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kJPHBsdWdpbnM+CisJCQkgPHBsdWdpbj4KKwkJCQk8Z3JvdXBJZD5vcmcuY29kZWhhdXMubW9qbzwvZ3JvdXBJZD4KKwkJCQk8YXJ0aWZhY3RJZD5zb25hci1tYXZlbi1wbHVnaW48L2FydGlmYWN0SWQ+CisJCQkJPHZlcnNpb24+My4yPC92ZXJzaW9uPgorCQkJPC9wbHVnaW4+CisJCQk8cGx1Z2luPgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDxncm91cElkPm9yZy5hcGFjaGUubWF2ZW4ucGx1Z2luczwvZ3JvdXBJZD4KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA8YXJ0aWZhY3RJZD5tYXZlbi1zaXRlLXBsdWdpbjwvYXJ0aWZhY3RJZD4KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA8dmVyc2lvbj4zLjY8L3ZlcnNpb24+CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPGRlcGVuZGVuY2llcz4KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDxkZXBlbmRlbmN5PgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA8Z3JvdXBJZD5vcmcuYXBhY2hlLm1hdmVuLndhZ29uPC9ncm91cElkPgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA8YXJ0aWZhY3RJZD53YWdvbi13ZWJkYXYtamFja3JhYmJpdDwvYXJ0aWZhY3RJZD4KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPHZlcnNpb24+Mi4xMDwvdmVyc2lvbj4KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDwvZGVwZW5kZW5jeT4KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA8L2RlcGVuZGVuY2llcz4KKyAgICAgICAgICAgIDwvcGx1Z2luPgorCQkJPHBsdWdpbj4KKwkJCQk8YXJ0aWZhY3RJZD5tYXZlbi1jb21waWxlci1wbHVnaW48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ICAgICAgICAgICAgICA8dmVyc2lvbj4zLjAuMTwvdmVyc2lvbj4KKyAgICAgICAgICAgICAgICAgPCEtLQorICAgICAgICAgICAgICAgICAgICAgICBZb3VyIG93biBwcm9wZXJ0eSBmaWxlcyBjYW4gYmUgcGxhY2VkIGluIGVjb21wLXBvcnRhbC1iZS8uLi8uLi9vdmVycmlkZXMgZGlyZWN0b3J5IGFuZCB0aGV5IAorICAgICAgICAgICAgICAgICAgICAgICB3aWxsIG92ZXJyaWRlIHRoZSBnZW5lcmljIHNvdXJjZSBjb250cm9sbGVkIHZlcnNpb25zIGF0IGJ1aWxkIHRpbWUgYWxsb3dpbmcKKyAgICAgICAgICAgICAgICAgICAgICAgeW91IHRvIHRlc3QgbG9jYWxseSB3aXRoIHlvdXIgb3duIHNldHRpbmdzLgorICAgICAgICAgICAgICAgICAgLS0+CisgICAgICAgICAgICAgICAgIDxleGVjdXRpb25zPgorICAgICAgICAgICAgICAgICAgICAgPGV4ZWN1dGlvbj4KKyAgICAgICAgICAgICAgICAgICAgICAgIDxpZD5jb3B5LWN1c3RvbS1wcm9wZXJ0aWVzMTwvaWQ+CisgICAgICAgICAgICAgICAgICAgICAgICA8cGhhc2U+cHJvY2Vzcy1yZXNvdXJjZXM8L3BoYXNlPgorICAgICAgICAgICAgICAgICAgICAgICAgPGdvYWxzPgorICAgICAgICAgICAgICAgICAgICAgICAgICAgIDxnb2FsPmNvcHktcmVzb3VyY2VzPC9nb2FsPgorICAgICAgICAgICAgICAgICAgICAgICAgPC9nb2Fscz4KKyAgICAgICAgICAgICAgICAgICAgICAgIDxjb25maWd1cmF0aW9uPgorICAgICAgICAgICAgICAgICAgICAgICAgICAgIDxvdmVyd3JpdGU+dHJ1ZTwvb3ZlcndyaXRlPgorICAgICAgICAgICAgICAgICAgICAgICAgICAgIDxvdXRwdXREaXJlY3Rvcnk+JHtiYXNlZGlyfS93YXIvV0VCLUlORi9jb25mPC9vdXRwdXREaXJlY3Rvcnk+CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgPHJlc291cmNlcz4KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPHJlc291cmNlPgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPGRpcmVjdG9yeT4ke2Jhc2VkaXJ9Ly4uLy4uL292ZXJyaWRlczwvZGlyZWN0b3J5PgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPGluY2x1ZGVzPgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDxpbmNsdWRlPnN5c3RlbS5wcm9wZXJ0aWVzPC9pbmNsdWRlPgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPC9pbmNsdWRlcz4KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPC9yZXNvdXJjZT4KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICA8L3Jlc291cmNlcz4KKyAgICAgICAgICAgICAgICAgICAgICAgIDwvY29uZmlndXJhdGlvbj4KKyAgICAgICAgICAgICAgICAgICAgIDwvZXhlY3V0aW9uPgorICAgICAgICAgICAgICAgICAgICAgPGV4ZWN1dGlvbj4KKyAgICAgICAgICAgICAgICAgICAgICAgIDxpZD5jb3B5LWN1c3RvbS1wcm9wZXJ0aWVzMjwvaWQ+CisgICAgICAgICAgICAgICAgICAgICAgICA8cGhhc2U+cHJvY2Vzcy1yZXNvdXJjZXM8L3BoYXNlPgorICAgICAgICAgICAgICAgICAgICAgICAgPGdvYWxzPgorICAgICAgICAgICAgICAgICAgICAgICAgICAgIDxnb2FsPmNvcHktcmVzb3VyY2VzPC9nb2FsPgorICAgICAgICAgICAgICAgICAgICAgICAgPC9nb2Fscz4KKyAgICAgICAgICAgICAgICAgICAgICAgIDxjb25maWd1cmF0aW9uPgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA8b3ZlcndyaXRlPnRydWU8L292ZXJ3cml0ZT4KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPG91dHB1dERpcmVjdG9yeT4ke2Jhc2VkaXJ9L3dhci9XRUItSU5GL2Z1c2lvbi9jb25mPC9vdXRwdXREaXJlY3Rvcnk+CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDxyZXNvdXJjZXM+CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA8cmVzb3VyY2U+CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPGRpcmVjdG9yeT4ke2Jhc2VkaXJ9Ly4uLy4uL292ZXJyaWRlczwvZGlyZWN0b3J5PgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDxpbmNsdWRlcz4KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPGluY2x1ZGU+ZnVzaW9uLnByb3BlcnRpZXM8L2luY2x1ZGU+CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPC9pbmNsdWRlcz4KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDwvcmVzb3VyY2U+CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDwvcmVzb3VyY2VzPgorICAgICAgICAgICAgICAgICAgICAgICAgPC9jb25maWd1cmF0aW9uPgorICAgICAgICAgICAgICAgICAgICAgPC9leGVjdXRpb24+CisgICAgICAgICAgICAgICAgICAgICA8ZXhlY3V0aW9uPgorICAgICAgICAgICAgICAgICAgICAgICAgPGlkPmNvcHktY3VzdG9tLXByb3BlcnRpZXMzPC9pZD4KKyAgICAgICAgICAgICAgICAgICAgICAgIDxwaGFzZT5wcm9jZXNzLXJlc291cmNlczwvcGhhc2U+CisgICAgICAgICAgICAgICAgICAgICAgICA8Z29hbHM+CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgPGdvYWw+Y29weS1yZXNvdXJjZXM8L2dvYWw+CisgICAgICAgICAgICAgICAgICAgICAgICA8L2dvYWxzPgorICAgICAgICAgICAgICAgICAgICAgICAgICAgIDxjb25maWd1cmF0aW9uPgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA8b3ZlcndyaXRlPnRydWU8L292ZXJ3cml0ZT4KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPG91dHB1dERpcmVjdG9yeT4ke2Jhc2VkaXJ9L3NyYy9tYWluL3Jlc291cmNlczwvb3V0cHV0RGlyZWN0b3J5PgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA8cmVzb3VyY2VzPgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPHJlc291cmNlPgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDxkaXJlY3Rvcnk+JHtiYXNlZGlyfS8uLi8uLi9vdmVycmlkZXM8L2RpcmVjdG9yeT4KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA8aW5jbHVkZXM+CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDxpbmNsdWRlPnBvcnRhbC5wcm9wZXJ0aWVzPC9pbmNsdWRlPgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA8aW5jbHVkZT5vcGVuaWQtY29ubmVjdC5wcm9wZXJ0aWVzPC9pbmNsdWRlPiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDxpbmNsdWRlPm9wZW5pZC1rZXlzdG9yZS5qd2tzPC9pbmNsdWRlPiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPC9pbmNsdWRlcz4KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDwvcmVzb3VyY2U+CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDwvcmVzb3VyY2VzPgorICA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IgQEAKK01hbmlmZXN0LVZlcnNpb246IDEuMAorQ2xhc3MtUGF0aDogL1dFQi1JTkYvY29uZgpkaWZmIC0tZ2l0IGEvZWNvbXAtcG9ydGFsLUJFL3NyYy9tYWluL2phdmEvb3JnL29wZW5lY29tcC9wb3J0YWxhcHAvYXV0aGVudGljYXRpb24vTG9naW5TdHJhdGVneS5qYXZhIGIvZWNvbXAtcG9ydGFsLUJFL3NyYy9tYWluL2phdmEvb3JnL29wZW5lY29tcC9wb3J0YWxhcHAvYXV0aGVudGljYXRpb24vTG9naW5TdHJhdGVneS5qYXZhCm5ldyBmaWxlIG1vZGUgMTAwNjQ0CmluZGV4IDAwMDAwMDAuLjY5YmY1ZWMKLS0tIC9kZXYvbnVsbAorKysgYi9lY29tcC1wb3J0YWwtQkUvc3JjL21haW4vamF2YS9vcmcvb3BlbmVjb21wL3BvcnRhbGFwcC9hdXRoZW50aWNhdGlvbi9Mb2dpblN0cmF0ZWd5LmphdmEKQEAgLTAsMCArMSwyNyBAQAorLyotCisgKiA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorICogZUNPTVAgUG9ydGFsCisgKiA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorICogQ29weXJpZ2h0IChDKSAyMDE3IEFUJlQgSW50ZWxsZWN0dWFsIFByb3BlcnR5CisgKiA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorICogTGljZW5zZWQgdW5kZXIgdGhlIEFwYWNoZSBMaWNlbnNlLCBWZXJzaW9uIDIuMCAodGhlICJMaWNlbnNlIik7CisgKiB5b3UgbWF5IG5vdCB1c2UgdGhpcyBmaWxlIGV4Y2VwdCBpbiBjb21wbGlhbmNlIHdpdGgg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9lY29tcC1wb3J0YWwtQkUvc3JjL21haW4vamF2YS9vcmcvb3BlbmVjb21wL3BvcnRhbGFwcC9hdXRoZW50aWNhdGlvbi9PcGVuSWRDb25uZWN0TG9naW5TdHJhdGVneS5qYXZhIGIvZWNvbXAtcG9ydGFsLUJFL3NyYy9tYWluL2phdmEvb3JnL29wZW5lY29tcC9wb3J0YWxhcHAvYXV0aGVudGljYXRpb24vT3BlbklkQ29ubmVjdExvZ2luU3RyYXRlZ3kuamF2YQpuZXcgZmlsZSBtb2RlIDEwMDY0NAppbmRleCAwMDAwMDAwLi43NWFkZTQ3Ci0tLSAvZGV2L251bGwKKysrIGIvZWNvbXAtcG9ydGFsLUJFL3NyYy9tYWluL2phdmEvb3JnL29wZW5lY29tcC9wb3J0YWxhcHAvYXV0aGVudGljYXRpb24vT3BlbklkQ29ubmVjdExvZ2luU3RyYXRlZ3kuamF2YQpAQCAtMCwwICsxLDkxIEBACisvKi0KKyAqID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisgKiBlQ09NUCBQb3J0YWwKKyAqID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisgKiBDb3B5cmlnaHQgKEMpIDIwMTcgQVQmVCBJbnRlbGxlY3R1YWwgUHJvcGVydHkKKyAqID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisgKiBMaWNlbnNlZCB1bmRlciB0aGUgQXBhY2hlIExpY2Vuc2UsIFZlcnNpb24gMi4wICh0aGUgIkxpY2Vuc2UiKTsKKyAqIHlvdSBtYXkgbm90IHVzZSB0aGlzIGZpbGUgZXhjZXB0IGluIGNvbXBsaWFuY2Ugd2l0aCB0aGUgTGljZW5zZS4KKyAqIFlvdSBtYXkg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L2phdmEvb3JnL29wZW5lY29tcC9wb3J0YWxhcHAvYXV0aGVudGljYXRpb24vU2ltcGxlTG9naW5TdHJhdGVneS5qYXZhCkBAIC0wLDAgKzEsMTAxIEBACisvKi0KKyAqID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisgKiBlQ09NUCBQb3J0YWwKKyAqID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisgKiBDb3B5cmlnaHQgKEMpIDIwMTcgQVQmVCBJbnRlbGxlY3R1YWwgUHJvcGVydHkKKyAqID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisgKiBMaWNlbnNlZCB1bmRlciB0aGUgQXBhY2hlIExpY2Vuc2UsIFZlcnNpb24gMi4wICh0aGUgIkxpY2Vuc2UiKTsKKyAqIHlvdSBtYXkgbm90IHVzZSB0aGlzIGZpbGUgZXhjZXB0IGluIGNvbXBsaWFuY2Ugd2l0aCB0aGUgTGljZW5zZS4KKyAqIFlvdSBtYXkgb2J0YWluIGEgY29weSBvZiB0aGUgTGljZW5zZSBhdAorICogCisgKiAgICAgIGh0dHA6Ly93d3cuYXBhY2hlLm9yZy9saWNlbnNlcy9MSUNFTlNFLTIuMAorICogCisgKiBVbmxlc3MgcmVxdWlyZWQgYnkgYXBwbGljYWJsZSBsYXcgb3IgYWdyZWVkIHRvIGluIHdyaXRpbmcsIHNvZnR3YXJlCisgKiBkaXN0cmlidXRlZCB1bmRlciB0aGUgTGljZW5zZSBpcyBkaXN0cmlidXRlZCBvbiBhbiAiQVMgSVMiIEJBU0lTLAorICogV0lUSE9VVCBXQVJSQU5USUVTIE9SIENPTkRJVElPTlMgT0YgQU5ZIEtJTkQsIGVpdGhlciBleHByZXNzIG9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lSGFuZGxlKCkgd2hpbGUgcmVkaXJlY3RpbmcsIERldGFpbHM6ICIgKyBFY29tcFBvcnRhbFV0aWxzLmdldFN0YWNrVHJhY2UoZSkpOworCQkJfQorCQl9CisKKwkJcmV0dXJuIGZhbHNlOworCisJfQorfQpkaWZmIC0tZ2l0IGEvZWNvbXAtcG9ydGFsLUJFL3NyYy9tYWluL2phdmEvb3JnL29wZW5lY29tcC9wb3J0YWxhcHAvY29tbWFuZC9FUExvZ2luQmVhbi5qYXZhIGIvZWNvbXAtcG9ydGFsLUJFL3NyYy9tYWluL2phdmEvb3JnL29wZW5lY29tcC9wb3J0YWxhcHAvY29tbWFuZC9FUExvZ2luQmVhbi5qYXZhCm5ldyBmaWxlIG1vZGUgMTAwNjQ0CmluZGV4IDAwMDAwMDAuLmUzYmIxNDMKLS0tIC9kZXYvbnVsbAorKysgYi9lY29tcC1wb3J0YWwtQkUvc3JjL21haW4vamF2YS9vcmcvb3BlbmVjb21wL3BvcnRhbGFwcC9jb21tYW5kL0VQTG9naW5CZWFuLmphdmEKQEAgLTAsMCArMSwxODYgQEAKKy8qLQorICogPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKyAqIGVDT01QIFBvcnRhbAorICogPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKyAqIENvcHlyaWdodCAoQykgMjAxNyBBVCZUIEludGVsbGVjdHVhbCBQcm9wZXJ0eQorICogPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKyAqIExpY2Vuc2VkIHVuZGVyIHRoZSBBcGFjaGUgTGljZW5zZSwgVmVyc2lvbiAyLjAgKHRoZSAiTGljZW5zZSIpOworICogeW91IG1heSBub3QgdXNlIHRoaXM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gbG9naW5JZDsKKyAgICBwcml2YXRlIFN0cmluZyBsb2dpblB3ZDsKKyAgICBwcml2YXRlIFN0cmluZyBocmlkOworICAgIHByaXZhdGUgU3RyaW5nIG9yZ1VzZXJJZDsKKyAgICBwcml2YXRlIFN0cmluZyBzaXRlQWNjZXNzOworICAgIHByaXZhdGUgU3RyaW5nIGxvZ2luRXJyb3JNZXNzYWdlOworCisgICAgcHJpdmF0ZSBFUFVzZXIgdXNlcjsKKyAgICBwcml2YXRlIFNldDw/PiAgbWVudTsKKyAgICBwcml2YXRlIFNldDw/PiAgYnVzaW5lc3NEaXJlY3RNZW51OworCisgICAgLyoqCisgICAgICogZ2V0TG9naW5JZAorICAgICAqCisgICAgICogQHJldHVybiBTdHJpbmcKKyAgICAgKi8KKyAgICBwdWJsaWMgU3RyaW5nIGdldExvZ2luSWQoKSB7CisgICAgICAgIHJldHVybiBsb2dpbklkOworICAgIH0KKworICAgIC8qKgorICAgICAqIGdldExvZ2luUHdkCisgICAgICoKKyAgICAgKiBAcmV0dXJuIFN0cmluZworICAgICAqLworICAgIHB1YmxpYyBTdHJpbmcgZ2V0TG9naW5Qd2QoKSB7CisgICAgICAgIHJldHVybiBsb2dpblB3ZDsKKyAgICB9CisKKyAgICAvKioKKyAgICAgKiBnZXRNZW51CisgICAgICoKKyAgICAgKiBAcmV0dXJuIFNldAorICAgICAqLworICAgIHB1YmxpYyBTZXQ8Pz4gZ2V0TWVudSgpIHsKKyAgICAgICAgcmV0dXJuIG1lbnU7CisgICAgfQorCisgICAgLyoqCisgICAgICogZ2V0VXNlcgorICAgICAqCisgICAgICogQHJldHVybiBVc2VyCisgICAgICovCisgICAgcHVibGljIEVQVXNlciBnZXRVc2VyKCkgeworICAgICAgICByZXR1cm4gdXNlcjsKKyAgICB9CisKKyAgICAvKioKKyAgICAgKiBnZXRIcmlkCisgICAgICoKKyAgICAgKiBAcmV0dXJuIFN0cmluZworICAgICAqLworICAgIHB1YmxpYyBTdHJpbmcgZ2V0SHJpZCgpIHsKKyAgICAgICAgcmV0dXJuIGhyaWQ7CisgICAgfQorCisgICAgLyoqCisgICAgICogZ2V0U2l0ZUFjY2VzcworICAgICAqCisgICAgICogQHJldHVybiBTdHJpbmcKKyAgICAgKi8KKyAgICBwdWJsaWMgU3RyaW5nIGdldFNpdGVBY2Nlc3MoKSB7CisgICAgICAgIHJldHVybiBzaXRlQWNjZXNzOworICAgIH0KKworICAgIC8qKgorICAgICAqIGdldEJ1c2luZXNzRGlyZWN0TWVudQorICAgICAqCisgICAgICogQHJldHVybiBTZXQKKyAgICAgKi8KKyAgICBwdWJsaWMgU2V0PD8+IGdldEJ1c2luZXNzRGlyZWN0TWVudSgpIHsKKyAgICAgICAgcmV0dXJuIGJ1c2luZXNzRGlyZWN0TWVudTsKKyAgICB9CisKKyAgICAvKioKKyAgICAgKiBnZXRMb2dpbkVycm9yTWVzc2FnZQorICAgICAqCisgICAgICogQHJldHVybiBTdHJpbmcKKyAgICAgKi8KKyAgICBwdWJsaWMgU3RyaW5nIGdldExvZ2luRXJyb3JNZXNzYWdlKCkgeworICAgICAgICByZXR1cm4gbG9naW5FcnJvck1lc3NhZ2U7CisgICAgfQorCisgICAgcHVibGljIFN0cmluZyBnZXRPcmdVc2VySWQoKSB7CisgICAgICAgIHJldHVybiBvcmdVc2VySWQ7CisgICAgfQorCisgICAgLyoqCisgICAgICogc2V0TG9naW5JZAorICAgICAqCisgICAgICogQHBhcmFtIGxvZ2luSWQgU3RyaW5nCisgICAgICovCisgICAgcHVibGljIHZvaWQgc2V0TG9naW5JZChTdHJpbmcgbG9naW5JZCkgeworICAgICAgICB0aGlzLmxvZ2luSWQgPSBsb2dpbklkOworICAgIH0KKworICAgIC8qKgorICAgICAqIHNldExvZ2luUHdkCisgICAgICoKKyAgICAgKiBAcGFyYW0gbG9naW5Qd2QgU3RyaW5nCisgICAgICovCisgICAgcHVibGljIHZvaWQgc2V0TG9naW5Qd2QoU3RyaW5nIGxvZ2luUHdkKSB7CisgICAgICAgIHRoaXMubG9naW5Qd2QgPSBsb2dpblB3ZDsKKyAgICB9CisKKyAgICBwdWJsaWMgdm9pZCBzZXRNZW51KFNldDw/PiBtZW51KSB7CisgICAgICAgIHRoaXMubWVudSA9IG1lbnU7CisgICAgfQorCisgICAgLyoqCisgICAgICogc2V0VXNlcgorICAgICAqCisgICAgICogQHBhcmFtIHVzZXIgVXNlcgorICAgICAqLworICAgIHB1YmxpYyB2b2lkIHNldFVzZXIoRVBVc2VyIHVzZXIpIHsKKyAgICAgICAgdGhpcy51c2VyID0gdXNlcjsKKyAgICB9CisKKyAgICAvKioKKyAgICAgKiBzZXRIcmlkCisgICAgICoKKyAgICAgKiBAcGFyYW0gaHJpZCBTdHJpbmcKKyAgICAgKi8KKyAgICBwdWJsaWMgdm9pZCBzZXRIcmlkKFN0cmluZyBocmlkKSB7CisgICAgICAgIHRoaXMuaHJpZCA9IGhyaWQ7CisgICAgfQorCisgICAgLyoqCisgICAgICogc2V0U2l0ZUFjY2VzcworICAgICAqCisgICAgICogQHBhcmFtIHNpdGVBY2Nlc3MgU3RyaW5nCisgICAgICovCisgICAgcHVibGljIHZvaWQgc2V0U2l0ZUFjY2VzcyhTdHJpbmcgc2l0ZUFjY2VzcykgeworICAgICAgICB0aGlzLnNpdGVBY2Nlc3MgPSBzaXRlQWNjZXNzOworICAgIH0KKworICAgIC8qKgorICAgICAqIHNldEJ1c2luZXNzRGlyZWN0TWVudQorICAgICAqCisgICAgICogQHBhcmFtIGJ1c2luZXNzRGlyZWN0TWVudSBTZXQKKyAgICAgKi8KKyAgICBwdWJsaWMgdm9pZCBzZXRCdXNpbmVzc0RpcmVjdE1lbnUoU2V0PD8+IGJ1c2luZXNzRGlyZWN0TWVudSkgeworICAgICAgICB0aGlzLmJ1c2luZXNzRGlyZWN0TWVudSA9IGJ1c2luZXNzRGlyZWN0TWVudTsKKyAgICB9CisKKyAgICAvKioKKyAgICAgKiBzZXRMb2dpbkVycm9yTWVzc2FnZQorICAgICAqCisgICAgICogQHBhcmFtIGxvZ2luRXJyb3JNZXNzYWdlIFN0cmluZworICAgICAqLworICAgIHB1YmxpYyB2b2lkIHNldExvZ2luRXJyb3JNZXNzYWdlKFN0cmluZyBsb2dpbkVycm9yTWVzc2FnZSkgeworICAgICAgICB0aGlzLmxvZ2luRXJyb3JNZXNzYWdlID0gbG9naW5FcnJvck1lc3NhZ2U7CisgICAgfQorCisgICAgcHVibGljIHZvaWQgc2V0T3JnVXNlcklkKFN0cmluZyBvcmdVc2VySWQpIHsKKyAgICAgICAgdGhpcy5vcmdVc2VySWQgPSBvcmdVc2VySWQ7CisgICAgfQorfQorCmRpZmYgLS1naXQgYS9lY29tcC1wb3J0YWwtQkUvc3JjL21haW4vamF2YS9vcmcvb3BlbmVjb21wL3BvcnRhbGFwcC9jb21tYW5kL1Bvc3RTZWFyY2hCZWFuLmphdmEgYi9lY29tcC1wb3J0YWwtQkUvc3JjL21haW4vamF2YS9vcmcvb3BlbmVjb21wL3BvcnRhbGFwcC9jb21tYW5kL1Bvc3RTZWFyY2hCZWFuLmphdmEKbmV3IGZpbGUgbW9kZSAxMDA2NDQKaW5kZXggMDAwMDAwMC4uMGY1ODgwNwotLS0gL2Rldi9udWxsCisrKyBiL2Vjb21wLXBvcnRhbC1CRS9zcmMvbWFpbi9qYXZhL29yZy9vcGVuZWNvbXAvcG9ydGFsYXBwL2NvbW1hbmQvUG9zdFNlYXJjaEJlYW4uamF2YQpAQCAtMCwwICsxLDM3MyBAQAorLyotCisgKiA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorICogZUNPTVAgUG9ydGFsCisgKiA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorICogQ29weXJpZ2h0IChDKSAyMDE3IEFUJlQgSW50ZWxsZWN0dWFsIFByb3BlcnR5CisgKi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AgIH0JLy8gUG9zdFNlYXJjaEJlYW4KKworCisgICAgcHVibGljIFN0cmluZyBnZXRGaXJzdE5hbWUoKSAgICAgICAgICAgICAgICAgICAgICB7IHJldHVybiB1c2VyLmdldEZpcnN0TmFtZSgpOyB9CisgICAgcHVibGljIFN0cmluZyBnZXRMYXN0TmFtZSgpICAgICAgICAgICAgICAgICAgICAgICB7IHJldHVybiB1c2VyLmdldExhc3ROYW1lKCk7IH0KKyAgICBwdWJsaWMgU3RyaW5nIGdldEhyaWQoKSAgICAgICAgICAgICAgICAgICAgICAgICAgIHsgcmV0dXJuIHVzZXIuZ2V0SHJpZCgpOyB9CisgICAgcHVibGljIFN0cmluZyBnZXRPcmdVc2VySWQoKSAgICAgICAgICAgICAgICAgICAgICB7IHJldHVybiB1c2VyLmdldE9yZ1VzZXJJZCgpOyB9CisgICAgcHVibGljIFN0cmluZyBnZXRPcmdDb2RlKCkgICAgICAgICAgICAgICAgICAgICAgICB7IHJldHVybiB1c2VyLmdldE9yZ0NvZGUoKTsgfQorICAgIHB1YmxpYyBTdHJpbmcgZ2V0RW1haWwoKSAgICAgICAgICAgICAgICAgICAgICAgICAgeyByZXR1cm4gdXNlci5nZXRFbWFpbCgpOyB9CisgICAgcHVibGljIFN0cmluZyBnZXRPcmdNYW5hZ2VyVXNlcklkKCkgICAgICAgICAgICAgICAgICB7IHJldHVybiB1c2VyLmdldE9yZ01hbmFnZXJVc2VySWQoKTsgfQorICAgIAorICAgIHB1YmxpYyBTdHJpbmcgZ2V0Rmlyc3ROYW1lT3JpZygpICAgICAgICAgICAgICAgICAgeyByZXR1cm4gdXNlci5nZXRGaXJzdE5hbWUoKTsgfQorICAgIHB1YmxpYyBTdHJpbmcgZ2V0TGFzdE5hbWVPcmlnKCkgICAgICAgICAgICAgICAgICAgeyByZXR1cm4gdXNlci5nZXRMYXN0TmFtZSgpOyB9CisgICAgcHVibGljIFN0cmluZyBnZXRIcmlkT3JpZygpICAgICAgICAgICAgICAgICAgICAgICB7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KKyAgICB9CisKKyAgICBwdWJsaWMgU3RyaW5nW10gZ2V0UG9zdFBob25lKCkgeworICAgICAgICByZXR1cm4gcG9zdFBob25lOworICAgIH0KKworICAgIHB1YmxpYyBTdHJpbmdbXSBnZXRQb3N0T3JnVXNlcklkKCkgeworICAgICAgICByZXR1cm4gcG9zdE9yZ1VzZXJJZDsKKyAgICB9CisKKyAgICBwdWJsaWMgU3RyaW5nW10gZ2V0U2VsZWN0ZWQoKSB7CisgICAgICAgIHJldHVybiBzZWxlY3RlZDsKKyAgICB9CisKKyAgICBwdWJsaWMgU3RyaW5nW10gZ2V0UG9zdEFkZHJlc3MxKCkgeworICAgICAgICByZXR1cm4gcG9zdEFkZHJlc3MxOworICAgIH0KKworICAgIHB1YmxpYyBTdHJpbmdbXSBnZXRQb3N0QnVzaW5lc3NDb3VudHJ5Q29kZSgpIHsKKyAgICAgICAgcmV0dXJuIHBvc3RCdXNpbmVzc0NvdW50cnlDb2RlOworICAgIH0KKworICAgIHB1YmxpYyBTdHJpbmdbXSBnZXRQb3N0Q2l0eSgpIHsKKyAgICAgICAgcmV0dXJuIHBvc3RDaXR5OworICAgIH0KKworICAgIHB1YmxpYyBTdHJpbmdbXSBnZXRQb3N0Q29tbWFuZENoYWluKCkgeworICAgICAgICByZXR1cm4gcG9zdENvbW1hbmRDaGFpbjsKKyAgICB9CisKKyAgICBwdWJsaWMgU3RyaW5nW10gZ2V0UG9zdENvbXBhbnkoKSB7CisgICAgICAgIHJldHVybiBwb3N0Q29tcGFueTsKKyAgICB9CisKKyAgICBwdWJsaWMgU3RyaW5nW10gZ2V0UG9zdENvbXBhbnlDb2RlKCkgeworICAgICAgICByZXR1cm4gcG9zdENvbXBhbnlDb2RlOworICAgIH0KKworICAgIHB1YmxpYyBTdHJpbmdbXSBnZXRQb3N0RGVwYXJ0bWVudCgpIHsKKyAgICAgICAgcmV0dXJuIHBvc3REZXBhcnRtZW50OworICAgIH0KKworICAgIHB1YmxpYyBTdHJpbmdbXSBn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Z01hbmFnZXJVc2VySWQoKSkuZXF1YWxzKFV0aWxpdGllcy5udmwodXNlck9yaWcuZ2V0T3JnTWFuYWdlclVzZXJJZCgpKSkmJgorICAgICAgICAgICAgICAgIHRydWUpKTsKKyAgICAgICB9IC8vIGlzQ3JpdGVyaWFVcGRhdGVkCisKK30JLy8gUG9zdFNlYXJjaEJlYW4KZGlmZiAtLWdpdCBhL2Vjb21wLXBvcnRhbC1CRS9zcmMvbWFpbi9qYXZhL29yZy9vcGVuZWNvbXAvcG9ydGFsYXBwL2NvbmYvRXh0ZXJuYWxBcHBDb25maWcuamF2YSBiL2Vjb21wLXBvcnRhbC1CRS9zcmMvbWFpbi9qYXZhL29yZy9vcGVuZWNvbXAvcG9ydGFsYXBwL2NvbmYvRXh0ZXJuYWxBcHBDb25maWcuamF2YQpuZXcgZmlsZSBtb2RlIDEwMDY0NAppbmRleCAwMDAwMDAwLi41YmNiNDMwCi0tLSAvZGV2L251bGwKKysrIGIvZWNvbXAtcG9ydGFsLUJFL3NyYy9tYWluL2phdmEvb3JnL29wZW5lY29tcC9wb3J0YWxhcHAvY29uZi9FeHRlcm5hbEFwcENvbmZpZy5qYXZhCkBAIC0wLDAgKzEsMzExIEBACisvKi0KKyAqID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisgKiBlQ09NUCBQb3J0YWwKKyAqID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisgKiBDb3B5cmlnaHQgKEMpIDIwMTcgQVQmVCBJbnRlbGxlY3R1YWwgUHJvcGVydHkKKyAqID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisgKiBMaWNlbnNlZCB1bmRlciB0aGUgQXBhY2hlIExpY2Vuc2UsI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ZmYgLS1naXQgYS9lY29tcC1wb3J0YWwtQkUvc3JjL21haW4vamF2YS9vcmcvb3BlbmVjb21wL3BvcnRhbGFwcC9jb25mL0V4dGVybmFsQXBwSW5pdGlhbGl6ZXIuamF2YSBiL2Vjb21wLXBvcnRhbC1CRS9zcmMvbWFpbi9qYXZhL29yZy9vcGVuZWNvbXAvcG9ydGFsYXBwL2NvbmYvRXh0ZXJuYWxBcHBJbml0aWFsaXplci5qYXZhCm5ldyBmaWxlIG1vZGUgMTAwNjQ0CmluZGV4IDAwMDAwMDAuLmMxYmM3Y2YKLS0tIC9kZXYvbnVsbAorKysgYi9lY29tcC1wb3J0YWwtQkUvc3JjL21haW4vamF2YS9vcmcvb3BlbmVjb21wL3BvcnRhbGFwcC9jb25mL0V4dGVybmFsQXBwSW5pdGlhbGl6ZXIuamF2YQpAQCAtMCwwICsxLDYwIEBACisvKi0KKyAqID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisgKiBlQ09NUCBQb3J0YWwKKyAqID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisgKiBDb3B5cmlnaHQgKEMpIDIwMTcgQVQmVCBJbnRlbGxlY3R1YWwgUHJvcGVydHkKKyAqID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisgKiBMaWNlbnNlZCB1bmRlciB0aGUgQXBhY2hlIExpY2Vuc2UsIFZlcnNpb24gMi4wICh0aGUgIkxpY2Vuc2UiKTsKKyAqIHlvdSBtYXkgbm90IHVzZSB0aGlzIGZpbGUgZXhjZXB0IGluIGNvbXBsaWFuY2Ugd2l0aCB0aGUgTGljZW5zZS4KKyAqIFlvdSBtYXkgb2J0YWluIGEgY29weSBvZiB0aGUgTGljZW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0YWxhcHAvY29uZi9IaWJlcm5hdGVNYXBwaW5nTG9jYXRpb25zLmphdmEgYi9lY29tcC1wb3J0YWwtQkUvc3JjL21haW4vamF2YS9vcmcvb3BlbmVjb21wL3BvcnRhbGFwcC9jb25mL0hpYmVybmF0ZU1hcHBpbmdMb2NhdGlvbnMuamF2YQpuZXcgZmlsZSBtb2RlIDEwMDY0NAppbmRleCAwMDAwMDAwLi4zZWI4OGY5Ci0tLSAvZGV2L251bGwKKysrIGIvZWNvbXAtcG9ydGFsLUJFL3NyYy9tYWluL2phdmEvb3JnL29wZW5lY29tcC9wb3J0YWxhcHAvY29uZi9IaWJlcm5hdGVNYXBwaW5nTG9jYXRpb25zLmphdmEKQEAgLTAsMCArMSwzOCBAQAorLyotCisgKiA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorICogZUNPTVAgUG9ydGFsCisgKiA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorICogQ29weXJpZ2h0IChDKSAyMDE3IEFUJlQgSW50ZWxsZWN0dWFsIFByb3BlcnR5CisgKiA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorICogTGljZW5zZWQgdW5kZXIgdGhlIEFwYWNoZSBMaWNlbnNlLCBWZXJzaW9uIDIuMCAodGhlICJMaWNlbnNlIik7CisgKiB5b3UgbWF5IG5vdCB1c2UgdGhpcyBmaWxlIGV4Y2VwdCBpbiBjb21wbGlhbmNlIHdpdGggdGhlIExpY2Vuc2UuCisgKiBZb3UgbWF5IG9idGFpbiBhIGNvcHkgb2YgdGhlIExpY2Vuc2UgYXQKKyAqIAorICogICAgICBodHRwOi8vd3d3LmFwYWNoZS5vcmcvbGljZW5zZXMvTElDRU5TRS0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EhpYmVybmF0ZU1hcHBpbmdMb2NhdGFibGUgeworCisJcHVibGljIFJlc291cmNlW10gZ2V0TWFwcGluZ0xvY2F0aW9ucygpIHsKKwkJcmV0dXJuIG5ldyBSZXNvdXJjZVtdIHsgbmV3IENsYXNzUGF0aFJlc291cmNlKCIuLi9mdXNpb24vb3JtL0Z1c2lvbi5oYm0ueG1sIiksCisJCQkJbmV3IENsYXNzUGF0aFJlc291cmNlKCIuLi9mdXNpb24vb3JtL0VQLmhibS54bWwiKSwKKwkJCQluZXcgQ2xhc3NQYXRoUmVzb3VyY2UoIi4uL2Z1c2lvbi9vcm0vV29ya2Zsb3cuaGJtLnhtbCIpIH07CisJfQorCit9CmRpZmYgLS1naXQgYS9lY29tcC1wb3J0YWwtQkUvc3JjL21haW4vamF2YS9vcmcvb3BlbmVjb21wL3BvcnRhbGFwcC9jb250cm9sbGVyL0VDT01QTG9nb3V0Q29udHJvbGxlci5qYXZhIGIvZWNvbXAtcG9ydGFsLUJFL3NyYy9tYWluL2phdmEvb3JnL29wZW5lY29tcC9wb3J0YWxhcHAvY29udHJvbGxlci9FQ09NUExvZ291dENvbnRyb2xsZXIuamF2YQpuZXcgZmlsZSBtb2RlIDEwMDY0NAppbmRleCAwMDAwMDAwLi4xMzI0MmMyCi0tLSAvZGV2L251bGwKKysrIGIvZWNvbXAtcG9ydGFsLUJFL3NyYy9tYWluL2phdmEvb3JnL29wZW5lY29tcC9wb3J0YWxhcHAvY29udHJvbGxlci9FQ09NUExvZ291dENvbnRyb2xsZXIuamF2YQpAQCAtMCwwICsxLDExMiBAQAorLyotCisgKiA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorICogZUNPTVAgUG9ydGFsCisgKiA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorICogQ29weXJpZ2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XRpbHMuZ2V0VXNlclNlc3Npb24ocmVxdWVzdCkpOworCX0KKwkKKwlwdWJsaWMgRVBVc2VyIGdldFVzZXIoKSB7CisJCXJldHVybiB1c2VyOworCX0KKwkKKwlwdWJsaWMgdm9pZCBzZXRVc2VyKEVQVXNlciB1c2VyKSB7CisJCXRoaXMudXNlciA9IHVzZXI7CisJfQorfQpkaWZmIC0tZ2l0IGEvZWNvbXAtcG9ydGFsLUJFL3NyYy9tYWluL2phdmEvb3JnL29wZW5lY29tcC9wb3J0YWxhcHAvY29udHJvbGxlci9FUEZ1c2lvbkJhc2VDb250cm9sbGVyLmphdmEgYi9lY29tcC1wb3J0YWwtQkUvc3JjL21haW4vamF2YS9vcmcvb3BlbmVjb21wL3BvcnRhbGFwcC9jb250cm9sbGVyL0VQRnVzaW9uQmFzZUNvbnRyb2xsZXIuamF2YQpuZXcgZmlsZSBtb2RlIDEwMDY0NAppbmRleCAwMDAwMDAwLi5mMzRmZDA3Ci0tLSAvZGV2L251bGwKKysrIGIvZWNvbXAtcG9ydGFsLUJFL3NyYy9tYWluL2phdmEvb3JnL29wZW5lY29tcC9wb3J0YWxhcHAvY29udHJvbGxlci9FUEZ1c2lvbkJhc2VDb250cm9sbGVyLmphdmEKQEAgLTAsMCArMSwxMDYgQEAKKy8qLQorICogPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKyAqIGVDT01QIFBvcnRhbAorICogPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKyAqIENvcHlyaWdodCAoQykgMjAxNyBBVCZUIEludGVsbGVjdHVhbCBQcm9wZXJ0eQorICogPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKyAqIExpY2Vuc2VkIH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T09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisgKiBlQ09NUCBQb3J0YWwKKyAqID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisgKiBDb3B5cmlnaHQgKEMpIDIwMTcgQVQmVCBJbnRlbGxlY3R1YWwgUHJvcGVydHkKKyAqID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisgKiBMaWNlbnNlZCB1bmRlciB0aGUgQXBhY2hlIExpY2Vuc2UsIFZlcnNpb24gMi4wICh0aGUgIkxpY2Vuc2UiKTsKKyAqIHlvdSBtYXkgbm90IHVzZSB0aGlzIGZpbGUgZXhjZXB0IGluIGNvbXBsaWFuY2Ugd2l0aCB0aGUgTGljZW5zZS4KKyAqIFlvdSBtYXkgb2J0YWluIGEgY29weSBvZiB0aGUgTGljZW5zZSBhdAorICogCisgKiAgICAgIGh0dHA6Ly93d3cuYXBhY2hlLm9yZy9saWNlbnNlcy9MSUNFTlNFLTIuMAorICogCisgKiBVbmxlc3MgcmVxdWlyZWQgYnkgYXBwbGljYWJsZSBsYXcgb3IgYWdyZWVkIHRvIGluIHdyaXRpbmcsIHNvZnR3YXJlCisgKiBkaXN0cmlidXRlZCB1bmRlciB0aGUgTGljZW5zZSBpcyBkaXN0cmlidXRlZCBvbiBhbiAiQVMgSVMiIEJBU0lTLAorICogV0lUSE9VVCBXQVJSQU5USUVTIE9SIENPTkRJVElPTlMgT0YgQU5ZIEtJTkQsIGVpdGhlciBleHByZXNzIG9yIGltcGxpZWQuCisgKiBTZWUgdGhlIExpY2Vuc2UgZm9yIHRoZSBzcGVjaWZpYyBsYW5ndWFnZSBnb3Zlcm5pbmcgcGVybWlzc2lvbnMgYW5kCisgKiBsaW1pdGF0aW9ucyB1bmRlciB0aGUgTGljZW5zZS4KKyAqID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisgKi8KK3BhY2thZ2Ugb3JnLm9wZW5lY29tcC5wb3J0YWxhcHAuY29udHJvbGxlcjsKKworcHVibGljIGNsYXNzIEVQUmVzdHJpY3RlZEJhc2VDb250cm9sbGVyIGV4dGVuZHMgRVBGdXNpb25CYXNlQ29udHJvbGxlcnsKKwkKKwlwcm90ZWN0ZWQgU3RyaW5nIHZpZXdOYW1lOworCXByaXZhdGUgU3RyaW5nIGV4Y2VwdGlvblZpZXc7CisJCisJQE92ZXJyaWRlCisJcHVibGljIGJvb2xlYW4gaXNBY2Nlc3NpYmxlKCkgeworCQlyZXR1cm4gZmFsc2U7CisJfQorCQorCUBPdmVycmlkZQorCXB1YmxpYyBib29sZWFuIGlzUkVTVGZ1bENhbGwoKXsKKwkJcmV0dXJuIGZhbHNlOworCX0KKwkKKwlwcm90ZWN0ZWQgU3RyaW5nIGdldFZpZXdOYW1lKCkgeworCQlyZXR1cm4gdmlld05hbWU7CisJfQorCQorCXByb3RlY3RlZCB2b2lkIHNldFZpZXdOYW1lKFN0cmluZyB2aWV3TmFtZSkgeworCQl0aGlzLnZpZXdOYW1lID0gdmlld05hbWU7CisJfQorCisJcHVibGljIFN0cmluZyBnZXRFeGNlcHRpb25WaWV3KCkgeworICAgICAgICByZXR1cm4gKGV4Y2VwdGlvblZpZXcgPT0gbnVsbCkgPyAicnVudGltZV9lcnJvcl9oYW5kbGVyIiA6IGV4Y2VwdGlvblZpZXc7CisJfQorCisJcHVibGljIHZvaWQgc2V0RXhjZXB0aW9uVmlldyhTdHJpbmcgZXhjZXB0aW9uVmlldykgeworCQl0aGlzLmV4Y2VwdGlvblZpZXcgPSBleGNlcHRpb25WaWV3OworCX0KK30KZGlmZiAtLWdpdCBhL2Vjb21wLXBvcnRhbC1CRS9zcmMvbWFpbi9qYXZhL29yZy9vcGVuZWNvbXAvcG9ydGFsYXBwL2NvbnRyb2xsZXIvRVBSZXN0cmljdGVkUkVTVGZ1bEJhc2VDb250cm9sbGVyLmphdmEgYi9lY29tcC1wb3J0YWwtQkUvc3JjL21haW4vamF2YS9vcmcvb3BlbmVjb21wL3BvcnRhbGFwcC9jb250cm9sbGVyL0VQUmVzdHJpY3RlZFJFU1RmdWxCYXNlQ29udHJvbGxlci5qYXZhCm5ldyBmaWxlIG1vZGUgMTAwNjQ0CmluZGV4IDAwMDAwMDAuLjY5NTA0YTEKLS0tIC9kZXYvbnVsbAorKysgYi9lY29tcC1wb3J0YWwtQkUvc3JjL21haW4vamF2YS9vcmcvb3BlbmVjb21wL3BvcnRhbGFwcC9jb250cm9sbGVyL0VQUmVzdHJpY3RlZFJFU1RmdWxCYXNlQ29udHJvbGxlci5qYXZhCkBAIC0wLDAgKzEsNTQgQEAKKy8qLQorICogPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKyAqIGVDT01QIFBvcnRhbAorICogPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKyAqIENvcHlyaWdodCAoQykgMjAxNyBBVCZUIEludGVsbGVjdHVhbCBQcm9wZXJ0eQorICogPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKyAqIExpY2Vuc2VkIHVuZGVyIHRoZSBBcGFjaGUgTGljZW5zZSwgVmVyc2lvbiAyLjAgKHRoZSAiTGljZW5zZSIpOworICogeW91IG1heSBub3QgdXNlIHRoaXMgZmlsZSBleGNlcHQgaW4gY29tcGxpYW5jZSB3aXRoIHRoZSBMaWNlbnNlLgorICogWW91IG1heSBvYnRhaW4gYSBjb3B5IG9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T09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisgKiBlQ09NUCBQb3J0YWwKKyAqID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisgKiBDb3B5cmlnaHQgKEMpIDIwMTcgQVQmVCBJbnRlbGxlY3R1YWwgUHJvcGVydHkKKyAqID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisgKiBMaWNlbnNlZCB1bmRlciB0aGUgQXBhY2hlIExpY2Vuc2UsIFZlcnNpb24gMi4wICh0aGUgIkxpY2Vuc2UiKTsKKyAqIHlvdSBtYXkgbm90IHVzZSB0aGlzIGZpbGUgZXhjZXB0IGluIGNvbXBsaWFuY2Ugd2l0aCB0aGUgTGljZW5zZS4KKyAqIFlvdSBtYXkgb2J0YWluIGEgY29weSBvZiB0aGUgTGljZW5zZSBhdAorICogCisgKiAgICAgIGh0dHA6Ly93d3cuYXBhY2hlLm9yZy9saWNlbnNlcy9MSUNFTlNFLTIuMAorICogCisgKiBVbmxlc3MgcmVxdWlyZWQgYnkgYXBwbGljYWJsZSBsYXcgb3IgYWdyZWVkIHRvIGluIHdyaXRpbmcsIHNvZnR3YXJlCisgKiBkaXN0cmlidXRlZCB1bmRlciB0aGUgTGljZW5zZSBpcyBkaXN0cmlidXRlZCBvbiBhbiAiQVMgSVMiIEJBU0lTLAorICogV0lUSE9VVCBXQVJSQU5USUVTIE9SIENPTkRJVElPTlMgT0YgQU5ZIEtJTkQsIGVpdGhlciBleHByZXNzIG9yIGltcGxpZWQuCisgKiBTZWUgdGhlIExpY2Vuc2UgZm9yIHRoZSBzcGVjaWZpYyBsYW5ndWFnZSBnb3Zlcm5pbmcgcGVybWlzc2lvbnMgYW5kCisgKiBsaW1pdGF0aW9ucyB1bmRlciB0aGUgTGljZW5zZS4KKyAqID09PT09PT09PT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xvZ2luQ29udHJvbGxlci5qYXZhCkBAIC0wLDAgKzEsMzU2IEBACisvKi0KKyAqID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisgKiBlQ09NUCBQb3J0YWwKKyAqID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisgKiBDb3B5cmlnaHQgKEMpIDIwMTcgQVQmVCBJbnRlbGxlY3R1YWwgUHJvcGVydHkKKyAqID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisgKiBMaWNlbnNlZCB1bmRlciB0aGUgQXBhY2hlIExpY2Vuc2UsIFZlcnNpb24gMi4wICh0aGUgIkxpY2Vuc2UiKTsKKyAqIHlvdSBtYXkgbm90IHVzZSB0aGlzIGZpbGUgZXhjZXB0IGluIGNvbXBsaWFuY2Ugd2l0aCB0aGUgTGljZW5zZS4KKyAqIFlvdSBtYXkgb2J0YWluIGEgY29weSBvZiB0aGUgTGljZW5zZSBhdAorICogCisgKiAgICAgIGh0dHA6Ly93d3cuYXBhY2hlLm9yZy9saWNlbnNlcy9MSUNFTlNFLTIuMAorICogCisgKiBVbmxlc3MgcmVxdWlyZWQgYnkgYXBwbGljYWJsZSBsYXcgb3IgYWdyZWVkIHRvIGluIHdyaXRpbmcsIHNvZnR3YXJlCisgKiBkaXN0cmlidXRlZCB1bmRlciB0aGUgTGljZW5zZSBpcyBkaXN0cmlidXRlZCBvbiBhbiAiQVMgSVMiIEJBU0lTLAorICogV0lUSE9VVCBXQVJSQU5USUVTIE9SIENPTkRJVElPTlMgT0YgQU5ZIEtJTkQsIGVpdGhlciBleHByZXNzIG9yIGltcGxpZWQuCisgKiBTZWUgdGhlIExpY2Vuc2UgZm9yIHRoZSBzcGVjaWZpY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cnZpY2U7CisgICAgfQorCisJcHVibGljIFNoYXJlZENvbnRleHRTZXJ2aWNlIGdldFNoYXJlZENvbnRleHRTZXJ2aWNlKCkgeworCQlyZXR1cm4gc2hhcmVkQ29udGV4dFNlcnZpY2U7CisJfQorCisJcHVibGljIHZvaWQgc2V0U2hhcmVkQ29udGV4dFNlcnZpY2UoU2hhcmVkQ29udGV4dFNlcnZpY2Ugc2hhcmVkQ29udGV4dFNlcnZpY2UpIHsKKwkJdGhpcy5zaGFyZWRDb250ZXh0U2VydmljZSA9IHNoYXJlZENvbnRleHRTZXJ2aWNlOworCX0KKyAgICAKKworCit9CmRpZmYgLS1naXQgYS9lY29tcC1wb3J0YWwtQkUvc3JjL21haW4vamF2YS9vcmcvb3BlbmVjb21wL3BvcnRhbGFwcC9jb250cm9sbGVyL0xvZ2luU2VydmljZS5qYXZhIGIvZWNvbXAtcG9ydGFsLUJFL3NyYy9tYWluL2phdmEvb3JnL29wZW5lY29tcC9wb3J0YWxhcHAvY29udHJvbGxlci9Mb2dpblNlcnZpY2UuamF2YQpuZXcgZmlsZSBtb2RlIDEwMDY0NAppbmRleCAwMDAwMDAwLi5mNjk5MTZhCi0tLSAvZGV2L251bGwKKysrIGIvZWNvbXAtcG9ydGFsLUJFL3NyYy9tYWluL2phdmEvb3JnL29wZW5lY29tcC9wb3J0YWxhcHAvY29udHJvbGxlci9Mb2dpblNlcnZpY2UuamF2YQpAQCAtMCwwICsxLDM2IEBACisvKi0KKyAqID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisgKiBlQ09NUCBQb3J0YWwKKyAqID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisgKiBDb3B5cmlnaHQgKEMpIDIwMTcgQVQmVCBJbnRlbGxlY3R1YWwgUHJvcGVydHkKKyAqID09PT09P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tYWluL2phdmEvb3JnL29wZW5lY29tcC9wb3J0YWxhcHAvY29udHJvbGxlci9PcGVuQ29sbGFib3JhdGlvbkNvbnRyb2xsZXIuamF2YQpAQCAtMCwwICsxLDQ4IEBACisvKi0KKyAqID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisgKiBlQ09NUCBQb3J0YWwKKyAqID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisgKiBDb3B5cmlnaHQgKEMpIDIwMTcgQVQmVCBJbnRlbGxlY3R1YWwgUHJvcGVydHkKKyAqID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisgKiBMaWNlbnNlZCB1bmRlciB0aGUgQXBhY2hlIExpY2Vuc2UsIFZlcnNpb24gMi4wICh0aGUgIkxpY2Vuc2UiKTsKKyAqIHlvdSBtYXkgbm90IHVzZSB0aGlzIGZpbGUgZXhjZXB0IGluIGNvbXBsaWFuY2Ugd2l0aCB0aGUgTGljZW5zZS4KKyAqIFlvdSBtYXkgb2J0YWluIGEgY29weSBvZiB0aGUgTGljZW5zZSBhdAorICogCisgKiAgICAgIGh0dHA6Ly93d3cuYXBhY2hlLm9yZy9saWNlbnNlcy9MSUNFTlNFLTIuMAorICogCisgKiBVbmxlc3MgcmVxdWlyZWQgYnkgYXBwbGljYWJsZSBsYXcgb3IgYWdyZWVkIHRvIGluIHdyaXRpbmcsIHNvZnR3YXJlCisgKiBkaXN0cmlidXRlZCB1bmRlciB0aGUgTGljZW5zZSBpcyBkaXN0cmlidXRlZCBvbiBhbiAiQVMgSVMiIEJBU0lTLAorICogV0lUSE9VVCBXQVJSQU5USUVTIE9SIENPTkRJVElPTlMgT0YgQU5ZIEtJTkQsIGVpdGhlciBleH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GIvZWNvbXAtcG9ydGFsLUJFL3NyYy9tYWluL2phdmEvb3JnL29wZW5lY29tcC9wb3J0YWxhcHAvY29udHJvbGxlci9QZWVyQnJvYWRjYXN0U29ja2V0LmphdmEKQEAgLTAsMCArMSwxMDYgQEAKKy8qLQorICogPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKyAqIGVDT01QIFBvcnRhbAorICogPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKyAqIENvcHlyaWdodCAoQykgMjAxNyBBVCZUIEludGVsbGVjdHVhbCBQcm9wZXJ0eQorICogPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKyAqIExpY2Vuc2VkIHVuZGVyIHRoZSBBcGFjaGUgTGljZW5zZSwgVmVyc2lvbiAyLjAgKHRoZSAiTGljZW5zZSIpOworICogeW91IG1heSBub3QgdXNlIHRoaXMgZmlsZSBleGNlcHQgaW4gY29tcGxpYW5jZSB3aXRoIHRoZSBMaWNlbnNlLgorICogWW91IG1heSBvYnRhaW4gYSBjb3B5IG9mIHRoZSBMaWNlbnNlIGF0CisgKiAKKyAqICAgICAgaHR0cDovL3d3dy5hcGFjaGUub3JnL2xpY2Vuc2VzL0xJQ0VOU0UtMi4wCisgKiAKKyAqIFVubGVzcyByZXF1aXJlZCBieSBhcHBsaWNhYmxlIGxhdyBvciBhZ3JlZWQgdG8gaW4gd3JpdGluZywgc29mdHdhcmUKKyAqIGRpc3RyaWJ1dGVkIHVuZGVyIHRoZSBMaWNlbnNlIGlzIGRpc3RyaWJ1dGVkIG9uIGFuICJBUyBJUyIgQkFTSVMsCisgKiBXSVRIT1VUIFdBUlJBTlRJRVMgT1IgQ09ORElUSU9OUyBPRiBBTl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isgKiBlQ09NUCBQb3J0YWwKKyAqID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisgKiBDb3B5cmlnaHQgKEMpIDIwMTcgQVQmVCBJbnRlbGxlY3R1YWwgUHJvcGVydHkKKyAqID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisgKiBMaWNlbnNlZCB1bmRlciB0aGUgQXBhY2hlIExpY2Vuc2UsIFZlcnNpb24gMi4wICh0aGUgIkxpY2Vuc2UiKTsKKyAqIHlvdSBtYXkgbm90IHVzZSB0aGlzIGZpbGUgZXhjZXB0IGluIGNvbXBsaWFuY2Ugd2l0aCB0aGUgTGljZW5zZS4KKyAqIFlvdSBtYXkgb2J0YWluIGEgY29weSBvZiB0aGUgTGljZW5zZSBhdAorICogCisgKiAgICAgIGh0dHA6Ly93d3cuYXBhY2hlLm9yZy9saWNlbnNlcy9MSUNFTlNFLTIuMAorICogCisgKiBVbmxlc3MgcmVxdWlyZWQgYnkgYXBwbGljYWJsZSBsYXcgb3IgYWdyZWVkIHRvIGluIHdyaXRpbmcsIHNvZnR3YXJlCisgKiBkaXN0cmlidXRlZCB1bmRlciB0aGUgTGljZW5zZSBpcyBkaXN0cmlidXRlZCBvbiBhbiAiQVMgSVMiIEJBU0lTLAorICogV0lUSE9VVCBXQVJSQU5USUVTIE9SIENPTkRJVElPTlMgT0YgQU5ZIEtJTkQsIGVpdGhlciBleHByZXNzIG9yIGltcGxpZWQuCisgKiBTZWUgdGhlIExpY2Vuc2UgZm9yIHRoZSBzcGVjaWZpYyBsYW5ndWFnZSBnb3Zlcm5pbmcgcGVybWlzc2lvbnMgYW5kCisgKiBsaW1pdGF0aW9ucyB1bmRlciB0aGUgTGljZW5zZS4KKyAqID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT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09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisgKiBDb3B5cmlnaHQgKEMpIDIwMTcgQVQmVCBJbnRlbGxlY3R1YWwgUHJvcGVydHkKKyAqID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisgKiBMaWNlbnNlZCB1bmRlciB0aGUgQXBhY2hlIExpY2Vuc2UsIFZlcnNpb24gMi4wICh0aGUgIkxpY2Vuc2UiKTsKKyAqIHlvdSBtYXkgbm90IHVzZSB0aGlzIGZpbGUgZXhjZXB0IGluIGNvbXBsaWFuY2Ugd2l0aCB0aGUgTGljZW5zZS4KKyAqIFlvdSBtYXkgb2J0YWluIGEgY29weSBvZiB0aGUgTGljZW5zZSBhdAorICogCisgKiAgICAgIGh0dHA6Ly93d3cuYXBhY2hlLm9yZy9saWNlbnNlcy9MSUNFTlNFLTIuMAorICogCisgKiBVbmxlc3MgcmVxdWlyZWQgYnkgYXBwbGljYWJsZSBsYXcgb3IgYWdyZWVkIHRvIGluIHdyaXRpbmcsIHNvZnR3YXJlCisgKiBkaXN0cmlidXRlZCB1bmRlciB0aGUgTGljZW5zZSBpcyBkaXN0cmlidXRlZCBvbiBhbiAiQVMgSVMiIEJBU0lTLAorICogV0lUSE9VVCBXQVJSQU5USUVTIE9SIENPTkRJVElPTlMgT0YgQU5ZIEtJTkQsIGVpdGhlciBleHByZXNzIG9yIGltcGxpZWQuCisgKiBTZWUgdGhlIExpY2Vuc2UgZm9yIHRoZSBzcGVjaWZpYyBsYW5ndWFnZSBnb3Zlcm5pbmcgcGVybWlzc2lvbnMgYW5kCisgKiBsaW1pdGF0aW9ucyB1bmRlciB0aGUgTGljZW5zZS4KKyAqID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisgKi8KK3BhY2thZ2Ugb3JnLm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ZWNvbXAvcG9ydGFsYXBwL2NvbnRyb2xsZXIvc2Vzc2lvbm1ndC9TZXNzaW9uQ29tbXVuaWNhdGlvbkNvbnRyb2xsZXIuamF2YQpuZXcgZmlsZSBtb2RlIDEwMDY0NAppbmRleCAwMDAwMDAwLi4wMzQ4ZmI4Ci0tLSAvZGV2L251bGwKKysrIGIvZWNvbXAtcG9ydGFsLUJFL3NyYy9tYWluL2phdmEvb3JnL29wZW5lY29tcC9wb3J0YWxhcHAvY29udHJvbGxlci9zZXNzaW9ubWd0L1Nlc3Npb25Db21tdW5pY2F0aW9uQ29udHJvbGxlci5qYXZhCkBAIC0wLDAgKzEsNjQgQEAKKy8qLQorICogPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKyAqIGVDT01QIFBvcnRhbAorICogPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKyAqIENvcHlyaWdodCAoQykgMjAxNyBBVCZUIEludGVsbGVjdHVhbCBQcm9wZXJ0eQorICogPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKyAqIExpY2Vuc2VkIHVuZGVyIHRoZSBBcGFjaGUgTGljZW5zZSwgVmVyc2lvbiAyLjAgKHRoZSAiTGljZW5zZSIpOworICogeW91IG1heSBub3QgdXNlIHRoaXMgZmlsZSBleGNlcHQgaW4gY29tcGxpYW5jZSB3aXRoIHRoZSBMaWNlbnNlLgorICogWW91IG1heSBvYnRhaW4gYSBjb3B5IG9mIHRoZSBMaWNlbnNlIGF0CisgKiAKKyAqICAgICAgaHR0cDovL3d3dy5hcGFjaGUub3JnL2xpY2Vuc2VzL0xJQ0VOU0UtMi4wCisgKiAKKyAqIFVubGVzcyByZXF1aXJlZCBieSBhcHB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F2YS9vcmcvb3BlbmVjb21wL3BvcnRhbGFwcC9rcGlkYXNoL2NvbnRyb2xsZXIvS3BpRGFzaGJvYXJkQ29udHJvbGxlci5qYXZhCm5ldyBmaWxlIG1vZGUgMTAwNjQ0CmluZGV4IDAwMDAwMDAuLmIzYTRmMGMKLS0tIC9kZXYvbnVsbAorKysgYi9lY29tcC1wb3J0YWwtQkUvc3JjL21haW4vamF2YS9vcmcvb3BlbmVjb21wL3BvcnRhbGFwcC9rcGlkYXNoL2NvbnRyb2xsZXIvS3BpRGFzaGJvYXJkQ29udHJvbGxlci5qYXZhCkBAIC0wLDAgKzEsMjY4IEBACisvKi0KKyAqID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisgKiBlQ09NUCBQb3J0YWwKKyAqID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisgKiBDb3B5cmlnaHQgKEMpIDIwMTcgQVQmVCBJbnRlbGxlY3R1YWwgUHJvcGVydHkKKyAqID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisgKiBMaWNlbnNlZCB1bmRlciB0aGUgQXBhY2hlIExpY2Vuc2UsIFZlcnNpb24gMi4wICh0aGUgIkxpY2Vuc2UiKTsKKyAqIHlvdSBtYXkgbm90IHVzZSB0aGlzIGZpbGUgZXhjZXB0IGluIGNvbXBsaWFuY2Ugd2l0aCB0aGUgTGljZW5zZS4KKyAqIFlvdSBtYXkgb2J0YWluIGEgY29weSBvZiB0aGUgTGljZW5zZSBhdAorICogCisgKiAgICAgIGh0dHA6Ly93d3cuYXBhY2hlLm9yZy9saWNlbnNlcy9MSUNFTlNFLTIuMAorICogCisgKiBVbmxlc3MgcmVxdWlyZWQgYnkgYXBwbGljYWJ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09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKyAqIENvcHlyaWdodCAoQykgMjAxNyBBVCZUIEludGVsbGVjdHVhbCBQcm9wZXJ0eQorICogPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKyAqIExpY2Vuc2VkIHVuZGVyIHRoZSBBcGFjaGUgTGljZW5zZSwgVmVyc2lvbiAyLjAgKHRoZSAiTGljZW5zZSIpOworICogeW91IG1heSBub3QgdXNlIHRoaXMgZmlsZSBleGNlcHQgaW4gY29tcGxpYW5jZSB3aXRoIHRoZSBMaWNlbnNlLgorICogWW91IG1heSBvYnRhaW4gYSBjb3B5IG9mIHRoZSBMaWNlbnNlIGF0CisgKiAKKyAqICAgICAgaHR0cDovL3d3dy5hcGFjaGUub3JnL2xpY2Vuc2VzL0xJQ0VOU0UtMi4wCisgKiAKKyAqIFVubGVzcyByZXF1aXJlZCBieSBhcHBsaWNhYmxlIGxhdyBvciBhZ3JlZWQgdG8gaW4gd3JpdGluZywgc29mdHdhcmUKKyAqIGRpc3RyaWJ1dGVkIHVuZGVyIHRoZSBMaWNlbnNlIGlzIGRpc3RyaWJ1dGVkIG9uIGFuICJBUyBJUyIgQkFTSVMsCisgKiBXSVRIT1VUIFdBUlJBTlRJRVMgT1IgQ09ORElUSU9OUyBPRiBBTlkgS0lORCwgZWl0aGVyIGV4cHJlc3Mgb3IgaW1wbGllZC4KKyAqIFNlZSB0aGUgTGljZW5zZSBmb3IgdGhlIHNwZWNpZmljIGxhbmd1YWdlIGdvdmVybmluZyBwZXJtaXNzaW9ucyBhbmQKKyAqIGxpbWl0YXRpb25zIHVuZGVyIHRoZSBMaWNlbnNlLgorICogPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKy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GFsQXBpKSB7CisJCXRoaXMudG90YWxBcGkgPSB0b3RhbEFwaTsKKwl9CisKKwlwdWJsaWMgU3RyaW5nIGdldENvbW1lbnQoKSB7CisJCXJldHVybiBjb21tZW50OworCX0KKworCXB1YmxpYyB2b2lkIHNldENvbW1lbnQoU3RyaW5nIGNvbW1lbnQpIHsKKwkJdGhpcy5jb21tZW50ID0gY29tbWVudDsKKwl9CisKK30KZGlmZiAtLWdpdCBhL2Vjb21wLXBvcnRhbC1CRS9zcmMvbWFpbi9qYXZhL29yZy9vcGVuZWNvbXAvcG9ydGFsYXBwL2twaWRhc2gvbW9kZWwvS3BpU2VydmljZVN1cHBvcnRlZC5qYXZhIGIvZWNvbXAtcG9ydGFsLUJFL3NyYy9tYWluL2phdmEvb3JnL29wZW5lY29tcC9wb3J0YWxhcHAva3BpZGFzaC9tb2RlbC9LcGlTZXJ2aWNlU3VwcG9ydGVkLmphdmEKbmV3IGZpbGUgbW9kZSAxMDA2NDQKaW5kZXggMDAwMDAwMC4uMWU3NjgzOQotLS0gL2Rldi9udWxsCisrKyBiL2Vjb21wLXBvcnRhbC1CRS9zcmMvbWFpbi9qYXZhL29yZy9vcGVuZWNvbXAvcG9ydGFsYXBwL2twaWRhc2gvbW9kZWwvS3BpU2VydmljZVN1cHBvcnRlZC5qYXZhCkBAIC0wLDAgKzEsNjAgQEAKKy8qLQorICogPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKyAqIGVDT01QIFBvcnRhbAorICogPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKyAqIENvcHlyaWdodCAoQykgMjAxNyBBVCZUIEludGVsbGVjdHVhbCBQcm9wZXJ0eQorICogPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09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JjL21haW4vamF2YS9vcmcvb3BlbmVjb21wL3BvcnRhbGFwcC9rcGlkYXNoL21vZGVsL0twaVVzZXJTdG9yeVN0YXRzLmphdmEKbmV3IGZpbGUgbW9kZSAxMDA2NDQKaW5kZXggMDAwMDAwMC4uZTQzMzdjYwotLS0gL2Rldi9udWxsCisrKyBiL2Vjb21wLXBvcnRhbC1CRS9zcmMvbWFpbi9qYXZhL29yZy9vcGVuZWNvbXAvcG9ydGFsYXBwL2twaWRhc2gvbW9kZWwvS3BpVXNlclN0b3J5U3RhdHMuamF2YQpAQCAtMCwwICsxLDEwNyBAQAorLyotCisgKiA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorICogZUNPTVAgUG9ydGFsCisgKiA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorICogQ29weXJpZ2h0IChDKSAyMDE3IEFUJlQgSW50ZWxsZWN0dWFsIFByb3BlcnR5CisgKiA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorICogTGljZW5zZWQgdW5kZXIgdGhlIEFwYWNoZSBMaWNlbnNlLCBWZXJzaW9uIDIuMCAodGhlICJMaWNlbnNlIik7CisgKiB5b3UgbWF5IG5vdCB1c2UgdGhpcyBmaWxlIGV4Y2VwdCBpbiBjb21wbGlhbmNlIHdpdGggdGhlIExpY2Vuc2UuCisgKiBZb3UgbWF5IG9idGFpbiBhIGNvcHkgb2YgdGhlIExpY2Vuc2UgYXQKKyAqIAorICogICAgICBodHRwOi8vd3d3LmFwYWNoZS5vcmcvbGljZW5zZXMvTElDRU5TRS0yLjAKKyAqIAorICogVW5sZXNzIHJlcXVpcmVkIGJ5IGFwcGxpY2FibGUgbGF3IG9yIGFncmVlZCB0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0aWVzLmphdmEKbmV3IGZpbGUgbW9kZSAxMDA2NDQKaW5kZXggMDAwMDAwMC4uYTZmODFmNAotLS0gL2Rldi9udWxsCisrKyBiL2Vjb21wLXBvcnRhbC1CRS9zcmMvbWFpbi9qYXZhL29yZy9vcGVuZWNvbXAvcG9ydGFsYXBwL2twaWRhc2gvbW9kZWwvS3BpZGFzaFByb3BlcnRpZXMuamF2YQpAQCAtMCwwICsxLDMzIEBACisvKi0KKyAqID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisgKiBlQ09NUCBQb3J0YWwKKyAqID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisgKiBDb3B5cmlnaHQgKEMpIDIwMTcgQVQmVCBJbnRlbGxlY3R1YWwgUHJvcGVydHkKKyAqID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisgKiBMaWNlbnNlZCB1bmRlciB0aGUgQXBhY2hlIExpY2Vuc2UsIFZlcnNpb24gMi4wICh0aGUgIkxpY2Vuc2UiKTsKKyAqIHlvdSBtYXkgbm90IHVzZSB0aGlzIGZpbGUgZXhjZXB0IGluIGNvbXBsaWFuY2Ugd2l0aCB0aGUgTGljZW5zZS4KKyAqIFlvdSBtYXkgb2J0YWluIGEgY29weSBvZiB0aGUgTGljZW5zZSBhdAorICogCisgKiAgICAgIGh0dHA6Ly93d3cuYXBhY2hlLm9yZy9saWNlbnNlcy9MSUNFTlNFLTIuMAorICogCisgKiBVbmxlc3MgcmVxdWlyZWQgYnkgYXBwbGljYWJsZSBsYXcgb3IgYWdyZWVkIHRvIGluIHdyaXRpbmcsIHNvZnR3YXJlCisgKiBkaXN0cmlidXRlZCB1bmRlciB0aGUgTGljZW5zZSBpcyB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jdGlvbmIiOworCXB1YmxpYyBzdGF0aWMgZmluYWwgU3RyaW5nIEdFT19BUElfVVJMID0gInVybC5nZW9tYXBhcGl1cmwiOworfQpkaWZmIC0tZ2l0IGEvZWNvbXAtcG9ydGFsLUJFL3NyYy9tYWluL2phdmEvb3JnL29wZW5lY29tcC9wb3J0YWxhcHAva3BpZGFzaC9zZXJ2aWNlL0twaURhc2hib2FyZFNlcnZpY2UuamF2YSBiL2Vjb21wLXBvcnRhbC1CRS9zcmMvbWFpbi9qYXZhL29yZy9vcGVuZWNvbXAvcG9ydGFsYXBwL2twaWRhc2gvc2VydmljZS9LcGlEYXNoYm9hcmRTZXJ2aWNlLmphdmEKbmV3IGZpbGUgbW9kZSAxMDA2NDQKaW5kZXggMDAwMDAwMC4uMTQ4OTJmNgotLS0gL2Rldi9udWxsCisrKyBiL2Vjb21wLXBvcnRhbC1CRS9zcmMvbWFpbi9qYXZhL29yZy9vcGVuZWNvbXAvcG9ydGFsYXBwL2twaWRhc2gvc2VydmljZS9LcGlEYXNoYm9hcmRTZXJ2aWNlLmphdmEKQEAgLTAsMCArMSw1NiBAQAorLyotCisgKiA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorICogZUNPTVAgUG9ydGFsCisgKiA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorICogQ29weXJpZ2h0IChDKSAyMDE3IEFUJlQgSW50ZWxsZWN0dWFsIFByb3BlcnR5CisgKiA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorICogTGljZW5zZWQgdW5kZXIgdGhlIEFwYWNoZSBMaWNlbnNlLCBWZXJzaW9uIDIuMCAodGhlICJMaWNlbnNlIik7CisgKiB5b3UgbWF5IG5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wL2twaWRhc2gvc2VydmljZS9LcGlEYXNoYm9hcmRTZXJ2aWNlSW1wbC5qYXZhCm5ldyBmaWxlIG1vZGUgMTAwNjQ0CmluZGV4IDAwMDAwMDAuLmVkYmM1NGEKLS0tIC9kZXYvbnVsbAorKysgYi9lY29tcC1wb3J0YWwtQkUvc3JjL21haW4vamF2YS9vcmcvb3BlbmVjb21wL3BvcnRhbGFwcC9rcGlkYXNoL3NlcnZpY2UvS3BpRGFzaGJvYXJkU2VydmljZUltcGwuamF2YQpAQCAtMCwwICsxLDE4MCBAQAorLyotCisgKiA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorICogZUNPTVAgUG9ydGFsCisgKiA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorICogQ29weXJpZ2h0IChDKSAyMDE3IEFUJlQgSW50ZWxsZWN0dWFsIFByb3BlcnR5CisgKiA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorICogTGljZW5zZWQgdW5kZXIgdGhlIEFwYWNoZSBMaWNlbnNlLCBWZXJzaW9uIDIuMCAodGhlICJMaWNlbnNlIik7CisgKiB5b3UgbWF5IG5vdCB1c2UgdGhpcyBmaWxlIGV4Y2VwdCBpbiBjb21wbGlhbmNlIHdpdGggdGhlIExpY2Vuc2UuCisgKiBZb3UgbWF5IG9idGFpbiBhIGNvcHkgb2YgdGhlIExpY2Vuc2UgYXQKKyAqIAorICogICAgICBodHRwOi8vd3d3LmFwYWNoZS5vcmcvbGljZW5zZXMvTElDRU5TRS0yLjAKKyAqIAorICogVW5sZXNzIHJlcXVpcmVkIGJ5IGFwcGxpY2FibGUgbGF3IG9yIGFncmVlZCB0byBpbiB3cml0aW5nLCBzb2Z0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G1vZGUgMTAwNjQ0CmluZGV4IDAwMDAwMDAuLjAwOWQwZmIKLS0tIC9kZXYvbnVsbAorKysgYi9lY29tcC1wb3J0YWwtQkUvc3JjL21haW4vamF2YS9vcmcvb3BlbmVjb21wL3BvcnRhbGFwcC9tb2RlbC9SZXN1bHQuamF2YQpAQCAtMCwwICsxLDM3IEBACisvKi0KKyAqID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisgKiBlQ09NUCBQb3J0YWwKKyAqID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisgKiBDb3B5cmlnaHQgKEMpIDIwMTcgQVQmVCBJbnRlbGxlY3R1YWwgUHJvcGVydHkKKyAqID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisgKiBMaWNlbnNlZCB1bmRlciB0aGUgQXBhY2hlIExpY2Vuc2UsIFZlcnNpb24gMi4wICh0aGUgIkxpY2Vuc2UiKTsKKyAqIHlvdSBtYXkgbm90IHVzZSB0aGlzIGZpbGUgZXhjZXB0IGluIGNvbXBsaWFuY2Ugd2l0aCB0aGUgTGljZW5zZS4KKyAqIFlvdSBtYXkgb2J0YWluIGEgY29weSBvZiB0aGUgTGljZW5zZSBhdAorICogCisgKiAgICAgIGh0dHA6Ly93d3cuYXBhY2hlLm9yZy9saWNlbnNlcy9MSUNFTlNFLTIuMAorICogCisgKiBVbmxlc3MgcmVxdWlyZWQgYnkgYXBwbGljYWJsZSBsYXcgb3IgYWdyZWVkIHRvIGluIHdyaXRpbmcsIHNvZnR3YXJlCisgKiBkaXN0cmlidXRlZCB1bmRlciB0aGUgTGljZW5zZSBpcyBkaXN0cmlidXRlZCBvbiBhbiAiQVMgSVMiIEJBU0lTLAorICogV0lU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BiL2Vjb21wLXBvcnRhbC1CRS9zcmMvbWFpbi9qYXZhL29yZy9vcGVuZWNvbXAvcG9ydGFsYXBwL3BvcnRhbC9jb250cm9sbGVyL0FwcENhdGFsb2dDb250cm9sbGVyLmphdmEKQEAgLTAsMCArMSwxMjQgQEAKKy8qLQorICogPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKyAqIGVDT01QIFBvcnRhbAorICogPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKyAqIENvcHlyaWdodCAoQykgMjAxNyBBVCZUIEludGVsbGVjdHVhbCBQcm9wZXJ0eQorICogPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKyAqIExpY2Vuc2VkIHVuZGVyIHRoZSBBcGFjaGUgTGljZW5zZSwgVmVyc2lvbiAyLjAgKHRoZSAiTGljZW5zZSIpOworICogeW91IG1heSBub3QgdXNlIHRoaXMgZmlsZSBleGNlcHQgaW4gY29tcGxpYW5jZSB3aXRoIHRoZSBMaWNlbnNlLgorICogWW91IG1heSBvYnRhaW4gYSBjb3B5IG9mIHRoZSBMaWNlbnNlIGF0CisgKiAKKyAqICAgICAgaHR0cDovL3d3dy5hcGFjaGUub3JnL2xpY2Vuc2VzL0xJQ0VOU0UtMi4wCisgKiAKKyAqIFVubGVzcyByZXF1aXJlZCBieSBhcHBsaWNhYmxlIGxhdyBvciBhZ3JlZWQgdG8gaW4gd3JpdGluZywgc29mdHdhcmUKKyAqIGRpc3RyaWJ1dGVkIHVuZGVyIHRoZSBMaWNlbnNlIGlzIGRpc3RyaWJ1dGVkIG9uIGFuICJBUyBJUyIgQkFTSVMsCisgKiBXSVRIT1VUIFdBUlJBTlRJRVMgT1IgQ09ORElUS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isrKyBiL2Vjb21wLXBvcnRhbC1CRS9zcmMvbWFpbi9qYXZhL29yZy9vcGVuZWNvbXAvcG9ydGFsYXBwL3BvcnRhbC9jb250cm9sbGVyL0FwcENvbnRhY3RVc0NvbnRyb2xsZXIuamF2YQpAQCAtMCwwICsxLDIyNCBAQAorLyotCisgKiA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorICogZUNPTVAgUG9ydGFsCisgKiA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorICogQ29weXJpZ2h0IChDKSAyMDE3IEFUJlQgSW50ZWxsZWN0dWFsIFByb3BlcnR5CisgKiA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorICogTGljZW5zZWQgdW5kZXIgdGhlIEFwYWNoZSBMaWNlbnNlLCBWZXJzaW9uIDIuMCAodGhlICJMaWNlbnNlIik7CisgKiB5b3UgbWF5IG5vdCB1c2UgdGhpcyBmaWxlIGV4Y2VwdCBpbiBjb21wbGlhbmNlIHdpdGggdGhlIExpY2Vuc2UuCisgKiBZb3UgbWF5IG9idGFpbiBhIGNvcHkgb2YgdGhlIExpY2Vuc2UgYXQKKyAqIAorICogICAgICBodHRwOi8vd3d3LmFwYWNoZS5vcmcvbGljZW5zZXMvTElDRU5TRS0yLjAKKyAqIAorICogVW5sZXNzIHJlcXVpcmVkIGJ5IGFwcGxpY2FibGUgbGF3IG9yIGFncmVlZCB0byBpbiB3cml0aW5nLCBzb2Z0d2FyZQorICogZGlzdHJpYnV0ZWQgdW5kZXIgdGhlIExpY2Vuc2UgaXMgZGlzdHJpYnV0ZWQgb24gYW4gIkFTIElTIiBCQVNJUywKKyAqIFdJVEhPVVQgV0FSUkFOVElFUyBPUiBD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bmc+KFBvcnRhbFJlc3RTdGF0dXNFbnVtLkVSUk9SLCBzYXZlQXBwQ29udGFjdFVzLCAiIik7CisJfQorCit9ClwgTm8gbmV3bGluZSBhdCBlbmQgb2YgZmlsZQpkaWZmIC0tZ2l0IGEvZWNvbXAtcG9ydGFsLUJFL3NyYy9tYWluL2phdmEvb3JnL29wZW5lY29tcC9wb3J0YWxhcHAvcG9ydGFsL2NvbnRyb2xsZXIvQXBwc0NvbnRyb2xsZXIuamF2YSBiL2Vjb21wLXBvcnRhbC1CRS9zcmMvbWFpbi9qYXZhL29yZy9vcGVuZWNvbXAvcG9ydGFsYXBwL3BvcnRhbC9jb250cm9sbGVyL0FwcHNDb250cm9sbGVyLmphdmEKbmV3IGZpbGUgbW9kZSAxMDA2NDQKaW5kZXggMDAwMDAwMC4uZjQ2MGNlNAotLS0gL2Rldi9udWxsCisrKyBiL2Vjb21wLXBvcnRhbC1CRS9zcmMvbWFpbi9qYXZhL29yZy9vcGVuZWNvbXAvcG9ydGFsYXBwL3BvcnRhbC9jb250cm9sbGVyL0FwcHNDb250cm9sbGVyLmphdmEKQEAgLTAsMCArMSw0NzAgQEAKKy8qLQorICogPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKyAqIGVDT01QIFBvcnRhbAorICogPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKyAqIENvcHlyaWdodCAoQykgMjAxNyBBVCZUIEludGVsbGVjdHVhbCBQcm9wZXJ0eQorICogPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKyAqIExpY2Vuc2VkIHVuZGVyIHRoZSBBcGFjaGUgTGljZW5zZSwgVmVyc2lvbiAyLjAgKHRoZSAiTGljZW5zZSIp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jg1YWMKLS0tIC9kZXYvbnVsbAorKysgYi9lY29tcC1wb3J0YWwtQkUvc3JjL21haW4vamF2YS9vcmcvb3BlbmVjb21wL3BvcnRhbGFwcC9wb3J0YWwvY29udHJvbGxlci9EYXNoYm9hcmRDb250cm9sbGVyLmphdmEKQEAgLTAsMCArMSwzNjEgQEAKKy8qLQorICogPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKyAqIGVDT01QIFBvcnRhbAorICogPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKyAqIENvcHlyaWdodCAoQykgMjAxNyBBVCZUIEludGVsbGVjdHVhbCBQcm9wZXJ0eQorICogPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKyAqIExpY2Vuc2VkIHVuZGVyIHRoZSBBcGFjaGUgTGljZW5zZSwgVmVyc2lvbiAyLjAgKHRoZSAiTGljZW5zZSIpOworICogeW91IG1heSBub3QgdXNlIHRoaXMgZmlsZSBleGNlcHQgaW4gY29tcGxpYW5jZSB3aXRoIHRoZSBMaWNlbnNlLgorICogWW91IG1heSBvYnRhaW4gYSBjb3B5IG9mIHRoZSBMaWNlbnNlIGF0CisgKiAKKyAqICAgICAgaHR0cDovL3d3dy5hcGFjaGUub3JnL2xpY2Vuc2VzL0xJQ0VOU0UtMi4wCisgKiAKKyAqIFVubGVzcyByZXF1aXJlZCBieSBhcHBsaWNhYmxlIGxhdyBvciBhZ3JlZWQgdG8gaW4gd3JpdGluZywgc29mdHdhcmUKKyAqIGRpc3RyaWJ1dGVkIHVuZGVyIHRoZSBMaWNlbnNlIGlzIGRpc3RyaWJ1dGVkIG9uIGFuICJBUyBJUyIgQkFTSVMsCisgKiBXSVRIT1VUIFdBU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L21haW4vamF2YS9vcmcvb3BlbmVjb21wL3BvcnRhbGFwcC9wb3J0YWwvY29udHJvbGxlci9EYXNoYm9hcmRTZWFyY2hSZXN1bHRDb250cm9sbGVyLmphdmEKbmV3IGZpbGUgbW9kZSAxMDA2NDQKaW5kZXggMDAwMDAwMC4uZDYwNTJiYwotLS0gL2Rldi9udWxsCisrKyBiL2Vjb21wLXBvcnRhbC1CRS9zcmMvbWFpbi9qYXZhL29yZy9vcGVuZWNvbXAvcG9ydGFsYXBwL3BvcnRhbC9jb250cm9sbGVyL0Rhc2hib2FyZFNlYXJjaFJlc3VsdENvbnRyb2xsZXIuamF2YQpAQCAtMCwwICsxLDI0MyBAQAorLyotCisgKiA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorICogZUNPTVAgUG9ydGFsCisgKiA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorICogQ29weXJpZ2h0IChDKSAyMDE3IEFUJlQgSW50ZWxsZWN0dWFsIFByb3BlcnR5CisgKiA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorICogTGljZW5zZWQgdW5kZXIgdGhlIEFwYWNoZSBMaWNlbnNlLCBWZXJzaW9uIDIuMCAodGhlICJMaWNlbnNlIik7CisgKiB5b3UgbWF5IG5vdCB1c2UgdGhpcyBmaWxlIGV4Y2VwdCBpbiBjb21wbGlhbmNlIHdpdGggdGhlIExpY2Vuc2UuCisgKiBZb3UgbWF5IG9idGFpbiBhIGNvcHkgb2YgdGhlIExpY2Vuc2UgYXQKKyAqIAorICogICAgICBodHRwOi8vd3d3LmFwYWNoZS5vcmcvbGljZW5zZXMvTElDRU5TRS0yLjAKKyAqIAorICogVW5sZXNzIHJlcXVpc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VuZWNvbXAvcG9ydGFsYXBwL3BvcnRhbC9jb250cm9sbGVyL0V4dGVybmFsQXBwc1Jlc3RmdWxDb250cm9sbGVyLmphdmEgYi9lY29tcC1wb3J0YWwtQkUvc3JjL21haW4vamF2YS9vcmcvb3BlbmVjb21wL3BvcnRhbGFwcC9wb3J0YWwvY29udHJvbGxlci9FeHRlcm5hbEFwcHNSZXN0ZnVsQ29udHJvbGxlci5qYXZhCm5ldyBmaWxlIG1vZGUgMTAwNjQ0CmluZGV4IDAwMDAwMDAuLjA4ODA0YTAKLS0tIC9kZXYvbnVsbAorKysgYi9lY29tcC1wb3J0YWwtQkUvc3JjL21haW4vamF2YS9vcmcvb3BlbmVjb21wL3BvcnRhbGFwcC9wb3J0YWwvY29udHJvbGxlci9FeHRlcm5hbEFwcHNSZXN0ZnVsQ29udHJvbGxlci5qYXZhCkBAIC0wLDAgKzEsMTI4IEBACisvKi0KKyAqID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisgKiBlQ09NUCBQb3J0YWwKKyAqID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisgKiBDb3B5cmlnaHQgKEMpIDIwMTcgQVQmVCBJbnRlbGxlY3R1YWwgUHJvcGVydHkKKyAqID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisgKiBMaWNlbnNlZCB1bmRlciB0aGUgQXBhY2hlIExpY2Vuc2UsIFZlcnNpb24gMi4wICh0aGUgIkxpY2Vuc2UiKTsKKyAqIHlvdSBtYXkgbm90IHVzZSB0aGlzIGZpbGUgZXhjZXB0IGluIGNvbXBsaWFuY2Ugd2l0aCB0aGUgTGljZW5zZS4KKyAqIFlvdSBtYXkgb2J0YWluIGEgY29weSBv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EX1JFUVVFU1QudmFsdWUoKSwgZS5nZXRNZXNzYWdlKCkpOworCX0KK30KZGlmZiAtLWdpdCBhL2Vjb21wLXBvcnRhbC1CRS9zcmMvbWFpbi9qYXZhL29yZy9vcGVuZWNvbXAvcG9ydGFsYXBwL3BvcnRhbC9jb250cm9sbGVyL0Z1bmN0aW9uYWxNZW51Q29udHJvbGxlci5qYXZhIGIvZWNvbXAtcG9ydGFsLUJFL3NyYy9tYWluL2phdmEvb3JnL29wZW5lY29tcC9wb3J0YWxhcHAvcG9ydGFsL2NvbnRyb2xsZXIvRnVuY3Rpb25hbE1lbnVDb250cm9sbGVyLmphdmEKbmV3IGZpbGUgbW9kZSAxMDA2NDQKaW5kZXggMDAwMDAwMC4uNmM2OWZkZQotLS0gL2Rldi9udWxsCisrKyBiL2Vjb21wLXBvcnRhbC1CRS9zcmMvbWFpbi9qYXZhL29yZy9vcGVuZWNvbXAvcG9ydGFsYXBwL3BvcnRhbC9jb250cm9sbGVyL0Z1bmN0aW9uYWxNZW51Q29udHJvbGxlci5qYXZhCkBAIC0wLDAgKzEsNDM2IEBACisvKi0KKyAqID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisgKiBlQ09NUCBQb3J0YWwKKyAqID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisgKiBDb3B5cmlnaHQgKEMpIDIwMTcgQVQmVCBJbnRlbGxlY3R1YWwgUHJvcGVydHkKKyAqID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisgKiBMaWNlbnNlZCB1bmRlciB0aGUgQXBhY2hlIExpY2Vuc2UsIFZlcnNpb24gMi4wICh0aGUgIkxpY2Vuc2UiKTsKKyAqIHlvdSBtYXkgbm90I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wMDAwMC4uNWZlMjIxOQotLS0gL2Rldi9udWxsCisrKyBiL2Vjb21wLXBvcnRhbC1CRS9zcmMvbWFpbi9qYXZhL29yZy9vcGVuZWNvbXAvcG9ydGFsYXBwL3BvcnRhbC9jb250cm9sbGVyL0dldEFjY2Vzc0NvbnRyb2xsZXIuamF2YQpAQCAtMCwwICsxLDcwIEBACisvKi0KKyAqID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisgKiBlQ09NUCBQb3J0YWwKKyAqID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisgKiBDb3B5cmlnaHQgKEMpIDIwMTcgQVQmVCBJbnRlbGxlY3R1YWwgUHJvcGVydHkKKyAqID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisgKiBMaWNlbnNlZCB1bmRlciB0aGUgQXBhY2hlIExpY2Vuc2UsIFZlcnNpb24gMi4wICh0aGUgIkxpY2Vuc2UiKTsKKyAqIHlvdSBtYXkgbm90IHVzZSB0aGlzIGZpbGUgZXhjZXB0IGluIGNvbXBsaWFuY2Ugd2l0aCB0aGUgTGljZW5zZS4KKyAqIFlvdSBtYXkgb2J0YWluIGEgY29weSBvZiB0aGUgTGljZW5zZSBhdAorICogCisgKiAgICAgIGh0dHA6Ly93d3cuYXBhY2hlLm9yZy9saWNlbnNlcy9MSUNFTlNFLTIuMAorICogCisgKiBVbmxlc3MgcmVxdWlyZWQgYnkgYXBwbGljYWJsZSBsYXcgb3IgYWdyZWVkIHRvIGluIHdyaXRpbmcsIHNvZnR3YXJlCisgKiBkaXN0cmlidXRlZCB1bmRlciB0aGUgTGljZW5zZSBpcyBkaXN0cmlidXRlZCBvbiBhbiAiQVMgSVMiIEJBU0lTLA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GVyL0hlYWx0aENoZWNrQ29udHJvbGxlci5qYXZhIGIvZWNvbXAtcG9ydGFsLUJFL3NyYy9tYWluL2phdmEvb3JnL29wZW5lY29tcC9wb3J0YWxhcHAvcG9ydGFsL2NvbnRyb2xsZXIvSGVhbHRoQ2hlY2tDb250cm9sbGVyLmphdmEKbmV3IGZpbGUgbW9kZSAxMDA2NDQKaW5kZXggMDAwMDAwMC4uYTM4NzA1MQotLS0gL2Rldi9udWxsCisrKyBiL2Vjb21wLXBvcnRhbC1CRS9zcmMvbWFpbi9qYXZhL29yZy9vcGVuZWNvbXAvcG9ydGFsYXBwL3BvcnRhbC9jb250cm9sbGVyL0hlYWx0aENoZWNrQ29udHJvbGxlci5qYXZhCkBAIC0wLDAgKzEsMjM0IEBACisvKi0KKyAqID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisgKiBlQ09NUCBQb3J0YWwKKyAqID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisgKiBDb3B5cmlnaHQgKEMpIDIwMTcgQVQmVCBJbnRlbGxlY3R1YWwgUHJvcGVydHkKKyAqID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisgKiBMaWNlbnNlZCB1bmRlciB0aGUgQXBhY2hlIExpY2Vuc2UsIFZlcnNpb24gMi4wICh0aGUgIkxpY2Vuc2UiKTsKKyAqIHlvdSBtYXkgbm90IHVzZSB0aGlzIGZpbGUgZXhjZXB0IGluIGNvbXBsaWFuY2Ugd2l0aCB0aGUgTGljZW5zZS4KKyAqIFlvdSBtYXkgb2J0YWluIGEgY29weSBvZiB0aGUgTGljZW5zZSBhdAorICogCisgKiAgICAgIGh0dHA6Ly93d3cuYXBhY2hlLm9yZy9saWNl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Jlc3BvbnNlLnB1dCgiZXJyb3IiLCAiZmFpbGVkIHRvIGdldCBtYW5pZmVzdDogIiArIGV4LnRvU3RyaW5nKCkpOworCQl9CisJCXJldHVybiByZXNwb25zZTsKKwl9CisKK30KZGlmZiAtLWdpdCBhL2Vjb21wLXBvcnRhbC1CRS9zcmMvbWFpbi9qYXZhL29yZy9vcGVuZWNvbXAvcG9ydGFsYXBwL3BvcnRhbC9jb250cm9sbGVyL1BvcnRhbEFkbWluQ29udHJvbGxlci5qYXZhIGIvZWNvbXAtcG9ydGFsLUJFL3NyYy9tYWluL2phdmEvb3JnL29wZW5lY29tcC9wb3J0YWxhcHAvcG9ydGFsL2NvbnRyb2xsZXIvUG9ydGFsQWRtaW5Db250cm9sbGVyLmphdmEKbmV3IGZpbGUgbW9kZSAxMDA2NDQKaW5kZXggMDAwMDAwMC4uOTUxYzA1MwotLS0gL2Rldi9udWxsCisrKyBiL2Vjb21wLXBvcnRhbC1CRS9zcmMvbWFpbi9qYXZhL29yZy9vcGVuZWNvbXAvcG9ydGFsYXBwL3BvcnRhbC9jb250cm9sbGVyL1BvcnRhbEFkbWluQ29udHJvbGxlci5qYXZhCkBAIC0wLDAgKzEsMTE3IEBACisvKi0KKyAqID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisgKiBlQ09NUCBQb3J0YWwKKyAqID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisgKiBDb3B5cmlnaHQgKEMpIDIwMTcgQVQmVCBJbnRlbGxlY3R1YWwgUHJvcGVydHkKKyAqID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisgKiBMaWNlbnNlZCB1bmRlciB0aGUgQXBhY2hlIExpY2Vuc2UsIFZl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G9ydGFsL2NvbnRyb2xsZXIvU2hhcmVkQ29udGV4dFJlc3RDb250cm9sbGVyLmphdmEKQEAgLTAsMCArMSwzMzUgQEAKKy8qLQorICogPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKyAqIGVDT01QIFBvcnRhbAorICogPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKyAqIENvcHlyaWdodCAoQykgMjAxNyBBVCZUIEludGVsbGVjdHVhbCBQcm9wZXJ0eQorICogPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKyAqIExpY2Vuc2VkIHVuZGVyIHRoZSBBcGFjaGUgTGljZW5zZSwgVmVyc2lvbiAyLjAgKHRoZSAiTGljZW5zZSIpOworICogeW91IG1heSBub3QgdXNlIHRoaXMgZmlsZSBleGNlcHQgaW4gY29tcGxpYW5jZSB3aXRoIHRoZSBMaWNlbnNlLgorICogWW91IG1heSBvYnRhaW4gYSBjb3B5IG9mIHRoZSBMaWNlbnNlIGF0CisgKiAKKyAqICAgICAgaHR0cDovL3d3dy5hcGFjaGUub3JnL2xpY2Vuc2VzL0xJQ0VOU0UtMi4wCisgKiAKKyAqIFVubGVzcyByZXF1aXJlZCBieSBhcHBsaWNhYmxlIGxhdyBvciBhZ3JlZWQgdG8gaW4gd3JpdGluZywgc29mdHdhcmUKKyAqIGRpc3RyaWJ1dGVkIHVuZGVyIHRoZSBMaWNlbnNlIGlzIGRpc3RyaWJ1dGVkIG9uIGFuICJBUyBJUyIgQkFTSVMsCisgKiBXSVRIT1VUIFdBUlJBTlRJRVMgT1IgQ09ORElUSU9OUyBPRiBBTlkgS0lORCwgZWl0aGVyIGV4cHJlc3Mgb3IgaW1wbGllZC4KKyAqIF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PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKyAqIENvcHlyaWdodCAoQykgMjAxNyBBVCZUIEludGVsbGVjdHVhbCBQcm9wZXJ0eQorICogPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKyAqIExpY2Vuc2VkIHVuZGVyIHRoZSBBcGFjaGUgTGljZW5zZSwgVmVyc2lvbiAyLjAgKHRoZSAiTGljZW5zZSIpOworICogeW91IG1heSBub3QgdXNlIHRoaXMgZmlsZSBleGNlcHQgaW4gY29tcGxpYW5jZSB3aXRoIHRoZSBMaWNlbnNlLgorICogWW91IG1heSBvYnRhaW4gYSBjb3B5IG9mIHRoZSBMaWNlbnNlIGF0CisgKiAKKyAqICAgICAgaHR0cDovL3d3dy5hcGFjaGUub3JnL2xpY2Vuc2VzL0xJQ0VOU0UtMi4wCisgKiAKKyAqIFVubGVzcyByZXF1aXJlZCBieSBhcHBsaWNhYmxlIGxhdyBvciBhZ3JlZWQgdG8gaW4gd3JpdGluZywgc29mdHdhcmUKKyAqIGRpc3RyaWJ1dGVkIHVuZGVyIHRoZSBMaWNlbnNlIGlzIGRpc3RyaWJ1dGVkIG9uIGFuICJBUyBJUyIgQkFTSVMsCisgKiBXSVRIT1VUIFdBUlJBTlRJRVMgT1IgQ09ORElUSU9OUyBPRiBBTlkgS0lORCwgZWl0aGVyIGV4cHJlc3Mgb3IgaW1wbGllZC4KKyAqIFNlZSB0aGUgTGljZW5zZSBmb3IgdGhlIHNwZWNpZmljIGxhbmd1YWdlIGdvdmVybmluZyBwZXJtaXNzaW9ucyBhbmQKKyAqIGxpbWl0YXRpb25zIHVuZGVyIHRoZSBMaWNlbnNlLgorICogPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKyA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21haW4vamF2YS9vcmcvb3BlbmVjb21wL3BvcnRhbGFwcC9wb3J0YWwvY29udHJvbGxlci9XaWRnZXRzQ29udHJvbGxlci5qYXZhIGIvZWNvbXAtcG9ydGFsLUJFL3NyYy9tYWluL2phdmEvb3JnL29wZW5lY29tcC9wb3J0YWxhcHAvcG9ydGFsL2NvbnRyb2xsZXIvV2lkZ2V0c0NvbnRyb2xsZXIuamF2YQpuZXcgZmlsZSBtb2RlIDEwMDY0NAppbmRleCAwMDAwMDAwLi5kZGFkZWY5Ci0tLSAvZGV2L251bGwKKysrIGIvZWNvbXAtcG9ydGFsLUJFL3NyYy9tYWluL2phdmEvb3JnL29wZW5lY29tcC9wb3J0YWxhcHAvcG9ydGFsL2NvbnRyb2xsZXIvV2lkZ2V0c0NvbnRyb2xsZXIuamF2YQpAQCAtMCwwICsxLDEzNCBAQAorLyotCisgKiA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorICogZUNPTVAgUG9ydGFsCisgKiA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorICogQ29weXJpZ2h0IChDKSAyMDE3IEFUJlQgSW50ZWxsZWN0dWFsIFByb3BlcnR5CisgKiA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorICogTGljZW5zZWQgdW5kZXIgdGhlIEFwYWNoZSBMaWNlbnNlLCBWZXJzaW9uIDIuMCAodGhlICJMaWNlbnNlIik7CisgKiB5b3UgbWF5IG5vdCB1c2UgdGhpcyBmaWxlIGV4Y2VwdCBpbiBjb21wbGlhbmNlIHdpdGggdGhlIExpY2Vuc2UuCisgKiBZb3UgbWF5IG9idGFpbiBhIGNvcHkgb2YgdGhlIExpY2Vuc2UgYXQKKyAqI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hCm5ldyBmaWxlIG1vZGUgMTAwNjQ0CmluZGV4IDAwMDAwMDAuLmFlNTVmNmYKLS0tIC9kZXYvbnVsbAorKysgYi9lY29tcC1wb3J0YWwtQkUvc3JjL21haW4vamF2YS9vcmcvb3BlbmVjb21wL3BvcnRhbGFwcC9wb3J0YWwvZG9tYWluL0FkbWluVXNlckFwcC5qYXZhCkBAIC0wLDAgKzEsODggQEAKKy8qLQorICogPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKyAqIGVDT01QIFBvcnRhbAorICogPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKyAqIENvcHlyaWdodCAoQykgMjAxNyBBVCZUIEludGVsbGVjdHVhbCBQcm9wZXJ0eQorICogPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKyAqIExpY2Vuc2VkIHVuZGVyIHRoZSBBcGFjaGUgTGljZW5zZSwgVmVyc2lvbiAyLjAgKHRoZSAiTGljZW5zZSIpOworICogeW91IG1heSBub3QgdXNlIHRoaXMgZmlsZSBleGNlcHQgaW4gY29tcGxpYW5jZSB3aXRoIHRoZSBMaWNlbnNlLgorICogWW91IG1heSBvYnRhaW4gYSBjb3B5IG9mIHRoZSBMaWNlbnNlIGF0CisgKiAKKyAqICAgICAgaHR0cDovL3d3dy5hcGFjaGUub3JnL2xpY2Vuc2VzL0xJQ0VOU0UtMi4wCisgKiAKKyAqIFVubGVzcyByZXF1aXJlZCBieSBhcHBsaWNhYmxlIGxhdyBvciBhZ3JlZWQgdG8gaW4gd3JpdGluZywgc29mdHdhcmUKKyAqIGRpc3RyaWJ1dGVkIHVuZGVyIHRoZSBMaWNlbnNlIGlzIGRpc3RyaWJ1dGVkIG9uIGF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2lkIHNldEFwcE5hbWUoU3RyaW5nIGFwcE5hbWUpIHsKKwkJdGhpcy5hcHBOYW1lID0gYXBwTmFtZTsKKwl9Cit9CmRpZmYgLS1naXQgYS9lY29tcC1wb3J0YWwtQkUvc3JjL21haW4vamF2YS9vcmcvb3BlbmVjb21wL3BvcnRhbGFwcC9wb3J0YWwvZG9tYWluL0FkbWluVXNlckFwcGxpY2F0aW9ucy5qYXZhIGIvZWNvbXAtcG9ydGFsLUJFL3NyYy9tYWluL2phdmEvb3JnL29wZW5lY29tcC9wb3J0YWxhcHAvcG9ydGFsL2RvbWFpbi9BZG1pblVzZXJBcHBsaWNhdGlvbnMuamF2YQpuZXcgZmlsZSBtb2RlIDEwMDY0NAppbmRleCAwMDAwMDAwLi4zYjQxNzlkCi0tLSAvZGV2L251bGwKKysrIGIvZWNvbXAtcG9ydGFsLUJFL3NyYy9tYWluL2phdmEvb3JnL29wZW5lY29tcC9wb3J0YWxhcHAvcG9ydGFsL2RvbWFpbi9BZG1pblVzZXJBcHBsaWNhdGlvbnMuamF2YQpAQCAtMCwwICsxLDk2IEBACisvKi0KKyAqID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisgKiBlQ09NUCBQb3J0YWwKKyAqID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisgKiBDb3B5cmlnaHQgKEMpIDIwMTcgQVQmVCBJbnRlbGxlY3R1YWwgUHJvcGVydHkKKyAqID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisgKiBMaWNlbnNlZCB1bmRlciB0aGUgQXBhY2hlIExpY2Vuc2UsIFZlcnNpb24gMi4wICh0aGUgIkxpY2Vuc2UiKTsKKyAqIHlvdSBtYXkgbm90IHV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GFsYXBwL3BvcnRhbC9kb21haW4vQXBwQ29udGFjdFVzLmphdmEgYi9lY29tcC1wb3J0YWwtQkUvc3JjL21haW4vamF2YS9vcmcvb3BlbmVjb21wL3BvcnRhbGFwcC9wb3J0YWwvZG9tYWluL0FwcENvbnRhY3RVcy5qYXZhCm5ldyBmaWxlIG1vZGUgMTAwNjQ0CmluZGV4IDAwMDAwMDAuLmNiNTMwM2MKLS0tIC9kZXYvbnVsbAorKysgYi9lY29tcC1wb3J0YWwtQkUvc3JjL21haW4vamF2YS9vcmcvb3BlbmVjb21wL3BvcnRhbGFwcC9wb3J0YWwvZG9tYWluL0FwcENvbnRhY3RVcy5qYXZhCkBAIC0wLDAgKzEsODYgQEAKKy8qLQorICogPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKyAqIGVDT01QIFBvcnRhbAorICogPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKyAqIENvcHlyaWdodCAoQykgMjAxNyBBVCZUIEludGVsbGVjdHVhbCBQcm9wZXJ0eQorICogPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKyAqIExpY2Vuc2VkIHVuZGVyIHRoZSBBcGFjaGUgTGljZW5zZSwgVmVyc2lvbiAyLjAgKHRoZSAiTGljZW5zZSIpOworICogeW91IG1heSBub3QgdXNlIHRoaXMgZmlsZSBleGNlcHQgaW4gY29tcGxpYW5jZSB3aXRoIHRoZSBMaWNlbnNlLgorICogWW91IG1heSBvYnRhaW4gYSBjb3B5IG9mIHRoZSBMaWNlbnNlIGF0CisgKiAKKyAqICAgICAgaHR0cDovL3d3dy5hcGFjaGUub3JnL2xpY2Vuc2VzL0xJQ0VOU0UtMi4wCisgKiAKKyAqIF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wlwcml2YXRlIFN0cmluZyB1cmw7CisJcHJpdmF0ZSBTdHJpbmcgYWN0aXZlWU47CisKKwlwdWJsaWMgRVBBcHAgZ2V0QXBwKCkgeworCQlyZXR1cm4gYXBwOworCX0KKworCXB1YmxpYyB2b2lkIHNldEFwcChFUEFwcCBhcHApIHsKKwkJdGhpcy5hcHAgPSBhcHA7CisJfQorCisJcHVibGljIFN0cmluZyBnZXREZXNjcmlwdGlvbigpIHsKKwkJcmV0dXJuIGRlc2NyaXB0aW9uOworCX0KKworCXB1YmxpYyB2b2lkIHNldERlc2NyaXB0aW9uKFN0cmluZyBkZXNjcmlwdGlvbikgeworCQl0aGlzLmRlc2NyaXB0aW9uID0gZGVzY3JpcHRpb247CisJfQorCisJcHVibGljIFN0cmluZyBnZXRDb250YWN0RW1haWwoKSB7CisJCXJldHVybiBjb250YWN0RW1haWw7CisJfQorCisJcHVibGljIHZvaWQgc2V0Q29udGFjdEVtYWlsKFN0cmluZyBjb250YWN0RW1haWwpIHsKKwkJdGhpcy5jb250YWN0RW1haWwgPSBjb250YWN0RW1haWw7CisJfQorCisJcHVibGljIFN0cmluZyBnZXRDb250YWN0TmFtZSgpIHsKKwkJcmV0dXJuIGNvbnRhY3ROYW1lOworCX0KKworCXB1YmxpYyB2b2lkIHNldENvbnRhY3ROYW1lKFN0cmluZyBjb250YWN0TmFtZSkgeworCQl0aGlzLmNvbnRhY3ROYW1lID0gY29udGFjdE5hbWU7CisJfQorCisJcHVibGljIFN0cmluZyBnZXRVcmwoKSB7CisJCXJldHVybiB1cmw7CisJfQorCisJcHVibGljIHZvaWQgc2V0VXJsKFN0cmluZyB1cmwpIHsKKwkJdGhpcy51cmwgPSB1cmw7CisJfQorCisJcHVibGljIFN0cmluZyBnZXRBY3RpdmVZTigpIHsKKwkJcmV0dXJuIGFjdGl2ZVlOOworCX0KKworCXB1YmxpYyB2b2lkIHNldEFjdGl2ZVlOKFN0cmluZyBhY3RpdmVZTikgeworCQl0aGlzLmFjdGl2ZVlOID0gYWN0aXZlWU47CisJfQorCit9CmRpZmYgLS1naXQgYS9lY29tcC1wb3J0YWwtQkUvc3JjL21haW4vamF2YS9vcmcvb3BlbmVjb21wL3BvcnRhbGFwcC9wb3J0YWwvZG9tYWluL0FwcENvbnRhY3RVc1RyYW5zcG9ydE1vZGVsLmphdmEgYi9lY29tcC1wb3J0YWwtQkUvc3JjL21haW4vamF2YS9vcmcvb3BlbmVjb21wL3BvcnRhbGFwcC9wb3J0YWwvZG9tYWluL0FwcENvbnRhY3RVc1RyYW5zcG9ydE1vZGVsLmphdmEKbmV3IGZpbGUgbW9kZSAxMDA2NDQKaW5kZXggMDAwMDAwMC4uZTM0ODMxMQotLS0gL2Rldi9udWxsCisrKyBiL2Vjb21wLXBvcnRhbC1CRS9zcmMvbWFpbi9qYXZhL29yZy9vcGVuZWNvbXAvcG9ydGFsYXBwL3BvcnRhbC9kb21haW4vQXBwQ29udGFjdFVzVHJhbnNwb3J0TW9kZWwuamF2YQpAQCAtMCwwICsxLDg0IEBACisvKi0KKyAqID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisgKiBlQ09NUCBQb3J0YWwKKyAqID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisgKiBDb3B5cmlnaHQgKEMpIDIwMTcgQVQmVCBJbnRlbGxlY3R1YWwgUHJvcGVydHkKKyAqID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisgKiBMaWNlbnNlZCB1bmRlciB0aGUgQXBhY2hlIExpY2Vuc2UsIFZlcnNpb24gMi4wICh0aGUgIkxpY2Vuc2UiKTsKKyAqIHlvdSBtYXkgbm90IHVzZSB0aGlzIGZpbGUgZXhjZXB0IGluIGNvbXBsaW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HBOYW1lID0gYXBwTmFtZTsKKwl9CisKKwlwdWJsaWMgTG9uZyBnZXRBcHBJZCgpIHsKKwkJcmV0dXJuIGFwcElkOworCX0KKworCXB1YmxpYyB2b2lkIHNldEFwcElkKExvbmcgYXBwSWQpIHsKKwkJdGhpcy5hcHBJZCA9IGFwcElkOworCX0KKworfQpkaWZmIC0tZ2l0IGEvZWNvbXAtcG9ydGFsLUJFL3NyYy9tYWluL2phdmEvb3JnL29wZW5lY29tcC9wb3J0YWxhcHAvcG9ydGFsL2RvbWFpbi9BcHBJZEFuZE5hbWVUcmFuc3BvcnRNb2RlbC5qYXZhIGIvZWNvbXAtcG9ydGFsLUJFL3NyYy9tYWluL2phdmEvb3JnL29wZW5lY29tcC9wb3J0YWxhcHAvcG9ydGFsL2RvbWFpbi9BcHBJZEFuZE5hbWVUcmFuc3BvcnRNb2RlbC5qYXZhCm5ldyBmaWxlIG1vZGUgMTAwNjQ0CmluZGV4IDAwMDAwMDAuLjUyMDA1ZTgKLS0tIC9kZXYvbnVsbAorKysgYi9lY29tcC1wb3J0YWwtQkUvc3JjL21haW4vamF2YS9vcmcvb3BlbmVjb21wL3BvcnRhbGFwcC9wb3J0YWwvZG9tYWluL0FwcElkQW5kTmFtZVRyYW5zcG9ydE1vZGVsLmphdmEKQEAgLTAsMCArMSw2MyBAQAorLyotCisgKiA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorICogZUNPTVAgUG9ydGFsCisgKiA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorICogQ29weXJpZ2h0IChDKSAyMDE3IEFUJlQgSW50ZWxsZWN0dWFsIFByb3BlcnR5CisgKiA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT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kZSAxMDA2NDQKaW5kZXggMDAwMDAwMC4uOTBkOGU5NgotLS0gL2Rldi9udWxsCisrKyBiL2Vjb21wLXBvcnRhbC1CRS9zcmMvbWFpbi9qYXZhL29yZy9vcGVuZWNvbXAvcG9ydGFsYXBwL3BvcnRhbC9kb21haW4vQXBwc1Jlc3BvbnNlLmphdmEKQEAgLTAsMCArMSw3NiBAQAorLyotCisgKiA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorICogZUNPTVAgUG9ydGFsCisgKiA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorICogQ29weXJpZ2h0IChDKSAyMDE3IEFUJlQgSW50ZWxsZWN0dWFsIFByb3BlcnR5CisgKiA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorICogTGljZW5zZWQgdW5kZXIgdGhlIEFwYWNoZSBMaWNlbnNlLCBWZXJzaW9uIDIuMCAodGhlICJMaWNlbnNlIik7CisgKiB5b3UgbWF5IG5vdCB1c2UgdGhpcyBmaWxlIGV4Y2VwdCBpbiBjb21wbGlhbmNlIHdpdGggdGhlIExpY2Vuc2UuCisgKiBZb3UgbWF5IG9idGFpbiBhIGNvcHkgb2YgdGhlIExpY2Vuc2UgYXQKKyAqIAorICogICAgICBodHRwOi8vd3d3LmFwYWNoZS5vcmcvbGljZW5zZXMvTElDRU5TRS0yLjAKKyAqIAorICogVW5sZXNzIHJlcXVpcmVkIGJ5IGFwcGxpY2FibGUgbGF3IG9yIGFncmVlZCB0byBpbiB3cml0aW5nLCBzb2Z0d2FyZQorICogZGlzdHJpYnV0ZWQgdW5kZXIgdGhlIExpY2Vuc2UgaXMgZGlzdHJpYnV0ZWQgb24gYW4gIkFTIElTIiBCQ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CAwMDAwMDAwLi44ODk3MTUxCi0tLSAvZGV2L251bGwKKysrIGIvZWNvbXAtcG9ydGFsLUJFL3NyYy9tYWluL2phdmEvb3JnL29wZW5lY29tcC9wb3J0YWxhcHAvcG9ydGFsL2RvbWFpbi9FUEFwcC5qYXZhCkBAIC0wLDAgKzEsMzE5IEBACisvKi0KKyAqID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisgKiBlQ09NUCBQb3J0YWwKKyAqID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisgKiBDb3B5cmlnaHQgKEMpIDIwMTcgQVQmVCBJbnRlbGxlY3R1YWwgUHJvcGVydHkKKyAqID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisgKiBMaWNlbnNlZCB1bmRlciB0aGUgQXBhY2hlIExpY2Vuc2UsIFZlcnNpb24gMi4wICh0aGUgIkxpY2Vuc2UiKTsKKyAqIHlvdSBtYXkgbm90IHVzZSB0aGlzIGZpbGUgZXhjZXB0IGluIGNvbXBsaWFuY2Ugd2l0aCB0aGUgTGljZW5zZS4KKyAqIFlvdSBtYXkgb2J0YWluIGEgY29weSBvZiB0aGUgTGljZW5zZSBhdAorICogCisgKiAgICAgIGh0dHA6Ly93d3cuYXBhY2hlLm9yZy9saWNlbnNlcy9MSUNFTlNFLTIuMAorICogCisgKiBVbmxlc3MgcmVxdWlyZWQgYnkgYXBwbGljYWJsZSBsYXcgb3IgYWdyZWVkIHRvIGluIHdyaXRpbmcsIHNvZnR3YXJlCisgKiBkaXN0cmlidXRlZCB1bmRlciB0aGUgTGljZW5zZSBpcyBkaXN0cmlidXRlZCBvbiBhbiAiQVMgSVMiIEJBU0lTLAorICogV0lUSE9VVCBXQVJ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MCArMSwyMDQgQEAKKy8qLQorICogPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKyAqIGVDT01QIFBvcnRhbAorICogPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKyAqIENvcHlyaWdodCAoQykgMjAxNyBBVCZUIEludGVsbGVjdHVhbCBQcm9wZXJ0eQorICogPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKyAqIExpY2Vuc2VkIHVuZGVyIHRoZSBBcGFjaGUgTGljZW5zZSwgVmVyc2lvbiAyLjAgKHRoZSAiTGljZW5zZSIpOworICogeW91IG1heSBub3QgdXNlIHRoaXMgZmlsZSBleGNlcHQgaW4gY29tcGxpYW5jZSB3aXRoIHRoZSBMaWNlbnNlLgorICogWW91IG1heSBvYnRhaW4gYSBjb3B5IG9mIHRoZSBMaWNlbnNlIGF0CisgKiAKKyAqICAgICAgaHR0cDovL3d3dy5hcGFjaGUub3JnL2xpY2Vuc2VzL0xJQ0VOU0UtMi4wCisgKiAKKyAqIFVubGVzcyByZXF1aXJlZCBieSBhcHBsaWNhYmxlIGxhdyBvciBhZ3JlZWQgdG8gaW4gd3JpdGluZywgc29mdHdhcmUKKyAqIGRpc3RyaWJ1dGVkIHVuZGVyIHRoZSBMaWNlbnNlIGlzIGRpc3RyaWJ1dGVkIG9uIGFuICJBUyBJUyIgQkFTSVMsCisgKiBXSVRIT1VUIFdBUlJBTlRJRVMgT1IgQ09ORElUSU9OUyBPRiBBTlkgS0lORCwgZWl0aGVyIGV4cHJlc3Mgb3IgaW1wbGllZC4KKyAqIFNlZSB0aGUgTGljZW5zZSBmb3IgdGhlIHNwZWNpZmljIGxhbmd1YWdlIGdvdmVybmluZyBwZXJta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oaXMubmFtZSA9IG5hbWU7CisgICAgfQorCisgICAgcHVibGljIHZvaWQgc2V0QWN0aXZlKGJvb2xlYW4gYWN0aXZlKSB7CisgICAgICAgIHRoaXMuYWN0aXZlID0gYWN0aXZlOworICAgIH0KKworICAgIHB1YmxpYyB2b2lkIHNldFJvbGVGdW5jdGlvbnMoU29ydGVkU2V0PFJvbGVGdW5jdGlvbj4gcm9sZUZ1bmN0aW9ucykgeworICAgICAgICB0aGlzLnJvbGVGdW5jdGlvbnMgPSByb2xlRnVuY3Rpb25zOworICAgIH0KKworICAgIHB1YmxpYyB2b2lkIHNldFByaW9yaXR5KEludGVnZXIgcHJpb3JpdHkpIHsKKyAgICAgICAgdGhpcy5wcmlvcml0eSA9IHByaW9yaXR5OworICAgIH0KKworICAgIHB1YmxpYyB2b2lkIHNldENoaWxkUm9sZXMoU29ydGVkU2V0PEVQUm9sZT4gY2hpbGRSb2xlcykgeworICAgICAgICB0aGlzLmNoaWxkUm9sZXMgPSBjaGlsZFJvbGVzOworICAgIH0KKworICAgIHB1YmxpYyB2b2lkIHNldFBhcmVudFJvbGVzKFNvcnRlZFNldDxFUFJvbGU+IHBhcmVudFJvbGVzKSB7CisgICAgICAgIHRoaXMucGFyZW50Um9sZXMgPSBwYXJlbnRSb2xlczsKKyAgICB9CisKKyAgICBwdWJsaWMgdm9pZCBhZGRSb2xlRnVuY3Rpb24oUm9sZUZ1bmN0aW9uIHJvbGVGdW5jdGlvbikgeworICAgICAgICB0aGlzLnJvbGVGdW5jdGlvbnMuYWRkKHJvbGVGdW5jdGlvbik7CisgICAgfQorCisgICAgcHVibGljIHZvaWQgYWRkQ2hpbGRSb2xlKEVQUm9sZSByb2xlKSB7CisgICAgICAgIHRoaXMuY2hpbGRSb2xlcy5hZGQocm9sZSk7CisgICAgfQorCisgICAgcHVibGljIHZvaWQgYWRkUGFyZW50Um9sZShFUFJvbGUgcm9sZSkgeworICAgICAgICB0aGlzLnBhcmVudFJvbGVzLmFkZChyb2xlKT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sZUlkKyJdIjsKKwkJcmV0dXJuIHN0cjsKKwl9Cit9CmRpZmYgLS1naXQgYS9lY29tcC1wb3J0YWwtQkUvc3JjL21haW4vamF2YS9vcmcvb3BlbmVjb21wL3BvcnRhbGFwcC9wb3J0YWwvZG9tYWluL0VQVXNlci5qYXZhIGIvZWNvbXAtcG9ydGFsLUJFL3NyYy9tYWluL2phdmEvb3JnL29wZW5lY29tcC9wb3J0YWxhcHAvcG9ydGFsL2RvbWFpbi9FUFVzZXIuamF2YQpuZXcgZmlsZSBtb2RlIDEwMDY0NAppbmRleCAwMDAwMDAwLi5kNzBkYWE5Ci0tLSAvZGV2L251bGwKKysrIGIvZWNvbXAtcG9ydGFsLUJFL3NyYy9tYWluL2phdmEvb3JnL29wZW5lY29tcC9wb3J0YWxhcHAvcG9ydGFsL2RvbWFpbi9FUFVzZXIuamF2YQpAQCAtMCwwICsxLDYwMiBAQAorLyotCisgKiA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorICogZUNPTVAgUG9ydGFsCisgKiA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorICogQ29weXJpZ2h0IChDKSAyMDE3IEFUJlQgSW50ZWxsZWN0dWFsIFByb3BlcnR5CisgKiA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorICogTGljZW5zZWQgdW5kZXIgdGhlIEFwYWNoZSBMaWNlbnNlLCBWZXJzaW9uIDIuMCAodGhlICJMaWNlbnNlIik7CisgKiB5b3UgbWF5IG5vdCB1c2UgdGhpcyBmaWxlIGV4Y2VwdCBpbiBjb21wbGlhbmNlIHdpdGggdGhlIExpY2Vuc2UuCisgKiBZb3UgbWF5IG9idGFpbiBhIGNvcHkgb2Yg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1cm4gZ2V0Rmlyc3ROYW1lKCkgKyAiICIgKyBnZXRMYXN0TmFtZSgpOwkKKwkgICAgfQorCSAgICAKKwkgICAgcHVibGljIFN0cmluZyBnZXRMb2dpbklkKCkgeworCSAgICAgICAgcmV0dXJuIGxvZ2luSWQ7CisJICAgIH0KKworCSAgICBwdWJsaWMgU3RyaW5nIGdldExvZ2luUHdkKCkgeworCSAgICAgICAgcmV0dXJuIGxvZ2luUHdkOworCSAgICB9CisKKwkgICAgcHVibGljIExvbmcgZ2V0TWFuYWdlcklkKCkgeworCSAgICAgICAgcmV0dXJuIG1hbmFnZXJJZDsKKwkgICAgfQorCisJICAgIHB1YmxpYyBTdHJpbmcgZ2V0TWlkZGxlSW5pdGlhbCgpIHsKKwkgICAgICAgIHJldHVybiBtaWRkbGVJbml0aWFsOworCSAgICB9CisKKwkgICAgcHVibGljIFN0cmluZyBnZXRPcmdDb2RlKCkgeworCSAgICAgICAgcmV0dXJuIG9yZ0NvZGU7CisJICAgIH0KKworCSAgICBwdWJsaWMgTG9uZyBnZXRPcmdJZCgpIHsKKwkgICAgICAgIHJldHVybiBvcmdJZDsKKwkgICAgfQorCisJICAgIHB1YmxpYyBTdHJpbmcgZ2V0UGhvbmUoKSB7CisJICAgICAgICByZXR1cm4gcGhvbmU7CisJICAgIH0KKworCSAgICBwdWJsaWMgU3RyaW5nIGdldE9yZ1VzZXJJZCgpIHsKKwkgICAgICAgIHJldHVybiBvcmdVc2VySWQ7CisJICAgIH0KKworCSAgICBwdWJsaWMgYm9vbGVhbiBnZXRBY3RpdmUoKSB7CisJICAgICAgICByZXR1cm4gYWN0aXZlOworCSAgICB9CisKKwkgICAgcHVibGljIGJvb2xlYW4gZ2V0SW50ZXJuYWwoKSB7CisJICAgICAgICByZXR1cm4gaW50ZXJuYWw7CisJICAgIH0KKworCSAgICBwdWJsaWMgU3RyaW5nIGdldEFkZHJlc3MxKCkgeworCSAgICAgICAgcmV0dXJuIGFkZHJlc3MxOworCSAgICB9CisKKwkgICAgcHVibGljIFN0cmluZyBnZXRBZGRyZXNzMigpIHsKKwkgICAgICAgIHJldHVybiBhZGRyZXNzMjsKKwkgICAgfQorCisJICAgIHB1YmxpYyBTdHJpbmcgZ2V0Q2l0eSgpIHsKKwkgICAgICAgIHJldHVybiBjaXR5OworCSAgICB9CisKKwkgICAgcHVibGljIFN0cmluZyBnZXRDb3VudHJ5KCkgeworCSAgICAgICAgcmV0dXJuIGNvdW50cnk7CisJICAgIH0KKworCSAgICBwdWJsaWMgU3RyaW5nIGdldFN0YXRlKCkgeworCSAgICAgICAgcmV0dXJuIHN0YXRlOworCSAgICB9CisKKwkgICAgcHVibGljIFN0cmluZyBnZXRaaXBDb2RlKCkgeworCSAgICAgICAgcmV0dXJuIHppcENvZGU7CisJICAgIH0KKworCSAgICBwdWJsaWMgU3RyaW5nIGdldEJ1c2luZXNzQ291bnRyeUNvZGUoKSB7CisJICAgICAgICByZXR1cm4gYnVzaW5lc3NDb3VudHJ5Q29kZTsKKwkgICAgfQorCisJICAgIHB1YmxpYyBTdHJpbmcgZ2V0Q29tbWFuZENoYWluKCkgeworCSAgICAgICAgcmV0dXJuIGNvbW1hbmRDaGFpbjsKKwkgICAgfQorCisJICAgIHB1YmxpYyBTdHJpbmcgZ2V0Q29tcGFueSgpIHsKKwkgICAgICAgIHJldHVybiBjb21wYW55OworCSAgICB9CisKKwkgICAgcHVibGljIFN0cmluZyBnZXRDb21wYW55Q29kZSgpIHsKKwkgICAgICAgIHJldHVybiBjb21wYW55Q29kZTsKKwkgICAgfQorCisJICAgIHB1YmxpYyBTdHJpbmcgZ2V0RGVwYXJ0bWVudCgpIHsKKwkgICAgICAgIHJldHVybiBkZXBhcnRtZW50OworCSAgICB9CisKKwkgICAgcHVibGljIFN0cmluZyBnZXRKb2JUaXRsZSgpIHsKKwkgICAgICAgIHJldHVybiBqb2JUaXRsZTsKKwkgICAgfQorCisJICAgIHB1YmxpYyBTdHJpbmcgZ2V0TG9jYXRpb25DbGxpKCk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bnRyeSA9IGNvdW50cnk7CisJICAgIH0KKworCSAgICBwdWJsaWMgdm9pZCBzZXRTdGF0ZShTdHJpbmcgc3RhdGUpIHsKKwkgICAgICAgIHRoaXMuc3RhdGUgPSBzdGF0ZTsKKwkgICAgfQorCisJICAgIHB1YmxpYyB2b2lkIHNldFppcENvZGUoU3RyaW5nIHppcENvZGUpIHsKKwkgICAgICAgIHRoaXMuemlwQ29kZSA9IHppcENvZGU7CisJICAgIH0KKworCSAgICBwdWJsaWMgdm9pZCBzZXRCdXNpbmVzc0NvdW50cnlDb2RlKFN0cmluZyBidXNpbmVzc0NvdW50cnlDb2RlKSB7CisJICAgICAgICB0aGlzLmJ1c2luZXNzQ291bnRyeUNvZGUgPSBidXNpbmVzc0NvdW50cnlDb2RlOworCSAgICB9CisKKwkgICAgcHVibGljIHZvaWQgc2V0Q29tbWFuZENoYWluKFN0cmluZyBjb21tYW5kQ2hhaW4pIHsKKwkgICAgICAgIHRoaXMuY29tbWFuZENoYWluID0gY29tbWFuZENoYWluOworCSAgICB9CisKKwkgICAgcHVibGljIHZvaWQgc2V0Q29tcGFueShTdHJpbmcgY29tcGFueSkgeworCSAgICAgICAgdGhpcy5jb21wYW55ID0gY29tcGFueTsKKwkgICAgfQorCisJICAgIHB1YmxpYyB2b2lkIHNldENvbXBhbnlDb2RlKFN0cmluZyBjb21wYW55Q29kZSkgeworCSAgICAgICAgdGhpcy5jb21wYW55Q29kZSA9IGNvbXBhbnlDb2RlOworCSAgICB9CisKKwkgICAgcHVibGljIHZvaWQgc2V0RGVwYXJ0bWVudChTdHJpbmcgZGVwYXJ0bWVudCkgeworCSAgICAgICAgdGhpcy5kZXBhcnRtZW50ID0gZGVwYXJ0bWVudDsKKwkgICAgfQorCisJICAgIHB1YmxpYyB2b2lkIHNldEpvYlRpdGxlKFN0cmluZyBqb2JUaXRsZSkgeworCSAgICAgICAgdGhpcy5qb2JUaXRsZSA9IGpvYlRpdGxlOworCSAgICB9CisKKwkgICAgcHVibGlj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mluZyBnZXRCdXNpbmVzc1VuaXROYW1lKCkgeworCQkJcmV0dXJuIGJ1c2luZXNzVW5pdE5hbWU7CisJCX0KKworCQlwdWJsaWMgdm9pZCBzZXRCdXNpbmVzc1VuaXROYW1lKFN0cmluZyBidXNpbmVzc1VuaXROYW1lKSB7CisJCQl0aGlzLmJ1c2luZXNzVW5pdE5hbWUgPSBidXNpbmVzc1VuaXROYW1lOworCQl9CisKKwkJcHVibGljIFN0cmluZyBnZXREZXBhcnRtZW50TmFtZSgpIHsKKwkJCXJldHVybiBkZXBhcnRtZW50TmFtZTsKKwkJfQorCisJCXB1YmxpYyB2b2lkIHNldERlcGFydG1lbnROYW1lKFN0cmluZyBkZXBhcnRtZW50TmFtZSkgeworCQkJdGhpcy5kZXBhcnRtZW50TmFtZSA9IGRlcGFydG1lbnROYW1lOworCQl9CisKKwkJcHVibGljIGludCBjb21wYXJlVG8oT2JqZWN0IG9iail7CisJICAgICAgRVBVc2VyIHVzZXIgPSAoRVBVc2VyKW9iajsKKworCSAgICAgIFN0cmluZyBjMSA9IGdldExhc3ROYW1lKCkgKyBnZXRGaXJzdE5hbWUoKSArIGdldE1pZGRsZUluaXRpYWwoKTsKKwkgICAgICBTdHJpbmcgYzIgPSB1c2VyLmdldExhc3ROYW1lKCkgKyB1c2VyLmdldEZpcnN0TmFtZSgpICsgdXNlci5nZXRNaWRkbGVJbml0aWFsKCk7CisKKwkgICAgICByZXR1cm4gYzEuY29tcGFyZVRvKGMyKTsKKwkgICAgfQorCisJCXB1YmxpYyBib29sZWFuIGlzT25saW5lKCkgeworCQkJcmV0dXJuIG9ubGluZTsKKwkJfQorCisJCXB1YmxpYyB2b2lkIHNldE9ubGluZShib29sZWFuIG9ubGluZSkgeworCQkJdGhpcy5vbmxpbmUgPSBvbmxpbmU7CisJCX0KKworCQlwdWJsaWMgU3RyaW5nIGdldENoYXRJZCgpIHsKKwkJCXJldHVybiBjaGF0SWQ7CisJCX0KKworCQlwdWJsaWMgdm9pZCBz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UFJvbGVzKHJvbGVzKTsKKwkJfQorCX0KKwkKKwlwdWJsaWMgYm9vbGVhbiBpc0d1ZXN0KCkgeworCQlyZXR1cm4gaXNHdWVzdDsKKwl9CisKKwlwdWJsaWMgdm9pZCBzZXRHdWVzdChib29sZWFuIGlzR3Vlc3QpIHsKKwkJdGhpcy5pc0d1ZXN0ID0gaXNHdWVzdDsKKwl9Cit9CmRpZmYgLS1naXQgYS9lY29tcC1wb3J0YWwtQkUvc3JjL21haW4vamF2YS9vcmcvb3BlbmVjb21wL3BvcnRhbGFwcC9wb3J0YWwvZG9tYWluL0VQVXNlckFwcC5qYXZhIGIvZWNvbXAtcG9ydGFsLUJFL3NyYy9tYWluL2phdmEvb3JnL29wZW5lY29tcC9wb3J0YWxhcHAvcG9ydGFsL2RvbWFpbi9FUFVzZXJBcHAuamF2YQpuZXcgZmlsZSBtb2RlIDEwMDY0NAppbmRleCAwMDAwMDAwLi5mNDY0N2ZjCi0tLSAvZGV2L251bGwKKysrIGIvZWNvbXAtcG9ydGFsLUJFL3NyYy9tYWluL2phdmEvb3JnL29wZW5lY29tcC9wb3J0YWxhcHAvcG9ydGFsL2RvbWFpbi9FUFVzZXJBcHAuamF2YQpAQCAtMCwwICsxLDExOSBAQAorLyotCisgKiA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorICogZUNPTVAgUG9ydGFsCisgKiA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorICogQ29weXJpZ2h0IChDKSAyMDE3IEFUJlQgSW50ZWxsZWN0dWFsIFByb3BlcnR5CisgKiA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorICogTGljZW5zZWQgdW5kZXIgdGhlIEFwYWNoZSB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zZXJJZCgpKSArIChjYXN0T3RoZXIuZ2V0QXBwKCk9PW51bGx8fGNhc3RPdGhlci5nZXRBcHAoKS5nZXRJZCgpPT1udWxsID8gMCA6IGNhc3RPdGhlci5nZXRBcHAoKS5nZXRJZCgpKSArIChjYXN0T3RoZXIuZ2V0Um9sZSgpPT1udWxsfHxjYXN0T3RoZXIuZ2V0Um9sZSgpLmdldElkKCk9PW51bGwgPyAwIDogY2FzdE90aGVyLmdldFJvbGUoKS5nZXRJZCgpKSArIChjYXN0T3RoZXIucHJpb3JpdHk9PW51bGwgPyAwIDogY2FzdE90aGVyLnByaW9yaXR5KTsKKworCSAgICByZXR1cm4gYzEuY29tcGFyZVRvKGMyKTsKKwl9Cit9CmRpZmYgLS1naXQgYS9lY29tcC1wb3J0YWwtQkUvc3JjL21haW4vamF2YS9vcmcvb3BlbmVjb21wL3BvcnRhbGFwcC9wb3J0YWwvZG9tYWluL0Vjb21wQXBwLmphdmEgYi9lY29tcC1wb3J0YWwtQkUvc3JjL21haW4vamF2YS9vcmcvb3BlbmVjb21wL3BvcnRhbGFwcC9wb3J0YWwvZG9tYWluL0Vjb21wQXBwLmphdmEKbmV3IGZpbGUgbW9kZSAxMDA2NDQKaW5kZXggMDAwMDAwMC4uMjU2NGExNwotLS0gL2Rldi9udWxsCisrKyBiL2Vjb21wLXBvcnRhbC1CRS9zcmMvbWFpbi9qYXZhL29yZy9vcGVuZWNvbXAvcG9ydGFsYXBwL3BvcnRhbC9kb21haW4vRWNvbXBBcHAuamF2YQpAQCAtMCwwICsxLDE0MyBAQAorLyotCisgKiA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorICogZUNPTVAgUG9ydGFsCisgKiA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorICogQ29weXJpZ2h0IChDKSAyMDE3IEFUJlQgSW50ZWxsZWN0dWFsIFByb3BlcnR5CisgKiA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorICogTGljZW5zZWQgdW5kZXIgdGhlIEFwYWNoZSBMaWNlbnNlLCBWZXJzaW9uIDIuMCAodGhlICJMaWNlbnNlIik7CisgKiB5b3UgbWF5IG5vdCB1c2UgdGhpcyBmaWxlIGV4Y2VwdCBpbiBjb21wbGlhbmNlIHdpdGggdGhlIExpY2Vuc2UuCisgKiBZb3UgbWF5IG9idGFpbiBhIGNvcHkgb2YgdGhlIExpY2Vuc2UgYXQKKyAqIAorICogICAgICBodHRwOi8vd3d3LmFwYWNoZS5vcmcvbGljZW5zZXMvTElDRU5TRS0yLjAKKyAqIAorICogVW5sZXNzIHJlcXVpcmVkIGJ5IGFwcGxpY2FibGUgbGF3IG9yIGFncmVlZCB0byBpbiB3cml0aW5nLCBzb2Z0d2FyZQorICogZGlzdHJpYnV0ZWQgdW5kZXIgdGhlIExpY2Vuc2UgaXMgZGlzdHJpYnV0ZWQgb24gYW4gIkFTIElTIiBCQVNJUywKKyAqIFdJVEhPVVQgV0FSUkFOVElFUyBPUiBDT05ESVRJT05TIE9GIEFOWSBLSU5ELCBlaXRoZXIgZXhwcmVzcyBvciBpbXBsaWVkLgorICogU2VlIHRoZSBMaWNlbnNlIGZvciB0aGUgc3BlY2lmaWMgbGFuZ3VhZ2UgZ292ZXJuaW5nIHBlcm1pc3Npb25zIGFuZAorICogbGltaXRhdGlvbnMgdW5kZXIgdGhlIExpY2Vuc2UuCisgKiA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorICovCitwYWNrYWdlIG9yZy5vcGVuZWNvbXAucG9ydGFsYXBwLnBvcnRhbC5kb21haW47CisKK3B1YmxpYyBjbGFzcyBFY29tcEFw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T09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisgKiBDb3B5cmlnaHQgKEMpIDIwMTcgQVQmVCBJbnRlbGxlY3R1YWwgUHJvcGVydHkKKyAqID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisgKiBMaWNlbnNlZCB1bmRlciB0aGUgQXBhY2hlIExpY2Vuc2UsIFZlcnNpb24gMi4wICh0aGUgIkxpY2Vuc2UiKTsKKyAqIHlvdSBtYXkgbm90IHVzZSB0aGlzIGZpbGUgZXhjZXB0IGluIGNvbXBsaWFuY2Ugd2l0aCB0aGUgTGljZW5zZS4KKyAqIFlvdSBtYXkgb2J0YWluIGEgY29weSBvZiB0aGUgTGljZW5zZSBhdAorICogCisgKiAgICAgIGh0dHA6Ly93d3cuYXBhY2hlLm9yZy9saWNlbnNlcy9MSUNFTlNFLTIuMAorICogCisgKiBVbmxlc3MgcmVxdWlyZWQgYnkgYXBwbGljYWJsZSBsYXcgb3IgYWdyZWVkIHRvIGluIHdyaXRpbmcsIHNvZnR3YXJlCisgKiBkaXN0cmlidXRlZCB1bmRlciB0aGUgTGljZW5zZSBpcyBkaXN0cmlidXRlZCBvbiBhbiAiQVMgSVMiIEJBU0lTLAorICogV0lUSE9VVCBXQVJSQU5USUVTIE9SIENPTkRJVElPTlMgT0YgQU5ZIEtJTkQsIGVpdGhlciBleHByZXNzIG9yIGltcGxpZWQuCisgKiBTZWUgdGhlIExpY2Vuc2UgZm9yIHRoZSBzcGVjaWZpYyBsYW5ndWFnZSBnb3Zlcm5pbmcgcGVybWlzc2lvbnMgYW5kCisgKiBsaW1pdGF0aW9ucyB1bmRlciB0aGUgTGljZW5zZS4KKyAqID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09P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09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorICogQ29weXJpZ2h0IChDKSAyMDE3IEFUJlQgSW50ZWxsZWN0dWFsIFByb3BlcnR5CisgKiA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorICogTGljZW5zZWQgdW5kZXIgdGhlIEFwYWNoZSBMaWNlbnNlLCBWZXJzaW9uIDIuMCAodGhlICJMaWNlbnNlIik7CisgKiB5b3UgbWF5IG5vdCB1c2UgdGhpcyBmaWxlIGV4Y2VwdCBpbiBjb21wbGlhbmNlIHdpdGggdGhlIExpY2Vuc2UuCisgKiBZb3UgbWF5IG9idGFpbiBhIGNvcHkgb2YgdGhlIExpY2Vuc2UgYXQKKyAqIAorICogICAgICBodHRwOi8vd3d3LmFwYWNoZS5vcmcvbGljZW5zZXMvTElDRU5TRS0yLjAKKyAqIAorICogVW5sZXNzIHJlcXVpcmVkIGJ5IGFwcGxpY2FibGUgbGF3IG9yIGFncmVlZCB0byBpbiB3cml0aW5nLCBzb2Z0d2FyZQorICogZGlzdHJpYnV0ZWQgdW5kZXIgdGhlIExpY2Vuc2UgaXMgZGlzdHJpYnV0ZWQgb24gYW4gIkFTIElTIiBCQVNJUywKKyAqIFdJVEhPVVQgV0FSUkFOVElFUyBPUiBDT05ESVRJT05TIE9GIEFOWSBLSU5ELCBlaXRoZXIgZXhwcmVzcyBvciBpbXBsaWVkLgorICogU2VlIHRoZSBMaWNlbnNlIGZvciB0aGUgc3BlY2lmaWMgbGFuZ3VhZ2UgZ292ZXJuaW5nIHBlcm1pc3Npb25zIGFuZAorICogbGltaXRhdGlvbnMgdW5kZXIgdGhlIExpY2Vuc2UuCisgKiA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorICovCitwYWNrYWdlIG9yZy5vcGVuZWNvbXAucG9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lTmFtZShTdHJpbmcgcm9sZU5hbWUpIHsKKwkJdGhpcy5yb2xlTmFtZSA9IHJvbGVOYW1lOworCX0KK30KZGlmZiAtLWdpdCBhL2Vjb21wLXBvcnRhbC1CRS9zcmMvbWFpbi9qYXZhL29yZy9vcGVuZWNvbXAvcG9ydGFsYXBwL3BvcnRhbC9kb21haW4vUGVyc1VzZXJBcHBTZWxlY3Rpb24uamF2YSBiL2Vjb21wLXBvcnRhbC1CRS9zcmMvbWFpbi9qYXZhL29yZy9vcGVuZWNvbXAvcG9ydGFsYXBwL3BvcnRhbC9kb21haW4vUGVyc1VzZXJBcHBTZWxlY3Rpb24uamF2YQpuZXcgZmlsZSBtb2RlIDEwMDY0NAppbmRleCAwMDAwMDAwLi40Mjg4ZDkyCi0tLSAvZGV2L251bGwKKysrIGIvZWNvbXAtcG9ydGFsLUJFL3NyYy9tYWluL2phdmEvb3JnL29wZW5lY29tcC9wb3J0YWxhcHAvcG9ydGFsL2RvbWFpbi9QZXJzVXNlckFwcFNlbGVjdGlvbi5qYXZhCkBAIC0wLDAgKzEsNzkgQEAKKy8qLQorICogPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKyAqIGVDT01QIFBvcnRhbAorICogPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKyAqIENvcHlyaWdodCAoQykgMjAxNyBBVCZUIEludGVsbGVjdHVhbCBQcm9wZXJ0eQorICogPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKyAqIExpY2Vuc2VkIHVuZGVyIHRoZSBBcGFjaGUgTGljZW5zZSwgVmVyc2lvbiAyLjAgKHRoZSAiTGljZW5zZSIpOworICogeW91IG1heSBub3QgdXNlIHRoaXMgZ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0YXR1c0NvZGUoU3RyaW5nIHN0YXR1c0NvZGUpIHsKKwkJdGhpcy5zdGF0dXNDb2RlID0gc3RhdHVzQ29kZTsKKwl9CisKK30KXCBObyBuZXdsaW5lIGF0IGVuZCBvZiBmaWxlCmRpZmYgLS1naXQgYS9lY29tcC1wb3J0YWwtQkUvc3JjL21haW4vamF2YS9vcmcvb3BlbmVjb21wL3BvcnRhbGFwcC9wb3J0YWwvZG9tYWluL1NoYXJlZENvbnRleHQuamF2YSBiL2Vjb21wLXBvcnRhbC1CRS9zcmMvbWFpbi9qYXZhL29yZy9vcGVuZWNvbXAvcG9ydGFsYXBwL3BvcnRhbC9kb21haW4vU2hhcmVkQ29udGV4dC5qYXZhCm5ldyBmaWxlIG1vZGUgMTAwNjQ0CmluZGV4IDAwMDAwMDAuLmM2OGYxYjgKLS0tIC9kZXYvbnVsbAorKysgYi9lY29tcC1wb3J0YWwtQkUvc3JjL21haW4vamF2YS9vcmcvb3BlbmVjb21wL3BvcnRhbGFwcC9wb3J0YWwvZG9tYWluL1NoYXJlZENvbnRleHQuamF2YQpAQCAtMCwwICsxLDE2MSBAQAorLyotCisgKiA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorICogZUNPTVAgUG9ydGFsCisgKiA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorICogQ29weXJpZ2h0IChDKSAyMDE3IEFUJlQgSW50ZWxsZWN0dWFsIFByb3BlcnR5CisgKiA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorICogTGljZW5zZWQgdW5kZXIgdGhlIEFwYWNoZSBMaWNlbnNlLCBWZXJzaW9uIDIuMCAodGhlICJMaWNlbnNlIik7CisgKiB5b3UgbWF5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XRDdmFsdWUoKSB7CisJCXJldHVybiBjdmFsdWU7CisJfQorCisJLyoqCisJICogU2V0cyB0aGUgdmFsdWUgb2YgdGhlIGtleS12YWx1ZSBwYWlyLgorCSAqIAorCSAqIEBwYXJhbSBjdmFsdWUKKwkgKi8KKwlwdWJsaWMgdm9pZCBzZXRDdmFsdWUoZmluYWwgU3RyaW5nIGN2YWx1ZSkgeworCQl0aGlzLmN2YWx1ZSA9IGN2YWx1ZTsKKwl9CisKK30KZGlmZiAtLWdpdCBhL2Vjb21wLXBvcnRhbC1CRS9zcmMvbWFpbi9qYXZhL29yZy9vcGVuZWNvbXAvcG9ydGFsYXBwL3BvcnRhbC9kb21haW4vVXNlcklkUm9sZUlkLmphdmEgYi9lY29tcC1wb3J0YWwtQkUvc3JjL21haW4vamF2YS9vcmcvb3BlbmVjb21wL3BvcnRhbGFwcC9wb3J0YWwvZG9tYWluL1VzZXJJZFJvbGVJZC5qYXZhCm5ldyBmaWxlIG1vZGUgMTAwNjQ0CmluZGV4IDAwMDAwMDAuLmNjZTRjYjIKLS0tIC9kZXYvbnVsbAorKysgYi9lY29tcC1wb3J0YWwtQkUvc3JjL21haW4vamF2YS9vcmcvb3BlbmVjb21wL3BvcnRhbGFwcC9wb3J0YWwvZG9tYWluL1VzZXJJZFJvbGVJZC5qYXZhCkBAIC0wLDAgKzEsNzcgQEAKKy8qLQorICogPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKyAqIGVDT01QIFBvcnRhbAorICogPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKyAqIENvcHlyaWdodCAoQykgMjAxNyBBVCZUIEludGVsbGVjdHVhbCBQcm9wZXJ0eQorICogPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09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cmdVc2VySWQpIHsKKwkJdGhpcy5vcmdVc2VySWQgPSBvcmdVc2VySWQ7CisJfQorfQpkaWZmIC0tZ2l0IGEvZWNvbXAtcG9ydGFsLUJFL3NyYy9tYWluL2phdmEvb3JnL29wZW5lY29tcC9wb3J0YWxhcHAvcG9ydGFsL2RvbWFpbi9Vc2VyUm9sZS5qYXZhIGIvZWNvbXAtcG9ydGFsLUJFL3NyYy9tYWluL2phdmEvb3JnL29wZW5lY29tcC9wb3J0YWxhcHAvcG9ydGFsL2RvbWFpbi9Vc2VyUm9sZS5qYXZhCm5ldyBmaWxlIG1vZGUgMTAwNjQ0CmluZGV4IDAwMDAwMDAuLmQwYjVkZjkKLS0tIC9kZXYvbnVsbAorKysgYi9lY29tcC1wb3J0YWwtQkUvc3JjL21haW4vamF2YS9vcmcvb3BlbmVjb21wL3BvcnRhbGFwcC9wb3J0YWwvZG9tYWluL1VzZXJSb2xlLmphdmEKQEAgLTAsMCArMSw5MSBAQAorLyotCisgKiA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorICogZUNPTVAgUG9ydGFsCisgKiA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorICogQ29weXJpZ2h0IChDKSAyMDE3IEFUJlQgSW50ZWxsZWN0dWFsIFByb3BlcnR5CisgKiA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorICogTGljZW5zZWQgdW5kZXIgdGhlIEFwYWNoZSBMaWNlbnNlLCBWZXJzaW9uIDIuMCAodGhlICJMaWNlbnNlIik7CisgKiB5b3UgbWF5IG5vdCB1c2UgdGhpcyBmaWxlIGV4Y2VwdCBpbiBjb21wbGlhbmNlIHdpdGggdGhlIExpY2Vuc2UuCisg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09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisgKiBDb3B5cmlnaHQgKEMpIDIwMTcgQVQmVCBJbnRlbGxlY3R1YWwgUHJvcGVydHkKKyAqID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisgKiBMaWNlbnNlZCB1bmRlciB0aGUgQXBhY2hlIExpY2Vuc2UsIFZlcnNpb24gMi4wICh0aGUgIkxpY2Vuc2UiKTsKKyAqIHlvdSBtYXkgbm90IHVzZSB0aGlzIGZpbGUgZXhjZXB0IGluIGNvbXBsaWFuY2Ugd2l0aCB0aGUgTGljZW5zZS4KKyAqIFlvdSBtYXkgb2J0YWluIGEgY29weSBvZiB0aGUgTGljZW5zZSBhdAorICogCisgKiAgICAgIGh0dHA6Ly93d3cuYXBhY2hlLm9yZy9saWNlbnNlcy9MSUNFTlNFLTIuMAorICogCisgKiBVbmxlc3MgcmVxdWlyZWQgYnkgYXBwbGljYWJsZSBsYXcgb3IgYWdyZWVkIHRvIGluIHdyaXRpbmcsIHNvZnR3YXJlCisgKiBkaXN0cmlidXRlZCB1bmRlciB0aGUgTGljZW5zZSBpcyBkaXN0cmlidXRlZCBvbiBhbiAiQVMgSVMiIEJBU0lTLAorICogV0lUSE9VVCBXQVJSQU5USUVTIE9SIENPTkRJVElPTlMgT0YgQU5ZIEtJTkQsIGVpdGhlciBleHByZXNzIG9yIGltcGxpZWQuCisgKiBTZWUgdGhlIExpY2Vuc2UgZm9yIHRoZSBzcGVjaWZpYyBsYW5ndWFnZSBnb3Zlcm5pbmcgcGVybWlzc2lvbnMgYW5kCisgKiBsaW1pdGF0aW9ucyB1bmRlciB0aGUgTGljZW5zZS4KKyAqID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisgKi8KK3BhY2thZ2Ugb3J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YWluL2phdmEvb3JnL29wZW5lY29tcC9wb3J0YWxhcHAvcG9ydGFsL2RvbWFpbi9XaWRnZXQuamF2YQpuZXcgZmlsZSBtb2RlIDEwMDY0NAppbmRleCAwMDAwMDAwLi4zMDliMGM4Ci0tLSAvZGV2L251bGwKKysrIGIvZWNvbXAtcG9ydGFsLUJFL3NyYy9tYWluL2phdmEvb3JnL29wZW5lY29tcC9wb3J0YWxhcHAvcG9ydGFsL2RvbWFpbi9XaWRnZXQuamF2YQpAQCAtMCwwICsxLDEwNCBAQAorLyotCisgKiA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorICogZUNPTVAgUG9ydGFsCisgKiA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorICogQ29weXJpZ2h0IChDKSAyMDE3IEFUJlQgSW50ZWxsZWN0dWFsIFByb3BlcnR5CisgKiA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorICogTGljZW5zZWQgdW5kZXIgdGhlIEFwYWNoZSBMaWNlbnNlLCBWZXJzaW9uIDIuMCAodGhlICJMaWNlbnNlIik7CisgKiB5b3UgbWF5IG5vdCB1c2UgdGhpcyBmaWxlIGV4Y2VwdCBpbiBjb21wbGlhbmNlIHdpdGggdGhlIExpY2Vuc2UuCisgKiBZb3UgbWF5IG9idGFpbiBhIGNvcHkgb2YgdGhlIExpY2Vuc2UgYXQKKyAqIAorICogICAgICBodHRwOi8vd3d3LmFwYWNoZS5vcmcvbGljZW5zZXMvTElDRU5TRS0yLjAKKyAqIAorICogVW5sZXNzIHJlcXVpcmVkIGJ5IGFwcGxpY2FibGUgbGF3IG9yIGFncmVlZCB0byBpbiB3cml0aW5nLCBzb2Z0d2FyZQorICogZG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PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorICogQ29weXJpZ2h0IChDKSAyMDE3IEFUJlQgSW50ZWxsZWN0dWFsIFByb3BlcnR5CisgKiA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorICogTGljZW5zZWQgdW5kZXIgdGhlIEFwYWNoZSBMaWNlbnNlLCBWZXJzaW9uIDIuMCAodGhlICJMaWNlbnNlIik7CisgKiB5b3UgbWF5IG5vdCB1c2UgdGhpcyBmaWxlIGV4Y2VwdCBpbiBjb21wbGlhbmNlIHdpdGggdGhlIExpY2Vuc2UuCisgKiBZb3UgbWF5IG9idGFpbiBhIGNvcHkgb2YgdGhlIExpY2Vuc2UgYXQKKyAqIAorICogICAgICBodHRwOi8vd3d3LmFwYWNoZS5vcmcvbGljZW5zZXMvTElDRU5TRS0yLjAKKyAqIAorICogVW5sZXNzIHJlcXVpcmVkIGJ5IGFwcGxpY2FibGUgbGF3IG9yIGFncmVlZCB0byBpbiB3cml0aW5nLCBzb2Z0d2FyZQorICogZGlzdHJpYnV0ZWQgdW5kZXIgdGhlIExpY2Vuc2UgaXMgZGlzdHJpYnV0ZWQgb24gYW4gIkFTIElTIiBCQVNJUywKKyAqIFdJVEhPVVQgV0FSUkFOVElFUyBPUiBDT05ESVRJT05TIE9GIEFOWSBLSU5ELCBlaXRoZXIgZXhwcmVzcyBvciBpbXBsaWVkLgorICogU2VlIHRoZSBMaWNlbnNlIGZvciB0aGUgc3BlY2lmaWMgbGFuZ3VhZ2UgZ292ZXJuaW5nIHBlcm1pc3Npb25zIGFuZAorICogbGltaXRhdGlvbnMgdW5kZXIgdGhlIExpY2Vuc2UuCisgKiA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorICovCitwYWNrYWdlIG9yZy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09PT09PT09PT09PT0KKyAqIENvcHlyaWdodCAoQykgMjAxNyBBVCZUIEludGVsbGVjdHVhbCBQcm9wZXJ0eQorICogPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKyAqIExpY2Vuc2VkIHVuZGVyIHRoZSBBcGFjaGUgTGljZW5zZSwgVmVyc2lvbiAyLjAgKHRoZSAiTGljZW5zZSIpOworICogeW91IG1heSBub3QgdXNlIHRoaXMgZmlsZSBleGNlcHQgaW4gY29tcGxpYW5jZSB3aXRoIHRoZSBMaWNlbnNlLgorICogWW91IG1heSBvYnRhaW4gYSBjb3B5IG9mIHRoZSBMaWNlbnNlIGF0CisgKiAKKyAqICAgICAgaHR0cDovL3d3dy5hcGFjaGUub3JnL2xpY2Vuc2VzL0xJQ0VOU0UtMi4wCisgKiAKKyAqIFVubGVzcyByZXF1aXJlZCBieSBhcHBsaWNhYmxlIGxhdyBvciBhZ3JlZWQgdG8gaW4gd3JpdGluZywgc29mdHdhcmUKKyAqIGRpc3RyaWJ1dGVkIHVuZGVyIHRoZSBMaWNlbnNlIGlzIGRpc3RyaWJ1dGVkIG9uIGFuICJBUyBJUyIgQkFTSVMsCisgKiBXSVRIT1VUIFdBUlJBTlRJRVMgT1IgQ09ORElUSU9OUyBPRiBBTlkgS0lORCwgZWl0aGVyIGV4cHJlc3Mgb3IgaW1wbGllZC4KKyAqIFNlZSB0aGUgTGljZW5zZSBmb3IgdGhlIHNwZWNpZmljIGxhbmd1YWdlIGdvdmVybmluZyBwZXJtaXNzaW9ucyBhbmQKKyAqIGxpbWl0YXRpb25zIHVuZGVyIHRoZSBMaWNlbnNlLgorICogPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKyAqLworcGFja2FnZSBvcmcub3BlbmVjb21wLnBvcnRhbGFwcC5wb3J0YW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Q29udGFjdFVzSXRlbS5qYXZhCkBAIC0wLDAgKzEsMTA0IEBACisvKi0KKyAqID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisgKiBlQ09NUCBQb3J0YWwKKyAqID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisgKiBDb3B5cmlnaHQgKEMpIDIwMTcgQVQmVCBJbnRlbGxlY3R1YWwgUHJvcGVydHkKKyAqID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisgKiBMaWNlbnNlZCB1bmRlciB0aGUgQXBhY2hlIExpY2Vuc2UsIFZlcnNpb24gMi4wICh0aGUgIkxpY2Vuc2UiKTsKKyAqIHlvdSBtYXkgbm90IHVzZSB0aGlzIGZpbGUgZXhjZXB0IGluIGNvbXBsaWFuY2Ugd2l0aCB0aGUgTGljZW5zZS4KKyAqIFlvdSBtYXkgb2J0YWluIGEgY29weSBvZiB0aGUgTGljZW5zZSBhdAorICogCisgKiAgICAgIGh0dHA6Ly93d3cuYXBhY2hlLm9yZy9saWNlbnNlcy9MSUNFTlNFLTIuMAorICogCisgKiBVbmxlc3MgcmVxdWlyZWQgYnkgYXBwbGljYWJsZSBsYXcgb3IgYWdyZWVkIHRvIGluIHdyaXRpbmcsIHNvZnR3YXJlCisgKiBkaXN0cmlidXRlZCB1bmRlciB0aGUgTGljZW5zZSBpcyBkaXN0cmlidXRlZCBvbiBhbiAiQVMgSVMiIEJBU0lTLAorICogV0lUSE9VVCBXQVJSQU5USUVTIE9SIENPTkRJVElPTlMgT0YgQU5ZIEtJTkQsIGVpdGhlciBleHByZXNzIG9yIGltcGxpZWQuCisgKiBTZWUgdGhlIExpY2Vuc2UgZm9yIHRoZSBzcGVjaWZpYy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0aGlzLnVybCA9IHVybDsKKwl9CisKKwlwdWJsaWMgU3RyaW5nIGdldEFjdGl2ZVlOKCkgeworCQlyZXR1cm4gYWN0aXZlWU47CisJfQorCisJcHVibGljIHZvaWQgc2V0QWN0aXZlWU4oU3RyaW5nIGFjdGl2ZVlOKSB7CisJCXRoaXMuYWN0aXZlWU4gPSBhY3RpdmVZTjsKKwl9CisKKworfQpkaWZmIC0tZ2l0IGEvZWNvbXAtcG9ydGFsLUJFL3NyYy9tYWluL2phdmEvb3JnL29wZW5lY29tcC9wb3J0YWxhcHAvcG9ydGFsL2Vjb21wL21vZGVsL0NvbW1vbldpZGdldHNFbnVtLmphdmEgYi9lY29tcC1wb3J0YWwtQkUvc3JjL21haW4vamF2YS9vcmcvb3BlbmVjb21wL3BvcnRhbGFwcC9wb3J0YWwvZWNvbXAvbW9kZWwvQ29tbW9uV2lkZ2V0c0VudW0uamF2YQpuZXcgZmlsZSBtb2RlIDEwMDY0NAppbmRleCAwMDAwMDAwLi42MjcwNzUxCi0tLSAvZGV2L251bGwKKysrIGIvZWNvbXAtcG9ydGFsLUJFL3NyYy9tYWluL2phdmEvb3JnL29wZW5lY29tcC9wb3J0YWxhcHAvcG9ydGFsL2Vjb21wL21vZGVsL0NvbW1vbldpZGdldHNFbnVtLmphdmEKQEAgLTAsMCArMSwzNiBAQAorLyotCisgKiA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorICogZUNPTVAgUG9ydGFsCisgKiA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorICogQ29weXJpZ2h0IChDKSAyMDE3IEFUJlQgSW50ZWxsZWN0dWFsIFByb3BlcnR5CisgKiA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09P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mluZyB2YWx1ZTsKKwlwcml2YXRlIENvbW1vbldpZGdldHNFbnVtKFN0cmluZyB2YWx1ZSl7CisJCXRoaXMudmFsdWUgPSB2YWx1ZTsKKwl9CisJCisJQE92ZXJyaWRlCisgICAgcHVibGljIFN0cmluZyB0b1N0cmluZygpIHsKKyAgICAgICAgcmV0dXJuIHZhbHVlOworICAgIH0KK30KZGlmZiAtLWdpdCBhL2Vjb21wLXBvcnRhbC1CRS9zcmMvbWFpbi9qYXZhL29yZy9vcGVuZWNvbXAvcG9ydGFsYXBwL3BvcnRhbC9lY29tcC9tb2RlbC9Qb3J0YWxSZXN0UmVzcG9uc2UuamF2YSBiL2Vjb21wLXBvcnRhbC1CRS9zcmMvbWFpbi9qYXZhL29yZy9vcGVuZWNvbXAvcG9ydGFsYXBwL3BvcnRhbC9lY29tcC9tb2RlbC9Qb3J0YWxSZXN0UmVzcG9uc2UuamF2YQpuZXcgZmlsZSBtb2RlIDEwMDY0NAppbmRleCAwMDAwMDAwLi40ZjkyZTc1Ci0tLSAvZGV2L251bGwKKysrIGIvZWNvbXAtcG9ydGFsLUJFL3NyYy9tYWluL2phdmEvb3JnL29wZW5lY29tcC9wb3J0YWxhcHAvcG9ydGFsL2Vjb21wL21vZGVsL1BvcnRhbFJlc3RSZXNwb25zZS5qYXZhCkBAIC0wLDAgKzEsNjAgQEAKKy8qLQorICogPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKyAqIGVDT01QIFBvcnRhbAorICogPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKyAqIENvcHlyaWdodCAoQykgMjAxNyBBVCZUIEludGVsbGVjdHVhbCBQcm9wZXJ0eQorICogPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT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XAvcG9ydGFsYXBwL3BvcnRhbC9lY29tcC9tb2RlbC9Qb3J0YWxSZXN0U3RhdHVzRW51bS5qYXZhCm5ldyBmaWxlIG1vZGUgMTAwNjQ0CmluZGV4IDAwMDAwMDAuLmVjZWFiYWMKLS0tIC9kZXYvbnVsbAorKysgYi9lY29tcC1wb3J0YWwtQkUvc3JjL21haW4vamF2YS9vcmcvb3BlbmVjb21wL3BvcnRhbGFwcC9wb3J0YWwvZWNvbXAvbW9kZWwvUG9ydGFsUmVzdFN0YXR1c0VudW0uamF2YQpAQCAtMCwwICsxLDM1IEBACisvKi0KKyAqID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisgKiBlQ09NUCBQb3J0YWwKKyAqID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisgKiBDb3B5cmlnaHQgKEMpIDIwMTcgQVQmVCBJbnRlbGxlY3R1YWwgUHJvcGVydHkKKyAqID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisgKiBMaWNlbnNlZCB1bmRlciB0aGUgQXBhY2hlIExpY2Vuc2UsIFZlcnNpb24gMi4wICh0aGUgIkxpY2Vuc2UiKTsKKyAqIHlvdSBtYXkgbm90IHVzZSB0aGlzIGZpbGUgZXhjZXB0IGluIGNvbXBsaWFuY2Ugd2l0aCB0aGUgTGljZW5zZS4KKyAqIFlvdSBtYXkgb2J0YWluIGEgY29weSBvZiB0aGUgTGljZW5zZSBhdAorICogCisgKiAgICAgIGh0dHA6Ly93d3cuYXBhY2hlLm9yZy9saWNlbnNlcy9MSUNFTlNFLTIuMAorICogCisgKiBVbmxlc3MgcmVxdWlyZWQgYnkgYXBwbGljYWJsZSBsYXcgb3IgYWdyZWVkIHRvI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J0YWwvZWNvbXAvbW9kZWwvU2VhcmNoUmVzdWx0SXRlbS5qYXZhCm5ldyBmaWxlIG1vZGUgMTAwNjQ0CmluZGV4IDAwMDAwMDAuLjBmYWRhYjgKLS0tIC9kZXYvbnVsbAorKysgYi9lY29tcC1wb3J0YWwtQkUvc3JjL21haW4vamF2YS9vcmcvb3BlbmVjb21wL3BvcnRhbGFwcC9wb3J0YWwvZWNvbXAvbW9kZWwvU2VhcmNoUmVzdWx0SXRlbS5qYXZhCkBAIC0wLDAgKzEsOTIgQEAKKy8qLQorICogPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKyAqIGVDT01QIFBvcnRhbAorICogPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKyAqIENvcHlyaWdodCAoQykgMjAxNyBBVCZUIEludGVsbGVjdHVhbCBQcm9wZXJ0eQorICogPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKyAqIExpY2Vuc2VkIHVuZGVyIHRoZSBBcGFjaGUgTGljZW5zZSwgVmVyc2lvbiAyLjAgKHRoZSAiTGljZW5zZSIpOworICogeW91IG1heSBub3QgdXNlIHRoaXMgZmlsZSBleGNlcHQgaW4gY29tcGxpYW5jZSB3aXRoIHRoZSBMaWNlbnNlLgorICogWW91IG1heSBvYnRhaW4gYSBjb3B5IG9mIHRoZSBMaWNlbnNlIGF0CisgKiAKKyAqICAgICAgaHR0cDovL3d3dy5hcGFjaGUub3JnL2xpY2Vuc2VzL0xJQ0VOU0UtMi4wCisgKiAKKyAqIFVubGVzcyByZXF1aXJlZCBieSBhcHBsaWNhYmxlIGxhdyBvciBhZ3JlZWQgdG8gaW4gd3JpdGluZywgc29mdHdhcmUKKyAqIGR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YXRlc05hdGl2ZShyZXF1ZXN0LCBudWxsLCBudWxsLCBudWxsLCBudWxsLCBtYW5hZ2VTZXJ2aWNlKTsKKwl9Cit9CmRpZmYgLS1naXQgYS9lY29tcC1wb3J0YWwtQkUvc3JjL21haW4vamF2YS9vcmcvb3BlbmVjb21wL3BvcnRhbGFwcC9wb3J0YWwvaW50ZXJjZXB0b3IvU2Vzc2lvblRpbWVvdXRJbnRlcmNlcHRvci5qYXZhIGIvZWNvbXAtcG9ydGFsLUJFL3NyYy9tYWluL2phdmEvb3JnL29wZW5lY29tcC9wb3J0YWxhcHAvcG9ydGFsL2ludGVyY2VwdG9yL1Nlc3Npb25UaW1lb3V0SW50ZXJjZXB0b3IuamF2YQpuZXcgZmlsZSBtb2RlIDEwMDY0NAppbmRleCAwMDAwMDAwLi5jZDBhMzAzCi0tLSAvZGV2L251bGwKKysrIGIvZWNvbXAtcG9ydGFsLUJFL3NyYy9tYWluL2phdmEvb3JnL29wZW5lY29tcC9wb3J0YWxhcHAvcG9ydGFsL2ludGVyY2VwdG9yL1Nlc3Npb25UaW1lb3V0SW50ZXJjZXB0b3IuamF2YQpAQCAtMCwwICsxLDk3IEBACisvKi0KKyAqID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisgKiBlQ09NUCBQb3J0YWwKKyAqID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisgKiBDb3B5cmlnaHQgKEMpIDIwMTcgQVQmVCBJbnRlbGxlY3R1YWwgUHJvcGVydHkKKyAqID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisgKiBMaWNlbnNlZCB1bmRlciB0aGUgQXBhY2hlIExpY2Vuc2UsIFZlcnNpb24gMi4wICh0aGUg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0ZW5lci9IZWFsdGhNb25pdG9yLmphdmEgYi9lY29tcC1wb3J0YWwtQkUvc3JjL21haW4vamF2YS9vcmcvb3BlbmVjb21wL3BvcnRhbGFwcC9wb3J0YWwvbGlzdGVuZXIvSGVhbHRoTW9uaXRvci5qYXZhCm5ldyBmaWxlIG1vZGUgMTAwNjQ0CmluZGV4IDAwMDAwMDAuLjZiNzFlZWIKLS0tIC9kZXYvbnVsbAorKysgYi9lY29tcC1wb3J0YWwtQkUvc3JjL21haW4vamF2YS9vcmcvb3BlbmVjb21wL3BvcnRhbGFwcC9wb3J0YWwvbGlzdGVuZXIvSGVhbHRoTW9uaXRvci5qYXZhCkBAIC0wLDAgKzEsMzkzIEBACisvKi0KKyAqID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisgKiBlQ09NUCBQb3J0YWwKKyAqID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisgKiBDb3B5cmlnaHQgKEMpIDIwMTcgQVQmVCBJbnRlbGxlY3R1YWwgUHJvcGVydHkKKyAqID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisgKiBMaWNlbnNlZCB1bmRlciB0aGUgQXBhY2hlIExpY2Vuc2UsIFZlcnNpb24gMi4wICh0aGUgIkxpY2Vuc2UiKTsKKyAqIHlvdSBtYXkgbm90IHVzZSB0aGlzIGZpbGUgZXhjZXB0IGluIGNvbXBsaWFuY2Ugd2l0aCB0aGUgTGljZW5zZS4KKyAqIFlvdSBtYXkgb2J0YWluIGEgY29weSBvZiB0aGUgTGljZW5zZSBhdAorICogCisgKiAgICAgIGh0dHA6Ly93d3cuYXBhY2hlLm9yZy9saWNlbnNlcy9MSUNFTlNFLTIuMAorICogCisgKiB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AgICB1cmwgPSB1cmwucmVwbGFjZSgiaW5kZXguaHRtbCIsICJhcHAvaGVhbHRoQ2hlY2suanNvbiIpOworCSAgICAgICAgICAgIAkgICAgICAgICAgICAKKwkgICAgICAgICAgICBVUkwgZnJvbnRFbmRVUkwgPSBuZXcgVVJMKHVybCk7CisJICAgICAgICAgICAgCisJICAgICAgICAgICAgSHR0cFVSTENvbm5lY3Rpb24gY29uID0gKEh0dHBVUkxDb25uZWN0aW9uKSBmcm9udEVuZFVSTC5vcGVuQ29ubmVjdGlvbigpOworCisJICAgICAgICAgICAgLy8gb3B0aW9uYWwgZGVmYXVsdCBpcyBHRVQKKwkgICAgICAgICAgICBjb24uc2V0UmVxdWVzdE1ldGhvZCgiR0VUIik7CisJICAgICAgICAgICAgCisJICAgICAgICAgICAgaW50IHJlc3BvbnNlQ29kZSA9IGNvbi5nZXRSZXNwb25zZUNvZGUoKTsKKwkgICAgICAgICAgICBsb2dnZXIuZGVidWcoRUVMRkxvZ2dlckRlbGVnYXRlLmRlYnVnTG9nZ2VyLCAiRnJvbmVuZCByZXNwb25zZSBjb2RlIDogIiArIHJlc3BvbnNlQ29kZSk7CisJICAgICAgICAgICAgCSAgICAgICAgICAgIAorCSAgICAgICAgICAgIGlmKHJlc3BvbnNlQ29kZSA9PSAyMDApCisJICAgICAgICAgICAgeworCSAgICAgICAgICAgIAlmcm9udGVubmRVcCA9IHRydWU7CisJICAgICAgICAgICAgfQkgICAgICAgICAgICAKKwkgICAgCSAgCisJCX0KKwkJY2F0Y2goRXhjZXB0aW9uIGUpeworCQkJbG9nZ2VyLmVycm9yKEVFTEZMb2dnZXJEZWxlZ2F0ZS5lcnJvckxvZ2dlciwgIkV4Y2VwdGlvbiBvY2N1cnJlZCB3aGlsZSB0cnlpbmcgdG8gYWNjZXNzIGZvbnQgZW5kIiArIEVjb21wUG9ydGFsVXRpbHMuZ2V0U3RhY2tUcmFjZShlKSk7CisJICAgIH0KKwkJCisJCXJldHVybiBmcm9udGVubmRVcDsJCQkJCisJfQorCSovCit9CmRpZmYgLS1naXQgYS9lY29tcC1wb3J0YWwtQkUvc3JjL21haW4vamF2YS9vcmcvb3BlbmVjb21wL3BvcnRhbGFwcC9wb3J0YWwvbGlzdGVuZXIvVXNlckNvbnRleHRMaXN0ZW5lci5qYXZhIGIvZWNvbXAtcG9ydGFsLUJFL3NyYy9tYWluL2phdmEvb3JnL29wZW5lY29tcC9wb3J0YWxhcHAvcG9ydGFsL2xpc3RlbmVyL1VzZXJDb250ZXh0TGlzdGVuZXIuamF2YQpuZXcgZmlsZSBtb2RlIDEwMDY0NAppbmRleCAwMDAwMDAwLi44MjU1OTE0Ci0tLSAvZGV2L251bGwKKysrIGIvZWNvbXAtcG9ydGFsLUJFL3NyYy9tYWluL2phdmEvb3JnL29wZW5lY29tcC9wb3J0YWxhcHAvcG9ydGFsL2xpc3RlbmVyL1VzZXJDb250ZXh0TGlzdGVuZXIuamF2YQpAQCAtMCwwICsxLDQ5IEBACisvKi0KKyAqID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisgKiBlQ09NUCBQb3J0YWwKKyAqID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisgKiBDb3B5cmlnaHQgKEMpIDIwMTcgQVQmVCBJbnRlbGxlY3R1YWwgUHJvcGVydHkKKyAqID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisgKiBMaWNlbnNlZCB1bmRlciB0aGUgQXBhY2hlIExpY2Vuc2UsIFZlcnNpb24gMi4wICh0aGUgIkxpY2Vuc2UiKTsKKyAqIHlvdSBtYXkgbm90IHVzZSB0aGlzIGZpbGUgZXhjZXB0IGluIGNvbXBsaWFuY2Ugd2l0aCB0aGUgTGljZW5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LUJFL3NyYy9tYWluL2phdmEvb3JnL29wZW5lY29tcC9wb3J0YWxhcHAvcG9ydGFsL2xpc3RlbmVyL1VzZXJTZXNzaW9uTGlzdGVuZXIuamF2YSBiL2Vjb21wLXBvcnRhbC1CRS9zcmMvbWFpbi9qYXZhL29yZy9vcGVuZWNvbXAvcG9ydGFsYXBwL3BvcnRhbC9saXN0ZW5lci9Vc2VyU2Vzc2lvbkxpc3RlbmVyLmphdmEKbmV3IGZpbGUgbW9kZSAxMDA2NDQKaW5kZXggMDAwMDAwMC4uOWI0OGM2MgotLS0gL2Rldi9udWxsCisrKyBiL2Vjb21wLXBvcnRhbC1CRS9zcmMvbWFpbi9qYXZhL29yZy9vcGVuZWNvbXAvcG9ydGFsYXBwL3BvcnRhbC9saXN0ZW5lci9Vc2VyU2Vzc2lvbkxpc3RlbmVyLmphdmEKQEAgLTAsMCArMSwxMjUgQEAKKy8qLQorICogPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKyAqIGVDT01QIFBvcnRhbAorICogPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKyAqIENvcHlyaWdodCAoQykgMjAxNyBBVCZUIEludGVsbGVjdHVhbCBQcm9wZXJ0eQorICogPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKyAqIExpY2Vuc2VkIHVuZGVyIHRoZSBBcGFjaGUgTGljZW5zZSwgVmVyc2lvbiAyLjAgKHRoZSAiTGljZW5zZSIpOworICogeW91IG1heSBub3QgdXNlIHRoaXMgZmlsZSBleGNlcHQgaW4gY29tcGxpYW5jZSB3aXRoIHRoZSBMaWNlbnNlLgorICogWW91IG1heSBvYnRhaW4gYSBjb3B5IG9mIHRoZSBMaWNl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CQl9CisJCQorCQlyZXR1cm4gc2hhcmVkQ29udGV4dFNlcnZpY2U7CisJfQorCisJcHVibGljIHZvaWQgc2V0U2hhcmVkQ29udGV4dFNlcnZpY2UoU2hhcmVkQ29udGV4dFNlcnZpY2Ugc2hhcmVkQ29udGV4dFNlcnZpY2UpIHsKKwkJdGhpcy5zaGFyZWRDb250ZXh0U2VydmljZSA9IHNoYXJlZENvbnRleHRTZXJ2aWNlOworCX0KK30KKwpkaWZmIC0tZ2l0IGEvZWNvbXAtcG9ydGFsLUJFL3NyYy9tYWluL2phdmEvb3JnL29wZW5lY29tcC9wb3J0YWxhcHAvcG9ydGFsL2xvZ2dpbmcvYW9wL0VQQXVkaXRMb2cuamF2YSBiL2Vjb21wLXBvcnRhbC1CRS9zcmMvbWFpbi9qYXZhL29yZy9vcGVuZWNvbXAvcG9ydGFsYXBwL3BvcnRhbC9sb2dnaW5nL2FvcC9FUEF1ZGl0TG9nLmphdmEKbmV3IGZpbGUgbW9kZSAxMDA2NDQKaW5kZXggMDAwMDAwMC4uMTVhNGM3ZgotLS0gL2Rldi9udWxsCisrKyBiL2Vjb21wLXBvcnRhbC1CRS9zcmMvbWFpbi9qYXZhL29yZy9vcGVuZWNvbXAvcG9ydGFsYXBwL3BvcnRhbC9sb2dnaW5nL2FvcC9FUEF1ZGl0TG9nLmphdmEKQEAgLTAsMCArMSwzMSBAQAorLyotCisgKiA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorICogZUNPTVAgUG9ydGFsCisgKiA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorICogQ29weXJpZ2h0IChDKSAyMDE3IEFUJlQgSW50ZWxsZWN0dWFsIFByb3BlcnR5CisgKiA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT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5qYXZhCkBAIC0wLDAgKzEsMzEgQEAKKy8qLQorICogPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKyAqIGVDT01QIFBvcnRhbAorICogPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKyAqIENvcHlyaWdodCAoQykgMjAxNyBBVCZUIEludGVsbGVjdHVhbCBQcm9wZXJ0eQorICogPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKyAqIExpY2Vuc2VkIHVuZGVyIHRoZSBBcGFjaGUgTGljZW5zZSwgVmVyc2lvbiAyLjAgKHRoZSAiTGljZW5zZSIpOworICogeW91IG1heSBub3QgdXNlIHRoaXMgZmlsZSBleGNlcHQgaW4gY29tcGxpYW5jZSB3aXRoIHRoZSBMaWNlbnNlLgorICogWW91IG1heSBvYnRhaW4gYSBjb3B5IG9mIHRoZSBMaWNlbnNlIGF0CisgKiAKKyAqICAgICAgaHR0cDovL3d3dy5hcGFjaGUub3JnL2xpY2Vuc2VzL0xJQ0VOU0UtMi4wCisgKiAKKyAqIFVubGVzcyByZXF1aXJlZCBieSBhcHBsaWNhYmxlIGxhdyBvciBhZ3JlZWQgdG8gaW4gd3JpdGluZywgc29mdHdhcmUKKyAqIGRpc3RyaWJ1dGVkIHVuZGVyIHRoZSBMaWNlbnNlIGlzIGRpc3RyaWJ1dGVkIG9uIGFuICJBUyBJUyIgQkFTSVMsCisgKiBXSVRIT1VUIFdBUlJBTlRJRVMgT1IgQ09ORElUSU9OUyBPRiBBTlkgS0lORCwgZWl0aGVyIGV4cHJlc3Mgb3IgaW1wbGllZC4KKyAqIFNlZSB0aGUgTGljZW5zZSBmb3IgdGhlIHNwZWNpZmljIGxhbmd1YWdlIGdv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yYy9tYWluL2phdmEvb3JnL29wZW5lY29tcC9wb3J0YWxhcHAvcG9ydGFsL2xvZ2dpbmcvZm9ybWF0L0FwcGxpY2F0aW9uQ29kZXMucHJvcGVydGllcwpAQCAtMCwwICsxLDE0MSBAQAorIyMjCisjID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisjIGVDT01QIFBvcnRhbAorIyA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorIyBDb3B5cmlnaHQgKEMpIDIwMTcgQVQmVCBJbnRlbGxlY3R1YWwgUHJvcGVydHkKKyMgPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKyMgTGljZW5zZWQgdW5kZXIgdGhlIEFwYWNoZSBMaWNlbnNlLCBWZXJzaW9uIDIuMCAodGhlICJMaWNlbnNlIik7CisjIHlvdSBtYXkgbm90IHVzZSB0aGlzIGZpbGUgZXhjZXB0IGluIGNvbXBsaWFuY2Ugd2l0aCB0aGUgTGljZW5zZS4KKyMgWW91IG1heSBvYnRhaW4gYSBjb3B5IG9mIHRoZSBMaWNlbnNlIGF0CisjIAorIyAgICAgIGh0dHA6Ly93d3cuYXBhY2hlLm9yZy9saWNlbnNlcy9MSUNFTlNFLTIuMAorIyAKKyMgVW5sZXNzIHJlcXVpcmVkIGJ5IGFwcGxpY2FibGUgbGF3IG9yIGFncmVlZCB0byBpbiB3cml0aW5nLCBzb2Z0d2FyZQorIyBkaXN0cmlidXRlZCB1bmRlciB0aGUgTGljZW5zZSBpcyBkaXN0cmlidXRlZCBvbiBhbiAiQVMgSVMiIEJBU0lTLAorIyBXSVRIT1VUIFdBUlJBTlRJRVMgT1IgQ09ORElUSU9OUyBPRiBBTlkgS0lORCwgZWl0a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EV0FSTklOR19PTkVfQVJHVU1FTlQ9CXx8fERlc2NyaXB0aW9uOiB7MH0uCisKK0lOVEVSTkFMVU5FWFBFQ1RFREVSUk9SX09ORV9BUkdVTUVOVD0JfHx8RGVzY3JpcHRpb246IHswfS4KKworSU5URVJOQUxVTkVYUEVDVEVERkFUQUxfT05FX0FSR1VNRU5UPQl8fHxEZXNjcmlwdGlvbjogezB9LgpkaWZmIC0tZ2l0IGEvZWNvbXAtcG9ydGFsLUJFL3NyYy9tYWluL2phdmEvb3JnL29wZW5lY29tcC9wb3J0YWxhcHAvcG9ydGFsL2xvZ2dpbmcvZm9ybWF0L0VQQXBwTWVzc2FnZXNFbnVtLmphdmEgYi9lY29tcC1wb3J0YWwtQkUvc3JjL21haW4vamF2YS9vcmcvb3BlbmVjb21wL3BvcnRhbGFwcC9wb3J0YWwvbG9nZ2luZy9mb3JtYXQvRVBBcHBNZXNzYWdlc0VudW0uamF2YQpuZXcgZmlsZSBtb2RlIDEwMDY0NAppbmRleCAwMDAwMDAwLi5hYWU1NmU5Ci0tLSAvZGV2L251bGwKKysrIGIvZWNvbXAtcG9ydGFsLUJFL3NyYy9tYWluL2phdmEvb3JnL29wZW5lY29tcC9wb3J0YWxhcHAvcG9ydGFsL2xvZ2dpbmcvZm9ybWF0L0VQQXBwTWVzc2FnZXNFbnVtLmphdmEKQEAgLTAsMCArMSwyNjAgQEAKKy8qLQorICogPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKyAqIGVDT01QIFBvcnRhbAorICogPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKyAqIENvcHlyaWdodCAoQykgMjAxNyBBVCZUIEludGVsbGVjdHVhbCBQcm9wZXJ0eQorICogPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09P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GFsL2xvZ2dpbmcvZm9ybWF0L0VQRXJyb3JDb2Rlc0VudW0uamF2YSBiL2Vjb21wLXBvcnRhbC1CRS9zcmMvbWFpbi9qYXZhL29yZy9vcGVuZWNvbXAvcG9ydGFsYXBwL3BvcnRhbC9sb2dnaW5nL2Zvcm1hdC9FUEVycm9yQ29kZXNFbnVtLmphdmEKbmV3IGZpbGUgbW9kZSAxMDA2NDQKaW5kZXggMDAwMDAwMC4uMzk3NzFlMwotLS0gL2Rldi9udWxsCisrKyBiL2Vjb21wLXBvcnRhbC1CRS9zcmMvbWFpbi9qYXZhL29yZy9vcGVuZWNvbXAvcG9ydGFsYXBwL3BvcnRhbC9sb2dnaW5nL2Zvcm1hdC9FUEVycm9yQ29kZXNFbnVtLmphdmEKQEAgLTAsMCArMSw5NSBAQAorLyotCisgKiA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorICogZUNPTVAgUG9ydGFsCisgKiA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorICogQ29weXJpZ2h0IChDKSAyMDE3IEFUJlQgSW50ZWxsZWN0dWFsIFByb3BlcnR5CisgKiA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorICogTGljZW5zZWQgdW5kZXIgdGhlIEFwYWNoZSBMaWNlbnNlLCBWZXJzaW9uIDIuMCAodGhlICJMaWNlbnNlIik7CisgKiB5b3UgbWF5IG5vdCB1c2UgdGhpcyBmaWxlIGV4Y2VwdCBpbiBjb21wbGlhbmNlIHdpdGggdGhlIExpY2Vuc2UuCisgKiBZb3UgbWF5IG9idGFpbiBhIGNvcHkgb2YgdGhlIExpY2Vuc2UgYXQKKyAqIAorICogICAgICBodHRwOi8vd3d3LmFwYW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1lc3NhZ2VzIGZyb20gdGhyZWUgYnVuZGxlcworICAgICAqLworICAgIHN0YXRpYyB7CisgICAgICAgIEVFTEZSZXNvdXJjZU1hbmFnZXIubG9hZE1lc3NhZ2VCdW5kbGUoIm9yZy9vcGVuZWNvbXAvcG9ydGFsYXBwL3BvcnRhbC9sb2dnaW5nL2Zvcm1hdC9BcHBsaWNhdGlvbkNvZGVzIik7CisgICAgfQorfQpkaWZmIC0tZ2l0IGEvZWNvbXAtcG9ydGFsLUJFL3NyYy9tYWluL2phdmEvb3JnL29wZW5lY29tcC9wb3J0YWxhcHAvcG9ydGFsL2xvZ2dpbmcvbG9naWMvRVBMb2dVdGlsLmphdmEgYi9lY29tcC1wb3J0YWwtQkUvc3JjL21haW4vamF2YS9vcmcvb3BlbmVjb21wL3BvcnRhbGFwcC9wb3J0YWwvbG9nZ2luZy9sb2dpYy9FUExvZ1V0aWwuamF2YQpuZXcgZmlsZSBtb2RlIDEwMDY0NAppbmRleCAwMDAwMDAwLi40ODlhNjhhCi0tLSAvZGV2L251bGwKKysrIGIvZWNvbXAtcG9ydGFsLUJFL3NyYy9tYWluL2phdmEvb3JnL29wZW5lY29tcC9wb3J0YWxhcHAvcG9ydGFsL2xvZ2dpbmcvbG9naWMvRVBMb2dVdGlsLmphdmEKQEAgLTAsMCArMSw3NiBAQAorLyotCisgKiA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorICogZUNPTVAgUG9ydGFsCisgKiA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorICogQ29weXJpZ2h0IChDKSAyMDE3IEFUJlQgSW50ZWxsZWN0dWFsIFByb3BlcnR5CisgKiA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT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aWNlLmphdmEKQEAgLTAsMCArMSw1MiBAQAorLyotCisgKiA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorICogZUNPTVAgUG9ydGFsCisgKiA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorICogQ29weXJpZ2h0IChDKSAyMDE3IEFUJlQgSW50ZWxsZWN0dWFsIFByb3BlcnR5CisgKiA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorICogTGljZW5zZWQgdW5kZXIgdGhlIEFwYWNoZSBMaWNlbnNlLCBWZXJzaW9uIDIuMCAodGhlICJMaWNlbnNlIik7CisgKiB5b3UgbWF5IG5vdCB1c2UgdGhpcyBmaWxlIGV4Y2VwdCBpbiBjb21wbGlhbmNlIHdpdGggdGhlIExpY2Vuc2UuCisgKiBZb3UgbWF5IG9idGFpbiBhIGNvcHkgb2YgdGhlIExpY2Vuc2UgYXQKKyAqIAorICogICAgICBodHRwOi8vd3d3LmFwYWNoZS5vcmcvbGljZW5zZXMvTElDRU5TRS0yLjAKKyAqIAorICogVW5sZXNzIHJlcXVpcmVkIGJ5IGFwcGxpY2FibGUgbGF3IG9yIGFncmVlZCB0byBpbiB3cml0aW5nLCBzb2Z0d2FyZQorICogZGlzdHJpYnV0ZWQgdW5kZXIgdGhlIExpY2Vuc2UgaXMgZGlzdHJpYnV0ZWQgb24gYW4gIkFTIElTIiBCQVNJUywKKyAqIFdJVEhPVVQgV0FSUkFOVElFUyBPUiBDT05ESVRJT05TIE9GIEFOWSBLSU5ELCBlaXRoZXIgZXhwcmVzcyBvciBpbXBsaWVkLgorICogU2VlIHRoZSBMaWNlbnNlIGZvciB0aGUgc3BlY2lmaWMgbGFuZ3VhZ2UgZ292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lIG1vZGUgMTAwNjQ0CmluZGV4IDAwMDAwMDAuLjUwOGJkM2QKLS0tIC9kZXYvbnVsbAorKysgYi9lY29tcC1wb3J0YWwtQkUvc3JjL21haW4vamF2YS9vcmcvb3BlbmVjb21wL3BvcnRhbGFwcC9wb3J0YWwvc2VydmljZS9BZG1pblJvbGVzU2VydmljZUltcGwuamF2YQpAQCAtMCwwICsxLDMxOCBAQAorLyotCisgKiA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorICogZUNPTVAgUG9ydGFsCisgKiA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorICogQ29weXJpZ2h0IChDKSAyMDE3IEFUJlQgSW50ZWxsZWN0dWFsIFByb3BlcnR5CisgKiA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorICogTGljZW5zZWQgdW5kZXIgdGhlIEFwYWNoZSBMaWNlbnNlLCBWZXJzaW9uIDIuMCAodGhlICJMaWNlbnNlIik7CisgKiB5b3UgbWF5IG5vdCB1c2UgdGhpcyBmaWxlIGV4Y2VwdCBpbiBjb21wbGlhbmNlIHdpdGggdGhlIExpY2Vuc2UuCisgKiBZb3UgbWF5IG9idGFpbiBhIGNvcHkgb2YgdGhlIExpY2Vuc2UgYXQKKyAqIAorICogICAgICBodHRwOi8vd3d3LmFwYWNoZS5vcmcvbGljZW5zZXMvTElDRU5TRS0yLjAKKyAqIAorICogVW5sZXNzIHJlcXVpcmVkIGJ5IGFwcGxpY2FibGUgbGF3IG9yIGFncmVlZCB0byBpbiB3cml0aW5nLCBzb2Z0d2FyZQorICogZGlzdHJpYnV0ZWQgdW5kZXIgdGhlIExpY2Vuc2UgaXMgZGlzdHJpYnV0ZWQgb24gYW4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DAwMDAwLi5jODFmMjkzCi0tLSAvZGV2L251bGwKKysrIGIvZWNvbXAtcG9ydGFsLUJFL3NyYy9tYWluL2phdmEvb3JnL29wZW5lY29tcC9wb3J0YWxhcHAvcG9ydGFsL3NlcnZpY2UvQXBwQ29udGFjdFVzU2VydmljZS5qYXZhCkBAIC0wLDAgKzEsNTUgQEAKKy8qLQorICogPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKyAqIGVDT01QIFBvcnRhbAorICogPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKyAqIENvcHlyaWdodCAoQykgMjAxNyBBVCZUIEludGVsbGVjdHVhbCBQcm9wZXJ0eQorICogPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKyAqIExpY2Vuc2VkIHVuZGVyIHRoZSBBcGFjaGUgTGljZW5zZSwgVmVyc2lvbiAyLjAgKHRoZSAiTGljZW5zZSIpOworICogeW91IG1heSBub3QgdXNlIHRoaXMgZmlsZSBleGNlcHQgaW4gY29tcGxpYW5jZSB3aXRoIHRoZSBMaWNlbnNlLgorICogWW91IG1heSBvYnRhaW4gYSBjb3B5IG9mIHRoZSBMaWNlbnNlIGF0CisgKiAKKyAqICAgICAgaHR0cDovL3d3dy5hcGFjaGUub3JnL2xpY2Vuc2VzL0xJQ0VOU0UtMi4wCisgKiAKKyAqIFVubGVzcyByZXF1aXJlZCBieSBhcHBsaWNhYmxlIGxhdyBvciBhZ3JlZWQgdG8gaW4gd3JpdGluZywgc29mdHdhcmUKKyAqIGRpc3RyaWJ1dGVkIHVuZGVyIHRoZSBMaWNlbnNlIGlzIGRpc3RyaWJ1dGVkIG9uIGFuICJBUyBJUyIgQkFTSVMsCisgKiBXSV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bWFpbi9qYXZhL29yZy9vcGVuZWNvbXAvcG9ydGFsYXBwL3BvcnRhbC9zZXJ2aWNlL0FwcENvbnRhY3RVc1NlcnZpY2VJbXBsLmphdmEgYi9lY29tcC1wb3J0YWwtQkUvc3JjL21haW4vamF2YS9vcmcvb3BlbmVjb21wL3BvcnRhbGFwcC9wb3J0YWwvc2VydmljZS9BcHBDb250YWN0VXNTZXJ2aWNlSW1wbC5qYXZhCm5ldyBmaWxlIG1vZGUgMTAwNjQ0CmluZGV4IDAwMDAwMDAuLjdhMmY2MjAKLS0tIC9kZXYvbnVsbAorKysgYi9lY29tcC1wb3J0YWwtQkUvc3JjL21haW4vamF2YS9vcmcvb3BlbmVjb21wL3BvcnRhbGFwcC9wb3J0YWwvc2VydmljZS9BcHBDb250YWN0VXNTZXJ2aWNlSW1wbC5qYXZhCkBAIC0wLDAgKzEsMTc4IEBACisvKi0KKyAqID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisgKiBlQ09NUCBQb3J0YWwKKyAqID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisgKiBDb3B5cmlnaHQgKEMpIDIwMTcgQVQmVCBJbnRlbGxlY3R1YWwgUHJvcGVydHkKKyAqID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisgKiBMaWNlbnNlZCB1bmRlciB0aGUgQXBhY2hlIExpY2Vuc2UsIFZlcnNpb24gMi4wICh0aGUgIkxpY2Vuc2UiKTsKKyAqIHlvdSBtYXkgbm90IHVzZSB0aGlzIGZpbGUgZXhjZXB0IGluIGNvbXBsaWFuY2Ugd2l0aCB0aGUgTGljZW5zZS4KKyAqIFlvdSBtYXkgb2J0YWluIGEgY29weSBvZiB0aGUgT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Y2UvQXBwbGljYXRpb25zUmVzdENsaWVudFNlcnZpY2UuamF2YQpuZXcgZmlsZSBtb2RlIDEwMDY0NAppbmRleCAwMDAwMDAwLi4yZWQ5ODIwCi0tLSAvZGV2L251bGwKKysrIGIvZWNvbXAtcG9ydGFsLUJFL3NyYy9tYWluL2phdmEvb3JnL29wZW5lY29tcC9wb3J0YWxhcHAvcG9ydGFsL3NlcnZpY2UvQXBwbGljYXRpb25zUmVzdENsaWVudFNlcnZpY2UuamF2YQpAQCAtMCwwICsxLDI4IEBACisvKi0KKyAqID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisgKiBlQ09NUCBQb3J0YWwKKyAqID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisgKiBDb3B5cmlnaHQgKEMpIDIwMTcgQVQmVCBJbnRlbGxlY3R1YWwgUHJvcGVydHkKKyAqID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisgKiBMaWNlbnNlZCB1bmRlciB0aGUgQXBhY2hlIExpY2Vuc2UsIFZlcnNpb24gMi4wICh0aGUgIkxpY2Vuc2UiKTsKKyAqIHlvdSBtYXkgbm90IHVzZSB0aGlzIGZpbGUgZXhjZXB0IGluIGNvbXBsaWFuY2Ugd2l0aCB0aGUgTGljZW5zZS4KKyAqIFlvdSBtYXkgb2J0YWluIGEgY29weSBvZiB0aGUgTGljZW5zZSBhdAorICogCisgKiAgICAgIGh0dHA6Ly93d3cuYXBhY2hlLm9yZy9saWNlbnNlcy9MSUNFTlNFLTIuMAorICogCisgKiBVbmxlc3MgcmVxdWlyZWQgYnkgYXBwbGljYWJsZSBsYXcgb3IgYWdyZWVkIHRvIGluIHdyaXRpbmcsIHNvZnR3YXJlC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BvcnRhbC1CRS9zcmMvbWFpbi9qYXZhL29yZy9vcGVuZWNvbXAvcG9ydGFsYXBwL3BvcnRhbC9zZXJ2aWNlL0FwcGxpY2F0aW9uc1Jlc3RDbGllbnRTZXJ2aWNlSW1wbC5qYXZhIGIvZWNvbXAtcG9ydGFsLUJFL3NyYy9tYWluL2phdmEvb3JnL29wZW5lY29tcC9wb3J0YWxhcHAvcG9ydGFsL3NlcnZpY2UvQXBwbGljYXRpb25zUmVzdENsaWVudFNlcnZpY2VJbXBsLmphdmEKbmV3IGZpbGUgbW9kZSAxMDA2NDQKaW5kZXggMDAwMDAwMC4uYzE4ZmUzMAotLS0gL2Rldi9udWxsCisrKyBiL2Vjb21wLXBvcnRhbC1CRS9zcmMvbWFpbi9qYXZhL29yZy9vcGVuZWNvbXAvcG9ydGFsYXBwL3BvcnRhbC9zZXJ2aWNlL0FwcGxpY2F0aW9uc1Jlc3RDbGllbnRTZXJ2aWNlSW1wbC5qYXZhCkBAIC0wLDAgKzEsMjY3IEBACisvKi0KKyAqID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisgKiBlQ09NUCBQb3J0YWwKKyAqID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisgKiBDb3B5cmlnaHQgKEMpIDIwMTcgQVQmVCBJbnRlbGxlY3R1YWwgUHJvcGVydHkKKyAqID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisgKiBMaWNlbnNlZCB1bmRlciB0aGUgQXBhY2hlIExpY2Vuc2UsIFZlcnNpb24gMi4wICh0aGUgIkxpY2Vuc2UiKTsKKyAqIHlvdSBtYXkgbm90IHVzZSB0aGlzIGZpbGUgZXhjZXB0IGluIGNvbXBsaWFuY2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Evb3JnL29wZW5lY29tcC9wb3J0YWxhcHAvcG9ydGFsL3NlcnZpY2UvQXBwc0NhY2hlU2VydmljZS5qYXZhCkBAIC0wLDAgKzEsNDAgQEAKKy8qLQorICogPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKyAqIGVDT01QIFBvcnRhbAorICogPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKyAqIENvcHlyaWdodCAoQykgMjAxNyBBVCZUIEludGVsbGVjdHVhbCBQcm9wZXJ0eQorICogPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKyAqIExpY2Vuc2VkIHVuZGVyIHRoZSBBcGFjaGUgTGljZW5zZSwgVmVyc2lvbiAyLjAgKHRoZSAiTGljZW5zZSIpOworICogeW91IG1heSBub3QgdXNlIHRoaXMgZmlsZSBleGNlcHQgaW4gY29tcGxpYW5jZSB3aXRoIHRoZSBMaWNlbnNlLgorICogWW91IG1heSBvYnRhaW4gYSBjb3B5IG9mIHRoZSBMaWNlbnNlIGF0CisgKiAKKyAqICAgICAgaHR0cDovL3d3dy5hcGFjaGUub3JnL2xpY2Vuc2VzL0xJQ0VOU0UtMi4wCisgKiAKKyAqIFVubGVzcyByZXF1aXJlZCBieSBhcHBsaWNhYmxlIGxhdyBvciBhZ3JlZWQgdG8gaW4gd3JpdGluZywgc29mdHdhcmUKKyAqIGRpc3RyaWJ1dGVkIHVuZGVyIHRoZSBMaWNlbnNlIGlzIGRpc3RyaWJ1dGVkIG9uIGFuICJBUyBJUyIgQkFTSVMsCisgKiBXSVRIT1VUIFdBUlJBTlRJRVMgT1IgQ09ORElUSU9OUyBPRiBBTlkgS0lORCwgZWl0aGVyIGV4cHJlc3Mgb3Iga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XBvcnRhbC1CRS9zcmMvbWFpbi9qYXZhL29yZy9vcGVuZWNvbXAvcG9ydGFsYXBwL3BvcnRhbC9zZXJ2aWNlL0FwcHNDYWNoZVNlcnZpY2VJbXBsZS5qYXZhCm5ldyBmaWxlIG1vZGUgMTAwNjQ0CmluZGV4IDAwMDAwMDAuLjdiYmZmNzYKLS0tIC9kZXYvbnVsbAorKysgYi9lY29tcC1wb3J0YWwtQkUvc3JjL21haW4vamF2YS9vcmcvb3BlbmVjb21wL3BvcnRhbGFwcC9wb3J0YWwvc2VydmljZS9BcHBzQ2FjaGVTZXJ2aWNlSW1wbGUuamF2YQpAQCAtMCwwICsxLDEwNCBAQAorLyotCisgKiA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorICogZUNPTVAgUG9ydGFsCisgKiA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorICogQ29weXJpZ2h0IChDKSAyMDE3IEFUJlQgSW50ZWxsZWN0dWFsIFByb3BlcnR5CisgKiA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorICogTGljZW5zZWQgdW5kZXIgdGhlIEFwYWNoZSBMaWNlbnNlLCBWZXJzaW9uIDIuMCAodGhlICJMaWNlbnNlIik7CisgKiB5b3UgbWF5IG5vdCB1c2UgdGhpcyBmaWxlIGV4Y2VwdCBpbiBjb21wbGlhbmNlIHdpdGggdGhlIExpY2Vuc2UuCisgKiBZb3UgbWF5IG9idGFpbiBhIGNvcHkgb2YgdGhlIExpY2Vuc2UgYXQKKyAqIAorICogICAgICBodHRwOi8vd3d3LmFwYWNoZS5vcmcvbGljZW5zZXMvTElDRU5TRS0yLjAKKyAqIAorICogVW5sZXNzIHJlcXVpcmVkIGJ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T09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKyAqIGVDT01QIFBvcnRhbAorICogPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKyAqIENvcHlyaWdodCAoQykgMjAxNyBBVCZUIEludGVsbGVjdHVhbCBQcm9wZXJ0eQorICogPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKyAqIExpY2Vuc2VkIHVuZGVyIHRoZSBBcGFjaGUgTGljZW5zZSwgVmVyc2lvbiAyLjAgKHRoZSAiTGljZW5zZSIpOworICogeW91IG1heSBub3QgdXNlIHRoaXMgZmlsZSBleGNlcHQgaW4gY29tcGxpYW5jZSB3aXRoIHRoZSBMaWNlbnNlLgorICogWW91IG1heSBvYnRhaW4gYSBjb3B5IG9mIHRoZSBMaWNlbnNlIGF0CisgKiAKKyAqICAgICAgaHR0cDovL3d3dy5hcGFjaGUub3JnL2xpY2Vuc2VzL0xJQ0VOU0UtMi4wCisgKiAKKyAqIFVubGVzcyByZXF1aXJlZCBieSBhcHBsaWNhYmxlIGxhdyBvciBhZ3JlZWQgdG8gaW4gd3JpdGluZywgc29mdHdhcmUKKyAqIGRpc3RyaWJ1dGVkIHVuZGVyIHRoZSBMaWNlbnNlIGlzIGRpc3RyaWJ1dGVkIG9uIGFuICJBUyBJUyIgQkFTSVMsCisgKiBXSVRIT1VUIFdBUlJBTlRJRVMgT1IgQ09ORElUSU9OUyBPRiBBTlkgS0lORCwgZWl0aGVyIGV4cHJlc3Mgb3IgaW1wbGllZC4KKyAqIFNlZSB0aGUgTGljZW5zZSBmb3IgdGhlIHNwZWNpZmljIGxhbmd1YWdlIGdvdmVybmluZyBwZXJtaXNzaW9ucyBhbmQKKyAqIGxpbWl0YXRpb25zIHVuZGVyIHRoZSBMaWNlbnNlLgorICogPT09P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F0YSk7CisJcHVibGljIFN0cmluZyBkZWxldGVXaWRnZXREYXRhKENvbW1vbldpZGdldCBldmVudFdpZGdldCk7CQorfQpkaWZmIC0tZ2l0IGEvZWNvbXAtcG9ydGFsLUJFL3NyYy9tYWluL2phdmEvb3JnL29wZW5lY29tcC9wb3J0YWxhcHAvcG9ydGFsL3NlcnZpY2UvRGFzaGJvYXJkU2VhcmNoU2VydmljZUltcGwuamF2YSBiL2Vjb21wLXBvcnRhbC1CRS9zcmMvbWFpbi9qYXZhL29yZy9vcGVuZWNvbXAvcG9ydGFsYXBwL3BvcnRhbC9zZXJ2aWNlL0Rhc2hib2FyZFNlYXJjaFNlcnZpY2VJbXBsLmphdmEKbmV3IGZpbGUgbW9kZSAxMDA2NDQKaW5kZXggMDAwMDAwMC4uYmYwZmM0NAotLS0gL2Rldi9udWxsCisrKyBiL2Vjb21wLXBvcnRhbC1CRS9zcmMvbWFpbi9qYXZhL29yZy9vcGVuZWNvbXAvcG9ydGFsYXBwL3BvcnRhbC9zZXJ2aWNlL0Rhc2hib2FyZFNlYXJjaFNlcnZpY2VJbXBsLmphdmEKQEAgLTAsMCArMSwyMzggQEAKKy8qLQorICogPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKyAqIGVDT01QIFBvcnRhbAorICogPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKyAqIENvcHlyaWdodCAoQykgMjAxNyBBVCZUIEludGVsbGVjdHVhbCBQcm9wZXJ0eQorICogPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKyAqIExpY2Vuc2VkIHVuZGVyIHRoZSBBcGFjaGUgTGljZW5zZSwgVmVyc2lvbiAyLjAgKHRoZSAiTGljZW5z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QQXBwU2VydmljZS5qYXZhIGIvZWNvbXAtcG9ydGFsLUJFL3NyYy9tYWluL2phdmEvb3JnL29wZW5lY29tcC9wb3J0YWxhcHAvcG9ydGFsL3NlcnZpY2UvRVBBcHBTZXJ2aWNlLmphdmEKbmV3IGZpbGUgbW9kZSAxMDA2NDQKaW5kZXggMDAwMDAwMC4uNDYxNGEyYwotLS0gL2Rldi9udWxsCisrKyBiL2Vjb21wLXBvcnRhbC1CRS9zcmMvbWFpbi9qYXZhL29yZy9vcGVuZWNvbXAvcG9ydGFsYXBwL3BvcnRhbC9zZXJ2aWNlL0VQQXBwU2VydmljZS5qYXZhCkBAIC0wLDAgKzEsMTY0IEBACisvKi0KKyAqID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisgKiBlQ09NUCBQb3J0YWwKKyAqID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisgKiBDb3B5cmlnaHQgKEMpIDIwMTcgQVQmVCBJbnRlbGxlY3R1YWwgUHJvcGVydHkKKyAqID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisgKiBMaWNlbnNlZCB1bmRlciB0aGUgQXBhY2hlIExpY2Vuc2UsIFZlcnNpb24gMi4wICh0aGUgIkxpY2Vuc2UiKTsKKyAqIHlvdSBtYXkgbm90IHVzZSB0aGlzIGZpbGUgZXhjZXB0IGluIGNvbXBsaWFuY2Ugd2l0aCB0aGUgTGljZW5zZS4KKyAqIFlvdSBtYXkgb2J0YWluIGEgY29weSBvZiB0aGUgTGljZW5zZSBhdAorICogCisgKiAgICAgIGh0dHA6Ly93d3cuYXBhY2hlLm9yZy9saWNlbnNlcy9MSUNFTlNFLTIuMAorICogCisgKiBVbmxlc3MgcmV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WxsCisrKyBiL2Vjb21wLXBvcnRhbC1CRS9zcmMvbWFpbi9qYXZhL29yZy9vcGVuZWNvbXAvcG9ydGFsYXBwL3BvcnRhbC9zZXJ2aWNlL0VQQXBwU2VydmljZUltcGwuamF2YQpAQCAtMCwwICsxLDEyMTggQEAKKy8qLQorICogPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKyAqIGVDT01QIFBvcnRhbAorICogPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKyAqIENvcHlyaWdodCAoQykgMjAxNyBBVCZUIEludGVsbGVjdHVhbCBQcm9wZXJ0eQorICogPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKyAqIExpY2Vuc2VkIHVuZGVyIHRoZSBBcGFjaGUgTGljZW5zZSwgVmVyc2lvbiAyLjAgKHRoZSAiTGljZW5zZSIpOworICogeW91IG1heSBub3QgdXNlIHRoaXMgZmlsZSBleGNlcHQgaW4gY29tcGxpYW5jZSB3aXRoIHRoZSBMaWNlbnNlLgorICogWW91IG1heSBvYnRhaW4gYSBjb3B5IG9mIHRoZSBMaWNlbnNlIGF0CisgKiAKKyAqICAgICAgaHR0cDovL3d3dy5hcGFjaGUub3JnL2xpY2Vuc2VzL0xJQ0VOU0UtMi4wCisgKiAKKyAqIFVubGVzcyByZXF1aXJlZCBieSBhcHBsaWNhYmxlIGxhdyBvciBhZ3JlZWQgdG8gaW4gd3JpdGluZywgc29mdHdhcmUKKyAqIGRpc3RyaWJ1dGVkIHVuZGVyIHRoZSBMaWNlbnNlIGlzIGRpc3RyaWJ1dGVkIG9uIGFuICJBUyBJUyIgQkFTSVMsCisgKiBXSVRIT1VUIFdBUlJBTlRJRVMgT1IgQ09ORElUSU9OUyBPRiBBTlkgS0lORCwgZWl0aGVyIGV4cHJlc3Mgb3IgaW1wbGllZC4KKyAqIFNlZSB0aGUgTGljZW5zZSBmb3IgdGhlIHNwZWNpZmljIGxhbmd1YWdlIGdvdmVybmluZyBwZXJtaXNzaW9ucyBhbmQKKyAqIGxpbWl0YXRpb25zIHVuZGVyIHRoZSBMaWNlbnNlLgorICogPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKyAqLworcGFja2FnZSBvcmcub3BlbmVjb21wLnBvcnRhbGFwcC5wb3J0YWwuc2VydmljZTsKKworCitpbXBvcnQgamF2YS5pby5GaWxlOworaW1wb3J0IGphdmEuaW8uRmlsZU5vdEZvdW5kRXhjZXB0aW9uOworaW1wb3J0IGphdmEuaW8uRmlsZU91dHB1dFN0cmVhbTsKK2ltcG9ydCBqYXZhLmlvLklPRXhjZXB0aW9uOworaW1wb3J0IGphdmEudXRpbC5BcnJheUxpc3Q7CitpbXBvcnQgamF2YS51dGlsLkJhc2U2NDsKKy8qLQorICogPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKyAqIGVDT01QIFBvcnRhbAorICogPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKyAqIENvcHlyaWdodCAoQykgMjAxNyBBVCZUIEludGVsbGVjdHVhbCBQcm9wZXJ0eQorICogPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKyAqIExpY2Vuc2VkIHVuZGVyIHRoZSBBcGFjaGUgTGljZW5zZSwgVmVyc2lvbiAyLjAgKHRoZSAiTGljZW5zZSIpOworICogeW91IG1heSBub3QgdXNlIH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GljIGludGVyZmFjZSBFUEF1ZGl0U2VydmljZSB7CisJcHVibGljIERhdGUgZ2V0R3Vlc3RMYXN0TG9naW4oU3RyaW5nIGF0dHVpZCk7Cit9CmRpZmYgLS1naXQgYS9lY29tcC1wb3J0YWwtQkUvc3JjL21haW4vamF2YS9vcmcvb3BlbmVjb21wL3BvcnRhbGFwcC9wb3J0YWwvc2VydmljZS9FUEF1ZGl0U2VydmljZUltcGwuamF2YSBiL2Vjb21wLXBvcnRhbC1CRS9zcmMvbWFpbi9qYXZhL29yZy9vcGVuZWNvbXAvcG9ydGFsYXBwL3BvcnRhbC9zZXJ2aWNlL0VQQXVkaXRTZXJ2aWNlSW1wbC5qYXZhCm5ldyBmaWxlIG1vZGUgMTAwNjQ0CmluZGV4IDAwMDAwMDAuLjlkNDc4ZmMKLS0tIC9kZXYvbnVsbAorKysgYi9lY29tcC1wb3J0YWwtQkUvc3JjL21haW4vamF2YS9vcmcvb3BlbmVjb21wL3BvcnRhbGFwcC9wb3J0YWwvc2VydmljZS9FUEF1ZGl0U2VydmljZUltcGwuamF2YQpAQCAtMCwwICsxLDc0IEBACisvKi0KKyAqID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisgKiBlQ09NUCBQb3J0YWwKKyAqID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisgKiBDb3B5cmlnaHQgKEMpIDIwMTcgQVQmVCBJbnRlbGxlY3R1YWwgUHJvcGVydHkKKyAqID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisgKiBMaWNlbnNlZCB1bmRlciB0aGUgQXBhY2hlIExpY2Vuc2UsIFZlcnNpb24gMi4wICh0aGUgIkxpY2Vuc2UiKTsKKyAqIHlvdS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L2Vjb21wLXBvcnRhbC1CRS9zcmMvbWFpbi9qYXZhL29yZy9vcGVuZWNvbXAvcG9ydGFsYXBwL3BvcnRhbC9zZXJ2aWNlL0VQTGRhcFNlcnZpY2UuamF2YQpuZXcgZmlsZSBtb2RlIDEwMDY0NAppbmRleCAwMDAwMDAwLi44NDE4YmVjCi0tLSAvZGV2L251bGwKKysrIGIvZWNvbXAtcG9ydGFsLUJFL3NyYy9tYWluL2phdmEvb3JnL29wZW5lY29tcC9wb3J0YWxhcHAvcG9ydGFsL3NlcnZpY2UvRVBMZGFwU2VydmljZS5qYXZhCkBAIC0wLDAgKzEsMzEgQEAKKy8qLQorICogPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKyAqIGVDT01QIFBvcnRhbAorICogPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKyAqIENvcHlyaWdodCAoQykgMjAxNyBBVCZUIEludGVsbGVjdHVhbCBQcm9wZXJ0eQorICogPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKyAqIExpY2Vuc2VkIHVuZGVyIHRoZSBBcGFjaGUgTGljZW5zZSwgVmVyc2lvbiAyLjAgKHRoZSAiTGljZW5zZSIpOworICogeW91IG1heSBub3QgdXNlIHRoaXMgZmlsZSBleGNlcHQgaW4gY29tcGxpYW5jZSB3aXRoIHRoZSBMaWNlbnNlLgorICogWW91IG1heSBvYnRhaW4gYSBjb3B5IG9mIHRoZSBMaWNlbnNlIGF0CisgKiAKKyAqICAgICAgaHR0cDovL3d3dy5hcGFjaGUub3JnL2xpY2Vuc2VzL0xJQ0VOU0UtMi4wCisgKiAKKyAqIFVubGVzcyByZXF1aXJlZCBieSBhcHBsaWNhYmxlIGxh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dGhyb3dzIEV4Y2VwdGlvbjsKKworfQpkaWZmIC0tZ2l0IGEvZWNvbXAtcG9ydGFsLUJFL3NyYy9tYWluL2phdmEvb3JnL29wZW5lY29tcC9wb3J0YWxhcHAvcG9ydGFsL3NlcnZpY2UvRVBMZGFwU2VydmljZUltcGwuamF2YSBiL2Vjb21wLXBvcnRhbC1CRS9zcmMvbWFpbi9qYXZhL29yZy9vcGVuZWNvbXAvcG9ydGFsYXBwL3BvcnRhbC9zZXJ2aWNlL0VQTGRhcFNlcnZpY2VJbXBsLmphdmEKbmV3IGZpbGUgbW9kZSAxMDA2NDQKaW5kZXggMDAwMDAwMC4uN2NmNTk2NQotLS0gL2Rldi9udWxsCisrKyBiL2Vjb21wLXBvcnRhbC1CRS9zcmMvbWFpbi9qYXZhL29yZy9vcGVuZWNvbXAvcG9ydGFsYXBwL3BvcnRhbC9zZXJ2aWNlL0VQTGRhcFNlcnZpY2VJbXBsLmphdmEKQEAgLTAsMCArMSwyODcgQEAKKy8qLQorICogPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKyAqIGVDT01QIFBvcnRhbAorICogPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKyAqIENvcHlyaWdodCAoQykgMjAxNyBBVCZUIEludGVsbGVjdHVhbCBQcm9wZXJ0eQorICogPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKyAqIExpY2Vuc2VkIHVuZGVyIHRoZSBBcGFjaGUgTGljZW5zZSwgVmVyc2lvbiAyLjAgKHRoZSAiTGljZW5zZSIpOworICogeW91IG1heSBub3QgdXNlIHRoaXMgZmlsZSBleGNlcHQgaW4gY29tcGxpYW5jZSB3aXRoIHRoZSBMaWNlbnN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gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZpbHRlckNsYXVzZS50b1N0cmluZygpLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2VhcmNoQ29udHJvbHMpOworICAgICAgICAJICBsaXN0ID0gcHJvY2Vzc1Jlc3VsdHMoZSk7CisgICAgICAgICAgfQorICAgICAgICAgIAorICAgICAgICAgIENvbGxlY3Rpb25zLnNvcnQobGlzdCk7CisKKyAgICAgICAgICBzZWFyY2hSZXN1bHQgPSBuZXcgU2VhcmNoUmVzdWx0KGxpc3QpOworICAgICAgICAgIHNlYXJjaFJlc3VsdC5zZXRQYWdlTm8ocGFnZU5vKTsKKyAgICAgICAgICBpZihkYXRhU2l6ZSA+PSAwKSB7CisgICAgICAgICAgICBzZWFyY2hSZXN1bHQuc2V0RGF0YVNpemUoZGF0YVNpemUpOworICAgICAgICAgIH0KKyAgICAgICAgICBlbHNlIHsKKyAgICAgICAgICAgIHNlYXJjaFJlc3VsdC5zZXREYXRhU2l6ZShsaXN0LnNpemUoKSk7CisgICAgICAgICAgfQorICAgICAgICB9IGNhdGNoKE5hbWluZ0V4Y2VwdGlvbiBuZSkgeworICAgICAgICAJU3RyaW5nIHN0YWNrVHJhY2UgPSBFY29tcFBvcnRhbFV0aWxzLmdldFN0YWNrVHJhY2UobmUpOworICAgICAgICAJbG9nZ2VyLmVycm9yKEVFTEZMb2dnZXJEZWxlZ2F0ZS5lcnJvckxvZ2dlciwgIkV4Y2VwdGlvbiBvY2N1cnJlZCB3aGlsZSBwZXJmb3JtaW5nIHRoZSBMREFQIHNlYXJjaC4gRGV0YWlsczogIiArIHN0YWNrVHJhY2UpOworICAgICAgICB9IGNhdGNoKEV4Y2VwdGlvbiBlKSB7CisgICAgICAgIAlTdHJpbmcgc3RhY2tUcmFjZSA9IEVjb21wUG9ydGFsVXRpbHMuZ2V0U3RhY2tUcmFjZShlKTsKKyAgICAgICAg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gICAgICAgICAgICAgIHVzZXIuc2V0TWlkZGxlSW5pdGlhbCgoU3RyaW5nKSBpZS5uZXh0KCkpOworICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgIGVsc2UgaWYgKGF0dHJpYnV0ZS5nZXRJRCgpLmVxdWFsc0lnbm9yZUNhc2UoInNuIikpIHsKKyAgICAgICAgICAgICAgICAgIHVzZXIuc2V0TGFzdE5hbWUoKFN0cmluZykgaWUubmV4dCgpKTsKKyAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICBlbHNlIGlmIChhdHRyaWJ1dGUuZ2V0SUQoKS5lcXVhbHNJZ25vcmVDYXNlKCJlbXBsb3llZU51bWJlciIpKSB7CisgICAgICAgICAgICAgICAgICB1c2VyLnNldEhyaWQoKFN0cmluZykgaWUubmV4dCgpKTsKKyAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICBlbHNlIGlmIChhdHRyaWJ1dGUuZ2V0SUQoKS5lcXVhbHNJZ25vcmVDYXNlKCJtYWlsIikpIHsKKyAgICAgICAgICAgICAgICAgIHVzZXIuc2V0RW1haWwoKFN0cmluZykgaWUubmV4dCgpKTsKKyAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICBlbHNlIGlmIChhdHRyaWJ1dGUuZ2V0SUQoKS5lcXVhbHNJZ25vcmVDYXNlKCJ0ZWxlcGhvbmVOdW1iZXIiKSkgeworICAgICAgICAgICAgICAgICAgdXNlci5zZXRQaG9uZSgoU3RyaW5nKSBpZS5uZXh0KCkpOworICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgIGVsc2UgaWYgKGF0dHJpYnV0ZS5nZXRJRCgpLmVxdWFsc0lnbm9yZUNhc2UoImRlcGFydG1lbnROdW1iZXIiKSkgeworICAgICAgICAgICAgICAgICAgdXNlci5zZXRPcmdDb2RlKChTdHJpbmcpIGllLm5leHQoKSk7CisgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgZWxzZSBpZiAoYXR0cmlidXRlLmdldElEKCkuZXF1YWxzSWdub3JlQ2FzZSgiYTEiKSkgeworICAgICAgICAgICAgICAgICAgdXNlci5zZXRPcmdVc2VySWQoKFN0cmluZykgaWUubmV4dCgpKTsKKyAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICBlbHNlIGlmIChhdHRyaWJ1dGUuZ2V0SUQoKS5lcXVhbHNJZ25vcmVDYXNlKCJzdHJlZXQiKSkgeworICAgICAgICAgICAgICAgICAgdXNlci5zZXRBZGRyZXNzMSgoU3RyaW5nKSBpZS5uZXh0KCkpOworICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgIGVsc2UgaWYgKGF0dHJpYnV0ZS5nZXRJRCgpLmVxdWFsc0lnbm9yZUNhc2UoInJvb21OdW1iZXIiKSkgeworICAgICAgICAgICAgICAgICAgdXNlci5zZXRBZGRyZXNzMigoU3RyaW5nKSBpZS5uZXh0KCkpOworICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgIGVsc2UgaWYgKGF0dHJpYnV0ZS5nZXRJRCgpLmVxdWFsc0lnbm9yZUNhc2UoImwiKSkgeworICAgICAgICAgICAgICAgICAgdXNlci5zZXRDaXR5KChTdHJpbmcpIGllLm5leHQoKSk7CisgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgZWxzZSBpZiAoYXR0cmlidXRlLmdldElEKCkuZXF1YWxzSWdub3JlQ2FzZSgic3QiKSkgeworICAgICAgICAgICAgICAgICAgdXNlci5zZXRTdGF0ZSgoU3RyaW5nKSBpZS5uZXh0KCkpOworICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgIGVsc2UgaWYgKGF0dHJpYnV0ZS5nZXRJRCgpLmVxdWFsc0lnbm9yZUNhc2UoInBvc3RhbENvZGUiKSkgeworICAgICAgICAgICAgICAgICAgdXNlci5zZXRaaXBDb2RlKChTdHJpbmcpIGllLm5leHQoKSk7CisgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgZWxzZSBpZiAoYXR0cmlidXRlLmdldElEKCkuZXF1YWxzSWdub3JlQ2FzZSgiemlwNCIpKSB7CisgICAgICAgICAgICAgICAgICB1c2VyLnNldFppcENvZGVTdWZmaXgoKFN0cmluZykgaWUubmV4dCgpKTsKKyAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICBlbHNlIGlmIChhdHRyaWJ1dGUuZ2V0SUQoKS5lcXVhbHNJZ25vcmVDYXNlKCJwaHlzaWNhbERlbGl2ZXJ5T2ZmaWNlTmFtZSIpKSB7CisgICAgICAgICAgICAgICAgICB1c2VyLnNldExvY2F0aW9uQ2xsaSgoU3RyaW5nKSBpZS5uZXh0KCkpOworICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgIGVsc2UgaWYgKGF0dHJpYnV0ZS5nZXRJRCgpLmVxdWFsc0lnbm9yZUNhc2UoImJjIikpIHsKKyAgICAgICAgICAgICAgICAgIHVzZXIuc2V0QnVzaW5lc3NDb3VudHJ5Q29kZSgoU3RyaW5nKSBpZS5uZXh0KCkpOworICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgIGVsc2UgaWYgKGF0dHJpYnV0ZS5nZXRJRCgpLmVxdWFsc0lnbm9yZUNhc2UoImZyaWVuZGx5Q291bnRyeU5hbWUiKSkgeworICAgICAgICAgICAgICAgICAgdXNlci5zZXRCdXNpbmVzc0NvdW50cnlOYW1lKChTdHJpbmcpIGllLm5leHQoKSk7CisgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgZWxzZSBpZiAoYXR0cmlidXRlLmdldElEKCkuZXF1YWxzSWdub3JlQ2FzZSgiYmQiKSkgeworICAgICAgICAgICAgICAgICAgdXNlci5zZXREZXBhcnRtZW50KChTdHJpbmcpIGllLm5leHQoKSk7CisgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgZWxzZSBpZiAoYXR0cmlidXRlLmdldElEKCkuZXF1YWxzSWdub3JlQ2FzZSgiYmRuYW1lIikpIHsKKyAgICAgICAgICAgICAgICAgIHVzZXIuc2V0RGVwYXJ0bWVudE5hbWUoKFN0cmluZykgaWUubmV4dCgpKTsKKyAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICBlbHNlIGlmIChhdHRyaWJ1dGUuZ2V0SUQoKS5lcXVhbHNJZ25vcmVDYXNlKCJqdG5hbWUiKSkgeworICAgICAgICAgICAgICAgICAgdXNlci5zZXRKb2JUaXRsZSgoU3RyaW5nKSBpZS5uZXh0KCkpOworICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgIGVsc2UgaWYgKGF0dHJpYnV0ZS5nZXRJRCgpLmVxdWFsc0lnbm9yZUNhc2UoIm1ncmlkIikpIHsKKyAgICAgICAgICAgICAgICAgIHVzZXIuc2V0T3JnTWFuYWdlclVzZXJJZCgoU3RyaW5nKSBpZS5uZXh0KCkpOworICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgIGVsc2UgaWYgKGF0dHJpYnV0ZS5nZXRJRCgpLmVxdWFsc0lnbm9yZUNhc2UoImEyIikpIHsKKyAgICAgICAgICAgICAgICAgIHVzZXIuc2V0Q29tbWFuZENoYWluKChTdHJpbmcpIGllLm5leHQoKSk7CisgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgZWxzZSBpZiAoYXR0cmlidXRlLmdldElEKCkuZXF1YWxzSWdub3JlQ2FzZSgiY29tcGNvZGUiKSkgeworICAgICAgICAgICAgICAgICAgdXNlci5zZXRDb21wYW55Q29kZSgoU3RyaW5nKSBpZS5uZXh0KCkpOworICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgIGVsc2UgaWYgKGF0dHJpYnV0ZS5nZXRJRCgpLmVxdWFsc0lnbm9yZUNhc2UoImNvbXBkZXNjIikpIHsKKyAgICAgICAgICAgICAgICAgIHVzZXIuc2V0Q29tcGFueSgoU3RyaW5nKSBpZS5uZXh0KCkpOworICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgIGVsc2UgaWYgKGF0dHJpYnV0ZS5nZXRJRCgpLmVxdWFsc0lnbm9yZUNhc2UoImJ1IikpIHsKKyAgICAgICAgICAgICAgICAgIHVzZXIuc2V0QnVzaW5lc3NVbml0KChTdHJpbmcpaWUubmV4dCgpKTsKKyAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICBlbHNlIGlmIChhdHRyaWJ1dGUuZ2V0SUQoKS5lcXVhbHNJZ25vcmVDYXNlKCJidW5hbWUiKSkgeworICAgICAgICAgICAgICAgICAgdXNlci5zZXRCdXNpbmVzc1VuaXROYW1lKChTdHJpbmcpaWUubmV4dCgpKTsKKyAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICBlbHNlIGlmIChhdHRyaWJ1dGUuZ2V0SUQoKS5lcXVhbHNJZ25vcmVDYXNlKCJzaWxvIikpIHsKKyAgICAgICAgICAgICAgICAgIHVzZXIuc2V0U2lsb1N0YXR1cygoU3RyaW5nKWllLm5leHQoKSk7CisgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgZWxzZSBpZiAoYXR0cmlidXRlLmdldElEKCkuZXF1YWxzSWdub3JlQ2FzZSgiY29zdGNlbnRlciIpKSB7CisgICAgICAgICAgICAgICAgICB1c2VyLnNldENvc3RDZW50ZXIoKFN0cmluZylpZS5uZXh0KCkpOworICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgIGVsc2UgaWYgKGF0dHJpYnV0ZS5nZXRJRCgpLmVxdWFsc0lnbm9yZUNhc2UoImIyIikpIHsKKyAgICAgICAgICAgICAgICAgIHVzZXIuc2V0RmluYW5jaWFsTG9jQ29kZSgoU3RyaW5nKWllLm5leHQoKSk7CisgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgZWxzZSB7IC8vd2UgZG9uJ3QgY2FyZSBhYm91dCByZXR1cm5lZCBhdHRyaWJ1dGUsIGxldCdzIG1vdmUgb24KKyAgICAgICAgICAgICAgICBpZS5uZXh0KCk7CisgICAgICAgICAgICAgIH0KKworICAgICAgICAgICAgfQorICAgICAgICAgIH0KKyAgICAgICAgfQorICAgICAgfSBjYXRjaCAoTmFtaW5nRXhjZXB0aW9uIGUpIHsKKyAg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vcnRhbC9zZXJ2aWNlL0VQTG9naW5TZXJ2aWNlLmphdmEKbmV3IGZpbGUgbW9kZSAxMDA2NDQKaW5kZXggMDAwMDAwMC4uNGQwMzM3YQotLS0gL2Rldi9udWxsCisrKyBiL2Vjb21wLXBvcnRhbC1CRS9zcmMvbWFpbi9qYXZhL29yZy9vcGVuZWNvbXAvcG9ydGFsYXBwL3BvcnRhbC9zZXJ2aWNlL0VQTG9naW5TZXJ2aWNlLmphdmEKQEAgLTAsMCArMSw0MiBAQAorLyotCisgKiA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorICogZUNPTVAgUG9ydGFsCisgKiA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorICogQ29weXJpZ2h0IChDKSAyMDE3IEFUJlQgSW50ZWxsZWN0dWFsIFByb3BlcnR5CisgKiA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorICogTGljZW5zZWQgdW5kZXIgdGhlIEFwYWNoZSBMaWNlbnNlLCBWZXJzaW9uIDIuMCAodGhlICJMaWNlbnNlIik7CisgKiB5b3UgbWF5IG5vdCB1c2UgdGhpcyBmaWxlIGV4Y2VwdCBpbiBjb21wbGlhbmNlIHdpdGggdGhlIExpY2Vuc2UuCisgKiBZb3UgbWF5IG9idGFpbiBhIGNvcHkgb2YgdGhlIExpY2Vuc2UgYXQKKyAqIAorICogICAgICBodHRwOi8vd3d3LmFwYWNoZS5vcmcvbGljZW5zZXMvTElDRU5TRS0yLjAKKyAqIAorICogVW5sZXNzIHJlcXVpcmVkIGJ5IGFwcGxpY2FibGUgbGF3IG9yIGFncmVlZCB0byBpbiB3cml0aW5nLCBzb2Z0d2FyZQorICogZGlzdHJpYnV0ZW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iBlQ09NUCBQb3J0YWwKKyAqID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisgKiBDb3B5cmlnaHQgKEMpIDIwMTcgQVQmVCBJbnRlbGxlY3R1YWwgUHJvcGVydHkKKyAqID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisgKiBMaWNlbnNlZCB1bmRlciB0aGUgQXBhY2hlIExpY2Vuc2UsIFZlcnNpb24gMi4wICh0aGUgIkxpY2Vuc2UiKTsKKyAqIHlvdSBtYXkgbm90IHVzZSB0aGlzIGZpbGUgZXhjZXB0IGluIGNvbXBsaWFuY2Ugd2l0aCB0aGUgTGljZW5zZS4KKyAqIFlvdSBtYXkgb2J0YWluIGEgY29weSBvZiB0aGUgTGljZW5zZSBhdAorICogCisgKiAgICAgIGh0dHA6Ly93d3cuYXBhY2hlLm9yZy9saWNlbnNlcy9MSUNFTlNFLTIuMAorICogCisgKiBVbmxlc3MgcmVxdWlyZWQgYnkgYXBwbGljYWJsZSBsYXcgb3IgYWdyZWVkIHRvIGluIHdyaXRpbmcsIHNvZnR3YXJlCisgKiBkaXN0cmlidXRlZCB1bmRlciB0aGUgTGljZW5zZSBpcyBkaXN0cmlidXRlZCBvbiBhbiAiQVMgSVMiIEJBU0lTLAorICogV0lUSE9VVCBXQVJSQU5USUVTIE9SIENPTkRJVElPTlMgT0YgQU5ZIEtJTkQsIGVpdGhlciBleHByZXNzIG9yIGltcGxpZWQuCisgKiBTZWUgdGhlIExpY2Vuc2UgZm9yIHRoZSBzcGVjaWZpYyBsYW5ndWFnZSBnb3Zlcm5pbmcgcGVybWlzc2lvbnMgYW5kCisgKiBsaW1pdGF0aW9ucyB1bmRlciB0aGUgTGljZW5zZS4KKyAqID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT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Mgdm9pZCBzZXREYXRhQWNjZXNzU2VydmljZShEYXRhQWNjZXNzU2VydmljZSBkYXRhQWNjZXNzU2VydmljZSkgeworCQl0aGlzLmRhdGFBY2Nlc3NTZXJ2aWNlID0gZGF0YUFjY2Vzc1NlcnZpY2U7CisJfQorCisKK30KZGlmZiAtLWdpdCBhL2Vjb21wLXBvcnRhbC1CRS9zcmMvbWFpbi9qYXZhL29yZy9vcGVuZWNvbXAvcG9ydGFsYXBwL3BvcnRhbC9zZXJ2aWNlL0VQUm9sZVNlcnZpY2UuamF2YSBiL2Vjb21wLXBvcnRhbC1CRS9zcmMvbWFpbi9qYXZhL29yZy9vcGVuZWNvbXAvcG9ydGFsYXBwL3BvcnRhbC9zZXJ2aWNlL0VQUm9sZVNlcnZpY2UuamF2YQpuZXcgZmlsZSBtb2RlIDEwMDY0NAppbmRleCAwMDAwMDAwLi45MWFhNzdiCi0tLSAvZGV2L251bGwKKysrIGIvZWNvbXAtcG9ydGFsLUJFL3NyYy9tYWluL2phdmEvb3JnL29wZW5lY29tcC9wb3J0YWxhcHAvcG9ydGFsL3NlcnZpY2UvRVBSb2xlU2VydmljZS5qYXZhCkBAIC0wLDAgKzEsMzIgQEAKKy8qLQorICogPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKyAqIGVDT01QIFBvcnRhbAorICogPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKyAqIENvcHlyaWdodCAoQykgMjAxNyBBVCZUIEludGVsbGVjdHVhbCBQcm9wZXJ0eQorICogPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKyAqIExpY2Vuc2VkIHVuZGVyIHRoZSBBcGFjaGUgTGljZW5zZSwgVmVyc2lvb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XBwIGlkLCBhbmQgZXh0ZXJuYWwgYXBwIHJvbGUgaWQuCisJRVBSb2xlIGdldFJvbGUoTG9uZyBhcHBJZCwgTG9uZyBhcHBSb2xlaWQpOworCXB1YmxpYyB2b2lkIHNhdmVSb2xlKEVQUm9sZSBkb21haW5Sb2xlKTsKKwkKKwkKK30KZGlmZiAtLWdpdCBhL2Vjb21wLXBvcnRhbC1CRS9zcmMvbWFpbi9qYXZhL29yZy9vcGVuZWNvbXAvcG9ydGFsYXBwL3BvcnRhbC9zZXJ2aWNlL0VQUm9sZVNlcnZpY2VJbXBsLmphdmEgYi9lY29tcC1wb3J0YWwtQkUvc3JjL21haW4vamF2YS9vcmcvb3BlbmVjb21wL3BvcnRhbGFwcC9wb3J0YWwvc2VydmljZS9FUFJvbGVTZXJ2aWNlSW1wbC5qYXZhCm5ldyBmaWxlIG1vZGUgMTAwNjQ0CmluZGV4IDAwMDAwMDAuLjQ2N2I5MDAKLS0tIC9kZXYvbnVsbAorKysgYi9lY29tcC1wb3J0YWwtQkUvc3JjL21haW4vamF2YS9vcmcvb3BlbmVjb21wL3BvcnRhbGFwcC9wb3J0YWwvc2VydmljZS9FUFJvbGVTZXJ2aWNlSW1wbC5qYXZhCkBAIC0wLDAgKzEsMTQ5IEBACisvKi0KKyAqID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisgKiBlQ09NUCBQb3J0YWwKKyAqID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisgKiBDb3B5cmlnaHQgKEMpIDIwMTcgQVQmVCBJbnRlbGxlY3R1YWwgUHJvcGVydHkKKyAqID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisgKiBMaWNlbnNlZCB1bmRlci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tYWluL2phdmEvb3JnL29wZW5lY29tcC9wb3J0YWxhcHAvcG9ydGFsL3NlcnZpY2UvRnVuY3Rpb25hbE1lbnVTZXJ2aWNlLmphdmEgYi9lY29tcC1wb3J0YWwtQkUvc3JjL21haW4vamF2YS9vcmcvb3BlbmVjb21wL3BvcnRhbGFwcC9wb3J0YWwvc2VydmljZS9GdW5jdGlvbmFsTWVudVNlcnZpY2UuamF2YQpuZXcgZmlsZSBtb2RlIDEwMDY0NAppbmRleCAwMDAwMDAwLi45ZGU0NTk5Ci0tLSAvZGV2L251bGwKKysrIGIvZWNvbXAtcG9ydGFsLUJFL3NyYy9tYWluL2phdmEvb3JnL29wZW5lY29tcC9wb3J0YWxhcHAvcG9ydGFsL3NlcnZpY2UvRnVuY3Rpb25hbE1lbnVTZXJ2aWNlLmphdmEKQEAgLTAsMCArMSw1MCBAQAorLyotCisgKiA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorICogZUNPTVAgUG9ydGFsCisgKiA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorICogQ29weXJpZ2h0IChDKSAyMDE3IEFUJlQgSW50ZWxsZWN0dWFsIFByb3BlcnR5CisgKiA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorICogTGljZW5zZWQgdW5kZXIgdGhlIEFwYWNoZSBMaWNlbnNlLCBWZXJzaW9uIDIuMCAodGhlICJMaWNlbnNlIik7CisgKiB5b3UgbWF5IG5vdCB1c2UgdGhpcyBmaWxlIGV4Y2VwdCBpbiBjb21wbGlhbmNlIHdpdGggdGhlIExpY2Vuc2UuCisgKiBZb3UgbWF5IG9idGFpbiBhIGNvcHkgb2YgdGhlIExpY2Vuc2UgYXQKKyA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Ci0tLSAvZGV2L251bGwKKysrIGIvZWNvbXAtcG9ydGFsLUJFL3NyYy9tYWluL2phdmEvb3JnL29wZW5lY29tcC9wb3J0YWxhcHAvcG9ydGFsL3NlcnZpY2UvRnVuY3Rpb25hbE1lbnVTZXJ2aWNlSW1wbC5qYXZhCkBAIC0wLDAgKzEsODYyIEBACisvKi0KKyAqID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisgKiBlQ09NUCBQb3J0YWwKKyAqID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisgKiBDb3B5cmlnaHQgKEMpIDIwMTcgQVQmVCBJbnRlbGxlY3R1YWwgUHJvcGVydHkKKyAqID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisgKiBMaWNlbnNlZCB1bmRlciB0aGUgQXBhY2hlIExpY2Vuc2UsIFZlcnNpb24gMi4wICh0aGUgIkxpY2Vuc2UiKTsKKyAqIHlvdSBtYXkgbm90IHVzZSB0aGlzIGZpbGUgZXhjZXB0IGluIGNvbXBsaWFuY2Ugd2l0aCB0aGUgTGljZW5zZS4KKyAqIFlvdSBtYXkgb2J0YWluIGEgY29weSBvZiB0aGUgTGljZW5zZSBhdAorICogCisgKiAgICAgIGh0dHA6Ly93d3cuYXBhY2hlLm9yZy9saWNlbnNlcy9MSUNFTlNFLTIuMAorICogCisgKiBVbmxlc3MgcmVxdWlyZWQgYnkgYXBwbGljYWJsZSBsYXcgb3IgYWdyZWVkIHRvIGluIHdyaXRpbmcsIHNvZnR3YXJlCisgKiBkaXN0cmlidXRlZCB1bmRlciB0aGUgTGljZW5zZSBpcyBkaXN0cmlidXRlZCBvbiBhbiAiQVMgSVMiIEJBU0lTLAorICogV0lUSE9VV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YXBwL3BvcnRhbC9zZXJ2aWNlL0dldEFjY2Vzc1NlcnZpY2UuamF2YQpAQCAtMCwwICsxLDMyIEBACisvKi0KKyAqID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisgKiBlQ09NUCBQb3J0YWwKKyAqID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisgKiBDb3B5cmlnaHQgKEMpIDIwMTcgQVQmVCBJbnRlbGxlY3R1YWwgUHJvcGVydHkKKyAqID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisgKiBMaWNlbnNlZCB1bmRlciB0aGUgQXBhY2hlIExpY2Vuc2UsIFZlcnNpb24gMi4wICh0aGUgIkxpY2Vuc2UiKTsKKyAqIHlvdSBtYXkgbm90IHVzZSB0aGlzIGZpbGUgZXhjZXB0IGluIGNvbXBsaWFuY2Ugd2l0aCB0aGUgTGljZW5zZS4KKyAqIFlvdSBtYXkgb2J0YWluIGEgY29weSBvZiB0aGUgTGljZW5zZSBhdAorICogCisgKiAgICAgIGh0dHA6Ly93d3cuYXBhY2hlLm9yZy9saWNlbnNlcy9MSUNFTlNFLTIuMAorICogCisgKiBVbmxlc3MgcmVxdWlyZWQgYnkgYXBwbGljYWJsZSBsYXcgb3IgYWdyZWVkIHRvIGluIHdyaXRpbmcsIHNvZnR3YXJlCisgKiBkaXN0cmlidXRlZCB1bmRlciB0aGUgTGljZW5zZSBpcyBkaXN0cmlidXRlZCBvbiBhbiAiQVMgSVMiIEJBU0lTLAorICogV0lUSE9VVCBXQVJSQU5USUVTIE9SIENPTkRJVElPTlMgT0YgQU5ZIEtJTkQsIGVpdGhlciBleHByZXNzIG9yIGltcGxpZWQuCisgKiBTZWUgdGhlIExpY2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YWluL2phdmEvb3JnL29wZW5lY29tcC9wb3J0YWxhcHAvcG9ydGFsL3NlcnZpY2UvR2V0QWNjZXNzU2VydmljZUltcGwuamF2YQpAQCAtMCwwICsxLDUwIEBACisvKi0KKyAqID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisgKiBlQ09NUCBQb3J0YWwKKyAqID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisgKiBDb3B5cmlnaHQgKEMpIDIwMTcgQVQmVCBJbnRlbGxlY3R1YWwgUHJvcGVydHkKKyAqID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisgKiBMaWNlbnNlZCB1bmRlciB0aGUgQXBhY2hlIExpY2Vuc2UsIFZlcnNpb24gMi4wICh0aGUgIkxpY2Vuc2UiKTsKKyAqIHlvdSBtYXkgbm90IHVzZSB0aGlzIGZpbGUgZXhjZXB0IGluIGNvbXBsaWFuY2Ugd2l0aCB0aGUgTGljZW5zZS4KKyAqIFlvdSBtYXkgb2J0YWluIGEgY29weSBvZiB0aGUgTGljZW5zZSBhdAorICogCisgKiAgICAgIGh0dHA6Ly93d3cuYXBhY2hlLm9yZy9saWNlbnNlcy9MSUNFTlNFLTIuMAorICogCisgKiBVbmxlc3MgcmVxdWlyZWQgYnkgYXBwbGljYWJsZSBsYXcgb3IgYWdyZWVkIHRvIGluIHdyaXRpbmcsIHNvZnR3YXJlCisgKiBkaXN0cmlidXRlZCB1bmRlciB0aGUgTGljZW5zZSBpcyBkaXN0cmlidXRlZCBvbiBhbiAiQVMgSVMiIEJBU0lTLAorICogV0lUSE9VVCBXQVJSQU5USUVTIE9SIENPTkRJVElPTlMgT0YgQU5ZIEtJTkQsIGVpdGhlciBleHByZXNz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uaWZlc3RTZXJ2aWNlLmphdmEKQEAgLTAsMCArMSwzNCBAQAorLyotCisgKiA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorICogZUNPTVAgUG9ydGFsCisgKiA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorICogQ29weXJpZ2h0IChDKSAyMDE3IEFUJlQgSW50ZWxsZWN0dWFsIFByb3BlcnR5CisgKiA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorICogTGljZW5zZWQgdW5kZXIgdGhlIEFwYWNoZSBMaWNlbnNlLCBWZXJzaW9uIDIuMCAodGhlICJMaWNlbnNlIik7CisgKiB5b3UgbWF5IG5vdCB1c2UgdGhpcyBmaWxlIGV4Y2VwdCBpbiBjb21wbGlhbmNlIHdpdGggdGhlIExpY2Vuc2UuCisgKiBZb3UgbWF5IG9idGFpbiBhIGNvcHkgb2YgdGhlIExpY2Vuc2UgYXQKKyAqIAorICogICAgICBodHRwOi8vd3d3LmFwYWNoZS5vcmcvbGljZW5zZXMvTElDRU5TRS0yLjAKKyAqIAorICogVW5sZXNzIHJlcXVpcmVkIGJ5IGFwcGxpY2FibGUgbGF3IG9yIGFncmVlZCB0byBpbiB3cml0aW5nLCBzb2Z0d2FyZQorICogZGlzdHJpYnV0ZWQgdW5kZXIgdGhlIExpY2Vuc2UgaXMgZGlzdHJpYnV0ZWQgb24gYW4gIkFTIElTIiBCQVNJUywKKyAqIFdJVEhPVVQgV0FSUkFOVElFUyBPUiBDT05ESVRJT05TIE9GIEFOWSBLSU5ELCBlaXRoZXIgZXhwcmVzcyBvciBpbXBsaWVkLgorICogU2VlIHRoZSBMaWNlbnNlIGZvciB0aGUgc3BlY2lmaWMgbGF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yBiL2Vjb21wLXBvcnRhbC1CRS9zcmMvbWFpbi9qYXZhL29yZy9vcGVuZWNvbXAvcG9ydGFsYXBwL3BvcnRhbC9zZXJ2aWNlL01hbmlmZXN0U2VydmljZUltcGwuamF2YQpAQCAtMCwwICsxLDY1IEBACisvKi0KKyAqID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisgKiBlQ09NUCBQb3J0YWwKKyAqID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisgKiBDb3B5cmlnaHQgKEMpIDIwMTcgQVQmVCBJbnRlbGxlY3R1YWwgUHJvcGVydHkKKyAqID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisgKiBMaWNlbnNlZCB1bmRlciB0aGUgQXBhY2hlIExpY2Vuc2UsIFZlcnNpb24gMi4wICh0aGUgIkxpY2Vuc2UiKTsKKyAqIHlvdSBtYXkgbm90IHVzZSB0aGlzIGZpbGUgZXhjZXB0IGluIGNvbXBsaWFuY2Ugd2l0aCB0aGUgTGljZW5zZS4KKyAqIFlvdSBtYXkgb2J0YWluIGEgY29weSBvZiB0aGUgTGljZW5zZSBhdAorICogCisgKiAgICAgIGh0dHA6Ly93d3cuYXBhY2hlLm9yZy9saWNlbnNlcy9MSUNFTlNFLTIuMAorICogCisgKiBVbmxlc3MgcmVxdWlyZWQgYnkgYXBwbGljYWJsZSBsYXcgb3IgYWdyZWVkIHRvIGluIHdyaXRpbmcsIHNvZnR3YXJlCisgKiBkaXN0cmlidXRlZCB1bmRlciB0aGUgTGljZW5zZSBpcyBkaXN0cmlidXRlZCBvbiBhbiAiQVMgSVMiIEJBU0lTLAorICogV0lUSE9VVCBXQVJSQU5USUVTIE9SIENPTkRJVElPTlMg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29yZAorCQkJCQkJcGVyc1Jvdy5zZXRTdGF0dXNDb2RlKCJIIik7IC8vIGhpZGUKKwkJCQkJCWRhdGFBY2Nlc3NTZXJ2aWNlLnNhdmVEb21haW5PYmplY3QocGVyc1JvdywgbnVsbCk7CisJCQkJCX0KKwkJCQl9IC8vIGRlc2VsZWN0CisJCQl9CisJCX0KKwl9CisKK30KXCBObyBuZXdsaW5lIGF0IGVuZCBvZiBmaWxlCmRpZmYgLS1naXQgYS9lY29tcC1wb3J0YWwtQkUvc3JjL21haW4vamF2YS9vcmcvb3BlbmVjb21wL3BvcnRhbGFwcC9wb3J0YWwvc2VydmljZS9Qb3J0YWxBZG1pblNlcnZpY2UuamF2YSBiL2Vjb21wLXBvcnRhbC1CRS9zcmMvbWFpbi9qYXZhL29yZy9vcGVuZWNvbXAvcG9ydGFsYXBwL3BvcnRhbC9zZXJ2aWNlL1BvcnRhbEFkbWluU2VydmljZS5qYXZhCm5ldyBmaWxlIG1vZGUgMTAwNjQ0CmluZGV4IDAwMDAwMDAuLjVjZjUyZTUKLS0tIC9kZXYvbnVsbAorKysgYi9lY29tcC1wb3J0YWwtQkUvc3JjL21haW4vamF2YS9vcmcvb3BlbmVjb21wL3BvcnRhbGFwcC9wb3J0YWwvc2VydmljZS9Qb3J0YWxBZG1pblNlcnZpY2UuamF2YQpAQCAtMCwwICsxLDMxIEBACisvKi0KKyAqID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisgKiBlQ09NUCBQb3J0YWwKKyAqID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisgKiBDb3B5cmlnaHQgKEMpIDIwMTcgQVQmVCBJbnRlbGxlY3R1YWwgUHJvcGVydHkKKyAqID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT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DKSAyMDE3IEFUJlQgSW50ZWxsZWN0dWFsIFByb3BlcnR5CisgKiA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorICogTGljZW5zZWQgdW5kZXIgdGhlIEFwYWNoZSBMaWNlbnNlLCBWZXJzaW9uIDIuMCAodGhlICJMaWNlbnNlIik7CisgKiB5b3UgbWF5IG5vdCB1c2UgdGhpcyBmaWxlIGV4Y2VwdCBpbiBjb21wbGlhbmNlIHdpdGggdGhlIExpY2Vuc2UuCisgKiBZb3UgbWF5IG9idGFpbiBhIGNvcHkgb2YgdGhlIExpY2Vuc2UgYXQKKyAqIAorICogICAgICBodHRwOi8vd3d3LmFwYWNoZS5vcmcvbGljZW5zZXMvTElDRU5TRS0yLjAKKyAqIAorICogVW5sZXNzIHJlcXVpcmVkIGJ5IGFwcGxpY2FibGUgbGF3IG9yIGFncmVlZCB0byBpbiB3cml0aW5nLCBzb2Z0d2FyZQorICogZGlzdHJpYnV0ZWQgdW5kZXIgdGhlIExpY2Vuc2UgaXMgZGlzdHJpYnV0ZWQgb24gYW4gIkFTIElTIiBCQVNJUywKKyAqIFdJVEhPVVQgV0FSUkFOVElFUyBPUiBDT05ESVRJT05TIE9GIEFOWSBLSU5ELCBlaXRoZXIgZXhwcmVzcyBvciBpbXBsaWVkLgorICogU2VlIHRoZSBMaWNlbnNlIGZvciB0aGUgc3BlY2lmaWMgbGFuZ3VhZ2UgZ292ZXJuaW5nIHBlcm1pc3Npb25zIGFuZAorICogbGltaXRhdGlvbnMgdW5kZXIgdGhlIExpY2Vuc2UuCisgKiA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorICovCitwYWNrYWdlIG9yZy5vcGVuZWNvbXAucG9ydGFsYXBwLnBvcnRhbC5zZXJ2aWNlOworCitpbXBvcnQgamF2YS51dG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jUyNTRlMjAKLS0tIC9kZXYvbnVsbAorKysgYi9lY29tcC1wb3J0YWwtQkUvc3JjL21haW4vamF2YS9vcmcvb3BlbmVjb21wL3BvcnRhbGFwcC9wb3J0YWwvc2VydmljZS9TZWFyY2hTZXJ2aWNlLmphdmEKQEAgLTAsMCArMSwzOCBAQAorLyotCisgKiA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorICogZUNPTVAgUG9ydGFsCisgKiA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorICogQ29weXJpZ2h0IChDKSAyMDE3IEFUJlQgSW50ZWxsZWN0dWFsIFByb3BlcnR5CisgKiA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorICogTGljZW5zZWQgdW5kZXIgdGhlIEFwYWNoZSBMaWNlbnNlLCBWZXJzaW9uIDIuMCAodGhlICJMaWNlbnNlIik7CisgKiB5b3UgbWF5IG5vdCB1c2UgdGhpcyBmaWxlIGV4Y2VwdCBpbiBjb21wbGlhbmNlIHdpdGggdGhlIExpY2Vuc2UuCisgKiBZb3UgbWF5IG9idGFpbiBhIGNvcHkgb2YgdGhlIExpY2Vuc2UgYXQKKyAqIAorICogICAgICBodHRwOi8vd3d3LmFwYWNoZS5vcmcvbGljZW5zZXMvTElDRU5TRS0yLjAKKyAqIAorICogVW5sZXNzIHJlcXVpcmVkIGJ5IGFwcGxpY2FibGUgbGF3IG9yIGFncmVlZCB0byBpbiB3cml0aW5nLCBzb2Z0d2FyZQorICogZGlzdHJpYnV0ZWQgdW5kZXIgdGhlIExpY2Vuc2UgaXMgZGlzdHJpYnV0ZWQgb24gYW4gIkFTIElTIiBCQVNJUywKKyAqIFdJVEhPVVQgV0FSUkFOVEl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cGVuZWNvbXAvcG9ydGFsYXBwL3BvcnRhbC9zZXJ2aWNlL1NlYXJjaFNlcnZpY2VJbXBsLmphdmEgYi9lY29tcC1wb3J0YWwtQkUvc3JjL21haW4vamF2YS9vcmcvb3BlbmVjb21wL3BvcnRhbGFwcC9wb3J0YWwvc2VydmljZS9TZWFyY2hTZXJ2aWNlSW1wbC5qYXZhCm5ldyBmaWxlIG1vZGUgMTAwNjQ0CmluZGV4IDAwMDAwMDAuLjAyMGI3NDkKLS0tIC9kZXYvbnVsbAorKysgYi9lY29tcC1wb3J0YWwtQkUvc3JjL21haW4vamF2YS9vcmcvb3BlbmVjb21wL3BvcnRhbGFwcC9wb3J0YWwvc2VydmljZS9TZWFyY2hTZXJ2aWNlSW1wbC5qYXZhCkBAIC0wLDAgKzEsMTg4IEBACisvKi0KKyAqID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisgKiBlQ09NUCBQb3J0YWwKKyAqID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisgKiBDb3B5cmlnaHQgKEMpIDIwMTcgQVQmVCBJbnRlbGxlY3R1YWwgUHJvcGVydHkKKyAqID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisgKiBMaWNlbnNlZCB1bmRlciB0aGUgQXBhY2hlIExpY2Vuc2UsIFZlcnNpb24gMi4wICh0aGUgIkxpY2Vuc2UiKTsKKyAqIHlvdSBtYXkgbm90IHVzZSB0aGlzIGZpbGUgZXhjZXB0IGluIGNvbXBsaWFuY2Ugd2l0aCB0aGUgTGljZW5zZS4KKyAqIFlvdSBtYXkgb2J0YWluIGEgY29weSBvZiB0aGUgTGljZW5zZSBhdAorICogCisgKiAgICAgIGh0dHA6Ly93d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PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisgKiBDb3B5cmlnaHQgKEMpIDIwMTcgQVQmVCBJbnRlbGxlY3R1YWwgUHJvcGVydHkKKyAqID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisgKiBMaWNlbnNlZCB1bmRlciB0aGUgQXBhY2hlIExpY2Vuc2UsIFZlcnNpb24gMi4wICh0aGUgIkxpY2Vuc2UiKTsKKyAqIHlvdSBtYXkgbm90IHVzZSB0aGlzIGZpbGUgZXhjZXB0IGluIGNvbXBsaWFuY2Ugd2l0aCB0aGUgTGljZW5zZS4KKyAqIFlvdSBtYXkgb2J0YWluIGEgY29weSBvZiB0aGUgTGljZW5zZSBhdAorICogCisgKiAgICAgIGh0dHA6Ly93d3cuYXBhY2hlLm9yZy9saWNlbnNlcy9MSUNFTlNFLTIuMAorICogCisgKiBVbmxlc3MgcmVxdWlyZWQgYnkgYXBwbGljYWJsZSBsYXcgb3IgYWdyZWVkIHRvIGluIHdyaXRpbmcsIHNvZnR3YXJlCisgKiBkaXN0cmlidXRlZCB1bmRlciB0aGUgTGljZW5zZSBpcyBkaXN0cmlidXRlZCBvbiBhbiAiQVMgSVMiIEJBU0lTLAorICogV0lUSE9VVCBXQVJSQU5USUVTIE9SIENPTkRJVElPTlMgT0YgQU5ZIEtJTkQsIGVpdGhlciBleHByZXNzIG9yIGltcGxpZWQuCisgKiBTZWUgdGhlIExpY2Vuc2UgZm9yIHRoZSBzcGVjaWZpYyBsYW5ndWFnZSBnb3Zlcm5pbmcgcGVybWlzc2lvbnMgYW5kCisgKiBsaW1pdGF0aW9ucyB1bmRlciB0aGUgTGljZW5zZS4KKyAqID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisgKi8KK3BhY2thZ2Ugb3JnLm9wZW5lY29tc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WluL2phdmEvb3JnL29wZW5lY29tcC9wb3J0YWxhcHAvcG9ydGFsL3NlcnZpY2UvU2hhcmVkQ29udGV4dFNlcnZpY2VJbXBsLmphdmEKQEAgLTAsMCArMSwxNzMgQEAKKy8qLQorICogPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKyAqIGVDT01QIFBvcnRhbAorICogPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKyAqIENvcHlyaWdodCAoQykgMjAxNyBBVCZUIEludGVsbGVjdHVhbCBQcm9wZXJ0eQorICogPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKyAqIExpY2Vuc2VkIHVuZGVyIHRoZSBBcGFjaGUgTGljZW5zZSwgVmVyc2lvbiAyLjAgKHRoZSAiTGljZW5zZSIpOworICogeW91IG1heSBub3QgdXNlIHRoaXMgZmlsZSBleGNlcHQgaW4gY29tcGxpYW5jZSB3aXRoIHRoZSBMaWNlbnNlLgorICogWW91IG1heSBvYnRhaW4gYSBjb3B5IG9mIHRoZSBMaWNlbnNlIGF0CisgKiAKKyAqICAgICAgaHR0cDovL3d3dy5hcGFjaGUub3JnL2xpY2Vuc2VzL0xJQ0VOU0UtMi4wCisgKiAKKyAqIFVubGVzcyByZXF1aXJlZCBieSBhcHBsaWNhYmxlIGxhdyBvciBhZ3JlZWQgdG8gaW4gd3JpdGluZywgc29mdHdhcmUKKyAqIGRpc3RyaWJ1dGVkIHVuZGVyIHRoZSBMaWNlbnNlIGlzIGRpc3RyaWJ1dGVkIG9uIGFuICJBUyBJUyIgQkFTSVMsCisgKiBXSVRIT1VUIFdBUlJBTlRJRVMgT1IgQ09ORElUSU9OUyBPRiBBTlkgS0lORCwgZWl0aGVy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PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorICogQ29weXJpZ2h0IChDKSAyMDE3IEFUJlQgSW50ZWxsZWN0dWFsIFByb3BlcnR5CisgKiA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorICogTGljZW5zZWQgdW5kZXIgdGhlIEFwYWNoZSBMaWNlbnNlLCBWZXJzaW9uIDIuMCAodGhlICJMaWNlbnNlIik7CisgKiB5b3UgbWF5IG5vdCB1c2UgdGhpcyBmaWxlIGV4Y2VwdCBpbiBjb21wbGlhbmNlIHdpdGggdGhlIExpY2Vuc2UuCisgKiBZb3UgbWF5IG9idGFpbiBhIGNvcHkgb2YgdGhlIExpY2Vuc2UgYXQKKyAqIAorICogICAgICBodHRwOi8vd3d3LmFwYWNoZS5vcmcvbGljZW5zZXMvTElDRU5TRS0yLjAKKyAqIAorICogVW5sZXNzIHJlcXVpcmVkIGJ5IGFwcGxpY2FibGUgbGF3IG9yIGFncmVlZCB0byBpbiB3cml0aW5nLCBzb2Z0d2FyZQorICogZGlzdHJpYnV0ZWQgdW5kZXIgdGhlIExpY2Vuc2UgaXMgZGlzdHJpYnV0ZWQgb24gYW4gIkFTIElTIiBCQVNJUywKKyAqIFdJVEhPVVQgV0FSUkFOVElFUyBPUiBDT05ESVRJT05TIE9GIEFOWSBLSU5ELCBlaXRoZXIgZXhwcmVzcyBvciBpbXBsaWVkLgorICogU2VlIHRoZSBMaWNlbnNlIGZvciB0aGUgc3BlY2lmaWMgbGFuZ3VhZ2UgZ292ZXJuaW5nIHBlcm1pc3Npb25zIGFuZAorICogbGltaXRhdGlvbnMgdW5kZXIgdGhlIExpY2Vuc2UuCisgKiA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09P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tYWluL2phdmEvb3JnL29wZW5lY29tcC9wb3J0YWxhcHAvcG9ydGFsL3NlcnZpY2UvVXNlclJvbGVzU2VydmljZUltcGwuamF2YQpAQCAtMCwwICsxLDY1NiBAQAorLyotCisgKiA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorICogZUNPTVAgUG9ydGFsCisgKiA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorICogQ29weXJpZ2h0IChDKSAyMDE3IEFUJlQgSW50ZWxsZWN0dWFsIFByb3BlcnR5CisgKiA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorICogTGljZW5zZWQgdW5kZXIgdGhlIEFwYWNoZSBMaWNlbnNlLCBWZXJzaW9uIDIuMCAodGhlICJMaWNlbnNlIik7CisgKiB5b3UgbWF5IG5vdCB1c2UgdGhpcyBmaWxlIGV4Y2VwdCBpbiBjb21wbGlhbmNlIHdpdGggdGhlIExpY2Vuc2UuCisgKiBZb3UgbWF5IG9idGFpbiBhIGNvcHkgb2YgdGhlIExpY2Vuc2UgYXQKKyAqIAorICogICAgICBodHRwOi8vd3d3LmFwYWNoZS5vcmcvbGljZW5zZXMvTElDRU5TRS0yLjAKKyAqIAorICogVW5sZXNzIHJlcXVpcmVkIGJ5IGFwcGxpY2FibGUgbGF3IG9yIGFncmVlZCB0byBpbiB3cml0aW5nLCBzb2Z0d2FyZQorICogZGlzdHJpYnV0ZWQgdW5kZXIgdGhlIExpY2Vuc2UgaXMgZGlzdHJpYnV0ZWQgb24gYW4gIkFTIElTIiBCQVNJUywKKyAqIFdJVEhPVVQgV0FSUkFOVElFUyBPUiBDT05ESVRJT05TIE9GIEFOWSBLSU5ELCBlaXRoZXIgZXhwcmV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c0ZvclVzZXI6IGxpc3Qgc2l6ZSBpcyB7fSIsIAorCQkJCXJvbGVMaXN0LnNpemUoKSk7CisJCXJldHVybiByb2xlTGlzdDsKKwl9CisKK30KZGlmZiAtLWdpdCBhL2Vjb21wLXBvcnRhbC1CRS9zcmMvbWFpbi9qYXZhL29yZy9vcGVuZWNvbXAvcG9ydGFsYXBwL3BvcnRhbC9zZXJ2aWNlL1VzZXJTZXJ2aWNlLmphdmEgYi9lY29tcC1wb3J0YWwtQkUvc3JjL21haW4vamF2YS9vcmcvb3BlbmVjb21wL3BvcnRhbGFwcC9wb3J0YWwvc2VydmljZS9Vc2VyU2VydmljZS5qYXZhCm5ldyBmaWxlIG1vZGUgMTAwNjQ0CmluZGV4IDAwMDAwMDAuLjhmY2Q1NjYKLS0tIC9kZXYvbnVsbAorKysgYi9lY29tcC1wb3J0YWwtQkUvc3JjL21haW4vamF2YS9vcmcvb3BlbmVjb21wL3BvcnRhbGFwcC9wb3J0YWwvc2VydmljZS9Vc2VyU2VydmljZS5qYXZhCkBAIC0wLDAgKzEsMzQgQEAKKy8qLQorICogPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKyAqIGVDT01QIFBvcnRhbAorICogPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKyAqIENvcHlyaWdodCAoQykgMjAxNyBBVCZUIEludGVsbGVjdHVhbCBQcm9wZXJ0eQorICogPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKyAqIExpY2Vuc2VkIHVuZGVyIHRoZSBBcGFjaGUgTGljZW5zZSwgVmVyc2lvbiAyLjAgKHRoZSAiTGljZW5zZSIpOworICogeW91IG1heSBub3QgdXNlIHRoaXMgZmlsZSBle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ydmljZSgpLnNhdmVEb21haW5PYmplY3Qob2xkVXNlciwgbnVsbCk7CisJCSAgICAJCSAKKwkJICAgIAkgfQorCQkgICAgCSAKKwkJICAgICB9CisJCQorCQl9Y2F0Y2ggKEV4Y2VwdGlvbiBlKSB7CisJCQlsb2dnZXIuZXJyb3IoRUVMRkxvZ2dlckRlbGVnYXRlLmVycm9yTG9nZ2VyLCAiIiwgZSk7CisJCQl0aHJvdyBuZXcgRXhjZXB0aW9uKGUpOworCQl9CisJCXJldHVybiAic3VjY2VzcyI7CisJfTsKKworfQpkaWZmIC0tZ2l0IGEvZWNvbXAtcG9ydGFsLUJFL3NyYy9tYWluL2phdmEvb3JnL29wZW5lY29tcC9wb3J0YWxhcHAvcG9ydGFsL3NlcnZpY2UvV2lkZ2V0U2VydmljZS5qYXZhIGIvZWNvbXAtcG9ydGFsLUJFL3NyYy9tYWluL2phdmEvb3JnL29wZW5lY29tcC9wb3J0YWxhcHAvcG9ydGFsL3NlcnZpY2UvV2lkZ2V0U2VydmljZS5qYXZhCm5ldyBmaWxlIG1vZGUgMTAwNjQ0CmluZGV4IDAwMDAwMDAuLmFmZWMzMzgKLS0tIC9kZXYvbnVsbAorKysgYi9lY29tcC1wb3J0YWwtQkUvc3JjL21haW4vamF2YS9vcmcvb3BlbmVjb21wL3BvcnRhbGFwcC9wb3J0YWwvc2VydmljZS9XaWRnZXRTZXJ2aWNlLmphdmEKQEAgLTAsMCArMSwzNiBAQAorLyotCisgKiA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorICogZUNPTVAgUG9ydGFsCisgKiA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorICogQ29weXJpZ2h0IChDKSAyMDE3IEFUJlQgSW50ZWxsZWN0dWFsIFByb3BlcnR5CisgKiA9PT09PT09PT09P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LDI3NSBAQAorLyotCisgKiA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorICogZUNPTVAgUG9ydGFsCisgKiA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorICogQ29weXJpZ2h0IChDKSAyMDE3IEFUJlQgSW50ZWxsZWN0dWFsIFByb3BlcnR5CisgKiA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorICogTGljZW5zZWQgdW5kZXIgdGhlIEFwYWNoZSBMaWNlbnNlLCBWZXJzaW9uIDIuMCAodGhlICJMaWNlbnNlIik7CisgKiB5b3UgbWF5IG5vdCB1c2UgdGhpcyBmaWxlIGV4Y2VwdCBpbiBjb21wbGlhbmNlIHdpdGggdGhlIExpY2Vuc2UuCisgKiBZb3UgbWF5IG9idGFpbiBhIGNvcHkgb2YgdGhlIExpY2Vuc2UgYXQKKyAqIAorICogICAgICBodHRwOi8vd3d3LmFwYWNoZS5vcmcvbGljZW5zZXMvTElDRU5TRS0yLjAKKyAqIAorICogVW5sZXNzIHJlcXVpcmVkIGJ5IGFwcGxpY2FibGUgbGF3IG9yIGFncmVlZCB0byBpbiB3cml0aW5nLCBzb2Z0d2FyZQorICogZGlzdHJpYnV0ZWQgdW5kZXIgdGhlIExpY2Vuc2UgaXMgZGlzdHJpYnV0ZWQgb24gYW4gIkFTIElTIiBCQVNJUywKKyAqIFdJVEhPVVQgV0FSUkFOVElFUyBPUiBDT05ESVRJT05TIE9GIEFOWSBLSU5ELCBlaXRoZXIgZXhwcmVzcyBvciBpbXBsaWVkLgorICogU2VlIHRoZSBMaWNlbnNlIGZvciB0aGUgc3BlY2lmaWMgbGFuZ3VhZ2UgZ292ZXJuaW5nIHBlcm1pc3Npb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9wb3J0YWxhcHAvcG9ydGFsL3RyYW5zcG9ydC9BbGxBcHBzV2l0aFJvbGVzRm9yVXNlci5qYXZhCkBAIC0wLDAgKzEsNDAgQEAKKy8qLQorICogPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKyAqIGVDT01QIFBvcnRhbAorICogPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKyAqIENvcHlyaWdodCAoQykgMjAxNyBBVCZUIEludGVsbGVjdHVhbCBQcm9wZXJ0eQorICogPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKyAqIExpY2Vuc2VkIHVuZGVyIHRoZSBBcGFjaGUgTGljZW5zZSwgVmVyc2lvbiAyLjAgKHRoZSAiTGljZW5zZSIpOworICogeW91IG1heSBub3QgdXNlIHRoaXMgZmlsZSBleGNlcHQgaW4gY29tcGxpYW5jZSB3aXRoIHRoZSBMaWNlbnNlLgorICogWW91IG1heSBvYnRhaW4gYSBjb3B5IG9mIHRoZSBMaWNlbnNlIGF0CisgKiAKKyAqICAgICAgaHR0cDovL3d3dy5hcGFjaGUub3JnL2xpY2Vuc2VzL0xJQ0VOU0UtMi4wCisgKiAKKyAqIFVubGVzcyByZXF1aXJlZCBieSBhcHBsaWNhYmxlIGxhdyBvciBhZ3JlZWQgdG8gaW4gd3JpdGluZywgc29mdHdhcmUKKyAqIGRpc3RyaWJ1dGVkIHVuZGVyIHRoZSBMaWNlbnNlIGlzIGRpc3RyaWJ1dGVkIG9uIGFuICJBUyBJUyIgQkFTSVMsCisgKiBXSVRIT1VUIFdBUlJBTlRJRVMgT1IgQ09ORElUSU9OUyBPRiBBTlkgS0lORCwgZWl0aGVyIGV4cHJlc3Mgb3IgaW1wbG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pbGUKZGlmZiAtLWdpdCBhL2Vjb21wLXBvcnRhbC1CRS9zcmMvbWFpbi9qYXZhL29yZy9vcGVuZWNvbXAvcG9ydGFsYXBwL3BvcnRhbC90cmFuc3BvcnQvQXBwTmFtZUlkSXNBZG1pbi5qYXZhIGIvZWNvbXAtcG9ydGFsLUJFL3NyYy9tYWluL2phdmEvb3JnL29wZW5lY29tcC9wb3J0YWxhcHAvcG9ydGFsL3RyYW5zcG9ydC9BcHBOYW1lSWRJc0FkbWluLmphdmEKbmV3IGZpbGUgbW9kZSAxMDA2NDQKaW5kZXggMDAwMDAwMC4uZDA0ZTg0MAotLS0gL2Rldi9udWxsCisrKyBiL2Vjb21wLXBvcnRhbC1CRS9zcmMvbWFpbi9qYXZhL29yZy9vcGVuZWNvbXAvcG9ydGFsYXBwL3BvcnRhbC90cmFuc3BvcnQvQXBwTmFtZUlkSXNBZG1pbi5qYXZhCkBAIC0wLDAgKzEsMzEgQEAKKy8qLQorICogPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKyAqIGVDT01QIFBvcnRhbAorICogPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKyAqIENvcHlyaWdodCAoQykgMjAxNyBBVCZUIEludGVsbGVjdHVhbCBQcm9wZXJ0eQorICogPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKyAqIExpY2Vuc2VkIHVuZGVyIHRoZSBBcGFjaGUgTGljZW5zZSwgVmVyc2lvbiAyLjAgKHRoZSAiTGljZW5zZSIpOworICogeW91IG1heSBub3QgdXNlIHRoaXMgZmlsZSBleGNlcHQgaW4gY29tcGxpYW5jZSB3aXRoIHRoZSBMaWNlbnNlLgorICogWW91IG1heSBvYnRh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b3J0YWwtQkUvc3JjL21haW4vamF2YS9vcmcvb3BlbmVjb21wL3BvcnRhbGFwcC9wb3J0YWwvdHJhbnNwb3J0L0FwcFdpdGhSb2xlc0ZvclVzZXIuamF2YQpuZXcgZmlsZSBtb2RlIDEwMDY0NAppbmRleCAwMDAwMDAwLi5mZTk5NmZkCi0tLSAvZGV2L251bGwKKysrIGIvZWNvbXAtcG9ydGFsLUJFL3NyYy9tYWluL2phdmEvb3JnL29wZW5lY29tcC9wb3J0YWxhcHAvcG9ydGFsL3RyYW5zcG9ydC9BcHBXaXRoUm9sZXNGb3JVc2VyLmphdmEKQEAgLTAsMCArMSwzNCBAQAorLyotCisgKiA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorICogZUNPTVAgUG9ydGFsCisgKiA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorICogQ29weXJpZ2h0IChDKSAyMDE3IEFUJlQgSW50ZWxsZWN0dWFsIFByb3BlcnR5CisgKiA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorICogTGljZW5zZWQgdW5kZXIgdGhlIEFwYWNoZSBMaWNlbnNlLCBWZXJzaW9uIDIuMCAodGhlICJMaWNlbnNlIik7CisgKiB5b3UgbWF5IG5vdCB1c2UgdGhpcyBmaWxlIGV4Y2VwdCBpbiBjb21wbGlhbmNlIHdpdGggdGhlIExpY2Vuc2UuCisgKiBZb3UgbWF5IG9idGFpbiBhIGNvcHkgb2YgdGhlIExpY2Vuc2UgYXQKKyAqIAorICogICAgICBodHRwOi8vd3d3LmFwYWNoZS5vcmcvbGljZW5zZXMvTElDRU5TRS0yLjAKKyAqIAorICogVW5sZXNzIHJlcXVpcmVkIGJ5IGFwcGxp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2l0aEFkbWluUm9sZS5qYXZhCm5ldyBmaWxlIG1vZGUgMTAwNjQ0CmluZGV4IDAwMDAwMDAuLjkwN2JmN2UKLS0tIC9kZXYvbnVsbAorKysgYi9lY29tcC1wb3J0YWwtQkUvc3JjL21haW4vamF2YS9vcmcvb3BlbmVjb21wL3BvcnRhbGFwcC9wb3J0YWwvdHJhbnNwb3J0L0FwcHNMaXN0V2l0aEFkbWluUm9sZS5qYXZhCkBAIC0wLDAgKzEsMzQgQEAKKy8qLQorICogPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKyAqIGVDT01QIFBvcnRhbAorICogPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKyAqIENvcHlyaWdodCAoQykgMjAxNyBBVCZUIEludGVsbGVjdHVhbCBQcm9wZXJ0eQorICogPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKyAqIExpY2Vuc2VkIHVuZGVyIHRoZSBBcGFjaGUgTGljZW5zZSwgVmVyc2lvbiAyLjAgKHRoZSAiTGljZW5zZSIpOworICogeW91IG1heSBub3QgdXNlIHRoaXMgZmlsZSBleGNlcHQgaW4gY29tcGxpYW5jZSB3aXRoIHRoZSBMaWNlbnNlLgorICogWW91IG1heSBvYnRhaW4gYSBjb3B5IG9mIHRoZSBMaWNlbnNlIGF0CisgKiAKKyAqICAgICAgaHR0cDovL3d3dy5hcGFjaGUub3JnL2xpY2Vuc2VzL0xJQ0VOU0UtMi4wCisgKiAKKyAqIFVubGVzcyByZXF1aXJlZCBieSBhcHBsaWNhYmxlIGxhdyBvciBhZ3JlZWQgdG8gaW4gd3JpdGluZywgc29mdHdhcmUKKyAqIGRpc3RyaWJ1dGVkIHVuZGVyIHR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DA2NDQKaW5kZXggMDAwMDAwMC4uNzA2ZDZiYQotLS0gL2Rldi9udWxsCisrKyBiL2Vjb21wLXBvcnRhbC1CRS9zcmMvbWFpbi9qYXZhL29yZy9vcGVuZWNvbXAvcG9ydGFsYXBwL3BvcnRhbC90cmFuc3BvcnQvQ29tbW9uV2lkZ2V0LmphdmEKQEAgLTAsMCArMSwxNDAgQEAKKy8qLQorICogPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKyAqIGVDT01QIFBvcnRhbAorICogPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKyAqIENvcHlyaWdodCAoQykgMjAxNyBBVCZUIEludGVsbGVjdHVhbCBQcm9wZXJ0eQorICogPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKyAqIExpY2Vuc2VkIHVuZGVyIHRoZSBBcGFjaGUgTGljZW5zZSwgVmVyc2lvbiAyLjAgKHRoZSAiTGljZW5zZSIpOworICogeW91IG1heSBub3QgdXNlIHRoaXMgZmlsZSBleGNlcHQgaW4gY29tcGxpYW5jZSB3aXRoIHRoZSBMaWNlbnNlLgorICogWW91IG1heSBvYnRhaW4gYSBjb3B5IG9mIHRoZSBMaWNlbnNlIGF0CisgKiAKKyAqICAgICAgaHR0cDovL3d3dy5hcGFjaGUub3JnL2xpY2Vuc2VzL0xJQ0VOU0UtMi4wCisgKiAKKyAqIFVubGVzcyByZXF1aXJlZCBieSBhcHBsaWNhYmxlIGxhdyBvciBhZ3JlZWQgdG8gaW4gd3JpdGluZywgc29mdHdhcmUKKyAqIGRpc3RyaWJ1dGVkIHVuZGVyIHRoZSBMaWNlbnNlIGlzIGRpc3RyaWJ1dGVkIG9uIGFuICJBUyBJUyIg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HJpbmcgY29udGVudCkgeworCQl0aGlzLmNvbnRlbnQgPSBjb250ZW50OworCX0KKworCXB1YmxpYyBTdHJpbmcgZ2V0RXZlbnREYXRlKCkgeworCQlyZXR1cm4gZXZlbnREYXRlOworCX0KKworCXB1YmxpYyB2b2lkIHNldEV2ZW50RGF0ZShTdHJpbmcgZXZlbnREYXRlKSB7CisJCXRoaXMuZXZlbnREYXRlID0gZXZlbnREYXRlOworCX0JCit9CmRpZmYgLS1naXQgYS9lY29tcC1wb3J0YWwtQkUvc3JjL21haW4vamF2YS9vcmcvb3BlbmVjb21wL3BvcnRhbGFwcC9wb3J0YWwvdHJhbnNwb3J0L0NvbW1vbldpZGdldE1ldGEuamF2YSBiL2Vjb21wLXBvcnRhbC1CRS9zcmMvbWFpbi9qYXZhL29yZy9vcGVuZWNvbXAvcG9ydGFsYXBwL3BvcnRhbC90cmFuc3BvcnQvQ29tbW9uV2lkZ2V0TWV0YS5qYXZhCm5ldyBmaWxlIG1vZGUgMTAwNjQ0CmluZGV4IDAwMDAwMDAuLmRiYTExMjcKLS0tIC9kZXYvbnVsbAorKysgYi9lY29tcC1wb3J0YWwtQkUvc3JjL21haW4vamF2YS9vcmcvb3BlbmVjb21wL3BvcnRhbGFwcC9wb3J0YWwvdHJhbnNwb3J0L0NvbW1vbldpZGdldE1ldGEuamF2YQpAQCAtMCwwICsxLDUwIEBACisvKi0KKyAqID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisgKiBlQ09NUCBQb3J0YWwKKyAqID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisgKiBDb3B5cmlnaHQgKEMpIDIwMTcgQVQmVCBJbnRlbGxlY3R1YWwgUHJvcGVydHkKKyAqID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09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3RyYW5zcG9ydC9FdmVudFdpZGdldC5qYXZhCkBAIC0wLDAgKzEsMTM5IEBACisvKi0KKyAqID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisgKiBlQ09NUCBQb3J0YWwKKyAqID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisgKiBDb3B5cmlnaHQgKEMpIDIwMTcgQVQmVCBJbnRlbGxlY3R1YWwgUHJvcGVydHkKKyAqID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisgKiBMaWNlbnNlZCB1bmRlciB0aGUgQXBhY2hlIExpY2Vuc2UsIFZlcnNpb24gMi4wICh0aGUgIkxpY2Vuc2UiKTsKKyAqIHlvdSBtYXkgbm90IHVzZSB0aGlzIGZpbGUgZXhjZXB0IGluIGNvbXBsaWFuY2Ugd2l0aCB0aGUgTGljZW5zZS4KKyAqIFlvdSBtYXkgb2J0YWluIGEgY29weSBvZiB0aGUgTGljZW5zZSBhdAorICogCisgKiAgICAgIGh0dHA6Ly93d3cuYXBhY2hlLm9yZy9saWNlbnNlcy9MSUNFTlNFLTIuMAorICogCisgKiBVbmxlc3MgcmVxdWlyZWQgYnkgYXBwbGljYWJsZSBsYXcgb3IgYWdyZWVkIHRvIGluIHdyaXRpbmcsIHNvZnR3YXJlCisgKiBkaXN0cmlidXRlZCB1bmRlciB0aGUgTGljZW5zZSBpcyBkaXN0cmlidXRlZCBvbiBhbiAiQVMgSVMiIEJBU0lTLAorICogV0lUSE9VVCBXQVJSQU5USUVTIE9SIENPTkRJVElPTlMgT0YgQU5ZIEtJTkQsIGVpdGhlciBleHByZXNzIG9yIGltcGxpZWQuCisgKiBTZWUgdGhlIExpY2Vuc2UgZm9yIHRoZSBz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W5lY29tcC9wb3J0YWxhcHAvcG9ydGFsL3RyYW5zcG9ydC9FdmVudFdpZGdldE1ldGEuamF2YQpuZXcgZmlsZSBtb2RlIDEwMDY0NAppbmRleCAwMDAwMDAwLi42MGU5YWEwCi0tLSAvZGV2L251bGwKKysrIGIvZWNvbXAtcG9ydGFsLUJFL3NyYy9tYWluL2phdmEvb3JnL29wZW5lY29tcC9wb3J0YWxhcHAvcG9ydGFsL3RyYW5zcG9ydC9FdmVudFdpZGdldE1ldGEuamF2YQpAQCAtMCwwICsxLDUyIEBACisvKi0KKyAqID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisgKiBlQ09NUCBQb3J0YWwKKyAqID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisgKiBDb3B5cmlnaHQgKEMpIDIwMTcgQVQmVCBJbnRlbGxlY3R1YWwgUHJvcGVydHkKKyAqID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisgKiBMaWNlbnNlZCB1bmRlciB0aGUgQXBhY2hlIExpY2Vuc2UsIFZlcnNpb24gMi4wICh0aGUgIkxpY2Vuc2UiKTsKKyAqIHlvdSBtYXkgbm90IHVzZSB0aGlzIGZpbGUgZXhjZXB0IGluIGNvbXBsaWFuY2Ugd2l0aCB0aGUgTGljZW5zZS4KKyAqIFlvdSBtYXkgb2J0YWluIGEgY29weSBvZiB0aGUgTGljZW5zZSBhdAorICogCisgKiAgICAgIGh0dHA6Ly93d3cuYXBhY2hlLm9yZy9saWNlbnNlcy9MSUNFTlNFLTIuMAorICogCisgKiBVbmxlc3MgcmVxdWlyZWQgYnkgYXBwbGljYWJsZSBsYXcgb3IgYWdyZWVkIHRvIGluIHdyaXRpbmcsIHNvZ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29wZW5lY29tcC9wb3J0YWxhcHAvcG9ydGFsL3RyYW5zcG9ydC9GYXZvcml0ZXNGdW5jdGlvbmFsTWVudUl0ZW1Kc29uLmphdmEKQEAgLTAsMCArMSw1NyBAQAorLyotCisgKiA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorICogZUNPTVAgUG9ydGFsCisgKiA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorICogQ29weXJpZ2h0IChDKSAyMDE3IEFUJlQgSW50ZWxsZWN0dWFsIFByb3BlcnR5CisgKiA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorICogTGljZW5zZWQgdW5kZXIgdGhlIEFwYWNoZSBMaWNlbnNlLCBWZXJzaW9uIDIuMCAodGhlICJMaWNlbnNlIik7CisgKiB5b3UgbWF5IG5vdCB1c2UgdGhpcyBmaWxlIGV4Y2VwdCBpbiBjb21wbGlhbmNlIHdpdGggdGhlIExpY2Vuc2UuCisgKiBZb3UgbWF5IG9idGFpbiBhIGNvcHkgb2YgdGhlIExpY2Vuc2UgYXQKKyAqIAorICogICAgICBodHRwOi8vd3d3LmFwYWNoZS5vcmcvbGljZW5zZXMvTElDRU5TRS0yLjAKKyAqIAorICogVW5sZXNzIHJlcXVpcmVkIGJ5IGFwcGxpY2FibGUgbGF3IG9yIGFncmVlZCB0byBpbiB3cml0aW5nLCBzb2Z0d2FyZQorICogZGlzdHJpYnV0ZWQgdW5kZXIgdGhlIExpY2Vuc2UgaXMgZGlzdHJpYnV0ZWQgb24gYW4gIkFTIElTIiBCQVNJUywKKyAqIFdJVEhPVVQgV0FSUkFOVElFUyBPUiBDT05ESVRJT05TIE9GIEFOWSBLSU5ELCBlaXRoZXIgZXh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YW1lID0gInRleHQiKQorCXB1YmxpYyBTdHJpbmcgdGV4dDsKKwkKKwlAQ29sdW1uKG5hbWUgPSAidXJsIikKKwlwdWJsaWMgU3RyaW5nIHVybDsKKwkKKwlAVHJhbnNpZW50CisJcHVibGljIEJvb2xlYW4gcmVzdHJpY3RlZEFwcDsKK30KZGlmZiAtLWdpdCBhL2Vjb21wLXBvcnRhbC1CRS9zcmMvbWFpbi9qYXZhL29yZy9vcGVuZWNvbXAvcG9ydGFsYXBwL3BvcnRhbC90cmFuc3BvcnQvRmllbGRzVmFsaWRhdG9yLmphdmEgYi9lY29tcC1wb3J0YWwtQkUvc3JjL21haW4vamF2YS9vcmcvb3BlbmVjb21wL3BvcnRhbGFwcC9wb3J0YWwvdHJhbnNwb3J0L0ZpZWxkc1ZhbGlkYXRvci5qYXZhCm5ldyBmaWxlIG1vZGUgMTAwNjQ0CmluZGV4IDAwMDAwMDAuLmNhNTU5OTcKLS0tIC9kZXYvbnVsbAorKysgYi9lY29tcC1wb3J0YWwtQkUvc3JjL21haW4vamF2YS9vcmcvb3BlbmVjb21wL3BvcnRhbGFwcC9wb3J0YWwvdHJhbnNwb3J0L0ZpZWxkc1ZhbGlkYXRvci5qYXZhCkBAIC0wLDAgKzEsNDkgQEAKKy8qLQorICogPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKyAqIGVDT01QIFBvcnRhbAorICogPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKyAqIENvcHlyaWdodCAoQykgMjAxNyBBVCZUIEludGVsbGVjdHVhbCBQcm9wZXJ0eQorICogPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKyAqIExpY2Vuc2VkIHVuZGVyIHRoZS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PT09PT09PT09PT09PT09PT09CisgKiBlQ09NUCBQb3J0YWwKKyAqID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisgKiBDb3B5cmlnaHQgKEMpIDIwMTcgQVQmVCBJbnRlbGxlY3R1YWwgUHJvcGVydHkKKyAqID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisgKiBMaWNlbnNlZCB1bmRlciB0aGUgQXBhY2hlIExpY2Vuc2UsIFZlcnNpb24gMi4wICh0aGUgIkxpY2Vuc2UiKTsKKyAqIHlvdSBtYXkgbm90IHVzZSB0aGlzIGZpbGUgZXhjZXB0IGluIGNvbXBsaWFuY2Ugd2l0aCB0aGUgTGljZW5zZS4KKyAqIFlvdSBtYXkgb2J0YWluIGEgY29weSBvZiB0aGUgTGljZW5zZSBhdAorICogCisgKiAgICAgIGh0dHA6Ly93d3cuYXBhY2hlLm9yZy9saWNlbnNlcy9MSUNFTlNFLTIuMAorICogCisgKiBVbmxlc3MgcmVxdWlyZWQgYnkgYXBwbGljYWJsZSBsYXcgb3IgYWdyZWVkIHRvIGluIHdyaXRpbmcsIHNvZnR3YXJlCisgKiBkaXN0cmlidXRlZCB1bmRlciB0aGUgTGljZW5zZSBpcyBkaXN0cmlidXRlZCBvbiBhbiAiQVMgSVMiIEJBU0lTLAorICogV0lUSE9VVCBXQVJSQU5USUVTIE9SIENPTkRJVElPTlMgT0YgQU5ZIEtJTkQsIGVpdGhlciBleHByZXNzIG9yIGltcGxpZWQuCisgKiBTZWUgdGhlIExpY2Vuc2UgZm9yIHRoZSBzcGVjaWZpYyBsYW5ndWFnZSBnb3Zlcm5pbmcgcGVybWlzc2lvbnMgYW5kCisgKiBsaW1pdGF0aW9ucyB1bmRlciB0aGUgTGljZW5zZS4KKyAqID09PT09PT09PT09PT09PT09PT09PT09P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AxNyBBVCZUIEludGVsbGVjdHVhbCBQcm9wZXJ0eQorICogPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKyAqIExpY2Vuc2VkIHVuZGVyIHRoZSBBcGFjaGUgTGljZW5zZSwgVmVyc2lvbiAyLjAgKHRoZSAiTGljZW5zZSIpOworICogeW91IG1heSBub3QgdXNlIHRoaXMgZmlsZSBleGNlcHQgaW4gY29tcGxpYW5jZSB3aXRoIHRoZSBMaWNlbnNlLgorICogWW91IG1heSBvYnRhaW4gYSBjb3B5IG9mIHRoZSBMaWNlbnNlIGF0CisgKiAKKyAqICAgICAgaHR0cDovL3d3dy5hcGFjaGUub3JnL2xpY2Vuc2VzL0xJQ0VOU0UtMi4wCisgKiAKKyAqIFVubGVzcyByZXF1aXJlZCBieSBhcHBsaWNhYmxlIGxhdyBvciBhZ3JlZWQgdG8gaW4gd3JpdGluZywgc29mdHdhcmUKKyAqIGRpc3RyaWJ1dGVkIHVuZGVyIHRoZSBMaWNlbnNlIGlzIGRpc3RyaWJ1dGVkIG9uIGFuICJBUyBJUyIgQkFTSVMsCisgKiBXSVRIT1VUIFdBUlJBTlRJRVMgT1IgQ09ORElUSU9OUyBPRiBBTlkgS0lORCwgZWl0aGVyIGV4cHJlc3Mgb3IgaW1wbGllZC4KKyAqIFNlZSB0aGUgTGljZW5zZSBmb3IgdGhlIHNwZWNpZmljIGxhbmd1YWdlIGdvdmVybmluZyBwZXJtaXNzaW9ucyBhbmQKKyAqIGxpbWl0YXRpb25zIHVuZGVyIHRoZSBMaWNlbnNlLgorICogPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKyAqLworcGFja2FnZSBvcmcub3BlbmVjb21wLnBvcnRhbGFwcC5wb3J0YWwudHJhbnNwb3J0OworCitpbXBvcnQgamF2YS5pby5TZ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UuamF2YSBiL2Vjb21wLXBvcnRhbC1CRS9zcmMvbWFpbi9qYXZhL29yZy9vcGVuZWNvbXAvcG9ydGFsYXBwL3BvcnRhbC90cmFuc3BvcnQvRnVuY3Rpb25hbE1lbnVSb2xlLmphdmEKbmV3IGZpbGUgbW9kZSAxMDA2NDQKaW5kZXggMDAwMDAwMC4uMTc5MjQ3NwotLS0gL2Rldi9udWxsCisrKyBiL2Vjb21wLXBvcnRhbC1CRS9zcmMvbWFpbi9qYXZhL29yZy9vcGVuZWNvbXAvcG9ydGFsYXBwL3BvcnRhbC90cmFuc3BvcnQvRnVuY3Rpb25hbE1lbnVSb2xlLmphdmEKQEAgLTAsMCArMSw0OSBAQAorLyotCisgKiA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorICogZUNPTVAgUG9ydGFsCisgKiA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorICogQ29weXJpZ2h0IChDKSAyMDE3IEFUJlQgSW50ZWxsZWN0dWFsIFByb3BlcnR5CisgKiA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorICogTGljZW5zZWQgdW5kZXIgdGhlIEFwYWNoZSBMaWNlbnNlLCBWZXJzaW9uIDIuMCAodGhlICJMaWNlbnNlIik7CisgKiB5b3UgbWF5IG5vdCB1c2UgdGhpcyBmaWxlIGV4Y2VwdCBpbiBjb21wbGlhbmNlIHdpdGggdGhlIExpY2Vuc2UuCisgKiBZb3UgbWF5IG9idGFpbiBhIGNvcHkgb2YgdGhlIExpY2Vuc2UgYXQKKyAqIAorICogICAgICBodHRwOi8vd3d3LmFwYWNoZS5vcmcvbGljZW5zZXMvTElDRU5TRS0yLjAKKyAqIAorICogVW5sZXNzIH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xvbmcgc2VyaWFsVmVyc2lvblVJRCA9IDFMOworCisJQElkCisgICAgQEdlbmVyYXRlZFZhbHVlKHN0cmF0ZWd5PUdlbmVyYXRpb25UeXBlLklERU5USVRZKQorCUBDb2x1bW4obmFtZSA9ICJJRCIpCisJcHVibGljIEludGVnZXIgaWQ7CisJCisJQENvbHVtbihuYW1lID0gIk1FTlVfSUQiKQorCXB1YmxpYyBMb25nIG1lbnVJZDsKKwkKKwlAQ29sdW1uKG5hbWUgPSAiQVBQX0lEIikKKwlwdWJsaWMgSW50ZWdlciBhcHBJZDsKKwkKKwlAQ29sdW1uKG5hbWUgPSAiUk9MRV9JRCIpCisJcHVibGljIEludGVnZXIgcm9sZUlkOworCQorfQpkaWZmIC0tZ2l0IGEvZWNvbXAtcG9ydGFsLUJFL3NyYy9tYWluL2phdmEvb3JnL29wZW5lY29tcC9wb3J0YWxhcHAvcG9ydGFsL3RyYW5zcG9ydC9Mb2NhbFJvbGUuamF2YSBiL2Vjb21wLXBvcnRhbC1CRS9zcmMvbWFpbi9qYXZhL29yZy9vcGVuZWNvbXAvcG9ydGFsYXBwL3BvcnRhbC90cmFuc3BvcnQvTG9jYWxSb2xlLmphdmEKbmV3IGZpbGUgbW9kZSAxMDA2NDQKaW5kZXggMDAwMDAwMC4uNTg2YTM4OAotLS0gL2Rldi9udWxsCisrKyBiL2Vjb21wLXBvcnRhbC1CRS9zcmMvbWFpbi9qYXZhL29yZy9vcGVuZWNvbXAvcG9ydGFsYXBwL3BvcnRhbC90cmFuc3BvcnQvTG9jYWxSb2xlLmphdmEKQEAgLTAsMCArMSw0MiBAQAorLyotCisgKiA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorICogZUNPTVAgUG9ydGFsCisgKiA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorICogQ29weXJpZ2h0IChDKSAyMDE3IEFUJlQgSW50ZWxsZWN0dWFsIFByb3BlcnR5CisgKiA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorICogTGljZW5zZWQgdW5kZXIgdGhlIEFwYWNoZSBMaWNlbnNlLCBWZXJzaW9uIDIuMCAodGhlICJMaWNlbnNlIik7CisgKiB5b3UgbWF5IG5vdCB1c2UgdGhpcyBmaWxlIGV4Y2VwdCBpbiBjb21wbGlhbmNlIHdpdGggdGhlIExpY2Vuc2UuCisgKiBZb3UgbWF5IG9idGFpbiBhIGNvcHkgb2YgdGhlIExpY2Vuc2UgYXQKKyAqIAorICogICAgICBodHRwOi8vd3d3LmFwYWNoZS5vcmcvbGljZW5zZXMvTElDRU5TRS0yLjAKKyAqIAorICogVW5sZXNzIHJlcXVpcmVkIGJ5IGFwcGxpY2FibGUgbGF3IG9yIGFncmVlZCB0byBpbiB3cml0aW5nLCBzb2Z0d2FyZQorICogZGlzdHJpYnV0ZWQgdW5kZXIgdGhlIExpY2Vuc2UgaXMgZGlzdHJpYnV0ZWQgb24gYW4gIkFTIElTIiBCQVNJUywKKyAqIFdJVEhPVVQgV0FSUkFOVElFUyBPUiBDT05ESVRJT05TIE9GIEFOWSBLSU5ELCBlaXRoZXIgZXhwcmVzcyBvciBpbXBsaWVkLgorICogU2VlIHRoZSBMaWNlbnNlIGZvciB0aGUgc3BlY2lmaWMgbGFuZ3VhZ2UgZ292ZXJuaW5nIHBlcm1pc3Npb25zIGFuZAorICogbGltaXRhdGlvbnMgdW5kZXIgdGhlIExpY2Vuc2UuCisgKiA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorICovCitwYWNrYWdlIG9yZy5vcGVuZWNvbXAucG9ydGFsYXBwLnBvcnRhbC50cmFuc3BvcnQ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AQCAtMCwwICsxLDgzIEBACisvKi0KKyAqID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisgKiBlQ09NUCBQb3J0YWwKKyAqID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisgKiBDb3B5cmlnaHQgKEMpIDIwMTcgQVQmVCBJbnRlbGxlY3R1YWwgUHJvcGVydHkKKyAqID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisgKiBMaWNlbnNlZCB1bmRlciB0aGUgQXBhY2hlIExpY2Vuc2UsIFZlcnNpb24gMi4wICh0aGUgIkxpY2Vuc2UiKTsKKyAqIHlvdSBtYXkgbm90IHVzZSB0aGlzIGZpbGUgZXhjZXB0IGluIGNvbXBsaWFuY2Ugd2l0aCB0aGUgTGljZW5zZS4KKyAqIFlvdSBtYXkgb2J0YWluIGEgY29weSBvZiB0aGUgTGljZW5zZSBhdAorICogCisgKiAgICAgIGh0dHA6Ly93d3cuYXBhY2hlLm9yZy9saWNlbnNlcy9MSUNFTlNFLTIuMAorICogCisgKiBVbmxlc3MgcmVxdWlyZWQgYnkgYXBwbGljYWJsZSBsYXcgb3IgYWdyZWVkIHRvIGluIHdyaXRpbmcsIHNvZnR3YXJlCisgKiBkaXN0cmlidXRlZCB1bmRlciB0aGUgTGljZW5zZSBpcyBkaXN0cmlidXRlZCBvbiBhbiAiQVMgSVMiIEJBU0lTLAorICogV0lUSE9VVCBXQVJSQU5USUVTIE9SIENPTkRJVElPTlMgT0YgQU5ZIEtJTkQsIGVpdGhlciBleHByZXNzIG9yIGltcGxpZWQuCisgKiBTZWUgdGhlIExpY2Vuc2UgZm9yIHRoZSBzcGVjaWZpYyBsYW5ndWFnZSBnb3Zlcm5pbmcgcGVybWlzc2lvbnMgYW5kCisgKiBsaW1pdGF0aW9ucyB1bmRlciB0aGUgTGljZW5zZS4KKyAqID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisgKi8KK3BhY2thZ2Ugb3JnLm9wZW5lY29tcC5wb3J0YWxhcHAucG9ydGFsLnRyYW5zcG9ydDsKKworcHVibGljIGNsYXNzIE9uYm9hcmRpbmdBcHAgeworCisJcHVibGljIExvbmcgaWQ7CisKKwlwdWJsaWMgU3RyaW5nIG5hbWU7CisKKwlwdWJsaWMgU3RyaW5nIGltYWdlVXJsOworCisJcHVibGljIFN0cmluZyBkZXNjcmlwdGlvbjsKKworCXB1YmxpYyBTdHJpbmcgbm90ZXM7CisKKwlwdWJsaWMgU3RyaW5nIHVybDsKKworCXB1YmxpYyBTdHJpbmcgYWx0ZXJuYXRlVXJsOworCisJcHVibGljIFN0cmluZyByZXN0VXJsOworCisJcHVibGljIEJvb2xlYW4gaXNPcGVuOworCisJcHVibGljIEJvb2xlYW4gaXNFbmFibGVkOworCisJcHVibGljIFN0cmluZyB1c2VybmFtZTsKKworCXB1YmxpYyBTdHJpbmcgYXBwUGFzc3dvcmQ7CisKKwlwdWJsaWMgU3RyaW5nIHRodW1ibmFpbDsKKwkKKwlwdWJsaWMgU3RyaW5nIHVlYlRvcGljTmFtZTsKKwkKKwlwdWJsaWMgU3RyaW5nIHVlYktleTsKKwkKKwlwdWJsaWMgU3RyaW5nIHVlYlNlY3JldDsKKwkKKwlwdWJsaWMgQm9vbGVhbiByZXN0cmljdGVkQXBwOworCisJcHVibGljIHZvaWQgbm9ybWFsaXplKCkgeworCQl0aGlzLm5hbWUgPSAodGhpcy5uYW1lID09IG51bGwpID8gIiIgOiB0aGlzLm5hbWUudHJpbSgpOworCQl0aGlzLnVzZXJuYW1lID0gKHRoaXMudXNlcm5hbWUgPT0gbnVsbCkgPyAiIiA6IHRoaXMudX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AwNjQ0CmluZGV4IDAwMDAwMDAuLjBhMjM3ODYKLS0tIC9kZXYvbnVsbAorKysgYi9lY29tcC1wb3J0YWwtQkUvc3JjL21haW4vamF2YS9vcmcvb3BlbmVjb21wL3BvcnRhbGFwcC9wb3J0YWwvdHJhbnNwb3J0L09uYm9hcmRpbmdXaWRnZXQuamF2YQpAQCAtMCwwICsxLDY1IEBACisvKi0KKyAqID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisgKiBlQ09NUCBQb3J0YWwKKyAqID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisgKiBDb3B5cmlnaHQgKEMpIDIwMTcgQVQmVCBJbnRlbGxlY3R1YWwgUHJvcGVydHkKKyAqID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisgKiBMaWNlbnNlZCB1bmRlciB0aGUgQXBhY2hlIExpY2Vuc2UsIFZlcnNpb24gMi4wICh0aGUgIkxpY2Vuc2UiKTsKKyAqIHlvdSBtYXkgbm90IHVzZSB0aGlzIGZpbGUgZXhjZXB0IGluIGNvbXBsaWFuY2Ugd2l0aCB0aGUgTGljZW5zZS4KKyAqIFlvdSBtYXkgb2J0YWluIGEgY29weSBvZiB0aGUgTGljZW5zZSBhdAorICogCisgKiAgICAgIGh0dHA6Ly93d3cuYXBhY2hlLm9yZy9saWNlbnNlcy9MSUNFTlNFLTIuMAorICogCisgKiBVbmxlc3MgcmVxdWlyZWQgYnkgYXBwbGljYWJsZSBsYXcgb3IgYWdyZWVkIHRvIGluIHdyaXRpbmcsIHNvZnR3YXJlCisgKiBkaXN0cmlidXRlZCB1bmRlciB0aGUgTGljZW5zZSBpcyBkaXN0cmlidXRlZCBvbiBhbiAiQVMgSVM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phdmEKQEAgLTAsMCArMSw1MyBAQAorLyotCisgKiA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorICogZUNPTVAgUG9ydGFsCisgKiA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorICogQ29weXJpZ2h0IChDKSAyMDE3IEFUJlQgSW50ZWxsZWN0dWFsIFByb3BlcnR5CisgKiA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorICogTGljZW5zZWQgdW5kZXIgdGhlIEFwYWNoZSBMaWNlbnNlLCBWZXJzaW9uIDIuMCAodGhlICJMaWNlbnNlIik7CisgKiB5b3UgbWF5IG5vdCB1c2UgdGhpcyBmaWxlIGV4Y2VwdCBpbiBjb21wbGlhbmNlIHdpdGggdGhlIExpY2Vuc2UuCisgKiBZb3UgbWF5IG9idGFpbiBhIGNvcHkgb2YgdGhlIExpY2Vuc2UgYXQKKyAqIAorICogICAgICBodHRwOi8vd3d3LmFwYWNoZS5vcmcvbGljZW5zZXMvTElDRU5TRS0yLjAKKyAqIAorICogVW5sZXNzIHJlcXVpcmVkIGJ5IGFwcGxpY2FibGUgbGF3IG9yIGFncmVlZCB0byBpbiB3cml0aW5nLCBzb2Z0d2FyZQorICogZGlzdHJpYnV0ZWQgdW5kZXIgdGhlIExpY2Vuc2UgaXMgZGlzdHJpYnV0ZWQgb24gYW4gIkFTIElTIiBCQVNJUywKKyAqIFdJVEhPVVQgV0FSUkFOVElFUyBPUiBDT05ESVRJT05TIE9GIEFOWSBLSU5ELCBlaXRoZXIgZXhwcmVzcyBvciBpbXBsaWVkLgorICogU2VlIHRoZSBMaWNlbnNlIGZvciB0aGUgc3BlY2lmaWMgbGFuZ3VhZ2UgZ292ZXJua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MgU3RyaW5nIGZpcnN0TmFtZTsKKwkKKwlAQ29sdW1uKG5hbWUgPSAibGFzdF9uYW1lIikKKwlwdWJsaWMgU3RyaW5nIGxhc3ROYW1lOworCQorfQpkaWZmIC0tZ2l0IGEvZWNvbXAtcG9ydGFsLUJFL3NyYy9tYWluL2phdmEvb3JnL29wZW5lY29tcC9wb3J0YWxhcHAvcG9ydGFsL3RyYW5zcG9ydC9Qb3J0YWxBZG1pblVzZXJSb2xlLmphdmEgYi9lY29tcC1wb3J0YWwtQkUvc3JjL21haW4vamF2YS9vcmcvb3BlbmVjb21wL3BvcnRhbGFwcC9wb3J0YWwvdHJhbnNwb3J0L1BvcnRhbEFkbWluVXNlclJvbGUuamF2YQpuZXcgZmlsZSBtb2RlIDEwMDY0NAppbmRleCAwMDAwMDAwLi4yMzEzNDI5Ci0tLSAvZGV2L251bGwKKysrIGIvZWNvbXAtcG9ydGFsLUJFL3NyYy9tYWluL2phdmEvb3JnL29wZW5lY29tcC9wb3J0YWxhcHAvcG9ydGFsL3RyYW5zcG9ydC9Qb3J0YWxBZG1pblVzZXJSb2xlLmphdmEKQEAgLTAsMCArMSw0OCBAQAorLyotCisgKiA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorICogZUNPTVAgUG9ydGFsCisgKiA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorICogQ29weXJpZ2h0IChDKSAyMDE3IEFUJlQgSW50ZWxsZWN0dWFsIFByb3BlcnR5CisgKiA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorICogTGljZW5zZWQgdW5kZXIgdGhlIEFwYWNoZSBMaWNlbnNlLCBWZXJzaW9uIDIuMCAodGhlICJMaWNlbnNlIik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yB0byBoYW5kbGUgcG9ydGFsIGFkbWlucworICovCitARW50aXR5CitAVGFibGUobmFtZT0iZm5fdXNlcl9yb2xlIikKK3B1YmxpYyBjbGFzcyBQb3J0YWxBZG1pblVzZXJSb2xlIGltcGxlbWVudHMgU2VyaWFsaXphYmxleworCXByaXZhdGUgc3RhdGljIGZpbmFsIGxvbmcgc2VyaWFsVmVyc2lvblVJRCA9IDFMOworCisJQElkCisJQENvbHVtbihuYW1lID0gInVzZXJfaWQiKQorCXB1YmxpYyBMb25nIHVzZXJJZDsKKwkKKwlASWQKKwlAQ29sdW1uKG5hbWUgPSAicm9sZV9pZCIpCisJcHVibGljIExvbmcgcm9sZUlkOworCQorCUBDb2x1bW4obmFtZSA9ICJhcHBfaWQiKQorCXB1YmxpYyBMb25nIGFwcElkOworCQkKK30KZGlmZiAtLWdpdCBhL2Vjb21wLXBvcnRhbC1CRS9zcmMvbWFpbi9qYXZhL29yZy9vcGVuZWNvbXAvcG9ydGFsYXBwL3BvcnRhbC90cmFuc3BvcnQvUmVtb3RlUm9sZS5qYXZhIGIvZWNvbXAtcG9ydGFsLUJFL3NyYy9tYWluL2phdmEvb3JnL29wZW5lY29tcC9wb3J0YWxhcHAvcG9ydGFsL3RyYW5zcG9ydC9SZW1vdGVSb2xlLmphdmEKbmV3IGZpbGUgbW9kZSAxMDA2NDQKaW5kZXggMDAwMDAwMC4uMGU2YzRmZgotLS0gL2Rldi9udWxsCisrKyBiL2Vjb21wLXBvcnRhbC1CRS9zcmMvbWFpbi9qYXZhL29yZy9vcGVuZWNvbXAvcG9ydGFsYXBwL3BvcnRhbC90cmFuc3BvcnQvUmVtb3RlUm9sZS5qYXZhCkBAIC0wLDAgKzEsMjggQEAKKy8qLQorICogPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKyAqIGVDT01QIFBvcnRhbAorICogPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKyAqIENvcHlyaWdodCAoQykgMjAxNyBBVCZUIEludGVsbGVjdHVhbCBQcm9wZXJ0eQorICogPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKyAqIExpY2Vuc2VkIHVuZGVyIHRoZSBBcGFjaGUgTGljZW5zZSwgVmVyc2lvbiAyLjAgKHRoZSAiTGljZW5zZSIpOworICogeW91IG1heSBub3QgdXNlIHRoaXMgZmlsZSBleGNlcHQgaW4gY29tcGxpYW5jZSB3aXRoIHRoZSBMaWNlbnNlLgorICogWW91IG1heSBvYnRhaW4gYSBjb3B5IG9mIHRoZSBMaWNlbnNlIGF0CisgKiAKKyAqICAgICAgaHR0cDovL3d3dy5hcGFjaGUub3JnL2xpY2Vuc2VzL0xJQ0VOU0UtMi4wCisgKiAKKyAqIFVubGVzcyByZXF1aXJlZCBieSBhcHBsaWNhYmxlIGxhdyBvciBhZ3JlZWQgdG8gaW4gd3JpdGluZywgc29mdHdhcmUKKyAqIGRpc3RyaWJ1dGVkIHVuZGVyIHRoZSBMaWNlbnNlIGlzIGRpc3RyaWJ1dGVkIG9uIGFuICJBUyBJUyIgQkFTSVMsCisgKiBXSVRIT1VUIFdBUlJBTlRJRVMgT1IgQ09ORElUSU9OUyBPRiBBTlkgS0lORCwgZWl0aGVyIGV4cHJlc3Mgb3IgaW1wbGllZC4KKyAqIFNlZSB0aGUgTGljZW5zZSBmb3IgdGhlIHNwZWNpZmljIGxhbmd1YWdlIGdvdmVybmluZyBwZXJtaXNzaW9ucyBhbmQKKyAqIGxpbWl0YXRpb25zIHVuZGVyIHRoZSBMaWNlbnNlLgorICogPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKyAqLworcGFja2FnZSBvcmcub3BlbmVjb21wLnBvcnRhbGFwcC5wb3J0YWwudHJhbnNwb3J0OworCitwdWJsaWMgY2xhc3MgUmVtb3RlUm9sZSB7CisKKwlwdWJsaWMgTG9uZyBpZDsKKworCXB1YmxpYyBTdHJpbmcgbmFtZTsKKworfQpkaWZmIC0tZ2l0IGEvZWNvbXAtcG9ydGFsLUJFL3NyYy9tYWluL2phdmEvb3JnL29wZW5lY29tcC9wb3J0YWxhcHAvcG9ydGFsL3RyYW5zcG9ydC9SZW1vdGVVc2VyV2l0aFJvbGVzLmphdmEgYi9lY29tcC1wb3J0YWwtQkUvc3JjL21haW4vamF2YS9vcmcvb3BlbmVjb21wL3BvcnRhbGFwcC9wb3J0YWwvdHJhbnNwb3J0L1JlbW90ZVVzZXJXaXRoUm9sZXMuamF2YQpuZXcgZmlsZSBtb2RlIDEwMDY0NAppbmRleCAwMDAwMDAwLi40ODQ1Njc0Ci0tLSAvZGV2L251bGwKKysrIGIvZWNvbXAtcG9ydGFsLUJFL3NyYy9tYWluL2phdmEvb3JnL29wZW5lY29tcC9wb3J0YWxhcHAvcG9ydGFsL3RyYW5zcG9ydC9SZW1vdGVVc2VyV2l0aFJvbGVzLmphdmEKQEAgLTAsMCArMSw2MyBAQAorLyotCisgKiA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorICogZUNPTVAgUG9ydGFsCisgKiA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorICogQ29weXJpZ2h0IChDKSAyMDE3IEFUJlQgSW50ZWxsZWN0dWFsIFByb3BlcnR5CisgKiA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorICogTGljZW5zZWQgdW5kZXIgdGhlIEFwYWNo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wb3J0YWwtQkUvc3JjL21haW4vamF2YS9vcmcvb3BlbmVjb21wL3BvcnRhbGFwcC9wb3J0YWwvdHJhbnNwb3J0L1JvbGVJbkFwcEZvclVzZXIuamF2YQpuZXcgZmlsZSBtb2RlIDEwMDY0NAppbmRleCAwMDAwMDAwLi5hNzQ2MTRjCi0tLSAvZGV2L251bGwKKysrIGIvZWNvbXAtcG9ydGFsLUJFL3NyYy9tYWluL2phdmEvb3JnL29wZW5lY29tcC9wb3J0YWxhcHAvcG9ydGFsL3RyYW5zcG9ydC9Sb2xlSW5BcHBGb3JVc2VyLmphdmEKQEAgLTAsMCArMSwzOSBAQAorLyotCisgKiA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorICogZUNPTVAgUG9ydGFsCisgKiA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorICogQ29weXJpZ2h0IChDKSAyMDE3IEFUJlQgSW50ZWxsZWN0dWFsIFByb3BlcnR5CisgKiA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorICogTGljZW5zZWQgdW5kZXIgdGhlIEFwYWNoZSBMaWNlbnNlLCBWZXJzaW9uIDIuMCAodGhlICJMaWNlbnNlIik7CisgKiB5b3UgbWF5IG5vdCB1c2UgdGhpcyBmaWxlIGV4Y2VwdCBpbiBjb21wbGlhbmNlIHdpdGggdGhlIExpY2Vuc2UuCisgKiBZb3UgbWF5IG9idGFpbiBhIGNvcHkgb2YgdGhlIExpY2Vuc2UgYXQKKyAqIAorICogICAgICBodHRwOi8vd3d3LmFwYWNoZS5vcmcvbGljZW5zZXMvTElDRU5TRS0yLjAKKyAqIAorICogVW5sZXNzIHJlcXVpcmVkIGJ5IGFwcGxpY2FibGU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WFpbi9qYXZhL29yZy9vcGVuZWNvbXAvcG9ydGFsYXBwL3BvcnRhbC90cmFuc3BvcnQvUm9sZXNJbkFwcEZvclVzZXIuamF2YQpuZXcgZmlsZSBtb2RlIDEwMDY0NAppbmRleCAwMDAwMDAwLi4xYzM4NjJkCi0tLSAvZGV2L251bGwKKysrIGIvZWNvbXAtcG9ydGFsLUJFL3NyYy9tYWluL2phdmEvb3JnL29wZW5lY29tcC9wb3J0YWxhcHAvcG9ydGFsL3RyYW5zcG9ydC9Sb2xlc0luQXBwRm9yVXNlci5qYXZhCkBAIC0wLDAgKzEsMzMgQEAKKy8qLQorICogPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKyAqIGVDT01QIFBvcnRhbAorICogPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKyAqIENvcHlyaWdodCAoQykgMjAxNyBBVCZUIEludGVsbGVjdHVhbCBQcm9wZXJ0eQorICogPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKyAqIExpY2Vuc2VkIHVuZGVyIHRoZSBBcGFjaGUgTGljZW5zZSwgVmVyc2lvbiAyLjAgKHRoZSAiTGljZW5zZSIpOworICogeW91IG1heSBub3QgdXNlIHRoaXMgZmlsZSBleGNlcHQgaW4gY29tcGxpYW5jZSB3aXRoIHRoZSBMaWNlbnNlLgorICogWW91IG1heSBvYnRhaW4gYSBjb3B5IG9mIHRoZSBMaWNlbnNlIGF0CisgKiAKKyAqICAgICAgaHR0cDovL3d3dy5hcGFjaGUub3JnL2xpY2Vuc2VzL0xJQ0VOU0UtMi4wCisgKiAKKyAqIFVubGVzcyByZXF1aXJlZCBieSBhcHBsaWNhYmxlIGxhdyBvciBhZ3JlZW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cnQvVXNlckFwcGxpY2F0aW9uUm9sZXMuamF2YQpuZXcgZmlsZSBtb2RlIDEwMDY0NAppbmRleCAwMDAwMDAwLi5mOWZkNDEzCi0tLSAvZGV2L251bGwKKysrIGIvZWNvbXAtcG9ydGFsLUJFL3NyYy9tYWluL2phdmEvb3JnL29wZW5lY29tcC9wb3J0YWxhcHAvcG9ydGFsL3RyYW5zcG9ydC9Vc2VyQXBwbGljYXRpb25Sb2xlcy5qYXZhCkBAIC0wLDAgKzEsNDEgQEAKKy8qLQorICogPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKyAqIGVDT01QIFBvcnRhbAorICogPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKyAqIENvcHlyaWdodCAoQykgMjAxNyBBVCZUIEludGVsbGVjdHVhbCBQcm9wZXJ0eQorICogPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKyAqIExpY2Vuc2VkIHVuZGVyIHRoZSBBcGFjaGUgTGljZW5zZSwgVmVyc2lvbiAyLjAgKHRoZSAiTGljZW5zZSIpOworICogeW91IG1heSBub3QgdXNlIHRoaXMgZmlsZSBleGNlcHQgaW4gY29tcGxpYW5jZSB3aXRoIHRoZSBMaWNlbnNlLgorICogWW91IG1heSBvYnRhaW4gYSBjb3B5IG9mIHRoZSBMaWNlbnNlIGF0CisgKiAKKyAqICAgICAgaHR0cDovL3d3dy5hcGFjaGUub3JnL2xpY2Vuc2VzL0xJQ0VOU0UtMi4wCisgKiAKKyAqIFVubGVzcyByZXF1aXJlZCBieSBhcHBsaWNhYmxlIGxhdyBvciBhZ3JlZWQgdG8gaW4gd3JpdGluZywgc29mdHdhcmUKKyAqIGRpc3RyaWJ1dGVk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GhOYW1lU3VybmFtZVRpdGxlLmphdmEgYi9lY29tcC1wb3J0YWwtQkUvc3JjL21haW4vamF2YS9vcmcvb3BlbmVjb21wL3BvcnRhbGFwcC9wb3J0YWwvdHJhbnNwb3J0L1VzZXJXaXRoTmFtZVN1cm5hbWVUaXRsZS5qYXZhCm5ldyBmaWxlIG1vZGUgMTAwNjQ0CmluZGV4IDAwMDAwMDAuLjZjNmNjNDEKLS0tIC9kZXYvbnVsbAorKysgYi9lY29tcC1wb3J0YWwtQkUvc3JjL21haW4vamF2YS9vcmcvb3BlbmVjb21wL3BvcnRhbGFwcC9wb3J0YWwvdHJhbnNwb3J0L1VzZXJXaXRoTmFtZVN1cm5hbWVUaXRsZS5qYXZhCkBAIC0wLDAgKzEsMzkgQEAKKy8qLQorICogPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKyAqIGVDT01QIFBvcnRhbAorICogPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKyAqIENvcHlyaWdodCAoQykgMjAxNyBBVCZUIEludGVsbGVjdHVhbCBQcm9wZXJ0eQorICogPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKyAqIExpY2Vuc2VkIHVuZGVyIHRoZSBBcGFjaGUgTGljZW5zZSwgVmVyc2lvbiAyLjAgKHRoZSAiTGljZW5zZSIpOworICogeW91IG1heSBub3QgdXNlIHRoaXMgZmlsZSBleGNlcHQgaW4gY29tcGxpYW5jZSB3aXRoIHRoZSBMaWNlbnNlLgorICogWW91IG1heSBvYnRhaW4gYSBjb3B5IG9mIHRoZSBMaWNlbnNlIGF0CisgKiAKKyAqICAgICAgaHR0cDovL3d3dy5hcGFjaGUub3JnL2xpY2Vuc2VzL0x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dE5hbWUgPSBsYXN0TmFtZTsKKwkJdGhpcy5qb2JUaXRsZSA9IGpvYlRpdGxlOworCX0KKworfQpkaWZmIC0tZ2l0IGEvZWNvbXAtcG9ydGFsLUJFL3NyYy9tYWluL2phdmEvb3JnL29wZW5lY29tcC9wb3J0YWxhcHAvcG9ydGFsL3VlYi9FUFVlYkhlbHBlci5qYXZhIGIvZWNvbXAtcG9ydGFsLUJFL3NyYy9tYWluL2phdmEvb3JnL29wZW5lY29tcC9wb3J0YWxhcHAvcG9ydGFsL3VlYi9FUFVlYkhlbHBlci5qYXZhCm5ldyBmaWxlIG1vZGUgMTAwNjQ0CmluZGV4IDAwMDAwMDAuLjI1NzY2OTkKLS0tIC9kZXYvbnVsbAorKysgYi9lY29tcC1wb3J0YWwtQkUvc3JjL21haW4vamF2YS9vcmcvb3BlbmVjb21wL3BvcnRhbGFwcC9wb3J0YWwvdWViL0VQVWViSGVscGVyLmphdmEKQEAgLTAsMCArMSwyMTggQEAKKy8qLQorICogPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKyAqIGVDT01QIFBvcnRhbAorICogPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKyAqIENvcHlyaWdodCAoQykgMjAxNyBBVCZUIEludGVsbGVjdHVhbCBQcm9wZXJ0eQorICogPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKyAqIExpY2Vuc2VkIHVuZGVyIHRoZSBBcGFjaGUgTGljZW5zZSwgVmVyc2lvbiAyLjAgKHRoZSAiTGljZW5zZSIpOworICogeW91IG1heSBub3QgdXNlIHRoaXMgZmlsZSBleGNlcHQgaW4gY29tcGxpYW5jZSB3aXRoIHRoZSBMaWNlbnNlLgorICog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MvbWFpbi9qYXZhL29yZy9vcGVuZWNvbXAvcG9ydGFsYXBwL3BvcnRhbC91ZWIvRVBVZWJNc2dUeXBlcy5qYXZhCkBAIC0wLDAgKzEsMjcgQEAKKy8qLQorICogPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKyAqIGVDT01QIFBvcnRhbAorICogPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKyAqIENvcHlyaWdodCAoQykgMjAxNyBBVCZUIEludGVsbGVjdHVhbCBQcm9wZXJ0eQorICogPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKyAqIExpY2Vuc2VkIHVuZGVyIHRoZSBBcGFjaGUgTGljZW5zZSwgVmVyc2lvbiAyLjAgKHRoZSAiTGljZW5zZSIpOworICogeW91IG1heSBub3QgdXNlIHRoaXMgZmlsZSBleGNlcHQgaW4gY29tcGxpYW5jZSB3aXRoIHRoZSBMaWNlbnNlLgorICogWW91IG1heSBvYnRhaW4gYSBjb3B5IG9mIHRoZSBMaWNlbnNlIGF0CisgKiAKKyAqICAgICAgaHR0cDovL3d3dy5hcGFjaGUub3JnL2xpY2Vuc2VzL0xJQ0VOU0UtMi4wCisgKiAKKyAqIFVubGVzcyByZXF1aXJlZCBieSBhcHBsaWNhYmxlIGxhdyBvciBhZ3JlZWQgdG8gaW4gd3JpdGluZywgc29mdHdhcmUKKyAqIGRpc3RyaWJ1dGVkIHVuZGVyIHRoZSBMaWNlbnNlIGlzIGRpc3RyaWJ1dGVkIG9uIGFuICJBUyBJUyIgQkFTSVMsCisgKiBXSVRIT1VUIFdBUlJBTlRJRVMgT1IgQ09ORElUSU9OUyBPRiBBTlkgS0lORCwgZWl0aGVyIGV4cHJlc3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Sw2MCBAQAorLyotCisgKiA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorICogZUNPTVAgUG9ydGFsCisgKiA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorICogQ29weXJpZ2h0IChDKSAyMDE3IEFUJlQgSW50ZWxsZWN0dWFsIFByb3BlcnR5CisgKiA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorICogTGljZW5zZWQgdW5kZXIgdGhlIEFwYWNoZSBMaWNlbnNlLCBWZXJzaW9uIDIuMCAodGhlICJMaWNlbnNlIik7CisgKiB5b3UgbWF5IG5vdCB1c2UgdGhpcyBmaWxlIGV4Y2VwdCBpbiBjb21wbGlhbmNlIHdpdGggdGhlIExpY2Vuc2UuCisgKiBZb3UgbWF5IG9idGFpbiBhIGNvcHkgb2YgdGhlIExpY2Vuc2UgYXQKKyAqIAorICogICAgICBodHRwOi8vd3d3LmFwYWNoZS5vcmcvbGljZW5zZXMvTElDRU5TRS0yLjAKKyAqIAorICogVW5sZXNzIHJlcXVpcmVkIGJ5IGFwcGxpY2FibGUgbGF3IG9yIGFncmVlZCB0byBpbiB3cml0aW5nLCBzb2Z0d2FyZQorICogZGlzdHJpYnV0ZWQgdW5kZXIgdGhlIExpY2Vuc2UgaXMgZGlzdHJpYnV0ZWQgb24gYW4gIkFTIElTIiBCQVNJUywKKyAqIFdJVEhPVVQgV0FSUkFOVElFUyBPUiBDT05ESVRJT05TIE9GIEFOWSBLSU5ELCBlaXRoZXIgZXhwcmVzcyBvciBpbXBsaWVkLgorICogU2VlIHRoZSBMaWNlbnNlIGZvciB0aGUgc3BlY2lmaWMgbGFuZ3VhZ2UgZ292ZXJuaW5nIHBlcm1pc3Npb25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b3JnL29wZW5lY29tcC9wb3J0YWxhcHAvcG9ydGFsL3V0aWxzL0VQU3lzdGVtUHJvcGVydGllcy5qYXZhCm5ldyBmaWxlIG1vZGUgMTAwNjQ0CmluZGV4IDAwMDAwMDAuLjU3ZWI5MjEKLS0tIC9kZXYvbnVsbAorKysgYi9lY29tcC1wb3J0YWwtQkUvc3JjL21haW4vamF2YS9vcmcvb3BlbmVjb21wL3BvcnRhbGFwcC9wb3J0YWwvdXRpbHMvRVBTeXN0ZW1Qcm9wZXJ0aWVzLmphdmEKQEAgLTAsMCArMSw3NyBAQAorLyotCisgKiA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorICogZUNPTVAgUG9ydGFsCisgKiA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorICogQ29weXJpZ2h0IChDKSAyMDE3IEFUJlQgSW50ZWxsZWN0dWFsIFByb3BlcnR5CisgKiA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorICogTGljZW5zZWQgdW5kZXIgdGhlIEFwYWNoZSBMaWNlbnNlLCBWZXJzaW9uIDIuMCAodGhlICJMaWNlbnNlIik7CisgKiB5b3UgbWF5IG5vdCB1c2UgdGhpcyBmaWxlIGV4Y2VwdCBpbiBjb21wbGlhbmNlIHdpdGggdGhlIExpY2Vuc2UuCisgKiBZb3UgbWF5IG9idGFpbiBhIGNvcHkgb2YgdGhlIExpY2Vuc2UgYXQKKyAqIAorICogICAgICBodHRwOi8vd3d3LmFwYWNoZS5vcmcvbGljZW5zZXMvTElDRU5TRS0yLjAKKyAqIAorICogVW5sZXNzIHJlcXVpcmVkIGJ5IGFwcGxpY2FibGUgbGF3IG9yIGFncmVlZCB0byBpbiB3cml0a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CisgKiA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorICogQ29weXJpZ2h0IChDKSAyMDE3IEFUJlQgSW50ZWxsZWN0dWFsIFByb3BlcnR5CisgKiA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorICogTGljZW5zZWQgdW5kZXIgdGhlIEFwYWNoZSBMaWNlbnNlLCBWZXJzaW9uIDIuMCAodGhlICJMaWNlbnNlIik7CisgKiB5b3UgbWF5IG5vdCB1c2UgdGhpcyBmaWxlIGV4Y2VwdCBpbiBjb21wbGlhbmNlIHdpdGggdGhlIExpY2Vuc2UuCisgKiBZb3UgbWF5IG9idGFpbiBhIGNvcHkgb2YgdGhlIExpY2Vuc2UgYXQKKyAqIAorICogICAgICBodHRwOi8vd3d3LmFwYWNoZS5vcmcvbGljZW5zZXMvTElDRU5TRS0yLjAKKyAqIAorICogVW5sZXNzIHJlcXVpcmVkIGJ5IGFwcGxpY2FibGUgbGF3IG9yIGFncmVlZCB0byBpbiB3cml0aW5nLCBzb2Z0d2FyZQorICogZGlzdHJpYnV0ZWQgdW5kZXIgdGhlIExpY2Vuc2UgaXMgZGlzdHJpYnV0ZWQgb24gYW4gIkFTIElTIiBCQVNJUywKKyAqIFdJVEhPVVQgV0FSUkFOVElFUyBPUiBDT05ESVRJT05TIE9GIEFOWSBLSU5ELCBlaXRoZXIgZXhwcmVzcyBvciBpbXBsaWVkLgorICogU2VlIHRoZSBMaWNlbnNlIGZvciB0aGUgc3BlY2lmaWMgbGFuZ3VhZ2UgZ292ZXJuaW5nIHBlcm1pc3Npb25zIGFuZAorICogbGltaXRhdGlvbnMgdW5kZXIgdGhlIExpY2Vuc2UuCisgKiA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09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5lY29tcC9wb3J0YWxhcHAvcG9ydGFsL3V0aWxzL0Vjb21wVmVyc2lvbi5qYXZhCkBAIC0wLDAgKzEsMzMgQEAKKy8qLQorICogPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKyAqIGVDT01QIFBvcnRhbAorICogPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKyAqIENvcHlyaWdodCAoQykgMjAxNyBBVCZUIEludGVsbGVjdHVhbCBQcm9wZXJ0eQorICogPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKyAqIExpY2Vuc2VkIHVuZGVyIHRoZSBBcGFjaGUgTGljZW5zZSwgVmVyc2lvbiAyLjAgKHRoZSAiTGljZW5zZSIpOworICogeW91IG1heSBub3QgdXNlIHRoaXMgZmlsZSBleGNlcHQgaW4gY29tcGxpYW5jZSB3aXRoIHRoZSBMaWNlbnNlLgorICogWW91IG1heSBvYnRhaW4gYSBjb3B5IG9mIHRoZSBMaWNlbnNlIGF0CisgKiAKKyAqICAgICAgaHR0cDovL3d3dy5hcGFjaGUub3JnL2xpY2Vuc2VzL0xJQ0VOU0UtMi4wCisgKiAKKyAqIFVubGVzcyByZXF1aXJlZCBieSBhcHBsaWNhYmxlIGxhdyBvciBhZ3JlZWQgdG8gaW4gd3JpdGluZywgc29mdHdhcmUKKyAqIGRpc3RyaWJ1dGVkIHVuZGVyIHRoZSBMaWNlbnNlIGlzIGRpc3RyaWJ1dGVkIG9uIGFuICJBUyBJUyIgQkFTSVMsCisgKiBXSVRIT1VUIFdBUlJBTlRJRVMgT1IgQ09ORElUSU9OUyBPRiBBTlkgS0lORCwgZWl0aGVyIGV4cHJlc3Mgb3IgaW1wbGllZC4KKyAqIFN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J0YWwtQkUvc3JjL21haW4vamF2YS9vcmcvb3BlbmVjb21wL3BvcnRhbGFwcC9wb3J0YWwvdXRpbHMvSGFzaE1hcEZyb21MaXN0LmphdmEKbmV3IGZpbGUgbW9kZSAxMDA2NDQKaW5kZXggMDAwMDAwMC4uYzlhNTUzMgotLS0gL2Rldi9udWxsCisrKyBiL2Vjb21wLXBvcnRhbC1CRS9zcmMvbWFpbi9qYXZhL29yZy9vcGVuZWNvbXAvcG9ydGFsYXBwL3BvcnRhbC91dGlscy9IYXNoTWFwRnJvbUxpc3QuamF2YQpAQCAtMCwwICsxLDEwMCBAQAorLyotCisgKiA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorICogZUNPTVAgUG9ydGFsCisgKiA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorICogQ29weXJpZ2h0IChDKSAyMDE3IEFUJlQgSW50ZWxsZWN0dWFsIFByb3BlcnR5CisgKiA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorICogTGljZW5zZWQgdW5kZXIgdGhlIEFwYWNoZSBMaWNlbnNlLCBWZXJzaW9uIDIuMCAodGhlICJMaWNlbnNlIik7CisgKiB5b3UgbWF5IG5vdCB1c2UgdGhpcyBmaWxlIGV4Y2VwdCBpbiBjb21wbGlhbmNlIHdpdGggdGhlIExpY2Vuc2UuCisgKiBZb3UgbWF5IG9idGFpbiBhIGNvcHkgb2YgdGhlIExpY2Vuc2UgYXQKKyAqIAorICogICAgICBodHRwOi8vd3d3LmFwYWNoZS5vcmcvbGljZW5zZXMvTElDRU5TRS0yLjAKKyAqIAorICogVW5sZXNzIHJlcXVpcmVkIGJ5IGFwcGxpY2FibGUgbGF3IG9yIGFncmV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09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisgKiBDb3B5cmlnaHQgKEMpIDIwMTcgQVQmVCBJbnRlbGxlY3R1YWwgUHJvcGVydHkKKyAqID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisgKiBMaWNlbnNlZCB1bmRlciB0aGUgQXBhY2hlIExpY2Vuc2UsIFZlcnNpb24gMi4wICh0aGUgIkxpY2Vuc2UiKTsKKyAqIHlvdSBtYXkgbm90IHVzZSB0aGlzIGZpbGUgZXhjZXB0IGluIGNvbXBsaWFuY2Ugd2l0aCB0aGUgTGljZW5zZS4KKyAqIFlvdSBtYXkgb2J0YWluIGEgY29weSBvZiB0aGUgTGljZW5zZSBhdAorICogCisgKiAgICAgIGh0dHA6Ly93d3cuYXBhY2hlLm9yZy9saWNlbnNlcy9MSUNFTlNFLTIuMAorICogCisgKiBVbmxlc3MgcmVxdWlyZWQgYnkgYXBwbGljYWJsZSBsYXcgb3IgYWdyZWVkIHRvIGluIHdyaXRpbmcsIHNvZnR3YXJlCisgKiBkaXN0cmlidXRlZCB1bmRlciB0aGUgTGljZW5zZSBpcyBkaXN0cmlidXRlZCBvbiBhbiAiQVMgSVMiIEJBU0lTLAorICogV0lUSE9VVCBXQVJSQU5USUVTIE9SIENPTkRJVElPTlMgT0YgQU5ZIEtJTkQsIGVpdGhlciBleHByZXNzIG9yIGltcGxpZWQuCisgKiBTZWUgdGhlIExpY2Vuc2UgZm9yIHRoZSBzcGVjaWZpYyBsYW5ndWFnZSBnb3Zlcm5pbmcgcGVybWlzc2lvbnMgYW5kCisgKiBsaW1pdGF0aW9ucyB1bmRlciB0aGUgTGljZW5zZS4KKyAqID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisgKi8KK3BhY2thZ2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cnkoKSArICIgIiArIFJ1bnRpbWUuZ2V0UnVudGltZSgpLm1heE1lbW9yeSgpKSk7CisKKwl9CisKK30KZGlmZiAtLWdpdCBhL2Vjb21wLXBvcnRhbC1CRS9zcmMvbWFpbi9qYXZhL29yZy9vcGVuZWNvbXAvcG9ydGFsYXBwL3NjaGVkdWxlci9Mb2dSZWdpc3RyeS5qYXZhIGIvZWNvbXAtcG9ydGFsLUJFL3NyYy9tYWluL2phdmEvb3JnL29wZW5lY29tcC9wb3J0YWxhcHAvc2NoZWR1bGVyL0xvZ1JlZ2lzdHJ5LmphdmEKbmV3IGZpbGUgbW9kZSAxMDA2NDQKaW5kZXggMDAwMDAwMC4uOWIzNGM4NwotLS0gL2Rldi9udWxsCisrKyBiL2Vjb21wLXBvcnRhbC1CRS9zcmMvbWFpbi9qYXZhL29yZy9vcGVuZWNvbXAvcG9ydGFsYXBwL3NjaGVkdWxlci9Mb2dSZWdpc3RyeS5qYXZhCkBAIC0wLDAgKzEsNTcgQEAKKy8qLQorICogPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKyAqIGVDT01QIFBvcnRhbAorICogPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKyAqIENvcHlyaWdodCAoQykgMjAxNyBBVCZUIEludGVsbGVjdHVhbCBQcm9wZXJ0eQorICogPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKyAqIExpY2Vuc2VkIHVuZGVyIHRoZSBBcGFjaGUgTGljZW5zZSwgVmVyc2lvbiAyLjAgKHRoZSAiTGljZW5zZSIpOworICogeW91IG1heSBub3QgdXNlIHRoaXMgZmlsZSBleGNlcHQgaW4gY29tcGxpYW5jZSB3aXRoIHRoZSBMaW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uIGNyb25UcmlnZ2VyRmFjdG9yeUJlYW4oKSB0aHJvd3MgUGFyc2VFeGNlcHRpb24geworCQkvLyAiMCAqICogKiAqID8gKgorCQlyZXR1cm4gY3JvblRyaWdnZXJGYWN0b3J5QmVhbihncm91cE5hbWUsIHRyaWdnZXJOYW1lLCBTeXN0ZW1Qcm9wZXJ0aWVzLmdldFByb3BlcnR5KFN5c3RlbVByb3BlcnRpZXMuTE9HX0NST04pKTsKKwl9CisKK30KZGlmZiAtLWdpdCBhL2Vjb21wLXBvcnRhbC1CRS9zcmMvbWFpbi9qYXZhL29yZy9vcGVuZWNvbXAvcG9ydGFsYXBwL3NjaGVkdWxlci9SZWdpc3Rlci5qYXZhIGIvZWNvbXAtcG9ydGFsLUJFL3NyYy9tYWluL2phdmEvb3JnL29wZW5lY29tcC9wb3J0YWxhcHAvc2NoZWR1bGVyL1JlZ2lzdGVyLmphdmEKbmV3IGZpbGUgbW9kZSAxMDA2NDQKaW5kZXggMDAwMDAwMC4uYzA5NzIxYwotLS0gL2Rldi9udWxsCisrKyBiL2Vjb21wLXBvcnRhbC1CRS9zcmMvbWFpbi9qYXZhL29yZy9vcGVuZWNvbXAvcG9ydGFsYXBwL3NjaGVkdWxlci9SZWdpc3Rlci5qYXZhCkBAIC0wLDAgKzEsODYgQEAKKy8qLQorICogPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKyAqIGVDT01QIFBvcnRhbAorICogPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKyAqIENvcHlyaWdodCAoQykgMjAxNyBBVCZUIEludGVsbGVjdHVhbCBQcm9wZXJ0eQorICogPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKyAqIExpY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XIuamF2YQpAQCAtMCwwICsxLDEwMCBAQAorLyotCisgKiA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorICogZUNPTVAgUG9ydGFsCisgKiA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorICogQ29weXJpZ2h0IChDKSAyMDE3IEFUJlQgSW50ZWxsZWN0dWFsIFByb3BlcnR5CisgKiA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorICogTGljZW5zZWQgdW5kZXIgdGhlIEFwYWNoZSBMaWNlbnNlLCBWZXJzaW9uIDIuMCAodGhlICJMaWNlbnNlIik7CisgKiB5b3UgbWF5IG5vdCB1c2UgdGhpcyBmaWxlIGV4Y2VwdCBpbiBjb21wbGlhbmNlIHdpdGggdGhlIExpY2Vuc2UuCisgKiBZb3UgbWF5IG9idGFpbiBhIGNvcHkgb2YgdGhlIExpY2Vuc2UgYXQKKyAqIAorICogICAgICBodHRwOi8vd3d3LmFwYWNoZS5vcmcvbGljZW5zZXMvTElDRU5TRS0yLjAKKyAqIAorICogVW5sZXNzIHJlcXVpcmVkIGJ5IGFwcGxpY2FibGUgbGF3IG9yIGFncmVlZCB0byBpbiB3cml0aW5nLCBzb2Z0d2FyZQorICogZGlzdHJpYnV0ZWQgdW5kZXIgdGhlIExpY2Vuc2UgaXMgZGlzdHJpYnV0ZWQgb24gYW4gIkFTIElTIiBCQVNJUywKKyAqIFdJVEhPVVQgV0FSUkFOVElFUyBPUiBDT05ESVRJT05TIE9GIEFOWSBLSU5ELCBlaXRoZXIgZXhwcmVzcyBvciBpbXBsaWVkLgorICogU2VlIHRoZSBMaWNlbnNlIGZvciB0aGUgc3BlY2lmaWMgbGFuZ3VhZ2UgZ292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qYXZhCm5ldyBmaWxlIG1vZGUgMTAwNjQ0CmluZGV4IDAwMDAwMDAuLjE3N2I0MjkKLS0tIC9kZXYvbnVsbAorKysgYi9lY29tcC1wb3J0YWwtQkUvc3JjL21haW4vamF2YS9vcmcvb3BlbmVjb21wL3BvcnRhbGFwcC9zY2hlZHVsZXIvU2Vzc2lvbk1ndFJlZ2lzdHJ5LmphdmEKQEAgLTAsMCArMSw4OSBAQAorLyotCisgKiA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorICogZUNPTVAgUG9ydGFsCisgKiA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorICogQ29weXJpZ2h0IChDKSAyMDE3IEFUJlQgSW50ZWxsZWN0dWFsIFByb3BlcnR5CisgKiA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorICogTGljZW5zZWQgdW5kZXIgdGhlIEFwYWNoZSBMaWNlbnNlLCBWZXJzaW9uIDIuMCAodGhlICJMaWNlbnNlIik7CisgKiB5b3UgbWF5IG5vdCB1c2UgdGhpcyBmaWxlIGV4Y2VwdCBpbiBjb21wbGlhbmNlIHdpdGggdGhlIExpY2Vuc2UuCisgKiBZb3UgbWF5IG9idGFpbiBhIGNvcHkgb2YgdGhlIExpY2Vuc2UgYXQKKyAqIAorICogICAgICBodHRwOi8vd3d3LmFwYWNoZS5vcmcvbGljZW5zZXMvTElDRU5TRS0yLjAKKyAqIAorICogVW5sZXNzIHJlcXVpcmVkIGJ5IGFwcGxpY2FibGUgbGF3IG9yIGFncmVlZCB0byBpbiB3cml0aW5nLCBzb2Z0d2FyZQorICogZGlzdHJpYnV0ZWQgdW5kZXIgdGhlIExpY2Vuc2UgaXMgZGlzdHJpYn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Fpbi9qYXZhL29yZy9vcGVuZWNvbXAvcG9ydGFsYXBwL3NlcnZpY2UvQWRtaW5BdXRoRXh0ZW5zaW9uLmphdmEgYi9lY29tcC1wb3J0YWwtQkUvc3JjL21haW4vamF2YS9vcmcvb3BlbmVjb21wL3BvcnRhbGFwcC9zZXJ2aWNlL0FkbWluQXV0aEV4dGVuc2lvbi5qYXZhCm5ldyBmaWxlIG1vZGUgMTAwNjQ0CmluZGV4IDAwMDAwMDAuLjI0MzIwNjEKLS0tIC9kZXYvbnVsbAorKysgYi9lY29tcC1wb3J0YWwtQkUvc3JjL21haW4vamF2YS9vcmcvb3BlbmVjb21wL3BvcnRhbGFwcC9zZXJ2aWNlL0FkbWluQXV0aEV4dGVuc2lvbi5qYXZhCkBAIC0wLDAgKzEsMzUgQEAKKy8qLQorICogPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKyAqIGVDT01QIFBvcnRhbAorICogPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKyAqIENvcHlyaWdodCAoQykgMjAxNyBBVCZUIEludGVsbGVjdHVhbCBQcm9wZXJ0eQorICogPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKyAqIExpY2Vuc2VkIHVuZGVyIHRoZSBBcGFjaGUgTGljZW5zZSwgVmVyc2lvbiAyLjAgKHRoZSAiTGljZW5zZSIpOworICogeW91IG1heSBub3QgdXNlIHRoaXMgZmlsZSBleGNlcHQgaW4gY29tcGxpYW5jZSB3aXRoIHRoZSBMaWNlbnNlLgorICogWW91IG1heSBvYnRhaW4gYSBjb3B5IG9mIHRoZSBMaWNlbnNlIGF0CisgKiAKKyAqICAgICAgaHR0cDovL3d3dy5hcGFjaGUub3Jn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hlaXIgb3duIGxvZ2ljIGhlcmUsIGxpa2UgdXBkYXRpbmcgYXBwJ3MgcmVsYXRlZCB0YWJsZXMKKwl9CisKK30KZGlmZiAtLWdpdCBhL2Vjb21wLXBvcnRhbC1CRS9zcmMvbWFpbi9qYXZhL29yZy9vcGVuZWNvbXAvcG9ydGFsYXBwL3NlcnZpY2UvRVBQcm9maWxlU2VydmljZS5qYXZhIGIvZWNvbXAtcG9ydGFsLUJFL3NyYy9tYWluL2phdmEvb3JnL29wZW5lY29tcC9wb3J0YWxhcHAvc2VydmljZS9FUFByb2ZpbGVTZXJ2aWNlLmphdmEKbmV3IGZpbGUgbW9kZSAxMDA2NDQKaW5kZXggMDAwMDAwMC4uOTg0MTU2NgotLS0gL2Rldi9udWxsCisrKyBiL2Vjb21wLXBvcnRhbC1CRS9zcmMvbWFpbi9qYXZhL29yZy9vcGVuZWNvbXAvcG9ydGFsYXBwL3NlcnZpY2UvRVBQcm9maWxlU2VydmljZS5qYXZhCkBAIC0wLDAgKzEsMzYgQEAKKy8qLQorICogPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKyAqIGVDT01QIFBvcnRhbAorICogPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKyAqIENvcHlyaWdodCAoQykgMjAxNyBBVCZUIEludGVsbGVjdHVhbCBQcm9wZXJ0eQorICogPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKyAqIExpY2Vuc2VkIHVuZGVyIHRoZSBBcGFjaGUgTGljZW5zZSwgVmVyc2lvbiAyLjAgKHRoZSAiTGljZW5zZSIpOworICogeW91IG1heSBub3QgdXNlIHRoaXMgZmlsZSBleGNlcHQgaW4gY29tcGxpYW5jZSB3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GdldFVzZXIoU3RyaW5nIGlkKTsKKwkKKwl2b2lkIHNhdmVVc2VyKEVQVXNlciB1c2VyKTsKK30KZGlmZiAtLWdpdCBhL2Vjb21wLXBvcnRhbC1CRS9zcmMvbWFpbi9qYXZhL29yZy9vcGVuZWNvbXAvcG9ydGFsYXBwL3NlcnZpY2UvRVBQcm9maWxlU2VydmljZUltcGwuamF2YSBiL2Vjb21wLXBvcnRhbC1CRS9zcmMvbWFpbi9qYXZhL29yZy9vcGVuZWNvbXAvcG9ydGFsYXBwL3NlcnZpY2UvRVBQcm9maWxlU2VydmljZUltcGwuamF2YQpuZXcgZmlsZSBtb2RlIDEwMDY0NAppbmRleCAwMDAwMDAwLi45ZGNjOGRjCi0tLSAvZGV2L251bGwKKysrIGIvZWNvbXAtcG9ydGFsLUJFL3NyYy9tYWluL2phdmEvb3JnL29wZW5lY29tcC9wb3J0YWxhcHAvc2VydmljZS9FUFByb2ZpbGVTZXJ2aWNlSW1wbC5qYXZhCkBAIC0wLDAgKzEsNzYgQEAKKy8qLQorICogPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKyAqIGVDT01QIFBvcnRhbAorICogPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKyAqIENvcHlyaWdodCAoQykgMjAxNyBBVCZUIEludGVsbGVjdHVhbCBQcm9wZXJ0eQorICogPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKyAqIExpY2Vuc2VkIHVuZGVyIHRoZSBBcGFjaGUgTGljZW5zZSwgVmVyc2lvbiAyLjAgKHRoZSAiTGljZW5zZSIpOworICogeW91IG1heSBub3QgdXNlIHRoaXMgZmlsZSBleGNlcHQgaW4gY29tcGxpYW5jZSB3a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nRhbGFwcC9zZXJ2aWNlL3Nlc3Npb25tZ3QvQ29yZVRpbWVvdXRIYW5kbGVyLmphdmEgYi9lY29tcC1wb3J0YWwtQkUvc3JjL21haW4vamF2YS9vcmcvb3BlbmVjb21wL3BvcnRhbGFwcC9zZXJ2aWNlL3Nlc3Npb25tZ3QvQ29yZVRpbWVvdXRIYW5kbGVyLmphdmEKbmV3IGZpbGUgbW9kZSAxMDA2NDQKaW5kZXggMDAwMDAwMC4uZGFjZTU0MwotLS0gL2Rldi9udWxsCisrKyBiL2Vjb21wLXBvcnRhbC1CRS9zcmMvbWFpbi9qYXZhL29yZy9vcGVuZWNvbXAvcG9ydGFsYXBwL3NlcnZpY2Uvc2Vzc2lvbm1ndC9Db3JlVGltZW91dEhhbmRsZXIuamF2YQpAQCAtMCwwICsxLDE2NiBAQAorLyotCisgKiA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorICogZUNPTVAgUG9ydGFsCisgKiA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorICogQ29weXJpZ2h0IChDKSAyMDE3IEFUJlQgSW50ZWxsZWN0dWFsIFByb3BlcnR5CisgKiA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorICogTGljZW5zZWQgdW5kZXIgdGhlIEFwYWNoZSBMaWNlbnNlLCBWZXJzaW9uIDIuMCAodGhlICJMaWNlbnNlIik7CisgKiB5b3UgbWF5IG5vdCB1c2UgdGhpcyBmaWxlIGV4Y2VwdCBpbiBjb21wbGlhbmNlIHdpdGggdGhlIExpY2Vuc2UuCisgKiBZb3UgbWF5IG9idGFpbiBhIGNvcHkgb2YgdGhlIExpY2Vuc2UgYXQKKyAqIAorICogICAgICBodHRwOi8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zcmMvbWFpbi9qYXZhL29yZy9vcGVuZWNvbXAvcG9ydGFsYXBwL3NlcnZpY2Uvc2Vzc2lvbm1ndC9NYW5hZ2VTZXJ2aWNlLmphdmEKbmV3IGZpbGUgbW9kZSAxMDA2NDQKaW5kZXggMDAwMDAwMC4uYTQ4NTE3NgotLS0gL2Rldi9udWxsCisrKyBiL2Vjb21wLXBvcnRhbC1CRS9zcmMvbWFpbi9qYXZhL29yZy9vcGVuZWNvbXAvcG9ydGFsYXBwL3NlcnZpY2Uvc2Vzc2lvbm1ndC9NYW5hZ2VTZXJ2aWNlLmphdmEKQEAgLTAsMCArMSwxMDEgQEAKKy8qLQorICogPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKyAqIGVDT01QIFBvcnRhbAorICogPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKyAqIENvcHlyaWdodCAoQykgMjAxNyBBVCZUIEludGVsbGVjdHVhbCBQcm9wZXJ0eQorICogPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKyAqIExpY2Vuc2VkIHVuZGVyIHRoZSBBcGFjaGUgTGljZW5zZSwgVmVyc2lvbiAyLjAgKHRoZSAiTGljZW5zZSIpOworICogeW91IG1heSBub3QgdXNlIHRoaXMgZmlsZSBleGNlcHQgaW4gY29tcGxpYW5jZSB3aXRoIHRoZSBMaWNlbnNlLgorICogWW91IG1heSBvYnRhaW4gYSBjb3B5IG9mIHRoZSBMaWNlbnNlIGF0CisgKiAKKyAqICAgICAgaHR0cDovL3d3dy5hcGFjaGUub3JnL2xpY2Vuc2VzL0xJQ0VOU0UtMi4wCisgKiAKKyAqIFVubGVzcyByZXF1aXJlZCBieSBhcHBsaWNhYmxlIG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AtMCwwICsxLDQ0IEBACisvKi0KKyAqID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisgKiBlQ09NUCBQb3J0YWwKKyAqID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisgKiBDb3B5cmlnaHQgKEMpIDIwMTcgQVQmVCBJbnRlbGxlY3R1YWwgUHJvcGVydHkKKyAqID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisgKiBMaWNlbnNlZCB1bmRlciB0aGUgQXBhY2hlIExpY2Vuc2UsIFZlcnNpb24gMi4wICh0aGUgIkxpY2Vuc2UiKTsKKyAqIHlvdSBtYXkgbm90IHVzZSB0aGlzIGZpbGUgZXhjZXB0IGluIGNvbXBsaWFuY2Ugd2l0aCB0aGUgTGljZW5zZS4KKyAqIFlvdSBtYXkgb2J0YWluIGEgY29weSBvZiB0aGUgTGljZW5zZSBhdAorICogCisgKiAgICAgIGh0dHA6Ly93d3cuYXBhY2hlLm9yZy9saWNlbnNlcy9MSUNFTlNFLTIuMAorICogCisgKiBVbmxlc3MgcmVxdWlyZWQgYnkgYXBwbGljYWJsZSBsYXcgb3IgYWdyZWVkIHRvIGluIHdyaXRpbmcsIHNvZnR3YXJlCisgKiBkaXN0cmlidXRlZCB1bmRlciB0aGUgTGljZW5zZSBpcyBkaXN0cmlidXRlZCBvbiBhbiAiQVMgSVMiIEJBU0lTLAorICogV0lUSE9VVCBXQVJSQU5USUVTIE9SIENPTkRJVElPTlMgT0YgQU5ZIEtJTkQsIGVpdGhlciBleHByZXNzIG9yIGltcGxpZWQuCisgKiBTZWUgdGhlIExpY2Vuc2UgZm9yIHRoZSBzcGVjaWZpYyBsYW5ndWFnZSBnb3Zlcm5pbmcgcG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JcHVibGljIGJvb2xlYW4gdmVyaWZ5UkVTVENyZWRlbnRpYWwoU3RyaW5nIHNlY3JldEtleSwgU3RyaW5nIHJlcXVlc3RVZWJLZXksIFN0cmluZyByZXF1ZXN0VXNlck5hbWUsCisJCQlTdHJpbmcgcmVxdWVzdFBhc3N3b3JkKSB0aHJvd3MgRXhjZXB0aW9uOworCit9CmRpZmYgLS1naXQgYS9lY29tcC1wb3J0YWwtQkUvc3JjL21haW4vamF2YS9vcmcvb3BlbmVjb21wL3BvcnRhbGFwcC9zZXJ2aWNlL3Nlc3Npb25tZ3QvUmVtb3RlV2ViU2VydmljZUNhbGxTZXJ2aWNlSW1wbC5qYXZhIGIvZWNvbXAtcG9ydGFsLUJFL3NyYy9tYWluL2phdmEvb3JnL29wZW5lY29tcC9wb3J0YWxhcHAvc2VydmljZS9zZXNzaW9ubWd0L1JlbW90ZVdlYlNlcnZpY2VDYWxsU2VydmljZUltcGwuamF2YQpuZXcgZmlsZSBtb2RlIDEwMDY0NAppbmRleCAwMDAwMDAwLi5lMmIyZGQ1Ci0tLSAvZGV2L251bGwKKysrIGIvZWNvbXAtcG9ydGFsLUJFL3NyYy9tYWluL2phdmEvb3JnL29wZW5lY29tcC9wb3J0YWxhcHAvc2VydmljZS9zZXNzaW9ubWd0L1JlbW90ZVdlYlNlcnZpY2VDYWxsU2VydmljZUltcGwuamF2YQpAQCAtMCwwICsxLDgzIEBACisvKi0KKyAqID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisgKiBlQ09NUCBQb3J0YWwKKyAqID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisgKiBDb3B5cmlnaHQgKEMpIDIwMTcgQVQmVCBJbnRlbGxlY3R1YWwgUHJvcGVydHkKKyAqID09PT09PT09PT09PT09PT09PT09PT09PT09PT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aGVyVXRpbC5kZWNyeXB0KCJva1lUYURyaHppYmNiR1ZxNW1qa1ZRPT0iLCAiQUdMRGRHNEQwNEJLbTJJeElXRXI4bz09Iik7CisJCVN5c3RlbS5vdXQucHJpbnQoZGVjcnlwdGVkUHdkKTsKKwl9CisJCit9CmRpZmYgLS1naXQgYS9lY29tcC1wb3J0YWwtQkUvc3JjL21haW4vamF2YS9vcmcvb3BlbmVjb21wL3BvcnRhbGFwcC9zZXJ2aWNlL3Nlc3Npb25tZ3QvU2Vzc2lvbkNvbW11bmljYXRpb24uamF2YSBiL2Vjb21wLXBvcnRhbC1CRS9zcmMvbWFpbi9qYXZhL29yZy9vcGVuZWNvbXAvcG9ydGFsYXBwL3NlcnZpY2Uvc2Vzc2lvbm1ndC9TZXNzaW9uQ29tbXVuaWNhdGlvbi5qYXZhCm5ldyBmaWxlIG1vZGUgMTAwNjQ0CmluZGV4IDAwMDAwMDAuLjU3ZmRkOGEKLS0tIC9kZXYvbnVsbAorKysgYi9lY29tcC1wb3J0YWwtQkUvc3JjL21haW4vamF2YS9vcmcvb3BlbmVjb21wL3BvcnRhbGFwcC9zZXJ2aWNlL3Nlc3Npb25tZ3QvU2Vzc2lvbkNvbW11bmljYXRpb24uamF2YQpAQCAtMCwwICsxLDI3NCBAQAorLyotCisgKiA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorICogZUNPTVAgUG9ydGFsCisgKiA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorICogQ29weXJpZ2h0IChDKSAyMDE3IEFUJlQgSW50ZWxsZWN0dWFsIFByb3BlcnR5CisgKiA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorICogTGljZW5zZWQgdW5k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XBwL3NlcnZpY2Uvc2Vzc2lvbm1ndC9UaW1lb3V0SGFuZGxlci5qYXZhIGIvZWNvbXAtcG9ydGFsLUJFL3NyYy9tYWluL2phdmEvb3JnL29wZW5lY29tcC9wb3J0YWxhcHAvc2VydmljZS9zZXNzaW9ubWd0L1RpbWVvdXRIYW5kbGVyLmphdmEKbmV3IGZpbGUgbW9kZSAxMDA2NDQKaW5kZXggMDAwMDAwMC4uODRkY2YzZgotLS0gL2Rldi9udWxsCisrKyBiL2Vjb21wLXBvcnRhbC1CRS9zcmMvbWFpbi9qYXZhL29yZy9vcGVuZWNvbXAvcG9ydGFsYXBwL3NlcnZpY2Uvc2Vzc2lvbm1ndC9UaW1lb3V0SGFuZGxlci5qYXZhCkBAIC0wLDAgKzEsMjUyIEBACisvKi0KKyAqID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisgKiBlQ09NUCBQb3J0YWwKKyAqID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisgKiBDb3B5cmlnaHQgKEMpIDIwMTcgQVQmVCBJbnRlbGxlY3R1YWwgUHJvcGVydHkKKyAqID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisgKiBMaWNlbnNlZCB1bmRlciB0aGUgQXBhY2hlIExpY2Vuc2UsIFZlcnNpb24gMi4wICh0aGUgIkxpY2Vuc2UiKTsKKyAqIHlvdSBtYXkgbm90IHVzZSB0aGlzIGZpbGUgZXhjZXB0IGluIGNvbXBsaWFuY2Ugd2l0aCB0aGUgTGljZW5zZS4KKyAqIFlvdSBtYXkgb2J0YWluIGEgY29weSBvZiB0aGUgTGljZW5zZSBhdAorICogCisgKiAgICAgIGh0dHA6Ly93d3cuYXBhY2hlLm9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bW11bmljYXRpb24oU2Vzc2lvbkNvbW11bmljYXRpb24gc2Vzc2lvbkNvbW11bmljYXRpb24pIHsKKwkJdGhpcy5zZXNzaW9uQ29tbXVuaWNhdGlvbiA9IHNlc3Npb25Db21tdW5pY2F0aW9uOworCX0KKworfQpkaWZmIC0tZ2l0IGEvZWNvbXAtcG9ydGFsLUJFL3NyYy9tYWluL2phdmEvb3JnL29wZW5lY29tcC9wb3J0YWxhcHAvdWViaGFuZGxlci9GdW5jdGlvbmFsTWVudUhhbmRsZXIuamF2YSBiL2Vjb21wLXBvcnRhbC1CRS9zcmMvbWFpbi9qYXZhL29yZy9vcGVuZWNvbXAvcG9ydGFsYXBwL3VlYmhhbmRsZXIvRnVuY3Rpb25hbE1lbnVIYW5kbGVyLmphdmEKbmV3IGZpbGUgbW9kZSAxMDA2NDQKaW5kZXggMDAwMDAwMC4uYTcyNjY3NAotLS0gL2Rldi9udWxsCisrKyBiL2Vjb21wLXBvcnRhbC1CRS9zcmMvbWFpbi9qYXZhL29yZy9vcGVuZWNvbXAvcG9ydGFsYXBwL3VlYmhhbmRsZXIvRnVuY3Rpb25hbE1lbnVIYW5kbGVyLmphdmEKQEAgLTAsMCArMSwxMjYgQEAKKy8qLQorICogPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKyAqIGVDT01QIFBvcnRhbAorICogPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKyAqIENvcHlyaWdodCAoQykgMjAxNyBBVCZUIEludGVsbGVjdHVhbCBQcm9wZXJ0eQorICogPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKyAqIExpY2Vuc2VkIHVuZGVyIHRoZSBBcGFjaGUgTGljZW5zZSwgVm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21wLXBvcnRhbC1CRS9zcmMvbWFpbi9qYXZhL29yZy9vcGVuZWNvbXAvcG9ydGFsYXBwL3VlYmhhbmRsZXIvTWFpblVlYkhhbmRsZXIuamF2YQpuZXcgZmlsZSBtb2RlIDEwMDY0NAppbmRleCAwMDAwMDAwLi5kZTA4NTQxCi0tLSAvZGV2L251bGwKKysrIGIvZWNvbXAtcG9ydGFsLUJFL3NyYy9tYWluL2phdmEvb3JnL29wZW5lY29tcC9wb3J0YWxhcHAvdWViaGFuZGxlci9NYWluVWViSGFuZGxlci5qYXZhCkBAIC0wLDAgKzEsMTE1IEBACisvKi0KKyAqID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisgKiBlQ09NUCBQb3J0YWwKKyAqID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisgKiBDb3B5cmlnaHQgKEMpIDIwMTcgQVQmVCBJbnRlbGxlY3R1YWwgUHJvcGVydHkKKyAqID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisgKiBMaWNlbnNlZCB1bmRlciB0aGUgQXBhY2hlIExpY2Vuc2UsIFZlcnNpb24gMi4wICh0aGUgIkxpY2Vuc2UiKTsKKyAqIHlvdSBtYXkgbm90IHVzZSB0aGlzIGZpbGUgZXhjZXB0IGluIGNvbXBsaWFuY2Ugd2l0aCB0aGUgTGljZW5zZS4KKyAqIFlvdSBtYXkgb2J0YWluIGEgY29weSBvZiB0aGUgTGljZW5zZSBhdAorICogCisgKiAgICAgIGh0dHA6Ly93d3cuYXBhY2hlLm9yZy9saWNlbnNlcy9MSUNFTlNFLTIuMAorICogCisgKiBVbmxlc3MgcmVxdWlyZWQgYnkgYXBwbGljYWJsZSBsYXcgb3IgYWdy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xlZXAiICsgRWNvbXBQb3J0YWxVdGlscy5nZXRTdGFja1RyYWNlKGUpKTsKKwkJCX0KKwkJfQorCX0KK30KZGlmZiAtLWdpdCBhL2Vjb21wLXBvcnRhbC1CRS9zcmMvbWFpbi9qYXZhL29yZy9vcGVuZWNvbXAvcG9ydGFsYXBwL3VlYmhhbmRsZXIvV2lkZ2V0Tm90aWZpY2F0aW9uSGFuZGxlci5qYXZhIGIvZWNvbXAtcG9ydGFsLUJFL3NyYy9tYWluL2phdmEvb3JnL29wZW5lY29tcC9wb3J0YWxhcHAvdWViaGFuZGxlci9XaWRnZXROb3RpZmljYXRpb25IYW5kbGVyLmphdmEKbmV3IGZpbGUgbW9kZSAxMDA2NDQKaW5kZXggMDAwMDAwMC4uYTA2NmIxMgotLS0gL2Rldi9udWxsCisrKyBiL2Vjb21wLXBvcnRhbC1CRS9zcmMvbWFpbi9qYXZhL29yZy9vcGVuZWNvbXAvcG9ydGFsYXBwL3VlYmhhbmRsZXIvV2lkZ2V0Tm90aWZpY2F0aW9uSGFuZGxlci5qYXZhCkBAIC0wLDAgKzEsOTMgQEAKKy8qLQorICogPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKyAqIGVDT01QIFBvcnRhbAorICogPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKyAqIENvcHlyaWdodCAoQykgMjAxNyBBVCZUIEludGVsbGVjdHVhbCBQcm9wZXJ0eQorICogPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKyAqIExpY2Vuc2VkIHVuZGVyIHRoZSBBcGFjaGUgTGljZW5zZSwgVmVyc2lvbiAyLjAgKHRoZSAiTGljZW5zZSIpOworICogeW91IG1heSBub3QgdXNl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09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisgKiBlQ09NUCBQb3J0YWwKKyAqID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisgKiBDb3B5cmlnaHQgKEMpIDIwMTcgQVQmVCBJbnRlbGxlY3R1YWwgUHJvcGVydHkKKyAqID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisgKiBMaWNlbnNlZCB1bmRlciB0aGUgQXBhY2hlIExpY2Vuc2UsIFZlcnNpb24gMi4wICh0aGUgIkxpY2Vuc2UiKTsKKyAqIHlvdSBtYXkgbm90IHVzZSB0aGlzIGZpbGUgZXhjZXB0IGluIGNvbXBsaWFuY2Ugd2l0aCB0aGUgTGljZW5zZS4KKyAqIFlvdSBtYXkgb2J0YWluIGEgY29weSBvZiB0aGUgTGljZW5zZSBhdAorICogCisgKiAgICAgIGh0dHA6Ly93d3cuYXBhY2hlLm9yZy9saWNlbnNlcy9MSUNFTlNFLTIuMAorICogCisgKiBVbmxlc3MgcmVxdWlyZWQgYnkgYXBwbGljYWJsZSBsYXcgb3IgYWdyZWVkIHRvIGluIHdyaXRpbmcsIHNvZnR3YXJlCisgKiBkaXN0cmlidXRlZCB1bmRlciB0aGUgTGljZW5zZSBpcyBkaXN0cmlidXRlZCBvbiBhbiAiQVMgSVMiIEJBU0lTLAorICogV0lUSE9VVCBXQVJSQU5USUVTIE9SIENPTkRJVElPTlMgT0YgQU5ZIEtJTkQsIGVpdGhlciBleHByZXNzIG9yIGltcGxpZWQuCisgKiBTZWUgdGhlIExpY2Vuc2UgZm9yIHRoZSBzcGVjaWZpYyBsYW5ndWFnZSBnb3Zlcm5pbmcgcGVybWlzc2lvbnMgYW5kCisgKiBsaW1pdGF0aW9ucy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hPSBudWxsKSB7CisJCQlTdHJpbmdCdWZmZXIgcmVxdWVzdFVSTCA9IHJlcXVlc3QuZ2V0UmVxdWVzdFVSTCgpOworCQkJU3RyaW5nIHF1ZXJ5U3RyaW5nID0gcmVxdWVzdC5nZXRRdWVyeVN0cmluZygpOworCisJCQlpZiAocXVlcnlTdHJpbmcgPT0gbnVsbCkgeworCQkJCXJldHVybiByZXF1ZXN0VVJMLnRvU3RyaW5nKCk7CisJCQl9IGVsc2UgeworCQkJCXJldHVybiByZXF1ZXN0VVJMLmFwcGVuZCgnPycpLmFwcGVuZChxdWVyeVN0cmluZykudG9TdHJpbmcoKTsKKwkJCX0KKwkJfQorCQlyZXR1cm4gIiI7CisJfQorfQpkaWZmIC0tZ2l0IGEvZWNvbXAtcG9ydGFsLUJFL3NyYy9tYWluL2phdmEvb3JnL29wZW5lY29tcC9wb3J0YWxhcHAvdXRpbC9TZXNzaW9uQ29va2llVXRpbC5qYXZhIGIvZWNvbXAtcG9ydGFsLUJFL3NyYy9tYWluL2phdmEvb3JnL29wZW5lY29tcC9wb3J0YWxhcHAvdXRpbC9TZXNzaW9uQ29va2llVXRpbC5qYXZhCm5ldyBmaWxlIG1vZGUgMTAwNjQ0CmluZGV4IDAwMDAwMDAuLjY5ZmM5YjIKLS0tIC9kZXYvbnVsbAorKysgYi9lY29tcC1wb3J0YWwtQkUvc3JjL21haW4vamF2YS9vcmcvb3BlbmVjb21wL3BvcnRhbGFwcC91dGlsL1Nlc3Npb25Db29raWVVdGlsLmphdmEKQEAgLTAsMCArMSwxMjkgQEAKKy8qLQorICogPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKyAqIGVDT01QIFBvcnRhbAorICogPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKyAqIENvcHlyaWdodCAoQykgMjAxNyBBVCZUIEludGVsbGVjdHVhbCBQcm9wZXJ0eQorICogPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKyAqIExpY2Vuc2VkIHVuZGVyIHRoZSBBcGFjaGUgTGljZW5zZSwgVmVyc2lvbiAyLjAgKHRoZSAiTGljZW5zZSIpOworICogeW91IG1heSBub3QgdXNlIHRoaXMgZmlsZSBleGNlcHQgaW4gY29tcGxpYW5jZSB3aXRoIHRoZSBMaWNlbnNlLgorICogWW91IG1heSBvYnRhaW4gYSBjb3B5IG9mIHRoZSBMaWNlbnNlIGF0CisgKiAKKyAqICAgICAgaHR0cDovL3d3dy5hcGFjaGUub3JnL2xpY2Vuc2VzL0xJQ0VOU0UtMi4wCisgKiAKKyAqIFVubGVzcyByZXF1aXJlZCBieSBhcHBsaWNhYmxlIGxhdyBvciBhZ3JlZWQgdG8gaW4gd3JpdGluZywgc29mdHdhcmUKKyAqIGRpc3RyaWJ1dGVkIHVuZGVyIHRoZSBMaWNlbnNlIGlzIGRpc3RyaWJ1dGVkIG9uIGFuICJBUyBJUyIgQkFTSVMsCisgKiBXSVRIT1VUIFdBUlJBTlRJRVMgT1IgQ09ORElUSU9OUyBPRiBBTlkgS0lORCwgZWl0aGVyIGV4cHJlc3Mgb3IgaW1wbGllZC4KKyAqIFNlZSB0aGUgTGljZW5zZSBmb3IgdGhlIHNwZWNpZmljIGxhbmd1YWdlIGdvdmVybmluZyBwZXJtaXNzaW9ucyBhbmQKKyAqIGxpbWl0YXRpb25zIHVuZGVyIHRoZSBMaWNlbnNlLgorICogPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKyAqLworcGFja2FnZSBvcmcub3BlbmVjb21wLnBvcnRhbGFwcC51dGlsOworCitpbXBvcnQgamF2YXguc2VydmxldC5odHRwLkNvb2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T09PT09PT09PT09PT09PT09PT09PT09PT0KKyMgQ29weXJpZ2h0IChDKSAyMDE3IEFUJlQgSW50ZWxsZWN0dWFsIFByb3BlcnR5CisjID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisjIExpY2Vuc2VkIHVuZGVyIHRoZSBBcGFjaGUgTGljZW5zZSwgVmVyc2lvbiAyLjAgKHRoZSAiTGljZW5zZSIpOworIyB5b3UgbWF5IG5vdCB1c2UgdGhpcyBmaWxlIGV4Y2VwdCBpbiBjb21wbGlhbmNlIHdpdGggdGhlIExpY2Vuc2UuCisjIFlvdSBtYXkgb2J0YWluIGEgY29weSBvZiB0aGUgTGljZW5zZSBhdAorIyAKKyMgICAgICBodHRwOi8vd3d3LmFwYWNoZS5vcmcvbGljZW5zZXMvTElDRU5TRS0yLjAKKyMgCisjIFVubGVzcyByZXF1aXJlZCBieSBhcHBsaWNhYmxlIGxhdyBvciBhZ3JlZWQgdG8gaW4gd3JpdGluZywgc29mdHdhcmUKKyMgZGlzdHJpYnV0ZWQgdW5kZXIgdGhlIExpY2Vuc2UgaXMgZGlzdHJpYnV0ZWQgb24gYW4gIkFTIElTIiBCQVNJUywKKyMgV0lUSE9VVCBXQVJSQU5USUVTIE9SIENPTkRJVElPTlMgT0YgQU5ZIEtJTkQsIGVpdGhlciBleHByZXNzIG9yIGltcGxpZWQuCisjIFNlZSB0aGUgTGljZW5zZSBmb3IgdGhlIHNwZWNpZmljIGxhbmd1YWdlIGdvdmVybmluZyBwZXJtaXNzaW9ucyBhbmQKKyMgbGltaXRhdGlvbnMgdW5kZXIgdGhlIExpY2Vuc2UuCisjID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisjIyMKK2F1dGhlbnRpY2F0aW9uX3NlcnZlcl91cmwgPSBodHRwOi8vbG9jYWxob3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zQzZERXdHVkhYT3dSb1hSR1FfaDUwVnNoNjBNQjVNSXVETjE4OEVlWm5RMzBkdENUQkI5S0RUU0VBMkR1bnBsaHdMQ3E0eHBobk1OVWFlSGRFayIsCisgICAgICAia3R5IjogIlJTQSIsCisgICAgICAia2lkIjogInJzYTEiCisgICAgfQorICBdCit9CmRpZmYgLS1naXQgYS9lY29tcC1wb3J0YWwtQkUvc3JjL21haW4vcmVzb3VyY2VzL3BvcnRhbC5wcm9wZXJ0aWVzIGIvZWNvbXAtcG9ydGFsLUJFL3NyYy9tYWluL3Jlc291cmNlcy9wb3J0YWwucHJvcGVydGllcwpuZXcgZmlsZSBtb2RlIDEwMDY0NAppbmRleCAwMDAwMDAwLi5hMTk4MjYzCi0tLSAvZGV2L251bGwKKysrIGIvZWNvbXAtcG9ydGFsLUJFL3NyYy9tYWluL3Jlc291cmNlcy9wb3J0YWwucHJvcGVydGllcwpAQCAtMCwwICsxLDQ0IEBACisjIyMKKyMgPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKyMgZUNPTVAgUG9ydGFsCisjID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisjIENvcHlyaWdodCAoQykgMjAxNyBBVCZUIEludGVsbGVjdHVhbCBQcm9wZXJ0eQorIyA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorIyBMaWNlbnNlZCB1bmRlciB0aGUgQXBhY2hlIExpY2Vuc2UsIFZlcnNpb24gMi4wICh0aGUgIkxpY2Vuc2UiKTsKKyMgeW91IG1heSBub3QgdXNlIHRoaXMgZmlsZSBleGNlcHQgaW4gY29tcGxpYW5jZSB3aXRoIHRoZSBMaWNlbnNlLgorIyBZb3UgbWF5IG9idGFp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UF0dHJpYnV0ZXMKK2pjcy5yZWdpb24ubG9va1VwT2JqZWN0Q2FjaGUuY2FjaGVhdHRyaWJ1dGVzLk1heE9iamVjdHM9NDAwMAoramNzLnJlZ2lvbi5sb29rVXBPYmplY3RDYWNoZS5jYWNoZWF0dHJpYnV0ZXMuTWVtb3J5Q2FjaGVOYW1lPW9yZy5hcGFjaGUuamNzLmVuZ2luZS5tZW1vcnkubHJ1LkxSVU1lbW9yeUNhY2hlCmRpZmYgLS1naXQgYS9lY29tcC1wb3J0YWwtQkUvd2FyL1dFQi1JTkYvY29uZi9rcGlkYXNoLnByb3BlcnRpZXMgYi9lY29tcC1wb3J0YWwtQkUvd2FyL1dFQi1JTkYvY29uZi9rcGlkYXNoLnByb3BlcnRpZXMKbmV3IGZpbGUgbW9kZSAxMDA2NDQKaW5kZXggMDAwMDAwMC4uZWViZmZmNwotLS0gL2Rldi9udWxsCisrKyBiL2Vjb21wLXBvcnRhbC1CRS93YXIvV0VCLUlORi9jb25mL2twaWRhc2gucHJvcGVydGllcwpAQCAtMCwwICsxLDIyIEBACisjIyMKKyMgPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKyMgZUNPTVAgUG9ydGFsCisjID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisjIENvcHlyaWdodCAoQykgMjAxNyBBVCZUIEludGVsbGVjdHVhbCBQcm9wZXJ0eQorIyA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorIyBMaWNlbnNlZCB1bmRlciB0aGUgQXBhY2hlIExpY2Vuc2UsIFZlcnNpb24gMi4wICh0aGUgIkxpY2Vuc2UiKTsKKyMgeW91IG1heSBub3QgdXNlIHRoaXMgZmlsZSBleGNl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F1YXJ0ei5wcm9wZXJ0aWVzIGIvZWNvbXAtcG9ydGFsLUJFL3dhci9XRUItSU5GL2NvbmYvcXVhcnR6LnByb3BlcnRpZXMKbmV3IGZpbGUgbW9kZSAxMDA2NDQKaW5kZXggMDAwMDAwMC4uZjk1ZjQ2OQotLS0gL2Rldi9udWxsCisrKyBiL2Vjb21wLXBvcnRhbC1CRS93YXIvV0VCLUlORi9jb25mL3F1YXJ0ei5wcm9wZXJ0aWVzCkBAIC0wLDAgKzEsNTUgQEAKKyMjIworIyA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorIyBlQ09NUCBQb3J0YWwKKyMgPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKyMgQ29weXJpZ2h0IChDKSAyMDE3IEFUJlQgSW50ZWxsZWN0dWFsIFByb3BlcnR5CisjID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisjIExpY2Vuc2VkIHVuZGVyIHRoZSBBcGFjaGUgTGljZW5zZSwgVmVyc2lvbiAyLjAgKHRoZSAiTGljZW5zZSIpOworIyB5b3UgbWF5IG5vdCB1c2UgdGhpcyBmaWxlIGV4Y2VwdCBpbiBjb21wbGlhbmNlIHdpdGggdGhlIExpY2Vuc2UuCisjIFlvdSBtYXkgb2J0YWluIGEgY29weSBvZiB0aGUgTGljZW5zZSBhdAorIyAKKyMgICAgICBodHRwOi8vd3d3LmFwYWNoZS5vcmcvbGljZW5zZXMvTElDRU5TRS0yLjAKKyMgCisjIFVubGVzcyByZXF1aXJlZCBieSBhcHBsaWNhYmxlIGxhdyBvciBhZ3JlZWQgdG8gaW4gd3JpdGluZywgc29mdHdhcmUKKyMgZGlzdHJpYnV0ZWQgdW5kZXI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09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKyMgQ29uZmlndXJlIEpvYlN0b3JlICAKKyM9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisKK29yZy5xdWFydHouam9iU3RvcmUubWlzZmlyZVRocmVzaG9sZCA9IDYwMDAwCisKK29yZy5xdWFydHouam9iU3RvcmUuY2xhc3MgPSBvcmcucXVhcnR6LmltcGwuamRiY2pvYnN0b3JlLkpvYlN0b3JlVFgKK29yZy5xdWFydHouam9iU3RvcmUuZHJpdmVyRGVsZWdhdGVDbGFzcyA9IG9yZy5xdWFydHouaW1wbC5qZGJjam9ic3RvcmUuU3RkSkRCQ0RlbGVnYXRlCitvcmcucXVhcnR6LmpvYlN0b3JlLnVzZVByb3BlcnRpZXMgPSBmYWxzZQorI29yZy5xdWFydHouam9iU3RvcmUuZGF0YVNvdXJjZSA9IG15RFMKK29yZy5xdWFydHouam9iU3RvcmUudGFibGVQcmVmaXggPSBGTl9RWl8KKworb3JnLnF1YXJ0ei5qb2JTdG9yZS5pc0NsdXN0ZXJlZCA9IHRydWUKK29yZy5xdWFydHouam9iU3RvcmUuY2x1c3RlckNoZWNraW5JbnRlcnZhbCA9IDIwMDAwCisKKyM9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisjIENvbmZpZ3VyZSBEYXRhc291cmNlcyAgCisjPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorCisjb3JnLnF1YXJ0ei5kYXRhU291cmNlLm15RFMuZHJpdmVyID0gY29tLm15c3FsLmpkYmMuRHJpdmVyCisjb3JnLnF1YXJ0ei5kYXRhU291cmNlLm15RFMuVVJMID0gamRiYzpteXNxbDovL2xvY2FsaG9zdDozMzA2L3BvcnRhbAorI29yZy5xdWFydHouZGF0YVNvdXJjZS5teURTLnVzZXIgPSB0b2RvCisjb3JnLnF1YXJ0ei5kYXRhU291cmNlLm15RFMucGFzc3dvcmQgPSB0b2RvCisjb3JnLnF1YXJ0ei5kYXRhU291cmNlLm15RFMubWF4Q29ubmVjdGlvbnMgPSA1Cisjb3JnLnF1YXJ0ei5kYXRhU291cmNlLm15RFMudmFsaWRhdGlvblF1ZXJ5PXNlbGVjdCAwIGZyb20gZHVhbApkaWZmIC0tZ2l0IGEvZWNvbXAtcG9ydGFsLUJFL3dhci9XRUItSU5GL2NvbmYvcmFwdG9yLnByb3BlcnRpZXMgYi9lY29tcC1wb3J0YWwtQkUvd2FyL1dFQi1JTkYvY29uZi9yYXB0b3IucHJvcGVydGllcwpuZXcgZmlsZSBtb2RlIDEwMDY0NAppbmRleCAwMDAwMDAwLi4wYzMyZWY2Ci0tLSAvZGV2L251bGwKKysrIGIvZWNvbXAtcG9ydGFsLUJFL3dhci9XRUItSU5GL2NvbmYvcmFwdG9yLnByb3BlcnRpZXMKQEAgLTAsMCArMSwxODUgQEAKKyMjIworIyA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorIyBlQ09NUCBQb3J0YWwKKyMgPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKyMgQ29weXJpZ2h0IChDKSAyMDE3IEFUJlQgSW50ZWxsZWN0dWFsIFByb3BlcnR5CisjID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisjIExpY2Vuc2VkIHVuZGVyIHRoZSBBcGFjaGUgTGljZW5zZSwgVmVyc2lvbiAyLjAgKHRoZSAiTGljZW5zZSIpOworIyB5b3UgbWF5IG5vdCB1c2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VzCm5ldyBmaWxlIG1vZGUgMTAwNjQ0CmluZGV4IDAwMDAwMDAuLjA5ZmUwY2UKLS0tIC9kZXYvbnVsbAorKysgYi9lY29tcC1wb3J0YWwtQkUvd2FyL1dFQi1JTkYvY29uZi9yYXB0b3JfYXBwX2Z1c2lvbi5wcm9wZXJ0aWVzCkBAIC0wLDAgKzEsMzYgQEAKKyMjIworIyA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorIyBlQ09NUCBQb3J0YWwKKyMgPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKyMgQ29weXJpZ2h0IChDKSAyMDE3IEFUJlQgSW50ZWxsZWN0dWFsIFByb3BlcnR5CisjID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisjIExpY2Vuc2VkIHVuZGVyIHRoZSBBcGFjaGUgTGljZW5zZSwgVmVyc2lvbiAyLjAgKHRoZSAiTGljZW5zZSIpOworIyB5b3UgbWF5IG5vdCB1c2UgdGhpcyBmaWxlIGV4Y2VwdCBpbiBjb21wbGlhbmNlIHdpdGggdGhlIExpY2Vuc2UuCisjIFlvdSBtYXkgb2J0YWluIGEgY29weSBvZiB0aGUgTGljZW5zZSBhdAorIyAKKyMgICAgICBodHRwOi8vd3d3LmFwYWNoZS5vcmcvbGljZW5zZXMvTElDRU5TRS0yLjAKKyMgCisjIFVubGVzcyByZXF1aXJlZCBieSBhcHBsaWNhYmxlIGxhdyBvciBhZ3JlZWQgdG8gaW4gd3JpdGluZywgc29mdHdhcmUKKyMgZGlzdHJpYnV0ZWQgdW5kZXIgdGhlIExpY2Vuc2UgaXMgZGlzdHJpYnV0ZWQgb24gYW4gIkFTIElTIiBCQVNJUywKKyMgV0lUSE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bnR1bS9yYXB0b3JfZW1haWxfYXR0YWNobWVudC5odG0/YWN0aW9uPXJhcHRvciZzb3VyY2VfcGFnZT1yZXBvcnRfcnVuJmRpc3BsYXlfY29udGVudD15CitiYXNlX2FjdGlvbl91cmw9cmFwdG9yLmh0bT9hY3Rpb249CitiYXNlX2FjdGlvbl9wYXJhbT1jX21hc3Rlcj0KK3N1cGVyX3JvbGVfaWQ9MQorYWRtaW5fcm9sZV9pZHM9MQorcXVpY2tfbGlua3NfbWVudV9pZHM9SE9NRSxDVVNUT01FUixSRVBPUlRTCmRpZmYgLS1naXQgYS9lY29tcC1wb3J0YWwtQkUvd2FyL1dFQi1JTkYvY29uZi9yYXB0b3JfZGJfZnVzaW9uLnByb3BlcnRpZXMgYi9lY29tcC1wb3J0YWwtQkUvd2FyL1dFQi1JTkYvY29uZi9yYXB0b3JfZGJfZnVzaW9uLnByb3BlcnRpZXMKbmV3IGZpbGUgbW9kZSAxMDA2NDQKaW5kZXggMDAwMDAwMC4uNDk3ZmExNgotLS0gL2Rldi9udWxsCisrKyBiL2Vjb21wLXBvcnRhbC1CRS93YXIvV0VCLUlORi9jb25mL3JhcHRvcl9kYl9mdXNpb24ucHJvcGVydGllcwpAQCAtMCwwICsxLDE5IEBACisjIyMKKyMgPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKyMgZUNPTVAgUG9ydGFsCisjID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisjIENvcHlyaWdodCAoQykgMjAxNyBBVCZUIEludGVsbGVjdHVhbCBQcm9wZXJ0eQorIyA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorIyBMaWNlbnNlZCB1bmRlciB0aGUgQXBhY2hlIExp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vcnRhbC1CRS93YXIvV0VCLUlORi9jb25mL3JhcHRvcl9wZGYucHJvcGVydGllcwpAQCAtMCwwICsxLDQ5IEBACisjIyMKKyMgPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKyMgZUNPTVAgUG9ydGFsCisjID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisjIENvcHlyaWdodCAoQykgMjAxNyBBVCZUIEludGVsbGVjdHVhbCBQcm9wZXJ0eQorIyA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorIyBMaWNlbnNlZCB1bmRlciB0aGUgQXBhY2hlIExpY2Vuc2UsIFZlcnNpb24gMi4wICh0aGUgIkxpY2Vuc2UiKTsKKyMgeW91IG1heSBub3QgdXNlIHRoaXMgZmlsZSBleGNlcHQgaW4gY29tcGxpYW5jZSB3aXRoIHRoZSBMaWNlbnNlLgorIyBZb3UgbWF5IG9idGFpbiBhIGNvcHkgb2YgdGhlIExpY2Vuc2UgYXQKKyMgCisjICAgICAgaHR0cDovL3d3dy5hcGFjaGUub3JnL2xpY2Vuc2VzL0xJQ0VOU0UtMi4wCisjIAorIyBVbmxlc3MgcmVxdWlyZWQgYnkgYXBwbGljYWJsZSBsYXcgb3IgYWdyZWVkIHRvIGluIHdyaXRpbmcsIHNvZnR3YXJlCisjIGRpc3RyaWJ1dGVkIHVuZGVyIHRoZSBMaWNlbnNlIGlzIGRpc3RyaWJ1dGVkIG9uIGFuICJBUyBJUyIgQkFTSVMsCisjIFdJVEhPVVQgV0FSUkFOVElFUyBPUiBDT05ESVRJT05TIE9GIEFOWSBLSU5ELCBlaXRoZXIgZXhwcmVzcyBvciBpbXBsaWVkLgorIyBTZWUgdGhlIExpY2Vuc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T09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKyMgQ29weXJpZ2h0IChDKSAyMDE3IEFUJlQgSW50ZWxsZWN0dWFsIFByb3BlcnR5CisjID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisjIExpY2Vuc2VkIHVuZGVyIHRoZSBBcGFjaGUgTGljZW5zZSwgVmVyc2lvbiAyLjAgKHRoZSAiTGljZW5zZSIpOworIyB5b3UgbWF5IG5vdCB1c2UgdGhpcyBmaWxlIGV4Y2VwdCBpbiBjb21wbGlhbmNlIHdpdGggdGhlIExpY2Vuc2UuCisjIFlvdSBtYXkgb2J0YWluIGEgY29weSBvZiB0aGUgTGljZW5zZSBhdAorIyAKKyMgICAgICBodHRwOi8vd3d3LmFwYWNoZS5vcmcvbGljZW5zZXMvTElDRU5TRS0yLjAKKyMgCisjIFVubGVzcyByZXF1aXJlZCBieSBhcHBsaWNhYmxlIGxhdyBvciBhZ3JlZWQgdG8gaW4gd3JpdGluZywgc29mdHdhcmUKKyMgZGlzdHJpYnV0ZWQgdW5kZXIgdGhlIExpY2Vuc2UgaXMgZGlzdHJpYnV0ZWQgb24gYW4gIkFTIElTIiBCQVNJUywKKyMgV0lUSE9VVCBXQVJSQU5USUVTIE9SIENPTkRJVElPTlMgT0YgQU5ZIEtJTkQsIGVpdGhlciBleHByZXNzIG9yIGltcGxpZWQuCisjIFNlZSB0aGUgTGljZW5zZSBmb3IgdGhlIHNwZWNpZmljIGxhbmd1YWdlIGdvdmVybmluZyBwZXJtaXNzaW9ucyBhbmQKKyMgbGltaXRhdGlvbnMgdW5kZXIgdGhlIExpY2Vuc2UuCisjID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisjIyMKKyNTUUwgU3RhdGVt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nMvZGVmaW5pdGlvbnMueG1sCkBAIC0wLDAgKzEsMzggQEAKKzw/eG1sIHZlcnNpb249IjEuMCIgZW5jb2Rpbmc9IlVURi04Ij8+Cis8IS0tCisgID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisgIGVDT01QIFBvcnRhbAorICA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorICBDb3B5cmlnaHQgKEMpIDIwMTcgQVQmVCBJbnRlbGxlY3R1YWwgUHJvcGVydHkKKyAgPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKyAgTGljZW5zZWQgdW5kZXIgdGhlIEFwYWNoZSBMaWNlbnNlLCBWZXJzaW9uIDIuMCAodGhlICJMaWNlbnNlIik7CisgIHlvdSBtYXkgbm90IHVzZSB0aGlzIGZpbGUgZXhjZXB0IGluIGNvbXBsaWFuY2Ugd2l0aCB0aGUgTGljZW5zZS4KKyAgWW91IG1heSBvYnRhaW4gYSBjb3B5IG9mIHRoZSBMaWNlbnNlIGF0CisgIAorICAgICAgIGh0dHA6Ly93d3cuYXBhY2hlLm9yZy9saWNlbnNlcy9MSUNFTlNFLTIuMAorICAKKyAgVW5sZXNzIHJlcXVpcmVkIGJ5IGFwcGxpY2FibGUgbGF3IG9yIGFncmVlZCB0byBpbiB3cml0aW5nLCBzb2Z0d2FyZQorICBkaXN0cmlidXRlZCB1bmRlciB0aGUgTGljZW5zZSBpcyBkaXN0cmlidXRlZCBvbiBhbiAiQVMgSVMiIEJBU0lTLAorICBXSVRIT1VUIFdBUlJBTlRJRVMgT1IgQ09ORElUSU9OUyBPRiBBTlkgS0lORCwgZWl0aGVyIGV4cHJlc3Mgb3IgaW1wbGllZC4KKyAgU2VlI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KworPC90aWxlcy1kZWZpbml0aW9ucz4KZGlmZiAtLWdpdCBhL2Vjb21wLXBvcnRhbC1CRS93YXIvV0VCLUlORi9mdXNpb24vLkRTX1N0b3JlIGIvZWNvbXAtcG9ydGFsLUJFL3dhci9XRUItSU5GL2Z1c2lvbi8uRFNfU3RvcmUKbmV3IGZpbGUgbW9kZSAxMDA2NDQKaW5kZXggMDAwMDAwMC4uN2ZiMjc0YwotLS0gL2Rldi9udWxsCisrKyBiL2Vjb21wLXBvcnRhbC1CRS93YXIvV0VCLUlORi9mdXNpb24vLkRTX1N0b3JlCkJpbmFyeSBmaWxlcyBkaWZmZXIKZGlmZiAtLWdpdCBhL2Vjb21wLXBvcnRhbC1CRS93YXIvV0VCLUlORi9mdXNpb24vY29uZi9mdXNpb24ucHJvcGVydGllcyBiL2Vjb21wLXBvcnRhbC1CRS93YXIvV0VCLUlORi9mdXNpb24vY29uZi9mdXNpb24ucHJvcGVydGllcwpuZXcgZmlsZSBtb2RlIDEwMDY0NAppbmRleCAwMDAwMDAwLi4yNDJhMjFkCi0tLSAvZGV2L251bGwKKysrIGIvZWNvbXAtcG9ydGFsLUJFL3dhci9XRUItSU5GL2Z1c2lvbi9jb25mL2Z1c2lvbi5wcm9wZXJ0aWVzCkBAIC0wLDAgKzEsODIgQEAKKyMjIworIyA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorIyBlQ09NUCBQb3J0YWwKKyMgPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKyMgQ29weXJpZ2h0IChDKSAyMDE3IEFUJlQgSW50ZWxsZWN0dWFsIFByb3BlcnR5CisjID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisjIExpY2Vuc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c2VyX2F0dHJpYnV0ZV9uYW1lICAgICAgPSB1c2VyCisKKyMgVXNlciBTZXNzaW9uIHNldHRpbmdzCisjdXNlcl9hdHRyaWJ1dGVfbmFtZSAgICAgICAgICAgPSB1c2VyCityb2xlc19hdHRyaWJ1dGVfbmFtZSAgICAgICAgICA9IHJvbGVzCityb2xlX2Z1bmN0aW9uc19hdHRyaWJ1dGVfbmFtZSA9IHJvbGVfZnVuY3Rpb25zCisjY2xpZW50X2RldmljZV9hdHRyaWJ1dGVfbmFtZSAgPSBjbGllbnRfZGV2aWNlCisjY2xpZW50X2RldmljZV9lbXVsYXRpb24gICAgICAgPSBmYWxzZQorI2NsaWVudF9kZXZpY2VfdHlwZV90b19lbXVsYXRlID0gCisKKyMgbWVudSBzZXR0aW5ncworbWVudV9xdWVyeV9uYW1lICAgICAgICAgICAgICAgICAgICAgID0gbWVudURhdGEKKyNtZW51X3Byb3BlcnRpZXNfZmlsZV9sb2NhdGlvbiAgICAgICAgPSAvV0VCLUlORi9mdXNpb24vbWVudS8KK2FwcGxpY2F0aW9uX21lbnVfc2V0X25hbWUgICAgICAgICAgICA9IEFQUAorYXBwbGljYXRpb25fbWVudV9hdHRyaWJ1dGVfbmFtZSAgICAgID0gYXBwbGljYXRpb25NZW51RGF0YQorI2FwcGxpY2F0aW9uX21lbnVfcHJvcGVydGllc19uYW1lICAgICA9IG1lbnUucHJvcGVydGllcworYnVzaW5lc3NfZGlyZWN0X21lbnVfc2V0X25hbWUgICAgICAgID0gQkQKKyNidXNpbmVzc19kaXJlY3RfbWVudV9wcm9wZXJ0aWVzX25hbWUgPSBiZC5tZW51LnByb3BlcnRpZXMKK2J1c2luZXNzX2RpcmVjdF9tZW51X2F0dHJpYnV0ZV9uYW1lICA9IGJ1c2luZXNzRGlyZWN0TWVudURhdGEKKworIyBSQVBUT1IgY29uZmlnIHNldHRpbmdzCisjcmFwdG9yX2NvbmZpZ19maWxlX3BhdGggPSAvV0VCLUlORi9jb25mLworCisjIEVDT01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yBhbiBhbGVydC4gIFRoaXMgcGFyYW1ldGVyIHNwZWNpZmllcyBob3cgb2Z0ZW4gdGhpcyBhbGVydCBzaG91bGQgYmUgdHJpZ2dlcmVkICAKKyMgaWYgdGhlIGNvbXBvbmVudCByZW1haW5zIGRvd24uICAgRm9yIGV4YW1wbGUgYSB2YWx1ZSBvZiAzMCwgd291bGQgdHJhbnNsYXRlIHRvIDMwICogNjAgc2Vjb25kcyA9IDE4MDAgc2Vjb25kcywgb3IgZXZlcnkgMzAgbWludXRlcworIworaGVhbHRoX2ZhaWxfYWxlcnRfZXZlcnlfeF9pbnRlcnZhbHMgPSAgMzAKZGlmZiAtLWdpdCBhL2Vjb21wLXBvcnRhbC1CRS93YXIvV0VCLUlORi9mdXNpb24vZGVmcy9kZWZpbml0aW9ucy54bWwgYi9lY29tcC1wb3J0YWwtQkUvd2FyL1dFQi1JTkYvZnVzaW9uL2RlZnMvZGVmaW5pdGlvbnMueG1sCm5ldyBmaWxlIG1vZGUgMTAwNjQ0CmluZGV4IDAwMDAwMDAuLmYxMWIzOWEKLS0tIC9kZXYvbnVsbAorKysgYi9lY29tcC1wb3J0YWwtQkUvd2FyL1dFQi1JTkYvZnVzaW9uL2RlZnMvZGVmaW5pdGlvbnMueG1sCkBAIC0wLDAgKzEsMTIwIEBACis8P3htbCB2ZXJzaW9uPSIxLjAiIGVuY29kaW5nPSJVVEYtOCI/PgorPCEtLQorICA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorICBlQ09NUCBQb3J0YWwKKyAgPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKyAgQ29weXJpZ2h0IChDKSAyMDE3IEFUJlQgSW50ZWxsZWN0dWFsIFByb3BlcnR5CisgID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT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nVzaW9uL2pzcC8uZ2l0aWdub3JlIGIvZWNvbXAtcG9ydGFsLUJFL3dhci9XRUItSU5GL2Z1c2lvbi9qc3AvLmdpdGlnbm9yZQpuZXcgZmlsZSBtb2RlIDEwMDY0NAppbmRleCAwMDAwMDAwLi5lNjlkZTI5Ci0tLSAvZGV2L251bGwKKysrIGIvZWNvbXAtcG9ydGFsLUJFL3dhci9XRUItSU5GL2Z1c2lvbi9qc3AvLmdpdGlnbm9yZQpkaWZmIC0tZ2l0IGEvZWNvbXAtcG9ydGFsLUJFL3dhci9XRUItSU5GL2Z1c2lvbi9qc3AvY29sbGFib3JhdGVMaXN0LmpzcCBiL2Vjb21wLXBvcnRhbC1CRS93YXIvV0VCLUlORi9mdXNpb24vanNwL2NvbGxhYm9yYXRlTGlzdC5qc3AKbmV3IGZpbGUgbW9kZSAxMDA2NDQKaW5kZXggMDAwMDAwMC4uMjE0OTc1MQotLS0gL2Rldi9udWxsCisrKyBiL2Vjb21wLXBvcnRhbC1CRS93YXIvV0VCLUlORi9mdXNpb24vanNwL2NvbGxhYm9yYXRlTGlzdC5qc3AKQEAgLTAsMCArMSwxMDEgQEAKKzwlLS0KKyAgPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKyAgZUNPTVAgUG9ydGFsCisgID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisgIENvcHlyaWdodCAoQykgMjAxNyBBVCZUIEludGVsbGVjdHVhbCBQcm9wZXJ0eQorICA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorICBMaWNlbnNlZCB1bmRlciB0aGUgQXBhY2hlIExpY2Vuc2UsIFZlcnNpb24gMi4wICh0aGUgIkxpY2Vuc2UiKTsKKy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pzcC9lYnovZWJ6X2Zvb3Rlci5qc3AgYi9lY29tcC1wb3J0YWwtQkUvd2FyL1dFQi1JTkYvZnVzaW9uL2pzcC9lYnovZWJ6X2Zvb3Rlci5qc3AKbmV3IGZpbGUgbW9kZSAxMDA2NDQKaW5kZXggMDAwMDAwMC4uYWU3MmFmNgotLS0gL2Rldi9udWxsCisrKyBiL2Vjb21wLXBvcnRhbC1CRS93YXIvV0VCLUlORi9mdXNpb24vanNwL2Viei9lYnpfZm9vdGVyLmpzcApAQCAtMCwwICsxLDYzIEBACis8JS0tCisgID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisgIGVDT01QIFBvcnRhbAorICA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorICBDb3B5cmlnaHQgKEMpIDIwMTcgQVQmVCBJbnRlbGxlY3R1YWwgUHJvcGVydHkKKyAgPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKyAgTGljZW5zZWQgdW5kZXIgdGhlIEFwYWNoZSBMaWNlbnNlLCBWZXJzaW9uIDIuMCAodGhlICJMaWNlbnNlIik7CisgIHlvdSBtYXkgbm90IHVzZSB0aGlzIGZpbGUgZXhjZXB0IGluIGNvbXBsaWFuY2Ugd2l0aCB0aGUgTGljZW5zZS4KKyAgWW91IG1heSBvYnRhaW4gYSBjb3B5IG9mIHRoZSBMaWNlbnNlIGF0CisgIAorICAgICAgIGh0dHA6Ly93d3cuYXBhY2hlLm9yZy9saWNlbnNlcy9MSUNFTlNFLTIuMAorICAKKyAgVW5sZXNzIHJlcXVpcmVkIGJ5IGFwcGxpY2FibGUgbGF3IG9yIGFncmVlZCB0byBpbiB3cml0aW5nLCBzb2Z0d2FyZQorICBkaX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cApuZXcgZmlsZSBtb2RlIDEwMDY0NAppbmRleCAwMDAwMDAwLi5lNGNkMjI0Ci0tLSAvZGV2L251bGwKKysrIGIvZWNvbXAtcG9ydGFsLUJFL3dhci9XRUItSU5GL2Z1c2lvbi9qc3AvZWJ6L2Viel9oZWFkZXIuanNwCkBAIC0wLDAgKzEsMzAzIEBACis8JS0tCisgID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisgIGVDT01QIFBvcnRhbAorICA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorICBDb3B5cmlnaHQgKEMpIDIwMTcgQVQmVCBJbnRlbGxlY3R1YWwgUHJvcGVydHkKKyAgPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKyAgTGljZW5zZWQgdW5kZXIgdGhlIEFwYWNoZSBMaWNlbnNlLCBWZXJzaW9uIDIuMCAodGhlICJMaWNlbnNlIik7CisgIHlvdSBtYXkgbm90IHVzZSB0aGlzIGZpbGUgZXhjZXB0IGluIGNvbXBsaWFuY2Ugd2l0aCB0aGUgTGljZW5zZS4KKyAgWW91IG1heSBvYnRhaW4gYSBjb3B5IG9mIHRoZSBMaWNlbnNlIGF0CisgIAorICAgICAgIGh0dHA6Ly93d3cuYXBhY2hlLm9yZy9saWNlbnNlcy9MSUNFTlNFLTIuMAorICAKKyAgVW5sZXNzIHJlcXVpcmVkIGJ5IGFwcGxpY2FibGUgbGF3IG9yIGFncmVlZCB0byBpbiB3cml0aW5nLCBzb2Z0d2FyZQorICBkaXN0cmlidXRlZCB1bmRlciB0aGUgTGljZW5zZSBpcyBkaXN0cmlidXRlZCBvbiBhbiAiQVMgSVMiIEJBU0lTLAorICBXSVRIT1VUIFdBUlJBTlR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i9udWxsCisrKyBiL2Vjb21wLXBvcnRhbC1CRS93YXIvV0VCLUlORi9mdXNpb24vanNwL2Viel90ZW1wbGF0ZS5qc3AKQEAgLTAsMCArMSw0NCBAQAorPCUtLQorICA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorICBlQ09NUCBQb3J0YWwKKyAgPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKyAgQ29weXJpZ2h0IChDKSAyMDE3IEFUJlQgSW50ZWxsZWN0dWFsIFByb3BlcnR5CisgID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisgIExpY2Vuc2VkIHVuZGVyIHRoZSBBcGFjaGUgTGljZW5zZSwgVmVyc2lvbiAyLjAgKHRoZSAiTGljZW5zZSIpOworICB5b3UgbWF5IG5vdCB1c2UgdGhpcyBmaWxlIGV4Y2VwdCBpbiBjb21wbGlhbmNlIHdpdGggdGhlIExpY2Vuc2UuCisgIFlvdSBtYXkgb2J0YWluIGEgY29weSBvZiB0aGUgTGljZW5zZSBhdAorICAKKyAgICAgICBodHRwOi8vd3d3LmFwYWNoZS5vcmcvbGljZW5zZXMvTElDRU5TRS0yLjAKKyAgCisgIFVubGVzcyByZXF1aXJlZCBieSBhcHBsaWNhYmxlIGxhdyBvciBhZ3JlZWQgdG8gaW4gd3JpdGluZywgc29mdHdhcmUKKyAgZGlzdHJpYnV0ZWQgdW5kZXIgdGhlIExpY2Vuc2UgaXMgZGlzdHJpYnV0ZWQgb24gYW4gIkFTIElTIiBCQVNJUywKKyAgV0lUSE9VVCBXQVJSQU5USUVTIE9SIENPTkRJVElPTlMgT0YgQU5ZIEtJTkQsIGVpdGhlciBleHByZXNzIG9yIGltcGxpZWQuCisgIF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tZT0iYm9keSIgLz4KKwkJCQk8L2Rpdj4KKwkJCTwvZGl2PgorCQkJPGJyPgorCQkJPGRpdj4KKwkJCQk8dGlsZXM6aW5zZXJ0QXR0cmlidXRlIG5hbWU9ImZvb3RlciIgLz4gCisJCQk8L2Rpdj4KKwkJPC9kaXY+CisJPC9ib2R5PgorPC9odG1sPgpkaWZmIC0tZ2l0IGEvZWNvbXAtcG9ydGFsLUJFL3dhci9XRUItSU5GL2Z1c2lvbi9qc3AvZWJ6X3RlbXBsYXRlX25vaGVhZGVyX25vZm9vdGVyLmpzcCBiL2Vjb21wLXBvcnRhbC1CRS93YXIvV0VCLUlORi9mdXNpb24vanNwL2Viel90ZW1wbGF0ZV9ub2hlYWRlcl9ub2Zvb3Rlci5qc3AKbmV3IGZpbGUgbW9kZSAxMDA2NDQKaW5kZXggMDAwMDAwMC4uYzNmOWZlZgotLS0gL2Rldi9udWxsCisrKyBiL2Vjb21wLXBvcnRhbC1CRS93YXIvV0VCLUlORi9mdXNpb24vanNwL2Viel90ZW1wbGF0ZV9ub2hlYWRlcl9ub2Zvb3Rlci5qc3AKQEAgLTAsMCArMSwzNSBAQAorPCUtLQorICA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorICBlQ09NUCBQb3J0YWwKKyAgPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKyAgQ29weXJpZ2h0IChDKSAyMDE3IEFUJlQgSW50ZWxsZWN0dWFsIFByb3BlcnR5CisgID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisgIExpY2Vuc2VkIHVuZGVyIHRoZSBBcGFjaGUgTGljZW5zZSwgVmVyc2lvbiAyLjAgKHRoZSAiTGljZW5zZSIpOworICB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IsIDI0Mik7IHBhZGRpbmc6IDBweDsiPgorCQk8ZGl2IGNsYXNzPSJhcHBsaWNhdGlvbldpbmRvdyI+CisJCQorCQkJPGRpdiBjbGFzcz0iY29udGVudCIgc3R5bGU9Im1hcmdpbi1sZWZ0OjEwMHB4OyBtYXJnaW4tcmlnaHQ6MTAwcHg7Ij4KKwkJCQk8ZGl2IHN0eWxlPSJtYXJnaW4tdG9wOiA1MHB4OyI+CisJCQkJCTx0aWxlczppbnNlcnRBdHRyaWJ1dGUgbmFtZT0iYm9keSIgLz4KKwkJCQk8L2Rpdj4KKwkJCTwvZGl2PgorCQkJCisJCTwvZGl2PgorCTwvYm9keT4KKzwvaHRtbD4KZGlmZiAtLWdpdCBhL2Vjb21wLXBvcnRhbC1CRS93YXIvV0VCLUlORi9mdXNpb24vanNwL2luY2x1ZGUuanNwIGIvZWNvbXAtcG9ydGFsLUJFL3dhci9XRUItSU5GL2Z1c2lvbi9qc3AvaW5jbHVkZS5qc3AKbmV3IGZpbGUgbW9kZSAxMDA2NDQKaW5kZXggMDAwMDAwMC4uZTRjYTZlNAotLS0gL2Rldi9udWxsCisrKyBiL2Vjb21wLXBvcnRhbC1CRS93YXIvV0VCLUlORi9mdXNpb24vanNwL2luY2x1ZGUuanNwCkBAIC0wLDAgKzEsMzAgQEAKKzwlLS0KKyAgPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKyAgZUNPTVAgUG9ydGFsCisgID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisgIENvcHlyaWdodCAoQykgMjAxNyBBVCZUIEludGVsbGVjdHVhbCBQcm9wZXJ0eQorICA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorICBMaWNl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RpbC5MaW5rZWRIYXNoTWFwIiAlPgorCisKKzwlQCB0YWdsaWIgcHJlZml4PSJjIiAgICAgIHVyaT0iaHR0cDovL2phdmEuc3VuLmNvbS9qc3AvanN0bC9jb3JlIiAlPgorPCVAIHRhZ2xpYiBwcmVmaXg9ImZtdCIgICAgdXJpPSJodHRwOi8vamF2YS5zdW4uY29tL2pzcC9qc3RsL2ZtdCIgJT4KKzwlQCB0YWdsaWIgcHJlZml4PSJmbiIgICAgIHVyaT0iaHR0cDovL2phdmEuc3VuLmNvbS9qc3AvanN0bC9mdW5jdGlvbnMiICU+CisKKzxjOnNldCB2YXI9InJlcXVlc3QiIHZhbHVlPSI8JT1yZXF1ZXN0JT4iLz4KZGlmZiAtLWdpdCBhL2Vjb21wLXBvcnRhbC1CRS93YXIvV0VCLUlORi9mdXNpb24vanNwL2pjc19hZG1pbi5qc3AgYi9lY29tcC1wb3J0YWwtQkUvd2FyL1dFQi1JTkYvZnVzaW9uL2pzcC9qY3NfYWRtaW4uanNwCm5ldyBmaWxlIG1vZGUgMTAwNjQ0CmluZGV4IDAwMDAwMDAuLmJmNTZjNTYKLS0tIC9kZXYvbnVsbAorKysgYi9lY29tcC1wb3J0YWwtQkUvd2FyL1dFQi1JTkYvZnVzaW9uL2pzcC9qY3NfYWRtaW4uanNwCkBAIC0wLDAgKzEsMTQ5IEBACis8JS0tCisgID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisgIGVDT01QIFBvcnRhbAorICA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorICBDb3B5cmlnaHQgKEMpIDIwMTcgQVQmVCBJbnRlbGxlY3R1YWwgUHJvcGVydHkKKyAgPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09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wKKyAgPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKyAgQ29weXJpZ2h0IChDKSAyMDE3IEFUJlQgSW50ZWxsZWN0dWFsIFByb3BlcnR5CisgID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisgIExpY2Vuc2VkIHVuZGVyIHRoZSBBcGFjaGUgTGljZW5zZSwgVmVyc2lvbiAyLjAgKHRoZSAiTGljZW5zZSIpOworICB5b3UgbWF5IG5vdCB1c2UgdGhpcyBmaWxlIGV4Y2VwdCBpbiBjb21wbGlhbmNlIHdpdGggdGhlIExpY2Vuc2UuCisgIFlvdSBtYXkgb2J0YWluIGEgY29weSBvZiB0aGUgTGljZW5zZSBhdAorICAKKyAgICAgICBodHRwOi8vd3d3LmFwYWNoZS5vcmcvbGljZW5zZXMvTElDRU5TRS0yLjAKKyAgCisgIFVubGVzcyByZXF1aXJlZCBieSBhcHBsaWNhYmxlIGxhdyBvciBhZ3JlZWQgdG8gaW4gd3JpdGluZywgc29mdHdhcmUKKyAgZGlzdHJpYnV0ZWQgdW5kZXIgdGhlIExpY2Vuc2UgaXMgZGlzdHJpYnV0ZWQgb24gYW4gIkFTIElTIiBCQVNJUywKKyAgV0lUSE9VVCBXQVJSQU5USUVTIE9SIENPTkRJVElPTlMgT0YgQU5ZIEtJTkQsIGVpdGhlciBleHByZXNzIG9yIGltcGxpZWQuCisgIFNlZSB0aGUgTGljZW5zZSBmb3IgdGhlIHNwZWNpZmljIGxhbmd1YWdlIGdvdmVybmluZyBwZXJtaXNzaW9ucyBhbmQKKyAgbGltaXRhdGlvbnMgdW5kZXIgdGhlIExpY2Vuc2UuCisgID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09Cisg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XNoZWV0IiB0eXBlPSJ0ZXh0L2NzcyIgaHJlZj0ic3RhdGljL2Viei9zYW5kYm94L3N0eWxlcy9zbGRyLmNzcyIgPgorCQk8bGluayByZWw9InN0eWxlc2hlZXQiIHR5cGU9InRleHQvY3NzIiBocmVmPSJzdGF0aWMvZWJ6L3NhbmRib3gvc3R5bGVzL3N0eWxlLmNzcyIgPgorCQk8bGluayByZWw9InN0eWxlc2hlZXQiIHR5cGU9InRleHQvY3NzIiBocmVmPSJzdGF0aWMvZWJ6L3NhbmRib3gvc3R5bGVzL3Ricy5jc3MiID4gCisJCQorPC9oZWFkPgpkaWZmIC0tZ2l0IGEvZWNvbXAtcG9ydGFsLUJFL3dhci9XRUItSU5GL2Z1c2lvbi9qc3AvcG9wdXBfbW9kYWwuaHRtbCBiL2Vjb21wLXBvcnRhbC1CRS93YXIvV0VCLUlORi9mdXNpb24vanNwL3BvcHVwX21vZGFsLmh0bWwKbmV3IGZpbGUgbW9kZSAxMDA2NDQKaW5kZXggMDAwMDAwMC4uODJjNTYxNgotLS0gL2Rldi9udWxsCisrKyBiL2Vjb21wLXBvcnRhbC1CRS93YXIvV0VCLUlORi9mdXNpb24vanNwL3BvcHVwX21vZGFsLmh0bWwKQEAgLTAsMCArMSwzMTEgQEAKKzwhLS0KKyAgPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKyAgZUNPTVAgUG9ydGFsCisgID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisgIENvcHlyaWdodCAoQykgMjAxNyBBVCZUIEludGVsbGVjdHVhbCBQcm9wZXJ0eQorICA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorICBMaWNlbnNlZCB1bmRlciB0aGUg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09PT09CisgIGVDT01QIFBvcnRhbAorICA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorICBDb3B5cmlnaHQgKEMpIDIwMTcgQVQmVCBJbnRlbGxlY3R1YWwgUHJvcGVydHkKKyAgPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKyAgTGljZW5zZWQgdW5kZXIgdGhlIEFwYWNoZSBMaWNlbnNlLCBWZXJzaW9uIDIuMCAodGhlICJMaWNlbnNlIik7CisgIHlvdSBtYXkgbm90IHVzZSB0aGlzIGZpbGUgZXhjZXB0IGluIGNvbXBsaWFuY2Ugd2l0aCB0aGUgTGljZW5zZS4KKyAgWW91IG1heSBvYnRhaW4gYSBjb3B5IG9mIHRoZSBMaWNlbnNlIGF0CisgIAorICAgICAgIGh0dHA6Ly93d3cuYXBhY2hlLm9yZy9saWNlbnNlcy9MSUNFTlNFLTIuMAorICAKKyAgVW5sZXNzIHJlcXVpcmVkIGJ5IGFwcGxpY2FibGUgbGF3IG9yIGFncmVlZCB0byBpbiB3cml0aW5nLCBzb2Z0d2FyZQorICBkaXN0cmlidXRlZCB1bmRlciB0aGUgTGljZW5zZSBpcyBkaXN0cmlidXRlZCBvbiBhbiAiQVMgSVMiIEJBU0lTLAorICBXSVRIT1VUIFdBUlJBTlRJRVMgT1IgQ09ORElUSU9OUyBPRiBBTlkgS0lORCwgZWl0aGVyIGV4cHJlc3Mgb3IgaW1wbGllZC4KKyAgU2VlIHRoZSBMaWNlbnNlIGZvciB0aGUgc3BlY2lmaWMgbGFuZ3VhZ2UgZ292ZXJuaW5nIHBlcm1pc3Npb25zIGFuZAorICBsaW1pdGF0aW9ucyB1bmRlciB0aGUgTGljZW5zZS4KKyAgPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09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6IGZ1bmN0aW9uKGRhdGEpeworCQkJCSBhbGVydCgiRXJyb3Igd2hpbGUgc2F2aW5nLiIpOworCQkJIH0KKwkgIAkgIH0pOworCQl9OworCQkKKwkkc2NvcGUuY2xvc2UgPSBmdW5jdGlvbigpIHsKKwkJJG1vZGFsSW5zdGFuY2UuY2xvc2UoKTsKKwl9OworfQorCis8L3NjcmlwdD4KZGlmZiAtLWdpdCBhL2Vjb21wLXBvcnRhbC1CRS93YXIvV0VCLUlORi9mdXNpb24vanNwL3Bvc3Rfc2VhcmNoLmpzcCBiL2Vjb21wLXBvcnRhbC1CRS93YXIvV0VCLUlORi9mdXNpb24vanNwL3Bvc3Rfc2VhcmNoLmpzcApuZXcgZmlsZSBtb2RlIDEwMDY0NAppbmRleCAwMDAwMDAwLi4zZTBiMTZhCi0tLSAvZGV2L251bGwKKysrIGIvZWNvbXAtcG9ydGFsLUJFL3dhci9XRUItSU5GL2Z1c2lvbi9qc3AvcG9zdF9zZWFyY2guanNwCkBAIC0wLDAgKzEsMzcwIEBACis8JS0tCisgID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisgIGVDT01QIFBvcnRhbAorICA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorICBDb3B5cmlnaHQgKEMpIDIwMTcgQVQmVCBJbnRlbGxlY3R1YWwgUHJvcGVydHkKKyAgPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKyAgTGljZW5zZWQgdW5kZXIgdGhlIEFwYWNoZSBMaWNlbnNlLCBWZXJzaW9uIDIuMCAodGhlICJMaWNlbnNlIik7CisgIHlvdSBtYXkgbm90IHVzZSB0aGlzIGZpbGUgZXhjZXB0IGluIGNvbXBsaWFuY2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1tb2RlbD0icG9zdFNlYXJjaEJlYW4uc2JjaWQiIHZhbHVlPSIiIHNpemU9IjI1Ij4KKyAgICAgICAgICAgIDwvZGl2PgorICAgICAgICAgICAKKyAgICAgICAgICAgIDxkaXYgY2xhc3M9ImZuLWViei1jb250YWluZXIiPgorCSAgICAgICAgICBNYW5hZ2VyIEFUVFVJRDo8YnIvPgorCSAgICAgICAgICA8aW5wdXQgY2xhc3M9ImZuLWViei10ZXh0IiB0eXBlPSJ0ZXh0IiBuZy1tb2RlbD0icG9zdFNlYXJjaEJlYW4ubWFuYWdlckF0dHVpZCIgdmFsdWU9IiIgc2l6ZT0iMjUiPgorICAgICAgICAgICAgPC9kaXY+CisgICAgICAgICAgIDxicj4KKyAgICAgICAgICAgIDxkaXYgY2xhc3M9ImZuLWViei1jb250YWluZXIiPgorCSAgICAgICAgICBPcmdhbml6YXRpb246PGJyLz4KKwkgICAgICAgICAgPGlucHV0IGNsYXNzPSJmbi1lYnotdGV4dCIgdHlwZT0idGV4dCIgbmctbW9kZWw9InBvc3RTZWFyY2hCZWFuLm9yZ0NvZGUiIHZhbHVlPSIiIHNpemU9IjI1Ij4KKyAgICAgICAgICAgIDwvZGl2PgorICAgICAgICAgICAKKyAgICAgICAgICAgIDxkaXYgY2xhc3M9ImZuLWViei1jb250YWluZXIiPgorCSAgICAgICAgICBFbWFpbDo8YnIvPgorCSAgICAgICAgICA8aW5wdXQgY2xhc3M9ImZuLWViei10ZXh0IiB0eXBlPSJ0ZXh0IiBuZy1tb2RlbD0icG9zdFNlYXJjaEJlYW4uZW1haWwiIHZhbHVlPSIiIHNpemU9IjI1Ij4KKyAgICAgICAgICAgIDwvZGl2PgorICAgICA8YnI+Cis8IS0tICAgICAgU29ydCBCeTogPGJyLz4KKyAgICAgICAgIAk8ZGl2IGNsYXNzPSJmbi1lYnotY29udGFpbmVyIiA+CisgICAgICAgCisgCQk8ZGl2IGNsYXNzPSJmbi1lYnotY29udGFpbmVyIj4JCisJCQk8ZGl2I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tuZ2V4aXN0aW5nVXNlcnNbcHJvZmlsZS5zYmNpZF19fSIgYWx0PSJWaWV3L0VkaXQgUHJvZmlsZSI+CisgICAgICAgICAgICAgICAgICAJICB7e3Byb2ZpbGUubGFzdE5hbWV9fSwmbmJzcDt7e3Byb2ZpbGUuZmlyc3ROYW1lfX0KKwkgICAgICAgICAgICAgICAgICA8L2E+CisgICAgICAgICAgICAJICAgPC9kaXY+CisgICAgICAgICAgICAgICAKKyAgICAgICAgICAgICAgICA8L3RkPgorICAgICAgICAgICAgCTx0ZCBhdHQtdGFibGUtYm9keSB3aWR0aD0iNSUiIGFsaWduPSJsZWZ0Ij4KKyAgICAgICAgICAgICAgICB7e3Byb2ZpbGUuc2JjaWR9fQorICAgICAgICAgICAgICAgIDwvdGQ+CisgICAgICAgICAgICAJPHRkIGF0dC10YWJsZS1ib2R5IHdpZHRoPSIxMCUiIGFsaWduPSJsZWZ0Ij4KKyAgICAgICAgICAgICAgICB7e3Byb2ZpbGUub3JnQ29kZX19CisgICAgICAgICAgICAgICAgPC90ZD4KKyAgICAgICAgICAgIAk8dGQgYXR0LXRhYmxlLWJvZHkgd2lkdGg9IjIwJSIgYWxpZ249ImxlZnQiPgorICAgICAgICAgICAgICAgIHt7cHJvZmlsZS5waG9uZX19CisgICAgICAgICAgICAgICAgPC90ZD4KKyAgICAgICAgICAgIAk8dGQgYXR0LXRhYmxlLWJvZHkgd2lkdGg9IjIwJSIgYWxpZ249ImxlZnQiPgorICAgICAgICAgICAgICAgIHt7cHJvZmlsZS5lbWFpbH19CisgICAgICAgICAgICAgICAgPC90ZD4KKyAgICAgICAgICAgICAgICAKKyAgICAgICAgICAgIAk8dGQgYXR0LXRhYmxlLWJvZHkgd2lkdGg9IjEwJSIgYWxpZ249ImxlZnQiPgorCQkgICAgICAgICAgICA8ZGl2IG5nLWlmPSJuZ2V4aXN0aW5nVXNlcnNbcHJvZmlsZS5zYmNpZF0gPT0gbnVsbCI+CisJCSAgICAgICAgICAgIAk8Z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KysgYi9lY29tcC1wb3J0YWwtQkUvd2FyL1dFQi1JTkYvZnVzaW9uL2pzcC9wcm9maWxlX3NlYXJjaC5qc3AKQEAgLTAsMCArMSwxMDAgQEAKKzwlLS0KKyAgPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKyAgZUNPTVAgUG9ydGFsCisgID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisgIENvcHlyaWdodCAoQykgMjAxNyBBVCZUIEludGVsbGVjdHVhbCBQcm9wZXJ0eQorICA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorICBMaWNlbnNlZCB1bmRlciB0aGUgQXBhY2hlIExpY2Vuc2UsIFZlcnNpb24gMi4wICh0aGUgIkxpY2Vuc2UiKTsKKyAgeW91IG1heSBub3QgdXNlIHRoaXMgZmlsZSBleGNlcHQgaW4gY29tcGxpYW5jZSB3aXRoIHRoZSBMaWNlbnNlLgorICBZb3UgbWF5IG9idGFpbiBhIGNvcHkgb2YgdGhlIExpY2Vuc2UgYXQKKyAgCisgICAgICAgaHR0cDovL3d3dy5hcGFjaGUub3JnL2xpY2Vuc2VzL0xJQ0VOU0UtMi4wCisgIAorICBVbmxlc3MgcmVxdWlyZWQgYnkgYXBwbGljYWJsZSBsYXcgb3IgYWdyZWVkIHRvIGluIHdyaXRpbmcsIHNvZnR3YXJlCisgIGRpc3RyaWJ1dGVkIHVuZGVyIHRoZSBMaWNlbnNlIGlzIGRpc3RyaWJ1dGVkIG9uIGFuICJBUyBJUyIgQkFTSVMsCisgIFdJVEhPVVQgV0FSUkFOVElFUyBPUiBDT05ESVRJT05TIE9GIEFOWSBLSU5ELCBlaXRoZXIgZXhwcmVzcyBvciBpbXBsaWVkL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W49ZmFsc2U7CisJfQorICAgICRzY29wZS5lZGl0Um93ID0gZnVuY3Rpb24ocHJvZmlsZUlkKXsKKyAgICAgICAgd2luZG93LmxvY2F0aW9uID0gJ3Byb2ZpbGU/cHJvZmlsZV9pZD0nICsgcHJvZmlsZUlkOworICAgIH0KKyAgIAorICAgICRzY29wZS50b2dnbGVQcm9maWxlQWN0aXZlID0gZnVuY3Rpb24ocHJvZmlsZUlkKSB7CisgICAgCWlmIChjb25maXJtKCJZb3UgYXJlIGFib3V0IHRvIGNoYW5nZSB1c2VyJ3MgYWN0aXZlIHN0YXR1cy4gRG8geW91IHdhbnQgdG8gY29udGludWU/IikpIHsKKyAgICAgICAgICAgICAgICAgJGh0dHAuZ2V0KCJwcm9maWxlL3RvZ2dsZVByb2ZpbGVBY3RpdmU/cHJvZmlsZV9pZD0iK3Byb2ZpbGVJZCkuc3VjY2VzcyhmdW5jdGlvbigpe30pOworICAgIAl9CisgICAgfTsKKworfSk7Cis8L3NjcmlwdD4KZGlmZiAtLWdpdCBhL2Vjb21wLXBvcnRhbC1CRS93YXIvV0VCLUlORi9mdXNpb24vanNwL3JvbGUuanNwIGIvZWNvbXAtcG9ydGFsLUJFL3dhci9XRUItSU5GL2Z1c2lvbi9qc3Avcm9sZS5qc3AKbmV3IGZpbGUgbW9kZSAxMDA2NDQKaW5kZXggMDAwMDAwMC4uZTFjMTAwZAotLS0gL2Rldi9udWxsCisrKyBiL2Vjb21wLXBvcnRhbC1CRS93YXIvV0VCLUlORi9mdXNpb24vanNwL3JvbGUuanNwCkBAIC0wLDAgKzEsMjk4IEBACis8JS0tCisgID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisgIGVDT01QIFBvcnRhbAorICA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorICBDb3B5cml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mNlID0gJG1vZGFsLm9wZW4oeworCQkJICAgIHRlbXBsYXRlVXJsOiAncm9sZV9mdW5jdGlvbnNfcG9wdXAuaHRtbCcsCisJCQkgICAgY29udHJvbGxlcjogJ3JvbGVwb3B1cENvbnRyb2xsZXInLAorCQkJICAgIHJlc29sdmU6IHsKKwkJCSAgICAJcm9sZTogZnVuY3Rpb24gKCkgeworCQkJICAgICAgICAgIHJldHVybiAkc2NvcGUucm9sZTsKKwkJCSAgICAgICAgfQkJCQkJCisJCQkgICAgICB9CisJCQkgIH0pOyAKKwkJCW1vZGFsSW5zdGFuY2UucmVzdWx0LnRoZW4oZnVuY3Rpb24ocmVzcG9uc2UpeworCSAgICAgICAgICAgIGNvbnNvbGUubG9nKCdyZXNwb25zZScsIHJlc3BvbnNlKTsKKwkgICAgICAgICAgICAkc2NvcGUucm9sZT1yZXNwb25zZS5yb2xlOworCSAgICAgICAgfSk7CisJCX07CisJCQorCQkkc2NvcGUuYWRkTmV3Q2hpbGRSb2xlTW9kYWxQb3B1cCA9IGZ1bmN0aW9uKCkgeworCQkJdmFyIG1vZGFsSW5zdGFuY2UgPSAkbW9kYWwub3Blbih7CisJCQkgICAgdGVtcGxhdGVVcmw6ICdjaGlsZF9yb2xlc19wb3B1cC5odG1sJywKKwkJCSAgICBjb250cm9sbGVyOiAncm9sZXBvcHVwQ29udHJvbGxlcicsCisJCQkgICAgcmVzb2x2ZTogeworCQkJICAgIAlyb2xlOiBmdW5jdGlvbiAoKSB7CisJCQkgICAgICAgICAgcmV0dXJuICRzY29wZS5yb2xlOworCQkJICAgICAgICB9CQkJCQkKKwkJCSAgICAgIH0KKwkJCSAgfSk7IAorCQkJbW9kYWxJbnN0YW5jZS5yZXN1bHQudGhlbihmdW5jdGlvbihyZXNwb25zZSl7CisJICAgICAgICAgICAgY29uc29sZS5sb2coJ3Jlc3BvbnNlJywgcmVzcG9uc2UpOworCSAgICAgICAgICAgICRzY29wZS5yb2xlPXJlc3BvbnNlLnJvbGU7CisJ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nJvciA6IGZ1bmN0aW9uKGRhdGEpeworCQkJCQkJIGNvbnNvbGUubG9nKGRhdGEpOworCQkJCQkJIGFsZXJ0KCJFcnJvciB3aGlsZSBkZWxldGluZzogIisgZGF0YS5yZXNwb25zZVRleHQpOworCQkJCQkgfQorCQkJICAJICB9KTsKKwkJCX0KKwkJCQorCQl9OworCQkKKworfSk7Cis8L3NjcmlwdD4KZGlmZiAtLWdpdCBhL2Vjb21wLXBvcnRhbC1CRS93YXIvV0VCLUlORi9mdXNpb24vanNwL3JvbGVfbGlzdC5qc3AgYi9lY29tcC1wb3J0YWwtQkUvd2FyL1dFQi1JTkYvZnVzaW9uL2pzcC9yb2xlX2xpc3QuanNwCm5ldyBmaWxlIG1vZGUgMTAwNjQ0CmluZGV4IDAwMDAwMDAuLmYzNWQ5NzUKLS0tIC9kZXYvbnVsbAorKysgYi9lY29tcC1wb3J0YWwtQkUvd2FyL1dFQi1JTkYvZnVzaW9uL2pzcC9yb2xlX2xpc3QuanNwCkBAIC0wLDAgKzEsMTQ3IEBACis8JS0tCisgID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisgIGVDT01QIFBvcnRhbAorICA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorICBDb3B5cmlnaHQgKEMpIDIwMTcgQVQmVCBJbnRlbGxlY3R1YWwgUHJvcGVydHkKKyAgPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKyAgTGljZW5zZWQgdW5kZXIgdGhlIEFwYWNoZSBMaWNlbnNlLCBWZXJzaW9uIDIuMCAodGhlICJMaWNlbnNlIik7CisgIHlvdSBtYXkgbm90IHVzZSB0aGlzIGZpbGUgZXhjZXB0IGluIGNvbXBsaWF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9yIHdoaWxlIGRlbGV0aW5nOiAiKyBkYXRhLnJlc3BvbnNlVGV4dCk7CisJCQkJCSB9CisJCQkgIAkgIH0pOworCQkJfQorCQkJCisJCX07CisJCQorCit9KTsKKzwvc2NyaXB0PgpkaWZmIC0tZ2l0IGEvZWNvbXAtcG9ydGFsLUJFL3dhci9XRUItSU5GL2Z1c2lvbi9qc3AvdXNhZ2VfbGlzdC5qc3AgYi9lY29tcC1wb3J0YWwtQkUvd2FyL1dFQi1JTkYvZnVzaW9uL2pzcC91c2FnZV9saXN0LmpzcApuZXcgZmlsZSBtb2RlIDEwMDY0NAppbmRleCAwMDAwMDAwLi4xMWUyNDM5Ci0tLSAvZGV2L251bGwKKysrIGIvZWNvbXAtcG9ydGFsLUJFL3dhci9XRUItSU5GL2Z1c2lvbi9qc3AvdXNhZ2VfbGlzdC5qc3AKQEAgLTAsMCArMSw5OSBAQAorPCUtLQorICA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorICBlQ09NUCBQb3J0YWwKKyAgPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKyAgQ29weXJpZ2h0IChDKSAyMDE3IEFUJlQgSW50ZWxsZWN0dWFsIFByb3BlcnR5CisgID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisgIExpY2Vuc2VkIHVuZGVyIHRoZSBBcGFjaGUgTGljZW5zZSwgVmVyc2lvbiAyLjAgKHRoZSAiTGljZW5zZSIpOworICB5b3UgbWF5IG5vdCB1c2UgdGhpcyBmaWxlIGV4Y2VwdCBpbiBjb21wbGlhbmNlIHdpdGggdGhlIExpY2Vuc2UuCisgIFlvdSBtYXkgb2J0YWluIGEgY29weSBvZiB0aGUgTGljZW5z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lIGFwcGxpY2F0aW9uLiBBbGwgb2YgdGhlaXIgdW5zYXZlZCBkYXRhIHdpbGwgYmUgbG9zdC4gRG8geW91IHdhbnQgdG8gY29udGludWU/IikpeworCQkJJGh0dHAuZ2V0KCJ1c2FnZV9saXN0L3JlbW92ZVNlc3Npb24/ZGVsZXRlU2Vzc2lvbklkPSIrc2Vzc2lvbklkKS5zdWNjZXNzKGZ1bmN0aW9uKHJlc3BvbnNlKXskc2NvcGUudXNlcnM9cmVzcG9uc2U7fSk7CisJCX0KKwl9Cit9KTsKKzwvc2NyaXB0PgpkaWZmIC0tZ2l0IGEvZWNvbXAtcG9ydGFsLUJFL3dhci9XRUItSU5GL2Z1c2lvbi9qc3Avd2VicnRjL2NvbGxhYm9yYXRpb24uanNwIGIvZWNvbXAtcG9ydGFsLUJFL3dhci9XRUItSU5GL2Z1c2lvbi9qc3Avd2VicnRjL2NvbGxhYm9yYXRpb24uanNwCm5ldyBmaWxlIG1vZGUgMTAwNjQ0CmluZGV4IDAwMDAwMDAuLmIwNDgwZDQKLS0tIC9kZXYvbnVsbAorKysgYi9lY29tcC1wb3J0YWwtQkUvd2FyL1dFQi1JTkYvZnVzaW9uL2pzcC93ZWJydGMvY29sbGFib3JhdGlvbi5qc3AKQEAgLTAsMCArMSw1MjkgQEAKKzwlLS0KKyAgPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKyAgZUNPTVAgUG9ydGFsCisgID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisgIENvcHlyaWdodCAoQykgMjAxNyBBVCZUIEludGVsbGVjdHVhbCBQcm9wZXJ0eQorICA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorICBMaWNlbnNlZ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c2UsZmFsc2UsdHJ1ZSxmYWxzZSx0cnVlKTsKKwkgICAgCQorCSAgICB9OworCSAgICAKKwkgICAgZnVuY3Rpb24gY29uZmlnQ29ubmVjdGlvbihfY29ubmVjdGlvbiwgX2F1ZGlvLCBfdmlkZW8sIF9zY3JlZW4sIF9kYXRhLCBfb25ld2F5KSB7CisJICAgIAkgX2Nvbm5lY3Rpb24uc2Vzc2lvbiA9IHsKKwkgICAgICAgICAgICAgICAgIGF1ZGlvOiAgICAgX2F1ZGlvLCAvLyBieSBkZWZhdWx0LCBpdCBpcyB0cnVlCisJICAgICAgICAgICAgICAgICB2aWRlbzogICAgIF92aWRlbywgLy8gYnkgZGVmYXVsdCwgaXQgaXMgdHJ1ZQorCSAgICAgICAgICAgICAgICAgc2NyZWVuOiAgICBfc2NyZWVuLAorCSAgICAgICAgICAgICAgICAgZGF0YTogICAgICBfZGF0YSwKKwkgICAgICAgICAgICAgICAgIG9uZXdheTogICAgX29uZXdheSwKKwkgICAgICAgICAgICAgICAgIGJyb2FkY2FzdDogZmFsc2UKKwkgICAgICAgICAgICB9OworCSAgICAJIAorCSAgICAJIF9jb25uZWN0aW9uLmRpcmVjdGlvbiA9ICJvbmUtdG8tb25lIjsKKwkgICAgCSAKKwkgICAgCSBpZiggX2RhdGEgPT0gdHJ1ZSApIHsKKwkgICAgCSBfY29ubmVjdGlvbi5vbm1lc3NhZ2UgPSBmdW5jdGlvbihlKSB7CisJICAgICAgICAgICAgIGFwcGVuZERJVihlLmRhdGEpOworCisJICAgICAgICAgICAgIGNvbnNvbGUuZGVidWcoZS51c2VyaWQsICdwb3N0ZWQnLCBlLmRhdGEpOworCSAgICAgICAgICAgICBjb25zb2xlLmxvZygnbGF0ZW5jeTonLCBlLmxhdGVuY3ksICdtcycpOworCSAgICAgICAgIH07CisJICAgIAkgfQorCSAgICAKKwkgICAgIAorCSAgICB9OyAKKwkgICAgCisJICAgIGZ1bmN0aW9uIGFzc2lnblN0cmVhbVRvRG9tKCkgewor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Gg7aSsrKSB7CisJICAgIAkJCSBpZih1c2VyTGlzdFtpXSAhPT0gY3VycmVudFVzZXIpIHsKKwkgICAgCQkJCSByZW1vdGVVc2VyID0gdXNlckxpc3RbaV07CisJICAgIAkJCQkgYnJlYWs7CisJICAgIAkJCSB9CisJICAgIAkJIH0KKwkgICAgCQkKKwkgICAgCQlzb2NrZXRTZXR1cChpbml0aWFsUGFnZVZpc2l0LCBjdXJyZW50VXNlciwgcmVtb3RlVXNlciwic29ja2V0U2VuZCIpOworCSAgICAJCQorCSAgICAJCSAKKwkgICAgCQkgCisJICAgIAkJIAorCSAgICAJCisJICAgIAkgCisJICAgICB9OworCSAgICAgCisJICAgICBmdW5jdGlvbiBtYWtlQ2hhdFZpc2libGUoKSB7CisJICAgIAkgCisJICAgIAkgJCgnI2NoYXQtaW5wdXQnKS5jc3MoInZpc2liaWxpdHkiLCAndmlzaWJsZScpOyAgICAJIAorCSAgICAgfTsKKwkgICAgIAorCSAgICAgZnVuY3Rpb24gc3JjRGVzdGluYXRpb25TZXNzaW9uQWN0aW9uKCkgeworCSAgICAJIHZhciB1cmwgPSB3aW5kb3cubG9jYXRpb24uaHJlZjsKKwkgICAgCSB2YXIgY2hhdElkID0gIiI7CisJICAgIAkgCisJICAgIAkgdHJ5eyAKKwkgICAgCQkgY2hhdElkID0gdXJsLnNwbGl0KCJjaGF0X2lkPSIpWzFdOyAKKwkgICAgCSB9CQorCSAgICAJIGNhdGNoKGVycikgeworCSAgICAJCSBjaGF0SWQgPSIiOworCSAgICAJIH0KKwkgICAgCSAvLyB3aW5kb3cubG9jYWxTdG9yYWdlLmdldEl0ZW0oY2hhdElkKSA9PSAic291cmNlIgorCSAgICAJIGlmKGNoYXRJZCAhPSAiIiAmJiBnZXRDb29raWUoY2hhdElkKSA9PSAic291cmNlIikgeworCSAgICAJCSBzdGFydFNlc3Npb24oKTsKKwkgICAgCQkgc2V0Q29va2llKGNoYXRJZCwiIiwtMSk7CisJICAgIAkJIC8vd2luZG93L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dW5jdGlvbiBzZXRDb29raWUoY25hbWUsY3ZhbHVlLGV4ZGF5cykgeworCSAgICAJICAgIHZhciBkID0gbmV3IERhdGUoKTsKKwkgICAgCSAgICBkLnNldFRpbWUoZC5nZXRUaW1lKCkgKyAoZXhkYXlzKjI0KjYwKjYwKjEwMDApKTsKKwkgICAgCSAgICB2YXIgZXhwaXJlcyA9ICJleHBpcmVzPSIgKyBkLnRvR01UU3RyaW5nKCk7CisJICAgIAkgICAgZG9jdW1lbnQuY29va2llID0gY25hbWUgKyAiPSIgKyBjdmFsdWUgKyAiOyIgKyBleHBpcmVzICsgIjtwYXRoPS8iOworCSAgICAJfQorCisJICAgIAlmdW5jdGlvbiBnZXRDb29raWUoY25hbWUpIHsKKwkgICAgCSAgICB2YXIgbmFtZSA9IGNuYW1lICsgIj0iOworCSAgICAJICAgIHZhciBkZWNvZGVkQ29va2llID0gZGVjb2RlVVJJQ29tcG9uZW50KGRvY3VtZW50LmNvb2tpZSk7CisJICAgIAkgICAgdmFyIGNhID0gZGVjb2RlZENvb2tpZS5zcGxpdCgnOycpOworCSAgICAJICAgIGZvcih2YXIgaSA9IDA7IGkgPCBjYS5sZW5ndGg7IGkrKykgeworCSAgICAJICAgICAgICB2YXIgYyA9IGNhW2ldOworCSAgICAJICAgICAgICB3aGlsZSAoYy5jaGFyQXQoMCkgPT0gJyAnKSB7CisJICAgIAkgICAgICAgICAgICBjID0gYy5zdWJzdHJpbmcoMSk7CisJICAgIAkgICAgICAgIH0KKwkgICAgCSAgICAgICAgaWYgKGMuaW5kZXhPZihuYW1lKSA9PSAwKSB7CisJICAgIAkgICAgICAgICAgICByZXR1cm4gYy5zdWJzdHJpbmcobmFtZS5sZW5ndGgsIGMubGVuZ3RoKTsKKwkgICAgCSAgICAgICAgfQorCSAgICAJICAgIH0KKwkgICAgCSAgICByZXR1cm4gIiI7CisJICAgIAl9CisJICAgIAorCSAgICAKKwkgICAgCisJICAgICAvKiBvbiBjbGljayBidXR0b24gZW5hYmx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09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisgIGVDT01QIFBvcnRhbAorICA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorICBDb3B5cmlnaHQgKEMpIDIwMTcgQVQmVCBJbnRlbGxlY3R1YWwgUHJvcGVydHkKKyAgPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKyAgTGljZW5zZWQgdW5kZXIgdGhlIEFwYWNoZSBMaWNlbnNlLCBWZXJzaW9uIDIuMCAodGhlICJMaWNlbnNlIik7CisgIHlvdSBtYXkgbm90IHVzZSB0aGlzIGZpbGUgZXhjZXB0IGluIGNvbXBsaWFuY2Ugd2l0aCB0aGUgTGljZW5zZS4KKyAgWW91IG1heSBvYnRhaW4gYSBjb3B5IG9mIHRoZSBMaWNlbnNlIGF0CisgIAorICAgICAgIGh0dHA6Ly93d3cuYXBhY2hlLm9yZy9saWNlbnNlcy9MSUNFTlNFLTIuMAorICAKKyAgVW5sZXNzIHJlcXVpcmVkIGJ5IGFwcGxpY2FibGUgbGF3IG9yIGFncmVlZCB0byBpbiB3cml0aW5nLCBzb2Z0d2FyZQorICBkaXN0cmlidXRlZCB1bmRlciB0aGUgTGljZW5zZSBpcyBkaXN0cmlidXRlZCBvbiBhbiAiQVMgSVMiIEJBU0lTLAorICBXSVRIT1VUIFdBUlJBTlRJRVMgT1IgQ09ORElUSU9OUyBPRiBBTlkgS0lORCwgZWl0aGVyIGV4cHJlc3Mgb3IgaW1wbGllZC4KKyAgU2VlIHRoZSBMaWNlbnNlIGZvciB0aGUgc3BlY2lmaWMgbGFuZ3VhZ2UgZ292ZXJuaW5nIHBlcm1pc3Npb25zIGFuZAorICBsaW1pdGF0aW9ucyB1bmRlciB0aGUgTGljZW5zZS4KKyAgPT09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1hcHBpbmc+ClwgTm8gbmV3bGluZSBhdCBlbmQgb2YgZmlsZQpkaWZmIC0tZ2l0IGEvZWNvbXAtcG9ydGFsLUJFL3dhci9XRUItSU5GL2Z1c2lvbi9vcm0vRnVzaW9uLmhibS54bWwgYi9lY29tcC1wb3J0YWwtQkUvd2FyL1dFQi1JTkYvZnVzaW9uL29ybS9GdXNpb24uaGJtLnhtbApuZXcgZmlsZSBtb2RlIDEwMDY0NAppbmRleCAwMDAwMDAwLi41M2M0NWI3Ci0tLSAvZGV2L251bGwKKysrIGIvZWNvbXAtcG9ydGFsLUJFL3dhci9XRUItSU5GL2Z1c2lvbi9vcm0vRnVzaW9uLmhibS54bWwKQEAgLTAsMCArMSwzNzIgQEAKKzw/eG1sIHZlcnNpb249IjEuMCI/PgorPCEtLQorICA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorICBlQ09NUCBQb3J0YWwKKyAgPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKyAgQ29weXJpZ2h0IChDKSAyMDE3IEFUJlQgSW50ZWxsZWN0dWFsIFByb3BlcnR5CisgID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisgIExpY2Vuc2VkIHVuZGVyIHRoZSBBcGFjaGUgTGljZW5zZSwgVmVyc2lvbiAyLjAgKHRoZSAiTGljZW5zZSIpOworICB5b3UgbWF5IG5vdCB1c2UgdGhpcyBmaWxlIGV4Y2VwdCBpbiBjb21wbGlhbmNlIHdpdGggdGhlIExpY2Vuc2UuCisgIFlvdSBtYXkgb2J0YWluIGEgY29weSBvZiB0aGUgTGljZW5zZSBhdAorICAKKyAgICAgICBodHRwOi8vd3d3LmFwYWNoZS5vcmcvbGljZW5zZX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5lcmF0b3IgY2xhc3M9Im5hdGl2ZSI+CisgICAgICAgICAgICAgPHBhcmFtIG5hbWU9InNlcXVlbmNlIj5zZXFfZm5fbWVudTwvcGFyYW0+IAorICAgICAgICAgIDwvZ2VuZXJhdG9yPgorICAgICAgICA8L2lkPgorCisgICAgICAgICA8cHJvcGVydHkgbmFtZT0ibWVudUxldmVsIiAgIGNvbHVtbj0ibGV2ZWwtMSIvPgorICAgICAgICAgPHByb3BlcnR5IG5hbWU9ImxhYmVsIiAgICAgICBjb2x1bW49ImxhYmVsIi8+CisgICAgICAgICA8cHJvcGVydHkgbmFtZT0icGFyZW50SWQiICAgIGNvbHVtbj0icGFyZW50X2lkIi8+CisgICAgICAgICA8cHJvcGVydHkgbmFtZT0iYWN0aW9uIiAgICAgIGNvbHVtbj0iYWN0aW9uIi8+CisgICAgICAgICA8cHJvcGVydHkgbmFtZT0iZnVuY3Rpb25DZCIgIGNvbHVtbj0iZnVuY3Rpb25fY2QiLz4KKyAgICAgICAgIDxwcm9wZXJ0eSBuYW1lPSJzb3J0T3JkZXIiICAgY29sdW1uPSJzb3J0X29yZGVyIi8+CisgICAgICAgICA8cHJvcGVydHkgbmFtZT0ic2VydmxldCIgICAgIGNvbHVtbj0ic2VydmxldCIvPgorICAgICAgICAgPHByb3BlcnR5IG5hbWU9InF1ZXJ5U3RyaW5nIiBjb2x1bW49InF1ZXJ5X3N0cmluZyIvPgorICAgICAgICAgPHByb3BlcnR5IG5hbWU9ImV4dGVybmFsVXJsIiBjb2x1bW49ImV4dGVybmFsX3VybCIvPgorICAgICAgICAgPHByb3BlcnR5IG5hbWU9InRhcmdldCIgICAgICBjb2x1bW49InRhcmdldCIvPgorICAgICAgICAgPHByb3BlcnR5IG5hbWU9ImFjdGl2ZSIgICAgICBjb2x1bW49ImFjdGl2ZV95biIgICAgdHlwZT0ieWVzX25vIi8+CisgICAgICAgICA8cHJvcGVydHkgbmFtZT0ic2VwYXJhdG9yIiAgIGNvbHVtbj0ic2VwYX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dGEiPgorICAgICAgZnJvbSBFdmVudFdpZGdldCBvcmRlciBieSBzb3J0T3JkZXIKKyAgICA8L3F1ZXJ5PiAtLT4KKwkKKyAgICAKKzwvaGliZXJuYXRlLW1hcHBpbmc+CisJCmRpZmYgLS1naXQgYS9lY29tcC1wb3J0YWwtQkUvd2FyL1dFQi1JTkYvZnVzaW9uL29ybS9Xb3JrZmxvdy5oYm0ueG1sIGIvZWNvbXAtcG9ydGFsLUJFL3dhci9XRUItSU5GL2Z1c2lvbi9vcm0vV29ya2Zsb3cuaGJtLnhtbApuZXcgZmlsZSBtb2RlIDEwMDY0NAppbmRleCAwMDAwMDAwLi42OWMxOWRiCi0tLSAvZGV2L251bGwKKysrIGIvZWNvbXAtcG9ydGFsLUJFL3dhci9XRUItSU5GL2Z1c2lvbi9vcm0vV29ya2Zsb3cuaGJtLnhtbApAQCAtMCwwICsxLDQ4IEBACis8P3htbCB2ZXJzaW9uPSIxLjAiPz4KKzwhLS0KKyAgPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKyAgZUNPTVAgUG9ydGFsCisgID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisgIENvcHlyaWdodCAoQykgMjAxNyBBVCZUIEludGVsbGVjdHVhbCBQcm9wZXJ0eQorICA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorICBMaWNlbnNlZCB1bmRlciB0aGUgQXBhY2hlIExpY2Vuc2UsIFZlcnNpb24gMi4wICh0aGUgIkxpY2Vuc2UiKTsKKyAgeW91IG1heSBub3QgdXNlIHRoaXMgZmlsZSBleGNlcHQgaW4gY29tcGxpYW5jZSB3aXRoIHRoZSBMaWNlbnNlLgorICBZb3UgbWF5IG9idGF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DA2NDQKaW5kZXggMDAwMDAwMC4uZTE4OTVkMgotLS0gL2Rldi9udWxsCisrKyBiL2Vjb21wLXBvcnRhbC1CRS93YXIvV0VCLUlORi9mdXNpb24vcmFwdG9yL3JlcG9ydF9zZWFyY2guanNwCkBAIC0wLDAgKzEsMjAgQEAKKzwlLS0KKyAgPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKyAgZUNPTVAgUG9ydGFsCisgID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisgIENvcHlyaWdodCAoQykgMjAxNyBBVCZUIEludGVsbGVjdHVhbCBQcm9wZXJ0eQorICA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorICBMaWNlbnNlZCB1bmRlciB0aGUgQXBhY2hlIExpY2Vuc2UsIFZlcnNpb24gMi4wICh0aGUgIkxpY2Vuc2UiKTsKKyAgeW91IG1heSBub3QgdXNlIHRoaXMgZmlsZSBleGNlcHQgaW4gY29tcGxpYW5jZSB3aXRoIHRoZSBMaWNlbnNlLgorICBZb3UgbWF5IG9idGFpbiBhIGNvcHkgb2YgdGhlIExpY2Vuc2UgYXQKKyAgCisgICAgICAgaHR0cDovL3d3dy5hcGFjaGUub3JnL2xpY2Vuc2VzL0xJQ0VOU0UtMi4wCisgIAorICBVbmxlc3MgcmVxdWlyZWQgYnkgYXBwbGljYWJsZSBsYXcgb3IgYWdyZWVkIHRvIGluIHdyaXRpbmcsIHNvZnR3YXJlCisgIGRpc3RyaWJ1dGVkIHVuZGVyIHRoZSBMaWNlbnNlIGlzIGRpc3RyaWJ1dGVkIG9uIGFuICJBUyBJUyIgQkFTSVMsCisgIFdJVEhPVVQgV0FSUkFOVElFUyBPUiBDT05ESVRJT05TIE9GIEFOWSBLSU5ELCBlaXRoZXIgZXhwcmVzcyBvciBpbXBsaWVkLgorICBTZWUgdGhlIExpY2Vuc2UgZm9yIHRoZSBzcGVjaWZpYyBsYW5ndWFnZSBnb3Zlcm5pbmcgcGVybWlzc2lvbnMgYW5kCisgIGxpbWl0YXRpb25zIHVuZGVyIHRoZSBMaWNlbnNlLgorICA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorICAtLSU+CitIZWxsbyB3b3JsZApkaWZmIC0tZ2l0IGEvZWNvbXAtcG9ydGFsLUJFL3dhci9XRUItSU5GL2pzcC9lcnJvci5qc3AgYi9lY29tcC1wb3J0YWwtQkUvd2FyL1dFQi1JTkYvanNwL2Vycm9yLmpzcApuZXcgZmlsZSBtb2RlIDEwMDY0NAppbmRleCAwMDAwMDAwLi5jNzlhYTg5Ci0tLSAvZGV2L251bGwKKysrIGIvZWNvbXAtcG9ydGFsLUJFL3dhci9XRUItSU5GL2pzcC9lcnJvci5qc3AKQEAgLTAsMCArMSwyMCBAQAorPCUtLQorICA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorICBlQ09NUCBQb3J0YWwKKyAgPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKyAgQ29weXJpZ2h0IChDKSAyMDE3IEFUJlQgSW50ZWxsZWN0dWFsIFByb3BlcnR5CisgID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisgIExpY2Vuc2VkIHVuZGVyIHRoZSBBcGFjaGUgTGljZW5zZSwgVmVyc2lvbiAyLjAgKHRoZSAiTGljZW5zZSIpOworICB5b3UgbWF5IG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PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorICBlQ09NUCBQb3J0YWwKKyAgPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKyAgQ29weXJpZ2h0IChDKSAyMDE3IEFUJlQgSW50ZWxsZWN0dWFsIFByb3BlcnR5CisgID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisgIExpY2Vuc2VkIHVuZGVyIHRoZSBBcGFjaGUgTGljZW5zZSwgVmVyc2lvbiAyLjAgKHRoZSAiTGljZW5zZSIpOworICB5b3UgbWF5IG5vdCB1c2UgdGhpcyBmaWxlIGV4Y2VwdCBpbiBjb21wbGlhbmNlIHdpdGggdGhlIExpY2Vuc2UuCisgIFlvdSBtYXkgb2J0YWluIGEgY29weSBvZiB0aGUgTGljZW5zZSBhdAorICAKKyAgICAgICBodHRwOi8vd3d3LmFwYWNoZS5vcmcvbGljZW5zZXMvTElDRU5TRS0yLjAKKyAgCisgIFVubGVzcyByZXF1aXJlZCBieSBhcHBsaWNhYmxlIGxhdyBvciBhZ3JlZWQgdG8gaW4gd3JpdGluZywgc29mdHdhcmUKKyAgZGlzdHJpYnV0ZWQgdW5kZXIgdGhlIExpY2Vuc2UgaXMgZGlzdHJpYnV0ZWQgb24gYW4gIkFTIElTIiBCQVNJUywKKyAgV0lUSE9VVCBXQVJSQU5USUVTIE9SIENPTkRJVElPTlMgT0YgQU5ZIEtJTkQsIGVpdGhlciBleHByZXNzIG9yIGltcGxpZWQuCisgIFNlZSB0aGUgTGljZW5zZSBmb3IgdGhlIHNwZWNpZmljIGxhbmd1YWdlIGdvdmVybmluZyBwZXJtaXNzaW9ucyBhbmQKKyAgbGltaXRhdGlvbnMgdW5kZXIgdGhlIExpY2Vuc2UuCisgID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisgIC0tJT4KKzwlQCB0YWdsaWIgcHJlZml4PSJjIiAgICAgIHVyaT0iaHR0cDovL2phdmEuc3VuLmNvbS9qc3AvanN0bC9jb3JlIiAlPgorPGM6cmVkaXJlY3QgdXJsPSIvaW5kZXguaHRtbCIvPgpkaWZmIC0tZ2l0IGEvZWNvbXAtcG9ydGFsLUJFL3dhci9XRUItSU5GL2pzcC9sb2dpbi5qc3AgYi9lY29tcC1wb3J0YWwtQkUvd2FyL1dFQi1JTkYvanNwL2xvZ2luLmpzcApuZXcgZmlsZSBtb2RlIDEwMDY0NAppbmRleCAwMDAwMDAwLi5iZGZmYzczCi0tLSAvZGV2L251bGwKKysrIGIvZWNvbXAtcG9ydGFsLUJFL3dhci9XRUItSU5GL2pzcC9sb2dpbi5qc3AKQEAgLTAsMCArMSwxNTIgQEAKKzwlLS0KKyAgPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKyAgZUNPTVAgUG9ydGFsCisgID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisgIENvcHlyaWdodCAoQykgMjAxNyBBVCZUIEludGVsbGVjdHVhbCBQcm9wZXJ0eQorICA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorICBMaWNlbnNlZCB1bmRlciB0aGUgQXBhY2hlIExpY2Vuc2UsIFZlcnNpb24gMi4wICh0aGUgIkxpY2Vuc2UiKTsKKyAgeW91IG1heSBub3QgdXNlIHRoaXMgZmlsZSBleGNlcHQgaW4gY29tcGxpYW5jZSB3aXRoIHRoZSBMaWNlbnNlLgorICBZb3U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0aW9uLmhyZWY9ICI8JT1mcm9udFVybCU+IgorICAgICAgICAgICAgICAgICAgfWVsc2V7CisgICAgICAgICAgICAgICAgCSQoIiNlcnJvckluZm8gc3BhbiIpLnRleHQocmVzcG9uc2UpOworICAgICAgICAgICAgICAgIAkvLyQoIiNlcnJvckluZm8iKS50ZXh0ID0gcmVzcG9uc2U7CisgICAgICAgICAgICAgICAgCSQoIiNlcnJvckluZm8iKS5zaG93KCk7CisgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgfSwKKyAgICAgICAgICAgICAgICBlcnJvcjpmdW5jdGlvbigganFYSFIsIHN0YXR1cyxlcnJvciApeworICAgICAgICAgICAgICAgIAkkKCIjZXJyb3JJbmZvIikuc2hvdygpOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAKKyAgICAgICAgfSk7CisKKyAgICB9OworCS8qKgorCSRzY29wZS5sb2dpbkV4dGVybmFsID0gZnVuY3Rpb24oKSB7CisKKyAgICAgICAgCisJCSAgdmFyIHJlZGlyZWN0VXJsID0gImxvZ2luX2V4dGVybmFsL2xvZ2luIjsKKyAgICAgICAgICB2YXIgZm9ybSA9ICQoJzxmb3JtIGFjdGlvbj0iJyArIHJlZGlyZWN0VXJsICsgJyIgbWV0aG9kPSJwb3N0Ij4nICsKKyAgICAgICAgICAgICAgICAgICc8aW5wdXQgdHlwZT0iaGlkZGVuIiBuYW1lPSJsb2dpbklkIiB2YWx1ZT0nKyRzY29wZS5sb2dpbklkKycgLz4nICsKKyAgICAgICAgICAgICAgICAgICc8aW5wdXQgdHlwZT0iaGlkZGVuIiBuYW1lPSJwYXNzd29yZCIgdmFsdWU9Jyskc2NvcGUucGFzc3dvcmQrJyAvPicgKworICAgICAgICAgICAgICAgICAgJzwvZm9ybT4nKTsKKyAgICAgICAgICAgICAgICAgIAorICAgICAgICAgICAgICAgICAgJCgnYm9keScpLmFwcGVuZChmb3JtKTsKKyAgICAgICAgICAgICAgICAgICQoZm9ybSkuc3VibWl0KCk7CisgICAgICAgICAKKworICAgIH07CisgICAgKi8JCit9KTsKKzwvc2NyaXB0PgorCQorPC9odG1sPgpkaWZmIC0tZ2l0IGEvZWNvbXAtcG9ydGFsLUJFL3dhci9XRUItSU5GL2pzcC9vaWQtYWRtaW4uanNwIGIvZWNvbXAtcG9ydGFsLUJFL3dhci9XRUItSU5GL2pzcC9vaWQtYWRtaW4uanNwCm5ldyBmaWxlIG1vZGUgMTAwNjQ0CmluZGV4IDAwMDAwMDAuLjkzZmQ2OWMKLS0tIC9kZXYvbnVsbAorKysgYi9lY29tcC1wb3J0YWwtQkUvd2FyL1dFQi1JTkYvanNwL29pZC1hZG1pbi5qc3AKQEAgLTAsMCArMSw3MiBAQAorPCUtLQorICA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorICBlQ09NUCBQb3J0YWwKKyAgPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKyAgQ29weXJpZ2h0IChDKSAyMDE3IEFUJlQgSW50ZWxsZWN0dWFsIFByb3BlcnR5CisgID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisgIExpY2Vuc2VkIHVuZGVyIHRoZSBBcGFjaGUgTGljZW5zZSwgVmVyc2lvbiAyLjAgKHRoZSAiTGljZW5zZSIpOworICB5b3UgbWF5IG5vdCB1c2UgdGhpcyBmaWxlIGV4Y2VwdCBpbiBjb21wbGlhbmNlIHdpdGggdGhlIExpY2Vuc2UuCisgIFlvdSBtYXkgb2J0YWluIGEgY29weSBvZiB0aGUgTGljZW5zZSBhdAorICAKKyAgICAgICBodHRwOi8vd3d3LmFwYWNoZS5vcmcvbGljZW5zZXMvTElDRU5TRS0yLjAKKyAgCisgIFVubGVz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gQEAKKzwlLS0KKyAgPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKyAgZUNPTVAgUG9ydGFsCisgID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisgIENvcHlyaWdodCAoQykgMjAxNyBBVCZUIEludGVsbGVjdHVhbCBQcm9wZXJ0eQorICA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorICBMaWNlbnNlZCB1bmRlciB0aGUgQXBhY2hlIExpY2Vuc2UsIFZlcnNpb24gMi4wICh0aGUgIkxpY2Vuc2UiKTsKKyAgeW91IG1heSBub3QgdXNlIHRoaXMgZmlsZSBleGNlcHQgaW4gY29tcGxpYW5jZSB3aXRoIHRoZSBMaWNlbnNlLgorICBZb3UgbWF5IG9idGFpbiBhIGNvcHkgb2YgdGhlIExpY2Vuc2UgYXQKKyAgCisgICAgICAgaHR0cDovL3d3dy5hcGFjaGUub3JnL2xpY2Vuc2VzL0xJQ0VOU0UtMi4wCisgIAorICBVbmxlc3MgcmVxdWlyZWQgYnkgYXBwbGljYWJsZSBsYXcgb3IgYWdyZWVkIHRvIGluIHdyaXRpbmcsIHNvZnR3YXJlCisgIGRpc3RyaWJ1dGVkIHVuZGVyIHRoZSBMaWNlbnNlIGlzIGRpc3RyaWJ1dGVkIG9uIGFuICJBUyBJUyIgQkFTSVMsCisgIFdJVEhPVVQgV0FSUkFOVElFUyBPUiBDT05ESVRJT05TIE9GIEFOWSBLSU5ELCBlaXRoZXIgZXhwcmVzcyBvciBpbXBsaWVkLgorICBTZWUgdGhlIExpY2Vuc2UgZm9yIHRoZSBzcGVjaWZpYyBsYW5ndWFnZSBnb3Zlcm5pbmcgcGVybWlzc2lvbnMgYW5kCisgIGx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1naXQgYS9lY29tcC1wb3J0YWwtQkUvd2FyL1dFQi1JTkYvanNwL29pZC1sb2dpbi5qc3AgYi9lY29tcC1wb3J0YWwtQkUvd2FyL1dFQi1JTkYvanNwL29pZC1sb2dpbi5qc3AKbmV3IGZpbGUgbW9kZSAxMDA2NDQKaW5kZXggMDAwMDAwMC4uY2YyZjliYwotLS0gL2Rldi9udWxsCisrKyBiL2Vjb21wLXBvcnRhbC1CRS93YXIvV0VCLUlORi9qc3Avb2lkLWxvZ2luLmpzcApAQCAtMCwwICsxLDc2IEBACis8JS0tCisgID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisgIGVDT01QIFBvcnRhbAorICA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorICBDb3B5cmlnaHQgKEMpIDIwMTcgQVQmVCBJbnRlbGxlY3R1YWwgUHJvcGVydHkKKyAgPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKyAgTGljZW5zZWQgdW5kZXIgdGhlIEFwYWNoZSBMaWNlbnNlLCBWZXJzaW9uIDIuMCAodGhlICJMaWNlbnNlIik7CisgIHlvdSBtYXkgbm90IHVzZSB0aGlzIGZpbGUgZXhjZXB0IGluIGNvbXBsaWFuY2Ugd2l0aCB0aGUgTGljZW5zZS4KKyAgWW91IG1heSBvYnRhaW4gYSBjb3B5IG9mIHRoZSBMaWNlbnNlIGF0CisgIAorICAgICAgIGh0dHA6Ly93d3cuYXBhY2hlLm9yZy9saWNlbnNlcy9MSUNFTlNFLTIuMAorICAKKyAgVW5sZXNzIHJlcXVpcmVkIGJ5IGFwcGxpY2FibGUgbGF3IG9yIGFncmVlZCB0byBpbiB3cml0aW5nLCBzb2Z0d2FyZQorICBk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luZGV4IDAwMDAwMDAuLjExMjQxNWIKLS0tIC9kZXYvbnVsbAorKysgYi9lY29tcC1wb3J0YWwtQkUvd2FyL1dFQi1JTkYvanNwL29pZC11c2VyLmpzcApAQCAtMCwwICsxLDEzOSBAQAorPCUtLQorICA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorICBlQ09NUCBQb3J0YWwKKyAgPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKyAgQ29weXJpZ2h0IChDKSAyMDE3IEFUJlQgSW50ZWxsZWN0dWFsIFByb3BlcnR5CisgID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisgIExpY2Vuc2VkIHVuZGVyIHRoZSBBcGFjaGUgTGljZW5zZSwgVmVyc2lvbiAyLjAgKHRoZSAiTGljZW5zZSIpOworICB5b3UgbWF5IG5vdCB1c2UgdGhpcyBmaWxlIGV4Y2VwdCBpbiBjb21wbGlhbmNlIHdpdGggdGhlIExpY2Vuc2UuCisgIFlvdSBtYXkgb2J0YWluIGEgY29weSBvZiB0aGUgTGljZW5zZSBhdAorICAKKyAgICAgICBodHRwOi8vd3d3LmFwYWNoZS5vcmcvbGljZW5zZXMvTElDRU5TRS0yLjAKKyAgCisgIFVubGVzcyByZXF1aXJlZCBieSBhcHBsaWNhYmxlIGxhdyBvciBhZ3JlZWQgdG8gaW4gd3JpdGluZywgc29mdHdhcmUKKyAgZGlzdHJpYnV0ZWQgdW5kZXIgdGhlIExpY2Vuc2UgaXMgZGlzdHJpYnV0ZWQgb24gYW4gIkFTIElTIiBCQVNJUywKKyAgV0lUSE9VVCBXQVJSQU5USUVTIE9SIENPTkRJVElPTlMgT0YgQU5ZIEtJTkQsIGVpdGhlciBleHBy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kJCX0gZWxzZSB7CisJCQkJJCgnI2lkVG9rZW5IZWFkZXIgdGJvZHknKS5hcHBlbmQoJzx0cj48dGQ+JyArIF8uZXNjYXBlKGtleSkgKyAnPC90ZD48dGQ+JyArIF8uZXNjYXBlKHZhbCkgKyAnPC90ZD48L3RyPicpOworCQkJfQorCQl9KTsKKwkJCisJCXZhciB1c2VySW5mbyA9ICR7IHVzZXJJbmZvSnNvbiB9OworCQlfLmVhY2godXNlckluZm8sIGZ1bmN0aW9uKHZhbCwga2V5LCBsaXN0KSB7CisJCQkkKCcjdXNlckluZm9UYWJsZSB0Ym9keScpLmFwcGVuZCgnPHRyPjx0ZD4nICsgXy5lc2NhcGUoa2V5KSArICc8L3RkPjx0ZD4nICsgXy5lc2NhcGUodmFsKSArICc8L3RkPjwvdHI+Jyk7CisJCX0pOworCX0pOworCis8L3NjcmlwdD4KKworPG86Zm9vdGVyIC8+CmRpZmYgLS1naXQgYS9lY29tcC1wb3J0YWwtQkUvd2FyL1dFQi1JTkYvanNwL3dlbGNvbWUuanNwIGIvZWNvbXAtcG9ydGFsLUJFL3dhci9XRUItSU5GL2pzcC93ZWxjb21lLmpzcApuZXcgZmlsZSBtb2RlIDEwMDY0NAppbmRleCAwMDAwMDAwLi4wNTRjMzhmCi0tLSAvZGV2L251bGwKKysrIGIvZWNvbXAtcG9ydGFsLUJFL3dhci9XRUItSU5GL2pzcC93ZWxjb21lLmpzcApAQCAtMCwwICsxLDY5NSBAQAorPCUtLQorICA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorICBlQ09NUCBQb3J0YWwKKyAgPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKyAgQ29weXJpZ2h0IChDKSAyMDE3IEFUJlQgSW50ZWxsZWN0dWFsIFByb3BlcnR5CisgID09PT09PT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xsaW5nPSJubyIgZnJhbWVCb3JkZXI9IjAiIGFsaWduPSJjZW50ZXIiIHdpZHRoPSIxMDAlIiBoZWlnaHQ9IjQwMHB4IiBzcmM9InN0YXRpYy9mdXNpb24vc2FtcGxlL29yZ19jaGFydC9leGFtcGxlX3ZzcC5odG1sIiA+PC9pZnJhbWU+CisJCQkJCQkJCQkJCSAgICAgICAgICA8L2FjY29yZGlvbi1ncm91cD4KKwkJCQkJCQkJCSAgICAgICAgICA8L2FjY29yZGlvbj4gCQorCQkJICAgICAgICAgICAgICAgCQk8L2Rpdj4KKwkJCSAgICAgICAgICAgICAgIAkJCisJCQkJICAgICAgCSAgCTwvZGl2PgorCQkJCQkJCQorCQkgICAgICAgICAgICAgICAgPCEtLUFDVFVBTCBCT0RZIENPTlRFTlQgRU5ELS0+CisgICAgICAgICAgICAgICAgCTwvZGl2PgorICAgICAgICAgICAgICAgICAgIDwhLS0gIDxkaXYgYXR0LWdyaWRzdGVyLWl0ZW0tZm9vdGVyIAorICAgICAgICAgICAgICAgICAgICAgICAgIGF0dC1ncmlkc3Rlci1pdGVtLWZvb3Rlci1saW5rPXt7aXRlbS5mb290ZXJMaW5rfX0+CisgICAgICAgICAgICAgICAgICAgICAgICB7e2l0ZW0uZm9vdGVyTGlua1RleHR9fQorICAgICAgICAgICAgICAgICAgICA8L2Rpdj4gLS0+CisgICAgICAgICAgICAgICAgPC9kaXY+CisgICAgICAgICAgICA8L2Rpdj4KKyAgICAgICAgPC9kaXY+CisgICAgPC9jZW50ZXI+CisgICAgCis8L2Rpdj4KKwkKKzxzY3JpcHQ+CiskKGRvY3VtZW50KS5yZWFkeShmdW5jdGlvbigpeworCSAgJCggIiNyaWdodEljb24iICkuaGlkZSgpOworCQkkKCAiI2xlZnRJY29uIiApLnNob3coKTsKK30pOwordmFyIGFwcD1hbmd1bGFyLm1vZHVsZSgiYWJzIiwgWyJhdHQuYWJzIiwgIm1vZGFsU2VydmljZXMiLCJhdHQuZ3JpZHN0ZXIiL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6IDgsCisJCQlyb3c6IDAsCisJCQljb2w6IDAsCisJCSAgICAgICAgICAgIGhlYWRlclRleHQ6J0Rhc2hib2FyZCcsCisJCSAgICAgICAgICAgIG1heDpmYWxzZQorCQkgICAgICAgICAgICAKKwkJICAgICAgICAgICAgCisJCX0sCisJCSAgICB7CisJCQlzaXplWDogMSwKKwkJCXNpemVZOiA1LAorIAkgICAgICAgIG1heEhlaWdodDogNSwKKwkJCXJvdzogMCwKKwkJCWNvbDogMSwKKwkJICAgICAgICAgICAgaGVhZGVyVGV4dDonRG9udXQgQ2hhcnQnLAorCQkgICAgICAgICAgICBtYXg6ZmFsc2UKKwkJICAgICAgICAgICAgCisJCX0sCisJCSAgICB7CisJCQlzaXplWDogMSwKKwkJCXNpemVZOiA1LAorIAkgICAgICAgIG1heEhlaWdodDogNSwKKwkJCXJvdzogMCwKKwkJCWNvbDogMiwKKwkJICAgICAgICAgICAgaGVhZGVyVGV4dDonQXJlYSBDaGFydCcsCisJCSAgICAgICAgICAgIG1heDp0cnVlCisJCX0sCisJCSAgICB7CisJCQlzaXplWDogMSwKKwkJCXNpemVZOiA1LAorIAkgICAgICAgIG1heEhlaWdodDogNSwKKwkJCXJvdzogOCwKKwkJCWNvbDogMCwKKwkJICAgICAgICAgICAgaGVhZGVyVGV4dDonUGllIENoYXJ0JywKKwkJICAgICAgICAgICAgbWF4OmZhbHNlCisJCX0sCisJCSAgICB7CisJCQlzaXplWDogMSwKKwkJCXNpemVZOiA1LAorIAkgICAgICAgIG1heEhlaWdodDogNSwKKwkJCXJvdzogOCwKKwkJCWNvbDogMSwKKwkJICAgICAgICAgICAgaGVhZGVyVGV4dDonTGluZSBDaGFydCcsCisJCSAgICAgICAgICAgIG1heDp0cnVlCisJCX0sCisJCSAgICB7CisJCQlzaXplWDogMSwKKwkJCXNpemVZOiA1LAorIAkgICAgICAgIG1heEhlaWdodDogNSwKKwkJCXJvdzogOCwKKwkJCWNvbDogMiwKKwkJICAgICAgICAgICAgaGVhZGVyVGV4dDonR2F1Z2VzJywKKwkJICAgICAgICAgICAgbWF4OmZhbHNlCisJCX0sCisJCSAgICB7CisJCQlzaXplWDogMSwKKwkJCXNpemVZOiA4LAorIAkgICAgICAgIG1heEhlaWdodDogOCwKKwkJCXJvdzogMTYsCisJCQljb2w6IDAsCisJCSAgICAgICAgICAgIGhlYWRlclRleHQ6J1RyYWZmaWMgZGlzdHJpYnV0aW9uIGJ5IGRheSBvZiB3ZWVrJywKKwkJICAgICAgICAgICAgbWF4OmZhbHNlCisJCX0sCisJCSAgICB7CisJCQlzaXplWDogMSwKKwkJCXNpemVZOiA4LAorIAkgICAgICAgIG1heEhlaWdodDogOCwKKwkJCXJvdzogMTYsCisJCQljb2w6IDEsCisJCSAgICAgICAgICAgIGhlYWRlclRleHQ6J0J1c3kgaG91ciB0cmFmZmljIGFuYWx5c2lzIGJ5IGRheSBvZiB3ZWVrJywKKwkJICAgICAgICAgICAgbWF4OmZhbHNlCisJCX0sCisJCSAgICB7CisJCQlzaXplWDogMSwKKwkJCXNpemVZOiA2LAorIAkgICAgICAgIG1heEhlaWdodDogNiwKKwkJCXJvdzogMjQsCisJCQljb2w6IDAsCisJCSAgICAgICAgICAgIGhlYWRlclRleHQ6J0FkZGl0aW9uYWwgU2FtcGxlcycsCisJCSAgICAgICAgICAgIG1heDpmYWxzZQorCQl9LAorCQkgICAgeworCQkJc2l6ZVg6IDEsCisJCQlzaXplWTogOCwKKyAJICAgICAgICBtYXhIZWlnaHQ6IDgsCisJCQlyb3c6IDI0LAorCQkJY29sOiAxLAorCQkgICAgICAgICAgICBoZWFkZXJUZXh0OidTdGlja3kgTm90ZXMnLAorCQkgICAgICAgICAgICBtYXg6ZmFsc2UKKwkJfSwKKwkJICAgIHsKKwkJCXNpemVYOiAzLAorCQkJc2l6ZVk6IDEwLAorIAkgICAgICAgIG1heEhlaWdodDogMTAsCisJCQlyb3c6IDMyLAorCQkJY29sOiAwLAorCQkgICAgICAgICAgICBoZWFkZXJUZXh0OidTZXJ2aWNlIENvbmZpZ3VyYXRpb24nLAorCQkgICAgICAgICAgICBtYXg6ZmFsc2UKKwkJfV07CisJCisJJC5lYWNoKCRzY29wZS5zdGFuZGFyZEl0ZW1zLCBmdW5jdGlvbihpLCBhKXsgCisJCSAgICAkc2NvcGUudG9nZ2xlTWluTWF4KGksJycpOworCX0pOworCSAkc2NvcGUuYWN0aXZlVGFiSWQgPSAnTW9uZGF5JzsKKwkvL2ZvciBnZW5lcmljIHRhYnMKKyAgICAkc2NvcGUuZ1RhYnMgPSBbeworICAgICAgICAgICAgdGl0bGU6ICdNb25kYXknLAorICAgICAgICAgICAgaWQ6ICdNb25kYXknLAorICAgICAgICAgICAgdXJsOiAnI01vbmRheScsCisgICAgICAgICAgICBzZWxlY3RlZDogdHJ1ZQorICAgICAgICB9LHsKKyAgICAgICAgICAgIHRpdGxlOiAnVHVlc2RheScsCisgICAgICAgICAgICBpZDogJ1R1ZXNkYXknLAorICAgICAgICAgICAgdXJsOiAnI1R1ZXNkYXknCisgICAgICAgIH0seworICAgICAgICAgICAgdGl0bGU6ICdXZWRuZXNkYXknLAorICAgICAgICAgICAgaWQ6ICdXZWRuZXNkYXknLAorICAgICAgICAgICAgdXJsOiAnI1dlZG5lc2RheScKKyAgICAgICAgfSx7CisgICAgICAgICAgICB0aXRsZTogJ1RodXJzZGF5JywKKyAgICAgICAgICAgIGlkOiAnVGh1cnNkYXknLAorICAgICAgICAgICAgdXJsOiAnI1RodXJzZGF5JworICAgICAgICB9LHsKKyAgICAgICAgICAgIHRpdGxlOiAnRnJpZGF5JywKKyAgICAgICAgICAgIGlkOiAnRnJpZGF5JywKKyAgICAgICAgICAgIHVybDogJyNGcmlkYXknCisgICAgICAgIH0seworICAgICAgICAgICAgdGl0bGU6ICdTYXR1cmRheScsCisgICAgICAgICAgICBpZDogJ1NhdHVyZGF5JywKKyAgICAgICAgICAgIHVybDogJyNTYXR1cmRheScKKyAgICAgICAgfSx7CisgICAgICAgICAgICB0aXRsZTogJ1N1bmRheScsCisgICAgICAgICAgICBpZDogJ1N1bmRheScsCisgICAgICAgICAgICB1cmw6ICcjU3VuZGF5JworICAgICAgICB9CisgICAgXTsKKworICAgICRzY29wZS5hY3RpdmVUYWJJZDIgPSAnSW5jb21pbmcnOworCS8vZm9yIGdlbmVyaWMgdGFicworICAgICRzY29wZS5nVGFiczIgPSBbeworICAgICAgICAgICAgdGl0bGU6ICdCSCBTTlJDIERMU1RYIC0gSW5jb21pbmcnLAorICAgICAgICAgICAgaWQ6ICdJbmNvbWluZycsCisgICAgICAgICAgICB1cmw6ICcjSW5jb21pbmcnLAorICAgICAgICAgICAgc2VsZWN0ZWQ6IHRydWUKKyAgICAgICAgfSx7CisgICAgICAgICAgICB0aXRsZTogJ0JIIFNOUkMgRExTVFggLSBPdXRnb2luZycsCisgICAgICAgICAgICBpZDogJ091dGdvaW5nJywKKyAgICAgICAgICAgIHVybDogJyNPdXRnb2luZycKKyAgICAgICAgfSx7CisgICAgICAgICAgICB0aXRsZTogJ0JIIE5hdGlvbmFsIC0gRGVmYXVsdCcsCisgICAgICAgICAgICBpZDogJ0RlZmF1bHQnLAorICAgICAgICAgICAgdXJsOiAnI0RlZmF1bHQnCisgICAgICAgIH0seworICAgICAgICAgICAgdGl0bGU6ICdCSCBOYXRpb25hbCAtIFByaW9yaXR5JywKKyAgICAgICAgICAgIGlkOiAnUHJpb3JpdHknLAorICAgICAgICAgICAgdXJsOiAnI1ByaW9yaXR5JworICAgICAgICB9LHsKKyAgICAgICAgICAgIHRpdGxlOiAnQkggTmF0aW9uYWwnLAorICAgICAgICAgICAgaWQ6ICdCSE5hdGlvbmFsJywKKyAgICAgICAgICAgIHVybDogJyNCSE5hdGlvbmFsJworICAgICAgICB9CisgICAgXTsKKwkKKyAgICAkc2NvcGUuYWN0aXZlVGFiSWQzID0gJ0luY29taW5nJzsKKwkvL2ZvciBnZW5lcmljIHRhYnMKKyAgICAkc2NvcGUuZ1RhYnMzID0gW3sKKyAgICAgICAgICAgIHRpdGxlOiAnQkggU05SQyBETFNUWCAtIEluY29taW5nJywKKyAgICAgICAgICAgIGlkOiAnSW5jb21pbmcnLAorICAgICAgICAgICAgdXJsOiAnI0luY29taW5nJywKKyAgICAgICAgICAgIHNlbGVjdGVkOiB0cnVlICAgICAgICAgICAgCisgICAgICAgIH0seworICAgICAgICAgICAgdGl0bGU6ICdCSCBTTlJDIERMU1RYIC0gT3V0Z29pbmcnLAorICAgICAgICAgICAgaWQ6ICdPdXRnb2luZycsCisgICAgICAgICAgICB1cmw6ICcjT3V0Z29pbmcnCisgICAgICAgIH0seworICAgICAgICAgICAgdGl0bGU6ICdCSCBOYXRpb25hbCAtIERlZmF1bHQnLAorICAgICAgICAgICAgaWQ6ICdEZWZhdWx0JywKKyAgICAgICAgICAgIHVybDogJyNEZWZhdWx0JworICAgICAgICB9LHsKKyAgICAgICAgICAgIHRpdGxlOiAnQkggTmF0aW9uYWwgLSBQcmlvcml0eScsCisgICAgICAgICAgICBpZDogJ1ByaW9yaXR5JywKKyAgICAgICAgICAgIHVybDogJyNQcmlvcml0eScKKyAgICAgICAgfSx7CisgICAgICAgICAgICB0aXRsZTogJ0JIIE5hdGlvbmFsJywKKyAgICAgICAgICAgIGlkOiAnQkhOYXRpb25hbCcsCisgICAgICAgICAgICB1cmw6ICcjQkhOYXRpb25hbCcKKyAgICAgICAgfQorICAgIF07CisKKwkvKiAkc2NvcGUuJHdhdGNoKCdhY3RpdmVUYWJJZCcsIGZ1bmN0aW9uKG5ld1ZhbCkgeworCQlhbGVydChuZXd2YWwpOworCQkkKCcjJytuZXd2YWwpLnNob3coKTsKKwl9LCB0cnVlKTsgKi8KKwkKKwkkc2NvcGUudG9nZ2xlRWFzdFRvV2VzdCA9IGZ1bmN0aW9uKCkgeworCQkkKCAiI3RvZ2dsZSIgKS50b2dnbGUoICdzbGlkZScpOwkKKwkJaWYgKCQoIiNsZWZ0SWNvbiIpLmlzKCI6dmlzaWJsZSIpKSB7CisJCQkkKCAiI3JpZ2h0SWNvbiIgKS5zaG93KCk7CisJCQkkKCAiI2xlZnRJY29uIiApLmhpZGUoKTsKKwkgICAgfSAKKwkJZWxzZSBpZiAoJCgiI3JpZ2h0SWNvbiIpLmlzKCI6dmlzaWJsZSIpKSB7CisJICAgIAkkKCAiI3JpZ2h0SWNvbiIgKS5oaWRlKCk7CisJCQkkKCAiI2xlZnRJY29uIiApLnNob3coKTsKKwkgICAgfQorCX07CisJCisJJHNjb3BlLmdyb3VwMSA9IHsKKyAgICAgICAgICAgIG9wZW46IHRydWUKKyAgICAgICAgfTsKKwkkc2NvcGUuZ3JvdXAyID0geworICAgICAgICAgICAgb3BlbjogdHJ1ZQorICAgICAgICB9OworCSRzY29wZS5ncm91cDMgPSB7CisgICAgICAgICAgICBvcGVuOiB0cnVlCisgICAgICAgIH07CisJJHNjb3BlLmdyb3VwNCA9IHsKKyAgICAgICAgICAgIG9wZW46IHRydWUKKyAgICAgICAgfTsKKwkkc2NvcGUuZ3JvdXA1ID0geworICAgICAgICAgICAgb3BlbjogdHJ1ZQorICAgICAgICB9OworCSRzY29wZS5ncm91cDYgPSB7CisgICAgICAgICAgICBvcGVuOiB0cnVlCisgICAgICAgIH07CQorCSRzY29wZS5ncm91cDcgPSB7CisgICAgICAgICAgICBvcGVuOiB0cnVlCisgICAgICAgIH07CisJJHNjb3BlLmdyb3VwNzEgPSB7CisgICAgICAgICAgICBvcGVuOiB0cnVlCisgICAgICAgIH07CisJJHNjb3BlLmdyb3VwOCA9IHsKKyAgICAgICAgICAgIG9wZW46IHRydWUKKyAgICAgICAgfTsKKwkkc2NvcGUuZ3JvdXA5ID0geworICAgICAgICAgICAgb3BlbjogdHJ1ZQorICAgICAgICB9OworCSRzY29wZS5ncm91cDEwID0geworICAgICAgICAgICAgb3BlbjogdHJ1ZQorICAgICAgICB9OworCSRzY29wZS5ncm91cDExID0geworICAgICAgICAgICAgb3BlbjogdHJ1ZQorICAgICAgICB9OworCSRzY29wZS5ncm91cDEyID0geworICAgICAgICAgICAgb3BlbjogZmFsc2UKKyAgICAgICAgfTsKK30pOworPC9zY3JpcHQ+CisKKyAgPCEtLSBTZWxlY3QgdGhlIFNsaWRlciBjb250cm9sIGJ5IGRlZmF1bHQgLS0+CisgIDxzY3JpcHQ+JCgnaW5wdXRbbmFtZT12aWV3ZXJdOmVxKDEpJykuY2xpY2soKTs8L3NjcmlwdD4KZGlmZiAtLWdpdCBhL2Vjb21wLXBvcnRhbC1CRS93YXIvV0VCLUlORi9vaWQtY29udGV4dC54bWwgYi9lY29tcC1wb3J0YWwtQkUvd2FyL1dFQi1JTkYvb2lkLWNvbnRleHQueG1sCm5ldyBmaWxlIG1vZGUgMTAwNjQ0CmluZGV4IDAwMDAwMDAuLjMzNDU4ZDYKLS0tIC9kZXYvbnVsbAorKysgYi9lY29tcC1wb3J0YWwtQkUvd2FyL1dFQi1JTkYvb2lkLWNvbnRleHQueG1sCkBAIC0wLDAgKzEsNDU1IEBACis8P3htbCB2ZXJzaW9uPSIxLjAiIGVuY29kaW5nPSJVVEYtOCI/PgorPCEtLQorICA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorICBlQ09NUCBQb3J0YWwKKyAgPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKyAgQ29weXJpZ2h0IChDKSAyMDE3IEFUJlQgSW50ZWxsZWN0dWFsIFByb3BlcnR5CisgID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisgIExpY2Vuc2VkIHVuZGVyIHRoZSBBcGFjaGUgTGljZW5zZSwgVmVyc2lvbiAyLjAgKHRoZSAiTGljZW5zZSIpOworICB5b3UgbWF5IG5vdCB1c2UgdGhpcyBmaWxlIGV4Y2VwdCBpbiBjb21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ZSgnUk9MRV9VU0VSJykiPgorCSAgICAgICAgICAgICAgICAgICAgPGxpPgorCSAgICAgICAgICAgICAgICAgICAgCTxhIGlkPSJsb2dpbkJ1dHRvbiIgaHJlZj0ibG9naW4iIGRhdGEtdG9nZ2xlPSJjb2xsYXBzZSIgZGF0YS10YXJnZXQ9Ii5uYXYtY29sbGFwc2UiPjxpIGNsYXNzPSJpY29uLWxvY2sgaWNvbi13aGl0ZSI+PC9pPiBMb2cgaW48L2E+CisJICAgICAgICAgICAgICAgICAgICA8L2xpPgorCSAgICAgICAgICAgICAgICAgICAgPC9zZWN1cml0eTphdXRob3JpemU+CisJICAgICAgICAgICAgICAgIDwvdWw+CisKKwkgICAgICAgICAgICA8L2Rpdj48IS0tLy5uYXYtY29sbGFwc2UgLS0+CisJCQk8L2M6aWY+CisgICAgICAgIDwvZGl2PgorICAgIDwvZGl2PgorPC9kaXY+CmRpZmYgLS1naXQgYS9lY29tcC1wb3J0YWwtQkUvd2FyL1dFQi1JTkYvd2ViLnhtbCBiL2Vjb21wLXBvcnRhbC1CRS93YXIvV0VCLUlORi93ZWIueG1sCm5ldyBmaWxlIG1vZGUgMTAwNjQ0CmluZGV4IDAwMDAwMDAuLjhjOTIwZDEKLS0tIC9kZXYvbnVsbAorKysgYi9lY29tcC1wb3J0YWwtQkUvd2FyL1dFQi1JTkYvd2ViLnhtbApAQCAtMCwwICsxLDg3IEBACis8P3htbCB2ZXJzaW9uPSIxLjAiIGVuY29kaW5nPSJVVEYtOCI/PgorPCEtLQorICA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorICBlQ09NUCBQb3J0YWwKKyAgPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKyAgQ29weXJpZ2h0IChDKSAyMDE3IEFUJlQgSW50ZWxsZWN0dWFsIFByb3BlcnR5CisgID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisgIExpY2Vuc2VkIHVuZGVyIHRoZSBBcGFjaGUgTGljZW5zZSwgVmVyc2lvbiAyLjAgKHRoZSAiTGljZW5zZSIpOworICB5b3UgbWF5IG5vdCB1c2UgdGhpcyBmaWxlIGV4Y2VwdCBpbiBjb21wbGlhbmNlIHdpdGggdGhlIExpY2Vuc2UuCisgIFlvdSBtYXkgb2J0YWluIGEgY29weSBvZiB0aGUgTGljZW5zZSBhdAorICAKKyAgICAgICBodHRwOi8vd3d3LmFwYWNoZS5vcmcvbGljZW5zZXMvTElDRU5TRS0yLjAKKyAgCisgIFVubGVzcyByZXF1aXJlZCBieSBhcHBsaWNhYmxlIGxhdyBvciBhZ3JlZWQgdG8gaW4gd3JpdGluZywgc29mdHdhcmUKKyAgZGlzdHJpYnV0ZWQgdW5kZXIgdGhlIExpY2Vuc2UgaXMgZGlzdHJpYnV0ZWQgb24gYW4gIkFTIElTIiBCQVNJUywKKyAgV0lUSE9VVCBXQVJSQU5USUVTIE9SIENPTkRJVElPTlMgT0YgQU5ZIEtJTkQsIGVpdGhlciBleHByZXNzIG9yIGltcGxpZWQuCisgIFNlZSB0aGUgTGljZW5zZSBmb3IgdGhlIHNwZWNpZmljIGxhbmd1YWdlIGdvdmVybmluZyBwZXJtaXNzaW9ucyBhbmQKKyAgbGltaXRhdGlvbnMgdW5kZXIgdGhlIExpY2Vuc2UuCisgID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisgIC0tPgorCis8d2ViLWFwcCB4bWxucz0iaHR0cDovL2phdmEuc3VuLmNvbS94bWwvbnMvajJlZSIgeG1sbnM6eHNpPSJodHRwOi8vd3d3LnczLm9yZy8yMDAxL1hNTFNjaGVtYS1pbnN0YW5jZSIge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dCbG9ja0VsZW1lbnRzLCBtYWtlTWFwKCJhZGRyZXNzLGFydGljbGUsIiArCisgICAgICAgICJhc2lkZSxibG9ja3F1b3RlLGNhcHRpb24sY2VudGVyLGRlbCxkaXIsZGl2LGRsLGZpZ3VyZSxmaWdjYXB0aW9uLGZvb3RlcixoMSxoMixoMyxoNCxoNSwiICsKKyAgICAgICAgImg2LGhlYWRlcixoZ3JvdXAsaHIsaW5zLG1hcCxtZW51LG5hdixvbCxwcmUsc2NyaXB0LHNlY3Rpb24sdGFibGUsdWwiKSk7CisKKy8vIElubGluZSBFbGVtZW50cyAtIEhUTUw1Cit2YXIgaW5saW5lRWxlbWVudHMgPSBhbmd1bGFyLmV4dGVuZCh7fSwgb3B0aW9uYWxFbmRUYWdJbmxpbmVFbGVtZW50cywgbWFrZU1hcCgiYSxhYmJyLGFjcm9ueW0sYiwiICsKKyAgICAgICAgImJkaSxiZG8sYmlnLGJyLGNpdGUsY29kZSxkZWwsZGZuLGVtLGZvbnQsaSxpbWcsaW5zLGtiZCxsYWJlbCxtYXAsbWFyayxxLHJ1YnkscnAscnQscywiICsKKyAgICAgICAgInNhbXAsc21hbGwsc3BhbixzdHJpa2Usc3Ryb25nLHN1YixzdXAsdGltZSx0dCx1LHZhciIpKTsKKworCisvLyBTcGVjaWFsIEVsZW1lbnRzIChjYW4gY29udGFpbiBhbnl0aGluZykKK3ZhciBzcGVjaWFsRWxlbWVudHMgPSBtYWtlTWFwKCJzY3JpcHQsc3R5bGUiKTsKKwordmFyIHZhbGlkRWxlbWVudHMgPSBhbmd1bGFyLmV4dGVuZCh7fSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdm9pZEVsZW1lbnRzLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBibG9ja0VsZW1lbnRzLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpbmxpbmVFbGVtZW50cywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC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gaW5kZXggPSBodG1sLmluZGV4T2YoIi0tIiwgNCk7CisKKyAgICAgICAgaWYgKCBpbmRleCA+PSAwICYmIGh0bWwubGFzdEluZGV4T2YoIi0tPiIsIGluZGV4KSA9PT0gaW5kZXgpIHsKKyAgICAgICAgICBpZiAoaGFuZGxlci5jb21tZW50KSBoYW5kbGVyLmNvbW1lbnQoIGh0bWwuc3Vic3RyaW5nKCA0LCBpbmRleCApICk7CisgICAgICAgICAgaHRtbCA9IGh0bWwuc3Vic3RyaW5nKCBpbmRleCArIDMgKTsKKyAgICAgICAgICBjaGFycyA9IGZhbHNlOworICAgICAgICB9CisgICAgICAvLyBET0NUWVBFCisgICAgICB9IGVsc2UgaWYgKCBET0NUWVBFX1JFR0VYUC50ZXN0KGh0bWwpICkgeworICAgICAgICBtYXRjaCA9IGh0bWwubWF0Y2goIERPQ1RZUEVfUkVHRVhQICk7CisKKyAgICAgICAgaWYgKCBtYXRjaCApIHsKKyAgICAgICAgICBodG1sID0gaHRtbC5yZXBsYWNlKCBtYXRjaFswXSwgJycpOworICAgICAgICAgIGNoYXJzID0gZmFsc2U7CisgICAgICAgIH0KKyAgICAgIC8vIGVuZCB0YWcKKyAgICAgIH0gZWxzZSBpZiAoIEJFR0lOR19FTkRfVEFHRV9SRUdFWFAudGVzdChodG1sKSApIHsKKyAgICAgICAgbWF0Y2ggPSBodG1sLm1hdGNoKCBFTkRfVEFHX1JFR0VYUCApOworCisgICAgICAgIGlmICggbWF0Y2ggKSB7CisgICAgICAgICAgaHRtbCA9IGh0bWwuc3Vic3RyaW5nKCBtYXRjaFswXS5sZW5ndGggKTsKKyAgICAgICAgICBtYXRjaFswXS5yZXBsYWNlKCBFTkRfVEFHX1JFR0VYUCwgcGFyc2VFbmRUYWcgKTsKKyAgICAgICAgICBjaGFycyA9IGZhbHNlOworICAgICAgICB9CisKKyAgICAgIC8vIHN0YXJ0IHRhZworICAgICAgfSBlbHNlIGlmICggQkVHSU5fVEFHX1JFR0VYUC50ZXN0KGh0bWwpICkgeworICAgICAgICBtYXRjaCA9IGh0bWwubWF0Y2goIFNUQVJUX1RBR19SRUdFWFAgKTsKKworICAgICAgICBpZiAoIG1hdGNoICkgeworICAgICAgICAgIC8vIFdlIG9ubHkgaGF2ZSBhIHZhbGlkIHN0YXJ0LXRhZyBpZiB0aGVyZSBpcyBhICc+Jy4KKyAgICAgICAgICBpZiAoIG1hdGNoWzRdICkgeworICAgICAgICAgICAgaHRtbCA9IGh0bWwuc3Vic3RyaW5nKCBtYXRjaFswXS5sZW5ndGggKTsKKyAgICAgICAgICAgIG1hdGNoWzBdLnJlcGxhY2UoIFNUQVJUX1RBR19SRUdFWFAsIHBhcnNlU3RhcnRUYWcgKTsKKyAgICAgICAgICB9CisgICAgICAgICAgY2hhcnMgPSBmYWxzZTsKKyAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAvLyBubyBlbmRpbmcgdGFnIGZvdW5kIC0tLSB0aGlzIHBpZWNlIHNob3VsZCBiZSBlbmNvZGVkIGFzIGFuIGVudGl0eS4KKyAgICAgICAgICB0ZXh0ICs9ICc8JzsKKyAgICAgICAgICBodG1sID0gaHRtbC5zdWJzdHJpbmcoMSk7CisgICAgICAgIH0KKyAgICAgIH0KKworICAgICAgaWYgKCBjaGFycyApIHsKKyAgICAgICAgaW5kZXggPSBodG1sLmluZGV4T2YoIjwiKTsKKworICAgICAgICB0ZXh0ICs9IGluZGV4IDwgMCA/IGh0bWwgOiBodG1sLnN1YnN0cmluZyggMCwgaW5kZXggKTsKKyAgICAgICAgaHRtbCA9IGluZGV4IDwgMCA/ICIiIDogaHRtbC5zdWJzdHJpbmcoIGluZGV4ICk7CisKKyAgICAgICAgaWYgKGhhbmRsZXIuY2hhcnMpIGhhbmRsZXIuY2hhcnMoIGRlY29kZUVudGl0aWVzKHRleHQpICk7CisgICAgICB9CisKKyAgICB9IGVsc2UgeworICAgICAgaHRtbCA9IGh0bWwucmVwbGFjZShuZXcgUmVnRXhwKCIoLiopPFxccypcX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nJmFtcDsnKS4KKyAgICByZXBsYWNlKFNVUlJPR0FURV9QQUlSX1JFR0VYUCwgZnVuY3Rpb24gKHZhbHVlKSB7CisgICAgICB2YXIgaGkgPSB2YWx1ZS5jaGFyQ29kZUF0KDApOworICAgICAgdmFyIGxvdyA9IHZhbHVlLmNoYXJDb2RlQXQoMSk7CisgICAgICByZXR1cm4gJyYjJyArICgoKGhpIC0gMHhEODAwKSAqIDB4NDAwKSArIChsb3cgLSAweERDMDApICsgMHgxMDAwMCkgKyAnOyc7CisgICAgfSkuCisgICAgcmVwbGFjZShOT05fQUxQSEFOVU1FUklDX1JFR0VYUCwgZnVuY3Rpb24odmFsdWUpeworICAgICAgcmV0dXJuICcmIycgKyB2YWx1ZS5jaGFyQ29kZUF0KDApICsgJzsnOworICAgIH0pLgorICAgIHJlcGxhY2UoLzwvZywgJyZsdDsnKS4KKyAgICByZXBsYWNlKC8+L2csICcmZ3Q7Jyk7Cit9CisKKy8qKgorICogY3JlYXRlIGFuIEhUTUwvWE1MIHdyaXRlciB3aGljaCB3cml0ZXMgdG8gYnVmZmVyCisgKiBAcGFyYW0ge0FycmF5fSBidWYgdXNlIGJ1Zi5qYWluKCcnKSB0byBnZXQgb3V0IHNhbml0aXplZCBodG1sIHN0cmluZworICogQHJldHVybnMge29iamVjdH0gaW4gdGhlIGZvcm0gb2YgeworICogICAgIHN0YXJ0OiBmdW5jdGlvbih0YWcsIGF0dHJzLCB1bmFyeSkge30sCisgKiAgICAgZW5kOiBmdW5jdGlvbih0YWcpIHt9LAorICogICAgIGNoYXJzOiBmdW5jdGlvbih0ZXh0KSB7fSwKKyAqICAgICBjb21tZW50OiBmdW5jdGlvbih0ZXh0KSB7fQorICogfQorICovCitmdW5jdGlvbiBodG1sU2FuaXRpemVXcml0ZXIoYnVmLCB1cmlWYWxpZGF0b3IpeworICB2YXIgaWdub3JlID0gZmFsc2U7CisgIHZhciBvdXQgPSBhbmd1bGFyLmJpbmQoYnVmLCBidWYucHVzaCk7Cis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oZXNlIGFzIHRoZXkgYXJlIHNvbWV0aW1lcyBmb3VuZCBhdCB0aGUgZW5kIG9mIHRoZSBzZW50ZW5jZQorICAgICAgdXJsID0gbWF0Y2hbMF07CisgICAgICAvLyBpZiB3ZSBkaWQgbm90IG1hdGNoIGZ0cC9odHRwL21haWx0byB0aGVuIGFzc3VtZSBtYWlsdG8KKyAgICAgIGlmIChtYXRjaFsyXSA9PSBtYXRjaFszXSkgdXJsID0gJ21haWx0bzonICsgdXJsOworICAgICAgaSA9IG1hdGNoLmluZGV4OworICAgICAgYWRkVGV4dChyYXcuc3Vic3RyKDAsIGkpKTsKKyAgICAgIGFkZExpbmsodXJsLCBtYXRjaFswXS5yZXBsYWNlKE1BSUxUT19SRUdFWFAsICcnKSk7CisgICAgICByYXcgPSByYXcuc3Vic3RyaW5nKGkgKyBtYXRjaFswXS5sZW5ndGgpOworICAgIH0KKyAgICBhZGRUZXh0KHJhdyk7CisgICAgcmV0dXJuICRzYW5pdGl6ZShodG1sLmpvaW4oJycpKTsKKworICAgIGZ1bmN0aW9uIGFkZFRleHQodGV4dCkgeworICAgICAgaWYgKCF0ZXh0KSB7CisgICAgICAgIHJldHVybjsKKyAgICAgIH0KKyAgICAgIGh0bWwucHVzaChzYW5pdGl6ZVRleHQodGV4dCkpOworICAgIH0KKworICAgIGZ1bmN0aW9uIGFkZExpbmsodXJsLCB0ZXh0KSB7CisgICAgICBodG1sLnB1c2goJzxhICcpOworICAgICAgaWYgKGFuZ3VsYXIuaXNEZWZpbmVkKHRhcmdldCkpIHsKKyAgICAgICAgaHRtbC5wdXNoKCd0YXJnZXQ9IicpOworICAgICAgICBodG1sLnB1c2godGFyZ2V0KTsKKyAgICAgICAgaHRtbC5wdXNoKCciICcpOworICAgICAgfQorICAgICAgaHRtbC5wdXNoKCdocmVmPSInKTsKKyAgICAgIGh0bWwucHVzaCh1cmwpOworICAgICAgaHRtbC5wdXNoKCciPicpOworICAgICAgYWRkVGV4dCh0ZXh0KTsKKyAgIC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isgKiBAcGFyYW0ge3N0cmluZ30gbW9kdWxlIFRoZSBuYW1lc3BhY2UgdG8gdXNlIGZvciB0aGUgbmV3IG1pbkVyciBpbnN0YW5jZS4KKyAqIEByZXR1cm5zIHtmdW5jdGlvbihjb2RlOnN0cmluZywgdGVtcGxhdGU6c3RyaW5nLCAuLi50ZW1wbGF0ZUFyZ3MpOiBFcnJvcn0gbWluRXJyIGluc3RhbmNlCisgKi8KKworZnVuY3Rpb24gbWluRXJyKG1vZHVsZSkgeworICByZXR1cm4gZnVuY3Rpb24gKCkgeworICAgIHZhciBjb2RlID0gYXJndW1lbnRzWzBdLAorICAgICAgcHJlZml4ID0gJ1snICsgKG1vZHVsZSA/IG1vZHVsZSArICc6JyA6ICcnKSArIGNvZGUgKyAnXSAnLAorICAgICAgdGVtcGxhdGUgPSBhcmd1bWVudHNbMV0sCisgICAgICB0ZW1wbGF0ZUFyZ3MgPSBhcmd1bWVudHMsCisgICAgICBzdHJpbmdpZnkgPSBmdW5jdGlvbiAob2JqKSB7CisgICAgICAgIGlmICh0eXBlb2Ygb2JqID09PSAnZnVuY3Rpb24nKSB7CisgICAgICAgICAgcmV0dXJuIG9iai50b1N0cmluZygpLnJlcGxhY2UoLyBce1tcc1xTXSokLywgJycpOworICAgICAgICB9IGVsc2UgaWYgKHR5cGVvZiBvYmogPT09ICd1bmRlZmluZWQnKSB7CisgICAgICAgICAgcmV0dXJuICd1bmRlZmluZWQnOworICAgICAgICB9IGVsc2UgaWYgKHR5cGVvZiBvYmogIT09ICdzdHJpbmcnKSB7CisgICAgICAgICAgcmV0dXJuIEpTT04uc3RyaW5naWZ5KG9iaik7CisgICAgICAgIH0KKyAgICAgICAgcmV0dXJuIG9iajsKKyAgICAgIH0sCisgICAgICBtZXNzYWdlLCBpOworCisgICAgbWVzc2FnZSA9IHByZWZpeCArIHRlbXBsYXRlLnJlcGxhY2UoL1x7XGQrXH0vZywgZnVuY3Rpb24gKG1hdGNoKSB7CisgICAgICB2YXIgaW5k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MgbWFqb3IgdmVyc2lvbiBudW1iZXIgZm9yIElFIG9yIE5hTiBmb3IgcmVhbCBicm93c2VycyAqLworICAgIG1zaWUsCisgICAganFMaXRlLCAgICAgICAgICAgLy8gZGVsYXkgYmluZGluZyBzaW5jZSBqUXVlcnkgY291bGQgYmUgbG9hZGVkIGFmdGVyIHVzLgorICAgIGpRdWVyeSwgICAgICAgICAgIC8vIGRlbGF5IGJpbmRpbmcKKyAgICBzbGljZSAgICAgICAgICAgICA9IFtdLnNsaWNlLAorICAgIHB1c2ggICAgICAgICAgICAgID0gW10ucHVzaCwKKyAgICB0b1N0cmluZyAgICAgICAgICA9IE9iamVjdC5wcm90b3R5cGUudG9TdHJpbmcsCisgICAgbmdNaW5FcnIgICAgICAgICAgPSBtaW5FcnIoJ25nJyksCisKKyAgICAvKiogQG5hbWUgYW5ndWxhciAqLworICAgIGFuZ3VsYXIgICAgICAgICAgID0gd2luZG93LmFuZ3VsYXIgfHwgKHdpbmRvdy5hbmd1bGFyID0ge30pLAorICAgIGFuZ3VsYXJNb2R1bGUsCisgICAgbm9kZU5hbWVfLAorICAgIHVpZCAgICAgICAgICAgICAgID0gWycwJywgJzAnLCAnMCddOworCisvKioKKyAqIElFIDExIGNoYW5nZWQgdGhlIGZvcm1hdCBvZiB0aGUgVXNlckFnZW50IHN0cmluZy4KKyAqIFNlZSBodHRwOi8vbXNkbi5taWNyb3NvZnQuY29tL2VuLXVzL2xpYnJhcnkvbXM1Mzc1MDMuYXNweAorICovCittc2llID0gaW50KCgvbXNpZSAoXGQrKS8uZXhlYyhsb3dlcmNhc2UobmF2aWdhdG9yLnVzZXJBZ2VudCkpIHx8IFtdKVsxXSk7CitpZiAoaXNOYU4obXNpZSkpIHsKKyAgbXNpZSA9IGludCgoL3RyaWRlbnRcLy4qOyBydjooXGQrKS8uZXhlYyhsb3dlcmNhc2UobmF2aWdhdG9yLnVzZXJBZ2VudCkpIHx8IFtdKVsxXSk7Cit9CisKKworLyoqCisgKiBAcHJp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vciwgY29udGV4dCkgeworICB2YXIga2V5OworICBpZiAob2JqKSB7CisgICAgaWYgKGlzRnVuY3Rpb24ob2JqKSkgeworICAgICAgZm9yIChrZXkgaW4gb2JqKSB7CisgICAgICAgIC8vIE5lZWQgdG8gY2hlY2sgaWYgaGFzT3duUHJvcGVydHkgZXhpc3RzLAorICAgICAgICAvLyBhcyBvbiBJRTggdGhlIHJlc3VsdCBvZiBxdWVyeVNlbGVjdG9yQWxsIGlzIGFuIG9iamVjdCB3aXRob3V0IGEgaGFzT3duUHJvcGVydHkgZnVuY3Rpb24KKyAgICAgICAgaWYgKGtleSAhPSAncHJvdG90eXBlJyAmJiBrZXkgIT0gJ2xlbmd0aCcgJiYga2V5ICE9ICduYW1lJyAmJiAoIW9iai5oYXNPd25Qcm9wZXJ0eSB8fCBvYmouaGFzT3duUHJvcGVydHkoa2V5KSkpIHsKKyAgICAgICAgICBpdGVyYXRvci5jYWxsKGNvbnRleHQsIG9ialtrZXldLCBrZXkpOworICAgICAgICB9CisgICAgICB9CisgICAgfSBlbHNlIGlmIChpc0FycmF5KG9iaikgfHwgaXNBcnJheUxpa2Uob2JqKSkgeworICAgICAgZm9yIChrZXkgPSAwOyBrZXkgPCBvYmoubGVuZ3RoOyBrZXkrKykgeworICAgICAgICBpdGVyYXRvci5jYWxsKGNvbnRleHQsIG9ialtrZXldLCBrZXkpOworICAgICAgfQorICAgIH0gZWxzZSBpZiAob2JqLmZvckVhY2ggJiYgb2JqLmZvckVhY2ggIT09IGZvckVhY2gpIHsKKyAgICAgICAgb2JqLmZvckVhY2goaXRlcmF0b3IsIGNvbnRleHQpOworICAgIH0gZWxzZSB7CisgICAgICBmb3IgKGtleSBpbiBvYmopIHsKKyAgICAgICAgaWYgKG9iai5oYXNPd25Qcm9wZXJ0eShrZXkpKSB7CisgICAgICAgICAgaXRlcmF0b3IuY2FsbChjb250ZXh0LCBvYmpba2V5XSwga2V5KTsKKyAgICAgICAgfQorICAgICAgfQorICAgIH0KKyAgfQ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IGlmIChpc09iamVjdChvYmopKSB7CisgICAgZm9yIChrZXkgaW4gb2JqKQorICAgICAgaWYgKCFvd25Qcm9wc09ubHkgfHwgb2JqLmhhc093blByb3BlcnR5KGtleSkpCisgICAgICAgIGNvdW50Kys7CisgIH0KKworICByZXR1cm4gY291bnQ7Cit9CisKKworZnVuY3Rpb24gaW5jbHVkZXMoYXJyYXksIG9iaikgeworICByZXR1cm4gaW5kZXhPZihhcnJheSwgb2JqKSAhPSAtMTsKK30KKworZnVuY3Rpb24gaW5kZXhPZihhcnJheSwgb2JqKSB7CisgIGlmIChhcnJheS5pbmRleE9mKSByZXR1cm4gYXJyYXkuaW5kZXhPZihvYmopOworCisgIGZvciAodmFyIGkgPSAwOyBpIDwgYXJyYXkubGVuZ3RoOyBpKyspIHsKKyAgICBpZiAob2JqID09PSBhcnJheVtpXSkgcmV0dXJuIGk7CisgIH0KKyAgcmV0dXJuIC0xOworfQorCitmdW5jdGlvbiBhcnJheVJlbW92ZShhcnJheSwgdmFsdWUpIHsKKyAgdmFyIGluZGV4ID0gaW5kZXhPZihhcnJheSwgdmFsdWUpOworICBpZiAoaW5kZXggPj0wKQorICAgIGFycmF5LnNwbGljZShpbmRleCwgMSk7CisgIHJldHVybiB2YWx1ZTsKK30KKworZnVuY3Rpb24gaXNMZWFmTm9kZSAobm9kZSkgeworICBpZiAobm9kZSkgeworICAgIHN3aXRjaCAobm9kZS5ub2RlTmFtZSkgeworICAgIGNhc2UgIk9QVElPTiI6CisgICAgY2FzZSAiUFJFIjoKKyAgICBjYXNlICJUSVRMRSI6CisgICAgICByZXR1cm4gdHJ1ZTsKKyAgICB9CisgIH0KKyAgcmV0dXJuIGZhbHNlOworfQorCisvKioKKyAqIEBuZ2RvYyBmdW5jdGlvbgorICogQG5hbWUgYW5ndWxhci5jb3B5CisgKiBAbW9kdWxlIG5nCisgKiBAa2luZCBmdW5jdGlvbgorICoKKyAqIEBkZXNjcmlwdGlvbgorICogQ3JlYXRlcyBhIGRlZXA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XI9IHt9OworCisgICAgICAkc2NvcGUudXBkYXRlID0gZnVuY3Rpb24odXNlcikgeworICAgICAgICAvLyBFeGFtcGxlIHdpdGggMSBhcmd1bWVudAorICAgICAgICAkc2NvcGUubWFzdGVyPSBhbmd1bGFyLmNvcHkodXNlcik7CisgICAgICB9OworCisgICAgICAkc2NvcGUucmVzZXQgPSBmdW5jdGlvbigpIHsKKyAgICAgICAgLy8gRXhhbXBsZSB3aXRoIDIgYXJndW1lbnRzCisgICAgICAgIGFuZ3VsYXIuY29weSgkc2NvcGUubWFzdGVyLCAkc2NvcGUudXNlcik7CisgICAgICB9OworCisgICAgICAkc2NvcGUucmVzZXQoKTsKKyAgICB9XSk7CisgPC9zY3JpcHQ+CisgPC9maWxlPgorIDwvZXhhbXBsZT4KKyAqLworZnVuY3Rpb24gY29weShzb3VyY2UsIGRlc3RpbmF0aW9uLCBzdGFja1NvdXJjZSwgc3RhY2tEZXN0KSB7CisgIGlmIChpc1dpbmRvdyhzb3VyY2UpIHx8IGlzU2NvcGUoc291cmNlKSkgeworICAgIHRocm93IG5nTWluRXJyKCdjcHdzJywKKyAgICAgICJDYW4ndCBjb3B5ISBNYWtpbmcgY29waWVzIG9mIFdpbmRvdyBvciBTY29wZSBpbnN0YW5jZXMgaXMgbm90IHN1cHBvcnRlZC4iKTsKKyAgfQorCisgIGlmICghZGVzdGluYXRpb24pIHsKKyAgICBkZXN0aW5hdGlvbiA9IHNvdXJjZTsKKyAgICBpZiAoc291cmNlKSB7CisgICAgICBpZiAoaXNBcnJheShzb3VyY2UpKSB7CisgICAgICAgIGRlc3RpbmF0aW9uID0gY29weShzb3VyY2UsIFtdLCBzdGFja1NvdXJjZSwgc3RhY2tEZXN0KTsKKyAgICAgIH0gZWxzZSBpZiAoaXNEYXRlKHNvdXJjZSkpIHsKKyAgICAgICAgZGVzdGluYXRpb24gPSBuZXcgRGF0ZShzb3VyY2UuZ2V0VGltZSgpKTsKKyAgICAgIH0gZWxzZSBpZiAoaXNSZWdFeHAoc291cmNlKSkgeworICAgICAgICBkZXN0aW5hdGlvbiA9IG5ldyBSZWdFeHAoc291cmNlLnNvdXJjZSwgc291cmNlLnRvU3RyaW5nKCkubWF0Y2goL1teXC9dKiQvKVswXSk7CisgICAgICAgIGRlc3RpbmF0aW9uLmxhc3RJbmRleCA9IHNvdXJjZS5sYXN0SW5kZXg7CisgICAgICB9IGVsc2UgaWYgKGlzT2JqZWN0KHNvdXJjZSkpIHsKKyAgICAgICAgZGVzdGluYXRpb24gPSBjb3B5KHNvdXJjZSwge30sIHN0YWNrU291cmNlLCBzdGFja0Rlc3QpOworICAgICAgfQorICAgIH0KKyAgfSBlbHNlIHsKKyAgICBpZiAoc291cmNlID09PSBkZXN0aW5hdGlvbikgdGhyb3cgbmdNaW5FcnIoJ2NwaScsCisgICAgICAiQ2FuJ3QgY29weSEgU291cmNlIGFuZCBkZXN0aW5hdGlvbiBhcmUgaWRlbnRpY2FsLiIpOworCisgICAgc3RhY2tTb3VyY2UgPSBzdGFja1NvdXJjZSB8fCBbXTsKKyAgICBzdGFja0Rlc3QgPSBzdGFja0Rlc3QgfHwgW107CisKKyAgICBpZiAoaXNPYmplY3Qoc291cmNlKSkgeworICAgICAgdmFyIGluZGV4ID0gaW5kZXhPZihzdGFja1NvdXJjZSwgc291cmNlKTsKKyAgICAgIGlmIChpbmRleCAhPT0gLTEpIHJldHVybiBzdGFja0Rlc3RbaW5kZXhdOworCisgICAgICBzdGFja1NvdXJjZS5wdXNoKHNvdXJjZSk7CisgICAgICBzdGFja0Rlc3QucHVzaChkZXN0aW5hdGlvbik7CisgICAgfQorCisgICAgdmFyIHJlc3VsdDsKKyAgICBpZiAoaXNBcnJheShzb3VyY2UpKSB7CisgICAgICBkZXN0aW5hdGlvbi5sZW5ndGggPSAwOworICAgICAgZm9yICggdmFyIGkgPSAwOyBpIDwgc291cmNlLmxlbmd0aDsgaSsrKSB7CisgICAgICAgIHJlc3VsdCA9IGNvcHkoc291cmNlW2ldLCBudWxsLCBzdGFja1NvdXJjZSwgc3RhY2tEZXN0KTsKKyAgICAgICAgaWYgKGlzT2JqZWN0KHNvdXJjZVtpXSkpIHsKKyAgICAgICAgICBzdGFja1NvdXJjZS5wdXNoKHNvdXJjZVtpXSk7CisgICAgICAgICAgc3RhY2tEZXN0LnB1c2gocmVzdWx0KTsKKyAgICAgICAgfQorICAgICAgICBkZXN0aW5hdGlvbi5wdXNoKHJlc3VsdCk7CisgICAgICB9CisgICAgfSBlbHNlIHsKKyAgICAgIHZhciBoID0gZGVzdGluYXRpb24uJCRoYXNoS2V5OworICAgICAgaWYgKGlzQXJyYXkoZGVzdGluYXRpb24pKSB7CisgICAgICAgIGRlc3RpbmF0aW9uLmxlbmd0aCA9IDA7CisgICAgICB9IGVsc2UgeworICAgICAgICBmb3JFYWNoKGRlc3RpbmF0aW9uLCBmdW5jdGlvbih2YWx1ZSwga2V5KSB7CisgICAgICAgICAgZGVsZXRlIGRlc3RpbmF0aW9uW2tleV07CisgICAgICAgIH0pOworICAgICAgfQorICAgICAgZm9yICggdmFyIGtleSBpbiBzb3VyY2UpIHsKKyAgICAgICAgcmVzdWx0ID0gY29weShzb3VyY2Vba2V5XSwgbnVsbCwgc3RhY2tTb3VyY2UsIHN0YWNrRGVzdCk7CisgICAgICAgIGlmIChpc09iamVjdChzb3VyY2Vba2V5XSkpIHsKKyAgICAgICAgICBzdGFja1NvdXJjZS5wdXNoKHNvdXJjZVtrZXldKTsKKyAgICAgICAgICBzdGFja0Rlc3QucHVzaChyZXN1bHQpOworICAgICAgICB9CisgICAgICAgIGRlc3RpbmF0aW9uW2tleV0gPSByZXN1bHQ7CisgICAgICB9CisgICAgICBzZXRIYXNoS2V5KGRlc3RpbmF0aW9uLGgpOworICAgIH0KKworICB9CisgIHJldHVybiBkZXN0aW5hdGlvbjsKK30KKworLyoqCisgKiBDcmVhdGVzIGEgc2hhbGxvdyBjb3B5IG9mIGFuIG9iamVjdCwgYW4gYXJyYXkgb3IgYSBwcmltaXRpd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b3cobzIpIHx8IGlzQXJyYXkobzIpKSByZXR1cm4gZmFsc2U7CisgICAgICAgIGtleVNldCA9IHt9OworICAgICAgICBmb3Ioa2V5IGluIG8xKSB7CisgICAgICAgICAgaWYgKGtleS5jaGFyQXQoMCkgPT09ICckJyB8fCBpc0Z1bmN0aW9uKG8xW2tleV0pKSBjb250aW51ZTsKKyAgICAgICAgICBpZiAoIWVxdWFscyhvMVtrZXldLCBvMltrZXldKSkgcmV0dXJuIGZhbHNlOworICAgICAgICAgIGtleVNldFtrZXldID0gdHJ1ZTsKKyAgICAgICAgfQorICAgICAgICBmb3Ioa2V5IGluIG8yKSB7CisgICAgICAgICAgaWYgKCFrZXlTZXQuaGFzT3duUHJvcGVydHkoa2V5KSAmJgorICAgICAgICAgICAgICBrZXkuY2hhckF0KDApICE9PSAnJCcgJiYKKyAgICAgICAgICAgICAgbzJba2V5XSAhPT0gdW5kZWZpbmVkICYmCisgICAgICAgICAgICAgICFpc0Z1bmN0aW9uKG8yW2tleV0pKSByZXR1cm4gZmFsc2U7CisgICAgICAgIH0KKyAgICAgICAgcmV0dXJuIHRydWU7CisgICAgICB9CisgICAgfQorICB9CisgIHJldHVybiBmYWxzZTsKK30KKwordmFyIGNzcCA9IGZ1bmN0aW9uKCkgeworICBpZiAoaXNEZWZpbmVkKGNzcC5pc0FjdGl2ZV8pKSByZXR1cm4gY3NwLmlzQWN0aXZlXzsKKworICB2YXIgYWN0aXZlID0gISEoZG9jdW1lbnQucXVlcnlTZWxlY3RvcignW25nLWNzcF0nKSB8fAorICAgICAgICAgICAgICAgICAgZG9jdW1lbnQucXVlcnlTZWxlY3RvcignW2RhdGEtbmctY3NwXScpKTsKKworICBpZiAoIWFjdGl2ZSkgeworICAgIHRyeSB7CisgICAgICAvKiBqc2hpbnQgLVcwMzEsIC1XMDU0ICovCisgICAgICBuZXcgRnVuY3Rpb24oJycpOworICAgICAgLyoganNoaW50ICtXMDMxLCArVzA1NCAqLworICAgIH0gY2F0Y2ggKGU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0ga2V5VmFsdWUucmVwbGFjZSgvXCsvZywnJTIwJykuc3BsaXQoJz0nKTsKKyAgICAgIGtleSA9IHRyeURlY29kZVVSSUNvbXBvbmVudChrZXlfdmFsdWVbMF0pOworICAgICAgaWYgKCBpc0RlZmluZWQoa2V5KSApIHsKKyAgICAgICAgdmFyIHZhbCA9IGlzRGVmaW5lZChrZXlfdmFsdWVbMV0pID8gdHJ5RGVjb2RlVVJJQ29tcG9uZW50KGtleV92YWx1ZVsxXSkgOiB0cnVlOworICAgICAgICBpZiAoIWhhc093blByb3BlcnR5LmNhbGwob2JqLCBrZXkpKSB7CisgICAgICAgICAgb2JqW2tleV0gPSB2YWw7CisgICAgICAgIH0gZWxzZSBpZihpc0FycmF5KG9ialtrZXldKSkgeworICAgICAgICAgIG9ialtrZXldLnB1c2godmFsKTsKKyAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICBvYmpba2V5XSA9IFtvYmpba2V5XSx2YWxdOworICAgICAgICB9CisgICAgICB9CisgICAgfQorICB9KTsKKyAgcmV0dXJuIG9iajsKK30KKworZnVuY3Rpb24gdG9LZXlWYWx1ZShvYmopIHsKKyAgdmFyIHBhcnRzID0gW107CisgIGZvckVhY2gob2JqLCBmdW5jdGlvbih2YWx1ZSwga2V5KSB7CisgICAgaWYgKGlzQXJyYXkodmFsdWUpKSB7CisgICAgICBmb3JFYWNoKHZhbHVlLCBmdW5jdGlvbihhcnJheVZhbHVlKSB7CisgICAgICAgIHBhcnRzLnB1c2goZW5jb2RlVXJpUXVlcnkoa2V5LCB0cnVlKSArCisgICAgICAgICAgICAgICAgICAgKGFycmF5VmFsdWUgPT09IHRydWUgPyAnJyA6ICc9JyArIGVuY29kZVVyaVF1ZXJ5KGFycmF5VmFsdWUsIHRydWUpKSk7CisgICAgICB9KTsKKyAgICB9IGVsc2UgeworICAgIHBhcnRzLnB1c2goZW5jb2RlVXJpUXVlcnkoa2V5LCB0cnVlKSArCisgICAgICAgICAgICAgICAodmFsdWUgPT09IH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jyk7CisgICAgaWYgKGVsZW1lbnQucXVlcnlTZWxlY3RvckFsbCkgeworICAgICAgZm9yRWFjaChlbGVtZW50LnF1ZXJ5U2VsZWN0b3JBbGwoJy4nICsgbmFtZSksIGFwcGVuZCk7CisgICAgICBmb3JFYWNoKGVsZW1lbnQucXVlcnlTZWxlY3RvckFsbCgnLicgKyBuYW1lICsgJ1xcOicpLCBhcHBlbmQpOworICAgICAgZm9yRWFjaChlbGVtZW50LnF1ZXJ5U2VsZWN0b3JBbGwoJ1snICsgbmFtZSArICddJyksIGFwcGVuZCk7CisgICAgfQorICB9KTsKKworICBmb3JFYWNoKGVsZW1lbnRzLCBmdW5jdGlvbihlbGVtZW50KSB7CisgICAgaWYgKCFhcHBFbGVtZW50KSB7CisgICAgICB2YXIgY2xhc3NOYW1lID0gJyAnICsgZWxlbWVudC5jbGFzc05hbWUgKyAnICc7CisgICAgICB2YXIgbWF0Y2ggPSBOR19BUFBfQ0xBU1NfUkVHRVhQLmV4ZWMoY2xhc3NOYW1lKTsKKyAgICAgIGlmIChtYXRjaCkgeworICAgICAgICBhcHBFbGVtZW50ID0gZWxlbWVudDsKKyAgICAgICAgbW9kdWxlID0gKG1hdGNoWzJdIHx8ICcnKS5yZXBsYWNlKC9ccysvZywgJywnKTsKKyAgICAgIH0gZWxzZSB7CisgICAgICAgIGZvckVhY2goZWxlbWVudC5hdHRyaWJ1dGVzLCBmdW5jdGlvbihhdHRyKSB7CisgICAgICAgICAgaWYgKCFhcHBFbGVtZW50ICYmIG5hbWVzW2F0dHIubmFtZV0pIHsKKyAgICAgICAgICAgIGFwcEVsZW1lbnQgPSBlbGVtZW50OworICAgICAgICAgICAgbW9kdWxlID0gYXR0ci52YWx1ZTsKKyAgICAgICAgICB9CisgICAgICAgIH0pOworICAgICAgfQorICAgIH0KKyAgfSk7CisgIGlmIChhcHBFbGVtZW50KSB7CisgICAgYm9vdHN0cmFwKGFwcEVsZW1lbnQsIG1vZHVsZSA/IFttb2R1bGVdIDogW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isgICAgICAgICAgJ2J0c3RycGQnLAorICAgICAgICAgICJBcHAgQWxyZWFkeSBCb290c3RyYXBwZWQgd2l0aCB0aGlzIEVsZW1lbnQgJ3swfSciLAorICAgICAgICAgIHRhZy5yZXBsYWNlKC88LywnJmx0OycpLnJlcGxhY2UoLz4vLCcmZ3Q7JykpOworICAgIH0KKworICAgIG1vZHVsZXMgPSBtb2R1bGVzIHx8IFtdOworICAgIG1vZHVsZXMudW5zaGlmdChbJyRwcm92aWRlJywgZnVuY3Rpb24oJHByb3ZpZGUpIHsKKyAgICAgICRwcm92aWRlLnZhbHVlKCckcm9vdEVsZW1lbnQnLCBlbGVtZW50KTsKKyAgICB9XSk7CisgICAgbW9kdWxlcy51bnNoaWZ0KCduZycpOworICAgIHZhciBpbmplY3RvciA9IGNyZWF0ZUluamVjdG9yKG1vZHVsZXMpOworICAgIGluamVjdG9yLmludm9rZShbJyRyb290U2NvcGUnLCAnJHJvb3RFbGVtZW50JywgJyRjb21waWxlJywgJyRpbmplY3RvcicsICckYW5pbWF0ZScsCisgICAgICAgZnVuY3Rpb24oc2NvcGUsIGVsZW1lbnQsIGNvbXBpbGUsIGluamVjdG9yLCBhbmltYXRlKSB7CisgICAgICAgIHNjb3BlLiRhcHBseShmdW5jdGlvbigpIHsKKyAgICAgICAgICBlbGVtZW50LmRhdGEoJyRpbmplY3RvcicsIGluamVjdG9yKTsKKyAgICAgICAgICBjb21waWxlKGVsZW1lbnQpKHNjb3BlKTsKKyAgICAgICAgfSk7CisgICAgICB9XQorICAgICk7CisgICAgcmV0dXJuIGluamVjdG9yOworICB9OworCisgIHZhciBOR19ERUZFUl9CT09UU1RSQVAgPSAvXk5HX0RFRkVSX0JPT1RTVFJBUCEvOworCisgIGlmICh3aW5kb3cgJiYgIU5HX0RFRkVSX0JPT1RTVFJBUC50ZXN0KHdpbmRvdy5uYW1lKSkgeworICAgIHJldHVybiBkb0Jvb3RzdHJhcCgpOworICB9CisKKyAgd2luZG93Lm5hbWUgPSB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gorICAgICAqIEEgbW9kdWxlIGlzIGEgY29sbGVjdGlvbiBvZiBzZXJ2aWNlcywgZGlyZWN0aXZlcywgY29udHJvbGxlcnMsIGZpbHRlcnMsIGFuZCBjb25maWd1cmF0aW9uIGluZm9ybWF0aW9uLgorICAgICAqIGBhbmd1bGFyLm1vZHVsZWAgaXMgdXNlZCB0byBjb25maWd1cmUgdGhlIHtAbGluayBhdXRvLiRpbmplY3RvciAkaW5qZWN0b3J9LgorICAgICAqCisgICAgICogYGBganMKKyAgICAgKiAvLyBDcmVhdGUgYSBuZXcgbW9kdWxlCisgICAgICogdmFyIG15TW9kdWxlID0gYW5ndWxhci5tb2R1bGUoJ215TW9kdWxlJywgW10pOworICAgICAqCisgICAgICogLy8gcmVnaXN0ZXIgYSBuZXcgc2VydmljZQorICAgICAqIG15TW9kdWxlLnZhbHVlKCdhcHBOYW1lJywgJ015Q29vbEFwcCcpOworICAgICAqCisgICAgICogLy8gY29uZmlndXJlIGV4aXN0aW5nIHNlcnZpY2VzIGluc2lkZSBpbml0aWFsaXphdGlvbiBibG9ja3MuCisgICAgICogbXlNb2R1bGUuY29uZmlnKFsnJGxvY2F0aW9uUHJvdmlkZXInLCBmdW5jdGlvbigkbG9jYXRpb25Qcm92aWRlcikgeworICAgICAqICAgLy8gQ29uZmlndXJlIGV4aXN0aW5nIHByb3ZpZGVycworICAgICAqICAgJGxvY2F0aW9uUHJvdmlkZXIuaGFzaFByZWZpeCgnIScpOworICAgICAqIH1dKTsKKyAgICAgKiBgYGAKKyAgICAgKgorICAgICAqIFRoZW4geW91IGNhbiBjcmVhdGUgYW4gaW5qZWN0b3IgYW5kIGxvYWQgeW91ciBtb2R1bGVzIGxpa2UgdGhpczoKKyAgICAgKgorICAgICAqIGBgYGpzCisgICAgICogdmFyIGluamVjdG9yID0gYW5ndWxhci5pbmplY3RvcihbJ25nJywgJ215TW9kdWxlJ10pCisgICAgICogYGBgCisgICAgICoKKyAgICAgKiBIb3dldmVyIGl0J3MgbW9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YWRuYW1lJywgJ2hhc093blByb3BlcnR5IGlzIG5vdCBhIHZhbGlkIHswfSBuYW1lJywgY29udGV4dCk7CisgICAgICAgIH0KKyAgICAgIH07CisKKyAgICAgIGFzc2VydE5vdEhhc093blByb3BlcnR5KG5hbWUsICdtb2R1bGUnKTsKKyAgICAgIGlmIChyZXF1aXJlcyAmJiBtb2R1bGVzLmhhc093blByb3BlcnR5KG5hbWUpKSB7CisgICAgICAgIG1vZHVsZXNbbmFtZV0gPSBudWxsOworICAgICAgfQorICAgICAgcmV0dXJuIGVuc3VyZShtb2R1bGVzLCBuYW1lLCBmdW5jdGlvbigpIHsKKyAgICAgICAgaWYgKCFyZXF1aXJlcykgeworICAgICAgICAgIHRocm93ICRpbmplY3Rvck1pbkVycignbm9tb2QnLCAiTW9kdWxlICd7MH0nIGlzIG5vdCBhdmFpbGFibGUhIFlvdSBlaXRoZXIgbWlzc3BlbGxlZCAiICsKKyAgICAgICAgICAgICAidGhlIG1vZHVsZSBuYW1lIG9yIGZvcmdvdCB0byBsb2FkIGl0LiBJZiByZWdpc3RlcmluZyBhIG1vZHVsZSBlbnN1cmUgdGhhdCB5b3UgIiArCisgICAgICAgICAgICAgInNwZWNpZnkgdGhlIGRlcGVuZGVuY2llcyBhcyB0aGUgc2Vjb25kIGFyZ3VtZW50LiIsIG5hbWUpOworICAgICAgICB9CisKKyAgICAgICAgLyoqIEB0eXBlIHshQXJyYXkuPEFycmF5LjwqPj59ICovCisgICAgICAgIHZhciBpbnZva2VRdWV1ZSA9IFtdOworCisgICAgICAgIC8qKiBAdHlwZSB7IUFycmF5LjxGdW5jdGlvbj59ICovCisgICAgICAgIHZhciBydW5CbG9ja3MgPSBbXTsKKworICAgICAgICB2YXIgY29uZmlnID0gaW52b2tlTGF0ZXIoJyRpbmplY3RvcicsICdpbnZva2UnKTsKKworICAgICAgICAvKiogQHR5cGUge2FuZ3VsYXIuTW9kdWxlfSAqLworICAgICAgICB2YXIgbW9kdWxlSW5zdGFuY2UgPSB7CisgICAgICAgICAgLy8gUHJpdmF0ZSBzdGF0ZQorICAgICAgICAgIF9pbnZva2VRdWV1ZTogaW52b2tlUXVldWUsCisgICAgICAgICAgX3J1bkJsb2NrczogcnVuQmxvY2tzLAorCisgICAgICAgICAgLyoqCisgICAgICAgICAgICogQG5nZG9jIHByb3BlcnR5CisgICAgICAgICAgICogQG5hbWUgYW5ndWxhci5Nb2R1bGUjcmVxdWlyZXMKKyAgICAgICAgICAgKiBAbW9kdWxlIG5nCisgICAgICAgICAgICoKKyAgICAgICAgICAgKiBAZGVzY3JpcHRpb24KKyAgICAgICAgICAgKiBIb2xkcyB0aGUgbGlzdCBvZiBtb2R1bGVzIHdoaWNoIHRoZSBpbmplY3RvciB3aWxsIGxvYWQgYmVmb3JlIHRoZSBjdXJyZW50IG1vZHVsZSBpcworICAgICAgICAgICAqIGxvYWRlZC4KKyAgICAgICAgICAgKi8KKyAgICAgICAgICByZXF1aXJlczogcmVxdWlyZXMsCisKKyAgICAgICAgICAvKioKKyAgICAgICAgICAgKiBAbmdkb2MgcHJvcGVydHkKKyAgICAgICAgICAgKiBAbmFtZSBhbmd1bGFyLk1vZHVsZSNuYW1lCisgICAgICAgICAgICogQG1vZHVsZSBuZworICAgICAgICAgICAqCisgICAgICAgICAgICogQGRlc2NyaXB0aW9uCisgICAgICAgICAgICogTmFtZSBvZiB0aGUgbW9kdWxlLgorICAgICAgICAgICAqLworICAgICAgICAgIG5hbWU6IG5hbWUsCisKKworICAgICAgICAgIC8qKgorICAgICAgICAgICAqIEBuZ2RvYyBtZXRob2QKKyAgICAgICAgICAgKiBAbmFtZSBhbmd1bGFyLk1vZHVsZSNwcm92aWRlcgorICAgICAgICAgICAqIEBtb2R1bGUgbmcKKyAgICAgICAgICAgKiBAcGFyYW0ge3N0cmluZ30gbmFtZSBzZXJ2aWNlIG5hbWUKKyAgICAgICAgICAgKiBAcGFyYW0ge0Z1bmN0aW9ufSBwcm92aWRlclR5cGUgQ29uc3RydWN0aW9uIGZ1bmN0aW9uIGZvciBjcmVhdGluZyBuZXcgaW5zdGFuY2Ugb2YgdGhlCisgICAgICAgICAgICogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNlcnZpY2UuCisgICAgICAgICAgICogQGRlc2NyaXB0aW9uCisgICAgICAgICAgICogU2VlIHtAbGluayBhdXRvLiRwcm92aWRlI3Byb3ZpZGVyICRwcm92aWRlLnByb3ZpZGVyKCl9LgorICAgICAgICAgICAqLworICAgICAgICAgIHByb3ZpZGVyOiBpbnZva2VMYXRlcignJHByb3ZpZGUnLCAncHJvdmlkZXInKSwKKworICAgICAgICAgIC8qKgorICAgICAgICAgICAqIEBuZ2RvYyBtZXRob2QKKyAgICAgICAgICAgKiBAbmFtZSBhbmd1bGFyLk1vZHVsZSNmYWN0b3J5CisgICAgICAgICAgICogQG1vZHVsZSBuZworICAgICAgICAgICAqIEBwYXJhbSB7c3RyaW5nfSBuYW1lIHNlcnZpY2UgbmFtZQorICAgICAgICAgICAqIEBwYXJhbSB7RnVuY3Rpb259IHByb3ZpZGVyRnVuY3Rpb24gRnVuY3Rpb24gZm9yIGNyZWF0aW5nIG5ldyBpbnN0YW5jZSBvZiB0aGUgc2VydmljZS4KKyAgICAgICAgICAgKiBAZGVzY3JpcHRpb24KKyAgICAgICAgICAgKiBTZWUge0BsaW5rIGF1dG8uJHByb3ZpZGUjZmFjdG9yeSAkcHJvdmlkZS5mYWN0b3J5KCl9LgorICAgICAgICAgICAqLworICAgICAgICAgIGZhY3Rvcnk6IGludm9rZUxhdGVyKCckcHJvdmlkZScsICdmYWN0b3J5JyksCisKKyAgICAgICAgICAvKioKKyAgICAgICAgICAgKiBAbmdkb2MgbWV0aG9kCisgICAgICAgICAgICogQG5hbWUgYW5ndWxhci5Nb2R1bGUjc2VydmljZQorICAgICAgICAgICAqIEBtb2R1bGUgbmcKKyAgICAgICAgICAgKiBAcGFyYW0ge3N0cmluZ30gbmFtZSBzZXJ2aWNlIG5hbWUKKyAgICAgICAgICAgKiBAcGFyYW0ge0Z1bmN0aW9ufSBjb25zdHJ1Y3RvciBBIGNvbnN0cnVjdG9yIGZ1bmN0aW9uIHRoYXQgd2lsbCBiZSBpbnN0YW50aWF0ZWQuCisgICAgICAgICAgICogQGRlc2NyaXB0aW9uCisgICAgICAgICAgICogU2VlIHtAbGluayBhdXRvLiRwcm92aWRlI3NlcnZpY2UgJHByb3ZpZGUuc2VydmljZSgpfS4KKyAgICAgICAgICAgKi8KKyAgICAgICAgICBzZXJ2aWNlOiBpbnZva2VMYXRlcignJHByb3ZpZGUnLCAnc2VydmljZScpLAorCisgICAgICAgICAgLyoqCisgICAgICAgICAgICogQG5nZG9jIG1ldGhvZAorICAgICAgICAgICAqIEBuYW1lIGFuZ3VsYXIuTW9kdWxlI3ZhbHVlCisgICAgICAgICAgICogQG1vZHVsZSBuZworICAgICAgICAgICAqIEBwYXJhbSB7c3RyaW5nfSBuYW1lIHNlcnZpY2UgbmFtZQorICAgICAgICAgICAqIEBwYXJhbSB7Kn0gb2JqZWN0IFNlcnZpY2UgaW5zdGFuY2Ugb2JqZWN0LgorICAgICAgICAgICAqIEBkZXNjcmlwdGlvbgorICAgICAgICAgICAqIFNlZSB7QGxpbmsgYXV0by4kcHJvdmlkZSN2YWx1ZSAkcHJvdmlkZS52YWx1ZSgpfS4KKyAgICAgICAgICAgKi8KKyAgICAgICAgICB2YWx1ZTogaW52b2tlTGF0ZXIoJyRwcm92aWRlJywgJ3ZhbHVlJyksCisKKyAgICAgICAgICAvKioKKyAgICAgICAgICAgKiBAbmdkb2MgbWV0aG9kCisgICAgICAgICAgICogQG5hbWUgYW5ndWxhci5Nb2R1bGUjY29uc3RhbnQKKyAgICAgICAgICAgKiBAbW9kdWxlIG5nCisgICAgICAgICAgICogQHBhcmFtIHtzdHJpbmd9IG5hbWUgY29uc3RhbnQgbmFtZQorICAgICAgICAgICAqIEBwYXJhbSB7Kn0gb2JqZWN0IENvbnN0YW50IHZhbHVlLgorICAgICAgICAgICAqIEBkZXNjcmlwdGlvbgorICAgICAgICAgICAqIEJlY2F1c2UgdGhlIGNvbnN0YW50IGFyZSBmaXhlZCwgdGhleSBnZXQgYXBwbGllZCBiZWZvcmUgb3RoZXIgcHJvdmlkZSBtZXRob2RzLgorICAgICAgICAgICAqIFNlZSB7QGxpbmsgYXV0by4kcHJvdmlkZSNjb25zdGFudCAkcHJvdmlkZS5jb25zdGFudCgpfS4KKyAgICAgICAgICAgKi8KKyAgICAgICAgICBjb25zdGFudDogaW52b2tlTGF0ZXIoJyRwcm92aWRlJywgJ2NvbnN0YW50JywgJ3Vuc2hpZnQnKSwKKworICAgICAgICAgIC8qKgorICAgICAgICAgICAqIEBuZ2RvYyBtZXRob2QKKyAgICAgICAgICAgKiBAbmFtZSBhbmd1bGFyLk1vZHVsZSNhbmltYXRpb24KKyAgICAgICAgICAgKiBAbW9kdWxlIG5nCisgICAgICAgICAgICogQHBhcmFtIHtzdHJpbmd9IG5hbWUgYW5pbWF0aW9uIG5hbWUKKyAgICAgICAgICAgKiBAcGFyYW0ge0Z1bmN0aW9ufSBhbmltYXRpb25GYWN0b3J5IEZhY3RvcnkgZnVuY3Rpb24gZm9yIGNyZWF0aW5nIG5ldyBpbnN0YW5jZSBvZiBhbgorICAgICAgICAgICAqICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYW5pbWF0aW9uLgorICAgICAgICAgICAqIEBkZXNjcmlwdGlvbgorICAgICAgICAgICAqCisgICAgICAgICAgICogKipOT1RFKio6IGFuaW1hdGlvbnMgdGFrZSBlZmZlY3Qgb25seSBpZiB0aGUgKipuZ0FuaW1hdGUqKiBtb2R1bGUgaXMgbG9hZGVkLgorICAgICAgICAgICAqCisgICAgICAgICAgICoKKyAgICAgICAgICAgKiBEZWZpbmVzIGFuIGFuaW1hdGlvbiBob29rIHRoYXQgY2FuIGJlIGxhdGVyIHVzZWQgd2l0aAorICAgICAgICAgICAqIHtAbGluayBuZ0FuaW1hdGUuJGFuaW1hdGUgJGFuaW1hdGV9IHNlcnZpY2UgYW5kIGRpcmVjdGl2ZXMgdGhhdCB1c2UgdGhpcyBzZXJ2aWNlLgorICAgICAgICAgICAqCisgICAgICAgICAgICogYGBganMKKyAgICAgICAgICAgKiBtb2R1bGUuYW5pbWF0aW9uKCcuYW5pbWF0aW9uLW5hbWUnLCBmdW5jdGlvbigkaW5qZWN0MSwgJGluamVjdDIpIHsKKyAgICAgICAgICAgKiAgIHJldHVybiB7CisgICAgICAgICAgICogICAgIGV2ZW50TmFtZSA6IGZ1bmN0aW9uKGVsZW1lbnQsIGRvbmUpIHsKKyAgICAgICAgICAgKiAgICAgICAvL2NvZGUgdG8gcnVuIHRoZSBhbmltYXRpb24KKyAgICAgICAgICAgKiAgICAgICAvL29uY2UgY29tcGxldGUsIHRoZW4gcnVuIGRvbmUoKQorICAgICAgICAgICAqICAgICAgIHJldHVybiBmdW5jdGlvbiBjYW5jZWxsYXRpb25GdW5jdGlvbihlbGVtZW50KSB7CisgICAgICAgICAgICogICAgICAgICAvL2NvZGUgdG8gY2FuY2VsIHRoZSBhbmltYXRpb24KKyAgICAgICAgICAgKiAgICAgICB9CisgICAgICAgICAgICogICAgIH0KKyAgICAgICAgICAgKiAgIH0KKyAgICAgICAgICAgKiB9KQorICAgICAgICAgICAqIGBgYAorICAgICAgICAgICAqCisgICAgICAgICAgICogU2VlIHtAbGluayBuZ0FuaW1hdGUuJGFuaW1hdGVQcm92aWRlciNyZWdpc3RlciAkYW5pbWF0ZVByb3ZpZGVyLnJlZ2lzdGVyKCl9IGFuZAorICAgICAgICAgICAqIHtAbGluayBuZ0FuaW1hdGUgbmdBbmltYXRlIG1vZHVsZX0gZm9yIG1vcmUgaW5mb3JtYXRpb24uCisgICAgICAgICAgICovCisgICAgICAgICAgYW5pbWF0aW9uOiBpbnZva2VMYXRlcignJGFuaW1hdGVQcm92aWRlcicsICdyZWdpc3RlcicpLAorCisgICAgICAgICAgLyoqCisgICAgICAgICAgICogQG5nZG9jIG1ldGhvZA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FkaW5nIGFsbCBtb2R1bGVzLgorICAgICAgICAgICAqLworICAgICAgICAgIHJ1bjogZnVuY3Rpb24oYmxvY2spIHsKKyAgICAgICAgICAgIHJ1bkJsb2Nrcy5wdXNoKGJsb2NrKTsKKyAgICAgICAgICAgIHJldHVybiB0aGlzOworICAgICAgICAgIH0KKyAgICAgICAgfTsKKworICAgICAgICBpZiAoY29uZmlnRm4pIHsKKyAgICAgICAgICBjb25maWcoY29uZmlnRm4pOworICAgICAgICB9CisKKyAgICAgICAgcmV0dXJuICBtb2R1bGVJbnN0YW5jZTsKKworICAgICAgICAvKioKKyAgICAgICAgICogQHBhcmFtIHtzdHJpbmd9IHByb3ZpZGVyCisgICAgICAgICAqIEBwYXJhbSB7c3RyaW5nfSBtZXRob2QKKyAgICAgICAgICogQHBhcmFtIHtTdHJpbmc9fSBpbnNlcnRNZXRob2QKKyAgICAgICAgICogQHJldHVybnMge2FuZ3VsYXIuTW9kdWxlfQorICAgICAgICAgKi8KKyAgICAgICAgZnVuY3Rpb24gaW52b2tlTGF0ZXIocHJvdmlkZXIsIG1ldGhvZCwgaW5zZXJ0TWV0aG9kKSB7CisgICAgICAgICAgcmV0dXJuIGZ1bmN0aW9uKCkgeworICAgICAgICAgICAgaW52b2tlUXVldWVbaW5zZXJ0TWV0aG9kIHx8ICdwdXNoJ10oW3Byb3ZpZGVyLCBtZXRob2QsIGFyZ3VtZW50c10pOworICAgICAgICAgICAgcmV0dXJuIG1vZHVsZUluc3RhbmNlOworICAgICAgICAgIH07CisgICAgICAgIH0KKyAgICAgIH0pOworICAgIH07CisgIH0pOworCit9CisKKy8qIGdsb2JhbCBhbmd1bGFyTW9kdWxlOiB0cnVlLAorICB2ZXJzaW9uOiB0cnVlLAorCisgICRMb2NhbGVQcm92aWRlciwKKyAgJENvbXBpbGVQcm92aWRlciwKKworICAgIGh0bWxBbmNob3JEaXJlY3RpdmUsCisgICAgaW5wdXREaXJlY3RpdmUsCisgICAgaW5wdXREaXJlY3RpdmU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gIH0sCisKKyAgY29udHJvbGxlcjoganFMaXRlQ29udHJvbGxlciwKKworICBpbmplY3RvcjogZnVuY3Rpb24oZWxlbWVudCkgeworICAgIHJldHVybiBqcUxpdGVJbmhlcml0ZWREYXRhKGVsZW1lbnQsICckaW5qZWN0b3InKTsKKyAgfSwKKworICByZW1vdmVBdHRyOiBmdW5jdGlvbihlbGVtZW50LG5hbWUpIHsKKyAgICBlbGVtZW50LnJlbW92ZUF0dHJpYnV0ZShuYW1lKTsKKyAgfSwKKworICBoYXNDbGFzczoganFMaXRlSGFzQ2xhc3MsCisKKyAgY3NzOiBmdW5jdGlvbihlbGVtZW50LCBuYW1lLCB2YWx1ZSkgeworICAgIG5hbWUgPSBjYW1lbENhc2UobmFtZSk7CisKKyAgICBpZiAoaXNEZWZpbmVkKHZhbHVlKSkgeworICAgICAgZWxlbWVudC5zdHlsZVtuYW1lXSA9IHZhbHVlOworICAgIH0gZWxzZSB7CisgICAgICB2YXIgdmFsOworCisgICAgICBpZiAobXNpZSA8PSA4KSB7CisgICAgICAgIC8vIHRoaXMgaXMgc29tZSBJRSBzcGVjaWZpYyB3ZWlyZG5lc3MgdGhhdCBqUXVlcnkgMS42LjQgZG9lcyBub3Qgc3VyZSB3aHkKKyAgICAgICAgdmFsID0gZWxlbWVudC5jdXJyZW50U3R5bGUgJiYgZWxlbWVudC5jdXJyZW50U3R5bGVbbmFtZV07CisgICAgICAgIGlmICh2YWwgPT09ICcnKSB2YWwgPSAnYXV0byc7CisgICAgICB9CisKKyAgICAgIHZhbCA9IHZhbCB8fCBlbGVtZW50LnN0eWxlW25hbWVdOworCisgICAgICBpZiAobXNpZSA8PSA4KSB7CisgICAgICAgIC8vIGpxdWVyeSB3ZWlyZG5lc3MgOi0vCisgICAgICAgIHZhbCA9ICh2YWwgPT09ICcnKSA/IHVuZGVmaW5lZCA6IHZhbDsKKyAgICAgIH0KKworICAgICAgcmV0dXJuICB2YWw7CisgICAgfQorICB9LAorCisgIGF0dHI6IGZ1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hciB0ZXh0UHJvcCA9IE5PREVfVFlQRV9URVhUX1BST1BFUlRZW2VsZW1lbnQubm9kZVR5cGVdOworICAgICAgaWYgKGlzVW5kZWZpbmVkKHZhbHVlKSkgeworICAgICAgICByZXR1cm4gdGV4dFByb3AgPyBlbGVtZW50W3RleHRQcm9wXSA6ICcnOworICAgICAgfQorICAgICAgZWxlbWVudFt0ZXh0UHJvcF0gPSB2YWx1ZTsKKyAgICB9CisgIH0pKCksCisKKyAgdmFsOiBmdW5jdGlvbihlbGVtZW50LCB2YWx1ZSkgeworICAgIGlmIChpc1VuZGVmaW5lZCh2YWx1ZSkpIHsKKyAgICAgIGlmIChub2RlTmFtZV8oZWxlbWVudCkgPT09ICdTRUxFQ1QnICYmIGVsZW1lbnQubXVsdGlwbGUpIHsKKyAgICAgICAgdmFyIHJlc3VsdCA9IFtdOworICAgICAgICBmb3JFYWNoKGVsZW1lbnQub3B0aW9ucywgZnVuY3Rpb24gKG9wdGlvbikgeworICAgICAgICAgIGlmIChvcHRpb24uc2VsZWN0ZWQpIHsKKyAgICAgICAgICAgIHJlc3VsdC5wdXNoKG9wdGlvbi52YWx1ZSB8fCBvcHRpb24udGV4dCk7CisgICAgICAgICAgfQorICAgICAgICB9KTsKKyAgICAgICAgcmV0dXJuIHJlc3VsdC5sZW5ndGggPT09IDAgPyBudWxsIDogcmVzdWx0OworICAgICAgfQorICAgICAgcmV0dXJuIGVsZW1lbnQudmFsdWU7CisgICAgfQorICAgIGVsZW1lbnQudmFsdWUgPSB2YWx1ZTsKKyAgfSwKKworICBodG1sOiBmdW5jdGlvbihlbGVtZW50LCB2YWx1ZSkgeworICAgIGlmIChpc1VuZGVmaW5lZCh2YWx1ZSkpIHsKKyAgICAgIHJldHVybiBlbGVtZW50LmlubmVySFRNTDsKKyAgICB9CisgICAgZm9yICh2YXIgaSA9IDAsIGNoaWxkTm9kZXMgPSBlbGVtZW50LmNoaWxkTm9kZXM7IGkgPCBjaGlsZE5vZGVzLmxlbmd0aD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krKykgeworICAgICAgICAgIGlmIChmbiA9PT0ganFMaXRlRGF0YSkgeworICAgICAgICAgICAgLy8gZGF0YSgpIHRha2VzIHRoZSB3aG9sZSBvYmplY3QgaW4galF1ZXJ5CisgICAgICAgICAgICBmbih0aGlzW2ldLCBhcmcxKTsKKyAgICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgZm9yIChrZXkgaW4gYXJnMSkgeworICAgICAgICAgICAgICBmbih0aGlzW2ldLCBrZXksIGFyZzFba2V5XSk7CisgICAgICAgICAgICB9CisgICAgICAgICAgfQorICAgICAgICB9CisgICAgICAgIC8vIHJldHVybiBzZWxmIGZvciBjaGFpbmluZworICAgICAgICByZXR1cm4gdGhpczsKKyAgICAgIH0gZWxzZSB7CisgICAgICAgIC8vIHdlIGFyZSBhIHJlYWQsIHNvIHJlYWQgdGhlIGZpcnN0IGNoaWxkLgorICAgICAgICAvLyBUT0RPOiBkbyB3ZSBzdGlsbCBuZWVkIHRoaXM/CisgICAgICAgIHZhciB2YWx1ZSA9IGZuLiRkdjsKKyAgICAgICAgLy8gT25seSBpZiB3ZSBoYXZlICRkdiBkbyB3ZSBpdGVyYXRlIG92ZXIgYWxsLCBvdGhlcndpc2UgaXQgaXMganVzdCB0aGUgZmlyc3QgZWxlbWVudC4KKyAgICAgICAgdmFyIGpqID0gKHZhbHVlID09PSB1bmRlZmluZWQpID8gTWF0aC5taW4obm9kZUNvdW50LCAxKSA6IG5vZGVDb3VudDsKKyAgICAgICAgZm9yICh2YXIgaiA9IDA7IGogPCBqajsgaisrKSB7CisgICAgICAgICAgdmFyIG5vZGVWYWx1ZSA9IGZuKHRoaXNbal0sIGFyZzEsIGFyZzIpOworICAgICAgICAgIHZhbHVlID0gdmFsdWUgPyB2YWx1ZSArIG5vZGVWYWx1ZSA6IG5vZGVWYWx1ZTsKKyAgICAgICAgfQorICAgICAgICByZXR1cm4gdmFsdWU7CisgICAgICB9CisgICAgfSBlbHNlIHsKKyAgICAgIC8vIHdlIGFyZSBhIHdyaXRlLCBzbyBhcHBseSB0byBhbGwgY2hpbGRyZW4KKyAgICAgIGZvciAoaSA9IDA7IGkgPCBub2RlQ291bnQ7IGkrKykgeworICAgICAgICBmbih0aGlzW2ldLCBhcmcxLCBhcmcyKTsKKyAgICAgIH0KKyAgICAgIC8vIHJldHVybiBzZWxmIGZvciBjaGFpbmluZworICAgICAgcmV0dXJuIHRoaXM7CisgICAgfQorICB9OworfSk7CisKK2Z1bmN0aW9uIGNyZWF0ZUV2ZW50SGFuZGxlcihlbGVtZW50LCBldmVudHMpIHsKKyAgdmFyIGV2ZW50SGFuZGxlciA9IGZ1bmN0aW9uIChldmVudCwgdHlwZSkgeworICAgIGlmICghZXZlbnQucHJldmVudERlZmF1bHQpIHsKKyAgICAgIGV2ZW50LnByZXZlbnREZWZhdWx0ID0gZnVuY3Rpb24oKSB7CisgICAgICAgIGV2ZW50LnJldHVyblZhbHVlID0gZmFsc2U7IC8vaWUKKyAgICAgIH07CisgICAgfQorCisgICAgaWYgKCFldmVudC5zdG9wUHJvcGFnYXRpb24pIHsKKyAgICAgIGV2ZW50LnN0b3BQcm9wYWdhdGlvbiA9IGZ1bmN0aW9uKCkgeworICAgICAgICBldmVudC5jYW5jZWxCdWJibGUgPSB0cnVlOyAvL2llCisgICAgICB9OworICAgIH0KKworICAgIGlmICghZXZlbnQudGFyZ2V0KSB7CisgICAgICBldmVudC50YXJnZXQgPSBldmVudC5zcmNFbGVtZW50IHx8IGRvY3VtZW50OworICAgIH0KKworICAgIGlmIChpc1VuZGVmaW5lZChldmVudC5kZWZhdWx0UHJldmVudGVkKSkgeworICAgICAgdmFyIHByZXZlbnQgPSBldmVudC5wcmV2ZW50RGVmYXVsdDsKKyAgICAgIGV2ZW50LnByZXZlbnREZWZhdWx0ID0gZnVuY3Rpb24oKSB7CisgICAgICAgIGV2ZW50LmRlZmF1bHRQcmV2ZW50ZWQgPSB0cnVlOworICAgICAgICBwcmV2ZW50LmNhbGwoZXZlbnQpOworICAgICA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gICAgaWYgKCFoYW5kbGUpIGpxTGl0ZUV4cGFuZG9TdG9yZShlbGVtZW50LCAnaGFuZGxlJywgaGFuZGxlID0gY3JlYXRlRXZlbnRIYW5kbGVyKGVsZW1lbnQsIGV2ZW50cykpOworCisgICAgZm9yRWFjaCh0eXBlLnNwbGl0KCcgJyksIGZ1bmN0aW9uKHR5cGUpeworICAgICAgdmFyIGV2ZW50Rm5zID0gZXZlbnRzW3R5cGVdOworCisgICAgICBpZiAoIWV2ZW50Rm5zKSB7CisgICAgICAgIGlmICh0eXBlID09ICdtb3VzZWVudGVyJyB8fCB0eXBlID09ICdtb3VzZWxlYXZlJykgeworICAgICAgICAgIHZhciBjb250YWlucyA9IGRvY3VtZW50LmJvZHkuY29udGFpbnMgfHwgZG9jdW1lbnQuYm9keS5jb21wYXJlRG9jdW1lbnRQb3NpdGlvbiA/CisgICAgICAgICAgZnVuY3Rpb24oIGEsIGIgKSB7CisgICAgICAgICAgICAvLyBqc2hpbnQgYml0d2lzZTogZmFsc2UKKyAgICAgICAgICAgIHZhciBhZG93biA9IGEubm9kZVR5cGUgPT09IDkgPyBhLmRvY3VtZW50RWxlbWVudCA6IGEsCisgICAgICAgICAgICBidXAgPSBiICYmIGIucGFyZW50Tm9kZTsKKyAgICAgICAgICAgIHJldHVybiBhID09PSBidXAgfHwgISEoIGJ1cCAmJiBidXAubm9kZVR5cGUgPT09IDEgJiYgKAorICAgICAgICAgICAgICBhZG93bi5jb250YWlucyA/CisgICAgICAgICAgICAgIGFkb3duLmNvbnRhaW5zKCBidXAgKSA6CisgICAgICAgICAgICAgIGEuY29tcGFyZURvY3VtZW50UG9zaXRpb24gJiYgYS5jb21wYXJlRG9jdW1lbnRQb3NpdGlvbiggYnVwICkgJiAxNgorICAgICAgICAgICAgICApKTsKKyAgICAgICAgICAgIH0gOgorICAgICAgICAgICAgZnVuY3Rpb24oIGEsIGIgKSB7CisgICAgICAgICAgICAgIGlmICggYiApIHsKKyAgICAgICAgICAgICAgICB3aGlsZSAoIChiID0gYi5wYXJlbnROb2RlKSApIHsKKyAgICAgICAgICAgICAgICAgIGlmICggYiA9PT0gYSApIHsKKyAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHRydWU7CisgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgIHJldHVybiBmYWxzZTsKKyAgICAgICAgICAgIH07CisKKyAgICAgICAgICBldmVudHNbdHlwZV0gPSBbXTsKKworICAgICAgICAgIC8vIFJlZmVyIHRvIGpRdWVyeSdzIGltcGxlbWVudGF0aW9uIG9mIG1vdXNlZW50ZXIgJiBtb3VzZWxlYXZlCisgICAgICAgICAgLy8gUmVhZCBhYm91dCBtb3VzZWVudGVyIGFuZCBtb3VzZWxlYXZlOgorICAgICAgICAgIC8vIGh0dHA6Ly93d3cucXVpcmtzbW9kZS5vcmcvanMvZXZlbnRzX21vdXNlLmh0bWwjbGluazgKKyAgICAgICAgICB2YXIgZXZlbnRtYXAgPSB7IG1vdXNlbGVhdmUgOiAibW91c2VvdXQiLCBtb3VzZWVudGVyIDogIm1vdXNlb3ZlciJ9OworCisgICAgICAgICAgb25GbihlbGVtZW50LCBldmVudG1hcFt0eXBlXSwgZnVuY3Rpb24oZXZlbnQpIHsKKyAgICAgICAgICAgIHZhciB0YXJnZXQgPSB0aGlzLCByZWxhdGVkID0gZXZlbnQucmVsYXRlZFRhcmdldDsKKyAgICAgICAgICAgIC8vIEZvciBtb3VzZW50ZXIvbGVhdmUgY2FsbCB0aGUgaGFuZGxlciBpZiByZWxhdGVkIGlzIG91dHNpZGUgdGhlIHRhcmdldC4KKyAgICAgICAgICAgIC8vIE5COiBObyByZWxhdGVkVGFyZ2V0IGlmIHRoZSBtb3VzZSBsZWZ0L2VudGVyZWQgdGhlIGJyb3dzZXIgd2luZG93CisgICAgICAgICAgICBpZiAoICFyZWxhdGVkIHx8IChyZWxhdGVkICE9PSB0YXJnZXQgJiYgIWNvbnRhaW5zKHRhcmdldCwgcmVsYXRlZCkpICl7CisgICAgICAgICAgICAgIGhhbmRsZShldmVudCwgdHlwZSk7CisgICAgICAgICAgICB9CisgICAgICAgICAgfSk7CisKKyAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICBhZGRFdmVudExpc3RlbmVyRm4oZWxlbWVudCwgdHlwZSwgaGFuZGxlKTsKKyAgICAgICAgICBldmVudHNbdHlwZV0gPSBbXTsKKyAgICAgICAgfQorICAgICAgICBldmVudEZucyA9IGV2ZW50c1t0eXBlXTsKKyAgICAgIH0KKyAgICAgIGV2ZW50Rm5zLnB1c2goZm4pOworICAgIH0pOworICB9LAorCisgIG9mZjoganFMaXRlT2ZmLAorCisgIG9uZTogZnVuY3Rpb24oZWxlbWVudCwgdHlwZSwgZm4pIHsKKyAgICBlbGVtZW50ID0ganFMaXRlKGVsZW1lbnQpOworCisgICAgLy9hZGQgdGhlIGxpc3RlbmVyIHR3aWNlIHNvIHRoYXQgd2hlbiBpdCBpcyBjYWxsZWQKKyAgICAvL3lvdSBjYW4gcmVtb3ZlIHRoZSBvcmlnaW5hbCBmdW5jdGlvbiBhbmQgc3RpbGwgYmUKKyAgICAvL2FibGUgdG8gY2FsbCBlbGVtZW50Lm9mZihldiwgZm4pIG5vcm1hbGx5CisgICAgZWxlbWVudC5vbih0eXBlLCBmdW5jdGlvbiBvbkZuKCkgeworICAgICAgZWxlbWVudC5vZmYodHlwZSwgZm4pOworICAgICAgZWxlbWVudC5vZmYodHlwZSwgb25Gbik7CisgICAgfSk7CisgICAgZWxlbWVudC5vbih0eXBlLCBmbik7CisgIH0sCisKKyAgcmVwbGFjZVdpdGg6IGZ1bmN0aW9uKGVsZW1lbnQsIHJlcGxhY2VOb2RlKSB7CisgICAgdmFyIGluZGV4LCBwYXJlbnQgPSBlbGVtZW50LnBhcmVudE5vZGU7CisgICAganFMaXRlRGVhbG9jKGVsZW1lbnQpOworICAgIGZvckVhY2gobmV3IEpRTGl0ZShyZXBsYWNlTm9kZSksIGZ1bmN0aW9uKG5vZGUpeworICAgICAgaWYgKGluZGV4KSB7CisgICAgICAgIHBhcmVudC5pbnNlcnRCZWZvcmUobm9kZSwgaW5kZXgubmV4dFNpYmxpbmcpOworICAgICAgfSBlbHNlIHsKKyAgICAgICAgcGFyZW50LnJlcGxhY2VDaGlsZChub2RlLCBlbGVtZW50KTsKKyAgICAgIH0KKyAgICAgIGluZGV4ID0gbm9kZTsKKyAgICB9KTsKKyAgfSwKKworICBjaGlsZHJlbjogZnVuY3Rpb24oZWxlbWVudCkgeworICAgIHZhciBjaGlsZHJlbiA9IFtdOworICAgIGZvckVhY2goZWxlbWVudC5jaGlsZE5vZGVzLCBmdW5jdGlvbihlbGVtZW50KXsKKyAgICAgIGlmIChlbGVtZW50Lm5vZGVUeXBlID09PSAxKQorICAgICAgICBjaGlsZHJlbi5wdXNoKGVsZW1lbnQpOworICAgIH0pOworICAgIHJldHVybiBjaGlsZHJlbjsKKyAgfSwKKworICBjb250ZW50czogZnVuY3Rpb24oZWxlbWVudCkgeworICAgIHJldHVybiBlbGVtZW50LmNvbnRlbnREb2N1bWVudCB8fCBlbGVtZW50LmNoaWxkTm9kZXMgfHwgW107CisgIH0sCisKKyAgYXBwZW5kOiBmdW5jdGlvbihlbGVtZW50LCBub2RlKSB7CisgICAgZm9yRWFjaChuZXcgSlFMaXRlKG5vZGUpLCBmdW5jdGlvbihjaGlsZCl7CisgICAgICBpZiAoZWxlbWVudC5ub2RlVHlwZSA9PT0gMSB8fCBlbGVtZW50Lm5vZGVUeXBlID09PSAxMSkgeworICAgICAgICBlbGVtZW50LmFwcGVuZENoaWxkKGNoaWxkKTsKKyAgICAgIH0KKyAgICB9KTsKKyAgfSwKKworICBwcmVwZW5kOiBmdW5jdGlvbihlbGVtZW50LCBub2RlKSB7CisgICAgaWYgKGVsZW1lbnQubm9kZVR5cGUgPT09IDEpIHsKKyAgICAgIHZhciBpbmRleCA9IGVsZW1lbnQuZmlyc3RDaGlsZDsKKyAgICAg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9yLCBjb25kaXRpb24pIHsKKyAgICBpZiAoc2VsZWN0b3IpIHsKKyAgICAgIGZvckVhY2goc2VsZWN0b3Iuc3BsaXQoJyAnKSwgZnVuY3Rpb24oY2xhc3NOYW1lKXsKKyAgICAgICAgdmFyIGNsYXNzQ29uZGl0aW9uID0gY29uZGl0aW9uOworICAgICAgICBpZiAoaXNVbmRlZmluZWQoY2xhc3NDb25kaXRpb24pKSB7CisgICAgICAgICAgY2xhc3NDb25kaXRpb24gPSAhanFMaXRlSGFzQ2xhc3MoZWxlbWVudCwgY2xhc3NOYW1lKTsKKyAgICAgICAgfQorICAgICAgICAoY2xhc3NDb25kaXRpb24gPyBqcUxpdGVBZGRDbGFzcyA6IGpxTGl0ZVJlbW92ZUNsYXNzKShlbGVtZW50LCBjbGFzc05hbWUpOworICAgICAgfSk7CisgICAgfQorICB9LAorCisgIHBhcmVudDogZnVuY3Rpb24oZWxlbWVudCkgeworICAgIHZhciBwYXJlbnQgPSBlbGVtZW50LnBhcmVudE5vZGU7CisgICAgcmV0dXJuIHBhcmVudCAmJiBwYXJlbnQubm9kZVR5cGUgIT09IDExID8gcGFyZW50IDogbnVsbDsKKyAgfSwKKworICBuZXh0OiBmdW5jdGlvbihlbGVtZW50KSB7CisgICAgaWYgKGVsZW1lbnQubmV4dEVsZW1lbnRTaWJsaW5nKSB7CisgICAgICByZXR1cm4gZWxlbWVudC5uZXh0RWxlbWVudFNpYmxpbmc7CisgICAgfQorCisgICAgLy8gSUU4IGRvZXNuJ3QgaGF2ZSBuZXh0RWxlbWVudFNpYmxpbmcKKyAgICB2YXIgZWxtID0gZWxlbWVudC5uZXh0U2libGluZzsKKyAgICB3aGlsZSAoZWxtICE9IG51bGwgJiYgZWxtLm5vZGVUeXBlICE9PSAxKSB7CisgICAgICBlbG0gPSBlbG0ubmV4dFNpYmxpbmc7CisgICAgfQorICAgIHJldHVybiBlbG07CisgIH0sCisKKyAgZmluZDogZnVuY3Rpb24oZWxlbWVudCwgc2VsZWN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CisgICAgICBpZiAoZXZlbnQudHlwZSkgeworICAgICAgICBkdW1teUV2ZW50ID0gZXh0ZW5kKGR1bW15RXZlbnQsIGV2ZW50KTsKKyAgICAgIH0KKworICAgICAgLy8gQ29weSBldmVudCBoYW5kbGVycyBpbiBjYXNlIGV2ZW50IGhhbmRsZXJzIGFycmF5IGlzIG1vZGlmaWVkIGR1cmluZyBleGVjdXRpb24uCisgICAgICBldmVudEZuc0NvcHkgPSBzaGFsbG93Q29weShldmVudEZucyk7CisgICAgICBoYW5kbGVyQXJncyA9IGV4dHJhUGFyYW1ldGVycyA/IFtkdW1teUV2ZW50XS5jb25jYXQoZXh0cmFQYXJhbWV0ZXJzKSA6IFtkdW1teUV2ZW50XTsKKworICAgICAgZm9yRWFjaChldmVudEZuc0NvcHksIGZ1bmN0aW9uKGZuKSB7CisgICAgICAgIGZuLmFwcGx5KGVsZW1lbnQsIGhhbmRsZXJBcmdzKTsKKyAgICAgIH0pOworCisgICAgfQorICB9Cit9LCBmdW5jdGlvbihmbiwgbmFtZSl7CisgIC8qKgorICAgKiBjaGFpbmluZyBmdW5jdGlvbnMKKyAgICovCisgIEpRTGl0ZS5wcm90b3R5cGVbbmFtZV0gPSBmdW5jdGlvbihhcmcxLCBhcmcyLCBhcmczKSB7CisgICAgdmFyIHZhbHVlOworICAgIGZvcih2YXIgaT0wOyBpIDwgdGhpcy5sZW5ndGg7IGkrKykgeworICAgICAgaWYgKGlzVW5kZWZpbmVkKHZhbHVlKSkgeworICAgICAgICB2YWx1ZSA9IGZuKHRoaXNbaV0sIGFyZzEsIGFyZzIsIGFyZzMpOworICAgICAgICBpZiAoaXNEZWZpbmVkKHZhbHVlKSkgeworICAgICAgICAgIC8vIGFueSBmdW5jdGlvbiB3aGljaCByZXR1cm5zIGEgdmFsdWUgbmVlZHMgdG8gYmUgd3JhcHBlZAorICAgICAgICAgIHZhbHVlID0ganFMaXRlKHZhbHVlKTsKKyAgICAgICAgfQorICAgICAgfSBlbHNlIHsKKyA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isgKiAqVGhpcyBpcyBmYWlybHkgcmFyZSBidXQgY291bGQgYmUgdGhlIGNhc2UgaWYgYSB0aGlyZCBwYXJ0eSBsaWJyYXJ5IGlzIGluamVjdGluZyB0aGUKKyAqIG1hcmt1cC4qCisgKgorICogSW4gdGhlIGZvbGxvd2luZyBleGFtcGxlIGEgbmV3IGJsb2NrIG9mIEhUTUwgY29udGFpbmluZyBhIGBuZy1jb250cm9sbGVyYAorICogZGlyZWN0aXZlIGlzIGFkZGVkIHRvIHRoZSBlbmQgb2YgdGhlIGRvY3VtZW50IGJvZHkgYnkgSlF1ZXJ5LiBXZSB0aGVuIGNvbXBpbGUgYW5kIGxpbmsKKyAqIGl0IGludG8gdGhlIGN1cnJlbnQgQW5ndWxhckpTIHNjb3BlLgorICoKKyAqIGBgYGpzCisgKiB2YXIgJGRpdiA9ICQoJzxkaXYgbmctY29udHJvbGxlcj0iTXlDdHJsIj57e2NvbnRlbnQubGFiZWx9fTwvZGl2PicpOworICogJChkb2N1bWVudC5ib2R5KS5hcHBlbmQoJGRpdik7CisgKgorICogYW5ndWxhci5lbGVtZW50KGRvY3VtZW50KS5pbmplY3RvcigpLmludm9rZShmdW5jdGlvbigkY29tcGlsZSkgeworICogICB2YXIgc2NvcGUgPSBhbmd1bGFyLmVsZW1lbnQoJGRpdikuc2NvcGUoKTsKKyAqICAgJGNvbXBpbGUoJGRpdikoc2NvcGUpOworICogfSk7CisgKiBgYGAKKyAqLworCisKKy8qKgorICogQG5nZG9jIG1vZHVsZQorICogQG5hbWUgYXV0bworICogQGRlc2NyaXB0aW9uCisgKgorICogSW1wbGljaXQgbW9kdWxlIHdoaWNoIGdldHMgYXV0b21hdGljYWxseSBhZGRlZCB0byBlYWNoIHtAbGluayBhdXRvLiRpbmplY3RvciAkaW5qZWN0b3J9LgorICovCisKK3ZhciBGTl9BUkdTID0gL15mdW5jdGlvblxzKlteXChdKlwoXHMqKFteXCldKilcKS9tOwordmFyIEZOX0FSR19TUExJVCA9IC8sLzsKK3ZhciBGTl9BUkcgPSAvXlxzKihfPykoXFMrPylcMVxzKiQvOwordmFyIFNUUklQX0NPTU1FTlRTID0gLygoXC9cLy4qJCl8KFwvXCpbXHNcU10qP1wqXC8pKS9tZzsKK3ZhciAkaW5qZWN0b3JNaW5FcnIgPSBtaW5FcnIoJyRpbmplY3RvcicpOworZnVuY3Rpb24gYW5ub3RhdGUoZm4pIHsKKyAgdmFyICRpbmplY3QsCisgICAgICBmblRleHQsCisgICAgICBhcmdEZWNsLAorICAgICAgbGFzdDsKKworICBpZiAodHlwZW9mIGZuID09PSAnZnVuY3Rpb24nKSB7CisgICAgaWYgKCEoJGluamVjdCA9IGZuLiRpbmplY3QpKSB7CisgICAgICAkaW5qZWN0ID0gW107CisgICAgICBpZiAoZm4ubGVuZ3RoKSB7CisgICAgICAgIGZuVGV4dCA9IGZuLnRvU3RyaW5nKCkucmVwbGFjZShTVFJJUF9DT01NRU5UUywgJycpOworICAgICAgICBhcmdEZWNsID0gZm5UZXh0Lm1hdGNoKEZOX0FSR1MpOworICAgICAgICBmb3JFYWNoKGFyZ0RlY2xbMV0uc3BsaXQoRk5fQVJHX1NQTElUKSwgZnVuY3Rpb24oYXJnKXsKKyAgICAgICAgICBhcmcucmVwbGFjZShGTl9BUkcsIGZ1bmN0aW9uKGFsbCwgdW5kZXJzY29yZSwgbmFtZSl7CisgICAgICAgICAgICAkaW5qZWN0LnB1c2gobmFtZSk7CisgICAgICAgICAgfSk7CisgICAgICAgIH0pOworICAgICAgfQorICAgICAgZm4uJGluamVjdCA9ICRpbmplY3Q7CisgICAgfQorICB9IGVsc2UgaWYgKGlzQXJyYXkoZm4pKSB7CisgICAgbGFzdCA9IGZuLmxlbmd0aCAtIDE7CisgICAgYXNzZXJ0QXJnRm4oZm5bbGFzdF0sICdmbicpOworICAgICRpbmplY3QgPSBmbi5zbGljZSgwLCBsYXN0KTsKKyAgfSBlbHNlIHsKKyAgICBhc3NlcnRBcmdGbihmbiwgJ2ZuJywgdH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mV0dXJuIHsKKyAqICAgICAgICAvLyBDYWxsIHRoaXMgdG8gdHJhY2sgYW4gZXZlbnQKKyAqICAgICAgICBldmVudDogZnVuY3Rpb24oZXZlbnQpIHsKKyAqICAgICAgICAgIHZhciBjb3VudCA9IHRyYWNrZWRFdmVudHNbZXZlbnRdIHx8IDA7CisgKiAgICAgICAgICBjb3VudCArPSAxOworICogICAgICAgICAgdHJhY2tlZEV2ZW50c1tldmVudF0gPSBjb3VudDsKKyAqICAgICAgICAgIHJldHVybiBjb3VudDsKKyAqICAgICAgICB9LAorICogICAgICAgIC8vIENhbGwgdGhpcyB0byBzYXZlIHRoZSB0cmFja2VkIGV2ZW50cyB0byB0aGUgdHJhY2tpbmdVcmwKKyAqICAgICAgICBzYXZlOiBmdW5jdGlvbigpIHsKKyAqICAgICAgICAgICRodHRwLnBvc3QodHJhY2tpbmdVcmwsIHRyYWNrZWRFdmVudHMpOworICogICAgICAgIH0KKyAqICAgICAgfTsKKyAqICAgIH1dOworICogIH0KKyAqCisgKiAgZGVzY3JpYmUoJ2V2ZW50VHJhY2tlcicsIGZ1bmN0aW9uKCkgeworICogICAgdmFyIHBvc3RTcHk7CisgKgorICogICAgYmVmb3JlRWFjaChtb2R1bGUoZnVuY3Rpb24oJHByb3ZpZGUpIHsKKyAqICAgICAgLy8gUmVnaXN0ZXIgdGhlIGV2ZW50VHJhY2tlciBwcm92aWRlcgorICogICAgICAkcHJvdmlkZS5wcm92aWRlcignZXZlbnRUcmFja2VyJywgRXZlbnRUcmFja2VyUHJvdmlkZXIpOworICogICAgfSkpOworICoKKyAqICAgIGJlZm9yZUVhY2gobW9kdWxlKGZ1bmN0aW9uKGV2ZW50VHJhY2tlclByb3ZpZGVyKSB7CisgKiAgICAgIC8vIENvbmZpZ3VyZSBldmVudFRyYWNrZXIgcHJvdmlkZXIKKyAqICAgICAgZXZlbnRUcmFja2VyUHJvdmlkZXIuc2V0VHJhY2tpbmdVcmwoJy9jdXN0b20tdHJhY2snKTsKKy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eworICAgICAgICAgICAgcHJvdmlkZXI6IHN1cHBvcnRPYmplY3QocHJvdmlkZXIpLAorICAgICAgICAgICAgZmFjdG9yeTogc3VwcG9ydE9iamVjdChmYWN0b3J5KSwKKyAgICAgICAgICAgIHNlcnZpY2U6IHN1cHBvcnRPYmplY3Qoc2VydmljZSksCisgICAgICAgICAgICB2YWx1ZTogc3VwcG9ydE9iamVjdCh2YWx1ZSksCisgICAgICAgICAgICBjb25zdGFudDogc3VwcG9ydE9iamVjdChjb25zdGFudCksCisgICAgICAgICAgICBkZWNvcmF0b3I6IGRlY29yYXRvcgorICAgICAgICAgIH0KKyAgICAgIH0sCisgICAgICBwcm92aWRlckluamVjdG9yID0gKHByb3ZpZGVyQ2FjaGUuJGluamVjdG9yID0KKyAgICAgICAgICBjcmVhdGVJbnRlcm5hbEluamVjdG9yKHByb3ZpZGVyQ2FjaGUsIGZ1bmN0aW9uKCkgeworICAgICAgICAgICAgdGhyb3cgJGluamVjdG9yTWluRXJyKCd1bnByJywgIlVua25vd24gcHJvdmlkZXI6IHswfSIsIHBhdGguam9pbignIDwtICcpKTsKKyAgICAgICAgICB9KSksCisgICAgICBpbnN0YW5jZUNhY2hlID0ge30sCisgICAgICBpbnN0YW5jZUluamVjdG9yID0gKGluc3RhbmNlQ2FjaGUuJGluamVjdG9yID0KKyAgICAgICAgICBjcmVhdGVJbnRlcm5hbEluamVjdG9yKGluc3RhbmNlQ2FjaGUsIGZ1bmN0aW9uKHNlcnZpY2VuYW1lKSB7CisgICAgICAgICAgICB2YXIgcHJvdmlkZXIgPSBwcm92aWRlckluamVjdG9yLmdldChzZXJ2aWNlbmFtZSArIHByb3ZpZGVyU3VmZml4KTsKKyAgICAgICAgICAgIHJldHVybiBpbnN0YW5jZUluamVjdG9yLmludm9rZShwcm92aWRlci4kZ2V0LCBwcm92aWRlcik7CisgICAgICAgICAgfSkpOworCisKKyAgZm9yRWFjaChsb2FkTW9kdWxlcyhtb2R1bGVzVG9Mb2FkKSwgZnV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Y2s7CisgICAgICAgIH0KKyAgICAgICAgdGhyb3cgJGluamVjdG9yTWluRXJyKCdtb2R1bGVycicsICJGYWlsZWQgdG8gaW5zdGFudGlhdGUgbW9kdWxlIHswfSBkdWUgdG86XG57MX0iLAorICAgICAgICAgICAgICAgICAgbW9kdWxlLCBlLnN0YWNrIHx8IGUubWVzc2FnZSB8fCBlKTsKKyAgICAgIH0KKyAgICB9KTsKKyAgICByZXR1cm4gcnVuQmxvY2tzOworICB9CisKKyAgLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vCisgIC8vIGludGVybmFsIEluamVjdG9yCisgIC8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLworCisgIGZ1bmN0aW9uIGNyZWF0ZUludGVybmFsSW5qZWN0b3IoY2FjaGUsIGZhY3RvcnkpIHsKKworICAgIGZ1bmN0aW9uIGdldFNlcnZpY2Uoc2VydmljZU5hbWUpIHsKKyAgICAgIGlmIChjYWNoZS5oYXNPd25Qcm9wZXJ0eShzZXJ2aWNlTmFtZSkpIHsKKyAgICAgICAgaWYgKGNhY2hlW3NlcnZpY2VOYW1lXSA9PT0gSU5TVEFOVElBVElORykgeworICAgICAgICAgIHRocm93ICRpbmplY3Rvck1pbkVycignY2RlcCcsICdDaXJjdWxhciBkZXBlbmRlbmN5IGZvdW5kOiB7MH0nLAorICAgICAgICAgICAgICAgICAgICBzZXJ2aWNlTmFtZSArICcgPC0gJyArIHBhdGguam9pbignIDwtICcpKTsKKyAgICAgICAgfQorICAgICAgICByZXR1cm4gY2FjaGVbc2VydmljZU5hbWVdOworICAgICAgfSBlbHNlIHsKKyAgICAgICAgdHJ5IHsKKyAgICAgICAgICBwYXRoLnVuc2hpZnQoc2VydmljZU5hbWUpOworICAgICAgICAgIGNhY2hlW3NlcnZpY2VOYW1lXSA9IElOU1RBTlRJQVRJTkc7CisgICAgICAgICAgcmV0dXJuIGNhY2hlW3NlcnZpY2VOYW1lXSA9IGZhY3Rvcnkoc2VydmljZU5hbWUpOworICAgICAgICB9IGNhdGNoIChlcnIpIHsKKyAgICAgICAgICBpZiAoY2FjaGVbc2VydmljZU5hbWVdID09PSBJTlNUQU5USUFUSU5HKSB7CisgICAgICAgICAgICBkZWxldGUgY2FjaGVbc2VydmljZU5hbWVdOworICAgICAgICAgIH0KKyAgICAgICAgICB0aHJvdyBlcnI7CisgICAgICAgIH0gZmluYWxseSB7CisgICAgICAgICAgcGF0aC5zaGlmdCgpOworICAgICAgICB9CisgICAgICB9CisgICAgfQorCisgICAgZnVuY3Rpb24gaW52b2tlKGZuLCBzZWxmLCBsb2NhbHMpeworICAgICAgdmFyIGFyZ3MgPSBbXSwKKyAgICAgICAgICAkaW5qZWN0ID0gYW5ub3RhdGUoZm4pLAorICAgICAgICAgIGxlbmd0aCwgaSwKKyAgICAgICAgICBrZXk7CisKKyAgICAgIGZvcihpID0gMCwgbGVuZ3RoID0gJGluamVjdC5sZW5ndGg7IGkgPCBsZW5ndGg7IGkrKykgeworICAgICAgICBrZXkgPSAkaW5qZWN0W2ldOworICAgICAgICBpZiAodHlwZW9mIGtleSAhPT0gJ3N0cmluZycpIHsKKyAgICAgICAgICB0aHJvdyAkaW5qZWN0b3JNaW5FcnIoJ2l0a24nLAorICAgICAgICAgICAgICAgICAgJ0luY29ycmVjdCBpbmplY3Rpb24gdG9rZW4hIEV4cGVjdGVkIHNlcnZpY2UgbmFtZSBhcyBzdHJpbmcsIGdvdCB7MH0nLCBrZXkpOworICAgICAgICB9CisgICAgICAgIGFyZ3MucHVzaCgKKyAgICAgICAgICBsb2NhbHMgJiYgbG9jYWxzLmhhc093blByb3BlcnR5KGtleSkKKyAgICAgICAgICA/IGxvY2Fsc1trZXldCisgICAgICAgICAgOiBnZXRTZXJ2aWNlKGtleSkKKyAgICAgICAgKTsKKyAgICAgIH0KKyAgICAgIGlmIChpc0FycmF5KGZuKSkgeworICAgICAgICBmbiA9IGZuW2xlbmd0aF07CisgICAgICB9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BET00KKyAgICAgICAqLworICAgICAgZW50ZXIgOiBmdW5jdGlvbihlbGVtZW50LCBwYXJlbnQsIGFmdGVyLCBkb25lKSB7CisgICAgICAgIGlmIChhZnRlcikgeworICAgICAgICAgIGFmdGVyLmFmdGVyKGVsZW1lbnQpOworICAgICAgICB9IGVsc2UgeworICAgICAgICAgIGlmICghcGFyZW50IHx8ICFwYXJlbnRbMF0pIHsKKyAgICAgICAgICAgIHBhcmVudCA9IGFmdGVyLnBhcmVudCgpOworICAgICAgICAgIH0KKyAgICAgICAgICBwYXJlbnQuYXBwZW5kKGVsZW1lbnQpOworICAgICAgICB9CisgICAgICAgIGFzeW5jKGRvbmUpOworICAgICAgfSwKKworICAgICAgLyoqCisgICAgICAgKgorICAgICAgICogQG5nZG9jIG1ldGhvZAorICAgICAgICogQG5hbWUgJGFuaW1hdGUjbGVhdmUKKyAgICAgICAqIEBraW5kIGZ1bmN0aW9uCisgICAgICAgKiBAZGVzY3JpcHRpb24gUmVtb3ZlcyB0aGUgZWxlbWVudCBmcm9tIHRoZSBET00uIE9uY2UgY29tcGxldGUsIHRoZSBkb25lKCkgY2FsbGJhY2sgd2lsbCBiZQorICAgICAgICogICBmaXJlZCAoaWYgcHJvdmlkZWQpLgorICAgICAgICogQHBhcmFtIHtET01FbGVtZW50fSBlbGVtZW50IHRoZSBlbGVtZW50IHdoaWNoIHdpbGwgYmUgcmVtb3ZlZCBmcm9tIHRoZSBET00KKyAgICAgICAqIEBwYXJhbSB7RnVuY3Rpb249fSBkb25lIGNhbGxiYWNrIGZ1bmN0aW9uIHRoYXQgd2lsbCBiZSBjYWxsZWQgYWZ0ZXIgdGhlIGVsZW1lbnQgaGFzIGJlZW4KKyAgICAgICAqICAgcmVtb3ZlZCBmcm9tIHRoZSBET00KKyAgICAgICAqLworICAgICAgbGVhdmUgOiBmdW5jdGlvbihlbGVtZW50LCBkb25lKSB7CisgICAgICAgIGVsZW1lbnQucmVtb3ZlKCk7CisgICAgICAgIGFzeW5jKG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T4gc2V0IG5hbWUgdG8gdmFsdWUsIGlmIHZhbHVlIGlzIHVuZGVmaW5lZCBkZWxldGUgdGhlIGNvb2tpZQorICAgKiAtIGNvb2tpZXMobmFtZSkgLT4gdGhlIHNhbWUgYXMgKG5hbWUsIHVuZGVmaW5lZCkgPT0gREVMRVRFUyAobm8gb25lIGNhbGxzIGl0IHJpZ2h0IG5vdyB0aGF0CisgICAqICAgd2F5KQorICAgKgorICAgKiBAcmV0dXJucyB7T2JqZWN0fSBIYXNoIG9mIGFsbCBjb29raWVzIChpZiBjYWxsZWQgd2l0aG91dCBhbnkgcGFyYW1ldGVyKQorICAgKi8KKyAgc2VsZi5jb29raWVzID0gZnVuY3Rpb24obmFtZSwgdmFsdWUpIHsKKyAgICAvKiBnbG9iYWwgZXNjYXBlOiBmYWxzZSwgdW5lc2NhcGU6IGZhbHNlICovCisgICAgdmFyIGNvb2tpZUxlbmd0aCwgY29va2llQXJyYXksIGNvb2tpZSwgaSwgaW5kZXg7CisKKyAgICBpZiAobmFtZSkgeworICAgICAgaWYgKHZhbHVlID09PSB1bmRlZmluZWQpIHsKKyAgICAgICAgcmF3RG9jdW1lbnQuY29va2llID0gZXNjYXBlKG5hbWUpICsgIj07cGF0aD0iICsgY29va2llUGF0aCArCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICI7ZXhwaXJlcz1UaHUsIDAxIEphbiAxOTcwIDAwOjAwOjAwIEdNVCI7CisgICAgICB9IGVsc2UgeworICAgICAgICBpZiAoaXNTdHJpbmcodmFsdWUpKSB7CisgICAgICAgICAgY29va2llTGVuZ3RoID0gKHJhd0RvY3VtZW50LmNvb2tpZSA9IGVzY2FwZShuYW1lKSArICc9JyArIGVzY2FwZSh2YWx1ZSkgKworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAnO3BhdGg9JyArIGNvb2tpZVBhdGgpLmxlbmd0aCArIDE7CisKKyAgICAgICAgICAvLyBwZXIgaHR0cDovL3d3dy5pZXRmLm9yZy9yZmMvcmZjMjEwOS50eHQgYnJvd3NlciBtdXN0IGFsbG93IGF0IG1pbmltdW06CisgICAgICAgICAgLy8gLSAzMDAgY29va2llcworICAgICAgICAgIC8vIC0gMjAgY29va2llcyBwZXIgdW5pcXVlIGRvbWFpbgorICAgICAgICAgIC8vIC0gNDA5NiBieXRlcyBwZXIgY29va2llCisgICAgICAgICAgaWYgKGNvb2tpZUxlbmd0aCA+IDQwOTYpIHsKKyAgICAgICAgICAgICRsb2cud2FybigiQ29va2llICciKyBuYW1lICsKKyAgICAgICAgICAgICAgIicgcG9zc2libHkgbm90IHNldCBvciBvdmVyZmxvd2VkIGJlY2F1c2UgaXQgd2FzIHRvbyBsYXJnZSAoIisKKyAgICAgICAgICAgICAgY29va2llTGVuZ3RoICsgIiA+IDQwOTYgYnl0ZXMpISIpOworICAgICAgICAgIH0KKyAgICAgICAgfQorICAgICAgfQorICAgIH0gZWxzZSB7CisgICAgICBpZiAocmF3RG9jdW1lbnQuY29va2llICE9PSBsYXN0Q29va2llU3RyaW5nKSB7CisgICAgICAgIGxhc3RDb29raWVTdHJpbmcgPSByYXdEb2N1bWVudC5jb29raWU7CisgICAgICAgIGNvb2tpZUFycmF5ID0gbGFzdENvb2tpZVN0cmluZy5zcGxpdCgiOyAiKTsKKyAgICAgICAgbGFzdENvb2tpZXMgPSB7fTsKKworICAgICAgICBmb3IgKGkgPSAwOyBpIDwgY29va2llQXJyYXkubGVuZ3RoOyBpKyspIHsKKyAgICAgICAgICBjb29raWUgPSBjb29raWVBcnJheVtpXTsKKyAgICAgICAgICBpbmRleCA9IGNvb2tpZS5pbmRleE9mKCc9Jyk7CisgICAgICAgICAgaWYgKGluZGV4ID4gMCkgeyAvL2lnbm9yZSBuYW1lbGVzcyBjb29raWVzCisgICAgICAgICAgICBuYW1lID0gdW5lc2NhcGUoY29va2llLnN1YnN0cmluZygwLCBpbmRleCkpOworICAgICAgICAgICAgLy8gdGhlIGZpcnN0IHZhbHVlIHRoYXQgaXMgc2Vlb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UpIGluIGNhY2hlLmluZm8oKSI+CisgICAgICAgICAgIDxzcGFuIG5nLWJpbmQ9ImtleSI+PC9zcGFuPgorICAgICAgICAgICA8c3Bhbj46IDwvc3Bhbj4KKyAgICAgICAgICAgPGIgbmctYmluZD0idmFsdWUiPjwvYj4KKyAgICAgICAgIDwvZGl2PgorICAgICAgIDwvZGl2PgorICAgICA8L2ZpbGU+CisgICAgIDxmaWxlIG5hbWU9InNjcmlwdC5qcyI+CisgICAgICAgYW5ndWxhci5tb2R1bGUoJ2NhY2hlRXhhbXBsZUFwcCcsIFtdKS4KKyAgICAgICAgIGNvbnRyb2xsZXIoJ0NhY2hlQ29udHJvbGxlcicsIFsnJHNjb3BlJywgJyRjYWNoZUZhY3RvcnknLCBmdW5jdGlvbigkc2NvcGUsICRjYWNoZUZhY3RvcnkpIHsKKyAgICAgICAgICAgJHNjb3BlLmtleXMgPSBbXTsKKyAgICAgICAgICAgJHNjb3BlLmNhY2hlID0gJGNhY2hlRmFjdG9yeSgnY2FjaGVJZCcpOworICAgICAgICAgICAkc2NvcGUucHV0ID0gZnVuY3Rpb24oa2V5LCB2YWx1ZSkgeworICAgICAgICAgICAgIGlmICgkc2NvcGUuY2FjaGUuZ2V0KGtleSkgPT09IHVuZGVmaW5lZCkgeworICAgICAgICAgICAgICAgJHNjb3BlLmtleXMucHVzaChrZXkpOworICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAkc2NvcGUuY2FjaGUucHV0KGtleSwgdmFsdWUgPT09IHVuZGVmaW5lZCA/IG51bGwgOiB2YWx1ZSk7CisgICAgICAgICAgIH07CisgICAgICAgICB9XSk7CisgICAgIDwvZmlsZT4KKyAgICAgPGZpbGUgbmFtZT0ic3R5bGUuY3NzIj4KKyAgICAgICBwIHsKKyAgICAgICAgIG1hcmdpbjogMTBweCAwIDNweDsKKyAgICAgICB9CisgICAgIDwvZmlsZT4KKyAgIDwvZXhhbXBsZT4KKyAqLworZnVuY3Rpb24gJENhY2hlRmFjdG9yeVByb3ZpZGVyKCkgeworCisgIHRoaXMuJGdldCA9IGZ1bmN0aW9uKCkgeworICAgIHZhciBjYWNoZXMgPSB7fTsKKworICAgIGZ1bmN0aW9uIGNhY2hlRmFjdG9yeShjYWNoZUlkLCBvcHRpb25zKSB7CisgICAgICBpZiAoY2FjaGVJZCBpbiBjYWNoZXMpIHsKKyAgICAgICAgdGhyb3cgbWluRXJyKCckY2FjaGVGYWN0b3J5JykoJ2lpZCcsICJDYWNoZUlkICd7MH0nIGlzIGFscmVhZHkgdGFrZW4hIiwgY2FjaGVJZCk7CisgICAgICB9CisKKyAgICAgIHZhciBzaXplID0gMCwKKyAgICAgICAgICBzdGF0cyA9IGV4dGVuZCh7fSwgb3B0aW9ucywge2lkOiBjYWNoZUlkfSksCisgICAgICAgICAgZGF0YSA9IHt9LAorICAgICAgICAgIGNhcGFjaXR5ID0gKG9wdGlvbnMgJiYgb3B0aW9ucy5jYXBhY2l0eSkgfHwgTnVtYmVyLk1BWF9WQUxVRSwKKyAgICAgICAgICBscnVIYXNoID0ge30sCisgICAgICAgICAgZnJlc2hFbmQgPSBudWxsLAorICAgICAgICAgIHN0YWxlRW5kID0gbnVsbDsKKworICAgICAgLyoqCisgICAgICAgKiBAbmdkb2MgdHlwZQorICAgICAgICogQG5hbWUgJGNhY2hlRmFjdG9yeS5DYWNoZQorICAgICAgICoKKyAgICAgICAqIEBkZXNjcmlwdGlvbgorICAgICAgICogQSBjYWNoZSBvYmplY3QgdXNlZCB0byBzdG9yZSBhbmQgcmV0cmlldmUgZGF0YSwgcHJpbWFyaWx5IHVzZWQgYnkKKyAgICAgICAqIHtAbGluayAkaHR0cCAkaHR0cH0gYW5kIHRoZSB7QGxpbmsgbmcuZGlyZWN0aXZlOnNjcmlwdCBzY3JpcHR9IGRpcmVjdGl2ZSB0byBjYWNoZQorICAgICAgICogdGVtcGxhdGVzIGFuZCBvdGhlciBkYXRhLgorICAgICAgICoKKyAgICAgICAqIGBgYGpzCisgICAgICAgKiAgYW5ndWxhci5tb2R1bGUoJ3N1cGVyQ2FjaGUnKQorICAgICAgICogICAgLmZhY3RvcnkoJ3N1cGVyQ2FjaGUnLCBbJyRjYWNoZUZhY3RvcnknLCBmdW5jdGlvbigkY2FjaGVGYWN0b3J5KSB7CisgICAgICAgKiAgICAgIHJldHVybiAkY2FjaGVGYWN0b3J5KCdzdXBlci1jYWNoZScpOworICAgICAgICogICAgfV0pOworICAgICAgICogYGBgCisgICAgICAgKgorICAgICAgICogRXhhbXBsZSB0ZXN0OgorICAgICAgICoKKyAgICAgICAqIGBgYGpzCisgICAgICAgKiAgaXQoJ3Nob3VsZCBiZWhhdmUgbGlrZSBhIGNhY2hlJywgaW5qZWN0KGZ1bmN0aW9uKHN1cGVyQ2FjaGUpIHsKKyAgICAgICAqICAgIHN1cGVyQ2FjaGUucHV0KCdrZXknLCAndmFsdWUnKTsKKyAgICAgICAqICAgIHN1cGVyQ2FjaGUucHV0KCdhbm90aGVyIGtleScsICdhbm90aGVyIHZhbHVlJyk7CisgICAgICAgKgorICAgICAgICogICAgZXhwZWN0KHN1cGVyQ2FjaGUuaW5mbygpKS50b0VxdWFsKHsKKyAgICAgICAqICAgICAgaWQ6ICdzdXBlci1jYWNoZScsCisgICAgICAgKiAgICAgIHNpemU6IDIKKyAgICAgICAqICAgIH0pOworICAgICAgICoKKyAgICAgICAqICAgIHN1cGVyQ2FjaGUucmVtb3ZlKCdhbm90aGVyIGtleScpOworICAgICAgICogICAgZXhwZWN0KHN1cGVyQ2FjaGUuZ2V0KCdhbm90aGVyIGtleScpKS50b0JlVW5kZWZpbmVkKCk7CisgICAgICAgKgorICAgICAgICogICAgc3VwZXJDYWNoZS5yZW1vdmVBbGwoKTsKKyAgICAgICAqICAgIGV4cGVjdChzdXBlckNhY2hlLmluZm8oKSkudG9FcXVhbCh7CisgICAgICAgKiAgICAgIGlkOiAnc3VwZXItY2FjaGUnLAorICAgICAgICogICAgICBzaXplOiAwCisgICAgICAgKiAgICB9KTsKKyAgICAgICAqICB9KSk7CisgICAgICAgKiBgYGAKKyAgICAgICAqLworICAgICAgcmV0dXJuIGNhY2hlc1tjYWNoZUlkXSA9IHsKKworICAgICAgICAvKioKKyAgICAgICAgICogQG5nZG9jIG1ldGhvZAorICAgICAgICAgKiBAbmFtZSAkY2FjaGVGYWN0b3J5LkNhY2hlI3B1dAorICAgICAgICAgKiBAa2luZCBmdW5jdGlvbgorICAgICAgICAgKgorICAgICAgICAgKiBAZGVzY3JpcHRpb24KKyAgICAgICAgICogSW5zZXJ0cyBhIG5hbWVkIGVudHJ5IGludG8gdGhlIHtAbGluayAkY2FjaGVGYWN0b3J5LkNhY2hlIENhY2hlfSBvYmplY3QgdG8gYmUKKyAgICAgICAgICogcmV0cmlldmVkIGxhdGVyLCBhbmQgaW5jcmVtZW50aW5nIHRoZSBzaXplIG9mIHRoZSBjYWNoZSBpZiB0aGUga2V5IHdhcyBub3QgYWxyZWFkeQorICAgICAgICAgKiBwcmVzZW50IGluIHRoZSBjYWNoZS4gSWYgYmVoYXZpbmcgbGlrZSBhbiBMUlUgY2FjaGUsIGl0IHdpbGwgYWxzbyByZW1vdmUgc3RhbGUKKyAgICAgICAgICogZW50cmllcyBmcm9tIHRoZSBzZXQuCisgICAgICAgICAqCisgICAgICAgICAqIEl0IHdpbGwgbm90IGluc2VydCB1bmRlZmluZWQgdmFsdWVzIGludG8gdGhlIGNhY2hlLgorICAgICAgICAgKgorICAgICAgICAgKiBAcGFyYW0ge3N0cmluZ30ga2V5IHRoZSBrZXkgdW5kZXIgd2hpY2ggdGhlIGNhY2hlZCBkYXRhIGlzIHN0b3JlZC4KKyAgICAgICAgICogQHBhcmFtIHsqfSB2YWx1ZSB0aGUgdmFsdWUgdG8gc3RvcmUgYWxvbmdzaWRlIHRoZSBrZXkuIElmIGl0IGlzIHVuZGVmaW5lZCwgdGhlIGtleQorICAgICAgICAgKiAgICB3aWxsIG5vdCBiZSBzdG9yZWQuCisgICAgICAgICAqIEByZXR1cm5zIHsqfSB0aGUgdmFsdWUgc3RvcmVkLgorICAgICAgICAgKi8KKyAgICAgICAgcHV0OiBmdW5jdGlvbihrZXksIHZhbHVlKSB7CisgICAgICAgICAgaWYgKGNhcGFjaXR5IDwgTnVtYmVyLk1BWF9WQUxVRSkgeworICAgICAgICAgICAgdmFyIGxydUVudHJ5ID0gbHJ1SGFzaFtrZXldIHx8IChscnVIYXNoW2tleV0gPSB7a2V5OiBrZXl9KTsKKworICAgICAgICAgICAgcmVmcmVzaChscnVFbnRyeSk7CisgICAgICAgICAgfQorCisgICAgICAgICAgaWYgKGlzVW5kZWZpbmVkKHZhbHVlKSkgcmV0dXJuOworICAgICAgICAgIGlmICghKGtleSBpbiBkYXRhKSkgc2l6ZSsrOworICAgICAgICAgIGRhdGFba2V5XSA9IHZhbHVlOworCisgICAgICAgICAgaWYgKHNpemUgPiBjYXBhY2l0eSkgeworICAgICAgICAgICAgdGhpcy5yZW1vdmUoc3RhbGVFbmQua2V5KTsKKyAgICAgICAgICB9CisKKyAgICAgICAgICByZXR1cm4gdmFsdWU7CisgICAgICAgIH0sCisKKyAgICAgICAgLyoqCisgICAgICAgICAqIEBuZ2RvYyBtZXRob2QKKyAgICAgICAgICogQG5hbWUgJGNhY2hlRmFjdG9yeS5DYWNoZSNnZXQKKyAgICAgICAgICogQGtpbmQgZnVuY3Rpb24KKyAgICAgICAgICoKKyAgICAgICAgICogQGRlc2NyaXB0aW9uCisgICAgICAgICAqIFJldHJpZXZlcyBuYW1lZCBkYXRhIHN0b3JlZCBpbiB0aGUge0BsaW5rICRjYWNoZUZhY3RvcnkuQ2FjaGUgQ2FjaGV9IG9iamVjdC4KKyAgICAgICAgICoKKyAgICAgICAgICogQHBhcmFtIHtzdHJpbmd9IGtleSB0aGUga2V5IG9mIHRoZSBkYXRhIHRvIGJlIHJldHJpZXZlZAorICAgICAgICAgKiBAcmV0dXJucyB7Kn0gdGhlIHZhbHVlIHN0b3JlZC4KKyAgICAgICAgICovCisgICAgICAgIGdldDogZnVuY3Rpb24oa2V5KSB7CisgICAgICAgICAgaWYgKGNhcGFjaXR5IDwgTnVtYmVyLk1BWF9WQUxVRSkgeworICAgICAgICAgICAgdmFyIGxydUVudHJ5ID0gbHJ1SGFzaFtrZXldOworCisgICAgICAgICAgICBpZiAoIWxydUVudHJ5KSByZXR1cm47CisKKyAgICAgICAgICAgIHJlZnJlc2gobHJ1RW50cnkpOworICAgICAgICAgIH0KKworICAgICAgICAgIHJldHVybiBkYXRhW2tleV07CisgICAgICAgIH0sCisKKworICAgICAgICAvKioKKyAgICAgICAgICogQG5nZG9jIG1ldGhvZAorICAgICAgICAgKiBAbmFtZSAkY2FjaGVGYWN0b3J5LkNhY2hlI3JlbW92ZQorICAgICAgICAgKiBAa2luZCBmdW5jdGlvbgorICAgICAgICAgKgorICAgICAgICAgKiBAZGVzY3JpcHRpb24KKyAgICAgICAgICogUmVtb3ZlcyBhbiBlbnRyeSBmcm9tIHRoZSB7QGxpbmsgJGNhY2hlRmFjdG9yeS5DYWNoZSBDYWNoZX0gb2JqZWN0LgorICAgICAgICAgKgorICAgICAgICAgKiBAcGFyYW0ge3N0cmluZ30ga2V5IHRoZSBrZXkgb2YgdGhlIGVudHJ5IHRvIGJlIHJlbW92ZWQKKyAgICAgICAgICovCisgICAgICAgIHJlbW92ZTogZnVuY3Rpb24oa2V5KSB7CisgICAgICAgICAgaWYgKGNhcGFjaXR5IDwgTnVtYmVyLk1BWF9WQUxVRSkgeworICAgICAgICAgICAgdmFyIGxydUVudHJ5ID0gbHJ1SGFzaFtrZXldOworCisgICAgICAgICAgICBpZiAoIWxydUVudHJ5KSByZXR1cm47CisKKyAgICAgICAgICAgIGlmIChscnVFbnRyeSA9PSBmcmVzaEVuZCkgZnJlc2hFbmQgPSBscnVFbnRyeS5wOworICAgICAgICAgICAgaWYgKGxydUVudHJ5ID09IHN0YWxlRW5kKSBzdGFsZUVuZCA9IGxydUVudHJ5Lm47CisgICAgICAgICAgICBsaW5rKGxydUVudHJ5Lm4sbHJ1RW50cnkucCk7CisKKyAgICAgICAgICAgIGRlbGV0ZSBscnVIYXNoW2tleV07CisgICAgICAgICAgfQorCisgICAgICAgICAgZGVsZXRlIGRhdGFba2V5XTsKKyAgICAgICAgICBzaXplLS07CisgICAgICAgIH0sCisKKworICAgICAgICAvKioKKyAgICAgICAgICogQG5nZG9jIG1ldGhvZAorICAgICAgICAgKiBAbmFtZSAkY2FjaGVGYWN0b3J5LkNhY2hlI3JlbW92ZUFsbAorICAgICAgICAgKiBAa2luZCBmdW5jdGlvbgorICAgICAgICAgKgorICAgICAgICAgKiBAZGVzY3JpcHRpb24KKyAgICAgICAgICogQ2xlYXJzIHRoZSBjYWNoZSBvYmplY3Qgb2YgYW55IGVudHJpZXMuCisgICAgICAgICAqLworICAgICAgICByZW1vdmVBbGw6IGZ1bmN0aW9uKCkgeworICAgICAgICAgIGRhdGEgPSB7fTsKKyAgICAgICAgICBzaXplID0gMDsKKyAgICAgICAgICBscnVIYXNoID0ge307CisgICAgICAgICAgZnJlc2hFbmQgPSBzdGFsZUVuZCA9IG51bGw7CisgICAgICAgIH0sCisKKworICAgICAgICAvKioKKyAgICAgICAgICogQG5nZG9jIG1ldGhvZAorICAgICAgICAgKiBAbmFtZSAkY2FjaGVGYWN0b3J5LkNhY2hlI2Rlc3Ryb3kKKyAgICAgICAgICogQGtpbmQgZnVuY3Rpb24KKyAgICAgICAgICoKKyAgICAgICAgICogQGRlc2NyaXB0aW9uCisgICAgICAgICAqIERlc3Ryb3lzIHRoZSB7QGxpbmsgJGNhY2hlRmFjdG9yeS5DYWNoZSBDYWNoZX0gb2JqZWN0IGVudGlyZWx5LAorICAgICAgICAgKiByZW1vdmluZyBpdCBmcm9tIHRoZSB7QGxpbmsgJGNhY2hlRmFjdG9yeSAkY2FjaGVGYWN0b3J5fSBzZXQuCisgICAgICAgICAqLworICAgICAgICBkZXN0cm95OiBmdW5jdGlvbigpIHsKKyAgICAgICAgICBkYXRhID0gbnVsbDsKKyAgICAgICAgICBzdGF0cyA9IG51bGw7CisgICAgICAgICAgbHJ1SGFzaCA9IG51bGw7CisgICAgICAgICAgZGVsZXRlIGNhY2hlc1tjYWNoZUlkXTsKKyAgICAgICAgfSwKKworCisgICAgICAgIC8qKgorICAgICAgICAgKiBAbmdkb2MgbWV0aG9kCisgICAgICAgICAqIEBuYW1lICRjYWNoZUZhY3RvcnkuQ2FjaGUjaW5mbworICAgICAgICAgKiBAa2luZCBmdW5jdGlvbgorICAgICAgICAgKgorICAgICAgICAgKiBAZGVzY3JpcHRpb24KKyAgICAgICAgICogUmV0cmlldmUgaW5mb3JtYXRpb24gcmVnYXJkaW5nIGEgcGFydGljdWxhciB7QGxpbmsgJGNhY2hlRmFjdG9yeS5DYWNoZSBDYWNoZX0uCisgICAgICAgICAqCisgICAgICAgICAqIEByZXR1cm5zIHtvYmplY3R9IGFuIG9iamVjdCB3aXRoIHRoZSBmb2xsb3dpbmcgcHJvcGVydGllczoKKyAgICAgICAgICogICA8dWw+CisgICAgICAgICAqICAgICA8bGk+KippZCoqOiB0aGUgaWQgb2YgdGhlIGNhY2hlIGluc3RhbmNlPC9saT4KKyAgICAgICAgICogICAgIDxsaT4qKnNpemUqKjogdGhlIG51bWJlciBvZiBlbnRyaWVzIGtlcHQgaW4gdGhlIGNhY2hlIGluc3RhbmNlPC9saT4KKyAgICAgICAgICogICAgIDxsaT4qKi4uLioqOiBhbnkgYWRkaXRpb25hbCBwcm9wZXJ0aWVzIGZyb20gdGhlIG9wdGlvbnMgb2JqZWN0IHdoZW4gY3JlYXRpbmcgdGhlCisgICAgICAgICAqICAgICAgIGNhY2hlLjwvbGk+CisgICAgICAgICAqICAgPC91bD4KKyAgICAgICAgICovCisgICAgICAgIGluZm86IGZ1bmN0aW9uKCkgeworICAgICAgICAgIHJldHVybiBleHRlbmQoe30sIHN0YXRzLCB7c2l6ZTogc2l6ZX0pOworICAgICAgICB9CisgICAgICB9OworCisKKyAgICAgIC8qKgorICAgICAgICogbWFrZXMgdGhlIGBlbnRyeWAgdGhlIGZyZXNoRW5kIG9mIHRoZSBMUlUgbGlua2VkIGxpc3QKKyAgICAgICAqLworICAgICAgZnVuY3Rpb24gcmVmcmVzaChlbnRyeSkgeworICAgICAgICBpZiAoZW50cnkgIT0gZnJlc2hFbmQpIHsKKyAgICAgICAgICBpZiAoIXN0YWxlRW5kKSB7CisgICAgICAgICAgICBzdGFsZUVuZCA9IGVudHJ5OworICAgICAgICAgIH0gZWxzZSBpZiAoc3RhbGVFbmQgPT0gZW50cnkpIHsKKyAgICAgICAgICAgIHN0YWxlRW5kID0gZW50cnkubjsKKyAgICAgICAgICB9CisKKyAgICAgICAgICBsaW5rKGVudHJ5Lm4sIGVudHJ5LnApOworICAgICAgICAgIGxpbmsoZW50cnksIGZyZXNoRW5kKTsKKyAgICAgICAgICBmcmVzaEVuZCA9IGVudHJ5OworICAgICAgICAgIGZyZXNoRW5kLm4gPSBudWxsOworICAgICAgICB9CisgICAgICB9CisKKworICAgICAgLyoqCisgICAgICAgKiBiaWRpcmVjdGlvbmFsbHkgbGlua3MgdHdvIGVudHJpZXMgb2YgdGhlIExSVSBsaW5rZWQgbGlzdAorICAgICAgICovCisgICAgICBmdW5jdGlvbiBsaW5rKG5leHRFbnRyeSwgcHJldkVudHJ5KSB7CisgICAgICAgIGlmIChuZXh0RW50cnkgIT0gcHJldkVudHJ5KSB7CisgICAgICAgICAgaWYgKG5leHRFbnRyeSkgbmV4dEVudHJ5LnAgPSBwcmV2RW50cnk7IC8vcCBzdGFuZHMgZm9yIHByZXZpb3VzLCAncHJldicgZGlkbid0IG1pbmlmeQorICAgICAgICAgIGlmIChwcmV2RW50cnkpIHByZXZFbnRyeS5uID0gbmV4dEVudHJ5OyAvL24gc3RhbmRzIGZvciBuZXh0LCAnbmV4dCcgZGlkbid0IG1pbmlmeQorICAgICAgICB9CisgICAgICB9CisgICAgfQorCisKKyAgLyoqCisgICAqIEBuZ2RvYyBtZXRob2QKKyAgICogQG5hbWUgJGNhY2hlRmF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ByZTogZnVuY3Rpb24gcHJlTGluayhzY29wZSwgaUVsZW1lbnQsIGlBdHRycywgY29udHJvbGxlcikgeyAuLi4gfSwKKyAqICAgICAgICAgICBwb3N0OiBmdW5jdGlvbiBwb3N0TGluayhzY29wZSwgaUVsZW1lbnQsIGlBdHRycywgY29udHJvbGxlcikgeyAuLi4gfQorICogICAgICAgICB9CisgKiAgICAgICAgIC8vIG9yCisgKiAgICAgICAgIC8vIHJldHVybiBmdW5jdGlvbiBwb3N0TGluayggLi4uICkgeyAuLi4gfQorICogICAgICAgfSwKKyAqICAgICAgIC8vIG9yCisgKiAgICAgICAvLyBsaW5rOiB7CisgKiAgICAgICAvLyAgcHJlOiBmdW5jdGlvbiBwcmVMaW5rKHNjb3BlLCBpRWxlbWVudCwgaUF0dHJzLCBjb250cm9sbGVyKSB7IC4uLiB9LAorICogICAgICAgLy8gIHBvc3Q6IGZ1bmN0aW9uIHBvc3RMaW5rKHNjb3BlLCBpRWxlbWVudCwgaUF0dHJzLCBjb250cm9sbGVyKSB7IC4uLiB9CisgKiAgICAgICAvLyB9CisgKiAgICAgICAvLyBvcgorICogICAgICAgLy8gbGluazogZnVuY3Rpb24gcG9zdExpbmsoIC4uLiApIHsgLi4uIH0KKyAqICAgICB9OworICogICAgIHJldHVybiBkaXJlY3RpdmVEZWZpbml0aW9uT2JqZWN0OworICogICB9KTsKKyAqIGBgYAorICoKKyAqIDxkaXYgY2xhc3M9ImFsZXJ0IGFsZXJ0LXdhcm5pbmciPgorICogKipOb3RlOioqIEFueSB1bnNwZWNpZmllZCBvcHRpb25zIHdpbGwgdXNlIHRoZSBkZWZhdWx0IHZhbHVlLiBZb3UgY2FuIHNlZSB0aGUgZGVmYXVsdCB2YWx1ZXMgYmVsb3cuCisgKiA8L2Rpdj4KKyAqCisgKiBUaGVyZWZvcmUgdGhlIGFib3ZlIGNhbiBiZSBzaW1wbGlmaWVkIGFzOgorICoKKyAqIGBgYGpzCisgKiAgIHZhciBteU1vZHVsZSA9I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VsZW1lbnQuaHRtbCh2YWx1ZSk7CisKKyAgICAgICAgICAgICAgICAvLyBjb21waWxlIHRoZSBuZXcgRE9NIGFuZCBsaW5rIGl0IHRvIHRoZSBjdXJyZW50CisgICAgICAgICAgICAgICAgLy8gc2NvcGUuCisgICAgICAgICAgICAgICAgLy8gTk9URTogd2Ugb25seSBjb21waWxlIC5jaGlsZE5vZGVzIHNvIHRoYXQKKyAgICAgICAgICAgICAgICAvLyB3ZSBkb24ndCBnZXQgaW50byBpbmZpbml0ZSBsb29wIGNvbXBpbGluZyBvdXJzZWx2ZXMKKyAgICAgICAgICAgICAgICAkY29tcGlsZShlbGVtZW50LmNvbnRlbnRzKCkpKHNjb3BlKTsKKyAgICAgICAgICAgICAgfQorICAgICAgICAgICAgKTsKKyAgICAgICAgICB9OworICAgICAgICB9KTsKKyAgICAgIH0pCisgICAgICAuY29udHJvbGxlcignR3JlZXRlckNvbnRyb2xsZXInLCBbJyRzY29wZScsIGZ1bmN0aW9uKCRzY29wZSkgeworICAgICAgICAkc2NvcGUubmFtZSA9ICdBbmd1bGFyJzsKKyAgICAgICAgJHNjb3BlLmh0bWwgPSAnSGVsbG8ge3tuYW1lfX0nOworICAgICAgfV0pOworICAgIDwvc2NyaXB0PgorICAgIDxkaXYgbmctY29udHJvbGxlcj0iR3JlZXRlckNvbnRyb2xsZXIiPgorICAgICAgPGlucHV0IG5nLW1vZGVsPSJuYW1lIj4gPGJyPgorICAgICAgPHRleHRhcmVhIG5nLW1vZGVsPSJodG1sIj48L3RleHRhcmVhPiA8YnI+CisgICAgICA8ZGl2IGNvbXBpbGU9Imh0bWwiPjwvZGl2PgorICAgIDwvZGl2PgorICAgPC9maWxlPgorICAgPGZpbGUgbmFtZT0icHJvdHJhY3Rvci5qcyIgdHlwZT0icHJvdHJhY3RvciI+CisgICAgIGl0KCdzaG91bGQgYXV0byBjb21waWxlJywgZnVuY3Rpb24oKSB7CisgICAgICAgdmFyIHRleHRhcmVhID0gJCgndGV4dGFyZ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ICAgIH0gZWxzZSBpZiAoIWRpcmVjdGl2ZS5jb21waWxlICYmIGRpcmVjdGl2ZS5saW5rKSB7CisgICAgICAgICAgICAgICAgICBkaXJlY3RpdmUuY29tcGlsZSA9IHZhbHVlRm4oZGlyZWN0aXZlLmxpbmspOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICBkaXJlY3RpdmUucHJpb3JpdHkgPSBkaXJlY3RpdmUucHJpb3JpdHkgfHwgMDsKKyAgICAgICAgICAgICAgICBkaXJlY3RpdmUuaW5kZXggPSBpbmRleDsKKyAgICAgICAgICAgICAgICBkaXJlY3RpdmUubmFtZSA9IGRpcmVjdGl2ZS5uYW1lIHx8IG5hbWU7CisgICAgICAgICAgICAgICAgZGlyZWN0aXZlLnJlcXVpcmUgPSBkaXJlY3RpdmUucmVxdWlyZSB8fCAoZGlyZWN0aXZlLmNvbnRyb2xsZXIgJiYgZGlyZWN0aXZlLm5hbWUpOworICAgICAgICAgICAgICAgIGRpcmVjdGl2ZS5yZXN0cmljdCA9IGRpcmVjdGl2ZS5yZXN0cmljdCB8fCAnQSc7CisgICAgICAgICAgICAgICAgZGlyZWN0aXZlcy5wdXNoKGRpcmVjdGl2ZSk7CisgICAgICAgICAgICAgIH0gY2F0Y2ggKGUpIHsKKyAgICAgICAgICAgICAgICAkZXhjZXB0aW9uSGFuZGxlcihlKTsKKyAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfSk7CisgICAgICAgICAgICByZXR1cm4gZGlyZWN0aXZlczsKKyAgICAgICAgICB9XSk7CisgICAgICB9CisgICAgICBoYXNEaXJlY3RpdmVzW25hbWVdLnB1c2goZGlyZWN0aXZlRmFjdG9yeSk7CisgICAgfSBlbHNlIHsKKyAgICAgIGZvckVhY2gobmFtZSwgcmV2ZXJzZVBhcmFtcyhyZWdpc3RlckRpcmVjdGl2ZSkpOworICAgIH0KKyAgICByZXR1cm4gdGhpczsKKyAgfTsKKworCisgIC8qKgorICAgKiBAbmdkb2MgbWV0a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ck5hbWUgT3B0aW9uYWwgbm9uZSBub3JtYWxpemVkIG5hbWUuIERlZmF1bHRzIHRvIGtleS4KKyAgICAgICAqLworICAgICAgJHNldDogZnVuY3Rpb24oa2V5LCB2YWx1ZSwgd3JpdGVBdHRyLCBhdHRyTmFtZSkgeworICAgICAgICAvLyBUT0RPOiBkZWNpZGUgd2hldGhlciBvciBub3QgdG8gdGhyb3cgYW4gZXJyb3IgaWYgImNsYXNzIgorICAgICAgICAvL2lzIHNldCB0aHJvdWdoIHRoaXMgZnVuY3Rpb24gc2luY2UgaXQgbWF5IGNhdXNlICR1cGRhdGVDbGFzcyB0bworICAgICAgICAvL2JlY29tZSB1bnN0YWJsZS4KKworICAgICAgICB2YXIgYm9vbGVhbktleSA9IGdldEJvb2xlYW5BdHRyTmFtZSh0aGlzLiQkZWxlbWVudFswXSwga2V5KSwKKyAgICAgICAgICAgIG5vcm1hbGl6ZWRWYWwsCisgICAgICAgICAgICBub2RlTmFtZTsKKworICAgICAgICBpZiAoYm9vbGVhbktleSkgeworICAgICAgICAgIHRoaXMuJCRlbGVtZW50LnByb3Aoa2V5LCB2YWx1ZSk7CisgICAgICAgICAgYXR0ck5hbWUgPSBib29sZWFuS2V5OworICAgICAgICB9CisKKyAgICAgICAgdGhpc1trZXldID0gdmFsdWU7CisKKyAgICAgICAgLy8gdHJhbnNsYXRlIG5vcm1hbGl6ZWQga2V5IHRvIGFjdHVhbCBrZXkKKyAgICAgICAgaWYgKGF0dHJOYW1lKSB7CisgICAgICAgICAgdGhpcy4kYXR0cltrZXldID0gYXR0ck5hbWU7CisgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgYXR0ck5hbWUgPSB0aGlzLiRhdHRyW2tleV07CisgICAgICAgICAgaWYgKCFhdHRyTmFtZSkgeworICAgICAgICAgICAgdGhpcy4kYXR0cltrZXldID0gYXR0ck5hbWUgPSBzbmFrZV9jYXNlKGtleSwgJy0nKTsKKyAgICAgICAgICB9CisgICAgICAgIH0KKworICAgICAgICBub2RlTmFtZSA9IG5vZGVOYW1lXyh0aGlzLiQkZWxlbWVudCk7CisKKyAgICAgICAgLy8gc2FuaXRpemUgYVtocmVmXSBhbmQgaW1nW3NyY10gdmFsdWVzCisgICAgICAgIGlmICgobm9kZU5hbWUgPT09ICdBJyAmJiBrZXkgPT09ICdocmVmJykgfHwKKyAgICAgICAgICAgIChub2RlTmFtZSA9PT0gJ0lNRycgJiYga2V5ID09PSAnc3JjJykpIHsKKyAgICAgICAgICB0aGlzW2tleV0gPSB2YWx1ZSA9ICQkc2FuaXRpemVVcmkodmFsdWUsIGtleSA9PT0gJ3NyYycpOworICAgICAgICB9CisKKyAgICAgICAgaWYgKHdyaXRlQXR0ciAhPT0gZmFsc2UpIHsKKyAgICAgICAgICBpZiAodmFsdWUgPT09IG51bGwgfHwgdmFsdWUgPT09IHVuZGVmaW5lZCkgeworICAgICAgICAgICAgdGhpcy4kJGVsZW1lbnQucmVtb3ZlQXR0cihhdHRyTmFtZSk7CisgICAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgIHRoaXMuJCRlbGVtZW50LmF0dHIoYXR0ck5hbWUsIHZhbHVlKTsKKyAgICAgICAgICB9CisgICAgICAgIH0KKworICAgICAgICAvLyBmaXJlIG9ic2VydmVycworICAgICAgICB2YXIgJCRvYnNlcnZlcnMgPSB0aGlzLiQkb2JzZXJ2ZXJzOworICAgICAgICAkJG9ic2VydmVycyAmJiBmb3JFYWNoKCQkb2JzZXJ2ZXJzW2tleV0sIGZ1bmN0aW9uKGZuKSB7CisgICAgICAgICAgdHJ5IHsKKyAgICAgICAgICAgIGZuKHZhbHVlKTsKKyAgICAgICAgICB9IGNhdGNoIChlKSB7CisgICAgICAgICAgICAkZXhjZXB0aW9uSGFuZGxlcihlKTsKKyAgICAgICAgICB9CisgICAgICAgIH0pOworICAgICAgfSwKKworCisgICAgICAvKioKKyAgICAgICAqIEBuZ2RvYyBtZXRob2QKKyAgICAgICAqIEBuYW1lICRjb21waWxlLmRpcm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YnNlcnZlcnMgfHwgKGF0dHJzLiQkb2JzZXJ2ZXJzID0ge30pKSwKKyAgICAgICAgICAgIGxpc3RlbmVycyA9ICgkJG9ic2VydmVyc1trZXldIHx8ICgkJG9ic2VydmVyc1trZXldID0gW10pKTsKKworICAgICAgICBsaXN0ZW5lcnMucHVzaChmbik7CisgICAgICAgICRyb290U2NvcGUuJGV2YWxBc3luYyhmdW5jdGlvbigpIHsKKyAgICAgICAgICBpZiAoIWxpc3RlbmVycy4kJGludGVyKSB7CisgICAgICAgICAgICAvLyBubyBvbmUgcmVnaXN0ZXJlZCBhdHRyaWJ1dGUgaW50ZXJwb2xhdGlvbiBmdW5jdGlvbiwgc28gbGV0cyBjYWxsIGl0IG1hbnVhbGx5CisgICAgICAgICAgICBmbihhdHRyc1trZXldKTsKKyAgICAgICAgICB9CisgICAgICAgIH0pOworICAgICAgICByZXR1cm4gZm47CisgICAgICB9CisgICAgfTsKKworICAgIHZhciBzdGFydFN5bWJvbCA9ICRpbnRlcnBvbGF0ZS5zdGFydFN5bWJvbCgpLAorICAgICAgICBlbmRTeW1ib2wgPSAkaW50ZXJwb2xhdGUuZW5kU3ltYm9sKCksCisgICAgICAgIGRlbm9ybWFsaXplVGVtcGxhdGUgPSAoc3RhcnRTeW1ib2wgPT0gJ3t7JyB8fCBlbmRTeW1ib2wgID09ICd9fScpCisgICAgICAgICAgICA/IGlkZW50aXR5CisgICAgICAgICAgICA6IGZ1bmN0aW9uIGRlbm9ybWFsaXplVGVtcGxhdGUodGVtcGxhdGUpIHsKKyAgICAgICAgICAgICAgcmV0dXJuIHRlbXBsYXRlLnJlcGxhY2UoL1x7XHsvZywgc3RhcnRTeW1ib2wpLnJlcGxhY2UoL319L2csIGVuZFN5bWJvbCk7CisgICAgICAgIH0sCisgICAgICAgIE5HX0FUVFJfQklORElORyA9IC9ebmdBdHRyW0EtWl0vOworCisKKyAgICByZXR1cm4gY29tcGlsZTsKKworICAgIC8vPT09PT09PT09PT09PT09PT09PT09PT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0byBub24tdGV4dCBub2Rlcy4KKyAgICAgICAgZm9yKHZhciBpID0gMCwgaWkgPSAkbGlua05vZGUubGVuZ3RoOyBpPGlpOyBpKyspIHsKKyAgICAgICAgICB2YXIgbm9kZSA9ICRsaW5rTm9kZVtpXSwKKyAgICAgICAgICAgICAgbm9kZVR5cGUgPSBub2RlLm5vZGVUeXBlOworICAgICAgICAgIGlmIChub2RlVHlwZSA9PT0gMSAvKiBlbGVtZW50ICovIHx8IG5vZGVUeXBlID09PSA5IC8qIGRvY3VtZW50ICovKSB7CisgICAgICAgICAgICAkbGlua05vZGUuZXEoaSkuZGF0YSgnJHNjb3BlJywgc2NvcGUpOworICAgICAgICAgIH0KKyAgICAgICAgfQorCisgICAgICAgIGlmIChjbG9uZUNvbm5lY3RGbikgY2xvbmVDb25uZWN0Rm4oJGxpbmtOb2RlLCBzY29wZSk7CisgICAgICAgIGlmIChjb21wb3NpdGVMaW5rRm4pIGNvbXBvc2l0ZUxpbmtGbihzY29wZSwgJGxpbmtOb2RlLCAkbGlua05vZGUsIHBhcmVudEJvdW5kVHJhbnNjbHVkZUZuKTsKKyAgICAgICAgcmV0dXJuICRsaW5rTm9kZTsKKyAgICAgIH07CisgICAgfQorCisgICAgZnVuY3Rpb24gc2FmZUFkZENsYXNzKCRlbGVtZW50LCBjbGFzc05hbWUpIHsKKyAgICAgIHRyeSB7CisgICAgICAgICRlbGVtZW50LmFkZENsYXNzKGNsYXNzTmFtZSk7CisgICAgICB9IGNhdGNoKGUpIHsKKyAgICAgICAgLy8gaWdub3JlLCBzaW5jZSBpdCBtZWFucyB0aGF0IHdlIGFyZSB0cnlpbmcgdG8gc2V0IGNsYXNzIG9uCisgICAgICAgIC8vIFNWRyBlbGVtZW50LCB3aGVyZSBjbGFzcyBuYW1lIGlzIHJlYWQtb25seS4KKyAgICAgIH0KKyAgICB9CisKKyAgICAvKioKKyAgICAgKiBDb21waWxlIGZ1bmN0aW9uIG1hdGNoZXMgZWFjaCBub2RlIGluIG5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ub2RlTGlua0ZuID0gKGRpcmVjdGl2ZXMubGVuZ3RoKQorICAgICAgICAgICAgPyBhcHBseURpcmVjdGl2ZXNUb05vZGUoZGlyZWN0aXZlcywgbm9kZUxpc3RbaV0sIGF0dHJzLCB0cmFuc2NsdWRlRm4sICRyb290RWxlbWVudCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbnVsbCwgW10sIFtdLCBwcmV2aW91c0NvbXBpbGVDb250ZXh0KQorICAgICAgICAgICAgOiBudWxsOworCisgICAgICAgIGlmIChub2RlTGlua0ZuICYmIG5vZGVMaW5rRm4uc2NvcGUpIHsKKyAgICAgICAgICBzYWZlQWRkQ2xhc3MoYXR0cnMuJCRlbGVtZW50LCAnbmctc2NvcGUnKTsKKyAgICAgICAgfQorCisgICAgICAgIGNoaWxkTGlua0ZuID0gKG5vZGVMaW5rRm4gJiYgbm9kZUxpbmtGbi50ZXJtaW5hbCB8fAorICAgICAgICAgICAgICAgICAgICAgICEoY2hpbGROb2RlcyA9IG5vZGVMaXN0W2ldLmNoaWxkTm9kZXMpIHx8CisgICAgICAgICAgICAgICAgICAgICAgIWNoaWxkTm9kZXMubGVuZ3RoKQorICAgICAgICAgICAgPyBudWxsCisgICAgICAgICAgICA6IGNvbXBpbGVOb2RlcyhjaGlsZE5vZGVzLAorICAgICAgICAgICAgICAgICBub2RlTGlua0ZuID8gKAorICAgICAgICAgICAgICAgICAgKG5vZGVMaW5rRm4udHJhbnNjbHVkZU9uVGhpc0VsZW1lbnQgfHwgIW5vZGVMaW5rRm4udGVtcGxhdGVPblRoaXNFbGVtZW50KQorICAgICAgICAgICAgICAgICAgICAgJiYgbm9kZUxpbmtGbi50cmFuc2NsdWRlKSA6IHRyYW5zY2x1ZGVGbik7CisKKyAgICAgICAgbGlua0Zucy5wdXNoKG5vZGVMaW5rRm4sIGNoaWxkTGlua0ZuKTsKKyAgICAgICAgbGlua0ZuRm91bmQgPSBsaW5rRm5Gb3VuZCB8fCBub2RlT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kZSA9IHN0YWJsZU5vZGVMaXN0W25dOworICAgICAgICAgIG5vZGVMaW5rRm4gPSBsaW5rRm5zW2krK107CisgICAgICAgICAgY2hpbGRMaW5rRm4gPSBsaW5rRm5zW2krK107CisKKyAgICAgICAgICBpZiAobm9kZUxpbmtGbikgeworICAgICAgICAgICAgaWYgKG5vZGVMaW5rRm4uc2NvcGUpIHsKKyAgICAgICAgICAgICAgY2hpbGRTY29wZSA9IHNjb3BlLiRuZXcoKTsKKyAgICAgICAgICAgICAganFMaXRlLmRhdGEobm9kZSwgJyRzY29wZScsIGNoaWxkU2NvcGUpOworICAgICAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgICAgY2hpbGRTY29wZSA9IHNjb3BlOworICAgICAgICAgICAgfQorCisgICAgICAgICAgICBpZiAoIG5vZGVMaW5rRm4udHJhbnNjbHVkZU9uVGhpc0VsZW1lbnQgKSB7CisgICAgICAgICAgICAgIGNoaWxkQm91bmRUcmFuc2NsdWRlRm4gPSBjcmVhdGVCb3VuZFRyYW5zY2x1ZGVGbihzY29wZSwgbm9kZUxpbmtGbi50cmFuc2NsdWRlLCBwYXJlbnRCb3VuZFRyYW5zY2x1ZGVGbik7CisKKyAgICAgICAgICAgIH0gZWxzZSBpZiAoIW5vZGVMaW5rRm4udGVtcGxhdGVPblRoaXNFbGVtZW50ICYmIHBhcmVudEJvdW5kVHJhbnNjbHVkZUZuKSB7CisgICAgICAgICAgICAgIGNoaWxkQm91bmRUcmFuc2NsdWRlRm4gPSBwYXJlbnRCb3VuZFRyYW5zY2x1ZGVGbjsKKworICAgICAgICAgICAgfSBlbHNlIGlmICghcGFyZW50Qm91bmRUcmFuc2NsdWRlRm4gJiYgdHJhbnNjbHVkZUZuKSB7CisgICAgICAgICAgICAgIGNoaWxkQm91bmRUcmFuc2NsdWRlRm4gPSBjcmVhdGVCb3VuZFRyYW5zY2x1ZGVGbihzY29wZSwgdHJhbnNjbHVkZUZuKTsKKworICAgICAgICAgICAgfSBlbHNl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oLAorICAgICAgICAgIGNsYXNzTmFtZTsKKworICAgICAgc3dpdGNoKG5vZGVUeXBlKSB7CisgICAgICAgIGNhc2UgMTogLyogRWxlbWVudCAqLworICAgICAgICAgIC8vIHVzZSB0aGUgbm9kZSBuYW1lOiA8ZGlyZWN0aXZlPgorICAgICAgICAgIGFkZERpcmVjdGl2ZShkaXJlY3RpdmVzLAorICAgICAgICAgICAgICBkaXJlY3RpdmVOb3JtYWxpemUobm9kZU5hbWVfKG5vZGUpLnRvTG93ZXJDYXNlKCkpLCAnRScsIG1heFByaW9yaXR5LCBpZ25vcmVEaXJlY3RpdmUpOworCisgICAgICAgICAgLy8gaXRlcmF0ZSBvdmVyIHRoZSBhdHRyaWJ1dGVzCisgICAgICAgICAgZm9yICh2YXIgYXR0ciwgbmFtZSwgbk5hbWUsIG5nQXR0ck5hbWUsIHZhbHVlLCBpc05nQXR0ciwgbkF0dHJzID0gbm9kZS5hdHRyaWJ1dGVzLAorICAgICAgICAgICAgICAgICAgIGogPSAwLCBqaiA9IG5BdHRycyAmJiBuQXR0cnMubGVuZ3RoOyBqIDwgamo7IGorKykgeworICAgICAgICAgICAgdmFyIGF0dHJTdGFydE5hbWUgPSBmYWxzZTsKKyAgICAgICAgICAgIHZhciBhdHRyRW5kTmFtZSA9IGZhbHNlOworCisgICAgICAgICAgICBhdHRyID0gbkF0dHJzW2pdOworICAgICAgICAgICAgaWYgKCFtc2llIHx8IG1zaWUgPj0gOCB8fCBhdHRyLnNwZWNpZmllZCkgeworICAgICAgICAgICAgICBuYW1lID0gYXR0ci5uYW1lOworICAgICAgICAgICAgICB2YWx1ZSA9IHRyaW0oYXR0ci52YWx1ZSk7CisKKyAgICAgICAgICAgICAgLy8gc3VwcG9ydCBuZ0F0dHIgYXR0cmlidXRlIGJpbmRpbmcKKyAgICAgICAgICAgICAgbmdBdHRyTmFtZSA9IGRpcmVjdGl2ZU5vcm1hbGl6ZShuYW1lKTsKKyAgICAgICAgICAgICAgaWYgKGlzTmdBdHRyID0gTkdfQVRUUl9CSU5ESU5HLnRlc3QobmdBdHRyTmFtZSkpIHsKKyAgICAgICAgICAgICAgICBuYW1lID0gc25ha2VfY2FzZShuZ0F0dHJOYW1lLnN1YnN0cig2KSwgJy0nKTsKKyAgICAgICAgICAgICAgfQorCisgICAgICAgICAgICAgIHZhciBkaXJlY3RpdmVOTmFtZSA9IG5nQXR0ck5hbWUucmVwbGFjZSgvKFN0YXJ0fEVuZCkkLywgJycpOworICAgICAgICAgICAgICBpZiAobmdBdHRyTmFtZSA9PT0gZGlyZWN0aXZlTk5hbWUgKyAnU3RhcnQnKSB7CisgICAgICAgICAgICAgICAgYXR0clN0YXJ0TmFtZSA9IG5hbWU7CisgICAgICAgICAgICAgICAgYXR0ckVuZE5hbWUgPSBuYW1lLnN1YnN0cigwLCBuYW1lLmxlbmd0aCAtIDUpICsgJ2VuZCc7CisgICAgICAgICAgICAgICAgbmFtZSA9IG5hbWUuc3Vic3RyKDAsIG5hbWUubGVuZ3RoIC0gNik7CisgICAgICAgICAgICAgIH0KKworICAgICAgICAgICAgICBuTmFtZSA9IGRpcmVjdGl2ZU5vcm1hbGl6ZShuYW1lLnRvTG93ZXJDYXNlKCkpOworICAgICAgICAgICAgICBhdHRyc01hcFtuTmFtZV0gPSBuYW1lOworICAgICAgICAgICAgICBpZiAoaXNOZ0F0dHIgfHwgIWF0dHJzLmhhc093blByb3BlcnR5KG5OYW1lKSkgeworICAgICAgICAgICAgICAgICAgYXR0cnNbbk5hbWVdID0gdmFsdWU7CisgICAgICAgICAgICAgICAgICBpZiAoZ2V0Qm9vbGVhbkF0dHJOYW1lKG5vZGUsIG5OYW1lKSkgeworICAgICAgICAgICAgICAgICAgICBhdHRyc1tuTmFtZV0gPSB0cnVlOyAvLyBwcmVzZW5jZSBtZWFucyB0cnVlCisgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgYWRkQXR0ckludGVycG9sYXRlRGlyZWN0aXZlKG5vZGUsIGRpcmVjdGl2ZXMsIHZhbHVlLCBuTmFtZSk7CisgICAgICAgICAgICAgIGFkZERpcmVjdGl2ZShkaXJlY3RpdmVzLCBuTmFtZSwgJ0EnLCBtYXhQcmlvcml0eSwgaWdub3JlRGlyZWN0aXZlLCBhdHRyU3RhcnROYW1lLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIGF0dHJFbmROYW1lKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICB9CisKKyAgICAgICAgICAvLyB1c2UgY2xhc3MgYXMgZGlyZWN0aXZlCisgICAgICAgICAgY2xhc3NOYW1lID0gbm9kZS5jbGFzc05hbWU7CisgICAgICAgICAgaWYgKGlzU3RyaW5nKGNsYXNzTmFtZSkgJiYgY2xhc3NOYW1lICE9PSAnJykgeworICAgICAgICAgICAgd2hpbGUgKG1hdGNoID0gQ0xBU1NfRElSRUNUSVZFX1JFR0VYUC5leGVjKGNsYXNzTmFtZSkpIHsKKyAgICAgICAgICAgICAgbk5hbWUgPSBkaXJlY3RpdmVOb3JtYWxpemUobWF0Y2hbMl0pOworICAgICAgICAgICAgICBpZiAoYWRkRGlyZWN0aXZlKGRpcmVjdGl2ZXMsIG5OYW1lLCAnQycsIG1heFByaW9yaXR5LCBpZ25vcmVEaXJlY3RpdmUpKSB7CisgICAgICAgICAgICAgICAgYXR0cnNbbk5hbWVdID0gdHJpbShtYXRjaFszXSk7CisgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgY2xhc3NOYW1lID0gY2xhc3NOYW1lLnN1YnN0cihtYXRjaC5pbmRleCArIG1hdGNoWzBdLmxlbmd0aCk7CisgICAgICAgICAgICB9CisgICAgICAgICAgfQorICAgICAgICAgIGJyZWFrOworICAgICAgICBjYXNlIDM6IC8qIFRleHQgTm9kZSAqLworICAgICAgICAgIGFkZFRleHRJbnRlcnBvbGF0ZURpcmVjdGl2ZShkaXJlY3RpdmVzLCBub2RlLm5vZGVWYWx1ZSk7CisgICAgICAgICAgYnJlYWs7CisgICAgICAgIGNhc2UgODogLyogQ29tbWVudCAqLworICAgICAgICAgIHRyeSB7CisgICAgICAgICAgICBtYXRjaCA9IENPTU1FTlRfRElSRUNUSVZFX1JFR0VYUC5leGVjKG5vZGUubm9kZVZhbHVlKTsKKyAgICAgICAgICAgIGlmIChtYXRjaCkgeworICAgICAgICAgICAgICBuTmFtZSA9IGRpcmVjdGl2ZU5vcm1hbGl6ZShtYXRjaFsxXSk7CisgICAgICAgICAgICAgIGlmIChhZGREaXJlY3RpdmUoZGlyZWN0aXZlcywgbk5hbWUsICdNJywgbWF4UHJpb3JpdHksIGlnbm9yZURpcmVjdGl2ZSkpIHsKKyAgICAgICAgICAgICAgICBhdHRyc1tuTmFtZV0gPSB0cmltKG1hdGNoWzJdKTsKKyAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfQorICAgICAgICAgIH0gY2F0Y2ggKGUpIHsKKyAgICAgICAgICAgIC8vIHR1cm5zIG91dCB0aGF0IHVuZGVyIHNvbWUgY2lyY3Vtc3RhbmNlcyBJRTkgdGhyb3dzIGVycm9ycyB3aGVuIG9uZSBhdHRlbXB0cyB0byByZWFkCisgICAgICAgICAgICAvLyBjb21tZW50J3Mgbm9kZSB2YWx1ZS4KKyAgICAgICAgICAgIC8vIEp1c3QgaWdub3JlIGl0IGFuZCBjb250aW51ZS4gKENhbid0IHNlZW0gdG8gcmVwcm9kdWNlIGluIHRlc3QgY2FzZS4pCisgICAgICAgICAgfQorICAgICAgICAgIGJyZWFrOworICAgICAgfQorCisgICAgICBkaXJlY3RpdmVzLnNvcnQoYnlQcmlvcml0eSk7CisgICAgICByZXR1cm4gZGlyZWN0aXZlczsKKyAgICB9CisKKyAgICAvKioKKyAgICAgKiBHaXZlbiBhIG5vZGUgd2l0aCBhbiBkaXJlY3RpdmUtc3RhcnQgaXQgY29sbGVjdHMgYWxsIG9mIHRoZSBzaWJsaW5ncyB1bnRpbCBpdCBmaW5kcworICAgICAqIGRpcmVjdGl2ZS1lbmQuCisgICAgICogQHBhcmFtIG5vZGUKKyAgICAgKiBAcGFyYW0gYXR0clN0YXJ0CisgICAgICogQHBhcmFtIGF0dHJFbmQKKyAgICAgKiBAcmV0dXJucyB7Kn0KKyAgICAgKi8KKyAgICBmdW5jdGlvbiBncm91cFNjYW4obm9kZSwgYXR0clN0YXJ0LCBhdHRyRW5kKSB7CisgICAgICB2YXIgbm9kZXMgPSBbXTsKKyAgICAgIHZhciBkZXB0aCA9IDA7CisgICAgICBpZiAoYXR0clN0YXJ0ICYmIG5vZGUuaGFzQXR0cmlidXRlICYmIG5vZGUuaGFzQXR0cmlidXRlKGF0dHJTdGFydCkpIHsKKyAgICAgICAgdmFyIHN0YXJ0Tm9kZSA9IG5vZGU7CisgICAgICAgIGRvIHsKKyAgICAgICAgICBpZiAoIW5vZGUpIHsKKyAgICAgICAgICAgIHRocm93ICRjb21waWxlTWluRXJyKCd1dGVyZGlyJywKKyAgICAgICAgICAgICAgICAgICAgICAiVW50ZXJtaW5hdGVkIGF0dHJpYnV0ZSwgZm91bmQgJ3swfScgYnV0IG5vIG1hdGNoaW5nICd7MX0nIGZvdW5kLiIsCisgICAgICAgICAgICAgICAgICAgICAgYXR0clN0YXJ0LCBhdHRyRW5kKTsKKyAgICAgICAgICB9CisgICAgICAgICAgaWYgKG5vZGUubm9kZVR5cGUgPT0gMSAvKiogRWxlbWVudCAqKi8pIHsKKyAgICAgICAgICAgIGlmIChub2RlLmhhc0F0dHJpYnV0ZShhdHRyU3RhcnQpKSBkZXB0aCsrOworICAgICAgICAgICAgaWYgKG5vZGUuaGFzQXR0cmlidXRlKGF0dHJFbmQpKSBkZXB0aC0tOworICAgICAgICAgIH0KKyAgICAgICAgICBub2Rlcy5wdXNoKG5vZGUpOworICAgICAgICAgIG5vZGUgPSBub2RlLm5leHRTaWJsaW5nOworICAgICAgICB9IHdoaWxlIChkZXB0aCA+IDApOworICAgICAgfSBlbHNlIHsKKyAgICAgICAgbm9kZXMucHVzaChub2RlKTsKKyAgICAg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Bub2RlcworICAgICAqICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgb24gaXQuCisgICAgICogQHBhcmFtIHtPYmplY3Q9fSBvcmlnaW5hbFJlcGxhY2VEaXJlY3RpdmUgQW4gb3B0aW9uYWwgZGlyZWN0aXZlIHRoYXQgd2lsbCBiZSBpZ25vcmVkIHdoZW4KKyAgICAgKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb21waWxpbmcgdGhlIHRyYW5zY2x1c2lvbi4KKyAgICAgKiBAcGFyYW0ge0FycmF5LjxGdW5jdGlvbj59IHByZUxpbmtGbnMKKyAgICAgKiBAcGFyYW0ge0FycmF5LjxGdW5jdGlvbj59IHBvc3RMaW5rRm5zCisgICAgICogQHBhcmFtIHtPYmplY3R9IHByZXZpb3VzQ29tcGlsZUNvbnRleHQgQ29udGV4dCB1c2VkIGZvciBwcmV2aW91cyBjb21waWxhdGlvbiBvZiB0aGUgY3VycmVudAorICAgICAqICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG5vZGUKKyAgICAgKiBAcmV0dXJucyB7RnVuY3Rpb259IGxpbmtGbgorICAgICAqLworICAgIGZ1bmN0aW9uIGFwcGx5RGlyZWN0aXZlc1RvTm9kZShkaXJlY3RpdmVzLCBjb21waWxlTm9kZSwgdGVtcGxhdGVBdHRycywgdHJhbnNjbHVkZUZuLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBqcUNvbGxlY3Rpb24sIG9yaWdpbmFsUmVwbGFjZURpcmVjdGl2ZSwgcHJlTGlua0ZucywgcG9zdExpbmtGbnMsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHByZXZpb3VzQ29tcGlsZUNvbnRleHQpIHsKKyAgICAgIHByZXZpb3VzQ29tcGlsZUNvbnRleHQgPSBwcmV2aW91c0NvbXBpbGVDb250ZXh0IHx8IHt9OworCisgICAgICB2YXIgdGVybWluYWxQcmlvcml0eSA9IC1OdW1i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gICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRlbXBsYXRlQXR0cnNbZGlyZWN0aXZlTmFtZV0gKyAnICcpKTsKKyAgICAgICAgICAgIGNvbXBpbGVOb2RlID0gJGNvbXBpbGVOb2RlWzBdOworICAgICAgICAgICAgcmVwbGFjZVdpdGgoanFDb2xsZWN0aW9uLCBzbGljZUFyZ3MoJHRlbXBsYXRlKSwgY29tcGlsZU5vZGUpOworCisgICAgICAgICAgICBjaGlsZFRyYW5zY2x1ZGVGbiA9IGNvbXBpbGUoJHRlbXBsYXRlLCB0cmFuc2NsdWRlRm4sIHRlcm1pbmFsUHJpb3JpdHksCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmVwbGFjZURpcmVjdGl2ZSAmJiByZXBsYWNlRGlyZWN0aXZlLm5hbWUsIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vIERvbid0IHBhc3MgaW46CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyAtIGNvbnRyb2xsZXJEaXJlY3RpdmVzIC0gb3RoZXJ3aXNlIHdlJ2xsIGNyZWF0ZSBkdXBsaWNhdGVzIGNvbnRyb2xsZXJzCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyAtIG5ld0lzb2xhdGVTY29wZURpcmVjdGl2ZSBvciB0ZW1wbGF0ZURpcmVjdGl2ZSAtIGNvbWJpbmluZyB0ZW1wbGF0ZXMgd2l0aAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gICBlbGVtZW50IHRyYW5zY2x1c2lvbiBkb2Vzbid0IG1ha2Ugc2Vuc2UuCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gV2UgbmVlZCBvbmx5IG5vblRsYlRyYW5zY2x1ZGV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JlY3RpdmUsCisgICAgICAgICAgICAgICAgbm9uVGxiVHJhbnNjbHVkZURpcmVjdGl2ZTogbm9uVGxiVHJhbnNjbHVkZURpcmVjdGl2ZQorICAgICAgICAgICAgICB9KTsKKyAgICAgICAgICBpaSA9IGRpcmVjdGl2ZXMubGVuZ3RoOworICAgICAgICB9IGVsc2UgaWYgKGRpcmVjdGl2ZS5jb21waWxlKSB7CisgICAgICAgICAgdHJ5IHsKKyAgICAgICAgICAgIGxpbmtGbiA9IGRpcmVjdGl2ZS5jb21waWxlKCRjb21waWxlTm9kZSwgdGVtcGxhdGVBdHRycywgY2hpbGRUcmFuc2NsdWRlRm4pOworICAgICAgICAgICAgaWYgKGlzRnVuY3Rpb24obGlua0ZuKSkgeworICAgICAgICAgICAgICBhZGRMaW5rRm5zKG51bGwsIGxpbmtGbiwgYXR0clN0YXJ0LCBhdHRyRW5kKTsKKyAgICAgICAgICAgIH0gZWxzZSBpZiAobGlua0ZuKSB7CisgICAgICAgICAgICAgIGFkZExpbmtGbnMobGlua0ZuLnByZSwgbGlua0ZuLnBvc3QsIGF0dHJTdGFydCwgYXR0ckVuZCk7CisgICAgICAgICAgICB9CisgICAgICAgICAgfSBjYXRjaCAoZSkgeworICAgICAgICAgICAgJGV4Y2VwdGlvbkhhbmRsZXIoZSwgc3RhcnRpbmdUYWcoJGNvbXBpbGVOb2RlKSk7CisgICAgICAgICAgfQorICAgICAgICB9CisKKyAgICAgICAgaWYgKGRpcmVjdGl2ZS50ZXJtaW5hbCkgeworICAgICAgICAgIG5vZGVMaW5rRm4udGVybWluYWwgPSB0cnVlOworICAgICAgICAgIHRlcm1pbmFsUHJpb3JpdHkgPSBNYXRoLm1heCh0ZXJtaW5hbFByaW9yaXR5LCBkaXJlY3RpdmUucHJpb3JpdHkpOworICAgICAgICB9CisKKyAgICAgIH0KKworICAgICAgbm9kZUxpbmtGbi5zY29wZSA9IG5ld1Njb3BlRGlyZWN0aXZlICYmIG5ld1Njb3BlRGlyZWN0aX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0ZVNjb3BlOiB0cnVlfSk7CisgICAgICAgICAgfQorICAgICAgICAgIHByZUxpbmtGbnMucHVzaChwcmUpOworICAgICAgICB9CisgICAgICAgIGlmIChwb3N0KSB7CisgICAgICAgICAgaWYgKGF0dHJTdGFydCkgcG9zdCA9IGdyb3VwRWxlbWVudHNMaW5rRm5XcmFwcGVyKHBvc3QsIGF0dHJTdGFydCwgYXR0ckVuZCk7CisgICAgICAgICAgcG9zdC5yZXF1aXJlID0gZGlyZWN0aXZlLnJlcXVpcmU7CisgICAgICAgICAgcG9zdC5kaXJlY3RpdmVOYW1lID0gZGlyZWN0aXZlTmFtZTsKKyAgICAgICAgICBpZiAobmV3SXNvbGF0ZVNjb3BlRGlyZWN0aXZlID09PSBkaXJlY3RpdmUgfHwgZGlyZWN0aXZlLiQkaXNvbGF0ZVNjb3BlKSB7CisgICAgICAgICAgICBwb3N0ID0gY2xvbmVBbmRBbm5vdGF0ZUZuKHBvc3QsIHtpc29sYXRlU2NvcGU6IHRydWV9KTsKKyAgICAgICAgICB9CisgICAgICAgICAgcG9zdExpbmtGbnMucHVzaChwb3N0KTsKKyAgICAgICAgfQorICAgICAgfQorCisKKyAgICAgIGZ1bmN0aW9uIGdldENvbnRyb2xsZXJzKGRpcmVjdGl2ZU5hbWUsIHJlcXVpcmUsICRlbGVtZW50LCBlbGVtZW50Q29udHJvbGxlcnMpIHsKKyAgICAgICAgdmFyIHZhbHVlLCByZXRyaWV2YWxNZXRob2QgPSAnZGF0YScsIG9wdGlvbmFsID0gZmFsc2U7CisgICAgICAgIGlmIChpc1N0cmluZyhyZXF1aXJlKSkgeworICAgICAgICAgIHdoaWxlKCh2YWx1ZSA9IHJlcXVpcmUuY2hhckF0KDApKSA9PSAnXicgfHwgdmFsdWUgPT0gJz8nKSB7CisgICAgICAgICAgICByZXF1aXJlID0gcmVxdWlyZS5zdWJzdHIoMSk7CisgICAgICAgICAgICBpZiAodmFsdWUgPT0gJ14nKSB7CisgICAgICAgICAgICAgIHJldHJpZXZhbE1ldGhvZCA9ICdpbmhlcml0ZWREYXRhJzsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIG9wdGlvbmFsID0gb3B0aW9uYWwgfHwgdmFsdWUgPT0gJz8nOworICAgICAgICAgIH0KKyAgICAgICAgICB2YWx1ZSA9IG51bGw7CisKKyAgICAgICAgICBpZiAoZWxlbWVudENvbnRyb2xsZXJzICYmIHJldHJpZXZhbE1ldGhvZCA9PT0gJ2RhdGEnKSB7CisgICAgICAgICAgICB2YWx1ZSA9IGVsZW1lbnRDb250cm9sbGVyc1tyZXF1aXJlXTsKKyAgICAgICAgICB9CisgICAgICAgICAgdmFsdWUgPSB2YWx1ZSB8fCAkZWxlbWVudFtyZXRyaWV2YWxNZXRob2RdKCckJyArIHJlcXVpcmUgKyAnQ29udHJvbGxlcicpOworCisgICAgICAgICAgaWYgKCF2YWx1ZSAmJiAhb3B0aW9uYWwpIHsKKyAgICAgICAgICAgIHRocm93ICRjb21waWxlTWluRXJyKCdjdHJlcScsCisgICAgICAgICAgICAgICAgIkNvbnRyb2xsZXIgJ3swfScsIHJlcXVpcmVkIGJ5IGRpcmVjdGl2ZSAnezF9JywgY2FuJ3QgYmUgZm91bmQhIiwKKyAgICAgICAgICAgICAgICByZXF1aXJlLCBkaXJlY3RpdmVOYW1lKTsKKyAgICAgICAgICB9CisgICAgICAgICAgcmV0dXJuIHZhbHVlOworICAgICAgICB9IGVsc2UgaWYgKGlzQXJyYXkocmVxdWlyZSkpIHsKKyAgICAgICAgICB2YWx1ZSA9IFtdOworICAgICAgICAgIGZvckVhY2gocmVxdWlyZSwgZnVuY3Rpb24ocmVxdWlyZSkgeworICAgICAgICAgICAgdmFsdWUucHVzaChnZXRDb250cm9sbGVycyhkaXJlY3RpdmVOYW1lLCByZXF1aXJlLCAkZWxlbWVudCwgZWxlbWVudENvbnRyb2xsZXJzKSk7CisgICAgICAgICAgfSk7CisgICAgICAgIH0KKyAgICAgICAgcmV0dXJuIHZhbHVlOwor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VtZW50LmRhdGEoJyRpc29sYXRlU2NvcGVOb1RlbXBsYXRlJywgaXNvbGF0ZVNjb3BlKTsKKyAgICAgICAgICB9CisKKworCisgICAgICAgICAgc2FmZUFkZENsYXNzKCRlbGVtZW50LCAnbmctaXNvbGF0ZS1zY29wZScpOworCisgICAgICAgICAgZm9yRWFjaChuZXdJc29sYXRlU2NvcGVEaXJlY3RpdmUuc2NvcGUsIGZ1bmN0aW9uKGRlZmluaXRpb24sIHNjb3BlTmFtZSkgeworICAgICAgICAgICAgdmFyIG1hdGNoID0gZGVmaW5pdGlvbi5tYXRjaChMT0NBTF9SRUdFWFApIHx8IFtdLAorICAgICAgICAgICAgICAgIGF0dHJOYW1lID0gbWF0Y2hbM10gfHwgc2NvcGVOYW1lLAorICAgICAgICAgICAgICAgIG9wdGlvbmFsID0gKG1hdGNoWzJdID09ICc/JyksCisgICAgICAgICAgICAgICAgbW9kZSA9IG1hdGNoWzFdLCAvLyBALCA9LCBvciAmCisgICAgICAgICAgICAgICAgbGFzdFZhbHVlLAorICAgICAgICAgICAgICAgIHBhcmVudEdldCwgcGFyZW50U2V0LCBjb21wYXJlOworCisgICAgICAgICAgICBpc29sYXRlU2NvcGUuJCRpc29sYXRlQmluZGluZ3Nbc2NvcGVOYW1lXSA9IG1vZGUgKyBhdHRyTmFtZTsKKworICAgICAgICAgICAgc3dpdGNoIChtb2RlKSB7CisKKyAgICAgICAgICAgICAgY2FzZSAnQCc6CisgICAgICAgICAgICAgICAgYXR0cnMuJG9ic2VydmUoYXR0ck5hbWUsIGZ1bmN0aW9uKHZhbHVlKSB7CisgICAgICAgICAgICAgICAgICBpc29sYXRlU2NvcGVbc2NvcGVOYW1lXSA9IHZhbHVlOworICAgICAgICAgICAgICAgIH0pOworICAgICAgICAgICAgICAgIGF0dHJzLiQkb2JzZXJ2ZXJzW2F0dHJOYW1lXS4kJHNjb3BlID0gc2NvcGU7CisgICAgICAgICAgICAgICAgaWYoIGF0dHJzW2F0dHJOYW1lXSApIHsKKyAgICAgICAgICAgICAgICAgIC8vIElmIHRoZSBhdHRyaWJ1dGUgaGFzIGJlZW4gcHJvdmlkZWQgdGhlbiB3ZSB0cmlnZ2VyIGFuIGludGVycG9sYXRpb24gdG8gZW5zdXJlCisgICAgICAgICAgICAgICAgICAvLyB0aGUgdmFsdWUgaXMgdGhlcmUgZm9yIHVzZSBpbiB0aGUgbGluayBmbgorICAgICAgICAgICAgICAgICAgaXNvbGF0ZVNjb3BlW3Njb3BlTmFtZV0gPSAkaW50ZXJwb2xhdGUoYXR0cnNbYXR0ck5hbWVdKShzY29wZSk7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIGJyZWFrOworCisgICAgICAgICAgICAgIGNhc2UgJz0nOgorICAgICAgICAgICAgICAgIGlmIChvcHRpb25hbCAmJiAhYXR0cnNbYXR0ck5hbWVdKSB7CisgICAgICAgICAgICAgICAgICByZXR1cm47CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIHBhcmVudEdldCA9ICRwYXJzZShhdHRyc1thdHRyTmFtZV0pOworICAgICAgICAgICAgICAgIGlmIChwYXJlbnRHZXQubGl0ZXJhbCkgeworICAgICAgICAgICAgICAgICAgY29tcGFyZSA9IGVxdWFsczsKKyAgICAgICAgICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgICAgICAgY29tcGFyZSA9IGZ1bmN0aW9uKGEsYikgeyByZXR1cm4gYSA9PT0gYiB8fCAoYSAhPT0gYSAmJiBiICE9PSBiKTsgfTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgcGFyZW50U2V0ID0gcGFyZW50R2V0LmFzc2lnbiB8fCBmdW5jdGlvbigpIHsKKyAgICAgICAgICAgICAgICAgIC8vIHJlc2V0IHRoZSBjaGFuZ2UsIG9yIHdlIHdpbGwgdGhyb3cgdGhpcyBleGNlcHRpb24gb24gZXZlcnkgJGRpZ2VzdAorICAgICAgICAgICAgICAgICAgbGFzdFZhbHVlID0gaXNvbGF0ZVNjb3BlW3Njb3BlTmFtZV0gPSBwYXJlbnRHZXQoc2NvcGUpOworICAgICAgICAgICAgICAgICAgdGhyb3cgJGNvbXBpbGVNaW5FcnIoJ25vbmFzc2lnbicsCisgICAgICAgICAgICAgICAgICAgICAgIkV4cHJlc3Npb24gJ3swfScgdXNlZCB3aXRoIGRpcmVjdGl2ZSAnezF9JyBpcyBub24tYXNzaWduYWJsZSEiLAorICAgICAgICAgICAgICAgICAgICAgIGF0dHJzW2F0dHJOYW1lXSwgbmV3SXNvbGF0ZVNjb3BlRGlyZWN0aXZlLm5hbWUpOworICAgICAgICAgICAgICAgIH07CisgICAgICAgICAgICAgICAgbGFzdFZhbHVlID0gaXNvbGF0ZVNjb3BlW3Njb3BlTmFtZV0gPSBwYXJlbnRHZXQoc2NvcGUpOworICAgICAgICAgICAgICAgIGlzb2xhdGVTY29wZS4kd2F0Y2goZnVuY3Rpb24gcGFyZW50VmFsdWVXYXRjaCgpIHsKKyAgICAgICAgICAgICAgICAgIHZhciBwYXJlbnRWYWx1ZSA9IHBhcmVudEdldChzY29wZSk7CisgICAgICAgICAgICAgICAgICBpZiAoIWNvbXBhcmUocGFyZW50VmFsdWUsIGlzb2xhdGVTY29wZVtzY29wZU5hbWVdKSkgeworICAgICAgICAgICAgICAgICAgICAvLyB3ZSBhcmUgb3V0IG9mIHN5bmMgYW5kIG5lZWQgdG8gY29weQorICAgICAgICAgICAgICAgICAgICBpZiAoIWNvbXBhcmUocGFyZW50VmFsdWUsIGxhc3RWYWx1ZSkpIHsKKyAgICAgICAgICAgICAgICAgICAgICAvLyBwYXJlbnQgY2hhbmdlZCBhbmQgaXQgaGFzIHByZWNlZGVuY2UKKyAgICAgICAgICAgICAgICAgICAgICBpc29sYXRlU2NvcGVbc2NvcGVOYW1lXSA9IHBhcmVudFZhbHVlOworICAgICAgICAgICAgICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgICAgICAgICAgIC8vIGlmIHRoZSBwYXJlbnQgY2FuIGJlIGFzc2lnbmVkIHRoZW4gZG8gc28KKyAgICAgICAgICAgICAgICAgICAgICBwYXJlbnRTZXQoc2NvcGUsIHBhcmVudFZhbHVlID0gaXNvbGF0ZVNjb3BlW3Njb3BlTmFtZV0pOworICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICByZXR1cm4gbGFzdFZhbHVlID0gcGFyZW50VmFsdWU7CisgICAgICAgICAgICAgICAgfSwgbnVsbCwgcGFyZW50R2V0LmxpdGVyYWwpOworICAgICAgICAgICAgICAgIGJyZWFrOworCisgICAgICAgICAgICAgIGNhc2UgJyYnOgorICAgICAgICAgICAgICAgIHBhcmVudEdldCA9ICRwYXJzZShhdHRyc1thdHRyTmFtZV0pOworICAgICAgICAgICAgICAgIGlzb2xhdGVTY29wZVtzY29wZU5hbWVdID0gZnVuY3Rpb24obG9jYWxzKSB7CisgICAgICAgICAgICAgICAgICByZXR1cm4gcGFyZW50R2V0KHNjb3BlLCBsb2NhbHMpOworICAgICAgICAgICAgICAgIH07CisgICAgICAgICAgICAgICAgYnJlYWs7CisKKyAgICAgICAgICAgICAgZGVmYXVsdDoKKyAgICAgICAgICAgICAgICB0aHJvdyAkY29tcGlsZU1pbkVycignaXNjcCcsCisgICAgICAgICAgICAgICAgICAgICJJbnZhbGlkIGlzb2xhdGUgc2NvcGUgZGVmaW5pdGlvbiBmb3IgZGlyZWN0aXZlICd7MH0nLiIgKworICAgICAgICAgICAgICAgICAgICAiIERlZmluaXRpb246IHsuLi4gezF9OiAnezJ9JyAuLi59IiwKKyAgICAgICAgICAgICAgICAgICAgbmV3SXNvbGF0ZVNjb3BlRGlyZWN0aXZlLm5hbWUsIHNjb3BlTmFtZSwgZGVmaW5pdGlvbik7CisgICAgICAgICAgICB9CisgICAgICAgICAgfSk7CisgICAgICAgIH0KKyAgICAgICAgdHJhbnNjbHVkZUZuID0gYm91bmRUcmFuc2NsdWRlRm4gJiYgY29udHJvbGxlcnNCb3VuZFRyYW5zY2x1ZGU7CisgICAgICAgIGlmIChjb250cm9sbGVyRGlyZWN0aXZlcykgeworICAgICAgICAgIGZvckVhY2goY29udHJvbGxlckRpcmVjdGl2ZXMsIGZ1bmN0aW9uKGRpcmVjdGl2ZSkgeworICAgICAgICAgICAgdmFyIGxvY2FscyA9IHsKKyAgICAgICAgICAgICAgJHNjb3BlOiBkaXJlY3RpdmUgPT09IG5ld0lzb2xhdGVTY29wZURpcmVjdGl2ZSB8fCBkaXJlY3RpdmUuJCRpc29sYXRlU2NvcGUgPyBpc29sYXRlU2NvcGUgOiBzY29wZSwKKyAgICAgICAgICAgICAgJGVsZW1lbnQ6ICRlbGVtZW50LAorICAgICAgICAgICAgICAkYXR0cnM6IGF0dHJzLAorICAgICAgICAgICAgICAkdHJhbnNjbHVkZTogdHJhbnNjbHVkZUZuCisgICAgICAgICAgICB9LCBjb250cm9sbGVySW5zdGFuY2U7CisKKyAgICAgICAgICAgIGNvbnRyb2xsZXIgPSBkaXJlY3RpdmUuY29udHJvbGxlcjsKKyAgICAgICAgICAgIGlmIChjb250cm9sbGVyID09ICdAJykgeworICAgICAgICAgICAgICBjb250cm9sbGVyID0gYXR0cnNbZGlyZWN0aXZlLm5hbWVdOworICAgICAgICAgICAgfQorCisgICAgICAgICAgICBjb250cm9sbGVySW5zdGFuY2UgPSAkY29udHJvbGxlcihjb250cm9sbGVyLCBsb2NhbHMpOworICAgICAgICAgICAgLy8gRm9yIGRpcmVjdGl2ZXMgd2l0aCBlbGVtZW50IHRyYW5zY2x1c2lvbiB0aGUgZWxlbWVudCBpcyBhIGNvbW1lbnQsCisgICAgICAgICAgICAvLyBidXQgalF1ZXJ5IC5kYXRhIGRvZXNuJ3Qgc3VwcG9ydCBhdHRhY2hpbmcgZGF0YSB0byBjb21tZW50IG5vZGVzIGFzIGl0J3MgaGFyZCB0bworICAgICAgICAgICAgLy8gY2xlYW4gdXAgKGh0dHA6Ly9idWdzLmpxdWVyeS5jb20vdGlja2V0LzgzMzUpLgorICAgICAgICAgICAgLy8gSW5zdGVhZCwgd2Ugc2F2ZSB0aGUgY29udHJvbGxlcnMgZm9yIHRoZSBlbGVtZW50IGluIGEgbG9jYWwgaGFzaCBhbmQgYXR0YWNoIHRvIC5kYXRhCisgICAgICAgICAgICAvLyBsYXRlciwgb25jZSB3ZSBoYXZlIHRoZSBhY3R1YWwgZWxlbWVudC4KKyAgICAgICAgICAgIGVsZW1lbnRDb250cm9sbGVyc1tkaXJlY3RpdmUubmFtZV0gPSBjb250cm9sbGVySW5zdGFuY2U7CisgICAgICAgICAgICBpZiAoIWhhc0VsZW1lbnRUcmFuc2NsdWRlRGlyZWN0aXZlKSB7CisgICAgICAgICAgICAgICRlbGVtZW50LmRhdGEoJyQnICsgZGlyZWN0aXZlLm5hbWUgKyAnQ29udHJvbGxlcicsIGNvbnRyb2xsZXJJbnN0YW5jZSk7CisgICAgICAgICAgICB9CisKKyAgICAgICAgICAgIGlmIChkaXJlY3RpdmUuY29udHJvbGxlckFzKSB7CisgICAgICAgICAgICAgIGxvY2Fscy4kc2NvcGVbZGlyZWN0aXZlLmNvbnRyb2xsZXJBc10gPSBjb250cm9sbGVySW5zdGFuY2U7CisgICAgICAgICAgICB9CisgICAgICAgICAgfSk7CisgICAgICAgIH0KKworICAgICAgICAvLyBQUkVMSU5LSU5HCisgICAgICAgIGZvcihpID0gMCwgaWkgPSBwcmVMaW5rRm5zLmxlbmd0aDsgaSA8IGlpOyBpKyspIHsKKyAgICAgICAgICB0cnkgeworICAgICAgICAgICAgbGlua0ZuID0gcHJlTGlua0Zuc1tpXTsKKyAgICAgICAgICAgIGxpbmtGbihsaW5rRm4uaXNvbGF0ZVNjb3BlID8gaXNvbGF0ZVNjb3BlIDogc2NvcGUsICRlbGVtZW50LCBhdHRycywKKyAgICAgICAgICAgICAgICBsaW5rRm4ucmVxdWlyZSAmJiBnZXRDb250cm9sbGVycyhsaW5rRm4uZGlyZWN0aXZlTmFtZSwgbGlua0ZuLnJlcX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ZVNjb3BlID8gaXNvbGF0ZVNjb3BlIDogc2NvcGUsICRlbGVtZW50LCBhdHRycywKKyAgICAgICAgICAgICAgICBsaW5rRm4ucmVxdWlyZSAmJiBnZXRDb250cm9sbGVycyhsaW5rRm4uZGlyZWN0aXZlTmFtZSwgbGlua0ZuLnJlcXVpcmUsICRlbGVtZW50LCBlbGVtZW50Q29udHJvbGxlcnMpLCB0cmFuc2NsdWRlRm4pOworICAgICAgICAgIH0gY2F0Y2ggKGUpIHsKKyAgICAgICAgICAgICRleGNlcHRpb25IYW5kbGVyKGUsIHN0YXJ0aW5nVGFnKCRlbGVtZW50KSk7CisgICAgICAgICAgfQorICAgICAgICB9CisKKyAgICAgICAgLy8gVGhpcyBpcyB0aGUgZnVuY3Rpb24gdGhhdCBpcyBpbmplY3RlZCBhcyBgJHRyYW5zY2x1ZGVgLgorICAgICAgICBmdW5jdGlvbiBjb250cm9sbGVyc0JvdW5kVHJhbnNjbHVkZShzY29wZSwgY2xvbmVBdHRhY2hGbikgeworICAgICAgICAgIHZhciB0cmFuc2NsdWRlQ29udHJvbGxlcnM7CisKKyAgICAgICAgICAvLyBubyBzY29wZSBwYXNzZWQKKyAgICAgICAgICBpZiAoYXJndW1lbnRzLmxlbmd0aCA8IDIpIHsKKyAgICAgICAgICAgIGNsb25lQXR0YWNoRm4gPSBzY29wZTsKKyAgICAgICAgICAgIHNjb3BlID0gdW5kZWZpbmVkOworICAgICAgICAgIH0KKworICAgICAgICAgIGlmIChoYXNFbGVtZW50VHJhbnNjbHVkZURpcmVjdGl2ZSkgeworICAgICAgICAgICAgdHJhbnNjbHVkZUNvbnRyb2xsZXJzID0gZWxlbWVudENvbnRyb2xsZXJzOworICAgICAgICAgIH0KKworICAgICAgICAgIHJldHVybiBib3VuZFRyYW5zY2x1ZGVGbihzY29wZSwgY2xvbmVBdHRhY2hGbiwgdHJhbnNjbHVkZUNvbnRyb2xsZXJzKTsKKyAgICAgICAgfQorICAgICAgfQorICAgIH0KKworICAgIG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Y2F0aW9uLCBtYXhQcmlvcml0eSwgaWdub3JlRGlyZWN0aXZlLCBzdGFydEF0dHJOYW1lLAorICAgICAgICAgICAgICAgICAgICAgICAgICBlbmRBdHRyTmFtZSkgeworICAgICAgaWYgKG5hbWUgPT09IGlnbm9yZURpcmVjdGl2ZSkgcmV0dXJuIG51bGw7CisgICAgICB2YXIgbWF0Y2ggPSBudWxsOworICAgICAgaWYgKGhhc0RpcmVjdGl2ZXMuaGFzT3duUHJvcGVydHkobmFtZSkpIHsKKyAgICAgICAgZm9yKHZhciBkaXJlY3RpdmUsIGRpcmVjdGl2ZXMgPSAkaW5qZWN0b3IuZ2V0KG5hbWUgKyBTdWZmaXgpLAorICAgICAgICAgICAgaSA9IDAsIGlpID0gZGlyZWN0aXZlcy5sZW5ndGg7IGk8aWk7IGkrKykgeworICAgICAgICAgIHRyeSB7CisgICAgICAgICAgICBkaXJlY3RpdmUgPSBkaXJlY3RpdmVzW2ldOworICAgICAgICAgICAgaWYgKCAobWF4UHJpb3JpdHkgPT09IHVuZGVmaW5lZCB8fCBtYXhQcmlvcml0eSA+IGRpcmVjdGl2ZS5wcmlvcml0eSkgJiYKKyAgICAgICAgICAgICAgICAgZGlyZWN0aXZlLnJlc3RyaWN0LmluZGV4T2YobG9jYXRpb24pICE9IC0xKSB7CisgICAgICAgICAgICAgIGlmIChzdGFydEF0dHJOYW1lKSB7CisgICAgICAgICAgICAgICAgZGlyZWN0aXZlID0gaW5oZXJpdChkaXJlY3RpdmUsIHskJHN0YXJ0OiBzdGFydEF0dHJOYW1lLCAkJGVuZDogZW5kQXR0ck5hbWV9KTsKKyAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICB0RGlyZWN0aXZlcy5wdXNoKGRpcmVjdGl2ZSk7CisgICAgICAgICAgICAgIG1hdGNoID0gZGlyZWN0aXZlOworICAgICAgICAgICAgfQorICAgICAgICAgIH0gY2F0Y2goZSkgeyAkZXhjZXB0aW9uSGFuZGxlcihlKTsgfQorICAgICAgICB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NyY1trZXldOworICAgICAgICAgIH0KKyAgICAgICAgICBkc3QuJHNldChrZXksIHZhbHVlLCB0cnVlLCBzcmNBdHRyW2tleV0pOworICAgICAgICB9CisgICAgICB9KTsKKworICAgICAgLy8gY29weSB0aGUgbmV3IGF0dHJpYnV0ZXMgb24gdGhlIG9sZCBhdHRycyBvYmplY3QKKyAgICAgIGZvckVhY2goc3JjLCBmdW5jdGlvbih2YWx1ZSwga2V5KSB7CisgICAgICAgIGlmIChrZXkgPT0gJ2NsYXNzJykgeworICAgICAgICAgIHNhZmVBZGRDbGFzcygkZWxlbWVudCwgdmFsdWUpOworICAgICAgICAgIGRzdFsnY2xhc3MnXSA9IChkc3RbJ2NsYXNzJ10gPyBkc3RbJ2NsYXNzJ10gKyAnICcgOiAnJykgKyB2YWx1ZTsKKyAgICAgICAgfSBlbHNlIGlmIChrZXkgPT0gJ3N0eWxlJykgeworICAgICAgICAgICRlbGVtZW50LmF0dHIoJ3N0eWxlJywgJGVsZW1lbnQuYXR0cignc3R5bGUnKSArICc7JyArIHZhbHVlKTsKKyAgICAgICAgICBkc3RbJ3N0eWxlJ10gPSAoZHN0WydzdHlsZSddID8gZHN0WydzdHlsZSddICsgJzsnIDogJycpICsgdmFsdWU7CisgICAgICAgICAgLy8gYGRzdGAgd2lsbCBuZXZlciBjb250YWluIGhhc093blByb3BlcnR5IGFzIERPTSBwYXJzZXIgd29uJ3QgbGV0IGl0LgorICAgICAgICAgIC8vIFlvdSB3aWxsIGdldCBhbiAiSW52YWxpZENoYXJhY3RlckVycm9yOiBET00gRXhjZXB0aW9uIDUiIGVycm9yIGlmIHlvdQorICAgICAgICAgIC8vIGhhdmUgYW4gYXR0cmlidXRlIGxpa2UgImhhcy1vd24tcHJvcGVydHkiIG9yICJkYXRhLWhhcy1vd24tcHJvcGVydHkiLCBldGMuCisgICAgICAgIH0gZWxzZSBpZiAoa2V5LmNoYXJBdCgwKSAhPSAnJCcgJiYgIWRzdC5oYXNPd25Qcm9wZXJ0e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gICAgICAgdmFyIGludGVycG9sYXRlRm4gPSAkaW50ZXJwb2xhdGUodGV4dCwgdHJ1ZSk7CisgICAgICAgIGlmIChpbnRlcnBvbGF0ZUZuKSB7CisgICAgICAgICAgZGlyZWN0aXZlcy5wdXNoKHsKKyAgICAgICAgICAgIHByaW9yaXR5OiAwLAorICAgICAgICAgICAgY29tcGlsZTogZnVuY3Rpb24gdGV4dEludGVycG9sYXRlQ29tcGlsZUZuKHRlbXBsYXRlTm9kZSkgeworICAgICAgICAgICAgICAvLyB3aGVuIHRyYW5zY2x1ZGluZyBhIHRlbXBsYXRlIHRoYXQgaGFzIGJpbmRpbmdzIGluIHRoZSByb290CisgICAgICAgICAgICAgIC8vIHRoZW4gd2UgZG9uJ3QgaGF2ZSBhIHBhcmVudCBhbmQgc2hvdWxkIGRvIHRoaXMgaW4gdGhlIGxpbmtGbgorICAgICAgICAgICAgICB2YXIgcGFyZW50ID0gdGVtcGxhdGVOb2RlLnBhcmVudCgpLCBoYXNDb21waWxlUGFyZW50ID0gcGFyZW50Lmxlbmd0aDsKKyAgICAgICAgICAgICAgaWYgKGhhc0NvbXBpbGVQYXJlbnQpIHNhZmVBZGRDbGFzcyh0ZW1wbGF0ZU5vZGUucGFyZW50KCksICduZy1iaW5kaW5nJyk7CisKKyAgICAgICAgICAgICAgcmV0dXJuIGZ1bmN0aW9uIHRleHRJbnRlcnBvbGF0ZUxpbmtGbihzY29wZSwgbm9kZSkgeworICAgICAgICAgICAgICAgIHZhciBwYXJlbnQgPSBub2RlLnBhcmVudCgpLAorICAgICAgICAgICAgICAgICAgYmluZGluZ3MgPSBwYXJlbnQuZGF0YSgnJGJpbmRpbmcnKSB8fCBbXTsKKyAgICAgICAgICAgICAgICBiaW5kaW5ncy5wdXNoKGludGVycG9sYXRlRm4pOworICAgICAgICAgICAgICAgIHBhcmVudC5kYXRhKCckYmluZGluZycsIGJpbmRpbmdzKTsKKyAgICAgICAgICAgICAgICBpZiAoIWhhc0NvbXBpbGVQYXJlbnQpIHNhZmVBZGRDbGFzcyhwYXJlbnQsICduZy1iaW5kaW5nJyk7CisgICAgICAgICAgICAgICAgc2NvcGUuJHdhdGNoKGludGVycG9sYXRlRm4sIGZ1bmN0aW9uIGludGVycG9sYXRlRm5XYXRjaEFjdGlvbih2YWx1ZSkgeworICAgICAgICAgICAgICAgICAgbm9kZVswXS5ub2RlVmFsdWUgPSB2YWx1ZTsKKyAgICAgICAgICAgICAgICB9KTsKKyAgICAgICAgICAgICAgfTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICB9KTsKKyAgICAgICAgfQorICAgICAgfQorCisKKyAgICBmdW5jdGlvbiBnZXRUcnVzdGVkQ29udGV4dChub2RlLCBhdHRyTm9ybWFsaXplZE5hbWUpIHsKKyAgICAgIGlmIChhdHRyTm9ybWFsaXplZE5hbWUgPT0gInNyY2RvYyIpIHsKKyAgICAgICAgcmV0dXJuICRzY2UuSFRNTDsKKyAgICAgIH0KKyAgICAgIHZhciB0YWcgPSBub2RlTmFtZV8obm9kZSk7CisgICAgICAvLyBtYWN0aW9uW3hsaW5rOmhyZWZdIGNhbiBzb3VyY2UgU1ZHLiAgSXQncyBub3QgbGltaXRlZCB0byA8bWFjdGlvbj4uCisgICAgICBpZiAoYXR0ck5vcm1hbGl6ZWROYW1lID09ICJ4bGlua0hyZWYiIHx8CisgICAgICAgICAgKHRhZyA9PSAiRk9STSIgJiYgYXR0ck5vcm1hbGl6ZWROYW1lID09ICJhY3Rpb24iKSB8fAorICAgICAgICAgICh0YWcgIT0gIklNRyIgJiYgKGF0dHJOb3JtYWxpemVkTmFtZSA9PSAic3JjIiB8fAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIGF0dHJOb3JtYWxpemVkTmFtZSA9PSAibmdTcmMiKSkpIHsKKyAgICAgICAgcmV0dXJuICRzY2UuUkVTT1VSQ0VfVVJMOworICAgICAgfQorICAgIH0KKworCisgICAgZnVuY3Rpb24gYWRkQXR0ckludGVycG9sYXRlRGlyZWN0aXZlKG5vZGUsIGRpcmVjdGl2ZXMsIHZhbHVlLCBuYW1lKSB7CisgICAgICB2YXIgaW50ZXJwb2xhdGVGbiA9ICRpbnRlcnBvbGF0ZSh2YWx1ZSwgdHJ1ZSk7CisKKyAgICAgIC8vIG5vIGludGVycG9sYXRpb24gZm91bmQgLT4gaWdub3JlCisgICAgICBpZiAoIWludGVycG9sYXRlRm4pIHJldHVybjsKKworCisgICAgICBpZiAobmFtZSA9PT0gIm11bHRpcGxlIiAmJiBub2RlTmFtZV8obm9kZSkgPT09ICJTRUxFQ1QiKSB7CisgICAgICAgIHRocm93ICRjb21waWxlTWluRXJyKCJzZWxtdWx0aSIsCisgICAgICAgICAgICAiQmluZGluZyB0byB0aGUgJ211bHRpcGxlJyBhdHRyaWJ1dGUgaXMgbm90IHN1cHBvcnRlZC4gRWxlbWVudDogezB9IiwKKyAgICAgICAgICAgIHN0YXJ0aW5nVGFnKG5vZGUpKTsKKyAgICAgIH0KKworICAgICAgZGlyZWN0aXZlcy5wdXNoKHsKKyAgICAgICAgcHJpb3JpdHk6IDEwMCwKKyAgICAgICAgY29tcGlsZTogZnVuY3Rpb24oKSB7CisgICAgICAgICAgICByZXR1cm4geworICAgICAgICAgICAgICBwcmU6IGZ1bmN0aW9uIGF0dHJJbnRlcnBvbGF0ZVByZUxpbmtGbihzY29wZSwgZWxlbWVudCwgYXR0cikgeworICAgICAgICAgICAgICAgIHZhciAkJG9ic2VydmVycyA9IChhdHRyLiQkb2JzZXJ2ZXJzIHx8IChhdHRyLiQkb2JzZXJ2ZXJzID0ge30pKTsKKworICAgICAgICAgICAgICAgIGlmIChFVkVOVF9IQU5ETEVSX0FUVFJfUkVHRVhQLnRlc3QobmFtZSkpIHsKKyAgICAgICAgICAgICAgICAgIHRocm93ICRjb21waWxlTWluRXJyKCdub2RvbWV2ZW50cycsCisgICAgICAgICAgICAgICAgICAgICAgIkludGVycG9sYXRpb25zIGZvciBIVE1MIERPTSBldmVudCBhdHRyaWJ1dGVzIGFyZSBkaXNhbGxvd2VkLiAgUGxlYXNlIHVzZSB0aGUgIiArCisgICAgICAgICAgICAgICAgICAgICAgICAgICJuZy0gdmVyc2lvbnMgKHN1Y2ggYXMgbmctY2xpY2sgaW5zdGVhZCBvZiBvbmNsaWNrKSBpbnN0ZWFkLiIpOworICAgICAgICAgICAgICAgIH0KKworICAgICAgICAgICAgICAgIC8vIHdlIG5lZWQgdG8gaW50ZXJwb2xhdGUgYWdhaW4sIGluIGNhc2UgdGhlIGF0dHJpYnV0ZSB2YWx1ZSBoYXMgYmVlbiB1cGRhdGVkCisgICAgICAgICAgICAgICAgLy8gKGUuZy4gYnkgYW5vdGhlciBkaXJlY3RpdmUncyBjb21waWxlIGZ1bmN0aW9uKQorICAgICAgICAgICAgICAgIGludGVycG9sYXRlRm4gPSAkaW50ZXJwb2xhdGUoYXR0cltuYW1lXSwgdHJ1ZSwgZ2V0VHJ1c3RlZENvbnRleHQobm9kZSwgbmFtZSkpOworCisgICAgICAgICAgICAgICAgLy8gaWYgYXR0cmlidXRlIHdhcyB1cGRhdGVkIHNvIHRoYXQgdGhlcmUgaXMgbm8gaW50ZXJwb2xhdGlvbiBnb2luZyBvbiB3ZSBkb24ndCB3YW50IHRvCisgICAgICAgICAgICAgICAgLy8gcmVnaXN0ZXIgYW55IG9ic2VydmVycworICAgICAgICAgICAgICAgIGlmICghaW50ZXJwb2xhdGVGbikgcmV0dXJuOworCisgICAgICAgICAgICAgICAgLy8gVE9ETyhpKTogdGhpcyBzaG91bGQgbGlrZWx5IGJlIGF0dHIuJHNldChuYW1lLCBpdGVycG9sYXRlRm4oc2NvcGUpIHNvIHRoYXQgd2UgcmVzZXQgdGhlCisgICAgICAgICAgICAgICAgLy8gYWN0dWFsIGF0dHIgdmFsdWUKKyAgICAgICAgICAgICAgICBhdHRyW25hbWVdID0gaW50ZXJwb2xhdGVGbihzY29wZSk7CisgICAgICAgICAgICAgICAgKCQkb2JzZXJ2ZXJzW25hbWVdIHx8ICgkJG9ic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HNldChuYW1lLCBuZXdWYWx1ZSk7CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgIH0pOworICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9OworICAgICAgICAgIH0KKyAgICAgIH0pOworICAgIH0KKworCisgICAgLyoqCisgICAgICogVGhpcyBpcyBhIHNwZWNpYWwganFMaXRlLnJlcGxhY2VXaXRoLCB3aGljaCBjYW4gcmVwbGFjZSBpdGVtcyB3aGljaAorICAgICAqIGhhdmUgbm8gcGFyZW50cywgcHJvdmlkZWQgdGhhdCB0aGUgY29udGFpbmluZyBqcUxpdGUgY29sbGVjdGlvbiBpcyBwcm92aWRlZC4KKyAgICAgKgorICAgICAqIEBwYXJhbSB7SnFMaXRlPX0gJHJvb3RFbGVtZW50IFRoZSByb290IG9mIHRoZSBjb21waWxlIHRyZWUuIFVzZWQgc28gdGhhdCB3ZSBjYW4gcmVwbGFjZSBub2RlcworICAgICAqICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGluIHRoZSByb290IG9mIHRoZSB0cmVlLgorICAgICAqIEBwYXJhbSB7SnFMaXRlfSBlbGVtZW50c1RvUmVtb3ZlIFRoZSBqcUxpdGUgZWxlbWVudCB3aGljaCB3ZSBhcmUgZ29pbmcgdG8gcmVwbGFjZS4gV2Uga2VlcAorICAgICAqICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRoZSBzaGVsbCwgYnV0IHJlcGxhY2UgaXRzIERPTSBub2RlIHJlZmVyZW5jZS4KKyAgICAgKiBAcGFyYW0ge05vZGV9IG5ld05vZGUgVGhlIG5ldyBET00gbm9kZS4KKyAgICAgKi8KKyAgICBmdW5jdGlvbiByZXBsYWNlV2l0aCgkcm9vdEVsZW1lbnQsIGVsZW1lbnRzVG9SZW1vdmUsIG5ld05vZGUpIHsKKyAgICAgIHZhciBmaXJzdEVsZW1lbnRUb1JlbW92ZSA9IGVsZW1lbnRzVG9SZW1vdmVbMF0sCisgICAgICAgICAgcmVtb3ZlQ291bnQgPSBlbGVtZW50c1RvUmVtb3ZlLmxlbmd0aCwKKyAgICAgICAgICBwYXJlbnQgPSBmaXJzdEVsZW1lbnRUb1JlbW92ZS5wYXJlbnROb2RlLAorICAgICAgICAgIGksIGlpOworCisgICAgICBpZiAoJHJvb3RFbGVtZW50KSB7CisgICAgICAgIGZvcihpID0gMCwgaWkgPSAkcm9vdEVsZW1lbnQubGVuZ3RoOyBpIDwgaWk7IGkrKykgeworICAgICAgICAgIGlmICgkcm9vdEVsZW1lbnRbaV0gPT0gZmlyc3RFbGVtZW50VG9SZW1vdmUpIHsKKyAgICAgICAgICAgICRyb290RWxlbWVudFtpKytdID0gbmV3Tm9kZTsKKyAgICAgICAgICAgIGZvciAodmFyIGogPSBpLCBqMiA9IGogKyByZW1vdmVDb3VudCAtIDEsCisgICAgICAgICAgICAgICAgICAgICBqaiA9ICRyb290RWxlbWVudC5sZW5ndGg7CisgICAgICAgICAgICAgICAgIGogPCBqajsgaisrLCBqMisrKSB7CisgICAgICAgICAgICAgIGlmIChqMiA8IGpqKSB7CisgICAgICAgICAgICAgICAgJHJvb3RFbGVtZW50W2pdID0gJHJvb3RFbGVtZW50W2oyXTsKKyAgICAgICAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgICAgICBkZWxldGUgJHJvb3RFbGVtZW50W2pdOworICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9CisgICAgICAgICAgICAkcm9vdEVsZW1lbnQubGVuZ3RoIC09IHJlbW92ZUNvdW50IC0gMTsKKyAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgIH0KKyAgICAgICAgfQorICAgICAgfQorCisgICAgICBpZiAocGFyZW50KSB7CisgICAgICAgIHBhcmVudC5yZXBsYWNlQ2hpbGQobmV3Tm9kZSwgZmlyc3RFbGVtZW50VG9SZW1vdmUpOworICAgICAgfQorICAgICAgdmFyIGZyYWdtZW50ID0gZG9jdW1lbnQuY3JlYXRlRG9jdW1lbnRGcmFnbWVudCgp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mVxdWVzdCc6IGZ1bmN0aW9uKGNvbmZpZykgeworICAgICAqICAgICAgICAgLy8gZG8gc29tZXRoaW5nIG9uIHN1Y2Nlc3MKKyAgICAgKiAgICAgICAgIHJldHVybiBjb25maWc7CisgICAgICogICAgICAgfSwKKyAgICAgKgorICAgICAqICAgICAgIC8vIG9wdGlvbmFsIG1ldGhvZAorICAgICAqICAgICAgJ3JlcXVlc3RFcnJvcic6IGZ1bmN0aW9uKHJlamVjdGlvbikgeworICAgICAqICAgICAgICAgLy8gZG8gc29tZXRoaW5nIG9uIGVycm9yCisgICAgICogICAgICAgICBpZiAoY2FuUmVjb3ZlcihyZWplY3Rpb24pKSB7CisgICAgICogICAgICAgICAgIHJldHVybiByZXNwb25zZU9yTmV3UHJvbWlzZQorICAgICAqICAgICAgICAgfQorICAgICAqICAgICAgICAgcmV0dXJuICRxLnJlamVjdChyZWplY3Rpb24pOworICAgICAqICAgICAgIH0sCisgICAgICoKKyAgICAgKgorICAgICAqCisgICAgICogICAgICAgLy8gb3B0aW9uYWwgbWV0aG9kCisgICAgICogICAgICAgJ3Jlc3BvbnNlJzogZnVuY3Rpb24ocmVzcG9uc2UpIHsKKyAgICAgKiAgICAgICAgIC8vIGRvIHNvbWV0aGluZyBvbiBzdWNjZXNzCisgICAgICogICAgICAgICByZXR1cm4gcmVzcG9uc2U7CisgICAgICogICAgICAgfSwKKyAgICAgKgorICAgICAqICAgICAgIC8vIG9wdGlvbmFsIG1ldGhvZAorICAgICAqICAgICAgJ3Jlc3BvbnNlRXJyb3InOiBmdW5jdGlvbihyZWplY3Rpb24pIHsKKyAgICAgKiAgICAgICAgIC8vIGRvIHNvbWV0aGluZyBvbiBlcnJvcgorICAgICAqICAgICAgICAgaWYgKGNhblJlY292ZXIocmVqZWN0aW9uKSkgeworICAgICAqICAgICAgICAgICByZXR1cm4gcmVzcG9uc2VPck5ld1Byb21pc2UKKyAgICAgKiAgICAgICAgIH0KKyAgICAgKiAgICAgICAgIHJldHVybiAkcS5yZWplY3QocmVqZWN0aW9uKTsKKyAgICAgKiAgICAgICB9CisgICAgICogICAgIH07CisgICAgICogICB9KTsKKyAgICAgKgorICAgICAqICAgJGh0dHBQcm92aWRlci5pbnRlcmNlcHRvcnMucHVzaCgnbXlIdHRwSW50ZXJjZXB0b3InKTsKKyAgICAgKgorICAgICAqCisgICAgICogICAvLyBhbHRlcm5hdGl2ZWx5LCByZWdpc3RlciB0aGUgaW50ZXJjZXB0b3IgdmlhIGFuIGFub255bW91cyBmYWN0b3J5CisgICAgICogICAkaHR0cFByb3ZpZGVyLmludGVyY2VwdG9ycy5wdXNoKGZ1bmN0aW9uKCRxLCBkZXBlbmRlbmN5MSwgZGVwZW5kZW5jeTIpIHsKKyAgICAgKiAgICAgcmV0dXJuIHsKKyAgICAgKiAgICAgICdyZXF1ZXN0JzogZnVuY3Rpb24oY29uZmlnKSB7CisgICAgICogICAgICAgICAgLy8gc2FtZSBhcyBhYm92ZQorICAgICAqICAgICAgIH0sCisgICAgICoKKyAgICAgKiAgICAgICAncmVzcG9uc2UnOiBmdW5jdGlvbihyZXNwb25zZSkgeworICAgICAqICAgICAgICAgIC8vIHNhbWUgYXMgYWJvdmUKKyAgICAgKiAgICAgICB9CisgICAgICogICAgIH07CisgICAgICogICB9KTsKKyAgICAgKiBgYGAKKyAgICAgKgorICAgICAqICMgUmVzcG9uc2UgaW50ZXJjZXB0b3JzIChERVBSRUNBVEVEKQorICAgICAqCisgICAgICogQmVmb3JlIHlvdSBzdGFydCBjcmVhdGluZyBpbnRlcmNlcHRvcnMsIGJlIHN1cmUgdG8gdW5kZXJzdGFuZCB0aGUKKyAgICAgKiB7QGxpbmsgbmcuJHEgJHEgYW5kIGRlZmVycmVkL3Byb21pc2UgQVBJc30uCisgICAgICoKKyAgICAgKiBGb3IgcHVycG9zZXMgb2YgZ2xvYmFsIGVycm9yIGhhbmRsaW5nLCBhdXRoZW50aWNhdGlvbiBvciBhbnkga2luZCBvZiBzeW5jaHJvbm91cyBvcg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pY2UKKyAgICAgKiAgICRwcm92aWRlLmZhY3RvcnkoJ215SHR0cEludGVyY2VwdG9yJywgZnVuY3Rpb24oJHEsIGRlcGVuZGVuY3kxLCBkZXBlbmRlbmN5MikgeworICAgICAqICAgICByZXR1cm4gZnVuY3Rpb24ocHJvbWlzZSkgeworICAgICAqICAgICAgIHJldHVybiBwcm9taXNlLnRoZW4oZnVuY3Rpb24ocmVzcG9uc2UpIHsKKyAgICAgKiAgICAgICAgIC8vIGRvIHNvbWV0aGluZyBvbiBzdWNjZXNzCisgICAgICogICAgICAgICByZXR1cm4gcmVzcG9uc2U7CisgICAgICogICAgICAgfSwgZnVuY3Rpb24ocmVzcG9uc2UpIHsKKyAgICAgKiAgICAgICAgIC8vIGRvIHNvbWV0aGluZyBvbiBlcnJvcgorICAgICAqICAgICAgICAgaWYgKGNhblJlY292ZXIocmVzcG9uc2UpKSB7CisgICAgICogICAgICAgICAgIHJldHVybiByZXNwb25zZU9yTmV3UHJvbWlzZQorICAgICAqICAgICAgICAgfQorICAgICAqICAgICAgICAgcmV0dXJuICRxLnJlamVjdChyZXNwb25zZSk7CisgICAgICogICAgICAgfSk7CisgICAgICogICAgIH0KKyAgICAgKiAgIH0pOworICAgICAqCisgICAgICogICAkaHR0cFByb3ZpZGVyLnJlc3BvbnNlSW50ZXJjZXB0b3JzLnB1c2goJ215SHR0cEludGVyY2VwdG9yJyk7CisgICAgICoKKyAgICAgKgorICAgICAqICAgLy8gcmVnaXN0ZXIgdGhlIGludGVyY2VwdG9yIHZpYSBhbiBhbm9ueW1vdXMgZmFjdG9yeQorICAgICAqICAgJGh0dHBQcm92aWRlci5yZXNwb25zZUludGVyY2VwdG9ycy5wdXNoKGZ1bmN0aW9uKCRxLCBkZXBlbmRlbmN5MSwgZGVwZW5kZW5jeTIpIHsKKyAgICAgKiAgICAgcmV0dXJuIGZ1bmN0aW9uKHByb21pc2UpIHsKKyAgICAgKiAgICAgICAvLyBzYW1lIGFzIGFib3ZlCisgICAgICogIC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naHR0cC1oZWxsby5odG1sJzsKKworICAgICAgICAkc2NvcGUuZmV0Y2ggPSBmdW5jdGlvbigpIHsKKyAgICAgICAgICAkc2NvcGUuY29kZSA9IG51bGw7CisgICAgICAgICAgJHNjb3BlLnJlc3BvbnNlID0gbnVsbDsKKworICAgICAgICAgICRodHRwKHttZXRob2Q6ICRzY29wZS5tZXRob2QsIHVybDogJHNjb3BlLnVybCwgY2FjaGU6ICR0ZW1wbGF0ZUNhY2hlfSkuCisgICAgICAgICAgICBzdWNjZXNzKGZ1bmN0aW9uKGRhdGEsIHN0YXR1cykgeworICAgICAgICAgICAgICAkc2NvcGUuc3RhdHVzID0gc3RhdHVzOworICAgICAgICAgICAgICAkc2NvcGUuZGF0YSA9IGRhdGE7CisgICAgICAgICAgICB9KS4KKyAgICAgICAgICAgIGVycm9yKGZ1bmN0aW9uKGRhdGEsIHN0YXR1cykgeworICAgICAgICAgICAgICAkc2NvcGUuZGF0YSA9IGRhdGEgfHwgIlJlcXVlc3QgZmFpbGVkIjsKKyAgICAgICAgICAgICAgJHNjb3BlLnN0YXR1cyA9IHN0YXR1czsKKyAgICAgICAgICB9KTsKKyAgICAgICAgfTsKKworICAgICAgICAkc2NvcGUudXBkYXRlTW9kZWwgPSBmdW5jdGlvbihtZXRob2QsIHVybCkgeworICAgICAgICAgICRzY29wZS5tZXRob2QgPSBtZXRob2Q7CisgICAgICAgICAgJHNjb3BlLnVybCA9IHVybDsKKyAgICAgICAgfTsKKyAgICAgIH1dKTsKKzwvZmlsZT4KKzxmaWxlIG5hbWU9Imh0dHAtaGVsbG8uaHRtbCI+CisgIEhlbGxvLCAkaHR0cCEKKzwvZmlsZT4KKzxmaWxlIG5hbWU9InByb3RyYWN0b3IuanMiIHR5cGU9InByb3RyYWN0b3IiPgorICB2YXIgc3RhdHVzID0gZWxlbWVudChieS5iaW5kaW5nKCdzdGF0dXMnKSk7CisgIHZhciBkYXRhID0gZWxlbWVudChieS5iaW5kaW5nKCdkYXRhJykpOwor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pZiAobG93ZXJjYXNlKGhlYWRlcikgPT09ICdjb250ZW50LXR5cGUnKSB7CisgICAgICAgICAgICAgICAgZGVsZXRlIGhlYWRlcnNbaGVhZGVyXTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICB9KTsKKyAgICAgICAgfQorCisgICAgICAgIGlmIChpc1VuZGVmaW5lZChjb25maWcud2l0aENyZWRlbnRpYWxzKSAmJiAhaXNVbmRlZmluZWQoZGVmYXVsdHMud2l0aENyZWRlbnRpYWxzKSkgeworICAgICAgICAgIGNvbmZpZy53aXRoQ3JlZGVudGlhbHMgPSBkZWZhdWx0cy53aXRoQ3JlZGVudGlhbHM7CisgICAgICAgIH0KKworICAgICAgICAvLyBzZW5kIHJlcXVlc3QKKyAgICAgICAgcmV0dXJuIHNlbmRSZXEoY29uZmlnLCByZXFEYXRhLCBoZWFkZXJzKS50aGVuKHRyYW5zZm9ybVJlc3BvbnNlLCB0cmFuc2Zvcm1SZXNwb25zZSk7CisgICAgICB9OworCisgICAgICB2YXIgY2hhaW4gPSBbc2VydmVyUmVxdWVzdCwgdW5kZWZpbmVkXTsKKyAgICAgIHZhciBwcm9taXNlID0gJHEud2hlbihjb25maWcpOworCisgICAgICAvLyBhcHBseSBpbnRlcmNlcHRvcnMKKyAgICAgIGZvckVhY2gocmV2ZXJzZWRJbnRlcmNlcHRvcnMsIGZ1bmN0aW9uKGludGVyY2VwdG9yKSB7CisgICAgICAgIGlmIChpbnRlcmNlcHRvci5yZXF1ZXN0IHx8IGludGVyY2VwdG9yLnJlcXVlc3RFcnJvcikgeworICAgICAgICAgIGNoYWluLnVuc2hpZnQoaW50ZXJjZXB0b3IucmVxdWVzdCwgaW50ZXJjZXB0b3IucmVxdWVzdEVycm9yKTsKKyAgICAgICAgfQorICAgICAgICBpZiAoaW50ZXJjZXB0b3IucmVzcG9uc2UgfHwgaW50ZXJjZXB0b3IucmVzcG9uc2VFcnJvcikgeworICAgICAgICAgIGNoYWluLnB1c2goaW50ZXJjZXB0b3IucmVzcG9uc2UsIGludGVyY2VwdG9yLnJlc3BvbnNlRXJyb3IpOworICAgICAgICB9CisgICAgICB9KTsKKworICAgICAgd2hpbGUoY2hhaW4ubGVuZ3RoKSB7CisgICAgICAgIHZhciB0aGVuRm4gPSBjaGFpbi5zaGlmdCgpOworICAgICAgICB2YXIgcmVqZWN0Rm4gPSBjaGFpbi5zaGlmdCgpOworCisgICAgICAgIHByb21pc2UgPSBwcm9taXNlLnRoZW4odGhlbkZuLCByZWplY3RGbik7CisgICAgICB9CisKKyAgICAgIHByb21pc2Uuc3VjY2VzcyA9IGZ1bmN0aW9uKGZuKSB7CisgICAgICAgIHByb21pc2UudGhlbihmdW5jdGlvbihyZXNwb25zZSkgeworICAgICAgICAgIGZuKHJlc3BvbnNlLmRhdGEsIHJlc3BvbnNlLnN0YXR1cywgcmVzcG9uc2UuaGVhZGVycywgY29uZmlnKTsKKyAgICAgICAgfSk7CisgICAgICAgIHJldHVybiBwcm9taXNlOworICAgICAgfTsKKworICAgICAgcHJvbWlzZS5lcnJvciA9IGZ1bmN0aW9uKGZuKSB7CisgICAgICAgIHByb21pc2UudGhlbihudWxsLCBmdW5jdGlvbihyZXNwb25zZSkgeworICAgICAgICAgIGZuKHJlc3BvbnNlLmRhdGEsIHJlc3BvbnNlLnN0YXR1cywgcmVzcG9uc2UuaGVhZGVycywgY29uZmlnKTsKKyAgICAgICAgfSk7CisgICAgICAgIHJldHVybiBwcm9taXNlOworICAgICAgfTsKKworICAgICAgcmV0dXJuIHByb21pc2U7CisKKyAgICAgIGZ1bmN0aW9uIHRyYW5zZm9ybVJlc3BvbnNlKHJlc3BvbnNlKSB7CisgICAgICAgIC8vIG1ha2UgYSBjb3B5IHNpbmNlIHRoZSByZXNwb25zZSBtdXN0IGJlIGNhY2hlYWJsZQorICAgICAgICB2YXIgcmVzcCA9IGV4dGVuZCh7fSwgcmVzcG9uc2UsIHsKKyAgICAgICAgICBkYXRhOiB0cmFuc2Zvcm1EYXRhKHJlc3B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UpIHsKKyAgICAgICAgICAgICAgY29udGludWUgZGVmYXVsdEhlYWRlcnNJdGVyYXRpb247CisgICAgICAgICAgICB9CisgICAgICAgICAgfQorCisgICAgICAgICAgcmVxSGVhZGVyc1tkZWZIZWFkZXJOYW1lXSA9IGRlZkhlYWRlcnNbZGVmSGVhZGVyTmFtZV07CisgICAgICAgIH0KKworICAgICAgICAvLyBleGVjdXRlIGlmIGhlYWRlciB2YWx1ZSBpcyBhIGZ1bmN0aW9uIGZvciBtZXJnZWQgaGVhZGVycworICAgICAgICBleGVjSGVhZGVycyhyZXFIZWFkZXJzKTsKKyAgICAgICAgcmV0dXJuIHJlcUhlYWRlcnM7CisKKyAgICAgICAgZnVuY3Rpb24gZXhlY0hlYWRlcnMoaGVhZGVycykgeworICAgICAgICAgIHZhciBoZWFkZXJDb250ZW50OworCisgICAgICAgICAgZm9yRWFjaChoZWFkZXJzLCBmdW5jdGlvbihoZWFkZXJGbiwgaGVhZGVyKSB7CisgICAgICAgICAgICBpZiAoaXNGdW5jdGlvbihoZWFkZXJGbikpIHsKKyAgICAgICAgICAgICAgaGVhZGVyQ29udGVudCA9IGhlYWRlckZuKCk7CisgICAgICAgICAgICAgIGlmIChoZWFkZXJDb250ZW50ICE9IG51bGwpIHsKKyAgICAgICAgICAgICAgICBoZWFkZXJzW2hlYWRlcl0gPSBoZWFkZXJDb250ZW50OworICAgICAgICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgICAgIGRlbGV0ZSBoZWFkZXJzW2hlYWRlcl07CisgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0KKyAgICAgICAgICB9KTsKKyAgICAgICAgfQorICAgICAgfQorICAgIH0KKworICAgICRodHRwLnBlbmRpbmdSZXF1ZXN0cyA9IFtdOworCisgICAgLyoqCisgICAgICogQG5nZG9jIG1ldGhvZAorICAgICAqIEBuYW1lICRodHRwI2dldAorICAgICAqCisgICAgICogQGRlc2NyaXB0aW9uCisgICAgICogU2hvcnRjdXQgbWV0aG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cmF0aW9uIG9mCisgICAgICAgICAqIGRlZmF1bHQgaGVhZGVycywgd2l0aENyZWRlbnRpYWxzIGFzIHdlbGwgYXMgcmVxdWVzdCBhbmQgcmVzcG9uc2UgdHJhbnNmb3JtYXRpb25zLgorICAgICAgICAgKgorICAgICAgICAgKiBTZWUgIlNldHRpbmcgSFRUUCBIZWFkZXJzIiBhbmQgIlRyYW5zZm9ybWluZyBSZXF1ZXN0cyBhbmQgUmVzcG9uc2VzIiBzZWN0aW9ucyBhYm92ZS4KKyAgICAgICAgICovCisgICAgJGh0dHAuZGVmYXVsdHMgPSBkZWZhdWx0czsKKworCisgICAgcmV0dXJuICRodHRwOworCisKKyAgICBmdW5jdGlvbiBjcmVhdGVTaG9ydE1ldGhvZHMobmFtZXMpIHsKKyAgICAgIGZvckVhY2goYXJndW1lbnRzLCBmdW5jdGlvbihuYW1lKSB7CisgICAgICAgICRodHRwW25hbWVdID0gZnVuY3Rpb24odXJsLCBjb25maWcpIHsKKyAgICAgICAgICByZXR1cm4gJGh0dHAoZXh0ZW5kKGNvbmZpZyB8fCB7fSwgeworICAgICAgICAgICAgbWV0aG9kOiBuYW1lLAorICAgICAgICAgICAgdXJsOiB1cmwKKyAgICAgICAgICB9KSk7CisgICAgICAgIH07CisgICAgICB9KTsKKyAgICB9CisKKworICAgIGZ1bmN0aW9uIGNyZWF0ZVNob3J0TWV0aG9kc1dpdGhEYXRhKG5hbWUpIHsKKyAgICAgIGZvckVhY2goYXJndW1lbnRzLCBmdW5jdGlvbihuYW1lKSB7CisgICAgICAgICRodHRwW25hbWVdID0gZnVuY3Rpb24odXJsLCBkYXRhLCBjb25maWcpIHsKKyAgICAgICAgICByZXR1cm4gJGh0dHAoZXh0ZW5kKGNvbmZpZyB8fCB7fSwgeworICAgICAgICAgICAgbWV0aG9kOiBuYW1lLAorICAgICAgICAgICAgdXJsOiB1cmwsCisgICAgICAgICAgICBkYXRhOiBkYXRhCisgICAgICAgICAgfSkpOworICAgICAgICB9OworICAgICAgfSk7CisgICAgfQorCisKKyAgICAvKioKKyAgICAgKiBNYWtlcyB0aGUgcmVxdWVzdC4KKyAgICAgKgorICAgICAqICEhISBBQ0NFU1NFUyBDTE9TVVJFIFZBUlM6CisgICAgICogJGh0dHBCYWNrZW5kLCBkZWZhdWx0cywgJGxvZywgJHJvb3RTY29wZSwgZGVmYXVsdENhY2hlLCAkaHR0cC5wZW5kaW5nUmVxdWVzdHMKKyAgICAgKi8KKyAgICBmdW5jdGlvbiBzZW5kUmVxKGNvbmZpZywgcmVxRGF0YSwgcmVxSGVhZGVycykgeworICAgICAgdmFyIGRlZmVycmVkID0gJHEuZGVmZXIoKSwKKyAgICAgICAgICBwcm9taXNlID0gZGVmZXJyZWQucHJvbWlzZSwKKyAgICAgICAgICBjYWNoZSwKKyAgICAgICAgICBjYWNoZWRSZXNwLAorICAgICAgICAgIHVybCA9IGJ1aWxkVXJsKGNvbmZpZy51cmwsIGNvbmZpZy5wYXJhbXMpOworCisgICAgICAkaHR0cC5wZW5kaW5nUmVxdWVzdHMucHVzaChjb25maWcpOworICAgICAgcHJvbWlzZS50aGVuKHJlbW92ZVBlbmRpbmdSZXEsIHJlbW92ZVBlbmRpbmdSZXEpOworCisKKyAgICAgIGlmICgoY29uZmlnLmNhY2hlIHx8IGRlZmF1bHRzLmNhY2hlKSAmJiBjb25maWcuY2FjaGUgIT09IGZhbHNlICYmCisgICAgICAgICAgKGNvbmZpZy5tZXRob2QgPT09ICdHRVQnIHx8IGNvbmZpZy5tZXRob2QgPT09ICdKU09OUCcpKSB7CisgICAgICAgIGNhY2hlID0gaXNPYmplY3QoY29uZmlnLmNhY2hlKSA/IGNvbmZpZy5jYWNoZQorICAgICAgICAgICAgICA6IGlzT2JqZWN0KGRlZmF1bHRzLmNhY2hlKSA/IGRlZmF1bHRzLmNhY2hlCisgICAgICAgICAgICAgIDogZGVmYXVsdENhY2hlOworICAgICAgfQorCisgICAgICBpZiAoY2FjaGUpIHsKKyAgICAgICAgY2FjaGV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yAgICAgIC8vIHNlbmQgdGhlIHJlcXVlc3QgdG8gdGhlIGJhY2tlbmQKKyAgICAgIGlmIChpc1VuZGVmaW5lZChjYWNoZWRSZXNwKSkgeworICAgICAgICB2YXIgeHNyZlZhbHVlID0gdXJsSXNTYW1lT3JpZ2luKGNvbmZpZy51cmwpCisgICAgICAgICAgICA/ICRicm93c2VyLmNvb2tpZXMoKVtjb25maWcueHNyZkNvb2tpZU5hbWUgfHwgZGVmYXVsdHMueHNyZkNvb2tpZU5hbWVdCisgICAgICAgICAgICA6IHVuZGVmaW5lZDsKKyAgICAgICAgaWYgKHhzcmZWYWx1ZSkgeworICAgICAgICAgIHJlcUhlYWRlcnNbKGNvbmZpZy54c3JmSGVhZGVyTmFtZSB8fCBkZWZhdWx0cy54c3JmSGVhZGVyTmFtZSldID0geHNyZlZhbHVlOworICAgICAgICB9CisKKyAgICAgICAgJGh0dHBCYWNrZW5kKGNvbmZpZy5tZXRob2QsIHVybCwgcmVxRGF0YSwgZG9uZSwgcmVxSGVhZGVycywgY29uZmlnLnRpbWVvdXQsCisgICAgICAgICAgICBjb25maWcud2l0aENyZWRlbnRpYWxzLCBjb25maWcucmVzcG9uc2VUeXBlKTsKKyAgICAgIH0KKworICAgICAgcmV0dXJuIHByb21pc2U7CisKKworICAgICAgLyoqCisgICAgICAgKiBDYWxsYmFjayByZWdpc3RlcmVkIHRvICRodHRwQmFja2VuZCgpOgorICAgICAgICogIC0gY2FjaGVzIHRoZSByZXNwb25zZSBpZiBkZXNpcmVkCisgICAgICAgKiAgLSByZXNvbHZlcyB0aGUgcmF3ICRodHRwIHByb21pc2UKKyAgICAgICAqICAtIGNhbGxzICRhcHBseQorICAgICAgICovCisgICAgICBmdW5jdGlvbiBkb25lKHN0YXR1cywgcmVzcG9uc2UsIGhlYWRlcnNTdHJpbmcsIHN0YXR1c1RleHQpIHsKKyAgICAgICAgaWYgKGNhY2hlKSB7CisgICAgICAgICAgaWYgKGlzU3VjY2VzcyhzdGF0dXMpKSB7CisgICAgICAgICAgICBjYWNoZS5wdXQodXJsLCBbc3RhdHVzLCByZXNwb25zZSwgcGFyc2VIZWFkZXJzKGhlYWRlcnNTdHJpbmcpLCBzdGF0dXNUZXh0XSk7CisgICAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgIC8vIHJlbW92ZSBwcm9taXNlIGZyb20gdGhlIGNhY2hlCisgICAgICAgICAgICBjYWNoZS5yZW1vdmUodXJsKTsKKyAgICAgICAgICB9CisgICAgICAgIH0KKworICAgICAgICByZXNvbHZlUHJvbWlzZShyZXNwb25zZSwgc3RhdHVzLCBoZWFkZXJzU3RyaW5nLCBzdGF0dXNUZXh0KTsKKyAgICAgICAgaWYgKCEkcm9vdFNjb3BlLiQkcGhhc2UpICRyb290U2NvcGUuJGFwcGx5KCk7CisgICAgICB9CisKKworICAgICAgLyoqCisgICAgICAgKiBSZXNvbHZlcyB0aGUgcmF3ICRodHRwIHByb21pc2UuCisgICAgICAgKi8KKyAgICAgIGZ1bmN0aW9uIHJlc29sdmVQcm9taXNlKHJlc3BvbnNlLCBzdGF0dXMsIGhlYWRlcnMsIHN0YXR1c1RleHQpIHsKKyAgICAgICAgLy8gbm9ybWFsaXplIGludGVybmFsIHN0YXR1c2VzIHRvIDAKKyAgICAgICAgc3RhdHVzID0gTWF0aC5tYXgoc3RhdHVzLCAwKTsKKworICAgICAgICAoaXNTdWNjZXNzKHN0YXR1cykgPyBkZWZlcnJlZC5yZXNvbHZlIDogZGVmZXJyZWQucmVqZWN0KSh7CisgICAgICAgICAgZGF0YTogcmVzcG9uc2UsCisgICAgICAgICAgc3RhdHVzOiBzdGF0dXMsCisgICAgICAgICAgaGVhZGVyczogaGVhZGVyc0dldHRlcihoZWFkZXJzKSwKKyAgICAgICAgICBjb25maWc6IGNvbmZpZywKKyAgICAgICAgICBzdGF0dXNUZXh0IDogc3RhdHVzVGV4dAorICAgICAgICB9KTsKKyAgICAgIH0KKworCisgICAgICBmdW5jdGlvbiByZW1vdmVQZW5kaW5nUmVxKCkgeworICAgICAgICB2YXIgaWR4ID0gaW5kZXhPZigkaHR0cC5wZW5kaW5nUmVxdWVzdHMsIGNvbmZpZyk7CisgICAgICAgIGlmIChpZHggIT09IC0xKSAkaHR0cC5wZW5kaW5nUmVxdWVzdHMuc3BsaWNlKGlkeCwgMSk7CisgICAgICB9CisgICAgfQorCisKKyAgICBmdW5jdGlvbiBidWlsZFVybCh1cmwsIHBhcmFtcykgeworICAgICAgaWYgKCFwYXJhbXMpIHJldHVybiB1cmw7CisgICAgICB2YXIgcGFydHMgPSBbXTsKKyAgICAgIGZvckVhY2hTb3J0ZWQocGFyYW1zLCBmdW5jdGlvbih2YWx1ZSwga2V5KSB7CisgICAgICAgIGlmICh2YWx1ZSA9PT0gbnVsbCB8fCBpc1VuZGVmaW5lZCh2YWx1ZSkpIHJldHVybjsKKyAgICAgICAgaWYgKCFpc0FycmF5KHZhbHVlKSkgdmFsdWUgPSBbdmFsdWVdOworCisgICAgICAgIGZvckVhY2godmFsdWUsIGZ1bmN0aW9uKHYpIHsKKyAgICAgICAgICBpZiAoaXNPYmplY3QodikpIHsKKyAgICAgICAgICAgIGlmIChpc0RhdGUodikpeworICAgICAgICAgICAgICB2ID0gdi50b0lTT1N0cmluZygpOworICAgICAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgICAgdiA9IHRvSnNvbih2KTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICB9CisgICAgICAgICAgcGFydHMucHVzaChlbmNvZGVVcmlRdWVyeShrZXkpICsgJz0nICsKKyAgICAgICAgICAgICAgICAgICAgIGVuY29kZVVyaVF1ZXJ5KHYpKTsKKyAgICAgICAgfSk7CisgICAgICB9KTsKKyAgICAgIGlmKHBhcnRzLmxlbmd0aCA+IDApIHsKKyAgICAgICAgdXJsICs9ICgodXJsLmluZGV4T2YoJz8nKSA9PSAtMSkgPyAnPycgOiAnJicpICsgcGFydHMuam9pbignJicpOworICAgICAgfQorICAgICAgcmV0dXJuIHVyb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AgICAgLy8gU2FmYXJpIHJlc3BlY3RpdmVseS4KKyAgICAgICAgaWYgKHhociAmJiB4aHIucmVhZHlTdGF0ZSA9PSA0KSB7CisgICAgICAgICAgdmFyIHJlc3BvbnNlSGVhZGVycyA9IG51bGwsCisgICAgICAgICAgICAgIHJlc3BvbnNlID0gbnVsbCwKKyAgICAgICAgICAgICAgc3RhdHVzVGV4dCA9ICcnOworCisgICAgICAgICAgaWYoc3RhdHVzICE9PSBBQk9SVEVEKSB7CisgICAgICAgICAgICByZXNwb25zZUhlYWRlcnMgPSB4aHIuZ2V0QWxsUmVzcG9uc2VIZWFkZXJzKCk7CisKKyAgICAgICAgICAgIC8vIHJlc3BvbnNlVGV4dCBpcyB0aGUgb2xkLXNjaG9vbCB3YXkgb2YgcmV0cmlldmluZyByZXNwb25zZSAoc3VwcG9ydGVkIGJ5IElFOCAmIDkpCisgICAgICAgICAgICAvLyByZXNwb25zZS9yZXNwb25zZVR5cGUgcHJvcGVydGllcyB3ZXJlIGludHJvZHVjZWQgaW4gWEhSIExldmVsMiBzcGVjIChzdXBwb3J0ZWQgYnkgSUUxMCkKKyAgICAgICAgICAgIHJlc3BvbnNlID0gKCdyZXNwb25zZScgaW4geGhyKSA/IHhoci5yZXNwb25zZSA6IHhoci5yZXNwb25zZVRleHQ7CisgICAgICAgICAgfQorCisgICAgICAgICAgLy8gQWNjZXNzaW5nIHN0YXR1c1RleHQgb24gYW4gYWJvcnRlZCB4aHIgb2JqZWN0IHdpbGwKKyAgICAgICAgICAvLyB0aHJvdyBhbiAnYzAwYzAyM2YgZXJyb3InIGluIElFOSBhbmQgbG93ZXIsIGRvbid0IHRvdWNoIGl0LgorICAgICAgICAgIGlmICghKHN0YXR1cyA9PT0gQUJPUlRFRCAmJiBtc2llIDwgMTApKSB7CisgICAgICAgICAgICBzdGF0dXNUZXh0ID0geGhyLnN0YXR1c1RleHQ7CisgICAgICAgICAgfQorCisgICAgICAgICAgY29tcGxldGVSZXF1ZXN0KGNhbGxiYWNrLAorICAgICAgICAgICAgICBzdGF0dXMgfHwgeGhyLnN0YXR1cywKKyAgICAgICAgICAgICAgcmVzcG9uc2UsCisgICAgICAgICAgICAgIHJlc3BvbnNlSGVhZGVycywKKyAgICAgICAgICAgICAgc3RhdHVzVGV4dCk7CisgICAgICAgIH0KKyAgICAgIH07CisKKyAgICAgIGlmICh3aXRoQ3JlZGVudGlhbHMpIHsKKyAgICAgICAgeGhyLndpdGhDcmVkZW50aWFscyA9IHRydWU7CisgICAgICB9CisKKyAgICAgIGlmIChyZXNwb25zZVR5cGUpIHsKKyAgICAgICAgdHJ5IHsKKyAgICAgICAgICB4aHIucmVzcG9uc2VUeXBlID0gcmVzcG9uc2VUeXBlOworICAgICAgICB9IGNhdGNoIChlKSB7CisgICAgICAgICAgLy8gV2ViS2l0IGFkZGVkIHN1cHBvcnQgZm9yIHRoZSBqc29uIHJlc3BvbnNlVHlwZSB2YWx1ZSBvbiAwOS8wMy8yMDEzCisgICAgICAgICAgLy8gaHR0cHM6Ly9idWdzLndlYmtpdC5vcmcvc2hvd19idWcuY2dpP2lkPTczNjQ4LiBWZXJzaW9ucyBvZiBTYWZhcmkgcHJpb3IgdG8gNyBhcmUKKyAgICAgICAgICAvLyBrbm93biB0byB0aHJvdyB3aGVuIHNldHRpbmcgdGhlIHZhbHVlICJqc29uIiBhcyB0aGUgcmVzcG9uc2UgdHlwZS4gT3RoZXIgb2xkZXIKKyAgICAgICAgICAvLyBicm93c2VycyBpbXBsZW1lbnRpbmcgdGhlIHJlc3BvbnNlVHlwZQorICAgICAgICAgIC8vCisgICAgICAgICAgLy8gVGhlIGpzb24gcmVzcG9uc2UgdHlwZSBjYW4gYmUgaWdub3JlZCBpZiBub3Qgc3VwcG9ydGVkLCBiZWNhdXNlIEpTT04gcGF5bG9hZHMgYXJlCisgICAgICAgICAgLy8gcGFyc2VkIG9uIHRoZSBjbGllbnQtc2lkZSByZWdhcmRsZXNzLgorICAgICAgICAgIGlmIChyZXNwb25zZVR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zY3JpcHQuc3JjID0gdXJsOworICAgIHNjcmlwdC5hc3luYyA9IHRydWU7CisKKyAgICBjYWxsYmFjayA9IGZ1bmN0aW9uKGV2ZW50KSB7CisgICAgICByZW1vdmVFdmVudExpc3RlbmVyRm4oc2NyaXB0LCAibG9hZCIsIGNhbGxiYWNrKTsKKyAgICAgIHJlbW92ZUV2ZW50TGlzdGVuZXJGbihzY3JpcHQsICJlcnJvciIsIGNhbGxiYWNrKTsKKyAgICAgIHJhd0RvY3VtZW50LmJvZHkucmVtb3ZlQ2hpbGQoc2NyaXB0KTsKKyAgICAgIHNjcmlwdCA9IG51bGw7CisgICAgICB2YXIgc3RhdHVzID0gLTE7CisgICAgICB2YXIgdGV4dCA9ICJ1bmtub3duIjsKKworICAgICAgaWYgKGV2ZW50KSB7CisgICAgICAgIGlmIChldmVudC50eXBlID09PSAibG9hZCIgJiYgIWNhbGxiYWNrc1tjYWxsYmFja0lkXS5jYWxsZWQpIHsKKyAgICAgICAgICBldmVudCA9IHsgdHlwZTogImVycm9yIiB9OworICAgICAgICB9CisgICAgICAgIHRleHQgPSBldmVudC50eXBlOworICAgICAgICBzdGF0dXMgPSBldmVudC50eXBlID09PSAiZXJyb3IiID8gNDA0IDogMjAwOworICAgICAgfQorCisgICAgICBpZiAoZG9uZSkgeworICAgICAgICBkb25lKHN0YXR1cywgdGV4dCk7CisgICAgICB9CisgICAgfTsKKworICAgIGFkZEV2ZW50TGlzdGVuZXJGbihzY3JpcHQsICJsb2FkIiwgY2FsbGJhY2spOworICAgIGFkZEV2ZW50TGlzdGVuZXJGbihzY3JpcHQsICJlcnJvciIsIGNhbGxiYWNrKTsKKworICAgIGlmIChtc2llIDw9IDgpIHsKKyAgICAgIHNjcmlwdC5vbnJlYWR5c3RhdGVjaGFuZ2UgPSBmdW5jdGlvbigpIHsKKyAgICAgICAgaWYgKGlzU3RyaW5nKHNjcmlwdC5yZWFkeVN0YXRlKSAmJiAvbG9hZGVkfGNvbXBsZXRlLy50ZXN0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ICAqICAgIGludGVycG9sYXRlZCBzdHJpbmcuIFRoZSBmdW5jdGlvbiBoYXMgdGhlc2UgcGFyYW1ldGVyczoKKyAgICAgKgorICAgICAqICAgICogYGNvbnRleHRgOiBhbiBvYmplY3QgYWdhaW5zdCB3aGljaCBhbnkgZXhwcmVzc2lvbnMgZW1iZWRkZWQgaW4gdGhlIHN0cmluZ3MgYXJlIGV2YWx1YXRlZAorICAgICAqICAgICAgYWdhaW5zdC4KKyAgICAgKgorICAgICAqLworICAgIGZ1bmN0aW9uICRpbnRlcnBvbGF0ZSh0ZXh0LCBtdXN0SGF2ZUV4cHJlc3Npb24sIHRydXN0ZWRDb250ZXh0KSB7CisgICAgICB2YXIgc3RhcnRJbmRleCwKKyAgICAgICAgICBlbmRJbmRleCwKKyAgICAgICAgICBpbmRleCA9IDAsCisgICAgICAgICAgcGFydHMgPSBbXSwKKyAgICAgICAgICBsZW5ndGggPSB0ZXh0Lmxlbmd0aCwKKyAgICAgICAgICBoYXNJbnRlcnBvbGF0aW9uID0gZmFsc2UsCisgICAgICAgICAgZm4sCisgICAgICAgICAgZXhwLAorICAgICAgICAgIGNvbmNhdCA9IFtdOworCisgICAgICB3aGlsZShpbmRleCA8IGxlbmd0aCkgeworICAgICAgICBpZiAoICgoc3RhcnRJbmRleCA9IHRleHQuaW5kZXhPZihzdGFydFN5bWJvbCwgaW5kZXgpKSAhPSAtMSkgJiYKKyAgICAgICAgICAgICAoKGVuZEluZGV4ID0gdGV4dC5pbmRleE9mKGVuZFN5bWJvbCwgc3RhcnRJbmRleCArIHN0YXJ0U3ltYm9sTGVuZ3RoKSkgIT0gLTEpICkgeworICAgICAgICAgIChpbmRleCAhPSBzdGFydEluZGV4KSAmJiBwYXJ0cy5wdXNoKHRleHQuc3Vic3RyaW5nKGluZGV4LCBzdGFydEluZGV4KSk7CisgICAgICAgICAgcGFydHMucHVzaChmbiA9ICRwYXJzZShleHAgPSB0ZXh0LnN1YnN0cmluZyhzdGFydEluZGV4ICsgc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KHR5cGVvZiAocGFydCA9IHBhcnRzW2ldKSA9PSAnZnVuY3Rpb24nKSB7CisgICAgICAgICAgICAgICAgcGFydCA9IHBhcnQoY29udGV4dCk7CisgICAgICAgICAgICAgICAgaWYgKHRydXN0ZWRDb250ZXh0KSB7CisgICAgICAgICAgICAgICAgICBwYXJ0ID0gJHNjZS5nZXRUcnVzdGVkKHRydXN0ZWRDb250ZXh0LCBwYXJ0KTsKKyAgICAgICAgICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgICAgICAgcGFydCA9ICRzY2UudmFsdWVPZihwYXJ0KTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgaWYgKHBhcnQgPT0gbnVsbCkgeyAvLyBudWxsIHx8IHVuZGVmaW5lZAorICAgICAgICAgICAgICAgICAgcGFydCA9ICcnOworICAgICAgICAgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICAgICAgICBzd2l0Y2ggKHR5cGVvZiBwYXJ0KSB7CisgICAgICAgICAgICAgICAgICAgIGNhc2UgJ3N0cmluZyc6CisgICAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICBjYXNlICdudW1iZXInOgorICAgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgICAgcGFydCA9ICcnICsgcGFydDsKKyAgICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICBkZWZhdWx0OgorICAgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgICAgcGFydCA9IHRvSnNvbihwYXJ0KTsKKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICBjb25jYXRbaV0gPSBwYXJ0OworICAgICAgICAgICAgfQorICAgICAgICAgICAgcmV0dXJuIGNvbmNhdC5qb2luKCcnKTsKKyAgICAgICAgICB9CisgICAgICAgICAgY2F0Y2goZXJyKSB7CisgICAgICAgICAgICB2YXIgbmV3RXJyID0gJGludGVycG9sYXRlTWluRXJyKCdpbnRlcnInLCAiQ2FuJ3QgaW50ZXJwb2xhdGU6IHswfVxuezF9IiwgdGV4dCwKKyAgICAgICAgICAgICAgICBlcnIudG9TdHJpbmcoKSk7CisgICAgICAgICAgICAkZXhjZXB0aW9uSGFuZGxlcihuZXdFcnIpOworICAgICAgICAgIH0KKyAgICAgICAgfTsKKyAgICAgICAgZm4uZXhwID0gdGV4dDsKKyAgICAgICAgZm4ucGFydHMgPSBwYXJ0czsKKyAgICAgICAgcmV0dXJuIGZuOworICAgICAgfQorICAgIH0KKworCisgICAgLyoqCisgICAgICogQG5nZG9jIG1ldGhvZAorICAgICAqIEBuYW1lICRpbnRlcnBvbGF0ZSNzdGFydFN5bWJvbAorICAgICAqIEBkZXNjcmlwdGlvbgorICAgICAqIFN5bWJvbCB0byBkZW5vdGUgdGhlIHN0YXJ0IG9mIGV4cHJlc3Npb24gaW4gdGhlIGludGVycG9sYXRlZCBzdHJpbmcuIERlZmF1bHRzIHRvIGB7e2AuCisgICAgICoKKyAgICAgKiBVc2Uge0BsaW5rIG5nLiRpbnRlcnBvbGF0ZVByb3ZpZGVyI3N0YXJ0U3ltYm9sIGAkaW50ZXJwb2xhdGVQcm92aWRlci5zdGFydFN5bWJvbGB9IHRvIGNoYW5nZQorICAgICAqIHRoZSBzeW1ib2wuCisgICAgICoKKyAgICAgKiBAcmV0dXJucyB7c3RyaW5nfSBzdGFydCBzeW1ib2wuCisgICAgICovCisgICAgJGludGVycG9sYXRlLnN0YXJ0U3ltYm9sID0gZnVuY3Rpb24oKSB7CisgICAgICByZXR1cm4gc3RhcnRTeW1ib2w7CisgICAgfTsKKworCisgICAgLyoqCisgICAgICogQG5nZG9jIG1ldGhvZAorICAgICAqIEBuYW1lIC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lvbi4KKyAgICAgICoKKyAgICAgICogQGV4YW1wbGUKKyAgICAgICogPGV4YW1wbGUgbW9kdWxlPSJpbnRlcnZhbEV4YW1wbGUiPgorICAgICAgKiA8ZmlsZSBuYW1lPSJpbmRleC5odG1sIj4KKyAgICAgICogICA8c2NyaXB0PgorICAgICAgKiAgICAgYW5ndWxhci5tb2R1bGUoJ2ludGVydmFsRXhhbXBsZScsIFtdKQorICAgICAgKiAgICAgICAuY29udHJvbGxlcignRXhhbXBsZUNvbnRyb2xsZXInLCBbJyRzY29wZScsICckaW50ZXJ2YWwnLAorICAgICAgKiAgICAgICAgIGZ1bmN0aW9uKCRzY29wZSwgJGludGVydmFsKSB7CisgICAgICAqICAgICAgICAgICAkc2NvcGUuZm9ybWF0ID0gJ00vZC95eSBoOm1tOnNzIGEnOworICAgICAgKiAgICAgICAgICAgJHNjb3BlLmJsb29kXzEgPSAxMDA7CisgICAgICAqICAgICAgICAgICAkc2NvcGUuYmxvb2RfMiA9IDEyMDsKKyAgICAgICoKKyAgICAgICogICAgICAgICAgIHZhciBzdG9wOworICAgICAgKiAgICAgICAgICAgJHNjb3BlLmZpZ2h0ID0gZnVuY3Rpb24oKSB7CisgICAgICAqICAgICAgICAgICAgIC8vIERvbid0IHN0YXJ0IGEgbmV3IGZpZ2h0IGlmIHdlIGFyZSBhbHJlYWR5IGZpZ2h0aW5nCisgICAgICAqICAgICAgICAgICAgIGlmICggYW5ndWxhci5pc0RlZmluZWQoc3RvcCkgKSByZXR1cm47CisgICAgICAqCisgICAgICAqICAgICAgICAgICBzdG9wID0gJGludGVydmFsKGZ1bmN0aW9uKCkgeworICAgICAgKiAgICAgICAgICAgICBpZiAoJHNjb3BlLmJsb29kXzEgPiAwICYmICRzY29wZS5ibG9vZF8yID4gMCkgeworICAgICAgKiAgICAgICAgICAgICAgICRzY29wZS5ibG9vZF8xID0gJHNjb3BlLmJsb29kXzEgLSAzOworICAgICAgKiAgICAgICAgICAgICAgICRzY29wZS5ibG9vZF8yID0gJHNjb3BlLmJsb29kXzIgLSA0OworICAgICAgKiAgICAgICAgICAgICB9IGVsc2UgeworICAgICAgKiAgICAgICAgICAgICAgICRzY29wZS5zdG9wRmlnaHQoKTsKKyAgICAgICogICAgICAgICAgICAgfQorICAgICAgKiAgICAgICAgICAgfSwgMTAwKTsKKyAgICAgICogICAgICAgICB9OworICAgICAgKgorICAgICAgKiAgICAgICAgICRzY29wZS5zdG9wRmlnaHQgPSBmdW5jdGlvbigpIHsKKyAgICAgICogICAgICAgICAgIGlmIChhbmd1bGFyLmlzRGVmaW5lZChzdG9wKSkgeworICAgICAgKiAgICAgICAgICAgICAkaW50ZXJ2YWwuY2FuY2VsKHN0b3ApOworICAgICAgKiAgICAgICAgICAgICBzdG9wID0gdW5kZWZpbmVkOworICAgICAgKiAgICAgICAgICAgfQorICAgICAgKiAgICAgICAgIH07CisgICAgICAqCisgICAgICAqICAgICAgICAgJHNjb3BlLnJlc2V0RmlnaHQgPSBmdW5jdGlvbigpIHsKKyAgICAgICogICAgICAgICAgICRzY29wZS5ibG9vZF8xID0gMTAwOworICAgICAgKiAgICAgICAgICAgJHNjb3BlLmJsb29kXzIgPSAxMjA7CisgICAgICAqICAgICAgICAgfTsKKyAgICAgICoKKyAgICAgICogICAgICAgICAkc2NvcGUuJG9uKCckZGVzdHJveScsIGZ1bmN0aW9uKCkgeworICAgICAgKiAgICAgICAgICAgLy8gTWFrZSBzdXJlIHRoYXQgdGhlIGludGVydmFsIGlzIGRlc3Ryb3llZCB0b28KKyAgICAgICogICAgICAgICAgICRzY29wZS5zdG9wRmlnaHQoKTsKKyAgICAgICogICAgICAgICB9KTsKKyAgICAgICogICAgICAgfV0pCisgICAgICAqICAgICAgIC8vIFJlZ2lzdGVyIHRoZSAnbXlDdXJyZW50VGltZScgZGlyZWN0aXZlIGZhY3RvcnkgbWV0aG9kLgorICAgICAgKiAgICAgICAvLyBXZSBpbmplY3QgJGludGVydmFsIGFuZCBkYXRlRmlsdGVyIHNlcnZpY2Ugc2luY2UgdGhlIGZhY3RvcnkgbWV0aG9kIGlzIERJLgorICAgICAgKiAgICAgICAuZGlyZWN0aXZlKCdteUN1cnJlbnRUaW1lJywgWyckaW50ZXJ2YWwnLCAnZGF0ZUZpbHRlcicsCisgICAgICAqICAgICAgICAgZnVuY3Rpb24oJGludGVydmFsLCBkYXRlRmlsdGVyKSB7CisgICAgICAqICAgICAgICAgICAvLyByZXR1cm4gdGhlIGRpcmVjdGl2ZSBsaW5rIGZ1bmN0aW9uLiAoY29tcGlsZSBmdW5jdGlvbiBub3QgbmVlZGVkKQorICAgICAgKiAgICAgICAgICAgcmV0dXJuIGZ1bmN0aW9uKHNjb3BlLCBlbGVtZW50LCBhdHRycykgeworICAgICAgKiAgICAgICAgICAgICB2YXIgZm9ybWF0LCAgLy8gZGF0ZSBmb3JtYXQKKyAgICAgICogICAgICAgICAgICAgICAgIHN0b3BUaW1lOyAvLyBzbyB0aGF0IHdlIGNhbiBjYW5jZWwgdGhlIHRpbWUgdXBkYXRlcworICAgICAgKgorICAgICAgKiAgICAgICAgICAgICAvLyB1c2VkIHRvIHVwZGF0ZSB0aGUgVUkKKyAgICAgICogICAgICAgICAgICAgZnVuY3Rpb24gdXBkYXRlVGltZSgpIHsKKyAgICAgICogICAgICAgICAgICAgICBlbGVtZW50LnRleHQoZGF0ZUZpbHRlcihuZXcgRGF0ZSgpLCBmb3JtYXQpKTsKKyAgICAgICogICAgICAgICAgICAgfQorICAgICAgKgorICAgICAgKiAgICAgICAgICAgICAvLyB3YXRjaCB0aGUgZXhwcmVzc2lvbiwgYW5kIHVwZGF0ZSB0aGUgVUkgb24gY2hhbmdlLgorICAgICAgKiAgICAgICAgICAgICBzY29wZS4kd2F0Y2goYXR0cnMubXlDdXJyZW50VGltZSwgZnVuY3Rpb24odmFsdWUpIHsKKyAgICAgICogICAgICAgICAgICAgICBmb3JtYXQgPSB2YWx1ZTsKKyAgICAgICogICAgICAgICAgICAgICB1cGRhdGVUaW1lKCk7CisgICAgICAqICAgICAgICAgICAgIH0pOworICAgICAgKgorICAgICAgKiAgICAgICAgICAgICBzdG9wVGltZSA9ICRpbnRlcnZhbCh1cGRhdGVUaW1lLCAxMDAwKTsKKyAgICAgICoKKyAgICAgICogICAgICAgICAgICAgLy8gbGlzdGVuIG9uIERPTSBkZXN0cm95IChyZW1vdmFsKSBldmVudCwgYW5kIGNhbmNlbCB0aGUgbmV4dCBVSSB1cGRhdGUKKyAgICAgICogICAgICAgICAgICAgLy8gdG8gcHJldmVudCB1cGRhdGluZyB0aW1lIGFmdGVyIHRoZSBET00gZWxlbWVudCB3YXMgcmVtb3ZlZC4KKyAgICAgICogICAgICAgICAgICAgZWxlbWVudC5iaW5kKCckZGVzdHJveScsIGZ1bmN0aW9uKCkgeworICAgICAgKiAgICAgICAgICAgICAgICRpbnRlcnZhbC5jYW5jZWwoc3RvcFRpbWUpOworICAgICAgKiAgICAgICAgICAgICB9KTsKKyAgICAgICogICAgICAgICAgIH0KKyAgICAgICogICAgICAgICB9XSk7CisgICAgICAqICAgPC9zY3JpcHQ+CisgICAgICAqCisgICAgICAqICAgPGRpdj4KKyAgICAgICogICAgIDxkaXYgbmctY29udHJvbGxlcj0iRXhhbXBsZUNvbnRyb2xsZXIiPgorICAgICAgKiAgICAgICBEYXRlIGZvcm1hdDogPGlucHV0IG5nLW1vZGVsPSJmb3JtYXQiPiA8aHIvPgorICAgICAgKiAgICAgICBDdXJyZW50IHRpbWUgaXM6IDxzcGFuIG15LWN1cnJlbnQtdGltZT0iZm9ybWF0Ij48L3NwYW4+CisgICAgICAqICAgICAgIDxoci8+CisgICAgICAqICAgICAgIEJsb29kIDEgOiA8Zm9udCBjb2xvcj0ncmVkJz57e2Jsb29kXzF9fTwvZm9udD4KKyAgICAgICogICAgICAgQmxvb2QgMiA6IDxmb250IGNvbG9yPSdyZWQnPnt7Ymxvb2RfMn19PC9mb250PgorICAgICAgKiAgICAgICA8YnV0dG9uIHR5cGU9ImJ1dHRvbiIgZGF0YS1uZy1jbGljaz0iZmlnaHQoKSI+RmlnaHQ8L2J1dHRvbj4KKyAgICAgICogICAgICAgPGJ1dHRvbiB0eXBlPSJidXR0b24iIGRhdGEtbmctY2xpY2s9InN0b3BGaWdodCgpIj5TdG9wRmlnaHQ8L2J1dHRvbj4KKyAgICAgICogICAgICAgPGJ1dHRvbiB0eXBlPSJidXR0b24iIGRhdGEtbmctY2xpY2s9InJlc2V0RmlnaHQoKSI+cmVzZXRGaWdodDwvYnV0dG9uPgorICAgICAgKiAgICAgPC9kaXY+CisgICAgICAqICAgPC9kaXY+CisgICAgICAqCisgICAgICAqIDwvZmlsZT4KKyAgICAgICogPC9leGFtcGxlPgorICAgICAgKi8KKyAgICBmdW5jdGlvbiBpbnRlcnZhbChmbiwgZGVsYXksIGNvdW50LCBpbnZva2VBcHBseSkgeworICAgICAgdmFyIHNldEludGVydmFsID0gJHdpbmRvdy5zZXRJbnRlcnZhbCwKKyAgICAgICAgICBjbGVhckludGVydmFsID0gJHdpbmRvdy5jbGVhckludGVydmFsLAorICAgICAgICAgIGRlZmVycmVkID0gJHEuZGVmZXIoKSwKKyAgICAgICAgICBwcm9taXNlID0gZGVmZXJyZWQucHJvbWlzZSwKKyAgICAgICAgICBpdGVyYXRpb24gPSAwLAorICAgICAgICAgIHNraXBBcHBseSA9IChpc0RlZmluZWQoaW52b2tlQXBwbHkpICYmICFpbnZva2VBcHBseSk7CisKKyAgICAgIGNvdW50ID0gaXNEZWZpbmVkKGNvdW50KSA/IGNvdW50IDogMDsKKworICAgICAgcHJvbWlzZS50aGVuKG51bGwsIG51bGwsIGZuKTsKKworICAgICAgcHJvbWlzZS4kJGludGVydmFsSWQgPSBzZXRJbnRlcnZhbChmdW5jdGlvbiB0aWNrKCkgeworICAgICAgICBkZWZlcnJlZC5ub3RpZnkoaXRlcmF0aW9uKyspOworCisgICAgICAgIGlmIChjb3VudCA+IDAgJiYgaXRlcmF0aW9uID49IGNvdW50KSB7CisgICAgICAgICAgZGVmZXJyZWQucmVzb2x2ZShpdGVyYXRpb24pOworICAgICAgICAgIGNsZWFySW50ZXJ2YWwocHJvbWlzZS4kJGludGVydmFsSWQpOworICAgICAgICAgIGRlbGV0ZSBpbnRlcnZhbHNbcHJvbWlzZS4kJGludGVydmFsSWRdOworICAgICAgICB9CisKKyAgICAgICAgaWYgKCFza2lwQXBwbHkpICRyb290U2NvcGUuJGFwcGx5KCk7CisKKyAgICAgIH0sIGRlbGF5KTsKKworICAgICAgaW50ZXJ2YWxzW3Byb21pc2UuJCRpbnRlcnZhbElkXSA9IGRlZmVycmVkOworCisgICAgICByZXR1cm4gcHJvbWlzZTsKKyAgICB9CisKKworICAgICAvKioKKyAgICAgICogQG5nZG9jIG1ldGhvZAorICAgICAgKiBAbmFtZSAkaW50ZXJ2YWwjY2FuY2VsCisgICAgICAqCisgICAgICAqIEBkZXNjcmlwdGlvbgorICAgICAgKiBDYW5jZWxzIGEgdGFzayBhc3NvY2lhdGVkIHdpdGggdGhlIGBwcm9taXNlYC4KKyAgICAgICoKKyAgICAgICogQHBhcmFtIHtwcm9taXNlfSBwcm9taXNlIHJldHVybmVkIGJ5IHRoZSBgJGludGVydmFsYCBmdW5jdGlvbi4KKyAgICAgICogQHJldHVybnMge2Jvb2xlYW59IFJldHVybnMgYHRydWVgIGlmIHRoZSB0YXNrIHdhcyBzdWNjZXNzZnVsbHkgY2FuY2VsZWQuCisgICAgICAqLworICAgIGludGVydmFsLmNhbmNlbCA9IGZ1bmN0aW9uKHByb21pc2UpIHsKKyAgICAgIGlmIChwcm9taXNlICYmIHByb21pc2UuJCRpbnRlcnZhbElkIGluIGludGVydmFscykgeworICAgICAgICBpbnRlcnZhbHNbcHJvbWlzZS4kJGludGVydmFsSWRdLnJlamVjdCgnY2FuY2VsZWQnKTsKKyAgICAgICAgJHdpbmRvdy5jbGVhckludGVydmFsKHByb21pc2UuJCRpbnRlcnZhbElkKTsKKyAgICAgICAgZGVsZXRlIGludGVydmFsc1twcm9taXNlLiQkaW50ZXJ2YWxJZF07CisgICAgICAgIHJldHVybiB0cnVlOworICAgICAgfQorICAgICAgcmV0dXJuIGZhbHNlOworICAgIH07CisKKyAgICByZXR1cm4gaW50ZXJ2YWw7CisgIH1dOworfQorCisvKioKKyAqIEBuZ2RvYyBzZXJ2aWNlCisgKiBAbmFtZSAkbG9jYWxlCisgKgorICogQGRlc2NyaXB0aW9uCisgKiAkbG9jYWxlIHNlcnZpY2UgcHJvdmlkZXMgbG9jYWxpemF0aW9uIHJ1bGVzIGZvciB2YXJpb3VzIEFuZ3VsYXIgY29tcG9uZW50cy4gQXMgb2YgcmlnaHQgbm93IHRoZQorICogb25seSBwdWJsaWMgYXBpIGlzOgorICoKKyAqICogYGlkYCDigJMgYHtzdHJpbmd9YCDigJMgbG9jYWxlIGlkIGZvcm1hdHRlZCBhcyBgbGFuZ3VhZ2VJZC1jb3VudHJ5SWRgIChlLmcuIGBlbi11c2ApCisgKi8KK2Z1bmN0aW9uICRMb2NhbGVQcm92aWRlcigpeworICB0aGlzLiRnZXQgPSBmdW5jdGlvbigpIHsKKyAgICByZXR1cm4geworICAgICAgaWQ6ICdlbi11cycsCisKKyAgICAgIE5VTUJFUl9GT1JNQVRTOiB7CisgICAgICAgIERFQ0lNQUxfU0VQOiAnLicsCisgICAgICAgIEdST1VQX1NFUDogJywnLAorICAgICAgICBQQVRURVJOUzogWworICAgICAgICAgIHsgLy8gRGVjaW1hbCBQYXR0ZXJuCisgICAgICAgICAgICBtaW5JbnQ6IDEsCisgICAgICAgICAgICBtaW5GcmFjOiAwLAorICAgICAgICAgICAgbWF4RnJhYzogMywKKyAgICAgICAgICAgIHBvc1ByZTogJycsCisgICAgICAgICAgICBwb3NTdWY6ICcnLAorICAgICAgICAgICAgbmVnUHJlOiAnLScsCisgICAgICAgICAgICBuZWdTdWY6ICcnLAorICAgICAgICAgICAgZ1NpemU6IDMsCisgICAgICAgICAgICBsZ1NpemU6IDMKKyAgICAgICAgICB9LHsgLy9DdXJyZW5jeSBQYXR0ZXJuCisgICAgICAgICAgICBtaW5JbnQ6IDEsCisgICAgICAgICAgICBtaW5GcmFjOiAyLAorICAgICAgICAgICAgbWF4RnJhYzogMiwKKyAgICAgICAgICAgIHBvc1ByZTogJ1x1MDBBNCcsCisgICAgICAgICAgICBwb3NTdWY6ICcnLAorICAgICAgICAgICAgbmVnUHJlOiAnKFx1MDBBNCcsCisgICAgICAgICAgICBuZWdTdWY6ICcpJywKKyAgICAgICAgICAgIGdTaXplOiAzLAorICAgICAgICAgICAgbGdTaXplOiAzCisgICAgICAgICAgfQorICAgICAgICBdLAorICAgICAgICBDVVJSRU5DWV9TWU06ICckJworICAgICAgfSwKKworICAgICAgREFURVRJTUVfRk9STUFUUzogeworICAgICAgICBNT05USDoKKyAgICAgICAgICAgICdKYW51YXJ5LEZlYnJ1YXJ5LE1hcmNoLEFwcmlsLE1heSxKdW5lLEp1bHksQXVndXN0LFNlcHRlbWJlcixPY3RvYmVyLE5vdmVtYmVyLERlY2VtYmVyJworICAgICAgICAgICAgLnNwbGl0KCcsJyksCisgICAgICAgIFNIT1JUTU9OVEg6ICAnSmFuLEZlYixNYXIsQXByLE1heSxKdW4sSnVsLEF1ZyxTZXAsT2N0LE5vdixEZWMnLnNwbGl0KCcsJyksCisgICAgICAgIERBWTogJ1N1bmRheSxNb25kYXksVHVlc2RheSxXZWRuZXNkYXksVGh1cnNkYXksRnJpZGF5LFNhdHVyZGF5Jy5zcGxpdCgnLCcpLAorICAgICAgICBTSE9SVERBWTogJ1N1bixNb24sVHVlLFdlZCxUaHUsRnJpLFNhdCcuc3BsaXQoJywnKSwKKyAgICAgICAgQU1QTVM6IFsnQU0nLCdQTSddLAorICAgICAgICBtZWRpdW06ICdNTU0gZCwgeSBoOm1tOnNzIGEnLAorICAgICAgICBzaG9ydDogJ00vZC95eSBoOm1tIGEnLAorICAgICAgICBmdWxsRGF0ZTogJ0VFRUUsIE1NTU0gZCwgeScsCisgICAgICAgIGxvbmdEYXRlOiAnTU1NTSBkL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SBlbHNlIGlmIChpc09iamVjdChzZWFyY2gpKSB7CisgICAgICAgICAgLy8gcmVtb3ZlIG9iamVjdCB1bmRlZmluZWQgb3IgbnVsbCBwcm9wZXJ0aWVzCisgICAgICAgICAgZm9yRWFjaChzZWFyY2gsIGZ1bmN0aW9uKHZhbHVlLCBrZXkpIHsKKyAgICAgICAgICAgIGlmICh2YWx1ZSA9PSBudWxsKSBkZWxldGUgc2VhcmNoW2tleV07CisgICAgICAgICAgfSk7CisKKyAgICAgICAgICB0aGlzLiQkc2VhcmNoID0gc2VhcmNoOworICAgICAgICB9IGVsc2UgeworICAgICAgICAgIHRocm93ICRsb2NhdGlvbk1pbkVycignaXNyY2hhcmcnLAorICAgICAgICAgICAgICAnVGhlIGZpcnN0IGFyZ3VtZW50IG9mIHRoZSBgJGxvY2F0aW9uI3NlYXJjaCgpYCBjYWxsIG11c3QgYmUgYSBzdHJpbmcgb3IgYW4gb2JqZWN0LicpOworICAgICAgICB9CisgICAgICAgIGJyZWFrOworICAgICAgZGVmYXVsdDoKKyAgICAgICAgaWYgKGlzVW5kZWZpbmVkKHBhcmFtVmFsdWUpIHx8IHBhcmFtVmFsdWUgPT09IG51bGwpIHsKKyAgICAgICAgICBkZWxldGUgdGhpcy4kJHNlYXJjaFtzZWFyY2hdOworICAgICAgICB9IGVsc2UgeworICAgICAgICAgIHRoaXMuJCRzZWFyY2hbc2VhcmNoXSA9IHBhcmFtVmFsdWU7CisgICAgICAgIH0KKyAgICB9CisKKyAgICB0aGlzLiQkY29tcG9zZSgpOworICAgIHJldHVybiB0aGlzOworICB9LAorCisgIC8qKgorICAgKiBAbmdkb2MgbWV0aG9kCisgICAqIEBuYW1lICRsb2NhdGlvbiNoYXNoCisgICAqCisgICAqIEBkZXNjcmlwdGlvbgorICAgKiBUaGlzIG1ldGhvZCBpcyBnZXR0ZXIgLyBzZXR0ZXIuCisgICAqCisgICAqIFJldHVybiBoYXNoIGZyYWdtZW50IHdoZW4gY2FsbGVkIHdpdGh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gICBpZiAoSUdOT1JFX1VSSV9SRUdFWFAudGVzdChhYnNIcmVmKSkgcmV0dXJuOworCisgICAgICAvLyBNYWtlIHJlbGF0aXZlIGxpbmtzIHdvcmsgaW4gSFRNTDUgbW9kZSBmb3IgbGVnYWN5IGJyb3dzZXJzIChvciBhdCBsZWFzdCBJRTggJiA5KQorICAgICAgLy8gVGhlIGhyZWYgc2hvdWxkIGJlIGEgcmVndWxhciB1cmwgZS5nLiAvbGluay9zb21ld2hlcmUgb3IgbGluay9zb21ld2hlcmUgb3IgLi4vc29tZXdoZXJlIG9yCisgICAgICAvLyBzb21ld2hlcmUjYW5jaG9yIG9yIGh0dHA6Ly9leGFtcGxlLmNvbS9zb21ld2hlcmUKKyAgICAgIGlmIChMb2NhdGlvbk1vZGUgPT09IExvY2F0aW9uSGFzaGJhbmdJbkh0bWw1VXJsKSB7CisgICAgICAgIC8vIGdldCB0aGUgYWN0dWFsIGhyZWYgYXR0cmlidXRlIC0gc2VlCisgICAgICAgIC8vIGh0dHA6Ly9tc2RuLm1pY3Jvc29mdC5jb20vZW4tdXMvbGlicmFyeS9pZS9kZDM0NzE0OCh2PXZzLjg1KS5hc3B4CisgICAgICAgIHZhciBocmVmID0gZWxtLmF0dHIoJ2hyZWYnKSB8fCBlbG0uYXR0cigneGxpbms6aHJlZicpOworCisgICAgICAgIGlmIChocmVmICYmIGhyZWYuaW5kZXhPZignOi8vJykgPCAwKSB7ICAgICAgICAgLy8gSWdub3JlIGFic29sdXRlIFVSTHMKKyAgICAgICAgICB2YXIgcHJlZml4ID0gJyMnICsgaGFzaFByZWZpeDsKKyAgICAgICAgICBpZiAoaHJlZlswXSA9PSAnLycpIHsKKyAgICAgICAgICAgIC8vIGFic29sdXRlIHBhdGggLSByZXBsYWNlIG9sZCBwYXRoCisgICAgICAgICAgICBhYnNIcmVmID0gYXBwQmFzZSArIHByZWZpeCArIGhyZWY7CisgICAgICAgICAgfSBlbHNlIGlmIChocmVmWzBdID09ICcjJykgeworICAgICAgICAgICAgLy8gbG9jYWwgYW5jaG9yCisgICAgICAgICAgICBhYnNIcmVmID0gYXBwQmFzZSArIHByZWZpeCArICgkbG9jYXRpb24ucGF0aCgpIHx8ICcvJykgKyBocmVmOworICAgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICAvLyByZWxhdGl2ZSBwYXRoIC0gam9pbiB3aXRoIGN1cnJlbnQgcGF0aAorICAgICAgICAgICAgdmFyIHN0YWNrID0gJGxvY2F0aW9uLnBhdGgoKS5zcGxpdCgiLyIpLAorICAgICAgICAgICAgICBwYXJ0cyA9IGhyZWYuc3BsaXQoIi8iKTsKKyAgICAgICAgICAgIGlmIChzdGFjay5sZW5ndGggPT09IDIgJiYgIXN0YWNrWzFdKSBzdGFjay5sZW5ndGggPSAxOworICAgICAgICAgICAgZm9yICh2YXIgaT0wOyBpPHBhcnRzLmxlbmd0aDsgaSsrKSB7CisgICAgICAgICAgICAgIGlmIChwYXJ0c1tpXSA9PSAiLiIpCisgICAgICAgICAgICAgICAgY29udGludWU7CisgICAgICAgICAgICAgIGVsc2UgaWYgKHBhcnRzW2ldID09ICIuLiIpCisgICAgICAgICAgICAgICAgc3RhY2sucG9wKCk7CisgICAgICAgICAgICAgIGVsc2UgaWYgKHBhcnRzW2ldLmxlbmd0aCkKKyAgICAgICAgICAgICAgICBzdGFjay5wdXNoKHBhcnRzW2ldKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGFic0hyZWYgPSBhcHBCYXNlICsgcHJlZml4ICsgc3RhY2suam9pbignLycpOworICAgICAgICAgIH0KKyAgICAgICAgfQorICAgICAgfQorCisgICAgICB2YXIgcmV3cml0dGVuVXJsID0gJGxvY2F0aW9uLiQkcmV3cml0ZShhYnNIcmVmKTsKKworICAgICAgaWYgKGFic0hyZWYgJiYgIWVsbS5hdHRyKCd0YXJnZXQnKSAmJiByZXdyaXR0ZW5VcmwgJiYgIWV2ZW50LmlzRGVmYXVsdFByZXZlbnRlZCgpKSB7CisgICAgICAgIGV2ZW50LnByZXZlbnREZWZhdWx0KCk7CisgICAgICAgIGlmIChyZXdyaXR0ZW5VcmwgIT0gJGJyb3dzZXIudXJsKCkpIHsKKyAgICAgICAgICAvLyB1cGRhdGUgbG9jYXRpb24gbWFudWFsbHkKKyAgICAgICAgICAkbG9jYXRpb24uJCRwYXJzZShyZXdyaXR0ZW5VcmwpOworICAgICAgICAgICRyb290U2NvcGUuJGFwcGx5KCk7CisgICAgICAgICAgLy8gaGFjayB0byB3b3JrIGFyb3VuZCBGRjYgYnVnIDY4NDIwOCB3aGVuIHNjZW5hcmlvIHJ1bm5lciBjbGlja3Mgb24gbGlua3MKKyAgICAgICAgICB3aW5kb3cuYW5ndWxhclsnZmYtNjg0MjA4LXByZXZlbnREZWZhdWx0J10gPSB0cnVlOworICAgICAgICB9CisgICAgICB9CisgICAgfSk7CisKKworICAgIC8vIHJld3JpdGUgaGFzaGJhbmcgdXJsIDw+IGh0bWw1IHVybAorICAgIGlmICgkbG9jYXRpb24uYWJzVXJsKCkgIT0gaW5pdGlhbFVybCkgeworICAgICAgJGJyb3dzZXIudXJsKCRsb2NhdGlvbi5hYnNVcmwoKSwgdHJ1ZSk7CisgICAgfQorCisgICAgLy8gdXBkYXRlICRsb2NhdGlvbiB3aGVuICRicm93c2VyIHVybCBjaGFuZ2VzCisgICAgJGJyb3dzZXIub25VcmxDaGFuZ2UoZnVuY3Rpb24obmV3VXJsKSB7CisgICAgICBpZiAoJGxvY2F0aW9uLmFic1VybCgpICE9IG5ld1VybCkgeworICAgICAgICAkcm9vdFNjb3BlLiRldmFsQXN5bmMoZnVuY3Rpb24oKSB7CisgICAgICAgICAgdmFyIG9sZFVybCA9ICRsb2NhdGlvbi5hYnNVcmwoKTsKKworICAgICAgICAgICRsb2NhdGlvbi4kJHBhcnNlKG5ld1VybCk7CisgICAgICAgICAgaWYgKCRyb290U2NvcGUuJGJyb2FkY2FzdCgnJGxvY2F0aW9uQ2hhbmdlU3RhcnQnLCBuZXdVcmwsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBvbGRVcmwpLmRlZmF1bHRQcmV2ZW50ZWQpIHsKKyAgICAgICAgICAgICRsb2NhdGlvbi4kJHBhcnNlKG9sZFVybCk7CisgICAgICAgICAgICAkYnJvd3Nlci51cmwob2xkVXJsKTsKKyAgICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgYWZ0ZXJMb2NhdGlvbkNoYW5nZShvbGRVcmwpOworICAgICAgICAgIH0KKyAgICAgICAgfSk7CisgICAgICAgIGlmICghJHJvb3RTY29wZS4kJHBoYXNlKSAkcm9vdFNjb3BlLiRkaWdlc3QoKTsKKyAgICAgIH0KKyAgICB9KTsKKworICAgIC8vIHVwZGF0ZSBicm93c2VyCisgICAgdmFyIGNoYW5nZUNvdW50ZXIgPSAwOworICAgICRyb290U2NvcGUuJHdhdGNoKGZ1bmN0aW9uICRsb2NhdGlvbldhdGNoKCkgeworICAgICAgdmFyIG9sZFVybCA9ICRicm93c2VyLnVybCgpOworICAgICAgdmFyIGN1cnJlbnRSZXBsYWNlID0gJGxvY2F0aW9uLiQkcmVwbGFjZTsKKworICAgICAgaWYgKCFjaGFuZ2VDb3VudGVyIHx8IG9sZFVybCAhPSAkbG9jYXRpb24uYWJzVXJsKCkpIHsKKyAgICAgICAgY2hhbmdlQ291bnRlcisrOworICAgICAgICAkcm9vdFNjb3BlLiRldmFsQXN5bmMoZnVuY3Rpb24oKSB7CisgICAgICAgICAgaWYgKCRyb290U2NvcGUuJGJyb2FkY2FzdCgnJGxvY2F0aW9uQ2hhbmdlU3RhcnQnLCAkbG9jYXRpb24uYWJzVXJsKCksIG9sZFVybCkuCisgICAgICAgICAgICAgIGRlZmF1bHRQcmV2ZW50ZWQpIHsKKyAgICAgICAgICAgICRsb2NhdGlvbi4kJHBhcnNlKG9sZFVybCk7CisgICAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgICRicm93c2VyLnVybCgkbG9jYXRpb24uYWJzVXJsKCksIG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ZGVyCisgKiBAZGVzY3JpcHRpb24KKyAqIFVzZSB0aGUgYCRsb2dQcm92aWRlcmAgdG8gY29uZmlndXJlIGhvdyB0aGUgYXBwbGljYXRpb24gbG9ncyBtZXNzYWdlcworICovCitmdW5jdGlvbiAkTG9nUHJvdmlkZXIoKXsKKyAgdmFyIGRlYnVnID0gdHJ1ZSwKKyAgICAgIHNlbGYgPSB0aGlzOworCisgIC8qKgorICAgKiBAbmdkb2MgbWV0aG9kCisgICAqIEBuYW1lICRsb2dQcm92aWRlciNkZWJ1Z0VuYWJsZWQKKyAgICogQGRlc2NyaXB0aW9uCisgICAqIEBwYXJhbSB7Ym9vbGVhbj19IGZsYWcgZW5hYmxlIG9yIGRpc2FibGUgZGVidWcgbGV2ZWwgbWVzc2FnZXMKKyAgICogQHJldHVybnMgeyp9IGN1cnJlbnQgdmFsdWUgaWYgdXNlZCBhcyBnZXR0ZXIgb3IgaXRzZWxmIChjaGFpbmluZykgaWYgdXNlZCBhcyBzZXR0ZXIKKyAgICovCisgIHRoaXMuZGVidWdFbmFibGVkID0gZnVuY3Rpb24oZmxhZykgeworICAgIGlmIChpc0RlZmluZWQoZmxhZykpIHsKKyAgICAgIGRlYnVnID0gZmxhZzsKKyAgICByZXR1cm4gdGhpczsKKyAgICB9IGVsc2UgeworICAgICAgcmV0dXJuIGRlYnVnOworICAgIH0KKyAgfTsKKworICB0aGlzLiRnZXQgPSBbJyR3aW5kb3cnLCBmdW5jdGlvbigkd2luZG93KXsKKyAgICByZXR1cm4geworICAgICAgLyoqCisgICAgICAgKiBAbmdkb2MgbWV0aG9kCisgICAgICAgKiBAbmFtZSAkbG9nI2xvZworICAgICAgICoKKyAgICAgICAqIEBkZXNjcmlwdGlvbgorICAgICAgICogV3JpdGUgYSBsb2cgbWVzc2FnZQorICAgICAgICovCisgICAgICBsb2c6IGNvbnNvbGVMb2coJ2xvZycpLAorCisgICAgICAvKioKKyAgICAgICAqIEBuZ2RvYyBtZXRob2QKKyAgICAgICAqIEBuYW1lICRsb2cjaW5mbworICAgICAgICoKKyAgICAgICAqIEBkZXNjcmlwdGlvbgorICAgICAgICogV3JpdGUgYW4gaW5mb3JtYXRpb24gbWVzc2FnZQorICAgICAgICovCisgICAgICBpbmZvOiBjb25zb2xlTG9nKCdpbmZvJyksCisKKyAgICAgIC8qKgorICAgICAgICogQG5nZG9jIG1ldGhvZAorICAgICAgICogQG5hbWUgJGxvZyN3YXJuCisgICAgICAgKgorICAgICAgICogQGRlc2NyaXB0aW9uCisgICAgICAgKiBXcml0ZSBhIHdhcm5pbmcgbWVzc2FnZQorICAgICAgICovCisgICAgICB3YXJuOiBjb25zb2xlTG9nKCd3YXJuJyksCisKKyAgICAgIC8qKgorICAgICAgICogQG5nZG9jIG1ldGhvZAorICAgICAgICogQG5hbWUgJGxvZyNlcnJvcgorICAgICAgICoKKyAgICAgICAqIEBkZXNjcmlwdGlvbgorICAgICAgICogV3JpdGUgYW4gZXJyb3IgbWVzc2FnZQorICAgICAgICovCisgICAgICBlcnJvcjogY29uc29sZUxvZygnZXJyb3InKSwKKworICAgICAgLyoqCisgICAgICAgKiBAbmdkb2MgbWV0aG9kCisgICAgICAgKiBAbmFtZSAkbG9nI2RlYnVnCisgICAgICAgKgorICAgICAgICogQGRlc2NyaXB0aW9uCisgICAgICAgKiBXcml0ZSBhIGRlYnVnIG1lc3NhZ2UKKyAgICAgICAqLworICAgICAgZGVidWc6IChmdW5jdGlvbiAoKSB7CisgICAgICAgIHZhciBmbiA9IGNvbnNvbGVMb2coJ2RlYnVnJyk7CisKKyAgICAgICAgcmV0dXJuIGZ1bmN0aW9uKCkgeworICAgICAgICAgIGlmIChkZWJ1ZykgeworICAgICAgICAgICAgZm4uYXBwbHkoc2VsZiwgYXJndW1lbnRzKTsKKyAgICAgICAgICB9CisgICAgICAgIH07CisgICAgICB9KCkpCisgICAgfTsKKworICAgIGZ1bmN0aW9uIGZvcm1hdEVycm9yKGFyZykgeworICAgICAgaWYgKGFyZyBpbnN0YW5jZW9mIEVycm9yKSB7CisgICAgICAgIGlmIChhcmcuc3RhY2spIHsKKyAgICAgICAgICBhcmcgPSAoYXJnLm1lc3NhZ2UgJiYgYXJnLnN0YWNrLmluZGV4T2YoYXJnLm1lc3NhZ2UpID09PSAtMSkKKyAgICAgICAgICAgICAgPyAnRXJyb3I6ICcgKyBhcmcubWVzc2FnZSArICdcbicgKyBhcmcuc3RhY2sKKyAgICAgICAgICAgICAgOiBhcmcuc3RhY2s7CisgICAgICAgIH0gZWxzZSBpZiAoYXJnLnNvdXJjZVVSTCkgeworICAgICAgICAgIGFyZyA9IGFyZy5tZXNzYWdlICsgJ1xuJyArIGFyZy5zb3VyY2VVUkwgKyAnOicgKyBhcmcubGluZTsKKyAgICAgICAgfQorICAgICAgfQorICAgICAgcmV0dXJuIGFyZzsKKyAgICB9CisKKyAgICBmdW5jdGlvbiBjb25zb2xlTG9nKHR5cGUpIHsKKyAgICAgIHZhciBjb25zb2xlID0gJHdpbmRvdy5jb25zb2xlIHx8IHt9LAorICAgICAgICAgIGxvZ0ZuID0gY29uc29sZVt0eXBlXSB8fCBjb25zb2xlLmxvZyB8fCBub29wLAorICAgICAgICAgIGhhc0FwcGx5ID0gZmFsc2U7CisKKyAgICAgIC8vIE5vdGU6IHJlYWRpbmcgbG9nRm4uYXBwbHkgdGhyb3dzIGFuIGVycm9yIGluIElFMTEgaW4gSUU4IGRvY3VtZW50IG1vZGUuCisgICAgICAvLyBUaGUgcmVhc29uIGJlaGluZCB0aGlzIGlzIHRoYXQgY29uc29sZS5sb2cgaGFzIHR5cGUgIm9iamVjdCIgaW4gSUU4Li4uCisgICAgICB0cnkgeworICAgICAgICBoYXNBcHBseSA9ICEhbG9nRm4uYXBwbHk7CisgICAgICB9IGNhdGNoIChlKSB7fQorCisgICAgICBpZiAoaGFzQXBwbHkpIHsKKyAgICAgICAgcmV0dXJuIGZ1bmN0aW9uKCkgeworICAgICAgICAgIHZhciBhcmdzID0gW107CisgICAgICAgICAgZm9yRWFj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AgZnVsbEV4cHJlc3Npb24pOworICAgIH0KKyAgfQorICByZXR1cm4gb2JqOworfQorCit2YXIgQ0FMTCA9IEZ1bmN0aW9uLnByb3RvdHlwZS5jYWxsOwordmFyIEFQUExZID0gRnVuY3Rpb24ucHJvdG90eXBlLmFwcGx5OwordmFyIEJJTkQgPSBGdW5jdGlvbi5wcm90b3R5cGUuYmluZDsKKworZnVuY3Rpb24gZW5zdXJlU2FmZUZ1bmN0aW9uKG9iaiwgZnVsbEV4cHJlc3Npb24pIHsKKyAgaWYgKG9iaikgeworICAgIGlmIChvYmouY29uc3RydWN0b3IgPT09IG9iaikgeworICAgICAgdGhyb3cgJHBhcnNlTWluRXJyKCdpc2VjZm4nLAorICAgICAgICAnUmVmZXJlbmNpbmcgRnVuY3Rpb24gaW4gQW5ndWxhciBleHByZXNzaW9ucyBpcyBkaXNhbGxvd2VkISBFeHByZXNzaW9uOiB7MH0nLAorICAgICAgICBmdWxsRXhwcmVzc2lvbik7CisgICAgfSBlbHNlIGlmIChvYmogPT09IENBTEwgfHwgb2JqID09PSBBUFBMWSB8fCAoQklORCAmJiBvYmogPT09IEJJTkQpKSB7CisgICAgICB0aHJvdyAkcGFyc2VNaW5FcnIoJ2lzZWNmZicsCisgICAgICAgICdSZWZlcmVuY2luZyBjYWxsLCBhcHBseSBvciBiaW5kIGluIEFuZ3VsYXIgZXhwcmVzc2lvbnMgaXMgZGlzYWxsb3dlZCEgRXhwcmVzc2lvbjogezB9JywKKyAgICAgICAgZnVsbEV4cHJlc3Npb24pOworICAgIH0KKyAgfQorfQorCit2YXIgT1BFUkFUT1JTID0geworICAgIC8qIGpzaGludCBiaXR3aXNlIDogZmFsc2UgKi8KKyAgICAnbnVsbCc6ZnVuY3Rpb24oKXtyZXR1cm4gbnVsbDt9LAorICAgICd0cnVlJzpmdW5jdGlvbigpe3JldHVybiB0cnVlO30sCisgICAgJ2ZhbHNlJzpmdW5jdGlvbigpe3JldHVybiBmYWxzZTt9LAorICAgIHVuZG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AgfSBlbHNlIGlmICh0aGlzLmlzTnVtYmVyKHRoaXMuY2gpIHx8IHRoaXMuaXMoJy4nKSAmJiB0aGlzLmlzTnVtYmVyKHRoaXMucGVlaygpKSkgeworICAgICAgICB0aGlzLnJlYWROdW1iZXIoKTsKKyAgICAgIH0gZWxzZSBpZiAodGhpcy5pc0lkZW50KHRoaXMuY2gpKSB7CisgICAgICAgIHRoaXMucmVhZElkZW50KCk7CisgICAgICB9IGVsc2UgaWYgKHRoaXMuaXMoJygpe31bXS4sOzo/JykpIHsKKyAgICAgICAgdGhpcy50b2tlbnMucHVzaCh7CisgICAgICAgICAgaW5kZXg6IHRoaXMuaW5kZXgsCisgICAgICAgICAgdGV4dDogdGhpcy5jaAorICAgICAgICB9KTsKKyAgICAgICAgdGhpcy5pbmRleCsrOworICAgICAgfSBlbHNlIGlmICh0aGlzLmlzV2hpdGVzcGFjZSh0aGlzLmNoKSkgeworICAgICAgICB0aGlzLmluZGV4Kys7CisgICAgICAgIGNvbnRpbnVlOworICAgICAgfSBlbHNlIHsKKyAgICAgICAgdmFyIGNoMiA9IHRoaXMuY2ggKyB0aGlzLnBlZWsoKTsKKyAgICAgICAgdmFyIGNoMyA9IGNoMiArIHRoaXMucGVlaygyKTsKKyAgICAgICAgdmFyIGZuID0gT1BFUkFUT1JTW3RoaXMuY2hdOworICAgICAgICB2YXIgZm4yID0gT1BFUkFUT1JTW2NoMl07CisgICAgICAgIHZhciBmbjMgPSBPUEVSQVRPUlNbY2gzXTsKKyAgICAgICAgaWYgKGZuMykgeworICAgICAgICAgIHRoaXMudG9rZW5zLnB1c2goe2luZGV4OiB0aGlzLmluZGV4LCB0ZXh0OiBjaDMsIGZuOiBmbjN9KTsKKyAgICAgICAgICB0aGlzLmluZGV4ICs9IDM7CisgICAgICAgIH0gZWxzZSBpZiAoZm4yKSB7CisgICAgICAgICAgdGhpcy50b2tlbnMucHVzaCh7aW5kZXg6IHRoaXMuaW5kZXgsIHRleHQ6IGNoMiwgZm46IGZuMn0pOworICAgICAgICAgIHRoaXMuaW5kZXggKz0gMjsKKyAgICAgICAgfSBlbHNlIGlmIChmbikgeworICAgICAgICAgIHRoaXMudG9rZW5zLnB1c2goeworICAgICAgICAgICAgaW5kZXg6IHRoaXMuaW5kZXgsCisgICAgICAgICAgICB0ZXh0OiB0aGlzLmNoLAorICAgICAgICAgICAgZm46IGZuCisgICAgICAgICAgfSk7CisgICAgICAgICAgdGhpcy5pbmRleCArPSAxOworICAgICAgICB9IGVsc2UgeworICAgICAgICAgIHRoaXMudGhyb3dFcnJvcignVW5leHBlY3RlZCBuZXh0IGNoYXJhY3RlciAnLCB0aGlzLmluZGV4LCB0aGlzLmluZGV4ICsgMSk7CisgICAgICAgIH0KKyAgICAgIH0KKyAgICAgIHRoaXMubGFzdENoID0gdGhpcy5jaDsKKyAgICB9CisgICAgcmV0dXJuIHRoaXMudG9rZW5zOworICB9LAorCisgIGlzOiBmdW5jdGlvbihjaGFycykgeworICAgIHJldHVybiBjaGFycy5pbmRleE9mKHRoaXMuY2gpICE9PSAtMTsKKyAgfSwKKworICB3YXM6IGZ1bmN0aW9uKGNoYXJzKSB7CisgICAgcmV0dXJuIGNoYXJzLmluZGV4T2YodGhpcy5sYXN0Q2gpICE9PSAtMTsKKyAgfSwKKworICBwZWVrOiBmdW5jdGlvbihpKSB7CisgICAgdmFyIG51bSA9IGkgfHwgMTsKKyAgICByZXR1cm4gKHRoaXMuaW5kZXggKyBudW0gPCB0aGlzLnRleHQubGVuZ3RoKSA/IHRoaXMudGV4dC5jaGFyQXQodGhpcy5pbmRleCArIG51bSkgOiBmYWxzZTsKKyAgfSwKKworICBpc051bWJlcjogZnVuY3Rpb24oY2gpIHsKKyAgICByZXR1cm4gKCcwJyA8PSBjaCAmJiBjaCA8PSAnOScpOworICB9LAorCisgIGlzV2hpdGVzcGFjZTogZnVuY3Rpb24oY2gpIHsKKyAgICAvLyBJRSB0cmVhdHMgbm9uLWJyZWFraW5nIHNwYWNlIGFzIFx1MDBBMAorICAgIHJldHVybiAoY2ggPT09ICcgJyB8fCBjaCA9PT0gJ1xyJyB8fCBjaCA9PT0gJ1x0JyB8fAorICAgICAgICAgICAgY2ggPT09ICdcbicgfHwgY2ggPT09ICdcdicgfHwgY2ggPT09ICdcdTAwQTAnKTsKKyAgfSwKKworICBpc0lkZW50OiBmdW5jdGlvbihjaCkgeworICAgIHJldHVybiAoJ2EnIDw9IGNoICYmIGNoIDw9ICd6JyB8fAorICAgICAgICAgICAgJ0EnIDw9IGNoICYmIGNoIDw9ICdaJyB8fAorICAgICAgICAgICAgJ18nID09PSBjaCB8fCBjaCA9PT0gJyQnKTsKKyAgfSwKKworICBpc0V4cE9wZXJhdG9yOiBmdW5jdGlvbihjaCkgeworICAgIHJldHVybiAoY2ggPT09ICctJyB8fCBjaCA9PT0gJysnIHx8IHRoaXMuaXNOdW1iZXIoY2gpKTsKKyAgfSwKKworICB0aHJvd0Vycm9yOiBmdW5jdGlvbihlcnJvciwgc3RhcnQsIGVuZCkgeworICAgIGVuZCA9IGVuZCB8fCB0aGlzLmluZGV4OworICAgIHZhciBjb2xTdHIgPSAoaXNEZWZpbmVkKHN0YXJ0KQorICAgICAgICAgICAgPyAncyAnICsgc3RhcnQgKyAgJy0nICsgdGhpcy5pbmRleCArICcgWycgKyB0aGlzLnRleHQuc3Vic3RyaW5nKHN0YXJ0LCBlbmQpICsgJ10nCisgICAgICAgICAgICA6ICcgJyArIGVuZCk7CisgICAgdGhyb3cgJHBhcnNlTWluRXJyKCdsZXhlcnInLCAnTGV4ZXIgRXJyb3I6IHswfSBhdCBjb2x1bW57MX0gaW4gZXhwcmVzc2lvbiBbezJ9XS4nLAorICAgICAgICBlcnJvciwgY29sU3RyLCB0aGlzLnRleHQpOworICB9LAorCisgIHJlYWROdW1iZXI6IGZ1bmN0aW9uKCkgeworICAgIHZhciBudW1iZXIgPSAnJzsKKyAgICB2YXIgc3RhcnQgPSB0aGlzLmluZGV4OworICAgIHdoaWxlICh0aGlzLmluZGV4IDwgdGhpcy50ZXh0Lmxlbmd0aCkgeworICAgICAgdmFyIGNoID0gbG93ZXJjYXNlKHRoaXMudGV4dC5jaGFyQXQodGhpcy5pbmRleCkpOworICAgICAgaWYgKGNoID09ICcuJyB8fCB0aGlzLmlzTnVtYmVyKGNoKSkgeworICAgICAgICBudW1iZXIgKz0gY2g7CisgICAgICB9IGVsc2UgeworICAgICAgICB2YXIgcGVla0NoID0gdGhpcy5wZWVrKCk7CisgICAgICAgIGlmIChjaCA9PSAnZScgJiYgdGhpcy5pc0V4cE9wZXJhdG9yKHBlZWtDaCkpIHsKKyAgICAgICAgICBudW1iZXIgKz0gY2g7CisgICAgICAgIH0gZWxzZSBpZiAodGhpcy5pc0V4cE9wZXJhdG9yKGNoKSAmJgorICAgICAgICAgICAgcGVla0NoICYmIHRoaXMuaXNOdW1iZXIocGVla0NoKSAmJgorICAgICAgICAgICAgbnVtYmVyLmNoYXJBdChudW1iZXIubGVuZ3RoIC0gMSkgPT0gJ2UnKSB7CisgICAgICAgICAgbnVtYmVyICs9IGNoOworICAgICAgICB9IGVsc2UgaWYgKHRoaXMuaXNFeHBPcGVyYXRvcihjaCkgJiYKKyAgICAgICAgICAgICghcGVla0NoIHx8ICF0aGlzLmlzTnVtYmVyKHBlZWtDaCkpICYmCisgICAgICAgICAgICBudW1iZXIuY2hhckF0KG51bWJlci5sZW5ndGggLSAxKSA9PSAnZScpIHsKKyAgICAgICAgICB0aGlzLnRocm93RXJyb3IoJ0ludmFsaWQgZXhwb25lbnQnKTsKKyAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICBicmVhazsKKyAgICAgICAgfQorICAgICAgfQorICAgICAgdGhpcy5pbmRleCsrOworICAgIH0KKyAgICBudW1iZXIgPSAxICogbnVtYmVyOworICAgIHRoaXMudG9rZW5zLnB1c2goeworICAgICAgaW5kZXg6IHN0YXJ0LAorICAgICAgdGV4dDogbnVtYmVyLAorICAgICAgbGl0ZXJhbDogdHJ1ZSwKKyAgICAgIGNvbnN0YW50OiB0cnVlLAorICAgICAgZm46IGZ1bmN0aW9uKCkgeyByZXR1cm4gbnVtYmVyOyB9CisgICAgfSk7CisgIH0sCisKKyAgcmVhZElkZW50OiBmdW5jdGlvbigpIHsKKyAgICB2YXIgcGFyc2VyID0gdGhpczsKKworICAgIHZhciBpZGVudCA9ICcnOworICAgIHZhciBzdGFydCA9IHRoaXMuaW5kZXg7CisKKyAgICB2YXIgbGFzdERvdCwgcGVla0luZGV4LCBtZXRob2ROYW1lLCBjaDsKKworICAgIHdoaWxlICh0aGlzLmluZGV4IDwgdGhpcy50ZXh0Lmxlbmd0aCkgeworICAgICAgY2ggPSB0aGlzLnRleHQuY2hhckF0KHRoaXMuaW5kZXgpOworICAgICAgaWYgKGNoID09PSAnLicgfHwgdGhpcy5pc0lkZW50KGNoKSB8fCB0aGlzLmlzTnVtYmVyKGNoKSkgeworICAgICAgICBpZiAoY2ggPT09ICcuJykgbGFzdERvdCA9IHRoaXMuaW5kZXg7CisgICAgICAgIGlkZW50ICs9IGNoOworICAgICAgfSBlbHNlIHsKKyAgICAgICAgYnJlYWs7CisgICAgICB9CisgICAgICB0aGlzLmluZGV4Kys7CisgICAgfQorCisgICAgLy9jaGVjayBpZiB0aGlzIGlzIG5vdCBhIG1ldGhvZCBpbnZvY2F0aW9uIGFuZCBpZiBpdCBpcyBiYWNrIG91dCB0byBsYXN0IGRvdAorICAgIGlmIChsYXN0RG90KSB7CisgICAgICBwZWVrSW5kZXggPSB0aGlzLmluZGV4OworICAgICAgd2hpbGUgKHBlZWtJbmRleCA8IHRoaXMudGV4dC5sZW5ndGgpIHsKKyAgICAgICAgY2ggPSB0aGlzLnRleHQuY2hhckF0KHBlZWtJbmRleCk7CisgICAgICAgIGlmIChjaCA9PT0gJygnKSB7CisgICAgICAgICAgbWV0aG9kTmFtZSA9IGlkZW50LnN1YnN0cihsYXN0RG90IC0gc3RhcnQgKyAxKTsKKyAgICAgICAgICBpZGVudCA9IGlkZW50LnN1YnN0cigwLCBsYXN0RG90IC0gc3RhcnQpOworICAgICAgICAgIHRoaXMuaW5kZXggPSBwZWVrSW5kZXg7CisgICAgICAgICAgYnJlYWs7CisgICAgICAgIH0KKyAgICAgICAgaWYgKHRoaXMuaXNXaGl0ZXNwYWNlKGNoKSkgeworICAgICAgICAgIHBlZWtJbmRleCsrOworICAgICAgICB9IGVsc2UgeworICAgICAgICAgIGJyZWFrOworICAgICAgICB9CisgICAgICB9CisgICAgfQorCisKKyAgICB2YXIgdG9rZW4gPSB7CisgICAgICBpbmRleDogc3RhcnQsCisgICAgICB0ZXh0OiBpZGVudAorICAgIH07CisKKyAgICAvLyBPUEVSQVRPUlMgaXMgb3VyIG93biBvYmplY3Qgc28gd2UgZG9uJ3QgbmVlZCB0byB1c2Ugc3BlY2lhbCBoYXNPd25Qcm9wZXJ0eUZuCisgICAgaWYgKE9QRVJBVE9SUy5oYXNPd25Qcm9wZXJ0eShpZGVudCkpIHsKKyAgICAgIHRva2VuLmZuID0gT1BFUkFUT1JTW2lkZW50XTsKKyAgICAgIHRva2VuLmxpdGVyYWwgPSB0cnVlOworICAgICAgdG9rZW4uY29uc3RhbnQgPSB0cnVlOworICAgIH0gZWxzZSB7CisgICAgICB2YXIgZ2V0dGVyID0gZ2V0dGVyRm4oaWRlbnQsIHRoaXMub3B0aW9ucywgdGhpcy50ZXh0KTsKKyAgICAgIHRva2VuLmZuID0gZXh0ZW5kKGZ1bmN0aW9uKHNlbGYsIGxvY2FscykgeworICAgICAgICByZXR1cm4gKGdldHRlcihzZWxmLCBsb2NhbHMpKTsKKyAgICAgIH0sIHsKKyAgICAgICAgYXNzaWduOiBmdW5jdGlvbihzZWxmLCB2YWx1ZSkgeworICAgICAgICAgIHJldHVybiBzZXR0ZXIoc2VsZiwgaWRlbnQsIHZhbHVlLCBwYXJzZXIudGV4dCwgcGFyc2VyLm9wdGlvbnMpOworICAgICAgICB9CisgICAgICB9KTsKKyAgICB9CisKKyAgICB0aGlzLnRva2Vucy5wdXNoKHRva2VuKTsKKworICAgIGlmIChtZXRob2ROYW1lKSB7CisgICAgICB0aGlzLnRva2Vucy5wdXNoKHsKKyAgICAgICAgaW5kZXg6bGFzdERvdCwKKyAgICAgICAgdGV4dDogJy4nCisgICAgICB9KTsKKyAgICAgIHRoaXMudG9rZW5zLnB1c2goeworICAgICAgICBpbmRleDogbGFzdERvdCArIDEsCisgICAgICAgIHRleHQ6IG1ldGhvZE5hbWUKKyAgICAgIH0pOworICAgIH0KKyAgfSwKKworICByZWFkU3RyaW5nOiBmdW5jdGlvbihxdW90ZSkgeworICAgIHZhciBzdGFydCA9IHRoaXMuaW5kZXg7CisgICAgdGhpcy5pbmRleCsrOworICAgIHZhciBzdHJpbmcgPSAnJzsKKyAgICB2YXIgcmF3U3RyaW5nID0gcXVvdGU7CisgICAgdmFyIGVzY2FwZSA9IGZhbHNlOworICAgIHdoaWxlICh0aGlzLmluZGV4IDwgdGhpcy50ZXh0Lmxlbmd0aCkgeworICAgICAgdmFyIGNoID0gdGhpcy50ZXh0LmNoYXJBdCh0aGlzLmluZGV4KTsKKyAgICAgIHJhd1N0cmluZyArPSBjaDsKKyAgICAgIGlmIChlc2NhcGUpIHsKKyAgICAgICAgaWYgKGNoID09PSAndScpIHsKKyAgICAgICAgICB2YXIgaGV4ID0gdGhpcy50ZXh0LnN1YnN0cmluZyh0aGlzLmluZGV4ICsgMSwgdGhpcy5pbmRleCArIDUpOworICAgICAgICAgIGlmICghaGV4Lm1hdGNoKC9bXGRhLWZdezR9L2kpKQorICAgICAgICAgICAgdGhpcy50aHJvd0Vycm9yKCdJbnZhbGlkIHVuaWNvZGUgZXNjYXBlIFtcXHUnICsgaGV4ICsgJ10nKTsKKyAgICAgICAgICB0aGlzLmluZGV4ICs9IDQ7CisgICAgICAgICAgc3RyaW5nICs9IFN0cmluZy5mcm9tQ2hhckNvZGUocGFyc2VJbnQoaGV4LCAxNikpOworICAgICAgICB9IGVsc2UgeworICAgICAgICAgIHZhciByZXAgPSBFU0NBUEVbY2hdOworICAgICAgICAgIHN0cmluZyA9IHN0cmluZyArIChyZXAgfHwgY2gpOworICAgICAgICB9CisgICAgICAgIGVzY2FwZSA9IGZhbHNlOworICAgICAgfSBlbHNlIGlmIChjaCA9PT0gJ1xcJykgeworICAgICAgICBlc2NhcGUgPSB0cnVlOworICAgICAgfSBlbHNlIGlmIChjaCA9PT0gcXVvdGUpIHsKKyAgICAgICAgdGhpcy5pbmRleCsrOworICAgICAgICB0aGlzLnRva2Vucy5wdXNoKHsKKyAgICAgICAgICBpbmRleDogc3RhcnQsCisgICAgICAgICAgdGV4dDogcmF3U3RyaW5nLAorICAgICAgICAgIHN0cmluZzogc3RyaW5nLAorICAgICAgICAgIGxpdGVyYWw6IHRydWUsCisgICAgICAgICAgY29uc3RhbnQ6IHRydWUsCisgICAgICAgICAgZm46IGZ1bmN0aW9uKCkgeyByZXR1cm4gc3RyaW5nOyB9CisgICAgICAgIH0pOworICAgICAgICByZXR1cm47CisgICAgICB9IGVsc2UgeworICAgICAgICBzdHJpbmcgKz0gY2g7CisgICAgICB9CisgICAgICB0aGlzLmluZGV4Kys7CisgICAgfQorICAgIHRoaXMudGhyb3dFcnJvcignVW50ZXJtaW5hdGVkIHF1b3RlJywgc3RhcnQpOworICB9Cit9OworCisKKy8qKgorICogQGNvbnN0cnVjdG9yCisgKi8KK3ZhciBQYXJzZXIgPSBmdW5jdGlvbiAobGV4ZXIsICRmaWx0ZXIsIG9wdGlvbnMpIHsKKyAgdGhpcy5sZXhlciA9IGxleGVyOworICB0aGlzLiRmaWx0ZXIgPSAkZmlsdGVyOworICB0aGlzLm9wdGlvbnMgPSBvcHRpb25zOworfTsKKworUGFyc2VyLlpFUk8gPSBleHRlbmQoZnVuY3Rpb24gKCkgeworICByZXR1cm4gMDsKK30sIHsKKyAgY29uc3RhbnQ6IHRydWUKK30pOworCitQYXJzZXIucHJvdG90eXBlID0geworICBjb25zdHJ1Y3RvcjogUGFyc2VyLAorCisgIHBhcnNlOiBmdW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W1hcnkuY29uc3RhbnQgPSAhIXRva2VuLmNvbnN0YW50OworICAgIH0KKworICAgIHZhciBuZXh0LCBjb250ZXh0OworICAgIHdoaWxlICgobmV4dCA9IHRoaXMuZXhwZWN0KCcoJywgJ1snLCAnLicpKSkgeworICAgICAgaWYgKG5leHQudGV4dCA9PT0gJygnKSB7CisgICAgICAgIHByaW1hcnkgPSB0aGlzLmZ1bmN0aW9uQ2FsbChwcmltYXJ5LCBjb250ZXh0KTsKKyAgICAgICAgY29udGV4dCA9IG51bGw7CisgICAgICB9IGVsc2UgaWYgKG5leHQudGV4dCA9PT0gJ1snKSB7CisgICAgICAgIGNvbnRleHQgPSBwcmltYXJ5OworICAgICAgICBwcmltYXJ5ID0gdGhpcy5vYmplY3RJbmRleChwcmltYXJ5KTsKKyAgICAgIH0gZWxzZSBpZiAobmV4dC50ZXh0ID09PSAnLicpIHsKKyAgICAgICAgY29udGV4dCA9IHByaW1hcnk7CisgICAgICAgIHByaW1hcnkgPSB0aGlzLmZpZWxkQWNjZXNzKHByaW1hcnkpOworICAgICAgfSBlbHNlIHsKKyAgICAgICAgdGhpcy50aHJvd0Vycm9yKCdJTVBPU1NJQkxFJyk7CisgICAgICB9CisgICAgfQorICAgIHJldHVybiBwcmltYXJ5OworICB9LAorCisgIHRocm93RXJyb3I6IGZ1bmN0aW9uKG1zZywgdG9rZW4pIHsKKyAgICB0aHJvdyAkcGFyc2VNaW5FcnIoJ3N5bnRheCcsCisgICAgICAgICdTeW50YXggRXJyb3I6IFRva2VuIFwnezB9XCcgezF9IGF0IGNvbHVtbiB7Mn0gb2YgdGhlIGV4cHJlc3Npb24gW3szfV0gc3RhcnRpbmcgYXQgW3s0fV0uJywKKyAgICAgICAgICB0b2tlbi50ZXh0LCBtc2csICh0b2tlbi5pbmRleCArIDEpLCB0aGlzLnRleHQsIHRoaXMudGV4dC5zdWJzdHJpbmcodG9rZW4uaW5kZXgpKTsKKyAgfSwKKworICBwZWVrVG9rZW46IGZ1bmN0aW9uKCkgeworICAgIGlmICh0aGlzLnRva2Vucy5sZW5ndGggPT09IDApCisgICAgICB0aHJvdyAkcGFyc2VNaW5FcnIoJ3Vlb2UnLCAnVW5leHBlY3RlZCBlbmQgb2YgZXhwcmVzc2lvbjogezB9JywgdGhpcy50ZXh0KTsKKyAgICByZXR1cm4gdGhpcy50b2tlbnNbMF07CisgIH0sCisKKyAgcGVlazogZnVuY3Rpb24oZTEsIGUyLCBlMywgZTQpIHsKKyAgICBpZiAodGhpcy50b2tlbnMubGVuZ3RoID4gMCkgeworICAgICAgdmFyIHRva2VuID0gdGhpcy50b2tlbnNbMF07CisgICAgICB2YXIgdCA9IHRva2VuLnRleHQ7CisgICAgICBpZiAodCA9PT0gZTEgfHwgdCA9PT0gZTIgfHwgdCA9PT0gZTMgfHwgdCA9PT0gZTQgfHwKKyAgICAgICAgICAoIWUxICYmICFlMiAmJiAhZTMgJiYgIWU0KSkgeworICAgICAgICByZXR1cm4gdG9rZW47CisgICAgICB9CisgICAgfQorICAgIHJldHVybiBmYWxzZTsKKyAgfSwKKworICBleHBlY3Q6IGZ1bmN0aW9uKGUxLCBlMiwgZTMsIGU0KXsKKyAgICB2YXIgdG9rZW4gPSB0aGlzLnBlZWsoZTEsIGUyLCBlMywgZTQpOworICAgIGlmICh0b2tlbikgeworICAgICAgdGhpcy50b2tlbnMuc2hpZnQoKTsKKyAgICAgIHJldHVybiB0b2tlbjsKKyAgICB9CisgICAgcmV0dXJuIGZhbHNlOworICB9LAorCisgIGNvbnN1bWU6IGZ1bmN0aW9uKGUxKXsKKyAgICBpZiAoIXRoaXMuZXhwZWN0KGUxKSkgeworICAgICAgdGhpcy50aHJvd0Vycm9yKCdpcyB1bmV4cGVjdGVkLCBleHBlY3RpbmcgWycgKyBlMSArICddJywgdGhpcy5wZWVrKCkpOworICAgIH0KKyAgfSwKKworICB1bmFyeUZuOiBmdW5jdGlvbihmbiwgcmlnaHQpIHsKKyAgICByZXR1cm4gZXh0ZW5kKGZ1bmN0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Ugd2hlcmUgdGhlcmUgaXMgb25seSBvbmUgc3RhdGVtZW50LgorICAgICAgICAvLyBUT0RPKHNpemUpOiBtYXliZSB3ZSBzaG91bGQgbm90IHN1cHBvcnQgbXVsdGlwbGUgc3RhdGVtZW50cz8KKyAgICAgICAgcmV0dXJuIChzdGF0ZW1lbnRzLmxlbmd0aCA9PT0gMSkKKyAgICAgICAgICAgID8gc3RhdGVtZW50c1swXQorICAgICAgICAgICAgOiBmdW5jdGlvbihzZWxmLCBsb2NhbHMpIHsKKyAgICAgICAgICAgICAgICB2YXIgdmFsdWU7CisgICAgICAgICAgICAgICAgZm9yICh2YXIgaSA9IDA7IGkgPCBzdGF0ZW1lbnRzLmxlbmd0aDsgaSsrKSB7CisgICAgICAgICAgICAgICAgICB2YXIgc3RhdGVtZW50ID0gc3RhdGVtZW50c1tpXTsKKyAgICAgICAgICAgICAgICAgIGlmIChzdGF0ZW1lbnQpIHsKKyAgICAgICAgICAgICAgICAgICAgdmFsdWUgPSBzdGF0ZW1lbnQoc2VsZiwgbG9jYWxzKTsKKyAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgcmV0dXJuIHZhbHVlOworICAgICAgICAgICAgICB9OworICAgICAgfQorICAgIH0KKyAgfSwKKworICBmaWx0ZXJDaGFpbjogZnVuY3Rpb24oKSB7CisgICAgdmFyIGxlZnQgPSB0aGlzLmV4cHJlc3Npb24oKTsKKyAgICB2YXIgdG9rZW47CisgICAgd2hpbGUgKHRydWUpIHsKKyAgICAgIGlmICgodG9rZW4gPSB0aGlzLmV4cGVjdCgnfCcpKSkgeworICAgICAgICBsZWZ0ID0gdGhpcy5iaW5hcnlGbihsZWZ0LCB0b2tlbi5mbiwgdGhpcy5maWx0ZXIoKSk7CisgICAgICB9IGVsc2UgeworICAgICAgICByZXR1cm4gbGVmdDsKKyAgICAgIH0KKyAgICB9CisgIH0sCisKKyAgZmlsdGVyOiBmdW5jdGlvbigpIHsKKyAgICB2YXIgdG9rZW4gPSB0aGlzLmV4cGVjdCgpOworICAgIHZhciBmbiA9IHRoaXMuJGZpbHRlcih0b2tlbi50ZXh0KTsKKyAgICB2YXIgYXJnc0ZuID0gW107CisgICAgd2hpbGUgKHRydWUpIHsKKyAgICAgIGlmICgodG9rZW4gPSB0aGlzLmV4cGVjdCgnOicpKSkgeworICAgICAgICBhcmdzRm4ucHVzaCh0aGlzLmV4cHJlc3Npb24oKSk7CisgICAgICB9IGVsc2UgeworICAgICAgICB2YXIgZm5JbnZva2UgPSBmdW5jdGlvbihzZWxmLCBsb2NhbHMsIGlucHV0KSB7CisgICAgICAgICAgdmFyIGFyZ3MgPSBbaW5wdXRdOworICAgICAgICAgIGZvciAodmFyIGkgPSAwOyBpIDwgYXJnc0ZuLmxlbmd0aDsgaSsrKSB7CisgICAgICAgICAgICBhcmdzLnB1c2goYXJnc0ZuW2ldKHNlbGYsIGxvY2FscykpOworICAgICAgICAgIH0KKyAgICAgICAgICByZXR1cm4gZm4uYXBwbHkoc2VsZiwgYXJncyk7CisgICAgICAgIH07CisgICAgICAgIHJldHVybiBmdW5jdGlvbigpIHsKKyAgICAgICAgICByZXR1cm4gZm5JbnZva2U7CisgICAgICAgIH07CisgICAgICB9CisgICAgfQorICB9LAorCisgIGV4cHJlc3Npb246IGZ1bmN0aW9uKCkgeworICAgIHJldHVybiB0aGlzLmFzc2lnbm1lbnQoKTsKKyAgfSwKKworICBhc3NpZ25tZW50OiBmdW5jdGlvbigpIHsKKyAgICB2YXIgbGVmdCA9IHRoaXMudGVybmFyeSgpOworICAgIHZhciByaWdodDsKKyAgICB2YXIgdG9rZW47CisgICAgaWYgKCh0b2tlbiA9IHRoaXMuZXhwZWN0KCc9JykpKSB7CisgICAgICBpZiAoIWxlZnQuYXNzaWduKSB7CisgICAgICAgIHRoaXMudGhyb3dFcnJvcignaW1wbGllcyBhc3NpZ25tZW50IGJ1dCBbJyArCisgICAgICAgICAgICB0aGlzLnRleHQuc3Vic3R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bihmaWVsZCwgdGhpcy5vcHRpb25zLCB0aGlzLnRleHQpOworCisgICAgcmV0dXJuIGV4dGVuZChmdW5jdGlvbihzY29wZSwgbG9jYWxzLCBzZWxmKSB7CisgICAgICByZXR1cm4gZ2V0dGVyKHNlbGYgfHwgb2JqZWN0KHNjb3BlLCBsb2NhbHMpKTsKKyAgICB9LCB7CisgICAgICBhc3NpZ246IGZ1bmN0aW9uKHNjb3BlLCB2YWx1ZSwgbG9jYWxzKSB7CisgICAgICAgIHZhciBvID0gb2JqZWN0KHNjb3BlLCBsb2NhbHMpOworICAgICAgICBpZiAoIW8pIG9iamVjdC5hc3NpZ24oc2NvcGUsIG8gPSB7fSk7CisgICAgICAgIHJldHVybiBzZXR0ZXIobywgZmllbGQsIHZhbHVlLCBwYXJzZXIudGV4dCwgcGFyc2VyLm9wdGlvbnMpOworICAgICAgfQorICAgIH0pOworICB9LAorCisgIG9iamVjdEluZGV4OiBmdW5jdGlvbihvYmopIHsKKyAgICB2YXIgcGFyc2VyID0gdGhpczsKKworICAgIHZhciBpbmRleEZuID0gdGhpcy5leHByZXNzaW9uKCk7CisgICAgdGhpcy5jb25zdW1lKCddJyk7CisKKyAgICByZXR1cm4gZXh0ZW5kKGZ1bmN0aW9uKHNlbGYsIGxvY2FscykgeworICAgICAgdmFyIG8gPSBvYmooc2VsZiwgbG9jYWxzKSwKKyAgICAgICAgICBpID0gaW5kZXhGbihzZWxmLCBsb2NhbHMpLAorICAgICAgICAgIHYsIHA7CisKKyAgICAgIGVuc3VyZVNhZmVNZW1iZXJOYW1lKGksIHBhcnNlci50ZXh0KTsKKyAgICAgIGlmICghbykgcmV0dXJuIHVuZGVmaW5lZDsKKyAgICAgIHYgPSBlbnN1cmVTYWZlT2JqZWN0KG9baV0sIHBhcnNlci50ZXh0KTsKKyAgICAgIGlmICh2ICYmIHYudGhlbiAmJiBwYXJzZXIub3B0aW9ucy51bndyYXBQcm9taXNlcykgeworICAgICAgICBwID0gdjsKKyAgICAgICAgaWYgKCEoJyQkdicgaW4gdikpIHsKKyAgICAgICAgICBwLiQkdiA9IHVuZGVmaW5lZDsKKyAgICAgICAgICBwLnRoZW4oZnVuY3Rpb24odmFsKSB7IHAuJCR2ID0gdmFsOyB9KTsKKyAgICAgICAgfQorICAgICAgICB2ID0gdi4kJHY7CisgICAgICB9CisgICAgICByZXR1cm4gdjsKKyAgICB9LCB7CisgICAgICBhc3NpZ246IGZ1bmN0aW9uKHNlbGYsIHZhbHVlLCBsb2NhbHMpIHsKKyAgICAgICAgdmFyIGtleSA9IGVuc3VyZVNhZmVNZW1iZXJOYW1lKGluZGV4Rm4oc2VsZiwgbG9jYWxzKSwgcGFyc2VyLnRleHQpOworICAgICAgICAvLyBwcmV2ZW50IG92ZXJ3cml0aW5nIG9mIEZ1bmN0aW9uLmNvbnN0cnVjdG9yIHdoaWNoIHdvdWxkIGJyZWFrIGVuc3VyZVNhZmVPYmplY3QgY2hlY2sKKyAgICAgICAgdmFyIG8gPSBlbnN1cmVTYWZlT2JqZWN0KG9iaihzZWxmLCBsb2NhbHMpLCBwYXJzZXIudGV4dCk7CisgICAgICAgIGlmICghbykgb2JqLmFzc2lnbihzZWxmLCBvID0ge30pOworICAgICAgICByZXR1cm4gb1trZXldID0gdmFsdWU7CisgICAgICB9CisgICAgfSk7CisgIH0sCisKKyAgZnVuY3Rpb25DYWxsOiBmdW5jdGlvbihmbiwgY29udGV4dEdldHRlcikgeworICAgIHZhciBhcmdzRm4gPSBbXTsKKyAgICBpZiAodGhpcy5wZWVrVG9rZW4oKS50ZXh0ICE9PSAnKScpIHsKKyAgICAgIGRvIHsKKyAgICAgICAgYXJnc0ZuLnB1c2godGhpcy5leHByZXNzaW9uKCkpOworICAgICAgfSB3aGlsZSAodGhpcy5leHBlY3QoJywnKSk7CisgICAgfQorICAgIHRoaXMuY29uc3VtZSgnKScpOworCisgICAgdmFyIHBhcnNlciA9IHRoaXM7CisKKyAgICByZXR1cm4gZnVuY3Rpb24oc2NvcGUsIGxv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T0gJ10nKSB7CisgICAgICBkbyB7CisgICAgICAgIGlmICh0aGlzLnBlZWsoJ10nKSkgeworICAgICAgICAgIC8vIFN1cHBvcnQgdHJhaWxpbmcgY29tbWFzIHBlciBFUzUuMS4KKyAgICAgICAgICBicmVhazsKKyAgICAgICAgfQorICAgICAgICB2YXIgZWxlbWVudEZuID0gdGhpcy5leHByZXNzaW9uKCk7CisgICAgICAgIGVsZW1lbnRGbnMucHVzaChlbGVtZW50Rm4pOworICAgICAgICBpZiAoIWVsZW1lbnRGbi5jb25zdGFudCkgeworICAgICAgICAgIGFsbENvbnN0YW50ID0gZmFsc2U7CisgICAgICAgIH0KKyAgICAgIH0gd2hpbGUgKHRoaXMuZXhwZWN0KCcsJykpOworICAgIH0KKyAgICB0aGlzLmNvbnN1bWUoJ10nKTsKKworICAgIHJldHVybiBleHRlbmQoZnVuY3Rpb24oc2VsZiwgbG9jYWxzKSB7CisgICAgICB2YXIgYXJyYXkgPSBbXTsKKyAgICAgIGZvciAodmFyIGkgPSAwOyBpIDwgZWxlbWVudEZucy5sZW5ndGg7IGkrKykgeworICAgICAgICBhcnJheS5wdXNoKGVsZW1lbnRGbnNbaV0oc2VsZiwgbG9jYWxzKSk7CisgICAgICB9CisgICAgICByZXR1cm4gYXJyYXk7CisgICAgfSwgeworICAgICAgbGl0ZXJhbDogdHJ1ZSwKKyAgICAgIGNvbnN0YW50OiBhbGxDb25zdGFudAorICAgIH0pOworICB9LAorCisgIG9iamVjdDogZnVuY3Rpb24gKCkgeworICAgIHZhciBrZXlWYWx1ZXMgPSBbXTsKKyAgICB2YXIgYWxsQ29uc3RhbnQgPSB0cnVlOworICAgIGlmICh0aGlzLnBlZWtUb2tlbigpLnRleHQgIT09ICd9JykgeworICAgICAgZG8geworICAgICAgICBpZiAodGhpcy5wZWVrKCd9JykpIHsKKyAgICAgICAgICAvLyBTdXBwb3J0IHRyYWlsaW5nIGNvbW1hcyBwZXIgRVM1LjEuCisgICAgICAgICAgYnJlYWs7CisgICAgICAgIH0KKyAgICAgICAgdmFyIHRva2VuID0gdGhpcy5leHBlY3QoKSwKKyAgICAgICAga2V5ID0gdG9rZW4uc3RyaW5nIHx8IHRva2VuLnRleHQ7CisgICAgICAgIHRoaXMuY29uc3VtZSgnOicpOworICAgICAgICB2YXIgdmFsdWUgPSB0aGlzLmV4cHJlc3Npb24oKTsKKyAgICAgICAga2V5VmFsdWVzLnB1c2goe2tleToga2V5LCB2YWx1ZTogdmFsdWV9KTsKKyAgICAgICAgaWYgKCF2YWx1ZS5jb25zdGFudCkgeworICAgICAgICAgIGFsbENvbnN0YW50ID0gZmFsc2U7CisgICAgICAgIH0KKyAgICAgIH0gd2hpbGUgKHRoaXMuZXhwZWN0KCcsJykpOworICAgIH0KKyAgICB0aGlzLmNvbnN1bWUoJ30nKTsKKworICAgIHJldHVybiBleHRlbmQoZnVuY3Rpb24oc2VsZiwgbG9jYWxzKSB7CisgICAgICB2YXIgb2JqZWN0ID0ge307CisgICAgICBmb3IgKHZhciBpID0gMDsgaSA8IGtleVZhbHVlcy5sZW5ndGg7IGkrKykgeworICAgICAgICB2YXIga2V5VmFsdWUgPSBrZXlWYWx1ZXNbaV07CisgICAgICAgIG9iamVjdFtrZXlWYWx1ZS5rZXldID0ga2V5VmFsdWUudmFsdWUoc2VsZiwgbG9jYWxzKTsKKyAgICAgIH0KKyAgICAgIHJldHVybiBvYmplY3Q7CisgICAgfSwgeworICAgICAgbGl0ZXJhbDogdHJ1ZSwKKyAgICAgIGNvbnN0YW50OiBhbGxDb25zdGFudAorICAgIH0pOworICB9Cit9OworCisKKy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vCisvLyBQYXJzZXIgaGVscGVyIGZ1bmN0aW9ucworLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8KKworZnVuY3Rpb24gc2V0dGVyKG9iaiwgcGF0aCwgc2V0VmFsdWUsIGZ1bGxFeHAsIG9wdGlvbnMpIHsKKyAgZW5zdXJlU2FmZU9iamVjdChvYmosIGZ1bGxFeHApOworCisgIC8vbmVlZGVkPworICBvcHRpb25zID0gb3B0aW9ucyB8fCB7fTsKKworICB2YXIgZWxlbWVudCA9IHBhdGguc3BsaXQoJy4nKSwga2V5OworICBmb3IgKHZhciBpID0gMDsgZWxlbWVudC5sZW5ndGggPiAxOyBpKyspIHsKKyAgICBrZXkgPSBlbnN1cmVTYWZlTWVtYmVyTmFtZShlbGVtZW50LnNoaWZ0KCksIGZ1bGxFeHApOworICAgIHZhciBwcm9wZXJ0eU9iaiA9IGVuc3VyZVNhZmVPYmplY3Qob2JqW2tleV0sIGZ1bGxFeHApOworICAgIGlmICghcHJvcGVydHlPYmopIHsKKyAgICAgIHByb3BlcnR5T2JqID0ge307CisgICAgICBvYmpba2V5XSA9IHByb3BlcnR5T2JqOworICAgIH0KKyAgICBvYmogPSBwcm9wZXJ0eU9iajsKKyAgICBpZiAob2JqLnRoZW4gJiYgb3B0aW9ucy51bndyYXBQcm9taXNlcykgeworICAgICAgcHJvbWlzZVdhcm5pbmcoZnVsbEV4cCk7CisgICAgICBpZiAoISgiJCR2IiBpbiBvYmopKSB7CisgICAgICAgIChmdW5jdGlvbihwcm9taXNlKSB7CisgICAgICAgICAgcHJvbWlzZS50aGVuKGZ1bmN0aW9uKHZhbCkgeyBwcm9taXNlLiQkdiA9IHZhbDsgfSk7IH0KKyAgICAgICAgKShvYmopOworICAgICAgfQorICAgICAgaWYgKG9iai4kJHYgPT09IHVuZGVmaW5lZCkgeworICAgICAgICBvYmouJCR2ID0ge307CisgICAgICB9CisgICAgICBvYmogPSBvYmouJCR2OworICAgIH0KKyAgfQorICBrZXkgPSBlbnN1cmVTYWZlTWVtYmVyTmFtZShlbGVtZW50LnNoaWZ0KCksIGZ1bGxFeHApOworICBlbnN1cmVTYWZlT2JqZWN0KG9ialtrZXldLCBmdWxsRXhwKTsKKyA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wgPT0gbnVsbCkgcmV0dXJuIHVuZGVmaW5lZDsKKyAgICAgICAgICBwYXRoVmFsID0gcGF0aFZhbFtrZXkxXTsKKworICAgICAgICAgIGlmICgha2V5MikgcmV0dXJuIHBhdGhWYWw7CisgICAgICAgICAgaWYgKHBhdGhWYWwgPT0gbnVsbCkgcmV0dXJuIHVuZGVmaW5lZDsKKyAgICAgICAgICBwYXRoVmFsID0gcGF0aFZhbFtrZXkyXTsKKworICAgICAgICAgIGlmICgha2V5MykgcmV0dXJuIHBhdGhWYWw7CisgICAgICAgICAgaWYgKHBhdGhWYWwgPT0gbnVsbCkgcmV0dXJuIHVuZGVmaW5lZDsKKyAgICAgICAgICBwYXRoVmFsID0gcGF0aFZhbFtrZXkzXTsKKworICAgICAgICAgIGlmICgha2V5NCkgcmV0dXJuIHBhdGhWYWw7CisgICAgICAgICAgaWYgKHBhdGhWYWwgPT0gbnVsbCkgcmV0dXJuIHVuZGVmaW5lZDsKKyAgICAgICAgICBwYXRoVmFsID0gcGF0aFZhbFtrZXk0XTsKKworICAgICAgICAgIHJldHVybiBwYXRoVmFsOworICAgICAgICB9CisgICAgICA6IGZ1bmN0aW9uIGNzcFNhZmVQcm9taXNlRW5hYmxlZEdldHRlcihzY29wZSwgbG9jYWxzKSB7CisgICAgICAgICAgdmFyIHBhdGhWYWwgPSAobG9jYWxzICYmIGxvY2Fscy5oYXNPd25Qcm9wZXJ0eShrZXkwKSkgPyBsb2NhbHMgOiBzY29wZSwKKyAgICAgICAgICAgICAgcHJvbWlzZTsKKworICAgICAgICAgIGlmIChwYXRoVmFsID09IG51bGwpIHJldHVybiBwYXRoVmFsOworCisgICAgICAgICAgcGF0aFZhbCA9IHBhdGhWYWxba2V5MF07CisgICAgICAgICAgaWYgKHBhdGhWYWwgJiYgcGF0aFZhbC50aGVuKSB7CisgICAgICAgICAgICBwcm9taXNlV2FybmluZyhmdWxsRXhwKTsKKyAgICAgICAgICAgIGlmICghKCIkJHYiIGluIHBhdGhWYWwpKSB7CisgICAgICAgICAgICAgIHByb21pc2UgPSBwYXRoVmFsOworICAgICAgICAgICAgICBwcm9taXNlLiQkdiA9IHVuZGVmaW5lZDsKKyAgICAgICAgICAgICAgcHJvbWlzZS50aGVuKGZ1bmN0aW9uKHZhbCkgeyBwcm9taXNlLiQkdiA9IHZhbDsgfSk7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBwYXRoVmFsID0gcGF0aFZhbC4kJHY7CisgICAgICAgICAgfQorCisgICAgICAgICAgaWYgKCFrZXkxKSByZXR1cm4gcGF0aFZhbDsKKyAgICAgICAgICBpZiAocGF0aFZhbCA9PSBudWxsKSByZXR1cm4gdW5kZWZpbmVkOworICAgICAgICAgIHBhdGhWYWwgPSBwYXRoVmFsW2tleTFdOworICAgICAgICAgIGlmIChwYXRoVmFsICYmIHBhdGhWYWwudGhlbikgeworICAgICAgICAgICAgcHJvbWlzZVdhcm5pbmcoZnVsbEV4cCk7CisgICAgICAgICAgICBpZiAoISgiJCR2IiBpbiBwYXRoVmFsKSkgeworICAgICAgICAgICAgICBwcm9taXNlID0gcGF0aFZhbDsKKyAgICAgICAgICAgICAgcHJvbWlzZS4kJHYgPSB1bmRlZmluZWQ7CisgICAgICAgICAgICAgIHByb21pc2UudGhlbihmdW5jdGlvbih2YWwpIHsgcHJvbWlzZS4kJHYgPSB2YWw7IH0pOworICAgICAgICAgICAgfQorICAgICAgICAgICAgcGF0aFZhbCA9IHBhdGhWYWwuJCR2OworICAgICAgICAgIH0KKworICAgICAgICAgIGlmICgha2V5MikgcmV0dXJuIHBhdGhWYWw7CisgICAgICAgICAgaWYgKHBhdGhWYWwgPT0gbnVsbCkgcmV0dXJuIHVuZGVmaW5lZDsKKyAgICAgICAgICBwYXRoVmFsID0gcGF0aFZhbFtrZXkyXTsKKyAgICAgICAgICBpZiAocGF0aFZhbCAmJiBwYXRoVmFsLnRoZW4pIHsKKyAgICAgICAgICAgIHByb21pc2VXYXJuaW5nKGZ1bGxFeHApOworICAgICAgICAgICAgaWYgKCEoIiQkdiIgaW4gcGF0aFZhbCkpIHsKKyAgICAgICAgICAgICAgcHJvbWlzZSA9IHBhdGhWYWw7CisgICAgICAgICAgICAgIHByb21pc2UuJCR2ID0gdW5kZWZpbmVkOworICAgICAgICAgICAgICBwcm9taXNlLnRoZW4oZnVuY3Rpb24odmFsKSB7IHByb21pc2UuJCR2ID0gdmFsOyB9KTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIHBhdGhWYWwgPSBwYXRoVmFsLiQkdjsKKyAgICAgICAgICB9CisKKyAgICAgICAgICBpZiAoIWtleTMpIHJldHVybiBwYXRoVmFsOworICAgICAgICAgIGlmIChwYXRoVmFsID09IG51bGwpIHJldHVybiB1bmRlZmluZWQ7CisgICAgICAgICAgcGF0aFZhbCA9IHBhdGhWYWxba2V5M107CisgICAgICAgICAgaWYgKHBhdGhWYWwgJiYgcGF0aFZhbC50aGVuKSB7CisgICAgICAgICAgICBwcm9taXNlV2FybmluZyhmdWxsRXhwKTsKKyAgICAgICAgICAgIGlmICghKCIkJHYiIGluIHBhdGhWYWwpKSB7CisgICAgICAgICAgICAgIHByb21pc2UgPSBwYXRoVmFsOworICAgICAgICAgICAgICBwcm9taXNlLiQkdiA9IHVuZGVmaW5lZDsKKyAgICAgICAgICAgICAgcHJvbWlzZS50aGVuKGZ1bmN0aW9uKHZhbCkgeyBwcm9taXNlLiQkdiA9IHZhbDsgfSk7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBwYXRoVmFsID0gcGF0aFZhbC4kJHY7CisgICAgICAgICAgfQorCisgICAgICAgICAgaWYgKCFrZXk0KSByZXR1cm4gcGF0aFZhbDsKKyAgICAgICAgICBpZiAocGF0aFZhbCA9PSBudWxsKSByZXR1cm4gdW5kZWZpbmVkOworICAgICAgICAgIHBhdGhWYWwgPSBwYXRoVmFsW2tleTRdOworICAgICAgICAgIGlmIChwYXRoVmFsICYmIHBhdGhWYWwudGhlbikgeworICAgICAgICAgICAgcHJvbWlzZVd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AgZm4gPSBjc3BTYWZlR2V0dGVyRm4ocGF0aEtleXNbMF0sIHBhdGhLZXlzWzFdLCBwYXRoS2V5c1syXSwgcGF0aEtleXNbM10sIHBhdGhLZXlzWzRdLCBmdWxsRXhwLAorICAgICAgICAgICAgICAgICAgICAgICAgICBvcHRpb25zKTsKKyAgICB9IGVsc2UgeworICAgICAgZm4gPSBmdW5jdGlvbihzY29wZSwgbG9jYWxzKSB7CisgICAgICAgIHZhciBpID0gMCwgdmFsOworICAgICAgICBkbyB7CisgICAgICAgICAgdmFsID0gY3NwU2FmZUdldHRlckZuKHBhdGhLZXlzW2krK10sIHBhdGhLZXlzW2krK10sIHBhdGhLZXlzW2krK10sIHBhdGhLZXlzW2krK10sCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBhdGhLZXlzW2krK10sIGZ1bGxFeHAsIG9wdGlvbnMpKHNjb3BlLCBsb2NhbHMpOworCisgICAgICAgICAgbG9jYWxzID0gdW5kZWZpbmVkOyAvLyBjbGVhciBhZnRlciBmaXJzdCBpdGVyYXRpb24KKyAgICAgICAgICBzY29wZSA9IHZhbDsKKyAgICAgICAgfSB3aGlsZSAoaSA8IHBhdGhLZXlzTGVuZ3RoKTsKKyAgICAgICAgcmV0dXJuIHZhbDsKKyAgICAgIH07CisgICAgfQorICB9IGVsc2UgeworICAgIHZhciBjb2RlID0gJ3ZhciBwO1xuJzsKKyAgICBmb3JFYWNoKHBhdGhLZXlzLCBmdW5jdGlvbihrZXksIGluZGV4KSB7CisgICAgICBlbnN1cmVTYWZlTWVtYmVyTmFtZShrZXksIGZ1bGxFeHApOworICAgICAgY29kZSArPSAnaWYocyA9PSBudWxsKSByZXR1cm4gdW5kZWZpbmVkO1xuJyArCisgICAgICAgICAgICAgICdzPScrIChpbmRleAorICAgICAgICAgICAgICAgICAgICAgIC8vIHdlIHNpbXBseSBkZXJlZmVyZW5jZSAncycgb24gYW55IC5kb3Qgbm90YXRpb24KKyAgICAgICAgICAgICAgICAgICAgICA/ICdzJworICAgICAgICAgICAgICAgICAgICAgIC8vIGJ1dCBpZiB3ZSBhcmUgZmlyc3QgdGhlbiB3ZSBjaGVjayBsb2NhbHMgZmlyc3QsIGFuZCBpZiBzbyByZWFkIGl0IGZpcnN0CisgICAgICAgICAgICAgICAgICAgICAgOiAnKChrJiZrLmhhc093blByb3BlcnR5KCInICsga2V5ICsgJyIpKT9rOnMpJykgKyAnWyInICsga2V5ICsgJyJdJyArICc7XG4nICsKKyAgICAgICAgICAgICAgKG9wdGlvbnMudW53cmFwUHJvbWlzZXMKKyAgICAgICAgICAgICAgICA/ICdpZiAocyAmJiBzLnRoZW4pIHtcbicgKworICAgICAgICAgICAgICAgICAgJyBwdygiJyArIGZ1bGxFeHAucmVwbGFjZSgvKFsiXHJcbl0pL2csICdcXCQxJykgKyAnIik7XG4nICsKKyAgICAgICAgICAgICAgICAgICcgaWYgKCEoIiQkdiIgaW4gcykpIHtcbicgKworICAgICAgICAgICAgICAgICAgICAnIHA9cztcbicgKworICAgICAgICAgICAgICAgICAgICAnIHAuJCR2ID0gdW5kZWZpbmVkO1xuJyArCisgICAgICAgICAgICAgICAgICAgICcgcC50aGVuKGZ1bmN0aW9uKHYpIHtwLiQkdj12O30pO1xuJyArCisgICAgICAgICAgICAgICAgICAgICd9XG4nICsKKyAgICAgICAgICAgICAgICAgICcgcz1zLiQkdlxuJyArCisgICAgICAgICAgICAgICAgJ31cbicKKyAgICAgICAgICAgICAgICA6ICcnKTsKKyAgICB9KTsKKyAgICBjb2RlICs9ICdyZXR1cm4gczsnOworCisgICAgLyoganNoaW50IC1XMDU0ICovCisgICAgdmFyIGV2YWxlZEZuR2V0dGVyID0gbmV3IEZ1bmN0aW9uKCdzJywgJ2snLCAncHcnLCBjb2RlKTsgLy8gcz1zY29wZSwgaz1sb2NhbHMsIHB3PXByb21pc2VXYXJuaW5nCisgICAgLyoganNoaW50ICtXMDU0ICovCisgICAgZXZhbGVkRm5HZXR0ZXIudG9TdHJpbmcgPSB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AuICcgKworICAgICAgICAgICdBdXRvbWF0aWMgdW53cmFwcGluZyBvZiBwcm9taXNlcyBpbiBBbmd1bGFyIGV4cHJlc3Npb25zIGlzIGRlcHJlY2F0ZWQuJyk7CisgICAgfTsKKworICAgIHJldHVybiBmdW5jdGlvbihleHApIHsKKyAgICAgIHZhciBwYXJzZWRFeHByZXNzaW9uOworCisgICAgICBzd2l0Y2ggKHR5cGVvZiBleHApIHsKKyAgICAgICAgY2FzZSAnc3RyaW5nJzoKKworICAgICAgICAgIGlmIChjYWNoZS5oYXNPd25Qcm9wZXJ0eShleHApKSB7CisgICAgICAgICAgICByZXR1cm4gY2FjaGVbZXhwXTsKKyAgICAgICAgICB9CisKKyAgICAgICAgICB2YXIgbGV4ZXIgPSBuZXcgTGV4ZXIoJHBhcnNlT3B0aW9ucyk7CisgICAgICAgICAgdmFyIHBhcnNlciA9IG5ldyBQYXJzZXIobGV4ZXIsICRmaWx0ZXIsICRwYXJzZU9wdGlvbnMpOworICAgICAgICAgIHBhcnNlZEV4cHJlc3Npb24gPSBwYXJzZXIucGFyc2UoZXhwKTsKKworICAgICAgICAgIGlmIChleHAgIT09ICdoYXNPd25Qcm9wZXJ0eScpIHsKKyAgICAgICAgICAgIC8vIE9ubHkgY2FjaGUgdGhlIHZhbHVlIGlmIGl0J3Mgbm90IGdvaW5nIHRvIG1lc3MgdXAgdGhlIGNhY2hlIG9iamVjdAorICAgICAgICAgICAgLy8gVGhpcyBpcyBtb3JlIHBlcmZvcm1hbnQgdGhhdCB1c2luZyBPYmplY3QucHJvdG90eXBlLmhhc093blByb3BlcnR5LmNhbGwKKyAgICAgICAgICAgIGNhY2hlW2V4cF0gPSBwYXJzZWRFeHByZXNzaW9uOworICAgICAgICAgIH0KKworICAgICAgICAgIHJldHVybiBwYXJzZWRFeHByZXNzaW9uOworCisgICAgICAgIGNhc2UgJ2Z1bmN0aW9uJzoKKyAgICAgICAgICByZXR1cm4gZXhwOworCisgICAgICAgIGRlZmF1bHQ6Cis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jb3BlYCBhbmQgYG9rVG9HcmVldGAKKyAqICAgLy8gYXJlIGF2YWlsYWJsZSBpbiB0aGUgY3VycmVudCBsZXhpY2FsIHNjb3BlICh0aGV5IGNvdWxkIGhhdmUgYmVlbiBpbmplY3RlZCBvciBwYXNzZWQgaW4pLgorICoKKyAqICAgZnVuY3Rpb24gYXN5bmNHcmVldChuYW1lKSB7CisgKiAgICAgdmFyIGRlZmVycmVkID0gJHEuZGVmZXIoKTsKKyAqCisgKiAgICAgc2V0VGltZW91dChmdW5jdGlvbigpIHsKKyAqICAgICAgIGRlZmVycmVkLm5vdGlmeSgnQWJvdXQgdG8gZ3JlZXQgJyArIG5hbWUgKyAnLicpOworICoKKyAqICAgICAgIGlmIChva1RvR3JlZXQobmFtZSkpIHsKKyAqICAgICAgICAgZGVmZXJyZWQucmVzb2x2ZSgnSGVsbG8sICcgKyBuYW1lICsgJyEnKTsKKyAqICAgICAgIH0gZWxzZSB7CisgKiAgICAgICAgIGRlZmVycmVkLnJlamVjdCgnR3JlZXRpbmcgJyArIG5hbWUgKyAnIGlzIG5vdCBhbGxvd2VkLicpOworICogICAgICAgfQorICogICAgIH0sIDEwMDApOworICoKKyAqICAgICByZXR1cm4gZGVmZXJyZWQucHJvbWlzZTsKKyAqICAgfQorICoKKyAqICAgdmFyIHByb21pc2UgPSBhc3luY0dyZWV0KCdSb2JpbiBIb29kJyk7CisgKiAgIHByb21pc2UudGhlbihmdW5jdGlvbihncmVldGluZykgeworICogICAgIGFsZXJ0KCdTdWNjZXNzOiAnICsgZ3JlZXRpbmcpOworICogICB9LCBmdW5jdGlvbihyZWFzb24pIHsKKyAqICAgICBhbGVydCgnRmFpbGVkOiAnICsgcmVhc29uKTsKKyAqICAgfSwgZnVuY3Rpb24odXBkYXRlKSB7CisgKiAgICAgYWxlcnQoJ0dvdCBub3RpZmljYXRpb246ICcgKyB1cGRhdGUpOworICogICB9KTsKKyAqIGBgYAorICoKKyAqIEF0IGZpcnN0IGl0IG1pZ2h0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ICB2YXIgcHJvbWlzZSA9IGRlZmVycmVkLnByb21pc2U7CisgKiAgICAgIHZhciByZXNvbHZlZFZhbHVlOworICoKKyAqICAgICAgcHJvbWlzZS50aGVuKGZ1bmN0aW9uKHZhbHVlKSB7IHJlc29sdmVkVmFsdWUgPSB2YWx1ZTsgfSk7CisgKiAgICAgIGV4cGVjdChyZXNvbHZlZFZhbHVlKS50b0JlVW5kZWZpbmVkKCk7CisgKgorICogICAgICAvLyBTaW11bGF0ZSByZXNvbHZpbmcgb2YgcHJvbWlzZQorICogICAgICBkZWZlcnJlZC5yZXNvbHZlKDEyMyk7CisgKiAgICAgIC8vIE5vdGUgdGhhdCB0aGUgJ3RoZW4nIGZ1bmN0aW9uIGRvZXMgbm90IGdldCBjYWxsZWQgc3luY2hyb25vdXNseS4KKyAqICAgICAgLy8gVGhpcyBpcyBiZWNhdXNlIHdlIHdhbnQgdGhlIHByb21pc2UgQVBJIHRvIGFsd2F5cyBiZSBhc3luYywgd2hldGhlciBvciBub3QKKyAqICAgICAgLy8gaXQgZ290IGNhbGxlZCBzeW5jaHJvbm91c2x5IG9yIGFzeW5jaHJvbm91c2x5LgorICogICAgICBleHBlY3QocmVzb2x2ZWRWYWx1ZSkudG9CZVVuZGVmaW5lZCgpOworICoKKyAqICAgICAgLy8gUHJvcGFnYXRlIHByb21pc2UgcmVzb2x1dGlvbiB0byAndGhlbicgZnVuY3Rpb25zIHVzaW5nICRhcHBseSgpLgorICogICAgICAkcm9vdFNjb3BlLiRhcHBseSgpOworICogICAgICBleHBlY3QocmVzb2x2ZWRWYWx1ZSkudG9FcXVhbCgxMjMpOworICogICAgfSkpOworICogIGBgYAorICovCitmdW5jdGlvbiAkUVByb3ZpZGVyKCkgeworCisgIHRoaXMuJGdldCA9IFsnJHJvb3RTY29wZScsICckZXhjZXB0aW9uSGFuZGxlcicsIGZ1bmN0aW9uKCRyb290U2NvcGUsICRleGNlcHRpb25IYW5kbGVyKSB7CisgICAgcmV0dXJuIHFGYWN0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CisgICAgICByZXNvbHZlOiBmdW5jdGlvbih2YWwpIHsKKyAgICAgICAgaWYgKHBlbmRpbmcpIHsKKyAgICAgICAgICB2YXIgY2FsbGJhY2tzID0gcGVuZGluZzsKKyAgICAgICAgICBwZW5kaW5nID0gdW5kZWZpbmVkOworICAgICAgICAgIHZhbHVlID0gcmVmKHZhbCk7CisKKyAgICAgICAgICBpZiAoY2FsbGJhY2tzLmxlbmd0aCkgeworICAgICAgICAgICAgbmV4dFRpY2soZnVuY3Rpb24oKSB7CisgICAgICAgICAgICAgIHZhciBjYWxsYmFjazsKKyAgICAgICAgICAgICAgZm9yICh2YXIgaSA9IDAsIGlpID0gY2FsbGJhY2tzLmxlbmd0aDsgaSA8IGlpOyBpKyspIHsKKyAgICAgICAgICAgICAgICBjYWxsYmFjayA9IGNhbGxiYWNrc1tpXTsKKyAgICAgICAgICAgICAgICB2YWx1ZS50aGVuKGNhbGxiYWNrWzBdLCBjYWxsYmFja1sxXSwgY2FsbGJhY2tbMl0pOworICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9KTsKKyAgICAgICAgICB9CisgICAgICAgIH0KKyAgICAgIH0sCisKKworICAgICAgcmVqZWN0OiBmdW5jdGlvbihyZWFzb24pIHsKKyAgICAgICAgZGVmZXJyZWQucmVzb2x2ZShjcmVhdGVJbnRlcm5hbFJlamVjdGVkUHJvbWlzZShyZWFzb24pKTsKKyAgICAgIH0sCisKKworICAgICAgbm90aWZ5OiBmdW5jdGlvbihwcm9ncmVzcykgeworICAgICAgICBpZiAocGVuZGluZykgeworICAgICAgICAgIHZhciBjYWxsYmFja3MgPSBwZW5kaW5nOworCisgICAgICAgICAgaWYgKHBlbmRpbmcubGVuZ3RoKSB7CisgICAgICAgICAgICBuZXh0VGljayhmdW5jdGlvbigpIHsKKyAgICAgICAgICAgICAgdmFyIGNhbGxiYWNrOworICAgICAgICAgICAgICBmb3IgKHZhciBpID0gMCwgaWkgPSBjYWxsYmFja3MubGVuZ3RoOyBpIDwgaWk7IGkrKykgeworICAgICAgICAgICAgICAgIGNhbGxiYWNrID0gY2FsbGJhY2tzW2ldOworICAgICAgICAgICAgICAgIGNhbGxiYWNrWzJdKHByb2dyZXNzKTsKKyAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfSk7CisgICAgICAgICAgfQorICAgICAgICB9CisgICAgICB9LAorCisKKyAgICAgIHByb21pc2U6IHsKKyAgICAgICAgdGhlbjogZnVuY3Rpb24oY2FsbGJhY2ssIGVycmJhY2ssIHByb2dyZXNzYmFjaykgeworICAgICAgICAgIHZhciByZXN1bHQgPSBkZWZlcigpOworCisgICAgICAgICAgdmFyIHdyYXBwZWRDYWxsYmFjayA9IGZ1bmN0aW9uKHZhbHVlKSB7CisgICAgICAgICAgICB0cnkgeworICAgICAgICAgICAgICByZXN1bHQucmVzb2x2ZSgoaXNGdW5jdGlvbihjYWxsYmFjaykgPyBjYWxsYmFjayA6IGRlZmF1bHRDYWxsYmFjaykodmFsdWUpKTsKKyAgICAgICAgICAgIH0gY2F0Y2goZSkgeworICAgICAgICAgICAgICByZXN1bHQucmVqZWN0KGUpOworICAgICAgICAgICAgICBleGNlcHRpb25IYW5kbGVyKGUpOworICAgICAgICAgICAgfQorICAgICAgICAgIH07CisKKyAgICAgICAgICB2YXIgd3JhcHBlZEVycmJhY2sgPSBmdW5jdGlvbihyZWFzb24pIHsKKyAgICAgICAgICAgIHRyeSB7CisgICAgICAgICAgICAgIHJlc3VsdC5yZXNvbHZlKChpc0Z1bmN0aW9uKGVycmJhY2spID8gZXJyYmFjayA6IGRlZmF1bHRFcnJiYWNrKShyZWFzb24pKTsKKyAgICAgICAgICAgIH0gY2F0Y2goZSkgeworICAgICAgICAgICAgICByZXN1bHQucmVqZWN0KGUpOworICAgICAgICAgICAgICBleGNlcHRpb25IYW5kbGVyKGUpOworICAgICAgICAgICAgfQorICAgICAgICAgIH07CisKKyAgICAgICAgICB2YXIgd3JhcHBlZFByb2dyZXNzYmFjayA9IGZ1bmN0aW9uKHByb2dyZXNzKSB7CisgICAgICAgICAgICB0cnkgeworICAgICAgICAgICAgICByZXN1bHQubm90aWZ5KChpc0Z1bmN0aW9uKHByb2dyZXNzYmFjaykgPyBwcm9ncmVzc2JhY2sgOiBkZWZhdWx0Q2FsbGJhY2spKHByb2dyZXNzKSk7CisgICAgICAgICAgICB9IGNhdGNoKGUpIHsKKyAgICAgICAgICAgICAgZXhjZXB0aW9uSGFuZGxlcihlKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICB9OworCisgICAgICAgICAgaWYgKHBlbmRpbmcpIHsKKyAgICAgICAgICAgIHBlbmRpbmcucHVzaChbd3JhcHBlZENhbGxiYWNrLCB3cmFwcGVkRXJyYmFjaywgd3JhcHBlZFByb2dyZXNzYmFja10pOworICAgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICB2YWx1ZS50aGVuKHdyYXBwZWRDYWxsYmFjaywgd3JhcHBlZEVycmJhY2ssIHdyYXBwZWRQcm9ncmVzc2JhY2spOworICAgICAgICAgIH0KKworICAgICAgICAgIHJldHVybiByZXN1bHQucHJvbWlzZTsKKyAgICAgICAgfSwKKworICAgICAgICAiY2F0Y2giOiBmdW5jdGlvbihjYWxsYmFjaykgeworICAgICAgICAgIHJldHVybiB0aGlzLnRoZW4obnVsbCwgY2FsbGJhY2spOworICAgICAgICB9LAorCisgICAgICAgICJmaW5hbGx5IjogZnVuY3Rpb24oY2FsbGJhY2spIHsKKworICAgICAgICAgIGZ1bmN0aW9uIG1ha2VQcm9taXNlKHZhbHVlLCByZXNvbHZlZCkgeworICAgICAgICAgICAgdmFyIHJlc3VsdCA9IGRlZmVyKCk7CisgICAgICAgICAgICBpZiAocmVzb2x2ZWQpIHsKKyAgICAgICAgICAgICAgcmVzdWx0LnJlc29sdmUodmFsdWUpOworICAgICAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgICAgcmVzdWx0LnJlamVjdCh2YWx1ZSk7CisgICAgICAgICAgICB9CisgICAgICAgICAgICByZXR1cm4gcmVzdWx0LnByb21pc2U7CisgICAgICAgICAgfQorCisgICAgICAgICAgZnVuY3Rpb24gaGFuZGxlQ2FsbGJhY2sodmFsdWUsIGlzUmVzb2x2ZWQpIHsKKyAgICAgICAgICAgIHZhciBjYWxsYmFja091dHB1dCA9IG51bGw7CisgICAgICAgICAgICB0cnkgeworICAgICAgICAgICAgICBjYWxsYmFja091dHB1dCA9IChjYWxsYmFjayB8fGRlZmF1bHRDYWxsYmFjaykoKTsKKyAgICAgICAgICAgIH0gY2F0Y2goZSkgeworICAgICAgICAgICAgICByZXR1cm4gbWFrZVByb21pc2UoZSwgZmFsc2UpOworICAgICAgICAgICAgfQorICAgICAgICAgICAgaWYgKGlzUHJvbWlzZUxpa2UoY2FsbGJhY2tPdXRwdXQpKSB7CisgICAgICAgICAgICAgIHJldHVybiBjYWxsYmFja091dHB1dC50aGVuKGZ1bmN0aW9uKCkgeworICAgICAgICAgICAgICAgIHJldHVybiBtYWtlUHJvbWlzZSh2YWx1ZSwgaXNSZXNvbHZlZCk7CisgICAgICAgICAgICAgIH0sIGZ1bmN0aW9uKGVycm9yKSB7CisgICAgICAgICAgICAgICAgcmV0dXJuIG1ha2VQcm9taXNlKGVycm9yLCBmYWxzZSk7CisgICAgICAgICAgICAgIH0pOworICAgICAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgICAgcmV0dXJuIG1ha2VQcm9taXNlKHZhbHVlLCBpc1Jlc29sdmVkKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICB9CisKKyAgICAgICAgICByZXR1cm4gdGhpcy50aGVuKGZ1bmN0aW9uKHZhbHVlKSB7CisgICAgICAgICAgICByZXR1cm4gaGFuZGxlQ2FsbGJhY2sodmFsdWUsIHRydWUpOworICAgICAgICAgIH0sIGZ1bmN0aW9uKGVycm9yKSB7CisgICAgICAgICAgICByZXR1cm4gaGFuZGxlQ2FsbGJhY2soZXJyb3IsIGZhbHNlKTsKKyAgICAgICAgICB9KTsKKyAgICAgICAgfQorIC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4gSmF2YVNjcmlwdC4gVGhpcyBhbHNvIG1lYW5zIHRoYXQgaWYgeW91ICJjYXRjaCIgYW4gZXJyb3IgdmlhCisgICAqIGEgcHJvbWlzZSBlcnJvciBjYWxsYmFjayBhbmQgeW91IHdhbnQgdG8gZm9yd2FyZCB0aGUgZXJyb3IgdG8gdGhlIHByb21pc2UgZGVyaXZlZCBmcm9tIHRoZQorICAgKiBjdXJyZW50IHByb21pc2UsIHlvdSBoYXZlIHRvICJyZXRocm93IiB0aGUgZXJyb3IgYnkgcmV0dXJuaW5nIGEgcmVqZWN0aW9uIGNvbnN0cnVjdGVkIHZpYQorICAgKiBgcmVqZWN0YC4KKyAgICoKKyAgICogYGBganMKKyAgICogICBwcm9taXNlQiA9IHByb21pc2VBLnRoZW4oZnVuY3Rpb24ocmVzdWx0KSB7CisgICAqICAgICAvLyBzdWNjZXNzOiBkbyBzb21ldGhpbmcgYW5kIHJlc29sdmUgcHJvbWlzZUIKKyAgICogICAgIC8vICAgICAgICAgIHdpdGggdGhlIG9sZCBvciBhIG5ldyByZXN1bHQKKyAgICogICAgIHJldHVybiByZXN1bHQ7CisgICAqICAgfSwgZnVuY3Rpb24ocmVhc29uKSB7CisgICAqICAgICAvLyBlcnJvcjogaGFuZGxlIHRoZSBlcnJvciBpZiBwb3NzaWJsZSBhbmQKKyAgICogICAgIC8vICAgICAgICByZXNvbHZlIHByb21pc2VCIHdpdGggbmV3UHJvbWlzZU9yVmFsdWUsCisgICAqICAgICAvLyAgICAgICAgb3RoZXJ3aXNlIGZvcndhcmQgdGhlIHJlamVjdGlvbiB0byBwcm9taXNlQgorICAgKiAgICAgaWYgKGNhbkhhbmRsZShyZWFzb24pKSB7CisgICAqICAgICAgLy8gaGFuZGxlIHRoZSBlcnJvciBhbmQgcmVjb3ZlcgorICAgKiAgICAgIHJldHVybiBuZXdQcm9taXNlT3JWYWx1ZTsKKyAgICogICAgIH0KKyAgICogICAgIHJldHVybiAkcS5yZWplY3QocmVhc29uKTsKKyAgICogICB9KTsKKyAgICogYGBgCisgICAqCisgICAqIEBwYXJhbSB7Kn0gcmVhc29uIENvbnN0YW50LCBtZXNzYWdlLCBleGNlcHRpb24gb3IgYW4gb2JqZWN0IHJlcHJlc2VudGluZyB0aGUgcmVqZWN0aW9uIHJlYXNvbi4KKyAgICogQHJldHVybnMge1Byb21pc2V9IFJldHVybnMgYSBwcm9taXNlIHRoYXQgd2FzIGFscmVhZHkgcmVzb2x2ZWQgYXMgcmVqZWN0ZWQgd2l0aCB0aGUgYHJlYXNvbmAuCisgICAqLworICB2YXIgcmVqZWN0ID0gZnVuY3Rpb24ocmVhc29uKSB7CisgICAgdmFyIHJlc3VsdCA9IGRlZmVyKCk7CisgICAgcmVzdWx0LnJlamVjdChyZWFzb24pOworICAgIHJldHVybiByZXN1bHQucHJvbWlzZTsKKyAgfTsKKworICB2YXIgY3JlYXRlSW50ZXJuYWxSZWplY3RlZFByb21pc2UgPSBmdW5jdGlvbihyZWFzb24pIHsKKyAgICByZXR1cm4geworICAgICAgdGhlbjogZnVuY3Rpb24oY2FsbGJhY2ssIGVycmJhY2spIHsKKyAgICAgICAgdmFyIHJlc3VsdCA9IGRlZmVyKCk7CisgICAgICAgIG5leHRUaWNrKGZ1bmN0aW9uKCkgeworICAgICAgICAgIHRyeSB7CisgICAgICAgICAgICByZXN1bHQucmVzb2x2ZSgoaXNGdW5jdGlvbihlcnJiYWNrKSA/IGVycmJhY2sgOiBkZWZhdWx0RXJyYmFjaykocmVhc29uKSk7CisgICAgICAgICAgfSBjYXRjaChlKSB7CisgICAgICAgICAgICByZXN1bHQucmVqZWN0KGUpOworICAgICAgICAgICAgZXhjZXB0aW9uSGFuZGxlcihlKTsKKyAgICAgICAgICB9CisgICAgICAgIH0pOworICAgICAgICByZXR1cm4gcmVzdWx0LnByb21pc2U7CisgICAgICB9CisgICAgfTsKKyAgfTsKKworCisgIC8qKgorICAgKiBAbmdkb2MgbWV0aG9kCisgICAqIEBuYW1lICRxI3doZW4KKy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eworICAgICAgICByZXR1cm4gKGlzRnVuY3Rpb24oZXJyYmFjaykgPyBlcnJiYWNrIDogZGVmYXVsdEVycmJhY2spKHJlYXNvbik7CisgICAgICB9IGNhdGNoIChlKSB7CisgICAgICAgIGV4Y2VwdGlvbkhhbmRsZXIoZSk7CisgICAgICAgIHJldHVybiByZWplY3QoZSk7CisgICAgICB9CisgICAgfTsKKworICAgIHZhciB3cmFwcGVkUHJvZ3Jlc3NiYWNrID0gZnVuY3Rpb24ocHJvZ3Jlc3MpIHsKKyAgICAgIHRyeSB7CisgICAgICAgIHJldHVybiAoaXNGdW5jdGlvbihwcm9ncmVzc2JhY2spID8gcHJvZ3Jlc3NiYWNrIDogZGVmYXVsdENhbGxiYWNrKShwcm9ncmVzcyk7CisgICAgICB9IGNhdGNoIChlKSB7CisgICAgICAgIGV4Y2VwdGlvbkhhbmRsZXIoZSk7CisgICAgICB9CisgICAgfTsKKworICAgIG5leHRUaWNrKGZ1bmN0aW9uKCkgeworICAgICAgcmVmKHZhbHVlKS50aGVuKGZ1bmN0aW9uKHZhbHVlKSB7CisgICAgICAgIGlmIChkb25lKSByZXR1cm47CisgICAgICAgIGRvbmUgPSB0cnVlOworICAgICAgICByZXN1bHQucmVzb2x2ZShyZWYodmFsdWUpLnRoZW4od3JhcHBlZENhbGxiYWNrLCB3cmFwcGVkRXJyYmFjaywgd3JhcHBlZFByb2dyZXNzYmFjaykpOworICAgICAgfSwgZnVuY3Rpb24ocmVhc29uKSB7CisgICAgICAgIGlmIChkb25lKSByZXR1cm47CisgICAgICAgIGRvbmUgPSB0cnVlOworICAgICAgICByZXN1bHQucmVzb2x2ZSh3cmFwcGVkRXJyYmFjayhyZWFzb24pKTsKKyAgICAgIH0sIGZ1bmN0aW9uKHByb2dyZXNzKSB7CisgICAgICAgIGlmIChkb25lKSByZXR1cm47CisgICAgICAgIHJlc3VsdC5ub3RpZnkod3JhcHBlZFByb2dyZXNzYmFjayhwcm9ncmVzcykpOworICAgICAgfSk7Cisg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AgKi8KKyAgZnVuY3Rpb24gYWxsKHByb21pc2VzKSB7CisgICAgdmFyIGRlZmVycmVkID0gZGVmZXIoKSwKKyAgICAgICAgY291bnRlciA9IDAsCisgICAgICAgIHJlc3VsdHMgPSBpc0FycmF5KHByb21pc2VzKSA/IFtdIDoge307CisKKyAgICBmb3JFYWNoKHByb21pc2VzLCBmdW5jdGlvbihwcm9taXNlLCBrZXkpIHsKKyAgICAgIGNvdW50ZXIrKzsKKyAgICAgIHJlZihwcm9taXNlKS50aGVuKGZ1bmN0aW9uKHZhbHVlKSB7CisgICAgICAgIGlmIChyZXN1bHRzLmhhc093blByb3BlcnR5KGtleSkpIHJldHVybjsKKyAgICAgICAgcmVzdWx0c1trZXldID0gdmFsdWU7CisgICAgICAgIGlmICghKC0tY291bnRlcikpIGRlZmVycmVkLnJlc29sdmUocmVzdWx0cyk7CisgICAgICB9LCBmdW5jdGlvbihyZWFzb24pIHsKKyAgICAgICAgaWYgKHJlc3VsdHMuaGFzT3duUHJvcGVydHkoa2V5KSkgcmV0dXJuOworICAgICAgICBkZWZlcnJlZC5yZWplY3QocmVhc29uKTsKKyAgICAgIH0pOworICAgIH0pOworCisgICAgaWYgKGNvdW50ZXIgPT09IDApIHsKKyAgICAgIGRlZmVycmVkLnJlc29sdmUocmVzdWx0cyk7CisgICAgfQorCisgICAgcmV0dXJuIGRlZmVycmVkLnByb21pc2U7CisgIH0KKworICByZXR1cm4geworICAgIGRlZmVyOiBkZWZlciwKKyAgICByZWplY3Q6IHJlamVjdCwKKyAgICB3aGVuOiB3aGVuLAorICAgIGFsbDogYWxsCisgIH07Cit9CisKK2Z1bmN0aW9uICQkUkFGUHJvdmlkZXIoKXsgLy9yQUYKKyAgdGhpcy4kZ2V0ID0gWyckd2luZG93JywgJyR0aW1lb3V0JywgZnVuY3Rpb24oJHdpbmRvdywgJHRpbWVvdXQpIHsKKyAgICB2YXIgcmVxdWVzdEFuaW1hdGlvbkZyYW1lID0gJHdpbmRvdy5yZXF1ZXN0QW5pbWF0aW9uRnJhbWUgfHwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJHdpbmRvdy53ZWJraXRSZXF1ZXN0QW5pbWF0aW9uRnJhbWUgfHwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJHdpbmRvdy5tb3pSZXF1ZXN0QW5pbWF0aW9uRnJhbWU7CisKKyAgICB2YXIgY2FuY2VsQW5pbWF0aW9uRnJhbWUgPSAkd2luZG93LmNhbmNlbEFuaW1hdGlvbkZyYW1lIHx8CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJHdpbmRvdy53ZWJraXRDYW5jZWxBbmltYXRpb25GcmFtZSB8fAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICR3aW5kb3cubW96Q2FuY2VsQW5pbWF0aW9uRnJhbWUgfHwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAkd2luZG93LndlYmtpdENhbmNlbFJlcXVlc3RBbmltYXRpb25GcmFtZTsKKworICAgIHZhciByYWZTdXBwb3J0ZWQgPSAhIXJlcXVlc3RBbmltYXRpb25GcmFtZTsKKyAgICB2YXIgcmFmID0gcmFmU3VwcG9ydGVkCisgICAgICA/IGZ1bmN0aW9uKGZuKSB7CisgICAgICAgICAgdmFyIGlkID0gcmVxdWVzdEFuaW1hdGlvbkZyYW1lKGZuKTsKKyAgICAgICAgICByZXR1cm4gZnVuY3Rpb24oKSB7CisgICAgICAgICAgICBjYW5jZWxBbmltYXRpb25GcmFtZShpZCk7CisgICAgICAgICAgfTsKKyAgICAgICAgfQorICAgICAgOiBmdW5jdGlvbihmbikgeworICAgICAgICAgIHZhciB0aW1lciA9ICR0aW1lb3V0KGZuLCAxNi42NiwgZmFsc2UpOyAvLyAxMDAwIC8gNjAgPSAxNi42NjYKKyAgICAgICAgICByZXR1cm4gZnVuY3Rpb24oKSB7CisgICAgICAgICAgICAkdGltZW91dC5jYW5jZWwodGltZXIpOworICAgICAgICAgIH07CisgICAgICA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orICAgICAqCisgICAgICoKKyAgICAgKiBAcGFyYW0ge09iamVjdC48c3RyaW5nLCBmdW5jdGlvbigpPj19IHByb3ZpZGVycyBNYXAgb2Ygc2VydmljZSBmYWN0b3J5IHdoaWNoIG5lZWQgdG8gYmUKKyAgICAgKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHByb3ZpZGVkIGZvciB0aGUgY3VycmVudCBzY29wZS4gRGVmYXVsdHMgdG8ge0BsaW5rIG5nfS4KKyAgICAgKiBAcGFyYW0ge09iamVjdC48c3RyaW5nLCAqPj19IGluc3RhbmNlQ2FjaGUgUHJvdmlkZXMgcHJlLWluc3RhbnRpYXRlZCBzZXJ2aWNlcyB3aGljaCBzaG91bGQKKyAgICAgKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGFwcGVuZC9vdmVycmlkZSBzZXJ2aWNlcyBwcm92aWRlZCBieSBgcHJvdmlkZXJzYC4gVGhpcyBpcyBoYW5keQorICAgICAqICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgd2hlbiB1bml0LXRlc3RpbmcgYW5kIGhhdmluZyB0aGUgbmVlZCB0byBvdmVycmlkZSBhIGRlZmF1bHQKKyAgICAgKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNlcnZpY2UuCisgICAgICogQHJldHVybnMge09iamVjdH0gTmV3bHkgY3JlYXRlZCBzY29wZS4KKyAgICAgKgorICAgICAqLworICAgIGZ1bmN0aW9uIFNjb3BlKCkgeworICAgICAgdGhpcy4kaWQgPSBuZXh0VWlkKCk7CisgICAgICB0aGlzLiQkcGhhc2UgPSB0aGlzLiRwYXJlbnQgPSB0aGlzLiQkd2F0Y2hlcnMgPQorICAgICAgICAgICAgICAgICAgICAgdGhpcy4kJG5leHRTaWJsaW5nID0gdGhpcy4kJHByZXZTaWJsaW5nID0KKyAgICAgICAgICAgICAgICAgICAgIHRoaXMuJCRjaGlsZEhlYWQgPSB0aGlzLiQkY2hpbGRUYWlsID0gbnVsbDsKKyAgICAgIHRoaXNbJ3RoaXMnXSA9IHRoaXMuJHJvb3QgPSAgdGhpczsKKyAgICAgIHRoaXMuJCRkZXN0cm95ZWQgPSBmYWxzZTsKKyAgICAgIHRoaXMuJCRhc3luY1F1ZXVlID0gW107CisgICAgICB0aGlzLiQkcG9zdERpZ2VzdFF1ZXVlID0gW107CisgICAgICB0aGlzLiQkbGlzdGVuZXJzID0ge307CisgICAgICB0aGlzLiQkbGlzdGVuZXJDb3VudCA9IHt9OworICAgICAgdGhpcy4kJGlzb2xhdGVCaW5kaW5ncyA9IHt9OworICAgIH0KKworICAgIC8qKgorICAgICAqIEBuZ2RvYyBwcm9wZXJ0eQorICAgICAqIEBuYW1lICRyb290U2NvcGUuU2NvcGUjJGlkCisgICAgICoKKyAgICAgKiBAZGVzY3JpcHRpb24KKyAgICAgKiBVbmlxdWUgc2NvcGUgSUQgKG1vbm90b25pY2FsbHkgaW5jcmVhc2luZykgdXNlZnVsIGZvciBkZWJ1Z2dpbmcuCisgICAgICovCisKKyAgICAgLyoqCisgICAgICAqIEBuZ2RvYyBwcm9wZXJ0eQorICAgICAgKiBAbmFtZSAkcm9vdFNjb3BlLlNjb3BlIyRwYXJlbnQKKyAgICAgICoKKyAgICAgICogQGRlc2NyaXB0aW9uCisgICAgICAqIFJlZmVyZW5jZSB0byB0aGUgcGFyZW50IHNjb3BlLgorICAgICAgKi8KKworICAgICAgLyoqCisgICAgICAgKiBAbmdkb2MgcHJvcGVydHkKKyAgICAgICAqIEBuYW1lICRyb290U2NvcGUuU2NvcGUjJHJvb3QKKyAgICAgICAqCisgICAgICAgKiBAZGVzY3JpcHRpb24KKyAgICAgICAqIFJlZmVyZW5jZSB0byB0aGUgcm9vdCBzY29wZS4KKyAgICAgICAqLworCisgICAgU2NvcGUucHJvdG90eXBlID0geworICAgICAgY29uc3RydWN0b3I6IFNjb3BlLAorICAgICAgLyoqCisgICAgICAgKiBAbmdkb2MgbWV0aG9kCisgICAgICAgKiBAbmFtZSA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3MpIHsKKyAgICAgICAgICAgIHRoaXMuJCRjaGlsZFNjb3BlQ2xhc3MgPSBmdW5jdGlvbigpIHsKKyAgICAgICAgICAgICAgdGhpcy4kJHdhdGNoZXJzID0gdGhpcy4kJG5leHRTaWJsaW5nID0KKyAgICAgICAgICAgICAgICAgIHRoaXMuJCRjaGlsZEhlYWQgPSB0aGlzLiQkY2hpbGRUYWlsID0gbnVsbDsKKyAgICAgICAgICAgICAgdGhpcy4kJGxpc3RlbmVycyA9IHt9OworICAgICAgICAgICAgICB0aGlzLiQkbGlzdGVuZXJDb3VudCA9IHt9OworICAgICAgICAgICAgICB0aGlzLiRpZCA9IG5leHRVaWQoKTsKKyAgICAgICAgICAgICAgdGhpcy4kJGNoaWxkU2NvcGVDbGFzcyA9IG51bGw7CisgICAgICAgICAgICB9OworICAgICAgICAgICAgdGhpcy4kJGNoaWxkU2NvcGVDbGFzcy5wcm90b3R5cGUgPSB0aGlzOworICAgICAgICAgIH0KKyAgICAgICAgICBjaGlsZCA9IG5ldyB0aGlzLiQkY2hpbGRTY29wZUNsYXNzKCk7CisgICAgICAgIH0KKyAgICAgICAgY2hpbGRbJ3RoaXMnXSA9IGNoaWxkOworICAgICAgICBjaGlsZC4kcGFyZW50ID0gdGhpczsKKyAgICAgICAgY2hpbGQuJCRwcmV2U2libGluZyA9IHRoaXMuJCRjaGlsZFRhaWw7CisgICAgICAgIGlmICh0aGlzLiQkY2hpbGRIZWFkKSB7CisgICAgICAgICAgdGhpcy4kJGNoaWxkVGFpbC4kJG5leHRTaWJsaW5nID0gY2hpbGQ7CisgICAgICAgICAgdGhpcy4kJGNoaWxkVGFpbCA9IGNoaWxkOworICAgICAgICB9IGVsc2UgeworICAgICAgICAgIHRoaXMuJCRjaGlsZEhlYWQgPSB0aGlzLiQkY2hpbGRUYWlsID0gY2hpbGQ7CisgICAgICAgIH0KKyAgICAgICAgcmV0dXJuIGNoaWxkOworICAgICAgfSwKKworICAgICAgLyoqCisgICAgICAgKiBAbmd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TsKKyAgICAgICAgICAgZXhwZWN0KHNjb3BlLmNvdW50ZXIpLnRvRXF1YWwoMCk7CisKKyAgICAgICAgICAgc2NvcGUuJGRpZ2VzdCgpOworICAgICAgICAgICAvLyB0aGUgbGlzdGVuZXIgaXMgYWx3YXlzIGNhbGxlZCBkdXJpbmcgdGhlIGZpcnN0ICRkaWdlc3QgbG9vcCBhZnRlciBpdCB3YXMgcmVnaXN0ZXJlZAorICAgICAgICAgICBleHBlY3Qoc2NvcGUuY291bnRlcikudG9FcXVhbCgxKTsKKworICAgICAgICAgICBzY29wZS4kZGlnZXN0KCk7CisgICAgICAgICAgIC8vIGJ1dCBub3cgaXQgd2lsbCBub3QgYmUgY2FsbGVkIHVubGVzcyB0aGUgdmFsdWUgY2hhbmdlcworICAgICAgICAgICBleHBlY3Qoc2NvcGUuY291bnRlcikudG9FcXVhbCgxKTsKKworICAgICAgICAgICBzY29wZS5uYW1lID0gJ2FkYW0nOworICAgICAgICAgICBzY29wZS4kZGlnZXN0KCk7CisgICAgICAgICAgIGV4cGVjdChzY29wZS5jb3VudGVyKS50b0VxdWFsKDIpOworCisKKworICAgICAgICAgICAvLyBVc2luZyBhIGxpc3RlbmVyIGZ1bmN0aW9uCisgICAgICAgICAgIHZhciBmb29kOworICAgICAgICAgICBzY29wZS5mb29kQ291bnRlciA9IDA7CisgICAgICAgICAgIGV4cGVjdChzY29wZS5mb29kQ291bnRlcikudG9FcXVhbCgwKTsKKyAgICAgICAgICAgc2NvcGUuJHdhdGNoKAorICAgICAgICAgICAgIC8vIFRoaXMgaXMgdGhlIGxpc3RlbmVyIGZ1bmN0aW9uCisgICAgICAgICAgICAgZnVuY3Rpb24oKSB7IHJldHVybiBmb29kOyB9LAorICAgICAgICAgICAgIC8vIFRoaXMgaXMgdGhlIGNoYW5nZSBoYW5kbGVyCisgICAgICAgICAgICAgZnVuY3Rpb24obmV3VmFsdWUsIG9sZFZhbHVlKSB7CisgICAgICAgICAgICAgICBpZiAoIG5ld1ZhbHVlICE9PSBvbGRWYWx1ZSApIHsKKyAgICAgICAgICAgICAgICAgLy8gT25seSBpbmNyZW1lbnQgdGhlIGNvdW50ZXIgaWYgdGhlIHZhbHVlIGNoYW5nZWQKKyAgICAgICAgICAgICAgICAgc2NvcGUuZm9vZENvdW50ZXIgPSBzY29wZS5mb29kQ291bnRlciArIDE7CisgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgfQorICAgICAgICAgICApOworICAgICAgICAgICAvLyBObyBkaWdlc3QgaGFzIGJlZW4gcnVuIHNvIHRoZSBjb3VudGVyIHdpbGwgYmUgemVybworICAgICAgICAgICBleHBlY3Qoc2NvcGUuZm9vZENvdW50ZXIpLnRvRXF1YWwoMCk7CisKKyAgICAgICAgICAgLy8gUnVuIHRoZSBkaWdlc3QgYnV0IHNpbmNlIGZvb2QgaGFzIG5vdCBjaGFuZ2VkIGNvdW50IHdpbGwgc3RpbGwgYmUgemVybworICAgICAgICAgICBzY29wZS4kZGlnZXN0KCk7CisgICAgICAgICAgIGV4cGVjdChzY29wZS5mb29kQ291bnRlcikudG9FcXVhbCgwKTsKKworICAgICAgICAgICAvLyBVcGRhdGUgZm9vZCBhbmQgcnVuIGRpZ2VzdC4gIE5vdyB0aGUgY291bnRlciB3aWxsIGluY3JlbWVudAorICAgICAgICAgICBmb29kID0gJ2NoZWVzZWJ1cmdlcic7CisgICAgICAgICAgIHNjb3BlLiRkaWdlc3QoKTsKKyAgICAgICAgICAgZXhwZWN0KHNjb3BlLmZvb2RDb3VudGVyKS50b0VxdWFsKDEpOworCisgICAgICAgKiBgYGAKKyAgICAgICAqCisgICAgICAgKgorICAgICAgICoKKyAgICAgICAqIEBwYXJhbSB7KGZ1bmN0aW9uKCl8c3RyaW5nKX0gd2F0Y2hFeHByZXNzaW9uIEV4cHJlc3Npb24gdGhhdCBpcyBldmFsdWF0ZWQgb24gZWFjaAorICAgICAgICogICAge0BsaW5rIG5nLiRyb290U2NvcGUuU2NvcGUjJGRpZ2VzdCAkZGl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Zm9yIHRoaXMgbGlzdGVuZXIuCisgICAgICAgKi8KKyAgICAgICR3YXRjaDogZnVuY3Rpb24od2F0Y2hFeHAsIGxpc3RlbmVyLCBvYmplY3RFcXVhbGl0eSkgeworICAgICAgICB2YXIgc2NvcGUgPSB0aGlzLAorICAgICAgICAgICAgZ2V0ID0gY29tcGlsZVRvRm4od2F0Y2hFeHAsICd3YXRjaCcpLAorICAgICAgICAgICAgYXJyYXkgPSBzY29wZS4kJHdhdGNoZXJzLAorICAgICAgICAgICAgd2F0Y2hlciA9IHsKKyAgICAgICAgICAgICAgZm46IGxpc3RlbmVyLAorICAgICAgICAgICAgICBsYXN0OiBpbml0V2F0Y2hWYWwsCisgICAgICAgICAgICAgIGdldDogZ2V0LAorICAgICAgICAgICAgICBleHA6IHdhdGNoRXhwLAorICAgICAgICAgICAgICBlcTogISFvYmplY3RFcXVhbGl0eQorICAgICAgICAgICAgfTsKKworICAgICAgICBsYXN0RGlydHlXYXRjaCA9IG51bGw7CisKKyAgICAgICAgLy8gaW4gdGhlIGNhc2UgdXNlciBwYXNzIHN0cmluZywgd2UgbmVlZCB0byBjb21waWxlIGl0LCBkbyB3ZSByZWFsbHkgbmVlZCB0aGlzID8KKyAgICAgICAgaWYgKCFpc0Z1bmN0aW9uKGxpc3RlbmVyKSkgeworICAgICAgICAgIHZhciBsaXN0ZW5GbiA9IGNvbXBpbGVUb0ZuKGxpc3RlbmVyIHx8IG5vb3AsICdsaXN0ZW5lcicpOworICAgICAgICAgIHdhdGNoZXIuZm4gPSBmdW5jdGlvbihuZXdWYWwsIG9sZFZhbCwgc2NvcGUpIHtsaXN0ZW5GbihzY29wZSk7fTsKKyAgICAgICAgfQorCisgICAgICAgIGlmICh0eXBlb2Ygd2F0Y2hFeHAgPT0gJ3N0cmluZycgJiYgZ2V0LmNvbnN0YW50KSB7CisgICAgICAgICAgdmFyIG9yaWdpbmFsRm4gPSB3YXRjaGVyLmZuOworICAgICAgICAgIHdhdGNoZXIuZm4gPSBmdW5jdGlvbihuZXdWYWwsIG9sZFZhbCwgc2NvcGUpIHsKKyAgICAgICAgICAgIG9yaWdpbmFsRm4uY2FsbCh0aGlzLCBuZXdWYWwsIG9sZFZhbCwgc2NvcGUpOworICAgICAgICAgICAgYXJyYXlSZW1vdmUoYXJyYXksIHdhdGNoZXIpOworICAgICAgICAgIH07CisgICAgICAgIH0KKworICAgICAgICBpZiAoIWFycmF5KSB7CisgICAgICAgICAgYXJyYXkgPSBzY29wZS4kJHdhdGNoZXJzID0gW107CisgICAgICAgIH0KKyAgICAgICAgLy8gd2UgdXNlIHVuc2hpZnQgc2luY2Ugd2UgdXNlIGEgd2hpbGUgbG9vcCBpbiAkZGlnZXN0IGZvciBzcGVlZC4KKyAgICAgICAgLy8gdGhlIHdoaWxlIGxvb3AgcmVhZHMgaW4gcmV2ZXJzZSBvcmRlci4KKyAgICAgICAgYXJyYXkudW5zaGlmdCh3YXRjaGVyKTsKKworICAgICAgICByZXR1cm4gZnVuY3Rpb24gZGVyZWdpc3RlcldhdGNoKCkgeworICAgICAgICAgIGFycmF5UmVtb3ZlKGFycmF5LCB3YXRjaGVyKTsKKyAgICAgICAgICBsYXN0RGlydHlXYXRjaCA9IG51bGw7CisgICAgICAgIH07CisgICAgICB9LAorCisKKyAgICAgIC8qKgorICAgICAgICogQG5nZG9jIG1ldGhvZAorICAgICAgICogQG5hbWUgJHJvb3RTY29wZS5TY29wZSMkd2F0Y2hDb2xsZWN0aW9uCisgICAgICAgKiBAa2luZCBmdW5jdGlvbgorICAgICAgICoKKyAgICAgICAqIEBkZXNjcmlwdGlvbgorICAgICAgICogU2hhbGxvdyB3YXRjaGVzIHRoZSBwcm9wZXJ0aWVzIG9mIGFuIG9iamVjdCBhbmQgZmlyZXMgd2hlbmV2ZXIgYW55IG9mIHRoZSBwcm9wZXJ0aWVzIGNoYW5nZQorICAgICAgICogKGZvciBhcnJheXMsIHRoaXMgaW1wbGllcyB3YXRjaGluZyB0aGUgYXJyYXkgaXRlbXM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xhc3QgZGlydHktY2hlY2sgcnVuLAorICAgICAgICAvLyB1cGRhdGVkIHRvIG1hdGNoIG5ld1ZhbHVlIGR1cmluZyBkaXJ0eS1jaGVjayBydW4KKyAgICAgICAgdmFyIG9sZFZhbHVlOworICAgICAgICAvLyBhIHNoYWxsb3cgY29weSBvZiB0aGUgbmV3VmFsdWUgZnJvbSB3aGVuIHRoZSBsYXN0IGNoYW5nZSBoYXBwZW5lZAorICAgICAgICB2YXIgdmVyeU9sZFZhbHVlOworICAgICAgICAvLyBvbmx5IHRyYWNrIHZlcnlPbGRWYWx1ZSBpZiB0aGUgbGlzdGVuZXIgaXMgYXNraW5nIGZvciBpdAorICAgICAgICB2YXIgdHJhY2tWZXJ5T2xkVmFsdWUgPSAobGlzdGVuZXIubGVuZ3RoID4gMSk7CisgICAgICAgIHZhciBjaGFuZ2VEZXRlY3RlZCA9IDA7CisgICAgICAgIHZhciBvYmpHZXR0ZXIgPSAkcGFyc2Uob2JqKTsKKyAgICAgICAgdmFyIGludGVybmFsQXJyYXkgPSBbXTsKKyAgICAgICAgdmFyIGludGVybmFsT2JqZWN0ID0ge307CisgICAgICAgIHZhciBpbml0UnVuID0gdHJ1ZTsKKyAgICAgICAgdmFyIG9sZExlbmd0aCA9IDA7CisKKyAgICAgICAgZnVuY3Rpb24gJHdhdGNoQ29sbGVjdGlvbldhdGNoKCkgeworICAgICAgICAgIG5ld1ZhbHVlID0gb2JqR2V0dGVyKHNlbGYpOworICAgICAgICAgIHZhciBuZXdMZW5ndGgsIGtleSwgYm90aE5hTjsKKworICAgICAgICAgIGlmICghaXNPYmplY3QobmV3VmFsdWUpKSB7IC8vIGlmIHByaW1pdGl2ZQorICAgICAgICAgICAgaWYgKG9sZFZhbHVlICE9PSBuZXdWYWx1ZSkgeworICAgICAgICAgICAgICBvbGRWYWx1ZSA9IG5ld1ZhbHVlOworICAgICAgICAgICAgICBjaGFuZ2VEZXRlY3RlZCsrOworICAgICAgICAgICAgfQorICAgICAgICAgIH0gZWxzZSBpZiAoaXNBcnJheUxpa2UobmV3VmFsdWUpKSB7CisgICAgICAgICAgICBpZiAob2xkVmFsdWUgIT09IGludGVybmFsQXJyYXkpIHsKKyAgICAgICAgICAgICAgLy8gd2UgYXJlIHRyYW5zaXRpb25pbmcgZnJvbSBzb21ldGhpbmcgd2hpY2ggd2FzIG5vdCBhbiBhcnJheSBpbnRvIGFycmF5LgorICAgICAgICAgICAgICBvbGRWYWx1ZSA9IGludGVybmFsQXJyYXk7CisgICAgICAgICAgICAgIG9sZExlbmd0aCA9IG9sZFZhbHVlLmxlbmd0aCA9IDA7CisgICAgICAgICAgICAgIGNoYW5nZURldGVjdGVkKys7CisgICAgICAgICAgICB9CisKKyAgICAgICAgICAgIG5ld0xlbmd0aCA9IG5ld1ZhbHVlLmxlbmd0aDsKKworICAgICAgICAgICAgaWYgKG9sZExlbmd0aCAhPT0gbmV3TGVuZ3RoKSB7CisgICAgICAgICAgICAgIC8vIGlmIGxlbmd0aHMgZG8gbm90IG1hdGNoIHdlIG5lZWQgdG8gdHJpZ2dlciBjaGFuZ2Ugbm90aWZpY2F0aW9uCisgICAgICAgICAgICAgIGNoYW5nZURldGVjdGVkKys7CisgICAgICAgICAgICAgIG9sZFZhbHVlLmxlbmd0aCA9IG9sZExlbmd0aCA9IG5ld0xlbmd0aDsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIC8vIGNvcHkgdGhlIGl0ZW1zIHRvIG9sZFZhbHVlIGFuZCBsb29rIGZvciBjaGFuZ2VzLgorICAgICAgICAgICAgZm9yICh2YXIgaSA9IDA7IGkgPCBuZXdMZW5ndGg7IGkrKykgeworICAgICAgICAgICAgICBib3RoTmFOID0gKG9sZFZhbHVlW2ldICE9PSBvbGRWYWx1ZVtpXSkgJiYKKyAgICAgICAgICAgICAgICAgIChuZXdWYWx1ZVtpXSAhPT0gbmV3VmFsdWVbaV0pOworICAgICAgICAgICAgICBpZiAoIWJvdGhOYU4gJiYgKG9sZFZhbHVlW2ldICE9PSBuZXdWYWx1ZVtpXSkpIHsKKyAgICAgICAgICAgICAgICBjaGFuZ2VEZXRlY3RlZCsrOworICAgICAgICAgICAgICAgIG9sZFZhbHVlW2ldID0gbmV3VmFsdWVbaV07CisgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0KKyAgICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgaWYgKG9sZFZhbHVlICE9PSBpbnRlcm5hbE9iamVjdCkgeworICAgICAgICAgICAgICAvLyB3ZSBhcmUgdHJhbnNpdGlvbmluZyBmcm9tIHNvbWV0aGluZyB3aGljaCB3YXMgbm90IGFuIG9iamVjdCBpbnRvIG9iamVjdC4KKyAgICAgICAgICAgICAgb2xkVmFsdWUgPSBpbnRlcm5hbE9iamVjdCA9IHt9OworICAgICAgICAgICAgICBvbGRMZW5ndGggPSAwOworICAgICAgICAgICAgICBjaGFuZ2VEZXRlY3RlZCsrOworICAgICAgICAgICAgfQorICAgICAgICAgICAgLy8gY29weSB0aGUgaXRlbXMgdG8gb2xkVmFsdWUgYW5kIGxvb2sgZm9yIGNoYW5nZXMuCisgICAgICAgICAgICBuZXdMZW5ndGggPSAwOworICAgICAgICAgICAgZm9yIChrZXkgaW4gbmV3VmFsdWUpIHsKKyAgICAgICAgICAgICAgaWYgKG5ld1ZhbHVlLmhhc093blByb3BlcnR5KGtleSkpIHsKKyAgICAgICAgICAgICAgICBuZXdMZW5ndGgrKzsKKyAgICAgICAgICAgICAgICBpZiAob2xkVmFsdWUuaGFzT3duUHJvcGVydHkoa2V5KSkgeworICAgICAgICAgICAgICAgICAgYm90aE5hTiA9IChvbGRWYWx1ZVtrZXldICE9PSBvbGRWYWx1ZVtrZXldKSAmJgorICAgICAgICAgICAgICAgICAgICAgIChuZXdWYWx1ZVtrZXldICE9PSBuZXdWYWx1ZVtrZXldKTsKKyAgICAgICAgICAgICAgICAgIGlmICghYm90aE5hTiAmJiAob2xkVmFsdWVba2V5XSAhPT0gbmV3VmFsdWVba2V5XSkpIHsKKyAgICAgICAgICAgICAgICAgICAgY2hhbmdlRGV0ZWN0ZWQrKzsKKyAgICAgICAgICAgICAgICAgICAgb2xkVmFsdWVba2V5XSA9IG5ld1ZhbHVlW2tleV07CisgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgICAgICAgIG9sZExlbmd0aCsrOworICAgICAgICAgICAgICAgICAgb2xkVmFsdWVba2V5XSA9IG5ld1ZhbHVlW2tleV07CisgICAgICAgICAgICAgICAgICBjaGFuZ2VEZXRlY3RlZCsrOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfQorICAgICAgICAgICAgaWYgKG9sZExlbmd0aCA+IG5ld0xlbmd0aCkgeworICAgICAgICAgICAgICAvLyB3ZSB1c2VkIHRvIGhhdmUgbW9yZSBrZXlzLCBuZWVkIHRvIGZpbmQgdGhlbSBhbmQgZGVzdHJveSB0aGVtLgorICAgICAgICAgICAgICBjaGFuZ2VEZXRlY3RlZCsrOworICAgICAgICAgICAgICBmb3Ioa2V5IGluIG9sZFZhbHVlKSB7CisgICAgICAgICAgICAgICAgaWYgKG9sZFZhbHVlLmhhc093blByb3BlcnR5KGtleSkgJiYgIW5ld1ZhbHVlLmhhc093blByb3BlcnR5KGtleSkpIHsKKyAgICAgICAgICAgICAgICAgIG9sZExlbmd0aC0tOworICAgICAgICAgICAgICAgICAgZGVsZXRlIG9sZFZhbHVlW2tleV07CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9CisgICAgICAgICAgfQorICAgICAgICAgIHJldHVybiBjaGFuZ2VEZXRlY3RlZDsKKyAgICAgICAgfQorCisgICAgICAgIGZ1bmN0aW9uICR3YXRjaENvbGxlY3Rpb25BY3Rpb24oKSB7CisgICAgICAgICAgaWYgKGluaXRSdW4pIHsKKyAgICAgICAgICAgIGluaXRSdW4gPSBmYWxzZTsKKyAgICAgICAgICAgIGxpc3RlbmVyKG5ld1ZhbHVlLCBuZXdWYWx1ZSwgc2VsZik7CisgICAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgIGxpc3RlbmVyKG5ld1ZhbHVlLCB2ZXJ5T2xkVmFsdWUsIHNlbGYpOworICAgICAgICAgIH0KKworICAgICAgICAgIC8vIG1ha2UgYSBjb3B5IGZvciB0aGUgbmV4dCB0aW1lIGEgY29sbGVjdGlvbiBpcyBjaGFuZ2VkCisgICAgICAgICAgaWYgKHRyYWNrVmVyeU9sZFZhbHVlKSB7CisgICAgICAgICAgICBpZiAoIWlzT2JqZWN0KG5ld1ZhbHVlKSkgeworICAgICAgICAgICAgICAvL3ByaW1pdGl2ZQorICAgICAgICAgICAgICB2ZXJ5T2xkVmFsdWUgPSBuZXdWYWx1ZTsKKyAgICAgICAgICAgIH0gZWxzZSBpZiAoaXNBcnJheUxpa2UobmV3VmFsdWUpKSB7CisgICAgICAgICAgICAgIHZlcnlPbGRWYWx1ZSA9IG5ldyBBcnJheShuZXdWYWx1ZS5sZW5ndGgpOworICAgICAgICAgICAgICBmb3IgKHZhciBpID0gMDsgaSA8IG5ld1ZhbHVlLmxlbmd0aDsgaSsrKSB7CisgICAgICAgICAgICAgICAgdmVyeU9sZFZhbHVlW2ldID0gbmV3VmFsdWVbaV07CisgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0gZWxzZSB7IC8vIGlmIG9iamVjdAorICAgICAgICAgICAgICB2ZXJ5T2xkVmFsdWUgPSB7fTsKKyAgICAgICAgICAgICAgZm9yICh2YXIga2V5IGluIG5ld1ZhbHVlKSB7CisgICAgICAgICAgICAgICAgaWYgKGhhc093blByb3BlcnR5LmNhbGwobmV3VmFsdWUsIGtleSkpIHsKKyAgICAgICAgICAgICAgICAgIHZlcnlPbGRWYWx1ZVtrZXldID0gbmV3VmFsdWVba2V5XTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0KKyAgICAgICAgICB9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AgICAgICBzY29wZS4kd2F0Y2goJ25hbWUnLCBmdW5jdGlvbihuZXdWYWx1ZSwgb2xkVmFsdWUpIHsKKyAgICAgICAgICAgICBzY29wZS5jb3VudGVyID0gc2NvcGUuY291bnRlciArIDE7CisgICAgICAgICAgIH0pOworICAgICAgICAgICBleHBlY3Qoc2NvcGUuY291bnRlcikudG9FcXVhbCgwKTsKKworICAgICAgICAgICBzY29wZS4kZGlnZXN0KCk7CisgICAgICAgICAgIC8vIHRoZSBsaXN0ZW5lciBpcyBhbHdheXMgY2FsbGVkIGR1cmluZyB0aGUgZmlyc3QgJGRpZ2VzdCBsb29wIGFmdGVyIGl0IHdhcyByZWdpc3RlcmVkCisgICAgICAgICAgIGV4cGVjdChzY29wZS5jb3VudGVyKS50b0VxdWFsKDEpOworCisgICAgICAgICAgIHNjb3BlLiRkaWdlc3QoKTsKKyAgICAgICAgICAgLy8gYnV0IG5vdyBpdCB3aWxsIG5vdCBiZSBjYWxsZWQgdW5sZXNzIHRoZSB2YWx1ZSBjaGFuZ2VzCisgICAgICAgICAgIGV4cGVjdChzY29wZS5jb3VudGVyKS50b0VxdWFsKDEpOworCisgICAgICAgICAgIHNjb3BlLm5hbWUgPSAnYWRhbSc7CisgICAgICAgICAgIHNjb3BlLiRkaWdlc3QoKTsKKyAgICAgICAgICAgZXhwZWN0KHNjb3BlLmNvdW50ZXIpLnRvRXF1YWwoMik7CisgICAgICAgKiBgYGAKKyAgICAgICAqCisgICAgICAgKi8KKyAgICAgICRkaWdlc3Q6IGZ1bmN0aW9uKCkgeworICAgICAgICB2YXIgd2F0Y2gsIHZhbHVlLCBsYXN0LAorICAgICAgICAgICAgd2F0Y2hlcnMsCisgICAgICAgICAgICBhc3luY1F1ZXVlID0gdGhpcy4kJGFzeW5jUXVldWUsCisgICAgICAgICAgICBwb3N0RGlnZXN0UXVldWUgPSB0aGlzLiQkcG9zdERpZ2VzdFF1ZXVlLAorICAgICAgICAgICAgbGVuZ3RoLAorICAgICAgICAgICAgZGlydHksIHR0bCA9IFRUTCwKKyAgICAgICAgICAgIG5leHQsIGN1cnJlbnQsIHRhcmdldCA9IHRoaXMsCisgICAgICAgICAgICB3YXRjaExvZyA9IFtdLAorICAgICAgICAgICAgbG9nSWR4LCBsb2dNc2csIGFzeW5jVGFzazsKKworICAgICAgICBiZWdpblBoYXNlKCckZGlnZXN0Jyk7CisgICAgICAgIC8vIENoZWNrIGZvciBjaGFuZ2VzIHRvIGJyb3dzZXIgdXJsIHRoYXQgaGFwcGVuZWQgaW4gc3luYyBiZWZvcmUgdGhlIGNhbGwgdG8gJGRpZ2VzdAorICAgICAgICAkYnJvd3Nlci4kJGNoZWNrVXJsQ2hhbmdlKCk7CisKKyAgICAgICAgbGFzdERpcnR5V2F0Y2ggPSBudWxsOworCisgICAgICAgIGRvIHsgLy8gIndoaWxlIGRpcnR5IiBsb29wCisgICAgICAgICAgZGlydHkgPSBmYWxzZTsKKyAgICAgICAgICBjdXJyZW50ID0gdGFyZ2V0OworCisgICAgICAgICAgd2hpbGUoYXN5bmNRdWV1ZS5sZW5ndGgpIHsKKyAgICAgICAgICAgIHRyeSB7CisgICAgICAgICAgICAgIGFzeW5jVGFzayA9IGFzeW5jUXVldWUuc2hpZnQoKTsKKyAgICAgICAgICAgICAgYXN5bmNUYXNrLnNjb3BlLiRldmFsKGFzeW5jVGFzay5leHByZXNzaW9uKTsKKyAgICAgICAgICAgIH0gY2F0Y2ggKGUpIHsKKyAgICAgICAgICAgICAgY2xlYXJQaGFzZSgpOworICAgICAgICAgICAgICAkZXhjZXB0aW9uSGFuZGxlcihlKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGxhc3REaXJ0eVdhdGNoID0gbnVsbDsKKyAgICAgICAgICB9CisKKyAgICAgICAgICB0cmF2ZXJzZVNjb3Blc0xvb3A6CisgICAgICAgICAgZG8geyAvLyAidHJhdmVyc2UgdGhlIHNjb3BlcyIgbG9vcAorICAgICAgICAgICAgaWYgKCh3YXRjaGVycyA9IGN1cnJlbnQuJCR3YXRjaGVycykpIHsKKyAgICAgICAgICAgICAgLy8gcHJvY2VzcyBvdXIgd2F0Y2hlcworICAgICAgICAgICAgICBsZW5ndGggPSB3YXRjaGVycy5sZW5ndGg7CisgICAgICAgICAgICAgIHdoaWxlIChsZW5ndGgtLSkgeworICAgICAgICAgICAgICAgIHRyeSB7CisgICAgICAgICAgICAgICAgICB3YXRjaCA9IHdhdGNoZXJzW2xlbmd0aF07CisgICAgICAgICAgICAgICAgICAvLyBNb3N0IGNvbW1vbiB3YXRjaGVzIGFyZSBvbiBwcmltaXRpdmVzLCBpbiB3aGljaCBjYXNlIHdlIGNhbiBzaG9ydAorICAgICAgICAgICAgICAgICAgLy8gY2lyY3VpdCBpdCB3aXRoID09PSBvcGVyYXRvciwgb25seSB3aGVuID09PSBmYWlscyBkbyB3ZSB1c2UgLmVxdWFscworICAgICAgICAgICAgICAgICAgaWYgKHdhdGNoKSB7CisgICAgICAgICAgICAgICAgICAgIGlmICgodmFsdWUgPSB3YXRjaC5nZXQoY3VycmVudCkpICE9PSAobGFzdCA9IHdhdGNoLmxhc3QpICYmCisgICAgICAgICAgICAgICAgICAgICAgICAhKHdhdGNoLmVxCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgPyBlcXVhbHModmFsdWUsIGxhc3QpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgOiAodHlwZW9mIHZhbHVlID09PSAnbnVtYmVyJyAmJiB0eXBlb2YgbGFzdCA9PT0gJ251bWJlcicKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiBpc05hTih2YWx1ZSkgJiYgaXNOYU4obGFzdCkpKSkgeworICAgICAgICAgICAgICAgICAgICAgIGRpcnR5ID0gdHJ1ZTsKKyAgICAgICAgICAgICAgICAgICAgICBsYXN0RGlydHlXYXRjaCA9IHdhdGNoOworICAgICAgICAgICAgICAgICAgICAgIHdhdGNoLmxhc3QgPSB3YXRjaC5lcSA/IGNvcHkodmFsdWUsIG51bGwpIDogdmFsdWU7CisgICAgICAgICAgICAgICAgICAgICAgd2F0Y2guZm4odmFsdWUsICgobGFzdCA9PT0gaW5pdFdhdGNoVmFsKSA/IHZhbHVlIDogbGFzdCksIGN1cnJlbnQpOworICAgICAgICAgICAgICAgICAgICAgIGlmICh0dGwgPCA1KSB7CisgICAgICAgICAgICAgICAgICAgICAgICBsb2dJZHggPSA0IC0gdHRsOworICAgICAgICAgICAgICAgICAgICAgICAgaWYgKCF3YXRjaExvZ1tsb2dJZHhdKSB3YXRjaExvZ1tsb2dJZHhdID0gW107CisgICAgICAgICAgICAgICAgICAgICAgICBsb2dNc2cgPSAoaXNGdW5jdGlvbih3YXRjaC5leHApKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgID8gJ2ZuOiAnICsgKHdhdGNoLmV4cC5uYW1lIHx8IHdhdGNoLmV4cC50b1N0cmluZygpKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgIDogd2F0Y2guZXhwOworICAgICAgICAgICAgICAgICAgICAgICAgbG9nTXNnICs9ICc7IG5ld1ZhbDogJyArIHRvSnNvbih2YWx1ZSkgKyAnOyBvbGRWYWw6ICcgKyB0b0pzb24obGFzdCk7CisgICAgICAgICAgICAgICAgICAgICAgICB3YXRjaExvZ1tsb2dJZHhdLnB1c2gobG9nTXNnKTsKKyAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAod2F0Y2ggPT09IGxhc3REaXJ0eVdhdGNoKSB7CisgICAgICAgICAgICAgICAgICAgICAgLy8gSWYgdGhlIG1vc3QgcmVjZW50bHkgZGlydHkgd2F0Y2hlciBpcyBub3cgY2xlYW4sIHNob3J0IGNpcmN1aXQgc2luY2UgdGhlIHJlbWFpbmluZyB3YXRjaGVycworICAgICAgICAgICAgICAgICAgICAgIC8vIGhhdmUgYWxyZWFkeSBiZWVuIHRlc3RlZC4KKyAgICAgICAgICAgICAgICAgICAgICBkaXJ0eSA9IGZhbHNlOworICAgICAgICAgICAgICAgICAgICAgIGJyZWFrIHRyYXZlcnNlU2NvcGVzTG9vcDsKKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIH0gY2F0Y2ggKGUpIHsKKyAgICAgICAgICAgICAgICAgIGNsZWFyUGhhc2UoKTsKKyAgICAgICAgICAgICAgICAgICRleGNlcHRpb25IYW5kbGVyKGUpOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfQorCisgICAgICAgICAgICAvLyBJbnNhbml0eSBXYXJuaW5nOiBzY29wZSBkZXB0aC1maXJzdCB0cmF2ZXJzYWwKKyAgICAgICAgICAgIC8vIHllcywgdGhpcyBjb2RlIGlzIGEgYml0IGNyYXp5LCBidXQgaXQgd29ya3MgYW5kIHdlIGhhdmUgdGVzdHMgdG8gcHJvdmUgaXQhCisgICAgICAgICAgICAvLyB0aGlzIHBpZWNlIHNob3VsZCBiZSBrZXB0IGluIHN5bmMgd2l0aCB0aGUgdHJhdmVyc2FsIGluICRicm9hZGNhc3QKKyAgICAgICAgICAgIGlmICghKG5leHQgPSAoY3VycmVudC4kJGNoaWxkSGVhZCB8fAorICAgICAgICAgICAgICAgIChjdXJyZW50ICE9PSB0YXJnZXQgJiYgY3VycmVudC4kJG5leHRTaWJsaW5nKSkpKSB7CisgICAgICAgICAgICAgIHdoaWxlKGN1cnJlbnQgIT09IHRhcmdldCAmJiAhKG5leHQgPSBjdXJyZW50LiQkbmV4dFNpYmxpbmcpKSB7CisgICAgICAgICAgICAgICAgY3VycmVudCA9IGN1cnJlbnQuJHBhcmVudDsKKyAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfQorICAgICAgICAgIH0gd2hpbGUgKChjdXJyZW50ID0gbmV4dCkpOworCisgICAgICAgICAgLy8gYGJyZWFrIHRyYXZlcnNlU2NvcGVzTG9vcDtgIHRha2VzIHVzIHRvIGhlcmUKKworICAgICAgICAgIGlmKChkaXJ0eSB8fCBhc3luY1F1ZXVlLmxlbmd0aCkgJiYgISh0dGwtLSkpIHsKKyAgICAgICAgICAgIGNsZWFyUGhhc2UoKTsKKyAgICAgICAgICAgIHRocm93ICRyb290U2NvcGVNaW5FcnIoJ2luZmRpZycsCisgICAgICAgICAgICAgICAgJ3swfSAkZGlnZXN0KCkgaXRlcmF0aW9ucyByZWFjaGVkLiBBYm9ydGluZyFcbicgKworICAgICAgICAgICAgICAgICdXYXRjaGVycyBmaXJlZCBpbiB0aGUgbGFzdCA1IGl0ZXJhdGlvbnM6IHsxfScsCisgICAgICAgICAgICAgICAgVFRMLCB0b0pzb24od2F0Y2hMb2cpKTsKKyAgICAgICAgICB9CisKKyAgICAgICAgfSB3aGlsZSAoZGlydHkgfHwgYXN5bmNRdWV1ZS5sZW5ndGgpOworCisgICAgICAgIGNsZWFyUGhhc2UoKTsKKworICAgICAgICB3aGlsZShwb3N0RGlnZXN0UXVldWUubGVuZ3RoKSB7CisgICAgICAgICAgdHJ5IHsKKyAgICAgICAgICAgIHBvc3REaWdlc3RRdWV1ZS5zaGlmdCgpKCk7CisgICAgICAgICAgfSBjYXRjaCAoZSkgeworICAgICAgICAgICAgJGV4Y2VwdGlvbkhhbmRsZXIoZSk7CisgICAgICAgICAgfQorICAgICAgICB9CisgICAgICB9LAorCisKKyAgICAgIC8qKgorICAgICAgICogQG5nZG9jIGV2ZW50CisgICAgICAgKiBAbmFtZSAkcm9vdFNjb3BlLlNjb3BlIyRkZXN0cm95CisgICAgICAgKiBAZXZlbnRUeXBlIGJyb2FkY2FzdCBvbiBzY29wZSBiZWluZyBkZXN0cm95ZWQKKyAgICAgICAqCisgICAgICAgKiBAZGVzY3JpcHRpb24KKyAgICAgICAqIEJyb2FkY2FzdGVkIHdoZW4gYSBzY29wZSBhbmQgaXRzIGNoaWxkcmVuIGFyZSBiZWluZyBkZXN0cm95ZWQuCisgICAgICAgKgorICAgICAgICogTm90ZSB0aGF0LCBpbiBBbmd1bGFySlMsIHRoZX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IHVzZWZ1bCBmb3Igb3ZlcnJpZGluZyB2YWx1ZXMgaW4gc2NvcGUuCisgICAgICAgKiBAcmV0dXJucyB7Kn0gVGhlIHJlc3VsdCBvZiBldmFsdWF0aW5nIHRoZSBleHByZXNzaW9uLgorICAgICAgICovCisgICAgICAkZXZhbDogZnVuY3Rpb24oZXhwciwgbG9jYWxzKSB7CisgICAgICAgIHJldHVybiAkcGFyc2UoZXhwcikodGhpcywgbG9jYWxzKTsKKyAgICAgIH0sCisKKyAgICAgIC8qKgorICAgICAgICogQG5nZG9jIG1ldGhvZAorICAgICAgICogQG5hbWUgJHJvb3RTY29wZS5TY29wZSMkZXZhbEFzeW5jCisgICAgICAgKiBAa2luZCBmdW5jdGlvbgorICAgICAgICoKKyAgICAgICAqIEBkZXNjcmlwdGlvbgorICAgICAgICogRXhlY3V0ZXMgdGhlIGV4cHJlc3Npb24gb24gdGhlIGN1cnJlbnQgc2NvcGUgYXQgYSBsYXRlciBwb2ludCBpbiB0aW1lLgorICAgICAgICoKKyAgICAgICAqIFRoZSBgJGV2YWxBc3luY2AgbWFrZXMgbm8gZ3VhcmFudGVlcyBhcyB0byB3aGVuIHRoZSBgZXhwcmVzc2lvbmAgd2lsbCBiZSBleGVjdXRlZCwgb25seQorICAgICAgICogdGhhdDoKKyAgICAgICAqCisgICAgICAgKiAgIC0gaXQgd2lsbCBleGVjdXRlIGFmdGVyIHRoZSBmdW5jdGlvbiB0aGF0IHNjaGVkdWxlZCB0aGUgZXZhbHVhdGlvbiAocHJlZmVyYWJseSBiZWZvcmUgRE9NCisgICAgICAgKiAgICAgcmVuZGVyaW5nKS4KKyAgICAgICAqICAgLSBhdCBsZWFzdCBvbmUge0BsaW5rIG5nLiRyb290U2NvcGUuU2NvcGUjJGRpZ2VzdCAkZGlnZXN0IGN5Y2xlfSB3aWxsIGJlIHBlcmZvcm1lZCBhZnRlcgorICAgICAgICogICAgIGBleHByZXNzaW9uYCBleGVjdXRpb24uCisgICAgICAgKgorICAgICA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GFyZSBvdXRzaWRlIG9mIGFuICRkaWdlc3QgbG9vcCBhbmQgdGhpcyBpcyB0aGUgZmlyc3QgdGltZSB3ZSBhcmUgc2NoZWR1bGluZyBhc3luYworICAgICAgICAvLyB0YXNrIGFsc28gc2NoZWR1bGUgYXN5bmMgYXV0by1mbHVzaAorICAgICAgICBpZiAoISRyb290U2NvcGUuJCRwaGFzZSAmJiAhJHJvb3RTY29wZS4kJGFzeW5jUXVldWUubGVuZ3RoKSB7CisgICAgICAgICAgJGJyb3dzZXIuZGVmZXIoZnVuY3Rpb24oKSB7CisgICAgICAgICAgICBpZiAoJHJvb3RTY29wZS4kJGFzeW5jUXVldWUubGVuZ3RoKSB7CisgICAgICAgICAgICAgICRyb290U2NvcGUuJGRpZ2VzdCgpOworICAgICAgICAgICAgfQorICAgICAgICAgIH0pOworICAgICAgICB9CisKKyAgICAgICAgdGhpcy4kJGFzeW5jUXVldWUucHVzaCh7c2NvcGU6IHRoaXMsIGV4cHJlc3Npb246IGV4cHJ9KTsKKyAgICAgIH0sCisKKyAgICAgICQkcG9zdERpZ2VzdCA6IGZ1bmN0aW9uKGZuKSB7CisgICAgICAgIHRoaXMuJCRwb3N0RGlnZXN0UXVldWUucHVzaChmbik7CisgICAgICB9LAorCisgICAgICAvKioKKyAgICAgICAqIEBuZ2RvYyBtZXRob2QKKyAgICAgICAqIEBuYW1lICRyb290U2NvcGUuU2NvcGUjJGFwcGx5CisgICAgICAgKiBAa2luZCBmdW5jdGlvbgorICAgICAgICoKKyAgICAgICAqIEBkZXNjcmlwdGlvbgorICAgICAgICogYCRhcHBseSgpYCBpcyB1c2VkIHRvIGV4ZWN1dGUgYW4gZXhwcmVzc2lvbiBpbiBhbmd1bGFyIGZyb20gb3V0c2lkZSBvZiB0aGUgYW5ndWxhcgorICAgICAgICogZnJhbWV3b3JrLiAoRm9yIGV4YW1wbGUgZnJvbSBicm93c2VyIERPTSBldmVudHMsIHNldFRpbWVvdXQsIFhIUiBvciB0aGlyZCBwYXJ0eSBsaWJyYXJpZXMpLgorICAgICAgICogQmVjYXVzZSB3ZSBhcmUgY2FsbGluZyBpbnRvIHRoZSBhbmd1bGFyIGZyYW1ld29yayB3ZSBuZWVkIHRvIHBlcmZvcm0gcHJvcGVyIHNjb3BlIGxpZmUKKyAgICAgICAqIGN5Y2xlIG9mIHtAbGluayBuZy4kZXhjZXB0aW9uSGFuZGxlciBleGNlcHRpb24gaGFuZGxpbmd9LAorICAgICAgICoge0BsaW5rIG5nLiRyb290U2NvcGUuU2NvcGUjJGRpZ2VzdCBleGVjdXRpbmcgd2F0Y2hlc30uCisgICAgICAgKgorICAgICAgICogIyMgTGlmZSBjeWNsZQorICAgICAgICoKKyAgICAgICAqICMgUHNldWRvLUNvZGUgb2YgYCRhcHBseSgpYAorICAgICAgICogYGBganMKKyAgICAgICAgICAgZnVuY3Rpb24gJGFwcGx5KGV4cHIpIHsKKyAgICAgICAgICAgICB0cnkgeworICAgICAgICAgICAgICAgcmV0dXJuICRldmFsKGV4cHIpOworICAgICAgICAgICAgIH0gY2F0Y2ggKGUpIHsKKyAgICAgICAgICAgICAgICRleGNlcHRpb25IYW5kbGVyKGUpOworICAgICAgICAgICAgIH0gZmluYWxseSB7CisgICAgICAgICAgICAgICAkcm9vdC4kZGlnZXN0KCk7CisgICAgICAgICAgICAgfQorICAgICAgICAgICB9CisgICAgICAgKiBgYGAKKyAgICAgICAqCisgICAgICAgKgorICAgICAgICogU2NvcGUncyBgJGFwcGx5KClgIG1ldGhvZCB0cmFuc2l0aW9ucyB0aHJvdWdoIHRoZSBmb2xsb3dpbmcgc3RhZ2VzOgorICAgICAgICoKKyAgICAgICAqIDEuIFRoZSB7QGxpbmsgZ3VpZGUvZXhwcmVzc2lvbiBleHByZXNzaW9ufSBpcyBleGVjdXRlZCB1c2luZyB0aGUKKyAgICAgICAqICAgIHtAbGluayBuZy4kcm9vdFNjb3BlLlNjb3BlIyRldmFsICRldmFsKCl9IG1ldGhvZC4KKyAgICAgICAqIDI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uJGV2YWwoZXhwcik7CisgICAgICAgIH0gY2F0Y2ggKGUpIHsKKyAgICAgICAgICAkZXhjZXB0aW9uSGFuZGxlcihlKTsKKyAgICAgICAgfSBmaW5hbGx5IHsKKyAgICAgICAgICBjbGVhclBoYXNlKCk7CisgICAgICAgICAgdHJ5IHsKKyAgICAgICAgICAgICRyb290U2NvcGUuJGRpZ2VzdCgpOworICAgICAgICAgIH0gY2F0Y2ggKGUpIHsKKyAgICAgICAgICAgICRleGNlcHRpb25IYW5kbGVyKGUpOworICAgICAgICAgICAgdGhyb3cgZTsKKyAgICAgICAgICB9CisgICAgICAgIH0KKyAgICAgIH0sCisKKyAgICAgIC8qKgorICAgICAgICogQG5nZG9jIG1ldGhvZAorICAgICAgICogQG5hbWUgJHJvb3RTY29wZS5TY29wZSMkb24KKyAgICAgICAqIEBraW5kIGZ1bmN0aW9uCisgICAgICAgKgorICAgICAgICogQGRlc2NyaXB0aW9uCisgICAgICAgKiBMaXN0ZW5zIG9uIGV2ZW50cyBvZiBhIGdpdmVuIHR5cGUuIFNlZSB7QGxpbmsgbmcuJHJvb3RTY29wZS5TY29wZSMkZW1pdCAkZW1pdH0gZm9yCisgICAgICAgKiBkaXNjdXNzaW9uIG9mIGV2ZW50IGxpZmUgY3ljbGUuCisgICAgICAgKgorICAgICAgICogVGhlIGV2ZW50IGxpc3RlbmVyIGZ1bmN0aW9uIGZvcm1hdCBpczogYGZ1bmN0aW9uKGV2ZW50LCBhcmdzLi4uKWAuIFRoZSBgZXZlbnRgIG9iamVjdAorICAgICAgICogcGFzc2VkIGludG8gdGhlIGxpc3RlbmVyIGhhcyB0aGUgZm9sbG93aW5nIGF0dHJpYnV0ZXM6CisgICAgICAgKgorICAgICAgICogICAtIGB0YXJnZXRTY29wZWAgLSBge1Njb3BlfWA6IHRoZSBzY29wZSBvbiB3aGljaCB0aGUgZXZlbnQgd2FzIGAkZW1pdGAtZWQgb3IKKyAgICAgICAqICAgICBgJGJyb2FkY2FzdGAtZWQu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wgbGlzdGVuZXIpIHsKKyAgICAgICAgdmFyIG5hbWVkTGlzdGVuZXJzID0gdGhpcy4kJGxpc3RlbmVyc1tuYW1lXTsKKyAgICAgICAgaWYgKCFuYW1lZExpc3RlbmVycykgeworICAgICAgICAgIHRoaXMuJCRsaXN0ZW5lcnNbbmFtZV0gPSBuYW1lZExpc3RlbmVycyA9IFtdOworICAgICAgICB9CisgICAgICAgIG5hbWVkTGlzdGVuZXJzLnB1c2gobGlzdGVuZXIpOworCisgICAgICAgIHZhciBjdXJyZW50ID0gdGhpczsKKyAgICAgICAgZG8geworICAgICAgICAgIGlmICghY3VycmVudC4kJGxpc3RlbmVyQ291bnRbbmFtZV0pIHsKKyAgICAgICAgICAgIGN1cnJlbnQuJCRsaXN0ZW5lckNvdW50W25hbWVdID0gMDsKKyAgICAgICAgICB9CisgICAgICAgICAgY3VycmVudC4kJGxpc3RlbmVyQ291bnRbbmFtZV0rKzsKKyAgICAgICAgfSB3aGlsZSAoKGN1cnJlbnQgPSBjdXJyZW50LiRwYXJlbnQpKTsKKworICAgICAgICB2YXIgc2VsZiA9IHRoaXM7CisgICAgICAgIHJldHVybiBmdW5jdGlvbigpIHsKKyAgICAgICAgICBuYW1lZExpc3RlbmVyc1tpbmRleE9mKG5hbWVkTGlzdGVuZXJzLCBsaXN0ZW5lcildID0gbnVsbDsKKyAgICAgICAgICBkZWNyZW1lbnRMaXN0ZW5lckNvdW50KHNlbGYsIDEsIG5hbWUpOworICAgICAgICB9OworICAgICAgfSwKKworCisgICAgICAvKioKKyAgICAgICAqIEBuZ2RvYyBtZXRob2QKKyAgICAgICAqIEBuYW1lICRyb290U2NvcGUuU2NvcGUjJGVtaXQKKyAgICAgICAqIEBraW5kIGZ1bmN0aW9uCisgICAgICAgKgorICAgICAgICogQGRlc2NyaXB0aW9uCisgICAgICAgKiBEaXNwYXRjaGVzIGFuIGV2ZW50IGBuYW1lYCB1cHdhcmRzIHRocm91Z2ggdGhlIHNjb3BlIGhpZXJhcmN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b250byB0aGUgZXZlbnQgbGlzdGVuZXJzLgorICAgICAgICogQHJldHVybiB7T2JqZWN0fSBFdmVudCBvYmplY3QgKHNlZSB7QGxpbmsgbmcuJHJvb3RTY29wZS5TY29wZSMkb259KS4KKyAgICAgICAqLworICAgICAgJGVtaXQ6IGZ1bmN0aW9uKG5hbWUsIGFyZ3MpIHsKKyAgICAgICAgdmFyIGVtcHR5ID0gW10sCisgICAgICAgICAgICBuYW1lZExpc3RlbmVycywKKyAgICAgICAgICAgIHNjb3BlID0gdGhpcywKKyAgICAgICAgICAgIHN0b3BQcm9wYWdhdGlvbiA9IGZhbHNlLAorICAgICAgICAgICAgZXZlbnQgPSB7CisgICAgICAgICAgICAgIG5hbWU6IG5hbWUsCisgICAgICAgICAgICAgIHRhcmdldFNjb3BlOiBzY29wZSwKKyAgICAgICAgICAgICAgc3RvcFByb3BhZ2F0aW9uOiBmdW5jdGlvbigpIHtzdG9wUHJvcGFnYXRpb24gPSB0cnVlO30sCisgICAgICAgICAgICAgIHByZXZlbnREZWZhdWx0OiBmdW5jdGlvbigpIHsKKyAgICAgICAgICAgICAgICBldmVudC5kZWZhdWx0UHJldmVudGVkID0gdHJ1ZTsKKyAgICAgICAgICAgICAgfSwKKyAgICAgICAgICAgICAgZGVmYXVsdFByZXZlbnRlZDogZmFsc2UKKyAgICAgICAgICAgIH0sCisgICAgICAgICAgICBsaXN0ZW5lckFyZ3MgPSBjb25jYXQoW2V2ZW50XSwgYXJndW1lbnRzLCAxKSwKKyAgICAgICAgICAgIGksIGxlbmd0aDsKKworICAgICAgICBkbyB7CisgICAgICAgICAgbmFtZWRMaXN0ZW5lcnMgPSBzY29wZS4kJGxpc3RlbmVyc1tuYW1lXSB8fCBlbXB0eTsKKyAgICAgICAgICBldmVudC5jdXJyZW50U2NvcGUgPSBzY29wZTsKKyAgICAgICAgICBmb3IgKGk9MCwgbGVuZ3RoPW5hbWVkTGlzdGVuZXJzLmxlbmd0aDsgaTxsZW5ndGg7IGkrKykgeworCisgICAgICAgICAgICAvLyBpZiBsaXN0ZW5lcnMgd2VyZSBkZXJlZ2lzdGVyZWQsIGRlZnJhZ21lbnQgdGhlIGFycmF5CisgICAgICAgICAgICBpZiAoIW5hbWVkTGlzdGVuZXJzW2ldKSB7CisgICAgICAgICAgICAgIG5hbWVkTGlzdGVuZXJzLnNwbGljZShpLCAxKTsKKyAgICAgICAgICAgICAgaS0tOworICAgICAgICAgICAgICBsZW5ndGgtLTsKKyAgICAgICAgICAgICAgY29udGludWU7CisgICAgICAgICAgICB9CisgICAgICAgICAgICB0cnkgeworICAgICAgICAgICAgICAvL2FsbG93IGFsbCBsaXN0ZW5lcnMgYXR0YWNoZWQgdG8gdGhlIGN1cnJlbnQgc2NvcGUgdG8gcnVuCisgICAgICAgICAgICAgIG5hbWVkTGlzdGVuZXJzW2ldLmFwcGx5KG51bGwsIGxpc3RlbmVyQXJncyk7CisgICAgICAgICAgICB9IGNhdGNoIChlKSB7CisgICAgICAgICAgICAgICRleGNlcHRpb25IYW5kbGVyKGUpOworICAgICAgICAgICAgfQorICAgICAgICAgIH0KKyAgICAgICAgICAvL2lmIGFueSBsaXN0ZW5lciBvbiB0aGUgY3VycmVudCBzY29wZSBzdG9wcyBwcm9wYWdhdGlvbiwgcHJldmVudCBidWJibGluZworICAgICAgICAgIGlmIChzdG9wUHJvcGFnYXRpb24pIHJldHVybiBldmVudDsKKyAgICAgICAgICAvL3RyYXZlcnNlIHVwd2FyZHMKKyAgICAgICAgICBzY29wZSA9IHNjb3BlLiRwYXJlbnQ7CisgICAgICAgIH0gd2hpbGUgKHNjb3BlKTsKKworICAgICAgICByZXR1cm4gZXZlbnQ7CisgICAgICB9LAorCisKKyAgICAgIC8qKgorICAgICAgICogQG5nZG9jIG1ldGhvZAorICAgICAgICogQG5hbWUgJHJvb3RTY29wZS5TY29wZSMkYnJvYWRjYXN0CisgICAgICAgKiBAa2luZCBmdW5jdGlvbgorICAgICAgICoKKyAgICAgICAqIEBkZXNjcmlwdG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uCisgICAgICAgKiBAcGFyYW0gey4uLip9IGFyZ3MgT3B0aW9uYWwgb25lIG9yIG1vcmUgYXJndW1lbnRzIHdoaWNoIHdpbGwgYmUgcGFzc2VkIG9udG8gdGhlIGV2ZW50IGxpc3RlbmVycy4KKyAgICAgICAqIEByZXR1cm4ge09iamVjdH0gRXZlbnQgb2JqZWN0LCBzZWUge0BsaW5rIG5nLiRyb290U2NvcGUuU2NvcGUjJG9ufQorICAgICAgICovCisgICAgICAkYnJvYWRjYXN0OiBmdW5jdGlvbihuYW1lLCBhcmdzKSB7CisgICAgICAgIHZhciB0YXJnZXQgPSB0aGlzLAorICAgICAgICAgICAgY3VycmVudCA9IHRhcmdldCwKKyAgICAgICAgICAgIG5leHQgPSB0YXJnZXQsCisgICAgICAgICAgICBldmVudCA9IHsKKyAgICAgICAgICAgICAgbmFtZTogbmFtZSwKKyAgICAgICAgICAgICAgdGFyZ2V0U2NvcGU6IHRhcmdldCwKKyAgICAgICAgICAgICAgcHJldmVudERlZmF1bHQ6IGZ1bmN0aW9uKCkgeworICAgICAgICAgICAgICAgIGV2ZW50LmRlZmF1bHRQcmV2ZW50ZWQgPSB0cnVlOworICAgICAgICAgICAgICB9LAorICAgICAgICAgICAgICBkZWZhdWx0UHJldmVudGVkOiBmYWxzZQorICAgICAgICAgICAgfSwKKyAgICAgICAgICAgIGxpc3RlbmVyQXJncyA9IGNvbmNhdChbZXZlbnRdLCBhcmd1bWVudHMsIDEpLAorICAgICAgICAgICAgbGlzdGVuZXJzLCBpLCBsZW5ndGg7CisKKyAgICAgICAgLy9kb3duIHdoaWxlIHlvdSBjYW4sIHRoZW4gdXAgYW5kIG5leHQgc2libGluZyBvciB1cCBhbmQgbmV4dCBzaWJsaW5nIHVudGlsIGJhY2sgYXQgcm9vdAorICAgICAgICB3aGlsZSAoKGN1cnJlbnQgPSBuZXh0KSkgeworICAgICAgICAgIGV2ZW50LmN1cnJlbnRTY29wZSA9IGN1cnJlbnQ7CisgICAgICAgICAgbGlzdGVuZXJzID0gY3VycmVudC4kJGxpc3RlbmVyc1tuYW1lXSB8fCBbXTsKKyAgICAgICAgICBmb3IgKGk9MCwgbGVuZ3RoID0gbGlzdGVuZXJzLmxlbmd0aDsgaTxsZW5ndGg7IGkrKykgeworICAgICAgICAgICAgLy8gaWYgbGlzdGVuZXJzIHdlcmUgZGVyZWdpc3RlcmVkLCBkZWZyYWdtZW50IHRoZSBhcnJheQorICAgICAgICAgICAgaWYgKCFsaXN0ZW5lcnNbaV0pIHsKKyAgICAgICAgICAgICAgbGlzdGVuZXJzLnNwbGljZShpLCAxKTsKKyAgICAgICAgICAgICAgaS0tOworICAgICAgICAgICAgICBsZW5ndGgtLTsKKyAgICAgICAgICAgICAgY29udGludWU7CisgICAgICAgICAgICB9CisKKyAgICAgICAgICAgIHRyeSB7CisgICAgICAgICAgICAgIGxpc3RlbmVyc1tpXS5hcHBseShudWxsLCBsaXN0ZW5lckFyZ3MpOworICAgICAgICAgICAgfSBjYXRjaChlKSB7CisgICAgICAgICAgICAgICRleGNlcHRpb25IYW5kbGVyKGUpOworICAgICAgICAgICAgfQorICAgICAgICAgIH0KKworICAgICAgICAgIC8vIEluc2FuaXR5IFdhcm5pbmc6IHNjb3BlIGRlcHRoLWZpcnN0IHRyYXZlcnNhbAorICAgICAgICAgIC8vIHllcywgdGhpcyBjb2RlIGlzIGEgYml0IGNyYXp5LCBidXQgaXQgd29ya3MgYW5kIHdlIGhhdmUgdGVzdHMgdG8gcHJvdmUgaXQhCisgICAgICAgICAgLy8gdGhpcyBwaWVjZSBzaG91bGQgYmUga2VwdCBpbiBzeW5jIHdpdGggdGhlIHRyYXZlcnNhbCBpbiAkZGlnZXN0CisgICAgICAgICAgLy8gKHRob3VnaCBpdCBkaWZmZXJzIGR1ZSB0byBoYXZpbmcgdGhlIGV4dHJhIGNoZWNrIGZvciAkJGxpc3RlbmVyQ291bnQpCisgICAgICAgICAgaWYgKCEobmV4dCA9ICgoY3VycmVudC4kJGxpc3RlbmVyQ291bnRbbmFtZV0gJiYgY3VycmVudC4kJGNoaWxkSGVhZCkgfHwKKyAgICAgICAgICAgICAgKGN1cnJlbnQgIT09IHRhcmdldCAmJiBjdXJyZW50LiQkbmV4dFNpYmxpbmcpKSkpIHsKKyAgICAgICAgICAgIHdoaWxlKGN1cnJlbnQgIT09IHRhcmdldCAmJiAhKG5leHQgPSBjdXJyZW50LiQkbmV4dFNpYmxpbmcpKSB7CisgICAgICAgICAgICAgIGN1cnJlbnQgPSBjdXJyZW50LiRwYXJlbnQ7CisgICAgICAgICAgICB9CisgICAgICAgICAgfQorICAgICAgICB9CisKKyAgICAgICAgcmV0dXJuIGV2ZW50OworICAgICAgfQorICAgIH07CisKKyAgICB2YXIgJHJvb3RTY29wZSA9IG5ldyBTY29wZSgpOworCisgICAgcmV0dXJuICRyb290U2NvcGU7CisKKworICAgIGZ1bmN0aW9uIGJlZ2luUGhhc2UocGhhc2UpIHsKKyAgICAgIGlmICgkcm9vdFNjb3BlLiQkcGhhc2UpIHsKKyAgICAgICAgdGhyb3cgJHJvb3RTY29wZU1pbkVycignaW5wcm9nJywgJ3swfSBhbHJlYWR5IGluIHByb2dyZXNzJywgJHJvb3RTY29wZS4kJHBoYXNlKTsKKyAgICAgIH0KKworICAgICAgJHJvb3RTY29wZS4kJHBoYXNlID0gcGhhc2U7CisgICAgfQorCisgICAgZnVuY3Rpb24gY2xlYXJQaGFzZSgpIHsKKyAgICAgICRyb290U2NvcGUuJCRwaGFzZSA9IG51bGw7CisgICAgfQorCisgICAgZnVuY3Rpb24gY29tcGlsZVRvRm4oZXhwLCBuYW1lKSB7CisgICAgICB2YXIgZm4gPSAkcGFyc2UoZXhwKTsKKyAgICAgIGFzc2VydEFyZ0ZuKGZuLCBuYW1lKTsKKyAgICAgIHJldHVybiBmbjsKKyAgICB9CisKKyAgICBmdW5jdGlvbiBkZWNyZW1lbnRMaXN0ZW5lckNvdW50KGN1cnJlbnQsIGNvdW50LCBuYW1lKSB7CisgICAgICBk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JzZWRVcmwpOworICAgICAgfSBlbHNlIHsKKyAgICAgICAgLy8gZGVmaW5pdGVseSBhIHJlZ2V4LiAgU2VlIGFkanVzdE1hdGNoZXJzKCkKKyAgICAgICAgcmV0dXJuICEhbWF0Y2hlci5leGVjKHBhcnNlZFVybC5ocmVmKTsKKyAgICAgIH0KKyAgICB9CisKKyAgICBmdW5jdGlvbiBpc1Jlc291cmNlVXJsQWxsb3dlZEJ5UG9saWN5KHVybCkgeworICAgICAgdmFyIHBhcnNlZFVybCA9IHVybFJlc29sdmUodXJsLnRvU3RyaW5nKCkpOworICAgICAgdmFyIGksIG4sIGFsbG93ZWQgPSBmYWxzZTsKKyAgICAgIC8vIEVuc3VyZSB0aGF0IGF0IGxlYXN0IG9uZSBpdGVtIGZyb20gdGhlIHdoaXRlbGlzdCBhbGxvd3MgdGhpcyB1cmwuCisgICAgICBmb3IgKGkgPSAwLCBuID0gcmVzb3VyY2VVcmxXaGl0ZWxpc3QubGVuZ3RoOyBpIDwgbjsgaSsrKSB7CisgICAgICAgIGlmIChtYXRjaFVybChyZXNvdXJjZVVybFdoaXRlbGlzdFtpXSwgcGFyc2VkVXJsKSkgeworICAgICAgICAgIGFsbG93ZWQgPSB0cnVlOworICAgICAgICAgIGJyZWFrOworICAgICAgICB9CisgICAgICB9CisgICAgICBpZiAoYWxsb3dlZCkgeworICAgICAgICAvLyBFbnN1cmUgdGhhdCBubyBpdGVtIGZyb20gdGhlIGJsYWNrbGlzdCBibG9ja2VkIHRoaXMgdXJsLgorICAgICAgICBmb3IgKGkgPSAwLCBuID0gcmVzb3VyY2VVcmxCbGFja2xpc3QubGVuZ3RoOyBpIDwgbjsgaSsrKSB7CisgICAgICAgICAgaWYgKG1hdGNoVXJsKHJlc291cmNlVXJsQmxhY2tsaXN0W2ldLCBwYXJzZWRVcmwpKSB7CisgICAgICAgICAgICBhbGxvd2VkID0gZmFsc2U7CisgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICB9CisgICAgICAgIH0KK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XBwb3J0ID0ge30sCisgICAgICAgIGFuZHJvaWQgPQorICAgICAgICAgIGludCgoL2FuZHJvaWQgKFxkKykvLmV4ZWMobG93ZXJjYXNlKCgkd2luZG93Lm5hdmlnYXRvciB8fCB7fSkudXNlckFnZW50KSkgfHwgW10pWzFdKSwKKyAgICAgICAgYm94ZWUgPSAvQm94ZWUvaS50ZXN0KCgkd2luZG93Lm5hdmlnYXRvciB8fCB7fSkudXNlckFnZW50KSwKKyAgICAgICAgZG9jdW1lbnQgPSAkZG9jdW1lbnRbMF0gfHwge30sCisgICAgICAgIGRvY3VtZW50TW9kZSA9IGRvY3VtZW50LmRvY3VtZW50TW9kZSwKKyAgICAgICAgdmVuZG9yUHJlZml4LAorICAgICAgICB2ZW5kb3JSZWdleCA9IC9eKE1venx3ZWJraXR8T3xtcykoPz1bQS1aXSkvLAorICAgICAgICBib2R5U3R5bGUgPSBkb2N1bWVudC5ib2R5ICYmIGRvY3VtZW50LmJvZHkuc3R5bGUsCisgICAgICAgIHRyYW5zaXRpb25zID0gZmFsc2UsCisgICAgICAgIGFuaW1hdGlvbnMgPSBmYWxzZSwKKyAgICAgICAgbWF0Y2g7CisKKyAgICBpZiAoYm9keVN0eWxlKSB7CisgICAgICBmb3IodmFyIHByb3AgaW4gYm9keVN0eWxlKSB7CisgICAgICAgIGlmKG1hdGNoID0gdmVuZG9yUmVnZXguZXhlYyhwcm9wKSkgeworICAgICAgICAgIHZlbmRvclByZWZpeCA9IG1hdGNoWzBdOworICAgICAgICAgIHZlbmRvclByZWZpeCA9IHZlbmRvclByZWZpeC5zdWJzdHIoMCwgMSkudG9VcHBlckNhc2UoKSArIHZlbmRvclByZWZpeC5zdWJzdHIoMSk7CisgICAgICAgICAgYnJlYWs7CisgICAgICAgIH0KKyAgICAgIH0KKworICAgICAgaWYoIXZlbmRvclByZWZpeCkgeworICAgICAgICB2ZW5kb3JQcmVmaXggPSAoJ1dlYmtpdE9wYWNpdHknIGluIGJvZHlTdHlsZSkgJiYg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gICAgICAgICAgdmFyIGRpdkVsbSA9IGRvY3VtZW50LmNyZWF0ZUVsZW1lbnQoJ2RpdicpOworICAgICAgICAgIGV2ZW50U3VwcG9ydFtldmVudF0gPSAnb24nICsgZXZlbnQgaW4gZGl2RWxtOworICAgICAgICB9CisKKyAgICAgICAgcmV0dXJuIGV2ZW50U3VwcG9ydFtldmVudF07CisgICAgICB9LAorICAgICAgY3NwOiBjc3AoKSwKKyAgICAgIHZlbmRvclByZWZpeDogdmVuZG9yUHJlZml4LAorICAgICAgdHJhbnNpdGlvbnMgOiB0cmFuc2l0aW9ucywKKyAgICAgIGFuaW1hdGlvbnMgOiBhbmltYXRpb25zLAorICAgICAgYW5kcm9pZDogYW5kcm9pZCwKKyAgICAgIG1zaWUgOiBtc2llLAorICAgICAgbXNpZURvY3VtZW50TW9kZTogZG9jdW1lbnRNb2RlCisgICAgfTsKKyAgfV07Cit9CisKK2Z1bmN0aW9uICRUaW1lb3V0UHJvdmlkZXIoKSB7CisgIHRoaXMuJGdldCA9IFsnJHJvb3RTY29wZScsICckYnJvd3NlcicsICckcScsICckZXhjZXB0aW9uSGFuZGxlcicsCisgICAgICAgZnVuY3Rpb24oJHJvb3RTY29wZSwgICAkYnJvd3NlciwgICAkcSwgICAkZXhjZXB0aW9uSGFuZGxlcikgeworICAgIHZhciBkZWZlcnJlZHMgPSB7fTsKKworCisgICAgIC8qKgorICAgICAgKiBAbmdkb2Mgc2VydmljZQorICAgICAgKiBAbmFtZSAkdGltZW91dAorICAgICAgKgorICAgICAgKiBAZGVzY3JpcHRpb24KKyAgICAgICogQW5ndWxhcidzIHdyYXBwZXIgZm9yIGB3aW5kb3cuc2V0VGltZW91dGAuIFRoZSBgZm5gIGZ1bmN0aW9uIGlzIHdyYXBwZWQgaW50byBhIHRyeS9jYXRjaAorICAgICAgKiBibG9jayBhbmQgZGVsZWdhdGVzIGFueSBleGNlcHRpb25zIHRvCisgICAgICAqIHtAbGluayBuZy4kZXhjZXB0aW9uSGFuZG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XNvbHZlZCB3aGVuIHRoZSB0aW1lb3V0IGlzIHJlYWNoZWQuIFRoZSB2YWx1ZSB0aGlzCisgICAgICAqICAgcHJvbWlzZSB3aWxsIGJlIHJlc29sdmVkIHdpdGggaXMgdGhlIHJldHVybiB2YWx1ZSBvZiB0aGUgYGZuYCBmdW5jdGlvbi4KKyAgICAgICoKKyAgICAgICovCisgICAgZnVuY3Rpb24gdGltZW91dChmbiwgZGVsYXksIGludm9rZUFwcGx5KSB7CisgICAgICB2YXIgZGVmZXJyZWQgPSAkcS5kZWZlcigpLAorICAgICAgICAgIHByb21pc2UgPSBkZWZlcnJlZC5wcm9taXNlLAorICAgICAgICAgIHNraXBBcHBseSA9IChpc0RlZmluZWQoaW52b2tlQXBwbHkpICYmICFpbnZva2VBcHBseSksCisgICAgICAgICAgdGltZW91dElkOworCisgICAgICB0aW1lb3V0SWQgPSAkYnJvd3Nlci5kZWZlcihmdW5jdGlvbigpIHsKKyAgICAgICAgdHJ5IHsKKyAgICAgICAgICBkZWZlcnJlZC5yZXNvbHZlKGZuKCkpOworICAgICAgICB9IGNhdGNoKGUpIHsKKyAgICAgICAgICBkZWZlcnJlZC5yZWplY3QoZSk7CisgICAgICAgICAgJGV4Y2VwdGlvbkhhbmRsZXIoZSk7CisgICAgICAgIH0KKyAgICAgICAgZmluYWxseSB7CisgICAgICAgICAgZGVsZXRlIGRlZmVycmVkc1twcm9taXNlLiQkdGltZW91dElkXTsKKyAgICAgICAgfQorCisgICAgICAgIGlmICghc2tpcEFwcGx5KSAkcm9vdFNjb3BlLiRhcHBseSgpOworICAgICAgfSwgZGVsYXkpOworCisgICAgICBwcm9taXNlLiQkdGltZW91dElkID0gdGltZW91dElkOworICAgICAgZGVmZXJyZWRzW3RpbWVvdXRJZF0gPSBkZWZlcnJlZDsKKworICAgICAgcmV0dXJuIHByb21pc2U7CisgICAgfQorCisKKyAgICAgLyoqCisgICAgICAqIEBuZ2RvYyBtZXRob2QKKyAgICAgICogQG5hbWUgJHR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bXBsZSBtb2R1bGU9IndpbmRvd0V4YW1wbGUiPgorICAgICA8ZmlsZSBuYW1lPSJpbmRleC5odG1sIj4KKyAgICAgICA8c2NyaXB0PgorICAgICAgICAgYW5ndWxhci5tb2R1bGUoJ3dpbmRvd0V4YW1wbGUnLCBbXSkKKyAgICAgICAgICAgLmNvbnRyb2xsZXIoJ0V4YW1wbGVDb250cm9sbGVyJywgWyckc2NvcGUnLCAnJHdpbmRvdycsIGZ1bmN0aW9uICgkc2NvcGUsICR3aW5kb3cpIHsKKyAgICAgICAgICAgICAkc2NvcGUuZ3JlZXRpbmcgPSAnSGVsbG8sIFdvcmxkISc7CisgICAgICAgICAgICAgJHNjb3BlLmRvR3JlZXRpbmcgPSBmdW5jdGlvbihncmVldGluZykgeworICAgICAgICAgICAgICAgJHdpbmRvdy5hbGVydChncmVldGluZyk7CisgICAgICAgICAgICAgfTsKKyAgICAgICAgICAgfV0pOworICAgICAgIDwvc2NyaXB0PgorICAgICAgIDxkaXYgbmctY29udHJvbGxlcj0iRXhhbXBsZUNvbnRyb2xsZXIiPgorICAgICAgICAgPGlucHV0IHR5cGU9InRleHQiIG5nLW1vZGVsPSJncmVldGluZyIgLz4KKyAgICAgICAgIDxidXR0b24gbmctY2xpY2s9ImRvR3JlZXRpbmcoZ3JlZXRpbmcpIj5BTEVSVDwvYnV0dG9uPgorICAgICAgIDwvZGl2PgorICAgICA8L2ZpbGU+CisgICAgIDxmaWxlIG5hbWU9InByb3RyYWN0b3IuanMiIHR5cGU9InByb3RyYWN0b3IiPgorICAgICAgaXQoJ3Nob3VsZCBkaXNwbGF5IHRoZSBncmVldGluZyBpbiB0aGUgaW5wdXQgYm94JywgZnVuY3Rpb24oKSB7CisgICAgICAgZWxlbWVudChieS5tb2RlbCgnZ3JlZXRpbmcnKSkuc2VuZEtleXMoJ0hlbGxvLCBFMkUgVGVzdHMnKTsKKyAgICAgICAvLyBJZiB3ZSBjbGljayB0aGUgYnV0dG9uIGl0IHdpbGwgYmxv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ybiBhcnJheTsKKworICAgIHZhciBjb21wYXJhdG9yVHlwZSA9IHR5cGVvZihjb21wYXJhdG9yKSwKKyAgICAgICAgcHJlZGljYXRlcyA9IFtdOworCisgICAgcHJlZGljYXRlcy5jaGVjayA9IGZ1bmN0aW9uKHZhbHVlKSB7CisgICAgICBmb3IgKHZhciBqID0gMDsgaiA8IHByZWRpY2F0ZXMubGVuZ3RoOyBqKyspIHsKKyAgICAgICAgaWYoIXByZWRpY2F0ZXNbal0odmFsdWUpKSB7CisgICAgICAgICAgcmV0dXJuIGZhbHNlOworICAgICAgICB9CisgICAgICB9CisgICAgICByZXR1cm4gdHJ1ZTsKKyAgICB9OworCisgICAgaWYgKGNvbXBhcmF0b3JUeXBlICE9PSAnZnVuY3Rpb24nKSB7CisgICAgICBpZiAoY29tcGFyYXRvclR5cGUgPT09ICdib29sZWFuJyAmJiBjb21wYXJhdG9yKSB7CisgICAgICAgIGNvbXBhcmF0b3IgPSBmdW5jdGlvbihvYmosIHRleHQpIHsKKyAgICAgICAgICByZXR1cm4gYW5ndWxhci5lcXVhbHMob2JqLCB0ZXh0KTsKKyAgICAgICAgfTsKKyAgICAgIH0gZWxzZSB7CisgICAgICAgIGNvbXBhcmF0b3IgPSBmdW5jdGlvbihvYmosIHRleHQpIHsKKyAgICAgICAgICBpZiAob2JqICYmIHRleHQgJiYgdHlwZW9mIG9iaiA9PT0gJ29iamVjdCcgJiYgdHlwZW9mIHRleHQgPT09ICdvYmplY3QnKSB7CisgICAgICAgICAgICBmb3IgKHZhciBvYmpLZXkgaW4gb2JqKSB7CisgICAgICAgICAgICAgIGlmIChvYmpLZXkuY2hhckF0KDApICE9PSAnJCcgJiYgaGFzT3duUHJvcGVydHkuY2FsbChvYmosIG9iaktleSkgJiYKKyAgICAgICAgICAgICAgICAgIGNvbXBhcmF0b3Iob2JqW29iaktleV0sIHRleHRbb2JqS2V5XSkpIHsKKyAgICAgICAgICAgICAgICByZXR1cm4gdHJ1ZTsKKyAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfQorICAgICAgICAgICAgcmV0dXJuIGZhbHNlOworICAgICAgICAgIH0KKyAgICAgICAgICB0ZXh0ID0gKCcnK3RleHQpLnRvTG93ZXJDYXNlKCk7CisgICAgICAgICAgcmV0dXJuICgnJytvYmopLnRvTG93ZXJDYXNlKCkuaW5kZXhPZih0ZXh0KSA+IC0xOworICAgICAgICB9OworICAgICAgfQorICAgIH0KKworICAgIHZhciBzZWFyY2ggPSBmdW5jdGlvbihvYmosIHRleHQpeworICAgICAgaWYgKHR5cGVvZiB0ZXh0ID09ICdzdHJpbmcnICYmIHRleHQuY2hhckF0KDApID09PSAnIScpIHsKKyAgICAgICAgcmV0dXJuICFzZWFyY2gob2JqLCB0ZXh0LnN1YnN0cigxKSk7CisgICAgICB9CisgICAgICBzd2l0Y2ggKHR5cGVvZiBvYmopIHsKKyAgICAgICAgY2FzZSAiYm9vbGVhbiI6CisgICAgICAgIGNhc2UgIm51bWJlciI6CisgICAgICAgIGNhc2UgInN0cmluZyI6CisgICAgICAgICAgcmV0dXJuIGNvbXBhcmF0b3Iob2JqLCB0ZXh0KTsKKyAgICAgICAgY2FzZSAib2JqZWN0IjoKKyAgICAgICAgICBzd2l0Y2ggKHR5cGVvZiB0ZXh0KSB7CisgICAgICAgICAgICBjYXNlICJvYmplY3QiOgorICAgICAgICAgICAgICByZXR1cm4gY29tcGFyYXRvcihvYmosIHRleHQpOworICAgICAgICAgICAgZGVmYXVsdDoKKyAgICAgICAgICAgICAgZm9yICggdmFyIG9iaktleSBpbiBvYmopIHsKKyAgICAgICAgICAgICAgICBpZiAob2JqS2V5LmNoYXJBdCgwKSAhPT0gJyQnICYmIHNlYXJjaChvYmpbb2JqS2V5XSwgdGV4dCkpIHsKKyAgICAgICAgICAgICAgICAgIHJldHVybiB0cnVlOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICB9CisgICAgICAgICAgcmV0dXJuIGZhbHNlOworICAgICAgICBjYXNlICJhcnJheSI6CisgICAgICAgICAgZm9yICggdmFyIGkgPSAwOyBpIDwgb2JqLmxlbmd0aDsgaSsrKSB7CisgICAgICAgICAgICBpZiAoc2VhcmNoKG9ialtpXSwgdGV4dCkpIHsKKyAgICAgICAgICAgICAgcmV0dXJuIHRydWU7CisgICAgICAgICAgICB9CisgICAgICAgICAgfQorICAgICAgICAgIHJldHVybiBmYWxzZTsKKyAgICAgICAgZGVmYXVsdDoKKyAgICAgICAgICByZXR1cm4gZmFsc2U7CisgICAgICB9CisgICAgfTsKKyAgICBzd2l0Y2ggKHR5cGVvZiBleHByZXNzaW9uKSB7CisgICAgICBjYXNlICJib29sZWFuIjoKKyAgICAgIGNhc2UgIm51bWJlciI6CisgICAgICBjYXNlICJzdHJpbmciOgorICAgICAgICAvLyBTZXQgdXAgZXhwcmVzc2lvbiBvYmplY3QgYW5kIGZhbGwgdGhyb3VnaAorICAgICAgICBleHByZXNzaW9uID0geyQ6ZXhwcmVzc2lvbn07CisgICAgICAgIC8vIGpzaGludCAtVzA4NgorICAgICAgY2FzZSAib2JqZWN0IjoKKyAgICAgICAgLy8ganNoaW50ICtXMDg2CisgICAgICAgIGZvciAodmFyIGtleSBpbiBleHByZXNzaW9uKSB7CisgICAgICAgICAgKGZ1bmN0aW9uKHBhdGgpIHsKKyAgICAgICAgICAgIGlmICh0eXBlb2YgZXhwcmVzc2lvbltwYXRoXSA9PT0gJ3VuZGVmaW5lZCcpIHJldHVybjsKKyAgICAgICAgICAgIHByZWRpY2F0ZXMucHVzaChmdW5jdGlvbih2YWx1ZSkgeworICAgICAgICAgICAgICByZXR1cm4gc2VhcmNoKHBhdGggPT0gJyQnID8gdmFsdWUgOiAodmFsdWUgJiYgdmFsdWVbcGF0aF0pLCBleHByZXNzaW9uW3BhdGhdKTsKKyAgICAgICAgICAgIH0pOworICAgICAgICAgIH0pKGtleSk7CisgICAgICAgIH0KKyAgICAgICAgYnJlYWs7CisgIC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91cFNlcCwgZGVjaW1hbFNlcCwgZnJhY3Rpb25TaXplKSB7CisgIGlmIChudW1iZXIgPT0gbnVsbCB8fCAhaXNGaW5pdGUobnVtYmVyKSB8fCBpc09iamVjdChudW1iZXIpKSByZXR1cm4gJyc7CisKKyAgdmFyIGlzTmVnYXRpdmUgPSBudW1iZXIgPCAwOworICBudW1iZXIgPSBNYXRoLmFicyhudW1iZXIpOworICB2YXIgbnVtU3RyID0gbnVtYmVyICsgJycsCisgICAgICBmb3JtYXRlZFRleHQgPSAnJywKKyAgICAgIHBhcnRzID0gW107CisKKyAgdmFyIGhhc0V4cG9uZW50ID0gZmFsc2U7CisgIGlmIChudW1TdHIuaW5kZXhPZignZScpICE9PSAtMSkgeworICAgIHZhciBtYXRjaCA9IG51bVN0ci5tYXRjaCgvKFtcZFwuXSspZSgtPykoXGQrKS8pOworICAgIGlmIChtYXRjaCAmJiBtYXRjaFsyXSA9PSAnLScgJiYgbWF0Y2hbM10gPiBmcmFjdGlvblNpemUgKyAxKSB7CisgICAgICBudW1TdHIgPSAnMCc7CisgICAgICBudW1iZXIgPSAwOworICAgIH0gZWxzZSB7CisgICAgICBmb3JtYXRlZFRleHQgPSBudW1TdHI7CisgICAgICBoYXNFeHBvbmVudCA9IHRydWU7CisgICAgfQorICB9CisKKyAgaWYgKCFoYXNFeHBvbmVudCkgeworICAgIHZhciBmcmFjdGlvbkxlbiA9IChudW1TdHIuc3BsaXQoREVDSU1BTF9TRVApWzFdIHx8ICcnKS5sZW5ndGg7CisKKyAgICAvLyBkZXRlcm1pbmUgZnJhY3Rpb25TaXplIGlmIGl0IGlzIG5vdCBzcGVjaWZpZWQKKyAgICBpZiAoaXNVbmRlZmluZWQoZnJhY3Rpb25TaXplKSkgeworICAgICAgZnJhY3Rpb25TaXplID0gTWF0aC5taW4oTWF0aC5tYXgocGF0dGVybi5taW5GcmFjLCBmcmFjdGlvbkxlbiksIHBhdHRlcm4ubWF4RnJhYyk7CisgICAgfQorCisgICAgLy8g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gOiAiIjsKKworICBwYWRkZWRab25lICs9IHBhZE51bWJlcihNYXRoW3pvbmUgPiAwID8gJ2Zsb29yJyA6ICdjZWlsJ10oem9uZSAvIDYwKSwgMikgKworICAgICAgICAgICAgICAgIHBhZE51bWJlcihNYXRoLmFicyh6b25lICUgNjApLCAyKTsKKworICByZXR1cm4gcGFkZGVkWm9uZTsKK30KKworZnVuY3Rpb24gYW1wbUdldHRlcihkYXRlLCBmb3JtYXRzKSB7CisgIHJldHVybiBkYXRlLmdldEhvdXJzKCkgPCAxMiA/IGZvcm1hdHMuQU1QTVNbMF0gOiBmb3JtYXRzLkFNUE1TWzFdOworfQorCit2YXIgREFURV9GT1JNQVRTID0geworICB5eXl5OiBkYXRlR2V0dGVyKCdGdWxsWWVhcicsIDQpLAorICAgIHl5OiBkYXRlR2V0dGVyKCdGdWxsWWVhcicsIDIsIDAsIHRydWUpLAorICAgICB5OiBkYXRlR2V0dGVyKCdGdWxsWWVhcicsIDEpLAorICBNTU1NOiBkYXRlU3RyR2V0dGVyKCdNb250aCcpLAorICAgTU1NOiBkYXRlU3RyR2V0dGVyKCdNb250aCcsIHRydWUpLAorICAgIE1NOiBkYXRlR2V0dGVyKCdNb250aCcsIDIsIDEpLAorICAgICBNOiBkYXRlR2V0dGVyKCdNb250aCcsIDEsIDEpLAorICAgIGRkOiBkYXRlR2V0dGVyKCdEYXRlJywgMiksCisgICAgIGQ6IGRhdGVHZXR0ZXIoJ0RhdGUnLCAxKSwKKyAgICBISDogZGF0ZUdldHRlcignSG91cnMnLCAyKSwKKyAgICAgSDogZGF0ZUdldHRlcignSG91cnMnLCAxKSwKKyAgICBoaDogZGF0ZUdldHRlcignSG91cnMnLCAyLCAtMTIpLAorICAgICBoOiBkYXRlR2V0dGVyKCdIb3VycycsIDEsIC0xMiksCisgICAgbW06IGRhdGVHZXR0ZXIoJ01pbnV0ZXMnLCAyKSwKKyAgICAgbTogZGF0ZUdldHRlcignTWludXRlcycsIDEpLAorICAgIHNzOiBk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ShkYXRlKSkgeworICAgICAgcmV0dXJuIGRhdGU7CisgICAgfQorCisgICAgd2hpbGUoZm9ybWF0KSB7CisgICAgICBtYXRjaCA9IERBVEVfRk9STUFUU19TUExJVC5leGVjKGZvcm1hdCk7CisgICAgICBpZiAobWF0Y2gpIHsKKyAgICAgICAgcGFydHMgPSBjb25jYXQocGFydHMsIG1hdGNoLCAxKTsKKyAgICAgICAgZm9ybWF0ID0gcGFydHMucG9wKCk7CisgICAgICB9IGVsc2UgeworICAgICAgICBwYXJ0cy5wdXNoKGZvcm1hdCk7CisgICAgICAgIGZvcm1hdCA9IG51bGw7CisgICAgICB9CisgICAgfQorCisgICAgZm9yRWFjaChwYXJ0cywgZnVuY3Rpb24odmFsdWUpeworICAgICAgZm4gPSBEQVRFX0ZPUk1BVFNbdmFsdWVdOworICAgICAgdGV4dCArPSBmbiA/IGZuKGRhdGUsICRsb2NhbGUuREFURVRJTUVfRk9STUFUUykKKyAgICAgICAgICAgICAgICAgOiB2YWx1ZS5yZXBsYWNlKC8oXid8JyQpL2csICcnKS5yZXBsYWNlKC8nJy9nLCAiJyIpOworICAgIH0pOworCisgICAgcmV0dXJuIHRleHQ7CisgIH07Cit9CisKKworLyoqCisgKiBAbmdkb2MgZmlsdGVyCisgKiBAbmFtZSBqc29uCisgKiBAa2luZCBmdW5jdGlvbgorICoKKyAqIEBkZXNjcmlwdGlvbgorICogICBBbGxvd3MgeW91IHRvIGNvbnZlcnQgYSBKYXZhU2NyaXB0IG9iamVjdCBpbnRvIEpTT04gc3RyaW5nLgorICoKKyAqICAgVGhpcyBmaWx0ZXIgaXMgbW9zdGx5IHVzZWZ1bCBmb3IgZGVidWdnaW5nLiBXaGVuIHVzaW5nIHRoZSBkb3VibGUgY3VybHkge3t2YWx1ZX19IG5vdGF0aW9uCisgKiAgIHRoZSBiaW5kaW5nIGlzIGF1dG9tYXRpY2FsbHkgY29udmVydGVkIHRvIEpTT04uCisgKgorICogQHBhcmFtIHsqfSBvYmplY3QgQW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BudW1iZXIgIG9mIGl0ZW1zIGZyb20gdGhlIGVuZCBvZiB0aGUgc291cmNlIGFycmF5L3N0cmluZworICogICAgIGFyZSBjb3BpZWQuIFRoZSBgbGltaXRgIHdpbGwgYmUgdHJpbW1lZCBpZiBpdCBleGNlZWRzIGBhcnJheS5sZW5ndGhgCisgKiBAcmV0dXJucyB7QXJyYXl8c3RyaW5nfSBBIG5ldyBzdWItYXJyYXkgb3Igc3Vic3RyaW5nIG9mIGxlbmd0aCBgbGltaXRgIG9yIGxlc3MgaWYgaW5wdXQgYXJyYXkKKyAqICAgICBoYWQgbGVzcyB0aGFuIGBsaW1pdGAgZWxlbWVudHMuCisgKgorICogQGV4YW1wbGUKKyAgIDxleGFtcGxlIG1vZHVsZT0ibGltaXRUb0V4YW1wbGUiPgorICAgICA8ZmlsZSBuYW1lPSJpbmRleC5odG1sIj4KKyAgICAgICA8c2NyaXB0PgorICAgICAgICAgYW5ndWxhci5tb2R1bGUoJ2xpbWl0VG9FeGFtcGxlJywgW10pCisgICAgICAgICAgIC5jb250cm9sbGVyKCdFeGFtcGxlQ29udHJvbGxlcicsIFsnJHNjb3BlJywgZnVuY3Rpb24oJHNjb3BlKSB7CisgICAgICAgICAgICAgJHNjb3BlLm51bWJlcnMgPSBbMSwyLDMsNCw1LDYsNyw4LDldOworICAgICAgICAgICAgICRzY29wZS5sZXR0ZXJzID0gImFiY2RlZmdoaSI7CisgICAgICAgICAgICAgJHNjb3BlLm51bUxpbWl0ID0gMzsKKyAgICAgICAgICAgICAkc2NvcGUubGV0dGVyTGltaXQgPSAzOworICAgICAgICAgICB9XSk7CisgICAgICAgPC9zY3JpcHQ+CisgICAgICAgPGRpdiBuZy1jb250cm9sbGVyPSJFeGFtcGxlQ29udHJvbGxlciI+CisgICAgICAgICBMaW1pdCB7e251bWJlcnN9fSB0bzogPGlucHV0IHR5cGU9ImludGVnZXIiIG5nLW1vZGVsPSJudW1MaW1pdCI+CisgICAgICAgICA8cD5PdXRwdXQgbnV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iZXJzOiBbMSwyLDNdJyk7CisgICAgICAgICBleHBlY3QobGltaXRlZExldHRlcnMuZ2V0VGV4dCgpKS50b0VxdWFsKCdPdXRwdXQgbGV0dGVyczogYWJjJyk7CisgICAgICAgfSk7CisKKyAgICAgICBpdCgnc2hvdWxkIHVwZGF0ZSB0aGUgb3V0cHV0IHdoZW4gLTMgaXMgZW50ZXJlZCcsIGZ1bmN0aW9uKCkgeworICAgICAgICAgbnVtTGltaXRJbnB1dC5jbGVhcigpOworICAgICAgICAgbnVtTGltaXRJbnB1dC5zZW5kS2V5cygnLTMnKTsKKyAgICAgICAgIGxldHRlckxpbWl0SW5wdXQuY2xlYXIoKTsKKyAgICAgICAgIGxldHRlckxpbWl0SW5wdXQuc2VuZEtleXMoJy0zJyk7CisgICAgICAgICBleHBlY3QobGltaXRlZE51bWJlcnMuZ2V0VGV4dCgpKS50b0VxdWFsKCdPdXRwdXQgbnVtYmVyczogWzcsOCw5XScpOworICAgICAgICAgZXhwZWN0KGxpbWl0ZWRMZXR0ZXJzLmdldFRleHQoKSkudG9FcXVhbCgnT3V0cHV0IGxldHRlcnM6IGdoaScpOworICAgICAgIH0pOworCisgICAgICAgaXQoJ3Nob3VsZCBub3QgZXhjZWVkIHRoZSBtYXhpbXVtIHNpemUgb2YgaW5wdXQgYXJyYXknLCBmdW5jdGlvbigpIHsKKyAgICAgICAgIG51bUxpbWl0SW5wdXQuY2xlYXIoKTsKKyAgICAgICAgIG51bUxpbWl0SW5wdXQuc2VuZEtleXMoJzEwMCcpOworICAgICAgICAgbGV0dGVyTGltaXRJbnB1dC5jbGVhcigpOworICAgICAgICAgbGV0dGVyTGltaXRJbnB1dC5zZW5kS2V5cygnMTAwJyk7CisgICAgICAgICBleHBlY3QobGltaXRlZE51bWJlcnMuZ2V0VGV4dCgpKS50b0VxdWFsKCdPdXRwdXQgbnVtYmVyczogWzEsMiwzLDQsNSw2LDcsOCw5XScpOworICAgICAgICAgZXhwZWN0KGxpbWl0ZWRMZXR0ZXJzLmdldFRleHQoKSkudG9FcXVhbCgnT3V0cHV0IGxldHRlcnM6IGFiY2RlZmdoaScpOworICAgICAgIH0pOworICAgICA8L2ZpbGU+CisgICA8L2V4YW1wbGU+CisgKi8KK2Z1bmN0aW9uIGxpbWl0VG9GaWx0ZXIoKXsKKyAgcmV0dXJuIGZ1bmN0aW9uKGlucHV0LCBsaW1pdCkgeworICAgIGlmICghaXNBcnJheShpbnB1dCkgJiYgIWlzU3RyaW5nKGlucHV0KSkgcmV0dXJuIGlucHV0OworCisgICAgaWYgKE1hdGguYWJzKE51bWJlcihsaW1pdCkpID09PSBJbmZpbml0eSkgeworICAgICAgbGltaXQgPSBOdW1iZXIobGltaXQpOworICAgIH0gZWxzZSB7CisgICAgICBsaW1pdCA9IGludChsaW1pdCk7CisgICAgfQorCisgICAgaWYgKGlzU3RyaW5nKGlucHV0KSkgeworICAgICAgLy9OYU4gY2hlY2sgb24gbGltaXQKKyAgICAgIGlmIChsaW1pdCkgeworICAgICAgICByZXR1cm4gbGltaXQgPj0gMCA/IGlucHV0LnNsaWNlKDAsIGxpbWl0KSA6IGlucHV0LnNsaWNlKGxpbWl0LCBpbnB1dC5sZW5ndGgpOworICAgICAgfSBlbHNlIHsKKyAgICAgICAgcmV0dXJuICIiOworICAgICAgfQorICAgIH0KKworICAgIHZhciBvdXQgPSBbXSwKKyAgICAgIGksIG47CisKKyAgICAvLyBpZiBhYnMobGltaXQpIGV4Y2VlZHMgbWF4aW11bSBsZW5ndGgsIHRyaW0gaXQKKyAgICBpZiAobGltaXQgPiBpbnB1dC5sZW5ndGgpCisgICAgICBsaW1pdCA9IGlucHV0Lmxlbmd0aDsKKyAgICBlbHNlIGlmIChsaW1pdCA8IC1pbnB1dC5sZW5ndGgpCisgICAgICBsaW1pdCA9IC1pbnB1dC5sZW5ndGg7CisKKyAgICBpZiAobGltaXQgPiAwKSB7CisgICAgICBpID0gMDsKKyAgICAgIG4gPSBsaW1pdDsKKyAgICB9IGVsc2UgeworIC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gbmV4dCBwcmVkaWNhdGUgaXMgdXNlZC4KKyAqCisgKiBAcGFyYW0ge2Jvb2xlYW49fSByZXZlcnNlIFJldmVyc2UgdGhlIG9yZGVyIG9mIHRoZSBhcnJheS4KKyAqIEByZXR1cm5zIHtBcnJheX0gU29ydGVkIGNvcHkgb2YgdGhlIHNvdXJjZSBhcnJheS4KKyAqCisgKiBAZXhhbXBsZQorICAgPGV4YW1wbGUgbW9kdWxlPSJvcmRlckJ5RXhhbXBsZSI+CisgICAgIDxmaWxlIG5hbWU9ImluZGV4Lmh0bWwiPgorICAgICAgIDxzY3JpcHQ+CisgICAgICAgICBhbmd1bGFyLm1vZHVsZSgnb3JkZXJCeUV4YW1wbGUnLCBbXSkKKyAgICAgICAgICAgLmNvbnRyb2xsZXIoJ0V4YW1wbGVDb250cm9sbGVyJywgWyckc2NvcGUnLCBmdW5jdGlvbigkc2NvcGUpIHsKKyAgICAgICAgICAgICAkc2NvcGUuZnJpZW5kcyA9CisgICAgICAgICAgICAgICAgIFt7bmFtZTonSm9obicsIHBob25lOic1NTUtMTIxMicsIGFnZToxMH0sCisgICAgICAgICAgICAgICAgICB7bmFtZTonTWFyeScsIHBob25lOic1NTUtOTg3NicsIGFnZToxOX0sCisgICAgICAgICAgICAgICAgICB7bmFtZTonTWlrZScsIHBob25lOic1NTUtNDMyMScsIGFnZToyMX0sCisgICAgICAgICAgICAgICAgICB7bmFtZTonQWRhbScsIHBob25lOic1NTUtNTY3OCcsIGFnZTozNX0sCisgICAgICAgICAgICAgICAgICB7bmFtZTonSnVsaWUnLCBwaG9uZTonNTU1LTg3NjUnLCBhZ2U6Mjl9XTsKKyAgICAgICAgICAgICAkc2NvcGUucHJlZGljYXRlID0gJy1hZ2UnOworICAgICAgICAgICB9XSk7CisgICAgICAgPC9zY3JpcHQ+CisgICAgICAgPGRpdiBuZy1jb250cm9sbGVyPSJFeGFtcGxlQ29udHJvbGxlciI+CisgICAgICAgICA8cHJlPlNvcnRpbmcgcHJlZGljY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XIga2V5ID0gZ2V0KCk7CisgICAgICAgICAgcmV0dXJuIHJldmVyc2VDb21wYXJhdG9yKGZ1bmN0aW9uKGEsYikgeworICAgICAgICAgICAgcmV0dXJuIGNvbXBhcmUoYVtrZXldLCBiW2tleV0pOworICAgICAgICAgIH0sIGRlc2NlbmRpbmcpOworICAgICAgICB9CisgICAgICB9CisgICAgICByZXR1cm4gcmV2ZXJzZUNvbXBhcmF0b3IoZnVuY3Rpb24oYSxiKXsKKyAgICAgICAgcmV0dXJuIGNvbXBhcmUoZ2V0KGEpLGdldChiKSk7CisgICAgICB9LCBkZXNjZW5kaW5nKTsKKyAgICB9KTsKKyAgICB2YXIgYXJyYXlDb3B5ID0gW107CisgICAgZm9yICggdmFyIGkgPSAwOyBpIDwgYXJyYXkubGVuZ3RoOyBpKyspIHsgYXJyYXlDb3B5LnB1c2goYXJyYXlbaV0pOyB9CisgICAgcmV0dXJuIGFycmF5Q29weS5zb3J0KHJldmVyc2VDb21wYXJhdG9yKGNvbXBhcmF0b3IsIHJldmVyc2VPcmRlcikpOworCisgICAgZnVuY3Rpb24gY29tcGFyYXRvcihvMSwgbzIpeworICAgICAgZm9yICggdmFyIGkgPSAwOyBpIDwgc29ydFByZWRpY2F0ZS5sZW5ndGg7IGkrKykgeworICAgICAgICB2YXIgY29tcCA9IHNvcnRQcmVkaWNhdGVbaV0obzEsIG8yKTsKKyAgICAgICAgaWYgKGNvbXAgIT09IDApIHJldHVybiBjb21wOworICAgICAgfQorICAgICAgcmV0dXJuIDA7CisgICAgfQorICAgIGZ1bmN0aW9uIHJldmVyc2VDb21wYXJhdG9yKGNvbXAsIGRlc2NlbmRpbmcpIHsKKyAgICAgIHJldHVybiB0b0Jvb2xlYW4oZGVzY2VuZGluZykKKyAgICAgICAgICA/IGZ1bmN0aW9uKGEsYil7cmV0dXJuIGNvbXAoYixhKTt9CisgICAgICAgICAgOiBjb21wOworICAgIH0KKyAgICBmdW5jdGlvbiBjb21wYXJlKHYxLCB2Mil7CisgICAgICB2YXIgdDEgPSB0eXBlb2YgdjE7CisgICAgICB2YXIgdDIgPSB0eXBlb2YgdjI7CisgICAgICBpZiAodDEgPT0gdDIpIHsKKyAgICAgICAgaWYgKGlzRGF0ZSh2MSkgJiYgaXNEYXRlKHYyKSkgeworICAgICAgICAgIHYxID0gdjEudmFsdWVPZigpOworICAgICAgICAgIHYyID0gdjIudmFsdWVPZigpOworICAgICAgICB9CisgICAgICAgIGlmICh0MSA9PSAic3RyaW5nIikgeworICAgICAgICAgICB2MSA9IHYxLnRvTG93ZXJDYXNlKCk7CisgICAgICAgICAgIHYyID0gdjIudG9Mb3dlckNhc2UoKTsKKyAgICAgICAgfQorICAgICAgICBpZiAodjEgPT09IHYyKSByZXR1cm4gMDsKKyAgICAgICAgcmV0dXJuIHYxIDwgdjIgPyAtMSA6IDE7CisgICAgICB9IGVsc2UgeworICAgICAgICByZXR1cm4gdDEgPCB0MiA/IC0xIDogMTsKKyAgICAgIH0KKyAgICB9CisgIH07Cit9CisKK2Z1bmN0aW9uIG5nRGlyZWN0aXZlKGRpcmVjdGl2ZSkgeworICBpZiAoaXNGdW5jdGlvbihkaXJlY3RpdmUpKSB7CisgICAgZGlyZWN0aXZlID0geworICAgICAgbGluazogZGlyZWN0aXZlCisgICAgfTsKKyAgfQorICBkaXJlY3RpdmUucmVzdHJpY3QgPSBkaXJlY3RpdmUucmVzdHJpY3QgfHwgJ0FDJzsKKyAgcmV0dXJuIHZhbHVlRm4oZGlyZWN0aXZlKTsKK30KKworLyoqCisgKiBAbmdkb2MgZGlyZWN0aXZlCisgKiBAbmFtZSBhCisgKiBAcmVzdHJpY3QgRQorICoKKyAqIEBkZXNjcmlwdGlvbgorICogTW9kaWZpZXMgdGhlIGRlZmF1bHQgYmVoYXZpb3Igb2YgdGhlIGh0bWwgQSB0YWcgc28gdGhhdCB0aGUgZGVmYXVsdCBhY3Rpb24gaXMgcHJldmVudGVkIHdoZW4KKyAqIHRoZSBocmVmIGF0dHJpYnV0Z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aXZlci5nZXRDdXJyZW50VXJsKCkudGhlbihmdW5jdGlvbih1cmwpIHsKKyAgICAgICAgICAgICAgcmV0dXJuIHVybC5tYXRjaCgvXC8xMjMkLyk7CisgICAgICAgICAgICB9KTsKKyAgICAgICAgICB9LCA1MDAwLCAncGFnZSBzaG91bGQgbmF2aWdhdGUgdG8gLzEyMycpOworICAgICAgICB9KTsKKworICAgICAgICB4aXQoJ3Nob3VsZCBleGVjdXRlIG5nLWNsaWNrIGJ1dCBub3QgcmVsb2FkIHdoZW4gaHJlZiBlbXB0eSBzdHJpbmcgYW5kIG5hbWUgc3BlY2lmaWVkJywgZnVuY3Rpb24oKSB7CisgICAgICAgICAgZWxlbWVudChieS5pZCgnbGluay00JykpLmNsaWNrKCk7CisgICAgICAgICAgZXhwZWN0KGVsZW1lbnQoYnkubW9kZWwoJ3ZhbHVlJykpLmdldEF0dHJpYnV0ZSgndmFsdWUnKSkudG9FcXVhbCgnNCcpOworICAgICAgICAgIGV4cGVjdChlbGVtZW50KGJ5LmlkKCdsaW5rLTQnKSkuZ2V0QXR0cmlidXRlKCdocmVmJykpLnRvQmUoJycpOworICAgICAgICB9KTsKKworICAgICAgICBpdCgnc2hvdWxkIGV4ZWN1dGUgbmctY2xpY2sgYnV0IG5vdCByZWxvYWQgd2hlbiBubyBocmVmIGJ1dCBuYW1lIHNwZWNpZmllZCcsIGZ1bmN0aW9uKCkgeworICAgICAgICAgIGVsZW1lbnQoYnkuaWQoJ2xpbmstNScpKS5jbGljaygpOworICAgICAgICAgIGV4cGVjdChlbGVtZW50KGJ5Lm1vZGVsKCd2YWx1ZScpKS5nZXRBdHRyaWJ1dGUoJ3ZhbHVlJykpLnRvRXF1YWwoJzUnKTsKKyAgICAgICAgICBleHBlY3QoZWxlbWVudChieS5pZCgnbGluay01JykpLmdldEF0dHJpYnV0ZSgnaHJlZicpKS50b0JlKG51bGwpOworICAgICAgICB9KTsKKworICAgICAgICBpdCgnc2hvdWxkIG9ubHkgY2hhbmdlI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W1lID0gYXR0ck5hbWUsCisgICAgICAgICAgICBuYW1lID0gYXR0ck5hbWU7CisKKyAgICAgICAgaWYgKGF0dHJOYW1lID09PSAnaHJlZicgJiYKKyAgICAgICAgICAgIHRvU3RyaW5nLmNhbGwoZWxlbWVudC5wcm9wKCdocmVmJykpID09PSAnW29iamVjdCBTVkdBbmltYXRlZFN0cmluZ10nKSB7CisgICAgICAgICAgbmFtZSA9ICd4bGlua0hyZWYnOworICAgICAgICAgIGF0dHIuJGF0dHJbbmFtZV0gPSAneGxpbms6aHJlZic7CisgICAgICAgICAgcHJvcE5hbWUgPSBudWxsOworICAgICAgICB9CisKKyAgICAgICAgYXR0ci4kb2JzZXJ2ZShub3JtYWxpemVkLCBmdW5jdGlvbih2YWx1ZSkgeworICAgICAgICAgIGlmICghdmFsdWUpIHsKKyAgICAgICAgICAgIGlmIChhdHRyTmFtZSA9PT0gJ2hyZWYnKSB7CisgICAgICAgICAgICAgIGF0dHIuJHNldChuYW1lLCBudWxsKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIHJldHVybjsKKyAgICAgICAgICB9CisKKyAgICAgICAgICBhdHRyLiRzZXQobmFtZSwgdmFsdWUpOworCisgICAgICAgICAgLy8gb24gSUUsIGlmICJuZzpzcmMiIGRpcmVjdGl2ZSBkZWNsYXJhdGlvbiBpcyB1c2VkIGFuZCAic3JjIiBhdHRyaWJ1dGUgZG9lc24ndCBleGlzdAorICAgICAgICAgIC8vIHRoZW4gY2FsbGluZyBlbGVtZW50LnNldEF0dHJpYnV0ZSgnc3JjJywgJ2ZvbycpIGRvZXNuJ3QgZG8gYW55dGhpbmcsIHNvIHdlIG5lZWQKKyAgICAgICAgICAvLyB0byBzZXQgdGhlIHByb3BlcnR5IGFzIHdlbGwgdG8gYWNoaWV2ZSB0aGUgZGVzaXJlZCBlZmZlY3QuCisgICAgICAgICAgLy8gd2UgdXNlIGF0dHJbYXR0ck5hbWVdIHZhbHVlIHNpbmNlICRzZXQgY2FuIHN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byB0aGlzIGF1dG9tYXRpY2FsbHkgd2hlbiB0aGV5IGFyZSBkZXN0cm95ZWQuCisgICAqLworICBmb3JtLiRyZW1vdmVDb250cm9sID0gZnVuY3Rpb24oY29udHJvbCkgeworICAgIGlmIChjb250cm9sLiRuYW1lICYmIGZvcm1bY29udHJvbC4kbmFtZV0gPT09IGNvbnRyb2wpIHsKKyAgICAgIGRlbGV0ZSBmb3JtW2NvbnRyb2wuJG5hbWVdOworICAgIH0KKyAgICBmb3JFYWNoKGVycm9ycywgZnVuY3Rpb24ocXVldWUsIHZhbGlkYXRpb25Ub2tlbikgeworICAgICAgZm9ybS4kc2V0VmFsaWRpdHkodmFsaWRhdGlvblRva2VuLCB0cnVlLCBjb250cm9sKTsKKyAgICB9KTsKKworICAgIGFycmF5UmVtb3ZlKGNvbnRyb2xzLCBjb250cm9sKTsKKyAgfTsKKworICAvKioKKyAgICogQG5nZG9jIG1ldGhvZAorICAgKiBAbmFtZSBmb3JtLkZvcm1Db250cm9sbGVyIyRzZXRWYWxpZGl0eQorICAgKgorICAgKiBAZGVzY3JpcHRpb24KKyAgICogU2V0cyB0aGUgdmFsaWRpdHkgb2YgYSBmb3JtIGNvbnRyb2wuCisgICAqCisgICAqIFRoaXMgbWV0aG9kIHdpbGwgYWxzbyBwcm9wYWdhdGUgdG8gcGFyZW50IGZvcm1zLgorICAgKi8KKyAgZm9ybS4kc2V0VmFsaWRpdHkgPSBmdW5jdGlvbih2YWxpZGF0aW9uVG9rZW4sIGlzVmFsaWQsIGNvbnRyb2wpIHsKKyAgICB2YXIgcXVldWUgPSBlcnJvcnNbdmFsaWRhdGlvblRva2VuXTsKKworICAgIGlmIChpc1ZhbGlkKSB7CisgICAgICBpZiAocXVldWUpIHsKKyAgICAgICAgYXJyYXlSZW1vdmUocXVldWUsIGNvbnRyb2wpOworICAgICAgICBpZiAoIXF1ZXVlLmxlbmd0aCkgeworICAgICAgICAgIGludmFsaWRDb3VudC0tOworICAgICAgICAgIGlmICghaW52YWxpZENvdW50KSB7CisgICAgICAgICAgICB0b2dnbGVWYWxpZENzcyhpc1ZhbGlkKTsKKyAgICAgICAgICAgIGZvcm0uJHZhbGlkID0gdHJ1ZTsKKyAgICAgICAgICAgIGZvcm0uJGludmFsaWQgPSBmYWxzZTsKKyAgICAgICAgICB9CisgICAgICAgICAgZXJyb3JzW3ZhbGlkYXRpb25Ub2tlbl0gPSBmYWxzZTsKKyAgICAgICAgICB0b2dnbGVWYWxpZENzcyh0cnVlLCB2YWxpZGF0aW9uVG9rZW4pOworICAgICAgICAgIHBhcmVudEZvcm0uJHNldFZhbGlkaXR5KHZhbGlkYXRpb25Ub2tlbiwgdHJ1ZSwgZm9ybSk7CisgICAgICAgIH0KKyAgICAgIH0KKworICAgIH0gZWxzZSB7CisgICAgICBpZiAoIWludmFsaWRDb3VudCkgeworICAgICAgICB0b2dnbGVWYWxpZENzcyhpc1ZhbGlkKTsKKyAgICAgIH0KKyAgICAgIGlmIChxdWV1ZSkgeworICAgICAgICBpZiAoaW5jbHVkZXMocXVldWUsIGNvbnRyb2wpKSByZXR1cm47CisgICAgICB9IGVsc2UgeworICAgICAgICBlcnJvcnNbdmFsaWRhdGlvblRva2VuXSA9IHF1ZXVlID0gW107CisgICAgICAgIGludmFsaWRDb3VudCsrOworICAgICAgICB0b2dnbGVWYWxpZENzcyhmYWxzZSwgdmFsaWRhdGlvblRva2VuKTsKKyAgICAgICAgcGFyZW50Rm9ybS4kc2V0VmFsaWRpdHkodmFsaWRhdGlvblRva2VuLCBmYWxzZSwgZm9ybSk7CisgICAgICB9CisgICAgICBxdWV1ZS5wdXNoKGNvbnRyb2wpOworCisgICAgICBmb3JtLiR2YWxpZCA9IGZhbHNlOworICAgICAgZm9ybS4kaW52YWxpZCA9IHRydWU7CisgICAgfQorICB9OworCisgIC8qKgorICAgKiBAbmdkb2MgbWV0aG9kCisgICAqIEBuYW1lIGZvcm0uRm9ybUNvbnRyb2xsZXIjJHNldERpcnR5CisgICAqCisgICAqIE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XMgaW52YWxpZCBhZnRlciBpdCBoYXMgYmVlbiB2YWxpZGF0ZWQ6CisgKgorICogPHByZT4KKyAqIC8vYmUgc3VyZSB0byBpbmNsdWRlIG5nQW5pbWF0ZSBhcyBhIG1vZHVsZSB0byBob29rIGludG8gbW9yZQorICogLy9hZHZhbmNlZCBhbmltYXRpb25zCisgKiAubXktZm9ybSB7CisgKiAgIHRyYW5zaXRpb246MC41cyBsaW5lYXIgYWxsOworICogICBiYWNrZ3JvdW5kOiB3aGl0ZTsKKyAqIH0KKyAqIC5teS1mb3JtLm5nLWludmFsaWQgeworICogICBiYWNrZ3JvdW5kOiByZWQ7CisgKiAgIGNvbG9yOndoaXRlOworICogfQorICogPC9wcmU+CisgKgorICogQGV4YW1wbGUKKyAgICA8ZXhhbXBsZSBkZXBzPSJhbmd1bGFyLWFuaW1hdGUuanMiIGFuaW1hdGlvbnM9InRydWUiIGZpeEJhc2U9InRydWUiIG1vZHVsZT0iZm9ybUV4YW1wbGUiPgorICAgICAgPGZpbGUgbmFtZT0iaW5kZXguaHRtbCI+CisgICAgICAgPHNjcmlwdD4KKyAgICAgICAgIGFuZ3VsYXIubW9kdWxlKCdmb3JtRXhhbXBsZScsIFtdKQorICAgICAgICAgICAuY29udHJvbGxlcignRm9ybUNvbnRyb2xsZXInLCBbJyRzY29wZScsIGZ1bmN0aW9uKCRzY29wZSkgeworICAgICAgICAgICAgICRzY29wZS51c2VyVHlwZSA9ICdndWVzdCc7CisgICAgICAgICAgIH1dKTsKKyAgICAgICA8L3NjcmlwdD4KKyAgICAgICA8c3R5bGU+CisgICAgICAgIC5teS1mb3JtIHsKKyAgICAgICAgICAtd2Via2l0LXRyYW5zaXRpb246YWxsIGxpbmVhciAwLjVzOworICAgICAgICAgIHRyYW5zaXRpb246YWxsIGxpbmVhciAwLjVzOworICAgICAgICAgIGJhY2tncm91bmQ6IHRyYW5zcGFyZW50OworICAgICAgICB9CisgICAgICAgIC5teS1mb3JtLm5nLWludmFsaWQgeworICA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Y3Rpb24oZXZlbnQpIHsKKyAgICAgICAgICAgICAgICBldmVudC5wcmV2ZW50RGVmYXVsdAorICAgICAgICAgICAgICAgICAgPyBldmVudC5wcmV2ZW50RGVmYXVsdCgpCisgICAgICAgICAgICAgICAgICA6IGV2ZW50LnJldHVyblZhbHVlID0gZmFsc2U7IC8vIElFCisgICAgICAgICAgICAgIH07CisKKyAgICAgICAgICAgICAgYWRkRXZlbnRMaXN0ZW5lckZuKGZvcm1FbGVtZW50WzBdLCAnc3VibWl0JywgcHJldmVudERlZmF1bHRMaXN0ZW5lcik7CisKKyAgICAgICAgICAgICAgLy8gdW5yZWdpc3RlciB0aGUgcHJldmVudERlZmF1bHQgbGlzdGVuZXIgc28gdGhhdCB3ZSBkb24ndCBub3QgbGVhayBtZW1vcnkgYnV0IGluIGEKKyAgICAgICAgICAgICAgLy8gd2F5IHRoYXQgd2lsbCBhY2hpZXZlIHRoZSBwcmV2ZW50aW9uIG9mIHRoZSBkZWZhdWx0IGFjdGlvbi4KKyAgICAgICAgICAgICAgZm9ybUVsZW1lbnQub24oJyRkZXN0cm95JywgZnVuY3Rpb24oKSB7CisgICAgICAgICAgICAgICAgJHRpbWVvdXQoZnVuY3Rpb24oKSB7CisgICAgICAgICAgICAgICAgICByZW1vdmVFdmVudExpc3RlbmVyRm4oZm9ybUVsZW1lbnRbMF0sICdzdWJtaXQnLCBwcmV2ZW50RGVmYXVsdExpc3RlbmVyKTsKKyAgICAgICAgICAgICAgICB9LCAwLCBmYWxzZSk7CisgICAgICAgICAgICAgIH0pOworICAgICAgICAgICAgfQorCisgICAgICAgICAgICB2YXIgcGFyZW50Rm9ybUN0cmwgPSBmb3JtRWxlbWVudC5wYXJlbnQoKS5jb250cm9sbGVyKCdmb3JtJyksCisgICAgICAgICAgICAgICAgYWxpYXMgPSBhdHRyLm5hbWUgfHwgYXR0ci5uZ0Zvcm07CisKKyAgICAgICAgICAgIGlmIChhbGlhcykgeworICAgICAgICAgICAgICBzZXR0ZXIoc2NvcGUsIGFsaWFzLCBjb250cm9sbGVyLCBhbGlhcyk7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBpZiAocGFyZW50Rm9ybUN0cmwpIHsKKyAgICAgICAgICAgICAgZm9ybUVsZW1lbnQub24oJyRkZXN0cm95JywgZnVuY3Rpb24oKSB7CisgICAgICAgICAgICAgICAgcGFyZW50Rm9ybUN0cmwuJHJlbW92ZUNvbnRyb2woY29udHJvbGxlcik7CisgICAgICAgICAgICAgICAgaWYgKGFsaWFzKSB7CisgICAgICAgICAgICAgICAgICBzZXR0ZXIoc2NvcGUsIGFsaWFzLCB1bmRlZmluZWQsIGFsaWFzKTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgZXh0ZW5kKGNvbnRyb2xsZXIsIG51bGxGb3JtQ3RybCk7IC8vc3RvcCBwcm9wYWdhdGluZyBjaGlsZCBkZXN0cnVjdGlvbiBoYW5kbGVycyB1cHdhcmRzCisgICAgICAgICAgICAgIH0pOworICAgICAgICAgICAgfQorICAgICAgICAgIH0KKyAgICAgICAgfTsKKyAgICAgIH0KKyAgICB9OworCisgICAgcmV0dXJuIGZvcm1EaXJlY3RpdmU7CisgIH1dOworfTsKKwordmFyIGZvcm1EaXJlY3RpdmUgPSBmb3JtRGlyZWN0aXZlRmFjdG9yeSgpOwordmFyIG5nRm9ybURpcmVjdGl2ZSA9IGZvcm1EaXJlY3RpdmVGYWN0b3J5KHRydWUpOworCisvKiBnbG9iYWwgVkFMSURfQ0xBU1M6IHRydWUsCisgICAgSU5WQUxJRF9DTEFTUzogdHJ1ZSwKKyAgICBQUklTVElORV9DTEFTUzogdHJ1ZSwKKyAgICBESVJUWV9DTEFTUzogdHJ1ZQorKi8KKwordmFyIFVSTF9SRUdFWFAgPSAvXihmdHB8aHR0cHxodHRwcyk6XC9cLyhcdys6ezAsMX1cdypAKT8oXFMrKSg6WzAtOV0rKT8oXC98XC8oW1x3IyE6Lj8rPSYlQCFcLVwvXSkpPyQvOwordmFy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HNwYW4gY2xhc3M9ImVycm9yIiBuZy1zaG93PSJteUZvcm0uaW5wdXQuJGVycm9yLnJlcXVpcmVkIj4KKyAgICAgICAgICAgICBSZXF1aXJlZCE8L3NwYW4+CisgICAgICAgICAgIDxzcGFuIGNsYXNzPSJlcnJvciIgbmctc2hvdz0ibXlGb3JtLmlucHV0LiRlcnJvci5wYXR0ZXJuIj4KKyAgICAgICAgICAgICBTaW5nbGUgd29yZCBvbmx5ITwvc3Bhbj4KKworICAgICAgICAgICA8dHQ+dGV4dCA9IHt7dGV4dH19PC90dD48YnIvPgorICAgICAgICAgICA8dHQ+bXlGb3JtLmlucHV0LiR2YWxpZCA9IHt7bXlGb3JtLmlucHV0LiR2YWxpZH19PC90dD48YnIvPgorICAgICAgICAgICA8dHQ+bXlGb3JtLmlucHV0LiRlcnJvciA9IHt7bXlGb3JtLmlucHV0LiRlcnJvcn19PC90dD48YnIvPgorICAgICAgICAgICA8dHQ+bXlGb3JtLiR2YWxpZCA9IHt7bXlGb3JtLiR2YWxpZH19PC90dD48YnIvPgorICAgICAgICAgICA8dHQ+bXlGb3JtLiRlcnJvci5yZXF1aXJlZCA9IHt7ISFteUZvcm0uJGVycm9yLnJlcXVpcmVkfX08L3R0Pjxici8+CisgICAgICAgICAgPC9mb3JtPgorICAgICAgICA8L2ZpbGU+CisgICAgICAgIDxmaWxlIG5hbWU9InByb3RyYWN0b3IuanMiIHR5cGU9InByb3RyYWN0b3IiPgorICAgICAgICAgIHZhciB0ZXh0ID0gZWxlbWVudChieS5iaW5kaW5nKCd0ZXh0JykpOworICAgICAgICAgIHZhciB2YWxpZCA9IGVsZW1lbnQoYnkuYmluZGluZygnbXlGb3JtLmlucHV0LiR2YWxpZCcpKTsKKyAgICAgICAgICB2YXIgaW5wdXQgPSBlbGVtZW50KGJ5Lm1vZGVsKCd0ZXh0JykpOworCisgICAgICAgICAgaXQoJ3Nob3VsZCBpbml0aWFsaXplIHRvIG1vZGVsJywgZnVuY3Rpb24oKSB7CisgICAgICAgICAgICBleHBlY3QodGV4dC5nZXRUZXh0KCkpLnRvQ29udGFpbignZ3Vlc3QnKTsKKyAgICAgICAgICAgIGV4cGVjdCh2YWxpZC5nZXRUZXh0KCkpLnRvQ29udGFpbigndHJ1ZScpOworICAgICAgICAgIH0pOworCisgICAgICAgICAgaXQoJ3Nob3VsZCBiZSBpbnZhbGlkIGlmIGVtcHR5JywgZnVuY3Rpb24oKSB7CisgICAgICAgICAgICBpbnB1dC5jbGVhcigpOworICAgICAgICAgICAgaW5wdXQuc2VuZEtleXMoJycpOworCisgICAgICAgICAgICBleHBlY3QodGV4dC5nZXRUZXh0KCkpLnRvRXF1YWwoJ3RleHQgPScpOworICAgICAgICAgICAgZXhwZWN0KHZhbGlkLmdldFRleHQoKSkudG9Db250YWluKCdmYWxzZScpOworICAgICAgICAgIH0pOworCisgICAgICAgICAgaXQoJ3Nob3VsZCBiZSBpbnZhbGlkIGlmIG11bHRpIHdvcmQnLCBmdW5jdGlvbigpIHsKKyAgICAgICAgICAgIGlucHV0LmNsZWFyKCk7CisgICAgICAgICAgICBpbnB1dC5zZW5kS2V5cygnaGVsbG8gd29ybGQnKTsKKworICAgICAgICAgICAgZXhwZWN0KHZhbGlkLmdldFRleHQoKSkudG9Db250YWluKCdmYWxzZScpOworICAgICAgICAgIH0pOworICAgICAgICA8L2ZpbGU+CisgICAgICA8L2V4YW1wbGU+CisgICAqLworICAndGV4dCc6IHRleHRJbnB1dFR5cGUsCisKKworICAvKioKKyAgICogQG5nZG9jIGlucHV0CisgICAqIEBuYW1lIGlucHV0W251bWJlcl0KKyAgICoKKyAgICogQGRlc2NyaXB0aW9uCisgICAqIFRleHQgaW5wdXQgd2l0aCBudW1iZXIgdmFsaWRhdGlvbiBhbmQgdHJhbnNmb3JtYXRpb24uIFNldHMgdGhlIGBudW1iZXJgIHZhbGlkYXRpb24KKyAgICogZXJyb3IgaWYgbm90IGEgdmFsaWQgbnVtYmVyLgorICAgKgorICAgKiBAcGFyYW0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JywgWyckc2NvcGUnLCBmdW5jdGlvbigkc2NvcGUpIHsKKyAgICAgICAgICAgICAgICRzY29wZS52YWx1ZSA9IDEyOworICAgICAgICAgICAgIH1dKTsKKyAgICAgICAgIDwvc2NyaXB0PgorICAgICAgICAgPGZvcm0gbmFtZT0ibXlGb3JtIiBuZy1jb250cm9sbGVyPSJFeGFtcGxlQ29udHJvbGxlciI+CisgICAgICAgICAgIE51bWJlcjogPGlucHV0IHR5cGU9Im51bWJlciIgbmFtZT0iaW5wdXQiIG5nLW1vZGVsPSJ2YWx1ZSIKKyAgICAgICAgICAgICAgICAgICAgICAgICAgbWluPSIwIiBtYXg9Ijk5IiByZXF1aXJlZD4KKyAgICAgICAgICAgPHNwYW4gY2xhc3M9ImVycm9yIiBuZy1zaG93PSJteUZvcm0uaW5wdXQuJGVycm9yLnJlcXVpcmVkIj4KKyAgICAgICAgICAgICBSZXF1aXJlZCE8L3NwYW4+CisgICAgICAgICAgIDxzcGFuIGNsYXNzPSJlcnJvciIgbmctc2hvdz0ibXlGb3JtLmlucHV0LiRlcnJvci5udW1iZXIiPgorICAgICAgICAgICAgIE5vdCB2YWxpZCBudW1iZXIhPC9zcGFuPgorICAgICAgICAgICA8dHQ+dmFsdWUgPSB7e3ZhbHVlfX08L3R0Pjxici8+CisgICAgICAgICAgIDx0dD5teUZvcm0uaW5wdXQuJHZhbGlkID0ge3tteUZvcm0uaW5wdXQuJHZhbGlkfX08L3R0Pjxici8+CisgICAgICAgICAgIDx0dD5teUZvcm0uaW5wdXQuJGVycm9yID0ge3tteUZvcm0uaW5wdXQuJGVycm9yfX08L3R0Pjxici8+CisgICAgICAgICAgIDx0dD5teUZvcm0uJHZhbGlkID0ge3tteUZvcm0uJHZhbGlkfX08L3R0Pjxici8+CisgICAgICAgICAgIDx0dD5teUZvcm0uJGVycm9yLnJlcXVpcmVkID0ge3shIW15Rm9ybS4kZXJyb3IucmVxdWlyZWR9fTwvdHQ+PGJyLz4KKyAgICAgICAgICA8L2Zvcm0+CisgICAgICAgIDwvZmlsZT4KKyAgICAgICAgPGZpbGUgbmFtZT0icHJvdHJhY3Rvci5qcyIgdHlwZT0icHJvdHJhY3RvciI+CisgICAgICAgICAgdmFyIHZhbHVlID0gZWxlbWVudChieS5iaW5kaW5nKCd2YWx1ZScpKTsKKyAgICAgICAgICB2YXIgdmFsaWQgPSBlbGVtZW50KGJ5LmJpbmRpbmcoJ215Rm9ybS5pbnB1dC4kdmFsaWQnKSk7CisgICAgICAgICAgdmFyIGlucHV0ID0gZWxlbWVudChieS5tb2RlbCgndmFsdWUnKSk7CisKKyAgICAgICAgICBpdCgnc2hvdWxkIGluaXRpYWxpemUgdG8gbW9kZWwnLCBmdW5jdGlvbigpIHsKKyAgICAgICAgICAgIGV4cGVjdCh2YWx1ZS5nZXRUZXh0KCkpLnRvQ29udGFpbignMTInKTsKKyAgICAgICAgICAgIGV4cGVjdCh2YWxpZC5nZXRUZXh0KCkpLnRvQ29udGFpbigndHJ1ZScpOworICAgICAgICAgIH0pOworCisgICAgICAgICAgaXQoJ3Nob3VsZCBiZSBpbnZhbGlkIGlmIGVtcHR5JywgZnVuY3Rpb24oKSB7CisgICAgICAgICAgICBpbnB1dC5jbGVhcigpOworICAgICAgICAgICAgaW5wdXQuc2VuZEtleXMoJycpOworICAgICAgICAgICAgZXhwZWN0KHZhbHVlLmdldFRleHQoKSkudG9FcXVhbCgndmFsdWUgPScpOworICAgICAgICAgICAgZXhwZWN0KHZhbGlkLmdldFRleHQoKSkudG9Db250YWluKCdmYWxzZScpOworICAgICAgICAgIH0pOworCisgICAgICAgICAgaXQoJ3Nob3VsZCBiZSBpbnZhbGlkIGlmIG92ZXIgbWF4JywgZnVuY3Rpb24oKSB7CisgICAgICAgICAgICBpbnB1dC5jbGVhcigpOworICAgICAgICAgICAgaW5wdXQuc2VuZEtleXMoJzEyMycpOworICAgICAgICAgICAgZXhwZWN0KHZhbHVlLmdldFRleHQoKSkudG9FcXVhbCgndmFsdWUgPScpOworICAgIC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yAgICAgICAgICAgPHR0Pm15Rm9ybS4kZXJyb3IucmVxdWlyZWQgPSB7eyEhbXlGb3JtLiRlcnJvci5yZXF1aXJlZH19PC90dD48YnIvPgorICAgICAgICAgICA8dHQ+bXlGb3JtLiRlcnJvci51cmwgPSB7eyEhbXlGb3JtLiRlcnJvci51cmx9fTwvdHQ+PGJyLz4KKyAgICAgICAgICA8L2Zvcm0+CisgICAgICAgIDwvZmlsZT4KKyAgICAgICAgPGZpbGUgbmFtZT0icHJvdHJhY3Rvci5qcyIgdHlwZT0icHJvdHJhY3RvciI+CisgICAgICAgICAgdmFyIHRleHQgPSBlbGVtZW50KGJ5LmJpbmRpbmcoJ3RleHQnKSk7CisgICAgICAgICAgdmFyIHZhbGlkID0gZWxlbWVudChieS5iaW5kaW5nKCdteUZvcm0uaW5wdXQuJHZhbGlkJykpOworICAgICAgICAgIHZhciBpbnB1dCA9IGVsZW1lbnQoYnkubW9kZWwoJ3RleHQnKSk7CisKKyAgICAgICAgICBpdCgnc2hvdWxkIGluaXRpYWxpemUgdG8gbW9kZWwnLCBmdW5jdGlvbigpIHsKKyAgICAgICAgICAgIGV4cGVjdCh0ZXh0LmdldFRleHQoKSkudG9Db250YWluKCdodHRwOi8vZ29vZ2xlLmNvbScpOworICAgICAgICAgICAgZXhwZWN0KHZhbGlkLmdldFRleHQoKSkudG9Db250YWluKCd0cnVlJyk7CisgICAgICAgICAgfSk7CisKKyAgICAgICAgICBpdCgnc2hvdWxkIGJlIGludmFsaWQgaWYgZW1wdHknLCBmdW5jdGlvbigpIHsKKyAgICAgICAgICAgIGlucHV0LmNsZWFyKCk7CisgICAgICAgICAgICBpbnB1dC5zZW5kS2V5cygnJyk7CisKKyAgICAgICAgICAgIGV4cGVjdCh0ZXh0LmdldFRleHQoKSkudG9FcXVhbCgndGV4dCA9Jyk7CisgICAgICAgICAgICBleHBlY3QodmFsaWQuZ2V0VGV4dCgpKS50b0NvbnRhaW4oJ2ZhbHNlJyk7CisgICAgICAgICAg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LgorICAgKgorICAgKiBAZXhhbXBsZQorICAgICAgPGV4YW1wbGUgbmFtZT0iZW1haWwtaW5wdXQtZGlyZWN0aXZlIiBtb2R1bGU9ImVtYWlsRXhhbXBsZSI+CisgICAgICAgIDxmaWxlIG5hbWU9ImluZGV4Lmh0bWwiPgorICAgICAgICAgPHNjcmlwdD4KKyAgICAgICAgICAgYW5ndWxhci5tb2R1bGUoJ2VtYWlsRXhhbXBsZScsIFtdKQorICAgICAgICAgICAgIC5jb250cm9sbGVyKCdFeGFtcGxlQ29udHJvbGxlcicsIFsnJHNjb3BlJywgZnVuY3Rpb24oJHNjb3BlKSB7CisgICAgICAgICAgICAgICAkc2NvcGUudGV4dCA9ICdtZUBleGFtcGxlLmNvbSc7CisgICAgICAgICAgICAgfV0pOworICAgICAgICAgPC9zY3JpcHQ+CisgICAgICAgICAgIDxmb3JtIG5hbWU9Im15Rm9ybSIgbmctY29udHJvbGxlcj0iRXhhbXBsZUNvbnRyb2xsZXIiPgorICAgICAgICAgICAgIEVtYWlsOiA8aW5wdXQgdHlwZT0iZW1haWwiIG5hbWU9ImlucHV0IiBuZy1tb2RlbD0idGV4dCIgcmVxdWlyZWQ+CisgICAgICAgICAgICAgPHNwYW4gY2xhc3M9ImVycm9yIiBuZy1zaG93PSJteUZvcm0uaW5wdXQuJGVycm9yLnJlcXVpcmVkIj4KKyAgICAgICAgICAgICAgIFJlcXVpcmVkITwvc3Bhbj4KKyAgICAgICAgICAgICA8c3BhbiBjbGFzcz0iZXJyb3IiIG5nLXNob3c9Im15Rm9ybS5pbnB1dC4kZXJyb3IuZW1haWwiPgorICAgICAgICAgICAgICAgTm90IHZhbGlkIGVtYWlsITwvc3Bhbj4KKyAgICAgICAgICAgICA8dHQ+dGV4dCA9IHt7dGV4dH19PC90dD48YnIvPgorICAgICAgICAgICAgIDx0dD5teUZvcm0uaW5wdXQuJHZhbGlkID0ge3tteUZvcm0uaW5wdXQuJHZhbGlkfX08L3R0Pjxici8+CisgICAgICAgICAgICAgPHR0Pm15Rm9ybS5pbnB1dC4kZXJyb3IgPSB7e215Rm9ybS5pbnB1dC4kZXJyb3J9fTwvdHQ+PGJyLz4KKyAgICAgICAgICAgICA8dHQ+bXlGb3JtLiR2YWxpZCA9IHt7bXlGb3JtLiR2YWxpZH19PC90dD48YnIvPgorICAgICAgICAgICAgIDx0dD5teUZvcm0uJGVycm9yLnJlcXVpcmVkID0ge3shIW15Rm9ybS4kZXJyb3IucmVxdWlyZWR9fTwvdHQ+PGJyLz4KKyAgICAgICAgICAgICA8dHQ+bXlGb3JtLiRlcnJvci5lbWFpbCA9IHt7ISFteUZvcm0uJGVycm9yLmVtYWlsfX08L3R0Pjxici8+CisgICAgICAgICAgIDwvZm9ybT4KKyAgICAgICAgIDwvZmlsZT4KKyAgICAgICAgPGZpbGUgbmFtZT0icHJvdHJhY3Rvci5qcyIgdHlwZT0icHJvdHJhY3RvciI+CisgICAgICAgICAgdmFyIHRleHQgPSBlbGVtZW50KGJ5LmJpbmRpbmcoJ3RleHQnKSk7CisgICAgICAgICAgdmFyIHZhbGlkID0gZWxlbWVudChieS5iaW5kaW5nKCdteUZvcm0uaW5wdXQuJHZhbGlkJykpOworICAgICAgICAgIHZhciBpbnB1dCA9IGVsZW1lbnQoYnkubW9kZWwoJ3RleHQnKSk7CisKKyAgICAgICAgICBpdCgnc2hvdWxkIGluaXRpYWxpemUgdG8gbW9kZWwnLCBmdW5jdGlvbigpIHsKKyAgICAgICAgICAgIGV4cGVjdCh0ZXh0LmdldFRleHQoKSkudG9Db250YWluKCdtZUBleGFtcGxlLmNvbScpOworICAgICAgICAgICAgZXhwZWN0KHZhbGlkLmdldFRleHQoKSkudG9Db250YWluKCd0cnVlJyk7CisgICAgICAgICAgfSk7CisKKyAgICAgICAgICBpdCgnc2hvdWxkIGJlIGludmFsaWQgaWYgZW1wdHknLCBmdW5jdGlvbigpIHsKKyAgICAgICAgICAgIGlucHV0LmNsZWFyKCk7CisgICAgICAgICAgICBpbnB1dC5zZW5kS2V5cygnJyk7CisgICAgICAgICAgICBleHBlY3QodGV4dC5nZXRUZXh0KCkpLnRvRXF1YWwoJ3RleHQgPScpOworICAgICAgICAgICAgZXhwZWN0KHZhbGlkLmdldFRleHQoKSkudG9Db250YWluKCdmYWxzZScpOworICAgICAgICAgIH0pOworCisgICAgICAgICAgaXQoJ3Nob3VsZCBiZSBpbnZhbGlkIGlmIG5vdCBlbWFpbCcsIGZ1bmN0aW9uKCkgeworICAgICAgICAgICAgaW5wdXQuY2xlYXIoKTsKKyAgICAgICAgICAgIGlucHV0LnNlbmRLZXlzKCd4eHgnKTsKKworICAgICAgICAgICAgZXhwZWN0KHZhbGlkLmdldFRleHQoKSkudG9Db250YWluKCdmYWxzZScpOworICAgICAgICAgIH0pOworICAgICAgICA8L2ZpbGU+CisgICAgICA8L2V4YW1wbGU+CisgICAqLworICAnZW1haWwnOiBlbWFpbElucHV0VHlwZSwKKworCisgIC8qKgorICAgKiBAbmdkb2MgaW5wdXQKKyAgICogQG5hbWUgaW5wdXRbcmFkaW9dCisgICAqCisgICAqIEBkZXNjcmlwdGlvbgorICAgKiBIVE1MIHJhZGlvIGJ1dHRvbi4KKyAgICoKKyAgICogQHBhcmFtIHtzdHJpbmd9IG5nTW9kZWwgQXNzaWduYWJsZSBhbmd1bGFyIGV4cHJlc3Npb24gdG8gZGF0YS1iaW5kIHRvLgorICAgKiBAcGFyYW0ge3N0cmluZ30gdmFsdWUgVGhlIHZhbHVlIHRvIHdoaWNoIHRoZSBleHByZXNzaW9uIHNob3VsZCBiZSBzZXQgd2hlbiBzZWxlY3RlZC4KKyAgICogQHBhcmFtIHtzdHJpbmc9fSBuYW1lIFByb3BlcnR5IG5hbWUgb2YgdGhlIGZvcm0gdW5kZXIgd2hpY2ggdGhlIGNvbnRyb2wgaXMgcHVibGlzaGVkLgorICAgKiBAcGFyYW0ge3N0cmluZz19IG5nQ2hhbmdlIEFuZ3VsYXIgZXhwcmVzc2lvbiB0byBiZSBleGVjdXRlZCB3aGVuIGlucHV0IGNoYW5nZXMgZHVlIHRvIHVzZXIKKyAgICogICAgaW50ZXJhY3Rpb24gd2l0aCB0aGUgaW5wdXQgZWxlbWVudC4KKyAgICogQHBhcmFtIHtzdHJpbmd9IG5nVmFsdWUgQW5ndWxhciBleHByZXNzaW9uIHdoaWNoIHNldHMgdGhlIHZhbHVlIHRvIHdoaWNoIHRoZSBleHByZXNzaW9uIHNob3VsZAorICAgKiAgICBiZSBzZXQgd2hlbiBzZWxlY3RlZC4KKyAgICoKKyAgICogQGV4YW1wbGUKKyAgICAgIDxleGFtcGxlIG5hbWU9InJhZGlvLWlucHV0LWRpcmVjdGl2ZSIgbW9kdWxlPSJyYWRpb0V4YW1wbGUiPgorICAgICAgICA8ZmlsZSBuYW1lPSJpbmRleC5odG1sIj4KKyAgICAgICAgIDxzY3JpcHQ+CisgICAgICAgICAgIGFuZ3VsYXIubW9kdWxlKCdyYWRpb0V4YW1wbGUnLCBbXSkKKyAgICAgICAgICAgICAuY29udHJvbGxlcignRXhhbXBsZUNvbnRyb2xsZXInLCBbJyRzY29wZScsIGZ1bmN0aW9uKCRzY29wZSkgeworICAgICAgICAgICAgICAgJHNjb3BlLmNvbG9yID0gJ2JsdWUnOworICAgICAgICAgICAgICAgJHNjb3BlLnNwZWNpYWxWYWx1ZSA9IHsKKyAgICAgICAgICAgICAgICAgImlkIjogIjEyMzQ1IiwKKyAgICAgICAgICAgICAgICAgInZhbHVlIjogImdyZWVuIgorICAgICAgICAgICAgICAgfTsKKyAgICAgICAgICAgICB9XSk7CisgICAgICAgICA8L3NjcmlwdD4KKyAgICAgICAgIDxmb3JtIG5hbWU9Im15Rm9ybSIgbmctY29udHJvbGxlcj0iRXhhbXBsZUNvbnRyb2xsZXIiPgorICAgICAgICAgICA8aW5wdXQgdHlwZT0icmFkaW8iIG5nLW1vZGVsPSJjb2xvciIgdmFsdWU9InJlZCI+ICBSZWQgPGJyLz4KKyAgICAgICAgICAgPGlucHV0IHR5cGU9InJh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sKKyAgICAgICAgICB0aW1lb3V0ID0gbnVsbDsKKyAgICAgICAgfSk7CisgICAgICB9CisgICAgfTsKKworICAgIGVsZW1lbnQub24oJ2tleWRvd24nLCBmdW5jdGlvbihldmVudCkgeworICAgICAgdmFyIGtleSA9IGV2ZW50LmtleUNvZGU7CisKKyAgICAgIC8vIGlnbm9yZQorICAgICAgLy8gICAgY29tbWFuZCAgICAgICAgICAgIG1vZGlmaWVycyAgICAgICAgICAgICAgICAgICBhcnJvd3MKKyAgICAgIGlmIChrZXkgPT09IDkxIHx8ICgxNSA8IGtleSAmJiBrZXkgPCAxOSkgfHwgKDM3IDw9IGtleSAmJiBrZXkgPD0gNDApKSByZXR1cm47CisKKyAgICAgIGRlZmVyTGlzdGVuZXIoKTsKKyAgICB9KTsKKworICAgIC8vIGlmIHVzZXIgbW9kaWZpZXMgaW5wdXQgdmFsdWUgdXNpbmcgY29udGV4dCBtZW51IGluIElFLCB3ZSBuZWVkICJwYXN0ZSIgYW5kICJjdXQiIGV2ZW50cyB0byBjYXRjaCBpdAorICAgIGlmICgkc25pZmZlci5oYXNFdmVudCgncGFzdGUnKSkgeworICAgICAgZWxlbWVudC5vbigncGFzdGUgY3V0JywgZGVmZXJMaXN0ZW5lcik7CisgICAgfQorICB9CisKKyAgLy8gaWYgdXNlciBwYXN0ZSBpbnRvIGlucHV0IHVzaW5nIG1vdXNlIG9uIG9sZGVyIGJyb3dzZXIKKyAgLy8gb3IgZm9ybSBhdXRvY29tcGxldGUgb24gbmV3ZXIgYnJvd3Nlciwgd2UgbmVlZCAiY2hhbmdlIiBldmVudCB0byBjYXRjaCBpdAorICBlbGVtZW50Lm9uKCdjaGFuZ2UnLCBsaXN0ZW5lcik7CisKKyAgY3RybC4kcmVuZGVyID0gZnVuY3Rpb24oKSB7CisgICAgZWxlbWVudC52YWwoY3RybC4kaXNFbXB0eShjdHJsLiR2aWV3VmFsdWUpID8gJycgOiBjdHJsLiR2aWV3VmFsdWUpOworICB9OworCisgIC8v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gICAgICAgIGl0KCdzaG91bGQgYmUgaW52YWxpZCBpZiBlbXB0eSB3aGVuIHJlcXVpcmVkJywgZnVuY3Rpb24oKSB7CisgICAgICAgICAgdXNlck5hbWVJbnB1dC5jbGVhcigpOworICAgICAgICAgIHVzZXJOYW1lSW5wdXQuc2VuZEtleXMoJycpOworCisgICAgICAgICAgZXhwZWN0KHVzZXIuZ2V0VGV4dCgpKS50b0NvbnRhaW4oJ3sibGFzdCI6InZpc2l0b3IifScpOworICAgICAgICAgIGV4cGVjdCh1c2VyTmFtZVZhbGlkLmdldFRleHQoKSkudG9Db250YWluKCdmYWxzZScpOworICAgICAgICAgIGV4cGVjdChmb3JtVmFsaWQuZ2V0VGV4dCgpKS50b0NvbnRhaW4oJ2ZhbHNlJyk7CisgICAgICAgIH0pOworCisgICAgICAgIGl0KCdzaG91bGQgYmUgdmFsaWQgaWYgZW1wdHkgd2hlbiBtaW4gbGVuZ3RoIGlzIHNldCcsIGZ1bmN0aW9uKCkgeworICAgICAgICAgIHVzZXJMYXN0SW5wdXQuY2xlYXIoKTsKKyAgICAgICAgICB1c2VyTGFzdElucHV0LnNlbmRLZXlzKCcnKTsKKworICAgICAgICAgIGV4cGVjdCh1c2VyLmdldFRleHQoKSkudG9Db250YWluKCd7Im5hbWUiOiJndWVzdCIsImxhc3QiOiIifScpOworICAgICAgICAgIGV4cGVjdChsYXN0TmFtZVZhbGlkLmdldFRleHQoKSkudG9Db250YWluKCd0cnVlJyk7CisgICAgICAgICAgZXhwZWN0KGZvcm1WYWxpZC5nZXRUZXh0KCkpLnRvQ29udGFpbigndHJ1ZScpOworICAgICAgICB9KTsKKworICAgICAgICBpdCgnc2hvdWxkIGJlIGludmFsaWQgaWYgbGVzcyB0aGFuIHJlcXVpcmVkIG1pbiBsZW5ndGgnLCBmdW5jdGlvbigpIHsKKyAgICAgICAgICB1c2VyTGFzdElucHV0LmNsZWFyKCk7CisgICAgICAgICAgdXNlckxhc3RJbnB1dC5zZW5kS2V5cygneH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gICAgICByZXN0cmljdDogJ0EnLCAvLyBvbmx5IGFjdGl2YXRlIG9uIGVsZW1lbnQgYXR0cmlidXRlCisgICAgICAgICAgICByZXF1aXJlOiAnP25nTW9kZWwnLCAvLyBnZXQgYSBob2xkIG9mIE5nTW9kZWxDb250cm9sbGVyCisgICAgICAgICAgICBsaW5rOiBmdW5jdGlvbihzY29wZSwgZWxlbWVudCwgYXR0cnMsIG5nTW9kZWwpIHsKKyAgICAgICAgICAgICAgaWYoIW5nTW9kZWwpIHJldHVybjsgLy8gZG8gbm90aGluZyBpZiBubyBuZy1tb2RlbAorCisgICAgICAgICAgICAgIC8vIFNwZWNpZnkgaG93IFVJIHNob3VsZCBiZSB1cGRhdGVkCisgICAgICAgICAgICAgIG5nTW9kZWwuJHJlbmRlciA9IGZ1bmN0aW9uKCkgeworICAgICAgICAgICAgICAgIGVsZW1lbnQuaHRtbCgkc2NlLmdldFRydXN0ZWRIdG1sKG5nTW9kZWwuJHZpZXdWYWx1ZSB8fCAnJykpOworICAgICAgICAgICAgICB9OworCisgICAgICAgICAgICAgIC8vIExpc3RlbiBmb3IgY2hhbmdlIGV2ZW50cyB0byBlbmFibGUgYmluZGluZworICAgICAgICAgICAgICBlbGVtZW50Lm9uKCdibHVyIGtleXVwIGNoYW5nZScsIGZ1bmN0aW9uKCkgeworICAgICAgICAgICAgICAgIHNjb3BlLiRhcHBseShyZWFkKTsKKyAgICAgICAgICAgICAgfSk7CisgICAgICAgICAgICAgIHJlYWQoKTsgLy8gaW5pdGlhbGl6ZQorCisgICAgICAgICAgICAgIC8vIFdyaXRlIGRhdGEgdG8gdGhlIG1vZGVsCisgICAgICAgICAgICAgIGZ1bmN0aW9uIHJlYWQoKSB7CisgICAgICAgICAgICAgICAgdmFyIGh0bWwgPSBlbGVtZW50Lmh0bWwoKTsKKyAgICAgICAgICAgICAgICAvLyBXaGVuIHdlIGNsZWFyIHRoZSBjb250ZW50IGVkaXRhYmxlIHRoZSBicm93c2VyIGxlYXZlcyBhIDxicj4gYmVoaW5kCisgICAgICAgICAgICAgICAgLy8gSWYgc3RyaXAtYnIgYXR0cmlidXRlIGlzIHByb3ZpZGVkIHRoZW4gd2Ugc3RyaXAgdGhpcyBvdXQKKyAgICAgICAgICAgICAgICBpZiggYXR0cnMuc3RyaXBCciAmJiBodG1sID09ICc8YnI+JyApIHsKKyAgICAgICAgICAgICAgICAgIGh0bWwgPSAnJzsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgbmdNb2RlbC4kc2V0Vmlld1ZhbHVlKGh0bWwpOworICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9CisgICAgICAgICAgfTsKKyAgICAgICAgfV0pOworICAgIDwvZmlsZT4KKyAgICA8ZmlsZSBuYW1lPSJpbmRleC5odG1sIj4KKyAgICAgIDxmb3JtIG5hbWU9Im15Rm9ybSI+CisgICAgICAgPGRpdiBjb250ZW50ZWRpdGFibGUKKyAgICAgICAgICAgIG5hbWU9Im15V2lkZ2V0IiBuZy1tb2RlbD0idXNlckNvbnRlbnQiCisgICAgICAgICAgICBzdHJpcC1icj0idHJ1ZSIKKyAgICAgICAgICAgIHJlcXVpcmVkPkNoYW5nZSBtZSE8L2Rpdj4KKyAgICAgICAgPHNwYW4gbmctc2hvdz0ibXlGb3JtLm15V2lkZ2V0LiRlcnJvci5yZXF1aXJlZCI+UmVxdWlyZWQhPC9zcGFuPgorICAgICAgIDxocj4KKyAgICAgICA8dGV4dGFyZWEgbmctbW9kZWw9InVzZXJDb250ZW50Ij48L3RleHRhcmVhPgorICAgICAgPC9mb3JtPgorICAgIDwvZmlsZT4KKyAgICA8ZmlsZSBuYW1lPSJwcm90cmFjdG9yLmpzIiB0eXBlPSJwcm90cmFjdG9yIj4KKyAgICBpdCgnc2hvdWxkIGRhdGEtYmluZCBhbmQgYmVjb21lIGludmFsaWQnLCBmdW5jdGlvbigpIHsKKyAgICAgIGlmIChicm93c2VyLnBhcmFtcy5icm93c2VyID09ICdzYWZhcmknIHx8I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lbGVtZW50LCBESVJUWV9DTEFTUyk7CisgICAgICBwYXJlbnRGb3JtLiRzZXREaXJ0eSgpOworICAgIH0KKworICAgIGZvckVhY2godGhpcy4kcGFyc2VycywgZnVuY3Rpb24oZm4pIHsKKyAgICAgIHZhbHVlID0gZm4odmFsdWUpOworICAgIH0pOworCisgICAgaWYgKHRoaXMuJG1vZGVsVmFsdWUgIT09IHZhbHVlKSB7CisgICAgICB0aGlzLiRtb2RlbFZhbHVlID0gdmFsdWU7CisgICAgICBuZ01vZGVsU2V0KCRzY29wZSwgdmFsdWUpOworICAgICAgZm9yRWFjaCh0aGlzLiR2aWV3Q2hhbmdlTGlzdGVuZXJzLCBmdW5jdGlvbihsaXN0ZW5lcikgeworICAgICAgICB0cnkgeworICAgICAgICAgIGxpc3RlbmVyKCk7CisgICAgICAgIH0gY2F0Y2goZSkgeworICAgICAgICAgICRleGNlcHRpb25IYW5kbGVyKGUpOworICAgICAgICB9CisgICAgICB9KTsKKyAgICB9CisgIH07CisKKyAgLy8gbW9kZWwgLT4gdmFsdWUKKyAgdmFyIGN0cmwgPSB0aGlzOworCisgICRzY29wZS4kd2F0Y2goZnVuY3Rpb24gbmdNb2RlbFdhdGNoKCkgeworICAgIHZhciB2YWx1ZSA9IG5nTW9kZWxHZXQoJHNjb3BlKTsKKworICAgIC8vIGlmIHNjb3BlIG1vZGVsIHZhbHVlIGFuZCBuZ01vZGVsIHZhbHVlIGFyZSBvdXQgb2Ygc3luYworICAgIGlmIChjdHJsLiRtb2RlbFZhbHVlICE9PSB2YWx1ZSkgeworCisgICAgICB2YXIgZm9ybWF0dGVycyA9IGN0cmwuJGZvcm1hdHRlcnMsCisgICAgICAgICAgaWR4ID0gZm9ybWF0dGVycy5sZW5ndGg7CisKKyAgICAgIGN0cmwuJG1vZGVsVmFsdWUgPSB2YWx1ZTsKKyAgICAgIHdoaWxlKGlkeC0tKSB7CisgICAgICAgIHZhbHVlID0gZm9ybWF0dGVyc1tpZHhdKHZhbHVlKTs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cz0iYW5ndWxhci1hbmltYXRlLmpzIiBhbmltYXRpb25zPSJ0cnVlIiBmaXhCYXNlPSJ0cnVlIiBtb2R1bGU9ImlucHV0RXhhbXBsZSI+CisgICAgIDxmaWxlIG5hbWU9ImluZGV4Lmh0bWwiPgorICAgICAgIDxzY3JpcHQ+CisgICAgICAgIGFuZ3VsYXIubW9kdWxlKCdpbnB1dEV4YW1wbGUnLCBbXSkKKyAgICAgICAgICAuY29udHJvbGxlcignRXhhbXBsZUNvbnRyb2xsZXInLCBbJyRzY29wZScsIGZ1bmN0aW9uKCRzY29wZSkgeworICAgICAgICAgICAgJHNjb3BlLnZhbCA9ICcxJzsKKyAgICAgICAgICB9XSk7CisgICAgICAgPC9zY3JpcHQ+CisgICAgICAgPHN0eWxlPgorICAgICAgICAgLm15LWlucHV0IHsKKyAgICAgICAgICAgLXdlYmtpdC10cmFuc2l0aW9uOmFsbCBsaW5lYXIgMC41czsKKyAgICAgICAgICAgdHJhbnNpdGlvbjphbGwgbGluZWFyIDAuNXM7CisgICAgICAgICAgIGJhY2tncm91bmQ6IHRyYW5zcGFyZW50OworICAgICAgICAgfQorICAgICAgICAgLm15LWlucHV0Lm5nLWludmFsaWQgeworICAgICAgICAgICBjb2xvcjp3aGl0ZTsKKyAgICAgICAgICAgYmFja2dyb3VuZDogcmVkOworICAgICAgICAgfQorICAgICAgIDwvc3R5bGU+CisgICAgICAgVXBkYXRlIGlucHV0IHRvIHNlZSB0cmFuc2l0aW9ucyB3aGVuIHZhbGlkL2ludmFsaWQuCisgICAgICAgSW50ZWdlciBpcyBhIHZhbGlkIHZhbHVlLgorICAgICAgIDxmb3JtIG5hbWU9InRlc3RGb3JtIiBuZy1jb250cm9sbGVyPSJFeGFtcGxlQ29udHJvbGxlciI+CisgICAgICAgICA8aW5wdXQgbmctbW9kZWw9InZhbCIgbmctcGF0dGVybj0iL15cZCskLyIgbmFtZT0iYW5pbSIgY2xhc3M9Im15LWlucHV0IiAvPgorICAgICAgIDwvZm9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JjaGFuZ2UoKSIgaWQ9Im5nLWNoYW5nZS1leGFtcGxlMSIgLz4KKyAqICAgICAgIDxpbnB1dCB0eXBlPSJjaGVja2JveCIgbmctbW9kZWw9ImNvbmZpcm1lZCIgaWQ9Im5nLWNoYW5nZS1leGFtcGxlMiIgLz4KKyAqICAgICAgIDxsYWJlbCBmb3I9Im5nLWNoYW5nZS1leGFtcGxlMiI+Q29uZmlybWVkPC9sYWJlbD48YnIgLz4KKyAqICAgICAgIDx0dD5kZWJ1ZyA9IHt7Y29uZmlybWVkfX08L3R0Pjxici8+CisgKiAgICAgICA8dHQ+Y291bnRlciA9IHt7Y291bnRlcn19PC90dD48YnIvPgorICogICAgIDwvZGl2PgorICogICA8L2ZpbGU+CisgKiAgIDxmaWxlIG5hbWU9InByb3RyYWN0b3IuanMiIHR5cGU9InByb3RyYWN0b3IiPgorICogICAgIHZhciBjb3VudGVyID0gZWxlbWVudChieS5iaW5kaW5nKCdjb3VudGVyJykpOworICogICAgIHZhciBkZWJ1ZyA9IGVsZW1lbnQoYnkuYmluZGluZygnY29uZmlybWVkJykpOworICoKKyAqICAgICBpdCgnc2hvdWxkIGV2YWx1YXRlIHRoZSBleHByZXNzaW9uIGlmIGNoYW5naW5nIGZyb20gdmlldycsIGZ1bmN0aW9uKCkgeworICogICAgICAgZXhwZWN0KGNvdW50ZXIuZ2V0VGV4dCgpKS50b0NvbnRhaW4oJzAnKTsKKyAqCisgKiAgICAgICBlbGVtZW50KGJ5LmlkKCduZy1jaGFuZ2UtZXhhbXBsZTEnKSkuY2xpY2soKTsKKyAqCisgKiAgICAgICBleHBlY3QoY291bnRlci5nZXRUZXh0KCkpLnRvQ29udGFpbignMScpOworICogICAgICAgZXhwZWN0KGRlYnVnLmdldFRleHQoKSkudG9Db250YWluKCd0cnVlJyk7CisgKiAgICAgfSk7CisgKgorICogICAgIGl0KCdzaG91bGQgbm90IGV2YWx1YXRlIHRoZSBleHByZXNzaW9uIGlmIGNoYW5naW5nIGZyb20gb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hbXlGb3JtLiRlcnJvci5yZXF1aXJlZH19PC90dD48YnIvPgorICAgICAgICA8L2Zvcm0+CisgICAgICA8L2ZpbGU+CisgICAgICA8ZmlsZSBuYW1lPSJwcm90cmFjdG9yLmpzIiB0eXBlPSJwcm90cmFjdG9yIj4KKyAgICAgICAgdmFyIGxpc3RJbnB1dCA9IGVsZW1lbnQoYnkubW9kZWwoJ25hbWVzJykpOworICAgICAgICB2YXIgbmFtZXMgPSBlbGVtZW50KGJ5LmJpbmRpbmcoJ3t7bmFtZXN9fScpKTsKKyAgICAgICAgdmFyIHZhbGlkID0gZWxlbWVudChieS5iaW5kaW5nKCdteUZvcm0ubmFtZXNJbnB1dC4kdmFsaWQnKSk7CisgICAgICAgIHZhciBlcnJvciA9IGVsZW1lbnQoYnkuY3NzKCdzcGFuLmVycm9yJykpOworCisgICAgICAgIGl0KCdzaG91bGQgaW5pdGlhbGl6ZSB0byBtb2RlbCcsIGZ1bmN0aW9uKCkgeworICAgICAgICAgIGV4cGVjdChuYW1lcy5nZXRUZXh0KCkpLnRvQ29udGFpbignWyJpZ29yIiwibWlza28iLCJ2b2p0YSJdJyk7CisgICAgICAgICAgZXhwZWN0KHZhbGlkLmdldFRleHQoKSkudG9Db250YWluKCd0cnVlJyk7CisgICAgICAgICAgZXhwZWN0KGVycm9yLmdldENzc1ZhbHVlKCdkaXNwbGF5JykpLnRvQmUoJ25vbmUnKTsKKyAgICAgICAgfSk7CisKKyAgICAgICAgaXQoJ3Nob3VsZCBiZSBpbnZhbGlkIGlmIGVtcHR5JywgZnVuY3Rpb24oKSB7CisgICAgICAgICAgbGlzdElucHV0LmNsZWFyKCk7CisgICAgICAgICAgbGlzdElucHV0LnNlbmRLZXlzKCcnKTsKKworICAgICAgICAgIGV4cGVjdChuYW1lcy5nZXRUZXh0KCkpLnRvQ29udGFpbignJyk7CisgICAgICAgICAgZXhwZWN0KHZhbGlkLmdldFRleHQoKSkudG9Db250YWluKCdmYWxzZScpOworICAgICAgICAgIG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bGwgYmUgYm91bmQgdG8gdGhlIGB2YWx1ZWAgYXR0cmlidXRlCisgKiAgIG9mIHRoZSBgaW5wdXRgIGVsZW1lbnQKKyAqCisgKiBAZXhhbXBsZQorICAgIDxleGFtcGxlIG5hbWU9Im5nVmFsdWUtZGlyZWN0aXZlIiBtb2R1bGU9InZhbHVlRXhhbXBsZSI+CisgICAgICA8ZmlsZSBuYW1lPSJpbmRleC5odG1sIj4KKyAgICAgICA8c2NyaXB0PgorICAgICAgICAgIGFuZ3VsYXIubW9kdWxlKCd2YWx1ZUV4YW1wbGUnLCBbXSkKKyAgICAgICAgICAgIC5jb250cm9sbGVyKCdFeGFtcGxlQ29udHJvbGxlcicsIFsnJHNjb3BlJywgZnVuY3Rpb24oJHNjb3BlKSB7CisgICAgICAgICAgICAgICRzY29wZS5uYW1lcyA9IFsncGl6emEnLCAndW5pY29ybnMnLCAncm9ib3RzJ107CisgICAgICAgICAgICAgICRzY29wZS5teSA9IHsgZmF2b3JpdGU6ICd1bmljb3JucycgfTsKKyAgICAgICAgICAgIH1dKTsKKyAgICAgICA8L3NjcmlwdD4KKyAgICAgICAgPGZvcm0gbmctY29udHJvbGxlcj0iRXhhbXBsZUNvbnRyb2xsZXIiPgorICAgICAgICAgIDxoMj5XaGljaCBpcyB5b3VyIGZhdm9yaXRlPzwvaDI+CisgICAgICAgICAgICA8bGFiZWwgbmctcmVwZWF0PSJuYW1lIGluIG5hbWVzIiBmb3I9Int7bmFtZX19Ij4KKyAgICAgICAgICAgICAge3tuYW1lfX0KKyAgICAgICAgICAgICAgPGlucHV0IHR5cGU9InJhZGlvIgorICAgICAgICAgICAgICAgICAgICAgbmctbW9kZWw9Im15LmZhdm9yaXRlIgorICAgICAgICAgICAgICAgICAgICAgbmctdmFsdWU9Im5hbWUiCisgICAgICAgICAgICAgICAgICAgICBpZD0ie3tuYW1lfX0iCisgICAgICAgICAgICAgICAgICAgICBuYW1lPSJmYXZvcml0ZSI+CisgICAgICAgICAgICA8L2xhYmVsPgorICAgICAgICAgIDxkaXY+WW91IGNob3NlIHt7bXkuZmF2b3JpdGV9fTwvZGl2PgorICAgICAgICA8L2Zvcm0+CisgICAgICA8L2ZpbGU+CisgICAgICA8ZmlsZSBuYW1lPSJwcm90cmFjdG9yLmpzIiB0eXBlPSJwcm90cmFjdG9yIj4KKyAgICAgICAgdmFyIGZhdm9yaXRlID0gZWxlbWVudChieS5iaW5kaW5nKCdteS5mYXZvcml0ZScpKTsKKworICAgICAgICBpdCgnc2hvdWxkIGluaXRpYWxpemUgdG8gbW9kZWwnLCBmdW5jdGlvbigpIHsKKyAgICAgICAgICBleHBlY3QoZmF2b3JpdGUuZ2V0VGV4dCgpKS50b0NvbnRhaW4oJ3VuaWNvcm5zJyk7CisgICAgICAgIH0pOworICAgICAgICBpdCgnc2hvdWxkIGJpbmQgdGhlIHZhbHVlcyB0byB0aGUgaW5wdXRzJywgZnVuY3Rpb24oKSB7CisgICAgICAgICAgZWxlbWVudC5hbGwoYnkubW9kZWwoJ215LmZhdm9yaXRlJykpLmdldCgwKS5jbGljaygpOworICAgICAgICAgIGV4cGVjdChmYXZvcml0ZS5nZXRUZXh0KCkpLnRvQ29udGFpbigncGl6emEnKTsKKyAgICAgICAgfSk7CisgICAgICA8L2ZpbGU+CisgICAgPC9leGFtcGxlPgorICovCit2YXIgbmdWYWx1ZURpcmVjdGl2ZSA9IGZ1bmN0aW9uKCkgeworICByZXR1cm4geworICAgIHByaW9yaXR5OiAxMDAsCisgICAgY29tcGlsZTogZnVuY3Rpb24odHBsLCB0cGxBdHRyKSB7CisgICAgICBpZiAoQ09OU1RBTlRfVkFMVUVfUkVHRVhQLnRlc3QodHBsQXR0ci5uZ1ZhbHVlKSkgeworICAgICAgICByZXR1cm4gZnVuY3Rpb24gbmdWYWx1ZUNvbnN0YW50TGluayhzY29wZSwgZWxtLCBhdHRyKSB7CisgICAgICAgICAgYXR0ci4kc2V0KCd2YWx1ZScsIHNjb3BlLiRldmFsKGF0dHIubmdWYWx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pKSB8fCAnJyk7CisgICAgICAgIH0pOworICAgICAgfTsKKyAgICB9CisgIH07Cit9XTsKKworZnVuY3Rpb24gY2xhc3NEaXJlY3RpdmUobmFtZSwgc2VsZWN0b3IpIHsKKyAgbmFtZSA9ICduZ0NsYXNzJyArIG5hbWU7CisgIHJldHVybiBbJyRhbmltYXRlJywgZnVuY3Rpb24oJGFuaW1hdGUpIHsKKyAgICByZXR1cm4geworICAgICAgcmVzdHJpY3Q6ICdBQycsCisgICAgICBsaW5rOiBmdW5jdGlvbihzY29wZSwgZWxlbWVudCwgYXR0cikgeworICAgICAgICB2YXIgb2xkVmFsOworCisgICAgICAgIHNjb3BlLiR3YXRjaChhdHRyW25hbWVdLCBuZ0NsYXNzV2F0Y2hBY3Rpb24sIHRydWUpOworCisgICAgICAgIGF0dHIuJG9ic2VydmUoJ2NsYXNzJywgZnVuY3Rpb24odmFsdWUpIHsKKyAgICAgICAgICBuZ0NsYXNzV2F0Y2hBY3Rpb24oc2NvcGUuJGV2YWwoYXR0cltuYW1lXSkpOworICAgICAgICB9KTsKKworCisgICAgICAgIGlmIChuYW1lICE9PSAnbmdDbGFzcycpIHsKKyAgICAgICAgICBzY29wZS4kd2F0Y2goJyRpbmRleCcsIGZ1bmN0aW9uKCRpbmRleCwgb2xkJGluZGV4KSB7CisgICAgICAgICAgICAvLyBqc2hpbnQgYml0d2lzZTogZmFsc2UKKyAgICAgICAgICAgIHZhciBtb2QgPSAkaW5kZXggJiAxOworICAgICAgICAgICAgaWYgKG1vZCAhPT0gKG9sZCRpbmRleCAmIDEpKSB7CisgICAgICAgICAgICAgIHZhciBjbGFzc2VzID0gYXJyYXlDbGFzc2VzKHNjb3BlLiRldmFsKGF0dHJbbmFtZV0pKTsKKyAgICAgICAgICAgICAgbW9kID09PSBzZWxlY3RvciA/CisgICAgICAgICAgICAgICAgYWRkQ2xhc3NlcyhjbGFzc2VzKSA6CisgICAgICAgICAgICAgICAgcmVtb3ZlQ2xhc3NlcyhjbGFzc2VzKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICB9KTsKKyAgICAgICAgfQorCisgICAgICAgIGZ1bmN0aW9uIGFkZENsYXNzZXMoY2xhc3NlcykgeworICAgICAgICAgIHZhciBuZXdDbGFzc2VzID0gZGlnZXN0Q2xhc3NDb3VudHMoY2xhc3NlcywgMSk7CisgICAgICAgICAgYXR0ci4kYWRkQ2xhc3MobmV3Q2xhc3Nlcyk7CisgICAgICAgIH0KKworICAgICAgICBmdW5jdGlvbiByZW1vdmVDbGFzc2VzKGNsYXNzZXMpIHsKKyAgICAgICAgICB2YXIgbmV3Q2xhc3NlcyA9IGRpZ2VzdENsYXNzQ291bnRzKGNsYXNzZXMsIC0xKTsKKyAgICAgICAgICBhdHRyLiRyZW1vdmVDbGFzcyhuZXdDbGFzc2VzKTsKKyAgICAgICAgfQorCisgICAgICAgIGZ1bmN0aW9uIGRpZ2VzdENsYXNzQ291bnRzIChjbGFzc2VzLCBjb3VudCkgeworICAgICAgICAgIHZhciBjbGFzc0NvdW50cyA9IGVsZW1lbnQuZGF0YSgnJGNsYXNzQ291bnRzJykgfHwge307CisgICAgICAgICAgdmFyIGNsYXNzZXNUb1VwZGF0ZSA9IFtdOworICAgICAgICAgIGZvckVhY2goY2xhc3NlcywgZnVuY3Rpb24gKGNsYXNzTmFtZSkgeworICAgICAgICAgICAgaWYgKGNvdW50ID4gMCB8fCBjbGFzc0NvdW50c1tjbGFzc05hbWVdKSB7CisgICAgICAgICAgICAgIGNsYXNzQ291bnRzW2NsYXNzTmFtZV0gPSAoY2xhc3NDb3VudHNbY2xhc3NOYW1lXSB8fCAwKSArIGNvdW50OworICAgICAgICAgICAgICBpZiAoY2xhc3NDb3VudHNbY2xhc3NOYW1lXSA9PT0gKyhjb3VudCA+IDApKSB7CisgICAgICAgICAgICAgICAgY2xhc3Nlc1RvVXBkYXRlLnB1c2goY2xhc3NOYW1lKTsKKyAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfQorICAgICAgICAgIH0pOworICAgICAgICAgIGVsZW1lbnQuZGF0YSgnJGNsYXNzQ291bnRzJywgY2xhc3NDb3VudHMpOworICAgICAgICAgIHJldHVybiBjbGFzc2VzVG9VcGRhdGUuam9pbignICcpOworICAgICAgICB9CisKKyAgICAgICAgZnVuY3Rpb24gdXBkYXRlQ2xhc3NlcyAob2xkQ2xhc3NlcywgbmV3Q2xhc3NlcykgeworICAgICAgICAgIHZhciB0b0FkZCA9IGFycmF5RGlmZmVyZW5jZShuZXdDbGFzc2VzLCBvbGRDbGFzc2VzKTsKKyAgICAgICAgICB2YXIgdG9SZW1vdmUgPSBhcnJheURpZmZlcmVuY2Uob2xkQ2xhc3NlcywgbmV3Q2xhc3Nlcyk7CisgICAgICAgICAgdG9SZW1vdmUgPSBkaWdlc3RDbGFzc0NvdW50cyh0b1JlbW92ZSwgLTEpOworICAgICAgICAgIHRvQWRkID0gZGlnZXN0Q2xhc3NDb3VudHModG9BZGQsIDEpOworCisgICAgICAgICAgaWYgKHRvQWRkLmxlbmd0aCA9PT0gMCkgeworICAgICAgICAgICAgJGFuaW1hdGUucmVtb3ZlQ2xhc3MoZWxlbWVudCwgdG9SZW1vdmUpOworICAgICAgICAgIH0gZWxzZSBpZiAodG9SZW1vdmUubGVuZ3RoID09PSAwKSB7CisgICAgICAgICAgICAkYW5pbWF0ZS5hZGRDbGFzcyhlbGVtZW50LCB0b0FkZCk7CisgICAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgICRhbmltYXRlLnNldENsYXNzKGVsZW1lbnQsIHRvQWRkLCB0b1JlbW92ZSk7CisgICAgICAgICAgfQorICAgICAgICB9CisKKyAgICAgICAgZnVuY3Rpb24gbmdDbGFzc1dhdGNoQWN0aW9uKG5ld1ZhbCkgeworICAgICAgICAgIGlmIChzZWxlY3RvciA9PT0gdHJ1ZSB8fCBzY29wZS4kaW5kZXggJSAyID09PSBzZWxlY3RvcikgeworICAgICAgICAgICAgdmFyIG5ld0NsYXNzZXMgPSBhcnJheUNsYXNzZXMobmV3VmFsIHx8IFtdKTsKKyAgICAgICAgICAgIGlmICghb2xkVmFsKSB7CisgICAgICAgICAgICAgIGFkZENsYXNzZXMobmV3Q2xhc3Nlcyk7CisgICAgICAgICAgICB9IGVsc2UgaWYgKCFlcXVhbHMobmV3VmFsLG9sZFZhbCkpIHsKKyAgICAgICAgICAgICAgdmFyIG9sZENsYXNzZXMgPSBhcnJheUNsYXNzZXMob2xkVmFsKTsKKyAgICAgICAgICAgICAgdXBkYXRlQ2xhc3NlcyhvbGRDbGFzc2VzLCBuZXdDbGFzc2VzKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICB9CisgICAgICAgICAgb2xkVmFsID0gc2hhbGxvd0NvcHkobmV3VmFsKTsKKyAgICAgICAgfQorICAgICAgfQorICAgIH07CisKKyAgICBmdW5jdGlvbiBhcnJheURpZmZlcmVuY2UodG9rZW5zMSwgdG9rZW5zMikgeworICAgICAgdmFyIHZhbHVlcyA9IFtdOworCisgICAgICBvdXRlcjoKKyAgICAgIGZvcih2YXIgaSA9IDA7IGkgPCB0b2tlbnMxLmxlbmd0aDsgaSsrKSB7CisgICAgICAgIHZhciB0b2tlbiA9IHRva2VuczFbaV07CisgICAgICAgIGZvcih2YXIgaiA9IDA7IGogPCB0b2tlbnMyLmxlbmd0aDsgaisrKSB7CisgICAgICAgICAgaWYodG9rZW4gPT0gdG9rZW5zMltqXSkgY29udGludWUgb3V0ZXI7CisgICAgICAgIH0KKyAgICAgICAgdmFsdWVzLnB1c2godG9rZW4pOworICAgICAgfQorICAgICAgcmV0dXJuIHZhbHVlczsKKyAgICB9CisKKyAgICBmdW5jdGlvbiBhcnJheUNsYXNzZXMgKGNsYXNzVmFsKSB7CisgICAgICBpZiAoaXNBcnJheShjbGFzc1ZhbCkpIHsKKyAgICAgICAgcmV0dXJuIGNsYXNzVmFsOworICAgICAgfSBlbHNlIGlmIChpc1N0cmluZyhjbGFzc1ZhbCkpIHsKKyAgICAgICAgcmV0dXJuIGNsYX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MCwgMC40NTAsIDAuOTQwKSAwLjVzOworICAgICAgIH0KKworICAgICAgIC5iYXNlLWNsYXNzLm15LWNsYXNzIHsKKyAgICAgICAgIGNvbG9yOiByZWQ7CisgICAgICAgICBmb250LXNpemU6M2VtOworICAgICAgIH0KKyAgICAgPC9maWxlPgorICAgICA8ZmlsZSBuYW1lPSJwcm90cmFjdG9yLmpzIiB0eXBlPSJwcm90cmFjdG9yIj4KKyAgICAgICBpdCgnc2hvdWxkIGNoZWNrIG5nLWNsYXNzJywgZnVuY3Rpb24oKSB7CisgICAgICAgICBleHBlY3QoZWxlbWVudChieS5jc3MoJy5iYXNlLWNsYXNzJykpLmdldEF0dHJpYnV0ZSgnY2xhc3MnKSkubm90LgorICAgICAgICAgICB0b01hdGNoKC9teS1jbGFzcy8pOworCisgICAgICAgICBlbGVtZW50KGJ5LmlkKCdzZXRidG4nKSkuY2xpY2soKTsKKworICAgICAgICAgZXhwZWN0KGVsZW1lbnQoYnkuY3NzKCcuYmFzZS1jbGFzcycpKS5nZXRBdHRyaWJ1dGUoJ2NsYXNzJykpLgorICAgICAgICAgICB0b01hdGNoKC9teS1jbGFzcy8pOworCisgICAgICAgICBlbGVtZW50KGJ5LmlkKCdjbGVhcmJ0bicpKS5jbGljaygpOworCisgICAgICAgICBleHBlY3QoZWxlbWVudChieS5jc3MoJy5iYXNlLWNsYXNzJykpLmdldEF0dHJpYnV0ZSgnY2xhc3MnKSkubm90LgorICAgICAgICAgICB0b01hdGNoKC9teS1jbGFzcy8pOworICAgICAgIH0pOworICAgICA8L2ZpbGU+CisgICA8L2V4YW1wbGU+CisKKworICAgIyMgbmdDbGFzcyBhbmQgcHJlLWV4aXN0aW5nIENTUzMgVHJhbnNpdGlvbnMvQW5pbWF0aW9ucworICAgVGhlIG5nQ2xhc3MgZGlyZWN0aXZlIHN0aWxsIHN1cHBvcnRzIENTUzMgVHJhbnNpdGlvbnMvQW5pbWF0aW9ucyBldmVuIGlmIHRoZXkgZG8gbm90IGZvb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zeW50YXguCisgKgorICogPGV4YW1wbGUgbmFtZT0ibmdDb250cm9sbGVyQXMiIG1vZHVsZT0iY29udHJvbGxlckFzRXhhbXBsZSI+CisgKiAgIDxmaWxlIG5hbWU9ImluZGV4Lmh0bWwiPgorICogICAgPGRpdiBpZD0iY3RybC1hcy1leG1wbCIgbmctY29udHJvbGxlcj0iU2V0dGluZ3NDb250cm9sbGVyMSBhcyBzZXR0aW5ncyI+CisgKiAgICAgIE5hbWU6IDxpbnB1dCB0eXBlPSJ0ZXh0IiBuZy1tb2RlbD0ic2V0dGluZ3MubmFtZSIvPgorICogICAgICBbIDxhIGhyZWY9IiIgbmctY2xpY2s9InNldHRpbmdzLmdyZWV0KCkiPmdyZWV0PC9hPiBdPGJyLz4KKyAqICAgICAgQ29udGFjdDoKKyAqICAgICAgPHVsPgorICogICAgICAgIDxsaSBuZy1yZXBlYXQ9ImNvbnRhY3QgaW4gc2V0dGluZ3MuY29udGFjdHMiPgorICogICAgICAgICAgPHNlbGVjdCBuZy1tb2RlbD0iY29udGFjdC50eXBlIj4KKyAqICAgICAgICAgICAgIDxvcHRpb24+cGhvbmU8L29wdGlvbj4KKyAqICAgICAgICAgICAgIDxvcHRpb24+ZW1haWw8L29wdGlvbj4KKyAqICAgICAgICAgIDwvc2VsZWN0PgorICogICAgICAgICAgPGlucHV0IHR5cGU9InRleHQiIG5nLW1vZGVsPSJjb250YWN0LnZhbHVlIi8+CisgKiAgICAgICAgICBbIDxhIGhyZWY9IiIgbmctY2xpY2s9InNldHRpbmdzLmNsZWFyQ29udGFjdChjb250YWN0KSI+Y2xlYXI8L2E+CisgKiAgICAgICAgICB8IDxhIGhyZWY9IiIgbmctY2xpY2s9InNldHRpbmdzLnJlbW92ZUNvbnRhY3QoY29udGFjdCkiPlg8L2E+IF0KKyAqICAgICAgICA8L2xpPgorICogICAgICAgIDxsaT5bIDxhIGhyZWY9IiIgbmctY2xpY2s9InNldHRpbmdzLmFkZENvbnRhY3QoKSI+YWRkPC9hPiBdPC9saT4KKyAqICAgICA8L3VsPgorICogICAgPC9kaXY+CisgKiAgIDwvZmlsZT4KKyAqICAgPGZpbGUgbmFtZT0iYXBwLmpzIj4KKyAqICAgIGFuZ3VsYXIubW9kdWxlKCdjb250cm9sbGVyQXNFeGFtcGxlJywgW10pCisgKiAgICAgIC5jb250cm9sbGVyKCdTZXR0aW5nc0NvbnRyb2xsZXIxJywgU2V0dGluZ3NDb250cm9sbGVyMSk7CisgKgorICogICAgZnVuY3Rpb24gU2V0dGluZ3NDb250cm9sbGVyMSgpIHsKKyAqICAgICAgdGhpcy5uYW1lID0gIkpvaG4gU21pdGgiOworICogICAgICB0aGlzLmNvbnRhY3RzID0gWworICogICAgICAgIHt0eXBlOiAncGhvbmUnLCB2YWx1ZTogJzQwOCA1NTUgMTIxMid9LAorICogICAgICAgIHt0eXBlOiAnZW1haWwnLCB2YWx1ZTogJ2pvaG4uc21pdGhAZXhhbXBsZS5vcmcnfSBdOworICogICAgfQorICoKKyAqICAgIFNldHRpbmdzQ29udHJvbGxlcjEucHJvdG90eXBlLmdyZWV0ID0gZnVuY3Rpb24oKSB7CisgKiAgICAgIGFsZXJ0KHRoaXMubmFtZSk7CisgKiAgICB9OworICoKKyAqICAgIFNldHRpbmdzQ29udHJvbGxlcjEucHJvdG90eXBlLmFkZENvbnRhY3QgPSBmdW5jdGlvbigpIHsKKyAqICAgICAgdGhpcy5jb250YWN0cy5wdXNoKHt0eXBlOiAnZW1haWwnLCB2YWx1ZTogJ3lvdXJuYW1lQGV4YW1wbGUub3JnJ30pOworICogICAgfTsKKyAqCisgKiAgICBTZXR0aW5nc0NvbnRyb2xsZXIxLnByb3RvdHlwZS5yZW1vdmVDb250YWN0ID0gZnVuY3Rpb24oY29udGFjdFRvUmVtb3ZlKSB7CisgKiAgICAgdmFyIGluZGV4ID0gdGhpcy5jb250YWN0cy5pbmRleE9mKGNvbnRhY3RUb1JlbW92ZSk7CisgKiAgICAgIHRoaXMuY29udGFjdHMuc3BsaWNlKGluZGV4LCAxKTsKKyAqICAgIH07CisgKgorICogICAgU2V0dGluZ3NDb250cm9sbGVyMS5wcm90b3R5cGUuY2xlYXJDb250YWN0ID0gZnVuY3Rpb24oY29udGFjdCkgeworICogICAgICBjb250YWN0LnR5cGUgPSAncGhvbmUnOworICogICAgICBjb250YWN0LnZhbHVlID0gJyc7CisgKiAgICB9OworICogICA8L2ZpbGU+CisgKiAgIDxmaWxlIG5hbWU9InByb3RyYWN0b3IuanMiIHR5cGU9InByb3RyYWN0b3IiPgorICogICAgIGl0KCdzaG91bGQgY2hlY2sgY29udHJvbGxlciBhcycsIGZ1bmN0aW9uKCkgeworICogICAgICAgdmFyIGNvbnRhaW5lciA9IGVsZW1lbnQoYnkuaWQoJ2N0cmwtYXMtZXhtcGwnKSk7CisgKiAgICAgICAgIGV4cGVjdChjb250YWluZXIuZWxlbWVudChieS5tb2RlbCgnc2V0dGluZ3MubmFtZScpKQorICogICAgICAgICAgIC5nZXRBdHRyaWJ1dGUoJ3ZhbHVlJykpLnRvQmUoJ0pvaG4gU21pdGgnKTsKKyAqCisgKiAgICAgICB2YXIgZmlyc3RSZXBlYXQgPQorICogICAgICAgICAgIGNvbnRhaW5lci5lbGVtZW50KGJ5LnJlcGVhdGVyKCdjb250YWN0IGluIHNldHRpbmdzLmNvbnRhY3RzJykucm93KDApKTsKKyAqICAgICAgIHZhciBzZWNvbmRSZXBlYXQgPQorICogICAgICAgICAgIGNvbnRhaW5lci5lbGVtZW50KGJ5LnJlcGVhdGVyKCdjb250YWN0IGluIHNldHRpbmdzLmNvbnRhY3RzJykucm93KDEpKTsKKyAqCisgKiAgICAgICBleHBlY3QoZmlyc3RSZXBlYXQuZWxlbWVudChieS5tb2RlbCgnY29udGFjdC52YWx1ZScpKS5nZXRBdHRyaWJ1dGUoJ3ZhbHVlJykpCisgKiAgICAgICAgICAgLnRvQmUoJzQwOCA1NTUgMTIxMicpOworICoKKyAqICAgICAgIGV4cGVjdChzZWNvbmRSZXBlYX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CRzY29wZSkgeworICogICAgICRzY29wZS5uYW1lID0gIkpvaG4gU21pdGgiOworICogICAgICRzY29wZS5jb250YWN0cyA9IFsKKyAqICAgICAgIHt0eXBlOidwaG9uZScsIHZhbHVlOic0MDggNTU1IDEyMTInfSwKKyAqICAgICAgIHt0eXBlOidlbWFpbCcsIHZhbHVlOidqb2huLnNtaXRoQGV4YW1wbGUub3JnJ30gXTsKKyAqCisgKiAgICAgJHNjb3BlLmdyZWV0ID0gZnVuY3Rpb24oKSB7CisgKiAgICAgICBhbGVydCgkc2NvcGUubmFtZSk7CisgKiAgICAgfTsKKyAqCisgKiAgICAgJHNjb3BlLmFkZENvbnRhY3QgPSBmdW5jdGlvbigpIHsKKyAqICAgICAgICRzY29wZS5jb250YWN0cy5wdXNoKHt0eXBlOidlbWFpbCcsIHZhbHVlOid5b3VybmFtZUBleGFtcGxlLm9yZyd9KTsKKyAqICAgICB9OworICoKKyAqICAgICAkc2NvcGUucmVtb3ZlQ29udGFjdCA9IGZ1bmN0aW9uKGNvbnRhY3RUb1JlbW92ZSkgeworICogICAgICAgdmFyIGluZGV4ID0gJHNjb3BlLmNvbnRhY3RzLmluZGV4T2YoY29udGFjdFRvUmVtb3ZlKTsKKyAqICAgICAgICRzY29wZS5jb250YWN0cy5zcGxpY2UoaW5kZXgsIDEpOworICogICAgIH07CisgKgorICogICAgICRzY29wZS5jbGVhckNvbnRhY3QgPSBmdW5jdGlvbihjb250YWN0KSB7CisgKiAgICAgICBjb250YWN0LnR5cGUgPSAncGhvbmUnOworICogICAgICAgY29udGFjdC52YWx1ZSA9ICcnOworICogICAgIH07CisgKiAgIH0KKyAqICA8L2ZpbGU+CisgKiAgPGZpbGUgbmFtZT0icHJvdHJhY3Rvci5qcyIgdHlwZT0icHJvdHJhY3RvciI+CisgKiAgICBpdCgnc2hvdWxkIGNoZWNrIGNvbnRyb2xsZXInLCBmdW5jdGlvbigpIHsKKyAqICAgICAgdmFyIGNvbnRhaW5lciA9IGVsZW1lbnQoYnkuaWQoJ2N0cmwtZXhtcGwnKSk7CisgKgorICogICAgICBleHBlY3QoY29udGFpbmVyLmVsZW1lbnQoYnkubW9kZWwoJ25hbWUnKSkKKyAqICAgICAgICAgIC5nZXRBdHRyaWJ1dGUoJ3ZhbHVlJykpLnRvQmUoJ0pvaG4gU21pdGgnKTsKKyAqCisgKiAgICAgIHZhciBmaXJzdFJlcGVhdCA9CisgKiAgICAgICAgICBjb250YWluZXIuZWxlbWVudChieS5yZXBlYXRlcignY29udGFjdCBpbiBjb250YWN0cycpLnJvdygwKSk7CisgKiAgICAgIHZhciBzZWNvbmRSZXBlYXQgPQorICogICAgICAgICAgY29udGFpbmVyLmVsZW1lbnQoYnkucmVwZWF0ZXIoJ2NvbnRhY3QgaW4gY29udGFjdHMnKS5yb3coMSkpOworICoKKyAqICAgICAgZXhwZWN0KGZpcnN0UmVwZWF0LmVsZW1lbnQoYnkubW9kZWwoJ2NvbnRhY3QudmFsdWUnKSkuZ2V0QXR0cmlidXRlKCd2YWx1ZScpKQorICogICAgICAgICAgLnRvQmUoJzQwOCA1NTUgMTIxMicpOworICogICAgICBleHBlY3Qoc2Vjb25kUmVwZWF0LmVsZW1lbnQoYnkubW9kZWwoJ2NvbnRhY3QudmFsdWUnKSkuZ2V0QXR0cmlidXRlKCd2YWx1ZScpKQorICogICAgICAgICAgLnRvQmUoJ2pvaG4uc21pdGhAZXhhbXBsZS5vcmcnKTsKKyAqCisgKiAgICAgIGZpcnN0UmVwZWF0LmVsZW1lbnQoYnkubGlua1RleHQoJ2NsZWFyJykpLmNsaWNrKCk7CisgKgorICogICAgICBleHBlY3QoZmlyc3RSZXBlYXQuZWxlbWVudChieS5tb2RlbCgnY29udGFjdC52YWx1ZScpKS5nZXRBdHRyaWJ1dGUoJ3ZhbHVlJykpCisgKiAgICAgICAgICAudG9CZSgnJyk7CisgKgorICogICAgICBjb250YWluZXIuZWxlbWVudChieS5saW5rVGV4dCgnYWRkJykpLmNsaWNrKCk7CisgKgorICog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IHsKKyAgICAgICAgICAgICAgdmFyIGNhbGxiYWNrID0gZnVuY3Rpb24oKSB7CisgICAgICAgICAgICAgICAgZm4oc2NvcGUsIHskZXZlbnQ6ZXZlbnR9KTsKKyAgICAgICAgICAgICAgfTsKKyAgICAgICAgICAgICAgaWYgKGZvcmNlQXN5bmNFdmVudHNbZXZlbnROYW1lXSAmJiAkcm9vdFNjb3BlLiQkcGhhc2UpIHsKKyAgICAgICAgICAgICAgICBzY29wZS4kZXZhbEFzeW5jKGNhbGxiYWNrKTsKKyAgICAgICAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgICAgICBzY29wZS4kYXBwbHkoY2FsbGJhY2spOworICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9KTsKKyAgICAgICAgICB9OworICAgICAgICB9CisgICAgICB9OworICAgIH1dOworICB9CispOworCisvKioKKyAqIEBuZ2RvYyBkaXJlY3RpdmUKKyAqIEBuYW1lIG5nRGJsY2xpY2sKKyAqCisgKiBAZGVzY3JpcHRpb24KKyAqIFRoZSBgbmdEYmxjbGlja2AgZGlyZWN0aXZlIGFsbG93cyB5b3UgdG8gc3BlY2lmeSBjdXN0b20gYmVoYXZpb3Igb24gYSBkYmxjbGljayBldmVudC4KKyAqCisgKiBAZWxlbWVudCBBTlkKKyAqIEBwcmlvcml0eSAwCisgKiBAcGFyYW0ge2V4cHJlc3Npb259IG5nRGJsY2xpY2sge0BsaW5rIGd1aWRlL2V4cHJlc3Npb24gRXhwcmVzc2lvbn0gdG8gZXZhbHVhdGUgdXBvbgorICogYSBkYmxjbGljay4gKFRoZSBFdmVudCBvYmplY3QgaXMgYXZhaWxhYmxlIGFzIGAkZXZlbnRgKQorICoKKyAqIEBleGFtcGxlCisgICA8ZXhhbXBsZT4KKyAgICAgPGZpbGUgbmFtZT0iaW5kZXguaHRtbCI+CisgICAgICA8YnV0dG9uIG5nLWRibGNsaWNrPSJjb3VudCA9IGNvdW50ICsgMSIgbmctaW5pdD0iY291bnQ9MCI+Cis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Akc2NvcGUubGlzdCA9IFtdOworICAgICAgICAgICAgJHNjb3BlLnRleHQgPSAnaGVsbG8nOworICAgICAgICAgICAgJHNjb3BlLnN1Ym1pdCA9IGZ1bmN0aW9uKCkgeworICAgICAgICAgICAgICBpZiAoJHNjb3BlLnRleHQpIHsKKyAgICAgICAgICAgICAgICAkc2NvcGUubGlzdC5wdXNoKHRoaXMudGV4dCk7CisgICAgICAgICAgICAgICAgJHNjb3BlLnRleHQgPSAnJzsKKyAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfTsKKyAgICAgICAgICB9XSk7CisgICAgICA8L3NjcmlwdD4KKyAgICAgIDxmb3JtIG5nLXN1Ym1pdD0ic3VibWl0KCkiIG5nLWNvbnRyb2xsZXI9IkV4YW1wbGVDb250cm9sbGVyIj4KKyAgICAgICAgRW50ZXIgdGV4dCBhbmQgaGl0IGVudGVyOgorICAgICAgICA8aW5wdXQgdHlwZT0idGV4dCIgbmctbW9kZWw9InRleHQiIG5hbWU9InRleHQiIC8+CisgICAgICAgIDxpbnB1dCB0eXBlPSJzdWJtaXQiIGlkPSJzdWJtaXQiIHZhbHVlPSJTdWJtaXQiIC8+CisgICAgICAgIDxwcmU+bGlzdD17e2xpc3R9fTwvcHJlPgorICAgICAgPC9mb3JtPgorICAgICA8L2ZpbGU+CisgICAgIDxmaWxlIG5hbWU9InByb3RyYWN0b3IuanMiIHR5cGU9InByb3RyYWN0b3IiPgorICAgICAgIGl0KCdzaG91bGQgY2hlY2sgbmctc3VibWl0JywgZnVuY3Rpb24oKSB7CisgICAgICAgICBleHBlY3QoZWxlbWVudChieS5iaW5kaW5nKCdsaXN0JykpLmdldFRleHQoKSkudG9CZSgnbGlzdD1bXScpOworICAgICAgICAgZWxlbWVudChieS5jc3MoJyNzdWJtaXQnKSkuY2xpY2soKTsKKyAgICAgICAgIGV4cGVjdChlbGVtZW50KGJ5LmJpbmRpbmcoJ2xpc3QnKSkuZ2V0VGV4dCgpKS50b0NvbnRhaW4oJ2hl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sZFNjb3BlID0gJHNjb3BlLiRuZXcoKTsKKyAgICAgICAgICAgICAgJHRyYW5zY2x1ZGUoY2hpbGRTY29wZSwgZnVuY3Rpb24gKGNsb25lKSB7CisgICAgICAgICAgICAgICAgY2xvbmVbY2xvbmUubGVuZ3RoKytdID0gZG9jdW1lbnQuY3JlYXRlQ29tbWVudCgnIGVuZCBuZ0lmOiAnICsgJGF0dHIubmdJZiArICcgJyk7CisgICAgICAgICAgICAgICAgLy8gTm90ZTogV2Ugb25seSBuZWVkIHRoZSBmaXJzdC9sYXN0IG5vZGUgb2YgdGhlIGNsb25lZCBub2Rlcy4KKyAgICAgICAgICAgICAgICAvLyBIb3dldmVyLCB3ZSBuZWVkIHRvIGtlZXAgdGhlIHJlZmVyZW5jZSB0byB0aGUganFsaXRlIHdyYXBwZXIgYXMgaXQgbWlnaHQgYmUgY2hhbmdlZCBsYXRlcgorICAgICAgICAgICAgICAgIC8vIGJ5IGEgZGlyZWN0aXZlIHdpdGggdGVtcGxhdGVVcmwgd2hlbiBpdHMgdGVtcGxhdGUgYXJyaXZlcy4KKyAgICAgICAgICAgICAgICBibG9jayA9IHsKKyAgICAgICAgICAgICAgICAgIGNsb25lOiBjbG9uZQorICAgICAgICAgICAgICAgIH07CisgICAgICAgICAgICAgICAgJGFuaW1hdGUuZW50ZXIoY2xvbmUsICRlbGVtZW50LnBhcmVudCgpLCAkZWxlbWVudCk7CisgICAgICAgICAgICAgIH0pOworICAgICAgICAgICAgfQorICAgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICBpZihwcmV2aW91c0VsZW1lbnRzKSB7CisgICAgICAgICAgICAgIHByZXZpb3VzRWxlbWVudHMucmVtb3ZlKCk7CisgICAgICAgICAgICAgIHByZXZpb3VzRWxlbWVudHMgPSBudWxsOworICAgICAgICAgICAgfQorICAgICAgICAgICAgaWYoY2hpbGRTY29wZSkgeworICAgICAgICAgICAgICBjaGlsZFNjb3BlLiRkZXN0cm95KCk7CisgICAgICAgICAgICAg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mlsZT4KKyAgICA8ZmlsZSBuYW1lPSJ0ZW1wbGF0ZTEuaHRtbCI+CisgICAgICBDb250ZW50IG9mIHRlbXBsYXRlMS5odG1sCisgICAgPC9maWxlPgorICAgIDxmaWxlIG5hbWU9InRlbXBsYXRlMi5odG1sIj4KKyAgICAgIENvbnRlbnQgb2YgdGVtcGxhdGUyLmh0bWwKKyAgICA8L2ZpbGU+CisgICAgPGZpbGUgbmFtZT0iYW5pbWF0aW9ucy5jc3MiPgorICAgICAgLnNsaWRlLWFuaW1hdGUtY29udGFpbmVyIHsKKyAgICAgICAgcG9zaXRpb246cmVsYXRpdmU7CisgICAgICAgIGJhY2tncm91bmQ6d2hpdGU7CisgICAgICAgIGJvcmRlcjoxcHggc29saWQgYmxhY2s7CisgICAgICAgIGhlaWdodDo0MHB4OworICAgICAgICBvdmVyZmxvdzpoaWRkZW47CisgICAgICB9CisKKyAgICAgIC5zbGlkZS1hbmltYXRlIHsKKyAgICAgICAgcGFkZGluZzoxMHB4OworICAgICAgfQorCisgICAgICAuc2xpZGUtYW5pbWF0ZS5uZy1lbnRlciwgLnNsaWRlLWFuaW1hdGUubmctbGVhdmUgeworICAgICAgICAtd2Via2l0LXRyYW5zaXRpb246YWxsIGN1YmljLWJlemllcigwLjI1MCwgMC40NjAsIDAuNDUwLCAwLjk0MCkgMC41czsKKyAgICAgICAgdHJhbnNpdGlvbjphbGwgY3ViaWMtYmV6aWVyKDAuMjUwLCAwLjQ2MCwgMC40NTAsIDAuOTQwKSAwLjVzOworCisgICAgICAgIHBvc2l0aW9uOmFic29sdXRlOworICAgICAgICB0b3A6MDsKKyAgICAgICAgbGVmdDowOworICAgICAgICByaWdodDowOworICAgICAgICBib3R0b206MDsKKyAgICAgICAgZGlzcGxheTpibG9jazsKKyAgICAgICAgcGFkZGluZzoxMHB4OworICAgICAgfQorCisgICAgICAuc2xpZGUtYW5pbWF0ZS5uZy1lbnRlciB7CisgICAgICAgIHRvcDotNTBweDsKKyAgICAgIH0KKy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gICAgICBpZihwcmV2aW91c0VsZW1lbnQpIHsKKyAgICAgICAgICAgIHByZXZpb3VzRWxlbWVudC5yZW1vdmUoKTsKKyAgICAgICAgICAgIHByZXZpb3VzRWxlbWVudCA9IG51bGw7CisgICAgICAgICAgfQorICAgICAgICAgIGlmKGN1cnJlbnRTY29wZSkgeworICAgICAgICAgICAgY3VycmVudFNjb3BlLiRkZXN0cm95KCk7CisgICAgICAgICAgICBjdXJyZW50U2NvcGUgPSBudWxsOworICAgICAgICAgIH0KKyAgICAgICAgICBpZihjdXJyZW50RWxlbWVudCkgeworICAgICAgICAgICAgJGFuaW1hdGUubGVhdmUoY3VycmVudEVsZW1lbnQsIGZ1bmN0aW9uKCkgeworICAgICAgICAgICAgICBwcmV2aW91c0VsZW1lbnQgPSBudWxsOworICAgICAgICAgICAgfSk7CisgICAgICAgICAgICBwcmV2aW91c0VsZW1lbnQgPSBjdXJyZW50RWxlbWVudDsKKyAgICAgICAgICAgIGN1cnJlbnRFbGVtZW50ID0gbnVsbDsKKyAgICAgICAgICB9CisgICAgICAgIH07CisKKyAgICAgICAgc2NvcGUuJHdhdGNoKCRzY2UucGFyc2VBc1Jlc291cmNlVXJsKHNyY0V4cCksIGZ1bmN0aW9uIG5nSW5jbHVkZVdhdGNoQWN0aW9uKHNyYykgeworICAgICAgICAgIHZhciBhZnRlckFuaW1hdGlvbiA9IGZ1bmN0aW9uKCkgeworICAgICAgICAgICAgaWYgKGlzRGVmaW5lZChhdXRvU2Nyb2xsRXhwKSAmJiAoIWF1dG9TY3JvbGxFeHAgfHwgc2NvcGUuJGV2YWwoYXV0b1Njcm9sbEV4cCkpKSB7CisgICAgICAgICAgICAgICRhbmNob3JTY3JvbGwoKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICB9OworICAgICAgICAgIHZhciB0aGlzQ2hhbmdlSWQgPSArK2NoYW5nZUNvdW50ZXI7CisKKyAgICAgICAgICBpZiAoc3JjKSB7CisgICAgICAgICAgICAkaHR0cC5nZX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HsKKyAgICAgICAgICAgICAgICBjbGVhbnVwTGFzdEluY2x1ZGVDb250ZW50KCk7CisgICAgICAgICAgICAgICAgJGFuaW1hdGUuZW50ZXIoY2xvbmUsIG51bGwsICRlbGVtZW50LCBhZnRlckFuaW1hdGlvbik7CisgICAgICAgICAgICAgIH0pOworCisgICAgICAgICAgICAgIGN1cnJlbnRTY29wZSA9IG5ld1Njb3BlOworICAgICAgICAgICAgICBjdXJyZW50RWxlbWVudCA9IGNsb25lOworCisgICAgICAgICAgICAgIGN1cnJlbnRTY29wZS4kZW1pdCgnJGluY2x1ZGVDb250ZW50TG9hZGVkJyk7CisgICAgICAgICAgICAgIHNjb3BlLiRldmFsKG9ubG9hZEV4cCk7CisgICAgICAgICAgICB9KS5lcnJvcihmdW5jdGlvbigpIHsKKyAgICAgICAgICAgICAgaWYgKHRoaXNDaGFuZ2VJZCA9PT0gY2hhbmdlQ291bnRlcikgY2xlYW51cExhc3RJbmNsdWRlQ29udGVudCgpOworICAgICAgICAgICAgfSk7CisgICAgICAgICAgICBzY29wZS4kZW1pdCgnJGluY2x1ZGVDb250ZW50UmVxdWVzdGVkJyk7CisgICAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgIGNsZWFudXBMYXN0SW5jbHVkZUNvbnRlbnQoKTsKKyAgICAgICAgICAgIGN0cmwudGVtcGxhdGUgPSBudWxsOworICAgICAgICAgIH0KKyAgICAgICAgfSk7CisgICAgICB9OworICAgIH0KKyAgfTsKK31dOworCisvLyBUaGlzIGRpcmVjdGl2ZSBpcyBjYWxsZWQgZHVyaW5nIHRoZSAkdHJhbnNjbHVkZSBjYWxsIG9mIHRoZSBmaXJzdCBgbmdJbmNsdWRlYCBkaXJlY3RpdmUuCisvLyBJdCB3aWxsIHJlcGxhY2UgYW5kIGNvbXBpbGUgdGhlIGNvbnRlbnQgb2YgdGhlIGVsZW1lbnQgd2l0aCB0aGUgbG9hZGVkIHRlbXBsYXRlLgorLy8gV2UgbmVlZCB0aGlzIGR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mctY29udHJvbGxlcj0iRXhhbXBsZUNvbnRyb2xsZXIiPgorICAgICAgICAgIFBlcnNvbiAxOjxpbnB1dCB0eXBlPSJ0ZXh0IiBuZy1tb2RlbD0icGVyc29uMSIgdmFsdWU9Iklnb3IiIC8+PGJyLz4KKyAgICAgICAgICBQZXJzb24gMjo8aW5wdXQgdHlwZT0idGV4dCIgbmctbW9kZWw9InBlcnNvbjIiIHZhbHVlPSJNaXNrbyIgLz48YnIvPgorICAgICAgICAgIE51bWJlciBvZiBQZW9wbGU6PGlucHV0IHR5cGU9InRleHQiIG5nLW1vZGVsPSJwZXJzb25Db3VudCIgdmFsdWU9IjEiIC8+PGJyLz4KKworICAgICAgICAgIDwhLS0tIEV4YW1wbGUgd2l0aCBzaW1wbGUgcGx1cmFsaXphdGlvbiBydWxlcyBmb3IgZW4gbG9jYWxlIC0tLT4KKyAgICAgICAgICBXaXRob3V0IE9mZnNldDoKKyAgICAgICAgICA8bmctcGx1cmFsaXplIGNvdW50PSJwZXJzb25Db3VudCIKKyAgICAgICAgICAgICAgICAgICAgICAgIHdoZW49InsnMCc6ICdOb2JvZHkgaXMgdmlld2luZy4nLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICdvbmUnOiAnMSBwZXJzb24gaXMgdmlld2luZy4nLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICdvdGhlcic6ICd7fSBwZW9wbGUgYXJlIHZpZXdpbmcuJ30iPgorICAgICAgICAgIDwvbmctcGx1cmFsaXplPjxicj4KKworICAgICAgICAgIDwhLS0tIEV4YW1wbGUgd2l0aCBvZmZzZXQgLS0tPgorICAgICAgICAgIFdpdGggT2Zmc2V0KDIpOgorICAgICAgICAgIDxuZy1wbHVyYWxpemUgY291bnQ9InBlcnNvbkNvdW50IiBvZmZzZXQ9MgorICAgICAgICAgICAgICAgICAgICAgICAgd2hlbj0ieycwJzogJ05vYm9keSBpcyB2aWV3aW5nLicsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJzEnOiAne3twZXJzb24xfX0gaXMgdmlld2luZy4nLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICcyJzogJ3t7cGVyc29uMX19IGFuZCB7e3BlcnNvbjJ9fSBhcmUgdmlld2luZy4nLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICdvbmUnOiAne3twZXJzb24xfX0sIHt7cGVyc29uMn19IGFuZCBvbmUgb3RoZXIgcGVyc29uIGFyZSB2aWV3aW5nLicsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJ290aGVyJzogJ3t7cGVyc29uMX19LCB7e3BlcnNvbjJ9fSBhbmQge30gb3RoZXIgcGVvcGxlIGFyZSB2aWV3aW5nLid9Ij4KKyAgICAgICAgICA8L25nLXBsdXJhbGl6ZT4KKyAgICAgICAgPC9kaXY+CisgICAgICA8L2ZpbGU+CisgICAgICA8ZmlsZSBuYW1lPSJwcm90cmFjdG9yLmpzIiB0eXBlPSJwcm90cmFjdG9yIj4KKyAgICAgICAgaXQoJ3Nob3VsZCBzaG93IGNvcnJlY3QgcGx1cmFsaXplZCBzdHJpbmcnLCBmdW5jdGlvbigpIHsKKyAgICAgICAgICB2YXIgd2l0aG91dE9mZnNldCA9IGVsZW1lbnQuYWxsKGJ5LmNzcygnbmctcGx1cmFsaXplJykpLmdldCgwKTsKKyAgICAgICAgICB2YXIgd2l0aE9mZnNldCA9IGVsZW1lbnQuYWxsKGJ5LmNzcygnbmctcGx1cmFsaXplJykpLmdldCgxKTsKKyAgICAgICAgICB2YXIgY291bnRJbnB1dCA9IGVsZW1lbnQoYnkubW9kZWwoJ3BlcnNvbkNvdW50JykpOworCisgICAgICAgICAgZXhwZWN0KHdpdGhvdXRPZmZzZXQuZ2V0VGV4dCgpKS50b0VxdWFsKCcxIHBlcnNvbiBpcyB2aWV3aW5nLicpOworICAgICAgICAgIGV4cGVjdCh3aXRoT2Zmc2V0LmdldFRleHQoKSkudG9FcXVhbCgnSWdvciBpcyB2aWV3aW5nLicpOworCisgICAgICAgICAgY291bnRJbnB1dC5jbGVhcigpOworICAgICAgICAgIGNvdW50SW5wdXQuc2VuZEtleXMoJzAnKTsKKworICAgICAgICAgIGV4cGVjdCh3aXRob3V0T2Zmc2V0LmdldFRleHQoKSkudG9FcXVhbCgnTm9ib2R5IGlzIHZpZXdpbmcuJyk7CisgICAgICAgICAgZXhwZWN0KHdpdGhPZmZzZXQuZ2V0VGV4dCgpKS50b0VxdWFsKCdOb2JvZHkgaXMgdmlld2luZy4nKTsKKworICAgICAgICAgIGNvdW50SW5wdXQuY2xlYXIoKTsKKyAgICAgICAgICBjb3VudElucHV0LnNlbmRLZXlzKCcyJyk7CisKKyAgICAgICAgICBleHBlY3Qod2l0aG91dE9mZnNldC5nZXRUZXh0KCkpLnRvRXF1YWwoJzIgcGVvcGxlIGFyZSB2aWV3aW5nLicpOworICAgICAgICAgIGV4cGVjdCh3aXRoT2Zmc2V0LmdldFRleHQoKSkudG9FcXVhbCgnSWdvciBhbmQgTWlza28gYXJlIHZpZXdpbmcuJyk7CisKKyAgICAgICAgICBjb3VudElucHV0LmNsZWFyKCk7CisgICAgICAgICAgY291bnRJbnB1dC5zZW5kS2V5cygnMycpOworCisgICAgICAgICAgZXhwZWN0KHdpdGhvdXRPZmZzZXQuZ2V0VGV4dCgpKS50b0VxdWFsKCczIHBlb3BsZSBhcmUgdmlld2luZy4nKTsKKyAgICAgICAgICBleHBlY3Qod2l0aE9mZnNldC5nZXRUZXh0KCkpLnRvRXF1YWwoJ0lnb3IsIE1pc2tvIGFuZCBvbmUgb3RoZXIgcGVyc29uIGFyZSB2aWV3aW5nLicpOworCisgICAgICAgICAgY291bnRJbnB1dC5jbGVhcigpOworICAgICAgICAgIGNvdW50SW5wdXQuc2VuZEtleXMoJzQnKTsKKworICAgICAgICAgIGV4cGVjdCh3aXRob3V0T2Zmc2V0LmdldFRleHQoKSkudG9FcXVhbCgnNCBwZW9wbGUgYXJlIHZpZXdpbmcuJyk7CisgICAgICAgICAgZXhwZWN0KHdpdGhPZmZzZXQuZ2V0VGV4dCgpKS50b0VxdWFsKCdJZ29yLCBNaXNrbyBhbmQgMiBvdGhlciBwZW9wbGUgYXJlIHZpZXdpbmcuJyk7CisgICAgICAgIH0pOworICAgICAgICBpdCgnc2hvdWxkIHNob3cgZGF0YS1ib3VuZCBuYW1lcycsIGZ1bmN0aW9uKCkgeworICAgICAgICAgIHZhciB3aXRoT2Zmc2V0ID0gZWxlbWVudC5hbGwoYnkuY3NzKCduZy1wbHVyYWxpemUnKSkuZ2V0KDEpOworICAgICAgICAgIHZhciBwZXJzb25Db3VudCA9IGVsZW1lbnQoYnkubW9kZWwoJ3BlcnNvbkNvdW50JykpOworICAgICAgICAgIHZhciBwZXJzb24xID0gZWxlbWVudChieS5tb2RlbCgncGVyc29uMScpKTsKKyAgICAgICAgICB2YXIgcGVyc29uMiA9IGVsZW1lbnQoYnkubW9kZWwoJ3BlcnNvbjInKSk7CisgICAgICAgICAgcGVyc29uQ291bnQuY2xlYXIoKTsKKyAgICAgICAgICBwZXJzb25Db3VudC5zZW5kS2V5cygnNCcpOworICAgICAgICAgIHBlcnNvbjEuY2xlYXIoKTsKKyAgICAgICAgICBwZXJzb24xLnNlbmRLZXlzKCdEaScpOworICAgICAgICAgIHBlcnNvbjIuY2xlYXIoKTsKKyAgICAgICAgICBwZXJzb24yLnNlbmRLZXlzKCdWb2p0YScpOworICAgICAgICAgIGV4cGVjdCh3aXRoT2Zmc2V0LmdldFRleHQoKSkudG9FcXVhbCgnRGksIFZvanRhIGFuZCAyIG90aGVyIHBlb3BsZSBhcmUgdmlld2luZy4nKTsKKyAgICAgICAgfSk7CisgICAgICA8L2ZpbGU+CisgICAgPC9leGFtcGxlPgorICovCit2YXIgbmdQbHVyYWxpemVEaXJlY3RpdmUgPSBbJyRsb2NhbGUnLCAnJGludGVycG9sYXRlJywgZnVuY3Rpb24oJGxvY2FsZSwgJGludGVycG9sYXRlKSB7CisgIHZhciBCUkFDRSA9IC97fS9nOworICByZXR1cm4geworICAgIHJlc3RyaWN0OiAnRUEnLAorICAgIGxpbms6IGZ1bmN0aW9uKHNjb3BlLCBlbGVtZW50LCBhdHRyKSB7CisgICAgICB2YXIgbnVtYmVyRXhwID0gYXR0ci5jb3VudCwKKyAgICAgICAgICB3aGVuRXhwID0gYXR0ci4kYXR0ci53aGVuICYmIGVsZW1lbnQuYXR0cihhdHRyLiRhdHRyLndoZW4pLCAvLyB3ZSBoYXZlIHt7fX0gaW4gYXR0cnMKKyAgICAgICAgICBvZmZzZXQgPSBhdHRyLm9mZnNldCB8fCAwLAorICAgICAgICAgIHdoZW5zID0gc2NvcGUuJGV2YWwod2hlbkV4cCkgfHwge30sCisgICAgICAgICAgd2hlbnNFeHBGbnMgPSB7fSwKKyAgICAgICAgICBzdGFydFN5bWJvbCA9ICRpbnRlcnBvbGF0ZS5zdGFydFN5bWJvbCgpLAorICAgICAgICAgIGVuZFN5bWJvbCA9ICRpbnRlcnBvbGF0ZS5lbmRTeW1ib2woKSwKKyAgICAgICAgICBpc1doZW4gPSAvXndoZW4oTWludXMpPyguKykkLzsKKworICAgICAgZm9yRWFjaChhdHRyLCBmdW5jdGlvbihleHByZXNzaW9uLCBhdHRyaWJ1dGVOYW1lKSB7CisgICAgICAgIGlmIChpc1doZW4udGVzdChhdHRyaWJ1dGVOYW1lKSkgeworICAgICAgICAgIHdoZW5zW2xvd2VyY2FzZShhdHRyaWJ1dGVOYW1lLnJlcGxhY2UoJ3doZW4nLCAnJykucmVwbGFjZSgnTWludXMnLCAnLScpKV0gPQorICAgICAgICAgICAgZWxlbWVudC5hdHRyKGF0dHIuJGF0dHJbYXR0cmlidXRlTmFtZV0pOworICAgICAgICB9CisgICAgICB9KTsKKyAgICAgIGZvckVhY2god2hlbnMsIGZ1bmN0aW9uKGV4cHJlc3Npb24sIGtleSkgeworICAgICAgICB3aGVuc0V4cEZuc1trZXldID0KKyAgICAgICAgICAkaW50ZXJwb2xhdGUoZXhwcmVzc2lvbi5yZX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ICAgICAgICAgW3t7JGluZGV4ICsgMX19XSB7e2ZyaWVuZC5uYW1lfX0gd2hvIGlzIHt7ZnJpZW5kLmFnZX19IHllYXJzIG9sZC4KKyAgICAgICAgICA8L2xpPgorICAgICAgICA8L3VsPgorICAgICAgPC9kaXY+CisgICAgPC9maWxlPgorICAgIDxmaWxlIG5hbWU9ImFuaW1hdGlvbnMuY3NzIj4KKyAgICAgIC5leGFtcGxlLWFuaW1hdGUtY29udGFpbmVyIHsKKyAgICAgICAgYmFja2dyb3VuZDp3aGl0ZTsKKyAgICAgICAgYm9yZGVyOjFweCBzb2xpZCBibGFjazsKKyAgICAgICAgbGlzdC1zdHlsZTpub25lOworICAgICAgICBtYXJnaW46MDsKKyAgICAgICAgcGFkZGluZzowIDEwcHg7CisgICAgICB9CisKKyAgICAgIC5hbmltYXRlLXJlcGVhdCB7CisgICAgICAgIGxpbmUtaGVpZ2h0OjQwcHg7CisgICAgICAgIGxpc3Qtc3R5bGU6bm9uZTsKKyAgICAgICAgYm94LXNpemluZzpib3JkZXItYm94OworICAgICAgfQorCisgICAgICAuYW5pbWF0ZS1yZXBlYXQubmctbW92ZSwKKyAgICAgIC5hbmltYXRlLXJlcGVhdC5uZy1lbnRlciwKKyAgICAgIC5hbmltYXRlLXJlcGVhdC5uZy1sZWF2ZSB7CisgICAgICAgIC13ZWJraXQtdHJhbnNpdGlvbjphbGwgbGluZWFyIDAuNXM7CisgICAgICAgIHRyYW5zaXRpb246YWxsIGxpbmVhciAwLjVzOworICAgICAgfQorCisgICAgICAuYW5pbWF0ZS1yZXBlYXQubmctbGVhdmUubmctbGVhdmUtYWN0aXZlLAorICAgICAgLmFuaW1hdGUtcmVwZWF0Lm5nLW1vdmUsCisgICAgICAuYW5pbWF0ZS1yZXBlYXQubmctZW50ZXIgeworICAgICAgICBvcGFjaXR5OjA7CisgICAgICAgIG1heC1oZWlnaHQ6MDsKKyAgICAgIH0KKworICAgICAgLmFuaW1hdGUtcmVwZWF0Lm5nLWxlY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HMrYnlccysoW1xzXFNdKz8pKT9ccyokLyksCisgICAgICAgICAgdHJhY2tCeUV4cCwgdHJhY2tCeUV4cEdldHRlciwgdHJhY2tCeUlkRXhwRm4sIHRyYWNrQnlJZEFycmF5Rm4sIHRyYWNrQnlJZE9iakZuLAorICAgICAgICAgIGxocywgcmhzLCB2YWx1ZUlkZW50aWZpZXIsIGtleUlkZW50aWZpZXIsCisgICAgICAgICAgaGFzaEZuTG9jYWxzID0geyRpZDogaGFzaEtleX07CisKKyAgICAgICAgaWYgKCFtYXRjaCkgeworICAgICAgICAgIHRocm93IG5nUmVwZWF0TWluRXJyKCdpZXhwJywgIkV4cGVjdGVkIGV4cHJlc3Npb24gaW4gZm9ybSBvZiAnX2l0ZW1fIGluIF9jb2xsZWN0aW9uX1sgdHJhY2sgYnkgX2lkX10nIGJ1dCBnb3QgJ3swfScuIiwKKyAgICAgICAgICAgIGV4cHJlc3Npb24pOworICAgICAgICB9CisKKyAgICAgICAgbGhzID0gbWF0Y2hbMV07CisgICAgICAgIHJocyA9IG1hdGNoWzJdOworICAgICAgICB0cmFja0J5RXhwID0gbWF0Y2hbM107CisKKyAgICAgICAgaWYgKHRyYWNrQnlFeHApIHsKKyAgICAgICAgICB0cmFja0J5RXhwR2V0dGVyID0gJHBhcnNlKHRyYWNrQnlFeHApOworICAgICAgICAgIHRyYWNrQnlJZEV4cEZuID0gZnVuY3Rpb24oa2V5LCB2YWx1ZSwgaW5kZXgpIHsKKyAgICAgICAgICAgIC8vIGFzc2lnbiBrZXksIHZhbHVlLCBhbmQgJGluZGV4IHRvIHRoZSBsb2NhbHMgc28gdGhhdCB0aGV5IGNhbiBiZSB1c2VkIGluIGhhc2ggZnVuY3Rpb25zCisgICAgICAgICAgICBpZiAoa2V5SWRlbnRpZmllcikgaGFzaEZuTG9jYWxzW2tleUlkZW50aWZpZXJdID0ga2V5OworICAgICAgICAgICAgaGFzaEZuTG9jYWxzW3ZhbHVlSWRlbnRpZmllcl0gPSB2YWx1ZTsKKyAgICAgICAgICAgIGhhc2hGbkxvY2Fscy4kaW5kZXggPSBpbmRleDsKKyAgICAgICAgICAgIHJldHVybiB0cmFja0J5RXhwR2V0dGVyKCRzY29wZSwgaGFzaEZuTG9jYWxzKTsKKyAgICAgICAgICB9OworICAgICAgICB9IGVsc2UgeworICAgICAgICAgIHRyYWNrQnlJZEFycmF5Rm4gPSBmdW5jdGlvbihrZXksIHZhbHVlKSB7CisgICAgICAgICAgICByZXR1cm4gaGFzaEtleSh2YWx1ZSk7CisgICAgICAgICAgfTsKKyAgICAgICAgICB0cmFja0J5SWRPYmpGbiA9IGZ1bmN0aW9uKGtleSkgeworICAgICAgICAgICAgcmV0dXJuIGtleTsKKyAgICAgICAgICB9OworICAgICAgICB9CisKKyAgICAgICAgbWF0Y2ggPSBsaHMubWF0Y2goL14oPzooW1wkXHddKyl8XCgoW1wkXHddKylccyosXHMqKFtcJFx3XSspXCkpJC8pOworICAgICAgICBpZiAoIW1hdGNoKSB7CisgICAgICAgICAgdGhyb3cgbmdSZXBlYXRNaW5FcnIoJ2lpZGV4cCcsICInX2l0ZW1fJyBpbiAnX2l0ZW1fIGluIF9jb2xsZWN0aW9uXycgc2hvdWxkIGJlIGFuIGlkZW50aWZpZXIgb3IgJyhfa2V5XywgX3ZhbHVlXyknIGV4cHJlc3Npb24sIGJ1dCBnb3QgJ3swfScuIiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbGhzKTsKKyAgICAgICAgfQorICAgICAgICB2YWx1ZUlkZW50aWZpZXIgPSBtYXRjaFszXSB8fCBtYXRjaFsxXTsKKyAgICAgICAga2V5SWRlbnRpZmllciA9IG1hdGNoWzJdOworCisgICAgICAgIC8vIFN0b3JlIGEgbGlzdCBvZiBlbGVtZW50cyBmcm9tIHByZXZpb3VzIHJ1bi4gVGhpcyBpcyBhIGhhc2ggd2hlcmUga2V5IGlzIHRoZSBpdGVtIGZyb20gdGhlCisgICAgICAgIC8vIGl0ZXJhdG9yLCBhbmQgdGhlIHZhbHVlIGlzIG9iamVjdHMgd2l0aCBmb2xsb3dpbmcgcHJvcGVydGllcy4KKyAgICAgICAgLy8gICAtIHNjb3BlOiBib3VuZCBzY29wZQorICAgICAgICAvLyAgIC0gZWxlbWVudDogcHJldmlvdXMgZWxlbWVudC4KKyAgICAgICAgLy8gICAtIGluZGV4OiBwb3NpdGlvbgorICAgICAgICB2YXIgbGFzdEJsb2NrTWFwID0ge307CisKKyAgICAgICAgLy93YXRjaCBwcm9wcworICAgICAgICAkc2NvcGUuJHdhdGNoQ29sbGVjdGlvbihyaHMsIGZ1bmN0aW9uIG5nUmVwZWF0QWN0aW9uKGNvbGxlY3Rpb24peworICAgICAgICAgIHZhciBpbmRleCwgbGVuZ3RoLAorICAgICAgICAgICAgICBwcmV2aW91c05vZGUgPSAkZWxlbWVudFswXSwgICAgIC8vIGN1cnJlbnQgcG9zaXRpb24gb2YgdGhlIG5vZGUKKyAgICAgICAgICAgICAgbmV4dE5vZGUsCisgICAgICAgICAgICAgIC8vIFNhbWUgYXMgbGFzdEJsb2NrTWFwIGJ1dCBpdCBoYXMgdGhlIGN1cnJlbnQgc3RhdGUuIEl0IHdpbGwgYmVjb21lIHRoZQorICAgICAgICAgICAgICAvLyBsYXN0QmxvY2tNYXAgb24gdGhlIG5leHQgaXRlcmF0aW9uLgorICAgICAgICAgICAgICBuZXh0QmxvY2tNYXAgPSB7fSwKKyAgICAgICAgICAgICAgYXJyYXlMZW5ndGgsCisgICAgICAgICAgICAgIGNoaWxkU2NvcGUsCisgICAgICAgICAgICAgIGtleSwgdmFsdWUsIC8vIGtleS92YWx1ZSBvZiBpdGVyYXRpb24KKyAgICAgICAgICAgICAgdHJhY2tCeUlkLAorICAgICAgICAgICAgICB0cmFja0J5SWRGbiwKKyAgICAgICAgICAgICAgY29sbGVjdGlvbktleXMsCisgICAgICAgICAgICAgIGJsb2NrLCAgICAgICAvLyBsYXN0IG9iamVjdCBpbmZvcm1hdGlvbiB7c2NvcGUsIGVsZW1lbnQsIGlkfQorICAgICAgICAgICAgICBuZXh0QmxvY2tPcmRlciA9IFtdLAorICAgICAgICAgICAgICBlbGVtZW50c1RvUmVtb3ZlOworCisKKyAgICAgICAgICBpZiAoaXNBcnJheUxpa2UoY29sbGVjdGlvbikpIHsKKyAgICAgICAgICAgIGNvbGxlY3Rpb25LZXlzID0gY29sbGVjdGlvbjsKKyAgICAgICAgICAgIHRyYWNrQnlJZEZuID0gdHJhY2tCeUlkRXhwRm4gfHwgdHJhY2tCeUlkQXJyYXlGbjsKKyAgICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgdHJhY2tCeUlkRm4gPSB0cmFja0J5SWRFeHBGbiB8fCB0cmFja0J5SWRPYmpGbjsKKyAgICAgICAgICAgIC8vIGlmIG9iamVjdCwgZXh0cmFjdCBrZXlzLCBzb3J0IHRoZW0gYW5kIHVzZSB0byBkZXRlcm1pbmUgb3JkZXIgb2YgaXRlcmF0aW9uIG92ZXIgb2JqIHByb3BzCisgICAgICAgICAgICBjb2xsZWN0aW9uS2V5cyA9IFtdOworICAgICAgICAgICAgZm9yIChrZXkgaW4gY29sbGVjdGlvbikgeworICAgICAgICAgICAgICBpZiAoY29sbGVjdGlvbi5oYXNPd25Qcm9wZXJ0eShrZXkpICYmIGtleS5jaGFyQXQoMCkgIT0gJyQnKSB7CisgICAgICAgICAgICAgICAgY29sbGVjdGlvbktleXMucHVzaChrZXkpOworICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9CisgICAgICAgICAgICBjb2xsZWN0aW9uS2V5cy5zb3J0KCk7CisgICAgICAgICAgfQorCisgICAgICAgICAgYXJyYXlMZW5ndGggPSBjb2xsZWN0aW9uS2V5cy5sZW5ndGg7CisKKyAgICAgICAgICAvLyBsb2NhdGUgZXhpc3RpbmcgaXRlbXMKKyAgICAgICAgICBsZW5ndGggPSBuZXh0QmxvY2tPcmRlci5sZW5ndGggPSBjb2xsZWN0aW9uS2V5cy5sZW5ndGg7CisgICAgICAgICAgZm9yKGluZGV4ID0gMDsgaW5kZXggPCBsZW5ndGg7IGluZGV4KyspIHsKKyAgICAgICAgICAga2V5ID0gKGNvbGxlY3Rpb24gPT09IGNvbGxlY3Rpb25LZXlzKSA/IGluZGV4IDogY29sbGVjdGlvbktleXNbaW5kZXhdOworICAgICAgICAgICB2YWx1ZSA9IGNvbGxlY3Rpb25ba2V5XTsKKyAgICAgICAgICAgdHJhY2tCeUlkID0gdHJhY2tCeUlkRm4oa2V5LCB2YWx1ZSwgaW5kZXgpOworICAgICAgICAgICBhc3NlcnROb3RIYXNPd25Qcm9wZXJ0eSh0cmFja0J5SWQsICdgdHJhY2sgYnlgIGlkJyk7CisgICAgICAgICAgIGlmKGxhc3RCbG9ja01hcC5oYXNPd25Qcm9wZXJ0eSh0cmFja0J5SWQpKSB7CisgICAgICAgICAgICAgYmxvY2sgPSBsYXN0QmxvY2tNYXBbdHJhY2tCeUlkXTsKKyAgICAgICAgICAgICBkZWxldGUgbGFzdEJsb2NrTWFwW3RyYWNrQnlJZF07CisgICAgICAgICAgICAgbmV4dEJsb2NrTWFwW3RyYWNrQnlJZF0gPSBibG9jazsKKyAgICAgICAgICAgICBuZXh0QmxvY2tPcmRlcltpbmRleF0gPSBibG9jazsKKyAgICAgICAgICAgfSBlbHNlIGlmIChuZXh0QmxvY2tNYXAuaGFzT3duUHJvcGVydHkodHJhY2tCeUlkKSkgeworICAgICAgICAgICAgIC8vIHJlc3RvcmUgbGFzdEJsb2NrTWFwCisgICAgICAgICAgICAgZm9yRWFjaChuZXh0QmxvY2tPcmRlciwgZnVuY3Rpb24oYmxvY2spIHsKKyAgICAgICAgICAgICAgIGlmIChibG9jayAmJiBibG9jay5zY29wZSkgbGFzdEJsb2NrTWFwW2Jsb2NrLmlkXSA9IGJsb2NrOworICAgICAgICAgICAgIH0pOworICAgICAgICAgICAgIC8vIFRoaXMgaXMgYSBkdXBsaWNhdGUgYW5kIHdlIG5lZWQgdG8gdGhyb3cgYW4gZXJyb3IKKyAgICAgICAgICAgICB0aHJvdyBuZ1JlcGVhdE1pbkVycignZHVwZXMnLAorICAgICAgICAgICAgICAgICAgIkR1cGxpY2F0ZXMgaW4gYSByZXBlYXRlciBhcmUgbm90IGFsbG93ZWQuIFVzZSAndHJhY2sgYnknIGV4cHJlc3Npb24gdG8gc3BlY2lmeSB1bmlxdWUga2V5cy4gUmVwZWF0ZXI6IHswfSwgRHVwbGljYXRlIGtleTogezF9LCBEdXBsaWNhdGUgdmFsdWU6IHsyfSIsCisgICAgICAgICAgICAgICAgICBleHByZXNzaW9uLCB0cmFja0J5SWQsIHRvSnNvbih2YWx1ZSkpOworICAgICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgIC8vIG5ldyBuZXZlciBiZWZvcmUgc2VlbiBibG9jaworICAgICAgICAgICAgIG5leHRCbG9ja09yZGVyW2luZGV4XSA9IHsgaWQ6IHRyYWNrQnlJZCB9OworICAgICAgICAgICAgIG5leHRCbG9ja01hcFt0cmFja0J5SWRdID0gZmFsc2U7CisgICAgICAgICAgIH0KKyAgICAgICAgIH0KKworICAgICAgICAgIC8vIHJlbW92ZSBleGlzdGluZyBpdGVtcworICAgICAgICAgIGZvciAoa2V5IGluIGxhc3RCbG9ja01hcCkgeworICAgICAgICAgICAgLy8gbGFzdEJsb2NrTWFwIGlzIG91ciBvd24gb2JqZWN0IHNvIHdlIGRvbid0IG5lZWQgdG8gdXNlIHNwZWNpYWwgaGFzT3duUHJvcGVydHlGbgorICAgICAgICAgICAgaWYgKGxhc3RCbG9ja01hcC5oYXNPd25Qcm9wZXJ0eShrZXkpKSB7CisgICAgICAgICAgICAgIGJsb2NrID0gbGFzdEJsb2NrTWFwW2tleV07CisgICAgICAgICAgICAgIGVsZW1lbnRzVG9SZW1vdmUgPSBnZXRCbG9ja0VsZW1lbnRzKGJsb2NrLmNsb25lKTsKKyAgICAgICAgICAgICAgJGFuaW1hdGUubGVhdmUoZWxlbWVudHNUb1JlbW92ZSk7CisgICAgICAgICAgICAgIGZvckVhY2goZWxlbWVudHNUb1JlbW92ZSwgZnVuY3Rpb24oZWxlbWVudCkgeyBlbGVtZW50W05HX1JFTU9WRURdID0gdHJ1ZTsgfSk7CisgICAgICAgICAgICAgIGJsb2NrLnNjb3BlLiRkZXN0cm95KCk7CisgICAgICAgICAgICB9CisgICAgICAgICAgfQorCisgICAgICAgICAgLy8gd2UgYXJlIG5vdCB1c2luZyBmb3JFYWNoIGZvciBwZXJmIHJlYXNvbnMgKHRyeWluZyB0byBhdm9pZCAjY2FsbCkKKyAgICAgICAgICBmb3IgKGluZGV4ID0gMCwgbGVuZ3RoID0gY29sbGVjdGlvbktleXMubGVuZ3RoOyBpbmRleCA8IGxlbmd0aDsgaW5kZXgrKykgeworICAgICAgICAgICAga2V5ID0gKGNvbGxlY3Rpb24gPT09IGNvbGxlY3Rpb25LZXlzKSA/IGluZGV4IDogY29sbGVjdGlvbktleXNbaW5kZXhdOworICAgICAgICAgICAgdmFsdWUgPSBjb2xsZWN0aW9uW2tleV07CisgICAgICAgICAgICBibG9jayA9IG5leHRCbG9ja09yZGVyW2luZGV4XTsKKyAgICAgICAgICAgIGlmIChuZXh0QmxvY2tPcmRlcltpbmRleCAtIDFdKSBwcmV2aW91c05vZGUgPSBnZXRCbG9ja0VuZChuZXh0QmxvY2tPcmRlcltpbmRleCAtIDFdKTsKKworICAgICAgICAgICAgaWYgKGJsb2NrLnNjb3BlKSB7CisgICAgICAgICAgICAgIC8vIGlmIHdlIGhhdmUgYWxyZWFkeSBzZWVuIHRoaXMgb2JqZWN0LCB0aGVuIHdlIG5lZWQgdG8gcmV1c2UgdGhlCisgICAgICAgICAgICAgIC8vIGFzc29jaWF0ZWQgc2NvcGUvZWxlbWVudAorICAgICAgICAgICAgICBjaGlsZFNjb3BlID0gYmxvY2suc2NvcGU7CisKKyAgICAgICAgICAgICAgbmV4dE5vZGUgPSBwcmV2aW91c05vZGU7CisgICAgICAgICAgICAgIGRvIHsKKyAgICAgICAgICAgICAgICBuZXh0Tm9kZSA9IG5leHROb2RlLm5leHRTaWJsaW5nOworICAgICAgICAgICAgICB9IHdoaWxlKG5leHROb2RlICYmIG5leHROb2RlW05HX1JFTU9WRURdKTsKKworICAgICAgICAgICAgICBpZiAoZ2V0QmxvY2tTdGFydChibG9jaykgIT0gbmV4dE5vZGUpIHsKKyAgICAgICAgICAgICAgICAvLyBleGlzdGluZyBpdGVtIHdoaWNoIGdvdCBtb3ZlZAorICAgICAgICAgICAgICAgICRhbmltYXRlLm1vdmUoZ2V0QmxvY2tFbGVtZW50cyhibG9jay5jbG9uZSksIG51bGwsIGpxTGl0ZShwcmV2aW91c05vZGUpKTsKKyAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICBwcmV2aW91c05vZGUgPSBnZXRCbG9ja0VuZChibG9jayk7CisgICAgICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgICAvLyBuZXcgaXRlbSB3aGljaCB3ZSBkb24ndCBrbm93IGFib3V0CisgICAgICAgICAgICAgIGNoaWxkU2NvcGUgPSAkc2NvcGUuJG5ldygpOworICAgICAgICAgICAgfQorCisgICAgICAgICAgICBjaGlsZFNjb3BlW3ZhbHVlSWRlbnRpZmllcl0gPSB2YWx1ZTsKKyAgICAgICAgICAgIGlmIChrZXlJZGVudGlmaWVyKSBjaGlsZFNjb3BlW2tleUlkZW50aWZpZXJdID0ga2V5OworICAgICAgICAgICAgY2hpbGRTY29wZS4kaW5kZXggPSBpbmRleDsKKyAgICAgICAgICAgIGNoaWxkU2NvcGUuJGZpcnN0ID0gKGluZGV4ID09PSAwKTsKKyAgICAgICAgICAgIGNoaWxkU2NvcGUuJGxhc3QgPSAoaW5kZXggPT09IChhcnJheUxlbmd0aCAtIDEpKTsKKyAgICAgICAgICAgIGNoaWxkU2NvcGUuJG1pZGRsZSA9ICEoY2hpbGRTY29wZS4kZmlyc3QgfHwgY2hpbGRTY29wZS4kbGFzdCk7CisgICAgICAgICAgICAvLyBqc2hpbnQgYml0d2lzZTogZmFsc2UKKyAgICAgICAgICAgIGNoaWxkU2NvcGUuJG9kZCA9ICEoY2hpbGRTY29wZS4kZXZlbiA9IChpbmRleCYxKSA9PT0gMCk7CisgICAgICAgICAgICAvLyBqc2hpbnQgYml0d2lzZTogdHJ1ZQorCisgICAgICAgICAgICBpZiAoIWJsb2NrLnNjb3BlKSB7CisgICAgICAgICAgICAgICR0cmFuc2NsdWRlKGNoaWxkU2NvcGUsIGZ1bmN0aW9uKGNsb25lKSB7CisgICAgICAgICAgICAgICAgY2xvbmVbY2xvbmUubGVuZ3RoKytdID0gZG9jdW1lbnQuY3JlYXRlQ29tbWVudCgnIGVuZCBuZ1JlcGVhdDogJyArIGV4cHJlc3Npb24gKyAnICcpOworICAgICAgICAgICAgICAgICRhbmltYXRlLmVudGVyKGNsb25lLCBudWxsLCBqcUxpdGUocHJldmlvdXNOb2RlKSk7CisgICAgICAgICAgICAgICAgcHJldmlvdXNOb2RlID0gY2xvbmU7CisgICAgICAgICAgICAgICAgYmxvY2suc2NvcGUgPSBjaGlsZFNjb3BlOworICAgICAgICAgICAgICAgIC8vIE5vdGU6IFdlIG9ubHkgbmVlZCB0aGUgZmlyc3QvbGFzdCBub2RlIG9mIHRoZSBjbG9uZWQgbm9kZXMuCisgICAgICAgICAgICAgICAgLy8gSG93ZXZlciwgd2UgbmVlZCB0byBrZWVwIHRoZSByZWZlcmVuY2UgdG8gdGhlIGpxbGl0ZSB3cmFwcGVyIGFzIGl0IG1pZ2h0IGJlIGNoYW5nZWQgbGF0ZXIKKyAgICAgICAgICAgICAgICAvLyBieSBhIGRpcmVjdGl2ZSB3aXRoIHRlbXBsYXRlVXJsIHdoZW4gaXRzIHRlbXBsYXRlIGFycml2ZXMuCisgICAgICAgICAgICAgICAgYmxvY2suY2xvbmUgPSBjbG9uZTsKKyAgICAgICAgICAgICAgICBuZXh0QmxvY2tNYXBbYmxvY2suaWRdID0gYmxvY2s7CisgICAgICAgICAgICAgI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gICAgICAgICAgPHNwYW4gY2xhc3M9ImdseXBoaWNvbiBnbHlwaGljb24tdGh1bWJzLWRvd24iPjwvc3Bhbj4gSSBoaWRlIHdoZW4geW91ciBjaGVja2JveCBpcyBjaGVja2VkLgorICAgICAgICA8L2Rpdj4KKyAgICAgIDwvZGl2PgorICAgIDwvZmlsZT4KKyAgICA8ZmlsZSBuYW1lPSJnbHlwaGljb25zLmNzcyI+CisgICAgICBAaW1wb3J0IHVybCgvL25ldGRuYS5ib290c3RyYXBjZG4uY29tL2Jvb3RzdHJhcC8zLjAuMC9jc3MvYm9vdHN0cmFwLWdseXBoaWNvbnMuY3NzKTsKKyAgICA8L2ZpbGU+CisgICAgPGZpbGUgbmFtZT0iYW5pbWF0aW9ucy5jc3MiPgorICAgICAgLmFuaW1hdGUtc2hvdyB7CisgICAgICAgIC13ZWJraXQtdHJhbnNpdGlvbjphbGwgbGluZWFyIDAuNXM7CisgICAgICAgIHRyYW5zaXRpb246YWxsIGxpbmVhciAwLjVzOworICAgICAgICBsaW5lLWhlaWdodDoyMHB4OworICAgICAgICBvcGFjaXR5OjE7CisgICAgICAgIHBhZGRpbmc6MTBweDsKKyAgICAgICAgYm9yZGVyOjFweCBzb2xpZCBibGFjazsKKyAgICAgICAgYmFja2dyb3VuZDp3aGl0ZTsKKyAgICAgIH0KKworICAgICAgLmFuaW1hdGUtc2hvdy5uZy1oaWRlIHsKKyAgICAgICAgbGluZS1oZWlnaHQ6MDsKKyAgICAgICAgb3BhY2l0eTowOworICAgICAgICBwYWRkaW5nOjAgMTBweDsKKyAgICAgIH0KKworICAgICAgLmNoZWNrLWVsZW1lbnQgeworICAgICAgICBwYWRkaW5nOjEwcHg7CisgICAgICAgIGJvcmRlcjoxcHggc29saWQgYmxhY2s7CisgICAgICAgIGJhY2tncm91bmQ6d2hpdGU7CisgICAgICB9CisgICAgPC9maWxlPgorICAgIDxmaWxlIG5hbWU9InByb3RyYWN0b3IuanMiIHR5cGU9InByb3RyYWN0b3IiPgorICAgICAgdmFyIHRodW1ic1VwID0gZWxlbWVudChieS5jc3MoJ3NwYW4uZ2x5cGhpY29uLXRodW1icy11cCcpKTsKKyAgICAgIHZhciB0aHVtYnNEb3duID0gZWxlbWVudChieS5jc3MoJ3NwYW4uZ2x5cGhpY29uLXRodW1icy1kb3duJykpOworCisgICAgICBpdCgnc2hvdWxkIGNoZWNrIG5nLXNob3cgLyBuZy1oaWRlJywgZnVuY3Rpb24oKSB7CisgICAgICAgIGV4cGVjdCh0aHVtYnNVcC5pc0Rpc3BsYXllZCgpKS50b0JlRmFsc3koKTsKKyAgICAgICAgZXhwZWN0KHRodW1ic0Rvd24uaXNEaXNwbGF5ZWQoKSkudG9CZVRydXRoeSgpOworCisgICAgICAgIGVsZW1lbnQoYnkubW9kZWwoJ2NoZWNrZWQnKSkuY2xpY2soKTsKKworICAgICAgICBleHBlY3QodGh1bWJzVXAuaXNEaXNwbGF5ZWQoKSkudG9CZVRydXRoeSgpOworICAgICAgICBleHBlY3QodGh1bWJzRG93bi5pc0Rpc3BsYXllZCgpKS50b0JlRmFsc3koKTsKKyAgICAgIH0pOworICAgIDwvZmlsZT4KKyAgPC9leGFtcGxlPgorICovCit2YXIgbmdTaG93RGlyZWN0aXZlID0gWyckYW5pbWF0ZScsIGZ1bmN0aW9uKCRhbmltYXRlKSB7CisgIHJldHVybiBmdW5jdGlvbihzY29wZSwgZWxlbWVudCwgYXR0cikgeworICAgIHNjb3BlLiR3YXRjaChhdHRyLm5nU2hvdywgZnVuY3Rpb24gbmdTaG93V2F0Y2hBY3Rpb24odmFsdWUpeworICAgICAgJGFuaW1hdGVbdG9Cb29sZWFuKHZhbHVlKSA/ICdyZW1vdmVDbGFzcycgOiAnYWRkQ2xhc3MnXShlbGVtZW50LCAnbmctaGlkZScpOworICAgIH0pOworICB9OworfV07CisKKworLyoqCisgKiBAbmdkb2MgZGlyZWN0aXZlCisgKiBAbmFtZSBuZ0hpZGUKKyAqCisgKiBAZGVzY3JpcHRpb24KKy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WxsIGxpbmVhciAwLjVzOworICAgICAgICBsaW5lLWhlaWdodDoyMHB4OworICAgICAgICBvcGFjaXR5OjE7CisgICAgICAgIHBhZGRpbmc6MTBweDsKKyAgICAgICAgYm9yZGVyOjFweCBzb2xpZCBibGFjazsKKyAgICAgICAgYmFja2dyb3VuZDp3aGl0ZTsKKyAgICAgIH0KKworICAgICAgLmFuaW1hdGUtaGlkZS5uZy1oaWRlIHsKKyAgICAgICAgbGluZS1oZWlnaHQ6MDsKKyAgICAgICAgb3BhY2l0eTowOworICAgICAgICBwYWRkaW5nOjAgMTBweDsKKyAgICAgIH0KKworICAgICAgLmNoZWNrLWVsZW1lbnQgeworICAgICAgICBwYWRkaW5nOjEwcHg7CisgICAgICAgIGJvcmRlcjoxcHggc29saWQgYmxhY2s7CisgICAgICAgIGJhY2tncm91bmQ6d2hpdGU7CisgICAgICB9CisgICAgPC9maWxlPgorICAgIDxmaWxlIG5hbWU9InByb3RyYWN0b3IuanMiIHR5cGU9InByb3RyYWN0b3IiPgorICAgICAgdmFyIHRodW1ic1VwID0gZWxlbWVudChieS5jc3MoJ3NwYW4uZ2x5cGhpY29uLXRodW1icy11cCcpKTsKKyAgICAgIHZhciB0aHVtYnNEb3duID0gZWxlbWVudChieS5jc3MoJ3NwYW4uZ2x5cGhpY29uLXRodW1icy1kb3duJykpOworCisgICAgICBpdCgnc2hvdWxkIGNoZWNrIG5nLXNob3cgLyBuZy1oaWRlJywgZnVuY3Rpb24oKSB7CisgICAgICAgIGV4cGVjdCh0aHVtYnNVcC5pc0Rpc3BsYXllZCgpKS50b0JlRmFsc3koKTsKKyAgICAgICAgZXhwZWN0KHRodW1ic0Rvd24uaXNEaXNwbGF5ZWQoKSkudG9CZVRydXRoeSgpOworCisgICAgICAgIGVsZW1lbnQoYnkubW9kZWwoJ2NoZWNrZWQnKSkuY2xpY2soKTsKKworICAgICAgICBleHBlY3QodGh1bWJzVXAuaXNEaXNwbGF5ZWQoKSkudG9CZVRydXRoeSgpOworIC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HNjb3BlLml0ZW1zID0gWydzZXR0aW5ncycsICdob21lJywgJ290aGVyJ107CisgICAgICAgICAgJHNjb3BlLnNlbGVjdGlvbiA9ICRzY29wZS5pdGVtc1swXTsKKyAgICAgICAgfV0pOworICAgIDwvZmlsZT4KKyAgICA8ZmlsZSBuYW1lPSJhbmltYXRpb25zLmNzcyI+CisgICAgICAuYW5pbWF0ZS1zd2l0Y2gtY29udGFpbmVyIHsKKyAgICAgICAgcG9zaXRpb246cmVsYXRpdmU7CisgICAgICAgIGJhY2tncm91bmQ6d2hpdGU7CisgICAgICAgIGJvcmRlcjoxcHggc29saWQgYmxhY2s7CisgICAgICAgIGhlaWdodDo0MHB4OworICAgICAgICBvdmVyZmxvdzpoaWRkZW47CisgICAgICB9CisKKyAgICAgIC5hbmltYXRlLXN3aXRjaCB7CisgICAgICAgIHBhZGRpbmc6MTBweDsKKyAgICAgIH0KKworICAgICAgLmFuaW1hdGUtc3dpdGNoLm5nLWFuaW1hdGUgeworICAgICAgICAtd2Via2l0LXRyYW5zaXRpb246YWxsIGN1YmljLWJlemllcigwLjI1MCwgMC40NjAsIDAuNDUwLCAwLjk0MCkgMC41czsKKyAgICAgICAgdHJhbnNpdGlvbjphbGwgY3ViaWMtYmV6aWVyKDAuMjUwLCAwLjQ2MCwgMC40NTAsIDAuOTQwKSAwLjVzOworCisgICAgICAgIHBvc2l0aW9uOmFic29sdXRlOworICAgICAgICB0b3A6MDsKKyAgICAgICAgbGVmdDowOworICAgICAgICByaWdodDowOworICAgICAgICBib3R0b206MDsKKyAgICAgIH0KKworICAgICAgLmFuaW1hdGUtc3dpdGNoLm5nLWxlYXZlLm5nLWxlYXZlLWFjdGl2ZSwKKyAgICAgIC5hbmltYXRlLXN3aXRjaC5uZy1lbnRlciB7CisgICAgICAgIHRvcDotNTBweDsKKyAgICAgIH0KKyAgICAgIC5hbmltYXRlLXN3aXRjaC5uZy1sZWF2ZSwKKyAgICAgIC5hbmltYXRlLXN3aXRjaC5uZy1lbn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bWVudHNbaV0gPSBzZWxlY3RlZDsKKyAgICAgICAgICAkYW5pbWF0ZS5sZWF2ZShzZWxlY3RlZCwgZnVuY3Rpb24oKSB7CisgICAgICAgICAgICBwcmV2aW91c0VsZW1lbnRzLnNwbGljZShpLCAxKTsKKyAgICAgICAgICB9KTsKKyAgICAgICAgfQorCisgICAgICAgIHNlbGVjdGVkRWxlbWVudHMubGVuZ3RoID0gMDsKKyAgICAgICAgc2VsZWN0ZWRTY29wZXMubGVuZ3RoID0gMDsKKworICAgICAgICBpZiAoKHNlbGVjdGVkVHJhbnNjbHVkZXMgPSBuZ1N3aXRjaENvbnRyb2xsZXIuY2FzZXNbJyEnICsgdmFsdWVdIHx8IG5nU3dpdGNoQ29udHJvbGxlci5jYXNlc1snPyddKSkgeworICAgICAgICAgIHNjb3BlLiRldmFsKGF0dHIuY2hhbmdlKTsKKyAgICAgICAgICBmb3JFYWNoKHNlbGVjdGVkVHJhbnNjbHVkZXMsIGZ1bmN0aW9uKHNlbGVjdGVkVHJhbnNjbHVkZSkgeworICAgICAgICAgICAgdmFyIHNlbGVjdGVkU2NvcGUgPSBzY29wZS4kbmV3KCk7CisgICAgICAgICAgICBzZWxlY3RlZFNjb3Blcy5wdXNoKHNlbGVjdGVkU2NvcGUpOworICAgICAgICAgICAgc2VsZWN0ZWRUcmFuc2NsdWRlLnRyYW5zY2x1ZGUoc2VsZWN0ZWRTY29wZSwgZnVuY3Rpb24oY2FzZUVsZW1lbnQpIHsKKyAgICAgICAgICAgICAgdmFyIGFuY2hvciA9IHNlbGVjdGVkVHJhbnNjbHVkZS5lbGVtZW50OworCisgICAgICAgICAgICAgIHNlbGVjdGVkRWxlbWVudHMucHVzaChjYXNlRWxlbWVudCk7CisgICAgICAgICAgICAgICRhbmltYXRlLmVudGVyKGNhc2VFbGVtZW50LCBhbmNob3IucGFyZW50KCksIGFuY2hvcik7CisgICAgICAgICAgICB9KTsKKyAgICAgICAgICB9KTsKKyAgICAgICAgfQorICAgICAgfSk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gaW5zZXJ0aW9uIHBvaW50IGZvciB0aGUgdHJhbnNjbHVkZWQgRE9NIG9mIHRoZSBuZWFyZXN0IHBhcmVudCBkaXJlY3RpdmUgdGhhdCB1c2VzIHRyYW5zY2x1c2lvbi4KKyAqCisgKiBBbnkgZXhpc3RpbmcgY29udGVudCBvZiB0aGUgZWxlbWVudCB0aGF0IHRoaXMgZGlyZWN0aXZlIGlzIHBsYWNlZCBvbiB3aWxsIGJlIHJlbW92ZWQgYmVmb3JlIHRoZSB0cmFuc2NsdWRlZCBjb250ZW50IGlzIGluc2VydGVkLgorICoKKyAqIEBlbGVtZW50IEFOWQorICoKKyAqIEBleGFtcGxlCisgICA8ZXhhbXBsZSBtb2R1bGU9InRyYW5zY2x1ZGVFeGFtcGxlIj4KKyAgICAgPGZpbGUgbmFtZT0iaW5kZXguaHRtbCI+CisgICAgICAgPHNjcmlwdD4KKyAgICAgICAgIGFuZ3VsYXIubW9kdWxlKCd0cmFuc2NsdWRlRXhhbXBsZScsIFtdKQorICAgICAgICAgIC5kaXJlY3RpdmUoJ3BhbmUnLCBmdW5jdGlvbigpeworICAgICAgICAgICAgIHJldHVybiB7CisgICAgICAgICAgICAgICByZXN0cmljdDogJ0UnLAorICAgICAgICAgICAgICAgdHJhbnNjbHVkZTogdHJ1ZSwKKyAgICAgICAgICAgICAgIHNjb3BlOiB7IHRpdGxlOidAJyB9LAorICAgICAgICAgICAgICAgdGVtcGxhdGU6ICc8ZGl2IHN0eWxlPSJib3JkZXI6IDFweCBzb2xpZCBibGFjazsiPicgKworICAgICAgICAgICAgICAgICAgICAgICAgICAgJzxkaXYgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6IGdyYXkiPnt7dGl0bGV9fTwvZGl2PicgKworICAgICAgICAgICAgICAgICAgICAgICAgICAgJzxkaXYgbmctdHJhbnNjbHVkZT48L2Rpdj4nICsKKyAgICAgICAgICAgICAgICAgICAgICAgICAnPC9kaXY+JworICAgICAgICAgICAgIH07CisgICAgICAgICB9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9InRwbC1jb250ZW50IiBuZy1pbmNsdWRlIHNyYz0iY3VycmVudFRwbCI+PC9kaXY+CisgICAgPC9maWxlPgorICAgIDxmaWxlIG5hbWU9InByb3RyYWN0b3IuanMiIHR5cGU9InByb3RyYWN0b3IiPgorICAgICAgaXQoJ3Nob3VsZCBsb2FkIHRlbXBsYXRlIGRlZmluZWQgaW5zaWRlIHNjcmlwdCB0YWcnLCBmdW5jdGlvbigpIHsKKyAgICAgICAgZWxlbWVudChieS5jc3MoJyN0cGwtbGluaycpKS5jbGljaygpOworICAgICAgICBleHBlY3QoZWxlbWVudChieS5jc3MoJyN0cGwtY29udGVudCcpKS5nZXRUZXh0KCkpLnRvTWF0Y2goL0NvbnRlbnQgb2YgdGhlIHRlbXBsYXRlLyk7CisgICAgICB9KTsKKyAgICA8L2ZpbGU+CisgIDwvZXhhbXBsZT4KKyAqLwordmFyIHNjcmlwdERpcmVjdGl2ZSA9IFsnJHRlbXBsYXRlQ2FjaGUnLCBmdW5jdGlvbigkdGVtcGxhdGVDYWNoZSkgeworICByZXR1cm4geworICAgIHJlc3RyaWN0OiAnRScsCisgICAgdGVybWluYWw6IHRydWUsCisgICAgY29tcGlsZTogZnVuY3Rpb24oZWxlbWVudCwgYXR0cikgeworICAgICAgaWYgKGF0dHIudHlwZSA9PSAndGV4dC9uZy10ZW1wbGF0ZScpIHsKKyAgICAgICAgdmFyIHRlbXBsYXRlVXJsID0gYXR0ci5pZCwKKyAgICAgICAgICAgIC8vIElFIGlzIG5vdCBjb25zaXN0ZW50LCBpbiBzY3JpcHRzIHdlIGhhdmUgdG8gcmVhZCAudGV4dCBidXQgaW4gb3RoZXIgbm9kZXMgd2UgaGF2ZSB0byByZWFkIC50ZXh0Q29udGVudAorICAgICAgICAgICAgdGV4dCA9IGVsZW1lbnRbMF0udGV4dDsKKworICAgICAgICAkdGVtcGxhdGVDYWNoZS5wdXQodGVtcGxhdGVVcmwsIHRleHQpOworICAgICAgfQorICAgIH0KKyAgfTsKK31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c2NyaXB0PgorICAgICAgICBhbmd1bGFyLm1vZHVsZSgnc2VsZWN0RXhhbXBsZScsIFtdKQorICAgICAgICAgIC5jb250cm9sbGVyKCdFeGFtcGxlQ29udHJvbGxlcicsIFsnJHNjb3BlJywgZnVuY3Rpb24oJHNjb3BlKSB7CisgICAgICAgICAgICAkc2NvcGUuY29sb3JzID0gWworICAgICAgICAgICAgICB7bmFtZTonYmxhY2snLCBzaGFkZTonZGFyayd9LAorICAgICAgICAgICAgICB7bmFtZTond2hpdGUnLCBzaGFkZTonbGlnaHQnfSwKKyAgICAgICAgICAgICAge25hbWU6J3JlZCcsIHNoYWRlOidkYXJrJ30sCisgICAgICAgICAgICAgIHtuYW1lOidibHVlJywgc2hhZGU6J2RhcmsnfSwKKyAgICAgICAgICAgICAge25hbWU6J3llbGxvdycsIHNoYWRlOidsaWdodCd9CisgICAgICAgICAgICBdOworICAgICAgICAgICAgJHNjb3BlLm15Q29sb3IgPSAkc2NvcGUuY29sb3JzWzJdOyAvLyByZWQKKyAgICAgICAgICB9XSk7CisgICAgICAgIDwvc2NyaXB0PgorICAgICAgICA8ZGl2IG5nLWNvbnRyb2xsZXI9IkV4YW1wbGVDb250cm9sbGVyIj4KKyAgICAgICAgICA8dWw+CisgICAgICAgICAgICA8bGkgbmctcmVwZWF0PSJjb2xvciBpbiBjb2xvcnMiPgorICAgICAgICAgICAgICBOYW1lOiA8aW5wdXQgbmctbW9kZWw9ImNvbG9yLm5hbWUiPgorICAgICAgICAgICAgICBbPGEgaHJlZiBuZy1jbGljaz0iY29sb3JzLnNwbGljZSgkaW5kZXgsIDEpIj5YPC9hPl0KKyAgICAgICAgICAgIDwvbGk+CisgICAgICAgICAgICA8bGk+CisgICAgICAgICAgICAgIFs8YSBocmVmIG5nLWNsaWNrPSJjb2xvcnMucHVzaCh7fSkiPmFkZDwvYT5dCisgICAgICAgICAgICA8L2xpPgorICAgICAgICAgIDwvdWw+CisgICAgICAgICAgPGhyLz4KKyAgICAgICAgICBDb2xvciAobnVsbCBub3QgYWxsb3dlZCk6CisgICAgICAgICAgPHNlbGVjdCBuZy1tb2RlbD0ibXlDb2xvciIgbmctb3B0aW9ucz0iY29sb3IubmFtZSBmb3IgY29sb3IgaW4gY29sb3JzIj48L3NlbGVjdD48YnI+CisKKyAgICAgICAgICBDb2xvciAobnVsbCBhbGxvd2VkKToKKyAgICAgICAgICA8c3BhbiAgY2xhc3M9Im51bGxhYmxlIj4KKyAgICAgICAgICAgIDxzZWxlY3QgbmctbW9kZWw9Im15Q29sb3IiIG5nLW9wdGlvbnM9ImNvbG9yLm5hbWUgZm9yIGNvbG9yIGluIGNvbG9ycyI+CisgICAgICAgICAgICAgIDxvcHRpb24gdmFsdWU9IiI+LS0gY2hvb3NlIGNvbG9yIC0tPC9vcHRpb24+CisgICAgICAgICAgICA8L3NlbGVjdD4KKyAgICAgICAgICA8L3NwYW4+PGJyLz4KKworICAgICAgICAgIENvbG9yIGdyb3VwZWQgYnkgc2hhZGU6CisgICAgICAgICAgPHNlbGVjdCBuZy1tb2RlbD0ibXlDb2xvciIgbmctb3B0aW9ucz0iY29sb3IubmFtZSBncm91cCBieSBjb2xvci5zaGFkZSBmb3IgY29sb3IgaW4gY29sb3JzIj4KKyAgICAgICAgICA8L3NlbGVjdD48YnIvPgorCisKKyAgICAgICAgICBTZWxlY3QgPGEgaHJlZiBuZy1jbGljaz0ibXlDb2xvciA9IHsgbmFtZTonbm90IGluIGxpc3QnLCBzaGFkZTogJ290aGVyJyB9Ij5ib2d1czwvYT4uPGJyPgorICAgICAgICAgIDxoci8+CisgICAgICAgICAgQ3VycmVudGx5IHNlbGVjdGVkOiB7eyB7c2VsZWN0ZWRfY29sb3I6bXlDb2xvcn0gIH19CisgICAgICAgICAgPGRpdiBzdHlsZT0iYm9yZGVyOnNvbGlkIDFweCBibGFjazsgaGVpZ2h0OjIwcHgiCisgICAgICAgICAgICAgICBuZy1zdHlsZT0ieydiYWNrZ3JvdW5kLWNvbG9yJzpteUNvbG9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KSB7CisgICAgICB2YXIgc2VsZiA9IHRoaXMsCisgICAgICAgICAgb3B0aW9uc01hcCA9IHt9LAorICAgICAgICAgIG5nTW9kZWxDdHJsID0gbnVsbE1vZGVsQ3RybCwKKyAgICAgICAgICBudWxsT3B0aW9uLAorICAgICAgICAgIHVua25vd25PcHRpb247CisKKworICAgICAgc2VsZi5kYXRhYm91bmQgPSAkYXR0cnMubmdNb2RlbDsKKworCisgICAgICBzZWxmLmluaXQgPSBmdW5jdGlvbihuZ01vZGVsQ3RybF8sIG51bGxPcHRpb25fLCB1bmtub3duT3B0aW9uXykgeworICAgICAgICBuZ01vZGVsQ3RybCA9IG5nTW9kZWxDdHJsXzsKKyAgICAgICAgbnVsbE9wdGlvbiA9IG51bGxPcHRpb25fOworICAgICAgICB1bmtub3duT3B0aW9uID0gdW5rbm93bk9wdGlvbl87CisgICAgICB9OworCisKKyAgICAgIHNlbGYuYWRkT3B0aW9uID0gZnVuY3Rpb24odmFsdWUpIHsKKyAgICAgICAgYXNzZXJ0Tm90SGFzT3duUHJvcGVydHkodmFsdWUsICcib3B0aW9uIHZhbHVlIicpOworICAgICAgICBvcHRpb25zTWFwW3ZhbHVlXSA9IHRydWU7CisKKyAgICAgICAgaWYgKG5nTW9kZWxDdHJsLiR2aWV3VmFsdWUgPT0gdmFsdWUpIHsKKyAgICAgICAgICAkZWxlbWVudC52YWwodmFsdWUpOworICAgICAgICAgIGlmICh1bmtub3duT3B0aW9uLnBhcmVudCgpKSB1bmtub3duT3B0aW9uLnJlbW92ZSgpOworICAgICAgICB9CisgICAgICB9OworCisKKyAgICAgIHNlbGYucmVtb3ZlT3B0aW9uID0gZnVuY3Rpb24odmFsdWUpIHsKKyAgICAgICAgaWYgKHRoaXMuaGFzT3B0aW9uKHZhbHVlKSkgeworICAgICAgICAgIGRlbGV0ZSBvcHRpb25zTWFwW3ZhbHVlXTsKKyAgICAgICAgICBpZiAobmdNb2RlbEN0cmwuJHZpZXdWYWx1ZSA9PSB2YWx1ZSkgeworICAgICAgICAgICAgdGhpcy5yZW5kZXJVbmtub3duT3B0aW9uKHZhbHVlKTsKKyAgICAgICAgICB9CisgICAgICAgIH0KKyAgICAgIH07CisKKworICAgICAgc2VsZi5yZW5kZXJVbmtub3duT3B0aW9uID0gZnVuY3Rpb24odmFsKSB7CisgICAgICAgIHZhciB1bmtub3duVmFsID0gJz8gJyArIGhhc2hLZXkodmFsKSArICcgPyc7CisgICAgICAgIHVua25vd25PcHRpb24udmFsKHVua25vd25WYWwpOworICAgICAgICAkZWxlbWVudC5wcmVwZW5kKHVua25vd25PcHRpb24pOworICAgICAgICAkZWxlbWVudC52YWwodW5rbm93blZhbCk7CisgICAgICAgIHVua25vd25PcHRpb24ucHJvcCgnc2VsZWN0ZWQnLCB0cnVlKTsgLy8gbmVlZGVkIGZvciBJRQorICAgICAgfTsKKworCisgICAgICBzZWxmLmhhc09wdGlvbiA9IGZ1bmN0aW9uKHZhbHVlKSB7CisgICAgICAgIHJldHVybiBvcHRpb25zTWFwLmhhc093blByb3BlcnR5KHZhbHVlKTsKKyAgICAgIH07CisKKyAgICAgICRzY29wZS4kb24oJyRkZXN0cm95JywgZnVuY3Rpb24oKSB7CisgICAgICAgIC8vIGRpc2FibGUgdW5rbm93biBvcHRpb24gc28gdGhhdCB3ZSBkb24ndCBkbyB3b3JrIHdoZW4gdGhlIHdob2xlIHNlbGVjdCBpcyBiZWluZyBkZXN0cm95ZWQKKyAgICAgICAgc2VsZi5yZW5kZXJVbmtub3duT3B0aW9uID0gbm9vcDsKKyAgICAgIH0pOworICAgIH1dLAorCisgICAgbGluazogZnVuY3Rpb24oc2NvcGUsIGVsZW1lbnQsIGF0dHIsIGN0cmxzKSB7CisgICAgICAvLyBpZiBuZ01vZGVsIGlzIG5vdCBkZWZpbmVkLCB3ZSBkb24ndCBuZWVkIHRvIGRvIGFueXRoaW5nCisgICAgICBpZiAoIWN0cmxzWzFdKSByZXR1cm47CisKKyAgICAgIHZhciBzZWxlY3RDdHJsID0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isgICAgICBzZWxlY3RDdHJsLmluaXQobmdNb2RlbEN0cmwsIG51bGxPcHRpb24sIHVua25vd25PcHRpb24pOworCisgICAgICAvLyByZXF1aXJlZCB2YWxpZGF0b3IKKyAgICAgIGlmIChtdWx0aXBsZSkgeworICAgICAgICBuZ01vZGVsQ3RybC4kaXNFbXB0eSA9IGZ1bmN0aW9uKHZhbHVlKSB7CisgICAgICAgICAgcmV0dXJuICF2YWx1ZSB8fCB2YWx1ZS5sZW5ndGggPT09IDA7CisgICAgICAgIH07CisgICAgICB9CisKKyAgICAgIGlmIChvcHRpb25zRXhwKSBzZXR1cEFzT3B0aW9ucyhzY29wZSwgZWxlbWVudCwgbmdNb2RlbEN0cmwpOworICAgICAgZWxzZSBpZiAobXVsdGlwbGUpIHNldHVwQXNNdWx0aXBsZShzY29wZSwgZWxlbWVudCwgbmdNb2RlbEN0cmwpOworICAgICAgZWxzZSBzZXR1cEFzU2luZ2xlKHNjb3BlLCBlbGVtZW50LCBuZ01vZGVsQ3RybCwgc2VsZWN0Q3RybCk7CisKKworICAgICAgLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLworCisKKworICAgICAgZnVuY3Rpb24gc2V0dXBBc1NpbmdsZShzY29wZSwgc2VsZWN0RWxlbWVudCwgbmdNb2RlbEN0cmwsIHNlbGVjdEN0cmwpIHsKKyAgICAgICAgbmdNb2RlbEN0cmwuJHJlbmRlciA9IGZ1bmN0aW9uKCkgeworICAgICAgICAgIHZhciB2aWV3VmFsdWUgPSBuZ01vZGVsQ3RybC4kdmlld1ZhbHVlOworCisgICAgICAgICAgaWYgKHNlbGVjdEN0cmwuaGFzT3B0aW9uKHZpZXdWYWx1ZSkpIHsKKyAgICAgICAgICAgIGlmICh1bmtub3duT3B0aW9uLnBhcmVudCgpKSB1bmtub3duT3B0aW9uLnJlbW92ZSgpOworICAgICAgICAgICAgc2VsZWN0RWxlbWVudC52YWwodmlld1ZhbHVlKTsKKyAgICAgICAgICAgIGlmICh2aWV3VmFsdWUgPT09ICcnKSBlbXB0eU9wdGlvbi5wcm9wKCdzZWxlY3RlZCcsIHRydWUpOyAvLyB0byBtYWtlIElFOSBoYXBweQorICAgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICBpZiAoaXNVbmRlZmluZWQodmlld1ZhbHVlKSAmJiBlbXB0eU9wdGlvbikgeworICAgICAgICAgICAgICBzZWxlY3RFbGVtZW50LnZhbCgnJyk7CisgICAgICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgICBzZWxlY3RDdHJsLnJlbmRlclVua25vd25PcHRpb24odmlld1ZhbHVlKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICB9CisgICAgICAgIH07CisKKyAgICAgICAgc2VsZWN0RWxlbWVudC5vbignY2hhbmdlJywgZnVuY3Rpb24oKSB7CisgICAgICAgICAgc2NvcGUuJGFwcGx5KGZ1bmN0aW9uKCkgeworICAgICAgICAgICAgaWYgKHVua25vd25PcHRpb24ucGFyZW50KCkpIHVua25vd25PcHRpb24ucmVtb3ZlKCk7CisgICAgICAgICAgICBuZ01vZGVsQ3RybC4kc2V0Vmlld1ZhbHVlKHNlbGVjdEVsZW1lbnQudmFsKCkpOworICAgICAgICAgIH0pOworICAgICAgICB9KTsKKyAgICAgIH0KKworICAgICAgZnVuY3Rpb24gc2V0dXBBc011bHRpcGxlKHNjb3BlLCBzZWxlY3RFbGVtZW50LCBjdHJsKSB7CisgICAgICAgIHZhciBsYXN0VmlldzsKKyAgICAgICAgY3RybC4kcmVuZGVyID0gZnVuY3Rpb24oKSB7CisgICAgICAgICAgdmFyIGl0ZW1zID0gbmV3IEhhc2hNYXAoY3RybC4kdmlld1ZhbHVlKTsKKyAgICAgICAgICBmb3JFYWNoKHNlbGVjdEVsZW1lbnQuZmluZCgnb3B0aW9uJyksIGZ1bmN0aW9uKG9wdGlvbikgeworICAgICAgICAgICAgb3B0aW9uLnNlbGVjdGVkID0gaXNEZWZpbmVkKGl0ZW1zLmdldChvcHRpb24udmFsdWUpKTsKKyAgICAgICAgICB9KTsKKyAgICAgICAgfTsKKworICAgICAgICAvLyB3ZSBoYXZlIHRvIGRvIGl0IG9uIGVhY2ggd2F0Y2ggc2luY2UgbmdNb2RlbCB3YXRjaGVzIHJlZmVyZW5jZSwgYnV0CisgICAgICAgIC8vIHdlIG5lZWQgdG8gd29yayBvZiBhbiBhcnJheSwgc28gd2UgbmVlZCB0byBzZWUgaWYgYW55dGhpbmcgd2FzIGluc2VydGVkL3JlbW92ZWQKKyAgICAgICAgc2NvcGUuJHdhdGNoKGZ1bmN0aW9uIHNlbGVjdE11bHRpcGxlV2F0Y2goKSB7CisgICAgICAgICAgaWYgKCFlcXVhbHMobGFzdFZpZXcsIGN0cmwuJHZpZXdWYWx1ZSkpIHsKKyAgICAgICAgICAgIGxhc3RWaWV3ID0gc2hhbGxvd0NvcHkoY3RybC4kdmlld1ZhbHVlKTsKKyAgICAgICAgICAgIGN0cmwuJHJlbmRlcigpOworICAgICAgICAgIH0KKyAgICAgICAgfSk7CisKKyAgICAgICAgc2VsZWN0RWxlbWVudC5vbignY2hhbmdlJywgZnVuY3Rpb24oKSB7CisgICAgICAgICAgc2NvcGUuJGFwcGx5KGZ1bmN0aW9uKCkgeworICAgICAgICAgICAgdmFyIGFycmF5ID0gW107CisgICAgICAgICAgICBmb3JFYWNoKHNlbGVjdEVsZW1lbnQuZmluZCgnb3B0aW9uJyksIGZ1bmN0aW9uKG9wdGlvbikgeworICAgICAgICAgICAgICBpZiAob3B0aW9uLnNlbGVjdGVkKSB7CisgICAgICAgICAgICAgICAgYXJyYXkucHVzaChvcHRpb24udmFsdWUpOworICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9KTsKKyAgICAgICAgICAgIGN0cmwuJHNldFZpZXdWYWx1ZShhcnJheSk7CisgICAgICAgICAgfSk7CisgICAgICAgIH0pOworICAgICAgfQorCisgICAgICBmdW5jdGlvbiBzZXR1cEFzT3B0aW9ucyhzY29wZSwgc2VsZWN0RWxlbWVudC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yIGNvbnRlbnRzLCB3ZSdsbCBhZGQgd2hhdCdzIG5lZWRlZCBiYXNlZCBvbiB0aGUgbW9kZWwKKyAgICAgICAgc2VsZWN0RWxlbWVudC5lbXB0eSgpOworCisgICAgICAgIHNlbGVjdEVsZW1lbnQub24oJ2NoYW5nZScsIGZ1bmN0aW9uKCkgeworICAgICAgICAgIHNjb3BlLiRhcHBseShmdW5jdGlvbigpIHsKKyAgICAgICAgICAgIHZhciBvcHRpb25Hcm91cCwKKyAgICAgICAgICAgICAgICBjb2xsZWN0aW9uID0gdmFsdWVzRm4oc2NvcGUpIHx8IFtdLAorICAgICAgICAgICAgICAgIGxvY2FscyA9IHt9LAorICAgICAgICAgICAgICAgIGtleSwgdmFsdWUsIG9wdGlvbkVsZW1lbnQsIGluZGV4LCBncm91cEluZGV4LCBsZW5ndGgsIGdyb3VwTGVuZ3RoLCB0cmFja0luZGV4OworCisgICAgICAgICAgICBpZiAobXVsdGlwbGUpIHsKKyAgICAgICAgICAgICAgdmFsdWUgPSBbXTsKKyAgICAgICAgICAgICAgZm9yIChncm91cEluZGV4ID0gMCwgZ3JvdXBMZW5ndGggPSBvcHRpb25Hcm91cHNDYWNoZS5sZW5ndGg7CisgICAgICAgICAgICAgICAgICAgZ3JvdXBJbmRleCA8IGdyb3VwTGVuZ3RoOworICAgICAgICAgICAgICAgICAgIGdyb3VwSW5kZXgrKykgeworICAgICAgICAgICAgICAgIC8vIGxpc3Qgb2Ygb3B0aW9ucyBmb3IgdGhhdCBncm91cC4gKGZpcnN0IGl0ZW0gaGFzIHRoZSBwYXJlbnQpCisgICAgICAgICAgICAgICAgb3B0aW9uR3JvdXAgPSBvcHRpb25Hcm91cHNDYWNoZVtncm91cEluZGV4XTsKKworICAgICAgICAgICAgICAgIGZvcihpbmRleCA9IDEsIGxlbmd0aCA9IG9wdGlvbkdyb3VwLmxlbmd0aDsgaW5kZXggPCBsZW5ndGg7IGluZGV4KyspIHsKKyAgICAgICAgICAgICAgICAgIGlmICgob3B0aW9uRWxlbWVudCA9IG9wdGlvbkdyb3VwW2luZGV4XS5lbGVtZW50KVswXS5zZWxlY3RlZCkgeworICAgICAgICAgICAgICAgICAgICBrZXkgPSBvcHRpb25FbGVtZW50LnZhbCgpOworICAgICAgICAgICAgICAgICAgICBpZiAoa2V5TmFtZSkgbG9jYWxzW2tleU5hbWVdID0ga2V5OworICAgICAgICAgICAgICAgICAgICBpZiAodHJhY2tGbikgeworICAgICAgICAgICAgICAgICAgICAgIGZvciAodHJhY2tJbmRleCA9IDA7IHRyYWNrSW5kZXggPCBjb2xsZWN0aW9uLmxlbmd0aDsgdHJhY2tJbmRleCsrKSB7CisgICAgICAgICAgICAgICAgICAgICAgICBsb2NhbHNbdmFsdWVOYW1lXSA9IGNvbGxlY3Rpb25bdHJhY2tJbmRleF07CisgICAgICAgICAgICAgICAgICAgICAgICBpZiAodHJhY2tGbihzY29wZSwgbG9jYWxzKSA9PSBrZXkpIGJyZWFrOworICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgICAgICAgICAgICBsb2NhbHNbdmFsdWVOYW1lXSA9IGNvbGxlY3Rpb25ba2V5XTsKKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICB2YWx1ZS5wdXNoKHZhbHVlRm4oc2NvcGUsIGxvY2FscykpOworICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgICAga2V5ID0gc2VsZWN0RWxlbWVudC52YWwoKTsKKyAgICAgICAgICAgICAgaWYgKGtleSA9PSAnPycpIHsKKyAgICAgICAgICAgICAgICB2YWx1ZSA9IHVuZGVmaW5lZDsKKyAgICAgICAgICAgICAgfSBlbHNlIGlmIChrZXkgPT09ICcnKXsKKyAgICAgICAgICAgICAgICB2YWx1ZSA9IG51bGw7CisgICAgICAgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICAgICAgaWYgKHRyYWNrRm4pIHsKKyAgICAgICAgICAgICAgICAgIGZvciAodHJhY2tJbmRleCA9IDA7IHRyYWNrSW5kZXggPCBjb2xsZWN0aW9uLmxlbmd0aDsgdHJhY2tJbmRleCsrKSB7CisgICAgICAgICAgICAgICAgICAgIGxvY2Fsc1t2YWx1ZU5hbWVdID0gY29sbGVjdGlvblt0cmFja0luZGV4XTsKKyAgICAgICAgICAgICAgICAgICAgaWYgKHRyYWNrRm4oc2NvcGUsIGxvY2FscykgPT0ga2V5KSB7CisgICAgICAgICAgICAgICAgICAgICAgdmFsdWUgPSB2YWx1ZUZuKHNjb3BlLCBsb2NhbHMpOworICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgICAgICAgIGxvY2Fsc1t2YWx1ZU5hbWVdID0gY29sbGVjdGlvbltrZXldOworICAgICAgICAgICAgICAgICAgaWYgKGtleU5hbWUpIGxvY2Fsc1trZXlOYW1lXSA9IGtleTsKKyAgICAgICAgICAgICAgICAgIHZhbHVlID0gdmFsdWVGbihzY29wZSwgbG9jYWxzKTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGN0cmwuJHNldFZpZXdWYWx1ZSh2YWx1ZSk7CisgICAgICAgICAgICByZW5kZXIoKTsKKyAgICAgICAgICB9KTsKKyAgICAgICAgfSk7CisKKyAgICAgICAgY3RybC4kcmVuZGVyID0gcmVuZGVyOworCisgICAgICAgIHNjb3BlLiR3YXRjaENvbGxlY3Rpb24odmFsdWVzRm4sIHJlbmRlcik7CisgICAgICAgIHNjb3BlLiR3YXRjaENvbGxlY3Rpb24oZnVuY3Rpb24gKCkgeworICAgICAgICAgIHZhciBsb2NhbHMgPSB7fSwKKyAgICAgICAgICAgICAgdmFsdWVzID0gdmFsdWVzRm4oc2NvcGUpOworICAgICAgICAgIGlmICh2YWx1ZXMpIHsKKyAgICAgICAgICAgIHZhciB0b0Rpc3BsYXkgPSBuZXcgQXJyYXkodmFsdWVzLmxlbmd0aCk7CisgICAgICAgICAgICBmb3IgKHZhciBpID0gMCwgaWkgPSB2YWx1ZXMubGVuZ3RoOyBpIDwgaWk7IGkrKykgeworICAgICAgICAgICAgICBsb2NhbHNbdmFsdWVOYW1lXSA9IHZhbHVlc1tpXTsKKyAgICAgICAgICAgICAgdG9EaXNwbGF5W2ldID0gZGlzcGxheUZuKHNjb3BlLCBsb2NhbHMpOworICAgICAgICAgICAgfQorICAgICAgICAgICAgcmV0dXJuIHRvRGlzcGxheTsKKyAgICAgICAgICB9CisgICAgICAgIH0sIHJlbmRlcik7CisKKyAgICAgICAgaWYgKCBtdWx0aXBsZSApIHsKKyAgICAgICAgICBzY29wZS4kd2F0Y2hDb2xsZWN0aW9uKGZ1bmN0aW9uKCkgeyByZXR1cm4gY3RybC4kbW9kZWxWYWx1ZTsgfSwgcmVuZGVyKTsKKyAgICAgICAgfQorCisgICAgICAgIGZ1bmN0aW9uIGdldFNlbGVjdGVkU2V0KCkgeworICAgICAgICAgIHZhciBzZWxlY3RlZFNldCA9IGZhbHNlOworICAgICAgICAgIGlmIChtdWx0aXBsZSkgeworICAgICAgICAgICAgdmFyIG1vZGVsVmFsdWUgPSBjdHJsLiRtb2RlbFZhbHVlOworICAgICAgICAgICAgaWYgKHRyYWNrRm4gJiYgaXNBcnJheShtb2RlbFZhbHVlKSkgeworICAgICAgICAgICAgICBzZWxlY3RlZFNldCA9IG5ldyBIYXNoTWFwKFtdKTsKKyAgICAgICAgICAgICAgdmFyIGxvY2FscyA9IHt9OworICAgICAgICAgICAgICBmb3IgKHZhciB0cmFja0luZGV4ID0gMDsgdHJhY2tJbmRleCA8IG1vZGVsVmFsdWUubGVuZ3RoOyB0cmFja0luZGV4KyspIHsKKyAgICAgICAgICAgICAgICBsb2NhbHNbdmFsdWVOYW1lXSA9IG1vZGVsVmFsdWVbdHJhY2tJbmRleF07CisgICAgICAgICAgICAgICAgc2VsZWN0ZWRTZXQucHV0KHRyYWNrRm4oc2NvcGUsIGxvY2FscyksIG1vZGVsVmFsdWVbdHJhY2tJbmRleF0pOworICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgICBzZWxlY3RlZFNldCA9IG5ldyBIYXNoTWFwKG1vZGVsVmFsdWUpOworICAgICAgICAgICAgfQorICAgICAgICAgIH0KKyAgICAgICAgICByZXR1cm4gc2VsZWN0ZWRTZXQ7CisgICAgICAgIH0KKworCisgICAgICAgIGZ1bmN0aW9uIHJlbmRlcigpIHsKKyAgICAgICAgICAgICAgLy8gVGVtcG9yYXJ5IGxvY2F0aW9uIGZvciB0aGUgb3B0aW9uIGdyb3VwcyBiZWZvcmUgd2UgcmVuZGVyIHRoZW0KKyAgICAgICAgICB2YXIgb3B0aW9uR3JvdXBzID0geycnOltdfSwKKyAgICAgICAgICAgICAgb3B0aW9uR3JvdXBOYW1lcyA9IFsnJ10sCisgICAgICAgICAgICAgIG9wdGlvbkdyb3VwTmFtZSwKKyAgICAgICAgICAgICAgb3B0aW9uR3JvdXAsCisgICAgICAgICAgICAgIG9wdGlvbiwKKyAgICAgICAgICAgICAgZXhpc3RpbmdQYXJlbnQsIGV4aXN0aW5nT3B0aW9ucywgZXhpc3RpbmdPcHRpb24sCisgICAgICAgICAgICAgIG1vZGVsVmFsdWUgPSBjdHJsLiRtb2RlbFZhbHVlLAorICAgICAgICAgICAgICB2YWx1ZXMgPSB2YWx1ZXNGbihzY29wZSkgfHwgW10sCisgICAgICAgICAgICAgIGtleXMgPSBrZXlOYW1lID8gc29ydGVkS2V5cyh2YWx1ZXMpIDogdmFsdWVzLAorICAgICAgICAgICAgICBrZXksCisgICAgICAgICAgICAgIGdyb3VwTGVuZ3RoLCBsZW5ndGgsCisgICAgICAgICAgICAgIGdyb3VwSW5kZXgsIGluZGV4LAorICAgICAgICAgICAgICBsb2NhbHMgPSB7fSwKKyAgICAgICAgICAgICAgc2VsZWN0ZWQsCisgICAgICAgICAgICAgIHNlbGVjdGVkU2V0ID0gZ2V0U2VsZWN0ZWRTZXQoKSwKKyAgICAgICAgICAgICAgbGFzdEVsZW1lbnQsCisgICAgICAgICAgICAgIGVsZW1lbnQsCisgICAgICAgICAgICAgIGxhYmVsOworCisKKyAgICAgICAgICAvLyBXZSBub3cgYnVpbGQgdXAgdGhlIGxpc3Qgb2Ygb3B0aW9ucyB3ZSBuZWVkICh3ZSBtZXJnZSBsYXRlcikKKyAgICAgICAgICBmb3IgKGluZGV4ID0gMDsgbGVuZ3RoID0ga2V5cy5sZW5ndGgsIGluZGV4IDwgbGVuZ3RoOyBpbmRleCsrKSB7CisKKyAgICAgICAgICAgIGtleSA9IGluZGV4OworICAgICAgICAgICAgaWYgKGtleU5hbWUpIHsKKyAgICAgICAgICAgICAga2V5ID0ga2V5c1tpbmRleF07CisgICAgICAgICAgICAgIGlmICgga2V5LmNoYXJBdCgwKSA9PT0gJyQnICkgY29udGludWU7CisgICAgICAgICAgICAgIGxvY2Fsc1trZXlOYW1lXSA9IGtleTsKKyAgICAgICAgICAgIH0KKworICAgICAgICAgICAgbG9jYWxzW3ZhbHVlTmFtZV0gPSB2YWx1ZXNba2V5XTsKKworICAgICAgICAgICAgb3B0aW9uR3JvdXBOYW1lID0gZ3JvdXBCeUZuKHNjb3BlLCBsb2NhbHMpIHx8ICcnOworICAgICAgICAgICAgaWYgKCEob3B0aW9uR3JvdXAgPSBvcHRpb25Hcm91cHNbb3B0aW9uR3JvdXBOYW1lXSkpIHsKKyAgICAgICAgICAgICAgb3B0aW9uR3JvdXAgPSBvcHRpb25Hcm91cHNbb3B0aW9uR3JvdXBOYW1lXSA9IFtdOworICAgICAgICAgICAgICBvcHRpb25Hcm91cE5hbWVzLnB1c2gob3B0aW9uR3JvdXBOYW1lKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGlmIChtdWx0aXBsZSkgeworICAgICAgICAgICAgICBzZWxlY3RlZCA9IGlzRGVmaW5lZCgKKyAgICAgICAgICAgICAgICBzZWxlY3RlZFNldC5yZW1vdmUodHJhY2tGbiA/IHRyYWNrRm4oc2NvcGUsIGxvY2FscykgOiB2YWx1ZUZuKHNjb3BlLCBsb2NhbHMpKQorICAgICAgICAgICAgICApOworICAgICAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgICAgaWYgKHRyYWNrRm4pIHsKKyAgICAgICAgICAgICAgICB2YXIgbW9kZWxDYXN0ID0ge307CisgICAgICAgICAgICAgICAgbW9kZWxDYXN0W3ZhbHVlTmFtZV0gPSBtb2RlbFZhbHVlOworICAgICAgICAgICAgICAgIHNlbGVjdGVkID0gdHJhY2tGbihzY29wZSwgbW9kZWxDYXN0KSA9PT0gdHJhY2tGbihzY29wZSwgbG9jYWxzKTsKKyAgICAgICAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgICAgICBzZWxlY3RlZCA9IG1vZGVsVmFsdWUgPT09IHZhbHVlRm4oc2NvcGUsIGxvY2Fscyk7CisgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgc2VsZWN0ZWRTZXQgPSBzZWxlY3RlZFNldCB8fCBzZWxlY3RlZDsgLy8gc2VlIGlmIGF0IGxlYXN0IG9uZSBpdGVtIGlzIHNlbGVjdGVkCisgICAgICAgICAgICB9CisgICAgICAgICAgICBsYWJlbCA9IGRpc3BsYXlGbihzY29wZSwgbG9jYWxzKTsgLy8gd2hhdCB3aWxsIGJlIHNlZW4gYnkgdGhlIHVzZXIKKworICAgICAgICAgICAgLy8gZG9pbmcgZGlzcGxheUZuKHNjb3BlLCBsb2NhbHMpIHx8ICcnIG92ZXJ3cml0ZXMgemVybyB2YWx1ZXMKKyAgICAgICAgICAgIGxhYmVsID0gaXNEZWZpbmVkKGxhYmVsKSA/IGxhYmVsIDogJyc7CisgICAgICAgICAgICBvcHRpb25Hcm91cC5wdXNoKHsKKyAgICAgICAgICAgICAgLy8gZWl0aGVyIHRoZSBpbmRleCBpbnRvIGFycmF5IG9yIGtleSBmcm9tIG9iamVjdAorICAgICAgICAgICAgICBpZDogdHJhY2tGbiA/IHRyYWNrRm4oc2NvcGUsIGxvY2FscykgOiAoa2V5TmFtZSA/IGtleXNbaW5kZXhdIDogaW5kZXgpLAorICAgICAgICAgICAgICBsYWJlbDogbGFiZWwsCisgICAgICAgICAgICAgIHNlbGVjdGVkOiBzZWxlY3RlZCAgICAgICAgICAgICAgICAgICAvLyBkZXRlcm1pbmUgaWYgd2Ugc2hvdWxkIGJlIHNlbGVjdGVkCisgICAgICAgICAgICB9KTsKKyAgICAgICAgICB9CisgICAgICAgICAgaWYgKCFtdWx0aXBsZSkgeworICAgICAgICAgICAgaWYgKG51bGxPcHRpb24gfHwgbW9kZWxWYWx1ZSA9PT0gbnVsbCkgeworICAgICAgICAgICAgICAvLyBpbnNlcnQgbnVsbCBvcHRpb24gaWYgd2UgaGF2ZSBhIHBsYWNlaG9sZGVyLCBvciB0aGUgbW9kZWwgaXMgbnVsbAorICAgICAgICAgICAgICBvcHRpb25Hcm91cHNbJyddLnVuc2hpZnQoe2lkOicnLCBsYWJlbDonJywgc2VsZWN0ZWQ6IXNlbGVjdGVkU2V0fSk7CisgICAgICAgICAgICB9IGVsc2UgaWYgKCFzZWxlY3RlZFNldCkgeworICAgICAgICAgICAgICAvLyBvcHRpb24gY291bGQgbm90IGJlIGZvdW5kLCB3ZSBoYXZlIHRvIGluc2VydCB0aGUgdW5kZWZpbmVkIGl0ZW0KKyAgICAgICAgICAgICAgb3B0aW9uR3JvdXBzWycnXS51bnNoaWZ0KHtpZDonPycsIGxhYmVsOicnLCBzZWxlY3RlZDp0cnVlfSk7CisgICAgICAgICAgICB9CisgICAgICAgICAgfQorCisgICAgICAgICAgLy8gTm93IHdlIG5lZWQgdG8gdXBkYXRlIHRoZSBsaXN0IG9mIERPTSBub2RlcyB0byBtYXRjaCB0aGUgb3B0aW9uR3JvdXBzIHdlIGNvbXB1dGVkIGFib3ZlCisgICAgICAgICAgZm9yIChncm91cEluZGV4ID0gMCwgZ3JvdXBMZW5ndGggPSBvcHRpb25Hcm91cE5hbWVzLmxlbmd0aDsKKyAgICAgICAgICAgICAgIGdyb3VwSW5kZXggPCBncm91cExlbmd0aDsKKyAgICAgICAgICAgICAgIGdyb3VwSW5kZXgrKykgeworICAgICAgICAgICAgLy8gY3VycmVudCBvcHRpb24gZ3JvdXAgbmFtZSBvciAnJyBpZiBubyBncm91cAorICAgICAgICAgICAgb3B0aW9uR3JvdXBOYW1lID0gb3B0aW9uR3JvdXBOYW1lc1tncm91cEluZGV4XTsKKworICAgICAgICAgICAgLy8gbGlzdCBvZiBvcHRpb25zIGZvciB0aGF0IGdyb3VwLiAoZmlyc3QgaXRlbSBoYXMgdGhlIHBhcmVudCkKKyAgICAgICAgICAgIG9wdGlvbkdyb3VwID0gb3B0aW9uR3JvdXBzW29wdGlvbkdyb3VwTmFtZV07CisKKyAgICAgICAgICAgIGlmIChvcHRpb25Hcm91cHNDYWNoZS5sZW5ndGggPD0gZ3JvdXBJbmRleCkgeworICAgICAgICAgICAgICAvLyB3ZSBuZWVkIHRvIGdyb3cgdGhlIG9wdGlvbkdyb3VwcworICAgICAgICAgICAgICBleGlzdGluZ1BhcmVudCA9IHsKKyAgICAgICAgICAgICAgICBlbGVtZW50OiBvcHRHcm91cFRlbXBsYXRlLmNsb25lKCkuYXR0cignbGFiZWwnLCBvcHRpb25Hcm91cE5hbWUpLAorICAgICAgICAgICAgICAgIGxhYmVsOiBvcHRpb25Hcm91cC5sYWJlbAorICAgICAgICAgICAgICB9OworICAgICAgICAgICAgICBleGlzdGluZ09wdGlvbnMgPSBbZXhpc3RpbmdQYXJlbnRdOworICAgICAgICAgICAgICBvcHRpb25Hcm91cHNDYWNoZS5wdXNoKGV4aXN0aW5nT3B0aW9ucyk7CisgICAgICAgICAgICAgIHNlbGVjdEVsZW1lbnQuYXBwZW5kKGV4aXN0aW5nUGFyZW50LmVsZW1lbnQpOworICAgICAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgICAgZXhpc3RpbmdPcHRpb25zID0gb3B0aW9uR3JvdXBzQ2FjaGVbZ3JvdXBJbmRleF07CisgICAgICAgICAgICAgIGV4aXN0aW5nUGFyZW50ID0gZXhpc3RpbmdPcHRpb25zWzBdOyAgLy8gZWl0aGVyIFNFTEVDVCAobm8gZ3JvdXApIG9yIE9QVEdST1VQIGVsZW1lbnQKKworICAgICAgICAgICAgICAvLyB1cGRhdGUgdGhlIE9QVEdST1VQIGxhYmVsIGlmIG5vdCB0aGUgc2FtZS4KKyAgICAgICAgICAgICAgaWYgKGV4aXN0aW5nUGFyZW50LmxhYmVsICE9IG9wdGlvbkdyb3VwTmFtZSkgeworICAgICAgICAgICAgICAgIGV4aXN0aW5nUGFyZW50LmVsZW1lbnQuYXR0cignbGFiZWwnLCBleGlzdGluZ1BhcmVudC5sYWJlbCA9IG9wdGlvbkdyb3VwTmFtZSk7CisgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0KKworICAgICAgICAgICAgbGFzdEVsZW1lbnQgPSBudWxsOyAgLy8gc3RhcnQgYXQgdGhlIGJlZ2lubmluZworICAgICAgICAgICAgZm9yKGluZGV4ID0gMCwgbGVuZ3RoID0gb3B0aW9uR3JvdXAubGVuZ3RoOyBpbmRleCA8IGxlbmd0aDsgaW5kZXgrKykgeworICAgICAgICAgICAgICBvcHRpb24gPSBvcHRpb25Hcm91cFtpbmRleF07CisgICAgICAgICAgICAgIGlmICgoZXhpc3RpbmdPcHRpb24gPSBleGlzdGluZ09wdGlvbnNbaW5kZXgrMV0pKSB7CisgICAgICAgICAgICAgICAgLy8gcmV1c2UgZWxlbWVudHMKKyAgICAgICAgICAgICAgICBsYXN0RWxlbWVudCA9IGV4aXN0aW5nT3B0aW9uLmVsZW1lbnQ7CisgICAgICAgICAgICAgICAgaWYgKGV4aXN0aW5nT3B0aW9uLmxhYmVsICE9PSBvcHRpb24ubGFiZWwpIHsKKyAgICAgICAgICAgICAgICAgIGxhc3RFbGVtZW50LnRleHQoZXhpc3RpbmdPcHRpb24ubGFiZWwgPSBvcHRpb24ubGFiZWwpOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICBpZiAoZXhpc3RpbmdPcHRpb24uaWQgIT09IG9wdGlvbi5pZCkgeworICAgICAgICAgICAgICAgICAgbGFzdEVsZW1lbnQudmFsKGV4aXN0aW5nT3B0aW9uLmlkID0gb3B0aW9uLmlkKTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgLy8gbGFzdEVsZW1lbnQucHJvcCgnc2VsZWN0ZWQnKSBwcm92aWRlZCBieSBqUXVlcnkgaGFzIHNpZGUtZWZmZWN0cworICAgICAgICAgICAgICAgIGlmIChsYXN0RWxlbWVudFswXS5zZWxlY3RlZCAhPT0gb3B0aW9uLnNlbGVjdGVkKSB7CisgICAgICAgICAgICAgICAgICBsYXN0RWxlbWVudC5wcm9wKCdzZWxlY3RlZCcsIChleGlzdGluZ09wdGlvbi5zZWxlY3RlZCA9IG9wdGlvbi5zZWxlY3RlZCkpOworICAgICAgICAgICAgICAgICAgaWYgKG1zaWUpIHsKKyAgICAgICAgICAgICAgICAgICAgLy8gU2VlICM3NjkyCisgICAgICAgICAgICAgICAgICAgIC8vIFRoZSBzZWxlY3RlZCBpdGVtIHdvdWxkbid0IHZpc3VhbGx5IHVwZGF0ZSBvbiBJRSB3aXRob3V0IHRoaXMuCisgICAgICAgICAgICAgICAgICAgIC8vIFRlc3RlZCBvbiBXaW43OiBJRTksIElFMTAgYW5kIElFMTEuIEZ1dHVyZSBJRXMgc2hvdWxkIGJlIHRlc3RlZCBhcyB3ZWxsCisgICAgICAgICAgICAgICAgICAgIGxhc3RFbGVtZW50LnByb3AoJ3NlbGVjdGVkJywgZXhpc3RpbmdPcHRpb24uc2VsZWN0ZWQpOworICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgICAgICAvLyBncm93IGVsZW1lbnRzCisKKyAgICAgICAgICAgICAgICAvLyBpZiBpdCdzIGEgbnVsbCBvcHRpb24KKyAgICAgICAgICAgICAgICBpZiAob3B0aW9uLmlkID09PSAnJyAmJiBudWxsT3B0aW9uKSB7CisgICAgICAgICAgICAgICAgICAvLyBwdXQgYmFjayB0aGUgcHJlLWNvbXBpbGVkIGVsZW1lbnQKKyAgICAgICAgICAgICAgICAgIGVsZW1lbnQgPSBudWxsT3B0aW9uOworICAgICAgICAgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICAgICAgICAvLyBqUXVlcnkodjEuNC4yKSBCdWc6IFdlIHNob3VsZCBiZSBhYmxlIHRvIGNoYWluIHRoZSBtZXRob2QgY2FsbHMsIGJ1dAorICAgICAgICAgICAgICAgICAgLy8gaW4gdGhpcyB2ZXJzaW9uIG9mIGpRdWVyeSBvbiBzb21lIGJyb3dzZXIgdGhlIC50ZXh0KCkgcmV0dXJucyBhIHN0cmluZworICAgICAgICAgICAgICAgICAgLy8gcmF0aGVyIHRoZW4gdGhlIGVsZW1lbnQuCisgICAgICAgICAgICAgICAgICAoZWxlbWVudCA9IG9wdGlvblRlbXBsYXRlLmNsb25lKCkpCisgICAgICAgICAgICAgICAgICAgICAgLnZhbChvcHRpb24uaWQpCisgICAgICAgICAgICAgICAgICAgICAgLnByb3AoJ3NlbGVjdGVkJywgb3B0aW9uLnNlbGVjdGVkKQorICAgICAgICAgICAgICAgICAgICAgIC5hdHRyKCdzZWxlY3RlZCcsIG9wdGlvbi5zZWxlY3RlZCkKKyAgICAgICAgICAgICAgICAgICAgICAudGV4dChvcHRpb24ubGFiZWwpOworICAgICAgICAgICAgICAgIH0KKworICAgICAgICAgICAgICAgIGV4aXN0aW5nT3B0aW9ucy5wdXNoKGV4aXN0aW5nT3B0aW9uID0geworICAgICAgICAgICAgICAgICAgICBlbGVtZW50OiBlbGVtZW50LAorICAgICAgICAgICAgICAgICAgICBsYWJlbDogb3B0aW9uLmxhYmVsLAorICAgICAgICAgICAgICAgICAgICBpZDogb3B0aW9uLmlkLAorICAgICAgICAgICAgICAgICAgICBzZWxlY3RlZDogb3B0aW9uLnNlbGVjdGVkCisgICAgICAgICAgICAgICAgfSk7CisgICAgICAgICAgICAgICAgaWYgKGxhc3RFbGVtZW50KSB7CisgICAgICAgICAgICAgICAgICBsYXN0RWxlbWVudC5hZnRlcihlbGVtZW50KTsKKyAgICAgICAgICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgICAgICAgZXhpc3RpbmdQYXJlbnQuZWxlbWVudC5hcHBlbmQoZWxlbWVudCk7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIGxhc3RFbGVtZW50ID0gZWxlbWVudDsKKyAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfQorICAgICAgICAgICAgLy8gcmVtb3ZlIGFueSBleGNlc3NpdmUgT1BUSU9OcyBpbiBhIGdyb3VwCisgICAgICAgICAgICBpbmRleCsrOyAvLyBpbmNyZW1lbnQgc2luY2UgdGhlIGV4aXN0aW5nT3B0aW9uc1swXSBpcyBwYXJlbnQgZWxlbWVudCBub3QgT1BUSU9OCisgICAgICAgICAgICB3aGlsZShleGlzdGluZ09wdGlvbnMubGVuZ3RoID4gaW5kZXgpIHsKKyAgICAgICAgICAgICAgZXhpc3RpbmdPcHRpb25zLnBvcCgpLmVsZW1lbnQucmVtb3ZlKCk7CisgICAgICAgICAgICB9CisgICAgICAgICAgfQorICAgICAgICAgIC8vIHJlbW92ZSBhbnkgZXhjZXNzaXZlIE9QVEdST1VQcyBmcm9tIHNlbGVjdAorICAgICAgICAgIHdoaWxlKG9wdGlvbkdyb3Vwc0NhY2hlLmxlbmd0aCA+IGdyb3VwSW5kZXgpIHsKKyAgICAgICAgICAgIG9wdGlvbkdyb3Vwc0NhY2hlLnBvcCgpWzBdLmVsZW1lbnQucmVtb3ZlKCk7CisgICAgICAgICAgfQorICAgICAgICB9CisgICAgICB9CisgICAgfQorICB9OworfV07CisKK3ZhciBvcHRpb25EaXJlY3RpdmUgPSBbJyRpbnRlcnBvbGF0ZScsIGZ1bmN0aW9uKCRpbnRlcnBvbGF0ZSkgeworICB2YXIgbnVsbFNlbGVjdEN0cmwgPSB7CisgICAgYWRkT3B0aW9uOiBub29wLAorICAgIHJlbW92ZU9wdGlvbjogbm9vcAorICB9OworCisgIHJldHVybiB7CisgICAgcmVzdHJpY3Q6ICdFJywKKyAgICBwcmlvcml0eTogMTAwLAorICAgIGNvbXBpbGU6IGZ1bmN0aW9uKGVsZW1lbnQsIGF0dHIpIHsKKyAgICAgIGlmIChpc1VuZGVmaW5lZChhdHRyLnZhbHVlKSkgeworICAgICAgICB2YXIgaW50ZXJwb2xhdGVGbiA9ICRpbnRlcnBvbGF0ZShlbGVtZW50LnRleHQoKSwgdHJ1ZSk7CisgICAgICAgIGlmICghaW50ZXJwb2xhdGVGbikgeworICAgICAgICAgIGF0dHIuJHNldCgndmFsdWUnLCBlbGVtZW50LnRleHQoKSk7CisgICAgICAgIH0KKyAgICAgIH0KKworICAgICAgcmV0dXJuIGZ1bmN0aW9uIChzY29wZSwgZWxlbWVudCwgYXR0cikgeworICAgICAgICB2YXIgc2VsZWN0Q3RybE5hbWUgPSAnJHNlbGVjdENvbnRyb2xsZXInLAorICAgICAgICAgICAgcGFyZW50ID0gZWxlbWVudC5wYXJlbnQoKSwKKyAgICAgICAgICAgIHNlbGVjdEN0cmwgPSBwYXJlbnQuZGF0YShzZWxlY3RDdHJsTmFtZSkgfHwKKyAgICAgICAgICAgICAgcGFyZW50LnBhcmVudCgpLmRhdGEoc2VsZWN0Q3RybE5hbWUpOyAvLyBpbiBjYXNlIHdlIGFyZSBpbiBvcHRncm91cAorCisgICAgICAgIGlmIChzZWxlY3RDdHJsICYmIHNlbGVjdEN0cmwuZGF0YWJvdW5kKSB7CisgIC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DsKKyAgICB9OworCisgICAgcmV0dXJuIHsKKyAgICAgICAgLyoqCisgICAgICAgICAqIFByb3ZpZGVzIHJlYWQtb25seSBlcXVpdmFsZW50IG9mIGpRdWVyeSdzIHBvc2l0aW9uIGZ1bmN0aW9uOgorICAgICAgICAgKiBodHRwOi8vYXBpLmpxdWVyeS5jb20vcG9zaXRpb24vCisgICAgICAgICAqLworICAgICAgICBwb3NpdGlvbjogZnVuY3Rpb24gKGVsZW1lbnQpIHsKKyAgICAgICAgICAgIHZhciBlbEJDUiA9IHRoaXMub2Zmc2V0KGVsZW1lbnQpOworICAgICAgICAgICAgdmFyIG9mZnNldFBhcmVudEJDUiA9IHsKKyAgICAgICAgICAgICAgICB0b3A6IDAsCisgICAgICAgICAgICAgICAgbGVmdDogMAorICAgICAgICAgICAgfTsKKyAgICAgICAgICAgIHZhciBvZmZzZXRQYXJlbnRFbCA9IHBhcmVudE9mZnNldEVsKGVsZW1lbnRbMF0pOworICAgICAgICAgICAgaWYgKG9mZnNldFBhcmVudEVsICE9PSAkZG9jdW1lbnRbMF0pIHsKKyAgICAgICAgICAgICAgICBvZmZzZXRQYXJlbnRCQ1IgPSB0aGlzLm9mZnNldChhbmd1bGFyLmVsZW1lbnQob2Zmc2V0UGFyZW50RWwpKTsKKyAgICAgICAgICAgICAgICBvZmZzZXRQYXJlbnRCQ1IudG9wICs9IG9mZnNldFBhcmVudEVsLmNsaWVudFRvcCAtIG9mZnNldFBhcmVudEVsLnNjcm9sbFRvcDsKKyAgICAgICAgICAgICAgICBvZmZzZXRQYXJlbnRCQ1IubGVmdCArPSBvZmZzZXRQYXJlbnRFbC5jbGllbnRMZWZ0IC0gb2Zmc2V0UGFyZW50RWwuc2Nyb2xsTGVmdDsKKyAgICAgICAgICAgIH0KKworICAgICAgICAgICAgcmV0dXJuIHsKKyAgICAgICAgICAgICAgICB3aWR0aDogZWxlbWVudC5wcm9wKCdvZmZzZXRXaWR0aCcpLAorICAgICAgICAgICAgICAgIGhlaWdodDogZWxlbWVudC5wcm9wKCdvZmZzZXRIZWlnaHQnKSwKKyAgICAgICAgICAgICAgICB0b3A6IGVsQkNSLnRvcCAtIG9mZnNldFBhcmVudEJDUi50b3AsCisgICAgICAgICAgICAgICAgbGVmdDogZWxCQ1IubGVmdCAtIG9mZnNldFBhcmVudEJDUi5sZWZ0CisgICAgICAgICAgICB9OworICAgICAgICB9LAorCisgICAgICAgIC8qKgorICAgICAgICAgKiBQcm92aWRlcyByZWFkLW9ubHkgZXF1aXZhbGVudCBvZiBqUXVlcnkncyBvZmZzZXQgZnVuY3Rpb246CisgICAgICAgICAqIGh0dHA6Ly9hcGkuanF1ZXJ5LmNvbS9vZmZzZXQvCisgICAgICAgICAqLworICAgICAgICBvZmZzZXQ6IGZ1bmN0aW9uIChlbGVtZW50KSB7CisgICAgICAgICAgICB2YXIgYm91bmRpbmdDbGllbnRSZWN0ID0gZWxlbWVudFswXS5nZXRCb3VuZGluZ0NsaWVudFJlY3QoKTsKKyAgICAgICAgICAgIHJldHVybiB7CisgICAgICAgICAgICAgICAgd2lkdGg6IGVsZW1lbnQucHJvcCgnb2Zmc2V0V2lkdGgnKSwKKyAgICAgICAgICAgICAgICBoZWlnaHQ6IGVsZW1lbnQucHJvcCgnb2Zmc2V0SGVpZ2h0JyksCisgICAgICAgICAgICAgICAgdG9wOiBib3VuZGluZ0NsaWVudFJlY3QudG9wICsgKCR3aW5kb3cucGFnZVlPZmZzZXQgfHwgJGRvY3VtZW50WzBdLmJvZHkuc2Nyb2xsVG9wIHx8ICRkb2N1bWVudFswXS5kb2N1bWVudEVsZW1lbnQuc2Nyb2xsVG9wKSwKKyAgICAgICAgICAgICAgICBsZWZ0OiBib3VuZGluZ0NsaWVudFJlY3QubGVmdCArICgkd2luZG93LnBhZ2VYT2Zmc2V0IHx8ICRkb2N1bWVudFswXS5ib2R5LnNjcm9sbExlZnQgfHwgJGRvY3VtZW50WzBdLmRvY3VtZW50RWxlbWVudC5zY3JvbGxMZWZ0KQorICA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xsYmFjaywKKyAgICAgICAgICAgICAgb25Db21wbGV0ZTogY2FsbGJhY2sKKyAgICAgICAgICB9KTsKKyAgICAgIH07CisgICAgICAvL1JldHVybnMgYSBmdW5jdGlvbiB0aGF0IHRha2VzIGEgY2FsbGJhY2sgZnVuY3Rpb24gYW5kIGEgZHVyYXRpb24gZm9yIHRoZSBhbmltYXRpb24KKyAgICAgIHJldHVybiAoZnVuY3Rpb24oKXsKKyAgICAgICAgcmV0dXJuIGxvYWRpbmdBbmltYXRpb247CisgICAgICB9KSgpOworICAgIH07CisKKyAgcmV0dXJuIGxvYWRpbmdBbmltYXRpb25DcmVhdG9yOworfSkKKy5mYWN0b3J5KCckaGVpZ2h0JywgZnVuY3Rpb24oKXsKKyAgdmFyIGhlaWdodEFuaW1hdGlvbiA9IGZ1bmN0aW9uKGVsZW1lbnQsZHVyYXRpb24saGVpZ2h0LGFscGhhKXsKKyAgICBUd2Vlbk1heC50byhlbGVtZW50LAorICAgICAgZHVyYXRpb24sCisgICAgICB7aGVpZ2h0OmhlaWdodCwgYXV0b0FscGhhOmFscGhhfSwKKyAgICAgIDApOworICB9OworICByZXR1cm4gaGVpZ2h0QW5pbWF0aW9uOworfSk7Cithbmd1bGFyLm1vZHVsZSgnYXR0LmFicy5hY2NvcmRpb24nLCBbJ2F0dC5hYnMucG9zaXRpb24nLCAnYXR0LmFicy50cmFuc2l0aW9uJ10pCisgICAgICAgIC5jb25zdGFudCgnYWNjb3JkaW9uQ29uZmlnJywgeworICAgICAgICAgICAgY2xvc2VPdGhlcnM6IGZhbHNlCisgICAgICAgIH0pLmNvbnRyb2xsZXIoJ0FjY29yZGlvbkNvbnRyb2xsZXInLCBbJyRzY29wZScsICckYXR0cnMnLCAnYWNjb3JkaW9uQ29uZmlnJywgJyRsb2cnLAorICAgIGZ1bmN0aW9uICgkc2NvcGUsICRhdHRycywgYWNjb3JkaW9uQ29uZmlnLCAkbG9nKSB7CisgICAgICAgIC8vIFRoaXMgYXJyYXkga2VlcHMgdHJhY2sgb2YgdGhlIGFjY29yZGlvbiBncm91cHMKKyAgICAgICAgdGhpcy5ncm91cHMgPSBbXTsKKyAgICAgICAgdGhpcy5pbmRleCA9IC0xOworICAgICAgICAvLyBLZWVwIHJlZmVyZW5jZSB0byB1c2VyJ3Mgc2NvcGUgdG8gcHJvcGVybHkgYXNzaWduIGBpcy1vcGVuYAorICAgICAgICB0aGlzLnNjb3BlID0gJHNjb3BlOworICAgICAgICAkc2NvcGUuZm9yY2VFeHBhbmQgPSBmYWxzZTsKKyAgICAgICAgLy8gRW5zdXJlIHRoYXQgYWxsIHRoZSBncm91cHMgaW4gdGhpcyBhY2NvcmRpb24gYXJlIGNsb3NlZCwgdW5sZXNzIGNsb3NlLW90aGVycyBleHBsaWNpdGx5IHNheXMgbm90IHRvCisgICAgICAgIHRoaXMuY2xvc2VPdGhlcnMgPSBmdW5jdGlvbiAob3Blbkdyb3VwKSB7CisgICAgICAgICAgICB2YXIgY2xvc2VPdGhlcnMgPSBhbmd1bGFyLmlzRGVmaW5lZCgkYXR0cnMuY2xvc2VPdGhlcnMpID8gJHNjb3BlLiRldmFsKCRhdHRycy5jbG9zZU90aGVycykgOiBhY2NvcmRpb25Db25maWcuY2xvc2VPdGhlcnM7CisgICAgICAgICAgICBpZiAoY2xvc2VPdGhlcnMgJiYgISRzY29wZS5mb3JjZUV4cGFuZCkgeworICAgICAgICAgICAgICAgIGFuZ3VsYXIuZm9yRWFjaCh0aGlzLmdyb3VwcywgZnVuY3Rpb24gKGdyb3VwKSB7CisgICAgICAgICAgICAgICAgICAgIGlmIChncm91cCAhPT0gb3Blbkdyb3VwKSB7CisgICAgICAgICAgICAgICAgICAgICAgICBncm91cC5pc09wZW4gPSBmYWxzZTsKKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIH0pOworICAgICAgICAgICAgfQorICAgICAgICAgICAgaWYgKHRoaXMuZ3JvdXBzLmluZGV4T2Yob3Blbkdyb3VwKSA9PT0gKHRoaXMuZ3JvdXBzLmxlbmd0aCAtIDEpICYmICRzY29wZS5mb3JjZUV4cGFuZCkgeworICAgICAgICAgICAgICAgICRzY29wZS5mb3JjZUV4cGFuZCA9IGZhbHNlOworICAgICAgICAgICAgfQorICAgICAgICB9OworICAgICAgICB0aGlzLmV4cGFuZEFsbCA9IGZ1bmN0aW9uICgpIHsKKyAgICAgICAgICAgICRzY29wZS5mb3JjZUV4cGFuZCA9IHRydWU7CisgICAgICAgICAgICBhbmd1bGFyLmZvckVhY2godGhpcy5ncm91cHMsIGZ1bmN0aW9uIChncm91cCkgeworICAgICAgICAgICAgICAgIGdyb3VwLmlzT3BlbiA9IHRydWU7CisgICAgICAgICAgICB9KTsKKyAgICAgICAgfTsKKyAgICAgICAgdGhpcy5jb2xsYXBzZUFsbCA9IGZ1bmN0aW9uICgpIHsKKyAgICAgICAgICAgIGFuZ3VsYXIuZm9yRWFjaCh0aGlzLmdyb3VwcywgZnVuY3Rpb24gKGdyb3VwKSB7CisgICAgICAgICAgICAgICAgZ3JvdXAuaXNPcGVuID0gZmFsc2U7CisgICAgICAgICAgICB9KTsKKyAgICAgICAgfTsKKyAgICAgICAgLyoqZnVuY3Rpb24gZm9jdXMgQHBhcmFtIGZvY3VzR3JvdXAgKi8KKyAgICAgICAgdGhpcy5mb2N1cyA9IGZ1bmN0aW9uIChmb2N1c0dyb3VwKSB7CisgICAgICAgICAgICB2YXIgc2VsZiA9IHRoaXM7CisgICAgICAgICAgICBhbmd1bGFyLmZvckVhY2godGhpcy5ncm91cHMsIGZ1bmN0aW9uIChncm91cCwgaW5kZXgpIHsKKyAgICAgICAgICAgICAgICBpZiAoZ3JvdXAgIT09IGZvY3VzR3JvdXApIHsKKyAgICAgICAgICAgICAgICAgICAgZ3JvdXAuZm9jdXNlZCA9IGZhbHNlOworICAgICAgICAgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICAgICAgICAgIHNlbGYuaW5kZXggPSBpbmRleDsKKyAgICAgICAgICAgICAgICAgICAgZ3JvdXAuZm9jdXNlZCA9IHRydWU7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfSk7CisgICAgICAgIH07CisgICAgICAgIC8qKiBAcGFyYW0gYmx1ckdyb3VwKi8KKyAgICAgICAgdGhpcy5ibHVyID0gZnVuY3Rpb24gKGJsdXJHcm91cCkgeworICAgICAgICAgICAgYmx1ckdyb3VwLmZvY3VzZWQgPSBmYWxzZTsKKyAgICAgICAgICAgIHRoaXMuaW5kZXggPSAtMTsKKyAgICAgICAgICAgICRsb2cubG9nKCJhY2NvcmRpb24uYmx1cigpIiwgYmx1ckdyb3VwKTsKKyAgICAgICAgfTsKKyAgICAgICAgLyoqIEBwYXJhbSBncm91cCAtIHRoZSBncm91cCBpbiBjdXJyZW50IGZvY3VzIEBwYXJhbSBkb3duIC0gY3ljbGluZyBkb3duICovCisgICAgICAgIHRoaXMuY3ljbGUgPSBmdW5jdGlvbiAoZ3JvdXAsIGRvd24sIG5vUmVjeWNsZSkgeworICAgICAgICAgICAgaWYgKCFkb3duKSB7CisgICAgICAgICAgICAgICAgaWYgKHRoaXMuaW5kZXggPD0gMCAmJiAhbm9SZWN5Y2xlKSB7CisgICAgICAgICAgICAgICAgICAgIHRoaXMuaW5kZXggPSB0aGlzLmdyb3Vwcy5sZW5ndGggLSAxOworICAgICAgICAgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICAgICAgICAgIHRoaXMuaW5kZXgtLTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgICAgIGlmICh0aGlzLmluZGV4ID09PSAodGhpcy5ncm91cHMubGVuZ3RoIC0gMSkpCisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICBpZiAobm9SZWN5Y2xlKSB7CisgICAgICAgICAgICAgICAgICAgICAgICB0aGlzLmluZGV4ID0gMDsKKyAgICAgICAgICAgICAgICAgICAgICAgIGdyb3VwLmZvY3VzZWQgPSBmYWxzZTsKKyAgICAgICAgICAgICAgICAgICAgICAgICRzY29wZS4kYXBwbHkoKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybjsKKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIHRoaXMuaW5kZXggPSAwOworICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgICAgICAgICAgdGhpcy5pbmRleCsrOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0KKworICAgICAgICAgICAgZ3JvdXAuZm9jdXNlZCA9IGZhbHNlOworICAgICAgICAgICAgdGhpcy5ncm91cHNbdGhpcy5pbmRleF0uc2V0Rm9jdXMgPSB0cnVlOworICAgICAgICAgICAgdGhpcy5ncm91cHNbdGhpcy5pbmRleF0uZm9jdXNlZCA9IHRydWU7CisgICAgICAgICAgICAkc2NvcGUuJGFwcGx5KCk7CisgICAgICAgIH07CisgICAgICAgIC8vIFRoaXMgaXMgY2FsbGVkIGZyb20gdGhlIGFjY29yZGlvbi1ncm91cCBkaXJlY3RpdmUgdG8gYWRkIGl0c2VsZiB0byB0aGUgYWNjb3JkaW9uCisgICAgICAgIHRoaXMuYWRkR3JvdXAgPSBmdW5jdGlvbiAoZ3JvdXBTY29wZSkgeworICAgICAgICAgICAgdmFyIHRoYXQgPSB0aGlzOworICAgICAgICAgICAgZ3JvdXBTY29wZS5pbmRleCA9IHRoaXMuZ3JvdXBzLmxlbmd0aDsKKyAgICAgICAgICAgIGdyb3VwU2NvcGUuZm9jdXNlZCA9IGZhbHNlOworICAgICAgICAgICAgdGhpcy5ncm91cHMucHVzaChncm91cFNjb3BlKTsKKworICAgICAgICAgICAgaWYodGhpcy5ncm91cHMubGVuZ3RoID4gMCl7CisgICAgICAgICAgICAgICAgdGhpcy5pbmRleCA9IDA7CisgICAgICAgICAgICB9CisKKyAgICAgICAgICAgIGdyb3VwU2NvcGUuJG9uKCckZGVzdHJveScsIGZ1bmN0aW9uICgpIHsKKyAgICAgICAgICAgICAgICB0aGF0LnJlbW92ZUdyb3VwKGdyb3VwU2NvcGUpOworICAgICAgICAgICAgfSk7CisgICAgICAgIH07CisgICAgICAgIC8vIFRoaXMgaXMgY2FsbGVkIGZyb20gdGhlIGFjY29yZGlvbi1ncm91cCBkaXJlY3RpdmUgd2hlbiB0byByZW1vdmUgaXRzZWxmCisgICAgICAgIHRoaXMucmVtb3ZlR3JvdXAgPSBmdW5jdGlvbiAoZ3JvdXApIHsKKyAgICAgICAgICAgIHZhciBpbmRleCA9IHRoaXMuZ3JvdXBzLmluZGV4T2YoZ3JvdXApOworICAgICAgICAgICAgaWYgKGluZGV4ICE9PSAtMSkgeworICAgICAgICAgICAgICAgIHRoaXMuZ3JvdXBzLnNwbGljZSh0aGlzLmdyb3Vwcy5pbmRleE9mKGdyb3VwKSwgMSk7CisgICAgICAgICAgICB9CisgICAgICAgIH07CisgICAgfV0pCisvLyBUaGUgYWNjb3JkaW9uIGRpcmVjdGl2ZSBzaW1wbHkgc2V0cyB1cCB0aGUgZGlyZWN0aXZlIGNvbnRyb2xsZXIgYW5kIGFkZHMgYW4gYWNjb3JkaW9uIENTUyBjbGFzcyB0byBpdHNlbGYgZWxlbWVudC4KKyAgICAgICAgLmRpcmVjdGl2ZSgnYWNjb3JkaW9uJywgZnVuY3Rpb24gKCkgeworICAgICAgICAgICAgcmV0dXJuIHsKKyAgICAgICAgICAgICAgICByZXN0cmljdDogJ0VBJywKKyAgICAgICAgICAgICAgICBjb250cm9sbGVyOiAnQWNjb3JkaW9uQ29udHJvbGxlcicsCisgICAgICAgICAgICAgICAgdHJhbnNjbHVkZTogdHJ1ZSwKKyAgICAgICAgICAgICAgICByZXBsYWNlOiBmYWxzZSwKKyAgICAgICAgICAgICAgICBzY29wZTogeworICAgICAgICAgICAgICAgICAgICBjQ2xhc3M6ICdAY3NzJywKKyAgICAgICAgICAgICAgICAgICAgZXhwYW5kQWxsOiAiPT8iLAorICAgICAgICAgICAgICAgICAgICBjb2xsYXBzZUFsbDogIj0/IgorICAgICAgICAgICAgICAgIH0sCisgICAgICAgICAgICAgICAgdGVtcGxhdGU6ICc8ZGl2IGNsYXNzPSJ7e2NDbGFzc319IiBuZy10cmFuc2NsdWRlPjwvZGl2PicsCisgICAgICAgICAgICAgICAgbGluazogZnVuY3Rpb24gKHNjb3BlLCBlbGVtLCBhdHRyaWJ1dGUsIGN0cmwpIHsKKyAgICAgICAgICAgICAgICAgICAgc2NvcGUuJHdhdGNoKCJleHBhbmRBbGwiLCBmdW5jdGlvbiAodmFsdWUpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIGlmICh2YWx1ZSkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGN0cmwuZXhwYW5kQWxsKCk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2NvcGUuZXhwYW5kQWxsID0gZmFsc2U7CisgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgIH0pOworICAgICAgICAgICAgICAgICAgICBzY29wZS4kd2F0Y2goImNvbGxhcHNlQWxsIiwgZnVuY3Rpb24gKHZhbHVlKSB7CisgICAgICAgICAgICAgICAgICAgICAgICBpZiAodmFsdWUpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBjdHJsLmNvbGxhcHNlQWxsKCk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2NvcGUuY29sbGFwc2VBbGwgPSBmYWxzZTsKKyAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgfSk7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfTsKKyAgICAgICAgfSkKKy8vIFRoZSBhY2NvcmRpb24tZ3JvdXAgZGlyZWN0aXZlIGluZGljYXRlcyBhIGJsb2NrIG9mIGh0bWwgdGhhdCB3aWxsIGV4cGFuZCBhbmQgY29sbGFwc2UgaW4gYW4gYWNjb3JkaW9uCisgICAgICAgIC5kaXJlY3RpdmUoJ2FjY29yZGlvbkdyb3VwJywgWyckcGFyc2UnLCAnJHRyYW5zaXRpb24nLCAnJHNjcm9sbFRvJywgJyR0aW1lb3V0JywgJyRsb2cnLCBmdW5jdGlvbiAoJHBhcnNlLCAkdHJhbnNpdGlvbiwgJHNjcm9sbFRvLCAkdGltZW91dCwgJGxvZykgeworICAgICAgICAgICAgICAgIHJldHVybiB7CisgICAgICAgICAgICAgICAgICAgIC8vIFdlIG5lZWQgdGhpcyBkaXJlY3RpdmUgdG8gYmUgaW5zaWRlIGFuIGFjY29yZGlvbgorICAgICAgICAgICAgICAgICAgICByZXF1aXJlOiBbJ15hY2NvcmRpb24nLCAnYWNjb3JkaW9uR3JvdXAnXSwKKyAgICAgICAgICAgICAgICAgICAgcmVzdHJpY3Q6ICdFQScsCisgICAgICAgICAgICAgICAgICAgIC8vIEl0IHRyYW5zY2x1ZGVzIHRoZSBjb250ZW50cyBvZiB0aGUgZGlyZWN0aXZlIGludG8gdGhlIHRlbXBsYXRlCisgICAgICAgICAgICAgICAgICAgIHRyYW5zY2x1ZGU6IHRydWUsCisgICAgICAgICAgICAgICAgICAgIC8vIFRoZSBlbGVtZW50IGNvbnRhaW5pbmcgdGhlIGRpcmVjdGl2ZSB3aWxsIGJlIHJlcGxhY2VkIHdpdGggdGhlIHRlbXBsYXRlCisgICAgICAgICAgICAgICAgICAgIHJlcGxhY2U6IHRydWUsCisgICAgICAgICAgICAgICAgICAgIHRlbXBsYXRlVXJsOiAnYXBwL3NjcmlwdHMvbmdfanNfYXR0X3RwbHMvYWNjb3JkaW9uL2FjY29yZGlvbi5odG1sJywKKyAgICAgICAgICAgICAgICAgICAgc2NvcGU6IHsKKyAgICAgICAgICAgICAgICAgICAgICAgIC8vIENyZWF0ZSBhbiBpc29sYXRlZCBzY29wZSBhbmQgaW50ZXJwb2xhdGUgdGhlIGhlYWRpbmcgYXR0cmlidXRlIG9udG8gdGhpcyBzY29wZQorICAgICAgICAgICAgICAgICAgICAgICAgaGVhZGluZzogJ0AnLAorICAgICAgICAgICAgICAgICAgICAgICAgaXNPcGVuOiAnPT8nCisgICAgICAgICAgICAgICAgICAgIH0sCisgICAgICAgICAgICAgICAgICAgIGNvbnRyb2xsZXI6IFsnJHNjb3BlJywgZnVuY3Rpb24gKCRzY29wZSkKKyAgICAgICAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAkc2NvcGUuc2hvd2ljbyA9IHRydWU7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgdGhpcy5zZXRIZWFkaW5nID0gZnVuY3Rpb24gKGVsZW1lbnQpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0aGlzLmhlYWRpbmcgPSBlbGVtZW50OworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAkc2NvcGUuc2hvd2ljbyA9IGZhbHNlOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIH07CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgdGhpcy5pc0lzT3BlbiA9IGZ1bmN0aW9uICgpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gJHNjb3BlLmlzT3BlbjsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB9OworICAgICAgICAgICAgICAgICAgICAgICAgfV0sCisgICAgICAgICAgICAgICAgICAgIGxpbms6IGZ1bmN0aW9uIChzY29wZSwgZWxlbWVudCwgYXR0cnMsIGN0cmwpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIHZhciBhY2NvcmRpb25DdHJsID0gY3RybFswXTsKKyAgICAgICAgICAgICAgICAgICAgICAgIHZhciBhY2NvcmRpb25Hcm91cEN0cmwgPSBjdHJsWzFdOworICAgICAgICAgICAgICAgICAgICAgICAgdmFyIGtleXMgPSB7dGFiOiA5LCBlbnRlcjogMTMsIGVzYzogMjcsIHNwYWNlOiAzMiwgcGFnZXVwOiAzMywgcGFnZWRvd246IDM0LCBlbmQ6IDM1LCBob21lOiAzNiwgbGVmdDogMzcsIHVwOiAzOCwgcmlnaHQ6IDM5LCBkb3duOiA0MH07CisgICAgICAgICAgICAgICAgICAgICAgICAvL25vdCBhIGZpeAorICAgICAgICAgICAgICAgICAgICAgICAgdmFyIHRhYiA9IGVsZW1lbnQuY2hpbGRyZW4oKS5lcSgwKTsKKworICAgICAgICAgICAgICAgICAgICAgICAgc2NvcGUuc2V0Rm9jdXMgPSBmYWxzZTsKKworICAgICAgICAgICAgICAgICAgICAgICAgdmFyIGhhbmRsZUtleWRvd24gPSBmdW5jdGlvbiAoZXYpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YXIgYm9vbEZsYWcgPSB0cnVlOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIHN3aXRjaCAoZXYua2V5Q29kZSkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNhc2Uga2V5cy5lbnRlcjoKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGV2LnByZXZlbnREZWZhdWx0KCk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzY29wZS50b2dnbGUoKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNjb3BlLiRhcHBseSgpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNhc2Uga2V5cy51cDoKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY2FzZSBrZXlzLmxlZnQ6CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBldi5wcmV2ZW50RGVmYXVsdCgpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYWNjb3JkaW9uQ3RybC5jeWNsZShzY29wZSwgZmFsc2UpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNhc2Uga2V5cy5kb3duOgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjYXNlIGtleXMucmlnaHQ6CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBldi5wcmV2ZW50RGVmYXVsdCgpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYWNjb3JkaW9uQ3RybC5jeWNsZShzY29wZSwgdHJ1ZSk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZGVmYXVsdDoKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJvb2xGbGFnID0gZmFsc2U7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgZXYuc3RvcFByb3BhZ2F0aW9uKCk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGJvb2xGbGFnOworICAgICAgICAgICAgICAgICAgICAgICAgfTsKKworICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGFuZ3VsYXIuaXNVbmRlZmluZWQoc2NvcGUuaXNPcGVuKSkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNjb3BlLmlzT3BlbiA9IGZhbHNlOworICAgICAgICAgICAgICAgICAgICAgICAgfQorCisgICAgICAgICAgICAgICAgICAgICAgICB0YWIuYmluZCgia2V5ZG93biIsIGhhbmRsZUtleWRvd24pOworCisgICAgICAgICAgICAgICAgICAgICAgICBhY2NvcmRpb25DdHJsLmFkZEdyb3VwKHNjb3BlKTsKKworICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHNjb3BlLmluZGV4ID09PSAwKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2NvcGUuZm9jdXNlZCA9IHRydWU7CisgICAgICAgICAgICAgICAgICAgICAgICB9CisKKyAgICAgICAgICAgICAgICAgICAgICAgIGFjY29yZGlvbkdyb3VwQ3RybC50b2dnbGUgPSBzY29wZS50b2dnbGUgPSBmdW5jdGlvbiAoKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2NvcGUuaXNPcGVuID0gIXNjb3BlLmlzT3BlbjsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBhY2NvcmRpb25DdHJsLmZvY3VzKHNjb3BlKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gc2NvcGUuaXNPcGVuOworICAgICAgICAgICAgICAgICAgICAgICAgfTsKKworICAgICAgICAgICAgICAgICAgICAgICAgc2NvcGUuJHdhdGNoKCdpc09wZW4nLCBmdW5jdGlvbiAodmFsdWUpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAodmFsdWUpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYWNjb3JkaW9uQ3RybC5jbG9zZU90aGVycyhzY29wZSk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgfSk7CisKKyAgICAgICAgICAgICAgICAgICAgICAgIHNjb3BlLiR3YXRjaCgiZm9jdXNlZCIsIGZ1bmN0aW9uICh2YWx1ZSkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICghIXZhbHVlKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRhYi5hdHRyKCJ0YWJpbmRleCIsICIwIik7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmKHNjb3BlLnNldEZvY3VzKXsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRhYlswXS5mb2N1cygpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgICAgIGVsc2V7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNjb3BlLnNldEZvY3VzID0gZmFsc2U7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRhYi5hdHRyKCJ0YWJpbmRleCIsICItMSIpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgIH0pOworICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgfTsKKyAgICAgICAgICAgIH1dKQorLy8gVXNlIGFjY29yZGlvbi1oZWFkaW5nIGJlbG93IGFuIGFjY29yZGlvbi1ncm91cCB0byBwcm92aWRlIGEgaGVhZGluZyBjb250YWluaW5nIEhUTUwKKy8vIDxhY2NvcmRpb24tZ3JvdXA+CisvLyAgIDxhY2NvcmRpb24taGVhZGluZz5IZWFkaW5nIGNvbnRhaW5pbmcgSFRNTCAtIDxpbWcgc3JjPSIuLi4iPjwvYWNjb3JkaW9uLWhlYWRpbmc+CisvLyA8L2FjY29yZGlvbi1ncm91cD4KKyAgICAgICAgLmRpcmVjdGl2ZSgnYWNjb3JkaW9uVG9nZ2xlJywgZnVuY3Rpb24gKCkgeworICAgICAgICAgICAgcmV0dXJueworICAgICAgICAgICAgICAgIHJlc3RyaWN0OiAnRUEnLAorICAgICAgICAgICAgICAgIHJlcXVpcmU6ICdeYWNjb3JkaW9uR3JvdXAnLAorICAgICAgICAgICAgICAgIHNjb3BlOiB7CisgICAgICAgICAgICAgICAgICAgIGV4cGFuZEljb246ICdAJywKKyAgICAgICAgICAgICAgICAgICAgY29sbGFwc2VJY29uOiAnQCcKKyAgICAgICAgICAgICAgICB9LAorICAgICAgICAgICAgICAgIGxpbms6IGZ1bmN0aW9uIChzY29wZSwgZWxlbWVudCwgYXR0ciwgYWNjb3JkaW9uQ3RybCkKKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgIHZhciBzZXRJY29uID0gZnVuY3Rpb24gKGlzT3BlbikgeworICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHNjb3BlLmV4cGFuZEljb24gJiYgc2NvcGUuY29sbGFwc2VJY29uKQorICAgICAgICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChpc09wZW4pIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZWxlbWVudC5yZW1vdmVDbGFzcyhzY29wZS5leHBhbmRJY29uKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZWxlbWVudC5hZGRDbGFzcyhzY29wZS5jb2xsYXBzZUljb24pOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBlbHNlIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZWxlbWVudC5yZW1vdmVDbGFzcyhzY29wZS5jb2xsYXBzZUljb24pOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBlbGVtZW50LmFkZENsYXNzKHNjb3BlLmV4cGFuZEljb24pOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgfTsKKyAgICAgICAgICAgICAgICAgICAgZWxlbWVudC5iaW5kKCdjbGljaycsIGZ1bmN0aW9uICgpCisgICAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIGFjY29yZGlvbkN0cmwudG9nZ2xlKCk7CisgICAgICAgICAgICAgICAgICAgICAgICBzY29wZS4kYXBwbHkoKTsKKyAgICAgICAgICAgICAgICAgICAgfSk7CisgICAgICAgICAgICAgICAgICAgIHNjb3BlLiR3YXRjaChmdW5jdGlvbiAoKSB7CisgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gYWNjb3JkaW9uQ3RybC5pc0lzT3BlbigpOworICAgICAgICAgICAgICAgICAgICB9LCBmdW5jdGlvbiAodmFsdWUpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIHNldEljb24odmFsdWUpOworICAgICAgICAgICAgICAgICAgICB9KTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9OworICAgICAgICB9KS5kaXJlY3RpdmUoJ2FjY29yZGlvbkhlYWRpbmcnLCBmdW5jdGlvbiAoKSB7CisgICAgcmV0dXJuIHsKKyAgICAgICAgcmVzdHJpY3Q6ICdFQScsCisgICAgICAgIHRyYW5zY2x1ZGU6IHRydWUsCisgICAgICAgIHRlbXBsYXRlOiAnJywKKyAgICAgICAgcmVxdWlyZTogJ15hY2NvcmRpb25Hcm91cCcsCisgICAgICAgIGNvbXBpbGU6IGZ1bmN0aW9uIChlbGVtZW50LCBhdHRyLCB0cmFuc2NsdWRlKSB7CisgICAgICAgICAgICB2YXIgbGluayA9IGZ1bmN0aW9uIChzY29wZSwgZWxlbWVudCwgYXR0ciwgYWNjb3JkaW9uR3JvdXBDdHJsKSB7CisgICAgICAgICAgICAgICAgLy8gUGFzcyB0aGUgaGVhZGluZyB0byB0aGUgYWNjb3JkaW9uLWdyb3VwIGNvbnRyb2xsZXIKKyAgICAgICAgICAgICAgICAvLyBzbyB0aGF0IGl0IGNhbiBiZSB0cmFuc2NsdWRlZCBpbnRvIHRoZSByaWdodCBwbGFjZSBpbiB0aGUgdGVtcGxhdGUKKyAgICAgICAgICAgICAgICAvLyBbVGhlIHNlY29uZCBwYXJhbWV0ZXIgdG8gdHJhbnNjbHVkZSBjYXVzZXMgdGhlIGVsZW1lbnRzIHRvIGJlIGNsb25lZCBzbyB0aGF0IHRoZXkgd29yayBpbiBuZy1yZXBlYXRdCisgICAgICAgICAgICAgICAgdHJhbnNjbHVkZShzY29wZSwgZnVuY3Rpb24gKGNsb25lKSB7CisgICAgICAgICAgICAgICAgICAgIGVsZW1lbnQuYXBwZW5kKGNsb25lKTsKKyAgICAgICAgICAgICAgICAgICAgYWNjb3JkaW9uR3JvdXBDdHJsLnNldEhlYWRpbmcoZWxlbWVudCk7CisgICAgICAgICAgICAgICAgfSk7CisgICAgICAgICAgICB9OworICAgICAgICAgICAgcmV0dXJuIGxpbms7CisgICAgICAgIH0KKyAgICB9OworfSkKKy8vIFVzZSBpbiB0aGUgYWNjb3JkaW9uLWdyb3VwIHRlbXBsYXRlIHRvIGluZGljYXRlIHdoZXJlIHlvdSB3YW50IHRoZSBoZWFkaW5nIHRvIGJlIHRyYW5zY2x1ZGVkCisvLyBZb3UgbXVzdCBwcm92aWRlIHRoZSBwcm9wZXJ0eSBvbiB0aGUgYWNjb3JkaW9uLWdyb3VwIGNvbnRyb2xsZXIgdGhhdCB3aWxsIGhvbGQgdGhlIHRyYW5zY2x1ZGVkIGVsZW1lbnQKKyAgICAgICAgLmRpcmVjdGl2ZSgnYWNjb3JkaW9uVHJhbnNjbHVkZScsIGZ1bmN0aW9uICgpIHsKKyAgICAgICAgICAgIHJldHVybiB7CisgICAgICAgICAgICAgICAgcmVxdWlyZTogJ15hY2NvcmRpb25Hcm91cCcsCisgICAgICAgICAgICAgICAgbGluazogZnVuY3Rpb24gKHNjb3BlLCBlbGVtZW50LCBhdHRyLCBjb250cm9sbGVyKSB7CisgICAgICAgICAgICAgICAgICAgIHNjb3BlLiR3YXRjaChmdW5jdGlvbiAoKSB7CisgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gY29udHJvbGxlclthdHRyLmFjY29yZGlvblRyYW5zY2x1ZGVdOworICAgICAgICAgICAgICAgICAgICB9LCBmdW5jdGlvbiAoaGVhZGluZykgeworICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGhlYWRpbmcpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBlbGVtZW50LmZpbmQoInNwYW4iKS5lcSgwKS5wcmVwZW5kKGhlYWRpbmcpOworICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICB9KTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9OworICAgICAgICB9KQorICAgICAgICAuZGlyZWN0aXZlKCdhdHRHb1RvcCcsIFsnJHNjcm9sbFRvJywgZnVuY3Rpb24gKCRzY3JvbGxUbykgeworICAgICAgICAgICAgICAgIHJldHVybiB7CisgICAgICAgICAgICAgICAgICAgIHJlc3RyaWN0OiAnQScsCisgICAgICAgICAgICAgICAgICAgIHRyYW5zY2x1ZGU6IGZhbHNlLAorICAgICAgICAgICAgICAgICAgICBsaW5rOiBmdW5jdGlvbiAoc2NvcGUsIGVsZW0sIGF0dHJzKQorICAgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgICAgICBlbGVtLmJpbmQoJ2NsaWNrJywgZnVuY3Rpb24gKCkKKyAgICAgICAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAkc2Nyb2xsVG8oMCwgYXR0cnNbImF0dEdvVG9wIl0pOworICAgICAgICAgICAgICAgICAgICAgICAgfSk7CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICB9OworICAgICAgICAgICAgfV0pCisgICAgICAgIC5kaXJlY3RpdmUoJ2F0dEdvVG8nLCBbJyRhbmNob3JTY3JvbGwnLCAnJGxvY2F0aW9uJywgZnVuY3Rpb24gKCRhbmNob3JTY3JvbGwsICRsb2NhdGlvbikgeworICAgICAgICAgICAgICAgIHJldHVybiB7CisgICAgICAgICAgICAgICAgICAgIHJlc3RyaWN0OiAnQScsCisgICAgICAgICAgICAgICAgICAgIHRyYW5zY2x1ZGU6IGZhbHNlLAorICAgICAgICAgICAgICAgICAgICBsaW5rOiBmdW5jdGlvbiAoc2NvcGUsIGVsZW0sIGF0dHJzKQorICAgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgICAgICBlbGVtLmJpbmQoJ2NsaWNrJywgZnVuY3Rpb24gKCkKKyAgICAgICAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YXIgbmV3SGFzaCA9IGF0dHJzWyJhdHRHb1RvIl07CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKCRsb2NhdGlvbi5oYXNoKCkgIT09IG5ld0hhc2gpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAkbG9jYXRpb24uaGFzaChhdHRyc1siYXR0R29UbyJdKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJGFuY2hvclNjcm9sbCgpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgIH0pOworICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgfTsKKyAgICAgICAgICAgIH1dKQorICAgICAgICAuZGlyZWN0aXZlKCdmcmVlU3RhbmRpbmcnLCBmdW5jdGlvbiAoKSB7CisgICAgICAgICAgICByZXR1cm4geworICAgICAgICAgICAgICAgIHJlc3RyaWN0OiAnRUEnLAorICAgICAgICAgICAgICAgIHRyYW5zY2x1ZGU6IHRydWUsCisgICAgICAgICAgICAgICAgcmVwbGFjZTogdHJ1ZSwKKyAgICAgICAgICAgICAgICBzY29wZTogdHJ1ZSwKKyAgICAgICAgICAgICAgICB0ZW1wbGF0ZTogIjxkaXY+PHNwYW4gY2xhc3M9J2F0dC1hY2NvcmRpb25fX2ZyZWVzdGFuZGluZycgbmctc2hvdz0nc2hvd0FjY29yZGlvbic+PC9zcGFuPlxuIiArCisgICAgICAgICAgICAgICAgICAgICAgICAiPGRpdiBjbGFzcz0nc2VjdGlvbi10b2dnbGUnPlxuIiArCisgICAgICAgICAgICAgICAgICAgICAgICAiPGJ1dHRvbiBjbGFzcz0nc2VjdGlvbi10b2dnbGVfX2J1dHRvbicgbmctY2xpY2s9J2ZzVG9nZ2xlKCknPlxuIiArCisgICAgICAgICAgICAgICAgICAgICAgICAiICAgIHt7YnRuVGV4dH19PGkgc3R5bGU9J2ZvbnQtc2l6ZTowLjg3NXJlbScgbmctY2xhc3M9J3tcImljb24tY2hldnJvbi11cFwiOiBzaG93QWNjb3JkaW9uLFwiaWNvbi1jaGV2cm9uLWRvd25cIjogIXNob3dBY2NvcmRpb24sIH0nPjwvaT4gXG4iICsKKyAgICAgICAgICAgICAgICAgICAgICAgICI8L2J1dHRvbj5cbiIgKworICAgICAgICAgICAgICAgICAgICAgICAgIjwvZGl2PjwvZGl2PiIsCisgICAgICAgICAgICAgICAgY29tcGlsZTogZnVuY3Rpb24gKGVsZW1lbnQsIGF0dHIsIHRyYW5zY2x1ZGUpCisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICB2YXIgbGluayA9IGZ1bmN0aW9uIChzY29wZSwgZWxlbSwgYXR0cnMpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIHNjb3BlLmNvbnRlbnQgPSAiIjsKKyAgICAgICAgICAgICAgICAgICAgICAgIHRyYW5zY2x1ZGUoc2NvcGUsIGZ1bmN0aW9uIChjbG9uZSkKKyAgICAgICAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBlbGVtLmZpbmQoInNwYW4iKS5hcHBlbmQoY2xvbmUpOworICAgICAgICAgICAgICAgICAgICAgICAgfSk7CisgICAgICAgICAgICAgICAgICAgICAgICBzY29wZS5zaG93QWNjb3JkaW9uID0gZmFsc2U7CisgICAgICAgICAgICAgICAgICAgICAgICBzY29wZS5idG5UZXh0ID0gc2NvcGUuc2hvd0FjY29yZGlvbiA/IGF0dHJzLmhpZGVNc2cgOiBhdHRycy5zaG93TXNnOworICAgICAgICAgICAgICAgICAgICAgICAgc2NvcGUuZnNUb2dnbGUgPSBmdW5jdGlvbiAoKQorICAgICAgICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNjb3BlLnNob3dBY2NvcmRpb24gPSAhc2NvcGUuc2hvd0FjY29yZGlvbjsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBzY29wZS5idG5UZXh0ID0gc2NvcGUuc2hvd0FjY29yZGlvbiA/IGF0dHJzLmhpZGVNc2cgOiBhdHRycy5zaG93TXNnOworICAgICAgICAgICAgICAgICAgICAgICAgfTsKKyAgICAgICAgICAgICAgICAgICAgfTsKKyAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGxpbms7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfTsKKyAgICAgICAgfSkuZGlyZWN0aXZlKCdleHBhbmRlcnMnLCBmdW5jdGlvbiAoKSB7CisgICAgcmV0dXJueworICAgICAgICByZXN0cmljdDogJ0VBJywKKyAgICAgICAgcmVwbGFjZTogdHJ1ZSwKKyAgICAgICAgdHJhbnNjbHVkZTogdHJ1ZSwKKyAgICAgICAgdGVtcGxhdGU6ICI8ZGl2IG5nLXRyYW5zY2x1ZGU+PC9kaXY+IiwKKyAgICAgICAgY29udHJvbGxlcjogW2Z1bmN0aW9uICgpIHsKKyAgICAgICAgICAgICAgICB2YXIgYm9keVNjb3BlID0gbnVsbDsKKyAgICAgICAgICAgICAgICB0aGlzLnNldFNjb3BlID0gZnVuY3Rpb24gKHNjb3BlKSB7CisgICAgICAgICAgICAgICAgICAgIGJvZHlTY29wZSA9IHNjb3BlOworICAgICAgICAgICAgICAgIH07CisgICAgICAgICAgICAgICAgdGhpcy50b2dnbGUgPSBmdW5jdGlvbiAoKSB7CisgICAgICAgICAgICAgICAgICAgIGJvZHlTY29wZS5pc09wZW4gPSAhYm9keVNjb3BlLmlzT3BlbjsKKyAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGJvZHlTY29wZS5pc09wZW47CisgICAgICAgICAgICAgICAgfTsKKyAgICAgICAgICAgIH1dLAorICAgICAgICBsa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9IGZhbHNlOworICAgICAgICAgICAgbXlDdHJsLnNldFNjb3BlKHNjb3BlKTsKKyAgICAgICAgfQorICAgIH07Cit9KS5kaXJlY3RpdmUoJ2V4cGFuZGVyVG9nZ2xlJywgZnVuY3Rpb24gKCkgeworICAgIHJldHVybnsKKyAgICAgICAgcmVzdHJpY3Q6ICdFQScsCisgICAgICAgIHJlcXVpcmU6ICJeZXhwYW5kZXJzIiwKKyAgICAgICAgc2NvcGU6IHsKKyAgICAgICAgICAgIGV4cGFuZEljb246ICdAJywKKyAgICAgICAgICAgIGNvbGxhcHNlSWNvbjogJ0AnCisgICAgICAgIH0sCisgICAgICAgIGxpbms6IGZ1bmN0aW9uIChzY29wZSwgZWxlbWVudCwgYXR0ciwgbXlDdHJsKQorICAgICAgICB7CisgICAgICAgICAgICB2YXIgaXNPcGVuID0gZmFsc2U7CisgICAgICAgICAgICB2YXIgc2V0SWNvbiA9IGZ1bmN0aW9uICgpIHsKKyAgICAgICAgICAgICAgICBpZiAoc2NvcGUuZXhwYW5kSWNvbiAmJiBzY29wZS5jb2xsYXBzZUljb24pCisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICBpZiAoaXNPcGVuKSB7CisgICAgICAgICAgICAgICAgICAgICAgICBlbGVtZW50LnJlbW92ZUNsYXNzKHNjb3BlLmV4cGFuZEljb24pOworICAgICAgICAgICAgICAgICAgICAgICAgZWxlbWVudC5hZGRDbGFzcyhzY29wZS5jb2xsYXBzZUljb24pOworICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgIGVsc2UgeworICAgICAgICAgICAgICAgICAgICAgICAgZWxlbWVudC5yZW1vdmVDbGFzcyhzY29wZS5jb2xsYXBzZUljb24pOworICAgICAgICAgICAgICAgICAgICAgICAgZWxlbWVudC5hZGRDbGFzcyhzY29wZS5leHBhbmRJY29uKTsKKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH07CisgICAgICAgICAgICBlbGVtZW50LmJpbmQoImtleWRvd24iLCBmdW5jdGlvbiAoZSkgeworICAgICAgICAgICAgICAgIGlmIChlLmtleUNvZGUgPT09IDEzKQorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgc2NvcGUudG9nZ2xlaXQoKTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9KTsKKyAgICAgICAgICAgIGVsZW1lbnQuYmluZCgnY2xpY2snLCBmdW5jdGlvbiAoKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIHNjb3BlLnRvZ2dsZWl0KCk7CisgICAgICAgICAgICB9KTsKKyAgICAgICAgICAgIHNjb3BlLnRvZ2dsZWl0ID0gZnVuY3Rpb24gKCkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBpc09wZW4gPSBteUN0cmwudG9nZ2xlKCk7CisgICAgICAgICAgICAgICAgc2V0SWNvbigpOworICAgICAgICAgICAgICAgIHNjb3BlLiRhcHBseSgpOworICAgICAgICAgICAgfTsKKyAgICAgICAgICAgIHNldEljb24oKTsKKyAgICAgICAgfQorICAgIH07Cit9KS5kaXJlY3RpdmUoJ2NvbGxhcHNlJywgWyckdHJhbnNpdGlvbicsIGZ1bmN0aW9uICgkdHJhbnNpdGlvbikgeworICAgICAgICAvLyBDU1MgdHJhbnNpdGlvbnMgZG9uJ3Qgd29yayB3aXRoIGhlaWdodDogYXV0bywgc28gd2UgaGF2ZSB0byBtYW51YWxseSBjaGFuZ2UgdGhlIGhlaWdodCB0byBhCisgICAgICAgIC8vIHNwZWNpZmljIHZhbHVlIGFuZCB0aGVuIG9uY2UgdGhlIGFuaW1hdGlvbiBjb21wbGV0ZXMsIHdlIGNhbiByZXNldCB0aGUgaGVpZ2h0IHRvIGF1dG8uCisgICAgICAgIC8vIFVuZm9ydHVuYXRlbHkgaWYgeW91IGRvIHRoaXMgd2hpbGUgdGhlIENTUyB0cmFuc2l0aW9ucyBhcmUgc3BlY2lmaWVkIChpLmUuIGluIHRoZSBDU1MgY2xhc3MKKyAgICAgICAgLy8gImNvbGxhcHNlIikgdGhlbiB5b3UgdHJpZ2dlciBhIGNoYW5nZSB0byBoZWlnaHQgMCBpbiBiZXR3ZWVuLgorICAgICAgICAvLyBUaGUgZml4IGlzIHRvIHJlbW92ZSB0aGUgImNvbGxhcHNlIiBDU1MgY2xhc3Mgd2hpbGUgY2hhbmdpbmcgdGhlIGhlaWdodCBiYWNrIHRvIGF1dG8gLSBwaGV3IQorICAgICAgICB2YXIgcHJvcHMgPSB7CisgICAgICAgICAgICBvcGVuOiB7CisgICAgICAgICAgICAgICAgbWFyZ2luVG9wOiBudWxsLAorICAgICAgICAgICAgICAgIG1hcmdpbkJvdHRvbTogbnVsbCwKKyAgICAgICAgICAgICAgICBwYWRkaW5nVG9wOiBudWxsLAorICAgICAgICAgICAgICAgIHBhZGRpbmdCb3R0b206IG51bGwsCisgICAgICAgICAgICAgICAgZGlzcGxheTogJ2Jsb2NrJworICAgICAgICAgICAgfSwKKyAgICAgICAgICAgIGNsb3NlZDogeworICAgICAgICAgICAgICAgIG1hcmdpblRvcDogMCwKKyAgICAgICAgICAgICAgICBtYXJnaW5Cb3R0b206IDAsCisgICAgICAgICAgICAgICAgcGFkZGluZ1RvcDogMCwKKyAgICAgICAgICAgICAgICBwYWRkaW5nQm90dG9tOiAwLAorICAgICAgICAgICAgICAgIGRpc3BsYXk6ICdub25lJworICAgICAgICAgICAgfQorICAgICAgICB9OworICAgICAgICB2YXIgZml4VXBIZWlnaHQgPSBmdW5jdGlvbiAoc2NvcGUsIGVsZW1lbnQsIGhlaWdodCkgeworICAgICAgICAgICAgLy8gV2UgcmVtb3ZlIHRoZSBjb2xsYXBzZSBDU1MgY2xhc3MgdG8gcHJldmVudCBhIHRyYW5zaXRpb24gd2hlbiB3ZSBjaGFuZ2UgdG8gaGVpZ2h0OiBhdXRvCisgICAgICAgICAgICBlbGVtZW50LnJlbW92ZUNsYXNzKCdjb2xsYXBzZScpOworICAgICAgICAgICAgZWxlbWVudC5jc3Moe2hlaWdodDogaGVpZ2h0fSk7CisgICAgICAgICAgICAvL2FkanVzdGluZyBmb3IgYW55IG1hcmdpbiBvciBwYWRkaW5nCisgICAgICAgICAgICBpZiAoaGVpZ2h0ID09PSAwKSB7CisgICAgICAgICAgICAgICAgZWxlbWVudC5jc3MocHJvcHMuY2xvc2VkKTsKKyAgICAgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICAgICAgZWxlbWVudC5jc3MocHJvcHMub3Blbik7CisgICAgICAgICAgICB9CisgICAgICAgICAgICAvLyBJdCBhcHBlYXJzIHRoYXQgIHJlYWRpbmcgb2Zmc2V0V2lkdGggbWFrZXMgdGhlIGJyb3dzZXIgcmVhbGlzZSB0aGF0IHdlIGhhdmUgY2hhbmdlZCB0aGUKKyAgICAgICAgICAgIC8vIGhlaWdodCBhbHJlYWR5IDotLworICAgICAgICAgICAgZWxlbWVudC5hZGRDbGFzcygnY29sbGFwc2UnKTsKKyAgICAgICAgfTsKKyAgICAgICAgcmV0dXJuIHsKKyAgICAgICAgICAgIGxpbms6IGZ1bmN0aW9uIChzY29wZSwgZWxlbWVudCwgYXR0cnMpIHsKKyAgICAgICAgICAgICAgICB2YXIgaXNDb2xsYXBzZWQ7CisgICAgICAgICAgICAgICAgdmFyIGluaXRpYWxBbmltU2tpcCA9IHRydWU7CisgICAgICAgICAgICAgICAgc2NvcGUuJHdhdGNoKGZ1bmN0aW9uICgpIHsKKyAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGVsZW1lbnRbMF0uc2Nyb2xsSGVpZ2h0OworICAgICAgICAgICAgICAgIH0sIGZ1bmN0aW9uICgpIHsKKyAgICAgICAgICAgICAgICAgICAgLy9UaGUgbGlzdGVuZXIgaXMgY2FsbGVkIHdoZW4gc2Nyb2xsSGVpZ2h0IGNoYW5nZXMKKyAgICAgICAgICAgICAgICAgICAgLy9JdCBhY3R1YWxseSBkb2VzIG9uIDIgc2NlbmFyaW9zOgorICAgICAgICAgICAgICAgICAgICAvLyAxLiBQYXJlbnQgaXMgc2V0IHRvIGRpc3BsYXkgbm9uZQorICAgICAgICAgICAgICAgICAgICAvLyAyLiBhbmd1bGFyIGJpbmRpbmdzIGluc2lkZSBhcmUgcmVzb2x2ZWQKKyAgICAgICAgICAgICAgICAgICAgLy9XaGVuIHdlIGhhdmUgYSBjaGFuZ2Ugb2Ygc2Nyb2xsSGVpZ2h0IHdlIGFyZSBzZXR0aW5nIGFnYWluIHRoZSBjb3JyZWN0IGhlaWdodCBpZiB0aGUgZ3JvdXAgaXMgb3BlbmVkCisgICAgICAgICAgICAgICAgICAgIGlmIChlbGVtZW50WzBdLnNjcm9sbEhlaWdodCAhPT0gMCAmJiAhaXNDb2xsYXBzZWQpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIGlmIChpbml0aWFsQW5pbVNraXApIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBmaXhVcEhlaWdodChzY29wZSwgZWxlbWVudCwgZWxlbWVudFswXS5zY3JvbGxIZWlnaHQgKyAncHgnKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgZml4VXBIZWlnaHQoc2NvcGUsIGVsZW1lbnQsICdhdXRvJyk7CisgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICB9KTsKKyAgICAgICAgICAgICAgICB2YXIgY3VycmVudFRyYW5zaXRpb247CisgICAgICAgICAgICAgICAgdmFyIGRvVHJhbnNpdGlvbiA9IGZ1bmN0aW9uIChjaGFuZ2UpIHsKKyAgICAgICAgICAgICAgICAgICAgaWYgKGN1cnJlbnRUcmFuc2l0aW9uKSB7CisgICAgICAgICAgICAgICAgICAgICAgICBjdXJyZW50VHJhbnNpdGlvbi5jYW5jZWwoKTsKKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICBjdXJyZW50VHJhbnNpdGlvbiA9ICR0cmFuc2l0aW9uKGVsZW1lbnQsIGNoYW5nZSk7CisgICAgICAgICAgICAgICAgICAgIGN1cnJlbnRUcmFuc2l0aW9uLnRoZW4oCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgZnVuY3Rpb24gKCkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjdXJyZW50VHJhbnNpdGlvbiA9IHVuZGVmaW5lZDsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB9LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZ1bmN0aW9uICgpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY3VycmVudFRyYW5zaXRpb24gPSB1bmRlZmluZWQ7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICApOworICAgICAgICAgICAgICAgICAgICByZXR1cm4gY3VycmVudFRyYW5zaXRpb247CisgICAgICAgICAgICAgICAgfTsKKyAgICAgICAgICAgICAgICB2YXIgZXhwYW5kID0gZnVuY3Rpb24gKCkgeworICAgICAgICAgICAgICAgICAgICBzY29wZS5wb3N0VHJhbnNpdGlvbiA9IHRydWU7CisgICAgICAgICAgICAgICAgICAgIGlmIChpbml0aWFsQW5pbVNraXApIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIGluaXRpYWxBbmltU2tpcCA9IGZhbHNlOworICAgICAgICAgICAgICAgICAgICAgICAgaWYgKCFpc0NvbGxhcHNlZCkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZpeFVwSGVpZ2h0KHNjb3BlLCBlbGVtZW50LCAnYXV0bycpOworICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgICAgICAgICAgICAgZG9UcmFuc2l0aW9uKGFuZ3VsYXIuZXh0ZW5kKHtoZWlnaHQ6IGVsZW1lbnRbMF0uc2Nyb2xsSGVpZ2h0ICsgJ3B4J30sIHByb3BzLm9wZW4pKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAudGhlbihmdW5jdGlvbiAoKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyBUaGlzIGNoZWNrIGVuc3VyZXMgdGhhdCB3ZSBkb24ndCBhY2NpZGVudGFsbHkgdXBkYXRlIHRoZSBoZWlnaHQgaWYgdGhlIHVzZXIgaGFzIGNsb3NlZAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gdGhlIGdyb3VwIHdoaWxlIHRoZSBhbmltYXRpb24gd2FzIHN0aWxsIHJ1bm5pbmcKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICghaXNDb2xsYXBzZWQpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZml4VXBIZWlnaHQoc2NvcGUsIGVsZW1lbnQsICdhdXRvJyk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0pOworICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgIGlzQ29sbGFwc2VkID0gZmFsc2U7CisgICAgICAgICAgICAgICAgfTsKKyAgICAgICAgICAgICAgICB2YXIgY29sbGFwc2UgPSBmdW5jdGlvbiAoKSB7CisgICAgICAgICAgICAgICAgICAgIGlzQ29sbGFwc2VkID0gdHJ1ZTsKKyAgICAgICAgICAgICAgICAgICAgaWYgKGluaXRpYWxBbmltU2tpcCkgeworICAgICAgICAgICAgICAgICAgICAgICAgaW5pdGlhbEFuaW1Ta2lwID0gZmFsc2U7CisgICAgICAgICAgICAgICAgICAgICAgICBmaXhVcEhlaWdodChzY29wZSwgZWxlbWVudCwgMCk7CisgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICAgICAgICAgICAgICBmaXhVcEhlaWdodChzY29wZSwgZWxlbWVudCwgZWxlbWVudFswXS5zY3JvbGxIZWlnaHQgKyAncHgnKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIGRvVHJhbnNpdGlvbihhbmd1bGFyLmV4dGVuZCh7aGVpZ2h0OiAwfSwgcHJvcHMuY2xvc2VkKSkudGhlbihmdW5jdGlvbiAoKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2NvcGUucG9zdFRyYW5zaXRpb24gPSBmYWxzZTsKKyAgICAgICAgICAgICAgICAgICAgICAgIH0pOworICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgfTsKKyAgICAgICAgICAgICAgICBzY29wZS4kd2F0Y2goYXR0cnMuY29sbGFwc2UsIGZ1bmN0aW9uICh2YWx1ZSkgeworICAgICAgICAgICAgICAgICAgICBpZiAodmFsdWUpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIGNvbGxhcHNlKCk7CisgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICAgICAgICAgICAgICBleHBhbmQoKTsKKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIH0pOworICAgICAgICAgICAgfQorICAgICAgICB9OworICAgIH1dKQorICAgICAgICAuZGlyZWN0aXZlKCdhdHRBY2NvcmQnLCBmdW5jdGlvbiAoKSB7CisgICAgICAgICAgICByZXR1cm4geworICAgICAgICAgICAgICAgIHJlc3RyaWN0OiAnRUEnLAorICAgICAgICAgICAgICAgIHRyYW5zY2x1ZGU6IHRydWUsCisgICAgICAgICAgICAgICAgcmVwbGFjZTogdHJ1ZSwKKyAgICAgICAgICAgICAgICBzY29wZToge30sCisgICAgICAgICAgICAgICAgY29udHJvbGxlcjogJ0F0dEFjY29yZEN0cmwnLAorICAgICAgICAgICAgICAgIHRlbXBsYXRlVXJsOiAnYXBwL3NjcmlwdHMvbmdfanNfYXR0X3RwbHMvYWNjb3JkaW9uL2F0dEFjY29yZEhlYWRlci5odG1sJworICAgICAgICAgICAgfTsKKyAgICAgICAgfSkKKyAgICAgICAgLmNvbnRyb2xsZXIoJ0F0dEFjY29yZEN0cmwnLCBbZnVuY3Rpb24gKCkgeworICAgICAgICAgICAgICAgIHRoaXMudHlwZSA9ICdhdHRBY2NvcmQnOworICAgICAgICAgICAgICAgIHRoaXMuaGVhZGVyQ3RybDsKKyAgICAgICAgICAgICAgICB0aGlzLmJvZHlDdHJsOworICAgICAgICAgICAgICAgIHZhciBpc09wZW4gPSB0cnVlOworICAgICAgICAgICAgICAgIHRoaXMudG9nZ2xlQm9keSA9IGZ1bmN0aW9uICgpIHsKKyAgICAgICAgICAgICAgICAgICAgaWYgKGlzT3BlbikgeworICAgICAgICAgICAgICAgICAgICAgICAgdGhpcy5leHBhbmRCb2R5KCk7CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgZWxzZSB7CisgICAgICAgICAgICAgICAgICAgICAgICB0aGlzLmNvbGxhcHNlQm9keSgpOworICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgIGlzT3BlbiA9ICFpc09wZW47CisgICAgICAgICAgICAgICAgfTsKKyAgICAgICAgICAgICAgICB0aGlzLmV4cGFuZEJvZHkgPSBmdW5jdGlvbiAoKSB7CisgICAgICAgICAgICAgICAgICAgIHRoaXMuYm9keUN0cmwuZXhwYW5kKCk7CisgICAgICAgICAgICAgICAgfTsKKyAgICAgICAgICAgICAgICB0aGlzLmNvbGxhcHNlQm9keSA9IGZ1bmN0aW9uICgpIHsKKyAgICAgICAgICAgICAgICAgICAgdGhpcy5ib2R5Q3RybC5jb2xsYXBzZSgpOworICAgICAgICAgICAgICAgIH07CisgICAgICAgICAgICB9XSkKKyAgICAgICAgLmNvbnRyb2xsZXIoJ0F0dEFjY29yZEhlYWRlckN0cmwnLCBbZnVuY3Rpb24gKCkgeworICAgICAgICAgICAgICAgIHRoaXMudHlwZSA9ICdoZWFkZXInOworICAgICAgICAgICAgfV0pCisgICAgICAgIC5kaXJlY3RpdmUoJ2F0dEFjY29yZEhlYWRlcicsIGZ1bmN0aW9uICgpIHsKKyAgICAgICAgICAgIHJldHVybiB7CisgICAgICAgICAgICAgICAgcmVzdHJpY3Q6ICdFQScsCisgICAgICAgICAgICAgICAgdHJhbnNjbHVkZTogdHJ1ZSwKKyAgICAgICAgICAgICAgICByZXBsYWNlOiB0cnVlLAorICAgICAgICAgICAgICAgIHJlcXVpcmU6IFsnXmF0dEFjY29yZCcsICdhdHRBY2NvcmRIZWFkZXInXSwKKyAgICAgICAgICAgICAgICBjb250cm9sbGVyOiAnQXR0QWNjb3JkSGVhZGVyQ3RybCcsCisgICAgICAgICAgICAgICAgdGVtcGxhdGVVcmw6ICdhcHAvc2NyaXB0cy9uZ19qc19hdHRfdHBscy9hY2NvcmRpb24vYXR0QWNjb3JkSGVhZGVyLmh0bWwnLAorICAgICAgICAgICAgICAgIGxpbms6IGZ1bmN0aW9uIChzY29wZSwgZWxlbWVudCwgYXR0ciwgY3RybHMpIHsKKyAgICAgICAgICAgICAgICAgICAgdmFyIGF0dEFjY29yZEN0cmwgPSBjdHJsc1swXTsKKyAgICAgICAgICAgICAgICAgICAgdmFyIGF0dEFjY29yZEhlYWRlckN0cmwgPSBjdHJsc1sxXTsKKyAgICAgICAgICAgICAgICAgICAgYXR0QWNjb3JkQ3RybC5oZWFkZXJDdHJsID0gYXR0QWNjb3JkSGVhZGVyQ3RybDsKKyAgICAgICAgICAgICAgICAgICAgc2NvcGUuY2xpY2tGdW5jID0gZnVuY3Rpb24gKCkgeworICAgICAgICAgICAgICAgICAgICAgICAgYXR0QWNjb3JkQ3RybC50b2dnbGVCb2R5KCk7CisgICAgICAgICAgICAgICAgICAgIH07CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfTsKKyAgICAgICAgfSkKKyAgICAgICAgLmNvbnRyb2xsZXIoJ0F0dEFjY29yZEJvZHlDdHJsJywgWyckc2NvcGUnLCBmdW5jdGlvbiAoJHNjb3BlKSB7CisgICAgICAgICAgICAgICAgdGhpcy50eXBlID0gJ2JvZHknOworICAgICAgICAgICAgICAgIHRoaXMuZXhwYW5kID0gZnVuY3Rpb24gKCkgeworICAgICAgICAgICAgICAgICAgICAkc2NvcGUuZXhwYW5kKCk7CisgICAgICAgICAgICAgICAgfTsKKyAgICAgICAgICAgICAgICB0aGlzLmNvbGxhcHNlID0gZnVuY3Rpb24gKCkgeworICAgICAgICAgICAgICAgICAgICAkc2NvcGUuY29sbGFwc2UoKTsKKyAgICAgICAgICAgICAgICB9OworICAgICAgICAgICAgfV0pCisgICAgICAgIC5kaXJlY3RpdmUoJ2F0dEFjY29yZEJvZHknLCBbJyR0aW1lb3V0JywgJyRoZWlnaHQnLCBmdW5jdGlvbiAoJHRpbWVvdXQsICRoZWlnaHQpIHsKKyAgICAgICAgICAgICAgICByZXR1cm4geworICAgICAgICAgICAgICAgICAgICByZXN0cmljdDogJ0VBJywKKyAgICAgICAgICAgICAgICAgICAgdHJhbnNjbHVkZTogdHJ1ZSwKKyAgICAgICAgICAgICAgICAgICAgcmVwbGFjZTogdHJ1ZSwKKyAgICAgICAgICAgICAgICAgICAgcmVxdWlyZTogWydeYXR0QWNjb3JkJywgJ2F0dEFjY29yZEJvZHknXSwKKyAgICAgICAgICAgICAgICAgICAgY29udHJvbGxlcjogJ0F0dEFjY29yZEJvZHlDdHJsJywKKyAgICAgICAgICAgICAgICAgICAgdGVtcGxhdGVVcmw6ICdhcHAvc2NyaXB0cy9uZ19qc19hdHRfdHBscy9hY2NvcmRpb24vYXR0QWNjb3JkQm9keS5odG1sJywKKyAgICAgICAgICAgICAgICAgICAgbGluazogZnVuY3Rpb24gKHNjb3BlLCBlbGVtZW50LCBhdHRyLCBjdHJscykgeworICAgICAgICAgICAgICAgICAgICAgICAgdmFyIGF0dEFjY29yZEN0cmwgPSBjdHJsc1swXTsKKyAgICAgICAgICAgICAgICAgICAgICAgIHZhciBhdHRBY2NvcmRCb2R5Q3RybCA9IGN0cmxzWzFdOworICAgICAgICAgICAgICAgICAgICAgICAgYXR0QWNjb3JkQ3RybC5ib2R5Q3RybCA9IGF0dEFjY29yZEJvZHlDdHJsOworICAgICAgICAgICAgICAgICAgICAgICAgdmFyIG9yaWdpbmFsSGVpZ2h0OworICAgICAgICAgICAgICAgICAgICAgICAgJHRpbWVvdXQoZnVuY3Rpb24gKCkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgIG9yaWdpbmFsSGVpZ2h0ID0gZWxlbWVudFswXS5vZmZzZXRIZWlnaHQ7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgJGhlaWdodChlbGVtZW50LCAwLCAwLCAwKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIH0pOworICAgICAgICAgICAgICAgICAgICAgICAgc2NvcGUuZXhwYW5kID0gZnVuY3Rpb24gKCkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICRoZWlnaHQoZWxlbWVudCwgMC4wNSwgb3JpZ2luYWxIZWlnaHQsIDEpOworICAgICAgICAgICAgICAgICAgICAgICAgfTsKKyAgICAgICAgICAgICAgICAgICAgICAgIHNjb3BlLmNvbGxhcHNlID0gZnVuY3Rpb24gKCkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICRoZWlnaHQoZWxlbWVudCwgMC4yNSwgMCwgMCk7CisgICAgICAgICAgICAgICAgICAgICAgICB9OworICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgfTsKKyAgICAgICAgICAgIH1dKTsKK2FuZ3VsYXIubW9kdWxlKCdhdHQuYWJzLmFsZXJ0JywgW10pCisuZGlyZWN0aXZlKCdhdHRBbGVydCcsIFtmdW5jdGlvbigpCit7CisgICAgcmV0dXJuIHsKKyAgICAgICAgcmVzdHJpY3Q6J0VBJywKKyAgICAgICAgcmVwbGFjZSA6IHRydWUsCisgICAgICAgIHRyYW5zY2x1ZGUgOiB0cnVlLAorICAgICAgICBzY29wZTogeworICAgICAgICAgICAgYWxlcnRUeXBlIDogIkB0eXBlIiwKKyAgICAgICAgICAgIHNob3dUb3AgOiAiQHRvcFBvcyIsCisgICAgICAgICAgICBzaG93QWxlcnQgOiAiPSIKKyAgICAgICAgfSwKKyAgICAgICB0ZW1wbGF0ZVVybCA6ICdhcHAvc2NyaXB0cy9uZ19qc19hdHRfdHBscy9hbGVydC9hbGVydC5odG1sJywKKyAgICAgICBsaW5rOiBmdW5jdGlvbihzY29wZSkKKyAgICAgICAgeworICAgICAgICAgICAgaWYoc2NvcGUuc2hvd1RvcCA9PT0gJ3RydWUnKXsKKyAgICAgICAgICAgICAgICBzY29wZS5jc3NTdHlsZSA9IHsndG9wJzonNTBweCd9OworICAgICAgICAgICAgfQorICAgICAgICAgICAgZWxzZXsKKyAgICAgICAgICAgICAgIHNjb3BlLmNzc1N0eWxlID0geyd0b3AnOicwcHgnfTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgc2NvcGUuY2xvc2UgPSBmdW5jdGlvbigpeworICAgICAgICAgICAgICAgc2NvcGUuc2hvd0FsZXJ0ID0gZmFsc2U7CisgICAgICAgICAgICB9OworICAgICAgICB9CisgICAgfTsKK31dKTsKKworYW5ndWxhci5tb2R1bGUoJ2F0dC5hYnMuYnJlYWRDcnVtYnMnLCBbXSkKKyAgICAuY29uc3RhbnQoImNsYXNzQ29uc3RhbnQiLHsKKyAgICAgICAgICAgICJkZWZhdWx0Q2xhc3MiIDogImJyZWFkY3J1bWJzX19saW5rIiwKKyAgICAgICAgICAgICJhY3RpdmVDbGFzcyI6ICJicmVhZGNydW1ic19fbGluay0tYWN0aXZlIgorICAgICAgICB9KQorICAgIC5kaXJlY3RpdmUoJ2F0dENydW1iJywgWydjbGFzc0NvbnN0YW50JywgZnVuY3Rpb24oY2xhc3NDb25zdGFudCkgeworICAgICAgICByZXR1cm4geworICAgICAgICAgICAgcmVzdHJpY3Q6ICdBJywKKyAgICAgICAgICAgIGxpbms6IGZ1bmN0aW9uKHNjb3BlLCBlbGVtLCBhdHRyKS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Z2knKSwgJzxzcGFuIGNsYXNzPVwiJyArIGNsYXNzTmFtZSArICdcIj4kJjwvc3Bhbj4nKSA6IG1hdGNoSXRlbTsKKyAgICB9OworfSkKKworLmZpbHRlcignYXR0TGltaXRUbycsIGZ1bmN0aW9uKCkgeworICAgIHJldHVybiBmdW5jdGlvbihhY3R1YWxBcnJheSwgX2xpbWl0LCBfYmVnaW4pIHsKKyAgICAgICAgdmFyIGZpbmFsQXJyYXkgPSBbXTsKKyAgICAgICAgdmFyIGxpbWl0ID0gX2xpbWl0OworICAgICAgICB2YXIgYmVnaW4gPSBfYmVnaW47CisgICAgICAgIGlmKGlzTmFOKGJlZ2luKSkgeworICAgICAgICAgICAgYmVnaW4gPSAwOworICAgICAgICB9CisgICAgICAgIGlmKGFjdHVhbEFycmF5ICYmICFpc05hTihsaW1pdCkpIHsKKyAgICAgICAgICAgIGZpbmFsQXJyYXkgPSBhY3R1YWxBcnJheS5zbGljZShiZWdpbiwgYmVnaW4rbGltaXQpOworICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgZmluYWxBcnJheSA9IGFjdHVhbEFycmF5OworICAgICAgICB9CisgICAgICAgIHJldHVybiBmaW5hbEFycmF5OworICAgIH07Cit9KQorCisuZmlsdGVyKCdzdGFydHNXaXRoJywgZnVuY3Rpb24oKSB7CisgICAgaWYgKHR5cGVvZiBTdHJpbmcucHJvdG90eXBlLnN0YXJ0c1dpdGggIT09ICdmdW5jdGlvbicpIHsKKyAgICAgICAgLy8gc2VlIGJlbG93IGZvciBiZXR0ZXIgaW1wbGVtZW50YXRpb24hCisgICAgICAgIFN0cmluZy5wcm90b3R5cGUuc3RhcnRzV2l0aCA9IGZ1bmN0aW9uIChzdHIpeworICAgICAgICAgICAgcmV0dXJuIHRoaXMuaW5kZXhPZihzdHIpID09PSAwOworICAgICAgICB9OworICAgIH0KKworICAgIHJldHVybiBmdW5jdGlvbihpdGVtcywgc2VhcmNoU3RyaW5nKSB7CisgICAgICAgIGlmIChzZWFyY2hTdHJpbmcgPT09IHVuZGVmaW5lZCB8fCBzZWFyY2hTdHJpbmcgPT09ICIiKSB7CisgICAgICAgICAgICByZXR1cm4gaXRlbXM7CisgICAgICAgIH0KKworICAgICAgICB2YXIgZmlsdGVyZWQgPSBbXTsKKyAgICAgICAgYW5ndWxhci5mb3JFYWNoKGl0ZW1zLCBmdW5jdGlvbihpdGVtKSB7CisgICAgICAgICAgICBpZiAoaXRlbS50aXRsZS50b0xvd2VyQ2FzZSgpLnN0YXJ0c1dpdGgoc2VhcmNoU3RyaW5nLnRvTG93ZXJDYXNlKCkpKSB7CisgICAgICAgICAgICAgICAgZmlsdGVyZWQucHVzaChpdGVtKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfSk7CisgICAgICAgIHJldHVybiBmaWx0ZXJlZDsKKyAgICB9OworfSkKKworLmRpcmVjdGl2ZSgnYXR0SW5wdXREZW55JywgW2Z1bmN0aW9uKCkgeworICAgIHJldHVybiB7CisgICAgICAgIHJlc3RyaWN0OiAnQScsCisgICAgICAgIHJlcXVpcmU6ICduZ01vZGVsJywKKyAgICAgICAgbGluazogZnVuY3Rpb24gKHNjb3BlLCBlbGVtLCBhdHRyLCBjdHJsKSB7CisgICAgICAgICAgICB2YXIgcmVnZXhFeHByZXNzaW9uID0gbnVsbDsKKyAgICAgICAgICAgIGF0dHIuJG9ic2VydmUoJ2F0dElucHV0RGVueScsIGZ1bmN0aW9uICh2YWx1ZSkgeworICAgICAgICAgICAgICAgIGlmICh2YWx1ZSkgeworICAgICAgICAgICAgICAgICAgICByZWdleEV4cHJlc3Npb24gPSBuZXcgUmVnRXhwKHZhbHVlLCAnZycpOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0pOworICAgICAgICAgICAgZWxlbS5iaW5kKCdpbnB1dCcsIGZ1bmN0aW9uICgpIHsKKyAgICAgICAgICAgICAgICB2YXIgaW5wdXRTdHJpbmcgPSBjdHJsLiR2aWV3VmFsdWUgJiYgY3RybC4kdmlld1ZhbHVlLnJlcGxhY2UocmVnZXhFeHByZXNzaW9uLCAnJyk7CisgICAgICAgICAgICAgICAgaWYgKGlucHV0U3RyaW5nICE9PSBjdHJsLiR2aWV3VmFsdWUpIHsKKyAgICAgICAgICAgICAgICAgICAgY3RybC4kc2V0Vmlld1ZhbHVlKGlucHV0U3RyaW5nKTsKKyAgICAgICAgICAgICAgICAgICAgY3RybC4kcmVuZGVyKCk7CisgICAgICAgICAgICAgICAgICAgIHNjb3BlLiRhcHBseSgpOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0pOworICAgICAgICB9CisgICAgfTsKK31dKQorCisuZGlyZWN0aXZlKCdhdHRBY2Nlc3NpYmlsaXR5Q2xpY2snLCBbZnVuY3Rpb24oKSB7CisgICAgcmV0dXJuIHsKKyAgICAgICAgcmVzdHJpY3Q6ICdBJywKKyAgICAgICAgbGluazogZnVuY3Rpb24gKHNjb3BlLCBlbGVtLCBhdHRyKSB7CisgICAgICAgICAgICB2YXIga2V5Q29kZSA9IFtdOworICAgICAgICAgICAgYXR0ci4kb2JzZXJ2ZSgnYXR0QWNjZXNzaWJpbGl0eUNsaWNrJywgZnVuY3Rpb24gKHZhbHVlKSB7CisgICAgICAgICAgICAgICAgaWYgKHZhbHVlKSB7CisgICAgICAgICAgICAgICAgICAgIGtleUNvZGUgPSB2YWx1ZS5zcGxpdCgnLCcpOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0pOworICAgICAgICAgICAgZWxlbS5iaW5kKCdrZXlkb3duJywgZnVuY3Rpb24gKGV2KSB7CisgICAgICAgICAgICAgICAgdmFyIGtleUNvZGVDb25kaXRpb24gPSBmdW5jdGlvbigpeworICAgICAgICAgICAgICAgICAgICB2YXIgZmxhZyA9IGZhbHNlOworICAgICAgICAgICAgICAgICAgICBpZighKGV2LmtleUNvZGUpKXsKKyAgICAgICAgICAgICAgICAgICAgICAgIGlmKGV2LndoaWNoKXsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBldi5rZXlDb2RlID0gZXYud2hpY2g7CisgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICBlbHNlIGlmKGV2LmNoYXJDb2RlKXsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBldi5rZXlDb2RlID0gZXYuY2hhckNvZGU7CisgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgaWYoKGV2LmtleUNvZGUgJiYga2V5Q29kZS5pbmRleE9mKGV2LmtleUNvZGUudG9TdHJpbmcoKSkgPiAtMSkpeworICAgICAgICAgICAgICAgICAgICAgICAgZmxhZyA9IHRydWU7CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGZsYWc7CisgICAgICAgICAgICAgICAgfTsKKyAgICAgICAgICAgICAgICBpZihrZXlDb2RlLmxlbmd0aCA+IDAgJiYga2V5Q29kZUNvbmRpdGlvbigpKSB7CisgICAgICAgICAgICAgICAgICAgIGVsZW1bMF0uY2xpY2soKTsKKyAgICAgICAgICAgICAgICAgICAgZXYucHJldmVudERlZmF1bHQoKTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9KTsKKyAgICAgICAgfQorICAgIH07Cit9XSkuZGlyZWN0aXZlKCdhdHRFbGVtZW50Rm9jdXMnLCBbZnVuY3Rpb24oKSB7CisgICAgcmV0dXJuIHsKKyAgICAgICAgcmVzdHJpY3Q6ICdBJywKKyAgICAgICAgbGluazogZnVuY3Rpb24oc2NvcGUsIGVsZW0sIGF0dHIpIHsKKyAgICAgICAgICAgIHNjb3BlLiR3YXRjaChhdHRyLmF0dEVsZW1lbnRGb2N1cywgZnVuY3Rpb24gKHZhbHVlKSB7CisgICAgICAgICAgICAgICAgaWYgKHZhbHVlKSB7CisgICAgICAgICAgICAgICAgICAgIGVsZW1bMF0uZm9jdXMoKTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9KTsKKyAgICAgICAgfQorICAgIH07Cit9XSkKKworLmZhY3RvcnkoJ2V2ZW50cycsIGZ1bmN0aW9uKCl7CisgICAgdmFyIHMgPSAgZnVuY3Rpb24oZSl7CisgICAgICAgIGlmKGUuc3RvcFByb3BhZ2F0aW9uKSB7CisgICAgICAgICAgICBlLnN0b3BQcm9wYWdhdGlvbigpOworICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgZS5yZXR1cm5WYWx1ZSA9IGZhbHNlOworICAgICAgICB9CisgICAgfTsKKyAgICByZXR1cm4geworICAgICAgICBzdG9wUHJvcGFnYXRpb246IHMKKyAgICB9OworfSkKKworLmZhY3RvcnkoJyRkb2N1bWVudEJpbmQnLCBbJyRkb2N1bWVudCcsICckdGltZW91dCcsIGZ1bmN0aW9uKCRkb2N1bWVudCwgJHRpbWVvdXQpIHsKKyAgICB2YXIgX2NsaWNrID0gZnVuY3Rpb24gKGZsYWcsIGNhbGxiYWNrRnVuYywgc2NvcGUpIHsKKyAgICAgICAgc2NvcGUuJHdhdGNoKGZsYWcsIGZ1bmN0aW9uICh2YWwpIHsKKyAgICAgICAgICAgICR0aW1lb3V0KGZ1bmN0aW9uICgpIHsKKyAgICAgICAgICAgICAgICBpZiAodmFsKSB7CisgICAgICAgICAgICAgICAgICAgICRkb2N1bWVudC5iaW5kKCdjbGljaycsIGNhbGxiYWNrRnVuYyk7CisgICAgICAgICAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgICAgICAgICAgJGRvY3VtZW50LnVuYmluZCgnY2xpY2snLCBjYWxsYmFja0Z1bmMpOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0pOworICAgICAgICB9KTsKKyAgICB9OworCisgICAgcmV0dXJuIHsKKyAgICAgICAgY2xpY2s6IF9jbGljaworICAgIH07Cit9XSkKKworLmZhY3RvcnkoJ2tleW1hcCcsIGZ1bmN0aW9uKCl7ICAgICAgICAKKyAgICByZXR1cm4geyAgICAgICAKKy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OiAiXFwiICwgMjIxIDogIl0iICwgMjIyIDogIiciCisgICAgICAgIH0sCisgICAgICAgIGlzQ29udHJvbDogZnVuY3Rpb24gKGUpIHsKKyAgICAgICAgICAgIHZhciBrID0gZS5rZXlDb2RlOworICAgICAgICAgICAgc3dpdGNoIChrKSB7CisgICAgICAgICAgICBjYXNlIHRoaXMuS0VZLkNPTU1BTkQ6CisgICAgICAgICAgICBjYXNlIHRoaXMuS0VZLlNISUZUOgorICAgICAgICAgICAgY2FzZSB0aGlzLktFWS5DVFJMOgorICAgICAgICAgICAgY2FzZSB0aGlzLktFWS5BTFQ6CisgICAgICAgICAgICAgICAgcmV0dXJuIHRydWU7CisgICAgICAgICAgICBkZWZhdWx0OjsKKyAgICAgICAgICAgIH0KKworICAgICAgICAgICAgaWYgKGUubWV0YUtleSkgeworICAgICAgICAgICAgICAgIHJldHVybiB0cnVlOworICAgICAgICAgICAgfQorCisgICAgICAgICAgICByZXR1cm4gZmFsc2U7CisgICAgICAgIH0sCisgICAgICAgIGlzRnVuY3Rpb25LZXk6IGZ1bmN0aW9uIChrKSB7CisgICAgICAgICAgICBrID0gay5rZXlDb2RlID8gay5rZXlDb2RlIDogazsKKyAgICAgICAgICAgIHJldHVybiBrID49IDExMiAmJiBrIDw9IDEyMzsKKyAgICAgICAgfSwKKyAgICAgICAgaXNWZXJ0aWNhbE1vdmVtZW50OiBmdW5jdGlvbiAoayl7CisgICAgICAgICAgcmV0dXJuIH5bdGhpcy5LRVkuVVAsIHRoaXMuS0VZLkRPV05dLmluZGV4T2Yoayk7CisgICAgICAgIH0sCisgICAgICAgIGlzSG9yaXpvbnRhbE1vdmVtZW50OiBmdW5jdGlvbiAoayl7CisgICAgICAgICAgcmV0dXJuIH5bdGhpcy5LRVkuTEVGVCwgdGhpcy5LRVkuUklHSFQsIHRoaXMuS0VZLkJBQ0tTUEFDRSwgdGhpcy5LRVkuREVMRVRFXS5pbmRleE9mKGspOworICAgICAgICB9LAorICAgICAgICBpc0FsbG93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bFN0cmluZyB8fCAnJzsKKyAgICAgICAgd2lkdGggPSAoIWlzTmFOKHdpZHRoKSAmJiB3aWR0aCkgfHwgMDsKKyAgICAgICAgY2hhcmFjdGVyID0gY2hhcmFjdGVyIHx8ICcnOworICAgICAgICBkaXJlY3Rpb24gPSAoZGlyZWN0aW9uICE9PSB1bmRlZmluZWQgJiYgZGlyZWN0aW9uKSB8fCB0cnVlOworICAgICAgICBpZiAod2lkdGggPiBhY3R1YWxTdHJpbmcubGVuZ3RoKSB7CisgICAgICAgICAgICBpZiAoZGlyZWN0aW9uKSB7CisgICAgICAgICAgICAgICAgcmV0dXJuIGNvbmNhdChjaGFyYWN0ZXIsICh3aWR0aCAtIGFjdHVhbFN0cmluZy5sZW5ndGgpKSArIGFjdHVhbFN0cmluZzsKKyAgICAgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICAgICAgcmV0dXJuIGFjdHVhbFN0cmluZyArIGNvbmNhdChjaGFyYWN0ZXIsICh3aWR0aCAtIGFjdHVhbFN0cmluZy5sZW5ndGgpKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgICAgICByZXR1cm4gYWN0dWFsU3RyaW5nOworICAgIH07CisKKyAgICBTdHJpbmcucHJvdG90eXBlLmxQYWQgPSBmdW5jdGlvbiAod2lkdGgsIGNoYXJhY3RlcikgeworICAgICAgICByZXR1cm4gcGFkKHRoaXMsIHdpZHRoLCBjaGFyYWN0ZXIsIHRydWUpOworICAgIH07CisKKyAgICBTdHJpbmcucHJvdG90eXBlLnJQYWQgPSBmdW5jdGlvbiAod2lkdGgsIGNoYXJhY3RlcikgeworICAgICAgICByZXR1cm4gcGFkKHRoaXMsIHdpZHRoLCBjaGFyYWN0ZXIsIGZhbHNlKTsKKyAgICB9OworCisgICAgaWYgKCFBcnJheS5wcm90b3R5cGUuaW5kZXhPZikgeworICAgICAgICBBcnJheS5wcm90b3R5cGUuaW5kZXhPZiA9IGZ1bmN0aW9uICh2YWwpIHsKKyAgICAgICAgICAgIGZvciAodmFyIGluZGV4ID0gMDsgaW5kZXggPCB0aGlzLmxlbmd0aDsgaW5kZXgrKykgeworICAgICAgICAgICAgICAgIGlmICh0aGlzW2luZGV4XSA9PT0gdmFsKSB7CisgICAgICAgICAgICAgICAgICAgIHJldHVybiBpbmRleDsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9CisgICAgICAgICAgICByZXR1cm4gLTE7CisgICAgICAgIH07CisgICAgfQorfSkoKTsKKworYW5ndWxhci5tb2R1bGUoJ2F0dC5hYnMuYnV0dG9ucycsIFsnYXR0LmFicy5wb3NpdGlvbicsICdhdHQuYWJzLnV0aWxpdGllcyddKQorICAgICAgICAuY29uc3RhbnQoJ2J0bkNvbmZpZycsIHsKKyAgICAgICAgICAgIGJ0bkNsYXNzOiAnYnV0dG9uJywKKyAgICAgICAgICAgIGJ0blByaW1hcnlDbGFzczogJ2J1dHRvbi0tcHJpbWFyeScsCisgICAgICAgICAgICBidG5TZWNvbmRhcnlDbGFzczogJ2J1dHRvbi0tc2Vjb25kYXJ5JywKKyAgICAgICAgICAgIGJ0bkRpc2FibGVkQ2xhc3M6ICdidXR0b24tLWluYWN0aXZlJywKKyAgICAgICAgICAgIGJ0blNtYWxsQ2xhc3M6ICdidXR0b24tLXNtYWxsJworICAgICAgICB9KQorICAgICAgICAuZGlyZWN0aXZlKCdhdHRCdXR0b24nLCBbJ2J0bkNvbmZpZycsIGZ1bmN0aW9uIChidG5Db25maWcpIHsKKyAgICAgICAgICAgICAgICByZXR1cm4geworICAgICAgICAgICAgICAgICAgICByZXN0cmljdDogJ0EnLAorICAgICAgICAgICAgICAgICAgICBsaW5rOiBmdW5jdGlvbiAoc2NvcGUsIGVsZW1lbnQsIGF0dHJzKSB7CisgICAgICAgICAgICAgICAgICAgICAgICBlbGVtZW50LmFkZENsYXNzKGJ0bkNvbmZpZy5idG5DbGFzcyk7CisgICAgICAgICAgICAgICAgICAgICAgICBpZiAoYXR0cnMuc2l6ZSA9PT0gJ3NtYWxsJykgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGVsZW1lbnQuYWRkQ2xhc3MoYnRuQ29uZmlnLmJ0blNtYWxsQ2xhc3MpOworICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgYXR0cnMuJG9ic2VydmUoJ2J0blR5cGUnLCBmdW5jdGlvbiAodmFsdWUpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAodmFsdWUgPT09ICdwcmltYXJ5JykgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBlbGVtZW50LmFkZENsYXNzKGJ0bkNvbmZpZy5idG5QcmltYXJ5Q2xhc3MpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBlbGVtZW50LnJlbW92ZUNsYXNzKGJ0bkNvbmZpZy5idG5TZWNvbmRhcnlDbGFzcyk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGVsZW1lbnQucmVtb3ZlQ2xhc3MoYnRuQ29uZmlnLmJ0bkRpc2FibGVkQ2xhc3MpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBlbGVtZW50LnJlbW92ZUF0dHIoJ2Rpc2FibGVkJyk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIGlmICh2YWx1ZSA9PT0gJ3NlY29uZGFyeScpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZWxlbWVudC5hZGRDbGFzcyhidG5Db25maWcuYnRuU2Vjb25kYXJ5Q2xhc3MpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBlbGVtZW50LnJlbW92ZUNsYXNzKGJ0bkNvbmZpZy5idG5QcmltYXJ5Q2xhc3MpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBlbGVtZW50LnJlbW92ZUNsYXNzKGJ0bkNvbmZpZy5idG5EaXNhYmxlZENsYXNzKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZWxlbWVudC5yZW1vdmVBdHRyKCdkaXNhYmxlZCcpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAodmFsdWUgPT09ICdkaXNhYmxlZCcpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZWxlbWVudC5hZGRDbGFzcyhidG5Db25maWcuYnRuRGlzYWJsZWRDbGFzcyk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGVsZW1lbnQucmVtb3ZlQ2xhc3MoYnRuQ29uZmlnLmJ0blByaW1hcnlDbGFzcyk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGVsZW1lbnQucmVtb3ZlQ2xhc3MoYnRuQ29uZmlnLmJ0blNlY29uZGFyeUNsYXNzKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZWxlbWVudC5hdHRyKCdkaXNhYmxlZCcsICdkaXNhYmxlZCcpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgIH0pOworICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgfTsKKyAgICAgICAgICAgIH1dKQorICAgICAgICAuZGlyZWN0aXZlKCdhdHRCdXR0b25Mb2FkZXInLCBbZnVuY3Rpb24gKCkgeworICAgICAgICAgICAgICAgIHJldHVybiB7CisgICAgICAgICAgICAgICAgICAgIHJlc3RyaWN0OiAnQScsCisgICAgICAgICAgICAgICAgICAgIHJlcGxhY2U6IGZhbHNlLAorICAgICAgICAgICAgICAgICAgICBzY29wZTogeworICAgICAgICAgICAgICAgICAgICAgICAgc2l6ZTogJ0AnCisgICAgICAgICAgICAgICAgICAgIH0sCisgICAgICAgICAgICAgICAgICAgIHRlbXBsYXRlOiAnPGRpdiBuZy1jbGFzcz0ie1wnYnV0dG9uLS1sb2FkaW5nXCc6IHNpemUgPT09IFwnbGFyZ2VcJyxcJ2J1dHRvbi0tbG9hZGluZ19fc21hbGxcJzogc2l6ZSA9PT0gXCdzbWFsbFwnfSI+PGk+PC9pPjxpPjwvaT48aT48L2k+PC9kaXY+JywKKyAgICAgICAgICAgICAgICAgICAgbGluazogZnVuY3Rpb24gKHNjb3BlLCBlbGVtZW50KSB7CisgICAgICAgICAgICAgICAgICAgICAgICBlbGVtZW50LmFkZENsYXNzKCdidXR0b24gYnV0dG9uLS1pbmFjdGl2ZScpOworICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgfTsKKyAgICAgICAgICAgIH1dKQorICAgICAgICAuZGlyZWN0aXZlKCdhdHRCdXR0b25IZXJvJywgW2Z1bmN0aW9uICgpIHsKKyAgICAgICAgICAgICAgICByZXR1cm4geworICAgICAgICAgICAgICAgICAgICByZXN0cmljdDogJ0EnLAorICAgICAgICAgICAgICAgICAgICByZXBsYWNlOiBmYWxzZSwKKyAgICAgICAgICAgICAgICAgICAgdHJhbnNjbHVkZTogdHJ1ZSwKKyAgICAgICAgICAgICAgICAgICAgc2NvcGU6IHsKKyAgICAgICAgICAgICAgICAgICAgICAgIGljb246ICdAJworICAgICAgICAgICAgICAgICAgICB9LAorICAgICAgICAgICAgICAgICAgICB0ZW1wbGF0ZTogJzxkaXYgY2xhc3M9ImJ1dHRvbi0taGVyb19faW5uZXIiPjxzcGFuIG5nLXRyYW5zY2x1ZGU+PC9zcGFuPiA8aSBuZy1jbGFzcz0ie1wnaWNvbi1hcnJvdy1yaWdodFwnOiBpY29uID09PSBcJ2Fycm93LXJpZ2h0XCcsXCdpY29uLWNhcnRcJzogaWNvbiA9PT0gXCdjYXJ0XCd9Ij48L2k+PC9kaXY+JywKKyAgICAgICAgICAgICAgICAgICAgbGluazogZnVuY3Rpb24gKHNjb3BlLCBlbGVtZW50KSB7CisgICAgICAgICAgICAgICAgICAgICAgICBlbGVtZW50LmFkZENsYXNzKCdidXR0b24gYnV0dG9uLS1oZXJvJyk7CisgICAgICAgICAgICAgICAgICAgICAgICBlbGVtZW50LmF0dHIoInRhYmluZG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ICAgICAgc2NvcGUuaXNPcGVuID0gc2hvdzsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICB9OworICAgICAgICAgICAgICAgICAgICAgICAgc2NvcGUudG9nZ2xlRHJvcGRvd25DaXJjbGUgPSBmdW5jdGlvbiAoKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgdG9nZ2xlKGZhbHNlKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIH07CisgICAgICAgICAgICAgICAgICAgICAgICBzY29wZS50b2dnbGVEcm9wZG93biA9IGZ1bmN0aW9uICgpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB0b2dnbGUoKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIH07CisgICAgICAgICAgICAgICAgICAgICAgICB2YXIgb3V0c2lkZUNsaWNrID0gZnVuY3Rpb24gKGUpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YXIgaXNFbGVtZW50ID0gJGlzRWxlbWVudChhbmd1bGFyLmVsZW1lbnQoZS50YXJnZXQpLCBlbGVtZW50LCAkZG9jdW1lbnQpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICghaXNFbGVtZW50KSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRvZ2dsZShmYWxzZSk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNjb3BlLiRhcHBseSgpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgIH07CisgICAgICAgICAgICAgICAgICAgICAgICAkZG9jdW1lbnRCaW5kLmNsaWNrKCdpc09wZW4nLCBvdXRzaWRlQ2xpY2ssIHNjb3BlKTsKKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIH07CisgICAgICAgICAgICB9XSk7CisKK2FuZ3VsYXIubW9kdWxlKCdhdHQuYWJzLmNoZWNrYm94JywgW10pCisuY29uc3RhbnQoImF0dENoZWNrYm94Q29uZmlnIiwgeworICAgIGFjdGl2ZUNsYXNzIDogImF0dC1jaGVja2JveC0tb24iLAorICAgIGRpc2FibGVkQ2xhc3MgOiAiYXR0LWNoZWNrYm94LS1kaXNhYmxlZCIKK30pCisuZGlyZWN0aXZlKCdjaGVja2JveExpbWl0JywgZnVuY3Rpb24gKCkgeworcmV0dXJuIHsKKyAgICBzY29wZTogeworICAgICAgICBjaGVja2JveExpbWl0Oic9JywKKyAgICAgICAgc2VsZWN0TGltaXQ6J0A/JywKKyAgICAgICAgbWF4U2VsZWN0ZWQ6JyY/JworICAgIH0sCisgICAgcmVzdHJpY3Q6ICdBJywKKyAgICByZXF1aXJlOidjaGVja2JveExpbWl0JywKKyAgICBjb250cm9sbGVyOiBbJyRzY29wZScsZnVuY3Rpb24oJHNjb3BlKQorICAgIHsKKyAgICAgICAgJHNjb3BlLmxpbWl0PXRydWU7CisgICAgICAgIHRoaXMuZ2V0TWF4TGltaXRzPWZ1bmN0aW9uKCl7CisgICAgICAgICAgICByZXR1cm4gJHNjb3BlLmxpbWl0OworICAgICAgICB9OworICAgICAgICB0aGlzLnNldE1heExpbWl0cz1mdW5jdGlvbih2YWx1ZSl7CisgICAgICAgICAgICAkc2NvcGUubGltaXQ9dmFsdWU7CisgICAgICAgIH07CisgICAgICAgIHRoaXMubWF4Q2hlY2tib3hTZWxlY3RlZD1mdW5jdGlvbigpeworICAgICAgICAgICAgJHNjb3BlLm1heFNlbGVjdGVkKCk7CisgICAgICAgIH07CisgICAgfV0sCisgICAgbGluazogZnVuY3Rpb24gKHNjb3BlLCBlbGVtZW50LCBhdHRyaWJ1dGUsIGN0cmwpIHsKKyAgICAgICAgc2NvcGUuJHdhdGNoKCdjaGVja2JveExpbWl0JywgZnVuY3Rpb24oKQorICAgICAgICB7CisgICAgICAgICAgICB2YXIgY291bnRUcnVlID0gMDsKKyAgICAgICAgICAgIGZvciAodmFyIGtleXMgaW4gc2NvcGUuY2hlY2tib3hMaW1pdCkgeworICAgICAgICAgICAgICAgIGlmIChzY29wZS5jaGVja2JveExpbWl0Lmhhc093blByb3BlcnR5KGtleXMpICYmIHNjb3BlLmNoZWNrYm94TGltaXRba2V5c10pIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIGNvdW50VHJ1ZSA9IGNvdW50VHJ1ZSArIDE7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfTsKKyAgICAgICAgICAgIGlmKGNvdW50VHJ1ZT49cGFyc2VJbnQoc2NvcGUuc2VsZWN0TGltaXQpKXsKKyAgICAgICAgICAgICAgICBjdHJsLnNldE1heExpbWl0cyhmYWxzZSk7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBlbHNleworICAgICAgICAgICAgICAgIGN0cmwuc2V0TWF4TGltaXRzKHRydWUpOworICAgICAgICAgICAgfQorICAgICAgICAgICAgfSwgdHJ1ZSk7CisgICAgfQorfTsKK30pCisuZGlyZWN0aXZlKCdhdHRDaGVja2JveCcsIFsnJGNvbXBpbGUnLCAiYXR0Q2hlY2tib3hDb25maWciLCBmdW5jdGlvbiAoJGNvbXBpbGUsIGF0dENoZWNrYm94Q29uZmlnKSB7CisgICAgcmV0dXJuIHsKKyAgICAgICAgc2NvcGU6IHt9LAorICAgICAgICByZXN0cmljdDogJ0EnLAorICAgICAgICByZXF1aXJlOiBbJ25nTW9kZWwnLCdeP2NoZWNrYm94TGltaXQnXSwKKyAgICAgICAgbGluazogZnVuY3Rpb24gKHNjb3BlLCBlbGVtZW50LCBhdHRyaWJ1dGUsIGN0cmwpIHsKKyAgICAgICAgICAgIHZhciBuZ0N0cmwgPSBjdHJsWzBdOworICAgICAgICAgICAgdmFyIGNoZWNrYm94TGltaXRDdHJsID0gY3RybFsxXTsKKyAgICAgICAgICAgIHZhciBwYXJlbnREaXYgPSAkY29tcGlsZSgnPGRpdiB0YWJpbmRleD0iMCIgcm9sZT0iY2hlY2tib3giIGF0dC1hY2Nlc3NpYmlsaXR5LWNsaWNrPSIxMywzMiIgbmctY2xpY2s9InVwZGF0ZU1vZGVsKCRldmVudCkiIGNsYXNzPSJhdHQtY2hlY2tib3giPjwvZGl2PicpKHNjb3BlKTsKKyAgICAgICAgICAgIGVsZW1lbnQuY3NzKHtkaXNwbGF5Oidub25lJ30pOworICAgICAgICAgICAgZWxlbWVudC53cmFwKHBhcmVudERpdik7CisgICAgICAgICAgICBlbGVtZW50LnBhcmVudCgpLmFwcGVuZCgnPGRpdiBjbGFzcz0iYXR0LWNoZWNrYm94X19pbmRpY2F0b3IiPjwvZGl2PicpOworICAgICAgICAgICAgZWxlbWVudC5wYXJlbnQoKS5hdHRyKCJ0aXRsZSIsIGF0dHJpYnV0ZS50aXRsZSk7CisgICAgICAgICAgICBlbGVtZW50LnBhcmVudCgpLmF0dHIoImlkIiwgYXR0cmlidXRlLmlkKTsKKyAgICAgICAgICAgIGVsZW1lbnQucmVtb3ZlQXR0cigiaWQiKTsKKyAgICAgICAgICAgIC8vbW9kZWwgLT4gVUkKKyAgICAgICAgICAgIG5nQ3RybC4kcmVuZGVyID0gZnVuY3Rpb24gKCkgeworICAgICAgICAgICAgICAgIHZhciBzZWxlY3RlZCA9IG5nQ3RybC4kbW9kZWxWYWx1ZSA/IHRydWUgOiBmYWxzZTsKKyAgICAgICAgICAgICAgICBlbGVtZW50LnBhcmVudCgpLnRvZ2dsZUNsYXNzKGF0dENoZWNrYm94Q29uZmlnLmFjdGl2ZUNsYXNzLCBzZWxlY3RlZCk7CisgICAgICAgICAgICAgICAgZWxlbWVudC5wYXJlbnQoKS5hdHRyKCJhcmlhLWNoZWNrZWQiLCBzZWxlY3RlZCk7CisgICAgICAgICAgICB9OworCisgICAgICAgICAgICAvL3VpLT5tb2RlbAorICAgICAgICAgICAgc2NvcGUudXBkYXRlTW9kZWwgPSBmdW5jdGlvbiAoZXZ0KSB7CisgICAgICAgICAgICAgICAgaWYgKCFzY29wZS5kaXNhYmxlZCkgeworICAgICAgICAgICAgICAgICAgICBuZ0N0cmwuJHNldFZpZXdWYWx1ZShlbGVtZW50LnBhcmVudCgpLmhhc0NsYXNzKGF0dENoZWNrYm94Q29uZmlnLmFjdGl2ZUNsYXNzKSA/IGZhbHNlIDogdHJ1ZSk7CisgICAgICAgICAgICAgICAgICAgIGlmKGNoZWNrYm94TGltaXRDdHJsICYmICEoY2hlY2tib3hMaW1pdEN0cmwuZ2V0TWF4TGltaXRzKCkpKXsKKyAgICAgICAgICAgICAgICAgICAgICAgIGlmKCFuZ0N0cmwuJG1vZGVsVmFsdWUpeworICAgICAgICAgICAgICAgICAgICAgICAgICAgIG5nQ3RybC4kcmVuZGVyKCk7CisgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICBlbHNleworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNoZWNrYm94TGltaXRDdHJsLm1heENoZWNrYm94U2VsZWN0ZWQoKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBuZ0N0cmwuJHNldFZpZXdWYWx1ZShlbGVtZW50LnBhcmVudCgpLmhhc0NsYXNzKGF0dENoZWNrYm94Q29uZmlnLmFjdGl2ZUNsYXNzKSA/IHRydWUgOiBmYWxzZSk7CisgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgZWxzZXsKKyAgICAgICAgICAgICAgICAgICAgICAgIG5nQ3RybC4kcmVuZGVyKCk7CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgZXZ0LnByZXZlbnREZWZhdWx0KCk7CisgICAgICAgICAgICB9OworCisgICAgICAgICAgICBhdHRyaWJ1dGUuJG9ic2VydmUoJ2Rpc2FibGVkJywgZnVuY3Rpb24odmFsKSB7CisgICAgICAgICAgICAgICAgc2NvcGUuZGlzYWJsZWQgPSAodmFsIHx8IHZhbCA9PT0gImRpc2FibGVkIiB8fCB2YWwgPT09ICJ0cnVlIik7CisgICAgICAgICAgICAgICAgZWxlbWVudC5wYXJlbnQoKS50b2dnbGVDbGFzcyhhdHRDaGVja2JveENvbmZpZy5kaXNhYmxlZENsYXNzLCBzY29wZS5kaXNhYmxlZCk7CisgICAgICAgICAgICAgICAgZWxlbWVudC5wYXJlbnQoKS5hdHRyKCJ0YWJpbmRleCIsIHNjb3BlLmRpc2FibGVkID8gIi0xIiA6ICIwIik7CisgICAgICAgICAgICB9KTsKKyAgICAgICAgfQorICAgIH07Cit9XSkKKy5kaXJlY3RpdmUoJ2NoZWNrYm94R3JvdXAnLCBbJyRjb21waWxlJyxmdW5jdGlvbigkY29tcGlsZSkgeworICAgIHJldHVybiB7CisgICAgICAgIHNjb3BlOnsKKyAgICAgICAgICAgIGNoZWNrYm94R3JvdXA6ICI9IiwKKyAgICAgICAgICAgIGNoZWNrYm94R3JvdXBWYWx1ZTogIj0/IgorICAgICAgICB9LAorICAgICAgICByZXN0cmljdDogJ0EnLAorICAgICAgICBsaW5rOiBmdW5jdGlvbihzY29wZSwgZWxlbWVudCwgYXR0cmlidXRlKXsKKyAgICAgICAgICAgICAgICBzY29wZS5jaGVja2JveFN0YXRlID0gJ25vbmUnOworICAgICAgICAgICAgICAgIHNjb3BlLmNoZWNrYm94R3JvdXBWYWx1ZT0iaW5kZXRlcm1pbmF0ZSI7CisgICAgICAgICAgICAgICAgZWxlbWVudC5jc3Moe2Rpc3BsYXk6J25vbmUnfSk7CisgICAgICAgICAgICAgICAgZWxlbWVudC53cmFwKCRjb21waWxlKCc8ZGl2IHRhYmluZGV4PSIwIiByb2xlPSJjaGVja2JveCIgYXR0LWFjY2Vzc2liaWxpdHktY2xpY2s9IjEzLDMyIiBuZy1jbGljaz0idXBkYXRlTW9kZWwoJGV2ZW50KSIgY2xhc3M9ImF0dC1jaGVja2JveCI+PC9kaXY+Jykoc2NvcGUpKTsKKyAgICAgICAgICAgICAgICBlbGVtZW50LnBhcmVudCgpLmFwcGVuZCgnPGRpdiBjbGFzcz0iYXR0LWNoZWNrYm94X19pbmRpY2F0b3IiPjwvZGl2PicpOworICAgICAgICAgICAgICAgIGVsZW1lbnQucGFyZW50KCkuYXR0cigidGl0bGUiLCBhdHRyaWJ1dGUudGl0bGUpOworICAgICAgICAgICAgICAgIHNjb3BlLiR3YXRjaCgnY2hlY2tib3hTdGF0ZScsIGZ1bmN0aW9uKHZhbCkgeworICAgICAgICAgICAgICAgICAgICBpZiAodmFsID09PSAnYWxsJykgeworICAgICAgICAgICAgICAgICAgICAgICAgZWxlbWVudC5wYXJlbnQoKS5hZGRDbGFzcygnYXR0LWNoZWNrYm94LS1vbicpOworICAgICAgICAgICAgICAgICAgICAgICAgZWxlbWVudC5wYXJlbnQoKS5yZW1vdmVDbGFzcygnYXR0LWNoZWNrYm94LS1pbmRldGVybWluYXRlJyk7CisgICAgICAgICAgICAgICAgICAgICAgICBlbGVtZW50LnBhcmVudCgpLmF0dHIoImFyaWEtY2hlY2tlZCIsIHRydWUpOworICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgIGVsc2UgaWYgKHZhbCA9PT0gJ25vbmUnKSB7CisgICAgICAgICAgICAgICAgICAgICAgICBlbGVtZW50LnBhcmVudCgpLnJlbW92ZUNsYXNzKCdhdHQtY2hlY2tib3gtLW9uJyk7CisgICAgICAgICAgICAgICAgICAgICAgICBlbGVtZW50LnBhcmVudCgpLnJlbW92ZUNsYXNzKCdhdHQtY2hlY2tib3gtLWluZGV0ZXJtaW5hdGUnKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIGVsZW1lbnQucGFyZW50KCkuYXR0cigiYXJpYS1jaGVja2VkIiwgZmFsc2UpOworICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgIGVsc2UgaWYgKHZhbCA9PT0gJ2luZGV0ZXJtaW5hdGUnKSB7CisgICAgICAgICAgICAgICAgICAgICAgICBlbGVtZW50LnBhcmVudCgpLnJlbW92ZUNsYXNzKCdhdHQtY2hlY2tib3gtLW9uJyk7CisgICAgICAgICAgICAgICAgICAgICAgICBlbGVtZW50LnBhcmVudCgpLmFkZENsYXNzKCdhdHQtY2hlY2tib3gtLWluZGV0ZXJtaW5hdGUnKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIGVsZW1lbnQucGFyZW50KCkuYXR0cigiYXJpYS1jaGVja2VkIiwgdHJ1ZSk7CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICB9KTsKKyAgICAgICAgICAgICAgICBzY29wZS51cGRhdGVNb2RlbCA9IGZ1bmN0aW9uKGV2dCl7CisgICAgICAgICAgICAgICAgICAgIGlmIChlbGVtZW50LnBhcmVudCgpLmhhc0NsYXNzKCdhdHQtY2hlY2tib3gtLW9uJykpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBlbGVtZW50LnBhcmVudCgpLnJlbW92ZUNsYXNzKCdhdHQtY2hlY2tib3gtLW9uJyk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgZm9yICh2YXIga2V5cyBpbiBzY29wZS5jaGVja2JveEdyb3VwKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChzY29wZS5jaGVja2JveEdyb3VwLmhhc093blByb3BlcnR5KGtleXMpKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzY29wZS5jaGVja2JveEdyb3VwW2tleXNdID0gZmFsc2U7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB9OworICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgZWxzZSB7CisgICAgICAgICAgICAgICAgICAgICAgICBlbGVtZW50LnBhcmVudCgpLmFkZENsYXNzKCdhdHQtY2hlY2tib3gtLW9uJyk7CisgICAgICAgICAgICAgICAgICAgICAgICBmb3IgKHZhciBrZXkgaW4gc2NvcGUuY2hlY2tib3hHcm91cCkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChzY29wZS5jaGVja2JveEdyb3VwLmhhc093blByb3BlcnR5KGtleSkpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2NvcGUuY2hlY2tib3hHcm91cFtrZXldID0gdHJ1ZTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICB9OworICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgIGV2dC5wcmV2ZW50RGVmYXVsdCgpOworICAgICAgICAgICAgICAgIH07CisgICAgICAgICAgICAgICAgc2NvcGUuJHdhdGNoKCdjaGVja2JveEdyb3VwVmFsdWUnLCBmdW5jdGlvbiAodmFsdWUpIHsKKyAgICAgICAgICAgICAgICAgICAgaWYgKHZhbHVlPT09ImZhbHNlIikgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGVsZW1lbnQucGFyZW50KCkucmVtb3ZlQ2xhc3MoJ2F0dC1jaGVja2JveC0tb24nKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBmb3IgKHZhciBrZXlzIGluIHNjb3BlLmNoZWNrYm94R3JvdXApIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHNjb3BlLmNoZWNrYm94R3JvdXAuaGFzT3duUHJvcGVydHkoa2V5cykpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzY29wZS5jaGVja2JveEdyb3VwW2tleXNdID0gZmFsc2U7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB9OworICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgZWxzZSBpZiAodmFsdWUgPT09ICJ0cnVlIil7CisgICAgICAgICAgICAgICAgICAgICAgICBlbGVtZW50LnBhcmVudCgpLmFkZENsYXNzKCdhdHQtY2hlY2tib3gtLW9uJyk7CisgICAgICAgICAgICAgICAgICAgICAgICBmb3IgKHZhciBrZXkgaW4gc2NvcGUuY2hlY2tib3hHcm91cCkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChzY29wZS5jaGVja2JveEdyb3VwLmhhc093blByb3BlcnR5KGtleSkpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNjb3BlLmNoZWNrYm94R3JvdXBba2V5XSA9IHRydWU7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgfTsKKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIH0pOworICAgICAgICAgICAgc2NvcGUuJHdhdGNoKCdjaGVja2JveEdyb3VwJywgZnVuY3Rpb24oKXsKKyAgICAgICAgICAgICAgICB2YXIgY291bnRUcnVlID0gMDsKKyAgICAgICAgICAgICAgICB2YXIgY291bnRGYWxzZSA9IDA7CisgICAgICAgICAgICAgICAgdmFyIGNvdW50ID0gMDsKKyAgICAgICAgICAgICAgICBmb3IgKHZhciBrZXlzIGluIHNjb3BlLmNoZWNrYm94R3JvdXApIHsKKyAgICAgICAgICAgICAgICAgICAgaWYgKHNjb3BlLmNoZWNrYm94R3JvdXAuaGFzT3duUHJvcGVydHkoa2V5cykpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIGNvdW50ID0gY291bnQgKyAxOworICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHNjb3BlLmNoZWNrYm94R3JvdXBba2V5c10pIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb3VudFRydWUgPSBjb3VudFRydWUgKyAxOworICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgZWxzZSBpZiAoIXNjb3BlLmNoZWNrYm94R3JvdXBba2V5c10pIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb3VudEZhbHNlID0gY291bnRGYWxzZSArIDE7CisgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICB9OworICAgICAgICAgICAgICAgIGlmIChjb3VudCA9PT0gY291bnRUcnVlKSB7CisgICAgICAgICAgICAgICAgICAgIHNjb3BlLmNoZWNrYm94U3RhdGUgPSAiYWxsIjsKKyAgICAgICAgICAgICAgICAgICAgIHNjb3BlLmNoZWNrYm94R3JvdXBWYWx1ZT0idHJ1ZSI7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIGVsc2UgaWYgKGNvdW50ID09PSBjb3VudEZhbHNlKSB7CisgICAgICAgICAgICAgICAgICAgIHNjb3BlLmNoZWNrYm94U3RhdGUgPSAibm9uZSI7CisgICAgICAgICAgICAgICAgICAgIHNjb3BlLmNoZWNrYm94R3JvdXBWYWx1ZT0iZmFsc2UiOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICBlbHNlIHsKKyAgICAgICAgICAgICAgICAgICAgc2NvcGUuY2hlY2tib3hTdGF0ZSA9ICJpbmRldGVybWluYXRlIjsKKyAgICAgICAgICAgICAgICAgICAgc2NvcGUuY2hlY2tib3hHcm91cFZhbHVlPSJpbmRldGVybWluYXRlIjsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgfSwgdHJ1ZSk7CisgICAgICAgIH0KKyAgICB9OworfV0pOworCithbmd1bGFyLm1vZHVsZSgnYXR0LmFicy5jb2xvcnNlbGVjdG9yJywgW10pCisgICAgLmRpcmVjdGl2ZSgnY29sb3JTZWxlY3RvcldyYXBwZXInLCBbZnVuY3Rpb24oKSB7CisgICAgICAgIHJldHVybiB7CisgICAgICAgICAgICBzY29wZTogeworICAgICAgICAgICAgICAgIHNlbGVjdGVkOiAnPScsCisgICAgICAgICAgICAgICAgaWNvbkNvbG9yOiAnQCcKKyAgICAgICAgICAgIH0sCisgICAgICAgICAgICByZXN0cmljdDogJ0FFJywKKyAgICAgICAgICAgIHRyYW5zY2x1ZGU6IHRydWUsCisgICAgICAgICAgICB0ZW1wbGF0ZVVybDogJ2FwcC9zY3JpcHRzL25nX2pzX2F0dF90cGxzL2NvbG9yc2VsZWN0b3IvY29sb3JzZWxlY3Rvci5odG1sJywKKyAgICAgICAgICAgIGxpbms6IGZ1bmN0aW9uKHNjb3BlKSB7CisgICAgICAgICAgICAgICAgc2NvcGUuYXBwbHljb2xvciA9IHsnYmFja2dyb3VuZC1jb2xvcic6IHNjb3BlLmljb25Db2xvcn07CisgICAgICAgICAgICAgICAgc2NvcGUuc2VsZWN0ZWRjb2xvciA9IGZ1bmN0aW9uKGljb25Db2xvcikgeworICAgICAgICAgICAgICAgICAgICBzY29wZS5zZWxlY3RlZCA9IGljb25Db2xvcjsKKyAgICAgICAgICAgICAgICB9OworICAgICAgICAgICAgfQorICAgICAgICB9OworICAgICB9XSkKKyAgICAuZGlyZWN0aXZlKCdjb2xvclNlbGVjdG9yJywgWyckY29tcGlsZScsIGZ1bmN0aW9uKCRjb21waWxlKSB7CisgICAgICAgIHJldHVybnsKKyAgICAgICAgICAgIHJlc3RyaWN0OiAnQScsCisgICAgICAgICAgICBzY29wZTogeworICAgICAgICAgICAgICAgIGNvbG9yU2VsZWN0b3I6ICdAJywKKyAgICAgICAgICAgICAgICBuZ01vZGVsOiAnPScKKyAgICAgICAgICAgIH0sCisgICAgICAgICAgICBsaW5rOiBmdW5jdGlvbihzY29wZSwgZWxlbWVudCkgeworICAgICAgICAgICAgICAgIGVsZW1lbnQucmVtb3ZlQXR0cignY29sb3Itc2VsZWN0b3InKTsKKyAgICAgICAgICAgICAgICB2YXIgd3JhcGNvbnQgPSBhbmd1bGFyLmVsZW1lbnQoJzxjb2xvci1zZWxlY3Rvci13cmFwcGVyIHNlbGVjdGVkPSJuZ01vZGVsIiBpY29uLWNvbG9yPSJ7e2NvbG9yU2VsZWN0b3J9fSI+JyArIGVsZW1lbnQucHJvcCgnb3V0ZXJIVE1MJykgKyAnPC9jb2xvci1zZWxlY3Rvci13cmFwcGVyPicpOworICAgICAgICAgICAgICAgIHZhciBuZXdXcmFwY29udCA9ICRjb21waWxlKHdyYXBjb250KShzY29wZSk7CisgICAgICAgICAgICAgICAgZWxlbWVudC5yZXBsYWNlV2l0aChuZXdXcmFwY29udCk7CisgICAgICAgICAgICB9CisgICAgICAgIH07CisgICAgfV0pOworYW5ndWxhci5tb2R1bGUoJ2F0dC5hYnMuZGF0ZXBpY2tlcicsIFsnYXR0LmFicy5wb3NpdGlvbicsICdhdHQuYWJzLnV0aWxpdGllcyddKQorCisuY29uc3RhbnQoJ2RhdGVwaWNrZXJDb25maWcnLCB7CisgICAgZGF0ZUZvcm1hdDogJ01NL2RkL3l5eXknLAorICAgIGRheUZvcm1hdDogJ2QnLAorICAgIG1vbnRoRm9ybWF0OiAnTU1NTScsCisgICAgeWVhckZvcm1hdDogJ3l5eXknLAorICAgIGRheUhlYWRlckZvcm1hdDogJ0VFRUUnLAorICAgIGRheVRpdGxlRm9ybWF0OiAnTU1NTSB5eXl5JywKKyAgICBkaXNhYmxlV2Vla2VuZDogZmFsc2UsCisgICAgZGlzYWJsZVN1bmRheTogZmFsc2UsCisgICAgc3RhcnRpbmdEYXk6IDAsCisgICAgbWluRGF0ZTogbnVsbCwKKyAgICBtYXhEYXRlOiBudWxsLAorICAgIG1vZGU6IDAsCisgICAgZGF0ZUZpbHRlcjogeworICAgICAgICBkZWZhdWx0VGV4dDogJ1NlbGVjdCBmcm9tIGxpc3QnCisgICAgfSwKKyAgICBkYXRlcGlja2VyRXZhbEF0dHJpYnV0ZXM6IFsnZGF0ZUZvcm1hdCcsICdkYXlGb3JtYXQnLCAnbW9udGhGb3JtYXQnLCAneWVhckZvcm1hdCcsICdkYXlIZWFkZXJGb3JtYXQnLCAnZGF5VGl0bGVGb3JtYXQnLCAnZGlzYWJsZVdlZWtlbmQnLCAnZGlzYWJsZVN1bmRheScsICdzdGFydGluZ0RheScsICdtb2RlJ10sCisJZGF0ZXBpY2tlcldhdGNoQXR0cmlidXRlczogWydtaW4nLCAnbWF4J10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biAoa2V5LCB2YWwpIHsKKyAgICAgICAgICAgICAgICBzY29wZVtrZXldID0gc2NvcGUuJHBhcmVudC4kZXZhbCh2YWwpOworICAgICAgICAgICAgfTsKKyAgICAgICAgICAgIAorICAgICAgICAgICAgdmFyIHdhdGNoRnVuY3Rpb24gPSBmdW5jdGlvbiAoa2V5LCB2YWwpIHsKKyAgICAgICAgICAgICAgICBzY29wZS4kcGFyZW50LiR3YXRjaCh2YWwsIGZ1bmN0aW9uICh2YWx1ZSkgeworICAgICAgICAgICAgICAgICAgICBzY29wZVtrZXldID0gdmFsdWU7CisgICAgICAgICAgICAgICAgfSk7CisgICAgICAgICAgICAgICAgc2NvcGUuJHdhdGNoKGtleSwgZnVuY3Rpb24gKHZhbHVlKSB7CisgICAgICAgICAgICAgICAgICAgIHNjb3BlLiRwYXJlbnRbdmFsXSA9IHZhbHVlOworICAgICAgICAgICAgICAgIH0pOworICAgICAgICAgICAgfTsKKworICAgICAgICAgICAgdmFyIGV2YWxBdHRyaWJ1dGVzID0gZGF0ZXBpY2tlckNvbmZpZy5kYXRlcGlja2VyRXZhbEF0dHJpYnV0ZXM7CisgICAgICAgICAgICB2YXIgd2F0Y2hBdHRyaWJ1dGVzID0gZGF0ZXBpY2tlckNvbmZpZy5kYXRlcGlja2VyV2F0Y2hBdHRyaWJ1dGVzOworICAgICAgICAgICAgZm9yICh2YXIga2V5IGluIGF0dHIpIHsKKyAgICAgICAgICAgICAgICB2YXIgdmFsID0gYXR0cltrZXldOworICAgICAgICAgICAgICAgIGlmIChldmFsQXR0cmlidXRlcy5pbmRleE9mKGtleSkgIT09IC0xICYmIGFuZ3VsYXIuaXNEZWZpbmVkKHZhbCkpIHsKKyAgICAgICAgICAgICAgICAgICAgZXZhbEZ1bmN0aW9uKGtleSwgdmFsKTsKKyAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKHdhdGNoQXR0cmlidXRlcy5pbmRleE9mKGtleSkgIT09IC0xICYmIGFuZ3VsYXIuaXNEZWZpbmVkKHZhbCkpIHsKKyAgICAgICAgICAgICAgICAgICAgd2F0Y2hGdW5jdGlvbihrZXksIHZhbCk7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgfTsKKworICAgIHZhciB2YWxpZGF0ZURhdGVTdHJpbmcgPSBmdW5jdGlvbiAoZGF0ZVN0cmluZywgZGF0ZUZvcm1hdCkgeworICAgICAgICBpZiAoZGF0ZVN0cmluZyAmJiBkYXRlRm9ybWF0KSB7CisgICAgICAgICAgICB2YXIgZGVsaW1pdGVyOworICAgICAgICAgICAgaWYgKGRhdGVGb3JtYXQuaW5kZXhPZignLycpICE9PSAtMSkgeworICAgICAgICAgICAgICAgIGRlbGltaXRlciA9ICcvJzsKKyAgICAgICAgICAgIH0gZWxzZSBpZiAoZGF0ZUZvcm1hdC5pbmRleE9mKCctJykgIT09IC0xKSB7CisgICAgICAgICAgICAgICAgZGVsaW1pdGVyID0gJy0nOworICAgICAgICAgICAgfSBlbHNlIGlmIChkYXRlRm9ybWF0LmluZGV4T2YoJy4nKSAhPT0gLTEpIHsKKyAgICAgICAgICAgICAgICBkZWxpbWl0ZXIgPSAnLic7CisgICAgICAgICAgICB9CisKKyAgICAgICAgICAgIHZhciBkYXRlU3RyaW5nQXJyYXkgPSBkYXRlU3RyaW5nLnNwbGl0KGRlbGltaXRlcik7CisgICAgICAgICAgICB2YXIgZGF0ZUZvcm1hdEFycmF5ID0gZGF0ZUZvcm1hdC5zcGxpdChkZWxpbWl0ZXIpOworICAgICAgICAgICAgaWYgKGRhdGVTdHJpbmdBcnJheS5sZW5ndGggIT09IGRhdGVGb3JtYXRBcnJheS5sZW5ndGgpIHsKKyAgICAgICAgICAgICAgICByZXR1cm4gZmFsc2U7CisgICAgICAgICAgICB9CisKKyAgICAgICAgICAgIGZvciAodmFyIGkgPSAwOyBpIDwgZGF0ZVN0cmluZ0FycmF5Lmxlbmd0aDsgaSsrKSB7CisgICAgICAgICAgICAgICAgZGF0ZV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SkgeworICAgICAgICByZXR1cm4gYW5ndWxhci5pc0RlZmluZWQodmFsdWUpID8gJHNjb3BlLiRwYXJlbnQuJGV2YWwodmFsdWUpIDogZGVmYXVsdFZhbHVlOworICAgIH0KKworICAgIGZ1bmN0aW9uIGdldERheXNJbk1vbnRoKHllYXIsIG1vbnRoKSB7CisgICAgICAgIHJldHVybiBuZXcgRGF0ZSh5ZWFyLCBtb250aCwgMCkuZ2V0RGF0ZSgpOworICAgIH0KKworICAgIGZ1bmN0aW9uIGdldERhdGVzKHN0YXJ0RGF0ZSwgbikgeworICAgICAgICB2YXIgZGF0ZXMgPSBuZXcgQXJyYXkobik7CisgICAgICAgIHZhciBjdXJyZW50ID0gc3RhcnREYXRlLCBpID0gMDsKKyAgICAgICAgd2hpbGUgKGkgPCBuKSB7CisgICAgICAgICAgICBkYXRlc1tpKytdID0gbmV3IERhdGUoY3VycmVudCk7CisgICAgICAgICAgICBjdXJyZW50LnNldERhdGUoY3VycmVudC5nZXREYXRlKCkgKyAxKTsKKyAgICAgICAgfQorICAgICAgICByZXR1cm4gZGF0ZXM7CisgICAgfQorICAgIAorICAgIGZ1bmN0aW9uIGlzU2VsZWN0ZWQoZHQpIHsKKyAgICAgICAgaWYgKGR0ICYmIGFuZ3VsYXIuaXNEYXRlKCRzY29wZS5jdXJyZW50RGF0ZSkgJiYgY29tcGFyZShkdCwgJHNjb3BlLmN1cnJlbnREYXRlKSA9PT0gMCkgeworICAgICAgICAgICAgcmV0dXJuIHRydWU7CisgICAgICAgIH0KKyAgICAgICAgcmV0dXJuIGZhbHNlOworICAgIH0KKyAgICAKKyAgICBmdW5jdGlvbiBpc0Zyb21EYXRlKGR0KSB7CisgICAgICAgIGlmIChkdCAmJiBhbmd1bGFyLmlzRGF0ZSgkc2NvcGUuZnJvbURhdGUpICYmIGNvbXBhcmUoZHQsICRzY29wZS5mcm9tRGF0ZSkgPT09IDApIHsKKyAgICAgICAgICAgIHJldHVybiB0cnVlOworICAgICAgICB9CisgICAgICAgIHJldHVybiBmYWxzZTsKKyAgICB9CisKKyAgICBmdW5jdGlvbiBpc1RvRGF0ZShkdCkgeworICAgICAgICBpZiAoZHQgJiYgYW5ndWxhci5pc0RhdGUoJHNjb3BlLmZyb21EYXRlKSAmJiBhbmd1bGFyLmlzRGF0ZSgkc2NvcGUuY3VycmVudERhdGUpICYmIGNvbXBhcmUoZHQsICRzY29wZS5jdXJyZW50RGF0ZSkgPT09IDApIHsKKyAgICAgICAgICAgIHJldHVybiB0cnVlOworICAgICAgICB9CisgICAgICAgIHJldHVybiBmYWxzZTsKKyAgICB9CisKKyAgICBmdW5jdGlvbiBpc0RhdGVSYW5nZShkdCkgeworICAgICAgICBpZiAoZHQgJiYgYW5ndWxhci5pc0RhdGUoJHNjb3BlLmZyb21EYXRlKSAmJiBhbmd1bGFyLmlzRGF0ZSgkc2NvcGUuY3VycmVudERhdGUpICYmIChjb21wYXJlKGR0LCAkc2NvcGUuZnJvbURhdGUpID49IDApICYmIChjb21wYXJlKGR0LCAkc2NvcGUuY3VycmVudERhdGUpIDw9IDApKSB7CisgICAgICAgICAgICByZXR1cm4gdHJ1ZTsKKyAgICAgICAgfQorICAgICAgICByZXR1cm4gZmFsc2U7CisgICAgfQorCisgICAgZnVuY3Rpb24gaXNXZWVrZW5kKGRhdGUpIHsKKyAgICAgICAgaWYgKGRhdGVGaWx0ZXIoZGF0ZSwgZm9ybWF0LmRheUhlYWRlcikgPT09ICJTYXR1cmRheSIgfHwgZGF0ZUZpbHRlcihkYXRlLCBmb3JtYXQuZGF5SGVhZGVyKSA9PT0gIlN1bmRheSIpIHsKKyAgICAgICAgICAgIHJldHVybiB0cnVlOworICAgICAgICB9CisgICAgICAgIHJldHVybiBmYWxzZTsKKyAgICB9CisKKyAgICBmdW5jdGlvbiBpc1RvZGF5KGRhdGUpIHsKKyAgICAgICAgaWYgKGNvbXBhcmUoZGF0ZSwgJHNjb3BlLnJlc2V0VGltZShuZXcgRGF0ZSgpKSkgPT09IDApIHsK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aW9uKGRhdGUxLCBkYXRlMikgeworICAgICAgICByZXR1cm4gKG5ldyBEYXRlKGRhdGUxLmdldEZ1bGxZZWFyKCksIGRhdGUxLmdldE1vbnRoKCksIGRhdGUxLmdldERhdGUoKSkgLSBuZXcgRGF0ZShkYXRlMi5nZXRGdWxsWWVhcigpLCBkYXRlMi5nZXRNb250aCgpLCBkYXRlMi5nZXREYXRlKCkpKTsKKyAgICB9OworCQorCQorICAgIGZ1bmN0aW9uIGlzTWluRGF0ZUF2YWlsYWJsZShzdGFydERhdGUsIGVuZERhdGUpIHsKKyAgICAgICAgaWYoKCRzY29wZS5taW5EYXRlICYmICRzY29wZS5taW5EYXRlLmdldFRpbWUoKSA+PSBzdGFydERhdGUuZ2V0VGltZSgpKSAmJiAoJHNjb3BlLm1pbkRhdGUuZ2V0VGltZSgpIDw9IGVuZERhdGUuZ2V0VGltZSgpKSkgeworICAgICAgICAgICAgcmV0dXJuIHRydWU7CisgICAgICAgIH0KKyAgICAgICAgZWxzZSB7CisgICAgICAgICAgICByZXR1cm4gZmFsc2U7CisgICAgICAgIH0KKyAgICB9CisgICAgCisgICAgZnVuY3Rpb24gaXNNYXhEYXRlQXZhaWxhYmxlKHN0YXJ0RGF0ZSwgZW5kRGF0ZSkgeworICAgICAgICBpZigoJHNjb3BlLm1heERhdGUgJiYgJHNjb3BlLm1heERhdGUuZ2V0VGltZSgpID49IHN0YXJ0RGF0ZS5nZXRUaW1lKCkpICYmICgkc2NvcGUubWF4RGF0ZS5nZXRUaW1lKCkgPD0gZW5kRGF0ZS5nZXRUaW1lKCkpKSB7CisgICAgICAgICAgICByZXR1cm4gdHJ1ZTsKKyAgICAgICAgfQorICAgICAgICBlbHNlIHsKKyAgICAgICAgICAgIHJldHVybiBmYWxzZTsKKyAgICAgICAgfQorICAgIH0KKworICAgIGZ1bmN0aW9uIGdldExhYmVsKGxhYmVsKSB7CisgICAgICAgIGlmIChsYWJlbCkKKyAgICAgICAgeworICAgICAgICAgICAgdmFyIG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PSBkYXRlLmdldE1vbnRoKCksIGZpcnN0RGF5T2ZNb250aCA9IG5ldyBEYXRlKHllYXIsIG1vbnRoLCAxKSwgbGFzdERheU9mTW9udGggPSBuZXcgRGF0ZSh5ZWFyLCBtb250aCsxLCAwKTsKKyAgICAgICAgICAgICAgICB2YXIgZGlmZmVyZW5jZSA9IHN0YXJ0aW5nRGF5IC0gZmlyc3REYXlPZk1vbnRoLmdldERheSgpLAorICAgICAgICAgICAgICAgICAgICAgICAgbnVtRGlzcGxheWVkRnJvbVByZXZpb3VzTW9udGggPSAoZGlmZmVyZW5jZSA+IDApID8gNyAtIGRpZmZlcmVuY2UgOiAtZGlmZmVyZW5jZSwKKyAgICAgICAgICAgICAgICAgICAgICAgIGZpcnN0RGF0ZSA9IG5ldyBEYXRlKGZpcnN0RGF5T2ZNb250aCksIG51bURhdGVzID0gMDsKKworICAgICAgICAgICAgICAgIGlmIChudW1EaXNwbGF5ZWRGcm9tUHJldmlvdXNNb250aCA+IDApIHsKKyAgICAgICAgICAgICAgICAgICAgZmlyc3REYXRlLnNldERhdGUoLW51bURpc3BsYXllZEZyb21QcmV2aW91c01vbnRoICsgMSk7CisgICAgICAgICAgICAgICAgICAgIG51bURhdGVzICs9IG51bURpc3BsYXllZEZyb21QcmV2aW91c01vbnRoOyAvLyBQcmV2aW91cworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICBudW1EYXRlcyArPSBnZXREYXlzSW5Nb250aCh5ZWFyLCBtb250aCArIDEpOyAvLyBDdXJyZW50CisgICAgICAgICAgICAgICAgbnVtRGF0ZXMgKz0gKDcgLSBudW1EYXRlcyAlIDcpICUgNzsgLy8gTmV4dAorCisgICAgICAgICAgICAgICAgdmFyIGRheXMgPSBnZXREYXRlcyhmaXJzdERhdGUsIG51bURhdGVzKSwgbGFiZWxzID0gbmV3IEFycmF5KDcpOworICAgICAgICAgICAgICAgIGZvciAodmFyIGkgPSAwOyBpIDwgbnVtRGF0ZXM7IGkrKykgeworICAgICAgICAgICAgICAgICAgICB2YXIgZHQgPSBuZXcgRGF0ZShkYXlzW2ldKTsKKyAgICAgICAgICAgICAgICAgICAgZGF5c1tpXSA9IG1ha2VEYXRlKGR0LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBmb3JtYXQuZGF5LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBmb3JtYXQuZGF5SGVhZGVyLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpc0ZvY3VzZWQoZHQpLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpc1NlbGVjdGVkKGR0KSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaXNGcm9tRGF0ZShkdCksCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlzVG9EYXRlKGR0KSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaXNEYXRlUmFuZ2UoZHQpLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAobmV3IERhdGUoZHQuZ2V0RnVsbFllYXIoKSwgZHQuZ2V0TW9udGgoKSwgMSwgMCwgMCwgMCkuZ2V0VGltZSgpIDwgbmV3IERhdGUoeWVhciwgbW9udGgsIDEsIDAsIDAsIDApLmdldFRpbWUoKSksCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChuZXcgRGF0ZShkdC5nZXRGdWxsWWVhcigpLCBkdC5nZXRNb250aCgpLCAxLCAwLCAwLCAwKS5nZXRUaW1lKCkgPiBuZXcgRGF0ZSh5ZWFyLCBtb250aCwgMSwgMCwgMCwgMCkuZ2V0VGltZSgpKSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaXNEaXNhYmxlZChkdCksCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlzVG9kYXkoZHQpLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpc1dlZWtlbmQoZHQpKTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgZm9yICh2YXIgaiA9IDA7IGogPCA3OyBqKyspIHsKKyAgICAgICAgICAgICAgICAgICAgbGFiZWxzW2pdID0gZ2V0TGFiZWwoZGF0ZUZpbHRlcihkYXlzW2pdLmRhdGUsIGZvcm1hdC5kYXlIZWFkZXIpKTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgaWYgKGNhbGVuZGFyID09PSAndG9wJykgeworICAgICAgICAgICAgICAgICAgICAkc2NvcGUuZGlzYWJsZVByZXZUb3AgPSBpc01pbkRhdGVBdmFpbGFibGUoZmlyc3REYXlPZk1vbnRoLCBsYXN0RGF5T2ZNb250aCk7CisgICAgICAgICAgICAgICAgICAgICRzY29wZS5kaXNhYmxlTmV4dFRvcCA9IGlzTWF4RGF0ZUF2YWlsYWJsZShmaXJzdERheU9mTW9udGgsIGxhc3REYXlPZk1vbnRoKTsKKyAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKGNhbGVuZGFyID09PSAnYm90dG9tJykgeworICAgICAgICAgICAgICAgICAgICAkc2NvcGUuZGlzYWJsZVByZXZCb3R0b20gPSBpc01pbkRhdGVBdmFpbGFibGUoZmlyc3REYXlPZk1vbnRoLCBsYXN0RGF5T2ZNb250aCk7CisgICAgICAgICAgICAgICAgICAgICRzY29wZS5kaXNhYmxlTmV4dEJvdHRvbSA9IGlzTWF4RGF0ZUF2YWlsYWJsZShmaXJzdERheU9mTW9udGgsIGxhc3REYXlPZk1vbnRoKTsKKyAgICAgICAgICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgICAgICAgICAkc2NvcGUuZGlzYWJsZVByZXZUb3AgPSAkc2NvcGUuZGlzYWJsZVByZXZCb3R0b20gPSBpc01pbkRhdGVBdmFpbGFibGUoZmlyc3REYXlPZk1vbnRoLCBsYXN0RGF5T2ZNb250aCk7CisgICAgICAgICAgICAgICAgICAgICRzY29wZS5kaXNhYmxlTmV4dFRvcCA9ICRzY29wZS5kaXNhYmxlTmV4dEJvdHRvbSA9IGlzTWF4RGF0ZUF2YWlsYWJsZShmaXJzdERheU9mTW9udGgsIGxhc3REYXlPZk1vbnRoKTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgJHNjb3BlLmRpc2FibGVQcmV2ID0gJHNjb3BlLmRpc2FibGVQcmV2VG9wIHx8ICRzY29wZS5kaXNhYmxlUHJldkJvdHRvbTsKKyAgICAgICAgICAgICAgICAkc2NvcGUuZGlzYWJsZU5leHQgPSAkc2NvcGUuZGlzYWJsZU5leHRUb3AgfHwgJHNjb3BlLmRpc2FibGVOZXh0Qm90dG9tOworICAgICAgICAgICAgICAgIHJldHVybiB7b2JqZWN0czogZGF5cywgdGl0bGU6IGRhdGVGaWx0ZXIoZGF0ZSwgZm9ybWF0LmRheVRpdGxlKSwgbGFiZWxzOiBsYWJlbHN9OworICAgICAgICAgICAgfSwJCQkJCQkKKyAgICAgICAgICAgIHNwbGl0OiA3LAkJCisgICAgICAgICAgICBzdGVwOiB7bW9udGhzOiAxfQorICAgICAgICB9LAkJCisJCXsKKyAgICAgICAgICAgIG5hbWU6ICdtb250aCcsCisgICAgICAgICAgICBnZXRWaXNpYmxlRGF0ZXM6IGZ1bmN0aW9uKGRhdGUsIGNhbGVuZGFyKSB7CisgICAgICAgICAgICAgICAgdmFyIG1vbnRocyA9IG5ldyBBcnJheSgxMiksIGxhYmVscyA9IFtdLCB5ZWFyID0gZGF0ZS5nZXRGdWxsWWVhcigpLCBtb250aCA9IGRhdGUuZ2V0TW9udGgoKTsKKyAgICAgICAgICAgICAgICBmb3IgKHZhciBpID0gMDsgaSA8IDEyOyBpKyspIHsKKyAgICAgICAgICAgICAgICAgICB2YXIgZHQgPSBuZXcgRGF0ZSh5ZWFyLGksMSk7CisgICAgICAgICAgICAgICAgICAgIG1vbnRoc1tpXSA9IG1ha2VEYXRlKGR0LAorCQkJCQkJCQlmb3JtYXQubW9udGgsCisJCQkJCQkJCWZvcm1hdC5tb250aCwJCQkJCQkJCQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpc0ZvY3VzZWQoZHQpLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpc1NlbGVjdGVkKGR0KSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaXNGcm9tRGF0ZShkdCksCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlzVG9EYXRlKGR0KSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaXNEYXRlUmFuZ2UoZHQpLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBmYWxzZSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZmFsc2UsCQkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaXNEaXNhYmxlZChkdCksCisJCQkJCQkJCWlzVG9kYXkoZHQpLAorCQkJCQkJCQlmYWxzZQorCQkJCQkJCQkpOworICAgICAgICAgICAgICAgIH0JCQkJCQkKKwkJCQlyZXR1cm4ge29iamVjdHM6IG1vbnRocywgdGl0bGU6IGRhdGVGaWx0ZXIoZGF0ZSwgZm9ybWF0LnllYXIpLCBsYWJlbHM6IGxhYmVsc307CisgICAgICAgICAgICB9LCAgICAgICAgIAorCQkJc3BsaXQ6MywKKyAgICAgICAgICAgIHN0ZXA6IHt5ZWFyczogMX0KKyAgICAgICAgfQorICAgIF07CisJCit9XSkKKworLmRpcmVjdGl2ZSgnZGF0ZXBpY2tlcicsIFsnJHRpbWVvdXQnLCBmdW5jdGlvbiAoJHRpbWVvdXQpIHsKKyAgICByZXR1cm4geworICAgICAgICByZXN0cmljdDogJ0VBJywKKyAgICAgICAgcmVwbGFjZTogdHJ1ZSwKKyAgICAgICAgdHJhbnNjbHVkZTogdHJ1ZSwKKyAgICAgICAgdGVtcGxhdGVVcmw6ICdhcHAvc2NyaXB0cy9uZ19qc19hdHRfdHBscy9kYXRlcGlja2VyL2RhdGVwaWNrZXIuaHRtbCcsCisgICAgICAgIHNjb3BlOiB7CisgICAgICAgICAgICBjdXJyZW50RGF0ZTogIj0/Y3VycmVudCIsCisgICAgICAgICAgICBmcm9tRGF0ZTogIj0/ZnJvbSIKKyAgICAgICAgfSwKKyAgICAgICAgcmVxdWlyZTogJ2RhdGVwaWNrZXInLAorICAgICAgICBjb250cm9sbGVyOiAnRGF0ZXBpY2tlckNvbnRyb2xsZXInLAorICAgICAgICBsaW5rOiBmdW5jdGlvbihzY29wZSwgZWxlbWVudCwgYXR0cnMsIGN0cmwpIHsKKyAgICAgICAgICAgIHZhciBkYXRlcGlja2VyQ3RybCA9IGN0cmw7CisgICAgICAgICAgICB2YXIgc2VsZWN0ZWQsIGNhbGVuZGFyU2VsZWN0ZWQgPSBmYWxzZTsKKyAgICAgICAgICAgIHNjb3BlLmZvY3VzZWREYXRlOworICAgICAgICAgICAKKyAgICAgICAgICAgIHNjb3BlLnJlc2V0VGltZSA9IGZ1bmN0aW9uKGRhdGUpIHsKKyAgICAgICAgICAgICAgICB2YXIgZHQ7CisgICAgICAgICAgICAgICAgaWYgKCFpc05hTihuZXcgRGF0ZShkYXRlKSkpIHsKKyAgICAgICAgICAgICAgICAgICAgZHQgPSBuZXcgRGF0ZShkYXRlKTsKKwkJCQkJaWYoc2NvcGUubW9kZSA9PT0gMSl7CisJCQkJCQlkdCA9IG5ldyBEYXRlKGR0LmdldEZ1bGxZZWFyKCksIGR0LmdldE1vbnRoKCkpOworCQkJCQl9ZWxzZXsKKwkJCQkJCWR0ID0gbmV3IERhdGUoZHQuZ2V0RnVsbFllYXIoKSwgZHQuZ2V0TW9udGgoKSwgZHQuZ2V0RGF0ZSgpKTsKKwkJCQkJfQorICAgICAgICAgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICAgICAgICAgIHJldHVybiBudWxsOworICAgICAgICAgICAgICAgIH0JCQkJCisgICAgICAgICAgICAgICAgcmV0dXJuIGR0OworICAgICAgICAgICAgfTsKKworICAgICAgICAgICAgaWYgKGF0dHJzLm1pbikgeworICAgICAgICAgICAgICAgIHNjb3BlLiRwYXJlbnQuJHdhdGNoKGF0dHJzLm1pbiwgZnVuY3Rpb24odmFsdWUpIHsKKyAgICAgICAgICAgICAgICAgICAgc2NvcGUubWluRGF0ZSA9IHZhbHVlID8gc2NvcGUucmVzZXRUaW1lKHZhbHVlKSA6IG51bGw7CisgICAgICAgICAgICAgICAgICAgIHJlZmlsbCgpOworICAgICAgICAgICAgICAgIH0pOworICAgICAgICAgICAgfQorICAgICAgICAgICAgaWYgKGF0dHJzLm1heCkgeworICAgICAgICAgICAgICAgIHNjb3BlLiRwYXJlbnQuJHdhdGNoKGF0dHJzLm1heCwgZnVuY3Rpb24odmFsdWUpIHsKKyAgICAgICAgICAgICAgICAgICAgc2NvcGUubWF4RGF0ZSA9IHZhbHVlID8gc2NvcGUucmVzZXRUaW1lKHZhbHVlKSA6IG51bGw7CisgICAgICAgICAgICAgICAgICAgIHJlZmlsbCgpOworICAgICAgICAgICAgICAgIH0pOworICAgICAgICAgICAgfQorICAgICAgICAgICAgCisgICAgICAgICAgICAvLyBTcGxpdCBhcnJheSBpbnRvIHNtYWxsZXIgYXJyYXlzCisgICAgICAgICAgICBmdW5jdGlvbiBzcGxpdChhcnIsIHNpemUpIHsKKyAgICAgICAgICAgICAgICB2YXIgYXJyYXlzID0gW107CisgICAgICAgICAgICAgICAgd2hpbGUgKGFyci5sZW5ndGggPiAwKSB7CisgICAgICAgICAgICAgICAgICAgIGFycmF5cy5wdXNoKGFyci5zcGxpY2UoMCwgc2l6ZSkpOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICByZXR1cm4gYXJyYXlzOworICAgICAgICAgICAgfQorCisgICAgICAgICAgICBmdW5jdGlvbiByZWZpbGwoZGF0ZSkgeworICAgICAgICAgICAgICAgIGlmIChhbmd1bGFyLmlzRGF0ZShkYXRlKSAmJiAhaXNOYU4oZGF0ZSkpIHsKKyAgICAgICAgICAgICAgICAgICAgc2VsZWN0ZWQgPSBuZXcgRGF0ZShkYXRlKTsKKyAgICAgICAgICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgICAgICAgICBpZiAoIXNlbGVjdGVkKSB7CisgICAgICAgICAgICAgICAgICAgICAgICBzZWxlY3RlZCA9IG5ldyBEYXRlKCk7CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICB9CisJCQkJCisJCQkJaWYgKHNlbGVjdGVkKSB7CisJCQkJCXZhciBzZWxlY3RlZENhbGVuZGFyOworCQkJCQlpZihzY29wZS5tb2RlID09PSAxKXsKKwkJCQkJCXNlbGVjdGVkID0gbmV3IERhdGUoKTsKKwkJCQkJCXNlbGVjdGVkQ2FsZW5kYXIgPSBtb3ZlTW9udGgoYW5ndWxhci5jb3B5KHNlbGVjdGVkKSwgLTEpOworCQkJCQl9IGVsc2UgeworCQkJCQkJc2VsZWN0ZWRDYWxlbmRhciA9IGFuZ3VsYXIuY29weShzZWxlY3RlZCk7CisJCQkJCX0KKwkJCQkJCisJCQkJCXZhciBjdXJyZW50TW9kZSA9IGRhdGVwaWNrZXJDdHJsLm1vZGVzW3Njb3BlLm1vZGVdOworCQkJCQl2YXIgY3VycmVudERhdGEgPSBjdXJyZW50TW9kZS5nZXRWaXNpYmxlRGF0ZXMoc2VsZWN0ZWRDYWxlbmRhciwgJ3RvcCcpOworICAgICAgICAgICAgICAgICAgICBzY29wZS5jdXJyZW50Um93cyA9IHNwbGl0KGN1cnJlbnREYXRhLm9iamVjdHMsIGN1cnJlbnRNb2RlLnNwbGl0KTsKKyAgICAgICAgICAgICAgICAgICAgc2NvcGUuY3VycmVudFRpdGxlID0gY3VycmVudERhdGEudGl0bGU7CisgICAgICAgICAgICAgICAgICAgIHNjb3BlLmxhYmVscyA9IGN1cnJlbnREYXRhLmxhYmVscyB8fCBbXTsKKworICAgICAgICAgICAgICAgICAgICB2YXIgbmV4dERhdGEgPSBjdXJyZW50TW9kZS5nZXRWaXNpYmxlRGF0ZXMobW92ZU1vbnRoKGFuZ3VsYXIuY29weShzZWxlY3RlZENhbGVuZGFyKSwgMSksICdib3R0b20nKTsKKyAgICAgICAgICAgICAgICAgICAgc2NvcGUubmV4dFJvd3MgPSBzcGxpdChuZXh0RGF0YS5vYmplY3RzLCBjdXJyZW50TW9kZS5zcGxpdCk7CisgICAgICAgICAgICAgICAgICAgIHNjb3BlLm5leHRUaXRsZSA9IG5leHREYXRhLnRpdGxlOwkJCQkJCisJCQkJfQorICAgICAgICAgICAgfQorICAgICAgICAKKyAgICAgICAgICAgIHNjb3BlLnNlbGVjdCA9IGZ1bmN0aW9uKGRhdGUpIHsKKyAgICAgICAgICAgICAgICBjYWxlbmRhclNlbGVjdGVkID0gdHJ1ZTsKKyAgICAgICAgICAgICAgICBpZihhdHRycy5mcm9tKSB7CisgICAgICAgICAgICAgICAgICAgIGlmKCEoYW5ndWxhci5pc0RhdGUoc2NvcGUuZnJvbURhdGUpICYmIGFuZ3VsYXIuaXNEYXRlKHNjb3BlLmN1cnJlbnREYXRlKSkpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIGlmKGFuZ3VsYXIuaXNEYXRlKHNjb3BlLmZyb21EYXRlKSkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNlbGVjdEN1cnJlbnREYXRlKGRhdGUpOworICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIGlmKCFhbmd1bGFyLmlzRGF0ZShzY29wZS5mcm9tRGF0ZSkpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBzZWxlY3RGcm9tRGF0ZShkYXRlKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICAgICAgICAgIHNlbGVjdEN1cnJlbnREYXRlKGRhdGUpOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICBzY29wZS5mb2N1c2VkRGF0ZSA9IGRhdGU7CisgICAgICAgICAgICB9OworICAgICAgICAgICAgCisgICAgICAgICAgICB2YXIgc2VsZWN0Q3VycmVudERhdGUgPSBmdW5jdGlvbihkYXRlKSB7CisgICAgICAgICAgICAgICAgdmFyIGR0ID0gbmV3IERhdGUoZGF0ZS5nZXRGdWxsWWVhcigpLCBkYXRlLmdldE1vbnRoKCksIGRhdGUuZ2V0RGF0ZSgpKTsKKyAgICAgICAgICAgICAgICBzY29wZS5jdXJyZW50RGF0ZSA9IGR0OworICAgICAgICAgICAgfTsKKyAgICAgICAgICAgIAorICAgICAgICAgICAgdmFyIHNlbGVjdEZyb21EYXRlID0gZnVuY3Rpb24oZGF0ZSkgeworICAgICAgICAgICAgICAgIHZhciBkdCA9IG5ldyBEYXRlKGRhdGUuZ2V0RnVsbFllYXIoKSwgZGF0ZS5nZXRNb250aCgpLCBkYXRlLmdldERhdGUoKSk7CisgICAgICAgICAgICAgICAgc2NvcGUuZnJvbURhdGUgPSBkdDsKKyAgICAgICAgICAgIH07CisKKyAgICAgICAgICAgIHZhciBzd2FwRGF0ZSA9IGZ1bmN0aW9uKGZyb21EYXRlLCBjdXJyZW50RGF0ZSkgeworICAgICAgICAgICAgICAgIHNlbGVjdEZyb21EYXRlKGN1cnJlbnREYXRlKTsKKyAgICAgICAgICAgICAgICAkdGltZW91dChmdW5jdGlvbiAoKSB7CisgICAgICAgICAgICAgICAgICAgIGNhbGVuZGFyU2VsZWN0ZWQgPSB0cnVlOworICAgICAgICAgICAgICAgICAgICBzY29wZS5mb2N1c2VkRGF0ZSA9IGN1cnJlbnREYXRlOworICAgICAgICAgICAgICAgICAgICBzZWxlY3RDdXJyZW50RGF0ZShmcm9tRGF0ZSk7CisgICAgICAgICAgICAgICAgfSk7CisgICAgICAgICAgICB9CQkJCisgICAgICAgICAgICB2YXIgbW92ZU1vbnRoID0gZnVuY3Rpb24oc2VsZWN0ZWREYXRlLCBkaXJlY3Rpb24pIHsKKyAgICAgICAgICAgICAgICB2YXIgc3RlcCA9IGRhdGVwaWNrZXJDdHJsLm1vZGVzW3Njb3BlLm1vZGVdLnN0ZXA7CisgICAgICAgICAgICAgICAgc2VsZWN0ZWREYXRlLnNldERhdGUoMSk7CisgICAgICAgICAgICAgICAgc2VsZWN0ZWREYXRlLnNldE1vbnRoKHNlbGVjdGVkRGF0ZS5nZXRNb250aCgpICsgZGlyZWN0aW9uICogKHN0ZXAubW9udGhzIHx8IDApKTsKKyAgICAgICAgICAgICAgICBzZWxlY3RlZERhdGUuc2V0RnVsbFllYXIoc2VsZWN0ZWREYXRlLmdldEZ1bGxZZWFyKCkgKyBkaXJlY3Rpb24gKiAoc3RlcC55ZWFycyB8fCAwKSk7CisKKyAgICAgICAgICAgICAgICByZXR1cm4gc2VsZWN0ZWREYXRlOworICAgICAgICAgICAgfTsKKworICAgICAgICAgICAgc2NvcGUubW92ZSA9IGZ1bmN0aW9uKGRpcmVjdGlvbikgeworICAgICAgICAgICAgICAgIHNlbGVjdGVkID0gbW92ZU1vbnRoKGFuZ3VsYXIuY29weShzZWxlY3RlZCksIGRpcmVjdGlvbik7CisgICAgICAgICAgICAgICAgcmVmaWxsKCk7CisgICAgICAgICAgICB9OworCisgICAgICAgICAgICBzY29wZS4kd2F0Y2goJ2N1cnJlbnREYXRlJywgZnVuY3Rpb24gKHZhbHVlKSB7CisgICAgICAgICAgICAgICAgaWYoYW5ndWxhci5pc0RhdGUodmFsdWUpICYmICFpc05hTih2YWx1ZSkgJiYgZGF0ZXBpY2tlckN0cmwuaXNEaXNhYmxlZCh2YWx1ZSkpIHsKKyAgICAgICAgICAgICAgICAgICAgc2NvcGUuY3VycmVudERhdGUgPSBudWxsOworICAgICAgICAgICAgICAgICAgICByZXR1cm47CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIGlmIChhdHRycy5mcm9tKSB7CisgICAgICAgICAgICAgICAgICAgIGlmICghaXNOYU4odmFsdWUpICYmICFpc05hTihzY29wZS5mcm9tRGF0ZSkgJiYgZGF0ZXBpY2tlckN0cmwuY29tcGFyZSh2YWx1ZSwgc2NvcGUuZnJvbURhdGUpIDwgMCkgeworICAgICAgICAgICAgICAgICAgICAgICAgc3dhcERhdGUoc2NvcGUuZnJvbURhdGUsIHZhbHVlKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybjsKKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICBpZiAoY2FsZW5kYXJTZWxlY3RlZCkgeworICAgICAgICAgICAgICAgICAgICByZWZpbGwoKTsKKyAgICAgICAgICAgICAgICAgICAgY2FsZW5kYXJTZWxlY3RlZCA9IGZhbHNlOworICAgICAgICAgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICAgICAgICAgIGlmIChhbmd1bGFyLmlzRGVmaW5lZCh2YWx1ZSkgJiYgdmFsdWUgIT09IG51bGwpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIHJlZmlsbCh2YWx1ZSk7CisgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICAgICAgICAgICAgICByZWZpbGwoKTsKKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICBzY29wZS5mb2N1c2VkRGF0ZSA9IHVuZGVmaW5lZDsKKyAgICAgICAgICAgIH0pOworICAgICAgICAgICAgCisgICAgICAgICAgICBzY29wZS4kd2F0Y2goJ2Zyb21EYXRlJywgZnVuY3Rpb24gKHZhbHVlKSB7CisgICAgICAgICAgICAgICAgaWYoYW5ndWxhci5pc0RhdGUodmFsdWUpICYmICFpc05hTih2YWx1ZSkgJiYgZGF0ZXBpY2tlckN0cmwuaXNEaXNhYmxlZCh2YWx1ZSkpIHsKKyAgICAgICAgICAgICAgICAgICAgc2NvcGUuZnJvbURhdGUgPSBudWxsOworICAgICAgICAgICAgICAgICAgICByZXR1cm47CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIGlmIChhdHRycy5mcm9tKSB7CisgICAgICAgICAgICAgICAgICAgIGlmICghaXNOYU4oc2NvcGUuY3VycmVudERhdGUpICYmICFpc05hTih2YWx1ZSkgJiYgZGF0ZXBpY2tlckN0cmwuY29tcGFyZShzY29wZS5jdXJyZW50RGF0ZSwgdmFsdWUpIDwgMCkgeworICAgICAgICAgICAgICAgICAgICAgICAgc3dhcERhdGUodmFsdWUsIHNjb3BlLmN1cnJlbnREYXRlKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybjsKKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICBpZiAoY2FsZW5kYXJTZWxlY3RlZCkgeworICAgICAgICAgICAgICAgICAgICAgICAgcmVmaWxsKCk7CisgICAgICAgICAgICAgICAgICAgICAgICBjYWxlbmRhclNlbGVjdGVkID0gZmFsc2U7CisgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICAgICAgICAgICAgICBpZiAoYW5ndWxhci5pc0RlZmluZWQodmFsdWUpICYmIHZhbHVlICE9PSBudWxsKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmVmaWxsKHZhbHVlKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmVmaWxsKCk7CisgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgc2NvcGUuZm9jdXNlZERhdGUgPSB1bmRlZmluZWQ7CisgICAgICAgICAgICB9KTsKKyAgICAgICAgfQorICAgIH07Cit9XSkKKy5kaXJlY3RpdmUoJ2RhdGVwaWNrZXJQb3B1cCcsIFsnJGRvY3VtZW50JywgJ2RhdGVwaWNrZXJTZXJ2aWNlJywgJyRpc0VsZW1lbnQnLCAnJGRvY3VtZW50QmluZCcsIGZ1bmN0aW9uKCRkb2N1bWVudCwgZGF0ZXBpY2tlclNlcnZpY2UsICRpc0VsZW1lbnQsICRkb2N1bWVudEJpbmQpIHsKKyAgICB2YXIgbGluayA9IGZ1bmN0aW9uIChzY29wZSwgZWxlbSwgYXR0ciwgY3RybCkgeworICAgICAgICBkYXRlcGlja2VyU2VydmljZS5iaW5kU2NvcGUoYXR0ciwgc2NvcGUpOworCisgICAgICAgIHNjb3BlLmlzT3BlbiA9IGZhbHNlOworCisgICAgICAgIHZhciB0b2dnbGUgPSBzY29wZS50b2dnbGUgPSBmdW5jdGlvbiAoc2hvdykgeworICAgICAgICAgICAgaWYoc2hvdyA9PT0gdHJ1ZSB8fCBzaG93ID09PSBmYWxzZSkgeworICAgICAgICAgICAgICAgIHNjb3BlLmlzT3BlbiA9IHNob3c7CisgICAgICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgICAgIHNjb3BlLmlzT3BlbiA9ICFzY29wZS5pc09wZW47CisgICAgICAgICAgICB9CisgICAgICAgIH07CisKKyAgICAgICAgc2NvcGUuJHdhdGNoKCdjdXJyZW50JywgZnVuY3Rpb24gKCkgeworICAgICAgICAgICAgdG9nZ2xlKGZhbHNlKTsKKyAgICAgICAgfSk7CisKKyAgICAgICAgdmFyIG91dHNpZGVDbGljayA9IGZ1bmN0aW9uIChlKSB7CisgICAgICAgICAgICB2YXIgaXNFbGVtZW50ID0gJGlzRWxlbWVudChhbmd1bGFyLmVsZW1lbnQoZS50YXJnZXQpLCBlbGVtLCAkZG9jdW1lbnQpOworICAgICAgICAgICAgaWYoIWlzRWxlbWVudCkgeworICAgICAgICAgICAgICAgIHRvZ2dsZShmYWxzZSk7CisgICAgICAgICAgICAgICAgc2NvcGUuJGFwcGx5KCk7CisgICAgICAgICAgICB9CisgICAgICAgIH07CisKKyAgICAgICAgJGRvY3VtZW50QmluZC5jbGljaygnaXNPcGVuJywgb3V0c2lkZUNsaWNrLCBzY29wZSk7CisgICAgfTsKKworICAgIHJldHVybiB7CisgICAgICAgIHJlc3RyaWN0OiAnRUEnLAorICAgICAgICByZXBsYWNlOiB0cnVlLAorICAgICAgICB0cmFuc2NsdWRlOiB0cnVlLAorICAgICAgICB0ZW1wbGF0ZVVybDogJ2FwcC9zY3JpcHRzL25nX2pzX2F0dF90cGxzL2RhdGVwaWNrZXIvZGF0ZXBpY2tlclBvcHVwLmh0bWwnLAorICAgICAgICBzY29wZTogeworICAgICAgICAgICAgY3VycmVudDogIj1jdXJyZW50IgorICAgICAgICB9LAorICAgICAgICBjb21waWxlOiBmdW5jdGlvbiAoZWxlbSwgYXR0cikgeworICAgICAgICAgICAgdmFyIHdyYXBwZXJFbGVtZW50ID0gZWxlbS5maW5kKCdzcGFuJykuZXEoMSk7CisgICAgICAgICAgICB3cmFwcGVyRWxlbWVudC5hdHRyKCdjdXJyZW50JywgJ2N1cnJlbnQnKTsKKyAgICAgICAgICAgIGRhdGVwaWNrZXJTZXJ2aWNlLnNldEF0dHJpYnV0ZXMoYXR0ciwgd3JhcHBlckVsZW1lbnQpOworCisgICAgICAgICAgICByZXR1cm4gbGluazsKKyAgICAgICAgfQorICAgIH07Cit9XSkKKworLmRpcmVjdGl2ZSgnYXR0RGF0ZXBpY2tlcicsIFsnJGxvZycsIGZ1bmN0aW9uKCRsb2cpIHsKKyAgICByZXR1cm4geworICAgICAgICByZXN0cmljdDogJ0EnLAorICAgICAgICByZXF1aXJlOiAnbmdNb2RlbCcsCisgICAgICAgIHNjb3BlOiB7fSwKKyAgICAgICAgY29udHJvbGxlcjogWyckc2NvcGUnLCAnJGVsZW1lbnQnLCAnJGF0dHJzJywgJyRjb21waWxlJywgJ2RhdGVwaWNrZXJDb25maWcnLCAnZGF0ZXBpY2tlclNlcnZpY2UnLCBmdW5jdGlvbigkc2NvcGUsICRlbGVtZW50LCAkYXR0cnMsICRjb21waWxlLCBkYXRlcGlja2VyQ29uZmlnLCBkYXRlcGlja2VyU2VydmljZSkgeworICAgICAgICAgICAgdmFyIGRhdGVGb3JtYXRTdHJpbmcgPSBhbmd1bGFyLmlzRGVmaW5lZCgkYXR0cnMuZGF0ZUZvcm1hdCkgPyAkc2NvcGUuJHBh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0ZXBpY2tlclNlcnZpY2Uuc2V0QXR0cmlidXRlcygkYXR0cnMsIHdyYXBwZXJFbGVtZW50KTsKKyAgICAgICAgICAgIGRhdGVwaWNrZXJTZXJ2aWNlLmJpbmRTY29wZSgkYXR0cnMsICRzY29wZSk7CisgICAgICAgICAgICAKKyAgICAgICAgICAgIHdyYXBwZXJFbGVtZW50Lmh0bWwoJycpOworICAgICAgICAgICAgd3JhcHBlckVsZW1lbnQuYXBwZW5kKCRlbGVtZW50LnByb3AoJ291dGVySFRNTCcpKTsKKyAgICAgICAgICAgIGlmIChuYXZpZ2F0b3IudXNlckFnZW50Lm1hdGNoKC9NU0lFIDgvKSA9PT0gbnVsbCkgeworICAgICAgICAgICAgICAgIHdyYXBwZXJFbGVtZW50LmFwcGVuZChzZWxlY3RlZERhdGVNZXNzYWdlKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIHZhciBlbG0gPSB3cmFwcGVyRWxlbWVudC5wcm9wKCdvdXRlckhUTUwnKTsKKyAgICAgICAgICAgIGVsbSA9ICRjb21waWxlKGVsbSkoJHNjb3BlKTsKKyAgICAgICAgICAgICRlbGVtZW50LnJlcGxhY2VXaXRoKGVsbSk7CisgICAgICAgIH1dLAorICAgICAgICBsaW5rOiBmdW5jdGlvbihzY29wZSwgZWxlbSwgYXR0ciwgY3RybCkgeworICAgICAgICAgICAgaWYgKCFjdHJsKSB7CisgICAgICAgICAgICAgICAgJGxvZy5lcnJvcigibmctbW9kZWwgaXMgcmVxdWlyZWQuIik7CisgICAgICAgICAgICAgICAgcmV0dXJuOyAvLyBkbyBub3RoaW5nIGlmIG5vIG5nLW1vZGVsCisgICAgICAgICAgICB9CisKKyAgICAgICAgICAgIHNjb3BlLiR3YXRjaCgnY3VycmVudCcsIGZ1bmN0aW9uKHZhbHVlKSB7CisgICAgICAgICAgICAgICAgY3RybC4kc2V0Vmlld1ZhbHVlKHZhbHVlKTsKKyAgICAgICAgICAgIH0pOworICAgICAgICAgICAgY3RybC4kcmVuZGVyID0gZnVuY3Rpb24oKSB7CisgICAgICAgICAgICAgICAgc2NvcGUuY3VycmVudCA9IGN0cmwuJHZpZXdWYWx1ZTsKKyAgICAgICAgICAgIH07CisgICAgICAgIH0KKyAgICB9OworfV0pCisKKy5kaXJlY3RpdmUoJ2Zvcm1hdERhdGUnLCBbJ2RhdGVGaWx0ZXInLCAnZGF0ZXBpY2tlclNlcnZpY2UnLCBmdW5jdGlvbihkYXRlRmlsdGVyLCBkYXRlcGlja2VyU2VydmljZSkgeworICAgIHJldHVybiB7CisgICAgICAgIHJlc3RyaWN0OiAnQScsCisgICAgICAgIHJlcXVpcmU6ICduZ01vZGVsJywKKyAgICAgICAgbGluazogZnVuY3Rpb24oc2NvcGUsIGVsZW0sIGF0dHIsIGN0cmwpIHsKKyAgICAgICAgICAgIHZhciBmb3JtYXREYXRlID0gIiI7CisgICAgICAgICAgICBhdHRyLiRvYnNlcnZlKCdmb3JtYXREYXRlJywgZnVuY3Rpb24gKHZhbHVlKSB7CisgICAgICAgICAgICAgICAgZm9ybWF0RGF0ZSA9IHZhbHVlOworICAgICAgICAgICAgfSk7CisgICAgICAgICAgICB2YXIgZGF0ZVRvU3RyaW5nID0gZnVuY3Rpb24odmFsdWUpIHsKKyAgICAgICAgICAgICAgICBpZiAodmFsdWUpIHsKKyAgICAgICAgICAgICAgICAgICAgY3RybC4kc2V0VmFsaWRpdHkoJ2ludmFsaWREYXRlJywgdHJ1ZSk7CisgICAgICAgICAgICAgICAgICAgIHJldHVybiBkYXRlRmlsdGVyKHZhbHVlLCBmb3JtYXREYXRlKTsKKyAgICAgICAgICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgICAgICAgICBjdHJsLiRzZXRWYWxpZGl0eSgnaW52YWxpZERhdGUnLCBmYWxzZSk7CisgICAgICAgICAgICAgICAgICAgIHJldHVybiBlbGVtLnZhbCgpOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH07CisgICAgICAgICAgICB2YXIgc3RyaW5nVG9EYXRlID0gZnVuY3Rpb24odmFsdWUpIHsKKyAgICAgICAgICAgICAgICBpZihkYXRlcGlja2VyU2VydmljZS52YWxpZGF0ZURhdGVTdHJpbmcodmFsdWUsIGZvcm1hdERhdGUpKSB7CisgICAgICAgICAgICAgICAgICAgIGN0cmwuJHNldFZhbGlkaXR5KCdpbnZhbGlkRGF0ZScsIHRydWUpOworICAgICAgICAgICAgICAgICAgICByZXR1cm4gbmV3IERhdGUodmFsdWUpOworICAgICAgICAgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICAgICAgICAgIGN0cmwuJHNldFZhbGlkaXR5KCdpbnZhbGlkRGF0ZScsIGZhbHNlKTsKKyAgICAgICAgICAgICAgICAgICAgcmV0dXJuIG51bGw7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfTsKKyAgICAgICAgICAgIGN0cmwuJGZvcm1hdHRlcnMudW5zaGlmdChkYXRlVG9TdHJpbmcpOworICAgICAgICAgICAgY3RybC4kcGFyc2Vycy51bnNoaWZ0KHN0cmluZ1RvRGF0ZSk7CisgICAgICAgIH0KKyAgICB9OworfV0pCisKKy5kaXJlY3RpdmUoJ2F0dERhdGVGaWx0ZXInLCBbJyRkb2N1bWVudCcsICdkYXRlRmlsdGVyJywgJ2RhdGVwaWNrZXJDb25maWcnLCAnZGF0ZXBpY2tlclNlcnZpY2UnLCAnJGlzRWxlbWVudCcsICckZG9jdW1lbnRCaW5kJywgZnVuY3Rpb24oJGRvY3VtZW50LCBkYXRlRmlsdGVyLCBkYXRlcGlja2VyQ29uZmlnLCBkYXRlcGlja2VyU2VydmljZSwgJGlzRWxlbWVudCwgJGRvY3VtZW50QmluZCkgeworCQorICAgIHZhciBsaW5rID0gZnVuY3Rpb24gKHNjb3BlLCBlbGVtLCBhdHRyLCBjdHJsKSB7CisgICAgICAgIGRhdGVwaWNrZXJTZXJ2aWNlLmJpbmRTY29wZShhdHRyLCBzY29wZSk7CisKKyAgICAgICAgc2NvcGUuc2VsZWN0ZWRPcHRpb24gPSBkYXRlcGlja2VyQ29uZmlnLmRhdGVGaWx0ZXIuZGVmYXVsdFRleHQ7CisgICAgICAgIHNjb3BlLnNob3dEcm9wZG93bkxpc3QgPSBmYWxzZTsKKyAgICAgICAgc2NvcGUuc2hvd0NhbGVuZGFyID0gZmFsc2U7CisgICAgICAgIHNjb3BlLmFwcGx5QnV0dG9uVHlwZSA9ICJkaXNhYmxlZCI7CisKKyAgICAgICAgc2NvcGUuY3VycmVudFNlbGVjdGlvbiA9ICIiOworICAgICAgICB2YXIgZGF0ZUZvcm1hdFN0cmluZyA9IGFuZ3VsYXIuaXNEZWZpbmVkKGF0dHIuZGF0ZUZvcm1hdCkgPyBzY29wZS4kcGFyZW50LiRldmFsKGF0dHIuZGF0ZUZvcm1hdCkgOiBkYXRlcGlja2VyQ29uZmlnLmRhdGVGb3JtYXQ7CisgICAgICAgIHZhciBpbnB1dENoYW5nZSA9IGZhbHNlOworCisgICAgICAgIAorCisgICAgICAgIHZhciBzaG93RHJvcGRvd24gPSBzY29wZS5zaG93RHJvcGRvd24gPSBmdW5jdGlvbiAoc2hvdykgeworICAgICAgICAgICAgaWYoc2hvdyA9PT0gdHJ1ZSB8fCBzaG93ID09PSBmYWxzZSkgeworICAgICAgICAgICAgICAgIHNjb3BlLnNob3dEcm9wZG93bkxpc3QgPSBzaG93OworICAgICAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgICAgICBzY29wZS5zaG93RHJvcGRvd25MaXN0ID0gIXNjb3BlLnNob3dEcm9wZG93bkxpc3Q7CisgICAgICAgICAgICB9CisKKyAgICAgICAgICAgIGlmICghc2NvcGUuc2hvd0Ryb3Bkb3duTGlzdCkgeworCQkJCXNjb3BlLmZvY3VzSW5wdXRCdXR0b24gPSB0cnVlOworICAgICAgICAgICAgICAgIGhpZGVDYWxlbmRhcigpOworICAgICAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgICAgICBpZiAoc2NvcGUuY3VycmVudFNlbGVjdGlvbiA9PT0gJ0N1c3RvbSBTaW5nbGUgRGF0ZScgfHwgc2NvcGUuY3VycmVudFNlbGVjdGlvbiA9PT0gJ0N1c3RvbSBSYW5nZScpIHsKKyAgICAgICAgICAgICAgICAgICAgc2hvd0NhbGVuZGFyKCk7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfQorICAgICAgICB9OworCisgICAgICAgIHZhciByZXNldFRpbWUgPSBzY29wZS5yZXNldFRpbWUgPSBmdW5jdGlvbihkYXRlKSB7CisgICAgICAgICAgICB2YXIgZHQ7CisgICAgICAgICAgICBpZiAoIWlzTmFOKG5ldyBEYXRlKGRhdGUpKSkgeworICAgICAgICAgICAgICAgIGR0ID0gbmV3IERhdGUoZGF0ZSk7CisgICAgICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgICAgIHJldHVybiBudWxsOworICAgICAgICAgICAgfQorICAgICAgICAgICAgcmV0dXJuIG5ldyBEYXRlKGR0LmdldEZ1bGxZZWFyKCksIGR0LmdldE1vbnRoKCksIGR0LmdldERhdGUoKSk7CisgICAgICAgIH07CisKKyAgICAgICAgdmFyIGFkZERheXMgPSBzY29wZS5hZGREYXlzID0gZnVuY3Rpb24gKGRhdGUsIGRheXMpIHsKKyAgICAgICAgICAgIHZhciBkdDsKKyAgICAgICAgICAgIGlmICghaXNOYU4obmV3IERhdGUoZGF0ZSkpICYmICFpc05hTihkYXlzKSkgeworICAgICAgICAgICAgICAgIGR0ID0gbmV3IERhdGUoZGF0ZSk7CisgICAgICAgICAgICAgICAgZHQuc2V0RGF0ZShkdC5nZXREYXRlKCkgKyBkYXlzKTsKKyAgICAgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICAgICAgZHQgPSBuZXcgRGF0ZSgpOworICAgICAgICAgICAgfQorICAgICAgICAgICAgcmV0dXJuIGR0OworICAgICAgICB9OworCQl2YXIgYWRkTW9udGggPSBzY29wZS5hZGRNb250aCA9IGZ1bmN0aW9uIChkYXRlLCBtb250aHMpIHsKKyAgICAgICAgICAgIHZhciBkdDsKKyAgICAgICAgICAgIGlmICghaXNOYU4obmV3IERhdGUoZGF0ZSkpICYmICFpc05hTihtb250aHMpKSB7CisgICAgICAgICAgICAgICAgZHQgPSBuZXcgRGF0ZShkYXRlKTsKKyAgICAgICAgICAgICAgICBkdC5zZXRNb250aChkdC5nZXRNb250aCgpICsgbW9udGhzKTsKKyAgICAgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICAgICAgZHQgPSBuZXcgRGF0ZSgpOworICAgICAgICAgICAgfQorICAgICAgICAgICAgcmV0dXJuIGR0OworICAgICAgICB9OyAgICAgIAorCisgICAgICAgIHZhciBzaG93Q2FsZW5kYXIgPSBmdW5jdGlvbigpIHsKKyAgICAgICAgICAgIHNjb3BlLnNob3dDYWxlbmRhciA9IHRydWU7CisgICAgICAgIH07CisKKyAgICAgICAgdmFyIGhpZGVDYWxlbmRhciA9IGZ1bmN0aW9uKCkgeworICAgICAgICAgICAgc2NvcGUuc2hvd0NhbGVuZGFyID0gZmFsc2U7CisgICAgICAgICAgICBpZihzY29wZS5jdXJyZW50U2VsZWN0aW9uICE9PSAnQ3VzdG9tIFNpbmdsZSBEYXRlJyAmJiBzY29wZS5jdXJyZW50U2VsZWN0aW9uICE9PSAnQ3VzdG9tIFJhbmdlJykgeworICAgICAgICAgICAgICAgIGNsZWFyKHRydWUpOworICAgICAgICAgICAgfQorICAgICAgICB9OworCisgICAgICAgIHZhciBzZXREcm9wZG93blRleHQgPSBmdW5jdGlvbih2YWx1ZSkgeworICAgICAgICAgICAgaWYoaW5wdXRDaGFuZ2UpIHsKKyAgICAgICAgICAgICAgICByZXR1cm47CisgICAgICAgICAgICB9CisKKyAgICAgICAgICAgIHZhciBmcm9tRGF0ZVRleHQgPSBkYXRlRm9ybWF0U3RyaW5nLnRvVXBwZXJDYXNlKCk7CisgICAgICAgICAgICB2YXIgY3VycmVudERhdGVUZXh0ID0gZGF0ZUZvcm1hdFN0cmluZy50b1VwcGVyQ2FzZSgpOworCisgICAgICAgICAgICBpZighaXNOYU4obmV3IERhdGUoc2NvcGUuZnJvbURhdGUpKSkgeworICAgICAgICAgICAgICAgIGZyb21EYXRlVGV4dCA9IGRhdGVGaWx0ZXIoc2NvcGUuZnJvbURhdGUsIGRhdGVGb3JtYXRTdHJpbmcpOworICAgICAgICAgICAgfQorICAgICAgICAgICAgaWYoIWlzTmFOKG5ldyBEYXRlKHNjb3BlLmN1cnJlbnREYXRlKSkpIHsKKyAgICAgICAgICAgICAgICBjdXJyZW50RGF0ZVRleHQgPSBkYXRlRmlsdGVyKHNjb3BlLmN1cnJlbnREYXRlLCBkYXRlRm9ybWF0U3RyaW5nKTsKKyAgICAgICAgICAgIH0KKworICAgICAgICAgICAgaWYodmFsdWUgPT09ICdDdXN0b20gU2luZ2xlIERhdGUnKSB7CisgICAgICAgICAgICAgICAgY3RybC4kc2V0VmFsaWRpdHkoJ2ludmFsaWREYXRlJywgdHJ1ZSk7CisgICAgICAgICAgICAgICAgc2NvcGUubWF4TGVuZ3RoID0gMTA7CisgICAgICAgICAgICAgICAgc2NvcGUuc2VsZWN0ZWRPcHRpb24gPSBjdXJyZW50RGF0ZVRleHQ7CisgICAgICAgICAgICB9IGVsc2UgaWYodmFsdWUgPT09ICdDdXN0b20gUmFuZ2UnKSB7CisgICAgICAgICAgICAgICAgY3RybC4kc2V0VmFsaWRpdHkoJ2ludmFsaWREYXRlJywgdHJ1ZSk7CisgICAgICAgICAgICAgICAgY3RybC4kc2V0VmFsaWRpdHkoJ2ludmFsaWREYXRlUmFuZ2UnLCB0cnVlKTsKKyAgICAgICAgICAgICAgICBzY29wZS5tYXhMZW5ndGggPSAyMTsKKyAgICAgICAgICAgICAgICBzY29wZS5zZWxlY3RlZE9wdGlvbiA9IGZyb21EYXRlVGV4dCArICctJyArIGN1cnJlbnREYXRlVGV4dDsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfTsKKworICAgICAgICBzY29wZS5nZXREcm9wZG93blRleHQgPSBmdW5jdGlvbiAoKSB7CisgICAgICAgICAgICBpbnB1dENoYW5nZSA9IHRydWU7CisgICAgICAgICAgICB2YXIgZHJvcGRvd25UZXh0ID0gc2NvcGUuc2VsZWN0ZWRPcHRpb247CisKKyAgICAgICAgICAgIGlmIChzY29wZS5jdXJyZW50U2VsZWN0aW9uID09PSAnQ3VzdG9tIFNpbmdsZSBEYXRlJykgeworICAgICAgICAgICAgICAgIGlmICghaXNOYU4obmV3IERhdGUoZHJvcGRvd25UZXh0KSkgJiYgZGF0ZXBpY2tlclNlcnZpY2UudmFsaWRhdGVEYXRlU3RyaW5nKGRyb3Bkb3duVGV4dCwgZGF0ZUZvcm1hdFN0cmluZykpIHsKKyAgICAgICAgICAgICAgICAgICAgY3RybC4kc2V0VmFsaWRpdHkoJ2ludmFsaWREYXRlJywgdHJ1ZSk7CisgICAgICAgICAgICAgICAgICAgIHNjb3BlLmZyb21EYXRlID0gdW5kZWZpbmVkOworICAgICAgICAgICAgICAgICAgICBzY29wZS5jdXJyZW50RGF0ZSA9IG5ldyBEYXRlKGRyb3Bkb3duVGV4dCk7CisgICAgICAgICAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgICAgICAgICAgY3RybC4kc2V0VmFsaWRpdHkoJ2ludmFsaWREYXRlJywgZmFsc2UpOworICAgICAgICAgICAgICAgICAgICBjbGVhcih0cnVlKTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9IGVsc2UgaWYgKHNjb3BlLmN1cnJlbnRTZWxlY3Rpb24gPT09ICdDdXN0b20gUmFuZ2UnKSB7CisgICAgICAgICAgICAgICAgaWYgKGRyb3Bkb3duVGV4dC5pbmRleE9mKCctJykgIT09IC0xICYmIChkcm9wZG93blRleHQuc3BsaXQoJy0nKS5sZW5ndGggPT09IDIgfHwgZHJvcGRvd25UZXh0LnNwbGl0KCctJykubGVuZ3RoID09PSA2KSkgeworICAgICAgICAgICAgICAgICAgICBjdHJsLiRzZXRWYWxpZGl0eSgnaW52YWxpZERhdGVSYW5nZScsIHRydWUpOworICAgICAgICAgICAgICAgICAgICB2YXIgcmVzdWx0RHJvcGRvd25UZXh0ID0gZHJvcGRvd25UZXh0LnNwbGl0KCctJyk7CisgICAgICAgICAgICAgICAgICAgIGlmIChyZXN1bHREcm9wZG93blRleHQubGVuZ3RoID09PSAyKSB7CisgICAgICAgICAgICAgICAgICAgICAgICByZXN1bHREcm9wZG93blRleHRbMF0gPSByZXN1bHREcm9wZG93blRleHRbMF0udHJpbSgpOworICAgICAgICAgICAgICAgICAgICAgICAgcmVzdWx0RHJvcGRvd25UZXh0WzFdID0gcmVzdWx0RHJvcGRvd25UZXh0WzFdLnRyaW0oKTsKKyAgICAgICAgICAgICAgICAgICAgfSBlbHNlIGlmIChyZXN1bHREcm9wZG93blRleHQubGVuZ3RoID09PSA2KSB7CisgICAgICAgICAgICAgICAgICAgICAgICB2YXIgZmlyc3REYXRlU3RyaW5nID0gcmVzdWx0RHJvcGRvd25UZXh0WzBdLnRyaW0oKSArICctJyArIHJlc3VsdERyb3Bkb3duVGV4dFsxXS50cmltKCkgKyAnLScgKyByZXN1bHREcm9wZG93blRleHRbMl0udHJpbSgpOworICAgICAgICAgICAgICAgICAgICAgICAgdmFyIHNlY29uZERhdGVTdHJpbmcgPSByZXN1bHREcm9wZG93blRleHRbM10udHJpbSgpICsgJy0nICsgcmVzdWx0RHJvcGRvd25UZXh0WzRdLnRyaW0oKSArICctJyArIHJlc3VsdERyb3Bkb3duVGV4dFs1XS50cmltKCk7CisgICAgICAgICAgICAgICAgICAgICAgICByZXN1bHREcm9wZG93blRleHRbMF0gPSBmaXJzdERhdGVTdHJpbmc7CisgICAgICAgICAgICAgICAgICAgICAgICByZXN1bHREcm9wZG93blRleHRbMV0gPSBzZWNvbmREYXRlU3RyaW5nOworICAgICAgICAgICAgICAgICAgICB9CisKKyAgICAgICAgICAgICAgICAgICAgaWYgKCFpc05hTihuZXcgRGF0ZShyZXN1bHREcm9wZG93blRleHRbMF0pKSAmJiAhaXNOYU4obmV3IERhdGUocmVzdWx0RHJvcGRvd25UZXh0WzFdKSkgJiYgZGF0ZXBpY2tlclNlcnZpY2UudmFsaWRhdGVEYXRlU3RyaW5nKHJlc3VsdERyb3Bkb3duVGV4dFswXSwgZGF0ZUZvcm1hdFN0cmluZykgJiYgZGF0ZXBpY2tlclNlcnZpY2UudmFsaWRhdGVEYXRlU3RyaW5nKHJlc3VsdERyb3Bkb3duVGV4dFsxXSwgZGF0ZUZvcm1hdFN0cmluZykpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIGN0cmwuJHNldFZhbGlkaXR5KCdpbnZhbGlkRGF0ZScsIHRydWUpOworICAgICAgICAgICAgICAgICAgICAgICAgdmFyIGZyb21EYXRlID0gbmV3IERhdGUocmVzdWx0RHJvcGRvd25UZXh0WzBdKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIHZhciBjdXJyZW50RGF0ZSA9IG5ldyBEYXRlKHJlc3VsdERyb3Bkb3duVGV4dFsxXSk7CisgICAgICAgICAgICAgICAgICAgICAgICBpZihmcm9tRGF0ZS5nZXRUaW1lKCkgPCBjdXJyZW50RGF0ZS5nZXRUaW1lKCkpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBjdHJsLiRzZXRWYWxpZGl0eSgnaW52YWxpZERhdGVSYW5nZScsIHRydWUpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNjb3BlLmZyb21EYXRlID0gZnJvbURhdGU7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2NvcGUuY3VycmVudERhdGUgPSBjdXJyZW50RGF0ZTsKKyAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgY3RybC4kc2V0VmFsaWRpdHkoJ2ludmFsaWREYXRlUmFuZ2UnLCBmYWxzZSk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgY2xlYXIodHJ1ZSk7CisgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICAgICAgICAgICAgICBjdHJsLiRzZXRWYWxpZGl0eSgnaW52YWxpZERhdGUnLCBmYWxzZSk7CisgICAgICAgICAgICAgICAgICAgICAgICBjbGVhcih0cnVlKTsKKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICAgICAgICAgIGN0cmwuJHNldFZhbGlkaXR5KCdpbnZhbGlkRGF0ZVJhbmdlJywgZmFsc2UpOworICAgICAgICAgICAgICAgICAgICBjbGVhcih0cnVlKTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9CisgICAgICAgIH07CisKKyAgICAgICAgc2NvcGUudW50cmFja0lucHV0Q2hhbmdlID0gZnVuY3Rpb24oZXYpIHsKKyAgICAgICAgICAgIGlucHV0Q2hhbmdlID0gZmFsc2U7CisgICAgICAgIH07CisKKyAgICAgICAgc2NvcGUuc2VsZWN0QWR2YW5jZWRPcHRpb24gPSBmdW5jdGlvbiAodmFsdWUsIG5vdENsZWFyRmxhZykgeworICAgICAgICAgICAgc2NvcGUuY3VycmVudFNlbGVjdGlvbiA9IHZhbHVlOworCQkJaWYoIW5vdENsZWFyRmxhZyl7CisJCQkJY2xlYXIoKTsKKwkJCQlzaG93Q2FsZW5kYXIoKTsKKwkJCX0JCQorICAgICAgICAgICAgc2NvcGUuJHdhdGNoKCdjdXJyZW50RGF0ZScsIGZ1bmN0aW9uKHZhbCkgeworICAgICAgICAgICAgICAgIGlmKCFpc05hTihuZXcgRGF0ZSh2YWwpKSkgeworICAgICAgICAgICAgICAgICAgICBzY29wZS5hcHBseUJ1dHRvblR5cGUgPSAicHJpbWFyeSI7CisgICAgICAgICAgICAgICAgICAgIHNldERyb3Bkb3duVGV4dCh2YWx1ZSk7CisgICAgICAgICAgICAgICAgICAgIGlmICghaW5wdXRDaGFuZ2UpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIHNjb3BlLmZvY3VzQXBwbHlCdXR0b24gPSB0cnVlOworICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfSk7CisgICAgICAgICAgICBzY29wZS4kd2F0Y2goJ2Zyb21EYXRlJywgZnVuY3Rpb24odmFsKSB7CisgICAgICAgICAgICAgICAgaWYoIWlzTmFOKG5ldyBEYXRlKHZhbCkpKSB7CisgICAgICAgICAgICAgICAgICAgIHNldERyb3Bkb3duVGV4dCh2YWx1ZSk7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfSk7CisgICAgICAgICAgICBpZiAodmFsdWUgPT09ICdDdXN0b20gU2luZ2xlIERhdGUnKSB7CisgICAgICAgICAgICAgICAgc2NvcGUuZm9jdXNTaW5nbGVEYXRlQ2FsZW5kYXIgPSB0cnVlOworICAgICAgICAgICAgfSBlbHNlIGlmICh2YWx1ZSA9PT0gJ0N1c3RvbSBSYW5nZScpIHsKKyAgICAgICAgICAgICAgICBzY29wZS5mb2N1c1JhbmdlQ2FsZW5kYXIgPSB0cnVlOworICAgICAgICAgICAgfQorICAgICAgICB9OworICAgICAgICAKKyAgICAgICAgc2NvcGUucmVzZXRGb2N1cyA9IGZ1bmN0aW9uIChldikgeworICAgICAgICAgICAgc2NvcGUuZm9jdXNTaW5nbGVEYXRlQ2FsZW5kYXIgPSBmYWxzZTsKKyAgICAgICAgICAgIHNjb3BlLmZvY3VzUmFuZ2VDYWxlbmRhciA9IGZhbHNlOworICAgICAgICAgICAgc2NvcGUuZm9jdXNBcHBseUJ1dHRvbiA9IGZhbHNlOworICAgICAgICB9OworCisgICAgICAgIHNjb3BlLmFwcGx5ID0gZnVuY3Rpb24oKSB7CisgICAgICAgICAgICBzY29wZS5kYXRlUmFuZ2Uuc2VsZWN0aW9uID0gc2NvcGUuc2VsZWN0ZWRPcHRpb247CisgICAgICAgICAgICBpZighaXNOYU4obmV3IERhdGUoc2NvcGUuZnJvbURhdGUpKSkgeworICAgICAgICAgICAgICAgIHNjb3BlLmZyb20gPSBzY29wZS5mcm9tRGF0ZTsKKyAgICAgICAgICAgICAgICBzY29wZS5kYXRlUmFuZ2UuZnJvbSA9IHNjb3BlLmZyb21EYXRlOworICAgICAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgICAgICBzY29wZS5mcm9tID0gdW5kZWZpbmVkOworICAgICAgICAgICAgICAgIHNjb3BlLmRhdGVSYW5nZS5mcm9tID0gdW5kZWZpbmVkOworICAgICAgICAgICAgfQorICAgICAgICAgICAgaWYoIWlzTmFOKG5ldyBEYXRlKHNjb3BlLmN1cnJlbnREYXRlKSkpIHsKKyAgICAgICAgICAgICAgICBzY29wZS5jdXJyZW50ID0gc2NvcGUuY3VycmVudERhdGU7CisgICAgICAgICAgICAgICAgc2NvcGUuZGF0ZVJhbmdlLmN1cnJlbnQgPSBzY29wZS5jdXJyZW50RGF0ZTsKKyAgICAgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICAgICAgc2NvcGUuY3VycmVudCA9IHVuZGVmaW5lZDsKKyAgICAgICAgICAgICAgICBzY29wZS5kYXRlUmFuZ2UuY3VycmVudCA9IHVuZGVmaW5lZDsKKyAgICAgICAgICAgIH0KKworICAgICAgICAgICAgc2hvd0Ryb3Bkb3duKCk7CisgICAgICAgIH07CisKKyAgICAgICAgc2NvcGUuJHdhdGNoQ29sbGVjdGlvbihmdW5jdGlvbigpIHsKKyAgICAgICAgICAgIHJldHVybiBzY29wZS5kYXRlUmFuZ2U7CisgICAgICAgIH0sIGZ1bmN0aW9uKHZhbHVlKSB7CisgICAgICAgICAgICBpZihjdHJsKSB7CisgICAgICAgICAgICAgICAgdmFyIGZpbmFsRGF0ZVJhbmdlID0gYW5ndWxhci5jb3B5KHZhbHVlKTsKKyAgICAgICAgICAgICAgICBjdHJsLiRzZXRWaWV3VmFsdWUoZmluYWxEYXRlUmFuZ2UpOworICAgICAgICAgICAgfQorICAgICAgICB9KTsKKworICAgICAgICBjdHJsLiRyZW5kZXI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k7CisgICAgICAgIH07CisKKyAgICAgICAgdmFyIGNsZWFyID0gc2NvcGUuY2xlYXIgPSBmdW5jdGlvbihwYXJ0aWFsKSB7CisgICAgICAgICAgICBzY29wZS5mcm9tRGF0ZSA9IHVuZGVmaW5lZDsKKyAgICAgICAgICAgIHNjb3BlLmN1cnJlbnREYXRlID0gdW5kZWZpbmVkOworICAgICAgICAgICAgc2NvcGUuYXBwbHlCdXR0b25UeXBlID0gImRpc2FibGVkIjsKKyAgICAgICAgICAgIGlmKCFwYXJ0aWFsKSB7CisgICAgICAgICAgICAgICAgY3RybC4kc2V0VmFsaWRpdHkoJ2ludmFsaWREYXRlJywgdHJ1ZSk7CisgICAgICAgICAgICAgICAgY3RybC4kc2V0VmFsaWRpdHkoJ2ludmFsaWREYXRlUmFuZ2UnLCB0cnVlKTsKKyAgICAgICAgICAgICAgICBzZXREcm9wZG93blRleHQoc2NvcGUuY3VycmVudFNlbGVjdGlvbik7CisgICAgICAgICAgICB9CisgICAgICAgIH07CisKKyAgICAgICAgdmFyIG91dHNpZGVDbGljayA9IGZ1bmN0aW9uIChlKSB7CisgICAgICAgICAgICB2YXIgaXNFbGVtZW50ID0gJGlzRWxlbWVudChhbmd1bGFyLmVsZW1lbnQoZS50YXJnZXQpLCBlbGVtLCAkZG9jdW1lbnQpOworICAgICAgICAgICAgaWYoIWlzRWxlbWVudCkgeworCQkJCXNjb3BlLmNhbmNlbCgpOworICAgICAgICAgICAgICAgIHNjb3BlLiRhcHBseSgpOworICAgICAgICAgICAgfQorICAgICAgICB9OworCisgICAgICAgICRkb2N1bWVudEJpbmQuY2xpY2soJ3Nob3dEcm9wZG93bkxpc3QnLCBvdXRzaWRlQ2xpY2ssIHNjb3BlKTsKKyAgICB9OworCisgICAgcmV0dXJuIHsKKyAgICAgICAgcmVzdHJpY3Q6ICdFQScsCisgICAgICAgIHNjb3BlOiB7CisgICAgICAgICAgICBmcm9tOiAnPT9mcm9tJywKKyAgICAgICAgICAgIGN1cnJlbnQ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29wZS5jdXJyZW50U2VsZWN0aW9uKSB7CisgICAgICAgICAgICAgICAgcmV0dXJuIHRydWU7CisgICAgICAgICAgICB9CisgICAgICAgICAgICByZXR1cm4gZmFsc2U7CisgICAgICAgIH07CisJCX1dLAorICAgICAgICBjb21waWxlOiBmdW5jdGlvbihlbGVtLCBhdHRyKSB7CisgICAgICAgICAgICB2YXIgc2luZ2xlRGF0ZUNhbGVuZGFyID0gZWxlbS5maW5kKCdzcGFuJykuZXEoNCk7CisgICAgICAgICAgICB2YXIgcmFuZ2VDYWxlbmRhciA9IGVsZW0uZmluZCgnc3BhbicpLmVxKDUpOworICAgICAgICAgICAgcmFuZ2VDYWxlbmRhci5hdHRyKCdmcm9tJywgJ2Zyb21EYXRlJyk7CisgICAgICAgICAgICBzaW5nbGVEYXRlQ2FsZW5kYXIuYXR0cignY3VycmVudCcsICdjdXJyZW50RGF0ZScpOworICAgICAgICAgICAgcmFuZ2VDYWxlbmRhci5hdHRyKCdjdXJyZW50JywgJ2N1cnJlbnREYXRlJyk7CisgICAgICAgICAgICBkYXRlcGlja2VyU2VydmljZS5zZXRBdHRyaWJ1dGVzKGF0dHIsIHNpbmdsZURhdGVDYWxlbmRhcik7CisgICAgICAgICAgICBkYXRlcGlja2VyU2VydmljZS5zZXRBdHRyaWJ1dGVzKGF0dHIsIHJhbmdlQ2FsZW5kYXIpOworCisgICAgICAgICAgICByZXR1cm4gbGluazsKKyAgICAgICAgfQorICAgIH07Cit9XSkKKy5kaXJlY3RpdmUoJ2F0dERhdGVGaWx0ZXJMaXN0JyxmdW5jdGlvbigpeworCXJldHVybnsKKwkJcmVzdHJpY3Q6J0VBJywKKwkJc2NvcGU6eworCQkJZnJvbURhdGU6Jz1mcm9tRGF0ZScsCisJCQl0b0RhdGU6Jz10b0RhdGUnLAorCQkJY2FwdGlvbjonPWNhcHRpb24nLAorCQkJZGlzYWJsZWQ6Jz1kaXNhYmxlZCcKKwkJfSwKKwkJcmVxdWlyZTonXmF0dERhdGVG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FkZFBhbmUgPSBmdW5jdGlvbihwYW5lKSB7CisgICAgICAgICAgICBpZiAocGFuZXMubGVuZ3RoID09PSAwKSB7CisgICAgICAgICAgICAgICAgJHNjb3BlLnNlbGVjdChwYW5lKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICBwYW5lcy5wdXNoKHBhbmUpOworICAgICAgICB9OworICAgICAgfSwKKyAgICAgIHRlbXBsYXRlOic8ZGl2PicrCisgICAgICAgICc8dWwgY2xhc3M9InRhYnMiPicgKworICAgICAgICAgICAgJzxsaSBuZy1yZXBlYXQ9InBhbmUgaW4gcGFuZXMiIG5nLWNsYXNzPSJ7YWN0aXZlOnBhbmUuc2VsZWN0ZWR9Ij4nKworICAgICAgICAgICAgICAnPGEgaHJlZj0iamF2YXNjcmlwdDp2b2lkKDApIiBuZy1jbGljaz0ic2VsZWN0KHBhbmUpIj57e3BhbmUudGl0bGV9fTwvYT4nICsKKyAgICAgICAgICAgICc8L2xpPicgKworICAgICAgICAgICc8L3VsPicgKworICAgICAgICAgICc8ZGl2IG5nLXRyYW5zY2x1ZGU+PC9kaXY+JysKKyAgICAgICAgICAnPC9kaXY+JywKKyAgICAgICAgICByZXBsYWNlOiB0cnVlCisgICAgfTsKKyAgfSkKKworICAuZGlyZWN0aXZlKCdwYW5lJywgZnVuY3Rpb24oKSB7CisgICAgcmV0dXJuIHsKKyAgICAgIHJlcXVpcmU6ICdeYXR0RGV2Tm90ZXMnLAorICAgICAgcmVzdHJpY3Q6ICdFQScsCisgICAgICB0cmFuc2NsdWRlOiB0cnVlLAorICAgICAgc2NvcGU6IHsKKyAgICAgICAgICB0aXRsZTogJ0AnCisgICAgICB9LAorICAgICAgbGluazogZnVuY3Rpb24oc2NvcGUsIGVsZW1lbnQsIGF0dHJzLCB0YWJzQ3RybCkgeworICAgICAgICB0YWJzQ3RybC5hZGRQYW5lKHNjb3BlKTsKKyAgICAgIH0sCisgICAgICB0ZW1wbGF0ZToKKyAgICAgICAgJzxkaXYgY2xhc3M9InRhYi1wYW5lIiBuZy1jbGFzcz0ie2FjdGl2ZTogc2VsZWN0ZWR9Ij4nICsKKyAgICAgICAgJzxwcmUgbmctY2xhc3M9IntcJ2xhbmd1YWdlLW1hcmt1cFwnOnRpdGxlPT1cJ0hUTUxcJyxcJ2xhbmd1YWdlLWphdmFzY3JpcHRcJzp0aXRsZT09XCdKYXZhU2NyaXB0XCd9IiAgY2xhc3M9IiBsaW5lLW51bWJlcnMiPicgKworICAgICAgICAgJzxjb2RlIG5nLXRyYW5zY2x1ZGU+PC9jb2RlPicgKworICAgICAgICAgJzwvcHJlPicgKworICAgICAgICAnPC9kaXY+JywKKyAgICAgIHJlcGxhY2U6IHRydWUKKyAgICB9OworICB9KTsKKworYW5ndWxhci5tb2R1bGUoJ2F0dC5hYnMuZGl2aWRlckxpbmVzJywgW10pCisgICAgICAgIC5kaXJlY3RpdmUoJ2F0dERpdmlkZXJMaW5lcycsIFtmdW5jdGlvbigpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgcmV0dXJuIHsKKyAgICAgICAgICAgICAgICAgICAgc2NvcGU6IHsKKyAgICAgICAgICAgICAgICAgICAgICAgIGF0dERpdmlkZXJMaW5lczogJ0AnCisgICAgICAgICAgICAgICAgICAgIH0sCisgICAgICAgICAgICAgICAgICAgIHJlc3RyaWN0OiAnQScsCisgICAgICAgICAgICAgICAgICAgIHJlcGxhY2U6IHRydWUsCisgICAgICAgICAgICAgICAgICAgIHRlbXBsYXRlVXJsOiAnYXBwL3NjcmlwdHMvbmdfanNfYXR0X3RwbHMvZGl2aWRlckxpbmVzL2RpdmlkZXJMaW5lcy5odG1sJywKKyAgICAgICAgICAgICAgICAgICAgbGluazogZnVuY3Rpb24oc2NvcGUsIGVsZW1lbnQsIGF0dHJpYnV0ZSkKKyAgICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAgICAgc2NvcGUubGlnaHRDb250YWluZXIgPSBhdHRyaWJ1dGUuYXR0RGl2aWRlckxpbmVzOworICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgfTsKKyAgICAgICAgICAgIH1dKTsKKworYW5ndWxhci5tb2R1bGUoJ2F0dC5hYnMuZHJhZ2Ryb3AnLCBbXSkKKyAgICAgICAgLmRpcmVjdGl2ZSgnYXR0RmlsZURyb3AnLCBbJyRwYXJzZScsIGZ1bmN0aW9uKCRwYXJzZSkgeworICAgICAgICAgICAgICAgIHJldHVybiB7CisgICAgICAgICAgICAgICAgICAgIHJlc3RyaWN0OiAnQScsCisgICAgICAgICAgICAgICAgICAgIHNjb3BlOiB7CisgICAgICAgICAgICAgICAgICAgICAgICBmaWxlTW9kZWwgOiAnPScsCisgICAgICAgICAgICAgICAgICAgICAgICBvbkRyb3AgOiAnJicsCisgICAgICAgICAgICAgICAgICAgICAgICBhdHRGaWxlRHJvcCA6ICcmJworICAgICAgICAgICAgICAgICAgICB9LAorICAgICAgICAgICAgICAgICAgICBjb250cm9sbGVyOiBbJyRzY29wZScsICckYXR0cnMnLCBmdW5jdGlvbigkc2NvcGUsICRhdHRycyl7CisgICAgICAgICAgICAgICAgICAgICAgICBpZigkYXR0cnMuYXR0RmlsZURyb3AhPT0iIil7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgJHNjb3BlLm9uRHJvcD0kc2NvcGUuYXR0RmlsZURyb3A7CisgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICB0aGlzLm9uRHJvcCA9ICRzY29wZS5vbkRyb3A7CisgICAgICAgICAgICAgICAgICAgIH1dLAorICAgICAgICAgICAgICAgICAgICBsaW5rOiBmdW5jdGlvbihzY29wZSwgZWxlbWVudCkgeworICAgICAgICAgICAgICAgICAgICAgICAgZWxlbWVudC5hZGRDbGFzcygnZHJhZ2Ryb3AnKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIGVsZW1lbnQuYmluZCgKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAnZHJhZ292ZXInLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZ1bmN0aW9uKGUpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYoZS5vcmlnaW5hbEV2ZW50KXsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGUuZGF0YVRyYW5zZmVyID0gZS5vcmlnaW5hbEV2ZW50LmRhdGFUcmFuc2ZlcjsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBlLmRhdGFUcmFuc2Zlci5kcm9wRWZmZWN0ID0gJ21vdmUnOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyBhbGxvd3MgdXMgdG8gZHJvcAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoZS5wcmV2ZW50RGVmYXVsdCkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZS5wcmV2ZW50RGVmYXVsdCgpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGVsZW1lbnQuYWRkQ2xhc3MoJ2RyYWdkcm9wLW92ZXInKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGZhbHNlOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgICk7CisgICAgICAgICAgICAgICAgICAgICAgICBlbGVtZW50LmJpbmQoCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgJ2RyYWdlbnRlcicsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgZnVuY3Rpb24oZSkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyBhbGxvd3MgdXMgdG8gZHJvcAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoZS5wcmV2ZW50RGVmYXVsdCkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZS5wcmV2ZW50RGVmYXVsdCgpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGVsZW1lbnQuYWRkQ2xhc3MoJ2RyYWdkcm9wLW92ZXInKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGZhbHNlOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgICk7CisgICAgICAgICAgICAgICAgICAgICAgICBlbGVtZW50LmJpbmQoCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgJ2RyYWdsZWF2ZScsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgZnVuY3Rpb24oKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGVsZW1lbnQucmVtb3ZlQ2xhc3MoJ2RyYWdkcm9wLW92ZXInKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGZhbHNlOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgICk7CisgICAgICAgICAgICAgICAgICAgICAgICBlbGVtZW50LmJpbmQoCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgJ2Ryb3AnLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZ1bmN0aW9uKGUpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gU3RvcHMgc29tZSBicm93c2VycyBmcm9tIHJlZGlyZWN0aW5nLgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZihlLnByZXZlbnREZWZhdWx0KSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBlLnByZXZlbnREZWZhdWx0KCk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGUuc3RvcFByb3BhZ2F0aW9uKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBlLnN0b3BQcm9wYWdhdGlvbigpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmKGUub3JpZ2luYWxFdmVudCl7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBlLmRhdGFUcmFuc2ZlciA9IGUub3JpZ2luYWxFdmVudC5kYXRhVHJhbnNmZXI7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZWxlbWVudC5yZW1vdmVDbGFzcygnZHJhZ2Ryb3Atb3ZlcicpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZihlLmRhdGFUcmFuc2Zlci5maWxlcyAmJiBlLmRhdGFUcmFuc2Zlci5maWxlcy5sZW5ndGggPiAwKXsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNjb3BlLmZpbGVNb2RlbCA9IGUuZGF0YVRyYW5zZmVyLmZpbGVzWzBdOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2NvcGUuJGFwcGx5KCk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZih0eXBlb2Ygc2NvcGUub25Ecm9wID09PSAiZnVuY3Rpb24iKXsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzY29wZS5vbkRyb3AgPSAkcGFyc2Uoc2NvcGUub25Ecm9wKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzY29wZS5vbkRyb3AoKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gZmFsc2U7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgKTsKKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIH07CisgICAgICAgICAgICB9XSkKKyAgICAgICAgLmRpcmVjdGl2ZSgnYXR0RmlsZUxpbmsnLCBbIGZ1bmN0aW9uKCkgeworICAgICAgICAgICAgICAgIHJldHVybiB7CisgICAgICAgICAgICAgICAgICAgIHJlc3RyaWN0OiAnRUEnLAorICAgICAgICAgICAgICAgICAgICByZXF1aXJlOiAnXj9hdHRGaWxlRHJvcCcsCisgICAgICAgICAgICAgICAgICAgIHJlcGxhY2U6IHRydWUsCisgICAgICAgICAgICAgICAgICAgIHRyYW5zY2x1ZGU6IHRydWUsCisgICAgICAgICAgICAgICAgICAgIHRlbXBsYXRlVXJsOiAnYXBwL3NjcmlwdHMvbmdfanNfYXR0X3RwbHMvZHJhZ2Ryb3AvZmlsZVVwbG9hZC5odG1sJywKKyAgICAgICAgICAgICAgICAgICAgc2NvcGU6IHsKKyAgICAgICAgICAgICAgICAgICAgICAgIGZpbGVNb2RlbCA6ICc9PycsCisgICAgICAgICAgICAgICAgICAgICAgICBvbkZpbGVTZWxlY3QgOiAnJicsCisgICAgICAgICAgICAgICAgICAgICAgICBhdHRGaWxlTGluayA6ICcmJworICAgICAgICAgICAgICAgICAgICB9LAorICAgICAgICAgICAgICAgICAgICBjb250cm9sbGVyOiBbJyRzY29wZScsICckcGFyc2UnLCBmdW5jdGlvbigkc2NvcGUsICRwYXJzZSl7CisgICAgICAgICAgICAgICAgICAgICAgICB0aGlzLnNldEZpbGVNb2RlbD0gZnVuY3Rpb24oZmlsZU1vZGVsKXsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZigkc2NvcGUudGFrZUZpbGVNb2RlbEZyb21QYXJlbnQpeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAkc2NvcGUuJHBhcmVudC5maWxlTW9kZWwgPSBmaWxlTW9kZWw7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICRzY29wZS4kcGFyZW50LiRhcHBseSgpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBlbHNleworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAkc2NvcGUuZmlsZU1vZGVsID0gZmlsZU1vZGVsOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAkc2NvcGUuJGFwcGx5KCk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgfTsKKyAgICAgICAgICAgICAgICAgICAgICAgIHRoaXMuY2FsbGJhY2tGdW5jdGlvbj0gZnVuY3Rpb24oKXsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZih0eXBlb2YgJHNjb3BlLm9uRmlsZVNlbGVjdCA9PT0gImZ1bmN0aW9uIil7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICRzY29wZS5vbkZpbGVTZWxlY3QgPSAkcGFyc2UoJHNjb3BlLm9uRmlsZVNlbGVjdCk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICRzY29wZS5vbkZpbGVTZWxlY3QoKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICB9OworICAgICAgICAgICAgICAgICAgICB9XSwKKyAgICAgICAgICAgICAgICAgICAgbGluazogZnVuY3Rpb24oc2NvcGUsIGVsZW1lbnQsIGF0dHIsIGF0dEZpbGVEcm9wQ3RybCkgeworICAgICAgICAgICAgICAgICAgICAgICAgc2NvcGUudGFrZUZpbGVNb2RlbEZyb21QYXJlbnQgPSBmYWxzZTsKKyAgICAgICAgICAgICAgICAgICAgICAgIGlmKCEoYXR0ci5maWxlTW9kZWwpICYmIGF0dEZpbGVEcm9wQ3RybCl7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2NvcGUudGFrZUZpbGVNb2RlbEZyb21QYXJlbnQgPSB0cnVlOworICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgaWYoYXR0ci5hdHRGaWxlTGluayE9PSIiKXsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBzY29wZS5vbkZpbGVTZWxlY3Q9c2NvcGUuYXR0RmlsZUxpbms7CisgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICBlbHNlIGlmKCEoYXR0ci5vbkZpbGVTZWxlY3QpICYmIGF0dEZpbGVEcm9wQ3RybCl7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2NvcGUub25GaWxlU2VsZWN0ID0gYXR0RmlsZURyb3BDdHJsLm9uRHJvcDsKKyAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIH07CisgICAgICAgICAgICB9XSkKKyAgICAgICAgLmRpcmVjdGl2ZSgnYXR0RmlsZUNoYW5nZScsIFtmdW5jdGlvbigpIHsKKyAgICAgICAgICAgICAgICByZXR1cm4geworICAgICAgICAgICAgICAgICAgICByZXN0cmljdDogJ0EnLAorICAgICAgICAgICAgICAgICAgICByZXF1aXJlOiAnXmF0dEZpbGVMaW5rJywKKyAgICAgICAgICAgICAgICAgICAgbGluazogZnVuY3Rpb24oc2NvcGUsIGVsZW1lbnQsIGF0dHIsIGF0dEZpbGVMaW5rQ3RybCkgeworICAgICAgICAgICAgICAgICAgICAgICAgZWxlbWVudC5iaW5kKAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICdjaGFuZ2UnLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZ1bmN0aW9uIChlKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmKGUudGFyZ2V0LmZpbGVzICYmIGUudGFyZ2V0LmZpbGVzLmxlbmd0aCA+IDApeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYXR0RmlsZUxpbmtDdHJsLnNldEZpbGVNb2RlbChlLnRhcmdldC5maWxlc1swXSk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBhdHRGaWxlTGlua0N0cmwuY2FsbGJhY2tGdW5jdGlvbigpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGVsc2V7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YXIgc3RyRmlsZU5hbWUgPSBlLnRhcmdldC52YWx1ZTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhciBvYmpGU08gPSBuZXcgQWN0aXZlWE9iamVjdCgiU2NyaXB0aW5nLkZpbGVTeXN0ZW1PYmplY3QiKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGF0dEZpbGVMaW5rQ3RybC5zZXRGaWxlTW9kZWwob2JqRlNPLmdldEZpbGUoc3RyRmlsZU5hbWUpKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGF0dEZpbGVMaW5rQ3RybC5jYWxsYmFja0Z1bmN0aW9uKCk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICApOworICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgfTsKKyAgICAgICAgICAgIH1dKTsKK2FuZ3VsYXIubW9kdWxlKCJhdHQuYWJzLmRyYXdlciIsIFtdKQorLmRpcmVjdGl2ZSgnYXR0RHJhd2VyJywgWyckZG9jdW1lbnQnLCAnJHRpbWVvdXQnLCBmdW5jdGlvbiAoJGRvY3VtZW50LCAkdGltZW91dCkgeworICAgICAgICByZXR1cm4geworICAgICAgICAgICAgcmVzdHJpY3Q6ICdFQScsCisgICAgICAgICAgICByZXBsYWNlOiB0cnVlLAorICAgICAgICAgICAgdHJhbnNjbHVkZTogdHJ1ZSwKKyAgICAgICAgICAgIHNjb3BlOiB7CisgICAgICAgICAgICAgICAgZHJhd2VyT3BlbjogIj0/IiwKKyAgICAgICAgICAgICAgICBkcmF3ZXJBdXRvQ2xvc2U6ICI9PyIKKyAgICAgICAgICAgIH0sCisgICAgICAgICAgICB0ZW1wbGF0ZTogJzxkaXY+PGRpdiBjbGFzcz0iYXR0LWRyYXdlciIgbmctdHJhbnNjbHVkZT48L2Rpdj48ZGl2IG5nLWNsYXNzPSJ7XCdkcmF3ZXItYmFja2Ryb3BcJzpkcmF3ZXJPcGVufSI+PC9kaXY+PC9kaXY+JywKKyAgICAgICAgICAgIGxpbms6IGZ1bmN0aW9uICgkc2NvcGUsIGVsZW1lbnQsIGF0dHJzKSB7CisgICAgICAgICAgICAgICAgdmFyIHBhcmFtID0ge307CisgICAgICAgICAgICAgICAgLy8gT3ZlcnJpZGUgZGVmYXVsdCBwYXJhbWV0ZXJzCisgICAgICAgICAgICAgICAgcGFyYW0uc2lkZSA9IGF0dHJzLmRyYXdlclNsaWRlIHx8ICd0b3AnOworICAgICAgICAgICAgICAgIHBhcmFtLnNwZWVkID0gYXR0cnMuZHJhd2VyU3BlZWQgfHwgJzAuMjUnOworICAgICAgICAgICAgICAgIHBhcmFtLnNpemUgPSBhdHRycy5kcmF3ZXJTaXplIHx8ICczMDBweCc7CisgICAgICAgICAgICAgICAgcGFyYW0uemluZGV4ID0gYXR0cnMuZHJhd2VyWmluZGV4IHx8IDEwMDA7CisgICAgICAgICAgICAgICAgcGFyYW0uY2xhc3NOYW1lID0gYXR0cnMuZHJhd2VyQ2xhc3MgfHwgJ2F0dC1kcmF3ZXInOworICAgICAgICAgICAgICAgIHZhciBzbGlkZXIgPSBlbGVtZW50LmVxKDApLmNoaWxkcmVuKClbMF07CisgICAgICAgICAgICAgICAgdmFyIGNvbnRlbnQgPSBhbmd1bGFyLmVsZW1lbnQoc2xpZGVyKS5jaGlsZHJlbigpWzBdOworICAgICAgICAgICAgICAgIHNsaWRlci5jbGFzc05hbWUgPSBwYXJhbS5jbGFzc05hbWU7CisgICAgICAgICAgICAgICAgLyogU3R5bGUgc2V0dXAgKi8KKyAgICAgICAgICAgICAgICBzbGlkZXIuc3R5bGUudHJhbnNpdGlvbkR1cmF0aW9uID0gcGFyYW0uc3BlZWQgKyAncyc7CisgICAgICAgICAgICAgICAgc2xpZGVyLnN0eWxlLndlYmtpdFRyYW5zaXRpb25EdXJhdGlvbiA9IHBhcmFtLnNwZWVkICsgJ3MnOworICAgICAgICAgICAgICAgIHNsaWRlci5zdHlsZS56SW5kZXggPSBwYXJhbS56aW5kZXg7CisgICAgICAgICAgICAgICAgc2xpZGVyLnN0eWxlLnBvc2l0aW9uID0gJ2ZpeGVkJzsKKyAgICAgICAgICAgICAgICBzbGlkZXIuc3R5bGUud2lkdGggPSAwOworICAgICAgICAgICAgICAgIHNsaWRlci5zdHlsZS5oZWlnaHQgPSAwOworICAgICAgICAgICAgICAgIHNsaWRlci5zdHlsZS50cmFuc2l0aW9uUHJvcGVydHkgPSAnd2lkdGgsIGhlaWdodCc7CisgICAgICAgICAgICAgICAgaWYocGFyYW0uc2lkZT09PSdyaWdodCcgfHwgcGFyYW0uc2lkZT09PSdsZWZ0Jyl7CisgICAgICAgICAgICAgICAgICAgIHNsaWRlci5zdHlsZS5oZWlnaHQgPSBhdHRycy5kcmF3ZXJDdXN0b21IZWlnaHQgfHwgJzEwMCUnOworICAgICAgICAgICAgICAgICAgICBzbGlkZXIuc3R5bGUudG9wID0gYXR0cnMuZHJhd2VyQ3VzdG9tVG9wIHx8ICAnMHB4JzsKKyAgICAgICAgICAgICAgICAgICAgc2xpZGVyLnN0eWxlLmJvdHRvbSA9IGF0dHJzLmRyYXdlckN1c3RvbUJvdHRvbSB8fCAgJzBweCc7CisgICAgICAgICAgICAgICAgICAgIHNsaWRlci5zdHlsZS5yaWdodCA9IGF0dHJzLmRyYXdlckN1c3RvbVJpZ2h0IHx8ICAnMHB4JzsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgZWxzZSBpZihwYXJhbS5zaWRlPT09J3RvcCcgfHwgcGFyYW0uc2lkZT09PSdib3R0b20nKXsKKyAgICAgICAgICAgICAgICAgICAgc2xpZGVyLnN0eWxlLndpZHRoID0gYXR0cnMuZHJhd2VyQ3VzdG9tV2lkdGggfHwgJzEwMCUnOworICAgICAgICAgICAgICAgICAgICBzbGlkZXIuc3R5bGUubGVmdCA9IGF0dHJzLmRyYXdlckN1c3RvbUxlZnQgfHwgJzBweCc7CisgICAgICAgICAgICAgICAgICAgIHNsaWRlci5zdHlsZS50b3AgPSBhdHRycy5kcmF3ZXJDdXN0b21Ub3AgfHwgJzBweCc7CisgICAgICAgICAgICAgICAgICAgIHNsaWRlci5zdHlsZS5yaWdodCA9IGF0dHJzLmRyYXdlckN1c3RvbVJpZ2h0IHx8ICcwcHgnOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAvKiBDbG9zZWQgKi8KKyAgICAgICAgICAgICAgICBmdW5jdGlvbiBkcmF3ZXJDbG9zZShzbGlkZXIsIHBhcmFtKSB7CisgICAgICAgICAgICAgICAgICAgIGlmIChzbGlkZXIgJiYgc2xpZGVyLnN0eWxlLndpZHRoICE9PSAwICYmIHNsaWRlci5zdHlsZS5oZWlnaHQgIT09IDApeworICAgICAgICAgICAgICAgICAgICAgICAgY29udGVudC5zdHlsZS5kaXNwbGF5ID0gJ25vbmUnOworICAgICAgICAgICAgICAgICAgICAgICAgaWYocGFyYW0uc2lkZT09PSdyaWdodCcgfHwgcGFyYW0uc2lkZT09PSdsZWZ0Jyl7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2xpZGVyLnN0eWxlLndpZHRoID0gJzBweCc7CisgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICBlbHNlIGlmKHBhcmFtLnNpZGU9PT0ndG9wJyB8fCBwYXJhbS5zaWRlPT09J2JvdHRvbScpeworICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNsaWRlci5zdHlsZS5oZWlnaHQgPSAnMHB4JzsKKyAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAkc2NvcGUuZHJhd2VyT3BlbiA9IGZhbHNlOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAvKiBPcGVuICovCisgICAgICAgICAgICAgICAgZnVuY3Rpb24gZHJhd2VyT3BlbihzbGlkZXIsIHBhcmFtKSB7CisgICAgICAgICAgICAgICAgICAgIGlmIChzbGlkZXIuc3R5bGUud2lkdGggIT09IDAgJiYgc2xpZGVyLnN0eWxlLmhlaWdodCAhPT0gMCl7CisgICAgICAgICAgICAgICAgICAgICAgICBpZihwYXJhbS5zaWRlPT09J3JpZ2h0JyB8fCBwYXJhbS5zaWRlPT09J2xlZnQnKXsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBzbGlkZXIuc3R5bGUud2lkdGggPSBwYXJhbS5zaXplOworICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgZWxzZSBpZihwYXJhbS5zaWRlPT09J3RvcCcgfHwgcGFyYW0uc2lkZT09PSdib3R0b20nKXsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBzbGlkZXIuc3R5bGUuaGVpZ2h0ID0gcGFyYW0uc2l6ZTsKKyAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgICR0aW1lb3V0KGZ1bmN0aW9uKCkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbnRlbnQuc3R5bGUuZGlzcGxheSA9ICdibG9jayc7CisgICAgICAgICAgICAgICAgICAgICAgICB9LChwYXJhbS5zcGVlZCAqIDEwMDApKTsKKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICBmdW5jdGlvbiBpc0Z1bmN0aW9uKGZ1bmN0aW9uVG9DaGVjaykgeworICAgICAgICAgICAgICAgICAgICB2YXIgZ2V0VHlwZSA9IHt9OworICAgICAgICAgICAgICAgICAgICByZXR1cm4gZnVuY3Rpb25Ub0NoZWNrICYmIGdldFR5cGUudG9TdHJpbmcuY2FsbChmdW5jdGlvblRvQ2hlY2spID09PSAnW29iamVjdCBGdW5jdGlvbl0nOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAvKgorICAgICAgICAgICAgICAgICogV2F0Y2hlcnMKKyAgICAgICAgICAgICAgICAqICovCisgICAgICAgICAgICAgICAgaWYoYXR0cnMuZHJhd2VyU2l6ZSkgeworICAgICAgICAgICAgICAgICAgICAkc2NvcGUuJHdhdGNoKGZ1bmN0aW9uKCkgeworICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGF0dHJzLmRyYXdlclNpemU7CisgICAgICAgICAgICAgICAgICAgIH0sIGZ1bmN0aW9uKG5ld1ZhbCkgeworICAgICAgICAgICAgICAgICAgICAgICAgcGFyYW0uc2l6ZSA9IG5ld1ZhbDsKKyAgICAgICAgICAgICAgICAgICAgICAgIGlmKCRzY29wZS5kcmF3ZXJPcGVuKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgZHJhd2VyT3BlbihzbGlkZXIscGFyYW0pOworICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICB9KTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgJHNjb3BlLiR3YXRjaCgiZHJhd2VyT3BlbiIsIGZ1bmN0aW9uICh2YWx1ZSl7CisgICAgICAgICAgICAgICAgICAgIGlmICghIXZhbHVlKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAvLyBPcGVuCisgICAgICAgICAgICAgICAgICAgICAgICBkcmF3ZXJPcGVuKHNsaWRlcixwYXJhbSk7CisgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICAgICAgICAgICAgICAvLyBDbG9zZQorICAgICAgICAgICAgICAgICAgICAgICAgZHJhd2VyQ2xvc2Uoc2xpZGVyLHBhcmFtKTsKKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIH0pOworICAgICAgICAgICAgICAgIC8vIGNsb3NlIHBhbmVsIG9uIGxvY2F0aW9uIGNoYW5nZQorICAgICAgICAgICAgICAgIGlmKCRzY29wZS5kcmF3ZXJBdXRvQ2xvc2UpIHsKKyAgICAgICAgICAgICAgICAgICAgJHNjb3BlLiRvbigiJGxvY2F0aW9uQ2hhbmdlU3RhcnQiLCBmdW5jdGlvbigpeworICAgICAgICAgICAgICAgICAgICAgICAgZHJhd2VyQ2xvc2Uoc2xpZGVyLCBwYXJhbSk7CisgICAgICAgICAgICAgICAgICAgICAgICBpZihpc0Z1bmN0aW9uKCRzY29wZS5kcmF3ZXJBdXRvQ2xvc2UpKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgJHNjb3BlLmRyYXdlckF1dG9DbG9zZSgpOworICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICB9KTsKKyAgICAgICAgICAgICAgICAgICAgJHNjb3BlLiRvbigiJHN0YXRlQ2hhbmdlU3RhcnQiLCBmdW5jdGlvbigpeworICAgICAgICAgICAgICAgICAgICAgICAgZHJhd2VyQ2xvc2Uoc2xpZGVyLCBwYXJhbSk7CisgICAgICAgICAgICAgICAgICAgICAgICBpZihpc0Z1bmN0aW9uKCRzY29wZS5kcmF3ZXJBdXRvQ2xvc2UpKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgJHNjb3BlLmRyYXdlckF1dG9DbG9zZSgpOworICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICB9KTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9CisgICAgICAgIH07CisgICAgfQorXSk7Cithbmd1bGFyLm1vZHVsZSgnYXR0LmFicy5tZXNzYWdlJywgW10pCisKKy5kaXJlY3RpdmUoJ2F0dE1lc3NhZ2VzJywgW2Z1bmN0aW9uKCkgeworICAgIHJldHVybiB7CisgICAgICAgIHJlc3RyaWN0OiAnRUEnLAorICAgICAgICBzY29wZTogdHJ1ZSwKKyAgICAgICAgY29udHJvbGxlcjogWyckc2NvcGUnLCAnJGVsZW1lbnQnLCAnJGF0dHJzJywgZnVuY3Rpb24oJHNjb3BlLCAkZWxlbWVudCwgJGF0dHJzKSB7CisgICAgICAgICAgICAkc2NvcGUubWVzc2FnZVR5cGU7CisgICAgICAgICAgICAkc2NvcGUuJHdhdGNoQ29sbGVjdGlvbigkYXR0cnNbJ2ZvciddLCBmdW5jdGlvbihlcnJvcnMpIHsKKyAgICAgICAgICAgICAgICBmb3IgKHZhciBrZXkgaW4gZXJyb3JzKSB7CisgICAgICAgICAgICAgICAgICAgIGlmIChlcnJvcnNba2V5XSkgeworICAgICAgICAgICAgICAgICAgICAgICAgJHNjb3BlLmVycm9yID0ga2V5OworICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICAgICAgICAgICAgICAkc2NvcGUuZXJyb3IgPSBudWxsOworICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgfTsKKyAgICAgICAgICAgICAgICBpZiAoJHNjb3BlLmVycm9yID09PSBudWxsKSB7CisgICAgICAgICAgICAgICAgICAgICRzY29wZS5tZXNzYWdlVHlwZSA9IG51bGw7CisgICAgICAgICAgICAgICAgICAgICRlbGVtZW50LnJlbW92ZUF0dHIoJ21lc3NhZ2UtdHlwZScpOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0pOworICAgICAgICAgICAgdGhpcy5zZXRNZXNzYWdlVHlwZSA9IGZ1bmN0aW9uKG1lc3NhZ2VUeXBlKSB7CisgICAgICAgICAgICAgICAgJHNjb3BlLm1lc3NhZ2VUeXBlID0gbWVzc2FnZVR5cGU7CisgICAgICAgICAgICB9OworICAgICAgICAgICAgJHNjb3BlLiR3YXRjaCgnbWVzc2FnZVR5cGUnLCBmdW5jdGlvbih2YWx1ZSkgeworICAgICAgICAgICAgICAgIGlmIChhbmd1bGFyLmlzRGVmaW5lZCh2YWx1ZSkgJiYgdmFsdWUgIT09IG51bGwpIHsKKyAgICAgICAgICAgICAgICAgICAgJGVsZW1lbnQuYXR0cignbWVzc2FnZS10eXBlJywgdmFsdWUpOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0pOworICAgICAgICB9XQorICAgIH07Cit9XSkKKworLmRpcmVjdGl2ZSgnYXR0TWVzc2FnZScsIFtmdW5jdGlvbigpIHsKKyAgICByZXR1cm4geworICAgICAgICByZXN0cmljdDogJ0VBJywKKyAgICAgICAgc2NvcGU6IHt9LAorICAgICAgICByZXF1aXJlOiAnXmF0dE1lc3NhZ2VzJywKKyAgICAgICAgbGluazogZnVuY3Rpb24oc2NvcGUsIGVsZW0sIGF0dHIsIGN0cmwpIHsKKyAgICAgICAgICAgIHNjb3BlLndoZW4gPSBhdHRyLndoZW4gfHwgYXR0ci5hdHRNZXNzYWdlOworICAgICAgICAgICAgc2NvcGUudHlwZSA9IGF0dHIudHlwZTsKKyAgICAgICAgICAgIGVsZW0uY3NzKHtkaXNwbGF5OiAnbm9uZSd9KTsKKyAgICAgICAgICAgIHNjb3BlLiRwYXJlbnQuJHdhdGNoKCdlcnJvcicsIGZ1bmN0aW9uKHZhbHVlKSB7CisgICAgICAgICAgICAgICAgaWYgKHZhbHVlID09PSBzY29wZS53aGVuKSB7CisgICAgICAgICAgICAgICAgICAgIGVsZW0uY3NzKHtkaXNwbGF5OiAnYmxvY2snfSk7CisgICAgICAgICAgICAgICAgICAgIGN0cmwuc2V0TWVzc2FnZVR5cGUoc2NvcGUudHlwZSk7CisgICAgICAgICAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgICAgICAgICAgZWxlbS5jc3Moe2Rpc3BsYXk6ICdub25lJ30pOworICAgICA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S5wYXJlbnQoKS5wYXJlbnQoKS5maW5kKCdsYWJlbCcpLmFkZENsYXNzKCdmb3JtLWZpZWxkX19sYWJlbC0taGlkZScpLnJlbW92ZUNsYXNzKCdmb3JtLWZpZWxkX19sYWJlbC0tc2hvdycpOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0pOworCisgICAgICAgICAgICBlbGVtLmJpbmQoJ2JsdXInLCBmdW5jdGlvbigpIHsKKyAgICAgICAgICAgICAgICBpZiAodGhpcy52YWx1ZSA9PT0gJycpIHsKKyAgICAgICAgICAgICAgICAgICAgZWxlbS5wYXJlbnQoKS5wYXJlbnQoKS5maW5kKCdsYWJlbCcpLnJlbW92ZUNsYXNzKCdmb3JtLWZpZWxkX19sYWJlbC0taGlkZScpOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0pOworICAgICAgICB9CisgICAgfTsKK31dKQorCisuZGlyZWN0aXZlKCdhdHRGb3JtRmllbGRWYWxpZGF0aW9uJywgWyckY29tcGlsZScsICckbG9nJywgZnVuY3Rpb24oJGNvbXBpbGUsICRsb2cpIHsKKyAgICByZXR1cm4geworICAgICAgICBwcmlvcml0eTogMTAyLAorICAgICAgICBzY29wZToge30sCisgICAgICAgIHJlc3RyaWN0OiAnQScsCisgICAgICAgIHJlcXVpcmU6IFsnP25nTW9kZWwnLCAnP2F0dEZvcm1GaWVsZCddLAorICAgICAgICBsaW5rOiBmdW5jdGlvbihzY29wZSwgZWxlbSwgYXR0ciwgY3RybCkgeworICAgICAgICAgICAgdmFyIG5nQ3RybCA9IGN0cmxbMF07CisgICAgICAgICAgICB2YXIgYXR0Rm9ybUZpZWxkQ3RybCA9IGN0cmxbMV07CisgICAgICAgICAgICBzY29wZS52YWxpZCA9ICIiOworICAgICAgICAgICAgaWYgKCFuZ0N0cmwpIHsKKyAgICAgICAgICAgICAgICAkbG9nLmVycm9yKCJhdHQtZm9ybS1maWVsZC12YWxpZGF0aW9uIDo6IG5nLW1vZGVsIGRpcmVjdGl2ZSBpcyByZXF1aXJlZC4iKTsKKyAgICAgICAgICAgICAgICByZXR1cm47CisgICAgICAgICAgICB9CisgICAgICAgICAgICBpZiAoIWF0dEZvcm1GaWVsZEN0cmwpIHsKKyAgICAgICAgICAgICAgICAkbG9nLmVycm9yKCJhdHQtZm9ybS1maWVsZC12YWxpZGF0aW9uIDo6IGF0dC1mb3JtLWZpZWxkIGRpcmVjdGl2ZSBpcyByZXF1aXJlZC4iKTsKKyAgICAgICAgICAgICAgICByZXR1cm47CisgICAgICAgICAgICB9CisKKyAgICAgICAgICAgIGVsZW0ucGFyZW50KCkuYXBwZW5kKCRjb21waWxlKGFuZ3VsYXIuZWxlbWVudCgnPGkgY2xhc3M9Imljb24taW5mby1hbGVydCBlcnJvciIgbmctc2hvdz0idmFsaWQ9PT1mYWxzZSI+Jm5ic3A7PC9pPicpKShzY29wZSkpOworICAgICAgICAgICAgZWxlbS5wYXJlbnQoKS5hcHBlbmQoJGNvbXBpbGUoYW5ndWxhci5lbGVtZW50KCc8aSBjbGFzcz0iaWNvbi1pbmZvLXN1Y2Nlc3Mgc3VjY2VzcyIgbmctc2hvdz0idmFsaWQ9PT10cnVlIj4mbmJzcDs8L2k+JykpKHNjb3BlKSk7CisKKyAgICAgICAgICAgIHNjb3BlLiR3YXRjaCgndmFsaWQnLCBmdW5jdGlvbih2YWx1ZSkgeworICAgICAgICAgICAgICAgIGlmICh2YWx1ZSkgeworICAgICAgICAgICAgICAgICAgICBlbGVtLnBhcmVudCgpLnBhcmVudCgpLmFkZENsYXNzKCdzdWNjZXNzJyk7CisgICAgICAgICAgICAgICAgfSBlbHNlIGlmICh2YWx1ZSA9PT0gZmFsc2UpIHsKKyAgICAgICAgICAgICAgICAgICAgZWxlbS5wYXJlbnQoKS5wYXJlbnQoKS5hZGRDbGFzcygnZXJyb3InKTsKKyAgICAgICAgICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgICAgICAgICBlbGVtLnBhcmVudCgpLnBhcmVudCgpLnJlbW92ZUNsYXNzKCdzdWNjZXNzJykucmVtb3ZlQ2xhc3MoJ2Vycm9yJyk7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfSk7CisKKyAgICAgICAgICAgIGVsZW0uYmluZCgna2V5dXAnLCBmdW5jdGlvbigpIHsKKyAgICAgICAgICAgICAgICBpZiAobmdDdHJsLiR2YWxpZCkgeworICAgICAgICAgICAgICAgICAgICBzY29wZS52YWxpZCA9IHRydWU7CisgICAgICAgICAgICAgICAgfSBlbHNlIGlmIChuZ0N0cmwuJGludmFsaWQpIHsKKyAgICAgICAgICAgICAgICAgICAgc2NvcGUudmFsaWQgPSBmYWxzZTsKKyAgICAgICAgICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgICAgICAgICBzY29wZS52YWxpZCA9ICIiOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICBzY29wZS4kYXBwbHkoKTsKKyAgICAgICAgICAgIH0pOworICAgICAgICB9CisgICAgfTsKK31dKQorCisuZGlyZWN0aXZlKCdhdHRGb3JtRmllbGRWYWxpZGF0aW9uQWxlcnQnLCBbJyR0aW1lb3V0JywgZnVuY3Rpb24oJHRpbWVvdXQpIHsKKyAgICAgICAgcmV0dXJuIHsKKyAgICAgICAgc2NvcGU6IHt9LAorICAgICAgICByZXN0cmljdDogJ0VBJywKKyAgICAgICAgcmVwbGFjZTogdHJ1ZSwKKyAgICAgICAgdHJhbnNjbHVkZTogdHJ1ZSwKKyAgICAgICAgdGVtcGxhdGVVcmw6ICdhcHAvc2NyaXB0cy9uZ19qc19hdHRfdHBscy9mb3JtRmllbGQvYXR0Rm9ybUZpZWxkVmFsaWRhdGlvbkFsZXJ0Lmh0bWwnLAorICAgICAgICBsaW5rOiBmdW5jdGlvbihzY29wZSwgZWxlbSkgeworICAgICAgICAgICAgc2NvcGUuc2hvd0xhYmVsID0gZmFsc2U7CisgICAgICAgICAgICBzY29wZS5oaWRlTGFiZWwgPSBmYWxzZTsKKyAgICAgICAgICAgIHNjb3BlLmVycm9yTWVzc2FnZSA9IGZhbHNlOworICAgICAgICAgICAgc2NvcGUud2FybmluZ01lc3NhZ2UgPSBmYWxzZTsKKyAgICAgICAgICAgIHZhciBjaGVja01lc3NhZ2VUeXBlID0gZnVuY3Rpb24oKSB7CisgICAgICAgICAgICAgICAgaWYgKGVsZW0uZmluZCgnYXR0LW1lc3NhZ2VzJykuYXR0cignbWVzc2FnZS10eXBlJykgPT09ICdlcnJvcicpIHsKKyAgICAgICAgICAgICAgICAgICAgc2NvcGUuZXJyb3JNZXNzYWdlID0gdHJ1ZTsKKyAgICAgICAgICAgICAgICAgICAgc2NvcGUud2FybmluZ01lc3NhZ2UgPSBmYWxzZTsKKyAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKGVsZW0uZmluZCgnYXR0LW1lc3NhZ2VzJykuYXR0cignbWVzc2FnZS10eXBlJykgPT09ICd3YXJuaW5nJykgeworICAgICAgICAgICAgICAgICAgICBzY29wZS5lcnJvck1lc3NhZ2UgPSBmYWxzZTsKKyAgICAgICAgICAgICAgICAgICAgc2NvcGUud2FybmluZ01lc3NhZ2UgPSB0cnVlOworICAgICAgICAgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICAgICAgICAgIHNjb3BlLmVycm9yTWVzc2FnZSA9IGZhbHNlOworICAgICAgICAgICAgICAgICAgICBzY29wZS53YXJuaW5nTWVzc2FnZSA9IGZhbHNlOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH07CisKKyAgICAgICAgICAgIGVsZW0uZmluZCgnbGFiZWwnKS50ZXh0KGVsZW0uZmluZCgnaW5wdXQnKS5hdHRyKCdwbGFjZWhvbGRlcicpKTsKKyAgICAgICAgICAgIGVsZW0uZmluZCgnaW5wdXQnKS5iaW5kKCdrZXl1cCcsIGZ1bmN0aW9uKCkgeworICAgICAgICAgICAgICAgIGlmICh0aGlzLnZhbHVlICE9PSAnJykgeworICAgICAgICAgICAgICAgICAgICBzY29wZS5zaG93TGFiZWwgPSB0cnVlOworICAgICAgICAgICAgICAgICAgICBzY29wZS5oaWRlTGFiZWwgPSBmYWxzZTsKKyAgICAgICAgICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgICAgICAgICBzY29wZS5zaG93TGFiZWwgPSBmYWxzZTsKKyAgICAgICAgICAgICAgICAgICAgc2NvcGUuaGlkZUxhYmVsID0gdHJ1ZTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgY2hlY2tNZXNzYWdlVHlwZSgpOworICAgICAgICAgICAgICAgIHNjb3BlLiRhcHBseSgpOworICAgICAgICAgICAgfSk7CisKKyAgICAgICAgICAgIGVsZW0uZmluZCgnaW5wdXQnKS5iaW5kKCdibHVyJywgZnVuY3Rpb24oKSB7CisgICAgICAgICAgICAgICAgaWYgKHRoaXMudmFsdWUgPT09ICcnKSB7CisgICAgICAgICAgICAgICAgICAgIHNjb3BlLnNob3dMYWJlbCA9IGZhbHNlOworICAgICAgICAgICAgICAgICAgICBzY29wZS5oaWRlTGFiZWwgPSBmYWxzZTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgc2NvcGUuJGFwcGx5KCk7CisgICAgICAgICAgICB9KTsKKyAgICAgICAgICAgICR0aW1lb3V0KGZ1bmN0aW9uKCkgeworICAgICAgICAgICAgICAgIGNoZWNrTWVzc2FnZVR5cGUoKTsKKyAgICAgICAgICAgIH0sIDEwMCk7CisgICAgICAgIH0KKyAgICB9OworfV0pOworCithbmd1bGFyLm1vZHVsZSgnYXR0LmFicy5ob3VycGlja2VyJywgWydhdHQuYWJzLnV0aWxpdGllcyddKQorICAuY29uc3RhbnQoJ2hvdXJwaWNrZXJDb25maWcnLCB7CisgICAgICAgICAgICBkYXlzOiBbJ01vbicsICdUdWUnLCAnV2VkJywgJ1RodScsICdGcmknLCAnU2F0JywgJ1N1biddLAorICAgICAgICAgICAgY3VzdG9tT3B0aW9uOiAnQ3VzdG9tJworICAgICAgICB9KQorCisgICAgICAgIC5jb250cm9sbGVyKCdob3VyUGlja2VyQ29udHJvbGxlcicsIFsnJHNjb3BlJywgZnVuY3Rpb24oJHNjb3BlKSB7CisKKyAgICAgICAgICAgICAgICAkc2NvcGUub3B0aW9ucyA9IFtdOworICAgICAgICAgICAgICAgIHRoaXMuc2V0T3B0aW9ucyA9IGZ1bmN0aW9uKHZhbHVlLCBmcm9tdGltZSwgdG90aW1lLCBwcmVzZWxlY3QsIHVuY2hlY2tlZEZyb21UaW1lLHVuY2hlY2tlZFRvVGltZSkgeworICAgICAgICAgICAgICAgICAgICAkc2NvcGUub3B0aW9ucy5wdXNoKHZhbHVlKTsKKworICAgICAgICAgICAgICAgICAgICBpZiAocHJlc2VsZWN0ICE9PSB1bmRlZmluZWQpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICRzY29wZS5wcmVzZWxlY3QgPSBwcmVzZWxlY3Q7CisgICAgICAgICAgICAgICAgICAgIH0KKworICAgICAgICAgICAgICAgICAgICB2YXIgZGF5Y291bnQ7CisKKyAgICAgICAgICAgICAgICAgICAgaWYgKGZyb210aW1lICE9PSB1bmRlZmluZWQpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICRzY29wZS5mcm9tdGltZSA9IGZyb210aW1lOworICAgICAgICAgICAgICAgICAgICAgICAgZm9yIChkYXljb3VudCBpbiAkc2NvcGUuZGF5cykgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICgkc2NvcGUuZGF5cy5oYXNPd25Qcm9wZXJ0eShkYXljb3VudCkpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJHNjb3BlLkZydGltZUxpc3RbJHNjb3BlLmRheXNbZGF5Y291bnRdXSA9IHt9OworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZih1bmNoZWNrZWRGcm9tVGltZSAhPT0gdW5kZWZpbmVkKXsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICRzY29wZS5GcnRpbWVMaXN0WyRzY29wZS5kYXlzW2RheWNvdW50XV0udmFsdWUgPSB1bmNoZWNrZWRGcm9tVGltZTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICRzY29wZS5zZWxlY3RlZEZyb21PcHRpb25bJHNjb3BlLmRheXNbZGF5Y291bnRdXSA9IHVuY2hlY2tlZEZyb21UaW1lOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9ZWxzZXsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICRzY29wZS5GcnRpbWVMaXN0WyRzY29wZS5kYXlzW2RheWNvdW50XV0udmFsdWUgPSBmcm9tdGltZVswXS52YWx1ZTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICRzY29wZS5zZWxlY3RlZEZyb21PcHRpb25bJHNjb3BlLmRheXNbZGF5Y291bnRdXSA9IGZyb210aW1lWzBdLnZhbHVlOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgIGlmICh0b3RpbWUgIT09IHVuZGVmaW5lZCkgeworICAgICAgICAgICAgICAgICAgICAgICAgJHNjb3BlLnRvdGltZSA9IHRvdGltZTsKKyAgICAgICAgICAgICAgICAgICAgICAgIGZvciAoZGF5Y291bnQgaW4gJHNjb3BlLmRheXMpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoJHNjb3BlLmRheXMuaGFzT3duUHJvcGVydHkoZGF5Y291bnQpKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICRzY29wZS5Ub3RpbWVMaXN0WyRzY29wZS5kYXlzW2RheWNvdW50XV0gPSB7fTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYodW5jaGVja2VkVG9UaW1lICE9PSB1bmRlZmluZWQpeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJHNjb3BlLlRvdGltZUxpc3RbJHNjb3BlLmRheXNbZGF5Y291bnRdXS52YWx1ZSA9IHVuY2hlY2tlZFRvVGltZTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICRzY29wZS5zZWxlY3RlZFRvT3B0aW9uWyRzY29wZS5kYXlzW2RheWNvdW50XV0gPSB1bmNoZWNrZWRUb1RpbWU7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1lbHNleworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJHNjb3BlLlRvdGltZUxpc3RbJHNjb3BlLmRheXNbZGF5Y291bnRdXS52YWx1ZSA9IHRvdGltZVswXS52YWx1ZTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICRzY29wZS5zZWxlY3RlZFRvT3B0aW9uWyRzY29wZS5kYXlzW2RheWNvdW50XV0gPSB0b3RpbWVbMF0udmFsdWU7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgIH0KKworICAgICAgICAgICAgICAgICAgICBpZih1bmNoZWNrZWRGcm9tVGltZSAhPT0gdW5kZWZpbmVkKXsKKyAgICAgICAgICAgICAgICAgICAgICAgICRzY29wZS51bmNoZWNrZWRGcm9tVGltZSA9IHVuY2hlY2tlZEZyb21UaW1lOworICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgIGlmKHVuY2hlY2tlZFRvVGltZSAhPT0gdW5kZWZpbmVkKXsKKyAgICAgICAgICAgICAgICAgICAgICAgICRzY29wZS51bmNoZWNrZWRUb1RpbWUgPSB1bmNoZWNrZWRUb1RpbWU7CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICB9OworICAgICAgICAgICAgfV0pCisKKyAgICAgICAgLmRpcmVjdGl2ZSgnYXR0SG91cnBpY2tlck9wdGlvbicsIFtmdW5jdGlvbigpIHsKKyAgICAgICAgICAgICAgICByZXR1cm4geworICAgICAgICAgICAgICAgICAgICByZXN0cmljdDogJ0VBJywKKyAgICAgICAgICAgICAgICAgICAgcmVxdWlyZTogJ15hdHRIb3VycGlja2VyJywKKyAgICAgICAgICAgICAgICAgICAgc2NvcGU6IHsKKyAgICAgICAgICAgICAgICAgICAgICAgIG9wdGlvbjogIj1vcHRpb24iLAorICAgICAgICAgICAgICAgICAgICAgICAgZnJvbXRpbWU6ICI9ZnJvbXRpbWUiLAorICAgICAgICAgICAgICAgICAgICAgICAgdG90aW1lOiAiPXRvdGltZSIsCisgICAgICAgICAgICAgICAgICAgICAgICBwcmVzZWxlY3Q6ICI9cHJlc2VsZWN0IiwKKyAgICAgICAgICAgICAgICAgICAgICAgIHVuY2hlY2tlZEZyb21UaW1lOiAiPSIsCisgICAgICAgICAgICAgICAgICAgICAgICB1bmNoZWNrZWRUb1RpbWU6ICI9IgorICAgICAgICAgICAgICAgICAgICB9LAorICAgICAgICAgICAgICAgICAgICBsaW5rOiBmdW5jdGlvbihzY29wZSwgZWxlbWVudCwgYXR0ciwgY3RybCkgeworICAgICAgICAgICAgICAgICAgICAgICAgY3RybC5zZXRPcHRpb25zKHNjb3BlLm9wdGlvbiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBzY29wZS5mcm9tdGltZSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBzY29wZS50b3RpbWUsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2NvcGUucHJlc2VsZWN0LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNjb3BlLnVuY2hlY2tlZEZyb21UaW1lLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNjb3BlLnVuY2hlY2tlZFRvVGltZSk7CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICB9OworICAgICAgICAgICAgfV0pCisKKyAgICAgICAgLmRpcmVjdGl2ZSgnYXR0SG91cnBpY2tlcicsIFsiaG91cnBpY2tlckNvbmZpZyIsICIkZG9jdW1lbnQiLCAiJGxvZyIsICIkZG9jdW1lbnRCaW5kIiwgIiR0aW1lb3V0IiwgZnVuY3Rpb24oaG91cnBpY2tlckNvbmZpZywgJGRvY3VtZW50LCAkbG9nLCAkZG9jdW1lbnRCaW5kLCAkdGltZW91dCkgeworICAgICAgICAgICAgICAgIHJldHVybnsKKyAgICAgICAgICAgICAgICAgICAgcmVxdWlyZTogJ25nTW9kZWwnLAorICAgICAgICAgICAgICAgICAgICByZXN0cmljdDogJ0VBJywKKyAgICAgICAgICAgICAgICAgICAgY29udHJvbGxlcjogJ2hvdXJQaWNrZXJDb250cm9sbGVyJywKKyAgICAgICAgICAgICAgICAgICAgdHJhbnNjbHVkZTogdHJ1ZSwKKyAgICAgICAgICAgICAgICAgICAgc2NvcGU6eworICAgICAgICAgICAgICAgICAgICAgIG1vZGVsOiAiPW5nTW9kZWwiLAorICAgICAgICAgICAgICAgICAgICAgIHJlc2V0RmxhZzogIj0/IgorICAgICAgICAgICAgICAgICAgICB9LAorICAgICAgICAgICAgICAgICAgICB0ZW1wbGF0ZVVybDogJ2FwcC9zY3JpcHRzL25nX2pzX2F0dF90cGxzL2hvdXJwaWNrZXIvaG91cnBpY2tlci5odG1sJywKKyAgICAgICAgICAgICAgICAgICAgbGluazogZnVuY3Rpb24oc2NvcGUsIGVsZW1lbnQsIGF0dHIsIGN0cmwpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIHZhciBmbGFnID0gZmFsc2U7CisgICAgICAgICAgICAgICAgICAgICAgICBzY29wZS5pc0Zyb21Ecm9wRG93bk9wZW4gPSBmYWxzZTsKKyAgICAgICAgICAgICAgICAgICAgICAgIHNjb3BlLmlzVG9Ecm9wRG93bk9wZW4gPSBmYWxzZTsKKyAgICAgICAgICAgICAgICAgICAgICAgIHZhciBkcm9wRG93bk9wZW5WYWx1ZSA9ICIiOworICAgICAgICAgICAgICAgICAgICAgICAgdmFyIGN1c3RUaW1lID0ge307CisgICAgICAgICAgICAgICAgICAgICAgICBzY29wZS5kYXlzID0gaG91cnBpY2tlckNvbmZpZy5kYXlzOworICAgICAgICAgICAgICAgICAgICAgICAgc2NvcGUuZGF5c0xpc3QgPSB7fTsKKyAgICAgICAgICAgICAgICAgICAgICAgIHNjb3BlLkZydGltZUxpc3QgPSB7fTsKKyAgICAgICAgICAgICAgICAgICAgICAgIHNjb3BlLkZydGltZUxpc3REYXkgPSB7fTsKKyAgICAgICAgICAgICAgICAgICAgICAgIHNjb3BlLlRvdGltZUxpc3REYXkgPSB7fTsKKyAgICAgICAgICAgICAgICAgICAgICAgIHNjb3BlLnNlbGVjdGVkRnJvbU9wdGlvbiA9IHt9OworICAgICAgICAgICAgICAgICAgICAgICAgc2NvcGUuc2VsZWN0ZWRUb09wdGlvbiA9IHt9OworICAgICAgICAgICAgICAgICAgICAgICAgc2NvcGUuVG90aW1lTGlzdCA9IHt9OworICAgICAgICAgICAgICAgICAgICAgICAgc2NvcGUuc2VsZWN0ZWRJbmRleCA9IDA7CisgICAgICAgICAgICAgICAgICAgICAgICBzY29wZS5zZWxlY3RlZE9wdGlvbiA9ICJTZWxlY3QgZnJvbSBsaXN0IjsKKyAgICAgICAgICAgICAgICAgICAgICAgIHNjb3BlLmN1c3RvbVRpbWUgPSBbXTsKKworICAgICAgICAgICAgICAgICAgICAgICAgc2NvcGUucmVzZXRGbGFnID0gZmFsc2U7CisKKyAgICAgICAgICAgICAgICAgICAgICAgIHNjb3BlLiR3YXRjaCgncmVzZXRGbGFnJywgZnVuY3Rpb24obmV3VmFsLCBvbGRWYWwpeworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmKG5ld1ZhbCAhPT0gb2xkVmFsKXsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYoIG5ld1ZhbCAmJiBzY29wZS5zZWxlY3RlZE9wdGlvbiA9PT0gaG91cnBpY2tlckNvbmZpZy5jdXN0b21PcHRpb24gKXsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vZGlzYWJsZSBhbmQgcmVzZXQgYWxsIGRheXMgY2hlY2tib3gKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZvciAoZGF5IGluIHNjb3BlLmRheXNMaXN0KSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHNjb3BlLmRheXNMaXN0Lmhhc093blByb3BlcnR5KGRheSkpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2NvcGUuZGF5c0xpc3RbZGF5XSA9IGZhbHNlOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzY29wZS5hZGRTZWxlY3RlZFZhbHVlKGRheSk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2NvcGUucHJlc2VsZWN0VXBkYXRlRnhuKHNjb3BlLnByZXNlbGVjdCk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2NvcGUucmVzZXRGbGFnID0gZmFsc2U7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgfSk7CisKKyAgICAgICAgICAgICAgICAgICAgICAgIHNjb3BlLiR3YXRjaCgnc2VsQ2F0ZWdvcnknLCBmdW5jdGlvbih2YWx1ZSkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICh2YWx1ZSl7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGN0cmwuJHNldFZpZXdWYWx1ZSh2YWx1ZSk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgfSk7CisgICAgICAgICAgICAgICAgICAgICAgICBzY29wZS4kd2F0Y2goJ21vZGVsJywgZnVuY3Rpb24odmFsdWUsb2xkVmFsdWUpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAodmFsdWUgJiYgb2xkVmFsdWUgJiYgYW5ndWxhci50b0pzb24odmFsdWUpICE9PSBhbmd1bGFyLnRvSnNvbihvbGRWYWx1ZSkpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzY29wZS51cGRhdGVEYXRhKHZhbHVlKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB9fSk7CisKKyAgICAgICAgICAgICAgICAgICAgICAgIHNjb3BlLnVwZGF0ZURhdGEgPSBmdW5jdGlvbih2YWx1ZSkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICh2YWx1ZS5jb25zdHJ1Y3RvciA9PT0gQXJyYXkpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2NvcGUuc2hvd0RheXNTZWxlY3RvciA9IHRydWU7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNjb3BlLnNlbGVjdGVkT3B0aW9uID0gaG91cnBpY2tlckNvbmZpZy5jdXN0b21PcHRpb247CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZvciAodmFyIGFycnkgaW4gdmFsdWUpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICh2YWx1ZS5oYXNPd25Qcm9wZXJ0eShhcnJ5KSkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhciBkYXkgPSB2YWx1ZVthcnJ5XS5kYXk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2NvcGUuZGF5c0xpc3RbZGF5XSA9IHRydWU7CisKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBmb3IgKHZhciBmcm9tY291bnQgaW4gc2NvcGUuZnJvbXRpbWUpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHNjb3BlLmZyb210aW1lW2Zyb21jb3VudF0udmFsdWUgPT09IHZhbHVlW2FycnldLkZyb21UaW1lKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzY29wZS5GcnRpbWVMaXN0W2RheV0udmFsdWUgPSBzY29wZS5mcm9tdGltZVtmcm9tY291bnRdLnZhbHVlOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2NvcGUuc2VsZWN0ZWRGcm9tT3B0aW9uW2RheV0gPSBzY29wZS5GcnRpbWVMaXN0W2RheV0udmFsdWU7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZm9yICh2YXIgdG9jb3VudCBpbiBzY29wZS50b3RpbWUpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHNjb3BlLnRvdGltZVt0b2NvdW50XS52YWx1ZSA9PT0gdmFsdWVbYXJyeV0uVG9UaW1lKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzY29wZS5Ub3RpbWVMaXN0W2RheV0udmFsdWUgPSBzY29wZS50b3RpbWVbdG9jb3VudF0udmFsdWU7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzY29wZS5zZWxlY3RlZFRvT3B0aW9uW2RheV0gPSBzY29wZS5Ub3RpbWVMaXN0W2RheV0udmFsdWU7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2NvcGUuYWRkU2VsZWN0ZWRWYWx1ZShkYXksIHZhbHVlW2FycnldLkZyb21UaW1lLCB2YWx1ZVthcnJ5XS5Ub1RpbWUpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vZm9yIElFOCBGaXgKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAocGFyc2VJbnQoYXJyeSkgKyAxID09PSB2YWx1ZS5sZW5ndGgpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgICAgIGVsc2UgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzY29wZS5zZWxlY3RPcHRpb24odmFsdWUuZGF5KTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICB9OworCisgICAgICAgICAgICAgICAgICAgICAgICBzY29wZS4kd2F0Y2goJ3ByZXNlbGVjdCcsIGZ1bmN0aW9uKHZhbHVlKXsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBzY29wZS5wcmVzZWxlY3RVcGRhdGVGeG4odmFsdWUpOworICAgICAgICAgICAgICAgICAgICAgICAgfSk7CisKKyAgICAgICAgICAgICAgICAgICAgICAgIHNjb3BlLnByZXNlbGVjdFVwZGF0ZUZ4biA9IGZ1bmN0aW9uKHZhbHVlKXsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAodmFsdWUgIT09IHVuZGVmaW5lZCkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZihzY29wZS5vcHRpb25zKXsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhbHVlID0gc2NvcGUudmFsaWRhdGVQcmVzZWxlY3REYXRhKHZhbHVlKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAodmFsdWUgPT09ICIiKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm47CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2NvcGUudXBkYXRlRGF0YSh2YWx1ZSk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgfTsKKworICAgICAgICAgICAgICAgICAgICAgICAgc2NvcGUudmFsaWRhdGVQcmVzZWxlY3REYXRhID0gZnVuY3Rpb24odmFsdWUpeworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICh2YWx1ZS5jb25zdHJ1Y3RvciA9PT0gQXJyYXkpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZm9yICh2YXIgYXJyeSBpbiB2YWx1ZSkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHZhbHVlLmhhc093blByb3BlcnR5KGFycnkpKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFyIGRheSA9IHZhbHVlW2FycnldLmRheTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YXIgaXNEYXlGb3VuZCA9IGZhbHNlOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhciBpc0ZybUZvdW5kID0gZmFsc2U7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFyIGlzVG9Gb3VuZCA9IGZhbHNlOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZvciAodmFyIGRheWNvdW50IGluIHNjb3BlLmRheXMpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHNjb3BlLmRheXNbZGF5Y291bnRdID09PSBkYXkpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlzRGF5Rm91bmQgPSB0cnVlOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKCFpc0RheUZvdW5kKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhbHVlLnNwbGljZShhcnJ5LCAxKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY29udGludWU7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZvciAodmFyIGZyb21jb3VudCBpbiBzY29wZS5mcm9tdGltZSkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoc2NvcGUuZnJvbXRpbWVbZnJvbWNvdW50XS52YWx1ZSA9PT0gdmFsdWVbYXJyeV0uRnJvbVRpbWUpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlzRnJtRm91bmQgPSB0cnVlOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKCFpc0ZybUZvdW5kKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhbHVlW2FycnldLkZyb21UaW1lID0gc2NvcGUuZnJvbXRpbWVbMF0udmFsdWU7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZvciAodmFyIHRvY291bnQgaW4gc2NvcGUudG90aW1lKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChzY29wZS50b3RpbWVbdG9jb3VudF0udmFsdWUgPT09IHZhbHVlW2FycnldLlRvVGltZSkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaXNUb0ZvdW5kID0gdHJ1ZTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICghaXNUb0ZvdW5kKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhbHVlW2FycnldLlRvVGltZSA9IHNjb3BlLnRvdGltZVswXS52YWx1ZTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLy9mb3IgSUU4IEZpeAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChwYXJzZUludChhcnJ5KSArIDEgPT09IHZhbHVlLmxlbmd0aCkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgZWxzZSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhciBpc09wdGlvbkZvdW5kID0gZmFsc2U7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZvciAodmFyIG9wdGNvdW50IGluIHNjb3BlLm9wdGlvbnMpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChzY29wZS5vcHRpb25zW29wdGNvdW50XSA9PT0gdmFsdWUuZGF5KSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaXNPcHRpb25Gb3VuZCA9IHRydWU7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKCFpc09wdGlvbkZvdW5kKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YWx1ZSA9ICIiOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiB2YWx1ZTsKKyAgICAgICAgICAgICAgICAgICAgICAgIH07CisKKyAgICAgICAgICAgICAgICAgICAgICAgIHNjb3BlLnNlbGVjdFByZXZOZXh0VmFsdWUgPSBmdW5jdGlvbigkZXZlbnQsIGFycmF5VmFsdWVzLCBjdXJyVmFsdWUpIHsKKworICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhciB2YWx1ZTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YXIgaW5kZXggPSAwOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICgkZXZlbnQua2V5Q29kZSA9PT0gMzgpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFsdWUgPSAtMTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKCRldmVudC5rZXlDb2RlID09PSA0MCkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YWx1ZSA9IDE7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGN1cnJWYWx1ZTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CisKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoYXJyYXlWYWx1ZXMuaW5kZXhPZihjdXJyVmFsdWUpICE9PSAtMSkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpbmRleCA9IGFycmF5VmFsdWVzLmluZGV4T2YoY3VyclZhbHVlKSArIHZhbHVlOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZvciAodmFyIGNvdW50IGluIGFycmF5VmFsdWVzKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoYXJyYXlWYWx1ZXNbY291bnRdLnZhbHVlID09PSBjdXJyVmFsdWUpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpbmRleCA9IHBhcnNlSW50KGNvdW50KSArIHZhbHVlOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQorCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGluZGV4ID09PSBhcnJheVZhbHVlcy5sZW5ndGgpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaW5kZXggPSBpbmRleCAtIDE7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIGlmIChpbmRleCA9PT0gLTEpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaW5kZXggPSBpbmRleCArIDE7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQorCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgJGV2ZW50LnByZXZlbnREZWZhdWx0KCk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGFycmF5VmFsdWVzW2luZGV4XS52YWx1ZSl7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBhcnJheVZhbHVlc1tpbmRleF0udmFsdWU7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgICAgIGVsc2V7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBhcnJheVZhbHVlc1tpbmRleF07CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgfTsKKworICAgICAgICAgICAgICAgICAgICAgICAgc2NvcGUuc2hvd0Ryb3Bkb3duID0gZnVuY3Rpb24oKQorICAgICAgICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNjb3BlLnNob3dsaXN0ID0gIXNjb3BlLnNob3dsaXN0OworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZsYWcgPSAhZmxhZzsKKyAgICAgICAgICAgICAgICAgICAgICAgIH07CisKKyAgICAgICAgICAgICAgICAgICAgICAgIHNjb3BlLnNob3dmcm9tRGF5RHJvcGRvd24gPSBmdW5jdGlvbih2YWx1ZSkKKyAgICAgICAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAvL2Nsb3NlIGRyb3Bkb3duIGlmIGFueSBvdGhlciBGcm9tIGRyb3AgZG93biBpcyBvcGVuZWQKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBmb3IgKGNvdW50IGluIHNjb3BlLkZydGltZUxpc3REYXkpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGNvdW50ICE9PSB2YWx1ZSAmJiBzY29wZS5GcnRpbWVMaXN0RGF5W2NvdW50XSkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2NvcGUuRnJ0aW1lTGlzdERheVtjb3VudF0gPSBmYWxzZTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBmb3IgKGNvdW50IGluIHNjb3BlLlRvdGltZUxpc3REYXkpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHNjb3BlLlRvdGltZUxpc3REYXlbY291bnRdKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzY29wZS5Ub3RpbWVMaXN0RGF5W2NvdW50XSA9IGZhbHNlOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNjb3BlLkZydGltZUxpc3REYXlbdmFsdWVdID0gIXNjb3BlLkZydGltZUxpc3REYXlbdmFsdWVdOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZsYWcgPSAhZmxhZzsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBzY29wZS5zaG93bGlzdCA9IGZhbHNlOworCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgLy9zYXZlIG1vZGVsIHZhbHVlIHNvIHdlIGNhbiBjbG9zZSBjdXJyZW50IGRyb3Bkb3duIG9uIGNsaWNrIG9mIG90aGVyIHBhcnQgb2YgdGhlIGRvY3VtZW50CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHNjb3BlLkZydGltZUxpc3REYXlbdmFsdWVdKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNjb3BlLmlzRnJvbURyb3BEb3duT3BlbiA9IHRydWU7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRyb3BEb3duT3BlblZhbHVlID0gdmFsdWU7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2NvcGUuaXNGcm9tRHJvcERvd25PcGVuID0gZmFsc2U7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQorCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgJHRpbWVvdXQoZnVuY3Rpb24gKCkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZihzY29wZS5GcnRpbWVMaXN0RGF5W3ZhbHVlXSl7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YXIgZGF5c0NvbnRhaW5lckRJViA9IGFuZ3VsYXIuZWxlbWVudChlbGVtZW50KVswXS5xdWVyeVNlbGVjdG9yKCIuY3VzdG9tZGF5cy13aWR0aCIpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFyIGNvbnRhaW5lclVMID0gYW5ndWxhci5lbGVtZW50KGRheXNDb250YWluZXJESVYucXVlcnlTZWxlY3RvcignLnNlbGVjdDItY29udGFpbmVyLWFjdGl2ZScpKS5wYXJlbnQoKVswXS5xdWVyeVNlbGVjdG9yKCJ1bCIpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFyIHNlbGVjdGVkRWxlbVRvcFBvcyA9IGFuZ3VsYXIuZWxlbWVudChjb250YWluZXJVTC5xdWVyeVNlbGVjdG9yKCcuc2VsZWN0ZWRJdGVtSW5Ecm9wRG93bicpKVswXS5vZmZzZXRUb3A7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBhbmd1bGFyLmVsZW1lbnQoY29udGFpbmVyVUwpWzBdLnNjcm9sbFRvcCA9IHNlbGVjdGVkRWxlbVRvcFBvczsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0pOworICAgICAgICAgICAgICAgICAgICAgICAgfTsKKworICAgICAgICAgICAgICAgICAgICAgICAgc2NvcGUuc2hvd3RvRGF5RHJvcGRvd24gPSBmdW5jdGlvbih2YWx1ZSkKKyAgICAgICAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAvL2Nsb3NlIGRyb3Bkb3duIGlmIGFueSBvdGhlciBUbyBkcm9wIGRvd24gaXMgb3BlbmVkCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgZm9yIChjb3VudCBpbiBzY29wZS5Ub3RpbWVMaXN0RGF5KSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChjb3VudCAhPT0gdmFsdWUgJiYgc2NvcGUuVG90aW1lTGlzdERheVtjb3VudF0pIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNjb3BlLlRvdGltZUxpc3REYXlbY291bnRdID0gZmFsc2U7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgZm9yIChjb3VudCBpbiBzY29wZS5GcnRpbWVMaXN0RGF5KSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChzY29wZS5GcnRpbWVMaXN0RGF5W2NvdW50XSkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2NvcGUuRnJ0aW1lTGlzdERheVtjb3VudF0gPSBmYWxzZTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBzY29wZS5Ub3RpbWVMaXN0RGF5W3ZhbHVlXSA9ICFzY29wZS5Ub3RpbWVMaXN0RGF5W3ZhbHVlXTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBmbGFnID0gIWZsYWc7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2NvcGUuc2hvd2xpc3QgPSBmYWxzZTsKKworICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vc2F2ZSBtb2RlbCB2YWx1ZSBzbyB3ZSBjYW4gY2xvc2UgY3VycmVudCBkcm9wZG93biBvbiBjbGljayBvZiBvdGhlciBwYXJ0IG9mIHRoZSBkb2N1bWVudAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChzY29wZS5Ub3RpbWVMaXN0RGF5W3ZhbHVlXSkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzY29wZS5pc1RvRHJvcERvd25PcGVuID0gdHJ1ZTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZHJvcERvd25PcGVuVmFsdWUgPSB2YWx1ZTsKKworICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNjb3BlLmlzVG9Ecm9wRG93bk9wZW4gPSBmYWxzZTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CisKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAkdGltZW91dChmdW5jdGlvbiAoKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmKHNjb3BlLkZydGltZUxpc3REYXlbdmFsdWVdKXsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhciBkYXlzQ29udGFpbmVyRElWID0gYW5ndWxhci5lbGVtZW50KGVsZW1lbnQpWzBdLnF1ZXJ5U2VsZWN0b3IoIi5jdXN0b21kYXlzLXdpZHRoIik7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YXIgY29udGFpbmVyVUwgPSBhbmd1bGFyLmVsZW1lbnQoZGF5c0NvbnRhaW5lckRJVi5xdWVyeVNlbGVjdG9yKCcuc2VsZWN0Mi1jb250YWluZXItYWN0aXZlJykpLnBhcmVudCgpWzBdLnF1ZXJ5U2VsZWN0b3IoInVsIik7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YXIgc2VsZWN0ZWRFbGVtVG9wUG9zID0gYW5ndWxhci5lbGVtZW50KGNvbnRhaW5lclVMLnF1ZXJ5U2VsZWN0b3IoJy5zZWxlY3RlZEl0ZW1JbkRyb3BEb3duJykpWzBdLm9mZnNldFRvcDsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGFuZ3VsYXIuZWxlbWVudChjb250YWluZXJVTClbMF0uc2Nyb2xsVG9wID0gc2VsZWN0ZWRFbGVtVG9wUG9zOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSk7CisgICAgICAgICAgICAgICAgICAgICAgICB9OworCisgICAgICAgICAgICAgICAgICAgICAgICBzY29wZS5zZWxlY3RGcm9tRGF5T3B0aW9uID0gZnVuY3Rpb24oZGF5LCB2YWx1ZSkKKyAgICAgICAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBzY29wZS5zZWxlY3RlZEZyb21PcHRpb25bZGF5XSA9IHZhbHVlOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNjb3BlLkZydGltZUxpc3RbZGF5XS52YWx1ZSA9IHZhbHVlOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNjb3BlLkZydGltZUxpc3REYXlbZGF5XSA9IGZhbHNlOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNjb3BlLmlzRnJvbURyb3BEb3duT3BlbiA9IGZhbHNlOworICAgICAgICAgICAgICAgICAgICAgICAgfTsKKworICAgICAgICAgICAgICAgICAgICAgICAgc2NvcGUuc2VsZWN0VG9EYXlPcHRpb24gPSBmdW5jdGlvbihkYXksIHZhbHVlKQorICAgICAgICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNjb3BlLnNlbGVjdGVkVG9PcHRpb25bZGF5XSA9IHZhbHVlOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNjb3BlLlRvdGltZUxpc3RbZGF5XS52YWx1ZSA9IHZhbHVlOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNjb3BlLlRvdGltZUxpc3REYXlbZGF5XSA9IGZhbHNlOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNjb3BlLmlzVG9Ecm9wRG93bk9wZW4gPSBmYWxzZTsKKyAgICAgICAgICAgICAgICAgICAgICAgIH07CisKKyAgICAgICAgICAgICAgICAgICAgICAgIHNjb3BlLmFkZFNlbGVjdGVkVmFsdWUgPSBmdW5jdGlvbih2YWx1ZSwgZnJvbXRpbWUsIHRvdGltZSkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhciBjb3VudCxsZW47CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHNjb3BlLmRheXNMaXN0W3ZhbHVlXSAhPT0gdW5kZWZpbmVkICYmICFzY29wZS5kYXlzTGlzdFt2YWx1ZV0pIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBmb3IgKGNvdW50ID0gMCwgbGVuID0gc2NvcGUuY3VzdG9tVGltZS5sZW5ndGg7IGNvdW50IDwgbGVuOyBjb3VudCsrKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoc2NvcGUuY3VzdG9tVGltZVtjb3VudF0uZGF5ID09PSB2YWx1ZSkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmKHNjb3BlLnVuY2hlY2tlZEZyb21UaW1lKXsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2NvcGUuc2VsZWN0ZWRGcm9tT3B0aW9uW3Njb3BlLmN1c3RvbVRpbWVbY291bnRdLmRheV0gPSBzY29wZS51bmNoZWNrZWRGcm9tVGltZTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZWxzZXsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2NvcGUuc2VsZWN0ZWRGcm9tT3B0aW9uW3Njb3BlLmN1c3RvbVRpbWVbY291bnRdLmRheV0gID0gc2NvcGUuRnJ0aW1lTGlzdFtzY29wZS5jdXN0b21UaW1lW2NvdW50XS5kYXldLnZhbHVlOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KKworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmKHNjb3BlLnVuY2hlY2tlZFRvVGltZSl7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNjb3BlLnNlbGVjdGVkVG9PcHRpb25bc2NvcGUuY3VzdG9tVGltZVtjb3VudF0uZGF5XSA9IHNjb3BlLnVuY2hlY2tlZFRvVGltZTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZWxzZXsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2NvcGUuc2VsZWN0ZWRUb09wdGlvbltzY29wZS5jdXN0b21UaW1lW2NvdW50XS5kYXldID0gc2NvcGUuVG90aW1lTGlzdFtzY29wZS5jdXN0b21UaW1lW2NvdW50XS5kYXldLnZhbHVlOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KKworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNjb3BlLmN1c3RvbVRpbWUuc3BsaWNlKGNvdW50LCAxKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBlbHNlIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYoc2NvcGUuc2VsZWN0ZWRGcm9tT3B0aW9uW3ZhbHVlXSA9PT0gc2NvcGUudW5jaGVja2VkRnJvbVRpbWUpeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2NvcGUuc2VsZWN0ZWRGcm9tT3B0aW9uW3ZhbHVlXSA9IHNjb3BlLmZyb210aW1lWzBdLnZhbHVlOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZnJvbXRpbWUgPSBzY29wZS5mcm9tdGltZVswXS52YWx1ZTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNjb3BlLkZydGltZUxpc3RbdmFsdWVdLnZhbHVlID0gc2NvcGUuZnJvbXRpbWVbMF0udmFsdWU7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KKworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZihzY29wZS5zZWxlY3RlZFRvT3B0aW9uW3ZhbHVlXSA9PT0gc2NvcGUudW5jaGVja2VkVG9UaW1lKXsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNjb3BlLnNlbGVjdGVkVG9PcHRpb25bdmFsdWVdID0gc2NvcGUudG90aW1lWzBdLnZhbHVlOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdG90aW1lID0gc2NvcGUudG90aW1lWzBdLnZhbHVlOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2NvcGUuVG90aW1lTGlzdFt2YWx1ZV0udmFsdWUgPSBzY29wZS50b3RpbWVbMF0udmFsdWU7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KKworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjdXN0VGltZVsiZGF5Il0gPSB2YWx1ZTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY3VzdFRpbWVbIkZyb21UaW1lIl0gPSAgc2NvcGUuRnJ0aW1lTGlzdFt2YWx1ZV0udmFsdWU7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGN1c3RUaW1lWyJUb1RpbWUiXSA9IHNjb3BlLlRvdGltZUxpc3RbdmFsdWVdLnZhbHVlOworCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZvciAoY291bnQgPSAwLCBsZW4gPSBzY29wZS5jdXN0b21UaW1lLmxlbmd0aDsgY291bnQgPCBsZW47IGNvdW50KyspIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChzY29wZS5jdXN0b21UaW1lW2NvdW50XS5kYXkgPT09IHZhbHVlKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2NvcGUuY3VzdG9tVGltZVtjb3VudF0uRnJvbVRpbWUgPSBjdXN0VGltZVsiRnJvbVRpbWUiXTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzY29wZS5jdXN0b21UaW1lW2NvdW50XS5Ub1RpbWUgPSBjdXN0VGltZVsiVG9UaW1lIl07CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGNvdW50ID09PSBsZW4pIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhciB4ID0gYW5ndWxhci5jb3B5KGN1c3RUaW1lKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNjb3BlLmN1c3RvbVRpbWUucHVzaCh4KTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBzY29wZS5zZWxDYXRlZ29yeSA9IHNjb3BlLmN1c3RvbVRpbWU7CisgICAgICAgICAgICAgICAgICAgICAgICB9OworCisKKyAgICAgICAgICAgICAgICAgICAgICAgIHZhciBvdXRzaWRlQ2xpY2sgPSBmdW5jdGlvbigpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoc2NvcGUuc2hvd2xpc3QpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2NvcGUuJGFwcGx5KGZ1bmN0aW9uKCkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2NvcGUuc2hvd2xpc3QgPSBmYWxzZTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgfTsKKworICAgICAgICAgICAgICAgICAgICAgICAgJGRvY3VtZW50QmluZC5jbGljaygnc2hvd2xpc3QnLCBvdXRzaWRlQ2xpY2ssIHNjb3BlKTsKKworICAgICAgICAgICAgICAgICAgICAgICAgdmFyIG91dHNpZGVDbGlja0Zyb21Ecm9wZG93biA9IGZ1bmN0aW9uKCkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNjb3BlLiRhcHBseShmdW5jdGlvbigpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHNjb3BlLmlzRnJvbURyb3BEb3duT3BlbikgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2NvcGUuRnJ0aW1lTGlzdERheVtkcm9wRG93bk9wZW5WYWx1ZV0gPSBmYWxzZTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNjb3BlLmlzRnJvbURyb3BEb3duT3BlbiA9IGZhbHNlOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSk7CisgICAgICAgICAgICAgICAgICAgICAgICB9OworCisgICAgICAgICAgICAgICAgICAgICAgICAkZG9jdW1lbnRCaW5kLmNsaWNrKCdpc0Zyb21Ecm9wRG93bk9wZW4nLCBvdXRzaWRlQ2xpY2tGcm9tRHJvcGRvd24sIHNjb3BlKTsKKworICAgICAgICAgICAgICAgICAgICAgICAgdmFyIG91dHNpZGVDbGlja1RvRHJvcGRvd24gPSBmdW5jdGlvbigpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBzY29wZS4kYXBwbHkoZnVuY3Rpb24oKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChzY29wZS5pc1RvRHJvcERvd25PcGVuKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzY29wZS5Ub3RpbWVMaXN0RGF5W2Ryb3BEb3duT3BlblZhbHVlXSA9IGZhbHNlOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2NvcGUuaXNUb0Ryb3BEb3duT3BlbiA9IGZhbHNlOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSk7CisgICAgICAgICAgICAgICAgICAgICAgICB9OworCisgICAgICAgICAgICAgICAgICAgICAgICAkZG9jdW1lbnRCaW5kLmNsaWNrKCdpc1RvRHJvcERvd25PcGVuJywgb3V0c2lkZUNsaWNrVG9Ecm9wZG93biwgc2NvcGUpOworCisgICAgICAgICAgICAgICAgICAgICAgICBzY29wZS5zZWxlY3RPcHRpb24gPSBmdW5jdGlvbihzSXRlbSkKKyAgICAgICAgICAgICAgICAgICAgICAgIHsKKworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChzSXRlbSA9PT0gaG91cnBpY2tlckNvbmZpZy5jdXN0b21PcHRpb24pIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2NvcGUuc2hvd0RheXNTZWxlY3RvciA9IHRydWU7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNjb3BlLnNlbENhdGVnb3J5ID0gc2NvcGUuY3VzdG9tVGltZTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzY29wZS5zaG93RGF5c1NlbGVjdG9yID0gZmFsc2U7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhciBmcm9tVGltZSA9IC9bMC05XVxzP2FtL2kuZXhlYyhzSXRlbSk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhciB0b1RpbWUgPSAvWzAtOV1ccz9wbS9pLmV4ZWMoc0l0ZW0pOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzY29wZS5zZWxDYXRlZ29yeSA9IHtkYXk6IHNJdGVtLCBGcm9tVGltZTogZnJvbVRpbWUgPT09IG51bGwgPyAnTkEnIDogZnJvbVRpbWVbMF0sIFRvVGltZTogdG9UaW1lID09PSBudWxsID8gJ05BJyA6IHRvVGltZVswXX07CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQorCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2NvcGUuc2hvd2xpc3QgPSBmYWxzZTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBmbGFnID0gZmFsc2U7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2NvcGUuc2VsZWN0ZWRPcHRpb24gPSBzSXRlbTsKKyAgICAgICAgICAgICAgICAgICAgICAgIH07CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICB9OworICAgICAgICAgICAgfV0pOworCithbmd1bGFyLm1vZHVsZSgnYXR0LmFicy5pY29uQnV0dG9ucycsIFtdKQorICAgICAgICAuY29uc3RhbnQoJ2J1dHRvbkNvbmZpZycsIHsKKyAgICAgICAgICAgIGFjdGl2ZUNsYXNzOiAnYWN0aXZlLS1idXR0b24nLAorICAgICAgICAgICAgdG9nZ2xlRXZlbnQ6ICdjbGljaycKKyAgICAgICAgfSkKKyAgICAgICAgLmRpcmVjdGl2ZSgnYXR0SWNvbkJ0blJhZGlvJywgWydidXR0b25Db25maWcnLCBmdW5jdGlvbihidXR0b25Db25maWcpIHsKKyAgICAgICAgICAgICAgICB2YXIgYWN0aXZlQ2xhc3MgPSBidXR0b25Db25maWcuYWN0aXZlQ2xhc3MgfHwgJ2FjdGl2ZS0tYnV0dG9uJzsKKyAgICAgICAgICAgICAgICB2YXIgdG9nZ2xlRXZlbnQgPSBidXR0b25Db25maWcudG9nZ2xlRXZlbnQgfHwgJ2NsaWNrJzsKKyAgICAgICAgICAgICAgICByZXR1cm4geworICAgICAgICAgICAgICAgICAgICByZXF1aXJlOiAnbmdNb2RlbCcsCisgICAgICAgICAgICAgICAgICAgIGxpbms6IGZ1bmN0aW9uKHNjb3BlLCBlbGVtZW50LCBhdHRycywgbmdNb2RlbEN0cmwpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIGVsZW1lbnQuYXR0cigicm9sZSIsImJ1dHRvbiIpOworCQkJZWxlbWVudC5hdHRyKCJ0YWJpbmRleCIsIjAiKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIGVsZW1lbnQuYXBwZW5kKCI8c3BhbiBjbGFzcz0naGlkZGVuLXNwb2tlbic+IithdHRycy5hdHRJY29uQnRuUmFkaW8rIjwvc3Bhbj4iKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIC8vbW9kZWwgLT4gVUkKKyAgICAgICAgICAgICAgICAgICAgICAgIG5nTW9kZWxDdHJsLiRyZW5kZXIgPSBmdW5jdGlvbigpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBlbGVtZW50LnBhcmVudCgpLnRvZ2dsZUNsYXNzKGFjdGl2ZUNsYXNzLCBhbmd1bGFyLmVxdWFscyhuZ01vZGVsQ3RybC4kbW9kZWxWYWx1ZSwgYXR0cnMuYXR0SWNvbkJ0blJhZGlvKSk7CisgICAgICAgICAgICAgICAgICAgICAgICB9OworICAgICAgICAgICAgICAgICAgICAgICAgLy91aS0+bW9kZWwKKyAgICAgICAgICAgICAgICAgICAgICAgIGVsZW1lbnQucGFyZW50KCkuYmluZCh0b2dnbGVFdmVudCwgZnVuY3Rpb24oKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKCFlbGVtZW50LnBhcmVudCgpLmhhc0NsYXNzKGFjdGl2ZUNsYXNzKSkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzY29wZS4kYXBwbHkoZnVuY3Rpb24oKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBuZ01vZGVsQ3RybC4kc2V0Vmlld1ZhbHVlKGF0dHJzLmF0dEljb25CdG5SYWRpbyk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBuZ01vZGVsQ3RybC4kcmVuZGVyKCk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0pOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgIH0pOworICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgfTsKKyAgICAgICAgICAgIH1dKQorICAgICAgICAuZGlyZWN0aXZlKCdhdHRJY29uQnRuQ2hlY2tib3gnLCBbJ2J1dHRvbkNvbmZpZycsIGZ1bmN0aW9uKGJ1dHRvbkNvbmZpZykgeworICAgICAgICAgICAgICAgIHZhciBhY3RpdmVDbGFzcyA9IGJ1dHRvbkNvbmZpZy5hY3RpdmVDbGFzcyB8fCAnYWN0aXZlLS1idXR0b24nOworICAgICAgICAgICAgICAgIHZhciB0b2dnbGVFdmVudCA9IGJ1dHRvbkNvbmZpZy50b2dnbGVFdmVudCB8fCAnY2xpY2snOworICAgICAgICAgICAgICAgIHJldHVybiB7CisgICAgICAgICAgICAgICAgICAgIHJlcXVpcmU6ICduZ01vZGVsJywKKyAgICAgICAgICAgICAgICAgICAgbGluazogZnVuY3Rpb24oc2NvcGUsIGVsZW1lbnQsIGF0dHJzLCBuZ01vZGVsQ3RybCkgeworICAgICAgICAgICAgICAgICAgICAgICAgZWxlbWVudC5hdHRyKCJyb2xlIiwiYnV0dG9uIik7CisJCQllbGVtZW50LmF0dHIoInRhYmluZGV4IiwiMCIpOworICAgICAgICAgICAgICAgICAgICAgICAgZWxlbWVudC5hcHBlbmQoIjxzcGFuIGNsYXNzPSdoaWRkZW4tc3Bva2VuJz4iK2F0dHJzLmF0dEljb25CdG5DaGVja2JveCsiPC9zcGFuPiIpOworICAgICAgICAgICAgICAgICAgICAgICAgZnVuY3Rpb24gZ2V0VHJ1ZVZhbHVlKCkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhciB0cnVlVmFsdWUgPSBzY29wZS4kZXZhbChhdHRycy5idG5DaGVja2JveFRydWUpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBhbmd1bGFyLmlzRGVmaW5lZCh0cnVlVmFsdWUpID8gdHJ1ZVZhbHVlIDogdHJ1ZTsKKyAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgIGZ1bmN0aW9uIGdldEZhbHNlVmFsdWUoKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFyIGZhbHNlVmFsdWUgPSBzY29wZS4kZXZhbChhdHRycy5idG5DaGVja2JveEZhbHNlKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gYW5ndWxhci5pc0RlZmluZWQoZmFsc2VWYWx1ZSkgPyBmYWxzZVZhbHVlIDogZmFsc2U7CisgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICAvL21vZGVsIC0+IFVJCisgICAgICAgICAgICAgICAgICAgICAgICBuZ01vZGVsQ3RybC4kcmVuZGVyID0gZnVuY3Rpb24oKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgZWxlbWVudC5wYXJlbnQoKS50b2dnbGVDbGFzcyhhY3RpdmVDbGFzcywgYW5ndWxhci5lcXVhbHMobmdNb2RlbEN0cmwuJG1vZGVsVmFsdWUsIGdldFRydWVWYWx1ZSgpKSk7CisgICAgICAgICAgICAgICAgICAgICAgICB9OworICAgICAgICAgICAgICAgICAgICAgICAgLy91aS0+bW9kZWwKKyAgICAgICAgICAgICAgICAgICAgICAgIGVsZW1lbnQucGFyZW50KCkuYmluZCh0b2dnbGVFdmVudCwgZnVuY3Rpb24oKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2NvcGUuJGFwcGx5KGZ1bmN0aW9uKCkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBuZ01vZGVsQ3RybC4kc2V0Vmlld1ZhbHVlKGVsZW1lbnQucGFyZW50KCkuaGFzQ2xhc3MoYWN0aXZlQ2xhc3MpID8gZ2V0RmFsc2VWYWx1ZSgpIDogZ2V0VHJ1ZVZhbHVlKCkpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBuZ01vZGVsQ3RybC4kcmVuZGVyKCk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSk7CisgICAgICAgICAgICAgICAgICAgICAgICB9KTsKKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIH07CisgICAgICAgICAgICB9XSk7CisKK2FuZ3VsYXIubW9kdWxlKCdhdHQuYWJzLmxpbmtzJywgWyduZ1Nhbml0aXplJ10pCisgICAgICAgIC5kaXJlY3RpdmUoJ2F0dExpbmsnLCBbZnVuY3Rpb24oKSB7CisgICAgICAgICAgICAgICAgcmV0dXJuIHsKKyAgICAgICAgICAgICAgICAgICAgcmVzdHJpY3Q6ICdBJywKKyAgICAgICAgICAgICAgICAgICAgbGluazogZnVuY3Rpb24oc2NvcGUsIGVsZW0pIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIGVsZW0uYWRkQ2xhc3MoJ2xpbmsnKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIGlmKCEoZWxlbS5hdHRyKCdocmVmJykpKXsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBlbGVtLmF0dHIoInRhYmluZGV4IiwgIjAiKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIH07CisgICAgICAgICAgICB9XSkKKyAgICAgICAgLmRpcmVjdGl2ZSgnYXR0TGlua1Zpc2l0ZWQnLCBbZnVuY3Rpb24oKSB7CisgICAgICAgICAgICAgICAgcmV0dXJuIHsKKyAgICAgICAgICAgICAgICAgICAgcmVzdHJpY3Q6ICdBJywKKyAgICAgICAgICAgICAgICAgICAgbGluazogZnVuY3Rpb24oc2NvcGUsIGVsZW0pIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIGVsZW0uYWRkQ2xhc3MoJ2xpbmstLXZpc2l0ZWQnKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIGlmKCEoZWxlbS5hdHRyKCdocmVmJykpKXsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBlbGVtLmF0dHIoInRhYmluZGV4IiwgIjAiKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIH07CisgICAgICAgICAgICB9XSkKKyAgICAgICAgLmRpcmVjdGl2ZSgnYXR0UmVhZG1vcmUnLCBbJyR0aW1lb3V0JyxmdW5jdGlvbigkdGltZW91dCkgeworICAgICAgICAgICAgICAgIHJldHVybiB7CisgICAgICAgICAgICAgICAgICAgIHJlc3RyaWN0OiAnQScsCisgICAgICAgICAgICAgICAgICAgIHNjb3BlOiB7CisgICAgICAgICAgICAgICAgICAgICAgICBsaW5lczoiQG5vT2ZMaW5lcyIsCisgICAgICAgICAgICAgICAgICAgICAgICB0ZXh0TW9kZWw6ICI9IiwKKyAgICAgICAgICAgICAgICAgICAgICAgIC8vYXR0cmlidXRlIHRvIHVzZSByZWFkbW9yZSBpbnNpZGUgYWNjb3JkaW9uCisgICAgICAgICAgICAgICAgICAgICAgICBpc09wZW46ICI9IgorICAgICAgICAgICAgICAgICAgICB9LAorICAgICAgICAgICAgICAgICAgICB0ZW1wbGF0ZVVybDogJ2FwcC9zY3JpcHRzL25nX2pzX2F0dF90cGxzL2xpbmtzL3JlYWRNb3JlLmh0bWwnLAorICAgICAgICAgICAgICAgICAgICBsaW5rOiBmdW5jdGlvbihzY29wZSwgZWxlbSkgeworICAgICAgICAgICAgICAgICAgICAgICAgdmFyIGhlaWdodCA9IDE7CisgICAgICAgICAgICAgICAgICAgICAgICBzY29wZS4kd2F0Y2goJ3RleHRNb2RlbCcsIGZ1bmN0aW9uKHZhbCl7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYoIXZhbCl7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNjb3BlLnRleHRUb0Rpc3BsYXkgPSAnJzsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2NvcGUucmVhZE1vcmVMaW5rID0gZmFsc2U7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNjb3BlLnJlYWRMZXNzTGluayA9IGZhbHNlOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzY29wZS5yZWFkRmxhZyA9IGZhbHNlOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBlbHNleworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAodHlwZW9mIFN0cmluZy5wcm90b3R5cGUudHJpbSAhPT0gJ2Z1bmN0aW9uJykgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgU3RyaW5nLnByb3RvdHlwZS50cmltID0gZnVuY3Rpb24oKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gdGhpcy5yZXBsYWNlKC9eXHMrfFxzKyQvZywgJycpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzY29wZS50ZXh0VG9EaXNwbGF5ID0gdmFsLnRyaW0oKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2NvcGUucmVhZEZsYWcgPSB0cnVlOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAkdGltZW91dChmdW5jdGlvbigpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhciByZWFkRWxlbSA9IGVsZW1bMF0uY2hpbGRyZW5bMF0uY2hpbGRyZW5bMF07CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZihoZWlnaHQ9PT0xKXsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZih3aW5kb3cuZ2V0Q29tcHV0ZWRTdHlsZSl7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGhlaWdodCA9IHBhcnNlSW50KHNjb3BlLmxpbmVzKSAqIHBhcnNlRmxvYXQod2luZG93LmdldENvbXB1dGVkU3R5bGUocmVhZEVsZW0sbnVsbCkuZ2V0UHJvcGVydHlWYWx1ZSgiaGVpZ2h0IikpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBlbHNlIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaGVpZ2h0ID0gcGFyc2VJbnQoc2NvcGUubGluZXMpICogcGFyc2VGbG9hdChyZWFkRWxlbS5jdXJyZW50U3R5bGUuaGVpZ2h0KTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2NvcGUuZWxlbUhlaWdodCA9IGhlaWdodDsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzY29wZS5yZWFkTGlua1N0eWxlID0geydoZWlnaHQnOiBzY29wZS5lbGVtSGVpZ2h0ICsgJ3B4J307CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0pOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzY29wZS5yZWFkTW9yZUxpbmsgPSB0cnVlOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzY29wZS5yZWFkTGVzc0xpbmsgPSBmYWxzZTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICB9KTsKKyAgICAgICAgICAgICAgICAgICAgICAgIC8vIENvZGUgdG8gdXNlIHJlYWRtb3JlIGluc2lkZSBhY2NvcmRpb24KKyAgICAgICAgICAgICAgICAgICAgICAgIHZhciBwYXJlbnRFbGVtID0gZWxlbS5wYXJlbnQoKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIGlmIChwYXJlbnRFbGVtLmhhc0NsYXNzKCdhdHQtYWNjb3JkaW9uX19ib2R5JykpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBzY29wZS4kd2F0Y2goJ2lzT3BlbicsIGZ1bmN0aW9uKHZhbCkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoIXZhbCkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2NvcGUucmVhZExlc3MoKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0pOworICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgc2NvcGUucmVhZE1vcmUgPSBmdW5jdGlvbigpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBzY29wZS5yZWFkTW9yZUxpbmsgPSBmYWxzZTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBzY29wZS5yZWFkTGVzc0xpbmsgPSB0cnVlOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNjb3BlLnJlYWRMaW5rU3R5bGUgPSB7J2hlaWdodCc6ICdhdXRvJ307CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2NvcGUucmVhZEZsYWcgPSBmYWxzZTsKKyAgICAgICAgICAgICAgICAgICAgICAgIH07CisgICAgICAgICAgICAgICAgICAgICAgICBzY29wZS5yZWFkTGVzcyA9IGZ1bmN0aW9uKCkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNjb3BlLnJlYWRNb3JlTGluayA9IHRydWU7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2NvcGUucmVhZExlc3NMaW5rID0gZmFsc2U7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2NvcGUucmVhZExpbmtTdHlsZSA9IHsnaGVpZ2h0Jzogc2NvcGUuZWxlbUhlaWdodCArICdweCd9OworICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNjb3BlLnJlYWRGbGFnID0gdHJ1ZTsKKyAgICAgICAgICAgICAgICAgICAgICAgIH07CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICB9OworICAgICAgICAgICAgfV0pCisgICAgICAgIC5kaXJlY3RpdmUoJ2F0dExpbmtzTGlzdCcsIFtmdW5jdGlvbigpIHsKKyAgICAgICAgICAgICAgICByZXR1cm4geworICAgICAgICAgICAgICAgICAgICByZXN0cmljdDogJ0EnLAorICAgICAgICAgICAgICAgICAgICBjb250cm9sbGVyOiBmdW5jdGlvbigpIHsKKyAgICAgICAgICAgICAgICAgICAgfSwKKyAgICAgICAgICAgICAgICAgICAgbGluazogZnVuY3Rpb24oc2NvcGUsIGVsZW0pIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIGVsZW0uYWRkQ2xhc3MoJ2xpbmtzLWxpc3QnKTsKKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIH07CisgICAgICAgICAgICB9XSkKKyAgICAgICAgLmRpcmVjdGl2ZSgnYXR0TGlua3NMaXN0SXRlbScsIFtmdW5jdGlvbigpIHsKKyAgICAgICAgICAgICAgICByZXR1cm4geworICAgICAgICAgICAgICAgICAgICByZXN0cmljdDogJ0EnLAorICAgICAgICAgICAgICAgICAgICByZXF1aXJlOiAnXmF0dExpbmtzTGlzdCcsCisgICAgICAgICAgICAgICAgICAgIGxpbms6IGZ1bmN0aW9uKHNjb3BlLCBlbGVtKSB7CisgICAgICAgICAgICAgICAgICAgICAgICBlbGVtLmFkZENsYXNzKCdsaW5rcy1saXN0X19pdGVtJyk7CisgICAgICAgICAgICAgICAgICAgICAgICBpZighKGVsZW0uYXR0cignaHJlZicpKSl7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgZWxlbS5hdHRyKCJ0YWJpbmRleCIsICIwIik7CisgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICB9OworICAgICAgICAgICAgfV0pOworYW5ndWxhci5tb2R1bGUoJ2F0dC5hYnMubG9hZGluZycsIFtdKQorICAgICAgICAuZGlyZWN0aXZlKCdhdHRMb2FkaW5nJywgWyckd2luZG93JyxmdW5jdGlvbigkd2luZG93KSB7CisgICAgICAgICAgICAgICAgcmV0dXJuIHsKKyAgICAgICAgICAgICAgICAgICAgcmVzdHJpY3Q6ICdBJywKKyAgICAgICAgICAgICAgICAgICAgcmVwbGFjZTogdHJ1ZSwKKyAgICAgICAgICAgICAgICAgICAgc2NvcGU6IHsKKyAgICAgICAgICAgICAgICAgICAgICAgIGljb246ICdAYXR0TG9hZGluZycsCisgICAgICAgICAgICAgICAgICAgICAgICBwcm9ncmVzc1N0YXR1czogJz0/JywKKyAgICAgICAgICAgICAgICAgICAgICAgIGNvbG9yQ2xhc3M6ICc9PycKKyAgICAgICAgICAgICAgICAgICAgfSwKKyAgICAgICAgICAgICAgICAgICAgdGVtcGxhdGVVcmw6ICdhcHAvc2NyaXB0cy9uZ19qc19hdHRfdHBscy9sb2FkaW5nL2xvYWRpbmcuaHRtbCcsCisgICAgICAgICAgICAgICAgICAgIGxpbms6IGZ1bmN0aW9uKHNjb3BlLCBlbGVtZW50KSB7CisgICAgICAgICAgICAgICAgICAgICAgICB2YXIgcHJvZ3Jlc3N2YWx1ZSA9IHNjb3BlLnByb2dyZXNzU3RhdHVzOworICAgICAgICAgICAgICAgICAgICAgICAgc2NvcGUucHJvZ3Jlc3NTdGF0dXMgPSBNYXRoLm1pbigxMDAsIE1hdGgubWF4KDAsIHByb2dyZXNzdmFsdWUpKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIGlmKCR3aW5kb3cubmF2aWdhdG9yLnVzZXJBZ2VudC5pbmRleE9mKCJNU0lFIDguIikhPT0tMSl7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFyIHNoaWZ0WCA9IDAsIHNoaWZ0WSA9IHNjb3BlLnByb2dyZXNzU3RhdHVzICogMzY7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgZWxlbWVudC5jc3MoeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAnYmFja2dyb3VuZC1wb3NpdGlvbi14JyA6IHNoaWZ0WCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJ2JhY2tncm91bmQtcG9zaXRpb24teScgOiAtc2hpZnRZCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSk7CisgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH07CisgICAgICAgIH1dKTsKK2FuZ3VsYXIubW9kdWxlKCdhdHQuYWJzLm1vZGFsJywgW10pCisvKioKKyAqIEEgaGVscGVyLCBpbnRlcm5hbCBkYXRhIHN0cnVjdHVyZSB0aGF0IGFjdHMgYXMgYSBtYXAgYnV0IGFsc28gYWxsb3dzIGdldHRpbmcgLyByZW1vdmluZworICogZWxlbWVudHMgaW4gdGhlIExJRk8gb3JkZXIKKyAqLworICAuZmFjdG9yeSgnJCRzdGFja2VkTWFwJywgZnVuY3Rpb24gKCkgeworICAgIHJldHVybiB7CisgICAgICBjcmVhdGVOZXc6IGZ1bmN0aW9uICgpIHsKKyAgICAgICAgdmFyIHN0YWNrID0gW107CisKKyAgICAgICAgcmV0dXJuIHsKKyAgICAgICAgICBhZGQ6IGZ1bmN0aW9uIChrZXksIHZhbHVlKSB7CisgICAgICAgICAgICBzdGFjay5wdXNoKHsKKyAgICAgICAgICAgICAga2V5OiBrZXksCisgICAgICAgICAgICAgIHZhbHVlOiB2YWx1ZQorICAgICAgICAgICAgfSk7CisgICAgICAgICAgfSwKKyAgICAgICAgICBnZXQ6IGZ1bmN0aW9uIChrZXkpIHsKKyAgICAgICAgICAgIGZvciAodmFyIGkgPSAwOyBpIDwgc3RhY2subGVuZ3RoOyBpKyspIHsKKyAgICAgICAgICAgICAgaWYgKGtleSA9PT0gc3RhY2tbaV0ua2V5KSB7CisgICAgICAgICAgICAgICAgcmV0dXJuIHN0YWNrW2ldOworICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9CisgICAgICAgICAgfSwKKyAgICAgICAgICBrZXlzOiBmdW5jdGlvbigpIHsKKyAgICAgICAgICAgIHZhciBrZXlzID0gW107CisgICAgICAgICAgICBmb3IgKHZhciBpID0gMDsgaSA8IHN0YWNrLmxlbmd0aDsgaSsrKSB7CisgICAgICAgICAgICAgIGtleXMucHVzaChzdGFja1tpXS5rZXkpOworICAgICAgICAgICAgfQorICAgICAgICAgICAgcmV0dXJuIGtleXM7CisgICAgICAgICAgfSwKKyAgICAgICAgICB0b3A6IGZ1bmN0aW9uICgpIHsKKyAgICAgICAgICAgIHJldHVybiBzdGFja1tzdGFjay5sZW5ndGggLSAxXTsKKyAgICAgICAgICB9LAorICAgICAgICAgIHJlbW92ZTogZnVuY3Rpb24gKGtleSkgeworICAgICAgICAgICAgdmFyIGlkeCA9IC0xOworICAgICAgICAgICAgZm9yICh2YXIgaSA9IDA7IGkgPCBzdGFjay5sZW5ndGg7IGkrKykgeworICAgICAgICAgICAgICBpZiAoa2V5ID09PSBzdGFja1tpXS5rZXkpIHsKKyAgICAgICAgICAgICAgICBpZHggPSBpOworICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9CisgICAgICAgICAgICByZXR1cm4gc3RhY2suc3BsaWNlKGlkeCwgMSlbMF07CisgICAgICAgICAgfSwKKyAgICAgICAgICByZW1vdmVUb3A6IGZ1bmN0aW9uICgpIHsKKyAgICAgICAgICAgIHJldHVybiBzdGFjay5zcGxpY2Uoc3RhY2subGVuZ3RoIC0gMSwgMSlbMF07CisgICAgICAgICAgfSwKKyAgICAgICAgICBsZW5ndGg6IGZ1bmN0aW9uICgpIHsKKyAgICAgICAgICAgIHJldHVybiBzdGFjay5sZW5ndGg7CisgICAgICAgICAgfQorICAgICAgICB9OworICAgICAgfQorICAgIH07CisgIH0pCisKKy8qKgorICogQSBoZWxwZXIgZGlyZWN0aXZlIGZvciB0aGUgJG1vZGFsIHNlcnZpY2UuIEl0IGNyZWF0ZXMgYSBiYWNrZHJvcCBlbGVtZW50LgorICovCisgIC5kaXJlY3Rpd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yB0cmlnZ2VyIENTUyB0cmFuc2l0aW9ucworICAgICAgICAgICAgc2NvcGUuZm9jdXNNb2RhbEZsYWcgPSB0cnVlOworICAgICAgICAgICAgc2NvcGUuYW5pbWF0ZSA9IHRydWU7CisgICAgICAgIH0pOworCQkkZG9jdW1lbnQub24oJ2ZvY3VzIGtleWRvd24nLCBmdW5jdGlvbihlKXsKKyAgICAgICAgICAgICAgICAgICAgaWYgKGUud2hpY2ggPT09OSkgeworCQkJU3RyaW5nLnByb3RvdHlwZS5jb250YWlucyA9IGZ1bmN0aW9uKGl0KSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHRoaXMuaW5kZXhPZihpdCkgIT09IC0xOworICAgICAgICAgICAgICAgICAgICAgICAgfTsKKwkJCWlmIChlbGVtZW50WzBdICE9PSBlLnRhcmdldCAmJiAhZWxlbWVudFswXS5jb250YWlucyggZS50YXJnZXQgKSkgeworCQkJCWVsZW1lbnRbMF0uZm9jdXMoKTsKKwkJCX0KKwkJCX0KKwkJfSk7CisgICAgICAgIHNjb3BlLmNsb3NlID0gZnVuY3Rpb24gKGV2dCkgeworICAgICAgICAgICAgdmFyIG1vZGFsID0gJG1vZGFsU3RhY2suZ2V0VG9wKCk7CisgICAgICAgICAgICBpZiAobW9kYWwgJiYgbW9kYWwudmFsdWUuYmFja2Ryb3AgJiYgbW9kYWwudmFsdWUuYmFja2Ryb3AgIT09ICdzdGF0aWMnICAmJiAoZXZ0LnRhcmdldCA9PT0gZXZ0LmN1cnJlbnRUYXJnZXQpKSB7CisgICAgICAgICAgICAvLyBDaGVjayBpZiBwcmV2ZW50RGVmYXVsdCBleGlzdHMgZHVlIHRvIGxhY2sgb2Ygc3VwcG9ydCBmb3IgSUU4CisgICAgICAgICAgICBpZiAoZXZ0LnByZXZlbnREZWZhdWx0KSB7CisgICAgICAgICAgICAgIGV2dC5wcmV2ZW50RGVmYXVsdCgpOworICAgICAgICAgICAgICBldnQuc3RvcFByb3BhZ2F0aW9uKCk7CisgICAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgICAgZXZ0LnJldHVyblZhbHVlID0gZmFsc2U7CisgICAgICAgICAgICB9CisgICAgICAgICAgICAkbW9kYWxTdGFjay5kaXNtaXNzKG1vZGFsLmtleSwgJ2JhY2tkcm9wIGNsaWNrJyk7CisgICAgICAgICAgfQorICAgICAgICB9OworICAgICAgfQorICAgIH07CisgIH1dKQorCisgIC5mYWN0b3J5KCckbW9kYWxTdGFjaycsIFsnJGRvY3VtZW50JywgJyRjb21waWxlJywgJyRyb290U2NvcGUnLCAnJCRzdGFja2VkTWFwJywKKyAgICBmdW5jdGlvbiAoJGRvY3VtZW50LCAkY29tcGlsZSwgJHJvb3RTY29wZSwgJCRzdGFja2VkTWFwKSB7CisgICAgICB2YXIgT1BFTkVEX01PREFMX0NMQVNTID0gJ21vZGFsLW9wZW4nOworICAgICAgdmFyIGJhY2tkcm9wanFMaXRlRWwsIGJhY2tkcm9wRG9tRWw7CisgICAgICB2YXIgYmFja2Ryb3BTY29wZSA9ICRyb290U2NvcGUuJG5ldyh0cnVlKTsKKyAgICAgIHZhciBvcGVuZWRXaW5kb3dzID0gJCRzdGFja2VkTWFwLmNyZWF0ZU5ldygpOworICAgICAgdmFyICRtb2RhbFN0YWNrID0ge307CisgICAgICBmdW5jdGlvbiBiYWNrZHJvcEluZGV4KCkgeworICAgICAgICB2YXIgdG9wQmFja2Ryb3BJbmRleCA9IC0xOworICAgICAgICB2YXIgb3BlbmVkID0gb3BlbmVkV2luZG93cy5rZXlzKCk7CisgICAgICAgIGZvciAodmFyIGkgPSAwOyBpIDwgb3BlbmVkLmxlbmd0aDsgaSsrKSB7CisgICAgICAgICAgaWYgKG9wZW5lZFdpbmRvd3MuZ2V0KG9wZW5lZFtpXSkudmFsdWUuYmFja2Ryb3ApIHsKKyAgICAgICAgICAgIHRvcEJhY2tkcm9wSW5kZXggPSBpOworICAgICAgICAgIH0KKyAgICAgICAgfQorICAgICAgICByZXR1c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Rkb2N1bWVudC5iaW5kKCdrZXlkb3duJywgZnVuY3Rpb24gKGV2dCkgeworICAgICAgICB2YXIgbW9kYWw7CisgICAgICAgIGlmIChldnQud2hpY2ggPT09IDI3KSB7CisgICAgICAgICAgbW9kYWwgPSBvcGVuZWRXaW5kb3dzLnRvcCgpOworICAgICAgICAgIGlmIChtb2RhbCAmJiBtb2RhbC52YWx1ZS5rZXlib2FyZCkgeworICAgICAgICAgICAgJHJvb3RTY29wZS4kYXBwbHkoZnVuY3Rpb24gKCkgeworICAgICAgICAgICAgICAkbW9kYWxTdGFjay5kaXNtaXNzKG1vZGFsLmtleSk7CisgICAgICAgICAgICB9KTsKKyAgICAgICAgICB9CisgICAgICAgIH0KKyAgICAgIH0pOworCisgICAgICAkbW9kYWxTdGFjay5vcGVuID0gZnVuY3Rpb24gKG1vZGFsSW5zdGFuY2UsIG1vZGFsKSB7CisgICAgICAgICAgb3BlbmVkV2luZG93cy5hZGQobW9kYWxJbnN0YW5jZSwgeworICAgICAgICAgIGRlZmVycmVkOiBtb2RhbC5kZWZlcnJlZCwKKyAgICAgICAgICBtb2RhbFNjb3BlOiBtb2RhbC5zY29wZSwKKyAgICAgICAgICBiYWNrZHJvcDogbW9kYWwuYmFja2Ryb3AsCisgICAgICAgICAga2V5Ym9hcmQ6IG1vZGFsLmtleWJvYXJkCisgICAgICAgIH0pOworICAgICAgICB2YXIgYm9keSA9ICRkb2N1bWVudC5maW5kKCdib2R5JykuZXEoMCk7CisKKyAgICAgICAgaWYgKGJhY2tkcm9wSW5kZXgoKSA+PSAwICYmICFiYWNrZHJvcERvbUVsKSB7CisgICAgICAgICAgICBiYWNrZHJvcGpxTGl0ZUVsID0gYW5ndWxhci5lbGVtZW50KCc8ZGl2IG1vZGFsLWJhY2tkcm9wPjwvZGl2PicpOworICAgICAgICAgICAgYmFja2Ryb3BEb21FbCA9ICRjb21waWxlKGJhY2tkcm9wanFMaXRlRWwpKGJhY2tkcm9wU2NvcGUpOworICAgICAgICAgIC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aW5kb3cgPSBvcGVuZWRXaW5kb3dzLmdldChtb2RhbEluc3RhbmNlKS52YWx1ZTsKKyAgICAgICAgaWYgKG1vZGFsV2luZG93KSB7CisgICAgICAgICAgbW9kYWxXaW5kb3cuZGVmZXJyZWQucmVqZWN0KHJlYXNvbik7CisgICAgICAgICAgcmVtb3ZlTW9kYWxXaW5kb3cobW9kYWxJbnN0YW5jZSk7CisgICAgICAgIH0KKyAgICAgIH07CisKKyAgICAgICRtb2RhbFN0YWNrLmdldFRvcCA9IGZ1bmN0aW9uICgpIHsKKyAgICAgICAgcmV0dXJuIG9wZW5lZFdpbmRvd3MudG9wKCk7CisgICAgICB9OworCisgICAgICByZXR1cm4gJG1vZGFsU3RhY2s7CisgICAgfV0pCisKKyAgLnByb3ZpZGVyKCckbW9kYWwnLCBmdW5jdGlvbiAoKSB7CisKKyAgICB2YXIgJG1vZGFsUHJvdmlkZXIgPSB7CisgICAgICBvcHRpb25zOiB7CisgICAgICAgIC8vY2FuIGJlIGFsc28gZmFsc2Ugb3IgJ3N0YXRpYycKKyAgICAgICAgYmFja2Ryb3A6IHRydWUsCisgICAgICAgIGtleWJvYXJkOiB0cnVlCisgICAgICB9LAorICAgICAgJGdldDogWyckaW5qZWN0b3InLCAnJHJvb3RTY29wZScsICckcScsICckaHR0cCcsICckdGVtcGxhdGVDYWNoZScsICckY29udHJvbGxlcicsICckbW9kYWxTdGFjaycsCisgICAgICAgIGZ1bmN0aW9uICgkaW5qZWN0b3IsICRyb290U2NvcGUsICRxLCAkaHR0cCwgJHRlbXBsYXRlQ2FjaGUsICRjb250cm9sbGVyLCAkbW9kYWxTdGFjaykgeworICAgICAgICAgICAgdmFyICRtb2RhbCA9IHt9OworICAgICAgICAgICAgZnVuY3Rpb24gZ2V0VGVtcGxhdGVQcm9taXNlKG9wdGlvbnMpIHsKKyAgICAgICAgICAgIHJldHVybiBvcHRpb25zLnRlbXBsYXRlID8gJHEud2hlbihvcHRpb25zLnRlbXBsYXRlKSA6CisgICAgICAgICAgICAgICRodHRwLmdldChvcHRpb25zLnRlbXBsYXRlVXJsLCB7Y2FjaGU6ICR0ZW1wbGF0ZUNhY2hlfSkudGhlbihmdW5jdGlvbiAocmVzdWx0KSB7CisgICAgICAgICAgICAgICAgcmV0dXJuIHJlc3VsdC5kYXRhOworICAgICAgICAgICAgICB9KTsKKyAgICAgICAgICB9CisKKyAgICAgICAgICBmdW5jdGlvbiBnZXRSZXNvbHZlUHJvbWlzZXMocmVzb2x2ZXMpIHsKKyAgICAgICAgICAgIHZhciBwcm9taXNlc0FyciA9IFtdOworICAgICAgICAgICAgYW5ndWxhci5mb3JFYWNoKHJlc29sdmVzLCBmdW5jdGlvbiAodmFsdWUpIHsKKyAgICAgICAgICAgICAgaWYgKGFuZ3VsYXIuaXNGdW5jdGlvbih2YWx1ZSkgfHwgYW5ndWxhci5pc0FycmF5KHZhbHVlKSkgeworICAgICAgICAgICAgICAgIHByb21pc2VzQXJyLnB1c2goJHEud2hlbigkaW5qZWN0b3IuaW52b2tlKHZhbHVlKSkpOworICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9KTsKKyAgICAgICAgICAgIHJldHVybiBwcm9taXNlc0FycjsKKyAgICAgICAgICB9CisgICAgICAgICAgJG1vZGFsLm9wZW4gPSBmdW5jdGlvbiAobW9kYWxPcHRpb25zKSB7CisgICAgICAgICAgICB2YXIgbW9kYWxSZXN1bHREZWZlcnJlZCA9ICRxLmRlZmVyKCk7CisgICAgICAgICAgICB2YXIgbW9kYWxPcGVuZWREZWZlcnJlZCA9ICRxLmRlZmVyKCk7CisKKyAgICAgICAgICAgIC8vcHJlcGFyZSBhbiBpbnN0YW5jZSBvZiBhIG1vZGFsIHRvIGJlIGluamVjdGVkIGludG8gY29udHJvbGxlcnMgYW5kIHJldHVybmVkIHRvIGEgY2FsbGVyCisgICAgICAgICAgICB2YXIgbW9kYWxJbnN0YW5jZSA9IHsKKyAgICAgICAgICAgICAgcmVzdWx0OiBtb2RhbFJlc3VsdERlZmVycmVkLnByb21pc2UsCisgICAgICAgICAgICAgIG9wZW5lZDogbW9kYWxPcGVuZWREZWZlcnJlZC5wcm9taXNlLAorICAgICAgICAgICAgICBjbG9zZTogZnVuY3Rpb24gKHJlc3VsdCkgeworICAgICAgICAgICAgICAgICRtb2RhbFN0YWNrLmNsb3NlKG1vZGFsSW5zdGFuY2UsIHJlc3VsdCk7CisgICAgICAgICAgICAgIH0sCisgICAgICAgICAgICAgIGRpc21pc3M6IGZ1bmN0aW9uIChyZWFzb24pIHsKKyAgICAgICAgICAgICAgICAkbW9kYWxTdGFjay5kaXNtaXNzKG1vZGFsSW5zdGFuY2UsIHJlYXNvbik7CisgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH07CisgICAgICAgICAgICAvL21lcmdlIGFuZCBjbGVhbiB1cCBvcHRpb25zCisgICAgICAgICAgICBtb2RhbE9wdGlvbnMgPSBhbmd1bGFyLmV4dGVuZCh7fSwgJG1vZGFsUHJvdmlkZXIub3B0aW9ucywgbW9kYWxPcHRpb25zKTsKKyAgICAgICAgICAgIG1vZGFsT3B0aW9ucy5yZXNvbHZlID0gbW9kYWxPcHRpb25zLnJlc29sdmUgfHwge307CisKKyAgICAgICAgICAgIC8vdmVyaWZ5IG9wdGlvbnMKKyAgICAgICAgICAgIGlmICghbW9kYWxPcHRpb25zLnRlbXBsYXRlICYmICFtb2RhbE9wdGlvbnMudGVtcGxhdGVVcmwpIHsKKyAgICAgICAgICAgICAgdGhyb3cgbmV3IEVycm9yKCdPbmUgb2YgdGVtcGxhdGUgb3IgdGVtcGxhdGVVcmwgb3B0aW9ucyBpcyByZXF1aXJlZC4nKTsKKyAgICAgICAgICAgIH0KKworICAgICAgICAgICAgdmFyIHRlbXBsYXRlQW5kUmVzb2x2ZVByb21pc2UgPQorICAgICAgICAgICAgICAkcS5hbGwoW2dldFRlbXBsYXRlUHJvbWlzZShtb2RhbE9wdGlvbnMpXS5jb25jYXQoZ2V0UmVzb2x2ZVByb21pc2VzKG1vZGFsT3B0aW9ucy5yZXNvbHZlKSkpOworICAgICAgICAgICAgICB0ZW1wbGF0ZUFuZFJlc29sdmVQcm9taXNlLnRoZW4oZnVuY3Rpb24odHBsQW5kVmFycykgeworICAgICAgICAgICAgICB2YXIgbW9kYWxTY29wZSA9IChtb2RhbE9wdGlvbnMuc2NvcGUgfHwgJHJvb3RTY29wZSkuJG5ldygpOworICAgICAgICAgICAgICBtb2RhbFNjb3BlLiRjbG9zZSA9IG1vZGFsSW5zdGFuY2UuY2xvc2U7CisgICAgICAgICAgICAgIG1vZGFsU2NvcGUuJGRpc21pc3MgPSBtb2RhbEluc3RhbmNlLmRpc21pc3M7CisKKyAgICAgICAgICAgICAgdmFyIGN0cmxJbnN0YW5jZSwgY3RybExvY2FscyA9IHt9OworICAgICAgICAgICAgICB2YXIgcmVzb2x2ZUl0ZXIgPSAxOworCisgICAgICAgICAgICAgIC8vY29udHJvbGxlcnMKKyAgICAgICAgICAgICAgaWYgKG1vZGFsT3B0aW9ucy5jb250cm9sbGVyKSB7CisgICAgICAgICAgICAgICAgY3RybExvY2Fscy4kc2NvcGUgPSBtb2RhbFNjb3BlOworICAgICAgICAgICAgICAgIGN0cmxMb2NhbHMuJG1vZGFsSW5zdGFuY2UgPSBtb2RhbEluc3RhbmNlOworICAgICAgICAgICAgICAgIGFuZ3VsYXIuZm9yRWFjaChtb2RhbE9wdGlvbnMucmVzb2x2ZSwgZnVuY3Rpb24gKHZhbHVlLCBrZXkpIHsKKyAgICAgICAgICAgICAgICAgIGN0cmxMb2NhbHNba2V5XSA9IHRwbEFuZFZhcnNbcmVzb2x2ZUl0ZXIrK107CisgICAgICAgICAgICAgICAgfSk7CisKKyAgICAgICAgICAgICAgICBjdHJsSW5zdGFuY2UgPSAkY29udHJvbGxlcihtb2RhbE9wdGlvbnMuY29udHJvbGxlciwgY3RybExvY2Fscyk7CisgICAgICAgICAgICAgIH0KKworICAgICAgICAgICAgICAkbW9kYWxTdGFjay5vcGVuKG1vZGFsSW5zdGFuY2UsIHsKKyAgICAgICAgICAgICAgICBzY29wZTogbW9kYWxTY29wZSwKKyAgICAgICAgICAgICAgICBkZWZlcnJlZDogbW9kYWxSZXN1bHREZWZlcnJlZCwKKyAgICAgICAgICAgICAgICBjb250ZW50OiB0cGxBbmRWYXJzWzBdLAorICAgICAgICAgICAgICAgIGJhY2tkcm9wOiBtb2RhbE9wdGlvbnMuYmFja2Ryb3AsCisgICAgICAgICAgICAgICAga2V5Ym9hcmQ6IG1vZGFsT3B0aW9ucy5rZXlib2FyZCwKKyAgICAgICAgICAgICAgICB3aW5kb3dDbGFzczogbW9kYWxPcHRpb25zLndpbmRvd0NsYXNzCisgICAgICAgICAgICAgIH0pOworCisgICAgICAgICAgICB9LCBmdW5jdGlvbihyZWFzb24pIHsKKyAgICAgICAgICAgICAgbW9kYWxSZXN1bHREZWZlcnJlZC5yZWplY3QocmVhc29uKTsKKyAgICAgICAgICAgIH0pOworCisgICAgICAgICAgICB0ZW1wbGF0ZUFuZFJlc29sdmVQcm9taXNlLnRoZW4oZnVuY3Rpb24gKCkgeworICAgICAgICAgICAgICBtb2RhbE9wZW5lZERlZmVycmVkLnJlc29sdmUodHJ1ZSk7CisgICAgICAgICAgICB9LCBmdW5jdGlvbiAoKSB7CisgICAgICAgICAgICAgIG1vZGFsT3BlbmVkRGVmZXJyZWQucmVqZWN0KGZhbHNlKTsKKyAgICAgICAgICAgIH0pOworCisgICAgICAgICAgICByZXR1cm4gbW9kYWxJbnN0YW5jZTsKKyAgICAgICAgICB9OworCisgICAgICAgICAgcmV0dXJuICRtb2RhbDsKKyAgICAgICAgfV0KKyAgICB9OworCisgICAgcmV0dXJuICRtb2RhbFByb3ZpZGVyOworICB9KQorCisuZGlyZWN0aXZlKCJzaW1wbGVNb2RhbCIsIFsiJG1vZGFsIiwgZnVuY3Rpb24oJG1vZGFsKSB7CisgICAgICAgIHJldHVybiB7CisgICAgICAgICAgICByZXN0cmljdDogJ0VBJywKKyAgICAgICAgICAgIHNjb3BlOiB7CisgICAgICAgICAgICAgICAgc2ltcGxlTW9kYWw6ICdAJywKKyAgICAgICAgICAgICAgICBiYWNrZHJvcDonQCcsCisgICAgICAgICAgICAgICAga2V5Ym9hcmQ6J0AnLAorICAgICAgICAgICAgICAgIG1vZGFsT2s6JyYnLAorICAgICAgICAgICAgICAgIG1vZGFsQ2FuY2VsOicmJywKKyAgICAgICAgICAgICAgICB3aW5kb3dDbGFzczonQCcsCisgICAgICAgICAgICAgICAgY29udHJvbGxlcjonQCcKKyAgICAgICAgICAgIH0sCisgICAgICAgICAgICBsaW5rOiBmdW5jdGlvbihzY29wZSwgZWxtKSB7CisgICAgICAgICAgICAgICAgZWxtLmJpbmQoJ2NsaWNrJywgZnVuY3Rpb24oZXYpIHsKKyAgICAgICAgICAgICAgICAgICAgZXYucHJldmVudERlZmF1bHQoKTsKKyAgICAgICAgICAgICAgICAgICAgaWYgKGFuZ3VsYXIuaXNEZWZpbmVkKGVsbS5hdHRyKCJocmVmIikpICYmIGVsbS5hdHRyKCJocmVmIikgIT09ICIiKSB7CisgICAgICAgICAgICAgICAgICAgICAgICBzY29wZS5zaW1wbGVNb2RhbCA9IGVsbS5hdHRyKCJocmVmIik7CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgaWYoIXNjb3BlLmJhY2tkcm9wKXsKKyAgICAgICAgICAgICAgICAgICAgICAgc2NvcGUuYmFja2Ryb3BjbGljaz0nc3RhdGljJzsKKyAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAgICAgc2NvcGUuYmFja2Ryb3BjbGljaz10cnVlOworICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgIGlmKCFzY29wZS5rZXlib2FyZCApeworICAgICAgICAgICAgICAgICAgICAgICAgc2NvcGUua2V5Ym9hcmRldj1mYWxzZTsKKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICBlbHNleworICAgICAgICAgICAgICAgICAgICAgICAgc2NvcGUua2V5Ym9hcmRldj10cnVlOworICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICRtb2RhbC5vcGVuKHsKKyAgICAgICAgICAgICAgICAgICAgICAgIHRlbXBsYXRlVXJsOiBzY29wZS5zaW1wbGVNb2RhbCwKKyAgICAgICAgICAgICAgICAgICAgICAgIGJhY2tkcm9wOnNjb3BlLmJhY2tkcm9wY2xpY2ssCisgICAgICAgICAgICAgICAgICAgICAgICBrZXlib2FyZDpzY29wZS5rZXlib2FyZGV2LAorICAgICAgICAgICAgICAgICAgICAgICAgd2luZG93Q2xhc3M6c2NvcGUud2luZG93Q2xhc3MsCisgICAgICAgICAgICAgICAgICAgICAgICBjb250cm9sbGVyOiBzY29wZS5jb250cm9sbGVyCisgICAgICAgICAgICAgICAgICAgIH0pLnJlc3VsdC50aGVuKHNjb3BlLm1vZGFsT2ssIHNjb3BlLm1vZGFsQ2FuY2VsKTsKKyAgICAgICAgICAgICAgICB9KTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfTsKKyAgICB9XSk7CisKK2FuZ3VsYXIubW9kdWxlKCdhdHQuYWJzLnBhZ2luYXRpb24nLCBbJ2F0dC5hYnMudXRpbGl0aWVzJ10pCisuZGlyZWN0aXZlKCdhdHRQYWdpbmF0aW9uJywgWyBmdW5jdGlvbigpIHsKKyAgICAgcmV0dXJuIHsKKyAgICAgICAgcmVzdHJpY3Q6ICdFQScsCisgICAgICAgIHNjb3BlOiB7CisgICAgICAgICAgICB0b3RhbFBhZ2VzOiAnPScsCisgICAgICAgICAgICBjdXJyZW50UGFnZTogJz0nLAorICAgICAgICAgICAgc2hvd0lucHV0OiAnPScsCisgICAgICAgICAgICBjbGlja0hhbmRsZXI6ICc9PycKKyAgICAgICAgfSwKKyAgICAgICAgcmVwbGFjZTogdHJ1ZSwKKyAgICAgICAgdGVtcGxhdGVVcmw6ICdhcHAvc2NyaXB0cy9uZ19qc19hdHRfdHBscy9wYWdpbmF0aW9uL3BhZ2luYXRpb24uaHRtbCcsCisgICAgICAgIGxpbms6IGZ1bmN0aW9uKHNjb3BlKSB7CisgICAgICAgICAgICBzY29wZS5mb2N1c2VkUGFnZTsKKyAgICAgICAgICAgIHNjb3BlLiR3YXRjaCgndG90YWxQYWdlcycsIGZ1bmN0aW9uKHZhbHVlKSB7CisgICAgICAgICAgICAgICAgaWYoYW5ndWxhci5pc0RlZmluZWQodmFsdWUpICYmIHZhbHVlICE9PSBudWxsKXsKKyAgICAgICAgICAgICAgICAgICAgc2NvcGUucGFnZXMgPSBbXTsKKyAgICAgICAgICAgICAgICAgICAgaWYgKHZhbHVlIDwgMSkgeworICAgICAgICAgICAgICAgICAgICAgICAgc2NvcGUudG90YWxQYWdlcyA9IDE7CisgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm47CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgaWYgKHZhbHVlIDw9IDcpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIGZvciAodmFyIGkgPSAxOyBpIDw9IHZhbHVlOyBpKyspIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBzY29wZS5wYWdlcy5wdXNoKGkpOworICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKHZhbHVlID4gNykgeworICAgICAgICAgICAgICAgICAgICAgICAgdmFyIG1pZFZhbCA9IE1hdGguY2VpbCh2YWx1ZSAvIDIpOworICAgICAgICAgICAgICAgICAgICAgICAgc2NvcGUucGFnZXMgPSBbbWlkVmFsIC0gMSwgbWlkVmFsLCBtaWRWYWwgKyAxXTsKKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICBjdXJyZW50UGFnZUNoYW5nZWQoMSk7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfSk7CisgICAgICAgICAgICBzY29wZS4kd2F0Y2goJ2N1cnJlbnRQYWdlJywgZnVuY3Rpb24odmFsdWUpIHsKKyAgICAgICAgICAgICAgICBjdXJyZW50UGFnZUNoYW5nZWQodmFsdWUpOworICAgICAgICAgICAgfSk7CisgICAgICAgICAgICB2YXIgY2FsbGJhY2tIYW5kbGVyID0gZnVuY3Rpb24obnVtKSB7CisgICAgICAgICAgICAgICAgaWYgKGFuZ3VsYXIuaXNGdW5jdGlvbihzY29wZS5jbGlja0hhbmRsZXIpKXsKKyAgICAgICAgICAgICAgICAgICAgc2NvcGUuY2xpY2tIYW5kbGVyKG51bSk7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfTsKKyAgICAgICAgICAgIGZ1bmN0aW9uIGN1cnJlbnRQYWdlQ2hhbmdlZCh2YWx1ZSkgeworICAgICAgICAgICAgICAgIGlmIChhbmd1bGFyLmlzRGVmaW5lZCh2YWx1ZSkgJiYgdmFsdWUgIT09IG51bGwpIHsKKyAgICAgICAgICAgICAgICAgICAgaWYgKCF2YWx1ZSB8fCB2YWx1ZSA8IDEpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIHZhbHVlID0gMTsKKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICBpZiAodmFsdWUgPiBzY29wZS50b3RhbFBhZ2VzKSB7CisgICAgICAgICAgICAgICAgICAgICAgICB2YWx1ZSA9IHNjb3BlLnRvdGFsUGFnZXM7CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgaWYoc2NvcGUuY3VycmVudFBhZ2UgIT09IHZhbHVlKSB7CisgICAgICAgICAgICAgICAgICAgICAgICBzY29wZS5jdXJyZW50UGFnZSA9IHZhbHVlOworICAgICAgICAgICAgICAgICAgICAgICAgY2FsbGJhY2tIYW5kbGVyKHNjb3BlLmN1cnJlbnRQYWdlKTsKKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICBpZiAoc2NvcGUudG90YWxQYWdlcyA+IDcpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIGlmICh2YWx1ZSA8IHNjb3BlLnBhZ2VzWzBdICYmIHZhbHVlID4gMykgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNjb3BlLnBhZ2VzID0gW3ZhbHVlLCB2YWx1ZSArIDEsIHZhbHVlICsgMl07CisgICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKHZhbHVlID4gc2NvcGUucGFnZXNbMl0gJiYgdmFsdWUgPCBzY29wZS50b3RhbFBhZ2VzIC0gMikgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgc2NvcGUucGFnZXMgPSBbdmFsdWUgLSAyLCB2YWx1ZSAtIDEsIHZhbHVlXTsKKyAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAodmFsdWUgPD0gMykgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzY29wZS5wYWdlcyA9IFsxLCAyLCAzXTsKKyAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAodmFsdWUgPj0gc2NvcGUudG90YWxQYWdlcyAtIDIpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2NvcGUucGFnZXMgPSBbc2NvcGUudG90YWxQYWdlcyAtIDIsIHNjb3BlLnRvdGFsUGFnZXMgLSAxLCBzY29wZS50b3RhbFBhZ2VzXTsKKyAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIHNjb3BlLm5leHQgPSBmdW5jdGlvbihldmVudCkgeworICAgICAgICAgICAgICAgIGV2ZW50LnByZXZlbnREZWZhdWx0KCk7CisgICAgICAgICAgICAgICAgaWYgKHNjb3BlLmN1cnJlbnRQYWdlIDwgc2NvcGUudG90YWxQYWdlcykgeworICAgICAgICAgICAgICAgICAgICBzY29wZS5jdXJyZW50UGFnZSArPSAxOworICAgICAgICAgICAgICAgICAgICBjYWxsYmFja0hhbmRsZXIoc2NvcGUuY3VycmVudFBhZ2UpOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH07CisgICAgICAgICAgICBzY29wZS5wcmV2ID0gZnVuY3Rpb24oZXZlbnQpIHsKKyAgICAgICAgICAgICAgICBldmVudC5wcmV2ZW50RGVmYXVsdCgpOworICAgICAgICAgICAgICAgIGlmIChzY29wZS5jdXJyZW50UGFnZSA+IDEpIHsKKyAgICAgICAgICAgICAgICAgICAgc2NvcGUuY3VycmVudFBhZ2UgLT0gMTsKKyAgICAgICAgICAgICAgICAgICAgY2FsbGJhY2tIYW5kbGVyKHNjb3BlLmN1cnJlbnRQYWdlKTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9OworICAgICAgICAgICAgc2NvcGUuc2VsZWN0UGFnZSA9IGZ1bmN0aW9uKHZhbHVlLCBldmVudCkgeworICAgICAgICAgICAgICAgIGV2ZW50LnByZXZlbnREZWZhdWx0KCk7CisgICAgICAgICAgICAgICAgc2NvcGUuY3VycmVudFBhZ2UgPSB2YWx1ZTsKKyAgICAgICAgICAgICAgICBzY29wZS5mb2N1c2VkUGFnZSA9IHZhbHVlOworICAgICAgICAgICAgICAgIGNhbGxiYWNrSGFuZGxlcihzY29wZS5jdXJyZW50UGFnZSk7CisgICAgICAgICAgICB9OworICAgICAgICAgICAgc2NvcGUuY2hlY2tTZWxlY3RlZFBhZ2UgPSBmdW5jdGlvbih2YWx1ZSkgeworICAgICAgICAgICAgICAgIGlmKHNjb3BlLmN1cnJlbnRQYWdlID09PSB2YWx1ZSkgeworICAgICAgICAgICAgICAgICAgICByZXR1cm4gdHJ1ZTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgcmV0dXJuIGZhbHNlOworICAgICAgICAgICAgfTsKKyAgICAgICAgICAgIHNjb3BlLmlzRm9jdXNlZCA9IGZ1bmN0aW9uKHBhZ2Up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AgICB2YXIgcGFuZUlkID0gc2lkZVBhbmVSb3dzW2luZGV4XS5wYW5lSWQ7CisgICAgICAgICAgICAgICAgICAgIHZhciBkcmlsbERvd25UbyA9IHNpZGVQYW5lUm93c1tpbmRleF0uZHJpbGxEb3duVG87CisKKyAgICAgICAgICAgICAgICAgICAgdGhpcy5kcmlsbERvd25Ub01hcHBlcltwYW5lSWRdID0gZHJpbGxEb3duVG87CisKKyAgICAgICAgICAgICAgICAgICAgaWYoaW5kZXggPT09IDApeworICAgICAgICAgICAgICAgICAgICAgICAgdGhpcy5jdXJyZW50U2VsZWN0ZWRSb3dQYW5lSWQgPSBwYW5lSWQ7CisgICAgICAgICAgICAgICAgICAgICAgICB0aGlzLnNpZGVQYW5lVHJhY2tlcltwYW5lSWRdID0gW107CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICB9CisJCQl9CisJCX0KKwl9OworCisJdGhpcy5nZXRTaWRlUGFuZXNMaXN0ID0gZnVuY3Rpb24oKXsKKwkJcmV0dXJuIHRoaXMuc2lkZVBhbmVUcmFja2VyW3RoaXMuY3VycmVudFNlbGVjdGVkUm93UGFuZUlkXTsKKwl9OworCisJdGhpcy5hZGRUb1NpZGVQYW5lc0xpc3QgPSBmdW5jdGlvbihuZXdQYW5lSWQpeworCQlpZih0aGlzLnNpZGVQYW5lVHJhY2tlclt0aGlzLmN1cnJlbnRTZWxlY3RlZFJvd1BhbmVJZF0gPT09IHVuZGVmaW5lZCl7CisJCQl0aGlzLnNpZGVQYW5lVHJhY2tlclt0aGlzLmN1cnJlbnRTZWxlY3RlZFJvd1BhbmVJZF0gPSBbXTsKKyAgICAgICAgfQorCQllbHNlIGlmKG5ld1BhbmVJZCl7CisgICAgICAgICAgICB0aGlzLnNpZGVQYW5lVHJhY2tlclt0aGlzLmN1cnJlbnRTZWxlY3RlZFJvd1BhbmVJZF0ucHVzaChuZXdQYW5lSWQpOworCQl9CisJfTsKKworCXRoaXMuc2V0V2lkdGggPSBm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IgaW5kZXg7CisJCQlmb3IoaW5kZXggaW4gc2lkZVBhbmUuc2lkZVBhbmVSb3dzKXsKKyAgICAgICAgICAgICAgICBpZiAoc2lkZVBhbmUuc2lkZVBhbmVSb3dzLmhhc093blByb3BlcnR5KGluZGV4KSkgeworICAgICAgICAgICAgICAgICAgICB2YXIgcGFuZSA9IHNpZGVQYW5lLnNpZGVQYW5lUm93c1tpbmRleF07CisKKyAgICAgICAgICAgICAgICAgICAgLy9Ta2lwIHRoZSBmaXJzdCBwYW5lIHJvdyBzaW5jZSB3ZSBoYW5kbGVkIGl0IGluIHRoZSBiZWdpbmluZworICAgICAgICAgICAgICAgICAgICBpZihpbmRleCA+IDAgJiYgcGFuZXNbcGFuZS5wYW5lSWRdLnN0YXJ0T3BlbiAmJiBwYW5lc1twYW5lLnBhbmVJZF0uc3RhcnRPcGVuKCkpeworICAgICAgICAgICAgICAgICAgICAgICAgb3RoZXJQYW5lc1N0YXJ0T3BlbmVkLnB1c2gocGFuZSk7CisgICAgICAgICAgICAgICAgICAgICAgICAvL1JlbWVtYmVyIHRoZSBwYW5lcyB0aGF0IGFyZSBvcGVuZWQgZm9yIHRoZSBmaXJzdCBwYW5lIHJvdyBJbmRleAorICAgICAgICAgICAgICAgICAgICAgICAgc2lkZVBhbmUuYWRkVG9TaWRlUGFuZXNMaXN0KHBhbmUucGFuZUlkKTsKKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIH0KKwkJCX0KKworICAgICAgICAgICAgaWYod2lkdGgpeworICAgICAgICAgICAgICAgIGZvcihpbmRleCBpbiBvdGhlclBhbmVzU3RhcnRPcGVuZWQpeworICAgICAgICAgICAgICAgICAgICBpZiAob3RoZXJQYW5lc1N0YXJ0T3BlbmVkLmhhc093blByb3BlcnR5KGluZGV4KSkgeworICAgICAgICAgICAgICAgICAgICAgICAgdmFyIHBhbmVJZCA9IG90aGVyUGFuZXNTdGFydE9wZW5lZFtpbmRleF0ucGFuZUlkOworICAgICAgICAgICAgICAgICAgICAgICAgdmFyIHBhbmVDdHJsID0gcGFuZXNbcGFuZUlkXTsKKworICAgICAgICAgICAgICAgICAgICAgICAgaWYocGFuZUN0cmwgJiYgcGFuZUN0cmwuc2V0V2lkdGggJiYgcGFuZUN0cmwuZGlzcGxheUJsb2NrKXsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBwYW5lQ3RybC5zZXRXaWR0aCh3aWR0aCk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgcGFuZUN0cmwuZGlzcGxheUJsb2NrKCk7CisgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9CisKKwkJfQorCX07CisKKwkvKgorCSAgUmVzZXRzIGFsbCB0aGUgcGFuZWxzIHRvIHRoZWlyIG9yaWdpbmFsIHBvc2l0aW9ucyBhdCB0aGUgZW5kIG9mIGEgc2lkZWJhciBjbGljaworCSAgQnkgc2V0dGluZyB0aGUgc2lkZUJhciB0byBpdHMgZGVmYXVsdCB3aWR0aAorCSAgU2V0dGluZyBhbGwgcGFuZXMgdG8gZmxvYXQgbGVmdCBhbmQgZGlzcGxheW5vbmUKKwkgIFNldHRpbmcgdGhlIHBhbmUgdGhhdCB3YXMgY2xpY2tlZCB0byBkZWZhdWx0IHdpZHRoIGFuZCBzbGlkZSByaWdodAorCSovCisKKwl0aGlzLnJlc2V0UGFuZXMgPSBmdW5jdGlvbigpeworCQlmb3IodmFyIGtleSBpbiB0aGlzLnBhbmVzKXsKKyAgICAgICAgICAgIGlmKHRoaXMucGFuZXMuaGFzT3duUHJvcGVydHkoa2V5KSl7CisgICAgICAgICAgICAgICAgdmFyIHBhbmUgPSB0aGlzLnBhbmVzW2tleV07CisgICAgICAgICAgICAgICAgaWYocGFuZSAmJiAocGFuZS5wYW5lSWQgIT09IHBhbmVHcm91cENvbnN0YW50cy5TSURFX1BBTkVfSUQpKXsKKyAgICAgICAgICAgICAgICA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hbmVzW3BhbmVJZF0uZGlzcGxheUJsb2NrKCk7CisgICAgICAgICAgICAgICAgICAgIHRoaXMucGFuZXNbcGFuZUlkXS5zZXRXaWR0aChwYW5lR3JvdXBDb25zdGFudHMuSU5ORVJfUEFORV9ERUZBVUxUKTsKKwkJCQl9CisgICAgICAgICAgICAgICAgZWxzZXsKKyAgICAgICAgICAgICAgICAgICAgLy9NdWx0aXBsZSBwYW5lcyBvdXQKKyAgICAgICAgICAgICAgICAgICAgdmFyIG51bVBhbmVzID0gcGFuZXNMaXN0Lmxlbmd0aCArIDI7CisgICAgICAgICAgICAgICAgICAgIHZhciB3aWR0aCA9ICgoMTAwL251bVBhbmVzKSkgKyAnJSc7CisgICAgICAgICAgICAgICAgICAgIHRoaXMucGFuZXNbcGFuZUdyb3VwQ29uc3RhbnRzLlNJREVfUEFORV9JRF0uc2V0V2lkdGgod2lkdGgpOworCisgICAgICAgICAgICAgICAgICAgIC8vU2V0IHRoZSBzaWRlUGFuZXMgcGFuZQorICAgICAgICAgICAgICAgICAgICAvL3NldCB0aGUgcGFuZXMgY2hpbGRyZW4gbGlzdAorICAgICAgICAgICAgICAgICAgICBpZih0aGlzLnBhbmVzW3RoaXMucGFuZXNbcGFuZUdyb3VwQ29uc3RhbnRzLlNJREVfUEFORV9JRF0uY3VycmVudFNlbGVjdGVkUm93UGFuZUlkXSl7CisgICAgICAgICAgICAgICAgICAgICAgICB0aGlzLnBhbmVzW3RoaXMucGFuZXNbcGFuZUdyb3VwQ29uc3RhbnRzLlNJREVfUEFORV9JRF0uY3VycmVudFNlbGVjdGVkUm93UGFuZUlkXS5kaXNwbGF5QmxvY2soKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIHRoaXMucGFuZXNbdGhpcy5wYW5lc1twYW5lR3JvdXBDb25zdGFudHMuU0lERV9QQU5FX0lEXS5jdXJyZW50U2VsZWN0ZWRSb3dQYW5lSWRdLnNldFdpZHRoKHdpZHRoKTsKKyAgICAgICAgICAgICAgICAgICAgfQorCisgICAgICAgICAgICAgICAgICAgIGZvcih2YXIgaSBpbiBwYW5lc0xpc3QpeworICAgICAgICAgICAgICAgICAgICAgICAgaWYodGhpcy5wYW5lc1twYW5lc0xpc3RbaV1dKXsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB0aGlzLnBhbmVzW3BhbmVzTGlzdFtpXV0uZGlzcGxheUJsb2NrKCk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgdGhpcy5wYW5lc1twYW5lc0xpc3RbaV1dLnNldFdpZHRoKHdpZHRoKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgfQorCQkJCX0KKwkJCX0KKwkJfQorCQllbHNleworCisJCQkvL0hhdmUgdG8gY2hlY2sgdGhlIHBhbmVJZCB0aGF0IHdhcyBnaXZlbiBhbmQgd2hlcmUgaXQgaXMgZHJpbGxpbmcgZG93biB0bworCQkJdmFyIGlzUGFuZUluU3RhY2sgPSBmYWxzZTsKKworCQkJdmFyIHN0YWNrUGFuZUxpc3Q7CisKKwkJCWlmKHRoaXMucGFuZXNbcGFuZUdyb3VwQ29uc3RhbnRzLlNJREVfUEFORV9JRF0peworCQkJCXN0YWNrUGFuZUxpc3QgPSB0aGlzLnBhbmVzW3BhbmVHcm91cENvbnN0YW50cy5TSURFX1BBTkVfSURdLmdldFNpZGVQYW5lc0xpc3QoKTsKKyAgICAgICAgICAgIH0KKworCQkJZm9yKHZhciBqIGluIHN0YWNrUGFuZUxpc3QpeworICAgICAgICAgICAgICAgIGlmKHN0YWNrUGFuZUxpc3QuaGFzT3duUHJvcGVydHkoaikpeworICAgICAgICAgICAgICAgICAgICB2YXIgcElkID0gc3RhY2tQYW5lTGlzdFtqXTsKKyAgICAgICAgICAgICAgICAgICAgaWYocElkID09PSBwYW5lSWQpeworICAgICAgICAgICAgICAgICAgICAgICAgaXNQYW5lSW5TdGFjayA9IHRydWU7CisgICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAg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KyAgICAgICAgICAgIH0KKworCQkJdmFyIHRoYXQgPSB0aGlzOworCisJCQlpZih0aGF0LnBhbmVzW3BhbmVHcm91cENvbnN0YW50cy5TSURFX1BBTkVfSURdKXsKKwkJCQlwYW5lc0xpc3QgPSB0aGF0LnBhbmVzW3BhbmVHcm91cENvbnN0YW50cy5TSURFX1BBTkVfSURdLmdldFNpZGVQYW5lc0xpc3QoKTsKKyAgICAgICAgICAgIH0KKworCQkJZm9yKHZhciBwIGluIHBhbmVzTGlzdCl7CisgICAgICAgICAgICAgICAgaWYocGFuZXNMaXN0Lmhhc093blByb3BlcnR5KHApKXsKKyAgICAgICAgICAgICAgICAgICAgdmFyIHBhbmVMaXN0UGFuZUlkID0gcGFuZXNMaXN0W3BdOworICAgICAgICAgICAgICAgICAgICB2YXIgcGFuZSA9IHRoaXMucGFuZXNbcGFuZUxpc3RQYW5lSWRdOworICAgICAgICAgICAgICAgICAgICBpZihwYW5lTGlzdFBhbmVJZCAhPT0gc2xpZGVJblBhbmVJZCAmJiBwYW5lKXsKKyAgICAgICAgICAgICAgICAgICAgICAgIHBhbmUuc2V0V2lkdGgod2lkdGhUb1NldCk7CisgICAgICAgICAgICAgICAgICAgICAgICBwYW5lLmRpc3BsYXlCbG9jaygpOworICAgICAgICAgICAgICAgICAgICAgICAgcGFuZS5mbG9hdExlZnQoKTsKKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIH0KKwkJCX0KKworCQkJaWYodGhpcy5wYW5lc1t0aGlzLnBhbmVzW3BhbmVHcm91cENvbnN0YW50cy5TSURFX1BBTkVfSURdLmN1cnJlbnRTZWxlY3RlZFJvd1BhbmVJZF0peworCQkJCXRoaXMucGFuZXNbdGhpcy5wYW5lc1twYW5lR3JvdXBDb25zdGFudHMuU0lERV9QQU5FX0lEXS5jdXJyZW50U2VsZWN0ZWRSb3dQYW5lSWRdLmRpc3BsYXlCbG9jaygpOworCQkJCXRoaXMucGFuZXNbdGhpcy5wYW5lc1twY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SIgorICAgICAgICAgICAgICAgIH0pCisgICAgICAgICAgICAuZGlyZWN0aXZlKCdwcm9maWxlQ2FyZCcsWyckaHR0cCcsJyRxJywncHJvZmlsZVN0YXR1cycsIGZ1bmN0aW9uKCRodHRwLCRxLHByb2ZpbGVTdGF0dXMpIHsKKyAgICAgICAgICAgICAgIHJldHVybiB7CisgICAgICAgICAgICAgICAgICAgIHJlc3RyaWN0OiAnRUEnLAorICAgICAgICAgICAgICAgICAgICByZXBsYWNlOid0cnVlJywKKyAgICAgICAgICAgICAgICAgICAgdGVtcGxhdGVVcmw6ZnVuY3Rpb24oZWxlbWVudCwgYXR0cnMpeworICAgICAgICAgICAgICAgICAgICAgICAgaWYoIWF0dHJzLmFkZFVzZXIpeworICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiAnYXBwL3NjcmlwdHMvbmdfanNfYXR0X3RwbHMvcHJvZmlsZUNhcmQvcHJvZmlsZUNhcmQuaHRtbCc7CisgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICBlbHNleworICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiAnYXBwL3NjcmlwdHMvbmdfanNfYXR0X3RwbHMvcHJvZmlsZUNhcmQvYWRkVXNlci5odG1sJzsKKyAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgfSwKKyAgICAgICAgICAgICAgICAgICAgc2NvcGU6eworICAgICAgICAgICAgICAgICAgICAgICAgcHJvZmlsZTonPScKKyAgICAgICAgICAgICAgICAgICAgfSwKKyAgICAgICAgICAgICAgICAgICAgbGluazogZnVuY3Rpb24oc2NvcGUsIGVsZW0sIGF0dHIpeworICAgICAgICAgICAgICAgICAgICAgICAgc2NvcGUuaW1hZ2U9dHJ1ZTsKKyAgICAgICAgICAgICAgICAgICAgICAgIGZ1bmN0aW9uIGlzSW1hZ2Uoc3JjKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFyIGRlZmVycmVkID0gJHEuZGVmZXIoKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YXIgaW1hZ2UgPSBuZXcgSW1hZ2UoKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBpbWFnZS5vbmVycm9yID0gZnVuY3Rpb24oKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRlZmVycmVkLnJlamVjdChmYWxzZSk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgfTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBpbWFnZS5vbmxvYWQgPSBmdW5jdGlvbigpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZGVmZXJyZWQucmVzb2x2ZSh0cnVlKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB9OworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmKHNyYyE9PXVuZGVmaW5lZCAmJiBzcmMubGVuZ3RoPjAgKXsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaW1hZ2Uuc3JjID0gc3JjOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1lbHNleworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZGVmZXJyZWQucmVqZWN0KGZhbHNlKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGRlZmVycmVkLnByb21pc2U7CisgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICBpZighYXR0ci5hZGRVc2VyKXsKKyAgICAgICAgICAgICAgICAgICAgICAgIHNjb3BlLmltYWdlPWZhbHNlOworICAgICAgICAgICAgICAgICAgICAgICAgaXNJbWFnZShzY29wZS5wcm9maWxlLmltZykudGhlbihmdW5jdGlvbihpbWcpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBzY29wZS5pbWFnZT1pbWc7CisgICAgICAgICAgICAgICAgICAgICAgICB9KTsKKyAgICAgICAgICAgICAgICAgICAgICAgIHZhciBzcGxpdE5hbWU9KHNjb3BlLnByb2ZpbGUubmFtZSkuc3BsaXQoJyAnKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIHNjb3BlLmluaXRpYWxzPScnOworICAgICAgICAgICAgICAgICAgICAgICAgZm9yKHZhciBpPTA7aTxzcGxpdE5hbWUubGVuZ3RoO2krKyl7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2NvcGUuaW5pdGlhbHMgKz0gc3BsaXROYW1lW2ldWzBdOworICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgaWYoc2NvcGUucHJvZmlsZS5yb2xlLnRvVXBwZXJDYXNlKCk9PT1wcm9maWxlU3RhdHVzLnJvbGUpeworICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNjb3BlLmJhZGdlPXRydWU7CisgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICB2YXIgcHJvZmlsZVN0YXRlPXByb2ZpbGVTdGF0dXMuc3RhdHVzW3Njb3BlLnByb2ZpbGUuc3RhdGUudG9VcHBlckNhc2UoKV07CisgICAgICAgICAgICAgICAgICAgICAgICBpZihwcm9maWxlU3RhdGUpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBzY29wZS5wcm9maWxlLnN0YXRlPXByb2ZpbGVTdGF0dXMuc3RhdHVzW3Njb3BlLnByb2ZpbGUuc3RhdGUudG9VcHBlckNhc2UoKV0uc3RhdHVzOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNjb3BlLmNvbG9ySWNvbj1wcm9maWxlU3RhdHVzLnN0YXR1c1tzY29wZS5wcm9maWxlLnN0YXRlLnRvVXBwZXJDYXNlKCldLmNvbG9yOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmKHNjb3BlLnByb2ZpbGUuc3RhdGUudG9VcHBlckNhc2UoKT09PXByb2ZpbGVTdGF0dXMuc3RhdHVzLlBFTkRJTkcuc3RhdHVzLnRvVXBwZXJDYXNlKCl8fHNjb3BlLnByb2ZpbGUuc3RhdGUudG9VcHBlckNhc2UoKT09PXByb2ZpbGVTdGF0dXMuc3RhdHVzLkxPQ0tFRC5zdGF0dXMudG9VcHBlckNhc2UoKSl7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzY29wZS5wcm9maWxlLmxhc3RMb2dpbj1zY29wZS5wcm9maWxlLnN0YXRlOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgIHZhciB0b2RheT1uZXcgRGF0ZSgpLmdldFRpbWUoKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIHZhciBsYXN0bG9naW49bmV3IERhdGUoc2NvcGUucHJvZmlsZS5sYXN0TG9naW4pLmdldFRpbWUoKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIHZhciBkaWZmPSh0b2RheS1sYXN0bG9naW4pLygxMDAwKjYwKjYwKjI0KTsKKyAgICAgICAgICAgICAgICAgICAgICAgIGlmKGRpZmY8PTEpeworICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNjb3BlLnByb2ZpbGUubGFzdExvZ2luPSJUb2RheSI7CisgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICBlbHNlIGlmKGRpZmY8PTIpeworICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNjb3BlLnByb2ZpbGUubGFzdExvZ2luPSJZZXN0ZXJkYXkiOworICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfTsKKyAgICAgICAgfV0pOworYW5ndWxhci5tb2R1bGUoJ2F0dC5hYnMucHJvZ3Jlc3NCYXJzJywgW10pCisKKy5kaXJlY3RpdmUoJ2F0dFByb2dyZXNzQmFyJywgW2Z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KCkuYXBwZW5kKCc8ZGl2IGNsYXNzPSJhdHQtcmFkaW9fX2luZGljYXRvciI+PC9kaXY+Jyk7CisgICAgICAgICAgICBlbGVtZW50LnBhcmVudCgpLmF0dHIoInRpdGxlIiwgYXR0ci50aXRsZSk7CisgICAgICAgICAgICBlbGVtZW50LmF0dHIoInRhYmluZGV4IiwiLTEiKTsKKworICAgICAgICAgICAgbmdDdHJsLiRyZW5kZXIgPSBmdW5jdGlvbiAoKSB7CisgICAgICAgICAgICAgICAgdmFyIHNlbGVjdGVkID0gYW5ndWxhci5lcXVhbHMobmdDdHJsLiRtb2RlbFZhbHVlLCBhdHRyLmF0dFJhZGlvKTsKKyAgICAgICAgICAgICAgICBlbGVtZW50LnBhcmVudCgpLnRvZ2dsZUNsYXNzKGF0dFJhZGlvQ29uZmlnLmFjdGl2ZUNsYXNzLCBzZWxlY3RlZCk7CisgICAgICAgICAgICAgICAgZWxlbWVudC5wYXJlbnQoKS5hdHRyKCJhcmlhLWNoZWNrZWQiLCBzZWxlY3RlZCk7CisgICAgICAgICAgICB9OworCisgICAgICAgICAgICBzY29wZS51cGRhdGVNb2RlbCA9IGZ1bmN0aW9uIChldnQpIHsKKyAgICAgICAgICAgICAgICB2YXIgaXNBY3RpdmUgPSBlbGVtZW50LnBhcmVudCgpLmhhc0NsYXNzKGF0dFJhZGlvQ29uZmlnLmFjdGl2ZUNsYXNzKTsKKworICAgICAgICAgICAgICAgIGlmICghaXNBY3RpdmUgJiYgIXNjb3BlLmRpc2FibGVkKSB7CisgICAgICAgICAgICAgICAgICAgIG5nQ3RybC4kc2V0Vmlld1ZhbHVlKGlzQWN0aXZlID8gbnVsbCA6IGF0dHIuYXR0UmFkaW8pOworICAgICAgICAgICAgICAgICAgICBuZ0N0cmwuJHJlbmRlcigpOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICBldnQucHJldmVudERlZmF1bHQoKTsKKyAgICAgICAgICAgIH07CisKKyAgICAgICAgICAgIGF0dHIuJG9ic2VydmUoJ2Rpc2FibGVkJywgZnVuY3Rpb24gKHZhbCkgeworICAgICAgICAgICAgICAgIHNjb3BlLmRpc2FibGVkID0gKHZhbCB8fCB2YWwgPT09ICJkaXNhYmxlZCIgfHwgdmFsID09PSAidHJ1ZSIpOworICAgICAgICAgICAgICAgIGVsZW1lbnQucGFyZW50KCkudG9nZ2xlQ2xhc3MoYXR0UmFkaW9Db25maWcuZGlzYWJsZWRDbGFzcywgc2NvcGUuZGlzYWJsZWQpOworICAgICAgICAgICAgICAgIGVsZW1lbnQucGFyZW50KCkuYXR0cigidGFiaW5kZXgiLCBzY29wZS5kaXNhYmxlZCA/ICItMSIgOiAiMCIpOworICAgICAgICAgICAgfSk7CisgICAgICAgIH0KKyAgICB9OworfV0pOworCithbmd1bGFyLm1vZHVsZSgnYXR0LmFicy5zY3JvbGxiYXInLCBbXSkKKyAgICAuY29uc3RhbnQoJ2F0dFNjcm9sbGJhckNvbnN0YW50JywgeworICAgICAgICBkZWZhdWx0cyA6IHsKKyAgICAgICAgICAgICAvLyBWZXJ0aWNhbCBvciBob3Jpem9udGFsIHNjcm9sbGJhcj8gKCB4IHx8IHkgKS4KKyAgICAgICAgICAgICAgICBheGlzOiAneScsCisgICAgICAgICAgICAgICAgLy8gRW5hYmxlIG9yIGRpc2FibGUgdGhlIG1vdXNld2hlZWwuCisgICAgICAgICAgICAgICAgd2hlZWw6IHRydWUsCisgICAgICAgICAgICAgICAgLy8gSG93IG1hbnkgcGl4ZWxzIG11c3QgdGhlIG1vdXN3aGVlbCBzY3JvbGwgYXQgYSB0aW1lLgorICAgICAgICAgICAgICAgIHdoZWVsU3BlZWQ6IDQwLAorICAgICAgICAgICAgICAgIC8vIExvY2sgZGVmYXVsdCBzY3JvbGxpbmcgd2luZG93IHdoZW4gdGhlcmUgaXMgbm8gbW9yZSBjb250ZW50LgorICAgICAgICAgICAgICAgIHdoZWVsTG9jazogdHJ1ZSwKKyAgICAgICAgICAgICAgICAvLy8vIEVuYWJ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eworICAgICAgICAgICAgdmFyIGRlZmF1bHRzID1hdHRTY3JvbGxiYXJDb25zdGFudC5kZWZhdWx0czsKKyAgICAgICAgICAgIHZhciBvcHRpb25zID0gJGF0dHJzLnNjcm9sbGJhcjsKKyAgICAgICAgICAgIGlmIChvcHRpb25zKSB7CisgICAgICAgICAgICAgICAgb3B0aW9ucyA9ICRwYXJzZShvcHRpb25zKSgkc2NvcGUpOworICAgICAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgICAgICBvcHRpb25zID0ge307CisgICAgICAgICAgICB9CisgICAgICAgICAgICB0aGlzLm9wdGlvbnMgPSBhbmd1bGFyLmV4dGVuZCh7fSwgZGVmYXVsdHMsIG9wdGlvbnMpOworICAgICAgICAgICAgdGhpcy5fZGVmYXVsdHMgPSBkZWZhdWx0czsKKworICAgICAgICAgICAgdmFyIHNlbGYgPSB0aGlzLAorICAgICAgICAgICAgICAgICAgICAkYm9keSA9IGFuZ3VsYXIuZWxlbWVudChkb2N1bWVudC5xdWVyeVNlbGVjdG9yQWxsKCdib2R5JylbMF0pLAorICAgICAgICAgICAgICAgICAgICAkZG9jdW1lbnQgPSBhbmd1bGFyLmVsZW1lbnQoZG9jdW1lbnQpLAorICAgICAgICAgICAgICAgICAgICAkdmlld3BvcnQgPSBhbmd1bGFyLmVsZW1lbnQoJGVsZW1lbnRbMF0ucXVlcnlTZWxlY3RvckFsbCgnLnNjcm9sbC12aWV3cG9ydCcpWzBdKSwKKyAgICAgICAgICAgICAgICAgICAgJG92ZXJ2aWV3ID0gYW5ndWxhci5lbGVtZW50KCRlbGVtZW50WzBdLnF1ZXJ5U2VsZWN0b3JBbGwoJy5zY3JvbGwtb3ZlcnZpZXcnKVswXSksCisgICAgICAgICAgICAgICAgICAgICRzY3JvbGxiYXIgPSBhbmd1bGFyLmVsZW1lbnQoJGVsZW1lbnRbMF0ucXVlcnlTZWxlY3RvckFsbCgnLnNjcm9sbC1iYXInKVswXSksCisgICAgICAgICAgICAgICAgICAgICR0aHVtYiA9IGFuZ3VsYXIuZWxlbWVudCgkZWxlbWVudFswXS5xdWVyeVNlbGVjdG9yQWxsKCcuc2Nyb2xsLXRodW1iJylbMF0pLAorICAgICAgICAgICAgICAgICAgICBtb3VzZVBvc2l0aW9uID0gMCwKKyAgICAgICAgICAgICAgICAgICAgaXNIb3Jpem9udGFsID0gdGhpcy5vcHRpb25zLmF4aXMgPT09ICd4JywKKyAgICAgICAgICAgICAgICAgICAgaGFzVG91Y2hFdmVudHM9ZmFsc2UsCisgICAgICAgICAgICAgICAgICAgIC8vIE1vZGVybiBicm93c2VycyBzdXBwb3J0ICJ3aGVlbCIKKyAgICAgICAgICAgICAgICAgICAgd2hlZWxFdmVudCA9ICgib253aGVlbCIgaW4gZG9jdW1lbnQgPyAid2hlZWwiIDoKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyBXZWJraXQgYW5kIElFIHN1cHBvcnQgYXQgbGVhc3QgIm1vdXNld2hlZWwiCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgZG9jdW1lbnQub25tb3VzZXdoZWVsICE9PSB1bmRlZmluZWQgPyAibW91c2V3aGVlbCIgOgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gbGV0J3MgYXNzdW1lIHRoYXQgcmVtYWluaW5nIGJyb3dzZXJzIGFyZSBvbGRlciBGaXJlZm94CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgIkRPTU1vdXNlU2Nyb2xsIiksCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2l6ZUxhYmVsID0gaXNIb3Jpem9udGFsID8gJ3dpZHRoJyA6ICdoZWlnaHQnLAorICAgICAgICAgICAgICAgICAgICBzaXplTGFiZWxDYXAgPSBzaXplTGFiZWwuY2hhckF0KDApLnRvVXBwZXJDYXNlKCkgKyBzaXplTGFiZWwuc2xpY2UoMSkudG9Mb3dlckNhc2UoKSwKKyAgICAgICAgICAgICAgICAgICAgcG9zaUxhYmVsID0gaXNIb3Jpem9udGFsID8gJ2xlZnQnIDogJ3RvcCcsCisgICAgICAgICAgICAgICAgICAgIC8vIG1vdmVFdmVudCA9IGRvY3VtZW50LmNyZWF0ZUV2ZW50KCdIVE1MRXZlbnRzJyksCisgICAgICAgICAgICAgICAgICAgIHJlc3RvcmVWaXNpYmlsaXR5QWZ0ZXJXaGVlbCwKKyAgICAgICAgICAgICAgICAgICAgdGh1bWJzY3JvbGx0b3VjaD1mYWxzZSxkb2N1bW5ldHNjcm9sbHRvdWNoPWZhbHNlOworICAgICAgICAgICAgICAgIGlmKCgnb250b3VjaHN0YXJ0JyBpbiB3aW5kb3cpIHx8IHdpbmRvdy5Eb2N1bWVudFRvdWNoICYmIGRvY3VtZW50IGluc3RhbmNlb2YgRG9jdW1lbnRUb3VjaCkgeworICAgICAgICAgICAgICAgICAgICBoYXNUb3VjaEV2ZW50cyA9IHRydWU7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRoaXMuY29udGVudFBvc2l0aW9uID0gMDsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB0aGlzLnZpZXdwb3J0U2l6ZSA9IDA7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgdGhpcy5jb250ZW50U2l6ZSA9IDA7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgdGhpcy5jb250ZW50UmF0aW8gPSAwOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRoaXMudHJhY2tTaXplID0gMDsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB0aGlzLnRyYWNrUmF0aW8gPSAwOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRoaXMudGh1bWJTaXplID0gMDsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB0aGlzLnRodW1iUG9zaXRpb24gPSAwOworCisgICAgICAgICAgICB0aGlzLmluaXRpYWxpemUgPSBmdW5jdGlvbigpIHsKKyAgICAgICAgICAgICAgICBpZiAoIXRoaXMub3B0aW9ucy5hbHdheXNWaXNpYmxlKSB7CisgICAgICAgICAgICAgICAgICAgICRzY3JvbGxiYXIuY3NzKCdvcGFjaXR5JywgMCk7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIHNlbGYudXBkYXRlKCk7CisgICAgICAgICAgICAgICAgc2V0RXZlbnRzKCk7CisgICAgICAgICAgICAgICAgcmV0dXJuIHNlbGY7CisgICAgICAgICAgICB9OworICAgICAgICAgICAgdGhpcy5zZXRTaXplRGF0YSA9IGZ1bmN0aW9uKCkgeworICAgICAgICAgICAgICAgIHRoaXMudmlld3BvcnRTaXplID0gJHZpZXdwb3J0LnByb3AoJ29mZnNldCcgKyBzaXplTGFiZWxDYXApIHx8IDE7CisgICAgICAgICAgICAgICAgdGhpcy5jb250ZW50U2l6ZSA9ICRvdmVydmlldy5wcm9wKCdzY3JvbGwnICsgc2l6ZUxhYmVsQ2FwKSB8fCAxOworICAgICAgICAgICAgICAgIHRoaXMuY29udGVudFJhdGlvID0gdGhpcy52aWV3cG9ydFNpemUgLyB0aGlzLmNvbnRlbnRTaXplOworICAgICAgICAgICAgICAgIHRoaXMudHJhY2tTaXplID0gdGhpcy5vcHRpb25zLnRyYWNrU2l6ZSB8fCB0aGlzLnZpZXdwb3J0U2l6ZTsKKyAgICAgICAgICAgICAgICB0aGlzLnRodW1iU2l6ZSA9IE1hdGgubWluKHRoaXMudHJhY2tTaXplLCBNYXRoLm1heCgwLCAodGhpcy5vcHRpb25zLnRodW1iU2l6ZSB8fCAodGhpcy50cmFja1NpemUgKiB0aGlzLmNvbnRlbnRSYXRpbykpKSk7CisgICAgICAgICAgICAgICAgdGhpcy50cmFja1JhdGlvID0gdGhpcy5vcHRpb25zLnRodW1iU2l6ZSA/ICh0aGlzLmNvbnRlbnRTaXplIC0gdGhpcy52aWV3cG9ydFNpemUpIC8gKHRoaXMudHJhY2tTaXplIC0gdGhpcy50aHVtYlNpemUpIDogKHRoaXMuY29udGVudFNpemUgLyB0aGlzLnRyYWNrU2l6ZSk7CisgICAgICAgICAgICB9OworICAgICAgICAgICAgdGhpcy51cGRhdGUgPSBmdW5jdGlvbihzY3JvbGxUbykgeworICAgICAgICAgICAgICAgIHNlbGYuc2V0U2l6ZURhdGEoKTsKKyAgICAgICAgICAgICAgICBtb3VzZVBvc2l0aW9uID0gJHNjcm9sbGJhci5wcm9wKCdvZmZzZXRUb3AnKTsKKworICAgICAgICAgICAgICAgICRzY3JvbGxiYXIudG9nZ2xlQ2xhc3MoJ2Rpc2FibGUnLCB0aGlzLmNvbnRlbnRSYXRpbyA+PSAxIHx8IGlzTmFOKHRoaXMuY29udGVudFJhdGlvKSk7CisKKyAgICAgICAgICAgICAgICBpZiAoIXRoaXMub3B0aW9ucy5hbHdheXNWaXNpYmxlICYmIHRoaXMuY29udGVudFJhdGlvIDwgMSAmJiB0aGlzLnZpZXdwb3J0U2l6ZSA+IDApIHsKKyAgICAgICAgICAgICAgICAgICAgLy9mbGFzaCB0aGUgc2Nyb2xsYmFyIHdoZW4gdXBkYXRlIGhhcHBlbnMKKyAgICAgICAgICAgICAgICAgICAgJGFuaW1hdGUuYWRkQ2xhc3MoJHNjcm9sbGJhciwgJ3Zpc2libGUnKS50aGVuKGZ1bmN0aW9uKCkgeworICAgICAgICAgICAgICAgICAgICAgICAgJGFuaW1hdGUucmVtb3ZlQ2xhc3MoJHNjcm9sbGJhciwgJ3Zpc2libGUnKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICRzY29wZS4kZGlnZXN0KCk7CisgICAgICAgICAgICAgICAgICAgIH0pOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICBpZiAoc2Nyb2xsVG8gIT09IG51bGwpIHsKKyAgICAgICAgICAgICAgICBpZiAoc2Nyb2xsVG89PT0nYm90dG9tJykgeworICAgICAgICAgICAgICAgICAgICAgdGhpcy5jb250ZW50UG9zaXRpb24gPSB0aGlzLmNvbnRlbnRTaXplIC0gdGhpcy52aWV3cG9ydFNpemU7CisgICAgICAgICAgICAgICAgIH1lbHNleworICAgICAgICAgICAgICAgICAgICAgdGhpcy5jb250ZW50UG9zaXRpb24gPSBwYXJzZUludChzY3JvbGxUbywgMTApIHx8IDA7CisgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgZW5zdXJlQ29udGVudFBvc2l0aW9uKCk7CisgICAgICAgICAgICAgICAgJHRodW1iLmNzcyhwb3NpTGFiZWwsIHNlbGYuY29udGVudFBvc2l0aW9uIC8gc2VsZi50cmFja1JhdGlvICsgJ3B4Jyk7CisgICAgICAgICAgICAgICAgJHNjcm9sbGJhci5jc3Moc2l6ZUxhYmVsLCBzZWxmLnRyYWNrU2l6ZSArICdweCcpOworICAgICAgICAgICAgICAgICR0aHVtYi5jc3Moc2l6ZUxhYmVsLCBzZWxmLnRodW1iU2l6ZSArICdweCcpOworICAgICAgICAgICAgICAgICRvdmVydmlldy5jc3MocG9zaUxhYmVsLCAtc2VsZi5jb250ZW50UG9zaXRpb24gKyAncHgnKTsKKworICAgICAgICAgICAgICAgIHJldHVybiB0aGlzOworICAgICAgICAgICAgfTsKKyAgICAgICAgICAgIGZpcmVFdmVudCA9IGZ1bmN0aW9uKG9iaiwgZXZ0KSB7CisgICAgICAgICAgICAgICAgdmFyIGZpcmVPblRoaXMgPSBvYmo7CisgICAgICAgICAgICAgICAgdmFyIGV2dE9iajsKKyAgICAgICAgICAgICAgICBpZiAoZG9jdW1lbnQuY3JlYXRlRXZlbnQpIHsKKyAgICAgICAgICAgICAgICAgICAgZXZ0T2JqID0gZG9jdW1lbnQuY3JlYXRlRXZlbnQoJ0hUTUxFdmVudHMnKTsKKyAgICAgICAgICAgICAgICAgICAgZXZ0T2JqLmluaXRFdmVudChldnQsIHRydWUsIGZhbHNlKTsKKyAgICAgICAgICAgICAgICAgICAgZmlyZU9uVGhpcy5kaXNwYXRjaEV2ZW50KGV2dE9iaik7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIGVsc2UgaWYgKGRvY3VtZW50LmNyZWF0ZUV2ZW50T2JqZWN0KSB7CisgICAgICAgICAgICAgICAgICAgIGV2dE9iaiA9IGRvY3VtZW50LmNyZWF0ZUV2ZW50T2JqZWN0KCk7CisgICAgICAgICAgICAgICAgICAgIGZpcmVPblRoaXMuZmlyZUV2ZW50KCdvbicgKyBldnQsIGV2dE9iaik7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfTsKKyAgICAgICAgICAgIGZ1bmN0aW9uIGVuc3VyZUNvbnRlbnRQb3NpdGlvbigpIHsKKyAgICAgICAgICAgICAgICAvLyBpZiBzY3JvbGxiYXIgaXMgb24sIGVuc3VyZSB0aGUgYm90dG9tIG9mIHRoZSBjb250ZW50IGRvZXMgbm90IGdvIGFib3ZlIHRoZSBib3R0b20gb2YgdGhlIHZpZXdwb3J0CisgICAgICAgICAgICAgICAgaWYgKHNlbGYuY29udGVudFJhdGlvIDw9IDEgJiYgc2VsZi5jb250ZW50UG9zaXRpb24gPiBzZWxmLmNvbnRlbnRTaXplIC0gc2VsZi52aWV3cG9ydFNpemUpIHsKKyAgICAgICAgICAgICAgICAgICAgc2VsZi5jb250ZW50UG9zaXRpb24gPSBzZWxmLmNvbnRlbnRTaXplIC0gc2VsZi52aWV3cG9ydFNpemU7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIC8vIGlmIHNjcm9sbGJhciBpcyBvZmYsIGVuc3VyZSB0aGUgdG9wIG9mIHRoZSBjb250ZW50IGRvZXMgbm90IGdvIGJlbG93IHRoZSB0b3Agb2YgdGhlIHZpZXdwb3J0CisgICAgICAgICAgICAgICAgZWxzZSBpZiAoc2VsZi5jb250ZW50UmF0aW8gPiAxICYmIHNlbGYuY29udGVudFBvc2l0aW9uID4gMCkgeworICAgICAgICAgICAgICAgICAgICBzZWxmLmNvbnRlbnRQb3NpdGlvbiA9IDA7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfQorCisgICAgICAgICAgICBmdW5jdGlvbiBzZXRFdmVudHMoKSB7CisKKyAgICAgICAgICAgICAgICBpZiAoaGFzVG91Y2hFdmVudHMpIHsKKyAgICAgICAgICAgICAgICAgICAgJHZpZXdwb3J0Lm9uKCd0b3VjaHN0YXJ0JywgdG91Y2hzdGFydCk7CisgICAgICAgICAgICAgICAgICAgICR0aHVtYi5vbigndG91Y2hzdGFydCcsIHRvdWNoc3RhcnQpOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICBlbHNlIHsKKyAgICAgICAgICAgICAgICAgICAgJHRodW1iLm9uKCdtb3VzZWRvd24nLCBzdGFydCk7CisgICAgICAgICAgICAgICAgICAgICRzY3JvbGxiYXIub24oJ21vdXNlZG93bicsIGRyYWcpOworICAgICAgICAgICAgICAgIH0KKworICAgICAgICAgICAgICAgIGFuZ3VsYXIuZWxlbWVudCgkd2luZG93KS5vbigncmVzaXplJywgcmVzaXplKTsKKworICAgICAgICAgICAgICAgIGlmIChzZWxmLm9wdGlvbnMud2hlZWwpIHsKKyAgICAgICAgICAgICAgICAgICAgJGVsZW1lbnQub24od2hlZWxFdmVudCwgd2hlZWwpOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0KKworICAgICAgICAgICAgZnVuY3Rpb24gcmVzaXplKCkgeworICAgICAgICAgICAgICAgIHNlbGYudXBkYXRlKCk7CisgICAgICAgICAgICB9CisKKyAgICAgICAgICAgIGZ1bmN0aW9uIHRvdWNoc3RhcnQoZXZlbnQpIHsKKyAgICAgICAgICAgICAgICBpZiAoMSA9PT0gZXZlbnQudG91Y2hlcy5sZW5ndGgpIHsKKyAgICAgICAgICAgICAgICAgICAgZXZlbnQuc3RvcFByb3BhZ2F0aW9uKCk7CisgICAgICAgICAgICAgICAgICAgIHN0YXJ0KGV2ZW50LnRvdWNoZXNbMF0pOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0KKworICAgICAgICAgICAgZnVuY3Rpb24gc3RhcnQoZXZlbnQpIHsKKyAgICAgICAgICAgICAgICAkYm9keS5hZGRDbGFzcygnc2Nyb2xsLW5vLXNlbGVjdCcpOworICAgICAgICAgICAgICAgICRlbGVtZW50LmFkZENsYXNzKCdzY3JvbGwtbm8tc2VsZWN0Jyk7CisKKyAgICAgICAgICAgICAgICBpZiAoIXNlbGYub3B0aW9ucy5hbHdheXNWaXNpYmxlKSB7CisgICAgICAgICAgICAgICAgICAgICRzY3JvbGxiYXIuYWRkQ2xhc3MoJ3Zpc2libGUnKTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgbW91c2VQb3NpdGlvbiA9IGlzSG9yaXpvbnRhbCA/IGV2ZW50LmNsaWVudFggOiBldmVudC5jbGllbnRZOworICAgICAgICAgICAgICAgIHNlbGYudGh1bWJQb3NpdGlvbiA9IHBhcnNlSW50KCR0aHVtYi5jc3MocG9zaUxhYmVsKSwgMTApIHx8IDA7CisgICAgICAgICAgICAgICAgaWYgKGhhc1RvdWNoRXZlbnRzKSB7CisgICAgICAgICAgICAgICAgICAgIGRvY3VtbmV0c2Nyb2xsdG91Y2g9ZmFsc2U7CisgICAgICAgICAgICAgICAgICAgIHRodW1ic2Nyb2xsdG91Y2g9ZmFsc2U7CisgICAgICAgICAgICAgICAgICAgICR2aWV3cG9ydC5vbigndG91Y2htb3ZlJywgdG91Y2hkcmFnKTsKKyAgICAgICAgICAgICAgICAgICAgJHRodW1iLm9uKCd0b3VjaG1vdmUnLHRvdWNoZHJhZ3RodW1iKTsKKyAgICAgICAgICAgICAgICAgICAgJHRodW1iLm9uKCd0b3VjaGVuZCcsIGVuZCk7CisgICAgICAgICAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgICAgICAgICAgJGRvY3VtZW50Lm9uKCdtb3VzZW1vdmUnLCBkcmFnKTsKKyAgICAgICAgICAgICAgICAgICAgJGRvY3VtZW50Lm9uKCdtb3VzZXVwJywgZW5kKTsKKyAgICAgICAgICAgICAgICAgICAgJHRodW1iLm9uKCdtb3VzZXVwJywgZW5kKTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9CisKKyAgICAgICAgICAgIGZ1bmN0aW9uIHdoZWVsKGV2ZW50KSB7CisKKyAgICAgICAgICAgICAgICBpZiAoc2VsZi5jb250ZW50UmF0aW8gPj0gMSkgeworICAgICAgICAgICAgICAgICAgICByZXR1cm47CisgICAgICAgICAgICAgICAgfQorCisgICAgICAgICAgICAgICAgaWYgKCFzZWxmLm9wdGlvbnMuYWx3YXlzVmlzaWJsZSkgeworICAgICAgICAgICAgICAgICAgICAvL2NhbmNlbCByZW1vdmluZyB2aXNpYmlsaXR5IGlmIHdoZWVsIGV2ZW50IGlzIHRyaWdnZXJlZCBiZWZvcmUgdGhlIHRpbWVvdXQKKyAgICAgICAgICAgICAgICAgICAgaWYgKHJlc3RvcmVWaXNpYmlsaXR5QWZ0ZXJXaGVlbCkgeworICAgICAgICAgICAgICAgICAgICAgICAgJHRpbWVvdXQuY2FuY2VsKHJlc3RvcmVWaXNpYmlsaXR5QWZ0ZXJXaGVlbCk7CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgJHNjcm9sbGJhci5hZGRDbGFzcygndmlzaWJsZScpOworCisgICAgICAgICAgICAgICAgICAgIHJlc3RvcmVWaXNpYmlsaXR5QWZ0ZXJXaGVlbCA9ICR0aW1lb3V0KGZ1bmN0aW9uKCkgeworICAgICAgICAgICAgICAgICAgICAgICAgJHNjcm9sbGJhci5yZW1vdmVDbGFzcygndmlzaWJsZScpOworICAgICAgICAgICAgICAgICAgICB9LCAxMDApOworICAgICAgICAgICAgICAgIH0KKworCisgICAgICAgICAgICAgICAgdmFyIGV2bnRPYmogPSAoZXZlbnQgJiYgZXZlbnQub3JpZ2luYWxFdmVudCkgfHwgZXZlbnQgfHwgJHdpbmRvdy5ldmVudCwKKyAgICAgICAgICAgICAgICAgICAgICAgIGRlbHRhRGlyID0gc2VsZi5vcHRpb25zLmF4aXMudG9VcHBlckNhc2UoKSwKKyAgICAgICAgICAgICAgICAgICAgICAgIGRlbHRhID0geworICAgICAgICAgICAgICAgICAgICAgICAgICAgIFg6IGV2bnRPYmouZGVsdGFYLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIFk6IGV2bnRPYmouZGVsdGFZCisgICAgICAgICAgICAgICAgICAgICAgICB9LAorICAgICAgICAgICAgICAgIHdoZWVsU3BlZWQgPSBldm50T2JqLmRlbHRhTW9kZSA9PT0gMCA/IHNlbGYub3B0aW9ucy53aGVlbFNwZWVkIDogMTsKKworICAgICAgICAgICAgICAgIGlmIChzZWxmLm9wdGlvbnMuc2Nyb2xsSW52ZXJ0KSB7CisgICAgICAgICAgICAgICAgICAgIHdoZWVsU3BlZWQgKj0gLTE7CisgICAgICAgICAgICAgICAgfQorCisgICAgICAgICAgICAgICAgaWYgKHdoZWVsRXZlbnQgPT09ICdtb3VzZXdoZWVsJykgeworICAgICAgICAgICAgICAgICAgICBkZWx0YS5ZID0gLTEgKiBldm50T2JqLndoZWVsRGVsdGEgLyA0MDsKKyAgICAgICAgICAgICAgICAgICAgaWYoZXZudE9iai53aGVlbERlbHRhWCl7CisgICAgICAgICAgICAgICAgICAgZGVsdGEuWCA9IC0xICogZXZudE9iai53aGVlbERlbHRhWCAvIDQwOworICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICBkZWx0YS5YICo9IC0xIC8gd2hlZWxTcGVlZDsKKyAgICAgICAgICAgICAgICBkZWx0YS5ZICo9IC0xIC8gd2hlZWxTcGVlZDsKKworICAgICAgICAgICAgICAgIHZhciB3aGVlbFNwZWVkRGVsdGEgPSBkZWx0YVtkZWx0YURpcl07CisKKyAgICAgICAgICAgICAgICBzZWxmLmNvbnRlbnRQb3NpdGlvbiAtPSB3aGVlbFNwZWVkRGVsdGEgKiBzZWxmLm9wdGlvbnMud2hlZWxTcGVlZDsKKyAgICAgICAgICAgICAgICBzZWxmLmNvbnRlbnRQb3NpdGlvbiA9IE1hdGgubWluKChzZWxmLmNvbnRlbnRTaXplIC0gc2VsZi52aWV3cG9ydFNpemUpLCBNYXRoLm1heCgwLCBzZWxmLmNvbnRlbnRQb3NpdGlvbikpOworICAgICAgICAgICAgICAgIGZpcmVFdmVudCgkZWxlbWVudFswXSwgJ21vdmUnKTsKKworICAgICAgICAgICAgICAgIGVuc3VyZUNvbnRlbnRQb3NpdGlvbigpOworICAgICAgICAgICAgICAgICR0aHVtYi5jc3MocG9zaUxhYmVsLCBzZWxmLmNvbnRlbnRQb3NpdGlvbiAvIHNlbGYudHJhY2tSYXRpbyArICdweCcpOworICAgICAgICAgICAgICAgICRvdmVydmlldy5jc3MocG9zaUxhYmVsLCAtc2VsZi5jb250ZW50UG9zaXRpb24gKyAncHgnKTsKKworICAgICAgICAgICAgICAgIGlmIChzZWxmLm9wdGlvbnMud2hlZWxMb2NrIHx8IChzZWxmLmNvbnRlbnRQb3NpdGlvbiAhPT0gKHNlbGYuY29udGVudFNpemUgLSBzZWxmLnZpZXdwb3J0U2l6ZSkgJiYgc2VsZi5jb250ZW50UG9zaXRpb24gIT09IDApKSB7CisgICAgICAgICAgICAgICAgICAgIGV2bnRPYmoucHJldmVudERlZmF1bHQoKTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9CisKKyAgICAgICAgICAgIGZ1bmN0aW9uIHRvdWNoZHJhZyhldmVudCkgeworICAgICAgICAgICAgICAgIGV2ZW50LnByZXZlbnREZWZhdWx0KCk7CisgICAgICAgICAgICAgICAgZG9jdW1uZXRzY3JvbGx0b3VjaD10cnVlOworICAgICAgICAgICAgICAgIGRyYWcoZXZlbnQudG91Y2hlc1swXSk7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBmdW5jdGlvbiB0b3VjaGRyYWd0aHVtYihldmVudCl7CisgICAgICAgICAgICAgICAgZXZlbnQucHJldmVudERlZmF1bHQoKTsKKyAgICAgICAgICAgICAgICB0aHVtYnNjcm9sbHRvdWNoPXRydWU7CisgICAgICAgICAgICAgICAgZHJhZyhldmVudC50b3VjaGVzWzBdKTsKKyAgICAgICAgICAgIH0KKworICAgICAgICAgICAgZnVuY3Rpb24gZHJhZyhldmVudCkgeworCisgICAgICAgICAgICAgICAgaWYgKHNlbGYuY29udGVudFJhdGlvID49IDEpIHsKKyAgICAgICAgICAgICAgICAgICAgcmV0dXJuOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICB2YXIgbW91c2VQb3NpdGlvbk5ldyA9IGlzSG9yaXpvbnRhbCA/IGV2ZW50LmNsaWVudFggOiBldmVudC5jbGllbnRZLAorICAgICAgICAgICAgICAgICAgICAgICAgdGh1bWJQb3NpdGlvbkRlbHRhID0gbW91c2VQb3NpdGlvbk5ldyAtIG1vdXNlUG9zaXRpb247CisKKyAgICAgICAgICAgICAgICBpZiAoKHNlbGYub3B0aW9ucy5zY3JvbGxJbnZlcnQgJiYgIWhhc1RvdWNoRXZlbnRzKSB8fAorICAgICAgICAgICAgICAgICAgICAgICAgKGhhc1RvdWNoRXZlbnRzICYmICFzZWxmLm9wdGlvbnMuc2Nyb2xsSW52ZXJ0KSkKKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgIHRodW1iUG9zaXRpb25EZWx0YSA9IG1vdXNlUG9zaXRpb24gLSBtb3VzZVBvc2l0aW9uTmV3OworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICBpZihkb2N1bW5ldHNjcm9sbHRvdWNoICYmIGhhc1RvdWNoRXZlbnRzKXsKKyAgICAgICAgICAgICAgICAgICAgICAgIHRodW1iUG9zaXRpb25EZWx0YSA9IG1vdXNlUG9zaXRpb24gLSBtb3VzZVBvc2l0aW9uTmV3OworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICBpZih0aHVtYnNjcm9sbHRvdWNoICYmIGhhc1RvdWNoRXZlbnRzKXsKKyAgICAgICAgICAgICAgICAgICAgdGh1bWJQb3NpdGlvbkRlbHRhID0gbW91c2VQb3NpdGlvbk5ldyAtIG1vdXNlUG9zaXRpb247CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIHZhciB0aHVtYlBvc2l0aW9uTmV3ID0gTWF0aC5taW4oKHNlbGYudHJhY2tTaXplIC0gc2VsZi50aHVtYlNpemUpLCBNYXRoLm1heCgwLCBzZWxmLnRodW1iUG9zaXRpb24gKyB0aHVtYlBvc2l0aW9uRGVsdGEpKTsKKyAgICAgICAgICAgICAgICBzZWxmLmNvbnRlbnRQb3NpdGlvbiA9IHRodW1iUG9zaXRpb25OZXcgKiBzZWxmLnRyYWNrUmF0aW87CisgICAgICAgICAgICAgICAgZmlyZUV2ZW50KCRlbGVtZW50WzBdLCAnbW92ZScpOworCisgICAgICAgICAgICAgICAgZW5zdXJlQ29udGVudFBvc2l0aW9uKCk7CisgICAgICAgICAgICAgICAgJHRodW1iLmNzcyhwb3NpTGFiZWwsIHRodW1iUG9zaXRpb25OZXcgKyAncHgnKTsKKyAgICAgICAgICAgICAgICAkb3ZlcnZpZXcuY3NzKHBvc2lMYWJlbCwgLXNlbGYuY29udGVudFBvc2l0aW9uICsgJ3B4Jyk7CisgICAgICAgICAgICB9CisKKyAgICAgICAgICAgIGZ1bmN0aW9uIGVuZCgpIHsKKworICAgICAgICAgICAgICAgICRib2R5LnJlbW92ZUNsYXNzKCdzY3JvbGwtbm8tc2VsZWN0Jyk7CisgICAgICAgICAgICAgICAgJGVsZW1lbnQucmVtb3ZlQ2xhc3MoJ3Njcm9sbC1uby1zZWxlY3QnKTsKKyAgICAgICAgICAgICAgICBpZiAoIXNlbGYub3B0aW9ucy5hbHdheXNWaXNpYmxlKSB7CisgICAgICAgICAgICAgICAgICAgICRzY3JvbGxiYXIucmVtb3ZlQ2xhc3MoJ3Zpc2libGUnKTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgJGRvY3VtZW50Lm9mZignbW91c2Vtb3ZlJywgZHJhZyk7CisgICAgICAgICAgICAgICAgJGRvY3VtZW50Lm9mZignbW91c2V1cCcsIGVuZCk7CisgICAgICAgICAgICAgICAgJHRodW1iLm9mZignbW91c2V1cCcsIGVuZCk7CisgICAgICAgICAgICAgICAgJGRvY3VtZW50Lm9mZigndG91Y2htb3ZlJywgdG91Y2hkcmFnKTsKKyAgICAgICAgICAgICAgICAkZG9jdW1lbnQub2ZmKCdvbnRvdWNoZW5kJywgZW5kKTsKKyAgICAgICAgICAgICAgICAkdGh1bWIub2ZmKCd0b3VjaG1vdmUnLHRvdWNoZHJhZ3RodW1iKTsKKyAgICAgICAgICAgICAgICAkdGh1bWIub2ZmKCd0b3VjaGVuZCcsIGVuZCk7CisgICAgICAgICAgICB9CisgICAgICAgICAgICB0aGlzLmNsZWFudXAgPSBmdW5jdGlvbigpIHsKKyAgICAgICAgICAgICAgICAkdmlld3BvcnQub2ZmKCd0b3VjaHN0YXJ0JywgdG91Y2hzdGFydCk7CisgICAgICAgICAgICAgICAgJHRodW1iLm9mZignbW91c2Vkb3duJywgc3RhcnQpOworICAgICAgICAgICAgICAgICRzY3JvbGxiYXIub2ZmKCdtb3VzZWRvd24nLCBkcmFnKTsKKyAgICAgICAgICAgICAgICAkdGh1bWIub2ZmKCd0b3VjaG1vdmUnLHRvdWNoZHJhZ3RodW1iKTsKKyAgICAgICAgICAgICAgICAkdGh1bWIub2ZmKCd0b3VjaGVuZCcsIGVuZCk7CisgICAgICAgICAgICAgICAgYW5ndWxhci5lbGVtZW50KCR3aW5kb3cpLm9mZigncmVzaXplJywgcmVzaXplKTsKKyAgICAgICAgICAgICAgICAkZWxlbWVudC5vZmYod2hlZWxFdmVudCwgd2hlZWwpOworICAgICAgICAgICAgICAgIC8vZW5zdXJlIHNjcm9sbGJhciBpc24ndCBhY3RpdmF0ZWQKKyAgICAgICAgICAgICAgICBzZWxmLm9wdGlvbnMuYWx3YXlzVmlzaWJsZSA9IHRydWU7CisgICAgICAgICAgICAgICAgZW5kKCk7CisgICAgICAgICAgICB9OworCisgICAgICAgIH1dLAorICAgICAgICBsaW5rOiBmdW5jdGlvbihzY29wZSwgaUVsZW1lbnQsIGlBdHRycywgY29udHJvbGxlcikgeworICAgICAgICAgICAgdmFyIHBvc2l0aW9uID0gaUVsZW1lbnQuY3NzKCdwb3NpdGlvbicpOworICAgICAgICAgICAgaWYgKHBvc2l0aW9uICE9PSAncmVsYXRpdmUnICYmIHBvc2l0aW9uICE9PSAnYWJzb2x1dGUnKSB7CisgICAgICAgICAgICAgICAgaUVsZW1lbnQuY3NzKCdwb3NpdGlvbicsICdyZWxhdGl2ZScpOworICAgICAgICAgICAgfQorICAgICAgICAgICAgc2NvcGUuJHdhdGNoKGZ1bmN0aW9uKCkgeworICAgICAgICAgICAgICAgICR0aW1lb3V0KGZ1bmN0aW9uKCkgeworICAgICAgICAgICAgICAgICAgICB2YXIgJG92ZXJ2aWV3ID0gYW5ndWxhci5lbGVtZW50KGlFbGVtZW50WzBdLnF1ZXJ5U2VsZWN0b3JBbGwoJy5zY3JvbGwtb3ZlcnZpZXcnKVswXSk7CisgICAgICAgICAgICAgICAgICAgIHZhciBuZXdWYWx1ZSA9ICRvdmVydmlldy5wcm9wKCdzY3JvbGxIZWlnaHQnKTsKKyAgICAgICAgICAgICAgICAgICAgdmFyIG9sZFZhbHVlID0gc2NvcGUub2xkVmFsdWU7CisgICAgICAgICAgICAgICAgICAgIGlmIChuZXdWYWx1ZSAhPT0gb2xkVmFsdWUpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIHNjb3BlLm9sZFZhbHVlID0gbmV3VmFsdWU7CisgICAgICAgICAgICAgICAgICAgICAgICBjb250cm9sbGVyLnVwZGF0ZSgpOworICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgfSwgMTAwLCBmYWxzZSk7CisgICAgICAgICAgICB9KTsKKyAgICAgICAgICAgIGNvbnRyb2xsZXIuaW5pdGlhbGl6ZSgpOworICAgICAgICAgICAgaUVsZW1lbnQub24oJyRkZXN0cm95JywgZnVuY3Rpb24oKSB7CisgICAgICA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U7CisgICAgICAgICAgICBzY29wZS5zaG93bGlzdCA9IGZhbHNlOworICAgICAgICAgICAgaWYoYXR0ci5wbGFjZWhvbGRlckFzT3B0aW9uID09PSAiZmFsc2UiKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIHNjb3BlLnNlbGVjdE1zZyA9ICIiOworICAgICAgICAgICAgfQorICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIHNjb3BlLnNlbGVjdE1zZyA9IGF0dHIucGxhY2Vob2xkZXI7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBpZiAoYXR0ci5zdGFydHNXaXRoRmlsdGVyID09PSAidHJ1ZSIgfHwgYXR0ci5zdGFydHNXaXRoRmlsdGVyKSB7CisgICAgICAgICAgICAgICAgc2NvcGUuc3RhcnRzV2l0aEZpbHRlciA9IHRydWU7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBpZihhdHRyLnNob3dJbnB1dEZpbHRlciA9PT0gInRydWUiKXsKKyAgICAgICAgICAgICAgICBzY29wZS5zaG93U2VhcmNoID0gdHJ1ZTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIHNjb3BlLnNob3dEcm9wZG93biA9IGZ1bmN0aW9uKCl7CisgICAgICAgICAgICAgICAgaWYoIShhdHRyLmRpc2FibGVkKSl7CisgICAgICAgICAgICAgICAgICAgIHNjb3BlLnNob3dsaXN0ID0gIXNjb3BlLnNob3dsaXN0OworICAgICAgICAgICAgICAgICAgICBzY29wZS5zZXRTZWxlY3RUb3AoKTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9OworICAgICAgICAgICAgZWxlbWVudC5iaW5kKCJrZXlkb3duIiwgZnVuY3Rpb24oZSl7CisgICAgICAgICAgICAgICAgaWYgKGtleW1hcC5pc0FsbG93ZWRLZXkoZS5rZXlDb2RlKSB8fCBrZXltYXAuaXNDb250cm9sKGUpIHx8IGtleW1hcC5pc0Z1bmN0aW9uS2V5KGUpKQorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgZS5wcmV2ZW50RGVmYXVsdCgpOworICAgICAgICAgICAgICAgICAgICBlLnN0b3BQcm9wYWdhdGlvbigpOworCisgICAgICAgICAgICAgICAgICAgIHN3aXRjaCAoZS5rZXlDb2RlKSB7CisgICAgICAgICAgICAgICAgICAgICAgICBjYXNlIGtleW1hcC5LRVkuRE9XTjoKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBzY29wZS5zZWxlY3ROZXh0KCk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgICAgICAgICBjYXNlIGtleW1hcC5LRVkuVVA6CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2NvcGUuc2VsZWN0UHJldigpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgICAgICAgICAgY2FzZSBrZXltYXAuS0VZLkVOVEVSOgorICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNjb3BlLnNlbGVjdEN1cnJlbnQoKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICAgICAgICAgIGNhc2Uga2V5bWFwLktFWS5CQUNLU1BBQ0U6CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2NvcGUudGl0bGUgPSAiIjsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBzY29wZS4kYXBwbHkoKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICAgICAgICAgIGNhc2Uga2V5bWFwLktFWS5TUEFDRToKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBzY29wZS50aXRsZSArPSAiICI7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2NvcGUuJGFwcGx5KCk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgICAgICAgICBjYXNlIGtleW1hcC5LRVkuRVNDOgorICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmKHNjb3BlLnRpdGxlID09PSAiIikKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNjb3BlLnNob3dsaXN0ID0gZmFsc2U7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNjb3BlLiRhcHBseSgpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzY29wZS50aXRsZSA9ICIiOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzY29wZS4kYXBwbHkoKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgICAgICAgICBkZWZhdWx0OjsKKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICBpZih0eXBlb2Ygc2NvcGUuc2hvd1NlYXJjaCA9PT0gJ2Jvb2xlYW4nICYmICFzY29wZS5zaG93U2VhcmNoICYmIGUua2V5Q29kZSAhPT0gOSkKKyAgICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAgICAgc2NvcGUuc2hvd2xpc3QgPSB0cnVlOworICAgICAgICAgICAgICAgICAgICAgICAgc2NvcGUudGl0bGUgPSBzY29wZS50aXRsZSA/IHNjb3BlLnRpdGxlICsgU3RyaW5nLmZyb21DaGFyQ29kZShlLmtleUNvZGUpOlN0cmluZy5mcm9tQ2hhckNvZGUoZS5rZXlDb2RlKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIHNjb3BlLiRhcHBseSgpOworICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgIGVsc2UgaWYoZS5rZXlDb2RlID09PSA5KQorICAgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgICAgICBzY29wZS5zaG93bGlzdCA9IGZhbHNlOworICAgICAgICAgICAgICAgICAgICAgICAgc2NvcGUudGl0bGUgPSAiIjsKKyAgICAgICAgICAgICAgICAgICAgICAgIHNjb3BlLiRhcHBseSgpOworICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfSk7CisgICAgICAgICAgICBzY29wZS5zZWxlY3RPcHRpb24gPSBmdW5jdGlvbihzVGl0bGUsc0luZGV4LGtlZXBPcGVuKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIGlmKHNJbmRleCA9PT0gLTEgfHwgc0luZGV4ID09PSAnLTEnKXsKKyAgICAgICAgICAgICAgICAgICBzY29wZS5zZWxDYXRlZ29yeSA9ICIiOworICAgICAgICAgICAgICAgICAgIHNjb3BlLnNlbGVjdGVkSW5kZXggPSAtMTsKKyAgICAgICAgICAgICAgICAgICBjdHJsLiRzZXRWaWV3VmFsdWUoIiIpOworICAgICAgICAgICAgICAgICAgIHNjb3BlLnNlbGVjdGVkT3B0aW9uID0gc2NvcGUuc2VsZWN0TXNnOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICBzY29wZS5zZWxDYXRlZ29yeSA9IHNjb3BlLmNOYW1lW3NJbmRleF07CisgICAgICAgICAgICAgICAgICAgIHNjb3BlLnNlbGVjdGVkSW5kZXggPSBzSW5kZXg7CisgICAgICAgICAgICAgICAgICAgIGN0cmwuJHNldFZpZXdWYWx1ZShzY29wZS5zZWxDYXRlZ29yeSk7CisgICAgICAgICAgICAgICAgICAgIHNjb3BlLnNlbGVjdGVkT3B0aW9uID0gc2NvcGUuc2VsQ2F0ZWdvcnkudGl0bGU7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIHNjb3BlLnRpdGxlID0gIiI7CisgICAgICAgICAgICAgICAgaWYoIWtlZXBPcGVuKQorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgc2NvcGUuc2hvd2xpc3QgPSBmYWxzZTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9OworICAgICAgICAgICAgaWYoYXR0ci5kaXNhYmxlZCkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgIHNjb3BlLmlzRGlzYWJsZWQgPSB0cnVlOworICAgICAgICAgICAgfQorICAgICAgICAgICAgc2NvcGUuc2VsZWN0Q3VycmVudCA9IGZ1bmN0aW9uKCkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBpZihzY29wZS5zaG93bGlzdCkKKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgIHNjb3BlLnNlbGVjdE9wdGlvbihzY29wZS5zZWxlY3RNc2csc2NvcGUuc2VsZWN0ZWRJbmRleCAsZmFsc2UpOworICAgICAgICAgICAgICAgICAgICBzY29wZS4kYXBwbHkoKTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgc2NvcGUuc2hvd2xpc3QgPSB0cnVlOworICAgICAgICAgICAgICAgICAgICBzY29wZS5zZXRTZWxlY3RUb3AoKTsKKyAgICAgICAgICAgICAgICAgICAgc2NvcGUuJGFwcGx5KCk7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfTsKKyAgICAgICAgICAgIHNjb3BlLmhvdmVySW4gPSBmdW5jdGlvbihjSXRlbSkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBzY29wZS5zZWxlY3RlZEluZGV4ID0gY0l0ZW07CisgICAgICAgICAgICB9OworICAgICAgICAgICAgc2NvcGUuc2V0U2VsZWN0VG9wID0gZnVuY3Rpb24oKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICR0aW1lb3V0KGZ1bmN0aW9uICgpCisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICBpZihzY29wZS5zaG93bGlzdCkKKyAgICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAgICAgdmFyIGNvbnRhaW5lclVMID0gYW5ndWxhci5lbGVtZW50KGVsZW1lbnQpWzBdLnF1ZXJ5U2VsZWN0b3IoIi5zZWxlY3QyLXJlc3VsdHMiKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIHZhciBzZWxlY3RlZEVsZW1Ub3BQb3MgPSBhbmd1bGFyLmVsZW1lbnQoY29udGFpbmVyVUwucXVlcnlTZWxlY3RvcignLnNlbGVjdDItcmVzdWx0LWN1cnJlbnQnKSlbMF0ub2Zmc2V0VG9wOworICAgICAgICAgICAgICAgICAgICAgICAgYW5ndWxhci5lbGVtZW50KGNvbnRhaW5lclVMKVswXS5zY3JvbGxUb3AgPSBzZWxlY3RlZEVsZW1Ub3BQb3M7CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICB9KTsKKyAgICAgICAgICAgIH07CisgICAgICAgICAgICBzY29wZS5zZXRDdXJyZW50VG9wID0gZnVuY3Rpb24oKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICR0aW1lb3V0KGZ1bmN0aW9uICgpCisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICBpZihzY29wZS5zaG93bGlzdCkKKyAgICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAgICAgdmFyIGNvbnRhaW5lclVMID0gYW5ndWxhci5lbGVtZW50KGVsZW1lbnQpWzBdLnF1ZXJ5U2VsZWN0b3IoIi5zZWxlY3QyLXJlc3VsdHMiKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIHZhciBzZWxlY3RlZEVsZW1Ub3BQb3MgPSBhbmd1bGFyLmVsZW1lbnQoY29udGFpbmVyVUwucXVlcnlTZWxlY3RvcignLmhvdnN0eWxlJykpWzBdLm9mZnNldFRvcDsKKyAgICAgICAgICAgICAgICAgICAgICAgIGlmKHNlbGVjdGVkRWxlbVRvcFBvcyA8IChhbmd1bGFyLmVsZW1lbnQoY29udGFpbmVyVUwpWzBdLnNjcm9sbFRvcCkgKQorICAgICAgICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGFuZ3VsYXIuZWxlbWVudChjb250YWluZXJVTClbMF0uc2Nyb2xsVG9wIC09IDMwOworICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgZWxzZSBpZigoc2VsZWN0ZWRFbGVtVG9wUG9zICsgMzApID4gKGFuZ3VsYXIuZWxlbWVudChjb250YWluZXJVTClbMF0uY2xpZW50SGVpZ2h0KSkKKyAgICAgICAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBhbmd1bGFyLmVsZW1lbnQoY29udGFpbmVyVUwpWzBdLnNjcm9sbFRvcCArPSAzMDsKKyAgICAgICAgICAgICAgICAgICAgICAgIH0KKworICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgfSk7CisgICAgICAgICAgICB9OworICAgICAgICAgICAgc2NvcGUuc2VsZWN0TmV4dCA9IGZ1bmN0aW9uKCkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBpZigoc2NvcGUuc2VsZWN0ZWRJbmRleCArIDEpIDw9IChzY29wZS5jTmFtZS5sZW5ndGgtMSkpCisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICBzY29wZS5zZWxlY3RlZEluZGV4ICs9IDE7CisgICAgICAgICAgICAgICAgICAgIGlmKCFzY29wZS5zaG93bGlzdCkKKyAgICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAgICAgc2NvcGUuc2VsZWN0T3B0aW9uKHNjb3BlLnNlbGVjdE1zZyxzY29wZS5zZWxlY3RlZEluZGV4ICxmYWxzZSk7CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgc2NvcGUuJGFwcGx5KCk7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIHNjb3BlLnNldEN1cnJlbnRUb3AoKTsKKyAgICAgICAgICAgIH07CisgICAgICAgICAgICBzY29wZS5zZWxlY3RQcmV2ID0gZnVuY3Rpb24oKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIGlmKChzY29wZS5zZWxlY3RlZEluZGV4IC0gMSkgPj0gMCkKKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgIHNjb3BlLnNlbGVjdGVkSW5kZXggLT0gMTsKKyAgICAgICAgICAgICAgICAgICAgaWYoIXNjb3BlLnNob3dsaXN0KQorICAgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgICAgICBzY29wZS5zZWxlY3RPcHRpb24oc2NvcGUuc2VsZWN0TXNnLHNjb3BlLnNlbGVjdGVkSW5kZXggLGZhbHNlKTsKKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICBzY29wZS4kYXBwbHkoKTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgZWxzZSBpZihzY29wZS5zZWxlY3RlZEluZGV4IC0xIDwgMCkKKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgIHNjb3BlLnNlbGVjdGVkSW5kZXggPSAtMTsKKyAgICAgICAgICAgICAgICAgICAgaWYoIXNjb3BlLnNob3dsaXN0KQorICAgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgICAgICBzY29wZS5zZWxlY3RPcHRpb24oc2NvcGUuc2VsZWN0TXNnLHNjb3BlLnNlbGVjdGVkSW5kZXggLGZhbHNlKTsKKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICBzY29wZS4kYXBwbHkoKTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgc2NvcGUuc2V0Q3VycmVudFRvcCgpOworCisgICAgICAgICAgICB9OworICAgICAgICAgICAgc2NvcGUudXBkYXRlU2VsZWN0aW9uID0gZnVuY3Rpb24oc0l0ZW0pCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgc2NvcGUuc2VsZWN0ZWRPcHRpb24gPSBzSXRlbS50aXRsZTsKKyAgICAgICAgICAgICAgICBzY29wZS50aXRsZSA9ICIiOworICAgICAgICAgICAgfTsKKyAgICAgICAgICAgIHNjb3BlLiR3YXRjaCgnc2VsQ2F0ZWdvcnknLGZ1bmN0aW9uKHZhbHVlKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIGlmKHZhbHVlKXsKKyAgICAgICAgICAgICAgICAgICAgc2NvcGUudXBkYXRlU2VsZWN0aW9uKHZhbHVlKTsKKyAgICAgICAgICAgICAgICB9OworICAgICAgICAgICAgfSk7CisgICAgICAgICAgICBjdHJsLiR2aWV3Q2hhbmdlTGlzdGVuZXJzLnB1c2goZnVuY3Rpb24oKXsKKyAgICAgICAgICAgICAgICBzY29wZS4kZXZhbChhdHRyLm5nQ2hhbmdlKTsKKyAgICAgICAgICAgIH0pOworICAgICAgICAgICAgY3RybC4kcmVuZGVyID0gZnVuY3Rpb24oKXsKKyAgICAgICAgICAgICAgICBzY29wZS5zZWxDYXRlZ29yeSA9IGN0cmwuJHZpZXdWYWx1ZTsKKyAgICAgICAgICAgIH07CisgICAgICAgICAgICB2YXIgb3V0c2lkZUNsaWNrID0gZnVuY3Rpb24oZSl7CisgICAgICAgICAgICAgICAgdmFyIGlzRWxlbWVudCA9ICRpc0VsZW1lbnQoYW5ndWxhci5lbGVtZW50KGUudGFyZ2V0KSwgZWxlbWVudCwgJGRvY3VtZW50KTsKKyAgICAgICAgICAgICAgICBpZighaXNFbGVtZW50KSB7CisgICAgICAgICAgICAgICAgICAgIHNjb3BlLnNob3dsaXN0ID0gZmFsc2U7CisgICAgICAgICAgICAgICAgICAgIHNjb3BlLiRhcHBseSgpOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH07CisgICAgICAgICAgICAkZG9jdW1lbnRCaW5kLmNsaWNrKCdzaG93bGlzdCcsIG91dHNpZGVDbGljaywgc2NvcGUpOworICAgICAgICB9CisgICAgfTsKK31dKTsKKworYW5ndWxhci5tb2R1bGUoJ2F0dC5hYnMuc2VsZWN0JywgWydhdHQuYWJzLnV0aWxpdGllcycsICdhdHQuYWJzLnBvc2l0aW9uJywgJ2F0dC5hYnMudXRpbGl0aWVzJ10pCisuZGlyZWN0aXZlKCdhdHRTZWxlY3QnLCBbIiRkb2N1bWVudCIsICIkZmlsdGVyIiwgIiRpc0VsZW1lbnQiLCAnJGRvY3VtZW50QmluZCcsICIkdGltZW91dCIsICJrZXltYXAiLCBmdW5jdGlvbigkZG9jdW1lbnQsJGZpbHRlciwkaXNFbGVtZW50LCRkb2N1bWVudEJpbmQsJHRpbWVvdXQsa2V5bWFwKXsKKyAgICByZXR1cm57CisgICAgICAgIHJlc3RyaWN0OiAnQScsCisgICAgICAgIHNjb3BlOntjTmFtZTogJz1hdHRTZWxlY3QnfSwKKyAgICAgICAgdHJhbnNjbHVkZTogZmFsc2UsCisgICAgICAgIHJlcGxhY2U6IGZhbHNlLAorICAgICAgICByZXF1aXJlOiduZ01vZGVsJywKKyAgICAgICAgdGVtcGxhdGVVcmw6ICdhcHAvc2NyaXB0cy9uZ19qc19hdHRfdHBscy9zZWxlY3Qvc2VsZWN0Lmh0bWwnLAorICAgICAgICBsaW5rOiBmdW5jdGlvbihzY29wZSwgZWxlbWVudCwgYXR0ciwgY3RybCkgeworICAgICAgICAgICAgc2NvcGUuc2VsZWN0ZWRJbmRleCA9IC0xOworICAgICAgICAgICAgc2NvcGUuc2VsZWN0ZWRPcHRpb24gPSBhdHRyLnBsYWNlaG9sZGVyOworICAgICAgICAgICAgc2NvcGUuaXNEaXNhYmxlZCA9IGZhbHNlOworICAgICAgICAgICAgc2NvcGUuY2xhc3NOYW1lID0gInNlbGVjdDItbWF0Y2giOworICAgICAgICAgICAgc2NvcGUuc2hvd1NlYXJjaCA9IGZhbHNlOworICAgICAgICAgICAgc2NvcGUuc2hvd2xpc3QgPSBmYWxzZTsKKyAgICAgICAgICAgIGlmKGF0dHIucGxhY2Vob2xkZXJBc09wdGlvbiA9PT0gImZhbHNlIikKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBzY29wZS5zZWxlY3RNc2cgPSAiIjsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBzY29wZS5zZWxlY3RNc2cgPSBhdHRyLnBsYWNlaG9sZGVyOworICAgICAgICAgICAgfQorICAgICAgICAgICAgaWYgKGF0dHIuc3RhcnRzV2l0aEZpbHRlciA9PT0gInRydWUiIHx8IGF0dHIuc3RhcnRzV2l0aEZpbHRlcikgeworICAgICAgICAgICAgICAgIHNjb3BlLnN0YXJ0c1dpdGhGaWx0ZXIgPSB0cnVlOworICAgICAgICAgICAgfQorICAgICAgICAgICAgaWYoYXR0ci5zaG93SW5wdXRGaWx0ZXIgPT09ICJ0cnVlIil7CisgICAgICAgICAgICAgICAgc2NvcGUuc2hvd1NlYXJjaCA9IHRydWU7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBzY29wZS5zaG93RHJvcGRvd24gPSBmdW5jdGlvbigpeworICAgICAgICAgICAgICAgIGlmKCEoYXR0ci5kaXNhYmxlZCkpeworICAgICAgICAgICAgICAgICAgICBzY29wZS5zaG93bGlzdCA9ICFzY29wZS5zaG93bGlzdDsKKyAgICAgICAgICAgICAgICAgICAgc2NvcGUuc2V0U2VsZWN0VG9wKCk7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfTsKKyAgICAgICAgICAgIGVsZW1lbnQuYmluZCgia2V5ZG93biIsIGZ1bmN0aW9uKGUpeworICAgICAgICAgICAgICAgIGlmIChrZXltYXAuaXNBbGxvd2VkS2V5KGUua2V5Q29kZSkgfHwga2V5bWFwLmlzQ29udHJvbChlKSB8fCBrZXltYXAuaXNGdW5jdGlvbktleShlKSkKKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgIGUucHJldmVudERlZmF1bHQoKTsKKyAgICAgICAgICAgICAgICAgICAgZS5zdG9wUHJvcGFnYXRpb24oKTsKKworICAgICAgICAgICAgICAgICAgICBzd2l0Y2ggKGUua2V5Q29kZSkgeworICAgICAgICAgICAgICAgICAgICAgICAgY2FzZSBrZXltYXAuS0VZLkRPV046CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2NvcGUuc2VsZWN0TmV4dCgpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgICAgICAgICAgY2FzZSBrZXltYXAuS0VZLlVQOgorICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNjb3BlLnNlbGVjdFByZXYoKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICAgICAgICAgIGNhc2Uga2V5bWFwLktFWS5FTlRFUjoKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBzY29wZS5zZWxlY3RDdXJyZW50KCk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgICAgICAgICBjYXNlIGtleW1hcC5LRVkuQkFDS1NQQUNFOgorICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNjb3BlLnRpdGxlID0gIiI7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2NvcGUuJGFwcGx5KCk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgICAgICAgICBjYXNlIGtleW1hcC5LRVkuU1BBQ0U6CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2NvcGUudGl0bGUgKz0gIiAiOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNjb3BlLiRhcHBseSgpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgICAgICAgICAgY2FzZSBrZXltYXAuS0VZLkVTQzoKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZihzY29wZS50aXRsZSA9PT0gIiIpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzY29wZS5zaG93bGlzdCA9IGZhbHNlOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzY29wZS4kYXBwbHkoKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2NvcGUudGl0bGUgPSAiIjsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2NvcGUuJGFwcGx5KCk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgICAgICAgICAgZGVmYXVsdDo7CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgaWYodHlwZW9mIHNjb3BlLnNob3dTZWFyY2ggPT09ICdib29sZWFuJyAmJiAhc2NvcGUuc2hvd1NlYXJjaCAmJiBlLmtleUNvZGUgIT09IDkpCisgICAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIHNjb3BlLnNob3dsaXN0ID0gdHJ1ZTsKKyAgICAgICAgICAgICAgICAgICAgICAgIHNjb3BlLnRpdGxlID0gc2NvcGUudGl0bGUgPyBzY29wZS50aXRsZSArIFN0cmluZy5mcm9tQ2hhckNvZGUoZS5rZXlDb2RlKTpTdHJpbmcuZnJvbUNoYXJDb2RlKGUua2V5Q29kZSk7CisgICAgICAgICAgICAgICAgICAgICAgICBzY29wZS4kYXBwbHkoKTsKKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICBlbHNlIGlmKGUua2V5Q29kZSA9PT0gOSkKKyAgICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAgICAgc2NvcGUuc2hvd2xpc3QgPSBmYWxzZTsKKyAgICAgICAgICAgICAgICAgICAgICAgIHNjb3BlLnRpdGxlID0gIiI7CisgICAgICAgICAgICAgICAgICAgICAgICBzY29wZS4kYXBwbHkoKTsKKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0pOyAgICAgICAgICAgIAorICAgICAgICAgICAgc2NvcGUuc2VsZWN0T3B0aW9uID0gZnVuY3Rpb24oc1RpdGxlLHNJbmRleCxrZWVwT3BlbikKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBpZihzSW5kZXggPT09IC0xIHx8IHNJbmRleCA9PT0gJy0xJyl7CisgICAgICAgICAgICAgICAgICAgc2NvcGUuc2VsQ2F0ZWdvcnkgPSAiIjsKKyAgICAgICAgICAgICAgICAgICBzY29wZS5zZWxlY3RlZEluZGV4ID0gLTE7CisgICAgICAgICAgICAgICAgICAgY3RybC4kc2V0Vmlld1ZhbHVlKCIiKTsKKyAgICAgICAgICAgICAgICAgICBzY29wZS5zZWxlY3RlZE9wdGlvbiA9IHNjb3BlLnNlbGVjdE1zZzsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgc2NvcGUuc2VsQ2F0ZWdvcnkgPSBzY29wZS5jTmFtZVtzSW5kZXhdOworICAgICAgICAgICAgICAgICAgICBzY29wZS5zZWxlY3RlZEluZGV4ID0gc0luZGV4OworICAgICAgICAgICAgICAgICAgICBjdHJsLiRzZXRWaWV3VmFsdWUoc2NvcGUuc2VsQ2F0ZWdvcnkpOworICAgICAgICAgICAgICAgICAgICBzY29wZS5zZWxlY3RlZE9wdGlvbiA9IHNjb3BlLnNlbENhdGVnb3J5LnRpdGxlOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICBzY29wZS50aXRsZSA9ICIiOworICAgICAgICAgICAgICAgIGlmKCFrZWVwT3BlbikKKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgIHNjb3BlLnNob3dsaXN0ID0gZmFsc2U7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfTsKKyAgICAgICAgICAgIGlmKGF0dHIuZGlzYWJsZWQpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICBzY29wZS5pc0Rpc2FibGVkID0gdHJ1ZTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIHNjb3BlLnNlbGVjdEN1cnJlbnQgPSBmdW5jdGlvbigpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgaWYoc2NvcGUuc2hvd2xpc3QpCisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICBzY29wZS5zZWxlY3RPcHRpb24oc2NvcGUuc2VsZWN0TXNnLHNjb3BlLnNlbGVjdGVkSW5kZXggLGZhbHNlKTsKKyAgICAgICAgICAgICAgICAgICAgc2NvcGUuJGFwcGx5KCk7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgIHNjb3BlLnNob3dsaXN0ID0gdHJ1ZTsKKyAgICAgICAgICAgICAgICAgICAgc2NvcGUuc2V0U2VsZWN0VG9wKCk7CisgICAgICAgICAgICAgICAgICAgIHNjb3BlLiRhcHBseSgpOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH07CisgICAgICAgICAgICBzY29wZS5ob3ZlckluID0gZnVuY3Rpb24oY0l0ZW0pCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgc2NvcGUuc2VsZWN0ZWRJbmRleCA9IGNJdGVtOworICAgICAgICAgICAgfTsKKyAgICAgICAgICAgIHNjb3BlLnNldFNlbGVjdFRvcCA9IGZ1bmN0aW9uKCkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAkdGltZW91dChmdW5jdGlvbiAoKQorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgaWYoc2NvcGUuc2hvd2xpc3QpCisgICAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIHZhciBjb250YWluZXJVTCA9IGFuZ3VsYXIuZWxlbWVudChlbGVtZW50KVswXS5xdWVyeVNlbGVjdG9yKCIuc2VsZWN0Mi1yZXN1bHRzIik7CisgICAgICAgICAgICAgICAgICAgICAgICB2YXIgc2VsZWN0ZWRFbGVtVG9wUG9zID0gYW5ndWxhci5lbGVtZW50KGNvbnRhaW5lclVMLnF1ZXJ5U2VsZWN0b3IoJy5zZWxlY3QyLXJlc3VsdC1jdXJyZW50JykpWzBdLm9mZnNldFRvcDsKKyAgICAgICAgICAgICAgICAgICAgICAgIGFuZ3VsYXIuZWxlbWVudChjb250YWluZXJVTClbMF0uc2Nyb2xsVG9wID0gc2VsZWN0ZWRFbGVtVG9wUG9zOworICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgfSk7CisgICAgICAgICAgICB9OworICAgICAgICAgICAgc2NvcGUuc2V0Q3VycmVudFRvcCA9IGZ1bmN0aW9uKCkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAkdGltZW91dChmdW5jdGlvbiAoKQorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgaWYoc2NvcGUuc2hvd2xpc3QpCisgICAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIHZhciBjb250YWluZXJVTCA9IGFuZ3VsYXIuZWxlbWVudChlbGVtZW50KVswXS5xdWVyeVNlbGVjdG9yKCIuc2VsZWN0Mi1yZXN1bHRzIik7CisgICAgICAgICAgICAgICAgICAgICAgICB2YXIgc2VsZWN0ZWRFbGVtVG9wUG9zID0gYW5ndWxhci5lbGVtZW50KGNvbnRhaW5lclVMLnF1ZXJ5U2VsZWN0b3IoJy5ob3ZzdHlsZScpKVswXS5vZmZzZXRUb3A7CisgICAgICAgICAgICAgICAgICAgICAgICBpZihzZWxlY3RlZEVsZW1Ub3BQb3MgPCAoYW5ndWxhci5lbGVtZW50KGNvbnRhaW5lclVMKVswXS5zY3JvbGxUb3ApICkKKyAgICAgICAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBhbmd1bGFyLmVsZW1lbnQoY29udGFpbmVyVUwpWzBdLnNjcm9sbFRvcCAtPSAzMDsKKyAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgIGVsc2UgaWYoKHNlbGVjdGVkRWxlbVRvcFBvcyArIDMwKSA+IChhbmd1bGFyLmVsZW1lbnQoY29udGFpbmVyVUwpWzBdLmNsaWVudEhlaWdodCkpCisgICAgICAgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgYW5ndWxhci5lbGVtZW50KGNvbnRhaW5lclVMKVswXS5zY3JvbGxUb3AgKz0gMzA7CisgICAgICAgICAgICAgICAgICAgICAgICB9CisKKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIH0pOworICAgICAgICAgICAgfTsKKyAgICAgICAgICAgIHNjb3BlLnNlbGVjdE5leHQgPSBmdW5jdGlvbigpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgaWYoKHNjb3BlLnNlbGVjdGVkSW5kZXggKyAxKSA8PSAoc2NvcGUuY05hbWUubGVuZ3RoLTEpKQorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgc2NvcGUuc2VsZWN0ZWRJbmRleCArPSAxOworICAgICAgICAgICAgICAgICAgICBpZighc2NvcGUuc2hvd2xpc3QpCisgICAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIHNjb3BlLnNlbGVjdE9wdGlvbihzY29wZS5zZWxlY3RNc2csc2NvcGUuc2VsZWN0ZWRJbmRleCAsZmFsc2UpOworICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgIHNjb3BlLiRhcHBseSgpOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICBzY29wZS5zZXRDdXJyZW50VG9wKCk7CisgICAgICAgICAgICB9OworICAgICAgICAgICAgc2NvcGUuc2VsZWN0UHJldiA9IGZ1bmN0aW9uKCkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBpZigoc2NvcGUuc2VsZWN0ZWRJbmRleCAtIDEpID49IDApCisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICBzY29wZS5zZWxlY3RlZEluZGV4IC09IDE7CisgICAgICAgICAgICAgICAgICAgIGlmKCFzY29wZS5zaG93bGlzdCkKKyAgICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAgICAgc2NvcGUuc2VsZWN0T3B0aW9uKHNjb3BlLnNlbGVjdE1zZyxzY29wZS5zZWxlY3RlZEluZGV4ICxmYWxzZSk7CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgc2NvcGUuJGFwcGx5KCk7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIGVsc2UgaWYoc2NvcGUuc2VsZWN0ZWRJbmRleCAtMSA8IDApCisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICBzY29wZS5zZWxlY3RlZEluZGV4ID0gLTE7CisgICAgICAgICAgICAgICAgICAgIGlmKCFzY29wZS5zaG93bGlzdCkKKyAgICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAgICAgc2NvcGUuc2VsZWN0T3B0aW9uKHNjb3BlLnNlbGVjdE1zZyxzY29wZS5zZWxlY3RlZEluZGV4ICxmYWxzZSk7CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgc2NvcGUuJGFwcGx5KCk7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIHNjb3BlLnNldEN1cnJlbnRUb3AoKTsKKworICAgICAgICAgICAgfTsKKyAgICAgICAgICAgIHNjb3BlLnVwZGF0ZVNlbGVjdGlvbiA9IGZ1bmN0aW9uKHNJdGVtKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIHNjb3BlLnNlbGVjdGVkT3B0aW9uID0gc0l0ZW0udGl0bGU7CisgICAgICAgICAgICAgICAgc2NvcGUudGl0bGUgPSAiIjsKKyAgICAgICAgICAgIH07CisKKyAgICAgICAgICAgIHNjb3BlLiR3YXRjaCgnc2VsQ2F0ZWdvcnknLGZ1bmN0aW9uKHZhbHVlKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIGlmKHZhbHVlKXsKKyAgICAgICAgICAgICAgICAgICAgc2NvcGUudXBkYXRlU2VsZWN0aW9uKHZhbHVlKTsKKyAgICAgICAgICAgICAgICB9OworICAgICAgICAgICAgfSk7CisgICAgICAgICAgICBjdHJsLiR2aWV3Q2hhbmdlTGlzdGVuZXJzLnB1c2goZnVuY3Rpb24oKXsKKyAgICAgICAgICAgICAgICBzY29wZS4kZXZhbChhdHRyLm5nQ2hhbmdlKTsKKyAgICAgICAgICAgIH0pOworICAgICAgICAgICAgY3RybC4kcmVuZGVyID0gZnVuY3Rpb24oKXsKKyAgICAgICAgICAgICAgICBzY29wZS5zZWxDYXRlZ29yeSA9IGN0cmwuJHZpZXdWYWx1ZTsKKyAgICAgICAgICAgIH07CisgICAgICAgICAgICB2YXIgb3V0c2lkZUNsaWNrID0gZnVuY3Rpb24oZSl7CisgICAgICAgICAgICAgICAgdmFyIGlzRWxlbWVudCA9ICRpc0VsZW1lbnQoYW5ndWxhci5lbGVtZW50KGUudGFyZ2V0KSwgZWxlbWVudCwgJGRvY3VtZW50KTsKKyAgICAgICAgICAgICAgICBpZighaXNFbGVtZW50KSB7CisgICAgICAgICAgICAgICAgICAgIHNjb3BlLnNob3dsaXN0ID0gZmFsc2U7CisgICAgICAgICAgICAgICAgICAgIHNjb3BlLiRhcHBseSgpOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH07CisgICAgICAgICAgICAkZG9jdW1lbnRCaW5kLmNsaWNrKCdzaG93bGlzdCcsIG91dHNpZGVDbGljaywgc2NvcGUpOworICAgICAgICB9CisgICAgfTsKK31dKQorCisuZGlyZWN0aXZlKCd0ZXh0RHJvcGRvd24nLCBbJyRkb2N1bWVudCcsICckaXNFbGVtZW50JywgJyRkb2N1bWVudEJpbmQnLCAia2V5bWFwIiwgZnVuY3Rpb24oJGRvY3VtZW50LCRpc0VsZW1lbnQsJGRvY3VtZW50QmluZCxrZXltYXApIHsKKyAgICByZXR1cm4geworICAgICAgICByZXN0cmljdDogJ0VBJywKKyAgICAgICAgcmVwbGFjZTogdHJ1ZSwKKyAgICAgICAgc2NvcGU6IHsKKyAgICAgICAgICAgIGFjdGlvbnM6ICc9YWN0aW9ucycsCisgICAgICAgICAgICBkZWZhdWx0QWN0aW9uOiAnPWRlZmF1bHRBY3Rpb24nLAorICAgICAgICAgICAgb25BY3Rpb25DbGlja2VkOiAnPT8nCisgICAgICAgIH0sCisgICAgICAgIHRlbXBsYXRlVXJsIDogJ2FwcC9zY3JpcHRzL25nX2pzX2F0dF90cGxzL3NlbGVjdC90ZXh0RHJvcGRvd24uaHRtbCcsCisKKyAgICAgICAgbGluazogZnVuY3Rpb24oc2NvcGUsIGVsZW1lbnQsIGF0dHIpIHsKKyAgICAgICAgICAgIHNjb3BlLnNlbGVjdGVkSW5kZXggPSAwOworICAgICAgICAgICAgc2NvcGUuc2VsZWN0ZWRPcHRpb24gPSBhdHRyLnBsYWNlaG9sZGVyOworICAgICAgICAgICAgc2NvcGUuaXNEaXNhYmxlZCA9IGZhbHNlOworICAgICAgICAgICAgc2NvcGUuaXNBY3Rpb25zU2hvd24gPSBmYWxzZTsKKworICAgICAgICAgICAgaWYodHlwZW9mIHNjb3BlLmRlZmF1bHRBY3Rpb24gPT09ICd1bmRlZmluZWQnKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIHNjb3BlLmN1cnJlbnRBY3Rpb24gPSBzY29wZS5hY3Rpb25zWzBdOworICAgICAgICAgICAgICAgIHNjb3BlLnNlbGVjdGVkSW5kZXggPSAwOworICAgICAgICAgICAgfSBlbHNlIGlmICh0eXBlb2Ygc2NvcGUuZGVmYXVsdEFjdGlvbiAhPT0gJ3VuZGVmaW5lZCcgfHwgc2NvcGUuZGVmYXVsdEFjdGlvbiAhPT0gJycpIHsKKyAgICAgICAgICAgICAgICBmb3IgKHZhciBhY3QgaW4gc2NvcGUuYWN0aW9ucykKKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgIGlmIChzY29wZS5hY3Rpb25zW2FjdF0gPT09IHNjb3BlLmRlZmF1bHRBY3Rpb24pCisgICAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIHNjb3BlLmN1cnJlbnRBY3Rpb24gPSBzY29wZS5hY3Rpb25zW2FjdF07CisgICAgICAgICAgICAgICAgICAgICAgICBzY29wZS5zZWxlY3RlZEluZGV4ID0gc2NvcGUuYWN0aW9ucy5pbmRleE9mKGFjdCk7CisgICAgICAgICAgICAgICAgICAgICAgICBzY29wZS5pc0FjdGlvbnNTaG93biA9IGZhbHNlOworCisgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgfQorCisgICAgICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgICAgIHNjb3BlLmN1cnJlbnRBY3Rpb24gPSBzY29wZS5hY3Rpb25zWzBdOworICAgICAgICAgICAgfQorCisgICAgICAgICAgICBzY29wZS50b2dnbGUgPSBmdW5jdGlvbigpIHsKKyAgICAgICAgICAgICAgICBzY29wZS5pc0FjdGlvbnNTaG93biA9ICFzY29wZS5pc0FjdGlvbnNTaG93bjsKKyAgICAgICAgICAgIH07CisKKyAgICAgICAgICAgIHNjb3BlLmNob29zZUFjdGlvbiA9IGZ1bmN0aW9uKCRldmVudCwgYWN0aW9uKXsKKworICAgICAgICAgICAgICAgIGlmICgkZXZlbnQgIT0gbnVsbCkgeworICAgICAgICAgICAgICAgICAgICBzY29wZS5jdXJyZW50QWN0aW9uID0gYWN0aW9uOworICAgICAgICAgICAgICAgICAgICBzY29wZS5zZWxlY3RlZEluZGV4ID0gc2NvcGUuYWN0aW9ucy5pbmRleE9mKGFjdGlvbik7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIGVsc2UgeworICAgICAgICAgICAgICAgICAgICBzY29wZS5jdXJyZW50QWN0aW9uID0gc2NvcGUuYWN0aW9uc1tzY29wZS5zZWxlY3RlZEluZGV4XTsKKyAgICAgICAgICAgICAgICB9CisKKyAgICAgICAgICAgICAgICBpZiAoYW5ndWxhci5pc0Z1bmN0aW9uKHNjb3BlLm9uQWN0aW9uQ2xpY2tlZCkpCisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICBzY29wZS5vbkFjdGlvbkNsaWNrZWQoc2NvcGUuY3VycmVudEFjdGlvbik7CisgICAgICAgICAgICAgICAgfQorCisgICAgICAgICAgICAgICAgc2NvcGUudG9nZ2xlKCk7CisgICAgICAgICAgICB9OworCisgICAgICAgICAgICBzY29wZS5pc0N1cnJlbnRBY3Rpb24gPSBmdW5jdGlvbihhY3Rpb24pIHsKKyAgICAgICAgICAgICAgICByZXR1cm4gKGFjdGlvbiA9PT0gc2NvcGUuY3VycmVudEFjdGlvbik7CisgICAgICAgICAgICB9OworCisgICAgICAgICAgICAvLyBjYXRvCisgICAgICAgICAgICBlbGVtZW50LmJpbmQoImtleWRvd24iLCBmdW5jdGlvbihlKXsKKyAgICAgICAgICAgICAgICBpZiAoa2V5bWFwLmlzQWxsb3dlZEtleShlLmtleUNvZGUpIHx8IGtleW1hcC5pc0NvbnRyb2woZSkgfHwga2V5bWFwLmlzRnVuY3Rpb25LZXkoZSkpCisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICBlLnByZXZlbnREZWZhdWx0KCk7CisgICAgICAgICAgICAgICAgICAgIGUuc3RvcFByb3BhZ2F0aW9uKCk7CisgICAgICAgICAgICAgICAgICAgIHN3aXRjaCAoZS5rZXlDb2RlKSB7CisgICAgICAgICAgICAgICAgICAgICAgICBjYXNlIGtleW1hcC5LRVkuRE9XTjoKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBzY29wZS5zZWxlY3ROZXh0KCk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgICAgICAgICBjYXNlIGtleW1hcC5LRVkuVVA6CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2NvcGUuc2VsZWN0UHJldigpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgICAgICAgICAgY2FzZSBrZXltYXAuS0VZLkVOVEVSOgorICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNjb3BlLnNlbGVjdEN1cnJlbnQoKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICAgICAgICAgIGNhc2Uga2V5bWFwLktFWS5FU0M6CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2NvcGUuaXNBY3Rpb25zU2hvd24gPSBmYWxzZTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBzY29wZS4kYXBwbHkoKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICAgICAgICAgIGRlZmF1bHQ6OworICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgIHNjb3BlLiRhcHBseSgpOworICAgICAgICAgICAgICAgICAgICByZXR1cm47CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfSk7CisKKyAgICAgICAgICAgIGlmKGF0dHIuZGlzYWJsZWQpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICBzY29wZS5pc0Rpc2FibGVkID0gdHJ1ZTsKKyAgICAgICAgICAgIH0KKworCisgICAgICAgICAgICBzY29wZS5zZWxlY3RDdXJyZW50ID0gZnVuY3Rpb24oKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIGlmIChzY29wZS5zZWxlY3RlZEluZGV4IDwgMCkKKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgIHNjb3BlLnNlbGVjdGVkSW5kZXggPSAwOworICAgICAgICAgICAgICAgIH0KKworCisgICAgICAgICAgICAgICAgaWYoIXNjb3BlLmlzQWN0aW9uc1Nob3duKSB7CisgICAgICAgICAgICAgICAgICAgIHNjb3BlLnRvZ2dsZSgpOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICBlbHNlIHsKKyAgICAgICAgICAgICAgICAgICAgc2NvcGUuY2hvb3NlQWN0aW9uKG51bGwsIHNjb3BlLmN1cnJlbnRBY3Rpb24pOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH07CisKKyAgICAgICAgICAgIHNjb3BlLnNlbGVjdE5leHQgPSBmdW5jdGlvbigpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgaWYoc2NvcGUuaXNBY3Rpb25zU2hvd24pCisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICBpZigoc2NvcGUuc2VsZWN0ZWRJbmRleCArIDEpIDwgc2NvcGUuYWN0aW9ucy5sZW5ndGgpCisgICAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIHNjb3BlLnNlbGVjdGVkSW5kZXggKz0gMTsKKyAgICAgICAgICAgICAgICAgICAgICAgIHNjb3BlLiRhcHBseSgpOworCisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgZWxzZXsKKyAgICAgICAgICAgICAgICAgICAgICAgIHNjb3BlLnNlbGVjdGVkSW5kZXggPSAoc2NvcGUuYWN0aW9ucy5sZW5ndGggLSAxKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIHNjb3BlLiRhcHBseSgpOworCisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9OworCisgICAgICAgICAgICBzY29wZS5zZWxlY3RQcmV2ID0gZnVuY3Rpb24oKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIGlmKHNjb3BlLmlzQWN0aW9uc1Nob3duKQorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgaWYoKHNjb3BlLnNlbGVjdGVkSW5kZXggLSAxKSA+PSAwKQorICAgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgICAgICBzY29wZS5zZWxlY3RlZEluZGV4IC09IDE7CisgICAgICAgICAgICAgICAgICAgICAgICBzY29wZS4kYXBwbHkoKTsKKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICBlbHNlIGlmKHNjb3BlLnNlbGVjdGVkSW5kZXggLSAxIDwgMCkKKyAgICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAgICAgc2NvcGUuc2VsZWN0ZWRJbmRleCA9IDA7CisgICAgICAgICAgICAgICAgICAgICAgICBzY29wZS4kYXBwbHkoKTsKKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH07CisKKyAgICAgICAgICAgIHNjb3BlLmhvdmVySW4gPSBmdW5jdGlvbihjSXRlbSkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBzY29wZS5zZWxlY3RlZEluZGV4ID0gY0l0ZW07CisgICAgICAgICAgICB9OworCisKKyAgICAgICAgICAgIC8vZW5kIGNhdG8KKworICAgICAgICAgICAgdmFyIG91dHNpZGVDbGljayA9IGZ1bmN0aW9uKGUpIHsKKyAgICAgICAgICAgICAgICB2YXIgaXNFbGVtZW50ID0gJGlzRWxlbWVudChhbmd1bGFyLmVsZW1lbnQoZS50YXJnZXQpLCBlbGVtZW50LCAkZG9jdW1lbnQpOworCisgICAgICAgICAgICAgICAgaWYoIWlzRWxlbWVudCkgeworICAgICAgICAgICAgICAgICAgICBzY29wZS50b2dnbGUoKTsKKyAgICAgICAgICAgICAgICAgICAgc2NvcGUuJGFwcGx5KCk7CisgICAgICAgICAgICAgICAgfQorCisgICAgICAgICAgICB9OworCisgICAgICAgICAgICAkZG9jdW1lbnRCaW5kLmNsaWNrKCdpc0FjdGlvbnNTaG93bicsIG91dHNpZGVDbGljaywgc2NvcGUpOworCisgICAgICAgIH0KKyAgICB9OworfV0pOworCithbmd1bGFyLm1vZHVsZSgnYXR0LmFicy5zbGlkZXInLCBbJ2F0dC5hYnMucG9zaXRpb24nXSkKKyAgICAgICAgLmNvbnN0YW50KCdzbGlkZXJEZWZhdWx0T3B0aW9ucycsIHsKKyAgICAgICAgICAgIHdpZHRoOiAzMDAsCisgICAgICAgICAgICBzdGVwOiAxLAorICAgICAgICAgICAgcHJlY2lzaW9uOiAwLAorICAgICAgICAgICAgZGlzYWJsZWRXaWR0aDogMTE2CisgICAgICAgIH0pCisgICAgICAgIC5kaXJlY3RpdmUoJ2F0dFNsaWRlcicsIFsnc2xpZGVyRGVmYXVsdE9wdGlvbnMnLCckcG9zaXRpb24nLCBmdW5jdGlvbihzbGlkZXJEZWZhdWx0T3B0aW9ucywkcG9zaXRpb24pCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgcmV0dXJuIHsKKyAgICAgICAgICAgICAgICAgICAgcmVzdHJpY3Q6ICdFQScsCisgICAgICAgICAgICAgICAgICAgIHJlcGxhY2U6IHRydWUsCisgICAgICAgICAgICAgICAgICAgIHRyYW5zY2x1ZGU6IHRydWUsCisgICAgICAgICAgICAgICAgICAgIHNjb3BlOiB7CisgICAgICAgICAgICAgICAgICAgICAgICBmbG9vcjogIj0iLAorICAgICAgICAgICAgICAgICAgICAgICAgY2VpbGluZzogIj0iLAorICAgICAgICAgICAgICAgICAgICAgICAgc3RlcDogIkAiLAorICAgICAgICAgICAgICAgICAgICAgICAgcHJlY2lzaW9uOiAiQCIsCisgICAgICAgICAgICAgICAgICAgICAgICB3aWR0aDogIkAiLAorICAgICAgICAgICAgICAgICAgICAgICAgdGV4dERpc3BsYXk6ICI9IiwKKyAgICAgICAgICAgICAgICAgICAgICAgIHZhbHVlOiAiPSIsCisgICAgICAgICAgICAgICAgICAgICAgICBuZ01vZGVsU2luZ2xlOiAnPT8nLAorICAgICAgICAgICAgICAgICAgICAgICAgbmdNb2RlbExvdzogJz0/JywKKyAgICAgICAgICAgICAgICAgICAgICAgIG5nTW9kZWxIaWdoOiAnPT8nLAorICAgICAgICAgICAgICAgICAgICAgICAgbmdNb2RlbERpc2FibGVkOiAnPT8nCisgICAgICAgICAgICAgICAgICAgIH0sCisgICAgICAgICAgICAgICAgICAgIHRlbXBsYXRlVXJsOiAnYXBwL3NjcmlwdHMvbmdfanNfYXR0X3RwbHMvc2xpZGVyL3NsaWRlci5odG1sJywKKyAgICAgICAgICAgICAgICAgICAgbGluazogZnVuY3Rpb24oc2NvcGUsIGVsZW0sIGF0dHIpCisgICAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIHZhciBtaW5PZmZzZXQsIG1heE9mZnNldCwgbmV3T2Zmc2V0LCBvZmZzZXRSYW5nZSwgdmFsdWVSYW5nZSwgc3RhcnRfeCA9IDAsIGRpc2FibGVkUmFuZ2UsIGRpc2FibGVkLCBldkZsYWcgPSBmYWxzZSwgbWluVmFsdWUsIG1heFZhbHVlLCByYW5nZSwgcmVmTG93LCByZWZIaWdoLCBtYXhQdHIsIG1pblB0ciwgc2luZ2xlUHRyLCBnZXRIYW5kbGVzOworICAgICAgICAgICAgICAgICAgICAgICAgc2NvcGUubWluUHRyT2Zmc2V0ID0gMDsKKyAgICAgICAgICAgICAgICAgICAgICAgIHNjb3BlLm1heFB0ck9mZnNldCA9IDA7CisgICAgICAgICAgICAgICAgICAgICAgICB2YXIgZGlzYWJsZVdpZHRoID0gc2xpZGVyRGVmYXVsdE9wdGlvbnMuZGlzYWJsZWRXaWR0aDsKKyAgICAgICAgICAgICAgICAgICAgICAgIC8vR2V0IGhhbmRsZXMKKyAgICAgICAgICAgICAgICAgICAgICAgIHZhciBvYmogPSBlbGVtLmNoaWxkcmVuKCk7CisgICAgICAgICAgICAgICAgICAgICAgICBkaXNhYmxlZFJhbmdlID0gb2JqWzBdLmNoaWxkcmVuOworICAgICAgICAgICAgICAgICAgICAgICAgZGlzYWJsZWRSYW5nZSA9IGFuZ3VsYXIuZWxlbWVudChkaXNhYmxlZFJhbmdlWzBdKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIGdldEhhbmRsZXMgPSBvYmpbMV0uY2hpbGRyZW47CisgICAgICAgICAgICAgICAgICAgICAgICBzaW5nbGVQdHIgPSBhbmd1bGFyLmVsZW1lbnQoZ2V0SGFuZGxlc1swXSk7CisgICAgICAgICAgICAgICAgICAgICAgICBtaW5QdHIgPSBhbmd1bGFyLmVsZW1lbnQoZ2V0SGFuZGxlc1sxXSk7CisgICAgICAgICAgICAgICAgICAgICAgICBtYXhQdHIgPSBhbmd1bGFyLmVsZW1lbnQoZ2V0SGFuZGxlc1syXSk7CisgICAgICAgICAgICAgICAgICAgICAgICBkaXNhYmxlZCA9ICgoYXR0ci5uZ01vZGVsU2luZ2xlID09IG51bGwpICYmIChhdHRyLm5nTW9kZWxMb3cgPT0gbnVsbCkgJiYgKGF0dHIubmdNb2RlbEhpZ2ggPT0gbnVsbCkpICYmIChhdHRyLm5nTW9kZWxEaXNhYmxlZCAhPSBudWxsKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIHJhbmdlID0gKGF0dHIubmdNb2RlbFNpbmdsZSA9PSBudWxsKSAmJiAoKGF0dHIubmdNb2RlbExvdyAhPSBudWxsKSAmJiAoYXR0ci5uZ01vZGVsSGlnaCAhPSBudWxsKSk7CisgICAgICAgICAgICAgICAgICAgICAgICByZWZMb3cgPSAnbmdNb2RlbExvdyc7CisgICAgICAgICAgICAgICAgICAgICAgICByZWZIaWdoID0gJ25nTW9kZWxIaWdoJzsKKyAgICAgICAgICAgICAgICAgICAgICAgIGlmICghcmFuZ2UpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBtaW5QdHIucmVtb3ZlKCk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgbWF4UHRyLnJlbW92ZSgpOworICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgZWxzZSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2luZ2xlUHRyLnJlbW92ZSgpOworICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgaWYgKCFkaXNhYmxlZCkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRpc2FibGVkUmFuZ2UucmVtb3ZlKCk7CisgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICBlbHNlIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBzY29wZS5kaXNhYmxlZFN0eWxlID0ge3dpZHRoOiBkaXNhYmxlV2lkdGggKyAncHgnLCB6SW5kZXg6IDF9OworICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNjb3BlLmhhbmRsZVN0eWxlID0ge2xlZnQ6IGRpc2FibGVXaWR0aCArICdweCd9OworICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgbWluVmFsdWUgPSBwYXJzZUZsb2F0KHNjb3BlLmZsb29yKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIG1heFZhbHVlID0gcGFyc2VGbG9hdChzY29wZS5jZWlsaW5nKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIHZhbHVlUmFuZ2UgPSBtYXhWYWx1ZSAtIG1pblZhbHVlOworICAgICAgICAgICAgICAgICAgICAgICAgbWluT2Zmc2V0ID0gMDsKKyAgICAgICAgICAgICAgICAgICAgICAgIGlmIChhdHRyLndpZHRoICE9PSB1bmRlZmluZWQpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBtYXhPZmZzZXQgPSBhdHRyLndpZHRoOworICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgZWxzZSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGVsZW1bMF0uY2xpZW50V2lkdGggIT09IDApIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbWF4T2Zmc2V0ID0gZWxlbVswXS5jbGllbnRXaWR0aDsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgZWxzZSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1heE9mZnNldCA9IHNsaWRlckRlZmF1bHRPcHRpb25zLndpZHRoOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgIG9mZnNldFJhbmdlID0gbWF4T2Zmc2V0IC0gbWluT2Zmc2V0OworICAgICAgICAgICAgICAgICAgICAgICAgLy9LZXkgRG93biBFdmVudAorICAgICAgICAgICAgICAgICAgICAgICAgc2NvcGUua2V5RG93biA9IGZ1bmN0aW9uKGV2KXsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZihldi5rZXlDb2RlID09PSAzOSl7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YXIgZWxlbUxlZnQgPSAkcG9zaXRpb24ucG9zaXRpb24oZWxlbSkubGVmdDsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChuZXdPZmZzZXQpeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbmV3T2Zmc2V0ID0gc2xpZGVyRGVmYXVsdE9wdGlvbnMuc3RlcCArIG5ld09mZnNldDsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBlbHNle25ld09mZnNldCA9IHNsaWRlckRlZmF1bHRPcHRpb25zLnN0ZXAgKyBlbGVtTGVmdDt9CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgICAgIGVsc2UgaWYoZXYua2V5Q29kZSA9PT0gMzcpeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YXIgcHRyTGVmdCA9ICRwb3NpdGlvbi5wb3NpdGlvbihzaW5nbGVQdHIpLmxlZnQ7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmKG5ld09mZnNldCl7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChuZXdPZmZzZXQhPT0wKXsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG5ld09mZnNldCA9IG5ld09mZnNldCAtIHNsaWRlckRlZmF1bHRPcHRpb25zLnN0ZXAgOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZWxzZXsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG5ld09mZnNldCA9IHB0ckxlZnQgLSBzbGlkZXJEZWZhdWx0T3B0aW9ucy5zdGVwIDt9CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmKG5ld09mZnNldD49MCl7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNjb3BlLnB0ck9mZnNldChuZXdPZmZzZXQpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgIH07CisgICAgICAgICAgICAgICAgICAgICAgICAvL01vdXNlIERvd24gRXZlbnQKKyAgICAgICAgICAgICAgICAgICAgICAgIHNjb3BlLm1vdXNlRG93biA9IGZ1bmN0aW9uKGUsIHJlZikgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNjb3BlLnJlZiA9IHJlZjsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBldkZsYWcgPSB0cnVlOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICghcmFuZ2UpeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAobmV3T2Zmc2V0KQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzdGFydF94ID0gZS5jbGllbnRYIC0gbmV3T2Zmc2V0OworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGVsc2UgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc3RhcnRfeCA9IGUuY2xpZW50WDsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChzY29wZS5yZWYgPT09IHJlZkxvdykgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc3RhcnRfeCA9IGUuY2xpZW50WCAtIHNjb3BlLm1pblB0ck9mZnNldDsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBlbHNlIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHN0YXJ0X3ggPSBlLmNsaWVudFggLSBzY29wZS5tYXhQdHJPZmZzZXQ7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGRpc2FibGVkKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNjb3BlLnJlZj0gJ25nTW9kZWxEaXNhYmxlZCc7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNjb3BlLmRpc2FibGVkU3R5bGUgPSB7d2lkdGg6IGRpc2FibGVXaWR0aCArICdweCcsIHpJbmRleDogMX07CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgfTsKKyAgICAgICAgICAgICAgICAgICAgICAgIC8vIE1vdXNlIE1vdmUgRXZlbnQKKyAgICAgICAgICAgICAgICAgICAgICAgIHNjb3BlLm1vdmVFbGVtID0gZnVuY3Rpb24oZXYpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoZXZGbGFnKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhciBldmVudFg7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGV2ZW50WCA9IGV2LmNsaWVudFg7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG5ld09mZnNldCA9IGV2ZW50WCAtIHN0YXJ0X3g7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNjb3BlLnB0ck9mZnNldChuZXdPZmZzZXQpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgIH07CisgICAgICAgICAgICAgICAgICAgICAgICAvLyBNb3VzZSBVcCBFdmVudAorICAgICAgICAgICAgICAgICAgICAgICAgc2NvcGUubW91c2VVcCA9IGZ1bmN0aW9uKGV2KSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgZXZGbGFnID0gZmFsc2U7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgbWluUHRyLnJlbW92ZUNsYXNzKCdkcmFnZ2luZycpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1heFB0ci5yZW1vdmVDbGFzcygnZHJhZ2dpbmcnKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBzaW5nbGVQdHIucmVtb3ZlQ2xhc3MoJ2RyYWdnaW5nJyk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgJChkb2N1bWVudCkub2ZmKCdtb3VzZW1vdmUnKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIH07CisgICAgICAgICAgICAgICAgICAgICAgICAvL0Z1bmN0aW9uIHRvIGNhbGN1bGF0ZSB0aGUgY3VycmVudCBQb3NpdGlvblZhbHVlCisgICAgICAgICAgICAgICAgICAgICAgICBzY29wZS5jYWxTdGVwID0gZnVuY3Rpb24odmFsdWUsIHByZWNpc2lvbiwgc3RlcCwgZmxvb3IpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YXIgZGVjaW1hbHMsIHJlbWFpbmRlciwgcm91bmRlZFZhbHVlLCBzdGVwcGVkVmFsdWU7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGZsb29yID09PSBudWxsKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZsb29yID0gMDsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHN0ZXAgPT09IG51bGwpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc3RlcCA9IDEgLyBNYXRoLnBvdygxMCwgcHJlY2lzaW9uKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmVtYWluZGVyID0gKHZhbHVlIC0gZmxvb3IpICUgc3RlcDsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBzdGVwcGVkVmFsdWUgPSByZW1haW5kZXIgPiAoc3RlcCAvIDIpID8gdmFsdWUgKyBzdGVwIC0gcmVtYWluZGVyIDogdmFsdWUgLSByZW1haW5kZXI7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgZGVjaW1hbHMgPSBNYXRoLnBvdygxMCwgcHJlY2lzaW9uKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICByb3VuZGVkVmFsdWUgPSBzdGVwcGVkVmFsdWUgKiBkZWNpbWFscyAvIGRlY2ltYWxzOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiByb3VuZGVkVmFsdWUudG9GaXhlZChwcmVjaXNpb24pOworICAgICAgICAgICAgICAgICAgICAgICAgfTsKKyAgICAgICAgICAgICAgICAgICAgICAgIC8vRnVuY3Rpb24gdG8gY2FsY3VsYXRlIE9mZnNldCBQZXJjZW50CisgICAgICAgICAgICAgICAgICAgICAgICBzY29wZS5wZXJjZW50T2Zmc2V0ID0gZnVuY3Rpb24ob2Zmc2V0KSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuICgob2Zmc2V0IC0gbWluT2Zmc2V0KSAvIG9mZnNldFJhbmdlKSAqIDEwMDsKKyAgICAgICAgICAgICAgICAgICAgICAgIH07CisgICAgICAgICAgICAgICAgICAgICAgICAvL0Z1bmN0aW9uIHRvIGNhbGN1bGF0ZSBPZmZzZXQgcG9zaXRpb24KKyAgICAgICAgICAgICAgICAgICAgICAgIHNjb3BlLnB0ck9mZnNldCA9IGZ1bmN0aW9uKG5ld09mZnNldCl7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFyIG5ld1BlcmNlbnQsIG5ld1ZhbHVlOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBuZXdPZmZzZXQgPSBNYXRoLm1heChNYXRoLm1pbihuZXdPZmZzZXQsIG1heE9mZnNldCksIG1pbk9mZnNldCk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG5ld1BlcmNlbnQgPSBzY29wZS5wZXJjZW50T2Zmc2V0KG5ld09mZnNldCk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG5ld1ZhbHVlID0gbWluVmFsdWUgKyAodmFsdWVSYW5nZSAqIG5ld1BlcmNlbnQgLyAxMDAuMCk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChyYW5nZSkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFyIHJhbmdlU2xpZGVyV2lkdGg7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoc2NvcGUucmVmID09PSByZWZMb3cpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzY29wZS5taW5IYW5kbGVTdHlsZSA9IHtsZWZ0OiBuZXdPZmZzZXQgKyAicHgifTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzY29wZS5taW5OZXdWYWwgPSBuZXdWYWx1ZTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzY29wZS5taW5QdHJPZmZzZXQgPSBuZXdPZmZzZXQ7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbWluUHRyLmFkZENsYXNzKCdkcmFnZ2luZycpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChuZXdWYWx1ZSA+IHNjb3BlLm1heE5ld1ZhbCkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzY29wZS5yZWYgPSByZWZIaWdoOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzY29wZS5tYXhOZXdWYWwgPSBuZXdWYWx1ZTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2NvcGUubWF4UHRyT2Zmc2V0ID0gbmV3T2Zmc2V0OworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBtYXhQdHIuYWRkQ2xhc3MoJ2RyYWdnaW5nJyk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1pblB0ci5yZW1vdmVDbGFzcygnZHJhZ2dpbmcnKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2NvcGUubWF4SGFuZGxlU3R5bGUgPSB7bGVmdDogbmV3T2Zmc2V0ICsgInB4In07CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZWxzZSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2NvcGUubWF4SGFuZGxlU3R5bGUgPSB7bGVmdDogbmV3T2Zmc2V0ICsgInB4In07CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2NvcGUubWF4TmV3VmFsID0gbmV3VmFsdWU7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2NvcGUubWF4UHRyT2Zmc2V0ID0gbmV3T2Zmc2V0OworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1heFB0ci5hZGRDbGFzcygnZHJhZ2dpbmcnKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAobmV3VmFsdWUgPCBzY29wZS5taW5OZXdWYWwpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2NvcGUucmVmID0gcmVmTG93OworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzY29wZS5taW5WYWwgPSBuZXdWYWx1ZTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2NvcGUubWluUHRyT2Zmc2V0ID0gbmV3T2Zmc2V0OworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBtaW5QdHIuYWRkQ2xhc3MoJ2RyYWdnaW5nJyk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1heFB0ci5yZW1vdmVDbGFzcygnZHJhZ2dpbmcnKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2NvcGUubWluSGFuZGxlU3R5bGUgPSB7bGVmdDogbmV3T2Zmc2V0ICsgInB4In07CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmFuZ2VTbGlkZXJXaWR0aCA9IHBhcnNlSW50KHNjb3BlLm1heFB0ck9mZnNldCkgLSBwYXJzZUludChzY29wZS5taW5QdHJPZmZzZXQpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2NvcGUucmFuZ2VTdHlsZSA9IHt3aWR0aDogcmFuZ2VTbGlkZXJXaWR0aCArICJweCIsIGxlZnQ6IHNjb3BlLm1pblB0ck9mZnNldCArICJweCJ9OworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGVsc2UgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGRpc2FibGVkICYmIG5ld09mZnNldCA+IGRpc2FibGVXaWR0aCkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNjb3BlLnJhbmdlU3R5bGUgPSB7d2lkdGg6IG5ld09mZnNldCArICJweCIsIHpJbmRleDogMH07CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBlbHNlIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzaW5nbGVQdHIuYWRkQ2xhc3MoJ2RyYWdnaW5nJyk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2NvcGUucmFuZ2VTdHlsZSA9IHt3aWR0aDogbmV3T2Zmc2V0ICsgInB4In07CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzY29wZS5oYW5kbGVTdHlsZSA9IHtsZWZ0OiBuZXdPZmZzZXQgKyAicHgifTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoKHNjb3BlLnByZWNpc2lvbiA9PT0gdW5kZWZpbmVkKSB8fCAoc2NvcGUuc3RlcCA9PT0gdW5kZWZpbmVkKSkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2NvcGUucHJlY2lzaW9uID0gc2xpZGVyRGVmYXVsdE9wdGlvbnMucHJlY2lzaW9uOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2NvcGUuc3RlcCA9IHNsaWRlckRlZmF1bHRPcHRpb25zLnN0ZXA7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbmV3VmFsdWUgPSBzY29wZS5jYWxTdGVwKG5ld1ZhbHVlLCBwYXJzZUludChzY29wZS5wcmVjaXNpb24pLCBwYXJzZUZsb2F0KHNjb3BlLnN0ZXApLCBwYXJzZUZsb2F0KHNjb3BlLmZsb29yKSk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNjb3BlW3Njb3BlLnJlZl0gPSBuZXdWYWx1ZTsKKyAgICAgICAgICAgICAgICAgICAgICAgIH07CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICB9OworICAgICAgICAgICAgfQorICAgICAgICBdKS5kaXJlY3RpdmUoJ2F0dFNsaWRlck1pbicsW2Z1bmN0aW9uKCkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICByZXR1cm57CisgICAgICAgICAgICAgICAgIHJlcXVpcmU6ICdeYXR0U2xpZGVyJywKKyAgICAgICAgICAgICAgICAgcmVzdHJpY3Q6ICdFQScsCisgICAgICAgICAgICAgICAgIHJlcGxhY2U6IHRydWUsCisgICAgICAgICAgICAgICAgIHRyYW5zY2x1ZGU6IHRydWUsCisgICAgICAgICAgICAgICAgIHRlbXBsYXRlVXJsOiAnYXBwL3NjcmlwdHMvbmdfanNfYXR0X3RwbHMvc2xpZGVyL21pbkNvbnRlbnQuaHRtbCcKKyAgICAgICAgICAgICAgIH07CisgICAgICAgICB9CisgICAgXSkuZGlyZWN0aXZlKCdhdHRTbGlkZXJNYXgnLFtmdW5jdGlvbigpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgcmV0dXJueworICAgICAgICAgICAgICAgICByZXF1aXJlOiAnXmF0dFNsaWRlcicsCisgICAgICAgICAgICAgICAgIHJlc3RyaWN0OiAnRUEnLAorICAgICAgICAgICAgICAgICByZXBsYWNlOiB0cnVlLAorICAgICAgICAgICAgICAgICB0cmFuc2NsdWRlOiB0cnVlLAorICAgICAgICAgICAgICAgICB0ZW1wbGF0ZVVybDogJ2FwcC9zY3JpcHRzL25nX2pzX2F0dF90cGxzL3NsaWRlci9tYXhDb250ZW50Lmh0bWwnCisgICAgICAgICAgICAgfTsKKyAgICAgICAgIH0KKyAgICBdKTsKK2FuZ3VsYXIubW9kdWxlKCdhdHQuYWJzLnNwbGl0QnV0dG9uRHJvcGRvd24nLCBbJ2F0dC5hYnMudXRpbGl0aWVzJ10pCisgICAgICAgIC5kaXJlY3RpdmUoJ2F0dEJ1dHRvbkRyb3Bkb3duJywgWyckZG9jdW1lbnQnLCAnJHBhcnNlJywgJyRkb2N1bWVudEJpbmQnLCBmdW5jdGlvbigkZG9jdW1lbnQsICRwYXJzZSwgJGRvY3VtZW50QmluZCkgeworICAgICAgICAgICAgICAgIHJldHVybiB7CisgICAgICAgICAgICAgICAgICAgIHJlc3RyaWN0OiAnRUEnLAorICAgICAgICAgICAgICAgICAgICByZXBsYWNlOiB0cnVlLAorICAgICAgICAgICAgICAgICAgICB0cmFuc2NsdWRlOiB0cnVlLAorICAgICAgICAgICAgICAgICAgICB0ZW1wbGF0ZVVybDogJ2FwcC9zY3JpcHRzL25nX2pzX2F0dF90cGxzL3NwbGl0QnV0dG9uRHJvcGRvd24vc3BsaXRCdXR0b25Ecm9wZG93bi5odG1sJywKKyAgICAgICAgICAgICAgICAgICAgc2NvcGU6IHsKKyAgICAgICAgICAgICAgICAgICAgICAgIGJ0blRleHQ6ICJAIiwKKyAgICAgICAgICAgICAgICAgICAgICAgIGJ0blR5cGU6ICJAIiwKKyAgICAgICAgICAgICAgICAgICAgICAgIGJ0bkxpbms6ICJAIiwKKyAgICAgICAgICAgICAgICAgICAgICAgIGJ0bkNsaWNrOiAiJiIKKyAgICAgICAgICAgICAgICAgICAgfSwKKyAgICAgICAgICAgICAgICAgICAgbGluazogZnVuY3Rpb24oc2NvcGUsIGVsZW1lbnQsIGF0dHIpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIHNjb3BlLmlzU21hbGwgPSBmYWxzZTsKKyAgICAgICAgICAgICAgICAgICAgICAgIHNjb3BlLmlzRHJvcERvd25PcGVuID0gZmFsc2U7CisgICAgICAgICAgICAgICAgICAgICAgICBzY29wZS5pc0FjdGlvbkRyb3Bkb3duID0gZmFsc2U7CisKKyAgICAgICAgICAgICAgICAgICAgICAgIGlmIChhdHRyLnNtYWxsID09PSAiIikgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNjb3BlLmlzU21hbGwgPSB0cnVlOworICAgICAgICAgICAgICAgICAgICAgICAgfQorCisgICAgICAgICAgICAgICAgICAgICAgICBpZiAoIShzY29wZS5idG5UZXh0KSkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNjb3BlLmlzQWN0aW9uRHJvcGRvd24gPSB0cnVlOworICAgICAgICAgICAgICAgICAgICAgICAgfQorCisgICAgICAgICAgICAgICAgICAgICAgICBzY29wZS5jbGlja0Z4biA9IGZ1bmN0aW9uKCkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmKHR5cGVvZiBzY29wZS5idG5DbGljayA9PT0gImZ1bmN0aW9uIiAmJiAhc2NvcGUuYnRuTGluayl7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNjb3BlLmJ0bkNsaWNrID0gJHBhcnNlKHNjb3BlLmJ0bkNsaWNrKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2NvcGUuYnRuQ2xpY2soKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICB9OworCisgICAgICAgICAgICAgICAgICAgICAgICBzY29wZS50b2dnbGVEcm9wZG93biA9IGZ1bmN0aW9uKCkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICghKHNjb3BlLmJ0blR5cGUgPT09ICdkaXNhYmxlZCcpKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNjb3BlLmlzRHJvcERvd25PcGVuID0gIXNjb3BlLmlzRHJvcERvd25PcGVuOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgIH07CisKKyAgICAgICAgICAgICAgICAgICAgICAgIHNjb3BlLmhpZGVEcm9wZG93biA9IGZ1bmN0aW9uKCkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICghKHNjb3BlLmJ0blR5cGUgPT09ICdkaXNhYmxlZCcpKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNjb3BlLmlzRHJvcERvd25PcGVuID0gZmFsc2U7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgfTsKKworICAgICAgICAgICAgICAgICAgICAgICAgdmFyIG91dHNpZGVDbGljayA9IGZ1bmN0aW9uKCkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNjb3BlLiRhcHBseShmdW5jdGlvbigpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2NvcGUuaXNEcm9wRG93bk9wZW4gPSBmYWxzZTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB9KTsKKyAgICAgICAgICAgICAgICAgICAgICAgIH07CisKKyAgICAgICAgICAgICAgICAgICAgICAgICRkb2N1bWVudEJpbmQuY2xpY2soJ2lzRHJvcERvd25PcGVuJywgb3V0c2lkZUNsaWNrLCBzY29wZSk7CisKKyAgICAgICAgICAgICAgICAgICAgICAgIGF0dHIuJG9ic2VydmUoJ2J0blR5cGUnLCBmdW5jdGlvbih2YWwpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBzY29wZS5idG5UeXBlID0gdmFsOworICAgICAgICAgICAgICAgICAgICAgICAgfSk7CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICB9OworCisgICAgICAgICAgICB9XSk7Cithbmd1bGFyLm1vZHVsZSgnYXR0LmFicy5zcGxpdEljb25CdXR0b24nLCBbJ2F0dC5hYnMudXRpbGl0aWVzJ10pCisuY29uc3RhbnQoJ2ljb25TdGF0ZUNvbnN0YW50cycsIHsKKyAgICBNSURETEU6ICdtaWRkbGUnLAorICAgIExFRlQ6ICdsZWZ0JywKKyAgICBSSUdIVDogJ3JpZ2h0JywKKyAgICBORVhUX1RPX0RST1BET1dOOiduZXh0LXRvLWRyb3Bkb3duJywKKyAgICBMRUZUX05FWFRfVE9fRFJPUERPV046J2xlZnQtbmV4dC10by1kcm9wZG93bicsCisgICAgRElSX1RZUEU6IHsKKyAgICAgICAgTEVGVDogJ2xlZnQnLAorICAgICAgICBSSUdIVDogICdyaWdodCcsCisgICAgICAgIEJVVFRPTjogJ2J1dHRvbicKKyAgICB9LAorICAgIEtFWUJPQVJEOiB7CisgICAgICAgIFVQOiAzOCwKKyAgICAgICAgRE9XTjo0MCwKKyAgICAgICAgRU5URVI6IDEzLAorICAgICAgICBFU0M6IDI3CisgICAgfSwKKyAgICBTUExJVF9JQ09OX0JUTl9FVkVOVF9FTUlUVEVSX0tFWTogJ3NwbGl0SWNvbkJ1dHRvblRhcCcKK30pCisuZGlyZWN0aXZlKCdleHBhbmRhYmxlTGluZScsIFsnJGRvY3VtZW50JyxmdW5jdGlvbigkZG9jdW1lbnQpeworICAgIHJldHVybiB7CisgICAgICAgIHJlc3RyaWN0OiAnRUEnLAorICAgICAgICByZXBsYWNlOiB0cnVlLAorICAgICAgICBwcmlvcml0eTogMzAwLAorICAgICAgICByZXF1aXJlOiBbJ15hdHRTcGxpdEljb25CdXR0b24nLCAnZXhwYW5kYWJsZUxpbmUnXSwKKyAgICAgICAgY29udHJvbGxlcjogWyckc2NvcGUnLCBmdW5jdGlvbigkc2NvcGUpeworICAgICAgICAgICAgJHNjb3BlLmlzQWN0aXZlID0gZmFsc2U7CisgICAgICAgICAgICB0aGlzLnNldEFjdGl2ZVN0YXRlID0gZnVuY3Rpb24oaXNBY3RpdmUpeworICAgICAgICAgICAgICAgICRzY29wZS5pc0FjdGl2ZSA9IGlzQWN0aXZlOworICAgICAgICAgICAgfQorCisgICAgICAgICAgICB0aGlzLmlzQWN0aXZlID0gJHNjb3BlLmlzQWN0aXZlOworICAgICAgICAgICAgdGhpcy5kaXJUeXBlID0gJHNjb3BlLmRpclR5cGU7CisgICAgICAgIH1dLAorICAgICAgICB0ZW1wbGF0ZTogJzxkaXYgbmctY2xhc3M9IntcJ2V4cGFuZC1saW5lLWNvbnRhaW5lclwnOiAhaXNBY3RpdmUsIFwnZXhwYW5kLWxpbmUtY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xpdEljb24nLCBbJyRkb2N1bWVudCcsICckdGltZW91dCcsJ2ljb25TdGF0ZUNvbnN0YW50cycsJyRkb2N1bWVudEJpbmQnLCdldmVudHMnLAorIGZ1bmN0aW9uKCRkb2N1bWVudCwkdGltZW91dCxpY29uU3RhdGVDb25zdGFudHMsJGRvY3VtZW50QmluZCwgZXZlbnRzKXsKKyAgICByZXR1cm4geworICAgICAgICByZXN0cmljdDogJ0VBJywKKyAgICAgICAgcmVwbGFjZTogdHJ1ZSwKKyAgICAgICAgcHJpb3JpdHk6IDIwMCwKKyAgICAgICAgdHJhbnNjbHVkZTogdHJ1ZSwKKyAgICAgICAgcmVxdWlyZTogWydeYXR0U3BsaXRJY29uQnV0dG9uJywnYXR0U3BsaXRJY29uJ10sCisgICAgICAgIHRlbXBsYXRlVXJsOiAnYXBwL3NjcmlwdHMvbmdfanNfYXR0X3RwbHMvc3BsaXRJY29uQnV0dG9uL3NwbGl0SWNvbi5odG1sJywKKyAgICAgICAgc2NvcGU6eworICAgICAgICAgICAgaWNvbjogJ0AnLAorICAgICAgICAgICAgaG92ZXJXYXRjaDogJz0nLAorICAgICAgICAgICAgZHJvcERvd25XYXRjaDogJz0nLAorICAgICAgICAgICAgZGlyVHlwZTogJ0AnCisgICAgICAgIH0sCisgICAgICAgIGNvbnRyb2xsZXI6J0F0dFNwbGl0SWNvbkN0cmwnLAorICAgICAgICBsaW5rOiBmdW5jdGlvbihzY29wZSxlbGVtZW50LGF0dHIsY3RybHMpeworCisgICAgICAgICAgICB2YXIgYXR0U3BsaXRJY29uQnV0dG9uQ3RybCA9IGN0cmxzWzBdOworICAgICAgICAgICAgdmFyIGF0dFNwbGl0SWNvbkN0cmwgPSBjdHJsc1sxXTsKKyAgICAgICAgICAgIGF0dFNwbGl0SWNvbkJ1dHRvbkN0cmwuYWRkU3ViQ3RybChhdHRTcGxpdEljb25DdHJsKTsKKworICAgICAgICAgICAgc2NvcGUuaWNvblN0YXRlQ29uc3RhbnRzID0gaWNvblN0YXRlQ29uc3RhbnRzOworCisgICAgICAgICAgICB2YXIgY3VycmVudEluZGV4ID0gMDsKKyAgICAgICAgICAgIHZhciBpc015RWxlbWVudCA9IGZhbHNlOworICAgICAgICAgICAgdmFyIGxpc3RFbGVtZW50czsKKworICAgICAgICAgICAgc2NvcGUuaXNEcm9wZG93biA9IGZhbHNlOworICAgICAgICAgICAgc2NvcGUuaXNEcm9wZG93bk9wZW4gPSBmYWxzZTsKKworCisgICAgICAgICAgICBzY29wZS4kb24oaWNvblN0YXRlQ29uc3RhbnRzLlNQTElUX0lDT05fQlROX0VWRU5UX0VNSVRURVJfS0VZLCBmdW5jdGlvbihldm50LCBkYXRhKXsKKyAgICAgICAgICAgICAgICBpZih0eXBlb2YgZGF0YSA9PSAnYm9vbGVhbicgJiYgZGF0YSl7CisgICAgICAgICAgICAgICAgICAgIHNjb3BlLmRyb3BEb3duQ2xpY2tlZCgpOyAgICAKKyAgICAgICAgICAgICAgICAgICAgCisgICAgICAgICAgICAgICAgICAgIC8qCisgICAgICAgICAgICAgICAgICAgICAgICBDaGVjayBpZiB0aGUgZHJvcGRvd24gaXMgb3BlbiBhbmQgaWYgd2UgYXJlIHNlbGVjdGluZyBvbmUKKyAgICAgICAgICAgICAgICAgICAgICAgIG9mIHRoZSBpdGVtcywgc28gdGhhdCB3aGVuIHByZXNzaW5nIGVudGVyIGl0IHdpbGwgdHJpZ2dlciBpdC4KKyAgICAgICAgICAgICAgICAgICAgKi8KKyAgICAgICAgICAgICAgICAgICAgaWYoc2NvcGUuaXNEcm9wRG93bk9wZW4peworICAgICAgICAgICAgICAgICAgICAgICAgbGlzdEVsZW1lbnRzW2N1cnJlbnRJbmRleF0uZXEoMCkuZmluZCgnYScpWzBdLmNsaWNrKCk7CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgZWxzZXsKKyAgICAgICAgICAgICAgICAgICAgdmFyIGUgPSBkYXRhOworICAgICAgICAgICAgICAgICAgICAvL09ubHkgdHJpZ2dlciB0aGUga2V5Ym9hcmQgZXZlbnQgaWYgdGhlIGljb24gYnV0dG9uIGlzIGEgZHJvcGRvd24gdHlwZQorICAgICAgICAgICAgICAgICAgICBpZihzY29wZS5pc0Ryb3Bkb3duKQorICAgICAgICAgICAgICAgICAgICAgICAgdHJpZ2dlcktleWJvYXJkRXZlbnRzKGUpOyAgIAorICAgICAgICAgICAgICAgIH0KKworICAgICAgICAgICAgICAgIGZ1bmN0aW9uIHRyaWdnZXJLZXlib2FyZEV2ZW50cyhlKXsKKyAgICAgICAgICAgICAgICAgICAgaWYoZS53aGljaCA9PSBpY29uU3RhdGVDb25zdGFudHMuS0VZQk9BUkQuRVNDKXsKKyAgICAgICAgICAgICAgICAgICAgICAgIG91dHNpZGVDbGljaygpOworICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgIGlmKCBlLndoaWNoID09IGljb25TdGF0ZUNvbnN0YW50cy5LRVlCT0FSRC5VUCB8fCAgCisgICAgICAgICAgICAgICAgICAgICAgICBlLndoaWNoID09IGljb25TdGF0ZUNvbnN0YW50cy5LRVlCT0FSRC5ET1dOKXsKKworICAgICAgICAgICAgICAgICAgICAgICAgZS5wcmV2ZW50RGVmYXVsdCgpOworICAgICAgICAgICAgICAgICAgICAgICAgZXZlbnRzLnN0b3BQcm9wYWdhdGlvbihlKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIC8vZS5zdG9wUHJvcGFnYXRpb24oKTsKKworICAgICAgICAgICAgICAgICAgICAgICAgaWYoZS53aGljaCA9PSBpY29uU3RhdGVDb25zdGFudHMuS0VZQk9BUkQuRE9XTil7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgLy9Ecm9wZG93biBpcyBvcGVuIGFuZCB0aGUgdXNlciB0YXBzIGRvd24gYWdhaW4KKworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmKHNjb3BlLmlzRHJvcERvd25PcGVuKXsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLy9Ob3cgd2UgbmVlZCB0byBnbyB0aHJvdWdoIHRoZSByb3dzIGluIHRoZSBkcm9wZG93bgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzY29wZS5uZXh0SXRlbUluRHJvcGRvd24oKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgLy9Ecm9wZG93biBpcyBub3Qgb3BlbgorICAgICAgICAgICAgICAgICAgICAgICAgICAgIGVsc2V7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlzTXlFbGVtZW50ID0gdHJ1ZTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgb3V0c2lkZUNsaWNrKCk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxpc3RFbGVtZW50c0luaXQoKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICBlbHNlIGlmKGUud2hpY2ggID09IGljb25TdGF0ZUNvbnN0YW50cy5LRVlCT0FSRC5VUCl7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYoc2NvcGUuaXNEcm9wRG93bk9wZW4peworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzY29wZS5wcmV2aW91c0l0ZW1JbkRyb3Bkb3duKCk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgfWVsc2V7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgCisgICAgICAgICAgICAgICAgICAgICAgICBlbHNleworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlzTXlFbGVtZW50ID0gZmFsc2U7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgb3V0c2lkZUNsaWNrKCk7CisgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgIH1lbHNlIGlmKGUud2hpY2ggPT0gaWNvblN0YXRlQ29uc3RhbnRzLktFWUJPQVJELkVOVEVSKXsKKyAgICAgICAgICAgICAgICAgICAgICAgIGlmKHNjb3BlLmlzRHJvcERvd25PcGVuKXsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBsaXN0RWxlbWVudHNJbml0KCk7CisgICAgICAgICAgICAgICAgICAgICAgICB9ZWxzZXsKKyAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIH0KKworICAgICAgICAgICAgICAgIGZ1bmN0aW9uIGxpc3RFbGVtZW50c0luaXQoKXsKKyAgICAgICAgICAgICAgICAgICAgaWYobGlzdEVsZW1lbnRzID09IHVuZGVmaW5lZCl7CisgICAgICAgICAgICAgICAgICAgICAgICBsaXN0RWxlbWVudHMgPSBbXTsKKyAgICAgICAgICAgICAgICAgICAgICAgIHZhciBsaVRlbXBzID0gZWxlbWVudC5maW5kKCdsaScpOworICAgICAgICAgICAgICAgICAgICAgICAgZm9yKHZhciBpID0gMDsgaSA8IGxpVGVtcHMubGVuZ3RoOyBpKyspeworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxpc3RFbGVtZW50cy5wdXNoKGxpVGVtcHMuZXEoaSkpOworICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgbGlzdEVsZW1lbnRzW2N1cnJlbnRJbmRleF0uY2hpbGRyZW4oKS5lcSgwKS5hZGRDbGFzcygnc2VsZWN0ZWQtaXRlbScpOworICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgCisgICAgICAgICAgICB9KTsKKyAgICAgICAgCisgICAgICAgICAgICBzY29wZS5uZXh0SXRlbUluRHJvcGRvd24gPSBmdW5jdGlvbigpeworICAgICAgICAgICAgICAgIGlmKGxpc3RFbGVtZW50cyAmJiBjdXJyZW50SW5kZXggPCBsaXN0RWxlbWVudHMubGVuZ3RoIC0gMSl7CisgICAgICAgICAgICAgICAgICAgIGN1cnJlbnRJbmRleCsrOworICAgICAgICAgICAgICAgICAgICBsaXN0RWxlbWVudHNbY3VycmVudEluZGV4IC0gMV0uY2hpbGRyZW4oKS5lcSgwKS5yZW1vdmVDbGFzcygnc2VsZWN0ZWQtaXRlbScpOworICAgICAgICAgICAgICAgICAgICBsaXN0RWxlbWVudHNbY3VycmVudEluZGV4XS5jaGlsZHJlbigpLmVxKDApLmFkZENsYXNzKCdzZWxlY3RlZC1pdGVtJyk7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfTsKKworICAgICAgICAgICAgc2NvcGUucHJldmlvdXNJdGVtSW5Ecm9wZG93biA9IGZ1bmN0aW9uKCl7CisgICAgICAgICAgICAgICAgaWYoY3VycmVudEluZGV4ID4gMCl7CisgICAgICAgICAgICAgICAgICAgIGN1cnJlbnRJbmRleC0tOworICAgICAgICAgICAgICAgICAgICBsaXN0RWxlbWVudHNbY3VycmVudEluZGV4XS5jaGlsZHJlbigpLmVxKDApLmFkZENsYXNzKCdzZWxlY3RlZC1pdGVtJyk7CisKKyAgICAgICAgICAgICAgICAgICAgaWYoY3VycmVudEluZGV4ICsgMSA8IGxpc3RFbGVtZW50cy5sZW5ndGgpCisgICAgICAgICAgICAgICAgICAgICAgICBsaXN0RWxlbWVudHNbY3VycmVudEluZGV4ICsgMV0uY2hpbGRyZW4oKS5lcSgwKS5yZW1vdmVDbGFzcygnc2VsZWN0ZWQtaXRlbScpOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH07CisKKyAgICAgICAgICAgIHNjb3BlLiR3YXRjaCgnaXNJY29uSG92ZXJlZCcsIGZ1bmN0aW9uKHZhbCl7CisgICAgICAgICAgICAgICAgc2NvcGUuaG92ZXJXYXRjaCA9IHZhbDsKKyAgICAgICAgICAgIH0pOworCisgICAgICAgICAgICBzY29wZS4kd2F0Y2goJ3R5cGUnLCBmdW5jdGlvbih2YWwpeworCisgICAgICAgICAgICAgICAgZnVuY3Rpb24gdG9nZ2xlVmFsdWVzKGlzTWlkZGxlLGlzTmV4dFRvRHJvcERvd24saXNSaWdodCxpc0xlZnQsaXNMZWZ0TmV4dERyb3Bkb3duKXsKKyAgICAgICAgICAgICAgICAgICAgc2NvcGVbJ2lzTWlkZGxlJ10gID0gaXNNaWRkbGU7CisgICAgICAgICAgICAgICAgICAgIHNjb3BlWydpc05leHRUb0Ryb3BEb3duJ10gPSBpc05leHRUb0Ryb3BEb3duOworICAgICAgICAgICAgICAgICAgICBzY29wZVsnaXNSaWdodCddICA9IGlzUmlnaHQ7CisgICAgICAgICAgICAgICAgICAgIHNjb3BlWydpc0xlZnQnXSA9IGlzTGVmdDsKKyAgICAgICAgICAgICAgICAgICAgc2NvcGVbJ2lzTGVmdE5leHREcm9wZG93biddID0gaXNMZWZ0TmV4dERyb3Bkb3duOworICAgICAgICAgICAgICAgIH07CisKKyAgICAgICAgICAgICAgICBpZih2YWwgPT0gc2NvcGUuaWNvblN0YXRlQ29uc3RhbnRzLk1JRERMRSl7CisgICAgICAgICAgICAgICAgICAgIHRvZ2dsZVZhbHVlcyh0cnVlLGZhbHNlLGZhbHNlLHRydWUsZmFsc2UpOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICBlbHNlIGlmKHZhbCA9PSAgc2NvcGUuaWNvblN0YXRlQ29uc3RhbnRzLkxFRlQpeworICAgICAgICAgICAgICAgICAgICB0b2dnbGVWYWx1ZXMoZmFsc2UsZmFsc2UsZmFsc2UsdHJ1ZSxmYWxzZSk7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIGVsc2UgaWYodmFsID09IHNjb3BlLmljb25TdGF0ZUNvbnN0YW50cy5SSUdIVCl7CisgICAgICAgICAgICAgICAgICAgIHRvZ2dsZVZhbHVlcyhmYWxzZSxmYWxzZSx0cnVlLGZhbHNlLGZhbHNlKTsKKyAgICAgICAgICAgICAgICB9ZWxzZSBpZih2YWwgPT0gc2NvcGUuaWNvblN0YXRlQ29uc3RhbnRzLk5FWFRfVE9fRFJPUERPV04peworICAgICAgICAgICAgICAgICAgICB0b2dnbGVWYWx1ZXMoZmFsc2UsdHJ1ZSx0cnVlLHRydWUsZmFsc2UpOworICAgICAgICAgICAgICAgIH1lbHNlICBpZih2YWwgPT0gc2NvcGUuaWNvblN0YXRlQ29uc3RhbnRzLkxFRlRfTkVYVF9UT19EUk9QRE9XTil7CisgICAgICAgICAgICAgICAgICAgIHRvZ2dsZVZhbHVlcyhmYWxzZSxmYWxzZSxmYWxzZSx0cnVlLHRydWUpOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0pOworCisgICAgICAgICAgICBpZihhdHRyLmRyb3BEb3duSWQgJiYgYXR0ci5kcm9wRG93bklkICE9ICcnKXsKKyAgICAgICAgICAgICAgICBzY29wZS5kcm9wRG93bklkID0gYXR0ci5kcm9wRG93bklkOworICAgICAgICAgICAgICAgIHNjb3BlLmlzRHJvcGRvd24gPSB0cnVlOworICAgICAgICAgICAgfQorCisgICAgICAgICAgICBzY29wZS5kcm9wRG93bkNsaWNrZWQgPSBmdW5jdGlvbigpeworICAgICAgICAgICAgICAgIGlzTXlFbGVtZW50ID0gdHJ1ZTsKKyAgICAgICAgICAgIH07CisKKyAgICAgICAgICAgIHNjb3BlLnRvZ2dsZURyb3Bkb3duID0gZnVuY3Rpb24odmFsKSB7CisgICAgICAgICAgICAgICAgaWYodmFsICE9IHVuZGVmaW5lZCkKKyAgICAgICAgICAgICAgICAgICAgc2NvcGUuaXNEcm9wRG93bk9wZW49dmFsOworICAgICAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgICAgICAgICAgc2NvcGUuaXNEcm9wRG93bk9wZW4gPSAhc2NvcGUuaXNEcm9wRG93bk9wZW47IAorCisgICAgICAgICAgICAgICAgc2NvcGUuZHJvcERvd25XYXRjaCA9IHNjb3BlLmlzRHJvcERvd25PcGVuOworICAgICAgICAgICAgfTsKKworICAgICAgICAgICAgdmFyIG91dHNpZGVDbGljayA9IGZ1bmN0aW9uKGUpIHsKKyAgICAgICAgICAgICAgICBpZihzY29wZS5pc0Ryb3Bkb3duKXsKKyAgICAgICAgICAgICAgICAgICAgaWYgKGlzTXlFbGVtZW50KSB7CisgICAgICAgICAgICAgICAgICAgICAgICBpc015RWxlbWVudCA9IGZhbHNlOworICAgICAgICAgICAgICAgICAgICAgICAgc2NvcGUudG9nZ2xlRHJvcGRvd24oKTsKKyAgICAgICAgICAgICAgICAgICAgfWVsc2V7CisgICAgICAgICAgICAgICAgICAgICAgICBzY29wZS50b2dnbGVEcm9wZG93bihmYWxzZSk7CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgc2NvcGUuJGFwcGx5KCk7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfTsKKworICAgICAgICAgICAgJGRvY3VtZW50QmluZC5jbGljaygnaXNEcm9wZG93bicsIG91dHNpZGVDbGljaywgc2NvcGUpOworICAgICAgICB9CisgICAgfQorfV0pCisuY29udHJvbGxlcignQXR0U3BsaXRJY29uQnV0dG9uQ3RybCcsWyckc2NvcGUnLCAnaWNvblN0YXRlQ29uc3RhbnRzJyxmdW5jdGlvbigkc2NvcGUsaWNvblN0YXRlQ29uc3RhbnRzKXsKKworICAgIHRoaXMuc3ViQ3RybHMgPSBbXTsKKworICAgICRzY29wZS5pc0xlZnRMaW5lU2hvd249dHJ1ZTsKKyAgICAkc2NvcGUuaXNSaWdodExpbmVTaG93bj10cnVlOworICAgICRzY29wZS5jaGlsZHJlblNjb3BlcyA9IFtdOworCisgICAgdmFyIG9yaWdMZWZ0TGluZVNob3duID0gJHNjb3BlLmlzTGVmdExpbmVTaG93bjsKKyAgICB2YXIgb3JpZ1JpZ2h0TGluZVNob3duID0gJHNjb3BlLmlzUmlnaHRMaW5lU2hvd247CisKKyAgICB2YXIgdGhhdCA9IHRoaXM7CisKKyAgICBmdW5jdGlvbiBnZXREaXJJbmRleChkaXJUeXBlKXsKKyAgICAgICAgdmFyIGluZGV4ID0gLTE7CisgICAgICAgIGZvcih2YXIgYyBpbiB0aGF0LnN1YkN0cmxzKXsKKyAgICAgICAgICAgIHZhciBjdHJsID0gdGhhdC5zdWJDdHJsc1tjXTsKKyAgICAgICAgICAgIGlmKGN0cmwuZGlyVHlwZT09ZGlyVHlwZSl7CisgICAgICAgICAgICAgICAgaW5kZXggPSBjOworICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgICAgIHJldHVybiBpbmRleDsKKyAgICB9CisKKyAgICB0aGlzLmFkZFN1YkN0cmwgPSAgZnVuY3Rpb24oc3ViKXsKKyAgICAgICAgdGhpcy5zdWJDdHJscy5wdXNoKHN1Yik7CisgICAgfTsKKworICAgIHRoaXMuaXNMZWZ0TGluZVNob3duID0gZnVuY3Rpb24oaXNTaG93bil7CisgICAgICAgIGlmKGlzU2hvd24gPT0gdW5kZWZpbmVkKQorICAgICAgICAgICAgcmV0dXJuICRzY29wZS5pc0xlZnRMaW5lU2hvd247CisgICAgICAgIGVsc2UKKyAgICAgICAgICAgICRzY29wZS5pc0xlZnRMaW5lU2hvd24gPSBpc1Nob3duOworICAgIH07CisKKyAgICB0aGlzLmlzUmlnaHRMaW5lU2hvd24gPSBmdW5jdGlvbihpc1Nob3duKXsKKyAgICAgICAgaWYoaXNTaG93biA9PSB1bmRlZmluZWQpCisgICAgICAgICAgICByZXR1cm4gJHNjb3BlLmlzUmlnaHRMaW5lU2hvd247CisgICAgICAgIGVsc2UKKyAgICAgICAgICAgICRzY29wZS5pc1JpZ2h0TGluZVNob3duID0gaXNTaG93bjsKKyAgICB9OworCisgICAgdGhpcy5zZXRMZWZ0TGluZUhvdmVyID0gZnVuY3Rpb24oaXNIb3ZlcmVkKXsKKyAgICAgICAgdmFyIGxlZnRMaW5lSW5kZXggPSBnZXREaXJJbmRleChpY29uU3RhdGVDb25zdGFud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0cmxzW3JpZ2h0TGluZUluZGV4XSAKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiBzdWJJY29uQnV0dG9uc1tpLTFdLnN1YkN0cmxzW3JpZ2h0TGluZUluZGV4XS5zZXRBY3RpdmVTdGF0ZSkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBzdWJJY29uQnV0dG9uc1tpLTFdLnN1YkN0cmxzW3JpZ2h0TGluZUluZGV4XS5zZXRBY3RpdmVTdGF0ZShpc0hvdmVyZWQpOworICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0KKyAgICAgICAgfSAgIAorCisgICAgICAgIGlmKGlzRHJvcERvd25PcGVuKXsKKyAgICAgICAgICAgIC8qCisgICAgICAgICAgICAgIElmIHRoZSBidXR0b24gaXMgbmV4dCB0byB0aGUgZHJvcGRvd24gYnV0dG9uIHRoZW4ganVzdCBrZWVwIHRoZSAKKyAgICAgICAgICAgICAgYnV0dG9ucyBsZWZ0IGxpbmUgb3IgaXRzIGxlZnQgbmVpZ2hib3JzIHJpZ2h0IGxpbmUgdG9nZ2xlZCBvbgorICAgICAgICAgICAgICBJZiB0aGUgYnV0dG9uIGlzIHRoZSBkcm9wZG93biBidXR0b24gZG9uJ3QgZG8gYW55dGhpbmcKKyAgICAgICAgICAgICAgZWxzZSBkbyB0aGluZ3Mgbm9ybWFsbHkgd2l0aHQgdGhlIGJ1dHRvbgorICAgICAgICAgICAgKi8KKyAgICAgICAgICAgIGlmKHN1Ykljb25CdXR0b25zW3N1Ykljb25CdXR0b25zTGVuZ3RoLTFdID09IGJ1dHRvbkN0cmwpeworCisgICAgICAgICAgICB9CisgICAgICAgICAgICBlbHNlIGlmKHN1Ykljb25CdXR0b25zW3N1Ykljb25CdXR0b25zTGVuZ3RoLTJdPT1idXR0b25DdHJsKXsKKyAgICAgICAgICAgICAgICBpZihzdWJJY29uQnV0dG9uc1tzdWJJY29uQnV0dG9uc0xlbmd0aC0yXS5pc0xlZnRMaW5lU2hvd24oKSkKKyAgICAgICAgICAgICAgICAgICAgc3ViSWNvbkJ1dHRvbnNbc3ViSWNvbkJ1dHRvbnNMZW5ndGgtMl0uc3ViQ3RybHNbbGVmdExpbmVJbmRleF0uc2V0QWN0aXZlU3RhdGUoaXNIb3ZlcmVkKTsKKyAgICAgICAgICAgICAgICBlbHNlIGlmKHN1Ykljb25CdXR0b25zTGVuZ3RoICAtIDMgPj0gMCl7CisgICAgICAgICAgICAgICAgICAgIGlmKHN1Ykljb25CdXR0b25zW3N1Ykljb25CdXR0b25zTGVuZ3RoLTNdLmlzUmlnaHRMaW5lU2hvd24oKSkKKyAgICAgICAgICAgICAgICAgICAgICAgIHN1Ykljb25CdXR0b25zW3N1Ykljb25CdXR0b25zTGVuZ3RoLTNdLnN1YkN0cmxzW3JpZ2h0TGluZUluZGV4XS5zZXRBY3RpdmVTdGF0ZShpc0hvdmVyZWQpOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH1lbHNleworICAgICAgICAgICAgICAgCisgICAgICAgICAgICAgICAgbm9WZXJ0aWNhbExpbmVUb2dnbGUoKTsKKworICAgICAgICAgICAgICAgIGlmKCRzY29wZS5pc0xlZnRMaW5lU2hvd24peworICAgICAgICAgICAgICAgICAgICB0aGlzLnN1YkN0cmxzW2xlZnRMaW5lSW5kZXhdLnNldEFjdGl2ZVN0YXRlKGlzSG92ZXJlZCk7CisgICAgICAgICAgICAgICAgfQorCisgICAgICAgICAgICAgICAgaWYoJHNjb3BlLmlzUmlnaHRMaW5lU2hvd24peworICAgICAgICAgICAgICAgICAgICB0aGlzLnN1YkN0cmxzW3JpZ2h0TGluZUluZGV4XS5zZXRBY3RpdmVTdGF0ZShpc0hvdmVyZWQpOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgICAgICBlbHNleworICAgICAgICAgICAgLy9IYW5kbGUgU3BlY2lhbCBjYXNlcyB3aGVyZSB0aGV5IGFyZW4ndCBzaG93aW5nIGFueSB2ZXJ0aWNhbCBsaW5lcworICAgICAgICAgICAgLy9hbmQgdGhlIGRyb3Bkb3duIGlzbid0IGRvd24KKyAgICAgICAgICAgIGlmKCEkc2NvcGUuaXNMZWZ0TGluZVNob3duICYmICEkc2NvcGUuaXNSaWdodExpbmVTaG93bil7CisgICAgICAgICAgICAgICAgbm9WZXJ0aWNhbExpbmVUb2dnbGUoKTsKKyAgICAgICAgICAgIH0gICAKKworICAgICAgICAgICAgaWYoJHNjb3BlLmlzTGVmdExpbmVTaG93bil7CisgICAgICAgICAgICAgICAgaWYodGhpcy5zdWJDdHJsc1tsZWZ0TGluZUluZGV4XS5zZXRBY3RpdmVTdGF0ZSkKKyAgICAgICAgICAgICAgICB0aGlzLnN1YkN0cmxzW2xlZnRMaW5lSW5kZXhdLnNldEFjdGl2ZVN0YXRlKGlzSG92ZXJlZCk7CisgICAgICAgICAgICB9CisKKyAgICAgICAgICAgIGlmKCRzY29wZS5pc1JpZ2h0TGluZVNob3duKXsKKyAgICAgICAgICAgICAgICBpZih0aGlzLnN1YkN0cmxzW3JpZ2h0TGluZUluZGV4XS5zZXRBY3RpdmVTdGF0ZSkKKyAgICAgICAgICAgICAgICB0aGlzLnN1YkN0cmxzW3JpZ2h0TGluZUluZGV4XS5zZXRBY3RpdmVTdGF0ZShpc0hvdmVyZWQpOworICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgfTsKKyAgCisgICAgdGhpcy5zZXRCdXR0b25UeXBlID0gZnVuY3Rpb24odHlwZSl7CisgICAgICAgIHZhciBidXR0b25JbmRleCA9IGdldERpckluZGV4KGljb25TdGF0ZUNvbnN0YW50cy5ESVJfVFlQRS5CVVRUT04pOworICAgICAgICBpZih0aGlzLnN1YkN0cmxzW2J1dHRvbkluZGV4XSAmJiB0aGlzLnN1YkN0cmxzW2J1dHRvbkluZGV4XS5zZXRUeXBlKQorICAgICAgICAgICAgdGh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VudC5iaW5kKCdrZXlkb3duJywgZnVuY3Rpb24oZSl7CisgICAgICAgICAgICAgICAgLy9DaGVjayBpZiB0aGUga2V5IGlzIHRoZSB1cCBvciBkb3duIGtleQorICAgICAgICAgICAgICAgIC8vaWYoKQorICAgICAgICAgICAgICAgIGlmKGUud2hpY2ggPT0gaWNvblN0YXRlQ29uc3RhbnRzLktFWUJPQVJELlVQIHx8CisgICAgICAgICAgICAgICAgICAgIGUud2hpY2ggPT0gaWNvblN0YXRlQ29uc3RhbnRzLktFWUJPQVJELkRPV04gfHwKKyAgICAgICAgICAgICAgICAgICAgZS53aGljaCA9PSBpY29uU3RhdGVDb25zdGFudHMuS0VZQk9BUkQuRU5URVIgfHwKKyAgICAgICAgICAgICAgICAgICAgZS53aGljaCA9PSBpY29uU3RhdGVDb25zdGFudHMuS0VZQk9BUkQuRVNDICkgeworCisgICAgICAgICAgICAgICAgICAgIHNjb3BlLmNsaWNrSGFuZGxlcigpOworICAgICAgICAgICAgICAgICAgICBzY29wZS4kYnJvYWRjYXN0KGljb25TdGF0ZUNvbnN0YW50cy5TUExJVF9JQ09OX0JUTl9FVkVOVF9FTUlUVEVSX0tFWSwgZSk7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfSk7CisKKyAgICAgICAgICAgIHNjb3BlLmRyb3BEb3duV2F0Y2ggPSBmYWxzZTsKKworICAgICAgICAgICAgc2NvcGUuaWNvblN0YXRlQ29uc3RhbnRzID0gaWNvblN0YXRlQ29uc3RhbnRzOworCisgICAgICAgICAgICBzY29wZS5jbGlja0hhbmRsZXIgPSBmdW5jdGlvbigpeworICAgICAgICAgICAgICAgIGF0dFNwbGl0QnV0dG9uR3JvdXBDdHJsLmhpZGVMZWZ0TGluZVJpZ2h0QnV0dG9uKGF0dFNwbGl0SWNvbkJ1dHRvbkN0cmwpOworICAgICAgICAgICAgfTsKKyAgICAgICAgICAgIAorICAgICAgICAgICAgc2NvcGUuJHdhdGNoKCdpc0hvdmVyZWQnLCBm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25CdXR0b25zLnB1c2goaWNvbkJ1dHRvbik7CisgICAgfTsKKworICAgIHRoaXMuaXNEcm9wRG93bk9wZW4gPSBmYWxzZTsKKworICAgIHRoaXMuaGlkZUxlZnRMaW5lUmlnaHRCdXR0b24gPSBmdW5jdGlvbihidG4peworICAgICAgICB2YXIgbnVtQnV0dG9ucyA9IHRoaXMuc3ViSWNvbkJ1dHRvbnMubGVuZ3RoOworICAgICAgICB2YXIgYnV0dG9uTGVmdE9mUmlnaHRNb3N0ID0gdGhpcy5zdWJJY29uQnV0dG9uc1tudW1CdXR0b25zIC0gMl07CisgICAgICAgIHZhciByaWdodE1vc3RCdXR0b24gPSB0aGlzLnN1Ykljb25CdXR0b25zW251bUJ1dHRvbnMgLTFdOworCisgICAgICAgIGlmIChidG4gIT0gYnV0dG9uTGVmdE9mUmlnaHRNb3N0ICYmIGJ0biAhPSByaWdodE1vc3RCdXR0b24gKXsKKyAgICAgICAgICAgIHJpZ2h0TW9zdEJ1dHRvbi5zZXRMZWZ0TGluZUhvdmVyKGZhbHNlKTsKKyAgICAgICAgfQorICAgIH07CisKKyAgICB0aGlzLnRvZ2dsZURyb3Bkb3duU3RhdGUgPSBmdW5jdGlvbihpc0Ryb3BEb3duT3Blbil7CisKKyAgICAgICAgdmFyIG51bUJ1dHRvbnMgPSB0aGlzLnN1Ykljb25CdXR0b25zLmxlbmd0aDsKKyAgIAorICAgICAgICBpZihudW1CdXR0b25zID4gMil7CisgICAgICAgIAorICAgICAgICAgICAgaWYoaXNEcm9wRG93bk9wZW4peworCisgICAgICAgICAgICAgICAgaWYodGhpcy5zdWJJY29uQnV0dG9uc1tudW1CdXR0b25zIC0gMl0uaXNSaWdodExpbmVTaG93bigpKQorICAgICAgICAgICAgICAgICAgICB0aGlzLnN1Ykljb25CdXR0b25zW251bUJ1dHRvbnMgLSAyXS5zZXRSaWdodExpbmVIb3Zlcih0cnVlKTsKKyAgICAgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICAgICAgICAgIHRoaXMuc3ViSWNvbkJ1dHRvbnNbbnVtQnV0dG9ucyAtIDFdLnNldExlZnRMaW5lSG92ZXIodHJ1ZSk7CisKKyAgICAgICAgICAgICAgICB0aGlzLnN1Ykljb25CdXR0b25zW251bUJ1dHRvbnMgLSAyXS5zZXRCdXR0b25UeXBlKGljb25TdGF0ZUNvbnN0YW50cy5ORVhUX1RPX0RST1BET1dOKTsKKyAgICAgICAgICAgIH1lbHNleworICAgICAgICAgICAgICAgIAorICAgICAgICAgICAgICAgIHRoaXMuc3ViSWNvbkJ1dHRvbnNbbnVtQnV0dG9ucyAtIDFdLnNldExlZnRMaW5lSG92ZXIoZmFsc2UpOworICAgICAgICAgICAgICAgIHRoaXMuc3ViSWNvbkJ1dHRvbnNbbnVtQnV0dG9ucyAtIDJdLnNldEJ1dHRvblR5cGUoaWNvblN0YXRlQ29uc3RhbnRzLk1JRERMRSk7CisgICAgICAgICAgICB9CisKKyAgICAgICAgfWVsc2V7CisKKyAgICAgICAgICAgIGlmKGlzRHJvcERvd25PcGVuKXsKKyAgICAgICAgICAgICAgICB0aGlzLnN1Ykljb25CdXR0b25zWzBdLnNldFJpZ2h0TGluZUhvdmVyKHRydWUpOworICAgICAgICAgICAgICAgIHRoaXMuc3ViSWNvbkJ1dHRvbnNbMF0uc2V0QnV0dG9uVHlwZShpY29uU3RhdGVDb25zdGFudHMuTEVGVF9ORVhUX1RPX0RST1BET1dOKTsKKyAgICAgICAgICAgIH1lbHNleworICAgICAgICAgICAgICAgIHRoaXMuc3ViSWNvbkJ1dHRvbnNbMF0uc2V0QnV0dG9uVHlwZShpY29uU3RhdGVDb25zdGFudHMuTEVGVCk7CisgICAgICAgICAgICB9CisgICAgICAgIH0KKworICAgIH07CisKK31dKQorLmRpcmVjdGl2ZSgnYXR0U3BsaXRJY29uQnV0dG9uR3JvdXAnLCBbJyRkb2N1bWVudCcsICckdGltZW91dCcsICAnaWNvblN0YXRlQ29uc3RhbnRzJyAsZnVuY3Rpb24oJGRvY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JJY29uQnV0dG9uQ3RybHNbbGVmdE1vc3RCdXR0b25JbmRleF0uaXNMZWZ0TGluZVNob3duKGZhbHNlKTsKKyAgICAgICAgICAgICAgICBzdWJJY29uQnV0dG9uQ3RybHNbbGVmdE1vc3RCdXR0b25JbmRleF0uaXNSaWdodExpbmVTaG93bih0cnVlKTsKKworICAgICAgICAgICAgICAgIC8vcmlnaHQgbW9zdCBidXR0b24gY29uZmlnCisgICAgICAgICAgICAgICAgc3ViSWNvbkJ1dHRvbkN0cmxzW3JpZ2h0TW9zdEJ1dHRvbkluZGV4XS5zZXRCdXR0b25UeXBlKGljb25TdGF0ZUNvbnN0YW50cy5SSUdIVCk7CisgICAgICAgICAgICAgICAgc3ViSWNvbkJ1dHRvbkN0cmxzW3JpZ2h0TW9zdEJ1dHRvbkluZGV4XS5pc1JpZ2h0TGluZVNob3duKGZhbHNlKTsKKyAgICAgICAgICAgICAgICBzdWJJY29uQnV0dG9uQ3RybHNbcmlnaHRNb3N0QnV0dG9uSW5kZXhdLmlzTGVmdExpbmVTaG93bihmYWxzZSk7CisKKyAgICAgICAgICAgICAgICAvL21pZGRsZSBidXR0b25zIGNvbmZpZworICAgICAgICAgICAgICAgIGlmKHJpZ2h0TW9zdEJ1dHRvbkluZGV4ID49IDIpeworICAgICAgICAgICAgICAgICAgICB2YXIgaW5kZXggPSAxOworICAgICAgICAgICAgICAgICAgICB3aGlsZShpbmRleCA8IHJpZ2h0TW9zdEJ1dHRvbkluZGV4KXsKKyAgICAgICAgICAgICAgICAgICAgICAgIHN1Ykljb25CdXR0b25DdHJsc1tpbmRleF0uc2V0QnV0dG9uVHlwZShpY29uU3RhdGVDb25zdGFudHMuTUlERExFKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIHN1Ykljb25CdXR0b25DdHJsc1tpbmRleF0uaXNSaWdodExpbmVTaG93bihmYWxzZSk7CisgICAgICAgICAgICAgICAgICAgICAgICBzdWJJY29uQnV0dG9uQ3RybHNbaW5kZXhdLmlzTGVmdExpbmVTaG93bihmYWxzZSk7CisgICAgICAgICAgICAgICAgICAgICAgICBpbmRleCsrOworICAgICAgICAgICAgICAgICAgICB9CisKKyAgICAgICAgICAgICAgICAgICAgdmFyIHNraXBJbmRleCA9IDI7CisgICAgICAgICAgICAgICAgICAgIHdoaWxlKHNraXBJbmRleCA8PSByaWdodE1vc3RCdXR0b25JbmRleCl7CisgICAgICAgICAgICAgICAgICAgICAgICBpZihza2lwSW5kZXggPT0gcmlnaHRNb3N0QnV0dG9uSW5kZXgpeworICAgICAgICAgICAgICAgICAgICAgICAgICAgIHN1Ykljb25CdXR0b25DdHJsc1tza2lwSW5kZXhdLmlzTGVmdExpbmVTaG93bih0cnVlKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIH1lbHNleworICAgICAgICAgICAgICAgICAgICAgICAgICAgIHN1Ykljb25CdXR0b25DdHJsc1tza2lwSW5kZXhdLmlzUmlnaHRMaW5lU2hvd24odHJ1ZSk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgc3ViSWNvbkJ1dHRvbkN0cmxzW3NraXBJbmRleF0uaXNMZWZ0TGluZVNob3duKHRydWUpOyAKKyAgICAgICAgICAgICAgICAgICAgICAgIH0gCisgICAgICAgICAgICAgICAgICAgICAgICBza2lwSW5kZXggPSBza2lwSW5kZXggKyAyOworICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgfQorCisgICAgICAgICAgICAgICAgLy9yZXBvc2l0aW9uIHRoZSBkcm9wZG93bgorICAgICAgICAgICAgICAgIHZhciB1bEVsZW0gPSBlbGVtZW50LmZpbmQoJ3VsJyk7CisgICAgICAgICAgICAgICAgaWYodWxFbGVtLmxlbmd0aCA+IDApeworICAgICAgICAgICAgICAgICAgICB2YXIgbnVtQnV0dG9ucyA9IHJpZ2h0TW9zdEJ1dHRvbkluZGV4KzE7CisgICAgICAgICAgICAgICAgICAgIGlmKG51bUJ1dHRvbnMgPiAyKXsKKyAgICAgICAgICAgICAgICAgICAgICAgIHZhciBvZmZzZXQgPSAobnVtQnV0dG9ucykqMzQtNzArKG51bUJ1dHRvbnMvMS41KSArIDAuNTsKKyAgICAgICAgICAgICAgICAgICAgICAgIHZhciBvZmZTZXRTdHIgPSBvZmZzZXQrJ3B4JzsKKyAgICAgICAgICAgICAgICAgICAgICAgIGFuZ3VsYXIuZWxlbWVudCh1bEVsZW0pLmNzcygnbGVmdCcsb2ZmU2V0U3RyKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIGFuZ3VsYXIuZWxlbWVudCh1bEVsZW0pLmNzcygnYm9yZGVyLXRvcC1sZWZ0LXJhZGl1cycsJzBweCcpOworICAgICAgICAgICAgICAgICAgICB9ZWxzZXsKKyAgICAgICAgICAgICAgICAgICAgICAgIGFuZ3VsYXIuZWxlbWVudCh1bEVsZW0pLmNzcygnbGVmdCcsJzBweCcpOworICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgfQorfV0pOworCithbmd1bGFyLm1vZHVsZSgnYXR0LmFicy5zdGVwU2xpZGVyJywgWydhdHQuYWJzLnBvc2l0aW9uJ10pCisgICAgICAgIC5jb25zdGFudCgnc2xpZGVyQ29uc3RhbnRzJywgeworICAgICAgICAgICAgLyoKKyAgICAgICAgICAgICBUaGUgTUlUIExpY2Vuc2UgKE1JVCkKKyAgICAgICAgICAgICBDb3B5cmlnaHQgKGMpIDIwMTMgSnVsaWVuIFZhbMOpcnkKKyAgICAgICAgICAgICAqLworICAgICAgICAgICAgU0xJREVSOiB7CisgICAgICAgICAgICAgICAgc2V0dGluZ3M6IHsKKyAgICAgICAgICAgICAgICAgICAgZnJvbTogMSwKKyAgICAgICAgICAgICAgICAgICAgdG86IDQwLAorICAgICAgICAgICAgICAgICAgICBzdGVwOiAxLAorICAgICAgICAgICAgICAgICAgICBzbW9vdGg6IHRydWUsCisgICAgICAgICAgICAgICAgICAgIGxpbWl0czogdHJ1ZSwKKyAgICAgICAgICAgICAgICAgICAgdmFsdWU6ICIzIiwKKyAgICAgICAgICAgICAgICAgICAgZGltZW5zaW9uOiAiIiwKKyAgICAgICAgICAgICAgICAgICAgdmVydGljYWw6IGZhbHNlCisgICAgICAgICAgICAgICAgfSwKKyAgICAgICAgICAgICAgICBjbGFzc05hbWU6ICJqc2xpZGVyIiwKKyAgICAgICAgICAgICAgICBzZWxlY3RvcjogIi5qc2xpZGVyLSIKKyAgICAgICAgICAgIH0sCisgICAgICAgICAgICBFVkVOVFM6IHsKKyAgICAgICAgICAgIH0sCisgICAgICAgICAgICBDT0xPUlM6IHsKKyAgICAgICAgICAgICAgICBHUkVFTjogJ2dyZWVuJywKKyAgICAgICAgICAgICAgICBCTFVFX0hJR0hMSUdIVDogJ2JsdWUnLAorICAgICAgICAgICAgICAgIE1BR0VOVEE6ICdtYWdlbnRhJywKKyAgICAgICAgICAgICAgICBHT0xEOiAnZ29sZCcsCisgICAgICAgICAgICAgICAgUFVSUExFOiAncHVycGxlJywKKyAgICAgICAgICAgICAgICBEQVJLX0JMVUU6ICdkYXJrLWJsdWUnLAorICAgICAgICAgICAgICAgIFJFR1VMQVI6ICdyZWd1bGFyJywKKyAgICAgICAgICAgICAgICBXSElURTogJ3doaXRlJworICAgICAgICAgICAgfQorICAgICAgICB9KQorICAgICAgICAuZmFjdG9yeSgndXRpbHMnLCBmdW5jdGlvbiAoKSB7CisgICAgICAgICAgICAvKgorICAgICAgICAgICAgIFRoZSBNSVQgTGljZW5zZSAoTUlUKQorICAgICAgICAgICAgIENvcHlyaWdodCAoYykgMjAxMyBKdWxpZW4gVmFsw6lyeQorICAgICAgICAgICAgICovCisgICAgICAgICAgICByZXR1cm4geworICAgICAgICAgICAgICAgIG9mZnNldDogZnVuY3Rpb24gKGVsbSkgeworICAgICAgICAgICAgICAgICAgICB2YXIgcmF3RG9tID0gZWxtWzBdOworICAgICAgICAgICAgICAgICAgICB2YXIgX3ggPSAwOworICAgICAgICAgICAgICAgICAgICB2YXIgX3kgPSAwOworICAgICAgICAgICAgICAgICAgICB2YXIgYm9keSA9IGRvY3VtZW50LmRvY3VtZW50RWxlbWVudCB8fCBkb2N1bWVudC5ib2R5OworICAgICAgICAgICAgICAgICAgICB2YXIgc2Nyb2xsWCA9IHdpbmRvdy5wYWdlWE9mZnNldCB8fCBib2R5LnNjcm9sbExlZnQ7CisgICAgICAgICAgICAgICAgICAgIHZhciBzY3JvbGxZID0gd2luZG93LnBhZ2VZT2Zmc2V0IHx8IGJvZHkuc2Nyb2xsVG9wOworICAgICAgICAgICAgICAgICAgICBfeCA9IHJhd0RvbS5nZXRCb3VuZGluZ0NsaWVudFJlY3QoKS5sZWZ0ICsgc2Nyb2xsWDsKKyAgICAgICAgICAgICAgICAgICAgX3kgPSByYXdEb20uZ2V0Qm91bmRpbmdDbGllbnRSZWN0KCkudG9wICsgc2Nyb2xsWTsKKyAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHtsZWZ0OiBfeCwgdG9wOiBfeX07CisgICAgICAgICAgICAgICAgfSwKKyAgICAgICAgICAgICAgICByb3VuZFVwVG9TY2FsZTogZnVuY3Rpb24gKG1vdXNlUHJjLCBzY2FsZSwgY3V0T2ZmV2lkdGgsIGN1dE9mZkluZGV4KSB7CisgICAgICAgICAgICAgICAgICAgIHZhciBsb3dlclZhbDsKKyAgICAgICAgICAgICAgICAgICAgdmFyIGhpZ2hlclZhbDsKKyAgICAgICAgICAgICAgICAgICAgdmFyIG5ld01vdXNlUHJjOworICAgICAgICAgICAgICAgICAgICB2YXIgbWlkZGxlOworCisgICAgICAgICAgICAgICAgICAgIGZvciAodmFyIGluZGV4ID0gMTsgaW5kZXggPCBzY2FsZS5sZW5ndGg7IGluZGV4KyspIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIGxvd2VyVmFsID0gc2NhbGVbaW5kZXggLSAxXTsKKyAgICAgICAgICAgICAgICAgICAgICAgIGhpZ2hlclZhbCA9IHNjYWxlW2luZGV4XTsKKyAgICAgICAgICAgICAgICAgICAgICAgIG1pZGRsZSA9ICgoaGlnaGVyVmFsIC0gbG93ZXJWYWwpICogLjUpICsgbG93ZXJWYWw7CisgICAgICAgICAgICAgICAgICAgICAgICAvKgorICAgICAgICAgICAgICAgICAgICAgICAgIEhhbmRsZXMgYSBzaXR1YXRpb24gd2hlcmUgdGhlIHVzZXIgY2xpY2tzIGNsb3NlIHRvIHRoZSBzdGFydCBwb2ludCBvZgorICAgICAgICAgICAgICAgICAgICAgICAgIHRoZSBzbGlkZXIgYnV0IHRoZSBwb2ludGVyIGRvZXNuJ3QgbW92ZQorICAgICAgICAgICAgICAgICAgICAgICAgICovCisgICAgICAgICAgICAgICAgICAgICAgICBpZiAoKGxvd2VyVmFsID09PSAwICYmIG1vdXNlUHJjIDw9IG1pZGRsZSkgfHwgY2hlY2tFcXVhbGl0eShsb3dlclZhbCwgbW91c2VQcmMpKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgbmV3TW91c2VQcmMgPSBsb3dlclZhbDsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgIGVsc2UgaWYgKGxvd2VyVmFsIDwgbW91c2VQcmMgJiYgKG1vdXNlUHJjIDwgaGlnaGVyVmFsIHx8CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNoZWNrRXF1YWxpdHkobW91c2VQcmMsIGhpZ2hlclZhbCkpKQorICAgICAgICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgIG5ld01vdXNlUHJjID0gaGlnaGVyVmFsOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgIC8vQ2hlY2sgaWYgdGhlIG5ld01vdXNlUHJjIGlzIDw9IHRoZSBjdXR0T2ZmUG9pbnQKKyAgICAgICAgICAgICAgICAgICAgaWYgKGN1dE9mZldpZHRoICYmIG5ld01vdXNlUHJjIDwgY3V0T2ZmV2lkdGgpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBzY2FsZVtjdXRPZmZJbmRleF07CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgZWxzZSB7CisgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gbmV3TW91c2VQcmM7CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgLyoKKyAgICAgICAgICAgICAgICAgICAgIENoZWNrcyB0byBzZWUgaWYgMiBwb2ludHMgYXJlIHNvIGNsb3NlIHRoYXQgdGhleSBhcmUKKyAgICAgICAgICAgICAgICAgICAgIGJhc2ljYWxseSBlcXVhbC4KKyAgICAgICAgICAgICAgICAgICAgICovCisgICAgICAgICAgICAgICAgICAgIGZ1bmN0aW9uIGNoZWNrRXF1YWxpdHkocG9pbnQxLCBwb2ludDIpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIHZhciBwcmVjaXNpb24gPSAwLjE7CisgICAgICAgICAgICAgICAgICAgICAgICBpZiAoTWF0aC5hYnMocG9pbnQyIC0gcG9pbnQxKSA8PSBwcmVjaXNpb24pIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gdHJ1ZTsKKyAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBmYWxzZTsKKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIH0sCisgICAgICAgICAgICAgICAgdmFsdWVGb3JEaWZmZXJlbnRTY2FsZTogZnVuY3Rpb24gKGZyb20sIHRvLCBwcmMsIHByY1RvVmFsdWVNYXBwZXIpIHsKKyAgICAgICAgICAgICAgICAgICAgdmFyIGRlY2ltYWxQcmMgPSBwcmMgLyAxMDA7CisgICAgICAgICAgICAgICAgICAgIGlmIChkZWNpbWFsUHJjID09PSAwKSB7CisgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gZnJvbTsKKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICByZXR1cm4gcHJjVG9WYWx1ZU1hcHBlcltwcmNdOworICAgICAgICAgICAgICAgIH0sCisgICAgICAgICAgICAgICAgZ2V0Q29udmVyc2lvbkZhY3RvclZhbHVlOiBmdW5jdGlvbiAodmFsdWUsIGNvbnZlcnNpb24sIGZpcnN0RGltZW5zaW9uKSB7CisgICAgICAgICAgICAgICAgICAgIC8qCisgICAgICAgICAgICAgICAgICAgICBMb29wIHRocm91Z2ggdGhlIGNvbnZlcnNpb24gYXJyYXkgYW5kIGtlZXAgY2hlY2tpbmcgdGhlCisgICAgICAgICAgICAgICAgICAgICBzdGFydFZhbAorICAgICAgICAgICAgICAgICAgICAgKi8KKyAgICAgICAgICAgICAgICAgICAgaWYgKHZhbHVlIDw9IGNvbnZlcnNpb25bMF0uc3RhcnRWYWwpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybnsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBzY2FsZWRWYWw6IHZhbHVlLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNjYWxlZERpbWVuc2lvbjogZmlyc3REaW1lbnNpb24KKyAgICAgICAgICAgICAgICAgICAgICAgIH07CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgdmFyIGVuZEluZGV4ID0gMDsKKyAgICAgICAgICAgICAgICAgICAgZm9yICh2YXIgaW5kZXggaW4gY29udmVyc2lvbikgeworICAgICAgICAgICAgICAgICAgICAgICAgdmFyIGMgPSBjb252ZXJzaW9uW2luZGV4XTsKKyAgICAgICAgICAgICAgICAgICAgICAgIGlmICh2YWx1ZSA+IGMuc3RhcnRWYWwpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBlbmRJbmRleCA9IGluZGV4OworICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgIHZhciBzY2FsZUZhY3RvciA9IGNvbnZlcnNpb25bZW5kSW5kZXhdLnNjYWxlRmFjdG9yOworICAgICAgICAgICAgICAgICAgICB2YXIgc2NhbGVkVmFsID0gdmFsdWUgLyBzY2FsZUZhY3RvcjsKKyAgICAgICAgICAgICAgICAgICAgdmFyIHNjYWxlZERpbWVuc2lvbiA9IGNvbnZlcnNpb25bZW5kSW5kZXhdLmRpbWVuc2lvbjsKKyAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIHNjYWxlZFZhbDogc2NhbGVkVmFsLAorICAgICAgICAgICAgICAgICAgICAgICAgc2NhbGVkRGltZW5zaW9uOiBzY2FsZWREaW1lbnNpb24KKyAgICAgICAgICAgICAgICAgICAgfTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9OworICAgICAgICB9KQorICAgICAgICAuZmFjdG9yeSgnc2xpZGVyRHJhZ2dhYmxlJywgWyd1dGlscycsIGZ1bmN0aW9uICh1dGlscykgeworICAgICAgICAgICAgICAgIC8qCisgICAgICAgICAgICAgICAgIFRoZSBNSVQgTGljZW5zZSAoTUlUKQorICAgICAgICAgICAgICAgICBDb3B5cmlnaHQgKGMpIDIwMTMgSnVsaWVuIFZhbMOpcnkKKyAgICAgICAgICAgICAgICAgKi8KKyAgICAgICAgICAgICAgICBmdW5jdGlvbiBEcmFnZ2FibGUoKSB7CisgICAgICAgICAgICAgICAgICAgIHRoaXMuX2luaXQuYXBwbHkodGhpcywgYXJndW1lbnRzKTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgRHJhZ2dhYmxlLnByb3RvdHlwZS5vbmluaXQgPSBmdW5jdGlvbiAoKSB7CisgICAgICAgICAgICAgICAgfTsKKyAgICAgICAgICAgICAgICBEcmFnZ2FibGUucHJvdG90eXBlLmV2ZW50cyA9IGZ1bmN0aW9uICgpIHsKKyAgICAgICAgICAgICAgICB9OworICAgICAgICAgICAgICAgIERyYWdnYWJsZS5wcm90b3R5cGUub25tb3VzZWRvd24gPSBmdW5jdGlvbiAoKSB7CisgICAgICAgICAgICAgICAgICAgIHRoaXMucHRyLmNzcyh7cG9zaXRpb246ICJhYnNvbHV0ZSJ9KTsKKyAgICAgICAgICAgICAgICB9OworICAgICAgICAgICAgICAgIERyYWdnYWJsZS5wcm90b3R5cGUub25tb3VzZW1vdmUgPSBmdW5jdGlvbiAoZXZ0LCB4LCB5KSB7CisgICAgICAgICAgICAgICAgICAgIHRoaXMucHRyLmNzcyh7bGVmdDogeCwgdG9wOiB5fSk7CisgICAgICAgICAgICAgICAgfTsKKyAgICAgICAgICAgICAgICBEcmFnZ2FibGUucHJvdG90eXBlLm9ubW91c2V1cCA9IGZ1bmN0aW9uICgpIHsKKyAgICAgICAgICAgICAgICB9OworICAgICAgICAgICAgICAgIERyYWdnYWJsZS5wcm90b3R5cGUuaXNEZWZhdWx0ID0geworICAgICAgICAgICAgICAgICAgICBkcmFnOiBmYWxzZSwKKyAgICAgICAgICAgICAgICAgICAgY2xpY2tlZDogZmFsc2UsCisgICAgICAgICAgICAgICAgICAgIHRvY2xpY2s6IHRydWUsCisgICAgICAgICAgICAgICAgICAgIG1vdXNldXA6IGZhbHNlCisgICAgICAgICAgICAgICAgfTsKKyAgICAgICAgICAgICAgICBEcmFnZ2FibGUucHJvdG90eXBlLl9pbml0ID0gZnVuY3Rpb24gKCkgeworICAgICAgICAgICAgICAgICAgICBpZiAoYXJndW1lbnRzLmxlbmd0aCA+IDApIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIHRoaXMucHRyID0gYXJndW1lbnRzWzBdOworICAgICAgICAgICAgICAgICAgICAgICAgdGhpcy5wYXJlbnQgPSBhcmd1bWVudHNbMl07CisgICAgICAgICAgICAgICAgICAgICAgICBpZiAoIXRoaXMucHRyKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuOworICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgdGhpcy5pcyA9IHt9OworICAgICAgICAgICAgICAgICAgICAgICAgYW5ndWxhci5leHRlbmQodGhpcy5pcywgdGhpcy5pc0RlZmF1bHQpOworICAgICAgICAgICAgICAgICAgICAgICAgdmFyIG9mZnNldCA9IHV0aWxzLm9mZnNldCh0aGlzLnB0cik7CisgICAgICAgICAgICAgICAgICAgICAgICB0aGlzLmQgPSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgbGVmdDogb2Zmc2V0LmxlZnQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgdG9wOiBvZmZzZXQudG9wLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIHdpZHRoOiB0aGlzLnB0clswXS5jbGllbnRXaWR0aCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBoZWlnaHQ6IHRoaXMucHRyWzBdLmNsaWVudEhlaWdodAorICAgICAgICAgICAgICAgICAgICAgICAgfTsKKyAgICAgICAgICAgICAgICAgICAgICAgIHRoaXMub25pbml0LmFwcGx5KHRoaXMsIGFyZ3VtZW50cyk7CisgICAgICAgICAgICAgICAgICAgICAgICB0aGlzLl9ldmVudHMoKTsKKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIH07CisgICAgICAgICAgICAgICAgRHJhZ2dhYmxlLnByb3RvdHlwZS5fZ2V0UGFnZUNvb3JkcyA9IGZ1bmN0aW9uIChldmVudCkgeworICAgICAgICAgICAgICAgICAgICB2YXIgdmFsdWUgPSB7fTsKKyAgICAgICAgICAgICAgICAgICAgaWYgKGV2ZW50LnRhcmdldFRvdWNoZXMgJiYgZXZlbnQudGFyZ2V0VG91Y2hlc1swXSkgeworICAgICAgICAgICAgICAgICAgICAgICAgdmFsdWUgPSB7eDogZXZlbnQudGFyZ2V0VG91Y2hlc1swXS5wYWdlWCwgeTogZXZlbnQudGFyZ2V0VG91Y2hlc1swXS5wYWdlWX07CisgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICAgICAgICAgICAgICB2YWx1ZSA9IHt4OiBldmVudC5wYWdlWCwgeTogZXZlbnQucGFnZVl9OworICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgIHJldHVybiB2YWx1ZTsKKyAgICAgICAgICAgICAgICB9OworICAgICAgICAgICAgICAgIERyYWdnYWJsZS5wcm90b3R5cGUuX2JpbmRFdmVudCA9IGZ1bmN0aW9uIChwdHIsIGV2ZW50VHlwZSwgaGFuZGxlcikgeworICAgICAgICAgICAgICAgICAgICBpZiAodGhpcy5zdXBwb3J0VG91Y2hlc18pIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIHB0clswXS5hdHRhY2hFdmVudCh0aGlzLmV2ZW50c19bIGV2ZW50VHlwZSBdLCBoYW5kbGVyKTsKKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICBlbHNlIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIGlmIChwdHIuYmluZCkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgIHB0ci5iaW5kKHRoaXMuZXZlbnRzX1sgZXZlbnRUeXBlIF0sIGhhbmRsZXIpOworICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgfTsKKyAgICAgICAgICAgICAgICBEcmFnZ2FibGUucHJvdG90eXBlLl9ldmVudHMgPSBmdW5jdGlvbiAoKSB7CisgICAgICAgICAgICAgICAgICAgIHZhciBzZWxmID0gdGhpczsKKyAgICAgICAgICAgICAgICAgICAgdGhpcy5zdXBwb3J0VG91Y2hlc18gPSAnb250b3VjaGVuZCcgaW4gZG9jdW1lbnQ7CisgICAgICAgICAgICAgICAgICAgIHRoaXMuZXZlbnRzXyA9IHsKKyAgICAgICAgICAgICAgICAgICAgICAgICJjbGljayI6IHRoaXMuc3VwcG9ydFRvdWNoZXNfID8gInRvdWNoc3RhcnQiIDogImNsaWNrIiwKKyAgICAgICAgICAgICAgICAgICAgICAgICJkb3duIjogdGhpcy5zdXBwb3J0VG91Y2hlc18gPyAidG91Y2hzdGFydCIgOiAibW91c2Vkb3duIiwKKyAgICAgICAgICAgICAgICAgICAgICAgICJtb3ZlIjogdGhpcy5zdXBwb3J0VG91Y2hlc18gPyAidG91Y2htb3ZlIiA6ICJtb3VzZW1vdmUiLAorICAgICAgICAgICAgICAgICAgICAgICAgInVwIjogdGhpcy5zdXBwb3J0VG91Y2hlc18gPyAidG91Y2hlbmQiIDogIm1vdXNldXAiLAorICAgICAgICAgICAgICAgICAgICAgICAgIm1vdXNlZG93biI6IHRoaXMuc3VwcG9ydFRvdWNoZXNfID8gIm1vdXNlZG93biIgOiAibW91c2Vkb3duIgorICAgICAgICAgICAgICAgICAgICB9OworICAgICAgICAgICAgICAgICAgICB2YXIgZG9jdW1lbnRFbHQgPSBhbmd1bGFyLmVsZW1lbnQod2luZG93LmRvY3VtZW50KTsKKyAgICAgICAgICAgICAgICAgICAgdGhpcy5fYmluZEV2ZW50KGRvY3VtZW50RWx0LCAibW92ZSIsIGZ1bmN0aW9uIChldmVudCkgeworICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHNlbGYuaXMuZHJhZykgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGV2ZW50LnN0b3BQcm9wYWdhdGlvbigpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGV2ZW50LnByZXZlbnREZWZhdWx0KCk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKCFzZWxmLnBhcmVudC5kaXNhYmxlZCkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzZWxmLl9tb3VzZW1vdmUoZXZlbnQpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgfSk7CisgICAgICAgICAgICAgICAgICAgIHRoaXMuX2JpbmRFdmVudChkb2N1bWVudEVsdCwgImRvd24iLCBmdW5jdGlvbiAoZXZlbnQpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIGlmIChzZWxmLmlzLmRyYWcpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBldmVudC5zdG9wUHJvcGFnYXRpb24oKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBldmVudC5wcmV2ZW50RGVmYXVsdCgpOworICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICB9KTsKKyAgICAgICAgICAgICAgICAgICAgdGhpcy5fYmluZEV2ZW50KGRvY3VtZW50RWx0LCAidXAiLCBmdW5jdGlvbiAoZXZlbnQpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIHNlbGYuX21vdXNldXAoZXZlbnQpOworICAgICAgICAgICAgICAgICAgICB9KTsKKyAgICAgICAgICAgICAgICAgICAgdGhpcy5fYmluZEV2ZW50KHRoaXMucHRyLCAiZG93biIsIGZ1bmN0aW9uIChldmVudCkgeworICAgICAgICAgICAgICAgICAgICAgICAgc2VsZi5fbW91c2Vkb3duKGV2ZW50KTsKKyAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBmYWxzZTsKKyAgICAgICAgICAgICAgICAgICAgfSk7CisgICAgICAgICAgICAgICAgICAgIHRoaXMuX2JpbmRFdmVudCh0aGlzLnB0ciwgInVwIiwgZnVuY3Rpb24gKGV2ZW50KSB7CisgICAgICAgICAgICAgICAgICAgICAgICBzZWxmLl9tb3VzZXVwKGV2ZW50KTsKKyAgICAgICAgICAgICAgICAgICAgfSk7CisgICAgICAgICAgICAgICAgICAgIHRoaXMuZXZlbnRzKCk7CisgICAgICAgICAgICAgICAgfTsKKyAgICAgICAgICAgICAgICBEcmFnZ2FibGUucHJvdG90eXBlLl9tb3VzZWRvd24gPSBmdW5jdGlvbiAoZXZ0KSB7CisgICAgICAgICAgICAgICAgICAgIHRoaXMuaXMuZHJhZyA9IHRydWU7CisgICAgICAgICAgICAgICAgICAgIHRoaXMuaXMuY2xpY2tlZCA9IGZhbHNlOworICAgICAgICAgICAgICAgICAgICB0aGlzLmlzLm1vdXNldXAgPSBmYWxzZTsKKyAgICAgICAgICAgICAgICAgICAgdmFyIGNvb3JkcyA9IHRoaXMuX2dldFBhZ2VDb29yZHMoZXZ0KTsKKyAgICAgICAgICAgICAgICAgICAgdGhpcy5jeCA9IGNvb3Jkcy54IC0gdGhpcy5wdHJbMF0ub2Zmc2V0TGVmdDsKKyAgICAgICAgICAgICAgICAgICAgdGhpcy5jeSA9IGNvb3Jkcy55IC0gdGhpcy5wdHJbMF0ub2Zmc2V0VG9wOworICAgICAgICAgICAgICAgICAgICBhbmd1bGFyLmV4dGVuZCh0aGlzLmQsIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIGxlZnQ6IHRoaXMucHRyWzBdLm9mZnNldExlZnQsCisgICAgICAgICAgICAgICAgICAgICAgICB0b3A6IHRoaXMucHRyWzBdLm9mZnNldFRvcCwKKyAgICAgICAgICAgICAgICAgICAgICAgIHdpZHRoOiB0aGlzLnB0clswXS5jbGllbnRXaWR0aCwKKyAgICAgICAgICAgICAgICAgICAgICAgIGhlaWdodDogdGhpcy5wdHJbMF0uY2xpZW50SGVpZ2h0CisgICAgICAgICAgICAgICAgICAgIH0pOworICAgICAgICAgICAgICAgICAgICBpZiAodGhpcy5vdXRlciAmJiB0aGlzLm91dGVyLmdldCgwKSkgeworICAgICAgICAgICAgICAgICAgICAgICAgdGhpcy5vdXRlci5jc3Moe2hlaWdodDogTWF0aC5tYXgodGhpcy5vdXRlci5oZWlnaHQoKSwgJChkb2N1bWVudC5ib2R5KS5oZWlnaHQoKSksIG92ZXJmbG93OiAiaGlkZGVuIn0pOworICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgIHRoaXMub25tb3VzZWRvd24oZXZ0KTsKKyAgICAgICAgICAgICAgICB9OworICAgICAgICAgICAgICAgIERyYWdnYWJsZS5wcm90b3R5cGUuX21vdXNlbW92ZSA9IGZ1bmN0aW9uIChldnQpIHsKKyAgICAgICAgICAgICAgICAgICAgaWYgKHRoaXMudWlkID09PSAwKSB7CisgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm47CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgdGhpcy5pcy50b2NsaWNrID0gZmFsc2U7CisgICAgICAgICAgICAgICAgICAgIHZhciBjb29yZHMgPSB0aGlzLl9nZXRQYWdlQ29vcmRzKGV2dCk7CisgICAgICAgICAgICAgICAgICAgIHRoaXMub25tb3VzZW1vdmUoZXZ0LCBjb29yZHMueCAtIHRoaXMuY3gsIGNvb3Jkcy55IC0gdGhpcy5jeSk7CisgICAgICAgICAgICAgICAgfTsKKyAgICAgICAgICAgICAgICBEcmFnZ2FibGUucHJvdG90eXBlLl9tb3VzZXVwID0gZnVuY3Rpb24gKGV2dCkgeworICAgICAgICAgICAgICAgICAgICBpZiAodGhpcy5pcy5kcmFnKSB7CisgICAgICAgICAgICAgICAgICAgICAgICB0aGlzLmlzLmRyYWcgPSBmYWxzZTsKKyAgICAgICAgICAgICAgICAgICAgICAgIGlmICh0aGlzLm91dGVyICYmIHRoaXMub3V0ZXIuZ2V0KDApKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKCQuYnJvd3Nlci5tb3ppbGxhKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRoaXMub3V0ZXIuY3NzKHtvdmVyZmxvdzogImhpZGRlbiJ9KTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0aGlzLm91dGVyLmNzcyh7b3ZlcmZsb3c6ICJ2aXNpYmxlIn0pOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoJC5icm93c2VyLm1zaWUgJiYgJC5icm93c2VyLnZlcnNpb24gPT09ICc2LjAnKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRoaXMub3V0ZXIuY3NzKHtoZWlnaHQ6ICIxMDAlIn0pOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRoaXMub3V0ZXIuY3NzKHtoZWlnaHQ6ICJhdXRvIn0pOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgIHRoaXMub25tb3VzZXVwKGV2dCk7CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICB9OworICAgICAgICAgICAgICAgIHJldHVybiBEcmFnZ2FibGU7CisgICAgICAgICAgICB9XSkKKyAgICAgICAgLmZhY3RvcnkoJ3NsaWRlclBvaW50ZXInLCBbJ3NsaWRlckRyYWdnYWJsZScsICd1dGlscycsIGZ1bmN0aW9uIChEcmFnZ2FibGUsIHV0aWxzKSB7CisgICAgICAgICAgICAgICAgLyoKKyAgICAgICAgICAgICAgICAgVGhlIE1JVCBMaWNlbnNlIChNSVQpCisgICAgICAgICAgICAgICAgIENvcHlyaWdodCAoYykgMjAxMyBKdWxpZW4gVmFsw6lyeQorICAgICAgICAgICAgICAgICAqLworICAgICAgICAgICAgICAgIGZ1bmN0aW9uIFNsaWRlclBvaW50ZXIoKSB7CisgICAgICAgICAgICAgICAgICAgIERyYWdnYWJsZS5hcHBseSh0aGlzLCBhcmd1bWVudHMpOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICBTbGlkZXJQb2ludGVyLnByb3RvdHlwZSA9IG5ldyBEcmFnZ2FibGUoKTsKKyAgICAgICAgICAgICAgICBTbGlkZXJQb2ludGVyLnByb3RvdHlwZS5vbmluaXQgPSBmdW5jdGlvbiAocHRyLCBpZCwgX2NvbnN0cnVjdG9yKSB7CisgICAgICAgICAgICAgICAgICAgIHRoaXMudWlkID0gaWQ7CisgICAgICAgICAgICAgICAgICAgIHRoaXMucGFyZW50ID0gX2NvbnN0cnVjdG9yOworICAgICAgICAgICAgICAgICAgICB0aGlzLnZhbHVlID0ge307CisgICAgICAgICAgICAgICAgICAgIHRoaXMuc2V0dGluZ3MgPSBhbmd1bGFyLmNvcHkoX2NvbnN0cnVjdG9yLnNldHRpbmdzKTsKKyAgICAgICAgICAgICAgICB9OworICAgICAgICAgICAgICAgIFNsaWRlclBvaW50ZXIucHJvdG90eXBlLm9ubW91c2Vkb3duID0gZnVuY3Rpb24gKGV2dCkgeworICAgICAgICAgICAgICAgICAgICB2YXIgb2ZmID0gdXRpbHMub2Zmc2V0KHRoaXMucGFyZW50LmRvbU5vZGUpOworICAgICAgICAgICAgICAgICAgICB2YXIgb2Zmc2V0ID0geworICAgICAgICAgICAgICAgICAgICAgICAgbGVmdDogb2ZmLmxlZnQsCisgICAgICAgICAgICAgICAgICAgICAgICB0b3A6IG9mZi50b3AsCisgICAgICAgICAgICAgICAgICAgICAgICB3aWR0aDogdGhpcy5wYXJlbnQuZG9tTm9kZVswXS5jbGllbnRXaWR0aCwKKyAgICAgICAgICAgICAgICAgICAgICAgIGhlaWdodDogdGhpcy5wYXJlbnQuZG9tTm9kZVswXS5jbGllbnRIZWlnaHQKKyAgICAgICAgICAgICAgICAgICAgfTsKKyAgICAgICAgICAgICAgICAgICAgdGhpcy5fcGFyZW50ID0geworICAgICAgICAgICAgICAgICAgICAgICAgb2Zmc2V0OiBvZmZzZXQsCisgICAgICAgICAgICAgICAgICAgICAgICB3aWR0aDogb2Zmc2V0LndpZHRoLAorICAgICAgICAgICAgICAgICAgICAgICAgaGVpZ2h0OiBvZmZzZXQuaGVpZ2h0CisgICAgICAgICAgICAgICAgICAgIH07CisgICAgICAgICAgICAgICAgICAgIHRoaXMucHRyLmFkZENsYXNzKCJqc2xpZGVyLXBvaW50ZXItaG92ZXIiKTsKKyAgICAgICAgICAgICAgICAgICAgdGhpcy5zZXRJbmRleE92ZXIoKTsKKyAgICAgICAgICAgICAgICB9OworICAgICAgICAgICAgICAgIFNsaWRlclBvaW50ZXIucHJvdG90eXBlLm9ubW91c2Vtb3ZlID0gZnVuY3Rpb24gKGV2dCwgeCwgeSkgeworICAgICAgICAgICAgICAgICAgICB2YXIgY29vcmRzID0gdGhpcy5fZ2V0UGFnZUNvb3JkcyhldnQpOworICAgICAgICAgICAgICAgICAgICAvL3ZhbCBpcyB0aGUgcGVyY2VudCB3aGVyZSB0aGUgc2xpZGVyIHBvaW50ZXIgaXMgbG9jYXRlZAorICAgICAgICAgICAgICAgICAgICB2YXIgdmFsID0gdGhpcy5jYWxjKGNvb3Jkcy54KTsKKyAgICAgICAgICAgICAgICAgICAgaWYgKCF0aGlzLnBhcmVudC5zZXR0aW5ncy5zbW9vdGgpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIHZhbCA9IHV0aWxzLnJvdW5kVXBUb1NjYWxlKHZhbCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdGhpcy5wYXJlbnQuc2V0dGluZ3Muc2NhbGUsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRoaXMucGFyZW50LnNldHRpbmdzLmN1dE9mZldpZHRoLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0aGlzLnBhcmVudC5zZXR0aW5ncy5jdXRPZmZJbmRleCk7CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgdmFyIGN1dE9mZldpZHRoID0gdGhpcy5wYXJlbnQuc2V0dGluZ3MuY3V0T2ZmV2lkdGg7CisgICAgICAgICAgICAgICAgICAgIGlmIChjdXRPZmZXaWR0aCAmJiB2YWwgPCBjdXRPZmZXaWR0aCkgeworICAgICAgICAgICAgICAgICAgICAgICAgdmFsID0gY3V0T2ZmV2lkdGg7CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgdGhpcy5fc2V0KHZhbCk7CisgICAgICAgICAgICAgICAgfTsKKyAgICAgICAgICAgICAgICBTbGlkZXJQb2ludGVyLnByb3RvdHlwZS5vbm1vdXNldXAgPSBmdW5jdGlvbiAoZXZ0KSB7CisgICAgICAgICAgICAgICAgICAgIGlmICh0aGlzLnNldHRpbmdzLmNhbGxiYWNrICYmIGFuZ3VsYXIuaXNGdW5jdGlvbih0aGlzLnNldHRpbmdzLmNhbGxiYWNrKSkgeworICAgICAgICAgICAgICAgICAgICAgICAgdmFyIHZhbCA9IHRoaXMucGFyZW50LmdldFZhbHVlKCk7CisgICAgICAgICAgICAgICAgICAgICAgICB0aGlzLnNldHRpbmdzLmNhbGxiYWNrLmNhbGwodGhpcy5wYXJlbnQsIHZhbCk7CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgdGhpcy5wdHIucmVtb3ZlQ2xhc3MoImpzbGlkZXItcG9pbnRlci1ob3ZlciIpOworICAgICAgICAgICAgICAgIH07CisgICAgICAgICAgICAgICAgU2xpZGVyUG9pbnRlci5wcm90b3R5cGUuc2V0SW5kZXhPdmVyID0gZnVuY3Rpb24gKCkgeworICAgICAgICAgICAgICAgICAgICB0aGlzLnBhcmVudC5zZXRQb2ludGVyc0luZGV4KDEpOworICAgICAgICAgICAgICAgICAgICB0aGlzLmluZGV4KDIpOworICAgICAgICAgICAgICAgIH07CisgICAgICAgICAgICAgICAgU2xpZGVyUG9pbnRlci5wcm90b3R5cGUuaW5kZXggPSBmdW5jdGlvbiAoaSkgeworICAgICAgICAgICAgICAgIH07CisgICAgICAgICAgICAgICAgU2xpZGVyUG9pbnRlci5wcm90b3R5cGUubGltaXRzID0gZnVuY3Rpb24gKHgpIHsKKyAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHRoaXMucGFyZW50LmxpbWl0cyh4LCB0aGlzKTsKKyAgICAgICAgICAgICAgICB9OworICAgICAgICAgICAgICAgIFNsaWRlclBvaW50ZXIucHJvdG90eXBlLmNhbGMgPSBmdW5jdGlvbiAoY29vcmRzKSB7CisgICAgICAgICAgICAgICAgICAgIHZhciBkaWZmID0gY29vcmRzIC0gdGhpcy5fcGFyZW50Lm9mZnNldC5sZWZ0OworICAgICAgICAgICAgICAgICAgICB2YXIgdmFsID0gdGhpcy5saW1pdHMoKGRpZmYgKiAxMDApIC8gdGhpcy5fcGFyZW50LndpZHRoKTsKKyAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHZhbDsKKyAgICAgICAgICAgICAgICB9OworICAgICAgICAgICAgICAgIFNsaWRlclBvaW50ZXIucHJvdG90eXBlLnNldCA9IGZ1bmN0aW9uICh2YWx1ZSwgb3B0X29yaWdpbikgeworICAgICAgICAgICAgICAgICAgICB0aGlzLnZhbHVlLm9yaWdpbiA9IHRoaXMucGFyZW50LnJvdW5kKHZhbHVlKTsKKyAgICAgICAgICAgICAgICAgICAgdGhpcy5fc2V0KHRoaXMucGFyZW50LnZhbHVlVG9QcmModmFsdWUsIHRoaXMpLCBvcHRfb3JpZ2luKTsKKyAgICAgICAgICAgICAgICB9OworICAgICAgICAgICAgICAgIFNsaWRlclBvaW50ZXIucHJvdG90eXBlLl9zZXQgPSBmdW5jdGlvbiAocHJjLCBvcHRfb3JpZ2luKSB7CisgICAgICAgICAgICAgICAgICAgIGlmICghb3B0X29yaWdpbikgeworICAgICAgICAgICAgICAgICAgICAgICAgdGhpcy52YWx1ZS5vcmlnaW4gPSB0aGlzLnBhcmVudC5wcmNUb1ZhbHVlKHByYyk7CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgdGhpcy52YWx1ZS5wcmMgPSBwcmM7CisgICAgICAgICAgICAgICAgICAgIC8vU2V0cyB0aGUgbG9jYXRpb24gb2YgdGhlIFNsaWRlclBvaW50ZXIKKyAgICAgICAgICAgICAgICAgICAgdGhpcy5wdHIuY3NzKHtsZWZ0OiBwcmMgKyAnJSd9KTsKKyAgICAgICAgICAgICAgICAgICAgdGhpcy5wYXJlbnQucmVkcmF3KHRoaXMpOworICAgICAgICAgICAgICAgIH07CisgICAgICAgICAgICAgICAgcmV0dXJuIFNsaWRlclBvaW50ZXI7CisgICAgICAgICAgICB9XSkKKyAgICAgICAgLmZhY3RvcnkoJ3NsaWRlcicsIFsnc2xpZGVyUG9pbnRlcicsICdzbGlkZXJDb25zdGFudHMnLCAndXRpbHMnLCBmdW5jdGlvbiAoU2xpZGVyUG9pbnRlciwgc2xpZGVyQ29uc3RhbnRzLCB1dGlscykgeworICAgICAgICAgICAgICAgIC8qCisgICAgICAgICAgICAgICAgIFRoZSBNSVQgTGljZW5zZSAoTUlUKQorICAgICAgICAgICAgICAgICBDb3B5cmlnaHQgKGMpIDIwMTMgSnVsaWVuIFZhbMOpcnkKKyAgICAgICAgICAgICAgICAgKi8KKyAgICAgICAgICAgICAgICB2YXIgY3V0T2ZmRG9tOworICAgICAgICAgICAgICAgIGZ1bmN0aW9uIFNsaWRlcigpIHsKKyAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHRoaXMuaW5pdC5hcHBseSh0aGlzLCBhcmd1bWVudHMpOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICBmdW5jdGlvbiBjaGFuZ2VDdXRPZmZXaWR0aCh3aWR0aCkgeworICAgICAgICAgICAgICAgICAgICBjdXRPZmZEb20uY3NzKCd3aWR0aCcsIHdpZHRoKTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgOworICAgICAgICAgICAgICAgIFNsaWRlci5wcm90b3R5cGUuY2hhbmdlQ3V0T2ZmV2lkdGggPSBjaGFuZ2VDdXRPZmZXaWR0aDsKKyAgICAgICAgICAgICAgICBTbGlkZXIucHJvdG90eXBlLmluaXQgPSBmdW5jdGlvbiAoaW5wdXROb2RlLCB0ZW1wbGF0ZU5vZGUsIHNldHRpbmdzKSB7CisgICAgICAgICAgICAgICAgICAgIHRoaXMuc2V0dGluZ3MgPSBzbGlkZXJDb25zdGFudHMuU0xJREVSLnNldHRpbmdzOworICAgICAgICAgICAgICAgICAgICBhbmd1bGFyLmV4dGVuZCh0aGlzLnNldHRpbmdzLCBhbmd1bGFyLmNvcHkoc2V0dGluZ3MpKTsKKyAgICAgICAgICAgICAgICAgICAgdGhpcy5pbnB1dE5vZGUgPSBpbnB1dE5vZGU7CisgICAgICAgICAgICAgICAgICAgIHRoaXMuaW5wdXROb2RlLmFkZENsYXNzKCJuZy1oaWRlIik7CisgICAgICAgICAgICAgICAgICAgIHRoaXMuc2V0dGluZ3MuaW50ZXJ2YWwgPSB0aGlzLnNldHRpbmdzLnRvIC0gdGhpcy5zZXR0aW5ncy5mcm9tOworICAgICAgICAgICAgICAgICAgICBpZiAodGhpcy5zZXR0aW5ncy5jYWxjdWxhdGUgJiYgJC5pc0Z1bmN0aW9uKHRoaXMuc2V0dGluZ3MuY2FsY3VsYXRlKSkgeworICAgICAgICAgICAgICAgICAgICAgICAgdGhpcy5uaWNlID0gdGhpcy5zZXR0aW5ncy5jYWxjdWxhdGU7CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgaWYgKHRoaXMuc2V0dGluZ3Mub25zdGF0ZWNoYW5nZSAmJiAkLmlzRnVuY3Rpb24odGhpcy5zZXR0aW5ncy5vbnN0YXRlY2hhbmdlKSkgeworICAgICAgICAgICAgICAgICAgICAgICAgdGhpcy5vbnN0YXRlY2hhbmdlID0gdGhpcy5zZXR0aW5ncy5vbnN0YXRlY2hhbmdlOworICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgIHRoaXMuaXMgPSB7aW5pdDogZmFsc2V9OworICAgICAgICAgICAgICAgICAgICB0aGlzLm8gPSB7fTsKKyAgICAgICAgICAgICAgICAgICAgdGhpcy5jcmVhdGUodGVtcGxhdGVOb2RlKTsKKyAgICAgICAgICAgICAgICB9OworICAgICAgICAgICAgICAgIFNsaWRlci5wcm90b3R5cGUuY3JlYXRlID0gZnVuY3Rpb24gKHRlbXBsYXRlTm9kZSkgeworICAgICAgICAgICAgICAgICAgICB2YXIgJHRoaXMgPSB0aGlzOworICAgICAgICAgICAgICAgICAgICB0aGlzLmRvbU5vZGUgPSB0ZW1wbGF0ZU5vZGU7CisgICAgICAgICAgICAgICAgICAgIHZhciBvZmYgPSB1dGlscy5vZmZzZXQodGhpcy5kb21Ob2RlKTsKKyAgICAgICAgICAgICAgICAgICAgdmFyIG9mZnNldCA9IHsKKyAgICAgICAgICAgICAgICAgICAgICAgIGxlZnQ6IG9mZi5sZWZ0LAorICAgICAgICAgICAgICAgICAgICAgICAgdG9wOiBvZmYudG9wLAorICAgICAgICAgICAgICAgICAgICAgICAgd2lkdGg6IHRoaXMuZG9tTm9kZVswXS5jbGllbnRXaWR0aCwKKyAgICAgICAgICAgICAgICAgICAgICAgIGhlaWdodDogdGhpcy5kb21Ob2RlWzBdLmNsaWVudEhlaWdodAorICAgICAgICAgICAgICAgICAgICB9OworICAgICAgICAgICAgICAgICAgICB0aGlzLnNpemVzID0ge2RvbVdpZHRoOiB0aGlzLmRvbU5vZGVbMF0uY2xpZW50V2lkdGgsIGRvbU9mZnNldDogb2Zmc2V0fTsKKyAgICAgICAgICAgICAgICAgICAgYW5ndWxhci5leHRlbmQodGhpcy5vLCB7CisgICAgICAgICAgICAgICAgICAgICAgICBwb2ludGVyczoge30sCisgICAgICAgICAgICAgICAgICAgICAgICBsYWJlbHM6IHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAwOiB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG86IGFuZ3VsYXIuZWxlbWVudCh0aGlzLmRvbU5vZGUuZmluZCgnZGl2JylbNV0pCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAxOiB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG86IGFuZ3VsYXIuZWxlbWVudCh0aGlzLmRvbU5vZGUuZmluZCgnZGl2JylbNl0pCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgfSwKKyAgICAgICAgICAgICAgICAgICAgICAgIGxpbWl0czogeworICAgICAgICAgICAgICAgICAgICAgICAgICAgIDA6IGFuZ3VsYXIuZWxlbWVudCh0aGlzLmRvbU5vZGUuZmluZCgnZGl2JylbM10pLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIDE6IGFuZ3VsYXIuZWxlbWVudCh0aGlzLmRvbU5vZGUuZmluZCgnZGl2JylbNV0pCisgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgIH0pOworICAgICAgICAgICAgICAgICAgICBhbmd1bGFyLmV4dGVuZCh0aGlzLm8ubGFiZWxzWzBdLCB7CisgICAgICAgICAgICAgICAgICAgICAgICB2YWx1ZTogdGhpcy5vLmxhYmVsc1swXS5vLmZpbmQoInNwYW4iKQorICAgICAgICAgICAgICAgICAgICB9KTsKKyAgICAgICAgICAgICAgICAgICAgYW5ndWxhci5leHRlbmQodGhpcy5vLmxhYmVsc1sxXSwgeworICAgICAgICAgICAgICAgICAgICAgICAgdmFsdWU6IHRoaXMuby5sYWJlbHNbMV0uby5maW5kKCJzcGFuIikKKyAgICAgICAgICAgICAgICAgICAgfSk7CisgICAgICAgICAgICAgICAgICAgIGlmICghJHRoaXMuc2V0dGluZ3MudmFsdWUuc3BsaXQoIjsiKVsxXSkgeworICAgICAgICAgICAgICAgICAgICAgICAgdGhpcy5zZXR0aW5ncy5zaW5nbGUgPSB0cnVlOworICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgIHZhciBkb21Ob2RlRGl2cyA9IHRoaXMuZG9tTm9kZS5maW5kKCdkaXYnKTsKKyAgICAgICAgICAgICAgICAgICAgY3V0T2ZmRG9tID0gYW5ndWxhci5lbGVtZW50KGRvbU5vZGVEaXZzWzhdKTsKKyAgICAgICAgICAgICAgICAgICAgaWYgKGN1dE9mZkRvbSAmJiBjdXRPZmZEb20uY3NzKSB7CisgICAgICAgICAgICAgICAgICAgICAgICBjdXRPZmZEb20uY3NzKCd3aWR0aCcsICcwJScpOworICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgIHZhciBwb2ludGVycyA9IFthbmd1bGFyLmVsZW1lbnQoZG9tTm9kZURpdnNbMV0pLCBhbmd1bGFyLmVsZW1lbnQoZG9tTm9kZURpdnNbMl0pXTsKKyAgICAgICAgICAgICAgICAgICAgYW5ndWxhci5mb3JFYWNoKHBvaW50ZXJzLCBmdW5jdGlvbiAocG9pbnRlciwga2V5KSB7CisgICAgICAgICAgICAgICAgICAgICAgICAkdGhpcy5zZXR0aW5ncyA9IGFuZ3VsYXIuY29weSgkdGhpcy5zZXR0aW5ncyk7CisgICAgICAgICAgICAgICAgICAgICAgICB2YXIgdmFsdWUgPSAkdGhpcy5zZXR0aW5ncy52YWx1ZS5zcGxpdCgnOycpW2tleV07CisgICAgICAgICAgICAgICAgICAgICAgICBpZiAodmFsdWUpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAkdGhpcy5vLnBvaW50ZXJzW2tleV0gPSBuZXcgU2xpZGVyUG9pbnRlcihwb2ludGVyLCBrZXksICR0aGlzKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YXIgcHJldiA9ICR0aGlzLnNldHRpbmdzLnZhbHVlLnNwbGl0KCc7Jylba2V5IC0gMV07CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHByZXYgJiYgcGFyc2VJbnQodmFsdWUsIDEwKSA8IHBhcnNlSW50KHByZXYsIDEwKSkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YWx1ZSA9IHByZXY7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhciB2YWx1ZTEgPSB2YWx1ZSA8ICR0aGlzLnNldHRpbmdzLmZyb20gPyAkdGhpcy5zZXR0aW5ncy5mcm9tIDogdmFsdWU7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFsdWUxID0gdmFsdWUgPiAkdGhpcy5zZXR0aW5ncy50byA/ICR0aGlzLnNldHRpbmdzLnRvIDogdmFsdWU7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgJHRoaXMuby5wb2ludGVyc1trZXldLnNldCh2YWx1ZTEsIHRydWUpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChrZXkgPT09IDApIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJHRoaXMuZG9tTm9kZS5iaW5kKCdtb3VzZWRvd24nLCAkdGhpcy5jbGlja0hhbmRsZXIuYXBwbHkoJHRoaXMpKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgIH0pOworICAgICAgICAgICAgICAgICAgICB0aGlzLm8udmFsdWUgPSBhbmd1bGFyLmVsZW1lbnQodGhpcy5kb21Ob2RlLmZpbmQoImkiKVsyXSk7CisgICAgICAgICAgICAgICAgICAgIHRoaXMuaXMuaW5pdCA9IHRydWU7CisgICAgICAgICAgICAgICAgICAgIGFuZ3VsYXIuZm9yRWFjaCh0aGlzLm8ucG9pbnRlcnMsIGZ1bmN0aW9uIChwb2ludGVyKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAkdGhpcy5yZWRyYXcocG9pbnRlcik7CisgICAgICAgICAgICAgICAgICAgIH0pOworICAgICAgICAgICAgICAgIH07CisgICAgICAgICAgICAgICAgU2xpZGVyLnByb3RvdHlwZS5jbGlja0hhbmRsZXIgPSBmdW5jdGlvbiAoKSB7CisgICAgICAgICAgICAgICAgICAgIHZhciBzZWxmID0gdGhpczsKKyAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGZ1bmN0aW9uIChldnQpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIGlmIChzZWxmLmRpc2FibGVkKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuOworICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgdmFyIGNsYXNzTmFtZSA9IGV2dC50YXJnZXQuY2xhc3NOYW1lOworICAgICAgICAgICAgICAgICAgICAgICAgdmFyIHRhcmdldElkeCA9IDA7CisgICAgICAgICAgICAgICAgICAgICAgICBpZiAoY2xhc3NOYW1lLmluZGV4T2YoJ2pzbGlkZXItcG9pbnRlci10bycpID4gMCkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRhcmdldElkeCA9IDE7CisgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICB2YXIgX29mZiA9IHV0aWxzLm9mZnNldChzZWxmLmRvbU5vZGUpOworICAgICAgICAgICAgICAgICAgICAgICAgdmFyIG9mZnNldCA9IHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBsZWZ0OiBfb2ZmLmxlZnQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgdG9wOiBfb2ZmLnRvcCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB3aWR0aDogc2VsZi5kb21Ob2RlWzBdLmNsaWVudFdpZHRoLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIGhlaWdodDogc2VsZi5kb21Ob2RlWzBdLmNsaWVudEhlaWdodAorICAgICAgICAgICAgICAgICAgICAgICAgfTsKKyAgICAgICAgICAgICAgICAgICAgICAgIHRhcmdldElkeCA9IDE7CisgICAgICAgICAgICAgICAgICAgICAgICB2YXIgdGFyZ2V0UHRyID0gc2VsZi5vLnBvaW50ZXJzW3RhcmdldElkeF07CisgICAgICAgICAgICAgICAgICAgICAgICB0YXJnZXRQdHIuX3BhcmVudCA9IHtvZmZzZXQ6IG9mZnNldCwgd2lkdGg6IG9mZnNldC53aWR0aCwgaGVpZ2h0OiBvZmZzZXQuaGVpZ2h0fTsKKyAgICAgICAgICAgICAgICAgICAgICAgIHRhcmdldFB0ci5fbW91c2Vtb3ZlKGV2dCk7CisgICAgICAgICAgICAgICAgICAgICAgICB0YXJnZXRQdHIub25tb3VzZXVwKCk7CisgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gZmFsc2U7CisgICAgICAgICAgICAgICAgICAgIH07CisgICAgICAgICAgICAgICAgfTsKKyAgICAgICAgICAgICAgICBTbGlkZXIucHJvdG90eXBlLmRpc2FibGUgPSBmdW5jdGlvbiAoYm9vbCkgeworICAgICAgICAgICAgICAgICAgICB0aGlzLmRpc2FibGVkID0gYm9vbDsKKyAgICAgICAgICAgICAgICB9OworICAgICAgICAgICAgICAgIFNsaWRlci5wcm90b3R5cGUubmljZSA9IGZ1bmN0aW9uICh2YWx1ZSkgeworICAgICAgICAgICAgICAgICAgICByZXR1cm4gdmFsdWU7CisgICAgICAgICAgICAgICAgfTsKKyAgICAgICAgICAgICAgICBTbGlkZXIucHJvdG90eXBlLm9uc3RhdGVjaGFuZ2UgPSBmdW5jdGlvbiAoKSB7CisgICAgICAgICAgICAgICAgfTsKKyAgICAgICAgICAgICAgICBTbGlkZXIucHJvdG90eXBlLmxpbWl0cyA9IGZ1bmN0aW9uICh4LCBwb2ludGVyKSB7CisgICAgICAgICAgICAgICAgICAgIGlmICghdGhpcy5zZXR0aW5ncy5zbW9vdGgpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIHZhciBzdGVwID0gdGhpcy5zZXR0aW5ncy5zdGVwICogMTAwIC8gKHRoaXMuc2V0dGluZ3MuaW50ZXJ2YWwpOworICAgICAgICAgICAgICAgICAgICAgICAgeCA9IE1hdGgucm91bmQoeCAvIHN0ZXApICogc3RlcDsKKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICB2YXIgYW5vdGhlciA9IHRoaXMuby5wb2ludGVyc1sxIC0gcG9pbnRlci51aWRdOworICAgICAgICAgICAgICAgICAgICBpZiAoYW5vdGhlciAmJiBwb2ludGVyLnVpZCAmJiB4IDwgYW5vdGhlci52YWx1ZS5wcmMpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIHggPSBhbm90aGVyLnZhbHVlLnByYzsKKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICBpZiAoYW5vdGhlciAmJiAhcG9pbnRlci51aWQgJiYgeCA+IGFub3RoZXIudmFsdWUucHJjKSB7CisgICAgICAgICAgICAgICAgICAgICAgICB4ID0gYW5vdGhlci52YWx1ZS5wcmM7CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgaWYgKHggPCAwKSB7CisgICAgICAgICAgICAgICAgICAgICAgICB4ID0gMDsKKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICBpZiAoeCA+IDEwMCkgeworICAgICAgICAgICAgICAgICAgICAgICAgeCA9IDEwMDsKKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICB2YXIgdmFsID0gTWF0aC5yb3VuZCh4ICogMTApIC8gMTA7CisgICAgICAgICAgICAgICAgICAgIHJldHVybiB2YWw7CisgICAgICAgICAgICAgICAgfTsKKyAgICAgICAgICAgICAgICBTbGlkZXIucHJvdG90eXBlLnNldFBvaW50ZXJzSW5kZXggPSBmdW5jdGlvbiAoaSkgeworICAgICAgICAgICAgICAgICAgICBhbmd1bGFyLmZvckVhY2godGhpcy5nZXRQb2ludGVycygpLCBmdW5jdGlvbiAocG9pbnRlciwgaSkgeworICAgICAgICAgICAgICAgICAgICAgICAgcG9pbnRlci5pbmRleChpKTsKKyAgICAgICAgICAgICAgICAgICAgfSk7CisgICAgICAgICAgICAgICAgfTsKKyAgICAgICAgICAgICAgICBTbGlkZXIucHJvdG90eXBlLmdldFBvaW50ZXJzID0gZnVuY3Rpb24gKCkgeworICAgICAgICAgICAgICAgICAgICByZXR1cm4gdGhpcy5vLnBvaW50ZXJzOworICAgICAgICAgICAgICAgIH07CisgICAgICAgICAgICAgICAgU2xpZGVyLnByb3RvdHlwZS5vbnJlc2l6ZSA9IGZ1bmN0aW9uICgpIHsKKyAgICAgICAgICAgICAgICAgICAgdmFyIHNlbGYgPSB0aGlzOworICAgICAgICAgICAgICAgICAgICB0aGlzLnNpemVzID0geworICAgICAgICAgICAgICAgICAgICAgICAgZG9tV2lkdGg6IHRoaXMuZG9tTm9kZVswXS5jbGllbnRXaWR0aCwKKyAgICAgICAgICAgICAgICAgICAgICAgIGRvbUhlaWdodDogdGhpcy5kb21Ob2RlWzBdLmNsaWVudEhlaWdodCwKKyAgICAgICAgICAgICAgICAgICAgICAgIGRvbU9mZnNldDogeworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxlZnQ6IHRoaXMuZG9tTm9kZVswXS5vZmZzZXRMZWZ0LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRvcDogdGhpcy5kb21Ob2RlWzBdLm9mZnNldFRvcCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB3aWR0aDogdGhpcy5kb21Ob2RlWzBdLmNsaWVudFdpZHRoLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIGhlaWdodDogdGhpcy5kb21Ob2RlWzBdLmNsaWVudEhlaWdodAorICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICB9OworICAgICAgICAgICAgICAgICAgICBhbmd1bGFyLmZvckVhY2godGhpcy5vLnBvaW50ZXJzLCBmdW5jdGlvbiAocHRyLCBrZXkpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIHNlbGYucmVkcmF3KHB0cik7CisgICAgICAgICAgICAgICAgICAgIH0pOworICAgICAgICAgICAgICAgIH07CisgICAgICAgICAgICAgICAgU2xpZGVyLnByb3RvdHlwZS51cGRhdGUgPSBmdW5jdGlvbiAoKSB7CisgICAgICAgICAgICAgICAgICAgIHRoaXMub25yZXNpemUoKTsKKyAgICAgICAgICAgICAgICAgICAgdGhpcy5kcmF3U2NhbGUoKTsKKyAgICAgICAgICAgICAgICB9OworICAgICAgICAgICAgICAgIFNsaWRlci5wcm90b3R5cGUuZHJhd1NjYWxlID0gZnVuY3Rpb24gKCkgeworICAgICAgICAgICAgICAgIH07CisgICAgICAgICAgICAgICAgU2xpZGVyLnByb3RvdHlwZS5yZWRyYXcgPSBmdW5jdGlvbiAocG9pbnRlcikgeworICAgICAgICAgICAgICAgICAgICBpZiAoIXRoaXMuc2V0dGluZ3Muc21vb3RoKSB7CisgICAgICAgICAgICAgICAgICAgICAgICB2YXIgbmV3TW91c2VQcmMgPSB1dGlscy5yb3VuZFVwVG9TY2FsZShwb2ludGVyLnZhbHVlLnByYywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdGhpcy5zZXR0aW5ncy5zY2FsZSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdGhpcy5zZXR0aW5ncy5jdXRPZmZXaWR0aCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdGhpcy5zZXR0aW5ncy5jdXRPZmZJbmRleCk7CisgICAgICAgICAgICAgICAgICAgICAgICBwb2ludGVyLnZhbHVlLm9yaWdpbiA9IG5ld01vdXNlUHJjOworICAgICAgICAgICAgICAgICAgICAgICAgcG9pbnRlci52YWx1ZS5wcmMgPSBuZXdNb3VzZVByYzsKKyAgICAgICAgICAgICAgICAgICAgfQorCisgICAgICAgICAgICAgICAgICAgIGlmICghdGhpcy5pcy5pbml0KSB7CisgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gZmFsc2U7CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgdGhpcy5zZXRWYWx1ZSgpOworICAgICAgICAgICAgICAgICAgICB2YXIgd2lkdGggPSB0aGlzLm8ucG9pbnRlcnNbMV0udmFsdWUucHJjOworICAgICAgICAgICAgICAgICAgICB2YXIgbmV3UG9zID0ge2xlZnQ6ICcwJScsIHdpZHRoOiB3aWR0aCArICclJ307CisgICAgICAgICAgICAgICAgICAgIHRoaXMuby52YWx1ZS5jc3MobmV3UG9zKTsKKyAgICAgICAgICAgICAgICAgICAgdmFyIGh0bWxWYWx1ZSA9IHRoaXMubmljZShwb2ludGVyLnZhbHVlLm9yaWdpbik7CisgICAgICAgICAgICAgICAgICAgIHZhciBzY2FsZWREaW1lbnNpb24gPSB0aGlzLnNldHRpbmdzLmZpcnN0RGltZW5zaW9uOworICAgICAgICAgICAgICAgICAgICBpZiAodGhpcy5zZXR0aW5ncy5zdGVwV2l0aERpZmZlcmVudFNjYWxlICYmICF0aGlzLnNldHRpbmdzLnNtb290aCkgeworICAgICAgICAgICAgICAgICAgICAgICAgaHRtbFZhbHVlID0gdXRpbHMudmFsdWVGb3JEaWZmZXJlbnRTY2FsZSh0aGlzLnNldHRpbmdzLmZyb20sCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRoaXMuc2V0dGluZ3MudG8sIGh0bWxWYWx1ZSwgdGhpcy5zZXR0aW5ncy5wcmNUb1ZhbHVlTWFwcGVyKTsKKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAvL1RoaXMgaXMgdGhlIGJhc2UgdmFsdWUgYmVmb3JlIHRoZSBjb252ZXJzaW9uCisgICAgICAgICAgICAgICAgICAgIGlmICh0aGlzLnNldHRpbmdzLnJlYWx0aW1lQ2FsbGJhY2sgJiYgYW5ndWxhci5pc0Z1bmN0aW9uKHRoaXMuc2V0dGluZ3MucmVhbHRpbWVDYWxsYmFjaykKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiB0aGlzLnNldHRpbmdzLmN1dE9mZlZhbCAhPT0gdW5kZWZpbmVkICYmIHBvaW50ZXIudWlkID09PSAxKSB7CisgICAgICAgICAgICAgICAgICAgICAgICB0aGlzLnNldHRpbmdzLnJlYWx0aW1lQ2FsbGJhY2soaHRtbFZhbHVlKTsKKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAvL05lZWQgdG8gY2hhbmdlIHRoaXMgdG8gdGhlIGNvcnJlY3QgdmFsdWUgZm9yIHRoZSBzY2FsZQorICAgICAgICAgICAgICAgICAgICBpZiAodGhpcy5zZXR0aW5ncy5jb252ZXJzaW9uKSB7CisgICAgICAgICAgICAgICAgICAgICAgICB2YXIgY29udmVyc2lvbk9iaiA9IHV0aWxzLmdldENvbnZlcnNpb25GYWN0b3JWYWx1ZShwYXJzZUludChodG1sVmFsdWUpLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0aGlzLnNldHRpbmdzLmNvbnZlcnNpb24sCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRoaXMuc2V0dGluZ3MuZmlyc3REaW1lbnNpb24pOworICAgICAgICAgICAgICAgICAgICAgICAgaHRtbFZhbHVlID0gY29udmVyc2lvbk9iai5zY2FsZWRWYWw7CisgICAgICAgICAgICAgICAgICAgICAgICBzY2FsZWREaW1lbnNpb24gPSBjb252ZXJzaW9uT2JqLnNjYWxlZERpbWVuc2lvbjsKKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAvL0NoZWNrIGlmIHdlIG5lZWQgdG8gcm91bmQgdGhlIGRlY2ltYWwgcGxhY2VzCisgICAgICAgICAgICAgICAgICAgIGlmICh0aGlzLnNldHRpbmdzLmRlY2ltYWxQbGFjZXMgfHwgdGhpcy5zZXR0aW5ncy5kZWNpbWFsUGxhY2VzID09PSAwKSB7CisgICAgICAgICAgICAgICAgICAgICAgICBpZiAodHlwZW9mIGh0bWxWYWx1ZSA9PT0gJ251bWJlcicpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBodG1sVmFsdWUgPSBodG1sVmFsdWUudG9GaXhlZCh0aGlzLnNldHRpbmdzLmRlY2ltYWxQbGFjZXMpOworICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgIHRoaXMuby5sYWJlbHNbcG9pbnRlci51aWRdLnZhbHVlLmh0bWwoaHRtbFZhbHVlICsgJyAnICsgc2NhbGVkRGltZW5zaW9uKTsKKyAgICAgICAgICAgICAgICAgICAgLy9Ub3AgdG9vbHRpcCBsYWJlbAorICAgICAgICAgICAgICAgICAgICB0aGlzLnJlZHJhd0xhYmVscyhwb2ludGVyKTsKKyAgICAgICAgICAgICAgICB9OworICAgICAgICAgICAgICAgIFNsaWRlci5wcm90b3R5cGUucmVkcmF3TGFiZWxzID0gZnVuY3Rpb24gKHBvaW50ZXIpIHsKKyAgICAgICAgICAgICAgICAgICAgZnVuY3Rpb24gc2V0UG9zaXRpb24obGFiZWwsIHNpemVzLCBwcmMpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIHNpemVzLm1hcmdpbiA9IC1zaXplcy5sYWJlbCAvIDI7CisgICAgICAgICAgICAgICAgICAgICAgICB2YXIgZG9tU2l6ZSA9IHNlbGYuc2l6ZXMuZG9tV2lkdGg7CisgICAgICAgICAgICAgICAgICAgICAgICB2YXIgbGFiZWxfbGVmdCA9IHNpemVzLmJvcmRlciArIHNpemVzLm1hcmdpbjsKKyAgICAgICAgICAgICAgICAgICAgICAgIGlmIChsYWJlbF9sZWZ0IDwgMCkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNpemVzLm1hcmdpbiAtPSBsYWJlbF9sZWZ0OworICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHNpemVzLmJvcmRlciArIHNpemVzLmxhYmVsIC8gMiA+IGRvbVNpemUpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBzaXplcy5tYXJnaW4gPSAwOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNpemVzLnJpZ2h0ID0gdHJ1ZTsKKyAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZQorICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNpemVzLnJpZ2h0ID0gZmFsc2U7CisgICAgICAgICAgICAgICAgICAgICAgICAvL0FkanVzdCB0aGUgdG9vbHRpcCBsb2NhdGlvbgorICAgICAgICAgICAgICAgICAgICAgICAgc2l6ZXMubWFyZ2luID0gLSgobGFiZWwub1swXS5jbGllbnRXaWR0aCAvIDIpIC0gbGFiZWwub1swXS5jbGllbnRXaWR0aCAvIDIwKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIGxhYmVsLm8uY3NzKHtsZWZ0OiBwcmMgKyAiJSIsIG1hcmdpbkxlZnQ6IHNpemVzLm1hcmdpbiwgcmlnaHQ6ICJhdXRvIn0pOworICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHNpemVzLnJpZ2h0KQorICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxhYmVsLm8uY3NzKHtsZWZ0OiAiYXV0byIsIHJpZ2h0OiAwfSk7CisgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gc2l6ZXM7CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgdmFyIHNlbGYgPSB0aGlzOworICAgICAgICAgICAgICAgICAgICB2YXIgbGFiZWwgPSB0aGlzLm8ubGFiZWxzW3BvaW50ZXIudWlkXTsKKyAgICAgICAgICAgICAgICAgICAgdmFyIHByYyA9IHBvaW50ZXIudmFsdWUucHJjOworICAgICAgICAgICAgICAgICAgICB2YXIgc2l6ZXMgPSB7CisgICAgICAgICAgICAgICAgICAgICAgICBsYWJlbDogbGFiZWwub1swXS5vZmZzZXRXaWR0aCwKKyAgICAgICAgICAgICAgICAgICAgICAgIHJpZ2h0OiBmYWxzZSwKKyAgICAgICAgICAgICAgICAgICAgICAgIGJvcmRlcjogKHByYyAqIGRvbVNpemUpIC8gMTAwCisgICAgICAgICAgICAgICAgICAgIH07CisgICAgICAgICAgICAgICAgICAgIHZhciBhbm90aGVyX2xhYmVsID0gbnVsbDsKKyAgICAgICAgICAgICAgICAgICAgdmFyIGFub3RoZXIgPSBudWxsOworICAgICAgICAgICAgICAgICAgICBpZiAoIXRoaXMuc2V0dGluZ3Muc2luZ2xlKSB7CisgICAgICAgICAgICAgICAgICAgICAgICBhbm90aGVyID0gdGhpcy5vLnBvaW50ZXJzWzEgLSBwb2ludGVyLnVpZF07CisgICAgICAgICAgICAgICAgICAgICAgICBhbm90aGVyX2xhYmVsID0gdGhpcy5vLmxhYmVsc1thbm90aGVyLnVpZF07CisgICAgICAgICAgICAgICAgICAgICAgICBzd2l0Y2ggKHBvaW50ZXIudWlkKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgY2FzZSAwOgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoc2l6ZXMuYm9yZGVyICsgc2l6ZXMubGFiZWwgLyAyID4gYW5vdGhlcl9sYWJlbC5vWzBdLm9mZnNldExlZnQgLSB0aGlzLnNpemVzLmRvbU9mZnNldC5sZWZ0KSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBhbm90aGVyX2xhYmVsLm8uY3NzKHt2aXNpYmlsaXR5OiAiaGlkZGVuIn0pOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYW5vdGhlcl9sYWJlbC52YWx1ZS5odG1sKHRoaXMubmljZShhbm90aGVyLnZhbHVlLm9yaWdpbikpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbGFiZWwuby5jc3Moe3Zpc2liaWxpdHk6ICJoaWRkZW4ifSk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwcmMgPSAoYW5vdGhlci52YWx1ZS5wcmMgLSBwcmMpIC8gMiArIHByYzsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChhbm90aGVyLnZhbHVlLnByYyAhPT0gcG9pbnRlci52YWx1ZS5wcmMpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBsYWJlbC52YWx1ZS5odG1sKHRoaXMubmljZShwb2ludGVyLnZhbHVlLm9yaWdpbikgKyAiJm5ic3A7Jm5kYXNoOyZuYnNwOyIgKyB0aGlzLm5pY2UoYW5vdGhlci52YWx1ZS5vcmlnaW4pKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzaXplcy5sYWJlbCA9IGxhYmVsLm9bMF0uY2xpZW50V2lkdGg7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2l6ZXMuYm9yZGVyID0gKHByYyAqIGRvbVNpemUpIC8gMTAwOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYW5vdGhlcl9sYWJlbC5vLmNzcyh7dmlzaWJpbGl0eTogInZpc2libGUifSk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgY2FzZSAxOgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoc2l6ZXMuYm9yZGVyIC0gc2l6ZXMubGFiZWwgLyAyIDwgYW5vdGhlcl9sYWJlbC5vWzBdLm9mZnNldExlZnQgLSB0aGlzLnNpemVzLmRvbU9mZnNldC5sZWZ0ICsgYW5vdGhlcl9sYWJlbC5vWzBdLmNsaWVudFdpZHRoKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBhbm90aGVyX2xhYmVsLm8uY3NzKHt2aXNpYmlsaXR5OiAiaGlkZGVuIn0pOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYW5vdGhlcl9sYWJlbC52YWx1ZS5odG1sKHRoaXMubmljZShhbm90aGVyLnZhbHVlLm9yaWdpbikpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbGFiZWwuby5jc3Moe3Zpc2liaWxpdHk6ICJ2aXNpYmxlIn0pOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcHJjID0gKHByYyAtIGFub3RoZXIudmFsdWUucHJjKSAvIDIgKyBhbm90aGVyLnZhbHVlLnByYzsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChhbm90aGVyLnZhbHVlLnByYyAhPT0gcG9pbnRlci52YWx1ZS5wcmMpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBsYWJlbC52YWx1ZS5odG1sKHRoaXMubmljZShhbm90aGVyLnZhbHVlLm9yaWdpbikgKyAiJm5ic3A7Jm5kYXNoOyZuYnNwOyIgKyB0aGlzLm5pY2UocG9pbnRlci52YWx1ZS5vcmlnaW4pKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzaXplcy5sYWJlbCA9IGxhYmVsLm9bMF0uY2xpZW50V2lkdGg7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2l6ZXMuYm9yZGVyID0gKHByYyAqIGRvbVNpemUpIC8gMTAwOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYW5vdGhlcl9sYWJlbC5vLmNzcyh7dmlzaWJpbGl0eTogInZpc2libGUifSk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgc2l6ZXMgPSBzZXRQb3NpdGlvbihsYWJlbCwgc2l6ZXMsIHByYyk7CisgICAgICAgICAgICAgICAgICAgIHZhciBkb21TaXplID0gc2VsZi5zaXplcy5kb21XaWR0aDsKKyAgICAgICAgICAgICAgICAgICAgLy9UaGlzIGlzIHRoZSAwdGggcG9pbnRlcgorICAgICAgICAgICAgICAgICAgICBpZiAoYW5vdGhlcl9sYWJlbCkgeworICAgICAgICAgICAgICAgICAgICAgICAgc2l6ZXMgPSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgbGFiZWw6IGFub3RoZXJfbGFiZWwub1swXS5jbGllbnRXaWR0aCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICByaWdodDogZmFsc2UsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgYm9yZGVyOiAoYW5vdGhlci52YWx1ZS5wcmMgKiB0aGlzLnNpemVzLmRvbVdpZHRoKSAvIDEwMAorICAgICAgICAgICAgICAgICAgICAgICAgfTsKKyAgICAgICAgICAgICAgICAgICAgICAgIHNpemVzID0gc2V0UG9zaXRpb24oYW5vdGhlcl9sYWJlbCwgc2l6ZXMsIGFub3RoZXIudmFsdWUucHJjKTsKKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIH07CisgICAgICAgICAgICAgICAgU2xpZGVyLnByb3RvdHlwZS5yZWRyYXdMaW1pdHMgPSBmdW5jdGlvbiAoKSB7CisgICAgICAgICAgICAgICAgICAgIGlmICh0aGlzLnNldHRpbmdzLmxpbWl0cykgeworICAgICAgICAgICAgICAgICAgICAgICAgdmFyIGxpbWl0cyA9IFt0cnVlLCB0cnVlXTsKKyAgICAgICAgICAgICAgICAgICAgICAgIGZvciAodmFyIGtleSBpbiB0aGlzLm8ucG9pbnRlcnMpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoIXRoaXMuc2V0dGluZ3Muc2luZ2xlIHx8IGtleSA9PT0gMCkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YXIgcG9pbnRlciA9IHRoaXMuby5wb2ludGVyc1trZXldOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YXIgbGFiZWwgPSB0aGlzLm8ubGFiZWxzW3BvaW50ZXIudWlkXTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFyIGxhYmVsX2xlZnQgPSBsYWJlbC5vWzBdLm9mZnNldExlZnQgLSB0aGlzLnNpemVzLmRvbU9mZnNldC5sZWZ0OworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YXIgbGltaXQgPSB0aGlzLm8ubGltaXRzWzBdOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAobGFiZWxfbGVmdCA8IGxpbWl0WzBdLmNsaWVudFdpZHRoKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbGltaXRzWzBdID0gZmFsc2U7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxpbWl0ID0gdGhpcy5vLmxpbWl0c1sxXTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGxhYmVsX2xlZnQgKyBsYWJlbC5vWzBdLmNsaWVudFdpZHRoID4gdGhpcy5zaXplcy5kb21XaWR0aCAtIGxpbWl0WzBdLmNsaWVudFdpZHRoKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbGltaXRzWzFdID0gZmFsc2U7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgZm9yICh2YXIgaSA9IDA7IGkgPCBsaW1pdHMubGVuZ3RoOyBpKyspIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAobGltaXRzW2ldKXsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYW5ndWxhci5lbGVtZW50KHRoaXMuby5saW1pdHNbaV0pLmFkZENsYXNzKCJhbmltYXRlLXNob3ciKTt9CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgZWxzZXsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYW5ndWxhci5lbGVtZW50KHRoaXMuby5saW1pdHNbaV0pLmFkZENsYXNzKCJhbmltYXRlLWhpZGRlIik7fQorICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgfTsKKyAgICAgICAgICAgICAgICBTbGlkZXIucHJvdG90eXBlLnNldFZhbHVlID0gZnVuY3Rpb24gKCkgeworICAgICAgICAgICAgICAgICAgICB2YXIgdmFsdWUgPSB0aGlzLmdldFZhbHVlKCk7CisgICAgICAgICAgICAgICAgICAgIHRoaXMuaW5wdXROb2RlLmF0dHIoInZhbHVlIiwgdmFsdWUpOworICAgICAgICAgICAgICAgICAgICB0aGlzLm9uc3RhdGVjaGFuZ2UuY2FsbCh0aGlzLCB2YWx1ZSwgdGhpcy5pbnB1dE5vZGUpOworICAgICAgICAgICAgICAgIH07CisgICAgICAgICAgICAgICAgU2xpZGVyLnByb3RvdHlwZS5nZXRWYWx1ZSA9IGZ1bmN0aW9uICgpIHsKKyAgICAgICAgICAgICAgICAgICAgaWYgKCF0aGlzLmlzLmluaXQpeworICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGZhbHNlO30KKyAgICAgICAgICAgICAgICAgICAgdmFyICR0aGlzID0gdGhpczsKKyAgICAgICAgICAgICAgICAgICAgdmFyIHZhbHVlID0gIiI7CisgICAgICAgICAgICAgICAgICAgIGFuZ3VsYXIuZm9yRWFjaCh0aGlzLm8ucG9pbnRlcnMsIGZ1bmN0aW9uIChwb2ludGVyLCBrZXkpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIGlmIChwb2ludGVyLnZhbHVlLnByYyAhPT0gdW5kZWZpbmVkICYmICFpc05hTihwb2ludGVyLnZhbHVlLnByYykpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YXIgcG9pbnRlclByYyA9IHBvaW50ZXIudmFsdWUucHJjOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhciBteVZhbHVlID0gJHRoaXMucHJjVG9WYWx1ZShwb2ludGVyUHJjKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoISR0aGlzLnNldHRpbmdzLnNtb290aCkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YXIgbXlWYWx1ZSA9IHV0aWxzLnZhbHVlRm9yRGlmZmVyZW50U2NhbGUoJHRoaXMuc2V0dGluZ3MuZnJvbSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAkdGhpcy5zZXR0aW5ncy50bywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwb2ludGVyUHJjLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICR0aGlzLnNldHRpbmdzLnByY1RvVmFsdWVNYXBwZXIpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YWx1ZSArPSAoa2V5ID4gMCA/ICI7IiA6ICIiKSArIG15VmFsdWU7CisgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgIH0pOworICAgICAgICAgICAgICAgICAgICByZXR1cm4gdmFsdWU7CisgICAgICAgICAgICAgICAgfTsKKyAgICAgICAgICAgICAgICBTbGlkZXIucHJvdG90eXBlLmdldFByY1ZhbHVlID0gZnVuY3Rpb24gKCkgeworICAgICAgICAgICAgICAgICAgICBpZiAoIXRoaXMuaXMuaW5pdCkKKyAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBmYWxzZTsKKyAgICAgICAgICAgICAgICAgICAgdmFyIHZhbHVlID0gIiI7CisgICAgICAgICAgICAgICAgICAgICQuZWFjaCh0aGlzLm8ucG9pbnRlcnMsIGZ1bmN0aW9uIChpKSB7CisgICAgICAgICAgICAgICAgICAgICAgICBpZiAodGhpcy52YWx1ZS5wcmMgIT09IHVuZGVmaW5lZCAmJiAhaXNOYU4odGhpcy52YWx1ZS5wcmMpKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhbHVlICs9IChpID4gMCA/ICI7IiA6ICIiKSArIHRoaXMudmFsdWUucHJjOworICAgICAgICAgICAgICAgICAgICB9KTsKKyAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHZhbHVlOworICAgICAgICAgICAgICAgIH07CisgICAgICAgICAgICAgICAgU2xpZGVyLnByb3RvdHlwZS5wcmNUb1ZhbHVlID0gZnVuY3Rpb24gKHByYykgeworICAgICAgICAgICAgICAgICAgICB2YXIgdmFsdWU7CisgICAgICAgICAgICAgICAgICAgIGlmICh0aGlzLnNldHRpbmdzLmhldGVyb2dlbmVpdHkgJiYgdGhpcy5zZXR0aW5ncy5oZXRlcm9nZW5laXR5Lmxlbmd0aCA+IDApIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIHZhciBoID0gdGhpcy5zZXR0aW5ncy5oZXRlcm9nZW5laXR5OworICAgICAgICAgICAgICAgICAgICAgICAgdmFyIF9zdGFydCA9IDA7CisgICAgICAgICAgICAgICAgICAgICAgICB2YXIgX2Zyb20gPSB0aGlzLnNldHRpbmdzLmZyb207CisgICAgICAgICAgICAgICAgICAgICAgICBmb3IgKHZhciBpID0gMDsgaSA8PSBoLmxlbmd0aDsgaSsrKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFyIHY7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGhbaV0peworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2ID0gaFtpXS5zcGxpdCgiLyIpO30KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBlbHNleworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2ID0gWzEwMCwgdGhpcy5zZXR0aW5ncy50b107fQorICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChwcmMgPj0gX3N0YXJ0ICYmIHByYyA8PSB2WzBdKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhbHVlID0gX2Zyb20gKyAoKHByYyAtIF9zdGFydCkgKiAodlsxXSAtIF9mcm9tKSkgLyAodlswXSAtIF9zdGFydCk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgICAgIF9zdGFydCA9IHZbMF07CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgX2Zyb20gPSB2WzFdOworICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgIGVsc2UgeworICAgICAgICAgICAgICAgICAgICAgICAgdmFsdWUgPSB0aGlzLnNldHRpbmdzLmZyb20gKyAocHJjICogdGhpcy5zZXR0aW5ncy5pbnRlcnZhbCkgLyAxMDA7CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgdmFyIHJvdW5kZWRWYWx1ZSA9IHRoaXMucm91bmQodmFsdWUpOworICAgICAgICAgICAgICAgICAgICByZXR1cm4gcm91bmRlZFZhbHVlOworICAgICAgICAgICAgICAgIH07CisgICAgICAgICAgICAgICAgU2xpZGVyLnByb3RvdHlwZS52YWx1ZVRvUHJjID0gZnVuY3Rpb24gKHZhbHVlLCBwb2ludGVyKSB7CisgICAgICAgICAgICAgICAgICAgIHZhciBwcmM7CisgICAgICAgICAgICAgICAgICAgIGlmICh0aGlzLnNldHRpbmdzLmhldGVyb2dlbmVpdHkgJiYgdGhpcy5zZXR0aW5ncy5oZXRlcm9nZW5laXR5Lmxlbmd0aCA+IDApIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIHZhciBoID0gdGhpcy5zZXR0aW5ncy5oZXRlcm9nZW5laXR5OworICAgICAgICAgICAgICAgICAgICAgICAgdmFyIF9zdGFydCA9IDA7CisgICAgICAgICAgICAgICAgICAgICAgICB2YXIgX2Zyb20gPSB0aGlzLnNldHRpbmdzLmZyb207CisgICAgICAgICAgICAgICAgICAgICAgICBmb3IgKHZhciBpID0gMDsgaSA8PSBoLmxlbmd0aDsgaSsrKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFyIHY7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGhbaV0pCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHYgPSBoW2ldLnNwbGl0KCIvIik7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2ID0gWzEwMCwgdGhpcy5zZXR0aW5ncy50b107CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHZhbHVlID49IF9mcm9tICYmIHZhbHVlIDw9IHZbMV0pIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcHJjID0gcG9pbnRlci5saW1pdHMoX3N0YXJ0ICsgKHZhbHVlIC0gX2Zyb20pICogKHZbMF0gLSBfc3RhcnQpIC8gKHZbMV0gLSBfZnJvbSkpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBfc3RhcnQgPSB2WzBdOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIF9mcm9tID0gdlsxXTsKKyAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIHByYyA9IHBvaW50ZXIubGltaXRzKCh2YWx1ZSAtIHRoaXMuc2V0dGluZ3MuZnJvbSkgKiAxMDAgLyB0aGlzLnNldHRpbmdzLmludGVydmFsKTsKKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICByZXR1cm4gcHJjOworICAgICAgICAgICAgICAgIH07CisgICAgICAgICAgICAgICAgU2xpZGVyLnByb3RvdHlwZS5yb3VuZCA9IGZ1bmN0aW9uICh2YWx1ZSkgeworICAgICAgICAgICAgICAgICAgICB2YWx1ZSA9IE1hdGgucm91bmQodmFsdWUgLyB0aGlzLnNldHRpbmdzLnN0ZXApICogdGhpcy5zZXR0aW5ncy5zdGVwOworICAgICAgICAgICAgICAgICAgICBpZiAodGhpcy5zZXR0aW5ncy5yb3VuZCl7CisgICAgICAgICAgICAgICAgICAgICAgICB2YWx1ZSA9IE1hdGgucm91bmQodmFsdWUgKiBNYXRoLnBvdygxMCwgdGhpcy5zZXR0aW5ncy5yb3VuZCkpIC8gTWF0aC5wb3coMTAsIHRoaXMuc2V0dGluZ3Mucm91bmQpO30KKyAgICAgICAgICAgICAgICAgICAgZWxzZXsKKyAgICAgICAgICAgICAgICAgICAgICAgIHZhbHVlID0gTWF0aC5yb3VuZCh2YWx1ZSk7fQorICAgICAgICAgICAgICAgICAgICByZXR1cm4gdmFsdWU7CisgICAgICAgICAgICAgICAgfTsKKyAgICAgICAgICAgICAgICByZXR1cm4gU2xpZGVyOworICAgICAgICAgICAgfV0pCisgICAgICAgIC5kaXJlY3RpdmUoJ2F0dFN0ZXBTbGlkZXInLCBbCisgICAgICAgICAgICAnJGNvbXBpbGUnLCAnJHRlbXBsYXRlQ2FjaGUnLCAnJHRpbWVvdXQnLCAnJHdpbmRvdycsICdzbGlkZXInLCAnc2xpZGVyQ29uc3RhbnRzJywgJ3V0aWxzJywKKyAgICAgICAgICAgIGZ1bmN0aW9uIChjb21waWxlLCB0ZW1wbGF0ZUNhY2hlLCB0aW1lb3V0LCB3aW4sIFNsaWRlciwgc2xpZGVyQ29uc3RhbnRzLCB1dGlscykgeworICAgICAgICAgICAgICAgIC8qCisgICAgICAgICAgICAgICAgIFRoZSBNSVQgTGljZW5zZSAoTUlUKQorICAgICAgICAgICAgICAgICBDb3B5cmlnaHQgKGMpIDIwMTMgSnVsaWVuIFZhbMOpcnkKKyAgICAgICAgICAgICAgICAgKi8KKyAgICAgICAgICAgICAgICB2YXIgdGVtcGxhdGVVcmwgPSAnYXBwL3NjcmlwdHMvbmdfanNfYXR0X3RwbHMvc3RlcFNsaWRlci9hdHRTdGVwU2xpZGVyLmh0bWwnOworICAgICAgICAgICAgICAgIHJldHVybiB7CisgICAgICAgICAgICAgICAgICAgIHJlc3RyaWN0OiAnQUUnLAorICAgICAgICAgICAgICAgICAgICByZXF1aXJlOiAnP25nTW9kZWwnLAorICAgICAgICAgICAgICAgICAgICBzY29wZTogeworICAgICAgICAgICAgICAgICAgICAgICAgb3B0aW9uczogJz0nLAorICAgICAgICAgICAgICAgICAgICAgICAgY3V0T2ZmOiAnPScKKyAgICAgICAgICAgICAgICAgICAgfSwKKyAgICAgICAgICAgICAgICAgICAgcHJpb3JpdHk6IDEsCisgICAgICAgICAgICAgICAgICAgIHRlbXBsYXRlVXJsOiB0ZW1wbGF0ZVVybCwKKyAgICAgICAgICAgICAgICAgICAgbGluazogZnVuY3Rpb24gKHNjb3BlLCBlbGVtZW50LCBhdHRycywgbmdNb2RlbCkgeworICAgICAgICAgICAgICAgICAgICAgICAgaWYgKCFuZ01vZGVsKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybjsKKyAgICAgICAgICAgICAgICAgICAgICAgIHNjb3BlLm1haW5TbGlkZXJDbGFzcyA9ICdzdGVwLXNsaWRlcic7CisgICAgICAgICAgICAgICAgICAgICAgICBlbGVtZW50LmFmdGVyKGNvbXBpbGUodGVtcGxhdGVDYWNoZS5nZXQodGVtcGxhdGVVcmwpKShzY29wZSwgZnVuY3Rpb24gKGNsb25lZEVsZW1lbnQsIHNjb3BlKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2NvcGUudG1wbEVsdCA9IGNsb25lZEVsZW1lbnQ7CisgICAgICAgICAgICAgICAgICAgICAgICB9KSk7CisgICAgICAgICAgICAgICAgICAgICAgICBuZ01vZGVsLiRyZW5kZXIgPSBmdW5jdGlvbiAoKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKG5nTW9kZWwuJHZpZXdWYWx1ZS5zcGxpdCAmJiBuZ01vZGVsLiR2aWV3VmFsdWUuc3BsaXQoIjsiKS5sZW5ndGggPT09IDEpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbmdNb2RlbC4kdmlld1ZhbHVlID0gJzA7JyArIG5nTW9kZWwuJHZpZXdWYWx1ZTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKHR5cGVvZiAobmdNb2RlbC4kdmlld1ZhbHVlKSA9PT0gJ251bWJlcicpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbmdNb2RlbC4kdmlld1ZhbHVlID0gJzA7JyArIG5nTW9kZWwuJHZpZXdWYWx1ZTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKCFuZ01vZGVsLiR2aWV3VmFsdWUgJiYgbmdNb2RlbC4kdmlld1ZhbHVlICE9PSAwKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybjsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHR5cGVvZiAobmdNb2RlbC4kdmlld1ZhbHVlKSA9PT0gJ251bWJlcicpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbmdNb2RlbC4kdmlld1ZhbHVlID0gJycgKyBuZ01vZGVsLiR2aWV3VmFsdWU7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChzY29wZS5zbGlkZXIpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFyIGZpcnN0UG9pbnRlciA9ICcwJzsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2NvcGUuc2xpZGVyLmdldFBvaW50ZXJzKClbMF0uc2V0KGZpcnN0UG9pbnRlciwgdHJ1ZSk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChuZ01vZGVsLiR2aWV3VmFsdWUuc3BsaXQoIjsiKVsxXSkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFyIHZhbHVlID0gbmdNb2RlbC4kdmlld1ZhbHVlLnNwbGl0KCI7IilbMV07CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAodmFsdWUubGVuZ3RoID49IDQpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YWx1ZSA9IHZhbHVlLnN1YnN0cmluZygwLCAyKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICghc2NvcGUub3B0aW9ucy5yZWFsdGltZSkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzY29wZS5vcHRpb25zLmNhbGxiYWNrKHBhcnNlRmxvYXQobmdNb2RlbC4kdmlld1ZhbHVlLnNwbGl0KCI7IilbMV0pKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNjb3BlLnNsaWRlci5nZXRQb2ludGVycygpWzFdLnNldChuZ01vZGVsLiR2aWV3VmFsdWUuc3BsaXQoIjsiKVsxXSwgdHJ1ZSk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICB9OworICAgICAgICAgICAgICAgICAgICAgICAgdmFyIGluaXQgPSBmdW5jdGlvbiAoKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2NvcGUuZnJvbSA9ICcnICsgc2NvcGUub3B0aW9ucy5mcm9tOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNjb3BlLnRvID0gJycgKyBzY29wZS5vcHRpb25zLnRvOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChzY29wZS5vcHRpb25zLmNhbGN1bGF0ZSAmJiB0eXBlb2Ygc2NvcGUub3B0aW9ucy5jYWxjdWxhdGUgPT09ICdmdW5jdGlvbicpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2NvcGUuZnJvbSA9IHNjb3BlLm9wdGlvbnMuY2FsY3VsYXRlKHNjb3BlLmZyb20pOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzY29wZS50byA9IHNjb3BlLm9wdGlvbnMuY2FsY3VsYXRlKHNjb3BlLnRvKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2NvcGUuc2hvd0RpdmlkZXJzID0gc2NvcGUub3B0aW9ucy5zaG93RGl2aWRlcnM7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2NvcGUuQ09MT1JTID0gc2xpZGVyQ29uc3RhbnRzLkNPTE9SUzsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBzY29wZS5zbGlkZXJDb2xvciA9IHNjb3BlLm9wdGlvbnMuc2xpZGVyQ29sb3I7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKCFzY29wZS5zbGlkZXJDb2xvcikKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2NvcGUuc2xpZGVyQ29sb3IgPSBzbGlkZXJDb25zdGFudHMuQ09MT1JTLlJFR1VMQVI7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFyIHNjYWxlQXJyYXkgPSBzY29wZS5vcHRpb25zLnNjYWxlOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vTWFrZSBhIGNvcHkgb2YgdGhlIHNjYWxlQXJyYXkgYmVmb3JlIGNvbnZlcnRpbmcgaXQgdG8gcGVyY2VudGFnZSBmb3IgdGhlIGJhcnMKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YXIgbm9uUGVyY2VudFNjYWxlQXJyYXkgPSBbXTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAvL0NyZWF0ZSBNYXBwZXIgZm9yIHRoZSBwZXJjZW50YWdlIHRvIHZhbHVlCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFyIHByY1RvVmFsdWVNYXBwZXIgPSB7fTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBmb3IgKHZhciBpIGluIHNjYWxlQXJyYXkpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFyIHMgPSBzY2FsZUFycmF5W2ldOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBub25QZXJjZW50U2NhbGVBcnJheS5wdXNoKHMpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBmdW5jdGlvbiBhZGRTY2FsZUFycmF5U3RhcnRBbmRFbmQoKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChzY2FsZUFycmF5WzBdICE9PSAwKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzY2FsZUFycmF5LnNwbGljZSgwLCAwLCAwKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoc2NhbGVBcnJheVtzY2FsZUFycmF5Lmxlbmd0aCAtIDFdICE9PSAxMDApIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNjYWxlQXJyYXkuc3BsaWNlKHNjYWxlQXJyYXkubGVuZ3RoLCAwLCAxMDApOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZ1bmN0aW9uIGNvbnZlcnRTY2FsZUFycmF5VG9QZXJjZW50YWdlKCkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoc2NhbGVBcnJheVtzY2FsZUFycmF5Lmxlbmd0aCAtIDFdICE9PSBzY29wZS5vcHRpb25zLnRvKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzY2FsZUFycmF5LnNwbGljZShzY2FsZUFycmF5Lmxlbmd0aCwgMCwgc2NvcGUub3B0aW9ucy50byk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZm9yICh2YXIgaSBpbiBzY2FsZUFycmF5KSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YXIgZnJvbVZhbHVlQ2hlY2sgPSAoc2NhbGVBcnJheVtpXSAvIHNjb3BlLm9wdGlvbnMuZnJvbSk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YXIgdG9WYWx1ZUNoZWNrID0gKHNjYWxlQXJyYXlbaV0gLyBzY29wZS5vcHRpb25zLnRvKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhciBwcmNWYWx1ZSA9ICgoc2NhbGVBcnJheVtpXSAtIHNjb3BlLm9wdGlvbnMuZnJvbSkgLyAoc2NvcGUub3B0aW9ucy50byAtIHNjb3BlLm9wdGlvbnMuZnJvbSkpICogMTAwOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFyIHJlYWxWYWx1ZSA9IHNjYWxlQXJyYXlbaV07CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAodG9WYWx1ZUNoZWNrID09PSAxKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcHJjVmFsdWUgPSAxMDA7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBlbHNlIGlmIChmcm9tVmFsdWVDaGVjayA9PT0gMSkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHByY1ZhbHVlID0gMDsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNjYWxlQXJyYXlbaV0gPSBwcmNWYWx1ZTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHByY1RvVmFsdWVNYXBwZXJbJycgKyBwcmNWYWx1ZV0gPSByZWFsVmFsdWU7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKChzY29wZS5vcHRpb25zLmZyb20gIT09IDAgfHwgc2NvcGUub3B0aW9ucy50byAhPT0gMTAwKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgc2NvcGUub3B0aW9ucy5zbW9vdGgpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLyoKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNjYWxlIGFycmF5IGlzIGluIHJlYWwgdmFsdWVzLgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYWRkU2NhbGVBcnJheVN0YXJ0QW5kRW5kKCk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNjb3BlLm9wdGlvbnMuc3RlcFdpdGhEaWZmZXJlbnRTY2FsZSA9IHRydWU7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgICAgIGVsc2UgaWYgKChzY29wZS5vcHRpb25zLmZyb20gIT09IDAgfHwgc2NvcGUub3B0aW9ucy50byAhPT0gMTAwKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgIXNjb3BlLm9wdGlvbnMuc21vb3RoKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8qCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBDYXNlIGZvciBkaWZmZXJlbnQgZnJvbSBhbmQgdG8gdmFsdWVzIG90aGVyIHRoYW4gMCBhbmQgMTAwCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzbyB3ZSBoYXZlIHRvIGRvIHNvbWUgZGlmZmVyZW50IGNhbGN1bGF0aW9ucworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2NvcGUub3B0aW9ucy5zdGVwV2l0aERpZmZlcmVudFNjYWxlID0gdHJ1ZTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY29udmVydFNjYWxlQXJyYXlUb1BlcmNlbnRhZ2UoKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYWRkU2NhbGVBcnJheVN0YXJ0QW5kRW5kKCk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgICAgIGVsc2UgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvKgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgVGhpcyBpcyB0aGUgbm9ybWFsIGNhc2Ugd2hlcmUgdGhlIGZyb20gYW5kIHRvIHZhbHVlcyBhcmUgMCBhbmQKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDEwMCByZXNwZWN0aXZlbHkuICAgICAgICAKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vQ2hlY2sgdGhhdCB0aGUgc2NhbGUgc3RhcnRzIGF0IDAgYW5kIDEwMAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb252ZXJ0U2NhbGVBcnJheVRvUGVyY2VudGFnZSgpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBhZGRTY2FsZUFycmF5U3RhcnRBbmRFbmQoKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFyIGRlY2ltYWxQbGFjZXMgPSAwOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChzY29wZS5vcHRpb25zLmRlY2ltYWxQbGFjZXMpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZGVjaW1hbFBsYWNlcyA9IHNjb3BlLm9wdGlvbnMuZGVjaW1hbFBsYWNlczsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgLy9Nb2RpZnkgdGhlIGVuZERpbWVuc2lvbiBiYXNlZCBvbiB3aGV0aGVyIGNvbnZlcmlzb24gd2FzIHBhc3NlZCBpbgorICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vQWxzbyBjaGFuZ2UgdGhlIHRvU3RyIHZhbHVlIHRvIHNjYWxlIHRvIHRoZSBsYXN0IGZhY3RvcgorICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNjb3BlLmVuZERpbWVuc2lvbiA9IHNjb3BlLm9wdGlvbnMuZGltZW5zaW9uOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChzY29wZS5vcHRpb25zLmNvbnZlcnNpb24pIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLy9HZXQgdGhlIGRpbWVuc2lvbiBvZiB0aGUgbGFzdCBjb252ZXJzaW9uCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhciBsYXN0SW5kZXggPSBzY29wZS5vcHRpb25zLmNvbnZlcnNpb24ubGVuZ3RoIC0gMTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFyIGxhc3REaW1lbnNpb24gPSBzY29wZS5vcHRpb25zLmNvbnZlcnNpb25bbGFzdEluZGV4XS5kaW1lbnNpb247CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhciBsYXN0U2NhbGVGYWN0b3IgPSBzY29wZS5vcHRpb25zLmNvbnZlcnNpb25bbGFzdEluZGV4XS5zY2FsZUZhY3RvcjsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2NvcGUuZW5kRGltZW5zaW9uID0gIiAiICsgbGFzdERpbWVuc2lvbjsKKworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YXIgdG9WYWwgPSAoc2NvcGUudG8gLyBsYXN0U2NhbGVGYWN0b3IpLnRvRml4ZWQoZGVjaW1hbFBsYWNlcyk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNjb3BlLnRvU3RyID0gdG9WYWw7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2NvcGUudG9TdHIgPSBzY29wZS5vcHRpb25zLnRvOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YXIgT1BUSU9OUyA9IHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZnJvbTogc2NvcGUub3B0aW9ucy5mcm9tLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0bzogc2NvcGUub3B0aW9ucy50bywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc3RlcDogc2NvcGUub3B0aW9ucy5zdGVwLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzbW9vdGg6IHNjb3BlLm9wdGlvbnMuc21vb3RoLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBsaW1pdHM6IHRydWUsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHN0ZXBXaXRoRGlmZmVyZW50U2NhbGU6IHNjb3BlLm9wdGlvbnMuc3RlcFdpdGhEaWZmZXJlbnRTY2FsZSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcm91bmQ6IHNjb3BlLm9wdGlvbnMucm91bmQgfHwgZmFsc2UsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhbHVlOiBuZ01vZGVsLiR2aWV3VmFsdWUsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNjYWxlOiBzY29wZS5vcHRpb25zLnNjYWxlLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBub25QZXJjZW50U2NhbGVBcnJheTogbm9uUGVyY2VudFNjYWxlQXJyYXksCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHByY1RvVmFsdWVNYXBwZXI6IHByY1RvVmFsdWVNYXBwZXIsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZpcnN0RGltZW5zaW9uOiBzY29wZS5vcHRpb25zLmRpbWVuc2lvbiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZGVjaW1hbFBsYWNlczogZGVjaW1hbFBsYWNlcywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY29udmVyc2lvbjogc2NvcGUub3B0aW9ucy5jb252ZXJzaW9uCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgfTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoYW5ndWxhci5pc0Z1bmN0aW9uKHNjb3BlLm9wdGlvbnMucmVhbHRpbWUpKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIE9QVElPTlMucmVhbHRpbWVDYWxsYmFjayA9IGZ1bmN0aW9uICh2YWx1ZSkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbmdNb2RlbC4kc2V0Vmlld1ZhbHVlKHZhbHVlKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNjb3BlLm9wdGlvbnMuY2FsbGJhY2sodmFsdWUpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9OworICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBlbHNlIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgT1BUSU9OUy5jYWxsYmFjayA9IGZvcmNlQXBwbHk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgICAgIE9QVElPTlMuY2FsY3VsYXRlID0gc2NvcGUub3B0aW9ucy5jYWxjdWxhdGUgfHwgdW5kZWZpbmVkOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIE9QVElPTlMub25zdGF0ZWNoYW5nZSA9IHNjb3BlLm9wdGlvbnMub25zdGF0ZWNoYW5nZSB8fCB1bmRlZmluZWQ7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgdGltZW91dChmdW5jdGlvbiAoKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhciBzY2FsZURpdiA9IHNjb3BlLnRtcGxFbHQuZmluZCgnZGl2JylbN107CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICghT1BUSU9OUy5jb252ZXJzaW9uKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzY29wZS50bXBsRWx0LmZpbmQoJ2RpdicpLmVxKDYpLmZpbmQoJ3NwYW4nKS5lcSgwKS5jc3MoJ3BhZGRpbmctbGVmdCcsICcxMHB4Jyk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzY29wZS50bXBsRWx0LmZpbmQoJ2RpdicpLmVxKDYpLmZpbmQoJ3NwYW4nKS5lcSgwKS5jc3MoJ3BhZGRpbmctcmlnaHQnLCAnMTVweCcpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNjb3BlLnNsaWRlciA9IGFuZ3VsYXIuZWxlbWVudC5zbGlkZXIoZWxlbWVudCwgc2NvcGUudG1wbEVsdCwgT1BUSU9OUyk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGFuZ3VsYXIuZWxlbWVudChzY2FsZURpdikuaHRtbChzY29wZS5nZW5lcmF0ZVNjYWxlKCkpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzY29wZS5kcmF3U2NhbGUoc2NhbGVEaXYpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpbml0TGlzdGVuZXIoKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2NvcGUuJHdhdGNoKCdvcHRpb25zLmRpc2FibGUnLCBmdW5jdGlvbiAodmFsKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoc2NvcGUuc2xpZGVyKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2NvcGUudG1wbEVsdC50b2dnbGVDbGFzcygnZGlzYWJsZWQnLCB2YWwpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNjb3BlLnNsaWRlci5kaXNhYmxlKHZhbCk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0pOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzY29wZS4kd2F0Y2goJ2N1dE9mZicsIGZ1bmN0aW9uIChjdXRPZmZWYWwpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChjdXRPZmZWYWwgJiYgY3V0T2ZmVmFsID4gMCkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhciBjdXRPZmZQcmMgPSAoY3V0T2ZmVmFsIC0gc2NvcGUuc2xpZGVyLnNldHRpbmdzLmZyb20pIC8gKHNjb3BlLnNsaWRlci5zZXR0aW5ncy50byAtCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzY29wZS5zbGlkZXIuc2V0dGluZ3MuZnJvbSk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY3V0T2ZmUHJjID0gY3V0T2ZmUHJjICogMTAwOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNjb3BlLmlzQ3V0T2ZmU2xpZGVyID0gdHJ1ZTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzY29wZS5zbGlkZXIuc2V0dGluZ3MuY3V0T2ZmV2lkdGggPSBjdXRPZmZQcmM7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLy9jdXRPZmZWYWwgaXMgdGhlIGFjdHVhbCB2YWx1ZSBvZiB0aGUgY3V0b2ZmIHBvaW50CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2NvcGUuY3V0T2ZmVmFsID0gY3V0T2ZmVmFsOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChzY29wZS5vcHRpb25zLmNvbnZlcnNpb24pIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFyIGNvbnZlcnRlZFZhbCA9IHV0aWxzLmdldENvbnZlcnNpb25GYWN0b3JWYWx1ZShjdXRPZmZWYWwsIHNjb3BlLm9wdGlvbnMuY29udmVyc2lvbiwgc2NvcGUub3B0aW9ucy5kaW1lbnNpb24pOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb252ZXJ0ZWRWYWwuc2NhbGVkVmFsID0gcGFyc2VGbG9hdChjb252ZXJ0ZWRWYWwuc2NhbGVkVmFsKS50b0ZpeGVkKHNjb3BlLm9wdGlvbnMuZGVjaW1hbFBsYWNlcyk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNjb3BlLmN1dE9mZlZhbCA9IGNvbnZlcnRlZFZhbC5zY2FsZWRWYWwgKyAnICcgKyBjb252ZXJ0ZWRWYWwuc2NhbGVkRGltZW5zaW9uOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzY29wZS5zbGlkZXIuc2V0dGluZ3MuY3V0T2ZmVmFsID0gY3V0T2ZmVmFsOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vQ2FsY3VsYXRlIHRoZSBjdXRPZmYgcGVyY2VudGFnZQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNjb3BlLnNsaWRlci5jaGFuZ2VDdXRPZmZXaWR0aChjdXRPZmZQcmMgKyAnJScpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhciBzY2FsZSA9IHNjb3BlLnNsaWRlci5zZXR0aW5ncy5ub25QZXJjZW50U2NhbGVBcnJheTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvL0NhbGN1bGF0ZSB3aGVyZSB0aGUgY3V0T2ZmIHBvaW50IGluIHJlbGF0aW9uIHRvIHRoZSBzY2FsZSBhcnJheQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZvciAodmFyIGkgaW4gc2NhbGUpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGkgPj0gMSkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFyIGxvd2VyVmFsID0gc2NhbGVbaSAtIDFdOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFyIGhpZ2hlclZhbCA9IHNjYWxlW2ldOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGN1dE9mZlZhbCA+IGxvd2VyVmFsICYmIGN1dE9mZlZhbCA8PSBoaWdoZXJWYWwpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzY29wZS5zbGlkZXIuc2V0dGluZ3MuY3V0T2ZmSW5kZXggPSBpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzY29wZS5zbGlkZXIuc2V0dGluZ3MuY3V0T2ZmVmFsID0gMDsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSk7CisgICAgICAgICAgICAgICAgICAgICAgICB9OworICAgICAgICAgICAgICAgICAgICAgICAgZnVuY3Rpb24gaW5pdExpc3RlbmVyKCkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGFuZ3VsYXIuZWxlbWVudCh3aW4pLmJpbmQoJ3Jlc2l6ZScsIGZ1bmN0aW9uIChldmVudCkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzY29wZS5zbGlkZXIub25yZXNpemUoKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB9KTsKKyAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgIHNjb3BlLmdlbmVyYXRlU2NhbGUgPSBmdW5jdGlvbiAoKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHNjb3BlLm9wdGlvbnMuc2NhbGUgJiYgc2NvcGUub3B0aW9ucy5zY2FsZS5sZW5ndGggPiAwKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhciBzdHIgPSAiIjsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFyIHMgPSBzY29wZS5vcHRpb25zLnNjYWxlOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YXIgcG9zaXRpb24gPSAnbGVmdCc7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZvciAodmFyIGkgPSAwOyBpIDwgcy5sZW5ndGg7IGkrKykgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGkgIT09IDAgJiYgaSAhPT0gcy5sZW5ndGggLSAxKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFyIHNjYWxlZFBvc2l0aW9uID0gKChzW2ldIC0gc2NvcGUuZnJvbSkgLyAoc2NvcGUudG8gLSBzY29wZS5mcm9tKSkgKiAxMDA7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHNjb3BlLm9wdGlvbnMuc3RlcFdpdGhEaWZmZXJlbnRTY2FsZSAmJiAhc2NvcGUub3B0aW9ucy5zbW9vdGgpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2NhbGVkUG9zaXRpb24gPSBzW2ldOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzdHIgKz0gJzxzcGFuIHN0eWxlPSInICsgcG9zaXRpb24gKyAnOiAnICsgc2NhbGVkUG9zaXRpb24gKyAnJSI+PC9zcGFuPic7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHN0cjsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2UKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuICIiOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiAiIjsKKyAgICAgICAgICAgICAgICAgICAgICAgIH07CisgICAgICAgICAgICAgICAgICAgICAgICBzY29wZS5kcmF3U2NhbGUgPSBmdW5jdGlvbiAoc2NhbGVEaXYpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBhbmd1bGFyLmZvckVhY2goYW5ndWxhci5lbGVtZW50KHNjYWxlRGl2KS5maW5kKCdpbnMnKSwgZnVuY3Rpb24gKHNjYWxlTGFiZWwsIGtleSkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzY2FsZUxhYmVsLnN0eWxlLm1hcmdpbkxlZnQgPSAtc2NhbGVMYWJlbC5jbGllbnRXaWR0aCAvIDI7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSk7CisgICAgICAgICAgICAgICAgICAgICAgICB9OworICAgICAgICAgICAgICAgICAgICAgICAgdmFyIGZvcmNlQXBwbHkgPSBmdW5jdGlvbiAodmFsdWUpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YXIgdmFsID0gdmFsdWUuc3BsaXQoIjsiKVsxXTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBzY29wZS4kYXBwbHkoZnVuY3Rpb24gKCkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBuZ01vZGVsLiRzZXRWaWV3VmFsdWUocGFyc2VJbnQodmFsKSk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHNjb3BlLm9wdGlvbnMuY2FsbGJhY2spIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2NvcGUub3B0aW9ucy5jYWxsYmFjayhwYXJzZUludCh2YWwpKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICB9OworICAgICAgICAgICAgICAgICAgICAgICAgc2NvcGUuJHdhdGNoKCdvcHRpb25zJywgZnVuY3Rpb24gKHZhbHVlKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgaW5pdCgpOworICAgICAgICAgICAgICAgICAgICAgICAgfSk7CisgICAgICAgICAgICAgICAgICAgICAgICBhbmd1bGFyLmVsZW1lbnQuc2xpZGVyID0gZnVuY3Rpb24gKGlucHV0RWxlbWVudCwgZWxlbWVudCwgc2V0dGluZ3MpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoIWVsZW1lbnQuZGF0YSgnanNsaWRlcicpKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBlbGVtZW50LmRhdGEoJ2pzbGlkZXInLCBuZXcgU2xpZGVyKGlucHV0RWxlbWVudCwgZWxlbWVudCwgc2V0dGluZ3MpKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YXIgc2xpZGVyT2JqID0gZWxlbWVudC5kYXRhKCdqc2xpZGVyJyk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHNsaWRlck9iajsKKyAgICAgICAgICAgICAgICAgICAgICAgIH07CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICB9OworICAgICAgICAgICAgfV0pOworYW5ndWxhci5tb2R1bGUoJ2F0dC5hYnMuc3RlcHRyYWNrZXInLCBbJ2F0dC5hYnMudHJhbnNpdGlvbiddKQorICAgICAgICAuZGlyZWN0aXZlKCdzdGVwdHJhY2tlcicsIFsnJHRpbWVvdXQnLCBmdW5jdGlvbiAoJHRpbWVvdXQpIHsKKyAgICAgICAgICAgICAgICByZXR1cm4geworICAgICAgICAgICAgICAgICAgICAvLyBUaGlzIGFsbG93cyBkZXYncyBjbGlja0hhbmRsZXIgdG8gY2FuY2VsIGFuIG9wZXJhdGlvbgorICAgICAgICAgICAgICAgICAgICBwcmlvcml0eTogMTAwLAorICAgICAgICAgICAgICAgICAgICBzY29wZTogeworICAgICAgICAgICAgICAgICAgICAgICAgc2RhdGE6ICI9c2RhdGEiLAorICAgICAgICAgICAgICAgICAgICAgICAgY3N0ZXA6ICI9Y3VycmVudFN0ZXAiLAorICAgICAgICAgICAgICAgICAgICAgICAgY2xpY2tIYW5kbGVyOiAnPT8nLAorICAgICAgICAgICAgICAgICAgICAgICAgZGlzYWJsZUNsaWNrOiAnPT8nCisgICAgICAgICAgICAgICAgICAgIH0sCisgICAgICAgICAgICAgICAgICAgIHJlc3RyaWN0OiAnRUEnLAorICAgICAgICAgICAgICAgICAgICByZXBsYWNlOiB0cnVlLAorICAgICAgICAgICAgICAgICAgICB0ZW1wbGF0ZVVybDogJ2FwcC9zY3JpcHRzL25nX2pzX2F0dF90cGxzL3N0ZXB0cmFja2VyL3N0ZXAtdHJhY2tlci5odG1sJywKKyAgICAgICAgICAgICAgICAgICAgbGluazogZnVuY3Rpb24gKHNjb3BlLCBlbGVtKSB7CisgICAgICAgICAgICAgICAgICAgICAgICBpZiAoc2NvcGUuZGlzYWJsZUNsaWNrID09PSB1bmRlZmluZWQpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBzY29wZS5kaXNhYmxlQ2xpY2sgPSBmYWxzZTsKKyAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgICR0aW1lb3V0KGZ1bmN0aW9uICgpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoc2NvcGUuY3N0ZXAgPCAxKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNjb3BlLmNzdGVwID0gMTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgZWxzZSBpZiAoc2NvcGUuY3N0ZXAgPiBzY29wZS5zZGF0YS5sZW5ndGgpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2NvcGUuY3N0ZXAgPSBzY29wZS5zZGF0YS5sZW5ndGg7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhciBkaXZzID0gZWxlbS5maW5kKCdkaXYnKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YXIgc2xpZGVydHJhY2tzID0gW107CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgZm9yICh2YXIgaSBpbiBkaXZzKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChkaXZzLmVxKGkpWzBdKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YXIgZWwgPSBkaXZzLmVxKGkpWzBdLmNsYXNzTmFtZTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChlbC5pbmRleE9mKCd0cmFjayBuZy1zY29wZScpID4gLTEpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzbGlkZXJ0cmFja3MucHVzaChkaXZzLmVxKGkpKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YXIgY3VycmVudFBhZ2UsdG90YWxQYWdlLGN1cnJlbnRUcmFjayA9IHVwZGF0ZUN1cnJlbnRUcmFjayhzY29wZS5jc3RlcCk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgZnVuY3Rpb24gdXBkYXRlQ3VycmVudFRyYWNrKHN0ZXApIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gQWx3YXlzIHJldHVybiB0aGUgc3RlcC0xIGJlY2F1c2UgYXJyYXkgc3RhcnRzIGF0IDAKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGFuZ3VsYXIuZWxlbWVudChzbGlkZXJ0cmFja3Nbc3RlcCAtIDFdKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgZnVuY3Rpb24gdXBkYXRlVHJhY2tXaWR0aCgpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHNjb3BlLmNzdGVwID4gMCAmJiBzY29wZS5jc3RlcCA8PSBzY29wZS5zZGF0YS5sZW5ndGggLSAxICYmIGN1cnJlbnRQYWdlID4gMCkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFyIG5ld1dpZHRoID0gKChjdXJyZW50UGFnZSAvIHRvdGFsUGFnZSkgKiAxMDApICsgIiUiOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY3VycmVudFRyYWNrID0gdXBkYXRlQ3VycmVudFRyYWNrKHNjb3BlLmNzdGVwKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGN1cnJlbnRUcmFjay5jc3MoJ3dpZHRoJywgbmV3V2lkdGgpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZ1bmN0aW9uIHVwZGF0ZVBhZ2VzKCkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoc2NvcGUuY3N0ZXAgPD0gc2NvcGUuc2RhdGEubGVuZ3RoKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjdXJyZW50UGFnZSA9IHNjb3BlLnNkYXRhW3Njb3BlLmNzdGVwIC0gMV1bJ2N1cnJlbnRQYWdlJ107CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0b3RhbFBhZ2UgPSBzY29wZS5zZGF0YVtzY29wZS5jc3RlcCAtIDFdWyd0b3RhbFBhZ2VzJ107CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gZHluYW1pY2FsbHkgYWRkIHdpZHRoIGZvciBzdGVwcywgZGVwZW5kaW5nIG9uIHRoZSBudW1iZXIgb2Ygc3RlcHMuCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2NvcGUuc2V0X3dpZHRoID0gZnVuY3Rpb24gKGluZGV4dmFsKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhciBzZXR3aWR0aCA9ICgxMDAgLyAoc2NvcGUuc2RhdGEubGVuZ3RoIC0gMSkpICsgIiUiOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyBza2lwIGxhc3QgZWxlbWVudCBhbmQgYWRkIHdpZHRoIGZvciBhbGwgb3RoZXIgZWxlbWVudAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoKHNjb3BlLnNkYXRhLmxlbmd0aCAtIDEpID4gaW5kZXh2YWwpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiB7J3dpZHRoJzogc2V0d2lkdGh9OworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgfTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBzY29wZS4kd2F0Y2goJ3NkYXRhJywgZnVuY3Rpb24gKCkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB1cGRhdGVQYWdlcygpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YXIgcHJldlN0ZXAgPSBzY29wZS5jc3RlcDsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gQmVmb3JlIGFueXRoaW5nLCBlbnN1cmUgY3VycmVudFBhZ2UgaXMgbmV2ZXIgYmVsb3cgMQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoY3VycmVudFBhZ2UgPCAxKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjdXJyZW50UGFnZSA9IDE7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoc2NvcGUuY3N0ZXAgIT09IDEpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyBEZWNyZWFzZSBzdGVwLCBjdXJyZW50IHRyYWNrIHdpZHRoIGlzIDAlLCBuZXcgc3RlcCB3aWR0aCB1cGRhdGVzCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2NvcGUuY3N0ZXAtLTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB1cGRhdGVQYWdlcygpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vIE1vdmUgdG8gbmV4dCBzdGVwLCByZXNldCBjdXJyZW50UGFnZSwgdG90YWxQYWdlLCBhbmQgZW5zdXJlIHByZXZpb3VzIHN0ZXBzIGFyZSBjb21wbGV0ZWQKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGN1cnJlbnRQYWdlID4gdG90YWxQYWdlKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoc2NvcGUuY3N0ZXAgPiBzY29wZS5zZGF0YS5sZW5ndGggLSAxKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2NvcGUuY3N0ZXArKzsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm47CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGN1cnJlbnRQYWdlID0gdG90YWxQYWdlOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHVwZGF0ZVRyYWNrV2lkdGgoKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzY29wZS5jc3RlcCsrOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHVwZGF0ZVBhZ2VzKCk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdXBkYXRlVHJhY2tXaWR0aCgpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChjdXJyZW50UGFnZSA8IDEgJiYgcHJldlN0ZXAgPT09IHNjb3BlLmNzdGVwKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjdXJyZW50UGFnZSA9IDE7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoc2NvcGUuY3N0ZXAgPiAxKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2NvcGUuY3N0ZXAtLTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzY29wZS5zZGF0YVtzY29wZS5jc3RlcCAtIDFdWydjdXJyZW50UGFnZSddID0gc2NvcGUuc2RhdGFbc2NvcGUuY3N0ZXAgLSAxXVsndG90YWxQYWdlcyddOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNjb3BlLnNkYXRhW3Njb3BlLmNzdGVwXVsnY3VycmVudFBhZ2UnXSA9IDE7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdXBkYXRlVHJhY2tXaWR0aCgpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0sIHRydWUpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vYWRkIHRoZSBhY3RpdmUgY2xhc3MgZm9yIGN1cnJlbnQgc3RlcAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNjb3BlLmFjdGl2ZXN0ZXAgPSBmdW5jdGlvbiAoaW5kZXgpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIChpbmRleCA9PT0gc2NvcGUuY3N0ZXAgLSAxKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB9OworICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vYWRkIHRoZSBkb25lIGNsYXNzIGZvciBmaW5pc2hlZCBzdGVwCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2NvcGUuZG9uZXN0ZXBzID0gZnVuY3Rpb24gKGluZGV4KSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiAoaW5kZXggPCBzY29wZS5jc3RlcCAtIDEpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIH07CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgLy9hZGQgdGhlIGxhc3QgY2xhc3MgZm9yIGZpbmFsIHN0ZXAKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBzY29wZS5sYXN0c3RlcCA9IGZ1bmN0aW9uIChpbmRleCkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gKGluZGV4ID09PSBzY29wZS5zZGF0YS5sZW5ndGggLSAxKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB9OworICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNjb3BlLmlzSW5jb21wbGV0ZSA9IGZ1bmN0aW9uIChpbmRleCkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoaW5kZXggPT09IHNjb3BlLmNzdGVwIC0gMSkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGZhbHNlOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChpbmRleCA+PSAwICYmIGluZGV4IDwgc2NvcGUuc2RhdGEubGVuZ3RoIC0gMSkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFyIHN0ZXAgPSBzY29wZS5zZGF0YVtpbmRleF07CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gKHN0ZXBbJ2N1cnJlbnRQYWdlJ10gPD0gc3RlcFsndG90YWxQYWdlcyddKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgICAgIH07CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgLy9jbGljayBldmVudAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNjb3BlLnN0ZXBjbGljayA9IGZ1bmN0aW9uICgkZXZlbnQsIHN0ZXBzKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vIElmIHdlIGFyZSBkZWNyZWFzaW5nIHN0ZXBzLCByZXNldCBhbGwgY3VycmVudFBhZ2UgY291bnRzIHRvIDEKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHN0ZXBzIDwgc2NvcGUuY3N0ZXApIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZvciAodmFyIGkgPSBzY29wZS5jc3RlcCAtIDE7IGkgPiBzdGVwczsgaS0tKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2NvcGUuc2RhdGFbaV1bJ2N1cnJlbnRQYWdlJ10gPSAxOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2NvcGUuc2RhdGFbc3RlcHNdWydjdXJyZW50UGFnZSddLS07CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGFuZ3VsYXIuaXNGdW5jdGlvbihzY29wZS5jbGlja0hhbmRsZXIpKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzY29wZS5jbGlja0hhbmRsZXIoJGV2ZW50LCBzdGVwcyk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2NvcGUuY3N0ZXAgPSBzdGVwcyArIDE7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vIEluIHRoZSBjYXNlIHdlIGRlY3JlbWVudGVkIHByZXZpb3VzbHkgZnJvbSB0aGlzIHN0ZXAsIHdlIG5lZWQgdG8gcmVzZXQgY3VycmVudHBhZ2UgdG8gZGVmYXVsdAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoc2NvcGUuY3N0ZXAgPD0gc2NvcGUuc2RhdGEubGVuZ3RoICYmIHNjb3BlLnNkYXRhW3Njb3BlLmNzdGVwXVsnY3VycmVudFBhZ2UnXSA8IDEpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNjb3BlLnNkYXRhW3Njb3BlLmNzdGVwXVsnY3VycmVudFBhZ2UnXSA9IDE7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdXBkYXRlUGFnZXMoKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdXBkYXRlVHJhY2tXaWR0aCgpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIH07CisgICAgICAgICAgICAgICAgICAgICAgICB9LCAxMDApOworICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgfTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgXSkKKyAgICAgICAgLmNvbnN0YW50KCd0aW1lbGluZUNvbnN0YW50cycsIHsKKyAgICAgICAgICAgIFNURVBfVFlQRTogeworICAgICAgICAgICAgICAgIEFMRVJUOiAnYWxlcnQnLAorICAgICAgICAgICAgICAgIENPTVBMRVRFRDogJ2NvbXBsZXRlZCcsCisgICAgICAgICAgICAgICAgQ0FOQ0VMTEVEOiAnY2FuY2VsbGVkJworICAgICAgICAgICAgfQorICAgICAgICB9KQorICAgICAgICAuY29udHJvbGxlcignQXR0VGltZWxpbmVDdHJsJywgWyckc2NvcGUnLCAnJHRpbWVvdXQnLCBmdW5jdGlvbiAoJHNjb3BlLCAkdGltZW91dCkgeworICAgICAgICAgICAgICAgIHZhciB0aW1lbGluZUJhckN0cmxzID0gW107CisgICAgICAgICAgICAgICAgdmFyIHRpbWVsaW5lRG90Q3RybHMgPSBbXTsKKyAgICAgICAgICAgICAgICB0aGlzLm51bVN0ZXBzID0gMDsKKyAgICAgICAgICAgICAgICB0aGlzLmlzQWx0ZXJuYXRlID0gZnVuY3Rpb24gKCkgeworICAgICAgICAgICAgICAgICAgICByZXR1cm4gJHNjb3BlLmFsdGVybmF0ZTsKKyAgICAgICAgICAgICAgICB9OworICAgICAgICAgICAgICAgIHRoaXMuYWRkVGltZWxpbmVCYXJDdHJscyA9IGZ1bmN0aW9uICh0KSB7CisgICAgICAgICAgICAgICAgICAgIHRpbWVsaW5lQmFyQ3RybHMucHVzaCh0KTsKKyAgICAgICAgICAgICAgICB9OworICAgICAgICAgICAgICAgIHRoaXMuYWRkVGltZWxpbmVEb3RDdHJscyA9IGZ1bmN0aW9uIChiKSB7CisgICAgICAgICAgICAgICAgICAgIHRpbWVsaW5lRG90Q3RybHMucHVzaChiKTsKKyAgICAgICAgICAgICAgICB9OworICAgICAgICAgICAgICAgICR0aW1lb3V0KGluaXQsIDIwMCk7CisgICAgICAgICAgICAgICAgZnVuY3Rpb24gaW5pdCgpIHsKKyAgICAgICAgICAgICAgICAgICAgZnVuY3Rpb24gY29tcGFyZShhLCBiKSB7CisgICAgICAgICAgICAgICAgICAgICAgICBpZiAoYS5vcmRlciA8IGIub3JkZXIpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gLTE7CisgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICBpZiAoYS5vcmRlciA+IGIub3JkZXIpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gMTsKKyAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiAwOworICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgIHRpbWVsaW5lRG90Q3RybHMuc29ydChjb21wYXJlKTsKKyAgICAgICAgICAgICAgICAgICAgdGltZWxpbmVCYXJDdHJscy5zb3J0KGNvbXBhcmUpOworICAgICAgICAgICAgICAgICAgICBpZiAoJHNjb3BlLiRwYXJlbnQuYW5pbWF0ZSkgeworICAgICAgICAgICAgICAgICAgICAgICAgYW5pbWF0ZVNlcXVlbmNlKCk7CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgJHNjb3BlLiR3YXRjaCgndHJpZ2dlcicsIGZ1bmN0aW9uICh2YWwpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIGlmICh2YWwpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAkc2NvcGUucmVzZXRUaW1lbGluZSgpOworICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAkc2NvcGUuJHBhcmVudC5hbmltYXRlID0gZmFsc2U7CisgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgIH0pOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICBmdW5jdGlvbiBhbmltYXRlU2VxdWVuY2UoKSB7CisgICAgICAgICAgICAgICAgICAgIHZhciBkb3RzRHVyYXRpb24gPSAuMjU7CisgICAgICAgICAgICAgICAgICAgIHZhciB0aW1lbGluZUJhclByb2dyZXNzRHVyYXRpb24gPSAuMjU7CisgICAgICAgICAgICAgICAgICAgIGlmICh0eXBlb2YgJHNjb3BlLmJhckFuaW1hdGVEdXJhdGlvbiA9PT0gJ251bWJlcicpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIHRpbWVsaW5lQmFyUHJvZ3Jlc3NEdXJhdGlvbiA9ICRzY29wZS5iYXJBbmltYXRlRHVyYXRpb247CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgdmFyIHN0YXJ0ID0gY3JlYXRlQW5pbWF0aW9uKDAsIHRpbWVsaW5lQmFyUHJvZ3Jlc3NEdXJhdGlvbik7CisgICAgICAgICAgICAgICAgICAgIGZ1bmN0aW9uIHNldFRvSW5hY3RpdmVTdGF0ZXMoKSB7CisgICAgICAgICAgICAgICAgICAgICAgICBmb3IgKHZhciBpIGluIHRpbWVsaW5lRG90Q3RybHMpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YXIgZG90Q3RybCA9IHRpbWVsaW5lRG90Q3RybHNbaV07CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGkgJSAyID09PSAwKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRvdEN0cmwudW5ob3ZlcmVkU3RhdGVGb3JCZWxvdyguMjUpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRvdEN0cmwudW5ob3ZlcmVkU3RhdGVGb3JBYm92ZSguMjUpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoZG90Q3RybC5pc1N0b3AoKSkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgZnVuY3Rpb24gY3JlYXRlQW5pbWF0aW9uKGksIGR1cmF0aW9uKSB7CisgICAgICAgICAgICAgICAgICAgICAgICBpZiAoaSA9PT0gMCkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBmdW5jdGlvbiAoKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICh0aW1lbGluZURvdEN0cmxzW2kgKyAxXS5pc1N0b3AoKSAmJiB0aW1lbGluZURvdEN0cmxzW2kgKyAxXS5pc0NhbmNlbGxlZCgpKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0aW1lbGluZUJhckN0cmxzW2ldLmlzQ2FuY2VsbGVkKHRydWUpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRpbWVsaW5lQmFyQ3RybHNbaV0uYW5pbWF0ZShjcmVhdGVBbmltYXRpb24oaSArIDEsIGR1cmF0aW9uKSwgZHVyYXRpb24pOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIH07CisgICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKGkgPT09IHRpbWVsaW5lQmFyQ3RybHMubGVuZ3RoIC0gMSkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBmdW5jdGlvbiAoKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vUmVtb3ZlcyB0aGUgYm9sZGVkIHRleHQgZnJvbSB0aGUgc3RhcnQKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHRpbWVsaW5lRG90Q3RybHNbMF0uaXNDdXJyZW50U3RlcCgpKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0aW1lbGluZURvdEN0cmxzWzBdLmlzQ3VycmVudFN0ZXAoZmFsc2UpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICh0aW1lbGluZURvdEN0cmxzW2ldLmlzU3RvcCgpKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0aW1lbGluZURvdEN0cmxzW2kgLSAxXS5zaHJpbmtBbmltYXRlKGRvdHNEdXJhdGlvbik7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0aW1lbGluZURvdEN0cmxzW2ldLmlzQ3VycmVudFN0ZXAodHJ1ZSk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0aW1lbGluZURvdEN0cmxzW2kgLSAxXS5zaHJpbmtBbmltYXRlKGRvdHNEdXJhdGlvbik7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0aW1lbGluZUJhckN0cmxzW2ldLmFuaW1hdGUoY3JlYXRlQW5pbWF0aW9uKGkgKyAxLCBkdXJhdGlvbiksIGR1cmF0aW9uKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0aW1lbGluZURvdEN0cmxzW2ldLmV4cGFuZGVkQW5pbWF0ZShkb3RzRHVyYXRpb24pOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAkdGltZW91dChmdW5jdGlvbiAoKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzZXRUb0luYWN0aXZlU3RhdGVzKCk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0sIDUwMCk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgfTsKKyAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgIC8vRW5kIERvdAorICAgICAgICAgICAgICAgICAgICAgICAgZWxzZSBpZiAoaSA9PT0gdGltZWxpbmVCYXJDdHJscy5sZW5ndGgpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gZnVuY3Rpb24gKCkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvL1JlbW92ZXMgdGhlIGJvbGRlZCB0ZXh0IGZyb20gdGhlIHN0YXJ0CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICh0aW1lbGluZURvdEN0cmxzWzBdLmlzQ3VycmVudFN0ZXAoKSkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdGltZWxpbmVEb3RDdHJsc1swXS5pc0N1cnJlbnRTdGVwKGZhbHNlKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0aW1lbGluZURvdEN0cmxzW2kgLSAxXS5zaHJpbmtBbmltYXRlKGRvdHNEdXJhdGlvbik7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRpbWVsaW5lRG90Q3RybHNbaV0uZXhwYW5kZWRBbmltYXRlKGRvdHNEdXJhdGlvbik7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRpbWVsaW5lRG90Q3RybHNbaV0uaXNDdXJyZW50U3RlcCh0cnVlKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJHRpbWVvdXQoZnVuY3Rpb24gKCkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2V0VG9JbmFjdGl2ZVN0YXRlcygpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9LCA1MDApOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIH07CisgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICBlbHNlIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gZnVuY3Rpb24gKCkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvL1JlbW92ZXMgdGhlIGJvbGRlZCB0ZXh0IGZyb20gdGhlIHN0YXJ0CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICh0aW1lbGluZURvdEN0cmxzWzBdLmlzQ3VycmVudFN0ZXAoKSkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdGltZWxpbmVEb3RDdHJsc1swXS5pc0N1cnJlbnRTdGVwKGZhbHNlKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAodGltZWxpbmVEb3RDdHJsc1tpXS5pc1N0b3AoKSkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdGltZWxpbmVEb3RDdHJsc1tpIC0gMV0uc2hyaW5rQW5pbWF0ZShkb3RzRHVyYXRpb24pOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdGltZWxpbmVEb3RDdHJsc1tpXS5leHBhbmRlZEFuaW1hdGUoZG90c0R1cmF0aW9uKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRpbWVsaW5lRG90Q3RybHNbaV0uaXNDdXJyZW50U3RlcCh0cnVlKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICR0aW1lb3V0KGZ1bmN0aW9uICgpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzZXRUb0luYWN0aXZlU3RhdGVzKCk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9LCA1MDApOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHRpbWVsaW5lRG90Q3RybHNbaSArIDFdLmlzU3RvcCgpICYmIHRpbWVsaW5lRG90Q3RybHNbaSArIDFdLmlzQ2FuY2VsbGVkKCkpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0aW1lbGluZUJhckN0cmxzW2ldLmlzQ2FuY2VsbGVkKHRydWUpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdGltZWxpbmVEb3RDdHJsc1tpIC0gMV0uc2hyaW5rQW5pbWF0ZShkb3RzRHVyYXRpb24pOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdGltZWxpbmVCYXJDdHJsc1tpXS5hbmltYXRlKGNyZWF0ZUFuaW1hdGlvbihpICsgMSwgZHVyYXRpb24pLCBkdXJhdGlvbik7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0aW1lbGluZURvdEN0cmxzW2ldLmV4cGFuZGVkQW5pbWF0ZShkb3RzRHVyYXRpb24pOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgfTsKKyAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICBzdGFydCgpOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH1dKQorICAgICAgICAuZGlyZWN0aXZlKCdhdHRUaW1lbGluZScsIFsnJHRpbWVvdXQnLCAnJGNvbXBpbGUnLCBmdW5jdGlvbiAoJHRpbWVvdXQsICRjb21waWxlKSB7CisgICAgICAgICAgICAgICAgcmV0dXJuIHsKKyAgICAgICAgICAgICAgICAgICAgcmVzdHJpY3Q6ICdFQScsCisgICAgICAgICAgICAgICAgICAgIHJlcGxhY2U6IHRydWUsCisgICAgICAgICAgICAgICAgICAgIHNjb3BlOiB7CisgICAgICAgICAgICAgICAgICAgICAgICBzdGVwczogJz0nLAorICAgICAgICAgICAgICAgICAgICAgICAgdHJpZ2dlcjogJz0nLAorICAgICAgICAgICAgICAgICAgICAgICAgYWx0ZXJuYXRlOiAnPScsCisgICAgICAgICAgICAgICAgICAgICAgICBiYXJBbmltYXRlRHVyYXRpb246ICc9JworICAgICAgICAgICAgICAgICAgICB9LAorICAgICAgICAgICAgICAgICAgICB0ZW1wbGF0ZVVybDogJ2FwcC9zY3JpcHRzL25nX2pzX2F0dF90cGxzL3N0ZXB0cmFja2VyL3RpbWVsaW5lLmh0bWwnLAorICAgICAgICAgICAgICAgICAgICBjb250cm9sbGVyOiAnQXR0VGltZWxpbmVDdHJsJywKKyAgICAgICAgICAgICAgICAgICAgbGluazogZnVuY3Rpb24gKHNjb3BlLCBlbGVtZW50LCBhdHRycywgY3RybCkgeworICAgICAgICAgICAgICAgICAgICAgICAgdmFyIGluaXQgPSBmdW5jdGlvbiAoKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFyIHN0ZXBzID0gc2NvcGUuc3RlcHM7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFyIG1pZGRsZVN0ZXBzID0gW107CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgZm9yICh2YXIgaSA9IDE7IGkgPCBzdGVwcy5sZW5ndGg7IGkrKykgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YXIgYVN0ZXAgPSBzdGVwc1tpXTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbWlkZGxlU3RlcHMucHVzaChhU3RlcCk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNjb3BlLm1pZGRsZVN0ZXBzID0gbWlkZGxlU3RlcHM7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgLy9Vc2VkIGluIGNhbGN1bGF0aW5nIHRoZSB3aWR0aCBvZiB0aGUgbG9hZGluZyBiYXJzCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgY3RybC5udW1TdGVwcyA9IHN0ZXBzLmxlbmd0aCAtIDE7CisgICAgICAgICAgICAgICAgICAgICAgICB9OworICAgICAgICAgICAgICAgICAgICAgICAgaW5pdCgpOworICAgICAgICAgICAgICAgICAgICAgICAgLy9SZWNvbXBpbGUgaW4gY2FzZSBvZiBzY29wZSBjaGFuZ2VzCisgICAgICAgICAgICAgICAgICAgICAgICBzY29wZS5yZXNldFRpbWVsaW5lID0gZnVuY3Rpb24gKCkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNjb3BlLmFuaW1hdGUgPSB0cnVlOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICRjb21waWxlKGVsZW1lbnQpKHNjb3BlKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIH07CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICB9OworICAgICAgICAgICAgfV0pCisgICAgICAgIC5jb250cm9sbGVyKCdUaW1lbGluZUJhckN0cmwnLCBbJyRzY29wZScsIGZ1bmN0aW9uICgkc2NvcGUpIHsKKyAgICAgICAgICAgICAgICB0aGlzLnR5cGUgPSAndGltZWxpbmViYXInOworICAgICAgICAgICAgICAgIHRoaXMub3JkZXIgPSBwYXJzZUludCgkc2NvcGUub3JkZXIpOworICAgICAgICAgICAgICAgIHRoaXMuYW5pbWF0ZSA9IGZ1bmN0aW9uIChjYWxsYmFjaywgZHVyYXRpb24pIHsKKyAgICAgICAgICAgICAgICAgICAgJHNjb3BlLmxvYWRpbmdBbmltYXRpb24oY2FsbGJhY2ssIGR1cmF0aW9uKTsKKyAgICAgICAgICAgICAgICB9OworICAgICAgICAgICAgICAgIHRoaXMuaXNDYW5jZWxsZWQgPSBmdW5jdGlvbiAoaXNDYW5jZWxsZWQpIHsKKyAgICAgICAgICAgICAgICAgICAgJHNjb3BlLmlzQ2FuY2VsbGVkID0gaXNDYW5jZWxsZWQ7CisgICAgICAgICAgICAgICAgfTsKKyAgICAgICAgICAgIH1dKQorICAgICAgICAuZGlyZWN0aXZlKCd0aW1lbGluZUJhcicsIFsnYW5pbWF0aW9uJywgJyRwcm9ncmVzc0JhcicsIGZ1bmN0aW9uIChhbmltYXRpb24sICRwcm9ncmVzc0JhcikgeworICAgICAgICAgICAgICAgIHJldHVybiB7CisgICAgICAgICAgICAgICAgICAgIHJlc3RyaWN0OiAnRUEnLAorICAgICAgICAgICAgICAgICAgICByZXBsYWNlOiB0cnVlLAorICAgICAgICAgICAgICAgICAgICB0ZW1wbGF0ZVVybDogJ2FwcC9zY3JpcHRzL25nX2pzX2F0dF90cGxzL3N0ZXB0cmFja2VyL3RpbWVsaW5lQmFyLmh0bWwnLAorICAgICAgICAgICAgICAgICAgICBzY29wZTogeworICAgICAgICAgICAgICAgICAgICAgICAgb3JkZXI6ICdAJworICAgICAgICAgICAgICAgICAgICB9LAorICAgICAgICAgICAgICAgICAgICByZXF1aXJlOiBbJ15hdHRUaW1lbGluZScsICd0aW1lbGluZUJhciddLAorICAgICAgICAgICAgICAgICAgICBjb250cm9sbGVyOiAnVGltZWxpbmVCYXJDdHJsJywKKyAgICAgICAgICAgICAgICAgICAgbGluazogZnVuY3Rpb24gKHNjb3BlLCBlbGVtZW50LCBhdHRycywgY3RybHMpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIHZhciBhdHRUaW1lbGluZUN0cmwgPSBjdHJsc1swXTsKKyAgICAgICAgICAgICAgICAgICAgICAgIHZhciB0aW1lbGluZUJhckN0cmwgPSBjdHJsc1sxXTsKKyAgICAgICAgICAgICAgICAgICAgICAgIGF0dFRpbWVsaW5lQ3RybC5hZGRUaW1lbGluZUJhckN0cmxzKHRpbWVsaW5lQmFyQ3RybCk7CisgICAgICAgICAgICAgICAgICAgICAgICBzY29wZS5pc0NvbXBsZXRlZCA9IHRydWU7CisgICAgICAgICAgICAgICAgICAgICAgICB2YXIgd2lkdGhQZXJjID0gKDEwMCAvIGF0dFRpbWVsaW5lQ3RybC5udW1TdGVwcykgLSAzOworICAgICAgICAgICAgICAgICAgICAgICAgZWxlbWVudC5jc3MoJ3dpZHRoJywgd2lkdGhQZXJjICsgJyUnKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIHZhciBlbGVtID0gZWxlbWVudC5maW5kKCdkaXYnKS5lcSgwKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIGFuaW1hdGlvbi5zZXQoZWxlbSwge29wYWNpdHk6IDAuMH0pOworICAgICAgICAgICAgICAgICAgICAgICAgdmFyIHVwZGF0ZUNhbGxiYWNrID0gZnVuY3Rpb24gKHNlbGZFbGVtZW50KSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgYW5pbWF0aW9uLnNldChlbGVtLCB7b3BhY2l0eTogMS4wfSk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgYW5pbWF0aW9uLnNldChlbGVtLCB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNjYWxlWDogc2VsZkVsZW1lbnQucHJvZ3Jlc3MoKSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdHJhbnNmb3JtT3JpZ2luOiAibGVmdCIKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB9KTsKKyAgICAgICAgICAgICAgICAgICAgICAgIH07CisgICAgICAgICAgICAgICAgICAgICAgICBzY29wZS5sb2FkaW5nQW5pbWF0aW9uID0gJHByb2dyZXNzQmFyKHVwZGF0ZUNhbGxiYWNrKTsKKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIH07CisgICAgICAgICAgICB9XSkKKyAgICAgICAgLmNvbnRyb2xsZXIoJ1RpbWVsaW5lRG90Q3RybCcsIFsnJHNjb3BlJywgJyR0aW1lb3V0JywgJ3RpbWVsaW5lQ29uc3RhbnRzJywgZnVuY3Rpb24gKCRzY29wZSwgJHRpbWVvdXQsIHRpbWVsaW5lQ29uc3RhbnRzKSB7CisgICAgICAgICAgICAgICAgdGhpcy50eXBlID0gJ2RvdCc7CisgICAgICAgICAgICAgICAgdGhpcy5vcmRlciA9IHBhcnNlSW50KCRzY29wZS5vcmRlcik7CisgICAgICAgICAgICAgICAgdmFyIHNlbGYgPSB0aGlzOworICAgICAgICAgICAgICAgICR0aW1lb3V0KGZ1bmN0aW9uICgpIHsKKyAgICAgICAgICAgICAgICAgICAgaWYgKHNlbGYub3JkZXIgIT09IDApIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIGlmIChzZWxmLm9yZGVyICUgMiAhPT0gMCkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICRzY29wZS5pbml0aWFsaXplQWJvdmVGb3JBbmltYXRpb24oKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgIGVsc2UgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICRzY29wZS5pbml0aWFsaXplQmVsb3dGb3JBbmltYXRpb24oKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIH0pOworICAgICAgICAgICAgICAgIHRoaXMuZXhwYW5kZWRBbmltYXRlID0gZnVuY3Rpb24gKGR1cmF0aW9uKSB7CisgICAgICAgICAgICAgICAgICAgICRzY29wZS5zZXRDb2xvcigpOworICAgICAgICAgICAgICAgICAgICAkc2NvcGUuZXhwYW5kZWRBbmltYXRlKGR1cmF0aW9uKTsKKyAgICAgICAgICAgICAgICAgICAgaWYgKHNlbGYub3JkZXIgIT09IDAgJiYgISRzY29wZS5pc1N0ZXBzTGVzc1RoYW5GaXZlKCkpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIGlmIChzZWxmLm9yZGVyICUgMiAhPT0gMCkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICRzY29wZS5leHBhbmRDb250ZW50Rm9yQWJvdmUoZHVyYXRpb24pOworICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAkc2NvcGUuZXhwYW5kQ29udGVudEZvckJlbG93KGR1cmF0aW9uKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIH07CisgICAgICAgICAgICAgICAgdGhpcy51bmhvdmVyZWRTdGF0ZUZvckFib3ZlID0gZnVuY3Rpb24gKGR1cmF0aW9uKSB7CisgICAgICAgICAgICAgICAgICAgICRzY29wZS51bmhvdmVyZWRTdGF0ZUZvckFib3ZlKGR1cmF0aW9uKTsKKyAgICAgICAgICAgICAgICB9OworICAgICAgICAgICAgICAgIHRoaXMudW5ob3ZlcmVkU3RhdGVGb3JCZWxvdyA9IGZ1bmN0aW9uIChkdXJhdGlvbikgeworICAgICAgICAgICAgICAgICAgICAkc2NvcGUudW5ob3ZlcmVkU3RhdGVGb3JCZWxvdyhkdXJhdGlvbik7CisgICAgICAgICAgICAgICAgfTsKKyAgICAgICAgICAgICAgICB0aGlzLnNocmlua0FuaW1hdGUgPSBmdW5jdGlvbiAoZHVyYXRpb24pIHsKKyAgICAgICAgICAgICAgICAgICAgJHNjb3BlLnNocmlua0FuaW1hdGUoZHVyYXRpb24pOworICAgICAgICAgICAgICAgIH07CisgICAgICAgICAgICAgICAgdGhpcy5zZXRFeHBhbmRlZCA9IGZ1bmN0aW9uICgpIHsKKyAgICAgICAgICAgICAgICAgICAgJHNjb3BlLnNldFNpemUoMyk7CisgICAgICAgICAgICAgICAgfTsKKyAgICAgICAgICAgICAgICB0aGlzLmlzU3RvcCA9IGZ1bmN0aW9uICgpIHsKKyAgICAgICAgICAgICAgICAgICAgcmV0dXJuICRzY29wZS5pc1N0b3A7CisgICAgICAgICAgICAgICAgfTsKKyAgICAgICAgICAgICAgICB0aGlzLmlzQ2FuY2VsbGVkID0gZnVuY3Rpb24gKCkgeworICAgICAgICAgICAgICAgICAgICByZXR1cm4gKCRzY29wZS50eXBlID09PSB0aW1lbGluZUNvbnN0YW50cy5TVEVQX1RZUEUuQ0FOQ0VMTEVEKTsKKyAgICAgICAgICAgICAgICB9OworICAgICAgICAgICAgICAgIHRoaXMuaXNBbGVydCA9IGZ1bmN0aW9uICgpIHsKKyAgICAgICAgICAgICAgICAgICAgcmV0dXJuICgkc2NvcGUudHlwZSA9PT0gdGltZWxpbmVDb25zdGFudHMuU1RFUF9UWVBFLkFMRVJUKTsKKyAgICAgICAgICAgICAgICB9OworICAgICAgICAgICAgICAgIC8vU2V0cyB0aGUgYm9sZGVkIHRleHQKKyAgICAgICAgICAgICAgICB0aGlzLmlzQ3VycmVudFN0ZXAgPSBmdW5jdGlvbiAoaXNDdXJyZW50U3RlcCkgeworICAgICAgICAgICAgICAgICAgICBpZiAoaXNDdXJyZW50U3RlcCAhPT0gdW5kZWZpbmVkKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAkc2NvcGUuaXNDdXJyZW50U3RlcCA9IGlzQ3VycmVudFN0ZXA7CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgcmV0dXJuICRzY29wZS5pc0N1cnJlbnRTdGVwOworICAgICAgICAgICAgICAgIH07CisgICAgICAgICAgICB9XSkKKyAgICAgICAgLmRpcmVjdGl2ZSgndGltZWxpbmVEb3QnLCBbJ2FuaW1hdGlvbicsICd0aW1lbGluZUNvbnN0YW50cycsCisgICAgICAgICAgICBmdW5jdGlvbiAoYW5pbWF0aW9uLCB0aW1lbGluZUNvbnN0YW50cykgeworICAgICAgICAgICAgICAgIHJldHVybiB7CisgICAgICAgICAgICAgICAgICAgIHJlc3RyaWN0OiAnRUEnLAorICAgICAgICAgICAgICAgICAgICByZXBsYWNlOiB0cnVlLAorICAgICAgICAgICAgICAgICAgICBzY29wZTogeworICAgICAgICAgICAgICAgICAgICAgICAgb3JkZXI6ICdAJywKKyAgICAgICAgICAgICAgICAgICAgICAgIHRpdGxlOiAnQCcsCisgICAgICAgICAgICAgICAgICAgICAgICBkZXNjcmlwdGlvbjogJ0AnLAorICAgICAgICAgICAgICAgICAgICAgICAgYnk6ICdAJywKKyAgICAgICAgICAgICAgICAgICAgICAgIGRhdGU6ICdAJywKKyAgICAgICAgICAgICAgICAgICAgICAgIHR5cGU6ICdAJworICAgICAgICAgICAgICAgICAgICB9LAorICAgICAgICAgICAgICAgICAgICB0ZW1wbGF0ZVVybDogJ2FwcC9zY3JpcHRzL25nX2pzX2F0dF90cGxzL3N0ZXB0cmFja2VyL3RpbWVsaW5lRG90Lmh0bWwnLAorICAgICAgICAgICAgICAgICAgICByZXF1aXJlOiBbJ15hdHRUaW1lbGluZScsICd0aW1lbGluZURvdCddLAorICAgICAgICAgICAgICAgICAgICBjb250cm9sbGVyOiAnVGltZWxpbmVEb3RDdHJsJywKKyAgICAgICAgICAgICAgICAgICAgbGluazogZnVuY3Rpb24gKHNjb3BlLCBlbGVtZW50LCBhdHRycywgY3RybHMpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIHZhciBhdHRUaW1lbGluZUN0cmwgPSBjdHJsc1swXTsKKyAgICAgICAgICAgICAgICAgICAgICAgIHZhciB0aW1lbGluZURvdEN0cmwgPSBjdHJsc1sxXTsKKyAgICAgICAgICAgICAgICAgICAgICAgIGF0dFRpbWVsaW5lQ3RybC5hZGRUaW1lbGluZURvdEN0cmxzKHRpbWVsaW5lRG90Q3RybCk7CisgICAgICAgICAgICAgICAgICAgICAgICBzY29wZS5udW1TdGVwcyA9IGF0dFRpbWVsaW5lQ3RybC5udW1TdGVwcyArIDE7CisgICAgICAgICAgICAgICAgICAgICAgICBzY29wZS5pc0N1cnJlbnRTdGVwID0gZmFsc2U7CisgICAgICAgICAgICAgICAgICAgICAgICBzY29wZS5pc0NvbXBsZXRlZCA9IGZhbHNlOworICAgICAgICAgICAgICAgICAgICAgICAgc2NvcGUuaXNTdG9wID0gZmFsc2U7CisgICAgICAgICAgICAgICAgICAgICAgICBpZiAoc2NvcGUudHlwZSA9PT0gdGltZWxpbmVDb25zdGFudHMuU1RFUF9UWVBFLkFMRVJUIHx8IHNjb3BlLnR5cGUgPT09IHRpbWVsaW5lQ29uc3RhbnRzLlNURVBfVFlQRS5DQU5DRUxMRUQpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBzY29wZS5pc1N0b3AgPSB0cnVlOworICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgc2NvcGUuaXNJbmFjdGl2ZSA9IHRydWU7CisgICAgICAgICAgICAgICAgICAgICAgICB2YXIgZGl2cyA9IGVsZW1lbnQuZmluZCgnZGl2Jyk7CisgICAgICAgICAgICAgICAgICAgICAgICB2YXIgYmlnZ2VyQ2lyY2xlRWxlbSA9IGRpdnMuZXEoMCk7CisgICAgICAgICAgICAgICAgICAgICAgICB2YXIgZXhwYW5kYWJsZUNpcmNsZUVsZW0gPSBkaXZzLmVxKDIpOworICAgICAgICAgICAgICAgICAgICAgICAgdmFyIGluZm9ib3hFbGVtID0gZGl2cy5lcSgzKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIHZhciB0aXRsZUVsZW0gPSBkaXZzLmVxKDUpOworICAgICAgICAgICAgICAgICAgICAgICAgdmFyIGNvbnRlbnRFbGVtID0gZGl2cy5lcSg2KTsKKyAgICAgICAgICAgICAgICAgICAgICAgIHZhciBkYXRlRWxlbSA9IGRpdnMuZXEoOSk7CisgICAgICAgICAgICAgICAgICAgICAgICBmdW5jdGlvbiBpc0VtcHR5U3RlcCgpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoIXNjb3BlLmRlc2NyaXB0aW9uICYmICFzY29wZS5ieSAmJiAhc2NvcGUuZGF0ZSkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gdHJ1ZTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGZhbHNlOworICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgc2NvcGUuaXNTdGVwc0xlc3NUaGFuRml2ZSA9IGZ1bmN0aW9uICgpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoc2NvcGUubnVtU3RlcHMgPCA1KSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiB0cnVlOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gZmFsc2U7CisgICAgICAgICAgICAgICAgICAgICAgICB9OworICAgICAgICAgICAgICAgICAgICAgICAgc2NvcGUudGl0bGVNb3VzZW92ZXIgPSBmdW5jdGlvbiAobnVtKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKCFzY29wZS5pc1N0ZXBzTGVzc1RoYW5GaXZlKCkgJiYgIWlzRW1wdHlTdGVwKCkpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKG51bSA9PT0gMSAmJiBzY29wZS5vcmRlciAlIDIgPT09IDApIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNjb3BlLmV4cGFuZENvbnRlbnRGb3JCZWxvdyguMjUpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChudW0gPT09IDIgJiYgc2NvcGUub3JkZXIgJSAyICE9PSAwKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzY29wZS5leHBhbmRDb250ZW50Rm9yQWJvdmUoLjI1KTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgIH07CisgICAgICAgICAgICAgICAgICAgICAgICBzY29wZS50aXRsZU1vdXNlbGVhdmUgPSBmdW5jdGlvbiAoKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHNjb3BlLm9yZGVyICUgMiA9PT0gMCkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzY29wZS51bmhvdmVyZWRTdGF0ZUZvckJlbG93KC4yNSk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgICAgIGVsc2UgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzY29wZS51bmhvdmVyZWRTdGF0ZUZvckFib3ZlKC4yNSk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgfTsKKyAgICAgICAgICAgICAgICAgICAgICAgIHNjb3BlLmluaXRpYWxpemVBYm92ZUZvckFuaW1hdGlvbiA9IGZ1bmN0aW9uICgpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoIXNjb3BlLmlzU3RlcHNMZXNzVGhhbkZpdmUoKSAmJiBhdHRUaW1lbGluZUN0cmwuaXNBbHRlcm5hdGUoKSkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBhbmltYXRpb24uc2V0KGNvbnRlbnRFbGVtLCB7b3BhY2l0eTogMH0pOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBhbmltYXRpb24uc2V0KGRhdGVFbGVtLCB7b3BhY2l0eTogMH0pOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoIWlzRW1wdHlTdGVwKCkpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhciB5T2Zmc2V0ID0gY29udGVudEVsZW1bMF0ub2Zmc2V0SGVpZ2h0ICsgZGF0ZUVsZW1bMF0ub2Zmc2V0SGVpZ2h0OworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYW5pbWF0aW9uLnNldCh0aXRsZUVsZW0sIHsndG9wJzogeU9mZnNldH0pOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgfTsKKyAgICAgICAgICAgICAgICAgICAgICAgIHNjb3BlLmV4cGFuZENvbnRlbnRGb3JBYm92ZSA9IGZ1bmN0aW9uIChkdXJhdGlvbikgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICghc2NvcGUuaXNTdGVwc0xlc3NUaGFuRml2ZSgpICYmIGF0dFRpbWVsaW5lQ3RybC5pc0FsdGVybmF0ZSgpKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGFuaW1hdGlvbi50byh0aXRsZUVsZW0sIGR1cmF0aW9uLCB7J3RvcCc6IDB9KTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYW5pbWF0aW9uLnRvKGNvbnRlbnRFbGVtLCBkdXJhdGlvbiwge29wYWNpdHk6IDF9KTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYW5pbWF0aW9uLnRvKGRhdGVFbGVtLCBkdXJhdGlvbiwge29wYWNpdHk6IDF9KTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICB9OworICAgICAgICAgICAgICAgICAgICAgICAgc2NvcGUudW5ob3ZlcmVkU3RhdGVGb3JBYm92ZSA9IGZ1bmN0aW9uIChkdXJhdGlvbikgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICghc2NvcGUuaXNTdGVwc0xlc3NUaGFuRml2ZSgpICYmIGF0dFRpbWVsaW5lQ3RybC5pc0FsdGVybmF0ZSgpKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGFuaW1hdGlvbi5zZXQoY29udGVudEVsZW0sIHtvcGFjaXR5OiAwfSk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGFuaW1hdGlvbi5zZXQoZGF0ZUVsZW0sIHtvcGFjaXR5OiAxfSk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhciB5T2Zmc2V0ID0gY29udGVudEVsZW1bMF0ub2Zmc2V0SGVpZ2h0OworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBhbmltYXRpb24udG8odGl0bGVFbGVtLCBkdXJhdGlvbiwgeyd0b3AnOiB5T2Zmc2V0fSk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgfTsKKyAgICAgICAgICAgICAgICAgICAgICAgIHNjb3BlLmluaXRpYWxpemVCZWxvd0ZvckFuaW1hdGlvbiA9IGZ1bmN0aW9uICgpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoIXNjb3BlLmlzU3RlcHNMZXNzVGhhbkZpdmUoKSAmJiBhdHRUaW1lbGluZUN0cmwuaXNBbHRlcm5hdGUoKSkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBhbmltYXRpb24uc2V0KGNvbnRlbnRFbGVtLCB7aGVpZ2h0OiAnMCUnLCBvcGFjaXR5OiAwLCB0b3A6ICctMjBweCd9KTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYW5pbWF0aW9uLnNldChkYXRlRWxlbSwge29wYWNpdHk6IDB9KTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICB9OworICAgICAgICAgICAgICAgICAgICAgICAgc2NvcGUuZXhwYW5kQ29udGVudEZvckJlbG93ID0gZnVuY3Rpb24gKGR1cmF0aW9uKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKCFzY29wZS5pc1N0ZXBzTGVzc1RoYW5GaXZlKCkgJiYgYXR0VGltZWxpbmVDdHJsLmlzQWx0ZXJuYXRlKCkpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYW5pbWF0aW9uLnNldChkYXRlRWxlbSwge29wYWNpdHk6IDF9KTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYW5pbWF0aW9uLnRvKGNvbnRlbnRFbGVtLCBkdXJhdGlvbiwge2hlaWdodDogJ2F1dG8nLCBvcGFjaXR5OiAxLCB0b3A6ICcwcHgnfSk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgfTsKKyAgICAgICAgICAgICAgICAgICAgICAgIHNjb3BlLnVuaG92ZXJlZFN0YXRlRm9yQmVsb3cgPSBmdW5jdGlvbiAoZHVyYXRpb24pIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoIXNjb3BlLmlzU3RlcHNMZXNzVGhhbkZpdmUoKSAmJiBhdHRUaW1lbGluZUN0cmwuaXNBbHRlcm5hdGUoKSkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBhbmltYXRpb24udG8oY29udGVudEVsZW0sIGR1cmF0aW9uLCB7aGVpZ2h0OiAnMCUnLCBvcGFjaXR5OiAwLCB0b3A6ICctMjBweCcsIHBvc2l0aW9uOiAncmVsYXRpdmUnfSk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGFuaW1hdGlvbi5zZXQoZGF0ZUVsZW0sIHtvcGFjaXR5OiAxfSk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgfTsKKyAgICAgICAgICAgICAgICAgICAgICAgIC8qRGVmYXVsdCBJbml0aWFsaXphenRpb24qLworICAgICAgICAgICAgICAgICAgICAgICAgLy9JZiB0aGUgaW5mbyBib3ggaXMgYWJvdmUgYW5kIHRoZSBkZXNjcmlwdGlvbiBhbmQgZGF0ZSBhbmQgYnkgYXJlIGVtcHR5IHRoZW4gd2UgaGF2ZSBkbyByZXNldCBpdHMgcG9zaXRpb24KKyAgICAgICAgICAgICAgICAgICAgICAgIGlmIChpc0VtcHR5U3RlcCgpICYmIChzY29wZS5vcmRlciAlIDIgIT09IDAgJiYgYXR0VGltZWxpbmVDdHJsLmlzQWx0ZXJuYXRlKCkpKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgaW5mb2JveEVsZW0uY3NzKCd0b3AnLCAnLTQ3cHgnKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgIC8vQ2hlY2sgaWYgdGhlIG9yZGVyIGlzIG9kZCBhbmQgc2V0IHRoZSBhcHByb3BpYXRlIGFib3ZlIG9yIGJlbG93IGFuZCBvdGhlciBlZmZlY3RzCisgICAgICAgICAgICAgICAgICAgICAgICBpZiAoc2NvcGUub3JkZXIgJSAyID09PSAwIHx8ICFhdHRUaW1lbGluZUN0cmwuaXNBbHRlcm5hdGUoKSkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNjb3BlLmlzQmVsb3dJbmZvQm94U2hvd24gPSB0cnVlOworICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgZWxzZSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2NvcGUuaXNCZWxvd0luZm9Cb3hTaG93biA9IGZhbHNlOworICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgLy9tb2RpZnkgc29tZSBjc3MgZm9yIHN0ZXBzIGxlc3MgdGhhbiA1IGFuZCBub3QgYWx0ZXJuYXRpbmcKKyAgICAgICAgICAgICAgICAgICAgICAgIGlmIChzY29wZS5pc1N0ZXBzTGVzc1RoYW5GaXZlKCkgJiYgIWF0dFRpbWVsaW5lQ3RybC5pc0FsdGVybmF0ZSgpKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgYW5pbWF0aW9uLnNldChkYXRlRWxlbSwge21hcmdpblRvcDogMTB9KTsKKyAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgIC8vRm9yIElFIDggZml4CisgICAgICAgICAgICAgICAgICAgICAgICBhbmltYXRpb24uc2V0KGJpZ2dlckNpcmNsZUVsZW0sIHtvcGFjaXR5OiAnLjUnfSk7CisgICAgICAgICAgICAgICAgICAgICAgICAvL3NocmluayB0aGUgZXhwYW5kYWJsZUNpcmNsZSB0byB3ZSBjYW4gZXhwYW5kIGl0IGxhdGVyCisgICAgICAgICAgICAgICAgICAgICAgICBhbmltYXRpb24uc2V0KGV4cGFuZGFibGVDaXJjbGVFbGVtLCB7b3BhY2l0eTogJzAuMCd9KTsKKyAgICAgICAgICAgICAgICAgICAgICAgIGFuaW1hdGlvbi5zZXQoZXhwYW5kYWJsZUNpcmNsZUVsZW0sIHtzY2FsZTogLjEwfSk7CisgICAgICAgICAgICAgICAgICAgICAgICBpZiAoc2NvcGUub3JkZXIgPT09IDApIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBhbmltYXRpb24uc2V0KGV4cGFuZGFibGVDaXJjbGVFbGVtLCB7b3BhY2l0eTogJzEuMCd9KTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBhbmltYXRpb24uc2V0KGV4cGFuZGFibGVDaXJjbGVFbGVtLCB7c2NhbGU6IDF9KTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBhbmltYXRpb24uc2V0KGJpZ2dlckNpcmNsZUVsZW0sIHtzY2FsZTogM30pOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNjb3BlLmlzQ3VycmVudFN0ZXAgPSB0cnVlOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNjb3BlLmlzSW5hY3RpdmUgPSBmYWxzZTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBzY29wZS5pc0NvbXBsZXRlZCA9IHRydWU7CisgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICBzY29wZS5zZXRDb2xvciA9IGZ1bmN0aW9uICgpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBzY29wZS5pc0luYWN0aXZlID0gZmFsc2U7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHNjb3BlLnR5cGUgPT09IHRpbWVsaW5lQ29uc3RhbnRzLlNURVBfVFlQRS5DQU5DRUxMRUQpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2NvcGUuaXNDYW5jZWxsZWQgPSB0cnVlOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBlbHNlIGlmIChzY29wZS50eXBlID09PSB0aW1lbGluZUNvbnN0YW50cy5TVEVQX1RZUEUuQUxFUlQpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2NvcGUuaXNBbGVydCA9IHRydWU7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgICAgIGVsc2UgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzY29wZS5pc0NvbXBsZXRlZCA9IHRydWU7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICghc2NvcGUuJHBoYXNlKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNjb3BlLiRhcHBseSgpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgIH07CisgICAgICAgICAgICAgICAgICAgICAgICBzY29wZS5zZXRTaXplID0gZnVuY3Rpb24gKHNpemUpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBhbmltYXRpb24uc2V0KGJpZ2dlckNpcmNsZSwge3NjYWxlOiBzaXplfSk7CisgICAgICAgICAgICAgICAgICAgICAgICB9OworICAgICAgICAgICAgICAgICAgICAgICAgc2NvcGUuc2V0RXhwYW5kZWRDaXJjbGUgPSBmdW5jdGlvbiAoKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgYW5pbWF0aW9uLnNldChleHBhbmRhYmxlQ2lyY2xlRWxlbSwge29wYWNpdHk6ICcxLjAnfSk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgYW5pbWF0aW9uLnNldChleHBhbmRhYmxlQ2lyY2xlRWxlbSwge3NjYWxlOiAxfSk7CisgICAgICAgICAgICAgICAgICAgICAgICB9OworICAgICAgICAgICAgICAgICAgICAgICAgc2NvcGUuZXhwYW5kZWRBbmltYXRlID0gZnVuY3Rpb24gKGR1cmF0aW9uKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgYW5pbWF0aW9uLnRvKGJpZ2dlckNpcmNsZUVsZW0sIGR1cmF0aW9uLCB7c2NhbGU6IDN9KTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBhbmltYXRpb24uc2V0KGV4cGFuZGFibGVDaXJjbGVFbGVtLCB7b3BhY2l0eTogJzEuMCd9KTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBhbmltYXRpb24udG8oZXhwYW5kYWJsZUNpcmNsZUVsZW0sIGR1cmF0aW9uLCB7c2NhbGU6IDF9KTsKKyAgICAgICAgICAgICAgICAgICAgICAgIH07CisgICAgICAgICAgICAgICAgICAgICAgICBzY29wZS5zaHJpbmtBbmltYXRlID0gZnVuY3Rpb24gKGR1cmF0aW9uKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgYW5pbWF0aW9uLnRvKGJpZ2dlckNpcmNsZUVsZW0sIGR1cmF0aW9uLCB7c2NhbGU6IDF9KTsKKyAgICAgICAgICAgICAgICAgICAgICAgIH07CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICB9OworICAgICAgICAgICAgfV0pOworYW5ndWxhci5tb2R1bGUoJ2F0dC5hYnMudGFibGUnLCBbJ2F0dC5hYnMudXRpbGl0aWVzJ10pCisuY29uc3RhbnQoJ3RhYmxlQ29uZmlnJywgeworICAgIC8vdHJ1ZSBmb3IgZGVzY2VuZGluZyAmIGZhbHNlIGZvciBhc2NlbmRpbmcKKyAgICBkZWZhdWx0U29ydFBhdHRlcm46IGZhbHNlLAorICAgIGhpZ2hsaWdodFNlYXJjaFN0cmluZ0NsYXNzOiAndGFibGVzb3J0ZXItc2VhcmNoLWhpZ2hsaWdodCcKK30pCisKKy5kaXJlY3RpdmUoJ2F0dFRhYmxlJywgWyckZmlsdGVyJywgZnVuY3Rpb24oJGZpbHRlcikgeworICAgIHJldHVybiB7CisgICAgICAgIHJlc3RyaWN0OiAnRUEnLAorICAgICAgICByZXBsYWNlOiB0cnVlLAorICAgICAgICB0cmFuc2NsdWRlOiB0cnVlLAorICAgICAgICBzY29wZTogeworICAgICAgICAgICAgdGFibGVEYXRhOiAiPSIsCisgICAgICAgICAgICB2aWV3UGVyUGFnZTogIj0iLAorICAgICAgICAgICAgY3VycmVudFBhZ2U6ICI9IiwKKyAgICAgICAgICAgIHRvdGFsUGFnZTogIj0iLAorICAgICAgICAgICAgc2VhcmNoQ2F0ZWdvcnk6ICI9IiwKKyAgICAgICAgICAgIHNlYXJjaFN0cmluZzogIj0iCisgICAgICAgIH0sCisgICAgICAgIHJlcXVpcmU6ICdhdHRUYWJsZScsCisgICAgICAgIHRlbXBsYXRlVXJsOiAnYXBwL3NjcmlwdHMvbmdfanNfYXR0X3RwbHMvdGFibGUvYXR0VGFibGUuaHRtbCcsCisgICAgICAgIGNvbnRyb2xsZXI6IFsnJHNjb3BlJywgZnVuY3Rpb24oJHNjb3BlKSB7CisgICAgICAgICAgICB0aGlzLmhlYWRlcnMgPSBbXTsKKyAgICAgICAgICAgIHRoaXMuY3VycmVudFNvcnRJbmRleCA9IG51bGw7CisgICAgICAgICAgICB0aGlzLnNldEluZGV4ID0gZnVuY3Rpb24oaGVhZGVyU2NvcGUpIHsKKyAgICAgICAgICAgICAgICB0aGlzLmhlYWRlcnMucHVzaChoZWFkZXJTY29wZSk7CisgICAgICAgICAgICB9OworICAgICAgICAgICAgdGhpcy5nZXRJbmRleCA9IGZ1bmN0aW9uKGhlYWRlck5hbWUpIHsKKyAgICAgICAgICAgICAgICBmb3IgKHZhciBpID0gMDsgaSA8IHRoaXMuaGVhZGVycy5sZW5ndGg7IGkrKykgeworICAgICAgICAgICAgICAgICAgICBpZiAodGhpcy5oZWFkZXJzW2ldLmhlYWRlck5hbWUgPT09IGhlYWRlck5hbWUpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiB0aGlzLmhlYWRlcnNbaV0uaW5kZXg7CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgcmV0dXJuIG51bGw7CisgICAgICAgICAgICB9OworICAgICAgICAgICAgdGhpcy5zb3J0RGF0YSA9IGZ1bmN0aW9uKGNvbHVtbkluZGV4LCByZXZlcnNlKSB7CisgICAgICAgICAgICAgICAgJHNjb3BlLiRwYXJlbnQuY29sdW1uSW5kZXggPSBjb2x1bW5JbmRleDsKKyAgICAgICAgICAgICAgICAkc2NvcGUuJHBhcmVudC5yZXZlcnNlID0gcmV2ZXJzZTsKKyAgICAgICAgICAgICAgICB0aGlzLmN1cnJlbnRTb3J0SW5kZXggPSBjb2x1bW5JbmRleDsKKyAgICAgICAgICAgICAgICAkc2NvcGUuY3VycmVudFBhZ2UgPSAxOworICAgICAgICAgICAgICAgIHRoaXMucmVzZXRTb3J0UGF0dGVybigpOworICAgICAgICAgICAgfTsKKyAgICAgICAgICAgIHRoaXMuZ2V0U2VhcmNoU3RyaW5nID0gZnVuY3Rpb24oKSB7CisgICAgICAgICAgICAgICAgcmV0dXJuICRzY29wZS5zZWFyY2hTdHJpbmc7CisgICAgICAgICAgICB9OworICAgICAgICAgICAgdGhpcy5yZXNldFNvcnRQYXR0ZXJuID0gZnVuY3Rpb24oKSB7CisgICAgICAgICAgICAgICAgZm9yKHZhciBpID0gMDsgaSA8IHRoaXMuaGVhZGVycy5sZW5ndGg7IGkrKykgeworICAgICAgICAgICAgICAgICAgICB2YXIgY3VycmVudFNjb3BlID0gdGhpcy5oZWFkZXJzW2ldOworICAgICAgICAgICAgICAgICAgICBpZihjdXJyZW50U2NvcGUuaW5kZXggIT09IHRoaXMuY3VycmVudFNvcnRJbmRleCkgeworICAgICAgICAgICAgICAgICAgICAgICAgY3VycmVudFNjb3BlLnJlc2V0U29ydFBhdHRlcm4oKTsKKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH07CisgICAgICAgIH1dLAorICAgICAgICBsaW5rOiBmdW5jdGlvbihzY29wZSwgZWxlbSwgYXR0ciwgY3RybCkgeworICAgICAgICAgICAgc2NvcGUuc2VhcmNoQ3JpdGVyaWEgPSB7fTsKKyAgICAgICAgICAgIHNjb3BlLiR3YXRjaENvbGxlY3Rpb24oJ3RhYmxlRGF0YScsIGZ1bmN0aW9uKHZhbHVlKSB7CisgICAgICAgICAgICAgICAgaWYodmFsdWUgJiYgIWlzTmFOKHZhbHVlLmxlbmd0aCkpIHsKKyAgICAgICAgICAgICAgICAgICAgc2NvcGUudG90YWxSb3dzID0gdmFsdWUubGVuZ3RoOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0pOworICAgICAgICAgICAgc2NvcGUuJHdhdGNoKCdjdXJyZW50UGFnZScsIGZ1bmN0aW9uKHZhbCkgeworICAgICAgICAgICAgICAgIHNjb3BlLiRwYXJlbnQuY3VycmVudFBhZ2UgPSB2YWw7CisgICAgICAgICAgICB9KTsKKyAgICAgICAgICAgIHNjb3BlLiR3YXRjaCgndmlld1BlclBhZ2UnLCBmdW5jdGlvbih2YWwpIHsKKyAgICAgICAgICAgICAgICBzY29wZS4kcGFyZW50LnZpZXdQZXJQYWdlID0gdmFsOworICAgICAgICAgICAgfSk7CisgICAgICAgICAgICBzY29wZS4kd2F0Y2goZnVuY3Rpb24oKSB7CisgICAgICAgICAgICAgICAgcmV0dXJuIHNjb3BlLnRvdGFsUm93cyAvIHNjb3BlLnZpZXdQZXJQYWdlOworICAgICAgICAgICAgfSwgZnVuY3Rpb24odmFsdWUpIHsKKyAgICAgICAgICAgICAgICBpZighaXNOYU4odmFsdWUpKSB7CisgICAgICAgICAgICAgICAgICAgIHNjb3BlLnRvdGFsUGFnZSA9IE1hdGguY2VpbCh2YWx1ZSk7CisgICAgICAgICAgICAgICAgICAgIHNjb3BlLmN1cnJlbnRQYWdlID0gMTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9KTsKKyAgICAgICAgICAgIHZhciBzZWFyY2hWYWxDaGVjayA9IGZ1bmN0aW9uKHZhbCl7CisgICAgICAgICAgICAgICAgaWYoYW5ndWxhci5pc0RlZmluZWQodmFsKSAmJiB2YWwgIT09IG51bGwgJiYgdmFsICE9PSAiIil7CisgICAgICAgICAgICAgICAgICAgIHJldHVybiB0cnVlOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH07CisgICAgICAgICAgICB2YXIgc2V0U2VhcmNoQ3JpdGVyaWEgPSBmdW5jdGlvbih2MSx2Mil7CisgICAgICAgICAgICAgICAgaWYoc2VhcmNoVmFsQ2hlY2sodjEpICYmIHNlYXJjaFZhbENoZWNrKHYyKSl7CisgICAgICAgICAgICAgICAgICAgIHZhciBpbmRleCA9IGN0cmwuZ2V0SW5kZXgodjIpOworICAgICAgICAgICAgICAgICAgICBzY29wZS5zZWFyY2hDcml0ZXJpYSA9IHt9OworICAgICAgICAgICAgICAgICAgICBpZiAoaW5kZXggIT09IG51bGwpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIHNjb3BlLnNlYXJjaENyaXRlcmlhW2luZGV4XSA9IHYxOworICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgfWVsc2UgaWYoc2VhcmNoVmFsQ2hlY2sodjEpICYmICghYW5ndWxhci5pc0RlZmluZWQodjIpIHx8IHYyID09PSBudWxsIHx8IHYyID09PSAiIikpeworICAgICAgICAgICAgICAgICAgICBzY29wZS5zZWFyY2hDcml0ZXJpYSA9IHsKKyAgICAgICAgICAgICAgICAgICAgICAgICQ6IHYxCisgICAgICAgICAgICAgICAgICAgIH07CisgICAgICAgICAgICAgICAgfWVsc2UgeworICAgICAgICAgICAgICAgICAgICBzY29wZS5zZWFyY2hDcml0ZXJpYSA9IHt9OworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH07CisgICAgICAgICAgICBzY29wZS4kd2F0Y2goJ3NlYXJjaENhdGVnb3J5JywgZnVuY3Rpb24obmV3VmFsLG9sZFZhbCkgeworICAgICAgICAgICAgICAgIGlmKG5ld1ZhbCAhPT0gb2xkVmFsKXsKKyAgICAgICAgICAgICAgICAgICAgc2V0U2VhcmNoQ3JpdGVyaWEoc2NvcGUuc2VhcmNoU3RyaW5nLG5ld1ZhbCk7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfSk7CisgICAgICAgICAgICBzY29wZS4kd2F0Y2goJ3NlYXJjaFN0cmluZycsIGZ1bmN0aW9uIChuZXdWYWwsb2xkVmFsKSB7CisgICAgICAgICAgICAgICAgaWYobmV3VmFsICE9PSBvbGRWYWwpeworICAgICAgICAgICAgICAgICAgICBzZXRTZWFyY2hDcml0ZXJpYShuZXdWYWwsc2NvcGUuc2VhcmNoQ2F0ZWdvcnkpOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0pOworICAgICAgICAgICAgc2NvcGUuJHdhdGNoQ29sbGVjdGlvbignc2VhcmNoQ3JpdGVyaWEnLCBmdW5jdGlvbih2YWwpIHsKKyAgICAgICAgICAgICAgICBzY29wZS4kcGFyZW50LnNlYXJjaENyaXRlcmlhID0gdmFsOworICAgICAgICAgICAgICAgIHNjb3BlLnRvdGFsUm93cyA9ICgkZmlsdGVyKCdmaWx0ZXInKShzY29wZS50YWJsZURhdGEsIHZhbCwgZmFsc2UpKS5sZW5ndGg7CisgICAgICAgICAgICAgICAgc2NvcGUuY3VycmVudFBhZ2UgPSAxOworICAgICAgICAgICAgfSk7CisgICAgICAgIH0KKyAgICB9OworfV0pCisKKy5kaXJlY3RpdmUoJ2F0dFRhYmxlUm93JywgW2Z1bmN0aW9uKCkgeworICAgIHJldHVybiB7CisgICAgICAgIHJlc3RyaWN0OiAnRUEnLAorICAgICAgICBjb21waWxlOiBmdW5jdGlvbiAoZWxlbSwgYXR0cikgeworICAgICAgICAgICAgaWYgKGF0dHIudHlwZSA9PT0gJ2hlYWRlcicpIHsKKyAgICAgICAgICAgICAgICBlbGVtLmZpbmQoJ3RyJykuZXEoMCkuYWRkQ2xhc3MoJ3RhYmxlc29ydGVyLWhlYWRlclJvdycpOworICAgICAgICAgICAgfSBlbHNlIGlmIChhdHRyLnR5cGUgPT09ICdib2R5JykgeworICAgICAgICAgICAgICAgIHZhciBodG1sID0gZWxlbS5jaGlsZHJlbigpOworICAgICAgICAgICAgICAgIGlmKGF0dHIucm93UmVwZWF0KXsKKyAgICAgICAgICAgICAgICAgICAgaHRtbC5hdHRyKCduZy1yZXBlYXQnLCBhdHRyLnJvd1JlcGVhdC5jb25jYXQoIiB8IG9yZGVyQnkgOiBjb2x1bW5JbmRleCA6IHJldmVyc2UgfCBmaWx0ZXIgOiBzZWFyY2hDcml0ZXJpYSA6IGZhbHNlIHwgYXR0TGltaXRUbyA6IHZpZXdQZXJQYWdlIDogdmlld1BlclBhZ2UqKGN1cnJlbnRQYWdlLTEpIikpOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICBodG1sLmF0dHIoJ25nLWNsYXNzJywgInsnYWx0LXJvdyc6ICRldmVuLCdub3JtYWwtcm93JzogJG9kZH0iKTsKKyAgICAgICAgICAgICAgICBlbGVtLmFwcGVuZChodG1sKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgIH07Cit9XSkKKworLmRpcmVjdGl2ZSgnYXR0VGFibGVIZWFkZXInLCBbJ3RhYmxlQ29uZmlnJywgZnVuY3Rpb24odGFibGVDb25maWcpIHsKKyAgICByZXR1cm4geworICAgICAgICByZXN0cmljdDogJ0VBJywKKyAgICAgICAgcmVwbGFjZTogdHJ1ZSwKKyAgICAgICAgdHJhbnNjbHVkZTogdHJ1ZSwKKyAgICAgICAgc2NvcGU6IHsKKyAgICAgICAgICAgIHNvcnRhYmxlOiAnQCcsCisgICAgICAgICAgICBkZWZhdWx0U29ydDogJ0AnLAorICAgICAgICAgICAgaW5kZXg6ICdAa2V5JywKKyAgICAgICAgICAgIGFycm93RGlyZWN0aW9uOiAnPScsCisgICAgICAgICAgICBjbGlja0Z1bmM6ICcmJworICAgICAgICB9LAorICAgICAgICByZXF1aXJlOiAnXmF0dFRhYmxlJywKKyAgICAgICAgdGVtcGxhdGVVcmw6ICdhcHAvc2NyaXB0cy9uZ19qc19hdHRfdHBscy90YWJsZS9hdHRUYWJsZUhlYWRlci5odG1sJywKKyAgICAgICAgbGluazogZnVuY3Rpb24oc2NvcGUsIGVsZW0sIGF0dHIsIGN0cmwpIHsKKyAgICAgICAgICAgIHZhciByZXZlcnNlID0gdGFibGVDb25maWcuZGVmYXVsdFNvcnRQYXR0ZXJuOworICAgICAgICAgICAgc2NvcGUuaGVhZGVyTmFtZSA9IGVsZW0udGV4dCgpOworICAgICAgICAgICAgc2NvcGUuc29ydFBhdHRlcm4gPSBudWxsOworICAgICAgICAgICAgY3RybC5zZXRJbmRleChzY29wZSk7CisKKyAgICAgICAgICAgIHNjb3BlLiR3YXRjaCgnYXJyb3dEaXJlY3Rpb24nLCBmdW5jdGlvbih2YWwpeworICAgICAgICAgICAgICAgIGlmKHZhbCl7CisgICAgICAgICAgICAgICAgICAgIHNjb3BlLnNvcnRQYXR0ZXJuID0gJ2FzYyc7fQorICAgICAgICAgICAgICAgIGVsc2V7CisgICAgICAgICAgICAgICAgICAgIHNjb3BlLnNvcnRQYXR0ZXJuID0gJ2Rlc2MnO30KKyAgICAgICAgICAgIH0pOworCisgICAgICAgICAgICBzY29wZS4kd2F0Y2goZnVuY3Rpb24oKSB7CisgICAgICAgICAgICAgICAgcmV0dXJuIGVsZW0udGV4dCgpOworICAgICAgICAgICAgfSwgZnVuY3Rpb24odmFsdWUpIHsKKyAgICAgICAgICAgICAgICBzY29wZS5oZWFkZXJOYW1lID0gdmFsdWU7CisgICAgICAgICAgICB9KTsKKyAgICAgICAgICAgIHNjb3BlLnNvcnQgPSBmdW5jdGlvbihzb3J0VHlwZSkgeworICAgICAgICAgICAgICAgIGlmKHR5cGVvZiBzb3J0VHlwZSA9PT0gJ2Jvb2xlYW4nKSB7CisgICAgICAgICAgICAgICAgICAgIHJldmVyc2UgPSBzb3J0VHlwZTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgY3RybC5zb3J0RGF0YShzY29wZS5pbmRleCwgcmV2ZXJzZSk7CisgICAgICAgICAgICAgICAgc2NvcGUuc29ydFBhdHRlcm4gPSByZXZlcnNlID8gJ2Rlc2MnIDogJ2FzYyc7CisgICAgICAgICAgICAgICAgcmV2ZXJzZSA9ICFyZXZlcnNlOworICAgICAgICAgICAgfTsKKyAgICAgICAgICAgIHNjb3BlLiR3YXRjaChmdW5jdGlvbigpIHsKKyAgICAgICAgICAgICAgICByZXR1cm4gY3RybC5jdXJyZW50U29ydEluZGV4OworICAgICAgICAgICAgfSwgZnVuY3Rpb24odmFsdWUpIHsKKyAgICAgICAgICAgICAgICBpZiAodmFsdWUgIT09IHNjb3BlLmluZGV4KSB7CisgICAgICAgICAgICAgICAgICAgIHNjb3BlLnNvcnRQYXR0ZXJuID0gbnVsbDsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9KTsKKyAgICAgICAgICAgIGlmKHNjb3BlLnNvcnRhYmxlICE9PSAnZmFsc2UnKSB7CisgICAgICAgICAgICAgICAgaWYoc2NvcGUuZGVmYXVsdFNvcnQgPT09ICdBJyB8fCBzY29wZS5kZWZhdWx0U29ydCA9PT0gJ2EnKSB7CisgICAgICAgICAgICAgICAgICAgIHNjb3BlLnNvcnQoZmFsc2UpOworICAgICAgICAgICAgICAgIH0gZWxzZSBpZihzY29wZS5kZWZhdWx0U29ydCA9PT0gJ0QnIHx8IHNjb3BlLmRlZmF1bHRTb3J0ID09PSAnZCcpIHsKKyAgICAgICAgICAgICAgICAgICAgc2NvcGUuc29ydCh0cnVlKTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9CisgICAgICAgICAgICBzY29wZS5yZXNldFNvcnRQYXR0ZXJuID0gZnVuY3Rpb24oKSB7CisgICAgICAgICAgICAgICAgcmV2ZXJzZSA9IHRhYmxlQ29uZmlnLmRlZmF1bHRTb3J0UGF0dGVybjsKKyAgICAgICAgICAgIH07CisgICAgICAgIH0KKyAgICB9OworfV0pCisKKy5kaXJlY3RpdmUoJ2F0dFRhYmxlQm9keScsIFsnJGZpbHRlcicsICckdGltZW91dCcsICd0YWJsZUNvbmZpZycsIGZ1bmN0aW9uKCRmaWx0ZXIsICR0aW1lb3V0LCB0YWJsZUNvbmZpZykgeworICAgIHJldHVybiB7CisgICAgICAgIHJlc3RyaWN0OiAnRUEnLAorICAgICAgICByZXF1aXJlOiAnXmF0dFRhYmxlJywKKyAgICAgICAgcmVwbGFjZTogdHJ1ZSwKKyAgICAgICAgdHJhbnNjbHVkZTogdHJ1ZSwKKyAgICAgICAgdGVtcGxhdGVVcmw6ICdhcHAvc2NyaXB0cy9uZ19qc19hdHRfdHBscy90YWJsZS9hdHRUYWJsZUJvZHkuaHRtbCcsCisgICAgICAgIGxpbms6IGZ1bmN0aW9uIChzY29wZSwgZWxlbSwgYXR0ciwgY3RybCkgeworICAgICAgICAgICAgdmFyIGhpZ2hsaWdodFNlYXJjaFN0cmluZ0NsYXNzID0gdGFibGVDb25maWcuaGlnaGxpZ2h0U2VhcmNoU3RyaW5nQ2xhc3M7CisgICAgICAgICAgICB2YXIgc2VhcmNoU3RyaW5nID0gIiI7CisgICAgICAgICAgICB2YXIgd3JhcEVsZW1lbnQgPSBmdW5jdGlvbiAoZWxlbSkgeworICAgICAgICAgICAgICAgIHZhciB0ZXh0ID0gZWxlbS50ZXh0KCk7CisgICAgICAgICAgICAgICAgZWxlbS5odG1sKCcnKTsKKyAgICAgICAgICAgICAgICBlbGVtLmFwcGVuZCgkZmlsdGVyKCdoaWdobGlnaHQnKSh0ZXh0LCBzZWFyY2hTdHJpbmcsIGhpZ2hsaWdodFNlYXJjaFN0cmluZ0NsYXNzKSk7CisgICAgICAgICAgICB9OworICAgICAgICAgICAgdmFyIHRyYXZlcnNlID0gZnVuY3Rpb24gKGVsZW0pIHsKKyAgICAgICAgICAgICAgICB2YXIgaW5uZXJIdG1sID0gZWxlbS5jaGlsZHJlbigpOworICAgICAgICAgICAgICAgIGlmIChpbm5lckh0bWwubGVuZ3RoID4gMCkgeworICAgICAgICAgICAgICAgICAgICBmb3IgKHZhciBpID0gMDsgaSA8IGlubmVySHRtbC5sZW5ndGg7IGkrKykgeworICAgICAgICAgICAgICAgICAgICAgICAgdHJhdmVyc2UoaW5uZXJIdG1sLmVxKGkpKTsKKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICAgICAgICAgIHdyYXBFbGVtZW50KGVsZW0pOworICAgICAgICAgICAgICAgICAgICByZXR1cm47CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfTsKKyAgICAgICAgICAgIHZhciBjbGVhcldyYXAgPSBmdW5jdGlvbiAoZWxlbSkgeworICAgICAgICAgICAgICAgIHZhciBlbGVtcyA9IGVsZW0uZmluZCgnKicpOworICAgICAgICAgICAgICAgIGZvciAodmFyIGkgPSAwOyBpIDwgZWxlbXMubGVuZ3RoOyBpKyspIHsKKyAgICAgICAgICAgICAgICAgICAgaWYgKGVsZW1zLmVxKGkpLmF0dHIoJ2NsYXNzJykgJiYgZWxlbXMuZXEoaSkuYXR0cignY2xhc3MnKS5pbmRleE9mKGhpZ2hsaWdodFNlYXJjaFN0cmluZ0NsYXNzKSAhPT0gLTEpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIHZhciB0ZXh0ID0gZWxlbXMuZXEoaSkudGV4dCgpOworICAgICAgICAgICAgICAgICAgICAgICAgZWxlbXMuZXEoaSkucmVwbGFjZVdpdGgodGV4dCk7CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9OworICAgICAgICAgICAgJHRpbWVvdXQoZnVuY3Rpb24gKCkgeworICAgICAgICAgICAgICAgIHZhciBhY3R1YWxIdG1sID0gZWxlbS5jaGlsZHJlbigpOworICAgICAgICAgICAgICAgIHNjb3BlLiR3YXRjaChmdW5jdGlvbiAoKSB7CisgICAgICAgICAgICAgICAgICAgIHJldHVybiBjdHJsLmdldFNlYXJjaFN0cmluZygpOworICAgICAgICAgICAgICAgIH0sIGZ1bmN0aW9uICh2YWwpIHsKKyAgICAgICAgICAgICAgICAgICAgc2VhcmNoU3RyaW5nID0gdmFsOworICAgICAgICAgICAgICAgICAgICBjbGVhcldyYXAoZWxlbSk7CisgICAgICAgICAgICAgICAgICAgIGlmIChhY3R1YWxIdG1sLmxlbmd0aCA+IDApIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIHRyYXZlcnNlKGVsZW0pOworICAgICAgICAgICAgICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgICAgICAgICAgICAgd3JhcEVsZW1lbnQoZWxlbSk7CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICB9KTsKKyAgICAgICAgICAgIH0sIDUwKTsKKyAgICAgICAgfQorICAgIH07Cit9XSk7CisKK2FuZ3VsYXIubW9kdWxlKCdhdHQuYWJzLnRhYnMnLCBbXSkKKyAgICAgICAgLmRpcmVjdGl2ZSgnYXR0VGFicycsIGZ1bmN0aW9uICgpIHsKKyAgICAgICAgICAgIHJldHVybnsKKyAgICAgICAgICAgICAgICByZXN0cmljdDogJ0VBJywKKyAgICAgICAgICAgICAgICB0cmFuc2NsdWRlOiBmYWxzZSwKKyAgICAgICAgICAgICAgICByZXBsYWNlOiB0cnVlLAorICAgICAgICAgICAgICAgIHNjb3BlOiB7CisgICAgICAgICAgICAgICAgICAgIHRhYnM6ICI9dGl0bGUiCisgICAgICAgICAgICAgICAgfSwKKyAgICAgICAgICAgICAgICBjb250cm9sbGVyOiBbJyRzY29wZScsIGZ1bmN0aW9uICgkc2NvcGUpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIHRoaXMuZ2V0RGF0YSA9IGZ1bmN0aW9uICgpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gJHNjb3BlLnRhYnM7CisgICAgICAgICAgICAgICAgICAgICAgICB9OworICAgICAgICAgICAgICAgICAgICAgICAgdGhpcy5vbkNsaWNrVGFiID0gZnVuY3Rpb24gKHRhYikgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICRzY29wZS5jdXJyZW50VGFiID0gdGFiLnVybDsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gJHNjb3BlLmN1cnJlbnRUYWI7CisgICAgICAgICAgICAgICAgICAgICAgICB9OworICAgICAgICAgICAgICAgICAgICAgICAgdGhpcy5pc0FjdGl2ZVRhYiA9IGZ1bmN0aW9uICh0YWIpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gKHRhYiA9PT0gJHNjb3BlLmN1cnJlbnRUYWIpOworICAgICAgICAgICAgICAgICAgICAgICAgfTsKKyAgICAgICAgICAgICAgICAgICAgfV0sCisgICAgICAgICAgICAgICAgbGluazogZnVuY3Rpb24gKHNjb3BlKSB7CisgICAgICAgICAgICAgICAgICAgIGZvciAodmFyIGkgPSAwOyBpIDwgc2NvcGUudGFicy5sZW5ndGg7IGkrKykgeworICAgICAgICAgICAgICAgICAgICAgICAgaWYgKChzY29wZS50YWJzW2ldLnNlbGVjdGVkKSAmJiAoc2NvcGUudGFic1tpXS51cmwpKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2NvcGUuY3VycmVudFRhYiA9IHNjb3BlLnRhYnNbaV0udXJsOworICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfTsKKyAgICAgICAgfSkKKyAgICAgICAgLmRpcmVjdGl2ZSgnZmxvYXRpbmdUYWJzJywgZnVuY3Rpb24gKCkgeworICAgICAgICAgICAgcmV0dXJuIHsKKyAgICAgICAgICAgICAgICByZXF1aXJlOiAnXmF0dFRhYnMnLAorICAgICAgICAgICAgICAgIHJlc3RyaWN0OiAnRUEnLAorICAgICAgICAgICAgICAgIHRyYW5zY2x1ZGU6IGZhbHNlLAorICAgICAgICAgICAgICAgIHJlcGxhY2U6IHRydWUsCisgICAgICAgICAgICAgICAgc2NvcGU6IHsKKyAgICAgICAgICAgICAgICAgICAgc2l6ZTogIkAiCisgICAgICAgICAgICAgICAgfSwKKyAgICAgICAgICAgICAgICB0ZW1wbGF0ZVVybDogJ2FwcC9zY3JpcHRzL25nX2pzX2F0dF90cGxzL3RhYnMvZmxvYXRpbmdUYWJzLmh0bWwnLAorICAgICAgICAgICAgICAgIGxpbms6IGZ1bmN0aW9uIChzY29wZSwgZWxlbSwgYXR0ciwgYXR0VGFic0N0cmwpIHsKKyAgICAgICAgICAgICAgICAgICAgc2NvcGUudGFicyA9IGF0dFRhYnNDdHJsLmdldERhdGEoKTsKKyAgICAgICAgICAgICAgICAgICAgc2NvcGUub25DbGlja1RhYiA9IGF0dFRhYnNDdHJsLm9uQ2xpY2tUYWI7CisgICAgICAgICAgICAgICAgICAgIHNjb3BlLmlzQWN0aXZlVGFiID0gYXR0VGFic0N0cmwuaXNBY3RpdmVUYWI7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfTsKKyAgICAgICAgfSkKKyAgICAgICAgLmRpcmVjdGl2ZSgnc2ltcGxpZmllZFRhYnMnLCBmdW5jdGlvbiAoKSB7CisgICAgICAgICAgICByZXR1cm4geworICAgICAgICAgICAgICAgIHJlcXVpcmU6ICdeYXR0VGFicycsCisgICAgICAgICAgICAgICAgcmVzdHJpY3Q6ICdFQScsCisgICAgICAgICAgICAgICAgdHJhbnNjbHVkZTogZmFsc2UsCisgICAgICAgICAgICAgICAgcmVwbGFjZTogdHJ1ZSwKKyAgICAgICAgICAgICAgICBzY29wZTogeworICAgICAgICAgICAgICAgICAgICBjdGFiOiAiPW5nTW9kZWwiCisgICAgICAgICAgICAgICAgfSwKKyAgICAgICAgICAgICAgICB0ZW1wbGF0ZVVybDogJ2FwcC9zY3JpcHRzL25nX2pzX2F0dF90cGxzL3RhYnMvc2ltcGxpZmllZFRhYnMuaHRtbCcsCisgICAgICAgICAgICAgICAgbGluazogZnVuY3Rpb24gKHNjb3BlLCBlbGVtLCBhdHRyLCBhdHRUYWJzQ3RybCkgeworICAgICAgICAgICAgICAgICAgICBzY29wZS50YWJzID0gYXR0VGFic0N0cmwuZ2V0RGF0YSgpOworICAgICAgICAgICAgICAgICAgICBzY29wZS5jbGlja1RhYiA9IGZ1bmN0aW9uICh0YWIpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIHNjb3BlLmN0YWIgPSB0YWIuaWQ7CisgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gc2NvcGUuY3RhYjsKKyAgICAgICAgICAgICAgICAgICAgfTsKKyAgICAgICAgICAgICAgICAgICAgc2NvcGUuaXNBY3RpdmUgPSBmdW5jdGlvbiAodGFiKSB7CisgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gKHRhYiA9PT0gc2NvcGUuY3RhYik7CisgICAgICAgICAgICAgICAgICAgIH07CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfTsKKyAgICAgICAgfSkKKyAgICAgICAgLmRpcmVjdGl2ZSgnZ2VuZXJpY1RhYnMnLCBmdW5jdGlvbiAoKSB7CisgICAgICAgICAgICByZXR1cm4geworICAgICAgICAgICAgICAgIHJlcXVpcmU6ICdeYXR0VGFicycsCisgICAgICAgICAgICAgICAgcmVzdHJpY3Q6ICdFQScsCisgICAgICAgICAgICAgICAgdHJhbnNjbHVkZTogZmFsc2UsCisgICAgICAgICAgICAgICAgcmVwbGFjZTogdHJ1ZSwKKyAgICAgICAgICAgICAgICBzY29wZTogeworICAgICAgICAgICAgICAgICAgICBjdGFiOiAiPW5nTW9kZWwiCisgICAgICAgICAgICAgICAgfSwKKyAgICAgICAgICAgICAgICB0ZW1wbGF0ZVVybDogJ2FwcC9zY3JpcHRzL25nX2pzX2F0dF90cGxzL3RhYnMvZ2VuZXJpY1RhYnMuaHRtbCcsCisgICAgICAgICAgICAgICAgbGluazogZnVuY3Rpb24gKHNjb3BlLCBlbGVtLCBhdHRyLCBhdHRUYWJzQ3RybCkgeworICAgICAgICAgICAgICAgICAgICBzY29wZS50YWJzID0gYXR0VGFic0N0cmwuZ2V0RGF0YSgpOworICAgICAgICAgICAgICAgICAgICBzY29wZS5jbGlja1RhYiA9IGZ1bmN0aW9uICh0YWIpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIHNjb3BlLmN0YWIgPSB0YWIuaWQ7CisgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gc2NvcGUuY3RhYjsKKyAgICAgICAgICAgICAgICAgICAgfTsKKyAgICAgICAgICAgICAgICAgICAgc2NvcGUuaXNBY3RpdmUgPSBmdW5jdGlvbiAodGFiKSB7CisgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gKHRhYiA9PT0gc2NvcGUuY3RhYik7CisgICAgICAgICAgICAgICAgICAgIH07CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfTsKKyAgICAgICAgfSkKKyAgICAgICAgLmRpcmVjdGl2ZSgncGFyZW50VGFiJywgW2Z1bmN0aW9uICgpIHsKKyAgICAgICAgICAgICAgICByZXR1cm4geworICAgICAgICAgICAgICAgICAgICByZXN0cmljdDogJ0VBJywKKyAgICAgICAgICAgICAgICAgICAgc2NvcGU6IHsKKyAgICAgICAgICAgICAgICAgICAgICAgIG1lbnVJdGVtczogJz0nLAorICAgICAgICAgICAgICAgICAgICAgICAgYWN0aXZlU3ViTWVudTogJz0nLAorICAgICAgICAgICAgICAgICAgICAgICAgYWN0aXZlTWVudTogJz0nCisgICAgICAgICAgICAgICAgICAgIH0sCisgICAgICAgICAgICAgICAgICAgIGNvbnRyb2xsZXI6IFsnJHNjb3BlJywgZnVuY3Rpb24gKCRzY29wZSkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICRzY29wZS5tZWdhTWVudSA9ICRzY29wZS5tZW51SXRlbXM7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgJHNjb3BlLm1lZ2FNZW51VGFiOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICRzY29wZS5tZWdhTWVudUhvdmVyVGFiOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRoaXMuc2V0TWVudSA9IGZ1bmN0aW9uICgpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJHNjb3BlLm1lbnVJdGVtcyA9ICRzY29wZS5tZWdhTWVudTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZm9yICh2YXIgaSA9IDA7IGkgPCAkc2NvcGUubWVudUl0ZW1zLmxlbmd0aDsgaSsrKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoJHNjb3BlLm1lbnVJdGVtc1tpXS5hY3RpdmUpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAkc2NvcGUuYWN0aXZlTWVudSA9ICRzY29wZS5tZW51SXRlbXNbaV07CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdGhpcy5zZXRTdWJNZW51U3RhdHVzKGZhbHNlKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJHNjb3BlLiRhcHBseSgpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIH07CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgdGhpcy5zZXRBY3RpdmVNZW51ID0gZnVuY3Rpb24gKCkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoISgkc2NvcGUubWVnYU1lbnVUYWIgPT09ICJ1bmRlZmluZWQiIHx8ICRzY29wZS5tZWdhTWVudVRhYiA9PT0gbnVsbCkpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICRzY29wZS5tZW51SXRlbXMgPSBbJHNjb3BlLm1lZ2FNZW51VGFiXTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICRzY29wZS5hY3RpdmVNZW51ID0ge307CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAkc2NvcGUuYWN0aXZlU3ViTWVudSA9ICRzY29wZS5tZWdhTWVudVRhYjsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRoaXMuc2V0U3ViTWVudVN0YXR1cyh0cnVlKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBlbHNlIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNldE1lbnVJdGVtcygpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICRzY29wZS4kYXBwbHkoKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB9OworICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRoaXMuc2V0TWVudUl0ZW1zID0gZnVuY3Rpb24oKXsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZm9yICh2YXIgaSA9IDA7IGkgPCAkc2NvcGUubWVudUl0ZW1zLmxlbmd0aDsgaSsrKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJHNjb3BlLm1lbnVJdGVtc1tpXS5hY3RpdmUgPSBmYWxzZTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoJHNjb3BlLm1lbnVJdGVtc1tpXS5zdWJJdGVtcyl7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZvciAodmFyIGogPSAwOyBqIDwgJHNjb3BlLm1lbnVJdGVtc1tpXS5zdWJJdGVtcy5sZW5ndGg7IGorKykgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJHNjb3BlLm1lbnVJdGVtc1tpXS5zdWJJdGVtc1tqXS5hY3RpdmUgPSBmYWxzZTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICRzY29wZS5tZW51SXRlbXMgPSAkc2NvcGUubWVnYU1lbnU7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgfTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YXIgY2hlY2tTdWJNZW51U3RhdHVzID0gZmFsc2U7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgdGhpcy5zZXRTdWJNZW51U3RhdHVzID0gZnVuY3Rpb24gKHZhbHVlKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNoZWNrU3ViTWVudVN0YXR1cyA9IHZhbHVlOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIH07CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgdGhpcy5nZXRTdWJNZW51U3RhdHVzID0gZnVuY3Rpb24gKCkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gY2hlY2tTdWJNZW51U3RhdHVzOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIH07CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgdGhpcy5zZXRBY3RpdmVNZW51VGFiID0gZnVuY3Rpb24gKHRhYikgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAkc2NvcGUubWVnYU1lbnVUYWIgPSB0YWI7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgfTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB0aGlzLnNldEFjdGl2ZU1lbnVIb3ZlclRhYiA9IGZ1bmN0aW9uICh0YWIpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJHNjb3BlLm1lZ2FNZW51SG92ZXJUYWIgPSB0YWI7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgfTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB0aGlzLnNldEFjdGl2ZVN1Yk1lbnVUYWIgPSBmdW5jdGlvbiAoKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICRzY29wZS5tZWdhTWVudVRhYiA9ICRzY29wZS5tZWdhTWVudUhvdmVyVGFiOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIH07CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgdGhpcy5yZXNldE1lbnVUYWIgPSBmdW5jdGlvbiAoKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICRzY29wZS5tZWdhTWVudVRhYiA9ICd1bmRlZmluZWQnOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIH07CisgICAgICAgICAgICAgICAgICAgICAgICB9XQorICAgICAgICAgICAgICAgIH07CisgICAgICAgICAgICB9XSkKKyAgICAgICAgLmRpcmVjdGl2ZSgncGFyZW50bWVudVRhYnMnLCBbZnVuY3Rpb24gKCkgeworICAgICAgICAgICAgICAgIHJldHVybiB7CisgICAgICAgICAgICAgICAgICAgIHJlc3RyaWN0OiAnRUEnLAorICAgICAgICAgICAgICAgICAgICB0cmFuc2NsdWRlOiB0cnVlLAorICAgICAgICAgICAgICAgICAgICByZXBsYWNlOiB0cnVlLAorICAgICAgICAgICAgICAgICAgICBzY29wZTogeworICAgICAgICAgICAgICAgICAgICAgICAgbWVnYU1lbnU6ICdAJywKKyAgICAgICAgICAgICAgICAgICAgICAgIG1lbnVJdGVtczogJz0nCisgICAgICAgICAgICAgICAgICAgIH0sCisgICAgICAgICAgICAgICAgICAgIGNvbnRyb2xsZXI6IFsnJHNjb3BlJywgZnVuY3Rpb24gKCRzY29wZSkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRoaXMuZ2V0TWVudSA9IGZ1bmN0aW9uICgpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuICRzY29wZS5tZW51SXRlbXM7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgfTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB0aGlzLnNldE1lbnUgPSBmdW5jdGlvbiAobWVudUl0ZW0pIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJHNjb3BlLm1lbnVJdGVtcyA9IG1lbnVJdGVtOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIH07CisgICAgICAgICAgICAgICAgICAgICAgICB9XSwKKyAgICAgICAgICAgICAgICAgICAgdGVtcGxhdGVVcmw6ICdhcHAvc2NyaXB0cy9uZ19qc19hdHRfdHBscy90YWJzL3BhcmVudG1lbnVUYWIuaHRtbCcKKyAgICAgICAgICAgICAgICB9OworICAgICAgICAgICAgfV0pCisgICAgICAgIC5kaXJlY3RpdmUoJ21lbnVUYWJzJywgWyIkd2luZG93IiwgIiRkb2N1bWVudCIsIGZ1bmN0aW9uICh3aW4sICRkb2N1bWVudCkgeworICAgICAgICAgICAgICAgIHJldHVybiB7CisgICAgICAgICAgICAgICAgICAgIHJlc3RyaWN0OiAnRUEnLAorICAgICAgICAgICAgICAgICAgICB0cmFuc2NsdWRlOiB0cnVlLAorICAgICAgICAgICAgICAgICAgICByZXBsYWNlOiB0cnVlLAorICAgICAgICAgICAgICAgICAgICByZXF1aXJlOiBbJ15wYXJlbnRUYWInLCAnXj9wYXJlbnRtZW51VGFicyddLAorICAgICAgICAgICAgICAgICAgICBzY29wZTogeworICAgICAgICAgICAgICAgICAgICAgICAgYWN0aXZlTWVudTogIj0iLAorICAgICAgICAgICAgICAgICAgICAgICAgbWVudUl0ZW06ICI9IiwKKyAgICAgICAgICAgICAgICAgICAgICAgIHN1Yk1lbnU6ICJAIiwKKyAgICAgICAgICAgICAgICAgICAgICAgIHN1Ykl0ZW1BY3RpdmU6ICJAIgorICAgICAgICAgICAgICAgICAgICB9LAorICAgICAgICAgICAgICAgICAgICB0ZW1wbGF0ZVVybDogZnVuY3Rpb24gKGVsZW1lbnQsIGF0dHJzKSB7CisgICAgICAgICAgICAgICAgICAgICAgICBpZiAoYXR0cnMubWVnYU1lbnUpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gJ2FwcC9zY3JpcHRzL25nX2pzX2F0dF90cGxzL3RhYnMvbWVudVRhYi5odG1sJzsKKyAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgIGVsc2UgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiAnYXBwL3NjcmlwdHMvbmdfanNfYXR0X3RwbHMvdGFicy9zdWJtZW51VGFiLmh0bWwnOworICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICB9LAorICAgICAgICAgICAgICAgICAgICBsaW5rOiBmdW5jdGlvbiAoc2NvcGUsIGVsZW0sIGF0dHIsIGN0cmwpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIHZhciBwYXJlbnRDdHJsID0gY3RybFswXTsKKyAgICAgICAgICAgICAgICAgICAgICAgIHZhciBwYXJlbnRtZW51Q3RybCA9IGN0cmxbMV07CisgICAgICAgICAgICAgICAgICAgICAgICBzY29wZS5jbGlja0luYWN0aXZlID0gdHJ1ZTsKKyAgICAgICAgICAgICAgICAgICAgICAgIHNjb3BlLnNob3dIb3ZlckNoaWxkID0gZnVuY3Rpb24gKGUpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBzY29wZS5jbGlja0luYWN0aXZlID0gZmFsc2U7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2NvcGUuaG92ZXJDaGlsZCA9IGN0cmxbMF0uZ2V0U3ViTWVudVN0YXR1cygpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChlLnR5cGUgPT09ICJtb3VzZW92ZXIiICYmIGN0cmxbMF0uZ2V0U3ViTWVudVN0YXR1cygpKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2NvcGUuc2hvd0NoaWxkcmVuKGUpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgIH07CisgICAgICAgICAgICAgICAgICAgICAgICBzY29wZS5zaG93Q2hpbGRyZW4gPSBmdW5jdGlvbiAoZSkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNjb3BlLnBhcmVudE1lbnVJdGVtcyA9IHBhcmVudG1lbnVDdHJsLmdldE1lbnUoKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBmb3IgKHZhciBpID0gMDsgaSA8IHNjb3BlLnBhcmVudE1lbnVJdGVtcy5sZW5ndGg7IGkrKykgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzY29wZS5wYXJlbnRNZW51SXRlbXNbaV0uYWN0aXZlID0gZmFsc2U7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChzY29wZS5wYXJlbnRNZW51SXRlbXNbaV0uc3ViSXRlbXMpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZvciAodmFyIGogPSAwOyBqIDwgc2NvcGUucGFyZW50TWVudUl0ZW1zW2ldLnN1Ykl0ZW1zLmxlbmd0aDsgaisrKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2NvcGUucGFyZW50TWVudUl0ZW1zW2ldLnN1Ykl0ZW1zW2pdLmFjdGl2ZSA9IGZhbHNlOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNjb3BlLmNsaWNrSW5hY3RpdmUgPSB0cnVlOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBzY29wZS5tZW51SXRlbS5hY3RpdmUgPSB0cnVlOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNjb3BlLmFjdGl2ZU1lbnUgPSBzY29wZS5tZW51SXRlbTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBlLnN0b3BQcm9wYWdhdGlvbigpOworICAgICAgICAgICAgICAgICAgICAgICAgfTsKKyAgICAgICAgICAgICAgICAgICAgICAgIHNjb3BlLiR3YXRjaCgic3ViSXRlbUFjdGl2ZSIsIGZ1bmN0aW9uICh2YWx1ZSkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICh2YWx1ZSA9PT0gInRydWUiICYmIHNjb3BlLnN1Yk1lbnUgPT09ICd0cnVlJykgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwYXJlbnRDdHJsLnNldEFjdGl2ZU1lbnVIb3ZlclRhYihzY29wZS5tZW51SXRlbSk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgfSk7CisgICAgICAgICAgICAgICAgICAgICAgICBzY29wZS5zaG93TWVudUNsaWNrID0gZnVuY3Rpb24gKCkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBhcmVudEN0cmwuc2V0QWN0aXZlTWVudVRhYihzY29wZS5tZW51SXRlbSk7CisgICAgICAgICAgICAgICAgICAgICAgICB9OworICAgICAgICAgICAgICAgICAgICAgICAgc2NvcGUuc2hvd1N1Yk1lbnVDbGljayA9IGZ1bmN0aW9uICgpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBwYXJlbnRDdHJsLnNldEFjdGl2ZVN1Yk1lbnVUYWIoKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIH07CisgICAgICAgICAgICAgICAgICAgICAgICBzY29wZS5yZXNldE1lbnUgPSBmdW5jdGlvbiAoKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgcGFyZW50Q3RybC5yZXNldE1lbnVUYWIoKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIH07CisgICAgICAgICAgICAgICAgICAgICAgICBmdW5jdGlvbiBkZWJvdW5jZShtZXRob2QsIGRlbGF5KSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgY2xlYXJUaW1lb3V0KG1ldGhvZC5fdElkKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBtZXRob2QuX3RJZCA9IHNldFRpbWVvdXQoZnVuY3Rpb24gKCkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwYXJlbnRDdHJsLnNldE1lbnUoKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB9LCBkZWxheSk7CisgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICBmdW5jdGlvbiBkZWJvdW5jZTEobWV0aG9kLCBkZWxheSkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNsZWFyVGltZW91dChtZXRob2QuX3RJZCk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgbWV0aG9kLl90SWQgPSBzZXRUaW1lb3V0KGZ1bmN0aW9uICgpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcGFyZW50Q3RybC5zZXRBY3RpdmVNZW51KCk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSwgZGVsYXkpOworICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgJGRvY3VtZW50LmJpbmQoJ3Njcm9sbCcsIGZ1bmN0aW9uICgpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAod2luLnBhZ2VZT2Zmc2V0ID09PSAwKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRlYm91bmNlKHBhcmVudEN0cmwuc2V0TWVudSwgMTAwKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgZWxzZSBpZiAod2luLnBhZ2VZT2Zmc2V0ID4gMSAmJiB3aW4ucGFnZVlPZmZzZXQgPCAxNTAwKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRlYm91bmNlMShwYXJlbnRDdHJsLnNldEFjdGl2ZU1lbnUsIDEwMCk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgfSk7CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICB9OworICAgICAgICAgICAgfV0pOworYW5ndWxhci5tb2R1bGUoJ2F0dC5hYnMudGFnQmFkZ2VzJywgW10pCisgICAgICAgIC5kaXJlY3RpdmUoJ3RhZ0JhZGdlcycsIFsnJHBhcnNlJywgJyR0aW1lb3V0JywgZnVuY3Rpb24oJHBhcnNlLCAkdGltZW91dCkgeworICAgICAgICAgICAgICAgIHJldHVybiB7CisgICAgICAgICAgICAgICAgICAgIHJlc3RyaWN0OiAnRUEnLAorICAgICAgICAgICAgICAgICAgICByZXBsYWNlOiBmYWxzZSwKKyAgICAgICAgICAgICAgICAgICAgdHJhbnNjbHVkZTogdHJ1ZSwKKyAgICAgICAgICAgICAgICAgICAgdGVtcGxhdGVVcmw6ICdhcHAvc2NyaXB0cy9uZ19qc19hdHRfdHBscy90YWdCYWRnZXMvdGFnQmFkZ2VzLmh0bWwnLAorICAgICAgICAgICAgICAgICAgICBzY29wZTogeworICAgICAgICAgICAgICAgICAgICAgICAgc3R5bGVUeXBlOiAiQCIsCisgICAgICAgICAgICAgICAgICAgICAgICBvbkNsb3NlOiAiJiIKKyAgICAgICAgICAgICAgICAgICAgfSwKKyAgICAgICAgICAgICAgICAgICAgbGluazogZnVuY3Rpb24oc2NvcGUsIGVsZW0sIGF0dHIpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIHNjb3BlLmlzU21hbGwgPSBmYWxzZTsKKyAgICAgICAgICAgICAgICAgICAgICAgIHNjb3BlLmlzSWNvbiA9IGZhbHNlOworICAgICAgICAgICAgICAgICAgICAgICAgc2NvcGUuaXNDb2xvciA9IGZhbHNlOworICAgICAgICAgICAgICAgICAgICAgICAgc2NvcGUuZGlzcGxheSA9IHRydWU7CisgICAgICAgICAgICAgICAgICAgICAgICBzY29wZS5pc0Nsb3NhYmxlID0gZmFsc2U7CisgICAgICAgICAgICAgICAgICAgICAgICBzY29wZS5pc0hpZ2hsaWdodCA9IGZhbHNlOworICAgICAgICAgICAgICAgICAgICAgICAgc2NvcGUuY3VzdG9tQ29sb3IgPSBmYWxzZTsKKworICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGF0dHIuc21hbGwgPT09ICIiKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2NvcGUuaXNTbWFsbCA9IHRydWU7CisgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICBpZiAoc2NvcGUuc3R5bGVUeXBlID09PSAiaWNvbiIpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBzY29wZS5pc0ljb24gPSB0cnVlOworICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgZWxzZSBpZiAoc2NvcGUuc3R5bGVUeXBlID09PSAiY29sb3IiKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2NvcGUuaXNDb2xvciA9IHRydWU7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYoYXR0ci5jb2xvciAhPT0gdW5kZWZpbmVkICYmIGF0dHIuY29sb3IgIT09ICIiKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNjb3BlLmN1c3RvbUNvbG9yID0gdHJ1ZTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYXR0ci4kb2JzZXJ2ZSgiY29sb3IiLCBmdW5jdGlvbih2YWwpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNjb3BlLmJvcmRlcl90eXBlX2JvcmRlckNvbG9yID0gdmFsOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2NvcGUuYmFja2dyb3VuZF90eXBlX2JhY2tncm91bmRDb2xvciA9IHZhbDsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNjb3BlLmJhY2tncm91bmRfdHlwZV9ib3JkZXJDb2xvciA9IHZhbDsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgc2NvcGUuYWN0aXZlSGlnaGxpZ2h0ID0gZnVuY3Rpb24oc3RhdGUpeworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmKHNjb3BlLmN1c3RvbUNvbG9yKXsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYoc3RhdGUpeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2NvcGUuaXNIaWdobGlnaHQgPSB0cnVlOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGVsc2V7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzY29wZS5pc0hpZ2hsaWdodCA9IGZhbHNlOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgfTsKKyAgICAgICAgICAgICAgICAgICAgICAgIGlmIChhdHRyLmNsb3NhYmxlID09PSAiIikgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNjb3BlLmlzQ2xvc2FibGUgPSB0cnVlOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNjb3BlLmNsb3NlTWUgPSBmdW5jdGlvbigpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2NvcGUuZGlzcGxheSA9IGZhbHNlOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAkdGltZW91dChmdW5jdGlvbigpeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZWxlbS5hdHRyKCJ0YWJpbmRleCIsICIwIik7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBlbGVtWzBdLmZvY3VzKCk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBlbGVtLmJpbmQoJ2JsdXInLCBmdW5jdGlvbigpeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGVsZW0ucmVtb3ZlKCk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9KTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmKGF0dHJbJ29uQ2xvc2UnXSl7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzY29wZS5vbkNsb3NlID0gJHBhcnNlKHNjb3BlLm9uQ2xvc2UpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2NvcGUub25DbG9zZSgpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgfTsKKyAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIH07CisgICAgICAgICAgICB9XSk7Cithbmd1bGFyLm1vZHVsZSgnYXR0LmFicy50ZXh0T3ZlcmZsb3cnLCBbXSkKKyAgICAgICAgLmNvbnN0YW50KCd0ZXh0RGVmYXVsdE9wdGlvbnMnLCB7CisgICAgICAgICAgICB3aWR0aDogJzUwJScKKyAgICAgICAgfSkKKy5kaXJlY3RpdmUoJ2F0dFRleHRPdmVyZmxvdycsIFsndGV4dERlZmF1bHRPcHRpb25zJywnJGNvbXBpbGUnLGZ1bmN0aW9uKHRleHREZWZhdWx0T3B0aW9ucywkY29tcGlsZSkKK3sKKyAgICByZXR1cm4geworICAgICAgICByZXN0cmljdDogJ0EnLAorICAgICAgICBsaW5rOiBmdW5jdGlvbihzY29wZSwgZWxlbSwgYXR0cnMpCisgICAgICAgIHsKKyAgICAgICAgICAgIHZhciB0b29sdGlwVGV4dCA9IGVsZW0udGV4dCgpOworICAgICAgICAgICAgZWxlbS5hZGRDbGFzcygndGV4dC1lbGxpcHNpcycpOworICAgICAgICAgICAgYXR0cnMuJG9ic2VydmUoJ2F0dFRleHRPdmVyZmxvdycsIGZ1bmN0aW9uKHZhbCl7CisgICAgICAgICAgICAgICAgaWYodmFsKXsKKyAgICAgICAgICAgICAgICAgICAgZWxlbS5jc3MoeyJ3aWR0aCI6dmFsfSk7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIGVsc2V7CisgICAgICAgICAgICAgICAgICAgIGVsZW0uY3NzKHsid2lkdGgiOnRleHREZWZhdWx0T3B0aW9ucy53aWR0aH0pOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0pOworICAgICAgICAgICAgaWYoIShlbGVtLmF0dHIoJ3Rvb2x0aXAnKSkpeworICAgICAgICAgICAgICAgIGVsZW0uYXR0cigidG9vbHRpcCIsIHRvb2x0aXBUZXh0KTsKKyAgICAgICAgICAgICAgICBlbGVtLmF0dHIoInRvb2x0aXAtcGxhY2VtZW50IiwgJ2Fib3ZlJyk7CisgICAgICAgICAgICAgICAgdmFyIG5ld0VsZW0gPSAgYW5ndWxhci5lbGVtZW50KGVsZW0pOworICAgICAgICAgICAgICAgICRjb21waWxlKG5ld0VsZW0pKHNjb3BlKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgIH07Cit9XSk7CisKK2FuZ3VsYXIubW9kdWxlKCdhdHQuYWJzLnRvZ2dsZScsIFsnYW5ndWxhci1nZXN0dXJlcycsICdhdHQuYWJzLnBvc2l0aW9uJ10pCisgICAgICAgIC5kaXJlY3RpdmUoJ2F0dFRvZ2dsZVRlbXBsYXRlJywgWyckY29tcGlsZScsICckbG9nJywgJyRwb3NpdGlvbicsICBmdW5jdGlvbigkY29tcGlsZSwgJGxvZywgJHBvc2l0aW9uKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIHJldHVybnsKKyAgICAgICAgICAgICAgICAgICAgcmVzdHJpY3Q6ICdBJywKKyAgICAgICAgICAgICAgICAgICAgcmVxdWlyZTogJ25nTW9kZWwnLAorICAgICAgICAgICAgICAgICAgICB0cmFuc2NsdWRlOiB0cnVlLAorICAgICAgICAgICAgICAgICAgICBzY29wZTogeworICAgICAgICAgICAgICAgICAgICAgICAgbW9kZWxWYWw6ICI9bmdNb2RlbCIKKyAgICAgICAgICAgICAgICAgICAgfSwKKyAgICAgICAgICAgICAgICAgICAgdGVtcGxhdGVVcmw6ICdhcHAvc2NyaXB0cy9uZ19qc19hdHRfdHBscy90b2dnbGUvZGVtb1RvZ2dsZS5odG1sJywKKyAgICAgICAgICAgICAgICAgICAgbGluazogZnVuY3Rpb24oc2NvcGUsIGVsZW1lbnQsIGF0dHIpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIHNjb3BlLmluaXRpYWxEcmFnUG9zaXRpb24gPSAwOworICAgICAgICAgICAgICAgICAgICAgICAgdmFyIGRyYWdTdGF0dXMgPSAwOworICAgICAgICAgICAgICAgICAgICAgICAgdmFyIHN3aXRjaE1vdmVtZW50UGF0aCA9ICgkcG9zaXRpb24ub2Zmc2V0KGVsZW1lbnQuY2hpbGRyZW4oKS5lcSgxKS5jaGlsZHJlbigpLmVxKDApKS53aWR0aCAtMSk7CisgICAgICAgICAgICAgICAgICAgICAgICAgdmFyIHVwZGF0ZU1vZGVsVmFsID0gZnVuY3Rpb24oKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChzY29wZS5hdHRyVmFsdWUgPT09IGF0dHIubmdUcnVlVmFsdWUgfHwgc2NvcGUuYXR0clZhbHVlKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2NvcGUubW9kZWxWYWwgPSBmYWxzZTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2NvcGUubW9kZWxWYWwgPSB0cnVlOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgIH07CisgICAgICAgICAgICAgICAgICAgICAgICBzY29wZS51cGRhdGVNb2RlbCA9IGZ1bmN0aW9uKGVudil7CisgICAgICAgICAgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGRyYWdTdGF0dXMgIT09IDEpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdXBkYXRlTW9kZWxWYWwoKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZHJhZ1N0YXR1cyA9IDA7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBlbnYucHJldmVudERlZmF1bHQoKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIH07CisgICAgICAgICAgICAgICAgICAgICAgICBzY29wZS5kcmFnID0gZnVuY3Rpb24oZSkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRyYWdTdGF0dXMgPSAxOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChlLnR5cGUgPT09ICdkcmFnc3RhcnQnKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNjb3BlLmluaXRpYWxEcmFnUG9zaXRpb24gPSAkcG9zaXRpb24ucG9zaXRpb24oZWxlbWVudC5jaGlsZHJlbigpLmVxKDEpKS5sZWZ0OworCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGVsZW1lbnQuY2hpbGRyZW4oKS5lcSgxKS5hZGRDbGFzcygnZHJhZ2dpbmcnKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKGUudHlwZSA9PT0gJ2RyYWcnKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhciBsZWZ0ID0gTWF0aC5taW4oMCwgTWF0aC5tYXgoc2NvcGUuaW5pdGlhbERyYWdQb3NpdGlvbiArIGUuZ2VzdHVyZS5kZWx0YVgsIC1zd2l0Y2hNb3ZlbWVudFBhdGgpKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZWxlbWVudC5jaGlsZHJlbigpLmVxKDEpLmNzcyh7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBsZWZ0OiBsZWZ0ICsgJ3B4JworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9KTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKGUudHlwZSA9PT0gJ2RyYWdlbmQnKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhciBpc09uID0gJHBvc2l0aW9uLnBvc2l0aW9uKGVsZW1lbnQuY2hpbGRyZW4oKS5lcSgxKSkubGVmdCA+IChzd2l0Y2hNb3ZlbWVudFBhdGgqLTEpLzI7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGVsZW1lbnQuY2hpbGRyZW4oKS5lcSgxKS5yZW1vdmVDbGFzcygnZHJhZ2dpbmcnKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgVHdlZW5NYXgudG8oZWxlbWVudC5jaGlsZHJlbigpLmVxKDEpLCAuMSwge2xlZnQ6IGlzT24gPyAwIDogKHN3aXRjaE1vdmVtZW50UGF0aCotMSksIGVhc2U6IFBvd2VyNC5lYXNlT3V0LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgb25Db21wbGV0ZTogZnVuY3Rpb24oKXtlbGVtZW50LmNoaWxkcmVuKCkuZXEoMSkuY3NzKHtsZWZ0OiAnJ30pOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfX0pOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZihpc09uIHx8ICghaXNPbiAmJiBlLmdlc3R1cmUuZGlyZWN0aW9uID09PSAibGVmdCIpKXsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdXBkYXRlTW9kZWxWYWwoKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgZHJhZ1N0YXR1cyA9IDA7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQorCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGZhbHNlOworICAgICAgICAgICAgICAgICAgICAgICAgfTsKKworICAgICAgICAgICAgICAgICAgICAgICAgc2NvcGUuZGlyZWN0aXZlVmFsdWUgPSBhdHRyLmF0dFRvZ2dsZVRlbXBsYXRlOworICAgICAgICAgICAgICAgICAgICAgICAgc2NvcGUub24gPSBhdHRyLnRydWVWYWx1ZTsKKyAgICAgICAgICAgICAgICAgICAgICAgIHNjb3BlLm9mZiA9IGF0dHIuZmFsc2VWYWx1ZTsKKyAgICAgICAgICAgICAgICAgICAgICAgIHZhciBzd2l0Y2hNb3ZlbWVudFBhdGhQaXhlbHMgPSAoKHN3aXRjaE1vdmVtZW50UGF0aCkqLTEpICsgJ3B4JzsKKyAgICAgICAgICAgICAgICAgICAgICAgIHNjb3BlLiR3YXRjaCgnbW9kZWxWYWwnLCBmdW5jdGlvbihuZXdWYWwpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBzY29wZS5hdHRyVmFsdWUgPSBuZXdWYWw7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKG5ld1ZhbCA9PT0gYXR0ci5uZ1RydWVWYWx1ZSB8fCBuZXdWYWwpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZWxlbWVudC5jaGlsZHJlbigpLmVxKDEpLmNzcyh7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBsZWZ0IDogJzBweCcKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGVsZW1lbnQuYWRkQ2xhc3MoJ2F0dC1jaGVja2JveC0tb24nKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZWxlbWVudC5hdHRyKCJhcmlhLWNoZWNrZWQiLCB0cnVlKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZHJhZ1N0YXR1cyA9IDA7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZWxlbWVudC5jaGlsZHJlbigpLmVxKDEpLmNzcyh7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBsZWZ0IDogc3dpdGNoTW92ZW1lbnRQYXRoUGl4ZWxzCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0pOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBlbGVtZW50LnJlbW92ZUNsYXNzKCdhdHQtY2hlY2tib3gtLW9uJyk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGVsZW1lbnQuYXR0cigiYXJpYS1jaGVja2VkIiwgZmFsc2UpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBkcmFnU3RhdHVzID0gMDsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgZWxlbWVudC5jaGlsZHJlbigpLmVxKDEpLmNzcyh7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBsZWZ0IDogJycKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSk7CisgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgIH07CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgXSkKKworICAgICAgICAuZGlyZWN0aXZlKCdhdHRUb2dnbGVNYWluJywgWyckY29tcGlsZScsIGZ1bmN0aW9uKCRjb21waWxlKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIHJldHVybnsKKyAgICAgICAgICAgICAgICAgICAgcmVzdHJpY3Q6ICdBJywKKyAgICAgICAgICAgICAgICAgICAgcmVxdWlyZTogJ25nTW9kZWwnLAorICAgICAgICAgICAgICAgICAgICB0cmFuc2NsdWRlOiB0cnVlLAorICAgICAgICAgICAgICAgICAgICByZXBsYWNlOiB0cnVlLAorICAgICAgICAgICAgICAgICAgICBzY29wZTogeworICAgICAgICAgICAgICAgICAgICAgICAgbW9kZWxWYWx1ZTogIj1uZ01vZGVsIiwKKyAgICAgICAgICAgICAgICAgICAgICAgIHRydWVWYWx1ZTogIj1uZ1RydWVWYWx1ZSIsCisgICAgICAgICAgICAgICAgICAgICAgICBmYWxzZVZhbHVlOiAiPW5nRmFsc2VWYWx1ZSIKKyAgICAgICAgICAgICAgICAgICAgfSwKKyAgICAgICAgICAgICAgICAgICAgbGluazogZnVuY3Rpb24oc2NvcGUsIGVsZW1lbnQsIGF0dHIpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIHZhciBodG1sID0gIiI7CisgICAgICAgICAgICAgICAgICAgICAgICB2YXIgYXR0clZhbCA9ICIiOworICAgICAgICAgICAgICAgICAgICAgICAgZWxlbWVudC5yZW1vdmVBdHRyKCdhdHQtdG9nZ2xlLW1haW4nKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIHNjb3BlLm9uID0gYXR0ci5uZ1RydWVWYWx1ZTsKKyAgICAgICAgICAgICAgICAgICAgICAgIHNjb3BlLm9mZiA9IGF0dHIubmdGYWxzZVZhbHVlOworICAgICAgICAgICAgICAgICAgICAgICAgc2NvcGUubGFyZ2VWYWx1ZSA9IGF0dHIuYXR0VG9nZ2xlTWFpbjsKKyAgICAgICAgICAgICAgICAgICAgICAgIGlmIChhbmd1bGFyLmlzRGVmaW5lZChhdHRyLm5nVHJ1ZVZhbHVlKSkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGh0bWwgKz0gJyB0cnVlLXZhbHVlPSJ7e29ufX0iIGZhbHNlLXZhbHVlPSJ7e29mZn19Iic7CisgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICBpZiAoc2NvcGUubGFyZ2VWYWx1ZSAhPT0gdW5kZWZpbmVkKQorICAgICAgICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGF0dHJWYWwgKz0gJyA9Int7bGFyZ2VWYWx1ZX19Iic7CisgICAgICAgICAgICAgICAgICAgICAgICB9CisKKyAgICAgICAgICAgICAgICAgICAgICAgIGVsZW1lbnQuY3NzKHtkaXNwbGF5Oidub25lJ30pOworICAgICAgICAgICAgICAgICAgICAgICAgdmFyIGVsbSA9IGFuZ3VsYXIuZWxlbWVudCgnPGRpdiByb2xlPSJjaGVja2JveCIgY2xhc3M9ImF0dC1zd2l0Y2ggYXR0LXN3aXRjaC1hbHQiICBuZy1jbGFzcz0ie1wnbGFyZ2VcJyA6IGxhcmdlVmFsdWUgPT0gXCdsYXJnZVwnfSIgbmctbW9kZWw9Im1vZGVsVmFsdWUiJyArIGh0bWwgKyAnIGF0dC10b2dnbGUtdGVtcGxhdGUnICsgYXR0clZhbCArICc+JyArIGVsZW1lbnQucHJvcCgnb3V0ZXJIVE1MJykgKyAnPC9kaXY+Jyk7CisgICAgICAgICAgICAgICAgICAgICAgICBlbG0gPSAkY29tcGlsZShlbG0pKHNjb3BlKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIGVsZW1lbnQucmVwbGFjZVdpdGgoZWxtKTsKKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIH07CisgICAgICAgICAgICB9XQorICAgICAgICAgICAgICAgICk7Cithbmd1bGFyLm1vZHVsZSgnYXR0LmFicy50b29sdGlwJywgWydhdHQuYWJzLnBvc2l0aW9uJywgJ2F0dC5hYnMudXRpbGl0aWVzJywgJ25nU2FuaXRpemUnXSkKKyAgICAgICAgLy8gVGhlIGRlZmF1bHQgb3B0aW9ucyB0b29sdGlwIGFuZCBwb3BvdmVyLgorICAgICAgICAuY29uc3RhbnQoJ3Rvb2x0aXBEZWZhdWx0T3B0aW9ucycsIHsKKyAgICAgICAgICAgIHBsYWNlbWVudDogJ2Fib3ZlJywKKyAgICAgICAgICAgIGFuaW1hdGlvbjogZmFsc2UsCisgICAgICAgICAgICBwb3B1cERlbGF5OiAwLAorICAgICAgICAgICAgc3R5bGV0dDogJ2RhcmsnLAorICAgICAgICAgICAgYXBwZW5kVG9Cb2R5OiB0cnVlCisgICAgICAgIH0pCisKKyAgICAgICAgLyoqCisgICAgICAgICAqIFRoZSAkdG9vbHRpcCBzZXJ2aWNlIGNyZWF0ZXMgdG9vbHRpcC0gYW5kIHBvcG92ZXItbGlrZSBkaXJlY3RpdmVzIGFzIHdlbGwgYXMKKyAgICAgICAgICogaG91c2VzIGdsb2JhbCBvcHRpb25zIGZvciB0aGVtLgorICAgICAgICAgKi8KKyAgICAgICAgLnByb3ZpZGVyKCckdG9vbHRpcCcsIFsndG9vbHRpcERlZmF1bHRPcHRpb25zJywgZnVuY3Rpb24odG9vbHRpcERlZmF1bHRPcHRpb25zKSB7CisKKyAgICAgICAgICAgIC8vIERlZmF1bHQgaGlkZSB0cmlnZ2VycyBmb3IgZWFjaCBzaG93IHRyaWdnZXIKKyAgICAgICAgICAgIHZhciB0cmlnZ2VyTWFwID0geworICAgICAgICAgICAgICAgICdtb3VzZWVudGVyJzogJ21vdXNlbGVhdmUnLAorICAgICAgICAgICAgICAgICdjbGljayc6ICdjbGljaycsCisgICAgICAgICAgICAgICAgJ2ZvY3VzJzogJ2JsdXInLAorICAgICAgICAgICAgICAgICdtb3VzZW92ZXInOidtb3VzZW91dCcKKyAgICAgICAgICAgIH07CisKKyAgICAgICAgICAgIC8vIFRoZSBvcHRpb25zIHNwZWNpZmllZCB0byB0aGUgcHJvdmlkZXIgZ2xvYmFsbHkuCisgICAgICAgICAgICB2YXIgZ2xvYmFsT3B0aW9ucyA9IHt9OworCisgICAgICAgICAgICB0aGlzLm9wdGlvbnMgPSBmdW5jdGlvbih2YWx1ZSkgeworICAgICAgICAgICAgICAgIGFuZ3VsYXIuZXh0ZW5kKGdsb2JhbE9wdGlvbnMsIHZhbHVlKTsKKyAgICAgICAgICAgIH07CisKKyAgICAgICAgICAgIC8qKgorICAgICAgICAgICAgICogVGhpcyBhbGxvd3MgeW91IHRvIGV4dGVuZCB0aGUgc2V0IG9mIHRyaWdnZXIgbWFwcGluZ3MgYXZhaWxhYmxlLiBFLmcuOgorICAgICAgICAgICAgICoKKyAgICAgICAgICAgICAqICAgJHRvb2x0aXBQcm92aWRlci5zZXRUcmlnZ2VycyggJ29wZW5UcmlnZ2VyJzogJ2Nsb3NlVHJpZ2dlcicgKTsKKyAgICAgICAgICAgICAqLworICAgICAgICAgICAgdGhpcy5zZXRUcmlnZ2VycyA9IGZ1bmN0aW9uKHRyaWdnZXJzKSB7CisgICAgICAgICAgICAgICAgYW5ndWxhci5leHRlbmQodHJpZ2dlck1hcCwgdHJpZ2dlcnMpOworICAgICAgICAgICAgfTsKKworICAgICAgICAgICAgLyoqCisgICAgICAgICAgICAgKiBUaGlzIGlzIGEgaGVscGVyIGZ1bmN0aW9uIGZvciB0cmFuc2xhdGluZyBjYW1lbC1jYXNlIHRvIHNuYWtlLWNhc2UuCisgICAgICAgICAgICAgKi8KKyAgICAgICAgICAgIGZ1bmN0aW9uIHNuYWtlQ2FzZShuYW1lKSB7CisgICAgICAgICAgICAgICAgdmFyIHJlZ2V4cCA9IC9bQS1aXS9nOworICAgICAgICAgICAgICAgIHZhciBzZXBhcmF0b3IgPSAnLSc7CisgICAgICAgICAgICAgICAgcmV0dXJuIG5hbWUucmVwbGFjZShyZWdleHAsIGZ1bmN0aW9uKGxldHRlciwgcG9zKSB7CisgICAgICAgICAgICAgICAgICAgIHJldHVybiAocG9zID8gc2VwYXJhdG9yIDogJycpICsgbGV0dGVyLnRvTG93ZXJDYXNlKCk7CisgICAgICAgICAgICAgICAgfSk7CisgICAgICAgICAgICB9CisKKyAgICAgICAgICAgIC8qKgorICAgICAgICAgICAgICogUmV0dXJucyB0aGUgYWN0dWFsIGluc3RhbmNlIG9mIHRoZSAkdG9vbHRpcCBzZXJ2aWNlLgorICAgICAgICAgICAgICovCisgICAgICAgICAgICB0aGlzLiRnZXQgPSBbJyR3aW5kb3cnLCAnJGNvbXBpbGUnLCAnJHRpbWVvdXQnLCAnJHBhcnNlJywgJyRkb2N1bWVudCcsICckcG9zaXRpb24nLCAnJGludGVycG9sYXRlJywgZnVuY3Rpb24oJHdpbmRvdywgJGNvbXBpbGUsICR0aW1lb3V0LCAkcGFyc2UsICRkb2N1bWVudCwgJHBvc2l0aW9uLCAkaW50ZXJwb2xhdGUpIHsKKyAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGZ1bmN0aW9uICh0eXBlLCBwcmVmaXgsIGRlZmF1bHRUcmlnZ2VyU2hvdykgeworICAgICAgICAgICAgICAgICAgICAgICAgdmFyIG9wdGlvbnMgPSBhbmd1bGFyLmV4dGVuZCh7fSwgdG9vbHRpcERlZmF1bHRPcHRpb25zLCBnbG9iYWxPcHRpb25zKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIC8qKgorICAgICAgICAgICAgICAgICAgICAgICAgICogUmV0dXJucyBhbiBvYmplY3Qgb2Ygc2hvdyBhbmQgaGlkZSB0cmlnZ2Vycy4KKyAgICAgICAgICAgICAgICAgICAgICAgICAqCisgICAgICAgICAgICAgICAgICAgICAgICAgKiBJZiBhIHRyaWdnZXIgaXMgc3VwcGxpZWQsCisgICAgICAgICAgICAgICAgICAgICAgICAgKiBpdCBpcyB1c2VkIHRvIHNob3cgdGhlIHRvb2x0aXA7IG90aGVyd2lzZSwgaXQgd2lsbCB1c2UgdGhlIGB0cmlnZ2VyYAorICAgICAgICAgICAgICAgICAgICAgICAgICogb3B0aW9uIHBhc3NlZCB0byB0aGUgYCR0b29sdGlwUHJvdmlkZXIub3B0aW9uc2AgbWV0aG9kOyBlbHNlIGl0IHdpbGwKKyAgICAgICAgICAgICAgICAgICAgICAgICAqIGRlZmF1bHQgdG8gdGhlIHRyaWdnZXIgc3VwcGxpZWQgdG8gdGhpcyBkaXJlY3RpdmUgZmFjdG9yeS4KKyAgICAgICAgICAgICAgICAgICAgICAgICAqCisgICAgICAgICAgICAgICAgICAgICAgICAgKiBUaGUgaGlkZSB0cmlnZ2VyIGlzIGJhc2VkIG9uIHRoZSBzaG93IHRyaWdnZXIuIElmIHRoZSBgdHJpZ2dlcmAgb3B0aW9uCisgICAgICAgICAgICAgICAgICAgICAgICAgKiB3YXMgcGFzc2VkIHRvIHRoZSBgJHRvb2x0aXBQcm92aWRlci5vcHRpb25zYCBtZXRob2QsIGl0IHdpbGwgdXNlIHRoZQorICAgICAgICAgICAgICAgICAgICAgICAgICogbWFwcGVkIHRyaWdnZXIgZnJvbSBgdHJpZ2dlck1hcGAgb3IgdGhlIHBhc3NlZCB0cmlnZ2VyIGlmIHRoZSBtYXAgaXMKKyAgICAgICAgICAgICAgICAgICAgICAgICAqIHVuZGVmaW5lZDsgb3RoZXJ3aXNlLCBpdCB1c2VzIHRoZSBgdHJpZ2dlck1hcGAgdmFsdWUgb2YgdGhlIHNob3cKKyAgICAgICAgICAgICAgICAgICAgICAgICAqIHRyaWdnZXI7IGVsc2UgaXQgd2lsbCBqdXN0IHVzZSB0aGUgc2hvdyB0cmlnZ2VyLgorICAgICAgICAgICAgICAgICAgICAgICAgICovCisgICAgICAgICAgICAgICAgICAgICAgICBmdW5jdGlvbiBnZXRUcmlnZ2Vycyh0cmlnZ2VyKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFyIHNob3cgPSB0cmlnZ2VyIHx8IG9wdGlvbnMudHJpZ2dlciB8fCBkZWZhdWx0VHJpZ2dlclNob3c7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFyIGhpZGUgPSB0cmlnZ2VyTWFwW3Nob3ddIHx8IHNob3c7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2hvdzogc2hvdywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaGlkZTogaGlkZQorICAgICAgICAgICAgICAgICAgICAgICAgICAgIH07CisgICAgICAgICAgICAgICAgICAgICAgICB9CisKKyAgICAgICAgICAgICAgICAgICAgICAgIHZhciBkaXJlY3RpdmVOYW1lID0gc25ha2VDYXNlKHR5cGUpOworCisgICAgICAgICAgICAgICAgICAgICAgICB2YXIgc3RhcnRTeW0gPSAkaW50ZXJwb2xhdGUuc3RhcnRTeW1ib2woKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIHZhciBlbmRTeW0gPSAkaW50ZXJwb2xhdGUuZW5kU3ltYm9sKCk7CisgICAgICAgICAgICAgICAgICAgICAgICB2YXIgdGVtcGxhdGUgPQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAnPGRpdiAnICsgZGlyZWN0aXZlTmFtZSArICctcG9wdXAgJyArCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICd0aXRsZT0iJyArIHN0YXJ0U3ltICsgJ3R0X3RpdGxlJyArIGVuZFN5bSArICciICcgKworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAnY29udGVudD0iJyArIHN0YXJ0U3ltICsgJ3R0X2NvbnRlbnQnICsgZW5kU3ltICsgJyIgJyArCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICdwbGFjZW1lbnQ9IicgKyBzdGFydFN5bSArICd0dF9wbGFjZW1lbnQnICsgZW5kU3ltICsgJyIgJyArCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICdhbmltYXRpb249InR0X2FuaW1hdGlvbigpIiAnICsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJ2lzLW9wZW49InR0X2lzT3BlbiIgJyArCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICdzdHlsZXR0PSInICsgc3RhcnRTeW0gKyAndHRfc3R5bGUnICsgZW5kU3ltICsgJyIgJyArCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICc+JyArCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICc8L2Rpdj4nOworICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXN0cmljdDogJ0VBJywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBzY29wZTogdHJ1ZSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBsaW5rOiBmdW5jdGlvbiAoc2NvcGUsIGVsZW1lbnQsIGF0dHJzKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGVsZW1lbnQuYXR0cigidGFiaW5kZXgiLCAiMCIpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBlbGVtZW50LmJpbmQoJ21vdXNlZW50ZXInLCBmdW5jdGlvbigpeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZWxlbWVudC5yZW1vdmVBdHRyKCJ0aXRsZSIpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9KTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZWxlbWVudC5iaW5kKCdtb3VzZWxlYXZlJywgZnVuY3Rpb24oKXsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGVsZW1lbnQuYXR0cigidGl0bGUiLCBzY29wZS50dF9jb250ZW50KTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhciB0b29sdGlwID0gJGNvbXBpbGUodGVtcGxhdGUpKHNjb3BlKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFyIHRyYW5zaXRpb25UaW1lb3V0OworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YXIgcG9wdXBUaW1lb3V0OworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YXIgJGJvZHk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhciBhcHBlbmRUb0JvZHkgPSBhbmd1bGFyLmlzRGVmaW5lZChvcHRpb25zLmFwcGVuZFRvQm9keSkgPyBvcHRpb25zLmFwcGVuZFRvQm9keSA6IGZhbHNlOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YXIgdHJpZ2dlcnMgPSBnZXRUcmlnZ2Vycyh1bmRlZmluZWQpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YXIgaGFzUmVnaXN0ZXJlZFRyaWdnZXJzID0gZmFsc2U7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhciBoYXNFbmFibGVFeHAgPSBhbmd1bGFyLmlzRGVmaW5lZChhdHRyc1twcmVmaXggKyAnRW5hYmxlJ10pOworCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vIEJ5IGRlZmF1bHQsIHRoZSB0b29sdGlwIGlzIG5vdCBvcGVuLgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyBhZGQgYWJpbGl0eSB0byBzdGFydCB0b29sdGlwIG9wZW5lZAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzY29wZS50dF9pc09wZW4gPSBmYWxzZTsKKworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvL0FkZGluZyBhIHNjb3BlIHdhdGNoLCB0byByZW1vdmUgdGhlIGNyZWF0ZWQgcG9wdXAgZnJvbSBET00sIGluY2FzZSBpdCBpcyB1cGRhdGVkIG91dHNpZGUgdGhlIHByb3ZpZGVyIGNvZGUuCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNjb3BlLiR3YXRjaCgndHRfaXNPcGVuJywgZnVuY3Rpb24obmV3VmFsLCBvbGRWYWwpeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYobmV3VmFsICE9PSBvbGRWYWwgJiYgIW5ld1ZhbCl7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdG9vbHRpcC5yZW1vdmUoKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSk7CisKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZnVuY3Rpb24gdG9nZ2xlVG9vbHRpcEJpbmQoKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoIXNjb3BlLnR0X2lzT3BlbikgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNob3dUb29sdGlwQmluZCgpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBoaWRlVG9vbHRpcEJpbmQoKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQorCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vIFNob3cgdGhlIHRvb2x0aXAgd2l0aCBkZWxheSBpZiBzcGVjaWZpZWQsIG90aGVyd2lzZSBzaG93IGl0IGltbWVkaWF0ZWx5CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZ1bmN0aW9uIHNob3dUb29sdGlwQmluZCgpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRvb2x0aXAgPSAkY29tcGlsZSh0ZW1wbGF0ZSkoc2NvcGUpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2NvcGUuJGRpZ2VzdCgpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGhhc0VuYWJsZUV4cCAmJiAhc2NvcGUuJGV2YWwoYXR0cnNbcHJlZml4ICsgJ0VuYWJsZSddKSkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybjsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChzY29wZS50dF9wb3B1cERlbGF5KSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcG9wdXBUaW1lb3V0ID0gJHRpbWVvdXQoc2hvdywgc2NvcGUudHRfcG9wdXBEZWxheSk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNjb3BlLiRhcHBseShzaG93KTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQorCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZ1bmN0aW9uIGhpZGVUb29sdGlwQmluZCgpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNjb3BlLiRhcHBseShmdW5jdGlvbigpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBoaWRlKCk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9KTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQorCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vIFNob3cgdGhlIHRvb2x0aXAgcG9wdXAgZWxlbWVudC4KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZnVuY3Rpb24gc2hvdygpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhciBwb3NpdGlvbiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdHRXaWR0aCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdHRIZWlnaHQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHR0UG9zaXRpb247CisKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vIERvbid0IHNob3cgZW1wdHkgdG9vbHRpcHMuCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoIXNjb3BlLnR0X2NvbnRlbnQpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm47CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CisKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vIElmIHRoZXJlIGlzIGEgcGVuZGluZyByZW1vdmUgdHJhbnNpdGlvbiwgd2UgbXVzdCBjYW5jZWwgaXQsIGxlc3QgdGhlCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyB0b29sdGlwIGJlIG15c3RlcmlvdXNseSByZW1vdmVkLgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHRyYW5zaXRpb25UaW1lb3V0KSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJHRpbWVvdXQuY2FuY2VsKHRyYW5zaXRpb25UaW1lb3V0KTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KKworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gU2V0IHRoZSBpbml0aWFsIHBvc2l0aW9uaW5nLgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdG9vbHRpcC5jc3Moe3RvcDogMCwgbGVmdDogMCwgZGlzcGxheTogJ2Jsb2NrJywgJ3otaW5kZXgnOiA5OTk5fSk7CisKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vIE5vdyB3ZSBhZGQgaXQgdG8gdGhlIERPTSBiZWNhdXNlIG5lZWQgc29tZSBpbmZvIGFib3V0IGl0LiBCdXQgaXQncyBub3QKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vIHZpc2libGUgeWV0IGFueXdheS4KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChhcHBlbmRUb0JvZHkpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAkYm9keSA9ICRib2R5IHx8ICRkb2N1bWVudC5maW5kKCdib2R5Jyk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJGJvZHkuYXBwZW5kKHRvb2x0aXApOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBlbGVtZW50LmFmdGVyKHRvb2x0aXApOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQorCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyBHZXQgdGhlIHBvc2l0aW9uIG9mIHRoZSBkaXJlY3RpdmUgZWxlbWVudC4KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBvc2l0aW9uID0gYXBwZW5kVG9Cb2R5ID8gJHBvc2l0aW9uLm9mZnNldChlbGVtZW50KSA6ICRwb3NpdGlvbi5wb3NpdGlvbihlbGVtZW50KTsKKworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gR2V0IHRoZSBoZWlnaHQgYW5kIHdpZHRoIG9mIHRoZSB0b29sdGlwIHNvIHdlIGNhbiBjZW50ZXIgaXQuCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0dFdpZHRoID0gdG9vbHRpcC5wcm9wKCdvZmZzZXRXaWR0aCcpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdHRIZWlnaHQgPSB0b29sdGlwLnByb3AoJ29mZnNldEhlaWdodCcpOworCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyBDYWxjdWxhdGUgdGhlIHRvb2x0aXAncyB0b3AgYW5kIGxlZnQgY29vcmRpbmF0ZXMgdG8gY2VudGVyIGl0IHdpdGgKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vIHRoaXMgZGlyZWN0aXZlLgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFyIHR0QXJyb3dPZmZzZXQgPSAxMDsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHN3aXRjaCAoc2NvcGUudHRfcGxhY2VtZW50KSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY2FzZSAncmlnaHQnOgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZihhcHBlbmRUb0JvZHkpeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdHRQb3NpdGlvbiA9IHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0b3A6IHBvc2l0aW9uLnRvcCArIHBvc2l0aW9uLmhlaWdodCAvIDIgLSB0dEhlaWdodCAvIDIsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbGVmdDogcG9zaXRpb24ubGVmdCArIHBvc2l0aW9uLndpZHRoCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9OworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9ZWxzZXsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHR0UG9zaXRpb24gPSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdG9wOiBwb3NpdGlvbi50b3AgKyBwb3NpdGlvbi5oZWlnaHQgLyAyIC0gdHRIZWlnaHQgLyAyLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxlZnQ6IHBvc2l0aW9uLmxlZnQgKyBwb3NpdGlvbi53aWR0aCArIHR0QXJyb3dPZmZzZXQKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH07CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY2FzZSAnYmVsb3cnOgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZihhcHBlbmRUb0JvZHkpeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdHRQb3NpdGlvbiA9IHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0b3A6IHBvc2l0aW9uLnRvcCArIHBvc2l0aW9uLmhlaWdodCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBsZWZ0OiBwb3NpdGlvbi5sZWZ0ICsgcG9zaXRpb24ud2lkdGggLyAyIC0gdHRXaWR0aCAvIDIKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH07CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1lbHNleworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdHRQb3NpdGlvbiA9IHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0b3A6IHBvc2l0aW9uLnRvcCArIHBvc2l0aW9uLmhlaWdodCArIHR0QXJyb3dPZmZzZXQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbGVmdDogcG9zaXRpb24ubGVmdCArIHBvc2l0aW9uLndpZHRoIC8gMiAtIHR0V2lkdGggLyAyCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9OworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNhc2UgJ2xlZnQnOgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZihhcHBlbmRUb0JvZHkpeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdHRQb3NpdGlvbiA9IHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0b3A6IHBvc2l0aW9uLnRvcCArIHBvc2l0aW9uLmhlaWdodCAvIDIgLSB0dEhlaWdodCAvIDIsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbGVmdDogcG9zaXRpb24ubGVmdCAtIHR0V2lkdGgKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH07CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1lbHNleworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdHRQb3NpdGlvbiA9IHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0b3A6IHBvc2l0aW9uLnRvcCArIHBvc2l0aW9uLmhlaWdodCAvIDIgLSB0dEhlaWdodCAvIDIsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbGVmdDogcG9zaXRpb24ubGVmdCAtIHR0V2lkdGggLSB0dEFycm93T2Zmc2V0CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9OworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRlZmF1bHQ6CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmKGFwcGVuZFRvQm9keSl7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0dFBvc2l0aW9uID0geworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRvcDogcG9zaXRpb24udG9wIC0gdHRIZWlnaHQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbGVmdDogcG9zaXRpb24ubGVmdCArIHBvc2l0aW9uLndpZHRoIC8gMiAtIHR0V2lkdGggLyAyCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9OworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9ZWxzZXsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHR0UG9zaXRpb24gPSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdG9wOiBwb3NpdGlvbi50b3AgLSB0dEhlaWdodCAtIHR0QXJyb3dPZmZzZXQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbGVmdDogcG9zaXRpb24ubGVmdCArIHBvc2l0aW9uLndpZHRoIC8gMiAtIHR0V2lkdGggLyAyCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9OworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQorCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0dFBvc2l0aW9uLnRvcCArPSAncHgnOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdHRQb3NpdGlvbi5sZWZ0ICs9ICdweCc7CisKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vIE5vdyBzZXQgdGhlIGNhbGN1bGF0ZWQgcG9zaXRpb25pbmcuCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0b29sdGlwLmNzcyh0dFBvc2l0aW9uKTsKKworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gQW5kIHNob3cgdGhlIHRvb2x0aXAuCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzY29wZS50dF9pc09wZW4gPSB0cnVlOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CisKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gSGlkZSB0aGUgdG9vbHRpcCBwb3B1cCBlbGVtZW50LgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBmdW5jdGlvbiBoaWRlKCkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gRmlyc3QgdGhpbmdzIGZpcnN0OiB3ZSBkb24ndCBzaG93IGl0IGFueW1vcmUuCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzY29wZS50dF9pc09wZW4gPSBmYWxzZTsKKworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLy9pZiB0b29sdGlwIGlzIGdvaW5nIHRvIGJlIHNob3duIGFmdGVyIGRlbGF5LCB3ZSBtdXN0IGNhbmNlbCB0aGlzCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAkdGltZW91dC5jYW5jZWwocG9wdXBUaW1lb3V0KTsKKworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gQW5kIG5vdyB3ZSByZW1vdmUgaXQgZnJvbSB0aGUgRE9NLiBIb3dldmVyLCBpZiB3ZSBoYXZlIGFuaW1hdGlvbiwgd2UKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vIG5lZWQgdG8gd2FpdCBmb3IgaXQgdG8gZXhwaXJlIGJlZm9yZWhhbmQuCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyBUaGlzIGlzIGEgcGxhY2Vob2xkZXIgZm9yIGEgcG9ydCBvZiB0aGUgdHJhbnNpdGlvbnMgbGlicmFyeS4KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChhbmd1bGFyLmlzRGVmaW5lZChzY29wZS50dF9hbmltYXRpb24pICYmIHNjb3BlLnR0X2FuaW1hdGlvbigpKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdHJhbnNpdGlvblRpbWVvdXQgPSAkdGltZW91dChmdW5jdGlvbigpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdG9vbHRpcC5yZW1vdmUoKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9LCA1MDApOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0b29sdGlwLnJlbW92ZSgpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CisKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLyoqCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqIE9ic2VydmUgdGhlIHJlbGV2YW50IGF0dHJpYnV0ZXMuCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBhdHRycy4kb2JzZXJ2ZSh0eXBlLCBmdW5jdGlvbih2YWwpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICh2YWwpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzY29wZS50dF9jb250ZW50ID0gdmFsOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGVsZW1lbnQuYXR0cigndGl0bGUnLHZhbCk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChzY29wZS50dF9pc09wZW4pIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaGlkZSgpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSk7CisKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYXR0cnMuJG9ic2VydmUocHJlZml4ICsgJ1RpdGxlJywgZnVuY3Rpb24odmFsKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzY29wZS50dF90aXRsZSA9IHZhbDsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSk7CisKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYXR0cnMuJG9ic2VydmUocHJlZml4ICsgJ1BsYWNlbWVudCcsIGZ1bmN0aW9uKHZhbCkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2NvcGUudHRfcGxhY2VtZW50ID0gYW5ndWxhci5pc0RlZmluZWQodmFsKSA/IHZhbCA6IG9wdGlvbnMucGxhY2VtZW50OworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9KTsKKworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBhdHRycy4kb2JzZXJ2ZShwcmVmaXggKyAnU3R5bGUnLCBmdW5jdGlvbih2YWwpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNjb3BlLnR0X3N0eWxlID0gYW5ndWxhci5pc0RlZmluZWQodmFsKSA/IHZhbCA6IG9wdGlvbnMuc3R5bGV0dDsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSk7CisKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYXR0cnMuJG9ic2VydmUocHJlZml4ICsgJ0FuaW1hdGlvbicsIGZ1bmN0aW9uKHZhbCkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2NvcGUudHRfYW5pbWF0aW9uID0gYW5ndWxhci5pc0RlZmluZWQodmFsKSA/ICRwYXJzZSh2YWwpIDogZnVuY3Rpb24oKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIG9wdGlvbnMuYW5pbWF0aW9uOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSk7CisKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYXR0cnMuJG9ic2VydmUocHJlZml4ICsgJ1BvcHVwRGVsYXknLCBmdW5jdGlvbih2YWwpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhciBkZWxheSA9IHBhcnNlSW50KHZhbCwgMTApOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2NvcGUudHRfcG9wdXBEZWxheSA9ICFpc05hTihkZWxheSkgPyBkZWxheSA6IG9wdGlvbnMucG9wdXBEZWxheTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSk7CisKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYXR0cnMuJG9ic2VydmUocHJlZml4ICsgJ1RyaWdnZXInLCBmdW5jdGlvbih2YWwpIHsKKworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGhhc1JlZ2lzdGVyZWRUcmlnZ2VycykgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGVsZW1lbnQudW5iaW5kKHRyaWdnZXJzLnNob3csIHNob3dUb29sdGlwQmluZCk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZWxlbWVudC51bmJpbmQodHJpZ2dlcnMuaGlkZSwgaGlkZVRvb2x0aXBCaW5kKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KKworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdHJpZ2dlcnMgPSBnZXRUcmlnZ2Vycyh2YWwpOworCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAodHJpZ2dlcnMuc2hvdyA9PT0gdHJpZ2dlcnMuaGlkZSkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGVsZW1lbnQuYmluZCh0cmlnZ2Vycy5zaG93LCB0b2dnbGVUb29sdGlwQmluZCk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGVsZW1lbnQuYmluZCh0cmlnZ2Vycy5zaG93LCBzaG93VG9vbHRpcEJpbmQpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGVsZW1lbnQuYmluZCh0cmlnZ2Vycy5oaWRlLCBoaWRlVG9vbHRpcEJpbmQpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQorCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBoYXNSZWdpc3RlcmVkVHJpZ2dlcnMgPSB0cnVlOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9KTsKKworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBhdHRycy4kb2JzZXJ2ZShwcmVmaXggKyAnQXBwZW5kVG9Cb2R5JywgZnVuY3Rpb24odmFsKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBhcHBlbmRUb0JvZHkgPSBhbmd1bGFyLmlzRGVmaW5lZCh2YWwpID8gJHBhcnNlKHZhbCkoc2NvcGUpIDogYXBwZW5kVG9Cb2R5OworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9KTsKKworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyBpZiBhIHRvb2x0aXAgaXMgYXR0YWNoZWQgdG8gPGJvZHk+IHdlIG5lZWQgdG8gcmVtb3ZlIGl0IG9uCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vIGxvY2F0aW9uIGNoYW5nZSBhcyBpdHMgcGFyZW50IHNjb3BlIHdpbGwgcHJvYmFibHkgbm90IGJlIGRlc3Ryb3llZAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyBieSB0aGUgY2hhbmdlLgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoYXBwZW5kVG9Cb2R5KSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzY29wZS4kb24oJyRsb2NhdGlvbkNoYW5nZVN1Y2Nlc3MnLCBmdW5jdGlvbigpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoc2NvcGUudHRfaXNPcGVuKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGhpZGUoKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9KTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQorCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vIE1ha2Ugc3VyZSB0b29sdGlwIGlzIGRlc3Ryb3llZCBhbmQgcmVtb3ZlZC4KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2NvcGUuJG9uKCckZGVzdHJveScsIGZ1bmN0aW9uKCkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHNjb3BlLnR0X2lzT3BlbikgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGhpZGUoKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdG9vbHRpcC5yZW1vdmUoKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgfTsKKyAgICAgICAgICAgICAgICAgICAgfTsKKyAgICAgICAgICAgICAgICB9XTsKKyAgICAgICAgfV0pCisKKyAgICAgICAgLmRpcmVjdGl2ZSgndG9vbHRpcFBvcHVwJywgWyckZG9jdW1lbnQnLCAnJGRvY3VtZW50QmluZCcsIGZ1bmN0aW9uKCRkb2N1bWVudCwgJGRvY3VtZW50QmluZCkgeworICAgICAgICAgICAgcmV0dXJuIHsKKyAgICAgICAgICAgICAgICByZXN0cmljdDogJ0VBJywKKyAgICAgICAgICAgICAgICByZXBsYWNlOiB0cnVlLAorICAgICAgICAgICAgICAgIHRyYW5zY2x1ZGU6IHRydWUsCisgICAgICAgICAgICAgICAgc2NvcGU6IHtjb250ZW50OiAnQCcsIHBsYWNlbWVudDogJ0AnLCBhbmltYXRpb246ICcmJywgaXNPcGVuOiAnPScsIHN0eWxldHQ6ICdAJ30sCisgICAgICAgICAgICAgICAgdGVtcGxhdGVVcmw6ICdhcHAvc2NyaXB0cy9uZ19qc19hdHRfdHBscy90b29sdGlwL3Rvb2x0aXAtcG9wdXAuaHRtbCcsCisgICAgICAgICAgICAgICAgbGluazogZnVuY3Rpb24oc2NvcGUsIGVsZW0pIHsKKyAgICAgICAgICAgICAgICAgICAgdmFyIGZsYWcgPSBmYWxzZTsKKyAgICAgICAgICAgICAgICAgICAgc2NvcGUuJHdhdGNoKCJpc09wZW4iLCBmdW5jdGlvbigpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIGZsYWcgPSBzY29wZS5pc09wZW47CisgICAgICAgICAgICAgICAgICAgIH0pOworICAgICAgICAgICAgICAgICAgICBlbGVtLmJpbmQoJ2NsaWNrJywgZnVuY3Rpb24gKGUpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIGUuc3RvcFByb3BhZ2F0aW9uKCk7CisgICAgICAgICAgICAgICAgICAgIH0pOworICAgICAgICAgICAgICAgICAgICB2YXIgb3V0c2lkZUNsaWNrID0gZnVuY3Rpb24oKSB7CisgICAgICAgICAgICAgICAgICAgICAgICBpZiAoIWZsYWcpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBzY29wZS4kYXBwbHkoZnVuY3Rpb24oKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNjb3BlLmlzT3BlbiA9IGZhbHNlOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0pOworICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgZmxhZyA9IGZhbHNlOworICAgICAgICAgICAgICAgICAgICB9OworCisgICAgICAgICAgICAgICAgICAgICRkb2N1bWVudEJpbmQuY2xpY2soJ2lzT3BlbicsIG91dHNpZGVDbGljaywgc2NvcGUpOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH07CisgICAgICAgIH1dKQorCisgICAgICAgIC5kaXJlY3RpdmUoJ3Rvb2x0aXAnLCBbJyR0b29sdGlwJywgZnVuY3Rpb24oJHRvb2x0aXApIHsKKyAgICAgICAgICAgIHJldHVybiAkdG9vbHRpcCgndG9vbHRpcCcsICd0b29sdGlwJywgJ21vdXNlZW50ZXInKTsKKyAgICAgICAgfV0pCisKKyAgICAgICAgLmRpcmVjdGl2ZSgndG9vbHRpcENvbmRpdGlvbicsIFsgJyR0aW1lb3V0JyxmdW5jdGlvbigkdGltZW91dCkgeworICAgICAgICAgICAgICAgIHJldHVybiAgeworICAgICAgICAgICAgICAgICAgICByZXN0cmljdDogJ0VBJywKKyAgICAgICAgICAgICAgICAgICAgcmVwbGFjZTogdHJ1ZSwKKyAgICAgICAgICAgICAgICAgICAgc2NvcGU6eworICAgICAgICAgICAgICAgICAgICAgICAgdG9vbHRpcENvbmRpdGlvbjoiQD8iCisgICAgICAgICAgICAgICAgICAgIH0sCisgICAgICAgICAgICAgICAgICAgIHRlbXBsYXRlOic8cD48c3BhbiB0b29sdGlwPVwie3t0b29sdGlwQ29uZGl0aW9ufX1cIiBuZy1pZj1cInNob3dwb3BcIj57e3Rvb2x0aXBDb25kaXRpb259fTwvc3Bhbj48c3BhbiBpZD1cImlubmVyRWxlbWVudFwiIG5nLWhpZGU9XCJzaG93cG9wXCI+e3t0b29sdGlwQ29uZGl0aW9ufX08L3NwYW4+PC9wPicsCisgICAgICAgICAgICAgICAgICAgIGxpbms6IGZ1bmN0aW9uKHNjb3BlLCBlbGVtLCBhdHRyKXsKKyAgICAgICAgICAgICAgICAgICAgICAgIHNjb3BlLnNob3dwb3A9ZmFsc2U7CisgICAgICAgICAgICAgICAgICAgICAgICBpZihhdHRyLmhlaWdodD09PSd0cnVlJyl7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgJHRpbWVvdXQoZnVuY3Rpb24gKCkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YXIgbWF4SGVpZ2h0PShlbGVtWzBdLm9mZnNldEhlaWdodCk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFyIGVsZW1IZWlnaHQ9ZWxlbS5jaGlsZHJlbigwKVswXS5vZmZzZXRIZWlnaHQ7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYoZWxlbUhlaWdodCA+IG1heEhlaWdodCl7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNjb3BlLnNob3dwb3A9dHJ1ZTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSwxMDAwKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgIGVsc2UgaWYoc2NvcGUudG9vbHRpcENvbmRpdGlvbi5sZW5ndGg+PTI1KXsKKyAgICAgICAgICAgICAgICAgICAgICAgIHNjb3BlLnNob3dwb3A9dHJ1ZTsKKyAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIH07CisgICAgICAgIH1dKTsKK2FuZ3VsYXIubW9kdWxlKCdhdHQuYWJzLnRyZWV2aWV3JywgW10pCisgICAgICAgIC5kaXJlY3RpdmUoJ3RyZWVWaWV3JywgZnVuY3Rpb24oKSB7CisgICAgICAgICAgICByZXR1cm57CisgICAgICAgICAgICAgICAgcmVzdHJpY3Q6ICdBJywKKyAgICAgICAgICAgICAgICBsaW5rOiBmdW5jdGlvbihzY29wZSwgZWxlbSkgeworICAgICAgICAgICAgICAgICAgICB2YXIgZWwgPSBlbGVtLmNoaWxkcmVuKCd1bCBsaScpOworICAgICAgICAgICAgICAgICAgICB2YXIgbGlzdCA9IFR3ZWVuTWF4LmZyb20oZWwsIC4yLCB7ZGlzcGxheTogJ25vbmUnLCBwYXVzZWQ6IHRydWUsIHJldmVyc2VkOiB0cnVlfSk7CisgICAgICAgICAgICAgICAgICAgIGVsZW0uYXR0cigidGFiaW5kZXgiLCIwIik7CisgICAgICAgICAgICAgICAgICAgIGZ1bmN0aW9uIHRvZ2dsZUJyYW5jaCgpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIGlmIChsaXN0LnJldmVyc2VkKCkpCisgICAgICAgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgbGlzdC5wbGF5KCk7CisgICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2UKKyAgICAgICAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBsaXN0LnJldmVyc2UoKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgfTsKKyAgICAgICAgICAgICAgICAgICAgZnVuY3Rpb24gdG9nZ2xlVHJlZShlKSB7CisgICAgICAgICAgICAgICAgICAgICAgICBlLnN0b3BQcm9wYWdhdGlvbigpOworICAgICAgICAgICAgICAgICAgICAgICAgaWYgKCQoZS50YXJnZXQpLmF0dHIoInRyZWUtdmlldyIpICE9PSB1bmRlZmluZWQpCisgICAgICAgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGVsZW0uaGFzQ2xhc3MoJ21pbnVzJykpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBlbGVtLnJlbW92ZUNsYXNzKCdtaW51cycpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBlbGVtLmFkZENsYXNzKCdtaW51cycpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB0b2dnbGVCcmFuY2goKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICBlbGVtLm9uKCdjbGljaycsIGZ1bmN0aW9uKGUpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIHRvZ2dsZVRyZWUoZSk7CisgICAgICAgICAgICAgICAgICAgIH0pOworICAgICAgICAgICAgICAgICAgICBlbGVtLm9uKCdrZXlwcmVzcycsIGZ1bmN0aW9uIChlKSB7CisgICAgICAgICAgICAgICAgICAgICAgICB2YXIgYWN0aXZlQ29kZSA9IGUua2V5Q29kZSA/IGUua2V5Q29kZSA6IGUuY2hhckNvZGU7CisgICAgICAgICAgICAgICAgICAgICAgICB2YXIga2V5Q29kZSA9IFsxMywzMl07CisgICAgICAgICAgICAgICAgICAgICAgICBpZiAoa2V5Q29kZS5sZW5ndGggPiAwICYmICgoYWN0aXZlQ29kZSAmJiBrZXlDb2RlLmluZGV4T2YoYWN0aXZlQ29kZSkgPiAtMSkpKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgdG9nZ2xlVHJlZShlKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBlLnByZXZlbnREZWZhdWx0KCk7CisgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgIH0pOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH07CisgICAgICAgIH0pOworCithbmd1bGFyLm1vZHVsZSgnYXR0LmFicy50eXBlQWhlYWQnLCBbJ2F0dC5hYnMudGFnQmFkZ2VzJ10pCisKKyAgICAgICAgLmRpcmVjdGl2ZSgnZm9jdXNNZScsWyckdGltZW91dCcsICckcGFyc2UnLCBmdW5jdGlvbigkdGltZW91dCwgJHBhcnNlKSB7CisgICAgICAgICAgICByZXR1cm4geworICAgICAgICAgICAgICAgIGxpbms6IGZ1bmN0aW9uKHNjb3BlLCBlbGVtZW50LCBhdHRycykgeworICAgICAgICAgICAgICAgICAgICB2YXIgbW9kZWwgPSAkcGFyc2UoYXR0cnMuZm9jdXNNZSk7CisgICAgICAgICAgICAgICAgICAgIHNjb3BlLiR3YXRjaChtb2RlbCwgZnVuY3Rpb24odmFsdWUpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIGlmICh2YWx1ZSkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICR0aW1lb3V0KGZ1bmN0aW9uKCkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBlbGVtZW50WzBdLmZvY3VzKCk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNjb3BlLmlucHV0QWN0aXZlPXRydWU7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSk7CisgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgIH0pOworICAgICAgICAgICAgICAgICAgICBlbGVtZW50LmJpbmQoJ2JsdXInLCBmdW5jdGlvbigpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIHNjb3BlLiRhcHBseShtb2RlbC5hc3NpZ24oc2NvcGUsIGZhbHNlKSk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNjb3BlLmlucHV0QWN0aXZlPWZhbHNlOworICAgICAgICAgICAgICAgICAgICB9KTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9OworICAgICAgICB9XSkKKworICAgICAgICAuZGlyZWN0aXZlKCd0eXBlQWhlYWQnLCBbJyR0aW1lb3V0JywgZnVuY3Rpb24oJHRpbWVvdXQpIHsKKyAgICAgICAgICAgICAgICByZXR1cm4geworICAgICAgICAgICAgICAgICAgICByZXN0cmljdDogJ0VBJywKKyAgICAgICAgICAgICAgICAgICAgdGVtcGxhdGVVcmw6ICdhcHAvc2NyaXB0cy9uZ19qc19hdHRfdHBscy90eXBlQWhlYWQvdHlwZUFoZWFkLmh0bWwnLAorICAgICAgICAgICAgICAgICAgICByZXBsYWNlOiB0cnVlLAorICAgICAgICAgICAgICAgICAgICBzY29wZTogeworICAgICAgICAgICAgICAgICAgICAgICAgaXRlbXM6ICc9JywKKyAgICAgICAgICAgICAgICAgICAgICAgIHRpdGxlOiAnQCcsCisgICAgICAgICAgICAgICAgICAgICAgICBzdWJ0aXRsZTogJ0AnLAorICAgICAgICAgICAgICAgICAgICAgICAgbW9kZWw6ICc9JywKKyAgICAgICAgICAgICAgICAgICAgICAgIGVtYWlsSWRMaXN0Oic9JywKKyAgICAgICAgICAgICAgICAgICAgICAgIGVtYWlsTWVzc2FnZTonPScKKyAgICAgICAgICAgICAgICAgICAgfSwKKyAgICAgICAgICAgICAgICAgICAgbGluazogZnVuY3Rpb24oc2NvcGUsIGVsZW0pIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIHNjb3BlLmxpbmVJdGVtcyA9IFtdOworICAgICAgICAgICAgICAgICAgICAgICAgc2NvcGUuZmlsdGVyZWRMaXN0TGVuZ3RoID0gLTE7CisgICAgICAgICAgICAgICAgICAgICAgICBzY29wZS5maWx0ZXJlZExpc3QgPSBbXTsKKyAgICAgICAgICAgICAgICAgICAgICAgIHNjb3BlLmlucHV0Zm9jdXMgPSBmYWxzZTsKKworICAgICAgICAgICAgICAgICAgICAgICAgc2NvcGUuc2V0Rm9jdXMgPSBmdW5jdGlvbigpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBzY29wZS5jbGlja0ZvY3VzID0gdHJ1ZTsKKyAgICAgICAgICAgICAgICAgICAgICAgIH07CisgICAgICAgICAgICAgICAgICAgICAgICBzY29wZS5oYW5kbGVTZWxlY3Rpb24gPSBmdW5jdGlvbihzZWxlY3RlZEl0ZW0sZW1haWxJdGVtKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2NvcGUubGluZUl0ZW1zLnB1c2goc2VsZWN0ZWRJdGVtKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBzY29wZS5lbWFpbElkTGlzdC5wdXNoKGVtYWlsSXRlbSk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2NvcGUubW9kZWwgPSAiIjsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBzY29wZS5jdXJyZW50ID0gMDsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBzY29wZS5zZWxlY3RlZCA9IHRydWU7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2NvcGUuY2xpY2tGb2N1cyA9IHRydWU7CisgICAgICAgICAgICAgICAgICAgICAgICB9OworICAgICAgICAgICAgICAgICAgICAgICAgc2NvcGUudGhlTWV0aG9kVG9CZUNhbGxlZCA9IGZ1bmN0aW9uKGluZGV4KSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFyIHRlbXBBcnIgPSBzY29wZS5saW5lSXRlbXMuc2xpY2UoKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBzY29wZS5lbWFpbElkTGlzdC5zcGxpY2UoaW5kZXgsIDEpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRlbXBBcnIuc3BsaWNlKGluZGV4LCAxKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAkdGltZW91dChmdW5jdGlvbigpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2NvcGUubGluZUl0ZW1zID0gW107CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNjb3BlLiRhcHBseSgpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzY29wZS5saW5lSXRlbXMgPSBzY29wZS5saW5lSXRlbXMuY29uY2F0KHRlbXBBcnIpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0pOworICAgICAgICAgICAgICAgICAgICAgICAgfTsKKworICAgICAgICAgICAgICAgICAgICAgICAgc2NvcGUuY3VycmVudCA9IDA7CisgICAgICAgICAgICAgICAgICAgICAgICBzY29wZS5zZWxlY3RlZCA9IHRydWU7CisKKyAgICAgICAgICAgICAgICAgICAgICAgIHNjb3BlLmlzQ3VycmVudCA9IGZ1bmN0aW9uKGluZGV4LCBpdGVtTmFtZSxpdGVtRW1haWwsZHJvcGRvd25MZW5ndGgpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoc2NvcGUuY3VycmVudCA9PT0gaW5kZXgpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2NvcGUuaXRlbU5hbWUgPSBpdGVtTmFtZTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2NvcGUuaXRlbUVtYWlsID0gaXRlbUVtYWlsOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBzY29wZS5kcm9wZG93bkxlbmd0aD1kcm9wZG93bkxlbmd0aDsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gc2NvcGUuY3VycmVudCA9PT0gaW5kZXg7CisgICAgICAgICAgICAgICAgICAgICAgICB9OworCisgICAgICAgICAgICAgICAgICAgICAgICBzY29wZS5zZXRDdXJyZW50ID0gZnVuY3Rpb24oaW5kZXgpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBzY29wZS5jdXJyZW50ID0gaW5kZXg7CisgICAgICAgICAgICAgICAgICAgICAgICB9OworCisgICAgICAgICAgICAgICAgICAgICAgICBzY29wZS5zZWxlY3Rpb25JbmRleCA9IGZ1bmN0aW9uKGV2dCkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChldnQua2V5Q29kZSA9PT0gMzggJiYgc2NvcGUuY3VycmVudCA+IDApIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBldnQucHJldmVudERlZmF1bHQoKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2NvcGUuY3VycmVudCA9IHNjb3BlLmN1cnJlbnQgLSAxOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzY29wZS5pc0N1cnJlbnQoc2NvcGUuY3VycmVudCk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIGlmIChldnQua2V5Q29kZSA9PT0gOSkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzY29wZS5zZWxlY3RlZCA9IHRydWU7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIGlmIChldnQua2V5Q29kZSA9PT0gMTMgJiYgc2NvcGUuZHJvcGRvd25MZW5ndGghPT1zY29wZS5pdGVtcy5sZW5ndGgpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2NvcGUuaGFuZGxlU2VsZWN0aW9uKHNjb3BlLml0ZW1OYW1lLHNjb3BlLml0ZW1FbWFpbCk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIGlmICgoZXZ0LmtleUNvZGUgPT09IDggJiYgc2NvcGUubW9kZWwubGVuZ3RoID09PSAwKSB8fCBldnQua2V5Q29kZSA9PT0gNDYpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2NvcGUudGhlTWV0aG9kVG9CZUNhbGxlZChzY29wZS5saW5lSXRlbXMubGVuZ3RoIC0gMSk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIGlmIChldnQua2V5Q29kZSA9PT0gNDAgJiYgc2NvcGUuY3VycmVudCA8IHNjb3BlLmRyb3Bkb3duTGVuZ3RoLTEpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZXZ0LnByZXZlbnREZWZhdWx0KCk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNjb3BlLmN1cnJlbnQgPSBzY29wZS5jdXJyZW50ICsgMTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2NvcGUuaXNDdXJyZW50KHNjb3BlLmN1cnJlbnQpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBlbGVtWzBdLnF1ZXJ5U2VsZWN0b3IoJy5saXN0LXNjcm9sbGFibGUnKS5zY3JvbGxUb3AgPSAoc2NvcGUuY3VycmVudCAtIDEpICogMzU7CisgICAgICAgICAgICAgICAgICAgICAgICB9OworICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgfTsKKyAgICAgICAgICAgIH1dKTsKK2FuZ3VsYXIubW9kdWxlKCdhdHQuYWJzLnVzZXJNZXNzYWdlcycsIFtdKQorICAgIC5jb25zdGFudCgnbWVzc2FnZUNvbnN0YW50cycsIHsKKyAgICAgICAgICAgIFRBQkxFX01FU1NBR0VfVFlQRVM6IHsKKyAgICAgICAgICAgICAgICBub01hdGNoaW5nOiAxLAorICAgICAgICAgICAgICAgIGVycm9yTG9hZGluZzogMiwKKyAgICAgICAgICAgICAgICBtYWduaWZ5U2VhcmNoOiAzLAorICAgICAgICAgICAgICAgIGlzTG9hZGluZzogNH0sCisgICAgICAgIFVTRVJfTUVTU0FHRV9UWVBFUzogeworICAgICAgICAgICAgc3VjY2VzczogMSwKKyAgICAgICAgICAgIGVycm9yOiAwCisgICAgICAgICAgICB9CisgICAgICAgIH0pCisgICAgICAgIC5kaXJlY3RpdmUoJ2F0dFRhYmxlTWVzc2FnZScsIFsnbWVzc2FnZUNvbnN0YW50cycsIGZ1bmN0aW9uKG1lc3NhZ2VDb25zdGFudHMpIHsKKyAgICAgICAgICAgICAgICByZXR1cm4geworICAgICAgICAgICAgICAgICAgICByZXN0cmljdDogJ0FFJywKKyAgICAgICAgICAgICAgICAgICAgcmVwbGFjZTogdHJ1ZSwKKyAgICAgICAgICAgICAgICAgICAgdHJhbnNjbHVkZTogdHJ1ZSwKKyAgICAgICAgICAgICAgICAgICAgc2NvcGU6IHsKKyAgICAgICAgICAgICAgICAgICAgICAgIG1zZ1R5cGU6ICc9JywKKyAgICAgICAgICAgICAgICAgICAgICAgIG9uUmVmcmVzaENsaWNrOiAnJicKKyAgICAgICAgICAgICAgICAgICAgfSwKKyAgICAgICAgICAgICAgICAgICAgdGVtcGxhdGVVcmw6ICdhcHAvc2NyaXB0cy9uZ19qc19hdHRfdHBscy91c2VyTWVzc2FnZXMvYXR0VGFibGVNZXNzYWdlLmh0bWwnLAorICAgICAgICAgICAgICAgICAgICBsaW5rOiBmdW5jdGlvbihzY29wZSkgeworICAgICAgICAgICAgICAgICAgICAgICAgc2NvcGUubWVzc2FnZUNvbnN0YW50cyA9IG1lc3NhZ2VDb25zdGFudHM7CisgICAgICAgICAgICAgICAgICAgICAgICBzY29wZS5yZWZyZXNoQWN0aW9uID0gZnVuY3Rpb24oZXZ0KSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2NvcGUub25SZWZyZXNoQ2xpY2soZXZ0KTsKKyAgICAgICAgICAgICAgICAgICAgICAgIH07CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICB9OworICAgICAgICAgICAgfV0pLmRpcmVjdGl2ZSgnYXR0VXNlck1lc3NhZ2UnLCBbJ21lc3NhZ2VDb25zdGFudHMnLCBmdW5jdGlvbihtZXNzYWdlQ29uc3RhbnRzKSB7CisgICAgICAgIHJldHVybnsKKyAgICAgICAgICAgIHJlc3RyaWN0OiAnQUUnLAorICAgICAgICAgICAgcmVwbGFjZTogdHJ1ZSwKKyAgICAgICAgICAgIHRyYW5zY2x1ZGU6IHRydWUsCisgICAgICAgICAgICBzY29wZTogeworICAgICAgICAgICAgICAgIHRoZXRpdGxlOiAnPScsCisgICAgICAgICAgICAgICAgdHlwZTogJz0nLAorICAgICAgICAgICAgICAgIG1lc3NhZ2U6ICc9JywKKyAgICAgICAgICAgICAgICB0cmlnZ2VyOiAnPScKKyAgICAgICAgICAgIH0sCisgICAgICAgICAgICB0ZW1wbGF0ZVVybDogJ2FwcC9zY3JpcHRzL25nX2pzX2F0dF90cGxzL3VzZXJNZXNzYWdlcy9hdHRVc2VyTWVzc2FnZS5odG1sJywKKyAgICAgICAgICAgIGxpbms6IGZ1bmN0aW9uKHNjb3BlKSB7CisgICAgICAgICAgICAgICAgc2NvcGUubWVzc2FnZUNvbnN0YW50cyA9IG1lc3NhZ2VDb25zdGFudHM7CisgICAgICAgICAgICB9CisgICAgICAgIH07CisgICAgfV0pOworYW5ndWxhci5tb2R1bGUoJ2F0dC5hYnMudmVydGljYWxTdGVwdHJhY2tlcicsIFsnbmdTYW5pdGl6ZSddKQorICAgIC5kaXJlY3RpdmUoJ3ZlcnRpY2FsU3RlcHRyYWNrZXInLCBbIGZ1bmN0aW9uKCl7CisgICAgICAgIHJldHVybiB7CisgICAgICAgICAgICByZXN0cmljdDogJ0VBJywKKyAgICAgICAgICAgIHRyYW5zY2x1ZGU6IHRydWUsCisgICAgICAgICAgICByZXBsYWNlOiBmYWxzZSwKKyAgICAgICAgICAgIHNjb3BlOiB7fSwKKyAgICAgICAgICAgIHRlbXBsYXRlOiAnPGRpdiBjbGFzcz0idmVydGljYWwtbmF2Ij48dWwgbmctdHJhbnNjbHVkZSBjbGFzcz0idGlja2V0cy1saXN0LWhlaWdodCI+PC91bD48L2Rpdj4nLAorICAgICAgICAgICAgbGluazogZnVuY3Rpb24gKCkge30KKyAgICAgICAgfTsKKyAgICB9XSkKKyAgICAuZGlyZWN0aXZlKCd2ZXJ0aWNhbFN0ZXB0cmFja2VyU3RlcCcsWyBmdW5jdGlvbigpeworICAgICAgICByZXR1cm4geworICAgICAgICAgICAgcmVzdHJpY3Q6ICdFQScsCisgICAgICAgICAgICB0cmFuc2NsdWRlOiB0cnVlLAorICAgICAgICAgICAgcmVwbGFjZTogZmFsc2UsCisgICAgICAgICAgICBzY29wZTogeworICAgICAgICAgICAgICAgIHR5cGU6ICI9dHlwZSIsCisgICAgICAgICAgICAgICAgaWQ6ICI9aWQiCisgICAgICAgICAgICB9LAorICAgICAgICAgICAgdGVtcGxhdGVVcmw6ICdhcHAvc2NyaXB0cy9uZ19qc19hdHRfdHBscy92ZXJ0aWNhbFN0ZXB0cmFja2VyL3ZlcnRpY2FsLXN0ZXAtdHJhY2tlci5odG1sJywKKyAgICAgICAgICAgIGxpbms6IGZ1bmN0aW9uKCl7fQorICAgICAgICAgfTsKKyAgICB9XSkKKyAgICAuZGlyZWN0aXZlKCdhdHRBYnNMaW5rJyxbIGZ1bmN0aW9uKCl7CisgICAgICAgIHJldHVybnsKKyAgICAgICAgICAgIHJlc3RyaWN0OiAnRUEnLAorICAgICAgICAgICAgdHJhbnNjbHVkZTogdHJ1ZSwKKyAgICAgICAgICAgIHJlcGxhY2U6IGZhbHNlLAorICAgICAgICAgICAgdGVtcGxhdGU6ICc8c3BhbiBuZy10cmFuc2NsdWRlIGNsYXNzPSJ2aWV3LWxvZyI+PC9zcGFuPicKKyAgICAgICAgfTsKKyAgICB9XSk7Cithbmd1bGFyLm1vZHVsZSgnYXR0LmFicy52aWRlb0NvbnRyb2xzJywgW10pCisgICAgICAgIC5jb25maWcoWyckY29tcGlsZVByb3ZpZGVyJyAsIGZ1bmN0aW9uICgkY29tcGlsZVByb3ZpZGVyKSB7CisgICAgICAgICAgICAgICAgJGNvbXBpbGVQcm92aWRlci5hSHJlZlNhbml0aXphdGlvbldoaXRlbGlzdCgvXlxzKihodHRwcz98amF2YXNjcmlwdCk6Lyk7CisgICAgICAgICAgICB9XSkKKyAgICAgICAgLmRpcmVjdGl2ZSgndmlkZW9Db250cm9scycsIFtmdW5jdGlvbigpIHsKKyAgICAgICAgICAgICAgICByZXR1cm4geworICAgICAgICAgICAgICAgICAgICByZXN0cmljdDogJ0VBJywKKyAgICAgICAgICAgICAgICAgICAgcmVwbGFjZTogdHJ1ZSwKKyAgICAgICAgICAgICAgICAgICAgdHJhbnNjbHVkZTogdHJ1ZSwKKyAgICAgICAgICAgICAgICAgICAgdGVtcGxhdGVVcmw6ICdhcHAvc2NyaXB0cy9uZ19qc19hdHRfdHBscy92aWRlb0NvbnRyb2xzL3ZpZGVvQ29udHJvbHMuaHRtbCcKKyAgICAgICAgICAgICAgICB9OworICAgICAgICAgICAgfV0pCisgICAgICAgIC5kaXJlY3RpdmUoJ3Bob3RvQ29udHJvbHMnLCBbZnVuY3Rpb24oKSB7CisgICAgICAgICAgICAgICAgcmV0dXJuIHsKKyAgICAgICAgICAgICAgICAgICAgcmVzdHJpY3Q6ICdFQScsCisgICAgICAgICAgICAgICAgICAgIHJlcGxhY2U6IHRydWUsCisgICAgICAgICAgICAgICAgICAgIHRyYW5zY2x1ZGU6IHRydWUsCisgICAgICAgICAgICAgICAgICAgIHRlbXBsYXRlVXJsOiAnYXBwL3NjcmlwdHMvbmdfanNfYXR0X3RwbHMvdmlkZW9Db250cm9scy9waG90b0NvbnRyb2xzLmh0bWwnLAorICAgICAgICAgICAgICAgICAgICBzY29wZTogeworICAgICAgICAgICAgICAgICAgICAgICAgcHJldkxpbms6ICJAIiwKKyAgICAgICAgICAgICAgICAgICAgICAgIG5leHRMaW5rOiAiQCIKKyAgICAgICAgICAgICAgICAgICAgfSwKKyAgICAgICAgICAgICAgICAgICAgbGluazogZnVuY3Rpb24oc2NvcGUsIGVsZW0sIGF0dHIpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIGlmKCFhdHRyWydwcmV2TGluayddKXsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBzY29wZS5wcmV2TGluayA9ICdqYXZhc2NyaXB0OnZvaWQoMCknOworICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgaWYoIWF0dHJbJ25leHRMaW5rJ10peworICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNjb3BlLm5leHRMaW5rID0gJ2phdmFzY3JpcHQ6dm9pZCgwKSc7CisgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICBzY29wZS5saW5rcyA9IHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBwcmV2TGluayA6IHNjb3BlLnByZXZMaW5rLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIG5leHRMaW5rIDogc2NvcGUubmV4dExpbmsKKyAg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0ICYmIG1vdmUoMSlcIj5cbiIgKworICAgICIgICAgICAgICAgICAgICAgICAgICAgICA8ZGl2IGNsYXNzPVwiaWNvbnMtbGlzdFwiIGRhdGEtc2l6ZT1cIm1lZGl1bVwiPjxpIGNsYXNzPVwiaWNvbi1hcnJvdy1yaWdodC1jaXJjbGVcIiBuZy1jbGFzcz1cInsnZGlzYWJsZWQnOiBkaXNhYmxlTmV4dH1cIj48L2k+XG4iICsKKyAgICAiICAgICAgICAgICAgICAgICAgICAgICAgPC9kaXY+PHNwYW4gY2xhc3M9XCJoaWRkZW4tc3Bva2VuXCI+TmV4dCBNb250aDwvc3Bhbj5cbiIgKworICAgICIgICAgICAgICAgICAgICAgICAgIDwvdGg+XG4iICsKKyAgICAiICAgICAgICAgICAgICAgIDwvdHI+XG4iICsKKyAgICAiICAgICAgICAgICAgICAgIDx0ciBuZy1pZj1cImxhYmVscy5sZW5ndGggPiAwXCI+XG4iICsKKyAgICAiICAgICAgICAgICAgICAgICAgICA8dGggaWQ9XCJ7e2xhYmVsLnBvc3R9fVwiIHRhYmluZGV4PVwiLTFcIiBjbGFzcz1cImRvdyB3ZWVrZGF5XCIgbmctcmVwZWF0PVwibGFiZWwgaW4gbGFiZWxzXCI+PHNwYW4+e3tsYWJlbC5wcmV9fTwvc3Bhbj48c3BhbiBjbGFzcz1cImhpZGRlbi1zcG9rZW5cIj57e2xhYmVsLnBvc3R9fTwvc3Bhbj48L3RoPlxuIiArCisgICAgIiAgICAgICAgICAgICAgICA8L3RyPlxuIiArCisgICAgIiAgICAgICAgICAgIDwvdGhlYWQ+XG4iICsKKyAgICAiICAgICAgICAgICAgPHRib2R5PlxuIiArCisgICAgIiAgICAgICAgICAgICAgICA8dHI+XG4iICsKKyAgICAiICAgICAgICAgICAgICAgICAgICA8dGQgaWQ9XCJkYXRlcGlja2VyQm9keVwiIGF0dC1zY3JvbGxiYXIgY29sc3Bhbj1cInt7Y3VycmVudFJvd3NbMF0ubGVuZ3RofX1cIiBzdHl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W9ufX08L3NwYW4+PC9kaXY+PC9saT4gICAgICAgICAgICAgICAgICAgICAgICBcbiIgKworICAgICIgICAgICAgIDwvdWw+XG4iICsKKyAgICAiICAgICAgICA8L2Rpdj5cbiIgKworICAgICIgICAgPC9kaXY+XG4iICsKKyAgICAiICAgIDxkaXYgbmctc2hvdz1cInNob3dEYXlzU2VsZWN0b3JcIiBjbGFzcz1cImN1c3RvbWRheXMtd2lkdGhcIj5cbiIgKworICAgICIgICAgICAgIDxkaXYgYXR0LWRpdmlkZXItbGluZXMgY2xhc3M9XCJkaXZpZGVyLW1hcmdpbi1mXCI+PC9kaXY+ICBcbiIgKworICAgICIgICAgICAgIDxkaXYgY2xhc3M9XCJjb2wtbWQtMyBmcm9tdG8tbWFyZ2luXCI+XG4iICsKKyAgICAiICAgICAgICAgICAgPGRpdj5Gcm9tPC9kaXY+IDxicj5cbiIgKworICAgICIgICAgICAgICAgICA8ZGl2PlRvPC9kaXY+XG4iICsKKyAgICAiICAgICAgICA8L2Rpdj5cbiIgKworICAgICIgICAgICAgIDxkaXYgbmctcmVwZWF0PVwiZGF5IGluIGRheXNcIj5cbiIgKworICAgICIgICAgICAgICAgICA8ZGl2IGNsYXNzPVwiY29sLW1kLTMgY29sLW1kLWRheXNcIj5cbiIgKworICAgICIgICAgICAgICAgICAgICAgPGRpdiAgY2xhc3M9XCJjb2wtbWQtMSBkYXlzc2VsZWN0LW1hcmdpblwiPlxuIiArCisgICAgIiAgICAgICAgICAgICAgICAgICAgPGlucHV0IHR5cGU9XCJjaGVja2JveFwiIG5nLW1vZGVsPVwiZGF5c0xpc3RbZGF5XVwiIHRpdGxlPVwiRGF5IHNlbGVjdGlvblwiIGF0dC1jaGVja2JveCBuZy1jaGFuZ2U9XCJhZGRTZWxlY3RlZFZhbHVlKGRheSlcIj4gICAgXG4iICsKKyAgICAiICAgICAgICAgICAgICAgIDwvZGl2PlxuIiArCisgICAgIiAgICAgICAgICAgICAgICA8c3Bhbj57e2RheX19PC9zcGF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xpIG5nLWlmPVwiZGF5c0xpc3RbZGF5XVwiIG5nLWNsYXNzPVwiRnJ0aW1lTGlzdERheVtkYXldID8gJ2ljb24tZHJvcGRvd24tdXAnIDogJ2ljb24tZHJvcGRvd24tZG93bidcIj48L2k+PC9zcGFuPlxuIiArCisgICAgIiAgICAgICAgICAgICAgICAgICAgICAgIDwvYT5cbiIgKworICAgICIgICAgICAgICAgICAgICAgICAgIDwvZGl2PiAgICAgICAgICAgICBcbiIgKworICAgICIgICAgICAgICAgICAgICAgICAgIFxuIiArCisgICAgIiAgICAgICAgICAgICAgICAgICAgPGRpdiBjbGFzcz1cInNlbGVjdDItZGlzcGxheS1ub25lIHNlbGVjdDItd2l0aC1zZWFyY2hib3ggc2VsZWN0Mi1kcm9wLWFjdGl2ZSBzaG93LXNlYXJjaCByZXN1bHRGcm9tRHJvcERvd25cIiAgbmctc2hvdz1cIkZydGltZUxpc3REYXlbZGF5XVwiPiAgICAgICBcbiIgKworICAgICIgICAgICAgICAgICAgICAgICAgIDx1bCBjbGFzcz1cInNlbGVjdDItcmVzdWx0cyByZXN1bHRUb3BNYXJnaW5cIiA+ICAgICAgICAgICAgICAgICAgICAgICBcbiIgKworICAgICIgICAgICAgICAgICAgICAgICAgICAgICA8bGkgbmctY2xpY2s9XCJzZWxlY3RGcm9tRGF5T3B0aW9uKGRheSx0aW1lLnZhbHVlKTthZGRTZWxlY3RlZFZhbHVlKGRheSk7XCIgbmctcmVwZWF0PVwidGltZSBpbiBmcm9tdGltZVwiICBjbGFzcz1cInNlbGVjdDItcmVzdWx0cy1kZXB0LTAgc2VsZWN0Mi1yZXN1bHQgc2VsZWN0Mi1yZXN1bHQtc2VsZWN0YWJsZVwiPjxkaXYgY2xhc3M9XCJzZWxlY3QyLXJlc3VsdC1sYWJlbFwiIG5nLWNsYXNzPVwieydzZWxlY3RlZEl0ZW1JbkRyb3BEb3duJzogKHRpbWUudmFsdWU9PXNlbGVjdGVkRnJvbU9wdGlvbltkYXldKX1cIj48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F5XSAmJiBhZGRTZWxlY3RlZFZhbHVlKGRheSk7XCI+XG4iICsKKyAgICAiICAgICAgICAgICAgICAgICAgICAgICAgICAgIDxzcGFuIGNsYXNzPVwic2VsZWN0Mi1jaG9zZW4gZHJvcERvd25NYXJnaW5SaWdodFwiPnt7c2VsZWN0ZWRUb09wdGlvbltkYXldfX0gPGkgbmctaWY9XCJkYXlzTGlzdFtkYXldXCIgbmctY2xhc3M9XCJUb3RpbWVMaXN0RGF5W2RheV0gPyAnaWNvbi1kcm9wZG93bi11cCcgOiAnaWNvbi1kcm9wZG93bi1kb3duJ1wiID48L2k+PC9zcGFuPlxuIiArCisgICAgIiAgICAgICAgICAgICAgICAgICAgICAgIDwvYT5cbiIgKworICAgICIgICAgICAgICAgICAgICAgICAgIDwvZGl2PlxuIiArCisgICAgIiAgICAgICAgICAgICAgICAgICAgXG4iICsKKyAgICAiICAgICAgICAgICAgICAgICAgICA8ZGl2IGNsYXNzPVwic2VsZWN0Mi1kaXNwbGF5LW5vbmUgc2VsZWN0Mi13aXRoLXNlYXJjaGJveCBzZWxlY3QyLWRyb3AtYWN0aXZlIHNob3ctc2VhcmNoIHJlc3VsdFRvRHJvcERvd25cIiBuZy1zaG93PVwiVG90aW1lTGlzdERheVtkYXldXCI+ICAgICAgIFxuIiArCisgICAgIiAgICAgICAgICAgICAgICAgICAgPHVsIGNsYXNzPVwic2VsZWN0Mi1yZXN1bHRzIHJlc3VsdFRvcE1hcmdpblwiID4gICAgICAgICAgICAgICAgICAgICAgIFxuIiArCisgICAgIiAgICAgICAgICAgICAgICAgICAgICAgIDxsaSBuZy1jbGljaz1cInNlbGVjdFRvRGF5T3B0aW9uKGRheSx0aW1lLnZhbHVlKTthZGRTZWxlY3RlZFZhbHVlKGRheSk7XCIgbmctcmVwZWF0PVwidGltZSBpbiB0b3RpbWVcIiAgY2xhc3M9XCJzZWxlY3QyLXJlc3VsdHMtZGVwdC0wIHNlbGVjdDItcmVzdWx0IHNlbGVjdDItcmVzd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PHAgY2xhc3M9XCJzdGF0dXNcIj5cbiIgKworICAgICIgICAgICAgICAgICAgICAgPHNwYW4gY2xhc3M9XCJzdGF0dXMtaWNvblwiIG5nLWNsYXNzPVwieydpY29uLWdyZWVuJzpjb2xvckljb249PT0nZ3JlZW4nLCdpY29uLXJlZCc6Y29sb3JJY29uPT09J3JlZCcsJ2ljb24tYmx1ZSc6Y29sb3JJY29uPT09J2JsdWUnLCdpY29uLXllbGxvdyc6Y29sb3JJY29uPT09J3llbGxvdyd9XCI+ICAgXG4iICsKKyAgICAiICAgICAgICAgICAgICAgIDwvc3Bhbj5cbiIgKworICAgICIgICAgICAgICAgICAgICAgPHNwYW4+e3twcm9maWxlLnN0YXRlfX08c3BhbiBuZy1pZj1cImJhZGdlXCIgY2xhc3M9XCJzdGF0dXMtYmFkZ2VcIj5BZG1pbjwvc3Bhbj48L3NwYW4+XG4iICsKKyAgICAiICAgICAgICAgICAgPC9wPlxuIiArCisgICAgIiAgICAgICAgPC9kaXY+XG4iICsKKyAgICAiICAgIDwvZGl2PlxuIiArCisgICAgIiAgICA8ZGl2IGNsYXNzPVwiYm90dG9tLWJsb2NrXCI+XG4iICsKKyAgICAiICAgICAgICAgPGRpdiBjbGFzcz1cInByb2ZpbGUtZGV0YWlsc1wiPlxuIiArCisgICAgIiAgICAgICAgICAgIDxsYWJlbD5Vc2VybmFtZTwvbGFiZWw+XG4iICsKKyAgICAiICAgICAgICAgICAgPHAgYXR0LXRleHQtb3ZlcmZsb3c9XCI5MiVcIiB0b29sdGlwLWNvbmRpdGlvbj1cInt7cHJvZmlsZS51c2VyTmFtZX19XCI+e3twcm9maWxlLnVzZXJOYW1lfX08L3A+XG4iICsKKyAgICAiICAgICAgICAgICAgPGxhYmVsPkVtYWlsPC9sYWJlbD5cbiIgKworICAgICIgICAgICAgICAgICA8cCBhdHQtdGV4dC1vdmVyZmxvdz1cIjkyJVwiIHRvb2x0aXAtY29uZGl0aW9uPVwie3twcm9maWxlLmVtYWlsfX1c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MFwiIGNsYXNzPVwic2VsZWN0Mi1uby1yZXN1bHRzXCI+Tm8gbWF0Y2hlcyBmb3VuZDwvbGk+XG4iICsKKyAgICAiCQk8bGkgY2xhc3M9XCJzZWxlY3QyLXJlc3VsdHMtZGVwdC0wIHNlbGVjdDItcmVzdWx0IHNlbGVjdDItcmVzdWx0LXNlbGVjdGFibGVcIiByb2xlPVwicHJlc2VudGF0aW9uXCJcbiIgKworICAgICIgICAgICAgICAgICAgICAgICAgIG5nLW1vZGVsPVwiTGlzdFR5cGVcIiBuZy1zaG93PVwic2VsZWN0TXNnICYmIGZpbHRlcmVkTmFtZS5sZW5ndGggPiAwXCJcbiIgKworICAgICIgICAgICAgICAgICAgICAgICAgIG5nLWNsaWNrPVwic2VsZWN0T3B0aW9uKHNlbGVjdE1zZywgJy0xJylcIlxuIiArCisgICAgIiAgICAgICAgICAgICAgICAgICAgbmctY2xhc3M9XCJ7J3NlbGVjdDItcmVzdWx0LWN1cnJlbnQnOiBzZWxlY3RlZE9wdGlvbiA9PT0gc2VsZWN0TXNnLCAnaG92c3R5bGUnOiBzZWxlY3RlZEluZGV4ID09PSAtMX1cIlxuIiArCisgICAgIiAgICAgICAgICAgICAgICAgICAgbmctbW91c2VvdmVyPVwiaG92ZXJJbigtMSlcIj5cbiIgKworICAgICIgICAgICAgICAgICAgICAgICAgIDxkaXYgbmctaWY9XCJzdGFydHNXaXRoRmlsdGVyXCIgY2xhc3M9XCJzZWxlY3QyLXJlc3VsdC1sYWJlbFwiICBuZy1iaW5kLWh0bWw9XCJzZWxlY3RNc2cgfCB1bnNhZmVcIiByb2xlPVwib3B0aW9uXCI+XG4iICsKKyAgICAiICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPHNwYW4gY2xhc3M9XCJzZWxlY3QyLW1hdGNoXCIgPjwvc3Bhbj5cbiIgKworICAgICIgICAgICAgICAgICAgICAgICAgIDwvZGl2PlxuIiArCisgICAgIiAgICAgICAgICAgICAgICAgICAgPGRpdi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ZGV4KVwiPlxuIiArCisgICAgIiAgICAgICAgICAgICAgICAgICAgPGRpdiBjbGFzcz1cInNlbGVjdDItcmVzdWx0LWxhYmVsXCIgbmctYmluZC1odG1sPVwiaXRlbS50aXRsZSB8IHVuc2FmZVwiIHJvbGU9XCJvcHRpb25cIj5cbiIgKworICAgICIgICAgICAgICAgICAgICAgICAgICAgICAgICAgPHNwYW4gY2xhc3M9XCJzZWxlY3QyLW1hdGNoXCIgPjwvc3Bhbj5cbiIgKworICAgICIgICAgICAgICAgICAgICAgICAgIDwvZGl2PlxuIiArCisgICAgIiAgICAgICAgCTwvbGk+XG4iICsKKyAgICAiXG4iICsKKyAgICAiICAgICAgICAgICAgICAgIDxsaSBuZy1pZj1cIiFzdGFydHNXaXRoRmlsdGVyXCIgY2xhc3M9XCJzZWxlY3QyLXJlc3VsdHMtZGVwdC0wIHNlbGVjdDItcmVzdWx0IHNlbGVjdDItcmVzdWx0LXNlbGVjdGFibGVcIiByb2xlPVwicHJlc2VudGF0aW9uXCJcbiIgKworICAgICIgICAgICAgICAgICAgICAgICAgIG5nLW1vZGVsPVwiTGlzdFR5cGVcIiBuZy1yZXBlYXQ9XCIoZkluZGV4LCBpdGVtKSBpbiBmaWx0ZXJlZE5hbWUgPSAoY05hbWUgfCBmaWx0ZXI6dGl0bGUpXCJcbiIgKworICAgICIgICAgICAgICAgICAgICAgICAgIG5nLWNsYXNzPVwieydzZWxlY3QyLXJlc3VsdC1jdXJyZW50Jzogc2VsZWN0ZWRPcHRpb24gPT09IGl0ZW0udGl0bGUsJ2hvdnN0eWxlJzogc2VsZWN0ZWRJbmRleCA9PT0gaXRlbS5pbmRleH1cIlxuIiArCisgICAgIiAgICAgICAgICAgICAgICAgICAgbmctY2xpY2s9XCJzZWxlY3RPcHRpb24oaXRlbS50aXRsZSxpdGVtLmluZGV4KVwiXG4iICsKKyAgICAiICAgICAgICAgICAgICAgICAgICBuZy1tb3VzZW92ZXI9XCJob3ZlckluKGl0ZW0uaW5kZX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DItcmVzdWx0IHNlbGVjdDItcmVzdWx0LXNlbGVjdGFibGVcIiByb2xlPVwicHJlc2VudGF0aW9uXCJcbiIgKworICAgICIgICAgICAgICAgICAgICAgICAgIG5nLW1vZGVsPVwiTGlzdFR5cGVcIiBuZy1yZXBlYXQ9XCIoZkluZGV4LCBpdGVtKSBpbiBmaWx0ZXJlZE5hbWUgPSAoY05hbWUgfCBzdGFydHNXaXRoOnRpdGxlOml0ZW0pXCJcbiIgKworICAgICIgICAgICAgICAgICAgICAgICAgIG5nLWNsYXNzPVwieydzZWxlY3QyLXJlc3VsdC1jdXJyZW50Jzogc2VsZWN0ZWRPcHRpb24gPT09IGl0ZW0udGl0bGUsJ2hvdnN0eWxlJzogc2VsZWN0ZWRJbmRleCA9PT0gaXRlbS5pbmRleH1cIlxuIiArCisgICAgIiAgICAgICAgICAgICAgICAgICAgbmctY2xpY2s9XCJzZWxlY3RPcHRpb24oaXRlbS50aXRsZSxpdGVtLmluZGV4KVwiXG4iICsKKyAgICAiICAgICAgICAgICAgICAgICAgICBuZy1tb3VzZW92ZXI9XCJob3ZlckluKGl0ZW0uaW5kZXgpXCI+XG4iICsKKyAgICAiICAgICAgICAgICAgICAgICAgICA8ZGl2IGNsYXNzPVwic2VsZWN0Mi1yZXN1bHQtbGFiZWxcIiBuZy1iaW5kLWh0bWw9XCJpdGVtLnRpdGxlIHwgdW5zYWZlXCIgcm9sZT1cIm9wdGlvblwiPlxuIiArCisgICAgIiAgICAgICAgICAgICAgICAgICAgICAgICAgICA8c3BhbiBjbGFzcz1cInNlbGVjdDItbWF0Y2hcIiA+PC9zcGFuPlxuIiArCisgICAgIiAgICAgICAgICAgICAgICAgICAgPC9kaXY+XG4iICsKKyAgICAiICAgICAgICAJPC9saT5cbiIgKworICAgICJcbiIgKworICAgICIgICAgICAgICAgICAgICAgPGxpIG5nLWlmPVwiIXN0YXJ0c1dpdGhGaWx0ZXJcIiBjbGFzcz1cInNlbGVjdDItcmVzdWx0cy1kZXB0LTAgc2VsZWN0Mi1yZXN1bHQgc2VsZWN0Mi1yZXN1bHQtc2VsZWN0YWJsZVwiIHJvbGU9XCJwcmVzZW50YXRpb25cIlxuIiArCisgICAgIiAgICAgICAgICAgICAgICAgICAgbmctbW9kZWw9XCJMaXN0VHlwZVwiIG5nLXJlcGVhdD1cIihmSW5kZXgsIGl0ZW0pIGluIGZpbHRlcmVkTmFtZSA9IChjTmFtZSB8IGZpbHRlcjp0aXRsZSlcIlxuIiArCisgICAgIiAgICAgICAgICAgICAgICAgICAgbmctY2xhc3M9XCJ7J3NlbGVjdDItcmVzdWx0LWN1cnJlbnQnOiBzZWxlY3RlZE9wdGlvbiA9PT0gaXRlbS50aXRsZSwnaG92c3R5bGUnOiBzZWxlY3RlZEluZGV4ID09PSBpdGVtLmluZGV4fVwiXG4iICsKKyAgICAiICAgICAgICAgICAgICAgICAgICBuZy1jbGljaz1cInNlbGVjdE9wdGlvbihpdGVtLnRpdGxlLGl0ZW0uaW5kZXgpXCJcbiIgKworICAgICIgICAgICAgICAgICAgICAgICAgIG5nLW1vdXNlb3Zlcj1cImhvdmVySW4oaXRlbS5pbmRleClcIlxuIiArCisgICAgIiAgICAgICAgICAgICAgICAgICAgPlxuIiArCisgICAgIiAgICAgICAgICAgICAgICAgICAgPGRpdiBjbGFzcz1cInNlbGVjdDItcmVzdWx0LWxhYmVsXCIgbmctYmluZC1odG1sPVwiaXRlbS50aXRsZSB8IGhpZ2hsaWdodDp0aXRsZTpjbGFzc05hbWUgfCB1bnNhZmVcIiByb2xlPVwib3B0aW9uXCI+XG4iICsKKyAgICAiICAgICAgICAgICAgICAgICAgICAgICAgPHNwYW4gY2xhc3M9XCJzZWxlY3QyLW1hdGNoXCIgPjwvc3Bhbj5cbiIgKworICAgICIgICAgICAgICAgICAgICAgICAgIDwvZGl2PlxuIiArCisgICAgIiAgICAgICAgICAgICAgICA8L2xpPlxuIiArCisgICAgIlxuIiArCisgICAgIgk8L3VsPlxuIiArCisgICAgIjwvZGl2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uKFsiJHRlbXBsYXRlQ2FjaGUiLCBmdW5jdGlvbigkdGVtcGxhdGVDYWNoZSkgeworICAkdGVtcGxhdGVDYWNoZS5wdXQoImFwcC9zY3JpcHRzL25nX2pzX2F0dF90cGxzL3NwbGl0QnV0dG9uRHJvcGRvd24vc3BsaXRCdXR0b25Ecm9wZG93bi5odG1sIiwKKyAgICAiPGRpdiBjbGFzcz1cIiBidG4tZ3JvdXBcIiBcbiIgKworICAgICIgICAgIG5nLWNsYXNzPVwieydidXR0b25zLWRyb3Bkb3duLS1sYXJnZSc6IWlzU21hbGwsIFxuIiArCisgICAgIiAgICAgICAgICAgICAgICAgJ2J1dHRvbnMtZHJvcGRvd24tLXNtYWxsJzppc1NtYWxsLCBcbiIgKworICAgICIgICAgICAgICAgICAgICAgICdhY3Rpb24tZHJvcGRvd24nOmlzQWN0aW9uRHJvcGRvd24sIFxuIiArCisgICAgIiAgICAgICAgICAgICAgICAgJ29wZW4nOmlzRHJvcERvd25PcGVufVwiPlxuIiArCisgICAgIiAgICA8YSB0YWJpbmRleD1cIjBcIiBocmVmPVwiamF2YXNjcmlwdDp2b2lkKDApXCIgY2xhc3M9XCJidXR0b24gYnRuIGJ1dHRvbnMtZHJvcGRvd25fX3NwbGl0XCIgXG4iICsKKyAgICAiICAgICAgIG5nLWNsYXNzPVwieydidXR0b24tLXByaW1hcnknOihidG5UeXBlPT11bmRlZmluZWQgfHwgYnRuVHlwZT09J3ByaW1hcnknKSwgXG4iICsKKyAgICAiICAgICAgICAgICAgICAgICAgICdidXR0b24tLXNlY29uZGFyeSc6YnRuVHlwZT09J3NlY29uZGFyeScsIFxuIiArCisgICAgIiAgICAgICAgICAgICAgICAgICAnYnV0dG9uLS1kaXNhYmxlZCc6YnRuVHlwZT09J2Rpc2FibGVkJywgXG4iICsKKyAgICAiICAgICAgICAgICAgICAgICAgICdidXR0b24tLXNtYWxsJzppc1NtYWxsfVwiIFxuIiArCisgICAgIiAgICAgICBuZy1pZj1cIiFpc0Fj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saWRlcn1cIj48L2Rpdj5cbiIgKworICAgICIgICAgICAgICAgICAgICAgPGRpdiBjbGFzcz1cImpzbGlkZXItbGFiZWxcIj48c3BhbiBuZy1iaW5kPVwiZnJvbVwiPjwvc3Bhbj48c3BhbiBuZy1iaW5kPVwib3B0aW9ucy5kaW1lbnNpb25cIj48L3NwYW4+PC9kaXY+XG4iICsKKyAgICAiICAgICAgICAgICAgICAgIDxkaXYgY2xhc3M9XCJqc2xpZGVyLWxhYmVsIGpzbGlkZXItbGFiZWwtdG9cIj48c3BhbiBuZy1iaW5kPVwidG9TdHJcIj48L3NwYW4+PHNwYW4gbmctYmluZD1cImVuZERpbWVuc2lvblwiPjwvc3Bhbj48L2Rpdj5cbiIgKworICAgICIgICAgICAgICAgICAgICAgPGRpdiBjbGFzcz1cImpzbGlkZXItdmFsdWVcIiBpZD1cImpzbGlkZXItdmFsdWUtbGVmdFwiPjxzcGFuPjwvc3Bhbj57e29wdGlvbnMuZGltZW5zaW9ufX08L2Rpdj5cbiIgKworICAgICIgICAgICAgICAgICAgICAgPGRpdiBjbGFzcz1cImpzbGlkZXItdmFsdWUganNsaWRlci12YWx1ZS10b1wiPjxzcGFuPjwvc3Bhbj57e3Rvb2xUaXBEaW1lbnNpb259fTwvZGl2PlxuIiArCisgICAgIiAgICAgICAgICAgICAgICA8ZGl2IGNsYXNzPVwianNsaWRlci1zY2FsZVwiIG5nLWNsYXNzPVwieydzaG93LWRpdmlkZXJzJzogc2hvd0RpdmlkZXJzLCAnY3V0b2ZmLXNsaWRlci1kaXZpZGVycyc6aXNDdXRPZmZTbGlkZXJ9XCI+XG4iICsKKyAgICAiICAgICAgICAgICAgICAgIDwvZGl2PlxuIiArCisgICAgIiAgICAgICAgICAgICAgICA8ZGl2IGNsYXNzPVwianNsaWRlci1jdXRvZmZcIj5cbiIgKworICAgICIgICAgICAgICAgICAgICAgICAgIDxkaXYgY2xhc3M9XCJqc2xpZGVyLWxhYmVsIGpzbGlkZXItbGFiZWwtY3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ZWxlY3RvciAgICAgICAgICA6IHRoaXMuc2VsZWN0b3IsCisgICAgICBvcGVuICAgICAgICAgICAgICA6ICcub3BlbnBvcGJveCcsCisgICAgICBib3ggICAgICAgICAgICAgICA6ICcuYm94MScsCisgICAgICBhcnJvdyAgICAgICAgICAgICA6ICcuYXJyb3cnLAorICAgICAgYXJyb3dfYm9yZGVyICAgICAgOiAnLmFycm93LWJvcmRlcicsCisgICAgICBjbG9zZSAgICAgICAgICAgICA6ICcuY2xvc2UnCisgICAgfSwgb3B0aW9ucyk7CisKKyAgICB2YXIgbWV0aG9kcyA9IHsKKyAgICAgIG9wZW46IGZ1bmN0aW9uKGV2ZW50KXsKKyAgICAgICAgZXZlbnQucHJldmVudERlZmF1bHQoKTsKKyAgICAgICAgdmFyIHBvcCA9ICQodGhpcyk7CisgICAgICAgIHZhciBib3ggPSAkKHRoaXMpLnBhcmVudCgpLmZpbmQoc2V0dGluZ3NbJ2JveCddKTsKKyAgICAgICAgYm94LmZpbmQoc2V0dGluZ3NbJ2Fycm93J10pLmNzcyh7J2xlZnQnOiBib3gud2lkdGgoKS8yIC0gMTAgKyA0Nn0pOworICAgICAgICBib3guZmluZChzZXR0aW5nc1snYXJyb3dfYm9yZGVyJ10pLmNzcyh7J2xlZnQnOiBib3gud2lkdGgoKS8yIC0gMTAgLSA2M30pOworICAgICAgICBpZihib3guY3NzKCdkaXNwbGF5JykgPT0gJ2Jsb2NrJyl7CisgICAgICAgICAgLyogbWV0aG9kcy5jbG9zZSgpOworICAgICAgICAgIHNldFRpbWVvdXQoZnVuY3Rpb24oKXsgJCgiLmJ0bi1wYW5lbC12ZXJ0aWNhbCwjYWN0aW9uc0Ryb3BEb3duIikuY3NzKCd6LWluZGV4JywnOTk5Jyk7IH0sMjAwKTsKKyAgICAgICAgLy8gJCgiLmJ0bi1wYW5lbC12ZXJ0aWNhbCwjYWN0aW9uc0Ryb3BEb3duIikuY3NzKCd6LWluZGV4JywnOTk5Jyk7CisgICAgICAgICAgICB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aWNraW5nIG91dCBvZiBjaGF0LWJveAorICAgICQoZG9jdW1lbnQpLmJpbmQoJ2NsaWNrJywgZnVuY3Rpb24oZXZlbnQpeworICAgICAgaWYoISgkKGV2ZW50LnRhcmdldCkuY2xvc2VzdCgnLmNoYXRCb3gnKS5sZW5ndGggfHwgJChldmVudC50YXJnZXQpLmhhc0NsYXNzKCdjaGF0SWNvbicpIHx8ICQoZXZlbnQudGFyZ2V0KS5jbG9zZXN0KHNldHRpbmdzWydzZWxlY3RvciddKS5sZW5ndGgpKXsKKyAgICAgICAgbWV0aG9kcy5jbG9zZSgpOworICAgICAgICAgaWYgKCQoIiNhY3Rpb25zRHJvcERvd24iKS5jc3MoJ3otaW5kZXgnKT09Jy05OTknKXsKKyAgICAgICAgICAgc2V0VGltZW91dChmdW5jdGlvbigpeyAkKCIuYnRuLXBhbmVsLXZlcnRpY2FsLCNhY3Rpb25zRHJvcERvd24iKS5jc3MoJ3otaW5kZXgnLCc5OTknKTsgfSwyMDApOworICAgICAgICB9CisgICAgICAgIGlmKCQod2luZG93KS5zY3JvbGxUb3AoKSA+IDIwKXsKKyAgICAgICAgICAgc2V0VGltZW91dChmdW5jdGlvbigpeyAkKCIuYnRuLXBhbmVsLXZlcnRpY2FsLCNhY3Rpb25zRHJvcERvd24iKS5jc3MoJ3otaW5kZXgnLCctOTk5Jyk7IH0sMjAwKTsKKyAgICAgICAgICAgLy8gJCgiLmJ0bi1wYW5lbC12ZXJ0aWNhbCwjYWN0aW9uc0Ryb3BEb3duIikuY3NzKCd6LWluZGV4JywnLTk5OScpOworICAgICAgICB9OworICAgICAgIAorICAgICAgICAgICQoJy5jaGF0Qm94JykuZmFkZU91dCgnZmFzdCcpOworICAgICAgICAKKyAgICAgIH0KKyAgICB9KTsKKworICAgIHJldHVybiB0aGlzLmVhY2goZnVuY3Rpb24oKXsKKworICAgICAgJCh0aGlzKS5jc3Moeyd3aWR0aCc6ICQoc2V0dGluZ3NbJ2JveCddKS53aWR0aCgpfSk7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ZnVuY3Rpb24oKXsgJCgiLmJ0bi1wYW5lbC12ZXJ0aWNhbCwjYWN0aW9uc0Ryb3BEb3duIikuY3NzKCd6LWluZGV4JywnLTk5OScpOyB9LDIwMCk7CisgICAgICAgLy8gJCgiLmJ0bi1wYW5lbC12ZXJ0aWNhbCwjYWN0aW9uc0Ryb3BEb3duIikuY3NzKCd6LWluZGV4JywnLTk5OScpOworICAgIH07CisgIH0pOworCisgIC8vIENsb3NlIGNoYXQtYm94IG9uIEVzY2FwZSBrZXkgcHJlc3MKKyAgJChkb2N1bWVudCkuYmluZCgna2V5dXAnLCBmdW5jdGlvbihldmVudCl7CisgICAgaWYoZXZlbnQua2V5Q29kZSA9PSAyNyl7IAorICAgICAgc2V0VGltZW91dChmdW5jdGlvbigpeyAkKCIuYnRuLXBhbmVsLXZlcnRpY2FsLCNhY3Rpb25zRHJvcERvd24iKS5jc3MoJ3otaW5kZXgnLCc5OTknKTsgfSwyMDApOworICAgICAgbWV0aG9kcy5jbG9zZSgpOworICAgICAgaWYoJCh3aW5kb3cpLnNjcm9sbFRvcCgpID4gMjApeworICAgICAgICAgICBzZXRUaW1lb3V0KGZ1bmN0aW9uKCl7ICQoIi5idG4tcGFuZWwtdmVydGljYWwsI2FjdGlvbnNEcm9wRG93biIpLmNzcygnei1pbmRleCcsJy05OTknKTsgfSwyMDApOworICAgICAgICAgICAvLyQoIi5idG4tcGFuZWwtdmVydGljYWwsI2FjdGlvbnNEcm9wRG93biIpLmNzcygnei1pbmRleCcsJy05OTknKTsKKyAgICAgIH07CisgICAgfQorICB9KTsKKworICAvLyBDbG9zZSBjaGF0LWJveCBvbiBjbGlja2luZyBvdXQgb2YgY2hhdC1ib3gKKyAgLy8gJChkb2N1bWVudCkuYmluZCgnY2xpY2snLCBmdW5jdGlvbihldmVudCl7CisKKyAgLy8gICBjb25zb2xlLmxvZyhldmVudC50YXJnZXQsIjIiKTsKKyAgLy8gICBpZighKCQoZXZlbnQudGFyZ2V0KS5jbG9zZXN0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Z2l2ZW4gZWxlbWVudAorICAgICAqIEBwYXJhbSBlbGVtZW50CisgICAgICovCisgICAgdmFyIHBhcmVudE9mZnNldEVsID0gZnVuY3Rpb24gKGVsZW1lbnQpIHsKKyAgICAgICAgdmFyIGRvY0RvbUVsID0gJGRvY3VtZW50WzBdOworICAgICAgICB2YXIgb2Zmc2V0UGFyZW50ID0gZWxlbWVudC5vZmZzZXRQYXJlbnQgfHwgZG9jRG9tRWw7CisgICAgICAgIHdoaWxlIChvZmZzZXRQYXJlbnQgJiYgb2Zmc2V0UGFyZW50ICE9PSBkb2NEb21FbCAmJiBpc1N0YXRpY1Bvc2l0aW9uZWQob2Zmc2V0UGFyZW50KSkgeworICAgICAgICAgICAgb2Zmc2V0UGFyZW50ID0gb2Zmc2V0UGFyZW50Lm9mZnNldFBhcmVudDsKKyAgICAgICAgfQorICAgICAgICByZXR1cm4gb2Zmc2V0UGFyZW50IHx8IGRvY0RvbUVsOworICAgIH07CisKKyAgICByZXR1cm4geworICAgICAgICAvKioKKyAgICAgICAgICogUHJvdmlkZXMgcmVhZC1vbmx5IGVxdWl2YWxlbnQgb2YgalF1ZXJ5J3MgcG9zaXRpb24gZnVuY3Rpb246CisgICAgICAgICAqIGh0dHA6Ly9hcGkuanF1ZXJ5LmNvbS9wb3NpdGlvbi8KKyAgICAgICAgICovCisgICAgICAgIHBvc2l0aW9uOiBmdW5jdGlvbiAoZWxlbWVudCkgeworICAgICAgICAgICAgdmFyIGVsQkNSID0gdGhpcy5vZmZzZXQoZWxlbWVudCk7CisgICAgICAgICAgICB2YXIgb2Zmc2V0UGFyZW50QkNSID0geworICAgICAgICAgICAgICAgIHRvcDogMCwKKyAgICAgICAgICAgICAgICBsZWZ0OiAwCisgICAgICAgICAgICB9OworICAgICAgICAgICAgdmFyIG9mZnNldFBhcmVudEVsID0gcGFyZW50T2Zmc2V0RWwoZWxlbWVudFswXSk7CisgICAgICAgICAgICBpZiAob2Zmc2V0UGFyZW50RWwgIT0gJGRvY3VtZW50WzBdKSB7CisgICAgICAgICAgICAgICAgb2Zmc2V0UGFyZW50QkNSID0gdGhpcy5vZmZzZXQoYW5ndWxhci5lbGVtZW50KG9mZnNldFBhcmVudEVsKSk7CisgICAgICAgICAgICAgICAgb2Zmc2V0UGFyZW50QkNSLnRvcCArPSBvZmZzZXRQYXJlbnRFbC5jbGllbnRUb3AgLSBvZmZzZXRQYXJlbnRFbC5zY3JvbGxUb3A7CisgICAgICAgICAgICAgICAgb2Zmc2V0UGFyZW50QkNSLmxlZnQgKz0gb2Zmc2V0UGFyZW50RWwuY2xpZW50TGVmdCAtIG9mZnNldFBhcmVudEVsLnNjcm9sbExlZnQ7CisgICAgICAgICAgICB9CisKKyAgICAgICAgICAgIHJldHVybiB7CisgICAgICAgICAgICAgICAgd2lkdGg6IGVsZW1lbnQucHJvcCgnb2Zmc2V0V2lkdGgnKSwKKyAgICAgICAgICAgICAgICBoZWlnaHQ6IGVsZW1lbnQucHJvcCgnb2Zmc2V0SGVpZ2h0JyksCisgICAgICAgICAgICAgICAgdG9wOiBlbEJDUi50b3AgLSBvZmZzZXRQYXJlbnRCQ1IudG9wLAorICAgICAgICAgICAgICAgIGxlZnQ6IGVsQkNSLmxlZnQgLSBvZmZzZXRQYXJlbnRCQ1IubGVmdAorICAgICAgICAgICAgfTsKKyAgICAgICAgfSwKKworICAgICAgICAvKioKKyAgICAgICAgICogUHJvdmlkZXMgcmVhZC1vbmx5IGVxdWl2YWxlbnQgb2YgalF1ZXJ5J3Mgb2Zmc2V0IGZ1bmN0aW9uOgorICAgICAgICAgKiBodHRwOi8vYXBpLmpxdWVyeS5jb20vb2Zmc2V0LworICAgICAgICAgKi8KKyAgICAgICAgb2Zmc2V0OiBmdW5jdGlvbiAoZWxlbWVudCkgeworICAgICAgICAgICAgdmFyIGJvdW5kaW5nQ2xpZW50UmVjdCA9IGVsZW1lbnRbMF0uZ2V0Qm91bmRpbmdDbGllbnRSZWN0KCk7CisgICAgICAgICAgICByZXR1cm4geworIC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ZmFsc2U7CisgICAgICAgIH0KKyAgICB9OworICAgIAorICAgIHRoaXMuZXhwYW5kQWxsID0gZnVuY3Rpb24oKSB7CisgICAgICAgICRzY29wZS5mb3JjZUV4cGFuZD10cnVlOyAKKyAgICAgICAgYW5ndWxhci5mb3JFYWNoKHRoaXMuZ3JvdXBzLCBmdW5jdGlvbihncm91cCkgeyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKKyAgICAgICAgICAgIGdyb3VwLmlzT3BlbiA9IHRydWU7CisgICAgICAgIH0pOworICAgIH07CisgICAgCisgICAgdGhpcy5jb2xsYXBzZUFsbCA9IGZ1bmN0aW9uKCkgeworICAgICAgICBhbmd1bGFyLmZvckVhY2godGhpcy5ncm91cHMsIGZ1bmN0aW9uKGdyb3VwKSB7ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKKyAgICAgICAgICAgIGdyb3VwLmlzT3BlbiA9IGZhbHNlOyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCisgICAgICAgIH0pOworICAgIH07CisgICAgLyoqCisgICAgICoKKyAgICAgKiBmdW5jdGlvbiBmb2N1cworICAgICAqIEBwYXJhbSBmb2N1c0dyb3VwCisgICAgICovCisgICAgdGhpcy5mb2N1cyA9IGZ1bmN0aW9uKGZvY3VzR3JvdXApIHsKKyAgICAgICAgdmFyIHNlbGYgPSB0aGlzOworICAgICAgICAkbG9nLmxvZygiZW50ZXJpbmcgZm9jdXMiKTsKKyAgICAgICAgYW5ndWxhci5mb3JFYWNoKHRoaXMuZ3JvdXBzLCBmdW5jdGlvbihncm91cCwgaW5kZXgpIHsKKyAgICAgICAgICAgIGlmIChncm91cCAhPT0gZm9jdXNHcm91cCkgeworICAgICAgICAgICAgICAgIGdyb3VwLmZvY3VzZWQgPSBmYWxzZTsKKyAgICAgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICAgICAgc2VsZi5pbmRleCA9IGluZGV4OworICAgICAgICAgICAgICAgIGdyb3VwLmZvY3VzZWQgPSB0cnVlOworICAgICAgICAgICAgfQorICAgICAgICB9KTsKKyAgICB9OworICAgIC8qKgorICAgICAqCisgICAgICogQHBhcmFtIGJsdXJHcm91cAorICAgICAqLworICAgIHRoaXMuYmx1ciA9IGZ1bmN0aW9uKGJsdXJHcm91cCkgeworICAgICAgICBibHVyR3JvdXAuZm9jdXNlZCA9IGZhbHNlOworICAgICAgICB0aGlzLmluZGV4ID0gLTE7CisgICAgICAgICRsb2cubG9nKCJhY2NvcmRpb24uYmx1cigpIiwgYmx1ckdyb3VwKTsKKyAgICB9OworICAgIC8qKgorICAgICAqCisgICAgICogQHBhcmFtIGdyb3VwIC0gdGhlIGdyb3VwIGluIGN1cnJlbnQgZm9jdXMKKyAgICAgKiBAcGFyYW0gZG93biAtIGN5Y2xpbmcgZG93bgorICAgICAqLworICAgIHRoaXMuY3ljbGUgPSBmdW5jdGlvbihncm91cCwgZG93biwgbm9SZWN5Y2xlKSB7CisgICAgICAgIGlmICghZG93bikgeworICAgICAgICAgICAgaWYgKHRoaXMuaW5kZXggPD0gMCAmJiAhbm9SZWN5Y2xlKSB7CisgICAgICAgICAgICAgICAgdGhpcy5pbmRleCA9IHRoaXMuZ3JvdXBzLmxlbmd0aCAtIDE7CisgICAgICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgICAgIHRoaXMuaW5kZXgtLTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgIAorICAgICAgICAgICAgLyppZiAodGhpcy5pbmRleCA9PT0gKHRoaXMuZ3JvdXBzLmxlbmd0aCAtIDEpICYmICFub1JlY3ljbGUpIHsKKyAgICAgICAgICAgICAgICB0aGlzLmluZGV4ID0gMDsKKyAgICAgICAgICAgIH0gZWxzZSBpZiAodGhpcy5pbmRleCA9PT0gKHRoaXMuZ3JvdXBzLmxlbmd0aCAtIDEpICYmIG5vUmVjeWNsZSkgeworICAgICAgICAgICAgICAgIHRoaXMuaW5kZXggPSAwOworICAgICAgICAgICAgICAgIHJldHVybjsKKyAgICAgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICAgICAgdGhpcy5pbmRleCsrOworICAgICAgICAgICAgfSAqLworICAgICAgICAgICAgaWYgKHRoaXMuaW5kZXggPT09ICh0aGlzLmdyb3Vwcy5sZW5ndGggLSAxKSkgCisgICAgICAgICAgICB7ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKKyAgICAgICAgICAgICAgICBpZihub1JlY3ljbGUpeworICAgICAgICAgICAgICAgICAgICB0aGlzLmluZGV4ID0gMDsgICAgICAgICAgICAgICAgICAgIAorICAgICAgICAgICAgICAgICAgICBncm91cC5mb2N1c2VkID0gZmFsc2U7CisgICAgICAgICAgICAgICAgICAgICRzY29wZS4kYXBwbHkoKTsKKyAgICAgICAgICAgICAgICAgICAgcmV0dXJuOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICB0aGlzLmluZGV4ID0gMDsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgICAgIHRoaXMuaW5kZXgrKzsKKyAgICAgICAgICAgIH0gICAKKyAgICAgICAgICAgIAorICAgICAgICAgICAgCisgICAgICAgIH0KKyAgICAgICAgZ3JvdXAuZm9jdXNlZCA9IGZhbHNlOworICAgICAgICB0aGlzLmdyb3Vwc1t0aGlzLmluZGV4XS5mb2N1c2VkID0gdHJ1ZTsKKyAgICAgICAgJGxvZy5sb2coImFjY29yZGlvbi5jeWNsZSgpIiwgZ3JvdXAsIGRvd24pOworICAgICAgICAkbG9nLmxvZygiZ3JvdXAgdW5mb2N1c2VkIiwgZ3JvdXApOworICAgICAgICAkbG9nLmxvZygiZ3JvdXAgZm9jdXNlZCIsIHRoaXMuZ3JvdXBzW3RoaXMuaW5kZXhdKTsKKyAgICAgICAgJHNjb3BlLiRhcHBseSgpOworICAgIH07CisKKyAgICAvLyBUa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aXZlKCdhY2NvcmRpb24nLCBmdW5jdGlvbigpIHsKKyAgICByZXR1cm4geworICAgICAgICByZXN0cmljdDogJ0VBJywKKyAgICAgICAgY29udHJvbGxlcjogJ0FjY29yZGlvbkNvbnRyb2xsZXInLAorICAgICAgICB0cmFuc2NsdWRlOiB0cnVlLAorICAgICAgICByZXBsYWNlOiBmYWxzZSwKKyAgICAgICAgc2NvcGU6IHsKKyAgICAgICAgICAgIGNDbGFzczogJ0Bjc3MnLAorICAgICAgICAgICAgZXhwYW5kQWxsOiI9PyIsCisgICAgICAgICAgICBjb2xsYXBzZUFsbDoiPT8iCisgICAgICAgIH0sCisgICAgICAgIHRlbXBsYXRlOiAnPGRpdiBjbGFzcz0ie3tjQ2xhc3N9fSIgbmctdHJhbnNjbHVkZT48L2Rpdj4nLAorICAgICAgICBsaW5rOmZ1bmN0aW9uKHNjb3BlLGVsZW0sYXR0cmlidXRlLGN0cmwpICB7CisgICAgICAgICAgICAKKyAgICAgICAgICAgIHNjb3BlLiR3YXRjaCgiZXhwYW5kQWxsIiwgZnVuY3Rpb24odmFsdWUpIHsKKyAgICAgICAgICAgICAgICBpZiAodmFsdWU9PT10cnVlKSB7CisgICAgICAgICAgICAgICAgICAgICBjdHJsLmV4cGFuZEFsbCgpOworICAgICAgICAgICAgICAgICAgICAgc2NvcGUuZXhwYW5kQWxsPWZhbHNlOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0pOworICAgICAgICAgICAgIHNjb3BlLiR3YXRjaCgiY29sbGFwc2VBbGwiLCBmdW5jdGlvbih2YWx1ZSkgeworICAgICAgICAgICAgICAgIGlmICh2YWx1ZT09PXRydWUpIHsKKyAgICAgICAgICAgICAgICAgICAgIGN0cmwuY29sbGFwc2VBbGwoKTsKKyAgICAgICAgICAgICAgICAgICAgIHNjb3BlLmNvbGxhcHNlQWxsID0gZmFsc2U7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfSk7CisgICAgICAgIH0gICAKKyAgICB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gICAgICBzY29wZTogeworICAgICAgICAgICAgaGVhZGluZzogJ0AnLAorICAgICAgICAgICAgaXNPcGVuOiAnPT8nCisgICAgICAgIH0sIC8vIENyZWF0ZSBhbiBpc29sYXRlZCBzY29wZSBhbmQgaW50ZXJwb2xhdGUgdGhlIGhlYWRpbmcgYXR0cmlidXRlIG9udG8gdGhpcyBzY29wZQorICAgICAgICBjb250cm9sbGVyOlsnJHNjb3BlJywgZnVuY3Rpb24oJHNjb3BlKQorICAgICAgICB7CisgICAgICAgICAgICAkc2NvcGUuc2hvd2ljbyA9IHRydWU7CisgICAgICAgICAgICB0aGlzLnNldEhlYWRpbmcgPSBmdW5jdGlvbihlbGVtZW50KQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIHRoaXMuaGVhZGluZyA9IGVsZW1lbnQ7CisgICAgICAgICAgICAgICAgJHNjb3BlLnNob3dpY28gPSBmYWxzZTsKKyAgICAgICAgICAgIH07ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKKyAgICAgICAgICAgIHRoaXMuaXNJc09wZW4gPSBmdW5jdGlvbigpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgcmV0dXJuICRzY29wZS5pc09wZW47CisgICAgICAgICAgICB9OworICAgICAgICB9XSwKKyAgICAgICAgbGluazogZnVuY3Rpb24oc2NvcGUsIGVsZW1lbnQsIGF0dHJzLCBjdHJsKSB7CisgICAgICAgICAgICB2YXIgYWNjb3JkaW9uQ3RybCA9IGN0cmxbMF07CisgICAgICAgICAgICB2YXIgYWNjb3JkaW9uR3JvdXBDdHJsID0gY3RybFsxXTsKKyAgICAgICAgICAgIHZhciBrZXlzID0ge3RhYjogOSwgZW50ZXI6IDEzLCBlc2M6IDI3LCBzcGFjZTogMzIsIHBhZ2V1cDogMzMsIHBhZ2Vkb3duOiAzNCwgZW5kOiAzNSwgaG9tZTogMzYsIGxlZnQ6IDM3LCB1cDogMzgsIHJpZ2h0OiAzOSwgZG93bjogNDB9OworCisgICAgICAgICAgICAvL25vdCBhIGZpeAorICAgICAgICAgICAgdmFyIHRhYiA9IGVsZW1lbnQuY2hpbGRyZW4oKS5lcSgwKTsKKyAgICAgICAgICAgIHZhciBwYW5lbCA9IGVsZW1lbnQuY2hpbGRyZW4oKS5lcSgxKTsKKworICAgICAgICAgICAgdmFyIGhhbmRsZUtleWRvd24gPSBmdW5jdGlvbihldikgeworICAgICAgICAgICAgICAgICRsb2cubG9nKCJFbnRlciBoYW5kbGVLZXlkb3duIG9uOiAiLCBldik7CisgICAgICAgICAgICAgICAgdmFyIGJvb2xGbGFnID0gdHJ1ZTsKKyAgICAgICAgICAgICAgICBzd2l0Y2ggKGV2LmtleUNvZGUpCisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICBjYXNlIGtleXMuZW50ZXI6CisgICAgICAgICAgICAgICAgICAgICAgICBldi5wcmV2ZW50RGVmYXVsdCgpOworICAgICAgICAgICAgICAgICAgICAgICAgc2NvcGUudG9nZ2xlKCk7CisgICAgICAgICAgICAgICAgICAgICAgICBzY29wZS4kYXBwbHkoKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgICAgICAgICAgLy9yZXR1cm4gdHJ1ZTsKKyAgICAgICAgICAgICAgICAgICAgY2FzZSBrZXlzLnVwOgorICAgICAgICAgICAgICAgICAgICBjYXNlIGtleXMubGVmdDoKKyAgICAgICAgICAgICAgICAgICAgICAgIGV2LnByZXZlbnREZWZhdWx0KCk7CisgICAgICAgICAgICAgICAgICAgICAgICAkbG9nLmxvZygiY3ljbGUgdXAiKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIGFjY29yZGlvbkN0cmwuY3ljbGUoc2NvcGUsIGZhbHNlKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgICAgICAgICAgLy9yZXR1cm4gdHJ1ZTsKKyAgICAgICAgICAgICAgICAgICAgY2FzZSBrZXlzLmRvd246CisgICAgICAgICAgICAgICAgICAgIGNhc2Uga2V5cy5yaWdodDoKKyAgICAgICAgICAgICAgICAgICAgICAgIGV2LnByZXZlbnREZWZhdWx0KCk7CisgICAgICAgICAgICAgICAgICAgICAgICAkbG9nLmxvZygiY3ljbGUgZG93biIpOworICAgICAgICAgICAgICAgICAgICAgICAgYWNjb3JkaW9uQ3RybC5jeWNsZShzY29wZSwgdHJ1ZSk7CisgICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICAgICAgICAgIC8vcmV0dXJuIHRydWU7CisgICAgICAgICAgICAgICAgICAgIGNhc2Uga2V5cy50YWI6CisvLyAgICAgICAgICAgICAgICAgICAgICAgIGlmKGV2LnNoaWZ0S2V5ID09PSB0cnVlKQorLy8gICAgICAgICAgICAgICAgICAgICAgICB7CisvLyAgICAgICAgICAgICAgICAgICAgICAgICAgICAkbG9nLmxvZygic2hpZnQgd2l0aCBUYWIiKTsKKy8vICAgICAgICAgICAgICAgICAgICAgICAgICAgIGFjY29yZGlvbkN0cmwuY3ljbGUoc2NvcGUsIGZhbHNlKTsgICAgICAgICAgICAgICAgICAgICAgICAgICAgCisvLyAgICAgICAgICAgICAgICAgICAgICAgIH0KKy8vICAgICAgICAgICAgICAgICAgICAgICAgZWxzZQorLy8gICAgICAgICAgICAgICAgICAgICAgICB7CisvLyAgICAgICAgICAgICAgICAgICAgICAgICAgICBhY2NvcmRpb25DdHJsLmN5Y2xlKHNjb3BlLCB0cnVlLCB0cnVlKTsKKy8vICAgICAgICAgICAgICAgICAgICAgICAgfSAgICAgICAgICAgICAgICAgICAgICAgIAorLy8gICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICAgICAgZGVmYXVsdDoKKyAgICAgICAgICAgICAgICAgICAgICAgIGJvb2xGbGFnID0gZmFsc2U7CisgICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICAgICAgICAgIC8vcmV0dXJuIGZhbHNlOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICBldi5zdG9wUHJvcGFnYXRpb24oKTsKKyAgICAgICAgICAgICAgICByZXR1cm4gYm9vbEZsYWc7CisgICAgICAgICAgICB9OworCisgICAgICAgICAgICB2YXIgc3dhbGxvd0tleXByZXNzID0gZnVuY3Rpb24oZSkgeworICAgICAgICAgICAgICAgICRsb2cubG9nKCJrZXlwcmVzcyIsIGUpOworICAgICAgICAgICAgICAgIGlmIChlLmFsdEtleSkgeworICAgICAgICAgICAgICAgICAgICAvLyBkbyBub3RoaW5nCisgICAgICAgICAgICAgICAgICAgIHJldHVybiB0cnVlOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICB2YXIgYm9vbEZsYWcgPSB0cnVlOworICAgICAgICAgICAgICAgIHN3aXRjaCAoZS5rZXlDb2RlKQorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgY2FzZSBrZXlzLmVudGVyOgorICAgICAgICAgICAgICAgICAgICBjYXNlIGtleXMuc3BhY2U6CisgICAgICAgICAgICAgICAgICAgIGNhc2Uga2V5cy5sZWZ0OgorICAgICAgICAgICAgICAgICAgICBjYXNlIGtleXMudXA6CisgICAgICAgICAgICAgICAgICAgIGNhc2Uga2V5cy5yaWdodDoKKyAgICAgICAgICAgICAgICAgICAgY2FzZSBrZXlzLmRvd246CisgICAgICAgICAgICAgICAgICAgIGNhc2Uga2V5cy5ob21lOgorICAgICAgICAgICAgICAgICAgICBjYXNlIGtleXMuZW5kOgorICAgICAgICAgICAgICAgICAgICAgICAgZS5zdG9wUHJvcGFnYXRpb24oKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIGJvb2xGbGFnID0gZmFsc2U7CisgICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICAgICAgICAgIC8vcmV0dXJuIGZhbHNlOworICAgICAgICAgICAgICAgICAgICBjYXNlIGtleXMucGFnZXVwOgorICAgICAgICAgICAgICAgICAgICBjYXNlIGtleXMucGFnZWRvd246CisgICAgICAgICAgICAgICAgICAgICAgICAvLyBUaGUgdGFiIGtleXByZXNzIGhhbmRsZXIgbXVzdCBjb25zdW1lIHBhZ2V1cCBhbmQgcGFnZWRvd24KKyAgICAgICAgICAgICAgICAgICAgICAgIC8vIGtleXByZXNzZXMgdG8gcHJldmVudCBGaXJlZm94IGZyb20gc3dpdGNoaW5nIHRhYnMKKyAgICAgICAgICAgICAgICAgICAgICAgIC8vIG9uIGN0cmwrcGFnZXVwIGFuZCBjdHJsK3BhZ2Vkb3duCisgICAgICAgICAgICAgICAgICAgICAgICBpZiAoIWUuY3RybEtleSkKKyAgICAgICAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBib29sRmxhZyA9IHRydWU7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgLy9yZXR1cm4gdHJ1ZTsKKyAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgIGUuc3RvcFByb3BhZ2F0aW9uKCk7CisgICAgICAgICAgICAgICAgICAgICAgICBib29sRmxhZyA9IGZhbHNlOworICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgICAgICAgICAvL3JldHVybiBmYWxzZTsKKyAgICAgICAgICAgICAgICAgICAgZGVmYXVsdDoKKyAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICByZXR1cm4gYm9vbEZsYWc7CisgICAgICAgICAgICAgICAgLy9yZXR1cm4gdHJ1ZTsKKyAgICAgICAgICAgIH07CisgICAgICAgICAgICAKKyAgICAgICAgICAgIGlmKGFuZ3VsYXIuaXNVbmRlZmluZWQoc2NvcGUuaXNPcGVuKSkgeworICAgICAgICAgICAgICAgIHNjb3BlLmlzT3BlbiA9IGZhbHNlOworICAgICAgICAgICAgfQorCisgICAgICAgICAgICBwYW5lbC5iaW5kKCJrZXlwcmVzcyIsIHN3YWxsb3dLZXlwcmVzcyk7CisgICAgICAgICAgICB0YWIuYmluZCgia2V5ZG93biIsIGhhbmRsZUtleWRvd24pOworCisgICAgICAgICAgICB0YWIuYmluZCgiZm9jdXMiLCBmdW5jdGlvbihldikgeworICAgICAgICAgICAgICAgIHRhYi5hdHRyKCJ0YWJpbmRleCIsICIwIik7CisgICAgICAgICAgICB9KTsKKworICAgICAgICAgICAgdGFiLmJpbmQoImJsdXIiLCBmdW5jdGlvbihldikgeworICAgICAgICAgICAgICAgIGlmIChzY29wZS5pbmRleCAhPT0gMCkgeworICAgICAgICAgICAgICAgICAgICB0YWIuYXR0cigidGFiaW5kZXgiLCAiLTEiKTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9KTsKKworICAgICAgICAgICAgYWNjb3JkaW9uQ3RybC5hZGRHcm91cChzY29wZSk7CisKKyAgICAgICAgICAgIGlmIChzY29wZS5pbmRleCA9PT0gMCkgeworICAgICAgICAgICAgICAgIHRhYi5hdHRyKCJ0YWJpbmRleCIsICIwIik7CisgICAgICAgICAgICB9CisKKyAgICAgICAgICAgIGFjY29yZGlvbkdyb3VwQ3RybC50b2dnbGUgPSBzY29wZS50b2dnbGUgPSBmdW5jdGlvbigpIHsKKyAgICAgICAgICAgICAgICBzY29wZS5pc09wZW4gPSAhc2NvcGUuaXNPcGVuOworICAgICAgICAgICAgICAgIGFjY29yZGlvbkN0cmwuZm9jdXMoc2NvcGUpOworICAgICAgICAgICAgICAgIGlmIChzY29wZS5pc09wZW4gPT09IHRydWUpIHsKKyAgICAgICAgICAgICAgICAgICAgaWYgKG5hdmlnYXRvci51c2VyQWdlbnQubWF0Y2goL01TSUUgOC8pID09PSBudWxsKSB7CisgICAgICAgICAgICAgICAgICAgICAgIC8vICRzY3JvbGxUbygwLCAkcG9zaXRpb24ub2Zmc2V0KGVsZW1lbnQpLnRvcCwgMC41KTsKKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIH0gCisgICAgICAgICAgICAgICAgcmV0dXJuIHNjb3BlLmlzT3BlbjsKKyAgICAgICAgICAgIH07CisgICAgICAgICAgICAKKyAgICAgICAgICAgIHNjb3BlLiR3YXRjaCgnaXNPcGVuJywgZnVuY3Rpb24odmFsdWUpIHsKKyAgICAgICAgICAgICAgICBpZiAodmFsdWUpIHsKKyAgICAgICAgICAgICAgICAgICAgYWNjb3JkaW9uQ3RybC5jbG9zZU90aGVycyhzY29wZSk7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfSk7CisKKyAgICAgICAgICAgIHNjb3BlLiR3YXRjaCgiZm9jdXNlZCIsIGZ1bmN0aW9uKHZhbHVlKSB7CisgICAgICAgICAgICAgICAgaWYgKCEhdmFsdWUpIHsKKyAgICAgICAgICAgICAgICAgICAgJHRpbWVvdXQoZnVuY3Rpb24oKSB7CisgICAgICAgICAgICAgICAgICAgICAgICB0YWIuYXR0cigidGFiaW5kZXgiLCAiMCIpOworICAgICAgICAgICAgICAgICAgICAgICAgdGFiWzBdLmZvY3VzKCk7CisgICAgICAgICAgICAgICAgICAgIH0sIDApOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0pOworICAgICAgICB9CisgICAgfTsKK31dKQorLy8gVXNlIGFjY29yZGlvbi1oZWFkaW5nIGJlbG93IGFuIGFjY29yZGlvbi1ncm91cCB0byBwcm92aWRlIGEgaGVhZGluZyBjb250YWluaW5nIEhUTUwKKy8vIDxhY2NvcmRpb24tZ3JvdXA+CisvLyAgIDxhY2NvcmRpb24taGVhZGluZz5IZWFkaW5nIGNvbnRhaW5pbmcgSFRNTCAtIDxpbWcgc3JjPSIuLi4iPjwvYWNjb3JkaW9uLWhlYWRpbmc+CisvLyA8L2FjY29yZGlvbi1ncm91cD4KKy8vYWNjb3JkaW9uVG9nZ2xlCisuZGlyZWN0aXZlKCdhY2NvcmRpb25Ub2dnbGUnLGZ1bmN0aW9uKCl7CisgICAgcmV0dXJueworICAgICAgICByZXN0cmljdDogJ0VBJywKKyAgICAgICAgcmVxdWlyZTogJ15hY2NvcmRpb25Hcm91cCcsCisgICAgICAgIHNjb3BlOnsKKyAgICAgICAgICAgIGV4cGFuZEljb246J0AnLAorICAgICAgICAgICAgY29sbGFwc2VJY29uOidAJworICAgICAgICB9LAorICAgICAgICBsaW5rOiBmdW5jdGlvbihzY29wZSwgZWxlbWVudCwgYXR0ciwgYWNjb3JkaW9uQ3RybCkKKyAgICAgICAgeyAgICAgIAorICAgICAgICAgICAgICAgICAgICAgICAKKyAgICAgICAgICAgIHZhciBzZXRJY29uID0gZnVuY3Rpb24oaXNPcGVuKXsgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAorICAgICAgICAgICAgICAgIGlmKHNjb3BlLmV4cGFuZEljb24gJiYgc2NvcGUuY29sbGFwc2VJY29uKQorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgaWYoaXNPcGVuKXsKKyAgICAgICAgICAgICAgICAgICAgICAgIGVsZW1lbnQucmVtb3ZlQ2xhc3Moc2NvcGUuZXhwYW5kSWNvbik7CisgICAgICAgICAgICAgICAgICAgICAgICBlbGVtZW50LmFkZENsYXNzKHNjb3BlLmNvbGxhcHNlSWNvbik7CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgZWxzZXsKKyAgICAgICAgICAgICAgICAgICAgICAgIGVsZW1lbnQucmVtb3ZlQ2xhc3Moc2NvcGUuY29sbGFwc2VJY29uKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIGVsZW1lbnQuYWRkQ2xhc3Moc2NvcGUuZXhwYW5kSWNvbik7ICAgICAgICAgICAgICAgICAgICAgICAgCisgICAgICAgICAgICAgICAgICAgIH0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9OyAgCisgICAgICAgICAgICAgICAgICAgCisgICAgICAgICAgICBlbGVtZW50LmJpbmQoJ2NsaWNrJywgZnVuY3Rpb24oKQorICAgICAgICAgICAgeyAgICAgICAgICAgICAgICAKKyAgICAgICAgICAgICAgICBhY2NvcmRpb25DdHJsLnRvZ2dsZSgpOworICAgICAgICAgICAgICAgIHNjb3BlLiRhcHBseSgpOworICAgICAgICAgICAgfSk7CisgICAgICAgICAgICAgICAgICAgICAgICAKKyAgICAgICAgICAgIHNjb3BlLiR3YXRjaChmdW5jdGlvbigpeworICAgICAgICAgICAgICAgIHJldHVybiBhY2NvcmRpb25DdHJsLmlzSXNPcGVuKCk7CisgICAgICAgICAgICB9LCBmdW5jdGlvbih2YWx1ZSl7CisgICAgICAgICAgICAgICAgc2V0SWNvbih2YWx1ZSk7CisgICAgICAgICAgICB9KTsgICAgICAgICAgICAgICAgICAgIAorICAgICAgICB9ICAgICAgICAgICAgICAgIAorICAgIH07ICAgCit9KQorCisuZGlyZWN0aXZlKCdhY2NvcmRpb25IZWFkaW5nJywgZnVuY3Rpb24oKSB7CisgICAgcmV0dXJuIHsKKyAgICAgICAgcmVzdHJpY3Q6ICdFQScsCisgICAgICAgIHRyYW5zY2x1ZGU6IHRydWUsIC8vIEdyYWIgdGhlIGNvbnRlbnRzIHRvIGJlIHVzZWQgYXMgdGhlIGhlYWRpbmcKKyAgICAgICAgdGVtcGxhdGU6ICcnLCAvLyBJbiBlZmZlY3QgcmVtb3ZlIHRoaXMgZWxlbWVudCEKKyAgICAgICAgLy9yZXBsYWNlOiB0cnVlLAorICAgICAgICByZXF1aXJlOiAnXmFjY29yZGlvbkdyb3VwJywgICAgICAgIAorICAgICAgICBjb21waWxlOiBmdW5jdGlvbihlbGVtZW50LCBhdHRyLCB0cmFuc2NsdWRlKSB7CisgICAgICAgICAgICByZXR1cm4gZnVuY3Rpb24gbGluayhzY29wZSwgZWxlbWVudCwgYXR0ciwgYWNjb3JkaW9uR3JvdXBDdHJsKSB7CisgICAgICAgICAgICAgICAgLy8gUGFzcyB0aGUgaGVhZGluZyB0byB0aGUgYWNjb3JkaW9uLWdyb3VwIGNvbnRyb2xsZXIKKyAgICAgICAgICAgICAgICAvLyBzbyB0aGF0IGl0IGNhbiBiZSB0cmFuc2NsdWRlZCBpbnRvIHRoZSByaWdodCBwbGFjZSBpbiB0aGUgdGVtcGxhdGUKKyAgICAgICAgICAgICAgICAvLyBbVGhlIHNlY29uZCBwYXJhbWV0ZXIgdG8gdHJhbnNjbHVkZSBjYXVzZXMgdGhlIGVsZW1lbnRzIHRvIGJlIGNsb25lZCBzbyB0aGF0IHRoZXkgd29yayBpbiBuZy1yZXBlYXRdICAgICAgICAgICAgICAgIAorICAgICAgICAgICAgICAgIHRyYW5zY2x1ZGUoc2NvcGUsIGZ1bmN0aW9uKGNsb25lKSB7CisgICAgICAgICAgICAgICAgICAgIGVsZW1lbnQuYXBwZW5kKGNsb25lKTsKKyAgICAgICAgICAgICAgICAgICAgYWNjb3JkaW9uR3JvdXBDdHJsLnNldEhlYWRpbmcoZWxlbWVudCk7CisgICAgICAgICAgICAgICAgfSk7CisgICAgICAgICAgICB9OworICAgICAgICB9CisKKy8vICAgICAgICBjb21waWxlOiBmdW5jdGlvbihlbGVtZW50LCBhdHRyLCB0cmFuc2NsdWRlKSB7CisvLyAgICAgICAgICAgIHJldHVybiBmdW5jdGlvbiBsaW5rKHNjb3BlLCBlbGVtZW50LCBhdHRyLCBhY2NvcmRpb25Hcm91cEN0cmwpIHsKKy8vICAgICAgICAgICAgICAgIC8vIFBhc3MgdGhlIGhlYWRpbmcgdG8gdGhlIGFjY29yZGlvbi1ncm91cCBjb250cm9sbGVyCisvLyAgICAgICAgICAgICAgICAvLyBzbyB0aGF0IGl0IGNhbiBiZSB0cmFuc2NsdWRlZCBpbnRvIHRoZSByaWdodCBwbGFjZSBpbiB0aGUgdGVtcGxhdGUKKy8vICAgICAgICAgICAgICAgIC8vIFtUaGUgc2Vjb25kIHBhcmFtZXRlciB0by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bnNjbHVkZV07CisgICAgICAgICAgICB9LCBmdW5jdGlvbihoZWFkaW5nKSB7CisgICAgICAgICAgICAgICAgaWYgKGhlYWRpbmcpIHsKKyAgICAgICAgICAgICAgICAgICAgZWxlbWVudC5maW5kKCJzcGFuIikuZXEoMCkucHJlcGVuZChoZWFkaW5nKTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9KTsKKyAgICAgICAgfQorICAgIH07Cit9KQorCisuZGlyZWN0aXZlKCdhdHRHb1RvcCcsWyckc2Nyb2xsVG8nLCBmdW5jdGlvbigkc2Nyb2xsVG8peyAgICAKKyAgICByZXR1cm4geworICAgICAgcmVzdHJpY3Q6ICdBJywgICAgICAgIAorICAgICAgdHJhbnNjbHVkZTogZmFsc2UsICAgICAgICAgICAgICAgICAgIAorICAgICAgbGluazogZnVuY3Rpb24gKHNjb3BlLCBlbGVtLCBhdHRycykgCisgICAgICB7ICAgICAgICAgCisgICAgICAgICAgZWxlbS5iaW5kKCdjbGljaycsIGZ1bmN0aW9uKCkgCisgICAgICAgICAgeworICAgICAgICAgICAgICRzY3JvbGxUbygwLGF0dHJzWyJhdHRHb1RvcCJdKTsKKyAgICAgICAgICB9KTsKKyAgICAgIH0gICAgCit9OworfV0pCisKKy5kaXJlY3RpdmUoJ2F0dEdvVG8nLFsnJGFuY2hvclNjcm9sbCcsJyRsb2NhdGlvbicsIGZ1bmN0aW9uKCRhbmNob3JTY3JvbGwsICRsb2NhdGlvbil7ICAgIAorICAgIHJldHVybiB7CisgICAgICByZXN0cmljdDogJ0EnLCAgICAgICAgCisgICAgICB0cmFuc2NsdWRlOiBmYWxzZSwgICAgICAgICAgICAgICAgICAgCisgICAgICBsaW5rOiBmdW5jdGlvbiAoc2NvcGUsIGVsZW0sIGF0dHJzKSAKKyAgICAgICB7ICAgICAgICAgCisgICAgICAgICAgZWxlbS5iaW5kKCdjbGljaycsIGZ1bmN0aW9uKCkgCisgICAgICAgICAgeyAgICAgICAgICAgICAgICAKKyAgICAgICAgICAgICAgICB2YXIgbmV3SGFzaCA9IGF0dHJzWyJhdHRHb1RvIl07CisgICAgICAgICAgICAgICAgaWYgKCRsb2NhdGlvbi5oYXNoKCkgIT09IG5ld0hhc2gpIAorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgJGxvY2F0aW9uLmhhc2goYXR0cnNbImF0dEdvVG8iXSk7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIGVsc2UgCisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAkYW5jaG9yU2Nyb2xsKCk7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgIH0pOworICAgICAgICB9ICAgIAorICAgIH07Cit9XSkKKworLmRpcmVjdGl2ZSgnZnJlZVN0YW5kaW5nJyxmdW5jdGlvbigpeyAgICAKKyAgICByZXR1cm4geworICAgICAgcmVzdHJpY3Q6ICdFQScsCisgICAgICB0cmFuc2NsdWRlOiB0cnVlLCAgICAgICAgICAgICAgICAgICAKKyAgICAgIHJlcGxhY2U6dHJ1ZSwKKyAgICAgIHNjb3BlOnRydWUsCisgICAgICB0ZW1wbGF0ZTogIjxkaXY+PHNwYW4gY2xhc3M9J2F0dC1hY2NvcmRpb25fX2ZyZWVzdGFuZGluZycgbmctc2hvdz0nc2hvd0FjY29yZGlvbic+PC9zcGFuPlxuIiArICAgICAgICAgICAgICAgICAgICAgICAgIAorICAgICAgICAgICAgIjxkaXYgY2xhc3M9J3NlY3Rpb24tdG9nZ2xlJz5cbiIgKworICAgICAgICAgICAgIjxidXR0b24gY2xhc3M9J3NlY3Rpb24tdG9nZ2xlX19idXR0b24nIG5nLWNsaWNrPSdmc1RvZ2dsZSgpJz5cbiIgKyAKKyAgICAgICAgICAgICIgICAge3tidG5UZXh0fX08aSBzdHlsZT0nZm9udC1zaXplOjAuODc1cmVtJyBuZy1jbGFzcz0ne1wiaWNvbi1jaGV2cm9uLXVwXCI6IHNob3dBY2NvcmRpb24sXCJpY29uLWNoZXZyb24tZG93blwiOiAhc2hvd0FjY29yZGlvbiwgfSc+PC9pPiBcbiIgKworICAgICAgICAgICAgIjwvYnV0dG9uPlxuIiArIAorICAgICAgICAgICAgIjwvZGl2PjwvZGl2PiIsICAgICAgIAorICAgICAgICBjb21waWxlOiBmdW5jdGlvbihlbGVtZW50LCBhdHRyLCB0cmFuc2NsdWRlKSAKKyAgICAgICAgeworICAgICAgICAgICAgcmV0dXJuIGZ1bmN0aW9uIGxpbmsoc2NvcGUsIGVsZW0sIGF0dHJzKSAKKyAgICAgICAgICAgIHsgICAgICAgICAgICAgICAgCisgICAgICAgICAgICAgICAgc2NvcGUuY29udGVudCA9ICIiOworICAgICAgICAgICAgICAgIHRyYW5zY2x1ZGUoc2NvcGUsIGZ1bmN0aW9uKGNsb25lKSAKKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgIGVsZW0uZmluZCgic3BhbiIpLmFwcGVuZChjbG9uZSk7ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAorICAgICAgICAgICAgICAgIH0pOyAgICAgICAgICAgCisgICAgICAgICAgICAgICAgc2NvcGUuc2hvd0FjY29yZGlvbiA9IGZhbHNlOworICAgICAgICAgICAgICAgIHNjb3BlLmJ0blRleHQgPSBzY29wZS5zaG93QWNjb3JkaW9uPyBhdHRycy5oaWRlTXNnOmF0dHJzLnNob3dNc2c7ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAorICAgICAgICAgICAgICAgIHNjb3BlLmZzVG9nZ2xlID0gZnVuY3Rpb24oKQorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgICBzY29wZS5zaG93QWNjb3JkaW9uID0gIXNjb3BlLnNob3dBY2NvcmRpb247ICAgICAgICAgICAgICAKKyAgICAgICAgICAgICAgICAgICAgICBzY29wZS5idG5UZXh0ID0gc2NvcGUuc2hvd0FjY29yZGlvbj8gYXR0cnMuaGlkZU1zZzphdHRycy5zaG93TXNnOyAgICAgICAgICAgICAgICAgICAgCisgICAgICAgICAgICAgICAgfSAgICAgICAgICAgICAgICAKKyAgICAgICAgICAgIH07CisgICAgICAgIH0KKyAgICB9OworfSkKKworLmRpcmVjdGl2ZSgnZXhwYW5kZXJzJyxmdW5jdGlvbigpeworICAgIHJldHVybnsKKyAgICAgICAgcmVzdHJpY3Q6ICdFQScsCisgICAgICAgIHJlcGxhY2U6dHJ1ZSwKKyAgICAgICAgdHJhbnNjbHVkZTp0cnVlLCAgICAgICAgCisgICAgICAgIHRlbXBsYXRlOiI8ZGl2IG5nLXRyYW5zY2x1ZGU+PC9kaXY+IiwKKyAgICAgICAgY29udHJvbGxlcjogWyckc2NvcGUnLGZ1bmN0aW9uKCRzY29wZSl7CisgICAgICAgICAgICB2YXIgYm9keVNjb3BlID0gbnVsbDsKKyAgICAgICAgICAgIHRoaXMuc2V0U2NvcGUgPSBmdW5jdGlvbihzY29wZSl7ICAgICAgICAgICAgICAgCisgICAgICAgICAgICAgICAgYm9keVNjb3BlID0gc2NvcGU7ICAgICAgICAgICAgICAgCisgICAgICAgICAgICB9OworICAgICAgICAgICAgdGhpcy50b2dnbGUgPSBmdW5jdGlvbigpeyAgICAgICAgICAgICAKKyAgICAgICAgICAgICAgIGJvZHlTY29wZS5pc09wZW4gPSAhYm9keVNjb3BlLmlzT3BlbjsKKyAgICAgICAgICAgICAgIHJldHVybiBib2R5U2NvcGUuaXNPcGVuOworICAgICAgICAgICAgfTsKKyAgICAgICAgfV0sCisgICAgICAgIAorICAgICAgICBsaW5rOiBmdW5jdGlvbihzY29wZSwgZWxlbWVudCwgYXR0cnMsIGFjY29yZGlvbkN0cmwpCisgICAgICAgIHsgICAgICAgICAgIAorICAgICAgICAgICAgc2NvcGUuaXNPcGVuID0gZmFsc2U7CisgICAgICAgICAgICBlbGVtZW50LmJpbmQoJ2NsaWNrJywgZnVuY3Rpb24oKSAKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBzY29wZS5pc09wZW4gPSAhc2NvcGUuaXNPcGVuOyAKKyAgICAgICAgICAgIH0pOworICAgICAgICB9ICAgICAgICAgCisgICAgfTsKK30pCisKKy5kaXJlY3RpdmUoJ2V4cGFuZGVySGVhZGluZycsZnVuY3Rpb24oKXsKKyAgIAorICAgIHJldHVybnsKKyAgICAgICAgcmVxdWlyZToiXmV4cGFuZGVycyIsCisgICAgICAgIHJlc3RyaWN0OiAnRUEnLAorICAgICAgICByZXBsYWNlOnRydWUsCisgICAgICAgIHRyYW5zY2x1ZGU6dHJ1ZSwKKyAgICAgICAgc2NvcGU6dHJ1ZSwKKyAgICAgICAgdGVtcGxhdGU6ICI8ZGl2IHN0eWxlPSdwYWRkaW5nOjEwcHggIWltcG9ydGFudCcgbmctdHJhbnNjbHVkZT48L2Rpdj4iCisgICAgfTsKKyAgICAKK30pCisKKy5kaXJlY3RpdmUoJ2V4cGFuZGVyQm9keScsZnVuY3Rpb24oKXsKKyAgIAorICAgIHJldHVybnsKKyAgICAgICAgcmVzdHJpY3Q6ICdFQScsCisgICAgICAgIHJlcXVpcmU6Il5leHBhbmRlcnMiLAorICAgICAgICByZXBsYWNlOnRydWUsCisgICAgICAgIHRyYW5zY2x1ZGU6dHJ1ZSwKKyAgICAgICAgc2NvcGU6e30sCisgICAgICAgIHRlbXBsYXRlOiAiPGRpdiBjb2xsYXBzZT0nIWlzT3Blbic+PGRpdiBuZy10cmFuc2NsdWRlPjwvZGl2PjwvZGl2PiIsICAgICAgICAKKyAgICAgICAgbGluazpmdW5jdGlvbihzY29wZSwgZWxlbSwgYXR0ciwgbXlDdHJsKXsgICAgICAgICAgICAKKyAgICAgICAgICBzY29wZS5pc09wZW4gPSBmYWxzZTsgCisgICAgICAgICAgbXlDdHJsLnNldFNjb3BlKHNjb3BlKTsKKyAgICAgICAgfSAgIAorICAgIH07Cit9KQorCisuZGlyZWN0aXZlKCdleHBhbmRlclRvZ2dsZScsZnVuY3Rpb24oKXsKKyAgIAorICAgcmV0dXJueworICAgICAgICByZXN0cmljdDogJ0VBJywKKyAgICAgICAgcmVxdWlyZToiXmV4cGFuZGVycyIsCisgICAgICAgIHNjb3BlOnsKKyAgICAgICAgICAgIGV4cGFuZEljb246J0AnLAorICAgICAgICAgICAgY29sbGFwc2VJY29uOidAJworICAgICAgICB9LAorICAgICAgICBsaW5rOiBmdW5jdGlvbihzY29wZSwgZWxlbWVudCwgYXR0ciwgbXlDdHJsKQorICAgICAgICB7ICAgICAgCisgICAgICAgICAgICB2YXIgaXNPcGVuPWZhbHNlOyAgICAgICAgICAgICAgICAgICAgICAgCisgICAgICAgICAgICB2YXIgc2V0SWNvbiA9IGZ1bmN0aW9uKCl7ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKKyAgICAgICAgICAgICAgICBpZihzY29wZS5leHBhbmRJY29uICYmIHNjb3BlLmNvbGxhcHNlSWNvbikKKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgIGlmKGlzT3BlbikgeworICAgICAgICAgICAgICAgICAgICAgICAgZWxlbWVudC5yZW1vdmVDbGFzcyhzY29wZS5leHBhbmRJY29uKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIGVsZW1lbnQuYWRkQ2xhc3Moc2NvcGUuY29sbGFwc2VJY29uKTsKKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICBlbHNlIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIGVsZW1lbnQucmVtb3ZlQ2xhc3Moc2NvcGUuY29sbGFwc2VJY29uKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIGVsZW1lbnQuYWRkQ2xhc3Moc2NvcGUuZXhwYW5kSWNvbik7ICAgICAgICAgICAgICAgICAgICAgICAgCisgICAgICAgICAgICAgICAgICAgIH0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9OyAgICAKKyAgICAgICAgICAgICAgICAgICAgICAgIAorICAgICAgICAgICAgZWxlbWVudC5iaW5kKCJrZXlkb3duIiwgZnVuY3Rpb24oZSl7CisgICAgICAgICAgICAgICAgaWYoZS5rZXlDb2RlID09PSAxMykKKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgIHNjb3BlLnRvZ2dsZWl0KCk7CisgICAgICAgICAgICAgICAgfSAgICAgICAgICAgICAgICAKKyAgICAgICAgICAgIH0pOyAKKyAgICAgICAgICAgICAgICAgICAgICAgIAorICAgICAgICAgICAgZWxlbWVudC5iaW5kKCdjbGljaycsIGZ1bmN0aW9uKCkgCisgICAgICAgICAgICB7IAorICAgICAgICAgICAgICAgIHNjb3BlLnRvZ2dsZWl0KCk7ICAgICAgICAgICAgICAgIAorICAgICAgICAgICAgfSk7IAorICAgICAgICAgICAgCisgICAgICAgICAgICBzY29wZS50b2dnbGVpdCA9IGZ1bmN0aW9uKCkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgaXNPcGVuID0gbXlDdHJsLnRvZ2dsZSgpOworICAgICAgICAgICAgICAgICBzZXRJY29uKCk7CisgICAgICAgICAgICAgICAgIHNjb3BlLiRhcHBseSgpOworICAgICAgICAgICAgfTsgICAgICAgICAgICAKKyAgICAgICAgICAgIHNldEljb24oKTsKKyAgICAgICAgfSAgICAgICAgICAgICAgICAKKyAgICB9OyAgICAgICAgICAgICAKK30pCisgICAgICAgIAorLmRpcmVjdGl2ZSgnY29sbGFwc2UnLCBbJyR0cmFuc2l0aW9uJywgZnVuY3Rpb24oJHRyYW5zaXRpb24pIHsKKyAgLy8gQ1NTIHRyYW5zaXRpb25zIGRvbid0IHdvcmsgd2l0aCBoZWlnaHQ6IGF1dG8sIHNvIHdlIGhhdmUgdG8gbWFudWFsbHkgY2hhbmdlIHRoZSBoZWlnaHQgdG8gYQorICAvLyBzcGVjaWZpYyB2YWx1ZSBhbmQgdGhlbiBvbmNlIHRoZSBhbmltYXRpb24gY29tcGxldGVzLCB3ZSBjYW4gcmV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yAgICAgICAgLy8gMS4gUGFyZW50IGlzIHNldCB0byBkaXNwbGF5IG5vbmUKKyAgICAgICAgLy8gMi4gYW5ndWxhciBiaW5kaW5ncyBpbnNpZGUgYXJlIHJlc29sdmVkCisgICAgICAgIC8vV2hlbiB3ZSBoYXZlIGEgY2hhbmdlIG9mIHNjcm9sbEhlaWdodCB3ZSBhcmUgc2V0dGluZyBhZ2FpbiB0aGUgY29ycmVjdCBoZWlnaHQgaWYgdGhlIGdyb3VwIGlzIG9wZW5lZAorICAgICAgICBpZiAoZWxlbWVudFswXS5zY3JvbGxIZWlnaHQgIT09IDApIHsKKyAgICAgICAgICBpZiAoIWlzQ29sbGFwc2VkKSB7CisgICAgICAgICAgICBpZiAoaW5pdGlhbEFuaW1Ta2lwKSB7CisgICAgICAgICAgICAgIGZpeFVwSGVpZ2h0KHNjb3BlLCBlbGVtZW50LCBlbGVtZW50WzBdLnNjcm9sbEhlaWdodCArICdweCcpOworICAgICAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgICAgZml4VXBIZWlnaHQoc2NvcGUsIGVsZW1lbnQsICdhdXRvJyk7CisgICAgICAgICAgICB9CisgICAgICAgICAgfQorICAgICAgICB9CisgICAgICB9KTsKKyAgICAgIAorICAgICAgc2NvcGUuJHdhdGNoKGF0dHJzLmNvbGxhcHNlLCBmdW5jdGlvbih2YWx1ZSkgeworICAgICAgICBpZiAodmFsdWUpIHsKKyAgICAgICAgICBjb2xsYXBzZSgpOworICAgICAgICB9IGVsc2UgeworICAgICAgICAgIGV4cGFuZCgpOworICAgICAgICB9CisgICAgICB9KTsKKyAgICAgIAorCisgICAgICB2YXIgY3VycmVudFRyYW5zaXRpb247CisgICAgICB2YXIgZG9UcmFuc2l0aW9uID0gZnVuY3Rpb24oY2hhbmdlKSB7CisgICAgICAgIGlmICggY3VycmVudFRyYW5zaXRpb24gKSB7CisgICAgICAgICAgY3VycmVudFRyYW5zaXRpb24uY2FuY2VsKCk7CisgICAgICAgIH0KKyAgICAgICAgY3VycmVudFRyYW5zaXRpb24gPSAkdHJhbnNpdGlvbihlbGVtZW50LGNoYW5nZSk7CisgICAgICAgIGN1cnJlbnRUcmFuc2l0aW9uLnRoZW4oCisgICAgICAgICAgZnVuY3Rpb24oKSB7IGN1cnJlbnRUcmFuc2l0aW9uID0gdW5kZWZpbmVkOyB9LAorICAgICAgICAgIGZ1bmN0aW9uKCkgeyBjdXJyZW50VHJhbnNpdGlvbiA9IHVuZGVmaW5lZDsgfQorICAgICAgICApOworICAgICAgICByZXR1cm4gY3VycmVudFRyYW5zaXRpb247CisgICAgICB9OworCisgICAgICB2YXIgZXhwYW5kID0gZnVuY3Rpb24oKSB7CisgICAgICAgIC8vZWxlbWVudC5zaG93KCk7CisgICAgICAgICAgc2NvcGUucG9zdFRyYW5zaXRpb24gPSB0cnVlOworICAgICAgICBpZiAoaW5pdGlhbEFuaW1Ta2lwKSB7CisgICAgICAgICAgaW5pdGlhbEFuaW1Ta2lwID0gZmFsc2U7CisgICAgICAgICAgaWYgKCAhaXNDb2xsYXBzZWQgKSB7CisgICAgICAgICAgICBmaXhVcEhlaWdodChzY29wZSwgZWxlbWVudCwgJ2F1dG8nKTsKKyAgICAgICAgICB9CisgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgLy9kb1RyYW5zaXRpb24oeyBoZWlnaHQgOiBlbGVtZW50WzBdLnNjcm9sbEhlaWdodCArICdweCcgfSkKKyAgICAgICAgICBkb1RyYW5zaXRpb24oYW5ndWxhci5leHRlbmQoeyBoZWlnaHQgOiBlbGVtZW50WzBdLnNjcm9sbEhlaWdodCArICdweCcgfSwgcHJvcHMub3BlbikpCisgICAgICAgICAgLnRoZW4oZnVuY3Rpb24oKSB7CisgICAgICAgICAgICAvLyBUaGlzIGNoZWNrIGVuc3VyZXMgdGhhdCB3ZSBkb24ndCBhY2NpZGVudGFsbHkgdXBkYXRlIHRoZSBoZWlnaHQgaWYgdGhlIHVzZXIgaGFzIGNsb3NlZAorICAgICAgICAgICAgLy8gdGhlIGdyb3VwIHdoaWxlIHRoZSBhbmltYXRpb24gd2FzIHN0aWxsIHJ1bm5pbmcKKyAgICAgICAgICAgIGlmICggIWlzQ29sbGFwc2VkICkgCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgIGZpeFVwSGVpZ2h0KHNjb3BlLCBlbGVtZW50LCAnYXV0bycpOworICAgICAgICAgICAgfQorICAgICAgICAgIH0pOworICAgICAgICB9CisgICAgICAgIGlzQ29sbGFwc2VkID0gZmFsc2U7CisgICAgICB9OworICAgICAgCisgICAgICB2YXIgY29sbGFwc2UgPSBmdW5jdGlvbigpIHsKKyAgICAgICAgaXNDb2xsYXBzZWQgPSB0cnVlOworICAgICAgICBpZiAoaW5pdGlhbEFuaW1Ta2lwKSB7CisgICAgICAgICAgaW5pdGlhbEFuaW1Ta2lwID0gZmFsc2U7CisgICAgICAgICAgZml4VXBIZWlnaHQoc2NvcGUsIGVsZW1lbnQsIDApOworICAgICAgICB9IGVsc2UgeworICAgICAgICAgIGZpeFVwSGVpZ2h0KHNjb3BlLCBlbGVtZW50LCBlbGVtZW50WzBdLnNjcm9sbEhlaWdodCArICdweCcpOworICAgICAgICAgIC8vZG9UcmFuc2l0aW9uKHsnaGVpZ2h0JzonMCd9KS50aGVuKGZ1bmN0aW9uKCkgeworICAgICAgICAgICAgZG9UcmFuc2l0aW9uKGFuZ3VsYXIuZXh0ZW5kKHtoZWlnaHQ6MH0sIHByb3BzLmNsb3NlZCkpLnRoZW4oZnVuY3Rpb24oKSB7CisgICAgICAgICAgICAgIC8vZWxlbWVudC5oaWRlKCk7CisgICAgICAgICAgICAgIHNjb3BlLnBvc3RUcmFuc2l0aW9uID0gZmFsc2U7CisgICAgICAgICAgfSk7CisgICAgICAgIH0KKyAgICAgIH07CisgICAgfQorICB9OworfV0pCisuZGlyZWN0aXZlKCdhdHRBY2NvcmQnLCBmdW5jdGlvbigpeworICAgIHJldHVybiB7CisgICAgICAgIHJlc3RyaWN0OiAnRUEnLAorICAgICAgICB0cmFuc2NsdWRlOiB0cnVlLAorICAgICAgICByZXBsYWNlOnRydWUsCisgICAgICAgIHNjb3BlOiB7fSwKKyAgICAgICAgY29udHJvbGxlcjogJ0F0dEFjY29yZEN0cmwnLAorICAgICAgICB0ZW1wbGF0ZVVybDogJ2FwcC9zY3JpcHRzL25nX2pzX2F0dF90cGxzL2FjY29yZGlvbi9hdHRBY2NvcmRIZWFkZXIuaHRtbCcsCisgICAgICAgIGxpbms6IGZ1bmN0aW9uKHNjb3BlLGVsZW1lbnQsYXR0cixjdHJscyl7CisgICAgICAgIH0KKyAgICB9Cit9KQorLmNvbnRyb2xsZXIoJ0F0dEFjY29yZEN0cmwnLCBbJyRzY29wZScsIGZ1bmN0aW9uKCRzY29wZSl7CisKKyAgICB0aGlzLnR5cGU9J2F0dEFjY29yZCc7CisgICAgdGhpcy5oZWFkZXJDdHJsOworICAgIHRoaXMuYm9keUN0cmw7CisgICAgdmFyIGlzT3BlbiA9IHRydWU7CisKKyAgICB0aGlzLnRvZ2dsZUJvZHkgPSBmdW5jdGlvbigpeworICAgICAgICBpZihpc09wZW4pCisgICAgICAgICAgICB0aGlzLmV4cGFuZEJvZHkoKTsKKyAgICAgICAgZWxzZQorICAgICAgICAgICAgdGhpcy5jb2xsYXBzZUJvZHkoKTsKKworICAgICAgICBpc09wZW4gPSAhaXNPcGVuOworICAgIH07CisKKyAgICB0aGlzLmV4cGFuZEJvZHkgPSBmdW5jdGlvbigpeworICAgICAgICB0aGlzLmJvZHlDdHJsLmV4cGFuZCgpOworICAgIH07CisKKyAgICB0aGlzLmNvbGxhcHNlQm9keSA9IGZ1bmN0aW9uKCl7CisgICAgICAgIHRoaXMuYm9keUN0cmwuY29sbGFwc2UoKTsKKyAgICB9CisKK31dKQorLmNvbnRyb2xsZXIoJ0F0dEFjY29yZEhlYWRlckN0cmwnLFsnJHNjb3BlJywgZnVuY3Rpb24oJHNjb3BlKXsKKyAgICB0aGlzLnR5cGU9J2hlYWRlcic7Cit9XSkKKy5kaXJlY3RpdmUoJ2F0dEFjY29yZEhlYWRlcicsIGZ1bmN0aW9uKCl7CisgICAgcmV0dXJuIHsKKyAgICAgICAgcmVzdHJpY3Q6ICdFQScsCisgICAgICAgIHRyYW5zY2x1ZGU6IHRydWUsCisgICAgICAgIHJlcGxhY2U6dHJ1ZSwKKyAgICAgICAgcmVxdWlyZTpbJ15hdHRBY2NvcmQnLCdhdHRBY2NvcmRIZWFkZXInXSwKKyAgICAgICAgY29udHJvbGxlcjogJ0F0dEFjY29yZEhlYWRlckN0cmwnLAorICAgICAgICB0ZW1wbGF0ZVVybDogJ2FwcC9zY3JpcHRzL25nX2pzX2F0dF90cGxzL2FjY29yZGlvbi9hdHRBY2NvcmRIZWFkZXIuaHRtbCcsCisgICAgICAgIGxpbms6IGZ1bmN0aW9uKHNjb3BlLGVsZW1lbnQsYXR0ciwgY3RybHMpeworICAgICAgICAgICAgdmFyIGF0dEFjY29yZEN0cmwgPSBjdHJsc1swXTsKKyAgICAgICAgICAgIHZhciBhdHRBY2NvcmRIZWFkZXJDdHJsID0gY3RybHNbMV07CisgICAgICAgICAgICBhdHRBY2NvcmRDdHJsLmhlYWRlckN0cmwgPSBhdHRBY2NvcmRIZWFkZXJDdHJsOworCisgICAgICAgICAgICBzY29wZS5jbGlja0Z1bmMgPSBmdW5jdGlvbigpeworICAgICAgICAgICAgICAgIGF0dEFjY29yZEN0cmwudG9nZ2xlQm9keSgpOworICAgICAgICAgICAgfTsKKworICAgICAgICB9CisgICAgfQorfSkKKy5jb250cm9sbGVyKCdBdHRBY2NvcmRCb2R5Q3RybCcsIFsnJHNjb3BlJywgZnVuY3Rpb24oJHNjb3BlKXsKKyAgICB0aGlzLnR5cGU9J2JvZHknOworCisgICAgdGhpcy5leHBhbmQgPSBmdW5jdGlvbigpeworICAgICAgICAkc2NvcGUuZXhwYW5kKCk7CisgICAgfTsKKworICAgIHRoaXMuY29sbGFwc2UgPSBmdW5jdGlvbigpeworICAgICAgICAkc2NvcGUuY29sbGFwc2UoKTsKKyAgICB9OworCit9XSkKKy5kaXJlY3RpdmUoJ2F0dEFjY29yZEJvZHknLCBbJyR0aW1lb3V0JywgJyRoZWlnaHQnLGZ1bmN0aW9uKCR0aW1lb3V0LCRoZWlnaHQpeworICAgIHJldHVybiB7CisgICAgICAgIHJlc3RyaWN0OiAnRUEnLAorICAgICAgICB0cmFuc2NsdWRlOiB0cnVlLAorICAgICAgICByZXBsYWNlOnRydWUsCisgICAgICAgIHJlcXVpcmU6IFsnXmF0dEFjY29yZCcsJ2F0dEFjY29yZEJvZHknXSwKKyAgICAgICAgY29udHJvbGxlcjogJ0F0dEFjY29yZEJvZHlDdHJsJywKKyAgICAgICAgdGVtcGxhdGVVcmw6ICdhcHAvc2NyaXB0cy9uZ19qc19hdHRfdHBscy9hY2NvcmRpb24vYXR0QWNjb3JkQm9keS5odG1sJywKKyAgICAgICAgbGluazogZnVuY3Rpb24oc2NvcGUsZWxlbWVudCxhdHRyLGN0cmxzKXsKKworICAgICAgICAgICAgdmFyIGF0dEFjY29yZEN0cmwgPSBjdHJsc1swXTsKKyAgICAgICAgICAgIHZhciBhdHRBY2NvcmRCb2R5Q3RybCA9IGN0cmxzWzFdOworICAgICAgICAgICAgYXR0QWNjb3JkQ3RybC5ib2R5Q3RybCA9IGF0dEFjY29yZEJvZHlDdHJsOworCisgICAgICAgICAgICB2YXIgb3JpZ2luYWxIZWlnaHQ7IAorICAgICAgICAgICAgJHRpbWVvdXQoZnVuY3Rpb24oKXsKKyAgICAgICAgICAgICAgICBvcmlnaW5hbEhlaWdodCA9IGVsZW1lbnRbMF0ub2Zmc2V0SGVpZ2h0OworICAgICAgICAgICAgICAgICRoZWlnaHQoZWxlbWVudCwwLDAsMCk7CisgICAgICAgICAgICB9KTsKKworICAgICAgICAgICAgc2NvcGUuZXhwYW5kID0gZnVuY3Rpb24oKXsKKyAgICAgICAgICAgICAgICAkaGVpZ2h0KGVsZW1lbnQsMC4wNSxvcmlnaW5hbEhlaWdodCwxKTsKKyAgICAgICAgICAgIH07CisKKyAgICAgICAgICAgIHNjb3BlLmNvbGxhcHNlID0gZnVuY3Rpb24oKXsKKyAgICAgICAgICAgICAgICAkaGVpZ2h0KGVsZW1lbnQsMC4yNSwwLDApOworICAgICAgICAgICAgfTsKKworICAgICAgICB9IAorICAgIH0KK31dKQorYW5ndWxhci5tb2R1bGUoJ2F0dC5hYnMuYWxlcnQnLCBbXSkKKy5kaXJlY3RpdmUoJ2F0dEFsZXJ0JywgW2Z1bmN0aW9uKCkKK3sKKyAgICByZXR1cm4geworICAgICAgICByZXN0cmljdDogJ0VBJywgICAgICAgIAorICAgICAgICByZXBsYWNlIDogdHJ1ZSwKKyAgICAgICAgdHJhbnNjbHVkZSA6IHRydWUsCisgICAgICAgIHNjb3BlOiB7CisgICAgICAgICAgICBhbGVydFR5cGUgOiAiQHR5cGUiLAorICAgICAgICAgICAgc2hvd1RvcCA6ICJAdG9wUG9zIiwKKyAgICAgICAgICAgIHNob3dBbGVydCA6ICI9IgorICAgICAgICB9LAorICAgICAgIHRlbXBsYXRlVXJsIDogJ2FwcC9zY3JpcHRzL25nX2pzX2F0dF90cGxzL2FsZXJ0L2FsZXJ0Lmh0bWwnLAorICAgICAgIGxpbms6IGZ1bmN0aW9uKHNjb3BlLCBlbGVtLCBhdHRyLCBjdHJsKQorICAgICAgICB7CisgICAgICAgICAgICBpZihzY29wZS5zaG93VG9wID09PSAndHJ1ZScpeworICAgICAgICAgICAgICAgIHNjb3BlLmNzc1N0eWxlID0geyd0b3AnOic1MHB4J307CisgICAgICAgICAgICB9CisgICAgICAgICAgICBlbHNleworICAgICAgICAgICAgICAgc2NvcGUuY3NzU3R5bGUgPSB7J3RvcCc6JzBweCd9OworICAgICAgICAgICAgfQorICAgICAgICAgICBzY29wZS5jbG9zZSA9IGZ1bmN0aW9uKCl7CisgICAgICAgICAgICAgICBzY29wZS5zaG93QWxlcnQgPSBmYWxzZTsKKyAgICAgICAgICAgIH07CisgICAgICAgIH0KKyAgICB9OworfV0pOworCithbmd1bGFyLm1vZHVsZSgnYXR0LmFicy5icmVhZENydW1icycsIFtdKQorICAgIC5jb25zdGFudCgiY2xhc3NDb25zdGFudCIseworICAgICAgICAgICAgImRlZmF1bHRDbGFzcyIgOiAiYnJlYWRjcnVtYnNfX2xpbmsiLAorICAgICAgICAgICAgImFjdGl2ZUNsYXNzIjogImJyZWFkY3J1bWJzX19saW5rLS1hY3RpdmUiCisgICAgICAgIH0pCisuZGlyZWN0aXZlKCdhdHRDcnVtYicsIFsnY2xhc3NDb25zdGFudCcsIGZ1bmN0aW9uKGNsYXNzQ29uc3RhbnQpCit7CisgICAgcmV0dXJuIHsKKyAgICAgICAgcmVzdHJpY3Q6ICdBJywgICAgICAgIAorICAgICAgICByZXBsYWNlIDogdHJ1ZSwKKyAgICAgICAgdHJhbnNjbHVkZSA6IHRydWUsCisgICAgICAgIHNjb3BlOiB7fSwKKyAgICAgICAgbGluazogZnVuY3Rpb24oc2NvcGUsIGVsZW0sIGF0dHIsIGN0cmwpCisgICAgICAgIHsKKyAgICAgICAgICAgIGVsZW0uYWRkQ2xhc3MoY2xhc3NDb25zdGFudC5kZWZhdWx0Q2xhc3MpOworICAgICAgICAgICAgaWYoYXR0ci5hdHRDcnVtYiA9PT0gJ2FjdGl2ZScpeworICAgICAgICAgICAgICAgICBlbGVtLmFkZENsYXNzKGNsYXNzQ29uc3RhbnQuYWN0aXZlQ2xhc3MpOworICAgICAgICAgICAgfQorICAgICAgICAgICBpZighZWxlbS5oYXNDbGFzcygnbGFzdCcpKXsKKyAgICAgICAgICAgICAgIGVsZW0uYXBwZW5kKCc8aSBjbGFzcz0iYnJlYWRjcnVtYnNfX2l0ZW0iPjwvaT4nKTsKKyAgICAgICAgICAgfQorICAgICAgICB9CisgICAgfTsKK30KK10pOworCithbmd1bGFyLm1vZHVsZSgnYXR0LmFicy51dGlsaXRpZXMnLCBbXSkKKworLmZpbHRlcignaGlnaGxpZ2h0JywgZnVuY3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ICAgICBmaW5hbEFycmF5ID0gYWN0dWFsQXJyYXk7CisgICAgICAgIH0KKyAgICAgICAgcmV0dXJuIGZpbmFsQXJyYXk7CisgICAgfQorfSkKKworLmRpcmVjdGl2ZSgnYXR0SW5wdXREZW55JywgW2Z1bmN0aW9uKCkgeworICAgIHJldHVybiB7CisgICAgICAgIHJlc3RyaWN0OiAnQScsCisgICAgICAgIHJlcXVpcmU6ICduZ01vZGVsJywKKyAgICAgICAgbGluazogZnVuY3Rpb24gKHNjb3BlLCBlbGVtLCBhdHRyLCBjdHJsKSB7CisgICAgICAgICAgICB2YXIgcmVnZXhFeHByZXNzaW9uID0gbnVsbDsKKyAgICAgICAgICAgIGF0dHIuJG9ic2VydmUoJ2F0dElucHV0RGVueScsIGZ1bmN0aW9uICh2YWx1ZSkgeworICAgICAgICAgICAgICAgIGlmICh2YWx1ZSkgeworICAgICAgICAgICAgICAgICAgICByZWdleEV4cHJlc3Npb24gPSBuZXcgUmVnRXhwKHZhbHVlLCAnZycpOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0pOworICAgICAgICAgICAgZWxlbS5iaW5kKCdpbnB1dCcsIGZ1bmN0aW9uICgpIHsKKyAgICAgICAgICAgICAgICB2YXIgaW5wdXRTdHJpbmcgPSBjdHJsLiR2aWV3VmFsdWUgJiYgY3RybC4kdmlld1ZhbHVlLnJlcGxhY2UocmVnZXhFeHByZXNzaW9uLCAnJyk7CisgICAgICAgICAgICAgICAgaWYgKGlucHV0U3RyaW5nICE9PSBjdHJsLiR2aWV3VmFsdWUpIHsKKyAgICAgICAgICAgICAgICAgICAgY3RybC4kc2V0Vmlld1ZhbHVlKGlucHV0U3RyaW5nKTsKKyAgICAgICAgICAgICAgICAgICAgY3RybC4kcmVuZGVyKCk7CisgICAgICAgICAgICAgICAgICAgIHNjb3BlLiRhcHBseSgpOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0pOworICAgICAgICB9CisgICAgfTsKK31dKQorCisuZGlyZWN0aXZlKCdhdHRBY2Nlc3NpYmlsaXR5Q2xpY2snLCBbZnVuY3Rpb24oKSB7CisgICAgcmV0dXJuIHsKKyAgICAgICAgcmVzdHJpY3Q6ICdBJywKKyAgICAgICAgbGluazogZnVuY3Rpb24gKHNjb3BlLCBlbGVtLCBhdHRyLCBjdHJsKSB7CisgICAgICAgICAgICB2YXIga2V5Q29kZSA9IFtdOworICAgICAgICAgICAgYXR0ci4kb2JzZXJ2ZSgnYXR0QWNjZXNzaWJpbGl0eUNsaWNrJywgZnVuY3Rpb24gKHZhbHVlKSB7CisgICAgICAgICAgICAgICAgaWYgKHZhbHVlKSB7CisgICAgICAgICAgICAgICAgICAgIGtleUNvZGUgPSB2YWx1ZS5zcGxpdCgnLCcpOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0pOworICAgICAgICAgICAgZWxlbS5iaW5kKCdrZXlkb3duJywgZnVuY3Rpb24gKGV2KSB7CisgICAgICAgICAgICAgICAgaWYoa2V5Q29kZS5sZW5ndGggPiAwICYmICgoZXYuY2hhckNvZGUgJiYga2V5Q29kZS5pbmRleE9mKGV2LmNoYXJDb2RlLnRvU3RyaW5nKCkpID4gLTEpIHx8IChldi5rZXlDb2RlICYmIGtleUNvZGUuaW5kZXhPZihldi5rZXlDb2RlLnRvU3RyaW5nKCkpID4gLTEpIHx8IChldi53aGljaCAmJiBrZXlDb2RlLmluZGV4T2YoZXYud2hpY2gudG9TdHJpbmcoKSkgPiAtMSkpKSB7CisgICAgICAgICAgICAgICAgICAgIGVsZW1bMF0uY2xpY2soKTsKKyAgICAgICAgICAgICAgICAgICAgZXYucHJldmVudERlZmF1bHQoKTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9KTsKKyAgICAgICAgfQorICAgIH07Cit9XSkKKworLmRpcmVjdGl2ZSgnYXR0RWxlbWVudEZvY3VzJywgW2Z1bmN0aW9uKCkgeworICAgIHJldHVybiB7CisgICAgICAgIHJlc3RyaWN0OiAnQScsCisgICAgICAgIGxpbms6IGZ1bmN0aW9uKHNjb3BlLCBlbGVtLCBhdHRyLCBjdHJsKSB7CisgICAgICAgICAgICBzY29wZS4kd2F0Y2goYXR0ci5hdHRFbGVtZW50Rm9jdXMsIGZ1bmN0aW9uICh2YWx1ZSkgeworICAgICAgICAgICAgICAgIGlmICh2YWx1ZSA9PT0gdHJ1ZSkgeworICAgICAgICAgICAgICAgICAgICBlbGVtWzBdLmZvY3VzKCk7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfSk7CisgICAgICAgIH0KKyAgICB9OworfV0pCisuZmFjdG9yeSgnZXZlbnRzJywgZnVuY3Rpb24oKXsKKyAgICB2YXIgcyA9ICBmdW5jdGlvbihlKXsKKyAgICAgICAgaWYoZS5zdG9wUHJvcGFnYXRpb24pIHsKKyAgICAgICAgICAgIGUuc3RvcFByb3BhZ2F0aW9uKCk7CisgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICBlLnJldHVyblZhbHVlID0gZmFsc2U7CisgICAgICAgIH0gICAgCisgICAgfTsKKworICAgIHJldHVybiB7CisgICAgICAgIHN0b3BQcm9wYWdhdGlvbjogcworICAgIH07Cit9KQorLmZhY3RvcnkoJyRkb2N1bWVudEJpbmQnLCBbJyRkb2N1bWVudCcsICckdGltZW91dCcsIGZ1bmN0aW9uKCRkb2N1bWVudCwgJHRpbWVvdXQpIHsKKyAgICB2YXIgX2NsaWNrID0gZnVuY3Rpb24gKGZsYWcsIGNhbGxiYWNrRnVuYywgc2NvcGUpIHsKKyAgICAgICAgc2NvcGUuJHdhdGNoKGZsYWcsIGZ1bmN0aW9uICh2YWwpIHsKKyAgICAgICAgICAgICR0aW1lb3V0KGZ1bmN0aW9uICgpIHsKKyAgICAgICAgICAgICAgICBpZiAodmFsKSB7CisgICAgICAgICAgICAgICAgICAgICRkb2N1bWVudC5iaW5kKCdjbGljaycsIGNhbGxiYWNrRnVuYyk7CisgICAgICAgICAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgICAgICAgICAgJGRvY3VtZW50LnVuYmluZCgnY2xpY2snLCBjYWxsYmFja0Z1bmMpOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0pOworICAgICAgICB9KTsKKyAgICB9OworCisgICAgcmV0dXJuIHsKKyAgICAgICAgY2xpY2s6IF9jbGljaworICAgIH07Cit9XSk7CisKKyhmdW5jdGlvbiAoKSB7CisgICAgU3RyaW5nLnByb3RvdHlwZS50b1NuYWtlQ2FzZSA9IGZ1bmN0aW9uICgpIHsKKyAgICAgICAgcmV0dXJuIHRoaXMucmVwbGFjZSgvKFtBLVpdKS9nLCBmdW5jdGlvbiAoJDEpIHsKKyAgICAgICAgICAgIHJldHVybiAiLSIgKyAkMS50b0xvd2VyQ2FzZSgpOworICAgICAgICB9KTsKKyAgICB9OworICAgIAorICAgIHZhciBjb25jYXQgPSBmdW5jdGlvbiAoY2hhcmFjdGVyLCB0aW1lcykgeworICAgICAgICBjaGFyYWN0ZXIgPSBjaGFyYWN0ZXIgfHwgJyc7CisgICAgICAgIHRpbWVzID0gKCFpc05hTih0aW1lcykgJiYgdGltZXMpIHx8IDA7CisgICAgICAgIHZhciBmaW5hbENoYXIgPSAnJzsKKyAgICAgICAgZm9yICh2YXIgaSA9IDA7IGkgPCB0aW1lczsgaSsrKSB7CisgICAgICAgICAgICBmaW5hbENoYXIgKz0gY2hhcmFjdGVyOworICAgICAgICB9CisKKyAgICAgICAgcmV0dXJuIGZpbmFsQ2hhcjsKKyAgICB9OworICAgIAorICAgIHZhciBwYWQgPSBmdW5jdGlvbiAoYWN0dWFsU3RyaW5nLCB3aWR0aCwgY2hhcmFjdGVyLCBkaXJlY3Rpb24pIHsgLy8gZGlyZWN0aW9uOiB0cnVlIGZvciBsZWZ0IGFuZCBmYWxzZSBmb3IgcmlnaHQKKyAgICAgICAgYWN0dWFsU3RyaW5nID0gYWN0dWFsU3RyaW5nIHx8ICcnOworICAgICAgICB3aWR0aCA9ICghaXNOYU4od2lkdGg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ZW5ndGg7IGluZGV4KyspIHsKKyAgICAgICAgICAgICAgICBpZiAodGhpc1tpbmRleF0gPT09IHZhbCkgeworICAgICAgICAgICAgICAgICAgICByZXR1cm4gaW5kZXg7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfQorICAgICAgICAgICAgcmV0dXJuIC0xOworICAgICAgICB9OworICAgIH0KK30pKCk7CisKK2FuZ3VsYXIubW9kdWxlKCdhdHQuYWJzLmJ1dHRvbnMnLCBbJ2F0dC5hYnMucG9zaXRpb24nLCAnYXR0LmFicy51dGlsaXRpZXMnXSkKKy5jb25zdGFudCgnYnRuQ29uZmlnJywgeworICAgIGJ0bkNsYXNzOiAnYnV0dG9uJywKKyAgICBidG5QcmltYXJ5Q2xhc3M6ICdidXR0b24tLXByaW1hcnknLAorICAgIGJ0blNlY29uZGFyeUNsYXNzOiAnYnV0dG9uLS1zZWNvbmRhcnknLAorICAgIGJ0bkRpc2FibGVkQ2xhc3M6ICdidXR0b24tLWluYWN0aXZlJywKKyAgICBidG5TbWFsbENsYXNzOiAnYnV0dG9uLS1zbWFsbCcKK30pCisuZGlyZWN0aXZlKCdhdHRCdXR0b24nLCBbJ2J0bkNvbmZpZycsIGZ1bmN0aW9uKGJ0bkNvbmZpZykgeworICAgIHJldHVybiB7CisgICAgICAgIHJlc3RyaWN0OiAnQScsCisgICAgICAgIGxpbms6IGZ1bmN0aW9uIChzY29wZSwgZWxlbWVudCwgYXR0cnMsIGN0cmwpIHsKKyAgICAgICAgICAgIGVsZW1lbnQuYWRkQ2xhc3MoYnRuQ29uZmlnLmJ0bkNsYXNzKTsKKyAgICAgICAgICAgIGlmIChhdHRycy5zaXplID09PSAnc21hbGwnKSB7CisgICAgICAgICAgICAgICAgZWxlbWVudC5hZGRDbGFzcyhidG5Db25maWcuYnRuU21hbGxDbGFzcyk7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBhdHRycy4kb2JzZXJ2ZSgnYnRuVHlwZScsIGZ1bmN0aW9uKHZhbHVlKSB7CisgICAgICAgICAgICAgICAgaWYgKHZhbHVlID09PSAncHJpbWFyeScpIHsKKyAgICAgICAgICAgICAgICAgICAgZWxlbWVudC5hZGRDbGFzcyhidG5Db25maWcuYnRuUHJpbWFyeUNsYXNzKTsKKyAgICAgICAgICAgICAgICAgICAgZWxlbWVudC5yZW1vdmVDbGFzcyhidG5Db25maWcuYnRuU2Vjb25kYXJ5Q2xhc3MpOworICAgICAgICAgICAgICAgICAgICBlbGVtZW50LnJlbW92ZUNsYXNzKGJ0bkNvbmZpZy5idG5EaXNhYmxlZENsYXNzKTsKKyAgICAgICAgICAgICAgICAgICAgZWxlbWVudC5yZW1vdmVBdHRyKCdkaXNhYmxlZCcpOworICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAodmFsdWUgPT09ICdzZWNvbmRhcnknKSB7CisgICAgICAgICAgICAgICAgICAgIGVsZW1lbnQuYWRkQ2xhc3MoYnRuQ29uZmlnLmJ0blNlY29uZGFyeUNsYXNzKTsKKyAgICAgICAgICAgICAgICAgICAgZWxlbWVudC5yZW1vdmVDbGFzcyhidG5Db25maWcuYnRuUHJpbWFyeUNsYXNzKTsKKyAgICAgICAgICAgICAgICAgICAgZWxlbWVudC5yZW1vdmVDbGFzcyhidG5Db25maWcuYnRuRGlzYWJsZWRDbGFzcyk7CisgICAgICAgICAgICAgICAgICAgIGVsZW1lbnQucmVtb3ZlQXR0cignZGlzYWJsZWQnKTsKKyAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKHZhbHVlID09PSAnZGlzYWJsZWQnKSB7CisgICAgICAgICAgICAgICAgICAgIGVsZW1lbnQuYWRkQ2xhc3MoYnRuQ29uZmlnLmJ0bkRpc2FibGVkQ2xhc3MpOworICAgICAgICAgICAgICAgICAgICBlbGVtZW50LnJlbW92ZUNsYXNzKGJ0bkNvbmZpZy5idG5QcmltYXJ5Q2xhc3MpOworICAgICAgICAgICAgICAgICAgICBlbGVtZW50LnJlbW92ZUNsYXNzKGJ0bkNvbmZpZy5idG5TZWNvbmRhcnlDbGFzcyk7CisgICAgICAgICAgICAgICAgICAgIGVsZW1lbnQuYXR0cignZGlzYWJsZWQnLCAnZGlzYWJsZWQnKTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9KTsKKyAgICAgICAgfQorICAgIH07Cit9XSkKKy5kaXJlY3RpdmUoJ2F0dEJ1dHRvbkxvYWRlcicsIFtmdW5jdGlvbiAoKSB7CisgICAgcmV0dXJuIHsKKyAgICAgICAgcmVzdHJpY3Q6ICdBJywKKyAgICAgICAgcmVwbGFjZTogZmFsc2UsCisgICAgICAgIHNjb3BlOiB7CisgICAgICAgICAgICBzaXplOiAnQCcKKyAgICAgICAgfSwKKyAgICAgICAgdGVtcGxhdGU6ICc8ZGl2IG5nLWNsYXNzPSJ7XCdidXR0b24tLWxvYWRpbmdcJzogc2l6ZSA9PT0gXCdsYXJnZVwnLFwnYnV0dG9uLS1sb2FkaW5nX19zbWFsbFwnOiBzaXplID09PSBcJ3NtYWxsXCd9Ij48aT48L2k+PGk+PC9pPjxpPjwvaT48L2Rpdj4nLAorICAgICAgICBsaW5rOiBmdW5jdGlvbiAoc2NvcGUsIGVsZW1lbnQsIGF0dHJzLCBjdHJsKSB7CisgICAgICAgICAgICBlbGVtZW50LmFkZENsYXNzKCdidXR0b24gYnV0dG9uLS1pbmFjdGl2ZScpOworICAgICAgICB9CisgICAgfTsKK31dKS5kaXJlY3RpdmUoJ2F0dEJ1dHRvbkhlcm8nLCBbZnVuY3Rpb24gKCkgeworICAgIHJldHVybiB7CisgICAgICAgIHJlc3RyaWN0OiAnQScsCisgICAgICAgIHJlcGxhY2U6IGZhbHNlLAorICAgICAgICB0cmFuc2NsdWRlOiB0cnVlLAorICAgICAgICBzY29wZTogeworICAgICAgICAgICAgaWNvbjogJ0AnCisgICAgICAgIH0sCisgICAgICAgIHRlbXBsYXRlOiAnPGRpdiBjbGFzcz0iYnV0dG9uLS1oZXJvX19pbm5lciI+PHNwYW4gbmctdHJh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gICAgICAgICAgICAgaWYoc2hvdyA9PT0gdHJ1ZSB8fCBzaG93ID09PSBmYWxzZSkgeworICAgICAgICAgICAgICAgICAgICAgICAgc2NvcGUuaXNPcGVuID0gc2hvdzsKKyAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIHNjb3BlLmlzT3BlbiA9ICFzY29wZS5pc09wZW47CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICB9OworCisgICAgICAgICAgICAgICAgc2NvcGUudG9nZ2xlRHJvcGRvd25DaXJjbGUgPSBmdW5jdGlvbigkZXZlbnQpeworICAgICAgICAgICAgICAgICAgICB0b2dnbGUoZmFsc2UpOworICAgICAgICAgICAgICAgIH07CisKKyAgICAgICAgICAgICAgICBzY29wZS50b2dnbGVEcm9wZG93biA9IGZ1bmN0aW9uKCRldmVudCl7CisgICAgICAgICAgICAgICAgICAgIHRvZ2dsZSgpOworICAgICAgICAgICAgICAgIH07CisKKyAgICAgICAgICAgICAgICB2YXIgb3V0c2lkZUNsaWNrID0gZnVuY3Rpb24gKGUpIHsKKyAgICAgICAgICAgICAgICAgICAgdmFyIGlzRWxlbWVudCA9ICRpc0VsZW1lbnQoYW5ndWxhci5lbGVtZW50KGUudGFyZ2V0KSwgZWxlbWVudCwgJGRvY3VtZW50KTsKKyAgICAgICAgICAgICAgICAgICAgaWYoIWlzRWxlbWVudCkgeworICAgICAgICAgICAgICAgICAgICAgICAgdG9nZ2xlKGZhbHNlKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIHNjb3BlLiRhcHBseSgpOworICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgfTsKKworICAgICAgICAgICAgICAgICRkb2N1bWVudEJpbmQuY2xpY2soJ2lzT3BlbicsIG91dHNpZGVDbGljaywgc2NvcGUpOworICAgICAgICAgICAgfQorICAgICAgICB9OworfV0pOworCithbmd1bGFyLm1vZHVsZSgnYXR0LmFicy5jaGVja2JveCcsIFtdKQorLmNvbnN0YW50KCJhdHRDaGVja2JveENvbmZpZyIsIHsKKyAgICBhY3RpdmVDbGFzcyA6ICJhdHQtY2hlY2tib3gtLW9uIiwKKyAgICBkaXNhYmxlZENsYXNzIDogImF0dC1jaGVja2JveC0tZGlzYWJsZWQiCit9KQorLmRpcmVjdGl2ZSgnY2hlY2tib3hMaW1pdCcsIFsnJGNvbXBpbGUnLCAiYXR0Q2hlY2tib3hDb25maWciLCBmdW5jdGlvbiAoJGNvbXBpbGUsIGF0dENoZWNrYm94Q29uZmlnKSB7CityZXR1cm4geworICAgIHNjb3BlOiB7CisgICAgICAgIGNoZWNrYm94TGltaXQ6Jz0nLAorICAgICAgICBzZWxlY3RMaW1pdDonQD8nLAorICAgICAgICBtYXhTZWxlY3RlZDonJj8nCisgICAgfSwKKyAgICByZXN0cmljdDogJ0EnLAorICAgIHJlcXVpcmU6J2NoZWNrYm94TGltaXQnLAorICAgICBjb250cm9sbGVyOiBbJyRzY29wZScsICckZWxlbWVudCcsICckYXR0cnMnLCBmdW5jdGlvbigkc2NvcGUsICRlbGVtZW50LCAkYXR0cnMpIAorICAgIHsKKyAgICAgICAgJHNjb3BlLmxpbWl0PXRydWU7CisgICAgICAgIHRoaXMuZ2V0TWF4TGltaXRzPWZ1bmN0aW9uKCl7CisgICAgICAgICAgICByZXR1cm4gJHNjb3BlLmxpbWl0OworICAgICAgICB9OworICAgICAgICB0aGlzLnNldE1heExpbWl0cz1mdW5jdGlvbih2YWx1ZSl7CisgICAgICAgICAgICAkc2NvcGUubGltaXQ9dmFsdWU7CisgICAgICAgIH07CisgICAgICAgIHRoaXMubWF4Q2hlY2tib3hTZWxlY3RlZD1mdW5jdGlvbigpeworICAgICAgICAgICAgJHNjb3BlLm1heFNlbGVjdGVkKCk7CisgICAgICAgIH07CisgICAgfV0sCisgICAgbGluazogZnVuY3Rpb24gKHNjb3BlLCBlbGVtZW50LCBhdHRyaWJ1dGUsIGN0cmwpIHsKKyAgICAgICAgc2NvcGUuJHdhdGNoKCdjaGVja2JveExpbWl0JywgZnVuY3Rpb24oKQorICAgICAgICB7CisgICAgICAgICAgICB2YXIgY291bnRUcnVlID0gMDsKKyAgICAgICAgICAgIGZvciAodmFyIGtleXMgaW4gc2NvcGUuY2hlY2tib3hMaW1pdCkgeworICAgICAgICAgICAgICAgIGlmIChzY29wZS5jaGVja2JveExpbWl0Lmhhc093blByb3BlcnR5KGtleXMpKSB7CisgICAgICAgICAgICAgICAgICAgIGlmIChzY29wZS5jaGVja2JveExpbWl0W2tleXNdID09PSB0cnVlKSB7CisgICAgICAgICAgICAgICAgICAgICAgICBjb3VudFRydWUgPSBjb3VudFRydWUgKyAxOworICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfTsKKyAgICAgICAgICAgIGlmKGNvdW50VHJ1ZT49cGFyc2VJbnQoc2NvcGUuc2VsZWN0TGltaXQpKXsKKyAgICAgICAgICAgICAgICBjdHJsLnNldE1heExpbWl0cyhmYWxzZSk7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBlbHNleworICAgICAgICAgICAgICAgIGN0cmwuc2V0TWF4TGltaXRzKHRydWUpOworICAgICAgICAgICAgfQorICAgICAgICAgICAgfSwgdHJ1ZSk7CisgICAgfQorfTsKK31dKQorLmRpcmVjdGl2ZSgnYXR0Q2hlY2tib3gnLCBbJyRjb21waWxlJywgImF0dENoZWNrYm94Q29uZmlnIiwgZnVuY3Rpb24gKCRjb21waWxlLCBhdHRDaGVja2JveENvbmZpZykgeworICAgIHJldHVybiB7CisgICAgICAgIHNjb3BlOiB7fSwKKyAgICAgICAgcmVzdHJpY3Q6ICdBJywKKyAgICAgICAgcmVxdWlyZTogWyduZ01vZGVsJywnXj9jaGVja2JveExpbWl0J10sCisgICAgICAgIGxpbms6IGZ1bmN0aW9uIChzY29wZSwgZWxlbWVudCwgYXR0cmlidXRlLCBjdHJsKSB7CisgICAgICAgICAgICB2YXIgbmdDdHJsID0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QpOworICAgICAgICAgICAgfTsKKworICAgICAgICAgICAgLy91aS0+bW9kZWwKKyAgICAgICAgICAgIHNjb3BlLnVwZGF0ZU1vZGVsID0gZnVuY3Rpb24gKGV2dCkgeworICAgICAgICAgICAgICAgIGlmICghc2NvcGUuZGlzYWJsZWQpIHsKKyAgICAgICAgICAgICAgICAgICAgbmdDdHJsLiRzZXRWaWV3VmFsdWUoZWxlbWVudC5wYXJlbnQoKS5oYXNDbGFzcyhhdHRDaGVja2JveENvbmZpZy5hY3RpdmVDbGFzcykgPyBmYWxzZSA6IHRydWUpOworICAgICAgICAgICAgICAgICAgICBpZihjaGVja2JveExpbWl0Q3RybCAmJiAhKGNoZWNrYm94TGltaXRDdHJsLmdldE1heExpbWl0cygpKSl7CisgICAgICAgICAgICAgICAgICAgICAgICBpZihuZ0N0cmwuJG1vZGVsVmFsdWU9PT1mYWxzZSl7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgbmdDdHJsLiRyZW5kZXIoKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgIGVsc2V7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgY2hlY2tib3hMaW1pdEN0cmwubWF4Q2hlY2tib3hTZWxlY3RlZCgpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIG5nQ3RybC4kc2V0Vmlld1ZhbHVlKGVsZW1lbnQucGFyZW50KCkuaGFzQ2xhc3MoYXR0Q2hlY2tib3hDb25maWcuYWN0aXZlQ2xhc3MpID8gdHJ1ZSA6IGZhbHNlKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICBlbHNleworICAgICAgICAgICAgICAgICAgICAgICAgbmdDdHJsLiRyZW5kZXIoKTsKKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICBldnQucHJldmVudERlZmF1bHQoKTsKKyAgICAgICAgICAgIH07CisKKyAgICAgICAgICAgIGF0dHJpYnV0ZS4kb2JzZXJ2ZSgnZGlzYWJsZWQnLCBmdW5jdGlvbih2YWwpIHsKKyAgICAgICAgICAgICAgICBzY29wZS5kaXNhYmxlZCA9ICh2YWwgPT09IHRydWUgfHwgdmFsID09PSAiZGlzYWJsZWQiIHx8IHZhbCA9PT0gInRydWUiKTsKKyAgICAgICAgICAgICAgICBlbGVtZW50LnBhcmVudCgpLnRvZ2dsZUNsYXNzKGF0dENoZWNrYm94Q29uZmlnLmRpc2FibGVkQ2xhc3MsIHNjb3BlLmRpc2FibGVkKTsKKyAgICAgICAgICAgICAgICBlbGVtZW50LnBhcmVudCgpLmF0dHIoInRhYmluZGV4Iiwgc2NvcGUuZGlzYWJsZWQgPyAiLTEiIDogIjAiKTsKKyAgICAgICAgICAgIH0pOworICAgICAgICB9CisgICAgfTsKK31dKQorLmRpcmVjdGl2ZSgnY2hlY2tib3hHcm91cCcsIFsnJGNvbXBpbGUnLGZ1bmN0aW9uKCRjb21waWxlKSB7CisgICAgcmV0dXJuIHsKKyAgICAgICAgc2NvcGU6CisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgY2hlY2tib3hHcm91cDogIj0iLAorICAgICAgICAgICAgICAgIGNoZWNrYm94R3JvdXBWYWx1ZTogIj0/IgorICAgICAgICAgICAgfSwKKyAgICAgICAgcmVzdHJpY3Q6ICdBJywKKyAgICAgICAgbGluazogZnVuY3Rpb24oc2NvcGUsIGVsZW1lbnQsIGF0dHJpYnV0ZSwgY3RybCkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBzY29wZS5jaGVja2JveFN0YXRlID0gJ25vbmUnOworICAgICAgICAgICAgICAgIHNjb3BlLmNoZWNrYm94R3JvdXBWYWx1ZT0iaW5kZXRlcm1pbmF0ZSI7CisgICAgICAgICAgICAgICAgZWxlbWVudC5jc3Moe2Rpc3BsYXk6J25vbmUnfSk7CisgICAgICAgICAgICAgICAgZWxlbWVudC53cmFwKCRjb21waWxlKCc8ZGl2IHRhYmluZGV4PSIwIiByb2xlPSJjaGVja2JveCIgYXR0LWFjY2Vzc2liaWxpdHktY2xpY2s9IjEzLDMyIiBuZy1jbGljaz0idXBkYXRlTW9kZWwoJGV2ZW50KSIgY2xhc3M9ImF0dC1jaGVja2JveCI+PC9kaXY+Jykoc2NvcGUpKTsKKyAgICAgICAgICAgICAgICBlbGVtZW50LnBhcmVudCgpLmFwcGVuZCgnPGRpdiBjbGFzcz0iYXR0LWNoZWNrYm94X19pbmRpY2F0b3IiPjwvZGl2PicpOworICAgICAgICAgICAgICAgIGVsZW1lbnQucGFyZW50KCkuYXR0cigidGl0bGUiLCBhdHRyaWJ1dGUudGl0bGUpOworICAgICAgICAgICAgICAgIHNjb3BlLiR3YXRjaCgnY2hlY2tib3hTdGF0ZScsIGZ1bmN0aW9uKHZhbCkgeworICAgICAgICAgICAgICAgICAgICBpZiAodmFsID09PSAnYWxsJykgeworICAgICAgICAgICAgICAgICAgICAgICAgZWxlbWVudC5wYXJlbnQoKS5hZGRDbGFzcygnYXR0LWNoZWNrYm94LS1vbicpOworICAgICAgICAgICAgICAgICAgICAgICAgZWxlbWVudC5wYXJlbnQoKS5yZW1vdmVDbGFzcygnYXR0LWNoZWNrYm94LS1pbmRldGVybWluYXRlJyk7CisgICAgICAgICAgICAgICAgICAgICAgICBlbGVtZW50LnBhcmVudCgpLmF0dHIoImFyaWEtY2hlY2tlZCIsIHRydWUpOworICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgIGVsc2UgaWYgKHZhbCA9PT0gJ25vbmUnKSB7CisgICAgICAgICAgICAgICAgICAgICAgICBlbGVtZW50LnBhcmVudCgpLnJlbW92ZUNsYXNzKCdhdHQtY2hlY2tib3gtLW9uJyk7CisgICAgICAgICAgICAgICAgICAgICAgICBlbGVtZW50LnBhcmVudCgpLnJlbW92ZUNsYXNzKCdhdHQtY2hlY2tib3gtLWluZGV0ZXJtaW5hdGUnKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIGVsZW1lbnQucGFyZW50KCkuYXR0cigiYXJpYS1jaGVja2VkIiwgZmFsc2UpOworICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgIGVsc2UgaWYgKHZhbCA9PT0gJ2luZGV0ZXJtaW5hdGUnKSB7CisgICAgICAgICAgICAgICAgICAgICAgICBlbGVtZW50LnBhcmVudCgpLnJlbW92ZUNsYXNzKCdhdHQtY2hlY2tib3gtLW9uJyk7CisgICAgICAgICAgICAgICAgICAgICAgICBlbGVtZW50LnBhcmVudCgpLmFkZENsYXNzKCdhdHQtY2hlY2tib3gtLWluZGV0ZXJtaW5hdGUnKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIGVsZW1lbnQucGFyZW50KCkuYXR0cigiYXJpYS1jaGVja2VkIiwgdHJ1ZSk7CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICB9KTsKKworICAgICAgICAgICAgICAgIHNjb3BlLnVwZGF0ZU1vZGVsID0gZnVuY3Rpb24oZXZ0KQorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgaWYgKGVsZW1lbnQucGFyZW50KCkuaGFzQ2xhc3MoJ2F0dC1jaGVja2JveC0tb24nKSkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGVsZW1lbnQucGFyZW50KCkucmVtb3ZlQ2xhc3MoJ2F0dC1jaGVja2JveC0tb24nKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBmb3IgKHZhciBrZXlzIGluIHNjb3BlLmNoZWNrYm94R3JvdXApIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHNjb3BlLmNoZWNrYm94R3JvdXAuaGFzT3duUHJvcGVydHkoa2V5cykpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNjb3BlLmNoZWNrYm94R3JvdXBba2V5c10gPSBmYWxzZTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgICAgIH07CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICBlbHNlIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIGVsZW1lbnQucGFyZW50KCkuYWRkQ2xhc3MoJ2F0dC1jaGVja2JveC0tb24nKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIGZvciAodmFyIGtleXMgaW4gc2NvcGUuY2hlY2tib3hHcm91cCkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChzY29wZS5jaGVja2JveEdyb3VwLmhhc093blByb3BlcnR5KGtleXMpKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNjb3BlLmNoZWNrYm94R3JvdXBba2V5c10gPSB0cnVlOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgIH07CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgZXZ0LnByZXZlbnREZWZhdWx0KCk7CisgICAgICAgICAgICAgICAgfTsKKyAgICAgICAgICAgICAgICBzY29wZS4kd2F0Y2goJ2NoZWNrYm94R3JvdXBWYWx1ZScsIGZ1bmN0aW9uICh2YWx1ZSkgeworICAgICAgICAgICAgICAgICAgICBpZiAodmFsdWUgPT09IGZhbHNlKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgZWxlbWVudC5wYXJlbnQoKS5yZW1vdmVDbGFzcygnYXR0LWNoZWNrYm94LS1vbicpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZvciAodmFyIGtleXMgaW4gc2NvcGUuY2hlY2tib3hHcm91cCkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoc2NvcGUuY2hlY2tib3hHcm91cC5oYXNPd25Qcm9wZXJ0eShrZXlzKSkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNjb3BlLmNoZWNrYm94R3JvdXBba2V5c10gPSBmYWxzZTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgICAgIH07CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICBlbHNlIGlmICh2YWx1ZSA9PT0gdHJ1ZSl7CisgICAgICAgICAgICAgICAgICAgICAgICBlbGVtZW50LnBhcmVudCgpLmFkZENsYXNzKCdhdHQtY2hlY2tib3gtLW9uJyk7CisgICAgICAgICAgICAgICAgICAgICAgICBmb3IgKHZhciBrZXlzIGluIHNjb3BlLmNoZWNrYm94R3JvdXApIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoc2NvcGUuY2hlY2tib3hHcm91cC5oYXNPd25Qcm9wZXJ0eShrZXlzKSkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2NvcGUuY2hlY2tib3hHcm91cFtrZXlzXSA9IHRydWU7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgfTsKKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIH0pOworICAgICAgICAgICAgc2NvcGUuJHdhdGNoKCdjaGVja2JveEdyb3VwJywgZnVuY3Rpb24oKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIHZhciBjb3VudFRydWUgPSAwOworICAgICAgICAgICAgICAgIHZhciBjb3VudEZhbHNlID0gMDsKKyAgICAgICAgICAgICAgICB2YXIgY291bnQgPSAwOworICAgICAgICAgICAgICAgIGZvciAodmFyIGtleXMgaW4gc2NvcGUuY2hlY2tib3hHcm91cCkgeworICAgICAgICAgICAgICAgICAgICBpZiAoc2NvcGUuY2hlY2tib3hHcm91cC5oYXNPd25Qcm9wZXJ0eShrZXlzKSkgeworICAgICAgICAgICAgICAgICAgICAgICAgY291bnQgPSBjb3VudCArIDE7CisgICAgICAgICAgICAgICAgICAgICAgICBpZiAoc2NvcGUuY2hlY2tib3hHcm91cFtrZXlzXSA9PT0gdHJ1ZSkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvdW50VHJ1ZSA9IGNvdW50VHJ1ZSArIDE7CisgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICBlbHNlIGlmIChzY29wZS5jaGVja2JveEdyb3VwW2tleXNdID09PSBmYWxzZSkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvdW50RmFsc2UgPSBjb3VudEZhbHNlICsgMTsKKyAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIH07CisgICAgICAgICAgICAgICAgaWYgKGNvdW50ID09PSBjb3VudFRydWUpIHsKKyAgICAgICAgICAgICAgICAgICAgc2NvcGUuY2hlY2tib3hTdGF0ZSA9ICJhbGwiOworICAgICAgICAgICAgICAgICAgICAgc2NvcGUuY2hlY2tib3hHcm91cFZhbHVlPXRydWU7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIGVsc2UgaWYgKGNvdW50ID09PSBjb3VudEZhbHNlKSB7CisgICAgICAgICAgICAgICAgICAgIHNjb3BlLmNoZWNrYm94U3RhdGUgPSAibm9uZSI7CisgICAgICAgICAgICAgICAgICAgIHNjb3BlLmNoZWNrYm94R3JvdXBWYWx1ZT1mYWxzZTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgZWxzZSB7CisgICAgICAgICAgICAgICAgICAgIHNjb3BlLmNoZWNrYm94U3RhdGUgPSAiaW5kZXRlcm1pbmF0ZSI7CisgICAgICAgICAgICAgICAgICAgIHNjb3BlLmNoZWNrYm94R3JvdXBWYWx1ZT0iaW5kZXRlcm1pbmF0ZSI7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIH0sIHRydWUpOworICAgICAgICB9CisgICAgfTsKK31dKTsKKworYW5ndWxhci5tb2R1bGUoJ2F0dC5hYnMuY29sb3JzZWxlY3RvcicsIFtdKQorICAgIC5kaXJlY3RpdmUoJ2NvbG9yU2VsZWN0b3JXcmFwcGVyJywgW2Z1bmN0aW9uKCkgeworICAgICAgICByZXR1cm4geworICAgICAgICAgICAgc2NvcGU6IHsKKyAgICAgICAgICAgICAgICBzZWxlY3RlZDogJz0nLAorICAgICAgICAgICAgICAgIGljb25Db2xvcjogJ0AnCisgICAgICAgICAgICB9LAorICAgICAgICAgICAgcmVzdHJpY3Q6ICdBRScsCisgICAgICAgICAgICB0cmFuc2NsdWRlOiB0cnVlLAorICAgICAgICAgICAgdGVtcGxhdGVVcmw6ICdhcHAvc2NyaXB0cy9uZ19qc19hdHRfdHBscy9jb2xvcnNlbGVjdG9yL2NvbG9yc2VsZWN0b3IuaHRtbCcsCisgICAgICAgICAgICBsaW5rOiBmdW5jdGlvbihzY29wZSwgZWxlbWVudCwgYXR0cikgeworICAgICAgICAgICAgICAgIHNjb3BlLmFwcGx5Y29sb3IgPSB7J2JhY2tncm91bmQtY29sb3InOiBzY29wZS5pY29uQ29sb3J9OworICAgICAgICAgICAgICAgIHNjb3BlLnNlbGVjdGVkY29sb3IgPSBmdW5jdGlvbihpY29uQ29sb3IpIHsKKyAgICAgICAgICAgICAgICAgICAgc2NvcGUuc2VsZWN0ZWQgPSBpY29uQ29sb3I7CisgICAgICAgICAgICAgICAgfTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfTsKKyAgICAgfV0pCisgICAgLmRpcmVjdGl2ZSgnY29sb3JTZWxlY3RvcicsIFsnJGNvbXBpbGUnLCBmdW5jdGlvbigkY29tcGlsZSkgeworICAgICAgICByZXR1cm57CisgICAgICAgICAgICByZXN0cmljdDogJ0EnLAorICAgICAgICAgICAgc2NvcGU6IHsKKyAgICAgICAgICAgICAgICBjb2xvclNlbGVjdG9yOiAnQCcsCisgICAgICAgICAgICAgICAgbmdNb2RlbDogJz0nCisgICAg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T2Yoa2V5KSAhPT0gLTEgJiYgYW5ndWxhci5pc0RlZmluZWQodmFsKSkgeworICAgICAgICAgICAgICAgICAgICBlbGVtLmF0dHIoa2V5LnRvU25ha2VDYXNlKCksIGtleSk7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgfTsKKworICAgIHZhciBiaW5kU2NvcGUgPSBmdW5jdGlvbiAoYXR0ciwgc2NvcGUpIHsKKyAgICAgICAgaWYgKGFuZ3VsYXIuaXNEZWZpbmVkKGF0dHIpICYmIGF0dHIgIT09IG51bGwgJiYgYW5ndWxhci5pc0RlZmluZWQoc2NvcGUpICYmIHNjb3BlICE9PSBudWxsKSB7CisgICAgICAgICAgICB2YXIgZXZhbEZ1bmN0aW9uID0gZnVuY3Rpb24gKGtleSwgdmFsKSB7CisgICAgICAgICAgICAgICAgc2NvcGVba2V5XSA9IHNjb3BlLiRwYXJlbnQuJGV2YWwodmFsKTsKKyAgICAgICAgICAgIH07CisgICAgICAgICAgICAKKyAgICAgICAgICAgIHZhciB3YXRjaEZ1bmN0aW9uID0gZnVuY3Rpb24gKGtleSwgdmFsKSB7CisgICAgICAgICAgICAgICAgc2NvcGUuJHBhcmVudC4kd2F0Y2godmFsLCBmdW5jdGlvbiAodmFsdWUpIHsKKyAgICAgICAgICAgICAgICAgICAgc2NvcGVba2V5XSA9IHZhbHVlOworICAgICAgICAgICAgICAgIH0pOworICAgICAgICAgICAgICAgIHNjb3BlLiR3YXRjaChrZXksIGZ1bmN0aW9uICh2YWx1ZSkgeworICAgICAgICAgICAgICAgICAgICBzY29wZS4kcGFyZW50W3ZhbF0gPSB2YWx1ZTsKKyAgICAgICAgICAgICAgICB9KTsKKyAgICAgICAgICAgIH07CisKKyAgICAgICAgICAgIHZhciBldmFsQXR0cmlidXRlcyA9IGRhdGVwaWNrZXJDb25maWcuZGF0ZXBpY2tlckV2YWxBdHRyaWJ1dGVzOworICAgICAgICAgICAgdmFyIHdhdGNoQXR0cmlidXRlcyA9IGRhdGVwaWNrZXJDb25maWcuZGF0ZXBpY2tlcldhdGNoQXR0cmlidXRlczsKKyAgICAgICAgICAgIGZvciAodmFyIGtleSBpbiBhdHRyKSB7CisgICAgICAgICAgICAgICAgdmFyIHZhbCA9IGF0dHJba2V5XTsKKyAgICAgICAgICAgICAgICBpZiAoZXZhbEF0dHJpYnV0ZXMuaW5kZXhPZihrZXkpICE9PSAtMSAmJiBhbmd1bGFyLmlzRGVmaW5lZCh2YWwpKSB7CisgICAgICAgICAgICAgICAgICAgIGV2YWxGdW5jdGlvbihrZXksIHZhbCk7CisgICAgICAgICAgICAgICAgfSBlbHNlIGlmICh3YXRjaEF0dHJpYnV0ZXMuaW5kZXhPZihrZXkpICE9PSAtMSAmJiBhbmd1bGFyLmlzRGVmaW5lZCh2YWwpKSB7CisgICAgICAgICAgICAgICAgICAgIHdhdGNoRnVuY3Rpb24oa2V5LCB2YWwpOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgIH07CisKKyAgICB2YXIgdmFsaWRhdGVEYXRlU3RyaW5nID0gZnVuY3Rpb24gKGRhdGVTdHJpbmcsIGRhdGVGb3JtYXQpIHsKKyAgICAgICAgaWYgKGRhdGVTdHJpbmcgJiYgZGF0ZUZvcm1hdCkgeworICAgICAgICAgICAgdmFyIGRlbGltaXRlcjsKKyAgICAgICAgICAgIGlmIChkYXRlRm9ybWF0LmluZGV4T2YoJy8nKSAhPT0gLTEpIHsKKyAgICAgICAgICAgICAgICBkZWxpbWl0ZXIgPSAnLyc7CisgICAgICAgICAgICB9IGVsc2UgaWYgKGRhdGVGb3JtYXQuaW5kZXhPZignLScpICE9PSAtMSkgeworICAgICAgICAgICAgICAgIGRlbGltaXRlciA9ICctJzsKKyAgICAgICAgICAgIH0gZWxzZSBpZiAoZGF0ZUZvcm1hdC5pbmRleE9mKCcuJykgIT09IC0xKSB7CisgICAgICAgICAgICAgICAgZGVsaW1pdGVyID0gJy4nOworICAgICAgICAgICAgfQorCisgICAgICAgICAgICB2YXIgZGF0ZVN0cmluZ0FycmF5ID0gZGF0ZVN0cmluZy5zcGxpdChkZWxpbWl0ZXIpOworICAgICAgICAgICAgdmFyIGRhdGVGb3JtYXRBcnJheSA9IGRhdGVGb3JtYXQuc3BsaXQoZGVsaW1pdGVyKTsKKyAgICAgICAgICAgIGlmIChkYXRlU3RyaW5nQXJyYXkubGVuZ3RoICE9PSBkYXRlRm9ybWF0QXJyYXkubGVuZ3RoKSB7CisgICAgICAgICAgICAgICAgcmV0dXJuIGZhbHNlOworICAgICAgICAgICAgfQorCisgICAgICAgICAgICBmb3IgKHZhciBpID0gMDsgaSA8IGRhdGVTdHJpbmdBcnJheS5sZW5ndGg7IGkrKykgeworICAgICAgICAgICAgICAgIGRhdGVTdHJpbmdBcnJheVtpXSA9IGRhdGVTdHJpbmdBcnJheVtpXS5sUGFkKGRhdGVGb3JtYXRBcnJheVtpXS5sZW5ndGgsICcwJyk7CisgICAgICAgICAgICB9CisgICAgICAgICAgICB2YXIgaW50ZXJtZWRpYXRlRGF0ZVN0cmluZyA9IGRhdGVTdHJpbmdBcnJheS5qb2luKGRlbGltaXRlcik7CisKKyAgICAgICAgICAgIHZhciBhY3R1YWxEYXRlU3RyaW5nID0gZGF0ZUZpbHRlcihuZXcgRGF0ZShpbnRlcm1lZGlhdGVEYXRlU3RyaW5nKSwgZGF0ZUZvcm1hdCk7CisgICAgICAgICAgICBpZiAoaW50ZXJtZWRpYXRlRGF0ZVN0cmluZyA9PT0gYWN0dWFsRGF0ZVN0cmluZykgeworICAgICAgICAgICAgICAgIHJldHVybiB0cnVlOworICAgICAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgICAgICByZXR1cm4gZmFsc2U7CisgICAgICAgICAgICB9CisgICAgICAgIH0KKyAgICB9OworCisgICAgcmV0dXJuIHsKKyAgICAgICAgc2V0QXR0cmlidXRlczogc2V0QXR0cmlidXRlcywKKyAgICAgICAgYmluZFNjb3B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worICAgICAgICAgICAgcmV0dXJuIHRydWU7CisgICAgICAgIH0KKyAgICAgICAgcmV0dXJuIGZhbHNlOworICAgIH0KKworICAgIGZ1bmN0aW9uIGlzV2Vla2VuZChkYXRlKSB7CisgICAgICAgIGlmIChkYXRlRmlsdGVyKGRhdGUsIGZvcm1hdC5kYXlIZWFkZXIpID09PSAiU2F0dXJkYXkiIHx8IGRhdGVGaWx0ZXIoZGF0ZSwgZm9ybWF0LmRheUhlYWRlcikgPT09ICJTdW5kYXkiKSB7CisgICAgICAgICAgICByZXR1cm4gdHJ1ZTsKKyAgICAgICAgfQorICAgICAgICByZXR1cm4gZmFsc2U7CisgICAgfQorCisgICAgZnVuY3Rpb24gaXNUb2RheShkYXRlKSB7CisgICAgICAgIGlmIChjb21wYXJlKGRhdGUsICRzY29wZS5yZXNldFRpbWUobmV3IERhdGUoKSkpID09PSAwKSB7CisgICAgICAgICAgICByZXR1cm4gdHJ1ZTsKKyAgICAgICAgfQorICAgICAgICByZXR1cm4gZmFsc2U7CisgICAgfQkKKyAgICBmdW5jdGlvbiBpc0ZvY3VzZWQoZGF0ZSkgeworICAgICAgICBpZiAoZGF0ZSAmJiBhbmd1bGFyLmlzRGF0ZSgkc2NvcGUuZm9jdXNlZERhdGUpICYmIGNvbXBhcmUoZGF0ZSwgJHNjb3BlLmZvY3VzZWREYXRlKSA9PT0gMCkgeworICAgICAgICAgICAgcmV0dXJuIHRydWU7CisgICAgICAgIH0KKyAgICAgICAgcmV0dXJuIGZhbHNlOworICAgIH0KKworICAgIHZhciBpc0Rpc2FibGVkID0gdGhpcy5pc0Rpc2FibGVkID0gZnVuY3Rpb24oZGF0ZSkgeworICAgICAgICBpZiAoZm9ybWF0LmRpc2FibGVXZWVrZW5kID09PSB0cnVlICYmIChkYXRlRmlsdGVyKGRhdGUsIGZvcm1hdC5kYXlIZWFkZXIpID09PSAiU2F0dXJkYXkiIHx8IGRhdGVGaWx0ZXIoZGF0ZSwgZm9ybWF0LmRheUhlYWRl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c2VsZWN0ZWQ6ICEhaXNTZWxlY3RlZCwgZnJvbTogISFpc0Zyb21EYXRlLCB0bzogISFpc1RvRGF0ZSwgZGF0ZVJhbmdlOiAhIWlzRGF0ZVJhbmdlLCBvbGRNb250aDogISFpc09sZCwgbmV4dE1vbnRoOiAhIWlzTmV3LCBkaXNhYmxlZDogISFpc0Rpc2FibGVkLCB0b2RheTogISFpc1RvZGF5LCB3ZWVrZW5kOiAhIWlzV2Vla2VuZH07CisgICAgfQorCisgICAgdGhpcy5tb2RlcyA9IFsKKyAgICAgICAgeworICAgICAgICAgICAgbmFtZTogJ2RheScsCisgICAgICAgICAgICBnZXRWaXNpYmxlRGF0ZXM6IGZ1bmN0aW9uKGRhdGUsIGNhbGVuZGFyKSB7CisgICAgICAgICAgICAgICAgdmFyIHllYXIgPSBkYXRlLmdldEZ1bGxZZWFyKCksIG1vbnRoID0gZGF0ZS5nZXRNb250aCgpLCBmaXJzdERheU9mTW9udGggPSBuZXcgRGF0ZSh5ZWFyLCBtb250aCwgMSksIGxhc3REYXlPZk1vbnRoID0gbmV3IERhdGUoeWVhciwgbW9udGgrMSwgMCk7CisgICAgICAgICAgICAgICAgdmFyIGRpZmZlcmVuY2UgPSBzdGFydGluZ0RheSAtIGZpcnN0RGF5T2ZNb250aC5nZXREYXkoKSwKKyAgICAgICAgICAgICAgICAgICAgICAgIG51bURpc3BsYXllZEZyb21QcmV2aW91c01vbnRoID0gKGRpZmZlcmVuY2UgPiAwKSA/IDcgLSBkaWZmZXJlbmNlIDogLWRpZmZlcmVuY2UsCisgICAgICAgICAgICAgICAgICAgICAgICBmaXJzdERhdGUgPSBuZXcgRGF0ZShmaXJzdERheU9mTW9udGgpLCBudW1EYXRlcyA9IDA7CisKKyAgICAgICAgICAgICAgICBpZiAobnVtRGlzcGxheWVkRnJvbVByZXZpb3VzTW9udGggPiAwKSB7CisgICAgICAgICAgICAgICAgICAgIGZpcnN0RGF0ZS5zZXREYXRlKC1udW1EaXNwbGF5ZWRGcm9tUHJldmlvdXNNb250aCArIDEpOworICAgICAgICAgICAgICAgICAgICBudW1EYXRlcyArPSBudW1EaXNwbGF5ZWRGcm9tUHJldmlvdXNNb250aDsgLy8gUHJldmlvdXMKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgbnVtRGF0ZXMgKz0gZ2V0RGF5c0luTW9udGgoeWVhciwgbW9udGggKyAxKTsgLy8gQ3VycmVudAorICAgICAgICAgICAgICAgIG51bURhdGVzICs9ICg3IC0gbnVtRGF0ZXMgJSA3KSAlIDc7IC8vIE5leHQKKworICAgICAgICAgICAgICAgIHZhciBkYXlzID0gZ2V0RGF0ZXMoZmlyc3REYXRlLCBudW1EYXRlcyksIGxhYmVscyA9IG5ldyBBcnJheSg3KTsKKyAgICAgICAgICAgICAgICBmb3IgKHZhciBpID0gMDsgaSA8IG51bURhdGVzOyBpKyspIHsKKyAgICAgICAgICAgICAgICAgICAgdmFyIGR0ID0gbmV3IERhdGUoZGF5c1tpXSk7CisgICAgICAgICAgICAgICAgICAgIGRheXNbaV0gPSBtYWtlRGF0ZShkdCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZm9ybWF0LmRheSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZm9ybWF0LmRheUhlYWRlciwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaXNGb2N1c2VkKGR0KSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaXNTZWxlY3RlZChkdCksCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlzRnJvbURhdGUoZHQpLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpc1RvRGF0ZShkdCksCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlzRGF0ZVJhbmdlKGR0KSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKG5ldyBEYXRlKGR0LmdldEZ1bGxZZWFyKCksIGR0LmdldE1vbnRoKCksIDEsIDAsIDAsIDApLmdldFRpbWUoKSA8IG5ldyBEYXRlKHllYXIsIG1vbnRoLCAxLCAwLCAwLCAwKS5nZXRUaW1lKCkpLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAobmV3IERhdGUoZHQuZ2V0RnVsbFllYXIoKSwgZHQuZ2V0TW9udGgoKSwgMSwgMCwgMCwgMCkuZ2V0VGltZSgpID4gbmV3IERhdGUoeWVhciwgbW9udGgsIDEsIDAsIDAsIDApLmdldFRpbWUoKSksCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlzRGlzYWJsZWQoZHQpLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpc1RvZGF5KGR0KSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaXNXZWVrZW5kKGR0KSk7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIGZvciAodmFyIGogPSAwOyBqIDwgNzsgaisrKSB7CisgICAgICAgICAgICAgICAgICAgIGxhYmVsc1tqXSA9IGdldExhYmVsKGRhdGVGaWx0ZXIoZGF5c1tqXS5kYXRlLCBmb3JtYXQuZGF5SGVhZGVyKSk7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIGlmIChjYWxlbmRhciA9PT0gJ3RvcCcpIHsKKyAgICAgICAgICAgICAgICAgICAgJHNjb3BlLmRpc2FibGVQcmV2VG9wID0gaXNNaW5EYXRlQXZhaWxhYmxlKGZpcnN0RGF5T2ZNb250aCwgbGFzdERheU9mTW9udGgpOworICAgICAgICAgICAgICAgICAgICAkc2NvcGUuZGlzYWJsZU5leHRUb3AgPSBpc01heERhdGVBdmFpbGFibGUoZmlyc3REYXlPZk1vbnRoLCBsYXN0RGF5T2ZNb250aCk7CisgICAgICAgICAgICAgICAgfSBlbHNlIGlmIChjYWxlbmRhciA9PT0gJ2JvdHRvbScpIHsKKyAgICAgICAgICAgICAgICAgICAgJHNjb3BlLmRpc2FibGVQcmV2Qm90dG9tID0gaXNNaW5EYXRlQXZhaWxhYmxlKGZpcnN0RGF5T2ZNb250aCwgbGFzdERheU9mTW9udGgpOworICAgICAgICAgICAgICAgICAgICAkc2NvcGUuZGlzYWJsZU5leHRCb3R0b20gPSBpc01heERhdGVBdmFpbGFibGUoZmlyc3REYXlPZk1vbnRoLCBsYXN0RGF5T2ZNb250aCk7CisgICAgICAgICAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgICAgICAgICAgJHNjb3BlLmRpc2FibGVQcmV2VG9wID0gJHNjb3BlLmRpc2FibGVQcmV2Qm90dG9tID0gaXNNaW5EYXRlQXZhaWxhYmxlKGZpcnN0RGF5T2ZNb250aCwgbGFzdERheU9mTW9udGgpOworICAgICAgICAgICAgICAgICAgICAkc2NvcGUuZGlzYWJsZU5leHRUb3AgPSAkc2NvcGUuZGlzYWJsZU5leHRCb3R0b20gPSBpc01heERhdGVBdmFpbGFibGUoZmlyc3REYXlPZk1vbnRoLCBsYXN0RGF5T2ZNb250aCk7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICRzY29wZS5kaXNhYmxlUHJldiA9ICRzY29wZS5kaXNhYmxlUHJldlRvcCB8fCAkc2NvcGUuZGlzYWJsZVByZXZCb3R0b207CisgICAgICAgICAgICAgICAgJHNjb3BlLmRpc2FibGVOZXh0ID0gJHNjb3BlLmRpc2FibGVOZXh0VG9wIHx8ICRzY29wZS5kaXNhYmxlTmV4dEJvdHRvbTsKKyAgICAgICAgICAgICAgICByZXR1cm4ge29iamVjdHM6IGRheXMsIHRpdGxlOiBkYXRlRmlsdGVyKGRhdGUsIGZvcm1hdC5kYXlUaXRsZSksIGxhYmVsczogbGFiZWxzfTsKKyAgICAgICAgICAgIH0sCQkJCQkJCisgICAgICAgICAgICBzcGxpdDogNywJCQorICAgICAgICAgICAgc3RlcDoge21vbnRoczogMX0KKyAgICAgICAgfSwJCQorCQl7CisgICAgICAgICAgICBuYW1lOiAnbW9udGgnLAorICAgICAgICAgICAgZ2V0VmlzaWJsZURhdGVzOiBmdW5jdGlvbihkYXRlLCBjYWxlbmRhcikgeworICAgICAgICAgICAgICAgIHZhciBtb250aHMgPSBuZXcgQXJyYXkoMTIpLCBsYWJlbHMgPSBbXSwgeWVhciA9IGRhdGUuZ2V0RnVsbFllYXIoKSwgbW9udGggPSBkYXRlLmdldE1vbnRoKCk7CisgICAgICAgICAgICAgICAgZm9yICh2YXIgaSA9IDA7IGkgPCAxMjsgaSsrKSB7CisgICAgICAgICAgICAgICAgICAgdmFyIGR0ID0gbmV3IERhdGUoeWVhcixpLDEpOworICAgICAgICAgICAgICAgICAgICBtb250aHNbaV0gPSBtYWtlRGF0ZShkdCwKKwkJCQkJCQkJZm9ybWF0Lm1vbnRoLAorCQkJCQkJCQlmb3JtYXQubW9udGgsCQkJCQkJCQkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaXNGb2N1c2VkKGR0KSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaXNTZWxlY3RlZChkdCksCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlzRnJvbURhdGUoZHQpLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpc1RvRGF0ZShkdCksCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlzRGF0ZVJhbmdlKGR0KSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZmFsc2UsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZhbHNlLAkJCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlzRGlzYWJsZWQoZHQpLAorCQkJCQkJCQlpc1RvZGF5KGR0KSwKKwkJCQkJCQkJZmFsc2UKKwkJCQkJCQkJKTsKKyAgICAgICAgICAgICAgICB9CQkJCQkJCisJCQkJcmV0dXJuIHtvYmplY3RzOiBtb250aHMsIHRpdGxlOiBkYXRlRmlsdGVyKGRhdGUsIGZvcm1hdC55ZWFyKSwgbGFiZWxzOiBsYWJlbHN9OworICAgICAgICAgICAgfSwgICAgICAgICAKKwkJCXNwbGl0OjMsCisgICAgICAgICAgICBzdGVwOiB7eWVhcnM6IDF9CisgICAgICAgIH0KKyAgICBdOworCQorfV0pCisKKy5kaXJlY3RpdmUoJ2RhdGVwaWNrZXInLCBbJyR0aW1lb3V0JywgZnVuY3Rpb24gKCR0aW1lb3V0KSB7CisgICAgcmV0dXJuIHsKKyAgICAgICAgcmVzdHJpY3Q6ICdFQScsCisgICAgICAgIHJlcGxhY2U6IHRydWUsCisgICAgICAgIHRyYW5zY2x1ZGU6IHRydWUsCisgICAgICAgIHRlbXBsYXRlVXJsOiAnYXBwL3NjcmlwdHMvbmdfanNfYXR0X3RwbHMvZGF0ZXBpY2tlci9kYXRlcGlja2VyLmh0bWwnLAorICAgICAgICBzY29wZTogeworICAgICAgICAgICAgY3VycmVudERhdGU6ICI9P2N1cnJlbnQiLAorICAgICAgICAgICAgZnJvbURhdGU6ICI9P2Zyb20iCisgICAgICAgIH0sCisgICAgICAgIHJlcXVpcmU6ICdkYXRlcGlja2VyJywKKyAgICAgICAgY29udHJvbGxlcjogJ0RhdGVwaWNrZXJDb250cm9sbGVyJywKKyAgICAgICAgbGluazogZnVuY3Rpb24oc2NvcGUsIGVsZW1lbnQsIGF0dHJzLCBjdHJsKSB7CisgICAgICAgICAgICB2YXIgZGF0ZXBpY2tlckN0cmwgPSBjdHJsOworICAgICAgICAgICAgdmFyIHNlbGVjdGVkLCBjYWxlbmRhclNlbGVjdGVkID0gZmFsc2U7CisgICAgICAgICAgICBzY29wZS5mb2N1c2VkRGF0ZTsKKyAgICAgICAgICAgCisgICAgICAgICAgICBzY29wZS5yZXNldFRpbWUgPSBmdW5jdGlvbihkYXRlKSB7CisgICAgICAgICAgICAgICAgdmFyIGR0OworICAgICAgICAgICAgICAgIGlmICghaXNOYU4obmV3IERhdGUoZGF0ZSkpKSB7CisgICAgICAgICAgICAgICAgICAgIGR0ID0gbmV3IERhdGUoZGF0ZSk7CisJCQkJCWlmKHNjb3BlLm1vZGUgPT09IDEpeworCQkJCQkJZHQgPSBuZXcgRGF0ZShkdC5nZXRGdWxsWWVhcigpLCBkdC5nZXRNb250aCgpKTsKKwkJCQkJfWVsc2V7CisJCQkJCQlkdCA9IG5ldyBEYXRlKGR0LmdldEZ1bGxZZWFyKCksIGR0LmdldE1vbnRoKCksIGR0LmdldERhdGUoKSk7CisJCQkJCX0KKyAgICAgICAgICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgICAgICAgICByZXR1cm4gbnVsbDsKKyAgICAgICAgICAgICAgICB9CQkJCQorICAgICAgICAgICAgICAgIHJldHVybiBkdDsKKyAgICAgICAgICAgIH07CisKKyAgICAgICAgICAgIGlmIChhdHRycy5taW4pIHsKKyAgICAgICAgICAgICAgICBzY29wZS4kcGFyZW50LiR3YXRjaChhdHRycy5taW4sIGZ1bmN0aW9uKHZhbHVlKSB7CisgICAgICAgICAgICAgICAgICAgIHNjb3BlLm1pbkRhdGUgPSB2YWx1ZSA/IHNjb3BlLnJlc2V0VGltZSh2YWx1ZSkgOiBudWxsOworICAgICAgICAgICAgICAgICAgICByZWZpbGwoKTsKKyAgICAgICAgICAgICAgICB9KTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGlmIChhdHRycy5tYXgpIHsKKyAgICAgICAgICAgICAgICBzY29wZS4kcGFyZW50LiR3YXRjaChhdHRycy5tYXgsIGZ1bmN0aW9uKHZhbHVlKSB7CisgICAgICAgICAgICAgICAgICAgIHNjb3BlLm1heERhdGUgPSB2YWx1ZSA/IHNjb3BlLnJlc2V0VGltZSh2YWx1ZSkgOiBudWxsOworICAgICAgICAgICAgICAgICAgICByZWZpbGwoKTsKKyAgICAgICAgICAgICAgICB9KTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIAorICAgICAgICAgICAgLy8gU3BsaXQgYXJyYXkgaW50byBzbWFsbGVyIGFycmF5cworICAgICAgICAgICAgZnVuY3Rpb24gc3BsaXQoYXJyLCBzaXplKSB7CisgICAgICAgICAgICAgICAgdmFyIGFycmF5cyA9IFtdOworICAgICAgICAgICAgICAgIHdoaWxlIChhcnIubGVuZ3RoID4gMCkgeworICAgICAgICAgICAgICAgICAgICBhcnJheXMucHVzaChhcnIuc3BsaWNlKDAsIHNpemUpKTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgcmV0dXJuIGFycmF5czsKKyAgICAgICAgICAgIH0KKworICAgICAgICAgICAgZnVuY3Rpb24gcmVmaWxsKGRhdGUpIHsKKyAgICAgICAgICAgICAgICBpZiAoYW5ndWxhci5pc0RhdGUoZGF0ZSkgJiYgIWlzTmFOKGRhdGUpKSB7CisgICAgICAgICAgICAgICAgICAgIHNlbGVjdGVkID0gbmV3IERhdGUoZGF0ZSk7CisgICAgICAgICAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgICAgICAgICAgaWYgKCFzZWxlY3RlZCkgeworICAgICAgICAgICAgICAgICAgICAgICAgc2VsZWN0ZWQgPSBuZXcgRGF0ZSgpOworICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgfQorCQkJCQorCQkJCWlmIChzZWxlY3RlZCkgeworCQkJCQl2YXIgc2VsZWN0ZWRDYWxlbmRhcjsKKwkJCQkJaWYoc2NvcGUubW9kZSA9PT0gMSl7CisJCQkJCQlzZWxlY3RlZCA9IG5ldyBEYXRlKCk7CisJCQkJCQlzZWxlY3RlZENhbGVuZGFyID0gbW92ZU1vbnRoKGFuZ3VsYXIuY29weShzZWxlY3RlZCksIC0xKTsKKwkJCQkJfSBlbHNlIHsKKwkJCQkJCXNlbGVjdGVkQ2FsZW5kYXIgPSBhbmd1bGFyLmNvcHkoc2VsZWN0ZWQpOworCQkJCQl9CisJCQkJCQorCQkJCQl2YXIgY3VycmVudE1vZGUgPSBkYXRlcGlja2VyQ3RybC5tb2Rlc1tzY29wZS5tb2RlXTsKKwkJCQkJdmFyIGN1cnJlbnREYXRhID0gY3VycmVudE1vZGUuZ2V0VmlzaWJsZURhdGVzKHNlbGVjdGVkQ2FsZW5kYXIsICd0b3AnKTsKKyAgICAgICAgICAgICAgICAgICAgc2NvcGUuY3VycmVudFJvd3MgPSBzcGxpdChjdXJyZW50RGF0YS5vYmplY3RzLCBjdXJyZW50TW9kZS5zcGxpdCk7CisgICAgICAgICAgICAgICAgICAgIHNjb3BlLmN1cnJlbnRUaXRsZSA9IGN1cnJlbnREYXRhLnRpdGxlOworICAgICAgICAgICAgICAgICAgICBzY29wZS5sYWJlbHMgPSBjdXJyZW50RGF0YS5sYWJlbHMgfHwgW107CisKKyAgICAgICAgICAgICAgICAgICAgdmFyIG5leHREYXRhID0gY3VycmVudE1vZGUuZ2V0VmlzaWJsZURhdGVzKG1vdmVNb250aChhbmd1bGFyLmNvcHkoc2VsZWN0ZWRDYWxlbmRhciksIDEpLCAnYm90dG9tJyk7CisgICAgICAgICAgICAgICAgICAgIHNjb3BlLm5leHRSb3dzID0gc3BsaXQobmV4dERhdGEub2JqZWN0cywgY3VycmVudE1vZGUuc3BsaXQpOworICAgICAgICAgICAgICAgICAgICBzY29wZS5uZXh0VGl0bGUgPSBuZXh0RGF0YS50aXRsZTsJCQkJCQorCQkJCX0KKyAgICAgICAgICAgIH0KKyAgICAgICAgCisgICAgICAgICAgICBzY29wZS5zZWxlY3QgPSBmdW5jdGlvbihkYXRlKSB7CisgICAgICAgICAgICAgICAgY2FsZW5kYXJTZWxlY3RlZCA9IHRydWU7CisgICAgICAgICAgICAgICAgaWYoYXR0cnMuZnJvbSkgeworICAgICAgICAgICAgICAgICAgICBpZighKGFuZ3VsYXIuaXNEYXRlKHNjb3BlLmZyb21EYXRlKSAmJiBhbmd1bGFyLmlzRGF0ZShzY29wZS5jdXJyZW50RGF0ZSkpKSB7CisgICAgICAgICAgICAgICAgICAgICAgICBpZihhbmd1bGFyLmlzRGF0ZShzY29wZS5mcm9tRGF0ZSkpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBzZWxlY3RDdXJyZW50RGF0ZShkYXRlKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSBpZighYW5ndWxhci5pc0RhdGUoc2NvcGUuZnJvbURhdGUpKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2VsZWN0RnJvbURhdGUoZGF0ZSk7CisgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgICAgICAgICBzZWxlY3RDdXJyZW50RGF0ZShkYXRlKTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgc2NvcGUuZm9jdXNlZERhdGUgPSBkYXRlOworICAgICAgICAgICAgfTsKKyAgICAgICAgICAgIAorICAgICAgICAgICAgdmFyIHNlbGVjdEN1cnJlbnREYXRlID0gZnVuY3Rpb24oZGF0ZSkgeworICAgICAgICAgICAgICAgIHZhciBkdCA9IG5ldyBEYXRlKGRhdGUuZ2V0RnVsbFllYXIoKSwgZGF0ZS5nZXRNb250aCgpLCBkYXRlLmdldERhdGUoKSk7CisgICAgICAgICAgICAgICAgc2NvcGUuY3VycmVudERhdGUgPSBkdDsKKyAgICAgICAgICAgIH07CisgICAgICAgICAgICAKKyAgICAgICAgICAgIHZhciBzZWxlY3RGcm9tRGF0ZSA9IGZ1bmN0aW9uKGRhdGUpIHsKKyAgICAgICAgICAgICAgICB2YXIgZHQgPSBuZXcgRGF0ZShkYXRlLmdldEZ1bGxZZWFyKCksIGRhdGUuZ2V0TW9udGgoKSwgZGF0ZS5nZXREYXRlKCkpOworICAgICAgICAgICAgICAgIHNjb3BlLmZyb21EYXRlID0gZHQ7CisgICAgICAgICAgICB9OworCisgICAgICAgICAgICB2YXIgc3dhcERhdGUgPSBmdW5jdGlvbihmcm9tRGF0ZSwgY3VycmVudERhdGUpIHsKKyAgICAgICAgICAgICAgICBzZWxlY3RGcm9tRGF0ZShjdXJyZW50RGF0ZSk7CisgICAgICAgICAgICAgICAgJHRpbWVvdXQoZnVuY3Rpb24gKCkgeworICAgICAgICAgICAgICAgICAgICBjYWxlbmRhclNlbGVjdGVkID0gdHJ1ZTsKKyAgICAgICAgICAgICAgICAgICAgc2NvcGUuZm9jdXNlZERhdGUgPSBjdXJyZW50RGF0ZTsKKyAgICAgICAgICAgICAgICAgICAgc2VsZWN0Q3VycmVudERhdGUoZnJvbURhdGUpOworICAgICAgICAgICAgICAgIH0pOworICAgICAgICAgICAgfQkJCQorICAgICAgICAgICAgdmFyIG1vdmVNb250aCA9IGZ1bmN0aW9uKHNlbGVjdGVkRGF0ZSwgZGlyZWN0aW9uKSB7CisgICAgICAgICAgICAgICAgdmFyIHN0ZXAgPSBkYXRlcGlja2VyQ3RybC5tb2Rlc1tzY29wZS5tb2RlXS5zdGVwOworICAgICAgICAgICAgICAgIHNlbGVjdGVkRGF0ZS5zZXREYXRlKDEpOworICAgICAgICAgICAgICAgIHNlbGVjdGVkRGF0ZS5zZXRNb250aChzZWxlY3RlZERhdGUuZ2V0TW9udGgoKSArIGRpcmVjdGlvbiAqIChzdGVwLm1vbnRocyB8fCAwKSk7CisgICAgICAgICAgICAgICAgc2VsZWN0ZWREYXRlLnNldEZ1bGxZZWFyKHNlbGVjdGVkRGF0ZS5nZXRGdWxsWWVhcigpICsgZGlyZWN0aW9uICogKHN0ZXAueWVhcnMgfHwgMCkpOworCisgICAgICAgICAgICAgICAgcmV0dXJuIHNlbGVjdGVkRGF0ZTsKKyAgICAgICAgICAgIH07CisKKyAgICAgICAgICAgIHNjb3BlLm1vdmUgPSBmdW5jdGlvbihkaXJlY3Rpb24pIHsKKyAgICAgICAgICAgICAgICBzZWxlY3RlZCA9IG1vdmVNb250aChhbmd1bGFyLmNvcHkoc2VsZWN0ZWQpLCBkaXJlY3Rpb24pOworICAgICAgICAgICAgICAgIHJlZmlsbCgpOworICAgICAgICAgICAgfTsKKworICAgICAgICAgICAgc2NvcGUuJHdhdGNoKCdjdXJyZW50RGF0ZScsIGZ1bmN0aW9uICh2YWx1ZSkgeworICAgICAgICAgICAgICAgIGlmKGFuZ3VsYXIuaXNEYXRlKHZhbHVlKSAmJiAhaXNOYU4odmFsdWUpICYmIGRhdGVwaWNrZXJDdHJsLmlzRGlzYWJsZWQodmFsdWUpKSB7CisgICAgICAgICAgICAgICAgICAgIHNjb3BlLmN1cnJlbnREYXRlID0gbnVsbDsKKyAgICAgICAgICAgICAgICAgICAgcmV0dXJuOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICBpZiAoYXR0cnMuZnJvbSkgeworICAgICAgICAgICAgICAgICAgICBpZiAoIWlzTmFOKHZhbHVlKSAmJiAhaXNOYU4oc2NvcGUuZnJvbURhdGUpICYmIGRhdGVwaWNrZXJDdHJsLmNvbXBhcmUodmFsdWUsIHNjb3BlLmZyb21EYXRlKSA8IDApIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIHN3YXBEYXRlKHNjb3BlLmZyb21EYXRlLCB2YWx1ZSk7CisgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm47CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgaWYgKGNhbGVuZGFyU2VsZWN0ZWQpIHsKKyAgICAgICAgICAgICAgICAgICAgcmVmaWxsKCk7CisgICAgICAgICAgICAgICAgICAgIGNhbGVuZGFyU2VsZWN0ZWQgPSBmYWxzZTsKKyAgICAgICAgICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgICAgICAgICBpZiAoYW5ndWxhci5pc0RlZmluZWQodmFsdWUpICYmIHZhbHVlICE9PSBudWxsKSB7CisgICAgICAgICAgICAgICAgICAgICAgICByZWZpbGwodmFsdWUpOworICAgICAgICAgICAgICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgICAgICAgICAgICAgcmVmaWxsKCk7CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgc2NvcGUuZm9jdXNlZERhdGUgPSB1bmRlZmluZWQ7CisgICAgICAgICAgICB9KTsKKyAgICAgICAgICAgIAorICAgICAgICAgICAgc2NvcGUuJHdhdGNoKCdmcm9tRGF0ZScsIGZ1bmN0aW9uICh2YWx1ZSkgeworICAgICAgICAgICAgICAgIGlmKGFuZ3VsYXIuaXNEYXRlKHZhbHVlKSAmJiAhaXNOYU4odmFsdWUpICYmIGRhdGVwaWNrZXJDdHJsLmlzRGlzYWJsZWQodmFsdWUpKSB7CisgICAgICAgICAgICAgICAgICAgIHNjb3BlLmZyb21EYXRlID0gbnVsbDsKKyAgICAgICAgICAgICAgICAgICAgcmV0dXJuOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICBpZiAoYXR0cnMuZnJvbSkgeworICAgICAgICAgICAgICAgICAgICBpZiAoIWlzTmFOKHNjb3BlLmN1cnJlbnREYXRlKSAmJiAhaXNOYU4odmFsdWUpICYmIGRhdGVwaWNrZXJDdHJsLmNvbXBhcmUoc2NvcGUuY3VycmVudERhdGUsIHZhbHVlKSA8IDApIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIHN3YXBEYXRlKHZhbHVlLCBzY29wZS5jdXJyZW50RGF0ZSk7CisgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm47CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgaWYgKGNhbGVuZGFyU2VsZWN0ZWQpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIHJlZmlsbCgpOworICAgICAgICAgICAgICAgICAgICAgICAgY2FsZW5kYXJTZWxlY3RlZCA9IGZhbHNlOworICAgICAgICAgICAgICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGFuZ3VsYXIuaXNEZWZpbmVkKHZhbHVlKSAmJiB2YWx1ZSAhPT0gbnVsbCkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJlZmlsbCh2YWx1ZSk7CisgICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJlZmlsbCgpOworICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIHNjb3BlLmZvY3VzZWREYXRlID0gdW5kZWZpbmVkOworICAgICAgICAgICAgfSk7CisgICAgICAgIH0KKyAgICB9OworfV0pCisuZGlyZWN0aXZlKCdkYXRlcGlja2VyUG9wdXAnLCBbJyRkb2N1bWVudCcsICdkYXRlcGlja2VyU2VydmljZScsICckaXNFbGVtZW50JywgJyRkb2N1bWVudEJpbmQnLCBmdW5jdGlvbigkZG9jdW1lbnQsIGRhdGVwaWNrZXJTZXJ2aWNlLCAkaXNFbGVtZW50LCAkZG9jdW1lbnRCaW5kKSB7CisgICAgdmFyIGxpbmsgPSBmdW5jdGlvbiAoc2NvcGUsIGVsZW0sIGF0dHIsIGN0cmwpIHsKKyAgICAgICAgZGF0ZXBpY2tlclNlcnZpY2UuYmluZFNjb3BlKGF0dHIsIHNjb3BlKTsKKworICAgICAgICBzY29wZS5pc09wZW4gPSBmYWxzZTsKKworICAgICAgICB2YXIgdG9nZ2xlID0gc2NvcGUudG9nZ2xlID0gZnVuY3Rpb24gKHNob3cpIHsKKyAgICAgICAgICAgIGlmKHNob3cgPT09IHRydWUgfHwgc2hvdyA9PT0gZmFsc2UpIHsKKyAgICAgICAgICAgICAgICBzY29wZS5pc09wZW4gPSBzaG93OworICAgICAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgICAgICBzY29wZS5pc09wZW4gPSAhc2NvcGUuaXNPcGVuOworICAgICAgICAgICAgfQorICAgICAgICB9OworCisgICAgICAgIHNjb3BlLiR3YXRjaCgnY3VycmVudCcsIGZ1bmN0aW9uICgpIHsKKyAgICAgICAgICAgIHRvZ2dsZShmYWxzZSk7CisgICAgICAgIH0pOworCisgICAgICAgIHZhciBvdXRzaWRlQ2xpY2sgPSBmdW5jdGlvbiAoZSkgeworICAgICAgICAgICAgdmFyIGlzRWxlbWVudCA9ICRpc0VsZW1lbnQoYW5ndWxhci5lbGVtZW50KGUudGFyZ2V0KSwgZWxlbSwgJGRvY3VtZW50KTsKKyAgICAgICAgICAgIGlmKCFpc0VsZW1lbnQpIHsKKyAgICAgICAgICAgICAgICB0b2dnbGUoZmFsc2UpOworICAgICAgICAgICAgICAgIHNjb3BlLiRhcHBseSgpOworICAgICAgICAgICAgfQorICAgICAgICB9OworCisgICAgICAgICRkb2N1bWVudEJpbmQuY2xpY2soJ2lzT3BlbicsIG91dHNpZGVDbGljaywgc2NvcGUpOworICAgIH07CisKKyAgICByZXR1cm4geworICAgICAgICByZXN0cmljdDogJ0VBJywKKyAgICAgICAgcmVwbGFjZTogdHJ1ZSwKKyAgICAgICAgdHJhbnNjbHVkZTogdHJ1ZSwKKyAgICAgICAgdGVtcGxhdGVVcmw6ICdhcHAvc2NyaXB0cy9uZ19qc19hdHRfdHBscy9kYXRlcGlja2VyL2RhdGVwaWNrZXJQb3B1cC5odG1sJywKKyAgICAgICAgc2NvcGU6IHsKKyAgICAgICAgICAgIGN1cnJlbnQ6ICI9Y3VycmVudCIKKyAgICAgICAgfSwKKyAgICAgICAgY29tcGlsZTogZnVuY3Rpb24gKGVsZW0sIGF0dHIpIHsKKyAgICAgICAgICAgIHZhciB3cmFwcGVyRWxlbWVudCA9IGVsZW0uZmluZCgnc3BhbicpLmVxKDEpOworICAgICAgICAgICAgd3JhcHBlckVsZW1lbnQuYXR0cignY3VycmVudCcsICdjdXJyZW50Jyk7CisgICAgICAgICAgICBkYXRlcGlja2VyU2VydmljZS5zZXRBdHRyaWJ1dGVzKGF0dHIsIHdyYXBwZXJFbGVtZW50KTsKKworICAgICAgICAgICAgcmV0dXJuIGxpbms7CisgICAgICAgIH0KKyAgICB9OworfV0pCisKKy5kaXJlY3RpdmUoJ2F0dERhdGVwaWNrZXInLCBbJyRsb2cnLCBmdW5jdGlvbigkbG9nKSB7C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gICAgICAgICAgJGVsZW1lbnQuYXR0cignZm9ybWF0LWRhdGUnLCBkYXRlRm9ybWF0U3RyaW5nKTsKKyAgICAgICAgICAgICRlbGVtZW50LmF0dHIoJ2F0dC1pbnB1dC1kZW55JywgJ1teMC05XC8tXScpOworICAgICAgICAgICAgJGVsZW1lbnQuYXR0cignbWF4bGVuZ3RoJywgMTApOworCisgICAgICAgICAgICB2YXIgd3JhcHBlckVsZW1lbnQgPSBhbmd1bGFyLmVsZW1lbnQoJzxkaXY+PC9kaXY+Jyk7CisgICAgICAgICAgICB3cmFwcGVyRWxlbWVudC5hdHRyKCdkYXRlcGlja2VyLXBvcHVwJywgJycpOworICAgICAgICAgICAgd3JhcHBlckVsZW1lbnQuYXR0cignY3VycmVudCcsICdjdXJyZW50Jyk7CisgICAgICAgICAgICAKKyAgICAgICAgICAgIGRhdGVwaWNrZXJTZXJ2aWNlLnNldEF0dHJpYnV0ZXMoJGF0dHJzLCB3cmFwcGVyRWxlbWVudCk7CisgICAgICAgICAgICBkYXRlcGlja2VyU2VydmljZS5iaW5kU2NvcGUoJGF0dHJzLCAkc2NvcGUpOworICAgICAgICAgICAgCisgICAgICAgICAgICB3cmFwcGVyRWxlbWVudC5odG1sKCcnKTsKKyAgICAgICAgICAgIHdyYXBwZXJFbGVtZW50LmFwcGVuZCgkZWxlbWVudC5wcm9wKCdvdXRlckhUTUwnKSk7CisgICAgICAgICAgICBpZiAobmF2aWdhdG9yLnVzZXJBZ2VudC5tYXRjaCgvTVNJRSA4LykgPT09IG51bGwpIHsKKyAgICAgICAgICAgICAgICB3cmFwcGVyRWxlbWVudC5hcHBlbmQoc2VsZWN0ZWREYXRlTWVzc2FnZSk7CisgICAgICAgICAgICB9CisgICAgICAgICAgICB2YXIgZWxtID0gd3JhcHBlckVsZW1lbnQucHJvcCgnb3V0ZXJIVE1MJyk7CisgICAgICAgICAgICBlbG0gPSAkY29tcGlsZShlbG0pKCRzY29wZSk7CisgICAgICAgICAgICAkZWxlbWVudC5yZXBsYWNlV2l0aChlbG0pOworICAgICAgICB9XSwKKyAgICAgICAgbGluazogZnVuY3Rpb24oc2NvcGUsIGVsZW0sIGF0dHIsIGN0cmwpIHsKKyAgICAgICAgICAgIGlmICghY3RybCkgeworICAgICAgICAgICAgICAgICRsb2cuZXJyb3IoIm5nLW1vZGVsIGlzIHJlcXVpcmVkLiIpOworICAgICAgICAgICAgICAgIHJldHVybjsgLy8gZG8gbm90aGluZyBpZiBubyBuZy1tb2RlbAorICAgICAgICAgICAgfQorCisgICAgICAgICAgICBzY29wZS4kd2F0Y2goJ2N1cnJlbnQnLCBmdW5jdGlvbih2YWx1ZSkgeworICAgICAgICAgICAgICAgIGN0cmwuJHNldFZpZXdWYWx1ZSh2YWx1ZSk7CisgICAgICAgICAgICB9KTsKKyAgICAgICAgICAgIGN0cmwuJHJlbmRlciA9IGZ1bmN0aW9uKCkgeworICAgICAgICAgICAgICAgIHNjb3BlLmN1cnJlbnQgPSBjdHJsLiR2aWV3VmFsdWU7CisgICAgICAgICAgICB9OworICAgICAgICB9CisgICAgfTsKK31dKQorCisuZGlyZWN0aXZlKCdmb3JtYXREYXRlJywgWydkYXRlRmlsdGVyJywgJ2RhdGVwaWNrZXJTZXJ2aWNlJywgZnVuY3Rpb24oZGF0ZUZpbHRlciwgZGF0ZXBpY2tlclNlcnZpY2UpIHsKKyAgICByZXR1cm4geworICAgICAgICByZXN0cmljdDogJ0EnLAorICAgICAgICByZXF1aXJlOiAnbmdNb2RlbCcsCisgICAgICAgIGxpbms6IGZ1bmN0aW9uKHNjb3BlLCBlbGVtLCBhdHRyLCBjdHJsKSB7CisgICAgICAgICAgICB2YXIgZm9ybWF0RGF0ZSA9ICIiOworICAgICAgICAgICAgYXR0ci4kb2JzZXJ2ZSgnZm9ybWF0RGF0ZScsIGZ1bmN0aW9uICh2YWx1ZSkgeworICAgICAgICAgICAgICAgIGZvcm1hdERhdGUgPSB2YWx1ZTsKKyAgICAgICAgICAgIH0pOworICAgICAgICAgICAgdmFyIGRhdGVUb1N0cmluZyA9IGZ1bmN0aW9uKHZhbHVlKSB7CisgICAgICAgICAgICAgICAgaWYgKHZhbHVlKSB7CisgICAgICAgICAgICAgICAgICAgIGN0cmwuJHNldFZhbGlkaXR5KCdpbnZhbGlkRGF0ZScsIHRydWUpOworICAgICAgICAgICAgICAgICAgICByZXR1cm4gZGF0ZUZpbHRlcih2YWx1ZSwgZm9ybWF0RGF0ZSk7CisgICAgICAgICAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgICAgICAgICAgY3RybC4kc2V0VmFsaWRpdHkoJ2ludmFsaWREYXRlJywgZmFsc2UpOworICAgICAgICAgICAgICAgICAgICByZXR1cm4gZWxlbS52YWwoKTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9OworICAgICAgICAgICAgdmFyIHN0cmluZ1RvRGF0ZSA9IGZ1bmN0aW9uKHZhbHVlKSB7CisgICAgICAgICAgICAgICAgaWYoZGF0ZXBpY2tlclNlcnZpY2UudmFsaWRhdGVEYXRlU3RyaW5nKHZhbHVlLCBmb3JtYXREYXRlKSkgeworICAgICAgICAgICAgICAgICAgICBjdHJsLiRzZXRWYWxpZGl0eSgnaW52YWxpZERhdGUnLCB0cnVlKTsKKyAgICAgICAgICAgICAgICAgICAgcmV0dXJuIG5ldyBEYXRlKHZhbHVlKTsKKyAgICAgICAgICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgICAgICAgICBjdHJsLiRzZXRWYWxpZGl0eSgnaW52YWxpZERhdGUnLCBmYWxzZSk7CisgICAgICAgICAgICAgICAgICAgIHJldHVybiBudWxsOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH07CisgICAgICAgICAgICBjdHJsLiRmb3JtYXR0ZXJzLnVuc2hpZnQoZGF0ZVRvU3RyaW5nKTsKKyAgICAgICAgICAgIGN0cmwuJHBhcnNlcnMudW5zaGlmdChzdHJpbmdUb0RhdGUpOworICAgICAgICB9CisgICAgfTsKK31dKQorCisu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AgICAgICAgIGlmKHNob3cgPT09IHRydWUgfHwgc2hvdyA9PT0gZmFsc2UpIHsKKyAgICAgICAgICAgICAgICBzY29wZS5zaG93RHJvcGRvd25MaXN0ID0gc2hvdzsKKyAgICAgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICAgICAgc2NvcGUuc2hvd0Ryb3Bkb3duTGlzdCA9ICFzY29wZS5zaG93RHJvcGRvd25MaXN0OworICAgICAgICAgICAgfQorCisgICAgICAgICAgICBpZiAoIXNjb3BlLnNob3dEcm9wZG93bkxpc3QpIHsKKyAgICAgICAgICAgICAgICBoaWRlQ2FsZW5kYXIoKTsKKyAgICAgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICAgICAgaWYgKHNjb3BlLmN1cnJlbnRTZWxlY3Rpb24gPT09ICdDdXN0b20gU2luZ2xlIERhdGUnIHx8IHNjb3BlLmN1cnJlbnRTZWxlY3Rpb24gPT09ICdDdXN0b20gUmFuZ2UnKSB7CisgICAgICAgICAgICAgICAgICAgIHNob3dDYWxlbmRhcigpOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0KKyAgICAgICAgfTsKKworICAgICAgICB2YXIgcmVzZXRUaW1lID0gc2NvcGUucmVzZXRUaW1lID0gZnVuY3Rpb24oZGF0ZSkgeworICAgICAgICAgICAgdmFyIGR0OworICAgICAgICAgICAgaWYgKCFpc05hTihuZXcgRGF0ZShkYXRlKSkpIHsKKyAgICAgICAgICAgICAgICBkdCA9IG5ldyBEYXRlKGRhdGUpOworICAgICAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgICAgICByZXR1cm4gbnVsbDsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIHJldHVybiBuZXcgRGF0ZShkdC5nZXRGdWxsWWVhcigpLCBkdC5nZXRNb250aCgpLCBkdC5nZXREYXRlKCkpOworICAgICAgICB9OworCisgICAgICAgIHZhciBhZGREYXlzID0gc2NvcGUuYWRkRGF5cyA9IGZ1bmN0aW9uIChkYXRlLCBkYXlzKSB7CisgICAgICAgICAgICB2YXIgZHQ7CisgICAgICAgICAgICBpZiAoIWlzTmFOKG5ldyBEYXRlKGRhdGUpKSAmJiAhaXNOYU4oZGF5cykpIHsKKyAgICAgICAgICAgICAgICBkdCA9IG5ldyBEYXRlKGRhdGUpOworICAgICAgICAgICAgICAgIGR0LnNldERhdGUoZHQuZ2V0RGF0ZSgpICsgZGF5cyk7CisgICAgICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgICAgIGR0ID0gbmV3IERhdGUoKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIHJldHVybiBkdDsKKyAgICAgICAgfTsKKwkJdmFyIGFkZE1vbnRoID0gc2NvcGUuYWRkTW9udGggPSBmdW5jdGlvbiAoZGF0ZSwgbW9udGhzKSB7CisgICAgICAgICAgICB2YXIgZHQ7CisgICAgICAgICAgICBpZiAoIWlzTmFOKG5ldyBEYXRlKGRhdGUpKSAmJiAhaXNOYU4obW9udGhzKSkgeworICAgICAgICAgICAgICAgIGR0ID0gbmV3IERhdGUoZGF0ZSk7CisgICAgICAgICAgICAgICAgZHQuc2V0TW9udGgoZHQuZ2V0TW9udGgoKSArIG1vbnRocyk7CisgICAgICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgICAgIGR0ID0gbmV3IERhdGUoKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIHJldHVybiBkdDsKKyAgICAgICAgfTsgICAgICAKKworICAgICAgICB2YXIgc2hvd0NhbGVuZGFyID0gZnVuY3Rpb24oKSB7CisgICAgICAgICAgICBzY29wZS5zaG93Q2FsZW5kYXIgPSB0cnVlOworICAgICAgICB9OworCisgICAgICAgIHZhciBoaWRlQ2FsZW5kYXIgPSBmdW5jdGlvbigpIHsKKyAgICAgICAgICAgIHNjb3BlLnNob3dDYWxlbmRhciA9IGZhbHNlOworICAgICAgICAgICAgaWYoc2NvcGUuY3VycmVudFNlbGVjdGlvbiAhPT0gJ0N1c3RvbSBTaW5nbGUgRGF0ZScgJiYgc2NvcGUuY3VycmVudFNlbGVjdGlvbiAhPT0gJ0N1c3RvbSBSYW5nZScpIHsKKyAgICAgICAgICAgICAgICBjbGVhcih0cnVlKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfTsKKworICAgICAgICB2YXIgc2V0RHJvcGRvd25UZXh0ID0gZnVuY3Rpb24odmFsdWUpIHsKKyAgICAgICAgICAgIGlmKGlucHV0Q2hhbmdlKSB7CisgICAgICAgICAgICAgICAgcmV0dXJuOworICAgICAgICAgICAgfQorCisgICAgICAgICAgICB2YXIgZnJvbURhdGVUZXh0ID0gZGF0ZUZvcm1hdFN0cmluZy50b1VwcGVyQ2FzZSgpOworICAgICAgICAgICAgdmFyIGN1cnJlbnREYXRlVGV4dCA9IGRhdGVGb3JtYXRTdHJpbmcudG9VcHBlckNhc2UoKTsKKworICAgICAgICAgICAgaWYoIWlzTmFOKG5ldyBEYXRlKHNjb3BlLmZyb21EYXRlKSkpIHsKKyAgICAgICAgICAgICAgICBmcm9tRGF0ZVRleHQgPSBkYXRlRmlsdGVyKHNjb3BlLmZyb21EYXRlLCBkYXRlRm9ybWF0U3RyaW5nKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGlmKCFpc05hTihuZXcgRGF0ZShzY29wZS5jdXJyZW50RGF0ZSkpKSB7CisgICAgICAgICAgICAgICAgY3VycmVudERhdGVUZXh0ID0gZGF0ZUZpbHRlcihzY29wZS5jdXJyZW50RGF0ZSwgZGF0ZUZvcm1hdFN0cmluZyk7CisgICAgICAgICAgICB9CisKKyAgICAgICAgICAgIGlmKHZhbHVlID09PSAnQ3VzdG9tIFNpbmdsZSBEYXRlJykgeworICAgICAgICAgICAgICAgIGN0cmwuJHNldFZhbGlkaXR5KCdpbnZhbGlkRGF0ZScsIHRydWUpOworICAgICAgICAgICAgICAgIHNjb3BlLm1heExlbmd0aCA9IDEwOworICAgICAgICAgICAgICAgIHNjb3BlLnNlbGVjdGVkT3B0aW9uID0gY3VycmVudERhdGVUZXh0OworICAgICAgICAgICAgfSBlbHNlIGlmKHZhbHVlID09PSAnQ3VzdG9tIFJhbmdlJykgeworICAgICAgICAgICAgICAgIGN0cmwuJHNldFZhbGlkaXR5KCdpbnZhbGlkRGF0ZScsIHRydWUpOworICAgICAgICAgICAgICAgIGN0cmwuJHNldFZhbGlkaXR5KCdpbnZhbGlkRGF0ZVJhbmdlJywgdHJ1ZSk7CisgICAgICAgICAgICAgICAgc2NvcGUubWF4TGVuZ3RoID0gMjE7CisgICAgICAgICAgICAgICAgc2NvcGUuc2VsZWN0ZWRPcHRpb24gPSBmcm9tRGF0ZVRleHQgKyAnLScgKyBjdXJyZW50RGF0ZVRleHQ7CisgICAgICAgICAgICB9CisgICAgICAgIH07CisKKyAgICAgICAgc2NvcGUuZ2V0RHJvcGRvd25UZXh0ID0gZnVuY3Rpb24gKCkgeworICAgICAgICAgICAgaW5wdXRDaGFuZ2UgPSB0cnVlOworICAgICAgICAgICAgdmFyIGRyb3Bkb3duVGV4dCA9IHNjb3BlLnNlbGVjdGVkT3B0aW9uOworCisgICAgICAgICAgICBpZiAoc2NvcGUuY3VycmVudFNlbGVjdGlvbiA9PT0gJ0N1c3RvbSBTaW5nbGUgRGF0ZScpIHsKKyAgICAgICAgICAgICAgICBpZiAoIWlzTmFOKG5ldyBEYXRlKGRyb3Bkb3duVGV4dCkpICYmIGRhdGVwaWNrZXJTZXJ2aWNlLnZhbGlkYXRlRGF0ZVN0cmluZyhkcm9wZG93blRleHQsIGRhdGVGb3JtYXRTdHJpbmcpKSB7CisgICAgICAgICAgICAgICAgICAgIGN0cmwuJHNldFZhbGlkaXR5KCdpbnZhbGlkRGF0ZScsIHRydWUpOworICAgICAgICAgICAgICAgICAgICBzY29wZS5mcm9tRGF0ZSA9IHVuZGVmaW5lZDsKKyAgICAgICAgICAgICAgICAgICAgc2NvcGUuY3VycmVudERhdGUgPSBuZXcgRGF0ZShkcm9wZG93blRleHQpOworICAgICAgICAgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICAgICAgICAgIGN0cmwuJHNldFZhbGlkaXR5KCdpbnZhbGlkRGF0ZScsIGZhbHNlKTsKKyAgICAgICAgICAgICAgICAgICAgY2xlYXIodHJ1ZSk7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfSBlbHNlIGlmIChzY29wZS5jdXJyZW50U2VsZWN0aW9uID09PSAnQ3VzdG9tIFJhbmdlJykgeworICAgICAgICAgICAgICAgIGlmIChkcm9wZG93blRleHQuaW5kZXhPZignLScpICE9PSAtMSAmJiAoZHJvcGRvd25UZXh0LnNwbGl0KCctJykubGVuZ3RoID09PSAyIHx8IGRyb3Bkb3duVGV4dC5zcGxpdCgnLScpLmxlbmd0aCA9PT0gNikpIHsKKyAgICAgICAgICAgICAgICAgICAgY3RybC4kc2V0VmFsaWRpdHkoJ2ludmFsaWREYXRlUmFuZ2UnLCB0cnVlKTsKKyAgICAgICAgICAgICAgICAgICAgdmFyIHJlc3VsdERyb3Bkb3duVGV4dCA9IGRyb3Bkb3duVGV4dC5zcGxpdCgnLScpOworICAgICAgICAgICAgICAgICAgICBpZiAocmVzdWx0RHJvcGRvd25UZXh0Lmxlbmd0aCA9PT0gMikgeworICAgICAgICAgICAgICAgICAgICAgICAgcmVzdWx0RHJvcGRvd25UZXh0WzBdID0gcmVzdWx0RHJvcGRvd25UZXh0WzBdLnRyaW0oKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIHJlc3VsdERyb3Bkb3duVGV4dFsxXSA9IHJlc3VsdERyb3Bkb3duVGV4dFsxXS50cmltKCk7CisgICAgICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAocmVzdWx0RHJvcGRvd25UZXh0Lmxlbmd0aCA9PT0gNikgeworICAgICAgICAgICAgICAgICAgICAgICAgdmFyIGZpcnN0RGF0ZVN0cmluZyA9IHJlc3VsdERyb3Bkb3duVGV4dFswXS50cmltKCkgKyAnLScgKyByZXN1bHREcm9wZG93blRleHRbMV0udHJpbSgpICsgJy0nICsgcmVzdWx0RHJvcGRvd25UZXh0WzJdLnRyaW0oKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIHZhciBzZWNvbmREYXRlU3RyaW5nID0gcmVzdWx0RHJvcGRvd25UZXh0WzNdLnRyaW0oKSArICctJyArIHJlc3VsdERyb3Bkb3duVGV4dFs0XS50cmltKCkgKyAnLScgKyByZXN1bHREcm9wZG93blRleHRbNV0udHJpbSgpOworICAgICAgICAgICAgICAgICAgICAgICAgcmVzdWx0RHJvcGRvd25UZXh0WzBdID0gZmlyc3REYXRlU3RyaW5nOworICAgICAgICAgICAgICAgICAgICAgICAgcmVzdWx0RHJvcGRvd25UZXh0WzFdID0gc2Vjb25kRGF0ZVN0cmluZzsKKyAgICAgICAgICAgICAgICAgICAgfQorCisgICAgICAgICAgICAgICAgICAgIGlmICghaXNOYU4obmV3IERhdGUocmVzdWx0RHJvcGRvd25UZXh0WzBdKSkgJiYgIWlzTmFOKG5ldyBEYXRlKHJlc3VsdERyb3Bkb3duVGV4dFsxXSkpICYmIGRhdGVwaWNrZXJTZXJ2aWNlLnZhbGlkYXRlRGF0ZVN0cmluZyhyZXN1bHREcm9wZG93blRleHRbMF0sIGRhdGVGb3JtYXRTdHJpbmcpICYmIGRhdGVwaWNrZXJTZXJ2aWNlLnZhbGlkYXRlRGF0ZVN0cmluZyhyZXN1bHREcm9wZG93blRleHRbMV0sIGRhdGVGb3JtYXRTdHJpbmcpKSB7CisgICAgICAgICAgICAgICAgICAgICAgICBjdHJsLiRzZXRWYWxpZGl0eSgnaW52YWxpZERhdGUnLCB0cnVlKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIHZhciBmcm9tRGF0ZSA9IG5ldyBEYXRlKHJlc3VsdERyb3Bkb3duVGV4dFswXSk7CisgICAgICAgICAgICAgICAgICAgICAgICB2YXIgY3VycmVudERhdGUgPSBuZXcgRGF0ZShyZXN1bHREcm9wZG93blRleHRbMV0pOworICAgICAgICAgICAgICAgICAgICAgICAgaWYoZnJvbURhdGUuZ2V0VGltZSgpIDwgY3VycmVudERhdGUuZ2V0VGltZSgpKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgY3RybC4kc2V0VmFsaWRpdHkoJ2ludmFsaWREYXRlUmFuZ2UnLCB0cnVlKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBzY29wZS5mcm9tRGF0ZSA9IGZyb21EYXRlOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNjb3BlLmN1cnJlbnREYXRlID0gY3VycmVudERhdGU7CisgICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGN0cmwuJHNldFZhbGlkaXR5KCdpbnZhbGlkRGF0ZVJhbmdlJywgZmFsc2UpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNsZWFyKHRydWUpOworICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgICAgICAgICAgICAgY3RybC4kc2V0VmFsaWRpdHkoJ2ludmFsaWREYXRlJywgZmFsc2UpOworICAgICAgICAgICAgICAgICAgICAgICAgY2xlYXIodHJ1ZSk7CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgICAgICAgICBjdHJsLiRzZXRWYWxpZGl0eSgnaW52YWxpZERhdGVSYW5nZScsIGZhbHNlKTsKKyAgICAgICAgICAgICAgICAgICAgY2xlYXIodHJ1ZSk7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfQorICAgICAgICB9OworCisgICAgICAgIHNjb3BlLnVudHJhY2tJbnB1dENoYW5nZSA9IGZ1bmN0aW9uKGV2KSB7CisgICAgICAgICAgICBpbnB1dENoYW5nZSA9IGZhbHNlOworICAgICAgICB9OworCisgICAgICAgIHNjb3BlLnNlbGVjdEFkdmFuY2VkT3B0aW9uID0gZnVuY3Rpb24gKHZhbHVlKSB7CisgICAgICAgICAgICBzY29wZS5jdXJyZW50U2VsZWN0aW9uID0gdmFsdWU7CisgICAgICAgICAgICBzaG93Q2FsZW5kYXIoKTsKKyAgICAgICAgICAgIGNsZWFyKCk7CisgICAgICAgICAgICBzY29wZS4kd2F0Y2goJ2N1cnJlbnREYXRlJywgZnVuY3Rpb24odmFsKSB7CisgICAgICAgICAgICAgICAgaWYoIWlzTmFOKG5ldyBEYXRlKHZhbCkpKSB7CisgICAgICAgICAgICAgICAgICAgIHNjb3BlLmFwcGx5QnV0dG9uVHlwZSA9ICJwcmltYXJ5IjsKKyAgICAgICAgICAgICAgICAgICAgc2V0RHJvcGRvd25UZXh0KHZhbHVlKTsKKyAgICAgICAgICAgICAgICAgICAgaWYgKCFpbnB1dENoYW5nZSkgeworICAgICAgICAgICAgICAgICAgICAgICAgc2NvcGUuZm9jdXNBcHBseUJ1dHRvbiA9IHRydWU7CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9KTsKKyAgICAgICAgICAgIHNjb3BlLiR3YXRjaCgnZnJvbURhdGUnLCBmdW5jdGlvbih2YWwpIHsKKyAgICAgICAgICAgICAgICBpZighaXNOYU4obmV3IERhdGUodmFsKSkpIHsKKyAgICAgICAgICAgICAgICAgICAgc2V0RHJvcGRvd25UZXh0KHZhbHVlKTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9KTsKKyAgICAgICAgICAgIGlmICh2YWx1ZSA9PT0gJ0N1c3RvbSBTaW5nbGUgRGF0ZScpIHsKKyAgICAgICAgICAgICAgICBzY29wZS5mb2N1c1NpbmdsZURhdGVDYWxlbmRhciA9IHRydWU7CisgICAgICAgICAgICB9IGVsc2UgaWYgKHZhbHVlID09PSAnQ3VzdG9tIFJhbmdlJykgeworICAgICAgICAgICAgICAgIHNjb3BlLmZvY3VzUmFuZ2VDYWxlbmRhciA9IHRydWU7CisgICAgICAgICAgICB9CisgICAgICAgIH07CisgICAgICAgIAorICAgICAgICBzY29wZS5yZXNldEZvY3VzID0gZnVuY3Rpb24gKGV2KSB7CisgICAgICAgICAgICBzY29wZS5mb2N1c1NpbmdsZURhdGVDYWxlbmRhciA9IGZhbHNlOworICAgICAgICAgICAgc2NvcGUuZm9jdXNSYW5nZUNhbGVuZGFyID0gZmFsc2U7CisgICAgICAgICAgICBzY29wZS5mb2N1c0FwcGx5QnV0dG9uID0gZmFsc2U7CisgICAgICAgIH07CisKKyAgICAgICAgc2NvcGUuYXBwbHkgPSBmdW5jdGlvbigpIHsKKyAgICAgICAgICAgIHNjb3BlLmRhdGVSYW5nZS5zZWxlY3Rpb24gPSBzY29wZS5zZWxlY3RlZE9wdGlvbjsKKyAgICAgICAgICAgIGlmKCFpc05hTihuZXcgRGF0ZShzY29wZS5mcm9tRGF0ZSkpKSB7CisgICAgICAgICAgICAgICAgc2NvcGUuZnJvbSA9IHNjb3BlLmZyb21EYXRlOworICAgICAgICAgICAgICAgIHNjb3BlLmRhdGVSYW5nZS5mcm9tID0gc2NvcGUuZnJvbURhdGU7CisgICAgICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgICAgIHNjb3BlLmZyb20gPSB1bmRlZmluZWQ7CisgICAgICAgICAgICAgICAgc2NvcGUuZGF0ZVJhbmdlLmZyb20gPSB1bmRlZmluZWQ7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBpZighaXNOYU4obmV3IERhdGUoc2NvcGUuY3VycmVudERhdGUpKSkgeworICAgICAgICAgICAgICAgIHNjb3BlLmN1cnJlbnQgPSBzY29wZS5jdXJyZW50RGF0ZTsKKyAgICAgICAgICAgICAgICBzY29wZS5kYXRlUmFuZ2UuY3VycmVudCA9IHNjb3BlLmN1cnJlbnREYXRlOworICAgICAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgICAgICBzY29wZS5jdXJyZW50ID0gdW5kZWZpbmVkOworICAgICAgICAgICAgICAgIHNjb3BlLmRhdGVSYW5nZS5jdXJyZW50ID0gdW5kZWZpbmVkOworICAgICAgICAgICAgfQorCisgICAgICAgICAgICBzaG93RHJvcGRvd24oKTsKKyAgICAgICAgfTsKKworICAgICAgICBzY29wZS4kd2F0Y2hDb2xsZWN0aW9uKGZ1bmN0aW9uKCkgeworICAgICAgICAgICAgcmV0dXJuIHNjb3BlLmRhdGVSYW5nZTsKKyAgICAgICAgfSwgZnVuY3Rpb24odmFsdWUpIHsKKyAgICAgICAgICAgIGlmKGN0cmwpIHsKKyAgICAgICAgICAgICAgICB2YXIgZmluYWxEYXRlUmFuZ2UgPSBhbmd1bGFyLmNvcHkodmFsdWUpOworICAgICAgICAgICAgICAgIGN0cmwuJHNldFZpZXdWYWx1ZShmaW5hbERhdGVSYW5nZSk7CisgICAgICAgICAgICB9CisgICAgICAgIH0pOworCisgICAgICAgIGN0cmwuJHJlbmRlciA9IGZ1bmN0aW9uKCkgeworICAgICAgICAgICAgaWYgKGN0cmwuJHZpZXdWYWx1ZSkgeworICAgICAgICAgICAgICAgIHZhciBpbnB1dFJhbmdlID0gY3RybC4kdmlld1ZhbHVlOworICAgICAgICAgICAgICAgIHNjb3BlLnNlbGVjdGVkT3B0aW9uID0gaW5wdXRSYW5nZS5zZWxlY3Rpb247CisgICAgICAgICAgICAgICAgc2NvcGUuZnJvbURhdGUgPSBpbnB1dFJhbmdlLmZyb207CisgICAgICAgICAgICAgICAgc2NvcGUuY3VycmVudERhdGUgPSBpbnB1dFJhbmdlLmN1cnJlbnQ7CisgICAgICAgICAgICB9CisgICAgICAgIH07CisKKyAgICAgICAgc2NvcGUuY2FuY2VsID0gZnVuY3Rpb24oKSB7CisgICAgICAgICAgICBzY29wZS5jdXJyZW50U2VsZWN0aW9uID0gIiI7CisgICAgICAgICAgICBzY29wZS5zZWxlY3RlZE9wdGlvbiA9IGRhdGVwaWNrZXJDb25maWcuZGF0ZUZpbHRlci5kZWZhdWx0VGV4dDsKKwkJCXNob3dEcm9wZG93bigpOworICAgICAgICB9OworCisgICAgICAgIHZhciBjbGVhciA9IHNjb3BlLmNsZWFyID0gZnVuY3Rpb24ocGFydGlhbCkgeworICAgICAgICAgICAgc2NvcGUuZnJvbURhdGUgPSB1bmRlZmluZWQ7CisgICAgICAgICAgICBzY29wZS5jdXJyZW50RGF0ZSA9IHVuZGVmaW5lZDsKKyAgICAgICAgICAgIHNjb3BlLmFwcGx5QnV0dG9uVHlwZSA9ICJkaXNhYmxlZCI7CisgICAgICAgICAgICBpZighcGFydGlhbCkgeworICAgICAgICAgICAgICAgIGN0cmwuJHNldFZhbGlkaXR5KCdpbnZhbGlkRGF0ZScsIHRydWUpOworICAgICAgICAgICAgICAgIGN0cmwuJHNldFZhbGlkaXR5KCdpbnZhbGlkRGF0ZVJhbmdlJywgdHJ1ZSk7CisgICAgICAgICAgICAgICAgc2V0RHJvcGRvd25UZXh0KHNjb3BlLmN1cnJlbnRTZWxlY3Rpb24pOworICAgICAgICAgICAgfQorICAgICAgICB9OworCisgICAgICAgIHZhciBvdXRzaWRlQ2xpY2sgPSBmdW5jdGlvbiAoZSkgeworICAgICAgICAgICAgdmFyIGlzRWxlbWVudCA9ICRpc0VsZW1lbnQoYW5ndWxhci5lbGVtZW50KGUudGFyZ2V0KSwgZWxlbSwgJGRvY3VtZW50KTsKKyAgICAgICAgICAgIGlmKCFpc0VsZW1lbnQpIHsKKyAgICAgICAgICAgICAgICBzaG93RHJvcGRvd24oZmFsc2UpOworICAgICAgICAgICAgICAgIHNjb3BlLiRhcHBseSgpOworICAgICAgICAgICAgfQorICAgICAgICB9OworCisgICAgICAgICRkb2N1bWVudEJpbmQuY2xpY2soJ3Nob3dEcm9wZG93bkxpc3QnLCBvdXRzaWRlQ2xpY2ssIHNjb3BlKTsKKyAgICB9OworCisgICAgcmV0dXJuIHsKKyAgICAgICAgcmVzdHJpY3Q6ICdFQScsCisgICAgICAgIHNjb3BlOiB7CisgICAgICAgICAgICBmcm9tOiAnPT9mcm9tJywKKyAgICAgICAgICAgIGN1cnJlbnQ6ICI9P2N1cnJlbnQiCisgIC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W9uKSB7CisgICAgICAgICAgICAgICAgcmV0dXJuIHRydWU7CisgICAgICAgICAgICB9CisgICAgICAgICAgICByZXR1cm4gZmFsc2U7CisgICAgICAgIH07CisJCX1dLAorICAgICAgICBjb21waWxlOiBmdW5jdGlvbihlbGVtLCBhdHRyKSB7CisgICAgICAgICAgICB2YXIgc2luZ2xlRGF0ZUNhbGVuZGFyID0gZWxlbS5maW5kKCdzcGFuJykuZXEoNCk7CisgICAgICAgICAgICB2YXIgcmFuZ2VDYWxlbmRhciA9IGVsZW0uZmluZCgnc3BhbicpLmVxKDUpOworICAgICAgICAgICAgcmFuZ2VDYWxlbmRhci5hdHRyKCdmcm9tJywgJ2Zyb21EYXRlJyk7CisgICAgICAgICAgICBzaW5nbGVEYXRlQ2FsZW5kYXIuYXR0cignY3VycmVudCcsICdjdXJyZW50RGF0ZScpOworICAgICAgICAgICAgcmFuZ2VDYWxlbmRhci5hdHRyKCdjdXJyZW50JywgJ2N1cnJlbnREYXRlJyk7CisKKyAgICAgICAgICAgIGRhdGVwaWNrZXJTZXJ2aWNlLnNldEF0dHJpYnV0ZXMoYXR0ciwgc2luZ2xlRGF0ZUNhbGVuZGFyKTsKKyAgICAgICAgICAgIGRhdGVwaWNrZXJTZXJ2aWNlLnNldEF0dHJpYnV0ZXMoYXR0ciwgcmFuZ2VDYWxlbmRhcik7CisKKyAgICAgICAgICAgIHJldHVybiBsaW5rOworICAgICAgICB9CisgICAgfTsKK31dKQorLmRpcmVjdGl2ZSgnYXR0RGF0ZUZpbHRlckxpc3QnLGZ1bmN0aW9uKCl7CisJcmV0dXJueworCQlyZXN0cmljdDonRUEnLAorCQlzY29wZTp7CisJCQlmcm9tRGF0ZTonPWZyb21EYXRlJywKKwkJCXRvRGF0ZTonPXRvRGF0ZScsCisJCQljYXB0aW9uOic9Y2FwdGlvbicsCisJCQlkaXNhYmxlZDonPWRpc2FibGVkJworCQl9LAorCQlyZXF1aXJlOideYXR0RGF0ZUZpbHRlcicsCisJCXRyY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AgICAgCisgICAgICAgIH07CisKKyAgICAgICAgdGhpcy5hZGRQYW5lID0gZnVuY3Rpb24ocGFuZSkgeworICAgICAgICAgIGlmIChwYW5lcy5sZW5ndGggPT09IDApICRzY29wZS5zZWxlY3QocGFuZSk7CisgICAgICAgICAgcGFuZXMucHVzaChwYW5lKTsKKyAgICAgICAgfTsKKyAgICAgIH0sCisgICAgICB0ZW1wbGF0ZTonPGRpdj4nKworICAgICAgICAnPHVsIGNsYXNzPSJ0YWJzIj4nICsKKyAgICAgICAgICAgICc8bGkgbmctcmVwZWF0PSJwYW5lIGluIHBhbmVzIiBuZy1jbGFzcz0ie2FjdGl2ZTpwYW5lLnNlbGVjdGVkfSI+JysKKyAgICAgICAgICAgICAgJzxhIGhyZWY9ImphdmFzY3JpcHQ6dm9pZCgwKSIgbmctY2xpY2s9InNlbGVjdChwYW5lKSI+e3twYW5lLnRpdGxlfX08L2E+JyArCisgICAgICAgICAgICAnPC9saT4nICsKKyAgICAgICAgICAnPC91bD4nICsKKyAgICAgICAgICAnPGRpdiBuZy10cmFuc2NsdWRlPjwvZGl2PicrCisgICAgICAgICAgJzwvZGl2PicsCisgICAgICAgICAgcmVwbGFjZTogdHJ1ZQorICAgIH07CisgIH0pCisKKyAgLmRpcmVjdGl2ZSgncGFuZScsIGZ1bmN0aW9uKCkgeworICAgIHJldHVybiB7CisgICAgICByZXF1aXJlOiAnXmF0dERldk5vdGVzJywKKyAgICAgIHJlc3RyaWN0OiAnRUEnLAorICAgICAgdHJhbnNjbHVkZTogdHJ1ZSwKKyAgICAgIHNjb3BlOiB7CisgICAgICAgICAgdGl0bGU6ICdAJworICAgICAgfSwKKyAgICAgIGxpbms6IGZ1bmN0aW9uKHNjb3BlLCBlbGVtZW50LCBhdHRycywgdGFic0N0cmwpIHsKKyAgICAgICAgdGFic0N0cmwuYWRkUGFuZShzY29wZSk7CisgICAgICB9LAorICAgICAgdGVtcGxhdGU6CisgICAgICAgICc8ZGl2IGNsYXNzPSJ0YWItcGFuZSIgbmctY2xhc3M9InthY3RpdmU6IHNlbGVjdGVkfSI+JyArIAorICAgICAgICAnPHByZSBuZy1jbGFzcz0ie1wnbGFuZ3VhZ2UtbWFya3VwXCc6dGl0bGU9PVwnSFRNTFwnLFwnbGFuZ3VhZ2UtamF2YXNjcmlwdFwnOnRpdGxlPT1cJ0phdmFTY3JpcHRcJ30iICBjbGFzcz0iIGxpbmUtbnVtYmVycyI+JyArCisgICAgICAgICAnPGNvZGUgbmctdHJhbnNjbHVkZT48L2NvZGU+JyArCisgICAgICAgICAnPC9wcmU+JyArCisgICAgICAgICc8L2Rpdj4nLAorICAgICAgcmVwbGFjZTogdHJ1ZQorICAgIH07CisgIH0pOworCithbmd1bGFyLm1vZHVsZSgnYXR0LmFicy5kaXZpZGVyTGluZXMnLCBbXSkKKyAgICAgICAgLmRpcmVjdGl2ZSgnYXR0RGl2aWRlckxpbmVzJywgW2Z1bmN0aW9uKCkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICByZXR1cm4geworICAgICAgICAgICAgICAgICAgICBzY29wZTogeworICAgICAgICAgICAgICAgICAgICAgICAgYXR0RGl2aWRlckxpbmVzOiAnQCcKKyAgICAgICAgICAgICAgICAgICAgfSwKKyAgICAgICAgICAgICAgICAgICAgcmVzdHJpY3Q6ICdBJywKKyAgICAgICAgICAgICAgICAgICAgcmVwbGFjZTogdHJ1ZSwKKyAgICAgICAgICAgICAgICAgICAgdGVtcGxhdGVVcmw6ICdhcHAvc2NyaXB0cy9uZ19qc19hdHRfdHBscy9kaXZpZGVyTGluZXMvZGl2aWRlckxpbmVzLmh0bWwnLAorICAgICAgICAgICAgICAgICAgICBsaW5rOiBmdW5jdGlvbihzY29wZSwgZWxlbWVudCwgYXR0cmlidXRlLCBjdHJsKQorICAgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgICAgICBzY29wZS5saWdodENvbnRhaW5lciA9IGF0dHJpYnV0ZS5hdHREaXZpZGVyTGluZXM7CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICB9OworICAgICAgICAgICAgfV0pOworCithbmd1bGFyLm1vZHVsZSgnYXR0LmFicy5kcmFnZHJvcCcsIFtdKQorICAgICAgICAuZGlyZWN0aXZlKCdhdHRGaWxlRHJvcCcsIFsnJHBhcnNlJywgZnVuY3Rpb24oJHBhcnNlKSB7CisgICAgICAgICAgICAgICAgcmV0dXJuIHsKKyAgICAgICAgICAgICAgICAgICAgcmVzdHJpY3Q6ICdBJywKKyAgICAgICAgICAgICAgICAgICAgc2NvcGU6IHsKKyAgICAgICAgICAgICAgICAgICAgICAgIGZpbGVNb2RlbCA6ICc9JywKKyAgICAgICAgICAgICAgICAgICAgICAgIG9uRHJvcCA6ICcmJywKKyAgICAgICAgICAgICAgICAgICAgICAgIGF0dEZpbGVEcm9wIDogJyYnCisgICAgICAgICAgICAgICAgICAgIH0sCisgICAgICAgICAgICAgICAgICAgIGNvbnRyb2xsZXI6IFsnJHNjb3BlJywgJyRhdHRycycsIGZ1bmN0aW9uKCRzY29wZSwgJGF0dHJzKXsKKyAgICAgICAgICAgICAgICAgICAgICAgIGlmKCRhdHRycy5hdHRGaWxlRHJvcCE9PSIiKXsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAkc2NvcGUub25Ecm9wPSRzY29wZS5hdHRGaWxlRHJvcDsKKyAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAKKyAgICAgICAgICAgICAgICAgICAgICAgIHRoaXMub25Ecm9wID0gJHNjb3BlLm9uRHJvcDsKKyAgICAgICAgICAgICAgICAgICAgfV0sCisgICAgICAgICAgICAgICAgICAgIGxpbms6IGZ1bmN0aW9uKHNjb3BlLCBlbGVtZW50LCBhdHRyLCBjdHJsKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAKKyAgICAgICAgICAgICAgICAgICAgICAgIGVsZW1lbnQuYWRkQ2xhc3MoJ2RyYWdkcm9wJyk7CisgICAgICAgICAgICAgICAgICAgICAgICAKKyAgICAgICAgICAgICAgICAgICAgICAgIGVsZW1lbnQuYmluZCgKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAnZHJhZ292ZXInLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZ1bmN0aW9uKGUpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmKGUub3JpZ2luYWxFdmVudCl7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBlLmRhdGFUcmFuc2ZlciA9IGUub3JpZ2luYWxFdmVudC5kYXRhVHJhbnNmZXI7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGUuZGF0YVRyYW5zZmVyLmRyb3BFZmZlY3QgPSAnbW92ZSc7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vIGFsbG93cyB1cyB0byBkcm9wCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChlLnByZXZlbnREZWZhdWx0KSBlLnByZXZlbnREZWZhdWx0KCk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGVsZW1lbnQuYWRkQ2xhc3MoJ2RyYWdkcm9wLW92ZXInKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGZhbHNlOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgICk7CisgICAgICAgICAgICAgICAgICAgICAgICAKKyAgICAgICAgICAgICAgICAgICAgICAgIGVsZW1lbnQuYmluZCgKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAnZHJhZ2VudGVyJywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBmdW5jdGlvbihlKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vIGFsbG93cyB1cyB0byBkcm9wCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChlLnByZXZlbnREZWZhdWx0KSBlLnByZXZlbnREZWZhdWx0KCk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGVsZW1lbnQuYWRkQ2xhc3MoJ2RyYWdkcm9wLW92ZXInKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGZhbHNlOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgICk7CisKKyAgICAgICAgICAgICAgICAgICAgICAgIGVsZW1lbnQuYmluZCgKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAnZHJhZ2xlYXZlJywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBmdW5jdGlvbihlKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGVsZW1lbnQucmVtb3ZlQ2xhc3MoJ2RyYWdkcm9wLW92ZXInKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGZhbHNlOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgICk7CisgICAgICAgICAgICAgICAgICAgICAgICAKKyAgICAgICAgICAgICAgICAgICAgICAgIGVsZW1lbnQuYmluZCgKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAnZHJvcCcsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgZnVuY3Rpb24oZSkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyBTdG9wcyBzb21lIGJyb3dzZXJzIGZyb20gcmVkaXJlY3RpbmcuCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmKGUucHJldmVudERlZmF1bHQpIHsgZS5wcmV2ZW50RGVmYXVsdCgpOyB9IDsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGUuc3RvcFByb3BhZ2F0aW9uKSB7IGUuc3RvcFByb3BhZ2F0aW9uKCk7IH07CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZihlLm9yaWdpbmFsRXZlbnQpeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZS5kYXRhVHJhbnNmZXIgPSBlLm9yaWdpbmFsRXZlbnQuZGF0YVRyYW5zZmVyOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBlbGVtZW50LnJlbW92ZUNsYXNzKCdkcmFnZHJvcC1vdmVyJyk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZihlLmRhdGFUcmFuc2Zlci5maWxlcyAmJiBlLmRhdGFUcmFuc2Zlci5maWxlcy5sZW5ndGggPiAwKXsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNjb3BlLmZpbGVNb2RlbCA9IGUuZGF0YVRyYW5zZmVyLmZpbGVzWzBdOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2NvcGUuJGFwcGx5KCk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmKHR5cGVvZiBzY29wZS5vbkRyb3AgPT09ICJmdW5jdGlvbiIpeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNjb3BlLm9uRHJvcCA9ICRwYXJzZShzY29wZS5vbkRyb3ApOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNjb3BlLm9uRHJvcCgpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBmYWxzZTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICApOworICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgfTsKKyAgICAgICAgICAgIH1dKQorICAgICAgICAuZGlyZWN0aXZlKCdhdHRGaWxlTGluaycsIFsgZnVuY3Rpb24oKSB7CisgICAgICAgICAgICAgICAgcmV0dXJuIHsKKyAgICAgICAgICAgICAgICAgICAgcmVzdHJpY3Q6ICdFQScsCisgICAgICAgICAgICAgICAgICAgIHJlcXVpcmU6ICdeP2F0dEZpbGVEcm9wJywKKyAgICAgICAgICAgICAgICAgICAgcmVwbGFjZTogdHJ1ZSwKKyAgICAgICAgICAgICAgICAgICAgdHJhbnNjbHVkZTogdHJ1ZSwKKyAgICAgICAgICAgICAgICAgICAgdGVtcGxhdGVVcmw6ICdhcHAvc2NyaXB0cy9uZ19qc19hdHRfdHBscy9kcmFnZHJvcC9maWxlVXBsb2FkLmh0bWwnLAorICAgICAgICAgICAgICAgICAgICBzY29wZTogeworICAgICAgICAgICAgICAgICAgICAgICAgZmlsZU1vZGVsIDogJz0/JywKKyAgICAgICAgICAgICAgICAgICAgICAgIG9uRmlsZVNlbGVjdCA6ICcmJywKKyAgICAgICAgICAgICAgICAgICAgICAgIGF0dEZpbGVMaW5rIDogJyYnCisgICAgICAgICAgICAgICAgICAgIH0sCisgICAgICAgICAgICAgICAgICAgIGNvbnRyb2xsZXI6IFsnJHNjb3BlJywgJyRwYXJzZScsIGZ1bmN0aW9uKCRzY29wZSwgJHBhcnNlKXsKKyAgICAgICAgICAgICAgICAgICAgICAgIAorICAgICAgICAgICAgICAgICAgICAgICAgdGhpcy5zZXRGaWxlTW9kZWw9IGZ1bmN0aW9uKGZpbGVNb2RlbCl7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYoJHNjb3BlLnRha2VGaWxlTW9kZWxGcm9tUGFyZW50KXsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJHNjb3BlLiRwYXJlbnQuZmlsZU1vZGVsID0gZmlsZU1vZGVsOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAkc2NvcGUuJHBhcmVudC4kYXBwbHkoKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgZWxzZXsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJHNjb3BlLmZpbGVNb2RlbCA9IGZpbGVNb2RlbDsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJHNjb3BlLiRhcHBseSgpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgIH07CisgICAgICAgICAgICAgICAgICAgICAgICAKKyAgICAgICAgICAgICAgICAgICAgICAgIHRoaXMuY2FsbGJhY2tGdW5jdGlvbj0gZnVuY3Rpb24oKXsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZih0eXBlb2YgJHNjb3BlLm9uRmlsZVNlbGVjdCA9PT0gImZ1bmN0aW9uIil7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICRzY29wZS5vbkZpbGVTZWxlY3QgPSAkcGFyc2UoJHNjb3BlLm9uRmlsZVNlbGVjdCk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICRzY29wZS5vbkZpbGVTZWxlY3QoKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICB9OworICAgICAgICAgICAgICAgICAgICAgICAgCisgICAgICAgICAgICAgICAgICAgIH1dLAorICAgICAgICAgICAgICAgICAgICBsaW5rOiBmdW5jdGlvbihzY29wZSwgZWxlbWVudCwgYXR0ciwgYXR0RmlsZURyb3BDdHJsKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAKKyAgICAgICAgICAgICAgICAgICAgICAgIHNjb3BlLnRha2VGaWxlTW9kZWxGcm9tUGFyZW50ID0gZmFsc2U7CisgICAgICAgICAgICAgICAgICAgICAgICAKKyAgICAgICAgICAgICAgICAgICAgICAgIGlmKCEoYXR0ci5maWxlTW9kZWwpKXsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZihhdHRGaWxlRHJvcEN0cmwpeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzY29wZS50YWtlRmlsZU1vZGVsRnJvbVBhcmVudCA9IHRydWU7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgCisgICAgICAgICAgICAgICAgICAgICAgICBpZihhdHRyLmF0dEZpbGVMaW5rIT09IiIpeworICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNjb3BlLm9uRmlsZVNlbGVjdD1zY29wZS5hdHRGaWxlTGluazsKKyAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgIGVsc2UgaWYoIShhdHRyLm9uRmlsZVNlbGVjdCkpeworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmKGF0dEZpbGVEcm9wQ3RybCl7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNjb3BlLm9uRmlsZVNlbGVjdCA9IGF0dEZpbGVEcm9wQ3RybC5vbkRyb3A7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgCisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICB9OworICAgICAgICAgICAgfV0pCisgICAgICAgIC5kaXJlY3RpdmUoJ2F0dEZpbGVDaGFuZ2UnLCBbJyRwYXJzZScsIGZ1bmN0aW9uKCRwYXJzZSkgeworICAgICAgICAgICAgICAgIHJldHVybiB7CisgICAgICAgICAgICAgICAgICAgIHJlc3RyaWN0OiAnQScsCisgICAgICAgICAgICAgICAgICAgIHJlcXVpcmU6ICdeYXR0RmlsZUxpbmsnLAorICAgICAgICAgICAgICAgICAgICBsaW5rOiBmdW5jdGlvbihzY29wZSwgZWxlbWVudCwgYXR0ciwgYXR0RmlsZUxpbmtDdHJsKSB7CisgICAgICAgICAgICAgICAgICAgICAgICBlbGVtZW50LmJpbmQoCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgImNoYW5nZSIsIAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZ1bmN0aW9uIChlKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmKGUudGFyZ2V0LmZpbGVzICYmIGUudGFyZ2V0LmZpbGVzLmxlbmd0aCA+IDApeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYXR0RmlsZUxpbmtDdHJsLnNldEZpbGVNb2RlbChlLnRhcmdldC5maWxlc1swXSk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBhdHRGaWxlTGlua0N0cmwuY2FsbGJhY2tGdW5jdGlvbigpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGVsc2V7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YXIgc3RyRmlsZU5hbWUgPSBlLnRhcmdldC52YWx1ZTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhciBvYmpGU08gPSBuZXcgQWN0aXZlWE9iamVjdCgiU2NyaXB0aW5nLkZpbGVTeXN0ZW1PYmplY3QiKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYXR0RmlsZUxpbmtDdHJsLnNldEZpbGVNb2RlbChvYmpGU08uZ2V0RmlsZShzdHJGaWxlTmFtZSkpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYXR0RmlsZUxpbmtDdHJsLmNhbGxiYWNrRnVuY3Rpb24oKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgICk7CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICB9OworICAgICAgICAgICAgfV0pOworYW5ndWxhci5tb2R1bGUoImF0dC5hYnMuZHJhd2VyIiwgW10pCisuZGlyZWN0aXZlKCdhdHREcmF3ZXInLCBbJyRkb2N1bWVudCcsICckdGltZW91dCcsIGZ1bmN0aW9uICgkZG9jdW1lbnQsICR0aW1lb3V0KSB7CisgICAgICAgIHJldHVybiB7CisgICAgICAgICAgICByZXN0cmljdDogJ0VBJywKKyAgICAgICAgICAgIHJlcGxhY2U6IHRydWUsCisgICAgICAgICAgICB0cmFuc2NsdWRlOiB0cnVlLAorICAgICAgICAgICAgc2NvcGU6IHsKKyAgICAgICAgICAgICAgICBkcmF3ZXJPcGVuOiAiPT8iLAorICAgICAgICAgICAgICAgIGRyYXdlckF1dG9DbG9zZTogIj0/IgorICAgICAgICAgICAgfSwKKyAgICAgICAgICAgIHRlbXBsYXRlOiAnPGRpdj48ZGl2IGNsYXNzPSJhdHQtZHJhd2VyIiBuZy10cmFuc2NsdWRlPjwvZGl2PjxkaXYgbmctY2xhc3M9IntcJ2RyYXdlci1iYWNrZHJvcFwnOmRyYXdlck9wZW59Ij48L2Rpdj48L2Rpdj4nLAorICAgICAgICAgICAgbGluazogZnVuY3Rpb24gKCRzY29wZSwgZWxlbWVudCwgYXR0cnMpIHsKKyAgICAgICAgICAgICAgICB2YXIgcGFyYW0gPSB7fTsKKworICAgICAgICAgICAgICAgIC8vIE92ZXJyaWRlIGRlZmF1bHQgcGFyYW1ldGVycworICAgICAgICAgICAgICAgIHBhcmFtLnNpZGUgPSBhdHRycy5kcmF3ZXJTbGlkZSB8fCAndG9wJzsKKyAgICAgICAgICAgICAgICBwYXJhbS5zcGVlZCA9IGF0dHJzLmRyYXdlclNwZWVkIHx8ICcwLjI1JzsKKyAgICAgICAgICAgICAgICBwYXJhbS5zaXplID0gYXR0cnMuZHJhd2VyU2l6ZSB8fCAnMzAwcHgnOworICAgICAgICAgICAgICAgIHBhcmFtLnppbmRleCA9IGF0dHJzLmRyYXdlclppbmRleCB8fCAxMDAwOworICAgICAgICAgICAgICAgIHBhcmFtLmNsYXNzTmFtZSA9IGF0dHJzLmRyYXdlckNsYXNzIHx8ICdhdHQtZHJhd2VyJzsKKyAgICAgICAgICAgICAgICAKKyAgICAgICAgICAgICAgICB2YXIgc2xpZGVyID0gZWxlbWVudC5lcSgwKS5jaGlsZHJlbigpWzBdOworICAgICAgICAgICAgICAgIHZhciBjb250ZW50ID0gYW5ndWxhci5lbGVtZW50KHNsaWRlcikuY2hpbGRyZW4oKVswXTsKKworICAgICAgICAgICAgICAgIHNsaWRlci5jbGFzc05hbWUgPSBwYXJhbS5jbGFzc05hbWU7CisKKyAgICAgICAgICAgICAgICAvKiBTdHlsZSBzZXR1cCAqLworICAgICAgICAgICAgICAgIHNsaWRlci5zdHlsZS50cmFuc2l0aW9uRHVyYXRpb24gPSBwYXJhbS5zcGVlZCArICdzJzsKKyAgICAgICAgICAgICAgICBzbGlkZXIuc3R5bGUud2Via2l0VHJhbnNpdGlvbkR1cmF0aW9uID0gcGFyYW0uc3BlZWQgKyAncyc7CisgICAgICAgICAgICAgICAgc2xpZGVyLnN0eWxlLnpJbmRleCA9IHBhcmFtLnppbmRleDsKKyAgICAgICAgICAgICAgICBzbGlkZXIuc3R5bGUucG9zaXRpb24gPSAnZml4ZWQnOworICAgICAgICAgICAgICAgIHNsaWRlci5zdHlsZS53aWR0aCA9IDA7CisgICAgICAgICAgICAgICAgc2xpZGVyLnN0eWxlLmhlaWdodCA9IDA7CisgICAgICAgICAgICAgICAgc2xpZGVyLnN0eWxlLnRyYW5zaXRpb25Qcm9wZXJ0eSA9ICd3aWR0aCwgaGVpZ2h0JzsKKworICAgICAgICAgICAgICAgIHN3aXRjaCAocGFyYW0uc2lkZSkgeworICAgICAgICAgICAgICAgICAgICBjYXNlICdyaWdodCc6CisgICAgICAgICAgICAgICAgICAgICAgICBzbGlkZXIuc3R5bGUuaGVpZ2h0ID0gYXR0cnMuZHJhd2VyQ3VzdG9tSGVpZ2h0IHx8ICcxMDAlJzsgCisgICAgICAgICAgICAgICAgICAgICAgICBzbGlkZXIuc3R5bGUudG9wID0gYXR0cnMuZHJhd2VyQ3VzdG9tVG9wIHx8ICAnMHB4JzsKKyAgICAgICAgICAgICAgICAgICAgICAgIHNsaWRlci5zdHlsZS5ib3R0b20gPSBhdHRycy5kcmF3ZXJDdXN0b21Cb3R0b20gfHwgICcwcHgnOworICAgICAgICAgICAgICAgICAgICAgICAgc2xpZGVyLnN0eWxlLnJpZ2h0ID0gYXR0cnMuZHJhd2VyQ3VzdG9tUmlnaHQgfHwgICcwcHgnOworICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgICAgIGNhc2UgJ2xlZnQnOgorICAgICAgICAgICAgICAgICAgICAgICAgc2xpZGVyLnN0eWxlLmhlaWdodCA9IGF0dHJzLmRyYXdlckN1c3RvbUhlaWdodCB8fCAnMTAwJSc7ICAgCisgICAgICAgICAgICAgICAgICAgICAgICBzbGlkZXIuc3R5bGUudG9wID0gYXR0cnMuZHJhd2VyQ3VzdG9tVG9wIHx8ICcwcHgnOworICAgICAgICAgICAgICAgICAgICAgICAgc2xpZGVyLnN0eWxlLmJvdHRvbSA9IGF0dHJzLmRyYXdlckN1c3RvbUJvdHRvbSB8fCAnMHB4JzsKKyAgICAgICAgICAgICAgICAgICAgICAgIHNsaWRlci5zdHlsZS5sZWZ0ID0gYXR0cnMuZHJhd2VyQ3VzdG9tTGVmdCB8fCAnMHB4JzsKKyAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgICAgICBjYXNlICd0b3AnOgorICAgICAgICAgICAgICAgICAgICAgICAgc2xpZGVyLnN0eWxlLndpZHRoID0gYXR0cnMuZHJhd2VyQ3VzdG9tV2lkdGggfHwgJzEwMCUnOyAgIAorICAgICAgICAgICAgICAgICAgICAgICAgc2xpZGVyLnN0eWxlLmxlZnQgPSBhdHRycy5kcmF3ZXJDdXN0b21MZWZ0IHx8ICcwcHgnOworICAgICAgICAgICAgICAgICAgICAgICAgc2xpZGVyLnN0eWxlLnRvcCA9IGF0dHJzLmRyYXdlckN1c3RvbVRvcCB8fCAnMHB4JzsKKyAgICAgICAgICAgICAgICAgICAgICAgIHNsaWRlci5zdHlsZS5yaWdodCA9IGF0dHJzLmRyYXdlckN1c3RvbVJpZ2h0IHx8ICcwcHgnOworICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgICAgIGNhc2UgJ2JvdHRvbSc6CisgICAgICAgICAgICAgICAgICAgICAgICBzbGlkZXIuc3R5bGUud2lkdGggPSBhdHRycy5kcmF3ZXJDdXN0b21XaWR0aCB8fCAnMTAwJSc7IAorICAgICAgICAgICAgICAgICAgICAgICAgc2xpZGVyLnN0eWxlLmJvdHRvbSA9IGF0dHJzLmRyYXdlckN1c3RvbUJvdHRvbSB8fCAnMHB4JzsKKyAgICAgICAgICAgICAgICAgICAgICAgIHNsaWRlci5zdHlsZS5sZWZ0ID0gYXR0cnMuZHJhd2VyQ3VzdG9tTGVmdCB8fCAnMHB4JzsKKyAgICAgICAgICAgICAgICAgICAgICAgIHNsaWRlci5zdHlsZS5yaWdodCA9IGF0dHJzLmRyYXdlckN1c3RvbVJpZ2h0IHx8ICcwcHgnOworICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgfQorCisKKworICAgICAgICAgICAgICAgIC8qIENsb3NlZCAqLworICAgICAgICAgICAgICAgIGZ1bmN0aW9uIGRyYXdlckNsb3NlKHNsaWRlciwgcGFyYW0pIHsKKyAgICAgICAgICAgICAgICAgICAgaWYgKHNsaWRlciAmJiBzbGlkZXIuc3R5bGUud2lkdGggIT09IDAgJiYgc2xpZGVyLnN0eWxlLndpZHRoICE9PSAwKXsgCisgICAgICAgICAgICAgICAgICAgICAgICBjb250ZW50LnN0eWxlLmRpc3BsYXkgPSAnbm9uZSc7CisgICAgICAgICAgICAgICAgICAgICAgICBzd2l0Y2ggKHBhcmFtLnNpZGUpeworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNhc2UgJ3JpZ2h0JzoKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2xpZGVyLnN0eWxlLndpZHRoID0gJzBweCc7IAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBjYXNlICdsZWZ0JzoKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2xpZGVyLnN0eWxlLndpZHRoID0gJzBweCc7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNhc2UgJ3RvcCc6CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNsaWRlci5zdHlsZS5oZWlnaHQgPSAnMHB4JzsgCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNhc2UgJ2JvdHRvbSc6CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNsaWRlci5zdHlsZS5oZWlnaHQgPSAnMHB4JzsgCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICRzY29wZS5kcmF3ZXJPcGVuID0gZmFsc2U7CisgICAgICAgICAgICAgICAgfQorCisgICAgICAgICAgICAgICAgLyogT3BlbiAqLworICAgICAgICAgICAgICAgIGZ1bmN0aW9uIGRyYXdlck9wZW4oc2xpZGVyLCBwYXJhbSkgeworICAgICAgICAgICAgICAgICAgICBpZiAoc2xpZGVyLnN0eWxlLndpZHRoICE9PSAwICYmIHNsaWRlci5zdHlsZS53aWR0aCAhPT0gMCl7IAorICAgICAgICAgICAgICAgICAgICAgICAgc3dpdGNoIChwYXJhbS5zaWRlKXsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBjYXNlICdyaWdodCc6CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNsaWRlci5zdHlsZS53aWR0aCA9IHBhcmFtLnNpemU7IAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBjYXNlICdsZWZ0JzoKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2xpZGVyLnN0eWxlLndpZHRoID0gcGFyYW0uc2l6ZTsgCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNhc2UgJ3RvcCc6CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNsaWRlci5zdHlsZS5oZWlnaHQgPSBwYXJhbS5zaXplOyAKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgY2FzZSAnYm90dG9tJzoKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2xpZGVyLnN0eWxlLmhlaWdodCA9IHBhcmFtLnNpemU7IAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgICR0aW1lb3V0KGZ1bmN0aW9uKCkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbnRlbnQuc3R5bGUuZGlzcGxheSA9ICdibG9jayc7CisgICAgICAgICAgICAgICAgICAgICAgICB9LChwYXJhbS5zcGVlZCAqIDEwMDApKTsKKworICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgfQorCisgICAgICAgICAgICAgICAgZnVuY3Rpb24gaXNGdW5jdGlvbihmdW5jdGlvblRvQ2hlY2spIHsKKyAgICAgICAgICAgICAgICAgICAgdmFyIGdldFR5cGUgPSB7fTsKKyAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGZ1bmN0aW9uVG9DaGVjayAmJiBnZXRUeXBlLnRvU3RyaW5nLmNhbGwoZnVuY3Rpb25Ub0NoZWNrKSA9PT0gJ1tvYmplY3QgRnVuY3Rpb25dJzsKKyAgICAgICAgICAgICAgICB9CisKKyAgICAgICAgICAgICAgICAvKgorICAgICAgICAgICAgICAgICogV2F0Y2hlcnMKKyAgICAgICAgICAgICAgICAqICovCisKKyAgICAgICAgICAgICAgICBpZihhdHRycy5kcmF3ZXJTaXplKSB7CisgICAgICAgICAgICAgICAgICAgICRzY29wZS4kd2F0Y2goZnVuY3Rpb24oKSB7CisKKyAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBhdHRycy5kcmF3ZXJTaXplOworICAgICAgICAgICAgICAgICAgICB9LCBmdW5jdGlvbihuZXdWYWwsb2xkVmFsKSB7CisgICAgICAgICAgICAgICAgICAgICAgICBwYXJhbS5zaXplID0gbmV3VmFsOworCisgICAgICAgICAgICAgICAgICAgICAgICBpZigkc2NvcGUuZHJhd2VyT3BlbikgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRyYXdlck9wZW4oc2xpZGVyLHBhcmFtKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgfSk7CisgICAgICAgICAgICAgICAgfQorCisgICAgICAgICAgICAgICAgJHNjb3BlLiR3YXRjaCgiZHJhd2VyT3BlbiIsIGZ1bmN0aW9uICh2YWx1ZSl7CisgICAgICAgICAgICAgICAgICAgIGlmICghIXZhbHVlKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAvLyBPcGVuCisgICAgICAgICAgICAgICAgICAgICAgICBkcmF3ZXJPcGVuKHNsaWRlcixwYXJhbSk7CisgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICAgICAgICAgICAgICAvLyBDbG9zZQorICAgICAgICAgICAgICAgICAgICAgICAgZHJhd2VyQ2xvc2Uoc2xpZGVyLHBhcmFtKTsKKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIH0pOworCisgICAgICAgICAgICAgICAgLy8gY2xvc2UgcGFuZWwgb24gbG9jYXRpb24gY2hhbmdlCisgICAgICAgICAgICAgICAgaWYoJHNjb3BlLmRyYXdlckF1dG9DbG9zZSkgeworICAgICAgICAgICAgICAgICAgICAkc2NvcGUuJG9uKCIkbG9jYXRpb25DaGFuZ2VTdGFydCIsIGZ1bmN0aW9uKCl7CisgICAgICAgICAgICAgICAgICAgICAgICBkcmF3ZXJDbG9zZShzbGlkZXIsIHBhcmFtKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIGlmKGlzRnVuY3Rpb24oJHNjb3BlLmRyYXdlckF1dG9DbG9zZSkpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAkc2NvcGUuZHJhd2VyQXV0b0Nsb3NlKCk7CisgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgIH0pOworICAgICAgICAgICAgICAgICAgICAkc2NvcGUuJG9uKCIkc3RhdGVDaGFuZ2VTdGFydCIsIGZ1bmN0aW9uKCl7CisgICAgICAgICAgICAgICAgICAgICAgICBkcmF3ZXJDbG9zZShzbGlkZXIsIHBhcmFtKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIGlmKGlzRnVuY3Rpb24oJHNjb3BlLmRyYXdlckF1dG9DbG9zZSkpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAkc2NvcGUuZHJhd2VyQXV0b0Nsb3NlKCk7CisgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgIH0pOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0KKyAgICAgICAgfTsKKyAgICB9CitdKTsKK2FuZ3VsYXIubW9kdWxlKCdhdHQuYWJzLm1lc3NhZ2UnLCBbXSkKKworLmRpcmVjdGl2ZSgnYXR0TWVzc2FnZXMnLCBbZnVuY3Rpb24oKSB7CisgICAgcmV0dXJuIHsKKyAgICAgICAgcmVzdHJpY3Q6ICdFQScsCisgICAgICAgIHNjb3BlOiB0cnVlLAorICAgICAgICBjb250cm9sbGVyOiBbJyRzY29wZScsICckZWxlbWVudCcsICckYXR0cnMnLCBmdW5jdGlvbigkc2NvcGUsICRlbGVtZW50LCAkYXR0cnMpIHsKKyAgICAgICAgICAgICRzY29wZS5tZXNzYWdlVHlwZTsKKyAgICAgICAgICAgICRzY29wZS4kd2F0Y2hDb2xsZWN0aW9uKCRhdHRyc1snZm9yJ10sIGZ1bmN0aW9uKGVycm9ycykgeworICAgICAgICAgICAgICAgIGZvciAodmFyIGtleSBpbiBlcnJvcnMpIHsKKyAgICAgICAgICAgICAgICAgICAgaWYgKGVycm9yc1trZXldID09PSB0cnVlKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAkc2NvcGUuZXJyb3IgPSBrZXk7CisgICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICRzY29wZS5lcnJvciA9IG51bGw7CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICB9OworICAgICAgICAgICAgICAgIGlmICgkc2NvcGUuZXJyb3IgPT09IG51bGwpIHsKKyAgICAgICAgICAgICAgICAgICAgJHNjb3BlLm1lc3NhZ2VUeXBlID0gbnVsbDsKKyAgICAgICAgICAgICAgICAgICAgJGVsZW1lbnQucmVtb3ZlQXR0cignbWVzc2FnZS10eXBlJyk7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfSk7CisgICAgICAgICAgICB0aGlzLnNldE1lc3NhZ2VUeXBlID0gZnVuY3Rpb24obWVzc2FnZVR5cGUpIHsKKyAgICAgICAgICAgICAgICAkc2NvcGUubWVzc2FnZVR5cGUgPSBtZXNzYWdlVHlwZTsKKyAgICAgICAgICAgIH07CisgICAgICAgICAgICAkc2NvcGUuJHdhdGNoKCdtZXNzYWdlVHlwZScsIGZ1bmN0aW9uKHZhbHVlKSB7CisgICAgICAgICAgICAgICAgaWYgKGFuZ3VsYXIuaXNEZWZpbmVkKHZhbHVlKSAmJiB2YWx1ZSAhPT0gbnVsbCkgeworICAgICAgICAgICAgICAgICAgICAkZWxlbWVudC5hdHRyKCdtZXNzYWdlLXR5cGUnLCB2YWx1ZSk7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfSk7CisgICAgICAgIH1dCisgICAgfTsKK31dKQorCisuZGlyZWN0aXZlKCdhdHRNZXNzYWdlJywgW2Z1bmN0aW9uKCkgeworICAgIHJldHVybiB7CisgICAgICAgIHJlc3RyaWN0OiAnRUEnLAorICAgICAgICBzY29wZToge30sCisgICAgICAgIHJlcXVpcmU6ICdeYXR0TWVzc2FnZXMnLAorICAgICAgICBsaW5rOiBmdW5jdGlvbihzY29wZSwgZWxlbSwgYXR0ciwgY3RybCkgeworICAgICAgICAgICAgc2NvcGUud2hlbiA9IGF0dHIud2hlbiB8fCBhdHRyLmF0dE1lc3NhZ2U7CisgICAgICAgICAgICBzY29wZS50eXBlID0gYXR0ci50eXBlOworICAgICAgICAgICAgZWxlbS5jc3Moe2Rpc3BsYXk6ICdub25lJ30pOworICAgICAgICAgICAgc2NvcGUuJHBhcmVudC4kd2F0Y2goJ2Vycm9yJywgZnVuY3Rpb24odmFsdWUpIHsKKyAgICAgICAgICAgICAgICBpZiAodmFsdWUgPT09IHNjb3BlLndoZW4pIHsKKyAgICAgICAgICAgICAgICAgICAgZWxlbS5jc3Moe2Rpc3BsYXk6ICdibG9jayd9KTsKKyAgICAgICAgICAgICAgICAgICAgY3RybC5zZXRNZXNzYWdlVHlwZShzY29wZS50eXBlKTsKKyAgICAgICAgICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgICAgICAgICBlbGVtLmNzcyh7ZGlzcGxheTogJ25vbmUnfSk7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfSk7CisgICAgICAgIH0KKyAgICB9OworfV0pOworCithbmd1bGFyLm1vZHVsZSgnYXR0LmFicy5mb3JtRmllbGQnLCBbJ2F0dC5hYnMubWVzc2FnZSddKQorCisuZGlyZWN0aXZlKCdhdHRGb3JtRmllbGQnLCBbZnVuY3Rpb24oKSB7CisgICAgcmV0dXJuIHsKKyAgICAgICAgcHJpb3JpdHk6IDEwMSwKKyAgICAgICAgcmVzdHJpY3Q6ICdBJywKKyAgICAgICAgY29udHJvbGxlcjogWyckc2NvcGUnLCBmdW5jdGlvbigkc2NvcGUpIHsKKyAgICAgICAgfV0sCisgICAgICAgIGxpbms6IGZ1bmN0aW9uKHNjb3BlLCBlbGVtLCBhdHRyLCBjdHJsKSB7CisgICAgICAgICAgICBlbGVtLndyYXAoJzxkaXYgY2xhc3M9ImZvcm0tZmllbGQiPjwvZGl2PicpOworICAgICAgICAgICAgZWxlbS5wYXJlbnQoKS5hcHBlbmQoJzxsYWJlbCBjbGFzcz0iZm9ybS1maWVsZF9fbGFiZWwiPicgKyBhdHRyLnBsYWNlaG9sZGVyIHx8IGF0dHIuYXR0Rm9ybUZpZWxkICsgJzwvbGFiZWw+Jyk7CisgICAgICAgICAgICBlbGVtLndyYXAoJzxkaXYgY2xhc3M9ImZvcm0tZmllbGQtaW5wdXQtY29udGFpbmVyIj48L2Rpdj4nKTsKKworICAgICAgICAgICAgZWxlbS5iaW5kKCdrZXl1cCcsIGZ1bmN0aW9uKCkgeworICAgICAgICAgICAgICAgIGlmICh0aGlzLnZhbHVlICE9PSAnJykgeworICAgICAgICAgICAgICAgICAgICBlbGVtLnBhcmVudCgpLnBhcmVudCgpLmZpbmQoJ2xhYmVsJykuYWRkQ2xhc3MoJ2Zvcm0tZmllbGRfX2xhYmVsLS1zaG93JykucmVtb3ZlQ2xhc3MoJ2Zvcm0tZmllbGRfX2xhYmVsLS1oaWRlJyk7CisgICAgICAgICAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgICAgICAgICAgZWxlbS5wYXJlbnQoKS5wYXJlbnQoKS5maW5kKCdsYWJlbCcpLmFkZENsYXNzKCdmb3JtLWZpZWxkX19sYWJlbC0taGlkZScpLnJlbW92ZUNsYXNzKCdmb3JtLWZpZWxkX19sYWJlbC0tc2hvdycpOyAgICAgICAgICAgICAgICAgICAgCisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfSk7CisKKyAgICAgICAgICAgIGVsZW0uYmluZCgnYmx1cicsIGZ1bmN0aW9uKCkgeworICAgICAgICAgICAgICAgIGlmICh0aGlzLnZhbHVlID09PSAnJykgeworICAgICAgICAgICAgICAgICAgICBlbGVtLnBhcmVudCgpLnBhcmVudCgpLmZpbmQoJ2xhYmVsJykucmVtb3ZlQ2xhc3MoJ2Zvcm0tZmllbGRfX2xhYmVsLS1oaWRlJyk7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfSk7CisgICAgICAgIH0KKyAgICB9OworfV0pCisKKy5kaXJlY3RpdmUoJ2F0dEZvcm1GaWVsZFZhbGlkYXRpb24nLCBbJyRjb21waWxlJywgJyRsb2cnLCBmdW5jdGlvbigkY29tcGlsZSwgJGxvZykgeworICAgIHJldHVybiB7CisgICAgICAgIHByaW9yaXR5OiAxMDIsCisgICAgICAgIHNjb3BlOiB7fSwKKyAgICAgICAgcmVzdHJpY3Q6ICdBJywKKyAgICAgICAgcmVxdWlyZTogWyc/bmdNb2RlbCcsICc/YXR0Rm9ybUZpZWxkJ10sCisgICAgICAgIGxpbms6IGZ1bmN0aW9uKHNjb3BlLCBlbGVtLCBhdHRyLCBjdHJsKSB7CisgICAgICAgICAgICB2YXIgbmdDdHJsID0gY3RybFswXTsKKyAgICAgICAgICAgIHZhciBhdHRGb3JtRmllbGRDdHJsID0gY3RybFsxXTsKKyAgICAgICAgICAgIHNjb3BlLnZhbGlkID0gIiI7CisgICAgICAgICAgICAKKyAgICAgICAgICAgIGlmICghbmdDdHJsKSB7CisgICAgICAgICAgICAgICAgJGxvZy5lcnJvcigiYXR0LWZvcm0tZmllbGQtdmFsaWRhdGlvbiA6OiBuZy1tb2RlbCBkaXJlY3RpdmUgaXMgcmVxdWlyZWQuIik7CisgICAgICAgICAgICAgICAgcmV0dXJuOworICAgICAgICAgICAgfQorICAgICAgICAgICAgaWYgKCFhdHRGb3JtRmllbGRDdHJsKSB7CisgICAgICAgICAgICAgICAgJGxvZy5lcnJvcigiYXR0LWZvcm0tZmllbGQtdmFsaWRhdGlvbiA6OiBhdHQtZm9ybS1maWVsZCBkaXJlY3RpdmUgaXMgcmVxdWlyZWQuIik7CisgICAgICAgICAgICAgICAgcmV0dXJuOworICAgICAgICAgICAgfQorCisgICAgICAgICAgICBlbGVtLnBhcmVudCgpLmFwcGVuZCgkY29tcGlsZShhbmd1bGFyLmVsZW1lbnQoJzxpIGNsYXNzPSJpY29uLWluZm8tYWxlcnQgZXJyb3IiIG5nLXNob3c9InZhbGlkPT09ZmFsc2UiPiZuYnNwOzwvaT4nKSkoc2NvcGUpKTsKKyAgICAgICAgICAgIGVsZW0ucGFyZW50KCkuYXBwZW5kKCRjb21waWxlKGFuZ3VsYXIuZWxlbWVudCgnPGkgY2xhc3M9Imljb24taW5mby1zdWNjZXNzIHN1Y2Nlc3MiIG5nLXNob3c9InZhbGlkPT09dHJ1ZSI+Jm5ic3A7PC9pPicpKShzY29wZSkpOworCisgICAgICAgICAgICBzY29wZS4kd2F0Y2goJ3ZhbGlkJywgZnVuY3Rpb24odmFsdWUpIHsKKyAgICAgICAgICAgICAgICBpZiAodmFsdWUgPT09IHRydWUpIHsKKyAgICAgICAgICAgICAgICAgICAgZWxlbS5wYXJlbnQoKS5wYXJlbnQoKS5hZGRDbGFzcygnc3VjY2VzcycpOworICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAodmFsdWUgPT09IGZhbHNlKSB7CisgICAgICAgICAgICAgICAgICAgIGVsZW0ucGFyZW50KCkucGFyZW50KCkuYWRkQ2xhc3MoJ2Vycm9yJyk7CisgICAgICAgICAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgICAgICAgICAgZWxlbS5wYXJlbnQoKS5wYXJlbnQoKS5yZW1vdmVDbGFzcygnc3VjY2VzcycpLnJlbW92ZUNsYXNzKCdlcnJvcicpOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0pOworCisgICAgICAgICAgICBlbGVtLmJpbmQoJ2tleXVwJywgZnVuY3Rpb24oKSB7CisgICAgICAgICAgICAgICAgaWYgKG5nQ3RybC4kdmFsaWQgPT09IHRydWUpIHsKKyAgICAgICAgICAgICAgICAgICAgc2NvcGUudmFsaWQgPSB0cnVlOworICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAobmdDdHJsLiRpbnZhbGlkID09PSB0cnVlKSB7CisgICAgICAgICAgICAgICAgICAgIHNjb3BlLnZhbGlkID0gZmFsc2U7CisgICAgICAgICAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgICAgICAgICAgc2NvcGUudmFsaWQgPSAiIjsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgc2NvcGUuJGFwcGx5KCk7CisgICAgICAgICAgICB9KTsKKyAgICAgICAgfQorICAgIH07Cit9XSkKKworLmRpcmVjdGl2ZSgnYXR0Rm9ybUZpZWxkVmFsaWRhdGlvbkFsZXJ0JywgWyckdGltZW91dCcsIGZ1bmN0aW9uKCR0aW1lb3V0KSB7CisgICAgICAgIHJldHVybiB7CisgICAgICAgIHNjb3BlOiB7fSwKKyAgICAgICAgcmVzdHJpY3Q6ICdFQScsCisgICAgICAgIHJlcGxhY2U6IHRydWUsCisgICAgICAgIHRyYW5zY2x1ZGU6IHRydWUsCisgICAgICAgIHRlbXBsYXRlVXJsOiAnYXBwL3NjcmlwdHMvbmdfanNfYXR0X3RwbHMvZm9ybUZpZWxkL2F0dEZvcm1GaWVsZFZhbGlkYXRpb25BbGVydC5odG1sJywKKyAgICAgICAgbGluazogZnVuY3Rpb24oc2NvcGUsIGVsZW0sIGF0dHIsIGN0cmwpIHsKKyAgICAgICAgICAgIHNjb3BlLnNob3dMYWJlbCA9IGZhbHNlOworICAgICAgICAgICAgc2NvcGUuaGlkZUxhYmVsID0gZmFsc2U7CisgICAgICAgICAgICBzY29wZS5lcnJvck1lc3NhZ2UgPSBmYWxzZTsKKyAgICAgICAgICAgIHNjb3BlLndhcm5pbmdNZXNzYWdlID0gZmFsc2U7CisgICAgICAgICAgICAKKyAgICAgICAgICAgIHZhciBjaGVja01lc3NhZ2VUeXBlID0gZnVuY3Rpb24oKSB7CisgICAgICAgICAgICAgICAgaWYgKGVsZW0uZmluZCgnYXR0LW1lc3NhZ2VzJykuYXR0cignbWVzc2FnZS10eXBlJykgPT09ICdlcnJvcicpIHsKKyAgICAgICAgICAgICAgICAgICAgc2NvcGUuZXJyb3JNZXNzYWdlID0gdHJ1ZTsKKyAgICAgICAgICAgICAgICAgICAgc2NvcGUud2FybmluZ01lc3NhZ2UgPSBmYWxzZTsKKyAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKGVsZW0uZmluZCgnYXR0LW1lc3NhZ2VzJykuYXR0cignbWVzc2FnZS10eXBlJykgPT09ICd3YXJuaW5nJykgeworICAgICAgICAgICAgICAgICAgICBzY29wZS5lcnJvck1lc3NhZ2UgPSBmYWxzZTsKKyAgICAgICAgICAgICAgICAgICAgc2NvcGUud2FybmluZ01lc3NhZ2UgPSB0cnVlOworICAgICAgICAgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICAgICAgICAgIHNjb3BlLmVycm9yTWVzc2FnZSA9IGZhbHNlOworICAgICAgICAgICAgICAgICAgICBzY29wZS53YXJuaW5nTWVzc2FnZSA9IGZhbHNlOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH07CisKKyAgICAgICAgICAgIGVsZW0uZmluZCgnbGFiZWwnKS50ZXh0KGVsZW0uZmluZCgnaW5wdXQnKS5hdHRyKCdwbGFjZWhvbGRlcicpKTsKKyAgICAgICAgICAgIGVsZW0uZmluZCgnaW5wdXQnKS5iaW5kKCdrZXl1cCcsIGZ1bmN0aW9uKCkgeworICAgICAgICAgICAgICAgIGlmICh0aGlzLnZhbHVlICE9PSAnJykgeworICAgICAgICAgICAgICAgICAgICBzY29wZS5zaG93TGFiZWwgPSB0cnVlOworICAgICAgICAgICAgICAgICAgICBzY29wZS5oaWRlTGFiZWwgPSBmYWxzZTsKKyAgICAgICAgICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgICAgICAgICBzY29wZS5zaG93TGFiZWwgPSBmYWxzZTsKKyAgICAgICAgICAgICAgICAgICAgc2NvcGUuaGlkZUxhYmVsID0gdHJ1ZTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgY2hlY2tNZXNzYWdlVHlwZSgpOworICAgICAgICAgICAgICAgIHNjb3BlLiRhcHBseSgpOworICAgICAgICAgICAgfSk7CisKKyAgICAgICAgICAgIGVsZW0uZmluZCgnaW5wdXQnKS5iaW5kKCdibHVyJywgZnVuY3Rpb24oKSB7CisgICAgICAgICAgICAgICAgaWYgKHRoaXMudmFsdWUgPT09ICcnKSB7CisgICAgICAgICAgICAgICAgICAgIHNjb3BlLnNob3dMYWJlbCA9IGZhbHNlOworICAgICAgICAgICAgICAgICAgICBzY29wZS5oaWRlTGFiZWwgPSBmYWxzZTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgc2NvcGUuJGFwcGx5KCk7CisgICAgICAgICAgICB9KTsKKyAgICAgICAgICAgIAorICAgICAgICAgICAgJHRpbWVvdXQoZnVuY3Rpb24oKSB7CisgICAgICAgICAgICAgICAgY2hlY2tNZXNzYWdlVHlwZSgpOworICAgICAgICAgICAgfSwgMTAwKTsKKyAgICAgICAgfQorICAgIH07Cit9XSk7CisKKyd1c2Ugc3RyaWN0JzsKK2FuZ3VsYXIubW9kdWxlKCdhdHQuYWJzLmhvdXJwaWNrZXInLCBbJ2F0dC5hYnMudXRpbGl0aWVzJ10pCisgIC5jb25zdGFudCgnaG91cnBpY2tlckNvbmZpZycsIHsKKyAgICAgICAgICAgIGRheXM6IFsnTW9uJywgJ1R1ZScsICdXZWQnLCAnVGh1JywgJ0ZyaScsICdTYXQnLCAnU3VuJ10sCisgICAgICAgICAgICBjdXN0b21PcHRpb246ICdDdXN0b20nCisgICAgICAgIH0pCisKKyAgICAgICAgLmNvbnRyb2xsZXIoJ2hvdXJQaWNrZXJDb250cm9sbGVyJywgWyckc2NvcGUnLCBmdW5jdGlvbigkc2NvcGUpIHsKKworICAgICAgICAgICAgICAgICRzY29wZS5vcHRpb25zID0gW107CisgICAgICAgICAgICAgICAgdGhpcy5zZXRPcHRpb25zID0gCisgICAgICAgICAgICAgICAgZnVuY3Rpb24odmFsdWUsIGZyb210aW1lLCB0b3RpbWUsIHByZXNlbGVjdCwgdW5jaGVja2VkRnJvbVRpbWUsdW5jaGVja2VkVG9UaW1lKSB7CisgICAgICAgICAgICAgICAgICAgIAorICAgICAgICAgICAgICAgICAgICAkc2NvcGUub3B0aW9ucy5wdXNoKHZhbHVlKTsKKyAgICAgICAgICAgICAgICAgICAgaWYgKHByZXNlbGVjdCAhPT0gdW5kZWZpbmVkKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAkc2NvcGUucHJlc2VsZWN0ID0gcHJlc2VsZWN0OworICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgIAorICAgICAgICAgICAgICAgICAgICBpZiAoZnJvbXRpbWUgIT09IHVuZGVmaW5lZCkgeworICAgICAgICAgICAgICAgICAgICAgICAgJHNjb3BlLmZyb210aW1lID0gZnJvbXRpbWU7CisgICAgICAgICAgICAgICAgICAgICAgICBmb3IgKHZhciBkYXljb3VudCBpbiAkc2NvcGUuZGF5cykgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgJHNjb3BlLkZydGltZUxpc3RbJHNjb3BlLmRheXNbZGF5Y291bnRdXSA9IHt9OworICAgICAgICAgICAgICAgICAgICAgICAgICAgCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYodW5jaGVja2VkRnJvbVRpbWUgIT09IHVuZGVmaW5lZCl7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICRzY29wZS5GcnRpbWVMaXN0WyRzY29wZS5kYXlzW2RheWNvdW50XV0udmFsdWUgPSB1bmNoZWNrZWRGcm9tVGltZTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJHNjb3BlLnNlbGVjdGVkRnJvbU9wdGlvblskc2NvcGUuZGF5c1tkYXljb3VudF1dID0gdW5jaGVja2VkRnJvbVRpbWU7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgfWVsc2V7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICRzY29wZS5GcnRpbWVMaXN0WyRzY29wZS5kYXlzW2RheWNvdW50XV0udmFsdWUgPSBmcm9tdGltZVswXS52YWx1ZTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJHNjb3BlLnNlbGVjdGVkRnJvbU9wdGlvblskc2NvcGUuZGF5c1tkYXljb3VudF1dID0gZnJvbXRpbWVbMF0udmFsdWU7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgIGlmICh0b3RpbWUgIT09IHVuZGVmaW5lZCkgeworICAgICAgICAgICAgICAgICAgICAgICAgJHNjb3BlLnRvdGltZSA9IHRvdGltZTsKKyAgICAgICAgICAgICAgICAgICAgICAgIGZvciAodmFyIGRheWNvdW50IGluICRzY29wZS5kYXlzKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgJHNjb3BlLlRvdGltZUxpc3RbJHNjb3BlLmRheXNbZGF5Y291bnRdXSA9IHt9OworICAgICAgICAgICAgICAgICAgICAgICAgICAgIAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmKHVuY2hlY2tlZFRvVGltZSAhPT0gdW5kZWZpbmVkKXsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJHNjb3BlLlRvdGltZUxpc3RbJHNjb3BlLmRheXNbZGF5Y291bnRdXS52YWx1ZSA9IHVuY2hlY2tlZFRvVGltZTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJHNjb3BlLnNlbGVjdGVkVG9PcHRpb25bJHNjb3BlLmRheXNbZGF5Y291bnRdXSA9IHVuY2hlY2tlZFRvVGltZTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB9ZWxzZXsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJHNjb3BlLlRvdGltZUxpc3RbJHNjb3BlLmRheXNbZGF5Y291bnRdXS52YWx1ZSA9IHRvdGltZVswXS52YWx1ZTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJHNjb3BlLnNlbGVjdGVkVG9PcHRpb25bJHNjb3BlLmRheXNbZGF5Y291bnRdXSA9IHRvdGltZVswXS52YWx1ZTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgIH0KKworCisgICAgICAgICAgICAgICAgICAgIGlmKHVuY2hlY2tlZEZyb21UaW1lICE9PSB1bmRlZmluZWQpCisgICAgICAgICAgICAgICAgICAgICAgICAkc2NvcGUudW5jaGVja2VkRnJvbVRpbWUgPSB1bmNoZWNrZWRGcm9tVGltZTsKKworICAgICAgICAgICAgICAgICAgICBpZih1bmNoZWNrZWRUb1RpbWUgIT09IHVuZGVmaW5lZCkKKyAgICAgICAgICAgICAgICAgICAgICAgICRzY29wZS51bmNoZWNrZWRUb1RpbWUgPSB1bmNoZWNrZWRUb1RpbWU7CisgICAgICAgICAgICAgICAgfTsKKyAgICAgICAgICAgIH1dKQorCisgICAgICAgIC5kaXJlY3RpdmUoJ2F0dEhvdXJwaWNrZXJPcHRpb24nLCBbZnVuY3Rpb24oKSB7CisgICAgICAgICAgICAgICAgcmV0dXJuIHsKKyAgICAgICAgICAgICAgICAgICAgcmVzdHJpY3Q6ICdFQScsCisgICAgICAgICAgICAgICAgICAgIHJlcXVpcmU6ICdeYXR0SG91cnBpY2tlcicsCisgICAgICAgICAgICAgICAgICAgIHNjb3BlOiB7CisgICAgICAgICAgICAgICAgICAgICAgICBvcHRpb246ICI9b3B0aW9uIiwKKyAgICAgICAgICAgICAgICAgICAgICAgIGZyb210aW1lOiAiPWZyb210aW1lIiwKKyAgICAgICAgICAgICAgICAgICAgICAgIHRvdGltZTogIj10b3RpbWUiLAorICAgICAgICAgICAgICAgICAgICAgICAgcHJlc2VsZWN0OiAiPXByZXNlbGVjdCIsCisgICAgICAgICAgICAgICAgICAgICAgICB1bmNoZWNrZWRGcm9tVGltZTogIj0iLAorICAgICAgICAgICAgICAgICAgICAgICAgdW5jaGVja2VkVG9UaW1lOiAiPSIKKyAgICAgICAgICAgICAgICAgICAgfSwKKyAgICAgICAgICAgICAgICAgICAgbGluazogZnVuY3Rpb24oc2NvcGUsIGVsZW1lbnQsIGF0dHIsIGN0cmwpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIGN0cmwuc2V0T3B0aW9ucyhzY29wZS5vcHRpb24sIAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNjb3BlLmZyb210aW1lLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNjb3BlLnRvdGltZSwgCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2NvcGUucHJlc2VsZWN0LCAKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBzY29wZS51bmNoZWNrZWRGcm9tVGltZSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBzY29wZS51bmNoZWNrZWRUb1RpbWUpOworICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgfTsKKyAgICAgICAgICAgIH1dKQorCisgICAgICAgIC5kaXJlY3RpdmUoJ2F0dEhvdXJwaWNrZXInLCBbImhvdXJwaWNrZXJDb25maWciLCAiJGRvY3VtZW50IiwgIiRsb2ciLCAiJGRvY3VtZW50QmluZCIsICIkdGltZW91dCIsIGZ1bmN0aW9uKGhvdXJwaWNrZXJDb25maWcsICRkb2N1bWVudCwgJGxvZywgJGRvY3VtZW50QmluZCwgJHRpbWVvdXQpIHsKKyAgICAgICAgICAgICAgICByZXR1cm57CisgICAgICAgICAgICAgICAgICAgIHJlcXVpcmU6ICduZ01vZGVsJywKKyAgICAgICAgICAgICAgICAgICAgcmVzdHJpY3Q6ICdFQScsCisgICAgICAgICAgICAgICAgICAgIGNvbnRyb2xsZXI6ICdob3VyUGlja2VyQ29udHJvbGxlcicsCisgICAgICAgICAgICAgICAgICAgIHRyYW5zY2x1ZGU6IHRydWUsCisgICAgICAgICAgICAgICAgICAgIHNjb3BlOnsKKyAgICAgICAgICAgICAgICAgICAgICBtb2RlbDogIj1uZ01vZGVsIiwKKyAgICAgICAgICAgICAgICAgICAgICByZXNldEZsYWc6ICI9PyIKKyAgICAgICAgICAgICAgICAgICAgfSwKKyAgICAgICAgICAgICAgICAgICAgdGVtcGxhdGVVcmw6ICdhcHAvc2NyaXB0cy9uZ19qc19hdHRfdHBscy9ob3VycGlja2VyL2hvdXJwaWNrZXIuaHRtbCcsCisgICAgICAgICAgICAgICAgICAgIGxpbms6IGZ1bmN0aW9uKHNjb3BlLCBlbGVtZW50LCBhdHRyLCBjdHJsKSB7CisgICAgICAgICAgICAgICAgICAgICAgICB2YXIgZmxhZyA9IGZhbHNlOworICAgICAgICAgICAgICAgICAgICAgICAgc2NvcGUuaXNGcm9tRHJvcERvd25PcGVuID0gZmFsc2U7CisgICAgICAgICAgICAgICAgICAgICAgICBzY29wZS5pc1RvRHJvcERvd25PcGVuID0gZmFsc2U7CisgICAgICAgICAgICAgICAgICAgICAgICB2YXIgZHJvcERvd25PcGVuVmFsdWUgPSAiIjsKKyAgICAgICAgICAgICAgICAgICAgICAgIHZhciBjdXN0VGltZSA9IHt9OworICAgICAgICAgICAgICAgICAgICAgICAgc2NvcGUuZGF5cyA9IGhvdXJwaWNrZXJDb25maWcuZGF5czsKKyAgICAgICAgICAgICAgICAgICAgICAgIHNjb3BlLmRheXNMaXN0ID0ge307CisgICAgICAgICAgICAgICAgICAgICAgICBzY29wZS5GcnRpbWVMaXN0ID0ge307CisgICAgICAgICAgICAgICAgICAgICAgICBzY29wZS5GcnRpbWVMaXN0RGF5ID0ge307CisgICAgICAgICAgICAgICAgICAgICAgICBzY29wZS5Ub3RpbWVMaXN0RGF5ID0ge307CisgICAgICAgICAgICAgICAgICAgICAgICBzY29wZS5zZWxlY3RlZEZyb21PcHRpb24gPSB7fTsKKyAgICAgICAgICAgICAgICAgICAgICAgIHNjb3BlLnNlbGVjdGVkVG9PcHRpb24gPSB7fTsKKyAgICAgICAgICAgICAgICAgICAgICAgIHNjb3BlLlRvdGltZUxpc3QgPSB7fTsKKyAgICAgICAgICAgICAgICAgICAgICAgIHNjb3BlLnNlbGVjdGVkSW5kZXggPSAwOworICAgICAgICAgICAgICAgICAgICAgICAgc2NvcGUuc2VsZWN0ZWRPcHRpb24gPSAiU2VsZWN0IGZyb20gbGlzdCI7CisgICAgICAgICAgICAgICAgICAgICAgICBzY29wZS5jdXN0b21UaW1lID0gW107CisgICAgICAgICAgICAgICAgICAgICAgICAKKyAgICAgICAgICAgICAgICAgICAgICAgIHNjb3BlLnJlc2V0RmxhZyA9IGZhbHNlOworICAgICAgICAgICAgICAgICAgICAgICAgCisgICAgICAgICAgICAgICAgICAgICAgICBzY29wZS4kd2F0Y2goJ3Jlc2V0RmxhZycsIGZ1bmN0aW9uKG5ld1ZhbCwgb2xkVmFsKXsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZihuZXdWYWwgIT09IG9sZFZhbCl7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmKCBuZXdWYWwgPT09IHRydWUgJiYgc2NvcGUuc2VsZWN0ZWRPcHRpb24gPT09IGhvdXJwaWNrZXJDb25maWcuY3VzdG9tT3B0aW9uICl7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvL2Rpc2FibGUgYW5kIHJlc2V0IGFsbCBkYXlzIGNoZWNrYm94CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBmb3IgKGRheSBpbiBzY29wZS5kYXlzTGlzdCkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNjb3BlLmRheXNMaXN0W2RheV0gPSBmYWxzZTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzY29wZS5hZGRTZWxlY3RlZFZhbHVlKGRheSk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzY29wZS5wcmVzZWxlY3RVcGRhdGVGeG4oc2NvcGUucHJlc2VsZWN0KTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzY29wZS5yZXNldEZsYWcgPSBmYWxzZTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICB9KTsKKworICAgICAgICAgICAgICAgICAgICAgICAgc2NvcGUuJHdhdGNoKCdzZWxDYXRlZ29yeScsIGZ1bmN0aW9uKHZhbHVlKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHZhbHVlKXsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY3RybC4kc2V0Vmlld1ZhbHVlKHZhbHVlKTsgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgIH0pOworICAgICAgICAgICAgICAgICAgICAgICAgc2NvcGUuJHdhdGNoKCdtb2RlbCcsIGZ1bmN0aW9uKHZhbHVlLG9sZFZhbHVlKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHZhbHVlICYmIG9sZFZhbHVlICYmIGFuZ3VsYXIudG9Kc29uKHZhbHVlKSAhPT0gYW5ndWxhci50b0pzb24ob2xkVmFsdWUpKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2NvcGUudXBkYXRlRGF0YSh2YWx1ZSkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB9fSk7CisgICAgICAgICAgICAgICAgICAgICAgICAKKyAgICAgICAgICAgICAgICAgICAgICAgIHNjb3BlLnVwZGF0ZURhdGEgPSBmdW5jdGlvbih2YWx1ZSkKKyAgICAgICAgICAgICAgICAgICAgICAgIHsgICAgICAgICAgICAgICAgICAgICAgICAKKyAgICAgICAgICAgICAgICAgICAgICAgIGlmICh2YWx1ZS5jb25zdHJ1Y3RvciA9PT0gQXJyYXkpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNjb3BlLnNob3dEYXlzU2VsZWN0b3IgPSB0cnVlOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2NvcGUuc2VsZWN0ZWRPcHRpb24gPSBob3VycGlja2VyQ29uZmlnLmN1c3RvbU9wdGlvbjsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZvciAodmFyIGFycnkgaW4gdmFsdWUpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YXIgZGF5ID0gdmFsdWVbYXJyeV0uZGF5OworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNjb3BlLmRheXNMaXN0W2RheV0gPSB0cnVlOworCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZm9yICh2YXIgZnJvbWNvdW50IGluIHNjb3BlLmZyb210aW1lKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChzY29wZS5mcm9tdGltZVtmcm9tY291bnRdLnZhbHVlID09PSB2YWx1ZVthcnJ5XS5Gcm9tVGltZSkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2NvcGUuRnJ0aW1lTGlzdFtkYXldLnZhbHVlID0gc2NvcGUuZnJvbXRpbWVbZnJvbWNvdW50XS52YWx1ZTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNjb3BlLnNlbGVjdGVkRnJvbU9wdGlvbltkYXldID0gc2NvcGUuRnJ0aW1lTGlzdFtkYXldLnZhbHVlOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZvciAodmFyIHRvY291bnQgaW4gc2NvcGUudG90aW1lKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChzY29wZS50b3RpbWVbdG9jb3VudF0udmFsdWUgPT09IHZhbHVlW2FycnldLlRvVGltZSkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2NvcGUuVG90aW1lTGlzdFtkYXldLnZhbHVlID0gc2NvcGUudG90aW1lW3RvY291bnRdLnZhbHVlOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2NvcGUuc2VsZWN0ZWRUb09wdGlvbltkYXldID0gc2NvcGUuVG90aW1lTGlzdFtkYXldLnZhbHVlOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNjb3BlLmFkZFNlbGVjdGVkVmFsdWUoZGF5LCB2YWx1ZVthcnJ5XS5Gcm9tVGltZSwgdmFsdWVbYXJyeV0uVG9UaW1lKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvL2ZvciBJRTggRml4CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHBhcnNlSW50KGFycnkpICsgMSA9PT0gdmFsdWUubGVuZ3RoKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBlbHNlIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNjb3BlLnNlbGVjdE9wdGlvbih2YWx1ZS5kYXkpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgICAgIAorICAgICAgICAgICAgICAgICAgICAgICAgc2NvcGUuJHdhdGNoKCdwcmVzZWxlY3QnLCBmdW5jdGlvbih2YWx1ZSkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNjb3BlLnByZXNlbGVjdFVwZGF0ZUZ4bih2YWx1ZSk7CisgICAgICAgICAgICAgICAgICAgICAgICB9KTsKKyAgICAgICAgICAgICAgICAgICAgICAgIAorICAgICAgICAgICAgICAgICAgICAgICAgc2NvcGUucHJlc2VsZWN0VXBkYXRlRnhuID0gZnVuY3Rpb24odmFsdWUpeworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICh2YWx1ZSAhPT0gdW5kZWZpbmVkKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZihzY29wZS5vcHRpb25zKXsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhbHVlID0gc2NvcGUudmFsaWRhdGVQcmVzZWxlY3REYXRhKHZhbHVlKTsgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAodmFsdWUgPT09ICIiKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm47CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2NvcGUudXBkYXRlRGF0YSh2YWx1ZSk7ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgIH0KKworICAgICAgICAgICAgICAgICAgICAgICAgc2NvcGUudmFsaWRhdGVQcmVzZWxlY3REYXRhID0gZnVuY3Rpb24odmFsdWUpCisgICAgICAgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHZhbHVlLmNvbnN0cnVjdG9yID09PSBBcnJheSkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBmb3IgKHZhciBhcnJ5IGluIHZhbHVlKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YXIgZGF5ID0gdmFsdWVbYXJyeV0uZGF5OworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFyIGlzRGF5Rm91bmQgPSBmYWxzZTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhciBpc0ZybUZvdW5kID0gZmFsc2U7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YXIgaXNUb0ZvdW5kID0gZmFsc2U7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBmb3IgKHZhciBkYXljb3VudCBpbiBzY29wZS5kYXlzKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHNjb3BlLmRheXNbZGF5Y291bnRdID09PSBkYXkpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaXNEYXlGb3VuZCA9IHRydWU7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICghaXNEYXlGb3VuZCkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhbHVlLnNwbGljZShhcnJ5LCAxKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb250aW51ZTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZvciAodmFyIGZyb21jb3VudCBpbiBzY29wZS5mcm9tdGltZSkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChzY29wZS5mcm9tdGltZVtmcm9tY291bnRdLnZhbHVlID09PSB2YWx1ZVthcnJ5XS5Gcm9tVGltZSkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpc0ZybUZvdW5kID0gdHJ1ZTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKCFpc0ZybUZvdW5kKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFsdWVbYXJyeV0uRnJvbVRpbWUgPSBzY29wZS5mcm9tdGltZVswXS52YWx1ZTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZvciAodmFyIHRvY291bnQgaW4gc2NvcGUudG90aW1lKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHNjb3BlLnRvdGltZVt0b2NvdW50XS52YWx1ZSA9PT0gdmFsdWVbYXJyeV0uVG9UaW1lKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlzVG9Gb3VuZCA9IHRydWU7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICghaXNUb0ZvdW5kKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFsdWVbYXJyeV0uVG9UaW1lID0gc2NvcGUudG90aW1lWzBdLnZhbHVlOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLy9mb3IgSUU4IEZpeAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHBhcnNlSW50KGFycnkpICsgMSA9PT0gdmFsdWUubGVuZ3RoKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgZWxzZSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhciBpc09wdGlvbkZvdW5kID0gZmFsc2U7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZvciAodmFyIG9wdGNvdW50IGluIHNjb3BlLm9wdGlvbnMpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChzY29wZS5vcHRpb25zW29wdGNvdW50XSA9PT0gdmFsdWUuZGF5KSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaXNPcHRpb25Gb3VuZCA9IHRydWU7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKCFpc09wdGlvbkZvdW5kKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YWx1ZSA9ICIiOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiB2YWx1ZTsKKyAgICAgICAgICAgICAgICAgICAgICAgIH07CisKKyAgICAgICAgICAgICAgICAgICAgICAgIHNjb3BlLnNlbGVjdFByZXZOZXh0VmFsdWUgPSBmdW5jdGlvbigkZXZlbnQsIGFycmF5VmFsdWVzLCBjdXJyVmFsdWUpIHsKKworICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhciB2YWx1ZTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YXIgaW5kZXggPSAwOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICgkZXZlbnQua2V5Q29kZSA9PT0gMzgpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFsdWUgPSAtMTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKCRldmVudC5rZXlDb2RlID09PSA0MCkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YWx1ZSA9IDE7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGN1cnJWYWx1ZTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CisKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoYXJyYXlWYWx1ZXMuaW5kZXhPZihjdXJyVmFsdWUpICE9PSAtMSkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpbmRleCA9IGFycmF5VmFsdWVzLmluZGV4T2YoY3VyclZhbHVlKSArIHZhbHVlOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZvciAodmFyIGNvdW50IGluIGFycmF5VmFsdWVzKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoYXJyYXlWYWx1ZXNbY291bnRdLnZhbHVlID09PSBjdXJyVmFsdWUpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpbmRleCA9IHBhcnNlSW50KGNvdW50KSArIHZhbHVlOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQorCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGluZGV4ID09PSBhcnJheVZhbHVlcy5sZW5ndGgpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaW5kZXggPSBpbmRleCAtIDE7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIGlmIChpbmRleCA9PT0gLTEpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaW5kZXggPSBpbmRleCArIDE7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQorCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgJGV2ZW50LnByZXZlbnREZWZhdWx0KCk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGFycmF5VmFsdWVzW2luZGV4XS52YWx1ZSkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGFycmF5VmFsdWVzW2luZGV4XS52YWx1ZTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBhcnJheVZhbHVlc1tpbmRleF07CisgICAgICAgICAgICAgICAgICAgICAgICB9OworCisgICAgICAgICAgICAgICAgICAgICAgICBzY29wZS5zaG93RHJvcGRvd24gPSBmdW5jdGlvbigpCisgICAgICAgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2NvcGUuc2hvd2xpc3QgPSAhc2NvcGUuc2hvd2xpc3Q7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgZmxhZyA9ICFmbGFnOworICAgICAgICAgICAgICAgICAgICAgICAgfTsKKworICAgICAgICAgICAgICAgICAgICAgICAgc2NvcGUuc2hvd2Zyb21EYXlEcm9wZG93biA9IGZ1bmN0aW9uKHZhbHVlKQorICAgICAgICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vY2xvc2UgZHJvcGRvd24gaWYgYW55IG90aGVyIEZyb20gZHJvcCBkb3duIGlzIG9wZW5lZAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZvciAoY291bnQgaW4gc2NvcGUuRnJ0aW1lTGlzdERheSkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoY291bnQgIT09IHZhbHVlICYmIHNjb3BlLkZydGltZUxpc3REYXlbY291bnRdID09PSB0cnVlKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzY29wZS5GcnRpbWVMaXN0RGF5W2NvdW50XSA9IGZhbHNlOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZvciAoY291bnQgaW4gc2NvcGUuVG90aW1lTGlzdERheSkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoc2NvcGUuVG90aW1lTGlzdERheVtjb3VudF0gPT09IHRydWUpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNjb3BlLlRvdGltZUxpc3REYXlbY291bnRdID0gZmFsc2U7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2NvcGUuRnJ0aW1lTGlzdERheVt2YWx1ZV0gPSAhc2NvcGUuRnJ0aW1lTGlzdERheVt2YWx1ZV07CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgZmxhZyA9ICFmbGFnOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNjb3BlLnNob3dsaXN0ID0gZmFsc2U7CisKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAvL3NhdmUgbW9kZWwgdmFsdWUgc28gd2UgY2FuIGNsb3NlIGN1cnJlbnQgZHJvcGRvd24gb24gY2xpY2sgb2Ygb3RoZXIgcGFydCBvZiB0aGUgZG9jdW1lbnQKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoc2NvcGUuRnJ0aW1lTGlzdERheVt2YWx1ZV0pIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2NvcGUuaXNGcm9tRHJvcERvd25PcGVuID0gdHJ1ZTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZHJvcERvd25PcGVuVmFsdWUgPSB2YWx1ZTsKKworICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNjb3BlLmlzRnJvbURyb3BEb3duT3BlbiA9IGZhbHNlOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAkdGltZW91dChmdW5jdGlvbiAoKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmKHNjb3BlLkZydGltZUxpc3REYXlbdmFsdWVdKXsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhciBkYXlzQ29udGFpbmVyRElWID0gYW5ndWxhci5lbGVtZW50KGVsZW1lbnQpWzBdLnF1ZXJ5U2VsZWN0b3IoIi5jdXN0b21kYXlzLXdpZHRoIik7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YXIgY29udGFpbmVyVUwgPSBhbmd1bGFyLmVsZW1lbnQoZGF5c0NvbnRhaW5lckRJVi5xdWVyeVNlbGVjdG9yKCcuc2VsZWN0Mi1jb250YWluZXItYWN0aXZlJykpLnBhcmVudCgpWzBdLnF1ZXJ5U2VsZWN0b3IoInVsIik7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YXIgc2VsZWN0ZWRFbGVtVG9wUG9zID0gYW5ndWxhci5lbGVtZW50KGNvbnRhaW5lclVMLnF1ZXJ5U2VsZWN0b3IoJy5zZWxlY3RlZEl0ZW1JbkRyb3BEb3duJykpWzBdLm9mZnNldFRvcDsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGFuZ3VsYXIuZWxlbWVudChjb250YWluZXJVTClbMF0uc2Nyb2xsVG9wID0gc2VsZWN0ZWRFbGVtVG9wUG9zOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgCisgICAgICAgICAgICAgICAgICAgICAgICB9OworCisgICAgICAgICAgICAgICAgICAgICAgICBzY29wZS5zaG93dG9EYXlEcm9wZG93biA9IGZ1bmN0aW9uKHZhbHVlKQorICAgICAgICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vY2xvc2UgZHJvcGRvd24gaWYgYW55IG90aGVyIFRvIGRyb3AgZG93biBpcyBvcGVuZWQKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBmb3IgKGNvdW50IGluIHNjb3BlLlRvdGltZUxpc3REYXkpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGNvdW50ICE9PSB2YWx1ZSAmJiBzY29wZS5Ub3RpbWVMaXN0RGF5W2NvdW50XSA9PT0gdHJ1ZSkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2NvcGUuVG90aW1lTGlzdERheVtjb3VudF0gPSBmYWxzZTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBmb3IgKGNvdW50IGluIHNjb3BlLkZydGltZUxpc3REYXkpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHNjb3BlLkZydGltZUxpc3REYXlbY291bnRdID09PSB0cnVlKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzY29wZS5GcnRpbWVMaXN0RGF5W2NvdW50XSA9IGZhbHNlOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNjb3BlLlRvdGltZUxpc3REYXlbdmFsdWVdID0gIXNjb3BlLlRvdGltZUxpc3REYXlbdmFsdWVdOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZsYWcgPSAhZmxhZzsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBzY29wZS5zaG93bGlzdCA9IGZhbHNlOworCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgLy9zYXZlIG1vZGVsIHZhbHVlIHNvIHdlIGNhbiBjbG9zZSBjdXJyZW50IGRyb3Bkb3duIG9uIGNsaWNrIG9mIG90aGVyIHBhcnQgb2YgdGhlIGRvY3VtZW50CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHNjb3BlLlRvdGltZUxpc3REYXlbdmFsdWVdKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNjb3BlLmlzVG9Ecm9wRG93bk9wZW4gPSB0cnVlOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBkcm9wRG93bk9wZW5WYWx1ZSA9IHZhbHVlOworCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2NvcGUuaXNUb0Ryb3BEb3duT3BlbiA9IGZhbHNlOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAkdGltZW91dChmdW5jdGlvbiAoKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmKHNjb3BlLkZydGltZUxpc3REYXlbdmFsdWVdKXsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhciBkYXlzQ29udGFpbmVyRElWID0gYW5ndWxhci5lbGVtZW50KGVsZW1lbnQpWzBdLnF1ZXJ5U2VsZWN0b3IoIi5jdXN0b21kYXlzLXdpZHRoIik7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YXIgY29udGFpbmVyVUwgPSBhbmd1bGFyLmVsZW1lbnQoZGF5c0NvbnRhaW5lckRJVi5xdWVyeVNlbGVjdG9yKCcuc2VsZWN0Mi1jb250YWluZXItYWN0aXZlJykpLnBhcmVudCgpWzBdLnF1ZXJ5U2VsZWN0b3IoInVsIik7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YXIgc2VsZWN0ZWRFbGVtVG9wUG9zID0gYW5ndWxhci5lbGVtZW50KGNvbnRhaW5lclVMLnF1ZXJ5U2VsZWN0b3IoJy5zZWxlY3RlZEl0ZW1JbkRyb3BEb3duJykpWzBdLm9mZnNldFRvcDsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGFuZ3VsYXIuZWxlbWVudChjb250YWluZXJVTClbMF0uc2Nyb2xsVG9wID0gc2VsZWN0ZWRFbGVtVG9wUG9zOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgCisgICAgICAgICAgICAgICAgICAgICAgICB9OworCisgICAgICAgICAgICAgICAgICAgICAgICBzY29wZS5zZWxlY3RGcm9tRGF5T3B0aW9uID0gZnVuY3Rpb24oZGF5LCB2YWx1ZSkKKyAgICAgICAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBzY29wZS5zZWxlY3RlZEZyb21PcHRpb25bZGF5XSA9IHZhbHVlOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNjb3BlLkZydGltZUxpc3RbZGF5XS52YWx1ZSA9IHZhbHVlOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNjb3BlLkZydGltZUxpc3REYXlbZGF5XSA9IGZhbHNlOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNjb3BlLmlzRnJvbURyb3BEb3duT3BlbiA9IGZhbHNlOworICAgICAgICAgICAgICAgICAgICAgICAgfTsKKworICAgICAgICAgICAgICAgICAgICAgICAgc2NvcGUuc2VsZWN0VG9EYXlPcHRpb24gPSBmdW5jdGlvbihkYXksIHZhbHVlKQorICAgICAgICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNjb3BlLnNlbGVjdGVkVG9PcHRpb25bZGF5XSA9IHZhbHVlOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNjb3BlLlRvdGltZUxpc3RbZGF5XS52YWx1ZSA9IHZhbHVlOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNjb3BlLlRvdGltZUxpc3REYXlbZGF5XSA9IGZhbHNlOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNjb3BlLmlzVG9Ecm9wRG93bk9wZW4gPSBmYWxzZTsKKyAgICAgICAgICAgICAgICAgICAgICAgIH07CisKKyAgICAgICAgICAgICAgICAgICAgICAgIHNjb3BlLmFkZFNlbGVjdGVkVmFsdWUgPSBmdW5jdGlvbih2YWx1ZSwgZnJvbXRpbWUsIHRvdGltZSkKKyAgICAgICAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoc2NvcGUuZGF5c0xpc3RbdmFsdWVdICE9PSB1bmRlZmluZWQgJiYgIXNjb3BlLmRheXNMaXN0W3ZhbHVlXSkgeworCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZm9yICh2YXIgY291bnQgPSAwLCBsZW4gPSBzY29wZS5jdXN0b21UaW1lLmxlbmd0aDsgY291bnQgPCBsZW47IGNvdW50KyspIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChzY29wZS5jdXN0b21UaW1lW2NvdW50XS5kYXkgPT09IHZhbHVlKSB7CisKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZihzY29wZS51bmNoZWNrZWRGcm9tVGltZSkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2NvcGUuc2VsZWN0ZWRGcm9tT3B0aW9uW3Njb3BlLmN1c3RvbVRpbWVbY291bnRdLmRheV0gPSBzY29wZS51bmNoZWNrZWRGcm9tVGltZTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNjb3BlLnNlbGVjdGVkRnJvbU9wdGlvbltzY29wZS5jdXN0b21UaW1lW2NvdW50XS5kYXldICA9IHNjb3BlLkZydGltZUxpc3Rbc2NvcGUuY3VzdG9tVGltZVtjb3VudF0uZGF5XS52YWx1ZTsKKworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmKHNjb3BlLnVuY2hlY2tlZFRvVGltZSkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2NvcGUuc2VsZWN0ZWRUb09wdGlvbltzY29wZS5jdXN0b21UaW1lW2NvdW50XS5kYXldID0gc2NvcGUudW5jaGVja2VkVG9UaW1lOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2NvcGUuc2VsZWN0ZWRUb09wdGlvbltzY29wZS5jdXN0b21UaW1lW2NvdW50XS5kYXldID0gc2NvcGUuVG90aW1lTGlzdFtzY29wZS5jdXN0b21UaW1lW2NvdW50XS5kYXldLnZhbHVlOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNjb3BlLmN1c3RvbVRpbWUuc3BsaWNlKGNvdW50LCAxKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQorCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgICAgIGVsc2UgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYoc2NvcGUuc2VsZWN0ZWRGcm9tT3B0aW9uW3ZhbHVlXSA9PSBzY29wZS51bmNoZWNrZWRGcm9tVGltZSl7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzY29wZS5zZWxlY3RlZEZyb21PcHRpb25bdmFsdWVdID0gc2NvcGUuZnJvbXRpbWVbMF0udmFsdWU7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBmcm9tdGltZSA9IHNjb3BlLmZyb210aW1lWzBdLnZhbHVlOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2NvcGUuRnJ0aW1lTGlzdFt2YWx1ZV0udmFsdWUgPSBzY29wZS5mcm9tdGltZVswXS52YWx1ZTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQorCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmKHNjb3BlLnNlbGVjdGVkVG9PcHRpb25bdmFsdWVdICA9PSBzY29wZS51bmNoZWNrZWRUb1RpbWUpeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2NvcGUuc2VsZWN0ZWRUb09wdGlvblt2YWx1ZV09IHNjb3BlLnRvdGltZVswXS52YWx1ZTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRvdGltZSA9IHNjb3BlLnRvdGltZVswXS52YWx1ZTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNjb3BlLlRvdGltZUxpc3RbdmFsdWVdLnZhbHVlID0gc2NvcGUudG90aW1lWzBdLnZhbHVlOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjdXN0VGltZVsiZGF5Il0gPSB2YWx1ZTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY3VzdFRpbWVbIkZyb21UaW1lIl0gPSAgc2NvcGUuRnJ0aW1lTGlzdFt2YWx1ZV0udmFsdWU7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGN1c3RUaW1lWyJUb1RpbWUiXSA9IHNjb3BlLlRvdGltZUxpc3RbdmFsdWVdLnZhbHVlOworCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhciBjb3VudCA9IDAsIGxlbiA9IHNjb3BlLmN1c3RvbVRpbWUubGVuZ3RoOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBmb3IgKDsgY291bnQgPCBsZW47IGNvdW50KyspIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChzY29wZS5jdXN0b21UaW1lW2NvdW50XS5kYXkgPT09IHZhbHVlKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2NvcGUuY3VzdG9tVGltZVtjb3VudF0uRnJvbVRpbWUgPSBjdXN0VGltZVsiRnJvbVRpbWUiXTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzY29wZS5jdXN0b21UaW1lW2NvdW50XS5Ub1RpbWUgPSBjdXN0VGltZVsiVG9UaW1lIl07CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGNvdW50ID09PSBsZW4pIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhciB4ID0gYW5ndWxhci5jb3B5KGN1c3RUaW1lKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNjb3BlLmN1c3RvbVRpbWUucHVzaCh4KTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBzY29wZS5zZWxDYXRlZ29yeSA9IHNjb3BlLmN1c3RvbVRpbWU7CisgICAgICAgICAgICAgICAgICAgICAgICB9OworCisKKyAgICAgICAgICAgICAgICAgICAgICAgIHZhciBvdXRzaWRlQ2xpY2sgPSBmdW5jdGlvbihlKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHNjb3BlLnNob3dsaXN0KSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNjb3BlLiRhcHBseShmdW5jdGlvbigpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNjb3BlLnNob3dsaXN0ID0gZmFsc2U7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0pOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgIH07CisKKyAgICAgICAgICAgICAgICAgICAgICAgICRkb2N1bWVudEJpbmQuY2xpY2soJ3Nob3dsaXN0Jywgb3V0c2lkZUNsaWNrLCBzY29wZSk7CisKKyAgICAgICAgICAgICAgICAgICAgICAgIHZhciBvdXRzaWRlQ2xpY2tGcm9tRHJvcGRvd24gPSBmdW5jdGlvbihlKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2NvcGUuJGFwcGx5KGZ1bmN0aW9uKCkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoc2NvcGUuaXNGcm9tRHJvcERvd25PcGVuKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzY29wZS5GcnRpbWVMaXN0RGF5W2Ryb3BEb3duT3BlblZhbHVlXSA9IGZhbHNlOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2NvcGUuaXNGcm9tRHJvcERvd25PcGVuID0gZmFsc2U7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB9KTsKKyAgICAgICAgICAgICAgICAgICAgICAgIH07CisKKyAgICAgICAgICAgICAgICAgICAgICAgICRkb2N1bWVudEJpbmQuY2xpY2soJ2lzRnJvbURyb3BEb3duT3BlbicsIG91dHNpZGVDbGlja0Zyb21Ecm9wZG93biwgc2NvcGUpOworCisgICAgICAgICAgICAgICAgICAgICAgICB2YXIgb3V0c2lkZUNsaWNrVG9Ecm9wZG93biA9IGZ1bmN0aW9uKGUpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBzY29wZS4kYXBwbHkoZnVuY3Rpb24oKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChzY29wZS5pc1RvRHJvcERvd25PcGVuKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzY29wZS5Ub3RpbWVMaXN0RGF5W2Ryb3BEb3duT3BlblZhbHVlXSA9IGZhbHNlOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2NvcGUuaXNUb0Ryb3BEb3duT3BlbiA9IGZhbHNlOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSk7CisgICAgICAgICAgICAgICAgICAgICAgICB9OworCisgICAgICAgICAgICAgICAgICAgICAgICAkZG9jdW1lbnRCaW5kLmNsaWNrKCdpc1RvRHJvcERvd25PcGVuJywgb3V0c2lkZUNsaWNrVG9Ecm9wZG93biwgc2NvcGUpOworCisgICAgICAgICAgICAgICAgICAgICAgICBzY29wZS5zZWxlY3RPcHRpb24gPSBmdW5jdGlvbihzSXRlbSkKKyAgICAgICAgICAgICAgICAgICAgICAgIHsKKworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChzSXRlbSA9PT0gaG91cnBpY2tlckNvbmZpZy5jdXN0b21PcHRpb24pIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2NvcGUuc2hvd0RheXNTZWxlY3RvciA9IHRydWU7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNjb3BlLnNlbENhdGVnb3J5ID0gc2NvcGUuY3VzdG9tVGltZTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzY29wZS5zaG93RGF5c1NlbGVjdG9yID0gZmFsc2U7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhciBmcm9tVGltZSA9IC9bMC05XVxzP2FtL2kuZXhlYyhzSXRlbSk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhciB0b1RpbWUgPSAvWzAtOV1ccz9wbS9pLmV4ZWMoc0l0ZW0pOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzY29wZS5zZWxDYXRlZ29yeSA9IHtkYXk6IHNJdGVtLCBGcm9tVGltZTogZnJvbVRpbWUgPT09IG51bGwgPyAnTkEnIDogZnJvbVRpbWVbMF0sIFRvVGltZTogdG9UaW1lID09PSBudWxsID8gJ05BJyA6IHRvVGltZVswXX07CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQorCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2NvcGUuc2hvd2xpc3QgPSBmYWxzZTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBmbGFnID0gZmFsc2U7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2NvcGUuc2VsZWN0ZWRPcHRpb24gPSBzSXRlbTsKKyAgICAgICAgICAgICAgICAgICAgICAgIH07CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICB9OworICAgICAgICAgICAgfV0pOworCithbmd1bGFyLm1vZHVsZSgnYXR0LmFicy5pY29uQnV0dG9ucycsIFtdKQorCisgICAgICAgIC5jb25zdGFudCgnYnV0dG9uQ29uZmlnJywgeworICAgICAgICAgICAgYWN0aXZlQ2xhc3M6ICdhY3RpdmUtLWJ1dHRvbicsCisgICAgICAgICAgICB0b2dnbGVFdmVudDogJ2NsaWNrJworICAgICAgICB9KQorCisgICAgICAgIC5kaXJlY3RpdmUoJ2F0dEljb25CdG5SYWRpbycsIFsnYnV0dG9uQ29uZmlnJywgZnVuY3Rpb24oYnV0dG9uQ29uZmlnKSB7CisgICAgICAgICAgICAgICAgdmFyIGFjdGl2ZUNsYXNzID0gYnV0dG9uQ29uZmlnLmFjdGl2ZUNsYXNzIHx8ICdhY3RpdmUtLWJ1dHRvbic7CisgICAgICAgICAgICAgICAgdmFyIHRvZ2dsZUV2ZW50ID0gYnV0dG9uQ29uZmlnLnRvZ2dsZUV2ZW50IHx8ICdjbGljayc7CisKKyAgICAgICAgICAgICAgICByZXR1cm4geworICAgICAgICAgICAgICAgICAgICByZXF1aXJlOiAnbmdNb2RlbCcsCisgICAgICAgICAgICAgICAgICAgIGxpbms6IGZ1bmN0aW9uKHNjb3BlLCBlbGVtZW50LCBhdHRycywgbmdNb2RlbEN0cmwpIHsKKworICAgICAgICAgICAgICAgICAgICAgICAgZWxlbWVudC5hdHRyKCJyb2xlIiwiYnV0dG9uIik7CisJCQllbGVtZW50LmF0dHIoInRhYmluZGV4IiwiMCIpOworICAgICAgICAgICAgICAgICAgICAgICAgZWxlbWVudC5hcHBlbmQoIjxzcGFuIGNsYXNzPSdoaWRkZW4tc3Bva2VuJz4iK2F0dHJzLmF0dEljb25CdG5SYWRpbysiPC9zcGFuPiIpOworICAgICAgICAgICAgICAgICAgICAgICAgCisgICAgICAgICAgICAgICAgICAgICAgICAvL21vZGVsIC0+IFVJCisgICAgICAgICAgICAgICAgICAgICAgICBuZ01vZGVsQ3RybC4kcmVuZGVyID0gZnVuY3Rpb24oKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgZWxlbWVudC5wYXJlbnQoKS50b2dnbGVDbGFzcyhhY3RpdmVDbGFzcywgYW5ndWxhci5lcXVhbHMobmdNb2RlbEN0cmwuJG1vZGVsVmFsdWUsIGF0dHJzLmF0dEljb25CdG5SYWRpbykpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8qaWYobmdNb2RlbEN0cmwuJG1vZGVsVmFsdWUhPT11bmRlZmluZWQpeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoYW5ndWxhci5lcXVhbHMobmdNb2RlbEN0cmwuJG1vZGVsVmFsdWUsIGF0dHJzLmF0dEljb25CdG5SYWRpbykpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGVsZW1lbnQuYXR0cigiYXJpYS1zZWxlY3RlZCIsIHRydWUpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGVsc2UgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZWxlbWVudC5hdHRyKCJhcmlhLXNlbGVjdGVkIiwgZmFsc2UpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSovCisgICAgICAgICAgICAgICAgICAgICAgICB9OworCisgICAgICAgICAgICAgICAgICAgICAgICAvL3VpLT5tb2RlbAorICAgICAgICAgICAgICAgICAgICAgICAgZWxlbWVudC5wYXJlbnQoKS5iaW5kKHRvZ2dsZUV2ZW50LCBmdW5jdGlvbigpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoIWVsZW1lbnQucGFyZW50KCkuaGFzQ2xhc3MoYWN0aXZlQ2xhc3MpKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNjb3BlLiRhcHBseShmdW5jdGlvbigpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG5nTW9kZWxDdHJsLiRzZXRWaWV3VmFsdWUoYXR0cnMuYXR0SWNvbkJ0blJhZGlvKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG5nTW9kZWxDdHJsLiRyZW5kZXIoKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgfSk7CisKKworICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgfTsKKyAgICAgICAgICAgIH1dKQorICAgICAgICAuZGlyZWN0aXZlKCdhdHRJY29uQnRuQ2hlY2tib3gnLCBbJ2J1dHRvbkNvbmZpZycsIGZ1bmN0aW9uKGJ1dHRvbkNvbmZpZykgeworICAgICAgICAgICAgICAgIHZhciBhY3RpdmVDbGFzcyA9IGJ1dHRvbkNvbmZpZy5hY3RpdmVDbGFzcyB8fCAnYWN0aXZlLS1idXR0b24nOworICAgICAgICAgICAgICAgIHZhciB0b2dnbGVFdmVudCA9IGJ1dHRvbkNvbmZpZy50b2dnbGVFdmVudCB8fCAnY2xpY2snOworCisgICAgICAgICAgICAgICAgcmV0dXJuIHsKKyAgICAgICAgICAgICAgICAgICAgcmVxdWlyZTogJ25nTW9kZWwnLAorICAgICAgICAgICAgICAgICAgICBsaW5rOiBmdW5jdGlvbihzY29wZSwgZWxlbWVudCwgYXR0cnMsIG5nTW9kZWxDdHJsKSB7CisKKyAgICAgICAgICAgICAgICAgICAgICAgIGVsZW1lbnQuYXR0cigicm9sZSIsImJ1dHRvbiIpOworCQkJZWxlbWVudC5hdHRyKCJ0YWJpbmRleCIsIjAiKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIGVsZW1lbnQuYXBwZW5kKCI8c3BhbiBjbGFzcz0naGlkZGVuLXNwb2tlbic+IithdHRycy5hdHRJY29uQnRuQ2hlY2tib3grIjwvc3Bhbj4iKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIAorICAgICAgICAgICAgICAgICAgICAgICAgZnVuY3Rpb24gZ2V0VHJ1ZVZhbHVlKCkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhciB0cnVlVmFsdWUgPSBzY29wZS4kZXZhbChhdHRycy5idG5DaGVja2JveFRydWUpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBhbmd1bGFyLmlzRGVmaW5lZCh0cnVlVmFsdWUpID8gdHJ1ZVZhbHVlIDogdHJ1ZTsKKyAgICAgICAgICAgICAgICAgICAgICAgIH0KKworICAgICAgICAgICAgICAgICAgICAgICAgZnVuY3Rpb24gZ2V0RmFsc2VWYWx1ZSgpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YXIgZmFsc2VWYWx1ZSA9IHNjb3BlLiRldmFsKGF0dHJzLmJ0bkNoZWNrYm94RmFsc2UpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBhbmd1bGFyLmlzRGVmaW5lZChmYWxzZVZhbHVlKSA/IGZhbHNlVmFsdWUgOiBmYWxzZTsKKyAgICAgICAgICAgICAgICAgICAgICAgIH0KKworICAgICAgICAgICAgICAgICAgICAgICAgLy9tb2RlbCAtPiBVSQorICAgICAgICAgICAgICAgICAgICAgICAgbmdNb2RlbEN0cmwuJHJlbmRlciA9IGZ1bmN0aW9uKCkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGVsZW1lbnQucGFyZW50KCkudG9nZ2xlQ2xhc3MoYWN0aXZlQ2xhc3MsIGFuZ3VsYXIuZXF1YWxzKG5nTW9kZWxDdHJsLiRtb2RlbFZhbHVlLCBnZXRUcnVlVmFsdWUoKSkpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8qaWYobmdNb2RlbEN0cmwuJG1vZGVsVmFsdWUhPT11bmRlZmluZWQpeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoKGFuZ3VsYXIuZXF1YWxzKG5nTW9kZWxDdHJsLiRtb2RlbFZhbHVlLCBnZXRUcnVlVmFsdWUoKSkpKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBlbGVtZW50LmF0dHIoImFyaWEtc2VsZWN0ZWQiLCB0cnVlKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBlbHNlIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGVsZW1lbnQuYXR0cigiYXJpYS1zZWxlY3RlZCIsIGZhbHNlKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0qLworICAgICAgICAgICAgICAgICAgICAgICAgfTsKKworICAgICAgICAgICAgICAgICAgICAgICAgLy91aS0+bW9kZWwKKyAgICAgICAgICAgICAgICAgICAgICAgIGVsZW1lbnQucGFyZW50KCkuYmluZCh0b2dnbGVFdmVudCwgZnVuY3Rpb24oKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2NvcGUuJGFwcGx5KGZ1bmN0aW9uKCkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBuZ01vZGVsQ3RybC4kc2V0Vmlld1ZhbHVlKGVsZW1lbnQucGFyZW50KCkuaGFzQ2xhc3MoYWN0aXZlQ2xhc3MpID8gZ2V0RmFsc2VWYWx1ZSgpIDogZ2V0VHJ1ZVZhbHVlKCkpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBuZ01vZGVsQ3RybC4kcmVuZGVyKCk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSk7CisgICAgICAgICAgICAgICAgICAgICAgICB9KTsKKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIH07CisgICAgICAgICAgICB9XSk7CisKK2FuZ3VsYXIubW9kdWxlKCdhdHQuYWJzLmxpbmtzJywgW10pCisgICAgICAgIC5kaXJlY3RpdmUoJ2F0dExpbmsnLCBbJyRjb21waWxlJyxmdW5jdGlvbigkY29tcGlsZSkgeworICAgICAgICAgICAgICAgIHJldHVybiB7CisgICAgICAgICAgICAgICAgICAgIHJlc3RyaWN0OiAnQScsCisgICAgICAgICAgICAgICAgICAgIGxpbms6IGZ1bmN0aW9uKHNjb3BlLCBlbGVtLCBhdHRyKSB7CisgICAgICAgICAgICAgICAgICAgICAgICBlbGVtLmFkZENsYXNzKCdsaW5rJyk7CisgICAgICAgICAgICAgICAgICAgICAgICBpZighKGVsZW0uYXR0cignaHJlZicpKSl7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgZWxlbS5hdHRyKCJ0YWJpbmRleCIsICIwIik7CisgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICB9OworICAgICAgICAgICAgfV0pCisgICAgICAgIC5kaXJlY3RpdmUoJ2F0dExpbmtWaXNpdGVkJywgWyckY29tcGlsZScsZnVuY3Rpb24oJGNvbXBpbGUpIHsKKyAgICAgICAgICAgICAgICByZXR1cm4geworICAgICAgICAgICAgICAgICAgICByZXN0cmljdDogJ0EnLAorICAgICAgICAgICAgICAgICAgICBsaW5rOiBmdW5jdGlvbihzY29wZSwgZWxlbSwgYXR0cikgeworICAgICAgICAgICAgICAgICAgICAgICAgZWxlbS5hZGRDbGFzcygnbGluay0tdmlzaXRlZCcpOworICAgICAgICAgICAgICAgICAgICAgICAgaWYoIShlbGVtLmF0dHIoJ2hyZWYnKSkpeworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGVsZW0uYXR0cigidGFiaW5kZXgiLCAiMCIpOworICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgfTsKKyAgICAgICAgICAgIH1dKQorICAgICAgICAuZGlyZWN0aXZlKCdhdHRSZWFkbW9yZScsIFsnJHRpbWVvdXQnLGZ1bmN0aW9uKCR0aW1lb3V0KSB7CisgICAgICAgICAgICAgICAgcmV0dXJuIHsKKyAgICAgICAgICAgICAgICAgICAgcmVzdHJpY3Q6ICdBJywKKyAgICAgICAgICAgICAgICAgICAgc2NvcGU6IHsKKyAgICAgICAgICAgICAgICAgICAgICAgIGxpbmVzOiJAbm9PZkxpbmVzIiwKKyAgICAgICAgICAgICAgICAgICAgICAgIHRleHRNb2RlbDogIj0iLAorICAgICAgICAgICAgICAgICAgICAgICAgaXNPcGVuOiAiPSIgLy9hdHRyaWJ1dGUgdG8gdXNlIHJlYWRtb3JlIGluc2lkZSBhY2NvcmRpb24KKyAgICAgICAgICAgICAgICAgICAgfSwKKyAgICAgICAgICAgICAgICAgICAgdGVtcGxhdGVVcmw6ICdhcHAvc2NyaXB0cy9uZ19qc19hdHRfdHBscy9saW5rcy9yZWFkTW9yZS5odG1sJywKKyAgICAgICAgICAgICAgICAgICAgbGluazogZnVuY3Rpb24oc2NvcGUsIGVsZW0sIGF0dHIsIGN0cmwpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIHZhciBoZWlnaHQgPSAxOworICAgICAgICAgICAgICAgICAgICAgICAgc2NvcGUuJHdhdGNoKCd0ZXh0TW9kZWwnLCBmdW5jdGlvbih2YWwpeworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmKCF2YWwpeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzY29wZS50ZXh0VG9EaXNwbGF5ID0gJyc7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNjb3BlLnJlYWRNb3JlTGluayA9IGZhbHNlOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzY29wZS5yZWFkTGVzc0xpbmsgPSBmYWxzZTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2NvcGUucmVhZEZsYWcgPSBmYWxzZTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgZWxzZXsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHR5cGVvZiBTdHJpbmcucHJvdG90eXBlLnRyaW0gIT09ICdmdW5jdGlvbicpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFN0cmluZy5wcm90b3R5cGUudHJpbSA9IGZ1bmN0aW9uKCkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHRoaXMucmVwbGFjZSgvXlxzK3xccyskL2csICcnKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH07CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2NvcGUudGV4dFRvRGlzcGxheSA9IHZhbC50cmltKCk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNjb3BlLnJlYWRGbGFnID0gdHJ1ZTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJHRpbWVvdXQoZnVuY3Rpb24oKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YXIgcmVhZEVsZW0gPSBlbGVtWzBdLmNoaWxkcmVuWzBdLmNoaWxkcmVuWzBdOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYoaGVpZ2h0PT09MSl7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYod2luZG93LmdldENvbXB1dGVkU3R5bGUpeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBoZWlnaHQgPSBwYXJzZUludChzY29wZS5saW5lcykgKiBwYXJzZUZsb2F0KHdpbmRvdy5nZXRDb21wdXRlZFN0eWxlKHJlYWRFbGVtLG51bGwpLmdldFByb3BlcnR5VmFsdWUoImhlaWdodCIpKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZWxzZSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGhlaWdodCA9IHBhcnNlSW50KHNjb3BlLmxpbmVzKSAqIHBhcnNlRmxvYXQocmVhZEVsZW0uY3VycmVudFN0eWxlLmhlaWdodCk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNjb3BlLmVsZW1IZWlnaHQgPSBoZWlnaHQ7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2NvcGUucmVhZExpbmtTdHlsZSA9IHsnaGVpZ2h0Jzogc2NvcGUuZWxlbUhlaWdodCArICdweCd9OworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9KTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2NvcGUucmVhZE1vcmVMaW5rID0gdHJ1ZTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2NvcGUucmVhZExlc3NMaW5rID0gZmFsc2U7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgfSk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCisgICAgICAgICAgICAgICAgICAgICAgICAvLyBDb2RlIHRvIHVzZSByZWFkbW9yZSBpbnNpZGUgYWNjb3JkaW9uIAorICAgICAgICAgICAgICAgICAgICAgICAgdmFyIHBhcmVudEVsZW0gPSBlbGVtLnBhcmVudCgpOworICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHBhcmVudEVsZW0uaGFzQ2xhc3MoJ2F0dC1hY2NvcmRpb25fX2JvZHknKSkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNjb3BlLiR3YXRjaCgnaXNPcGVuJywgZnVuY3Rpb24odmFsKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICghdmFsKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzY29wZS5yZWFkTGVzcygpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSk7CisgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICAKKyAgICAgICAgICAgICAgICAgICAgICAgIHNjb3BlLnJlYWRNb3JlID0gZnVuY3Rpb24oKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2NvcGUucmVhZE1vcmVMaW5rID0gZmFsc2U7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2NvcGUucmVhZExlc3NMaW5rID0gdHJ1ZTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBzY29wZS5yZWFkTGlua1N0eWxlID0geydoZWlnaHQnOiAnYXV0byd9OworICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNjb3BlLnJlYWRGbGFnID0gZmFsc2U7CisgICAgICAgICAgICAgICAgICAgICAgICB9OworICAgICAgICAgICAgICAgICAgICAgICAgCisgICAgICAgICAgICAgICAgICAgICAgICBzY29wZS5yZWFkTGVzcyA9IGZ1bmN0aW9uKCkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNjb3BlLnJlYWRNb3JlTGluayA9IHRydWU7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2NvcGUucmVhZExlc3NMaW5rID0gZmFsc2U7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2NvcGUucmVhZExpbmtTdHlsZSA9IHsnaGVpZ2h0Jzogc2NvcGUuZWxlbUhlaWdodCArICdweCd9OworICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNjb3BlLnJlYWRGbGFnID0gdHJ1ZTsKKyAgICAgICAgICAgICAgICAgICAgICAgIH07CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICB9OworICAgICAgICAgICAgfV0pCisgICAgICAgIC5kaXJlY3RpdmUoJ2F0dExpbmtzTGlzdCcsIFtmdW5jdGlvbigpIHsKKyAgICAgICAgICAgICAgICByZXR1cm4geworICAgICAgICAgICAgICAgICAgICByZXN0cmljdDogJ0EnLAorICAgICAgICAgICAgICAgICAgICBjb250cm9sbGVyOiBmdW5jdGlvbigpIHsKKyAgICAgICAgICAgICAgICAgICAgfSwKKyAgICAgICAgICAgICAgICAgICAgbGluazogZnVuY3Rpb24oc2NvcGUsIGVsZW0sIGF0dHIpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIGVsZW0uYWRkQ2xhc3MoJ2xpbmtzLWxpc3QnKTsKKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIH07CisgICAgICAgICAgICB9XSkKKyAgICAgICAgLmRpcmVjdGl2ZSgnYXR0TGlua3NMaXN0SXRlbScsIFsnJGNvbXBpbGUnLGZ1bmN0aW9uKCRjb21waWxlKSB7CisgICAgICAgICAgICAgICAgcmV0dXJuIHsKKyAgICAgICAgICAgICAgICAgICAgcmVzdHJpY3Q6ICdBJywKKyAgICAgICAgICAgICAgICAgICAgcmVxdWlyZTogJ15hdHRMaW5rc0xpc3QnLAorICAgICAgICAgICAgICAgICAgICBsaW5rOiBmdW5jdGlvbihzY29wZSwgZWxlbSwgYXR0ciwgYXR0TGlua3NMaXN0Q3RybCkgeworICAgICAgICAgICAgICAgICAgICAgICAgZWxlbS5hZGRDbGFzcygnbGlua3MtbGlzdF9faXRlbScpOworICAgICAgICAgICAgICAgICAgICAgICAgaWYoIShlbGVtLmF0dHIoJ2hyZWYnKSkpeworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGVsZW0uYXR0cigidGFiaW5kZXgiLCAiMCIpOworICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgfTsKKyAgICAgICAgICAgIH1dKTsKKyd1c2Ugc3RyaWN0JworYW5ndWxhci5tb2R1bGUoJ2F0dC5hYnMubG9hZGluZycsIFtdKQorICAgICAgICAuZGlyZWN0aXZlKCdhdHRMb2FkaW5nJywgWworICAgICAgICAgICAgZnVuY3Rpb24oKSB7CisgICAgICAgICAgICAgICAgcmV0dXJuIHsKKyAgICAgICAgICAgICAgICAgICAgcmVzdHJpY3Q6ICdBJywKKyAgICAgICAgICAgICAgICAgICAgcmVwbGFjZTogdHJ1ZSwKKyAgICAgICAgICAgICAgICAgICAgc2NvcGU6IHsKKyAgICAgICAgICAgICAgICAgICAgICAgIGljb246ICdAYXR0TG9hZGluZycsCisgICAgICAgICAgICAgICAgICAgICAgICBwcm9ncmVzc1N0YXR1czogJz0/JywKKyAgICAgICAgICAgICAgICAgICAgICAgIGNvbG9yQ2xhc3M6ICc9PycKKyAgICAgICAgICAgICAgICAgICAgfSwKKyAgICAgICAgICAgICAgICAgICAgdGVtcGxhdGVVcmw6ICdhcHAvc2NyaXB0cy9uZ19qc19hdHRfdHBscy9sb2FkaW5nL2xvYWRpbmcuaHRtbCcsCisgICAgICAgICAgICAgICAgICAgIGxpbms6IGZ1bmN0aW9uKHNjb3BlLCBlbGVtZW50LCBhdHRyKSB7CisgICAgICAgICAgICAgICAgICAgICAgICB2YXIgcHJvZ3Jlc3N2YWx1ZSA9IHNjb3BlLnByb2dyZXNzU3RhdHVzOworICAgICAgICAgICAgICAgICAgICAgICAgc2NvcGUucHJvZ3Jlc3NTdGF0dXMgPSBNYXRoLm1pbigxMDAsIE1hdGgubWF4KDAsIHByb2dyZXNzdmFsdWUpKTsKKyAgICAgICAgICAgICAgICAgICAgICAgI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Y2tlZE1hcCcsIGZ1bmN0aW9uICgpIHsKKyAgICByZXR1cm4geworICAgICAgY3JlYXRlTmV3OiBmdW5jdGlvbiAoKSB7CisgICAgICAgIHZhciBzdGFjayA9IFtdOworCisgICAgICAgIHJldHVybiB7CisgICAgICAgICAgYWRkOiBmdW5jdGlvbiAoa2V5LCB2YWx1ZSkgeworICAgICAgICAgICAgc3RhY2sucHVzaCh7CisgICAgICAgICAgICAgIGtleToga2V5LAorICAgICAgICAgICAgICB2YWx1ZTogdmFsdWUKKyAgICAgICAgICAgIH0pOworICAgICAgICAgIH0sCisgICAgICAgICAgZ2V0OiBmdW5jdGlvbiAoa2V5KSB7CisgICAgICAgICAgICBmb3IgKHZhciBpID0gMDsgaSA8IHN0YWNrLmxlbmd0aDsgaSsrKSB7CisgICAgICAgICAgICAgIGlmIChrZXkgPT0gc3RhY2tbaV0ua2V5KSB7CisgICAgICAgICAgICAgICAgcmV0dXJuIHN0YWNrW2ldOworICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9CisgICAgICAgICAgfSwKKyAgICAgICAgICBrZXlzOiBmdW5jdGlvbigpIHsKKyAgICAgICAgICAgIHZhciBrZXlzID0gW107CisgICAgICAgICAgICBmb3IgKHZhciBpID0gMDsgaSA8IHN0YWNrLmxlbmd0aDsgaSsrKSB7CisgICAgICAgICAgICAgIGtleXMucHVzaChzdGFja1tpXS5rZXkpOworICAgICAgICAgICAgfQorICAgICAgICAgICAgcmV0dXJuIGtleXM7CisgICAgICAgICAgfSwKKyAgICAgICAgICB0b3A6IGZ1bmN0aW9uICgpIHsKKyAgICAgICAgICAgIHJldHVybiBzdGFja1tzdGFjay5sZW5ndGggLSAxXTsKKyAgICAgICAgICB9LAorICAgICAgICAgIHJlbW92ZTogZnVuY3Rpb24gKGtleSkgeworICAgICAgICAgICAgdmFyIGlkeCA9IC0xOworICAgICAgICAgICAgZm9yICh2YXIgaSA9IDA7IGkgPCBzdGFjay5sZW5ndGg7IGkrKykgeworICAgICAgICAgICAgICBpZiAoa2V5ID09IHN0YWNrW2ldLmtleSkgeworICAgICAgICAgICAgICAgIGlkeCA9IGk7CisgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIHJldHVybiBzdGFjay5zcGxpY2UoaWR4LCAxKVswXTsKKyAgICAgICAgICB9LAorICAgICAgICAgIHJlbW92ZVRvcDogZnVuY3Rpb24gKCkgeworICAgICAgICAgICAgcmV0dXJuIHN0YWNrLnNwbGljZShzdGFjay5sZW5ndGggLSAxLCAxKVswXTsKKyAgICAgICAgICB9LAorICAgICAgICAgIGxlbmd0aDogZnVuY3Rpb24gKCkgeworICAgICAgICAgICAgcmV0dXJuIHN0YWNrLmxlbmd0aDsKKyAgICAgICAgICB9CisgICAgICAgIH07CisgICAgICB9CisgICAgfTsKKyAgfSkKKworLyoqCisgKiBBIGhlbHBlciBkaXJlY3RpdmUgZm9yIHRoZSAkbW9kYWwgc2VydmljZS4gSXQgY3JlYXRlcyBhIGJhY2tkcm9wIGVsZW1lbnQuCisgKi8KKyAgLmRpcmVjdGl2ZSgnbW9kYWxCYWNrZHJvcCcsIFsnJHRpbWVvdXQnLCBmdW5jdGlvbiAoJHRpbWVvdXQpIHsKKyAgICByZXR1cm4geworICAgICAgcmVzdHJpY3Q6ICdFQScsCisgICAgICByZXBsYWNlOiB0cnVlLAorICAgICAgdGVtcGxhdGVVcmw6ICdhcHAvc2NyaXB0cy9uZ19qc19hdHRfdHBscy9tb2RhbC9iYWNrZHJvcC5odG1sJywKKyAgICAgIGxpbms6IGZ1bmN0aW9uIChzY29wZSkgeworICAgICAgICBzY29wZS5hbmltYXRlID0gZmFsc2U7CisgICAgICAgIC8vdHJpZ2dlciBDU1MgdHJhbnNpdGlvbnMKKyAgICAgICAgJHRpbWVvdXQoZnVuY3Rpb24gKCkgeworICAgICAgICAgIHNjb3BlLmFuaW1hdGUgPSB0cnVlOworICAgICAgICB9KTsgICAgICAKK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vY3VzKCk7CisJCQl9CisJCQl9CisJCX0pOworICAgICAgICBzY29wZS5jbG9zZSA9IGZ1bmN0aW9uIChldnQpIHsgICAgICAgICAgICAgCisgICAgICAgICAgdmFyIG1vZGFsID0gJG1vZGFsU3RhY2suZ2V0VG9wKCk7ICAgICAgICAgCisgICAgICAgICAgaWYgKG1vZGFsICYmIG1vZGFsLnZhbHVlLmJhY2tkcm9wICYmIG1vZGFsLnZhbHVlLmJhY2tkcm9wICE9ICdzdGF0aWMnICAmJiAoZXZ0LnRhcmdldCA9PT0gZXZ0LmN1cnJlbnRUYXJnZXQpKSB7CisgICAgICAgICAgICAvLyBDaGVjayBpZiBwcmV2ZW50RGVmYXVsdCBleGlzdHMgZHVlIHRvIGxhY2sgb2Ygc3VwcG9ydCBmb3IgSUU4CisgICAgICAgICAgICBpZiAoZXZ0LnByZXZlbnREZWZhdWx0KSB7CisgICAgICAgICAgICAgIGV2dC5wcmV2ZW50RGVmYXVsdCgpOworICAgICAgICAgICAgICBldnQuc3RvcFByb3BhZ2F0aW9uKCk7ICAKKyAgICAgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICAgIGV2dC5yZXR1cm5WYWx1ZSA9IGZhbHNlOworICAgICAgICAgICAgfQorICAgICAgICAgICAgCisgICAgICAgICAgICAkbW9kYWxTdGFjay5kaXNtaXNzKG1vZGFsLmtleSwgJ2JhY2tkcm9wIGNsaWNrJyk7CisgICAgICAgICAgfQorICAgICAgICB9OworICAgICAgfQorICAgIH07CisgIH1dKQorCisgIC5mYWN0b3J5KCckbW9kYWxTdGFjaycsIFsnJGRvY3VtZW50JywgJyRjb21waWxlJywgJyRyb290U2NvcGUnLCAnJCRzdGFja2VkTWFwJywKKyAgICBmdW5jdGlvbiAoJGRvY3VtZW50LCAkY29tcGlsZSwgJHJvb3RTY29wZSwgJCRzdGFja2VkTWFwKSB7CisKKyAgICAgIHZhciBPUEVORURfTU9EQUxfQ0xBU1MgPSAnbW9kYWwtb3Blbic7CisKKyAg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ICAgIG9wZW5lZFdpbmRvd3MucmVtb3ZlKG1vZGFsSW5zdGFuY2UpOworCisgICAgICAgIC8vcmVtb3ZlIHdpbmRvdyBET00gZWxlbWVudAorICAgICAgICBtb2RhbFdpbmRvdy5tb2RhbERvbUVsLnJlbW92ZSgpOworICAgICAgICBib2R5LnRvZ2dsZUNsYXNzKE9QRU5FRF9NT0RBTF9DTEFTUywgb3BlbmVkV2luZG93cy5sZW5ndGgoKSA+IDApOworCisgICAgICAgIC8vcmVtb3ZlIGJhY2tkcm9wIGlmIG5vIGxvbmdlciBuZWVkZWQKKyAgICAgICAgaWYgKGJhY2tkcm9wRG9tRWwgJiYgYmFja2Ryb3BJbmRleCgpID09IC0xKSB7CisgICAgICAgICAgYmFja2Ryb3BEb21FbC5yZW1vdmUoKTsKKyAgICAgICAgICBiYWNrZHJvcERvbUVsID0gdW5kZWZpbmVkOworICAgICAgICB9CisKKyAgICAgICAgLy9kZXN0cm95IHNjb3BlCisgICAgICAgIG1vZGFsV2luZG93Lm1vZGFsU2NvcGUuJGRlc3Ryb3koKTsKKyAgICAgIH0KKworICAgICAgJGRvY3VtZW50LmJpbmQoJ2tleWRvd24nLCBmdW5jdGlvbiAoZXZ0KSB7CisgICAgICAgIHZhciBtb2RhbDsKKworICAgICAgICBpZiAoZXZ0LndoaWNoID09PSAyNykgeworICAgICAgICAgIG1vZGFsID0gb3BlbmVkV2luZG93cy50b3AoKTsKKyAgICAgICAgICBpZiAobW9kYWwgJiYgbW9kYWwudmFsdWUua2V5Ym9hcmQpIHsKKyAgICAgICAgICAgICRyb290U2NvcGUuJGFwcGx5KGZ1bmN0aW9uICgpIHsKKyAgICAgICAgICAgICAgJG1vZGFsU3RhY2suZGlzbWlzcyhtb2RhbC5rZXkpOworICAgICAgICAgICAgfSk7CisgICAgICAgICAgfQorICAgICAgICB9CisgICAgICB9KTsKKworICAgICAgJG1vZGFsU3RhY2sub3BlbiA9IGZ1bmN0aW9uIChtb2RhbEluc3RhbmNlLCBtb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lKTsKKyAgICAgICAgb3BlbmVkV2luZG93cy50b3AoKS52YWx1ZS5tb2RhbERvbUVsID0gbW9kYWxEb21FbDsKKyAgICAgICAgYm9keS5hcHBlbmQobW9kYWxEb21FbCk7CisgICAgICAgIGJvZHkuYWRkQ2xhc3MoT1BFTkVEX01PREFMX0NMQVNTKTsKKyAgICAgIH07CisKKyAgICAgICRtb2RhbFN0YWNrLmNsb3NlID0gZnVuY3Rpb24gKG1vZGFsSW5zdGFuY2UsIHJlc3VsdCkgeworICAgICAgICB2YXIgbW9kYWwgPSBvcGVuZWRXaW5kb3dzLmdldChtb2RhbEluc3RhbmNlKTsKKyAgICAgICAgaWYgKG1vZGFsKSB7CisgICAgICAgICAgbW9kYWwudmFsdWUuZGVmZXJyZWQucmVzb2x2ZShyZXN1bHQpOworICAgICAgICAgIHJlbW92ZU1vZGFsV2luZG93KG1vZGFsSW5zdGFuY2UpOworICAgICAgICB9CisgICAgICB9OworCisgICAgICAkbW9kYWxTdGFjay5kaXNtaXNzID0gZnVuY3Rpb24gKG1vZGFsSW5zdGFuY2UsIHJlYXNvbikgeworICAgICAgICB2YXIgbW9kYWxXaW5kb3cgPSBvcGVuZWRXaW5kb3dzLmdldChtb2RhbEluc3RhbmNlKS52YWx1ZTsKKyAgICAgICAgaWYgKG1vZGFsV2luZG93KSB7CisgICAgICAgICAgbW9kYWxXaW5kb3cuZGVmZXJyZWQucmVqZWN0KHJlYXNvbik7CisgICAgICAgICAgcmVtb3ZlTW9kYWxXaW5kb3cobW9kYWxJbnN0YW5jZSk7CisgICAgICAgIH0KKyAgICAgIH07CisKKyAgICAgICRtb2RhbFN0YWNrLmdldFRvcCA9IGZ1bmN0aW9uICgpIHsKKyAgICAgICAgcmV0dXJuIG9wZW5lZFdpbmRvd3MudG9wKCk7CisgICAgICB9OworCisgICAgICByZXR1cm4gJG1vZGFsU3RhY2s7CisgICAgfV0pCisKKyAgLnByb3ZpZGVyKCckbW9kYWwnLCBmdW5jdGlvbiAoKSB7CisKKyAgICB2YXIgJG1vZGFsUHJvdmlkZXIgPSB7CisgICAgICBvcHRpb25zOiB7CisgICAgICAgIGJhY2tkcm9wOiB0cnVlLCAvL2NhbiBiZSBhbHNvIGZhbHNlIG9yICdzdGF0aWMnCisgICAgICAgIGtleWJvYXJkOiB0cnVlCisgICAgICB9LAorICAgICAgJGdldDogWyckaW5qZWN0b3InLCAnJHJvb3RTY29wZScsICckcScsICckaHR0cCcsICckdGVtcGxhdGVDYWNoZScsICckY29udHJvbGxlcicsICckbW9kYWxTdGFjaycsCisgICAgICAgIGZ1bmN0aW9uICgkaW5qZWN0b3IsICRyb290U2NvcGUsICRxLCAkaHR0cCwgJHRlbXBsYXRlQ2FjaGUsICRjb250cm9sbGVyLCAkbW9kYWxTdGFjaykgeworCisgICAgICAgICAgdmFyICRtb2RhbCA9IHt9OworCisgICAgICAgICAgZnVuY3Rpb24gZ2V0VGVtcGxhdGVQcm9taXNlKG9wdGlvbnMpIHsKKyAgICAgICAgICAgIHJldHVybiBvcHRpb25zLnRlbXBsYXRlID8gJHEud2hlbihvcHRpb25zLnRlbXBsYXRlKSA6CisgICAgICAgICAgICAgICRodHRwLmdldChvcHRpb25zLnRlbXBsYXRlVXJsLCB7Y2FjaGU6ICR0ZW1wbGF0ZUNhY2hlfSkudGhlbihmdW5jdGlvbiAocmVzdWx0KSB7CisgICAgICAgICAgICAgICAgcmV0dXJuIHJlc3VsdC5kYXRhOworICAgICAgICAgICAgICB9KTsKKyAgICAgICAgICB9CisKKyAgICAgICAgICBmdW5jdGlvbiBnZXRSZXNvbHZlUHJvbWlzZXMocmVzb2x2ZXMpIHsKKyAgICAgICAgICAgIHZhciBwcm9taXNlc0FyciA9IFtdOworICAgICAgICAgICAgYW5ndWxhci5mb3JFYWNoKHJlc29sdmVzLCBmdW5jdGlvbiAodmFsdWUsIGtleSkgeworICAgICAgICAgICAgICBpZiAoYW5ndWxhci5pc0Z1bmN0aW9uKHZhbHVlKSB8fCBhbmd1bGFyLmlzQXJyYXkodmFsdWUpKSB7CisgICAgICAgICAgICAgICAgcHJvbWlzZXNBcnIucHVzaCgkcS53aGVuKCRpbmplY3Rvci5pbnZva2UodmFsdWUpKSk7CisgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0pOworICAgICAgICAgICAgcmV0dXJuIHByb21pc2VzQXJyOworICAgICAgICAgIH0KKworICAgICAgICAgICRtb2RhbC5vcGVuID0gZnVuY3Rpb24gKG1vZGFsT3B0aW9ucykgeworCisgICAgICAgICAgICB2YXIgbW9kYWxSZXN1bHREZWZlcnJlZCA9ICRxLmRlZmVyKCk7CisgICAgICAgICAgICB2YXIgbW9kYWxPcGVuZWREZWZlcnJlZCA9ICRxLmRlZmVyKCk7CisKKyAgICAgICAgICAgIC8vcHJlcGFyZSBhbiBpbnN0YW5jZSBvZiBhIG1vZGFsIHRvIGJlIGluamVjdGVkIGludG8gY29udHJvbGxlcnMgYW5kIHJldHVybmVkIHRvIGEgY2FsbGVyCisgICAgICAgICAgICB2YXIgbW9kYWxJbnN0YW5jZSA9IHsKKyAgICAgICAgICAgICAgcmVzdWx0OiBtb2RhbFJlc3VsdERlZmVycmVkLnByb21pc2UsCisgICAgICAgICAgICAgIG9wZW5lZDogbW9kYWxPcGVuZWREZWZlcnJlZC5wcm9taXNlLAorICAgICAgICAgICAgICBjbG9zZTogZnVuY3Rpb24gKHJlc3VsdCkgeworICAgICAgICAgICAgICAgICRtb2RhbFN0YWNrLmNsb3NlKG1vZGFsSW5zdGFuY2UsIHJlc3VsdCk7CisgICAgICAgICAgICAgIH0sCisgICAgICAgICAgICAgIGRpc21pc3M6IGZ1bmN0aW9uIChyZWFzb24pIHsKKyAgICAgICAgICAgICAgICAkbW9kYWxTdGFjay5kaXNtaXNzKG1vZGFsSW5zdGFuY2UsIHJlYXNvbik7CisgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH07CisKKyAgICAgICAgICAgIC8vbWVyZ2UgYW5kIGNsZWFuIHVwIG9wdGlvbnMKKy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gICAgICAgICAgICB2YXIgcmVzb2x2ZUl0ZXIgPSAxOworCisgICAgICAgICAgICAgIC8vY29udHJvbGxlcnMKKyAgICAgICAgICAgICAgaWYgKG1vZGFsT3B0aW9ucy5jb250cm9sbGVyKSB7CisgICAgICAgICAgICAgICAgY3RybExvY2Fscy4kc2NvcGUgPSBtb2RhbFNjb3BlOworICAgICAgICAgICAgICAgIGN0cmxMb2NhbHMuJG1vZGFsSW5zdGFuY2UgPSBtb2RhbEluc3RhbmNlOworICAgICAgICAgICAgICAgIGFuZ3VsYXIuZm9yRWFjaChtb2RhbE9wdGlvbnMucmVzb2x2ZSwgZnVuY3Rpb24gKHZhbHVlLCBrZXkpIHsKKyAgICAgICAgICAgICAgICAgIGN0cmxMb2NhbHNba2V5XSA9IHRwbEFuZFZhcnNbcmVzb2x2ZUl0ZXIrK107CisgICAgICAgICAgICAgICAgfSk7CisKKyAgICAgICAgICAgICAgICBjdHJsSW5zdGFuY2UgPSAkY29udHJvbGxlcihtb2RhbE9wdGlvbnMuY29udHJvbGxlciwgY3RybExvY2Fscyk7CisgICAgICAgICAgICAgIH0KKworICAgICAgICAgICAgICAkbW9kYWxTdGFjay5vcGVuKG1vZGFsSW5zdGFuY2UsIHsKKyAgICAgICAgICAgICAgICBzY29wZTogbW9kYWxTY29wZSwKKyAgICAgICAgICAgICAgICBkZWZlcnJlZDogbW9kYWxSZXN1bHREZWZlcnJlZCwKKyAgICAgICAgICAgICAgICBjb250ZW50OiB0cGxBbmRWYXJzWzBdLAorICAgICAgICAgICAgICAgIGJhY2tkcm9wOiBtb2RhbE9wdGlvbnMuYmFja2Ryb3AsCisgICAgICAgICAgICAgICAga2V5Ym9hcmQ6IG1vZGFsT3B0aW9ucy5rZXlib2FyZCwKKyAgICAgICAgICAgICAgICB3aW5kb3dDbGFzczogbW9kYWxPcHRpb25zLndpbmRvd0NsYXNzCisgICAgICAgICAgICAgIH0pOworCisgICAgICAgICAgICB9LCBmdW5jdGlvbiByZXNvbHZlRXJyb3IocmVhc29uKSB7CisgICAgICAgICAgICAgIG1vZGFsUmVzdWx0RGVmZXJyZWQucmVqZWN0KHJlYXNvbik7CisgICAgICAgICAgICB9KTsKKworICAgICAgICAgICAgdGVtcGxhdGVBbmRSZXNvbHZlUHJvbWlzZS50aGVuKGZ1bmN0aW9uICgpIHsKKyAgICAgICAgICAgICAgbW9kYWxPcGVuZWREZWZlcnJlZC5yZXNvbHZlKHRydWUpOworICAgICAgICAgICAgfSwgZnVuY3Rpb24gKCkgeworICAgICAgICAgICAgICBtb2RhbE9wZW5lZERlZmVycmVkLnJlamVjdChmYWxzZSk7CisgICAgICAgICAgICB9KTsKKworICAgICAgICAgICAgcmV0dXJuIG1vZGFsSW5zdGFuY2U7CisgICAgICAgICAgfTsKKworICAgICAgICAgIHJldHVybiAkbW9kYWw7CisgICAgICAgIH1dCisgICAgfTsKKworICAgIHJldHVybiAkbW9kYWxQcm92aWRlcjsKKyAgfSkKKworLmRpcmVjdGl2ZSgic2ltcGxlTW9kYWwiLCBbIiRtb2RhbCIsICIkbG9nIiwgJyRzY3JvbGxUbycsIGZ1bmN0aW9uKCRtb2RhbCwgJGxvZywgJHNjcm9sbFRvKSB7CisgICAgICAgIHJldHVybiB7CisgICAgICAgICAgICByZXN0cmljdDogJ0VBJywKKyAgICAgICAgICAgIHNjb3BlOiB7CisgICAgICAgICAgICAgICAgc2ltcGxlTW9kYWw6ICdAJywKKyAgICAgICAgICAgICAgICBiYWNrZHJvcDonQCcsCisgICAgICAgICAgICAgICAga2V5Ym9hcmQ6J0AnLAorICAgICAgICAgICAgICAgIG1vZGFsT2s6JyYnLAorICAgICAgICAgICAgICAgIG1vZGFsQ2FuY2VsOicmJywKKyAgICAgICAgICAgICAgICB3aW5kb3dDbGFzczonQCcsCisgICAgICAgICAgICAgICAgY29udHJvbGxlcjonQCcKKyAgICAgICAgICAgIH0sCisgICAgICAgICAgICBsaW5rOiBmdW5jdGlvbihzY29wZSwgZWxtLCBhdHRyKSB7CisgICAgICAgICAgICAgICAgZWxtLmJpbmQoJ2NsaWNrJywgZnVuY3Rpb24oZXYpIHsKKyAgICAgICAgICAgICAgICAgICAgdmFyIGN1cnJlbnRQb3NpdGlvbiA9IGV2LnBhZ2VZIC0gZXYuY2xpZW50WTsKKyAgICAgICAgICAgICAgICAgICAgZXYucHJldmVudERlZmF1bHQoKTsKKyAgICAgICAgICAgICAgICAgICAgaWYgKGFuZ3VsYXIuaXNEZWZpbmVkKGVsbS5hdHRyKCJocmVmIikpICYmIGVsbS5hdHRyKCJocmVmIikgIT09ICIiKSB7CisgICAgICAgICAgICAgICAgICAgICAgICBzY29wZS5zaW1wbGVNb2RhbCA9IGVsbS5hdHRyKCJocmVmIik7CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICBzY29wZS5iYWNrZHJvcCA9PT0gImZhbHNlIiA/IHNjb3BlLmJhY2tkcm9wY2xpY2s9J3N0YXRpYyc6c2NvcGUuYmFja2Ryb3BjbGljaz10cnVlOworICAgICAgICAgICAgICAgICAgIHNjb3BlLmtleWJvYXJkID09PSAiZmFsc2UiID8gc2NvcGUua2V5Ym9hcmRldj1mYWxzZTpzY29wZS5rZXlib2FyZGV2PXRydWU7CisgICAgICAgICAgICAgICAgICAgICRtb2RhbC5vcGVuKHsKKyAgICAgICAgICAgICAgICAgICAgICAgIHRlbXBsYXRlVXJsOiBzY29wZS5zaW1wbGVNb2RhbCwKKyAgICAgICAgICAgICAgICAgICAgICAgIGJhY2tkcm9wOnNjb3BlLmJhY2tkcm9wY2xpY2ssCisgICAgICAgICAgICAgICAgICAgICAgICBrZXlib2FyZDpzY29wZS5rZXlib2FyZGV2LAorICAgICAgICAgICAgICAgICAgICAgICAgd2luZG93Q2xhc3M6c2NvcGUud2luZG93Q2xhc3MsCisgICAgICAgICAgICAgICAgICAgICAgICBjb250cm9sbGVyOiBzY29wZS5jb250cm9sbGVyCisgICAgICAgICAgICAgICAgICAgIH0pLnJlc3VsdC50aGVuKHNjb3BlLm1vZGFsT2ssIHNjb3BlLm1vZGFsQ2FuY2VsKTsKKyAgICAgICAgICAgICAgICB9KTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfTsgICAgIAorICAgIH1dKTsKKworYW5ndWxhci5tb2R1bGUoJ2F0dC5hYnMucGFnaW5hdGlvbicsIFsnYXR0LmFicy51dGlsaXRpZXMnXSkKKy5kaXJlY3RpdmUoJ2F0dFBhZ2luYXRpb24nLCBbJyR0aW1lb3V0JywgZnVuY3Rpb24oJHRpbWVvdXQpIHsKKyAgICAgcmV0dXJuIHsKKyAgICAgICAgcmVzdHJpY3Q6ICdFQScsCisgICAgICAgIHNjb3BlOiB7CisgICAgICAgICAgICB0b3RhbFBhZ2VzOiAnPScsCisgICAgICAgICAgICBjdXJyZW50UGFnZTogJz0nLAorICAgICAgICAgICAgc2hvd0lucHV0OiAnPScsCisgICAgICAgICAgICBjbGlja0hhbmRsZXI6ICc9PycKKyAgICAgICAgfSwKKyAgICAgICAgcmVwbGFjZTogdHJ1ZSwKKyAgICAgICAgdGVtcGxhdGVVcmw6ICdhcHAvc2NyaXB0cy9uZ19qc19hdHRfdHBscy9wYWdpbmF0aW9uL3BhZ2luYXRpb24uaHRtbCcsCisgICAgICAgIGxpbms6IGZ1bmN0aW9uKHNjb3BlLCBlbGVtLCBhdHRyLCBjdHJsKSB7CisgICAgICAgICAgICBzY29wZS5mb2N1c2VkUGFnZTsKKworICAgICAgICAgICAgc2NvcGUuJHdhdGNoKCd0b3RhbFBhZ2VzJywgZnVuY3Rpb24odmFsdWUpIHsKKyAgICAgICAgICAgICAgICBpZihhbmd1bGFyLmlzRGVmaW5lZCh2YWx1ZSkgJiYgdmFsdWUgIT09IG51bGwpeworICAgICAgICAgICAgICAgICAgICBzY29wZS5wYWdlcyA9IFtdOworICAgICAgICAgICAgICAgICAgICBpZiAodmFsdWUgPCAxKSB7CisgICAgICAgICAgICAgICAgICAgICAgICBzY29wZS50b3RhbFBhZ2VzID0gMTsKKyAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybjsKKyAgICAgICAgICAgICAgICAgICAgfQorCisgICAgICAgICAgICAgICAgICAgIGlmICh2YWx1ZSA8PSA3KSB7CisgICAgICAgICAgICAgICAgICAgICAgICBmb3IgKHZhciBpID0gMTsgaSA8PSB2YWx1ZTsgaSsrKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2NvcGUucGFnZXMucHVzaChpKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgfSBlbHNlIGlmICh2YWx1ZSA+IDcpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIHZhciBtaWRWYWwgPSBNYXRoLmNlaWwodmFsdWUgLyAyKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIHNjb3BlLnBhZ2VzID0gW21pZFZhbCAtIDEsIG1pZFZhbCwgbWlkVmFsICsgMV07CisgICAgICAgICAgICAgICAgICAgIH0KKworICAgICAgICAgICAgICAgICAgICBjdXJyZW50UGFnZUNoYW5nZWQoMSk7CisgICAgICAgICAgICAgICAgfSAgICAgICAgICAgICAgIAorICAgICAgICAgICAgfSk7CisKKyAgICAgICAgICAgIHNjb3BlLiR3YXRjaCgnY3VycmVudFBhZ2UnLCBmdW5jdGlvbih2YWx1ZSkgeworICAgICAgICAgICAgICAgIGN1cnJlbnRQYWdlQ2hhbmdlZCh2YWx1ZSk7CisgICAgICAgICAgICB9KTsKKworICAgICAgICAgICAgZnVuY3Rpb24gY3VycmVudFBhZ2VDaGFuZ2VkKHZhbHVlKSB7CisgICAgICAgICAgICAgICAgaWYgKGFuZ3VsYXIuaXNEZWZpbmVkKHZhbHVlKSAmJiB2YWx1ZSAhPT0gbnVsbCkgeworICAgICAgICAgICAgICAgICAgICBpZiAoIXZhbHVlKSB7CisgICAgICAgICAgICAgICAgICAgICAgICB2YWx1ZSA9IDE7CisgICAgICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAoIWFuZ3VsYXIuaXNOdW1iZXIodmFsdWUpKSB7CisgICAgICAgICAgICAgICAgICAgICAgICB2YWx1ZSA9IHBhcnNlSW50KHZhbHVlLCAxMCk7CisgICAgICAgICAgICAgICAgICAgIH0KKworICAgICAgICAgICAgICAgICAgICBpZiAodmFsdWUgPiBzY29wZS50b3RhbFBhZ2VzKSB7CisgICAgICAgICAgICAgICAgICAgICAgICB2YWx1ZSA9IHNjb3BlLnRvdGFsUGFnZXM7CisgICAgICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAodmFsdWUgPCAxKSB7CisgICAgICAgICAgICAgICAgICAgICAgICB2YWx1ZSA9IDE7CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgCisgICAgICAgICAgICAgICAgICAgIGlmKHNjb3BlLmN1cnJlbnRQYWdlICE9PSB2YWx1ZSkgeworICAgICAgICAgICAgICAgICAgICAgICAgc2NvcGUuY3VycmVudFBhZ2UgPSB2YWx1ZTsKKyAgICAgICAgICAgICAgICAgICAgICAgIGNhbGxiYWNrSGFuZGxlcihzY29wZS5jdXJyZW50UGFnZSk7CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgCisgICAgICAgICAgICAgICAgICAgIGlmIChzY29wZS50b3RhbFBhZ2VzID4gNykgeworICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHZhbHVlIDwgc2NvcGUucGFnZXNbMF0gJiYgdmFsdWUgPiAzKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2NvcGUucGFnZXMgPSBbdmFsdWUsIHZhbHVlICsgMSwgdmFsdWUgKyAyXTsKKyAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAodmFsdWUgPiBzY29wZS5wYWdlc1syXSAmJiB2YWx1ZSA8IHNjb3BlLnRvdGFsUGFnZXMgLSAyKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2NvcGUucGFnZXMgPSBbdmFsdWUgLSAyLCB2YWx1ZSAtIDEsIHZhbHVlXTsKKyAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAodmFsdWUgPD0gMykgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNjb3BlLnBhZ2VzID0gWzEsIDIsIDNdOworICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIGlmICh2YWx1ZSA+PSBzY29wZS50b3RhbFBhZ2VzIC0gMikgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNjb3BlLnBhZ2VzID0gW3Njb3BlLnRvdGFsUGFnZXMgLSAyLCBzY29wZS50b3RhbFBhZ2VzIC0gMSwgc2NvcGUudG90YWxQYWdlc107CisgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9CisgICAgICAgICAgICAKKyAgICAgICAgICAgIHNjb3BlLm5leHQgPSBmdW5jdGlvbihldmVudCkgeworICAgICAgICAgICAgICAgIGV2ZW50LnByZXZlbnREZWZhdWx0KCk7CisgICAgICAgICAgICAgICAgaWYgKHNjb3BlLmN1cnJlbnRQYWdlIDwgc2NvcGUudG90YWxQYWdlcykgeworICAgICAgICAgICAgICAgICAgICBzY29wZS5jdXJyZW50UGFnZSArPSAxOworICAgICAgICAgICAgICAgICAgICBjYWxsYmFja0hhbmRsZXIoc2NvcGUuY3VycmVudFBhZ2UpOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH07CisKKyAgICAgICAgICAgIHNjb3BlLnByZXYgPSBmdW5jdGlvbihldmVudCkgeworICAgICAgICAgICAgICAgIGV2ZW50LnByZXZlbnREZWZhdWx0KCk7CisgICAgICAgICAgICAgICAgaWYgKHNjb3BlLmN1cnJlbnRQYWdlID4gMSkgeworICAgICAgICAgICAgICAgICAgICBzY29wZS5jdXJyZW50UGFnZSAtPSAxOworICAgICAgICAgICAgICAgICAgICBjYWxsYmFja0hhbmRsZXIoc2NvcGUuY3VycmVudFBhZ2UpOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH07CisKKyAgICAgICAgICAgIHNjb3BlLnNlbGVjdFBhZ2UgPSBmdW5jdGlvbih2YWx1ZSwgZXZlbnQpIHsKKyAgICAgICAgICAgICAgICBldmVudC5wcmV2ZW50RGVmYXVsdCgpOworICAgICAgICAgICAgICAgIHNjb3BlLmN1cnJlbnRQYWdlID0gdmFsdWU7CisgICAgICAgICAgICAgICAgc2NvcGUuZm9jdXNlZFBhZ2UgPSB2YWx1ZTsKKyAgICAgICAgICAgICAgICBjYWxsYmFja0hhbmRsZXIoc2NvcGUuY3VycmVudFBhZ2UpOworICAgICAgICAgICAgfTsKKyAgICAgICAgICAgIAorICAgICAgICAgICAgdmFyIGNhbGxiYWNrSGFuZGxlciA9IGZ1bmN0aW9uKG51bSkgeworICAgICAgICAgICAgICAgIGlmIChhbmd1bGFyLmlzRnVuY3Rpb24oc2NvcGUuY2xpY2tIYW5kbGVyKSkKKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgIHNjb3BlLmNsaWNrSGFuZGxlcihudW0pOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH07CisKKyAgICAgICAgICAgIHNjb3BlLmNoZWNrU2VsZWN0ZWRQYWdlID0gZnVuY3Rpb24odmFsdWUpIHsKKyAgICAgICAgICAgICAgICBpZihzY29wZS5jdXJyZW50UGFnZSA9PT0gdmFsdWUpIHsKKyAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHRydWU7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIHJldHVybiBmYWxzZTsKKyAgICAgICAgICAgIH07CisKKyAgICAgICAgICAgIHNjb3BlLmlzRm9jdXNlZCA9IGZ1bmN0aW9uKHBhZ2UpIHsKKyAgICAgICAgICAgICAgICBpZihzY29wZS5mb2N1c2VkUGFnZSA9PT0gcGFnZSkgeworICAgICAgICAgICAgICAgICAgICByZXR1cm4gdHJ1ZTsKKyAgICAgICAgICAgICAgICB9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ICAgICAuY29uc3RhbnQoJ3Byb2ZpbGVTdGF0dXMnLHsKKyAgICAgICAgICAgICAgICBzdGF0dXM6eworICAgICAgICAgICAgICAgICAgICBBQ1RJVkU6e3N0YXR1czoiQWN0aXZlIixjb2xvcjoiZ3JlZW4ifSwKKyAgICAgICAgICAgICAgICAgICAgREVBQ1RJVkFURUQ6e3N0YXR1czoiRGVhY3RpdmF0ZWQiLGNvbG9yOiJyZWQifSwKKyAgICAgICAgICAgICAgICAgICAgTE9DS0VEOntzdGF0dXM6IkxvY2tlZCIsY29sb3I6InJlZCJ9LAorICAgICAgICAgICAgICAgICAgICBJRExFOntzdGF0dXM6IklkbGUiLGNvbG9yOiJ5ZWxsb3cifSwKKyAgICAgICAgICAgICAgICAgICAgUEVORElORzp7c3RhdHVzOiJQZW5kaW5nIixjb2xvcjoiYmx1ZSJ9CisgICAgICAgICAgICAgICAgICAgIH0sCisgICAgICAgICAgICAgICAgcm9sZToiQ09NUEFOWSBBRE1JTklTVFJBVE9SIgorICAgICAgICAgICAgICAgIH0pCisgICAgICAgICAgIAorICAgICAgICAgICAgLmRpcmVjdGl2ZSgncHJvZmlsZUNhcmQnLFsnJGh0dHAnLCckcScsJ3Byb2ZpbGVTdGF0dXMnLCBmdW5jdGlvbigkaHR0cCwkcSxwcm9maWxlU3RhdHVzKSB7CisgICAgICAgICAgICAgICByZXR1cm4gIHsgIAorICAgICAgICAgICAgICAgICAgICByZXN0cmljdDogJ0VBJywKKyAgICAgICAgICAgICAgICAgICAgcmVwbGFjZTondHJ1ZScsCisgICAgICAgICAgICAgICAgICAgIHRlbXBsYXRlVXJsOmZ1bmN0aW9uKGVsZW1lbnQsIGF0dHJzKSB7CisgICAgICAgICAgICAgICAgICAgICAgICBpZighYXR0cnMuYWRkVXNlcil7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuICdhcHAvc2NyaXB0cy9uZ19qc19hdHRfdHBscy9wcm9maWxlQ2FyZC9wcm9maWxlQ2FyZC5odG1sJzsKKyAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgIGVsc2V7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuICdhcHAvc2NyaXB0cy9uZ19qc19hdHRfdHBscy9wcm9maWxlQ2FyZC9hZGRVc2VyLmh0bWwnOworICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICB9LAorICAgICAgICAgICAgICAgICAgICBzY29wZTp7CisgICAgICAgICAgICAgICAgICAgICAgICBwcm9maWxlOic9JworICAgICAgICAgICAgICAgICAgICB9LAorICAgICAgICAgICAgICAgICAgICBsaW5rOiBmdW5jdGlvbihzY29wZSwgZWxlbSwgYXR0cil7CisKKyAgICAgICAgICAgICAgICAgICAgICAgIHNjb3BlLmltYWdlPXRydWU7CisgICAgICAgICAgICAgICAgICAgICAgICBmdW5jdGlvbiBpc0ltYWdlKHNyYykgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFyIGRlZmVycmVkID0gJHEuZGVmZXIoKTsKKworICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhciBpbWFnZSA9IG5ldyBJbWFnZSgpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGltYWdlLm9uZXJyb3IgPSBmdW5jdGlvbigpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZGVmZXJyZWQucmVqZWN0KGZhbHNlKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB9OworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGltYWdlLm9ubG9hZCA9IGZ1bmN0aW9uKCkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBkZWZlcnJlZC5yZXNvbHZlKHRydWUpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIH07CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYoc3JjIT09dW5kZWZpbmVkICYmIHNyYy5sZW5ndGg+MCApeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpbWFnZS5zcmMgPSBzcmM7ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB9ZWxzZXsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRlZmVycmVkLnJlamVjdChmYWxzZSk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQorCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGRlZmVycmVkLnByb21pc2U7CisgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICBpZighYXR0ci5hZGRVc2VyKXsKKyAgICAgICAgICAgICAgICAgICAgICAgIHNjb3BlLmltYWdlPWZhbHNlOworICAgICAgICAgICAgICAgICAgICAgICAgaXNJbWFnZShzY29wZS5wcm9maWxlLmltZykudGhlbihmdW5jdGlvbihpbWcpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb25zb2xlLmxvZyhpbWcpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzY29wZS5pbWFnZT1pbWc7CisgICAgICAgICAgICAgICAgICAgICAgICB9KTsKKyAgICAgICAgICAgICAgICAgICAgICAgdmFyIHNwbGl0TmFtZT0oc2NvcGUucHJvZmlsZS5uYW1lKS5zcGxpdCgnICcpOworCQkJCQkJc2NvcGUuaW5pdGlhbHM9Jyc7CisJCQkJCQlmb3IodmFyIGk9MDtpPHNwbGl0TmFtZS5sZW5ndGg7aSsrKXsKKwkJCQkJCQlzY29wZS5pbml0aWFscyArPSBzcGxpdE5hbWVbaV1bMF07CisJCQkJCQl9CisgICAgICAgICAgICAgICAgICAgICAgICBpZihzY29wZS5wcm9maWxlLnJvbGUudG9VcHBlckNhc2UoKT09PXByb2ZpbGVTdGF0dXMucm9sZSl7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2NvcGUuYmFkZ2U9dHJ1ZTsKKyAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgIHZhciBwcm9maWxlU3RhdGU9cHJvZmlsZVN0YXR1cy5zdGF0dXNbc2NvcGUucHJvZmlsZS5zdGF0ZS50b1VwcGVyQ2FzZSgpXTsKKyAgICAgICAgICAgICAgICAgICAgICAgIGlmKHByb2ZpbGVTdGF0ZSkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNjb3BlLnByb2ZpbGUuc3RhdGU9cHJvZmlsZVN0YXR1cy5zdGF0dXNbc2NvcGUucHJvZmlsZS5zdGF0ZS50b1VwcGVyQ2FzZSgpXS5zdGF0dXM7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2NvcGUuY29sb3JJY29uPXByb2ZpbGVTdGF0dXMuc3RhdHVzW3Njb3BlLnByb2ZpbGUuc3RhdGUudG9VcHBlckNhc2UoKV0uY29sb3I7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYoc2NvcGUucHJvZmlsZS5zdGF0ZS50b1VwcGVyQ2FzZSgpPT09cHJvZmlsZVN0YXR1cy5zdGF0dXMuUEVORElORy5zdGF0dXMudG9VcHBlckNhc2UoKXx8c2NvcGUucHJvZmlsZS5zdGF0ZS50b1VwcGVyQ2FzZSgpPT09cHJvZmlsZVN0YXR1cy5zdGF0dXMuTE9DS0VELnN0YXR1cy50b1VwcGVyQ2FzZSgpKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZihzY29wZS5wcm9maWxlLnN0YXRlLnRvVXBwZXJDYXNlKCk9PT1wcm9maWxlU3RhdHVzLnN0YXR1cy5MT0NLRUQuc3RhdHVzLnRvVXBwZXJDYXNlKCkpeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2NvcGUucHJvZmlsZS5sYXN0TG9naW49c2NvcGUucHJvZmlsZS5zdGF0ZTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBlbHNleworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2NvcGUucHJvZmlsZS5sYXN0TG9naW49c2NvcGUucHJvZmlsZS5zdGF0ZTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgdmFyIHRvZGF5PW5ldyBEYXRlKCkuZ2V0VGltZSgpOworICAgICAgICAgICAgICAgICAgICAgICAgdmFyIGxhc3Rsb2dpbj1uZXcgRGF0ZShzY29wZS5wcm9maWxlLmxhc3RMb2dpbikuZ2V0VGltZSgpOworICAgICAgICAgICAgICAgICAgICAgICAgdmFyIGRpZmY9KHRvZGF5LWxhc3Rsb2dpbikvKDEwMDAqNjAqNjAqMjQpOworICAgICAgICAgICAgICAgICAgICAgICAgaWYoZGlmZjw9MSl7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2NvcGUucHJvZmlsZS5sYXN0TG9naW49IlRvZGF5IjsKKyAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgIGVsc2UgaWYoZGlmZjw9Mil7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2NvcGUucHJvZmlsZS5sYXN0TG9naW49Illlc3RlcmRheSI7CisgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICB9IAorICAgICAgICAgICAgICAgICAgICAgfSAgICAgICAgICAgICAgICAgICAgIAorICAgICAgICAgICAgICAgIH07ICAgICAgICAgICAgICAKKyAgICAgICAgICAgIH1dKTsKK2FuZ3VsYXIubW9kdWxlKCdhdHQuYWJzLnByb2dyZXNzQmFycycsIFtdKQorCisuZGlyZWN0aXZlKCdhdHRQcm9ncmVzc0JhcicsIFsgZnVuY3Rpb24oKSB7CisgICAgcmV0dXJuIHsKKyAgICAgICAgcmV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zxkaXYgY2xhc3M9ImF0dC1yYWRpb19faW5kaWNhdG9yIj48L2Rpdj4nKTsKKyAgICAgICAgICAgIGVsZW1lbnQucGFyZW50KCkuYXR0cigidGl0bGUiLCBhdHRyLnRpdGxlKTsKKyAgICAgICAgICAgIGVsZW1lbnQuYXR0cigidGFiaW5kZXgiLCItMSIpOworCisgICAgICAgICAgICBuZ0N0cmwuJHJlbmRlciA9IGZ1bmN0aW9uICgpIHsKKyAgICAgICAgICAgICAgICB2YXIgc2VsZWN0ZWQgPSBhbmd1bGFyLmVxdWFscyhuZ0N0cmwuJG1vZGVsVmFsdWUsIGF0dHIuYXR0UmFkaW8pOworICAgICAgICAgICAgICAgIGVsZW1lbnQucGFyZW50KCkudG9nZ2xlQ2xhc3MoYXR0UmFkaW9Db25maWcuYWN0aXZlQ2xhc3MsIHNlbGVjdGVkKTsKKyAgICAgICAgICAgICAgICBlbGVtZW50LnBhcmVudCgpLmF0dHIoImFyaWEtY2hlY2tlZCIsIHNlbGVjdGVkKQorICAgICAgICAgICAgfTsKKworICAgICAgICAgICAgc2NvcGUudXBkYXRlTW9kZWwgPSBmdW5jdGlvbiAoZXZ0KSB7CisgICAgICAgICAgICAgICAgdmFyIGlzQWN0aXZlID0gZWxlbWVudC5wYXJlbnQoKS5oYXNDbGFzcyhhdHRSYWRpb0NvbmZpZy5hY3RpdmVDbGFzcyk7CisKKyAgICAgICAgICAgICAgICBpZiAoIWlzQWN0aXZlICYmICFzY29wZS5kaXNhYmxlZCkgeworICAgICAgICAgICAgICAgICAgICBuZ0N0cmwuJHNldFZpZXdWYWx1ZShpc0FjdGl2ZSA/IG51bGwgOiBhdHRyLmF0dFJhZGlvKTsKKyAgICAgICAgICAgICAgICAgICAgbmdDdHJsLiRyZW5kZXIoKTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgZXZ0LnByZXZlbnREZWZhdWx0KCk7CisgICAgICAgICAgICB9OworCisgICAgICAgICAgICBhdHRyLiRvYnNlcnZ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LgorICAgICAgICAgICAgICAgIHdoZWVsOiB0cnVlLCAvLyBFbmFibGUgb3IgZGlzYWJsZSB0aGUgbW91c2V3aGVlbDsKKyAgICAgICAgICAgICAgICB3aGVlbFNwZWVkOiA0MCwgLy8gSG93IG1hbnkgcGl4ZWxzIG11c3QgdGhlIG1vdXN3aGVlbCBzY3JvbGwgYXQgYSB0aW1lLgorICAgICAgICAgICAgICAgIHdoZWVsTG9jazogdHJ1ZSwgLy8gTG9jayBkZWZhdWx0IHNjcm9sbGluZyB3aW5kb3cgd2hlbiB0aGVyZSBpcyBubyBtb3JlIGNvbnRlbnQuCisgICAgICAgICAgICAgICAgc2Nyb2xsSW52ZXJ0OiBmYWxzZSwgLy8gRW5hYmxlIGludmVydCBzdHlsZSBzY3JvbGxpbmcKKyAgICAgICAgICAgICAgICB0cmFja1NpemU6IGZhbHNlLCAvLyBTZXQgdGhlIHNpemUgb2YgdGhlIHNjcm9sbGJhciB0byBhdXRvIG9yIGEgZml4ZWQgbnVtYmVyLgorICAgICAgICAgICAgICAgIHRodW1iU2l6ZTogZmFsc2UsIC8vIFNldCB0aGUgc2l6ZSBvZiB0aGUgdGh1bWIgdG8gYXV0byBvciBhIGZpeGVkIG51bWJlci4KKyAgICAgICAgICAgICAgICBhbHdheXNWaXNpYmxlOiB0cnVlIC8vIFNldCB0byBmYWxzZSB0byBoaWRlIHRoZSBzY3JvbGxiYXIgaWYgbm90IGJlaW5nIHVzZWQKKyAgICAgICAgICAgIH07CisgICAgICAgICAgICB2YXIgb3B0aW9ucyA9ICRhdHRycy5zY3JvbGxiYXI7CisgICAgICAgICAgICBpZiAob3B0aW9ucykgeworICAgICAgICAgICAgICAgIG9wdGlvbnMgPSAkcGFyc2Uob3B0aW9ucykoJHNjb3BlKTsKKyAgICAgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICAgICAgb3B0aW9ucyA9IHt9OworICAgICAgICAgICAgfQorICAgICAgICAgICAgdGhpcy5vcHRpb25zID0gYW5ndWxhci5leHRlbmQoe30sIGRlZmF1bHRzLCBvcHRpb25zKTsKKyAgICAgICAgICAgIHRoaXMuX2RlZmF1bHRzID0gZGVmYXVsdHM7CisKKyAgICAgICAgICAgIHZhciBzZWxmID0gdGhpcywKKyAgICAgICAgICAgICAgICAgICAgJGJvZHkgPSBhbmd1bGFyLmVsZW1lbnQoZG9jdW1lbnQucXVlcnlTZWxlY3RvckFsbCgnYm9keScpWzBdKSwKKyAgICAgICAgICAgICAgICAgICAgJGRvY3VtZW50ID0gYW5ndWxhci5lbGVtZW50KGRvY3VtZW50KSwKKyAgICAgICAgICAgICAgICAgICAgJHZpZXdwb3J0ID0gYW5ndWxhci5lbGVtZW50KCRlbGVtZW50WzBdLnF1ZXJ5U2VsZWN0b3JBbGwoJy5zY3JvbGwtdmlld3BvcnQnKVswXSksCisgICAgICAgICAgICAgICAgICAgICRvdmVydmlldyA9IGFuZ3VsYXIuZWxlbWVudCgkZWxlbWVudFswXS5xdWVyeVNlbGVjdG9yQWxsKCcuc2Nyb2xsLW92ZXJ2aWV3JylbMF0pLAorICAgICAgICAgICAgICAgICAgICAkc2Nyb2xsYmFyID0gYW5ndWxhci5lbGVtZW50KCRlbGVtZW50WzBdLnF1ZXJ5U2VsZWN0b3JBbGwoJy5zY3JvbGwtYmFyJylbMF0pLAorICAgICAgICAgICAgICAgICAgICAkdGh1bWIgPSBhbmd1bGFyLmVsZW1lbnQoJGVsZW1lbnRbMF0ucXVlcnlTZWxlY3RvckFsbCgnLnNjcm9sbC10aHVtYicpWzBdKSwKKyAgICAgICAgICAgICAgICAgICAgbW91c2VQb3NpdGlvbiA9IDAsCisgICAgICAgICAgICAgICAgICAgIGlzSG9yaXpvbnRhbCA9IHRoaXMub3B0aW9ucy5heGlzID09PSAneCcsCisgICAgICAgICAgICAgICAgICAgIGhhc1RvdWNoRXZlbnRzPWZhbHNlLAorICAgICAgICAgICAgICAgICAgICB3aGVlbEV2ZW50ID0gKCJvbndoZWVsIiBpbiBkb2N1bWVudCA/ICJ3aGVlbCIgOiAvLyBNb2Rlcm4gYnJvd3NlcnMgc3VwcG9ydCAid2hlZWwiCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgZG9jdW1lbnQub25tb3VzZXdoZWVsICE9PSB1bmRlZmluZWQgPyAibW91c2V3aGVlbCIgOiAvLyBXZWJraXQgYW5kIElFIHN1cHBvcnQgYXQgbGVhc3QgIm1vdXNld2hlZWwiCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgIkRPTU1vdXNlU2Nyb2xsIiksIC8vIGxldCdzIGFzc3VtZSB0aGF0IHJlbWFpbmluZyBicm93c2VycyBhcmUgb2xkZXIgRmlyZWZveAorICAgICAgICAgICAgICAgICAgICBzaXplTGFiZWwgPSBpc0hvcml6b250YWwgPyAnd2lkdGgnIDogJ2hlaWdodCcsCisgICAgICAgICAgICAgICAgICAgIHNpemVMYWJlbENhcCA9IHNpemVMYWJlbC5jaGFyQXQoMCkudG9VcHBlckNhc2UoKSArIHNpemVMYWJlbC5zbGljZSgxKS50b0xvd2VyQ2FzZSgpLAorICAgICAgICAgICAgICAgICAgICBwb3NpTGFiZWwgPSBpc0hvcml6b250YWwgPyAnbGVmdCcgOiAndG9wJywKKyAgICAgICAgICAgICAgICAgICAgLy8gbW92ZUV2ZW50ID0gZG9jdW1lbnQuY3JlYXRlRXZlbnQoJ0hUTUxFdmVudHMnKSwKKyAgICAgICAgICAgICAgICAgICAgcmVzdG9yZVZpc2liaWxpdHlBZnRlcldoZWVsLAorICAgICAgICAgICAgICAgICAgICB0aHVtYnNjcm9sbHRvdWNoPWZhbHNlLGRvY3VtbmV0c2Nyb2xsdG91Y2g9ZmFsc2U7CisgICAgICAgICAgICAgICAgaWYoKCdvbnRvdWNoc3RhcnQnIGluIHdpbmRvdykgfHwgd2luZG93LkRvY3VtZW50VG91Y2ggJiYgZG9jdW1lbnQgaW5zdGFuY2VvZiBEb2N1bWVudFRvdWNoKSB7CisgICAgICAgICAgICAgICAgICAgIGhhc1RvdWNoRXZlbnRzID0gdHJ1ZTsKKyAgICAgICAgICAgICAgICB9CisKKyAgICAgICAgICAgIC8vbW92ZUV2ZW50LmluaXRFdmVudCgnbW92ZScsIHRydWUsIHRydWUpOworICAgICAgICAgICAgdGhpcy5jb250ZW50UG9zaXRpb24gPSAwOworICAgICAgICAgICAgdGhpcy52aWV3cG9ydFNpemUgPSAwOworICAgICAgICAgICAgdGhpcy5jb250ZW50U2l6ZSA9IDA7CisgICAgICAgICAgICB0aGlzLmNvbnRlbnRSYXRpbyA9IDA7CisgICAgICAgICAgICB0aGlzLnRyYWNrU2l6ZSA9IDA7CisgICAgICAgICAgICB0aGlzLnRyYWNrUmF0aW8gPSAwOworICAgICAgICAgICAgdGhpcy50aHVtYlNpemUgPSAwOworICAgICAgICAgICAgdGhpcy50aHVtYlBvc2l0aW9uID0gMDsKKworICAgICAgICAgICAgdGhpcy5pbml0aWFsaXplID0gZnVuY3Rpb24oKSB7CisgICAgICAgICAgICAgICAgaWYgKCF0aGlzLm9wdGlvbnMuYWx3YXlzVmlzaWJsZSkgeworICAgICAgICAgICAgICAgICAgICAkc2Nyb2xsYmFyLmNzcygnb3BhY2l0eScsIDApOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICBzZWxmLnVwZGF0ZSgpOworICAgICAgICAgICAgICAgIHNldEV2ZW50cygpOworICAgICAgICAgICAgICAgIHJldHVybiBzZWxmOworICAgICAgICAgICAgfTsKKworICAgICAgICAgICAgdGhpcy51cGRhdGUgPSBmdW5jdGlvbihzY3JvbGxUbykgeworICAgICAgICAgICAgICAgIHRoaXMudmlld3BvcnRTaXplID0gJHZpZXdwb3J0LnByb3AoJ29mZnNldCcgKyBzaXplTGFiZWxDYXApIHx8IDE7CisgICAgICAgICAgICAgICAgdGhpcy5jb250ZW50U2l6ZSA9ICRvdmVydmlldy5wcm9wKCdzY3JvbGwnICsgc2l6ZUxhYmVsQ2FwKSB8fCAxOworICAgICAgICAgICAgICAgIHRoaXMuY29udGVud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dW5jdGlvbigpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICRhbmltYXRlLnJlbW92ZUNsYXNzKCRzY3JvbGxiYXIsICd2aXNpYmxlJyk7CisgICAgICAgICAgICAgICAgICAgICAgICAkc2NvcGUuJGRpZ2VzdCgpOworICAgICAgICAgICAgICAgICAgICB9KTsKKyAgICAgICAgICAgICAgICB9CisKKyAgICAgICAgICAgICAgICBpZiAoc2Nyb2xsVG8gIT09IG51bGwpIHsKKyAgICAgICAgICAgICAgICAgICAgc3dpdGNoIChzY3JvbGxUbykgeworICAgICAgICAgICAgICAgICAgICAgICAgY2FzZSAnYm90dG9tJzoKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB0aGlzLmNvbnRlbnRQb3NpdGlvbiA9IHRoaXMuY29udGVudFNpemUgLSB0aGlzLnZpZXdwb3J0U2l6ZTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICAgICAgICAgIGRlZmF1bHQ6CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgdGhpcy5jb250ZW50UG9zaXRpb24gPSBwYXJzZUludChzY3JvbGxUbywgMTApIHx8IDA7CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICB9CisKKyAgICAgICAgICAgICAgICBlbnN1cmVDb250ZW50UG9zaXRpb24oKTsKKyAgICAgICAgICAgICAgICAkdGh1bWIuY3NzKHBvc2lMYWJlbCwgc2VsZi5jb250ZW50UG9zaXRpb24gLyBzZWxmLnRyYWNrUmF0aW8gKyAncHgnKTsKKyAgICAgICAgICAgICAgICAkc2Nyb2xsYmFyLmNzcyhzaXplTGFiZWwsIHNlbGYudHJhY2tTaXplICsgJ3B4Jyk7CisgICAgICAgICAgICAgICAgJHRodW1iLmNzcyhzaXplTGFiZWwsIHNlbGYudGh1bWJTaXplICsgJ3B4Jyk7CisgICAgICAgICAgICAgICAgJG92ZXJ2aWV3LmNzcyhwb3NpTGFiZWwsIC1zZWxmLmNvbnRlbnRQb3NpdGlvbiArICdweCcpOworCisgICAgICAgICAgICAgICAgcmV0dXJuIHRoaXM7CisgICAgICAgICAgICB9OworICAgICAgICAgICAgZmlyZUV2ZW50ID0gZnVuY3Rpb24ob2JqLCBldnQpIHsKKyAgICAgICAgICAgICAgICB2YXIgZmlyZU9uVGhpcyA9IG9iajsKKyAgICAgICAgICAgICAgICBpZiAoZG9jdW1lbnQuY3JlYXRlRXZlbnQpIHsKKyAgICAgICAgICAgICAgICAgICAgLy8gYWxlcnQoIkZGIik7CisgICAgICAgICAgICAgICAgICAgIHZhciBldnRPYmogPSBkb2N1bWVudC5jcmVhdGVFdmVudCgnSFRNTEV2ZW50cycpOworICAgICAgICAgICAgICAgICAgICBldnRPYmouaW5pdEV2ZW50KGV2dCwgdHJ1ZSwgZmFsc2UpOworICAgICAgICAgICAgICAgICAgICBmaXJlT25UaGlzLmRpc3BhdGNoRXZlbnQoZXZ0T2JqKTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgZWxzZSBpZiAoZG9jdW1lbnQuY3JlYXRlRXZlbnRPYmplY3QpIHsKKyAgICAgICAgICAgICAgICAgICAgLy8gYWxlcnQoIklFOCIpOworICAgICAgICAgICAgICAgICAgICB2YXIgZXZ0T2JqID0gZG9jdW1lbnQuY3JlYXRlRXZlbnRPYmplY3QoKTsKKyAgICAgICAgICAgICAgICAgICAgZmlyZU9uVGhpcy5maXJlRXZlbnQoJ29uJyArIGV2dCwgZXZ0T2JqKTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9OworICAgICAgICAgICAgZnVuY3Rpb24gZW5zdXJlQ29udGVudFBvc2l0aW9uKCkgeworICAgICAgICAgICAgICAgIC8vIGlmIHNjcm9sbGJhciBpcyBvbiwgZW5zdXJlIHRoZSBib3R0b20gb2YgdGhlIGNvbnRlbnQgZG9lcyBub3QgZ28gYWJvdmUgdGhlIGJvdHRvbSBvZiB0aGUgdmlld3BvcnQKKyAgICAgICAgICAgICAgICBpZiAoc2VsZi5jb250ZW50UmF0aW8gPD0gMSAmJiBzZWxmLmNvbnRlbnRQb3NpdGlvbiA+IHNlbGYuY29udGVudFNpemUgLSBzZWxmLnZpZXdwb3J0U2l6ZSkgeworICAgICAgICAgICAgICAgICAgICBzZWxmLmNvbnRlbnRQb3NpdGlvbiA9IHNlbGYuY29udGVudFNpemUgLSBzZWxmLnZpZXdwb3J0U2l6ZTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgLy8gaWYgc2Nyb2xsYmFyIGlzIG9mZiwgZW5zdXJlIHRoZSB0b3Agb2YgdGhlIGNvbnRlbnQgZG9lcyBub3QgZ28gYmVsb3cgdGhlIHRvcCBvZiB0aGUgdmlld3BvcnQKKyAgICAgICAgICAgICAgICBlbHNlIGlmIChzZWxmLmNvbnRlbnRSYXRpbyA+IDEgJiYgc2VsZi5jb250ZW50UG9zaXRpb24gPiAwKSB7CisgICAgICAgICAgICAgICAgICAgIHNlbGYuY29udGVudFBvc2l0aW9uID0gMDsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9CisKKyAgICAgICAgICAgIGZ1bmN0aW9uIHNldEV2ZW50cygpIHsKKworICAgICAgICAgICAgICAgIGlmIChoYXNUb3VjaEV2ZW50cykgeworICAgICAgICAgICAgICAgICAgICAkdmlld3BvcnQub24oJ3RvdWNoc3RhcnQnLCB0b3VjaHN0YXJ0KTsKKwkJCQkJJHRodW1iLm9uKCd0b3VjaHN0YXJ0JywgdG91Y2hzdGFydCk7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIGVsc2UgeworICAgICAgICAgICAgICAgICAgICAkdGh1bWIub24oJ21vdXNlZG93bicsIHN0YXJ0KTsKKyAgICAgICAgICAgICAgICAgICAgJHNjcm9sbGJhci5vbignbW91c2Vkb3duJywgZHJhZyk7CisgICAgICAgICAgICAgICAgfQorCisgICAgICAgICAgICAgICAgYW5ndWxhci5lbGVtZW50KCR3aW5kb3cpLm9uKCdyZXNpemUnLCByZXNpemUpOworCisgICAgICAgICAgICAgICAgaWYgKHNlbGYub3B0aW9ucy53aGVlbCkgeworICAgICAgICAgICAgICAgICAgICAkZWxlbWVudC5vbih3aGVlbEV2ZW50LCB3aGVlbCk7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfQorCisgICAgICAgICAgICBmdW5jdGlvbiByZXNpemUoKSB7CisgICAgICAgICAgICAgICAgc2VsZi51cGRhdGUoKTsKKyAgICAgICAgICAgIH0KKworICAgICAgICAgICAgZnVuY3Rpb24gdG91Y2hzdGFydChldmVudCkgeworICAgICAgICAgICAgICAgIGlmICgxID09PSBldmVudC50b3VjaGVzLmxlbmd0aCkgeworICAgICAgICAgICAgICAgICAgICBldmVudC5zdG9wUHJvcGFnYXRpb24oKTsKKyAgICAgICAgICAgICAgICAgICAgc3RhcnQoZXZlbnQudG91Y2hlc1swXSk7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfQorCisgICAgICAgICAgICBmdW5jdGlvbiBzdGFydChldmVudCkgeworICAgICAgICAgICAgICAgICRib2R5LmFkZENsYXNzKCdzY3JvbGwtbm8tc2VsZWN0Jyk7CisgICAgICAgICAgICAgICAgJGVsZW1lbnQuYWRkQ2xhc3MoJ3Njcm9sbC1uby1zZWxlY3QnKTsKKworICAgICAgICAgICAgICAgIGlmICghc2VsZi5vcHRpb25zLmFsd2F5c1Zpc2libGUpIHsKKyAgICAgICAgICAgICAgICAgICAgJHNjcm9sbGJhci5hZGRDbGFzcygndmlzaWJsZScpOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICBtb3VzZVBvc2l0aW9uID0gaXNIb3Jpem9udGFsID8gZXZlbnQuY2xpZW50WCA6IGV2ZW50LmNsaWVudFk7CisgICAgICAgICAgICAgICAgc2VsZi50aHVtYlBvc2l0aW9uID0gcGFyc2VJbnQoJHRodW1iLmNzcyhwb3NpTGFiZWwpLCAxMCkgfHwgMDsKKworICAgICAgICAgICAgICAgIGlmIChoYXNUb3VjaEV2ZW50cykgeworCQkJCQlkb2N1bW5ldHNjcm9sbHRvdWNoPWZhbHNlOworICAgICAgICAgICAgICAgICAgICB0aHVtYnNjcm9sbHRvdWNoPWZhbHNlOworCQkJCQkkdmlld3BvcnQub24oJ3RvdWNobW92ZScsIHRvdWNoZHJhZyk7CisgICAgICAgICAgICAgICAgICAgICR2aWV3cG9ydC5vbigndG91Y2hlbmQnLCBlbmQpOworCQkJCQkkdGh1bWIub24oJ3RvdWNobW92ZScsdG91Y2hkcmFndGh1bWIpOworICAgICAgICAgICAgICAgICAgICAkdGh1bWIub24oJ3RvdWNoZW5kJywgZW5kKTsKKyAgICAgICAgICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgICAgICAgICAkZG9jdW1lbnQub24oJ21vdXNlbW92ZScsIGRyYWcpOworICAgICAgICAgICAgICAgICAgICAkZG9jdW1lbnQub24oJ21vdXNldXAnLCBlbmQpOworICAgICAgICAgICAgICAgICAgICAkdGh1bWIub24oJ21vdXNldXAnLCBlbmQpOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0KKworICAgICAgICAgICAgZnVuY3Rpb24gd2hlZWwoZXZlbnQpIHsKKworICAgICAgICAgICAgICAgIGlmIChzZWxmLmNvbnRlbnRSYXRpbyA+PSAxKSB7CisgICAgICAgICAgICAgICAgICAgIHJldHVybjsKKyAgICAgICAgICAgICAgICB9CisKKyAgICAgICAgICAgICAgICBpZiAoIXNlbGYub3B0aW9ucy5hbHdheXNWaXNpYmxlKSB7CisgICAgICAgICAgICAgICAgICAgIC8vY2FuY2VsIHJlbW92aW5nIHZpc2liaWxpdHkgaWYgd2hlZWwgZXZlbnQgaXMgdHJpZ2dlcmVkIGJlZm9yZSB0aGUgdGltZW91dAorICAgICAgICAgICAgICAgICAgICBpZiAocmVzdG9yZVZpc2liaWxpdHlBZnRlcldoZWVsKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAkdGltZW91dC5jYW5jZWwocmVzdG9yZVZpc2liaWxpdHlBZnRlcldoZWVsKTsKKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAkc2Nyb2xsYmFyLmFkZENsYXNzKCd2aXNpYmxlJyk7CisKKyAgICAgICAgICAgICAgICAgICAgcmVzdG9yZVZpc2liaWxpdHlBZnRlcldoZWVsID0gJHRpbWVvdXQoZnVuY3Rpb24oKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAkc2Nyb2xsYmFyLnJlbW92ZUNsYXNzKCd2aXNpYmxlJyk7CisgICAgICAgICAgICAgICAgICAgIH0sIDEwMCk7CisgICAgICAgICAgICAgICAgfQorCisKKyAgICAgICAgICAgICAgICB2YXIgZXZudE9iaiA9IChldmVudCAmJiBldmVudC5vcmlnaW5hbEV2ZW50KSB8fCBldmVudCB8fCAkd2luZG93LmV2ZW50LAorICAgICAgICAgICAgICAgICAgICAgICAgZGVsdGFEaXIgPSBzZWxmLm9wdGlvbnMuYXhpcy50b1VwcGVyQ2FzZSgpLAorICAgICAgICAgICAgICAgICAgICAgICAgZGVsdGEgPSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgWDogZXZudE9iai5kZWx0YVgsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgWTogZXZudE9iai5kZWx0YVkKKyAgICAgICAgICAgICAgICAgICAgICAgIH0sCisgICAgICAgICAgICAgICAgd2hlZWxTcGVlZCA9IGV2bnRPYmouZGVsdGFNb2RlID09PSAwID8gc2VsZi5vcHRpb25zLndoZWVsU3BlZWQgOiAxOworCisgICAgICAgICAgICAgICAgaWYgKHNlbGYub3B0aW9ucy5zY3JvbGxJbnZlcnQpIHsKKyAgICAgICAgICAgICAgICAgICAgd2hlZWxTcGVlZCAqPSAtMTsKKyAgICAgICAgICAgICAgICB9CisKKyAgICAgICAgICAgICAgICBpZiAod2hlZWxFdmVudCA9PT0gJ21vdXNld2hlZWwnKSB7CisgICAgICAgICAgICAgICAgICAgIGRlbHRhLlkgPSAtMSAqIGV2bnRPYmoud2hlZWxEZWx0YSAvIDQwOworICAgICAgICAgICAgICAgICAgICBldm50T2JqLndoZWVsRGVsdGFYICYmIChkZWx0YS5YID0gLTEgKiBldm50T2JqLndoZWVsRGVsdGFYIC8gNDApOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICBkZWx0YS5YICo9IC0xIC8gd2hlZWxTcGVlZDsKKyAgICAgICAgICAgICAgICBkZWx0YS5ZICo9IC0xIC8gd2hlZWxTcGVlZDsKKworICAgICAgICAgICAgICAgIHZhciB3aGVlbFNwZWVkRGVsdGEgPSBkZWx0YVtkZWx0YURpcl07CisKKyAgICAgICAgICAgICAgICBzZWxmLmNvbnRlbnRQb3NpdGlvbiAtPSB3aGVlbFNwZWVkRGVsdGEgKiBzZWxmLm9wdGlvbnMud2hlZWxTcGVlZDsKKyAgICAgICAgICAgICAgICBzZWxmLmNvbnRlbnRQb3NpdGlvbiA9IE1hdGgubWluKChzZWxmLmNvbnRlbnRTaXplIC0gc2VsZi52aWV3cG9ydFNpemUpLCBNYXRoLm1heCgwLCBzZWxmLmNvbnRlbnRQb3NpdGlvbikpOworCisKKyAgICAgICAgICAgICAgICAvLyRlbGVtZW50WzBdLmRpc3BhdGNoRXZlbnQobW92ZUV2ZW50KTsKKyAgICAgICAgICAgICAgICBmaXJlRXZlbnQoJGVsZW1lbnRbMF0sICdtb3ZlJyk7CisKKyAgICAgICAgICAgICAgICBlbnN1cmVDb250ZW50UG9zaXRpb24oKTsKKyAgICAgICAgICAgICAgICAkdGh1bWIuY3NzKHBvc2lMYWJlbCwgc2VsZi5jb250ZW50UG9zaXRpb24gLyBzZWxmLnRyYWNrUmF0aW8gKyAncHgnKTsKKyAgICAgICAgICAgICAgICAkb3ZlcnZpZXcuY3NzKHBvc2lMYWJlbCwgLXNlbGYuY29udGVudFBvc2l0aW9uICsgJ3B4Jyk7CisKKyAgICAgICAgICAgICAgICBpZiAoc2VsZi5vcHRpb25zLndoZWVsTG9jayB8fCAoc2VsZi5jb250ZW50UG9zaXRpb24gIT09IChzZWxmLmNvbnRlbnRTaXplIC0gc2VsZi52aWV3cG9ydFNpemUpICYmIHNlbGYuY29udGVudFBvc2l0aW9uICE9PSAwKSkgeworICAgICAgICAgICAgICAgICAgICBldm50T2JqLnByZXZlbnREZWZhdWx0KCk7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfQorCisgICAgICAgICAgICBmdW5jdGlvbiB0b3VjaGRyYWcoZXZlbnQpIHsKKyAgICAgICAgICAgICAgICBldmVudC5wcmV2ZW50RGVmYXVsdCgpOworCQkJCWRvY3VtbmV0c2Nyb2xsdG91Y2g9dHJ1ZTsKKyAgICAgICAgICAgICAgICBkcmFnKGV2ZW50LnRvdWNoZXNbMF0pOworICAgICAgICAgICAgfQorCQkJZnVuY3Rpb24gdG91Y2hkcmFndGh1bWIoZXZlbnQpeworICAgICAgICAgICAgICAgIGV2ZW50LnByZXZlbnREZWZhdWx0KCk7CisgICAgICAgICAgICAgICAgdGh1bWJzY3JvbGx0b3VjaD10cnVlOworICAgICAgICAgICAgICAgIGRyYWcoZXZlbnQudG91Y2hlc1swXSk7ICAgICAgICAgCisgICAgICAgICAgICB9CisKKyAgICAgICAgICAgIGZ1bmN0aW9uIGRyYWcoZXZlbnQpIHsKKworICAgICAgICAgICAgICAgIGlmIChzZWxmLmNvbnRlbnRSYXRpbyA+PSAxKSB7CisgICAgICAgICAgICAgICAgICAgIHJldHVybjsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgdmFyIG1vdXNlUG9zaXRpb25OZXcgPSBpc0hvcml6b250YWwgPyBldmVudC5jbGllbnRYIDogZXZlbnQuY2xpZW50WSwKKyAgICAgICAgICAgICAgICAgICAgICAgIHRodW1iUG9zaXRpb25EZWx0YSA9IG1vdXNlUG9zaXRpb25OZXcgLSBtb3VzZVBvc2l0aW9uOworCisgICAgICAgICAgICAgICAgaWYgKChzZWxmLm9wdGlvbnMuc2Nyb2xsSW52ZXJ0ICYmICFoYXNUb3VjaEV2ZW50cykgfHwKKyAgICAgICAgICAgICAgICAgICAgICAgIChoYXNUb3VjaEV2ZW50cyAmJiAhc2VsZi5vcHRpb25zLnNjcm9sbEludmVydCkpCisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICB0aHVtYlBvc2l0aW9uRGVsdGEgPSBtb3VzZVBvc2l0aW9uIC0gbW91c2VQb3NpdGlvbk5ldzsKKyAgICAgICAgICAgICAgICB9CisJCQkJaWYoZG9jdW1uZXRzY3JvbGx0b3VjaCAmJiBoYXNUb3VjaEV2ZW50cyl7CisgICAgICAgICAgICAgICAgICAgICAgICB0aHVtYlBvc2l0aW9uRGVsdGEgPSBtb3VzZVBvc2l0aW9uIC0gbW91c2VQb3NpdGlvbk5ldzsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgaWYodGh1bWJzY3JvbGx0b3VjaCAmJiBoYXNUb3VjaEV2ZW50cyl7CisgICAgICAgICAgICAgICAgICAgIHRodW1iUG9zaXRpb25EZWx0YSA9IG1vdXNlUG9zaXRpb25OZXcgLSBtb3VzZVBvc2l0aW9uOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICB2YXIgdGh1bWJQb3NpdGlvbk5ldyA9IE1hdGgubWluKChzZWxmLnRyYWNrU2l6ZSAtIHNlbGYudGh1bWJTaXplKSwgTWF0aC5tYXgoMCwgc2VsZi50aHVtYlBvc2l0aW9uICsgdGh1bWJQb3NpdGlvbkRlbHRhKSk7CisgICAgICAgICAgICAgICAgc2VsZi5jb250ZW50UG9zaXRpb24gPSB0aHVtYlBvc2l0aW9uTmV3ICogc2VsZi50cmFja1JhdGlvOworCisKKyAgICAgICAgICAgICAgICAvLyAkZWxlbWVudFswXS5kaXNwYXRjaEV2ZW50KG1vdmVFdmVudCk7CisgICAgICAgICAgICAgICAgZmlyZUV2ZW50KCRlbGVtZW50WzBdLCAnbW92ZScpOworCisgICAgICAgICAgICAgICAgZW5zdXJlQ29udGVudFBvc2l0aW9uKCk7CisgICAgICAgICAgICAgICAgJHRodW1iLmNzcyhwb3NpTGFiZWwsIHRodW1iUG9zaXRpb25OZXcgKyAncHgnKTsKKyAgICAgICAgICAgICAgICAkb3ZlcnZpZXcuY3NzKHBvc2lMYWJlbCwgLXNlbGYuY29udGVudFBvc2l0aW9uICsgJ3B4Jyk7CisgICAgICAgICAgICB9CisKKyAgICAgICAgICAgIGZ1bmN0aW9uIGVuZCgpIHsKKworICAgICAgICAgICAgICAgICRib2R5LnJlbW92ZUNsYXNzKCdzY3JvbGwtbm8tc2VsZWN0Jyk7CisgICAgICAgICAgICAgICAgJGVsZW1lbnQucmVtb3ZlQ2xhc3MoJ3Njcm9sbC1uby1zZWxlY3QnKTsKKyAgICAgICAgICAgICAgICBpZiAoIXNlbGYub3B0aW9ucy5hbHdheXNWaXNpYmxlKSB7CisgICAgICAgICAgICAgICAgICAgICRzY3JvbGxiYXIucmVtb3ZlQ2xhc3MoJ3Zpc2libGUnKTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgJGRvY3VtZW50Lm9mZignbW91c2Vtb3ZlJywgZHJhZyk7CisgICAgICAgICAgICAgICAgJGRvY3VtZW50Lm9mZignbW91c2V1cCcsIGVuZCk7CisgICAgICAgICAgICAgICAgJHRodW1iLm9mZignbW91c2V1cCcsIGVuZCk7CisgICAgICAgICAgICAgICAgJGRvY3VtZW50Lm9mZigndG91Y2htb3ZlJywgdG91Y2hkcmFnKTsKKyAgICAgICAgICAgICAgICAkZG9jdW1lbnQub2ZmKCdvbnRvdWNoZW5kJywgZW5kKTsKKwkJCQkkdGh1bWIub2ZmKCd0b3VjaG1vdmUnLHRvdWNoZHJhZ3RodW1iKTsKKyAgICAgICAgICAgICAgICAkdGh1bWIub2ZmKCd0b3VjaGVuZCcsIGVuZCk7CisgICAgICAgICAgICB9CisgICAgICAgICAgICB0aGlzLmNsZWFudXAgPSBmdW5jdGlvbigpIHsKKyAgICAgICAgICAgICAgICAkdmlld3BvcnQub2ZmKCd0b3VjaHN0YXJ0JywgdG91Y2hzdGFydCk7CisgICAgICAgICAgICAgICAgJHRodW1iLm9mZignbW91c2Vkb3duJywgc3RhcnQpOworICAgICAgICAgICAgICAgICRzY3JvbGxiYXIub2ZmKCdtb3VzZWRvd24nLCBkcmFnKTsKKwkJCQkkdGh1bWIub2ZmKCd0b3VjaG1vdmUnLHRvdWNoZHJhZ3RodW1iKTsKKyAgICAgICAgICAgICAgICAkdGh1bWIub2ZmKCd0b3VjaGVuZCcsIGVuZCk7CisgICAgICAgICAgICAgICAgYW5ndWxhci5lbGVtZW50KCR3aW5kb3cpLm9mZigncmVzaXplJywgcmVzaXplKTsKKyAgICAgICAgICAgICAgICAkZWxlbWVudC5vZmYod2hlZWxFdmVudCwgd2hlZWwpOworICAgICAgICAgICAgICAgIC8vZW5zdXJlIHNjcm9sbGJhciBpc24ndCBhY3RpdmF0ZWQKKyAgICAgICAgICAgICAgICBzZWxmLm9wdGlvbnMuYWx3YXlzVmlzaWJsZSA9IHRydWU7CisgICAgICAgICAgICAgICAgZW5kKCk7CisgICAgICAgICAgICB9OworCisgICAgICAgIH1dLAorICAgICAgICBsaW5rOiBmdW5jdGlvbihzY29wZSwgaUVsZW1lbnQsIGlBdHRycywgY29udHJvbGxlcikgeworICAgICAgICAgICAgdmFyIHBvc2l0aW9uID0gaUVsZW1lbnQuY3NzKCdwb3NpdGlvbicpOworICAgICAgICAgICAgaWYgKHBvc2l0aW9uICE9PSAncmVsYXRpdmUnICYmIHBvc2l0aW9uICE9PSAnYWJzb2x1dGUnKSB7CisgICAgICAgICAgICAgICAgaUVsZW1lbnQuY3NzKCdwb3NpdGlvbicsICdyZWxhdGl2ZScpOworICAgICAgICAgICAgfQorICAgICAgICAgICAgc2NvcGUuJHdhdGNoKGZ1bmN0aW9uKCkgeworICAgICAgICAgICAgICAgICR0aW1lb3V0KGZ1bmN0aW9uKCkgeworICAgICAgICAgICAgICAgICAgICB2YXIgJG92ZXJ2aWV3ID0gYW5ndWxhci5lbGVtZW50KGlFbGVtZW50WzBdLnF1ZXJ5U2VsZWN0b3JBbGwoJy5zY3JvbGwtb3ZlcnZpZXcnKVswXSk7CisgICAgICAgICAgICAgICAgICAgIHZhciBuZXdWYWx1ZSA9ICRvdmVydmlldy5wcm9wKCdzY3JvbGxIZWlnaHQnKTsKKyAgICAgICAgICAgICAgICAgICAgdmFyIG9sZFZhbHVlID0gc2NvcGUub2xkVmFsdWU7CisgICAgICAgICAgICAgICAgICAgIGlmIChuZXdWYWx1ZSAhPT0gb2xkVmFsdWUpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIHNjb3BlLm9sZFZhbHVlID0gbmV3VmFsdWU7CisgICAgICAgICAgICAgICAgICAgICAgICBjb250cm9sbGVyLnVwZGF0ZSgpOworICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgfSwgMTAwLCBmYWxzZSk7CisgICAgICAgICAgICB9KTsKKyAgICAgICAgICAgIGNvbnRyb2xsZXIuaW5pdGlhbGl6ZSgpOworICAgICAgICAgICAgaUVsZW1lbnQub24oJyRkZXN0cm95JywgZnVuY3Rpb24oKSB7CisgICAgICAgICAgICAgICAgY29udHJvbGxlci5jbGVhbnVwKCk7CisgICAgICAgICAgICB9KTsKKyAgICAgICAgfQorICAgIH07Cit9XSk7CisoZnVuY3Rpb24oKXsgICAgCit2YXIgS0VZID0geworICAgIFRBQjogOSwKKyAgICBFTlRFUjogMTMsCisgICAgRVNDOiAyNywKKyAgICBTUEFDRTogMzIsCisgICAgTEVGVDogMzcsCisgICAgVVA6IDM4LAorICAgIFJJR0hUOiAzOSwKKyAgICBET1dOOiA0MCwKKyAgICBTSElGVDogMTYsCisgICAgQ1RSTDogMTcsCisgICAgQUxUOiAxOCwKKyAgICBQQUdFX1VQOiAzMywKKyAgICBQQUdFX0RPV046IDM0LAorICAgIEhPTUU6IDM2LAorICAgIEVORDogMzUsCisgICAgQkFDS1NQQUNFOiA4LAorICA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ZW50LCBhdHRyLCBjdHJsKSB7CisgICAgICAgICAgICAKKyAgICAgICAgICAgIHNjb3BlLnNlbGVjdGVkSW5kZXggPSAtMTsKKyAgICAgICAgICAgIHNjb3BlLnNlbGVjdGVkT3B0aW9uID0gYXR0ci5wbGFjZWhvbGRlcjsKKyAgICAgICAgICAgIHNjb3BlLmlzRGlzYWJsZWQgPSBmYWxzZTsKKyAgICAgICAgICAgIHNjb3BlLmNsYXNzTmFtZSA9ICJzZWxlY3QyLW1hdGNoIjsKKyAgICAgICAgICAgIHNjb3BlLnNob3dTZWFyY2ggPSBmYWxzZTsKKyAgICAgICAgICAgIHNjb3BlLnNob3dsaXN0ID0gZmFsc2U7CisKKyAgICAgICAgICAgIGlmKGF0dHIucGxhY2Vob2xkZXJBc09wdGlvbiA9PT0gImZhbHNlIikKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBzY29wZS5zZWxlY3RNc2cgPSAiIjsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBzY29wZS5zZWxlY3RNc2cgPSBhdHRyLnBsYWNlaG9sZGVyOworICAgICAgICAgICAgfQorCisgICAgICAgICAgICBpZihhdHRyLnNob3dJbnB1dEZpbHRlciA9PT0gInRydWUiKXtzY29wZS5zaG93U2VhcmNoID0gdHJ1ZTt9ICAgICAgICAgICAgCisKKyAgICAgICAgICAgIHNjb3BlLnNob3dEcm9wZG93biA9IGZ1bmN0aW9uKCl7CisgICAgICAgICAgICAgICAgaWYoIShhdHRyLmRpc2FibGVkKSl7CisgICAgICAgICAgICAgICAgICAgIHNjb3BlLnNob3dsaXN0ID0gIXNjb3BlLnNob3dsaXN0OworICAgICAgICAgICAgICAgICAgICBzY29wZS5zZXRTZWxlY3RUb3AoKTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9OworICAgICAgICAgICAgCisgICAgICAgICAgICAgZWxlbWVudC5iaW5kKCJrZXlkb3duIiwgZnVuY3Rpb24oZSl7ICAgICAgICAgICAgICAgICAgICAgCisgICAgICAgICAgICAgICAgaWYgKGUua2V5Q29kZSA9PT0gS0VZLkJBQ0tTUEFDRSB8fCBlLmtleUNvZGUgPT09IEtFWS5TUEFDRSB8fCBlLmtleUNvZGUgPT09IEtFWS5FU0MgfHwgZS5rZXlDb2RlID09PSBLRVkuRU5URVIgfHwgS0VZLmlzQ29udHJvbChlKSB8fCBLRVkuaXNWZXJ0aWNhbE1vdmVtZW50KGUua2V5Q29kZSkgfHwgS0VZLmlzSG9yaXpvbnRhbE1vdmVtZW50KGUua2V5Q29kZSkgfHwgS0VZLmlzRnVuY3Rpb25LZXkoZS5rZXlDb2RlKSkgCisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICBlLnByZXZlbnREZWZhdWx0KCk7CisgICAgICAgICAgICAgICAgICAgIGUuc3RvcFByb3BhZ2F0aW9uKCk7IAorICAgICAgICAgICAgICAgICAgICAKKyAgICAgICAgICAgICAgICAgICAgc3dpdGNoIChlLmtleUNvZGUpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIGNhc2UgS0VZLkRPV046CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2NvcGUuc2VsZWN0TmV4dCgpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgICAgICAgICAgY2FzZSBLRVkuVVA6CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2NvcGUuc2VsZWN0UHJldigpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgICAgICAgICAgY2FzZSBLRVkuRU5URVI6CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2NvcGUuc2VsZWN0Q3VycmVudCgpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgICAgICAgICAgY2FzZSBLRVkuQkFDS1NQQUNFOgorICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNjb3BlLnRpdGxlID0gIiI7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2NvcGUuJGFwcGx5KCk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7ICAgIAorICAgICAgICAgICAgICAgICAgICAgICAgY2FzZSBLRVkuU1BBQ0U6CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2NvcGUudGl0bGUgKz0gIiAiOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNjb3BlLiRhcHBseSgpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOyAgICAgICAgICAgICAgICAgICAgICAgICAgICAKKyAgICAgICAgICAgICAgICAgICAgICAgIGNhc2UgS0VZLkVTQzoKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZihzY29wZS50aXRsZSA9PT0gIiIpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzY29wZS5zaG93bGlzdCA9IGZhbHNlOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzY29wZS4kYXBwbHkoKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2NvcGUudGl0bGUgPSAiIjsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2NvcGUuJGFwcGx5KCk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOyAgICAgICAgCisgICAgICAgICAgICAgICAgICAgIH0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgIGlmKHNjb3BlLnNob3dTZWFyY2ggPT09IGZhbHNlICYmIGUua2V5Q29kZSAhPT0gOSkKKyAgICAgICAgICAgICAgICAgICAgeyAKKyAgICAgICAgICAgICAgICAgICAgICAgIHNjb3BlLnNob3dsaXN0ID0gdHJ1ZTsKKyAgICAgICAgICAgICAgICAgICAgICAgIHNjb3BlLnRpdGxlID0gc2NvcGUudGl0bGUgPyBzY29wZS50aXRsZSArIFN0cmluZy5mcm9tQ2hhckNvZGUoZS5rZXlDb2RlKTpTdHJpbmcuZnJvbUNoYXJDb2RlKGUua2V5Q29kZSk7ICAgICAgICAgICAgICAgICAgICAgICAgICAgIAorICAgICAgICAgICAgICAgICAgICAgICAgc2NvcGUuJGFwcGx5KCk7CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgZWxzZSBpZihlLmtleUNvZGUgPT09IDkpCisgICAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIHNjb3BlLnNob3dsaXN0ID0gZmFsc2U7CisgICAgICAgICAgICAgICAgICAgICAgICBzY29wZS50aXRsZSA9ICIiOworICAgICAgICAgICAgICAgICAgICAgICAgc2NvcGUuJGFwcGx5KCk7CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9KTsKKworICAgICAgICAgICAgc2NvcGUuc2VsZWN0T3B0aW9uID0gZnVuY3Rpb24oc1RpdGxlLHNJbmRleCxrZWVwT3BlbikKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBpZihzSW5kZXggPT09IC0xIHx8IHNJbmRleCA9PT0gIi0xIil7CisgICAgICAgICAgICAgICAgICAgc2NvcGUuc2VsQ2F0ZWdvcnkgPSAiIjsgICAgICAgICAgICAgICAgICAgCisgICAgICAgICAgICAgICAgICAgc2NvcGUuc2VsZWN0ZWRJbmRleCA9IC0xOyAgICAgIAorICAgICAgICAgICAgICAgICAgIGN0cmwuJHNldFZpZXdWYWx1ZSgiIik7CisgICAgICAgICAgICAgICAgICAgc2NvcGUuc2VsZWN0ZWRPcHRpb24gPSBzY29wZS5zZWxlY3RNc2c7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgIHNjb3BlLnNlbENhdGVnb3J5ID0gc2NvcGUuY05hbWVbc0luZGV4XTsKKyAgICAgICAgICAgICAgICAgICAgc2NvcGUuc2VsZWN0ZWRJbmRleCA9IHNJbmRleDsgCisgICAgICAgICAgICAgICAgICAgIGN0cmwuJHNldFZpZXdWYWx1ZShzY29wZS5zZWxDYXRlZ29yeSk7CisgICAgICAgICAgICAgICAgICAgIHNjb3BlLnNlbGVjdGVkT3B0aW9uID0gc2NvcGUuc2VsQ2F0ZWdvcnkudGl0bGU7CisgICAgICAgICAgICAgICAgfSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCisgICAgICAgICAgICAgICAgc2NvcGUudGl0bGUgPSAiIjsKKyAgICAgICAgICAgICAgICBpZigha2VlcE9wZW4pCisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICBzY29wZS5zaG93bGlzdCA9IGZhbHNlOworICAgICAgICAgICAgICAgIH0gICAgICAgICAgICAgICAgCisgICAgICAgICAgICB9OworCisgICAgICAgICAgICBpZihhdHRyLmRpc2FibGVkKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgc2NvcGUuaXNEaXNhYmxlZCA9IHRydWU7CisgICAgICAgICAgICB9CisKKyAgICAgICAgICAgIHNjb3BlLnNlbGVjdEN1cnJlbnQgPSBmdW5jdGlvbigpCisgICAgICAgICAgICB7ICAgCisgICAgICAgICAgICAgICAgaWYoc2NvcGUuc2hvd2xpc3QgPT09IHRydWUpCisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICBzY29wZS5zZWxlY3RPcHRpb24oc2NvcGUuc2VsZWN0TXNnLHNjb3BlLnNlbGVjdGVkSW5kZXggLGZhbHNlKTsKKyAgICAgICAgICAgICAgICAgICAgc2NvcGUuJGFwcGx5KCk7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgIHNjb3BlLnNob3dsaXN0ID0gdHJ1ZTsKKyAgICAgICAgICAgICAgICAgICAgc2NvcGUuc2V0U2VsZWN0VG9wKCk7CisgICAgICAgICAgICAgICAgICAgIHNjb3BlLiRhcHBseSgpOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH07CisgICAgICAgICAgICAKKyAgICAgICAgICAgIHNjb3BlLmhvdmVySW4gPSBmdW5jdGlvbihjSXRlbSkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBzY29wZS5zZWxlY3RlZEluZGV4ID0gY0l0ZW07CisgICAgICAgICAgICB9OyAKKyAgICAgICAgICAgIAorICAgICAgICAgICAgc2NvcGUuc2V0U2VsZWN0VG9wID0gZnVuY3Rpb24oKQorICAgICAgICAgICAgeyAgICAgICAgICAgIAorICAgICAgICAgICAgICAgICR0aW1lb3V0KGZ1bmN0aW9uICgpIAorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgaWYoc2NvcGUuc2hvd2xpc3QgPT09dHJ1ZSkKKyAgICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAgICAgdmFyIGNvbnRhaW5lclVMID0gYW5ndWxhci5lbGVtZW50KGVsZW1lbnQpWzBdLnF1ZXJ5U2VsZWN0b3IoIi5zZWxlY3QyLXJlc3VsdHMiKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIHZhciBzZWxlY3RlZEVsZW1Ub3BQb3MgPSBhbmd1bGFyLmVsZW1lbnQoY29udGFpbmVyVUwucXVlcnlTZWxlY3RvcignLnNlbGVjdDItcmVzdWx0LWN1cnJlbnQnKSlbMF0ub2Zmc2V0VG9wOworICAgICAgICAgICAgICAgICAgICAgICAgYW5ndWxhci5lbGVtZW50KGNvbnRhaW5lclVMKVswXS5zY3JvbGxUb3AgPSBzZWxlY3RlZEVsZW1Ub3BQb3M7ICAgICAgICAgICAgICAgICAgICAgICAgICAKKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIH0pOyAgICAgICAgICAgICAgICAgICAgICAgIAorICAgICAgICAgICAgfTsKKyAgICAgICAgICAgIAorICAgICAgICAgICAgCisgICAgICAgICAgICBzY29wZS5zZXRDdXJyZW50VG9wID0gZnVuY3Rpb24oKQorICAgICAgICAgICAgeyAgICAgICAgICAgIAorICAgICAgICAgICAgICAgICR0aW1lb3V0KGZ1bmN0aW9uICgpIAorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgaWYoc2NvcGUuc2hvd2xpc3QgPT09dHJ1ZSkKKyAgICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAgICAgdmFyIGNvbnRhaW5lclVMID0gYW5ndWxhci5lbGVtZW50KGVsZW1lbnQpWzBdLnF1ZXJ5U2VsZWN0b3IoIi5zZWxlY3QyLXJlc3VsdHMiKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIHZhciBzZWxlY3RlZEVsZW1Ub3BQb3MgPSBhbmd1bGFyLmVsZW1lbnQoY29udGFpbmVyVUwucXVlcnlTZWxlY3RvcignLmhvdnN0eWxlJykpWzBdLm9mZnNldFRvcDsKKyAgICAgICAgICAgICAgICAgICAgICAgIC8vYW5ndWxhci5lbGVtZW50KGNvbnRhaW5lclVMKVswXS5zY3JvbGxUb3AgPSBzZWxlY3RlZEVsZW1Ub3BQb3M7CisgICAgICAgICAgICAgICAgICAgICAgICBpZihzZWxlY3RlZEVsZW1Ub3BQb3MgPCAoYW5ndWxhci5lbGVtZW50KGNvbnRhaW5lclVMKVswXS5zY3JvbGxUb3ApICkKKyAgICAgICAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBhbmd1bGFyLmVsZW1lbnQoY29udGFpbmVyVUwpWzBdLnNjcm9sbFRvcCAtPSAzMDsKKyAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgIGVsc2UgaWYoKHNlbGVjdGVkRWxlbVRvcFBvcyArIDMwKSA+IChhbmd1bGFyLmVsZW1lbnQoY29udGFpbmVyVUwpWzBdLmNsaWVudEhlaWdodCkpCisgICAgICAgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgYW5ndWxhci5lbGVtZW50KGNvbnRhaW5lclVMKVswXS5zY3JvbGxUb3AgKz0gMzA7ICAgICAgICAgICAgICAgICAgICAgICAgICAKKyAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgIAorICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgfSk7ICAgICAgICAgICAgICAgICAgICAgICAgCisgICAgICAgICAgICB9OyAKKyAgICAgICAgICAgIAorICAgICAgICAgICAgc2NvcGUuc2VsZWN0TmV4dCA9IGZ1bmN0aW9uKCkKKyAgICAgICAgICAgIHsgICAgICAgICAgICAgICAgIAorICAgICAgICAgICAgICAgIGlmKChzY29wZS5zZWxlY3RlZEluZGV4ICsgMSkgPD0gKHNjb3BlLmNOYW1lLmxlbmd0aC0xKSkKKyAgICAgICAgICAgICAgICB7ICAgIAorICAgICAgICAgICAgICAgICAgICBzY29wZS5zZWxlY3RlZEluZGV4ICs9IDE7CisgICAgICAgICAgICAgICAgICAgIGlmKHNjb3BlLnNob3dsaXN0ID09PSBmYWxzZSkKKyAgICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAgICAgc2NvcGUuc2VsZWN0T3B0aW9uKHNjb3BlLnNlbGVjdE1zZyxzY29wZS5zZWxlY3RlZEluZGV4ICxmYWxzZSk7ICAgICAgICAgICAgICAgICAgICAKKyAgICAgICAgICAgICAgICAgICAgfSAgICAgICAgICAgICAgICAgICAgCisgICAgICAgICAgICAgICAgICAgIHNjb3BlLiRhcHBseSgpOworICAgICAgICAgICAgICAgIH0gICAgIAorICAgICAgICAgICAgICAgIHNjb3BlLnNldEN1cnJlbnRUb3AoKTsKKyAgICAgICAgICAgIH07CisKKyAgICAgICAgICAgIHNjb3BlLnNlbGVjdFByZXYgPSBmdW5jdGlvbigpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgaWYoKHNjb3BlLnNlbGVjdGVkSW5kZXggLSAxKSA+PSAwKQorICAgICAgICAgICAgICAgIHsgICAgICAKKyAgICAgICAgICAgICAgICAgICAgc2NvcGUuc2VsZWN0ZWRJbmRleCAtPSAxOyAgICAgICAgICAgICAgICAgICAgCisgICAgICAgICAgICAgICAgICAgIGlmKHNjb3BlLnNob3dsaXN0ID09PSBmYWxzZSkKKyAgICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAgICAgc2NvcGUuc2VsZWN0T3B0aW9uKHNjb3BlLnNlbGVjdE1zZyxzY29wZS5zZWxlY3RlZEluZGV4ICxmYWxzZSk7ICAgICAgICAgICAgICAgICAgICAKKyAgICAgICAgICAgICAgICAgICAgfSAgICAgICAgICAgICAgICAgICAgIAorICAgICAgICAgICAgICAgICAgICBzY29wZS4kYXBwbHkoKTsKKyAgICAgICAgICAgICAgICB9ICAgICAgICAgICAgICAgIAorICAgICAgICAgICAgICAgIGVsc2UgaWYoc2NvcGUuc2VsZWN0ZWRJbmRleCAtMSA8IDApCisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICBzY29wZS5zZWxlY3RlZEluZGV4ID0gLTE7CisgICAgICAgICAgICAgICAgICAgIGlmKHNjb3BlLnNob3dsaXN0ID09PSBmYWxzZSkKKyAgICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAgICAgc2NvcGUuc2VsZWN0T3B0aW9uKHNjb3BlLnNlbGVjdE1zZyxzY29wZS5zZWxlY3RlZEluZGV4ICxmYWxzZSk7ICAgICAgICAgICAgICAgICAgICAKKyAgICAgICAgICAgICAgICAgICAgfSAKKyAgICAgICAgICAgICAgICAgICAgc2NvcGUuJGFwcGx5KCk7CisgICAgICAgICAgICAgICAgfSAgICAgICAgCisgICAgICAgICAgICAgICAgc2NvcGUuc2V0Q3VycmVudFRvcCgpOworCisgICAgICAgICAgICB9OworICAgICAgICAgICAgCisgICAgICAgICAgICBzY29wZS51cGRhdGVTZWxlY3Rpb24gPSBmdW5jdGlvbihzSXRlbSkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBzY29wZS5zZWxlY3RlZE9wdGlvbiA9IHNJdGVtLnRpdGxlOworICAgICAgICAgICAgICAgIC8vc2NvcGUuc2VsZWN0ZWRJbmRleCA9IC0xOworICAgICAgICAgICAgICAgIHNjb3BlLnRpdGxlID0gIiI7CisgICAgICAgICAgICB9OworCisgICAgICAgICAgICBzY29wZS4kd2F0Y2goJ3NlbENhdGVnb3J5JyxmdW5jdGlvbih2YWx1ZSkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBpZih2YWx1ZSl7CisgICAgICAgICAgICAgICAgICAgIHNjb3BlLnVwZGF0ZVNlbGVjdGlvbih2YWx1ZSk7CisgICAgICAgICAgICAgICAgfTsKKyAgICAgICAgICAgIH0pOworCisgICAgICAgICAgICBjdHJsLiR2aWV3Q2hhbmdlTGlzdGVuZXJzLnB1c2goZnVuY3Rpb24oKXsKKyAgICAgICAgICAgICAgICBzY29wZS4kZXZhbChhdHRyLm5nQ2hhbmdlKTsKKyAgICAgICAgICAgIH0pOworCisgICAgICAgICAgICBjdHJsLiRyZW5kZXIgPSBmdW5jdGlvbigpeworICAgICAgICAgICAgICAgIHNjb3BlLnNlbENhdGVnb3J5ID0gY3RybC4kdmlld1ZhbHVlOworICAgICAgICAgICAgfTsKKworICAgICAgICAgICAgdmFyIG91dHNpZGVDbGljayA9IGZ1bmN0aW9uKGUpeworICAgICAgICAgICAgICAgIHZhciBpc0VsZW1lbnQgPSAkaXNFbGVtZW50KGFuZ3VsYXIuZWxlbWVudChlLnRhcmdldCksIGVsZW1lbnQsICRkb2N1bWVudCk7CisgICAgICAgICAgICAgICAgaWYoIWlzRWxlbWVudCkgeworICAgICAgICAgICAgICAgICAgICBzY29wZS5zaG93bGlzdCA9IGZhbHNlOworICAgICAgICAgICAgICAgICAgICBzY29wZS4kYXBwbHkoKTsgCisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfTsKKworICAgICAgICAgICAgJGRvY3VtZW50QmluZC5jbGljaygnc2hvd2xpc3QnLCBvdXRzaWRlQ2xpY2ssIHNjb3BlKTsKKyAgICAgICAgfQorICAgIH07Cit9XSk7Cit9KCkpOworCisoZnVuY3Rpb24oKXsKK3ZhciBLRVkgPSB7CisgICAgVEFCOiA5LAorICAgIEVOVEVSOiAxMywKKyAgICBFU0M6IDI3LAorICAgIFNQQUNFOiAzMiwKKyAgICBMRUZUOiAzNywKKyAgICBVUDogMzgsCisgICAgUklHSFQ6IDM5LAorICAgIERPV046IDQwLAorICAgIFNISUZUOiAxNiwKKyAgICBDVFJMOiAxNywKKyAgICBBTFQ6IDE4LAorICAgIFBBR0VfVVA6IDMzLAorICAgIFBBR0VfRE9XTjogMzQsCisgICAgSE9NRTogMzYsCisgICAgRU5EOiAzNSwKKyAgICBCQUNLU1BBQ0U6IDgsCisgICAgREVMRVRFOiA0NiwKKyAgICBDT01NQU5EOiA5MSwKKworICAgIE1BUDogeyA5MSA6ICJDT01NQU5EIiwgOCA6ICJCQUNLU1BBQ0UiICwgOSA6ICJUQUIiICwgMTMgOiAiRU5URVIiICwgMTYgOiAiU0hJRlQiICwgMTcgOiAiQ1RSTCIgLCAxOCA6ICJBTFQiICwgMTkgOiAiUEFVU0VCUkVBSyIgLCAyMCA6ICJDQVBTTE9DSyIgLCAyNyA6ICJFU0MiICwgMzIgOiAiU1BBQ0UiICwgMzMgOiAiUEFHRV9VUCIsIDM0IDogIlBBR0VfR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Y2IiAsIDExOCA6ICJGNyIgLCAxMTkgOiAiRjgiICwgMTIwIDogIkY5IiAsIDEyMSA6ICJGMTAiICwgMTIyIDogIkYxMSIgLCAxMjMgOiAiRjEyIiwgMTQ0IDogIk5VTUxPQ0siICwgMTQ1IDogIlNDUk9MTExPQ0siICwgMTg2IDogIjsiICwgMTg3IDogIj0iICwgMTg4IDogIiwiICwgMTg5IDogIi0iICwgMTkwIDogIi4iICwgMTkxIDogIi8iICwgMTkyIDogImAiICwgMjE5IDogIlsiICwgMjIwIDogIlxcIiAsIDIyMSA6ICJdIiAsIDIyMiA6ICInIgorICAgIH0sCisKKyAgICBpc0NvbnRyb2w6IGZ1bmN0aW9uIChlKSB7CisgICAgICAgIHZhciBrID0gZS5rZXlDb2RlOworICAgICAgICBzd2l0Y2ggKGspIHsKKyAgICAgICAgY2FzZSBLRVkuQ09NTUFORDoKKyAgICAgICAgY2FzZSBLRVkuU0hJRlQ6CisgICAgICAgIGNhc2UgS0VZLkNUUkw6CisgICAgICAgIGNhc2UgS0VZLkFMVDoKKyAgICAgICAgICAgIHJldHVybiB0cnVlOworICAgICAgICB9CisKKyAgICAgICAgaWYgKGUubWV0YUtleSkgcmV0dXJuIHRydWU7CisKKyAgICAgICAgcmV0dXJuIGZhbHNlOworICAgIH0sCisgICAgaXNGdW5jdGlvbktleTogZnVuY3Rpb24gKGspIHsKKyAgICAgICAgayA9IGsua2V5Q29kZSA/IGsua2V5Q29kZSA6IGs7CisgICAgICAgIHJldHVybiBrID49IDExMiAmJiBrIDw9IDEyMzsKKyAgICB9LAorICAgIGlzVmVydGljYWxNb3ZlbWVudDogZnVuY3Rpb24gKGspeworICAgICAgcmV0dXJuIH5bS0VZLlVQLCBLRVkuRE9XTl0uaW5kZXhPZihrKTsKKyAgICB9LAorICAgIGlzSG9yaXpvbnRhbE1vdmVtZW50OiBmdW5jdGlvbiAoayl7CisgICAgICByZXR1cm4gfltLRVkuTEVGVCxLRVkuUklHSFQsS0VZLkJBQ0tTUEFDRSxLRVkuREVMRVRFXS5pbmRleE9mKGspOworICAgIH0KKyB9OworCithbmd1bGFyLm1vZHVsZSgnYXR0LmFicy5zZWxlY3QnLCBbJ2F0dC5hYnMudXRpbGl0aWVzJywgJ2F0dC5hYnMucG9zaXRpb24nLCAnYXR0LmFicy51dGlsaXRpZXMnXSkKKworLmZpbHRlcignc3RhcnRzV2l0aCcsIGZ1bmN0aW9uKCkgeworICAgIGlmICh0eXBlb2YgU3RyaW5nLnByb3RvdHlwZS5zdGFydHNXaXRoICE9ICdmdW5jdGlvbicpIHsKKyAgICAgICAgLy8gc2VlIGJlbG93IGZvciBiZXR0ZXIgaW1wbGVtZW50YXRpb24hCisgICAgICAgIFN0cmluZy5wcm90b3R5cGUuc3RhcnRzV2l0aCA9IGZ1bmN0aW9uIChzdHIpeworICAgICAgICAgICAgcmV0dXJuIHRoaXMuaW5kZXhPZihzdHIpID09PSAwOworICAgICAgICB9OworICAgIH0KKworICAgIHJldHVybiBmdW5jdGlvbihpdGVtcywgc2VhcmNoU3RyaW5nKSB7CisgICAgICAgIGlmIChzZWFyY2hTdHJpbmcgPT09IHVuZGVmaW5lZCB8fCBzZWFyY2hTdHJpbmcgPT09ICIiKSByZXR1cm4gaXRlbXM7CisKKyAgICAgICAgdmFyIGZpbHRlcmVkID0gW107CisgICAgICAgIGFuZ3VsYXIuZm9yRWFjaChpdGVtcywgZnVuY3Rpb24oaXRlbSkgeworICAgICAgICAgICAgaWYgKGl0ZW0udGl0bGUudG9Mb3dlckNhc2UoKS5zdGFydHNXaXRoKHNlYXJjaFN0cmluZy50b0xvd2VyQ2FzZSgpKSkgeworICAgICAgICAgICAgICAgIGZpbHRlcmVkLnB1c2goaXRlbSk7CisgICAgICAgICAgICB9CisgICAgICAgIH0pOworICAgICAgICByZXR1cm4gZmlsdGVyZWQ7CisgICAgfTsKK30pCisKKy5kaXJlY3RpdmUoJ2F0dFNlbGVjdCcsIFsiJGRvY3VtZW50IiwgIiRmaWx0ZXIiLCAiJGlzRWxlbWVudCIsICckZG9jdW1lbnRCaW5kJywgIiR0aW1lb3V0IiwgZnVuY3Rpb24oJGRvY3VtZW50LCRmaWx0ZXIsJGlzRWxlbWVudCwkZG9jdW1lbnRCaW5kLCR0aW1lb3V0KXsKKyAgICByZXR1cm57CisgICAgICAgIHJlc3RyaWN0OiAnQScsCisgICAgICAgIHNjb3BlOntjTmFtZTogJz1hdHRTZWxlY3QnfSwKKyAgICAgICAgdHJhbnNjbHVkZTogZmFsc2UsCisgICAgICAgIHJlcGxhY2U6IGZhbHNlLAorICAgICAgICByZXF1aXJlOiduZ01vZGVsJywKKyAgICAgICAgdGVtcGxhdGVVcmw6ICdhcHAvc2NyaXB0cy9uZ19qc19hdHRfdHBscy9zZWxlY3Qvc2VsZWN0Lmh0bWwnLAorICAgICAgICBsaW5rOiBmdW5jdGlvbihzY29wZSwgZWxlbWVudCwgYXR0ciwgY3RybCkgeworCisgICAgICAgICAgICBzY29wZS5zZWxlY3RlZEluZGV4ID0gLTE7CisgICAgICAgICAgICBzY29wZS5zZWxlY3RlZE9wdGlvbiA9IGF0dHIucGxhY2Vob2xkZXI7CisgICAgICAgICAgICBzY29wZS5pc0Rpc2FibGVkID0gZmFsc2U7CisgICAgICAgICAgICBzY29wZS5jbGFzc05hbWUgPSAic2VsZWN0Mi1tYXRjaCI7CisgICAgICAgICAgICBzY29wZS5zaG93U2VhcmNoID0gZmFsc2U7CisgICAgICAgICAgICBzY29wZS5zaG93bGlzdCA9IGZhbHNlOworCisgICAgICAgICAgICBpZihhdHRyLnBsYWNlaG9sZGVyQXNPcHRpb24gPT09ICJmYWxzZSIpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgc2NvcGUuc2VsZWN0TXNnID0gIiI7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgc2NvcGUuc2VsZWN0TXNnID0gYXR0ci5wbGFjZWhvbGRlcjsKKyAgICAgICAgICAgIH0KKworICAgICAgICAgICAgaWYgKGF0dHIuc3RhcnRzV2l0aEZpbHRlciA9PT0gInRydWUiIHx8IGF0dHIuc3RhcnRzV2l0aEZpbHRlciA9PT0gdHJ1ZSkgeworICAgICAgICAgICAgICAgIHNjb3BlLnN0YXJ0c1dpdGhGaWx0ZXIgPSB0cnVlOworICAgICAgICAgICAgfQorCisgICAgICAgICAgICBpZihhdHRyLnNob3dJbnB1dEZpbHRlciA9PT0gInRydWUiKXtzY29wZS5zaG93U2VhcmNoID0gdHJ1ZTt9CisKKyAgICAgICAgICAgIHNjb3BlLnNob3dEcm9wZG93biA9IGZ1bmN0aW9uKCl7CisgICAgICAgICAgICAgICAgaWYoIShhdHRyLmRpc2FibGVkKSl7CisgICAgICAgICAgICAgICAgICAgIHNjb3BlLnNob3dsaXN0ID0gIXNjb3BlLnNob3dsaXN0OworICAgICAgICAgICAgICAgICAgICBzY29wZS5zZXRTZWxlY3RUb3AoKTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9OworCisgICAgICAgICAgICAgZWxlbWVudC5iaW5kKCJrZXlkb3duIiwgZnVuY3Rpb24oZSl7CisgICAgICAgICAgICAgICAgaWYgKGUua2V5Q29kZSA9PT0gS0VZLkJBQ0tTUEFDRSB8fCBlLmtleUNvZGUgPT09IEtFWS5TUEFDRSB8fCBlLmtleUNvZGUgPT09IEtFWS5FU0MgfHwgZS5rZXlDb2RlID09PSBLRVkuRU5URVIgfHwgS0VZLmlzQ29udHJvbChlKSB8fCBLRVkuaXNWZXJ0aWNhbE1vdmVtZW50KGUua2V5Q29kZSkgfHwgS0VZLmlzSG9yaXpvbnRhbE1vdmVtZW50KGUua2V5Q29kZSkgfHwgS0VZLmlzRnVuY3Rpb25LZXkoZS5rZXlDb2RlKSkKKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgIGUucHJldmVudERlZmF1bHQoKTsKKyAgICAgICAgICAgICAgICAgICAgZS5zdG9wUHJvcGFnYXRpb24oKTsKKworICAgICAgICAgICAgICAgICAgICBzd2l0Y2ggKGUua2V5Q29kZSkgeworICAgICAgICAgICAgICAgICAgICAgICAgY2FzZSBLRVkuRE9XTjoKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBzY29wZS5zZWxlY3ROZXh0KCk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgICAgICAgICBjYXNlIEtFWS5VUDoKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBzY29wZS5zZWxlY3RQcmV2KCk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgICAgICAgICBjYXNlIEtFWS5FTlRFUjoKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBzY29wZS5zZWxlY3RDdXJyZW50KCk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgICAgICAgICBjYXNlIEtFWS5CQUNLU1BBQ0U6CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2NvcGUudGl0bGUgPSAiIjsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBzY29wZS4kYXBwbHkoKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICAgICAgICAgIGNhc2UgS0VZLlNQQUNFOgorICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNjb3BlLnRpdGxlICs9ICIgIjsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBzY29wZS4kYXBwbHkoKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICAgICAgICAgIGNhc2UgS0VZLkVTQzoKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZihzY29wZS50aXRsZSA9PT0gIiIpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzY29wZS5zaG93bGlzdCA9IGZhbHNlOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzY29wZS4kYXBwbHkoKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2NvcGUudGl0bGUgPSAiIjsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2NvcGUuJGFwcGx5KCk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgIGlmKHNjb3BlLnNob3dTZWFyY2ggPT09IGZhbHNlICYmIGUua2V5Q29kZSAhPT0gOSkKKyAgICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAgICAgc2NvcGUuc2hvd2xpc3QgPSB0cnVlOworICAgICAgICAgICAgICAgICAgICAgICAgc2NvcGUudGl0bGUgPSBzY29wZS50aXRsZSA/IHNjb3BlLnRpdGxlICsgU3RyaW5nLmZyb21DaGFyQ29kZShlLmtleUNvZGUpOlN0cmluZy5mcm9tQ2hhckNvZGUoZS5rZXlDb2RlKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIHNjb3BlLiRhcHBseSgpOworICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgIGVsc2UgaWYoZS5rZXlDb2RlID09PSA5KQorICAgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgICAgICBzY29wZS5zaG93bGlzdCA9IGZhbHNlOworICAgICAgICAgICAgICAgICAgICAgICAgc2NvcGUudGl0bGUgPSAiIjsKKyAgICAgICAgICAgICAgICAgICAgICAgIHNjb3BlLiRhcHBseSgpOworICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfSk7CisKKyAgICAgICAgICAgIHNjb3BlLnNlbGVjdE9wdGlvbiA9IGZ1bmN0aW9uKHNUaXRsZSxzSW5kZXgsa2VlcE9wZW4pCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgaWYoc0luZGV4ID09PSAtMSB8fCBzSW5kZXggPT09ICctMScpeworICAgICAgICAgICAgICAgICAgIHNjb3BlLnNlbENhdGVnb3J5ID0gIiI7CisgICAgICAgICAgICAgICAgICAgc2NvcGUuc2VsZWN0ZWRJbmRleCA9IC0xOworICAgICAgICAgICAgICAgICAgIGN0cmwuJHNldFZpZXdWYWx1ZSgiIik7CisgICAgICAgICAgICAgICAgICAgc2NvcGUuc2VsZWN0ZWRPcHRpb24gPSBzY29wZS5zZWxlY3RNc2c7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgIHNjb3BlLnNlbENhdGVnb3J5ID0gc2NvcGUuY05hbWVbc0luZGV4XTsKKyAgICAgICAgICAgICAgICAgICAgc2NvcGUuc2VsZWN0ZWRJbmRleCA9IHNJbmRleDsKKyAgICAgICAgICAgICAgICAgICAgY3RybC4kc2V0Vmlld1ZhbHVlKHNjb3BlLnNlbENhdGVnb3J5KTsKKyAgICAgICAgICAgICAgICAgICAgc2NvcGUuc2VsZWN0ZWRPcHRpb24gPSBzY29wZS5zZWxDYXRlZ29yeS50aXRsZTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgc2NvcGUudGl0bGUgPSAiIjsKKyAgICAgICAgICAgICAgICBpZigha2VlcE9wZW4pCisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICBzY29wZS5zaG93bGlzdCA9IGZhbHNlOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH07CisKKyAgICAgICAgICAgIGlmKGF0dHIuZGlzYWJsZWQpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICBzY29wZS5pc0Rpc2FibGVkID0gdHJ1ZTsKKyAgICAgICAgICAgIH0KKworICAgICAgICAgICAgc2NvcGUuc2VsZWN0Q3VycmVudCA9IGZ1bmN0aW9uKCkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBpZihzY29wZS5zaG93bGlzdCA9PT0gdHJ1ZSkKKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgIHNjb3BlLnNlbGVjdE9wdGlvbihzY29wZS5zZWxlY3RNc2csc2NvcGUuc2VsZWN0ZWRJbmRleCAsZmFsc2UpOworICAgICAgICAgICAgICAgICAgICBzY29wZS4kYXBwbHkoKTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgc2NvcGUuc2hvd2xpc3QgPSB0cnVlOworICAgICAgICAgICAgICAgICAgICBzY29wZS5zZXRTZWxlY3RUb3AoKTsKKyAgICAgICAgICAgICAgICAgICAgc2NvcGUuJGFwcGx5KCk7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfTsKKworICAgICAgICAgICAgc2NvcGUuaG92ZXJJbiA9IGZ1bmN0aW9uKGNJdGVtKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIHNjb3BlLnNlbGVjdGVkSW5kZXggPSBjSXRlbTsKKyAgICAgICAgICAgIH07CisKKyAgICAgICAgICAgIHNjb3BlLnNldFNlbGVjdFRvcCA9IGZ1bmN0aW9uKCkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAkdGltZW91dChmdW5jdGlvbiAoKQorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgaWYoc2NvcGUuc2hvd2xpc3QgPT09dHJ1ZSkKKyAgICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAgICAgdmFyIGNvbnRhaW5lclVMID0gYW5ndWxhci5lbGVtZW50KGVsZW1lbnQpWzBdLnF1ZXJ5U2VsZWN0b3IoIi5zZWxlY3QyLXJlc3VsdHMiKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIHZhciBzZWxlY3RlZEVsZW1Ub3BQb3MgPSBhbmd1bGFyLmVsZW1lbnQoY29udGFpbmVyVUwucXVlcnlTZWxlY3RvcignLnNlbGVjdDItcmVzdWx0LWN1cnJlbnQnKSlbMF0ub2Zmc2V0VG9wOworICAgICAgICAgICAgICAgICAgICAgICAgYW5ndWxhci5lbGVtZW50KGNvbnRhaW5lclVMKVswXS5zY3JvbGxUb3AgPSBzZWxlY3RlZEVsZW1Ub3BQb3M7CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICB9KTsKKyAgICAgICAgICAgIH07CisKKworICAgICAgICAgICAgc2NvcGUuc2V0Q3VycmVudFRvcCA9IGZ1bmN0aW9uKCkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAkdGltZW91dChmdW5jdGlvbiAoKQorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgaWYoc2NvcGUuc2hvd2xpc3QgPT09dHJ1ZSkKKyAgICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAgICAgdmFyIGNvbnRhaW5lclVMID0gYW5ndWxhci5lbGVtZW50KGVsZW1lbnQpWzBdLnF1ZXJ5U2VsZWN0b3IoIi5zZWxlY3QyLXJlc3VsdHMiKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIHZhciBzZWxlY3RlZEVsZW1Ub3BQb3MgPSBhbmd1bGFyLmVsZW1lbnQoY29udGFpbmVyVUwucXVlcnlTZWxlY3RvcignLmhvdnN0eWxlJykpWzBdLm9mZnNldFRvcDsKKyAgICAgICAgICAgICAgICAgICAgICAgIC8vYW5ndWxhci5lbGVtZW50KGNvbnRhaW5lclVMKVswXS5zY3JvbGxUb3AgPSBzZWxlY3RlZEVsZW1Ub3BQb3M7CisgICAgICAgICAgICAgICAgICAgICAgICBpZihzZWxlY3RlZEVsZW1Ub3BQb3MgPCAoYW5ndWxhci5lbGVtZW50KGNvbnRhaW5lclVMKVswXS5zY3JvbGxUb3ApICkKKyAgICAgICAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBhbmd1bGFyLmVsZW1lbnQoY29udGFpbmVyVUwpWzBdLnNjcm9sbFRvcCAtPSAzMDsKKyAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgIGVsc2UgaWYoKHNlbGVjdGVkRWxlbVRvcFBvcyArIDMwKSA+IChhbmd1bGFyLmVsZW1lbnQoY29udGFpbmVyVUwpWzBdLmNsaWVudEhlaWdodCkpCisgICAgICAgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgYW5ndWxhci5lbGVtZW50KGNvbnRhaW5lclVMKVswXS5zY3JvbGxUb3AgKz0gMzA7CisgICAgICAgICAgICAgICAgICAgICAgICB9CisKKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIH0pOworICAgICAgICAgICAgfTsKKworICAgICAgICAgICAgc2NvcGUuc2VsZWN0TmV4dCA9IGZ1bmN0aW9uKCkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBpZigoc2NvcGUuc2VsZWN0ZWRJbmRleCArIDEpIDw9IChzY29wZS5jTmFtZS5sZW5ndGgtMSkpCisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICBzY29wZS5zZWxlY3RlZEluZGV4ICs9IDE7CisgICAgICAgICAgICAgICAgICAgIGlmKHNjb3BlLnNob3dsaXN0ID09PSBmYWxzZSkKKyAgICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAgICAgc2NvcGUuc2VsZWN0T3B0aW9uKHNjb3BlLnNlbGVjdE1zZyxzY29wZS5zZWxlY3RlZEluZGV4ICxmYWxzZSk7CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgc2NvcGUuJGFwcGx5KCk7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIHNjb3BlLnNldEN1cnJlbnRUb3AoKTsKKyAgICAgICAgICAgIH07CisKKyAgICAgICAgICAgIHNjb3BlLnNlbGVjdFByZXYgPSBmdW5jdGlvbigpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgaWYoKHNjb3BlLnNlbGVjdGVkSW5kZXggLSAxKSA+PSAwKQorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgc2NvcGUuc2VsZWN0ZWRJbmRleCAtPSAxOworICAgICAgICAgICAgICAgICAgICBpZihzY29wZS5zaG93bGlzdCA9PT0gZmFsc2UpCisgICAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIHNjb3BlLnNlbGVjdE9wdGlvbihzY29wZS5zZWxlY3RNc2csc2NvcGUuc2VsZWN0ZWRJbmRleCAsZmFsc2UpOworICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgIHNjb3BlLiRhcHBseSgpOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICBlbHNlIGlmKHNjb3BlLnNlbGVjdGVkSW5kZXggLTEgPCAwKQorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgc2NvcGUuc2VsZWN0ZWRJbmRleCA9IC0xOworICAgICAgICAgICAgICAgICAgICBpZihzY29wZS5zaG93bGlzdCA9PT0gZmFsc2UpCisgICAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIHNjb3BlLnNlbGVjdE9wdGlvbihzY29wZS5zZWxlY3RNc2csc2NvcGUuc2VsZWN0ZWRJbmRleCAsZmFsc2UpOworICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgIHNjb3BlLiRhcHBseSgpOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICBzY29wZS5zZXRDdXJyZW50VG9wKCk7CisKKyAgICAgICAgICAgIH07CisKKyAgICAgICAgICAgIHNjb3BlLnVwZGF0ZVNlbGVjdGlvbiA9IGZ1bmN0aW9uKHNJdGVtKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIHNjb3BlLnNlbGVjdGVkT3B0aW9uID0gc0l0ZW0udGl0bGU7CisgICAgICAgICAgICAgICAgLy9zY29wZS5zZWxlY3RlZEluZGV4ID0gLTE7CisgICAgICAgICAgICAgICAgc2NvcGUudGl0bGUgPSAiIjsKKyAgICAgICAgICAgIH07CisKKyAgICAgICAgICAgIHNjb3BlLiR3YXRjaCgnc2VsQ2F0ZWdvcnknLGZ1bmN0aW9uKHZhbHVlKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIGlmKHZhbHVlKXsKKyAgICAgICAgICAgICAgICAgICAgc2NvcGUudXBkYXRlU2VsZWN0aW9uKHZhbHVlKTsKKyAgICAgICAgICAgICAgICB9OworICAgICAgICAgICAgfSk7CisKKyAgICAgICAgICAgIGN0cmwuJHZpZXdDaGFuZ2VMaXN0ZW5lcnMucHVzaChmdW5jdGlvbigpeworICAgICAgICAgICAgICAgIHNjb3BlLiRldmFsKGF0dHIubmdDaGFuZ2UpOworICAgICAgICAgICAgfSk7CisKKyAgICAgICAgICAgIGN0cmwuJHJlbmRlciA9IGZ1bmN0aW9uKCl7CisgICAgICAgICAgICAgICAgc2NvcGUuc2VsQ2F0ZWdvcnkgPSBjdHJsLiR2aWV3VmFsdWU7CisgICAgICAgICAgICB9OworCisgICAgICAgICAgICB2YXIgb3V0c2lkZUNsaWNrID0gZnVuY3Rpb24oZSl7CisgICAgICAgICAgICAgICAgdmFyIGlzRWxlbWVudCA9ICRpc0VsZW1lbnQoYW5ndWxhci5lbGVtZW50KGUudGFyZ2V0KSwgZWxlbWVudCwgJGRvY3VtZW50KTsKKyAgICAgICAgICAgICAgICBpZighaXNFbGVtZW50KSB7CisgICAgICAgICAgICAgICAgICAgIHNjb3BlLnNob3dsaXN0ID0gZmFsc2U7CisgICAgICAgICAgICAgICAgICAgIHNjb3BlLiRhcHBseSgpOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH07CisKKyAgICAgICAgICAgICRkb2N1bWVudEJpbmQuY2xpY2soJ3Nob3dsaXN0Jywgb3V0c2lkZUNsaWNrLCBzY29wZSk7CisgICAgICAgIH0KKyAgICB9OworfV0pCisKKy5kaXJlY3RpdmUoJ3RleHREcm9wZG93bicsIFsnJGRvY3VtZW50JywgJyRpc0VsZW1lbnQnLCAnJGRvY3VtZW50QmluZCcsIGZ1bmN0aW9uKCRkb2N1bWVudCwkaXNFbGVtZW50LCRkb2N1bWVudEJpbmQpIHsKKyAgICByZXR1cm4geworICAgICAgICByZXN0cmljdDogJ0VBJywKKyAgICAgICAgcmVwbGFjZTogdHJ1ZSwKKyAgICAgICAgc2NvcGU6IHsKKyAgICAgICAgICAgIGFjdGlvbnM6ICc9YWN0aW9ucycsCisgICAgICAgICAgICBkZWZhdWx0QWN0aW9uOiAnPWRlZmF1bHRBY3Rpb24nLAorICAgICAgICAgICAgb25BY3Rpb25DbGlja2VkOiAnPT8nCisgICAgICAgIH0sCisgICAgICAgIHRlbXBsYXRlVXJsIDogJ2FwcC9zY3JpcHRzL25nX2pzX2F0dF90cGxzL3NlbGVjdC90ZXh0RHJvcGRvd24uaHRtbCcsCisKKyAgICAgICAgbGluazogZnVuY3Rpb24oc2NvcGUsIGVsZW1lbnQsIGF0dHIsIGN0cmwpIHsKKyAgICAgICAgICAgIHNjb3BlLnNlbGVjdGVkSW5kZXggPSAwOworICAgICAgICAgICAgc2NvcGUuc2VsZWN0ZWRPcHRpb24gPSBhdHRyLnBsYWNlaG9sZGVyOworICAgICAgICAgICAgc2NvcGUuaXNEaXNhYmxlZCA9IGZhbHNlOworICAgICAgICAgICAgc2NvcGUuaXNBY3Rpb25zU2hvd24gPSBmYWxzZTsKKworICAgICAgICAgICAgaWYoc2NvcGUuZGVmYXVsdEFjdGlvbiA9PSB1bmRlZmluZWQpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgc2NvcGUuY3VycmVudEFjdGlvbiA9IHNjb3BlLmFjdGlvbnNbMF07CisgICAgICAgICAgICAgICAgc2NvcGUuc2VsZWN0ZWRJbmRleCA9IDA7CisgICAgICAgICAgICB9IGVsc2UgaWYgKHNjb3BlLmRlZmF1bHRBY3Rpb24gIT0gdW5kZWZpbmVkIHx8IHNjb3BlLmRlZmF1bHRBY3Rpb24gIT0gJycpIHsKKyAgICAgICAgICAgICAgICBmb3IgKHZhciBhY3QgaW4gc2NvcGUuYWN0aW9ucykKKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgIGlmIChzY29wZS5hY3Rpb25zW2FjdF0gPT09IHNjb3BlLmRlZmF1bHRBY3Rpb24pCisgICAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIHNjb3BlLmN1cnJlbnRBY3Rpb24gPSBzY29wZS5hY3Rpb25zW2FjdF07CisgICAgICAgICAgICAgICAgICAgICAgICBzY29wZS5zZWxlY3RlZEluZGV4ID0gc2NvcGUuYWN0aW9ucy5pbmRleE9mKGFjdCk7CisgICAgICAgICAgICAgICAgICAgICAgICBzY29wZS5pc0FjdGlvbnNTaG93biA9IGZhbHNlOworCisgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgfQorCisgICAgICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgICAgIHNjb3BlLmN1cnJlbnRBY3Rpb24gPSBzY29wZS5hY3Rpb25zWzBdOworICAgICAgICAgICAgfQorCisgICAgICAgICAgICBzY29wZS50b2dnbGUgPSBmdW5jdGlvbigpIHsKKyAgICAgICAgICAgICAgICBzY29wZS5pc0FjdGlvbnNTaG93biA9ICFzY29wZS5pc0FjdGlvbnNTaG93bjsKKyAgICAgICAgICAgIH0KKworICAgICAgICAgICAgc2NvcGUuY2hvb3NlQWN0aW9uID0gZnVuY3Rpb24oJGV2ZW50LCBhY3Rpb24peworCisgICAgICAgICAgICAgICAgaWYgKCRldmVudCAhPSBudWxsKSB7CisgICAgICAgICAgICAgICAgICAgIHNjb3BlLmN1cnJlbnRBY3Rpb24gPSBhY3Rpb247CisgICAgICAgICAgICAgICAgICAgIHNjb3BlLnNlbGVjdGVkSW5kZXggPSBzY29wZS5hY3Rpb25zLmluZGV4T2YoYWN0aW9uKTsKKworICAgICAgICAgICAgICAgIH0KKworICAgICAgICAgICAgICAgIGVsc2UgeworICAgICAgICAgICAgICAgICAgICBzY29wZS5jdXJyZW50QWN0aW9uID0gc2NvcGUuYWN0aW9uc1tzY29wZS5zZWxlY3RlZEluZGV4XTsKKyAgICAgICAgICAgICAgICB9CisKKyAgICAgICAgICAgICAgICBpZiAoYW5ndWxhci5pc0Z1bmN0aW9uKHNjb3BlLm9uQWN0aW9uQ2xpY2tlZCkpCisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICBzY29wZS5vbkFjdGlvbkNsaWNrZWQoc2NvcGUuY3VycmVudEFjdGlvbik7CisgICAgICAgICAgICAgICAgfQorCisgICAgICAgICAgICAgICAgc2NvcGUudG9nZ2xlKCk7CisgICAgICAgICAgICB9CisKKyAgICAgICAgICAgIHNjb3BlLmlzQ3VycmVudEFjdGlvbiA9IGZ1bmN0aW9uKGFjdGlvbikgeworICAgICAgICAgICAgICAgIHJldHVybiAoYWN0aW9uID09PSBzY29wZS5jdXJyZW50QWN0aW9uKTsKKyAgICAgICAgICAgIH07CisKKyAgICAgICAgICAgIC8vIGNhdG8KKyAgICAgICAgICAgIGVsZW1lbnQuYmluZCgia2V5ZG93biIsIGZ1bmN0aW9uKGUpeworICAgICAgICAgICAgICAgIGlmIChlLndoaWNoID09PSBLRVkuRU5URVIgfHwgIEtFWS5pc1ZlcnRpY2FsTW92ZW1lbnQoZS53aGljaCkgfHwgS0VZLmlzSG9yaXpvbnRhbE1vdmVtZW50KGUud2hpY2gpKQorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgZS5wcmV2ZW50RGVmYXVsdCgpOworICAgICAgICAgICAgICAgICAgICBlLnN0b3BQcm9wYWdhdGlvbigpOworICAgICAgICAgICAgICAgICAgICAgc3dpdGNoIChlLmtleUNvZGUpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIGNhc2UgS0VZLkRPV046CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2NvcGUuc2VsZWN0TmV4dCgpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgICAgICAgICAgY2FzZSBLRVkuVVA6CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2NvcGUuc2VsZWN0UHJldigpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgICAgICAgICAgY2FzZSBLRVkuRU5URVI6CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2NvcGUuc2VsZWN0Q3VycmVudCgpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgICAgICAgICAgY2FzZSBLRVkuRVNDOgorICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNjb3BlLmlzQWN0aW9uc1Nob3duID0gZmFsc2U7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2NvcGUuJGFwcGx5KCk7CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgc2NvcGUuJGFwcGx5KCk7CisgICAgICAgICAgICAgICAgICAgIHJldHVybjsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9KTsKKworICAgICAgICAgICAgaWYoYXR0ci5kaXNhYmxlZCkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgIHNjb3BlLmlzRGlzYWJsZWQgPSB0cnVlOworICAgICAgICAgICAgfQorCisKKyAgICAgICAgICAgIHNjb3BlLnNlbGVjdEN1cnJlbnQgPSBmdW5jdGlvbigpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgaWYgKHNjb3BlLnNlbGVjdGVkSW5kZXggPCAwKQorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgc2NvcGUuc2VsZWN0ZWRJbmRleCA9IDA7CisgICAgICAgICAgICAgICAgfQorCisKKyAgICAgICAgICAgICAgICBpZighc2NvcGUuaXNBY3Rpb25zU2hvd24pIHsKKyAgICAgICAgICAgICAgICAgICAgc2NvcGUudG9nZ2xlKCk7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIGVsc2UgeworICAgICAgICAgICAgICAgICAgICBzY29wZS5jaG9vc2VBY3Rpb24obnVsbCwgc2NvcGUuY3VycmVudEFjdGlvbik7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfTsKKworICAgICAgICAgICAgc2NvcGUuc2VsZWN0TmV4dCA9IGZ1bmN0aW9uKCkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBpZihzY29wZS5pc0FjdGlvbnNTaG93bikKKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgIGlmKChzY29wZS5zZWxlY3RlZEluZGV4ICsgMSkgPCBzY29wZS5hY3Rpb25zLmxlbmd0aCkKKyAgICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAgICAgc2NvcGUuc2VsZWN0ZWRJbmRleCArPSAxOworICAgICAgICAgICAgICAgICAgICAgICAgc2NvcGUuJGFwcGx5KCk7CisKKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICBlbHNleworICAgICAgICAgICAgICAgICAgICAgICAgc2NvcGUuc2VsZWN0ZWRJbmRleCA9IChzY29wZS5hY3Rpb25zLmxlbmd0aCAtIDEpOworICAgICAgICAgICAgICAgICAgICAgICAgc2NvcGUuJGFwcGx5KCk7CisKKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH07CisKKyAgICAgICAgICAgIHNjb3BlLnNlbGVjdFByZXYgPSBmdW5jdGlvbigpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgaWYoc2NvcGUuaXNBY3Rpb25zU2hvd24pCisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICBpZigoc2NvcGUuc2VsZWN0ZWRJbmRleCAtIDEpID49IDApCisgICAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIHNjb3BlLnNlbGVjdGVkSW5kZXggLT0gMTsKKyAgICAgICAgICAgICAgICAgICAgICAgIHNjb3BlLiRhcHBseSgpOworICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgIGVsc2UgaWYoc2NvcGUuc2VsZWN0ZWRJbmRleCAtIDEgPCAwKQorICAgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgICAgICBzY29wZS5zZWxlY3RlZEluZGV4ID0gMDsKKyAgICAgICAgICAgICAgICAgICAgICAgIHNjb3BlLiRhcHBseSgpOworICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfTsKKworICAgICAgICAgICAgc2NvcGUuaG92ZXJJbiA9IGZ1bmN0aW9uKGNJdGVtKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIHNjb3BlLnNlbGVjdGVkSW5kZXggPSBjSXRlbTsKKyAgICAgICAgICAgIH07CisKKworICAgICAgICAgICAgLy9lbmQgY2F0bworCisgICAgICAgICAgICB2YXIgb3V0c2lkZUNsaWNrID0gZnVuY3Rpb24oZSkgeworICAgICAgICAgICAgICAgIHZhciBpc0VsZW1lbnQgPSAkaXNFbGVtZW50KGFuZ3VsYXIuZWxlbWVudChlLnRhcmdldCksIGVsZW1lbnQsICRkb2N1bWVudCk7CisKKyAgICAgICAgICAgICAgICBpZighaXNFbGVtZW50KSB7CisgICAgICAgICAgICAgICAgICAgIHNjb3BlLnRvZ2dsZSgpOworICAgICAgICAgICAgICAgICAgICBzY29wZS4kYXBwbHkoKTsKKyAgICAgICAgICAgICAgICB9CisKKyAgICAgICAgICAgIH07CisKKyAgICAgICAgICAgICRkb2N1bWVudEJpbmQuY2xpY2soJ2lzQWN0aW9uc1Nob3duJywgb3V0c2lkZUNsaWNrLCBzY29wZSk7CisKKyAgICAgICAgfQorICAgIH07Cit9XSk7CisKK30oKSk7CisKK2FuZ3VsYXIubW9kdWxlKCdhdHQuYWJzLnNsaWRlcicsIFsnYXR0LmFicy5wb3NpdGlvbiddKQorICAgICAgICAuY29uc3RhbnQoJ3NsaWRlckRlZmF1bHRPcHRpb25zJywgeworICAgICAgICAgICAgd2lkdGg6IDMwMCwKKyAgICAgICAgICAgIHN0ZXA6IDEsCisgICAgICAgICAgICBwcmVjaXNpb246IDAsCisgICAgICAgICAgICBkaXNhYmxlZFdpZHRoOiAxMTYsCisgICAgICAgIH0pCisgICAgICAgIC5kaXJlY3RpdmUoJ2F0dFNsaWRlcicsIFsnc2xpZGVyRGVmYXVsdE9wdGlvbnMnLCckcG9zaXRpb24nLCBmdW5jdGlvbihzbGlkZXJEZWZhdWx0T3B0aW9ucywkcG9zaXRpb24pCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgcmV0dXJuIHsKKyAgICAgICAgICAgICAgICAgICAgcmVzdHJpY3Q6ICdFQScsCisgICAgICAgICAgICAgICAgICAgIHJlcGxhY2U6IHRydWUsCisgICAgICAgICAgICAgICAgICAgIHRyYW5zY2x1ZGU6IHRydWUsCisgICAgICAgICAgICAgICAgICAgIHNjb3BlOiB7CisgICAgICAgICAgICAgICAgICAgICAgICBmbG9vcjogIj0iLCAvLyB0aGUgbWluaW11bSBwb3NzaWJsZSB2YWx1ZQorICAgICAgICAgICAgICAgICAgICAgICAgY2VpbGluZzogIj0iLCAvLyB0aGUgbWF4aW11bSBwb3NzaWJsZSB2YWx1ZQorICAgICAgICAgICAgICAgICAgICAgICAgc3RlcDogIkAiLCAvLyBob3cgd2lkZSBpcyBlYWNoIHN0ZXAKKyAgICAgICAgICAgICAgICAgICAgICAgIHByZWNpc2lvbjogIkAiLCAvLyBob3cgbWFueSBkZWNpbWFsIHBsYWNlcyBkbyB3ZSBjYXJlIGFib3V0CisgICAgICAgICAgICAgICAgICAgICAgICB3aWR0aDogIkAiLCAvL2hvdyB3aWRlIHRoZSBiYXIgd291bGQgYmUKKyAgICAgICAgICAgICAgICAgICAgICAgIHRleHREaXNwbGF5OiAiPSIsIC8vIExhYmVscyBvZiBtYXggYW5kIG1pbiB2YWx1ZXMgdG8gYmUgZGlzcGxheWVkIGF0IGZyb250IEVuZAorICAgICAgICAgICAgICAgICAgICAgICAgdmFsdWU6ICI9IiwgLy8gVmFsdWUgb2YgQ3VycmVudCBQb3NpdGlvbiBtb2RlbAorICAgICAgICAgICAgICAgICAgICAgICAgbmdNb2RlbFNpbmdsZTogJz0/JywKKyAgICAgICAgICAgICAgICAgICAgICAgIG5nTW9kZWxMb3c6ICc9PycsCisgICAgICAgICAgICAgICAgICAgICAgICBuZ01vZGVsSGlnaDogJz0/JywKKyAgICAgICAgICAgICAgICAgICAgICAgIG5nTW9kZWxEaXNhYmxlZDogJz0/JworICAgICAgICAgICAgICAgICAgICB9LAorICAgICAgICAgICAgICAgICAgICB0ZW1wbGF0ZVVybDogJ2FwcC9zY3JpcHRzL25nX2pzX2F0dF90cGxzL3NsaWRlci9zbGlkZXIuaHRtbCcsCisgICAgICAgICAgICAgICAgICAgIGxpbms6IGZ1bmN0aW9uKHNjb3BlLCBlbGVtLCBhdHRyLCBjdHJsKQorICAgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgICAgICB2YXIgbWluT2Zmc2V0LCBtYXhPZmZzZXQsIG5ld09mZnNldCwgb2Zmc2V0UmFuZ2UsIHZhbHVlUmFuZ2UsIHN0YXJ0X3ggPSAwLCBkaXNhYmxlZFJhbmdlLCBkaXNhYmxlZCwgZXZGbGFnID0gZmFsc2UsIG1pblZhbHVlLCBtYXhWYWx1ZSwgcmFuZ2UsIHJlZkxvdywgcmVmSGlnaCwgbWF4UHRyLCBtaW5QdHIsIHNpbmdsZVB0ciwgZ2V0SGFuZGxlczsKKyAgICAgICAgICAgICAgICAgICAgICAgIHNjb3BlLm1pblB0ck9mZnNldCA9IDA7CisgICAgICAgICAgICAgICAgICAgICAgICBzY29wZS5tYXhQdHJPZmZzZXQgPSAwOworICAgICAgICAgICAgICAgICAgICAgICAgdmFyIGRpc2FibGVXaWR0aCA9IHNsaWRlckRlZmF1bHRPcHRpb25zLmRpc2FibGVkV2lkdGg7CisgICAgICAgICAgICAgICAgICAgICAgIAorICAgICAgICAgICAgICAgICAgICAgICAgLy9HZXQgaGFuZGxlcyAKKyAgICAgICAgICAgICAgICAgICAgICAgIHZhciBvYmogPSBlbGVtLmNoaWxkcmVuKCk7CisgICAgICAgICAgICAgICAgICAgICAgICBkaXNhYmxlZFJhbmdlID0gb2JqWzBdLmNoaWxkcmVuOworICAgICAgICAgICAgICAgICAgICAgICAgZGlzYWJsZWRSYW5nZSA9IGFuZ3VsYXIuZWxlbWVudChkaXNhYmxlZFJhbmdlWzBdKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIGdldEhhbmRsZXMgPSBvYmpbMV0uY2hpbGRyZW47CisgICAgICAgICAgICAgICAgICAgICAgICBzaW5nbGVQdHIgPSBhbmd1bGFyLmVsZW1lbnQoZ2V0SGFuZGxlc1swXSk7CisgICAgICAgICAgICAgICAgICAgICAgICBtaW5QdHIgPSBhbmd1bGFyLmVsZW1lbnQoZ2V0SGFuZGxlc1sxXSk7CisgICAgICAgICAgICAgICAgICAgICAgICBtYXhQdHIgPSBhbmd1bGFyLmVsZW1lbnQoZ2V0SGFuZGxlc1syXSk7CisgICAgICAgICAgICAgICAgICAgICAgICBkaXNhYmxlZCA9ICgoYXR0ci5uZ01vZGVsU2luZ2xlID09IG51bGwpICYmIChhdHRyLm5nTW9kZWxMb3cgPT0gbnVsbCkgJiYgKGF0dHIubmdNb2RlbEhpZ2ggPT0gbnVsbCkpICYmIChhdHRyLm5nTW9kZWxEaXNhYmxlZCAhPSBudWxsKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIHJhbmdlID0gKGF0dHIubmdNb2RlbFNpbmdsZSA9PSBudWxsKSAmJiAoKGF0dHIubmdNb2RlbExvdyAhPSBudWxsKSAmJiAoYXR0ci5uZ01vZGVsSGlnaCAhPSBudWxsKSk7CisgICAgICAgICAgICAgICAgICAgICAgICByZWZMb3cgPSAnbmdNb2RlbExvdyc7CisgICAgICAgICAgICAgICAgICAgICAgICByZWZIaWdoID0gJ25nTW9kZWxIaWdoJzsKKyAgICAgICAgICAgICAgICAgICAgICAgIGlmICghcmFuZ2UpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBtaW5QdHIucmVtb3ZlKCk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgbWF4UHRyLnJlbW92ZSgpOworICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgZWxzZSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2luZ2xlUHRyLnJlbW92ZSgpOworICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgaWYgKCFkaXNhYmxlZCkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRpc2FibGVkUmFuZ2UucmVtb3ZlKCk7CisgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICBlbHNlIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBzY29wZS5kaXNhYmxlZFN0eWxlID0ge3dpZHRoOiBkaXNhYmxlV2lkdGggKyAncHgnLCB6SW5kZXg6IDF9OworICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNjb3BlLmhhbmRsZVN0eWxlID0ge2xlZnQ6IGRpc2FibGVXaWR0aCArICdweCd9OworICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgbWluVmFsdWUgPSBwYXJzZUZsb2F0KHNjb3BlLmZsb29yKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIG1heFZhbHVlID0gcGFyc2VGbG9hdChzY29wZS5jZWlsaW5nKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIHZhbHVlUmFuZ2UgPSBtYXhWYWx1ZSAtIG1pblZhbHVlOworICAgICAgICAgICAgICAgICAgICAgICAgbWluT2Zmc2V0ID0gMDsKKyAgICAgICAgICAgICAgICAgICAgICAgIGlmIChhdHRyLndpZHRoICE9PSB1bmRlZmluZWQpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBtYXhPZmZzZXQgPSBhdHRyLndpZHRoOworICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgZWxzZSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGVsZW1bMF0uY2xpZW50V2lkdGggIT09IDApIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbWF4T2Zmc2V0ID0gZWxlbVswXS5jbGllbnRXaWR0aDsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgZWxzZSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1heE9mZnNldCA9IHNsaWRlckRlZmF1bHRPcHRpb25zLndpZHRoOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgIG9mZnNldFJhbmdlID0gbWF4T2Zmc2V0IC0gbWluT2Zmc2V0OworICAgICAgICAgICAgICAgICAgICAgICAgCisgICAgICAgICAgICAgICAgICAgICAgICAvL0tleSBEb3duIEV2ZW50CisgICAgICAgICAgICAgICAgICAgICAgICBzY29wZS5rZXlEb3duID0gZnVuY3Rpb24oZXYpeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmKGV2LmtleUNvZGUgPT0gMzkpeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFyIGVsZW1MZWZ0ID0gJHBvc2l0aW9uLnBvc2l0aW9uKGVsZW0pLmxlZnQ7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAobmV3T2Zmc2V0KXsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG5ld09mZnNldCA9IHNsaWRlckRlZmF1bHRPcHRpb25zLnN0ZXAgKyBuZXdPZmZzZXQ7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZWxzZXtuZXdPZmZzZXQgPSBzbGlkZXJEZWZhdWx0T3B0aW9ucy5zdGVwICsgZWxlbUxlZnQ7fQorICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBlbHNlIGlmKGV2LmtleUNvZGUgPT0gMzcpeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YXIgcHRyTGVmdCA9ICRwb3NpdGlvbi5wb3NpdGlvbihzaW5nbGVQdHIpLmxlZnQ7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhciBlbGVtTGVmdCA9ICRwb3NpdGlvbi5wb3NpdGlvbihlbGVtKS5sZWZ0OworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZihuZXdPZmZzZXQpeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAobmV3T2Zmc2V0IT0wKXsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG5ld09mZnNldCA9IG5ld09mZnNldCAtIHNsaWRlckRlZmF1bHRPcHRpb25zLnN0ZXAgOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZWxzZXsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG5ld09mZnNldCA9IHB0ckxlZnQgLSBzbGlkZXJEZWZhdWx0T3B0aW9ucy5zdGVwIDt9CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYobmV3T2Zmc2V0Pj0wKXsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2NvcGUucHRyT2Zmc2V0KG5ld09mZnNldCk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAKKyAgICAgICAgICAgICAgICAgICAgICAgICB9OyAgIAorICAgICAgICAgICAgICAgICAgICAgICAgIAorICAgICAgICAgICAgICAgICAgICAgICAgLy9Nb3VzZSBEb3duIEV2ZW50CisgICAgICAgICAgICAgICAgICAgICAgICBzY29wZS5tb3VzZURvd24gPSBmdW5jdGlvbihlLCByZWYpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBzY29wZS5yZWYgPSByZWY7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgZXZGbGFnID0gdHJ1ZTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoIXJhbmdlKXsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKG5ld09mZnNldCkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc3RhcnRfeCA9IGUuY2xpZW50WCAtIG5ld09mZnNldDsKKworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGVsc2UgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc3RhcnRfeCA9IGUuY2xpZW50WDsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChzY29wZS5yZWYgPT0gcmVmTG93KSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzdGFydF94ID0gZS5jbGllbnRYIC0gc2NvcGUubWluUHRyT2Zmc2V0OworCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZWxzZSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzdGFydF94ID0gZS5jbGllbnRYIC0gc2NvcGUubWF4UHRyT2Zmc2V0OworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChkaXNhYmxlZCkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzY29wZS5yZWY9ICduZ01vZGVsRGlzYWJsZWQnOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzY29wZS5kaXNhYmxlZFN0eWxlID0ge3dpZHRoOiBkaXNhYmxlV2lkdGggKyAncHgnLCB6SW5kZXg6IDF9OworICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgIH07CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKKyAgICAgICAgICAgICAgICAgICAgICAgIC8vIE1vdXNlIE1vdmUgRXZlbnQKKyAgICAgICAgICAgICAgICAgICAgICAgIHNjb3BlLm1vdmVFbGVtID0gZnVuY3Rpb24oZXYpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoZXZGbGFnKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhciBldmVudFgsIG5ld1BlcmNlbnQsIG5ld1ZhbHVlOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBldmVudFggPSBldi5jbGllbnRYOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBuZXdPZmZzZXQgPSBldmVudFggLSBzdGFydF94OworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzY29wZS5wdHJPZmZzZXQobmV3T2Zmc2V0KTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICB9OworCisgICAgICAgICAgICAgICAgICAgICAgICAvLyBNb3VzZSBVcCBFdmVudAorICAgICAgICAgICAgICAgICAgICAgICAgc2NvcGUubW91c2VVcCA9IGZ1bmN0aW9uKGV2KSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgZXZGbGFnID0gZmFsc2U7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgbWluUHRyLnJlbW92ZUNsYXNzKCdkcmFnZ2luZycpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1heFB0ci5yZW1vdmVDbGFzcygnZHJhZ2dpbmcnKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBzaW5nbGVQdHIucmVtb3ZlQ2xhc3MoJ2RyYWdnaW5nJyk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgJChkb2N1bWVudCkub2ZmKCdtb3VzZW1vdmUnKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIH07CisKKyAgICAgICAgICAgICAgICAgICAgICAgIC8vRnVuY3Rpb24gdG8gY2FsY3VsYXRlIHRoZSBjdXJyZW50IFBvc2l0aW9uVmFsdWUKKyAgICAgICAgICAgICAgICAgICAgICAgIHNjb3BlLmNhbFN0ZXAgPSBmdW5jdGlvbih2YWx1ZSwgcHJlY2lzaW9uLCBzdGVwLCBmbG9vcikgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhciBkZWNpbWFscywgcmVtYWluZGVyLCByb3VuZGVkVmFsdWUsIHN0ZXBwZWRWYWx1ZTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoZmxvb3IgPT09IG51bGwpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZmxvb3IgPSAwOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoc3RlcCA9PT0gbnVsbCkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzdGVwID0gMSAvIE1hdGgucG93KDEwLCBwcmVjaXNpb24pOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICByZW1haW5kZXIgPSAodmFsdWUgLSBmbG9vcikgJSBzdGVwOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIHN0ZXBwZWRWYWx1ZSA9IHJlbWFpbmRlciA+IChzdGVwIC8gMikgPyB2YWx1ZSArIHN0ZXAgLSByZW1haW5kZXIgOiB2YWx1ZSAtIHJlbWFpbmRlcjsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBkZWNpbWFscyA9IE1hdGgucG93KDEwLCBwcmVjaXNpb24pOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJvdW5kZWRWYWx1ZSA9IHN0ZXBwZWRWYWx1ZSAqIGRlY2ltYWxzIC8gZGVjaW1hbHM7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHJvdW5kZWRWYWx1ZS50b0ZpeGVkKHByZWNpc2lvbik7CisgICAgICAgICAgICAgICAgICAgICAgICB9OworCisgICAgICAgICAgICAgICAgICAgICAgICAvL0Z1bmN0aW9uIHRvIGNhbGN1bGF0ZSBPZmZzZXQgUGVyY2VudAorICAgICAgICAgICAgICAgICAgICAgICAgc2NvcGUucGVyY2VudE9mZnNldCA9IGZ1bmN0aW9uKG9mZnNldCkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiAoKG9mZnNldCAtIG1pbk9mZnNldCkgLyBvZmZzZXRSYW5nZSkgKiAxMDA7CisgICAgICAgICAgICAgICAgICAgICAgICB9OworICAgICAgICAgICAgICAgICAgICAgICAgCisgICAgICAgICAgICAgICAgICAgICAgICAvL0Z1bmN0aW9uIHRvIGNhbGN1bGF0ZSBPZmZzZXQgcG9zaXRpb24KKyAgICAgICAgICAgICAgICAgICAgICAgIHNjb3BlLnB0ck9mZnNldCA9IGZ1bmN0aW9uKG5ld09mZnNldCl7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFyIG5ld1BlcmNlbnQsIG5ld1ZhbHVlOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBuZXdPZmZzZXQgPSBNYXRoLm1heChNYXRoLm1pbihuZXdPZmZzZXQsIG1heE9mZnNldCksIG1pbk9mZnNldCk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG5ld1BlcmNlbnQgPSBzY29wZS5wZXJjZW50T2Zmc2V0KG5ld09mZnNldCk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG5ld1ZhbHVlID0gbWluVmFsdWUgKyAodmFsdWVSYW5nZSAqIG5ld1BlcmNlbnQgLyAxMDAuMCk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChyYW5nZSkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFyIHJhbmdlU2xpZGVyV2lkdGg7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoc2NvcGUucmVmID09IHJlZkxvdykgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNjb3BlLm1pbkhhbmRsZVN0eWxlID0ge2xlZnQ6IG5ld09mZnNldCArICJweCJ9OworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNjb3BlLm1pbk5ld1ZhbCA9IG5ld1ZhbHVlOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNjb3BlLm1pblB0ck9mZnNldCA9IG5ld09mZnNldDsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBtaW5QdHIuYWRkQ2xhc3MoJ2RyYWdnaW5nJyk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKG5ld1ZhbHVlID4gc2NvcGUubWF4TmV3VmFsKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNjb3BlLnJlZiA9IHJlZkhpZ2g7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNjb3BlLm1heE5ld1ZhbCA9IG5ld1ZhbHVlOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzY29wZS5tYXhQdHJPZmZzZXQgPSBuZXdPZmZzZXQ7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1heFB0ci5hZGRDbGFzcygnZHJhZ2dpbmcnKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbWluUHRyLnJlbW92ZUNsYXNzKCdkcmFnZ2luZycpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzY29wZS5tYXhIYW5kbGVTdHlsZSA9IHtsZWZ0OiBuZXdPZmZzZXQgKyAicHgifTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBlbHNlIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzY29wZS5tYXhIYW5kbGVTdHlsZSA9IHtsZWZ0OiBuZXdPZmZzZXQgKyAicHgifTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzY29wZS5tYXhOZXdWYWwgPSBuZXdWYWx1ZTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzY29wZS5tYXhQdHJPZmZzZXQgPSBuZXdPZmZzZXQ7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbWF4UHRyLmFkZENsYXNzKCdkcmFnZ2luZycpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChuZXdWYWx1ZSA8IHNjb3BlLm1pbk5ld1ZhbCkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzY29wZS5yZWYgPSByZWZMb3c7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNjb3BlLm1pblZhbCA9IG5ld1ZhbHVlOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzY29wZS5taW5QdHJPZmZzZXQgPSBuZXdPZmZzZXQ7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1pblB0ci5hZGRDbGFzcygnZHJhZ2dpbmcnKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbWF4UHRyLnJlbW92ZUNsYXNzKCdkcmFnZ2luZycpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzY29wZS5taW5IYW5kbGVTdHlsZSA9IHtsZWZ0OiBuZXdPZmZzZXQgKyAicHgifTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByYW5nZVNsaWRlcldpZHRoID0gcGFyc2VJbnQoc2NvcGUubWF4UHRyT2Zmc2V0KSAtIHBhcnNlSW50KHNjb3BlLm1pblB0ck9mZnNldCk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzY29wZS5yYW5nZVN0eWxlID0ge3dpZHRoOiByYW5nZVNsaWRlcldpZHRoICsgInB4IiwgbGVmdDogc2NvcGUubWluUHRyT2Zmc2V0ICsgInB4In07CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZWxzZSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoZGlzYWJsZWQgJiYgbmV3T2Zmc2V0ID4gZGlzYWJsZVdpZHRoKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2NvcGUucmFuZ2VTdHlsZSA9IHt3aWR0aDogbmV3T2Zmc2V0ICsgInB4IiwgekluZGV4OiAwfTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGVsc2UgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNpbmdsZVB0ci5hZGRDbGFzcygnZHJhZ2dpbmcnKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzY29wZS5yYW5nZVN0eWxlID0ge3dpZHRoOiBuZXdPZmZzZXQgKyAicHgifTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNjb3BlLmhhbmRsZVN0eWxlID0ge2xlZnQ6IG5ld09mZnNldCArICJweCJ9OworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICgoc2NvcGUucHJlY2lzaW9uID09IHVuZGVmaW5lZCkgfHwgKHNjb3BlLnN0ZXAgPT0gdW5kZWZpbmVkKSkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2NvcGUucHJlY2lzaW9uID0gc2xpZGVyRGVmYXVsdE9wdGlvbnMucHJlY2lzaW9uOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2NvcGUuc3RlcCA9IHNsaWRlckRlZmF1bHRPcHRpb25zLnN0ZXA7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbmV3VmFsdWUgPSBzY29wZS5jYWxTdGVwKG5ld1ZhbHVlLCBwYXJzZUludChzY29wZS5wcmVjaXNpb24pLCBwYXJzZUZsb2F0KHNjb3BlLnN0ZXApLCBwYXJzZUZsb2F0KHNjb3BlLmZsb29yKSk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNjb3BlW3Njb3BlLnJlZl0gPSBuZXdWYWx1ZTsKKyAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIH07CisgICAgICAgICAgICB9CisgICAgICAgIF0pLmRpcmVjdGl2ZSgnYXR0U2xpZGVyTWluJyxbZnVuY3Rpb24oKQorICAgICAgICAgICAgeworICAgICAgICAgICAgIHJldHVybnsKKyAgICAgICAgICAgICAgICAgcmVxdWlyZTogJ15hdHRTbGlkZXInLAorICAgICAgICAgICAgICAgICByZXN0cmljdDogJ0VBJywKKyAgICAgICAgICAgICAgICAgcmVwbGFjZTogdHJ1ZSwKKyAgICAgICAgICAgICAgICAgdHJhbnNjbHVkZTogdHJ1ZSwKKyAgICAgICAgICAgICAgICAgdGVtcGxhdGVVcmw6ICdhcHAvc2NyaXB0cy9uZ19qc19hdHRfdHBscy9zbGlkZXIvbWluQ29udGVudC5odG1sJworICAgICAgICAgICAgICAgfTsKKyAgICAgICAgIH0KKyAgICBdKS5kaXJlY3RpdmUoJ2F0dFNsaWRlck1heCcsW2Z1bmN0aW9uKCkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICByZXR1cm57CisgICAgICAgICAgICAgICAgIHJlcXVpcmU6ICdeYXR0U2xpZGVyJywKKyAgICAgICAgICAgICAgICAgcmVzdHJpY3Q6ICdFQScsCisgICAgICAgICAgICAgICAgIHJlcGxhY2U6IHRydWUsCisgICAgICAgICAgICAgICAgIHRyYW5zY2x1ZGU6IHRydWUsCisgICAgICAgICAgICAgICAgIHRlbXBsYXRlVXJsOiAnYXBwL3NjcmlwdHMvbmdfanNfYXR0X3RwbHMvc2xpZGVyL21heENvbnRlbnQuaHRtbCcKKyAgICAgICAgICAgICB9OworICAgICAgICAgfQorICAgIF0pCisuY29uc3RhbnQoJ3NsaWRlckNvbnN0YW50cycsIHsKKyAgICAvKgorICAgICAgICBUaGUgTUlUIExpY2Vuc2UgKE1JVCkKKyAgICAgICAgQ29weXJpZ2h0IChjKSAyMDEzIEp1bGllbiBWYWzpcnkKKyAgICAqLworICAgIFNMSURFUjogeworICAgICAgc2V0dGluZ3M6IHsKKyAgICAgICAgZnJvbTogMSwKKyAgICAgICAgdG86IDQwLAorICAgICAgICBzdGVwOiAxLAorICAgICAgICBzbW9vdGg6IHRydWUsCisgICAgICAgIGxpbWl0czogdHJ1ZSwKKyAgICAgICAgdmFsdWU6ICIzIiwKKyAgICAgICAgZGltZW5zaW9uOiAiIiwKKyAgICAgICAgdmVydGljYWw6IGZhbHNlCisgICAgICB9LAorICAgICAgY2xhc3NOYW1lOiAianNsaWRlciIsCisgICAgICBzZWxlY3RvcjogIi5qc2xpZGVyLSIKKyAgICB9LAorICAgIEVWRU5UUzogeworICAgIH0sCisgICAgQ09MT1JTOiB7CisgICAgICBHUkVFTjogJ2dyZWVuJywKKyAgICAgIEJMVUVfSElHSExJR0hUOiAnYmx1ZScsCisgICAgICBNQUdFTlRBOiAnbWFnZW50YScsCisgICAgICBHT0xEOiAnZ29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XIgaGlnaGVyVmFsOworICAgICAgICB2YXIgbmV3TW91c2VQcmM7CisgICAgICAgIHZhciBtaWRkbGU7CisKKyAgICAgICAgZm9yKHZhciBpbmRleCA9IDE7aW5kZXggPCBzY2FsZS5sZW5ndGg7IGluZGV4KyspeworICAgICAgICAgIGxvd2VyVmFsID0gc2NhbGVbaW5kZXgtMV07CisgICAgICAgICAgaGlnaGVyVmFsID0gc2NhbGVbaW5kZXhdOworCisgICAgICAgICAgbWlkZGxlID0gKChoaWdoZXJWYWwgLSBsb3dlclZhbCkqLjUpK2xvd2VyVmFsOworCisgICAgICAgICAgLyoKKyAgICAgICAgICBIYW5kbGVzIGEgc2l0dWF0aW9uIHdoZXJlIHRoZSB1c2VyIGNsaWNrcyBjbG9zZSB0byB0aGUgc3RhcnQgcG9pbnQgb2YgCisgICAgICAgICAgdGhlIHNsaWRlciBidXQgdGhlIHBvaW50ZXIgZG9lc24ndCBtb3ZlCisgICAgICAgICAgKi8KKyAgICAgCisKKyAgICAgICAgICBpZihsb3dlclZhbCA9PSAwICYmIG1vdXNlUHJjIDw9IG1pZGRsZSl7CisgICAgICAgICAgICBuZXdNb3VzZVByYyA9IGxvd2VyVmFsOworICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgfQorICAgICAgICAgIGVsc2UgaWYoY2hlY2tFcXVhbGl0eShsb3dlclZhbCxtb3VzZVByYykpeworICAgICAgICAgICAgbmV3TW91c2VQcmMgPSBsb3dlclZhbDsKKyAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgIH0KKyAgICAgICAgICBlbHNlIGlmKGxvd2VyVmFsIDwgbW91c2VQcmMgJiYgKG1vdXNlUHJjIDwgaGlnaGVyVmFsIHx8IAorICAgICAgICAgICAgY2hlY2tFcXVhbGl0eShtb3VzZVByYyxoaWdoZXJWYWwpKSkKKyAgICAgICAgICB7CisgICAgICAgICAgICBuZXdNb3VzZVByYyA9IGhpZ2hlclZhbDsKKyAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgIH0KKyAgICAgICAgICAKKyAgICAgICAgfQorCisgICAgICAgIC8vQ2hlY2sgaWYgdGhlIG5ld01vdXNlUHJjIGlzIDw9IHRoZSBjdXR0T2ZmUG9pbnQKKyAgICAgICAgaWYoY3V0T2ZmV2lkdGggJiYgbmV3TW91c2VQcmMgPCBjdXRPZmZXaWR0aCl7CisgICAgICAgICAgcmV0dXJuIHNjYWxlW2N1dE9mZkluZGV4XTsKKyAgICAgICAgfQorICAgICAgICBlbHNleworICAgICAgICAgIHJldHVybiBuZXdNb3VzZVByYzsKKyAgICAgICAgfQorCisgICAgICAgIC8qCisgICAgICAgICAgICBDaGVja3MgdG8gc2VlIGlmIDIgcG9pbnRzIGFyZSBzbyBjbG9zZSB0aGF0IHRoZXkgYXJlCisgICAgICAgICAgICBiYXNpY2FsbHkgZXF1YWwuCisgICAgICAgICovCisKKyAgICAgICAgZnVuY3Rpb24gY2hlY2tFcXVhbGl0eShwb2ludDEsIHBvaW50Mil7CisgICAgICAgICAgICB2YXIgcHJlY2lzaW9uID0gMC4xOworICAgICAgICAgICAgaWYoIE1hdGguYWJzKHBvaW50MiAtIHBvaW50MSkgPD0gcHJlY2lzaW9uKQorICAgICAgICAgICAgICAgIHJldHVybiB0cnVlOworICAgICAgICAgICAgcmV0dXJuIGZhbHNlOworICAgICAgICB9CisgICAgICB9LAorCisgICAgICB2YWx1ZUZvckRpZmZlcmVudFNjYWxlOiBmdW5jdGlvbihmcm9tLHRvLHByYyxwcmNUb1ZhbHVlTWFwcGVyKXsKKyAgICAgICAgdmFyIGRlY2ltYWxQcmMgPSBwcmMvMTAwOworICAgICAgICBpZihkZWNpbWFsUHJjID09IDApCisgICAgICAgICAgICByZXR1cm4gZnJvbTsKKworICAgICAgICByZXR1cm4gcHJjVG9WYWx1ZU1hcHBlcltwcmNdOworICAgICAgfSwKKworICAgICAgZ2V0Q29udmVyc2lvbkZhY3RvclZhbHVlOiBmdW5jdGlvbih2YWx1ZSwgY29udmVyc2lvbixmaXJzdERpbWVuc2lvbil7CisgICAgICAgIC8qCisgICAgICAgICAgICBMb29wIHRocm91Z2ggdGhlIGNvbnZlcnNpb24gYXJyYXkgYW5kIGtlZXAgY2hlY2tpbmcgdGhlCisgICAgICAgICAgICBzdGFydFZhbAorICAgICAgICAqLworCisgICAgICAgIGlmKHZhbHVlIDw9IGNvbnZlcnNpb25bMF0uc3RhcnRWYWwpeworICAgICAgICAgICAgcmV0dXJueworICAgICAgICAgICAgICAgIHNjYWxlZFZhbDp2YWx1ZSwKKyAgICAgICAgICAgICAgICBzY2FsZWREaW1lbnNpb246Zmlyc3REaW1lbnNpb24KKyAgICAgICAgICAgIH07CisgICAgICAgIH0KKworCisgICAgICAgIHZhciBlbmRJbmRleCA9IDA7CisgICAgICAgIGZvcih2YXIgaW5kZXggaW4gY29udmVyc2lvbil7CisgICAgICAgICAgICB2YXIgYyA9IGNvbnZlcnNpb25baW5kZXhdOworCisgICAgICAgICAgICBpZih2YWx1ZSA+IGMuc3RhcnRWYWwpCisgICAgICAgICAgICAgICAgZW5kSW5kZXggPSBpbmRleDsKKyAgICAgICAgfQorCisgICAgICAgIHZhciBzY2FsZUZhY3RvciA9IGNvbnZlcnNpb25bZW5kSW5kZXhdLnNjYWxlRmFjdG9yOworICAgICAgICB2YXIgc2NhbGVkVmFsID0gdmFsdWUvc2NhbGVGYWN0b3I7CisgICAgICAgIHZhciBzY2FsZWREaW1lbnNpb249Y29udmVyc2lvbltlbmRJbmRleF0uZGltZW5zaW9uOworCisgICAgICAgIHJldHVybiB7CisgICAgICAgICAgICBzY2FsZWRWYWw6c2NhbGVkVmFsLAorICAgICAgICAgICAgc2NhbGVkRGltZW5zaW9uOnNjYWxlZERpbWVuc2lvbgorICAgICAgICB9OworCisgICAgICB9CisKKyAgICB9OworfSkKKworLmZhY3RvcnkoJ3NsaWRlckRyYWdnYWJsZScsIFsndXRpbHMnLCBmdW5jdGlvbih1dGlscykgeworICAgCisgICAgLyoKKyAgICAgICAgVGhlIE1JVCBMaWNlbnNlIChNSVQpCisgICAgICAgIENvcHlyaWdodCAoYykgMjAxMyBKdWxpZW4gVmFs6XJ5CisgICAgKi8KKworICAgIGZ1bmN0aW9uIERyYWdnYWJsZSgpeworICAgICAgdGhpcy5faW5pdC5hcHBseSggdGhpcywgYXJndW1lbnRzICk7CisgICAgfQorCisgICAgRHJhZ2dhYmxlLnByb3RvdHlwZS5vbmluaXQgPSBmdW5jdGlvbigpeworICAgIH07CisKKyAgICBEcmFnZ2FibGUucHJvdG90eXBlLmV2ZW50cyA9IGZ1bmN0aW9uKCl7CisgICAgfTsKKworICAgIERyYWdnYWJsZS5wcm90b3R5cGUub25tb3VzZWRvd24gPSBmdW5jdGlvbigpeworICAgICAgdGhpcy5wdHIuY3NzKHsgcG9zaXRpb246ICJhYnNvbHV0ZSIgfSk7CisgICAgfTsKKworICAgIERyYWdnYWJsZS5wcm90b3R5cGUub25tb3VzZW1vdmUgPSBmdW5jdGlvbiggZXZ0LCB4LCB5ICl7CisgICAgICB0aGlzLnB0ci5jc3MoeyBsZWZ0OiB4LCB0b3A6IHkgfSk7CisgICAgfTsKKworICAgIERyYWdnYWJsZS5wcm90b3R5cGUub25tb3VzZXVwID0gZnVuY3Rpb24oKXt9OworCisgICAgRHJhZ2dhYmxlLnByb3RvdHlwZS5pc0RlZmF1bHQgPSB7CisgICAgICBkcmFnOiBmYWxzZSwKKyAgICAgIGNsaWNrZWQ6IGZhbHNlLAorICAgICAgdG9jbGljazogdHJ1ZSwKKyAgICAgIG1vdXNldXA6IGZhbHNlCisgICAgfTsKKworICAgIERyYWdnYWJsZS5wcm90b3R5cGUuX2luaXQgPSBmdW5jdGlvbigpIHsKKyAgICAgIGlmKCBhcmd1bWVudHMubGVuZ3RoID4gMCApeworICAgICAgICB0aGlzLnB0ciA9IGFyZ3VtZW50c1swXTsKKyAgICAgICAgdGhpcy5wYXJlbnQgPSBhcmd1bWVudHNbMl07CisKKyAgICAgICAgaWYgKCF0aGlzLnB0cikKKyAgICAgICAgICByZXR1cm47CisKKyAgICAgICAgdGhpcy5pcyA9IHt9OworICAgICAgICBhbmd1bGFyLmV4dGVuZCggdGhpcy5pcywgdGhpcy5pc0RlZmF1bHQgKTsKKyAgICAgICAgdmFyIG9mZnNldCA9IHV0aWxzLm9mZnNldCh0aGlzLnB0cik7CisKKyAgICAgICAgdGhpcy5kID0geworICAgICAgICAgIGxlZnQ6IG9mZnNldC5sZWZ0LAorICAgICAgICAgIHRvcDogb2Zmc2V0LnRvcCwKKyAgICAgICAgICB3aWR0aDogdGhpcy5wdHJbMF0uY2xpZW50V2lkdGgsCisgICAgICAgICAgaGVpZ2h0OiB0aGlzLnB0clswXS5jbGllbnRIZWlnaHQKKyAgICAgICAgfTsKKworICAgICAgICB0aGlzLm9uaW5pdC5hcHBseSggdGhpcywgYXJndW1lbnRzICk7CisKKyAgICAgICAgdGhpcy5fZXZlbnRzKCk7CisgICAgICB9CisgICAgfTsKKworICAgIERyYWdnYWJsZS5wcm90b3R5cGUuX2dldFBhZ2VDb29yZHMgPSBmdW5jdGlvbiggZXZlbnQgKXsKKworICAgICAgdmFyIHZhbHVlID0ge307CisKKyAgICAgIGlmKCBldmVudC50YXJnZXRUb3VjaGVzICYmIGV2ZW50LnRhcmdldFRvdWNoZXNbMF0gKXsKKyAgICAgICAgdmFsdWU9IHsgeDogZXZlbnQudGFyZ2V0VG91Y2hlc1swXS5wYWdlWCwgeTogZXZlbnQudGFyZ2V0VG91Y2hlc1swXS5wYWdlWSB9OworICAgICAgfSBlbHNleworICAgICAgICB2YWx1ZT0geyB4OiBldmVudC5wYWdlWCwgeTogZXZlbnQucGFnZVkgfTsKKyAgICAgIH0KKworCisgICAgICByZXR1cm4gdmFsdWU7CisgICAgfTsKKworICAgIERyYWdnYWJsZS5wcm90b3R5cGUuX2JpbmRFdmVudCA9IGZ1bmN0aW9uKCBwdHIsIGV2ZW50VHlwZSwgaGFuZGxlciApeworICAgICAgdmFyIHNlbGYgPSB0aGlzOworCisgICAgIC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pb24oZXZlbnQpIHsgICAgICAgIAorICAgICAgICBpZihzZWxmLmlzLmRyYWcpIHsKKyAgICAgICAgICBldmVudC5zdG9wUHJvcGFnYXRpb24oKTsKKyAgICAgICAgICBldmVudC5wcmV2ZW50RGVmYXVsdCgpOworICAgICAgICAgIGlmICghc2VsZi5wYXJlbnQuZGlzYWJsZWQpIHsKKyAgICAgICAgICAgIHNlbGYuX21vdXNlbW92ZShldmVudCk7CisgICAgICAgICAgfSAgCisgICAgICAgIH0KKyAgICAgIH0pOworICAgICAgdGhpcy5fYmluZEV2ZW50KGRvY3VtZW50RWx0LCAiZG93biIsIGZ1bmN0aW9uKGV2ZW50KSB7CisgICAgICAgIGlmKHNlbGYuaXMuZHJhZykgeworICAgICAgICAgIGV2ZW50LnN0b3BQcm9wYWdhdGlvbigpOworICAgICAgICAgIGV2ZW50LnByZXZlbnREZWZhdWx0KCk7CisgICAgICAgIH0KKyAgICAgIH0pOworICAgICAgdGhpcy5fYmluZEV2ZW50KGRvY3VtZW50RWx0LCAidXAiLCBmdW5jdGlvbihldmVudCkgeyAgICAgICAgCisgICAgICAgIHNlbGYuX21vdXNldXAoZXZlbnQpOyAgICAgICAgCisgICAgICB9KTsKKworICAgICAgdGhpcy5fYmluZEV2ZW50KCB0aGlzLnB0ciwgImRvd24iLCBmdW5jdGlvbihldmVudCkgeworICAgICAgICBzZWxmLl9tb3VzZWRvd24oIGV2ZW50ICk7CisgICAgICAgIHJldHVybiBmYWxzZTsKKyAgICAgIH0pOworICAgICAgdGhpcy5fYmluZEV2ZW50KCB0aGlzLnB0ciwgInVwIiwgZnVuY3Rpb24oZXZlbnQpIHsKKyAgICAgICAgc2VsZi5fbW91c2V1cCggZXZlbnQgKTsKKyAgICAgIH0pOyAgICAgIAorICAgICAKKyAgICAgIHRoaXMuZXZlbnRzKCk7CisgICAgfTsKKworICAgIERyYWdnYWJsZS5wcm90b3R5cGUuX21vdXNlZG93biA9IGZ1bmN0aW9uKCBldnQgKXsKKyAgICAgIHRoaXMuaXMuZHJhZyA9IHRydWU7CisgICAgICB0aGlzLmlzLmNsaWNrZWQgPSBmYWxzZTsKKyAgICAgIHRoaXMuaXMubW91c2V1cCA9IGZhbHNlOyAgIAorCisgICAgICB2YXIgY29vcmRzID0gdGhpcy5fZ2V0UGFnZUNvb3JkcyggZXZ0ICk7CisgICAgICB0aGlzLmN4ID0gY29vcmRzLnggLSB0aGlzLnB0clswXS5vZmZzZXRMZWZ0OworICAgICAgdGhpcy5jeSA9IGNvb3Jkcy55IC0gdGhpcy5wdHJbMF0ub2Zmc2V0VG9wOworCisgICAgICBhbmd1bGFyLmV4dGVuZCh0aGlzLmQsIHsKKyAgICAgICAgbGVmdDogdGhpcy5wdHJbMF0ub2Zmc2V0TGVmdCwKKyAgICAgICAgdG9wOiB0aGlzLnB0clswXS5vZmZzZXRUb3AsCisgICAgICAgIHdpZHRoOiB0aGlzLnB0clswXS5jbGllbnRXaWR0aCwKKyAgICAgICAgaGVpZ2h0OiB0aGlzLnB0clswXS5jbGllbnRIZWlnaHQKKyAgICAgIH0pOworCisgICAgICBpZiggdGhpcy5vdXRlciAmJiB0aGlzLm91dGVyLmdldCgwKSApeworICAgICAgICB0aGlzLm91dGVyLmNzcyh7IGhlaWdodDogTWF0aC5tYXgodGhpcy5vdXRlci5oZWlnaHQoKSwgJChkb2N1bWVudC5ib2R5KS5oZWlnaHQoKSksIG92ZXJmbG93OiAiaGlkZGVuIiB9KTsKKyAgICAgIH0KKworICAgICAgdGhpcy5vbm1vdXNlZG93biggZXZ0ICk7CisgICAgfTsKKworICAgIERyYWdnYWJsZS5wcm90b3R5cGUuX21vdXNlbW92ZSA9IGZ1bmN0aW9uKCBldnQgKXsKKworICAgICAgaWYodGhpcy51aWQ9PTApCisgICAgICAgIHJldHVybjsKKworICAgICAgdGhpcy5pcy50b2NsaWNrID0gZmFsc2U7CisgICAgICB2YXIgY29vcmRzID0gdGhpcy5fZ2V0UGFnZUNvb3JkcyggZXZ0ICk7CisgICAgICB0aGlzLm9ubW91c2Vtb3ZlKCBldnQsIGNvb3Jkcy54IC0gdGhpcy5jeCwgY29vcmRzLnkgLSB0aGlzLmN5ICk7CisgICAgfTsgICAgCisKKyAgICBEcmFnZ2FibGUucHJvdG90eXBlLl9tb3VzZXVwID0gZnVuY3Rpb24oIGV2dCApeworICAgICAgdmFyIG9UaGlzID0gdGhpczsKKworICAgICAgaWYoIHRoaXMuaXMuZHJhZyApeworICAgICAgICB0aGlzLmlzLmRyYWcgPSBmYWxzZTsKKworICAgICAgICBpZiggdGhpcy5vdXRlciAmJiB0aGlzLm91dGVyLmdldCgwKSApIHsKKworICAgICAgICAgIGlmKCAkLmJyb3dzZXIubW96aWxsYSApeworICAgICAgICAgICAgdGhpcy5vdXRlci5jc3MoeyBvdmVyZmxvdzogImhpZGRlbiIgfSk7CisgICAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgIHRoaXMub3V0ZXIuY3NzKHsgb3ZlcmZsb3c6ICJ2aXNpYmxlIiB9KTsKKyAgICAgICAgICB9CisKKyAgICAgICAgICBpZiggJC5icm93c2VyLm1zaWUgJiYgJC5icm93c2VyLnZlcnNpb24gPT0gJzYuMCcgKXsKKyAgICAgICAgICAgIHRoaXMub3V0ZXIuY3NzKHsgaGVpZ2h0OiAiMTAwJSIgfSk7CisgICAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgIHRoaXMub3V0ZXIuY3NzKHsgaGVpZ2h0OiAiYXV0byIgfSk7CisgICAgICAgICAgfQorICAgICAgICB9CisKKyAgICAgICAgdGhpcy5vbm1vdXNldXAoIGV2dCApOworICAgICAgfQorICAgIH07CisKKyAgICByZXR1cm4gRHJhZ2dhYmxlOworICB9XSkKKy5mYWN0b3J5KCdzbGlkZXJQb2ludGVyJywgWydzbGlkZXJEcmFnZ2FibGUnLCAndXRpbHMnLCBmdW5jdGlvbihEcmFnZ2FibGUsIHV0aWxzKSB7CisKKyAgICAvKgorICAgICAgICBUaGUgTUlUIExpY2Vuc2UgKE1JVCkKKyAgICAgICAgQ29weXJpZ2h0IChjKSAyMDEzIEp1bGllbiBWYWzpcnkKKyAgICAqLworICAgIGZ1bmN0aW9uIFNsaWRlclBvaW50ZXIoKSB7CisgICAgICBEcmFnZ2FibGUuYXBwbHkodGhpcywgYXJndW1lbnRzKTsKKyAgICB9CisKKyAgICBTbGlkZXJQb2ludGVyLnByb3RvdHlwZSA9IG5ldyBEcmFnZ2FibGUoKTsKKworICAgIFNsaWRlclBvaW50ZXIucHJvdG90eXBlLm9uaW5pdCA9IGZ1bmN0aW9uKHB0ciwgaWQsIF9jb25zdHJ1Y3RvcikgeworICAgICAgdGhpcy51aWQgPSBpZDsKKyAgICAgIHRoaXMucGFyZW50ID0gX2NvbnN0cnVjdG9yOworICAgICAgdGhpcy52YWx1ZSA9IHt9OworICAgICAgdGhpcy5zZXR0aW5ncyA9IGFuZ3VsYXIuY29weShfY29uc3RydWN0b3Iuc2V0dGluZ3MpOworICAgIH07CisKKyAgICBTbGlkZXJQb2ludGVyLnByb3RvdHlwZS5vbm1vdXNlZG93biA9IGZ1bmN0aW9uKGV2dCkgeworICAgICAgCisgICAgICB2YXIgb2ZmID0gdXRpbHMub2Zmc2V0KHRoaXMucGFyZW50LmRvbU5vZGUpOworCisgICAgICB2YXIgb2Zmc2V0ID0geworICAgICAgICBsZWZ0OiBvZmYubGVmdCwKKyAgICAgICAgdG9wOiBvZmYudG9wLAorICAgICAgICB3aWR0aDogdGhpcy5wYXJlbnQuZG9tTm9kZVswXS5jbGllbnRXaWR0aCwKKyAgICAgICAgaGVpZ2h0OiB0aGlzLnBhcmVudC5kb21Ob2RlWzBdLmNsaWVudEhlaWdodAorICAgICAgfTsKKworICAgICAgdGhpcy5fcGFyZW50ID0geworICAgICAgICBvZmZzZXQ6IG9mZnNldCwKKyAgICAgICAgd2lkdGg6IG9mZnNldC53aWR0aCwKKyAgICAgICAgaGVpZ2h0OiBvZmZzZXQuaGVpZ2h0CisgICAgICB9OyAgICAgIAorCisgICAgICB0aGlzLnB0ci5hZGRDbGFzcygianNsaWRlci1wb2ludGVyLWhvdmVyIik7CisgICAgICB0aGlzLnNldEluZGV4T3ZlcigpOworICAgIH07CisKKyAgICBTbGlkZXJQb2ludGVyLnByb3RvdHlwZS5vbm1vdXNlbW92ZSA9IGZ1bmN0aW9uKGV2dCwgeCwgeSkgeworICAgICAgdmFyIGNvb3JkcyA9IHRoaXMuX2dldFBhZ2VDb29yZHMoIGV2dCApOyAKKworICAgICAgLy92YWwgaXMgdGhlIHBlcmNlbnQgd2hlcmUgdGhlIHNsaWRlciBwb2ludGVyIGlzIGxvY2F0ZWQKKyAgICAgIHZhciB2YWwgPSB0aGlzLmNhbGMoY29vcmRzLngpOworICAgICAgCisgICAgICBpZighdGhpcy5wYXJlbnQuc2V0dGluZ3Muc21vb3RoKXsKKworICAgICAgICB2YWwgPSB1dGlscy5yb3VuZFVwVG9TY2FsZSh2YWwsCisgICAgICAgICAgdGhpcy5wYXJlbnQuc2V0dGluZ3Muc2NhbGUsIAorICAgICAgICAgIHRoaXMucGFyZW50LnNldHRpbmdzLmN1dE9mZldpZHRoLAorICAgICAgICAgIHRoaXMucGFyZW50LnNldHRpbmdzLmN1dE9mZkluZGV4KTsKKworICAgICAgfQorCisgICAgICB2YXIgY3V0T2ZmV2lkdGggPSB0aGlzLnBhcmVudC5zZXR0aW5ncy5jdXRPZmZXaWR0aDsKKworICAgICAgdmFyIHZhbFByYyA9IHZhbCAgKyAoNC81MDAwKTsKKyAgICAKKyAgICAgIGlmKGN1dE9mZldpZHRoICYmIHZhbCA8IGN1dE9mZldpZHRoKQorICAgICAgICB2YWwgPSBjdXRPZmZXaWR0aDsKKworICAgICAgdGhpcy5fc2V0KHZhbCk7CisgICAgfTsKKworICAgIFNsaWRlclBvaW50ZXIucHJvdG90eXBlLm9ubW91c2V1cCA9IGZ1bmN0aW9uKGV2dCkgeworCisgICAgICBpZiggdGhpcy5zZXR0aW5ncy5jYWxsYmFjayAmJiBhbmd1bGFyLmlzRnVuY3Rpb24odGhpcy5zZXR0aW5ncy5jYWxsYmFjaykgKXsKKyAgICAgICAgdmFyIHZhbCA9IHRoaXMucGFyZW50LmdldFZhbHVlKCk7CisgICAgICAgIHRoaXMuc2V0dGluZ3MuY2FsbGJhY2suY2FsbCggdGhpcy5wYXJlbnQsIHZhbCk7CisgICAgICB9CisKKyAgICAgIHRoaXMucHRyLnJlbW92ZUNsYXNzKCJqc2xpZGVyLXBvaW50ZXItaG92ZXIiKTsKKyAgICB9OworCisgICAgU2xpZGVyUG9pbnRlci5wcm90b3R5cGUuc2V0SW5kZXhPdmVyID0gZnVuY3Rpb24oKSB7CisgICAgICB0aGlzLnBhcmVudC5zZXRQb2ludGVyc0luZGV4KDEpOworICAgICAgdGhpcy5pbmRleCgyKTsKKyAgICB9OworCisgICAgU2xpZGVyUG9pbnRlci5wcm90b3R5cGUuaW5kZXggPSBmdW5jdGlvbihpKSB7CisgICAgfTsKKworICAgIFNsaWRlclBvaW50ZXIucHJvdG90eXBlLmxpbWl0cyA9IGZ1bmN0aW9uKHgpIHsKKyAgICAgIHJldHVybiB0aGlzLnBhcmVudC5saW1pdHMoeCwgdGhpcyk7CisgICAgfTsKKworICAgIFNsaWRlclBvaW50ZXIucHJvdG90eXBlLmNhbGMgPSBmdW5jdGlvbihjb29yZHMpIHsKKyAgICAgICAgdmFyIGRpZmYgPSBjb29yZHMtdGhpcy5fcGFyZW50Lm9mZnNldC5sZWZ0OworICAgICAgICB2YXIgdmFsID0gdGhpcy5saW1pdHMoICAoZGlmZioxMDApL3RoaXMuX3BhcmVudC53aWR0aCk7CisgICAgICAgIHJldHVybiB2YWw7CisgICAgfTsKKworICAgIFNsaWRlclBvaW50ZXIucHJvdG90eXBlLnNldCA9IGZ1bmN0aW9uKHZhbHVlLCBvcHRfb3JpZ2luKSB7CisgICAgICB0aGlzLnZhbHVlLm9yaWdpbiA9IHRoaXMucGFyZW50LnJvdW5kKHZhbHVlKTsKKyAgICAgIHRoaXMuX3NldCh0aGlzLnBhcmVudC52YWx1ZVRvUHJjKHZhbHVlLHRoaXMpLCBvcHRfb3JpZ2luKTsKKyAgICB9OworCisgICAgU2xpZGVyUG9pbnRlci5wcm90b3R5cGUuX3NldCA9IGZ1bmN0aW9uKHByYywgb3B0X29yaWdpbikgeworICAgICAgaWYoIW9wdF9vcmlnaW4peworICAgICAgICB0aGlzLnZhbHVlLm9yaWdpbiA9IHRoaXMucGFyZW50LnByY1RvVmFsdWUocHJjKTsKKyAgICAgIH0KKyAgICAgIHRoaXMudmFsdWUucHJjID0gcHJjOworCisgICAgICAvL1NldHMgdGhlIGxvY2F0aW9uIG9mIHRoZSBTbGlkZXJQb2ludGVyCisgICAgICB0aGlzLnB0ci5jc3Moe2xlZnQ6cHJjKyclJ30pOworICAgICAgdGhpcy5wYXJlbnQucmVkcmF3KHRoaXMpOworICAgIH07CisKKyAgICByZXR1cm4gU2xpZGVyUG9pbnRlcjsKK31dKQorLmZhY3RvcnkoJ3NsaWRlcicsIFsnc2xpZGVyUG9pbnRlcicsICdzbGlkZXJDb25zdGFudHMnLCAndXRpbHMnLCBmdW5jdGlvbihTbGlkZXJQb2ludGVyLCBzbGlkZXJDb25zdGFudHMsIHV0aWxzKSB7CisKKyAgICAvKgorICAgICAgICBUaGUgTUlUIExpY2Vuc2UgKE1JVCkKKyAgICAgICAgQ29weXJpZ2h0IChjKSAyMDEzIEp1bGllbiBWYWzpcnkKKyAgICAqLworICAgIHZhciBjdXRPZmZEb207CisKKyAgICBmdW5jdGlvbiBTbGlkZXIoKSB7CisgICAgICByZXR1cm4gdGhpcy5pbml0LmFwcGx5KCB0aGlzLCBhcmd1bWVudHMgKTsKKyAgICB9CisKKyAgICBmdW5jdGlvbiBjaGFuZ2VDdXRPZmZXaWR0aCh3aWR0aCl7CisgICAgICBjdXRPZmZEb20uY3NzKCd3aWR0aCcsd2lkdGgpOworICAgIH07CisKKyAgICBTbGlkZXIucHJvdG90eXBlLmNoYW5nZUN1dE9mZldpZ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R0aGlzID0gdGhpczsKKworICAgICAgdGhpcy5kb21Ob2RlID0gdGVtcGxhdGVOb2RlOworCisgICAgICB2YXIgb2ZmID0gdXRpbHMub2Zmc2V0KHRoaXMuZG9tTm9kZSk7CisKKyAgICAgIHZhciBvZmZzZXQgPSB7CisgICAgICAgIGxlZnQ6IG9mZi5sZWZ0LAorICAgICAgICB0b3A6IG9mZi50b3AsCisgICAgICAgIHdpZHRoOiB0aGlzLmRvbU5vZGVbMF0uY2xpZW50V2lkdGgsCisgICAgICAgIGhlaWdodDogdGhpcy5kb21Ob2RlWzBdLmNsaWVudEhlaWdodAorICAgICAgfTsgICAgICAKKworICAgICAgdGhpcy5zaXplcyA9IHsgZG9tV2lkdGg6IHRoaXMuZG9tTm9kZVswXS5jbGllbnRXaWR0aCwgZG9tT2Zmc2V0OiBvZmZzZXQgfTsKKworICAgICAgYW5ndWxhci5leHRlbmQodGhpcy5vLCB7CisgICAgICAgIHBvaW50ZXJzOiB7fSwKKyAgICAgICAgbGFiZWxzOiB7CisgICAgICAgICAgMDogeyAgICAgICAgICAgIAorICAgICAgICAgICAgbyA6IGFuZ3VsYXIuZWxlbWVudCh0aGlzLmRvbU5vZGUuZmluZCgnZGl2JylbNV0pCisgICAgICAgICAgfSwKKyAgICAgICAgICAxOiB7ICAgICAgICAgICAgCisgICAgICAgICAgICBvIDogYW5ndWxhci5lbGVtZW50KHRoaXMuZG9tTm9kZS5maW5kKCdkaXYnKVs2XSkKKyAgICAgICAgICB9CisgICAgICAgIH0sCisgICAgICAgIGxpbWl0czogeyAgICAgICAgICAKKyAgICAgICAgICAwOiBhbmd1bGFyLmVsZW1lbnQodGhpcy5kb21Ob2RlLmZpbmQoJ2RpdicpWzNdKSwgICAgICAgICAgCisgICAgICAgICAgMTogYW5ndWxhci5lbGVtZW50KHRoaXMuZG9tTm9kZS5maW5kKCdkaXYnKVs1XSkKKyAgICAgICAgfQorICAgICAgfSk7CisKKyAgICAgIGFuZ3VsYXIuZXh0ZW5kK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ciwga2V5LCAkdGhpcyApOworCisgICAgICAgICAgdmFyIHByZXYgPSAkdGhpcy5zZXR0aW5ncy52YWx1ZS5zcGxpdCgnOycpW2tleS0xXTsKKyAgICAgICAgICBpZiggcHJldiAmJiBwYXJzZUludCh2YWx1ZSwgMTApIDwgcGFyc2VJbnQocHJldiwgMTAgKSkgdmFsdWUgPSBwcmV2OworCisgICAgICAgICAgdmFyIHZhbHVlMSA9IHZhbHVlIDwgJHRoaXMuc2V0dGluZ3MuZnJvbSA/ICR0aGlzLnNldHRpbmdzLmZyb20gOiB2YWx1ZTsKKyAgICAgICAgICB2YWx1ZTEgPSB2YWx1ZSA+ICR0aGlzLnNldHRpbmdzLnRvID8gJHRoaXMuc2V0dGluZ3MudG8gOiB2YWx1ZTsKKworICAgICAgICAgICR0aGlzLm8ucG9pbnRlcnNba2V5XS5zZXQoIHZhbHVlMSwgdHJ1ZSApOworCisgICAgICAgICAgaWYgKGtleSA9PT0gMCkgeworICAgICAgICAgICAgJHRoaXMuZG9tTm9kZS5iaW5kKCdtb3VzZWRvd24nLCAkdGhpcy5jbGlja0hhbmRsZXIuYXBwbHkoJHRoaXMpKTsKKyAgICAgICAgICB9CisgICAgICAgIH0KKyAgICAgIH0pOworCisgICAgICB0aGlzLm8udmFsdWUgPSBhbmd1bGFyLmVsZW1lbnQodGhpcy5kb21Ob2RlLmZpbmQoImkiKVsyXSk7CisgICAgICB0aGlzLmlzLmluaXQgPSB0cnVlOworCisgICAgICBhbmd1bGFyLmZvckVhY2godGhpcy5vLnBvaW50ZXJzLCBmdW5jdGlvbihwb2ludGVyLCBrZXkpeworICAgICAgICAkdGhpcy5yZWRyYXcocG9pbnRlcik7CisgICAgICB9KTsKKworICAgIH07CisKKyAgICBTbGlkZXIucHJvdG90eXBlLmNsaWNrSGFuZGxlciA9IGZ1bmN0aW9uKCkgeworCisgICAgICB2YXIgc2VsZiA9IHRoaXM7CisgICAgIAorICAgICAgcmV0dXJuIGZ1bmN0aW9uKGV2dCkgeworCisgICAgICAgIGlmIChzZWxmLmRpc2FibGVkKQorICAgICAgICAgIHJldHVybjsKKworICAgICAgICB2YXIgY2xhc3NOYW1lID0gZXZ0LnRhcmdldC5jbGFzc05hbWU7CisgICAgICAgIHZhciB0YXJnZXRJZHggPSAwOworCisgICAgICAgIGlmIChjbGFzc05hbWUuaW5kZXhPZignanNsaWRlci1wb2ludGVyLXRvJykgPiAwKSB7CisgICAgICAgICAgdGFyZ2V0SWR4ID0gMTsKKyAgICAgICAgfQorCisgICAgICAgIHZhciBfb2ZmID0gdXRpbHMub2Zmc2V0KHNlbGYuZG9tTm9kZSk7CisKKyAgICAgICAgdmFyIG9mZnNldCA9IHsKKyAgICAgICAgICBsZWZ0OiBfb2ZmLmxlZnQsCisgICAgICAgICAgdG9wOiBfb2ZmLnRvcCwKKyAgICAgICAgICB3aWR0aDogc2VsZi5kb21Ob2RlWzBdLmNsaWVudFdpZHRoLAorICAgICAgICAgIGhlaWdodDogc2VsZi5kb21Ob2RlWzBdLmNsaWVudEhlaWdodAorICAgICAgICB9OyAgICAgICAgICAgICAgCisKKyAgICAgICAgdGFyZ2V0SWR4ID0gMTsKKyAgICAgICAgdmFyIHRhcmdldFB0ciA9IHNlbGYuby5wb2ludGVyc1t0YXJnZXRJZHhdOworCisgICAgICAgIHRhcmdldFB0ci5fcGFyZW50ID0geyBvZmZzZXQ6IG9mZnNldCwgd2lkdGg6IG9mZnNldC53aWR0aCwgaGVpZ2h0OiBvZmZzZXQuaGVpZ2h0fTsKKyAgICAgICAgdGFyZ2V0UHRyLl9tb3VzZW1vdmUoZXZ0KTsKKyAgICAgICAgdGFyZ2V0UHRyLm9ubW91c2V1cCgpOworCisgICAgICAgIHJldHVybiBmYWxzZTsKKyAgICAgIH07CisKKyAgICB9OworCisgICAgU2xpZGVyLnByb3RvdHlwZS5kaXNhYmxlID0gZnVuY3Rpb24oYm9vbCkgeyAgIAorICAgICAgdGhpcy5kaXNhYmxlZCA9IGJvb2w7CisgICAgfTsgICAgCisKKyAgICBTbGlkZXIucHJvdG90eXBlLm5pY2UgPSBmdW5jdGlvbiggdmFsdWUgKXsKKyAgICAgIHJldHVybiB2YWx1ZTsKKyAgICB9OworCisgICAgU2xpZGVyLnByb3RvdHlwZS5vbnN0YXRlY2hhbmdlID0gZnVuY3Rpb24oKXt9OworCisgICAgU2xpZGVyLnByb3RvdHlwZS5saW1pdHMgPSBmdW5jdGlvbiggeCwgcG9pbnRlciApeworCisgICAgICBpZiggIXRoaXMuc2V0dGluZ3Muc21vb3RoICl7CisgICAgICAgIHZhciBzdGVwID0gdGhpcy5zZXR0aW5ncy5zdGVwKjEwMCAvICggdGhpcy5zZXR0aW5ncy5pbnRlcnZhbCApOworICAgICAgICB4ID0gTWF0aC5yb3VuZCggeC9zdGVwICkgKiBzdGVwOworICAgICAgfQorCisgICAgICB2YXIgYW5vdGhlciA9IHRoaXMuby5wb2ludGVyc1sxLXBvaW50ZXIudWlkXTsKKyAgICAgIGlmKCBhbm90aGVyICYmIHBvaW50ZXIudWlkICYmIHggPCBhbm90aGVyLnZhbHVlLnByYyApIAorICAgICAgICB4ID0gYW5vdGhlci52YWx1ZS5wcmM7CisgICAgICBpZiggYW5vdGhlciAmJiAhcG9pbnRlci51aWQgJiYgeCA+IGFub3RoZXIudmFsdWUucHJjICkgCisgICAgICAgIHggPSBhbm90aGVyLnZhbHVlLnByYzsKKworICAgICAgaWYoIHggPCAwICkgeCA9IDA7CisgICAgICBpZiggeCA+IDEwMCApIHggPSAxMDA7CisKKyAgICAgIHZhciB2YWwgPSBNYXRoLnJvdW5kKCB4KjEwKSAvIDEwOworICAgICAgcmV0dXJuIHZhbDsKKyAgICB9OworCisgICAgU2xpZGVyLnByb3RvdHlwZS5zZXRQb2ludGVyc0luZGV4ID0gZnVuY3Rpb24oIGkgKXsKKyAgICAgIGFuZ3VsYXIuZm9yRWFjaCh0aGlzLmdldFBvaW50ZXJzKCksIGZ1bmN0aW9uKHBvaW50ZXIsIGkpIHsKKyAgICAgICAgcG9pbnRlci5pbmRleCggaSApOworICAgICAgfSk7CisgICAgfTsKKworICAgIFNsaWRlci5wcm90b3R5cGUuZ2V0UG9pbnRlcnMgPSBmdW5jdGlvbigpeworICAgICAgcmV0dXJuIHRoaXMuby5wb2ludGVyczsKKyAgICB9OworCisgICAgU2xpZGVyLnByb3RvdHlwZS5vbnJlc2l6ZSA9IGZ1bmN0aW9uKCl7CisgICAgICB2YXIgc2VsZiA9IHRoaXM7CisKKyAgICAgIHRoaXMuc2l6ZXMgPSB7CisgICAgICAgIGRvbVdpZHRoOiB0aGlzLmRvbU5vZGVbMF0uY2xpZW50V2lkdGgsCisgICAgICAgIGRvbUhlaWdodDogdGhpcy5kb21Ob2RlWzBdLmNsaWVudEhlaWdodCwKKyAgICAgICAgZG9tT2Zmc2V0OiB7CisgICAgICAgICAgbGVmdDogdGhpcy5kb21Ob2RlWzBdLm9mZnNldExlZnQsCisgICAgICAgICAgdG9wOiB0aGlzLmRvbU5vZGVbMF0ub2Zmc2V0VG9wLAorICAgICAgICAgIHdpZHRoOiB0aGlzLmRvbU5vZGVbMF0uY2xpZW50V2lkdGgsCisgICAgICAgICAgaGVpZ2h0OiB0aGlzLmRvbU5vZGVbMF0uY2xpZW50SGVpZ2h0CisgICAgICAgIH0KKyAgICAgIH07CisKKyAgICAgIGFuZ3VsYXIuZm9yRWFjaCh0aGlzLm8ucG9pbnRlcnMsIGZ1bmN0aW9uKHB0ciwga2V5KSB7CisgICAgICAgIHNlbGYucmVkcmF3KHB0cik7CisgICAgICB9KTsKKyAgICB9OworCisgICAgU2xpZGVyLnByb3RvdHlwZS51cGRhdGUgPSBmdW5jdGlvbigpeworICAgICAgdGhpcy5vbnJlc2l6ZSgpOworICAgICAgdGhpcy5kcmF3U2NhbGUoKTsKKyAgICB9OworCisgICAgU2xpZGVyLnByb3RvdHlwZS5kcmF3U2NhbGUgPSBmdW5jdGlvbigpeworICAgIH07CisKKyAgICBTbGlkZXIucHJvdG90eXBlLnJlZHJhdyA9IGZ1bmN0aW9uKCBwb2ludGVyICl7CisKKyAgICAgIGlmKCF0aGlzLnNldHRpbmdzLnNtb290aCl7CisKKyAgICAgICAgdmFyIG5ld01vdXNlUHJjID0gdXRpbHMucm91bmRVcFRvU2NhbGUocG9pbnRlci52YWx1ZS5wcmMsCisgICAgICAgICAgdGhpcy5zZXR0aW5ncy5zY2FsZSwgCisgICAgICAgICAgdGhpcy5zZXR0aW5ncy5jdXRPZmZXaWR0aCwKKyAgICAgICAgICB0aGlzLnNldHRpbmdzLmN1dE9mZkluZGV4KTsKKworICAgICAgICBwb2ludGVyLnZhbHVlLm9yaWdpbiA9IG5ld01vdXNlUHJjOworICAgICAgICBwb2ludGVyLnZhbHVlLnByYyA9IG5ld01vdXNlUHJjOworICAgICAgfQorCisgICAgICBpZiggIXRoaXMuaXMuaW5pdCApIAorICAgICAgICByZXR1cm4gZmFsc2U7CisKKyAgICAgIHRoaXMuc2V0VmFsdWUoKTsKKworICAgICAgdmFyIHdpZHRoID0gdGhpcy5vLnBvaW50ZXJzWzFdLnZhbHVlLnByYzsKKyAgICAgIHZhciBuZXdQb3MgPSB7bGVmdDonMCUnLCB3aWR0aDp3aWR0aCArICclJ307CisKKyAgICAgIHRoaXMuby52YWx1ZS5jc3MobmV3UG9zKTsKKworICAgICAgdmFyIGh0bWxWYWx1ZSA9IHRoaXMubmljZShwb2ludGVyLnZhbHVlLm9yaWdpbik7CisgICAgICB2YXIgc2NhbGVkRGltZW5zaW9uPXRoaXMuc2V0dGluZ3MuZmlyc3REaW1lbnNpb247CisKKyAgICAgIGlmKHRoaXMuc2V0dGluZ3Muc3RlcFdpdGhEaWZmZXJlbnRTY2FsZSAmJiAhdGhpcy5zZXR0aW5ncy5zbW9vdGgpeworICAgICAgICBodG1sVmFsdWUgPSB1dGlscy52YWx1ZUZvckRpZmZlcmVudFNjYWxlKHRoaXMuc2V0dGluZ3MuZnJvbSwKKyAgICAgICAgIHRoaXMuc2V0dGluZ3MudG8saHRtbFZ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ZWNpbWFsUGxhY2VzID09IDApeworICAgICAgICBpZih0eXBlb2YgaHRtbFZhbHVlID09ICdudW1iZXInKXsKKyAgICAgICAgICAgIGh0bWxWYWx1ZSA9IGh0bWxWYWx1ZS50b0ZpeGVkKHRoaXMuc2V0dGluZ3MuZGVjaW1hbFBsYWNlcyk7CisgICAgICAgIH0KKyAgICAgIH0KKworICAgICAgdGhpcy5vLmxhYmVsc1twb2ludGVyLnVpZF0udmFsdWUuaHRtbChodG1sVmFsdWUrJyAnK3NjYWxlZERpbWVuc2lvbik7CisKKyAgICAgIC8vVG9wIHRvb2x0aXAgbGFiZWwKKyAgICAgIHRoaXMucmVkcmF3TGFiZWxzKHBvaW50ZXIpOworICAgIH07CisKKyAgICBTbGlkZXIucHJvdG90eXBlLnJlZHJhd0xhYmVscyA9IGZ1bmN0aW9uKCBwb2ludGVyICkgeworCisgICAgICBmdW5jdGlvbiBzZXRQb3NpdGlvbiggbGFiZWwsIHNpemVzLCBwcmMgKXsKKyAgICAgICAgc2l6ZXMubWFyZ2luID0gLXNpemVzLmxhYmVsLzI7CisgICAgICAgIHZhciBkb21TaXplID0gc2VsZi5zaXplcy5kb21XaWR0aDsKKworICAgICAgICB2YXIgbGFiZWxfbGVmdCA9IHNpemVzLmJvcmRlciArIHNpemVzLm1hcmdpbjsKKyAgICAgICAgaWYoIGxhYmVsX2xlZnQgPCAwICkKKyAgICAgICAgICBzaXplcy5tYXJnaW4gLT0gbGFiZWxfbGVmdDsKKworICAgICAgICBpZiggc2l6ZXMuYm9yZGVyK3NpemVzLmxhYmVsIC8gMiA+IGRvbVNpemUgKXsKKyAgICAgICAgICBzaXplcy5tYXJnaW4gPSAwOworICAgICAgICAgIHNpemVzLnJpZ2h0ID0gdHJ1ZTsKKyAgICAgICAgfSBlbHNlCisgICAgICAgIHNpemVzLnJpZ2h0ID0gZmFsc2U7CisgICAgICAgIAorICAgICAgICAvL0FkanVzdCB0aGUgdG9vbHRpcCBsb2NhdGlvbgorICAgICAgICBzaXplcy5tYXJnaW4gPSAtKChsYWJlbC5vWzBdLmNsaWVudFdpZHRoLzIpIC0gbGFiZWwub1swXS5jbGllbnRXaWR0aC8yMCk7CisKKyAgICAgICAgbGFiZWwuby5jc3MoeyBsZWZ0OiBwcmMgKyAiJSIsIG1hcmdpbkxlZnQ6IHNpemVzLm1hcmdpbiwgcmlnaHQ6ICJhdXRvIiB9KTsKKworICAgICAgICBpZiggc2l6ZXMucmlnaHQgKSAKKyAgICAgICAgICBsYWJlbC5vLmNzcyh7IGxlZnQ6ICJhdXRvIiwgcmlnaHQ6IDAgfSk7CisKKyAgICAgICAgcmV0dXJuIHNpemVzOworICAgICAgfQorCisgICAgICB2YXIgc2VsZiA9IHRoaXM7CisgICAgICB2YXIgbGFiZWwgPSB0aGlzLm8ubGFiZWxzW3BvaW50ZXIudWlkXTsKKyAgICAgIHZhciBwcmMgPSBwb2ludGVyLnZhbHVlLnByYzsKKworICAgICAgdmFyIHNpemVzID0geworICAgICAgICBsYWJlbDogbGFiZWwub1swXS5vZmZzZXRXaWR0aCwKKyAgICAgICAgcmlnaHQ6IGZhbHNlLAorICAgICAgICBib3JkZXI6ICggcHJjICogZG9tU2l6ZSApIC8gMTAwCisgICAgICB9OworCisgICAgICB2YXIgYW5vdGhlcl9sYWJlbCA9IG51bGw7CisgICAgICB2YXIgYW5vdGhlciA9IG51bGw7CisKKyAgICAgIGlmICghdGhpcy5zZXR0aW5ncy5zaW5nbGUpeworICAgICAgICBhbm90aGVyID0gdGhpcy5vLnBvaW50ZXJzWzEtcG9pbnRlci51aWRdOworICAgICAgICBhbm90aGVyX2xhYmVsID0gdGhpcy5vLmxhYmVsc1thbm90aGVyLnVpZF07CisKKyAgICAgICAgc3dpdGNoKCBwb2ludGVyLnVpZCApeworICAgICAgICAgIGNhc2UgMDoKKyAgICAgICAgICBpZiggc2l6ZXMuYm9yZGVyK3NpemVzLmxhYmVsIC8gMiA+IGFub3RoZXJfbGFiZWwub1swXS5vZmZzZXRMZWZ0LXRoaXMuc2l6ZXMuZG9tT2Zmc2V0LmxlZnQgKXsKKyAgICAgICAgICAgIGFub3RoZXJfbGFiZWwuby5jc3MoeyB2aXNpYmlsaXR5OiAiaGlkZGVuIiB9KTsKKworICAgICAgICAgICAgYW5vdGhlcl9sYWJlbC52YWx1ZS5odG1sKCB0aGlzLm5pY2UoIGFub3RoZXIudmFsdWUub3JpZ2luICkgKTsKKworICAgICAgICAgICAgbGFiZWwuby5jc3MoeyB2aXNpYmlsaXR5OiAiaGlkZGVuIiB9KTsKKworICAgICAgICAgICAgcHJjID0gKCBhbm90aGVyLnZhbHVlLnByYyAtIHByYyApIC8gMiArIHByYzsKKyAgICAgICAgICAgIGlmKCBhbm90aGVyLnZhbHVlLnByYyAhPSBwb2ludGVyLnZhbHVlLnByYyApeworICAgICAgICAgICAgICBsYWJlbC52YWx1ZS5odG1sKCB0aGlzLm5pY2UocG9pbnRlci52YWx1ZS5vcmlnaW4pICsgIiZuYnNwOyZuZGFzaDsmbmJzcDsiICsgdGhpcy5uaWNlKGFub3RoZXIudmFsdWUub3JpZ2luKSApOworICAgICAgICAgICAgICAKKyAgICAgICAgICAgICAgc2l6ZXMubGFiZWwgPSBsYWJlbC5vWzBdLmNsaWVudFdpZHRoOworICAgICAgICAgICAgICBzaXplcy5ib3JkZXIgPSAoIHByYyAqIGRvbVNpemUgKSAvIDEwMDsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgYW5vdGhlcl9sYWJlbC5vLmNzcyh7IHZpc2liaWxpdHk6ICJ2aXNpYmxlIiB9KTsKKyAgICAgICAgICB9CisgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgY2FzZSAxOgorICAgICAgICAgIGlmKCBzaXplcy5ib3JkZXIgLSBzaXplcy5sYWJlbCAvIDIgPCBhbm90aGVyX2xhYmVsLm9bMF0ub2Zmc2V0TGVmdCAtIHRoaXMuc2l6ZXMuZG9tT2Zmc2V0LmxlZnQgKyBhbm90aGVyX2xhYmVsLm9bMF0uY2xpZW50V2lkdGggKXsKKyAgICAgICAgICAgIGFub3RoZXJfbGFiZWwuby5jc3MoeyB2aXNpYmlsaXR5OiAiaGlkZGVuIiB9KTsKKyAgICAgICAgICAgIGFub3RoZXJfbGFiZWwudmFsdWUuaHRtbCggdGhpcy5uaWNlKGFub3RoZXIudmFsdWUub3JpZ2luKSApOworCisgICAgICAgICAgICBsYWJlbC5vLmNzcyh7IHZpc2liaWxpdHk6ICJ2aXNpYmxlIiB9KTsKKworICAgICAgICAgICAgcHJjID0gKCBwcmMgLSBhbm90aGVyLnZhbHVlLnByYyApIC8gMiArIGFub3RoZXIudmFsdWUucHJjOworCisgICAgICAgICAgICBpZiggYW5vdGhlci52YWx1ZS5wcmMgIT0gcG9pbnRlci52YWx1ZS5wcmMgKXsKKyAgICAgICAgICAgICAgbGFiZWwudmFsdWUuaHRtbCggdGhpcy5uaWNlKGFub3RoZXIudmFsdWUub3JpZ2luKSArICImbmJzcDsmbmRhc2g7Jm5ic3A7IiArIHRoaXMubmljZShwb2ludGVyLnZhbHVlLm9yaWdpbikgKTsKKyAgICAgICAgICAgICAgc2l6ZXMubGFiZWwgPSBsYWJlbC5vWzBdLmNsaWVudFdpZHRoOworICAgICAgICAgICAgICBzaXplcy5ib3JkZXIgPSAoIHByYyAqIGRvbVNpemUgKSAvIDEwMDsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgYW5vdGhlcl9sYWJlbC5vLmNzcyh7IHZpc2liaWxpdHk6ICJ2aXNpYmxlIiB9KTsKKyAgICAgICAgICB9CisgICAgICAgICAgYnJlYWs7CisgICAgICAgIH0KKyAgICAgIH0KKworICAgICAgc2l6ZXMgPSBzZXRQb3NpdGlvbiggbGFiZWwsIHNpemVzLCBwcmMgKTsKKworICAgICAgdmFyIGRvbVNpemUgPSBzZWxmLnNpemVzLmRvbVdpZHRoOworCisgICAgICAvL1RoaXMgaXMgdGhlIDB0aCBwb2ludGVyCisgICAgICBpZiggYW5vdGhlcl9sYWJlbCApeworCisgICAgICAgIHNpemVzID0geworICAgICAgICAgIGxhYmVsOiBhbm90aGVyX2xhYmVsLm9bMF0uY2xpZW50V2lkdGgsCisgICAgICAgICAgcmlnaHQ6IGZhbHNlLAorICAgICAgICAgIGJvcmRlcjogKCBhbm90aGVyLnZhbHVlLnByYyAqIHRoaXMuc2l6ZXMuZG9tV2lkdGggKSAvIDEwMAorICAgICAgICB9OworCisgICAgICAgIHNpemVzID0gc2V0UG9zaXRpb24oIGFub3RoZXJfbGFiZWwsIHNpemVzLCBhbm90aGVyLnZhbHVlLnByYyApOworICAgICAgfQorICAgIH07CisKKyAgICBTbGlkZXIucHJvdG90eXBlLnJlZHJhd0xpbWl0cyA9IGZ1bmN0aW9uKCkgeworCisgICAgICBpZiggdGhpcy5zZXR0aW5ncy5saW1pdHMgKSB7CisKKyAgICAgICAgdmFyIGxpbWl0cyA9IFsgdHJ1ZSwgdHJ1ZSBdOworCisgICAgICAgIGZvciggdmFyIGtleSBpbiB0aGlzLm8ucG9pbnRlcnMgKXsKKworICAgICAgICAgIGlmKCAhdGhpcy5zZXR0aW5ncy5zaW5nbGUgfHwga2V5ID09PSAwICl7CisKKyAgICAgICAgICAgIHZhciBwb2ludGVyID0gdGhpcy5vLnBvaW50ZXJzW2tleV07CisgICAgICAgICAgICB2YXIgbGFiZWwgPSB0aGlzLm8ubGFiZWxzW3BvaW50ZXIudWlkXTsKKyAgICAgICAgICAgIHZhciBsYWJlbF9sZWZ0ID0gbGFiZWwub1swXS5vZmZzZXRMZWZ0IC0gdGhpcy5zaXplcy5kb21PZmZzZXQubGVmdDsKKworICAgICAgICAgICAgdmFyIGxpbWl0ID0gdGhpcy5vLmxpbWl0c1swXTsKKyAgICAgICAgICAgIGlmKCBsYWJlbF9sZWZ0IDwgbGltaXRbMF0uY2xpZW50V2lkdGggKQorICAgICAgICAgICAgICBsaW1pdHNbMF0gPSBmYWxzZTsKKworICAgICAgICAgICAgbGltaXQgPSB0aGlzLm8ubGltaXRzWzFdOworICAgICAgICAgICAgaWYoIGxhYmVsX2xlZnQgKyBsYWJlbC5vWzBdLmNsaWVudFdpZHRoID4gdGhpcy5zaXplcy5kb21XaWR0aCAtIGxpbWl0WzBdLmNsaWVudFdpZHRoICkKKyAgICAgICAgICAgICAgbGltaXRzWzFdID0gZmFsc2U7CisgICAgICAgICAgfQorICAgICAgICB9CisKKyAgICAgICAgZm9yKCB2YXIgaT0wOyBpIDwgbGltaXRzLmxlbmd0aDsgaSsrICl7CisgICAgICAgICAgaWYoIGxpbWl0c1tpXSApIAorICAgICAgICAgICAgYW5ndWxhci5lbGVtZW50KHRoaXMuby5saW1pdHNbaV0pLmFkZENsYXNzKCJhbmltYXRlLXNob3ciKTsgICAgICAgICAgCisgICAgICAgICAgZWxzZQorICAgICAgICAgICAgYW5ndWxhci5lbGVtZW50KHRoaXMuby5saW1pdHNbaV0pLmFkZENsYXNzKCJhbmltYXRlLWhpZGRlIik7ICAgICAgICAgIAorICAgICAgICB9CisgICAgICB9CisgICAgfTsKKworICAgIFNsaWRlci5wcm90b3R5cGUuc2V0VmFsdWUgPSBmdW5jdGlvbigpeworICAgICAgdmFyIHZhbHVlID0gdGhpcy5nZXRWYWx1ZSgpOworICAgICAgdGhpcy5pbnB1dE5vZGUuYXR0ciggInZhbHVlIiwgdmFsdWUgKTsKKyAgICAgIHRoaXMub25zdGF0ZWNoYW5nZS5jYWxsKCB0aGlzLCB2YWx1ZSwgdGhpcy5pbnB1dE5vZGUgKTsKKyAgICB9OworCisgICAgU2xpZGVyLnByb3RvdHlwZS5nZXRWYWx1ZSA9IGZ1bmN0aW9uKCl7CisgICAgICBpZighdGhpcy5pcy5pbml0KSAKKyAgICAgICAgcmV0dXJuIGZhbHNlOworCisgICAgICB2YXIgJHRoaXMgPSB0aGlzOworCisgICAgICB2YXIgdmFsdWUgPSAiIjsKKyAgICAgIGFuZ3VsYXIuZm9yRWFjaCggdGhpcy5vLnBvaW50ZXJzLCBmdW5jdGlvbihwb2ludGVyLCBrZXkpeworICAgICAgICBpZiggcG9pbnRlci52YWx1ZS5wcmMgIT09IHVuZGVmaW5lZCAmJiAhaXNOYU4ocG9pbnRlci52YWx1ZS5wcmMpICkgeworCisgICAgICAgICAgdmFyIHBvaW50ZXJQcmMgPSBwb2ludGVyLnZhbHVlLnByYzsKKyAgICAKKyAgICAgICAgICB2YXIgbXlWYWx1ZSA9ICAkdGhpcy5wcmNUb1ZhbHVlKHBvaW50ZXJQcmMpOworCisgICAgICAgICAgaWYoISR0aGlzLnNldHRpbmdzLnNtb290aCl7CisgICAgICAgICAgICB2YXIgbXlWYWx1ZSA9IHV0aWxzLnZhbHVlRm9yRGlmZmVyZW50U2NhbGUoJHRoaXMuc2V0dGluZ3MuZnJvbSwgCisgICAgICAgICAgICAkdGhpcy5zZXR0aW5ncy50bywgCisgICAgICAgICAgICBwb2ludGVyUHJjLAorICAgICAgICAgICAgJHRoaXMuc2V0dGluZ3MucHJjVG9WYWx1ZU1hcHBlcik7CisgICAgICAgICB9CisKKyAgICAgICAgICB2YWx1ZSArPSAoa2V5ID4gMCA/ICI7IiA6ICIiKSArbXlWYWx1ZTsKKyAgICAgICAgfQorICAgICAgfSk7CisKKyAgICAgIAorICAgICAgcmV0dXJuIHZhbHVlOworICAgIH07CisKKyAgICBTbGlkZXIucHJvdG90eXBlLmdldFByY1ZhbHVlID0gZnVuY3Rpb24oKXsKKyAgICAgIGlmKCF0aGlzLmlzLmluaXQpIHJldHVybiBmYWxzZTsKKyAgICAgIHZhciAkdGhpcyA9IHRoaXM7CisKKyAgICAgIHZhciB2YWx1ZSA9ICIiOworICAgICAgJC5lYWNoKCB0aGlzLm8ucG9pbnRlcnMsIGZ1bmN0aW9uKGkpeworICAgICAgICBpZiggdGhpcy52YWx1ZS5wcmMgIT09IHVuZGVmaW5lZCAmJiAhaXNOYU4odGhpcy52YWx1ZS5wcmMpICkKKyAgICAgICAgIHZhbHVlICs9IChpID4gMCA/ICI7IiA6ICIiKSArIHRoaXMudmFsdWUucHJjOworICAgICAgfSk7CisgICAgICByZXR1cm4gdmFsdWU7CisgICAgfTsKKworICAgIFNsaWRlci5wcm90b3R5cGUucHJjVG9WYWx1ZSA9IGZ1bmN0aW9uKCBwcmMgKXsKKyAgICAgIHZhciB2YWx1ZTsKKyAgICAgIGlmKCB0aGlzLnNldHRpbmdzLmhldGVyb2dlbmVpdHkgJiYgdGhpcy5zZXR0aW5ncy5oZXRlcm9nZW5laXR5Lmxlbmd0aCA+IDAgKXsKKyAgICAgICAgdmFyIGggPSB0aGlzLnNldHRpbmdzLmhldGVyb2dlbmVpdHk7CisKKyAgICAgICAgdmFyIF9zdGFydCA9IDA7CisgICAgICAgIHZhciBfZnJvbSA9IHRoaXMuc2V0dGluZ3MuZnJvbTsKKworICAgICAgICBmb3IoIHZhciBpPTA7IGkgPD0gaC5sZW5ndGg7IGkrKyApeworICAgICAgICAgIHZhciB2OworICAgICAgICAgIGlmKCBoW2ldICkgCisgICAgICAgICAgICB2ID0gaFtpXS5zcGxpdCgiLyIpOworICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgIHYgPSBbMTAwLCB0aGlzLnNldHRpbmdzLnRvXTsgICAgICAgIAorCisgICAgICAgICAgaWYoIHByYyA+PSBfc3RhcnQgJiYgcHJjIDw9IHZbMF0gKSB7CisgICAgICAgICAgICB2YWx1ZSA9IF9mcm9tICsgKCAocHJjLV9zdGFydCkgKiAodlsxXS1fZnJvbSkgKSAvICh2WzBdLV9zdGFydCk7CisgICAgICAgICAgfQorCisgICAgICAgICAgX3N0YXJ0ID0gdlswXTsKKyAgICAgICAgICBfZnJvbSA9IHZbMV07CisgICAgICAgIH0KKyAgICAgIH0gCisgICAgICBlbHNlIHsKKyAgICAgICAgdmFsdWUgPSB0aGlzLnNldHRpbmdzLmZyb20gKyAoIHByYyAqIHRoaXMuc2V0dGluZ3MuaW50ZXJ2YWwgKSAvIDEwMDsKKyAgICAgIH0gICAKKworICAgICAgdmFyIHJvdW5kZWRWYWx1ZSA9IHRoaXMucm91bmQodmFsdWUpOworICAgICAgcmV0dXJuIHJvdW5kZWRWYWx1ZTsKKyAgICB9OworCisgICAgU2xpZGVyLnByb3RvdHlwZS52YWx1ZVRvUHJjID0gZnVuY3Rpb24oIHZhbHVlLCBwb2ludGVyICl7CisKKyAgICAgIHZhciBwcmM7CisgICAgICBpZiggdGhpcy5zZXR0aW5ncy5oZXRlcm9nZW5laXR5ICYmIHRoaXMuc2V0dGluZ3MuaGV0ZXJvZ2VuZWl0eS5sZW5ndGggPiAwICl7CisgICAgICAgIHZhciBoID0gdGhpcy5zZXR0aW5ncy5oZXRlcm9nZW5laXR5OworCisgICAgICAgIHZhciBfc3RhcnQgPSAwOworICAgICAgICB2YXIgX2Zyb20gPSB0aGlzLnNldHRpbmdzLmZyb207CisKKyAgICAgICAgZm9yICh2YXIgaT0wOyBpIDw9IGgubGVuZ3RoOyBpKyspIHsKKyAgICAgICAgICB2YXIgdjsKKyAgICAgICAgICBpZihoW2ldKQorICAgICAgICAgICAgdiA9IGhbaV0uc3BsaXQoIi8iKTsKKyAgICAgICAgICBlbHNlCisgICAgICAgICAgICB2ID0gWzEwMCwgdGhpcy5zZXR0aW5ncy50b107ICAgICAgICAKKworICAgICAgICAgIGlmKHZhbHVlID49IF9mcm9tICYmIHZhbHVlIDw9IHZbMV0peworICAgICAgICAgICAgcHJjID0gcG9pbnRlci5saW1pdHMoX3N0YXJ0ICsgKHZhbHVlLV9mcm9tKSoodlswXS1fc3RhcnQpLyh2WzFdLV9mcm9tKSk7CisgICAgICAgICAgfQorCisgICAgICAgICAgX3N0YXJ0ID0gdlswXTsgX2Zyb20gPSB2WzFdOworICAgICAgICB9CisKKyAgICAgIH0gZWxzZSB7CisgICAgICAgIHByYyA9IHBvaW50ZXIubGltaXRzKCh2YWx1ZS10aGlzLnNldHRpbmdzLmZyb20pKjEwMC90aGlzLnNldHRpbmdzLmludGVydmFsKTsKKyAgICAg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ICAgcmV0dXJuIHsKKyAgICAgICAgICByZXN0cmljdCA6ICdBRScsCisgICAgICAgICAgcmVxdWlyZTogJz9uZ01vZGVsJywKKyAgICAgICAgICBzY29wZTogeyAKKyAgICAgICAgICAgIG9wdGlvbnM6Jz0nLAorICAgICAgICAgICAgY3V0T2ZmOiAnPScgCisgICAgICAgICAgfSwKKyAgICAgICAgICBwcmlvcml0eTogMSwKKyAgICAgICAgICB0ZW1wbGF0ZVVybDogdGVtcGxhdGVVcmwsCisgICAgICAgICAgbGluayA6IGZ1bmN0aW9uKHNjb3BlLCBlbGVtZW50LCBhdHRycywgbmdNb2RlbCkgeworICAgICAgICAgICAgaWYoIW5nTW9kZWwpIHJldHVybjsKKworICAgICAgICAgIHNjb3BlLm1haW5TbGlkZXJDbGFzcyA9ICdzdGVwLXNsaWRlcic7CisKKyAgICAgICAgICBlbGVtZW50LmFmdGVyKGNvbXBpbGUodGVtcGxhdGVDYWNoZS5nZXQodGVtcGxhdGVVcmwpKShzY29wZSwgZnVuY3Rpb24oY2xvbmVkRWxlbWVudCwgc2NvcGUpIHsgICAgICAgICAgCisgICAgICAgICAgICBzY29wZS50bXBsRWx0ID0gY2xvbmVkRWxlbWVudDsKKyAgICAgICAgICB9KSk7ICAgICAgICAKKworICAgICAgICAgIG5nTW9kZWwuJHJlbmRlciA9IGZ1bmN0aW9uICgpIHsKKyAgICAgICAgICAgIHZhciBzaW5nbGVWYWx1ZSA9IGZhbHNlOworCisgICAgICAgICAgICBpZihuZ01vZGVsLiR2aWV3VmFsdWUuc3BsaXQgJiYgbmdNb2RlbC4kdmlld1ZhbHVlLnNwbGl0KCI7IikubGVuZ3RoID09IDEpeworICAgICAgICAgICAgICAgIG5nTW9kZWwuJHZpZXdWYWx1ZSA9ICcwOycrbmdNb2RlbC4kdmlld1ZhbHVlOworICAgICAgICAgICAgfWVsc2UgaWYodHlwZW9mKG5nTW9kZWwuJHZpZXdWYWx1ZSkgPT09ICdudW1iZXInKXsKKyAgICAgICAgICAgICAgbmdNb2RlbC4kdmlld1ZhbHVlID0gJzA7JytuZ01vZGVsLiR2aWV3VmFsdWU7CisgICAgICAgICAgICB9CisKKyAgICAgICAgICAgIGlmICghbmdNb2RlbC4kdmlld1ZhbHVlICYmIG5nTW9kZWwuJHZpZXdWYWx1ZSAhPT0gMCkgeworICAgICAgICAgICAgICByZXR1cm47CisgICAgICAgICAgICB9CisKKyAgICAgICAgICAgIGlmICh0eXBlb2YobmdNb2RlbC4kdmlld1ZhbHVlKSA9PT0gJ251bWJlcicpIHsKKyAgICAgICAgICAgICAgbmdNb2RlbC4kdmlld1ZhbHVlID0gJycrbmdNb2RlbC4kdmlld1ZhbHVlOworICAgICAgICAgICAgfQorCisgICAgICAgICAgICBpZiAoc2NvcGUuc2xpZGVyKSB7CisgICAgICAgICAgICAgIHZhciBmaXJzdFBvaW50ZXIgPScwJzsKKyAgICAgICAgICAgICAgdmFyIHNlY29uZFBvaW50ZXIgPW5nTW9kZWwuJHZpZXdWYWx1ZS5zcGxpdCgiOyIpWzFdOworCisgICAgICAgICAgICAgIHNjb3BlLnNsaWRlci5nZXRQb2ludGVycygpWzBdLnNldChmaXJzdFBvaW50ZXIsIHRydWUpOworICAgICAgICAgICAgICAKKyAgICAgICAgICAgICAgaWYgKG5nTW9kZWwuJHZpZXdWYWx1ZS5zcGxpdCgiOyIpWzFdKSB7CisgICAgICAgICAgICAgICAgdmFyIHZhbHVlID0gbmdNb2RlbC4kdmlld1ZhbHVlLnNwbGl0KCI7IilbMV07CisgICAgICAgICAgICAgICAgaWYodmFsdWUubGVuZ3RoID49IDQpeworICAgICAgICAgICAgICAgICAgdmFsdWUgPSB2YWx1ZS5zdWJzdHJpbmcoMCwyKTsKKyAgICAgICAgICAgICAgICB9CisKKyAgICAgICAgICAgICAgICBpZighc2NvcGUub3B0aW9ucy5yZWFsdGltZSkKKyAgICAgICAgICAgICAgICAgICAgc2NvcGUub3B0aW9ucy5jYWxsYmFjayhwYXJzZUZsb2F0KG5nTW9kZWwuJHZpZXdWYWx1ZS5zcGxpdCgiOyIpWzFdKSk7CisgICAgICAgICAgICAgICAgCisgICAgICAgICAgICAgICAgc2NvcGUuc2xpZGVyLmdldFBvaW50ZXJzKClbMV0uc2V0KG5nTW9kZWwuJHZpZXdWYWx1ZS5zcGxpdCgiOyIpWzFdLCB0cnVlKTsKKyAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfQorICAgICAgICAgIH07CisKKyAgICAgICAgICB2YXIgaW5pdCA9IGZ1bmN0aW9uKCkgeworCisgICAgICAgICAgICBzY29wZS5mcm9tID0gJycrc2NvcGUub3B0aW9ucy5mcm9tOworICAgICAgICAgICAgc2NvcGUudG8gPSAnJytzY29wZS5vcHRpb25zLnRvOworCisgICAgICAgICAgICBpZiAoc2NvcGUub3B0aW9ucy5jYWxjdWxhdGUgJiYgdHlwZW9mIHNjb3BlLm9wdGlvbnMuY2FsY3VsYXRlID09PSAnZnVuY3Rpb24nKSB7CisgICAgICAgICAgICAgIHNjb3BlLmZyb20gPSBzY29wZS5vcHRpb25zLmNhbGN1bGF0ZShzY29wZS5mcm9tKTsKKyAgICAgICAgICAgICAgc2NvcGUudG8gPSBzY29wZS5vcHRpb25zLmNhbGN1bGF0ZShzY29wZS50byk7CisgICAgICAgICAgICB9CisKKyAgICAgICAgICAgIHNjb3BlLnNob3dEaXZpZGVycyA9IHNjb3BlLm9wdGlvbnMuc2hvd0RpdmlkZXJzOworICAgICAgICAgICAgc2NvcGUuQ09MT1JTID0gc2xpZGVyQ29uc3RhbnRzLkNPTE9SUzsKKworICAgICAgICAgICAgc2NvcGUuc2xpZGVyQ29sb3IgPSBzY29wZS5vcHRpb25zLnNsaWRlckNvbG9yOworICAgICAgICAgICAgaWYoIXNjb3BlLnNsaWRlckNvbG9yKQorICAgICAgICAgICAgICBzY29wZS5zbGlkZXJDb2xvciA9IHNsaWRlckNvbnN0YW50cy5DT0xPUlMuUkVHVUxBUjsKKworICAgICAgICAgICAgdmFyIHNjYWxlQXJyYXkgPSBzY29wZS5vcHRpb25zLnNjYWxlOworCisKKyAgICAgICAgICAgIC8vTWFrZSBhIGNvcHkgb2YgdGhlIHNjYWxlQXJyYXkgYmVmb3JlIGNvbnZlcnRpbmcgaXQgdG8gcGVyY2VudGFnZSBmb3IgdGhlIGJhcnMKKyAgICAgICAgICAgIHZhciBub25QZXJjZW50U2NhbGVBcnJheSA9IFtdOworCisgICAgICAgICAgICAvL0NyZWF0ZSBNYXBwZXIgZm9yIHRoZSBwZXJjZW50YWdlIHRvIHZhbHVlCisgICAgICAgICAgICB2YXIgcHJjVG9WYWx1ZU1hcHBlciA9IHt9OworCisgICAgICAgICAgICBmb3IodmFyIGkgaW4gc2NhbGVBcnJheSl7CisgICAgICAgICAgICAgICAgdmFyIHMgPSBzY2FsZUFycmF5W2ldOworICAgICAgICAgICAgICAgIG5vblBlcmNlbnRTY2FsZUFycmF5LnB1c2gocyk7CisgICAgICAgICAgICB9CisKKyAgICAgICAgICAgIGZ1bmN0aW9uIGFkZFNjYWxlQXJyYXlTdGFydEFuZEVuZCgpeworICAgICAgICAgICAgICBpZihzY2FsZUFycmF5WzBdICE9IDApeworICAgICAgICAgICAgICAgIHNjYWxlQXJyYXkuc3BsaWNlKDAsMCwwKTsKKyAgICAgICAgICAgICAgfSAKKworICAgICAgICAgICAgICBpZihzY2FsZUFycmF5W3NjYWxlQXJyYXkubGVuZ3RoIC0gMV0gIT0gMTAwKXsKKyAgICAgICAgICAgICAgICBzY2FsZUFycmF5LnNwbGljZShzY2FsZUFycmF5Lmxlbmd0aCwgMCwgMTAwKTsKKyAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfQorCisgICAgICAgICAgICBmdW5jdGlvbiBjb252ZXJ0U2NhbGVBcnJheVRvUGVyY2VudGFnZSgpeworCisgICAgICAgICAgICAgICAgaWYoc2NhbGVBcnJheVtzY2FsZUFycmF5Lmxlbmd0aCAtIDFdICE9IHNjb3BlLm9wdGlvbnMudG8peworICAgICAgICAgICAgICAgICBzY2FsZUFycmF5LnNwbGljZShzY2FsZUFycmF5Lmxlbmd0aCwgMCwgc2NvcGUub3B0aW9ucy50byk7CisgICAgICAgICAgICAgICAgfQorCisgICAgICAgICAgICAgICAgZm9yKHZhciBpIGluIHNjYWxlQXJyYXkpeworCisgICAgICAgICAgICAgICAgICAgIHZhciBmcm9tVmFsdWVDaGVjayA9IChzY2FsZUFycmF5W2ldL3Njb3BlLm9wdGlvbnMuZnJvbSk7CisgICAgICAgICAgICAgICAgICAgIHZhciB0b1ZhbHVlQ2hlY2sgPSAoc2NhbGVBcnJheVtpXS9zY29wZS5vcHRpb25zLnRvKTsKKworICAgICAgICAgICAgICAgICAgICB2YXIgcHJjVmFsdWUgPSAgKCAoc2NhbGVBcnJheVtpXSAtIHNjb3BlLm9wdGlvbnMuZnJvbSkvIChzY29wZS5vcHRpb25zLnRvIC0gc2NvcGUub3B0aW9ucy5mcm9tKSkqMTAwOworICAgICAgICAgICAgICAgICAgICB2YXIgcmVhbFZhbHVlID0gc2NhbGVBcnJheVtpXTsKKworICAgICAgICAgICAgICAgICAgICBpZih0b1ZhbHVlQ2hlY2sgPT0gMSl7CisgICAgICAgICAgICAgICAgICAgICAgICBwcmNWYWx1ZSA9IDEwMDsKKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICBlbHNlIGlmKGZyb21WYWx1ZUNoZWNrID09IDEpeworICAgICAgICAgICAgICAgICAgICAgICAgcHJjVmFsdWUgPSAwOyAgIAorICAgICAgICAgICAgICAgICAgICB9CisKKyAgICAgICAgICAgICAgICAgICAgc2NhbGVBcnJheVtpXSA9IHByY1ZhbHVlOworCisgICAgICAgICAgICAgICAgICAgIHByY1RvVmFsdWVNYXBwZXJbJycrcHJjVmFsdWVdID0gcmVhbFZhbHVlOworICAgICAgICAgICAgICAgIAorICAgICAgICAgICAgICAgIH0KKworICAgICAgICAgICAgfQorCisgICAgICAgICAgICBpZiggKHNjb3BlLm9wdGlvbnMuZnJvbSAhPSAwIHx8IHNjb3BlLm9wdGlvbnMudG8gIT0gMTAwKQorICAgICAgICAgICAgICYmIHNjb3BlLm9wdGlvbnMuc21vb3RoKXsKKyAgICAgICAgICAgICAgLyoKKyAgICAgICAgICAgICAgICBzY2FsZSBhcnJheSBpcyBpbiByZWFsIHZhbHVlcy4KKyAgICAgICAgICAgICAgICovCisgICAgICAgICAgICAgIGFkZFNjYWxlQXJyYXlTdGFydEFuZEVuZCgpOworICAgICAgICAgICAgICBzY29wZS5vcHRpb25zLnN0ZXBXaXRoRGlmZmVyZW50U2NhbGUgPSB0cnVlOworICAgICAgICAgICAgICAvKgorICAgICAgICAgICAgICBmb3IodmFyIGkgaW4gc2NhbGVBcnJheSl7CisgICAgICAgICAgICAgICAgc2NhbGVBcnJheVtpXSA9IChzY2FsZUFycmF5W2ldLzEwMCkqc2NvcGUub3B0aW9ucy50bzsKKyAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAqLworICAgICAgICAgICAgfQorICAgICAgICAgICAgZWxzZSBpZiggKHNjb3BlLm9wdGlvbnMuZnJvbSAhPSAwIHx8IHNjb3BlLm9wdGlvbnMudG8gIT0gMTAwKSAKKyAgICAgICAgICAgICAgJiYgIXNjb3BlLm9wdGlvbnMuc21vb3RoKXsKKyAgICAgICAgICAgICAgLyoKKyAgICAgICAgICAgICAgICBDYXNlIGZvciBkaWZmZXJlbnQgZnJvbSBhbmQgdG8gdmFsdWVzIG90aGVyIHRoYW4gMCBhbmQgMTAwCisgICAgICAgICAgICAgICAgc28gd2UgaGF2ZSB0byBkbyBzb21lIGRpZmZlcmVudCBjYWxjdWxhdGlvbnMKKyAgICAgICAgICAgICAgKi8KKyAgICAgICAgICAgICAgc2NvcGUub3B0aW9ucy5zdGVwV2l0aERpZmZlcmVudFNjYWxlID0gdHJ1ZTsKKyAgICAgICAgICAgICAgY29udmVydFNjYWxlQXJyYXlUb1BlcmNlbnRhZ2UoKTsKKyAgICAgICAgICAgICAgYWRkU2NhbGVBcnJheVN0YXJ0QW5kRW5kKCk7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBlbHNleworICAgICAgICAgICAgICAvKgorICAgICAgICAgICAgICAgVGhpcyBpcyB0aGUgbm9ybWFsIGNhc2Ugd2hlcmUgdGhlIGZyb20gYW5kIHRvIHZhbHVlcyBhcmUgMCBhbmQKKyAgICAgICAgICAgICAgIDEwMCByZXNwZWN0aXZlbHkuICAgICAgICAKKyAgICAgICAgICAgICAgKi8KKyAgICAgICAgICAgICAgLy9DaGVjayB0aGF0IHRoZSBzY2FsZSBzdGFydHMgYXQgMCBhbmQgMTAwCisgICAgICAgICAgICAgIGNvbnZlcnRTY2FsZUFycmF5VG9QZXJjZW50YWdlKCk7CisgICAgICAgICAgICAgIGFkZFNjYWxlQXJyYXlTdGFydEFuZEVuZCgpOworICAgICAgICAgICAgfQorCisgICAgICAgICAgICB2YXIgZGVjaW1hbFBsYWNlcyA9IDA7CisgICAgICAgICAgICBpZihzY29wZS5vcHRpb25zLmRlY2ltYWxQbGFjZXMpeworICAgICAgICAgICAgICAgIGRlY2ltYWxQbGFjZXMgPSBzY29wZS5vcHRpb25zLmRlY2ltYWxQbGFjZXM7CisgICAgICAgICAgICB9CisKKyAgICAgICAgICAgIC8vTW9kaWZ5IHRoZSBlbmREaW1lbnNpb24gYmFzZWQgb24gd2hldGhlciBjb252ZXJpc29uIHdhcyBwYXNzZWQgaW4KKyAgICAgICAgICAgIC8vQWxzbyBjaGFuZ2UgdGhlIHRvU3RyIHZhbHVlIHRvIHNjYWxlIHRvIHRoZSBsYXN0IGZhY3RvcgorICAgICAgICAgICAgc2NvcGUuZW5kRGltZW5zaW9uID0gc2NvcGUub3B0aW9ucy5kaW1lbnNpb247CisKKyAgICAgICAgICAgIGlmKHNjb3BlLm9wdGlvbnMuY29udmVyc2lvbil7CisgICAgICAgICAgICAgICAgLy9HZXQgdGhlIGRpbWVuc2lvbiBvZiB0aGUgbGFzdCBjb252ZXJzaW9uCisgICAgICAgICAgICAgICAgdmFyIGxhc3RJbmRleCA9IHNjb3BlLm9wdGlvbnMuY29udmVyc2lvbi5sZW5ndGggLSAxOworICAgICAgICAgICAgICAgIHZhciBsYXN0RGltZW5zaW9uID0gc2NvcGUub3B0aW9ucy5jb252ZXJzaW9uW2xhc3RJbmRleF0uZGltZW5zaW9uOworICAgICAgICAgICAgICAgIHZhciBsYXN0U2NhbGVGYWN0b3IgPSBzY29wZS5vcHRpb25zLmNvbnZlcnNpb25bbGFzdEluZGV4XS5zY2FsZUZhY3RvcjsKKyAgICAgICAgICAgICAgICBzY29wZS5lbmREaW1lbnNpb24gPSAiICIrbGFzdERpbWVuc2lvbjsKKworICAgICAgICAgICAgICAgIHZhciB0b1ZhbCA9IChzY29wZS50by9sYXN0U2NhbGVGYWN0b3IpLnRvRml4ZWQoZGVjaW1hbFBsYWNlcyk7CisgICAgICAgICAgICAgICAgc2NvcGUudG9TdHIgPSB0b1ZhbDsKKyAgICAgICAgICAgIH1lbHNleworICAgICAgICAgICAgICAgIHNjb3BlLnRvU3RyID0gc2NvcGUub3B0aW9ucy50bzsKKyAgICAgICAgICAgIH0KKworICAgICAgICAgICAgdmFyIE9QVElPTlMgPSB7CisgICAgICAgICAgICAgIGZyb206IHNjb3BlLm9wdGlvbnMuZnJvbSwKKyAgICAgICAgICAgICAgdG86IHNjb3BlLm9wdGlvbnMudG8sCisgICAgICAgICAgICAgIHN0ZXA6IHNjb3BlLm9wdGlvbnMuc3RlcCwKKyAgICAgICAgICAgICAgc21vb3RoOiBzY29wZS5vcHRpb25zLnNtb290aCwKKyAgICAgICAgICAgICAgbGltaXRzOiB0cnVlLAorICAgICAgICAgICAgICBzdGVwV2l0aERpZmZlcmVudFNjYWxlOiBzY29wZS5vcHRpb25zLnN0ZXBXaXRoRGlmZmVyZW50U2NhbGUsCisgICAgICAgICAgICAgIHJvdW5kOiBzY29wZS5vcHRpb25zLnJvdW5kIHx8IGZhbHNlLAorICAgICAgICAgICAgICB2YWx1ZTogbmdNb2RlbC4kdmlld1ZhbHVlLAorICAgICAgICAgICAgICBzY2FsZTogc2NvcGUub3B0aW9ucy5zY2FsZSwKKyAgICAgICAgICAgICAgbm9uUGVyY2VudFNjYWxlQXJyYXk6IG5vblBlcmNlbnRTY2FsZUFycmF5LAorICAgICAgICAgICAgICBwcmNUb1ZhbHVlTWFwcGVyOiBwcmNUb1ZhbHVlTWFwcGVyLAorICAgICAgICAgICAgICBmaXJzdERpbWVuc2lvbjpzY29wZS5vcHRpb25zLmRpbWVuc2lvbiwKKyAgICAgICAgICAgICAgZGVjaW1hbFBsYWNlczogZGVjaW1hbFBsYWNlcywKKyAgICAgICAgICAgICAgY29udmVyc2lvbjogc2NvcGUub3B0aW9ucy5jb252ZXJzaW9uLAorICAgICAgICAgICAgICByZWFsdGltZUNhbGxiYWNrOiBzY29wZS5vcHRpb25zLmNhbGxiYWNrCisgICAgICAgICAgICB9OworCisgICAgICAgICAgICBpZihhbmd1bGFyLmlzRnVuY3Rpb24oc2NvcGUub3B0aW9ucy5yZWFsdGltZSkpeworICAgICAgICAgICAgICAgIE9QVElPTlMucmVhbHRpbWVDYWxsYmFjayA9IGZ1bmN0aW9uKHZhbHVlKXsKKyAgICAgICAgICAgICAgICAgICAgbmdNb2RlbC4kc2V0Vmlld1ZhbHVlKHZhbHVlKTsKKyAgICAgICAgICAgICAgICAgICAgc2NvcGUub3B0aW9ucy5jYWxsYmFjayh2YWx1ZSk7CisgICAgICAgICAgICAgICAgfTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGVsc2V7CisgICAgICAgICAgICAgICAgT1BUSU9OUy5jYWxsYmFjayA9IGZvcmNlQXBwbHk7CisgICAgICAgICAgICB9CisgICAgICAgICAgICAKKyAgICAgICAgICAgIE9QVElPTlMuY2FsY3VsYXRlID0gc2NvcGUub3B0aW9ucy5jYWxjdWxhdGUgfHwgdW5kZWZpbmVkOworICAgICAgICAgICAgT1BUSU9OUy5vbnN0YXRlY2hhbmdlID0gc2NvcGUub3B0aW9ucy5vbnN0YXRlY2hhbmdlIHx8IHVuZGVmaW5lZDsKKyAgICAgICAgICAgIAorCisgICAgICAgICAgICAvL3RpbWVvdXQoZnVuY3Rpb24oKSB7CisKKyAgICAgICAgICAgICAgdmFyIHNjYWxlRGl2ID0gc2NvcGUudG1wbEVsdC5maW5kKCdkaXYnKVs3XTsKKyAgICAgICAgICAgICAgICBpZighT1BUSU9OUy5jb252ZXJzaW9uKXsKKyAgICAgICAgICAgICAgICAKKyAgICAgICAgICAgICAgICAgICAgc2NvcGUudG1wbEVsdC5maW5kKCdkaXYnKS5lcSg2KS5maW5kKCdzcGFuJykuZXEoMCkuY3NzKCdwYWRkaW5nLWxlZnQnLCAnMTBweCcpOworICAgICAgICAgICAgICAgICAgICBzY29wZS50bXBsRWx0LmZpbmQoJ2RpdicpLmVxKDYpLmZpbmQoJ3NwYW4nKS5lcSgwKS5jc3MoJ3BhZGRpbmctcmlnaHQnLCAnMTVweCcpOworICAgICAgICAgICAgCisgICAgICAgICAgICAgICAgfQorCisgICAgICAgICAgICAgIHNjb3BlLnNsaWRlciA9IGFuZ3VsYXIuZWxlbWVudC5zbGlkZXIoZWxlbWVudCwgc2NvcGUudG1wbEVsdCwgT1BUSU9OUyk7CisgICAgICAgICAgICAgIGFuZ3VsYXIuZWxlbWVudChzY2FsZURpdikuaHRtbChzY29wZS5nZW5lcmF0ZVNjYWxlKCkpOworICAgICAgICAgICAgICBzY29wZS5kcmF3U2NhbGUoc2NhbGVEaXYpOworICAgICAgICAgICAgICBpbml0TGlzdGVuZXIoKTsKKworICAgICAgICAgICAgICBzY29wZS4kd2F0Y2goJ29wdGlvbnMuZGlzYWJsZScsZnVuY3Rpb24odmFsKXsKKyAgICAgICAgICAgICAgICBpZiAgKHNjb3BlLnNsaWRlcikgeworICAgICAgICAgICAgICAgICAgc2NvcGUudG1wbEVsdC50b2dnbGVDbGFzcygnZGlzYWJsZWQnLHZhbCk7ICAgICAgICAgICAgICAKKyAgICAgICAgICAgICAgICAgIHNjb3BlLnNsaWRlci5kaXNhYmxlKHZhbCk7CisgICAgICAgICAgICAgICAgfSAgCisgICAgICAgICAgICAgIH0pOworCisgICAgICAgICAgICAgIHNjb3BlLiR3YXRjaCgnY3V0T2ZmJywgZnVuY3Rpb24oY3V0T2ZmVmFsKXsKKworICAgICAgICAgICAgICAgIAorCisgICAgICAgICAgICAgICAgaWYoY3V0T2ZmVmFsICYmIGN1dE9mZlZhbCA+IDApeworCisgICAgICAgICAgICAgICAgICB2YXIgY3V0T2ZmUHJjID0gKGN1dE9mZlZhbCAtIHNjb3BlLnNsaWRlci5zZXR0aW5ncy5mcm9tKS8oc2NvcGUuc2xpZGVyLnNldHRpbmdzLnRvIC0KKyAgICAgICAgICAgICAgICAgICAgc2NvcGUuc2xpZGVyLnNldHRpbmdzLmZyb20pOworICAgICAgICAgICAgICAgICAgY3V0T2ZmUHJjID0gY3V0T2ZmUHJjKjEwMDsKKworICAgICAgICAgICAgICAgICAgc2NvcGUuaXNDdXRPZmZTbGlkZXIgPSB0cnVlOworICAgICAgICAgICAgICAgICAgc2NvcGUuc2xpZGVyLnNldHRpbmdzLmN1dE9mZldpZHRoID0gY3V0T2ZmUHJjOworCisgICAgICAgICAgICAgICAgICAvL2N1dE9mZlZhbCBpcyB0aGUgYWN0dWFsIHZhbHVlIG9mIHRoZSBjdXRvZmYgcG9pbnQKKyAgICAgICAgICAgICAgICAgIHNjb3BlLmN1dE9mZlZhbCA9IGN1dE9mZlZhbDsKKyAgICAgICAgICAgICAgICAgIGlmKHNjb3BlLm9wdGlvbnMuY29udmVyc2lvbil7CisgICAgICAgICAgICAgICAgICAgIHZhciBjb252ZXJ0ZWRWYWwgPSB1dGlscy5nZXRDb252ZXJzaW9uRmFjdG9yVmFsdWUoY3V0T2ZmVmFsLCBzY29wZS5vcHRpb25zLmNvbnZlcnNpb24sIHNjb3BlLm9wdGlvbnMuZGltZW5zaW9uKTsKKyAgICAgICAgICAgICAgICAgICAgY29udmVydGVkVmFsLnNjYWxlZFZhbCA9IHBhcnNlRmxvYXQoY29udmVydGVkVmFsLnNjYWxlZFZhbCkudG9GaXhlZChzY29wZS5vcHRpb25zLmRlY2ltYWxQbGFjZXMpOworICAgICAgICAgICAgICAgICAgICBzY29wZS5jdXRPZmZWYWwgPSBjb252ZXJ0ZWRWYWwuc2NhbGVkVmFsICsnICcrY29udmVydGVkVmFsLnNjYWxlZERpbWVuc2lvbjsKKyAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgIHNjb3BlLnNsaWRlci5zZXR0aW5ncy5jdXRPZmZWYWwgPSBjdXRPZmZWYWw7CisgICAgICAgICAgICAgICAgICAvL0NhbGN1bGF0ZSB0aGUgY3V0T2ZmIHBlcmNlbnRhZ2UKKyAgICAgICAgICAgICAgICAgIHNjb3BlLnNsaWRlci5jaGFuZ2VDdXRPZmZXaWR0aChjdXRPZmZQcmMgKyAnJScpOworCisgICAgICAgICAgICAgICAgICB2YXIgc2NhbGUgPSBzY29wZS5zbGlkZXIuc2V0dGluZ3Mubm9uUGVyY2VudFNjYWxlQXJyYXk7CisKKyAgICAgICAgICAgICAgICAgIC8vQ2FsY3VsYXRlIHdoZXJlIHRoZSBjdXRPZmYgcG9pbnQgaW4gcmVsYXRpb24gdG8gdGhlIHNjYWxlIGFycmF5CisgICAgICAgICAgICAgICAgICBmb3IodmFyIGkgaW4gc2NhbGUpeworICAgICAgICAgICAgICAgICAgICBpZihpID49IDEpeworICAgICAgICAgICAgICAgICAgICAgIHZhciBsb3dlclZhbCA9IHNjYWxlW2kgLSAxXTsKKyAgICAgICAgICAgICAgICAgICAgICB2YXIgaGlnaGVyVmFsID0gc2NhbGVbaV07CisKKyAgICAgICAgICAgICAgICAgICAgICBpZihjdXRPZmZWYWwgPiBsb3dlclZhbCAmJiBjdXRPZmZWYWwgPD0gaGlnaGVyVmFsKXsKKyAgICAgICAgICAgICAgICAgICAgICAgIHNjb3BlLnNsaWRlci5zZXR0aW5ncy5jdXRPZmZJbmRleCA9IGk7CisgICAgICAgICAgICAgICAgICAgICAgfQorCisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgIH0KKworICAgICAgICAgICAgICAgIH1lbHNleworICAgICAgICAgICAgICAgICAgICBzY29wZS5zbGlkZXIuc2V0dGluZ3MuY3V0T2ZmVmFsID0gMDsKKyAgICAgICAgICAgICAgICB9CisKKyAgICAgICAgICAgICAgfSk7CisKKyAgICAgICAgICAgIC8vfSk7ICAgICAgICAgICAKKyAgICAgICAgICB9OworCisgICAgICAgICAgZnVuY3Rpb24gaW5pdExpc3RlbmVyKCkgeworICAgICAgICAgICAgYW5ndWxhci5lbGVtZW50KHdpbikuYmluZCgncmVzaXplJywgZnVuY3Rpb24oZXZlbnQpIHsKKyAgICAgICAgICAgICAgc2NvcGUuc2xpZGVyLm9ucmVzaXplKCk7CisgICAgICAgICAgICB9KTsKKyAgICAgICAgICB9CisgICAgIAorICAgICAgICAgIHNjb3BlLmdlbmVyYXRlU2NhbGUgPSBmdW5jdGlvbigpeworICAgICAgICAgICAgaWYoIHNjb3BlLm9wdGlvbnMuc2NhbGUgJiYgc2NvcGUub3B0aW9ucy5zY2FsZS5sZW5ndGggPiAwICl7CisgICAgICAgICAgICAgIHZhciBzdHIgPSAiIjsKKyAgICAgICAgICAgICAgdmFyIHMgPSBzY29wZS5vcHRpb25zLnNjYWxlOworICAgICAgICAgICAgICB2YXIgcG9zaXRpb24gPSAnbGVmdCc7CisKKyAgICAgICAgICAgICAgZm9yKHZhciBpPTA7IGkgPCBzLmxlbmd0aDsgaSsrKXsKKyAgICAgICAgICAgICAgICBpZihpICE9IDAgJiYgaSAhPSBzLmxlbmd0aCAtIDEpeworCisgICAgICAgICAgICAgICAgICAgIHZhciBzY2FsZWRQb3NpdGlvbiA9ICggKHNbaV0gLSBzY29wZS5mcm9tKS8oc2NvcGUudG8gLSBzY29wZS5mcm9tKSkqMTAwOworICAgICAgICAgICAgICAgICAgICBpZihzY29wZS5vcHRpb25zLnN0ZXBXaXRoRGlmZmVyZW50U2NhbGUgJiYgIXNjb3BlLm9wdGlvbnMuc21vb3RoKXsKKyAgICAgICAgICAgICAgICAgICAgICBzY2FsZWRQb3NpdGlvbiA9IHNbaV07CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgc3RyICs9ICc8c3BhbiBzdHlsZT0iJysgcG9zaXRpb24gKyAnOiAnICsgIHNjYWxlZFBvc2l0aW9uKyAnJSI+PC9zcGFuPic7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgIHJldHVybiBzdHI7CisgICAgICAgICAgICB9IGVsc2UgcmV0dXJuICIiOworCisgICAgICAgICAgICByZXR1cm4gIiI7CisgICAgICAgICAgfTsKKworICAgICAgICAgIHNjb3BlLmRyYXdTY2FsZSA9IGZ1bmN0aW9uKHNjYWxlRGl2KXsKKyAgICAgICAgICAgIGFuZ3VsYXIuZm9yRWFjaChhbmd1bGFyLmVsZW1lbnQoc2NhbGVEaXYpLmZpbmQoJ2lucycpLCBmdW5jdGlvbihzY2FsZUxhYmVsLCBrZXkpIHsKKyAgICAgICAgICAgICAgc2NhbGVMYWJlbC5zdHlsZS5tYXJnaW5MZWZ0ID0gLSBzY2FsZUxhYmVsLmNsaWVudFdpZHRoIC8gMjsKKyAgICAgICAgICAgIH0pOworICAgICAgICAgIH07CisKKyAgICAgICAgICB2YXIgZm9yY2VBcHBseSA9IGZ1bmN0aW9uKHZhbHVlKSB7CisgICAgICAgICAgICB2YXIgdmFsID0gdmFsdWUuc3BsaXQoIjsiKVsxXTsKKyAgICAgICAgICAgCisgICAgICAgICAgICBzY29wZS4kYXBwbHkoZnVuY3Rpb24oKSB7CisgICAgICAgICAgICAgICBuZ01vZGVsLiRzZXRWaWV3VmFsdWUocGFyc2VJbnQodmFsKSk7CisgICAgICAgICAgICB9KTsKKyAgICAgICAgICAgIGlmIChzY29wZS5vcHRpb25zLmNhbGxiYWNrKXsKKyAgICAgICAgICAgICAgIHNjb3BlLm9wdGlvbnMuY2FsbGJhY2socGFyc2VJbnQodmFsKSk7CisgICAgICAgICAgICB9CisKKyAgICAgICAgICB9OworCisgICAgICAgICAgc2NvcGUuJHdhdGNoKCdvcHRpb25zJywgZnVuY3Rpb24odmFsdWUpIHsKKyAgICAgICAgICAgICAgaW5pdCgpOworICAgICAgICAgIH0pOworCisgICAgICAgICAgYW5ndWxhci5lbGVtZW50LnNsaWRlciA9IGZ1bmN0aW9uKCBpbnB1dEVsZW1lbnQsIGVsZW1lbnQsIHNldHRpbmdzKSB7CisgICAgICAgICAgICBpZighZWxlbWVudC5kYXRhKCdqc2xpZGVyJykpCisgICAgICAgICAgICAgIGVsZW1lbnQuZGF0YSgnanNsaWRlcicsIG5ldyBTbGlkZXIoIGlucHV0RWxlbWVudCwgZWxlbWVudCwgc2V0dGluZ3MgKSk7CisgICAgICAgICAgICB2YXIgc2xpZGVyT2JqID0gZWxlbWVudC5kYXRhKCdqc2xpZGVyJyk7CisgICAgICAgICAgICByZXR1cm4gc2xpZGVyT2JqOworICAgICAgICAgIH07CisKKyAgICAgICAgfQorICAgICAgfTsKK31dKTsKK2FuZ3VsYXIubW9kdWxlKCdhdHQuYWJzLnNwbGl0QnV0dG9uRHJvcGRvd24nLCBbJ2F0dC5hYnMudXRpbGl0aWVzJ10pCisgICAgICAgIC5kaXJlY3RpdmUoJ2F0dEJ1dHRvbkRyb3Bkb3duJywgWyckZG9jdW1lbnQnLCAnJHBhcnNlJywgJyRkb2N1bWVudEJpbmQnLCBmdW5jdGlvbigkZG9jdW1lbnQsICRwYXJzZSwgJGRvY3VtZW50QmluZCkgeworICAgICAgICAgICAgICAgIHJldHVybiB7CisgICAgICAgICAgICAgICAgICAgIHJlc3RyaWN0OiAnRUEnLAorICAgICAgICAgICAgICAgICAgICByZXBsYWNlOiB0cnVlLAorICAgICAgICAgICAgICAgICAgICB0cmFuc2NsdWRlOiB0cnVlLAorICAgICAgICAgICAgICAgICAgICB0ZW1wbGF0ZVVybDogJ2FwcC9zY3JpcHRzL25nX2pzX2F0dF90cGxzL3NwbGl0QnV0dG9uRHJvcGRvd24vc3BsaXRCdXR0b25Ecm9wZG93bi5odG1sJywKKyAgICAgICAgICAgICAgICAgICAgc2NvcGU6IHsKKyAgICAgICAgICAgICAgICAgICAgICAgIGJ0blRleHQ6ICJAIiwKKyAgICAgICAgICAgICAgICAgICAgICAgIGJ0blR5cGU6ICJAIiwKKyAgICAgICAgICAgICAgICAgICAgICAgIGJ0bkxpbms6ICJAIiwKKyAgICAgICAgICAgICAgICAgICAgICAgIGJ0bkNsaWNrOiAiJiIKKyAgICAgICAgICAgICAgICAgICAgfSwKKyAgICAgICAgICAgICAgICAgICAgbGluazogZnVuY3Rpb24oc2NvcGUsIGVsZW1lbnQsIGF0dHIpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIHNjb3BlLmlzU21hbGwgPSBmYWxzZTsKKyAgICAgICAgICAgICAgICAgICAgICAgIHNjb3BlLmlzRHJvcERvd25PcGVuID0gZmFsc2U7CisgICAgICAgICAgICAgICAgICAgICAgICBzY29wZS5pc0FjdGlvbkRyb3Bkb3duID0gZmFsc2U7CisgICAgICAgICAgICAgICAgICAgICAgICB2YXIgZmxhZyA9IGZhbHNlOworCisgICAgICAgICAgICAgICAgICAgICAgICBpZiAoYXR0ci5zbWFsbCA9PT0gIiIpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBzY29wZS5pc1NtYWxsID0gdHJ1ZTsKKyAgICAgICAgICAgICAgICAgICAgICAgIH0KKworICAgICAgICAgICAgICAgICAgICAgICAgaWYgKCEoc2NvcGUuYnRuVGV4dCkpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBzY29wZS5pc0FjdGlvbkRyb3Bkb3duID0gdHJ1ZTsKKyAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgIAorICAgICAgICAgICAgICAgICAgICAgICAgc2NvcGUuY2xpY2tGeG4gPSBmdW5jdGlvbigpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZih0eXBlb2Ygc2NvcGUuYnRuQ2xpY2sgPT09ICJmdW5jdGlvbiIgJiYgIXNjb3BlLmJ0bkxpbmspeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzY29wZS5idG5DbGljayA9ICRwYXJzZShzY29wZS5idG5DbGljayk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNjb3BlLmJ0bkNsaWNrKCk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgfTsKKworICAgICAgICAgICAgICAgICAgICAgICAgc2NvcGUudG9nZ2xlRHJvcGRvd24gPSBmdW5jdGlvbigpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoIShzY29wZS5idG5UeXBlID09PSAnZGlzYWJsZWQnKSkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBmbGFnID0gc2NvcGUuaXNEcm9wRG93bk9wZW4gPSAhc2NvcGUuaXNEcm9wRG93bk9wZW47CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgfTsKKworICAgICAgICAgICAgICAgICAgICAgICAgc2NvcGUuc2hvd0Ryb3Bkb3duID0gZnVuY3Rpb24oKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKCEoc2NvcGUuYnRuVHlwZSA9PT0gJ2Rpc2FibGVkJykpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2NvcGUuaXNEcm9wRG93bk9wZW4gPSB0cnVlOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBmbGFnID0gdHJ1ZTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICB9OworCisgICAgICAgICAgICAgICAgICAgICAgICBzY29wZS5oaWRlRHJvcGRvd24gPSBmdW5jdGlvbigpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoIShzY29wZS5idG5UeXBlID09PSAnZGlzYWJsZWQnKSkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzY29wZS5pc0Ryb3BEb3duT3BlbiA9IGZhbHNlOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBmbGFnID0gZmFsc2U7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgfTsKKworICAgICAgICAgICAgICAgICAgICAgICAgdmFyIG91dHNpZGVDbGljayA9IGZ1bmN0aW9uKGUpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoIWZsYWcpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2NvcGUuJGFwcGx5KGZ1bmN0aW9uKCkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2NvcGUuaXNEcm9wRG93bk9wZW4gPSBmYWxzZTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZsYWcgPSBmYWxzZTsKKyAgICAgICAgICAgICAgICAgICAgICAgIH07CisKKyAgICAgICAgICAgICAgICAgICAgICAgICRkb2N1bWVudEJpbmQuY2xpY2soJ2lzRHJvcERvd25PcGVuJywgb3V0c2lkZUNsaWNrLCBzY29wZSk7CisKKyAgICAgICAgICAgICAgICAgICAgICAgIGF0dHIuJG9ic2VydmUoJ2J0blR5cGUnLCBmdW5jdGlvbih2YWwpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBzY29wZS5idG5UeXBlID0gdmFsOworICAgICAgICAgICAgICAgICAgICAgICAgfSk7CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICB9OworCisgICAgICAgICAgICB9XSkKKy5jb25zdGFudCgnaWNvblN0YXRlQ29uc3RhbnRzJywgeworICAgIE1JRERMRTogJ21pZGRsZScsCisgICAgTEVGVDogJ2xlZnQnLAorICAgIFJJR0hUOiAncmlnaHQnLAorICAgIE5FWFRfVE9fRFJPUERPV046J25leHQtdG8tZHJvcGRvd24nLAorICAgIExFRlRfTkVYVF9UT19EUk9QRE9XTjonbGVmdC1uZXh0LXRvLWRyb3Bkb3duJywKKyAgICBESVJfVFlQRTogeworICAgICAgICBMRUZUOiAnbGVmdCcsCisgICAgICAgIFJJR0hUOiAgJ3JpZ2h0JywKKyAgICAgICAgQlVUVE9OOiAnYnV0dG9uJworICAgIH0sCisgICAgS0VZQk9BUkQ6IHsKKyAgICAgICAgVVA6IDM4LAorICAgICAgICBET1dOOjQwLAorICAgICAgICBFTlRFUjogMTMsCisgICAgICAgIEVTQzogMjcKKyAgICB9LAorICAgIFNQTElUX0lDT05fQlROX0VWRU5UX0VNSVRURVJfS0VZOiAnc3BsaXRJY29uQnV0dG9uVGFwJworfSkKKy5kaXJlY3RpdmUoJ2V4cGFuZGFibGVMaW5lJywgWyckZG9jdW1lbnQnLGZ1bmN0aW9uKCRkb2N1bWVudCl7CisgICAgcmV0dXJuIHsKKyAgICAgICAgcmVzdHJpY3Q6ICdFQScsCisgICAgICAgIHJlcGxhY2U6IHRydWUsCisgICAgICAgIHByaW9yaXR5OiAzMDAsCisgICAgICAgIHJlcXVpcmU6IFsnXmF0dFNwbGl0SWNvbkJ1dHRvbicsICdleHBhbmRhYmxlTGluZSddLAorICAgICAgICBjb250cm9sbGVyOiBbJyRzY29wZScsIGZ1bmN0aW9uKCRzY29wZSl7CisgICAgICAgICAgICAkc2NvcGUuaXNBY3RpdmUgPSBmYWxzZTsKKyAgICAgICAgICAgIHRoaXMuc2V0QWN0aXZlU3RhdGUgPSBmdW5jdGlvbihpc0FjdGl2ZSl7CisgICAgICAgICAgICAgICAgJHNjb3BlLmlzQWN0aXZlID0gaXNBY3RpdmU7CisgICAgICAgICAgICB9CisKKyAgICAgIC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ICB9OworCisgICAgdGhpcy5kcm9wRG93bkNsaWNrZWQgPSBmdW5jdGlvbigpeworICAgICAgICBpZigkc2NvcGUuZHJvcERvd25DbGlja2VkKQorICAgICAgICAgICAgJHNjb3BlLmRyb3BEb3duQ2xpY2tlZCgpOworICAgIH0KKworICAgIHRoaXMuZGlyVHlwZSA9ICRzY29wZS5kaXJUeXBlOworCit9XSkKKy5kaXJlY3RpdmUoJ2F0dFNwbGl0SWNvbicsIFsnJGRvY3VtZW50JywgJyR0aW1lb3V0JywnaWNvblN0YXRlQ29uc3RhbnRzJywnJGRvY3VtZW50QmluZCcsJ2V2ZW50cycsCisgZnVuY3Rpb24oJGRvY3VtZW50LCR0aW1lb3V0LGljb25TdGF0ZUNvbnN0YW50cywkZG9jdW1lbnRCaW5kLCBldmVudHMpeworICAgIHJldHVybiB7CisgICAgICAgIHJlc3RyaWN0OiAnRUEnLAorICAgICAgICByZXBsYWNlOiB0cnVlLAorICAgICAgICBwcmlvcml0eTogMjAwLAorICAgICAgICB0cmFuc2NsdWRlOiB0cnVlLAorICAgICAgICByZXF1aXJlOiBbJ15hdHRTcGxpdEljb25CdXR0b24nLCdhdHRTcGxpdEljb24nXSwKKyAgICAgICAgdGVtcGxhdGVVcmw6ICdhcHAvc2NyaXB0cy9uZ19qc19hdHRfdHBscy9zcGxpdEJ1dHRvbkRyb3Bkb3duL3NwbGl0SWNvbi5odG1sJywKKyAgICAgICAgc2NvcGU6eworICAgICAgICAgICAgaWNvbjogJ0AnLAorICAgICAgICAgICAgaG92ZXJXYXRjaDogJz0nLAorICAgICAgICAgICAgZHJvcERvd25XYXRjaDogJz0nLAorICAgICAgICAgICAgZGlyVHlwZTogJ0AnCisgICAgICAgIH0sCisgICAgICAgIGNvbnRyb2xsZXI6J0F0dFNwbGl0SWNvbkN0cmwnLAorICAgICAgICBsaW5rOiBmdW5jdGlvbihzY29wZSxlbGVtZW50LGF0dHIsY3RybHMpeworCisgICAgICAgICAgICB2YXIgYXR0U3BsaXRJY29uQnV0dG9uQ3RybCA9IGN0cmxzWzBdOworICAgICAgICAgICAgdmFyIGF0dFNwbGl0SWNvbkN0cmwgPSBjdHJsc1sxXTsKKyAgICAgICAgICAgIGF0dFNwbGl0SWNvbkJ1dHRvbkN0cmwuYWRkU3ViQ3RybChhdHRTcGxpdEljb25DdHJsKTsKKworICAgICAgICAgICAgc2NvcGUuaWNvblN0YXRlQ29uc3RhbnRzID0gaWNvblN0YXRlQ29uc3RhbnRzOworCisgICAgICAgICAgICB2YXIgY3VycmVudEluZGV4ID0gMDsKKyAgICAgICAgICAgIHZhciBpc015RWxlbWVudCA9IGZhbHNlOworICAgICAgICAgICAgdmFyIGxpc3RFbGVtZW50czsKKworICAgICAgICAgICAgc2NvcGUuaXNEcm9wZG93biA9IGZhbHNlOworICAgICAgICAgICAgc2NvcGUuaXNEcm9wZG93bk9wZW4gPSBmYWxzZTsKKworCisgICAgICAgICAgICBzY29wZS4kb24oaWNvblN0YXRlQ29uc3RhbnRzLlNQTElUX0lDT05fQlROX0VWRU5UX0VNSVRURVJfS0VZLCBmdW5jdGlvbihldm50LCBkYXRhKXsKKyAgICAgICAgICAgICAgICBpZih0eXBlb2YgZGF0YSA9PSAnYm9vbGVhbicgJiYgZGF0YSl7CisgICAgICAgICAgICAgICAgICAgIHNjb3BlLmRyb3BEb3duQ2xpY2tlZCgpOyAgICAKKyAgICAgICAgICAgICAgICAgICAgCisgICAgICAgICAgICAgICAgICAgIC8qCisgICAgICAgICAgICAgICAgICAgICAgICBDaGVjayBpZiB0aGUgZHJvcGRvd24gaXMgb3BlbiBhbmQgaWYgd2UgYXJlIHNlbGVjdGluZyBvbmUKKyAgICAgICAgICAgICAgICAgICAgICAgIG9mIHRoZSBpdGVtcywgc28gdGhhdCB3aGVuIHByZXNzaW5nIGVudGVyIGl0IHdpbGwgdHJpZ2dlciBpdC4KKyAgICAgICAgICAgICAgICAgICAgKi8KKyAgICAgICAgICAgICAgICAgICAgaWYoc2NvcGUuaXNEcm9wRG93bk9wZW4peworICAgICAgICAgICAgICAgICAgICAgICAgbGlzdEVsZW1lbnRzW2N1cnJlbnRJbmRleF0uZXEoMCkuZmluZCgnYScpWzBdLmNsaWNrKCk7CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgZWxzZXsKKyAgICAgICAgICAgICAgICAgICAgdmFyIGUgPSBkYXRhOworICAgICAgICAgICAgICAgICAgICAvL09ubHkgdHJpZ2dlciB0aGUga2V5Ym9hcmQgZXZlbnQgaWYgdGhlIGljb24gYnV0dG9uIGlzIGEgZHJvcGRvd24gdHlwZQorICAgICAgICAgICAgICAgICAgICBpZihzY29wZS5pc0Ryb3Bkb3duKQorICAgICAgICAgICAgICAgICAgICAgICAgdHJpZ2dlcktleWJvYXJkRXZlbnRzKGUpOyAgIAorICAgICAgICAgICAgICAgIH0KKworICAgICAgICAgICAgICAgIGZ1bmN0aW9uIHRyaWdnZXJLZXlib2FyZEV2ZW50cyhlKXsKKyAgICAgICAgICAgICAgICAgICAgaWYoZS53aGljaCA9PSBpY29uU3RhdGVDb25zdGFudHMuS0VZQk9BUkQuRVNDKXsKKyAgICAgICAgICAgICAgICAgICAgICAgIG91dHNpZGVDbGljaygpOworICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgIGlmKCBlLndoaWNoID09IGljb25TdGF0ZUNvbnN0YW50cy5LRVlCT0FSRC5VUCB8fCAgCisgICAgICAgICAgICAgICAgICAgICAgICBlLndoaWNoID09IGljb25TdGF0ZUNvbnN0YW50cy5LRVlCT0FSRC5ET1dOKXsKKworICAgICAgICAgICAgICAgICAgICAgICAgZS5wcmV2ZW50RGVmYXVsdCgpOworICAgICAgICAgICAgICAgICAgICAgICAgZXZlbnRzLnN0b3BQcm9wYWdhdGlvbihlKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIC8vZS5zdG9wUHJvcGFnYXRpb24oKTsKKworICAgICAgICAgICAgICAgICAgICAgICAgaWYoZS53aGljaCA9PSBpY29uU3RhdGVDb25zdGFudHMuS0VZQk9BUkQuRE9XTil7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgLy9Ecm9wZG93biBpcyBvcGVuIGFuZCB0aGUgdXNlciB0YXBzIGRvd24gYWdhaW4KKworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmKHNjb3BlLmlzRHJvcERvd25PcGVuKXsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLy9Ob3cgd2UgbmVlZCB0byBnbyB0aHJvdWdoIHRoZSByb3dzIGluIHRoZSBkcm9wZG93bgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzY29wZS5uZXh0SXRlbUluRHJvcGRvd24oKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgLy9Ecm9wZG93biBpcyBub3Qgb3BlbgorICAgICAgICAgICAgICAgICAgICAgICAgICAgIGVsc2V7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlzTXlFbGVtZW50ID0gdHJ1ZTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgb3V0c2lkZUNsaWNrKCk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxpc3RFbGVtZW50c0luaXQoKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICBlbHNlIGlmKGUud2hpY2ggID09IGljb25TdGF0ZUNvbnN0YW50cy5LRVlCT0FSRC5VUCl7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYoc2NvcGUuaXNEcm9wRG93bk9wZW4peworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzY29wZS5wcmV2aW91c0l0ZW1JbkRyb3Bkb3duKCk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgfWVsc2V7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgCisgICAgICAgICAgICAgICAgICAgICAgICBlbHNleworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlzTXlFbGVtZW50ID0gZmFsc2U7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgb3V0c2lkZUNsaWNrKCk7CisgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgIH1lbHNlIGlmKGUud2hpY2ggPT0gaWNvblN0YXRlQ29uc3RhbnRzLktFWUJPQVJELkVOVEVSKXsKKyAgICAgICAgICAgICAgICAgICAgICAgIGlmKHNjb3BlLmlzRHJvcERvd25PcGVuKXsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBsaXN0RWxlbWVudHNJbml0KCk7CisgICAgICAgICAgICAgICAgICAgICAgICB9ZWxzZXsKKyAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIH0KKworICAgICAgICAgICAgICAgIGZ1bmN0aW9uIGxpc3RFbGVtZW50c0luaXQoKXsKKyAgICAgICAgICAgICAgICAgICAgaWYobGlzdEVsZW1lbnRzID09IHVuZGVmaW5lZCl7CisgICAgICAgICAgICAgICAgICAgICAgICBsaXN0RWxlbWVudHMgPSBbXTsKKyAgICAgICAgICAgICAgICAgICAgICAgIHZhciBsaVRlbXBzID0gZWxlbWVudC5maW5kKCdsaScpOworICAgICAgICAgICAgICAgICAgICAgICAgZm9yKHZhciBpID0gMDsgaSA8IGxpVGVtcHMubGVuZ3RoOyBpKyspeworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxpc3RFbGVtZW50cy5wdXNoKGxpVGVtcHMuZXEoaSkpOworICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgbGlzdEVsZW1lbnRzW2N1cnJlbnRJbmRleF0uY2hpbGRyZW4oKS5lcSgwKS5hZGRDbGFzcygnc2VsZWN0ZWQtaXRlbScpOworICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgCisgICAgICAgICAgICB9KTsKKyAgICAgICAgCisgICAgICAgICAgICBzY29wZS5uZXh0SXRlbUluRHJvcGRvd24gPSBmdW5jdGlvbigpeworICAgICAgICAgICAgICAgIGlmKGxpc3RFbGVtZW50cyAmJiBjdXJyZW50SW5kZXggPCBsaXN0RWxlbWVudHMubGVuZ3RoIC0gMSl7CisgICAgICAgICAgICAgICAgICAgIGN1cnJlbnRJbmRleCsrOworICAgICAgICAgICAgICAgICAgICBsaXN0RWxlbWVudHNbY3VycmVudEluZGV4IC0gMV0uY2hpbGRyZW4oKS5lcSgwKS5yZW1vdmVDbGFzcygnc2VsZWN0ZWQtaXRlbScpOworICAgICAgICAgICAgICAgICAgICBsaXN0RWxlbWVudHNbY3VycmVudEluZGV4XS5jaGlsZHJlbigpLmVxKDApLmFkZENsYXNzKCdzZWxlY3RlZC1pdGVtJyk7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfTsKKworICAgICAgICAgICAgc2NvcGUucHJldmlvdXNJdGVtSW5Ecm9wZG93biA9IGZ1bmN0aW9uKCl7CisgICAgICAgICAgICAgICAgaWYoY3VycmVudEluZGV4ID4gMCl7CisgICAgICAgICAgICAgICAgICAgIGN1cnJlbnRJbmRleC0tOworICAgICAgICAgICAgICAgICAgICBsaXN0RWxlbWVudHNbY3VycmVudEluZGV4XS5jaGlsZHJlbigpLmVxKDApLmFkZENsYXNzKCdzZWxlY3RlZC1pdGVtJyk7CisKKyAgICAgICAgICAgICAgICAgICAgaWYoY3VycmVudEluZGV4ICsgMSA8IGxpc3RFbGVtZW50cy5sZW5ndGgpCisgICAgICAgICAgICAgICAgICAgICAgICBsaXN0RWxlbWVudHNbY3VycmVudEluZGV4ICsgMV0uY2hpbGRyZW4oKS5lcSgwKS5yZW1vdmVDbGFzcygnc2VsZWN0ZWQtaXRlbScpOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH07CisKKyAgICAgICAgICAgIHNjb3BlLiR3YXRjaCgnaXNJY29uSG92ZXJlZCcsIGZ1bmN0aW9uKHZhbCl7CisgICAgICAgICAgICAgICAgc2NvcGUuaG92ZXJXYXRjaCA9IHZhbDsKKyAgICAgICAgICAgIH0pOworCisgICAgICAgICAgICBzY29wZS4kd2F0Y2goJ3R5cGUnLCBmdW5jdGlvbih2YWwpeworCisgICAgICAgICAgICAgICAgZnVuY3Rpb24gdG9nZ2xlVmFsdWVzKGlzTWlkZGxlLGlzTmV4dFRvRHJvcERvd24saXNSaWdodCxpc0xlZnQsaXNMZWZ0TmV4dERyb3Bkb3duKXsKKyAgICAgICAgICAgICAgICAgICAgc2NvcGVbJ2lzTWlkZGxlJ10gID0gaXNNaWRkbGU7CisgICAgICAgICAgICAgICAgICAgIHNjb3BlWydpc05leHRUb0Ryb3BEb3duJ10gPSBpc05leHRUb0Ryb3BEb3duOworICAgICAgICAgICAgICAgICAgICBzY29wZVsnaXNSaWdodCddICA9IGlzUmlnaHQ7CisgICAgICAgICAgICAgICAgICAgIHNjb3BlWydpc0xlZnQnXSA9IGlzTGVmdDsKKyAgICAgICAgICAgICAgICAgICAgc2NvcGVbJ2lzTGVmdE5leHREcm9wZG93biddID0gaXNMZWZ0TmV4dERyb3Bkb3duOworICAgICAgICAgICAgICAgIH07CisKKyAgICAgICAgICAgICAgICBpZih2YWwgPT0gc2NvcGUuaWNvblN0YXRlQ29uc3RhbnRzLk1JRERMRSl7CisgICAgICAgICAgICAgICAgICAgIHRvZ2dsZVZhbHVlcyh0cnVlLGZhbHNlLGZhbHNlLHRydWUsZmFsc2UpOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICBlbHNlIGlmKHZhbCA9PSAgc2NvcGUuaWNvblN0YXRlQ29uc3RhbnRzLkxFRlQpeworICAgICAgICAgICAgICAgICAgICB0b2dnbGVWYWx1ZXMoZmFsc2UsZmFsc2UsZmFsc2UsdHJ1ZSxmYWxzZSk7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIGVsc2UgaWYodmFsID09IHNjb3BlLmljb25TdGF0ZUNvbnN0YW50cy5SSUdIVCl7CisgICAgICAgICAgICAgICAgICAgIHRvZ2dsZVZhbHVlcyhmYWxzZSxmYWxzZSx0cnVlLGZhbHNlLGZhbHNlKTsKKyAgICAgICAgICAgICAgICB9ZWxzZSBpZih2YWwgPT0gc2NvcGUuaWNvblN0YXRlQ29uc3RhbnRzLk5FWFRfVE9fRFJPUERPV04peworICAgICAgICAgICAgICAgICAgICB0b2dnbGVWYWx1ZXMoZmFsc2UsdHJ1ZSx0cnVlLHRydWUsZmFsc2UpOworICAgICAgICAgICAgICAgIH1lbHNlICBpZih2YWwgPT0gc2NvcGUuaWNvblN0YXRlQ29uc3RhbnRzLkxFRlRfTkVYVF9UT19EUk9QRE9XTil7CisgICAgICAgICAgICAgICAgICAgIHRvZ2dsZVZhbHVlcyhmYWxzZSxmYWxzZSxmYWxzZSx0cnVlLHRydWUpOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0pOworCisgICAgICAgICAgICBpZihhdHRyLmRyb3BEb3duSWQgJiYgYXR0ci5kcm9wRG93bklkICE9ICcnKXsKKyAgICAgICAgICAgICAgICBzY29wZS5kcm9wRG93bklkID0gYXR0ci5kcm9wRG93bklkOworICAgICAgICAgICAgICAgIHNjb3BlLmlzRHJvcGRvd24gPSB0cnVlOworICAgICAgICAgICAgfQorCisgICAgICAgICAgICBzY29wZS5kcm9wRG93bkNsaWNrZWQgPSBmdW5jdGlvbigpeworICAgICAgICAgICAgICAgIGlzTXlFbGVtZW50ID0gdHJ1ZTsKKyAgICAgICAgICAgIH07CisKKyAgICAgICAgICAgIHNjb3BlLnRvZ2dsZURyb3Bkb3duID0gZnVuY3Rpb24odmFsKSB7CisgICAgICAgICAgICAgICAgaWYodmFsICE9IHVuZGVmaW5lZCkKKyAgICAgICAgICAgICAgICAgICAgc2NvcGUuaXNEcm9wRG93bk9wZW49dmFsOworICAgICAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgICAgICAgICAgc2NvcGUuaXNEcm9wRG93bk9wZW4gPSAhc2NvcGUuaXNEcm9wRG93bk9wZW47IAorCisgICAgICAgICAgICAgICAgc2NvcGUuZHJvcERvd25XYXRjaCA9IHNjb3BlLmlzRHJvcERvd25PcGVuOworICAgICAgICAgICAgfTsKKworICAgICAgICAgICAgdmFyIG91dHNpZGVDbGljayA9IGZ1bmN0aW9uKGUpIHsKKyAgICAgICAgICAgICAgICBpZihzY29wZS5pc0Ryb3Bkb3duKXsKKyAgICAgICAgICAgICAgICAgICAgaWYgKGlzTXlFbGVtZW50KSB7CisgICAgICAgICAgICAgICAgICAgICAgICBpc015RWxlbWVudCA9IGZhbHNlOworICAgICAgICAgICAgICAgICAgICAgICAgc2NvcGUudG9nZ2xlRHJvcGRvd24oKTsKKyAgICAgICAgICAgICAgICAgICAgfWVsc2V7CisgICAgICAgICAgICAgICAgICAgICAgICBzY29wZS50b2dnbGVEcm9wZG93bihmYWxzZSk7CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgc2NvcGUuJGFwcGx5KCk7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfTsKKworICAgICAgICAgICAgJGRvY3VtZW50QmluZC5jbGljaygnaXNEcm9wZG93bicsIG91dHNpZGVDbGljaywgc2NvcGUpOworICAgICAgICB9CisgICAgfQorfV0pCisuY29udHJvbGxlcignQXR0U3BsaXRJY29uQnV0dG9uQ3RybCcsWyckc2NvcGUnLCAnaWNvblN0YXRlQ29uc3RhbnRzJyxmdW5jdGlvbigkc2NvcGUsaWNvblN0YXRlQ29uc3RhbnRzKXsKKworICAgIHRoaXMuc3ViQ3RybHMgPSBbXTsKKworICAgICRzY29wZS5pc0xlZnRMaW5lU2hvd249dHJ1ZTsKKyAgICAkc2NvcGUuaXNSaWdodExpbmVTaG93bj10cnVlOworICAgICRzY29wZS5jaGlsZHJlblNjb3BlcyA9IFtdOworCisgICAgdmFyIG9yaWdMZWZ0TGluZVNob3duID0gJHNjb3BlLmlzTGVmdExpbmVTaG93bjsKKyAgICB2YXIgb3JpZ1JpZ2h0TGluZVNob3duID0gJHNjb3BlLmlzUmlnaHRMaW5lU2hvd247CisKKyAgICB2YXIgdGhhdCA9IHRoaXM7CisKKyAgICBmdW5jdGlvbiBnZXREaXJJbmRleChkaXJUeXBlKXsKKyAgICAgICAgdmFyIGluZGV4ID0gLTE7CisgICAgICAgIGZvcih2YXIgYyBpbiB0aGF0LnN1YkN0cmxzKXsKKyAgICAgICAgICAgIHZhciBjdHJsID0gdGhhdC5zdWJDdHJsc1tjXTsKKyAgICAgICAgICAgIGlmKGN0cmwuZGlyVHlwZT09ZGlyVHlwZSl7CisgICAgICAgICAgICAgICAgaW5kZXggPSBjOworICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgICAgIHJldHVybiBpbmRleDsKKyAgICB9CisKKyAgICB0aGlzLmFkZFN1YkN0cmwgPSAgZnVuY3Rpb24oc3ViKXsKKyAgICAgICAgdGhpcy5zdWJDdHJscy5wdXNoKHN1Yik7CisgICAgfTsKKworICAgIHRoaXMuaXNMZWZ0TGluZVNob3duID0gZnVuY3Rpb24oaXNTaG93bil7CisgICAgICAgIGlmKGlzU2hvd24gPT0gdW5kZWZpbmVkKQorICAgICAgICAgICAgcmV0dXJuICRzY29wZS5pc0xlZnRMaW5lU2hvd247CisgICAgICAgIGVsc2UKKyAgICAgICAgICAgICRzY29wZS5pc0xlZnRMaW5lU2hvd24gPSBpc1Nob3duOworICAgIH07CisKKyAgICB0aGlzLmlzUmlnaHRMaW5lU2hvd24gPSBmdW5jdGlvbihpc1Nob3duKXsKKyAgICAgICAgaWYoaXNTaG93biA9PSB1bmRlZmluZWQpCisgICAgICAgICAgICByZXR1cm4gJHNjb3BlLmlzUmlnaHRMaW5lU2hvd247CisgICAgICAgIGVsc2UKKyAgICAgICAgICAgICRzY29wZS5pc1JpZ2h0TGluZVNob3duID0gaXNTaG93bjsKKyAgICB9OworCisgICAgdGhpcy5zZXRMZWZ0TGluZUhvdmVyID0gZnVuY3Rpb24oaXNIb3ZlcmVkKXsKKyAgICAgICAgdmFyIGxlZnRMaW5lSW5kZXggPSBnZXREaXJJbmRleChpY29uU3RhdGVDb25zdGFudHMuRElSX1RZUEUuTEVGVCk7CisKKyAgICAgICAgaWYoJHNjb3BlLmlzTGVmdExpbmVTaG93bil7CisgICAgICAgICAgICBpZih0aGlzLnN1YkN0cmxzW2xlZnRMaW5lSW5kZXhdICYmIHRoaXMuc3ViQ3RybHNbbGVmdExpbmVJbmRleF0uc2V0QWN0aXZlU3RhdGUpeworICAgICAgICAgICAgICAgIHRoaXMuc3ViQ3RybHNbbGVmdExpbmVJbmRleF0uc2V0QWN0aXZlU3RhdGUoaXNIb3ZlcmVkKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgIH07CisKKyAgICB0aGlzLnNldFJpZ2h0TGluZUhvdmVyID0gZnVuY3Rpb24oaXNIb3ZlcmVkKXsKKyAgICAgICAgdmFyIHJpZ2h0TGluZUluZGV4ID0gZ2V0RGlySW5kZXgoaWNvblN0YXRlQ29uc3RhbnRzLkRJUl9UWVBFLlJJR0hUKTsKKyAgICAgICAgaWYoJHNjb3BlLmlzUmlnaHRMaW5lU2hvd24peworICAgICAgICAgICAgaWYodGhpcy5zdWJDdHJsc1tyaWdodExpbmVJbmRleF0gICYmIHRoaXMuc3ViQ3RybHNbcmlnaHRMaW5lSW5kZXhdLnNldEFjdGl2ZVN0YXRlKXsKKyAgICAgICAgICAgICAgICB0aGlzLnN1YkN0cmxzW3JpZ2h0TGluZUluZGV4XS5zZXRBY3RpdmVTdGF0ZShpc0hvdmVyZWQpOworICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgfTsKKworICAgIHRoaXMudG9nZ2xlTGluZX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5lSW5kZXhdLnNldEFjdGl2ZVN0YXRlKGlzSG92ZXJlZCk7CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgaWYoaSAtIDEgPj0gMCl7CisgICAgICAgICAgICAgICAgICAgICAgICBpZihzdWJJY29uQnV0dG9uc1tpLTFdLmlzUmlnaHRMaW5lU2hvd24oKSAmJiBzdWJJY29uQnV0dG9uc1tpLTFdLnN1YkN0cmxzW3JpZ2h0TGluZUluZGV4XSAKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiBzdWJJY29uQnV0dG9uc1tpLTFdLnN1YkN0cmxzW3JpZ2h0TGluZUluZGV4XS5zZXRBY3RpdmVTdGF0ZSkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBzdWJJY29uQnV0dG9uc1tpLTFdLnN1YkN0cmxzW3JpZ2h0TGluZUluZGV4XS5zZXRBY3RpdmVTdGF0ZShpc0hvdmVyZWQpOworICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0KKyAgICAgICAgfSAgIAorCisgICAgICAgIGlmKGlzRHJvcERvd25PcGVuKXsKKyAgICAgICAgICAgIC8qCisgICAgICAgICAgICAgIElmIHRoZSBidXR0b24gaXMgbmV4dCB0byB0aGUgZHJvcGRvd24gYnV0dG9uIHRoZW4ganVzdCBrZWVwIHRoZSAKKyAgICAgICAgICAgICAgYnV0dG9ucyBsZWZ0IGxpbmUgb3IgaXRzIGxlZnQgbmVpZ2hib3JzIHJpZ2h0IGxpbmUgdG9nZ2xlZCBvbgorICAgICAgICAgICAgICBJZiB0aGUgYnV0dG9uIGlzIHRoZSBkcm9wZG93biBidXR0b24gZG9uJ3QgZG8gYW55dGhpbmcKKyAgICAgICAgICAgICAgZWxzZSBkbyB0aGluZ3Mgbm9ybWFsbHkgd2l0aHQgdGhlIGJ1dHRvbgorICAgICAgICAgICAgKi8KKyAgICAgICAgICAgIGlmKHN1Ykljb25CdXR0b25zW3N1Ykljb25CdXR0b25zTGVuZ3RoLTFdID09IGJ1dHRvbkN0cmwpeworCisgICAgICAgICAgICB9CisgICAgICAgICAgICBlbHNlIGlmKHN1Ykljb25CdXR0b25zW3N1Ykljb25CdXR0b25zTGVuZ3RoLTJdPT1idXR0b25DdHJsKXsKKyAgICAgICAgICAgICAgICBpZihzdWJJY29uQnV0dG9uc1tzdWJJY29uQnV0dG9uc0xlbmd0aC0yXS5pc0xlZnRMaW5lU2hvd24oKSkKKyAgICAgICAgICAgICAgICAgICAgc3ViSWNvbkJ1dHRvbnNbc3ViSWNvbkJ1dHRvbnNMZW5ndGgtMl0uc3ViQ3RybHNbbGVmdExpbmVJbmRleF0uc2V0QWN0aXZlU3RhdGUoaXNIb3ZlcmVkKTsKKyAgICAgICAgICAgICAgICBlbHNlIGlmKHN1Ykljb25CdXR0b25zTGVuZ3RoICAtIDMgPj0gMCl7CisgICAgICAgICAgICAgICAgICAgIGlmKHN1Ykljb25CdXR0b25zW3N1Ykljb25CdXR0b25zTGVuZ3RoLTNdLmlzUmlnaHRMaW5lU2hvd24oKSkKKyAgICAgICAgICAgICAgICAgICAgICAgIHN1Ykljb25CdXR0b25zW3N1Ykljb25CdXR0b25zTGVuZ3RoLTNdLnN1YkN0cmxzW3JpZ2h0TGluZUluZGV4XS5zZXRBY3RpdmVTdGF0ZShpc0hvdmVyZWQpOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH1lbHNleworICAgICAgICAgICAgICAgCisgICAgICAgICAgICAgICAgbm9WZXJ0aWNhbExpbmVUb2dnbGUoKTsKKworICAgICAgICAgICAgICAgIGlmKCRzY29wZS5pc0xlZnRMaW5lU2hvd24peworICAgICAgICAgICAgICAgICAgICB0aGlzLnN1YkN0cmxzW2xlZnRMaW5lSW5kZXhdLnNldEFjdGl2ZVN0YXRlKGlzSG92ZXJlZCk7CisgICAgICAgICAgICAgICAgfQorCisgICAgICAgICAgICAgICAgaWYoJHNjb3BlLmlzUmlnaHRMaW5lU2hvd24peworICAgICAgICAgICAgICAgICAgICB0aGlzLnN1YkN0cmxzW3JpZ2h0TGluZUluZGV4XS5zZXRBY3RpdmVTdGF0ZShpc0hvdmVyZWQpOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgICAgICBlbHNleworICAgICAgICAgICAgLy9IYW5kbGUgU3BlY2lhbCBjYXNlcyB3aGVyZSB0aGV5IGFyZW4ndCBzaG93aW5nIGFueSB2ZXJ0aWNhbCBsaW5lcworICAgICAgICAgICAgLy9hbmQgdGhlIGRyb3Bkb3duIGlzbid0IGRvd24KKyAgICAgICAgICAgIGlmKCEkc2NvcGUuaXNMZWZ0TGluZVNob3duICYmICEkc2NvcGUuaXNSaWdodExpbmVTaG93bil7CisgICAgICAgICAgICAgICAgbm9WZXJ0aWNhbExpbmVUb2dnbGUoKTsKKyAgICAgICAgICAgIH0gICAKKworICAgICAgICAgICAgaWYoJHNjb3BlLmlzTGVmdExpbmVTaG93bil7CisgICAgICAgICAgICAgICAgaWYodGhpcy5zdWJDdHJsc1tsZWZ0TGluZUluZGV4XS5zZXRBY3RpdmVTdGF0ZSkKKyAgICAgICAgICAgICAgICB0aGlzLnN1YkN0cmxzW2xlZnRMaW5lSW5kZXhdLnNldEFjdGl2ZVN0YXRlKGlzSG92ZXJlZCk7CisgICAgICAgICAgICB9CisKKyAgICAgICAgICAgIGlmKCRzY29wZS5pc1JpZ2h0TGluZVNob3duKXsKKyAgICAgICAgICAgICAgICBpZih0aGlzLnN1YkN0cmxzW3JpZ2h0TGluZUluZGV4XS5zZXRBY3RpdmVTdGF0ZSkKKyAgICAgICAgICAgICAgICB0aGlzLnN1YkN0cmxzW3JpZ2h0TGluZUluZGV4XS5zZXRBY3RpdmVTdGF0ZShpc0hvdmVyZWQpOworICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgfTsKKyAgCisgICAgdGhpcy5zZXRCdXR0b25UeXBlID0gZnVuY3Rpb24odHlwZSl7CisgICAgICAgIHZhciBidXR0b25JbmRleCA9IGdldERpckluZGV4KGljb25TdGF0ZUNvbnN0YW50cy5ESVJfVFlQRS5CVVRUT04pOworICAgICAgICBpZih0aGlzLnN1YkN0cmxzW2J1dHRvbkluZGV4XSAmJiB0aGlzLnN1YkN0cmxzW2J1dHRvbkluZGV4XS5zZXRUeXBlKQorICAgICAgICAgICAgdGhpcy5zdWJDdHJsc1tidXR0b25JbmRleF0uc2V0VHlwZSh0eXBlKTsKKyAgICB9OworCit9XSkKKy5kaXJlY3RpdmUoJ2F0dFNwbGl0SWNvbkJ1dHRvbicsIFsnJGRvY3VtZW50JywgJ2ljb25TdGF0ZUNvbnN0YW50cycsCisgICAgZnVuY3Rpb24oJGRvY3VtZW50LGljb25TdGF0ZUNvbnN0YW50cyl7CisgICAgcmV0dXJuIHsKKyAgICAgICAgcmVzdHJpY3Q6ICdFQScsCisgICAgICAgIHJlcGxhY2U6IHRydWUsCisgICAgICAgIHByaW9yaXR5OiAxMDAsCisgICAgICAgIHRyYW5zY2x1ZGU6IHRydWUsCisgICAgICAgIHJlcXVpcmU6IFsnXmF0dFNwbGl0SWNvbkJ1dHRvbkdyb3VwJywgJ2F0dFNwbGl0SWNvbkJ1dHRvbiddLAorICAgICAgICBjb250cm9sbGVyOiAnQXR0U3BsaXRJY29uQnV0dG9uQ3RybCcsCisgICAgICAgIHRlbXBsYXRlVXJsOiAnYXBwL3NjcmlwdHMvbmdfanNfYXR0X3RwbHMvc3BsaXRCdXR0b25Ecm9wZG93bi9zcGxpdEljb25CdXR0b24uaHRtbCcsCisgICAgICAgIHNjb3BlOnsKKyAgICAgICAgICAgIGljb246ICdAJywKKyAgICAgICAgICAgIGRyb3BEb3duSWQ6ICdAJworICAgICAgICB9LAorICAgICAgICBsaW5rOiBmdW5jdGlvbihzY29wZSxlbGVtZW50LGF0dHIsY3RybHMpeworCisgICAgICAgICAgCisgICAgICAgICAgICB2YXIgYXR0U3BsaXRCdXR0b25Hcm91cEN0cmwgPSBjdHJsc1swXTsKKyAgICAgICAgICAgIHZhciBhdHRTcGxpdEljb25CdXR0b25DdHJsID0gY3RybHNbMV07CisKKyAgICAgICAgICAgIGF0dFNwbGl0QnV0dG9uR3JvdXBDdHJsLmFkZEljb25CdXR0b24oYXR0U3BsaXRJY29uQnV0dG9uQ3RybCk7CisKKyAgICAgICAgICAgIGVsZW1lbnQuYmluZCgna2V5ZG93bicsIGZ1bmN0aW9uKGUpeworICAgICAgICAgICAgICAgIC8vQ2hlY2sgaWYgdGhlIGtleSBpcyB0aGUgdXAgb3IgZG93biBrZXkKKyAgICAgICAgICAgICAgICAvL2lmKCkKKyAgICAgICAgICAgICAgICBpZihlLndoaWNoID09IGljb25TdGF0ZUNvbnN0YW50cy5LRVlCT0FSRC5VUCB8fAorICAgICAgICAgICAgICAgICAgICBlLndoaWNoID09IGljb25TdGF0ZUNvbnN0YW50cy5LRVlCT0FSRC5ET1dOIHx8CisgICAgICAgICAgICAgICAgICAgIGUud2hpY2ggPT0gaWNvblN0YXRlQ29uc3RhbnRzLktFWUJPQVJELkVOVEVSIHx8CisgICAgICAgICAgICAgICAgICAgIGUud2hpY2ggPT0gaWNvblN0YXRlQ29uc3RhbnRzLktFWUJPQVJELkVTQyApIHsKKworICAgICAgICAgICAgICAgICAgICBzY29wZS5jbGlja0hhbmRsZXIoKTsKKyAgICAgICAgICAgICAgICAgICAgc2NvcGUuJGJyb2FkY2FzdChpY29uU3RhdGVDb25zdGFudHMuU1BMSVRfSUNPTl9CVE5fRVZFTlRfRU1JVFRFUl9LRVksIGUpOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0pOworCisgICAgICAgICAgICBzY29wZS5kcm9wRG93bldhdGNoID0gZmFsc2U7CisKKyAgICAgICAgICAgIHNjb3BlLmljb25TdGF0ZUNvbnN0YW50cyA9IGljb25TdGF0ZUNvbnN0YW50czsKKworICAgICAgICAgICAgc2NvcGUuY2xpY2tIYW5kbGVyID0gZnVuY3Rpb24oKXsKKyAgICAgICAgICAgICAgICBhdHRTcGxpdEJ1dHRvbkdyb3VwQ3RybC5oaWRlTGVmdExpbmVSaWdodEJ1dHRvbihhdHRTcGxpdEljb25CdXR0b25DdHJsKTsKKyAgICAgICAgICAgIH07CisgICAgICAgICAgICAKKyAgICAgICAgICAgIHNjb3BlLiR3YXRjaCgnaXNIb3ZlcmVkJywgZnVuY3Rpb24odmFsKXsKKyAgICAgICAgICAgICAgICBpZih2YWwpeworICAgICAgICAgICAgICAgICAgICBhdHRTcGxpdEljb25CdXR0b25DdHJsLnRvZ2dsZUxpbmVzKHZhbCxhdHRTcGxpdEJ1dHRvbkdyb3VwQ3RybCxhdHRTcGxpdEljb25CdXR0b25DdHJsLGF0dFNwbGl0QnV0dG9uR3JvdXBDdHJsLmlzRHJvcERvd25PcGVuKTsKKyAgICAgICAgICAgICAgICB9ZWxzZXsKKyAgICAgICAgICAgICAgICAgICAgYXR0U3BsaXRJY29uQnV0dG9uQ3RybC50b2dnbGVMaW5lcyh2YWwsYXR0U3BsaXRCdXR0b25Hcm91cEN0cmwsYXR0U3BsaXRJY29uQnV0dG9uQ3RybCxhdHRTcGxpdEJ1dHRvbkdyb3VwQ3RybC5pc0Ryb3BEb3duT3Blbik7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfSk7CisKKyAgICAgICAgICAgIHNjb3BlLiR3YXRjaCgnZHJvcERvd25XYXRjaCcsIGZ1bmN0aW9uKHZhbCl7CisgICAgICAgICAgICAgICAgYXR0U3BsaXRCdXR0b25Hcm91cEN0cmwuaXNEcm9wRG93bk9wZW4gPSB2YWw7CisgICAgICAgICAgICAgICAgYXR0U3BsaXRCdXR0b25Hcm91cEN0cmwudG9nZ2xlRHJvcGRvd25TdGF0ZSh2YWwpOworICAgICAgICAgICAgfSk7CisgICAgICAgIH0KKyAgICB9Cit9XSkKKy5jb250cm9sbGVyKCdBdHRTcGxpdEljb25CdXR0b25Hcm91cEN0cmwnLCAgIFsnJHNjb3BlJywnaWNvblN0YXRlQ29uc3RhbnRzJyxmdW5jdGlvbigkc2NvcGUsaWNvblN0YXRlQ29uc3RhbnRzKXsKKyAgICAKKyAgICB0aGlzLnN1Ykljb25CdXR0b25zID0gW107CisgICAgdGhpcy5hZGRJY29uQnV0dG9uID0gZnVuY3Rpb24oaWNvbkJ1dHRvbil7CisgICAgICAgdGhpcy5zdWJJY29uQnV0dG9ucy5wdXNoKGljb25CdXR0b24pOworICAgIH07CisKKyAgICB0aGlzLmlzRHJvcERvd25PcGVuID0gZmFsc2U7CisKKyAgICB0aGlzLmhpZGVMZWZ0TGluZVJpZ2h0QnV0dG9uID0gZnVuY3Rpb24oYnRuKXsKKyAgICAgICAgdmFyIG51bUJ1dHRvbnMgPSB0aGlzLnN1Ykljb25CdXR0b25zLmxlbmd0aDsKKyAgICAgICAgdmFyIGJ1dHRvbkxlZnRPZlJpZ2h0TW9zdCA9IHRoaXMuc3ViSWNvbkJ1dHRvbnNbbnVtQnV0dG9ucyAtIDJdOworICAgICAgICB2YXIgcmlnaHRNb3N0QnV0dG9uID0gdGhpcy5zdWJJY29uQnV0dG9uc1tudW1CdXR0b25zIC0xXTsKKworICAgICAgICBpZiAoYnRuICE9IGJ1dHRvbkxlZnRPZlJpZ2h0TW9zdCAmJiBidG4gIT0gcmlnaHRNb3N0QnV0dG9uICl7CisgICAgICAgICAgICByaWdodE1vc3RCdXR0b24uc2V0TGVmdExpbmVIb3ZlcihmYWxzZSk7CisgICAgICAgIH0KKyAgICB9OworCisgICAgdGhpcy50b2dnbGVEcm9wZG93blN0YXRlID0gZnVuY3Rpb24oaXNEcm9wRG93bk9wZW4peworCisgICAgICAgIHZhciBudW1CdXR0b25zID0gdGhpcy5zdWJJY29uQnV0dG9ucy5sZW5ndGg7CisgICAKKyAgICAgICAgaWYobnVtQnV0dG9ucyA+IDIpeworICAgICAgICAKKyAgICAgICAgICAgIGlmKGlzRHJvcERvd25PcGVuKXsKKworICAgICAgICAgICAgICAgIGlmKHRoaXMuc3ViSWNvbkJ1dHRvbnNbbnVtQnV0dG9ucyAtIDJdLmlzUmlnaHRMaW5lU2hvd24oKSkKKyAgICAgICAgICAgICAgICAgICAgdGhpcy5zdWJJY29uQnV0dG9uc1tudW1CdXR0b25zIC0gMl0uc2V0UmlnaHRMaW5lSG92ZXIodHJ1ZSk7CisgICAgICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgICAgICAgICB0aGlzLnN1Ykljb25CdXR0b25zW251bUJ1dHRvbnMgLSAxXS5zZXRMZWZ0TGluZUhvdmVyKHRydWUpOworCisgICAgICAgICAgICAgICAgdGhpcy5zdWJJY29uQnV0dG9uc1tudW1CdXR0b25zIC0gMl0uc2V0QnV0dG9uVHlwZShpY29uU3RhdGVDb25zdGFudHMuTkVYVF9UT19EUk9QRE9XTik7CisgICAgICAgICAgICB9ZWxzZXsKKyAgICAgICAgICAgICAgICAKKyAgICAgICAgICAgICAgICB0aGlzLnN1Ykljb25CdXR0b25zW251bUJ1dHRvbnMgLSAxXS5zZXRMZWZ0TGluZUhvdmVyKGZhbHNlKTsKKyAgICAgICAgICAgICAgICB0aGlzLnN1Ykljb25CdXR0b25zW251bUJ1dHRvbnMgLSAyXS5zZXRCdXR0b25UeXBlKGljb25TdGF0ZUNvbnN0YW50cy5NSURETEUpOworICAgICAgICAgICAgfQorCisgICAgICAgIH1lbHNleworCisgICAgICAgICAgICBpZihpc0Ryb3BEb3duT3Blbil7CisgICAgICAgICAgICAgICAgdGhpcy5zdWJJY29uQnV0dG9uc1swXS5zZXRSaWdodExpbmVIb3Zlcih0cnVlKTsKKyAgICAgICAgICAgICAgICB0aGlzLnN1Ykljb25CdXR0b25zWzBdLnNldEJ1dHRvblR5cGUoaWNvblN0YXRlQ29uc3RhbnRzLkxFRlRfTkVYVF9UT19EUk9QRE9XTik7CisgICAgICAgICAgICB9ZWxzZXsKKyAgICAgICAgICAgICAgICB0aGlzLnN1Ykljb25CdXR0b25zWzBdLnNldEJ1dHRvblR5cGUoaWNvblN0YXRlQ29uc3RhbnRzLkxFRlQpOworICAgICAgICAgICAgfQorICAgICAgICB9CisKKyAgICB9OworCit9XSkKKy5kaXJlY3RpdmUoJ2F0dFNwbGl0SWNvbkJ1dHRvbkdyb3VwJywgWyckZG9jdW1lbnQnLCAnJHRpbWVvdXQnLCAgJ2ljb25TdGF0ZUNvbnN0YW50cycgLGZ1bmN0aW9uKCRkb2N1bWVudCwkdGltZW91dCxpY29uU3RhdGVDb25zdGFudHMpeworICAgIHJldHVybiB7CisgICAgICAgIHJlc3RyaWN0OiAnRUEnLAorICAgICAgICByZXBsYWNlOiB0cnVlLAorICAgICAgICBwcmlvcml0eTogNTAsCisgICAgICAgIHRyYW5zY2x1ZGU6IHRydWUsCisgICAgICAgIHJlcXVpcmU6ICdhdHRTcGxpdEljb25CdXR0b25Hcm91cCcsCisgICAgICAgIGNvbnRyb2xsZXI6ICdBdHRTcGxpdEljb25CdXR0b25Hcm91cEN0cmwnLAorICAgICAgICB0ZW1wbGF0ZVVybDogJ2FwcC9zY3JpcHRzL25nX2pzX2F0dF90cGxzL3NwbGl0QnV0dG9uRHJvcGRvd24vc3BsaXRJY29uQnV0dG9uR3JvdXAuaHRtbCcsCisgICAgICAgIHNjb3BlOnt9LAorICAgICAgICBsaW5rOiBmdW5jdGlvbihzY29wZSxlbGVtZW50LGF0dHIsY3RybHMpeworCisgICAgICAgICAgICAkdGltZW91dChpbml0aWFsaXplLDEwMCk7CisgICAgICAgICAKKyAgICAgICAgICAgIGZ1bmN0aW9uIGluaXRpYWxpemUoKXsKKworICAgICAgICAgICAgICAgIHZhciBzdWJJY29uQnV0dG9uQ3RybHMgPSBjdHJscy5zdWJJY29uQnV0dG9uczsKKyAgICAgICAgICAgICAgICB2YXIgbGVmdE1vc3RCdXR0b25JbmRleCA9IDA7CisgICAgICAgICAgICAgICAgdmFyIHJpZ2h0TW9zdEJ1dHRvbkluZGV4ID1zdWJJY29uQnV0dG9uQ3RybHMubGVuZ3RoLTE7CisKKyAgICAgICAgICAgICAgICAvL2xlZnQgbW9zdCBidXR0b24gY29uZmlnCisgICAgICAgICAgICAgICAgc3ViSWNvbkJ1dHRvbkN0cmxzW2xlZnRNb3N0QnV0dG9uSW5kZXhdLnNldEJ1dHRvblR5cGUoaWNvblN0YXRlQ29uc3RhbnRzLkxFRlQpOworICAgICAgICAgICAgICAgIHN1Ykljb25CdXR0b25DdHJsc1tsZWZ0TW9zdEJ1dHRvbkluZGV4XS5pc0xlZnRMaW5lU2hvd24oZmFsc2UpOworICAgICAgICAgICAgICAgIHN1Ykljb25CdXR0b25DdHJsc1tsZWZ0TW9zdEJ1dHRvbkluZGV4XS5pc1JpZ2h0TGluZVNob3duKHRydWUpOworCisgICAgICAgICAgICAgICAgLy9yaWdodCBtb3N0IGJ1dHRvbiBjb25maWcKKyAgICAgICAgICAgICAgICBzdWJJY29uQnV0dG9uQ3RybHNbcmlnaHRNb3N0QnV0dG9uSW5kZXhdLnNldEJ1dHRvblR5cGUoaWNvblN0YXRlQ29uc3RhbnRzLlJJR0hUKTsKKyAgICAgICAgICAgICAgICBzdWJJY29uQnV0dG9uQ3RybHNbcmlnaHRNb3N0QnV0dG9uSW5kZXhdLmlzUmlnaHRMaW5lU2hvd24oZmFsc2UpOworICAgICAgICAgICAgICAgIHN1Ykljb25CdXR0b25DdHJsc1tyaWdodE1vc3RCdXR0b25JbmRleF0uaXNMZWZ0TGluZVNob3duKGZhbHNlKTsKKworICAgICAgICAgICAgICAgIC8vbWlkZGxlIGJ1dHRvbnMgY29uZmlnCisgICAgICAgICAgICAgICAgaWYocmlnaHRNb3N0QnV0dG9uSW5kZXggPj0gMil7CisgICAgICAgICAgICAgICAgICAgIHZhciBpbmRleCA9IDE7CisgICAgICAgICAgICAgICAgICAgIHdoaWxlKGluZGV4IDwgcmlnaHRNb3N0QnV0dG9uSW5kZXgpeworICAgICAgICAgICAgICAgICAgICAgICAgc3ViSWNvbkJ1dHRvbkN0cmxzW2luZGV4XS5zZXRCdXR0b25UeXBlKGljb25TdGF0ZUNvbnN0YW50cy5NSURETEUpOworICAgICAgICAgICAgICAgICAgICAgICAgc3ViSWNvbkJ1dHRvbkN0cmxzW2luZGV4XS5pc1JpZ2h0TGluZVNob3duKGZhbHNlKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIHN1Ykljb25CdXR0b25DdHJsc1tpbmRleF0uaXNMZWZ0TGluZVNob3duKGZhbHNlKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIGluZGV4Kys7CisgICAgICAgICAgICAgICAgICAgIH0KKworICAgICAgICAgICAgICAgICAgICB2YXIgc2tpcEluZGV4ID0gMjsKKyAgICAgICAgICAgICAgICAgICAgd2hpbGUoc2tpcEluZGV4IDw9IHJpZ2h0TW9zdEJ1dHRvbkluZGV4KXsKKyAgICAgICAgICAgICAgICAgICAgICAgIGlmKHNraXBJbmRleCA9PSByaWdodE1vc3RCdXR0b25JbmRleCl7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgc3ViSWNvbkJ1dHRvbkN0cmxzW3NraXBJbmRleF0uaXNMZWZ0TGluZVNob3duKHRydWUpOworICAgICAgICAgICAgICAgICAgICAgICAgfWVsc2V7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgc3ViSWNvbkJ1dHRvbkN0cmxzW3NraXBJbmRleF0uaXNSaWdodExpbmVTaG93bih0cnVlKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBzdWJJY29uQnV0dG9uQ3RybHNbc2tpcEluZGV4XS5pc0xlZnRMaW5lU2hvd24odHJ1ZSk7IAorICAgICAgICAgICAgICAgICAgICAgICAgfSAKKyAgICAgICAgICAgICAgICAgICAgICAgIHNraXBJbmRleCA9IHNraXBJbmRleCArIDI7CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICB9CisKKyAgICAgICAgICAgICAgICAvL3JlcG9zaXRpb24gdGhlIGRyb3Bkb3duCisgICAgICAgICAgICAgICAgdmFyIHVsRWxlbSA9IGVsZW1lbnQuZmluZCgndWwnKTsKKyAgICAgICAgICAgICAgICBpZih1bEVsZW0ubGVuZ3RoID4gMCl7CisgICAgICAgICAgICAgICAgICAgIHZhciBudW1CdXR0b25zID0gcmlnaHRNb3N0QnV0dG9uSW5kZXgrMTsKKyAgICAgICAgICAgICAgICAgICAgaWYobnVtQnV0dG9ucyA+IDIpeworICAgICAgICAgICAgICAgICAgICAgICAgdmFyIG9mZnNldCA9IChudW1CdXR0b25zKSozNC03MCsobnVtQnV0dG9ucy8xLjUpICsgMC41OworICAgICAgICAgICAgICAgICAgICAgICAgdmFyIG9mZlNldFN0ciA9IG9mZnNldCsncHgnOworICAgICAgICAgICAgICAgICAgICAgICAgYW5ndWxhci5lbGVtZW50KHVsRWxlbSkuY3NzKCdsZWZ0JyxvZmZTZXRTdHIpOworICAgICAgICAgICAgICAgICAgICAgICAgYW5ndWxhci5lbGVtZW50KHVsRWxlbSkuY3NzKCdib3JkZXItdG9wLWxlZnQtcmFkaXVzJywnMHB4Jyk7CisgICAgICAgICAgICAgICAgICAgIH1lbHNleworICAgICAgICAgICAgICAgICAgICAgICAgYW5ndWxhci5lbGVtZW50KHVsRWxlbSkuY3NzKCdsZWZ0JywnMHB4Jyk7CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9CisgICAgICAgIH0KKyAgICB9Cit9XSk7CisKK2FuZ3VsYXIubW9kdWxlKCdhdHQuYWJzLnN0ZXB0cmFja2VyJywgWydhdHQuYWJzLnRyYW5zaXRpb24nXSkKKyAgICAuZGlyZWN0aXZlKCdzdGVwdHJhY2tlcicsIFsnJHRpbWVvdXQnLCBmdW5jdGlvbigkdGltZW91dCkgeworICAgICAgICByZXR1cm4geworICAgICAgICAgICAgcHJpb3JpdHk6IDEwMCwgLy8gVGhpcyBhbGxvd3MgZGV2J3MgY2xpY2tIYW5kbGVyIHRvIGNhbmNlbCBhbiBvcGVyYXRpb24KKyAgICAgICAgICAgIHNjb3BlOiB7CisgICAgICAgICAgICAgICAgc2RhdGE6ICI9c2RhdGEiLAorICAgICAgICAgICAgICAgIGNzdGVwOiI9Y3VycmVudFN0ZXAiLAorICAgICAgICAgICAgICAgIGNsaWNrSGFuZGxlcjogJz0/JywKKyAgICAgICAgICAgICAgICBkaXNhYmxlQ2xpY2s6ICc9PycKKyAgICAgICAgICAgIH0sCisgICAgICAgICAgICByZXN0cmljdDogJ0VBJywKKyAgICAgICAgICAgIHJlcGxhY2U6IHRydWUsCisgICAgICAgICAgICB0ZW1wbGF0ZVVybDogJ2FwcC9zY3JpcHRzL25nX2pzX2F0dF90cGxzL3N0ZXB0cmFja2VyL3N0ZXAtdHJhY2tlci5odG1sJywKKyAgICAgICAgICAgIGxpbms6IGZ1bmN0aW9uKHNjb3BlLCBlbGVtLCBhdHRyLCBjdHJsKSB7CisgICAgICAgICAgICAgICAgaWYgKHNjb3BlLmRpc2FibGVDbGljayA9PT0gdW5kZWZpbmVkKSB7CisgICAgICAgICAgICAgICAgICAgIHNjb3BlLmRpc2FibGVDbGljayA9IGZhbHNlOworICAgICAgICAgICAgICAgIH0KKworICAgICAgICAgICAgICAgICR0aW1lb3V0KGZ1bmN0aW9uKCkgeworICAgICAgICAgICAgICAgICAgICBpZihzY29wZS5jc3RlcCA8IDEpeworICAgICAgICAgICAgICAgICAgICAgICAgc2NvcGUuY3N0ZXAgPSAxOworICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgIGVsc2UgaWYoc2NvcGUuY3N0ZXAgPiBzY29wZS5zZGF0YS5sZW5ndGgpeworICAgICAgICAgICAgICAgICAgICAgICAgc2NvcGUuY3N0ZXAgPSBzY29wZS5zZGF0YS5sZW5ndGg7CisgICAgICAgICAgICAgICAgICAgIH0KKworICAgICAgICAgICAgICAgICAgICB2YXIgZGl2cyA9IGVsZW0uZmluZCgnZGl2Jyk7CisgICAgICAgICAgICAgICAgICAgIHZhciBzbGlkZXJ0cmFja3MgPSBbXTsKKyAgICAgICAgICAgICAgICAgICAgZm9yKHZhciBpIGluIGRpdnMpeworICAgICAgICAgICAgICAgICAgICAgICAgaWYoZGl2cy5lcShpKVswXSl7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFyIGVsID0gZGl2cy5lcShpKVswXS5jbGFzc05hbWU7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYoZWwuaW5kZXhPZigndHJhY2sgbmctc2NvcGUnKSA+IC0xKXsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2xpZGVydHJhY2tzLnB1c2goZGl2cy5lcShpKSk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICB9CisKKyAgICAgICAgICAgICAgICAgICAgdmFyIGN1cnJlbnRQYWdlOworICAgICAgICAgICAgICAgICAgICB2YXIgdG90YWxQYWdlOworICAgICAgICAgICAgICAgICAgICB2YXIgY3VycmVudFRyYWNrID0gdXBkYXRlQ3VycmVudFRyYWNrKHNjb3BlLmNzdGVwKTsKKworICAgICAgICAgICAgICAgICAgICBmdW5jdGlvbiB1cGRhdGVDdXJyZW50VHJhY2soc3RlcCkgeworICAgICAgICAgICAgICAgICAgICAgICAgLy8gQWx3YXlzIHJldHVybiB0aGUgc3RlcC0xIGJlY2F1c2UgYXJyYXkgc3RhcnRzIGF0IDAKKyAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBhbmd1bGFyLmVsZW1lbnQoc2xpZGVydHJhY2tzW3N0ZXAtMV0pOworICAgICAgICAgICAgICAgICAgICB9OworCisgICAgICAgICAgICAgICAgICAgIGZ1bmN0aW9uIHVwZGF0ZVRyYWNrV2lkdGgoKSB7CisgICAgICAgICAgICAgICAgICAgICAgICBpZiAoc2NvcGUuY3N0ZXAgPiAwICYmIHNjb3BlLmNzdGVwIDw9IHNjb3BlLnNkYXRhLmxlbmd0aC0xICYmIGN1cnJlbnRQYWdlID4gMCkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhciBuZXdXaWR0aCA9ICgoY3VycmVudFBhZ2UvdG90YWxQYWdlKSoxMDApICsgIiUiOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGN1cnJlbnRUcmFjayA9IHVwZGF0ZUN1cnJlbnRUcmFjayhzY29wZS5jc3RlcCk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgY3VycmVudFRyYWNrLmNzcygnd2lkdGgnLCBuZXdXaWR0aCk7CisgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgIH07CisKKyAgICAgICAgICAgICAgICAgICAgZnVuY3Rpb24gdXBkYXRlUGFnZXMoKSB7CisgICAgICAgICAgICAgICAgICAgICAgICBpZiAoc2NvcGUuY3N0ZXAgPD0gc2NvcGUuc2RhdGEubGVuZ3RoKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgY3VycmVudFBhZ2UgPSBzY29wZS5zZGF0YVtzY29wZS5jc3RlcC0xXVsnY3VycmVudFBhZ2UnXTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB0b3RhbFBhZ2UgPSBzY29wZS5zZGF0YVtzY29wZS5jc3RlcC0xXVsndG90YWxQYWdlcyddOworICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICB9OworCisgICAgICAgICAgICAgICAgICAgIC8vIGR5bmFtaWNhbGx5IGFkZCB3aWR0aCBmb3Igc3RlcHMsIGRlcGVuZGluZyBvbiB0aGUgbnVtYmVyIG9mIHN0ZXBzLgorICAgICAgICAgICAgICAgICAgICBzY29wZS5zZXRfd2lkdGggPSBmdW5jdGlvbihpbmRleHZhbCkgeworICAgICAgICAgICAgICAgICAgICAgICAgdmFyIHNldHdpZHRoID0gKDEwMCAvIChzY29wZS5zZGF0YS5sZW5ndGggLSAxKSkgKyAiJSI7CisKKyAgICAgICAgICAgICAgICAgICAgICAgIC8vIHNraXAgbGFzdCBlbGVtZW50IGFuZCBhZGQgd2lkdGggZm9yIGFsbCBvdGhlciBlbGVtZW50CisgICAgICAgICAgICAgICAgICAgICAgICBpZiAoKHNjb3BlLnNkYXRhLmxlbmd0aCAtIDEpID4gaW5kZXh2YWwpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4geyd3aWR0aCc6IHNldHdpZHRofTsKKyAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgfTsKKworICAgICAgICAgICAgICAgICAgICBzY29wZS4kd2F0Y2goJ3NkYXRhJywgZnVuY3Rpb24oY3VycmVudCwgcHJldmlvdXMpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIHVwZGF0ZVBhZ2VzKCk7CisgICAgICAgICAgICAgICAgICAgICAgICB2YXIgcHJldlN0ZXAgPSBzY29wZS5jc3RlcDsKKworICAgICAgICAgICAgICAgICAgICAgICAgLy8gQmVmb3JlIGFueXRoaW5nLCBlbnN1cmUgY3VycmVudFBhZ2UgaXMgbmV2ZXIgYmVsb3cgMQorICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGN1cnJlbnRQYWdlIDwgMSkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGN1cnJlbnRQYWdlID0gMTsKKworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChzY29wZS5jc3RlcCAhPSAxKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vIERlY3JlYXNlIHN0ZXAsIGN1cnJlbnQgdHJhY2sgd2lkdGggaXMgMCUsIG5ldyBzdGVwIHdpZHRoIHVwZGF0ZXMKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2NvcGUuY3N0ZXAtLTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdXBkYXRlUGFnZXMoKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICAvLyBNb3ZlIHRvIG5leHQgc3RlcCwgcmVzZXQgY3VycmVudFBhZ2UsIHRvdGFsUGFnZSwgYW5kIGVuc3VyZSBwcmV2aW91cyBzdGVwcyBhcmUgY29tcGxldGVkCisgICAgICAgICAgICAgICAgICAgICAgICBpZiAoY3VycmVudFBhZ2UgPiB0b3RhbFBhZ2UpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoc2NvcGUuY3N0ZXAgPiBzY29wZS5zZGF0YS5sZW5ndGgtMSkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzY29wZS5jc3RlcCsrOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm47CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY3VycmVudFBhZ2UgPSB0b3RhbFBhZ2U7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHVwZGF0ZVRyYWNrV2lkdGgoKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2NvcGUuY3N0ZXArKzsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdXBkYXRlUGFnZXMoKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdXBkYXRlVHJhY2tXaWR0aCgpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgIH0KKworICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGN1cnJlbnRQYWdlIDwgMSAmJiBwcmV2U3RlcCA9PT0gc2NvcGUuY3N0ZXApIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBjdXJyZW50UGFnZSA9IDE7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHNjb3BlLmNzdGVwID4gMSkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzY29wZS5jc3RlcC0tOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzY29wZS5zZGF0YVtzY29wZS5jc3RlcC0xXVsnY3VycmVudFBhZ2UnXSA9IHNjb3BlLnNkYXRhW3Njb3BlLmNzdGVwLTFdWyd0b3RhbFBhZ2VzJ107CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNjb3BlLnNkYXRhW3Njb3BlLmNzdGVwXVsnY3VycmVudFBhZ2UnXSA9IDE7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgfQorCisgICAgICAgICAgICAgICAgICAgICAgICB1cGRhdGVUcmFja1dpZHRoKCk7CisgICAgICAgICAgICAgICAgICAgIH0sIHRydWUpOworCisKKyAgICAgICAgICAgICAgICAgICAgLy9hZGQgdGhlIGFjdGl2ZSBjbGFzcyBmb3IgY3VycmVudCBzdGVwCisgICAgICAgICAgICAgICAgICAgIHNjb3BlLmFjdGl2ZXN0ZXAgPSBmdW5jdGlvbihpbmRleCkgeworICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGluZGV4ID09PSBzY29wZS5jc3RlcC0xKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiB0cnVlOworICAgICAgICAgICAgICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBmYWxzZTsKKyAgICAgICAgICAgICAgICAgICAgfTsKKyAgICAgICAgICAgICAgICAgICAgLy9hZGQgdGhlIGRvbmUgY2xhc3MgZm9yIGZpbmlzaGVkIHN0ZXAKKyAgICAgICAgICAgICAgICAgICAgc2NvcGUuZG9uZXN0ZXBzID0gZnVuY3Rpb24oaW5kZXgpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIGlmIChpbmRleCA8IHNjb3BlLmNzdGVwLTEpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHRydWU7CisgICAgICAgICAgICAgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGZhbHNlOworICAgICAgICAgICAgICAgICAgICB9OworICAgICAgICAgICAgICAgICAgICAvL2FkZCB0aGUgbGFzdCBjbGFzcyBmb3IgZmluYWwgc3RlcAorICAgICAgICAgICAgICAgICAgICBzY29wZS5sYXN0c3RlcCA9IGZ1bmN0aW9uKGluZGV4KSB7CisgICAgICAgICAgICAgICAgICAgICAgICBpZiAoaW5kZXggPT09IHNjb3BlLnNkYXRhLmxlbmd0aC0xKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiB0cnVlOworICAgICAgICAgICAgICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBmYWxzZTsKKyAgICAgICAgICAgICAgICAgICAgfTsKKworICAgICAgICAgICAgICAgICAgICBzY29wZS5pc0luY29tcGxldGUgPSBmdW5jdGlvbihpbmRleCkgeworICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGluZGV4ID09PSBzY29wZS5jc3RlcC0xKSByZXR1cm4gZmFsc2U7CisKKyAgICAgICAgICAgICAgICAgICAgICAgIGlmIChpbmRleCA+PSAwICYmIGluZGV4IDwgc2NvcGUuc2RhdGEubGVuZ3RoLTEpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyBJZiBjdXJyZW50UGFnZSA8PSB0b3RhbFBhZ2UgdGhlbiByZXR1cm4gdHJ1ZQorICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhciBzdGVwID0gc2NvcGUuc2RhdGFbaW5kZXhdOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChzdGVwWydjdXJyZW50UGFnZSddIDw9IHN0ZXBbJ3RvdGFsUGFnZXMnXSkgcmV0dXJuIHRydWU7IGVsc2UgcmV0dXJuIGZhbHNlOworICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICB9OworCisgICAgICAgICAgICAgICAgICAgIC8vY2xpY2sgZXZlbnQKKyAgICAgICAgICAgICAgICAgICAgc2NvcGUuc3RlcGNsaWNrID0gZnVuY3Rpb24oJGV2ZW50LCBzdGVwcykgeworCisgICAgICAgICAgICAgICAgICAgICAgICAvLyBJZiB3ZSBhcmUgZGVjcmVhc2luZyBzdGVwcywgcmVzZXQgYWxsIGN1cnJlbnRQYWdlIGNvdW50cyB0byAxCisgICAgICAgICAgICAgICAgICAgICAgICBpZiAoc3RlcHMgPCBzY29wZS5jc3RlcCkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZvciAodmFyIGkgPSBzY29wZS5jc3RlcC0xOyBpID4gc3RlcHM7IGktLSkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzY29wZS5zZGF0YVtpXVsnY3VycmVudFBhZ2UnXSA9IDE7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNjb3BlLnNkYXRhW3N0ZXBzXVsnY3VycmVudFBhZ2UnXS0tOworICAgICAgICAgICAgICAgICAgICAgICAgfQorCisgICAgICAgICAgICAgICAgICAgICAgICBpZiAoYW5ndWxhci5pc0Z1bmN0aW9uKHNjb3BlLmNsaWNrSGFuZGxlcikpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBzY29wZS5jbGlja0hhbmRsZXIoJGV2ZW50LCBzdGVwcyk7CisgICAgICAgICAgICAgICAgICAgICAgICB9CisKKyAgICAgICAgICAgICAgICAgICAgICAgIHNjb3BlLmNzdGVwPXN0ZXBzKzE7CisKKyAgICAgICAgICAgICAgICAgICAgICAgIC8vIEluIHRoZSBjYXNlIHdlIGRlY3JlbWVudGVkIHByZXZpb3VzbHkgZnJvbSB0aGlzIHN0ZXAsIHdlIG5lZWQgdG8gcmVzZXQgY3VycmVudHBhZ2UgdG8gZGVmYXVsdAorICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHNjb3BlLmNzdGVwIDw9IHNjb3BlLnNkYXRhLmxlbmd0aCAmJiBzY29wZS5zZGF0YVtzY29wZS5jc3RlcF1bJ2N1cnJlbnRQYWdlJ10gPCAxKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2NvcGUuc2RhdGFbc2NvcGUuY3N0ZXBdWydjdXJyZW50UGFnZSddID0gMTsKKyAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgIHVwZGF0ZVBhZ2VzKCk7CisgICAgICAgICAgICAgICAgICAgICAgICB1cGRhdGVUcmFja1dpZHRoKCk7CisgICAgICAgICAgICAgICAgICAgIH07CisgICAgICAgICAgICAgICAgfSwgMTAwKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfTsKKyAgICB9CisgICAgXSkKKy5jb25zdGFudCgndGltZWxpbmVDb25zdGFudHMnLHsKKyAgICBTVEVQX1RZUEU6eworICAgICAgICBBTEVSVDonYWxlcnQnLAorICAgICAgICBDT01QTEVURUQ6J2NvbXBsZXRlZCcsCisgICAgICAgIENBTkNFTExFRDogJ2NhbmNlbGxlZCcKKyAgICB9Cit9KQorLmNvbnRyb2xsZXIoJ0F0dFRpbWVsaW5lQ3RybCcgLCBbJyRzY29wZScsICckdGltZW91dCcsIGZ1bmN0aW9uKCRzY29wZSwkdGltZW91dCl7CisKKyAgICB2YXIgdGltZWxpbmVCYXJDdHJscyA9IFtdOworICAgIHZhciB0aW1lbGluZURvdEN0cmxzID0gW107CisKKyAgICB0aGlzLm51bVN0ZXBzID0gMDsKKworICAgIHRoaXMuaXNBbHRlcm5hdGUgPSBmdW5jdGlvbigpeworICAgICAgICByZXR1cm4gJHNjb3BlLmFsdGVybmF0ZTsKKyAgICB9CisKKyAgICB0aGlzLmFkZFRpbWVsaW5lQmFyQ3RybHMgPSBmdW5jdGlvbih0KXsKKyAgICAgICAgdGltZWxpbmVCYXJDdHJscy5wdXNoKHQpOyAgICAgICAKKyAgICB9OworCisgICAgdGhpcy5hZGRUaW1lbGluZURvdEN0cmxzID0gZnVuY3Rpb24oYil7CisgICAgICAgIHRpbWVsaW5lRG90Q3RybHMucHVzaChiKTsKKyAgICB9OworCisgICAgJHRpbWVvdXQoaW5pdCwyMDApOworICAgIAorICAgIGZ1bmN0aW9uIGluaXQoKXsKKyAKKyAgICAgICAgZnVuY3Rpb24gY29tcGFyZShhLGIpIHsKKyAgICAgICAgICBpZiAoYS5vcmRlciA8IGIub3JkZXIpCisgICAgICAgICAgICAgcmV0dXJuIC0xOworICAgICAgICAgIGlmIChhLm9yZGVyID4gYi5vcmRlcikKKyAgICAgICAgICAgIHJldHVybiAxOworICAgICAgICAgIHJldHVybiAwOworICAgICAgICB9CisKKyAgICAgICAgdGltZWxpbmVEb3RDdHJscy5zb3J0KGNvbXBhcmUpOworICAgICAgICB0aW1lbGluZUJhckN0cmxzLnNvcnQoY29tcGFyZSk7CisKKyAgICAgICAgaWYoJHNjb3BlLiRwYXJlbnQuYW5pbWF0ZSkKKyAgICAgICAgICAgIGFuaW1hdGVTZXF1ZW5jZSgpOworICAgICAgICAKKyAgICAgICAgJHNjb3BlLiR3YXRjaCgndHJpZ2dlcicsIGZ1bmN0aW9uKHZhbCl7CisgICAgICAgICAgICBpZih2YWwpeworICAgICAgICAgICAgICAgICRzY29wZS5yZXNldFRpbWVsaW5lKCk7CisgICAgICAgICAgICB9ZWxzZXsKKyAgICAgICAgICAgICAgICAkc2NvcGUuJHBhcmVudC5hbmltYXRlID0gZmFsc2U7CisgICAgICAgICAgICB9CisgICAgICAgIH0pOworICAgIH0KKworICAgIGZ1bmN0aW9uIGFuaW1hdGVTZXF1ZW5jZSgpeworCisgICAgICAgIHZhciBkb3RzRHVyYXRpb24gPSAuMjU7CisgICAgICAgIHZhciB0aW1lbGluZUJhclByb2dyZXNzRHVyYXRpb24gPSAuMjU7CisKKyAgICAgICAgaWYodHlwZW9mICRzY29wZS5iYXJBbmltYXRlRHVyYXRpb24gPT0gJ251bWJlcicpCisgICAgICAgICAgICB0aW1lbGluZUJhclByb2dyZXNzRHVyYXRpb24gPSAkc2NvcGUuYmFyQW5pbWF0ZUR1cmF0aW9uOworICAgICAgICAKKyAgICAgICAgdmFyIHN0YXJ0ID0gY3JlYXRlQW5pbWF0aW9uKDAsdGltZWxpbmVCYXJQcm9ncmVzc0R1cmF0aW9uKTsKKworICAgICAgICBmdW5jdGlvbiBzZXRUb0luYWN0aXZlU3RhdGVzKCl7CisKKyAgICAgICAgICAgIGZvcih2YXIgaSBpbiB0aW1lbGluZURvdEN0cmxzKXsKKyAgICAgICAgICAgICAgICB2YXIgZG90Q3RybCA9IHRpbWVsaW5lRG90Q3RybHNbaV07CisKKyAgICAgICAgICAgICAgICBpZihpJTIgPT0gMCl7CisgICAgICAgICAgICAgICAgICAgIGRvdEN0cmwudW5ob3ZlcmVkU3RhdGVGb3JCZWxvdyguMjUpOworICAgICAgICAgICAgICAgIH1lbHNleworICAgICAgICAgICAgICAgICAgICBkb3RDdHJsLnVuaG92ZXJlZFN0YXRlRm9yQWJvdmUoLjI1KTsKKyAgICAgICAgICAgICAgICB9CisKKyAgICAgICAgICAgICAgICBpZihkb3RDdHJsLmlzU3RvcCgpKQorICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgIH0KKworICAgICAgICB9CisKKyAgICAgICAgZnVuY3Rpb24gY3JlYXRlQW5pbWF0aW9uKGksIGR1cmF0aW9uKXsKKyAgICAgICAgICAgIGlmKGkgPT0gMCl7CisgICAgICAgICAgICAgICAgcmV0dXJuIGZ1bmN0aW9uKCl7CisgICAgICAgICAgICAgICAgICAgIGlmKHRpbWVsaW5lRG90Q3RybHNbaSsxXS5pc1N0b3AoKSAmJiB0aW1lbGluZURvdEN0cmxzW2krMV0uaXNDYW5jZWxsZWQoKSl7CisgICAgICAgICAgICAgICAgICAgICAgICB0aW1lbGluZUJhckN0cmxzW2ldLmlzQ2FuY2VsbGVkKHRydWUpOworICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgIHRpbWVsaW5lQmFyQ3RybHNbaV0uYW5pbWF0ZShjcmVhdGVBbmltYXRpb24oaSsxLCBkdXJhdGlvbiksIGR1cmF0aW9uKTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9ZWxzZSBpZihpID09IHRpbWVsaW5lQmFyQ3RybHMubGVuZ3RoIC0gMSl7CisgICAgICAgICAgICAgICAgcmV0dXJuIGZ1bmN0aW9uKCl7CisKKyAgICAgICAgICAgICAgICAgICAgLy9SZW1vdmVzIHRoZSBib2xkZWQgdGV4dCBmcm9tIHRoZSBzdGFydAorICAgICAgICAgICAgICAgICAgICBpZih0aW1lbGluZURvdEN0cmxzWzBdLmlzQ3VycmVudFN0ZXAoKSl7CisgICAgICAgICAgICAgICAgICAgICAgICB0aW1lbGluZURvdEN0cmxzWzBdLmlzQ3VycmVudFN0ZXAoZmFsc2UpOworICAgICAgICAgICAgICAgICAgICB9CisKKyAgICAgICAgICAgICAgICAgICAgaWYodGltZWxpbmVEb3RDdHJsc1tpXS5pc1N0b3AoKSl7CisgICAgICAgICAgICAgICAgICAgICAgICB0aW1lbGluZURvdEN0cmxzW2ktMV0uc2hyaW5rQW5pbWF0ZShkb3RzRHVyYXRpb24pOworICAgICAgICAgICAgICAgICAgICAgICAgdGltZWxpbmVEb3RDdHJsc1tpXS5pc0N1cnJlbnRTdGVwKHRydWUpOworICAgICAgICAgICAgICAgICAgICB9ZWxzZXsKKyAgICAgICAgICAgICAgICAgICAgICAgIHRpbWVsaW5lRG90Q3RybHNbaS0xXS5zaHJpbmtBbmltYXRlKGRvdHNEdXJhdGlvbik7CisgICAgICAgICAgICAgICAgICAgICAgICB0aW1lbGluZUJhckN0cmxzW2ldLmFuaW1hdGUoY3JlYXRlQW5pbWF0aW9uKGkrMSwgZHVyYXRpb24pLCBkdXJhdGlvbik7CisgICAgICAgICAgICAgICAgICAgIH0KKworICAgICAgICAgICAgICAgICAgICB0aW1lbGluZURvdEN0cmxzW2ldLmV4cGFuZGVkQW5pbWF0ZShkb3RzRHVyYXRpb24pOworCisgICAgICAgICAgICAgICAgICAgICR0aW1lb3V0KGZ1bmN0aW9uKCl7CisgICAgICAgICAgICAgICAgICAgICAgICBzZXRUb0luYWN0aXZlU3RhdGVzKCk7CisgICAgICAgICAgICAgICAgICAgIH0sNTAwKTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9CisgICAgICAgICAgICAvL0VuZCBEb3QKKyAgICAgICAgICAgIGVsc2UgaWYoaSA9PSB0aW1lbGluZUJhckN0cmxzLmxlbmd0aCl7CisgICAgICAgICAgICAgICAgcmV0dXJuIGZ1bmN0aW9uKCl7CisKKyAgICAgICAgICAgICAgICAgICAgLy9SZW1vdmVzIHRoZSBib2xkZWQgdGV4dCBmcm9tIHRoZSBzdGFydAorICAgICAgICAgICAgICAgICAgICBpZih0aW1lbGluZURvdEN0cmxzWzBdLmlzQ3VycmVudFN0ZXAoKSl7CisgICAgICAgICAgICAgICAgICAgICAgICB0aW1lbGluZURvdEN0cmxzWzBdLmlzQ3VycmVudFN0ZXAoZmFsc2UpOworICAgICAgICAgICAgICAgICAgICB9CisKKyAgICAgICAgICAgICAgICAgICAgdGltZWxpbmVEb3RDdHJsc1tpLTFdLnNocmlua0FuaW1hdGUoZG90c0R1cmF0aW9uKTsKKyAgICAgICAgICAgICAgICAgICAgdGltZWxpbmVEb3RDdHJsc1tpXS5leHBhbmRlZEFuaW1hdGUoZG90c0R1cmF0aW9uKTsKKyAgICAgICAgICAgICAgICAgICAgdGltZWxpbmVEb3RDdHJsc1tpXS5pc0N1cnJlbnRTdGVwKHRydWUpOworCisgICAgICAgICAgICAgICAgICAgICR0aW1lb3V0KGZ1bmN0aW9uKCl7CisgICAgICAgICAgICAgICAgICAgICAgICBzZXRUb0luYWN0aXZlU3RhdGVzKCk7CisgICAgICAgICAgICAgICAgICAgIH0sNTAwKTsKKyAgICAgICAgICAgICAgICAgICAgCisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfQorICAgICAgICAgICAgZWxzZXsKKyAgICAgICAgICAgICAgICByZXR1cm4gZnVuY3Rpb24oKXsKKyAgICAgICAgICAgICAgICAgICAgLy9SZW1vdmVzIHRoZSBib2xkZWQgdGV4dCBmcm9tIHRoZSBzdGFydAorICAgICAgICAgICAgICAgICAgICBpZih0aW1lbGluZURvdEN0cmxzWzBdLmlzQ3VycmVudFN0ZXAoKSl7CisgICAgICAgICAgICAgICAgICAgICAgICB0aW1lbGluZURvdEN0cmxzWzBdLmlzQ3VycmVudFN0ZXAoZmFsc2UpOworICAgICAgICAgICAgICAgICAgICB9CisKKyAgICAgICAgICAgICAgICAgICAgLy90aW1lbGluZURvdEN0cmxzW2ldLnNldENvbG9yKCk7CisgICAgICAgICAgICAgICAgICAgIGlmKHRpbWVsaW5lRG90Q3RybHNbaV0uaXNTdG9wKCkpeworICAgICAgICAgICAgICAgICAgICAgICAgdGltZWxpbmVEb3RDdHJsc1tpLTFdLnNocmlua0FuaW1hdGUoZG90c0R1cmF0aW9uKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIHRpbWVsaW5lRG90Q3RybHNbaV0uZXhwYW5kZWRBbmltYXRlKGRvdHNEdXJhdGlvbik7CisgICAgICAgICAgICAgICAgICAgICAgICB0aW1lbGluZURvdEN0cmxzW2ldLmlzQ3VycmVudFN0ZXAodHJ1ZSk7CisKKyAgICAgICAgICAgICAgICAgICAgICAgICR0aW1lb3V0KGZ1bmN0aW9uKCl7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2V0VG9JbmFjdGl2ZVN0YXRlcygpOworICAgICAgICAgICAgICAgICAgICAgICAgfSw1MDApOworCisgICAgICAgICAgICAgICAgICAgIH1lbHNleworCisgICAgICAgICAgICAgICAgICAgICAgICBpZih0aW1lbGluZURvdEN0cmxzW2krMV0uaXNTdG9wKCkgJiYgdGltZWxpbmVEb3RDdHJsc1tpKzFdLmlzQ2FuY2VsbGVkKCkpeworICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRpbWVsaW5lQmFyQ3RybHNbaV0uaXNDYW5jZWxsZWQodHJ1ZSk7CisgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgIAorICAgICAgICAgICAgICAgICAgICAgICAgdGltZWxpbmVEb3RDdHJsc1tpLTFdLnNocmlua0FuaW1hdGUoZG90c0R1cmF0aW9uKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIHRpbWVsaW5lQmFyQ3RybHNbaV0uYW5pbWF0ZShjcmVhdGVBbmltYXRpb24oaSsxLCBkdXJhdGlvbiksIGR1cmF0aW9uKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIHRpbWVsaW5lRG90Q3RybHNbaV0uZXhwYW5kZWRBbmltYXRlKGRvdHNEdXJhdGlvbik7CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgCisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfQorICAgICAgICB9CisKKyAgICAgICAgc3RhcnQoKTsKKyAgICB9CisKK31dKQorLmRpcmVjdGl2ZSgnYXR0VGltZWxpbmUnLCBbJyR0aW1lb3V0JywgJyRjb21waWxlJywgZnVuY3Rpb24oJHRpbWVvdXQsJGNvbXBpbGUpeworICAgIHJldHVybiB7CisgICAgICAgIHJlc3RyaWN0OiAnRUEnLAorICAgICAgICByZXBsYWNlOiB0cnVlLAorICAgICAgICBzY29wZTogeworICAgICAgICAgICAgc3RlcHM6ICc9JywKKyAgICAgICAgICAgIHRyaWdnZXI6Jz0nLAorICAgICAgICAgICAgYWx0ZXJuYXRlOiAnPScsCisgICAgICAgICAgICBiYXJBbmltYXRlRHVyYXRpb246ICc9JworICAgICAgICB9LAorICAgICAgICB0ZW1wbGF0ZVVybDogJ2FwcC9zY3JpcHRzL25nX2pzX2F0dF90cGxzL3N0ZXB0cmFja2VyL3RpbWVsaW5lLmh0bWwnLAorICAgICAgICBjb250cm9sbGVyOiAnQXR0VGltZWxpbmVDdHJsJywKKyAgICAgICAgbGluazogZnVuY3Rpb24oc2NvcGUsZWxlbWVudCxhdHRycyxjdHJsKXsKKyAgICAgICAgICAgIHZhciBpbml0ID0gZnVuY3Rpb24oKXsKKyAgICAgICAgICAgICAgICB2YXIgdGVtcEN0cmxzID0gW107CisgICAgICAgICAgICAgICAgdmFyIHN0ZXBzID0gc2NvcGUuc3RlcHM7CisKKyAgICAgICAgICAgICAgICB2YXIgbWlkZGxlU3RlcHMgPSBbXTsKKyAgICAgICAgICAgICAgICBmb3IodmFyIGkgPSAxOyBpIDwgc3RlcHMubGVuZ3RoOyBpKyspeworICAgICAgICAgICAgICAgICAgICB2YXIgYVN0ZXAgPSBzdGVwc1tpXTsKKyAgICAgICAgICAgICAgICAgICAgbWlkZGxlU3RlcHMucHVzaChhU3RlcCk7CisgICAgICAgICAgICAgICAgfQorCisgICAgICAgICAgICAgICAgc2NvcGUubWlkZGxlU3RlcHMgPSBtaWRkbGVTdGVwczsKKworICAgICAgICAgICAgICAgIC8vVXNlZCBpbiBjYWxjdWxhdGluZyB0aGUgd2lkdGggb2YgdGhlIGxvYWRpbmcgYmFycworICAgICAgICAgICAgICAgIGN0cmwubnVtU3RlcHMgPSBzdGVwcy5sZW5ndGggLSAxOworICAgICAgICAgICAgfTsKKyAgICAgICAgICAgIAorICAgICAgICAgICAgaW5pdCgpOworCisgICAgICAgICAgICAvL1JlY29tcGlsZSBpbiBjYXNlIG9mIHNjb3BlIGNoYW5nZXMKKyAgICAgICAgICAgIHNjb3BlLnJlc2V0VGltZWxpbmUgPSBmdW5jdGlvbigpeworICAgICAgICAgICAgICAgc2NvcGUuYW5pbWF0ZSA9IHRydWU7CisgICAgICAgICAgICAgICAkY29tcGlsZShlbGVtZW50KShzY29wZSk7CisgICAgICAgICAgICB9OworICAgICAgICB9CisgICAgfQorfV0pCisuY29udHJvbGxlcignVGltZWxpbmVCYXJDdHJsJywgWyckc2NvcGUnLCBmdW5jdGlvbigkc2NvcGUpeworICAgIHRoaXMudHlwZSAgPSAndGltZWxpbmViYXInOworICAgIHRoaXMub3JkZXIgPSBwYXJzZUludCgkc2NvcGUub3JkZXIpOworCisgICAgdGhpcy5hbmltYXRlID0gZnVuY3Rpb24oY2FsbGJhY2ssZHVyYXRpb24peworICAgICAgICAkc2NvcGUubG9hZGluZ0FuaW1hdGlvbihjYWxsYmFjayxkdXJhdGlvbik7CisgICAgfTsKKworICAgIHRoaXMuaXNDYW5jZWxsZWQgPSBmdW5jdGlvbihpc0NhbmNlbGxlZCl7CisgICAgICAgICRzY29wZS5pc0NhbmNlbGxlZCA9IGlzQ2FuY2VsbGVkOworICAgIH0KKworfV0pCisuZGlyZWN0aXZlKCd0aW1lbGluZUJhcicsIFsnYW5pbWF0aW9uJywgJyRwcm9ncmVzc0JhcicsIGZ1bmN0aW9uKGFuaW1hdGlvbiwgJHByb2dyZXNzQmFyKXsKKyAgICByZXR1cm4geworICAgICAgICByZXN0cmljdDogJ0VBJywKKyAgICAgICAgcmVwbGFjZTogdHJ1ZSwKKyAgICAgICAgdGVtcGxhdGVVcmw6ICdhcHAvc2NyaXB0cy9uZ19qc19hdHRfdHBscy9zdGVwdHJhY2tlci90aW1lbGluZUJhci5odG1sJywKKyAgICAgICAgc2NvcGU6IHsKKyAgICAgICAgICAgIG9yZGVyOiAnQCcKKyAgICAgICAgfSwKKyAgICAgICAgcmVxdWlyZTogWydeYXR0VGltZWxpbmUnLCAndGltZWxpbmVCYXInXSwKKyAgICAgICAgY29udHJvbGxlcjogJ1RpbWVsaW5lQmFyQ3RybCcsCisgICAgICAgIGxpbms6IGZ1bmN0aW9uKHNjb3BlLGVsZW1lbnQsYXR0cnMsIGN0cmxzKXsKKworICAgICAgICAgICAgdmFyIGF0dFRpbWVsaW5lQ3RybCA9IGN0cmxzWzBdOworICAgICAgICAgICAgdmFyIHRpbWVsaW5lQmFyQ3RybCA9IGN0cmxzWzFdOworCisgICAgICAgICAgICBhdHRUaW1lbGluZUN0cmwuYWRkVGltZWxpbmVCYXJDdHJscyh0aW1lbGluZUJhckN0cmwpOworCisgICAgICAgICAgICBzY29wZS5pc0NvbXBsZXRlZCA9IHRydWU7CisKKyAgICAgICAgICAgIHZhciB3aWR0aFBlcmMgPSAoMTAwL2F0dFRpbWVsaW5lQ3RybC5udW1TdGVwcyktMzsKKworICAgICAgICAgICAgZWxlbWVudC5jc3MoJ3dpZHRoJywgd2lkdGhQZXJjKyclJyk7CisgICAgICAgIAorICAgICAgICAgICAgdmFyIGVsZW0gPSBlbGVtZW50LmZpbmQoJ2RpdicpLmVxKDApOworCisgICAgICAgICAgICBhbmltYXRpb24uc2V0KGVsZW0sIHtvcGFjaXR5OiAwLjB9KTsKKworICAgICAgICAgICAgdmFyIHVwZGF0ZUNhbGxiYWNrID0gZnVuY3Rpb24oc2VsZkVsZW1lbnQpeworICAgICAgICAgICAgICAgIGFuaW1hdGlvbi5zZXQoZWxlbSwge29wYWNpdHk6MS4wfSk7CisgICAgICAgICAgICAgICAgYW5pbWF0aW9uLnNldChlbGVtLHsKKyAgICAgICAgICAgICAgICAgICAgc2NhbGVYOnNlbGZFbGVtZW50LnByb2dyZXNzKCksCisgICAgICAgICAgICAgICAgICAgIHRyYW5zZm9ybU9yaWdpbjogImxlZnQiCisgICAgICAgICAgICAgICAgfSk7CisgICAgICAgICAgICB9OworICAgICAgICAgICAgCisgICAgICAgICAgICBzY29wZS5sb2FkaW5nQW5pbWF0aW9uID0gJHByb2dyZXNzQmFyKHVwZGF0ZUNhbGxiYWNrKTsKKyAgICAgICAgfQorICAgIH0KK31dKQorLmNvbnRyb2xsZXIoJ1RpbWVsaW5lRG90Q3RybCcsIFsnJHNjb3BlJywnJHRpbWVvdXQnLCAndGltZWxpbmVDb25zdGFudHMnLGZ1bmN0aW9uKCRzY29wZSwkdGltZW91dCx0aW1lbGluZUNvbnN0YW50cyl7CisgICAgdGhpcy50eXBlID0gJ2RvdCc7CisKKyAgICB0aGlzLm9yZGVyID0gcGFyc2VJbnQoJHNjb3BlLm9yZGVyKTsKKyAgICB2YXIgc2VsZiA9IHRoaXM7CisKKyAgICAkdGltZW91dChmdW5jdGlvbigpeworCisgICAgICAgIGlmKHNlbGYub3JkZXIgIT0gMCl7CisgICAgICAgICAgICBpZihzZWxmLm9yZGVyICUyICE9IDApeworICAgICAgICAgICAgICAgICRzY29wZS5pbml0aWFsaXplQWJvdmVGb3JBbmltYXRpb24oKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGVsc2V7CisgICAgICAgICAgICAgICAgJHNjb3BlLmluaXRpYWxpemVCZWxvd0ZvckFuaW1hdGlvbigpOworICAgICAgICAgICAgfQorICAgICAgICB9CisKKyAgICB9KTsKKworICAgIHRoaXMuZXhwYW5kZWRBbmltYXRlICA9IGZ1bmN0aW9uKGR1cmF0aW9uKXsKKworICAgICAgICAkc2NvcGUuc2V0Q29sb3IoKTsKKyAgICAgICAgJHNjb3BlLmV4cGFuZGVkQW5pbWF0ZShkdXJhdGlvbik7CisKKyAgICAgICAgaWYoc2VsZi5vcmRlciAhPSAwICYmICEkc2NvcGUuaXNTdGVwc0xlc3NUaGFuRml2ZSgpKXsKKyAgICAgICAgICAgIGlmKHNlbGYub3JkZXIgJSAyICE9IDApeworICAgICAgICAgICAgICAgICRzY29wZS5leHBhbmRDb250ZW50Rm9yQWJvdmUoZHVyYXRpb24pOworICAgICAgICAgICAgfWVsc2V7CisgICAgICAgICAgICAgICAgJHNjb3BlLmV4cGFuZENvbnRlbnRGb3JCZWxvdyhkdXJhdGlvbik7CisgICAgICAgICAgICB9CisgICAgICAgIH0KKyAgICAgICAgCisgICAgfTsKKworICAgIHRoaXMudW5ob3ZlcmVkU3RhdGVGb3JBYm92ZSA9IGZ1bmN0aW9uKGR1cmF0aW9uKXsKKyAgICAgICAgJHNjb3BlLnVuaG92ZXJlZFN0YXRlRm9yQWJvdmUoZHVyYXRpb24pOworICAgIH07CisKKyAgICB0aGlzLnVuaG92ZXJlZFN0YXRlRm9yQmVsb3cgPSBmdW5jdGlvbihkdXJhdGlvbil7CisgICAgICAgICRzY29wZS51bmhvdmVyZWRTdGF0ZUZvckJlbG93KGR1cmF0aW9uKTsKKyAgICB9OworCisgICAgdGhpcy5zaHJpbmtBbmltYXRlID0gZnVuY3Rpb24oZHVyYXRpb24peworICAgICAgICAkc2NvcGUuc2hyaW5rQW5pbWF0ZShkdXJhdGlvbik7CisgICAgfTsKKworICAgIHRoaXMuc2V0RXhwYW5kZWQgPSBmdW5jdGlvbigpeworICAgICAgICAkc2NvcGUuc2V0U2l6ZSgzKTsKKyAgICB9OworCisgICAgdGhpcy5pc1N0b3AgPSBmdW5jdGlvbigpeworICAgICAgICByZXR1cm4gJHNjb3BlLmlzU3RvcDsKKyAgICB9OworCisgICAgdGhpcy5pc0NhbmNlbGxlZCA9IGZ1bmN0aW9uKCl7CisgICAgICAgIGlmKCRzY29wZS50eXBlID09IHRpbWVsaW5lQ29uc3RhbnRzLlNURVBfVFlQRS5DQU5DRUxMRUQpCisgICAgICAgICAgICByZXR1cm4gdHJ1ZTsKKyAgICAgICAgZWxzZQorICAgICAgICAgICAgcmV0dXJuIGZhbHNlOworICAgIH07CisKKyAgICB0aGlzLmlzQWxlcnQgPSBmdW5jdGlvbigpeworICAgICAgICBpZigkc2NvcGUudHlwZSA9PSB0aW1lbGluZUNvbnN0YW50cy5TVEVQX1RZUEUuQUxFUlQpCisgICAgICAgICAgICByZXR1cm4gdHJ1ZTsKKyAgICAgICAgZWxzZQorICAgICAgICAgICAgcmV0dXJuIGZhbHNlOworICAgIH07CisKKyAgICAvL1NldHMgdGhlIGJvbGRlZCB0ZXh0CisgICAgdGhpcy5pc0N1cnJlbnRTdGVwID0gZnVuY3Rpb24oaXNDdXJyZW50U3RlcCl7CisgICAgICAgIGlmKGlzQ3VycmVudFN0ZXAgIT0gdW5kZWZpbmVkKXsKKyAgICAgICAgICAgICRzY29wZS5pc0N1cnJlbnRTdGVwID0gaXNDdXJyZW50U3RlcDsKKyAgICAgICAgfQorICAgICAgICByZXR1cm4gJHNjb3BlLmlzQ3VycmVudFN0ZXA7CisgICAgfTsKKworfV0pCisuZGlyZWN0aXZlKCd0aW1lbGluZURvdCcsIFsnJHRpbWVvdXQnLCAnYW5pbWF0aW9uJywgJ3RpbWVsaW5lQ29uc3RhbnRzJywgCisgICAgZnVuY3Rpb24oJHRpbWVvdXQsYW5pbWF0aW9uLHRpbWVsaW5lQ29uc3RhbnRzKXsKKyAgICByZXR1cm4geworICAgICAgICByZXN0cmljdDogJ0VBJywKKyAgICAgICAgcmVwbGFjZTogdHJ1ZSwKKyAgICAgICAgc2NvcGU6eworICAgICAgICAgICAgb3JkZXI6J0AnLAorICAgICAgICAgICAgdGl0bGU6J0AnLAorICAgICAgICAgICAgZGVzY3JpcHRpb246ICdAJywKKyAgICAgICAgICAgIGJ5OiAnQCcsCisgICAgICAgICAgICBkYXRlOiAnQCcsCisgICAgICAgICAgICB0eXBlOiAnQCcKKyAgICAgICAgfSwKKyAgICAgICAgdGVtcGxhdGVVcmw6ICdhcHAvc2NyaXB0cy9uZ19qc19hdHRfdHBscy9zdGVwdHJhY2tlci90aW1lbGluZURvdC5odG1sJywKKyAgICAgICAgcmVxdWlyZTogWydeYXR0VGltZWxpbmUnLCAndGltZWxpbmVEb3QnXSwKKyAgICAgICAgY29udHJvbGxlcjogJ1RpbWVsaW5lRG90Q3RybCcsCisgICAgICAgIGxpbms6IGZ1bmN0aW9uKHNjb3BlLGVsZW1lbnQsYXR0cnMsY3RybHMpeworCisgICAgICAgICAgICB2YXIgYXR0VGltZWxpbmVDdHJsID0gY3RybHNbMF07CisgICAgICAgICAgICB2YXIgdGltZWxpbmVEb3RDdHJsID0gY3RybHNbMV07CisgICAgICAgICAgICBhdHRUaW1lbGluZUN0cmwuYWRkVGltZWxpbmVEb3RDdHJscyh0aW1lbGluZURvdEN0cmwpOworCisgICAgICAgICAgICBzY29wZS5udW1TdGVwcyA9IGF0dFRpbWVsaW5lQ3RybC5udW1TdGVwcyArIDE7CisKKyAgICAgICAgICAgIHNjb3BlLmlzQ3VycmVudFN0ZXAgPSBmYWxzZTsKKyAgICAgICAgICAgIHNjb3BlLmlzQ29tcGxldGVkID0gZmFsc2U7CisgICAgICAgICAgICBzY29wZS5pc1N0b3AgPSBmYWxzZTsKKworICAgICAgICAgICAgaWYoc2NvcGUudHlwZSA9PSB0aW1lbGluZUNvbnN0YW50cy5TVEVQX1RZUEUuQUxFUlQgfHwgc2NvcGUudHlwZSA9PSB0aW1lbGluZUNvbnN0YW50cy5TVEVQX1RZUEUuQ0FOQ0VMTEVEKXsKKyAgICAgICAgICAgICAgICBzY29wZS5pc1N0b3AgPSB0cnVlOworICAgICAgICAgICAgfQorCisgICAgICAgICAgICBzY29wZS5pc0luYWN0aXZlID0gdHJ1ZTsKKworICAgICAgICAgICAgdmFyIGRpdnMgPSBlbGVtZW50LmZpbmQoJ2RpdicpOworICAgICAgICAgICAgCisgICAgICAgICAgICB2YXIgYmlnZ2VyQ2lyY2xlRWxlbSA9IGRpdnMuZXEoMCk7CisgICAgICAgICAgICB2YXIgZXhwYW5kYWJsZUNpcmNsZUVsZW0gPSBkaXZzLmVxKDIpOworICAgICAgICAgICAgdmFyIGluZm9ib3hFbGVtID0gZGl2cy5lcSgzKTsKKyAgICAgICAgICAgIHZhciB0aXRsZUVsZW0gPSBkaXZzLmVxKDUpOworICAgICAgICAgICAgdmFyIGNvbnRlbnRFbGVtID0gZGl2cy5lcSg2KTsKKyAgICAgICAgICAgIHZhciBkYXRlRWxlbSA9IGRpdnMuZXEoOSk7CisgICAgICAgIAorICAgICAgICAgICAgCisgICAgICAgICAgICBmdW5jdGlvbiBpc0VtcHR5U3RlcCgpeworICAgICAgICAgICAgICAgIGlmKCFzY29wZS5kZXNjcmlwdGlvbiAmJiAhc2NvcGUuYnkgICYmICFzY29wZS5kYXRlKQorICAgICAgICAgICAgICAgICAgICByZXR1cm4gdHJ1ZTsKKyAgICAgICAgICAgICAgICByZXR1cm4gZmFsc2U7CisgICAgICAgICAgICB9CisKKyAgICAgICAgICAgIHNjb3BlLmlzU3RlcHNMZXNzVGhhbkZpdmUgPSBmdW5jdGlvbigpeworICAgICAgICAgICAgICAgIGlmKHNjb3BlLm51bVN0ZXBzIDwgNSkKKyAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHRydWU7CisgICAgICAgICAgICAgICAgcmV0dXJuIGZhbHNlOworICAgICAgICAgICAgfQorCisKKworICAgICAgICAgICAgc2NvcGUudGl0bGVNb3VzZW92ZXI9ZnVuY3Rpb24obnVtKXsKKworICAgICAgICAgICAgICAgIGlmKCFzY29wZS5pc1N0ZXBzTGVzc1RoYW5GaXZlKCkpeworICAgICAgICAgICAgICAgICAgICBpZighaXNFbXB0eVN0ZXAoKSl7CisgICAgICAgICAgICAgICAgICAgICAgICBpZihudW0gPT0gMSAmJiBzY29wZS5vcmRlciUyID09IDApeworICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNjb3BlLmV4cGFuZENvbnRlbnRGb3JCZWxvdyguMjUpOworICAgICAgICAgICAgICAgICAgICAgICAgfQorCisgICAgICAgICAgICAgICAgICAgICAgICBpZihudW0gPT0gMiAmJiBzY29wZS5vcmRlciUyICE9IDApeworICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNjb3BlLmV4cGFuZENvbnRlbnRGb3JBYm92ZSguMjUpOworICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIAorICAgICAgICAgICAgfTsKKworICAgICAgICAgICAgc2NvcGUudGl0bGVNb3VzZWxlYXZlID0gZnVuY3Rpb24obnVtKXsKKyAgICAgICAgICAgICAgICBpZihzY29wZS5vcmRlciUyID09IDApeworICAgICAgICAgICAgICAgICAgICBzY29wZS51bmhvdmVyZWRTdGF0ZUZvckJlbG93KC4yNSk7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIGVsc2V7ICAgICAgIAorICAgICAgICAgICAgICAgICAgICBzY29wZS51bmhvdmVyZWRTdGF0ZUZvckFib3ZlKC4yNSk7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfTsKKworICAgICAgICAgICAgc2NvcGUuaW5pdGlhbGl6ZUFib3ZlRm9yQW5pbWF0aW9uID0gZnVuY3Rpb24oKXsKKyAgICAgICAgICAgICAgICBpZighc2NvcGUuaXNTdGVwc0xlc3NUaGFuRml2ZSgpICYmIGF0dFRpbWVsaW5lQ3RybC5pc0FsdGVybmF0ZSgpKXsKKyAgICAgICAgICAgICAgICAgICAgYW5pbWF0aW9uLnNldChjb250ZW50RWxlbSx7b3BhY2l0eTowfSk7CisgICAgICAgICAgICAgICAgICAgIGFuaW1hdGlvbi5zZXQoZGF0ZUVsZW0se29wYWNpdHk6MH0pOworCisgICAgICAgICAgICAgICAgICAgIGlmKCFpc0VtcHR5U3RlcCgpKXsKKyAgICAgICAgICAgICAgICAgICAgICAgIHZhciB5T2Zmc2V0ID0gY29udGVudEVsZW1bMF0ub2Zmc2V0SGVpZ2h0ICsgZGF0ZUVsZW1bMF0ub2Zmc2V0SGVpZ2h0OworCisgICAgICAgICAgICAgICAgICAgICAgICBhbmltYXRpb24uc2V0KHRpdGxlRWxlbSx7J3RvcCc6eU9mZnNldCB9KTsKKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH07CisKKyAgICAgICAgICAgIHNjb3BlLmV4cGFuZENvbnRlbnRGb3JBYm92ZSA9IGZ1bmN0aW9uKGR1cmF0aW9uKXsKKworICAgICAgICAgICAgICAgIGlmKCFzY29wZS5pc1N0ZXBzTGVzc1RoYW5GaXZlKCkgJiYgYXR0VGltZWxpbmVDdHJsLmlzQWx0ZXJuYXRlKCkpeworICAgICAgICAgICAgICAgICAgICBhbmltYXRpb24udG8odGl0bGVFbGVtLGR1cmF0aW9uLCB7J3RvcCc6MH0pOworICAgICAgICAgICAgICAgICAgICBhbmltYXRpb24udG8oY29udGVudEVsZW0sZHVyYXRpb24se29wYWNpdHk6MX0pOworICAgICAgICAgICAgICAgICAgICBhbmltYXRpb24udG8oZGF0ZUVsZW0sZHVyYXRpb24se29wYWNpdHk6MX0pOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgCisgICAgICAgICAgICB9OworCisgICAgICAgICAgICBzY29wZS51bmhvdmVyZWRTdGF0ZUZvckFib3ZlID0gZnVuY3Rpb24oZHVyYXRpb24peworCisgICAgICAgICAgICAgICAgaWYoIXNjb3BlLmlzU3RlcHNMZXNzVGhhbkZpdmUoKSAmJiBhdHRUaW1lbGluZUN0cmwuaXNBbHRlcm5hdGUoKSl7CisgICAgICAgICAgICAgICAgICAgIGFuaW1hdGlvbi5zZXQoY29udGVudEVsZW0se29wYWNpdHk6MH0pOworICAgICAgICAgICAgICAgICAgICBhbmltYXRpb24uc2V0KGRhdGVFbGVtLHtvcGFjaXR5OjF9KTsKKyAgICAgICAgICAgICAgICAgICAgdmFyIHlPZmZzZXQgPSBjb250ZW50RWxlbVswXS5vZmZzZXRIZWlnaHQ7CisgICAgICAgICAgICAgICAgICAgIGFuaW1hdGlvbi50byh0aXRsZUVsZW0sZHVyYXRpb24seyd0b3AnOnlPZmZzZXR9KTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgIAorICAgICAgICAgICAgfTsKKworICAgICAgICAgICAgc2NvcGUuaW5pdGlhbGl6ZUJlbG93Rm9yQW5pbWF0aW9uID0gZnVuY3Rpb24oKXsKKyAgICAgICAgICAgICAgICBpZighc2NvcGUuaXNTdGVwc0xlc3NUaGFuRml2ZSgpICYmIGF0dFRpbWVsaW5lQ3RybC5pc0FsdGVybmF0ZSgpKXsKKyAgICAgICAgICAgICAgICAgICAgYW5pbWF0aW9uLnNldChjb250ZW50RWxlbSx7aGVpZ2h0OicwJScsb3BhY2l0eTowLCB0b3A6Jy0yMHB4J30pOworICAgICAgICAgICAgICAgICAgICBhbmltYXRpb24uc2V0KGRhdGVFbGVtLHtvcGFjaXR5OjB9KTsKKyAgICAgICAgICAgICAgICB9ICAKKyAgICAgICAgICAgIH07CisKKyAgICAgICAgICAgIHNjb3BlLmV4cGFuZENvbnRlbnRGb3JCZWxvdyA9IGZ1bmN0aW9uKGR1cmF0aW9uKXsKKworICAgICAgICAgICAgICAgIGlmKCFzY29wZS5pc1N0ZXBzTGVzc1RoYW5GaXZlKCkgJiYgYXR0VGltZWxpbmVDdHJsLmlzQWx0ZXJuYXRlKCkpeworICAgICAgICAgICAgICAgICAgICBhbmltYXRpb24uc2V0KGRhdGVFbGVtLHtvcGFjaXR5OjF9KTsKKyAgICAgICAgICAgICAgICAgICAgYW5pbWF0aW9uLnRvKGNvbnRlbnRFbGVtLGR1cmF0aW9uLHsgaGVpZ2h0OidhdXRvJyxvcGFjaXR5OjEsIHRvcDonMHB4J30pOyAgIAorICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAKKyAgICAgICAgICAgIH07CisKKyAgICAgICAgICAgIHNjb3BlLnVuaG92ZXJlZFN0YXRlRm9yQmVsb3cgPSBmdW5jdGlvbihkdXJhdGlvbil7CisKKyAgICAgICAgICAgICAgICBpZighc2NvcGUuaXNTdGVwc0xlc3NUaGFuRml2ZSgpICYmIGF0dFRpbWVsaW5lQ3RybC5pc0FsdGVybmF0ZSgpKXsKKyAgICAgICAgICAgICAgICAgICAgYW5pbWF0aW9uLnRvKGNvbnRlbnRFbGVtLGR1cmF0aW9uLHtoZWlnaHQ6JzAlJyxvcGFjaXR5OjAsIHRvcDonLTIwcHgnLCBwb3NpdGlvbjoncmVsYXRpdmUnfSk7CisgICAgICAgICAgICAgICAgICAgIGFuaW1hdGlvbi5zZXQoZGF0ZUVsZW0se29wYWNpdHk6MX0pOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAKKyAgICAgICAgICAgIH07ICAKKworICAgICAgICAgICAgLyoKKyAgICAgICAgICAgICAgICBEZWZhdWx0IEluaXRpYWxpemF6dGlvbgorICAgICAgICAgICAgKi8KKworICAgICAgICAgICAgLy9JZiB0aGUgaW5mbyBib3ggaXMgYWJvdmUgYW5kIHRoZSBkZXNjcmlwdGlvbiBhbmQgZGF0ZSBhbmQgYnkgYXJlIGVtcHR5IHRoZW4gd2UgaGF2ZSBkbyByZXNldCBpdHMgcG9zaXRpb24KKyAgICAgICAgICAgIGlmKGlzRW1wdHlTdGVwKCkpeworICAgICAgICAgICAgICAgIC8vSVQgaGFzIHRvIGJlIGFuIGFsdGVybmF0aW5nIHZlcnNpb24gZm9yIGl0IHRvIGJlIGFib3ZlCisgICAgICAgICAgICAgICAgaWYoc2NvcGUub3JkZXIlMiAhPSAwICYmIGF0dFRpbWVsaW5lQ3RybC5pc0FsdGVybmF0ZSgpKQorICAgICAgICAgICAgICAgICAgICBpbmZvYm94RWxlbS5jc3MoJ3RvcCcsICctNDdweCcpOworICAgICAgICAgICAgfQorCisKKyAgICAgICAgICAgIC8vQ2hlY2sgaWYgdGhlIG9yZGVyIGlzIG9kZCBhbmQgc2V0IHRoZSBhcHByb3BpYXRlIGFib3ZlIG9yIGJlbG93IGFuZCBvdGhlciBlZmZlY3RzCisgICAgICAgICAgICAvL3Njb3BlLmlzQWJvdmVJbmZvQm94U2hvd24gPSB0cnVlOworICAgICAgICAgICAgaWYoc2NvcGUub3JkZXIlMiA9PSAwIHx8ICFhdHRUaW1lbGluZUN0cmwuaXNBbHRlcm5hdGUoKSl7CisgICAgICAgICAgICAgICAgc2NvcGUuaXNCZWxvd0luZm9Cb3hTaG93bj10cnVlOworICAgICAgICAgICAgfQorICAgICAgICAgICAgZWxzZXsgICAgICAgICAgICAgICAKKyAgICAgICAgICAgICAgICBzY29wZS5pc0JlbG93SW5mb0JveFNob3duPWZhbHNlOworICAgICAgICAgICAgfQorCisgICAgICAgICAgICAvL21vZGlmeSBzb21lIGNzcyBmb3Igc3RlcHMgbGVzcyB0aGFuIDUgYW5kIG5vdCBhbHRlcm5hdGluZworICAgICAgICAgICAgaWYoc2NvcGUuaXNTdGVwc0xlc3NUaGFuRml2ZSgpICYmICFhdHRUaW1lbGluZUN0cmwuaXNBbHRlcm5hdGUoKSl7CisgICAgICAgICAgICAgICAgYW5pbWF0aW9uLnNldChkYXRlRWxlbSx7bWFyZ2luVG9wOjEwfSk7CisgICAgICAgICAgICB9CisKKyAgICAgICAgICAgIC8vRm9yIElFIDggZml4CisgICAgICAgICAgICBhbmltYXRpb24uc2V0KGJpZ2dlckNpcmNsZUVsZW0se29wYWNpdHk6ICcuNSd9KTsKKworICAgICAgICAgICAgLy9zaHJpbmsgdGhlIGV4cGFuZGFibGVDaXJjbGUgdG8gd2UgY2FuIGV4cGFuZCBpdCBsYXRlcgorICAgICAgICAgICAgYW5pbWF0aW9uLnNldChleHBhbmRhYmxlQ2lyY2xlRWxlbSwge29wYWNpdHk6ICcwLjAnfSk7CisgICAgICAgICAgICBhbmltYXRpb24uc2V0KGV4cGFuZGFibGVDaXJjbGVFbGVtLCB7c2NhbGU6IC4xMH0pOworCisgICAgICAgICAgICBpZihzY29wZS5vcmRlciA9PSAwKXsKKyAgICAgICAgICAgICAgICBhbmltYXRpb24uc2V0KGV4cGFuZGFibGVDaXJjbGVFbGVtLCB7b3BhY2l0eTogJzEuMCd9KTsKKyAgICAgICAgICAgICAgICBhbmltYXRpb24uc2V0KGV4cGFuZGFibGVDaXJjbGVFbGVtLHtzY2FsZTogMX0pOworICAgICAgICAgICAgICAgIGFuaW1hdGlvbi5zZXQoYmlnZ2VyQ2lyY2xlRWxlbSx7c2NhbGU6M30pOworCisgICAgICAgICAgICAgICAgc2NvcGUuaXNDdXJyZW50U3RlcCA9IHRydWU7CisgICAgICAgICAgICAgICAgc2NvcGUuaXNJbmFjdGl2ZT1mYWxzZTsKKyAgICAgICAgICAgICAgICBzY29wZS5pc0NvbXBsZXRlZCA9IHRydWU7CisgICAgICAgICAgICB9CisKKyAgICAgICAgICAgIHNjb3BlLnNldENvbG9yID0gZnVuY3Rpb24oKXsKKyAgICAgICAgICAgICAgICBzY29wZS5pc0luYWN0aXZlPWZhbHNlOworICAgICAgICAgICAgICAgIGlmKHNjb3BlLnR5cGUgPT0gdGltZWxpbmVDb25zdGFudHMuU1RFUF9UWVBFLkNBTkNFTExFRCl7CisgICAgICAgICAgICAgICAgICAgIHNjb3BlLmlzQ2FuY2VsbGVkPXRydWU7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIGVsc2UgaWYoc2NvcGUudHlwZSA9PSB0aW1lbGluZUNvbnN0YW50cy5TVEVQX1RZUEUuQUxFUlQpeworICAgICAgICAgICAgICAgICAgICBzY29wZS5pc0FsZXJ0PXRydWU7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIGVsc2V7CisgICAgICAgICAgICAgICAgICAgIHNjb3BlLmlzQ29tcGxldGVkID0gdHJ1ZTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgCisgICAgICAgICAgICAgICAgaWYoIXNjb3BlLiRwaGFzZSkKKyAgICAgICAgICAgICAgICAgICAgc2NvcGUuJGFwcGx5KCk7CisgICAgICAgICAgICB9OworCisgICAgICAgICAgICBzY29wZS5zZXRTaXplID0gZnVuY3Rpb24oc2l6ZSl7CisgICAgICAgICAgICAgICAgYW5pbWF0aW9uLnNldChiaWdnZXJDaXJjbGUse3NjYWxlOnNpemV9KTsKKyAgICAgICAgICAgIH07CisKKyAgICAgICAgICAgIHNjb3BlLnNldEV4cGFuZGVkQ2lyY2xlID0gZnVuY3Rpb24oKXsKKyAgICAgICAgICAgICAgICBhbmltYXRpb24uc2V0KGV4cGFuZGFibGVDaXJjbGVFbGVtLCB7b3BhY2l0eTogJzEuMCd9KTsKKyAgICAgICAgICAgICAgICBhbmltYXRpb24uc2V0KGV4cGFuZGFibGVDaXJjbGVFbGVtLHtzY2FsZTogMX0pOworICAgICAgICAgICAgfTsKKworICAgICAgICAgICAgc2NvcGUuZXhwYW5kZWRBbmltYXRlID0gZnVuY3Rpb24oZHVyYXRpb24peworICAgICAgICAgICAgICAgIGFuaW1hdGlvbi50byhiaWdnZXJDaXJjbGVFbGVtLGR1cmF0aW9uLHtzY2FsZTozfSk7CisgICAgICAgICAgICAgICAgYW5pbWF0aW9uLnNldChleHBhbmRhYmxlQ2lyY2xlRWxlbSwge29wYWNpdHk6ICcxLjAnfSk7CisgICAgICAgICAgICAgICAgYW5pbWF0aW9uLnRvKGV4cGFuZGFibGVDaXJjbGVFbGVtLGR1cmF0aW9uLHtzY2FsZTogMX0pOworICAgICAgICAgICAgfTsKKworICAgICAgICAgICAgc2NvcGUuc2hyaW5rQW5pbWF0ZSA9IGZ1bmN0aW9uKGR1cmF0aW9uKXsKKyAgICAgICAgICAgICAgICBhbmltYXRpb24udG8oYmlnZ2VyQ2lyY2xlRWxlbSxkdXJhdGlvbix7c2NhbGU6MX0pOworICAgICAgICAgICAgfTsKKyAgICAgICAgICAgIAorICAgICAgICB9CisgICAgfQorfV0pOworYW5ndWxhci5tb2R1bGUoJ2F0dC5hYnMudGFibGUnLCBbJ2F0dC5hYnMudXRpbGl0aWVzJ10pCisuY29uc3RhbnQoJ3RhYmxlQ29uZmlnJywgeworICAgIGRlZmF1bHRTb3J0UGF0dGVybjogZmFsc2UsIC8vdHJ1ZSBmb3IgZGVzY2VuZGluZyAmIGZhbHNlIGZvciBhc2NlbmRpbmcKKyAgICBoaWdobGlnaHRTZWFyY2hTdHJpbmdDbGFzczogJ3RhYmxlc29ydGVyLXNlYXJjaC1oaWdobGlnaHQnCit9KQorCisuZGlyZWN0aXZlKCdhdHRUYWJsZScsIFsnJGZpbHRlcicsIGZ1bmN0aW9uKCRmaWx0ZXIpIHsKKyAgICByZXR1cm4geworICAgICAgICByZXN0cmljdDogJ0VBJywKKyAgICAgICAgcmVwbGFjZTogdHJ1ZSwKKyAgICAgICAgdHJhbnNjbHVkZTogdHJ1ZSwKKyAgICAgICAgc2NvcGU6IHsKKyAgICAgICAgICAgIHRhYmxlRGF0YTogIj0iLAorICAgICAgICAgICAgdmlld1BlclBhZ2U6ICI9IiwKKyAgICAgICAgICAgIGN1cnJlbnRQYWdlOiAiPSIsCisgICAgICAgICAgICB0b3RhbFBhZ2U6ICI9IiwKKyAgICAgICAgICAgIHNlYXJjaENhdGVnb3J5OiAiPSIsCisgICAgICAgICAgICBzZWFyY2hTdHJpbmc6ICI9IgorICAgICAgICB9LAorICAgICAgICByZXF1aXJlOiAnYXR0VGFibGUnLAorICAgICAgICB0ZW1wbGF0ZVVybDogJ2FwcC9zY3JpcHRzL25nX2pzX2F0dF90cGxzL3RhYmxlL2F0dFRhYmxlLmh0bWwnLAorICAgICAgICBjb250cm9sbGVyOiBbJyRzY29wZScsIGZ1bmN0aW9uKCRzY29wZSkgeworICAgICAgICAgICAgdGhpcy5oZWFkZXJzID0gW107CisgICAgICAgICAgICB0aGlzLmN1cnJlbnRTb3J0SW5kZXggPSBudWxsOworICAgICAgICAgICAgdGhpcy5zZXRJbmRleCA9IGZ1bmN0aW9uKGhlYWRlclNjb3BlKSB7CisgICAgICAgICAgICAgICAgdGhpcy5oZWFkZXJzLnB1c2goaGVhZGVyU2NvcGUpOworICAgICAgICAgICAgfTsKKyAgICAgICAgICAgIHRoaXMuZ2V0SW5kZXggPSBmdW5jdGlvbihoZWFkZXJOYW1lKSB7CisgICAgICAgICAgICAgICAgZm9yICh2YXIgaSA9IDA7IGkgPCB0aGlzLmhlYWRlcnMubGVuZ3RoOyBpKyspIHsKKyAgICAgICAgICAgICAgICAgICAgaWYgKHRoaXMuaGVhZGVyc1tpXS5oZWFkZXJOYW1lID09PSBoZWFkZXJOYW1lKSB7CisgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gdGhpcy5oZWFkZXJzW2ldLmluZGV4OworICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIHJldHVybiBudWxsOworICAgICAgICAgICAgfTsKKyAgICAgICAgICAgIHRoaXMuc29ydERhdGEgPSBmdW5jdGlvbihjb2x1bW5JbmRleCwgcmV2ZXJzZSkgeworICAgICAgICAgICAgICAgICRzY29wZS4kcGFyZW50LmNvbHVtbkluZGV4ID0gY29sdW1uSW5kZXg7CisgICAgICAgICAgICAgICAgJHNjb3BlLiRwYXJlbnQucmV2ZXJzZSA9IHJldmVyc2U7CisgICAgICAgICAgICAgICAgdGhpcy5jdXJyZW50U29ydEluZGV4ID0gY29sdW1uSW5kZXg7CisgICAgICAgICAgICAgICAgJHNjb3BlLmN1cnJlbnRQYWdlID0gMTsKKyAgICAgICAgICAgICAgICB0aGlzLnJlc2V0U29ydFBhdHRlcm4oKTsKKyAgICAgICAgICAgIH07CisgICAgICAgICAgICB0aGlzLmdldFNlYXJjaFN0cmluZyA9IGZ1bmN0aW9uKCkgeworICAgICAgICAgICAgICAgIHJldHVybiAkc2NvcGUuc2VhcmNoU3RyaW5nOworICAgICAgICAgICAgfTsKKyAgICAgICAgICAgIHRoaXMucmVzZXRTb3J0UGF0dGVybiA9IGZ1bmN0aW9uKCkgeworICAgICAgICAgICAgICAgIGZvcih2YXIgaSA9IDA7IGkgPCB0aGlzLmhlYWRlcnMubGVuZ3RoOyBpKyspIHsKKyAgICAgICAgICAgICAgICAgICAgdmFyIGN1cnJlbnRTY29wZSA9IHRoaXMuaGVhZGVyc1tpXTsKKyAgICAgICAgICAgICAgICAgICAgaWYoY3VycmVudFNjb3BlLmluZGV4ICE9PSB0aGlzLmN1cnJlbnRTb3J0SW5kZXgpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIGN1cnJlbnRTY29wZS5yZXNldFNvcnRQYXR0ZXJuKCk7CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9OworICAgICAgICB9XSwKKyAgICAgICAgbGluazogZnVuY3Rpb24oc2NvcGUsIGVsZW0sIGF0dHIsIGN0cmwpIHsKKyAgICAgICAgICAgIHNjb3BlLnNlYXJjaENyaXRlcmlhID0ge307CisgICAgICAgICAgICBzY29wZS4kd2F0Y2hDb2xsZWN0aW9uKCd0YWJsZURhdGEnLCBmdW5jdGlvbih2YWx1ZSkgeworICAgICAgICAgICAgICAgIGlmKHZhbHVlICYmICFpc05hTih2YWx1ZS5sZW5ndGgpKSB7CisgICAgICAgICAgICAgICAgICAgIHNjb3BlLnRvdGFsUm93cyA9IHZhbHVlLmxlbmd0aDsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9KTsKKyAgICAgICAgICAgIHNjb3BlLiR3YXRjaCgnY3VycmVudFBhZ2UnLCBmdW5jdGlvbih2YWwpIHsKKyAgICAgICAgICAgICAgICBzY29wZS4kcGFyZW50LmN1cnJlbnRQYWdlID0gdmFsOworICAgICAgICAgICAgfSk7CisgICAgICAgICAgICBzY29wZS4kd2F0Y2goJ3ZpZXdQZXJQYWdlJywgZnVuY3Rpb24odmFsKSB7CisgICAgICAgICAgICAgICAgc2NvcGUuJHBhcmVudC52aWV3UGVyUGFnZSA9IHZhbDsKKyAgICAgICAgICAgIH0pOworICAgICAgICAgICAgc2NvcGUuJHdhdGNoKGZ1bmN0aW9uKCkgeworICAgICAgICAgICAgICAgIHJldHVybiBzY29wZS50b3RhbFJvd3MgLyBzY29wZS52aWV3UGVyUGFnZTsKKyAgICAgICAgICAgIH0sIGZ1bmN0aW9uKHZhbHVlKSB7CisgICAgICAgICAgICAgICAgaWYoIWlzTmFOKHZhbHVlKSkgeworICAgICAgICAgICAgICAgICAgICBzY29wZS50b3RhbFBhZ2UgPSBNYXRoLmNlaWwodmFsdWUpOworICAgICAgICAgICAgICAgICAgICBzY29wZS5jdXJyZW50UGFnZSA9IDE7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfSk7CisgICAgICAgICAgICB2YXIgcmVzZXRTZWFyY2hDcml0ZXJpYSA9IGZ1bmN0aW9uKCkgeworICAgICAgICAgICAgICAgIHNjb3BlLnNlYXJjaENyaXRlcmlhID0ge307CisgICAgICAgICAgICB9OworICAgICAgICAgICAgc2NvcGUuJHdhdGNoKCdzZWFyY2hDYXRlZ29yeScsIGZ1bmN0aW9uKHZhbHVlKSB7CisgICAgICAgICAgICAgICAgaWYgKGFuZ3VsYXIuaXNEZWZpbmVkKHZhbHVlKSAmJiB2YWx1ZSAhPT0gbnVsbCAmJiB2YWx1ZSAhPT0gIiIgJiYgYW5ndWxhci5pc0RlZmluZWQoc2NvcGUuc2VhcmNoU3RyaW5nKSAmJiBzY29wZS5zZWFyY2hTdHJpbmcgIT09IG51bGwgJiYgc2NvcGUuc2VhcmNoU3RyaW5nICE9PSAiIikgeworICAgICAgICAgICAgICAgICAgICB2YXIgaW5kZXggPSBjdHJsLmdldEluZGV4KHZhbHVlKTsKKyAgICAgICAgICAgICAgICAgICAgaWYgKGluZGV4ICE9PSBudWxsKSB7CisgICAgICAgICAgICAgICAgICAgICAgICByZXNldFNlYXJjaENyaXRlcmlhKCk7CisgICAgICAgICAgICAgICAgICAgICAgICBzY29wZS5zZWFyY2hDcml0ZXJpYVtpbmRleF0gPSBzY29wZS5zZWFyY2hTdHJpbmc7CisgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICAgICAgICAgICAgICByZXNldFNlYXJjaENyaXRlcmlhKCk7CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKGFuZ3VsYXIuaXNEZWZpbmVkKHNjb3BlLnNlYXJjaFN0cmluZykgJiYgc2NvcGUuc2VhcmNoU3RyaW5nICE9PSBudWxsICYmIHNjb3BlLnNlYXJjaFN0cmluZyAhPT0gIiIgJiYgKCFhbmd1bGFyLmlzRGVmaW5lZCh2YWx1ZSkgfHwgdmFsdWUgPT09IG51bGwgfHwgdmFsdWUgPT09ICIiKSkgeworICAgICAgICAgICAgICAgICAgICBzY29wZS5zZWFyY2hDcml0ZXJpYSA9IHsKKyAgICAgICAgICAgICAgICAgICAgICAgICQ6IHNjb3BlLnNlYXJjaFN0cmluZworICAgICAgICAgICAgICAgICAgICB9OworICAgICAgICAgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICAgICAgICAgIHJlc2V0U2VhcmNoQ3JpdGVyaWEoKTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9KTsKKyAgICAgICAgICAgIHNjb3BlLiR3YXRjaCgnc2VhcmNoU3RyaW5nJywgZnVuY3Rpb24odmFsdWUpIHsKKyAgICAgICAgICAgICAgICBpZiAoYW5ndWxhci5pc0RlZmluZWQodmFsdWUpICYmIHZhbHVlICE9PSBudWxsICYmIHZhbHVlICE9PSAiIiAmJiBhbmd1bGFyLmlzRGVmaW5lZChzY29wZS5zZWFyY2hDYXRlZ29yeSkgCisgICAgICAgICAgICAgICAgICAgICYmIHNjb3BlLnNlYXJjaENhdGVnb3J5ICE9PSBudWxsICYmIHNjb3BlLnNlYXJjaENhdGVnb3J5ICE9PSAiIikgeworICAgICAgICAgICAgICAgICAgICB2YXIgaW5kZXggPSBjdHJsLmdldEluZGV4KHNjb3BlLnNlYXJjaENhdGVnb3J5KTsKKyAgICAgICAgICAgICAgICAgICAgaWYgKGluZGV4ICE9PSBudWxsKSB7CisgICAgICAgICAgICAgICAgICAgICAgICByZXNldFNlYXJjaENyaXRlcmlhKCk7CisgICAgICAgICAgICAgICAgICAgICAgICBzY29wZS5zZWFyY2hDcml0ZXJpYVtpbmRleF0gPSB2YWx1ZTsKKyAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIHJlc2V0U2VhcmNoQ3JpdGVyaWEoKTsKKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAoYW5ndWxhci5pc0RlZmluZWQodmFsdWUpICYmIHZhbHVlICE9PSBudWxsICYmIHZhbHVlICE9PSAiIgorICAgICAgICAgICAgICAgICAmJiAoIWFuZ3VsYXIuaXNEZWZpbmVkKHNjb3BlLnNlYXJjaENhdGVnb3J5KSB8fCBzY29wZS5zZWFyY2hDYXRlZ29yeSA9PT0gbnVsbCB8fCBzY29wZS5zZWFyY2hDYXRlZ29yeSA9PT0gIiIpKQorICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICBzY29wZS5zZWFyY2hDcml0ZXJpYSA9IHsKKyAgICAgICAgICAgICAgICAgICAgICAgICQ6IHZhbHVlCisgICAgICAgICAgICAgICAgICAgIH07CisgICAgICAgICAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgICAgICAgICAgcmVzZXRTZWFyY2hDcml0ZXJpYSgpOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0pOworICAgICAgICAgICAgc2NvcGUuJHdhdGNoQ29sbGVjdGlvbignc2VhcmNoQ3JpdGVyaWEnLCBmdW5jdGlvbih2YWwpIHsKKyAgICAgICAgICAgICAgICBzY29wZS4kcGFyZW50LnNlYXJjaENyaXRlcmlhID0gdmFsOworICAgICAgICAgICAgICAgIHNjb3BlLnRvdGFsUm93cyA9ICgkZmlsdGVyKCdmaWx0ZXInKShzY29wZS50YWJsZURhdGEsIHZhbCwgZmFsc2UpKS5sZW5ndGg7CisgICAgICAgICAgICAgICAgc2NvcGUuY3VycmVudFBhZ2UgPSAxOworICAgICAgICAgICAgfSk7CisgICAgICAgIH0KKyAgICB9OworfV0pCisKKy5kaXJlY3RpdmUoJ2F0dFRhYmxlUm93JywgW2Z1bmN0aW9uKCkgeworICAgIHJldHVybiB7CisgICAgICAgIHJlc3RyaWN0OiAnRUEnLAorICAgICAgICBjb21waWxlOiBmdW5jdGlvbiAoZWxlbSwgYXR0cikgeworICAgICAgICAgICAgaWYgKGF0dHIudHlwZSA9PT0gJ2hlYWRlcicpIHsKKyAgICAgICAgICAgICAgICBlbGVtLmZpbmQoJ3RyJykuZXEoMCkuYWRkQ2xhc3MoJ3RhYmxlc29ydGVyLWhlYWRlclJvdycpOworICAgICAgICAgICAgfSBlbHNlIGlmIChhdHRyLnR5cGUgPT09ICdib2R5JykgeworICAgICAgICAgICAgICAgIHZhciBodG1sID0gZWxlbS5jaGlsZHJlbigpOworCisgICAgICAgICAgICAgICAgaWYoYXR0ci5yb3dSZXBlYXQpCisgICAgICAgICAgICAgICAgICAgIGh0bWwuYXR0cignbmctcmVwZWF0JywgYXR0ci5yb3dSZXBlYXQuY29uY2F0KCIgfCBvcmRlckJ5IDogY29sdW1uSW5kZXggOiByZXZlcnNlIHwgZmlsdGVyIDogc2VhcmNoQ3JpdGVyaWEgOiBmYWxzZSB8IGF0dExpbWl0VG8gOiB2aWV3UGVyUGFnZSA6IHZpZXdQZXJQYWdlKihjdXJyZW50UGFnZS0xKSIpKTsKKyAgICAgICAgICAgICAgICAKKyAgICAgICAgICAgICAgICBodG1sLmF0dHIoJ25nLWNsYXNzJywgInsnYWx0LXJvdyc6ICRldmVuLCdub3JtYWwtcm93JzogJG9kZH0iKTsKKyAgICAgICAgICAgICAgICBlbGVtLmFwcGVuZChodG1sKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgIH07Cit9XSkKKworLmRpcmVjdGl2ZSgnYXR0VGFibGVIZWFkZXInLCBbJ3RhYmxlQ29uZmlnJywgZnVuY3Rpb24odGFibGVDb25maWcpIHsKKyAgICByZXR1cm4geworICAgICAgICByZXN0cmljdDogJ0VBJywKKyAgICAgICAgcmVwbGFjZTogdHJ1ZSwKKyAgICAgICAgdHJhbnNjbHVkZTogdHJ1ZSwKKyAgICAgICAgc2NvcGU6IHsKKyAgICAgICAgICAgIHNvcnRhYmxlOiAnQCcsCisgICAgICAgICAgICBkZWZhdWx0U29ydDogJ0AnLAorICAgICAgICAgICAgaW5kZXg6ICdAa2V5JywKKyAgICAgICAgICAgIGFycm93RGlyZWN0aW9uOiAnPScsCisgICAgICAgICAgICBjbGlja0Z1bmM6ICcmJworICAgICAgICB9LAorICAgICAgICByZXF1aXJlOiAnXmF0dFRhYmxlJywKKyAgICAgICAgdGVtcGxhdGVVcmw6ICdhcHAvc2NyaXB0cy9uZ19qc19hdHRfdHBscy90YWJsZS9hdHRUYWJsZUhlYWRlci5odG1sJywKKyAgICAgICAgbGluazogZnVuY3Rpb24oc2NvcGUsIGVsZW0sIGF0dHIsIGN0cmwpIHsKKyAgICAgICAgICAgIHZhciByZXZlcnNlID0gdGFibGVDb25maWcuZGVmYXVsdFNvcnRQYXR0ZXJuOworICAgICAgICAgICAgc2NvcGUuaGVhZGVyTmFtZSA9IGVsZW0udGV4dCgpOworICAgICAgICAgICAgc2NvcGUuc29ydFBhdHRlcm4gPSBudWxsOworICAgICAgICAgICAgY3RybC5zZXRJbmRleChzY29wZSk7CisKKyAgICAgICAgICAgIHNjb3BlLiR3YXRjaCgnYXJyb3dEaXJlY3Rpb24nLCBmdW5jdGlvbih2YWwpeworICAgICAgICAgICAgICAgIGlmKHZhbCkKKyAgICAgICAgICAgICAgICAgICAgc2NvcGUuc29ydFBhdHRlcm4gPSAnYXNjJzsKKyAgICAgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICAgICAgICAgIHNjb3BlLnNvcnRQYXR0ZXJuID0gJ2Rlc2MnOworICAgICAgICAgICAgfSk7CisKKyAgICAgICAgICAgIHNjb3BlLiR3YXRjaChmdW5jdGlvbigpIHsKKyAgICAgICAgICAgICAgICByZXR1cm4gZWxlbS50ZXh0KCk7CisgICAgICAgICAgICB9LCBmdW5jdGlvbih2YWx1ZSkgeworICAgICAgICAgICAgICAgIHNjb3BlLmhlYWRlck5hbWUgPSB2YWx1ZTsKKyAgICAgICAgICAgIH0pOworICAgICAgICAgICAgc2NvcGUuc29ydCA9IGZ1bmN0aW9uKHNvcnRUeXBlKSB7CisgICAgICAgICAgICAgICAgaWYoc29ydFR5cGUgPT09IHRydWUgfHwgc29ydFR5cGUgPT09IGZhbHNlKSB7CisgICAgICAgICAgICAgICAgICAgIHJldmVyc2UgPSBzb3J0VHlwZTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgY3RybC5zb3J0RGF0YShzY29wZS5pbmRleCwgcmV2ZXJzZSk7CisgICAgICAgICAgICAgICAgc2NvcGUuc29ydFBhdHRlcm4gPSByZXZlcnNlID8gJ2Rlc2MnIDogJ2FzYyc7CisgICAgICAgICAgICAgICAgcmV2ZXJzZSA9ICFyZXZlcnNlOworICAgICAgICAgICAgfTsKKyAgICAgICAgICAgIHNjb3BlLiR3YXRjaChmdW5jdGlvbigpIHsKKyAgICAgICAgICAgICAgICByZXR1cm4gY3RybC5jdXJyZW50U29ydEluZGV4OworICAgICAgICAgICAgfSwgZnVuY3Rpb24odmFsdWUpIHsKKyAgICAgICAgICAgICAgICBpZiAodmFsdWUgIT09IHNjb3BlLmluZGV4KSB7CisgICAgICAgICAgICAgICAgICAgIHNjb3BlLnNvcnRQYXR0ZXJuID0gbnVsbDsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9KTsKKyAgICAgICAgICAgIGlmKHNjb3BlLnNvcnRhYmxlICE9PSAnZmFsc2UnKSB7CisgICAgICAgICAgICAgICAgaWYoc2NvcGUuZGVmYXVsdFNvcnQgPT09ICdBJyB8fCBzY29wZS5kZWZhdWx0U29ydCA9PT0gJ2EnKSB7CisgICAgICAgICAgICAgICAgICAgIHNjb3BlLnNvcnQoZmFsc2UpOworICAgICAgICAgICAgICAgIH0gZWxzZSBpZihzY29wZS5kZWZhdWx0U29ydCA9PT0gJ0QnIHx8IHNjb3BlLmRlZmF1bHRTb3J0ID09PSAnZCcpIHsKKyAgICAgICAgICAgICAgICAgICAgc2NvcGUuc29ydCh0cnVlKTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9CisgICAgICAgICAgICBzY29wZS5yZXNldFNvcnRQYXR0ZXJuID0gZnVuY3Rpb24oKSB7CisgICAgICAgICAgICAgICAgcmV2ZXJzZSA9IHRhYmxlQ29uZmlnLmRlZmF1bHRTb3J0UGF0dGVybjsKKyAgICAgICAgICAgIH07CisgICAgICAgIH0KKyAgICB9OworfV0pCisKKy5kaXJlY3RpdmUoJ2F0dFRhYmxlQm9keScsIFsnJGZpbHRlcicsICckdGltZW91dCcsICd0YWJsZUNvbmZpZycsIGZ1bmN0aW9uKCRmaWx0ZXIsICR0aW1lb3V0LCB0YWJsZUNvbmZpZykgeworICAgIHJldHVybiB7CisgICAgICAgIHJlc3RyaWN0OiAnRUEnLAorICAgICAgICByZXF1aXJlOiAnXmF0dFRhYmxlJywKKyAgICAgICAgcmVwbGFjZTogdHJ1ZSwKKyAgICAgICAgdHJhbnNjbHVkZTogdHJ1ZSwKKyAgICAgICAgdGVtcGxhdGVVcmw6ICdhcHAvc2NyaXB0cy9uZ19qc19hdHRfdHBscy90YWJsZS9hdHRUYWJsZUJvZHkuaHRtbCcsCisgICAgICAgIGxpbms6IGZ1bmN0aW9uIChzY29wZSwgZWxlbSwgYXR0ciwgY3RybCkgeworICAgICAgICAgICAgdmFyIGhpZ2hsaWdodFNlYXJjaFN0cmluZ0NsYXNzID0gdGFibGVDb25maWcuaGlnaGxpZ2h0U2VhcmNoU3RyaW5nQ2xhc3M7CisgICAgICAgICAgICB2YXIgc2VhcmNoU3RyaW5nID0gIiI7CisgICAgICAgICAgICAkdGltZW91dChmdW5jdGlvbiAoKSB7CisgICAgICAgICAgICAgICAgdmFyIGFjdHVhbEh0bWwgPSBlbGVtLmNoaWxkcmVuKCk7CisgICAgICAgICAgICAgICAgc2NvcGUuJHdhdGNoKGZ1bmN0aW9uICgpIHsKKyAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGN0cmwuZ2V0U2VhcmNoU3RyaW5nKCk7CisgICAgICAgICAgICAgICAgfSwgZnVuY3Rpb24gKHZhbCkgeworICAgICAgICAgICAgICAgICAgICBzZWFyY2hTdHJpbmcgPSB2YWw7CisgICAgICAgICAgICAgICAgICAgIGNsZWFyV3JhcChlbGVtKTsKKyAgICAgICAgICAgICAgICAgICAgaWYgKGFjdHVhbEh0bWwubGVuZ3RoID4gMCkgeworICAgICAgICAgICAgICAgICAgICAgICAgdHJhdmVyc2UoZWxlbSk7CisgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICAgICAgICAgICAgICB3cmFwRWxlbWVudChlbGVtKTsKKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIH0pOworICAgICAgICAgICAgfSwgNTApOworCisgICAgICAgICAgICB2YXIgdHJhdmVyc2UgPSBmdW5jdGlvbiAoZWxlbSkgeworICAgICAgICAgICAgICAgIHZhciBpbm5lckh0bWwgPSBlbGVtLmNoaWxkcmVuKCk7CisgICAgICAgICAgICAgICAgaWYgKGlubmVySHRtbC5sZW5ndGggPiAwKSB7CisgICAgICAgICAgICAgICAgICAgIGZvciAodmFyIGkgPSAwOyBpIDwgaW5uZXJIdG1sLmxlbmd0aDsgaSsrKSB7CisgICAgICAgICAgICAgICAgICAgICAgICB0cmF2ZXJzZShpbm5lckh0bWwuZXEoaSkpOworICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgICAgICAgICAgd3JhcEVsZW1lbnQoZWxlbSk7CisgICAgICAgICAgICAgICAgICAgIHJldHVybjsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9OworCisgICAgICAgICAgICB2YXIgd3JhcEVsZW1lbnQgPSBmdW5jdGlvbiAoZWxlbSkgeworICAgICAgICAgICAgICAgIHZhciB0ZXh0ID0gZWxlbS50ZXh0KCk7CisgICAgICAgICAgICAgICAgZWxlbS5odG1sKCcnKTsKKyAgICAgICAgICAgICAgICBlbGVtLmFwcGVuZCgkZmlsdGVyKCdoaWdobGlnaHQnKSh0ZXh0LCBzZWFyY2hTdHJpbmcsIGhpZ2hsaWdodFNlYXJjaFN0cmluZ0NsYXNzKSk7CisgICAgICAgICAgICB9OworCisgICAgICAgICAgICB2YXIgY2xlYXJXcmFwID0gZnVuY3Rpb24gKGVsZW0pIHsKKyAgICAgICAgICAgICAgICB2YXIgZWxlbXMgPSBlbGVtLmZpbmQoJyonKTsKKyAgICAgICAgICAgICAgICBmb3IgKHZhciBpID0gMDsgaSA8IGVsZW1zLmxlbmd0aDsgaSsrKSB7CisgICAgICAgICAgICAgICAgICAgIGlmIChlbGVtcy5lcShpKS5hdHRyKCdjbGFzcycpICYmIGVsZW1zLmVxKGkpLmF0dHIoJ2NsYXNzJykuaW5kZXhPZihoaWdobGlnaHRTZWFyY2hTdHJpbmdDbGFzcykgIT09IC0xKSB7CisgICAgICAgICAgICAgICAgICAgICAgICB2YXIgdGV4dCA9IGVsZW1zLmVxKGkpLnRleHQoKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIGVsZW1zLmVxKGkpLnJlcGxhY2VXaXRoKHRleHQpOworICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfTsKKyAgICAgICAgfQorICAgIH07Cit9XSk7CisKK2FuZ3VsYXIubW9kdWxlKCdhdHQuYWJzLnRhYnMnLCBbXSkKKyAgICAgICAgLmRpcmVjdGl2ZSgnYXR0VGFicycsIGZ1bmN0aW9uKCkgeworICAgICAgICAgICAgcmV0dXJueworICAgICAgICAgICAgICAgIHJlc3RyaWN0OiAnRUEnLAorICAgICAgICAgICAgICAgIHRyYW5zY2x1ZGU6IGZhbHNlLAorICAgICAgICAgICAgICAgIHJlcGxhY2U6IHRydWUsCisgICAgICAgICAgICAgICAgc2NvcGU6IHsKKyAgICAgICAgICAgICAgICAgICAgdGFiczogIj10aXRsZSIKKyAgICAgICAgICAgICAgICB9LAorICAgICAgICAgICAgICAgIGNvbnRyb2xsZXI6IFsnJHNjb3BlJywgZnVuY3Rpb24oJHNjb3BlKSB7CisgICAgICAgICAgICAgICAgICAgICAgICB0aGlzLmdldERhdGEgPSBmdW5jdGlvbigpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gJHNjb3BlLnRhYnM7CisgICAgICAgICAgICAgICAgICAgICAgICB9OworICAgICAgICAgICAgICAgICAgICAgICAgdGhpcy5vbkNsaWNrVGFiID0gZnVuY3Rpb24odGFiKSB7CisKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gJHNjb3BlLmN1cnJlbnRUYWIgPSB0YWIudXJsOworICAgICAgICAgICAgICAgICAgICAgICAgfTsKKyAgICAgICAgICAgICAgICAgICAgICAgIHRoaXMuaXNBY3RpdmVUYWIgPSBmdW5jdGlvbih0YWIpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gdGFiID09PSAkc2NvcGUuY3VycmVudFRhYjsKKyAgICAgICAgICAgICAgICAgICAgICAgIH07CisgICAgICAgICAgICAgICAgICAgIH1dLAorICAgICAgICAgICAgICAgIGxpbms6IGZ1bmN0aW9uKHNjb3BlLCBlbGVtLCBhdHRyLCBjdHJsKSB7CisgICAgICAgICAgICAgICAgICAgIGZvciAodmFyIGkgPSAwOyBpIDwgc2NvcGUudGFicy5sZW5ndGg7IGkrKykgeworICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHNjb3BlLnRhYnNbaV0uc2VsZWN0ZWQpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoc2NvcGUudGFic1tpXS51cmwpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2NvcGUuY3VycmVudFRhYiA9IHNjb3BlLnRhYnNbaV0udXJsOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH07CisgICAgICAgIH0pCisgICAgICAgIC5kaXJlY3RpdmUoJ2Zsb2F0aW5nVGFicycsIGZ1bmN0aW9uKCkgeworICAgICAgICAgICAgcmV0dXJuIHsKKyAgICAgICAgICAgICAgICByZXF1aXJlOiAnXmF0dFRhYnMnLAorICAgICAgICAgICAgICAgIHJlc3RyaWN0OiAnRUEnLAorICAgICAgICAgICAgICAgIHRyYW5zY2x1ZGU6IGZhbHNlLAorICAgICAgICAgICAgICAgIHJlcGxhY2U6IHRydWUsCisgICAgICAgICAgICAgICAgc2NvcGU6IHsKKyAgICAgICAgICAgICAgICAgICAgc2l6ZTogIkAiCisgICAgICAgICAgICAgICAgfSwKKyAgICAgICAgICAgICAgICB0ZW1wbGF0ZVVybDogJ2FwcC9zY3JpcHRzL25nX2pzX2F0dF90cGxzL3RhYnMvZmxvYXRpbmdUYWJzLmh0bWwnLAorICAgICAgICAgICAgICAgIGxpbms6IGZ1bmN0aW9uKHNjb3BlLCBlbGVtLCBhdHRyLCBhdHRUYWJzQ3RybCkgeworICAgICAgICAgICAgICAgICAgICBzY29wZS50YWJzID0gYXR0VGFic0N0cmwuZ2V0RGF0YSgpOworICAgICAgICAgICAgICAgICAgICBzY29wZS5vbkNsaWNrVGFiID0gYXR0VGFic0N0cmwub25DbGlja1RhYjsKKyAgICAgICAgICAgICAgICAgICAgc2NvcGUuaXNBY3RpdmVUYWIgPSBhdHRUYWJzQ3RybC5pc0FjdGl2ZVRhYjsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9OworICAgICAgICB9KQorICAgICAgICAuZGlyZWN0aXZlKCdzaW1wbGlmaWVkVGFicycsIGZ1bmN0aW9uKCkgeworICAgICAgICAgICAgcmV0dXJuIHsKKyAgICAgICAgICAgICAgICByZXF1aXJlOiAnXmF0dFRhYnMnLAorICAgICAgICAgICAgICAgIHJlc3RyaWN0OiAnRUEnLAorICAgICAgICAgICAgICAgIHRyYW5zY2x1ZGU6IGZhbHNlLAorICAgICAgICAgICAgICAgIHJlcGxhY2U6IHRydWUsCisgICAgICAgICAgICAgICAgc2NvcGU6IHsKKyAgICAgICAgICAgICAgICAgICAgY3RhYjogIj1uZ01vZGVsIgorICAgICAgICAgICAgICAgIH0sCisgICAgICAgICAgICAgICAgdGVtcGxhdGVVcmw6ICdhcHAvc2NyaXB0cy9uZ19qc19hdHRfdHBscy90YWJzL3NpbXBsaWZpZWRUYWJzLmh0bWwnLAorICAgICAgICAgICAgICAgIGxpbms6IGZ1bmN0aW9uKHNjb3BlLCBlbGVtLCBhdHRyLCBhdHRUYWJzQ3RybCkgeworICAgICAgICAgICAgICAgICAgICBzY29wZS50YWJzID0gYXR0VGFic0N0cmwuZ2V0RGF0YSgpOworICAgICAgICAgICAgICAgICAgICBzY29wZS5jbGlja1RhYiA9IGZ1bmN0aW9uKHRhYikgeworICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHNjb3BlLmN0YWIgPSB0YWIuaWQ7CisgICAgICAgICAgICAgICAgICAgIH07CisgICAgICAgICAgICAgICAgICAgIHNjb3BlLmlzQWN0aXZlID0gZnVuY3Rpb24odGFiKSB7CisgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gdGFiID09PSBzY29wZS5jdGFiOworICAgICAgICAgICAgICAgICAgICB9OworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH07CisgICAgICAgIH0pCisgICAgICAgIAorICAgIC5kaXJlY3RpdmUoJ2dlbmVyaWNUYWJzJywgZnVuY3Rpb24oKSB7CisgICAgICAgICAgICByZXR1cm4geworICAgICAgICAgICAgICAgIHJlcXVpcmU6ICdeYXR0VGFicycsCisgICAgICAgICAgICAgICAgcmVzdHJpY3Q6ICdFQScsCisgICAgICAgICAgICAgICAgdHJhbnNjbHVkZTogZmFsc2UsCisgICAgICAgICAgICAgICAgcmVwbGFjZTogdHJ1ZSwKKyAgICAgICAgICAgICAgICBzY29wZTogeworICAgICAgICAgICAgICAgICAgICBjdGFiOiAiPW5nTW9kZWwiCisgICAgICAgICAgICAgICAgfSwKKyAgICAgICAgICAgICAgICB0ZW1wbGF0ZVVybDogJ2FwcC9zY3JpcHRzL25nX2pzX2F0dF90cGxzL3RhYnMvZ2VuZXJpY1RhYnMuaHRtbCcsCisgICAgICAgICAgICAgICAgbGluazogZnVuY3Rpb24oc2NvcGUsIGVsZW0sIGF0dHIsIGF0dFRhYnNDdHJsKSB7CisgICAgICAgICAgICAgICAgICAgIHNjb3BlLnRhYnMgPSBhdHRUYWJzQ3RybC5nZXREYXRhKCk7CisgICAgICAgICAgICAgICAgICAgIHNjb3BlLmNsaWNrVGFiID0gZnVuY3Rpb24odGFiKSB7CisgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gc2NvcGUuY3RhYiA9IHRhYi5pZDsKKyAgICAgICAgICAgICAgICAgICAgfTsKKyAgICAgICAgICAgICAgICAgICAgc2NvcGUuaXNBY3RpdmUgPSBmdW5jdGlvbih0YWIpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiB0YWIgPT09IHNjb3BlLmN0YWI7CisgICAgICAgICAgICAgICAgICAgIH07CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfTsKKyAgICAgICAgfSkKKyAgICAuZGlyZWN0aXZlKCdwYXJlbnRUYWInLFsgZnVuY3Rpb24oKSB7CisgICAgICAgIHJldHVybiB7CisgICAgICAgICAgICByZXN0cmljdDogJ0VBJywKKyAgICAgICAgICAgIHNjb3BlOiB7CisgICAgICAgICAgICAgICAgbWVudUl0ZW1zOic9JywKKyAgICAgICAgICAgICAgICBhY3RpdmVTdWJNZW51Oic9JywKKyAgICAgICAgICAgICAgICBhY3RpdmVNZW51Oic9JworICAgICAgICAgICAgfSwKKyAgICAgICAgICAgIGNvbnRyb2xsZXI6IFsnJHNjb3BlJyxmdW5jdGlvbigkc2NvcGUpeworICAgICAgICAgICAgICAgICAgICAkc2NvcGUubWVnYU1lbnU9JHNjb3BlLm1lbnVJdGVtczsKKyAgICAgICAgICAgICAgICAgICAgJHNjb3BlLm1lZ2FNZW51VGFiOworICAgICAgICAgICAgICAgICAgICAkc2NvcGUubWVnYU1lbnVIb3ZlclRhYjsKKyAgICAgICAgICAgICAgICAgICAgdGhpcy5zZXRNZW51PWZ1bmN0aW9uKGluZGV4KXsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAkc2NvcGUubWVudUl0ZW1zPSRzY29wZS5tZWdhTWVudTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBmb3IodmFyIGk9MDsgaTwkc2NvcGUubWVudUl0ZW1zLmxlbmd0aDsgaSsrKXsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmKCRzY29wZS5tZW51SXRlbXNbaV0uYWN0aXZlID09IHRydWUpewkJCQkJCQkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJHNjb3BlLmFjdGl2ZU1lbnU9JHNjb3BlLm1lbnVJdGVtc1tpXTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH07CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgfTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB0aGlzLnNldFN1Yk1lbnVTdGF0dXMoZmFsc2UpOworCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgJHNjb3BlLiRhcHBseSgpOworICAgICAgICAgICAgICAgICAgICB9OwkKKyAgICAgICAgICAgICAgICAgICAgdGhpcy5zZXRBY3RpdmVNZW51PWZ1bmN0aW9uKCl7CisgICAgICAgICAgICAgICAgICAgIGlmKCEoJHNjb3BlLm1lZ2FNZW51VGFiPT0idW5kZWZpbmVkIiB8fCAkc2NvcGUubWVnYU1lbnVUYWI9PW51bGwpKXsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAkc2NvcGUubWVudUl0ZW1zPVskc2NvcGUubWVnYU1lbnVUYWJdOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICRzY29wZS5hY3RpdmVNZW51PXt9OworICAgICAgICAgICAgICAgICAgICAgICAgICAgICRzY29wZS5hY3RpdmVTdWJNZW51PSRzY29wZS5tZWdhTWVudVRhYjsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB0aGlzLnNldFN1Yk1lbnVTdGF0dXModHJ1ZSk7CQkJCQorICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgIGVsc2V7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgZm9yKHZhciBpPTA7IGk8JHNjb3BlLm1lbnVJdGVtcy5sZW5ndGg7IGkrKyl7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoJHNjb3BlLm1lbnVJdGVtc1tpXS5hY3RpdmUgPSBmYWxzZSk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZigkc2NvcGUubWVudUl0ZW1zW2ldLnN1Ykl0ZW1zKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZm9yKHZhciBqPTA7IGo8JHNjb3BlLm1lbnVJdGVtc1tpXS5zdWJJdGVtcy5sZW5ndGg7IGorKyl7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJHNjb3BlLm1lbnVJdGVtc1tpXS5zdWJJdGVtc1tqXS5hY3RpdmUgPSBmYWxzZTsJCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH07CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgfTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAkc2NvcGUubWVudUl0ZW1zPSRzY29wZS5tZWdhTWVudTsKKyAgICAgICAgICAgICAgICAgICAgfQkKKyAgICAgICAgICAgICAgICAgICAgJHNjb3BlLiRhcHBseSgpOwkKKyAgICAgICAgICAgICAgICAgICAgfTsKKyAgICAgICAgICAgICAgICAgICAgdmFyIGNoZWNrU3ViTWVudVN0YXR1cyA9IGZhbHNlOworCisgICAgICAgICAgICAgICAgICAgIHRoaXMuc2V0U3ViTWVudVN0YXR1cyA9IGZ1bmN0aW9uKHZhbHVlKXsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBjaGVja1N1Yk1lbnVTdGF0dXMgPSB2YWx1ZTsKKyAgICAgICAgICAgICAgICAgICAgfTsKKyAgICAgICAgICAgICAgICAgICAgdGhpcy5nZXRTdWJNZW51U3RhdHVzID0gZnVuY3Rpb24oKXsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gY2hlY2tTdWJNZW51U3RhdHVzOworICAgICAgICAgICAgICAgICAgICB9OworICAgICAgICAgICAgICAgICAgICB0aGlzLnNldEFjdGl2ZU1lbnVUYWI9ZnVuY3Rpb24odGFiKXsKKyAgICAgICAgICAgICAgICAgICAgJHNjb3BlLm1lZ2FNZW51VGFiPXRhYjsKKyAgICAgICAgICAgICAgICAgICAgfTsKKyAgICAgICAgICAgICAgICAgICAgdGhpcy5zZXRBY3RpdmVNZW51SG92ZXJUYWI9ZnVuY3Rpb24odGFiKXsKKyAgICAgICAgICAgICAgICAgICAgJHNjb3BlLm1lZ2FNZW51SG92ZXJUYWI9dGFiOworICAgICAgICAgICAgICAgICAgICB9OworICAgICAgICAgICAgICAgICAgICB0aGlzLnNldEFjdGl2ZVN1Yk1lbnVUYWI9ZnVuY3Rpb24oKXsKKyAgICAgICAgICAgICAgICAgICAgJHNjb3BlLm1lZ2FNZW51VGFiPSRzY29wZS5tZWdhTWVudUhvdmVyVGFiOworICAgICAgICAgICAgICAgICAgICB9OworICAgICAgICAgICAgICAgICAgICB0aGlzLnJlc2V0TWVudVRhYj1mdW5jdGlvbigpeworICAgICAgICAgICAgICAgICAgICAkc2NvcGUubWVnYU1lbnVUYWI9J3VuZGVmaW5lZCc7CisgICAgICAgICAgICAgICAgICAgIH07CisgICAgICAgICAgICB9XQorICAgICAgICB9CisgICAgIH1dKQorICAgIC5kaXJlY3RpdmUoJ3BhcmVudG1lbnVUYWJzJyxbIGZ1bmN0aW9uKCkgeworICAgICAgICByZXR1cm4geworICAgICAgICAgICAgcmVzdHJpY3Q6ICdFQScsCisgICAgICAgICAgICB0cmFuc2NsdWRlOiB0cnVlLAorICAgICAgICAgICAgcmVwbGFjZTogdHJ1ZSwKKyAgICAgICAgICAgIHNjb3BlOiB7CisgICAgICAgICAgICAgICAgbWVnYU1lbnU6J0AnLAorICAgICAgICAgICAgICAgIG1lbnVJdGVtczonPScKKyAgICAgICAgICAgIH0sCisgICAgICAgICAgICBjb250cm9sbGVyOiBbJyRzY29wZScsZnVuY3Rpb24oJHNjb3BlKXsKKyAgICAgICAgICAgICAgICAgICAgdGhpcy5nZXRNZW51PWZ1bmN0aW9uKCl7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuICRzY29wZS5tZW51SXRlbXM7CisgICAgICAgICAgICAgICAgICAgIH07CisgICAgICAgICAgICAgICAgICAgIHRoaXMuc2V0TWVudT1mdW5jdGlvbihtZW51SXRlbSl7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICRzY29wZS5tZW51SXRlbXM9bWVudUl0ZW07CisgICAgICAgICAgICAgICAgICAgIH07CQkJCQkKKyAgICAgICAgICAgIH1dLAorICAgICAgICAgICAgdGVtcGxhdGVVcmw6ICdhcHAvc2NyaXB0cy9uZ19qc19hdHRfdHBscy90YWJzL3BhcmVudG1lbnVUYWIuaHRtbCcJCisgICAgICAgIH0JCQorICAgIH1dKQorICAgIC5kaXJlY3RpdmUoJ21lbnVUYWJzJyxbIiR3aW5kb3ciLCIkZG9jdW1lbnQiLCAgZnVuY3Rpb24od2luLCRkb2N1bWVudCkgeworICAgICByZXR1cm4geworICAgICAgICAgcmVzdHJpY3Q6ICdFQScsCisgICAgICAgICB0cmFuc2NsdWRlOiB0cnVlLAorICAgICAgICAgcmVwbGFjZTogdHJ1ZSwKKyAgICAgICAgIHJlcXVpcmU6IFsnXnBhcmVudFRhYicsICdeP3BhcmVudG1lbnVUYWJzJ10sCisgICAgICAgICBzY29wZTogeworICAgICAgICAgICAgIGFjdGl2ZU1lbnU6Ij0iLAorICAgICAgICAgICAgIG1lbnVJdGVtOiAiPSIsCisgICAgICAgICAgICAgc3ViTWVudTogIkAiLAorICAgICAgICAgICAgIHN1Ykl0ZW1BY3RpdmU6ICJAIgorICAgICAgICAgfSwKKyAgICAgICAgIHRlbXBsYXRlVXJsOmZ1bmN0aW9uKGVsZW1lbnQsIGF0dHJzKSB7CisgICAgICAgICAgICAgaWYoYXR0cnMubWVnYU1lbnUpeworICAgICAgICAgICAgICAgICByZXR1cm4gJ2FwcC9zY3JpcHRzL25nX2pzX2F0dF90cGxzL3RhYnMvbWVudVRhYi5odG1sJzsKKyAgICAgICAgICAgICB9CisgICAgICAgICAgICAgZWxzZXsKKyAgICAgICAgICAgICAgICAgcmV0dXJuICdhcHAvc2NyaXB0cy9uZ19qc19hdHRfdHBscy90YWJzL3N1Ym1lbnVUYWIuaHRtbCc7CisgICAgICAgICAgICAgfQorICAgICAgICAgfSwKKyAgICAgICAgIGxpbms6IGZ1bmN0aW9uKHNjb3BlLCBlbGVtLCBhdHRyLGN0cmwpIHsKKyAgICAgICAgICAgICB2YXIgcGFyZW50Q3RybCA9IGN0cmxbMF07CisgICAgICAgICAgICAgdmFyIHBhcmVudG1lbnVDdHJsID0gY3RybFsxXTsKKyAgICAgICAgICAgICBzY29wZS5jbGlja0luYWN0aXZlPXRydWU7CisgICAgICAgICAgICAgc2NvcGUuc2hvd0hvdmVyQ2hpbGQgPSBmdW5jdGlvbihlKXsJCQorICAgICAgICAgICAgICAgICBzY29wZS5jbGlja0luYWN0aXZlPWZhbHNlOworICAgICAgICAgICAgICAgICBzY29wZS5ob3ZlckNoaWxkPWN0cmxbMF0uZ2V0U3ViTWVudVN0YXR1cygpOwkKKyAgICAgICAgICAgICAgICAgICAgICAgICBpZihlLnR5cGU9PSJtb3VzZW92ZXIiICYmIGN0cmxbMF0uZ2V0U3ViTWVudVN0YXR1cygpKQorICAgICAgICAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNjb3BlLnNob3dDaGlsZHJlbihlKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICB9CQkJCQkKKyAgICAgICAgICAgICB9CQkKKyAgICAgICAgICAgICBzY29wZS5zaG93Q2hpbGRyZW4gPSBmdW5jdGlvbihlKXsKKyAgICAgICAgICAgICAgICAgc2NvcGUucGFyZW50TWVudUl0ZW1zPXBhcmVudG1lbnVDdHJsLmdldE1lbnUoKTsKKyAgICAgICAgICAgICAgICAgZm9yKHZhciBpPTA7IGk8c2NvcGUucGFyZW50TWVudUl0ZW1zLmxlbmd0aDsgaSsrKXsKKyAgICAgICAgICAgICAgICAgICAgICAgICBzY29wZS5wYXJlbnRNZW51SXRlbXNbaV0uYWN0aXZlID0gZmFsc2U7CisgICAgICAgICAgICAgICAgICAgICAgICAgaWYoc2NvcGUucGFyZW50TWVudUl0ZW1zW2ldLnN1Ykl0ZW1zKXsJCQkJCQkJCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBmb3IodmFyIGo9MDsgajxzY29wZS5wYXJlbnRNZW51SXRlbXNbaV0uc3ViSXRlbXMubGVuZ3RoOyBqKyspeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzY29wZS5wYXJlbnRNZW51SXRlbXNbaV0uc3ViSXRlbXNbal0uYWN0aXZlID0gZmFsc2U7CQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfTsKKyAgICAgICAgICAgICAgICAgICAgICAgICB9OworICAgICAgICAgICAgICAgICAgICAgICAgIHNjb3BlLmNsaWNrSW5hY3RpdmU9dHJ1ZTsKKyAgICAgICAgICAgICAgICAgfTsKKyAgICAgICAgICAgICAgICAgc2NvcGUubWVudUl0ZW0uYWN0aXZlID0gdHJ1ZTsKKyAgICAgICAgICAgICAgICAgc2NvcGUuYWN0aXZlTWVudT1zY29wZS5tZW51SXRlbTsKKyAgICAgICAgICAgICAgICAgZS5zdG9wUHJvcGFnYXRpb24oKTsKKyAgICAgICAgICAgICB9OworICAgICAgICAgICAgIHNjb3BlLiR3YXRjaCgic3ViSXRlbUFjdGl2ZSIsZnVuY3Rpb24odmFsdWUpeworICAgICAgICAgICAgICAgICBpZih2YWx1ZT09InRydWUiICYmIHNjb3BlLnN1Yk1lbnU9PSd0cnVlJyl7CisgICAgICAgICAgICAgICAgIHBhcmVudEN0cmwuc2V0QWN0aXZlTWVudUhvdmVyVGFiKHNjb3BlLm1lbnVJdGVtKTsJCisgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICB9KTsKKworICAgICAgICAgICAgIHNjb3BlLnNob3dNZW51Q2xpY2s9ZnVuY3Rpb24oKXsKKyAgICAgICAgICAgICAgICAgICAgIHBhcmVudEN0cmwuc2V0QWN0aXZlTWVudVRhYihzY29wZS5tZW51SXRlbSk7CQkKKyAgICAgICAgICAgICB9OworICAgICAgICAgICAgIHNjb3BlLnNob3dTdWJNZW51Q2xpY2s9ZnVuY3Rpb24oKXsKKyAgICAgICAgICAgICAgICAgICAgIHBhcmVudEN0cmwuc2V0QWN0aXZlU3ViTWVudVRhYigpOwkJCisgICAgICAgICAgICAgfTsKKyAgICAgICAgICAgICBzY29wZS5yZXNldE1lbnU9ZnVuY3Rpb24oKXsKKyAgICAgICAgICAgICAgICAgICAgIHBhcmVudEN0cmwucmVzZXRNZW51VGFiKCk7CQkKKyAgICAgICAgICAgICB9OworCisgICAgICAgICAgICAgZnVuY3Rpb24gZGVib3VuY2UobWV0aG9kLCBkZWxheSkgeworICAgICAgICAgICAgICAgICAgICAgY2xlYXJUaW1lb3V0KG1ldGhvZC5fdElkKTsKKyAgICAgICAgICAgICAgICAgICAgIG1ldGhvZC5fdElkPSBzZXRUaW1lb3V0KGZ1bmN0aW9uKCl7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBhcmVudEN0cmwuc2V0TWVudSgpOworICAgICAgICAgICAgICAgICAgICAgfSwgZGVsYXkpOworICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICBmdW5jdGlvbiBkZWJvdW5jZTEobWV0aG9kLCBkZWxheSkgeworICAgICAgICAgICAgICAgICAgICAgY2xlYXJUaW1lb3V0KG1ldGhvZC5fdElkKTsKKyAgICAgICAgICAgICAgICAgICAgIG1ldGhvZC5fdElkPSBzZXRUaW1lb3V0KGZ1bmN0aW9uKCl7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBhcmVudEN0cmwuc2V0QWN0aXZlTWVudSgpOworICAgICAgICAgICAgICAgICAgICAgfSwgZGVsYXkpOworICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAkZG9jdW1lbnQuYmluZCgnc2Nyb2xsJywgZnVuY3Rpb24oKSB7CisgICAgICAgICAgICAgICAgICAgICBpZih3aW4ucGFnZVlPZmZzZXQ9PT0wKXsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZGVib3VuY2UocGFyZW50Q3RybC5zZXRNZW51LCAxMDApOworICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgZWxzZSBpZih3aW4ucGFnZVlPZmZzZXQ+MSAmJiB3aW4ucGFnZVlPZmZzZXQ8MTUwMCl7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRlYm91bmNlMShwYXJlbnRDdHJsLnNldEFjdGl2ZU1lbnUsIDEwMCk7CisgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgfSk7CisgICAgICAgICB9CisgICAgIH07CisgfV0pOworYW5ndWxhci5tb2R1bGUoJ2F0dC5hYnMudGFnQmFkZ2VzJywgW10pCisgICAgICAgIC5kaXJlY3RpdmUoJ3RhZ0JhZGdlcycsIFsnJHBhcnNlJywgJyR0aW1lb3V0JywgZnVuY3Rpb24oJHBhcnNlLCAkdGltZW91dCkgeworICAgICAgICAgICAgICAgIHJldHVybiB7CisgICAgICAgICAgICAgICAgICAgIHJlc3RyaWN0OiAnRUEnLAorICAgICAgICAgICAgICAgICAgICByZXBsYWNlOiBmYWxzZSwKKyAgICAgICAgICAgICAgICAgICAgdHJhbnNjbHVkZTogdHJ1ZSwKKyAgICAgICAgICAgICAgICAgICAgdGVtcGxhdGVVcmw6ICdhcHAvc2NyaXB0cy9uZ19qc19hdHRfdHBscy90YWdCYWRnZXMvdGFnQmFkZ2VzLmh0bWwnLAorICAgICAgICAgICAgICAgICAgICBzY29wZTogeworICAgICAgICAgICAgICAgICAgICAgICAgc3R5bGVUeXBlOiAiQCIsCisgICAgICAgICAgICAgICAgICAgICAgICBvbkNsb3NlOiAiJiIKKyAgICAgICAgICAgICAgICAgICAgfSwKKyAgICAgICAgICAgICAgICAgICAgbGluazogZnVuY3Rpb24oc2NvcGUsIGVsZW0sIGF0dHIsIGN0cmwpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIHNjb3BlLmlzU21hbGwgPSBmYWxzZTsKKyAgICAgICAgICAgICAgICAgICAgICAgIHNjb3BlLmlzSWNvbiA9IGZhbHNlOworICAgICAgICAgICAgICAgICAgICAgICAgc2NvcGUuaXNDb2xvciA9IGZhbHNlOworICAgICAgICAgICAgICAgICAgICAgICAgc2NvcGUuZGlzcGxheSA9IHRydWU7CisgICAgICAgICAgICAgICAgICAgICAgICBzY29wZS5pc0Nsb3NhYmxlID0gZmFsc2U7CisgICAgICAgICAgICAgICAgICAgICAgICBzY29wZS5pc0hpZ2hsaWdodCA9IGZhbHNlOworICAgICAgICAgICAgICAgICAgICAgICAgc2NvcGUuY3VzdG9tQ29sb3IgPSBmYWxzZTsKKworICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGF0dHIuc21hbGwgPT09ICIiKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2NvcGUuaXNTbWFsbCA9IHRydWU7CisgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICAKKyAgICAgICAgICAgICAgICAgICAgICAgIGlmIChzY29wZS5zdHlsZVR5cGUgPT09ICJpY29uIikgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNjb3BlLmlzSWNvbiA9IHRydWU7CisgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICBlbHNlIGlmIChzY29wZS5zdHlsZVR5cGUgPT09ICJjb2xvciIpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBzY29wZS5pc0NvbG9yID0gdHJ1ZTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZihhdHRyLmNvbG9yICE9IHVuZGVmaW5lZCAmJiBhdHRyLmNvbG9yICE9ICIiKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNjb3BlLmN1c3RvbUNvbG9yID0gdHJ1ZTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYXR0ci4kb2JzZXJ2ZSgiY29sb3IiLCBmdW5jdGlvbih2YWwpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNjb3BlLmJvcmRlcl90eXBlX2JvcmRlckNvbG9yID0gdmFsOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2NvcGUuYmFja2dyb3VuZF90eXBlX2JhY2tncm91bmRDb2xvciA9IHZhbDsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNjb3BlLmJhY2tncm91bmRfdHlwZV9ib3JkZXJDb2xvciA9IHZhbDsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgCisgICAgICAgICAgICAgICAgICAgICAgICBzY29wZS5hY3RpdmVIaWdobGlnaHQgPSBmdW5jdGlvbihzdGF0ZSl7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYoc2NvcGUuY3VzdG9tQ29sb3IpeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZihzdGF0ZSl7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzY29wZS5pc0hpZ2hsaWdodCA9IHRydWU7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZWxzZXsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNjb3BlLmlzSGlnaGxpZ2h0ID0gZmFsc2U7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICB9OworICAgICAgICAgICAgICAgICAgICAgICAgCisgICAgICAgICAgICAgICAgICAgICAgICBpZiAoYXR0ci5jbG9zYWJsZSA9PT0gIiIpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBzY29wZS5pc0Nsb3NhYmxlID0gdHJ1ZTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBzY29wZS5jbG9zZU1lID0gZnVuY3Rpb24oKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNjb3BlLmRpc3BsYXkgPSBmYWxzZTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICR0aW1lb3V0KGZ1bmN0aW9uKCl7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBlbGVtLmF0dHIoInRhYmluZGV4IiwgIjAiKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGVsZW1bMF0uZm9jdXMoKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGVsZW0uYmluZCgnYmx1cicsIGZ1bmN0aW9uKCl7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZWxlbS5yZW1vdmUoKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0pOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9KTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmKGF0dHJbJ29uQ2xvc2UnXSl7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzY29wZS5vbkNsb3NlID0gJHBhcnNlKHNjb3BlLm9uQ2xvc2UpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2NvcGUub25DbG9zZSgpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgfTsKKyAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH1dKTsKK2FuZ3VsYXIubW9kdWxlKCdhdHQuYWJzLnRleHRPdmVyZmxvdycsIFtdKQorICAgICAgICAuY29uc3RhbnQoJ3RleHREZWZhdWx0T3B0aW9ucycsIHsKKyAgICAgICAgICAgIHdpZHRoOiAnNTAlJworICAgICAgICB9KQorLmRpcmVjdGl2ZSgnYXR0VGV4dE92ZXJmbG93JywgWyd0ZXh0RGVmYXVsdE9wdGlvbnMnLCckY29tcGlsZScsZnVuY3Rpb24odGV4dERlZmF1bHRPcHRpb25zLCRjb21waWxlKQoreworICAgIHJldHVybiB7CisgICAgICAgIHJlc3RyaWN0OiAnQScsCisgICAgICAgIGxpbms6IGZ1bmN0aW9uKHNjb3BlLCBlbGVtLCBhdHRycywgY3RybCkKKyAgICAgICAgeworICAgICAgICAgICAgdmFyIHRvb2x0aXBUZXh0ID0gZWxlbS50ZXh0KCk7CisgICAgICAgICAgICBlbGVtLmFkZENsYXNzKCd0ZXh0LWVsbGlwc2lzJyk7CisgICAgICAgICAgICBhdHRycy4kb2JzZXJ2ZSgnYXR0VGV4dE92ZXJmbG93JywgZnVuY3Rpb24odmFsKXsKKyAgICAgICAgICAgICAgICBpZih2YWwpCisgICAgICAgICAgICAgICAgICAgIGVsZW0uY3NzKHsid2lkdGgiOnZhbH0pOworICAgICAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgICAgICAgICAgZWxlbS5jc3MoeyJ3aWR0aCI6dGV4dERlZmF1bHRPcHRpb25zLndpZHRofSk7CisgICAgICAgICAgICB9KTsKKyAgICAgICAgICAgIGlmKCEoZWxlbS5hdHRyKCd0b29sdGlwJykpKXsKKyAgICAgICAgICAgICAgICBlbGVtLmF0dHIoInRvb2x0aXAiLCB0b29sdGlwVGV4dCk7CisgICAgICAgICAgICAgICAgZWxlbS5hdHRyKCJ0b29sdGlwLXBsYWNlbWVudCIsICdhYm92ZScpOworICAgICAgICAgICAgICAgIHZhciBuZXdFbGVtID0gIGFuZ3VsYXIuZWxlbWVudChlbGVtKTsKKyAgICAgICAgICAgICAgICAkY29tcGlsZShuZXdFbGVtKShzY29wZSk7CisgICAgICAgICAgICB9CisgICAgICAgIH0KKyAgICB9OworfV0pOworCithbmd1bGFyLm1vZHVsZSgnYXR0LmFicy50b2dnbGUnLCBbJ2FuZ3VsYXItZ2VzdHVyZXMnLCAnYXR0LmFicy5wb3NpdGlvbiddKQorICAgICAgICAuZGlyZWN0aXZlKCdhdHRUb2dnbGVUZW1wbGF0ZScsIFsnJGNvbXBpbGUnLCAnJGxvZycsICckcG9zaXRpb24nLCAgZnVuY3Rpb24oJGNvbXBpbGUsICRsb2csICRwb3NpdGlvbikKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICByZXR1cm57CisgICAgICAgICAgICAgICAgICAgIHJlc3RyaWN0OiAnQScsCisgICAgICAgICAgICAgICAgICAgIHJlcXVpcmU6ICduZ01vZGVsJywKKyAgICAgICAgICAgICAgICAgICAgdHJhbnNjbHVkZTogdHJ1ZSwKKyAgICAgICAgICAgICAgICAgICAgc2NvcGU6IHsKKyAgICAgICAgICAgICAgICAgICAgICAgIG1vZGVsVmFsOiAiPW5nTW9kZWwiCisgICAgICAgICAgICAgICAgICAgIH0sCisgICAgICAgICAgICAgICAgICAgIHRlbXBsYXRlVXJsOiAnYXBwL3NjcmlwdHMvbmdfanNfYXR0X3RwbHMvdG9nZ2xlL2RlbW9Ub2dnbGUuaHRtbCcsCisgICAgICAgICAgICAgICAgICAgIGxpbms6IGZ1bmN0aW9uKHNjb3BlLCBlbGVtZW50LCBhdHRyLCBjdHJsKSB7CisgICAgICAgICAgICAgICAgICAgICAgICB2YXIgbmdDdHJsID0gY3RybDsKKyAgICAgICAgICAgICAgICAgICAgICAgIHNjb3BlLmluaXRpYWxEcmFnUG9zaXRpb24gPSAwOworICAgICAgICAgICAgICAgICAgICAgICAgdmFyIGRyYWdTdGF0dXMgPSAwOworICAgICAgICAgICAgICAgICAgICAgICAgdmFyIHN3aXRjaE1vdmVtZW50UGF0aCA9ICgkcG9zaXRpb24ub2Zmc2V0KGVsZW1lbnQuY2hpbGRyZW4oKS5lcSgxKS5jaGlsZHJlbigpLmVxKDApKS53aWR0aCAtMSk7CisgICAgICAgICAgICAgICAgICAgICAgICBzY29wZS5kcmFnID0gZnVuY3Rpb24oZSkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhciBzZWxmID0gdGhpczsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBkcmFnU3RhdHVzID0gMTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoZS50eXBlID09PSAnZHJhZ3N0YXJ0JykgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzY29wZS5pbml0aWFsRHJhZ1Bvc2l0aW9uID0gJHBvc2l0aW9uLnBvc2l0aW9uKGVsZW1lbnQuY2hpbGRyZW4oKS5lcSgxKSkubGVmdDsKKworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBlbGVtZW50LmNoaWxkcmVuKCkuZXEoMSkuYWRkQ2xhc3MoJ2RyYWdnaW5nJyk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIGlmIChlLnR5cGUgPT09ICdkcmFnJykgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YXIgbGVmdCA9IE1hdGgubWluKDAsIE1hdGgubWF4KHNjb3BlLmluaXRpYWxEcmFnUG9zaXRpb24gKyBlLmdlc3R1cmUuZGVsdGFYLCAtc3dpdGNoTW92ZW1lbnRQYXRoKSk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGVsZW1lbnQuY2hpbGRyZW4oKS5lcSgxKS5jc3MoeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbGVmdDogbGVmdCArICdweCcKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIGlmIChlLnR5cGUgPT09ICdkcmFnZW5kJykgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YXIgaXNPbiA9ICRwb3NpdGlvbi5wb3NpdGlvbihlbGVtZW50LmNoaWxkcmVuKCkuZXEoMSkpLmxlZnQgPiAoc3dpdGNoTW92ZW1lbnRQYXRoKi0xKS8yOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBlbGVtZW50LmNoaWxkcmVuKCkuZXEoMSkucmVtb3ZlQ2xhc3MoJ2RyYWdnaW5nJyk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFR3ZWVuTWF4LnRvKGVsZW1lbnQuY2hpbGRyZW4oKS5lcSgxKSwgLjEsIHtsZWZ0OiBpc09uID8gMCA6IChzd2l0Y2hNb3ZlbWVudFBhdGgqLTEpLCBlYXNlOiBQb3dlcjQuZWFzZU91dCwgb25Db21wbGV0ZTogZnVuY3Rpb24oKXtlbGVtZW50LmNoaWxkcmVuKCkuZXEoMSkuY3NzKHtsZWZ0OiAnJ30pIH0gfSk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmKGlzT24gPT09IHRydWUpeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB1cGRhdGVNb2RlbFZhbCgpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBlbHNlIGlmKGlzT24gPT09IGZhbHNlICYmIGUuZ2VzdHVyZS5kaXJlY3Rpb24gPT09ICJsZWZ0Iil7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHVwZGF0ZU1vZGVsVmFsKCk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgZHJhZ1N0YXR1cyA9IDA7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQorCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGZhbHNlOworICAgICAgICAgICAgICAgICAgICAgICAgfTsKKworICAgICAgICAgICAgICAgICAgICAgICAgc2NvcGUuZGlyZWN0aXZlVmFsdWUgPSBhdHRyLmF0dFRvZ2dsZVRlbXBsYXRlOworICAgICAgICAgICAgICAgICAgICAgICAgc2NvcGUub24gPSBhdHRyLnRydWVWYWx1ZTsKKyAgICAgICAgICAgICAgICAgICAgICAgIHNjb3BlLm9mZiA9IGF0dHIuZmFsc2VWYWx1ZTsKKyAgICAgICAgICAgICAgICAgICAgICAgIHZhciBzd2l0Y2hNb3ZlbWVudFBhdGhQaXhlbHMgPSAoKHN3aXRjaE1vdmVtZW50UGF0aCkqLTEpICsgJ3B4JzsKKyAgICAgICAgICAgICAgICAgICAgICAgIHNjb3BlLiR3YXRjaCgnbW9kZWxWYWwnLCBmdW5jdGlvbihuZXdWYWwpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBzY29wZS5hdHRyVmFsdWUgPSBuZXdWYWw7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKG5ld1ZhbCA9PT0gYXR0ci5uZ1RydWVWYWx1ZSB8fCBuZXdWYWwgPT09IHRydWUpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZWxlbWVudC5jaGlsZHJlbigpLmVxKDEpLmNzcyh7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBsZWZ0IDogJzBweCcKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGVsZW1lbnQuYWRkQ2xhc3MoJ2F0dC1jaGVja2JveC0tb24nKTsgCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGVsZW1lbnQuYXR0cigiYXJpYS1jaGVja2VkIiwgdHJ1ZSk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRyYWdTdGF0dXMgPSAwOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGVsZW1lbnQuY2hpbGRyZW4oKS5lcSgxKS5jc3MoeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbGVmdCA6IHN3aXRjaE1vdmVtZW50UGF0aFBpeGVscworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9KTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZWxlbWVudC5yZW1vdmVDbGFzcygnYXR0LWNoZWNrYm94LS1vbicpOyAKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZWxlbWVudC5hdHRyKCJhcmlhLWNoZWNrZWQiLCBmYWxzZSk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRyYWdTdGF0dXMgPSAwOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBlbGVtZW50LmNoaWxkcmVuKCkuZXEoMSkuY3NzKHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxlZnQgOiAnJworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9KTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAKKyAgICAgICAgICAgICAgICAgICAgICAgIH0pOworCisgICAgICAgICAgICAgICAgICAgICAgICB2YXIgdXBkYXRlTW9kZWxWYWwgPSBmdW5jdGlvbigpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoc2NvcGUuYXR0clZhbHVlID09PSBhdHRyLm5nVHJ1ZVZhbHVlIHx8IHNjb3BlLmF0dHJWYWx1ZSA9PT0gdHJ1ZSkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNjb3BlLm1vZGVsVmFsID0gZmFsc2U7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNjb3BlLm1vZGVsVmFsID0gdHJ1ZTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICB9OworICAgICAgICAgICAgICAgICAgICAgICAgc2NvcGUudXBkYXRlTW9kZWwgPSBmdW5jdGlvbihlbnYpeworICAgICAgICAgICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChkcmFnU3RhdHVzICE9PSAxKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHVwZGF0ZU1vZGVsVmFsKCk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRyYWdTdGF0dXMgPSAwOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB9OyAKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBlbnYucHJldmVudERlZmF1bHQoKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIH07CisgICAgICAgICAgICAgICAgICAgICAgICAKKworICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgfTsKKyAgICAgICAgICAgIH0KKworICAgICAgICBdKQorCisgICAgICAgIC5kaXJlY3RpdmUoJ2F0dFRvZ2dsZU1haW4nLCBbJyRjb21waWxlJywgJyRsb2cnLCBmdW5jdGlvbigkY29tcGlsZSwgJGxvZykKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICByZXR1cm57CisgICAgICAgICAgICAgICAgICAgIHJlc3RyaWN0OiAnQScsCisgICAgICAgICAgICAgICAgICAgIHJlcXVpcmU6ICduZ01vZGVsJywKKyAgICAgICAgICAgICAgICAgICAgdHJhbnNjbHVkZTogdHJ1ZSwKKyAgICAgICAgICAgICAgICAgICAgcmVwbGFjZTogdHJ1ZSwKKyAgICAgICAgICAgICAgICAgICAgc2NvcGU6IHsKKyAgICAgICAgICAgICAgICAgICAgICAgIG1vZGVsVmFsdWU6ICI9bmdNb2RlbCIsCisgICAgICAgICAgICAgICAgICAgICAgICB0cnVlVmFsdWU6ICI9bmdUcnVlVmFsdWUiLAorICAgICAgICAgICAgICAgICAgICAgICAgZmFsc2VWYWx1ZTogIj1uZ0ZhbHNlVmFsdWUiCisgICAgICAgICAgICAgICAgICAgIH0sCisgICAgICAgICAgICAgICAgICAgIGxpbms6IGZ1bmN0aW9uKHNjb3BlLCBlbGVtZW50LCBhdHRyLCBjdHJsKSB7CisgICAgICAgICAgICAgICAgICAgICAgICB2YXIgbmdDdHJsID0gY3RybDsKKyAgICAgICAgICAgICAgICAgICAgICAgIHZhciBodG1sID0gIiI7CisgICAgICAgICAgICAgICAgICAgICAgICB2YXIgYXR0clZhbCA9ICIiOworICAgICAgICAgICAgICAgICAgICAgICAgZWxlbWVudC5yZW1vdmVBdHRyKCdhdHQtdG9nZ2xlLW1haW4nKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIHNjb3BlLm9uID0gYXR0ci5uZ1RydWVWYWx1ZTsKKyAgICAgICAgICAgICAgICAgICAgICAgIHNjb3BlLm9mZiA9IGF0dHIubmdGYWxzZVZhbHVlOworICAgICAgICAgICAgICAgICAgICAgICAgc2NvcGUubGFyZ2VWYWx1ZSA9IGF0dHIuYXR0VG9nZ2xlTWFpbjsKKyAgICAgICAgICAgICAgICAgICAgICAgIGlmIChhbmd1bGFyLmlzRGVmaW5lZChhdHRyLm5nVHJ1ZVZhbHVlKSkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGh0bWwgKz0gJyB0cnVlLXZhbHVlPSJ7e29ufX0iIGZhbHNlLXZhbHVlPSJ7e29mZn19Iic7CisgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICBpZiAoc2NvcGUubGFyZ2VWYWx1ZSAhPT0gdW5kZWZpbmVkKQorICAgICAgICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGF0dHJWYWwgKz0gJyA9Int7bGFyZ2VWYWx1ZX19Iic7CisgICAgICAgICAgICAgICAgICAgICAgICB9CisKKyAgICAgICAgICAgICAgICAgICAgICAgIGVsZW1lbnQuY3NzKHtkaXNwbGF5Oidub25lJ30pOworICAgICAgICAgICAgICAgICAgICAgICAgdmFyIGVsbSA9IGFuZ3VsYXIuZWxlbWVudCgnPGRpdiByb2xlPSJjaGVja2JveCIgY2xhc3M9ImF0dC1zd2l0Y2ggYXR0LXN3aXRjaC1hbHQiICBuZy1jbGFzcz0ie1wnbGFyZ2VcJyA6IGxhcmdlVmFsdWUgPT0gXCdsYXJnZVwnfSIgbmctbW9kZWw9Im1vZGVsVmFsdWUiJyArIGh0bWwgKyAnIGF0dC10b2dnbGUtdGVtcGxhdGUnICsgYXR0clZhbCArICc+JyArIGVsZW1lbnQucHJvcCgnb3V0ZXJIVE1MJykgKyAnPC9kaXY+Jyk7ICAgICAgICAgICAgICAgICAgICAgICAgZWxtID0gJGNvbXBpbGUoZWxtKShzY29wZSk7CisgICAgICAgICAgICAgICAgICAgICAgICBlbGVtZW50LnJlcGxhY2VXaXRoKGVsbSk7CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICB9OworICAgICAgICAgICAgfV0KKyAgICAgICAgICAgICAgICApOworYW5ndWxhci5tb2R1bGUoJ2F0dC5hYnMudG9vbHRpcCcsIFsnYXR0LmFicy5wb3NpdGlvbicsICdhdHQuYWJzLnV0aWxpdGllcycsICduZ1Nhbml0aXplJ10pCisgICAgICAgIAorICAgICAgICAvLyBUaGUgZGVmYXVsdCBvcHRpb25zIHRvb2x0aXAgYW5kIHBvcG92ZXIuCisgICAgICAgIC5jb25zdGFudCgndG9vbHRpcERlZmF1bHRPcHRpb25zJywgeworICAgICAgICAgICAgcGxhY2VtZW50OiAnYWJvdmUnLAorICAgICAgICAgICAgYW5pbWF0aW9uOiBmYWxzZSwKKyAgICAgICAgICAgIHBvcHVwRGVsYXk6IDAsCisgICAgICAgICAgICBzdHlsZXR0OiAnZGFyaycsCisgICAgICAgICAgICBhcHBlbmRUb0JvZHk6IHRydWUKKyAgICAgICAgfSkKKyAgICAgICAgCisgICAgICAgIC8qKgorICAgICAgICAgKiBUaGUgJHRvb2x0aXAgc2VydmljZSBjcmVhdGVzIHRvb2x0aXAtIGFuZCBwb3BvdmVyLWxpa2UgZGlyZWN0aXZlcyBhcyB3ZWxsIGFzCisgICAgICAgICAqIGhvdXNlcyBnbG9iYWwgb3B0aW9ucyBmb3IgdGhlbS4KKyAgICAgICAgICovCisgICAgICAgIC5wcm92aWRlcignJHRvb2x0aXAnLCBbJ3Rvb2x0aXBEZWZhdWx0T3B0aW9ucycsIGZ1bmN0aW9uKHRvb2x0aXBEZWZhdWx0T3B0aW9ucykgeworCisgICAgICAgICAgICAvLyBEZWZhdWx0IGhpZGUgdHJpZ2dlcnMgZm9yIGVhY2ggc2hvdyB0cmlnZ2VyCisgICAgICAgICAgICB2YXIgdHJpZ2dlck1hcCA9IHsKKyAgICAgICAgICAgICAgICAnbW91c2VlbnRlcic6ICdtb3VzZWxlYXZlJywKKyAgICAgICAgICAgICAgICAnY2xpY2snOiAnY2xpY2snLAorICAgICAgICAgICAgICAgICdmb2N1cyc6ICdibHVyJywKKyAgICAgICAgICAgICAgICAnbW91c2VvdmVyJzonbW91c2VvdXQnCisgICAgICAgICAgICB9OworCisgICAgICAgICAgICAvLyBUaGUgb3B0aW9ucyBzcGVjaWZpZWQgdG8gdGhlIHByb3ZpZGVyIGdsb2JhbGx5LgorICAgICAgICAgICAgdmFyIGdsb2JhbE9wdGlvbnMgPSB7fTsKKworICAgICAgICAgICAgdGhpcy5vcHRpb25zID0gZnVuY3Rpb24odmFsdWUpIHsKKyAgICAgICAgICAgICAgICBhbmd1bGFyLmV4dGVuZChnbG9iYWxPcHRpb25zLCB2YWx1ZSk7CisgICAgICAgICAgICB9OworCisgICAgICAgICAgICAvKioKKyAgICAgICAgICAgICAqIFRoaXMgYWxsb3dzIHlvdSB0byBleHRlbmQgdGhlIHNldCBvZiB0cmlnZ2VyIG1hcHBpbmdzIGF2YWlsYWJsZS4gRS5nLjoKKyAgICAgICAgICAgICAqCisgICAgICAgICAgICAgKiAgICR0b29sdGlwUHJvdmlkZXIuc2V0VHJpZ2dlcnMoICdvcGVuVHJpZ2dlcic6ICdjbG9zZVRyaWdnZXInICk7CisgICAgICAgICAgICAgKi8KKyAgICAgICAgICAgIHRoaXMuc2V0VHJpZ2dlcnMgPSBmdW5jdGlvbiBzZXRUcmlnZ2Vycyh0cmlnZ2VycykgeworICAgICAgICAgICAgICAgIGFuZ3VsYXIuZXh0ZW5kKHRyaWdnZXJNYXAsIHRyaWdnZXJzKTsKKyAgICAgICAgICAgIH07CisKKyAgICAgICAgICAgIC8qKgorICAgICAgICAgICAgICogVGhpcyBpcyBhIGhlbHBlciBmdW5jdGlvbiBmb3IgdHJhbnNsYXRpbmcgY2FtZWwtY2FzZSB0byBzbmFrZS1jYXNlLgorICAgICAgICAgICAgICovCisgICAgICAgICAgICBmdW5jdGlvbiBzbmFrZV9jYXNlKG5hbWUpIHsKKyAgICAgICAgICAgICAgICB2YXIgcmVnZXhwID0gL1tBLVpdL2c7CisgICAgICAgICAgICAgICAgdmFyIHNlcGFyYXRvciA9ICctJzsKKyAgICAgICAgICAgICAgICByZXR1cm4gbmFtZS5yZXBsYWNlKHJlZ2V4cCwgZnVuY3Rpb24obGV0dGVyLCBwb3MpIHsKKyAgICAgICAgICAgICAgICAgICAgcmV0dXJuIChwb3MgPyBzZXBhcmF0b3IgOiAnJykgKyBsZXR0ZXIudG9Mb3dlckNhc2UoKTsKKyAgICAgICAgICAgICAgICB9KTsKKyAgICAgICAgICAgIH0KKworICAgICAgICAgICAgLyoqCisgICAgICAgICAgICAgKiBSZXR1cm5zIHRoZSBhY3R1YWwgaW5zdGFuY2Ugb2YgdGhlICR0b29sdGlwIHNlcnZpY2UuCisgICAgICAgICAgICAgKi8KKyAgICAgICAgICAgIHRoaXMuJGdldCA9IFsnJHdpbmRvdycsICckY29tcGlsZScsICckdGltZW91dCcsICckcGFyc2UnLCAnJGRvY3VtZW50JywgJyRwb3NpdGlvbicsICckaW50ZXJwb2xhdGUnLCBmdW5jdGlvbigkd2luZG93LCAkY29tcGlsZSwgJHRpbWVvdXQsICRwYXJzZSwgJGRvY3VtZW50LCAkcG9zaXRpb24sICRpbnRlcnBvbGF0ZSkgeworICAgICAgICAgICAgICAgICAgICByZXR1cm4gZnVuY3Rpb24gJHRvb2x0aXAodHlwZSwgcHJlZml4LCBkZWZhdWx0VHJpZ2dlclNob3cpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIHZhciBvcHRpb25zID0gYW5ndWxhci5leHRlbmQoe30sIHRvb2x0aXBEZWZhdWx0T3B0aW9ucywgZ2xvYmFsT3B0aW9ucyk7CisgICAgICAgICAgICAgICAgICAgICAgICAKKyAgICAgICAgICAgICAgICAgICAgICAgIC8qKgorICAgICAgICAgICAgICAgICAgICAgICAgICogUmV0dXJucyBhbiBvYmplY3Qgb2Ygc2hvdyBhbmQgaGlkZSB0cmlnZ2Vycy4KKyAgICAgICAgICAgICAgICAgICAgICAgICAqCisgICAgICAgICAgICAgICAgICAgICAgICAgKiBJZiBhIHRyaWdnZXIgaXMgc3VwcGxpZWQsCisgICAgICAgICAgICAgICAgICAgICAgICAgKiBpdCBpcyB1c2VkIHRvIHNob3cgdGhlIHRvb2x0aXA7IG90aGVyd2lzZSwgaXQgd2lsbCB1c2UgdGhlIGB0cmlnZ2VyYAorICAgICAgICAgICAgICAgICAgICAgICAgICogb3B0aW9uIHBhc3NlZCB0byB0aGUgYCR0b29sdGlwUHJvdmlkZXIub3B0aW9uc2AgbWV0aG9kOyBlbHNlIGl0IHdpbGwKKyAgICAgICAgICAgICAgICAgICAgICAgICAqIGRlZmF1bHQgdG8gdGhlIHRyaWdnZXIgc3VwcGxpZWQgdG8gdGhpcyBkaXJlY3RpdmUgZmFjdG9yeS4KKyAgICAgICAgICAgICAgICAgICAgICAgICAqCisgICAgICAgICAgICAgICAgICAgICAgICAgKiBUaGUgaGlkZSB0cmlnZ2VyIGlzIGJhc2VkIG9uIHRoZSBzaG93IHRyaWdnZXIuIElmIHRoZSBgdHJpZ2dlcmAgb3B0aW9uCisgICAgICAgICAgICAgICAgICAgICAgICAgKiB3YXMgcGFzc2VkIHRvIHRoZSBgJHRvb2x0aXBQcm92aWRlci5vcHRpb25zYCBtZXRob2QsIGl0IHdpbGwgdXNlIHRoZQorICAgICAgICAgICAgICAgICAgICAgICAgICogbWFwcGVkIHRyaWdnZXIgZnJvbSBgdHJpZ2dlck1hcGAgb3IgdGhlIHBhc3NlZCB0cmlnZ2VyIGlmIHRoZSBtYXAgaXMKKyAgICAgICAgICAgICAgICAgICAgICAgICAqIHVuZGVmaW5lZDsgb3RoZXJ3aXNlLCBpdCB1c2VzIHRoZSBgdHJpZ2dlck1hcGAgdmFsdWUgb2YgdGhlIHNob3cKKyAgICAgICAgICAgICAgICAgICAgICAgICAqIHRyaWdnZXI7IGVsc2UgaXQgd2lsbCBqdXN0IHVzZSB0aGUgc2hvdyB0cmlnZ2VyLgorICAgICAgICAgICAgICAgICAgICAgICAgICovCisgICAgICAgICAgICAgICAgICAgICAgICBmdW5jdGlvbiBnZXRUcmlnZ2Vycyh0cmlnZ2VyKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFyIHNob3cgPSB0cmlnZ2VyIHx8IG9wdGlvbnMudHJpZ2dlciB8fCBkZWZhdWx0VHJpZ2dlclNob3c7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFyIGhpZGUgPSB0cmlnZ2VyTWFwW3Nob3ddIHx8IHNob3c7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2hvdzogc2hvdywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaGlkZTogaGlkZQorICAgICAgICAgICAgICAgICAgICAgICAgICAgIH07CisgICAgICAgICAgICAgICAgICAgICAgICB9CisKKyAgICAgICAgICAgICAgICAgICAgICAgIHZhciBkaXJlY3RpdmVOYW1lID0gc25ha2VfY2FzZSh0eXBlKTsKKworICAgICAgICAgICAgICAgICAgICAgICAgdmFyIHN0YXJ0U3ltID0gJGludGVycG9sYXRlLnN0YXJ0U3ltYm9sKCk7CisgICAgICAgICAgICAgICAgICAgICAgICB2YXIgZW5kU3ltID0gJGludGVycG9sYXRlLmVuZFN5bWJvbCgpOworICAgICAgICAgICAgICAgICAgICAgICAgdmFyIHRlbXBsYXRlID0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJzxkaXYgJyArIGRpcmVjdGl2ZU5hbWUgKyAnLXBvcHVwICcgKworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAndGl0bGU9IicgKyBzdGFydFN5bSArICd0dF90aXRsZScgKyBlbmRTeW0gKyAnIiAnICsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJ2NvbnRlbnQ9IicgKyBzdGFydFN5bSArICd0dF9jb250ZW50JyArIGVuZFN5bSArICciICcgKworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAncGxhY2VtZW50PSInICsgc3RhcnRTeW0gKyAndHRfcGxhY2VtZW50JyArIGVuZFN5bSArICciICcgKworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAnYW5pbWF0aW9uPSJ0dF9hbmltYXRpb24oKSIgJyArCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICdpcy1vcGVuPSJ0dF9pc09wZW4iICcgKworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAnc3R5bGV0dD0iJyArIHN0YXJ0U3ltICsgJ3R0X3N0eWxlJyArIGVuZFN5bSArICciICcgKworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAnPicgKworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAnPC9kaXY+JzsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKKyAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmVzdHJpY3Q6ICdFQScsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2NvcGU6IHRydWUsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgbGluazogZnVuY3Rpb24gbGluayhzY29wZSwgZWxlbWVudCwgYXR0cnMpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGVsZW1lbnQuYXR0cigidGFiaW5kZXgiLCAiMCIpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBlbGVtZW50LmJpbmQoJ21vdXNlZW50ZXInLCBmdW5jdGlvbigpeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZWxlbWVudC5yZW1vdmVBdHRyKCJ0aXRsZSIpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9KTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZWxlbWVudC5iaW5kKCdtb3VzZWxlYXZlJywgZnVuY3Rpb24oKXsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGVsZW1lbnQuYXR0cigidGl0bGUiLCBzY29wZS50dF9jb250ZW50KTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YXIgdG9vbHRpcCA9ICRjb21waWxlKHRlbXBsYXRlKShzY29wZSk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhciB0cmFuc2l0aW9uVGltZW91dDsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFyIHBvcHVwVGltZW91dDsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFyICRib2R5OworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YXIgYXBwZW5kVG9Cb2R5ID0gYW5ndWxhci5pc0RlZmluZWQob3B0aW9ucy5hcHBlbmRUb0JvZHkpID8gb3B0aW9ucy5hcHBlbmRUb0JvZHkgOiBmYWxzZTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFyIHRyaWdnZXJzID0gZ2V0VHJpZ2dlcnModW5kZWZpbmVkKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFyIGhhc1JlZ2lzdGVyZWRUcmlnZ2VycyA9IGZhbHNlOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YXIgaGFzRW5hYmxlRXhwID0gYW5ndWxhci5pc0RlZmluZWQoYXR0cnNbcHJlZml4ICsgJ0VuYWJsZSddKTsKKworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyBCeSBkZWZhdWx0LCB0aGUgdG9vbHRpcCBpcyBub3Qgb3Blbi4KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gVE9ETyBhZGQgYWJpbGl0eSB0byBzdGFydCB0b29sdGlwIG9wZW5lZAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzY29wZS50dF9pc09wZW4gPSBmYWxzZTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vQWRkaW5nIGEgc2NvcGUgd2F0Y2gsIHRvIHJlbW92ZSB0aGUgY3JlYXRlZCBwb3B1cCBmcm9tIERPTSwgaW5jYXNlIGl0IGlzIHVwZGF0ZWQgb3V0c2lkZSB0aGUgcHJvdmlkZXIgY29kZS4KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2NvcGUuJHdhdGNoKCd0dF9pc09wZW4nLCBmdW5jdGlvbihuZXdWYWwsIG9sZFZhbCl7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZihuZXdWYWwgIT09IG9sZFZhbCl7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiggbmV3VmFsID09PSBmYWxzZSApeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vIHJlbW92ZSBjb2RlCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdG9vbHRpcC5yZW1vdmUoKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSk7CisKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZnVuY3Rpb24gdG9nZ2xlVG9vbHRpcEJpbmQoKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoIXNjb3BlLnR0X2lzT3BlbikgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNob3dUb29sdGlwQmluZCgpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBoaWRlVG9vbHRpcEJpbmQoKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQorCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vIFNob3cgdGhlIHRvb2x0aXAgd2l0aCBkZWxheSBpZiBzcGVjaWZpZWQsIG90aGVyd2lzZSBzaG93IGl0IGltbWVkaWF0ZWx5CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZ1bmN0aW9uIHNob3dUb29sdGlwQmluZCgpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRvb2x0aXAgPSAkY29tcGlsZSh0ZW1wbGF0ZSkoc2NvcGUpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2NvcGUuJGRpZ2VzdCgpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGhhc0VuYWJsZUV4cCAmJiAhc2NvcGUuJGV2YWwoYXR0cnNbcHJlZml4ICsgJ0VuYWJsZSddKSkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybjsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChzY29wZS50dF9wb3B1cERlbGF5KSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcG9wdXBUaW1lb3V0ID0gJHRpbWVvdXQoc2hvdywgc2NvcGUudHRfcG9wdXBEZWxheSk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNjb3BlLiRhcHBseShzaG93KTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQorCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZ1bmN0aW9uIGhpZGVUb29sdGlwQmluZCgpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNjb3BlLiRhcHBseShmdW5jdGlvbigpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBoaWRlKCk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9KTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQorCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vIFNob3cgdGhlIHRvb2x0aXAgcG9wdXAgZWxlbWVudC4KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZnVuY3Rpb24gc2hvdygpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhciBwb3NpdGlvbiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdHRXaWR0aCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdHRIZWlnaHQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHR0UG9zaXRpb247CisKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vIERvbid0IHNob3cgZW1wdHkgdG9vbHRpcHMuCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoIXNjb3BlLnR0X2NvbnRlbnQpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm47CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CisKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vIElmIHRoZXJlIGlzIGEgcGVuZGluZyByZW1vdmUgdHJhbnNpdGlvbiwgd2UgbXVzdCBjYW5jZWwgaXQsIGxlc3QgdGhlCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyB0b29sdGlwIGJlIG15c3RlcmlvdXNseSByZW1vdmVkLgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHRyYW5zaXRpb25UaW1lb3V0KSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJHRpbWVvdXQuY2FuY2VsKHRyYW5zaXRpb25UaW1lb3V0KTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KKworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gU2V0IHRoZSBpbml0aWFsIHBvc2l0aW9uaW5nLgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdG9vbHRpcC5jc3Moe3RvcDogMCwgbGVmdDogMCwgZGlzcGxheTogJ2Jsb2NrJywgJ3otaW5kZXgnOiA5OTk5fSk7CisKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vIE5vdyB3ZSBhZGQgaXQgdG8gdGhlIERPTSBiZWNhdXNlIG5lZWQgc29tZSBpbmZvIGFib3V0IGl0LiBCdXQgaXQncyBub3QgCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyB2aXNpYmxlIHlldCBhbnl3YXkuCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChhcHBlbmRUb0JvZHkpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAkYm9keSA9ICRib2R5IHx8ICRkb2N1bWVudC5maW5kKCdib2R5Jyk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJGJvZHkuYXBwZW5kKHRvb2x0aXApOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBlbGVtZW50LmFmdGVyKHRvb2x0aXApOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQorCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyBHZXQgdGhlIHBvc2l0aW9uIG9mIHRoZSBkaXJlY3RpdmUgZWxlbWVudC4KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBvc2l0aW9uID0gYXBwZW5kVG9Cb2R5ID8gJHBvc2l0aW9uLm9mZnNldChlbGVtZW50KSA6ICRwb3NpdGlvbi5wb3NpdGlvbihlbGVtZW50KTsKKy8vICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYWxlcnQoSlNPTi5zdHJpbmdpZnkocG9zaXRpb24pKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gR2V0IHRoZSBoZWlnaHQgYW5kIHdpZHRoIG9mIHRoZSB0b29sdGlwIHNvIHdlIGNhbiBjZW50ZXIgaXQuCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0dFdpZHRoID0gdG9vbHRpcC5wcm9wKCdvZmZzZXRXaWR0aCcpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdHRIZWlnaHQgPSB0b29sdGlwLnByb3AoJ29mZnNldEhlaWdodCcpOworCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyBDYWxjdWxhdGUgdGhlIHRvb2x0aXAncyB0b3AgYW5kIGxlZnQgY29vcmRpbmF0ZXMgdG8gY2VudGVyIGl0IHdpdGgKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vIHRoaXMgZGlyZWN0aXZlLgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFyIHR0QXJyb3dPZmZzZXQgPSAxMDsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc3dpdGNoIChzY29wZS50dF9wbGFjZW1lbnQpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjYXNlICdyaWdodCc6CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmKGFwcGVuZFRvQm9keSl7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0dFBvc2l0aW9uID0geworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRvcDogcG9zaXRpb24udG9wICsgcG9zaXRpb24uaGVpZ2h0IC8gMiAtIHR0SGVpZ2h0IC8gMiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBsZWZ0OiBwb3NpdGlvbi5sZWZ0ICsgcG9zaXRpb24ud2lkdGgKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH07CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1lbHNleworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdHRQb3NpdGlvbiA9IHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0b3A6IHBvc2l0aW9uLnRvcCArIHBvc2l0aW9uLmhlaWdodCAvIDIgLSB0dEhlaWdodCAvIDIsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbGVmdDogcG9zaXRpb24ubGVmdCArIHBvc2l0aW9uLndpZHRoICsgdHRBcnJvd09mZnNldAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjYXNlICdiZWxvdyc6CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmKGFwcGVuZFRvQm9keSl7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0dFBvc2l0aW9uID0geworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRvcDogcG9zaXRpb24udG9wICsgcG9zaXRpb24uaGVpZ2h0LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxlZnQ6IHBvc2l0aW9uLmxlZnQgKyBwb3NpdGlvbi53aWR0aCAvIDIgLSB0dFdpZHRoIC8gMgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfWVsc2V7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0dFBvc2l0aW9uID0geworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRvcDogcG9zaXRpb24udG9wICsgcG9zaXRpb24uaGVpZ2h0ICsgdHRBcnJvd09mZnNldCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBsZWZ0OiBwb3NpdGlvbi5sZWZ0ICsgcG9zaXRpb24ud2lkdGggLyAyIC0gdHRXaWR0aCAvIDIKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH07CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY2FzZSAnbGVmdCc6CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmKGFwcGVuZFRvQm9keSl7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0dFBvc2l0aW9uID0geworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRvcDogcG9zaXRpb24udG9wICsgcG9zaXRpb24uaGVpZ2h0IC8gMiAtIHR0SGVpZ2h0IC8gMiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBsZWZ0OiBwb3NpdGlvbi5sZWZ0IC0gdHRXaWR0aAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfWVsc2V7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0dFBvc2l0aW9uID0geworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRvcDogcG9zaXRpb24udG9wICsgcG9zaXRpb24uaGVpZ2h0IC8gMiAtIHR0SGVpZ2h0IC8gMiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBsZWZ0OiBwb3NpdGlvbi5sZWZ0IC0gdHRXaWR0aCAtIHR0QXJyb3dPZmZzZXQKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH07CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZGVmYXVsdDoKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYoYXBwZW5kVG9Cb2R5KXsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHR0UG9zaXRpb24gPSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdG9wOiBwb3NpdGlvbi50b3AgLSB0dEhlaWdodCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBsZWZ0OiBwb3NpdGlvbi5sZWZ0ICsgcG9zaXRpb24ud2lkdGggLyAyIC0gdHRXaWR0aCAvIDIKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH07CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1lbHNleworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdHRQb3NpdGlvbiA9IHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0b3A6IHBvc2l0aW9uLnRvcCAtIHR0SGVpZ2h0IC0gdHRBcnJvd09mZnNldCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBsZWZ0OiBwb3NpdGlvbi5sZWZ0ICsgcG9zaXRpb24ud2lkdGggLyAyIC0gdHRXaWR0aCAvIDIKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH07CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CisKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHR0UG9zaXRpb24udG9wICs9ICdweCc7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0dFBvc2l0aW9uLmxlZnQgKz0gJ3B4JzsKKworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gTm93IHNldCB0aGUgY2FsY3VsYXRlZCBwb3NpdGlvbmluZy4KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRvb2x0aXAuY3NzKHR0UG9zaXRpb24pOworCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyBBbmQgc2hvdyB0aGUgdG9vbHRpcC4KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNjb3BlLnR0X2lzT3BlbiA9IHRydWU7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KKworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyBIaWRlIHRoZSB0b29sdGlwIHBvcHVwIGVsZW1lbnQuCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZ1bmN0aW9uIGhpZGUoKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyBGaXJzdCB0aGluZ3MgZmlyc3Q6IHdlIGRvbid0IHNob3cgaXQgYW55bW9yZS4KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNjb3BlLnR0X2lzT3BlbiA9IGZhbHNlOworCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvL2lmIHRvb2x0aXAgaXMgZ29pbmcgdG8gYmUgc2hvd24gYWZ0ZXIgZGVsYXksIHdlIG11c3QgY2FuY2VsIHRoaXMKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICR0aW1lb3V0LmNhbmNlbChwb3B1cFRpbWVvdXQpOworCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyBBbmQgbm93IHdlIHJlbW92ZSBpdCBmcm9tIHRoZSBET00uIEhvd2V2ZXIsIGlmIHdlIGhhdmUgYW5pbWF0aW9uLCB3ZSAKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vIG5lZWQgdG8gd2FpdCBmb3IgaXQgdG8gZXhwaXJlIGJlZm9yZWhhbmQuCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyBGSVhNRTogdGhpcyBpcyBhIHBsYWNlaG9sZGVyIGZvciBhIHBvcnQgb2YgdGhlIHRyYW5zaXRpb25zIGxpYnJhcnkuCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoYW5ndWxhci5pc0RlZmluZWQoc2NvcGUudHRfYW5pbWF0aW9uKSAmJiBzY29wZS50dF9hbmltYXRpb24oKSkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRyYW5zaXRpb25UaW1lb3V0ID0gJHRpbWVvdXQoZnVuY3Rpb24oKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRvb2x0aXAucmVtb3ZlKCk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSwgNTAwKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdG9vbHRpcC5yZW1vdmUoKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQorCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8qKgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKiBPYnNlcnZlIHRoZSByZWxldmFudCBhdHRyaWJ1dGVzLgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYXR0cnMuJG9ic2VydmUodHlwZSwgZnVuY3Rpb24odmFsKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAodmFsKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2NvcGUudHRfY29udGVudCA9IHZhbDsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBlbGVtZW50LmF0dHIoJ3RpdGxlJyx2YWwpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoc2NvcGUudHRfaXNPcGVuKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGhpZGUoKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0pOworCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGF0dHJzLiRvYnNlcnZlKHByZWZpeCArICdUaXRsZScsIGZ1bmN0aW9uKHZhbCkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2NvcGUudHRfdGl0bGUgPSB2YWw7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0pOworCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGF0dHJzLiRvYnNlcnZlKHByZWZpeCArICdQbGFjZW1lbnQnLCBmdW5jdGlvbih2YWwpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNjb3BlLnR0X3BsYWNlbWVudCA9IGFuZ3VsYXIuaXNEZWZpbmVkKHZhbCkgPyB2YWwgOiBvcHRpb25zLnBsYWNlbWVudDsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBhdHRycy4kb2JzZXJ2ZShwcmVmaXggKyAnU3R5bGUnLCBmdW5jdGlvbih2YWwpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNjb3BlLnR0X3N0eWxlID0gYW5ndWxhci5pc0RlZmluZWQodmFsKSA/IHZhbCA6IG9wdGlvbnMuc3R5bGV0dDsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSk7CisKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYXR0cnMuJG9ic2VydmUocHJlZml4ICsgJ0FuaW1hdGlvbicsIGZ1bmN0aW9uKHZhbCkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2NvcGUudHRfYW5pbWF0aW9uID0gYW5ndWxhci5pc0RlZmluZWQodmFsKSA/ICRwYXJzZSh2YWwpIDogZnVuY3Rpb24oKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIG9wdGlvbnMuYW5pbWF0aW9uOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSk7CisKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYXR0cnMuJG9ic2VydmUocHJlZml4ICsgJ1BvcHVwRGVsYXknLCBmdW5jdGlvbih2YWwpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhciBkZWxheSA9IHBhcnNlSW50KHZhbCwgMTApOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2NvcGUudHRfcG9wdXBEZWxheSA9ICFpc05hTihkZWxheSkgPyBkZWxheSA6IG9wdGlvbnMucG9wdXBEZWxheTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSk7CisKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYXR0cnMuJG9ic2VydmUocHJlZml4ICsgJ1RyaWdnZXInLCBmdW5jdGlvbih2YWwpIHsKKworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGhhc1JlZ2lzdGVyZWRUcmlnZ2VycykgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGVsZW1lbnQudW5iaW5kKHRyaWdnZXJzLnNob3csIHNob3dUb29sdGlwQmluZCk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZWxlbWVudC51bmJpbmQodHJpZ2dlcnMuaGlkZSwgaGlkZVRvb2x0aXBCaW5kKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KKworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdHJpZ2dlcnMgPSBnZXRUcmlnZ2Vycyh2YWwpOworCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAodHJpZ2dlcnMuc2hvdyA9PT0gdHJpZ2dlcnMuaGlkZSkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGVsZW1lbnQuYmluZCh0cmlnZ2Vycy5zaG93LCB0b2dnbGVUb29sdGlwQmluZCk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGVsZW1lbnQuYmluZCh0cmlnZ2Vycy5zaG93LCBzaG93VG9vbHRpcEJpbmQpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGVsZW1lbnQuYmluZCh0cmlnZ2Vycy5oaWRlLCBoaWRlVG9vbHRpcEJpbmQpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQorCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBoYXNSZWdpc3RlcmVkVHJpZ2dlcnMgPSB0cnVlOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9KTsKKworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBhdHRycy4kb2JzZXJ2ZShwcmVmaXggKyAnQXBwZW5kVG9Cb2R5JywgZnVuY3Rpb24odmFsKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBhcHBlbmRUb0JvZHkgPSBhbmd1bGFyLmlzRGVmaW5lZCh2YWwpID8gJHBhcnNlKHZhbCkoc2NvcGUpIDogYXBwZW5kVG9Cb2R5OworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9KTsKKworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyBpZiBhIHRvb2x0aXAgaXMgYXR0YWNoZWQgdG8gPGJvZHk+IHdlIG5lZWQgdG8gcmVtb3ZlIGl0IG9uCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vIGxvY2F0aW9uIGNoYW5nZSBhcyBpdHMgcGFyZW50IHNjb3BlIHdpbGwgcHJvYmFibHkgbm90IGJlIGRlc3Ryb3llZAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyBieSB0aGUgY2hhbmdlLgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoYXBwZW5kVG9Cb2R5KSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzY29wZS4kb24oJyRsb2NhdGlvbkNoYW5nZVN1Y2Nlc3MnLCBmdW5jdGlvbiBjbG9zZVRvb2x0aXBPbkxvY2F0aW9uQ2hhbmdlU3VjY2VzcygpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoc2NvcGUudHRfaXNPcGVuKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGhpZGUoKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9KTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQorCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vIE1ha2Ugc3VyZSB0b29sdGlwIGlzIGRlc3Ryb3llZCBhbmQgcmVtb3ZlZC4KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2NvcGUuJG9uKCckZGVzdHJveScsIGZ1bmN0aW9uIG9uRGVzdHJveVRvb2x0aXAoKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoc2NvcGUudHRfaXNPcGVuKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaGlkZSgpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0b29sdGlwLnJlbW92ZSgpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9KTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICB9OworICAgICAgICAgICAgICAgICAgICB9OworICAgICAgICAgICAgICAgIH1dOworICAgICAgICB9XSkKKworICAgICAgICAuZGlyZWN0aXZlKCd0b29sdGlwUG9wdXAnLCBbJyRkb2N1bWVudCcsICckZG9jdW1lbnRCaW5kJywgZnVuY3Rpb24oJGRvY3VtZW50LCAkZG9jdW1lbnRCaW5kKSB7CisgICAgICAgICAgICByZXR1cm4geworICAgICAgICAgICAgICAgIHJlc3RyaWN0OiAnRUEnLAorICAgICAgICAgICAgICAgIHJlcGxhY2U6IHRydWUsCisgICAgICAgICAgICAgICAgdHJhbnNjbHVkZTogdHJ1ZSwKKyAgICAgICAgICAgICAgICBzY29wZToge2NvbnRlbnQ6ICdAJywgcGxhY2VtZW50OiAnQCcsIGFuaW1hdGlvbjogJyYnLCBpc09wZW46ICc9Jywgc3R5bGV0dDogJ0AnfSwKKyAgICAgICAgICAgICAgICB0ZW1wbGF0ZVVybDogJ2FwcC9zY3JpcHRzL25nX2pzX2F0dF90cGxzL3Rvb2x0aXAvdG9vbHRpcC1wb3B1cC5odG1sJywKKyAgICAgICAgICAgICAgICBsaW5rOiBmdW5jdGlvbihzY29wZSwgZWxlbSwgYXR0ciwgY3RybCkgeworICAgICAgICAgICAgICAgICAgICB2YXIgZmxhZyA9IGZhbHNlOworICAgICAgICAgICAgICAgICAgICAKKyAgICAgICAgICAgICAgICAgICAgc2NvcGUuJHdhdGNoKCJpc09wZW4iLCBmdW5jdGlvbih2YWx1ZSkgeworICAgICAgICAgICAgICAgICAgICAgICAgZmxhZyA9IHNjb3BlLmlzT3BlbjsKKyAgICAgICAgICAgICAgICAgICAgfSk7CisgICAgICAgICAgICAgICAgICAgIAorICAgICAgICAgICAgICAgICAgICBlbGVtLmJpbmQoJ2NsaWNrJywgZnVuY3Rpb24gKGUpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIGUuc3RvcFByb3BhZ2F0aW9uKCk7CisgICAgICAgICAgICAgICAgICAgIH0pOworICAgICAgICAgICAgICAgICAgICAKKyAgICAgICAgICAgICAgICAgICAgdmFyIG91dHNpZGVDbGljayA9IGZ1bmN0aW9uKGUpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIGlmICghZmxhZykgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNjb3BlLiRhcHBseShmdW5jdGlvbigpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2NvcGUuaXNPcGVuID0gZmFsc2U7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSk7CisgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICBmbGFnID0gZmFsc2U7CisgICAgICAgICAgICAgICAgICAgIH07CisKKyAgICAgICAgICAgICAgICAgICAgJGRvY3VtZW50QmluZC5jbGljaygnaXNPcGVuJywgb3V0c2lkZUNsaWNrLCBzY29wZSk7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfTsKKyAgICAgICAgfV0pCisgICAgCisgICAgICAgIC5kaXJlY3RpdmUoJ3Rvb2x0aXAnLCBbJyR0b29sdGlwJywgZnVuY3Rpb24oJHRvb2x0aXApIHsKKyAgICAgICAgICAgIHJldHVybiAkdG9vbHRpcCgndG9vbHRpcCcsICd0b29sdGlwJywgJ21vdXNlZW50ZXInKTsKKyAgICAgICAgfV0pCisgICAgICAgIAorICAgICAgICAuZGlyZWN0aXZlKCd0b29sdGlwQ29uZGl0aW9uJywgWyAnJHRpbWVvdXQnLGZ1bmN0aW9uKCR0aW1lb3V0KSB7CisgICAgICAgICAgICAgICAgcmV0dXJuICB7CisgICAgICAgICAgICAgICAgICAgIHJlc3RyaWN0OiAnRUEnLAorICAgICAgICAgICAgICAgICAgICByZXBsYWNlOiB0cnVlLCAgICAgICAgICAgICAgCisgICAgICAgICAgICAgICAgICAgIHNjb3BlOnsKKyAgICAgICAgICAgICAgICAgICAgICAgIHRvb2x0aXBDb25kaXRpb246IkA/IgorICAgICAgICAgICAgICAgICAgICB9LAorICAgICAgICAgICAgICAgICAgICB0ZW1wbGF0ZTonPHA+PHNwYW4gdG9vbHRpcD1cInt7dG9vbHRpcENvbmRpdGlvbn19XCIgbmctaWY9XCJzaG93cG9wXCI+e3t0b29sdGlwQ29uZGl0aW9ufX08L3NwYW4+PHNwYW4gaWQ9XCJpbm5lckVsZW1lbnRcIiBuZy1oaWRlPVwic2hvd3BvcFwiPnt7dG9vbHRpcENvbmRpdGlvbn19PC9zcGFuPjwvcD4nLAorICAgICAgICAgICAgICAgICAgICBsaW5rOiBmdW5jdGlvbihzY29wZSwgZWxlbSwgYXR0cil7CisgICAgICAgICAgICAgICAgICAgICAgICBzY29wZS5zaG93cG9wPWZhbHNlOworICAgICAgICAgICAgICAgICAgICAgICAgaWYoYXR0ci5oZWlnaHQ9PT0ndHJ1ZScpeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICR0aW1lb3V0KGZ1bmN0aW9uICgpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFyIG1heEhlaWdodD0oZWxlbVswXS5vZmZzZXRIZWlnaHQpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhciBlbGVtSGVpZ2h0PWVsZW0uY2hpbGRyZW4oMClbMF0ub2Zmc2V0SGVpZ2h0OworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmKGVsZW1IZWlnaHQgPiBtYXhIZWlnaHQpeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzY29wZS5zaG93cG9wPXRydWU7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0sMTAwMCk7CisgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICBlbHNlIGlmKHNjb3BlLnRvb2x0aXBDb25kaXRpb24ubGVuZ3RoPj0yNSl7CisgICAgICAgICAgICAgICAgICAgICAgICBzY29wZS5zaG93cG9wPXRydWU7CisgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgCisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICB9OyAgICAgICAgICAgIAorICAgICAgICB9XSk7CisKK2FuZ3VsYXIubW9kdWxlKCdhdHQuYWJzLnRyZWV2aWV3JywgW10pCisgICAgICAgIC5kaXJlY3RpdmUoJ3RyZWVWaWV3JywgZnVuY3Rpb24oKSB7CisgICAgICAgICAgICByZXR1cm57CisgICAgICAgICAgICAgICAgcmVzdHJpY3Q6ICdBJywKKyAgICAgICAgICAgICAgICBsaW5rOiBmdW5jdGlvbihzY29wZSwgZWxlbSwgYXR0cnMpIHsKKyAgICAgICAgICAgICAgICAgICAgdmFyIGVsID0gZWxlbS5jaGlsZHJlbigndWwgbGknKTsKKyAgICAgICAgICAgICAgICAgICAgdmFyIGxpc3QgPSBUd2Vlbk1heC5mcm9tKGVsLCAuMiwge2Rpc3BsYXk6ICdub25lJywgcGF1c2VkOiB0cnVlLCByZXZlcnNlZDogdHJ1ZX0pOworCQkJCQllbGVtLmF0dHIoInRhYmluZGV4IiwiMCIpOwkJCQkJCQkJCQorICAgICAgICAgICAgICAgICAgICBmdW5jdGlvbiB0b2dnbGVCcmFuY2goKSB7CisgICAgICAgICAgICAgICAgICAgICAgICBpZiAobGlzdC5yZXZlcnNlZCgpKQorICAgICAgICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxpc3QucGxheSgpOworICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlCisgICAgICAgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgbGlzdC5yZXZlcnNlKCk7CisgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgIH07CisJCQkJCWZ1bmN0aW9uIHRvZ2dsZVRyZWUoZSl7CisJCQkJCWUuc3RvcFByb3BhZ2F0aW9uKCk7CisJCQkJCQlpZiAoJChlLnRhcmdldCkuYXR0cigidHJlZS12aWV3IikgIT09IHVuZGVmaW5lZCkKKyAgICAgICAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoZWxlbS5oYXNDbGFzcygnbWludXMnKSkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGVsZW0ucmVtb3ZlQ2xhc3MoJ21pbnVzJyk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGVsZW0uYWRkQ2xhc3MoJ21pbnVzJyk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRvZ2dsZUJyYW5jaCgpOworICAgICAgICAgICAgICAgICAgICAgICAgfQorCQkJCQl9CisgICAgICAgICAgICAgICAgICAgIGVsZW0ub24oJ2NsaWNrJywgZnVuY3Rpb24oZSkgeworCQkJCQkJdG9nZ2xlVHJlZShlKTsKKyAgICAgICAgICAgICAgICAgICAgfSk7CisJCQkJCWVsZW0ub24oJ2tleXByZXNzJywgZnVuY3Rpb24gKGUpIHsJCQkJCQkKKwkJCQkJCXZhciBhY3RpdmVDb2RlID0gZS5rZXlDb2RlID8gZS5rZXlDb2RlIDogZS5jaGFyQ29kZTsJCQkJCisJCQkJCQl2YXIga2V5Q29kZSA9IFsxMywzMl07CisJCQkJCQlpZihrZXlDb2RlLmxlbmd0aCA+IDAgJiYgKChhY3RpdmVDb2RlICYmIGtleUNvZGUuaW5kZXhPZihhY3RpdmVDb2RlKSA+IC0xKSkpIHsJCQkJCQkKKwkJCQkJCQl0b2dnbGVUcmVlKGUpOwkJCQkJCQkKKwkJCQkJCQllLnByZXZlbnREZWZhdWx0KCk7CisJCQkJCQl9CisJCQkJCX0pOwkJCQkJCisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfTsKKyAgICAgICAgfSk7CisKK2FuZ3VsYXIubW9kdWxlKCdhdHQuYWJzLnR5cGVBaGVhZCcsIFsnYXR0LmFicy50YWdCYWRnZXMnXSkKKworICAgICAgICAuZGlyZWN0aXZlKCdmb2N1c01lJyxbJyR0aW1lb3V0JywgJyRwYXJzZScsIGZ1bmN0aW9uKCR0aW1lb3V0LCAkcGFyc2UpIHsKKyAgICAgICAgICAgIHJldHVybiB7CisgICAgICAgICAgICAgICAgbGluazogZnVuY3Rpb24oc2NvcGUsIGVsZW1lbnQsIGF0dHJzKSB7CisgICAgICAgICAgICAgICAgICAgIHZhciBtb2RlbCA9ICRwYXJzZShhdHRycy5mb2N1c01lKTsKKyAgICAgICAgICAgICAgICAgICAgCisgICAgICAgICAgICAgICAgICAgIHNjb3BlLiR3YXRjaChtb2RlbCwgZnVuY3Rpb24odmFsdWUpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIGlmICh2YWx1ZSA9PT0gdHJ1ZSkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICR0aW1lb3V0KGZ1bmN0aW9uKCkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBlbGVtZW50WzBdLmZvY3VzKCk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNjb3BlLmlucHV0QWN0aXZlPXRydWU7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSk7CisgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgIH0pOworICAgICAgICAgICAgICAgICAgICAKKyAgICAgICAgICAgICAgICAgICAgZWxlbWVudC5iaW5kKCdibHVyJywgZnVuY3Rpb24oKSB7CisgICAgICAgICAgICAgICAgICAgICAgICBzY29wZS4kYXBwbHkobW9kZWwuYXNzaWduKHNjb3BlLCBmYWxzZSkpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzY29wZS5pbnB1dEFjdGl2ZT1mYWxzZTsKKyAgICAgICAgICAgICAgICAgICAgfSk7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfTsKKyAgICAgICAgfV0pCisKKyAgICAgICAgLmRpcmVjdGl2ZSgndHlwZUFoZWFkJywgWyckdGltZW91dCcsIGZ1bmN0aW9uKCR0aW1lb3V0KSB7CisgICAgICAgICAgICAgICAgcmV0dXJuIHsKKyAgICAgICAgICAgICAgICAgICAgcmVzdHJpY3Q6ICdFQScsCisgICAgICAgICAgICAgICAgICAgIHRlbXBsYXRlVXJsOiAnYXBwL3NjcmlwdHMvbmdfanNfYXR0X3RwbHMvdHlwZUFoZWFkL3R5cGVBaGVhZC5odG1sJywKKyAgICAgICAgICAgICAgICAgICAgcmVwbGFjZTogdHJ1ZSwKKyAgICAgICAgICAgICAgICAgICAgc2NvcGU6IHsKKyAgICAgICAgICAgICAgICAgICAgICAgIGl0ZW1zOiAnPScsCisgICAgICAgICAgICAgICAgICAgICAgICB0aXRsZTogJ0AnLAorICAgICAgICAgICAgICAgICAgICAgICAgc3VidGl0bGU6ICdAJywKKyAgICAgICAgICAgICAgICAgICAgICAgIG1vZGVsOiAnPScsCisgICAgICAgICAgICAgICAgICAgICAgICBlbWFpbElkTGlzdDonPScsCisgICAgICAgICAgICAgICAgICAgICAgICBlbWFpbE1lc3NhZ2U6Jz0nCisgICAgICAgICAgICAgICAgICAgIH0sCisgICAgICAgICAgICAgICAgICAgIGxpbms6IGZ1bmN0aW9uKHNjb3BlLCBlbGVtLCBhdHRycykgeworICAgICAgICAgICAgICAgICAgICAgICAgc2NvcGUubGluZUl0ZW1zID0gW107CisgICAgICAgICAgICAgICAgICAgICAgICBzY29wZS5maWx0ZXJlZExpc3RMZW5ndGggPSAtMTsKKyAgICAgICAgICAgICAgICAgICAgICAgIHNjb3BlLmZpbHRlcmVkTGlzdCA9IFtdOworICAgICAgICAgICAgICAgICAgICAgICAgc2NvcGUuaW5wdXRmb2N1cyA9IGZhbHNlOworCisgICAgICAgICAgICAgICAgICAgICAgICBzY29wZS5zZXRGb2N1cyA9IGZ1bmN0aW9uKCkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNjb3BlLmNsaWNrRm9jdXMgPSB0cnVlOworICAgICAgICAgICAgICAgICAgICAgICAgfTsKKyAgICAgICAgICAgICAgICAgICAgICAgCisgICAgICAgICAgICAgICAgICAgICAgICBzY29wZS5oYW5kbGVTZWxlY3Rpb24gPSBmdW5jdGlvbihzZWxlY3RlZEl0ZW0sZW1haWxJdGVtKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2NvcGUubGluZUl0ZW1zLnB1c2goc2VsZWN0ZWRJdGVtKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBzY29wZS5lbWFpbElkTGlzdC5wdXNoKGVtYWlsSXRlbSk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2NvcGUubW9kZWwgPSAiIjsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBzY29wZS5jdXJyZW50ID0gMDsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBzY29wZS5zZWxlY3RlZCA9IHRydWU7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2NvcGUuY2xpY2tGb2N1cyA9IHRydWU7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAKKyAgICAgICAgICAgICAgICAgICAgICAgIH07CisgICAgICAgICAgICAgICAgICAgICAgICAgCisgICAgICAgICAgICAgICAgICAgICAgICBzY29wZS50aGVNZXRob2RUb0JlQ2FsbGVkID0gZnVuY3Rpb24oaW5kZXgpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YXIgdGVtcEFyciA9IHNjb3BlLmxpbmVJdGVtcy5zbGljZSgpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNjb3BlLmVtYWlsSWRMaXN0LnNwbGljZShpbmRleCwgMSk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgdGVtcEFyci5zcGxpY2UoaW5kZXgsIDEpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICR0aW1lb3V0KGZ1bmN0aW9uKCkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzY29wZS5saW5lSXRlbXMgPSBbXTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2NvcGUuJGFwcGx5KCk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNjb3BlLmxpbmVJdGVtcyA9IHNjb3BlLmxpbmVJdGVtcy5jb25jYXQodGVtcEFycik7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAKKyAgICAgICAgICAgICAgICAgICAgICAgIH07CisKKyAgICAgICAgICAgICAgICAgICAgICAgIHNjb3BlLmN1cnJlbnQgPSAwOworICAgICAgICAgICAgICAgICAgICAgICAgc2NvcGUuc2VsZWN0ZWQgPSB0cnVlOworCisgICAgICAgICAgICAgICAgICAgICAgICBzY29wZS5pc0N1cnJlbnQgPSBmdW5jdGlvbihpbmRleCwgaXRlbU5hbWUsaXRlbUVtYWlsLGRyb3Bkb3duTGVuZ3RoKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHNjb3BlLmN1cnJlbnQgPT09IGluZGV4KSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNjb3BlLml0ZW1OYW1lID0gaXRlbU5hbWU7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNjb3BlLml0ZW1FbWFpbCA9IGl0ZW1FbWFpbDsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICAgICAKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBzY29wZS5kcm9wZG93bkxlbmd0aD1kcm9wZG93bkxlbmd0aDsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gc2NvcGUuY3VycmVudCA9PT0gaW5kZXg7CisgICAgICAgICAgICAgICAgICAgICAgICB9OworCisgICAgICAgICAgICAgICAgICAgICAgICBzY29wZS5zZXRDdXJyZW50ID0gZnVuY3Rpb24oaW5kZXgpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBzY29wZS5jdXJyZW50ID0gaW5kZXg7CisgICAgICAgICAgICAgICAgICAgICAgICB9OworCisgICAgICAgICAgICAgICAgICAgICAgICBzY29wZS5zZWxlY3Rpb25JbmRleCA9IGZ1bmN0aW9uKGV2dCkgeworCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGV2dC5rZXlDb2RlID09PSAzOCAmJiBzY29wZS5jdXJyZW50ID4gMCkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGV2dC5wcmV2ZW50RGVmYXVsdCgpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzY29wZS5jdXJyZW50ID0gc2NvcGUuY3VycmVudCAtIDE7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNjb3BlLmlzQ3VycmVudChzY29wZS5jdXJyZW50KTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKGV2dC5rZXlDb2RlID09PSA5KSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNjb3BlLnNlbGVjdGVkID0gdHJ1ZTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKGV2dC5rZXlDb2RlID09PSAxMyAmJiBzY29wZS5kcm9wZG93bkxlbmd0aCE9PXNjb3BlLml0ZW1zLmxlbmd0aCkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzY29wZS5oYW5kbGVTZWxlY3Rpb24oc2NvcGUuaXRlbU5hbWUsc2NvcGUuaXRlbUVtYWlsKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKGV2dC5rZXlDb2RlID09PSA4ICYmIHNjb3BlLm1vZGVsLmxlbmd0aCA9PT0gMCkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzY29wZS50aGVNZXRob2RUb0JlQ2FsbGVkKHNjb3BlLmxpbmVJdGVtcy5sZW5ndGggLSAxKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKGV2dC5rZXlDb2RlID09PSA0NikgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzY29wZS50aGVNZXRob2RUb0JlQ2FsbGVkKHNjb3BlLmxpbmVJdGVtcy5sZW5ndGggLSAxKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKGV2dC5rZXlDb2RlID09PSA0MCAmJiBzY29wZS5jdXJyZW50IDwgc2NvcGUuZHJvcGRvd25MZW5ndGgtMSkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBldnQucHJldmVudERlZmF1bHQoKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2NvcGUuY3VycmVudCA9IHNjb3BlLmN1cnJlbnQgKyAxOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzY29wZS5pc0N1cnJlbnQoc2NvcGUuY3VycmVudCk7IAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KKworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGVsZW1bMF0ucXVlcnlTZWxlY3RvcignLmxpc3Qtc2Nyb2xsYWJsZScp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IH0gICAKKyAgICB9OworICAgICB9CisgXSkKKyAgICAgLmRpcmVjdGl2ZSgndmVydGljYWxTdGVwdHJhY2tlclN0ZXAnLFsKKyAgICAgICAgZnVuY3Rpb24oKSB7CisgICAgICAgIHJldHVybiB7ICAgICAgICAgICAgCisgICAgICAgICAgICByZXN0cmljdDogJ0VBJywKKyAgICAgICAgICAgIHRyYW5zY2x1ZGU6IHRydWUsCisgICAgICAgICAgICByZXBsYWNlOiBmYWxzZSwKKyAgICAgICAgICAgIHNjb3BlOiB7CisgICAgICAgICAgICAgICAgdHlwZTogIj10eXBlIiwKKyAgICAgICAgICAgICAgICBpZDogIj1pZCIKKyAgICAgICAgICAgIH0sCisgICAgICAgICAgICB0ZW1wbGF0ZVVybDogJ2FwcC9zY3JpcHRzL25nX2pzX2F0dF90cGxzL3ZlcnRpY2FsU3RlcHRyYWNrZXIvdmVydGljYWwtc3RlcC10cmFja2VyLmh0bWwnLAorICAgICAgICAgICAgbGluazogZnVuY3Rpb24oc2NvcGUsIGVsZW0sIGF0dHIsIGN0cmwpIHsKKworICAgICAgICAgICAgICAgIAorICAgICAgICAgICAgfQorICAgICAgICAgfTsKKyAgICAgfQorICAgICBdKQorICAgICAKKyAgICAgICAgLmRpcmVjdGl2ZSgnYXR0QWJzTGluaycsW2Z1bmN0aW9uKCl7CisgICAgICAgICAgICAgICAgcmV0dXJueworICAgICAgICAgICAgICAgICAgICByZXN0cmljdDogJ0VBJywKKyAgICAgICAgICAgICAgICAgICAgdHJhbnNjbHVkZTogdHJ1ZSwKKyAgICAgICAgICAgICAgICAgICAgcmVwbGFjZTogZmFsc2UsICAgICAgICAgICAgICAgICAgICAKKyAgICAgICAgICAgICAgICAgICAgdGVtcGxhdGU6ICc8c3BhbiBuZy10cmFuc2NsdWRlIGNsYXNzPSJ2aWV3LWxvZyI+PC9zcGFuPicsCisgICAgICAgICAgICAgICAgICAgIGxpbms6IGZ1bmN0aW9uKHNjb3BlLCBlbGVtLCBhdHRyLCBjdHJsKSB7CisgICAgICAgICAgICAgICAgCisgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgfTsKKyAgICAgICAgfV0pCisKKworCithbmd1bGFyLm1vZHVsZSgnYXR0LmFicy52aWRlb0NvbnRyb2xzJywgW10pCisgICAgICAgIC5jb25maWcoWyckY29tcGlsZVByb3ZpZGVyJyAsIGZ1bmN0aW9uICgkY29tcGlsZVByb3ZpZGVyKSB7CisgICAgICAgICAgICAgICAgJGNvbXBpbGVQcm92aWRlci5hSHJlZlNhbml0aXphdGlvbldoaXRlbGlzdCgvXlxzKihodHRwcz98amF2YXNjcmlwdCk6Lyk7CisgICAgICAgICAgICB9XSkKKyAgICAgICAgLmRpcmVjdGl2ZSgndmlkZW9Db250cm9scycsIFtmdW5jdGlvbigpIHsKKyAgICAgICAgICAgICAgICByZXR1cm4geworICAgICAgICAgICAgICAgICAgICByZXN0cmljdDogJ0VBJywKKyAgICAgICAgICAgICAgICAgICAgcmVwbGFjZTogdHJ1ZSwKKyAgICAgICAgICAgICAgICAgICAgdHJhbnNjbHVkZTogdHJ1ZSwKKyAgICAgICAgICAgICAgICAgICAgdGVtcGxhdGVVcmw6ICdhcHAvc2NyaXB0cy9uZ19qc19hdHRfdHBscy92aWRlb0NvbnRyb2xzL3ZpZGVvQ29udHJvbHMuaHRtbCcKKyAgICAgICAgICAgICAgICB9OworICAgICAgICAgICAgfV0pCisgICAgICAgIC5kaXJlY3RpdmUoJ3Bob3RvQ29udHJvbHMnLCBbZnVuY3Rpb24oKSB7CisgICAgICAgICAgICAgICAgcmV0dXJuIHsKKyAgICAgICAgICAgICAgICAgICAgcmVzdHJpY3Q6ICdFQScsCisgICAgICAgICAgICAgICAgICAgIHJlcGxhY2U6IHRydWUsCisgICAgICAgICAgICAgICAgICAgIHRyYW5zY2x1ZGU6IHRydWUsCisgICAgICAgICAgICAgICAgICAgIHRlbXBsYXRlVXJsOiAnYXBwL3NjcmlwdHMvbmdfanNfYXR0X3RwbHMvdmlkZW9Db250cm9scy9waG90b0NvbnRyb2xzLmh0bWwnLAorICAgICAgICAgICAgICAgICAgICBzY29wZTogeworICAgICAgICAgICAgICAgICAgICAgICAgcHJldkxpbms6ICJAIiwKKyAgICAgICAgICAgICAgICAgICAgICAgIG5leHRMaW5rOiAiQCIKKyAgICAgICAgICAgICAgICAgICAgfSwKKyAgICAgICAgICAgICAgICAgICAgbGluazogZnVuY3Rpb24oc2NvcGUsIGVsZW0sIGF0dHIsIGN0cmwpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIGlmKCFhdHRyWydwcmV2TGluayddKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNjb3BlLnByZXZMaW5rID0gJ2phdmFzY3JpcHQ6dm9pZCgwKSc7CisgICAgICAgICAgICAgICAgICAgICAgICAKKyAgICAgICAgICAgICAgICAgICAgICAgIGlmKCFhdHRyWyduZXh0TGluayddKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNjb3BlLm5leHRMaW5rID0gJ2phdmFzY3JpcHQ6dm9pZCgwKSc7CisgICAgICAgICAgICAgICAgICAgICAgICAKKyAgICAgICAgICAgICAgICAgICAgICAgIHNjb3BlLmxpbmtzID0geworICAgICAgICAgICAgICAgICAgICAgICAgICAgIHByZXZMaW5rIDogc2NvcGUucHJldkxpbmssCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgbmV4dExpbmsgOiBzY29wZS5uZXh0TGluaworICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgfTsKKyAgICAgICAgICAgIH1dKTsKK2FuZ3VsYXIubW9kdWxlKCJhcHAvc2NyaXB0cy9uZ19qc19hdHRfdHBscy9hY2NvcmRpb24vYWNjb3JkaW9uLmh0bWwiLCBbXSkucnVuKFsiJHRlbXBsYXRlQ2FjaGUiLCBmdW5jdGlvbigkdGVtcGxhdGVDYWNoZSkgeworICAkdGVtcGxhdGVDYWNoZS5wdXQoImFwcC9zY3JpcHRzL25nX2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ICAgPGRpdiBjbGFzcz1cImljb25zLWxpc3RcIiBkYXRhLXNpemU9XCJtZWRpdW1cIj48aSBjbGFzcz1cImljb24tYXJyb3ctbGVmdC1jaXJjbGVcIiBuZy1jbGFzcz1cInsnZGlzYWJsZWQnOiBkaXNhYmxlUHJldn1cIj48L2k+XG4iICsKKyAgICAiICAgICAgICAgICAgICAgICAgICAgICAgPC9kaXY+PHNwYW4gY2xhc3M9XCJoaWRkZW4tc3Bva2VuXCI+UHJldmlvdXMgTW9udGg8L3NwYW4+XG4iICsKKyAgICAiICAgICAgICAgICAgICAgICAgICA8L3RoPlxuIiArCisgICAgIiAgICAgICAgICAgICAgICAgICAgPHRoIG5nLWlmPVwibW9kZSAhPT0gMVwiIGlkPVwibmV4dFwiIGFyaWEtaGlkZGVuPVwie3shZGlzYWJsZU5leHQgJiYgJ2ZhbHNlJyB8fCAndHJ1ZSd9fVwiIHRhYmluZGV4PVwie3shZGlzYWJsZU5leHQgJiYgJzAnIHx8ICctMSd9fVwiIGF0dC1hY2Nlc3NpYmlsaXR5LWNsaWNrPVwiMTMsMzJcIiBuZy1jbGljaz1cIiFkaXNhYmxlTmV4dCAmJiBtb3ZlKDEpXCI+XG4iICsKKyAgICAiICAgICAgICAgICAgICAgICAgICAgICAgPGRpdiBjbGFzcz1cImljb25zLWxpc3RcIiBkYXRhLXNpemU9XCJtZWRpdW1cIj48aSBjbGFzcz1cImljb24tYXJyb3ctcmlnaHQtY2lyY2xlXCIgbmctY2xhc3M9XCJ7J2Rpc2FibGVkJzogZGlzYWJsZU5leHR9XCI+PC9pPlxuIiArCisgICAgIiAgICAgICAgICAgICAgICAgICAgICAgIDwvZGl2PjxzcGFuIGNsYXNzPVwiaGlkZGVuLXNwb2tlblwiPk5leHQgTW9udGg8L3NwYW4+XG4iICsKKyAgICAiICAgICAgICAgICAgICAgICAgICA8L3RoPlxuIiArCisgICAgIiAgICAgICAgICAgICAgICA8L3RyPlxuIiArCisgICAgIiAgICAgICAgICAgICAgICA8dHIgbmctaWY9XCJsYWJlbHMubGVuZ3RoID4gMFwiPlxuIiArCisgICAgIiAgICAgICAgICAgICAgICAgICAgPHRoIGlkPVwie3tsYWJlbC5wb3N0fX1cIiB0YWJpbmRleD1cIi0xXCIgY2xhc3M9XCJkb3cgd2Vla2RheVwiIG5nLXJlcGVhdD1cImxhYmVsIGluIGxhYmVsc1wiPjxzcGFuPnt7bGFiZWwucHJlfX08L3NwYW4+PHNwYW4gY2xhc3M9XCJoaWRkZW4tc3Bva2VuXCI+e3tsYWJlbC5wb3N0fX08L3NwYW4+PC90aD5cbiIgKworICAgICIgICAgICAgICAgICAgICAgPC90cj5cbiIgKworICAgICIgICAgICAgICAgICA8L3RoZWFkPlxuIiArCisgICAgIiAgICAgICAgICAgIDx0Ym9keT5cbiIgKworICAgICIgICAgICAgICAgICAgICAgPHRyPlxuIiArCisgICAgIiAgICAgICAgICAgICAgICAgICAgPHRkIGlkPVwiZGF0ZXBpY2tlckJvZHlcIiBhdHQtc2Nyb2xsYmFyIGNvbHNwYW49XCJ7e2N1cnJlbnRSb3dzWzBdLmxlbmd0aH19XCIgc3R5bGU9XCJwYWRkaW5nOiAwcHg7XCI+XG4iICsKKyAgICAiICAgICAgICAgICAgICAgICAgICAgICAgPHRhYmxlIG5nLWNsYXNzPVwieyd0YWJsZS1jb25kZW5zZWQnOiBtb2RlID09PSAwLCAnbW9udGh0YWJsZS1jb25kZW5zZWQnOiBtb2RlID09PSAxfVwiIHN0eWxlPVwicGFkZGluZzogMHB4O1wiPlxuIiArCisgICAgIiAgICAgICAgICAgICAgICAgICAgICAgICAgICA8dGJvZHk+XG4iICsKKyAgICAiICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA8dHIgbmctcmVwZWF0PVwicm93IGluIGN1cnJlbnRSb3dzXCI+XG4iICsKKyAgICAiICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPHRkIGhlYWRlcnM9XCJ7e2R0LmhlYWRlcn19XCIgYXR0LWVs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iBkdC5vbGRNb250aCwgJ25leHQtbW9udGgnOiBkdC5uZXh0TW9udGgsICdkaXNhYmxlZCc6IGR0LmRpc2FibGVkLCAndG9kYXknOiBkdC50b2RheSwgJ3dlZWtlbmQnOiBkdC53ZWVrZW5kfVwiIG5nLWNsaWNrPVwiIWR0LnNlbGVjdGVkICYmICFkdC5mcm9tICYmICFkdC50byAmJiAhZHQuZGlzYWJsZWQgJiYgIWR0Lm9sZE1vbnRoICYmICFkdC5uZXh0TW9udGggJiYgc2VsZWN0KGR0LmRhdGUpXCIgYXR0LWFjY2Vzc2liaWxpdHktY2xpY2s9XCIxMywzMlwiPjxzcGFuIGFyaWEtbGFiZWw9XCJ7e2R0LmxhYmVsfX1cIiBjbGFzcz1cImRheVwiPnt7ZHQubGFiZWx9fTwvc3Bhbj48L3RkPlxuIiArCisgICAgIiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPC90cj5cbiIgKworICAgICIgICAgICAgICAgICAgICAgICAgICAgICAgICAgPC90Ym9keT5cbiIgKworICAgICIgICAgICAgICAgICAgICAgICAgICAgICA8L3RhYmxlPlxuIiArCisgICAgIiAgICAgICAgICAgICAgICAgICAgPC90ZD5cbiIgKworICAgICIgICAgICAgICAgICAgICAgPC90cj5cbiIgKworICAgICIgICAgICAgICAgICA8L3Rib2R5PlxuIiArCisgICAgIiAgICAgICAgPC90YWJsZT5cbiIgKworICAgICIgICAgPC9kaXY+XG4iICsKKyAgICAiPC91bD5cbiIgKworICAgICIiKTsKK31dKTsKKworYW5ndWxhci5tb2R1bGUoImFwcC9zY3JpcHRzL25nX2pzX2F0dF90cGxzL2RhdGVwaWNrZXIvZGF0ZXBpY2tlclBvcHVwLmh0bWwiLCBbXSkucnVuKFsiJHRlbXBsYXRlQ2FjaGUiLCBmdW5jdGlvbigkdGVtcGxhdGVDYWNoZSkgeworICAkdGVtcGxhdGVDYWNoZS5wdXQoImFwcC9zY3JpcHRzL25nX2pzX2F0dF90cGxzL2RhdGVwaWNrZX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dWUoZGF5KTtcIj5cbiIgKworICAgICIgICAgICAgICAgICAgICAgICAgICAgICAgICAgPHNwYW4gY2xhc3M9XCJzZWxlY3QyLWNob3NlbiBkcm9wRG93bk1hcmdpblJpZ2h0XCIgPnt7c2VsZWN0ZWRGcm9tT3B0aW9uW2RheV19fSA8aSBuZy1pZj1cImRheXNMaXN0W2RheV1cIiBuZy1jbGFzcz1cIkZydGltZUxpc3REYXlbZGF5XSA/ICdpY29uLWRyb3Bkb3duLXVwJyA6ICdpY29uLWRyb3Bkb3duLWRvd24nXCI+PC9pPjwvc3Bhbj5cbiIgKworICAgICIgICAgICAgICAgICAgICAgICAgICAgICA8L2E+XG4iICsKKyAgICAiICAgICAgICAgICAgICAgICAgICA8L2Rpdj4gICAgICAgICAgICAgXG4iICsKKyAgICAiICAgICAgICAgICAgICAgICAgICBcbiIgKworICAgICIgICAgICAgICAgICAgICAgICAgIDxkaXYgY2xhc3M9XCJzZWxlY3QyLWRpc3BsYXktbm9uZSBzZWxlY3QyLXdpdGgtc2VhcmNoYm94IHNlbGVjdDItZHJvcC1hY3RpdmUgc2hvdy1zZWFyY2ggcmVzdWx0RnJvbURyb3BEb3duXCIgIG5nLXNob3c9XCJGcnRpbWVMaXN0RGF5W2RheV1cIj4gICAgICAgXG4iICsKKyAgICAiICAgICAgICAgICAgICAgICAgICA8dWwgY2xhc3M9XCJzZWxlY3QyLXJlc3VsdHMgcmVzdWx0VG9wTWFyZ2luXCIgPiAgICAgICAgICAgICAgICAgICAgICAgXG4iICsKKyAgICAiICAgICAgICAgICAgICAgICAgICAgICAgPGxpIG5nLWNsaWNrPVwic2VsZWN0RnJvbURheU9wdGlvbihkYXksdGltZS52YWx1ZSk7YWRkU2VsZWN0ZWRWYWx1ZShkYXkpO1wiIG5nLXJlcGVhdD1cInRpbWUgaW4gZnJvbXRpbWVcIiAgY2xhc3M9XCJzZWxlY3QyLXJlc3VsdHMtZGVwdC0wIHNlbGVjdDItcmVzdWx0IHNlbGVjdDItcmVzdWx0LXNlbGVjdGFibGVcIj48ZGl2IGNsYXNzPVwic2VsZWN0Mi1yZXN1bHQtbGFiZWxcIiBuZy1jbGFzcz1cInsnc2VsZWN0ZWRJdGVtSW5Ecm9wRG93bic6ICh0aW1lLnZhbHVlPT1zZWxlY3RlZEZyb21PcHRpb25bZGF5XSl9XCI+PHNwYW4gPnt7dGltZS52YWx1ZX19PC9zcGFuPjwvZGl2PjwvbGk+ICAgICAgICAgICAgICAgICAgICAgICAgXG4iICsKKyAgICAiICAgICAgICAgICAgICAgICAgICA8L3VsPlxuIiArCisgICAgIiAgICAgICAgICAgICAgICAgICAgPC9kaXY+XG4iICsKKyAgICAiICAgICAgICAgICAgICAgIDwvZGl2PlxuIiArCisgICAgIiAgICAgICAgICAgICAgICBcbiIgKworICAgICIgICAgICAgICAgICAgICAgPGRpdiBjbGFzcz1cImRyb3BEb3duTWFyZ2luQm90dG9tXCI+XG4iICsKKyAgICAiICAgICAgICAgICAgICAgICAgICA8ZGl2IGNsYXNzPVwic2VsZWN0Mi1jb250YWluZXIgdG9wRHJvcERvd25XaWR0aFwiIG5nLWNsYXNzPVwieydzZWxlY3QyLWRyb3Bkb3duLW9wZW4gc2VsZWN0Mi1jb250YWluZXItYWN0aXZlJzogVG90aW1lTGlzdERheVtkYXldfVwiID5cbiIgKworICAgICIgICAgICAgICAgICAgICAgICAgICAgICA8YSBjbGFzcz1cInNlbGVjdDItY2hvaWNlIHNlbGVjdERyb3BEb3duXCIgaHJlZj1cImphdmFzY3JpcHQ6dm9pZCgwKVwiIHRhYmluZGV4PVwie3tkYXlzTGlzdFtkYXldID8gJzAnIDogJy0xJ319XCIgYXR0LWFjY2Vzc2liaWxpdHktY2xpY2s9XCIxM1wiIG5nLWNsaWNrPVwiZGF5c0xpc3RbZGF5XSAmJiBzaG93dG9EYXlEcm9wZG93bihkYXkpXCIgbmctY2xhc3M9XCJ7J3NlbGVjdDItY2hvc2VuLWRpc2FibGVkJzohZGF5c0xpc3RbZGF5XX1cIiAgbmcta2V5ZG93bj1cImRheXNMaXN0W2RheV0gJiYgc2VsZWN0VG9EYXlPcHRpb24oZGF5ICwgc2VsZWN0UHJldk5leHRWYWx1ZSgkZXZlbnQsdG90aW1lLHNlbGVjdGVkVG9PcHRpb25bZGF5XSkpO2RheXNMaXN0W2RheV0gJiYgYWRkU2VsZWN0ZWRWYWx1ZShkYXkpO1wiPlxuIiArCisgICAgIiAgICAgICAgICAgICAgICAgICAgICAgICAgICA8c3BhbiBjbGFzcz1cInNlbGVjdDItY2hvc2VuIGRyb3BEb3duTWFyZ2luUmlnaHRcIj57e3NlbGVjdGVkVG9PcHRpb25bZGF5XX19IDxpIG5nLWlmPVwiZGF5c0xpc3RbZGF5XVwiIG5nLWNsYXNzPVwiVG90aW1lTGlzdERheVtkYXldID8gJ2ljb24tZHJvcGRvd24tdXAnIDogJ2ljb24tZHJvcGRvd24tZG93bidcIiA+PC9pPjwvc3Bhbj5cbiIgKworICAgICIgICAgICAgICAgICAgICAgICAgICAgICA8L2E+XG4iICsKKyAgICAiICAgICAgICAgICAgICAgICAgICA8L2Rpdj5cbiIgKworICAgICIgICAgICAgICAgICAgICAgICAgIFxuIiArCisgICAgIiAgICAgICAgICAgICAgICAgICAgPGRpdiBjbGFzcz1cInNlbGVjdDItZGlzcGxheS1ub25lIHNlbGVjdDItd2l0aC1zZWFyY2hib3ggc2VsZWN0Mi1kcm9wLWFjdGl2ZSBzaG93LXNlYXJjaCByZXN1bHRUb0Ryb3BEb3duXCIgbmctc2hvdz1cIlRvdGltZUxpc3REYXlbZGF5XVwiPiAgICAgICBcbiIgKworICAgICIgICAgICAgICAgICAgICAgICAgIDx1bCBjbGFzcz1cInNlbGVjdDItcmVzdWx0cyByZXN1bHRUb3BNYXJnaW5cIiA+ICAgICAgICAgICAgICAgICAgICAgICBcbiIgKworICAgICIgICAgICAgICAgICAgICAgICAgICAgICA8bGkgbmctY2xpY2s9XCJzZWxlY3RUb0RheU9wdGlvbihkYXksdGltZS52YW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A+XG4iICsKKyAgICAiICAgICAgICAgICAgPHAgY2xhc3M9XCJzdGF0dXNcIj5cbiIgKworICAgICIgICAgICAgICAgICAgICAgPHNwYW4gY2xhc3M9XCJzdGF0dXMtaWNvblwiIG5nLWNsYXNzPVwieydpY29uLWdyZWVuJzpjb2xvckljb249PT0nZ3JlZW4nLCdpY29uLXJlZCc6Y29sb3JJY29uPT09J3JlZCcsJ2ljb24tYmx1ZSc6Y29sb3JJY29uPT09J2JsdWUnLCdpY29uLXllbGxvdyc6Y29sb3JJY29uPT09J3llbGxvdyd9XCI+ICAgXG4iICsKKyAgICAiICAgICAgICAgICAgICAgIDwvc3Bhbj5cbiIgKworICAgICIgICAgICAgICAgICAgICAgPHNwYW4+e3twcm9maWxlLnN0YXRlfX08c3BhbiBuZy1pZj1cImJhZGdlXCIgY2xhc3M9XCJzdGF0dXMtYmFkZ2VcIj5BZG1pbjwvc3Bhbj48L3NwYW4+XG4iICsKKyAgICAiICAgICAgICAgICAgPC9wPlxuIiArCisgICAgIiAgICAgICAgPC9kaXY+XG4iICsKKyAgICAiICAgIDwvZGl2PlxuIiArCisgICAgIiAgICA8ZGl2IGNsYXNzPVwiYm90dG9tLWJsb2NrXCI+XG4iICsKKyAgICAiICAgICAgICAgPGRpdiBjbGFzcz1cInByb2ZpbGUtZGV0YWlsc1wiPlxuIiArCisgICAgIiAgICAgICAgICAgIDxsYWJlbD5Vc2VybmFtZTwvbGFiZWw+XG4iICsKKyAgICAiICAgICAgICAgICAgPHAgYXR0LXRleHQtb3ZlcmZsb3c9XCI5MiVcIiB0b29sdGlwLWNvbmRpdGlvbj1cInt7cHJvZmlsZS51c2VyTmFtZX19XCI+e3twcm9maWxlLnVzZXJOYW1lfX08L3A+XG4iICsKKyAgICAiICAgICAgICAgICAgPGxhYmVsPkVtYWlsPC9sYWJlbD5cbiIgKworICAgICIgICAgICAgICAgICA8cCBhdHQtdGV4dC1vdmVyZmxvdz1cIjkyJVwiIHRvb2x0aXAtY29uZGl0a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lvblwiPjwvc3Bhbj48L2Rpdj5cbiIgKworICAgICIgICAgICAgICAgICAgICAgPGRpdiBjbGFzcz1cImpzbGlkZXItdmFsdWVcIiBpZD1cImpzbGlkZXItdmFsdWUtbGVmdFwiPjxzcGFuPjwvc3Bhbj57e29wdGlvbnMuZGltZW5zaW9ufX08L2Rpdj5cbiIgKworICAgICIgICAgICAgICAgICAgICAgPGRpdiBjbGFzcz1cImpzbGlkZXItdmFsdWUganNsaWRlci12YWx1ZS10b1wiPjxzcGFuPjwvc3Bhbj57e3Rvb2xUaXBEaW1lbnNpb259fTwvZGl2PlxuIiArCisgICAgIiAgICAgICAgICAgICAgICA8ZGl2IGNsYXNzPVwianNsaWRlci1zY2FsZVwiIG5nLWNsYXNzPVwieydzaG93LWRpdmlkZXJzJzogc2hvd0RpdmlkZXJzLCAnY3V0b2ZmLXNsaWRlci1kaXZpZGVycyc6aXNDdXRPZmZTbGlkZXJ9XCI+XG4iICsKKyAgICAiICAgICAgICAgICAgICAgIDwvZGl2PlxuIiArCisgICAgIiAgICAgICAgICAgICAgICA8ZGl2IGNsYXNzPVwianNsaWRlci1jdXRvZmZcIj5cbiIgKworICAgICIgICAgICAgICAgICAgICAgICAgIDxkaXYgY2xhc3M9XCJqc2xpZGVyLWxhYmVsIGpzbGlkZXItbGFiZWwtY3V0b2ZmXCI+XG4iICsKKyAgICAiICAgICAgICAgICAgICAgICAgICAgICAgPHNwYW4gbmctYmluZD1cImN1dE9mZlZhbFwiPjwvc3Bhbj5cbiIgKworICAgICIgICAgICAgICAgICAgICAgICAgIDwvZGl2PlxuIiArCisgICAgIiAgICAgICAgICAgICAgICA8L2Rpdj5cbiIgKworICAgICIgICAgICAgICAgICA8L3RkPlxuIiArCisgICAgIiAgICAgICAgPC90cj5cbiIgKworICAgICIgICAgPC90YWJsZT5cbiIgKworICAgICI8L3NwYW4+XG4iICsKKyAgICAiIik7Cit9XSk7CisKK2FuZ3VsYXIubW9kdWxlKCJhcHAvc2NyaXB0cy9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WNrZXIvc3RlcC10cmFja2VyLmh0bWwiLAorICAgICI8ZGl2IGNsYXNzPVwic3RlcHRyYWNrZXIxXCI+XG4iICsKKyAgICAiICAgIDxkaXYgY2xhc3M9XCJzdGVwdHJhY2tlci1iZ1wiPlxuIiArCisgICAgIiAgICAgICAgPGRpdiBjbGFzcz1cInN0ZXB0cmFja2VyLXRyYWNrIHNpemUtb25ldGhpcmRcIiBuZy1yZXBlYXQ9XCJzdGVwIGluIHNkYXRhXCJcbiIgKworICAgICIgICAgICAgICAgICAgbmctc3R5bGU9XCJzZXRfd2lkdGgoJGluZGV4KVwiXG4iICsKKyAgICAiICAgICAgICAgICAgIG5nLWNsYXNzPVwieydsYXN0JzpsYXN0c3RlcCgkaW5kZXgpLCdkb25lJzpkb25lc3RlcHMoJGluZGV4KSwnYWN0aXZlJzphY3RpdmVzdGVwKCRpbmRleCksICdpbmNvbXBsZXRlJzogaXNJbmNvbXBsZXRlKCRpbmRleCksICdkaXNhYmxlZCc6IGRpc2FibGVDbGlja31cIj5cbiIgKworICAgICIgICAgICAgICAgICA8ZGl2IGNsYXNzPVwiY2lyY2xlXCIgdGFiaW5kZXg9XCIwXCJcbiIgKworICAgICIgICAgICAgICAgICAgICAgIG5nLWNsaWNrPVwic3RlcGNsaWNrKCRldmVudCwgJGluZGV4KTtcIlxuIiArCisgICAgIiAgICAgICAgICAgICAgICAgYXR0LWFjY2Vzc2liaWxpdHktY2xpY2s9XCIxMywyM1wiPnt7KCRpbmRleCkgKyAxfX08c3Bhbj57e3N0ZXAudGl0bGV9fTwvc3Bhbj48L2Rpdj5cbiIgKworICAgICIgICAgICAgICAgICA8ZGl2IG5nLWlmPVwiIWxhc3RzdGVwKCRpbmRleClcIiBjbGFzcz1cInRyYWNrXCI+PC9kaXY+XG4iICsKKyAgICAiICAgICAgICA8L2Rpdj5cbiIgKworICAgICIgICAgPC9kaXY+XG4iICsKKyAgICAiPC9kaXY+XG4iICsKKyAgICAiIik7Cit9XSk7CisKK2FuZ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JheShhcnIpKSB7CisgICAgICBmb3IgKHZhciBpID0gMDsgaSA8IGFyci5sZW5ndGg7IGkrKykgeworICAgICAgICBpZiAoYW5ndWxhci5lcXVhbHMoYXJyW2ldLCBpdGVtKSkgeworICAgICAgICAgIHJldHVybiB0cnVlOworICAgICAgICB9CisgICAgICB9CisgICAgfQorICAgIHJldHVybiBmYWxzZTsKKyAgfQorCisgIC8vIGFkZAorICBmdW5jdGlvbiBhZGQoYXJyLCBpdGVtKSB7CisgICAgYXJyID0gYW5ndWxhci5pc0FycmF5KGFycikgPyBhcnIgOiBbXTsKKyAgICBmb3IgKHZhciBpID0gMDsgaSA8IGFyci5sZW5ndGg7IGkrKykgeworICAgICAgaWYgKGFuZ3VsYXIuZXF1YWxzKGFycltpXSwgaXRlbSkpIHsKKyAgICAgICAgcmV0dXJuIGFycjsKKyAgICAgIH0KKyAgICB9CisgICAgYXJyLnB1c2goaXRlbSk7CisgICAgcmV0dXJuIGFycjsKKyAgfQorCisgIC8vIHJlbW92ZQorICBmdW5jdGlvbiByZW1vdmUoYXJyLCBpdGVtKSB7CisgICAgaWYgKGFuZ3VsYXIuaXNBcnJheShhcnIpKSB7CisgICAgICBmb3IgKHZhciBpID0gMDsgaSA8IGFyci5sZW5ndGg7IGkrKykgeworICAgICAgICBpZiAoYW5ndWxhci5lcXVhbHMoYXJyW2ldLCBpdGVtKSkgeworICAgICAgICAgIGFyci5zcGxpY2UoaSwgMSk7CisgICAgICAgICAgYnJlYWs7CisgICAgICAgIH0KKyAgICAgIH0KKyAgICB9CisgICAgcmV0dXJuIGFycjsKKyAgfQorCisgIC8vIGh0dHA6Ly9zdGFja292ZXJmbG93LmNvbS9hLzE5MjI4MzAyLzE0NTgxNjIKKyAgZnVuY3Rpb24gcG9zdExpbmtGbihzY29wZSwgZWxlbSwgYXR0cnMpIHsKKyAgICAvLyBjb21waWxlIHdpdGggYG5nLW1vZGVsYCBwb2ludGluZyB0byBgY2hlY2tlZGAKKyAgICAkY29tcGlsZ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ZFTlRfU1RBUlQsIGZ1bmN0aW9uKGV2KSB7CisgICAgICAgIGlmKHNlbGYuZW5hYmxlZCkgeworICAgICAgICAgICAgSGFtbWVyLmRldGVjdGlvbi5zdGFydERldGVjdChzZWxmLCBldik7CisgICAgICAgIH0KKyAgICB9KTsKKworICAgIC8vIHJldHVybiBpbnN0YW5jZQorICAgIHJldHVybiB0aGlzOworfTsKKworCitIYW1tZXIuSW5zdGFuY2UucHJvdG90eXBlID0geworICAgIC8qKgorICAgICAqIGJpbmQgZXZlbnRzIHRvIHRoZSBpbnN0YW5jZQorICAgICAqIEBwYXJhbSAgIHtTdHJpbmd9ICAgICAgZ2VzdHVyZQorICAgICAqIEBwYXJhbSAgIHtGdW5jdGlvbn0gICAgaGFuZGxlcgorICAgICAqIEByZXR1cm5zIHtIYW1tZXIuSW5zdGFuY2V9CisgICAgICovCisgICAgb246IGZ1bmN0aW9uIG9uRXZlbnQoZ2VzdHVyZSwgaGFuZGxlcil7CisgICAgICAgIHZhciBnZXN0dXJlcyA9IGdlc3R1cmUuc3BsaXQoJyAnKTsKKyAgICAgICAgZm9yKHZhciB0PTA7IHQ8Z2VzdHVyZXMubGVuZ3RoOyB0KyspIHsKKyAgICAgICAgICAgIHRoaXMuZWxlbWVudC5hZGRFdmVudExpc3RlbmVyKGdlc3R1cmVzW3RdLCBoYW5kbGVyLCBmYWxzZSk7CisgICAgICAgIH0KKyAgICAgICAgcmV0dXJuIHRoaXM7CisgICAgfSwKKworCisgICAgLyoqCisgICAgICogdW5iaW5kIGV2ZW50cyB0byB0aGUgaW5zdGFuY2UKKyAgICAgKiBAcGFyYW0gICB7U3RyaW5nfSAgICAgIGdlc3R1cmUKKyAgICAgKiBAcGFyYW0gICB7RnVuY3Rpb259ICAgIGhhbmRsZXIKKyAgICAgKiBAcmV0dXJucyB7SGFtbWVyLkluc3RhbmNlfQorICAgICAqLworICAgIG9mZjogZnVuY3Rpb24gb2ZmRXZlbnQoZ2VzdHVyZSwgaGFuZGxlcil7CisgICAgICAgIHZhciBnZXN0dXJlcyA9IGdlc3R1cmUuc3BsaXQoJyAnKTsKKyAgICAgICAgZm9yKHZhciB0PTA7IHQ8Z2VzdHVyZXMubGVuZ3RoOyB0KyspIHsKKyAgICAgICAgICAgIHRoaXMuZWxlbWVudC5yZW1vdmVFdmVudExpc3RlbmVyKGdlc3R1cmVzW3RdLCBoYW5kbGVyLCBmYWxzZSk7CisgICAgICAgIH0KKyAgICAgICAgcmV0dXJuIHRoaXM7CisgICAgfSwKKworCisgICAgLyoqCisgICAgICogdHJpZ2dlciBnZXN0dXJlIGV2ZW50CisgICAgICogQHBhcmFtICAge1N0cmluZ30gICAgICBnZXN0dXJlCisgICAgICogQHBhcmFtICAge09iamVjdH0gICAgICBldmVudERhdGEKKyAgICAgKiBAcmV0dXJucyB7SGFtbWVyLkluc3RhbmNlfQorICAgICAqLworICAgIHRyaWdnZXI6IGZ1bmN0aW9uIHRyaWdnZXJFdmVudChnZXN0dXJlLCBldmVudERhdGEpeworICAgICAgICAvLyBjcmVhdGUgRE9NIGV2ZW50CisgICAgICAgIHZhciBldmVudCA9IEhhbW1lci5ET0NVTUVOVC5jcmVhdGVFdmVudCgnRXZlbnQnKTsKKwkJZXZlbnQuaW5pdEV2ZW50KGdlc3R1cmUsIHRydWUsIHRydWUpOworCQlldmVudC5nZXN0dXJlID0gZXZlbnREYXRhOworCisgICAgICAgIC8vIHRyaWdnZXIgb24gdGhlIHRhcmdldCBpZiBpdCBpcyBpbiB0aGUgaW5zdGFuY2UgZWxlbWVudCwKKyAgICAgICAgLy8gdGhpcyBpcyBmb3IgZXZlbnQgZGVsZWdhdGlvbiB0cmlja3MKKyAgICAgICAgdmFyIGVsZW1lbnQgPSB0aGlzLmVsZW1lbnQ7CisgICAgICAgIGlmKEhhbW1lci51dGlscy5oYXNQYXJlbnQoZXZlbnREYXRhLnRhcmdldCwgZWxlbWVudCkpIHsKKyAgICAgICAgICAgIGVsZW1lbnQgPSBldmVudERhdGEudGFyZ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aGlzIGlzIGZvciB0b3VjaGRldmljZXMgd2hpY2ggYWxzbyBmaXJlIGEgbW91c2V1cCBvbiB0b3VjaGVuZAorICAgICAgICAgICAgaWYoc291cmNlRXZlbnRUeXBlLm1hdGNoKC9tb3VzZS8pICYmIHRvdWNoX3RyaWdnZXJlZCkgeworICAgICAgICAgICAgICAgIHJldHVybjsKKyAgICAgICAgICAgIH0KKworICAgICAgICAgICAgLy8gbW91c2VidXR0b24gbXVzdCBiZSBkb3duIG9yIGEgdG91Y2ggZXZlbnQKKyAgICAgICAgICAgIGVsc2UgaWYoIHNvdXJjZUV2ZW50VHlwZS5tYXRjaCgvdG91Y2gvKSB8fCAgIC8vIHRvdWNoIGV2ZW50cyBhcmUgYWx3YXlzIG9uIHNjcmVlbgorICAgICAgICAgICAgICAgIHNvdXJjZUV2ZW50VHlwZS5tYXRjaCgvcG9pbnRlcmRvd24vKSB8fCAvLyBwb2ludGVyZXZlbnRzIHRvdWNoCisgICAgICAgICAgICAgICAgKHNvdXJjZUV2ZW50VHlwZS5tYXRjaCgvbW91c2UvKSAmJiBldi53aGljaCA9PT0gMSkgICAvLyBtb3VzZSBpcyBwcmVzc2VkCisgICAgICAgICAgICApeworICAgICAgICAgICAgICAgIGVuYWJsZV9kZXRlY3QgPSB0cnVlOworICAgICAgICAgICAgfQorCisgICAgICAgICAgICAvLyB3ZSBhcmUgaW4gYSB0b3VjaCBldmVudCwgc2V0IHRoZSB0b3VjaCB0cmlnZ2VyZWQgYm9vbCB0byB0cnVlLAorICAgICAgICAgICAgLy8gdGhpcyBmb3IgdGhlIGNvbmZsaWN0cyB0aGF0IG1heSBvY2N1ciBvbiBpb3MgYW5kIGFuZHJvaWQKKyAgICAgICAgICAgIGlmKHNvdXJjZUV2ZW50VHlwZS5tYXRjaCgvdG91Y2h8cG9pbnRlci8pKSB7CisgICAgICAgICAgICAgICAgdG91Y2hfdHJpZ2dlcmVkID0gdHJ1ZTsKKyAgICAgICAgICAgIH0KKworICAgICAgICAgICAgLy8gY291bnQgdGhlIHRvdGFsIHRvdWNoZXMgb24gdGhlIHNjcmVlbgorICAgICAgICAgICAgdmFyIGNvdW50X3RvdWNoZXMgPSAwOworCisgICAgICAgICAgICAvLyB3aGVuIHRvdWNoIGhhcyBiZWVuIHRyaWdnZXJlZCBpbiB0aGlzIGRldGVjdGlvbiBzZXNzaW9uCisgICAgICAgICAgICAvLyBhbmQgd2UgYXJlIG5vdyBoYW5kbGluZyBhIG1vdXNlIGV2ZW50LCB3ZSBzdG9wIHRoYXQgdG8gcHJldmVudCBjb25mbGljdHMKKyAgICAgICAgICAgIGlmKGVuYWJsZV9kZXRlY3QpIHsKKyAgICAgICAgICAgICAgICAvLyB1cGRhdGUgcG9pbnRlcmV2ZW50CisgICAgICAgICAgICAgICAgaWYoSGFtbWVyLkhBU19QT0lOVEVSRVZFTlRTICYmIGV2ZW50VHlwZSAhPSBIYW1tZXIuRVZFTlRfRU5EKSB7CisgICAgICAgICAgICAgICAgICAgIGNvdW50X3RvdWNoZXMgPSBIYW1tZXIuUG9pbnRlckV2ZW50LnVwZGF0ZVBvaW50ZXIoZXZlbnRUeXBlLCBldik7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIC8vIHRvdWNoCisgICAgICAgICAgICAgICAgZWxzZSBpZihzb3VyY2VFdmVudFR5cGUubWF0Y2goL3RvdWNoLykpIHsKKyAgICAgICAgICAgICAgICAgICAgY291bnRfdG91Y2hlcyA9IGV2LnRvdWNoZXMubGVuZ3RoOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAvLyBtb3VzZQorICAgICAgICAgICAgICAgIGVsc2UgaWYoIXRvdWNoX3RyaWdnZXJlZCkgeworICAgICAgICAgICAgICAgICAgICBjb3VudF90b3VjaGVzID0gc291cmNlRXZlbnRUeXBlLm1hdGNoKC91cC8pID8gMCA6IDE7CisgICAgICAgICAgICAgICAgfQorCisgICAgICAgICAgICAgICAgLy8gaWYgd2UgYXJlIGluIGEgZW5kIGV2ZW50LCBidXQgd2hlbiB3ZSByZW1vdmUgb25lIHRvdWNoIGFuZAorICAgICAgICAgICAgICAgIC8vIHdlIHN0aWxsIGhhdmUgZW5vdWdoLCBzZXQgZXZlbnRUeXBlIHRvIG1vdmUKKyAgICAgICAgICAgICAgICBpZihjb3VudF90b3VjaGVzID4gMCAmJiBldmVudFR5cGUgPT0gSGFtbWVyLkVWRU5UX0VORCkgeworICAgICAgICAgICAgICAgICAgICBldmVudFR5cGUgPSBIYW1tZXIuRVZFTlRfTU9WRTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgLy8gbm8gdG91Y2hlcywgZm9yY2UgdGhlIGVuZCBldmVudAorICAgICAgICAgICAgICAgIGVsc2UgaWYoIWNvdW50X3RvdWNoZXMpIHsKKyAgICAgICAgICAgICAgICAgICAgZXZlbnRUeXBlID0gSGFtbWVyLkVWRU5UX0VORDsKKyAgICAgICAgICAgICAgICB9CisKKyAgICAgICAgICAgICAgICAvLyBiZWNhdXNlIHRvdWNoZW5kIGhhcyBubyB0b3VjaGVzLCBhbmQgd2Ugb2Z0ZW4gd2FudCB0byB1c2UgdGhlc2UgaW4gb3VyIGdlc3R1cmVzLAorICAgICAgICAgICAgICAgIC8vIHdlIHNlbmQgdGhlIGxhc3QgbW92ZSBldmVudCBhcyBvdXIgZXZlbnREYXRhIGluIHRvdWNoZW5kCisgICAgICAgICAgICAgICAgaWYoIWNvdW50X3RvdWNoZXMgJiYgbGFzdF9tb3ZlX2V2ZW50ICE9PSBudWxsKSB7CisgICAgICAgICAgICAgICAgICAgIGV2ID0gbGFzdF9tb3ZlX2V2ZW50OworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAvLyBzdG9yZSB0aGUgbGFzdCBtb3ZlIGV2ZW50CisgICAgICAgICAgICAgICAgZWxzZSB7CisgICAgICAgICAgICAgICAgICAgIGxhc3RfbW92ZV9ldmVudCA9IGV2OworICAgICAgICAgICAgICAgIH0KKworICAgICAgICAgICAgICAgIC8vIHRyaWdnZXIgdGhlIGhhbmRsZXIKKyAgICAgICAgICAgICAgICBoYW5kbGVyLmNhbGwoSGFtbWVyLmRldGVjdGlvbiwgc2VsZi5jb2xsZWN0RXZlbnREYXRhKGVsZW1lbnQsIGV2ZW50VHlwZSwgZXYpKTsKKworICAgICAgICAgICAgICAgIC8vIHJlbW92ZSBwb2ludGVyZXZlbnQgZnJvbSBsaXN0CisgICAgICAgICAgICAgICAgaWYoSGFtbWVyLkhBU19QT0lOVEVSRVZFTlRTICYmIGV2ZW50VHlwZSA9PSBIYW1tZXIuRVZFTlRfRU5EKSB7CisgICAgICAgICAgICAgICAgICAgIGNvdW50X3RvdWNoZXMgPSBIYW1tZXIuUG9pbnRlckV2ZW50LnVwZGF0ZVBvaW50ZXIoZXZlbnRUeXBlLCBldik7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfQorCisgICAgICAgICAgICAvL2RlYnVnKHNvdXJjZUV2ZW50VHlwZSArIiAiKyBldmVudFR5cGUpOworCisgICAgICAgICAgICAvLyBvbiB0aGUgZW5kIHdlIHJlc2V0IGV2ZXJ5dGhpbmcKKyAgICAgICAgICAgIGlmKCFjb3VudF90b3VjaGVzKSB7CisgICAgICAgICAgICAgICAgbGFzdF9tb3ZlX2V2ZW50ID0gbnVsbDsKKyAgICAgICAgICAgICAgICBlbmFibGVfZGV0ZWN0ID0gZmFsc2U7CisgICAgICAgICAgICAgICAgdG91Y2hfdHJpZ2dlcmVkID0gZmFsc2U7CisgICAgICAgICAgICAgICAgSGFtbWVyLlBvaW50ZXJFdmVudC5yZXNldCgpOworICAgICAgICAgICAgfQorICAgICAgICB9KTsKKyAgICB9LAorCisKKyAgICAvKioKKyAgICAgKiB3ZSBoYXZlIGRpZmZlcmVudCBldmVudHMgZm9yIGVhY2ggZGV2aWNlL2Jyb3dzZXIKKyAgICAgKiBkZXRlcm1pbmUgd2hhdCB3ZSBuZWVkIGFuZCBzZXQgdGhlbSBpbiB0aGUgSGFtbWVyLkVWRU5UX1RZUEVTIGNvbnN0YW50CisgICAgICovCisgICAgZGV0ZXJtaW5lRXZlbnRUeXBlczogZnVuY3Rpb24gZGV0ZXJtaW5lRXZlbnRUeXBlcygpIHsKKyAgICAgICAgLy8gZGV0ZXJtaW5lIHRoZSBldmVudHR5cGUgd2Ugd2FudCB0byBzZXQKKyAgICAgICAgdmFyIHR5cGVzOworCisgICAgICAgIC8vIHBvaW50ZXJFdmVudHMgbWFnaWMKKyAgICAgICAgaWYoSGFtbWVyLkhBU19QT0lOVEVSRVZFTlRTKSB7CisgICAgICAgICAgICB0eXBlcyA9IEhhbW1lci5Qb2ludGVyRXZlbnQuZ2V0RXZlbnRzKCk7CisgICAgICAgIH0KKyAgICAgICAgLy8gb24gQW5kcm9pZCwgaU9TLCBibGFja2JlcnJ5LCB3aW5kb3dzIG1vYmlsZSB3ZSBkb250IHdhbnQgYW55IG1vdXNlZXZlbnRzCisgICAgICAgIGVsc2UgaWYoSGFtbWVyLk5PX01PVVNFRVZFTlRTKSB7CisgICAgICAgICAgICB0eXBlcyA9IFsKKyAgICAgICAgICAgICAgICAndG91Y2hzdGFydCcsCisgICAgICAgICAgICAgICAgJ3RvdWNobW92ZScsCisgICAgICAgICAgICAgICAgJ3RvdWNoZW5kIHRvdWNoY2FuY2VsJ107CisgICAgICAgIH0KKyAgICAgICAgLy8gZm9yIG5vbiBwb2ludGVyIGV2ZW50cyBicm93c2VycyBhbmQgbWl4ZWQgYnJvd3NlcnMsCisgICAgICAgIC8vIGxpa2UgY2hyb21lIG9uIHdpbmRvd3M4IHRvdWNoIGxhcHRvcAorICAgICAgICBlbHNlIHsKKyAgICAgICAgICAgIHR5cGVzID0gWworICAgICAgICAgICAgICAgICd0b3VjaHN0YXJ0IG1vdXNlZG93bicsCisgICAgICAgICAgICAgICAgJ3RvdWNobW92ZSBtb3VzZW1vdmUnLAorICAgICAgICAgICAgICAgICd0b3VjaGVuZCB0b3VjaGNhbmNlbCBtb3VzZXVwJ107CisgICAgICAgIH0KKworICAgICAgICBIYW1tZXIuRVZFTlRfVFlQRVNbSGFtbWVyLkVWRU5UX1NUQVJUXSAgPSB0eXBlc1swXTsKKyAgICAgICAgSGFtbWVyLkVWRU5UX1RZUEVTW0hhbW1lci5FVkVOVF9NT1ZFXSAgID0gdHlwZXNbMV07CisgICAgICAgIEhhbW1lci5FVkVOVF9UWVBFU1tIYW1tZXIuRVZFTlRfRU5EXSAgICA9IHR5cGVzWzJdOworICAgIH0sCisKKworICAgIC8qKgorICAgICAqIGNyZWF0ZSB0b3VjaGxpc3QgZGVwZW5kaW5nIG9uIHRoZSBldmVudAorICAgICAqIEBwYXJhbSAgIHtPYmplY3R9ICAgIGV2CisgICAgICogQHBhcmFtICAge1N0cmluZ30gICAgZXZlbnRUeXBlICAgdXNlZCBieSB0aGUgZmFrZW11bHRpdG91Y2ggcGx1Z2luCisgICAgICovCisgICAgZ2V0VG91Y2hMaXN0OiBmdW5jdGlvbiBnZXRUb3VjaExpc3QoZXYvKiwgZXZlbnRUeXBlKi8pIHsKKyAgICAgICAgLy8gZ2V0IHRoZSBmYWtlIHBvaW50ZXJFdmVudCB0b3VjaGxpc3QKKyAgICAgICAgaWYoSGFtbWVyLkhBU19QT0lOVEVSRVZFTlRTKSB7CisgICAgICAgICAgICByZXR1cm4gSGFtbWVyLlBvaW50ZXJFdmVudC5nZXRUb3VjaExpc3QoKTsKKyAgICAgICAgfQorICAgICAgICAvLyBnZXQgdGhlIHRvdWNobGlzdAorICAgICAgICBlbHNlIGlmKGV2LnRvdWNoZXMpIHsKKyAgICAgICAgICAgIHJldHVybiBldi50b3VjaGVzOworICAgICAgICB9CisgICAgICAgIC8vIG1ha2UgZmFrZSB0b3VjaGxpc3QgZnJvbSBtb3VzZSBwb3NpdGlvbgorICAgICAgICBlbHNlIHsKKyAgICAgICAgICAgIHJldHVybiBbeworICAgICAgICAgICAgICAgIGlkZW50aWZpZXI6IDEsCisgICAgICAgICAgICAgICAgcGFnZVg6IGV2LnBhZ2VYLAorICAgICAgICAgICAgICAgIHBhZ2VZOiBldi5wYWdlWSwKKyAgICAgICAgICAgICAgICB0YXJnZXQ6IGV2LnRhcmdldAorICAgICAgICAgICAgfV07CisgICAgICAgIH0KKyAgICB9LAorCisKKyAgICAvKioKKyAgICAgKiBjb2xsZWN0IGV2ZW50IGRhdGEgZm9yIEhhbW1lciBqcworICAgICAqIEBwYXJhbSAgIHtIVE1MRWxlbWVudH0gICBlbGVtZW50CisgICAgICogQHBhcmFtICAge1N0cmluZ30gICAgICAgIGV2ZW50VHlwZSAgICAgICAgbGlrZSBIYW1tZXIuRVZFTlRfTU9WRQorICAgICAqIEBwYXJhbSAgIHtPYmplY3R9ICAgICAgICBldmVudERhdGEKKyAgICAgKi8KKyAgICBjb2xsZWN0RXZlbnREYXRhOiBmdW5jdGlvbiBjb2xsZWN0RXZlbnREYXRhKGVsZW1lbnQsIGV2ZW50VHlwZSwgZXYpIHsKKyAgICAgICAgdmFyIHRvdWNoZXMgPSB0aGlzLmdldFRvdWNoTGlzdChldiwgZXZlbnRUeXBlKTsKKworICAgICAgICAvLyBmaW5kIG91dCBwb2ludGVyVHlwZQorICAgICAgICB2YXIgcG9pbnRlclR5cGUgPSBIYW1tZXIuUE9JTlRFUl9UT1VDSDsKKyAgICAgICAgaWYoZXYudHlwZS5tYXRjaCgvbW91c2UvKSB8fCBIYW1tZXIuUG9pbnRlckV2ZW50Lm1hdGNoVHlwZShIYW1tZXIuUE9JTlRFUl9NT1VTRSwgZXYpKSB7CisgICAgICAgICAgICBwb2ludGVyVHlwZSA9IEhhbW1lci5QT0lOVEVSX01PVVNFOworICAgICAgICB9CisKKyAgICAgICAgcmV0dXJuIHsKKyAgICAgICAgICAgIGNlbnRlciAgICAgIDogSGFtbWVyLnV0aWxzLmdldENlbnRlcih0b3VjaGVzKSwKKyAgICAgICAgICAgIHRpbWVTdGFtcCAgIDogbmV3IERhdGUoKS5nZXRUaW1lKCksCisgICAgICAgICAgICB0YXJnZXQgICAgICA6IGV2LnRhcmdldCwKKyAgICAgICAgICAgIHRvdWNoZXMgICAgIDogdG91Y2hlcywKKyAgICAgICAgICAgIGV2ZW50VHlwZSAgIDogZXZlbnRUeXBlLAorICAgICAgICAgICAgcG9pbnRlclR5cGUgOiBwb2ludGVyVHlwZSwKKyAgICAgICAgICAgIHNyY0V2ZW50ICAgIDogZXYsCisKKyAgICAgICAgICAgIC8qKgorICAgICAgICAgICAgICogcHJldmVudCB0aGUgYnJvd3NlciBkZWZhdWx0IGFjdGlvbnMKKyAgICAgICAgICAgICAqIG1vc3RseSB1c2VkIHRvIGRpc2FibGUgc2Nyb2xsaW5nIG9mIHRoZSBicm93c2VyCisgICAgICAgICAgICAgKi8KKyAgICAgICAgICAgIHByZXZlbnREZWZhdWx0OiBmdW5jdGlvbigpIHsKKyAgICAgICAgICAgICAgICBpZih0aGlzLnNyY0V2ZW50LnByZXZlbnRNYW5pcHVsYXRpb24pIHsKKyAgICAgICAgICAgICAgICAgICAgdGhpcy5zcmNFdmVudC5wcmV2ZW50TWFuaXB1bGF0aW9uKCk7CisgICAgICAgICAgICAgICAgfQorCisgICAgICAgICAgICAgICAgaWYodGhpcy5zcmNFdmVudC5wcmV2ZW50RGVmYXVsdCkgeworICAgICAgICAgICAgICAgICAgICB0aGlzLnNyY0V2ZW50LnByZXZlbnREZWZhdWx0KCk7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfSwKKworICAgICAgICAgICAgLyoqCisgICAgICAgICAgICAgKiBzdG9wIGJ1YmJsaW5nIHRoZSBldmVudCB1cCB0byBpdHMgcGFyZW50cworICAgICAgICAgICAgICovCisgICAgICAgICAgICBzdG9wUHJvcGFnYXRpb246IGZ1bmN0aW9uKCkgeworICAgICAgICAgICAgICAgIHRoaXMuc3JjRXZlbnQuc3RvcFByb3BhZ2F0aW9uKCk7CisgICAgICAgICAgICB9LAorCisgICAgICAgICAgICAvKioKKyAgICAgICAgICAgICAqIGltbWVkaWF0ZWx5IHN0b3AgZ2VzdHVyZSBkZXRlY3Rpb24KKyAgICAgICAgICAgICAqIG1pZ2h0IGJlIHVzZWZ1bCBhZnRlciBhIHN3aXBlIHdhcyBkZXRlY3RlZAorICAgICAgICAgICAgICogQHJldHVybiB7Kn0KKyAgICAgICAgICAgICAqLworICAgICAgICAgICAgc3RvcERldGVjdDogZnVuY3Rpb24oKSB7CisgICAgICAgICAgICAgICAgcmV0dXJuIEhhbW1lci5kZXRlY3Rpb24uc3RvcERldGVjdCgpOworICAgICAgICAgICAgfQorICAgICAgICB9OworICAgIH0KK307CisKK0hhbW1lci5Qb2ludGVyRXZlbnQgPSB7CisgICAgLyoqCisgICAgICogaG9sZHMgYWxsIHBvaW50ZXJzCisgICAgICogQHR5cGUge09iamVjdH0KKyAgICAgKi8KKyAgICBwb2ludGVyczoge30sCisKKyAgICAvKioKKyAgICAgKiBnZXQgYSBsaXN0IG9mIHBvaW50ZXJzCisgICAgICogQHJldHVybnMge0FycmF5fSAgICAgdG91Y2hsaXN0CisgICAgICovCisgICAgZ2V0VG91Y2hMaXN0OiBmdW5jdGlvbigpIHsKKyAgICAgICAgdmFyIHNlbGYgPSB0aGlzOworICAgICAgICB2YXIgdG91Y2hsaXN0ID0gW107CisKKyAgICAgICAgLy8gd2UgY2FuIHVzZSBmb3JFYWNoIHNpbmNlIHBvaW50ZXJFdmVudHMgb25seSBpcyBpbiBJRTEwCisgICAgICAgIE9iamVjdC5rZXlzKHNlbGYucG9pbnRlcnMpLnNvcnQoKS5mb3JFYWNoKGZ1bmN0aW9uKGlkKSB7CisgICAgICAgICAgICB0b3VjaGxpc3QucHVzaChzZWxmLnBvaW50ZXJzW2lkXSk7CisgICAgICAgIH0pOworICAgICAgICByZXR1cm4gdG91Y2hsaXN0OworICAgIH0sCisKKyAgICAvKioKKyAgICAgKiB1cGRhdGUgdGhlIHBvc2l0aW9uIG9mIGEgcG9pbnRlcgorICAgICAqIEBwYXJhbSAgIHtTdHJpbmd9ICAgdHlwZSAgICAgICAgICAgICBIYW1tZXIuRVZFTlRfRU5ECisgICAgICogQHBhcmFtICAge09iamVjdH0gICBwb2ludGVyRXZlbnQKKyAgICAgKi8KKyAgICB1cGRhdGVQb2ludGVyOiBmdW5jdGlvbih0eXBlLCBwb2ludGVyRXZlbnQpIHsKKyAgICAgICAgaWYodHlwZSA9PSBIYW1tZXIuRVZFTlRfRU5EKSB7CisgICAgICAgICAgICB0aGlzLnBvaW50ZXJzID0ge307CisgICAgICAgIH0KKyAgICAgICAgZWxzZSB7CisgICAgICAgICAgICBwb2ludGVyRXZlbnQuaWRlbnRpZmllciA9IHBvaW50ZXJFdmVudC5wb2ludGVySWQ7CisgICAgICAgICAgICB0aGlzLnBvaW50ZXJzW3BvaW50ZXJFdmVudC5wb2ludGVySWRdID0gcG9pbnRlckV2ZW50OworICAgICAgICB9CisKKyAgICAgICAgcmV0dXJuIE9iamVjdC5rZXlzKHRoaXMucG9pbnRlcnMpLmxlbmd0aDsKKyAgICB9LAorCisgICAgLyoqCisgICAgICogY2hlY2sgaWYgZXYgbWF0Y2hlcyBwb2ludGVydHlwZQorICAgICAqIEBwYXJhbSAgIHtTdHJpbmd9ICAgICAgICBwb2ludGVyVHlwZSAgICAgSGFtbWVyLlBPSU5URVJfTU9VU0UKKyAgICAgKiBAcGFyYW0gICB7UG9pbnRlckV2ZW50fSAgZXYKKyAgICAgKi8KKyAgICBtYXRjaFR5cGU6IGZ1bmN0aW9uKHBvaW50ZXJUeXBlLCBldikgeworICAgICAgICBpZighZXYucG9pbnRlclR5cGUpIHsKKyAgICAgICAgICAgIHJldHVybiBmYWxzZTsKKyAgICAgICAgfQorCisgICAgICAgIHZhciB0eXBlcyA9IHt9OworICAgICAgICB0eXBlc1tIYW1tZXIuUE9JTlRFUl9NT1VTRV0gPSAoZXYucG9pbnRlclR5cGUgPT0gZXYuTVNQT0lOVEVSX1RZUEVfTU9VU0UgfHwgZXYucG9pbnRlclR5cGUgPT0gSGFtbWVyLlBPSU5URVJfTU9VU0UpOworICAgICAgICB0eXBlc1tIYW1tZXIuUE9JTlRFUl9UT1VDSF0gPSAoZXYucG9pbnRlclR5cGUgPT0gZXYuTVNQT0lOVEVSX1RZUEVfVE9VQ0ggfHwgZXYucG9pbnRlclR5cGUgPT0gSGFtbWVyLlBPSU5URVJfVE9VQ0gpOworICAgICAgICB0eXBlc1tIYW1tZXIuUE9JTlRFUl9QRU5dID0gKGV2LnBvaW50ZXJUeXBlID09IGV2Lk1TUE9JTlRFUl9UWVBFX1BFTiB8fCBldi5wb2ludGVyVHlwZSA9PSBIYW1tZXIuUE9JTlRFUl9QRU4pOworICAgICAgICByZXR1cm4gdHlwZXNbcG9pbnRlclR5cGVdOworICAgIH0sCisKKworICAgIC8qKgorICAgICAqIGdldCBldmVudHMKKyAgICAgKi8KKyAgICBnZXRFdmVudHM6IGZ1bmN0aW9uKCkgeworICAgICAgICByZXR1cm4gWworICAgICAgICAgICAgJ3BvaW50ZXJkb3duIE1TUG9pbnRlckRvd24nLAorICAgICAgICAgICAgJ3BvaW50ZXJtb3ZlIE1TUG9pbnRlck1vdmUnLAorICAgICAgICAgICAgJ3BvaW50ZXJ1cCBwb2ludGVyY2FuY2VsIE1TUG9pbnRlclVwIE1TUG9pbnRlckNhbmNlbCcKKyAgICAgICAgXTsKKyAgICB9LAorCisgICAgLyoqCisgICAgICogcmVzZXQgdGhlIGxpc3QKKyAgICAgKi8KKyAgICByZXNldDogZnVuY3Rpb24oKSB7CisgICAgICAgIHRoaXMucG9pbnRlcnMgPSB7fTsKKyAgICB9Cit9OworCisKK0hhbW1lci51dGlscyA9IHsKKyAgICAvKioKKyAgICAgKiBleHRlbmQgbWV0aG9kLAorICAgICAqIGFsc28gdXNlZCBmb3IgY2xvbmluZyB3aGVuIGRlc3QgaXMgYW4gZW1wdHkgb2JqZWN0CisgICAgICogQHBhcmFtICAge09iamVjdH0gICAgZGVzdAorICAgICAqIEBwYXJhbSAgIHtPYmplY3R9ICAgIHNyYworCSAqIEBwYXJtCXtCb29sZWFufQltZXJnZQkJZG8gYSBtZXJnZQorICAgICAqIEByZXR1cm5zIHtPYmplY3R9ICAgIGRlc3QKKyAgICAgKi8KKyAgICBleHRlbmQ6IGZ1bmN0aW9uIGV4dGVuZChkZXN0LCBzcmMsIG1lcmdlKSB7CisgICAgICAgIGZvciAodmFyIGtleSBpbiBzcmMpIHsKKwkJCWlmKGRlc3Rba2V5XSAhPT0gdW5kZWZpbmVkICYmIG1lcmdlKSB7CisJCQkJY29udGludWU7CisJCQl9CisgICAgICAgICAgICBkZXN0W2tleV0gPSBzcmNba2V5XTsKKyAgICAgICAgfQorICAgICAgICByZXR1cm4gZGVzdDsKKyAgICB9LAorCisKKyAgICAvKioKKyAgICAgKiBmaW5kIGlmIGEgbm9kZSBpcyBpbiB0aGUgZ2l2ZW4gcGFyZW50CisgICAgICogdXNlZCBmb3IgZXZlbnQgZGVsZWdhdGlvbiB0cmlja3MKKyAgICAgKiBAcGFyYW0gICB7SFRNTEVsZW1lbnR9ICAgbm9kZQorICAgICAqIEBwYXJhbSAgIHtIVE1MRWxlbWVudH0gICBwYXJlbnQKKyAgICAgKiBAcmV0dXJucyB7Ym9vbGVhbn0gICAgICAgaGFzX3BhcmVudAorICAgICAqLworICAgIGhhc1BhcmVudDogZnVuY3Rpb24obm9kZSwgcGFyZW50KSB7CisgICAgICAgIHdoaWxlKG5vZGUpeworICAgICAgICAgICAgaWYobm9kZSA9PSBwYXJlbnQpIHsKKyAgICAgICAgICAgICAgICByZXR1cm4gdHJ1ZTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIG5vZGUgPSBub2RlLnBhcmVudE5vZGU7CisgICAgICAgIH0KKyAgICAgICAgcmV0dXJuIGZhbHNlOworICAgIH0sCisKKworICAgIC8qKgorICAgICAqIGdldCB0aGUgY2VudGVyIG9mIGFsbCB0aGUgdG91Y2hlcworICAgICAqIEBwYXJhbSAgIHtBcnJheX0gICAgIHRvdWNoZXMKKyAgICAgKiBAcmV0dXJucyB7T2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yBkZWx0YV90aW1lKSB8fCAwLAorICAgICAgICAgICAgeTogTWF0aC5hYnMoZGVsdGFfeSAvIGRlbHRhX3RpbWUpIHx8IDAKKyAgICAgICAgfTsKKyAgICB9LAorCisKKyAgICAvKioKKyAgICAgKiBjYWxjdWxhdGUgdGhlIGFuZ2xlIGJldHdlZW4gdHdvIGNvb3JkaW5hdGVzCisgICAgICogQHBhcmFtICAge1RvdWNofSAgICAgdG91Y2gxCisgICAgICogQHBhcmFtICAge1RvdWNofSAgICAgdG91Y2gyCisgICAgICogQHJldHVybnMge051bWJlcn0gICAgYW5nbGUKKyAgICAgKi8KKyAgICBnZXRBbmdsZTogZnVuY3Rpb24gZ2V0QW5nbGUodG91Y2gxLCB0b3VjaDIpIHsKKyAgICAgICAgdmFyIHkgPSB0b3VjaDIucGFnZVkgLSB0b3VjaDEucGFnZVksCisgICAgICAgICAgICB4ID0gdG91Y2gyLnBhZ2VYIC0gdG91Y2gxLnBhZ2VYOworICAgICAgICByZXR1cm4gTWF0aC5hdGFuMih5LCB4KSAqIDE4MCAvIE1hdGguUEk7CisgICAgfSwKKworCisgICAgLyoqCisgICAgICogYW5nbGUgdG8gZGlyZWN0aW9uIGRlZmluZQorICAgICAqIEBwYXJhbSAgIHtUb3VjaH0gICAgIHRvdWNoMQorICAgICAqIEBwYXJhbSAgIHtUb3VjaH0gICAgIHRvdWNoMgorICAgICAqIEByZXR1cm5zIHtTdHJpbmd9ICAgIGRpcmVjdGlvbiBjb25zdGFudCwgbGlrZSBIYW1tZXIuRElSRUNUSU9OX0xFRlQKKyAgICAgKi8KKyAgICBnZXREaXJlY3Rpb246IGZ1bmN0aW9uIGdldERpcmVjdGlvbih0b3VjaDEsIHRvdWNoMikgeworICAgICAgICB2YXIgeCA9IE1hdGguYWJzKHRvdWNoMS5wYWdlWCAtIHRvdWNoMi5wYWdlWCksCisgICAgICAgICAgICB5ID0gTWF0aC5hYnModG91Y2gxLnBhZ2VZIC0gdG91Y2gyLnBhZ2VZKT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XJhbSAgIHtBcnJheX0gICAgIHN0YXJ0CisgICAgICogQHBhcmFtICAge0FycmF5fSAgICAgZW5kCisgICAgICogQHJldHVybnMge051bWJlcn0gICAgc2NhbGUKKyAgICAgKi8KKyAgICBnZXRTY2FsZTogZnVuY3Rpb24gZ2V0U2NhbGUoc3RhcnQsIGVuZCkgeworICAgICAgICAvLyBuZWVkIHR3byBmaW5nZXJzLi4uCisgICAgICAgIGlmKHN0YXJ0Lmxlbmd0aCA+PSAyICYmIGVuZC5sZW5ndGggPj0gMikgeworICAgICAgICAgICAgcmV0dXJuIHRoaXMuZ2V0RGlzdGFuY2UoZW5kWzBdLCBlbmRbMV0pIC8KKyAgICAgICAgICAgICAgICB0aGlzLmdldERpc3RhbmNlKHN0YXJ0WzBdLCBzdGFydFsxXSk7CisgICAgICAgIH0KKyAgICAgICAgcmV0dXJuIDE7CisgICAgfSwKKworCisgICAgLyoqCisgICAgICogY2FsY3VsYXRlIHRoZSByb3RhdGlvbiBkZWdyZWVzIGJldHdlZW4gdHdvIHRvdWNoTGlzdHMgKGZpbmdlcnMpCisgICAgICogQHBhcmFtICAge0FycmF5fSAgICAgc3RhcnQKKyAgICAgKiBAcGFyYW0gICB7QXJyYXl9ICAgICBlbmQKKyAgICAgKiBAcmV0dXJucyB7TnVtYmVyfSAgICByb3RhdGlvbgorICAgICAqLworICAgIGdldFJvdGF0aW9uOiBmdW5jdGlvbiBnZXRSb3RhdGlvbihzdGFydCwgZW5kKSB7CisgICAgICAgIC8vIG5lZWQgdHdvIGZpbmdlcnMKKyAgICAgICAgaWYoc3RhcnQubGVuZ3RoID49IDIgJiYgZW5kLmxlbmd0aCA+PSAyKSB7CisgICAgICAgICAgICByZXR1cm4gdGhpcy5nZXRBbmdsZShlbmRbMV0sIGVuZFswXSkgLQorICAgICAgICAgICAgICAgIHRoaXMuZ2V0QW5nbGUoc3RhcnRbMV0sIHN0YXJ0WzBdKTsKKyAgICAgICAgfQorICAgICAgICByZXR1cm4gMDsKKyAgICB9LAorCisKKyAgICAvKioKKyAgICAgKiBib29sZWFuIGlmIHRoZSBkaXJlY3Rpb24gaXMgdmVydGljYWwKKyAgICAgKiBAcGFyYW0gICAge1N0cmluZ30gICAgZGlyZWN0aW9uCisgICAgICogQHJldHVybnMgIHtCb29sZWFufSAgIGlzX3ZlcnRpY2FsCisgICAgICovCisgICAgaXNWZXJ0aWNhbDogZnVuY3Rpb24gaXNWZXJ0aWNhbChkaXJlY3Rpb24pIHsKKyAgICAgICAgcmV0dXJuIChkaXJlY3Rpb24gPT0gSGFtbWVyLkRJUkVDVElPTl9VUCB8fCBkaXJlY3Rpb24gPT0gSGFtbWVyLkRJUkVDVElPTl9ET1dOKTsKKyAgICB9LAorCisKKyAgICAvKioKKyAgICAgKiBzdG9wIGJyb3dzZXIgZGVmYXVsdCBiZWhhdmlvciB3aXRoIGNzcyBwcm9wcworICAgICAqIEBwYXJhbSAgIHtIdG1sRWxlbWVudH0gICBlbGVtZW50CisgICAgICogQHBhcmFtICAge09iamVjdH0gICAgICAgIGNzc19wcm9wcworICAgICAqLworICAgIHN0b3BEZWZhdWx0QnJvd3NlckJlaGF2aW9yOiBmdW5jdGlvbiBzdG9wRGVmYXVsdEJyb3dzZXJCZWhhdmlvcihlbGVtZW50LCBjc3NfcHJvcHMpIHsKKyAgICAgICAgdmFyIHByb3AsCisgICAgICAgICAgICB2ZW5kb3JzID0gWyd3ZWJraXQnLCdraHRtbCcsJ21veicsJ21zJywnbycsJyddOworCisgICAgICAgIGlmKCFjc3NfcHJvcHMgfHwgIWVsZW1lbnQuc3R5bGUpIHsKKyAgICAgICAgICAgIHJldHVybjsKKyAgICAgICAgfQorCisgICAgICAgIC8vIHdpdGggY3NzIHByb3BlcnRpZXMgZm9yIG1vZGVybiBicm93c2VycworICAgICAgICBmb3IodmFyIGkgPSAwOyBpIDwgdmVuZG9ycy5sZW5ndGg7IGkrKykgeworICAgICAgICAgICAgZm9yKHZhciBwIGluIGNzc19wcm9wcykgeworICAgICAgICAgICAgICAgIGlmKGNzc19wcm9wcy5oYXNPd25Qcm9wZXJ0eShwKSkgeworICAgICAgICAgICAgICAgICAgICBwcm9wID0gcDsKKworICAgICAgICAgICAgICAgICAgICAvLyB2ZW5kZXIgcHJlZml4IGF0IHRoZSBwcm9wZXJ0eQorICAgICAgICAgICAgICAgICAgICBpZih2ZW5kb3JzW2ldKSB7CisgICAgICAgICAgICAgICAgICAgICAgICBwcm9wID0gdmVuZG9yc1tpXSArIHByb3Auc3Vic3RyaW5nKDAsIDEpLnRvVXBwZXJDYXNlKCkgKyBwcm9wLnN1YnN0cmluZygxKTsKKyAgICAgICAgICAgICAgICAgICAgfQorCisgICAgICAgICAgICAgICAgICAgIC8vIHNldCB0aGUgc3R5bGUKKyAgICAgICAgICAgICAgICAgICAgZWxlbWVudC5zdHlsZVtwcm9wXSA9IGNzc19wcm9wc1twXTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9CisgICAgICAgIH0KKworICAgICAgICAvLyBhbHNvIHRoZSBkaXNhYmxlIG9uc2VsZWN0c3RhcnQKKyAgICAgICAgaWYoY3NzX3Byb3BzLnVzZXJTZWxlY3QgPT0gJ25vbmUnKSB7CisgICAgICAgICAgICBlbGVtZW50Lm9uc2VsZWN0c3RhcnQgPSBmdW5jdGlvbigpIHsKKyAgICAgICAgICAgICAgICByZXR1cm4gZmFsc2U7CisgICAgICAgICAgICB9OworICAgICAgICB9CisgICAgfQorfTsKKworSGFtbWVyLmRldGVjdGlvbiA9IHsKKyAgICAvLyBjb250YWlucyBhbGwgcmVnaXN0cmVkIEhhbW1lci5nZXN0dXJlcyBpbiB0aGUgY29ycmVjdCBvcmRlcgorICAgIGdlc3R1cmVzOiBbXSwKKworICAgIC8vIGRhdGEgb2YgdGhlIGN1cnJlbnQgSGFtbWVyLmdlc3R1cmUgZGV0ZWN0aW9uIHNlc3Npb24KKyAgICBjdXJyZW50OiBudWxsLAorCisgICAgLy8gdGhlIHByZXZpb3VzIEhhbW1lci5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Ghpcy5zdG9wcGVkICYmIGluc3Rfb3B0aW9uc1tnZXN0dXJlLm5hbWVdICE9PSBmYWxzZSkgeworICAgICAgICAgICAgICAgIC8vIGlmIGEgaGFuZGxlciByZXR1cm5zIGZhbHNlLCB3ZSBzdG9wIHdpdGggdGhlIGRldGVjdGlvbgorICAgICAgICAgICAgICAgIGlmKGdlc3R1cmUuaGFuZGxlci5jYWxsKGdlc3R1cmUsIGV2ZW50RGF0YSwgdGhpcy5jdXJyZW50Lmluc3QpID09PSBmYWxzZSkgeworICAgICAgICAgICAgICAgICAgICB0aGlzLnN0b3BEZXRlY3QoKTsKKyAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfQorICAgICAgICB9CisKKyAgICAgICAgLy8gc3RvcmUgYXMgcHJldmlvdXMgZXZlbnQgZXZlbnQKKyAgICAgICAgaWYodGhpcy5jdXJyZW50KSB7CisgICAgICAgICAgICB0aGlzLmN1cnJlbnQubGFzdEV2ZW50ID0gZXZlbnREYXRhOworICAgICAgICB9CisKKyAgICAgICAgLy8gZW5kZXZlbnQsIGJ1dCBub3QgdGhlIGxhc3QgdG91Y2gsIHNvIGRvbnQgc3RvcAorICAgICAgICBpZihldmVudERhdGEuZXZlbnRUeXBlID09IEhhbW1lci5FVkVOVF9FTkQgJiYgIWV2ZW50RGF0YS50b3VjaGVzLmxlbmd0aC0xKSB7CisgICAgICAgICAgICB0aGlzLnN0b3BEZXRlY3QoKTsKKyAgICAgICAgfQorCisgICAgICAgIHJldHVybiBldmVudERhdGE7CisgICAgfSwKKworCisgICAgLyoqCisgICAgICogY2xlYXIgdGhlIEhhbW1lci5nZXN0dXJlIHZhcnMKKyAgICAgKiB0aGlzIGlzIGNhbGxlZCBvbiBlbmREZXRlY3QsIGJ1dCBjYW4gYWxzbyBiZSB1c2VkIHdoZW4gYSBmaW5hbCBIYW1tZXIuZ2VzdHVyZSBoYXMgYmVlbiBkZXRlY3RlZAorICAgIC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lbHRhX3RpbWUsIGRlbHRhX3gsIGRlbHRhX3kpOworCisgICAgICAgIEhhbW1lci51dGlscy5leHRlbmQoZXYsIHsKKyAgICAgICAgICAgIGRlbHRhVGltZSAgIDogZGVsdGFfdGltZSwKKworICAgICAgICAgICAgZGVsdGFYICAgICAgOiBkZWx0YV94LAorICAgICAgICAgICAgZGVsdGFZICAgICAgOiBkZWx0YV95LAorCisgICAgICAgICAgICB2ZWxvY2l0eVggICA6IHZlbG9jaXR5LngsCisgICAgICAgICAgICB2ZWxvY2l0eVkgICA6IHZlbG9jaXR5LnksCisKKyAgICAgICAgICAgIGRpc3RhbmNlICAgIDogSGFtbWVyLnV0aWxzLmdldERpc3RhbmNlKHN0YXJ0RXYuY2VudGVyLCBldi5jZW50ZXIpLAorICAgICAgICAgICAgYW5nbGUgICAgICAgOiBIYW1tZXIudXRpbHMuZ2V0QW5nbGUoc3RhcnRFdi5jZW50ZXIsIGV2LmNlbnRlciksCisgICAgICAgICAgICBkaXJlY3Rpb24gICA6IEhhbW1lci51dGlscy5nZXREaXJlY3Rpb24oc3RhcnRFdi5jZW50ZXIsIGV2LmNlbnRlciksCisKKyAgICAgICAgICAgIHNjYWxlICAgICAgIDogSGFtbWVyLnV0aWxzLmdldFNjYWxlKHN0YXJ0RXYudG91Y2hlcywgZXYudG91Y2hlcyksCisgICAgICAgICAgICByb3RhdGlvbiAgICA6IEhhbW1lci51dGlscy5nZXRSb3RhdGlvbihzdGFydEV2LnRvdWNoZXMsIGV2LnRvdWNoZXMpLAorCisgICAgICAgICAgICBzdGFydEV2ZW50ICA6IHN0YXJ0RXYKKyAgICAgICAgfSk7CisKKyAgICAgICAgcmV0dXJuIGV2OworICAgIH0sCisKKworICAgIC8qKgorICAgICAqIHJlZ2lzdGVyIG5ldyBnZXN0dXJlCisgICAgICogQHBhcmFtICAge09iamVjdH0gICAgZ2VzdHVyZSBvYmplY3QsIHNlZSBnZXN0dXJlcy5qcyBmb3IgZG9jdW1lbnRhdGlvbgor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MgYXV0byByZWdpc3RlcmVkCisgKiBhdCB0aGUgc2V0dXAgb2YgdGhlIGZpcnN0IEhhbW1lciBpbnN0YW5jZS4gWW91IGNhbiBhbHNvIGNhbGwgSGFtbWVyLmRldGVjdGlvbi5yZWdpc3RlcgorICogbWFudWFsbHkgYW5kIHBhc3MgeW91ciBnZXN0dXJlIG9iamVjdCBhcyBhIHBhcmFtCisgKgorICovCisKKy8qKgorICogSG9sZAorICogVG91Y2ggc3RheXMgYXQgdGhlIHNhbWUgcGxhY2UgZm9yIHggdGltZQorICogQGV2ZW50cyAgaG9sZAorICovCitIYW1tZXIuZ2VzdHVyZXMuSG9sZCA9IHsKKyAgICBuYW1lOiAnaG9sZCcsCisgICAgaW5kZXg6IDEwLAorICAgIGRlZmF1bHRzOiB7CisgICAgICAgIGhvbGRfdGltZW91dAk6IDUwMCwKKyAgICAgICAgaG9sZF90aHJlc2hvbGQJOiAxCisgICAgfSwKKyAgICB0aW1lcjogbnVsbCwKKyAgICBoYW5kbGVyOiBmdW5jdGlvbiBob2xkR2VzdHVyZShldiwgaW5zdCkgeworICAgICAgICBzd2l0Y2goZXYuZXZlbnRUeXBlKSB7CisgICAgICAgICAgICBjYXNlIEhhbW1lci5FVkVOVF9TVEFSVDoKKyAgICAgICAgICAgICAgICAvLyBjbGVhciBhbnkgcnVubmluZyB0aW1lcnMKKyAgICAgICAgICAgICAgICBjbGVhclRpbWVvdXQodGhpcy50aW1lcik7CisKKyAgICAgICAgICAgICAgICAvLyBzZXQgdGhlIGdlc3R1cmUgc28gd2UgY2FuIGNoZWNrIGluIHRoZSB0aW1lb3V0IGlmIGl0IHN0aWxsIGlzCisgICAgICAgICAgICAgICAgSGFtbWVyLmRldGVjdGlvbi5jdXJyZW50Lm5hbWUgPSB0aGlzLm5hbWU7CisKKyAgICAgICAgICAgICAgICAvLyBzZXQgdGltZXIgYW5kIGlmIGFmdGVyIHRoZSB0aW1lb3V0IGl0IHN0aWxsIGlzIGhvbGQsCisgICAgICAgICAgICAgICAgLy8gd2UgdHJpZ2dlciB0aGUgaG9sZCBldmVudAorICAgICAgICAgICAgICAgIHRoaXMudGltZXIgPSBzZXRUaW1lb3V0KGZ1bmN0aW9uKCkgeworICAgICAgICAgICAgICAgICAgICBpZihIYW1tZXIuZGV0ZWN0aW9uLmN1cnJlbnQubmFtZSA9PSAnaG9sZCcpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIGluc3QudHJpZ2dlcignaG9sZCcsIGV2KTsKKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIH0sIGluc3Qub3B0aW9ucy5ob2xkX3RpbWVvdXQpOworICAgICAgICAgICAgICAgIGJyZWFrOworCisgICAgICAgICAgICAvLyB3aGVuIHlvdSBtb3ZlIG9yIGVuZCB3ZSBjbGVhciB0aGUgdGltZXIKKyAgICAgICAgICAgIGNhc2UgSGFtbWVyLkVWRU5UX01PVkU6CisgICAgICAgICAgICAgICAgaWYoZXYuZGlzdGFuY2UgPiBpbnN0Lm9wdGlvbnMuaG9sZF90aHJlc2hvbGQpIHsKKyAgICAgICAgICAgICAgICAgICAgY2xlYXJUaW1lb3V0KHRoaXMudGltZXIpOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICBicmVhazsKKworICAgICAgICAgICAgY2FzZSBIYW1tZXIuRVZFTlRfRU5EOgorICAgICAgICAgICAgICAgIGNsZWFyVGltZW91dCh0aGlzLnRpbWVyKTsKKyAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgfQorICAgIH0KK307CisKKworLyoqCisgKiBUYXAvRG91YmxlVGFwCisgKiBRdWljayB0b3VjaCBhdCBhIHBsYWNlIG9yIGRvdWJsZSBhdCB0aGUgc2FtZSBwbGFjZQorICogQGV2ZW50cyAgdGFwLCBkb3VibGV0YXAKKyAqLworSGFtbWVyLmdlc3R1cmVzLlRhcCA9IHsKKyAgICBuYW1lOiAndGFwJywKKyAgICBpbmRleDogMTAwLAorICAgIGRlZmF1bHRzOiB7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iBpbnN0Lm9wdGlvbnMuZHJhZ19tYXhfdG91Y2hlcykgeworICAgICAgICAgICAgcmV0dXJuOworICAgICAgICB9CisKKyAgICAgICAgc3dpdGNoKGV2LmV2ZW50VHlwZSkgeworICAgICAgICAgICAgY2FzZSBIYW1tZXIuRVZFTlRfU1RBUlQ6CisgICAgICAgICAgICAgICAgdGhpcy50cmlnZ2VyZWQgPSBmYWxzZTsKKyAgICAgICAgICAgICAgICBicmVhazsKKworICAgICAgICAgICAgY2FzZSBIYW1tZXIuRVZFTlRfTU9WRToKKyAgICAgICAgICAgICAgICAvLyB3aGVuIHRoZSBkaXN0YW5jZSB3ZSBtb3ZlZCBpcyB0b28gc21hbGwgd2Ugc2tpcCB0aGlzIGdlc3R1cmUKKyAgICAgICAgICAgICAgICAvLyBvciB3ZSBjYW4gYmUgYWxyZWFkeSBpbiBkcmFnZ2luZworICAgICAgICAgICAgICAgIGlmKGV2LmRpc3RhbmNlIDwgaW5zdC5vcHRpb25zLmRyYWdfbWluX2Rpc3RhbmNlICYmCisgICAgICAgICAgICAgICAgICAgIEhhbW1lci5kZXRlY3Rpb24uY3VycmVudC5uYW1lICE9IHRoaXMubmFtZSkgeworICAgICAgICAgICAgICAgICAgICByZXR1cm47CisgICAgICAgICAgICAgICAgfQorCisgICAgICAgICAgICAgICAgLy8gd2UgYXJlIGRyYWdnaW5nIQorICAgICAgICAgICAgICAgIEhhbW1lci5kZXRlY3Rpb24uY3VycmVudC5uYW1lID0gdGhpcy5uYW1lOworCisgICAgICAgICAgICAgICAgLy8gbG9jayBkcmFnIHRvIGF4aXM/CisgICAgICAgICAgICAgICAgaWYoSGFtbWVyLmRldGVjdGlvbi5jdXJyZW50Lmxhc3RFdmVudC5kcmFnX2xvY2tlZF90b19heGlzIHx8IChpbnN0Lm9wdGlvbnMuZHJhZ19sb2NrX3RvX2F4aXMgJiYgaW5zdC5vcHRpb25zLmRyYWdfbG9ja19taW5fZGlzdGFuY2U8PWV2LmRpc3RhbmNlKSkgeworICAgICAgICAgICAgICAgICAgICBldi5kcmFnX2xvY2tlZF90b19heGlzID0gdHJ1ZTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgdmFyIGxhc3RfZGlyZWN0aW9uID0gSGFtbWVyLmRldGVjdGlvbi5jdXJyZW50Lmxhc3RFdmVudC5kaXJlY3Rpb247CisgICAgICAgICAgICAgICAgaWYoZXYuZHJhZ19sb2NrZWRfdG9fYXhpcyAmJiBsYXN0X2RpcmVjdGlvbiAhPT0gZXYuZGlyZWN0aW9uKSB7CisgICAgICAgICAgICAgICAgICAgIC8vIGtlZXAgZGlyZWN0aW9uIG9uIHRoZSBheGlzIHRoYXQgdGhlIGRyYWcgZ2VzdHVyZSBzdGFydGVkIG9uCisgICAgICAgICAgICAgICAgICAgIGlmKEhhbW1lci51dGlscy5pc1ZlcnRpY2FsKGxhc3RfZGlyZWN0aW9uKSkgeworICAgICAgICAgICAgICAgICAgICAgICAgZXYuZGlyZWN0aW9uID0gKGV2LmRlbHRhWSA8IDApID8gSGFtbWVyLkRJUkVDVElPTl9VUCA6IEhhbW1lci5ESVJFQ1RJT05fRE9XTjsKKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICBlbHNlIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIGV2LmRpcmVjdGlvbiA9IChldi5kZWx0YVggPCAwKSA/IEhhbW1lci5ESVJFQ1RJT05fTEVGVCA6IEhhbW1lci5ESVJFQ1RJT05fUklHSFQ7CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICB9CisKKyAgICAgICAgICAgICAgICAvLyBmaXJzdCB0aW1lLCB0cmlnZ2VyIGRyYWdzdGFydCBldmVudAorICAgICAgICAgICAgICAgIGlmKCF0aGlzLnRyaWdnZXJlZCkgeworICAgICAgICAgICAgICAgICAgICBpbnN0LnRyaWdnZXIodGhpcy5uYW1lICsnc3RhcnQnLCBldik7CisgICAgICAgICAgICAgICAgICAgIHRoaXMudHJpZ2dlcmVkID0gdHJ1ZTsKKyAgICAgICAgICAgICAgICB9CisKKyAgICAgICAgICAgICAgICAvLyB0cmlnZ2VyIG5vcm1hbCBldmVudAorICAgICAgICAgICAgICAgIGluc3QudHJpZ2dlcih0aGlzLm5hbWUsIGV2KTsKKworICAgICAgICAgICAgICAgIC8vIGRpcmVjdGlvbiBldmVudCwgbGlrZSBkcmFnZG93bgorICAgICAgICAgICAgICAgIGluc3QudHJpZ2dlcih0aGlzLm5hbWUgKyBldi5kaXJlY3Rpb24sIGV2KTsKKworICAgICAgICAgICAgICAgIC8vIGJsb2NrIHRoZSBicm93c2VyIGV2ZW50cworICAgICAgICAgICAgICAgIGlmKCAoaW5zdC5vcHRpb25zLmRyYWdfYmxvY2tfdmVydGljYWwgJiYgSGFtbWVyLnV0aWxzLmlzVmVydGljYWwoZXYuZGlyZWN0aW9uKSkgfHwKKyAgICAgICAgICAgICAgICAgICAgKGluc3Qub3B0aW9ucy5kcmFnX2Jsb2NrX2hvcml6b250YWwgJiYgIUhhbW1lci51dGlscy5pc1ZlcnRpY2FsKGV2LmRpcmVjdGlvbikpKSB7CisgICAgICAgICAgICAgICAgICAgIGV2LnByZXZlbnREZWZhdWx0KCk7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIGJyZWFrOworCisgICAgICAgICAgICBjYXNlIEhhbW1lci5FVkVOVF9FTkQ6CisgICAgICAgICAgICAgICAgLy8gdHJpZ2dlciBkcmFnZW5kCisgICAgICAgICAgICAgICAgaWYodGhpcy50cmlnZ2VyZWQpIHsKKyAgICAgICAgICAgICAgICAgICAgaW5zdC50cmlnZ2VyKHRoaXMubmFtZSArJ2VuZCcsIGV2KTsKKyAgICAgICAgICAgICAgICB9CisKKyAgICAgICAgICAgICAgICB0aGlzLnRyaWdnZXJlZCA9IGZhbHNlOworICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICB9CisgICAgfQorfTsKKworCisvKioKKyAqIFRyYW5zZm9ybQorICog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VyZSBpcyBidXN5LiBub3cgY2FsbCBkcmFnZW5kCisgICAgICAgIGlmKEhhbW1lci5kZXRlY3Rpb24uY3VycmVudC5uYW1lICE9IHRoaXMubmFtZSAmJiB0aGlzLnRyaWdnZXJlZCkgeworICAgICAgICAgICAgaW5zdC50cmlnZ2VyKHRoaXMubmFtZSArJ2VuZCcsIGV2KTsKKyAgICAgICAgICAgIHRoaXMudHJpZ2dlcmVkID0gZmFsc2U7CisgICAgICAgICAgICByZXR1cm47CisgICAgICAgIH0KKworICAgICAgICAvLyBhdGxlYXN0IG11bHRpdG91Y2gKKyAgICAgICAgaWYoZXYudG91Y2hlcy5sZW5ndGggPCAyKSB7CisgICAgICAgICAgICByZXR1cm47CisgICAgICAgIH0KKworICAgICAgICAvLyBwcmV2ZW50IGRlZmF1bHQgd2hlbiB0d28gZmluZ2VycyBhcmUgb24gdGhlIHNjcmVlbgorICAgICAgICBpZihpbnN0Lm9wdGlvbnMudHJhbnNmb3JtX2Fsd2F5c19ibG9jaykgeworICAgICAgICAgICAgZXYucHJldmVudERlZmF1bHQoKTsKKyAgICAgICAgfQorCisgICAgICAgIHN3aXRjaChldi5ldmVudFR5cGUpIHsKKyAgICAgICAgICAgIGNhc2UgSGFtbWVyLkVWRU5UX1NUQVJUOgorICAgICAgICAgICAgICAgIHRoaXMudHJpZ2dlcmVkID0gZmFsc2U7CisgICAgICAgICAgICAgICAgYnJlYWs7CisKKyAgICAgICAgICAgIGNhc2UgSGFtbWVyLkVWRU5UX01PVkU6CisgICAgICAgICAgICAgICAgdmFyIHNjYWxlX3RocmVzaG9sZCA9IE1hdGguYWJzKDEtZXYuc2NhbGUpOworICAgICAgICAgICAgICAgIHZhciByb3RhdGlvbl90aHJlc2hvbGQgPSBNYXRoLmFicyhldi5yb3RhdGlvbik7CisKKyAgICAgICAgICAgICAgICAvLyB3aGVuIHRoZSBkaXN0YW5jZSB3ZSBtb3ZlZCBpcyB0b28gc21hbGwgd2Ugc2tpcCB0aGlzIGdlc3R1cmUKKyAgICAgICAgICAgICAgICAvLyBvciB3ZSBjYW4gYmUgYWxyZWFkeSBpbiBkcmFnZ2luZworICAgICAgICAgICAgICAgIGlmKHNjYWxlX3RocmVzaG9sZCA8IGluc3Qub3B0aW9ucy50cmFuc2Zvcm1fbWluX3NjYWxlICYmCisgICAgICAgICAgICAgICAgICAgIHJvdGF0aW9uX3RocmVzaG9sZCA8IGluc3Qub3B0aW9ucy50cmFuc2Zvcm1fbWluX3JvdGF0aW9uKSB7CisgICAgICAgICAgICAgICAgICAgIHJldHVybjsKKyAgICAgICAgICAgICAgICB9CisKKyAgICAgICAgICAgICAgICAvLyB3ZSBhcmUgdHJhbnNmb3JtaW5nIQorICAgICAgICAgICAgICAgIEhhbW1lci5kZXRlY3Rpb24uY3VycmVudC5uYW1lID0gdGhpcy5uYW1lOworCisgICAgICAgICAgICAgICAgLy8gZmlyc3QgdGltZSwgdHJpZ2dlciBkcmFnc3RhcnQgZXZlbnQKKyAgICAgICAgICAgICAgICBpZighdGhpcy50cmlnZ2VyZWQpIHsKKyAgICAgICAgICAgICAgICAgICAgaW5zdC50cmlnZ2VyKHRoaXMubmFtZSArJ3N0YXJ0JywgZXYpOworICAgICAgICAgICAgICAgICAgICB0aGlzLnRyaWdnZXJlZCA9IHRydWU7CisgICAgICAgICAgICAgICAgfQorCisgICAgICAgICAgICAgICAgaW5zdC50cmlnZ2VyKHRoaXMubmFtZSwgZXYpOyAvLyBiYXNpYyB0cmFuc2Zvcm0gZXZlbnQKKworICAgICAgICAgICAgICAgIC8vIHRyaWdnZXIgcm90YXRlIGV2ZW50CisgICAgICAgICAgICAgICAgaWYocm90YXRpb25fdGhyZXNob2xkID4gaW5zdC5vcHRpb25zLnRyYW5zZm9ybV9taW5fcm90YXRpb24pIHsKKyAgICAgICAgICAgICAgICAgICAgaW5zdC50cmlnZ2VyKCdyb3RhdGUnLCBldik7CisgICAgICAgICAgICAgICAgfQorCisgICAgICAgICAgICAgICAgLy8gdHJpZ2dlciBwaW5jaCBldmVudAorICAgICAgICAgICAgICAgIGlmKHNjYWxlX3RocmVzaG9sZCA+IGluc3Qub3B0aW9ucy50cmFuc2Zvcm1fbWluX3NjYWxlKSB7CisgICAgICAgICAgICAgICAgICAgIGluc3QudHJpZ2dlcigncGluY2gnLCBldik7CisgICAgICAgICAgICAgICAgICAgIGluc3QudHJpZ2dlcigncGluY2gnKyAoKGV2LnNjYWxlIDwgMSkgPyAnaW4nIDogJ291dCcpLCBldik7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIGJyZWFrOworCisgICAgICAgICAgICBjYXNlIEhhbW1lci5FVkVOVF9FTkQ6CisgICAgICAgICAgICAgICAgLy8gdHJpZ2dlciBkcmFnZW5kCisgICAgICAgICAgICAgICAgaWYodGhpcy50cmlnZ2VyZWQpIHsKKyAgICAgICAgICAgICAgICAgICAgaW5zdC50cmlnZ2VyKHRoaXMubmFtZSArJ2VuZCcsIGV2KTsKKyAgICAgICAgICAgICAgICB9CisKKyAgICAgICAgICAgICAgICB0aGlzLnRyaWdnZXJlZCA9IGZhbHNlOworICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICB9CisgICAgfQorfTsKKworCisvKioKKyAqIFRvdWNoCisgKiBDYWxsZWQgYXMgZmlyc3QsIHRlbGxzIHRoZSB1c2VyIGhhcyB0b3VjaGVkIHRoZSBzY3JlZW4KKyAqIEBldmVudHMgIHRvdWNoCisgKi8KK0hhbW1lci5nZXN0dXJlcy5Ub3VjaCA9IHsKKyAgICBuYW1lOiAndG91Y2gnLAorICAgIGluZGV4OiAtSW5maW5pdHksCisgICAgZGVmYXVsdHM6IHsKKyAgICAgICAgLy8gY2FsbCBwcmV2ZW50RGVmYXVsdCBhdCB0b3VjaHN0YXJ0LCBhbmQgbWFrZXMgdGhlIGVsZW1lbnQgYmxvY2tpbmcgYnkKKyAgICAgICAgLy8gZGlzYWJsaW5nIHRoZSBzY3JvbGxpbmcgb2YgdGhlIHBhZ2UsIGJ1dCBpdCBpbXByb3ZlcyBnZXN0dXJlcyBsaWtlCisgICAgICAgIC8vIHRyYW5zZm9ybWluZyBhbmQgZHJhZ2dpbmcuCisgICAgICAgIC8vIGJlIGNhcmVmdWwgd2l0aCB1c2luZyB0aGlzLCBpdCBjYW4gYmUgdmVyeSBhbm5veWluZyBmb3IgdXNlcnMgdG8gYmUgc3R1Y2sKKyAgICAgICAgLy8gb24gdGhlIHBhZ2UKKyAgICAgICAgcHJldmVudF9kZWZhdWx0OiBmYWxzZSwKKworICAgICAgICAvLyBkaXNhYmxlIG1vdXNlIGV2ZW50cywgc28gb25seSB0b3VjaCAob3IgcGVuISkgaW5wdXQgdHJpZ2dlcnMgZXZlbnRzCisgICAgICAgIHByZXZlbnRfbW91c2VldmVudHM6IGZhbHNlCisgICAgfSwKKyAgICBoYW5kbGVyOiBmdW5jdGlvbiB0b3VjaEdlc3R1cmUoZXYsIGluc3QpIHsKKyAgICAgICAgaWYoaW5zdC5vcHRpb25zLnByZXZlbnRfbW91c2VldmVudHMgJiYgZXYucG9pbnRlclR5cGUgPT0gSGFtbWVyLlBPSU5URVJfTU9VU0UpIHsKKyAgICAgICAgICAgIGV2LnN0b3BEZXRlY3QoKTsKKyAgICAgICAgICAgIHJldHVybjsKKyAgICAgICAgfQorCisgICAgICAgIGlmKGluc3Qub3B0aW9ucy5wcmV2ZW50X2RlZmF1bHQpIHsKKyAgICAgICAgICAgIGV2LnByZXZlbnREZWZhdWx0KCk7CisgICAgICAgIH0KKworICAgICAgICBpZihldi5ldmVudFR5cGUgPT0gIEhhbW1lci5FVkVOVF9TVEFSVCkgeworICAgICAgICAgICAgaW5zdC50cmlnZ2VyKHRoaXMubmFtZSwgZXYpOworICAgICAgICB9CisgICAgfQorfTsKKworCisvKioKKyAqIFJlbGVhc2UKKyAqIENhbGxlZCBhcyBsYXN0LCB0ZWxscyB0aGUgdXNlciBoYXMgcmVsZWFzZWQgdGhlIHNjcmVlbgorICogQGV2ZW50cyAgcmVsZWFzZQorICov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nNmb3Jtc3RhcnQgOiAndHJhbnNmb3Jtc3RhcnQnLAorICAgIGhtVHJhbnNmb3JtIDogJ3RyYW5zZm9ybScsCisgICAgaG1UcmFuc2Zvcm1lbmQgOiAndHJhbnNmb3JtZW5kJworfTsKKwordmFyIFZFUkJPU0UgPSBmYWxzZTsKKworYW5ndWxhci5mb3JFYWNoKEhHRVNUVVJFUywgZnVuY3Rpb24oZXZlbnROYW1lLCBkaXJlY3RpdmVOYW1lKSB7CisgICAgYW5ndWxhci5tb2R1bGUoJ2FuZ3VsYXItZ2VzdHVyZXMnKS5kaXJlY3RpdmUoCisgICAgICAgICAgICBkaXJlY3RpdmVOYW1lLAorICAgICAgICAgICAgWyckcGFyc2UnLCAnJGxvZycsICckdGltZW91dCcsIGZ1bmN0aW9uKCRwYXJzZSwgJGxvZywgJHRpbWVvdXQpIHsKKyAgICAgICAgICAgICAgICByZXR1cm4gZnVuY3Rpb24oc2NvcGUsIGVsZW1lbnQsIGF0dHIpIHsKKyAgICAgICAgICAgICAgICAgICAgdmFyIGhhbW1lcnRpbWUsIGhhbmRsZXI7CisgICAgICAgICAgICAgICAgICAgIGF0dHIuJG9ic2VydmUoZGlyZWN0aXZlTmFtZSwgZnVuY3Rpb24odmFsdWUpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIHZhciBmbiA9ICRwYXJzZSh2YWx1ZSk7CisgICAgICAgICAgICAgICAgICAgICAgICB2YXIgb3B0cyA9ICRwYXJzZShhdHRyW2RpcmVjdGl2ZU5hbWUgKyAnT3B0cyddKQorICAgICAgICAgICAgICAgICAgICAgICAgKHNjb3BlLCB7fSk7CisgICAgICAgICAgICAgICAgICAgICAgICBoYW1tZXJ0aW1lID0gbmV3IEhhbW1lcihlbGVtZW50WzBdLCBvcHRzKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIGhhbmRsZXIgPSBmdW5jdGlvbihldmVudCkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChWRVJCT1NFKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICRsb2cuZGVidWcoJ2FuZ3VsYXItZ2VzdHVyZXM6ICVzJywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBldmVudE5hbWUpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAkdGltZW91dChmdW5jdGlvbigpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZm4oc2NvcGUsIHsgJGV2ZW50IDogZXZlbnQgfSk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSwgMCk7CisgICAgICAgICAgICAgICAgICAgICAgICB9OworICAgICAgICAgICAgICAgICAgICAgICAgaGFtbWVydGltZS5vbihldmVudE5hbWUsIGhhbmRsZXIpOworICAgICAgICAgICAgICAgICAgICB9KTsKKyAgICAgICAgICAgICAgICAgICAgc2NvcGUuJG9uKCckZGVzdHJveScsIGZ1bmN0aW9uKCkgeworICAgICAgICAgICAgICAgICAgICAgICAgaGFtbWVydGltZS5vZmYoZXZlbnROYW1lLCBoYW5kbGVyKTsKKyAgICAgICAgICAgICAgICAgICAgfSk7CisgICAgICAgICAgICAgICAgfTsKKyAgICAgICAgICAgIH1dKTsKK30pOwpkaWZmIC0tZ2l0IGEvZWNvbXAtcG9ydGFsLUJFL3dhci9zdGF0aWMvZWJ6L2FuZ3VsYXJfanMvbmdfYmFzZS5qcyBiL2Vjb21wLXBvcnRhbC1CRS93YXIvc3RhdGljL2Viei9hbmd1bGFyX2pzL25nX2Jhc2UuanMKbmV3IGZpbGUgbW9kZSAxMDA2NDQKaW5kZXggMDAwMDAwMC4uZjg2NDUyNQotLS0gL2Rldi9udWxsCisrKyBiL2Vjb21wLXBvcnRhbC1CRS93YXIvc3RhdGljL2Viei9hbmd1bGFyX2pzL25nX2Jhc2UuanMKQEAgLTAsMCArMSw0IEBACishZnVuY3Rpb24oYSxiKXtmdW5jdGlvbiBjKGEpe3Z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ydC9zdGFja2VkQmFyY2hhcnQuaHRtbCIsInRlbXBsYXRlL3N0YWNrZWRhcmVhY2hhcnQvc3RhY2tlZEFyZWFDaGFydC5odG1sIl0pOworYW5ndWxhci5tb2R1bGUoJ2F0dC5jaGFydHMudXRpbGl0aWVzJywgW10pCisgICAgICAgIC5mYWN0b3J5KCckZXh0ZW5kT2JqJywgW2Z1bmN0aW9uICgpIHsKKyAgICAgICAgICAgICAgICB2YXIgX2V4dGVuZERlZXAgPSBmdW5jdGlvbiAoZHN0KSB7CisgICAgICAgICAgICAgICAgICAgIGFuZ3VsYXIuZm9yRWFjaChhcmd1bWVudHMsIGZ1bmN0aW9uIChvYmopIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIGlmIChvYmogIT09IGRzdCkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGFuZ3VsYXIuZm9yRWFjaChvYmosIGZ1bmN0aW9uICh2YWx1ZSwga2V5KSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChkc3Rba2V5XSAmJiBkc3Rba2V5XS5jb25zdHJ1Y3RvciAmJiBkc3Rba2V5XS5jb25zdHJ1Y3RvciA9PT0gT2JqZWN0KSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBfZXh0ZW5kRGVlcChkc3Rba2V5XSwgdmFsdWUpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZHN0W2tleV0gPSB2YWx1ZTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0pOworICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICB9KTsKKyAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGRzdDsKKyAgICAgICAgICAgICAgICB9OworICAgICAgICAgICAgICAgIHJldHVybiB7CisgICAgICAgICAgICAgICAgICAgIGV4dGVuZERlZXA6IF9leHRlbmREZWVwCisgICAgICAgICAgICAgICAgICAgIAorICAgICAgICAgICAgICAgIH07CisgICAgICAgICAgICB9XSk7CisKK2FuZ3VsYXIubW9kdWxlKCdhdHQuY2hhcnRzLmFyZWFjaGFydEQzJywgWydhdHQuY2hhcnRzLnV0aWxpdGllcyddKQorICAgICAgICAuY29uc3RhbnQoImFyZWFDaGFydENvbmZpZyIsCisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAiY2hhcnRjb2xvciI6IHsKKyAgICAgICAgICAgICAgICAgICAgICAgICJhcmVhQ2hhcnRDb2xvciI6IFsiI2JmZjFlYyIsICIjYmJmMGViIiwgIiMwMGM3YjIiXSwKKyAgICAgICAgICAgICAgICAgICAgICAgICJsaW5lQ2hhcnRDb2xvciI6IFsiIzQ0NDQ0NCIsICIjNDQ0NDQ0Il0sCisgICAgICAgICAgICAgICAgICAgICAgICAib3ZlcmFnZUNvbG9yIjogWyIjYjg1MDllIl0KKyAgICAgICAgICAgICAgICAgICAgfSwKKyAgICAgICAgICAgICAgICAgICAgImdyaWRMaW5lQ29sb3IiOiAiIzgwODA4MCIsCisgICAgICAgICAgICAgICAgICAgICJsaW5lQ3VydmVUeXBlIjogJ2NhcmRpbmFsJywKKyAgICAgICAgICAgICAgICAgICAgInlBeGlzTWF4VGlja3MiOiA0LAorICAgICAgICAgICAgICAgICAgICAiY2hhcnRIZWlnaHQiOiAiMjAwIiwKKyAgICAgICAgICAgICAgICAgICAgImRhdGFUeXBlIjogIkdCIiwKKyAgICAgICAgICAgICAgICAgICAgImxpbmVTdHJva2UiOiAzLAorICAgICAgICAgICAgICAgICAgICAib3BhY2l0eU9uSG92ZXIiOiAiMC41IiwKKyAgICAgICAgICAgICAgICAgICAgImNpcmNsZVJhZGl1cyI6IDMuNSwKKyAgICAgICAgICAgICAgICAgICAgInllYXJMYWJlbFBvcyI6IFs1LCAtNV0sCisgICAgICAgICAgICAgICAgICAgICJ0b29sdGlwVG9wTWFyZ2luIjogMTA1LAorICAgICAgICAgICAgICAgICAgICAidG9vbHRpcExlZnRNYXJnaW4iOiAyOCwKKyAgICAgICAgICAgICAgICAgICAgImFtb3VudEtEaXZpc2lvbiI6IDEwMDAsCisgICAgICAgICAgICAgICAgICAgICJhbW91bnRLVGV4dCI6ICJLIiwKKyAgICAgICAgICAgICAgICAgICAgImFtb3VudE1EaXZpc2lvbiI6IDEwMDAwMDAsCisgICAgICAgICAgICAgICAgICAgICJhbW91bnRNVGV4dCI6ICJNIgorICAgICAgICAgICAgICAgIH0pCisgICAgICAgIC5kaXJlY3RpdmUoJ2F0dEFyZWFDaGFydCcsIFsnYXJlYUNoYXJ0Q29uZmlnJywgJyRleHRlbmRPYmonLCAnJHRpbWVvdXQnLCBmdW5jdGlvbiAoYXJlYUNoYXJ0Q29uZmlnLCAkZXh0ZW5kT2JqLCAkdGltZW91dCkgeworICAgICAgICAgICAgICAgIHJldHVybiB7CisgICAgICAgICAgICAgICAgICAgIHJlc3RyaWN0OiAnQScsCisgICAgICAgICAgICAgICAgICAgIHNjb3BlOiB7CisgICAgICAgICAgICAgICAgICAgICAgICBjaGFydERhdGE6ICc9JywKKyAgICAgICAgICAgICAgICAgICAgICAgIGNoYXJ0Q29sb3I6ICI9IiwKKyAgICAgICAgICAgICAgICAgICAgICAgIGxlZ2VuZExhYmVsOiAiPSIsCisgICAgICAgICAgICAgICAgICAgICAgICByZWZyZXNoQ2hhcnQ6ICI9IiwKKyAgICAgICAgICAgICAgICAgICAgICAgIGNoYXJ0Q29uZmlnOiAiPSIKKyAgICAgICAgICAgICAgICAgICAgfSwKKyAgICAgICAgICAgICAgICAgICAgdGVtcGxhdGVVcmw6ICJ0ZW1wbGF0ZS9hcmVhY2hhcnREMy9hdHRBcmVhQ2hhcnREMy5odG1sIiwKKyAgICAgICAgICAgICAgICAgICAgcmVwbGFjZTogdHJ1ZSwKKyAgICAgICAgICAgICAgICAgICAgY29udHJvbGxlcjogWyckc2NvcGUnLCAnJGF0dHJzJywgZnVuY3Rpb24gKCRzY29wZSwgJGF0dHJzKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGFuZ3VsYXIuaXNEZWZpbmVkKCRzY29wZS5jaGFydENvbmZpZykpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYXJlYUNoYXJ0Q29uZmlnID0gJGV4dGVuZE9iai5leHRlbmREZWVwKGFyZWFDaGFydENvbmZpZywgJHNjb3BlLmNoYXJ0Q29uZmlnKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgJHNjb3BlLmRhdGFUeXBlID0gYXJlYUNoYXJ0Q29uZmlnLmRhdGFUeXBlOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICRzY29wZS5jaGFydElEID0gJGF0dHJzLmlkOworICAgICAgICAgICAgICAgICAgICAgICAgfV0sCisgICAgICAgICAgICAgICAgICAgIGxpbms6IGZ1bmN0aW9uIChzY29wZSwgZWxlbWVudCwgYXR0cnMsIGN0cmwpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIHNjb3BlLnRvb2x0aXBGbGFnID0gZmFsc2U7CisgICAgICAgICAgICAgICAgICAgICAgICBzY29wZS5vdmVyYWdlRmxhZyA9IGZhbHNlOworICAgICAgICAgICAgICAgICAgICAgICAgc2NvcGUudW5kZXJhZ2VGbGFnID0gZmFsc2U7CisgICAgICAgICAgICAgICAgICAgICAgICB2YXIgc3RhcnRDb2xvciwgc3RvcENvbG9yLCBsaW5lQ29sb3IsIHhBeGlzdGlja3MsIGRhdGFPYmosIG1hcmdpbiA9IHt0b3A6IDMwLCByaWdodDogMTUsIGJvdHRvbTogMzAsIGxlZnQ6IDQwfSwKKyAgICAgICAgICAgICAgICAgICAgICAgIHdpZHRoID0gcGFyc2VJbnQoYXR0cnMuY2hhcnRXaWR0aCwgMTApLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBoZWlnaHQgPSBhcmVhQ2hhcnRDb25maWcuY2hhcnRIZWlnaHQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBhcnNlRGF0ZSA9IGQzLnRpbWUuZm9ybWF0KCIlZC0lYi0lWSIpLnBhcnNlLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0b29sdGlwRm9ybWF0ID0gZDMudGltZS5mb3JtYXQoIiVCLSVZIiksCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxhYmVsRm9ybWF0ID0gZDMudGltZS5mb3JtYXQoIiVZIik7CisgICAgICAgICAgICAgICAgICAgICAgICB2YXIgbGVnZW5kQ29sb3JzID0gW107CisgICAgICAgICAgICAgICAgICAgICAgICBsZWdlbmRDb2xvcnMgPSAoc2NvcGUuY2hhcnRDb2xvcikgPyBzY29wZS5jaGFydENvbG9yIDogYXJlYUNoYXJ0Q29uZmlnLmNoYXJ0Y29sb3I7CisgICAgICAgICAgICAgICAgICAgICAgICBzdGFydENvbG9yID0gbGVnZW5kQ29sb3JzLmFyZWFDaGFydENvbG9yWzBdOworICAgICAgICAgICAgICAgICAgICAgICAgc3RvcENvbG9yID0gbGVnZW5kQ29sb3JzLmFyZWFDaGFydENvbG9yWzFdOworICAgICAgICAgICAgICAgICAgICAgICAgbGluZUNvbG9yID0gbGVnZW5kQ29sb3JzLmxpbmVDaGFydENvbG9yWzBdOworICAgICAgICAgICAgICAgICAgICAgICAgc2NvcGUuYXJlYUxlZ2VuZENvbG9yID0gbGVnZW5kQ29sb3JzLmFyZWFDaGFydENvbG9yWzJdOworICAgICAgICAgICAgICAgICAgICAgICAgc2NvcGUubGluZUxlZ2VuZENvbG9yID0gbGVnZW5kQ29sb3JzLmxpbmVDaGFydENvbG9yWzFdOworICAgICAgICAgICAgICAgICAgICAgICAgc2NvcGUub3ZlcmFnZUxlZ2VuZCA9IGxlZ2VuZENvbG9ycy5vdmVyYWdlQ29sb3JbMF07CisgICAgICAgICAgICAgICAgICAgICAgICB2YXIgb2xkSUUgPSBuYXZpZ2F0b3IudXNlckFnZW50LnRvTG93ZXJDYXNlKCkuaW5kZXhPZignbXNpZSA4LjAnKSAhPT0gLTE7CisgICAgICAgICAgICAgICAgICAgICAgICBzY29wZS5hZGRMZWdlbmRDb2xvciA9IGZ1bmN0aW9uIChpZCkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhciBiZ0NvbG9yID0gbnVsbDsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBzd2l0Y2ggKGlkKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNhc2UgMDoKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJnQ29sb3IgPSB7ImJhY2tncm91bmQtY29sb3IiOiBzY29wZS5hcmVhTGVnZW5kQ29sb3IsICJib3JkZXItcmFkaXVzIjogIjEwMCUifTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjYXNlIDE6CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBiZ0NvbG9yID0geyJiYWNrZ3JvdW5kLWNvbG9yIjogc2NvcGUubGluZUxlZ2VuZENvbG9yfTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjYXNlIDI6CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBiZ0NvbG9yID0geyJiYWNrZ3JvdW5kLWNvbG9yIjogc2NvcGUub3ZlcmFnZUxlZ2VuZCwgImJvcmRlci1yYWRpdXMiOiAiMTAwJSJ9OworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBiZ0NvbG9yOworICAgICAgICAgICAgICAgICAgICAgICAgfTsKKworICAgICAgICAgICAgICAgICAgICAgICAgYXR0cnMuJG9ic2VydmUoJ2xlZ2VuZFJlcXVpcmVkJywgZnVuY3Rpb24gKHZhbCkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICh2YWwgPT09ICd0cnVlJykgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzY29wZS5zaG93TGVnZW5kID0gdHJ1ZTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgZWxzZSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNjb3BlLnNob3dMZWdlbmQgPSBmYWxzZTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICB9KTsKKworICAgICAgICAgICAgICAgICAgICAgICAgc2NvcGUuJHdhdGNoKCdyZWZyZXNoQ2hhcnQnLCBmdW5jdGlvbiAodmFsdWUpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAodmFsdWUgPT09IGZhbHNlKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybjsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGFuZ3VsYXIuaXNEZWZpbmVkKHNjb3BlLmNoYXJ0Q29uZmlnKSkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBhcmVhQ2hhcnRDb25maWcgPSAkZXh0ZW5kT2JqLmV4dGVuZERlZXAoYXJlYUNoYXJ0Q29uZmlnLCBzY29wZS5jaGFydENvbmZpZyk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgICAgIGQzLnNlbGVjdCgic3ZnIyIgKyBhdHRycy5pZCkucmVtb3ZlKCk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgZDMuc2VsZWN0QWxsKCJzdmcjIiArIGF0dHJzLmlkICsgIiA+ICoiKS5yZW1vdmUoKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBkMy5zZWxlY3RBbGwoImRpdiNhcmVhQ2hhcnRDb250YWluZXIiICsgIiA+IGRpdiIpLnJlbW92ZSgpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIHhBeGlzdGlja3MgPSBzY29wZS5jaGFydERhdGEubGVuZ3RoOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRhdGFPYmogPSBzY29wZS5jaGFydERhdGE7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFyIHllYXJMYWJlbCA9ICcnLCBtb250aEFyciA9IHt9LCBpc1NpbmdsZU1vbnRoLCBzaW5nbGVNb250aE5hbWU7CisKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyAgT24gc2VsZWN0aW5nIHNhbWUgbW9udGggaW4gRnJvbSBhbmQgVG8gZHJvcGRvd25zLCBVc2VyIHNob3VsZCBiZSBnZXR0aW5nIGdyYXBoICAgICAgICAgICAgICAgICAgICAgICAgICAgIAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChkYXRhT2JqLmxlbmd0aCA9PT0gMSkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpc1NpbmdsZU1vbnRoID0gdHJ1ZTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFyIHRtcDEgPSAiMDEtIiArIGRhdGFPYmpbMF0ubW9udGg7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhciB0bXAgPSBwYXJzZURhdGUodG1wMSk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNpbmdsZU1vbnRoTmFtZSA9IHRtcC50b1N0cmluZygpLnNwbGl0KCIgIilbMV07CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRtcC5zZXRNb250aCh0bXAuZ2V0TW9udGgoKSArIDEpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YXIgbmV4dE1vbnRoID0gdG1wLnRvU3RyaW5nKCkuc3BsaXQoIiAiKVsxXSArICItIiArIHRtcC5nZXRGdWxsWWVhcigpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBkYXRhT2JqLnB1c2goe21vbnRoOiBuZXh0TW9udGgsIHVzYWdlOiBkYXRhT2JqWzBdLnVzYWdlLCBhdmFpbGFibGU6IGRhdGFPYmpbMF0uYXZhaWxhYmxlLCB1c2FnZURhdGFUeXBlOiBkYXRhT2JqWzBdLnVzYWdlRGF0YVR5cGUsIGF2YWlsYWJsZURhdGFUeXBlOiBkYXRhT2JqWzBdLmF2YWlsYWJsZURhdGFUeXBlfSk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQorCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgZGF0YU9iai5mb3JFYWNoKGZ1bmN0aW9uIChkKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhciB0bXAgPSAiMDEtIiArIGQubW9udGg7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGQubnVtZXJpY01vbnRoID0gcGFyc2VEYXRlKHRtcCk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGQudXNhZ2UgPSArZC51c2FnZTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZC5hdmFpbGFibGUgPSArZC5hdmFpbGFibGU7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1vbnRoQXJyW2xhYmVsRm9ybWF0KGQubnVtZXJpY01vbnRoKV0gPSBsYWJlbEZvcm1hdChkLm51bWVyaWNNb250aCk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSk7CisKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBmb3IgKHZhciBrZXkgaW4gbW9udGhBcnIpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFyIGxhYmVsID0gbW9udGhBcnJba2V5XTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKCF5ZWFyTGFiZWwpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHllYXJMYWJlbCA9IGxhYmVsOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGVsc2UgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKCFpc1NpbmdsZU1vbnRoKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgeWVhckxhYmVsID0geWVhckxhYmVsICsgIi0iICsgbGFiZWw7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CisKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAvL1gtQXhpcyBSYW5nZSAgICAgICAgCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFyIHhSYW5nZSA9IGQzLnRpbWUuc2NhbGUoKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLnJhbmdlKFswLCB3aWR0aF0pOworCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgLy9ZLUF4aXMgUmFuZ2UgCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFyIHlSYW5nZSA9IGQzLnNjYWxlLmxpbmVhcigpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAucmFuZ2UoW2hlaWdodCwgMF0pOworCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgLy9YLUF4aXMgRG9tYWluICAKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB4UmFuZ2UuZG9tYWluKGQzLmV4dGVudChkYXRhT2JqLCBmdW5jdGlvbiAoZCkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gZC5udW1lcmljTW9udGg7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSkpOworCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgLy9ZLUF4aXMgRG9tYWluCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFyIHlEb21haW5EYXRhID0gW10sIHlBeGlzRGF0YSA9IFtdOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZvciAodmFyIGIgPSAwOyBiIDwgZGF0YU9iai5sZW5ndGg7IGIrKykgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YXIgdXNhZ2VWYWwgPSBNYXRoLnJvdW5kKHBhcnNlSW50KGRhdGFPYmpbYl0udXNhZ2UsIDEwKSAvIGFyZWFDaGFydENvbmZpZy55QXhpc01heFRpY2tzKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFyIGF2YWlsYWJsZVZhbCA9IE1hdGgucm91bmQocGFyc2VJbnQoZGF0YU9ialtiXS5hdmFpbGFibGUsIDEwKSAvIGFyZWFDaGFydENvbmZpZy55QXhpc01heFRpY2tzKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFyIHZhbDsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHVzYWdlVmFsID4gYXZhaWxhYmxlVmFsKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YWwgPSB1c2FnZVZhbDsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBlbHNlIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhbCA9IGF2YWlsYWJsZVZhbDsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YXIgQ2FsYyA9IE1hdGguY2VpbCgodmFsIC8gTWF0aC5wb3coMTAsICgiIiArIHZhbCkubGVuZ3RoIC0gMSkpKSAqIChhcmVhQ2hhcnRDb25maWcueUF4aXNNYXhUaWNrcykgKiBNYXRoLnBvdygxMCwgKCIiICsgdmFsKS5sZW5ndGggLSAxKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgeURvbWFpbkRhdGEucHVzaCh7J3lBeGlzVmFsJzogQ2FsY30pOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KKworICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vWS1BeGlzIERvbWFpbgorICAgICAgICAgICAgICAgICAgICAgICAgICAgIHlSYW5nZS5kb21haW4oWzAsIGQzLm1heCh5RG9tYWluRGF0YSwgZnVuY3Rpb24gKGQpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiAoZC55QXhpc1ZhbCk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0pXSk7CisKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YXIgeVRpY2sgPSBkMy5tYXgoeURvbWFpbkRhdGEsIGZ1bmN0aW9uIChkKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBkLnlBeGlzVmFsOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0pOworCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgeVRpY2sgPSB5VGljayAvIGFyZWFDaGFydENvbmZpZy55QXhpc01heFRpY2tzOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZvciAodmFyIHggPSAwOyB4IDw9IGFyZWFDaGFydENvbmZpZy55QXhpc01heFRpY2tzOyB4KyspIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgeUF4aXNEYXRhLnB1c2goeVRpY2sgKiB4KTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFyIGZvcm1hdERhdGEgPSBmdW5jdGlvbiAoZCkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoZCA+PSBhcmVhQ2hhcnRDb25maWcuYW1vdW50TURpdmlzaW9uKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gZCAvIGFyZWFDaGFydENvbmZpZy5hbW91bnRNRGl2aXNpb24gKyBhcmVhQ2hhcnRDb25maWcuYW1vdW50TVRleHQ7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAoZCA+PSBhcmVhQ2hhcnRDb25maWcuYW1vdW50S0RpdmlzaW9uKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gZCAvIGFyZWFDaGFydENvbmZpZy5hbW91bnRLRGl2aXNpb24gKyBhcmVhQ2hhcnRDb25maWcuYW1vdW50S1RleHQ7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gZDsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgICAgIH07CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFyIHhBeGlzID0gZDMuc3ZnLmF4aXMoKS5zY2FsZSh4UmFuZ2UpLm9yaWVudCgiYm90dG9tIikudGlja0Zvcm1hdChkMy50aW1lLmZvcm1hdCgnJWInKSkudGlja3MoZDMudGltZS5tb250aHMpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhciB5QXhpcyA9IGQzLnN2Zy5heGlzKCkuc2NhbGUoeVJhbmdlKS5vcmllbnQoImxlZnQiKS50aWNrVmFsdWVzKHlBeGlzRGF0YSkudGlja3MoYXJlYUNoYXJ0Q29uZmlnLnlBeGlzTWF4VGlja3MpLnRpY2tGb3JtYXQoZm9ybWF0RGF0YSk7CisKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAvL0RyYXcgTGluZQorICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhciBsaW5lID0gZDMuc3ZnLmxpbmUoKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLngoZnVuY3Rpb24gKGQpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4geFJhbmdlKGQubnVtZXJpY01vbnRoKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0pCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAueShmdW5jdGlvbiAoZCkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiB5UmFuZ2UoZC5hdmFpbGFibGUpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSkuaW50ZXJwb2xhdGUoYXJlYUNoYXJ0Q29uZmlnLmxpbmVDdXJ2ZVR5cGUpOworCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgLy9EcmF3IEFyZWEgICAgICAgIAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhciBhcmVhID0gZDMuc3ZnLmFyZWEoKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLngoZnVuY3Rpb24gKGQpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4geFJhbmdlKGQubnVtZXJpY01vbnRoKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0pCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAueTAoaGVpZ2h0KQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLnkxKGZ1bmN0aW9uIChkKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHlSYW5nZShkLnVzYWdlKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0pLmludGVycG9sYXRlKGFyZWFDaGFydENvbmZpZy5saW5lQ3VydmVUeXBlKTsKKworICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vUGxvdCBDaGFydAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhciBkcmF3Q2hhcnQgPSBkMy5zZWxlY3QoIiNhcmVhQ2hhcnRDb250YWluZXIiKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLmFwcGVuZCgic3ZnIikKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC5hdHRyKCJpZCIsIGF0dHJzLmlkKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLmRhdGEoZGF0YU9iaikKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC5hdHRyKCJ3aWR0aCIsIHdpZHRoICsgbWFyZ2luLmxlZnQgKyBtYXJnaW4ucmlnaHQpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAuYXR0cigiaGVpZ2h0IiwgcGFyc2VJbnQoaGVpZ2h0LCAxMCkgKyBwYXJzZUludChtYXJnaW4udG9wLCAxMCkgKyBwYXJzZUludChtYXJnaW4uYm90dG9tLCAxMCkpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAuYXBwZW5kKCJnIikKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC5hdHRyKCJ0cmFuc2Zvcm0iLCAidHJhbnNsYXRlKCIgKyBtYXJnaW4ubGVmdCArICIsIiArIG1hcmdpbi50b3AgKyAiKSIpOworCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgLy9BcHBseSBncmFkaWVudHMgCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKCFvbGRJRSkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YXIgc3ZnRGVmcyA9IGRyYXdDaGFydC5hcHBlbmQoImRlZnMiKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC5hcHBlbmQoImxpbmVhckdyYWRpZW50IikKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAuYXR0cigiaWQiLCAiYXJlYUdyYWRpZW50IikKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAuYXR0cigneDEnLCAnMCUnKS5hdHRyKCd5MScsICcwJScpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLmF0dHIoJ3gyJywgJzAlJykuYXR0cigneTInLCAnMTAwJScpOworCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vRmlsbCBncmFkaWVudCAgICAgIAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzdmdEZWZzLmFwcGVuZCgnc3RvcCcpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLmF0dHIoJ3N0b3AtY29sb3InLCBzdGFydENvbG9yKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC5hdHRyKCJvZmZzZXQiLCAiMCUiKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC5hdHRyKCJzdG9wLW9wYWNpdHkiLCAiMSIpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzdmdEZWZzLmFwcGVuZCgnc3RvcCcpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLmF0dHIoJ3N0b3AtY29sb3InLCBzdG9wQ29sb3IpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLmF0dHIoIm9mZnNldCIsICIxMDAlIikKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAuYXR0cigic3RvcC1vcGFjaXR5IiwgIjEiKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CisKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAvL0RyYXcgWCBBeGlzICAgICAgICAKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBkcmF3Q2hhcnQuYXBwZW5kKCJnIikKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC5hdHRyKCJjbGFzcyIsICJ4IGF4aXMiKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLmF0dHIoInRyYW5zZm9ybSIsICJ0cmFuc2xhdGUoMCwiICsgaGVpZ2h0ICsgIikiKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLmNhbGwoeEF4aXMpLnNlbGVjdEFsbCgidGV4dCIpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAuYXR0cigiZHkiLCAiMS4yZW0iKTsKKworCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGlzU2luZ2xlTW9udGgpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZHJhd0NoYXJ0LnNlbGVjdEFsbCgnLnguYXhpcycpLnNlbGVjdEFsbCgnLnRpY2snKS5zZWxlY3RBbGwoJ3RleHQnKVsxXVswXS50ZXh0Q29udGVudCA9IHNpbmdsZU1vbnRoTmFtZTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CisKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAvL1Bsb3QgQXJlYQorICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhciBhcmVhUGF0aCA9IGRyYXdDaGFydC5hcHBlbmQoInBhdGgiKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLmRhdHVtKGRhdGFPYmopCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAuYXR0cigiY2xhc3MiLCAiYXJlYSIpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAuYXR0cigiZCIsIGFyZWEpLnN0eWxlKCJmaWxsIiwgInVybCgjYXJlYUdyYWRpZW50KSIpLmFwcGVuZCgidGl0bGUiKS50ZXh0KGZ1bmN0aW9uICgpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHNjb3BlLmxlZ2VuZExhYmVsWzBdLnNlcmllczsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB9KTsKKworICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhciBuZXdEYXRhT2JqID0gZGF0YU9iajsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoaXNTaW5nbGVNb250aCkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBuZXdEYXRhT2JqID0gZGF0YU9iai5zbGljZSgwLCAxKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CisKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAvL0RyYXcgRGF0YSBQb2ludHMgZm9yIEFyZWEgQ2hhcnQKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YXIgY2lyY2xlID0gZHJhd0NoYXJ0LnNlbGVjdEFsbCgiLmRvdCIpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAuZGF0YShuZXdEYXRhT2JqKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLmVudGVyKCkuYXBwZW5kKCJjaXJjbGUiKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLmF0dHIoImNsYXNzIiwgImRvdCIpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAuYXR0cigidHJhbnNmb3JtIiwgInRyYW5zbGF0ZSgiICsgKGlzU2luZ2xlTW9udGggPT09IHRydWUpICogd2lkdGggLyAyICsgIiwwKSIpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAuc3R5bGUoImZpbGwiLCBmdW5jdGlvbiAoZCkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChkLnVzYWdlID4gZC5hdmFpbGFibGUpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHNjb3BlLm92ZXJhZ2VMZWdlbmQ7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGVsc2UgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gc2NvcGUuYXJlYUxlZ2VuZENvbG9yOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0pCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAuYXR0cigiciIsIGFyZWFDaGFydENvbmZpZy5jaXJjbGVSYWRpdXMpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAuYXR0cigiY3giLCBmdW5jdGlvbiAoZCkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiB4UmFuZ2UoZC5udW1lcmljTW9udGgpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC5hdHRyKCJjeSIsIGZ1bmN0aW9uIChkKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHlSYW5nZShkLnVzYWdlKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0pLm9uKCJtb3VzZW92ZXIiLCBmdW5jdGlvbiAoZCkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YXIgb2Zmc2V0WCA9IE1hdGguY2VpbChkMy5zZWxlY3QodGhpcykuYXR0cigiY3giKSk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNob3dfdG9vbHRpcF9ncmlkX2xpbmUoZDMuc2VsZWN0KHRoaXMpLmF0dHIoImN4IiksICJjaXJjbGUiLCAiY3giKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFyIG9mZnNldFkgPSBNYXRoLnJvdW5kKGQzLnNlbGVjdCh0aGlzKS5hdHRyKCJjeSIpKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZDMuc2VsZWN0KCdzdmcjJyArIGF0dHJzLmlkKS5zdHlsZSgiZmlsbC1vcGFjaXR5IiwgYXJlYUNoYXJ0Q29uZmlnLm9wYWNpdHlPbkhvdmVyKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbW91c2VPdmVyKGQsIG9mZnNldFggLSAzLCBvZmZzZXRZIC0gMyk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSkub24oIm1vdXNlb3V0IiwgZnVuY3Rpb24gKCkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBoaWRlX3Rvb2x0aXBfZ3JpZF9saW5lKGQzLnNlbGVjdCh0aGlzKS5hdHRyKCJjeCIpLCAiY2lyY2xlIiwgImN4Iik7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGQzLnNlbGVjdCgnc3ZnIycgKyBhdHRycy5pZCkuc3R5bGUoImZpbGwtb3BhY2l0eSIsICIxIik7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNjb3BlLnRvb2x0aXBGbGFnID0gZmFsc2U7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNjb3BlLiRhcHBseSgpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0pOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNpcmNsZS5hcHBlbmQoJ2Rlc2MnKS5hcHBlbmQoJ3RpdGxlJykudGV4dChmdW5jdGlvbiAoZCkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4oYWRkVGl0bGUoZCkpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0pOworCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgLy9EcmF3IExpbmUgQ2hhcnQKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBkcmF3Q2hhcnQuYXBwZW5kKCJwYXRoIikKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC5hdHRyKCJjbGFzcyIsICJsaW5lIikKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC5zdHlsZSgic3Ryb2tlIiwgbGluZUNvbG9yKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8uc3R5bGUoInN0cm9rZS1kYXNoYXJyYXkiLCAoYXJlYUNoYXJ0Q29uZmlnLmxpbmVTdHJva2UsIGFyZWFDaGFydENvbmZpZy5saW5lU3Ryb2tlKSkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC5hdHRyKCJkIiwgbGluZShkYXRhT2JqKSkuYXBwZW5kKCJ0aXRsZSIpLnRleHQoZnVuY3Rpb24gKCkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gc2NvcGUubGVnZW5kTGFiZWxbMV0uc2VyaWVzOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0pOworCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgLy9EcmF3IGRhdGEgcG9pbnRzIGZvciBMaW5lIENoYXJ0CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKCFvbGRJRSkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YXIgc3F1YXJlZG90ID0gZHJhd0NoYXJ0LnNlbGVjdEFsbCgiLnNxdWFyZS1kb3QiKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC5kYXRhKG5ld0RhdGFPYmopLmVudGVyKCkuYXBwZW5kKCJyZWN0IikKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAuYXR0cigidHJhbnNmb3JtIiwgInRyYW5zbGF0ZSgiICsgKGlzU2luZ2xlTW9udGggPT09IHRydWUpICogd2lkdGggLyAyICsgIiwwKSIpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLnN0eWxlKCJmaWxsIiwgc2NvcGUubGluZUxlZ2VuZENvbG9yKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC5hdHRyKCJjbGFzcyIsICJzcXVhcmUtZG90IikKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAuYXR0cigieCIsIGZ1bmN0aW9uIChkKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhciB0bXAgPSB4UmFuZ2UoZC5udW1lcmljTW9udGgpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0bXAgPSB0bXAgLSAyLjU7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiB0bXA7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAuYXR0cigieSIsIGZ1bmN0aW9uIChkKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhciB0bXAgPSB5UmFuZ2UoZC5hdmFpbGFibGUpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0bXAgPSB0bXAgLSAyLjU7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiB0bXA7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAuYXR0cigid2lkdGgiLCAiNXB4IikKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAuYXR0cigiaGVpZ2h0IiwgIjVweCIpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLm9uKCJtb3VzZW92ZXIiLCBmdW5jdGlvbiAoZCkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YXIgb2Zmc2V0WCA9IE1hdGguY2VpbChkMy5zZWxlY3QodGhpcykuYXR0cigieCIpKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2hvd190b29sdGlwX2dyaWRfbGluZShkMy5zZWxlY3QodGhpcykuYXR0cigieCIpLCAicmVjdCIsICJ4Iik7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhciBvZmZzZXRZID0gTWF0aC5yb3VuZChkMy5zZWxlY3QodGhpcykuYXR0cigieSIpKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZDMuc2VsZWN0KCdzdmcjJyArIGF0dHJzLmlkKS5zdHlsZSgiZmlsbC1vcGFjaXR5IiwgYXJlYUNoYXJ0Q29uZmlnLm9wYWNpdHlPbkhvdmVyKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbW91c2VPdmVyKGQsIG9mZnNldFgsIG9mZnNldFkpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0pLm9uKCJtb3VzZW91dCIsIGZ1bmN0aW9uICgpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGhpZGVfdG9vbHRpcF9ncmlkX2xpbmUoZDMuc2VsZWN0KHRoaXMpLmF0dHIoIngiKSwgInJlY3QiLCAieCIpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZDMuc2VsZWN0KCdzdmcjJyArIGF0dHJzLmlkKS5zdHlsZSgiZmlsbC1vcGFjaXR5IiwgIjEiKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNjb3BlLnRvb2x0aXBGbGFnID0gZmFsc2U7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzY29wZS4kYXBwbHkoKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNxdWFyZWRvdC5hcHBlbmQoJ2Rlc2MnKS5hcHBlbmQoJ3RpdGxlJykudGV4dChmdW5jdGlvbiAoZCkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuKGFkZFRpdGxlKGQpKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgICAgIGVsc2UgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBhcmVhUGF0aC5zdHlsZSgiZmlsbCIsIHN0YXJ0Q29sb3IpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YXIgc3F1YXJlRG90ID0gZHJhd0NoYXJ0LnNlbGVjdEFsbCgiLnNxdWFyZS1kb3QiKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC5kYXRhKG5ld0RhdGFPYmopLmVudGVyKCkuYXBwZW5kKCJjaXJjbGUiKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC5hdHRyKCJjbGFzcyIsICJzcXVhcmUtZG90IikKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAuYXR0cigidHJhbnNmb3JtIiwgInRyYW5zbGF0ZSgiICsgKGlzU2luZ2xlTW9udGggPT09IHRydWUpICogd2lkdGggLyAyICsgIiwwKSIpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLnN0eWxlKCJmaWxsIiwgc2NvcGUuYXJlYUxlZ2VuZENvbG9yKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC5hdHRyKCJyIiwgYXJlYUNoYXJ0Q29uZmlnLmNpcmNsZVJhZGl1cykKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAuYXR0cigiY3giLCBmdW5jdGlvbiAoZCkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4geFJhbmdlKGQubnVtZXJpY01vbnRoKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9KQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC5hdHRyKCJjeSIsIGZ1bmN0aW9uIChkKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiB5UmFuZ2UoZC5hdmFpbGFibGUpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0pLm9uKCJtb3VzZW92ZXIiLCBmdW5jdGlvbiAoZCkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFyIG9mZnNldFggPSBNYXRoLmNlaWwoZDMuc2VsZWN0KHRoaXMpLmF0dHIoImN4IikpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFyIG9mZnNldFkgPSBNYXRoLnJvdW5kKGQzLnNlbGVjdCh0aGlzKS5hdHRyKCJjeSIpKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNob3dfdG9vbHRpcF9ncmlkX2xpbmUoZDMuc2VsZWN0KHRoaXMpLmF0dHIoImN4IiksICJjaXJjbGUiLCAiY3giKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGQzLnNlbGVjdCgnc3ZnIycgKyBhdHRycy5pZCkuc3R5bGUoImZpbGwtb3BhY2l0eSIsIGFyZWFDaGFydENvbmZpZy5vcGFjaXR5T25Ib3Zlcik7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBtb3VzZU92ZXIoZCwgb2Zmc2V0WCwgb2Zmc2V0WSk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0pLm9uKCJtb3VzZW91dCIsIGZ1bmN0aW9uICgpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGhpZGVfdG9vbHRpcF9ncmlkX2xpbmUoZDMuc2VsZWN0KHRoaXMpLmF0dHIoImN4IiksICJjaXJjbGUiLCAiY3giKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGQzLnNlbGVjdCgnc3ZnIycgKyBhdHRycy5pZCkuc3R5bGUoImZpbGwtb3BhY2l0eSIsICIxIik7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzY29wZS50b29sdGlwRmxhZyA9IGZhbHNlOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2NvcGUuJGFwcGx5KCk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0pOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzcXVhcmVEb3QuYXBwZW5kKCdkZXNjJykuYXBwZW5kKCd0aXRsZScpLnRleHQoZnVuY3Rpb24gKGQpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybihhZGRUaXRsZShkKSk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0pOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KKworICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vRHJhdyBZIEF4aXMKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YXIgeUF4aXNOb2RlcyA9IGRyYXdDaGFydC5hcHBlbmQoImciKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLmF0dHIoImNsYXNzIiwgInkgYXhpcyIpLmF0dHIoImlkIiwgInlBeGlzSWQiKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLmNhbGwoeUF4aXMpOworCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgeUF4aXNOb2Rlcy5zZWxlY3RBbGwoInRleHQiKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLmF0dHIoImlkIiwgZnVuY3Rpb24gKGQsIGkpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gKCJ5QXhpc1RleHQiICsgaSk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9KTsKKworICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vQXBwZW5kIFllYXIgTGFiZWwgCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgeUF4aXNOb2Rlcy5hcHBlbmQoInRleHQiKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLmF0dHIoInRyYW5zZm9ybSIsICJyb3RhdGUoMCkiKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLmF0dHIoInkiLCBhcmVhQ2hhcnRDb25maWcueWVhckxhYmVsUG9zWzFdKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLmF0dHIoIngiLCBhcmVhQ2hhcnRDb25maWcueWVhckxhYmVsUG9zWzBdKS5hdHRyKCJjbGFzcyIsICJ5ZWFyTGFiZWwiKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLnRleHQoeWVhckxhYmVsKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAvL1JlbW92ZSBtaW5pbXVtIHZhbHVlIGxhYmVsIGZvcm0gWSBBeGlzCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgZHJhd0NoYXJ0LnNlbGVjdCgiI3lBeGlzVGV4dDAiKS5yZW1vdmUoKTsKKworICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vIERyYXcgdGhlIHggR3JpZCBsaW5lcworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRyYXdDaGFydC5hcHBlbmQoImciKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLmF0dHIoImNsYXNzIiwgImdyaWQiKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLmF0dHIoImlkIiwgInhHcmlkIikKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC5hdHRyKCJ0cmFuc2Zvcm0iLCAidHJhbnNsYXRlKCIgKyAoaXNTaW5nbGVNb250aCA9PT0gdHJ1ZSkgKiB3aWR0aCAvIDIgKyAiLDApIikKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC5jYWxsKG1ha2VfeF9heGlzKCkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLnRpY2tTaXplKC1oZWlnaHQsIDApCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC50aWNrRm9ybWF0KCIiKSk7CisKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyBmdW5jdGlvbiBmb3IgdGhlIHggZ3JpZCBsaW5lcworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZ1bmN0aW9uIG1ha2VfeF9heGlzKCkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gZDMuc3ZnLmF4aXMoKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC5zY2FsZSh4UmFuZ2UpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLm9yaWVudCgidG9wIikKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAudGlja0Zvcm1hdChkMy50aW1lLmZvcm1hdCgnJWInKSkudGlja3MoZDMudGltZS5tb250aHMpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KKworICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vZHJhd0NoYXJ0LnNlbGVjdCgiI3hHcmlkIikuc2VsZWN0QWxsKCJsaW5lIikuc3R5bGUoInN0cm9rZSIsIGFyZWFDaGFydENvbmZpZy5ncmlkTGluZUNvbG9yKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBkcmF3Q2hhcnQuc2VsZWN0KCIjeEdyaWQiKS5zZWxlY3RBbGwoImxpbmUiKS5zdHlsZSgic3Ryb2tlIiwgIm5vbmUiKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBkcmF3Q2hhcnQuc2VsZWN0KCIjeEdyaWQiKS5zZWxlY3RBbGwoImxpbmUiKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLmF0dHIoImlkIiwgZnVuY3Rpb24gKGQsIGkpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gKCJ4QXhpc0xpbmUiICsgaSk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9KTsKKworICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vQWRkIHRpdGxlIGZvciBOVkRBIHNjcmVlbiByZWFkZXIKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBmdW5jdGlvbiBhZGRUaXRsZShkKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiAodG9vbHRpcEZvcm1hdChkLm51bWVyaWNNb250aCkgKyAiVXNlZCIgKyBkLnVzYWdlICsgZC51c2FnZURhdGFUeXBlICsgIkF2YWlsYWJsZSIgKyBkLmF2YWlsYWJsZSArIGQuYXZhaWxhYmxlRGF0YVR5cGUpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KKworICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vU2hvdyBHcmlkbGluZSBvbiBNb3VzZSBIb3ZlciAgICAgICAgCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgZnVuY3Rpb24gc2hvd190b29sdGlwX2dyaWRfbGluZShvZmZzZXRYLCBzaGFwZSwgYXR0cikgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0cnkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZm9yICh2YXIgaSA9IDA7IGkgPCB4QXhpc3RpY2tzOyBpKyspIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YXIgY2lyY2xlID0gZHJhd0NoYXJ0LnNlbGVjdEFsbChzaGFwZSk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGNpcmNsZVswXVtpXS5nZXRBdHRyaWJ1dGUoYXR0cikgPT09IG9mZnNldFgpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZHJhd0NoYXJ0LnNlbGVjdCgiI3hBeGlzTGluZSIgKyBpKS5zdHlsZSgic3Ryb2tlIiwgYXJlYUNoYXJ0Q29uZmlnLmdyaWRMaW5lQ29sb3IpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSBjYXRjaCAoZSkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQorCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgLy9IaWRlIEdyaWRsaW5lIG9uIE1vdXNlIEhvdmVyICAKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBmdW5jdGlvbiBoaWRlX3Rvb2x0aXBfZ3JpZF9saW5lKG9mZnNldFgsIHNoYXBlLCBhdHRyKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRyeSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBmb3IgKHZhciBpID0gMDsgaSA8IHhBeGlzdGlja3M7IGkrKykgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhciBjaXJjbGUgPSBkcmF3Q2hhcnQuc2VsZWN0QWxsKHNoYXBlKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoY2lyY2xlWzBdW2ldLmdldEF0dHJpYnV0ZShhdHRyKSA9PT0gb2Zmc2V0WCkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBkcmF3Q2hhcnQuc2VsZWN0KCIjeEF4aXNMaW5lIiArIGkpLnN0eWxlKCJzdHJva2UiLCAidHJhbnNwYXJlbnQiKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0gY2F0Y2ggKGUpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KKworICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vTW91c2UgSG92ZXIKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBmdW5jdGlvbiBtb3VzZU92ZXIoZCwgb2Zmc2V0WCwgb2Zmc2V0WSkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzY29wZS51bmRlcmFnZUZsYWcgPSBmYWxzZTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2NvcGUub3ZlcmFnZUZsYWcgPSBmYWxzZTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGQudXNhZ2UgPiBkLmF2YWlsYWJsZSkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2NvcGUub3ZlcmFnZUZsYWcgPSB0cnVlOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChkLnVzYWdlIDwgZC5hdmFpbGFibGUpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNjb3BlLnVuZGVyYWdlRmxhZyA9IHRydWU7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2NvcGUuZGF0YVBvaW50ID0geyJ4RGF0YSI6IHRvb2x0aXBGb3JtYXQoZC5udW1lcmljTW9udGgpLnJlcGxhY2UoJy0nLCAnICcpLCAiZGF0YVVzZWQiOiBkLnVzYWdlLCAiZGF0YUF2YWlsYWJsZSI6IGQuYXZhaWxhYmxlLCAib3ZlcmFnZSI6IGQub3ZlcmFnZSwgInVzYWdlRGF0YVR5cGUiOiBkLnVzYWdlRGF0YVR5cGUsICJhdmFpbGFibGVEYXRhVHlwZSI6IGQuYXZhaWxhYmxlRGF0YVR5cGUsICJ1bmRlcmFnZSI6IGQudW5kZXJhZ2V9OworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzY29wZS4kYXBwbHkoKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJHRpbWVvdXQoZnVuY3Rpb24gKCkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgb2Zmc2V0WSA9IG9mZnNldFkgLSBhcmVhQ2hhcnRDb25maWcudG9vbHRpcFRvcE1hcmdpbjsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhciB0b29sdGlwRWwgPSBlbGVtZW50LmNoaWxkcmVuKCkuZXEoMik7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YXIgdG9vbHRpcFdpZHRoID0gdG9vbHRpcEVsWzBdLm9mZnNldFdpZHRoOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGlzU2luZ2xlTW9udGgpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBvZmZzZXRYID0gb2Zmc2V0WCAtICh0b29sdGlwV2lkdGggLyAyKSArIGFyZWFDaGFydENvbmZpZy50b29sdGlwTGVmdE1hcmdpbiArICh3aWR0aCAvIDIpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBvZmZzZXRYID0gb2Zmc2V0WCAtICh0b29sdGlwV2lkdGggLyAyKSArIGFyZWFDaGFydENvbmZpZy50b29sdGlwTGVmdE1hcmdpbjsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNjb3BlLnRvb2x0aXBTdHlsZSA9IHsibGVmdCI6IG9mZnNldFggKyAicHgiLCAidG9wIjogb2Zmc2V0WSArICJweCJ9OworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2NvcGUudG9vbHRpcEZsYWcgPSB0cnVlOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9LDApOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBzY29wZS5yZWZyZXNoQ2hhcnQgPSBmYWxzZTsKKyAgICAgICAgICAgICAgICAgICAgICAgIH0pOworICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgfTsKKyAgICAgICAgICAgIH1dKQorICAgICAgICAuZmlsdGVyKCdmaWx0ZXJJbnB1dCcsIGZ1bmN0aW9uICgpIHsKKyAgICAgICAgICAgIHJldHVybiBmdW5jdGlvbiAoaW5wdXQpIHsKKyAgICAgICAgICAgICAgICByZXR1cm4gaW5wdXQucmVwbGFjZSgvICsvZywgIiIpLnRvTG93ZXJDYXNlKCk7CisgICAgICAgICAgICB9OworICAgICAgICB9KTsKK2FuZ3VsYXIubW9kdWxlKCdhdHQuY2hhcnRzLmJhcmNoYXJ0RDMnLCBbJ2F0dC5jaGFydHMudXRpbGl0aWVzJ10pCisgICAgICAgIAorICAgICAgICAuY29uc3RhbnQoIkJhckNoYXJ0RDNDb25maWciLAorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgImJhckNoYXJ0Q29sb3IiOiAiIzAwODFDMiIsCisgICAgICAgICAgICAgICAgICAgICJncmlkTGluZUNvbG9yIjogIiM4MDgwODAiLAorCQkJCQkieWF4aXNHcmlkTGluZUNvbG9yIjogIiMwMDAwMDAiLAorICAgICAgICAgICAgICAgICAgICAibWFyZ2luIjogeworICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRvcCAgOiA0MCwgCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmlnaHQ6IDIwLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJvdHRvbTogMzAsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgbGVmdDogNDAKKyAgICAgICAgICAgICAgICAgICAgfSwKKyAgICAgICAgICAgICAgICAgICAgImF0dHJpYnV0ZXMiOiB7CisgICAgICAgICAgICAgICAgICAgICAgICAidXNlck5hbWUiOiAibmFtZSIsCisgICAgICAgICAgICAgICAgICAgICAgICAicGhvbmVOdW1iZXIiOiAicGhvbmVOdW1iZXIiLAorICAgICAgICAgICAgICAgICAgICAgICAgImNoYXJnZXMiOiAiY2hhcmdlcyIKKyAgICAgICAgICAgICAgICAgICAgfSwKKyAgICAgICAgICAgICAgICAgICAgInlBeGlzTWF4VGlja3MiOiA0LAorICAgICAgICAgICAgICAgICAgICAiY2hhcnRIZWlnaHQiOiAxNjAsCisgICAgICAgICAgICAgICAgICAgICJhbW91bnRGb3JtYXQiIDogIiQwLDAwMCIsCisgICAgICAgICAgICAgICAgICAgICJhbW91bnRLRGl2aXNpb24iIDogMTAwMCwKKyAgICAgICAgICAgICAgICAgICAgImFtb3VudEtUZXh0IiA6ICJLIiwKKyAgICAgICAgICAgICAgICAgICAgImFtb3VudE1EaXZpc2lvbiIgOiAxMDAwMDAwLCAgICAKKyAgICAgICAgICAgICAgICAgICAgImFtb3VudE1UZXh0IiA6ICJNIiwKKyAgICAgICAgICAgICAgICAgICAgInhBeGlzdGlja1NpemUiOjAsCisgICAgICAgICAgICAgICAgICAgICJ0b29sdGlwVG9wTWFyZ2luIjo2OSwKKyAgICAgICAgICAgICAgICAgICAgInRvb2x0aXBMZWZ0TWFyZ2luIjo1OSwKKyAgICAgICAgICAgICAgICAgICAgInhBeGlzVGV4dFRvcE1hcmdpbiI6MTUsCisgICAgICAgICAgICAgICAgICAgICJ4QXhpc1RleHRMZWZ0TWFyZ2luIjo3LAorICAgICAgICAgICAgICAgICAgICAiYmFyQ2hhcnRTaXplIjoyNSwKKyAgICAgICAgICAgICAgICAgICAgImJhckhvdmVyT3BhY2l0eSI6MC4yCisgICAgICAgICAgICAgICAgfSkgCisgICAgICAgICAgICAgICAgCisgICAgICAgIC5kaXJlY3RpdmUoJ2F0dEJhckNoYXJ0JywgWydCYXJDaGFydEQzQ29uZmlnJywnJGV4dGVuZE9iaicsIGZ1bmN0aW9uKEJhckNoYXJ0RDNDb25maWcsJGV4dGVuZE9iaikgeworICAgICAgICAgICAgICAgIHJldHVybiB7CisgICAgICAgICAgICAgICAgICAgIHJlc3RyaWN0OiAnQScsCisgICAgICAgICAgICAgICAgICAgIHNjb3BlOiB7CisgICAgICAgICAgICAgICAgICAgICAgICBjaGFydERhdGE6ICc9JywKKyAgICAgICAgICAgICAgICAgICAgICAgIGNoYXJ0Q29uZmlnOiAnPScsCisgICAgICAgICAgICAgICAgICAgICAgICByZWZyZXNoQ2hhcnQ6ICI9IgorICAgICAgICAgICAgICAgICAgICB9LCAgICAgICAgICAgICAgICAgICAKKyAgICAgICAgICAgICAgICAgICAgdGVtcGxhdGVVcmw6ICJ0ZW1wbGF0ZS9iYXJjaGFydEQzL2F0dEJhckNoYXJ0RDMuaHRtbCIsCisgICAgICAgICAgICAgICAgICAgIHJlcGxhY2U6IHRydWUsCisgICAgICAgICAgICAgICAgICAgIGxpbms6IGZ1bmN0aW9uKHNjb3BlLCBlbGVtZW50LCBhdHRycywgY3RybCkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCisgICAgICAgICAgICAgICAgICAgICAgICBzY29wZS4kd2F0Y2goJ3JlZnJlc2hDaGFydCcsIGZ1bmN0aW9uKCkgeworICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGFuZ3VsYXIuaXNEZWZpbmVkKHNjb3BlLmNoYXJ0Q29uZmlnKSkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBCYXJDaGFydEQzQ29uZmlnID0gJGV4dGVuZE9iai5leHRlbmREZWVwKEJhckNoYXJ0RDNDb25maWcsIHNjb3BlLmNoYXJ0Q29uZmlnKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIH0KKworICAgICAgICAgICAgICAgICAgICAgICAgdmFyIHdpZHRoID0gcGFyc2VJbnQoYXR0cnMuY2hhcnRXaWR0aCwgMTApLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNoYXJ0Q29sb3IgPSBCYXJDaGFydEQzQ29uZmlnLmJhckNoYXJ0Q29sb3IsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgaGVpZ2h0ID0gQmFyQ2hhcnREM0NvbmZpZy5jaGFydEhlaWdodCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB1c2VyTmFtZSA9IEJhckNoYXJ0RDNDb25maWcuYXR0cmlidXRlcy51c2VyTmFtZSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBjaGFyZ2VzID0gQmFyQ2hhcnREM0NvbmZpZy5hdHRyaWJ1dGVzLmNoYXJnZXMsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgcGhvbmVOdW1iZXIgPSBCYXJDaGFydEQzQ29uZmlnLmF0dHJpYnV0ZXMucGhvbmVOdW1iZXIsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgZm9ybWF0Q2hhcmdlcyA9IGQzLmZvcm1hdChCYXJDaGFydEQzQ29uZmlnLmFtb3VudEZvcm1hdCksCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgaXNTaW5nbGVEYXRhT2JqID0gZmFsc2UsIHBhZGRpbmcgPSAyMDsKKyAgICAgICAgICAgICAgICAgICAgICAgIHZhciBiYXJDaGFydERhdGEsIHlEb21haW5EYXRhID0gW10seUF4aXNEYXRhID0gW107CisgICAgICAgICAgICAgICAgICAgICAgICBzY29wZS50b29sdGlwRmxhZyA9IGZhbHNlOworICAgICAgICAgICAgICAgICAgICAgICAgdmFyIGNvbXBhcmUgPSBmdW5jdGlvbiBjb21wYXJlKGEsIGIpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAocGFyc2VJbnQoYVtjaGFyZ2VzXSwgMTApID4gcGFyc2VJbnQoYltjaGFyZ2VzXSwgMTApKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiAtMTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHBhcnNlSW50KGFbY2hhcmdlc10sIDEwKSA8IHBhcnNlSW50KGJbY2hhcmdlc10sIDEwKSkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gMTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIDA7CisgICAgICAgICAgICAgICAgICAgICAgICB9OworCisKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBkMy5zZWxlY3QoInN2ZyMiICsgYXR0cnMuaWQpLnJlbW92ZSgpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGQzLnNlbGVjdEFsbCgic3ZnIyIgKyBhdHRycy5pZCArICIgPiAqIikucmVtb3ZlKCk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgZDMuc2VsZWN0QWxsKCJkaXYjYmFyQ2hhcnRDb250YWluZXIiICsgIiA+IGRpdiIpLnJlbW92ZSgpOworCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgYmFyQ2hhcnREYXRhID0gc2NvcGUuY2hhcnREYXRhLnNvcnQoY29tcGFyZSk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgYmFyQ2hhcnREYXRhID0gYmFyQ2hhcnREYXRhLnNsaWNlKDAsQmFyQ2hhcnREM0NvbmZpZy5iYXJDaGFydFNpemUpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChiYXJDaGFydERhdGEubGVuZ3RoID09PSAxKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlzU2luZ2xlRGF0YU9iaiA9IHRydWU7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhciB4ID0gZDMuc2NhbGUub3JkaW5hbCgpLnJhbmdlQmFuZHMoWzAsIHdpZHRoXSk7CisKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YXIgeSA9IGQzLnNjYWxlLmxpbmVhcigpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAucmFuZ2UoW2hlaWdodCwgMF0pOworCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgeC5kb21haW4oYmFyQ2hhcnREYXRhLm1hcChmdW5jdGlvbihkLCBpKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBpICsgMTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB9KSk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBmb3IodmFyIGI9MDsgYiA8IGJhckNoYXJ0RGF0YS5sZW5ndGg7IGIrKyl7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhciB2YWwgPSBNYXRoLnJvdW5kKHBhcnNlSW50KGJhckNoYXJ0RGF0YVtiXS5jaGFyZ2VzLCAxMCkvQmFyQ2hhcnREM0NvbmZpZy55QXhpc01heFRpY2tzKTsgCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhciBDYWxjID0gIE1hdGguY2VpbCgodmFsIC8gTWF0aC5wb3coMTAsICgiIiArIHZhbCkubGVuZ3RoIC0gMSkpKSAqIChCYXJDaGFydEQzQ29uZmlnLnlBeGlzTWF4VGlja3MpICogTWF0aC5wb3coMTAsICgiIiArIHZhbCkubGVuZ3RoIC0gMSk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHlEb21haW5EYXRhLnB1c2goeyd5QXhpc1ZhbCc6Q2FsY30pOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAvL1ktQXhpcyBEb21haW4KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB5LmRvbWFpbihbMCwgZDMubWF4KHlEb21haW5EYXRhLCBmdW5jdGlvbihkKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiAoZC55QXhpc1ZhbCk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSldKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YXIgeVRpY2sgPSBkMy5tYXgoeURvbWFpbkRhdGEsIGZ1bmN0aW9uKGQpIHtyZXR1cm4gZC55QXhpc1ZhbDt9KTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB5VGljayA9IHlUaWNrL0JhckNoYXJ0RDNDb25maWcueUF4aXNNYXhUaWNrczsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBmb3IodmFyIHogPSAwOyB6IDw9IEJhckNoYXJ0RDNDb25maWcueUF4aXNNYXhUaWNrczsgeisrKXsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgeUF4aXNEYXRhLnB1c2goeVRpY2sgKiB6KTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFyIGZvcm1hdE1vbmV5ID0gZnVuY3Rpb24oZCkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoZCA+PSBCYXJDaGFydEQzQ29uZmlnLmFtb3VudE1EaXZpc2lvbikgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuICIkIiArIGQgLyBCYXJDaGFydEQzQ29uZmlnLmFtb3VudE1EaXZpc2lvbiArIEJhckNoYXJ0RDNDb25maWcuYW1vdW50TVRleHQ7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0gIGVsc2UgaWYgKGQgPj0gQmFyQ2hhcnREM0NvbmZpZy5hbW91bnRLRGl2aXNpb24pIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiAiJCIgKyBkIC8gQmFyQ2hhcnREM0NvbmZpZy5hbW91bnRLRGl2aXNpb24gKyBCYXJDaGFydEQzQ29uZmlnLmFtb3VudEtUZXh0OworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuICIkIiArIGQ7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB9OworCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFyIHhBeGlzID0gZDMuc3ZnLmF4aXMoKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLnNjYWxlKHgpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAub3JpZW50KCJib3R0b20iKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLnRpY2tTaXplKEJhckNoYXJ0RDNDb25maWcueEF4aXN0aWNrU2l6ZSk7CisKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YXIgeUF4aXMgPSBkMy5zdmcuYXhpcygpLnNjYWxlKHkpLm9yaWVudCgibGVmdCIpLnRpY2tWYWx1ZXMoeUF4aXNEYXRhKS50aWNrcyhCYXJDaGFydEQzQ29uZmlnLnlBeGlzTWF4VGlja3MpLnRpY2tGb3JtYXQoZm9ybWF0TW9uZXkpOworCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFyIHN2ZyA9IGQzLnNlbGVjdCgiI2JhckNoYXJ0Q29udGFpbmVyIikKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC5hcHBlbmQoInN2ZyIpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAuYXR0cigiaWQiLCBhdHRycy5pZCkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC5hdHRyKCJ3aWR0aCIsIHdpZHRoICsgQmFyQ2hhcnREM0NvbmZpZy5tYXJnaW4ubGVmdCArIEJhckNoYXJ0RDNDb25maWcubWFyZ2luLnJpZ2h0KQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLmF0dHIoImhlaWdodCIsIGhlaWdodCArIEJhckNoYXJ0RDNDb25maWcubWFyZ2luLnRvcCArIEJhckNoYXJ0RDNDb25maWcubWFyZ2luLmJvdHRvbSkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC5hcHBlbmQoImciKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLmF0dHIoInRyYW5zZm9ybSIsICJ0cmFuc2xhdGUoIiArIEJhckNoYXJ0RDNDb25maWcubWFyZ2luLmxlZnQgKyAiLCIgKyBCYXJDaGFydEQzQ29uZmlnLm1hcmdpbi50b3AgKyAiKSIpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIHN2Zy5hcHBlbmQoImciKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLmF0dHIoImNsYXNzIiwgInggYXhpcyIpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAuYXR0cigidHJhbnNmb3JtIiwgInRyYW5zbGF0ZSgiICsgLU1hdGguY2VpbCgoeCgyKSAtIHgoMSkpIC8gMiAtIEJhckNoYXJ0RDNDb25maWcueEF4aXNUZXh0VG9wTWFyZ2luKSArICIsIiArIChoZWlnaHQgKyBCYXJDaGFydEQzQ29uZmlnLnhBeGlzVGV4dExlZnRNYXJnaW4pICsgIikiKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLmNhbGwoeEF4aXMpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhciBmb3JtYXRQaE51bWJlciA9IGZ1bmN0aW9uKHBob25lTnVtKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChwaG9uZU51bS5pbmRleE9mKCItIikgPT09IC0xKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gcGhvbmVOdW0uc3Vic3RyKDAsIDMpICsgJy0nICsgcGhvbmVOdW0uc3Vic3RyKDMsIDMpICsgJy0nICsgcGhvbmVOdW0uc3Vic3RyKDYpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHBob25lTnVtOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgfTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YXIgcmVjdEJhckdyb3VwID0gc3ZnLmFwcGVuZCgiZyIpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAuYXR0cigiY2xhc3MiLCAiZ3JvdXAiKS5hdHRyKCJpZCIsIGZ1bmN0aW9uIChkLCBpKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiAoImJhckdyb3VwIiArIGkpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0pLmF0dHIoInRyYW5zZm9ybSIsICJ0cmFuc2xhdGUoIiArIChpc1NpbmdsZURhdGFPYmogPT09IHRydWU/ICgod2lkdGggLyAyKSArIDExKToxMCkgKyAiLDApIik7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFyIHJlY3RCYXJzID0gcmVjdEJhckdyb3VwLnNlbGVjdEFsbCgiLmJhciIpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAuZGF0YShiYXJDaGFydERhdGEpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAuZW50ZXIoKS5hcHBlbmQoInJlY3QiKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLmF0dHIoInN0eWxlIiwgImZpbGw6IiArIGNoYXJ0Q29sb3IpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAuYXR0cigiY2xhc3MiLCAiYmFyIikKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC5hdHRyKCJ4IiwgZnVuY3Rpb24oZCwgaSkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBNYXRoLnJvdW5kKHgoaSArIDEpKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0pCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAuYXR0cigid2lkdGgiLCAxMCkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC5hdHRyKCJ5IiwgZnVuY3Rpb24oZCkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiB5KGRbY2hhcmdlc10pOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC5hdHRyKCJoZWlnaHQiLCBmdW5jdGlvbihkKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiAoaGVpZ2h0IC0geShkW2NoYXJnZXNdKSk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9KQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLm9uKCJtb3VzZW92ZXIiLCBmdW5jdGlvbihkKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFyIG9mZnNldFggPSBNYXRoLnJvdW5kKGQzLnNlbGVjdCh0aGlzKS5hdHRyKCJ4IikpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNob3dfdG9vbHRpcF9ncmlkX2xpbmUob2Zmc2V0WCk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFyIG9mZnNldFkgPSBNYXRoLnJvdW5kKGQzLnNlbGVjdCh0aGlzKS5hdHRyKCJ5IikpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHN2Zy5zZWxlY3QoIi5ncmlkIikuc2VsZWN0QWxsKCJsaW5lIikuc3R5bGUoInN0cm9rZSIsICJ0cmFuc3BhcmVudCIpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHN2Zy5zZWxlY3RBbGwoIi5iYXIiKS5zdHlsZSgiZmlsbC1vcGFjaXR5IixCYXJDaGFydEQzQ29uZmlnLmJhckhvdmVyT3BhY2l0eSk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZDMuc2VsZWN0KHRoaXMpLnN0eWxlKCJmaWxsLW9wYWNpdHkiLCIxIik7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbW91c2VPdmVyKGQsIG9mZnNldFgsIG9mZnNldFkpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC5vbigibW91c2VvdXQiLCBmdW5jdGlvbigpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YXIgb2Zmc2V0WCA9IE1hdGgucm91bmQoZDMuc2VsZWN0KHRoaXMpLmF0dHIoIngiKSk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaGlkZV90b29sdGlwX2dyaWRfbGluZShvZmZzZXRYKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzY29wZS50b29sdGlwRmxhZyA9IGZhbHNlOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHN2Zy5zZWxlY3QoIi5ncmlkIikuc2VsZWN0QWxsKCJsaW5lIikuc3R5bGUoInN0cm9rZSIsIEJhckNoYXJ0RDNDb25maWcuZ3JpZExpbmVDb2xvcik7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc3ZnLnNlbGVjdEFsbCgiLmJhciIpLnN0eWxlKCJmaWxsLW9wYWNpdHkiLCIxIik7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2NvcGUuJGFwcGx5KCk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9KTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICByZWN0QmFycy5hcHBlbmQoJ2Rlc2MnKS5hcHBlbmQoJ3RpdGxlJykudGV4dChmdW5jdGlvbihkKXsgcmV0dXJuIChkW3VzZXJOYW1lXSArICItLSBXaXJlbGVzcyBOdW1iZXIiICsgZm9ybWF0UGhOdW1iZXIoZFtwaG9uZU51bWJlcl0pICsgIkNoYXJnZXMtIiArIGRbY2hhcmdlc10pO30pOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhciB5QXhpc05vZGVzID0gc3ZnLmFwcGVuZCgiZyIpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAuYXR0cigiY2xhc3MiLCAieSBheGlzIikKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC5jYWxsKHlBeGlzKTsKKworICAgICAgICAgICAgICAgICAgICAgICAgICAgIHlBeGlzTm9kZXMuc2VsZWN0QWxsKCJ0ZXh0IikKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC5hdHRyKCJpZCIsIGZ1bmN0aW9uKGQsIGkpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gKCJ5QXhpc1RleHQiICsgaSk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9KTsKKworICAgICAgICAgICAgICAgICAgICAgICAgICAgIHlBeGlzTm9kZXMuc2VsZWN0QWxsKCJsaW5lIikKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC5hdHRyKCJpZCIsIGZ1bmN0aW9uKGQsIGkpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gKCJ5QXhpc0xpbmUiICsgaSk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9KTsKKworICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vUmVtb3ZlIG1pbmltdW0gdmFsdWUgbGFiZWwgZm9ybSBZIEF4aXMKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBkMy5zZWxlY3QoIiN5QXhpc1RleHQwIikucmVtb3ZlKCk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgZDMuc2VsZWN0KCIjeUF4aXNMaW5lMCIpLnJlbW92ZSgpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIHlBeGlzTm9kZXMuc2VsZWN0KCJwYXRoIikucmVtb3ZlKCk7CisKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyBEcmF3IHRoZSB5IEdyaWQgbGluZXMKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBzdmcuYXBwZW5kKCJnIikKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLmF0dHIoImNsYXNzIiwgImdyaWQiKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAuYXR0cigidHJhbnNmb3JtIiwgInRyYW5zbGF0ZSgwLDApIikKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLmNhbGwobWFrZV95X2F4aXMoKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC50aWNrU2l6ZSgtd2lkdGggKyB4KDIpIC0geCgxKSwgMCwgMCkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAudGlja0Zvcm1hdCgiIikpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIHN2Zy5zZWxlY3QoIi5ncmlkIikuc2VsZWN0QWxsKCJsaW5lIikuc3R5bGUoInN0cm9rZSIsIEJhckNoYXJ0RDNDb25maWcuZ3JpZExpbmVDb2xvcik7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gZnVuY3Rpb24gZm9yIHRoZSB5IGdyaWQgbGluZXMKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBmdW5jdGlvbiBtYWtlX3lfYXhpcygpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGQzLnN2Zy5heGlzKCkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAuc2NhbGUoeSkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAub3JpZW50KCJsZWZ0IikKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAudGlja3MoQmFyQ2hhcnREM0NvbmZpZy55QXhpc01heFRpY2tzKS50aWNrVmFsdWVzKHlBeGlzRGF0YSk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vIERyYXcgdGhlIHggR3JpZCBsaW5lcworICAgICAgICAgICAgICAgICAgICAgICAgICAgIHN2Zy5hcHBlbmQoImciKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLmF0dHIoImNsYXNzIiwgImdyaWQiKS5hdHRyKCJpZCIsICJ4R3JpZCIpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAuY2FsbChtYWtlX3hfYXhpcygpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLnRpY2tTaXplKC1oZWlnaHQgLCAwKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC50aWNrRm9ybWF0KCIiKSkuc2VsZWN0QWxsKCJsaW5lIikuYXR0cigidHJhbnNmb3JtIiwgInRyYW5zbGF0ZSgiICsgLU1hdGguY2VpbCgoeCgyKSAtIHgoMSkpIC8gMiAtIEJhckNoYXJ0RDNDb25maWcueEF4aXNUZXh0VG9wTWFyZ2luKSArICIsMCkiKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLmF0dHIoImlkIiwgZnVuY3Rpb24gKGQsIGkpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gKCJ4QXhpc0xpbmUiICsgaSk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9KTsKKworICAgICAgICAgICAgICAgICAgICAgICAgICAgIAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vIGZ1bmN0aW9uIGZvciB0aGUgeCBncmlkIGxpbmVzCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgZnVuY3Rpb24gbWFrZV94X2F4aXMoKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBkMy5zdmcuYXhpcygpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLnNjYWxlKHgpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLm9yaWVudCgidG9wIikKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAudGlja3MoQmFyQ2hhcnREM0NvbmZpZy55QXhpc01heFRpY2tzKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgc3ZnLnNlbGVjdCgiI3hHcmlkIikuc2VsZWN0QWxsKCJsaW5lIikKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC5hdHRyKCJpZCIsIGZ1bmN0aW9uKGQsIGkpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gKCJ4QXhpc0xpbmUiICsgaSk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9KTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZ1bmN0aW9uIHNob3dfdG9vbHRpcF9ncmlkX2xpbmUob2Zmc2V0WCl7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBmb3IgKHZhciBpID0gMDsgaSA8IGJhckNoYXJ0RGF0YS5sZW5ndGg7IGkrKykgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmKE1hdGgucm91bmQoeChpKzEpKT09PW9mZnNldFgpeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzdmcuc2VsZWN0KCIjeEF4aXNMaW5lIitpKS5zdHlsZSgic3Ryb2tlIiwgQmFyQ2hhcnREM0NvbmZpZy55YXhpc0dyaWRMaW5lQ29sb3IpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBmdW5jdGlvbiBoaWRlX3Rvb2x0aXBfZ3JpZF9saW5lKG9mZnNldFgpeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZm9yICh2YXIgaSA9IDA7IGkgPCBiYXJDaGFydERhdGEubGVuZ3RoOyBpKyspIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZihNYXRoLnJvdW5kKHgoaSsxKSk9PT1vZmZzZXRYKXsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc3ZnLnNlbGVjdCgiI3hBeGlzTGluZSIraSkuc3R5bGUoInN0cm9rZSIsICJ0cmFuc3BhcmVudCIpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBmdW5jdGlvbiBtb3VzZU92ZXIoZCwgb2Zmc2V0WCwgb2Zmc2V0WSkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBvZmZzZXRZID0gb2Zmc2V0WSAtIEJhckNoYXJ0RDNDb25maWcudG9vbHRpcFRvcE1hcmdpbjsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGlzU2luZ2xlRGF0YU9iaikgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgb2Zmc2V0WCA9IG9mZnNldFggLSBCYXJDaGFydEQzQ29uZmlnLnRvb2x0aXBMZWZ0TWFyZ2luICsgKHdpZHRoIC8gMik7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBvZmZzZXRYID0gb2Zmc2V0WCAtIEJhckNoYXJ0RDNDb25maWcudG9vbHRpcExlZnRNYXJnaW47CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2NvcGUudG9vbHRpcEZsYWcgPSB0cnVlOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzY29wZS50b29sdGlwU3R5bGUgPSB7ImxlZnQiOiBvZmZzZXRYICsgInB4IiwgInRvcCI6IG9mZnNldFkgKyAicHgifTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2NvcGUuZGF0YVBvaW50ID0geyJuYW1lIjogZFt1c2VyTmFtZV0sICJwaG9uZU51bWJlciI6IGZvcm1hdFBoTnVtYmVyKGRbcGhvbmVOdW1iZXJdKSwgImNoYXJnZXMiOiBmb3JtYXRDaGFyZ2VzKGRbY2hhcmdlc10pfTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2NvcGUuJGFwcGx5KCk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNjb3BlLnJlZnJlc2hDaGFydCA9IGZhbHNlOworICAgICAgICAgICAgICAgICAgICAgICAgfSk7CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICB9OworICAgICAgICAgICAgfV0pOworYW5ndWxhci5tb2R1bGUoJ2F0dC5jaGFydHMuY29zY2hhcnREMycsIFsnYXR0LmNoYXJ0cy51dGlsaXRpZXMnXSkKKyAgICAgICAgLmNvbnN0YW50KCJDb3NDaGFydEQzQ29uZmlnIiwKKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgICJjaGFydGNvbG9yIjogeworICAgICAgICAgICAgICAgICAgICAgICAgInBhbGV0dGVDb2xvcnMiOiBbIiMwOTdjYjUiLCAiI0ZFRkZGNyJdIC8vZGVmYXVsdCBjb2xvciBvcHRpb25zIGZvciByZW5kZXJpbmcgY2hhcnQgYmFzZUNvbG9yIGFuZCBOZWVkbGVDb2xvciwKKworICAgICAgICAgICAgICAgICAgICB9LAorICAgICAgICAgICAgICAgICAgICAiZGVmYXVsdGNlbnRlcmxhYmVsIjogIkNPUyAxIiwKKyAgICAgICAgICAgICAgICAgICAgImRlZmF1bHRjZW50ZXJjYXRlZ29yeSI6ICJSZWFsIFRpbWUiLAorICAgICAgICAgICAgICAgICAgICAiem9vbUxldmVsIjogIjI1IiwKKyAgICAgICAgICAgICAgICAgICAgImRvdWdobnV0cmF0aW8iOiAyMCwKKyAgICAgICAgICAgICAgICAgICAgImxlZ2VuZHJlcWQiOiAiZmFsc2UiLAorICAgICAgICAgICAgICAgICAgICAiYW5pbWR1cmF0aW9uIjogIjMwMCIsCisgICAgICAgICAgICAgICAgICAgICJsZWdlbmRwb3NpdGlvbiI6ICJ0b3AiLAorICAgICAgICAgICAgICAgICAgICAiY2VudGVyVGV4dFZhbHVlRHkiOiAiMCIsCisgICAgICAgICAgICAgICAgICAgICJjZW50ZXJUZXh0VmFsdWVEeCI6ICIwIiwKKyAgICAgICAgICAgICAgICAgICAgImNlbnRlclRleHRQZXJjZW50RHgiOiAiMjAiLAorICAgICAgICAgICAgICAgICAgICAiY2VudGVyVGV4dFBlcmNlbnREeSI6ICItMTAiLAorICAgICAgICAgICAgICAgICAgICAiY2VudGVyVGV4dExhYmVsRHkiOiAiMjAiLAorICAgICAgICAgICAgICAgICAgICAiY2VudGVyVGV4dExhYmVsRHgiOiAiMCIsCisgICAgICAgICAgICAgICAgICAgICJhcmNPdmVyTWFyZ2luIjogNQorICAgICAgICAgICAgICAgIH0pCisgICAgICAgIC5kaXJlY3RpdmUoJ2F0dENvc2QzQ2hhcnQnLCBbJ0Nvc0NoYXJ0RDNDb25maWcnLCAnJHRpbWVvdXQnLCckZXh0ZW5kT2JqJywgZnVuY3Rpb24gKENvc0NoYXJ0RDNDb25maWcsICR0aW1lb3V0LCRleHRlbmRPYmopIHsKKyAgICAgICAgICAgICAgICByZXR1cm4geworICAgICAgICAgICAgICAgICAgICByZXN0cmljdDogJ0EnLAorICAgICAgICAgICAgICAgICAgICBzY29wZTogeworICAgICAgICAgICAgICAgICAgICAgICAgY2hhcnRDb25maWc6ICc9JywKKyAgICAgICAgICAgICAgICAgICAgICAgIGluaXRWYWw6ICc9JworICAgICAgICAgICAgICAgICAgICB9LAorICAgICAgICAgICAgICAgICAgICB0ZW1wbGF0ZVVybDogJ3RlbXBsYXRlL2Nvc2NoYXJ0RDMvYXR0Q29zZDNDaGFydC5odG1sJywKKyAgICAgICAgICAgICAgICAgICAgdHJhbnNjbHVkZTogdHJ1ZSwKKyAgICAgICAgICAgICAgICAgICAgcmVwbGFjZTogdHJ1ZSwKKyAgICAgICAgICAgICAgICAgICAgY29udHJvbGxlcjogWyckc2NvcGUnLCAnJGF0dHJzJywgZnVuY3Rpb24gKCRzY29wZSwgJGF0dHJzKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGFuZ3VsYXIuaXNEZWZpbmVkKCRzY29wZS5jaGFydENvbmZpZykpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgQ29zQ2hhcnREM0NvbmZpZyA9ICRleHRlbmRPYmouZXh0ZW5kRGVlcChDb3NDaGFydEQzQ29uZmlnLCAkc2NvcGUuY2hhcnRDb25maWcpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YXIgbGVnZW5kQ29sb3IgPSBbXTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBsZWdlbmRDb2xvciA9IENvc0NoYXJ0RDNDb25maWcuY2hhcnRjb2xvci5wYWxldHRlQ29sb3JzOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICRzY29wZS5hZGRMZWdlbmRDb2xvciA9IGZ1bmN0aW9uICgpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHsiY29sb3IiOiBsZWdlbmRDb2xvclswXX07CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgfTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAkc2NvcGUuY2hhcnRJRCA9ICRhdHRycy5pZDsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoIWFuZ3VsYXIuaXNEZWZpbmVkKCRhdHRycy5sZWdlbmRSZXF1aXJlZCkpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJHNjb3BlLmxlZ2VuZFJlcXVpcmVkID0gQ29zQ2hhcnREM0NvbmZpZy5sZWdlbmRyZXFkOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICRzY29wZS5sZWdlbmRSZXF1aXJlZCA9ICRhdHRycy5sZWdlbmRSZXF1aXJlZDsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKCFhbmd1bGFyLmlzRGVmaW5lZCgkYXR0cnMubGVnZW5kUG9zaXRpb24pKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICRzY29wZS5sZWdlbmRQb3NpdGlvbiA9IENvc0NoYXJ0RDNDb25maWcubGVnZW5kcG9zaXRpb247CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJHNjb3BlLmxlZ2VuZFBvc2l0aW9uID0gJGF0dHJzLmxlZ2VuZFBvc2l0aW9uOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgIH1dLAorICAgICAgICAgICAgICAgICAgICBsaW5rOiBmdW5jdGlvbiAoc2NvcGUsIGVsZW1lbnQsIGF0dHJzKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAvLyB2YXIgcmFkaXVzID0gTWF0aC5taW4oYXR0cnMuY2hhcnRXaWR0aCwgYXR0cnMuY2hhcnRIZWlnaHQpIC8gMiwKKyAgICAgICAgICAgICAgICAgICAgICAgIHZhciBjb2xvciA9IGQzLnNjYWxlLm9yZGluYWwoKS5yYW5nZShDb3NDaGFydEQzQ29uZmlnLmNoYXJ0Y29sb3IucGFsZXR0ZUNvbG9ycyksCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHpvb20gPSBwYXJzZUludChDb3NDaGFydEQzQ29uZmlnLnpvb21MZXZlbCwgMCksZGF0YSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbWFyZ2luID0gey8vIG9wdGlvbmFsbHkgc2V0IG1hcmdpbnMKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRvcDogem9vbSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJpZ2h0OiB6b29tLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYm90dG9tOiB6b29tLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbGVmdDogem9vbQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9LAorICAgICAgICAgICAgICAgICAgICAgICAgd2lkdGggPSBhdHRycy5jaGFydFdpZHRoLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBoZWlnaHQgPSBhdHRycy5jaGFydEhlaWdodCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmFkaXVzID0gTWF0aC5taW4oCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgd2lkdGggLSAobWFyZ2luLmxlZnQgKyBtYXJnaW4ucmlnaHQpLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGhlaWdodCAtIChtYXJnaW4udG9wICsgbWFyZ2luLmJvdHRvbSkpIC8gMjsKKyAgICAgICAgICAgICAgICAgICAgICAgIHNjb3BlLkxlZ2VuZExhYmVsID0gQ29zQ2hhcnREM0NvbmZpZy5kZWZhdWx0Y2VudGVybGFiZWw7CisgICAgICAgICAgICAgICAgICAgICAgICBzY29wZS5MZWdlbmRDYXRlZ29yeSA9IENvc0NoYXJ0RDNDb25maWcuZGVmYXVsdGNlbnRlcmNhdGVnb3J5OworICAgICAgICAgICAgICAgICAgICAgICAgc2NvcGUuJHdhdGNoKCdpbml0VmFsJywgZnVuY3Rpb24gKHZhbHVlKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYoIWFuZ3VsYXIuaXNEZWZpbmVkKHNjb3BlLmluaXRWYWwpKXsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBkMy5zZWxlY3QoInN2ZyMiICsgYXR0cnMuaWQpLnJlbW92ZSgpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGQzLnNlbGVjdEFsbCgic3ZnIyIgKyBhdHRycy5pZCArICIgPiAqIikucmVtb3ZlKCk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFyIGNvc3ZhbCA9IHBhcnNlSW50KHNjb3BlLmluaXRWYWwudmFsdWUsIDEwKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBzY29wZS5jb3N2YWwgPSBjb3N2YWwgKyAiJSI7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYoY29zdmFsPjEwMCl7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRhdGEgPSBbCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgeyJuYW1lIjogImNvczEiLCAidmFsdWUiOiAxMDB9LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHsibmFtZSI6ICJyZXN0IiwgInZhbHVlIjogMH0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBdOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9ZWxzZXsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBkYXRhID0gWworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHsibmFtZSI6ICJjb3MxIiwgInZhbHVlIjogY29zdmFsfSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB7Im5hbWUiOiAicmVzdCIsICJ2YWx1ZSI6IDEwMCAtIChwYXJzZUludChjb3N2YWwsIDEwKSl9CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIF07CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhciBzbGlkZXJwZXJjZW50ID0gcGFyc2VJbnQoY29zdmFsLCAxMCk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGFuZ3VsYXIuaXNEZWZpbmVkKHNsaWRlcnBlcmNlbnQpKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNsaWRlcnBlcmNlbnQgPSAwOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBlbGVtZW50WzBdLnF1ZXJ5U2VsZWN0b3IoJy5jb3NkM0NvbnRhaW5lcicpLnNldEF0dHJpYnV0ZSgnaWQnLCBhdHRycy5pZCk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gYnVpbGQgY2hhcnQKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YXIgc3ZnID0gZDMuc2VsZWN0KCIuY29zZDNDb250YWluZXIjIiArIGF0dHJzLmlkKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLmF0dHIoInN0eWxlIiwgImhlaWdodDogIiArIGF0dHJzLmNoYXJ0SGVpZ2h0ICsgInB4OyIpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAuYXBwZW5kKCJzdmciKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLmF0dHIoImlkIiwgYXR0cnMuaWQpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAuYXR0cigid2lkdGgiLCAiMTAwJSIpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAuYXR0cigiaGVpZ2h0IiwgIjEwMCUiKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLmF0dHIoJ3ZpZXdCb3gnLCAnMCAwICcgKyBNYXRoLm1pbih3aWR0aCwgaGVpZ2h0KSArICcgJyArIE1hdGgubWluKHdpZHRoLCBoZWlnaHQpKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLmF0dHIoJ3ByZXNlcnZlQXNwZWN0UmF0aW8nLCAneE1pbllNaW4nKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLmFwcGVuZCgiZyIpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAuYXR0cigidHJhbnNmb3JtIiwgInRyYW5zbGF0ZSgiICsgTWF0aC5taW4od2lkdGgsIGhlaWdodCkgLyAyICsgIiwiICsgTWF0aC5taW4od2lkdGgsIGhlaWdodCkgLyAyICsgIikiKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyBzZXQgcmFkaXVzCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFyIGFyYyA9IGQzLnN2Zy5hcmMoKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLmlubmVyUmFkaXVzKHJhZGl1cyAtIENvc0NoYXJ0RDNDb25maWcuZG91Z2hudXRyYXRpbykKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC5vdXRlclJhZGl1cyhyYWRpdXMpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vIHNldCBob3ZlcmVkIHJhZGl1cworICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhciBhcmNPdmVyID0gZDMuc3ZnLmFyYygpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAuaW5uZXJSYWRpdXMocmFkaXVzIC0gQ29zQ2hhcnREM0NvbmZpZy5kb3VnaG51dHJhdGlvKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLm91dGVyUmFkaXVzKHJhZGl1cyArIENvc0NoYXJ0RDNDb25maWcuYXJjT3Zlck1hcmdpbik7CisKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyBhZGQgY2VudGVyIHRleHQgZWxlbWVudAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhciBjZW50ZXJUZXh0VmFsdWUgPSBzdmcuYXBwZW5kKCJ0ZXh0IikKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC5hdHRyKCJ5IiwgQ29zQ2hhcnREM0NvbmZpZy5jZW50ZXJUZXh0VmFsdWVEeSkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC5hdHRyKCJ4IiwgQ29zQ2hhcnREM0NvbmZpZy5jZW50ZXJUZXh0VmFsdWVEeCkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC5hdHRyKCJjbGFzcyIsICJjb3NjaGFydGNlbnRlclZhbHVlIik7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFyIGNlbnRlclRleHRQZXJjZW50ID0gc3ZnLmFwcGVuZCgidGV4dCIpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAuYXR0cigieCIsIENvc0NoYXJ0RDNDb25maWcuY2VudGVyVGV4dFBlcmNlbnREeCkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC5hdHRyKCJ5IiwgQ29zQ2hhcnREM0NvbmZpZy5jZW50ZXJUZXh0UGVyY2VudER5KQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLmF0dHIoImNsYXNzIiwgImNvc2NoYXJ0Y2VudGVyUGVyY2VudCIpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhciBjZW50ZXJUZXh0TGFiZWwgPSBzdmcuYXBwZW5kKCJ0ZXh0IikKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC5hdHRyKCJ5IiwgQ29zQ2hhcnREM0NvbmZpZy5jZW50ZXJUZXh0TGFiZWxEeSkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC5hdHRyKCJ4IiwgQ29zQ2hhcnREM0NvbmZpZy5jZW50ZXJUZXh0TGFiZWxEeCkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC5hdHRyKCJjbGFzcyIsICJjb3NjaGFydGNlbnRlckxhYmVsIik7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgY2VudGVyVGV4dFZhbHVlLnRleHQoY29zdmFsKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBjZW50ZXJUZXh0UGVyY2VudC50ZXh0KCIlIik7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgY2VudGVyVGV4dExhYmVsLnRleHQoQ29zQ2hhcnREM0NvbmZpZy5kZWZhdWx0Y2VudGVybGFiZWwgKyAiKCIgKyBDb3NDaGFydEQzQ29uZmlnLmRlZmF1bHRjZW50ZXJjYXRlZ29yeSArICIpIik7CisKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YXIgcGllID0gZDMubGF5b3V0LnBpZSgpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAuc29ydChudWxsKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLnN0YXJ0QW5nbGUoMy4yICogTWF0aC5QSSkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC5lbmRBbmdsZSg1LjIgKiBNYXRoLlBJKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLnZhbHVlKGZ1bmN0aW9uIChkKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGQudmFsdWU7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9KTsKKworICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vIHNldCBjaGFydCBhdHRyaWJ1dGVzIGFuZCBiaW5kIGhvdmVyIGV2ZW50cworICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhciBnID0gc3ZnLnNlbGVjdEFsbCgiLmFyYyIpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAuZGF0YShwaWUoZGF0YSkpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAuZW50ZXIoKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLmFwcGVuZCgiZyIpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAuYXR0cigiY2xhc3MiLCAiYXJjIikKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC5hdHRyKCJpZCIsIGZ1bmN0aW9uIChkLCBpKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuICJjb3NhcmMtIiArIGk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9KQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLnN0eWxlKCJjdXJzb3IiLCAicG9pbnRlciIpOworCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgZy5hcHBlbmQoInBhdGgiKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLnN0eWxlKCJmaWxsIiwgZnVuY3Rpb24gKGQpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gY29sb3IoZC5kYXRhLm5hbWUpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC5hdHRyKCJpZCIsIGZ1bmN0aW9uIChkLCBpKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuICJjb3NwYXRoLSIgKyBpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC5vbigibW91c2VvdmVyIiwgZnVuY3Rpb24gKGQpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBkMy5zZWxlY3QodGhpcykudHJhbnNpdGlvbigpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAuZHVyYXRpb24oQ29zQ2hhcnREM0NvbmZpZy5hbmltZHVyYXRpb24pCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAuYXR0cigiZCIsIGFyY092ZXIpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC5vbigibW91c2VvdXQiLCBmdW5jdGlvbiAoZCkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGQzLnNlbGVjdCh0aGlzKS50cmFuc2l0aW9uKCkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC5kdXJhdGlvbihDb3NDaGFydEQzQ29uZmlnLmFuaW1kdXJhdGlvbikKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC5hdHRyKCJkIiwgYXJjKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0pCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAudHJhbnNpdGlvbigpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAuZWFzZSgiZXhwIikKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC5kdXJhdGlvbigwKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLmF0dHJUd2VlbigiZCIsIHR3ZWVuUGllKTsKKworICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vIGFuaW1hdGUgZnVuY3Rpb24KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBmdW5jdGlvbiB0d2VlblBpZShiKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhciBpID0gZDMuaW50ZXJwb2xhdGUoeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc3RhcnRBbmdsZTogMi4xICogTWF0aC5QSSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGVuZEFuZ2xlOiAyLjEgKiBNYXRoLlBJCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0sIGIpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gZnVuY3Rpb24gKHQpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBhcmMoaSh0KSk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH07CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmKGNvc3ZhbD4wICYmIGNvc3ZhbDwxMDApeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBkMy5zZWxlY3QoIi5jb3NkM0NvbnRhaW5lciBwYXRoI2Nvc3BhdGgtMSIpLnN0eWxlKCdzdHJva2UnLCAnYmxhY2snKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgCisKKworICAgICAgICAgICAgICAgICAgICAgICAgfSk7CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICB9OworICAgICAgICAgICAgfV0pOworYW5ndWxhci5tb2R1bGUoJ2F0dC5jaGFydHMuY29zY2hhcnR3aXRoYmFyRDMnLCBbJ2F0dC5jaGFydHMudXRpbGl0aWVzJ10pCisuY29uc3RhbnQoIkNvc0NoYXJ0V2l0aEJhckQzQ29uZmlnIiwKKyAgICAgICAgeworICAgICAgICAgICAgImNoYXJ0Y29sb3IiOiB7CisgICAgICAgICAgICAgICAgInBhbGV0dGVDb2xvcnMiOiBbIiMwNTc0YWMiLCAiIzQ0YzhmNSIsICIjNGNhOTBjIiwgIiNkYTAwODEiLCAiI2ZmOTkwMCIsICIjODEwMTdlIl0sIC8vWyIjMDk3Y2I1IiwgIiNGRUZGRjciXSwgLy9kZWZhdWx0IGNvbG9yIG9wdGlvbnMgZm9yIHJlbmRlcmluZyBjaGFydCBiYXNlQ29sb3IgYW5kIE5lZWRsZUNvbG9yLAorICAgICAgICAgICAgICAgICJ6ZXJvQ29sb3IiOiAiI2ZmZmZmZiIsCisgICAgICAgICAgICAgICAgImJvcmRlckNvbG9yIjogIiM2NjY2NjYiCisgICAgICAgICAgICB9LAorICAgICAgICAgICAgInpvb21MZXZlbCI6ICIyNSIsCisgICAgICAgICAgICAiZG91Z2hudXRyYXRpbyI6IDIwLAorICAgICAgICAgICAgImJhcnJlcWQiOiAidHJ1ZSIsCisgICAgICAgICAgICAiYmFySGVpZ2h0IjogNTAsCisgICAgICAgICAgICAiYmFyV2lkdGgiOiAxNTAsCisgICAgICAgICAgICAiYmFyQ29ybmVyUmFkaXVzIjogOSwKKyAgICAgICAgICAgIC8vImJhclRleHRWYWx1ZUR5IjogIjI1MCIsCisgICAgICAgICAgICAvLyJiYXJUZXh0VmFsdWVEeCI6ICIwIiwKKyAgICAgICAgICAgIC8vImJhclRleHRQZXJjZW50RHgiOiAiMjAiLAorICAgICAgICAgICAgLy8iYmFyVGV4dFBlcmNlbnREeSI6ICItMjUwIiwKKyAgICAgICAgICAgIC8vImJhclRleHRMYWJlbER5IjogIjYwIiwKKyAgICAgICAgICAgIC8vImJhclRleHRMYWJlbER4IjogIi04MCIsCisgICAgICAgICAgICAvLyJkZWZhdWx0YmFybGFiZWwiOiAiQ29TIDJWL0NvUyAyL0NvUyAzL0NvUyA0L0NvUyA1IiwKKyAgICAgICAgICAgICJhbmltZHVyYXRpb24iOiAiMzAwIiwgICAKKyAgICAgICAgICAgICJjZW50ZXJUZXh0IjogeworICAgICAgICAgICAgICAgICdkZWZhdWx0Q2VudGVyTGFiZWwnOiAnQ09TIDEnLAorICAgICAgICAgICAgICAgICdkZWZhdWx0Q2VudGVyQ2F0ZWdvcnknOiAnUmVhbCBUaW1lJywKKyAgICAgICAgICAgICAgICAndGV4dFZhbHVlRHknOiAnMCcsCisgICAgICAgICAgICAgICAgJ3RleHRWYWx1ZUR4JzogJzAnLAorICAgICAgICAgICAgICAgICd0ZXh0UGVyY2VudER4JzogJzIwJywKKyAgICAgICAgICAgICAgICAndGV4dFBlcmNlbnREeSc6ICctMTAnLAorICAgICAgICAgICAgICAgICd0ZXh0TGFiZWxEeCc6ICcwJywKKyAgICAgICAgICAgICAgICAndGV4dExhYmVsRHknOiAnMjAnLAorICAgICAgICAgICAgICAgICdjb2xvcic6ICcjNjY2NjY2JywKKyAgICAgICAgICAgICAgICAnc2l6ZSc6ICczNnB4JywKKyAgICAgICAgICAgICAgICAnZm9udCc6ICdvbW5lc19hdHRfbGlnaHQnCisgICAgICAgICAgICB9LAorICAgICAgICAgICAgImNlbnRlclRleHRWYWx1ZUR5IjogIjAiLAorICAgICAgICAgICAgImNlbnRlclRleHRWYWx1ZUR4IjogIjAiLAorICAgICAgICAgICAgImNlbnRlclRleHRQZXJjZW50RHgiOiAiMjAiLAorICAgICAgICAgICAgImNlbnRlclRleHRQZXJjZW50RHkiOiAiLTEwIiwKKyAgICAgICAgICAgICJjZW50ZXJUZXh0TGFiZWxEeSI6ICIyMCIsCisgICAgICAgICAgICAiY2VudGVyVGV4dExhYmVsRHgiOiAiMCIsCisgICAgICAgICAgICAiYXJjT3Zlck1hcmdpbiI6IDUKKyAgICAgICAgfSkKKy5kaXJlY3RpdmUoJ2F0dENvc0JhckQzQ2hhcnQnLCBbJ0Nvc0NoYXJ0V2l0aEJhckQzQ29uZmlnJywgJyR0aW1lb3V0JywnJGV4dGVuZE9iaicsIGZ1bmN0aW9uIChDb3NDaGFydFdpdGhCYXJEM0NvbmZpZywgJHRpbWVvdXQsJGV4dGVuZE9iaikge3JldHVybiB7CisgICAgICAgICAgICByZXN0cmljdDogJ0EnLAorICAgICAgICAgICAgc2NvcGU6IHsKKyAgICAgICAgICAgICAgICBjaGFydENvbmZpZzogJz0nLAorICAgICAgICAgICAgICAgIGNoYXJ0RGF0YTogJz0nLAorICAgICAgICAgICAgICAgIHRvdGFsQ29zOiAnPScsCisgICAgICAgICAgICAgICAgcmVtYWluaW5nQ29zOiAnPScsCisgICAgICAgICAgICAgICAgbW91c2VPdmVyOiAnPT8nCisgICAgICAgICAgICB9LAorICAgICAgICAgICAgdGVtcGxhdGVVcmw6ICd0ZW1wbGF0ZS9jb3NjaGFydHdpdGhiYXJEMy9hdHRDb3NCYXJEM0NoYXJ0Lmh0bWwnLAorICAgICAgICAgICAgdHJhbnNjbHVkZTogdHJ1ZSwKKyAgICAgICAgICAgIHJlcGxhY2U6IHRydWUsCisgICAgICAgICAgICBjb250cm9sbGVyOiBbJyRzY29wZScsICckYXR0cnMnLCBmdW5jdGlvbiAoJHNjb3BlLCAkYXR0cnMpIHsKKyAgICAgICAgICAgICAgICBpZiAoYW5ndWxhci5pc0RlZmluZWQoJHNjb3BlLmNoYXJ0Q29uZmlnKSkgeworICAgICAgICAgICAgICAgICAgICBDb3NDaGFydFdpdGhCYXJEM0NvbmZpZyA9ICRleHRlbmRPYmouZXh0ZW5kRGVlcChDb3NDaGFydFdpdGhCYXJEM0NvbmZpZywgJHNjb3BlLmNoYXJ0Q29uZmlnKTsKKyAgICAgICAgICAgICAgICB9CisKKyAgICAgICAgICAgICAgICAkc2NvcGUuY2hhcnRJRCA9ICRhdHRycy5pZDsKKyAgICAgICAgICAgICAgICBpZiAoIWFuZ3VsYXIuaXNEZWZpbmVkKCRhdHRycy5iYXJSZXF1aXJlZCkpIHsKKyAgICAgICAgICAgICAgICAgICAgJHNjb3BlLmJhclJlcXVpcmVkID0gQ29zQ2hhcnRXaXRoQmFyRDNDb25maWcuYmFycmVxZDsKKyAgICAgICAgICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgICAgICAgICAkc2NvcGUuYmFyUmVxdWlyZWQgPSAkYXR0cnMuYmFyUmVxdWlyZWQ7CisgICAgICAgICAgICAgICAgfQorCisgICAgICAgICAgICAgICAgfV0sCisgICAgICAgICAgICBsaW5rOiBmdW5jdGlvbiAoc2NvcGUsIGVsZW1lbnQsIGF0dHJzKSB7CisgICAgICAgICAgICAgICAgLyoKKyAgICAgICAgICAgICAgICAgICAgeDogeC1jb29yZGluYXRlCisgICAgICAgICAgICAgICAgICAgIHk6IHktY29vcmRpbmF0ZQorICAgICAgICAgICAgICAgICAgICB3OiB3aWR0aAorICAgICAgICAgICAgICAgICAgICBoOiBoZWlnaHQKKyAgICAgICAgICAgICAgICAgICAgcjogY29ybmVyIHJhZGl1cworICAgICAgICAgICAgICAgICAgICB0bDogdG9wX2xlZnQgcm91bmRlZD8KKyAgICAgICAgICAgICAgICAgICAgdHI6IHRvcF9yaWdodCByb3VuZGVkPworICAgICAgICAgICAgICAgICAgICBibDogYm90dG9tX2xlZnQgcm91bmRlZD8KKyAgICAgICAgICAgICAgICAgICAgYnI6IGJvdHRvbV9yaWdodCByb3VuZGVkPworICAgICAgICAgICAgICAgICAqLworICAgICAgICAgICAgICAgIGZ1bmN0aW9uIHJvdW5kZWRfcmVjdCh4LCB5LCB3LCBoLCByLCB0bCwgdHIsIGJsLCBicikgeworICAgICAgICAgICAgICAgICAgICB2YXIgcmV0dmFsOworICAgICAgICAgICAgICAgICAgICByZXR2YWwgID0gIk0iICsgKHggKyByKSArICIsIiArIHk7CisgICAgICAgICAgICAgICAgICAgIHJldHZhbCArPSAiaCIgKyAodyAtIDIqcik7CisgICAgICAgICAgICAgICAgICAgIGlmICh0cikgeyByZXR2YWwgKz0gImEiICsgciArICIsIiArIHIgKyAiIDAgMCAxICIgKyByICsgIiwiICsgcjsgfQorICAgICAgICAgICAgICAgICAgICBlbHNlIHsgcmV0dmFsICs9ICJoIiArIHI7IHJldHZhbCArPSAidiIgKyByOyB9CisgICAgICAgICAgICAgICAgICAgIHJldHZhbCArPSAidiIgKyAoaCAtIDIqcik7CisgICAgICAgICAgICAgICAgICAgIGlmIChicikgeyByZXR2YWwgKz0gImEiICsgciArICIsIiArIHIgKyAiIDAgMCAxICIgKyAtciArICIsIiArIHI7IH0KKyAgICAgICAgICAgICAgICAgICAgZWxzZSB7IHJldHZhbCArPSAidiIgKyByOyByZXR2YWwgKz0gImgiICsgLXI7IH0KKyAgICAgICAgICAgICAgICAgICAgcmV0dmFsICs9ICJoIiArICgyKnIgLSB3KTsKKyAgICAgICAgICAgICAgICAgICAgaWYgKGJsKSB7IHJldHZhbCArPSAiYSIgKyByICsgIiwiICsgciArICIgMCAwIDEgIiArIC1yICsgIiwiICsgLXI7IH0KKyAgICAgICAgICAgICAgICAgICAgZWxzZSB7IHJldHZhbCArPSAiaCIgKyAtcjsgcmV0dmFsICs9ICJ2IiArIC1yOyB9CisgICAgICAgICAgICAgICAgICAgIHJldHZhbCArPSAidiIgKyAoMipyIC0gaCk7CisgICAgICAgICAgICAgICAgICAgIGlmICh0bCkgeyByZXR2YWwgKz0gImEiICsgciArICIsIiArIHIgKyAiIDAgMCAxICIgKyByICsgIiwiICsgLXI7IH0KKyAgICAgICAgICAgICAgICAgICAgZWxzZSB7IHJldHZhbCArPSAidiIgKyAtcjsgcmV0dmFsICs9ICJoIiArIHI7IH0KKyAgICAgICAgICAgICAgICAgICAgcmV0dmFsICs9ICJ6IjsKKyAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHJldHZhbDsKKyAgICAgICAgICAgICAgICB9CisKKyAgICAgICAgICAgICAgICB2YXIgcmFkU2NhbGUgPSBkMy5zY2FsZS5saW5lYXIoKS5kb21haW4oWzAsIDEwMF0pLnJhbmdlKFswLCAyICogTWF0aC5QSV0pOworCisgICAgICAgICAgICAgICAgIAorICAgICAgICAgICAgICAgIHZhciB6b29tID0gcGFyc2VJbnQoQ29zQ2hhcnRXaXRoQmFyRDNDb25maWcuem9vbUxldmVsLCAwKSxkYXRhLAorICAgICAgICAgICAgICAgICAgICBtYXJnaW4gPSB7Ly8gb3B0aW9uYWxseSBzZXQgbWFyZ2lucworICAgICAgICAgICAgICAgICAgICAgICAgdG9wOiB6b29tLAorICAgICAgICAgICAgICAgICAgICAgICAgcmlnaHQ6IHpvb20sCisgICAgICAgICAgICAgICAgICAgICAgICBib3R0b206IHpvb20sCisgICAgICAgICAgICAgICAgICAgICAgICBsZWZ0OiB6b29tCisgICAgICAgICAgICAgICAgICAgIH0sCisgICAgICAgICAgICAgICAgICAgIHdpZHRoID0gYXR0cnMuY2hhcnRXaWR0aCwKKyAgICAgICAgICAgICAgICAgICAgaGVpZ2h0ID0gYXR0cnMuY2hhcnRIZWlnaHQsCisgICAgICAgICAgICAgICAgICAgIHJhZGl1cyA9IE1hdGgubWluKAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIHdpZHRoIC0gKG1hcmdpbi5sZWZ0ICsgbWFyZ2luLnJpZ2h0KSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBoZWlnaHQgLSAobWFyZ2luLnRvcCArIG1hcmdpbi5ib3R0b20pKSAvIDI7CisKKworICAgICAgICAgICAgICAgIHNjb3BlLiR3YXRjaENvbGxlY3Rpb24oJ2NoYXJ0RGF0YScsIGZ1bmN0aW9uICh2YWx1ZSkgeworICAgICAgICAgICAgICAgICAgICB2YXIgaiA9IDA7IC8vIGluZGV4IGZvciBmb3ItbG9vcHMKKworICAgICAgICAgICAgICAgICAgICBpZighYW5ndWxhci5pc0RlZmluZWQoc2NvcGUuY2hhcnREYXRhKSB8fCBzY29wZS5jaGFydERhdGEubGVuZ3RoIDwgMSl7CisgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm47CisgICAgICAgICAgICAgICAgICAgIH0KKworICAgICAgICAgICAgICAgICAgICBkMy5zZWxlY3QoInN2ZyMiICsgYXR0cnMuaWQpLnJlbW92ZSgpOworICAgICAgICAgICAgICAgICAgICBkMy5zZWxlY3RBbGwoInN2ZyMiICsgYXR0cnMuaWQgKyAiID4gKiIpLnJlbW92ZSgpOworCisgICAgICAgICAgICAgICAgICAgIC8vIFNuaWNrckJhcgorICAgICAgICAgICAgICAgICAgICBkMy5zZWxlY3QoInN2ZyMiICsgc2NvcGUuc25pY2tyYmFySWQpLnJlbW92ZSgpOworICAgICAgICAgICAgICAgICAgICBkMy5zZWxlY3RBbGwoInN2ZyMiICsgc2NvcGUuc25pY2tyYmFySWQgKyAiID4gKiIpLnJlbW92ZSgpOworCisgICAgICAgICAgICAgICAgICAgIHZhciBjb3N2YWwgPSBzY29wZS5jaGFydERhdGFbMF07CisgICAgICAgICAgICAgICAgICAgIHZhciByZW1haW5pbmdDb3NWYWwgPSAwLCByZXN0Q29zVmFsID0gMDsKKworICAgICAgICAgICAgICAgICAgICBmb3IoaiA9IDE7IGogPCBzY29wZS5jaGFydERhdGEubGVuZ3RoOyBqKyspCisgICAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIHJlbWFpbmluZ0Nvc1ZhbCArPSBwYXJzZUludChzY29wZS5jaGFydERhdGFbal0sIDEwKTsgLy9wYXJzZUludCBhbGxvd3Mgc3RyaW5ncyB0byBiZSBwYXNzZWQgaW4KKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICByZXN0Q29zVmFsID0gMTAwIC0gY29zdmFsIC0gcmVtYWluaW5nQ29zVmFsOworICAgICAgICAgICAgICAgICAgICBzY29wZS50b3RhbENvcyA9IGNvc3ZhbCArIHJlbWFpbmluZ0Nvc1ZhbDsKKyAgICAgICAgICAgICAgICAgICAgc2NvcGUucmVtYWluaW5nQ29zID0gcmVtYWluaW5nQ29zVmFsOworCisgICAgICAgICAgICAgICAgICAgIHZhciBkYXRhID0gYW5ndWxhci5jb3B5KHNjb3BlLmNoYXJ0RGF0YSk7CisgICAgICAgICAgICAgICAgICAgIGlmIChhbmd1bGFyLmlzRGVmaW5lZChyZXN0Q29zVmFsKSkgeworICAgICAgICAgICAgICAgICAgICAgICAgZGF0YS5wdXNoKHJlc3RDb3NWYWwpOworICAgICAgICAgICAgICAgICAgICB9CisKKyAgICAgICAgICAgICAgICAgICAgZWxlbWVudFswXS5xdWVyeVNlbGVjdG9yKCcuY29zZDNDb250YWluZXInKS5zZXRBdHRyaWJ1dGUoJ2lkJywgYXR0cnMuaWQpOworICAgICAgICAgICAgICAgICAgICAvLyBidWlsZCBjaGFydAorICAgICAgICAgICAgICAgICAgICB2YXIgc3ZnID0gZDMuc2VsZWN0KCIuY29zZDNDb250YWluZXIjIiArIGF0dHJzLmlkKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgIC5hdHRyKCJzdHlsZSIsICJoZWlnaHQ6ICIgKyBhdHRycy5jaGFydEhlaWdodCArICJweDsiKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgIC5hcHBlbmQoInN2ZyIpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgLmF0dHIoImlkIiwgYXR0cnMuaWQpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgLmF0dHIoIndpZHRoIiwgIjEwMCUiKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgIC5hdHRyKCJoZWlnaHQiLCAiMTAwJSIpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgLmF0dHIoJ3ZpZXdCb3gnLCAnMCAwICcgKyBNYXRoLm1pbih3aWR0aCwgaGVpZ2h0KSArICcgJyArIE1hdGgubWluKHdpZHRoLCBoZWlnaHQpKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgIC5hdHRyKCdwcmVzZXJ2ZUFzcGVjdFJhdGlvJywgJ3hNaW5ZTWluJykKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAuYXBwZW5kKCJnIikKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAuYXR0cigidHJhbnNmb3JtIiwgInRyYW5zbGF0ZSgiICsgTWF0aC5taW4od2lkdGgsIGhlaWdodCkgLyAyICsgIiwiICsgTWF0aC5taW4od2lkdGgsIGhlaWdodCkgLyAyICsgIikiKTsKKworICAgICAgICAgICAgICAgICAgICBzY29wZS5zbmlja3JiYXJJZCA9IGF0dHJzLmlkICsgJ3NuaWNrcmJhcic7CisgICAgICAgICAgICAgICAgICAgIHZhciBzbmlja3JiYXIgPSBkMy5zZWxlY3QoIi5zbmlja3JCYXIiKQorICAgICAgICAgICAgICAgICAgICAgICAgLmF0dHIoJ3N0eWxlJywgJ21hcmdpbi1sZWZ0OicgKyBNYXRoLmZsb29yKENvc0NoYXJ0V2l0aEJhckQzQ29uZmlnLmJhcldpZHRoLzMpICsgJzsnKQorICAgICAgICAgICAgICAgICAgICAgICAgLnN0eWxlKHsnYmFja2dyb3VuZC1jb2xvcic6IENvc0NoYXJ0V2l0aEJhckQzQ29uZmlnLmNoYXJ0Y29sb3IuemVyb0NvbG9yLCAnd2lkdGgnOiBDb3NDaGFydFdpdGhCYXJEM0NvbmZpZy5iYXJXaWR0aCArICdweCcsICdib3JkZXInOiAnMXB4IHNvbGlkICM3NzcnLCAnYm9yZGVyLXJhZGl1cyc6ICcxMHB4J30pCisgICAgICAgICAgICAgICAgICAgICAgICAuYXBwZW5kKCJzdmciKQorICAgICAgICAgICAgICAgICAgICAgICAgLmF0dHIoImlkIiwgc2NvcGUuc25pY2tyYmFySWQpCisgICAgICAgICAgICAgICAgICAgICAgICAuYXR0cigid2lkdGgiLCBDb3NDaGFydFdpdGhCYXJEM0NvbmZpZy5iYXJXaWR0aCArICJweCIpCisgICAgICAgICAgICAgICAgICAgICAgICAuYXR0cigiaGVpZ2h0IiwgQ29zQ2hhcnRXaXRoQmFyRDNDb25maWcuYmFySGVpZ2h0ICsgInB4IikKKyAgICAgICAgICAgICAgICAgICAgICAgIC5hcHBlbmQoImciKTsKKworICAgICAgICAgICAgICAgICAgICAvLyBzZXQgcmFkaXVzCisgICAgICAgICAgICAgICAgICAgIHZhciBhcmMgPSBkMy5zdmcuYXJjKCkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAuaW5uZXJSYWRpdXMocmFkaXVzIC0gQ29zQ2hhcnRXaXRoQmFyRDNDb25maWcuZG91Z2hudXRyYXRpbykKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAub3V0ZXJSYWRpdXMocmFkaXVzKTsKKworICAgICAgICAgICAgICAgICAgICAvLyBzZXQgaG92ZXJlZCByYWRpdXMKKyAgICAgICAgICAgICAgICAgICAgdmFyIGFyY092ZXIgPSBkMy5zdmcuYXJjKCkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAuaW5uZXJSYWRpdXMocmFkaXVzIC0gQ29zQ2hhcnRXaXRoQmFyRDNDb25maWcuZG91Z2hudXRyYXRpbykKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAub3V0ZXJSYWRpdXMocmFkaXVzICsgQ29zQ2hhcnRXaXRoQmFyRDNDb25maWcuYXJjT3Zlck1hcmdpbik7CisKKyAgICAgICAgICAgICAgICAgICAgLy8gYWRkIGNlbnRlciB0ZXh0IGVsZW1lbnQKKyAgICAgICAgICAgICAgICAgICAgdmFyIGNlbnRlclRleHRWYWx1ZSA9IHN2Zy5hcHBlbmQoInRleHQiKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgIC5hdHRyKCJ5IiwgQ29zQ2hhcnRXaXRoQmFyRDNDb25maWcuY2VudGVyVGV4dC50ZXh0VmFsdWVEeSkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAuYXR0cigieCIsIENvc0NoYXJ0V2l0aEJhckQzQ29uZmlnLmNlbnRlclRleHQudGV4dFZhbHVlRHgpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgLmF0dHIoImNsYXNzIiwgImNvc2NoYXJ0Y2VudGVyVmFsdWUiKTsKKyAgICAgICAgICAgICAgICAgICAgdmFyIGNlbnRlclRleHRQZXJjZW50ID0gc3ZnLmFwcGVuZCgidGV4dCIpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgLmF0dHIoIngiLCBDb3NDaGFydFdpdGhCYXJEM0NvbmZpZy5jZW50ZXJUZXh0LnRleHRQZXJjZW50RHgpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgLmF0dHIoInkiLCBDb3NDaGFydFdpdGhCYXJEM0NvbmZpZy5jZW50ZXJUZXh0LnRleHRQZXJjZW50RHkpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgLmF0dHIoImNsYXNzIiwgImNvc2NoYXJ0Y2VudGVyUGVyY2VudCIpOworICAgICAgICAgICAgICAgICAgICB2YXIgY2VudGVyVGV4dExhYmVsID0gc3ZnLmFwcGVuZCgidGV4dCIpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgLmF0dHIoInkiLCBDb3NDaGFydFdpdGhCYXJEM0NvbmZpZy5jZW50ZXJUZXh0LnRleHRMYWJlbER5KQorICAgICAgICAgICAgICAgICAgICAgICAgICAgIC5hdHRyKCJ4IiwgQ29zQ2hhcnRXaXRoQmFyRDNDb25maWcuY2VudGVyVGV4dC50ZXh0TGFiZWxEeCkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAuYXR0cigiY2xhc3MiLCAiY29zY2hhcnRjZW50ZXJMYWJlbCIpOworICAgICAgICAgICAgICAgICAgICBjZW50ZXJUZXh0VmFsdWUudGV4dChjb3N2YWwpOworICAgICAgICAgICAgICAgICAgICBjZW50ZXJUZXh0UGVyY2VudC50ZXh0KCIlIik7CisgICAgICAgICAgICAgICAgICAgIGNlbnRlclRleHRMYWJlbC50ZXh0KENvc0NoYXJ0V2l0aEJhckQzQ29uZmlnLmNlbnRlclRleHQuZGVmYXVsdENlbnRlckxhYmVsICsgIigiICsgQ29zQ2hhcnRXaXRoQmFyRDNDb25maWcuY2VudGVyVGV4dC5kZWZhdWx0Q2VudGVyQ2F0ZWdvcnkgKyAiKSIpOworCisgICAgICAgICAgICAgICAgICAgIHZhciBzY2FsZSA9IGZ1bmN0aW9uKGQpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIGlmIChkIDw9IDApIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gMDsKKyAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFyIHIgPSAoZCAqIENvc0NoYXJ0V2l0aEJhckQzQ29uZmlnLmJhcldpZHRoKSAvIDEwMDsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoaXNOYU4ocikpIHsgciA9IDA7IH0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBlbHNlIGlmICghaXNGaW5pdGUocikpIHsgciA9IENvc0NoYXJ0V2l0aEJhckQzQ29uZmlnLmJhcldpZHRoOyB9CisKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gcjsKKyAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgfTsKKworICAgICAgICAgICAgICAgICAgICAvLyBPbmx5IGV4ZWN1dGVkIHdoZW4gdG90YWxDb3MgaXMgMAorICAgICAgICAgICAgICAgICAgICBpZiAoY29zdmFsIDw9IDApIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIGFyYy5zdGFydEFuZ2xlKDApLmVuZEFuZ2xlKDIgKiBNYXRoLlBJKTsgLy9qdXN0IHJhZGlhbnMKKyAgICAgICAgICAgICAgICAgICAgICAgIHN2Zy5hcHBlbmQoInBhdGgiKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAuYXR0cigiZCIsIGFyYykKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLmF0dHIoImZpbGwiLCBDb3NDaGFydFdpdGhCYXJEM0NvbmZpZy5jaGFydGNvbG9yLnplcm9Db2xvcikKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLnN0eWxlKCJzdHJva2UiLCBDb3NDaGFydFdpdGhCYXJEM0NvbmZpZy5jaGFydGNvbG9yLmJvcmRlckNvbG9yKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAuc3R5bGUoInN0cm9rZS13aWR0aCIsIDEpOworICAgICAgICAgICAgICAgICAgICB9IGVsc2UgeworCisgICAgICAgICAgICAgICAgICAgICAgICAvLyBKVk06IFRoaXMgY29kZSBpcyB0ZW1wIGZvciBqdXN0IHNuaWNrZXIncyBiYXIgcmVsZWFzZQorICAgICAgICAgICAgICAgICAgICAgICAgdmFyIHRlbXAgPSAxMDAtZGF0YVswXTsKKyAgICAgICAgICAgICAgICAgICAgICAgIHZhciBuZXdEYXRhID0gW107CisgICAgICAgICAgICAgICAgICAgICAgICBuZXdEYXRhLnB1c2goeyd2YWx1ZSc6ZGF0YVswXX0pOworICAgICAgICAgICAgICAgICAgICAgICAgbmV3RGF0YS5wdXNoKHsndmFsdWUnOnRlbXB9KTsKKworICAgICAgICAgICAgICAgICAgICAgICAgLypmb3IoaiA9IDA7IGogPCBkYXRhLmxlbmd0aDsgaisrKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFyIG9iaiA9IGFuZ3VsYXIuZXh0ZW5kKHt9LCBkYXRhW2pdKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBvYmoudmFsdWUgPSBkYXRhW2pdOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIG5ld0RhdGEucHVzaChvYmopOworICAgICAgICAgICAgICAgICAgICAgICAgfSovCisKKworICAgICAgICAgICAgICAgICAgICAgICAgLy89PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKworCisgICAgICAgICAgICAgICAgICAgICAgICB2YXIgcGllID0gZDMubGF5b3V0LnBpZSgpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgLnNvcnQobnVsbCkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAudmFsdWUoZnVuY3Rpb24gKGQsaW5kZXgpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFyIHIgPSBkLnZhbHVlOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoZC52YWx1ZSA8PSAwKSB7IHIgPSAwOyB9CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiByOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0pOworCisgICAgICAgICAgICAgICAgICAgICAgICAvLyBzZXQgY2hhcnQgYXR0cmlidXRlcyBhbmQgYmluZCBob3ZlciBldmVudHMKKyAgICAgICAgICAgICAgICAgICAgICAgIHZhciBnID0gc3ZnLnNlbGVjdEFsbCgiLmFyYyIpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC5kYXRhKHBpZShuZXdEYXRhKSkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLmVudGVyKCkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLmFwcGVuZCgiZyIpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC5hdHRyKCJjbGFzcyIsICJhcmMiKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAuYXR0cigiaWQiLCBmdW5jdGlvbiAoZCwgaSkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuICJjb3NhcmMtIiArIGk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0pCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC5zdHlsZSgiY3Vyc29yIiwgInBvaW50ZXIiKTsKKworICAgICAgICAgICAgICAgICAgICAgICAgZy5hcHBlbmQoInBhdGgiKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAuc3R5bGUoImZpbGwiLCBmdW5jdGlvbiAoZCwgaSkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGkgPT09IENvc0NoYXJ0V2l0aEJhckQzQ29uZmlnLmNoYXJ0Y29sb3IucGFsZXR0ZUNvbG9ycy5sZW5ndGggfHwgaSA9PT0gbmV3RGF0YS5sZW5ndGgtMSB8fCBkLmRhdGEudmFsdWUgPT09IDApIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gQ29zQ2hhcnRXaXRoQmFyRDNDb25maWcuY2hhcnRjb2xvci56ZXJvQ29sb3I7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CisKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBDb3NDaGFydFdpdGhCYXJEM0NvbmZpZy5jaGFydGNvbG9yLnBhbGV0dGVDb2xvcnNbaV07CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0pCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC5zdHlsZSgic3Ryb2tlIiwgIndoaXRlIikKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLnN0eWxlKCJzdHJva2Utd2lkdGgiLCBmdW5jdGlvbihkLGluZGV4KSB7IGlmIChjb3N2YWwgPj0gMTAwKSB7IHJldHVybiAwOyB9IGVsc2UgeyByZXR1cm4gMTsgfSB9KQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAuYXR0cigiaWQiLCBmdW5jdGlvbiAoZCwgaSkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuICJjb3NwYXRoLSIgKyBpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9KQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAub24oIm1vdXNlb3ZlciIsIGZ1bmN0aW9uIChkLCBpbmRleCkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGluZGV4IDwgbmV3RGF0YS5sZW5ndGgtMSkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGQzLnNlbGVjdCh0aGlzKS50cmFuc2l0aW9uKCkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLmR1cmF0aW9uKENvc0NoYXJ0V2l0aEJhckQzQ29uZmlnLmFuaW1kdXJhdGlvbikKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLmF0dHIoImQiLCBhcmNPdmVyKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLm9uKCJtb3VzZW91dCIsIGZ1bmN0aW9uIChkLCBpbmRleCkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGluZGV4IDwgbmV3RGF0YS5sZW5ndGgtMSkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGQzLnNlbGVjdCh0aGlzKS50cmFuc2l0aW9uKCkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC5kdXJhdGlvbihDb3NDaGFydFdpdGhCYXJEM0NvbmZpZy5hbmltZHVyYXRpb24pCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAuYXR0cigiZCIsIGFyYyk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0pCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC50cmFuc2l0aW9uKCkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLmVhc2UoImV4cCIpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC5kdXJhdGlvbigwKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAuYXR0clR3ZWVuKCJkIiwgdHdlZW5QaWUpOworICAgICAgICAgICAgICAgICAgICB9IC8vIGVuZCBvZiBlbHNlCisKKyAgICAgICAgICAgICAgICAgICAgaWYgKCFDb3NDaGFydFdpdGhCYXJEM0NvbmZpZy5iYXJyZXFkKSB7IHJldHVybjsgfQorICAgICAgICAgICAgICAgICAgICB2YXIgc25pY2tyRGF0YSA9IFtdOworICAgICAgICAgICAgICAgICAgICB2YXIgZCA9IHNjb3BlLmNoYXJ0RGF0YS5zbGljZSgxLCBzY29wZS5jaGFydERhdGEubGVuZ3RoKTsKKyAgICAgICAgICAgICAgICAgICAgZm9yIChqID0gMDsgaiA8IGQubGVuZ3RoOyBqKyspIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIGlmIChkW2pdICE9PSAwKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFyIG9iaiA9IHt9OworICAgICAgICAgICAgICAgICAgICAgICAgICAgIG9iai5kYXRhID0gZFtqXTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBvYmouY29sb3IgPSBDb3NDaGFydFdpdGhCYXJEM0NvbmZpZy5jaGFydGNvbG9yLnBhbGV0dGVDb2xvcnNbaisxXTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBzbmlja3JEYXRhLnB1c2gob2JqKTsgICAgCisgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgIH0KKworICAgICAgICAgICAgICAgICAgICB2YXIgcHJldldpZHRoID0gMDsKKyAgICAgICAgICAgICAgICAgICAgdmFyIG5leHRYID0gZnVuY3Rpb24oZCwgaSkgeworICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGkgPT09IDApIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBwcmV2V2lkdGggPSBzY2FsZShkKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gMDsKKyAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFyIHAgPSBwcmV2V2lkdGg7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgcHJldldpZHRoICs9IHNjYWxlKGQpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBwOworICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICB9OworCisgICAgICAgICAgICAgICAgICAgIHZhciByZWN0ID0gc25pY2tyYmFyLnNlbGVjdEFsbCgicGF0aCIpCisgICAgICAgICAgICAgICAgICAgICAgICAuZGF0YShzbmlja3JEYXRhKQorICAgICAgICAgICAgICAgICAgICAgICAgLmVudGVyKCkKKyAgICAgICAgICAgICAgICAgICAgICAgIC5hcHBlbmQoInBhdGgiKQorICAgICAgICAgICAgICAgICAgICAgICAgLnN0eWxlKCJmaWxsIiwgZnVuY3Rpb24oZCwgaSkgeyAKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoaSA+PSBDb3NDaGFydFdpdGhCYXJEM0NvbmZpZy5jaGFydGNvbG9yLnBhbGV0dGVDb2xvcnMubGVuZ3RoIHx8IGQuZGF0YSA9PT0gMCkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gQ29zQ2hhcnRXaXRoQmFyRDNDb25maWcuY2hhcnRjb2xvci56ZXJvQ29sb3I7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQorCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGQuY29sb3I7CisgICAgICAgICAgICAgICAgICAgICAgICB9KQorICAgICAgICAgICAgICAgICAgICAgICAgLmF0dHIoImQiLCBmdW5jdGlvbihkLCBpbmRleCkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChpbmRleCA9PT0gMCkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyBMZWZ0IHJvdW5kZWQgcmVjdGFuZ2xlCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiByb3VuZGVkX3JlY3QobmV4dFgoZC5kYXRhLCBpbmRleCksIDAsIHNjYWxlKGQuZGF0YSksIENvc0NoYXJ0V2l0aEJhckQzQ29uZmlnLmJhckhlaWdodCwgQ29zQ2hhcnRXaXRoQmFyRDNDb25maWcuYmFyQ29ybmVyUmFkaXVzLCB0cnVlLCBmYWxzZSwgdHJ1ZSwgZmFsc2UpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAoaW5kZXggPT09IHNuaWNrckRhdGEubGVuZ3RoLTEgJiYgcmVtYWluaW5nQ29zVmFsID49IDEwMCkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyBSaWdodCByb3VuZGVkIHJlY3RhbmdsZQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gcm91bmRlZF9yZWN0KG5leHRYKGQuZGF0YSwgaW5kZXgpLCAwLCBzY2FsZShkLmRhdGEpLCBDb3NDaGFydFdpdGhCYXJEM0NvbmZpZy5iYXJIZWlnaHQsIENvc0NoYXJ0V2l0aEJhckQzQ29uZmlnLmJhckNvcm5lclJhZGl1cywgZmFsc2UsIHRydWUsIGZhbHNlLCB0cnVlKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb25zb2xlLmxvZygnbm9ybWFsIHJlY3QgYXQgJyArIGluZGV4KTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHJvdW5kZWRfcmVjdChuZXh0WChkLmRhdGEsIGluZGV4KSwgMCwgc2NhbGUoZC5kYXRhKSwgQ29zQ2hhcnRXaXRoQmFyRDNDb25maWcuYmFySGVpZ2h0LCAwLCBmYWxzZSwgZmFsc2UsIGZhbHNlLCBmYWxzZSk7IAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgIH0pOworCisgICAgICAgICAgICAgICAgICAgIGlmIChyZW1haW5pbmdDb3NWYWwgPT09IDApIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIHNuaWNrcmJhci5hdHRyKCJmaWxsIiwgQ29zQ2hhcnRXaXRoQmFyRDNDb25maWcuY2hhcnRjb2xvci56ZXJvQ29sb3IpOworICAgICAgICAgICAgICAgICAgICB9CisKKyAgICAgICAgICAgICAgICAgICAgLy8gYWRkIGJhciB0ZXh0IGVsZW1lbnQKKyAgICAgICAgICAgICAgICAgICAgLyp2YXIgc25pY2tlclRleHQgPSBkMy5zZWxlY3QoJy5zbmlja3JCYXIgc3ZnJykKKyAgICAgICAgICAgICAgICAgICAgICAgIC5hcHBlbmQoImciKQorICAgICAgICAgICAgICAgICAgICAgICAgLnN0eWxlKCJmaWxsIiwgImJsYWNrIik7CisKKyAgICAgICAgICAgICAgICAgICAgdmFyIGJhclRleHRWYWx1ZSA9IHNuaWNrZXJUZXh0LmFwcGVuZCgidGV4dCIpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgLmF0dHIoInkiLCBDb3NDaGFydFdpdGhCYXJEM0NvbmZpZy5iYXJUZXh0VmFsdWVEeSkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAuYXR0cigieCIsIENvc0NoYXJ0V2l0aEJhckQzQ29uZmlnLmJhclRleHRWYWx1ZUR4KQorICAgICAgICAgICAgICAgICAgICAgICAgICAgIC5hdHRyKCJjbGFzcyIsICJjb3NjaGFydGJhcmNlbnRlclZhbHVlIik7CisgICAgICAgICAgICAgICAgICAgIHZhciBiYXJUZXh0UGVyY2VudCA9IHNuaWNrZXJUZXh0LmFwcGVuZCgidGV4dCIpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgLmF0dHIoIngiLCBDb3NDaGFydFdpdGhCYXJEM0NvbmZpZy5iYXJUZXh0UGVyY2VudER4KQorICAgICAgICAgICAgICAgICAgICAgICAgICAgIC5hdHRyKCJ5IiwgQ29zQ2hhcnRXaXRoQmFyRDNDb25maWcuY2VudGVyVGV4dFBlcmNlbnREeSkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAuYXR0cigiY2xhc3MiLCAiY29zY2hhcnRiYXJjZW50ZXJQZXJjZW50Iik7CisgICAgICAgICAgICAgICAgICAgIHZhciBiYXJUZXh0TGFiZWwgPSBzbmlja2VyVGV4dC5hcHBlbmQoInRleHQiKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgIC5hdHRyKCJ5IiwgQ29zQ2hhcnRXaXRoQmFyRDNDb25maWcuYmFyVGV4dExhYmVsRHkpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgLmF0dHIoIngiLCBDb3NDaGFydFdpdGhCYXJEM0NvbmZpZy5iYXJUZXh0TGFiZWxEeCkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAuYXR0cigiY2xhc3MiLCAiY29zY2hhcnRiYXJjZW50ZXJMYWJlbCIpOworICAgICAgICAgICAgICAgICAgICBiYXJUZXh0VmFsdWUudGV4dChjb3N2YWwpOworICAgICAgICAgICAgICAgICAgICBiYXJUZXh0UGVyY2VudC50ZXh0KCIlIik7CisgICAgICAgICAgICAgICAgICAgIGJhclRleHRMYWJlbC50ZXh0KENvc0NoYXJ0V2l0aEJhckQzQ29uZmlnLmRlZmF1bHRiYXJsYWJlbCk7Ki8KKworICAgICAgICAgICAgICAgICAgICAKKworICAgICAgICAgICAgICAgICAgICAvLyBhbmltYXRlIGZ1bmN0aW9uCisgICAgICAgICAgICAgICAgICAgIGZ1bmN0aW9uIHR3ZWVuUGllKGIpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIHZhciBpID0gZDMuaW50ZXJwb2xhdGUoeworICAgICAgICAgICAgICAgICAgICAgICAgICAgIHN0YXJ0QW5nbGU6IDIuMSAqIE1hdGguUEksCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgZW5kQW5nbGU6IDIuMSAqIE1hdGguUEkKKyAgICAgICAgICAgICAgICAgICAgICAgIH0sIGIpOworICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGZ1bmN0aW9uICh0KSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGFyYyhpKHQpKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIH07CisgICAgICAgICAgICAgICAgICAgIH0KKworICAgICAgICAgICAgICAgICAgICBzY29wZS4kd2F0Y2goJ21vdXNlT3ZlcicsIGZ1bmN0aW9uKHZhbCkgeworICAgICAgICAgICAgICAgICAgICAgICAgaWYgKCFhbmd1bGFyLmlzRGVmaW5lZChzY29wZS5tb3VzZU92ZXIpKSB7IHJldHVybjsgfQorICAgICAgICAgICAgICAgICAgICAgICAgdmFyIGlkID0gc2NvcGUubW91c2VPdmVyLnNwbGl0KCctJylbMV07CisgICAgICAgICAgICAgICAgICAgICAgICBpZiAoc2NvcGUubW91c2VPdmVyLnNwbGl0KCctJylbMF0gPT09ICd0cnVlJykgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChpZCA9PT0gJzAnKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGQzLnNlbGVjdCgiI2Nvc3BhdGgtIiArIGlkKS50cmFuc2l0aW9uKCkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC5kdXJhdGlvbihDb3NDaGFydFdpdGhCYXJEM0NvbmZpZy5hbmltZHVyYXRpb24pCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAuYXR0cigiZCIsIGFyY092ZXIpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZvciAodmFyIGkgPSAwOyBpIDwgbmV3RGF0YS5sZW5ndGgtMTsgaSsrKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBkMy5zZWxlY3QoIiNjb3NwYXRoLSIgKyAoaSsxKSkudHJhbnNpdGlvbigpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLmR1cmF0aW9uKENvc0NoYXJ0V2l0aEJhckQzQ29uZmlnLmFuaW1kdXJhdGlvbikKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAuYXR0cigiZCIsIGFyY092ZXIpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoaWQgPT09ICcwJykgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBkMy5zZWxlY3QoIiNjb3NwYXRoLSIgKyBpZCkudHJhbnNpdGlvbigpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAuZHVyYXRpb24oQ29zQ2hhcnRXaXRoQmFyRDNDb25maWcuYW5pbWR1cmF0aW9uKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLmF0dHIoImQiLCBhcmMpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZvciAoaiA9IDA7IGogPCBuZXdEYXRhLmxlbmd0aC0xOyBqKyspIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGQzLnNlbGVjdCgiI2Nvc3BhdGgtIiArIChqKzEpKS50cmFuc2l0aW9uKCkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAuZHVyYXRpb24oQ29zQ2hhcnRXaXRoQmFyRDNDb25maWcuYW5pbWR1cmF0aW9uKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC5hdHRyKCJkIiwgYXJjKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgfSk7CisKKyAgICAgICAgICAgICAgICB9KTsKKworICAgICAgICAgICAgfQorICAgICAgICB9OworICAgIH1dKTsKK2FuZ3VsYXIubW9kdWxlKCdhdHQuY2hhcnRzLmNvc2RlbGV0aW9uRDMnLCBbJ2F0dC5jaGFydHMudXRpbGl0aWVzJ10pCisgICAgICAgIC5jb25zdGFudCgiQ29zZGVsZXRpb25EM0NvbmZpZyIsCisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAiY2hhcnRjb2xvciI6IHsKKyAgICAgICAgICAgICAgICAgICAgICAgICJNYXhCYW5kd2lkdGhSZWFjaGVkIjogIiNkM2QzZDMiLAorICAgICAgICAgICAgICAgICAgICAgICAgIlplcm9CYW5kd2lkdGhTZWxlY3RlZCI6ICIjRkVGRkY3IiwKKyAgICAgICAgICAgICAgICAgICAgICAgICJSZW1haW5pbmdCYW5kd2lkdGhDb2xvciI6ICIjZmZmZmZmIiwKKyAgICAgICAgICAgICAgICAgICAgICAgICJSZW1haW5pbmdCYW5kd2lkdGhTdHJva2VDb2xvciI6ICIjZDNkM2QzIiwKKyAgICAgICAgICAgICAgICAgICAgICAgICJSZW1haW5pbmdCYW5kd2lkdGhTdHJva2VXaWR0aCI6IDEuNSwKKyAgICAgICAgICAgICAgICAgICAgICAgICJVc2VkQmFuZHdpZHRoQ29sb3IiOiAiIzA1NzRBQyIsCisgICAgICAgICAgICAgICAgICAgICAgICAiVXNlZEJhbmR3aWR0aFN0cm9rZUNvbG9yIjoiI2VmZWZlZiIsIC8vd2hpdGUKKyAgICAgICAgICAgICAgICAgICAgICAgICJVc2VkQmFuZHdpZHRoU3Ryb2tlV2lkdGgiOiIxIgorICAgICAgICAgICAgICAgICAgICB9LAorICAgICAgICAgICAgICAgICAgICAiZGVmYXVsdGNlbnRlcmxhYmVsIjogIkticHMiLAorICAgICAgICAgICAgICAgICAgICAiem9vbUxldmVsIjogIjEwIiwKKyAgICAgICAgICAgICAgICAgICAgImRvdWdobnV0cmF0aW8iOiAyMSwKKyAgICAgICAgICAgICAgICAgICAgImFuaW1kdXJhdGlvbiI6ICIzMDAiLAorICAgICAgICAgICAgICAgICAgICAiZ3VhZ2VTdGFydEFuZ2xlIjo0LAorICAgICAgICAgICAgICAgICAgICAiZ3VhZ2VFbmRBbmdsZSI6OC41NiwKKyAgICAgICAgICAgICAgICAgICAgImxlZ2VuZHJlcWQiOiAiZmFsc2UiLAorICAgICAgICAgICAgICAgICAgICAiaW5pdGR1cmF0aW9uIjogIjEwMDAiLAorICAgICAgICAgICAgICAgICAgICAibGVnZW5kcG9zaXRpb24iOiAidG9wIiwKKyAgICAgICAgICAgICAgICAgICAgImNlbnRlclRleHRMYWJlbER5IjogIjIwIiwKKyAgICAgICAgICAgICAgICAgICAgImNlbnRlclRleHRWYWx1ZUR5IjogIjAiLAorICAgICAgICAgICAgICAgICAgICAiY2VudGVyVGV4dFZhbHVlRHgiOiAiLTMwIiwKKyAgICAgICAgICAgICAgICAgICAgImNlbnRlclRleHRMYWJlbER4IjogIi0xMCIsCisgICAgICAgICAgICAgICAgICAgICJtYXhiYW5kd2lkdGhUZXh0RHgiOiAiMjUiLAorICAgICAgICAgICAgICAgICAgICAibWF4YmFuZHdpZHRoVGV4dER5IjogIjcwIiwKKyAgICAgICAgICAgICAgICAgICAgImFyY092ZXJNYXJnaW4iOiA1CisgICAgICAgICAgICAgICAgfSkKKyAgICAgICAgLmRpcmVjdGl2ZSgnYXR0Q29zZGVsZXRpb25kM0NoYXJ0JywgWydDb3NkZWxldGlvbkQzQ29uZmlnJywgJyR0aW1lb3V0JywnJGV4dGVuZE9iaicsIGZ1bmN0aW9uKENvc2RlbGV0aW9uRDNDb25maWcsICR0aW1lb3V0LCRleHRlbmRPYmopIHsKKyAgICAgICAgICAgICAgICByZXR1cm4geworICAgICAgICAgICAgICAgICAgICByZXN0cmljdDogJ0EnLAorICAgICAgICAgICAgICAgICAgICBzY29wZTogeworICAgICAgICAgICAgICAgICAgICAgICAgbWF4VmFsdWU6ICc9JywKKyAgICAgICAgICAgICAgICAgICAgICAgIGNoYXJ0RGF0YTogJz0nLAorICAgICAgICAgICAgICAgICAgICAgICAgY2hhcnRDb25maWc6ICc9JywKKyAgICAgICAgICAgICAgICAgICAgICAgIHJlc2V0Q2hhcnQ6ICc9JywKKyAgICAgICAgICAgICAgICAgICAgICAgIHJlbW92ZUFyY3M6ICc9JworICAgICAgICAgICAgICAgICAgICB9LAorICAgICAgICAgICAgICAgICAgICBjb250cm9sbGVyOiBbJyRzY29wZScsICckYXR0cnMnLCBmdW5jdGlvbigkc2NvcGUsICRhdHRycykgeworICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGFuZ3VsYXIuaXNEZWZpbmVkKCRzY29wZS5jaGFydENvbmZpZykpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBDb3NkZWxldGlvbkQzQ29uZmlnID0gJGV4dGVuZE9iai5leHRlbmREZWVwKENvc2RlbGV0aW9uRDNDb25maWcsICRzY29wZS5jaGFydENvbmZpZyk7CisgICAgICAgICAgICAgICAgICAgICAgICB9CisKKyAgICAgICAgICAgICAgICAgICAgICAgIH1dLAorICAgICAgICAgICAgICAgICAgICBsaW5rOiBmdW5jdGlvbihzY29wZSwgZWxlbWVudCwgYXR0cnMpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIHZhciB6b29tID0gcGFyc2VJbnQoQ29zZGVsZXRpb25EM0NvbmZpZy56b29tTGV2ZWwsIDApLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBtYXJnaW4gPSB7Ly8gb3B0aW9uYWxseSBzZXQgbWFyZ2lucworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdG9wOiB6b29tLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmlnaHQ6IHpvb20sCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBib3R0b206IHpvb20sCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBsZWZ0OiB6b29tCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0sCisgICAgICAgICAgICAgICAgICAgICAgICB3aWR0aCA9IGF0dHJzLmNoYXJ0V2lkdGgsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGhlaWdodCA9IGF0dHJzLmNoYXJ0SGVpZ2h0LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByYWRpdXMgPSBNYXRoLm1pbigKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB3aWR0aCAtIChtYXJnaW4ubGVmdCArIG1hcmdpbi5yaWdodCksCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaGVpZ2h0IC0gKG1hcmdpbi50b3AgKyBtYXJnaW4uYm90dG9tKSkgLyAyLGFyY1BhdGg7CisgICAgICAgICAgICAgICAgICAgICAgICAvLyBzZXQgcmFkaXVzCisgICAgICAgICAgICAgICAgICAgICAgICB2YXIgYXJjID0gZDMuc3ZnLmFyYygpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC5pbm5lclJhZGl1cyhyYWRpdXMgLSBDb3NkZWxldGlvbkQzQ29uZmlnLmRvdWdobnV0cmF0aW8pCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC5vdXRlclJhZGl1cyhyYWRpdXMpOworICAgICAgICAgICAgICAgICAgICAgICAgdmFyIGFyY092ZXIgPSBkMy5zdmcuYXJjKCkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAuaW5uZXJSYWRpdXMocmFkaXVzIC0gQ29zZGVsZXRpb25EM0NvbmZpZy5kb3VnaG51dHJhdGlvKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC5vdXRlclJhZGl1cyhyYWRpdXMgKyBDb3NkZWxldGlvbkQzQ29uZmlnLmFyY092ZXJNYXJnaW4pOworICAgICAgICAgICAgICAgICAgICAgICAKKyAgICAgICAgICAgICAgICAgICAgICAgIC8vIEJyb3dzZXIgb25yZXNpemUgZXZlbnQKKyAgICAgICAgICAgICAgICAgICAgICAgIHdpbmRvdy5vbnJlc2l6ZSA9IGZ1bmN0aW9uKCkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNjb3BlLiRhcHBseSgpOworICAgICAgICAgICAgICAgICAgICAgICAgfTsKKyAgICAgICAgICAgICAgICAgICAgICAgIHNjb3BlLiR3YXRjaCgncmVzZXRDaGFydCcsIGZ1bmN0aW9uKG5ld1ZhbHVlLCBvbGRWYWx1ZSkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmKHNjb3BlLnJlc2V0Q2hhcnQgPT09IHRydWUpeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzY29wZS5yZXNldENoYXJ0ID0gZmFsc2U7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybjsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHNjb3BlLnJlbmRlcihuZXdWYWx1ZSwgb2xkVmFsdWUpOworICAgICAgICAgICAgICAgICAgICAgICAgfSk7CisgICAgICAgICAgICAgICAgICAgICAgICBzY29wZS5yZW5kZXIgPSBmdW5jdGlvbihuZXdWYWx1ZSwgb2xkVmFsdWUpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBkMy5zZWxlY3QoInN2ZyMiICsgYXR0cnMuaWQpLnJlbW92ZSgpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGQzLnNlbGVjdEFsbCgic3ZnIyIgKyBhdHRycy5pZCArICIgPiAqIikucmVtb3ZlKCk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKCFzY29wZS5jaGFydERhdGEpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm47CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhciBkYXRhPWFuZ3VsYXIuY29weShzY29wZS5jaGFydERhdGEpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRhdGE9ZGF0YS5yZXZlcnNlKCk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFyIHRvdGFsQmFuZHdpZHRoPTAsdG90YWxVc2VkPTAscmVtYWluaW5nQmFuZHdpZHRoPTAsZHluYW1pY0NvbG9yUmFuZ2U9W10sbm9DaGVja0JveFNlbGVjdGVkPXRydWUsc2VsZWN0ZWRCYW5kd2lkdGg9MCxzZWxlY3RlZEVsZW09W107CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGFuZ3VsYXIuaXNEZWZpbmVkKHNjb3BlLm1heFZhbHVlKSkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0b3RhbEJhbmR3aWR0aCA9IHBhcnNlSW50KHNjb3BlLm1heFZhbHVlLCAwKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgZm9yICh2YXIgaiA9IDA7IGogPCBkYXRhLmxlbmd0aDsgaisrKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRvdGFsVXNlZCA9ICh0b3RhbFVzZWQgKyBwYXJzZUludChkYXRhW2pdLnZhbHVlLCAwKSk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmKGFuZ3VsYXIuZXF1YWxzKGRhdGFbal0uc3RhdHVzLCB0cnVlKSl7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBub0NoZWNrQm94U2VsZWN0ZWQ9ZmFsc2U7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzZWxlY3RlZEJhbmR3aWR0aD1zZWxlY3RlZEJhbmR3aWR0aCtkYXRhW2pdLnZhbHVlOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBkYXRhW2pdLnZhbHVlPTA7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBkeW5hbWljQ29sb3JSYW5nZS5wdXNoKENvc2RlbGV0aW9uRDNDb25maWcuY2hhcnRjb2xvci5NYXhCYW5kd2lkdGhSZWFjaGVkKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1lbHNleworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2VsZWN0ZWRFbGVtLnB1c2goe2luZGV4OiBkYXRhW2pdLmlkLCB2YWx1ZTogZGF0YVtqXS52YWx1ZX0pOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZHluYW1pY0NvbG9yUmFuZ2UucHVzaChDb3NkZWxldGlvbkQzQ29uZmlnLmNoYXJ0Y29sb3IuVXNlZEJhbmR3aWR0aENvbG9yKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmKHNjb3BlLnJlbW92ZUFyY3MpeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB3aGlsZShkYXRhLmxlbmd0aCA+IDApIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRhdGEucG9wKCk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGR5bmFtaWNDb2xvclJhbmdlPVtdOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZGF0YS5wdXNoKHtuYW1lOiAidG90YWxVc2VkIiwgdmFsdWU6IHRvdGFsVXNlZC1zZWxlY3RlZEJhbmR3aWR0aCxpZDoidG90YWxVc2VkIn0pOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZHluYW1pY0NvbG9yUmFuZ2UucHVzaChDb3NkZWxldGlvbkQzQ29uZmlnLmNoYXJ0Y29sb3IuVXNlZEJhbmR3aWR0aENvbG9yKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNjb3BlLnJlbW92ZUFyY3M9ZmFsc2U7CisgICAgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYodG90YWxVc2VkPjAgJiYgdG90YWxVc2VkPHRvdGFsQmFuZHdpZHRoKXsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmVtYWluaW5nQmFuZHdpZHRoPXRvdGFsQmFuZHdpZHRoLXRvdGFsVXNlZDsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYoIW5vQ2hlY2tCb3hTZWxlY3RlZCl7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBkYXRhLnB1c2goe25hbWU6ICJzZWxlY3RlZEJhbmR3aWR0aCIsIHZhbHVlOiBzZWxlY3RlZEJhbmR3aWR0aCxpZDoic2VsZWN0ZWRCYW5kd2lkdGgifSk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBkeW5hbWljQ29sb3JSYW5nZS5wdXNoKENvc2RlbGV0aW9uRDNDb25maWcuY2hhcnRjb2xvci5NYXhCYW5kd2lkdGhSZWFjaGVkKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBkYXRhLnB1c2goe25hbWU6ICJyZW1haW5pbmciLCB2YWx1ZTogcmVtYWluaW5nQmFuZHdpZHRoLGlkOiJyZW1haW5pbmcifSk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGR5bmFtaWNDb2xvclJhbmdlLnB1c2goQ29zZGVsZXRpb25EM0NvbmZpZy5jaGFydGNvbG9yLlJlbWFpbmluZ0JhbmR3aWR0aENvbG9yKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgZWxlbWVudFswXS5zZXRBdHRyaWJ1dGUoJ2lkJywgYXR0cnMuaWQpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhciBzdmcgPSBkMy5zZWxlY3QoZWxlbWVudFswXSkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC5hdHRyKCJzdHlsZSIsICJoZWlnaHQ6ICIgKyBhdHRycy5jaGFydEhlaWdodCArICJweDsiKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLmFwcGVuZCgic3ZnIikKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC5hdHRyKCJpZCIsIGF0dHJzLmlkKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLmF0dHIoInJhZGl1cyIsIHJhZGl1cykKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC5hdHRyKCJ3aWR0aCIsIGF0dHJzLmNoYXJ0V2lkdGgpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAuYXR0cigiaGVpZ2h0IiwgYXR0cnMuY2hhcnRIZWlnaHQpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAuYXR0cigndmlld0JveCcsICcwIDAgJyArIE1hdGgubWluKHdpZHRoLCBoZWlnaHQpICsgJyAnICsgTWF0aC5taW4od2lkdGgsIGhlaWdodCkpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAuYXR0cigncHJlc2VydmVBc3BlY3RSYXRpbycsICd4TWluWU1pbicpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAuYXBwZW5kKCJnIikKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC5hdHRyKCJ0cmFuc2Zvcm0iLCAidHJhbnNsYXRlKCIgKyBNYXRoLm1pbih3aWR0aCwgaGVpZ2h0KSAvIDIgKyAiLCIgKyBNYXRoLm1pbih3aWR0aCwgaGVpZ2h0KSAvIDIgKyAiKSIpOworCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFyIGNlbnRlclRleHRWYWx1ZSA9IHN2Zy5hcHBlbmQoInRleHQiKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLmF0dHIoInkiLCBDb3NkZWxldGlvbkQzQ29uZmlnLmNlbnRlclRleHRWYWx1ZUR5KQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLmF0dHIoIngiLCBDb3NkZWxldGlvbkQzQ29uZmlnLmNlbnRlclRleHRWYWx1ZUR4KQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLmF0dHIoImNsYXNzIiwgImNvc2RlbGV0aW9uY2VudGVyVmFsdWUiKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YXIgY2VudGVyVGV4dExhYmVsID0gc3ZnLmFwcGVuZCgidGV4dCIpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAuYXR0cigieSIsIENvc2RlbGV0aW9uRDNDb25maWcuY2VudGVyVGV4dExhYmVsRHkpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAuYXR0cigieCIsIENvc2RlbGV0aW9uRDNDb25maWcuY2VudGVyVGV4dExhYmVsRHgpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAuYXR0cigiY2xhc3MiLCAiY29zZGVsZXRpb25jZW50ZXJMYWJlbCIpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhciBtYXhiYW5kd2lkdGhUZXh0ID0gc3ZnLmFwcGVuZCgidGV4dCIpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAuYXR0cigieSIsIENvc2RlbGV0aW9uRDNDb25maWcubWF4YmFuZHdpZHRoVGV4dER5KQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLmF0dHIoIngiLCBDb3NkZWxldGlvbkQzQ29uZmlnLm1heGJhbmR3aWR0aFRleHREeCkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC5hdHRyKCJjbGFzcyIsICJjb3NkZWxldGlvbm1heGJhbmR3aWR0aFRleHQiKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YXIgY29sb3IgPSBkMy5zY2FsZS5vcmRpbmFsKCkucmFuZ2UoZHluYW1pY0NvbG9yUmFuZ2UpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNlbnRlclRleHRWYWx1ZS50ZXh0KHRvdGFsVXNlZC1zZWxlY3RlZEJhbmR3aWR0aCk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgY2VudGVyVGV4dExhYmVsLnRleHQoQ29zZGVsZXRpb25EM0NvbmZpZy5kZWZhdWx0Y2VudGVybGFiZWwpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1heGJhbmR3aWR0aFRleHQudGV4dCh0b3RhbEJhbmR3aWR0aCArICIgIiArIENvc2RlbGV0aW9uRDNDb25maWcuZGVmYXVsdGNlbnRlcmxhYmVsKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YXIgcGllID0gZDMubGF5b3V0LnBpZSgpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAuc29ydChudWxsKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLnN0YXJ0QW5nbGUoQ29zZGVsZXRpb25EM0NvbmZpZy5ndWFnZVN0YXJ0QW5nbGUpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAuZW5kQW5nbGUoQ29zZGVsZXRpb25EM0NvbmZpZy5ndWFnZUVuZEFuZ2xlKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLnZhbHVlKGZ1bmN0aW9uKGQpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gZC52YWx1ZTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0pOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFyIGcgPSBzdmcuc2VsZWN0QWxsKCIuYXJjIikKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC5kYXRhKHBpZShkYXRhKSkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC5lbnRlcigpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAuYXBwZW5kKCJnIikKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC5hdHRyKCJjbGFzcyIsICJhcmMiKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLmF0dHIoImlkIiwgZnVuY3Rpb24oZCwgaSkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiAiY29zZGVsZXRpb25hcmMtIiArIGQuZGF0YS5pZDsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0pCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAuc3R5bGUoImN1cnNvciIsICJwb2ludGVyIik7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgYXJjUGF0aCA9IGcuYXBwZW5kKCJwYXRoIikKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAuc3R5bGUoImZpbGwiLCBmdW5jdGlvbihkKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBjb2xvcihkLmRhdGEubmFtZSk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSkuYXR0cigiaWQiLCBmdW5jdGlvbihkLCBpKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiAiY29zZGVsZXRpb25wYXRoLSIgKyBkLmRhdGEuaWQ7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAudHJhbnNpdGlvbigpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLmVhc2UoImV4cCIpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLmR1cmF0aW9uKDApCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLmF0dHJUd2VlbigiZCIsIHR3ZWVuUGllKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgYXJjUGF0aCA9IGFyY1BhdGhbMF07CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgZm9yICh2YXIgaSA9IDA7IGkgPCBhcmNQYXRoLmxlbmd0aDsgaSsrKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YXIgaWQgPSBhcmNQYXRoW2ldLmlkOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGlkICE9PSAnY29zZGVsZXRpb25wYXRoLXJlbWFpbmluZycgJiYgaWQgIT09ICdjb3NkZWxldGlvbnBhdGgtc2VsZWN0ZWRCYW5kd2lkdGgnKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZDMuc2VsZWN0KCJwYXRoIyIgKyBpZCkudHJhbnNpdGlvbigpLmF0dHIoImQiLCBhcmNPdmVyKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgICAKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAocmVtYWluaW5nQmFuZHdpZHRoID4gMCkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZihhbmd1bGFyLmlzRGVmaW5lZChuZXdWYWx1ZSkgJiYgYW5ndWxhci5pc0RlZmluZWQob2xkVmFsdWUpKXsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZvciAodmFyIGsgPSAwOyBrIDwgc2VsZWN0ZWRFbGVtLmxlbmd0aDsgaysrKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhciBpbmRleCA9c2VsZWN0ZWRFbGVtW2tdLmluZGV4OworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGQzLnNlbGVjdCgicGF0aCNjb3NkZWxldGlvbnBhdGgtIiArIGluZGV4KS5zdHlsZSgnc3Ryb2tlJywgQ29zZGVsZXRpb25EM0NvbmZpZy5jaGFydGNvbG9yLlVzZWRCYW5kd2lkdGhTdHJva2VDb2xvcikuc3R5bGUoInN0cm9rZS13aWR0aCIsIENvc2RlbGV0aW9uRDNDb25maWcuY2hhcnRjb2xvci5Vc2VkQmFuZHdpZHRoU3Ryb2tlV2lkdGgpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGQzLnNlbGVjdCgiIyIgKyBhdHRycy5pZCArICIgcGF0aCNjb3NkZWxldGlvbnBhdGgtcmVtYWluaW5nIikuc3R5bGUoJ3N0cm9rZScsIENvc2RlbGV0aW9uRDNDb25maWcuY2hhcnRjb2xvci5SZW1haW5pbmdCYW5kd2lkdGhTdHJva2VDb2xvcikuc3R5bGUoInN0cm9rZS13aWR0aCIsIENvc2RlbGV0aW9uRDNDb25maWcuY2hhcnRjb2xvci5SZW1haW5pbmdCYW5kd2lkdGhTdHJva2VXaWR0aCk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSAKKyAgICAgICAgICAgICAgICAgICAgICAgIH07CisgICAgICAgICAgICAgICAgICAgICAgICAKKyAgICAgICAgICAgICAgICAgICAgICAgIGZ1bmN0aW9uIHR3ZWVuUGllKGIpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFyIGkgPSBkMy5pbnRlcnBvbGF0ZSh7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzdGFydEFuZ2xlOiAyLjEgKiBNYXRoLlBJLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZW5kQW5nbGU6IDIuMSAqIE1hdGguUEkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSwgYik7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBmdW5jdGlvbih0KSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gYXJjKGkodCkpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9OworICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIH07CisgICAgICAgICAgICB9XSk7Cithbmd1bGFyLm1vZHVsZSgnYXR0LmNoYXJ0cy5jb3NtdWx0aWNoYXJ0RDMnLCBbJ2F0dC5jaGFydHMudXRpbGl0aWVzJ10pCisgICAgICAgIC5jb25zdGFudCgiQ29zTXVsdGlDaGFydEQzQ29uZmlnIiwKKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgICJjaGFydGNvbG9yIjogeworICAgICAgICAgICAgICAgICAgICAgICAgInBhbGV0dGVDb2xvcnMiOiBbIiM0NGM2ZjciLCAiIzRiYTkwYiIsICIjZDcwZTgwIiwgIiNmZjk5MDAiLCAiIzgxMDE3ZSIsICIjY2NjY2NjIl0sIC8vZGVmYXVsdCBjb2xvciBvcHRpb25zIGZvciByZW5kZXJpbmcgY2hhcnQgYmFzZUNvbG9yIGFuZCBOZWVkbGVDb2xvciwKKyAgICAgICAgICAgICAgICAgICAgICAgICJ6ZXJvVGlja2V0Q29sb3IiOiBbIiNkM2QzZDMiXQorICAgICAgICAgICAgICAgICAgICB9LAorICAgICAgICAgICAgICAgICAgICAiZGVmYXVsdGNlbnRlcmxhYmVsIjogIkNvUyIsCisgICAgICAgICAgICAgICAgICAgICJkZWZhdWx0Y2VudGVyY2F0ZWdvcnkiOiAiMlYvMi8zLzQvNSIsCisgICAgICAgICAgICAgICAgICAgICJ6b29tTGV2ZWwiOiAiMjUiLAorICAgICAgICAgICAgICAgICAgICAiZG91Z2hudXRyYXRpbyI6IDIwLAorICAgICAgICAgICAgICAgICAgICAiYW5pbWR1cmF0aW9uIjogIjMwMCIsCisgICAgICAgICAgICAgICAgICAgICJsZWdlbmRyZXFkIjogImZhbHNlIiwKKyAgICAgICAgICAgICAgICAgICAgImluaXRkdXJhdGlvbiI6ICIxMDAwIiwKKyAgICAgICAgICAgICAgICAgICAgImxlZ2VuZHBvc2l0aW9uIjogInRvcCIsCisgICAgICAgICAgICAgICAgICAgICJjZW50ZXJUZXh0VmFsdWVEeSI6ICIwIiwKKyAgICAgICAgICAgICAgICAgICAgImNlbnRlclRleHRWYWx1ZUR4IjogIjAiLAorICAgICAgICAgICAgICAgICAgICAiY2VudGVyVGV4dFBlcmNlbnREeCI6ICIyMiIsCisgICAgICAgICAgICAgICAgICAgICJjZW50ZXJUZXh0UGVyY2VudER5IjogIi04IiwKKyAgICAgICAgICAgICAgICAgICAgImNlbnRlclRleHRMYWJlbER5IjogIjIwIiwKKyAgICAgICAgICAgICAgICAgICAgImNlbnRlclRleHRMYWJlbER4IjogIjAiLAorICAgICAgICAgICAgICAgICAgICAiYXJjT3Zlck1hcmdpbiI6IDUKKyAgICAgICAgICAgICAgICB9KQorICAgICAgICAuZGlyZWN0aXZlKCdhdHRDb3NtdWx0aWQzQ2hhcnQnLCBbJ0Nvc011bHRpQ2hhcnREM0NvbmZpZycsICckdGltZW91dCcsJyRleHRlbmRPYmonLCBmdW5jdGlvbiAoQ29zTXVsdGlDaGFydEQzQ29uZmlnLCAkdGltZW91dCwkZXh0ZW5kT2JqKSB7CisgICAgICAgICAgICAgICAgcmV0dXJuIHsKKyAgICAgICAgICAgICAgICAgICAgcmVzdHJpY3Q6ICdBJywKKyAgICAgICAgICAgICAgICAgICAgc2NvcGU6IHsKKyAgICAgICAgICAgICAgICAgICAgICAgIGNoYXJ0RGF0YTogJz0nLAorICAgICAgICAgICAgICAgICAgICAgICAgY2hhcnRDb25maWc6ICc9JworICAgICAgICAgICAgICAgICAgICB9LAorICAgICAgICAgICAgICAgICAgICB0ZW1wbGF0ZVVybDogJ3RlbXBsYXRlL2Nvc211bHRpY2hhcnREMy9hdHRDb3NtdWx0aWQzQ2hhcnQuaHRtbCcsCisgICAgICAgICAgICAgICAgICAgIHRyYW5zY2x1ZGU6IHRydWUsCisgICAgICAgICAgICAgICAgICAgIHJlcGxhY2U6IHRydWUsCisgICAgICAgICAgICAgICAgICAgIGNvbnRyb2xsZXI6IFsnJHNjb3BlJywgJyRhdHRycycsIGZ1bmN0aW9uICgkc2NvcGUsICRhdHRycykgeworCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGFuZ3VsYXIuaXNEZWZpbmVkKCRzY29wZS5jaGFydENvbmZpZykpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgQ29zTXVsdGlDaGFydEQzQ29uZmlnID0gJGV4dGVuZE9iai5leHRlbmREZWVwKENvc011bHRpQ2hhcnREM0NvbmZpZywgJHNjb3BlLmNoYXJ0Q29uZmlnKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CisKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAkc2NvcGUuYWRkTGVnZW5kQ29sb3IgPSBmdW5jdGlvbiAoaWQsIGl0ZW0pIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHsiY29sb3IiOiBDb3NNdWx0aUNoYXJ0RDNDb25maWcuY2hhcnRjb2xvci5wYWxldHRlQ29sb3JzW2lkXX07CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgfTsKKworICAgICAgICAgICAgICAgICAgICAgICAgICAgICRzY29wZS5jaGFydElEID0gJGF0dHJzLmlkOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICghYW5ndWxhci5pc0RlZmluZWQoJGF0dHJzLmxlZ2VuZFJlcXVpcmVkKSkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAkc2NvcGUubGVnZW5kUmVxdWlyZWQgPSBDb3NNdWx0aUNoYXJ0RDNDb25maWcubGVnZW5kcmVxZDsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAkc2NvcGUubGVnZW5kUmVxdWlyZWQgPSAkYXR0cnMubGVnZW5kUmVxdWlyZWQ7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICghYW5ndWxhci5pc0RlZmluZWQoJGF0dHJzLmxlZ2VuZFBvc2l0aW9uKSkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAkc2NvcGUubGVnZW5kUG9zaXRpb24gPSBDb3NNdWx0aUNoYXJ0RDNDb25maWcubGVnZW5kcG9zaXRpb247CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJHNjb3BlLmxlZ2VuZFBvc2l0aW9uID0gJGF0dHJzLmxlZ2VuZFBvc2l0aW9uOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgIH1dLAorICAgICAgICAgICAgICAgICAgICBsaW5rOiBmdW5jdGlvbiAoc2NvcGUsIGVsZW1lbnQsIGF0dHJzKSB7CisgICAgICAgICAgICAgICAgICAgICAgICB2YXIgem9vbSA9IHBhcnNlSW50KENvc011bHRpQ2hhcnREM0NvbmZpZy56b29tTGV2ZWwsIDApLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwaSA9IE1hdGguUEksCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1hcmdpbiA9IHsvLyBvcHRpb25hbGx5IHNldCBtYXJnaW5zCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0b3A6IHpvb20sCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByaWdodDogem9vbSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJvdHRvbTogem9vbSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxlZnQ6IHpvb20KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSwKKyAgICAgICAgICAgICAgICAgICAgICAgIHdpZHRoID0gYXR0cnMuY2hhcnRXaWR0aCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaGVpZ2h0ID0gYXR0cnMuY2hhcnRIZWlnaHQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJhZGl1cyA9IE1hdGgubWluKAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHdpZHRoIC0gKG1hcmdpbi5sZWZ0ICsgbWFyZ2luLnJpZ2h0KSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBoZWlnaHQgLSAobWFyZ2luLnRvcCArIG1hcmdpbi5ib3R0b20pKSAvIDI7CisKKyAgICAgICAgICAgICAgICAgICAgICAgIGZ1bmN0aW9uIHJlbmRlckNoYXJ0KCkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhciBjb2xvciA9IGQzLnNjYWxlLm9yZGluYWwoKS5yYW5nZShDb3NNdWx0aUNoYXJ0RDNDb25maWcuY2hhcnRjb2xvci5wYWxldHRlQ29sb3JzKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBkMy5zZWxlY3QoInN2ZyMiICsgYXR0cnMuaWQpLnJlbW92ZSgpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGQzLnNlbGVjdEFsbCgic3ZnIyIgKyBhdHRycy5pZCArICIgPiAqIikucmVtb3ZlKCk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFyIHRvdGFsQ29zVmFsID0gMCwgcmVtYWluaW5nQ29zVmFsOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZvciAodmFyIGogPSAwOyBqIDwgc2NvcGUuY2hhcnREYXRhLmxlbmd0aDsgaisrKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhciBjaGFydE9iaiA9IHNjb3BlLmNoYXJ0RGF0YVtqXTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdG90YWxDb3NWYWwgPSAodG90YWxDb3NWYWwgKyBwYXJzZUludChjaGFydE9iai52YWx1ZSwgMTApKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmVtYWluaW5nQ29zVmFsID0gMTAwIC0gcGFyc2VJbnQodG90YWxDb3NWYWwsIDEwKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YXIgZGF0YSA9IGFuZ3VsYXIuY29weShzY29wZS5jaGFydERhdGEpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChhbmd1bGFyLmlzRGVmaW5lZChyZW1haW5pbmdDb3NWYWwpKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRhdGEucHVzaCh7bmFtZTogInJlc3QiLCB2YWx1ZTogcmVtYWluaW5nQ29zVmFsfSk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgICAgIGVsZW1lbnRbMF0ucXVlcnlTZWxlY3RvcignLmNvc211bHRpZDNDb250YWluZXInKS5zZXRBdHRyaWJ1dGUoJ2lkJywgYXR0cnMuaWQpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vIGJ1aWxkIGNoYXJ0CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFyIHN2ZyA9IGQzLnNlbGVjdCgiLmNvc211bHRpZDNDb250YWluZXIjIiArIGF0dHJzLmlkKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLmF0dHIoInN0eWxlIiwgImhlaWdodDogIiArIGF0dHJzLmNoYXJ0SGVpZ2h0ICsgInB4OyIpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAuYXBwZW5kKCJzdmciKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLmF0dHIoImlkIiwgYXR0cnMuaWQpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAuYXR0cigid2lkdGgiLCAiMTAwJSIpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAuYXR0cigiaGVpZ2h0IiwgIjEwMCUiKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLmF0dHIoJ3ZpZXdCb3gnLCAnMCAwICcgKyBNYXRoLm1pbih3aWR0aCwgaGVpZ2h0KSArICcgJyArIE1hdGgubWluKHdpZHRoLCBoZWlnaHQpKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLmF0dHIoJ3ByZXNlcnZlQXNwZWN0UmF0aW8nLCAneE1pbllNaW4nKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLmFwcGVuZCgiZyIpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAuYXR0cigidHJhbnNmb3JtIiwgInRyYW5zbGF0ZSgiICsgTWF0aC5taW4od2lkdGgsIGhlaWdodCkgLyAyICsgIiwiICsgTWF0aC5taW4od2lkdGgsIGhlaWdodCkgLyAyICsgIikiKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyBzZXQgcmFkaXVzCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFyIGFyYyA9IGQzLnN2Zy5hcmMoKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLmlubmVyUmFkaXVzKHJhZGl1cyAtIENvc011bHRpQ2hhcnREM0NvbmZpZy5kb3VnaG51dHJhdGlvKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLm91dGVyUmFkaXVzKHJhZGl1cyk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gc2V0IGhvdmVyZWQgcmFkaXVzCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFyIGFyY092ZXIgPSBkMy5zdmcuYXJjKCkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC5pbm5lclJhZGl1cyhyYWRpdXMgLSBDb3NNdWx0aUNoYXJ0RDNDb25maWcuZG91Z2hudXRyYXRpbykKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC5vdXRlclJhZGl1cyhyYWRpdXMgKyBDb3NNdWx0aUNoYXJ0RDNDb25maWcuYXJjT3Zlck1hcmdpbik7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gYWRkIGNlbnRlciB0ZXh0IGVsZW1lbnQKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YXIgY2VudGVyVGV4dFZhbHVlID0gc3ZnLmFwcGVuZCgidGV4dCIpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAuYXR0cigieSIsIENvc011bHRpQ2hhcnREM0NvbmZpZy5jZW50ZXJUZXh0VmFsdWVEeSkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC5hdHRyKCJ4IiwgQ29zTXVsdGlDaGFydEQzQ29uZmlnLmNlbnRlclRleHRWYWx1ZUR4KQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLmF0dHIoImNsYXNzIiwgImNvc211bHRpY2hhcnRjZW50ZXJWYWx1ZSIpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhciBjZW50ZXJUZXh0UGVyY2VudCA9IHN2Zy5hcHBlbmQoInRleHQiKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLmF0dHIoIngiLCBDb3NNdWx0aUNoYXJ0RDNDb25maWcuY2VudGVyVGV4dFBlcmNlbnREeCkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC5hdHRyKCJ5IiwgQ29zTXVsdGlDaGFydEQzQ29uZmlnLmNlbnRlclRleHRQZXJjZW50RHkpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAuYXR0cigiY2xhc3MiLCAiY29zbXVsdGljaGFydGNlbnRlclBlcmNlbnQiKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YXIgY2VudGVyVGV4dExhYmVsID0gc3ZnLmFwcGVuZCgidGV4dCIpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAuYXR0cigieSIsIENvc011bHRpQ2hhcnREM0NvbmZpZy5jZW50ZXJUZXh0TGFiZWxEeSkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC5hdHRyKCJ4IiwgQ29zTXVsdGlDaGFydEQzQ29uZmlnLmNlbnRlclRleHRMYWJlbER4KQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLmF0dHIoImNsYXNzIiwgImNvc211bHRpY2hhcnRjZW50ZXJMYWJlbCIpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNlbnRlclRleHRWYWx1ZS50ZXh0KHRvdGFsQ29zVmFsKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBjZW50ZXJUZXh0UGVyY2VudC50ZXh0KCIlIik7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgY2VudGVyVGV4dExhYmVsLnRleHQoQ29zTXVsdGlDaGFydEQzQ29uZmlnLmRlZmF1bHRjZW50ZXJsYWJlbCArIiAgIiArIENvc011bHRpQ2hhcnREM0NvbmZpZy5kZWZhdWx0Y2VudGVyY2F0ZWdvcnkpOworCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHRvdGFsQ29zVmFsIDw9IDApIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYXJjLnN0YXJ0QW5nbGUoMCkuZW5kQW5nbGUoMiAqIHBpKTsgLy9qdXN0IHJhZGlhbnMKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc3ZnLmFwcGVuZCgicGF0aCIpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLmF0dHIoImQiLCBhcmMpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLmF0dHIoImZpbGwiLCBDb3NNdWx0aUNoYXJ0RDNDb25maWcuY2hhcnRjb2xvci56ZXJvVGlja2V0Q29sb3IpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhciBwaWUgPSBkMy5sYXlvdXQucGllKCkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAuc29ydChudWxsKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC5zdGFydEFuZ2xlKDMuMiAqIE1hdGguUEkpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLmVuZEFuZ2xlKDUuMiAqIE1hdGguUEkpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLnZhbHVlKGZ1bmN0aW9uIChkKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBkLnZhbHVlOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0pOworCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhciBnID0gc3ZnLnNlbGVjdEFsbCgiLmFyYyIpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLmRhdGEocGllKGRhdGEpKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC5lbnRlcigpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLmFwcGVuZCgiZyIpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLmF0dHIoImNsYXNzIiwgImFyYyIpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLmF0dHIoImlkIiwgZnVuY3Rpb24gKGQsIGkpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuICJjb3NtdWx0aWFyYy0iICsgaTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9KQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC5zdHlsZSgiY3Vyc29yIiwgInBvaW50ZXIiKTsKKworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBnLmFwcGVuZCgicGF0aCIpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLnN0eWxlKCJmaWxsIiwgZnVuY3Rpb24gKGQpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGNvbG9yKGQuZGF0YS5uYW1lKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9KQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC5hdHRyKCJpZCIsIGZ1bmN0aW9uIChkLCBpKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiAiY29zbXVsdGlwYXRoLSIgKyBpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0pCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLnN0eWxlKCJzdHJva2UiLCAid2hpdGUiKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC5zdHlsZSgic3Ryb2tlLXdpZHRoIiwgMSkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAub24oIm1vdXNlb3ZlciIsIGZ1bmN0aW9uIChkKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGQzLnNlbGVjdCh0aGlzKS50cmFuc2l0aW9uKCkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAuZHVyYXRpb24oQ29zTXVsdGlDaGFydEQzQ29uZmlnLmFuaW1kdXJhdGlvbikKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAuYXR0cigiZCIsIGFyY092ZXIpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0pCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLm9uKCJtb3VzZW91dCIsIGZ1bmN0aW9uIChkKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGQzLnNlbGVjdCh0aGlzKS50cmFuc2l0aW9uKCkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAuZHVyYXRpb24oQ29zTXVsdGlDaGFydEQzQ29uZmlnLmFuaW1kdXJhdGlvbikKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAuYXR0cigiZCIsIGFyYyk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAudHJhbnNpdGlvbigpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLmVhc2UoImV4cCIpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLmR1cmF0aW9uKDApCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLmF0dHJUd2VlbigiZCIsIHR3ZWVuUGllKTsKKworCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZ1bmN0aW9uIHR3ZWVuUGllKGIpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFyIGkgPSBkMy5pbnRlcnBvbGF0ZSh7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzdGFydEFuZ2xlOiAyLjEgKiBNYXRoLlBJLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZW5kQW5nbGU6IDIuMSAqIE1hdGguUEkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSwgYik7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBmdW5jdGlvbiAodCkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGFyYyhpKHQpKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICB9CisKKyAgICAgICAgICAgICAgICAgICAgICAgIHNjb3BlLiR3YXRjaCgnY2hhcnRDb25maWcnLCBmdW5jdGlvbih2YWx1ZSkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChhbmd1bGFyLmlzRGVmaW5lZChzY29wZS5jaGFydENvbmZpZykpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgQ29zTXVsdGlDaGFydEQzQ29uZmlnID0gJGV4dGVuZE9iai5leHRlbmREZWVwKENvc011bHRpQ2hhcnREM0NvbmZpZywgc2NvcGUuY2hhcnRDb25maWcpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KKworICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJlbmRlckNoYXJ0KCk7CisgICAgICAgICAgICAgICAgICAgICAgICB9LCB0cnVlKTsKKworICAgICAgICAgICAgICAgICAgICAgICAgc2NvcGUuJHdhdGNoKCdjaGFydERhdGEnLCBmdW5jdGlvbiAodmFsdWUpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICByZW5kZXJDaGFydCgpOworICAgICAgICAgICAgICAgICAgICAgICAgfSk7CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICB9OworICAgICAgICAgICAgfV0pOworYW5ndWxhci5tb2R1bGUoJ2F0dC5jaGFydHMuZG9udXREMycsIFsnYXR0LmNoYXJ0cy51dGlsaXRpZXMnXSkKKyAgICAgICAgLmNvbnN0YW50KCJEb251dENoYXJ0RDNDb25maWciLAorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgImNoYXJ0Y29sb3IiOiB7CisgICAgICAgICAgICAgICAgICAgICAgICAicGFsZXR0ZUNvbG9ycyI6IFsiIzY3Njc2NyIsICIjOTZCMUQwIiwgIiMwQjI0NzciLCAiI0ZGOTkwMCIsICIjODEwMTdEIiwgIiNCNkJGMDAiLCAiI0RBMDA4MSIsICIjMDBDN0IyIl0sIC8vZGVmYXVsdCBjb2xvciBvcHRpb25zIGZvciByZW5kZXJpbmcgY2hhcnQKKyAgICAgICAgICAgICAgICAgICAgICAgICJ6ZXJvVGlja2V0Q29sb3IiOiBbIiNkM2QzZDMiXSwKKyAgICAgICAgICAgICAgICAgICAgICAgICJjZW50ZXJUaWNrZXRDb3VudEhvdmVyQ29sb3IiOlsiIzA1NzRBQyJdCisgICAgICAgICAgICAgICAgICAgIH0sCisgICAgICAgICAgICAgICAgICAgICJ6b29tbGV2ZWwiOiAiMjUiLAorICAgICAgICAgICAgICAgICAgICAiZGVmYXVsdGNlbnRlcmxhYmVsIjogIlRvdGFsIiwKKyAgICAgICAgICAgICAgICAgICAgImRvbnV0cmF0aW8iOiAiMS41IiwKKyAgICAgICAgICAgICAgICAgICAgImluaXRkdXJhdGlvbiI6ICIxMDAwIiwKKyAgICAgICAgICAgICAgICAgICAgImFuaW1kdXJhdGlvbiI6ICIzMDAiLAorICAgICAgICAgICAgICAgICAgICAibGVnZW5kcmVxZCI6ICJmYWxzZSIsCisgICAgICAgICAgICAgICAgICAgICJsZWdlbmRwb3NpdGlvbiI6ICJyaWdodCIsCisgICAgICAgICAgICAgICAgICAgICJjZW50ZXJUZXh0TGFiZWxEeSI6ICIyMCIsCisgICAgICAgICAgICAgICAgICAgICJjbGlwTWFyZ2luIjogIjQwMCIsCisgICAgICAgICAgICAgICAgICAgICJhcmNPdmVyTWFyZ2luIjoxMAorICAgICAgICAgICAgICAgIH0pCisgICAgICAgIC5kaXJlY3RpdmUoJ2F0dERvbnV0ZDNDaGFydCcsIFsnRG9udXRDaGFydEQzQ29uZmlnJywgJyR0aW1lb3V0JywnJGV4dGVuZE9iaicsIGZ1bmN0aW9uIChEb251dENoYXJ0RDNDb25maWcsICR0aW1lb3V0LCRleHRlbmRPYmopIHsKKyAgICAgICAgICAgICAgICByZXR1cm4geworICAgICAgICAgICAgICAgICAgICByZXN0cmljdDogJ0EnLAorICAgICAgICAgICAgICAgICAgICBzY29wZTogeworICAgICAgICAgICAgICAgICAgICAgICAgY2hhcnREYXRhOiAnPScsCisgICAgICAgICAgICAgICAgICAgICAgICBjaGFydENvbG9yOiAnPScsCisgICAgICAgICAgICAgICAgICAgICAgICBjaGFydENvbmZpZzogJz0nLAorICAgICAgICAgICAgICAgICAgICAgICAgcmVmcmVzaENoYXJ0OiAnPScsCisgICAgICAgICAgICAgICAgICAgICAgICBvbmNsaWNrY2FsbGJhY2s6ICcmJywKKyAgICAgICAgICAgICAgICAgICAgICAgIGxlZ2VuZGNsaWNrY2FsbGJhY2s6ICcmJywKKyAgICAgICAgICAgICAgICAgICAgICAgIGNlbnRlcmNsaWNrY2FsbGJhY2s6ICcmJworICAgICAgICAgICAgICAgICAgICB9LAorICAgICAgICAgICAgICAgICAgICB0ZW1wbGF0ZVVybDogJ3RlbXBsYXRlL2RvbnV0RDMvYXR0RG9udXRkM0NoYXJ0Lmh0bWwnLAorICAgICAgICAgICAgICAgICAgICB0cmFuc2NsdWRlOiB0cnVlLAorICAgICAgICAgICAgICAgICAgICByZXBsYWNlOiB0cnVlLAorICAgICAgICAgICAgICAgICAgICBjb250cm9sbGVyOiBbJyRzY29wZScsICckYXR0cnMnLCBmdW5jdGlvbiAoJHNjb3BlLCAkYXR0cnMpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoYW5ndWxhci5pc0RlZmluZWQoJHNjb3BlLmNoYXJ0Q29uZmlnKSkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBEb251dENoYXJ0RDNDb25maWcgPSAkZXh0ZW5kT2JqLmV4dGVuZERlZXAoRG9udXRDaGFydEQzQ29uZmlnLCRzY29wZS5jaGFydENvbmZpZyk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhciBsZWdlbmRDb2xvcnMgPSBbXTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBsZWdlbmRDb2xvcnMgPSAoJHNjb3BlLmNoYXJ0Q29sb3IpID8gJHNjb3BlLmNoYXJ0Q29sb3IgOiBEb251dENoYXJ0RDNDb25maWcuY2hhcnRjb2xvci5wYWxldHRlQ29sb3JzOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICRzY29wZS5hZGRMZWdlbmRDb2xvciA9IGZ1bmN0aW9uIChpZCwgaXRlbSkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoaXRlbS52YWx1ZSA+IDApIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiB7ImNvbG9yIjogbGVnZW5kQ29sb3JzW2lkXX07CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4geyJjb2xvciI6IERvbnV0Q2hhcnREM0NvbmZpZy5jaGFydGNvbG9yLnplcm9UaWNrZXRDb2xvcn07CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB9OworICAgICAgICAgICAgICAgICAgICAgICAgICAgICRzY29wZS5jaGFydElEID0gJGF0dHJzLmlkOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICghYW5ndWxhci5pc0RlZmluZWQoJGF0dHJzLmxlZ2VuZFJlcXVpcmVkKSkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAkc2NvcGUubGVnZW5kUmVxdWlyZWQgPSBEb251dENoYXJ0RDNDb25maWcubGVnZW5kcmVxZDsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAkc2NvcGUubGVnZW5kUmVxdWlyZWQgPSAkYXR0cnMubGVnZW5kUmVxdWlyZWQ7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICghYW5ndWxhci5pc0RlZmluZWQoJGF0dHJzLmxlZ2VuZFBvc2l0aW9uKSkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAkc2NvcGUubGVnZW5kUG9zaXRpb24gPSBEb251dENoYXJ0RDNDb25maWcubGVnZW5kcG9zaXRpb247CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJHNjb3BlLmxlZ2VuZFBvc2l0aW9uID0gJGF0dHJzLmxlZ2VuZFBvc2l0aW9uOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAkc2NvcGUuYWRkU3R5bGUgPSBmdW5jdGlvbiAoZWxlbSkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoJHNjb3BlLmxlZ2VuZFJlcXVpcmVkICYmIGFuZ3VsYXIuaXNEZWZpbmVkKCRzY29wZS5sZWdlbmRQb3NpdGlvbikpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICgkYXR0cnMubGVnZW5kUG9zaXRpb24gPT09ICJyaWdodCIpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gImZsb2F0TGVmdCI7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChlbGVtID09PSAnY2hhcnRMZWdlbmQnKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuICJmbG9hdExlZnQiOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gImZsb2F0UmlnaHQiOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiAiZmxvYXRMZWZ0IjsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgICAgIH07CisgICAgICAgICAgICAgICAgICAgICAgICB9XSwKKyAgICAgICAgICAgICAgICAgICAgbGluazogZnVuY3Rpb24gKHNjb3BlLCBlbGVtZW50LCBhdHRycykgeworICAgICAgICAgICAgICAgICAgICAgICAgc2NvcGUuJHdhdGNoKCdyZWZyZXNoQ2hhcnQnLCBmdW5jdGlvbiAoKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGFuZ3VsYXIuaXNEZWZpbmVkKHNjb3BlLnJlZnJlc2hDaGFydCkpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHNjb3BlLnJlZnJlc2hDaGFydCAhPT0gdHJ1ZSkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZm9yICh2YXIgaiA9IDA7IGogPCBzY29wZS5jaGFydERhdGEubGVuZ3RoOyBqKyspIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YXIgY2hhcnRPYmogPXNjb3BlLmNoYXJ0RGF0YVtqXTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YXIgY2xhc3NOYW1lID0gKGNoYXJ0T2JqLm5hbWUpLnJlcGxhY2UoLyAvZywgIiIpLnRvVXBwZXJDYXNlKCk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYW5ndWxhci5lbGVtZW50KGRvY3VtZW50LnF1ZXJ5U2VsZWN0b3IoIltjaGFydC1sZWdlbmQtaWQ9IiArIGNsYXNzTmFtZSArICJdIikpLnJlbW92ZUNsYXNzKCJhY3RpdmUiKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CisKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGFuZ3VsYXIuaXNEZWZpbmVkKHNjb3BlLmNoYXJ0Q29uZmlnKSkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBEb251dENoYXJ0RDNDb25maWcgPSAkZXh0ZW5kT2JqLmV4dGVuZERlZXAoRG9udXRDaGFydEQzQ29uZmlnLCBzY29wZS5jaGFydENvbmZpZyk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgICAgIGQzLnNlbGVjdCgic3ZnIyIgKyBhdHRycy5pZCkucmVtb3ZlKCk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgZDMuc2VsZWN0QWxsKCJzdmcjIiArIGF0dHJzLmlkICsgIiA+ICoiKS5yZW1vdmUoKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YXIgc2VsZWN0ZWRQYXRoID0gIiIsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBsYXN0U2VsZWN0ZWQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwaSA9IE1hdGguUEk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFyIHpvb20gPSBwYXJzZUludChEb251dENoYXJ0RDNDb25maWcuem9vbWxldmVsLCAwKSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbG9yb3B0aW9ucyA9IChzY29wZS5jaGFydENvbG9yKSA/IHNjb3BlLmNoYXJ0Q29sb3IgOiBEb251dENoYXJ0RDNDb25maWcuY2hhcnRjb2xvci5wYWxldHRlQ29sb3JzLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZGVmYXVsdGNlbnRlcmxhYmVsID0gRG9udXRDaGFydEQzQ29uZmlnLmRlZmF1bHRjZW50ZXJsYWJlbCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRvdGFsY291bnQgPSAwLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbWFyZ2luID0gey8vIG9wdGlvbmFsbHkgc2V0IG1hcmdpbnMKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0b3A6IHpvb20sCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmlnaHQ6IHpvb20sCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYm90dG9tOiB6b29tLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxlZnQ6IHpvb20KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0sCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gc2V0IGhlaWdodCBhbmQgd2lkdGggcGx1cyBtYXJnaW4gc28gem9vbWVkIGFyZWEgaXMgbm90IGNsaXBwZWQKKyAgICAgICAgICAgICAgICAgICAgICAgICAgIC8qIHdpZHRoID0gcGFyc2VJbnQoYXR0cnMuY2hhcnRXaWR0aCwgMCkgLSAobWFyZ2luLmxlZnQgKyBtYXJnaW4ucmlnaHQpLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaGVpZ2h0ID0gcGFyc2VJbnQoYXR0cnMuY2hhcnRIZWlnaHQsIDApIC0gKG1hcmdpbi50b3AgKyBtYXJnaW4uYm90dG9tKSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJhZGl1cyA9IE1hdGgubWluKAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB3aWR0aCAtIChtYXJnaW4ubGVmdCArIG1hcmdpbi5yaWdodCksCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGhlaWdodCAtIChtYXJnaW4udG9wICsgbWFyZ2luLmJvdHRvbSkpIC8gMiwqLworICAgICAgICAgICAgICAgICAgICAgICAgICAgICB3aWR0aCA9IGF0dHJzLmNoYXJ0V2lkdGgsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBoZWlnaHQgPSBhdHRycy5jaGFydEhlaWdodCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJhZGl1cyA9IE1hdGgubWluKAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB3aWR0aCAtIChtYXJnaW4ubGVmdCArIG1hcmdpbi5yaWdodCksCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGhlaWdodCAtIChtYXJnaW4udG9wICsgbWFyZ2luLmJvdHRvbSkpIC8gMiwgCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb2xvciA9IGQzLnNjYWxlLm9yZGluYWwoKS5yYW5nZShjb2xvcm9wdGlvbnMpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChhbmd1bGFyLmlzRGVmaW5lZChzY29wZS5jaGFydERhdGEpKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZvciAodmFyIGkgaW4gc2NvcGUuY2hhcnREYXRhKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoYW5ndWxhci5pc0RlZmluZWQoc2NvcGUuY2hhcnREYXRhW2ldLnZhbHVlKSkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRvdGFsY291bnQgPSAodG90YWxjb3VudCArIHBhcnNlSW50KHNjb3BlLmNoYXJ0RGF0YVtpXS52YWx1ZSwgMTApKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YXIgZGF0YT1bXTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBmb3IgKHZhciB6ID0gMDsgeiA8IHNjb3BlLmNoYXJ0RGF0YS5sZW5ndGg7IHorKykgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YXIgY2hhcnRFbGVtID1zY29wZS5jaGFydERhdGFbel07CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmKGNoYXJ0RWxlbS52YWx1ZSA8PSAwKXsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRhdGEucHVzaCh7aW5kZXg6IHosIHZhbHVlOiBjaGFydEVsZW0udmFsdWV9KTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSAgICAgIAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YXIgY2hhcnRTdHlsZSA9IGQzLnNlbGVjdCgiLmNoYXJ0Q29udGFpbmVyIyIgKyBhdHRycy5pZCkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC5hdHRyKCJzdHlsZSIpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhciBjaGFydCA9IGQzLnNlbGVjdCgiLmNoYXJ0Q29udGFpbmVyIyIgKyBhdHRycy5pZCkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC5hdHRyKCJzdHlsZSIsICJoZWlnaHQ6ICIgKyBhdHRycy5jaGFydEhlaWdodCArICJweDt3aWR0aDoiICsgYXR0cnMuY2hhcnRXaWR0aCArICJweDsiKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLmFwcGVuZCgic3ZnIikKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC5hdHRyKCJpZCIsIGF0dHJzLmlkKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLmF0dHIoIndpZHRoIiwgJzEwMCUnKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLmF0dHIoImhlaWdodCIsICcxMDAlJykKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC5hdHRyKCd2aWV3Qm94JywgJzAgMCAnICsgTWF0aC5taW4od2lkdGgsIGhlaWdodCkgKyAnICcgKyBNYXRoLm1pbih3aWR0aCwgaGVpZ2h0KSkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC5hdHRyKCdwcmVzZXJ2ZUFzcGVjdFJhdGlvJywgJ3hNaW5ZTWluJykKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC5hcHBlbmQoImciKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLmF0dHIoInRyYW5zZm9ybSIsICJ0cmFuc2xhdGUoIiArIE1hdGgubWluKHdpZHRoLCBoZWlnaHQpIC8gMiArICIsIiArIE1hdGgubWluKHdpZHRoLCBoZWlnaHQpIC8gMiArICIpIik7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gc2V0IHJhZGl1cworICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhciBhcmMgPSBkMy5zdmcuYXJjKCkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC5pbm5lclJhZGl1cyhyYWRpdXMgLyBEb251dENoYXJ0RDNDb25maWcuZG9udXRyYXRpbykKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC5vdXRlclJhZGl1cyhyYWRpdXMpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vIGFkZCBjZW50ZXIgdGV4dCBlbGVtZW50CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFyIGNlbnRlclRleHRWYWx1ZSA9IGNoYXJ0LmFwcGVuZCgidGV4dCIpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAuYXR0cigiY2xhc3MiLCAiZG9udXRjZW50ZXJWYWx1ZSIpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAuYXR0cigiaWQiLCBhdHRycy5pZCArICJjb3VudCIpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAub24oImNsaWNrIiwgZnVuY3Rpb24gKGQpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YXIgdmFsdWUgPSBkMy5zZWxlY3QoImcgPiB0ZXh0IyIgKyBhdHRycy5pZCArICJjb3VudCIpLnRleHQoKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YXIgbGFiZWwgPSBkMy5zZWxlY3QoImcgPiB0ZXh0IyIgKyBhdHRycy5pZCArICJjYXRlZ29yeSIpLnRleHQoKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoYW5ndWxhci5pc0RlZmluZWQoc2NvcGUub25jbGlja2NhbGxiYWNrKSkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzY29wZS5jZW50ZXJjbGlja2NhbGxiYWNrKHtjb3VudDogdmFsdWUsIGNhdGVnb3J5OiBsYWJlbH0pOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0pOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhciBjZW50ZXJUZXh0TGFiZWwgPSBjaGFydC5hcHBlbmQoInRleHQiKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLmF0dHIoInkiLCBEb251dENoYXJ0RDNDb25maWcuY2VudGVyVGV4dExhYmVsRHkpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAuYXR0cigiY2xhc3MiLCAiZG9udXRjZW50ZXJMYWJlbCIpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAuYXR0cigiaWQiLCBhdHRycy5pZCArICJjYXRlZ29yeSIpOworCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgY2VudGVyVGV4dFZhbHVlLnRleHQodG90YWxjb3VudCk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgY2VudGVyVGV4dExhYmVsLnRleHQoZGVmYXVsdGNlbnRlcmxhYmVsKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAodG90YWxjb3VudCA8PSAwKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGFyYy5zdGFydEFuZ2xlKDApLmVuZEFuZ2xlKDIgKiBwaSk7IC8vanVzdCByYWRpYW5zCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNoYXJ0LmFwcGVuZCgicGF0aCIpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLmF0dHIoImQiLCBhcmMpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLmF0dHIoImZpbGwiLCBEb251dENoYXJ0RDNDb25maWcuY2hhcnRjb2xvci56ZXJvVGlja2V0Q29sb3IpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vIHNldCBob3ZlcmVkIHJhZGl1cworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YXIgYXJjT3ZlciA9IGQzLnN2Zy5hcmMoKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC5pbm5lclJhZGl1cyhyYWRpdXMgLyBEb251dENoYXJ0RDNDb25maWcuZG9udXRyYXRpbykKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAub3V0ZXJSYWRpdXMocmFkaXVzICsgRG9udXRDaGFydEQzQ29uZmlnLmFyY092ZXJNYXJnaW4pOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YXIgcGllID0gZDMubGF5b3V0LnBpZSgpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLnNvcnQobnVsbCkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAuc3RhcnRBbmdsZSgxLjEgKiBNYXRoLlBJKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC5lbmRBbmdsZSgzLjEgKiBNYXRoLlBJKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC52YWx1ZShmdW5jdGlvbiAoZCkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gZC52YWx1ZTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9KTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFyIGcgPSBjaGFydC5zZWxlY3RBbGwoIi5hcmMiKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC5kYXRhKHBpZShzY29wZS5jaGFydERhdGEpKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC5lbnRlcigpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLmFwcGVuZCgiZyIpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLmF0dHIoImNsYXNzIiwgImFyYyIpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLnN0eWxlKCJjdXJzb3IiLCAicG9pbnRlciIpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyBzZXQgZmlsbCBjb2xvciBhbmQgYW5pbWF0ZSB0d2VlbgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBnLmFwcGVuZCgicGF0aCIpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLnN0eWxlKCJmaWxsIiwgZnVuY3Rpb24gKGQpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGNvbG9yKGQuZGF0YS5uYW1lKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9KQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC5hdHRyKCJwYXRoLWlkIixmdW5jdGlvbiAoZCwgaSkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gImItIiArIGk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAuc3R5bGUoInN0cm9rZSIsICJ3aGl0ZSIpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLnN0eWxlKCJzdHJva2Utd2lkdGgiLCAxKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC5vbigibW91c2VvdmVyIiwgZnVuY3Rpb24gKGQpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZDMuc2VsZWN0KHRoaXMpLnRyYW5zaXRpb24oKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC5kdXJhdGlvbihEb251dENoYXJ0RDNDb25maWcuYW5pbWR1cmF0aW9uKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC5hdHRyKCJkIiwgYXJjT3Zlcik7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjZW50ZXJUZXh0VmFsdWUudGV4dChkMy5zZWxlY3QodGhpcykuZGF0dW0oKS5kYXRhLnZhbHVlKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY2VudGVyVGV4dExhYmVsLnRleHQoZDMuc2VsZWN0KHRoaXMpLmRhdHVtKCkuZGF0YS5uYW1lKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFyIGNsYXNzTmFtZSA9IGQzLnNlbGVjdCh0aGlzKS5kYXR1bSgpLmRhdGEubmFtZS5yZXBsYWNlKC8gL2csICIiKS50b1VwcGVyQ2FzZSgpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBhbmd1bGFyLmVsZW1lbnQoZG9jdW1lbnQucXVlcnlTZWxlY3RvcigiW2NoYXJ0LWxlZ2VuZC1pZD0iICsgY2xhc3NOYW1lICsgIl0iKSkuYWRkQ2xhc3MoImFjdGl2ZSIpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0pCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLm9uKCJtb3VzZW91dCIsIGZ1bmN0aW9uIChkKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICghdGhpcy5nZXRBdHRyaWJ1dGUoImNsaWNrZWQiKSkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZDMuc2VsZWN0KHRoaXMpLnRyYW5zaXRpb24oKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAuZHVyYXRpb24oRG9udXRDaGFydEQzQ29uZmlnLmFuaW1kdXJhdGlvbikKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLmF0dHIoImQiLCBhcmMpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHNlbGVjdGVkUGF0aC5sZW5ndGggPT09IDApIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjZW50ZXJUZXh0VmFsdWUudGV4dCh0b3RhbGNvdW50KTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjZW50ZXJUZXh0TGFiZWwudGV4dChkZWZhdWx0Y2VudGVybGFiZWwpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjZW50ZXJUZXh0VmFsdWUudGV4dChzZWxlY3RlZFBhdGguZGF0dW0oKS5kYXRhLnZhbHVlKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjZW50ZXJUZXh0TGFiZWwudGV4dChzZWxlY3RlZFBhdGguZGF0dW0oKS5kYXRhLm5hbWUpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFyIGNsYXNzTmFtZSA9IGQzLnNlbGVjdCh0aGlzKS5kYXR1bSgpLmRhdGEubmFtZS5yZXBsYWNlKC8gL2csICIiKS50b1VwcGVyQ2FzZSgpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYW5ndWxhci5lbGVtZW50KGRvY3VtZW50LnF1ZXJ5U2VsZWN0b3IoIltjaGFydC1sZWdlbmQtaWQ9IiArIGNsYXNzTmFtZSArICJdIikpLnJlbW92ZUNsYXNzKCJhY3RpdmUiKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIGlmIChhbmd1bGFyLmlzRGVmaW5lZChsYXN0U2VsZWN0ZWQpICYmIGxhc3RTZWxlY3RlZCE9PSIiKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBsYXN0U2VsZWN0ZWQudHJhbnNpdGlvbigpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC5kdXJhdGlvbihEb251dENoYXJ0RDNDb25maWcuYW5pbWR1cmF0aW9uKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAuYXR0cigiZCIsIGFyYyk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoYW5ndWxhci5pc0RlZmluZWQobGFzdFNlbGVjdGVkKSkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhciBwcmV2Y2xhc3NOYW1lID0gbGFzdFNlbGVjdGVkLmRhdHVtKCkuZGF0YS5uYW1lLnJlcGxhY2UoLyAvZywgIiIpLnRvVXBwZXJDYXNlKCk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYW5ndWxhci5lbGVtZW50KGRvY3VtZW50LnF1ZXJ5U2VsZWN0b3IoIltjaGFydC1sZWdlbmQtaWQ9IiArIHByZXZjbGFzc05hbWUgKyAiXSIpKS5yZW1vdmVDbGFzcygiYWN0aXZlIik7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9KQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC5vbigiY2xpY2siLCBmdW5jdGlvbiAoZCwgaSkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoYW5ndWxhci5pc0RlZmluZWQoc2NvcGUub25jbGlja2NhbGxiYWNrKSkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2NvcGUub25jbGlja2NhbGxiYWNrKHtuYW1lOiBkMy5zZWxlY3QodGhpcykuZGF0dW0oKS5kYXRhLm5hbWUsIHZhbHVlOiBkMy5zZWxlY3QodGhpcykuZGF0dW0oKS5kYXRhLnZhbHVlfSk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKCF0aGlzLmdldEF0dHJpYnV0ZSgiY2xpY2tlZCIpKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0aGlzLnNldEF0dHJpYnV0ZSgiY2xpY2tlZCIsICJjbGlja2VkIik7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoc2VsZWN0ZWRQYXRoICE9PSAiIikgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxhc3RTZWxlY3RlZCA9IHNlbGVjdGVkUGF0aDsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzZWxlY3RlZFBhdGhbMF1bMF0ucmVtb3ZlQXR0cmlidXRlKCJjbGlja2VkIik7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzZWxlY3RlZFBhdGggPSBkMy5zZWxlY3QodGhpcyk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAodGhpcy5nZXRBdHRyaWJ1dGUoInBhdGgtaWQiKSA9PT0gc2VsZWN0ZWRQYXRoLmF0dHIoInBhdGgtaWQiKSkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNlbGVjdGVkUGF0aFswXVswXS5yZW1vdmVBdHRyaWJ1dGUoImNsaWNrZWQiKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzZWxlY3RlZFBhdGggPSAiIjsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQorCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAudHJhbnNpdGlvbigpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLmVhc2UoImV4cCIpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLmR1cmF0aW9uKERvbnV0Q2hhcnREM0NvbmZpZy5pbml0ZHVyYXRpb24pCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLmF0dHJUd2VlbigiZCIsIHR3ZWVuUGllKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gYW5pbWF0ZSBmdW5jdGlvbgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzY29wZS5sZWdlbmRNb3VzZU92ZXIgPSBmdW5jdGlvbiAoaXRlbSwgaWQsIGUpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzZWxlY3RlZElkPSJiLSIraWQ7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoaXRlbS52YWx1ZSA+IDApIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzY29wZS5MZWdlbmRDbGFzcyA9ICIiOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRoaXMuTGVnZW5kQ2xhc3MgPSAiYWN0aXZlIjsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjZW50ZXJUZXh0VmFsdWUudGV4dChpdGVtLnZhbHVlKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjZW50ZXJUZXh0TGFiZWwudGV4dChpdGVtLm5hbWUpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGQzLnNlbGVjdEFsbCgiLmNoYXJ0Q29udGFpbmVyIyIrYXR0cnMuaWQrIiAiKyJwYXRoIikuZWFjaChmdW5jdGlvbihkLCBpKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZih0aGlzLmdldEF0dHJpYnV0ZSgicGF0aC1pZCIpPT1zZWxlY3RlZElkKXsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBkMy5zZWxlY3QodGhpcykudHJhbnNpdGlvbigpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAuZHVyYXRpb24oRG9udXRDaGFydEQzQ29uZmlnLmFuaW1kdXJhdGlvbikKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC5hdHRyKCJkIiwgYXJjT3Zlcik7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZDMuc2VsZWN0KCIjVGlja2V0R3JhcGhjb3VudCIpLnN0eWxlKCdmaWxsJyxEb251dENoYXJ0RDNDb25maWcuY2hhcnRjb2xvci5jZW50ZXJUaWNrZXRDb3VudEhvdmVyQ29sb3IpOyAgCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH07CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNjb3BlLmxlZ2VuZE1vdXNlTGVhdmUgPSBmdW5jdGlvbiAoaXRlbSwgaWQsIGUpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNlbGVjdGVkSWQ9ImItIitpZDsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGhvdmVyZWRMZWdlbmRJdGVtPXRoaXM7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoaXRlbS52YWx1ZSA+IDApIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoc2VsZWN0ZWRQYXRoLmxlbmd0aCA9PT0gMCkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjZW50ZXJUZXh0VmFsdWUudGV4dCh0b3RhbGNvdW50KTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY2VudGVyVGV4dExhYmVsLnRleHQoZGVmYXVsdGNlbnRlcmxhYmVsKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjZW50ZXJUZXh0VmFsdWUudGV4dChzZWxlY3RlZFBhdGguZGF0dW0oKS5kYXRhLnZhbHVlKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY2VudGVyVGV4dExhYmVsLnRleHQoc2VsZWN0ZWRQYXRoLmRhdHVtKCkuZGF0YS5uYW1lKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZDMuc2VsZWN0QWxsKCIuY2hhcnRDb250YWluZXIjIithdHRycy5pZCsiICIrInBhdGgiKS5lYWNoKGZ1bmN0aW9uKGQsIGkpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmKHRoaXMuZ2V0QXR0cmlidXRlKCJwYXRoLWlkIik9PXNlbGVjdGVkSWQpeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYodGhpcy5nZXRBdHRyaWJ1dGUoImNsaWNrZWQiKT09PW51bGwpeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGhvdmVyZWRMZWdlbmRJdGVtLkxlZ2VuZENsYXNzID0gIiI7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZDMuc2VsZWN0KHRoaXMpLnRyYW5zaXRpb24oKS5kdXJhdGlvbihEb251dENoYXJ0RDNDb25maWcuYW5pbWR1cmF0aW9uKS5hdHRyKCJkIiwgYXJjKTsgCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZDMuc2VsZWN0KCIjVGlja2V0R3JhcGhjb3VudCIpLnN0eWxlKCdmaWxsJywgIiMwMDAiKTsKKworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9OworICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBmdW5jdGlvbiB0d2VlblBpZShiKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhciBpID0gZDMuaW50ZXJwb2xhdGUoeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc3RhcnRBbmdsZTogMS4xICogTWF0aC5QSSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGVuZEFuZ2xlOiAxLjEgKiBNYXRoLlBJCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0sIGIpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gZnVuY3Rpb24gKHQpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBhcmMoaSh0KSk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH07CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICR0aW1lb3V0KGZ1bmN0aW9uICgpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFyIGggPSBlbGVtZW50LmZpbmQoInVsIilbMF0uY2xpZW50SGVpZ2h0LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZIZWlnaHQgPSAocGFyc2VJbnQoaGVpZ2h0LCAxMCkgLSBoKSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjbGFzc05hbWUgPSBzY29wZS5hZGRTdHlsZSgnY2hhcnRDb250YWluZXInKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZkhlaWdodCA9IChmSGVpZ2h0IDwgMCkgPyAwIDogZkhlaWdodDsgICAgIAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBhbmd1bGFyLmVsZW1lbnQoZWxlbWVudFswXS5xdWVyeVNlbGVjdG9yKCcuY2hhcnRDb250YWluZXInKSkuYWRkQ2xhc3MoY2xhc3NOYW1lKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYW5ndWxhci5lbGVtZW50KGVsZW1lbnRbMF0ucXVlcnlTZWxlY3RvcigiLmNoYXJ0TGVnZW5kIikpLmNzcyh7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAibWFyZ2luLXRvcCI6IChmSGVpZ2h0IC8gMikgKyAicHgiCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0pOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0sIDIwMCk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgZm9yICh2YXIgayA9IDA7IGsgPCBkYXRhLmxlbmd0aDsgaysrKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhciBpbmRleCA9ZGF0YVtrXS5pbmRleDsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFyIHplcm9WYWxJbmRleD0iYi0iK2luZGV4OworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZihkYXRhW2tdLnZhbHVlIDw9IDApeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmVtb3ZlU3Ryb2tlbGluZXMoemVyb1ZhbEluZGV4KTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgICAgIAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZ1bmN0aW9uIHJlbW92ZVN0cm9rZWxpbmVzKHplcm9WYWxJbmRleCl7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGQzLnNlbGVjdEFsbCgiLmNoYXJ0Q29udGFpbmVyIyIrYXR0cnMuaWQrIiAiKyJwYXRoIikuZWFjaChmdW5jdGlvbihkLCBpKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZih0aGlzLmdldEF0dHJpYnV0ZSgicGF0aC1pZCIpPT16ZXJvVmFsSW5kZXgpeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZDMuc2VsZWN0KHRoaXMpLnN0eWxlKCdzdHJva2UnLCAiIikuc3R5bGUoInN0cm9rZS13aWR0aCIsICIiKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9KTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2NvcGUucmVmcmVzaENoYXJ0ID0gZmFsc2U7CisgICAgICAgICAgICAgICAgICAgICAgICB9KTsKKworICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgfTsKKyAgICAgICAgICAgIH1dKQorICAgICAgICAuZmlsdGVyKCdmaWx0ZXJEYXRhJywgZnVuY3Rpb24gKCkgeworICAgICAgICAgICAgcmV0dXJuIGZ1bmN0aW9uIChpbnB1dCkgeworICAgICAgICAgICAgICAgIHJldHVybiBpbnB1dC5yZXBsYWNlKC8gL2csICIiKS50b1VwcGVyQ2FzZSgpOworICAgICAgICAgICAgfTsKKyAgICAgICAgfSk7Cithbmd1bGFyLm1vZHVsZSgnYXR0LmNoYXJ0cy5kb251dEZ1c2lvbicsIFtdKQorICAgICAgICAuY29uc3RhbnQoIkRvbnV0Q2hhcnRGdXNpb25Db25maWciLAorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgImNoYXJ0IjogeworICAgICAgICAgICAgICAgICAgICAgICAgImNhcHRpb24iOiAiVGlja2V0cyIsCisgICAgICAgICAgICAgICAgICAgICAgICAic3RhcnRpbmdBbmdsZSI6IDAsCisgICAgICAgICAgICAgICAgICAgICAgICAidGhlbWUiOiAiZmlzdCIsCisgICAgICAgICAgICAgICAgICAgICAgICAiY2FwdGlvblBhZGRpbmciOiAiMCIsCisgICAgICAgICAgICAgICAgICAgICAgICAicGFsZXR0ZUNvbG9ycyI6ICIjRkYwMDY2LCMwMENDRkYsIzAwQ0M2NiwjNjY5OUZGLCMwMDAwOTksIzY2MDA2NiwjRkY2NjAwLCM0RDRENEQiLCAvL2RlZmF1bHQgY29sb3Igb3B0aW9ucyBmb3IgcmVuZGVyaW5nIGNoYXJ0CisgICAgICAgICAgICAgICAgICAgICAgICAiZW5hYmxlU21hcnRMYWJlbHMiOiAiMCIsCisgICAgICAgICAgICAgICAgICAgICAgICAiZW5hYmxlTXVsdGlTbGljaW5nIjogIjEiLAorICAgICAgICAgICAgICAgICAgICAgICAgImRvbnV0UmFkaXVzIjogIjY1IiwKKyAgICAgICAgICAgICAgICAgICAgICAgICJwaWVSYWRpdXMiOiAiMTEwIiwKKyAgICAgICAgICAgICAgICAgICAgICAgICJzaG93TGFiZWxzIjogIjAiLAorICAgICAgICAgICAgICAgICAgICAgICAgInNob3dWYWx1ZXMiOiAiMCIsCisgICAgICAgICAgICAgICAgICAgICAgICAic2hvd0JvcmRlciI6ICIwIiwKKyAgICAgICAgICAgICAgICAgICAgICAgICJzaG93cGVyY2VudGludG9vbHRpcCI6ICIwIiwKKyAgICAgICAgICAgICAgICAgICAgICAgICJiZ2NvbG9yIjogIiNGRkZGRkYiLAorICAgICAgICAgICAgICAgICAgICAgICAgImRlZmF1bHRDZW50ZXJMYWJlbCI6ICJUb3RhbCIsCisgICAgICAgICAgICAgICAgICAgICAgICAic2hvd3NoYWRvdyI6IDAsCisgICAgICAgICAgICAgICAgICAgICAgICAiY2VudGVyTGFiZWwiOiAiJHZhbHVlICRsYWJlbCIsCisgICAgICAgICAgICAgICAgICAgICAgICAicGxvdEhvdmVyRWZmZWN0IjogMSwKKyAgICAgICAgICAgICAgICAgICAgICAgICJwbG90Qm9yZGVySG92ZXJEYXNoR2FwIjogIjUwIiwKKyAgICAgICAgICAgICAgICAgICAgICAgICJlbmFibGVSb3RhdGlvbiI6ICIwIiwKKyAgICAgICAgICAgICAgICAgICAgICAgICJiYXNlRm9udCI6ICJBcmlhbCIsCisgICAgICAgICAgICAgICAgICAgICAgICAiYmFzZUZvbnRDb2xvciI6ICIjNjY2NjY2IiwKKyAgICAgICAgICAgICAgICAgICAgICAgICJ1c2UzRExpZ2h0aW5nIjogIjAiLAorICAgICAgICAgICAgICAgICAgICAgICAgIm51bWJlcnN1ZmZpeCI6ICIiLAorICAgICAgICAgICAgICAgICAgICAgICAgImRlZmF1bHRBbmltYXRpb24iOiAiMCIsCisgICAgICAgICAgICAgICAgICAgICAgICAic2hvd1ZhbHVlc09uSG92ZXIiOiAwCisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICB9KQorICAgICAgICAuZGlyZWN0aXZlKCdhdHREb251dGZ1c2lvbkNoYXJ0JywgWydEb251dENoYXJ0RnVzaW9uQ29uZmlnJywgJyR0aW1lb3V0JywgZnVuY3Rpb24gKERvbnV0Q2hhcnRGdXNpb25Db25maWcsICR0aW1lb3V0KSB7CisgICAgICAgICAgICAgICAgJ3VzZSBzdHJpY3QnOworICAgICAgICAgICAgICAgIHJldHVybiB7CisgICAgICAgICAgICAgICAgICAgIHJlc3RyaWN0OiAnQScsCisgICAgICAgICAgICAgICAgICAgIHNjb3BlOiB7CisgICAgICAgICAgICAgICAgICAgICAgICBjaGFydERhdGE6ICc9JywKKyAgICAgICAgICAgICAgICAgICAgICAgIG9uY2xpY2tjYWxsYmFjazogJyYnCisgICAgICAgICAgICAgICAgICAgIH0sCisgICAgICAgICAgICAgICAgICAgIHRlbXBsYXRlVXJsOiAndGVtcGxhdGUvZG9udXRGdXNpb24vYXR0RG9udXRmdXNpb25DaGFydC5odG1sJywKKyAgICAgICAgICAgICAgICAgICAgdHJhbnNjbHVkZTogdHJ1ZSwKKyAgICAgICAgICAgICAgICAgICAgcmVwbGFjZTogdHJ1ZSwKKyAgICAgICAgICAgICAgICAgICAgbGluazogZnVuY3Rpb24gKHNjb3BlLCBlbGVtZW50LCBhdHRycywgY29udHJvbGxlciwgdHJhbnNjbHVkZSkgeworICAgICAgICAgICAgICAgICAgICAgICAgdmFyIHRvdGFsSXRlbXMgPSAwOworICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGFuZ3VsYXIuaXNEZWZpbmVkKHNjb3BlLmNoYXJ0RGF0YSkpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBmb3IgKHZhciBpIGluIHNjb3BlLmNoYXJ0RGF0YSkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZihhbmd1bGFyLmlzRGVmaW5lZChzY29wZS5jaGFydERhdGFbaV0udmFsdWUpKXsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdG90YWxJdGVtcyA9ICh0b3RhbEl0ZW1zICsgcGFyc2VJbnQoc2NvcGUuY2hhcnREYXRhW2ldLnZhbHVlLCAxMCkpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICBEb251dENoYXJ0RnVzaW9uQ29uZmlnLmRhdGEgPSBzY29wZS5jaGFydERhdGE7CisgICAgICAgICAgICAgICAgICAgICAgICB2YXIgZG9udXRDaGFydERhdGFTb3VyY2UgPSBEb251dENoYXJ0RnVzaW9uQ29uZmlnOworICAgICAgICAgICAgICAgICAgICAgICAgdmFyIGRlZmF1bHRDZW50ZXJMYWJlbFRleHQ7CisgICAgICAgICAgICAgICAgICAgICAgICBkZWZhdWx0Q2VudGVyTGFiZWxUZXh0ID0gdG90YWxJdGVtcyArICcgJyArIERvbnV0Q2hhcnRGdXNpb25Db25maWcuY2hhcnQuZGVmYXVsdENlbnRlckxhYmVsOworICAgICAgICAgICAgICAgICAgICAgICAgZG9udXRDaGFydERhdGFTb3VyY2UuY2hhcnQuZGVmYXVsdENlbnRlckxhYmVsID0gZGVmYXVsdENlbnRlckxhYmVsVGV4dDsKKworICAgICAgICAgICAgICAgICAgICAgICAgdmFyIGluaXRDaGFydCA9IGZ1bmN0aW9uICgpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBGdXNpb25DaGFydHMucmVhZHkoZnVuY3Rpb24gKCkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YXIgZG9udXRDaGFydCA9IG5ldyBGdXNpb25DaGFydHMoeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdHlwZTogJ2RvdWdobnV0MmQnLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmVuZGVyQXQ6ICJkb251dEZ1c2lvbkNoYXJ0IiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vd2lkdGg6ICcxMDAlJywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHdpZHRoOiBhdHRycy5jaGFydFdpZHRoLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaGVpZ2h0OiBhdHRycy5jaGFydEhlaWdodCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRhdGFGb3JtYXQ6ICdqc29uJywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRhdGFTb3VyY2U6IGRvbnV0Q2hhcnREYXRhU291cmNlLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZXZlbnRzOiB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLy9kYXRhUGxvdFJvbGxPdmVyIGV2ZW50IGlzIHJhaXNlZCB3aGVuZXZlciB5b3UgaG92ZXIgb3ZlciBhIGRhdGEgcGxvdCAoY29sdW1uLCBhbmNob3Igb2YgbGluZSBvciBhcmVhLCBwaWUgZXRjLikKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAiZGF0YVBsb3RSb2xsT3ZlciI6IGZ1bmN0aW9uIChldnRPYmosIGFyZ3VtZW50c09iamVjdCkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YXIgc2VsZWN0ZWRMYWJlbEFyciA9IGFyZ3VtZW50c09iamVjdC50b29sVGV4dC5zcGxpdCgiLCIpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YXIgY2xhc3NOYW1lID0gc2VsZWN0ZWRMYWJlbEFyclswXS5yZXBsYWNlKC8gL2csICIiKS50b1VwcGVyQ2FzZSgpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBhbmd1bGFyLmVsZW1lbnQoZG9jdW1lbnQucXVlcnlTZWxlY3RvcigiW2NoYXJ0LWxlZ2VuZC1pZD0iICsgY2xhc3NOYW1lICsgIl9mdXNpb24iICsgIl0iKSkuYWRkQ2xhc3MoImFjdGl2ZSIpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0sCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgImRhdGFQbG90Um9sbE91dCI6IGZ1bmN0aW9uIChldnRPYmosIGFyZ09iaikgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YXIgc2VsZWN0ZWRMYWJlbEFyciA9IGFyZ09iai50b29sVGV4dC5zcGxpdCgiLCIpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YXIgY2xhc3NOYW1lID0gc2VsZWN0ZWRMYWJlbEFyclswXS5yZXBsYWNlKC8gL2csICIiKS50b1VwcGVyQ2FzZSgpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBhbmd1bGFyLmVsZW1lbnQoZG9jdW1lbnQucXVlcnlTZWxlY3RvcigiW2NoYXJ0LWxlZ2VuZC1pZD0iICsgY2xhc3NOYW1lICsgIl9mdXNpb24iICsgIl0iKSkucmVtb3ZlQ2xhc3MoImFjdGl2ZSIpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0sCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgImRhdGFQbG90Q2xpY2siOiBmdW5jdGlvbiAoZXZ0T2JqLCBhcmdPYmopIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYoYW5ndWxhci5pc0RlZmluZWQoc2NvcGUub25jbGlja2NhbGxiYWNrKSl7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNjb3BlLm9uY2xpY2tjYWxsYmFjayh7ZXZ0T2JqOmV2dE9iaiwgYXJnT2JqOmFyZ09ian0pOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9KTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZG9udXRDaGFydC5yZW5kZXIoKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgRG9udXRDaGFydEZ1c2lvbkNvbmZpZy5jaGFydC5kZWZhdWx0Q2VudGVyTGFiZWwgPSBEb251dENoYXJ0RnVzaW9uQ29uZmlnLmNoYXJ0LmRlZmF1bHRDZW50ZXJMYWJlbDsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB9KTsKKyAgICAgICAgICAgICAgICAgICAgICAgIH07CisgICAgICAgICAgICAgICAgICAgICAgICBpbml0Q2hhcnQoKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICR0aW1lb3V0KGZ1bmN0aW9uICgpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YXIgdyA9IGVsZW1lbnQuZmluZCgidWwiKVswXS5jbGllbnRIZWlnaHQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBmV2lkdGggPSAocGFyc2VJbnQoYXR0cnMuY2hhcnRIZWlnaHQsIDEwKSAtIHcpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGVsZW1lbnQuZmluZCgidWwiKS5jc3MoIm1hcmdpbi10b3AiLCAoZldpZHRoIC8gMikgKyAicHgiKTsKKworICAgICAgICAgICAgICAgICAgICAgICAgfSwgMjAwKTsKKyAgICAgICAgICAgICAgICAgICAgfSwKKyAgICAgICAgICAgICAgICAgICAgY29udHJvbGxlcjogZnVuY3Rpb24gKCRzY29wZSwgJGVsZW1lbnQsICRhdHRycykgeworICAgICAgICAgICAgICAgICAgICAgICAgdmFyIGxlZ2VuZENvbG9ycyA9IFtdOworICAgICAgICAgICAgICAgICAgICAgICAgbGVnZW5kQ29sb3JzID0gRG9udXRDaGFydEZ1c2lvbkNvbmZpZy5jaGFydC5wYWxldHRlQ29sb3JzLnNwbGl0KCIsIik7CisgICAgICAgICAgICAgICAgICAgICAgICAkc2NvcGUuYWRkTGVnZW5kQ29sb3IgPSBmdW5jdGlvbiAoaWQpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4geyJjb2xvciI6IGxlZ2VuZENvbG9yc1tpZF19OworICAgICAgICAgICAgICAgICAgICAgICAgfTsKKyAgICAgICAgICAgICAgICAgICAgICAgICRzY29wZS5sZWdlbmRSZXF1aXJlZCA9ICRhdHRycy5sZWdlbmRSZXF1aXJlZDsKKworICAgICAgICAgICAgICAgICAgICAgICAgJHNjb3BlLmFkZFN0eWxlID0gZnVuY3Rpb24gKGVsZW0pIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoJHNjb3BlLmxlZ2VuZFJlcXVpcmVkICYmIGFuZ3VsYXIuaXNEZWZpbmVkKCRhdHRycy5sZWdlbmRQb3NpdGlvbikpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKCRhdHRycy5sZWdlbmRQb3NpdGlvbiA9PT0gInJpZ2h0IikgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGVsZW0gPT09ICdjaGFydExlZ2VuZCcpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHsiZmxvYXQiOiAibGVmdCJ9OworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiB7ImZsb2F0IjogImxlZnQifTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChlbGVtID09PSAnY2hhcnRMZWdlbmQnKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiB7ImZsb2F0IjogImxlZnQifTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4geyJmbG9hdCI6ICJyaWdodCJ9OworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHsiZmxvYXQiOiAibGVmdCJ9OworICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgIH07CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICB9OworICAgICAgICAgICAgfV0pCisgICAgICAgIC5maWx0ZXIoJ2ZpbHRlckRhdGEnLCBmdW5jdGlvbiAoKSB7CisgICAgICAgICAgICByZXR1cm4gZnVuY3Rpb24gKGlucHV0KSB7CisgICAgICAgICAgICAgICAgcmV0dXJuIGlucHV0LnJlcGxhY2UoLyAvZywgIiIpLnRvVXBwZXJDYXNlKCk7CisgICAgICAgICAgICB9OworICAgICAgICB9KTsKK2FuZ3VsYXIubW9kdWxlKCdhdHQuY2hhcnRzLmhvcnNlc2hvZUQzJywgWydhdHQuY2hhcnRzLnV0aWxpdGllcyddKQorICAgICAgICAuY29uc3RhbnQoIkhvcnNlU2hvZUNoYXJ0RDNDb25maWciLAorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgImNoYXJ0Y29sb3IiOiB7CisgICAgICAgICAgICAgICAgICAgICAgICAicGFsZXR0ZUNvbG9ycyI6IFsiIzEwNzJiOCIsICIjRkVGRkY3Il0sIC8vZGVmYXVsdCBjb2xvciBvcHRpb25zIGZvciByZW5kZXJpbmcgY2hhcnQgYmFzZUNvbG9yIGFuZCBOZWVkbGVDb2xvciwKKyAgICAgICAgICAgICAgICAgICAgICAgICJwYWxldHRlQm9yZGVyQ29sb3JzIjogWyIjMTA3MmI4IiwgIiMwMDAiXQorICAgICAgICAgICAgICAgICAgICB9LAorICAgICAgICAgICAgICAgICAgICAiZGVmYXVsdGNlbnRlcmxhYmVsIjogIkNPUyAxIiwKKyAgICAgICAgICAgICAgICAgICAgImRlZmF1bHRjZW50ZXJjYXRlZ29yeSI6ICJSZWFsIFRpbWUiLAorICAgICAgICAgICAgICAgICAgICAiYW5pbWR1cmF0aW9uIjogNTAwLAorICAgICAgICAgICAgICAgICAgICAibGVnZW5kcmVxZCI6ICJmYWxzZSIsCisgICAgICAgICAgICAgICAgICAgICJsZWdlbmRwb3NpdGlvbiI6ICJ0b3AiLAorICAgICAgICAgICAgICAgICAgICAiY2VudGVyVGV4dExhYmVsRHkiOiAiMjAiCisgICAgICAgICAgICAgICAgfSkKKyAgICAgICAgLmRpcmVjdGl2ZSgnYXR0SG9yc2VzaG9lZDNDaGFydCcsIFsnSG9yc2VTaG9lQ2hhcnREM0NvbmZpZycsICckdGltZW91dCcsJyRleHRlbmRPYmonLCBmdW5jdGlvbiAoSG9yc2VTaG9lQ2hhcnREM0NvbmZpZywgJHRpbWVvdXQsJGV4dGVuZE9iaikgeworICAgICAgICAgICAgICAgIHJldHVybiB7CisgICAgICAgICAgICAgICAgICAgIHJlc3RyaWN0OiAnQScsCisgICAgICAgICAgICAgICAgICAgIHNjb3BlOiB7CisgICAgICAgICAgICAgICAgICAgICAgICBjaGFydENvbmZpZzogJz0nLAorICAgICAgICAgICAgICAgICAgICAgICAgaW5pdFZhbDogJz0nLAorICAgICAgICAgICAgICAgICAgICAgICAgaG9yc2VTaG9lSWQ6ICdAJworICAgICAgICAgICAgICAgICAgICB9LAorICAgICAgICAgICAgICAgICAgICB0ZW1wbGF0ZVVybDogJ3RlbXBsYXRlL2hvcnNlc2hvZUQzL2F0dEhvcnNlc2hvZUQzQ2hhcnQuaHRtbCcsCisgICAgICAgICAgICAgICAgICAgIHRyYW5zY2x1ZGU6IHRydWUsCisgICAgICAgICAgICAgICAgICAgIHJlcGxhY2U6IHRydWUsCisgICAgICAgICAgICAgICAgICAgIGNvbnRyb2xsZXI6IFsnJHNjb3BlJywgJyRhdHRycycsZnVuY3Rpb24gKCRzY29wZSwgJGF0dHJzKSB7CisgICAgICAgICAgICAgICAgICAgICAgICBpZiAoYW5ndWxhci5pc0RlZmluZWQoJHNjb3BlLmNoYXJ0Q29uZmlnKSkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgIEhvcnNlU2hvZUNoYXJ0RDNDb25maWcgPSAkZXh0ZW5kT2JqLmV4dGVuZERlZXAoSG9yc2VTaG9lQ2hhcnREM0NvbmZpZywgJHNjb3BlLmNoYXJ0Q29uZmlnKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgIHZhciBsZWdlbmRDb2xvciA9IFtdOworICAgICAgICAgICAgICAgICAgICAgICAgbGVnZW5kQ29sb3IgPSBIb3JzZVNob2VDaGFydEQzQ29uZmlnLmNoYXJ0Y29sb3IucGFsZXR0ZUNvbG9yczsKKyAgICAgICAgICAgICAgICAgICAgICAgICRzY29wZS5hZGRMZWdlbmRDb2xvciA9IGZ1bmN0aW9uICgpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4geyJjb2xvciI6IGxlZ2VuZENvbG9yWzBdfTsKKyAgICAgICAgICAgICAgICAgICAgICAgIH07CisgICAgICAgICAgICAgICAgICAgICAgICBpZiAoIWFuZ3VsYXIuaXNEZWZpbmVkKCRhdHRycy5sZWdlbmRSZXF1aXJlZCkpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAkc2NvcGUubGVnZW5kUmVxdWlyZWQgPSBIb3JzZVNob2VDaGFydEQzQ29uZmlnLmxlZ2VuZHJlcWQ7CisgICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICRzY29wZS5sZWdlbmRSZXF1aXJlZCA9ICRhdHRycy5sZWdlbmRSZXF1aXJlZDsKKyAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgIGlmICghYW5ndWxhci5pc0RlZmluZWQoJGF0dHJzLmxlZ2VuZFBvc2l0aW9uKSkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICRzY29wZS5sZWdlbmRQb3NpdGlvbiA9IEhvcnNlU2hvZUNoYXJ0RDNDb25maWcubGVnZW5kcG9zaXRpb247CisgICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICRzY29wZS5sZWdlbmRQb3NpdGlvbiA9ICRhdHRycy5sZWdlbmRQb3NpdGlvbjsKKyAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgfV0sCisgICAgICAgICAgICAgICAgICAgIGxpbms6IGZ1bmN0aW9uIChzY29wZSwgZWxlbWVudCwgYXR0cnMpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIHZhciByYWRpdXMgPSBNYXRoLm1pbihhdHRycy5jaGFydFdpZHRoLCBhdHRycy5jaGFydEhlaWdodCkgLyAyOworICAgICAgICAgICAgICAgICAgICAgICAgc2NvcGUuTGVnZW5kTGFiZWwgPSBIb3JzZVNob2VDaGFydEQzQ29uZmlnLmRlZmF1bHRjZW50ZXJsYWJlbDsKKyAgICAgICAgICAgICAgICAgICAgICAgIHNjb3BlLkxlZ2VuZENhdGVnb3J5ID0gSG9yc2VTaG9lQ2hhcnREM0NvbmZpZy5kZWZhdWx0Y2VudGVyY2F0ZWdvcnk7CisgICAgICAgICAgICAgICAgICAgICAgICB2YXIgZHVyYXRpb24gPSBIb3JzZVNob2VDaGFydEQzQ29uZmlnLmFuaW1kdXJhdGlvbiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZ3VhZ2VWYWwgPSBwYXJzZUludChzY29wZS5pbml0VmFsLnZhbHVlLCAxMCk7CisgICAgICAgICAgICAgICAgICAgICAgICBzY29wZS5ndWFnZVZhbCA9IGd1YWdlVmFsICsgIiUiOworICAgICAgICAgICAgICAgICAgICAgICAgdmFyIGRhdGFzZXQgPSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgbG93ZXI6IGNhbGNQZXJjZW50KDApLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIHVwcGVyOiBjYWxjUGVyY2VudChndWFnZVZhbCkKKyAgICAgICAgICAgICAgICAgICAgICAgIH0sCisgICAgICAgICAgICAgICAgICAgICAgICBwaWUgPSBkMy5sYXlvdXQucGllKCkuc29ydChudWxsKSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZm9ybWF0ID0gZDMuZm9ybWF0KCIuMCUiKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIHZhciBhcmMgPSBkMy5zdmcuYXJjKCkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLmlubmVyUmFkaXVzKHJhZGl1cyAtIDIwKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAub3V0ZXJSYWRpdXMocmFkaXVzKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAuc3RhcnRBbmdsZShmdW5jdGlvbiAoZCkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGQuc3RhcnRBbmdsZSArIDIuNiAqIE1hdGguUEkgLyAyOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9KQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAuZW5kQW5nbGUoZnVuY3Rpb24gKGQpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBkLmVuZEFuZ2xlICsgMi42ICogTWF0aC5QSSAvIDI7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0pOworCisgICAgICAgICAgICAgICAgICAgICAgICBlbGVtZW50WzBdLnF1ZXJ5U2VsZWN0b3IoJy5ob3JzZXNob2VkM0NvbnRhaW5lcicpLnNldEF0dHJpYnV0ZSgnaWQnLCBzY29wZS5ob3JzZVNob2VJZCk7CisKKyAgICAgICAgICAgICAgICAgICAgICAgIHZhciBzdmcgPSBkMy5zZWxlY3QoIi5ob3JzZXNob2VkM0NvbnRhaW5lciMiICsgc2NvcGUuaG9yc2VTaG9lSWQpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC5hdHRyKCJzdHlsZSIsICJoZWlnaHQ6ICIgKyBhdHRycy5jaGFydEhlaWdodCArICJweDsiKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAuYXBwZW5kKCJzdmciKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAuYXR0cigiaWQiLCBzY29wZS5ob3JzZVNob2VJZCkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLmF0dHIoIndpZHRoIiwgIjEwMCUiKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAuYXR0cigiaGVpZ2h0IiwgIjEwMCUiKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAuYXR0cigndmlld0JveCcsICcwIDAgJyArIE1hdGgubWluKGF0dHJzLmNoYXJ0V2lkdGgsIGF0dHJzLmNoYXJ0SGVpZ2h0KSArICcgJyArIE1hdGgubWluKGF0dHJzLmNoYXJ0V2lkdGgsIGF0dHJzLmNoYXJ0SGVpZ2h0KSkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLmF0dHIoJ3ByZXNlcnZlQXNwZWN0UmF0aW8nLCAneE1pbllNaW4nKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAuYXBwZW5kKCJnIikKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLmF0dHIoInRyYW5zZm9ybSIsICJ0cmFuc2xhdGUoIiArIE1hdGgubWluKGF0dHJzLmNoYXJ0V2lkdGgsIGF0dHJzLmNoYXJ0SGVpZ2h0KSAvIDIgKyAiLCIgKyBNYXRoLm1pbihhdHRycy5jaGFydFdpZHRoLCBhdHRycy5jaGFydEhlaWdodCkgLyAyICsgIikiKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIHZhciBwYXRoID0gc3ZnLnNlbGVjdEFsbCgicGF0aCIpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC5kYXRhKHBpZShkYXRhc2V0Lmxvd2VyKSkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLmVudGVyKCkuYXBwZW5kKCJwYXRoIikKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLmF0dHIoImNsYXNzIiwgZnVuY3Rpb24gKGQsIGkpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiAiY29sb3IiICsgaTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLmF0dHIoImZpbGwiLCBIb3JzZVNob2VDaGFydEQzQ29uZmlnLmNoYXJ0Y29sb3IucGFsZXR0ZUNvbG9yc1sxXSkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLmF0dHIoInN0cm9rZSIsIEhvcnNlU2hvZUNoYXJ0RDNDb25maWcuY2hhcnRjb2xvci5wYWxldHRlQm9yZGVyQ29sb3JzWzFdKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAuYXR0cigiZCIsIGFyYykKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLmVhY2goZnVuY3Rpb24gKGQpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRoaXMuX2N1cnJlbnQgPSBkOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9KTsgLy8gc3RvcmUgdGhlIGluaXRpYWwgdmFsdWVzCisgICAgICAgICAgICAgICAgICAgICAgICAvLyBhZGQgY2VudGVyIHRleHQgZWxlbWVudAorICAgICAgICAgICAgICAgICAgICAgICAgdmFyIGNlbnRlclRleHRWYWx1ZSA9IHN2Zy5hcHBlbmQoInRleHQiKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAuYXR0cigiY2xhc3MiLCAiaG9yc2VzaG9lY2VudGVyVmFsdWUiKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIHZhciBjZW50ZXJUZXh0TGFiZWwgPSBzdmcuYXBwZW5kKCJ0ZXh0IikKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLmF0dHIoInkiLCBIb3JzZVNob2VDaGFydEQzQ29uZmlnLmNlbnRlclRleHRMYWJlbER5KQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAuYXR0cigiY2xhc3MiLCAiaG9yc2VzaG9lY2VudGVyTGFiZWwiKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIGlmICh0eXBlb2YgKGd1YWdlVmFsKSA9PT0gInN0cmluZyIpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBjZW50ZXJUZXh0VmFsdWUudGV4dChndWFnZVZhbCk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgY2VudGVyVGV4dExhYmVsLnRleHQoSG9yc2VTaG9lQ2hhcnREM0NvbmZpZy5kZWZhdWx0Y2VudGVybGFiZWwgKyAiKCIgKyBIb3JzZVNob2VDaGFydEQzQ29uZmlnLmRlZmF1bHRjZW50ZXJjYXRlZ29yeSArICIpIik7CisgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICBlbHNlIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YXIgcHJvZ3Jlc3MgPSAwOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhciB0aW1lb3V0ID0gc2V0VGltZW91dChmdW5jdGlvbiAoKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNsZWFyVGltZW91dCh0aW1lb3V0KTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcGF0aCA9IHBhdGguZGF0YShwaWUoZGF0YXNldC51cHBlcikpOyAvLyB1cGRhdGUgdGhlIGRhdGEKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcGF0aC50cmFuc2l0aW9uKCkuZHVyYXRpb24oZHVyYXRpb24pLmF0dHJUd2VlbigiZCIsIGZ1bmN0aW9uIChhLCBpbmRleCkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYW5ndWxhci5lbGVtZW50KHRoaXMpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC5hdHRyKCJmaWxsIiwgSG9yc2VTaG9lQ2hhcnREM0NvbmZpZy5jaGFydGNvbG9yLnBhbGV0dGVDb2xvcnNbaW5kZXhdKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAuYXR0cigic3Ryb2tlIiwgSG9yc2VTaG9lQ2hhcnREM0NvbmZpZy5jaGFydGNvbG9yLnBhbGV0dGVCb3JkZXJDb2xvcnNbaW5kZXhdKTsKKworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFyIGkgPSBkMy5pbnRlcnBvbGF0ZSh0aGlzLl9jdXJyZW50LCBhKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhciBpMiA9IGQzLmludGVycG9sYXRlKHByb2dyZXNzLCBndWFnZVZhbCk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0aGlzLl9jdXJyZW50ID0gaSgwKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBmdW5jdGlvbiAodCkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNlbnRlclRleHRWYWx1ZS50ZXh0KGZvcm1hdChpMih0KSAvIDEwMCkpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNlbnRlclRleHRMYWJlbC50ZXh0KEhvcnNlU2hvZUNoYXJ0RDNDb25maWcuZGVmYXVsdGNlbnRlcmxhYmVsICsgIigiICsgSG9yc2VTaG9lQ2hhcnREM0NvbmZpZy5kZWZhdWx0Y2VudGVyY2F0ZWdvcnkgKyAiKSIpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBhcmMoaSh0KSk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9OworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9KTsgLy8gcmVkcmF3IHRoZSBhcmNzCisKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB9LCAyMDApOworICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgc2NvcGUuJHdhdGNoKCdpbml0VmFsJywgZnVuY3Rpb24gKHZhbHVlKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2NvcGUuZ3VhZ2VWYWwgPSB2YWx1ZS52YWx1ZSArICIlIjsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBwYXRoLmRhdGEocGllKGNhbGNQZXJjZW50KHZhbHVlLnZhbHVlKSkpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBhdGgudHJhbnNpdGlvbigpLmR1cmF0aW9uKGR1cmF0aW9uKS5hdHRyVHdlZW4oImQiLCBmdW5jdGlvbiAoYSwgaW5kZXgpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYW5ndWxhci5lbGVtZW50KHRoaXMpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLmF0dHIoImZpbGwiLCBIb3JzZVNob2VDaGFydEQzQ29uZmlnLmNoYXJ0Y29sb3IucGFsZXR0ZUNvbG9yc1tpbmRleF0pCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLmF0dHIoInN0cm9rZSIsIEhvcnNlU2hvZUNoYXJ0RDNDb25maWcuY2hhcnRjb2xvci5wYWxldHRlQm9yZGVyQ29sb3JzW2luZGV4XSk7CisKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFyIGkgPSBkMy5pbnRlcnBvbGF0ZSh0aGlzLl9jdXJyZW50LCBhKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFyIGkyID0gZDMuaW50ZXJwb2xhdGUocHJvZ3Jlc3MsIHZhbHVlLnZhbHVlKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdGhpcy5fY3VycmVudCA9IGkoMCk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBmdW5jdGlvbiAodCkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY2VudGVyVGV4dFZhbHVlLnRleHQoZm9ybWF0KGkyKHQpIC8gMTAwKSk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjZW50ZXJUZXh0TGFiZWwudGV4dChIb3JzZVNob2VDaGFydEQzQ29uZmlnLmRlZmF1bHRjZW50ZXJsYWJlbCArICIoIiArIEhvcnNlU2hvZUNoYXJ0RDNDb25maWcuZGVmYXVsdGNlbnRlcmNhdGVnb3J5ICsgIikiKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBhcmMoaSh0KSk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH07CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSk7IC8vIHJlZHJhdyB0aGUgYXJjcworCisgICAgICAgICAgICAgICAgICAgICAgICB9KTsKKyAgICAgICAgICAgICAgICAgICAgICAgIGZ1bmN0aW9uIGNhbGNQZXJjZW50KGd1YWdlVmFsKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFtndWFnZVZhbCwgMTAwIC0gZ3VhZ2VWYWxdOworICAgICAgICAgICAgICAgICAgICAgICAgfQorCisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICB9OworICAgICAgICAgICAgfV0pOworYW5ndWxhci5tb2R1bGUoJ2F0dC5jaGFydHMucmFkaWFsZ3VhZ2VEMycsIFsnYXR0LmNoYXJ0cy51dGlsaXRpZXMnXSkKKyAgICAgICAgLmNvbnN0YW50KCJSYWRpYWxHdWFnZUNoYXJ0RDNDb25maWciLAorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgImNoYXJ0Y29sb3IiOiB7CisgICAgICAgICAgICAgICAgICAgICAgICAiTWF4QmFuZHdpZHRoUmVhY2hlZCI6IFsiI2VmZWZlZiJdLAorICAgICAgICAgICAgICAgICAgICAgICAgIlplcm9CYW5kd2lkdGhTZWxlY3RlZCI6IFsiI0ZFRkZGNyJdLAorICAgICAgICAgICAgICAgICAgICAgICAgIlJlbWFpbmluZ0JhbmR3aWR0aENvbG9yIjogWyIjRkVGRkY3Il0sCisgICAgICAgICAgICAgICAgICAgICAgICAiUmVtYWluaW5nQmFuZHdpZHRoU3Ryb2tlQ29sb3IiOiBbIiMwMDAwMDAiXSwKKyAgICAgICAgICAgICAgICAgICAgICAgICJVc2VkQmFuZHdpZHRoQ29sb3IiOiBbIiMxMDcyYjgiXSwKKyAgICAgICAgICAgICAgICAgICAgICAgICJNb3VzZU92ZXJBcmNGaWxsQ29sb3IiOiBbIiMwMDkxZDkiXSwKKyAgICAgICAgICAgICAgICAgICAgICAgICJSZW1haW5pbmdCYW5kd2lkdGhTdHJva2VXaWR0aCI6MSwKKyAgICAgICAgICAgICAgICAgICAgICAgICJVc2VkQmFuZHdpZHRoU3Ryb2tlV2lkdGgiOjEsCisgICAgICAgICAgICAgICAgICAgICAgICAiVXNlZEJhbmR3aWR0aFN0cm9rZUNvbG9yIjpbIiNlZmVmZWYiXQorICAgICAgICAgICAgICAgICAgICB9LAorICAgICAgICAgICAgICAgICAgICAiZGVmYXVsdGNlbnRlcmxhYmVsIjogIkticHMiLAorICAgICAgICAgICAgICAgICAgICAibWF4QWxsb3dlZFVuaXRzTGFiZWwiOiAiS2JwcyIsCisgICAgICAgICAgICAgICAgICAgICJ6b29tTGV2ZWwiOiAiMjUiLAorICAgICAgICAgICAgICAgICAgICAiZG91Z2hudXRyYXRpbyI6IDIwLAorICAgICAgICAgICAgICAgICAgICAiYW5pbWR1cmF0aW9uIjogIjMwMCIsCisgICAgICAgICAgICAgICAgICAgICJndWFnZVN0YXJ0QW5nbGUiOjQsCisgICAgICAgICAgICAgICAgICAgICJndWFnZUVuZEFuZ2xlIjo4LjU2LAorICAgICAgICAgICAgICAgICAgICAibGVnZW5kcmVxZCI6ICJmYWxzZSIsCisgICAgICAgICAgICAgICAgICAgICJsZWdlbmRwb3NpdGlvbiI6ICJ0b3AiLAorICAgICAgICAgICAgICAgICAgICAiY2VudGVyVGV4dExhYmVsRHkiOiAiMjAiLAorICAgICAgICAgICAgICAgICAgICAiY2VudGVyVGV4dFZhbHVlRHkiOiAiMCIsCisgICAgICAgICAgICAgICAgICAgICJjZW50ZXJUZXh0VmFsdWVEeCI6ICIwIiwKKyAgICAgICAgICAgICAgICAgICAgImNlbnRlclRleHRMYWJlbER4IjogIjAiLAorICAgICAgICAgICAgICAgICAgICAibWF4YmFuZHdpZHRoVGV4dER4IjogIjY1IiwKKyAgICAgICAgICAgICAgICAgICAgIm1heGJhbmR3aWR0aFRleHREeSI6ICIxMDAiLAorICAgICAgICAgICAgICAgICAgICAiYXJjT3Zlck1hcmdpbiI6IDUKKyAgICAgICAgICAgICAgICB9KQorICAgICAgICAuZGlyZWN0aXZlKCdhdHRSYWRpYWxndWFnZWQzQ2hhcnQnLCBbJ1JhZGlhbEd1YWdlQ2hhcnREM0NvbmZpZycsICckdGltZW91dCcsJyRleHRlbmRPYmonLCBmdW5jdGlvbihSYWRpYWxHdWFnZUNoYXJ0RDNDb25maWcsICR0aW1lb3V0LCRleHRlbmRPYmopIHsKKyAgICAgICAgICAgICAgICByZXR1cm4geworICAgICAgICAgICAgICAgICAgICByZXN0cmljdDogJ0EnLAorICAgICAgICAgICAgICAgICAgICBzY29wZTogeworICAgICAgICAgICAgICAgICAgICAgICAgbWF4VmFsdWU6ICc9JywKKyAgICAgICAgICAgICAgICAgICAgICAgIGNoYXJ0RGF0YTogJz0nLAorICAgICAgICAgICAgICAgICAgICAgICAgY2hhcnRDb25maWc6ICc9JywKKyAgICAgICAgICAgICAgICAgICAgICAgIHJlc2V0Q2hhcnQ6ICc9JywKKyAgICAgICAgICAgICAgICAgICAgICAgIG1vdXNlT3ZlcjogJz0/JworICAgICAgICAgICAgICAgICAgICB9LAorICAgICAgICAgICAgICAgICAgICBjb250cm9sbGVyOiBbJyRzY29wZScsICckYXR0cnMnLCBmdW5jdGlvbigkc2NvcGUsICRhdHRycykgeworICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGFuZ3VsYXIuaXNEZWZpbmVkKCRzY29wZS5jaGFydENvbmZpZykpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBSYWRpYWxHdWFnZUNoYXJ0RDNDb25maWcgPSAkZXh0ZW5kT2JqLmV4dGVuZERlZXAoUmFkaWFsR3VhZ2VDaGFydEQzQ29uZmlnLCAkc2NvcGUuY2hhcnRDb25maWcpOworICAgICAgICAgICAgICAgICAgICAgICAgfQorCisgICAgICAgICAgICAgICAgICAgICAgICB9XSwKKyAgICAgICAgICAgICAgICAgICAgbGluazogZnVuY3Rpb24oc2NvcGUsIGVsZW1lbnQsIGF0dHJzKSB7CisgICAgICAgICAgICAgICAgICAgICAgICB2YXIgem9vbSA9IHBhcnNlSW50KFJhZGlhbEd1YWdlQ2hhcnREM0NvbmZpZy56b29tTGV2ZWwsIDApLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBtYXJnaW4gPSB7Ly8gb3B0aW9uYWxseSBzZXQgbWFyZ2lucworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdG9wOiB6b29tLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmlnaHQ6IHpvb20sCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBib3R0b206IHpvb20sCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBsZWZ0OiB6b29tCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0sCisgICAgICAgICAgICAgICAgICAgICAgICB3aWR0aCA9IGF0dHJzLmNoYXJ0V2lkdGgsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGhlaWdodCA9IGF0dHJzLmNoYXJ0SGVpZ2h0LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByYWRpdXMgPSBNYXRoLm1pbigKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB3aWR0aCAtIChtYXJnaW4ubGVmdCArIG1hcmdpbi5yaWdodCksCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaGVpZ2h0IC0gKG1hcmdpbi50b3AgKyBtYXJnaW4uYm90dG9tKSkgLyAyOworICAgICAgICAgICAgICAgICAgICAgICAgLy8gc2V0IHJhZGl1cworICAgICAgICAgICAgICAgICAgICAgICAgdmFyIGFyYyA9IGQzLnN2Zy5hcmMoKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAuaW5uZXJSYWRpdXMocmFkaXVzIC0gUmFkaWFsR3VhZ2VDaGFydEQzQ29uZmlnLmRvdWdobnV0cmF0aW8pCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC5vdXRlclJhZGl1cyhyYWRpdXMpOworICAgICAgICAgICAgICAgICAgICAgICAgLy8gc2V0IGhvdmVyZWQgcmFkaXVzCisgICAgICAgICAgICAgICAgICAgICAgICB2YXIgYXJjT3ZlciA9IGQzLnN2Zy5hcmMoKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAuaW5uZXJSYWRpdXMocmFkaXVzIC0gUmFkaWFsR3VhZ2VDaGFydEQzQ29uZmlnLmRvdWdobnV0cmF0aW8pCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC5vdXRlclJhZGl1cyhyYWRpdXMgKyBSYWRpYWxHdWFnZUNoYXJ0RDNDb25maWcuYXJjT3Zlck1hcmdpbik7CisgICAgICAgICAgICAgICAgICAgICAgICAvLyBCcm93c2VyIG9ucmVzaXplIGV2ZW50CisgICAgICAgICAgICAgICAgICAgICAgICB3aW5kb3cub25yZXNpemUgPSBmdW5jdGlvbigpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBzY29wZS4kYXBwbHkoKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIH07CisKKyAgICAgICAgICAgICAgICAgICAgICAgIHNjb3BlLiR3YXRjaCgnbW91c2VPdmVyJywgZnVuY3Rpb24odmFsKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKCFhbmd1bGFyLmlzRGVmaW5lZChzY29wZS5tb3VzZU92ZXIpKSB7IHJldHVybjsgfQorICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhciBpZCA9IHBhcnNlSW50KHNjb3BlLm1vdXNlT3Zlci5zcGxpdCgnLScpWzFdLCAxMCk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHNjb3BlLm1vdXNlT3Zlci5zcGxpdCgnLScpWzBdID09PSAndHJ1ZScpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZDMuc2VsZWN0KCdwYXRoI3JhZGlhbGd1YWdlcGF0aC0nICsgKGlkKSkudHJhbnNpdGlvbigpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAuZHVyYXRpb24ocGFyc2VJbnQoUmFkaWFsR3VhZ2VDaGFydEQzQ29uZmlnLmFuaW1kdXJhdGlvbiwxMCkpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAuYXR0cignZCcsIGFyY092ZXIpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBkMy5zZWxlY3QoJ3BhdGgjcmFkaWFsZ3VhZ2VwYXRoLScgKyAoaWQpKS50cmFuc2l0aW9uKCkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC5kdXJhdGlvbihwYXJzZUludChSYWRpYWxHdWFnZUNoYXJ0RDNDb25maWcuYW5pbWR1cmF0aW9uLDEwKSkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC5hdHRyKCdkJywgYXJjKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICB9KTsKKworICAgICAgICAgICAgICAgICAgICAgICAgc2NvcGUuJHdhdGNoKCdyZXNldENoYXJ0JywgZnVuY3Rpb24oKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGFuZ3VsYXIuaXNEZWZpbmVkKHNjb3BlLnJlc2V0Q2hhcnQpKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChhbmd1bGFyLmlzRGVmaW5lZChzY29wZS5jaGFydERhdGEpKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzY29wZS5yZW5kZXIoc2NvcGUuY2hhcnREYXRhLCBzY29wZS5jaGFydERhdGEpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNjb3BlLnJlc2V0Q2hhcnQgPSBmYWxzZTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICB9KTsKKyAgICAgICAgICAgICAgICAgICAgICAgIHNjb3BlLiR3YXRjaCgnY2hhcnREYXRhJywgZnVuY3Rpb24obmV3VmFsdWUsIG9sZFZhbHVlKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHNjb3BlLnJlbmRlcihuZXdWYWx1ZSwgb2xkVmFsdWUpOworICAgICAgICAgICAgICAgICAgICAgICAgfSwgdHJ1ZSk7CisgICAgICAgICAgICAgICAgICAgICAgICBzY29wZS5yZW5kZXIgPSBmdW5jdGlvbihuZXdWYWx1ZSwgb2xkVmFsdWUpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBkMy5zZWxlY3QoInN2ZyMiICsgYXR0cnMuaWQpLnJlbW92ZSgpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGQzLnNlbGVjdEFsbCgic3ZnIyIgKyBhdHRycy5pZCArICIgPiAqIikucmVtb3ZlKCk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKCFzY29wZS5jaGFydERhdGEpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm47CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhciBjb2xvciwgc2VsZWN0ZWRTbGlkZXIsIHRvdGFsQmFuZHdpZHRoID0gMCwgdG90YWxVc2VkID0gMCwgcmVtYWluaW5nQmFuZHdpZHRoID0gMDsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoYW5ndWxhci5pc0RlZmluZWQoc2NvcGUubWF4VmFsdWUpKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRvdGFsQmFuZHdpZHRoID0gcGFyc2VJbnQoc2NvcGUubWF4VmFsdWUsIDApOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBhbmd1bGFyLmZvckVhY2gobmV3VmFsdWUsIGZ1bmN0aW9uKHZhbCwga2V5KSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRvdGFsVXNlZCA9ICh0b3RhbFVzZWQgKyBwYXJzZUludCh2YWwudmFsdWUsIDEwKSk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChuZXdWYWx1ZVtrZXldLnZhbHVlICE9PSBvbGRWYWx1ZVtrZXldLnZhbHVlKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzZWxlY3RlZFNsaWRlciA9IGtleTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0pOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhciBkYXRhID0gYW5ndWxhci5jb3B5KHNjb3BlLmNoYXJ0RGF0YSk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHRvdGFsVXNlZCA8IHRvdGFsQmFuZHdpZHRoKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJlbWFpbmluZ0JhbmR3aWR0aCA9IHRvdGFsQmFuZHdpZHRoIC0gcGFyc2VJbnQodG90YWxVc2VkLCAwKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZGF0YS5wdXNoKHtuYW1lOiAicmVtYWluaW5nIiwgdmFsdWU6IHJlbWFpbmluZ0JhbmR3aWR0aH0pOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBlbGVtZW50WzBdLnNldEF0dHJpYnV0ZSgnaWQnLCBhdHRycy5pZCk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFyIHN2ZyA9IGQzLnNlbGVjdChlbGVtZW50WzBdKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLmF0dHIoInN0eWxlIiwgImhlaWdodDogIiArIGF0dHJzLmNoYXJ0SGVpZ2h0ICsgInB4OyIpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAuYXBwZW5kKCJzdmciKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLmF0dHIoImlkIiwgYXR0cnMuaWQpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAuYXR0cigid2lkdGgiLCAiMTAwJSIpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAuYXR0cigiaGVpZ2h0IiwgIjEwMCUiKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLmF0dHIoJ3ZpZXdCb3gnLCAnMCAwICcgKyBNYXRoLm1pbih3aWR0aCwgaGVpZ2h0KSArICcgJyArIE1hdGgubWluKHdpZHRoLCBoZWlnaHQpKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLmF0dHIoJ3ByZXNlcnZlQXNwZWN0UmF0aW8nLCAneE1pbllNaW4nKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLmFwcGVuZCgiZyIpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAuYXR0cigidHJhbnNmb3JtIiwgInRyYW5zbGF0ZSgiICsgTWF0aC5taW4od2lkdGgsIGhlaWdodCkgLyAyICsgIiwiICsgTWF0aC5taW4od2lkdGgsIGhlaWdodCkgLyAyICsgIikiKTsKKworICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhciBjZW50ZXJUZXh0VmFsdWUgPSBzdmcuYXBwZW5kKCJ0ZXh0IikKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC5hdHRyKCJ5IiwgUmFkaWFsR3VhZ2VDaGFydEQzQ29uZmlnLmNlbnRlclRleHRWYWx1ZUR5KQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLmF0dHIoIngiLCBSYWRpYWxHdWFnZUNoYXJ0RDNDb25maWcuY2VudGVyVGV4dFZhbHVlRHgpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAuYXR0cigiY2xhc3MiLCAicmFkaWFsZ3VhZ2VjZW50ZXJWYWx1ZSIpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhciBjZW50ZXJUZXh0TGFiZWwgPSBzdmcuYXBwZW5kKCJ0ZXh0IikKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC5hdHRyKCJ5IiwgUmFkaWFsR3VhZ2VDaGFydEQzQ29uZmlnLmNlbnRlclRleHRMYWJlbER5KQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLmF0dHIoIngiLCBSYWRpYWxHdWFnZUNoYXJ0RDNDb25maWcuY2VudGVyVGV4dExhYmVsRHgpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAuYXR0cigiY2xhc3MiLCAicmFkaWFsZ3VhZ2VjZW50ZXJMYWJlbCIpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhciBtYXhiYW5kd2lkdGhUZXh0ID0gc3ZnLmFwcGVuZCgidGV4dCIpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAuYXR0cigieSIsIFJhZGlhbEd1YWdlQ2hhcnREM0NvbmZpZy5tYXhiYW5kd2lkdGhUZXh0RHkpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAuYXR0cigieCIsIFJhZGlhbEd1YWdlQ2hhcnREM0NvbmZpZy5tYXhiYW5kd2lkdGhUZXh0RHgpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAuYXR0cigiY2xhc3MiLCAicmFkaWFsbWF4YmFuZHdpZHRoVGV4dCIpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICh0b3RhbFVzZWQgPiB0b3RhbEJhbmR3aWR0aCkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0b3RhbFVzZWQgPSB0b3RhbEJhbmR3aWR0aDsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZGF0YSA9IFsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBuYW1lOiAidG90YWxVc2VkIiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YWx1ZTogIjEwMCIKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY29sb3IgPSBkMy5zY2FsZS5vcmRpbmFsKCkucmFuZ2UoUmFkaWFsR3VhZ2VDaGFydEQzQ29uZmlnLmNoYXJ0Y29sb3IuTWF4QmFuZHdpZHRoUmVhY2hlZCk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIGlmICh0b3RhbFVzZWQgPD0gMCkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBkYXRhID0gWworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG5hbWU6ICJ0b3RhbFVuVXNlZCIsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFsdWU6ICIxMDAiCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIF07CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbG9yID0gZDMuc2NhbGUub3JkaW5hbCgpLnJhbmdlKFJhZGlhbEd1YWdlQ2hhcnREM0NvbmZpZy5jaGFydGNvbG9yLlplcm9CYW5kd2lkdGhTZWxlY3RlZCk7CisKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YXIgQ29sb3JwYWxldHRlID0gW107CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChuZXdWYWx1ZSA9PT0gb2xkVmFsdWUpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRhdGEgPSBbCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBuYW1lOiAidG90YWxVc2VkIiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFsdWU6IHRvdGFsVXNlZAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIF07CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAocmVtYWluaW5nQmFuZHdpZHRoID4gMCkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRhdGEucHVzaCh7bmFtZTogInJlbWFpbmluZyIsIHZhbHVlOiByZW1haW5pbmdCYW5kd2lkdGh9KTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBmb3IgKHZhciBqID0gMDsgaiA8IGRhdGEubGVuZ3RoIC0gMTsgaisrKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBDb2xvcnBhbGV0dGVbal0gPSBSYWRpYWxHdWFnZUNoYXJ0RDNDb25maWcuY2hhcnRjb2xvci5Vc2VkQmFuZHdpZHRoQ29sb3I7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHJlbWFpbmluZ0JhbmR3aWR0aCA+IDApIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIENvbG9ycGFsZXR0ZS5wdXNoKFJhZGlhbEd1YWdlQ2hhcnREM0NvbmZpZy5jaGFydGNvbG9yLlJlbWFpbmluZ0JhbmR3aWR0aENvbG9yKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb2xvciA9IGQzLnNjYWxlLm9yZGluYWwoKS5yYW5nZShDb2xvcnBhbGV0dGUpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KKworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNlbnRlclRleHRWYWx1ZS50ZXh0KHRvdGFsVXNlZCk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgY2VudGVyVGV4dExhYmVsLnRleHQoUmFkaWFsR3VhZ2VDaGFydEQzQ29uZmlnLmRlZmF1bHRjZW50ZXJsYWJlbCk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgbWF4YmFuZHdpZHRoVGV4dC50ZXh0KHRvdGFsQmFuZHdpZHRoICsgIiAiICsgUmFkaWFsR3VhZ2VDaGFydEQzQ29uZmlnLm1heEFsbG93ZWRVbml0c0xhYmVsKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YXIgcGllID0gZDMubGF5b3V0LnBpZSgpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAuc29ydChudWxsKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLnN0YXJ0QW5nbGUoUmFkaWFsR3VhZ2VDaGFydEQzQ29uZmlnLmd1YWdlU3RhcnRBbmdsZSkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC5lbmRBbmdsZShSYWRpYWxHdWFnZUNoYXJ0RDNDb25maWcuZ3VhZ2VFbmRBbmdsZSkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC52YWx1ZShmdW5jdGlvbihkKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGQudmFsdWU7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9KTsKKworICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhciBnID0gc3ZnLnNlbGVjdEFsbCgiLmFyYyIpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAuZGF0YShwaWUoZGF0YSkpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAuZW50ZXIoKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLmFwcGVuZCgiZyIpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAuYXR0cigiY2xhc3MiLCAiYXJjIikKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC5hdHRyKCJpZCIsIGZ1bmN0aW9uKGQsIGkpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gInJhZGlhbGd1YWdlYXJjLSIgKyBpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC5zdHlsZSgiY3Vyc29yIiwgInBvaW50ZXIiKTsKKworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChuZXdWYWx1ZSA9PT0gb2xkVmFsdWUpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZy5hcHBlbmQoInBhdGgiKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC5zdHlsZSgiZmlsbCIsIGZ1bmN0aW9uKGQpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGNvbG9yKGQuZGF0YS5uYW1lKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9KQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC5hdHRyKCJpZCIsIGZ1bmN0aW9uKGQsIGkpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuICJyYWRpYWxndWFnZXBhdGgtIiArIGk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAudHJhbnNpdGlvbigpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLmVhc2UoImV4cCIpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLmR1cmF0aW9uKDApCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLmF0dHJUd2VlbigiZCIsIHR3ZWVuUGllKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBnLmFwcGVuZCgicGF0aCIpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLnN0eWxlKCJmaWxsIiwgZnVuY3Rpb24oZCkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gY29sb3IoZC5kYXRhLm5hbWUpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0pCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLmF0dHIoImlkIiwgZnVuY3Rpb24oZCwgaSkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gInJhZGlhbGd1YWdlcGF0aC0iICsgaTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9KQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC5zdHlsZSgic3Ryb2tlIiwgUmFkaWFsR3VhZ2VDaGFydEQzQ29uZmlnLmNoYXJ0Y29sb3IuUmVtYWluaW5nQmFuZHdpZHRoQ29sb3IpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLnN0eWxlKCJzdHJva2Utd2lkdGgiLCBSYWRpYWxHdWFnZUNoYXJ0RDNDb25maWcuY2hhcnRjb2xvci5Vc2VkQmFuZHdpZHRoU3Ryb2tlV2lkdGgpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLnRyYW5zaXRpb24oKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC5lYXNlKCJleHAiKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC5kdXJhdGlvbigwKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC5hdHRyVHdlZW4oImQiLCB0d2VlblBpZSk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICh0b3RhbFVzZWQgPT09IHRvdGFsQmFuZHdpZHRoIHx8IHJlbWFpbmluZ0JhbmR3aWR0aCA+IDApIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFyIGNvdW50ID0gZG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VyQXJjRmlsbENvbG9yKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgZnVuY3Rpb24gdHdlZW5QaWUoYikgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YXIgaSA9IGQzLmludGVycG9sYXRlKHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHN0YXJ0QW5nbGU6IDIuMSAqIE1hdGguUEksCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBlbmRBbmdsZTogMi4xICogTWF0aC5QSQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9LCBiKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGZ1bmN0aW9uKHQpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBhcmMoaSh0KSk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH07CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQorCisgICAgICAgICAgICAgICAgICAgICAgICB9OworCisKKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIH07CisgICAgICAgICAgICB9XSk7Cithbmd1bGFyLm1vZHVsZSgnYXR0LmNoYXJ0cy5zdGFja2VkQmFyY2hhcnQnLCBbJ2F0dC5jaGFydHMudXRpbGl0aWVzJ10pCisgICAgICAgIC5jb25zdGFudCgic3RhY2tCYXJDaGFydENvbmZpZyIsCisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAiY2hhcnRjb2xvciI6IFsiI0IyQjJCMiIsICIjMDBDQzAwIl0sCisgICAgICAgICAgICAgICAgICAgICJncmlkTGluZUNvbG9yIjogIiNDQ0NDQ0MiLAorICAgICAgICAgICAgICAgICAgICAieUF4aXNNYXhUaWNrcyI6IDQsCisgICAgICAgICAgICAgICAgICAgICJjaGFydEhlaWdodCI6ICIyMDAiLAorICAgICAgICAgICAgICAgICAgICAiY2hhcnRPcGFjaXR5IjogMC4zLAorICAgICAgICAgICAgICAgICAgICAiYW1vdW50S0RpdmlzaW9uIjogMTAwMCwKKyAgICAgICAgICAgICAgICAgICAgImFtb3VudEtUZXh0IjogIksiLAorICAgICAgICAgICAgICAgICAgICAiYW1vdW50TURpdmlzaW9uIjogMTAwMDAwMCwKKyAgICAgICAgICAgICAgICAgICAgImFtb3VudE1UZXh0IjogIk0iLAorICAgICAgICAgICAgICAgICAgICAieWVhckxhYmVsUG9zIjogeyJ4IjogMTAsICJ5IjogMTV9LAorICAgICAgICAgICAgICAgICAgICAidG9vbHRpcFRvcE1hcmdpbiI6IDExMCwKKyAgICAgICAgICAgICAgICAgICAgInRvb2x0aXBMZWZ0TWFyZ2luIjogNTQsCisgICAgICAgICAgICAgICAgICAgICJtYXJnaW4iOiB7CisgICAgICAgICAgICAgICAgICAgICAgICB0b3A6IDIwLAorICAgICAgICAgICAgICAgICAgICAgICAgcmlnaHQ6IDgwLAorICAgICAgICAgICAgICAgICAgICAgICAgYm90dG9tOiAzMCwKKyAgICAgICAgICAgICAgICAgICAgICAgIGxlZnQ6IDUyCisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICB9KQorICAgICAgICAuZGlyZWN0aXZlKCdzdGFja2VkQmFyQ2hhcnQnLCBbJ3N0YWNrQmFyQ2hhcnRDb25maWcnLCAnJGV4dGVuZE9iaicsICckdGltZW91dCcsIGZ1bmN0aW9uIChzdGFja0JhckNoYXJ0Q29uZmlnLCAkZXh0ZW5kT2JqLCAkdGltZW91dCkgeworICAgICAgICAgICAgICAgIHJldHVybiB7CisgICAgICAgICAgICAgICAgICAgIHJlc3RyaWN0OiAnQScsCisgICAgICAgICAgICAgICAgICAgIHNjb3BlOiB7CisgICAgICAgICAgICAgICAgICAgICAgICBjaGFydERhdGE6ICc9JywKKyAgICAgICAgICAgICAgICAgICAgICAgIGxlZ2VuZFJlcXVpcmVkOiAiPSIsCisgICAgICAgICAgICAgICAgICAgICAgICByZWZyZXNoQ2hhcnQ6ICI9IiwKKyAgICAgICAgICAgICAgICAgICAgICAgIGNoYXJ0Q29uZmlnOiAiPSIKKyAgICAgICAgICAgICAgICAgICAgfSwKKyAgICAgICAgICAgICAgICAgICAgdGVtcGxhdGVVcmw6ICJ0ZW1wbGF0ZS9zdGFja2VkQmFyY2hhcnQvc3RhY2tlZEJhcmNoYXJ0Lmh0bWwiLAorICAgICAgICAgICAgICAgICAgICByZXBsYWNlOiB0cnVlLAorICAgICAgICAgICAgICAgICAgICBjb250cm9sbGVyOiBbJyRzY29wZScsICckYXR0cnMnLCBmdW5jdGlvbiAoJHNjb3BlLCAkYXR0cnMpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoYW5ndWxhci5pc0RlZmluZWQoJHNjb3BlLmNoYXJ0Q29uZmlnKSkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzdGFja0JhckNoYXJ0Q29uZmlnID0gJGV4dGVuZE9iai5leHRlbmREZWVwKHN0YWNrQmFyQ2hhcnRDb25maWcsICRzY29wZS5jaGFydENvbmZpZyk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICRzY29wZS5jaGFydElEID0gJGF0dHJzLmlkOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICRzY29wZS5sZWdlbmRDb2xvcnMgPSBzdGFja0JhckNoYXJ0Q29uZmlnLmNoYXJ0Y29sb3I7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgJHNjb3BlLmFkZExlZ2VuZENvbG9yID0gZnVuY3Rpb24gKGlkKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhciBiZ0NvbG9yID0gbnVsbDsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYmdDb2xvciA9IHsiYmFja2dyb3VuZC1jb2xvciI6ICRzY29wZS5sZWdlbmRDb2xvcnNbaWRdfTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGJnQ29sb3I7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgfTsKKyAgICAgICAgICAgICAgICAgICAgICAgIH1dLAorICAgICAgICAgICAgICAgICAgICBsaW5rOiBmdW5jdGlvbiAoc2NvcGUsIGVsZW1lbnQsIGF0dHJzLCBjdHJsKSB7CisgICAgICAgICAgICAgICAgICAgICAgICBzY29wZS50b29sdGlwRmxhZyA9IGZhbHNlOworICAgICAgICAgICAgICAgICAgICAgICAgdmFyIGRhdGFPYmosIGlkeCA9IDAsIHhBeGlzVGlja3MsIG1hcmdpbiA9IHN0YWNrQmFyQ2hhcnRDb25maWcubWFyZ2luLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB3aWR0aCA9IHBhcnNlSW50KGF0dHJzLmNoYXJ0V2lkdGgsIDEwKSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaGVpZ2h0ID0gcGFyc2VJbnQoc3RhY2tCYXJDaGFydENvbmZpZy5jaGFydEhlaWdodCwgMTApLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwYWRkaW5nID0gMjAsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBhcnNlRGF0ZSA9IGQzLnRpbWUuZm9ybWF0KCIlZC0lYi0lWSIpLnBhcnNlLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0b29sdGlwRm9ybWF0ID0gZDMudGltZS5mb3JtYXQoIiVCLSVZIiksCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxhYmVsRm9ybWF0ID0gZDMudGltZS5mb3JtYXQoIiVZIik7CisgICAgICAgICAgICAgICAgICAgICAgICBhdHRycy4kb2JzZXJ2ZSgnbGVnZW5kUmVxdWlyZWQnLCBmdW5jdGlvbiAodmFsKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHZhbCA9PT0gJ3RydWUnKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNjb3BlLnNob3dMZWdlbmQgPSB0cnVlOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBlbHNlIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2NvcGUuc2hvd0xlZ2VuZCA9IGZhbHNlOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgIH0pOworICAgICAgICAgICAgICAgICAgICAgICAgc2NvcGUuJHdhdGNoKCdyZWZyZXNoQ2hhcnQnLCBmdW5jdGlvbiAodmFsdWUpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAodmFsdWUgPT09IGZhbHNlKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybjsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CisKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoYW5ndWxhci5pc0RlZmluZWQoc2NvcGUuY2hhcnRDb25maWcpKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHN0YWNrQmFyQ2hhcnRDb25maWcgPSAkZXh0ZW5kT2JqLmV4dGVuZERlZXAoc3RhY2tCYXJDaGFydENvbmZpZywgc2NvcGUuY2hhcnRDb25maWcpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KKworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGQzLnNlbGVjdCgic3ZnIyIgKyBhdHRycy5pZCkucmVtb3ZlKCk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgZDMuc2VsZWN0QWxsKCJzdmcjIiArIGF0dHJzLmlkICsgIiA+ICoiKS5yZW1vdmUoKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBkMy5zZWxlY3RBbGwoImRpdiNzdGFja0JhckNoYXJ0Q29udGFpbmVyIiArICIgPiBkaXYiKS5yZW1vdmUoKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoc2NvcGUuY2hhcnREYXRhWzBdLnZhbHVlcy5sZW5ndGggPT09IDApIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2NvcGUucmVmcmVzaENoYXJ0ID0gZmFsc2U7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybjsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CisKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YXIgeE1vbnRoID0gW10sIHlEb21haW5EYXRhID0gW10sIHlBeGlzRGF0YSA9IFtdLCB5VmFsdWUgPSBbXSwgdGVtcERhdGEgPSBbXSwgdG9vbHRpcERhdGEgPSB7fSwgeWVhckFyciA9IHt9LCBpc1NpbmdsZU1vbnRoID0gZmFsc2U7CisKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAvL1gtQXhpcyBSYW5nZSAgICAgICAgCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFyIHhSYW5nZSA9IGQzLnRpbWUuc2NhbGUoKS5yYW5nZShbcGFkZGluZywgd2lkdGggLSBwYWRkaW5nICogMl0pOworCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgLy9ZLUF4aXMgUmFuZ2UgCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFyIHlSYW5nZSA9IGQzLnNjYWxlLmxpbmVhcigpLnJhbmdlKFtoZWlnaHQgLSBwYWRkaW5nLCBwYWRkaW5nXSk7CisKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBkYXRhT2JqID0gc2NvcGUuY2hhcnREYXRhOworCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgZGF0YU9iai5mb3JFYWNoKGZ1bmN0aW9uIChkYXRhKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhciBvYmogPSBkYXRhLnZhbHVlczsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgeEF4aXNUaWNrcyA9IG9iai5sZW5ndGg7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChvYmoubGVuZ3RoID09IDEpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlzU2luZ2xlTW9udGggPSB0cnVlOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG9iai5mb3JFYWNoKGZ1bmN0aW9uIChkKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YXIgdG1wID0gIjAxLSIgKyBkLm1vbnRoOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZC5udW1lcmljTW9udGggPSBwYXJzZURhdGUodG1wKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHlWYWx1ZS5wdXNoKHsndmFsdWUnOiArZC52YWx1ZX0pOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZC52YWx1ZSA9ICtkLnZhbHVlOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgeE1vbnRoLnB1c2goeydudW1lcmljTW9udGgnOiBkLm51bWVyaWNNb250aH0pOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9KTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB9KTsKKworICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vVG9vbFRpcCBEYXRhCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgZm9yICh2YXIgeiA9IDA7IHogPCBkYXRhT2JqLmxlbmd0aDsgeisrKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhciB0ZW1wU2VyaWVzID0gZGF0YU9ialt6XS5zZXJpZXM7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZvciAodmFyIGogPSAwOyBqIDwgZGF0YU9ialt6XS52YWx1ZXMubGVuZ3RoOyBqKyspIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhciBtb250aHMgPSBkYXRhT2JqW3pdLnZhbHVlc1tqXS5tb250aDsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhciB0ZW1wVmFsID0gZGF0YU9ialt6XS52YWx1ZXNbal0udmFsdWU7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YXIgcGVyY2VudCA9IGRhdGFPYmpbel0udmFsdWVzW2pdLnBlcmNlbnQ7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0ZW1wRGF0YS5wdXNoKHsibW9udGgiOiBtb250aHMsICJzZXJpZXMiOiB0ZW1wU2VyaWVzLCAidmFsdWUiOiB0ZW1wVmFsLCAicGVyY2VudCI6IHBlcmNlbnR9KTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KKworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZvciAodmFyIGsgPSAwOyBrIDwgdGVtcERhdGEubGVuZ3RoOyBrKyspIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFyIHNlcmllc05hbWUgPSB0ZW1wRGF0YVtrXS5zZXJpZXM7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhciBzZXJpZXNWYWwgPSB0ZW1wRGF0YVtrXS52YWx1ZTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFyIHNlcmllc1BlciA9IHRlbXBEYXRhW2tdLnBlcmNlbnQ7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhciB0ZW1wT2JqID0gdG9vbHRpcERhdGFbdGVtcERhdGFba10ubW9udGhdOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoISh0ZW1wT2JqKSkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdGVtcE9iaiA9IFtdOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdG9vbHRpcERhdGFbdGVtcERhdGFba10ubW9udGhdID0gdGVtcE9iajsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRvb2x0aXBEYXRhW3RlbXBEYXRhW2tdLm1vbnRoXVsnc2VyaWVzUGVyJ10gPSBzZXJpZXNQZXI7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdGVtcE9iai5wdXNoKHtzZXJpZXNOYW1lOiBzZXJpZXNOYW1lLCBzZXJpZXNWYWw6IHNlcmllc1ZhbH0pOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KKworICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vWC1BeGlzIERvbWFpbiAgCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgeFJhbmdlLmRvbWFpbihkMy5leHRlbnQoeE1vbnRoLCBmdW5jdGlvbiAoZCkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gZC5udW1lcmljTW9udGg7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSkpOworCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgZm9yICh2YXIgYiA9IDA7IGIgPCB0ZW1wRGF0YS5sZW5ndGg7IGIrKykgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YXIgdmFsID0gTWF0aC5yb3VuZChwYXJzZUludCh0ZW1wRGF0YVtiXS52YWx1ZSwgMTApIC8gc3RhY2tCYXJDaGFydENvbmZpZy55QXhpc01heFRpY2tzKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFyIENhbGMgPSBNYXRoLmNlaWwoKHZhbCAvIE1hdGgucG93KDEwLCAoIiIgKyB2YWwpLmxlbmd0aCAtIDEpKSkgKiAoc3RhY2tCYXJDaGFydENvbmZpZy55QXhpc01heFRpY2tzKSAqIE1hdGgucG93KDEwLCAoIiIgKyB2YWwpLmxlbmd0aCAtIDEpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB5RG9tYWluRGF0YS5wdXNoKHsneUF4aXNWYWwnOiBDYWxjfSk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQorCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgLy9ZLUF4aXMgRG9tYWluCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgeVJhbmdlLmRvbWFpbihbMCwgZDMubWF4KHlEb21haW5EYXRhLCBmdW5jdGlvbiAoZCkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIChkLnlBeGlzVmFsKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSldKTsKKworICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhciB5VGljayA9IGQzLm1heCh5RG9tYWluRGF0YSwgZnVuY3Rpb24gKGQpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGQueUF4aXNWYWw7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSk7CisKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB5VGljayA9IHlUaWNrIC8gc3RhY2tCYXJDaGFydENvbmZpZy55QXhpc01heFRpY2tzOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZvciAodmFyIHggPSAwOyB4IDw9IHN0YWNrQmFyQ2hhcnRDb25maWcueUF4aXNNYXhUaWNrczsgeCsrKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHlBeGlzRGF0YS5wdXNoKHlUaWNrICogeCk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQorCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFyIGZvcm1hdE1vbmV5ID0gZnVuY3Rpb24gKGQpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGQgPj0gc3RhY2tCYXJDaGFydENvbmZpZy5hbW91bnRNRGl2aXNpb24pIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBkIC8gc3RhY2tCYXJDaGFydENvbmZpZy5hbW91bnRNRGl2aXNpb24gKyBzdGFja0JhckNoYXJ0Q29uZmlnLmFtb3VudE1UZXh0OworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKGQgPj0gc3RhY2tCYXJDaGFydENvbmZpZy5hbW91bnRLRGl2aXNpb24pIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBkIC8gc3RhY2tCYXJDaGFydENvbmZpZy5hbW91bnRLRGl2aXNpb24gKyBzdGFja0JhckNoYXJ0Q29uZmlnLmFtb3VudEtUZXh0OworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGQ7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB9OworICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhciB4QXhpcyA9IGQzLnN2Zy5heGlzKCkuc2NhbGUoeFJhbmdlKS5vcmllbnQoImJvdHRvbSIpLnRpY2tGb3JtYXQoZDMudGltZS5mb3JtYXQoJyViJykpLnRpY2tzKGQzLnRpbWUubW9udGhzKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YXIgeEF4aXNHcmlkID0gZDMuc3ZnLmF4aXMoKS5zY2FsZSh4UmFuZ2UpLm9yaWVudCgidG9wIikudGlja3MoZDMudGltZS5tb250aHMpLnRpY2tGb3JtYXQoJycpLnRpY2tTaXplKC1oZWlnaHQgKyAyICogcGFkZGluZywgMCk7CisKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YXIgeUF4aXMgPSBkMy5zdmcuYXhpcygpLnNjYWxlKHlSYW5nZSkub3JpZW50KCJsZWZ0IikudGlja1ZhbHVlcyh5QXhpc0RhdGEpLnRpY2tzKHN0YWNrQmFyQ2hhcnRDb25maWcueUF4aXNNYXhUaWNrcykudGlja0Zvcm1hdChmb3JtYXRNb25leSk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFyIHlBeGlzR3JpZCA9IGQzLnN2Zy5heGlzKCkuc2NhbGUoeVJhbmdlKS5vcmllbnQoImxlZnQiKS50aWNrVmFsdWVzKHlBeGlzRGF0YSkudGlja3Moc3RhY2tCYXJDaGFydENvbmZpZy55QXhpc01heFRpY2tzKS50aWNrU2l6ZSgtd2lkdGgsIDAsIDApOworCisKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAvL0NhbGN1bGF0ZSB2YWx1ZXMgZm9yIFN0YWNrCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFyIHN0YWNrID0gZDMubGF5b3V0LnN0YWNrKCkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC52YWx1ZXMoZnVuY3Rpb24gKGQpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gZC52YWx1ZXM7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9KQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLngoZnVuY3Rpb24gKGQpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gZC5udW1lcmljTW9udGg7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9KQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLnkoZnVuY3Rpb24gKGQpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gZC52YWx1ZTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0pOworCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgLy9QbG90IENoYXJ0CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFyIGRyYXdCYXJDaGFydCA9IGQzLnNlbGVjdCgiI3N0YWNrQmFyQ2hhcnRDb250YWluZXIiKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLmFwcGVuZCgic3ZnIikKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC5hdHRyKCJpZCIsIGF0dHJzLmlkKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLmRhdGEoZGF0YU9iaikKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC5hdHRyKCJ3aWR0aCIsIHdpZHRoICsgbWFyZ2luLmxlZnQgKyBtYXJnaW4ucmlnaHQpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAuYXR0cigiaGVpZ2h0IiwgcGFyc2VJbnQoaGVpZ2h0LCAxMCkgKyBwYXJzZUludChtYXJnaW4udG9wLCAxMCkgKyBwYXJzZUludChtYXJnaW4uYm90dG9tLCAxMCkpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAuYXBwZW5kKCJnIikKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC5hdHRyKCJ0cmFuc2Zvcm0iLCAidHJhbnNsYXRlKCIgKyBtYXJnaW4ubGVmdCArICIsIiArIG1hcmdpbi50b3AgKyAiKSIpOworCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgLy9EcmF3IFggQXhpcyAgICAgICAgCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgZHJhd0JhckNoYXJ0LmFwcGVuZCgiZyIpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAuYXR0cigiY2xhc3MiLCAieCBheGlzIikKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC5hdHRyKCJ0cmFuc2Zvcm0iLCAidHJhbnNsYXRlKDAsIiArIChoZWlnaHQgLSBwYWRkaW5nKSArICIpIikKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC5jYWxsKHhBeGlzKTsKKworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChpc1NpbmdsZU1vbnRoKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRyYXdCYXJDaGFydC5zZWxlY3QoIi54Iikuc2VsZWN0KCIudGljayIpLmF0dHIoInRyYW5zZm9ybSIsICJ0cmFuc2xhdGUoIiArIChpc1NpbmdsZU1vbnRoID09PSB0cnVlKSAqICh3aWR0aCAvIDIgKyAyMCkgKyAiLDApIik7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQorCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgLy9EcmF3IFkgR3JpZCBMaW5lcworICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhciB5R3JpZCA9IGRyYXdCYXJDaGFydC5hcHBlbmQoImciKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLmF0dHIoImNsYXNzIiwgImdyaWQiKS5hdHRyKCJpZCIsICJzdGFja0JhcllHcmlkIikKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC5hdHRyKCJ0cmFuc2Zvcm0iLCAidHJhbnNsYXRlKDAsMCkiKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLmNhbGwoeUF4aXNHcmlkKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB5R3JpZC5zZWxlY3RBbGwoImxpbmUiKS5zdHlsZSgic3Ryb2tlIiwgc3RhY2tCYXJDaGFydENvbmZpZy5ncmlkTGluZUNvbG9yKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB5R3JpZC5zZWxlY3RBbGwoInRleHQiKS5yZW1vdmUoKTsKKworICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vUGxvdCBCYXJzIGZvciBtdWx0aXBsZSBTdGFja3MKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YXIgYmFyR3JvdXAgPSBkcmF3QmFyQ2hhcnQuc2VsZWN0QWxsKCIuZ3JvdXAiKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLmRhdGEoc3RhY2soZGF0YU9iaikpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAuZW50ZXIoKS5hcHBlbmQoImciKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLmF0dHIoImNsYXNzIiwgImdyb3VwIikuYXR0cigiaWQiLCBmdW5jdGlvbiAoZCwgaSkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gKCJzdGFja0JhciIgKyBpKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB9KQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLmF0dHIoInRyYW5zZm9ybSIsICJ0cmFuc2xhdGUoIiArIChpc1NpbmdsZU1vbnRoID09PSB0cnVlKSAqIHdpZHRoIC8gMiArICIsMCkiKTsKKworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJhckdyb3VwLmFwcGVuZCgidGl0bGUiKS50ZXh0KGZ1bmN0aW9uIChkKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBkLnNlcmllczsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB9KTsKKworICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhciBiYXJzID0gYmFyR3JvdXAuc2VsZWN0QWxsKCJyZWN0IikKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC5kYXRhKGZ1bmN0aW9uIChkKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGQudmFsdWVzOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC5lbnRlcigpLmFwcGVuZCgicmVjdCIpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAuYXR0cigiY2xhc3MiLCAiYmFyIikKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC5hdHRyKCJ4IiwgZnVuY3Rpb24gKGQpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gKHhSYW5nZShkLm51bWVyaWNNb250aCkgLSAxMCk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9KQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLmF0dHIoInkiLCBmdW5jdGlvbiAoZCkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiB5UmFuZ2UoZC52YWx1ZSk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9KQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLmF0dHIoIndpZHRoIiwgIjIwIikKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC5hdHRyKCJoZWlnaHQiLCBmdW5jdGlvbiAoZCkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiAoKGhlaWdodCAtIHlSYW5nZShkLnZhbHVlKSkgLSBwYWRkaW5nKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0pLm9uKCJtb3VzZW92ZXIiLCBmdW5jdGlvbiAoZCkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YXIgb2Zmc2V0WCA9IGQzLnNlbGVjdCh0aGlzKS5hdHRyKCJ4Iik7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhciBvZmZzZXRZID0gZDMuc2VsZWN0KHRoaXMpLmF0dHIoInkiKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2hvd190b29sdGlwX2dyaWRfbGluZShvZmZzZXRYLCAieCIpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBkcmF3QmFyQ2hhcnQuc2VsZWN0QWxsKCIuYmFyIikuc3R5bGUoImZpbGwtb3BhY2l0eSIsIHN0YWNrQmFyQ2hhcnRDb25maWcuY2hhcnRPcGFjaXR5KTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZDMuc2VsZWN0KHRoaXMpLnN0eWxlKCJmaWxsLW9wYWNpdHkiLCAiMSIpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBtb3VzZU92ZXIoZCwgb2Zmc2V0WCwgb2Zmc2V0WSk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSkub24oIm1vdXNlb3V0IiwgZnVuY3Rpb24gKCkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBoaWRlX3Rvb2x0aXBfZ3JpZF9saW5lKGQzLnNlbGVjdCh0aGlzKS5hdHRyKCJ4IiksICJ4Iik7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNjb3BlLnRvb2x0aXBGbGFnID0gZmFsc2U7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRyYXdCYXJDaGFydC5zZWxlY3RBbGwoIi5iYXIiKS5zdHlsZSgiZmlsbC1vcGFjaXR5IiwgIjEiKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2NvcGUuJGFwcGx5KCk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSk7CisKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBiYXJzLmFwcGVuZCgnZGVzYycpLmFwcGVuZCgndGl0bGUnKS50ZXh0KGZ1bmN0aW9uIChkKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhciBudmRhT2JqID0gdG9vbHRpcERhdGFbZC5tb250aF07CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiAoYWRkVGl0bGUobnZkYU9iaiwgZCkpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0pOworCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgLy9GaWxsIGNvbG9yIGluIEJhcnMKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBmb3IgKHZhciBhID0gMDsgYSA8IGRhdGFPYmoubGVuZ3RoOyBhKyspIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFyIHJlY3RCYXJzID0gZHJhd0JhckNoYXJ0LnNlbGVjdCgnI3N0YWNrQmFyJyArIGEpLnNlbGVjdEFsbCgncmVjdCcpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZWN0QmFycy5hdHRyKCdmaWxsJywgc2NvcGUubGVnZW5kQ29sb3JzW2FdKS5hdHRyKCJmaWxsLW9wYWNpdHkiLCAiMSIpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KKworICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vIERyYXcgdGhlIHggR3JpZCBsaW5lcworICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhciB4R3JpZCA9IGRyYXdCYXJDaGFydC5hcHBlbmQoImciKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLmF0dHIoImNsYXNzIiwgImdyaWQiKS5hdHRyKCJpZCIsICJzdGFja0JhclhHcmlkIikKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC5hdHRyKCJ0cmFuc2Zvcm0iLCAidHJhbnNsYXRlKCIgKyAoaXNTaW5nbGVNb250aCA9PT0gdHJ1ZSkgKiB3aWR0aCAvIDIgKyAiLDApIikKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC5jYWxsKHhBeGlzR3JpZCk7CisKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB4R3JpZC5zZWxlY3RBbGwoImxpbmUiKS5hdHRyKCJ0cmFuc2Zvcm0iLCAidHJhbnNsYXRlKCIgKyAtTWF0aC5jZWlsKCh4UmFuZ2UoMikgLSB4UmFuZ2UoMSkpIC8gMikgKyAiLCIgKyBwYWRkaW5nICsgIikiKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLmF0dHIoImlkIiwgZnVuY3Rpb24gKGQsIGkpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gKCJ4R3JpZExpbmUiICsgaSk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9KTsKKworICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vRHJhdyBkdWFsIFkgYXhpcyBvbiBjaGFuZ2Ugb2YgWWVhcgorICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhciB5QXhpc09iaiA9IGRhdGFPYmpbMF0udmFsdWVzLCB5QXhpc0lkeCA9IDA7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgZm9yICh2YXIgaSA9IDA7IGkgPCB5QXhpc09iai5sZW5ndGg7IGkrKykgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YXIgdG1wT2JqID0gW107CisKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdG1wT2JqLnB1c2goeyJ5ZWFyIjogbGFiZWxGb3JtYXQoeUF4aXNPYmpbaV0ubnVtZXJpY01vbnRoKSwgInRyYW5zZm9ybSI6IHhSYW5nZSh5QXhpc09ialtpXS5udW1lcmljTW9udGgpfSk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICgheWVhckFycltsYWJlbEZvcm1hdCh5QXhpc09ialtpXS5udW1lcmljTW9udGgpXSkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgeWVhckFycltsYWJlbEZvcm1hdCh5QXhpc09ialtpXS5udW1lcmljTW9udGgpXSA9IHRtcE9iajsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBmb3IgKHZhciBrZXkgaW4geWVhckFycikgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YXIgb2JqID0geWVhckFycltrZXldOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YXIgeUF4aXNOb2RlcyA9IGRyYXdCYXJDaGFydC5hcHBlbmQoImciKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC5hdHRyKCJjbGFzcyIsICJ5IGF4aXMiKS5hdHRyKCJpZCIsIHlBeGlzSWQoeUF4aXNJZHgpKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC5hdHRyKCJ0cmFuc2Zvcm0iLCAidHJhbnNsYXRlKCIgKyAob2JqWzBdLnRyYW5zZm9ybSAtIHBhZGRpbmcpICsgIiwwKSIpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLmNhbGwoeUF4aXMpOworCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHlBeGlzTm9kZXMuc2VsZWN0QWxsKCJ0ZXh0IikuYXR0cignY2xhc3MnLCAndGlja3RleHQnKTsKKworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvL0FwcGVuZCBZZWFyIExhYmVsIAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB5QXhpc05vZGVzLmFwcGVuZCgidGV4dCIpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLmF0dHIoInRyYW5zZm9ybSIsICJyb3RhdGUoMCkiKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC5hdHRyKCJ5Iiwgc3RhY2tCYXJDaGFydENvbmZpZy55ZWFyTGFiZWxQb3MueSkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAuYXR0cigieCIsIHN0YWNrQmFyQ2hhcnRDb25maWcueWVhckxhYmVsUG9zLngpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLnRleHQob2JqWzBdLnllYXIpLmF0dHIoImNsYXNzIiwgInllYXJMYWJlbCIpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB5QXhpc0lkeCsrOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KKworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZ1bmN0aW9uIHlBeGlzSWQoeUF4aXNJZHgpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuICgieUF4aXMiICsgeUF4aXNJZHgpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KKworICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vZnVuY3Rpb24gdG8gc2VsZWN0IGZpcnN0IGVsZW1lbnQKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBkMy5zZWxlY3Rpb24ucHJvdG90eXBlLmZpcnN0ID0gZnVuY3Rpb24gKCkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gZDMuc2VsZWN0KHRoaXNbMF1bMF0pOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIH07CisKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAvL1JlbW92ZSBtaW5pbXVtIHZhbHVlIGxhYmVsIGZvcm0gWSBBeGlzCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFyIHRpY2tMYWJlbHMgPSBkMy5zZWxlY3QoIiN5QXhpczAiKS5zZWxlY3RBbGwoJy50aWNrdGV4dCcpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vdGlja0xhYmVscy5maXJzdCgpLnJlbW92ZSgpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGQzLnNlbGVjdCgiI3lBeGlzMSIpLnNlbGVjdEFsbCgnLnRpY2t0ZXh0JykucmVtb3ZlKCk7CisKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAvL0FkZCB0aXRsZSBmb3IgTlZEQSBzY3JlZW4gcmVhZGVyCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgZnVuY3Rpb24gYWRkVGl0bGUobnZkYU9iaiwgZCkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YXIgdGVtcCA9ICIiOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBmb3IgKHZhciB5ID0gMDsgeSA8IG52ZGFPYmoubGVuZ3RoOyB5KyspIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRlbXAgPSB0ZW1wICsgbnZkYU9ialt5XS5zZXJpZXNOYW1lICsgbnZkYU9ialt5XS5zZXJpZXNWYWw7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuICh0b29sdGlwRm9ybWF0KGQubnVtZXJpY01vbnRoKSArICItLSIgKyB0ZW1wICsgIlJldGFpbmliaWxpdHkgUGVyY2VudGFnZSIgKyBudmRhT2JqLnNlcmllc1Blcik7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQorCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgLy9Nb3VzZU92ZXIgRXZlbnQKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBmdW5jdGlvbiBtb3VzZU92ZXIoZCwgb2Zmc2V0WCwgb2Zmc2V0WSkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBmb3IgKHZhciBrZXkgaW4gdG9vbHRpcERhdGEpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChrZXkgPT0gZC5tb250aCkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNjb3BlLnN0YWNrRGF0YVBvaW50ID0gdG9vbHRpcERhdGFba2V5XTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzY29wZS5tb250aFBvaW50ID0geyJ4RGF0YSI6IHRvb2x0aXBGb3JtYXQoZC5udW1lcmljTW9udGgpLnJlcGxhY2UoJy0nLCAnICcpfTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2NvcGUuJGFwcGx5KCk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICR0aW1lb3V0KGZ1bmN0aW9uICgpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG9mZnNldFkgPSBvZmZzZXRZIC0gc3RhY2tCYXJDaGFydENvbmZpZy50b29sdGlwVG9wTWFyZ2luOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFyIHRvb2x0aXBFbCA9IGVsZW1lbnQuY2hpbGRyZW4oKS5lcSgyKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhciB0b29sdGlwV2lkdGggPSB0b29sdGlwRWxbMF0ub2Zmc2V0V2lkdGg7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoaXNTaW5nbGVNb250aCkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG9mZnNldFggPSBvZmZzZXRYIC0gKHRvb2x0aXBXaWR0aCAvIDIpICsgc3RhY2tCYXJDaGFydENvbmZpZy50b29sdGlwTGVmdE1hcmdpbiArICh3aWR0aCAvIDIpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBvZmZzZXRYID0gb2Zmc2V0WCAtICh0b29sdGlwV2lkdGggLyAyKSArIHN0YWNrQmFyQ2hhcnRDb25maWcudG9vbHRpcExlZnRNYXJnaW47CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzY29wZS50b29sdGlwU3R5bGUgPSB7ImxlZnQiOiBvZmZzZXRYICsgInB4IiwgInRvcCI6IG9mZnNldFkgKyAicHgifTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNjb3BlLnRvb2x0aXBGbGFnID0gdHJ1ZTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSwgMCk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQorCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgLy9TaG93IEdyaWQgTGluZSBvbiBPdmVyCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgZnVuY3Rpb24gc2hvd190b29sdGlwX2dyaWRfbGluZShvZmZzZXRYLCBhdHRyKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhciBkYXRhTGVuZ3RoOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBkYXRhTGVuZ3RoID0gc2NvcGUuY2hhcnREYXRhWzBdLnZhbHVlcy5sZW5ndGg7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZvciAodmFyIGkgPSAwOyBpIDwgZGF0YUxlbmd0aDsgaSsrKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YXIgYmFyID0gZHJhd0JhckNoYXJ0LnNlbGVjdEFsbCgiLmJhciIpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGJhclswXVtpXS5nZXRBdHRyaWJ1dGUoYXR0cikgPT09IG9mZnNldFgpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBkcmF3QmFyQ2hhcnQuc2VsZWN0KCIjeEdyaWRMaW5lIiArIGkpLnN0eWxlKCJzdHJva2UiLCBzdGFja0JhckNoYXJ0Q29uZmlnLmdyaWRMaW5lQ29sb3IpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQorCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgLy9IaWRlIEdyaWQgTGluZQorICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZ1bmN0aW9uIGhpZGVfdG9vbHRpcF9ncmlkX2xpbmUob2Zmc2V0WCwgYXR0cikgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YXIgZGF0YUxlbmd0aDsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZGF0YUxlbmd0aCA9IHNjb3BlLmNoYXJ0RGF0YVswXS52YWx1ZXMubGVuZ3RoOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBmb3IgKHZhciBpID0gMDsgaSA8IGRhdGFMZW5ndGg7IGkrKykgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFyIGJhciA9IGRyYXdCYXJDaGFydC5zZWxlY3RBbGwoIi5iYXIiKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChiYXJbMF1baV0uZ2V0QXR0cmlidXRlKGF0dHIpID09PSBvZmZzZXRYKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZHJhd0JhckNoYXJ0LnNlbGVjdCgiI3hHcmlkTGluZSIgKyBpKS5zdHlsZSgic3Ryb2tlIiwgInRyYW5zcGFyZW50Iik7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2NvcGUucmVmcmVzaENoYXJ0ID0gZmFsc2U7CisgICAgICAgICAgICAgICAgICAgICAgICB9KTsKKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIH07CisgICAgICAgICAgICB9XSkKKyAgICAgICAgLmZpbHRlcignZmlsdGVySW5wdXQnLCBmdW5jdGlvbiAoKSB7CisgICAgICAgICAgICByZXR1cm4gZnVuY3Rpb24gKGlucHV0KSB7CisgICAgICAgICAgICAgICAgcmV0dXJuIGlucHV0LnJlcGxhY2UoLyArL2csICIiKS50b0xvd2VyQ2FzZSgpOworICAgICAgICAgICAgfTsKKyAgICAgICAgfSk7Cithbmd1bGFyLm1vZHVsZSgnYXR0LmNoYXJ0cy5zdGFja2VkYXJlYWNoYXJ0JywgWydhdHQuY2hhcnRzLnV0aWxpdGllcyddKQorICAgICAgICAuY29uc3RhbnQoInN0YWNrQ2hhcnRDb25maWciLAorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgImNoYXJ0Y29sb3IiOiBbIiM5OTY2RkYiLCAiI0U2OEEyRSIsICIjNEREQjREIl0sCisgICAgICAgICAgICAgICAgICAgICJncmlkTGluZUNvbG9yIjogIiM4MDgwODAiLAorICAgICAgICAgICAgICAgICAgICAibGluZUN1cnZlVHlwZSI6ICdsaW5lYXInLAorICAgICAgICAgICAgICAgICAgICAieUF4aXNNYXhUaWNrcyI6IDQsCisgICAgICAgICAgICAgICAgICAgICJjaGFydEhlaWdodCI6ICIyMDAiLAorICAgICAgICAgICAgICAgICAgICAic2hhcGVzIjogWydjaXJjbGUnLCAncmVjdCcsICd0cmlhbmdsZSddLAorICAgICAgICAgICAgICAgICAgICAic2hhcGVTaXplIjogWzMsIDUsIDZdLAorICAgICAgICAgICAgICAgICAgICAiY2hhcnRPcGFjaXR5IjogMC42LAorICAgICAgICAgICAgICAgICAgICAieWVhckxhYmVsUG9zIjogeyJ4IjogOCwgInkiOiAtNX0sCisgICAgICAgICAgICAgICAgICAgICJ0b29sdGlwVG9wTWFyZ2luIjogMTAwLAorICAgICAgICAgICAgICAgICAgICAidG9vbHRpcExlZnRNYXJnaW4iOiA0MiwKKyAgICAgICAgICAgICAgICAgICAgInlBeGlzVW5pdFJhbmdlIjogNTAwMDAwLAorICAgICAgICAgICAgICAgICAgICAibWFyZ2luIjogeworICAgICAgICAgICAgICAgICAgICAgICAgdG9wOiAzMCwKKyAgICAgICAgICAgICAgICAgICAgICAgIHJpZ2h0OiA4MCwKKyAgICAgICAgICAgICAgICAgICAgICAgIGJvdHRvbTogMzAsCisgICAgICAgICAgICAgICAgICAgICAgICBsZWZ0OiA1MgorICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgfSkKKyAgICAgICAgLmRpcmVjdGl2ZSgnc3RhY2tlZEFyZWFDaGFydCcsIFsnc3RhY2tDaGFydENvbmZpZycsJyRleHRlbmRPYmonLCckdGltZW91dCcsIGZ1bmN0aW9uIChzdGFja0NoYXJ0Q29uZmlnLCRleHRlbmRPYmosJHRpbWVvdXQpIHsKKyAgICAgICAgICAgICAgICByZXR1cm4geworICAgICAgICAgICAgICAgICAgICByZXN0cmljdDogJ0EnLAorICAgICAgICAgICAgICAgICAgICBzY29wZTogeworICAgICAgICAgICAgICAgICAgICAgICAgY2hhcnREYXRhOiAnPScsCisgICAgICAgICAgICAgICAgICAgICAgICBsZWdlbmRSZXF1aXJlZDogIj0iLAorICAgICAgICAgICAgICAgICAgICAgICAgcmVmcmVzaENoYXJ0OiAiPSIsCisgICAgICAgICAgICAgICAgICAgICAgICBjaGFydENvbmZpZzogIj0iCisgICAgICAgICAgICAgICAgICAgIH0sCisgICAgICAgICAgICAgICAgICAgIHRlbXBsYXRlVXJsOiAidGVtcGxhdGUvc3RhY2tlZGFyZWFjaGFydC9zdGFja2VkQXJlYUNoYXJ0Lmh0bWwiLAorICAgICAgICAgICAgICAgICAgICByZXBsYWNlOiB0cnVlLAorICAgICAgICAgICAgICAgICAgICBjb250cm9sbGVyOiBbJyRzY29wZScsICckYXR0cnMnLCBmdW5jdGlvbiAoJHNjb3BlLCAkYXR0cnMpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YXIgZXh0ZW5kRGVlcCA9IGZ1bmN0aW9uIGV4dGVuZERlZXAoZHN0KSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBhbmd1bGFyLmZvckVhY2goYXJndW1lbnRzLCBmdW5jdGlvbihvYmopIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKG9iaiAhPT0gZHN0KSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYW5ndWxhci5mb3JFYWNoKG9iaiwgZnVuY3Rpb24odmFsdWUsIGtleSkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGRzdFtrZXldICYmIGRzdFtrZXldLmNvbnN0cnVjdG9yICYmIGRzdFtrZXldLmNvbnN0cnVjdG9yID09PSBPYmplY3QpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZXh0ZW5kRGVlcChkc3Rba2V5XSwgdmFsdWUpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZHN0W2tleV0gPSB2YWx1ZTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0gICAgIAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0pOyAgIAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9KTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBkc3Q7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgfTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoYW5ndWxhci5pc0RlZmluZWQoJHNjb3BlLmNoYXJ0Q29uZmlnKSkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzdGFja0NoYXJ0Q29uZmlnID0gJGV4dGVuZE9iai5leHRlbmREZWVwKHN0YWNrQ2hhcnRDb25maWcsICRzY29wZS5jaGFydENvbmZpZyk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICRzY29wZS5jaGFydElEID0gJGF0dHJzLmlkOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICRzY29wZS5sZWdlbmRDb2xvcnMgPSBzdGFja0NoYXJ0Q29uZmlnLmNoYXJ0Y29sb3I7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgJHNjb3BlLmxlZ2VuZFRvb2x0aXBDb2xvcnMgPSBhbmd1bGFyLmNvcHkoc3RhY2tDaGFydENvbmZpZy5jaGFydGNvbG9yKS5yZXZlcnNlKCk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgJHNjb3BlLmFkZExlZ2VuZENvbG9yID0gZnVuY3Rpb24gKGlkKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhciBiZ0NvbG9yID0gbnVsbDsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc3dpdGNoIChpZCkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY2FzZSAwOgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJnQ29sb3IgPSB7ImJhY2tncm91bmQtY29sb3IiOiAkc2NvcGUubGVnZW5kQ29sb3JzW2lkXSwgImJvcmRlci1yYWRpdXMiOiAiMTAwJSJ9OworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY2FzZSAxOgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJnQ29sb3IgPSB7ImJhY2tncm91bmQtY29sb3IiOiAkc2NvcGUubGVnZW5kQ29sb3JzW2lkXX07CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjYXNlIDI6CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYmdDb2xvciA9IHsid2lkdGgiOiAiMCIsICJoZWlnaHQiOiAiMCIsICJib3JkZXItbGVmdCI6ICI4cHggc29saWQgdHJhbnNwYXJlbnQiLCAiYm9yZGVyLXJpZ2h0IjogIjhweCBzb2xpZCB0cmFuc3BhcmVudCIsICJib3JkZXItYm90dG9tLXN0eWxlIjogInNvbGlkIiwgImJvcmRlci1ib3R0b20td2lkdGgiOiAiOHB4IiwgImJvcmRlci1ib3R0b20tY29sb3IiOiAkc2NvcGUubGVnZW5kQ29sb3JzW2lkXX07CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGJnQ29sb3I7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgfTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAkc2NvcGUuYWRkVG9vbFRpcExlZ2VuZENvbG9yID0gZnVuY3Rpb24gKGlkKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhciBiZ0NvbG9yID0gbnVsbDsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc3dpdGNoIChpZCkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY2FzZSAyOgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJnQ29sb3IgPSB7ImJhY2tncm91bmQtY29sb3IiOiAkc2NvcGUubGVnZW5kVG9vbHRpcENvbG9yc1tpZF0sICJib3JkZXItcmFkaXVzIjogIjEwMCUifTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNhc2UgMToKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBiZ0NvbG9yID0geyJiYWNrZ3JvdW5kLWNvbG9yIjogJHNjb3BlLmxlZ2VuZFRvb2x0aXBDb2xvcnNbaWRdfTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNhc2UgMDoKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBiZ0NvbG9yID0geyJ3aWR0aCI6ICIwIiwgImhlaWdodCI6ICIwIiwgImJvcmRlci1sZWZ0IjogIjZweCBzb2xpZCB0cmFuc3BhcmVudCIsICJib3JkZXItcmlnaHQiOiAiNnB4IHNvbGlkIHRyYW5zcGFyZW50IiwgImJvcmRlci1ib3R0b20tc3R5bGUiOiAic29saWQiLCAiYm9yZGVyLWJvdHRvbS13aWR0aCI6ICIxMnB4IiwgImJvcmRlci1ib3R0b20tY29sb3IiOiAkc2NvcGUubGVnZW5kVG9vbHRpcENvbG9yc1tpZF19OworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBiZ0NvbG9yOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIH07CisgICAgICAgICAgICAgICAgICAgICAgICB9XSwKKyAgICAgICAgICAgICAgICAgICAgbGluazogZnVuY3Rpb24gKHNjb3BlLCBlbGVtZW50LCBhdHRycywgY3RybCkgeworICAgICAgICAgICAgICAgICAgICAgICAgc2NvcGUudG9vbHRpcEZsYWcgPSBmYWxzZTsKKyAgICAgICAgICAgICAgICAgICAgICAgIHZhciBkYXRhT2JqLCBpZHggPSAwLCB4QXhpc1RpY2tzLCBtYXJnaW4gPSBzdGFja0NoYXJ0Q29uZmlnLm1hcmdpbiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgd2lkdGggPSBwYXJzZUludChhdHRycy5jaGFydFdpZHRoLCAxMCksCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGhlaWdodCA9IHN0YWNrQ2hhcnRDb25maWcuY2hhcnRIZWlnaHQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBhcnNlRGF0ZSA9IGQzLnRpbWUuZm9ybWF0KCIlZC0lYi0lWSIpLnBhcnNlLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0b29sdGlwRm9ybWF0ID0gZDMudGltZS5mb3JtYXQoIiVCLSVZIiksCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxhYmVsRm9ybWF0ID0gZDMudGltZS5mb3JtYXQoIiVZIik7CisgICAgICAgICAgICAgICAgICAgICAgICBhdHRycy4kb2JzZXJ2ZSgnbGVnZW5kUmVxdWlyZWQnLCBmdW5jdGlvbiAodmFsKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHZhbCA9PT0gJ3RydWUnKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNjb3BlLnNob3dMZWdlbmQgPSB0cnVlOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBlbHNlIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2NvcGUuc2hvd0xlZ2VuZCA9IGZhbHNlOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgIH0pOworICAgICAgICAgICAgICAgICAgICAgICAgc2NvcGUuJHdhdGNoKCdyZWZyZXNoQ2hhcnQnLCBmdW5jdGlvbiAodmFsdWUpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAodmFsdWUgPT09IGZhbHNlKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybjsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGFuZ3VsYXIuaXNEZWZpbmVkKHNjb3BlLmNoYXJ0Q29uZmlnKSkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzdGFja0NoYXJ0Q29uZmlnID0gJGV4dGVuZE9iai5leHRlbmREZWVwKHN0YWNrQ2hhcnRDb25maWcsIHNjb3BlLmNoYXJ0Q29uZmlnKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgZDMuc2VsZWN0KCJzdmcjIiArIGF0dHJzLmlkKS5yZW1vdmUoKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBkMy5zZWxlY3RBbGwoInN2ZyMiICsgYXR0cnMuaWQgKyAiID4gKiIpLnJlbW92ZSgpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGQzLnNlbGVjdEFsbCgiZGl2I3N0YWNrQ2hhcnRDb250YWluZXIiICsgIiA+IGRpdiIpLnJlbW92ZSgpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChzY29wZS5jaGFydERhdGFbMF0udmFsdWVzLmxlbmd0aCA9PT0gMCkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzY29wZS5yZWZyZXNoQ2hhcnQgPSBmYWxzZTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KKworICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhciB4TW9udGggPSBbXSwgeVZhbHVlID0gW10sIHRlbXBEYXRhID0gW10sIHRvb2x0aXBEYXRhID0ge30sIHllYXJBcnIgPSB7fSwgeWVhckxhYmVsID0gJycsIGlzU2luZ2xlTW9udGggPSBmYWxzZSwgc2luZ2xlTW9udGhOYW1lLCBjdXJyZW5jeUZvcm1hdCA9ICdLJzsKKworICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vWC1BeGlzIFJhbmdlICAgICAgICAKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YXIgeFJhbmdlID0gZDMudGltZS5zY2FsZSgpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAucmFuZ2UoWzAsIHdpZHRoXSk7CisKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAvL1ktQXhpcyBSYW5nZSAKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YXIgeVJhbmdlID0gZDMuc2NhbGUubGluZWFyKCkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC5yYW5nZShbaGVpZ2h0LCAwXSk7CisKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBkYXRhT2JqID0gc2NvcGUuY2hhcnREYXRhOworCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gIE9uIHNlbGVjdGluZyBzYW1lIG1vbnRoIGluIEZyb20gYW5kIFRvIGRyb3Bkb3ducywgVXNlciBzaG91bGQgYmUgZ2V0dGluZyBncmFwaCAgICAgICAgICAgICAgICAgICAgICAgICAgICAKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoZGF0YU9ialswXS52YWx1ZXMubGVuZ3RoID09PSAxKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlzU2luZ2xlTW9udGggPSB0cnVlOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBkYXRhT2JqLmZvckVhY2goZnVuY3Rpb24gKGRhdGEpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhciB0bXAxID0gIjAxLSIgKyBkYXRhLnZhbHVlc1swXS5tb250aDsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhciB0bXAgPSBwYXJzZURhdGUodG1wMSk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzaW5nbGVNb250aE5hbWUgPSB0bXAudG9TdHJpbmcoKS5zcGxpdCgiICIpWzFdOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdG1wLnNldE1vbnRoKHRtcC5nZXRNb250aCgpICsgMSk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YXIgbmV4dE1vbnRoID0gdG1wLnRvU3RyaW5nKCkuc3BsaXQoIiAiKVsxXSArICItIiArIHRtcC5nZXRGdWxsWWVhcigpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZGF0YS52YWx1ZXMucHVzaCh7bW9udGg6IG5leHRNb250aCwgdmFsdWU6IGRhdGEudmFsdWVzWzBdLnZhbHVlfSk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0pOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KKworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRhdGFPYmouZm9yRWFjaChmdW5jdGlvbiAoZGF0YSkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YXIgb2JqID0gZGF0YS52YWx1ZXM7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHhBeGlzVGlja3MgPSBvYmoubGVuZ3RoOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBvYmouZm9yRWFjaChmdW5jdGlvbiAoZCkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFyIHRtcCA9ICIwMS0iICsgZC5tb250aDsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGQubnVtZXJpY01vbnRoID0gcGFyc2VEYXRlKHRtcCk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB5VmFsdWUucHVzaCh7J3ZhbHVlJzogK2QudmFsdWV9KTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGQudmFsdWUgPSArZC52YWx1ZTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHhNb250aC5wdXNoKHsnbnVtZXJpY01vbnRoJzogZC5udW1lcmljTW9udGh9KTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChkLnZhbHVlID4gc3RhY2tDaGFydENvbmZpZy55QXhpc1VuaXRSYW5nZSkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGN1cnJlbmN5Rm9ybWF0ID0gJ00nOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9KTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB9KTsKKworICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vVG9vbFRpcCBEYXRhCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgZm9yICh2YXIgeiA9IDA7IHogPCBkYXRhT2JqLmxlbmd0aDsgeisrKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhciB0ZW1wU2VyaWVzID0gZGF0YU9ialt6XS5zZXJpZXM7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZvciAodmFyIGogPSAwOyBqIDwgZGF0YU9ialt6XS52YWx1ZXMubGVuZ3RoOyBqKyspIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhciBtb250aHMgPSBkYXRhT2JqW3pdLnZhbHVlc1tqXS5tb250aDsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhciB0ZW1wVmFsID0gZGF0YU9ialt6XS52YWx1ZXNbal0udmFsdWU7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0ZW1wRGF0YS5wdXNoKHsibW9udGgiOiBtb250aHMsICJzZXJpZXMiOiB0ZW1wU2VyaWVzLCAidmFsdWUiOiB0ZW1wVmFsfSk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgZm9yICh2YXIgayA9IDA7IGsgPCB0ZW1wRGF0YS5sZW5ndGg7IGsrKykgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YXIgc2VyaWVzTmFtZSA9IHRlbXBEYXRhW2tdLnNlcmllczsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFyIHNlcmllc1ZhbCA9IHRlbXBEYXRhW2tdLnZhbHVlOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YXIgdGVtcE9iaiA9IHRvb2x0aXBEYXRhW3RlbXBEYXRhW2tdLm1vbnRoXTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKCEodGVtcE9iaikpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRlbXBPYmogPSBbXTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRvb2x0aXBEYXRhW3RlbXBEYXRhW2tdLm1vbnRoXSA9IHRlbXBPYmo7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdGVtcE9iai5wdXNoKHtzZXJpZXNOYW1lOiBzZXJpZXNOYW1lLCBzZXJpZXNWYWw6IHNlcmllc1ZhbH0pOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBmb3IgKHZhciBkIGluIHRvb2x0aXBEYXRhKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhciB0b29sdGlwT2JqID0gdG9vbHRpcERhdGFbZF07CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhciB0ZW1wID0gMCwgbW9udGhUb3RhbFZhbCA9IDA7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZvciAodmFyIHkgPSAwOyB5IDwgdG9vbHRpcE9iai5sZW5ndGg7IHkrKykgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdGVtcCA9IHBhcnNlRmxvYXQodG9vbHRpcE9ialt5XS5zZXJpZXNWYWwpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbW9udGhUb3RhbFZhbCA9IG1vbnRoVG90YWxWYWwgKyB0ZW1wOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdG9vbHRpcE9ialsndG90YWwnXSA9IG1vbnRoVG90YWxWYWw7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFyIHlEb21haW5EYXRhID0gW10seUF4aXNEYXRhID0gW10seVRpY2tzRGF0YSA9IFtdOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZvciAodmFyIG1vbnRoIGluIHRvb2x0aXBEYXRhKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHlEb21haW5EYXRhLnB1c2goeyJ0b3RhbCI6IHRvb2x0aXBEYXRhW21vbnRoXS50b3RhbH0pOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgIAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vRm9ybWF0IHlBeGlzIExhYmVscworICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhciBmb3JtYXRDdXJyZW5jeSA9IGZ1bmN0aW9uIChkKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChjdXJyZW5jeUZvcm1hdCA9PT0gJ00nKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gIiQiICsgZCAvIDEwMDAwMDAgKyAiTSI7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gIiQiICsgZCAvIDEwMDAgKyAiSyI7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB9OworICAgICAgICAgICAgICAgICAgICAgICAgICAgIAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vWC1BeGlzIERvbWFpbiAgCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgeFJhbmdlLmRvbWFpbihkMy5leHRlbnQoeE1vbnRoLCBmdW5jdGlvbiAoZCkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gZC5udW1lcmljTW9udGg7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSkpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZvciAodmFyIGIgPSAwOyBiIDwgeURvbWFpbkRhdGEubGVuZ3RoOyBiKyspIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFyIHZhbCA9IE1hdGgucm91bmQocGFyc2VJbnQoeURvbWFpbkRhdGFbYl0udG90YWwsIDEwKSAvIHN0YWNrQ2hhcnRDb25maWcueUF4aXNNYXhUaWNrcyk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhciBDYWxjID0gTWF0aC5jZWlsKCh2YWwgLyBNYXRoLnBvdygxMCwgKCIiICsgdmFsKS5sZW5ndGggLSAxKSkpICogKHN0YWNrQ2hhcnRDb25maWcueUF4aXNNYXhUaWNrcykgKiBNYXRoLnBvdygxMCwgKCIiICsgdmFsKS5sZW5ndGggLSAxKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgeUF4aXNEYXRhLnB1c2goeyd5QXhpc1ZhbCc6IENhbGN9KTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CisgCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgLy9ZLUF4aXMgRG9tYWluCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgeVJhbmdlLmRvbWFpbihbMCwgZDMubWF4KHlBeGlzRGF0YSwgZnVuY3Rpb24gKGQpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiAoZC55QXhpc1ZhbCk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0pXSk7CisgCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFyIHlUaWNrID0gZDMubWF4KHlBeGlzRGF0YSwgZnVuY3Rpb24gKGQpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGQueUF4aXNWYWw7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSk7CisgCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgeVRpY2sgPSB5VGljayAvIHN0YWNrQ2hhcnRDb25maWcueUF4aXNNYXhUaWNrczsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBmb3IgKHZhciBjID0gMDsgYyA8PSBzdGFja0NoYXJ0Q29uZmlnLnlBeGlzTWF4VGlja3M7IGMrKykgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB5VGlja3NEYXRhLnB1c2goeVRpY2sgKiBjKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFyIHhBeGlzID0gZDMuc3ZnLmF4aXMoKS5zY2FsZSh4UmFuZ2UpLm9yaWVudCgiYm90dG9tIikudGlja0Zvcm1hdChkMy50aW1lLmZvcm1hdCgnJWInKSkudGlja3MoZDMudGltZS5tb250aHMpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhciB5QXhpcyA9IGQzLnN2Zy5heGlzKCkuc2NhbGUoeVJhbmdlKS5vcmllbnQoImxlZnQiKS50aWNrVmFsdWVzKHlUaWNrc0RhdGEpLnRpY2tzKHN0YWNrQ2hhcnRDb25maWcueUF4aXNNYXhUaWNrcykudGlja0Zvcm1hdChmb3JtYXRDdXJyZW5jeSk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFyIHlBeGlzR3JpZCA9IGQzLnN2Zy5heGlzKCkuc2NhbGUoeVJhbmdlKS5vcmllbnQoImxlZnQiKS50aWNrVmFsdWVzKHlUaWNrc0RhdGEpLnRpY2tzKHN0YWNrQ2hhcnRDb25maWcueUF4aXNNYXhUaWNrcykudGlja1NpemUoLXdpZHRoLCAwLCAwKTsgICAgICAgICAgICAgICAgICAgICAgICAgICAgCisKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAvL0NhbGN1bGF0ZSB2YWx1ZXMgZm9yIFN0YWNrCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFyIHN0YWNrID0gZDMubGF5b3V0LnN0YWNrKCkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC52YWx1ZXMoZnVuY3Rpb24gKGQpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gZC52YWx1ZXM7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9KQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLngoZnVuY3Rpb24gKGQpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gZC5udW1lcmljTW9udGg7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9KQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLnkoZnVuY3Rpb24gKGQpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gZC52YWx1ZTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0pOworCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgLy9EcmF3IEFyZWEgIAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhciBhcmVhID0gZDMuc3ZnLmFyZWEoKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLngoZnVuY3Rpb24gKGQpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4geFJhbmdlKGQubnVtZXJpY01vbnRoKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0pCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAueTAoZnVuY3Rpb24gKGQpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4geVJhbmdlKGQueTApOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC55MShmdW5jdGlvbiAoZCkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiB5UmFuZ2UoZC55MCArIGQueSk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9KS5pbnRlcnBvbGF0ZShzdGFja0NoYXJ0Q29uZmlnLmxpbmVDdXJ2ZVR5cGUpOworCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgLy9QbG90IENoYXJ0CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFyIGRyYXdDaGFydCA9IGQzLnNlbGVjdCgiI3N0YWNrQ2hhcnRDb250YWluZXIiKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLmFwcGVuZCgic3ZnIikKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC5hdHRyKCJpZCIsIGF0dHJzLmlkKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLmRhdGEoZGF0YU9iaikKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC5hdHRyKCJ3aWR0aCIsIHdpZHRoICsgbWFyZ2luLmxlZnQgKyBtYXJnaW4ucmlnaHQpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAuYXR0cigiaGVpZ2h0IiwgcGFyc2VJbnQoaGVpZ2h0LCAxMCkgKyBwYXJzZUludChtYXJnaW4udG9wLCAxMCkgKyBwYXJzZUludChtYXJnaW4uYm90dG9tLCAxMCkpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAuYXBwZW5kKCJnIikKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC5hdHRyKCJ0cmFuc2Zvcm0iLCAidHJhbnNsYXRlKCIgKyBtYXJnaW4ubGVmdCArICIsIiArIG1hcmdpbi50b3AgKyAiKSIpOworCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgLy9EcmF3IFggQXhpcyAgICAgICAgCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgZHJhd0NoYXJ0LmFwcGVuZCgiZyIpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAuYXR0cigiY2xhc3MiLCAieCBheGlzIikKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC5hdHRyKCJ0cmFuc2Zvcm0iLCAidHJhbnNsYXRlKDAsIiArIGhlaWdodCArICIpIikKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC5jYWxsKHhBeGlzKTsKKworICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vUGxvdCBBcmVhIGZvciBtdWx0aXBsZSBTdGFja3MKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBkcmF3Q2hhcnQuc2VsZWN0QWxsKCIubGF5ZXIiKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLmRhdGEoc3RhY2soZGF0YU9iaikpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAuZW50ZXIoKS5hcHBlbmQoInBhdGgiKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLmF0dHIoImNsYXNzIiwgImxheWVyIikKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC5hdHRyKCJkIiwgZnVuY3Rpb24gKGQpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gYXJlYShkLnZhbHVlcyk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9KS5zdHlsZSgiZmlsbCIsIGZ1bmN0aW9uIChkLCBpKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBzY29wZS5sZWdlbmRDb2xvcnNbaV07CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSkuc3R5bGUoIm9wYWNpdHkiLCBzdGFja0NoYXJ0Q29uZmlnLmNoYXJ0T3BhY2l0eSkuc3R5bGUoInN0cm9rZSIsICIjZGRkIikuYXBwZW5kKCJ0aXRsZSIpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAudGV4dChmdW5jdGlvbiAoZCkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBkLnNlcmllczsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0pOworCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgLy9EcmF3IGR1YWwgWSBheGlzIG9uIGNoYW5nZSBvZiBZZWFyCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFyIHlBeGlzT2JqID0gZGF0YU9ialswXS52YWx1ZXMsIHlBeGlzSWR4ID0gMDsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBmb3IgKHZhciBpID0gMDsgaSA8IHlBeGlzT2JqLmxlbmd0aDsgaSsrKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhciB0bXBPYmogPSBbXTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdG1wT2JqLnB1c2goeyJ5ZWFyIjogbGFiZWxGb3JtYXQoeUF4aXNPYmpbaV0ubnVtZXJpY01vbnRoKSwgInRyYW5zZm9ybSI6IHhSYW5nZSh5QXhpc09ialtpXS5udW1lcmljTW9udGgpfSk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICgheWVhckFycltsYWJlbEZvcm1hdCh5QXhpc09ialtpXS5udW1lcmljTW9udGgpXSkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgeWVhckFycltsYWJlbEZvcm1hdCh5QXhpc09ialtpXS5udW1lcmljTW9udGgpXSA9IHRtcE9iajsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBmb3IgKHZhciBrZXkgaW4geWVhckFycikgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YXIgb2JqID0geWVhckFycltrZXldOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YXIgeUF4aXNOb2RlcyA9IGRyYXdDaGFydC5hcHBlbmQoImciKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC5hdHRyKCJjbGFzcyIsICJ5IGF4aXMiKS5hdHRyKCJpZCIsIHlBeGlzSWQoeUF4aXNJZHgpKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC5hdHRyKCJ0cmFuc2Zvcm0iLCAidHJhbnNsYXRlKCIgKyBvYmpbMF0udHJhbnNmb3JtICsgIiwwKSIpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLmNhbGwoeUF4aXMpOworCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHlBeGlzTm9kZXMuc2VsZWN0QWxsKCJ0ZXh0IikuYXR0cignY2xhc3MnLCAndGlja3RleHQnKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLy9BcHBlbmQgWWVhciBMYWJlbCAKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgeUF4aXNOb2Rlcy5hcHBlbmQoInRleHQiKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC5hdHRyKCJ0cmFuc2Zvcm0iLCAicm90YXRlKDApIikKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAuYXR0cigieSIsIHN0YWNrQ2hhcnRDb25maWcueWVhckxhYmVsUG9zLnkpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLmF0dHIoIngiLCBzdGFja0NoYXJ0Q29uZmlnLnllYXJMYWJlbFBvcy54KQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC50ZXh0KG9ialswXS55ZWFyKS5hdHRyKCJjbGFzcyIsICJ5ZWFyTGFiZWwiKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgeUF4aXNJZHgrKzsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CisKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAvL1JlbW92ZSBuZXh0IHllYXIgWSBheGlzIGluIGNhc2Ugb2Ygc2luZ2xlIE1vbnRoIHNlbGVjdGlvbgorICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChpc1NpbmdsZU1vbnRoKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGQzLnNlbGVjdCgiI3lBeGlzSWQxIikucmVtb3ZlKCk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQorCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgZnVuY3Rpb24geUF4aXNJZCh5QXhpc0lkeCkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gKCJ5QXhpc0lkIiArIHlBeGlzSWR4KTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CisKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAvL2Z1bmN0aW9uIHRvIHNlbGVjdCBmaXJzdCBlbGVtZW50CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgZDMuc2VsZWN0aW9uLnByb3RvdHlwZS5maXJzdCA9IGZ1bmN0aW9uICgpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGQzLnNlbGVjdCh0aGlzWzBdWzBdKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB9OworCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgLy9SZW1vdmUgbWluaW11bSB2YWx1ZSBsYWJlbCBmb3JtIFkgQXhpcworICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhciB0aWNrTGFiZWxzID0gZDMuc2VsZWN0KCIjeUF4aXNJZDAiKS5zZWxlY3RBbGwoJy50aWNrdGV4dCcpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRpY2tMYWJlbHMuZmlyc3QoKS5yZW1vdmUoKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBkMy5zZWxlY3QoIiN5QXhpc0lkMSIpLnNlbGVjdEFsbCgnLnRpY2t0ZXh0JykucmVtb3ZlKCk7CisKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoaXNTaW5nbGVNb250aCkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBkcmF3Q2hhcnQuc2VsZWN0QWxsKCcueC5heGlzJykuc2VsZWN0QWxsKCcudGljaycpLnNlbGVjdEFsbCgndGV4dCcpWzFdWzBdLnRleHRDb250ZW50ID0gc2luZ2xlTW9udGhOYW1lOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KKworICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vQXBwZW5kIERhdGEgUG9pbnRzICAgICAgICAgCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgZm9yICh2YXIgeCA9IDA7IHggPCBkYXRhT2JqLmxlbmd0aDsgeCsrKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRyYXdDaGFydC5hcHBlbmQoJ2cnKS5hdHRyKCdpZCcsICJwYXRoSWQiICsgeCkuYXR0cigidHJhbnNmb3JtIiwgInRyYW5zbGF0ZSgiICsgKGlzU2luZ2xlTW9udGggPT09IHRydWUpICogd2lkdGggLyAyICsgIiwwKSIpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoaWR4ID49IHN0YWNrQ2hhcnRDb25maWcuc2hhcGVzLmxlbmd0aCkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWR4ID0gMDsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YXIgc2hhcGUgPSBzdGFja0NoYXJ0Q29uZmlnLnNoYXBlc1tpZHhdLCBzaGFwZVRvQXBwZW5kOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoc2hhcGUgPT0gJ3JlY3QnIHx8IHNoYXBlID09ICd0cmlhbmdsZScpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNoYXBlVG9BcHBlbmQgPSAncG9seWdvbic7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZWxzZSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzaGFwZVRvQXBwZW5kID0gJ2NpcmNsZSc7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KKworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YXIgbmV3RGF0YU9iajsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGlzU2luZ2xlTW9udGgpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG5ld0RhdGFPYmogPSBkYXRhT2JqW3hdLnZhbHVlcy5zbGljZSgwLCAxKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG5ld0RhdGFPYmogPSBkYXRhT2JqW3hdLnZhbHVlczsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQorCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhciBkYXRhUG9pbnRzID0gZHJhd0NoYXJ0LnNlbGVjdCgnI3BhdGhJZCcgKyB4KS5zZWxlY3RBbGwoc2hhcGVUb0FwcGVuZCkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAuZGF0YShuZXdEYXRhT2JqKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC5lbnRlcigpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLmFwcGVuZChzaGFwZVRvQXBwZW5kKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC5hdHRyKCdjbGFzcycsIHNoYXBlKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZHJhd1NoYXBlcyhzaGFwZSwgZGF0YVBvaW50cyk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlkeCsrOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KKworICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vRmlsbCBjb2xvciBpbiBkYXRhUG9pbnRzCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgZm9yICh2YXIgYSA9IDA7IGEgPD0gZGF0YU9iai5sZW5ndGg7IGErKykgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YXIgRG90cyA9IGRyYXdDaGFydC5zZWxlY3RBbGwoJy4nICsgc3RhY2tDaGFydENvbmZpZy5zaGFwZXNbYV0pOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBEb3RzLmF0dHIoJ2ZpbGwnLCBzY29wZS5sZWdlbmRDb2xvcnNbYV0pOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KKworICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vZnVuY3Rpb24gdG8gZHJhdyBtdWx0aXBsZSBzaGFwZXMgZm9yIERhdGEgUG9pbnRzCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgZnVuY3Rpb24gZHJhd1NoYXBlcyhzaGFwZSwgZGF0YVBvaW50cykgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzd2l0Y2ggKHNoYXBlKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjYXNlICdjaXJjbGUnOgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhciBjaXJjbGUgPSBkYXRhUG9pbnRzLmF0dHIoImN4IiwgZnVuY3Rpb24gKGQpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHhSYW5nZShkLm51bWVyaWNNb250aCk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSkuYXR0cigiY3kiLCBmdW5jdGlvbiAoZCkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4geVJhbmdlKGQueSArIGQueTApOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0pLmF0dHIoInIiLCBzdGFja0NoYXJ0Q29uZmlnLnNoYXBlU2l6ZVswXSkub24oIm1vdXNlb3ZlciIsIGZ1bmN0aW9uIChkKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNob3dfdG9vbHRpcF9ncmlkX2xpbmUoZDMuc2VsZWN0KHRoaXMpLmF0dHIoImN4IiksICJjaXJjbGUiLCAiY3giKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFyIG9mZnNldFggPSBNYXRoLmNlaWwoZDMuc2VsZWN0KHRoaXMpLmF0dHIoImN4IikpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YXIgb2Zmc2V0WSA9IE1hdGgucm91bmQoZDMuc2VsZWN0KHRoaXMpLmF0dHIoImN5IikpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBkMy5zZWxlY3RBbGwoJ3N2ZyMnICsgYXR0cnMuaWQgKyAiICIgKyAicGF0aCIpLnN0eWxlKCJmaWxsLW9wYWNpdHkiLCBzdGFja0NoYXJ0Q29uZmlnLmNoYXJ0T3BhY2l0eSk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGQzLnNlbGVjdEFsbCgnc3ZnIycgKyBhdHRycy5pZCArICIgIiArICJwb2x5Z29uIikuc3R5bGUoImZpbGwtb3BhY2l0eSIsIHN0YWNrQ2hhcnRDb25maWcuY2hhcnRPcGFjaXR5KTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZDMuc2VsZWN0QWxsKCdzdmcjJyArIGF0dHJzLmlkICsgIiAiICsgImNpcmNsZSIpLnN0eWxlKCJmaWxsLW9wYWNpdHkiLCBzdGFja0NoYXJ0Q29uZmlnLmNoYXJ0T3BhY2l0eSk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1vdXNlT3ZlcihkLCBvZmZzZXRYLCBvZmZzZXRZKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9KS5vbigibW91c2VvdXQiLCBmdW5jdGlvbiAoKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGhpZGVfdG9vbHRpcF9ncmlkX2xpbmUoZDMuc2VsZWN0KHRoaXMpLmF0dHIoImN4IiksICJjaXJjbGUiLCAiY3giKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZDMuc2VsZWN0QWxsKCdzdmcjJyArIGF0dHJzLmlkICsgIiAiICsgInBhdGgiKS5zdHlsZSgiZmlsbC1vcGFjaXR5IiwgMSk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGQzLnNlbGVjdEFsbCgnc3ZnIycgKyBhdHRycy5pZCArICIgIiArICJwb2x5Z29uIikuc3R5bGUoImZpbGwtb3BhY2l0eSIsIDEpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBkMy5zZWxlY3RBbGwoJ3N2ZyMnICsgYXR0cnMuaWQgKyAiICIgKyAiY2lyY2xlIikuc3R5bGUoImZpbGwtb3BhY2l0eSIsIDEpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzY29wZS50b29sdGlwRmxhZyA9IGZhbHNlOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzY29wZS4kYXBwbHkoKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9KTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjaXJjbGUuYXBwZW5kKCdkZXNjJykuYXBwZW5kKCd0aXRsZScpLnRleHQoZnVuY3Rpb24gKGQpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFyIG52ZGFPYmogPSB0b29sdGlwRGF0YVtkLm1vbnRoXTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIChhZGRUaXRsZShudmRhT2JqLCBkKSk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjYXNlICdyZWN0JzoKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YXIgcmVjdCA9IGRhdGFQb2ludHMuYXR0cigicG9pbnRzIiwgZnVuY3Rpb24gKGQpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFyIHggPSBwYXJzZUludCh4UmFuZ2UoZC5udW1lcmljTW9udGgpLCAxMCk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHggPSB4ICsgKHN0YWNrQ2hhcnRDb25maWcuc2hhcGVTaXplWzFdIC8gMik7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhciB5ID0gcGFyc2VJbnQoeVJhbmdlKGQueSArIGQueTApLCAxMCk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHkgPSB5IC0gKHN0YWNrQ2hhcnRDb25maWcuc2hhcGVTaXplWzFdIC8gMik7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhciB4MSA9IHBhcnNlSW50KCh4IC0gc3RhY2tDaGFydENvbmZpZy5zaGFwZVNpemVbMV0pLCAxMCk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhciB5MSA9IHk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhciB4MiA9IHgxOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YXIgeTIgPSBwYXJzZUludCgoeTEgKyBzdGFja0NoYXJ0Q29uZmlnLnNoYXBlU2l6ZVsxXSksIDEwKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFyIHgzID0geDsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFyIHkzID0geTI7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhciB0bXAgPSB4MiArICIsIiArIHkyICsgIiAiICsgeDMgKyAiLCIgKyB5MyArICIgIiArIHggKyAiLCIgKyB5ICsgIiAiICsgeDEgKyAiLCIgKyB5MTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHRtcDsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9KS5hdHRyKCd4JywgZnVuY3Rpb24gKGQpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHhSYW5nZShkLm51bWVyaWNNb250aCk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSkuYXR0cigneScsIGZ1bmN0aW9uIChkKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiB5UmFuZ2UoZC55ICsgZC55MCk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSkub24oIm1vdXNlb3ZlciIsIGZ1bmN0aW9uIChkKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNob3dfdG9vbHRpcF9ncmlkX2xpbmUoZDMuc2VsZWN0KHRoaXMpLmF0dHIoIngiKSwgInJlY3QiLCAieCIpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YXIgb2Zmc2V0WCA9IE1hdGguY2VpbChkMy5zZWxlY3QodGhpcykuYXR0cigieCIpKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFyIG9mZnNldFkgPSBNYXRoLnJvdW5kKGQzLnNlbGVjdCh0aGlzKS5hdHRyKCJ5IikpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBkMy5zZWxlY3RBbGwoJ3N2ZyMnICsgYXR0cnMuaWQgKyAiICIgKyAicGF0aCIpLnN0eWxlKCJmaWxsLW9wYWNpdHkiLCBzdGFja0NoYXJ0Q29uZmlnLmNoYXJ0T3BhY2l0eSk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGQzLnNlbGVjdEFsbCgnc3ZnIycgKyBhdHRycy5pZCArICIgIiArICJwb2x5Z29uIikuc3R5bGUoImZpbGwtb3BhY2l0eSIsIHN0YWNrQ2hhcnRDb25maWcuY2hhcnRPcGFjaXR5KTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZDMuc2VsZWN0QWxsKCdzdmcjJyArIGF0dHJzLmlkICsgIiAiICsgImNpcmNsZSIpLnN0eWxlKCJmaWxsLW9wYWNpdHkiLCBzdGFja0NoYXJ0Q29uZmlnLmNoYXJ0T3BhY2l0eSk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1vdXNlT3ZlcihkLCBvZmZzZXRYLCBvZmZzZXRZKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9KS5vbigibW91c2VvdXQiLCBmdW5jdGlvbiAoKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGhpZGVfdG9vbHRpcF9ncmlkX2xpbmUoZDMuc2VsZWN0KHRoaXMpLmF0dHIoIngiKSwgInJlY3QiLCAieCIpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBkMy5zZWxlY3RBbGwoJ3N2ZyMnICsgYXR0cnMuaWQgKyAiICIgKyAicGF0aCIpLnN0eWxlKCJmaWxsLW9wYWNpdHkiLCAxKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZDMuc2VsZWN0QWxsKCdzdmcjJyArIGF0dHJzLmlkICsgIiAiICsgInBvbHlnb24iKS5zdHlsZSgiZmlsbC1vcGFjaXR5IiwgMSk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGQzLnNlbGVjdEFsbCgnc3ZnIycgKyBhdHRycy5pZCArICIgIiArICJjaXJjbGUiKS5zdHlsZSgiZmlsbC1vcGFjaXR5IiwgMSk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNjb3BlLnRvb2x0aXBGbGFnID0gZmFsc2U7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNjb3BlLiRhcHBseSgpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0pOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJlY3QuYXBwZW5kKCdkZXNjJykuYXBwZW5kKCd0aXRsZScpLnRleHQoZnVuY3Rpb24gKGQpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFyIG52ZGFPYmogPSB0b29sdGlwRGF0YVtkLm1vbnRoXTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIChhZGRUaXRsZShudmRhT2JqLCBkKSk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjYXNlICd0cmlhbmdsZSc6CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFyIHRyaWFuZ2xlID0gZGF0YVBvaW50cy5hdHRyKCJwb2ludHMiLCBmdW5jdGlvbiAoZCkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YXIgeCA9IHBhcnNlSW50KHhSYW5nZShkLm51bWVyaWNNb250aCksIDEwKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFyIHkgPSBwYXJzZUludCh5UmFuZ2UoZC55ICsgZC55MCksIDEwKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFyIHgxID0gcGFyc2VJbnQoKHggLSBzdGFja0NoYXJ0Q29uZmlnLnNoYXBlU2l6ZVsyXSksIDEwKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFyIHkxID0gcGFyc2VJbnQoKHkgLSBzdGFja0NoYXJ0Q29uZmlnLnNoYXBlU2l6ZVsyXSksIDEwKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFyIHgyID0gcGFyc2VJbnQoKHggKyBzdGFja0NoYXJ0Q29uZmlnLnNoYXBlU2l6ZVsyXSksIDEwKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFyIHkyID0geTE7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhciB0bXAgPSB4MSArICIsIiArIHkxICsgIiAiICsgeCArICIsIiArIHkgKyAiICIgKyB4MiArICIsIiArIHkyOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gdG1wOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0pLmF0dHIoInRyYW5zZm9ybSIsIGZ1bmN0aW9uIChkKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhciB4ID0gcGFyc2VJbnQoeFJhbmdlKGQubnVtZXJpY01vbnRoKSwgMTApOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YXIgeSA9IHBhcnNlSW50KHlSYW5nZShkLnkgKyBkLnkwKSwgMTApOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB5ID0geSAtIDI7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhciB0bXAgPSAicm90YXRlKDE4MCwiICsgeCArICIsIiArIHkgKyAiKSI7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiB0bXA7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSkuYXR0cigneCcsIGZ1bmN0aW9uIChkKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiB4UmFuZ2UoZC5udW1lcmljTW9udGgpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0pLmF0dHIoJ3knLCBmdW5jdGlvbiAoZCkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4geVJhbmdlKGQueSArIGQueTApOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0pLm9uKCJtb3VzZW92ZXIiLCBmdW5jdGlvbiAoZCkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzaG93X3Rvb2x0aXBfZ3JpZF9saW5lKGQzLnNlbGVjdCh0aGlzKS5hdHRyKCJ4IiksICJ0cmlhbmdsZSIsICJ4Iik7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhciBvZmZzZXRYID0gTWF0aC5jZWlsKGQzLnNlbGVjdCh0aGlzKS5hdHRyKCJ4IikpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YXIgb2Zmc2V0WSA9IE1hdGgucm91bmQoZDMuc2VsZWN0KHRoaXMpLmF0dHIoInkiKSk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGQzLnNlbGVjdEFsbCgnc3ZnIycgKyBhdHRycy5pZCArICIgIiArICJwYXRoIikuc3R5bGUoImZpbGwtb3BhY2l0eSIsIHN0YWNrQ2hhcnRDb25maWcuY2hhcnRPcGFjaXR5KTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZDMuc2VsZWN0QWxsKCdzdmcjJyArIGF0dHJzLmlkICsgIiAiICsgInBvbHlnb24iKS5zdHlsZSgiZmlsbC1vcGFjaXR5Iiwgc3RhY2tDaGFydENvbmZpZy5jaGFydE9wYWNpdHkpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBkMy5zZWxlY3RBbGwoJ3N2ZyMnICsgYXR0cnMuaWQgKyAiICIgKyAiY2lyY2xlIikuc3R5bGUoImZpbGwtb3BhY2l0eSIsIHN0YWNrQ2hhcnRDb25maWcuY2hhcnRPcGFjaXR5KTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbW91c2VPdmVyKGQsIG9mZnNldFgsIG9mZnNldFkpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0pLm9uKCJtb3VzZW91dCIsIGZ1bmN0aW9uICgpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaGlkZV90b29sdGlwX2dyaWRfbGluZShkMy5zZWxlY3QodGhpcykuYXR0cigieCIpLCAidHJpYW5nbGUiLCAieCIpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBkMy5zZWxlY3RBbGwoJ3N2ZyMnICsgYXR0cnMuaWQgKyAiICIgKyAicGF0aCIpLnN0eWxlKCJmaWxsLW9wYWNpdHkiLCAxKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZDMuc2VsZWN0QWxsKCdzdmcjJyArIGF0dHJzLmlkICsgIiAiICsgInBvbHlnb24iKS5zdHlsZSgiZmlsbC1vcGFjaXR5IiwgMSk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGQzLnNlbGVjdEFsbCgnc3ZnIycgKyBhdHRycy5pZCArICIgIiArICJjaXJjbGUiKS5zdHlsZSgiZmlsbC1vcGFjaXR5IiwgMSk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNjb3BlLnRvb2x0aXBGbGFnID0gZmFsc2U7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNjb3BlLiRhcHBseSgpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0pOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRyaWFuZ2xlLmFwcGVuZCgnZGVzYycpLmFwcGVuZCgndGl0bGUnKS50ZXh0KGZ1bmN0aW9uIChkKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhciBudmRhT2JqID0gdG9vbHRpcERhdGFbZC5tb250aF07CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiAoYWRkVGl0bGUobnZkYU9iaiwgZCkpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0pOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQorCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgLy9EcmF3IEdyaWQgTGluZXMKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBkcmF3Q2hhcnQuYXBwZW5kKCJnIikKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC5hdHRyKCJjbGFzcyIsICJncmlkIikKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC5hdHRyKCJpZCIsICJ5U3RhY2tHcmlkIikKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC5hdHRyKCJ0cmFuc2Zvcm0iLCAidHJhbnNsYXRlKDAsMCkiKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLmNhbGwoeUF4aXNHcmlkKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLnNlbGVjdEFsbCgidGV4dCIpLnJlbW92ZSgpOworCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gRHJhdyB0aGUgeCBHcmlkIGxpbmVzCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgZHJhd0NoYXJ0LmFwcGVuZCgiZyIpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAuYXR0cigiY2xhc3MiLCAiZ3JpZCIpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAuYXR0cigiaWQiLCAieEdyaWQiKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLmF0dHIoInRyYW5zZm9ybSIsICJ0cmFuc2xhdGUoIiArIChpc1NpbmdsZU1vbnRoID09PSB0cnVlKSAqIHdpZHRoIC8gMiArICIsMCkiKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLmNhbGwobWFrZV94X2F4aXMoKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAudGlja1NpemUoLWhlaWdodCwgMCkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLnRpY2tGb3JtYXQoIiIpKTsKKworICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vIGZ1bmN0aW9uIGZvciB0aGUgeCBncmlkIGxpbmVzCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgZnVuY3Rpb24gbWFrZV94X2F4aXMoKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBkMy5zdmcuYXhpcygpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLnNjYWxlKHhSYW5nZSkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAub3JpZW50KCJ0b3AiKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC50aWNrRm9ybWF0KGQzLnRpbWUuZm9ybWF0KCclYicpKS50aWNrcyhkMy50aW1lLm1vbnRocyk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQorCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgZHJhd0NoYXJ0LnNlbGVjdCgiI3hHcmlkIikuc2VsZWN0QWxsKCJsaW5lIikuc3R5bGUoInN0cm9rZSIsICJub25lIik7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgZHJhd0NoYXJ0LnNlbGVjdCgiI3hHcmlkIikuc2VsZWN0QWxsKCJsaW5lIikKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC5hdHRyKCJpZCIsIGZ1bmN0aW9uIChkLCBpKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuICgieEF4aXNMaW5lIiArIGkpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgLy9BZGQgdGl0bGUgZm9yIE5WREEgc2NyZWVuIHJlYWRlcgorICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZ1bmN0aW9uIGFkZFRpdGxlKG52ZGFPYmosIGQpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFyIHRlbXAgPSAiIjsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZm9yICh2YXIgeSA9IDA7IHkgPCBudmRhT2JqLmxlbmd0aDsgeSsrKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0ZW1wID0gdGVtcCArIG52ZGFPYmpbeV0uc2VyaWVzTmFtZSArIG52ZGFPYmpbeV0uc2VyaWVzVmFsOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiAodG9vbHRpcEZvcm1hdChkLm51bWVyaWNNb250aCkgKyAiLS0iICsgdGVtcCArICJUb3RhbCBDaGFyZ2VzIiArIG52ZGFPYmoudG90YWwpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KKworICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vU2hvdyBHcmlkIExpbmVzIG9uIE1vdXNlIEhvdmVyICAgICAgICAKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBmdW5jdGlvbiBzaG93X3Rvb2x0aXBfZ3JpZF9saW5lKG9mZnNldFgsIHNoYXBlLCBhdHRyKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRyeSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YXIgZGF0YUxlbmd0aDsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChpc1NpbmdsZU1vbnRoKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZGF0YUxlbmd0aCA9IDE7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRhdGFMZW5ndGggPSBzY29wZS5jaGFydERhdGFbMF0udmFsdWVzLmxlbmd0aDsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KKworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZm9yICh2YXIgaSA9IDA7IGkgPCBkYXRhTGVuZ3RoOyBpKyspIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YXIgY2lyY2xlID0gZHJhd0NoYXJ0LnNlbGVjdEFsbCgiLiIgKyBzaGFwZSk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGNpcmNsZVswXVtpXS5nZXRBdHRyaWJ1dGUoYXR0cikgPT09IG9mZnNldFgpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZHJhd0NoYXJ0LnNlbGVjdCgiI3hBeGlzTGluZSIgKyBpKS5zdHlsZSgic3Ryb2tlIiwgc3RhY2tDaGFydENvbmZpZy5ncmlkTGluZUNvbG9yKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0gY2F0Y2ggKGUpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KKworICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vSGlkZSBncmlkIExpbmVzCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgZnVuY3Rpb24gaGlkZV90b29sdGlwX2dyaWRfbGluZShvZmZzZXRYLCBzaGFwZSwgYXR0cikgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0cnkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFyIGRhdGFMZW5ndGg7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoaXNTaW5nbGVNb250aCkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRhdGFMZW5ndGggPSAxOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBkYXRhTGVuZ3RoID0gc2NvcGUuY2hhcnREYXRhWzBdLnZhbHVlcy5sZW5ndGg7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CisKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZvciAodmFyIGkgPSAwOyBpIDwgZGF0YUxlbmd0aDsgaSsrKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFyIGNpcmNsZSA9IGRyYXdDaGFydC5zZWxlY3RBbGwoIi4iICsgc2hhcGUpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChjaXJjbGVbMF1baV0uZ2V0QXR0cmlidXRlKGF0dHIpID09PSBvZmZzZXRYKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRyYXdDaGFydC5zZWxlY3QoIiN4QXhpc0xpbmUiICsgaSkuc3R5bGUoInN0cm9rZSIsICJ0cmFuc3BhcmVudCIpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSBjYXRjaCAoZSkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQorCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgLy9Nb3VzZU92ZXIgRXZlbnQKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBmdW5jdGlvbiBtb3VzZU92ZXIoZCwgb2Zmc2V0WCwgb2Zmc2V0WSkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBmb3IgKHZhciBrZXkgaW4gdG9vbHRpcERhdGEpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChrZXkgPT0gZC5tb250aCkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhciBkYXRhID0gYW5ndWxhci5jb3B5KHRvb2x0aXBEYXRhKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzY29wZS5zdGFja0RhdGFQb2ludCA9IGRhdGFba2V5XS5yZXZlcnNlKCk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFyIHRtcCA9IDAsIG1vbnRoVG90YWxWYWwgPSAwOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBmb3IgKHZhciBiID0gMDsgYiA8IHNjb3BlLnN0YWNrRGF0YVBvaW50Lmxlbmd0aDsgYisrKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0bXAgPSBwYXJzZUZsb2F0KHNjb3BlLnN0YWNrRGF0YVBvaW50W2JdLnNlcmllc1ZhbCk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBtb250aFRvdGFsVmFsID0gbW9udGhUb3RhbFZhbCArIHRtcDsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzY29wZS50b3RhbCA9IG1vbnRoVG90YWxWYWw7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNjb3BlLnN0YWNrRGF0YVBvaW50LnRvdGFsID0gbW9udGhUb3RhbFZhbDsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNjb3BlLm1vbnRoUG9pbnQgPSB7InhEYXRhIjogdG9vbHRpcEZvcm1hdChkLm51bWVyaWNNb250aCkucmVwbGFjZSgnLScsICcgJyl9OworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzY29wZS4kYXBwbHkoKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJHRpbWVvdXQoZnVuY3Rpb24oKXsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBvZmZzZXRZID0gb2Zmc2V0WSAtIHN0YWNrQ2hhcnRDb25maWcudG9vbHRpcFRvcE1hcmdpbjsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFyIHRvb2x0aXBFbCA9IGVsZW1lbnQuY2hpbGRyZW4oKS5lcSgyKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFyIHRvb2x0aXBXaWR0aCA9IHRvb2x0aXBFbFswXS5vZmZzZXRXaWR0aDsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGlzU2luZ2xlTW9udGgpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG9mZnNldFggPSBvZmZzZXRYIC0gKHRvb2x0aXBXaWR0aC8yKSArIHN0YWNrQ2hhcnRDb25maWcudG9vbHRpcExlZnRNYXJnaW4gKyAod2lkdGggLyAyKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG9mZnNldFggPSBvZmZzZXRYIC0gKHRvb2x0aXBXaWR0aC8yKSArIHN0YWNrQ2hhcnRDb25maWcudG9vbHRpcExlZnRNYXJnaW47CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0gIAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzY29wZS50b29sdGlwU3R5bGUgPSB7ImxlZnQiOiBvZmZzZXRYICsgInB4IiwgInRvcCI6IG9mZnNldFkgKyAicHgifTsgICAgCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNjb3BlLnRvb2x0aXBGbGFnID0gdHJ1ZTsgICAgCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0sMCk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAorCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgLy9maXggZm9yIHJlbW92aW5nIHVwcGVyIHRleHQgaWYgaXQgaXMgYmVsb3cgdG8geWVhciBsYWJlbAorLy8gICAgICAgICAgICAgICAgICAgICAgICAgICAgdHJ5IHsKKy8vICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YXIgbGFzdFRpY2tQb3N0aW9uID0gZHJhd0NoYXJ0LnNlbGVjdEFsbCgnI3lBeGlzSWQwJykuc2VsZWN0QWxsKCcudGljaycpWzBdLmxlbmd0aCAtIDE7CisvLyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFyIGxhc3RHcmlkUG9zID0gZHJhd0NoYXJ0LnNlbGVjdCgiI3lTdGFja0dyaWQiKS5zZWxlY3RBbGwoJy50aWNrJylbMF0ubGVuZ3RoIC0gMTsKKy8vICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YXIgdmFsID0gZHJhd0NoYXJ0LnNlbGVjdEFsbCgnI3lBeGlzSWQwJykuc2VsZWN0QWxsKCcudGljaycpWzBdW2xhc3RUaWNrUG9zdGlvbl0uYXR0cmlidXRlcy50cmFuc2Zvcm0udmFsdWUuc3BsaXQoJywnKVsxXS5zcGxpdCgnKScpWzBdOworLy8gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICh2YWwgPCAyMCkgeworLy8gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBkcmF3Q2hhcnQuc2VsZWN0QWxsKCcjeUF4aXNJZDAnKS5zZWxlY3RBbGwoJ3RleHQnKVswXVtsYXN0VGlja1Bvc3Rpb24gLSAxXS5yZW1vdmUoKTsKKy8vICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZHJhd0NoYXJ0LnNlbGVjdCgiI3lTdGFja0dyaWQiKS5zZWxlY3RBbGwoJy50aWNrJylbMF1bbGFzdEdyaWRQb3NdLnJlbW92ZSgpOworLy8gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KKy8vICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0gY2F0Y2ggKGUpIHsKKy8vICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBzY29wZS5yZWZyZXNoQ2hhcnQgPSBmYWxzZTsKKyAgICAgICAgICAgICAgICAgICAgICAgIH0pOworICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgfTsKKyAgICAgICAgICAgIH1dK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I1MHB4OworfQorLmJ1aS1yZWctZmFzdCwKKy5idWktcmVnLW5ldy1jdXN0b21lci1sYWJlbCB7CisgIGZvbnQtZmFtaWx5OiBhcmlhbDsKKyAgZm9udC1zaXplOiAyNHB4OworICBjb2xvcjogIzA2N2FiNDsKKyAgbWFyZ2luOiAtM3B4IDBweCAwcHggMjlweDsKK30KKy5idWktcmVnLWZhc3QgaDMsCisuYnVpLXJlZy1uZXctY3VzdG9tZXItbGFiZWwgaDMgeworICBjb2xvcjogIzA2N2FiNDsKKyAgbWFyZ2luLWxlZnQ6IC0yOHB4OworfQorLmJ1aS1yZWctYnRuLWhlcm8geworICBwYWRkaW5nOiA4cHggMTdweCAhaW1wb3J0YW50OworICBib3gtc2l6aW5nOiBib3JkZXItYm94OworICAtbW96LWJveC1zaXppbmc6IGJvcmRlci1ib3g7CisgIGJhY2tncm91bmQtY29sb3I6ICM2NjY2NjY7CisgIGJvcmRlcjogMCBub25lOworICBib3JkZXItcmFkaXVzOiA2cHg7CisgIGNvbG9yOiAjRkZGRkZGICFpbXBvcnRhbnQ7CisgIGN1cnNvcjogcG9pbnRlcjsKKyAgZGlzcGxheTogaW5saW5lLWJsb2NrOworICBmb250LXNpemU6IDE0cHg7CisgIGxpbmUtaGVpZ2h0OiAxOworICBwb3NpdGlvbjogcmVsYXRpdmU7CisgIHRleHQtYWxpZ246IGNlbnRlcjsKKyAgdHJhbnNpdGlvbjogYmFja2dyb3VuZC1jb2xvciAwLjNzIGVhc2Utb3V0IDBzOworICB2ZXJ0aWNhbC1hbGlnbjogbWlkZGxlOworICBwYWRkaW5nOiA4cHggMjBweCA4cHggMjBweDsKKyAgdGV4dC1kZWNvcmF0aW9uOiBub25lICFpbXBvcnRhbnQ7CisgIHZhbGlnbjogbWlkZGxlOworICBvdXRsaW5lOiBub25lOworICBiYWNrZ3JvdW5kLWNvbG9yOiAjRUY2RjAwOworICBjb2xvcjogI0ZGRkZGRjsKKyAgbWFyZ2luLWxlZnQ6IDFweDsKKy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1bGFyICEgaW1wb3J0YW50OworICBmb250LXNpemU6IDEycHg7CisgIHBhZGRpbmc6IDFweCAwcHggMHB4IDU1cHg7CisgIHdpZHRoOiAyMTBweDsKKyAgbGluZS1oZWlnaHQ6IDE1cHggIWltcG9ydGFudDsKK30KKy5idWktcmVnLWNvbHVtbi0yIC5idWktcmVnLW1pbnV0ZXMtdGV4dC1kYXRhIC5hdHQtZ2xvYmFsLWZvbnRzLWNvbnRlbnQtY29weSB7CisgIGxpbmUtaGVpZ2h0OiAxNXB4ICFpbXBvcnRhbnQ7Cit9CisuY2xlYXJmaXggeworICBjbGVhcjogYm90aDsKK30KKy5oZWFkZXItY3VzdG9tLWVycm9ySWNvbiB7CisgIGJhY2tncm91bmQ6IHVybCguLi9jb21tb24vaW1hZ2VzL2NvbW1vbi9mb3JtLXZhbGlkYXRpb24vcmVkLWVycm9yLWljb24ucG5nKSBuby1yZXBlYXQgIWltcG9ydGFudDsKKyAgaGVpZ2h0OiAxNHB4OworICB3aWR0aDogMTRweDsKKyAgcG9zaXRpb246IGFic29sdXRlOworICB0b3A6IDEwcHg7CisgIGxlZnQ6IDIwMHB4OworICB6LWluZGV4OiAxMDA7CisgIHBhZGRpbmctdG9wOiAxMnB4OworfQorLmhlYWRlci1jdXN0b20td2FybmluZ0ljb24geworICBiYWNrZ3JvdW5kOiB1cmwoLi4vaW1hZ2VzL2NvbW1vbi9mb3JtLXZhbGlkYXRpb24vb3JhbmdlLXdhcm5pbmctaWNvbi5wbmcpIG5vLXJlcGVhdCAhaW1wb3J0YW50OworICBjbGVhcjogYm90aDsKKyAgZGlzcGxheTogYmxvY2s7CisgIGZsb2F0OiBsZWZ0OworICBoZWlnaHQ6IDE0cHg7CisgIG1hcmdpbjogMTBweCAxMHB4IDBweCAxMHB4OworICB3aWR0aDogMTRweDsKKyAgei1pbmRleDogMTAwOworfQorLmhlYWRlci1sb2dpbi1lcnJvci1tc2ctYm94IHsKKyAgcG9zaXRpb246IHJlbGF0aXZlOworICBm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NHB4OworICB6LWluZGV4OiAxMDA7CisgIHBhZGRpbmc6IDhweCA1cHggN3B4IDVweCFpbXBvcnRhbnQ7CisgIGxpbmUtaGVpZ2h0OiAxNXB4OworICBjdXJzb3I6IGRlZmF1bHQ7CisgIG1hcmdpbi1sZWZ0OiAyNXB4OworICB0ZXh0LWFsaWduOiBjZW50ZXI7Cit9CisuYnVpLWdsb2JhbC1idG4geworICBib3gtc2l6aW5nOiBib3JkZXItYm94OworICAtbW96LWJveC1zaXppbmc6IGJvcmRlci1ib3g7CisgIGJhY2tncm91bmQtY29sb3I6ICM2NjY2NjY7CisgIGJvcmRlcjogMCBub25lOworICBib3JkZXItcmFkaXVzOiA2cHg7CisgIGNvbG9yOiAjRkZGRkZGICFpbXBvcnRhbnQ7CisgIGN1cnNvcjogcG9pbnRlcjsKKyAgZGlzcGxheTogaW5saW5lLWJsb2NrOworICBmb250LXNpemU6IDE0cHg7CisgIGxpbmUtaGVpZ2h0OiAxOworICBwb3NpdGlvbjogcmVsYXRpdmU7CisgIHRleHQtYWxpZ246IGNlbnRlcjsKKyAgdHJhbnNpdGlvbjogYmFja2dyb3VuZC1jb2xvciAwLjNzIGVhc2Utb3V0IDBzOworICB2ZXJ0aWNhbC1hbGlnbjogbWlkZGxlOworICBwYWRkaW5nOiA4cHggMjBweCA4cHggMjBweDsKKyAgaGVpZ2h0OiBhdXRvOworICB0ZXh0LWRlY29yYXRpb246IG5vbmUgIWltcG9ydGFudDsKKyAgdmFsaWduOiBtaWRkbGU7CisgIG91dGxpbmU6IG5vbmU7Cit9CisuYnVpLWdsb2JhbC1idG4tc21hbGwgeworICBoZWlnaHQ6IDMwcHggIWltcG9ydGFudDsKKyAgbWluLXdpZHRoOiA2MHB4OworfQorLmJ1aS1nbG9iYWwtYnRuLXByaW1hcnkgeworICBiYWNrZ3JvdW5kLWNvbG9yOiAjMDY3QUI0OworICBib3JkZXItY29sb3I6ICMzNTgwQkQ7CisgIGNvbG9yOiAjRkZGRkZGICFpbXB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cGxheTogYmxvY2s7Cit9CitzZWN0aW9uIHsKKwlkaXNwbGF5OiBibG9jazsKK30KK3N1bW1hcnkgeworCWRpc3BsYXk6IGJsb2NrOworfQorYXVkaW8geworCWRpc3BsYXk6IGlubGluZS1ibG9jazsKK30KK2NhbnZhcyB7CisJZGlzcGxheTogaW5saW5lLWJsb2NrOworfQordmlkZW8geworCWRpc3BsYXk6IGlubGluZS1ibG9jazsKK30KK2F1ZGlvOm5vdChbY29udHJvbHNdKSB7CisJaGVpZ2h0OiAwcHg7IGRpc3BsYXk6IG5vbmU7Cit9CitbaGlkZGVuXSB7CisJZGlzcGxheTogbm9uZTsKK30KK2h0bWwgeworCWZvbnQtc2l6ZTogMTAwJTsgLW1zLXRleHQtc2l6ZS1hZGp1c3Q6IDEwMCU7IC13ZWJraXQtdGV4dC1zaXplLWFkanVzdDogMTAwJTsKK30KK2h0bWwgeworCWZvbnQtZmFtaWx5OiBzYW5zLXNlcmlmOworfQorYnV0dG9uIHsKKwlmb250LWZhbWlseTogc2Fucy1zZXJpZjsKK30KK2lucHV0IHsKKwlmb250LWZhbWlseTogc2Fucy1zZXJpZjsKK30KK3NlbGVjdCB7CisJZm9udC1mYW1pbHk6IHNhbnMtc2VyaWY7Cit9Cit0ZXh0YXJlYSB7CisJZm9udC1mYW1pbHk6IHNhbnMtc2VyaWY7Cit9Citib2R5IHsKKwltYXJnaW46IDBweDsKK30KK2E6Zm9jdXMgeworCW91dGxpbmU6IGRvdHRlZCB0aGluOworfQorYTphY3RpdmUgeworCW91dGxpbmU6IDBweDsKK30KK2E6aG92ZXIgeworCW91dGxpbmU6IDBweDsKK30KK2gxIHsKKwltYXJnaW46IDAuNjdlbSAwcHg7IGZvbnQtc2l6ZTogMmVtOworfQoraDIgeworCW1hcmdpbjogMC44M2VtIDBweDsgZm9udC1zaXplOiAxLjVlbTsKK30KK2gzIHsKKwltYXJnaW46IDFlbSAwcHg7IGZvbnQtc2l6ZTogMS4xN2VtOworfQoraDQgeworCW1hcmdpbjogMS4zM2VtIDBweDsgZm9udC1zaXplOiAxZW07Cit9CitoNSB7CisJbWFyZ2luOiAxLjY3ZW0gMHB4OyBmb250LXNpemU6IDAuODNlbTsKK30KK2g2IHsKKwltYXJnaW46IDIuMzNlbSAwcHg7IGZvbnQtc2l6ZTogMC43NWVtOworfQorYWJiclt0aXRsZV0geworCWJvcmRlci1ib3R0b20tY29sb3I6IGN1cnJlbnRDb2xvcjsgYm9yZGVyLWJvdHRvbS13aWR0aDogMXB4OyBib3JkZXItYm90dG9tLXN0eWxlOiBkb3R0ZWQ7Cit9CitiIHsKKwlmb250LXdlaWdodDogYm9sZDsKK30KK3N0cm9uZyB7CisJZm9udC13ZWlnaHQ6IGJvbGQ7Cit9CitibG9ja3F1b3RlIHsKKwltYXJnaW46IDFlbSA0MHB4OworfQorZGZuIHsKKwlmb250LXN0eWxlOiBpdGFsaWM7Cit9CittYXJrIHsKKwliYWNrZ3JvdW5kOiByZ2IoMjU1LCAyNTUsIDApOyBjb2xvcjogcmdiKDAsIDAsIDApOworfQorcCB7CisJbWFyZ2luOiAxZW0gMHB4OworfQorcHJlIHsKKwltYXJnaW46IDFlbSAwcHg7Cit9Citjb2RlIHsKKwlmb250LWZhbWlseTogbW9ub3NwYWNlLCBzZXJpZjsgZm9udC1zaXplOiAxZW07IF9mb250LWZhbWlseTogImNvdXJpZXIgbmV3IiwgbW9ub3NwYWNlOworfQora2JkIHsKKwlmb250LWZhbWlseTogbW9ub3NwYWNlLCBzZXJpZjsgZm9udC1zaXplOiAxZW07IF9mb250LWZhbWlseTogImNvdXJpZXIgbmV3IiwgbW9ub3NwYWNlOworfQorcHJlIHsKKwlmb250LWZhbWlseTogbW9ub3NwYWNlLCBzZXJpZjsgZm9udC1zaXplOiAxZW07IF9mb250LWZhbWlseTogImNvdXJpZXIgbmV3IiwgbW9ub3NwYWNlOworfQorc2FtcCB7CisJZm9udC1mYW1pbHk6IG1vbm9zcGFjZSwgc2VyaWY7IGZvbnQtc2l6ZTogMWVtOyBfZm9udC1mYW1pbHk6ICJjb3VyaWVyIG5ldyIsIG1vbm9zcGFjZTsKK30KK3ByZSB7CisJd2hpdGUtc3BhY2U6IHByZS13cmFwOyAtbXMtd29yZC13cmFwOiBicmVhay13b3JkOworfQorcSB7CisJcXVvdGVzOiBub25lOworfQorcTo6YmVmb3JlIHsKKwljb250ZW50OiBub25lOworfQorcTo6YWZ0ZXIgeworCWNvbnRlbnQ6IG5vbmU7Cit9CitzbWFsbCB7CisJZm9udC1zaXplOiA4MCU7Cit9CitzdWIgeworCWxpbmUtaGVpZ2h0OiAwOyBmb250LXNpemU6IDc1JTsgdmVydGljYWwtYWxpZ246IGJhc2VsaW5lOyBwb3NpdGlvbjogcmVsYXRpdmU7Cit9CitzdXAgeworCWxpbmUtaGVpZ2h0OiAwOyBmb250LXNpemU6IDc1JTsgdmVydGljYWwtYWxpZ246IGJhc2VsaW5lOyBwb3NpdGlvbjogcmVsYXRpdmU7Cit9CitzdXAgeworCXRvcDogLTAuNWVtOworfQorc3ViIHsKKwlib3R0b206IC0wLjI1ZW07Cit9CitkbCB7CisJbWFyZ2luOiAxZW0gMHB4OworfQorbWVudSB7CisJbWFyZ2luOiAxZW0gMHB4OworfQorb2wgeworCW1hcmdpbjogMWVtIDBweDsKK30KK3VsIHsKKwltYXJnaW46IDFlbSAwcHg7Cit9CitkZCB7CisJbWFyZ2luOiAwcHggMHB4IDBweCA0MHB4OworfQorbWVudSB7CisJcGFkZGluZzogMHB4IDBweCAwcHggNDBweDsKK30KK29sIHsKKwlwYWRkaW5nOiAwcHggMHB4IDBweCA0MHB4OworfQordWwgeworCXBhZGRpbmc6IDBweCAwcHggMHB4IDQwcHg7Cit9CituYXYgdWwgeworCWxpc3Qtc3R5bGU6IG5vbmU7Cit9CituYXYgb2wgeworCWxpc3Qtc3R5bGU6IG5vbmU7Cit9CitpbWcgeworCWJvcmRlcjogMHB4IGN1cnJlbnRDb2xvcjsgLW1zLWludGVycG9sYXRpb24tbW9k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CisJbWFyZ2luLXRvcDogMzVweDsgbWFyZ2luLWJvdHRvbTogMzVweDsKK30KKy5idWktbS10Yi00MCB7CisJbWFyZ2luLXRvcDogNDBweDsgbWFyZ2luLWJvdHRvbTogNDBweDsKK30KKy5idWktbS10Yi00NSB7CisJbWFyZ2luLXRvcDogNDVweDsgbWFyZ2luLWJvdHRvbTogNDVweDsKK30KKy5idWktbS10Yi01MCB7CisJbWFyZ2luLXRvcDogNTBweDsgbWFyZ2luLWJvdHRvbTogNTBweDsKK30KKy5idWktbS10Yi01NSB7CisJbWFyZ2luLXRvcDogNTVweDsgbWFyZ2luLWJvdHRvbTogNTVweDsKK30KKy5idWktbS10Yi02MCB7CisJbWFyZ2luLXRvcDogNjBweDsgbWFyZ2luLWJvdHRvbTogNjBweDsKK30KKy5idWktbS10Yi02NSB7CisJbWFyZ2luLXRvcDogNjVweDsgbWFyZ2luLWJvdHRvbTogNjVweDsKK30KKy5idWktbS10Yi03MCB7CisJbWFyZ2luLXRvcDogNzBweDsgbWFyZ2luLWJvdHRvbTogNzBweDsKK30KKy5idWktbS10Yi03NSB7CisJbWFyZ2luLXRvcDogNzVweDsgbWFyZ2luLWJvdHRvbTogNzVweDsKK30KKy5idWktbS10Yi04MCB7CisJbWFyZ2luLXRvcDogODBweDsgbWFyZ2luLWJvdHRvbTogODBweDsKK30KKy5idWktbS10Yi04NSB7CisJbWFyZ2luLXRvcDogODVweDsgbWFyZ2luLWJvdHRvbTogODVweDsKK30KKy5idWktbS10Yi05MCB7CisJbWFyZ2luLXRvcDogOTBweDsgbWFyZ2luLWJvdHRvbTogOTBweDsKK30KKy5idWktbS10Yi05NSB7CisJbWFyZ2luLXRvcDogOTVweDsgbWFyZ2luLWJvdHRvbTogOTVweDsKK30KKy5idWktbS10Yi0xMDAgeworCW1hcmdpbi10b3A6IDEwMHB4OyBtYXJnaW4tYm90dG9tOiAxMDBweDsKK30KKy5idWktbS1sci01IHsKKwltYXJnaW4tcmlnaHQ6IDVweDsgbWF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yBtYXJnaW4tbGVmdDogNzVweDsKK30KKy5idWktbS1sci04MCB7CisJbWFyZ2luLXJpZ2h0OiA4MHB4OyBtYXJnaW4tbGVmdDogODBweDsKK30KKy5idWktbS1sci04NSB7CisJbWFyZ2luLXJpZ2h0OiA4NXB4OyBtYXJnaW4tbGVmdDogODVweDsKK30KKy5idWktbS1sci05MCB7CisJbWFyZ2luLXJpZ2h0OiA5MHB4OyBtYXJnaW4tbGVmdDogOTBweDsKK30KKy5idWktbS1sci05NSB7CisJbWFyZ2luLXJpZ2h0OiA5NXB4OyBtYXJnaW4tbGVmdDogOTVweDsKK30KKy5idWktbS1sci0xMDAgeworCW1hcmdpbi1yaWdodDogMTAwcHg7IG1hcmdpbi1sZWZ0OiAxMDBweDsKK30KKy5idWktbS10LTUgeworCW1hcmdpbi10b3A6IDVweDsKK30KKy5idWktbS10LTEwIHsKKwltYXJnaW4tdG9wOiAxMHB4OworfQorLmJ1aS1tLXQtMTUgeworCW1hcmdpbi10b3A6IDE1cHg7Cit9CisuYnVpLW0tdC0yMCB7CisJbWFyZ2luLXRvcDogMjBweDsKK30KKy5idWktbS10LTI1IHsKKwltYXJnaW4tdG9wOiAyNXB4OworfQorLmJ1aS1tLXQtMzAgeworCW1hcmdpbi10b3A6IDMwcHg7Cit9CisuYnVpLW0tdC0zNSB7CisJbWFyZ2luLXRvcDogMzVweDsKK30KKy5idWktbS10LTQwIHsKKwltYXJnaW4tdG9wOiA0MHB4OworfQorLmJ1aS1tLXQtNDUgeworCW1hcmdpbi10b3A6IDQ1cHg7Cit9CisuYnVpLW0tdC01MCB7CisJbWFyZ2luLXRvcDogNTBweDsKK30KKy5idWktbS10LTU1IHsKKwltYXJnaW4tdG9wOiA1NXB4OworfQorLmJ1aS1tLXQtNjAgeworCW1hcmdpbi10b3A6IDYwcHg7Cit9CisuYnVpLW0tdC02NSB7CisJbWFyZ2luLXRvcDogNjVweDsKK30KKy5idWktbS10LTcwIHsKKwltYXJnaW4tdG9wOiA3MHB4OworfQorLmJ1aS1tLXQtNzUgeworCW1hcmdpbi10b3A6IDc1cHg7Cit9CisuYnVpLW0tdC04MCB7CisJbWFyZ2luLXRvcDogODBweDsKK30KKy5idWktbS10LTg1IHsKKwltYXJnaW4tdG9wOiA4NXB4OworfQorLmJ1aS1tLXQtOTAgeworCW1hcmdpbi10b3A6IDkwcHg7Cit9CisuYnVpLW0tdC05NSB7CisJbWFyZ2luLXRvcDogOTVweDsKK30KKy5idWktbS10LTEwMCB7CisJbWFyZ2luLXRvcDogMTAwcHg7Cit9CisuYnVpLW0tdC0xMDUgeworCW1hcmdpbi10b3A6IDEwNXB4OworfQorLmJ1aS1tLXQtMTMwIHsKKwltYXJnaW4tdG9wOiAxMzBweDsKK30KKy5idWktbS1iLTUgeworCW1hcmdpbi1ib3R0b206IDVweDsKK30KKy5idWktbS1iLTEwIHsKKwltYXJnaW4tYm90dG9tOiAxMHB4OworfQorLmJ1aS1tLWItMTUgeworCW1hcmdpbi1ib3R0b206IDE1cHg7Cit9CisuYnVpLW0tYi0yMCB7CisJbWFyZ2luLWJvdHRvbTogMjBweDsKK30KKy5idWktbS1iLTI1IHsKKwltYXJnaW4tYm90dG9tOiAyNXB4OworfQorLmJ1aS1tLWItMzAgeworCW1hcmdpbi1ib3R0b206IDMwcHg7Cit9CisuYnVpLW0tYi0zNSB7CisJbWFyZ2luLWJvdHRvbTogMzVweDsKK30KKy5idWktbS1iLTQwIHsKKwltYXJnaW4tYm90dG9tOiA0MHB4OworfQorLmJ1aS1tLWItNDUgeworCW1hcmdpbi1ib3R0b206IDQ1cHg7Cit9CisuYnVpLW0tYi01MCB7CisJbWFyZ2luLWJvdHRvbTogNTBweDsKK30KKy5idWktbS1iLTU1IHsKKwltYXJnaW4tYm90dG9tOiA1NXB4OworfQorLmJ1aS1tLWItNjAgeworCW1hcmdpbi1ib3R0b206IDYwcHg7Cit9CisuYnVpLW0tYi02NSB7CisJbWFyZ2luLWJvdHRvbTogNjVweDsKK30KKy5idWktbS1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1aS1tLXItODAgeworCW1hcmdpbi1yaWdodDogODBweDsKK30KKy5idWktbS1yLTg1IHsKKwltYXJnaW4tcmlnaHQ6IDg1cHg7Cit9CisuYnVpLW0tci05MCB7CisJbWFyZ2luLXJpZ2h0OiA5MHB4OworfQorLmJ1aS1tLXItOTUgeworCW1hcmdpbi1yaWdodDogOTVweDsKK30KKy5idWktbS1yLTEwMCB7CisJbWFyZ2luLXJpZ2h0OiAxMDBweDsKK30KKy5idWktcC1hbGwtNSB7CisJcGFkZGluZzogNXB4OworfQorLmJ1aS1wLWFsbC0xMCB7CisJcGFkZGluZzogMTBweDsKK30KKy5idWktcC1hbGwtMTUgeworCXBhZGRpbmc6IDE1cHg7Cit9CisuYnVpLXAtYWxsLTIwIHsKKwlwYWRkaW5nOiAyMHB4OworfQorLmJ1aS1wLWFsbC0yNSB7CisJcGFkZGluZzogMjVweDsKK30KKy5idWktcC1hbGwtMzAgeworCXBhZGRpbmc6IDMwcHg7Cit9CisuYnVpLXAtYWxsLTM1IHsKKwlwYWRkaW5nOiAzNXB4OworfQorLmJ1aS1wLWFsbC00MCB7CisJcGFkZGluZzogNDBweDsKK30KKy5idWktcC1hbGwtNDUgeworCXBhZGRpbmc6IDQ1cHg7Cit9CisuYnVpLXAtYWxsLTUwIHsKKwlwYWRkaW5nOiA1MHB4OworfQorLmJ1aS1wLWFsbC01NSB7CisJcGFkZGluZzogNTVweDsKK30KKy5idWktcC1hbGwtNjAgeworCXBhZGRpbmc6IDYwcHg7Cit9CisuYnVpLXAtYWxsLTY1IHsKKwlwYWRkaW5nOiA2NXB4OworfQorLmJ1aS1wLWFsbC03MCB7CisJcGFkZGluZzogNzBweDsKK30KKy5idWktcC1hbGwtNzUgeworCXBhZGRpbmc6IDc1cHg7Cit9CisuYnVpLXAtYWxsLTgwIHsKKwlwYWRkaW5nOiA4MHB4OworfQorLmJ1aS1wLWFsbC04NSB7CisJcGFkZGluZzogODVweDsKK30KKy5idWktcC1hbGwtOTAgeworCXBhZ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4OworfQorLmJ1aS1wLWxyLTEwMCB7CisJcGFkZGluZy1yaWdodDogMTAwcHg7IHBhZGRpbmctbGVmdDogMTAwcHg7Cit9CisuYnVpLXAtdC01IHsKKwlwYWRkaW5nLXRvcDogNXB4OworfQorLmJ1aS1wLXQtMTAgeworCXBhZGRpbmctdG9wOiAxMHB4OworfQorLmJ1aS1wLXQtMTUgeworCXBhZGRpbmctdG9wOiAxNXB4OworfQorLmJ1aS1wLXQtMjAgeworCXBhZGRpbmctdG9wOiAyMHB4OworfQorLmJ1aS1wLXQtMjUgeworCXBhZGRpbmctdG9wOiAyNXB4OworfQorLmJ1aS1wLXQtMzAgeworCXBhZGRpbmctdG9wOiAzMHB4OworfQorLmJ1aS1wLXQtMzUgeworCXBhZGRpbmctdG9wOiAzNXB4OworfQorLmJ1aS1wLXQtNDAgeworCXBhZGRpbmctdG9wOiA0MHB4OworfQorLmJ1aS1wLXQtNDUgeworCXBhZGRpbmctdG9wOiA0NXB4OworfQorLmJ1aS1wLXQtNTAgeworCXBhZGRpbmctdG9wOiA1MHB4OworfQorLmJ1aS1wLXQtNTUgeworCXBhZGRpbmctdG9wOiA1NXB4OworfQorLmJ1aS1wLXQtNjAgeworCXBhZGRpbmctdG9wOiA2MHB4OworfQorLmJ1aS1wLXQtNjUgeworCXBhZGRpbmctdG9wOiA2NXB4OworfQorLmJ1aS1wLXQtNzAgeworCXBhZGRpbmctdG9wOiA3MHB4OworfQorLmJ1aS1wLXQtNzUgeworCXBhZGRpbmctdG9wOiA3NXB4OworfQorLmJ1aS1wLXQtODAgeworCXBhZGRpbmctdG9wOiA4MHB4OworfQorLmJ1aS1wLXQtODUgeworCXBhZGRpbmctdG9wOiA4NXB4OworfQorLmJ1aS1wLXQtOTAgeworCXBhZGRpbmctdG9wOiA5MHB4OworfQorLmJ1aS1wLXQtOTUgeworCXBhZGRpbmctdG9wOiA5NXB4OworfQorLmJ1aS1wLXQtMTAwIHsKKwlwYWRkaW5nLXRvcDogMTAwcHg7Cit9CisuYnVpLXAtYi01IHsKKwlwYWRkaW5nLWJvdHRvbTogNXB4OworfQorLmJ1aS1wLWItMTAgeworCXBhZGRpbmctYm90dG9tOiAxMHB4OworfQorLmJ1aS1wLWItMTEgeworCXBhZGRpbmctYm90dG9tOiAxMXB4OworfQorLmJ1aS1wLWItMTIgeworCXBhZGRpbmctYm90dG9tOiAxMnB4OworfQorLmJ1aS1wLWItMTMgeworCXBhZGRpbmctYm90dG9tOiAxM3B4OworfQorLmJ1aS1wLWItMTQgeworCXBhZGRpbmctYm90dG9tOiAxNHB4OworfQorLmJ1aS1wLWItMTUgeworCXBhZGRpbmctYm90dG9tOiAxNXB4OworfQorLmJ1aS1wLWItMjAgeworCXBhZGRpbmctYm90dG9tOiAyMHB4OworfQorLmJ1aS1wLWItMjUgeworCXBhZGRpbmctYm90dG9tOiAyNXB4OworfQorLmJ1aS1wLWItMzAgeworCXBhZGRpbmctYm90dG9tOiAzMHB4OworfQorLmJ1aS1wLWItMzUgeworCXBhZGRpbmctYm90dG9tOiAzNXB4OworfQorLmJ1aS1wLWItNDAgeworCXBhZGRpbmctYm90dG9tOiA0MHB4OworfQorLmJ1aS1wLWItNDUgeworCXBhZGRpbmctYm90dG9tOiA0NXB4OworfQorLmJ1aS1wLWItNTAgeworCXBhZGRpbmctYm90dG9tOiA1MHB4OworfQorLmJ1aS1wLWItNTUgeworCXBhZGRpbmctYm90dG9tOiA1NXB4OworfQorLmJ1aS1wLWItNjAgeworCXBhZGRpbmctYm90dG9tOiA2MHB4OworfQorLmJ1aS1wLWItNjUgeworCXBhZGRpbmctYm90dG9tOiA2NXB4OworfQorLmJ1aS1wLWItNzAgeworCXBhZGRpbmctYm90dG9tOiA3MHB4OworfQorLmJ1aS1wLWItNzUgeworCXBhZGRpbmctYm90dG9tOiA3NXB4OworfQorLmJ1aS1wLWItODAgeworCXBhZGRpbmctYm90dG9tOiA4MHB4OworfQorLmJ1aS1wLWItODUgeworCXBhZGRpbmctYm90dG9tOiA4NX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VpLXAtci05NSB7CisJcGFkZGluZy1yaWdodDogOTVweDsKK30KKy5idWktcC1yLTEwMCB7CisJcGFkZGluZy1yaWdodDogMTAwcHg7Cit9CisuYnVpLXctNS1wZXJjZW50IHsKKwl3aWR0aDogNSUgIWltcG9ydGFudDsKK30KKy5idWktdy0xMC1wZXJjZW50IHsKKwl3aWR0aDogMTAlICFpbXBvcnRhbnQ7Cit9CisuYnVpLXctMTEtcGVyY2VudCB7CisJd2lkdGg6IDExJSAhaW1wb3J0YW50OworfQorLmJ1aS13LTEyLXBlcmNlbnQgeworCXdpZHRoOiAxMiUgIWltcG9ydGFudDsKK30KKy5idWktdy0xMy1wZXJjZW50IHsKKwl3aWR0aDogMTMlICFpbXBvcnRhbnQ7Cit9CisuYnVpLXctMTQtcGVyY2VudCB7CisJd2lkdGg6IDE0JSAhaW1wb3J0YW50OworfQorLmJ1aS13LTE1LXBlcmNlbnQgeworCXdpZHRoOiAxNSUgIWltcG9ydGFudDsKK30KKy5idWktdy0yMC1wZXJjZW50IHsKKwl3aWR0aDogMjAlICFpbXBvcnRhbnQ7Cit9CisuYnVpLXctMjEtcGVyY2VudCB7CisJd2lkdGg6IDIxJSAhaW1wb3J0YW50OworfQorLmJ1aS13LTIyLXBlcmNlbnQgeworCXdpZHRoOiAyMiUgIWltcG9ydGFudDsKK30KKy5idWktdy0yMy1wZXJjZW50IHsKKwl3aWR0aDogMjMlICFpbXBvcnRhbnQ7Cit9CisuYnVpLXctMjQtcGVyY2VudCB7CisJd2lkdGg6IDI0JSAhaW1wb3J0YW50OworfQorLmJ1aS13LTI1LXBlcmNlbnQgeworCXdpZHRoOiAyNSUgIWltcG9ydGFudDsKK30KKy5idWktdy0zMC1wZXJjZW50IHsKKwl3aWR0aDogMzAlICFpbXBvcnRhbnQ7Cit9CisuYnVpLXctMzEtcGVyY2VudCB7CisJd2lkdGg6IDMxJSAhaW1wb3J0YW50OworfQorLmJ1aS13LTMyLXBlcmNlbnQgeworCXdpZHRoOiAzMiUgIWltcG9ydGFudDsKK30KKy5idWktdy0zMy1wZXJjZW50IHsKKwl3aWR0aDogMzMlICFpbXBvcnRhbnQ7Cit9CisuYnVpLXctMzQtcGVyY2VudCB7CisJd2lkdGg6IDM0JSAhaW1wb3J0YW50OworfQorLmJ1aS13LTM1LXBlcmNlbnQgeworCXdpZHRoOiAzNSUgIWltcG9ydGFudDsKK30KKy5idWktdy00MC1wZXJjZW50IHsKKwl3aWR0aDogNDAlICFpbXBvcnRhbnQ7Cit9CisuYnVpLXctNDUtcGVyY2VudCB7CisJd2lkdGg6IDQ1JSAhaW1wb3J0YW50OworfQorLmJ1aS13LTUwLXBlcmNlbnQgeworCXdpZHRoOiA1MCUgIWltcG9ydGFudDsKK30KKy5idWktdy01MS1wZXJjZW50IHsKKwl3aWR0aDogNTElICFpbXBvcnRhbnQ7Cit9CisuYnVpLXctNTItcGVyY2VudCB7CisJd2lkdGg6IDUyJSAhaW1wb3J0YW50OworfQorLmJ1aS13LTUzLXBlcmNlbnQgeworCXdpZHRoOiA1MyUgIWltcG9ydGFudDsKK30KKy5idWktdy01NC1wZXJjZW50IHsKKwl3aWR0aDogNTQlICFpbXBvcnRhbnQ7Cit9CisuYnVpLXctNTUtcGVyY2VudCB7CisJd2lkdGg6IDU1JSAhaW1wb3J0YW50OworfQorLmJ1aS13LTU2LXBlcmNlbnQgeworCXdpZHRoOiA1NiUgIWltcG9ydGFudDsKK30KKy5idWktdy01Ny1wZXJjZW50IHsKKwl3aWR0aDogNTclICFpbXBvcnRhbnQ7Cit9CisuYnVpLXctNTgtcGVyY2VudCB7CisJd2lkdGg6IDU4JSAhaW1wb3J0YW50OworfQorLmJ1aS13LTU5LXBlcmNlbnQgeworCXdpZHRoOiA1OSUgIWltcG9ydGFudDsKK30KKy5idWktdy02MC1wZXJjZW50IHsKKwl3aWR0aDogNjAlICFpbXBvcnRhbnQ7Cit9CisuYnVpLXctNjUtcGVyY2VudCB7CisJd2lkdGg6IDY1JSAhaW1wb3J0YW50O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yb3VuZC1wb3NpdGlvbjogLTIxNnB4IDBweDsKK30KKy5idWktaWNvbi1hcnJvdy1kLWhvdmVyIHsKKwliYWNrZ3JvdW5kLXBvc2l0aW9uOiAtMjE2cHggLTE4cHg7Cit9CisuYnVpLWljb24tY2hlY2sgeworCWJhY2tncm91bmQtcG9zaXRpb246IC0yNTJweCAwcHg7Cit9CisuYnVpLWljb24tY2hlY2staG92ZXIgeworCWJhY2tncm91bmQtcG9zaXRpb246IC0yNTJweCAtMThweDsKK30KKy5idWktaWNvbi1nZWFyIHsKKwliYWNrZ3JvdW5kLXBvc2l0aW9uOiAtMjg4cHggMHB4OworfQorLmJ1aS1pY29uLWdlYXItaG92ZXIgeworCWJhY2tncm91bmQtcG9zaXRpb246IC0yODhweCAtMThweDsKK30KKy5idWktaWNvbi1yZWZyZXNoIHsKKwliYWNrZ3JvdW5kLXBvc2l0aW9uOiAtMzI0cHggMHB4OworfQorLmJ1aS1pY29uLXJlZnJlc2gtaG92ZXIgeworCWJhY2tncm91bmQtcG9zaXRpb246IC0zMjRweCAtMThweDsKK30KKy5idWktaWNvbi1mb3J3YXJkIHsKKwliYWNrZ3JvdW5kLXBvc2l0aW9uOiAtMzYwcHggMHB4OworfQorLmJ1aS1pY29uLWZvcndhcmQtaG92ZXIgeworCWJhY2tncm91bmQtcG9zaXRpb246IC0zNjBweCAtMThweDsKK30KKy5idWktaWNvbi1iYWNrIHsKKwliYWNrZ3JvdW5kLXBvc2l0aW9uOiAtMzk2cHggMHB4OworfQorLmJ1aS1pY29uLWJhY2staG92ZXIgeworCWJhY2tncm91bmQtcG9zaXRpb246IC0zOTZweCAtMThweDsKK30KKy5idWktaWNvbi1ncmlkIHsKKwliYWNrZ3JvdW5kLXBvc2l0aW9uOiAtNDMycHggMHB4OworfQorLmJ1aS1pY29uLWdyaWQtaG92ZXIgeworCWJhY2tncm91bmQtcG9zaXRpb246IC00MzJweCAtMThweDsKK30KKy5idWktaWNvbi1zdGFyIHsKKwliYWNrZ3JvdW5kLXBvc2l0aW9uOiAtNDY4cHggMHB4OworfQorLmJ1aS1pY29uLXN0YXItaG92ZXIgeworCWJhY2tncm91bmQtcG9zaXRpb246IC00NjhweCAtMThweDsKK30KKy5idWktaWNvbi1hbGVydCB7CisJYmFja2dyb3VuZC1wb3NpdGlvbjogLTUwNHB4IDBweDsKK30KKy5idWktaWNvbi1hbGVydCB7CisJYmFja2dyb3VuZC1wb3NpdGlvbjogLTUwNHB4IC0xOHB4OworfQorLmJ1aS1pY29uLWluZm8geworCWJhY2tncm91bmQtcG9zaXRpb246IC01NDBweCAwcHg7Cit9CisuYnVpLWljb24taW5mby1ob3ZlciB7CisJYmFja2dyb3VuZC1wb3NpdGlvbjogLTU0MHB4IC0xOHB4OworfQorLmJ1aS1pY29uLWhvbWUgeworCWJhY2tncm91bmQtcG9zaXRpb246IC01NzZweCAwcHg7Cit9CisuYnVpLWljb24taG9tZS1ob3ZlciB7CisJYmFja2dyb3VuZC1wb3NpdGlvbjogLTU3NnB4IC0xOHB4OworfQorLmJ1aS1pY29uLXNlYXJjaCB7CisJYmFja2dyb3VuZC1wb3NpdGlvbjogLTYxMnB4IDBweDsKK30KKy5idWktaWNvbi1zZWFyY2hmaWVsZDo6YWZ0ZXIgeworCWJhY2tncm91bmQtcG9zaXRpb246IC02MTJweCAwcHg7Cit9CisuYnVpLWljb24tc2VhcmNoLWhvdmVyIHsKKwliYWNrZ3JvdW5kLXBvc2l0aW9uOiAtNjEycHggLTE4cHg7Cit9CisuYnVpLWljb24tc2VhcmNoZmllbGQ6OmFmdGVyIHsKKwliYWNrZ3JvdW5kLXBvc2l0aW9uOiAtNjEycHggLTE4cHg7Cit9CisuYnVpLWljb24tY2hlY2tib3gtb2ZmIHsKKwliYWNrZ3JvdW5kLXBvc2l0aW9uOiAtNjg0cHggMHB4OworfQorLmJ1aS1pY29uLWNoZWNrYm94LW9mZi1ob3ZlciB7CisJYmFja2dyb3VuZC1wb3NpdGlvbjogLTY4NHB4IC0xOHB4O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VfNTB4NTAucG5nIik7Cit9CisuYnVpLWljb24tZGItaG9tZSB7CisJCit9CisuYnVpLWljb24tZGItaG9tZS1ob3ZlciB7CisJYmFja2dyb3VuZC1wb3NpdGlvbjogMHB4IC01MXB4OworfQorLmJ1aS1pY29uLWRiLW1vYmlsaXR5IHsKKwliYWNrZ3JvdW5kLXBvc2l0aW9uOiAtNTFweCAwcHg7Cit9CisuYnVpLWljb24tZGItbW9iaWxpdHktaG92ZXIgeworCWJhY2tncm91bmQtcG9zaXRpb246IC01MXB4IC01MXB4OworfQorLmJ1aS1pY29uLWRiLWViaWxsaW5nIHsKKwliYWNrZ3JvdW5kLXBvc2l0aW9uOiAtMTAycHggMHB4OworfQorLmJ1aS1pY29uLWRiLWViaWxsaW5nLWhvdmVyIHsKKwliYWNrZ3JvdW5kLXBvc2l0aW9uOiAtMTAycHggLTUxcHg7Cit9CisuYnVpLWljb24tZGItbmV0d29yayB7CisJYmFja2dyb3VuZC1wb3NpdGlvbjogLTE1M3B4IDBweDsKK30KKy5idWktaWNvbi1kYi1uZXR3b3JrLWhvdmVyIHsKKwliYWNrZ3JvdW5kLXBvc2l0aW9uOiAtMTUzcHggLTUxcHg7Cit9CisuYnVpLWljb24tZGItYWN0aXZpdHkgeworCWJhY2tncm91bmQtcG9zaXRpb246IC0yMDRweCAwcHg7Cit9CisuYnVpLWljb24tZGItYWN0aXZpdHktaG92ZXIgeworCWJhY2tncm91bmQtcG9zaXRpb246IC0yMDRweCAtNTFweDsKK30KKy5idWktaWNvbi1kYi1tYXAgeworCWJhY2tncm91bmQtcG9zaXRpb246IC0yNTVweCAwcHg7Cit9CisuYnVpLWljb24tZGItbWFwLWhvdmVyIHsKKwliYWNrZ3JvdW5kLXBvc2l0aW9uOiAtMjU1cHggLTUxcHg7Cit9CisuYnVpLWljb24tZGItYW5hbHl0aWMgeworCWJhY2tncm91bmQtcG9zaXRpb246IC0zMDZweCAwcHg7Cit9CisuYnVpLWljb24tZGItYW5hbHl0aWMtaG92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Zm9yZSB7CisJY29udGVudDogIlxlNjBhIjsKK30KKy5pY29uLXVzZXItc21hbGw6OmJlZm9yZSB7CisJY29udGVudDogIlxlNjBiIjsKK30KKy5pY29uLXVzZXItb3V0bGluZTo6YmVmb3JlIHsKKwljb250ZW50OiAiXGU2MGMiOworfQorLmljb24tdXNlci1sYXJnZS1vdXRsaW5lOjpiZWZvcmUgeworCWNvbnRlbnQ6ICJcZTYwZCI7Cit9CisuaWNvbi11cGdyYWRlczo6YmVmb3JlIHsKKwljb250ZW50OiAiXGU2MGUiOworfQorLmljb24tdXBncmFkZXMtb3V0bGluZTo6YmVmb3JlIHsKKwljb250ZW50OiAiXGU2MGYiOworfQorLmljb24tdW5saW1pdGVkLW5pZ2h0cy13ZWVrZW5kcy1vdXRsaW5lOjpiZWZvcmUgeworCWNvbnRlbnQ6ICJcZTYxMCI7Cit9CisuaWNvbi11bmxpbWl0ZWQtbWludXRlcy1vdXRsaW5lOjpiZWZvcmUgeworCWNvbnRlbnQ6ICJcZTYxMSI7Cit9CisuaWNvbi11bmxpbWl0ZWQtbWVzc2FnaW5nLW91dGxpbmU6OmJlZm9yZSB7CisJY29udGVudDogIlxlNjEyIjsKK30KKy5pY29uLXVubGltaXRlZC1tMm0tb3V0bGluZTo6YmVmb3JlIHsKKwljb250ZW50OiAiXGU2MTMiOworfQorLmljb24tdW5saW1pdGVkLWNhbGxpbmc6OmJlZm9yZSB7CisJY29udGVudDogIlxlNjE0IjsKK30KKy5pY29uLXR2LXBhY2thZ2VzLW91dGxpbmU6OmJlZm9yZSB7CisJY29udGVudDogIlxlNjE1IjsKK30KKy5pY29uLXRyYXZlbC1taW51dGVzLW91dGxpbmU6OmJlZm9yZSB7CisJY29udGVudDogIlxlNjE2IjsKK30KKy5pY29uLXRyYXNoOjpiZWZvcmUgeworCWNvbnRlbnQ6ICJcZTYxNyI7Cit9CisuaWNvbi10b2xsZnJlZS1vdXRsaW5lOjpiZWZvcmUgeworCWNvbnRlbnQ6ICJcZTYxOCI7Cit9CisuaWNvbi10aWxlczo6YmVmb3JlIHsKKwljb250ZW50OiAiXGU2MTkiOworfQorLmljb24tdGlsZXMtc21hbGw6OmJlZm9yZSB7CisJY29udGVudDogIlxlNjFhIjsKK30KKy5pY29uLXRpY2tldHM6OmJlZm9yZSB7CisJY29udGVudDogIlxlNjFiIjsKK30KKy5pY29uLXRpY2tldHMtcmV0dXJuZWQ6OmJlZm9yZSB7CisJY29udGVudDogIlxlNjFjIjsKK30KKy5pY29uLXRpY2tldHMtcmVmZXJyZWQ6OmJlZm9yZSB7CisJY29udGVudDogIlxlNjFkIjsKK30KKy5pY29uLXRpY2tldHMtb3V0bGluZTo6YmVmb3JlIHsKKwljb250ZW50OiAiXGU2MWUiOworfQorLmljb24tdGlja2V0cy1vcGVuOjpiZWZvcmUgeworCWNvbnRlbnQ6ICJcZTYxZiI7Cit9CisuaWNvbi10aWNrZXRzLWVzY2FsYXRlOjpiZWZvcmUgeworCWNvbnRlbnQ6ICJcZTYyMCI7Cit9CisuaWNvbi10aWNrZXRzLWNvbnRlc3RlZDo6YmVmb3JlIHsKKwljb250ZW50OiAiXGU2MjEiOworfQorLmljb24tdGlja2V0cy1jbG9zZWQ6OmJlZm9yZSB7CisJY29udGVudDogIlxlNjIyIjsKK30KKy5pY29uLXRpY2tldHMtY2xlYXJlZDo6YmVmb3JlIHsKKwljb250ZW50OiAiXGU2MjMiOworfQorLmljb24tdGlja2V0cy1hcnF1aXZlZDo6YmVmb3JlIHsKKwljb250ZW50OiAiXGU2MjQiOworfQorLmljb24tdGlja2V0cy1hY3RpdmU6OmJlZm9yZSB7CisJY29udGVudDogIlxlNjI1IjsKK30KKy5pY29uLXRlY2huaWNhbC1zcGVjaWZpY2F0aW9uczo6YmVmb3JlIHsKKwljb250ZW50OiAiXGU2MjYiOworfQorLmljb24tdGVjaC1zdXBwb3J0OjpiZWZvcmUgeworCWNvbnRlbnQ6ICJcZTYyNyI7Cit9CisuaWNvbi10ZWNoLXN1cHBvcnQ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NhbC1zZWFyY2g6OmJlZm9yZSB7CisJY29udGVudDogIlxlNjg1IjsKK30KKy5pY29uLWxvY2FsLWxvbmctZGlzdGFuY2Utb3V0bGluZTo6YmVmb3JlIHsKKwljb250ZW50OiAiXGU2ODYiOworfQorLmljb24tbGlzdDo6YmVmb3JlIHsKKwljb250ZW50OiAiXGU2ODciOworfQorLmljb24tbGVhcm46OmJlZm9yZSB7CisJY29udGVudDogIlxlNjg4IjsKK30KKy5pY29uLWxlYXJuLW91dGxpbmU6OmJlZm9yZSB7CisJY29udGVudDogIlxlNjg5IjsKK30KKy5pY29uLWxhcHRvcDo6YmVmb3JlIHsKKwljb250ZW50OiAiXGU2OGEiOworfQorLmljb24tbGFuZGxpbmU6OmJlZm9yZSB7CisJY29udGVudDogIlxlNjhiIjsKK30KKy5pY29uLWxhbmRsaW5lLW91dGxpbmU6OmJlZm9yZSB7CisJY29udGVudDogIlxlNjhjIjsKK30KKy5pY29uLWludm9pY2VzOjpiZWZvcmUgeworCWNvbnRlbnQ6ICJcZTY4ZCI7Cit9CisuaWNvbi1pbnZvaWNlcy1vdXRsaW5lOjpiZWZvcmUgeworCWNvbnRlbnQ6ICJcZTY4ZSI7Cit9CisuaWNvbi1pbnZlbnRvcnk6OmJlZm9yZSB7CisJY29udGVudDogIlxlNjhmIjsKK30KKy5pY29uLWludHJhbmV0LW91dGxpbmU6OmJlZm9yZSB7CisJY29udGVudDogIlxlNjkwIjsKK30KKy5pY29uLWludGVycHJldGVyOjpiZWZvcmUgeworCWNvbnRlbnQ6ICJcZTY5MSI7Cit9CisuaWNvbi1pbnRlcnByZXRlci1vdXRsaW5lOjpiZWZvcmUgeworCWNvbnRlbnQ6ICJcZTY5MiI7Cit9CisuaWNvbi1pbnRlcm5ldDo6YmVmb3JlIHsKKwljb250ZW50OiAiXGU2OTMiOworfQorLmljb24taW50ZXJuZXQtb3V0bGluZTo6YmVmb3JlIHsKKwljb250ZW50OiAiXGU2OTQiOworfQorLmljb24taW50ZXJuZ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bGluZTo6YmVmb3JlIHsKKwljb250ZW50OiAiXGU2YTMiOworfQorLmljb24taG9tZTo6YmVmb3JlIHsKKwljb250ZW50OiAiXGU2YTQiOworfQorLmljb24taGVscDo6YmVmb3JlIHsKKwljb250ZW50OiAiXGU2YTUiOworfQorLmljb24taGVscC1vdXRsaW5lOjpiZWZvcmUgeworCWNvbnRlbnQ6ICJcZTZhNiI7Cit9CisuaWNvbi1oZDo6YmVmb3JlIHsKKwljb250ZW50OiAiXGU2YTciOworfQorLmljb24taGQtb3V0bGluZTo6YmVmb3JlIHsKKwljb250ZW50OiAiXGU2YTgiOworfQorLmljb24taGFtYnVyZ2VyOjpiZWZvcmUgeworCWNvbnRlbnQ6ICJcZTZhOSI7Cit9CisuaWNvbi1ncm91cC1vdXRsaW5lOjpiZWZvcmUgeworCWNvbnRlbnQ6ICJcZTZhYSI7Cit9CisuaWNvbi1ncHM6OmJlZm9yZSB7CisJY29udGVudDogIlxlNmFiIjsKK30KKy5pY29uLWdwcy1vdXRsaW5lOjpiZWZvcmUgeworCWNvbnRlbnQ6ICJcZTZhYyI7Cit9CisuaWNvbi1nby1wYXBlcmxlc3MtZW1haWwtb3V0bGluZTo6YmVmb3JlIHsKKwljb250ZW50OiAiXGU2YWQiOworfQorLmljb24tZ2xvYmFsLW1lc3NhZ2luZy1vdXRsaW5lOjpiZWZvcmUgeworCWNvbnRlbnQ6ICJcZTZhZSI7Cit9CisuaWNvbi1nYW1lcGFkLW91dGxpbmU6OmJlZm9yZSB7CisJY29udGVudDogIlxlNmFmIjsKK30KKy5pY29uLWdhbWUtZGV2aWNlczo6YmVmb3JlIHsKKwljb250ZW50OiAiXGU2YjAiOworfQorLmljb24tZnVsbC1zY3JlZW46OmJlZm9yZSB7CisJY29udGVudDogIlxlNmIxIjsKK30KKy5pY29uLWZvcndhcmQtY2FsbHMtb3V0bGluZTo6YmVmb3JlIHsKKwljb250ZW50OiAiXGU2YjIiOworfQorLmljb24tZm9ydW06OmJlZm9yZSB7C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ZW50OiAiXGU2ZDEiOworfQorLmljb24tY2lyY2xlLWFjdGlvbi1lbXB0eTo6YmVmb3JlIHsKKwljb250ZW50OiAiXGU2ZDIiOworfQorLmljb24tY2lyY2xlLWFjdGlvbi1kZWxldGUtb3V0bGluZTo6YmVmb3JlIHsKKwljb250ZW50OiAiXGU2ZDMiOworfQorLmljb24tY2lyY2xlLWFjdGlvbi1jbG9zZTo6YmVmb3JlIHsKKwljb250ZW50OiAiXGU2ZDQiOworfQorLmljb24tY2lyY2xlLWFjdGlvbi1jaGVjay1vdXRsaW5lOjpiZWZvcmUgeworCWNvbnRlbnQ6ICJcZTZkNSI7Cit9CisuaWNvbi1jaXJjbGUtYWN0aW9uLXJlbW92ZTo6YmVmb3JlIHsKKwljb250ZW50OiAiXGU2ZDYiOworfQorLmljb24tY2lyY2xlLWFjdGlvbi1hZGQ6OmJlZm9yZSB7CisJY29udGVudDogIlxlNmQ3IjsKK30KKy5pY29uLWNoaXAtb3V0bGluZTo6YmVmb3JlIHsKKwljb250ZW50OiAiXGU2ZDgiOworfQorLmljb24tY2hldnJvbi11cDo6YmVmb3JlIHsKKwljb250ZW50OiAiXGU2ZDkiOworfQorLmljb24tY2hldnJvbi1yaWdodDo6YmVmb3JlIHsKKwljb250ZW50OiAiXGU2ZGEiOworfQorLmljb24tY2hldnJvbi1sZWZ0OjpiZWZvcmUgeworCWNvbnRlbnQ6ICJcZTZkYiI7Cit9CisuaWNvbi1jaGV2cm9uLWRvd246OmJlZm9yZSB7CisJY29udGVudDogIlxlNmRjIjsKK30KKy5pY29uLWNoZWNrYm94LWNoZWNrbWFyazo6YmVmb3JlIHsKKwljb250ZW50OiAiXGU2ZGQiOworfQorLmljb24tY2hhdDo6YmVmb3JlIHsKKwljb250ZW50OiAiXGU2ZGUiOworfQorLmljb24tY2hhdC1zbWFsbDo6YmVmb3JlIHsKKwljb250ZW50OiAiXGU2ZGYiOworfQorLmljb24tY2FzZS1zdHVkaWVzOjpiZWZvcmUgeworCWNvb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6ICJcZTZlZiI7Cit9CisuaWNvbi1iaWxsaW5nLWhpc3Rvcnktb3V0bGluZTo6YmVmb3JlIHsKKwljb250ZW50OiAiXGU2ZjAiOworfQorLmljb24tYmlsbGluZy1kYXNoYm9hcmQ6OmJlZm9yZSB7CisJY29udGVudDogIlxlNmYxIjsKK30KKy5pY29uLWJkLW1hcHM6OmJlZm9yZSB7CisJY29udGVudDogIlxlNmYyIjsKK30KKy5pY29uLWJhc2ljcGhvbmU6OmJlZm9yZSB7CisJY29udGVudDogIlxlNmYzIjsKK30KKy5pY29uLWJhc2ljcGhvbmUtb3V0bGluZTo6YmVmb3JlIHsKKwljb250ZW50OiAiXGU2ZjQiOworfQorLmljb24tYmFyY29kZS1vdXRsaW5lOjpiZWZvcmUgeworCWNvbnRlbnQ6ICJcZTZmNSI7Cit9CisuaWNvbi1iYXItY2hhcnQtdmVydGljYWw6OmJlZm9yZSB7CisJY29udGVudDogIlxlNmY2IjsKK30KKy5pY29uLWJhci1jaGFydC1ob3Jpem9udGFsOjpiZWZvcmUgeworCWNvbnRlbnQ6ICJcZTZmNyI7Cit9CisuaWNvbi1hcnJvdy11cDo6YmVmb3JlIHsKKwljb250ZW50OiAiXGU2ZjgiOworfQorLmljb24tYXJyb3ctdXAtcmlnaHQ6OmJlZm9yZSB7CisJY29udGVudDogIlxlNmY5IjsKK30KKy5pY29uLWFycm93LXVwLWxlZnQ6OmJlZm9yZSB7CisJY29udGVudDogIlxlNmZhIjsKK30KKy5pY29uLWFycm93LXVwLWNpcmNsZTo6YmVmb3JlIHsKKwljb250ZW50OiAiXGU2ZmIiOworfQorLmljb24tYXJyb3ctcmlnaHQ6OmJlZm9yZSB7CisJY29udGVudDogIlxlNmZjIjsKK30KKy5pY29uLWFycm93LXJpZ2h0LWNpcmNsZTo6YmVmb3JlIHsKKwljb250ZW50OiAiXGU2ZmQiOworfQorLmljb24tYXJyb3ctbGVmdDo6YmVmb3JlIHsKKwljb250ZW50OiAiXGU2ZmUiOworfQorLmljb24tYXJyb3ctbGVmdC1jaXJjbGU6OmJlZm9yZSB7CisJY29udGVudDogIlxlNmZmIjsKK30KKy5pY29uLWFycm93LWRvd246OmJlZm9yZSB7CisJY29udGVudDogIlxlNzAwIjsKK30KKy5pY29uLWFycm93LWRvd24tcmlnaHQ6OmJlZm9yZSB7CisJY29udGVudDogIlxlNzAxIjsKK30KKy5pY29uLWFycm93LWRvd24tbGVmdDo6YmVmb3JlIHsKKwljb250ZW50OiAiXGU3MDIiOworfQorLmljb24tYXJyb3ctZG93bi1jaXJjbGU6OmJlZm9yZSB7CisJY29udGVudDogIlxlNzAzIjsKK30KKy5pY29uLWFycm93LWRvdWJsZS1yaWdodDo6YmVmb3JlIHsKKwljb250ZW50OiAiXGU3MDQiOworfQorLmljb24tYXJyb3ctZG91YmxlLWxlZnQ6OmJlZm9yZSB7CisJY29udGVudDogIlxlNzA1IjsKK30KKy5pY29uLWFwcHMtbWVkaWE6OmJlZm9yZSB7CisJY29udGVudDogIlxlNzA2IjsKK30KKy5pY29uLWFwcHMtbWVkaWEtb3V0bGluZTo6YmVmb3JlIHsKKwljb250ZW50OiAiXGU3MDciOworfQorLmljb24tYXBwcy1tYXJrZXRwbGFjZTo6YmVmb3JlIHsKKwljb250ZW50OiAiXGU3MDgiOworfQorLmljb24tYXBwcy1tYXJrZXRwbGFjZS1vdXRsaW5lOjpiZWZvcmUgeworCWNvbnRlbnQ6ICJcZTcwOSI7Cit9CisuaWNvbi1hbmFseXRpY3M6OmJlZm9yZSB7CisJY29udGVudDogIlxlNzBhIjsKK30KKy5pY29uLWFsdC1tZWRpYS1zdWJzY3JpcHRpb24tb3V0bGluZTo6YmVmb3JlIHsKKwljb250ZW50OiAiXGU3MGIiOworfQorLmljb24tYWxsLWxvY2F0aW9uczo6YmVmb3JlIHsKKwljb250ZW50OiAiXGU3MGMiOworfQorLmljb24tYWxsLWRldmljZXM6OmJlZm9yZSB7CisJY29udGVudDogIlxlNzBkIjsKK30KKy5pY29uLWFsbC1kZXZpY2VzLW91dGxpbmU6OmJlZm9yZSB7CisJY29udGVudDogIlxlNzBlIjsKK30KKy5pY29uLWFsYXJtczo6YmVmb3JlIHsKKwljb250ZW50OiAiXGU3MGYiOworfQorLmljb24tYWxhcm1zLW91dGxpbmU6OmJlZm9yZSB7CisJY29udGVudDogIlxlNzEwIjsKK30KKy5pY29uLWFkZHJlc3MtaXAtb3V0bGluZTo6YmVmb3JlIHsKKwljb250ZW50OiAiXGU3MTEiOworfQorLmljb24tYWRkb25zOjpiZWZvcmUgeworCWNvbnRlbnQ6ICJcZTcxMiI7Cit9CisuaWNvbi1hZGRvbnMtb3V0bGluZTo6YmVmb3JlIHsKKwljb250ZW50OiAiXGU3MTMiOworfQorLmljb24tYWRkaXRpb25hbC1zZXJ2aWNlczo6YmVmb3JlIHsKKwljb250ZW50OiAiXGU3MTQiOworfQorLmljb24tYWRkaXRpb25hbC1taW51dGVzLW91dGxpbmU6OmJlZm9yZSB7CisJY29udGVudDogIlxlNzE1IjsKK30KKy5pY29uLWFkZC13aWRnZXQ6OmJlZm9yZSB7CisJY29udGVudDogIlxlNzE2IjsKK30KKy5pY29uLWFjdGl2aXR5LWZlZWQ6OmJlZm9yZSB7CisJY29udGVudDogIlxlNzE3IjsKK30KKy5pY29uLWFjY2Vzc29yaWVzOjpiZWZvcmUgeworCWNvbnRlbnQ6ICJcZTcxOCI7Cit9CisuaWNvbi1hY2Nlc3Nvcmllcy1vdXRsaW5lOjpiZWZvcmUgeworCWNvbnRlbnQ6ICJcZTcxOSI7Cit9CisuaWNvbi1mb3VuZGF0aW9uLWFjY291bnQ6OmJlZm9yZSB7CisJY29udGVudDogIlxlNzFhIjsKK30KKy5pY29uLWJpbGxpbmctYWNjb3VudDo6YmVmb3JlIHsKKwljb250ZW50OiAiXGU3MWIiOworfQorLmljb24taW5maW5pdGU6OmJlZm9yZSB7CisJY29udGVudDogIlxlNzFjIjsKK30KKy5pY29uLXNvY2lhbC1idXNpbmVzcy1jb21tdW5p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30KKy5pY29uLXRlY2gtc3VwcG9ydDo6YmVmb3JlIHsKKwljb250ZW50OiAiXGU2MjciOworfQorLmljb24tdGVjaC1zdXBwb3J0LW91dGxpbmU6OmJlZm9yZSB7CisJY29udGVudDogIlxlNjI4IjsKK30KKy5pY29uLXRhYmxldDo6YmVmb3JlIHsKKwljb250ZW50OiAiXGU2MjkiOworfQorLmljb24tdGFibGV0LW91dGxpbmU6OmJlZm9yZSB7CisJY29udGVudDogIlxlNjJhIjsKK30KKy5pY29uLXN1cHBvcnQ6OmJlZm9yZSB7CisJY29udGVudDogIlxlNjJiIjsKK30KKy5pY29uLXN1cHBvcnQtb3V0bGluZTo6YmVmb3JlIHsKKwljb250ZW50OiAiXGU2MmMiOworfQorLmljb24tc3Rhcjo6YmVmb3JlIHsKKwljb250ZW50OiAiXGU2MmQiOworfQorLmljb24tc29ydDo6YmVmb3JlIHsKKwljb250ZW50OiAiXGU2MmUiOworfQorLmljb24tc29jaWFsLW91dGxpbmU6OmJlZm9yZSB7CisJY29udGVudDogIlxlNjJmIjsKK30KKy5pY29uLXNtYXJ0cGhvbmU6OmJlZm9yZSB7CisJY29udGVudDogIlxlNjMwIjsKK30KKy5pY29uLXNtYXJ0cGhvbmUtb3V0bGluZTo6YmVmb3JlIHsKKwljb250ZW50OiAiXGU2MzEiOworfQorLmljb24tc2lnbm91dC1vdXRsaW5lOjpiZWZvcmUgeworCWNvbnRlbnQ6ICJcZTYzMiI7Cit9CisuaWNvbi1zaWduLW91dDo6YmVmb3JlIHsKKwljb250ZW50OiAiXGU2MzMiOworfQorLmljb24tc2hvcDo6YmVmb3JlIHsKKwljb250ZW50OiAiXGU2MzQiOworfQorLmljb24tc2hvcC1vdXRsaW5lOjpiZWZvcmUgeworCWNvbnRlbnQ6ICJcZTYzNSI7Cit9CisuaWNvbi1zaGFyZWQtb3V0bGluZTo6YmVmb3JlIHsKKwljb250ZW50OiAiXGU2MzYiOworfQorLmljb24tc2hhcmVkLW1pbnV0ZXMtb3V0bGluZTo6YmVmb3JlIHsKKwljb250ZW50OiAiXGU2MzciOworfQorLmljb24tc2hhcmU6OmJlZm9yZSB7CisJY29udGVudDogIlxlNjM4IjsKK30KKy5pY29uLXNldHRpbmdzOjpiZWZvcmUgeworCWNvbnRlbnQ6ICJcZTYzOSI7Cit9CisuaWNvbi1zZW5kLWludm9pY2Utb3V0bGluZTo6YmVmb3JlIHsKKwljb250ZW50OiAiXGU2M2EiOworfQorLmljb24tc2VlLW1vcmU6OmJlZm9yZSB7CisJY29udGVudDogIlxlNjNiIjsKK30KKy5pY29uLXNlZS1sZXNzOjpiZWZvcmUgeworCWNvbnRlbnQ6ICJcZTYzYyI7Cit9CisuaWNvbi1zZWFyY2g6OmJlZm9yZSB7CisJY29udGVudDogIlxlNjNkIjsKK30KKy5pY29uLXNlYXJjaC1zbWFsbDo6YmVmb3JlIHsKKwljb250ZW50OiAiXGU2M2UiOworfQorLmljb24tc2NyZWVuLWNhbGxzLW91dGxpbmU6OmJlZm9yZSB7CisJY29udGVudDogIlxlNjNmIjsKK30KKy5pY29uLXNhdmUtdGltZS1vdXRsaW5lOjpiZWZvcmUgeworCWNvbnRlbnQ6ICJcZTY0MCI7Cit9CisuaWNvbi1zYWFzLWVuYWJsZW1lbnQtb3V0bGluZTo6YmVmb3JlIHsKKwljb250ZW50OiAiXGU2NDEiOworfQorLmljb24tcy1iZWFtOjpiZWZvcmUgeworCWNvbnRlbnQ6ICJcZTY0MiI7Cit9CisuaWNvbi1zLWJlYW0tb3V0bGluZTo6YmVmb3JlIHsKKwljb250ZW50OiAiXGU2NDMiOworfQorLmljb24tcm9sbG92ZXItb3V0bGluZTo6YmVmb3JlIHsKKwljb250ZW50OiAiXGU2NDQiOworfQorLmljb24tcm9sbG92ZXItbWludXRlczo6YmVmb3JlIHsKKwljb250ZW50OiAiXGU2NDUiOworfQorLmljb24tcmV2aWV3cy1vdXRsaW5lOjpiZWZvcmUgeworCWNvbnRlbnQ6ICJcZTY0NiI7Cit9Cisua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b3JlIHsKKwljb250ZW50OiAiXGU2NjYiOworfQorLmljb24tbm90aWZpY2F0aW9uczo6YmVmb3JlIHsKKwljb250ZW50OiAiXGU2NjciOworfQorLmljb24tbm90aWZpY2F0aW9ucy1vdXRsaW5lOjpiZWZvcmUgeworCWNvbnRlbnQ6ICJcZTY2OCI7Cit9CisuaWNvbi1ub3JtYWwtc2NyZWVuOjpiZWZvcmUgeworCWNvbnRlbnQ6ICJcZTY2OSI7Cit9CisuaWNvbi1uaWdodHMtd2Vla2VuZHMtb3V0bGluZTo6YmVmb3JlIHsKKwljb250ZW50OiAiXGU2NmEiOworfQorLmljb24tbmV3LXJlcXVlc3RzLW91dGxpbmU6OmJlZm9yZSB7CisJY29udGVudDogIlxlNjZiIjsKK30KKy5pY29uLW5ldHdvcms6OmJlZm9yZSB7CisJY29udGVudDogIlxlNjZjIjsKK30KKy5pY29uLW5ldHdvcmstZGFzaGJvYXJkOjpiZWZvcmUgeworCWNvbnRlbnQ6ICJcZTY2ZCI7Cit9CisuaWNvbi1uZXRib29rOjpiZWZvcmUgeworCWNvbnRlbnQ6ICJcZTY2ZSI7Cit9CisuaWNvbi1uZXRib29rLW91dGxpbmU6OmJlZm9yZSB7CisJY29udGVudDogIlxlNjZmIjsKK30KKy5pY29uLW11c2ljOjpiZWZvcmUgeworCWNvbnRlbnQ6ICJcZTY3MCI7Cit9CisuaWNvbi1tdXNpYy12aWRlbzo6YmVmb3JlIHsKKwljb250ZW50OiAiXGU2NzEiOworfQorLmljb24tbXVzaWMtdmlkZW8tb3V0bGluZTo6YmVmb3JlIHsKKwljb250ZW50OiAiXGU2NzIiOworfQorLmljb24tbXVzaWMtb3V0bGluZTo6YmVmb3JlIHsKKwljb250ZW50OiAiXGU2NzMiOworfQorLmljb24tbW9kZW06OmJlZm9yZSB7CisJY29udGVudDogIlxlNjc0IjsKK30KKy5pY29uLW1vZGVtLW91dGxpbmU6OmJlZm9yZSB7CisJY29udGVudDogIlxlNjc1IjsKK30KKy5pY29uLW1vYmlsZS1pbnN1cmFuY2U6OmJlZm9yZSB7CisJY29udGVudDogIlxlNjc2IjsKK30KKy5pY29uLW1vYmlsZS1pbnN1cmFuY2Utb3V0bGluZTo6YmVmb3JlIHsKKwljb250ZW50OiAiXGU2NzciOworfQorLmljb24tbW9iaWxlLTItbW9iaWxlLW91dGxpbmU6OmJlZm9yZSB7CisJY29udGVudDogIlxlNjc4IjsKK30KKy5pY29uLW1pc3NlZC1jYWxscy1vdXRsaW5lOjpiZWZvcmUgeworCWNvbnRlbnQ6ICJcZTY3OSI7Cit9CisuaWNvbi1taW51dGVzOjpiZWZvcmUgeworCWNvbnRlbnQ6ICJcZTY3YSI7Cit9CisuaWNvbi1taW51dGVzLW91dGxpbmU6OmJlZm9yZSB7CisJY29udGVudDogIlxlNjdiIjsKK30KKy5pY29uLW1lc3NhZ2luZzo6YmVmb3JlIHsKKwljb250ZW50OiAiXGU2N2MiOworfQorLmljb24tbWVzc2FnaW5nLXRvb2xraXQtb3V0bGluZTo6YmVmb3JlIHsKKwljb250ZW50OiAiXGU2N2QiOworfQorLmljb24tbWVzc2FnaW5nLW91dGxpbmU6OmJlZm9yZSB7CisJY29udGVudDogIlxlNjdlIjsKK30KKy5pY29uLW1lc3NhZ2luZy1lbWFpbDo6YmVmb3JlIHsKKwljb250ZW50OiAiXGU2N2YiOworfQorLmljb24tbWVzc2FnaW5nLWVtYWlsLW91dGxpbmU6OmJlZm9yZSB7CisJY29udGVudDogIlxlNjgwIjsKK30KKy5pY29uLW1lc3NhZ2Utc21hbGw6OmJlZm9yZSB7CisJY29udGVudDogIlxlNjgxIjsKK30KKy5pY29uLW1haW50ZW5hbmNlOjpiZWZvcmUgeworCWNvbnRlbnQ6ICJcZTY4MiI7Cit9CisuaWNvbi1sb2NhdGlvbi1waW46OmJlZm9yZSB7CisJY29udGVudDogIlxlNjgzIjsKK30KKy5pY29uLWxvY2F0aW9uLXBpbi1zbWFsbDo6YmVmb3JlIHsKKwljb250ZW50OiAiXG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29udGVudDogIlxlNjk0IjsKK30KKy5pY29uLWludGVybmV0LTI0LW91dGxpbmU6OmJlZm9yZSB7CisJY29udGVudDogIlxlNjk1IjsKK30KKy5pY29uLWludGVybmV0LTE4LW91dGxpbmU6OmJlZm9yZSB7CisJY29udGVudDogIlxlNjk2IjsKK30KKy5pY29uLWludGVybmF0aW9uYWwtb3V0bGluZTo6YmVmb3JlIHsKKwljb250ZW50OiAiXGU2OTciOworfQorLmljb24taW50ZXJuYXRpb25hbC1sb25nLWRpc3RhbmNlLW91dGxpbmU6OmJlZm9yZSB7CisJY29udGVudDogIlxlNjk4IjsKK30KKy5pY29uLWludGVybmF0aW9uYWwtZGF0YS1vdXRsaW5lOjpiZWZvcmUgeworCWNvbnRlbnQ6ICJcZTY5OSI7Cit9CisuaWNvbi1pbnN0YWxsYXRpb24tb3V0bGluZTo6YmVmb3JlIHsKKwljb250ZW50OiAiXGU2OWEiOworfQorLmljb24taW5mb3JtYXRpb246OmJlZm9yZSB7CisJY29udGVudDogIlxlNjliIjsKK30KKy5pY29uLWluZm8tc3VjY2Vzczo6YmVmb3JlIHsKKwljb250ZW50OiAiXGU2OWMiOworfQorLmljb24taW5mby1hbGVydDo6YmVmb3JlIHsKKwljb250ZW50OiAiXGU2OWQiOworfQorLmljb24taW5mby1hbGVydC1vdXRsaW5lOjpiZWZvcmUgeworCWNvbnRlbnQ6ICJcZTY5ZSI7Cit9CisuaWNvbi1pbmNsdWRlZC1jaGVja21hcms6OmJlZm9yZSB7CisJY29udGVudDogIlxlNjlmIjsKK30KKy5pY29uLWluY2x1ZGVkLWNoZWNrbWFyay1vdXRsaW5lOjpiZWZvcmUgeworCWNvbnRlbnQ6ICJcZTZhMCI7Cit9CisuaWNvbi1ob3RzcG90OjpiZWZvcmUgeworCWNvbnRlbnQ6ICJcZTZhMSI7Cit9CisuaWNvbi1ob3RzcG90LW91dGxpbmU6OmJlZm9yZSB7CisJY29udGVudDogIlxlNmEyIjsKK30KKy5pY29uLWhvdHNwb3QtYWNjZXNzLW91dGxpbmU6OmJlZm9yZSB7CisJY29udGVudDogIlxlNmEzIjsKK30KKy5pY29uLWhvbWU6OmJlZm9yZSB7CisJY29udGVudDogIlxlNmE0IjsKK30KKy5pY29uLWhlbHA6OmJlZm9yZSB7CisJY29udGVudDogIlxlNmE1IjsKK30KKy5pY29uLWhlbHAtb3V0bGluZTo6YmVmb3JlIHsKKwljb250ZW50OiAiXGU2YTYiOworfQorLmljb24taGQ6OmJlZm9yZSB7CisJY29udGVudDogIlxlNmE3IjsKK30KKy5pY29uLWhkLW91dGxpbmU6OmJlZm9yZSB7CisJY29udGVudDogIlxlNmE4IjsKK30KKy5pY29uLWhhbWJ1cmdlcjo6YmVmb3JlIHsKKwljb250ZW50OiAiXGU2YTkiOworfQorLmljb24tZ3JvdXAtb3V0bGluZTo6YmVmb3JlIHsKKwljb250ZW50OiAiXGU2YWEiOworfQorLmljb24tZ3BzOjpiZWZvcmUgeworCWNvbnRlbnQ6ICJcZTZhYiI7Cit9CisuaWNvbi1ncHMtb3V0bGluZTo6YmVmb3JlIHsKKwljb250ZW50OiAiXGU2YWMiOworfQorLmljb24tZ28tcGFwZXJsZXNzLWVtYWlsLW91dGxpbmU6OmJlZm9yZSB7CisJY29udGVudDogIlxlNmFkIjsKK30KKy5pY29uLWdsb2JhbC1tZXNzYWdpbmctb3V0bGluZTo6YmVmb3JlIHsKKwljb250ZW50OiAiXGU2YWUiOworfQorLmljb24tZ2FtZXBhZC1vdXRsaW5lOjpiZWZvcmUgeworCWNvbnRlbnQ6ICJcZTZhZiI7Cit9CisuaWNvbi1nYW1lLWRldmljZXM6OmJlZm9yZSB7CisJY29udGVudDogIlxlNmIwIjsKK30KKy5pY29uLWZ1bGwtc2NyZWVuOjpiZWZvcmUgeworCWNvbnRlbnQ6ICJcZTZiMSI7Cit9CisuaWNvbi1mb3J3YXJkLWNhbGxzLW91dGxpbmU6OmJlZm9yZSB7CisJY29udGVudDogIlxlNmIyIjsKK30KKy5pY29uLWZvcnVtOjpiZWZvcmUgeworCWNvbnRlbnQ6ICJcZTZiMyI7Cit9CisuaWNvbi1mb3J1bS1vdXRsaW5lOjpiZWZvcmUgeworCWNvbnRlbnQ6ICJcZTZiNCI7Cit9CisuaWNvbi1maWx0ZXI6OmJlZm9yZSB7CisJY29udGVudDogIlxlNmI1IjsKK30KKy5pY29uLWV4dHJhczo6YmVmb3JlIHsKKwljb250ZW50OiAiXGU2YjYiOworfQorLmljb24tZXh0cmFzLW91dGxpbmU6OmJlZm9yZSB7CisJY29udGVudDogIlxlNmI3IjsKK30KKy5pY29uLWVyYXNlOjpiZWZvcmUgeworCWNvbnRlbnQ6ICJcZTZiOCI7Cit9CisuaWNvbi1lbnZlbG9wZTo6YmVmb3JlIHsKKwljb250ZW50OiAiXGU2YjkiOworfQorLmljb24tZW52ZWxvcGUtb3V0bGluZTo6YmVmb3JlIHsKKwljb250ZW50OiAiXGU2YmEiOworfQorLmljb24tZW50ZXJwcmlzZS1tZXNzYWdpbmctb3V0bGluZTo6YmVmb3JlIHsKKwljb250ZW50OiAiXGU2YmIiOworfQorLmljb24tZWRpdDo6YmVmb3JlIHsKKwljb250ZW50OiAiXGU2YmMiOworfQorLmljb24tZHVwbGljYXRlOjpiZWZvcmUgeworCWNvbnRlbnQ6ICJcZTZiZCI7Cit9CisuaWNvbi1kcm9wZG93bi11cDo6YmVmb3JlIHsKKwljb250ZW50OiAiXGU2YmUiOworfQorLmljb24tZHJvcGRvd24tZG93bjo6YmVmb3JlIHsKKwljb250ZW50OiAiXGU2YmYiOworfQorLmljb24tZG93bmxvYWQ6OmJlZm9yZSB7CisJY29udGVudDogIlxlNmMwIjsKK30KKy5pY29uLWRvd25sb2FkLW91dGxpbmU6OmJlZm9yZSB7CisJY29udGVudDogIlxlNmMxIjsKK30KKy5pY29uLWRpc3B1dGVzOjpiZWZvcmUgeworCWNvbnRlbnQ6ICJcZTZjMiI7Cit9CisuaWNvbi1kZXRhaWxlZC1iaWxsaW5nOjpiZW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B7CisJY29udGVudDogIlxlNmQxIjsKK30KKy5pY29uLWNpcmNsZS1hY3Rpb24tZW1wdHk6OmJlZm9yZSB7CisJY29udGVudDogIlxlNmQyIjsKK30KKy5pY29uLWNpcmNsZS1hY3Rpb24tZGVsZXRlLW91dGxpbmU6OmJlZm9yZSB7CisJY29udGVudDogIlxlNmQzIjsKK30KKy5pY29uLWNpcmNsZS1hY3Rpb24tY2xvc2U6OmJlZm9yZSB7CisJY29udGVudDogIlxlNmQ0IjsKK30KKy5pY29uLWNpcmNsZS1hY3Rpb24tY2hlY2stb3V0bGluZTo6YmVmb3JlIHsKKwljb250ZW50OiAiXGU2ZDUiOworfQorLmljb24tY2lyY2xlLWFjdGlvbi1yZW1vdmU6OmJlZm9yZSB7CisJY29udGVudDogIlxlNmQ2IjsKK30KKy5pY29uLWNpcmNsZS1hY3Rpb24tYWRkOjpiZWZvcmUgeworCWNvbnRlbnQ6ICJcZTZkNyI7Cit9CisuaWNvbi1jaGlwLW91dGxpbmU6OmJlZm9yZSB7CisJY29udGVudDogIlxlNmQ4IjsKK30KKy5pY29uLWNoZXZyb24tdXA6OmJlZm9yZSB7CisJY29udGVudDogIlxlNmQ5IjsKK30KKy5pY29uLWNoZXZyb24tcmlnaHQ6OmJlZm9yZSB7CisJY29udGVudDogIlxlNmRhIjsKK30KKy5pY29uLWNoZXZyb24tbGVmdDo6YmVmb3JlIHsKKwljb250ZW50OiAiXGU2ZGIiOworfQorLmljb24tY2hldnJvbi1kb3duOjpiZWZvcmUgeworCWNvbnRlbnQ6ICJcZTZkYyI7Cit9CisuaWNvbi1jaGVja2JveC1jaGVja21hcms6OmJlZm9yZSB7CisJY29udGVudDogIlxlNmRkIjsKK30KKy5pY29uLWNoYXQ6OmJlZm9yZSB7CisJY29udGVudDogIlxlNmRlIjsKK30KKy5pY29uLWNoYXQtc21hbGw6OmJlZm9yZSB7CisJY29udGVudDogIlxlNmRmIjsKK30KKy5pY29uLWNhc2Utc3R1ZGllczo6YmVmb3JlIHsKKwljb250ZW50OiAiXGU2ZTAiOworfQorLmljb24tY2FydDo6YmVmb3JlIHsKKwljb250ZW50OiAiXGU2ZTEiOworfQorLmljb24tY2FydC1zbWFsbDo6YmVmb3JlIHsKKwljb250ZW50OiAiXGU2ZTIiOworfQorLmljb24tY2FtZXJhOjpiZWZvcmUgeworCWNvbnRlbnQ6ICJcZTZlMyI7Cit9CisuaWNvbi1jYW1lcmEtb3V0bGluZTo6YmVmb3JlIHsKKwljb250ZW50OiAiXGU2ZTQiOworfQorLmljb24tY2FsZW5kYXItb3V0bGluZTo6YmVmb3JlIHsKKwljb250ZW50OiAiXGU2ZTUiOworfQorLmljb24tYnVzaW5lc3M6OmJlZm9yZSB7CisJY29udGVudDogIlxlNmU2IjsKK30KKy5pY29uLWJ1c2luZXNzLXR2OjpiZWZvcmUgeworCWNvbnRlbnQ6ICJcZTZlNyI7Cit9CisuaWNvbi1idXNpbmVzcy10di1vdXRsaW5lOjpiZWZvcmUgeworCWNvbnRlbnQ6ICJcZTZlOCI7Cit9CisuaWNvbi1idXNpbmVzcy10di1hZGRpdGlvbmFsLXBhY2tzLW91dGxpbmU6OmJlZm9yZSB7CisJY29udGVudDogIlxlNmU5IjsKK30KKy5pY29uLWJ1c2luZXNzLW91dGxpbmU6OmJlZm9yZSB7CisJY29udGVudDogIlxlNmVhIjsKK30KKy5pY29uLWJ1c2luZXNzLWNlbnRlcjo6YmVmb3JlIHsKKwljb250ZW50OiAiXGU2ZWIiOworfQorLmljb24tYnVzaW5lc3MtY2VudGVyLW91dGxpbmU6OmJlZm9yZSB7CisJY29udGVudDogIlxlNmVjIjsKK30KKy5pY29uLWJ1bmRsZXM6OmJlZm9yZSB7CisJY29udGVudDogIlxlNmVkIjsKK30KKy5pY29uLWJ1bmRsZXMtb3V0bGluZTo6YmVmb3JlIHsKKwljb250ZW50OiAiXGU2ZWUiOworfQorLmljb24tYmlsbGluZzo6YmVmb3JlIHsKKwljb250ZW50OiAiXGU2ZWYiOworfQorL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b2xvciB7CisJYmFja2dyb3VuZC1jb2xvcjogcmdiKDI0MiwgMjQyLCAyNDIpOworfQorLmJ1aS1jb250ZW50LWJhY2tncm91bmQtY29sb3IgeworCWJhY2tncm91bmQtY29sb3I6IHJnYigyNTUsIDI1NSwgMjU1KTsKK30KKy5idWktZm9udC10aXRsZSB7CisJZm9udC1mYW1pbHk6ICJjbGVhcnZpZXdhdHQiOyBmb250LXdlaWdodDogYm9sZDsKK30KKy5idWktZm9udC1zdWJ0aXRsZSB7CisJZm9udC1mYW1pbHk6ICJjbGVhcnZpZXdhdHQiOyBmb250LXdlaWdodDogYm9sZDsKK30KKy5idWktbGV0dGVyLXNwYWNlIHsKKwlsZXR0ZXItc3BhY2luZzogM3B4ICFpbXBvcnRhbnQ7Cit9CisuYnVpLWgxLXNpemUgeworCWZvbnQtc2l6ZTogNDJweDsKK30KKy5idWktaDItc2l6ZSB7CisJZm9udC1zaXplOiAzMHB4OworfQorLmJ1aS1oMy1zaXplIHsKKwlmb250LXNpemU6IDIxcHg7Cit9CisuYnVpLWg0LXNpemUgeworCWZvbnQtc2l6ZTogMTVweDsKK30KKy5idWktaDUtc2l6ZSB7CisJZm9udC1zaXplOiAxM3B4OworfQorLmJ1aS1oNi1zaXplIHsKKwlmb250LXNpemU6IDExcHg7Cit9CisuYnVpLWYxMC1zaXplIHsKKwlmb250LXNpemU6IDEwcHg7Cit9CisuYnVpLWYxMS1zaXplIHsKKwlmb250LXNpemU6IDExcHg7Cit9CisuYnVpLWYxMi1zaXplIHsKKwlmb250LXNpemU6IDEycHg7Cit9CisuYnVpLWYxNC1zaXplIHsKKwlmb250LXNpemU6IDE0cHg7Cit9CisuYnVpLWYxNi1zaXplIHsKKwlmb250LXNpemU6IDE2cHg7Cit9CisuYnVpLWYxOC1zaXplIHsKKwlmb250LXNpemU6IDE4cHg7Cit9CisuYnVpLWYyMC1zaXplIHsKKwlmb250LXNpemU6IDIwcHg7Cit9CisuYnVpLWYyNi1zaXplIHsKKwlmb250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bXMtdGV4dC1zaXplLWFkanVzdDogMTAwJTsgLXdlYmtpdC10ZXh0LXNpemUtYWRqdXN0OiAxMDAlOworfQoraHRtbCB7CisJZm9udC1mYW1pbHk6IHNhbnMtc2VyaWY7Cit9CitidXR0b24geworCWZvbnQtZmFtaWx5OiBzYW5zLXNlcmlmOworfQoraW5wdXQgeworCWZvbnQtZmFtaWx5OiBzYW5zLXNlcmlmOworfQorc2VsZWN0IHsKKwlmb250LWZhbWlseTogc2Fucy1zZXJpZjsKK30KK3RleHRhcmVhIHsKKwlmb250LWZhbWlseTogc2Fucy1zZXJpZjsKK30KK2JvZHkgeworCW1hcmdpbjogMHB4OworfQorYTpmb2N1cyB7CisJb3V0bGluZTogZG90dGVkIHRoaW47Cit9CithOmFjdGl2ZSB7CisJb3V0bGluZTogMHB4OworfQorYTpob3ZlciB7CisJb3V0bGluZTogMHB4OworfQoraDEgeworCW1hcmdpbjogMC42N2VtIDBweDsgZm9udC1zaXplOiAyZW07Cit9CitoMiB7CisJbWFyZ2luOiAwLjgzZW0gMHB4OyBmb250LXNpemU6IDEuNWVtOworfQoraDMgeworCW1hcmdpbjogMWVtIDBweDsgZm9udC1zaXplOiAxLjE3ZW07Cit9CitoNCB7CisJbWFyZ2luOiAxLjMzZW0gMHB4OyBmb250LXNpemU6IDFlbTsKK30KK2g1IHsKKwltYXJnaW46IDEuNjdlbSAwcHg7IGZvbnQtc2l6ZTogMC44M2VtOworfQoraDYgeworCW1hcmdpbjogMi4zM2VtIDBweDsgZm9udC1zaXplOiAwLjc1ZW07Cit9CithYmJyW3RpdGxlXSB7CisJYm9yZGVyLWJvdHRvbS1jb2xvcjogY3VycmVudENvbG9yOyBib3JkZXItYm90dG9tLXdpZHRoOiAxcHg7IGJvcmRlci1ib3R0b20tc3R5bGU6IGRvdHRlZDsKK30KK2IgeworCWZvbnQtd2VpZ2h0OiBib2xkOworfQorc3Ryb25nIHsKKwlmb250LXdlaWdodDogYm9sZDsKK30KK2Jsb2NrcXVvd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gtc2l6aW5nOiBib3JkZXItYm94OworfQoraW5wdXRbdHlwZT0nc2VhcmNoJ10geworCWJveC1zaXppbmc6IGNvbnRlbnQtYm94OyAtd2Via2l0LWJveC1zaXppbmc6IGNvbnRlbnQtYm94OyAtbW96LWJveC1zaXppbmc6IGNvbnRlbnQtYm94OyAtd2Via2l0LWFwcGVhcmFuY2U6IHRleHRmaWVsZDsKK30KK3RleHRhcmVhIHsKKwlvdmVyZmxvdzogYXV0bzsgdmVydGljYWwtYWxpZ246IHRvcDsKK30KK3RhYmxlIHsKKwlib3JkZXItY29sbGFwc2U6IGNvbGxhcHNlOyBib3JkZXItc3BhY2luZzogMDsKK30KKy5idWktbS1hbGwtNSB7CisJbWFyZ2luOiA1cHg7Cit9CisuYnVpLW0tYWxsLTEwIHsKKwltYXJnaW46IDEwcHg7Cit9CisuYnVpLW0tYWxsLTE1IHsKKwltYXJnaW46IDE1cHg7Cit9CisuYnVpLW0tYWxsLTIwIHsKKwltYXJnaW46IDIwcHg7Cit9CisuYnVpLW0tYWxsLTI1IHsKKwltYXJnaW46IDI1cHg7Cit9CisuYnVpLW0tYWxsLTMwIHsKKwltYXJnaW46IDMwcHg7Cit9CisuYnVpLW0tYWxsLTM1IHsKKwltYXJnaW46IDM1cHg7Cit9CisuYnVpLW0tYWxsLTQwIHsKKwltYXJnaW46IDQwcHg7Cit9CisuYnVpLW0tYWxsLTQ1IHsKKwltYXJnaW46IDVweDsKK30KKy5idWktbS1hbGwtNTAgeworCW1hcmdpbjogNTBweDsKK30KKy5idWktbS1hbGwtNTUgeworCW1hcmdpbjogNTVweDsKK30KKy5idWktbS1hbGwtNjAgeworCW1hcmdpbjogNjBweDsKK30KKy5idWktbS1hbGwtNjUgeworCW1hcmdpbjogNjVweDsKK30KKy5idWktbS1hbGwtNzAgeworCW1hcmdpbjogNzBweDsKK30KKy5idWktbS1hbGwtNzUgeworCW1hcmdpbjogNzVweDsKK30KKy5idWktbS1hbGwtODAgeworCW1hcmdpbjogODBwe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k1IHsKKwltYXJnaW4tdG9wOiA5NXB4OworfQorLmJ1aS1tLXQtMTAwIHsKKwltYXJnaW4tdG9wOiAxMDBweDsKK30KKy5idWktbS10LTEwNSB7CisJbWFyZ2luLXRvcDogMTA1cHg7Cit9CisuYnVpLW0tdC0xMzAgeworCW1hcmdpbi10b3A6IDEzMHB4OworfQorLmJ1aS1tLWItNSB7CisJbWFyZ2luLWJvdHRvbTogNXB4OworfQorLmJ1aS1tLWItMTAgeworCW1hcmdpbi1ib3R0b206IDEwcHg7Cit9CisuYnVpLW0tYi0xNSB7CisJbWFyZ2luLWJvdHRvbTogMTVweDsKK30KKy5idWktbS1iLTIwIHsKKwltYXJnaW4tYm90dG9tOiAyMHB4OworfQorLmJ1aS1tLWItMjUgeworCW1hcmdpbi1ib3R0b206IDI1cHg7Cit9CisuYnVpLW0tYi0zMCB7CisJbWFyZ2luLWJvdHRvbTogMzBweDsKK30KKy5idWktbS1iLTM1IHsKKwltYXJnaW4tYm90dG9tOiAzNXB4OworfQorLmJ1aS1tLWItNDAgeworCW1hcmdpbi1ib3R0b206IDQwcHg7Cit9CisuYnVpLW0tYi00NSB7CisJbWFyZ2luLWJvdHRvbTogNDVweDsKK30KKy5idWktbS1iLTUwIHsKKwltYXJnaW4tYm90dG9tOiA1MHB4OworfQorLmJ1aS1tLWItNTUgeworCW1hcmdpbi1ib3R0b206IDU1cHg7Cit9CisuYnVpLW0tYi02MCB7CisJbWFyZ2luLWJvdHRvbTogNjBweDsKK30KKy5idWktbS1iLTY1IHsKKwltYXJnaW4tYm90dG9tOiA2NXB4OworfQorLmJ1aS1tLWItNzAgeworCW1hcmdpbi1ib3R0b206IDcwcHg7Cit9CisuYnVpLW0tYi03NSB7CisJbWFyZ2luLWJvdHRvbTogNzVweDsKK30KKy5idWktbS1iLTgwIHsKKwltYXJnaW4tYm90dG9tOiA4MHB4OworfQorLmJ1aS1tLWItODUgeworCW1hcmdpbi1ib3R0b206IDg1cHg7Cit9CisuYnVpLW0tYi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ib3R0b206IDVweDsKK30KKy5idWktcC10Yi0xMCB7CisJcGFkZGluZy10b3A6IDEwcHg7IHBhZGRpbmctYm90dG9tOiAxMHB4OworfQorLmJ1aS1wLXRiLTE1IHsKKwlwYWRkaW5nLXRvcDogMTVweDsgcGFkZGluZy1ib3R0b206IDE1cHg7Cit9CisuYnVpLXAtdGItMjAgeworCXBhZGRpbmctdG9wOiAyMHB4OyBwYWRkaW5nLWJvdHRvbTogMjBweDsKK30KKy5idWktcC10Yi0yNSB7CisJcGFkZGluZy10b3A6IDI1cHg7IHBhZGRpbmctYm90dG9tOiAyNXB4OworfQorLmJ1aS1wLXRiLTMwIHsKKwlwYWRkaW5nLXRvcDogMzBweDsgcGFkZGluZy1ib3R0b206IDMwcHg7Cit9CisuYnVpLXAtdGItMzUgeworCXBhZGRpbmctdG9wOiAzNXB4OyBwYWRkaW5nLWJvdHRvbTogMzVweDsKK30KKy5idWktcC10Yi00MCB7CisJcGFkZGluZy10b3A6IDQwcHg7IHBhZGRpbmctYm90dG9tOiA0MHB4OworfQorLmJ1aS1wLXRiLTQ1IHsKKwlwYWRkaW5nLXRvcDogNDVweDsgcGFkZGluZy1ib3R0b206IDQ1cHg7Cit9CisuYnVpLXAtdGItNTAgeworCXBhZGRpbmctdG9wOiA1MHB4OyBwYWRkaW5nLWJvdHRvbTogNTBweDsKK30KKy5idWktcC10Yi01NSB7CisJcGFkZGluZy10b3A6IDU1cHg7IHBhZGRpbmctYm90dG9tOiA1NXB4OworfQorLmJ1aS1wLXRiLTYwIHsKKwlwYWRkaW5nLXRvcDogNjBweDsgcGFkZGluZy1ib3R0b206IDYwcHg7Cit9CisuYnVpLXAtdGItNjUgeworCXBhZGRpbmctdG9wOiA2NXB4OyBwYWRkaW5nLWJvdHRvbTogNjVweDsKK30KKy5idWktcC10Yi03MCB7CisJcGFkZGluZy10b3A6IDcwcHg7IHBhZGRpbmctYm90dG9tOiA3MHB4OworfQorLmJ1aS1wLXRiLTc1IHsKKwlwYWRkaW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g7Cit9CisuYnVpLXAtdC0xNSB7CisJcGFkZGluZy10b3A6IDE1cHg7Cit9CisuYnVpLXAtdC0yMCB7CisJcGFkZGluZy10b3A6IDIwcHg7Cit9CisuYnVpLXAtdC0yNSB7CisJcGFkZGluZy10b3A6IDI1cHg7Cit9CisuYnVpLXAtdC0zMCB7CisJcGFkZGluZy10b3A6IDMwcHg7Cit9CisuYnVpLXAtdC0zNSB7CisJcGFkZGluZy10b3A6IDM1cHg7Cit9CisuYnVpLXAtdC00MCB7CisJcGFkZGluZy10b3A6IDQwcHg7Cit9CisuYnVpLXAtdC00NSB7CisJcGFkZGluZy10b3A6IDQ1cHg7Cit9CisuYnVpLXAtdC01MCB7CisJcGFkZGluZy10b3A6IDUwcHg7Cit9CisuYnVpLXAtdC01NSB7CisJcGFkZGluZy10b3A6IDU1cHg7Cit9CisuYnVpLXAtdC02MCB7CisJcGFkZGluZy10b3A6IDYwcHg7Cit9CisuYnVpLXAtdC02NSB7CisJcGFkZGluZy10b3A6IDY1cHg7Cit9CisuYnVpLXAtdC03MCB7CisJcGFkZGluZy10b3A6IDcwcHg7Cit9CisuYnVpLXAtdC03NSB7CisJcGFkZGluZy10b3A6IDc1cHg7Cit9CisuYnVpLXAtdC04MCB7CisJcGFkZGluZy10b3A6IDgwcHg7Cit9CisuYnVpLXAtdC04NSB7CisJcGFkZGluZy10b3A6IDg1cHg7Cit9CisuYnVpLXAtdC05MCB7CisJcGFkZGluZy10b3A6IDkwcHg7Cit9CisuYnVpLXAtdC05NSB7CisJcGFkZGluZy10b3A6IDk1cHg7Cit9CisuYnVpLXAtdC0xMDAgeworCXBhZGRpbmctdG9wOiAxMDBweDsKK30KKy5idWktcC1iLTUgeworCXBhZGRpbmctYm90dG9tOiA1cHg7Cit9CisuYnVpLXAtYi0xMCB7CisJcGFkZGluZy1ib3R0b206IDEwcHg7Cit9CisuYnVpLXAtYi0xMSB7CisJcGFkZGluZy1ib3R0b206IDExcHg7Cit9CisuYnVpLXAtYi0xMiB7CisJcGFkZGluZy1ib3R0b206IDEycHg7Cit9CisuYnVpLXAtYi0xMyB7CisJcGFkZGluZy1ib3R0b206IDEzcHg7Cit9CisuYnVpLXAtYi0xNCB7CisJcGFkZGluZy1ib3R0b206IDE0cHg7Cit9CisuYnVpLXAtYi0xNSB7CisJcGFkZGluZy1ib3R0b206IDE1cHg7Cit9CisuYnVpLXAtYi0yMCB7CisJcGFkZGluZy1ib3R0b206IDIwcHg7Cit9CisuYnVpLXAtYi0yNSB7CisJcGFkZGluZy1ib3R0b206IDI1cHg7Cit9CisuYnVpLXAtYi0zMCB7CisJcGFkZGluZy1ib3R0b206IDMwcHg7Cit9CisuYnVpLXAtYi0zNSB7CisJcGFkZGluZy1ib3R0b206IDM1cHg7Cit9CisuYnVpLXAtYi00MCB7CisJcGFkZGluZy1ib3R0b206IDQwcHg7Cit9CisuYnVpLXAtYi00NSB7CisJcGFkZGluZy1ib3R0b206IDQ1cHg7Cit9CisuYnVpLXAtYi01MCB7CisJcGFkZGluZy1ib3R0b206IDUwcHg7Cit9CisuYnVpLXAtYi01NSB7CisJcGFkZGluZy1ib3R0b206IDU1cHg7Cit9CisuYnVpLXAtYi02MCB7CisJcGFkZGluZy1ib3R0b206IDYwcHg7Cit9CisuYnVpLXAtYi02NSB7CisJcGFkZGluZy1ib3R0b206IDY1cHg7Cit9CisuYnVpLXAtYi03MCB7CisJcGFkZGluZy1ib3R0b206IDcwcHg7Cit9CisuYnVpLXAtYi03NSB7CisJcGFkZGluZy1ib3R0b206IDc1cHg7Cit9CisuYnVpLXAtYi04MCB7CisJcGFkZGluZy1ib3R0b206IDgwcHg7Cit9CisuYnVpLXAtYi04NSB7CisJcGFkZGluZy1ib3R0b206IDg1cHg7Cit9CisuYnVpLXAtYi05MCB7CisJcGFkZGluZy1ib3R0b206IDkwcHg7Cit9CisuYnVpLXAtYi05NSB7CisJcGFkZGluZy1ib3R0b206IDk1cHg7Cit9CisuYnVpLXAtYi0xMDAgeworCXBhZGRpbmct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3J0YW50OworfQorLmJ1aS13LTEwLXBlcmNlbnQgeworCXdpZHRoOiAxMCUgIWltcG9ydGFudDsKK30KKy5idWktdy0xMS1wZXJjZW50IHsKKwl3aWR0aDogMTElICFpbXBvcnRhbnQ7Cit9CisuYnVpLXctMTItcGVyY2VudCB7CisJd2lkdGg6IDEyJSAhaW1wb3J0YW50OworfQorLmJ1aS13LTEzLXBlcmNlbnQgeworCXdpZHRoOiAxMyUgIWltcG9ydGFudDsKK30KKy5idWktdy0xNC1wZXJjZW50IHsKKwl3aWR0aDogMTQlICFpbXBvcnRhbnQ7Cit9CisuYnVpLXctMTUtcGVyY2VudCB7CisJd2lkdGg6IDE1JSAhaW1wb3J0YW50OworfQorLmJ1aS13LTIwLXBlcmNlbnQgeworCXdpZHRoOiAyMCUgIWltcG9ydGFudDsKK30KKy5idWktdy0yMS1wZXJjZW50IHsKKwl3aWR0aDogMjElICFpbXBvcnRhbnQ7Cit9CisuYnVpLXctMjItcGVyY2VudCB7CisJd2lkdGg6IDIyJSAhaW1wb3J0YW50OworfQorLmJ1aS13LTIzLXBlcmNlbnQgeworCXdpZHRoOiAyMyUgIWltcG9ydGFudDsKK30KKy5idWktdy0yNC1wZXJjZW50IHsKKwl3aWR0aDogMjQlICFpbXBvcnRhbnQ7Cit9CisuYnVpLXctMjUtcGVyY2VudCB7CisJd2lkdGg6IDI1JSAhaW1wb3J0YW50OworfQorLmJ1aS13LTMwLXBlcmNlbnQgeworCXdpZHRoOiAzMCUgIWltcG9ydGFudDsKK30KKy5idWktdy0zMS1wZXJjZW50IHsKKwl3aWR0aDogMzElICFpbXBvcnRhbnQ7Cit9CisuYnVpLXctMzItcGVyY2VudCB7CisJd2lkdGg6IDMyJSAhaW1wb3J0YW50OworfQorLmJ1aS13LTMzLXBlcmNlbnQgeworCXdpZHRoOiAzMyUgIWltcG9ydGFudDsKK30KKy5idWktdy0zNC1wZXJjZW50IHsKKwl3aWR0aDogMzQlICFpbXBvcnRhbnQ7Cit9CisuYnVpLXctMzUtcGVyY2VudCB7CisJd2lkdGg6IDM1JSAhaW1wb3J0YW50OworfQorLmJ1aS13LTQwLXBlcmNlbnQgeworCXdpZHRoOiA0MCUgIWltcG9ydGFudDsKK30KKy5idWktdy00NS1wZXJjZW50IHsKKwl3aWR0aDogNDUlICFpbXBvcnRhbnQ7Cit9CisuYnVpLXctNTAtcGVyY2VudCB7CisJd2lkdGg6IDUwJSAhaW1wb3J0YW50OworfQorLmJ1aS13LTUxLXBlcmNlbnQgeworCXdpZHRoOiA1MSUgIWltcG9ydGFudDsKK30KKy5idWktdy01Mi1wZXJjZW50IHsKKwl3aWR0aDogNTIlICFpbXBvcnRhbnQ7Cit9CisuYnVpLXctNTMtcGVyY2VudCB7CisJd2lkdGg6IDUzJSAhaW1wb3J0YW50OworfQorLmJ1aS13LTU0LXBlcmNlbnQgeworCXdpZHRoOiA1NCUgIWltcG9ydGFudDsKK30KKy5idWktdy01NS1wZXJjZW50IHsKKwl3aWR0aDogNTUlICFpbXBvcnRhbnQ7Cit9CisuYnVpLXctNTYtcGVyY2VudCB7CisJd2lkdGg6IDU2JSAhaW1wb3J0YW50OworfQorLmJ1aS13LTU3LXBlcmNlbnQgeworCXdpZHRoOiA1NyUgIWltcG9ydGFudDsKK30KKy5idWktdy01OC1wZXJjZW50IHsKKwl3aWR0aDogNTglICFpbXBvcnRhbnQ7Cit9CisuYnVpLXctNTktcGVyY2VudCB7CisJd2lkdGg6IDU5JSAhaW1wb3J0YW50OworfQorLmJ1aS13LTYwLXBlcmNlbnQgeworCXdpZHRoOiA2MCUgIWltcG9ydGFudDsKK30KKy5idWktdy02NS1wZXJjZW50IHsKKwl3aWR0aDogNjUlICFpbXBvcnRhbnQ7Cit9CisuYnVpLXctNzAtcGVyY2VudCB7CisJd2lkdGg6IDcwJSAhaW1wb3J0YW50OworfQorLmJ1aS13LTc1LXBlcmNlbnQgeworCXdpZHRoOiA3NSUgIWltcG9ydGFudDsKK30KKy5idWktdy04MC1wZXJjZW50I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wbHVzIHsKKwkKK30KKy5idWktaWNvbi1wbHVzLWhvdmVyIHsKKwliYWNrZ3JvdW5kLXBvc2l0aW9uOiAwcHggLTE4cHg7Cit9CisuYnVpLWljb24tbWludXMgeworCWJhY2tncm91bmQtcG9zaXRpb246IC0zNnB4IDBweDsKK30KKy5idWktaWNvbi1taW51cy1ob3ZlciB7CisJYmFja2dyb3VuZC1wb3NpdGlvbjogLTM2cHggLTE4cHg7Cit9CisuYnVpLWljb24tZGVsZXRlIHsKKwliYWNrZ3JvdW5kLXBvc2l0aW9uOiAtNzJweCAwcHg7Cit9CisuYnVpLWljb24tZGVsZXRlLWhvdmVyIHsKKwliYWNrZ3JvdW5kLXBvc2l0aW9uOiAtNzJweCAtMThweDsKK30KKy5idWktaWNvbi1hcnJvdy1yIHsKKwliYWNrZ3JvdW5kLXBvc2l0aW9uOiAtMTA4cHggMHB4OworfQorLmJ1aS1pY29uLWFycm93LXItaG92ZXIgeworCWJhY2tncm91bmQtcG9zaXRpb246IC0xMDhweCAtMThweDsKK30KKy5idWktaWNvbi1hcnJvdy1sIHsKKwliYWNrZ3JvdW5kLXBvc2l0aW9uOiAtMTQ0cHggMHB4OworfQorLmJ1aS1pY29uLWFycm93LWwtaG92ZXIgeworCWJhY2tncm91bmQtcG9zaXRpb246IC0xNDRweCAtMThweDsKK30KKy5idWktaWNvbi1hcnJvdy11IHsKKwliYWNrZ3JvdW5kLXBvc2l0aW9uOiAtMTgwcHggMHB4OworfQorLmJ1aS1pY29uLWFycm93LXUtaG92ZXIgeworCWJhY2tncm91bmQtcG9zaXRpb246IC0xODBweCAtMThweDsKK30KKy5idWktaWNvbi1hcnJvdy1kIHsKKwliYWNrZ3JvdW5kLXBvc2l0aW9uOiAtMjE2cHggMHB4OworfQorLmJ1aS1pY29uLWFycm93LWQtaG92ZXIgeworCWJhY2tncm91bmQtcG9zaXRpb246IC0yMTZweCAtMThweDsKK30KKy5idWktaWNvbi1jaGVjayB7CisJYmFja2dyb3VuZC1wb3NpdGlvbjogLTI1MnB4IDBweDsKK30KKy5idWktaWNvbi1jaGVjay1ob3ZlciB7CisJYmFja2dyb3VuZC1wb3NpdGlvbjogLTI1MnB4IC0xOHB4OworfQorLmJ1aS1pY29uLWdlYXIgeworCWJhY2tncm91bmQtcG9zaXRpb246IC0yODhweCAwcHg7Cit9CisuYnVpLWljb24tZ2Vhci1ob3ZlciB7CisJYmFja2dyb3VuZC1wb3NpdGlvbjogLTI4OHB4IC0xOHB4OworfQorLmJ1aS1pY29uLXJlZnJlc2ggeworCWJhY2tncm91bmQtcG9zaXRpb246IC0zMjRweCAwcHg7Cit9CisuYnVpLWljb24tcmVmcmVzaC1ob3ZlciB7CisJYmFja2dyb3VuZC1wb3NpdGlvbjogLTMyNHB4IC0xOHB4OworfQorLmJ1aS1pY29uLWZvcndhcmQgeworCWJhY2tncm91bmQtcG9zaXRpb246IC0zNjBweCAwcHg7Cit9CisuYnVpLWljb24tZm9yd2FyZC1ob3ZlciB7CisJYmFja2dyb3VuZC1wb3NpdGlvbjogLTM2MHB4IC0xOHB4OworfQorLmJ1aS1pY29uLWJhY2sgeworCWJhY2tncm91bmQtcG9zaXRpb246IC0zOTZweCAwcHg7Cit9CisuYnVpLWljb24tYmFjay1ob3ZlciB7CisJYmFja2dyb3VuZC1wb3NpdGlvbjogLTM5NnB4IC0xOHB4OworfQorLmJ1aS1pY29uLWdyaWQgeworCWJhY2tncm91bmQtcG9zaXRpb246IC00MzJweCAwcHg7Cit9CisuYnVpLWljb24tZ3JpZC1ob3ZlciB7CisJYmFja2dyb3VuZC1wb3NpdGlvbjogLTQzMnB4IC0xOHB4OworfQorLmJ1aS1pY29uLXN0YXIgeworCWJhY2tncm91bmQtcG9zaXRpb246IC00NjhweCAwcHg7Cit9CisuYnVpLWljb24tc3Rhci1ob3ZlciB7CisJYmFja2dyb3VuZC1wb3NpdGlvbjogLTQ2OHB4IC0xOHB4OworfQorLmJ1aS1pY29uLWFsZXJ0IHsKKwliYWNrZ3JvdW5kLXBvc2l0aW9uOiAtNTA0cHggMHB4OworfQorLmJ1aS1pY29uLWFsZXJ0IHsKKwliYWNrZ3JvdW5kLXBvc2l0aW9uOiAtNTA0cHggLTE4cHg7Cit9CisuYnVpLWljb24taW5mbyB7CisJYmFja2dyb3VuZC1wb3NpdGlvbjogLTU0MHB4IDBweDsKK30KKy5idWktaWNvbi1pbmZvLWhvdmVyIHsKKwliYWNrZ3JvdW5kLXBvc2l0aW9uOiAtNTQwcHggLTE4cHg7Cit9CisuYnVpLWljb24taG9tZSB7CisJYmFja2dyb3VuZC1wb3NpdGlvbjogLTU3NnB4IDBweDsKK30KKy5idWktaWNvbi1ob21lLWhvdmVyIHsKKwliYWNrZ3JvdW5kLXBvc2l0aW9uOiAtNTc2cHggLTE4cHg7Cit9CisuYnVpLWljb24tc2VhcmNoIHsKKwliYWNrZ3JvdW5kLXBvc2l0aW9uOiAtNjEycHggMHB4OworfQorLmJ1aS1pY29uLXNlYXJjaGZpZWxkOjphZnRlciB7CisJYmFja2dyb3VuZC1wb3NpdGlvbjogLTYxMnB4IDBweDsKK30KKy5idWktaWNvbi1zZWFyY2gtaG92ZXIgeworCWJhY2tncm91bmQtcG9zaXRpb246IC02MTJweCAtMThweDsKK30KKy5idWktaWNvbi1zZWFyY2hmaWVsZDo6YWZ0ZXIgeworCWJhY2tncm91bmQtcG9zaXRpb246IC02MTJweCAtMThweDsKK30KKy5idWktaWNvbi1jaGVja2JveC1vZmYgeworCWJhY2tncm91bmQtcG9zaXRpb246IC02ODRweCAwcHg7Cit9CisuYnVpLWljb24tY2hlY2tib3gtb2ZmLWhvdmVyIHsKKwliYWNrZ3JvdW5kLXBvc2l0aW9uOiAtNjg0cHggLTE4cHg7Cit9CisuYnVpLWljb24tY2hlY2tib3gtb24geworCWJhY2tncm91bmQtcG9zaXRpb246IC02NDhweCAwcHg7Cit9CisuYnVpLWljb24tY2hlY2tib3gtb24taG92ZXIgeworCWJhY2tncm91bmQtcG9zaXRpb246IC02NDhweCAtMThweDsKK30KKy5idWktaWNvbi1yYWRpby1vZmYgeworCWJhY2tncm91bmQtcG9zaXRpb246IC03NTZweCAwcHg7Cit9CisuYnVpLWljb24tcmFkaW8tb2ZmLWhvdmVyIHsKKwliYWNrZ3JvdW5kLXBvc2l0aW9uOiAtNzU2cHggLTE4cHg7Cit9CisuYnVpLWljb24tcmFkaW8tb24geworCWJhY2tncm91bmQtcG9zaXRpb246IC03MjBweCAwcHg7Cit9CisuYnVpLWljb24tcmFkaW8tb24taG92ZXIgeworCWJhY2tncm91bmQtcG9zaXRpb246IC03MjBweCAtMThweDsKK30KKy5idWktaWNvbi1hY3Rpdml0eSB7CisJYmFja2dyb3VuZC1wb3NpdGlvbjogLTc5MnB4IDBweDsKK30KKy5idWktaWNvbi1hY3Rpdml0eS1ob3ZlciB7CisJYmFja2dyb3VuZC1wb3NpdGlvbjogLTc5MnB4IC0xOHB4OworfQorLmJ1aS1pY29uLW5vdGlmaWNhdGlvbiB7CisJYmFja2dyb3VuZC1wb3NpdGlvbjogLTgyOHB4IDBweDsKK30KKy5idWktaWNvbi1ub3RpZmljYXRpb24taG92ZXIgeworCWJhY2tncm91bmQtcG9zaXRpb246IC04MjhweCAtMThweDsKK30KKy5idWktaWNvbi1vcmRlciB7CisJYmFja2dyb3VuZC1wb3NpdGlvbjogLTg1OXB4IDBweDsKK30KKy5idWktaWNvbi1vcmRlci1ob3ZlciB7CisJYmFja2dyb3VuZC1wb3NpdGlvbjogLTg1OXB4IC0xOHB4OworfQorLmJ1aS1pY29uLXNwcml0ZS0yNSB7CisJd2lkdGg6IDI1cHg7IGhlaWdodDogMjVweDsgdmVydGljYWwtYWxpZ246IG1pZGRsZTsgZGlzcGxheTogaW5saW5lLWJsb2NrOyBiYWNrZ3JvdW5kLWltYWdlOiB1cmwoIi4uL2ltYWdlcy9pY29uc19zcHJpdGVzaGVldF8yNS5wbmciKTsKK30KKy5idWktaWNvbi1hcnJvdy11cC1ncmVlbiB7CisJCit9CisuYnVpLWljb24tcXVlc3Rpb24teWVsbG93IHsKKwliYWNrZ3JvdW5kLXBvc2l0aW9uOiAtMjZweCAwcHg7Cit9CisuYnVpLWljb24tZXhjbGFpbWF0aW9uLXBpbmsgeworCWJhY2tncm91bmQtcG9zaXRpb246IC01MnB4IDBweDsKK30KKy5idWktaWNvbi1idWxsZXQtcG9pbnQgeworCWJhY2tncm91bmQtcG9zaXRpb246IC03OHB4IDBweDsKK30KKy5idWktaWNvbi1vay1zdGF0dXMgeworCWJhY2tncm91bmQtcG9zaXRpb246IC0xMDRweCAwcHg7Cit9CisuYnVpLWljb24tY2lyY2xlIHsKKwliYWNrZ3JvdW5kLXBvc2l0aW9uOiAtMTMwcHggMHB4OworfQorLmJ1aS1pY29uLWNpcmNsZS1ob3ZlciB7CisJYmFja2dyb3VuZC1wb3NpdGlvbjogLTEzMHB4IC0yNnB4OworfQorLmJ1aS1pY29uLW51bWJlciB7CisJYmFja2dyb3VuZC1wb3NpdGlvbjogLTE1NnB4IDBweDsKK30KKy5idWktaWNvbi1udW1iZXItaG92ZXIgeworCWJhY2tncm91bmQtcG9zaXRpb246IC0xNTZweCAtMjZweDsKK30KKy5idWktaWNvbi10aWNrZXQgeworCWJhY2tncm91bmQtcG9zaXRpb246IC0xODJweCAwcHg7Cit9CisuYnVpLWljb24tdGlja2V0LWhvdmVyIHsKKwliYWNrZ3JvdW5kLXBvc2l0aW9uOiAtMTgycHggLTI2cHg7Cit9CisuYnVpLWljb24tbWFpbnRlbmFuY2UgeworCWJhY2tncm91bmQtcG9zaXRpb246IC0yMDhweCAwcHg7Cit9CisuYnVpLWljb24tbWFpbnRlbmFuY2UtaG92ZXIgeworCWJhY2tncm91bmQtcG9zaXRpb246IC0yMDhweCAtMjZweDsKK30KKy5idWktaWNvbi1vdXRhZ2UgeworCWJhY2tncm91bmQtcG9zaXRpb246IC0yMzRweCAwcHg7Cit9CisuYnVpLWljb24tb3V0YWdlLWhvdmVyIHsKKwliYWNrZ3JvdW5kLXBvc2l0a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3VuZC1wb3NpdGlvbjogLTEwOHB4IDBweDsKK30KKy5idWktaWNvbi1iLXRvb2wgeworCWJhY2tncm91bmQtcG9zaXRpb246IC0xNDRweCAwcHg7Cit9CisuYnVpLWljb24taGVscCB7CisJYmFja2dyb3VuZC1wb3NpdGlvbjogLTE4MHB4IDBweDsKK30KKy5idWktaWNvbi1zcHJpdGUtb3ZlcnZpZXcgeworCXdpZHRoOiAxNHB4OyBoZWlnaHQ6IDE0cHg7IHZlcnRpY2FsLWFsaWduOiBtaWRkbGU7IGRpc3BsYXk6IGlubGluZS1ibG9jazsgYmFja2dyb3VuZC1pbWFnZTogdXJsKCIuLi9pbWFnZXMvc3ByaXRlX2Rhc2hib2FyZF9vdmVydmlld193aWRnZXRfMTR4MTQucG5nIik7Cit9CisuYnVpLWljb24tYWxhcm0tY3JpdGljYWwgeworCQorfQorLmJ1aS1pY29uLWFsYXJtLWNvbmdlc3Rpb24geworCWJhY2tncm91bmQtcG9zaXRpb246IC0xNXB4IDBweDsKK30KKy5idWktaWNvbi1hbGFybS1hY2sgeworCWJhY2tncm91bmQtcG9zaXRpb246IC0zMHB4IDBweDsKK30KKy5idWktaWNvbi1hbGFybS1jbGVhciB7CisJYmFja2dyb3VuZC1wb3NpdGlvbjogLTQ1cHggMHB4OworfQorLmJ1aS1pY29uLXRpY2tldC1ub3JtYWwgeworCWJhY2tncm91bmQtcG9zaXRpb246IC02MHB4IDBweDsKK30KKy5idWktaWNvbi10aWNrZXQtY2xlYXIgeworCWJhY2tncm91bmQtcG9zaXRpb246IC03NXB4IDBweDsKK30KKy5idWktaWNvbi1zcHJpdGUtd2lyZWxlc3MgeworCXdpZHRoOiAzMHB4OyBoZWlnaHQ6IDMwcHg7IHZlcnRpY2FsLWFsaWduOiBtaWRkbGU7IGRpc3BsYXk6IGlubGluZS1ibG9jazsgYmFja2dyb3VuZC1pbWFnZTogdXJsKCIuLi9pbWFnZXMvc3ByaXRlX2Rhc2hib2FyZF93aXJlbGVzc193aWRnZ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gcGFkZGluZzogMHB4OyBib3JkZXI6IDBweCBjdXJyZW50Q29sb3I7IGZsb2F0OiBsZWZ0OyBtaW4taGVpZ2h0OiAxcHg7IGJveC1zaXppbmc6IGJvcmRlci1ib3g7IC13ZWJraXQtYm94LXNpemluZzogYm9yZGVyLWJveDsgLW1vei1ib3gtc2l6aW5nOiBib3JkZXItYm94OyAtbXMtYm94LXNpemluZzogYm9yZGVyLWJveDsKK30KKy5idWktYmxvY2stMiB7CisJbWFyZ2luOiAwcHg7IHBhZGRpbmc6IDBweDsgYm9yZGVyOiAwcHggY3VycmVudENvbG9yOyBmbG9hdDogbGVmdDsgbWluLWhlaWdodDogMXB4OyBib3gtc2l6aW5nOiBib3JkZXItYm94OyAtd2Via2l0LWJveC1zaXppbmc6IGJvcmRlci1ib3g7IC1tb3otYm94LXNpemluZzogYm9yZGVyLWJveDsgLW1zLWJveC1zaXppbmc6IGJvcmRlci1ib3g7Cit9CisuYnVpLWJsb2NrLTMgeworCW1hcmdpbjogMHB4OyBwYWRkaW5nOiAwcHg7IGJvcmRlcjogMHB4IGN1cnJlbnRDb2xvcjsgZmxvYXQ6IGxlZnQ7IG1pbi1oZWlnaHQ6IDFweDsgYm94LXNpemluZzogYm9yZGVyLWJveDsgLXdlYmtpdC1ib3gtc2l6aW5nOiBib3JkZXItYm94OyAtbW96LWJveC1zaXppbmc6IGJvcmRlci1ib3g7IC1tcy1ib3gtc2l6aW5nOiBib3JkZXItYm94OworfQorLmJ1aS1ibG9jay00IHsKKwltYXJnaW46IDBweDsgcGFkZGluZzogMHB4OyBib3JkZXI6IDBweCBjdXJyZW50Q29sb3I7IGZsb2F0OiBsZWZ0OyBtaW4taGVpZ2h0OiAxcHg7IGJveC1zaXppbmc6IGJvcmRlci1ib3g7IC13ZWJraXQtYm94LXNpemluZzogYm9yZGVyLWJveDsgLW1vei1ib3gtc2l6aW5nOiBib3JkZXItYm94OyAtbXMtYm94LXNpemluZzogYm9yZGVyLWJveDsKK30KKy5idWktYm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YXNlZDsgLW1vei1vc3gtZm9udC1zbW9vdGhpbmc6IGdyYXlzY2FsZTsKK30KKy5pY29uLXdpcmVsZXNzLW91dGxpbmU6OmJlZm9yZSB7CisJY29udGVudDogIlxlNjAwIjsKK30KKy5pY29uLXdpcmVsZXNzLWRhc2hib2FyZDo6YmVmb3JlIHsKKwljb250ZW50OiAiXGU2MDEiOworfQorLmljb24td2Vic2l0ZS1ob3N0aW5nLW91dGxpbmU6OmJlZm9yZSB7CisJY29udGVudDogIlxlNjAyIjsKK30KKy5pY29uLXZvbHVtZS11cDo6YmVmb3JlIHsKKwljb250ZW50OiAiXGU2MDMiOworfQorLmljb24tdm9sdW1lLW11dGU6OmJlZm9yZSB7CisJY29udGVudDogIlxlNjA0IjsKK30KKy5pY29uLXZvbHVtZS1kb3duOjpiZWZvcmUgeworCWNvbnRlbnQ6ICJcZTYwNSI7Cit9CisuaWNvbi12aWRlbzo6YmVmb3JlIHsKKwljb250ZW50OiAiXGU2MDYiOworfQorLmljb24tdmlkZW8tdHV0b3JpYWxzOjpiZWZvcmUgeworCWNvbnRlbnQ6ICJcZTYwNyI7Cit9CisuaWNvbi12aWRlby10dXRvcmlhbHMtb3V0bGluZTo6YmVmb3JlIHsKKwljb250ZW50OiAiXGU2MDgiOworfQorLmljb24tdmlkZW8tb3V0bGluZTo6YmVmb3JlIHsKKwljb250ZW50OiAiXGU2MDkiOworfQorLmljb24tdXNlcjo6YmVmb3JlIHsKKwljb250ZW50OiAiXGU2MGEiOworfQorLmljb24tdXNlci1zbWFsbDo6YmVmb3JlIHsKKwljb250ZW50OiAiXGU2MGIiOworfQorLmljb24tdXNlci1vdXRsaW5lOjpiZWZvcmUgeworCWNvbnRlbnQ6ICJcZTYwYyI7Cit9CisuaWNvbi11c2VyLWxhcmdlLW91dGxpbmU6OmJlZm9yZSB7CisJY29udGVudDogIlxlNjBkIjsKK30KKy5pY29uLXVwZ3JhZGVzOjpiZWZvcmUgeworCWNvbnRlbnQ6ICJcZTYwZSI7Cit9CisuaWNvbi11cGdyYWRlcy1vdXRsaW5lOjpiZWZvcmUgeworCWNvbnRlbnQ6ICJcZTYwZiI7Cit9CisuaWNvbi11bmxpbWl0ZWQtbmlnaHRzLXdlZWtlbmRzLW91dGxpbmU6OmJlZm9yZSB7CisJY29udGVudDogIlxlNjEwIjsKK30KKy5pY29uLXVubGltaXRlZC1taW51dGVzLW91dGxpbmU6OmJlZm9yZSB7CisJY29udGVudDogIlxlNjExIjsKK30KKy5pY29uLXVubGltaXRlZC1tZXNzYWdpbmctb3V0bGluZTo6YmVmb3JlIHsKKwljb250ZW50OiAiXGU2MTIiOworfQorLmljb24tdW5saW1pdGVkLW0ybS1vdXRsaW5lOjpiZWZvcmUgeworCWNvbnRlbnQ6ICJcZTYxMyI7Cit9CisuaWNvbi11bmxpbWl0ZWQtY2FsbGluZzo6YmVmb3JlIHsKKwljb250ZW50OiAiXGU2MTQiOworfQorLmljb24tdHYtcGFja2FnZXMtb3V0bGluZTo6YmVmb3JlIHsKKwljb250ZW50OiAiXGU2MTUiOworfQorLmljb24tdHJhdmVsLW1pbnV0ZXMtb3V0bGluZTo6YmVmb3JlIHsKKwljb250ZW50OiAiXGU2MTYiOworfQorLmljb24tdHJhc2g6OmJlZm9yZSB7CisJY29udGVudDogIlxlNjE3IjsKK30KKy5pY29uLXRvbGxmcmVlLW91dGxpbmU6OmJlZm9yZSB7CisJY29udGVudDogIlxlNjE4IjsKK30KKy5pY29uLXRpbGVzOjpiZWZvcmUgeworCWNvbnRlbnQ6ICJcZTYxOSI7Cit9CisuaWNvbi10aWxlcy1zbWFsbDo6YmVmb3JlIHsKKwljb250ZW50OiAiXGU2MWEiOworfQorLmljb24tdGlja2V0czo6YmVmb3JlIHsKKwljb250ZW50OiAiXGU2MWIiOworfQorLmljb24tdGlja2V0cy1yZXR1cm5lZDo6YmVmb3JlIHsKKwljb250ZW50OiAiXGU2MWMiOworfQorLmljb24tdGlja2V0cy1yZWZlcnJlZDo6YmVmb3JlIHs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SB7CisJY29udGVudDogIlxlNjJjIjsKK30KKy5pY29uLXN0YXI6OmJlZm9yZSB7CisJY29udGVudDogIlxlNjJkIjsKK30KKy5pY29uLXNvcnQ6OmJlZm9yZSB7CisJY29udGVudDogIlxlNjJlIjsKK30KKy5pY29uLXNvY2lhbC1vdXRsaW5lOjpiZWZvcmUgeworCWNvbnRlbnQ6ICJcZTYyZiI7Cit9CisuaWNvbi1zbWFydHBob25lOjpiZWZvcmUgeworCWNvbnRlbnQ6ICJcZTYzMCI7Cit9CisuaWNvbi1zbWFydHBob25lLW91dGxpbmU6OmJlZm9yZSB7CisJY29udGVudDogIlxlNjMxIjsKK30KKy5pY29uLXNpZ25vdXQtb3V0bGluZTo6YmVmb3JlIHsKKwljb250ZW50OiAiXGU2MzIiOworfQorLmljb24tc2lnbi1vdXQ6OmJlZm9yZSB7CisJY29udGVudDogIlxlNjMzIjsKK30KKy5pY29uLXNob3A6OmJlZm9yZSB7CisJY29udGVudDogIlxlNjM0IjsKK30KKy5pY29uLXNob3Atb3V0bGluZTo6YmVmb3JlIHsKKwljb250ZW50OiAiXGU2MzUiOworfQorLmljb24tc2hhcmVkLW91dGxpbmU6OmJlZm9yZSB7CisJY29udGVudDogIlxlNjM2IjsKK30KKy5pY29uLXNoYXJlZC1taW51dGVzLW91dGxpbmU6OmJlZm9yZSB7CisJY29udGVudDogIlxlNjM3IjsKK30KKy5pY29uLXNoYXJlOjpiZWZvcmUgeworCWNvbnRlbnQ6ICJcZTYzOCI7Cit9CisuaWNvbi1zZXR0aW5nczo6YmVmb3JlIHsKKwljb250ZW50OiAiXGU2MzkiOworfQorLmljb24tc2VuZC1pbnZvaWNlLW91dGxpbmU6OmJlZm9yZSB7CisJY29udGVudDogIlxlNjNhIjsKK30KKy5pY29uLXNlZS1tb3JlOjpiZWZvcmUgeworCWNvbnRlbnQ6ICJcZTYzYiI7Cit9CisuaWNvbi1zZWUtbGVzczo6YmVmb3JlIHsKKwljb250ZW50OiAiXGU2M2MiOworfQorLmljb24tc2VhcmNoOjpiZWZvcmUgeworCWNvbnRlbnQ6ICJcZTYzZCI7Cit9CisuaWNvbi1zZWFyY2gtc21hbGw6OmJlZm9yZSB7CisJY29udGVudDogIlxlNjNlIjsKK30KKy5pY29uLXNjcmVlbi1jYWxscy1vdXRsaW5lOjpiZWZvcmUgeworCWNvbnRlbnQ6ICJcZTYzZiI7Cit9CisuaWNvbi1zYXZlLXRpbWUtb3V0bGluZTo6YmVmb3JlIHsKKwljb250ZW50OiAiXGU2NDAiOworfQorLmljb24tc2Fhcy1lbmFibGVtZW50LW91dGxpbmU6OmJlZm9yZSB7CisJY29udGVudDogIlxlNjQxIjsKK30KKy5pY29uLXMtYmVhbTo6YmVmb3JlIHsKKwljb250ZW50OiAiXGU2NDIiOworfQorLmljb24tcy1iZWFtLW91dGxpbmU6OmJlZm9yZSB7CisJY29udGVudDogIlxlNjQzIjsKK30KKy5pY29uLXJvbGxvdmVyLW91dGxpbmU6OmJlZm9yZSB7CisJY29udGVudDogIlxlNjQ0IjsKK30KKy5pY29uLXJvbGxvdmVyLW1pbnV0ZXM6OmJlZm9yZSB7CisJY29udGVudDogIlxlNjQ1IjsKK30KKy5pY29uLXJldmlld3Mtb3V0bGluZTo6YmVmb3JlIHsKKwljb250ZW50OiAiXGU2NDYiOworfQorLmljb24tcmVwb3J0czo6YmVmb3JlIHsKKwljb250ZW50OiAiXGU2NDciOworfQorLmljb24tcmVwb3J0cy1vdXRsaW5lOjpiZWZvcmUgeworCWNvbnRlbnQ6ICJcZTY0OCI7Cit9CisuaWNvbi1yZWNvbW1lbmRhdGlvbi10b29sOjpiZWZvcmUgeworCWNvbnRlbnQ6ICJcZTY0OSI7Cit9CisuaWNvbi1yZWNlaXZlcnMtb3V0bGluZTo6YmVmb3JlIHsKKwljb250ZW50OiAiXGU2NGEiOworfQorLmljb24tcHJvZHVjdGl2aXR5LW91dGxpbmU6OmJlZm9yZSB7CisJY29udGVudDogIlxlNjRiIjsKK30KKy5pY29uLXByaW50OjpiZWZvcmUgeworCWNvbnRlbnQ6ICJcZTY0YyI7Cit9CisuaWNvbi1wbHVzOjpiZWZvcmUgeworCWNvbnRlbnQ6ICJcZTY0ZCI7Cit9CisuaWNvbi1wbHVzLW91dGxpbmU6OmJlZm9yZSB7CisJY29udGVudDogIlxlNjRlIjsKK30KKy5pY29uLXBsYXk6OmJlZm9yZSB7CisJY29udGVudDogIlxlNjRmIjsKK30KKy5pY29uLXBsYXRmb3JtLWFzLXNlcnZpY2Utb3V0bGluZTo6YmVmb3JlIHsKKwljb250ZW50OiAiXGU2NTAiOworfQorLmljb24tcGxhbnM6OmJlZm9yZSB7CisJY29udGVudDogIlxlNjUxIjsKK30KKy5pY29uLXBsYW5zLW91dGxpbmU6OmJlZm9yZSB7CisJY29udGVudDogIlxlNjUyIjsKK30KKy5pY29uLXBpZS1jaGFydDo6YmVmb3JlIHsKKwljb250ZW50OiAiXGU2NTMiOworfQorLmljb24tcGhvdG9zOjpiZWZvcmUgeworCWNvbnRlbnQ6ICJcZTY1NCI7Cit9CisuaWNvbi1waG90b3Mtb3V0bGluZTo6YmVmb3JlIHsKKwljb250ZW50OiAiXGU2NTUiOworfQorLmljb24tcGhvbmUtZGF0YS1vdXRsaW5lOjpiZWZvcmUgeworCWNvbnRlbnQ6ICJcZTY1NiI7Cit9CisuaWNvbi1wYXltZW50czo6YmVmb3JlIHsKKwljb250ZW50OiAiXGU2NTciOworfQorLmljb24tcGF5bWVudHMtb3V0bGluZTo6YmVmb3JlIHsKKwljb250ZW50OiAiXGU2NTgiOworfQorLmljb24tcGF1c2U6OmJlZm9yZSB7CisJY29udGVudDogIlxlNjU5IjsKK30KKy5pY29uLXBhc3N3b3JkOjpiZWZvcmUgeworCWNvbnRlbnQ6ICJcZTY1YSI7Cit9CisuaWNvbi1wYXNzd29yZC1vdXRsaW5lOjpiZWZvcmUgeworCWNvbnRlbnQ6ICJcZTY1YiI7Cit9CisuaWNvbi1vdmVydmlldzo6YmVmb3JlIHsKK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ODkiOworfQorLmljb24tbGFwdG9wOjpiZWZvcmUgeworCWNvbnRlbnQ6ICJcZTY4YSI7Cit9CisuaWNvbi1sYW5kbGluZTo6YmVmb3JlIHsKKwljb250ZW50OiAiXGU2OGIiOworfQorLmljb24tbGFuZGxpbmUtb3V0bGluZTo6YmVmb3JlIHsKKwljb250ZW50OiAiXGU2OGMiOworfQorLmljb24taW52b2ljZXM6OmJlZm9yZSB7CisJY29udGVudDogIlxlNjhkIjsKK30KKy5pY29uLWludm9pY2VzLW91dGxpbmU6OmJlZm9yZSB7CisJY29udGVudDogIlxlNjhlIjsKK30KKy5pY29uLWludmVudG9yeTo6YmVmb3JlIHsKKwljb250ZW50OiAiXGU2OGYiOworfQorLmljb24taW50cmFuZXQtb3V0bGluZTo6YmVmb3JlIHsKKwljb250ZW50OiAiXGU2OTAiOworfQorLmljb24taW50ZXJwcmV0ZXI6OmJlZm9yZSB7CisJY29udGVudDogIlxlNjkxIjsKK30KKy5pY29uLWludGVycHJldGVyLW91dGxpbmU6OmJlZm9yZSB7CisJY29udGVudDogIlxlNjkyIjsKK30KKy5pY29uLWludGVybmV0OjpiZWZvcmUgeworCWNvbnRlbnQ6ICJcZTY5MyI7Cit9CisuaWNvbi1pbnRlcm5ldC1vdXRsaW5lOjpiZWZvcmUgeworCWNvbnRlbnQ6ICJcZTY5NCI7Cit9CisuaWNvbi1pbnRlcm5ldC0yNC1vdXRsaW5lOjpiZWZvcmUgeworCWNvbnRlbnQ6ICJcZTY5NSI7Cit9CisuaWNvbi1pbnRlcm5ldC0xOC1vdXRsaW5lOjpiZWZvcmUgeworCWNvbnRlbnQ6ICJcZTY5NiI7Cit9CisuaWNvbi1pbnRlcm5hdGlvbmFsLW91dGxpbmU6OmJlZm9yZSB7CisJY29udGVudDogIlxlNjk3IjsKK30KKy5pY29uLWludGVybmF0aW9uYWwtbG9uZy1kaXN0YW5jZS1vdXRsaW5lOjpiZWZvcmUgeworCWNvbnRlbnQ6ICJcZTY5OCI7Cit9C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cit9CisuaWNvbi1lcmFzZTo6YmVmb3JlIHsKKwljb250ZW50OiAiXGU2YjgiOworfQorLmljb24tZW52ZWxvcGU6OmJlZm9yZSB7CisJY29udGVudDogIlxlNmI5IjsKK30KKy5pY29uLWVudmVsb3BlLW91dGxpbmU6OmJlZm9yZSB7CisJY29udGVudDogIlxlNmJhIjsKK30KKy5pY29uLWVudGVycHJpc2UtbWVzc2FnaW5nLW91dGxpbmU6OmJlZm9yZSB7CisJY29udGVudDogIlxlNmJiIjsKK30KKy5pY29uLWVkaXQ6OmJlZm9yZSB7CisJY29udGVudDogIlxlNmJjIjsKK30KKy5pY29uLWR1cGxpY2F0ZTo6YmVmb3JlIHsKKwljb250ZW50OiAiXGU2YmQiOworfQorLmljb24tZHJvcGRvd24tdXA6OmJlZm9yZSB7CisJY29udGVudDogIlxlNmJlIjsKK30KKy5pY29uLWRyb3Bkb3duLWRvd246OmJlZm9yZSB7CisJY29udGVudDogIlxlNmJmIjsKK30KKy5pY29uLWRvd25sb2FkOjpiZWZvcmUgeworCWNvbnRlbnQ6ICJcZTZjMCI7Cit9CisuaWNvbi1kb3dubG9hZC1vdXRsaW5lOjpiZWZvcmUgeworCWNvbnRlbnQ6ICJcZTZjMSI7Cit9CisuaWNvbi1kaXNwdXRlczo6YmVmb3JlIHsKKwljb250ZW50OiAiXGU2YzIiOworfQorLmljb24tZGV0YWlsZWQtYmlsbGluZzo6YmVmb3JlIHsKKwljb250ZW50OiAiXGU2YzMiOworfQorLmljb24tZGV0YWlsZWQtYmlsbGluZy1vdXRsaW5lOjpiZWZvcmUgeworCWNvbnRlbnQ6ICJcZTZjNCI7Cit9CisuaWNvbi1kZXNrdG9wLW91dGxpbmU6OmJlZm9yZSB7CisJY29udGVudDogIlxlNmM1IjsKK30KKy5pY29uLWRhdGE6OmJlZm9yZSB7CisJY29udGVudDogIlxlNmM2IjsKK30KKy5pY29uLWRhdGEtb3V0bGluZTo6YmVmb3JlIHsKKwljb250ZW50OiAiXGU2YzciO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sgYmFja2dyb3VuZC1yZXBlYXQ6IG5vLXJlcGVhdDsKK30KKy5idWktcmVnLW9uZS1saW5lLWxheW91dCAqIHsKKwlkaXNwbGF5OiBpbmxpbmUtYmxvY2s7Cit9CisucG9wYm94IHsKKwltYXJnaW46IDBweCBhdXRvOyB0ZXh0LWFsaWduOiBjZW50ZXI7IHBvc2l0aW9uOiByZWxhdGl2ZTsKK30KKy5jb2xsYXBzZSB7CisJcG9zaXRpb246IHJlbGF0aXZlOworfQorLmJveCB7CisJYmFja2dyb3VuZDogcmdiKDI1NSwgMjU1LCAyNTUpOyBib3JkZXI6IDFweCBzb2xpZCByZ2IoMTg3LCAxODcsIDE4Nyk7IHdpZHRoOiBhdXRvOyBoZWlnaHQ6IGF1dG87IGRpc3BsYXk6IG5vbmU7IHBvc2l0aW9uOiByZWxhdGl2ZTsgei1pbmRleDogMTAwMDsgbWluLXdpZHRoOiAyNjBweDsgYm94LXNoYWRvdzogMHB4IDRweCA0cHggcmdiYSgwLDAsMCwwLjI1KTsKK30KKy5ib3ggKiB7CisJYm94LXNpemluZzogY29udGVudC1ib3g7IC13ZWJraXQtYm94LXNpemluZzogY29udGVudC1ib3g7IC1tb3otYm94LXNpemluZzogY29udGVudC1ib3g7Cit9CisuYm94IDo6YWZ0ZXIgeworCWJveC1zaXppbmc6IGNvbnRlbnQtYm94OyAtd2Via2l0LWJveC1zaXppbmc6IGNvbnRlbnQtYm94OyAtbW96LWJveC1zaXppbmc6IGNvbnRlbnQtYm94OworfQorLmJveCA6OmJlZm9yZSB7CisJYm94LXNpemluZzogY29udGVudC1ib3g7IC13ZWJraXQtYm94LXNpemluZzogY29udGVudC1ib3g7IC1tb3otYm94LXNpemluZzogY29udGVudC1ib3g7Cit9CisuYm94IGEuY2xvc2UgeworCWNvbG9yOiByZWQ7IGZvbnQtZmFtaWx5OiBhcmlhbDsgZm9udC1zaXplOiAxMnB4OyB0ZXh0LWRlY29yYXRpb246IHVuZGVybGluZTsKK30KKy5ib3ggL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m9ybWFsOyBzcGVhazogbm9uZTsgLXdlYmtpdC1mb250LXNtb290aGluZzogYW50aWFsaWFzZWQ7IC1tb3otb3N4LWZvbnQtc21vb3RoaW5nOiBncmF5c2NhbGU7Cit9CisuaWNvbi13aXJlbGVzcy1vdXRsaW5lOjpiZWZvcmUgeworCWNvbnRlbnQ6ICJcZTYwMCI7Cit9CisuaWNvbi13aXJlbGVzcy1kYXNoYm9hcmQ6OmJlZm9yZSB7CisJY29udGVudDogIlxlNjAxIjsKK30KKy5pY29uLXdlYnNpdGUtaG9zdGluZy1vdXRsaW5lOjpiZWZvcmUgeworCWNvbnRlbnQ6ICJcZTYwMiI7Cit9CisuaWNvbi12b2x1bWUtdXA6OmJlZm9yZSB7CisJY29udGVudDogIlxlNjAzIjsKK30KKy5pY29uLXZvbHVtZS1tdXRlOjpiZWZvcmUgeworCWNvbnRlbnQ6ICJcZTYwNCI7Cit9CisuaWNvbi12b2x1bWUtZG93bjo6YmVmb3JlIHsKKwljb250ZW50OiAiXGU2MDUiOworfQorLmljb24tdmlkZW86OmJlZm9yZSB7CisJY29udGVudDogIlxlNjA2IjsKK30KKy5pY29uLXZpZGVvLXR1dG9yaWFsczo6YmVmb3JlIHsKKwljb250ZW50OiAiXGU2MDciOworfQorLmljb24tdmlkZW8tdHV0b3JpYWxzLW91dGxpbmU6OmJlZm9yZSB7CisJY29udGVudDogIlxlNjA4IjsKK30KKy5pY29uLXZpZGVvLW91dGxpbmU6OmJlZm9yZSB7CisJY29udGVudDogIlxlNjA5IjsKK30KKy5pY29uLXVzZXI6OmJlZm9yZSB7CisJY29udGVudDogIlxlNjBhIjsKK30KKy5pY29uLXVzZXItc21hbGw6OmJlZm9yZSB7CisJY29udGVudDogIlxlNjBiIjsKK30KKy5pY29uLXVzZXItb3V0bGluZTo6YmVmb3JlIHsKKwljb250ZW50OiAiXGU2MGMiOworfQorLmljb24tdXNlci1sYXJnZS1vdXRsaW5lOjpiZWZvcmUgeworCWNvbnRlbnQ6ICJcZTYwZCI7Cit9CisuaWNvbi11cGdyYWRlczo6YmVmb3JlIHsKKwljb250ZW50OiAiXGU2MGUiOworfQorLmljb24tdXBncmFkZXMtb3V0bGluZTo6YmVmb3JlIHsKKwljb250ZW50OiAiXGU2MGYiOworfQorLmljb24tdW5saW1pdGVkLW5pZ2h0cy13ZWVrZW5kcy1vdXRsaW5lOjpiZWZvcmUgeworCWNvbnRlbnQ6ICJcZTYxMCI7Cit9CisuaWNvbi11bmxpbWl0ZWQtbWludXRlcy1vdXRsaW5lOjpiZWZvcmUgeworCWNvbnRlbnQ6ICJcZTYxMSI7Cit9CisuaWNvbi11bmxpbWl0ZWQtbWVzc2FnaW5nLW91dGxpbmU6OmJlZm9yZSB7CisJY29udGVudDogIlxlNjEyIjsKK30KKy5pY29uLXVubGltaXRlZC1tMm0tb3V0bGluZTo6YmVmb3JlIHsKKwljb250ZW50OiAiXGU2MTMiOworfQorLmljb24tdW5saW1pdGVkLWNhbGxpbmc6OmJlZm9yZSB7CisJY29udGVudDogIlxlNjE0IjsKK30KKy5pY29uLXR2LXBhY2thZ2VzLW91dGxpbmU6OmJlZm9yZSB7CisJY29udGVudDogIlxlNjE1IjsKK30KKy5pY29uLXRyYXZlbC1taW51dGVzLW91dGxpbmU6OmJlZm9yZSB7CisJY29udGVudDogIlxlNjE2IjsKK30KKy5pY29uLXRyYXNoOjpiZWZvcmUgeworCWNvbnRlbnQ6ICJcZTYxNyI7Cit9CisuaWNvbi10b2xsZnJlZS1vdXRsaW5lOjpiZWZvcmUgeworCWNvbnRlbnQ6ICJcZTYxOCI7Cit9CisuaWNvbi10aWxlczo6YmVmb3JlIHsKKwljb250ZW50OiAiXGU2MTkiOworfQorLmljb24tdGlsZXMtc21hbGw6OmJlZm9yZSB7CisJY29udGVudDogIlxlNjFhIjsKK30KKy5pY29uLXRpY2tldHM6OmJlZm9yZSB7CisJY29udGVudDogIlxlNjFiIjsKK30KKy5pY29uLXRpY2tldHMtcmV0dXJuZWQ6OmJlZm9yZSB7CisJY29udGVudDogIlxlNjFjIjsKK30KKy5pY29uLXRpY2tldHMtcmVmZXJyZWQ6OmJlZm9yZSB7CisJY29udGVudDogIlxlNjFkIjsKK30KKy5pY29uLXRpY2tldHMtb3V0bGluZTo6YmVmb3JlIHsKKwljb250ZW50OiAiXGU2MWUiOworfQorLmljb24tdGlja2V0cy1vcGVuOjpiZWZvcmUgeworCWNvbnRlbnQ6ICJcZTYxZiI7Cit9CisuaWNvbi10aWNrZXRzLWVzY2FsYXRlOjpiZWZvcmUgeworCWNvbnRlbnQ6ICJcZTYyMCI7Cit9CisuaWNvbi10aWNrZXRzLWNvbnRlc3RlZDo6YmVmb3JlIHsKKwljb250ZW50OiAiXGU2MjEiOworfQorLmljb24tdGlja2V0cy1jbG9zZWQ6OmJlZm9yZSB7CisJY29udGVudDogIlxlNjIyIjsKK30KKy5pY29uLXRpY2tldHMtY2xlYXJlZDo6YmVmb3JlIHsKKwljb250ZW50OiAiXGU2MjMiOworfQorLmljb24tdGlja2V0cy1hcnF1aXZlZDo6YmVmb3JlIHsKKwljb250ZW50OiAiXGU2MjQiOworfQorLmljb24tdGlja2V0cy1hY3RpdmU6OmJlZm9yZSB7CisJY29udGVudDogIlxlNjI1IjsKK30KKy5pY29uLXRlY2huaWNhbC1zcGVjaWZpY2F0aW9uczo6YmVmb3JlIHsKKwljb250ZW50OiAiXGU2MjYiOworfQorLmljb24tdGVjaC1zdXBwb3J0OjpiZWZvcmUgeworCWNvbnRlbnQ6ICJcZTYyNyI7Cit9CisuaWNvbi10ZWNoLXN1cHBvcnQtb3V0bGluZTo6YmVmb3JlIHsKKwljb250ZW50OiAiXGU2MjgiOworfQorLmljb24tdGFibGV0OjpiZWZvcmUgeworCWNvbnRlbnQ6ICJcZTYyOSI7Cit9CisuaWNvbi10YWJsZXQtb3V0bGluZTo6YmVmb3JlIHsKKwljb250ZW50OiAiXGU2MmEiOworfQorLmljb24tc3VwcG9ydDo6YmVmb3JlIHsKKwljb250ZW50OiAi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bmU6OmJlZm9yZSB7CisJY29udGVudDogIlxlNjc5IjsKK30KKy5pY29uLW1pbnV0ZXM6OmJlZm9yZSB7CisJY29udGVudDogIlxlNjdhIjsKK30KKy5pY29uLW1pbnV0ZXMtb3V0bGluZTo6YmVmb3JlIHsKKwljb250ZW50OiAiXGU2N2IiOworfQorLmljb24tbWVzc2FnaW5nOjpiZWZvcmUgeworCWNvbnRlbnQ6ICJcZTY3YyI7Cit9CisuaWNvbi1tZXNzYWdpbmctdG9vbGtpdC1vdXRsaW5lOjpiZWZvcmUgeworCWNvbnRlbnQ6ICJcZTY3ZCI7Cit9CisuaWNvbi1tZXNzYWdpbmctb3V0bGluZTo6YmVmb3JlIHsKKwljb250ZW50OiAiXGU2N2UiOworfQorLmljb24tbWVzc2FnaW5nLWVtYWlsOjpiZWZvcmUgeworCWNvbnRlbnQ6ICJcZTY3ZiI7Cit9CisuaWNvbi1tZXNzYWdpbmctZW1haWwtb3V0bGluZTo6YmVmb3JlIHsKKwljb250ZW50OiAiXGU2ODAiOworfQorLmljb24tbWVzc2FnZS1zbWFsbDo6YmVmb3JlIHsKKwljb250ZW50OiAiXGU2ODEiOworfQorLmljb24tbWFpbnRlbmFuY2U6OmJlZm9yZSB7CisJY29udGVudDogIlxlNjgyIjsKK30KKy5pY29uLWxvY2F0aW9uLXBpbjo6YmVmb3JlIHsKKwljb250ZW50OiAiXGU2ODMiOworfQorLmljb24tbG9jYXRpb24tcGluLXNtYWxsOjpiZWZvcmUgeworCWNvbnRlbnQ6ICJcZTY4NCI7Cit9CisuaWNvbi1sb2NhbC1zZWFyY2g6OmJlZm9yZSB7CisJY29udGVudDogIlxlNjg1IjsKK30KKy5pY29uLWxvY2FsLWxvbmctZGlzdGFuY2Utb3V0bGluZTo6YmVmb3JlIHsKKwljb250ZW50OiAiXGU2ODYiOworfQorLmljb24tbGlzdDo6YmVmb3JlIHsKKwljb250ZW50OiAiXGU2ODciOworfQorLmljb24tbGVhcm46OmJlZm9yZSB7CisJY29udGVudDogIlxlNjg4IjsKK30KKy5pY29uLWxlYXJuLW91dGxpbmU6OmJlZm9yZSB7CisJY29udGVudDogIlxlNjg5IjsKK30KKy5pY29uLWxhcHRvcDo6YmVmb3JlIHsKKwljb250ZW50OiAiXGU2OGEiOworfQorLmljb24tbGFuZGxpbmU6OmJlZm9yZSB7CisJY29udGVudDogIlxlNjhiIjsKK30KKy5pY29uLWxhbmRsaW5lLW91dGxpbmU6OmJlZm9yZSB7CisJY29udGVudDogIlxlNjhjIjsKK30KKy5pY29uLWludm9pY2VzOjpiZWZvcmUgeworCWNvbnRlbnQ6ICJcZTY4ZCI7Cit9CisuaWNvbi1pbnZvaWNlcy1vdXRsaW5lOjpiZWZvcmUgeworCWNvbnRlbnQ6ICJcZTY4ZSI7Cit9CisuaWNvbi1pbnZlbnRvcnk6OmJlZm9yZSB7CisJY29udGVudDogIlxlNjhmIjsKK30KKy5pY29uLWludHJhbmV0LW91dGxpbmU6OmJlZm9yZSB7CisJY29udGVudDogIlxlNjkwIjsKK30KKy5pY29uLWludGVycHJldGVyOjpiZWZvcmUgeworCWNvbnRlbnQ6ICJcZTY5MSI7Cit9CisuaWNvbi1pbnRlcnByZXRlci1vdXRsaW5lOjpiZWZvcmUgeworCWNvbnRlbnQ6ICJcZTY5MiI7Cit9CisuaWNvbi1pbnRlcm5ldDo6YmVmb3JlIHsKKwljb250ZW50OiAiXGU2OTMiOworfQorLmljb24taW50ZXJuZXQtb3V0bGluZTo6YmVmb3JlIHsKKwljb250ZW50OiAiXGU2OTQiOworfQorLmljb24taW50ZXJuZXQtMjQtb3V0bGluZTo6YmVmb3JlIHsKKwljb250ZW50OiAiXGU2OTUiOworfQorLmljb24taW50ZXJuZXQtMTgtb3V0bGluZTo6YmVmb3JlIHsKKwljb250ZW50OiAiXGU2OTYiOworfQorLmljb24taW50ZXJuYXRpb25hbC1vdXRsaW5lOjpiZWZvcmUgeworCWNvbnRlbnQ6ICJcZTY5NyI7Cit9CisuaWNvbi1pbnRlcm5hdGlvbmFsLWxvbmctZGlzdGFuY2Utb3V0bGluZTo6YmVmb3JlIHsKKwljb250ZW50OiAiXGU2OTgiOworfQorLmljb24taW50ZXJuYXRpb25hbC1kYXRhLW91dGxpbmU6OmJlZm9yZSB7CisJY29udGVudDogIlxlNjk5IjsKK30KKy5pY29uLWluc3RhbGxhdGlvbi1vdXRsaW5lOjpiZWZvcmUgeworCWNvbnRlbnQ6ICJcZTY5YSI7Cit9CisuaWNvbi1pbmZvcm1hdGlvbjo6YmVmb3JlIHsKKwljb250ZW50OiAiXGU2OWIiOworfQorLmljb24taW5mby1zdWNjZXNzOjpiZWZvcmUgeworCWNvbnRlbnQ6ICJcZTY5YyI7Cit9CisuaWNvbi1pbmZvLWFsZXJ0OjpiZWZvcmUgeworCWNvbnRlbnQ6ICJcZTY5ZCI7Cit9CisuaWNvbi1pbmZvLWFsZXJ0LW91dGxpbmU6OmJlZm9yZSB7CisJY29udGVudDogIlxlNjllIjsKK30KKy5pY29uLWluY2x1ZGVkLWNoZWNrbWFyazo6YmVmb3JlIHsKKwljb250ZW50OiAiXGU2OWYiOworfQorLmljb24taW5jbHVkZWQtY2hlY2ttYXJrLW91dGxpbmU6OmJlZm9yZSB7CisJY29udGVudDogIlxlNmEwIjsKK30KKy5pY29uLWhvdHNwb3Q6OmJlZm9yZSB7CisJY29udGVudDogIlxlNmExIjsKK30KKy5pY29uLWhvdHNwb3Qtb3V0bGluZTo6YmVmb3JlIHsKKwljb250ZW50OiAiXGU2YTIiOworfQorLmljb24taG90c3BvdC1hY2Nlc3Mtb3V0bGluZTo6YmVmb3JlIHsKKwljb250ZW50OiAiXGU2YTMiOworfQorLmljb24taG9tZTo6YmVmb3JlIHsKKwljb250ZW50OiAiXGU2YTQiOworfQorLmljb24taGVscDo6YmVmb3JlIHsKKwljb250ZW50OiAiXGU2YTUiOworfQorLmljb24taGVscC1vdXRsaW5lOjpiZWZvcmUgeworCWNvbnRlbnQ6ICJcZTZhNiI7Cit9CisuaWNvbi1oZDo6YmVmb3JlIHsKKwljb250ZW50OiAiXGU2YTciOworfQorLmljb24taGQtb3V0bGluZTo6YmVmb3JlIHsKKwljb250ZW50OiAiXGU2YTgiOworfQorLmljb24taGFtYnVyZ2VyOjpiZWZvcmUgeworCWNvbnRlbnQ6ICJcZTZhOSI7Cit9CisuaWNvbi1ncm91cC1vdXRsaW5lOjpiZWZvcmUgeworCWNvbnRlbnQ6ICJcZTZhYSI7Cit9CisuaWNvbi1ncHM6OmJlZm9yZSB7CisJY29udGVudDogIlxlNmFiIjsKK30KKy5pY29uLWdwcy1vdXRsaW5lOjpiZWZvcmUgeworCWNvbnRlbnQ6ICJcZTZhYyI7Cit9CisuaWNvbi1nby1wYXBlcmxlc3MtZW1haWwtb3V0bGluZTo6YmVmb3JlIHsKKwljb250ZW50OiAiXGU2YWQiOworfQorLmljb24tZ2xvYmFsLW1lc3NhZ2luZy1vdXRsaW5lOjpiZWZvcmUgeworCWNvbnRlbnQ6ICJcZTZhZSI7Cit9CisuaWNvbi1nYW1lcGFkLW91dGxpbmU6OmJlZm9yZSB7CisJY29udGVudDogIlxlNmFmIjsKK30KKy5pY29uLWdhbWUtZGV2aWNlczo6YmVmb3JlIHsKKwljb250ZW50OiAiXGU2YjAiOworfQorLmljb24tZnVsbC1zY3JlZW46OmJlZm9yZSB7CisJY29udGVudDogIlxlNmIxIjsKK30KKy5pY29uLWZvcndhcmQtY2FsbHMtb3V0bGluZTo6YmVmb3JlIHsKKwljb250ZW50OiAiXGU2YjIiOworfQorLmljb24tZm9ydW06OmJlZm9yZSB7CisJY29udGVudDogIlxlNmIzIjsKK30KKy5pY29uLWZvcnVtLW91dGxpbmU6OmJlZm9yZSB7CisJY29udGVudDogIlxlNmI0IjsKK30KKy5pY29uLWZpbHRlcjo6YmVmb3JlIHsKKwljb250ZW50OiAiXGU2YjUiOworfQorLmljb24tZXh0cmFzOjpiZWZvcmUgeworCWNvbnRlbnQ6ICJcZTZiNiI7Cit9CisuaWNvbi1leHR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yIjsKK30KKy5pY29uLWJhc2ljcGhvbmU6OmJlZm9yZSB7CisJY29udGVudDogIlxlNmYzIjsKK30KKy5pY29uLWJhc2ljcGhvbmUtb3V0bGluZTo6YmVmb3JlIHsKKwljb250ZW50OiAiXGU2ZjQiOworfQorLmljb24tYmFyY29kZS1vdXRsaW5lOjpiZWZvcmUgeworCWNvbnRlbnQ6ICJcZTZmNSI7Cit9CisuaWNvbi1iYXItY2hhcnQtdmVydGljYWw6OmJlZm9yZSB7CisJY29udGVudDogIlxlNmY2IjsKK30KKy5pY29uLWJhci1jaGFydC1ob3Jpem9udGFsOjpiZWZvcmUgeworCWNvbnRlbnQ6ICJcZTZmNyI7Cit9CisuaWNvbi1hcnJvdy11cDo6YmVmb3JlIHsKKwljb250ZW50OiAiXGU2ZjgiOworfQorLmljb24tYXJyb3ctdXAtcmlnaHQ6OmJlZm9yZSB7CisJY29udGVudDogIlxlNmY5IjsKK30KKy5pY29uLWFycm93LXVwLWxlZnQ6OmJlZm9yZSB7CisJY29udGVudDogIlxlNmZhIjsKK30KKy5pY29uLWFycm93LXVwLWNpcmNsZTo6YmVmb3JlIHsKKwljb250ZW50OiAiXGU2ZmIiOworfQorLmljb24tYXJyb3ctcmlnaHQ6OmJlZm9yZSB7CisJY29udGVudDogIlxlNmZjIjsKK30KKy5pY29uLWFycm93LXJpZ2h0LWNpcmNsZTo6YmVmb3JlIHsKKwljb250ZW50OiAiXGU2ZmQiOworfQorLmljb24tYXJyb3ctbGVmdDo6YmVmb3JlIHsKKwljb250ZW50OiAiXGU2ZmUiOworfQorLmljb24tYXJyb3ctbGVmdC1jaXJjbGU6OmJlZm9yZSB7CisJY29udGVudDogIlxlNmZmIjsKK30KKy5pY29uLWFycm93LWRvd246OmJlZm9yZSB7CisJY29udGVudDogIlxlNzAwIjsKK30KKy5pY29uLWFycm93LWRvd24tcmlnaHQ6OmJlZm9yZSB7CisJY29udGVudDogIlxlNzAxIjsKK30KKy5pY29uLWFycm93LWRvd24tbGVmdDo6YmVmb3JlIHsKKwljb250ZW50OiAiXGU3MDIiOworfQorLmljb24tYXJyb3ctZG93bi1jaXJjbGU6OmJlZm9yZSB7CisJY29udGVudDogIlxlNzAzIjsKK30KKy5pY29uLWFycm93LWRvdWJsZS1yaWdodDo6YmVmb3JlIHsKKwljb250ZW50OiAiXGU3MDQiOworfQorLmljb24tYXJyb3ctZG91YmxlLWxlZnQ6OmJlZm9yZSB7CisJY29udGVudDogIlxlNzA1IjsKK30KKy5pY29uLWFwcHMtbWVkaWE6OmJlZm9yZSB7CisJY29udGVudDogIlxlNzA2IjsKK30KKy5pY29uLWFwcHMtbWVkaWEtb3V0bGluZTo6YmVmb3JlIHsKKwljb250ZW50OiAiXGU3MDciOworfQorLmljb24tYXBwcy1tYXJrZXRwbGFjZTo6YmVmb3JlIHsKKwljb250ZW50OiAiXGU3MDgiOworfQorLmljb24tYXBwcy1tYXJrZXRwbGFjZS1vdXRsaW5lOjpiZWZvcmUgeworCWNvbnRlbnQ6ICJcZTcwOSI7Cit9CisuaWNvbi1hbmFseXRpY3M6OmJlZm9yZSB7CisJY29udGVudDogIlxlNzBhIjsKK30KKy5pY29uLWFsdC1tZWRpYS1zdWJzY3JpcHRpb24tb3V0bGluZTo6YmVmb3JlIHsKKwljb250ZW50OiAiXGU3MGIiOworfQorLmljb24tYWxsLWxvY2F0aW9uczo6YmVmb3JlIHsKKwljb250ZW50OiAiXGU3MGMiOworfQorLmljb24tYWxsLWRldmljZXM6OmJlZm9yZSB7CisJY29udGVudDogIlxlNzBkIjsKK30KKy5pY29uLWFsbC1kZXZpY2VzLW91dGxpbmU6OmJlZm9yZSB7CisJY29udGVudDogIlxlNzBlIjsKK30KKy5pY29uLWFsYXJtczo6YmVmb3JlIHsKKwljb250ZW50OiAiXGU3MGYiOworfQorLmljb24tYWxhcm1zLW91dGxpbmU6OmJlZm9yZSB7CisJY29udGVudDogIlxlNzEwIjsKK30KKy5pY29uLWFkZHJlc3MtaXAtb3V0bGluZTo6YmVmb3JlIHsKKwljb250ZW50OiAiXGU3MTEiOworfQorLmljb24tYWRkb25zOjpiZWZvcmUgeworCWNvbnRlbnQ6ICJcZTcxMiI7Cit9CisuaWNvbi1hZGRvbnMtb3V0bGluZTo6YmVmb3JlIHsKKwljb250ZW50OiAiXGU3MTMiOworfQorLmljb24tYWRkaXRpb25hbC1zZXJ2aWNlczo6YmVmb3JlIHsKKwljb250ZW50OiAiXGU3MTQiOworfQorLmljb24tYWRkaXRpb25hbC1taW51dGVzLW91dGxpbmU6OmJlZm9yZSB7CisJY29udGVudDogIlxlNzE1IjsKK30KKy5pY29uLWFkZC13aWRnZXQ6OmJlZm9yZSB7CisJY29udGVudDogIlxlNzE2IjsKK30KKy5pY29uLWFjdGl2aXR5LWZlZWQ6OmJlZm9yZSB7CisJY29udGVudDogIlxlNzE3IjsKK30KKy5pY29uLWFjY2Vzc29yaWVzOjpiZWZvcmUgeworCWNvbnRlbnQ6ICJcZTcxOCI7Cit9CisuaWNvbi1hY2Nlc3Nvcmllcy1vdXRsaW5lOjpiZWZvcmUgeworCWNvbnRlbnQ6ICJcZTcxOSI7Cit9CisuaWNvbi1mb3VuZGF0aW9uLWFjY291bnQ6OmJlZm9yZSB7CisJY29udGVudDogIlxlNzFhIjsKK30KKy5pY29uLWJpbGxpbmctYWNjb3VudDo6YmVmb3JlIHsKKwljb250ZW50OiAiXGU3MWIiOworfQorLmljb24taW5maW5pdGU6OmJlZm9yZSB7CisJY29udGVudDogIlxlNzFjIjsKK30KKy5pY29uLXNvY2lhbC1idXNpbmVzcy1jb21tdW5pdHk6OmJlZm9yZSB7CisJY29udGVudDogIlxlNzFkIjsKK30KKy5pY29uLXNvY2lhbC1mYWNlYm9vazo6YmVmb3JlIHsKKwljb250ZW50OiAiXGU3MWUiOworfQorLmljb24tc29jaWFsLWZlZWQ6OmJlZm9yZSB7CisJY29udGVudDogIlxlNzFmIjsKK30KKy5pY29uLXNvY2lhbC1nb29nbGUtcGx1czo6YmVmb3JlIHsKK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6ZSB7CisJZm9udC1zaXplOiAzMHB4OworfQorLmJ1aS1oMy1zaXplIHsKKwlmb250LXNpemU6IDIxcHg7Cit9CisuYnVpLWg0LXNpemUgeworCWZvbnQtc2l6ZTogMTVweDsKK30KKy5idWktaDUtc2l6ZSB7CisJZm9udC1zaXplOiAxM3B4OworfQorLmJ1aS1oNi1zaXplIHsKKwlmb250LXNpemU6IDExcHg7Cit9CisuYnVpLWYxMC1zaXplIHsKKwlmb250LXNpemU6IDEwcHg7Cit9CisuYnVpLWYxMS1zaXplIHsKKwlmb250LXNpemU6IDExcHg7Cit9CisuYnVpLWYxMi1zaXplIHsKKwlmb250LXNpemU6IDEycHg7Cit9CisuYnVpLWYxNC1zaXplIHsKKwlmb250LXNpemU6IDE0cHg7Cit9CisuYnVpLWYxNi1zaXplIHsKKwlmb250LXNpemU6IDE2cHg7Cit9CisuYnVpLWYxOC1zaXplIHsKKwlmb250LXNpemU6IDE4cHg7Cit9CisuYnVpLWYyMC1zaXplIHsKKwlmb250LXNpemU6IDIwcHg7Cit9CisuYnVpLWYyNi1zaXplIHsKKwlmb250LXNpemU6IDI2cHg7Cit9CisuYnVpLWYzMi1zaXplIHsKKwlmb250LXNpemU6IDMycHg7Cit9CisuYnVpLWYzNi1zaXplIHsKKwlmb250LXNpemU6IDM2cHg7Cit9CisuYnVpLWY1MC1zaXplIHsKKwlmb250LXNpemU6IDUwcHg7Cit9CisuYnVpLWY2MC1zaXplIHsKKwlmb250LXNpemU6IDYwcHg7Cit9CisuYnVpLWxoLTUgeworCWxpbmUtaGVpZ2h0OiA1cHg7Cit9CisuYnVpLWxoLTEwIHsKKwlsaW5lLWhlaWdodDogMTBweDsKK30KKy5idWktbGgtMTUgeworCWxpbmUtaGVpZ2h0OiAxNXB4OworfQorLmJ1aS1saC0yMCB7CisJbGluZS1oZWlnaHQ6IDIwcHg7Cit9CisuYnVpLWxoLTI1IHsKKwlsaW5lLWhlaWdodDogMjVweDsKK30KKy5idWktbGgtMzAgeworCWxpbmUtaGVpZ2h0OiAzMHB4OworfQorLmJ1aS1saC0zNSB7CisJbGluZS1oZWlnaHQ6IDM1cHg7Cit9CisuYnVpLWxoLTQwIHsKKwlsaW5lLWhlaWdodDogNDBweDsKK30KKy5idWktbGgtNDUgeworCWxpbmUtaGVpZ2h0OiA0NXB4OworfQorLmJ1aS1saC01MCB7CisJbGluZS1oZWlnaHQ6IDUwcHg7Cit9CisuYnVpLWxoLTU1IHsKKwlsaW5lLWhlaWdodDogNTVweDsKK30KKy5idWktbGgtNjAgeworCWxpbmUtaGVpZ2h0OiA2MHB4OworfQorLmJ1aS1saC02NSB7CisJbGluZS1oZWlnaHQ6IDY1cHg7Cit9CisuYnVpLWxoLTcwIHsKKwlsaW5lLWhlaWdodDogNzBweDsKK30KKy5idWktbGgtNzUgeworCWxpbmUtaGVpZ2h0OiA3NXB4OworfQorLmJ1aS1saC04MCB7CisJbGluZS1oZWlnaHQ6IDgwcHg7Cit9CisuYnVpLWxoLTg1IHsKKwlsaW5lLWhlaWdodDogODVweDsKK30KKy5idWktbGgtOTAgeworCWxpbmUtaGVpZ2h0OiA5MHB4OworfQorLmJ1aS1saC05NSB7CisJbGluZS1oZWlnaHQ6IDk1cHg7Cit9CisuYnVpLWxoLTEwMCB7CisJbGluZS1oZWlnaHQ6IDEwMHB4OworfQoraDEgeworCW1hcmdpbjogMHB4OyBmb250LXNpemU6IDQycHg7Cit9CisuYnVpLWgxIHsKKwltYXJnaW46IDBweDsgZm9udC1zaXplOiA0MnB4OworfQoraDIgeworCWZvbnQtc2l6ZTogMzBweDsKK30KKy5idWktaDIgeworCWZvbnQtc2l6ZTogMzBweDsKK30KK2gzIHsKKwlmb250LXNpemU6IDIxcHg7Cit9CisuYnVpLWgzIHsKKwlmb250LXNpemU6IDIxcHg7Cit9CitoNCB7CisJZm9udC1zaXplOiAxNXB4OworfQorLmJ1aS1oNCB7CisJZm9udC1zaXplOiAxNXB4OworfQoraDUgeworCWZvbnQtc2l6ZTogMTNweDs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m15R3JpZCB0ci56LXJvdyB0ZC56LXJvdy1pbm5lcnsKKwlib3JkZXI6IDBweCAgcmdiKDI0MiwgMjQyLCAyNDIpOworCWJvcmRlci1yaWdodDogMHB4IHNvbGlkIHRyYW5zcGFyZW50OworCXBhZGRpbmc6IDBweDsKK30KKy5teUdyaWQgdHIuei1yb3ctb3Zlcj50ZC56LXJvdy1pbm5lcj4uei1yb3ctY250IHsKKwljb2xvcjogIzAwNTQ3QTsKK30KKworLmViei1yYWRpb0RpdnsKKwlib3JkZXI6IDFweCBzb2xpZCAjOEZCOUQwOyAKKwlwYWRkaW5nOjEwcHg7IgorfQorLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLworLyoqKioqKioqKioqKioqKioqKioqKioqKioqKiogZm9sbG93aW5nIGlzIGZvciBidXR0b24qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLworLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLworLmZuLWViei1idG4sIC5mbi1lYnotYnRuLnN0ZHsKKwktd2Via2l0LWJvcmRlci1yYWRpdXM6IDZweDsKKwkgIC1tb3otYm9yZGVyLXJhZGl1czogNnB4OworCSAgICAgICBib3JkZXItcmFkaXVzOiA2cHg7CisJaGVpZ2h0OiA0MHB4OworCXBhZGRpbmctbGVmdDogMzBweDsKKwlwYWRkaW5nLXJpZ2h0OiAzMHB4OworCWZvbnQtc2l6ZTogMThweDsKKwl0ZXh0LWFsaWduOiBjZW50ZXI7CisJYm9yZGVyOiAwcHg7CisJY3Vyc29yOiBwb2ludGVyOworCWNvbG9yOiByZ2JhKDI1NSwyNTUsMjU1LDEpOworIAltYXJnaW4tdG9wOjVweDsgCisgCW1hcmdpbi1ib3R0b206NXB4OyAKK30KKy5mbi1lYnotYnRuLnNtIH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9pbWFnZXMvZm4tZWJ6LWNzcy9wcm9jZXNzaW5nLmdpZiIpIG5vLXJlcGVhdDsKKwliYWNrZ3JvdW5kLXBvc2l0aW9uOiBjZW50ZXI7CisJYmFja2dyb3VuZC1jb2xvcjogcmdiYSgyMTEsIDIxMSwgMjExLCAxKSAhaW1wb3J0YW50OworfQorLmZuLWViei1idG4uZGlyZWN0aW9uYWw6OmFmdGVyeworCWNvbnRlbnQ6ICIgXDIxOTIiOworCXZlcnRpY2FsLWFsaWduOiBtaWRkbGU7Cit9CisKKy8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLworLyoqKioqKioqKioqKioqKioqKioqKioqKioqKiogZm9sbG93aW5nIGlzIGZvciBsYWJlbCoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCisvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KKy8qLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0qLworLyotLS0tIGZvbnQtc2l6ZSBydWxlcyBmb3IgbGFiZWwsIHNwZWNpZnkgdG9wIGF0dHIgd2hlbiBjaGFuZ2UgZm9udCBzaXplIG9mIGxhYmVsIC0tLSovCisvKi0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSB0b3A6IC0oZm9udC1zaXplKXB4IC0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tKi8KKy8qLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0qLworbGFiZWwuZm4tZWJ6LXRleHQtbGFiZWwsbGFiZWwuZm4tZWJ6LXNlbGVjdC1sYWJlbHsKKwlwb3NpdGlvbjogYWJzb2x1dGU7CisJY29sb3I6ICM0NDQ0NDQ7CisJbGVmdDowcHg7CisJdG9wOiAtNXB4OworCXdoaXRlLXNwYWNlOm5vd3JhcDsKKwlmb250LWZhbWlseSA6YXJpYWw7CisJLypmb250LXNpemU6IDEycHg7Ki8gCisJZm9udC1zaXplOiAuNzVyZW07Cit9CitsYWJlbC5mbi1lYnotcmFkaW9idG4tbGFiZWwgeworCWJhY2tncm91bmQtaW1hZ2U6IHVybCguLi9pbWFnZXMvZm4tZWJ6LWNzcy9yYWRpb19idG4ucG5nKTsKKwktd2Via2l0LXRvdWNoLWNhbGxvdXQ6IG5vbmU7CisJLXdlYmtpdC11c2VyLXNlbGVjdDogbm9uZTsKKwkta2h0bWwtdXNlci1zZWxlY3Q6IG5vbmU7CisJLW1vei11c2VyLXNlbGVjdDogbm9uZTsKKwktbXMtdXNlci1zZWxlY3Q6IG5vbmU7CisJdXNlci1zZWxlY3Q6IG5vbmU7Cit9CisKKy8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLworLyoqKioqKioqKioqKioqKioqKioqKioqKioqKiogZm9sbG93aW5nIGlzIGZvciB0ZXh0IGZpZWxkICoqKioqKioqKioqKioqKioqKioqKioqKioqKiovCisvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KK2lucHV0W3R5cGU9InBhc3N3b3JkIl0uZm4tZWJ6LXRleHR7CisJCQorCS13ZWJraXQtYm9yZGVyLXJhZGl1czogNnB4OworCSAgICAtbW96LWJvcmRlci1yYWRpdXM6IDZweDsKKwkgICAgICAgICBib3JkZXItcmFkaXVzOiA2cHg7CisJbWFyZ2lu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KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCisvKioqKioqKioqKioqKioqKioqKioqKioqIGZvbGxvd2luZyBpcyBmb3IgZXJyb3JzIGFuZCB2YWxpZCAqKioqKioqKioqKioqKioqKioqKiovCisvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCisuZm4tZWJ6LWVycm9yeworCWJvcmRlcjogMXB4IHNvbGlkIHJlZCAhaW1wb3J0YW50OworfQorLmZuLWViei1lcnJvckdlbmVyaWN7CisJYm9yZGVyOiAxcHggc29saWQgcmVkICFpbXBvcnRhbnQ7Cit9CisuZm4tZWJ6LWVycm9yR2VuZXJpYyArIGxhYmVsLmZuLWViei10ZXh0LWxhYmVsOjphZnRlciwuZm4tZWJ6LWVycm9yR2VuZXJpYyArIGxhYmVsLmZuLWViei1zZWxlY3QtbGFiZWw6OmFmdGVyeworCWNvbnRlbnQ6IHVybCgiLi4vaW1hZ2VzL2ZuLWViei1jc3MvZXJyb3Jfc2lnbl9nZW5lcmljLnBuZyIpOworCWJhc2VsaW5lLXNoaWZ0OiAtMnB4OworCW1hcmdpbi1sZWZ0OiAxMHB4OworfQorLmZuLWViei12YWxpZElucHV0eworCWJvcmRlcjogMXB4IHNvbGlkIGdyZWVuICFpbXBvcnRhbnQ7Cit9CisuZm4tZWJ6LXZhbGlkSW5wdXQgKyBsYWJlbC5mbi1lYnotdGV4dC1sYWJlbDo6YWZ0ZXJ7CisJY29udGVudDogdXJsKCIuLi9pbWFnZXMvZm4tZWJ6LWNzcy93YXJuaW5nX3NpZ24ucG5nIikgdXJsKCIuLi9pbWFnZXMvZm4tZWJ6LWNzcy8xMHB4X3NwYWNlLnBuZyIpIHVybCgiLi4vaW1hZ2VzL2ZuLWViei1jc3MvdmFsaWRfY2hlY2sucG5nIik7CisJYmFzZWxpbmUtc2hpZnQ6IC0ycHg7CisJbWFyZ2luLWxlZnQ6NXB4OworCW1hcmdpbi1yaWdodDo1cHg7Cit9CisuZm4tZWJ6LXZhbGlkSW5wdXQgKyBsYWJlbC5mbi1lYnotc2VsZWN0LWxhYmVseworCWNvbG9yOiBncmVlbjsKK30KKy5mbi1lYnotdmFsaWRJbnB1dCArIGxhYmVsLmZuLWViei1zZWxlY3QtbGFiZWw6OmFmdGVyeworCWNvbnRlbnQ6IHVybCgiLi4vaW1hZ2VzL2ZuLWViei1jc3MvdmFsaWRfY2hlY2sucG5nIik7CisJYmFzZWxpbmUtc2hpZnQ6IC0ycHg7CisJbWFyZ2luLWxlZnQ6MTBweDsKK30KKworLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCisvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiBGb2xsb3dpbmcgaXMgZm9yIHRvb2x0aXBzICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KKy8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLworc3Bhbi5mbi1lYnotdG9vbHRpcCxzcGFuLmZuLWViei10b29sdGlwLnNvdXRoeworCXBvc2l0aW9uOiBhYnNvbHV0ZTsKKwloZWlnaHQ6IDMwcHg7CisJdG9wOiA5MCU7CisJbGVmdDogMCU7CisJbGluZS1oZWlnaHQ6IDMwcHg7CisJdGV4dC1hbGlnbjogY2VudGVyOworCXZpc2liaWxpdHk6aGlkZGVuOworCWJvcmRlci1yYWRpdXM6IDZweDsKKwlwYWRkaW5nLWxlZnQ6MTBweDsKKwlwYWRkaW5nLXJpZ2h0OjEwcHg7CisJb3BhY2l0eTogMC43OworCXotaW5kZXg6IDk5OTsKKwlmb250LXdlaWdodDpib2xkOworCWZvbnQ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9yZSB7CisJYm9yZGVyOiAwOworfQorc3Bhbi5mbi1lYnotdG9vbHRpcC5lcnJvci5zb3V0aDo6YWZ0ZXIgeworCWJvcmRlci1ib3R0b206IDhweCBzb2xpZCAjRkYwMDAwICFpbXBvcnRhbnQ7Cit9CitzcGFuLmZuLWViei10b29sdGlwLmVycm9yLm5vcnRoOjphZnRlciB7CisJYm9yZGVyLXRvcDogOHB4IHNvbGlkICNGRjAwMDAgIWltcG9ydGFudDsKK30KK3NwYW4uZm4tZWJ6LXRvb2x0aXAud2FybmluZyB7CisJY29sb3I6IGJsYWNrOworCXBhZGRpbmctbGVmdDozMHB4OworCWJhY2tncm91bmQ6IHVybCgiLi4vaW1hZ2VzL2ZuLWViei1jc3Mvd2FybmluZ19zaWduLnBuZyIpIG5vLXJlcGVhdCA7CisJYmFja2dyb3VuZC1wb3NpdGlvbjogMTBweCA3cHg7IAorCWJhY2tncm91bmQtY29sb3I6IG9yYW5nZTsgCisJYm9yZGVyOiAwOworfQorc3Bhbi5mbi1lYnotdG9vbHRpcC53YXJuaW5nLnNvdXRoOjphZnRlciB7CisJYm9yZGVyLWJvdHRvbTogOHB4IHNvbGlkIG9yYW5nZSAhaW1wb3J0YW50OworfQorc3Bhbi5mbi1lYnotdG9vbHRpcC53YXJuaW5nLm5vcnRoOjphZnRlciB7CisJYm9yZGVyLWJvdHRvbTogOHB4IHNvbGlkIG9yYW5nZSAhaW1wb3J0YW50OworfQorCisvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KKy8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqIEZvbGxvd2luZyBpcyBmb3IgRHJvcGRvd24gKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLworLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKio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KKwliYWNrZ3JvdW5kOiB1cmwoLi4vaW1hZ2VzL2ZuLWViei1jc3MvdXBfYXJyb3cucG5nKSBuby1yZXBlYXQgcmlnaHQ7Cit9CitzZWxlY3QuZm4tZWJ6LWRyb3Bkb3duOmZvY3VzICsgbGFiZWwuZm4tZWJ6LXNlbGVjdC1sYWJlbHsKKwljb2xvcjogcmdiYSgwLDE0NSwyMTcsMSk7Cit9CisKK3NlbGVjdC5mbi1lYnotZHJvcGRvd24ubWVkaXVteworCXdpZHRoOjE1MHB4OworCWhlaWdodDoyOXB4OworCW1hcmdpbjphdXRvOworCisgICAgcGFkZGluZy1yaWdodDogMTBweDsKKyAgIAorICAgIHBhZGRpbmctbGVmdDogMTBweDsKK30KKworc2VsZWN0LmZuLWViei1kcm9wZG93bi5sYXJnZXsKKyAgICBoZWlnaHQ6IDM2cHg7CisgICAgZm9udC1zaXplOjE0cHg7Cit9CisKKy5teWRyb3Bkb3dueworCWNvbG9yOmdyYXk7IAorCS8qZm9udC1zaXplOjExcHg7Ki8KKwlmb250LXNpemU6IC44NzVyZW07CQorfQorc2VsZWN0LmZuLWViei1kcm9wZG93bi5zZWFyY2h7CisJd2lkdGg6MjAwcHg7CisJaGVpZ2h0OjMwcHg7CisJbWFyZ2luOmF1dG87CisJcGFkZGluZzowcHg7Cit9CisvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KKy8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogZm9sbG93aW5nIGlzIGZvciByYWRpbyBidXR0b24gKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLworLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCitkaXYuZm4tZWJ6LWNvbnRhaW5lcj5pbnB1dF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qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCisvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqIGZvbGxvd2luZyBpcyBoZWFkZXIgYW5kIGZvb3RlciAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCisvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KKworIC5lYnpfZm9vdGVyIHsKKyAgICAvKmNsZWFyOiBib3RoOyovCisgICAgYm9yZGVyLXdpZHRoOiAwcHggMXB4IDBweCAxcHg7IGJvcmRlci1zdHlsZTogCisgICAgc29saWQ7IGJvcmRlci1jb2xvcjogIzk1OTU5NTsKKyAgCWZvbnQtZmFtaWx5OiBpbmhlcml0OworICAgIGZvbnQtc2l6ZTogMTJweDsgICAgCisgICAgcGFkZGluZzogICAxMHB4IDEwcHggMzBweCAxMHB4OworICAgIC8qIGJhY2tncm91bmQ6IHJnYmEoNiwgMTI0LCAxODAsIDAuODIpICFpbXBvcnRhbnQ7ICovCisgICAgYmFja2dyb3VuZDogIzA2N0FCNDsKKyAgICBjb2xvcjogd2hpdGU7CisgIH0KKyAgCisgIC5lYnpfaGVhZGVyIHsKKwkgICBib3JkZXItd2lkdGg6IDBweCAxcHggMHB4IDFweDsgYm9yZGVyLXN0eWxlOiAKKwkgICAgc29saWQ7IAorCSAgICBib3JkZXItY29sb3I6ICM5NTk1OTU7CisJICAgIGZvbnQtc2l6ZTogMTJweDsKKwkgICAgZm9udC1mYW1pbHk6IGluaGVyaXQ7ICAgIAorICB9CisgIAorICAuZWJ6X2hlYWRlci5sZXZlbDEgeworICAJCWJhY2tncm91bmQ6ICMyMjY0ODU7CisgIAkJY29sb3I6IHdoaXRlOworICB9CisgCisgIC5lYnpfaGVhZGVyLmxldmVsMiB7CisJCSAgYmFja2dyb3VuZDogIzA2N0FCNDsKKwkJICBwYWRkaW5nOiAgIDEwcHggMTBweCAxNXB4IDEwcHg7CisJCSAgY29sb3I6IHdoaXRlOworCQkgIGZvbnQtc2l6ZTogMjBweDsKKyAgfQorIAorICAuZWJ6X2hlYWRlci5sZXZlbDMgeworCSAgYmFja2dyb3VuZDogd2hpdGU7CisJICBwYWRkaW5nOiAgIDEwcHggMTBweCAxMHB4IDEwcHg7CisJICBjb2xvcjogYmxhY2s7CisgIH0KKyAgCisvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KKy8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogZm9sbG93aW5nIGlzIGZvciBncmlkIGluIHVzZXIgcGFnZSAqKioqKioqKioqKioqKioqKioqKioqKioqKioqLworLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCisgICAgLmhlYWRpbmcxeworCQlmb250LWZhbWlseTogb21uZXNfYXR0X2xpZ2h0IDsKKwkJZm9udC1zaXplOiAzNnB4OworCQljb2xvcjogIzQ0NDQ0NDsKKwkJbWFyZ2luOjA7CisJCXBhZGRpbmc6MDsKKwkJZm9udC13ZWlnaHQ6IG5vcm1hbDsKKwl9CQkKKwkKKwkuaGVhZGluZzJ7CisJICAgIGZvbnQtZmFtaWx5OiBvbW5lc19hdHRfbGlnaHQgOworCQlmb250LXNpemU6IDI0cHg7CisJCWNvbG9yOiAjNDQ0NDQ0OworCQltYXJnaW46MDsKKwkJcGFkZGluZzowOworCQlmb250LXdlaWdodDogbm9ybWFsOworCX0KKwkKKwkuaGVhZGluZzN7CisJICBmb250LWZhbWlseTogb21uZXNfYXR0X2xpZ2h0IDsKKwkJZm9udC1zaXplOiAxN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CisJCWhlaWdodDogN3B4OworCX0KKwkKKy8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLworLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiBmb2xsb3dpbmcgaXMgZm9yIGluZm8gbGFiZWwgKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCisvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KKworCS5mbi1lYnotaW5mby1sYWJlbCB7CisJCWRpc3BsYXk6IGlubGluZS1ibG9jazsKKyAJCXdpZHRoOiAzMDBweDsKKwkJY29sb3I6IGJsYWNrOworCQlwYWRkaW5nLWxlZnQ6MzBweDsKKwkJYmFja2dyb3VuZDogdXJsKCIuLi9pbWFnZXMvaW5mb19ibHVlLmpwZyIpIG5vLXJlcGVhdDsKKwkJYmFja2dyb3VuZC1wb3NpdGlvbjp0b3AgbGVmdDsKKwl9CisJCisvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KKy8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogZm9sbG93aW5nIGlzIGZvciBMaXN0Qm94ICAqKioqKioqKioqKioqKioqKioqKioqKioqKioqLworLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCisgCisgLypUbyBjaGFuZ2UgdGhlIGhlYWRlciBjb2xvciB0byBncmF5Ki8KKyAJIC5teWxpc3Rib3ggLnotbGlzdGJveC1oZWFkZXIgdHIuei1saXN0aGVhZCwubXlsaXN0aGVh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GlkZGVuOworCQkJem9vbTogMTsKKwkJCWJhY2tncm91bmQ6ICNGRkY7CisJCQlib3JkZXI6IG5vbmU7CisJCQliYWNrZ3JvdW5kLWltYWdlOiBub25lOworCQl9CisJLm15bGlzdGJveCAuei1saXN0Y2VsbC1jbnQgeworCQlmb250LXNpemU6IDEzcHg7CisJCWZvbnQtZmFtaWx5OiBhcmlhbDsKKwkJCQorCX0KKwkKKwlkaXYuZWJ6LWxpc3Rib3ggeworCQloZWlnaHQ6MzUwcHg7CisJCWJvcmRlcjoxcHggc29saWQgYmxhY2s7CisJCW92ZXJmbG93OmF1dG8gOyAKKwkJYm9yZGVyLXJhZGl1czogNnB4OyAKKwkJYm9yZGVyLWNvbG9yOnJnYigxMDUsIDEzOCwgMTU0KTsgCisJCWJhY2tncm91bmQtY29sb3I6IHJnYigyNTUsIDI1NSwgMjU1KTsgCisJCXBhZGRpbmc6MTBweDsgCisJCS13ZWJraXQtYm9yZGVyLXJhZGl1czogMTBweDsgIAorCQktbW96LWJvcmRlci1yYWRpdXM6IDEwcHg7CisJfQorCisvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KKy8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogZm9sbG93aW5nIGlzIGZvciBidXR0byBvbiBMb2NhdGlvblBob25lTm9zTGlzdCAgKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KKy8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLworCisJCS5teUNvbWJvYm94VGV4dGJveCAuei1jb21ib2JveCAuei1jb21ib2JveC1pbnB7CisJCQlib3JkZXI6IDFweCBzb2xpZCAjRTZFNkU2OyAJYm9yZGVyLXRvcC1jb2xvcjogI0IyQjJCMjsgCWJvcmRlci1yaWdodDogMDsgcGFkZGluZzogMnB4OworCQkJYm9yZGVyLXJhZGl1czogNnB4IDAgMCAycHg7IC1tb3otYm9yZGVyLXJhZGl1czogMnB4IDAgMCAycHg7IC13ZWJraXQtYm9yZGVyLXJhZGl1czogNnB4IDAgMCAycHg7IGhlaWdodDogMjVweDsKKwkJfQorCSAJLm15emtCdG57CisJCQljb2xvcjpncmF5OyAtd2Via2l0LWJvcmRlci1yYWRpdXM6IDZweDsgIC1tb3otYm9yZGVyLXJhZGl1czogNnB4OyBib3JkZXItcmFkaXVzOiA2cHg7IGhlaWdodDogMzJweDsgd2lkdGg6MzJweDsgYmFja2dyb3VuZDp3aGl0ZTsgbWFyZ2luLXRvcDo4cHg7CisJCX0gCisJCS5teVRleHRib3h7CisJCQlwYWRkaW5nLWxlZnQ6IDhweDsgYm9yZGVyLXJhZGl1czogNnB4OyBoZWlnaHQ6IDMwcHg7IHdpZHRoOiAxNTBweDsKKwkJfQorLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCisvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqIGZvbGxvd2luZyBpcyBmb3IgRGFzaGJvYXJkICoqKioqKioqKioqKioqKioqKioqKioqKioqKiovCisvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KKwkJLmViel9kYXNoYm9hcmQgLnotcGFuZWwtYnIsLmViel9kYXNoYm9hcmQgLnotcGFuZWwtY3IsLmViel9kYXNoYm9hcmQgLnotcGFuZWwtY2wsLmViel9kYXNoYm9hcmQgLnotcGFuZWwtaHIsLmViel9kYXNoYm9hcmQgLnotcGFuZWwtdHIsLmViel9kYXNoYm9hcmQgLnotcGFuZWwtaGx7CisJCQliYWNrZ3JvdW5kLWltYW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Ym9hcmRfc2VhcmNoX2RkIC5zZWxlY3QyLXJlc3VsdHN7CisgICAgIAkgIG1hcmdpbjogLTRweCAwIDA7CisgICAgICAgfQorICAgICAgIC5mbl9lYnpfZGFzaGJvYXJkX3NlYXJjaF9kZCAuc2VsZWN0Mi1kcm9wZG93bi1vcGVuIC5zZWxlY3QyLWNob2ljZXsKKyAgICAgICAJYm9yZGVyLXRvcC1yaWdodC1yYWRpdXM6MCAhaW1wb3J0YW50OyAKKyAgICAgICB9CisgICAgICAgLmZuX2Viel9kYXNoYm9hcmRfc2VhcmNoX2RkIC5zZWxlY3QyLWNvbnRhaW5lciAuc2VsZWN0Mi1jaG9pY2UgLnNlbGVjdDItYXJyb3d7CisgICAgICAgCWJvcmRlci10b3AtcmlnaHQtcmFkaXVzOjAgIWltcG9ydGFudDsgCisgICAgICAgfQorICAgICAgLmZuX2Viel9kYXNoYm9hcmRfc2VhcmNoX2J1dHRvbiAuYnV0dG9uIHsKKyAgICAgICAJIHBhZGRpbmc6NnB4OworICAgICAgIAkgYm9yZGVyLWJvdHRvbS1sZWZ0LXJhZGl1czowcHg7CisgICAgICAgCSBib3JkZXItdG9wLWxlZnQtcmFkaXVzOjBweDsKKyAgICAgICB9CisgICAgICAgLmZuX2Viel9kYXNoYm9hcmRfaW5wdXR7CisJICAgICAgIGJhY2tncm91bmQ6d2hpdGUgIWltcG9ydGFudDsgCisJICAgICAgIGJvcmRlci1yYWRpdXM6MCAwIDAgMCAhaW1wb3J0YW50OyAJCisJICAgICAgIGZvbnQtZmFtaWx5OmFyaWFsICFpbXBvcnRhbnQ7IAorCSAgICAgICBoZWlnaHQ6MzBweCAhaW1wb3J0YW50OyAgIGJvcmRlci1sZWZ0LXdpZHRoOiAwcHggIWltcG9ydGFudDsgICAKKwkgICAgICAgcGFkZGluZy1ib3R0b206IDlweCAhaW1wb3J0YW50OworICAgICAgIH0KKy8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLworLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiBmb2xsb3dpbmcgaXMgZm9yIGxvY2F0aW9uIE1hbmFnZSAqKioqKioqKioqKioqKioqKioqKioqKioqKioqLworLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCisKKwkuZWJ6X2xvY2F0aW9uX21hbmFnZSB0ci56LWxpc3RpdGVtLXNlbGQgLnotbGlzdGNlbGwtY250LC5lYnpfbG9jYXRpb25fbWFuYWdlIHRyLnotbGlzdGl0ZW0tb3Zlci1zZWxkIC56LWxpc3RjZWxsLWNudCwuZWJ6X2xvY2F0aW9uX21hbmFnZSB0ci56LWxpc3RpdGVtLW92ZXIgLnotbGlzdGNlbGwtY250eworCQljb2xvcjpibGFjazsKKwl9CisJLmViel9sb2NhdGlvbl9tYW5hZ2UgZGl2LnotbGlzdGJveC1oZWFkZXIgdGguei1hdXhoZWFkZXJ7CisJCWJvcmRlcjpub25lOworCX0gCisJLmViel9sb2NhdGlvbl9tYW5hZ2UgZGl2LnotbGlzdGJveC1oZWFkZXIgZGl2LnotYXV4aGVhZGVyLWNudHsKKwkJcGFkZGluZy1ib3R0b206MDsKKwl9CisJLmViel9sb2NhdGlvbl9tYW5hZ2UgZGl2LnotbGlzdGJveC1mb290ZXIgLnotbGlzdGZvb3RlciwuZWJ6X2xvY2F0aW9uX21hbmFnZSBkaXYuei1saXN0Ym94LWZvb3RlcnsKKwkJYmFja2dyb3VuZDogbm9uZTsKKwkJYm9yZGVyOm5vbmU7CisJfQorCS5lYnpfbG9jYXRpb25fbWFuYWdlIGRpdi56LWxpc3Rib3gtZm9vdGVyIHRhYmxlIHsKKwkJbWFyZ2luOjA7CisJfQorCQkKKy8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLworLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiBmb2xsb3dpbmcgaXMgZm9yIENhbGxGb3dhcmRBZGQgKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KKy8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLworCisubXlobGF5b3V0IC56LWhsYXlvdXQtaW5uZXIgeworCXZlcnRpY2FsLWFsaWduOiBtaWRkbGU7Cit9CisKKy5teWhsYXlvdXR7CisJcG9zaXRpb246cmVsYXRpdmU7IGxlZnQ6NTVweDsKK30gCisKKy8qIGRpdi50aWxleworCWRpc3BsYXk6IHRhYmxlLWNlbGw7CisJcG9zaXRpb246IHJlbGF0aXZlOworCWhlaWdodDo1MCU7CisJYm9yZGVyOiAxcHggc29saWQgZ3JleTsKKwlib3JkZXItcmFkaXVzOiAxNXB4OyAKK30KK2Rpdi50aWxlLWNvbnRlbnR7CisJbWFyZ2luOiAwOworCXBhZGRpbmc6IDIwcHggMjBweCAxMDBweCAyMHB4OworCWhlaWdodDoxMDAlOworfQorZGl2LnRpbGUud2l0aG91dF9zYXZlX2J0biAudGlsZS1jb250ZW50eworCXBhZGRpbmctYm90dG9tOiAyMHB4OworfQorZGl2LmRldGFpbHsKKwlwYWRkaW5nLWxlZnQ6NSU7CisgICAJd2lkdGg6IDEwMCU7CisgICAJaGVpZ2h0OjEwMCU7CisgICAJZGlzcGxheTogdGFibGU7CisgICAJdGFibGUtbGF5b3V0OiBmaXhlZDsgICAJCisJYm9yZGVyLXNwYWNpbmc6IDVweDsKK30KK2Rpdi5kZXRhaWwtcm93eworCWRpc3BsYXk6dGFibGUtcm93OyAKKwl3aWR0aDoxMDAlOworCWhlaWdodDoxMDAlOworfSAqLworLnJpZ2h0LWJvdHRvbXsKKwlwb3NpdGlvbjphYnNvbHV0ZTsKKwlyaWdodDoyMHB4OworCXRvcDo0MHB4OworfQorCisubHJlZCAudGFnc19faXRlbS0tY29sb3IudGFnc19faXRlbSAudGFnc19faXRlbS0tY29sb3ItaWNvbnsKKwliYWNrZ3JvdW5kOnJlZDsKKwlib3JkZXItY29sb3I6IHJlZDsJCisJei1pbmRleDowOworfQorLmxyZWQgLnRhZ3NfX2l0ZW0udGFnc19faXRlbS0tY29sb3J7CisJYm9yZGVyOm5vbmU7Cit9CisubHJlZCAudGFnc19faXRlbS50YWdzX19pdGVtLS1jb2xvcjphY3RpdmV7CisJYmFja2dyb3VuZDpub25lOworfQorCisubGdyZWVuIC50YWdzX19pdGVtLS1jb2xvci50YWdzX19pdGVtIC50YWdzX19pdGVtLS1jb2xvci1pY29ueworCWJhY2tncm91bmQ6IzExODgxNzsKKwlib3JkZXItY29sb3I6ICMxMTg4MTc7CQorCXotaW5kZXg6MDsKK30KKy5sZ3JlZW4gLnRhZ3NfX2l0ZW0udGFnc19faXRlbS0tY29sb3J7CisJYm9yZGVyOm5vbmU7Cit9CisubGdyZWVuIC50YWdzX19pdGVtLnRhZ3NfX2l0ZW0tLWNvbG9yOmFjdGl2ZXsKKwliYWNrZ3JvdW5kOm5vbmU7Cit9CisKKwordWwudGFiIHsKKyAgICBsaXN0LXN0eWxlOiBub25lOworICAgIHBhZGRpbmc6IDA7CisgICAgbWFyZ2luOiAwOworfQordWwudGFiIGxpIHsKKyAgICBmbG9hdDogbGVmdDsKKyAgICBib3JkZXI6IDFweCBzb2xpZCAjMDAwOworICAgIGJvcmRlci1ib3R0b20td2lkdGg6IDA7CisgICAgbWFyZ2luOiAzcHggM3B4IDBweCAzcHg7CisgICAgcGFkZGluZzogNXB4IDVweCAwcHggNXB4OworICAgIGJhY2tncm91bmQtY29sb3I6ICNDQ0M7CisgICAgY29sb3I6ICM2OTY5Njk7CisgICAgY3Vyc29yOiBwb2ludGVyOworfQordWwudGFiIGxpLmF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pYWxzOjpiZWZvcmUgeworCWNvbnRlbnQ6ICJcZTYwNyI7Cit9CisuaWNvbi12aWRlby10dXRvcmlhbHMtb3V0bGluZTo6YmVmb3JlIHsKKwljb250ZW50OiAiXGU2MDgiOworfQorLmljb24tdmlkZW8tb3V0bGluZTo6YmVmb3JlIHsKKwljb250ZW50OiAiXGU2MDkiOworfQorLmljb24tdXNlcjo6YmVmb3JlIHsKKwljb250ZW50OiAiXGU2MGEiOworfQorLmljb24tdXNlci1zbWFsbDo6YmVmb3JlIHsKKwljb250ZW50OiAiXGU2MGIiOworfQorLmljb24tdXNlci1vdXRsaW5lOjpiZWZvcmUgeworCWNvbnRlbnQ6ICJcZTYwYyI7Cit9CisuaWNvbi11c2VyLWxhcmdlLW91dGxpbmU6OmJlZm9yZSB7CisJY29udGVudDogIlxlNjBkIjsKK30KKy5pY29uLXVwZ3JhZGVzOjpiZWZvcmUgeworCWNvbnRlbnQ6ICJcZTYwZSI7Cit9CisuaWNvbi11cGdyYWRlcy1vdXRsaW5lOjpiZWZvcmUgeworCWNvbnRlbnQ6ICJcZTYwZiI7Cit9CisuaWNvbi11bmxpbWl0ZWQtbmlnaHRzLXdlZWtlbmRzLW91dGxpbmU6OmJlZm9yZSB7CisJY29udGVudDogIlxlNjEwIjsKK30KKy5pY29uLXVubGltaXRlZC1taW51dGVzLW91dGxpbmU6OmJlZm9yZSB7CisJY29udGVudDogIlxlNjExIjsKK30KKy5pY29uLXVubGltaXRlZC1tZXNzYWdpbmctb3V0bGluZTo6YmVmb3JlIHsKKwljb250ZW50OiAiXGU2MTIiOworfQorLmljb24tdW5saW1pdGVkLW0ybS1vdXRsaW5lOjpiZWZvcmUgeworCWNvbnRlbnQ6ICJcZTYxMyI7Cit9CisuaWNvbi11bmxpbWl0ZWQtY2FsbGluZzo6YmVmb3JlIHsKKwljb250ZW50OiAiXGU2MTQiOworfQorLmljb24tdHYtcGFja2FnZXMtb3V0bGluZTo6YmVmb3JlIHsKKwljb250ZW50OiAiXGU2MTUiOworfQorLmljb24tdHJhdmVsLW1pbnV0ZXMtb3V0bGluZTo6YmVmb3JlIHsKKwljb250ZW50OiAiXGU2MTYiOworfQorLmljb24tdHJhc2g6OmJlZm9yZSB7CisJY29udGVudDogIlxlNjE3IjsKK30KKy5pY29uLXRvbGxmcmVlLW91dGxpbmU6OmJlZm9yZSB7CisJY29udGVudDogIlxlNjE4IjsKK30KKy5pY29uLXRpbGVzOjpiZWZvcmUgeworCWNvbnRlbnQ6ICJcZTYxOSI7Cit9CisuaWNvbi10aWxlcy1zbWFsbDo6YmVmb3JlIHsKKwljb250ZW50OiAiXGU2MWEiOworfQorLmljb24tdGlja2V0czo6YmVmb3JlIHsKKwljb250ZW50OiAiXGU2MWIiOworfQorLmljb24tdGlja2V0cy1yZXR1cm5lZDo6YmVmb3JlIHsKKwljb250ZW50OiAiXGU2MWMiOworfQorLmljb24tdGlja2V0cy1yZWZlcnJlZDo6YmVmb3JlIHsKKwljb250ZW50OiAiXGU2MWQiOworfQorLmljb24tdGlja2V0cy1vdXRsaW5lOjpiZWZvcmUgeworCWNvbnRlbnQ6ICJcZTYxZSI7Cit9CisuaWNvbi10aWNrZXRzLW9wZW46OmJlZm9yZSB7CisJY29udGVudDogIlxlNjFmIjsKK30KKy5pY29uLXRpY2tldHMtZXNjYWxhdGU6OmJlZm9yZSB7CisJY29udGVudDogIlxlNjIwIjsKK30KKy5pY29uLXRpY2tldHMtY29udGVzdGVkOjpiZWZvcmUgeworCWNvbnRlbnQ6ICJcZTYyMSI7Cit9CisuaWNvbi10aWNrZXRzLWNsb3NlZDo6YmVmb3JlIHsKKwljb250ZW50OiAiXGU2MjIiOworfQorLmljb24tdGlja2V0cy1jbGVhcmVkOjpiZWZvcmUgeworCWNvbnRlbnQ6ICJcZTYyMyI7Cit9CisuaWNvbi10aWNrZXRzLWFycXVpdmVkOjpiZWZvcmUgeworCWNvbnRlbnQ6ICJcZTYyNCI7Cit9CisuaWNvbi10aWNrZXRzLWFjdGl2Z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bGluZTo6YmVmb3JlIHsKKwljb250ZW50OiAiXGU2MzUiOworfQorLmljb24tc2hhcmVkLW91dGxpbmU6OmJlZm9yZSB7CisJY29udGVudDogIlxlNjM2IjsKK30KKy5pY29uLXNoYXJlZC1taW51dGVzLW91dGxpbmU6OmJlZm9yZSB7CisJY29udGVudDogIlxlNjM3IjsKK30KKy5pY29uLXNoYXJlOjpiZWZvcmUgeworCWNvbnRlbnQ6ICJcZTYzOCI7Cit9CisuaWNvbi1zZXR0aW5nczo6YmVmb3JlIHsKKwljb250ZW50OiAiXGU2MzkiOworfQorLmljb24tc2VuZC1pbnZvaWNlLW91dGxpbmU6OmJlZm9yZSB7CisJY29udGVudDogIlxlNjNhIjsKK30KKy5pY29uLXNlZS1tb3JlOjpiZWZvcmUgeworCWNvbnRlbnQ6ICJcZTYzYiI7Cit9CisuaWNvbi1zZWUtbGVzczo6YmVmb3JlIHsKKwljb250ZW50OiAiXGU2M2MiOworfQorLmljb24tc2VhcmNoOjpiZWZvcmUgeworCWNvbnRlbnQ6ICJcZTYzZCI7Cit9CisuaWNvbi1zZWFyY2gtc21hbGw6OmJlZm9yZSB7CisJY29udGVudDogIlxlNjNlIjsKK30KKy5pY29uLXNjcmVlbi1jYWxscy1vdXRsaW5lOjpiZWZvcmUgeworCWNvbnRlbnQ6ICJcZTYzZiI7Cit9CisuaWNvbi1zYXZlLXRpbWUtb3V0bGluZTo6YmVmb3JlIHsKKwljb250ZW50OiAiXGU2NDAiOworfQorLmljb24tc2Fhcy1lbmFibGVtZW50LW91dGxpbmU6OmJlZm9yZSB7CisJY29udGVudDogIlxlNjQxIjsKK30KKy5pY29uLXMtYmVhbTo6YmVmb3JlIHsKKwljb250ZW50OiAiXGU2NDIiOworfQorLmljb24tcy1iZWFtLW91dGxpbmU6OmJlZm9yZSB7CisJY29udGVudDogIlxlNjQzIjsKK30KKy5pY29uLXJvbGxvdmVyLW91dGxpbmU6OmJlZm9yZSB7CisJY29udGVudDogIlxlNjQ0IjsKK30KKy5pY29uLXJvbGxvdmVyLW1pbnV0ZXM6OmJlZm9yZSB7CisJY29udGVudDogIlxlNjQ1IjsKK30KKy5pY29uLXJldmlld3Mtb3V0bGluZTo6YmVmb3JlIHsKKwljb250ZW50OiAiXGU2NDYiOworfQorLmljb24tcmVwb3J0czo6YmVmb3JlIHsKKwljb250ZW50OiAiXGU2NDciOworfQorLmljb24tcmVwb3J0cy1vdXRsaW5lOjpiZWZvcmUgeworCWNvbnRlbnQ6ICJcZTY0OCI7Cit9CisuaWNvbi1yZWNvbW1lbmRhdGlvbi10b29sOjpiZWZvcmUgeworCWNvbnRlbnQ6ICJcZTY0OSI7Cit9CisuaWNvbi1yZWNlaXZlcnMtb3V0bGluZTo6YmVmb3JlIHsKKwljb250ZW50OiAiXGU2NGEiOworfQorLmljb24tcHJvZHVjdGl2aXR5LW91dGxpbmU6OmJlZm9yZSB7CisJY29udGVudDogIlxlNjRiIjsKK30KKy5pY29uLXByaW50OjpiZWZvcmUgeworCWNvbnRlbnQ6ICJcZTY0YyI7Cit9CisuaWNvbi1wbHVzOjpiZWZvcmUgeworCWNvbnRlbnQ6ICJcZTY0ZCI7Cit9CisuaWNvbi1wbHVzLW91dGxpbmU6OmJlZm9yZSB7CisJY29udGVudDogIlxlNjRlIjsKK30KKy5pY29uLXBsYXk6OmJlZm9yZSB7CisJY29udGVudDogIlxlNjRmIjsKK30KKy5pY29uLXBsYXRmb3JtLWFzLXNlcnZpY2Utb3V0bGluZTo6YmVmb3JlIHsKKwljb250ZW50OiAiXGU2NTAiOworfQorLmljb24tcGxhbnM6OmJlZm9yZSB7CisJY29udGVudDogIlxlNjUxIjsKK30KKy5pY29uLXBsYW5zLW91dGxpbmU6OmJlZm9yZSB7CisJY29udGVudDogIlxlNjUyIjsKK30KKy5pY29uLXBpZS1jaGFydDo6YmVmb3JlIHsKKwljb250ZW50OiAiXGU2NTMiOworfQorLmljb24tcGhvdG9zOjpiZWZvcmUgeworCWNvbnRlbnQ6ICJcZTY1N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xpbmU6OmJlZm9yZSB7CisJY29udGVudDogIlxlNjY0IjsKK30KKy5pY29uLW9mZmVyczo6YmVmb3JlIHsKKwljb250ZW50OiAiXGU2NjUiOworfQorLmljb24tb2ZmZXJzLW91dGxpbmU6OmJlZm9yZSB7CisJY29udGVudDogIlxlNjY2IjsKK30KKy5pY29uLW5vdGlmaWNhdGlvbnM6OmJlZm9yZSB7CisJY29udGVudDogIlxlNjY3IjsKK30KKy5pY29uLW5vdGlmaWNhdGlvbnMtb3V0bGluZTo6YmVmb3JlIHsKKwljb250ZW50OiAiXGU2NjgiOworfQorLmljb24tbm9ybWFsLXNjcmVlbjo6YmVmb3JlIHsKKwljb250ZW50OiAiXGU2NjkiOworfQorLmljb24tbmlnaHRzLXdlZWtlbmRzLW91dGxpbmU6OmJlZm9yZSB7CisJY29udGVudDogIlxlNjZhIjsKK30KKy5pY29uLW5ldy1yZXF1ZXN0cy1vdXRsaW5lOjpiZWZvcmUgeworCWNvbnRlbnQ6ICJcZTY2YiI7Cit9CisuaWNvbi1uZXR3b3JrOjpiZWZvcmUgeworCWNvbnRlbnQ6ICJcZTY2YyI7Cit9CisuaWNvbi1uZXR3b3JrLWRhc2hib2FyZDo6YmVmb3JlIHsKKwljb250ZW50OiAiXGU2NmQiOworfQorLmljb24tbmV0Ym9vazo6YmVmb3JlIHsKKwljb250ZW50OiAiXGU2NmUiOworfQorLmljb24tbmV0Ym9vay1vdXRsaW5lOjpiZWZvcmUgeworCWNvbnRlbnQ6ICJcZTY2ZiI7Cit9CisuaWNvbi1tdXNpYzo6YmVmb3JlIHsKKwljb250ZW50OiAiXGU2NzAiOworfQorLmljb24tbXVzaWMtdmlkZW86OmJlZm9yZSB7CisJY29udGVudDogIlxlNjcxIjsKK30KKy5pY29uLW11c2ljLXZpZGVvLW91dGxpbmU6OmJlZm9yZSB7CisJY29udGVudDogIlxlNjcyIjsKK30KKy5pY29uLW11c2ljLW91dGxpbmU6OmJlZm9yZSB7CisJY29udGVudDogIlxlNj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6YmVmb3JlIHsKKwljb250ZW50OiAiXGU2ODIiOworfQorLmljb24tbG9jYXRpb24tcGluOjpiZWZvcmUgeworCWNvbnRlbnQ6ICJcZTY4MyI7Cit9CisuaWNvbi1sb2NhdGlvbi1waW4tc21hbGw6OmJlZm9yZSB7CisJY29udGVudDogIlxlNjg0IjsKK30KKy5pY29uLWxvY2FsLXNlYXJjaDo6YmVmb3JlIHsKKwljb250ZW50OiAiXGU2ODUiOworfQorLmljb24tbG9jYWwtbG9uZy1kaXN0YW5jZS1vdXRsaW5lOjpiZWZvcmUgeworCWNvbnRlbnQ6ICJcZTY4NiI7Cit9CisuaWNvbi1saXN0OjpiZWZvcmUgeworCWNvbnRlbnQ6ICJcZTY4NyI7Cit9CisuaWNvbi1sZWFybjo6YmVmb3JlIHsKKwljb250ZW50OiAiXGU2ODgiOworfQorLmljb24tbGVhcm4tb3V0bGluZTo6YmVmb3JlIHsKKwljb250ZW50OiAiXGU2ODkiOworfQorLmljb24tbGFwdG9wOjpiZWZvcmUgeworCWNvbnRlbnQ6ICJcZTY4YSI7Cit9CisuaWNvbi1sYW5kbGluZTo6YmVmb3JlIHsKKwljb250ZW50OiAiXGU2OGIiOworfQorLmljb24tbGFuZGxpbmUtb3V0bGluZTo6YmVmb3JlIHsKKwljb250ZW50OiAiXGU2OGMiOworfQorLmljb24taW52b2ljZXM6OmJlZm9yZSB7CisJY29udGVudDogIlxlNjhkIjsKK30KKy5pY29uLWludm9pY2VzLW91dGxpbmU6OmJlZm9yZSB7CisJY29udGVudDogIlxlNjhlIjsKK30KKy5pY29uLWludmVudG9yeTo6YmVmb3JlIHsKKwljb250ZW50OiAiXGU2OGYiOworfQorLmljb24taW50cmFuZXQtb3V0bGluZTo6YmVmb3JlIHsKKwljb250ZW50OiAiXGU2OTAiOworfQorLmljb24taW50ZXJwcmV0ZXI6OmJlZm9yZSB7CisJY29udGVudDogIlxlNjkxIjsKK30KKy5pY29uLWludGVycHJldGVyLW91dGxpbmU6OmJlZm9y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XZpY2VzOjpiZWZvcmUgeworCWNvbnRlbnQ6ICJcZTZiMCI7Cit9CisuaWNvbi1mdWxsLXNjcmVlbjo6YmVmb3JlIHsKKwljb250ZW50OiAiXGU2YjEiOworfQorLmljb24tZm9yd2FyZC1jYWxscy1vdXRsaW5lOjpiZWZvcmUgeworCWNvbnRlbnQ6ICJcZTZiMiI7Cit9CisuaWNvbi1mb3J1bTo6YmVmb3JlIHsKKwljb250ZW50OiAiXGU2YjMiOworfQorLmljb24tZm9ydW0tb3V0bGluZTo6YmVmb3JlIHsKKwljb250ZW50OiAiXGU2YjQiOworfQorLmljb24tZmlsdGVyOjpiZWZvcmUgeworCWNvbnRlbnQ6ICJcZTZiNSI7Cit9CisuaWNvbi1leHRyYXM6OmJlZm9yZSB7CisJY29udGVudDogIlxlNmI2IjsKK30KKy5pY29uLWV4dHJhcy1vdXRsaW5lOjpiZWZvcmUgeworCWNvbnRlbnQ6ICJcZTZiNyI7Cit9CisuaWNvbi1lcmFzZTo6YmVmb3JlIHsKKwljb250ZW50OiAiXGU2YjgiOworfQorLmljb24tZW52ZWxvcGU6OmJlZm9yZSB7CisJY29udGVudDogIlxlNmI5IjsKK30KKy5pY29uLWVudmVsb3BlLW91dGxpbmU6OmJlZm9yZSB7CisJY29udGVudDogIlxlNmJhIjsKK30KKy5pY29uLWVudGVycHJpc2UtbWVzc2FnaW5nLW91dGxpbmU6OmJlZm9yZSB7CisJY29udGVudDogIlxlNmJiIjsKK30KKy5pY29uLWVkaXQ6OmJlZm9yZSB7CisJY29udGVudDogIlxlNmJjIjsKK30KKy5pY29uLWR1cGxpY2F0ZTo6YmVmb3JlIHsKKwljb250ZW50OiAiXGU2YmQiOworfQorLmljb24tZHJvcGRvd24tdXA6OmJlZm9yZSB7CisJY29udGVudDogIlxlNmJlIjsKK30KKy5pY29uLWRyb3Bkb3duLWRvd246OmJlZm9yZSB7CisJY29udGVudDogIlxlNmJmIjsKK30KKy5pY29uLWRvd25sb2FkOjpiZWZvcmUgeworCWNvbnRlbnQ6ICJcZTZjMCI7Cit9CisuaWNvbi1kb3dubG9hZC1vdXRsaW5lOjpiZWZvcmUgeworCWNvbnRlbnQ6ICJcZTZjMSI7Cit9CisuaWNvbi1kaXNwdXRlczo6YmVmb3JlIHsKKwljb250ZW50OiAiXGU2YzIiOworfQorLmljb24tZGV0YWlsZWQtYmlsbGluZzo6YmVmb3JlIHsKKwljb250ZW50OiAiXGU2YzMiOworfQorLmljb24tZGV0YWlsZWQtYmlsbGluZy1vdXRsaW5lOjpiZWZvcmUgeworCWNvbnRlbnQ6ICJcZTZjNCI7Cit9CisuaWNvbi1kZXNrdG9wLW91dGxpbmU6OmJlZm9yZSB7CisJY29udGVudDogIlxlNmM1IjsKK30KKy5pY29uLWRhdGE6OmJlZm9yZSB7CisJY29udGVudDogIlxlNmM2IjsKK30KKy5pY29uLWRhdGEtb3V0bGluZTo6YmVmb3JlIHsKKwljb250ZW50OiAiXGU2YzciOworfQorLmljb24tZGF0YS1hZGRpdGlvbmFsLW91dGxpbmU6OmJlZm9yZSB7CisJY29udGVudDogIlxlNmM4IjsKK30KKy5pY29uLWNvbXBhcmU6OmJlZm9yZSB7CisJY29udGVudDogIlxlNmM5IjsKK30KKy5pY29uLWNsb3VkLXN0b3JhZ2Utb3V0bGluZTo6YmVmb3JlIHsKKwljb250ZW50OiAiXGU2Y2EiOworfQorLmljb24tY2xvdWQtb3V0bGluZTo6YmVmb3JlIHsKKwljb250ZW50OiAiXGU2Y2IiOworfQorLmljb24tY2xvdWQtY29tcHV0aW5nLW91dGxpbmU6OmJlZm9yZSB7CisJY29udGVudDogIlxlNmNjIjsKK30KKy5pY29uLWNsb3VkLWJhY2t1cDo6YmVmb3JlIHsKKwljb250ZW50OiAiXGU2Y2QiOworfQorLmljb24tY2xvdWQtYmFja3VwLW91dGxpbmU6OmJlZm9yZSB7CisJY29udGVudDogIlxlNmNlIjsKK30KKy5pY29uLWNpcmNsZS1pbmZvcm1hdGlvbi1vdXRsaW5lOj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KyAgICAgIGJveCAgICAgICAgICAgICAgIDogJy5ib3gxJywKKyAgICAgIGFycm93ICAgICAgICAgICAgIDogJy5hcnJvdycsCisgICAgICBhcnJvd19ib3JkZXIgICAgICA6ICcuYXJyb3ctYm9yZGVyJywKKyAgICAgIGNsb3NlICAgICAgICAgICAgIDogJy5jbG9zZScKKyAgICB9LCBvcHRpb25zKTsKKworICAgIHZhciBtZXRob2RzID0geworICAgICAgb3BlbjogZnVuY3Rpb24oZXZlbnQpeworICAgICAgICBldmVudC5wcmV2ZW50RGVmYXVsdCgpOworICAgICAgICB2YXIgcG9wID0gJCh0aGlzKTsKKyAgICAgICAgdmFyIGJveCA9ICQodGhpcykucGFyZW50KCkuZmluZChzZXR0aW5nc1snYm94J10pOworICAgICAgICBib3guZmluZChzZXR0aW5nc1snYXJyb3cnXSkuY3NzKHsnbGVmdCc6IGJveC53aWR0aCgpLzIgLSAxMCArIDQ2fSk7CisgICAgICAgIGJveC5maW5kKHNldHRpbmdzWydhcnJvd19ib3JkZXInXSkuY3NzKHsnbGVmdCc6IGJveC53aWR0aCgpLzIgLSAxMCAtIDYzfSk7CisgICAgICAgIGlmKGJveC5jc3MoJ2Rpc3BsYXknKSA9PSAnYmxvY2snKXsKKyAgICAgICAgICAvKiBtZXRob2RzLmNsb3NlKCk7CisgICAgICAgICAgc2V0VGltZW91dChmdW5jdGlvbigpeyAkKCIuYnRuLXBhbmVsLXZlcnRpY2FsLCNhY3Rpb25zRHJvcERvd24iKS5jc3MoJ3otaW5kZXgnLCc5OTknKTsgfSwyMDApOworICAgICAgICAvLyAkKCIuYnRuLXBhbmVsLXZlcnRpY2FsLCNhY3Rpb25zRHJvcERvd24iKS5jc3MoJ3otaW5kZXgnLCc5OTknKTsKKyAgICAgICAgICAgIGlmKCQod2luZG93KS5zY3JvbGxUb3AoKSA+IDIwKXsKKyAgICAgICAgICAgICAgICAgc2V0VGltZW91dChmdW5jdGlvbigpeyAkKCIuYnRuLXBhbmVsLXZlcnRpY2FsLCNhY3Rpb25zRHJvcERvd24iKS5jc3MoJ3otaW5kZXgnLCctOTk5Jyk7IH0sMjAwKTsKKyAgICAgICAgICAgICAgICAgIC8vICQoIi5idG4tcGFuZWwtdmVydGljYWwsI2FjdGlvbnNEcm9wRG93biIpLmNzcygnei1pbmRleCcsJy05OTknKTsKKyAgICAgICAgICAgIH07Ki8KKwkJCSAkKCcuYm94MScpLmZhZGVJbignc2xvdycpOworICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAkKCcuY2hhdEJveCcpLmZhZGVPdXQoJ2Zhc3QnKTsKKyAgICAgICAgICAkKCIuYnRuLXBhbmVsLXZlcnRpY2FsLCNhY3Rpb25zRHJvcERvd24iKS5jc3MoJ3otaW5kZXgnLCctOTk5Jyk7CisgICAgICAgIAlpZihib3guYXR0cigndGFyZ2V0JykgPT0gJ2F1dGgnKXsKKyAgICAgICAgCQlib3guZmluZChzZXR0aW5nc1snYXJyb3cnXSkuY3NzKHsnbGVmdCc6IGJveC53aWR0aCgpLzIgKyAzNn0pOworICAgICAgICAJCWJveC5jc3MoeydkaXNwbGF5JzogJ2Jsb2NrJywgJ3RvcCc6IDAsICdsZWZ0JzogKChwb3AucGFyZW50KCkucGFyZW50KCkud2lkdGgoKS8yKSAtYm94LndpZHRoKCkvMiApIC0gOTB9KTsKKyAgICAgICAgCX0KKyAgICAgICAgCWVsc2V7CisgICAgICAgIAkJYm94LmZpbmQoc2V0dGluZ3NbJ2Fycm93J10pLmNzcyh7J2xlZnQnOiBib3gud2lkdGgoKS8yIC0gNDJ9KTsKKyAgICAgICAgCQlib3guY3NzKHsnZGlzcGxheSc6ICdibG9jaycsICd0b3AnOiAwLCAnbGVmdCc6ICgocG9wLnBhcmVudCgpLnBhcmVudCgpLndpZHRoKCkvMikgLWJveC53aWR0aCgpLzItMTUgKX0pOworICAgICAgICAJCWJveC5maW5kKCIjaGVhZGVyX2xvZ2luX2lkIikuZm9jdXMoKTsKKyAgICAgICAgCQlib3guZmluZCgnI2h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bG9zZXN0KCcuY2hhdEJveCcpLmxlbmd0aCB8fCAkKGV2ZW50LnRhcmdldCkuaGFzQ2xhc3MoJ2NoYXRJY29uJykgfHwgJChldmVudC50YXJnZXQpLmNsb3Nlc3Qoc2V0dGluZ3NbJ3NlbGVjdG9yJ10pLmxlbmd0aCkpeworICAgICAgICBtZXRob2RzLmNsb3NlKCk7CisgICAgICAgICBpZiAoJCgiI2FjdGlvbnNEcm9wRG93biIpLmNzcygnei1pbmRleCcpPT0nLTk5OScpeworICAgICAgICAgICBzZXRUaW1lb3V0KGZ1bmN0aW9uKCl7ICQoIi5idG4tcGFuZWwtdmVydGljYWwsI2FjdGlvbnNEcm9wRG93biIpLmNzcygnei1pbmRleCcsJzk5OScpOyB9LDIwMCk7CisgICAgICAgIH0KKyAgICAgICAgaWYoJCh3aW5kb3cpLnNjcm9sbFRvcCgpID4gMjApeworICAgICAgICAgICBzZXRUaW1lb3V0KGZ1bmN0aW9uKCl7ICQoIi5idG4tcGFuZWwtdmVydGljYWwsI2FjdGlvbnNEcm9wRG93biIpLmNzcygnei1pbmRleCcsJy05OTknKTsgfSwyMDApOworICAgICAgICAgICAvLyAkKCIuYnRuLXBhbmVsLXZlcnRpY2FsLCNhY3Rpb25zRHJvcERvd24iKS5jc3MoJ3otaW5kZXgnLCctOTk5Jyk7CisgICAgICAgIH07CisgICAgICAgCisgICAgICAgICAgJCgnLmNoYXRCb3gnKS5mYWRlT3V0KCdmYXN0Jyk7CisgICAgICAgIAorICAgICAgfQorICAgIH0pOworCisgICAgcmV0dXJuIHRoaXMuZWFjaChmdW5jdGlvbigpeworCisgICAgICAkKHRoaXMpLmNzcyh7J3dpZHRoJzogJChzZXR0aW5nc1snYm94J10pLndpZHRoKCl9KTsgLy8gV2lkdGggbmVlZHMgdG8gYmUgc2V0IG90aGVyd2lzZSBwb3Bib3ggd2lsbCBub3QgbW92ZSB3aGVuIHdpbmRvdyByZXNpemVkLgorICAgICAgJChzZXR0aW5nc1snb3BlbiddLC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ZhdWx0KCk7CisgIC8vICAgLy8gY29uc29sZS5sb2coJChldmVudC50YXJnZXQpLmNsb3Nlc3Qoc2V0dGluZ3NbJ3NlbGVjdG9yJ10pLmxlbmd0aCk7CisgIC8vICAgY29uc29sZS5sb2coJChldmVudC50YXJnZXQpLmNsb3Nlc3QoJy4JJykubGVuZ3RoKTsKKyAgLy8gICBjb25zb2xlLmxvZygkKGV2ZW50LnRhcmdldCkuaGFzQ2xhc3MoJ2NoYXRJY29uJykpOworCisKKyAgLy8gICAgIC8vICQoIi5idG4tcGFuZWwtdmVydGljYWwsI2FjdGlvbnNEcm9wRG93biIpLmNzcygnei1pbmRleCcsJzk5OScpOworICAvLyAgICAgbWV0aG9kcy5jbG9zZSgpOworICAvLyAgICAgaWYgKCQoIiNhY3Rpb25zRHJvcERvd24iKS5jc3MoJ3otaW5kZXgnKT09Jy05OTknKSB7CisgIC8vICAgICAgICQoIi5idG4tcGFuZWwtdmVydGljYWwsI2FjdGlvbnNEcm9wRG93biIpLmNzcygnei1pbmRleCcsJzk5OScpOworICAvLyAgICAgfTsKKyAgLy8gICAgIC8vIGlmIChmbGFnIT0iY2xpY2tlZCIpIHsKKyAgLy8gICAgIC8vICAgaWYgKCQoJy5ib3gnKS5jc3MoJ2Rpc3BsYXknKSA9PSAnYmxvY2snIHx8ICQoJy5jaGF0Qm94JykuY3NzKCdkaXNwbGF5JykgPT0gJ2Jsb2NrJyApeworICAvLyAgICAgLy8gICAgICQoIi5idG4tcGFuZWwtdmVydGljYWwsI2FjdGlvbnNEcm9wRG93biIpLmNzcygnei1pbmRleCcsJy05OTknKTsKKyAgLy8gICAgIC8vICAgfSBlbHNlIHsKKyAgLy8gICAgIC8vICAgICAkKCIuYnRuLXBhbmVsLXZlcnRpY2FsLCNhY3Rpb25zRHJvcERvd24iKS5jc3MoJ3otaW5kZXgnLCc5OTknKTsKKyAgLy8gICAgIC8vICAgfQorICAvLyAgICAgLy8gfQorICAvLyAgICB9CisgIC8vIH0pOworCit9K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dGNoSXRlbTsKKyAgICB9OworfSkKKworLmZpbHRlcignYXR0TGltaXRUbycsIGZ1bmN0aW9uKCkgeworICAgIHJldHVybiBmdW5jdGlvbihhY3R1YWxBcnJheSwgX2xpbWl0LCBfYmVnaW4pIHsKKyAgICAgICAgdmFyIGZpbmFsQXJyYXkgPSBbXTsKKyAgICAgICAgdmFyIGxpbWl0ID0gX2xpbWl0OworICAgICAgICB2YXIgYmVnaW4gPSBfYmVnaW47CisgICAgICAgIGlmKGlzTmFOKGJlZ2luKSkgeworICAgICAgICAgICAgYmVnaW4gPSAwOworICAgICAgICB9CisgICAgICAgIGlmKGFjdHVhbEFycmF5ICYmICFpc05hTihsaW1pdCkpIHsKKyAgICAgICAgICAgIGZpbmFsQXJyYXkgPSBhY3R1YWxBcnJheS5zbGljZShiZWdpbiwgYmVnaW4rbGltaXQpOworICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgZmluYWxBcnJheSA9IGFjdHVhbEFycmF5OworICAgICAgICB9CisgICAgICAgIHJldHVybiBmaW5hbEFycmF5OworICAgIH07Cit9KQorCisuZmlsdGVyKCdzdGFydHNXaXRoJywgZnVuY3Rpb24oKSB7CisgICAgaWYgKHR5cGVvZiBTdHJpbmcucHJvdG90eXBlLnN0YXJ0c1dpdGggIT09ICdmdW5jdGlvbicpIHsKKyAgICAgICAgLy8gc2VlIGJlbG93IGZvciBiZXR0ZXIgaW1wbGVtZW50YXRpb24hCisgICAgICAgIFN0cmluZy5wcm90b3R5cGUuc3RhcnRzV2l0aCA9IGZ1bmN0aW9uIChzdHIpeworICAgICAgICAgICAgcmV0dXJuIHRoaXMuaW5kZXhPZihzdHIpID09PSAwOworICAgICAgICB9OworICAgIH0KKworICAgIHJldHVybiBmdW5jdGlvbihpdGVtcywgc2VhcmNoU3RyaW5nKSB7CisgICAgICAgIGlmIChzZWFyY2hTdHJpbmcgPT09IHVuZGVmaW5lZCB8fCBzZWFyY2hTdHJpbmcgPT09ICIiKSB7CisgICAgICAgICAgICByZXR1cm4gaXRlbXM7CisgICAgICAgIH0KKworICAgICAgICB2YXIgZmlsdGVyZWQgPSBbXTsKKyAgICAgICAgYW5ndWxhci5mb3JFYWNoKGl0ZW1zLCBmdW5jdGlvbihpdGVtKSB7CisgICAgICAgICAgICBpZiAoaXRlbS50aXRsZS50b0xvd2VyQ2FzZSgpLnN0YXJ0c1dpdGgoc2VhcmNoU3RyaW5nLnRvTG93ZXJDYXNlKCkpKSB7CisgICAgICAgICAgICAgICAgZmlsdGVyZWQucHVzaChpdGVtKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfSk7CisgICAgICAgIHJldHVybiBmaWx0ZXJlZDsKKyAgICB9OworfSkKKworLmRpcmVjdGl2ZSgnYXR0SW5wdXREZW55JywgW2Z1bmN0aW9uKCkgeworICAgIHJldHVybiB7CisgICAgICAgIHJlc3RyaWN0OiAnQScsCisgICAgICAgIHJlcXVpcmU6ICduZ01vZGVsJywKKyAgICAgICAgbGluazogZnVuY3Rpb24gKHNjb3BlLCBlbGVtLCBhdHRyLCBjdHJsKSB7CisgICAgICAgICAgICB2YXIgcmVnZXhFeHByZXNzaW9uID0gbnVsbDsKKyAgICAgICAgICAgIGF0dHIuJG9ic2VydmUoJ2F0dElucHV0RGVueScsIGZ1bmN0aW9uICh2YWx1ZSkgeworICAgICAgICAgICAgICAgIGlmICh2YWx1ZSkgeworICAgICAgICAgICAgICAgICAgICByZWdleEV4cHJlc3Npb24gPSBuZXcgUmVnRXhwKHZhbHVlLCAnZycpOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0pOworICAgICAgICAgICAgZWxlbS5iaW5kKCdpbnB1dCcsIGZ1bmN0aW9uICgpIHsKKyAgICAgICAgICAgICAgICB2YXIgaW5wdXRTdHJpbmcgPSBjdHJsLiR2aWV3VmFsdWUgJiYgY3RybC4kdmlld1ZhbHVlLnJlcGxhY2UocmVnZXhFeHByZXNzaW9uLCAnJyk7CisgICAgICAgICAgICAgICAgaWYgKGlucHV0U3RyaW5nICE9PSBjdHJsLiR2aWV3VmFsdWUpIHsKKyAgICAgICAgICAgICAgICAgICAgY3RybC4kc2V0Vmlld1ZhbHVlKGlucHV0U3RyaW5nKTsKKyAgICAgICAgICAgICAgICAgICAgY3RybC4kcmVuZGVyKCk7CisgICAgICAgICAgICAgICAgICAgIHNjb3BlLiRhcHBseSgpOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0pOworICAgICAgICB9CisgICAgfTsKK31dKQorCisuZGlyZWN0aXZlKCdhdHRBY2Nlc3NpYmlsaXR5Q2xpY2snLCBbZnVuY3Rpb24oKSB7CisgICAgcmV0dXJuIHsKKyAgICAgICAgcmVzdHJpY3Q6ICdBJywKKyAgICAgICAgbGluazogZnVuY3Rpb24gKHNjb3BlLCBlbGVtLCBhdHRyKSB7CisgICAgICAgICAgICB2YXIga2V5Q29kZSA9IFtdOworICAgICAgICAgICAgYXR0ci4kb2JzZXJ2ZSgnYXR0QWNjZXNzaWJpbGl0eUNsaWNrJywgZnVuY3Rpb24gKHZhbHVlKSB7CisgICAgICAgICAgICAgICAgaWYgKHZhbHVlKSB7CisgICAgICAgICAgICAgICAgICAgIGtleUNvZGUgPSB2YWx1ZS5zcGxpdCgnLCcpOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0pOworICAgICAgICAgICAgZWxlbS5iaW5kKCdrZXlkb3duJywgZnVuY3Rpb24gKGV2KSB7CisgICAgICAgICAgICAgICAgdmFyIGtleUNvZGVDb25kaXRpb24gPSBmdW5jdGlvbigpeworICAgICAgICAgICAgICAgICAgICB2YXIgZmxhZyA9IGZhbHNlOworICAgICAgICAgICAgICAgICAgICBpZighKGV2LmtleUNvZGUpKXsKKyAgICAgICAgICAgICAgICAgICAgICAgIGlmKGV2LndoaWNoKXsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBldi5rZXlDb2RlID0gZXYud2hpY2g7CisgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICBlbHNlIGlmKGV2LmNoYXJDb2RlKXsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBldi5rZXlDb2RlID0gZXYuY2hhckNvZGU7CisgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgaWYoKGV2LmtleUNvZGUgJiYga2V5Q29kZS5pbmRleE9mKGV2LmtleUNvZGUudG9TdHJpbmcoKSkgPiAtMSkpeworICAgICAgICAgICAgICAgICAgICAgICAgZmxhZyA9IHRydWU7CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGZsYWc7CisgICAgICAgICAgICAgICAgfTsKKyAgICAgICAgICAgICAgICBpZihrZXlDb2RlLmxlbmd0aCA+IDAgJiYga2V5Q29kZUNvbmRpdGlvbigpKSB7CisgICAgICAgICAgICAgICAgICAgIGVsZW1bMF0uY2xpY2soKTsKKyAgICAgICAgICAgICAgICAgICAgZXYucHJldmVudERlZmF1bHQoKTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9KTsKKyAgICAgICAgfQorICAgIH07Cit9XSkKKworLmRpcmVjdGl2ZSgnYXR0RWxlbWVudEZvY3VzJywgW2Z1bmN0aW9uKCkgeworICAgIHJldHVybiB7CisgICAgICAgIHJlc3RyaWN0OiAnQScsCisgICAgICAgIGxpbms6IGZ1bmN0aW9uKHNjb3BlLCBlbGVtLCBhdHRyKSB7CisgICAgICAgICAgICBzY29wZS4kd2F0Y2goYXR0ci5hdHRFbGVtZW50Rm9jdXMsIGZ1bmN0aW9uICh2YWx1ZSkgeworICAgICAgICAgICAgICAgIGlmICh2YWx1ZSkgeworICAgICAgICAgICAgICAgICAgICBlbGVtWzBdLmZvY3VzKCk7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfSk7CisgICAgICAgIH0KKyAgICB9OworfV0pCisKKy5kaXJlY3RpdmUoJ2ZvY3VzT24nLCBbJyR0aW1lb3V0JywKKyAgICBmdW5jdGlvbiAoJHRpbWVvdXQpIHsKKyAgICAgICAgdmFyIGNoZWNrRGlyZWN0aXZlUHJlcmVxdWlzaXRlcyA9IGZ1bmN0aW9uIChhdHRycykgeworICAgICAgICAgIGlmICghYXR0cnMuZm9jdXNPbiAmJiBhdHRycy5mb2N1c09uICE9PSAnJykgeworICAgICAgICAgICAgICAgIHRocm93ICdGb2N1c09uQ29uZGl0aW9uIG1pc3NpbmcgYXR0cmlidXRlIHRvIGV2YWx1YXRlJzsKKyAgICAgICAgICB9CisgICAgICAgIH07CisgICAgICAgIHJldHVybiB7ICAgICAgICAgICAgCisgICAgICAgICAgICByZXN0cmljdDogJ0EnLAorICAgICAgICAgICAgbGluazogZnVuY3Rpb24gKHNjb3BlLCBlbGVtZW50LCBhdHRycykgeworICAgICAgICAgICAgICAgIGNoZWNrRGlyZWN0aXZlUHJlcmVxdWlzaXRlcyhhdHRycyk7CisKKyAgICAgICAgICAgICAgICBzY29wZS4kd2F0Y2goYXR0cnMuZm9jdXNPbiwgZnVuY3Rpb24gKGN1cnJlbnRWYWx1ZSkgeworICAgICAgICAgICAgICAgICAgICBpZihjdXJyZW50VmFsdWUpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICR0aW1lb3V0KGZ1bmN0aW9uICgpIHsgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBlbGVtZW50WzBdLmZvY3VzKCk7CisgICAgICAgICAgICAgICAgICAgICAgICB9KTsKKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIH0pOworICAgICAgICAgICAgfQorICAgICAgICB9OworICAgIH0KK10pCisuY29uc3RhbnQoJ3doZW5TY3JvbGxFbmRzQ29uc3RhbnRzJywgeworICAgICd0aHJlc2hvbGQnOiAxMDAsCisgICAgJ3dpZHRoJzogMCwKKyAgICAnaGVpZ2h0JzogMAorfSkKKy5kaXJlY3RpdmUoJ3doZW5TY3JvbGxFbmRzJywgZnVuY3Rpb24od2hlblNjcm9sbEVuZHNDb25zdGFudHMsICRsb2cpIHsKKyAgICByZXR1cm4geworICAgICAgICByZXN0cmljdDogJ0EnLAorICAgICAgICBsaW5rOiBmdW5jdGlvbiAoc2NvcGUsIGVsZW1lbnQsIGF0dHJzKSB7CisgICAgICAgICAgICAvKioKKyAgICAgICAgICAgICogRXhwb3NlZCBBdHRyaWJ1dGVzOgorICAgICAgICAgICAgKiAgICAgICB0aHJlc2hvbGQgLSBpbnRlZ2VyIC0gbnVtYmVyIG9mIHBpeGVscyBiZWZvcmUgc2Nyb2xsYmFyIGhpdHMgZW5kIHRoYXQgY2FsbGJhY2sgaXMgY2FsbGVkCisgICAgICAgICAgICAqICAgICAgIHdpZHRoIC0gaW50ZWdlciAtIG92ZXJyaWRlIGZvciBlbGVtZW50J3Mgd2lkdGggKHB4KQorICAgICAgICAgICAgKiAgICAgICBoZWlnaHQgLSBpbnRlZ2VyIC0gb3ZlcnJpZGUgZm9yIGVsZW1lbnQncyBoZWlnaHQgKHB4KQorICAgICAgICAgICAgKiAgICAgICBheGlzIC0gc3RyaW5nIC0geC95IGZvciBzY3JvbGwgYmFyIGF4aXMKKyAgICAgICAgICAgICovCisgICAgICAgICAgICB2YXIgdGhyZXNob2xkID0gcGFyc2VJbnQoYXR0cnMudGhyZXNob2xkLCAxMCkgfHwgd2hlblNjcm9sbEVuZHNDb25zdGFudHMudGhyZXNob2xkOworCisgICAgICAgICAgICBpZiAoIWF0dHJzLmF4aXMgfHwgYXR0cnMuYXhpcyA9PT0gJycpIHsKKyAgICAgICAgICAgICAgICAkbG9nLndhcm4oJ2F4aXMgYXR0cmlidXRlIG11c3QgYmUgZGVmaW5lZCBmb3Igd2hlblNjcm9sbEVuZHMuJyk7CisgICAgICAgICAgICAgICAgcmV0dXJuOworICAgICAgICAgICAgfQorCisgICAgICAgICAgICBpZiAoYXR0cnMuYXhpcyA9PT0gJ3gnKSB7CisgICAgICAgICAgICAgICAgdmlzaWJsZVdpZHRoID0gcGFyc2VJbnQoYXR0cnMud2lkdGgsIDEwKSB8fCB3aGVuU2Nyb2xsRW5kc0NvbnN0YW50cy53aWR0aDsKKyAgICAgICAgICAgICAgICBpZiAoZWxlbWVudC5jc3MoJ3dpZHRoJykpIHsKKyAgICAgICAgICAgICAgICAgICAgdmlzaWJsZVdpZHRoID0gZWxlbWVudC5jc3MoJ3dpZHRoJykuc3BsaXQoJ3B4JylbMF07ICAKKyAgICAgICAgICAgICAgICB9CisKKyAgICAgICAgICAgICAgICBlbGVtZW50WzBdLmFkZEV2ZW50TGlzdGVuZXIoJ3Njcm9sbCcsIGZ1bmN0aW9uKCkgeworICAgICAgICAgICAgICAgICAgICB2YXIgc2Nyb2xsYWJsZVdpZHRoID0gZWxlbWVudC5wcm9wKCdzY3JvbGxXaWR0aCcpOworICAgICAgICAgICAgICAgICAgICBpZiAoc2Nyb2xsYWJsZVdpZHRoID09PSB1bmRlZmluZWQpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIHNjcm9sbGFibGVXaWR0aCA9IDE7CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgdmFyIGhpZGRlbkNvbnRlbnRXaWR0aCA9IHNjcm9sbGFibGVXaWR0aCAtIHZpc2libGVXaWR0aDsKKworICAgICAgICAgICAgICAgICAgICBpZiAoaGlkZGVuQ29udGVudFdpZHRoIC0gZWxlbWVudFswXS5zY3JvbGxMZWZ0IDw9IHRocmVzaG9sZCkgeworICAgICAgICAgICAgICAgICAgICAgICAgLyogU2Nyb2xsIGFsbW9zdCBhdCBib3R0b20sIGxvYWQgbW9yZSByb3dzICovCisgICAgICAgICAgICAgICAgICAgICAgICBzY29wZS4kYXBwbHkoYXR0cnMud2hlblNjcm9sbEVuZHMpOworICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgfSk7CisgICAgICAgICAgICB9IGVsc2UgaWYgKGF0dHJzLmF4aXMgPT09ICd5JykgeworICAgICAgICAgICAgICAgIHZpc2libGVIZWlnaHQgPSBwYXJzZUludChhdHRycy5oZWlnaHQsIDEwKSB8fCB3aGVuU2Nyb2xsRW5kc0NvbnN0YW50cy5oZWlnaHQ7CisgICAgICAgICAgICAgICAgaWYgKGVsZW1lbnQuY3NzKCd3aWR0aCcpKSB7CisgICAgICAgICAgICAgICAgICAgIHZpc2libGVIZWlnaHQgPSBlbGVtZW50LmNzcygnaGVpZ2h0Jykuc3BsaXQoJ3B4JylbMF07IAorICAgICAgICAgICAgICAgIH0KKworICAgICAgICAgICAgICAgIGVsZW1lbnRbMF0uYWRkRXZlbnRMaXN0ZW5lcignc2Nyb2xsJywgZnVuY3Rpb24oKSB7CisgICAgICAgICAgICAgICAgICAgIHZhciBzY3JvbGxhYmxlSGVpZ2h0ID0gZWxlbWVudC5wcm9wKCdzY3JvbGxIZWlnaHQnKTsKKyAgICAgICAgICAgICAgICAgICAgaWYgKHNjcm9sbGFibGVIZWlnaHQgPT09IHVuZGVmaW5lZCkgeworICAgICAgICAgICAgICAgICAgICAgICAgc2Nyb2xsYWJsZUhlaWdodCA9IDE7CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgdmFyIGhpZGRlbkNvbnRlbnRIZWlnaHQgPSBzY3JvbGxhYmxlSGVpZ2h0IC0gdmlzaWJsZUhlaWdodDsKKworICAgICAgICAgICAgICAgICAgICBpZiAoaGlkZGVuQ29udGVudEhlaWdodCAtIGVsZW1lbnRbMF0uc2Nyb2xsVG9wIDw9IHRocmVzaG9sZCkgeworICAgICAgICAgICAgICAgICAgICAgICAgLyogU2Nyb2xsIGFsbW9zdCBhdCBib3R0b20sIGxvYWQgbW9yZSByb3dzICovCisgICAgICAgICAgICAgICAgICAgICAgICBzY29wZS4kYXBwbHkoYXR0cnMud2hlblNjcm9sbEVuZHMpOworICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgfSk7CisgICAgICAgICAgICB9CisgICAgICAgIH0KKyAgICB9OworfSkKKworLmRpcmVjdGl2ZSgidmFsaWRJbWVpIiwgZnVuY3Rpb24oKXsgICAgICAgICAgCisgICAgcmV0dXJuIHsKKyAgICAgICAgcmVzdHJpY3Q6ICdBJywKKyAgICAgICAgcmVxdWlyZTogJ25nTW9kZWwnLAorICAgICAgICBsaW5rOiBmdW5jdGlvbihzY29wZSwgZWxlLCBhdHRycywgY3RybCkKKyAgICAgICAgeyAgICAgICAKKyAgICAgICAgICAgIGN0cmwuJHBhcnNlcnMudW5zaGlmdChmdW5jdGlvbih2YWx1ZSkgCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgaWYodmFsdWUpeyAgICAgICAgICAgICAgICAgICAgCisgICAgICAgICAgICAgICAgICAgIHNjb3BlLnZhbGlkID0gZmFsc2U7CisgICAgICAgICAgICAgICAgICAgIGlmICghaXNOYU4odmFsdWUpICYmIHZhbHVlLmxlbmd0aCA9PT0gMTUpCisgICAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIHZhciBzdW1JbWVpVmFsID0gMDsJCisgICAgICAgICAgICAgICAgICAgICAgICB2YXIgcG9zSU1FSSA9IFtdOworICAgICAgICAgICAgICAgICAgICAgICAgZm9yICh2YXIgaW1laUluZGV4PTA7IGltZWlJbmRleDwxNTsgaW1laUluZGV4KyspCisgICAgICAgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgcG9zSU1FSVtpbWVpSW5kZXhdID0gIHBhcnNlSW50KHZhbHVlLnN1YnN0cmluZyhpbWVpSW5kZXgsaW1laUluZGV4ICsgMSksMTApOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChpbWVpSW5kZXggJSAyICE9PSAwKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcG9zSU1FSVtpbWVpSW5kZXhdID0gcGFyc2VJbnQoKHBvc0lNRUlbaW1laUluZGV4XSAqIDIpLDEwKTsgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChwb3NJTUVJW2ltZWlJbmRleF0gPiA5KQorICAgICAgICAgICAgICAgICAgICAgICAgICAgIHsgICAgCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBvc0lNRUlbaW1laUluZGV4XSA9IHBhcnNlSW50KChwb3NJTUVJW2ltZWlJbmRleF0gJSAxMCksMTApICsgcGFyc2VJbnQoKHBvc0lNRUlbaW1laUluZGV4XSAvIDEwKSwxMCk7ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBzdW1JbWVpVmFsPXN1bUltZWlWYWwrcGFyc2VJbnQoKHBvc0lNRUlbaW1laUluZGV4XSksMTApOworICAgICAgICAgICAgICAgICAgICAgICAgfQorCisgICAgICAgICAgICAgICAgICAgICAgICBpZigoc3VtSW1laVZhbCAlIDEwKSA9PT0gMCkKKyAgICAgICAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBzY29wZS52YWxpZCA9IHRydWU7ICAgICAgICAgICAgICAgICAgICAgICAgICAgIAorICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNjb3BlLnZhbGlkID0gZmFsc2U7ICAgICAgICAgICAgICAgICAgICAgICAgICAgIAorICAgICAgICAgICAgICAgICAgICAgICAgfSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgZWxzZSAKKyAgICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAgICAgc2NvcGUudmFsaWQgPSBmYWxzZTsgICAgICAgICAgICAgICAgICAgICAgICAKKyAgICAgICAgICAgICAgICAgICAgfSAgICAgICAgICAgICAgICAgICAgCisgICAgICAgICAgICAgICAgICAgIGN0cmwuJHNldFZhbGlkaXR5KCdpbnZhbGlkSW1laScsIHNjb3BlLnZhbGlkKTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgcmV0dXJuIHNjb3BlLnZhbGlkID8gdmFsdWUgOiB1bmRlZmluZWQ7CisgICAgICAgICAgICB9KTsKKyAgICAgICAgfQorICAgIH07Cit9KQorCisuZGlyZWN0aXZlKCJ0b2dnbGVQYXNzd29yZCIsIGZ1bmN0aW9uKCl7CisgICAgcmV0dXJueworICAgICAgICByZXN0cmljdDonQScsICAgICAgICAKKyAgICAgICAgdHJhbnNjbHVkZTpmYWxzZSwKKyAgICAgICAgbGluazogZnVuY3Rpb24oc2NvcGUsIGVsZW1lbnQsIGF0dHIsIGN0cmwpCisgICAgICAgIHsKKyAgICAgICAgICAgIGVsZW1lbnQuYmluZCgiY2xpY2siLCBmdW5jdGlvbigpIAorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIHZhciBpcHdkID0gYXR0ci50b2dnbGVQYXNzd29yZDsKKyAgICAgICAgICAgICAgICBlbGVtZW50WzBdLmlubmVySFRNTCA9IGVsZW1lbnRbMF0uaW5uZXJIVE1MID09PSAiU2hvdyIgPyAiSGlkZSIgOiAiU2hvdyI7ICAgICAgICAgICAgICAgIAorICAgICAgICAgICAgICAgIHZhciBlID0gYW5ndWxhci5lbGVtZW50KGRvY3VtZW50LnF1ZXJ5U2VsZWN0b3IoJyMnICsgaXB3ZCkpWzBdLnR5cGU7CisgICAgICAgICAgICAgICAgYW5ndWxhci5lbGVtZW50KGRvY3VtZW50LnF1ZXJ5U2VsZWN0b3IoJyMnICsgaXB3ZCkpWzBdLnR5cGUgPSBlID09PSAicGFzc3dvcmQiPyAidGV4dCIgOiAicGFzc3dvcmQiOworICAgICAgICAgICAgICAgIAorICAgICAgICAgICAgfSk7ICAgICAgCisgICAgICAgICAgICAgICAgICAgICAgIAorICAgICAgICB9CisgICAgfTsKK30pCisKKy5mYWN0b3J5KCdldmVudHMnLCBmdW5jdGlvbigpeworICAgIHZhciBfc3RvcFByb3BhZ2F0aW9uID0gIGZ1bmN0aW9uKGV2dCl7CisgICAgICAgIGlmKGV2dC5zdG9wUHJvcGFnYXRpb24pIHsKKyAgICAgICAgICAgIGV2dC5zdG9wUHJvcGFnYXRpb24oKTsKKyAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgIGV2dC5yZXR1cm5WYWx1ZSA9IGZhbHNlOworICAgICAgICB9CisgICAgfTsKKyAgICB2YXIgX3ByZXZlbnREZWZhdWx0ID0gZnVuY3Rpb24oZXZ0KSB7CisgICAgICAgIGlmIChldnQucHJldmVudERlZmF1bHQpIHsKKyAgICAgICAgICAgIGV2dC5wcmV2ZW50RGVmYXVsdCgpOworICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgZXZ0LnJldHVyblZhbHVlID0gZmFsc2U7CisgICAgICAgIH0KKyAgICB9CisgICAgcmV0dXJuIHsKKyAgICAgICAgc3RvcFByb3BhZ2F0aW9uOiBfc3RvcFByb3BhZ2F0aW9uLAorICAgICAgICBwcmV2ZW50RGVmYXVsdDogX3ByZXZlbnREZWZhdWx0CisgICAgfTsKK30pCisKKy5mYWN0b3J5KCckZG9jdW1lbnRCaW5kJywgWyckZG9jdW1lbnQnLCAnJHRpbWVvdXQnLCBmdW5jdGlvbiAoJGRvY3VtZW50LCAkdGltZW91dCkgeworICAgIHZhciBfY2xpY2sgPSBmdW5jdGlvbiAoZmxhZywgY2FsbGJhY2tGdW5jLCBzY29wZSkgeworICAgICAgICBzY29wZS4kd2F0Y2goZmxhZywgZnVuY3Rpb24gKHZhbCkgeworICAgICAgICAgICAgJHRpbWVvdXQoZnVuY3Rpb24gKCkgeworICAgICAgICAgICAgICAgIGlmICh2YWwpIHsKKyAgICAgICAgICAgICAgICAgICAgJGRvY3VtZW50LmJpbmQoJ2NsaWNrJywgY2FsbGJhY2tGdW5jKTsKKyAgICAgICAgICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgICAgICAgICAkZG9jdW1lbnQudW5iaW5kKCdjbGljaycsIGNhbGxiYWNrRnVuYyk7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfSk7CisgICAgICAgIH0pOworICAgIH07CisKKyAgICB2YXIgX2V2ZW50ID0gZnVuY3Rpb24gKGV2ZW50LCBmbGFnLCBjYWxsYmFja0Z1bmMsIHNjb3BlLCB0aW1lb3V0RmxhZywgdGltZW91dFZhbHVlKSB7CisgICAgICAgIGlmICh0aW1lb3V0RmxhZykgeworICAgICAgICAgICAgaWYgKCEodGltZW91dFZhbHVlKSkgeworICAgICAgICAgICAgICAgIHRpbWVvdXRWYWx1ZSA9IDA7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBzY29wZS4kd2F0Y2goZmxhZywgZnVuY3Rpb24gKG5ld1ZhbCwgb2xkVmFsKSB7CisgICAgICAgICAgICAgICAgaWYgKG5ld1ZhbCAhPT0gb2xkVmFsKSB7CisgICAgICAgICAgICAgICAgICAgICR0aW1lb3V0KGZ1bmN0aW9uICgpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIGlmIChuZXdWYWwpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAkZG9jdW1lbnQuYmluZChldmVudCwgY2FsbGJhY2tGdW5jKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgJGRvY3VtZW50LnVuYmluZChldmVudCwgY2FsbGJhY2tGdW5jKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgfSwgdGltZW91dFZhbHVlKTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9KTsKKyAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgIHNjb3BlLiR3YXRjaChmbGFnLCBmdW5jdGlvbiAobmV3VmFsLCBvbGRWYWwpIHsKKyAgICAgICAgICAgICAgICBpZiAobmV3VmFsICE9PSBvbGRWYWwpIHsKKyAgICAgICAgICAgICAgICAgICAgaWYgKG5ld1ZhbCkgeworICAgICAgICAgICAgICAgICAgICAgICAgJGRvY3VtZW50LmJpbmQoZXZlbnQsIGNhbGxiYWNrRnVuYyk7CisgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICAgICAgICAgICAgICAkZG9jdW1lbnQudW5iaW5kKGV2ZW50LCBjYWxsYmFja0Z1bmMpOworICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfSk7CisgICAgICAgIH0KKyAgICB9OworCisgICAgcmV0dXJuIHsKKyAgICAgICAgY2xpY2s6IF9jbGljaywKKyAgICAgICAgZXZlbnQ6IF9ldmVudAorICAgIH07Cit9XSkKKworLmZhY3RvcnkoJ0RPTUhlbHBlcicsIGZ1bmN0aW9uKCkgeworCisgICAgZnVuY3Rpb24gaXNUYWJhYmxlKG5vZGUpIHsKKyAgICAgICAgdmFyIGVsZW1lbnQgPSBhbmd1bGFyLmVsZW1lbnQobm9kZSk7CisgICAgICAgIHZhciBoYXNUYWJpbmRleCA9IChwYXJzZUludChlbGVtZW50LmF0dHIoJ3RhYmluZGV4JyksIDEwKSA+PSAwKSA/IHRydWUgOiBmYWxzZTsKKyAgICAgICAgdmFyIHRhZ05hbWUgPSBlbGVtZW50WzBdLnRhZ05hbWUudG9VcHBlckNhc2UoKTsKKworICAgICAgICBpZiAoaGFzVGFiaW5kZXggfHwgdGFnTmFtZSA9PT0gJ0EnIHx8IHRhZ05hbWUgPT09ICdJTlBVVCcgfHwgdGFnTmFtZSA9PT0gJ1RFWFRBUkVBJykgeworICAgICAgICAgICAgcmV0dXJuICEoZWxlbWVudFswXS5kaXNhYmxlZCB8fCBlbGVtZW50WzBdLnJlYWRPbmx5KTsKKyAgICAgICAgfQorICAgICAgICByZXR1cm4gZmFsc2U7CisgICAgfQorCisgICAgZnVuY3Rpb24gaXNWYWxpZENoaWxkKGNoaWxkKSB7CisgICAgICAgIHJldHVybiBjaGlsZC5ub2RlVHlwZSA9PSAxICYmIGNoaWxkLm5vZGVOYW1lICE9ICdTQ1JJUFQnICYmIGNoaWxkLm5vZGVOYW1lICE9ICdTVFlMRSc7CisgICAgfQorCisgICAgZnVuY3Rpb24gdHJhdmVyc2Uob2JqKSB7CisgICAgICAgIHZhciBvYmogPSBvYmogfHwgZG9jdW1lbnQuZ2V0RWxlbWVudHNCeVRhZ05hbWUoJ2JvZHknKVswXTsKKyAgICAgICAgaWYgKGlzVmFsaWRDaGlsZChvYmopICYmIGlzVGFiYWJsZShvYmopKSB7CisgICAgICAgICAgICByZXR1cm4gb2JqOworICAgICAgICB9IAorICAgICAgICBpZiAob2JqLmhhc0NoaWxkTm9kZXMoKSkgeworICAgICAgICAgICAgdmFyIGNoaWxkID0gb2JqLmZpcnN0Q2hpbGQ7CisgICAgICAgICAgICB3aGlsZShjaGlsZCkgeworICAgICAgICAgICAgICAgIHZhciByZXMgPSAgdHJhdmVyc2UoY2hpbGQpOworICAgICAgICAgICAgICAgIGlmKHJlcyl7CisgICAgICAgICAgICAgICAgICAgIHJldHVybiByZXM7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIGVsc2V7CisgICAgICAgICAgICAgICAgICAgIGNoaWxkID0gY2hpbGQubmV4dFNpYmxpbmc7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgICAgIGVsc2V7CisgICAgICAgICAgICByZXR1cm4gdW5kZWZpbmVkOworICAgICAgICB9CisgICAgfQorCisgICAgdmFyIF9maXJzdFRhYmFibGVFbGVtZW50ID0gZnVuY3Rpb24oZWwpIHsKKyAgICAgICAgLyogVGhpcyB3aWxsIHJldHVybiB0aGUgZmlyc3QgdGFiYWJsZSBlbGVtZW50IGZyb20gdGhlIHBhcmVudCBlbCAqLworICAgICAgICB2YXIgZWxlbSA9IGVsOworICAgICAgICBpZiAoZWwuaGFzT3duUHJvcGVydHkoJ2xlbmd0aCcpKSB7CisgICAgICAgICAgICBlbGVtID0gZWxbMF07CisgICAgICAgIH0KKworICAgICAgICByZXR1cm4gdHJhdmVyc2UoZWxlbSk7CisgICAgfTsKKworICAgIHJldHVybiB7CisgICAgICAgIGZpcnN0VGFiYWJsZUVsZW1lbnQ6IF9maXJzdFRhYmFibGVFbGVtZW50CisgICAgfTsKK30pCisKKy5mYWN0b3J5KCdrZXltYXAnLCBmdW5jdGlvbigpeworICAgIHJldHVybiB7CisgICAgS0VZOnsKKyAgICAgICAgVEFCOiA5LAorICAgICAgICBFTlRFUjogMTMsCisgICAgICAgIEVTQzogMjcsCisgICAgICAgIFNQQUNFOiAzMiwKKyAgICAgICAgTEVGVDogMzcsCisgICAgICAgIFVQOiAzOCwKKyAgICAgICAgUklHSFQ6IDM5LAorICAgICAgICBET1dOOiA0MCwKKyAgICAgICAgU0hJRlQ6IDE2LAorICAgICAgICBDVFJMOiAxNywKKyAgICAgICAgQUxUOiAxOCwKKyAgICAgICAgUEFHRV9VUDogMzMsCisgICAgICAgIFBBR0VfRE9XTjogMzQsCisgICAgICAgIEhPTUU6IDM2LAorICAgICAgICBFTkQ6IDM1LAorICAgICAgICBCQUNLU1BBQ0U6IDgsCisgICAgICAgIERFTEVURTogNDYsCisgICAgICAgIENPTU1BTkQ6IDkxCisgICAgICAgIH0sCisgICAgICAgIE1BUDogeyA5MSA6ICJDT01NQU5EIiwgOCA6ICJCQUNLU1BBQ0UiICwgOSA6ICJUQUIiICwgMTMgOiAiRU5URVIiICwgMTYgOiAiU0hJRlQiICwgMTcgOiAiQ1RSTCIgLCAxOCA6ICJBTFQiICwgMTkgOiAiUEFVU0VCUkVBSyIgLCAyMCA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IDExMiA6ICJGMSIgLCAxMTMgOiAiRjIiICwgMTE0IDogIkYzIiAsIDExNSA6ICJGNCIgLCAxMTYgOiAiRjUiICwgMTE3IDogIkY2IiAsIDExOCA6ICJGNyIgLCAxMTkgOiAiRjgiICwgMTIwIDogIkY5IiAsIDEyMSA6ICJGMTAiICwgMTIyIDogIkYxMSIgLCAxMjMgOiAiRjEyIiwgMTQ0IDogIk5VTUxPQ0siICwgMTQ1IDogIlNDUk9MTExPQ0siICwgMTg2IDogIjsiICwgMTg3IDogIj0iICwgMTg4IDogIiwiICwgMTg5IDogIi0iICwgMTkwIDogIi4iICwgMTkxIDogIi8iICwgMTkyIDogImAiICwgMjE5IDogIlsiICwgMjIwIDogIlxcIiAsIDIyMSA6ICJdIiAsIDIyMiA6ICInIgorICAgICAgICB9LAorICAgICAgICBpc0NvbnRyb2w6IGZ1bmN0aW9uIChlKSB7CisgICAgICAgICAgICB2YXIgayA9IGUua2V5Q29kZTsKKyAgICAgICAgICAgIHN3aXRjaCAoaykgeworICAgICAgICAgICAgY2FzZSB0aGlzLktFWS5DT01NQU5EOgorICAgICAgICAgICAgY2FzZSB0aGlzLktFWS5TSElGVDoKKyAgICAgICAgICAgIGNhc2UgdGhpcy5LRVkuQ1RSTDoKKyAgICAgICAgICAgIGNhc2UgdGhpcy5LRVkuQUxUOgorICAgICAgICAgICAgICAgIHJldHVybiB0cnVlOworICAgICAgICAgICAgZGVmYXVsdDo7CisgICAgICAgICAgICB9CisKKyAgICAgICAgICAgIGlmIChlLm1ldGFLZXkpIHsKKyAgICAgICAgICAgICAgICByZXR1cm4gdHJ1ZTsKKyAgICAgICAgICAgIH0KKworICAgICAgICAgICAgcmV0dXJuIGZhbHNlOworICAgICAgICB9LAorICAgICAgICBpc0Z1bmN0aW9uS2V5OiBmdW5jdGlvbiAoaykgeworICAgICAgICAgICAgayA9IGsua2V5Q29kZSA/IGsua2V5Q29kZSA6IGs7CisgICAgICAgICAgICByZXR1cm4gayA+PSAxMTIgJi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IGRvY3VtZW50LmNyZWF0ZUVsZW1lbnQoJ2RpdicpLAorCQkJYWxsID0gZGl2LmdldEVsZW1lbnRzQnlUYWdOYW1lKCdpJyk7CisJCWRvIHsKKwkJCWRpdi5pbm5lckhUTUwgPSAnPCEtLVtpZiBndCBJRSAnICsgKCsrdikgKyAnXT48aT48L2k+PCFbZW5kaWZdLS0+JzsKKwkJfSB3aGlsZSAoYWxsWzBdKTsKKwkJcmV0dXJuIHYgPiA0ID8gdiA6IHVuZGVmaW5lZDsKKwl9OworCQorCXJldHVybiBmdW5jdGlvbiAoKSB7CisJCWlmIChpZT09PW51bGwpIHsKKwkJCWllID0gbG9hZElFVmVyc2lvbigpOworCQl9CisJCXJldHVybiBpZTsKKwl9OworfSk7CisoZnVuY3Rpb24gKCkgeworICAgIFN0cmluZy5wcm90b3R5cGUudG9TbmFrZUNhc2UgPSBmdW5jdGlvbiAoKSB7CisgICAgICAgIHJldHVybiB0aGlzLnJlcGxhY2UoLyhbQS1aXSkvZywgZnVuY3Rpb24gKCQxKSB7CisgICAgICAgICAgICByZXR1cm4gIi0iICsgJDEudG9Mb3dlckNhc2UoKTsKKyAgICAgICAgfSk7CisgICAgfTsKKyAgICB2YXIgY29uY2F0ID0gZnVuY3Rpb24gKGNoYXJhY3RlciwgdGltZXMpIHsKKyAgICAgICAgY2hhcmFjdGVyID0gY2hhcmFjdGVyIHx8ICcnOworICAgICAgICB0aW1lcyA9ICghaXNOYU4odGltZXMpICYmIHRpbWVzKSB8fCAwOworICAgICAgICB2YXIgZmluYWxDaGFyID0gJyc7CisgICAgICAgIGZvciAodmFyIGkgPSAwOyBpIDwgdGltZXM7IGkrKykgeworICAgICAgICAgICAgZmluYWxDaGFyICs9IGNoYXJhY3RlcjsKKyAgICAgICAgfQorICAgICAgICByZXR1cm4gZmluYWxDaGFyOworICAgIH07CisKKyAgICAvLyBkaXJlY3Rpb246IHRydWUgZm9yIGxlZnQgYW5kIGZhbHNlIGZvciByaWdodAorICAgIHZhciBwYWQgPSBmdW5jdGlvbiAoYWN0dWFsU3RyaW5nLCB3aWR0aCwgY2hhcmFjdGVyLCBkaXJlY3Rpb24pIHsKKyAgICAgICAgYWN0dWFsU3RyaW5nID0gYWN0dWFsU3RyaW5nIHx8ICcnOworICAgICAgICB3aWR0aCA9ICghaXNOYU4od2lkdGgpICYmIHdpZHRoKSB8fCAwOworICAgICAgICBjaGFyYWN0ZXIgPSBjaGFyYWN0ZXIgfHwgJyc7CisgICAgICAgIGlmICh3aWR0aCA+IGFjdHVhbFN0cmluZy5sZW5ndGgpIHsKKyAgICAgICAgICAgIGlmIChkaXJlY3Rpb24pIHsKKyAgICAgICAgICAgICAgICByZXR1cm4gY29uY2F0KGNoYXJhY3RlciwgKHdpZHRoIC0gYWN0dWFsU3RyaW5nLmxlbmd0aCkpICsgYWN0dWFsU3RyaW5nOworICAgICAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgICAgICByZXR1cm4gYWN0dWFsU3RyaW5nICsgY29uY2F0KGNoYXJhY3RlciwgKHdpZHRoIC0gYWN0dWFsU3RyaW5nLmxlbmd0aCkpOworICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgICAgIHJldHVybiBhY3R1YWxTdHJpbmc7CisgICAgfTsKKworICAgIFN0cmluZy5wcm90b3R5cGUubFBhZCA9IGZ1bmN0aW9uICh3aWR0aCwgY2hhcmFjdGVyKSB7CisgICAgICAgIHJldHVybiBwYWQodGhpcywgd2lkdGgsIGNoYXJhY3RlciwgdHJ1ZSk7CisgICAgfTsKKworICAgIFN0cmluZy5wcm90b3R5cGUuclBhZCA9IGZ1bmN0aW9uICh3aWR0aCwgY2hhcmFjdGVyKSB7CisgICAgICAgIHJldHVybiBwYWQodGhpcywgd2lkdGgsIGNoYXJhY3RlciwgZmFsc2UpOworICAgIH07CisKKyAgICBpZiAoIUFycmF5LnByb3RvdHlwZS5pbmRleE9mKSB7CisgICAgICAgIEFycmF5LnByb3RvdHlwZS5pbmRleE9mID0gZnVuY3Rpb24gKHZhbCkgeworICAgICAgICAgICAgZm9yICh2YXIgaW5kZXggPSAwOyBpbmRleCA8IHRoaXMubGVuZ3RoOyBpbmRleCsrKSB7CisgICAgICAgICAgICAgICAgaWYgKHRoaXNbaW5kZXhdID09PSB2YWwpIHsKKyAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGluZGV4OworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIHJldHVybiAtMTsKKyAgICAgICAgfTsKKyAgICB9Cit9KSgpOworCithbmd1bGFyLm1vZHVsZSgnYXR0LmFicy5wb3NpdGlvbicsIFtdKQorCisuZmFjdG9yeSgnJHBvc2l0aW9uJywgWyckZG9jdW1lbnQnLCAnJHdpbmRvdycsIGZ1bmN0aW9uICgkZG9jdW1lbnQsICR3aW5kb3cpIHsKKyAgICBmdW5jdGlvbiBnZXRTdHlsZShlbCwgY3NzcHJvcCkgeworICAgICAgICBpZiAoZWwuY3VycmVudFN0eWxlKSB7IC8vSUUKKyAgICAgICAgICAgIHJldHVybiBlbC5jdXJyZW50U3R5bGVbY3NzcHJvcF07CisgICAgICAgIH0gZWxzZSBpZiAoJHdpbmRvdy5nZXRDb21wdXRlZFN0eWxlKSB7CisgICAgICAgICAgICByZXR1cm4gJHdpbmRvdy5nZXRDb21wdXRlZFN0eWxlKGVsKVtjc3Nwcm9wXTsKKyAgICAgICAgfQorICAgICAgICAvLyBmaW5hbGx5IHRyeSBhbmQgZ2V0IGlubGluZSBzdHlsZQorICAgICAgICByZXR1cm4gZWwuc3R5bGVbY3NzcHJvcF07CisgICAgfQorCisgICAgLyoqCisgICAgICogQ2hlY2tzIGlmIGEgZ2l2ZW4gZWxlbWVudCBpcyBzdGF0aWNhbGx5IHBvc2l0aW9uZWQKKyAgICAgKiBAcGFyYW0gZWxlbWVudCAtIHJhdyBET00gZWxlbWVudAorICAgICAqLworICAgIGZ1bmN0aW9uIGlzU3RhdGljUG9zaXRpb25lZChlbGVtZW50KSB7CisgICAgICAgIHJldHVybiAoZ2V0U3R5bGUoZWxlbWVudCwgInBvc2l0aW9uIikgfHwgJ3N0YXRpYycpID09PSAnc3RhdGljJzsKKyAgICB9CisKKyAgICAvKioKKyAgICAgKiByZXR1cm5zIHRoZSBjbG9zZXN0LCBub24tc3RhdGljYWxseSBwb3NpdGlvbmVkIHBhcmVudE9mZnNldCBvZiBhIGdpdmVuIGVsZW1lbnQKKyAgICAgKiBAcGFyYW0gZWxlbWVudAorICAgICAqLworICAgIHZhciBwYXJlbnRPZmZzZXRFbCA9IGZ1bmN0aW9uIChlbGVtZW50KSB7CisgICAgICAgIHZhciBkb2NEb21FbCA9ICRkb2N1bWVudFswXTsKKyAgICAgICAgdmFyIG9mZnNldFBhcmVudCA9IGVsZW1lbnQub2Zmc2V0UGFyZW50IHx8IGRvY0RvbUVsOworICAgICAgICB3aGlsZSAob2Zmc2V0UGFyZW50ICYmIG9mZnNldFBhcmVudCAhPT0gZG9jRG9tRWwgJiYgaXNTdGF0aWNQb3NpdGlvbmVkKG9mZnNldFBhcmVudCkpIHsKKyAgICAgICAgICAgIG9mZnNldFBhcmVudCA9IG9mZnNldFBhcmVudC5vZmZzZXRQYXJlbnQ7CisgICAgICAgIH0KKyAgICAgICAgcmV0dXJuIG9mZnNldFBhcmVudCB8fCBkb2NEb21FbDsKKyAgICB9OworCisgICAgcmV0dXJuIHsKKyAgICAgICAgLyoqCisgICAgICAgICAqIFByb3ZpZGVzIHJlYWQtb25seSBlcXVpdmFsZW50IG9mIGpRdWVyeSdzIHBvc2l0aW9uIGZ1bmN0aW9uOgorICAgICAgICAgKiBodHRwOi8vYXBpLmpxdWVyeS5jb20vcG9zaXRpb24vCisgICAgICAgICAqLworICAgICAgICBwb3NpdGlvbjogZnVuY3Rpb24gKGVsZW1lbnQpIHsKKyAgICAgICAgICAgIHZhciBlbEJDUiA9IHRoaXMub2Zmc2V0KGVsZW1lbnQpOworICAgICAgICAgICAgdmFyIG9mZnNldFBhcmVudEJDUiA9IHsKKyAgICAgICAgICAgICAgICB0b3A6IDAsCisgICAgICAgICAgICAgICAgbGVmdDogMAorICAgICAgICAgICAgfTsKKyAgICAgICAgICAgIHZhciBvZmZzZXRQYXJlbnRFbCA9IHBhcmVudE9mZnNldEVsKGVsZW1lbnRbMF0pOworICAgICAgICAgICAgaWYgKG9mZnNldFBhcmVudEVsICE9PSAkZG9jdW1lbnRbMF0pIHsKKyAgICAgICAgICAgICAgICBvZmZzZXRQYXJlbnRCQ1IgPSB0aGlzLm9mZnNldChhbmd1bGFyLmVsZW1lbnQob2Zmc2V0UGFyZW50RWwpKTsKKyAgICAgICAgICAgICAgICBvZmZzZXRQYXJlbnRCQ1IudG9wICs9IG9mZnNldFBhcmVudEVsLmNsaWVudFRvcCAtIG9mZnNldFBhcmVudEVsLnNjcm9sbFRvcDsKKyAgICAgICAgICAgICAgICBvZmZzZXRQYXJlbnRCQ1IubGVmdCArPSBvZmZzZXRQYXJlbnRFbC5jbGllbnRMZWZ0IC0gb2Zmc2V0UGFyZW50RWwuc2Nyb2xsTGVmdDsKKyAgICAgICAgICAgIH0KKworICAgICAgICAgICAgcmV0dXJuIHsKKyAgICAgICAgICAgICAgICB3aWR0aDogZWxlbWVudC5wcm9wKCdvZmZzZXRXaWR0aCcpLAorICAgICAgICAgICAgICAgIGhlaWdodDogZWxlbWVudC5wcm9wKCdvZmZzZXRIZWlnaHQnKSwKKyAgICAgICAgICAgICAgICB0b3A6IGVsQkNSLnRvcCAtIG9mZnNldFBhcmVudEJDUi50b3AsCisgICAgICAgICAgICAgICAgbGVmdDogZWxCQ1IubGVmdCAtIG9mZnNldFBhcmVudEJDUi5sZWZ0CisgICAgICAgICAgICB9OworICAgICAgICB9LAorCisgICAgICAgIC8qKgorICAgICAgICAgKiBQcm92aWRlcyByZWFkLW9ubHkgZXF1aXZhbGVudCBvZiBqUXVlcnkncyBvZmZzZXQgZnVuY3Rpb246CisgICAgICAgICAqIGh0dHA6Ly9hcGkuanF1ZXJ5LmNvb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kgeworICAgICAgICAgICAgcmV0dXJuIGZhbHNlOworICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgcmV0dXJuIGlzRWxlbWVudCgoY3VycmVudEVsZW0ucGFyZW50KClbMF0gJiYgY3VycmVudEVsZW0ucGFyZW50KCkpIHx8IHRhcmdldEVsZW0sIHRhcmdldEVsZW0sIGFsdGVybmF0ZUVsZW0pOworICAgICAgICB9CisgICAgfTsKKworICAgIHJldHVybiBpc0VsZW1lbnQ7Cit9XSkKKworLmRpcmVjdGl2ZSgnYXR0UG9zaXRpb24nLCBbJyRwb3NpdGlvbicsIGZ1bmN0aW9uICgkcG9zaXRpb24pIHsKKyAgICByZXR1cm4geworICAgICAgICByZXN0cmljdDogJ0EnLAorICAgICAgICBsaW5rOiBmdW5jdGlvbiAoc2NvcGUsIGVsZW0sIGF0dHIpIHsKKyAgICAgICAgICAgIHNjb3BlLiR3YXRjaENvbGxlY3Rpb24oZnVuY3Rpb24gKCkgeworICAgICAgICAgICAgICAgIHJldHVybiAkcG9zaXRpb24ucG9zaXRpb24oZWxlbSk7CisgICAgICAgICAgICB9LCBmdW5jdGlvbiAodmFsdWUpIHsKKyAgICAgICAgICAgICAgICBzY29wZVthdHRyLmF0dFBvc2l0aW9uXSA9IHZhbHVlOworICAgICAgICAgICAgfSk7CisgICAgICAgIH0KKyAgICB9OworfV0pOworCisvKiEKKyAqIFZFUlNJT046IDEuNy4zCisgKiBEQVRFOiAyMDE0LTAxLTE0CisgKiBVUERBVEVTIEFORCBET0NTIEFUOiBodHRwOi8vd3d3LmdyZWVuc29jay5jb20KKyAqCisgKiBAbGljZW5zZSBDb3B5cmlnaHQgKGMpIDIwMDgtMjAxNCwgR3JlZW5Tb2NrLiBBbGwgcmlnaHRzIHJlc2VydmVkLgorICogVGhpcyB3b3JrIGlzIHN1YmplY3QgdG8gdGhlIHRlcm1zIGF0IGh0dHA6Ly93d3cuZ3JlZW5zb2NrLmNvbS90ZXJtc19vZl91c2UuaHRtbCBvciBm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gPSB0aGlzOworICAgIGFuZ3VsYXIuZm9yRWFjaCh0aGlzLmdyb3VwcywgZnVuY3Rpb24gKGdyb3VwLCBpbmRleCkgeworICAgICAgICBpZiAoZ3JvdXAgIT09IGZvY3VzR3JvdXApIHsKKyAgICAgICAgICAgIGdyb3VwLmZvY3VzZWQgPSBmYWxzZTsKKyAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgIHNlbGYuaW5kZXggPSBpbmRleDsKKyAgICAgICAgICAgIGdyb3VwLmZvY3VzZWQgPSB0cnVlOworICAgICAgICB9CisgICAgfSk7Cit9OworLyoqIEBwYXJhbSBibHVyR3JvdXAqLwordGhpcy5ibHVyID0gZnVuY3Rpb24gKGJsdXJHcm91cCkgeworICAgIGJsdXJHcm91cC5mb2N1c2VkID0gZmFsc2U7CisgICAgdGhpcy5pbmRleCA9IC0xOworICAgICRsb2cubG9nKCJhY2NvcmRpb24uYmx1cigpIiwgYmx1ckdyb3VwKTsKK307CisvKiogQHBhcmFtIGdyb3VwIC0gdGhlIGdyb3VwIGluIGN1cnJlbnQgZm9jdXMgQHBhcmFtIGRvd24gLSBjeWNsaW5nIGRvd24gKi8KK3RoaXMuY3ljbGUgPSBmdW5jdGlvbiAoZ3JvdXAsIGRvd24sIG5vUmVjeWNsZSkgeworICAgIGlmICghZG93bikgeworICAgICAgICBpZiAodGhpcy5pbmRleCA8PSAwICYmICFub1JlY3ljbGUpIHsKKyAgICAgICAgICAgIHRoaXMuaW5kZXggPSB0aGlzLmdyb3Vwcy5sZW5ndGggLSAxOworICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgdGhpcy5pbmRleC0tOworICAgICAgICB9CisgICAgfSBlbHNlIHsKKyAgICAgICAgaWYgKHRoaXMuaW5kZXggPT09ICh0aGlzLmdyb3Vwcy5sZW5ndGggLSAxKSkKKyAgICAgICAgeworICAgICAgICAgICAgaWYgKG5vUmVjeWNsZSkgeworICAgICAgICAgICAgICAgIHRoaXMuaW5kZXggPSAwOworICAgICAgICAgICAgICAgIGdyb3VwLmZvY3VzZWQgPSBmYWxzZTsKKyAgICAgICAgICAgICAgICAkc2NvcGUuJGFwcGx5KCk7CisgICAgICAgICAgICAgICAgcmV0dXJuOworICAgICAgICAgICAgfQorICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIHRoaXMuaW5kZXggPSAwOworICAgICAgICAgICAgfQorICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgdGhpcy5pbmRleCsrOworICAgICAgICB9CisgICAgfQorCisgICAgZ3JvdXAuZm9jdXNlZCA9IGZhbHNlOworICAgIHRoaXMuZ3JvdXBzW3RoaXMuaW5kZXhdLnNldEZvY3VzID0gdHJ1ZTsKKyAgICB0aGlzLmdyb3Vwc1t0aGlzLmluZGV4XS5mb2N1c2VkID0gdHJ1ZTsKKyAgICAkc2NvcGUuJGFwcGx5KCk7Cit9OworLy8gVGhpcyBpcyBjYWxsZWQgZnJvbSB0aGUgYWNjb3JkaW9uLWdyb3VwIGRpcmVjdGl2ZSB0byBhZGQgaXRzZWxmIHRvIHRoZSBhY2NvcmRpb24KK3RoaXMuYWRkR3JvdXAgPSBmdW5jdGlvbiAoZ3JvdXBTY29wZSkgeworICAgIHZhciB0aGF0ID0gdGhpczsKKyAgICBncm91cFNjb3BlLmluZGV4ID0gdGhpcy5ncm91cHMubGVuZ3RoOworICAgIGdyb3VwU2NvcGUuZm9jdXNlZCA9IGZhbHNlOworICAgIHRoaXMuZ3JvdXBzLnB1c2goZ3JvdXBTY29wZSk7CisKKyAgICBpZih0aGlzLmdyb3Vwcy5sZW5ndGggPiAwKXsKKyAgICAgICAgdGhpcy5pbmRleCA9IDA7CisgICAgfQorCisgICAgZ3JvdXBTY29wZS4kb24oJyRkZXN0cm95JywgZnVuY3Rpb24gKCkgeworICAgICAgICB0aGF0LnJlbW92ZUdyb3VwKGdyb3VwU2NvcGUpOworICAgIH0pOworfTsKKy8vIFRoaXMgaXMgY2FsbGVkIGZyb20gd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AgICAgICAgICAgICAgICBpZiAodmFsdWUpIHsKKyAgICAgICAgICAgICAgICAgICAgY3RybC5leHBhbmRBbGwoKTsKKyAgICAgICAgICAgICAgICAgICAgc2NvcGUuZXhwYW5kQWxsID0gZmFsc2U7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfSk7CisgICAgICAgICAgICBzY29wZS4kd2F0Y2goImNvbGxhcHNlQWxsIiwgZnVuY3Rpb24gKHZhbHVlKSB7CisgICAgICAgICAgICAgICAgaWYgKHZhbHVlKSB7CisgICAgICAgICAgICAgICAgICAgIGN0cmwuY29sbGFwc2VBbGwoKTsKKyAgICAgICAgICAgICAgICAgICAgc2NvcGUuY29sbGFwc2VBbGwgPSBmYWxzZTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9KTsKKyAgICAgICAgfQorICAgIH07Cit9KQorLy9UaGUgYWNjb3JkaW9uLWdyb3VwIGRpcmVjdGl2ZSBpbmRpY2F0ZXMgYSBibG9jayBvZiBodG1sIHRoYXQgd2lsbCBleHBhbmQgYW5kIGNvbGxhcHNlIGluIGFuIGFjY29yZGlvbgorLmRpcmVjdGl2ZSgnYWNjb3JkaW9uR3JvdXAnLCBbIGZ1bmN0aW9uICgpIHsKKyAgICAgICAgcmV0dXJuIHsKKyAgICAgICAgICAgIC8vIFdlIG5lZWQgdGhpcyBkaXJlY3RpdmUgdG8gYmUgaW5zaWRlIGFuIGFjY29yZGlvbgorICAgICAgICAgICAgcmVxdWlyZTogWydeYWNjb3JkaW9uJywgJ2FjY29yZGlvbkdyb3VwJ10sCisgICAgICAgICAgICByZXN0cmljdDogJ0VBJywKKyAgICAgICAgICAgIC8vIEl0IHRyYW5zY2x1ZGVzIHRoZSBjb250ZW50cyBvZiB0aGUgZGlyZWN0aXZlIGludG8gdGhlIHRlbXBsYXRlCisgICAgICAgICAgICB0cmFuc2NsdWRlOiB0cnVlLAorICAgICAgICAgICAgLy8gVGhlIGVsZW1lbnQgY29udGFpbmluZyB0aGUgZGlyZWN0aXZlIHdpbGwgYmUgcmVwbGFjZWQgd2l0aCB0aGUgdGVtcGxhdGUKKyAgICAgICAgICAgIHJlcGxhY2U6IHRydWUsCisgICAgICAgICAgICB0ZW1wbGF0ZVVybDogJ2FwcC9zY3JpcHRzL25nX2pzX2F0dF90cGxzL2FjY29yZGlvbi9hY2NvcmRpb24uaHRtbCcsCisgICAgICAgICAgICBzY29wZTogeworICAgICAgICAgICAgICAgIC8vIENyZWF0ZSBhbiBpc29sYXRlZCBzY29wZSBhbmQgaW50ZXJwb2xhdGUgdGhlIGhlYWRpbmcgYXR0cmlidXRlIG9udG8gdGhpcyBzY29wZQorICAgICAgICAgICAgICAgIGhlYWRpbmc6ICdAJywKKyAgICAgICAgICAgICAgICBpc09wZW46ICc9PycKKyAgICAgICAgICAgIH0sCisgICAgICAgICAgICBjb250cm9sbGVyOiBbJyRzY29wZScsIGZ1bmN0aW9uICgkc2NvcGUpCisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAkc2NvcGUuc2hvd2ljb24gPSB0cnVlOworICAgICAgICAgICAgICAgICAgICB0aGlzLnNldEhlYWRpbmcgPSBmdW5jdGlvbiAoZWxlbWVudCkKKyAgICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAgICAgdGhpcy5oZWFkaW5nID0gZWxlbWVudDsKKyAgICAgICAgICAgICAgICAgICAgICAgICRzY29wZS5zaG93aWNvbiA9IGZhbHNlOworICAgICAgICAgICAgICAgICAgICB9OworICAgICAgICAgICAgICAgICAgICB0aGlzLmlzSXNPcGVuID0gZnVuY3Rpb24gKCkKKyAgICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuICRzY29wZS5pc09wZW47CisgICAgICAgICAgICAgICAgICAgIH07CisgICAgICAgICAgICAgICAgfV0sCisgICAgICAgICAgICBsaW5rOiBmdW5jdGlvbiAoc2NvcGUsIGVsZW1lbnQsIGF0dHJzLCBjdHJsKSB7CisgICAgICAgICAgICAgICAgdmFyIGFjY29yZGlvbkN0cmwgPSBjdHJsWzBdOworICAgICAgICAgICAgICAgIHZhciBhY2NvcmRpb25Hcm91cEN0cmwgPSBjdHJsWzFdOworICAgICAgICAgICAgICAgIHZhciBrZXlzID0ge3RhYjogOSwgZW50ZXI6IDEzLCBlc2M6IDI3LCBzcGFjZTogMzIsIHBhZ2V1cDogMzMsIHBhZ2Vkb3duOiAzNCwgZW5kOiAzNSwgaG9tZTogMzYsIGxlZnQ6IDM3LCB1cDogMzgsIHJpZ2h0OiAzOSwgZG93bjogNDB9OworICAgICAgICAgICAgICAgIC8vbm90IGEgZml4CisgICAgICAgICAgICAgICAgdmFyIHRhYiA9IGVsZW1lbnQuY2hpbGRyZW4oKS5lcSgwKTsKKyAgICAgICAgICAgICAgICB2YXIgcGFyZW50SHlwZXJMaW5rPWF0dHJzLnBhcmVudExpbms7CisgICAgICAgICAgICAgICAgc2NvcGUuc2V0Rm9jdXMgPSBmYWxzZTsKKyAgICAgICAgICAgICAgICBzY29wZS5jaGlsZExlbmd0aCA9IGF0dHJzLmNoaWxkTGVuZ3RoOworICAgICAgICAgICAgICAgIHNjb3BlLmhlYWRpbmdJY29uQ2xhc3MgPSBhdHRycy5pbWFnZVNvdXJjZTsKKworICAgICAgICAgICAgICAgIHZhciBoYW5kbGVLZXlkb3duID0gZnVuY3Rpb24gKGV2KSB7CisgICAgICAgICAgICAgICAgICAgIHZhciBib29sRmxhZyA9IHRydWU7CisgICAgICAgICAgICAgICAgICAgIHN3aXRjaCAoZXYua2V5Q29kZSkKKyAgICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAgICAgY2FzZSBrZXlzLmVudGVyOgorICAgICAgICAgICAgICAgICAgICAgICAgICAgIGV2LnByZXZlbnREZWZhdWx0KCk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2NvcGUudG9nZ2xlKCk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2NvcGUuJGFwcGx5KCk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgICAgICAgICBjYXNlIGtleXMudXA6CisgICAgICAgICAgICAgICAgICAgICAgICBjYXNlIGtleXMubGVmdDoKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBldi5wcmV2ZW50RGVmYXVsdCgpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGFjY29yZGlvbkN0cmwuY3ljbGUoc2NvcGUsIGZhbHNlKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICAgICAgICAgIGNhc2Uga2V5cy5kb3duOgorICAgICAgICAgICAgICAgICAgICAgICAgY2FzZSBrZXlzLnJpZ2h0OgorICAgICAgICAgICAgICAgICAgICAgICAgICAgIGV2LnByZXZlbnREZWZhdWx0KCk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgYWNjb3JkaW9uQ3RybC5jeWNsZShzY29wZSwgdHJ1ZSk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgICAgICAgICBkZWZhdWx0OgorICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJvb2xGbGFnID0gZmFsc2U7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgZXYuc3RvcFByb3BhZ2F0aW9uKCk7CisgICAgICAgICAgICAgICAgICAgIHJldHVybiBib29sRmxhZzsKKyAgICAgICAgICAgICAgICB9OworCisgICAgICAgICAgICAgICAgaWYgKGFuZ3VsYXIuaXNVbmRlZmluZWQoc2NvcGUuaXNPcGVuKSkgeworICAgICAgICAgICAgICAgICAgICBzY29wZS5pc09wZW4gPSBmYWxzZTsKKyAgICAgICAgICAgICAgICB9CisKKyAgICAgICAgICAgICAgICB0YWIuYmluZCgia2V5ZG93biIsIGhhbmRsZUtleWRvd24pOworCisgICAgICAgICAgICAgICAgYWNjb3JkaW9uQ3RybC5hZGRHcm91cChzY29wZSk7CisKKyAgICAgICAgICAgICAgICBpZiAoc2NvcGUuaW5kZXggPT09IDApIHsKKyAgICAgICAgICAgICAgICAgICAgc2NvcGUuZm9jdXNlZCA9IHRydWU7CisgICAgICAgICAgICAgICAgfQorCisgICAgICAgICAgICAgICAgYWNjb3JkaW9uR3JvdXBDdHJsLnRvZ2dsZSA9IHNjb3BlLnRvZ2dsZSA9IGZ1bmN0aW9uICgpIHsKKyAgICAgICAgICAgICAgICAJLyogaWYgdGhlIG1lbnUgaXRlbSBoYXMgY2hpbGRyZW4sIHRvZ2dsZS9leHBhbmQgY2hpbGQgbWVudSBvZiB0aGlzIGl0ZW0gKi8KKyAgICAgICAgICAgICAgICAJaWYgKHNjb3BlLmNoaWxkTGVuZ3RoPjApIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIHNjb3BlLmlzT3BlbiA9ICFzY29wZS5pc09wZW47CisgICAgICAgICAgICAgICAgICAgICAgICBhY2NvcmRpb25DdHJsLmZvY3VzKHNjb3BlKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBzY29wZS5pc09wZW47CisgICAgICAgICAgICAgICAgCX0KKyAgICAgICAgICAgICAgICAJLyogaWYgdGhlIG1lbnUgaXRlbSBkb2VzIG5vdCBoYXZlIGNoaWxkcmVuLCByZWRpcmVjdCB0byBwYXJlbnQgYWN0aW9uIFVSTCovCisgICAgICAgICAgICAgICAgCWVsc2UgeworICAgICAgICAgICAgICAgIAkJd2luZG93LmxvY2F0aW9uLmhyZWYgPSBwYXJlbnRIeXBlckxpbms7CisgICAgICAgICAgICAgICAgCX0KKyAgICAgICAgICAgICAgICAJCisgICAgICAgICAgICAgICAgfTsKKworICAgICAgICAgICAgICAgIHNjb3BlLiR3YXRjaCgnaXNPcGVuJywgZnVuY3Rpb24gKHZhbHVlKSB7CisgICAgICAgICAgICAgICAgICAgIGlmICh2YWx1ZSkgeworICAgICAgICAgICAgICAgICAgICAgICAgYWNjb3JkaW9uQ3RybC5jbG9zZU90aGVycyhzY29wZSk7CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICB9KTsKKworICAgICAgICAgICAgICAgIHNjb3BlLiR3YXRjaCgiZm9jdXNlZCIsIGZ1bmN0aW9uICh2YWx1ZSkgeworICAgICAgICAgICAgICAgICAgICBpZiAoISF2YWx1ZSkgeworICAgICAgICAgICAgICAgICAgICAgICAgdGFiLmF0dHIoInRhYmluZGV4IiwgIjAiKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIGlmKHNjb3BlLnNldEZvY3VzKXsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB0YWJbMF0uZm9jdXMoKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICBlbHNleworICAgICAgICAgICAgICAgICAgICAgICAgc2NvcGUuc2V0Rm9jdXMgPSBmYWxzZTsKKyAgICAgICAgICAgICAgICAgICAgICAgIHRhYi5hdHRyKCJ0YWJpbmRleCIsICItMSIpOworICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgfSk7CisgICAgICAgICAgICB9CisgICAgICAgIH07CisgICAgfV0pCisvL1VzZSBhY2NvcmRpb24taGVhZGluZyBiZWxvdyBhbiBhY2NvcmRpb24tZ3JvdXAgdG8gcHJvdmlkZSBhIGhlYWRpbmcgY29udGFpbmluZyBIVE1MCisvLzxhY2NvcmRpb24tZ3JvdXA+CisvLzxhY2NvcmRpb24taGVhZGluZz5IZWFkaW5nIGNvbnRhaW5pbmcgSFRNTCAtIDxpbWcgc3JjPSIuLi4iPjwvYWNjb3JkaW9uLWhlYWRpbmc+CisvLzwvYWNjb3JkaW9uLWdyb3VwPgorLmRpcmVjdGl2ZSgnYWNjb3JkaW9uVG9nZ2xlJywgZnVuY3Rpb24gKCkgeworICAgIHJldHVybnsKKyAgICAgICAgcmVzdHJpY3Q6ICdFQScsCisgICAgICAgIHJlcXVpcmU6ICdeYWNjb3JkaW9uR3JvdXAnLAorICAgICAgICBzY29wZTogeworICAgICAgICAgICAgZXhwYW5kSWNvbjogJ0AnLAorICAgICAgICAgICAgY29sbGFwc2VJY29uOiAnQCcKKyAgICAgICAgfSwKKyAgICAgICAgbGluazogZnVuY3Rpb24gKHNjb3BlLCBlbGVtZW50LCBhdHRyLCBhY2NvcmRpb25DdHJsKQorICAgICAgICB7CisgICAgICAgICAgICB2YXIgc2V0SWNvbiA9IGZ1bmN0aW9uIChpc09wZW4pIHsKKyAgICAgICAgICAgICAgICBpZiAoc2NvcGUuZXhwYW5kSWNvbiAmJiBzY29wZS5jb2xsYXBzZUljb24pCisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICBpZiAoaXNPcGVuKSB7CisgICAgICAgICAgICAgICAgICAgICAgICBlbGVtZW50LnJlbW92ZUNsYXNzKHNjb3BlLmV4cGFuZEljb24pOworICAgICAgICAgICAgICAgICAgICAgICAgZWxlbWVudC5hZGRDbGFzcyhzY29wZS5jb2xsYXBzZUljb24pOworICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgIGVsc2UgeworICAgICAgICAgICAgICAgICAgICAgICAgZWxlbWVudC5yZW1vdmVDbGFzcyhzY29wZS5jb2xsYXBzZUljb24pOworICAgICAgICAgICAgICAgICAgICAgICAgZWxlbWVudC5hZGRDbGFzcyhzY29wZS5leHBhbmRJY29uKTsKKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH07CisgICAgICAgICAgICBlbGVtZW50LmJpbmQoJ2NsaWNrJywgZnVuY3Rpb24gKCkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBhY2NvcmRpb25DdHJsLnRvZ2dsZSgpOworICAgICAgICAgICAgICAgIHNjb3BlLiRhcHBseSgpOworICAgICAgICAgICAgfSk7CisgICAgICA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nQpOworICAgICAgICB9KTsKKyAgICB9OworICAgIHJldHVybiBsaW5rOworfQorfTsKK30pCisvLyBVc2UgaW4gdGhlIGFjY29yZGlvbi1ncm91cCB0ZW1wbGF0ZSB0byBpbmRpY2F0ZSB3aGVyZSB5b3Ugd2FudCB0aGUgaGVhZGluZyB0byBiZSB0cmFuc2NsdWRlZAorLy8gWW91IG11c3QgcHJvdmlkZSB0aGUgcHJvcGVydHkgb24gdGhlIGFjY29yZGlvbi1ncm91cCBjb250cm9sbGVyIHRoYXQgd2lsbCBob2xkIHRoZSB0cmFuc2NsdWRlZCBlbGVtZW50CisgICAgICAgIC5kaXJlY3RpdmUoJ2FjY29yZGlvblRyYW5zY2x1ZGUnLCBmdW5jdGlvbiAoKSB7CisgICAgICAgICAgICByZXR1cm4geworICAgICAgICAgICAgICAgIHJlcXVpcmU6ICdeYWNjb3JkaW9uR3JvdXAnLAorICAgICAgICAgICAgICAgIGxpbms6IGZ1bmN0aW9uIChzY29wZSwgZWxlbWVudCwgYXR0ciwgY29udHJvbGxlcikgeworICAgICAgICAgICAgICAgICAgICBzY29wZS4kd2F0Y2goZnVuY3Rpb24gKCkgeworICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGNvbnRyb2xsZXJbYXR0ci5hY2NvcmRpb25UcmFuc2NsdWRlXTsKKyAgICAgICAgICAgICAgICAgICAgfSwgZnVuY3Rpb24gKGhlYWRpbmcpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIGlmIChoZWFkaW5nKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgZWxlbWVudC5maW5kKCJzcGFuIikuZXEoMCkucHJlcGVuZChoZWFkaW5nKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgfSk7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfTsKKyAgICAgICAgfSkKKyAgICAgICAgLmRpcmVjdGl2ZSgnYXR0R29Ub3AnLCBbJyRzY3JvbGxUbycsIGZ1bmN0aW9uICgkc2Nyb2xsVG8pIHsKKyAgICAgICAgICAgICAgICByZXR1cm4geworICAgICAgICAgICAgICAgICAgICByZXN0cmljdDogJ0EnLAorICAgICAgICAgICAgICAgICAgICB0cmFuc2NsdWRlOiBmYWxzZSwKKyAgICAgICAgICAgICAgICAgICAgbGluazogZnVuY3Rpb24gKHNjb3BlLCBlbGVtLCBhdHRycykKKyAgICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAgICAgZWxlbS5iaW5kKCdjbGljaycsIGZ1bmN0aW9uICgpCisgICAgICAgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgJHNjcm9sbFRvKDAsIGF0dHJzWyJhdHRHb1RvcCJdKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIH0pOworICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgfTsKKyAgICAgICAgICAgIH1dKQorICAgICAgICAuZGlyZWN0aXZlKCdhdHRHb1RvJywgWyckYW5jaG9yU2Nyb2xsJywgJyRsb2NhdGlvbicsIGZ1bmN0aW9uICgkYW5jaG9yU2Nyb2xsLCAkbG9jYXRpb24pIHsKKyAgICAgICAgICAgICAgICByZXR1cm4geworICAgICAgICAgICAgICAgICAgICByZXN0cmljdDogJ0EnLAorICAgICAgICAgICAgICAgICAgICB0cmFuc2NsdWRlOiBmYWxzZSwKKyAgICAgICAgICAgICAgICAgICAgbGluazogZnVuY3Rpb24gKHNjb3BlLCBlbGVtLCBhdHRycykKKyAgICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAgICAgZWxlbS5iaW5kKCdjbGljaycsIGZ1bmN0aW9uICgpCisgICAgICAgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFyIG5ld0hhc2ggPSBhdHRyc1siYXR0R29UbyJdOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICgkbG9jYXRpb24uaGFzaCgpICE9PSBuZXdIYXNoKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJGxvY2F0aW9uLmhhc2goYXR0cnNbImF0dEdvVG8iXSk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICRhbmNob3JTY3JvbGwoKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICB9KTsKKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIH07CisgICAgICAgICAgICB9XSkKKyAgICAgICAgLmRpcmVjdGl2ZSgnZnJlZVN0YW5kaW5nJywgZnVuY3Rpb24gKCkgeworICAgICAgICAgICAgcmV0dXJuIHsKKyAgICAgICAgICAgICAgICByZXN0cmljdDogJ0VBJywKKyAgICAgICAgICAgICAgICB0cmFuc2NsdWRlOiB0cnVlLAorICAgICAgICAgICAgICAgIHJlcGxhY2U6IHRydWUsCisgICAgICAgICAgICAgICAgc2NvcGU6IHRydWUsCisgICAgICAgICAgICAgICAgdGVtcGxhdGU6ICI8ZGl2PjxzcGFuIGNsYXNzPSdhdHQtYWNjb3JkaW9uX19mcmVlc3RhbmRpbmcnIG5nLXNob3c9J3Nob3dBY2NvcmRpb24nPjwvc3Bhbj5cbiIgKworICAgICAgICAgICAgICAgICAgICAgICAgIjxkaXYgY2xhc3M9J3NlY3Rpb24tdG9nZ2xlJz5cbiIgKworICAgICAgICAgICAgICAgICAgICAgICAgIjxidXR0b24gY2xhc3M9J3NlY3Rpb24tdG9nZ2xlX19idXR0b24nIG5nLWNsaWNrPSdmc1RvZ2dsZSgpJz5cbiIgKworICAgICAgICAgICAgICAgICAgICAgICAgIiAgICB7e2J0blRleHR9fTxpIHN0eWxlPSdmb250LXNpemU6MC44NzVyZW0nIG5nLWNsYXNzPSd7XCJpY29uLWNoZXZyb24tdXBcIjogc2hvd0FjY29yZGlvbixcImljb24tY2hldnJvbi1kb3duXCI6ICFzaG93QWNjb3JkaW9uLCB9Jz48L2k+IFxuIiArCisgICAgICAgICAgICAgICAgICAgICAgICAiPC9idXR0b24+XG4iICsKKyAgICAgICAgICAgICAgICAgICAgICAgICI8L2Rpdj48L2Rpdj4iLAorICAgICAgICAgICAgICAgIGNvbXBpbGU6IGZ1bmN0aW9uIChlbGVtZW50LCBhdHRyLCB0cmFuc2NsdWRlKQorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgdmFyIGxpbmsgPSBmdW5jdGlvbiAoc2NvcGUsIGVsZW0sIGF0dHJzKSB7CisgICAgICAgICAgICAgICAgICAgICAgICBzY29wZS5jb250ZW50ID0gIiI7CisgICAgICAgICAgICAgICAgICAgICAgICB0cmFuc2NsdWRlKHNjb3BlLCBmdW5jdGlvbiAoY2xvbmUpCisgICAgICAgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgZWxlbS5maW5kKCJzcGFuIikuYXBwZW5kKGNsb25lKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIH0pOworICAgICAgICAgICAgICAgICAgICAgICAgc2NvcGUuc2hvd0FjY29yZGlvbiA9IGZhbHNlOworICAgICAgICAgICAgICAgICAgICAgICAgc2NvcGUuYnRuVGV4dCA9IHNjb3BlLnNob3dBY2NvcmRpb24gPyBhdHRycy5oaWRlTXNnIDogYXR0cnMuc2hvd01zZzsKKyAgICAgICAgICAgICAgICAgICAgICAgIHNjb3BlLmZzVG9nZ2xlID0gZnVuY3Rpb24gKCkKKyAgICAgICAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBzY29wZS5zaG93QWNjb3JkaW9uID0gIXNjb3BlLnNob3dBY2NvcmRpb247CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2NvcGUuYnRuVGV4dCA9IHNjb3BlLnNob3dBY2NvcmRpb24gPyBhdHRycy5oaWRlTXNnIDogYXR0cnMuc2hvd01zZzsKKyAgICAgICAgICAgICAgICAgICAgICAgIH07CisgICAgICAgICAgICAgICAgICAgIH07CisgICAgICAgICAgICAgICAgICAgIHJldHVybiBsaW5rOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH07CisgICAgICAgIH0pLmRpcmVjdGl2ZSgnZXhwYW5kZXJzJywgZnVuY3Rpb24gKCkgeworICAgIHJldHVybnsKKyAgICAgICAgcmVzdHJpY3Q6ICdFQScsCisgICAgICAgIHJlcGxhY2U6IHRydWUsCisgICAgICAgIHRyYW5zY2x1ZGU6IHRydWUsCisgICAgICAgIHRlbXBsYXRlOiAiPGRpdiBuZy10cmFuc2NsdWRlPjwvZGl2PiIsCisgICAgICAgIGNvbnRyb2xsZXI6IFsnJHNjb3BlJywgZnVuY3Rpb24gKCRzY29wZSl7CisgICAgICAgICAgICAgICAgdmFyIGJvZHlTY29wZSA9IG51bGw7CisgICAgICAgICAgICAgICAgdGhpcy5zZXRTY29wZSA9IGZ1bmN0aW9uIChzY29wZSkgeworICAgICAgICAgICAgICAgICAgICBib2R5U2NvcGUgPSBzY29wZTsKKyAgICAgICAgICAgICAgICB9OworICAgICAgICAgICAgICAgIHRoaXMudG9nZ2xlID0gZnVuY3Rpb24gKCkgeworICAgICAgICAgICAgICAgICAgICAkc2NvcGUuaXNPcGVuID0gYm9keVNjb3BlLmlzT3BlbiA9ICFib2R5U2NvcGUuaXNPcGVuOworICAgICAgICAgICAgICAgICAgICByZXR1cm4gYm9keVNjb3BlLmlzT3BlbjsKKyAgICAgICAgICAgICAgICB9OworICAgICAgICAgICAgfV0sCisgICAgICAgIGxpbms6IGZ1bmN0aW9uIChzY29wZSkKKyAgICAgICAgeworICAgICAgICAgICAgc2NvcGUuaXNPcGVuID0gZmFsc2U7CisgICAgICAgIH0KKyAgICB9OworfSkuZGlyZWN0aXZlKCdleHBhbmRlckhlYWRpbmcnLCBmdW5jdGlvbiAoKSB7CisgICAgcmV0dXJueworICAgICAgICByZXF1aXJlOiAiXmV4cGFuZGVycyIsCisgICAgICAgIHJlc3RyaWN0OiAnRUEnLAorICAgICAgICByZXBsYWNlOiB0cnVlLAorICAgICAgICB0cmFuc2NsdWRlOiB0cnVlLAorICAgICAgICBzY29wZTogdHJ1ZSwKKyAgICAgICAgdGVtcGxhdGU6ICI8ZGl2IHN0eWxlPSdwYWRkaW5nOjEwcHggIWltcG9ydGFudCcgbmctdHJhbnNjbHVkZT48L2Rpdj4iCisgICAgfTsKK30pLmRpcmVjdGl2ZSgnZXhwYW5kZXJCb2R5JywgZnVuY3Rpb24gKCkgeworICAgIHJldHVybnsKKyAgICAgICAgcmVzdHJpY3Q6ICdFQScsCisgICAgICAgIHJlcXVpcmU6ICJeZXhwYW5kZXJzIiwKKyAgICAgICAgcmVwbGFjZTogdHJ1ZSwKKyAgICAgICAgdHJhbnNjbHVkZTogdHJ1ZSwKKyAgICAgICAgc2NvcGU6IHt9LAorICAgICAgICB0ZW1wbGF0ZTogIjxkaXYgY29sbGFwc2U9JyFpc09wZW4nPjxkaXYgbmctdHJhbnNjbHVkZT48L2Rpdj48L2Rpdj4iLAorICAgICAgICBsaW5rOiBmdW5jdGlvbiAoc2NvcGUsIGVsZW0sIGF0dHIsIG15Q3RybCkgeworICAgICAgICAgICAgc2NvcGUuaXNPcGVuID0gZmFsc2U7CisgICAgICAgICAgICBteUN0cmwuc2V0U2NvcGUoc2NvcGUpOworICAgICAgICB9CisgICAgfTsKK30pLmRpcmVjdGl2ZSgnZXhwYW5kZXJUb2dnbGUnLCBmdW5jdGlvbiAoKSB7CisgICAgcmV0dXJueworICAgICAgICByZXN0cmljdDogJ0VBJywKKyAgICAgICAgcmVxdWlyZTogIl5leHBhbmRlcnMiLAorICAgICAgICBzY29wZTogeworICAgICAgICAgICAgZXhwYW5kSWNvbjogJ0AnLAorICAgICAgICAgICAgY29sbGFwc2VJY29uOiAnQCcKKyAgICAgICAgfSwKKyAgICAgICAgbGluazogZnVuY3Rpb24gKHNjb3BlLCBlbGVtZW50LCBhdHRyLCBteUN0cmwpCisgICAgICAgIHsKKyAgICAgICAgICAgIHZhciBpc09wZW4gPSBmYWxzZTsKKyAgICAgICAgICAgIHZhciBzZXRJY29uID0gZnVuY3Rpb24gKCkgeworICAgICAgICAgICAgICAgIGlmIChzY29wZS5leHBhbmRJY29uICYmIHNjb3BlLmNvbGxhcHNlSWNvbikKKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgIGlmIChpc09wZW4pIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIGVsZW1lbnQucmVtb3ZlQ2xhc3Moc2NvcGUuZXhwYW5kSWNvbik7CisgICAgICAgICAgICAgICAgICAgICAgICBlbGVtZW50LmFkZENsYXNzKHNjb3BlLmNvbGxhcHNlSWNvbik7CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgZWxzZSB7CisgICAgICAgICAgICAgICAgICAgICAgICBlbGVtZW50LnJlbW92ZUNsYXNzKHNjb3BlLmNvbGxhcHNlSWNvbik7CisgICAgICAgICAgICAgICAgICAgICAgICBlbGVtZW50LmFkZENsYXNzKHNjb3BlLmV4cGFuZEljb24pOworICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfTsKKyAgICAgICAgICAgIGVsZW1lbnQuYmluZCgia2V5ZG93biIsIGZ1bmN0aW9uIChlKSB7CisgICAgICAgICAgICAgICAgaWYgKGUua2V5Q29kZSA9PT0gMTMpCisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICBzY29wZS50b2dnbGVpdCgpOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0pOworICAgICAgICAgICAgZWxlbWVudC5iaW5kKCdjbGljaycsIGZ1bmN0aW9uICgpCisgICAgICAgICAgICB7CisgICAgICAgIC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A9IHsKKyAgICAgICAgICAgIG9wZW46IHsKKyAgICAgICAgICAgICAgICBtYXJnaW5Ub3A6IG51bGwsCisgICAgICAgICAgICAgICAgbWFyZ2luQm90dG9tOiBudWxsLAorICAgICAgICAgICAgICAgIHBhZGRpbmdUb3A6IG51bGwsCisgICAgICAgICAgICAgICAgcGFkZGluZ0JvdHRvbTogbnVsbCwKKyAgICAgICAgICAgICAgICBkaXNwbGF5OiAnYmxvY2snCisgICAgICAgICAgICB9LAorICAgICAgICAgICAgY2xvc2VkOiB7CisgICAgICAgICAgICAgICAgbWFyZ2luVG9wOiAwLAorICAgICAgICAgICAgICAgIG1hcmdpbkJvdHRvbTogMCwKKyAgICAgICAgICAgICAgICBwYWRkaW5nVG9wOiAwLAorICAgICAgICAgICAgICAgIHBhZGRpbmdCb3R0b206IDAsCisgICAgICAgICAgICAgICAgZGlzcGxheTogJ25vbmUnCisgICAgICAgICAgICB9CisgICAgICAgIH07CisgICAgICAgIHZhciBmaXhVcEhlaWdodCA9IGZ1bmN0aW9uIChzY29wZSwgZWxlbWVudCwgaGVpZ2h0KSB7CisgICAgICAgICAgICAvLyBXZSByZW1vdmUgdGhlIGNvbGxhcHNlIENTUyBjbGFzcyB0byBwcmV2ZW50IGEgdHJhbnNpdGlvbiB3aGVuIHdlIGNoYW5nZSB0byBoZWlnaHQ6IGF1dG8KKyAgICAgICAgICAgIGVsZW1lbnQucmVtb3ZlQ2xhc3MoJ2NvbGxhcHNlJyk7CisgICAgICAgICAgICBlbGVtZW50LmNzcyh7aGVpZ2h0OiBoZWlnaHR9KTsKKyAgICAgICAgICAgIC8vYWRqdXN0aW5nIGZvciBhbnkgbWFyZ2luIG9yIHBhZGRpbmcKKyAgICAgICAgICAgIGlmIChoZWlnaHQgPT09IDApIHsKKyAgICAgICAgICAgICAgICBlbGVtZW50LmNzcyhwcm9wcy5jbG9zZWQpOworICAgICAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgICAgICBlbGVtZW50LmNzcyhwcm9wcy5vcGVuKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIC8vIEl0IGFwcGVhcnMgdGhhdCAgcmVhZGluZyBvZmZzZXRXaWR0aCBtYWtlcyB0aGUgYnJvd3NlciByZWFsaXNlIHRoYXQgd2UgaGF2ZSBjaGFuZ2VkIHRoZQorICAgICAgICAgICAgLy8gaGVpZ2h0IGFscmVhZHkgOi0vCisgICAgICAgICAgICBlbGVtZW50LmFkZENsYXNzKCdjb2xsYXBzZScpOworICAgICAgICB9OworICAgICAgICByZXR1cm4geworICAgICAgICAgICAgbGluazogZnVuY3Rpb24gKHNjb3BlLCBlbGVtZW50LCBhdHRycykgeworICAgICAgICAgICAgICAgIHZhciBpc0NvbGxhcHNlZDsKKyAgICAgICAgICAgICAgICB2YXIgaW5pdGlhbEFuaW1Ta2lwID0gdHJ1ZTsKKyAgICAgICAgICAgICAgICBzY29wZS4kd2F0Y2goZnVuY3Rpb24gKCkgeworICAgICAgICAgICAgICAgICAgICByZXR1cm4gZWxlbWVudFswXS5zY3JvbGxIZWlnaHQ7CisgICAgICAgICAgICAgICAgfSwgZnVuY3Rpb24gKCkgeworICAgICAgICAgICAgICAgICAgICAvL1RoZSBsaXN0ZW5lciBpcyBjYWxsZWQgd2hlbiBzY3JvbGxIZWlnaHQgY2hhbmdlcworICAgICAgICAgICAgICAgICAgICAvL0l0IGFjdHVhbGx5IGRvZXMgb24gMiBzY2VuYXJpb3M6CisgICAgICAgICAgICAgICAgICAgIC8vIDEuIFBhcmVudCBpcyBzZXQgdG8gZGlzcGxheSBub25lCisgICAgICAgICAgICAgICAgICAgIC8vIDIuIGFuZ3VsYXIgYmluZGluZ3MgaW5zaWRlIGFyZSByZXNvbHZlZAorICAgICAgICAgICAgICAgICAgICAvL1doZW4gd2UgaGF2ZSBhIGNoYW5nZSBvZiBzY3JvbGxIZWlnaHQgd2UgYXJlIHNldHRpbmcgYWdhaW4gdGhlIGNvcnJlY3QgaGVpZ2h0IGlmIHRoZSBncm91cCBpcyBvcGVuZWQKKyAgICAgICAgICAgICAgICAgICAgaWYgKGVsZW1lbnRbMF0uc2Nyb2xsSGVpZ2h0ICE9PSAwICYmICFpc0NvbGxhcHNlZCkgeworICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGluaXRpYWxBbmltU2tpcCkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZpeFVwSGVpZ2h0KHNjb3BlLCBlbGVtZW50LCBlbGVtZW50WzBdLnNjcm9sbEhlaWdodCArICdweCcpOworICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBmaXhVcEhlaWdodChzY29wZSwgZWxlbWVudCwgJ2F1dG8nKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIH0pOworICAgICAgICAgICAgICAgIHZhciBjdXJyZW50VHJhbnNpdGlvbjsKKyAgICAgICAgICAgICAgICB2YXIgZG9UcmFuc2l0aW9uID0gZnVuY3Rpb24gKGNoYW5nZSkgeworICAgICAgICAgICAgICAgICAgICBpZiAoY3VycmVudFRyYW5zaXRpb24pIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIGN1cnJlbnRUcmFuc2l0aW9uLmNhbmNlbCgpOworICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgIGN1cnJlbnRUcmFuc2l0aW9uID0gJHRyYW5zaXRpb24oZWxlbWVudCwgY2hhbmdlKTsKKyAgICAgICAgICAgICAgICAgICAgY3VycmVudFRyYW5zaXRpb24udGhlbigKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBmdW5jdGlvbiAoKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGN1cnJlbnRUcmFuc2l0aW9uID0gdW5kZWZpbmVkOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0sCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgZnVuY3Rpb24gKCkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjdXJyZW50VHJhbnNpdGlvbiA9IHVuZGVmaW5lZDsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICk7CisgICAgICAgICAgICAgICAgICAgIHJldHVybiBjdXJyZW50VHJhbnNpdGlvbjsKKyAgICAgICAgICAgICAgICB9OworICAgICAgICAgICAgICAgIHZhciBleHBhbmQgPSBmdW5jdGlvbiAoKSB7CisgICAgICAgICAgICAgICAgICAgIHNjb3BlLnBvc3RUcmFuc2l0aW9uID0gdHJ1ZTsKKyAgICAgICAgICAgICAgICAgICAgaWYgKGluaXRpYWxBbmltU2tpcCkgeworICAgICAgICAgICAgICAgICAgICAgICAgaW5pdGlhbEFuaW1Ta2lwID0gZmFsc2U7CisgICAgICAgICAgICAgICAgICAgICAgICBpZiAoIWlzQ29sbGFwc2VkKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgZml4VXBIZWlnaHQoc2NvcGUsIGVsZW1lbnQsICdhdXRvJyk7CisgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICAgICAgICAgICAgICBkb1RyYW5zaXRpb24oYW5ndWxhci5leHRlbmQoe2hlaWdodDogZWxlbWVudFswXS5zY3JvbGxIZWlnaHQgKyAncHgnfSwgcHJvcHMub3BlbikpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC50aGVuKGZ1bmN0aW9uICgpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vIFRoaXMgY2hlY2sgZW5zdXJlcyB0aGF0IHdlIGRvbid0IGFjY2lkZW50YWxseSB1cGRhdGUgdGhlIGhlaWdodCBpZiB0aGUgdXNlciBoYXMgY2xvc2VkCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyB0aGUgZ3JvdXAgd2hpbGUgdGhlIGFuaW1hdGlvbiB3YXMgc3RpbGwgcnVubmluZworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKCFpc0NvbGxhcHNlZCkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBmaXhVcEhlaWdodChzY29wZSwgZWxlbWVudCwgJ2F1dG8nKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSk7CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgaXNDb2xsYXBzZWQgPSBmYWxzZTsKKyAgICAgICAgICAgICAgICB9OworICAgICAgICAgICAgICAgIHZhciBjb2xsYXBzZSA9IGZ1bmN0aW9uICgpIHsKKyAgICAgICAgICAgICAgICAgICAgaXNDb2xsYXBzZWQgPSB0cnVlOworICAgICAgICAgICAgICAgICAgICBpZiAoaW5pdGlhbEFuaW1Ta2lwKSB7CisgICAgICAgICAgICAgICAgICAgICAgICBpbml0aWFsQW5pbVNraXAgPSBmYWxzZTsKKyAgICAgICAgICAgICAgICAgICAgICAgIGZpeFVwSGVpZ2h0KHNjb3BlLCBlbGVtZW50LCAwKTsKKyAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIGZpeFVwSGVpZ2h0KHNjb3BlLCBlbGVtZW50LCBlbGVtZW50WzBdLnNjcm9sbEhlaWdodCArICdweCcpOworICAgICAgICAgICAgICAgICAgICAgICAgZG9UcmFuc2l0aW9uKGFuZ3VsYXIuZXh0ZW5kKHtoZWlnaHQ6IDB9LCBwcm9wcy5jbG9zZWQpKS50aGVuKGZ1bmN0aW9uICgpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBzY29wZS5wb3N0VHJhbnNpdGlvbiA9IGZhbHNlOworICAgICAgICAgICAgICAgICAgICAgICAgfSk7CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICB9OworICAgICAgICAgICAgICAgIHNjb3BlLiR3YXRjaChhdHRycy5jb2xsYXBzZSwgZnVuY3Rpb24gKHZhbHVlKSB7CisgICAgICAgICAgICAgICAgICAgIGlmICh2YWx1ZSkgeworICAgICAgICAgICAgICAgICAgICAgICAgY29sbGFwc2UoKTsKKyAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIGV4cGFuZCgpOworICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgfSk7CisgICAgICAgICAgICB9CisgICAgICAgIH07CisgICAgfV0pCisgICAgICAgIC5kaXJlY3RpdmUoJ2F0dEFjY29yZCcsIGZ1bmN0aW9uICgpIHsKKyAgICAgICAgICAgIHJldHVybiB7CisgICAgICAgICAgICAgICAgcmVzdHJpY3Q6ICdFQScsCisgICAgICAgICAgICAgICAgdHJhbnNjbHVkZTogdHJ1ZSwKKyAgICAgICAgICAgICAgICByZXBsYWNlOiB0cnVlLAorICAgICAgICAgICAgICAgIHNjb3BlOiB7fSwKKyAgICAgICAgICAgICAgICBjb250cm9sbGVyOiAnQXR0QWNjb3JkQ3RybCcsCisgICAgICAgICAgICAgICAgdGVtcGxhdGVVcmw6ICdhcHAvc2NyaXB0cy9uZ19qc19hdHRfdHBscy9hY2NvcmRpb24vYXR0QWNjb3JkSGVhZGVyLmh0bWwnCisgICAgICAgICAgICB9OworICAgICAgICB9KQorICAgICAgICAuY29udHJvbGxlcignQXR0QWNjb3JkQ3RybCcsIFtmdW5jdGlvbiAoKSB7CisgICAgICAgICAgICAgICAgdGhpcy50eXBlID0gJ2F0dEFjY29yZCc7CisgICAgICAgICAgICAgICAgdGhpcy5oZWFkZXJDdHJsOworICAgICAgICAgICAgICAgIHRoaXMuYm9keUN0cmw7CisgICAgICAgICAgICAgICAgdmFyIGlzT3BlbiA9IHRydWU7CisgICAgICAgICAgICAgICAgdGhpcy50b2dnbGVCb2R5ID0gZnVuY3Rpb24gKCkgeworICAgICAgICAgICAgICAgICAgICBpZiAoaXNPcGVuKSB7CisgICAgICAgICAgICAgICAgICAgICAgICB0aGlzLmV4cGFuZEJvZHkoKTsKKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICBlbHNlIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIHRoaXMuY29sbGFwc2VCb2R5KCk7CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgaXNPcGVuID0gIWlzT3BlbjsKKyAgICAgICAgICAgICAgICB9OworICAgICAgICAgICAgICAgIHRoaXMuZXhwYW5kQm9keSA9IGZ1bmN0aW9uICgpIHsKKyAgICAgICAgICAgICAgICAgICAgdGhpcy5ib2R5Q3RybC5leHBhbmQoKTsKKyAgICAgICAgICAgICAgICB9OworICAgICAgICAgICAgICAgIHRoaXMuY29sbGFwc2VCb2R5ID0gZnVuY3Rpb24gKCkgeworICAgICAgICAgICAgICAgICAgICB0aGlzLmJvZHlDdHJsLmNvbGxhcHNlKCk7CisgICAgICAgICAgICAgICAgfTsKKyAgICAgICAgICAgIH1dKQorICAgICAgICAuY29udHJvbGxlcignQXR0QWNjb3JkSGVhZGVyQ3RybCcsIFtmdW5jdGlvbiAoKSB7CisgICAgICAgICAgICAgICAgdGhpcy50eXBlID0gJ2hlYWRlcic7CisgICAgICAgICAgICB9XSkKKyAgICAgICAgLmRpcmVjdGl2ZSgnYXR0QWNjb3JkSGVhZGVyJywgWydrZXltYXAnLCAnZXZlbnRzJywgZnVuY3Rpb24gKGtleW1hcCwgZXZlbnRzKSB7CisgICAgICAgICAgICByZXR1cm4geworICAgICAgICAgICAgICAgIHJlc3RyaWN0OiAnRUEnLAorICAgICAgICAgICAgICAgIHRyYW5zY2x1ZGU6IHRydWUsCisgICAgICAgICAgICAgICAgcmVwbGFjZTogdHJ1ZSwKKyAgICAgICAgICAgICAgICByZXF1aXJlOiBbJ15hdHRBY2NvcmQnLCAnYXR0QWNjb3JkSGVhZGVyJ10sCisgICAgICAgICAgICAgICAgY29udHJvbGxlcjogJ0F0dEFjY29yZEhlYWRlckN0cmwnLAorICAgICAgICAgICAgICAgIHRlbXBsYXRlVXJsOiAnYXBwL3NjcmlwdHMvbmdfanNfYXR0X3RwbHMvYWNjb3JkaW9uL2F0dEFjY29yZEhlYWRlci5odG1sJywKKyAgICAgICAgICAgICAgICBsaW5rOiBmdW5jdGlvbiAoc2NvcGUsIGVsZW1lbnQsIGF0dHIsIGN0cmxzKSB7CisgICAgICAgICAgICAgICAgICAgIHZhciBhdHRBY2NvcmRDdHJsID0gY3RybHNbMF07CisgICAgICAgICAgICAgICAgICAgIHZhciBhdHRBY2NvcmRIZWFkZXJDdHJsID0gY3RybHNbMV07CisgICAgICAgICAgICAgICAgICAgIGF0dEFjY29yZEN0cmwuaGVhZGVyQ3RybCA9IGF0dEFjY29yZEhlYWRlckN0cmw7CisgICAgICAgICAgICAgICAgICAgIHZhciB0YWIgPSBlbGVtZW50LmNoaWxkcmVuKCkuZXEoMCk7CisgICAgICAgICAgICAgICAgICAgICAgICAKKyAgICAgICAgICAgICAgICAgICAgc2NvcGUuY2xpY2tGdW5jID0gZnVuY3Rpb24gKCkgeworICAgICAgICAgICAgICAgICAgICAgICAgYXR0QWNjb3JkQ3RybC50b2dnbGVCb2R5KCk7CisgICAgICAgICAgICAgICAgICAgIH07CisKKyAgICAgICAgICAgICAgICAgICAgdmFyIGhhbmRsZUtleWRvd24gPSBmdW5jdGlvbiAoZXYpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIHZhciBib29sRmxhZyA9IHRydWU7CisgICAgICAgICAgICAgICAgICAgICAgICBzd2l0Y2ggKGV2LmtleUNvZGUpCisgICAgICAgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgY2FzZSBrZXltYXAuS0VZLkVOVEVSOgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBldi5wcmV2ZW50RGVmYXVsdCgpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzY29wZS5jbGlja0Z1bmMoKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2NvcGUuJGFwcGx5KCk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRlZmF1bHQ6CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJvb2xGbGFnID0gZmFsc2U7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgZXYuc3RvcFByb3BhZ2F0aW9uKCk7CisgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gYm9vbEZsYWc7CisgICAgICAgICAgICAgICAgICAgIH07CisgICAgICAgICAgICAgICAgICAgICAgICAKKyAgICAgICAgICAgICAgICAgICAgaWYgKGFuZ3VsYXIuaXNVbmRlZmluZWQoc2NvcGUuaXNPcGVuKSkgeworICAgICAgICAgICAgICAgICAgICAgICAgc2NvcGUuaXNPcGVuID0gZmFsc2U7CisgICAgICAgICAgICAgICAgICAgIH0KKworICAgICAgICAgICAgICAgICAgICB0YWIuYmluZCgia2V5ZG93biIsIGhhbmRsZUtleWRvd24pOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH07CisgICAgICAgIH1dKQorICAgICAgICAuY29udHJvbGxlcignQXR0QWNjb3JkQm9keUN0cmwnLCBbJyRzY29wZScsIGZ1bmN0aW9uICgkc2NvcGUpIHsKKyAgICAgICAgICAgICAgICB0aGlzLnR5cGUgPSAnYm9keSc7CisgICAgICAgICAgICAgICAgdGhpcy5leHBhbmQgPSBmdW5jdGlvbiAoKSB7CisgICAgICAgICAgICAgICAgICAgICRzY29wZS5leHBhbmQoKTsKKyAgICAgICAgICAgICAgICB9OworICAgICAgICAgICAgICAgIHRoaXMuY29sbGFwc2UgPSBmdW5jdGlvbiAoKSB7CisgICAgICAgICAgICAgICAgICAgICRzY29wZS5jb2xsYXBzZSgpOworICAgICAgICAgICAgICAgIH07CisgICAgICAgICAgICB9XSkKKyAgICAgICAgLmRpcmVjdGl2ZSgnYXR0QWNjb3JkQm9keScsIFsnJHRpbWVvdXQnLCAnJGhlaWdodCcsIGZ1bmN0aW9uICgkdGltZW91dCwgJGhlaWdodCkgeworICAgICAgICAgICAgICAgIHJldHVybiB7CisgICAgICAgICAgICAgICAgICAgIHJlc3RyaWN0OiAnRUEnLAorICAgICAgICAgICAgICAgICAgICB0cmFuc2NsdWRlOiB0cnVlLAorICAgICAgICAgICAgICAgICAgICByZXBsYWNlOiB0cnVlLAorICAgICAgICAgICAgICAgICAgICByZXF1aXJlOiBbJ15hdHRBY2NvcmQnLCAnYXR0QWNjb3JkQm9keSddLAorICAgICAgICAgICAgICAgICAgICBjb250cm9sbGVyOiAnQXR0QWNjb3JkQm9keUN0cmwnLAorICAgICAgICAgICAgICAgICAgICB0ZW1wbGF0ZVVybDogJ2FwcC9zY3JpcHRzL25nX2pzX2F0dF90cGxzL2FjY29yZGlvbi9hdHRBY2NvcmRCb2R5Lmh0bWwnLAorICAgICAgICAgICAgICAgICAgICBsaW5rOiBmdW5jdGlvbiAoc2NvcGUsIGVsZW1lbnQsIGF0dHIsIGN0cmxzKSB7CisgICAgICAgICAgICAgICAgICAgICAgICB2YXIgYXR0QWNjb3JkQ3RybCA9IGN0cmxzWzBdOworICAgICAgICAgICAgICAgICAgICAgICAgdmFyIGF0dEFjY29yZEJvZHlDdHJsID0gY3RybHNbMV07CisgICAgICAgICAgICAgICAgICAgICAgICBhdHRBY2NvcmRDdHJsLmJvZHlDdHJsID0gYXR0QWNjb3JkQm9keUN0cmw7CisgICAgICAgICAgICAgICAgICAgICAgICB2YXIgb3JpZ2luYWxIZWlnaHQ7CisgICAgICAgICAgICAgICAgICAgICAgICAkdGltZW91dChmdW5jdGlvbiAoKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgb3JpZ2luYWxIZWlnaHQgPSBlbGVtZW50WzBdLm9mZnNldEhlaWdodDsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAkaGVpZ2h0KGVsZW1lbnQsIDAsIDAsIDApOworICAgICAgICAgICAgICAgICAgICAgICAgfSk7CisgICAgICAgICAgICAgICAgICAgICAgICBzY29wZS5leHBhbmQgPSBmdW5jdGlvbiAoKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgJGhlaWdodChlbGVtZW50LCAwLjA1LCBvcmlnaW5hbEhlaWdodCwgMSk7CisgICAgICAgICAgICAgICAgICAgICAgICB9OworICAgICAgICAgICAgICAgICAgICAgICAgc2NvcGUuY29sbGFwc2UgPSBmdW5jdGlvbiAoKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgJGhlaWdodChlbGVtZW50LCAwLjI1LCAwLCAwKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIH07CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICB9OworICAgICAgICAgICAgfV0pOworYW5ndWxhci5tb2R1bGUoJ2F0dC5hYnMuYWxlcnQnLCBbXSkKKy5kaXJlY3RpdmUoJ2F0dEFsZXJ0JywgW2Z1bmN0aW9uKCkKK3sKKyAgICByZXR1cm4geworICAgICAgICByZXN0cmljdDonRUEnLAorICAgICAgICByZXBsYWNlIDogdHJ1ZSwKKyAgICAgICAgdHJhbnNjbHVkZSA6IHRydWUsCisgICAgICAgIHNjb3BlOiB7CisgICAgICAgICAgICBhbGVydFR5cGUgOiAiQHR5cGUiLAorICAgICAgICAgICAgc2hvd1RvcCA6ICJAdG9wUG9zIiwKKyAgICAgICAgICAgIHNob3dBbGVydCA6ICI9IgorICAgICAgICB9LAorICAgICAgIHRlbXBsYXRlVXJsIDogJ2FwcC9zY3JpcHRzL25nX2pzX2F0dF90cGxzL2FsZXJ0L2FsZXJ0Lmh0bWwnLAorICAgICAgIGxpbms6IGZ1bmN0aW9uKHNjb3BlKQorICAgICAgICB7CisgICAgICAgICAgICBpZihzY29wZS5zaG93VG9wID09PSAndHJ1ZScpeworICAgICAgICAgICAgICAgIHNjb3BlLmNzc1N0eWxlID0geyd0b3AnOic1MHB4J307CisgICAgICAgICAgICB9CisgICAgICAgICAgICBlbHNleworICAgICAgICAgICAgICAgc2NvcGUuY3NzU3R5bGUgPSB7J3RvcCc6JzBweCd9OworICAgICAgICAgICAgfQorICAgICAgICAgICBzY29wZS5jbG9zZSA9IGZ1bmN0aW9uKCl7CisgICAgICAgICAgICAgICBzY29wZS5zaG93QWxlcnQgPSBmYWxzZTsKKyAgICAgICAgICAgIH07CisgICAgICAgIH0KKyAgICB9OworfV0pOworCithbmd1bGFyLm1vZHVsZSgnYXR0LmFicy5ib2FyZFN0cmlwJywgWydhdHQuYWJzLnV0aWxpdGllcyddKQorLmNvbnN0YW50KCdCb2FyZFN0cmlwQ29uZmlnJywgeworICAgICdtYXhWaXNpYmxlQm9hcmRzJzogNCwKKyAgICAnYm9hcmRzVG9TY3JvbGwnOiAxLAorICAgIC8qIFRoZXNlIHBhcmFtZXRlcnMgYXJlIG5vbi1jb25maWd1cmFibGUgYW5kIHJlbWFpbiB1bmFsdGVyZWQsIHVudGlsIHRoZXJlIGlzIGEgY2hhbmdlIGluIGNvcnJlc3BvbmRpbmcgU0NTUyAqLworICAgICdib2FyZExlbmd0aCc6IDE0MCwKKyAgICAnYm9hcmRNYXJnaW4nOiAxNQorfSkKKy5kaXJlY3RpdmUoJ2F0dEJvYXJkJywgW2Z1bmN0aW9uKCkgeworICAgIHJldHVybiB7CisgICAgICAgIHJlc3RyaWN0OiAnQUUnLAorICAgICAgICByZXBsYWNlOiB0cnVlLAorICAgICAgICB0cmFuc2NsdWRlOiB0cnVlLAorICAgICAgICByZXF1aXJlOiAnXmF0dEJvYXJkU3RyaXAnLAorICAgICAgICBzY29wZSA6IHsKKyAgICAgICAgICAgIGJvYXJkSW5kZXggOiAnPScsCisgICAgICAgICAgICBib2FyZExhYmVsIDogJz0nCisgICAgICAgIH0sCisgICAgICAgIHRlbXBsYXRlVXJsOiAnYXBwL3NjcmlwdHMvbmdfanNfYXR0X3RwbHMvYm9hcmRTdHJpcC9hdHRCb2FyZC5odG1sJywKKyAgICAgICAgbGluazogZnVuY3Rpb24oc2NvcGUsIGVsZW1lbnQsIGF0dHJzLCBjdHJscykgeworCisgICAgICAgICAgICB2YXIgcGFyZW50Q3RybCA9IGN0cmxzOworCisgICAgICAgICAgICBzY29wZS5nZXRDdXJyZW50SW5kZXggPSBmdW5jdGlvbigpIHsKKyAgICAgICAgICAgICAgICByZXR1cm4gcGFyZW50Q3RybC5nZXRDdXJyZW50SW5kZXgoKTsKKyAgICAgICAgICAgIH07CisgICAgICAgICAgICBzY29wZS5zZWxlY3RCb2FyZCA9IGZ1bmN0aW9uKGJvYXJkSW5kZXgpIHsKKyAgICAgICAgICAgICAgICBpZiAoIWlzTmFOKGJvYXJkSW5kZXgpKSB7CisgICAgICAgICAgICAgICAgICAgIHBhcmVudEN0cmwuc2V0Q3VycmVudEluZGV4KGJvYXJkSW5kZXgpOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH07CisgICAgICAgICAgICBzY29wZS5pc0luVmlldyA9IGZ1bmN0aW9uKGJvYXJkSW5kZXgpIHsKKyAgICAgICAgICAgICAgICByZXR1cm4gcGFyZW50Q3RybC5pc0luVmlldyhib2FyZEluZGV4KTsKKyAgICAgICAgICAgIH07CisgICAgICAgIH0KKyAgICB9OworfV0pCisuZGlyZWN0aXZlKCdhdHRCb2FyZFN0cmlwJywgWydCb2FyZFN0cmlwQ29uZmlnJywgJyR0aW1lb3V0JywgJyRpZVZlcnNpb24nLCBmdW5jdGlvbihCb2FyZFN0cmlwQ29uZmlnLCAkdGltZW91dCwgJGllVmVyc2lvbikgeworICAgIHJldHVybiB7CisgICAgICAgIHJlc3RyaWN0OiAnQUUnLAorICAgICAgICByZXBsYWNlOiB0cnVlLAorICAgICAgICB0cmFuc2NsdWRlOiB0cnVlLAorICAgICAgICBzY29wZTogeworICAgICAgICAgICAgY3VycmVudEluZGV4OiAnPXNlbGVjdGVkSW5kZXgnLAorICAgICAgICAgICAgYm9hcmRzTWFzdGVyQXJyYXkgOiAnPScsCisgICAgICAgICAgICBvbkFkZEJvYXJkIDogJyY/JworICAgICAgICB9LAorICAgICAgICB0ZW1wbGF0ZVVybDogJ2FwcC9zY3JpcHRzL25nX2pzX2F0dF90cGxzL2JvYXJkU3RyaXAvYXR0Qm9hcmRTdHJpcC5odG1sJywKKyAgICAgICAgY29udHJvbGxlcjogZnVuY3Rpb24oJHNjb3BlKSB7CisgICAgICAgICAgICBpZighYW5ndWxhci5pc0RlZmluZWQoJHNjb3BlLmJvYXJkc01hc3RlckFycmF5KSl7CisgICAgICAgICAgICAgICAgJHNjb3BlLmJvYXJkc01hc3RlckFycmF5ID0gW107CisgICAgICAgICAgICB9CisKKyAgICAgICAgICAgIHRoaXMucmVjdGlmeU1heFZpc2libGVCb2FyZHMgPSBmdW5jdGlvbigpIHsKKyAgICAgICAgICAgICAgICBpZiAodGhpcy5tYXhWaXNpYmxlSW5kZXggPj0gJHNjb3BlLmJvYXJkc01hc3RlckFycmF5Lmxlbmd0aCkgeworICAgICAgICAgICAgICAgICAgICB0aGlzLm1heFZpc2libGVJbmRleCA9ICRzY29wZS5ib2FyZHNNYXN0ZXJBcnJheS5sZW5ndGggLSAxOworICAgICAgICAgICAgICAgIH0KKworICAgICAgICAgICAgICAgIGlmICh0aGlzLm1heFZpc2libGVJbmRleCA8IDApIHsKKyAgICAgICAgICAgICAgICAgICAgdGhpcy5tYXhWaXNpYmxlSW5kZXggPSAwOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH07CisKKyAgICAgICAgICAgIHRoaXMucmVzZXRCb2FyZFN0cmlwID0gZnVuY3Rpb24oKXsKKyAgICAgICAgICAgICAgICAkc2NvcGUuY3VycmVudEluZGV4ID0gMDsKKworICAgICAgICAgICAgICAgIHRoaXMubWF4VmlzaWJsZUluZGV4ID0gQm9hcmRTdHJpcENvbmZpZy5tYXhWaXNpYmxlQm9hcmRzLTE7CisgICAgICAgICAgICAgICAgdGhpcy5taW5WaXNpYmxlSW5kZXggPSAwOworCisgICAgICAgICAgICAgICAgdGhpcy5yZWN0aWZ5TWF4VmlzaWJsZUJvYXJkcygpOworICAgICAgICAgICAgfTsKKworCisgICAgICAgICAgICBpZiAoJHNjb3BlLmN1cnJlbnRJbmRleCA+IDApIHsKKyAgICAgICAgICAgICAgICB2YXIgaW5kZXggPSAkc2NvcGUuY3VycmVudEluZGV4OworICAgICAgICAgICAgICAgIHRoaXMucmVzZXRCb2FyZFN0cmlwKCk7CisgICAgICAgICAgICAgICAgaWYgKGluZGV4ID4gJHNjb3BlLmJvYXJkc01hc3RlckFycmF5Lmxlbmd0aCkgeworICAgICAgICAgICAgICAgICAgICAkc2NvcGUuY3VycmVudEluZGV4ID0gJHNjb3BlLmJvYXJkc01hc3RlckFycmF5Lmxlbmd0aC0xOworICAgICAgICAgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICAgICAgICAgICRzY29wZS5jdXJyZW50SW5kZXggPSBpbmRleDsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgICAgIHRoaXMucmVzZXRCb2FyZFN0cmlwKCk7CisgICAgICAgICAgICB9CisgICAgICAgICAgICAKKworICAgICAgICAgICAgdGhpcy5nZXRDdXJyZW50SW5kZXggPSBmdW5jdGlvbigpIHsKKyAgICAgICAgICAgICAgICByZXR1cm4gJHNjb3BlLmN1cnJlbnRJbmRleDsKKyAgICAgICAgICAgIH07CisgICAgICAgICAgICB0aGlzLnNldEN1cnJlbnRJbmRleCA9IGZ1bmN0aW9uKGluZHgpIHsKKyAgICAgICAgICAgICAgICAkc2NvcGUuY3VycmVudEluZGV4ID0gaW5keDsKKyAgICAgICAgICAgIH07CisKKyA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ljYWxjdWxhdGVkQWRqdXN0bWVudFZhbHVlID0gKGN0cmwubWluVmlzaWJsZUluZGV4ICogKEJvYXJkU3RyaXBDb25maWcuYm9hcmRMZW5ndGggKyBCb2FyZFN0cmlwQ29uZmlnLmJvYXJkTWFyZ2luKSkqIC0xOworCQkJCX0KKwkJCQkKKwkJCQlyZXR1cm4gY2FsY3VsYXRlZEFkanVzdG1lbnRWYWx1ZTsKKwkJCX07CisKKyAgICAgICAgICAgIHZhciB1cGRhdGVCb2FyZHNUYWJJbmRleCA9IGZ1bmN0aW9uKGJvYXJkQXJyYXksIG1pblZpZXdJbmRleCwgbWF4Vmlld0luZGV4KSB7CisgICAgICAgICAgICAgICAgZm9yICh2YXIgaSA9IDA7IGkgPCBib2FyZEFycmF5Lmxlbmd0aDsgaSsrKSB7CisgICAgICAgICAgICAgICAgICAgIGFuZ3VsYXIuZWxlbWVudChib2FyZEFycmF5W2ldKS5hdHRyKCd0YWJpbmRleCcsICctMScpOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICBmb3IgKHZhciBpID0gbWluVmlld0luZGV4OyBpIDw9IG1heFZpZXdJbmRleDsgaSsrKSB7CisgICAgICAgICAgICAgICAgICAgIGFuZ3VsYXIuZWxlbWVudChib2FyZEFycmF5W2ldKS5hdHRyKCd0YWJpbmRleCcsICcwJyk7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfTsKKwkJCQorICAgICAgICAgICAgc2NvcGUuJHdhdGNoQ29sbGVjdGlvbignYm9hcmRzTWFzdGVyQXJyYXknLCBmdW5jdGlvbihuZXdWYWwsIG9sZFZhbCl7CisgICAgICAgICAgICAgICAgaWYobmV3VmFsICE9PSBvbGRWYWwpeworCQkJCQkvKiBXaGVuIGEgYm9hcmQgaXMgcmVtb3ZlZCAqLworCQkJCQlpZihuZXdWYWwubGVuZ3RoIDwgb2xkVmFsLmxlbmd0aCl7CisJCQkJCQljdHJsLnJlc2V0Qm9hcmRTdHJpcCgpOworCQkJ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YXksIGN0cmwubWluVmlzaWJsZUluZGV4LCBjdHJsLm1heFZpc2libGVJbmRleCk7CisJCQkJCQl9KTsKKwkJCQkJfQorICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0pOworCisgICAgICAgICAgICBzY29wZS5uZXh0Qm9hcmQgPSBmdW5jdGlvbigpIHsKKyAgICAgICAgICAgICAgICBjdHJsLm1heFZpc2libGVJbmRleCArPSBCb2FyZFN0cmlwQ29uZmlnLmJvYXJkc1RvU2Nyb2xsOworICAgICAgICAgICAgICAgIGN0cmwucmVjdGlmeU1heFZpc2libGVCb2FyZHMoKTsKKyAgICAgICAgICAgICAgICBjdHJsLm1pblZpc2libGVJbmRleCA9IGN0cmwubWF4VmlzaWJsZUluZGV4IC0gKEJvYXJkU3RyaXBDb25maWcubWF4VmlzaWJsZUJvYXJkcy0xKTsKKworCQkJCSR0aW1lb3V0LmNhbmNlbChvbGRUaW1lb3V0KTsKKwkJCQlhbmd1bGFyLmVsZW1lbnQoZWxlbWVudFswXS5xdWVyeVNlbGVjdG9yKCIuYm9hcmRzdHJpcC1jb250YWluZXIiKSkuY3NzKHsibGVmdCI6IGNhbGN1bGF0ZUFuZEdldEJvYXJkc3RyaXBDb250YWluZXJBZGp1c3RtZW50KCkgKyAicHgifSk7CisKKyAgICAgICAgICAgICAgICAkdGltZW91dChmdW5jdGlvbigpeworICAgICAgICAgICAgICAgICAgICB2YXIgY3VycmVudEJvYXJkQXJyYXkgPSBlbGVtZW50WzBdLnF1ZXJ5U2VsZWN0b3JBbGwoJ1thdHQtYm9hcmRdJyk7CisKKyAgICAgICAgICAgICAgICAgICAgLyogUmVtb3ZlIHRhYmluZGV4IGZyb20gbm9uLXZpc2libGUgYm9hcmRzICovCisgICAgICAgICAgICAgICAgICAgIHVwZGF0ZUJvYXJkc1RhYkluZGV4KGN1cnJlbnRCb2FyZEFycmF5LCBjdHJsLm1pblZpc2libGVJbmRleCwgY3RybC5tYXhWaXNpYmxlSW5kZXgpOworCisgICAgICAgICAgICAgICAgICAgIGlmICghKHNjb3BlLmlzTmV4dEJvYXJkKCkpKSB7CisgICAgICAgICAgICAgICAgICAgICAgICB0cnkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGN1cnJlbnRCb2FyZEFycmF5W2N1cnJlbnRCb2FyZEFycmF5Lmxlbmd0aC0xXS5mb2N1cygpOworICAgICAgICAgICAgICAgICAgICAgICAgfSBjYXRjaChlKSB7fQorICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgfSwgYW5pbWF0aW9uVGltZW91dCk7CisgICAgICAgICAgICB9OworICAgICAgICAgICAgc2NvcGUucHJldkJvYXJkID0gZnVuY3Rpb24oKSB7CisKKyAgICAgICAgICAgICAgICBjdHJsLm1pblZpc2libGVJbmRleCAtPSBCb2FyZFN0cmlwQ29uZmlnLmJvYXJkc1RvU2Nyb2xsOworICAgICAgICAgICAgICAgIGlmIChjdHJsLm1pblZpc2libGVJbmRleCA8IDApIHsKKyAgICAgICAgICAgICAgICAgICAgY3RybC5taW5WaXNpYmxlSW5kZXggPSAwOworICAgICAgICAgICAgICAgIH0KKworICAgICAgICAgICAgICAgIGN0cmwubWF4VmlzaWJsZUluZGV4ID0gY3RybC5taW5WaXNpYmxlSW5kZXggKyBCb2FyZFN0cmlwQ29uZmlnLm1heFZpc2libGVCb2FyZHMtMTsKKyAgICAgICAgICAgICAgICBjdHJsLnJlY3RpZnlNYXhWaXNpYmxlQm9hcmRzKCk7CisKKwkJCQkkdGltZW91dC5jYW5jZWwob2xkVGltZW91dCk7CisJCQkJYW5ndWxhci5lbGVtZW50KGVsZW1lbnRbMF0ucXVlcnlTZWxlY3RvcigiLmJvYXJkc3RyaXAtY29udGFpbmVyIikpLmNzcyh7ImxlZnQiOiBjYWxjdWxhdGVBbmRHZXRCb2FyZHN0cmlwQ29udGFpbmVyQWRqdXN0bWVudCgpICsgInB4In0pOworCisgICAgICAgICAgICAgICAgJHRpbWVvdXQoZnVuY3Rpb24oKXsKKyAgICAgICAgICAgICAgICAgICAgdmFyIGN1cnJlbnRCb2FyZEFycmF5ID0gZWxlbWVudFswXS5xdWVyeVNlbGVjdG9yQWxsKCdbYXR0LWJvYXJkXScpOworCisgICAgICAgICAgICAgICAgICAgIC8qIFJlbW92ZSB0YWJpbmRleCBmcm9tIG5vbi12aXNpYmxlIGJvYXJkcyAqLworICAgICAgICAgICAgICAgICAgICB1cGRhdGVCb2FyZHNUYWJJbmRleChjdXJyZW50Qm9hcmRBcnJheSwgY3RybC5taW5WaXNpYmxlSW5kZXgsIGN0cmwubWF4VmlzaWJsZUluZGV4KTsKKworICAgICAgICAgICAgICAgICAgICBpZiAoY3RybC5taW5WaXNpYmxlSW5kZXggPT09IDApIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIHRyeSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgZWxlbWVudFswXS5xdWVyeVNlbGVjdG9yKCdkaXYuYm9hcmRzdHJpcC1pdGVtLS1hZGQnKS5mb2N1cygpOworICAgICAgICAgICAgICAgICAgICAgICAgfSBjYXRjaCAoZSkge30gLyogSUU4IG1heSB0aHJvdyBleGNlcHRpb24gKi8KKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIH0pOworICAgICAgICAgICAgfTsKKworICAgICAgICAgICAgc2NvcGUuaXNQcmV2Qm9hcmQgPSBmdW5jdGlvbigpIHsKKyAgICAgICAgICAgICAgICByZXR1cm4gKGN0cmwubWluVmlzaWJsZUluZGV4ID4gMCk7CisgICAgICAgICAgICB9OworICAgICAgICAgICAgc2NvcGUuaXNOZXh0Qm9hcmQgPSBmdW5jdGlvbigpIHsKKyAgICAgICAgICAgICAgICByZXR1cm4gKGN0cmwuZ2V0Qm9hcmRzTWFzdGVyQXJyYXlMZW5ndGgoKS0xID4gY3RybC5tYXhWaXNpYmxlSW5kZXgpOworICAgICAgICAgICAgfTsKKyAgICAgICAgfQorICAgIH07Cit9XSkKKy5kaXJlY3RpdmUoJ2F0dEFkZEJvYXJkJywgWydCb2FyZFN0cmlwQ29uZmlnJywgJyRwYXJzZScsICckdGltZW91dCcsIGZ1bmN0aW9uKEJvYXJkU3RyaXBDb25maWcsICRwYXJzZSwgJHRpbWVvdXQpIHsKKyAgICByZXR1cm4geworICAgICAgICByZXN0cmljdDogJ0FFJywKKyAgICAgICAgcmVwbGFjZTogdHJ1ZSwKKyAgICAgICAgcmVxdWlyZTogJ15hdHRCb2FyZFN0cmlwJywKKyAgICAgICAgc2NvcGUgOiB7CisgICAgICAgICAgICBvbkFkZEJvYXJkIDogJyY/JworICAgICAgICB9LAorICAgICAgICB0ZW1wbGF0ZVVybDogJ2FwcC9zY3JpcHRzL25nX2pzX2F0dF90cGxzL2JvYXJkU3RyaXAvYXR0QWRkQm9hcmQuaHRtbCcsCisgICAgICAgIGxpbms6IGZ1bmN0aW9uKHNjb3BlLCBlbGVtZW50LCBhdHRycywgY3RybHMpIHsKKyAgICAgICAgICAgIHZhciBwYXJlbnRDdHJsID0gY3RybHM7CisgICAgICAgICAgICBzY29wZS5hZGRCb2FyZCA9IGZ1bmN0aW9uKCkgeworICAgICAgICAgICAgICAgIGlmIChhdHRyc1snb25BZGRCb2FyZCddICkgeworICAgICAgICAgICAgICAgICAgICBzY29wZS5vbkFkZEJvYXJkID0gJHBhcnNlKHNjb3BlLm9uQWRkQm9hcmQpOworICAgICAgICAgICAgICAgICAgICBzY29wZS5vbkFkZEJvYXJkKCk7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfTsKKyAgICAgICAgfQorICAgIH07Cit9XSkKKy5kaXJlY3RpdmUoJ2F0dEJvYXJkTmF2aWdhdGlvbicsIFsna2V5bWFwJywgJ2V2ZW50cycsIGZ1bmN0aW9uKGtleW1hcCwgZXZlbnRzKSB7CisgICAgcmV0dXJuIHsKKyAgICAgICAgcmVzdHJpY3Q6ICdBRScsCisgICAgICAgIGxpbms6IGZ1bmN0aW9uKHNjb3BlLCBlbGVtKSB7CisKKyAgICAgICAgICAgIHZhciBwcmV2RWxlbSA9IGtleW1hcC5LRVkuTEVGVDsKKyAgICAgICAgICAgIHZhciBuZXh0RWxlbSA9IGtleW1hcC5LRVkuUklHSFQ7CisKKyAgICAgICAgICAgIGVsZW0uYmluZCgna2V5ZG93bicsIGZ1bmN0aW9uIChldikgeworCisgICAgICAgICAgICAgICAgaWYgKCEoZXYua2V5Q29kZSkpIHsKKyAgICAgICAgICAgICAgICAgICAgZXYua2V5Q29kZSA9IGV2LndoaWNoOworICAgICAgICAgICAgICAgIH0KKworICAgICAgICAgICAgICAgIHN3aXRjaCAoZXYua2V5Q29kZSkgeworICAgICAgICAgICAgICAgIGNhc2UgbmV4dEVsZW06CisgICAgICAgICAgICAgICAgICAgIGV2ZW50cy5wcmV2ZW50RGVmYXVsdChldik7CisgICAgICAgICAgICAgICAgICAgIGV2ZW50cy5zdG9wUHJvcGFnYXRpb24oZXYpOworCisgICAgICAgICAgICAgICAgICAgIGlmIChlbGVtWzBdLm5leHRFbGVtZW50U2libGluZyAmJiBwYXJzZUludChhbmd1bGFyLmVsZW1lbnQoZWxlbVswXS5uZXh0RWxlbWVudFNpYmxpbmcpLmF0dHIoJ3RhYmluZGV4JykpID49IDApIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIGFuZ3VsYXIuZWxlbWVudChlbGVtWzBdKVswXS5uZXh0RWxlbWVudFNpYmxpbmcuZm9jdXMoKTsKKyAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIC8qIElFOCBmaXggKi8KKyAgICAgICAgICAgICAgICAgICAgICAgIHZhciBlbCA9IGFuZ3VsYXIuZWxlbWVudChlbGVtWzBdKVswXTsKKyAgICAgICAgICAgICAgICAgICAgICAgIGRvIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoZWwubmV4dFNpYmxpbmcpeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBlbCA9IGVsLm5leHRTaWJsaW5nOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBlbHNleworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICB9IHdoaWxlIChlbCAmJiBlbC50YWdOYW1lICE9PSAnTEknKTsKKworICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGVsLnRhZ05hbWUgJiYgZWwudGFnTmFtZSA9PT0gJ0xJJyAmJiBwYXJzZUludChhbmd1bGFyLmVsZW1lbnQoZWwpLmF0dHIoJ3RhYmluZGV4JykpID49IDApeworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGVsLmZvY3VzKCk7CisgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgIH0KKworICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICBjYXNlIHByZXZFbGVtOgorICAgICAgICAgICAgICAgICAgICBldmVudHMucHJldmVudERlZmF1bHQoZXYpOworICAgICAgICAgICAgICAgICAgICBldmVudHMuc3RvcFByb3BhZ2F0aW9uKGV2KTsKKworICAgICAgICAgICAgICAgICAgICBpZiAoZWxlbVswXS5wcmV2aW91c0VsZW1lbnRTaWJsaW5nICYmIHBhcnNlSW50KGFuZ3VsYXIuZWxlbWVudChlbGVtWzBdLnByZXZpb3VzRWxlbWVudFNpYmxpbmcpLmF0dHIoJ3RhYmluZGV4JykpID49IDApIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIGFuZ3VsYXIuZWxlbWVudChlbGVtWzBdKVswXS5wcmV2aW91c0VsZW1lbnRTaWJsaW5nLmZvY3VzKCk7CisgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICAgICAgICAgICAgICAvKiBJRTggZml4ICovCisgICAgICAgICAgICAgICAgICAgICAgICB2YXIgZWwxID0gYW5ndWxhci5lbGVtZW50KGVsZW1bMF0pWzBdOworICAgICAgICAgICAgICAgICAgICAgICAgZG8geworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChlbDEucHJldmlvdXNTaWJsaW5nKXsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZWwxID0gZWwxLnByZXZpb3VzU2libGluZzsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgZWxzZXsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgfSB3aGlsZSAoZWwxICYmIGVsMS50YWdOYW1lICE9PSAnTEknKTsKKworICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGVsMS50YWdOYW1lICYmIGVsMS50YWdOYW1lID09PSAnTEknICYmIHBhcnNlSW50KGFuZ3VsYXIuZWxlbWVudChlbCkuYXR0cigndGFiaW5kZXgnKSkgPj0gMCl7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgZWwxLmZvY3VzKCk7CisgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgZGVmYXVsdDoKKyAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfSk7CisgICAgICAgIH0KKyAgICB9OworfV0pOworCithbmd1bGFyLm1vZHVsZSgnYXR0LmFicy5icmVhZENydW1icycsIFtdKQorICAgIC5jb25zdGFudCgiY2xhc3NDb25zdGFudCIseworICAgICAgICAgICAgImRlZmF1bHRDbGFzcyIgOiAiYnJlYWRjcnVtYnNfX2xpbmsiLAorICAgICAgICAgICAgImFjdGl2ZUNsYXNzIjogImJyZWFkY3J1bWJzX19saW5rLS1hY3RpdmUiCisgICAgICAgIH0pCisgICAgLmRpcmVjdGl2ZSgnYXR0Q3J1bWInLCBbJ2NsYXNzQ29uc3RhbnQnLCBmdW5jdGlvbihjbGFzc0NvbnN0YW50KSB7CisgICAgICAgIHJldHVybiB7CisgICAgICAgICAgICByZXN0cmljdDogJ0EnLAorICAgICAgICAgICAgbGluazogZnVuY3Rpb24oc2NvcGUsIGVsZW0sIGF0dHIpIHsKKyAgICAgICAgICAgICAgICBlbGVtLmFkZENsYXNzKGNsYXNzQ29uc3RhbnQuZGVmYXVsdENsYXNzKTsKKyAgICAgICAgICAgICAgICBpZihhdHRyLmF0dENydW1iID09PSAnYWN0aXZlJyl7CisgICAgICAgICAgICAgICAgICAgICBlbGVtLmFkZENsYXNzKGNsYXNzQ29uc3RhbnQuYWN0aXZlQ2xhc3MpOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgIGlmKCFlbGVtLmhhc0NsYXNzKCdsYXN0JykpeworICAgICAgICAgICAgICAgICAgIGVsZW0uYWZ0ZXIoJzxpIGNsYXNzPSJicmVhZGNydW1ic19faXRlbSI+PC9pPicpOworICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfQorICAgICAgICB9OworICAgIH0KK10pOworYW5ndWxhci5tb2R1bGUoJ2F0dC5hYnMuYnV0dG9ucycsIFsnYXR0LmFicy5wb3NpdGlvbicsICdhdHQuYWJzLnV0aWxpdGllcyddKQorICAgICAgICAuY29uc3RhbnQoJ2J0bkNvbmZpZycsIHsKKyAgICAgICAgICAgIGJ0bkNsYXNzOiAnYnV0dG9uJywKKyAgICAgICAgICAgIGJ0blByaW1hcnlDbGFzczogJ2J1dHRvbi0tcHJpbWFyeScsCisgICAgICAgICAgICBidG5TZWNvbmRhcnlDbGFzczogJ2J1dHRvbi0tc2Vjb25kYXJ5JywKKyAgICAgICAgICAgIGJ0bkRpc2FibGVkQ2xhc3M6ICdidXR0b24tLWluYWN0aXZlJywKKyAgICAgICAgICAgIGJ0blNtYWxsQ2xhc3M6ICdidXR0b24tLXNtYWxsJworICAgICAgICB9KQorICAgICAgICAuZGlyZWN0aXZlKCdhdHRCdXR0b24nLCBbJ2J0bkNvbmZpZycsIGZ1bmN0aW9uIChidG5Db25maWcpIHsKKyAgICAgICAgICAgICAgICByZXR1cm4geworICAgICAgICAgICAgICAgICAgICByZXN0cmljdDogJ0EnLAorICAgICAgICAgICAgICAgICAgICBsaW5rOiBmdW5jdGlvbiAoc2NvcGUsIGVsZW1lbnQsIGF0dHJzKSB7CisgICAgICAgICAgICAgICAgICAgICAgICBlbGVtZW50LmFkZENsYXNzKGJ0bkNvbmZpZy5idG5DbGFzcyk7CisgICAgICAgICAgICAgICAgICAgICAgICBpZiAoYXR0cnMuc2l6ZSA9PT0gJ3NtYWxsJykgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGVsZW1lbnQuYWRkQ2xhc3MoYnRuQ29uZmlnLmJ0blNtYWxsQ2xhc3MpOworICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgYXR0cnMuJG9ic2VydmUoJ2J0blR5cGUnLCBmdW5jdGlvbiAodmFsdWUpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAodmFsdWUgPT09ICdwcmltYXJ5JykgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBlbGVtZW50LmFkZENsYXNzKGJ0bkNvbmZpZy5idG5QcmltYXJ5Q2xhc3MpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBlbGVtZW50LnJlbW92ZUNsYXNzKGJ0bkNvbmZpZy5idG5TZWNvbmRhcnlDbGFzcyk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGVsZW1lbnQucmVtb3ZlQ2xhc3MoYnRuQ29uZmlnLmJ0bkRpc2FibGVkQ2xhc3MpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBlbGVtZW50LnJlbW92ZUF0dHIoJ2Rpc2FibGVkJyk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIGlmICh2YWx1ZSA9PT0gJ3NlY29uZGFyeScpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZWxlbWVudC5hZGRDbGFzcyhidG5Db25maWcuYnRuU2Vjb25kYXJ5Q2xhc3MpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBlbGVtZW50LnJlbW92ZUNsYXNzKGJ0bkNvbmZpZy5idG5QcmltYXJ5Q2xhc3MpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBlbGVtZW50LnJlbW92ZUNsYXNzKGJ0bkNvbmZpZy5idG5EaXNhYmxlZENsYXNzKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZWxlbWVudC5yZW1vdmVBdHRyKCdkaXNhYmxlZCcpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAodmFsdWUgPT09ICdkaXNhYmxlZCcpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZWxlbWVudC5hZGRDbGFzcyhidG5Db25maWcuYnRuRGlzYWJsZWRDbGFzcyk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGVsZW1lbnQucmVtb3ZlQ2xhc3MoYnRuQ29uZmlnLmJ0blByaW1hcnlDbGFzcyk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGVsZW1lbnQucmVtb3ZlQ2xhc3MoYnRuQ29uZmlnLmJ0blNlY29uZGFyeUNsYXNzKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZWxlbWVudC5hdHRyKCdkaXNhYmxlZCcsICdkaXNhYmxlZCcpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgIH0pOworICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgfTsKKyAgICAgICAgICAgIH1dKQorICAgICAgICAuZGlyZWN0aXZlKCdhdHRCdXR0b25Mb2FkZXInLCBbZnVuY3Rpb24gKCkgeworICAgICAgICAgICAgICAgIHJldHVybiB7CisgICAgICAgICAgICAgICAgICAgIHJlc3RyaWN0OiAnQScsCisgICAgICAgICAgICAgICAgICAgIHJlcGxhY2U6IGZhbHNlLAorICAgICAgICAgICAgICAgICAgICBzY29wZTogeworICAgICAgICAgICAgICAgICAgICAgICAgc2l6ZTogJ0AnCisgICAgICAgICAgICAgICAgICAgIH0sCisgICAgICAgICAgICAgICAgICAgIHRlbXBsYXRlOiAnPGRpdiBuZy1jbGFzcz0ie1wnYnV0dG9uLS1sb2FkaW5nXCc6IHNpemUgPT09IFwnbGFyZ2VcJyxcJ2J1dHRvbi0tbG9hZGluZ19fc21hbGxcJzogc2l6ZSA9PT0gXCdzbWFsbFwnfSI+PGk+PC9pPjxpIGNsYXNzPSJzZWNvbmRfX2xvYWRlciI+PC9pPjxpPjwvaT48L2Rpdj4nLAorICAgICAgICAgICAgICAgICAgICBsaW5rOiBmdW5jdGlvbiAoc2NvcGUsIGVsZW1lbnQpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIGVsZW1lbnQuYWRkQ2xhc3MoJ2J1dHRvbiBidXR0b24tLWluYWN0aXZlJyk7CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICB9OworICAgICAgICAgICAgfV0pCisgICAgICAgIC5kaXJlY3RpdmUoJ2F0dEJ1dHRvbkhlcm8nLCBbZnVuY3Rpb24gKCkgeworICAgICAgICAgICAgICAgIHJldHVybiB7CisgICAgICAgICAgICAgICAgICAgIHJlc3RyaWN0OiAnQScsCisgICAgICAgICAgICAgICAgICAgIHJlcGxhY2U6IGZhbHNlLAorICAgICAgICAgICAgICAgICAgICB0cmFuc2NsdWRlOiB0cnVlLAorICAgICAgICAgICAgICAgICAgICBzY29wZTogeworICAgICAgICAgICAgICAgICAgICAgICAgaWNvbjogJ0AnCisgICAgICAgICAgICAgICAgICAgIH0sCisgICAgICAgICAgICAgICAgICAgIHRlbXBsYXRlOiAnPGRpdiBjbGFzcz0iYnV0dG9uLS1oZXJvX19pbm5lciI+PHNwYW4gbmctdHJhbnNjbHVkZT48L3NwYW4+IDxpIG5nLWNsYXNzPSJ7XCdpY29uLWFycm93LXJpZ2h0XCc6IGljb24gPT09IFwnYXJyb3ctcmlnaHRcJyxcJ2ljb24tY2FydFwnOiBpY29uID09PSBcJ2NhcnRcJ30iPjwvaT48L2Rpdj4nLAorICAgICAgICAgICAgICAgICAgICBsaW5rOiBmdW5jdGlvbiAoc2NvcGUsIGVsZW1lbnQpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIGVsZW1lbnQuYWRkQ2xhc3MoJ2J1dHRvbiBidXR0b24tLWhlcm8nKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIGVsZW1lbnQuYXR0cigidGFiaW5kZXgiLCAiMCIpOworICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgfTsKKyAgICAgICAgICAgIH1dKQorICAgICAgICAuZGlyZWN0aXZlKCdhdHRCdG5Ecm9wZG93bicsIFsnJGRvY3VtZW50JywgJyR0aW1lb3V0JywgJyRpc0VsZW1lbnQnLCAnJGRvY3VtZW50QmluZCcsICdrZXltYXAnLCAnZXZlbnRzJywgZnVuY3Rpb24gKCRkb2N1bWVudCwgJHRpbWVvdXQsICRpc0VsZW1lbnQsICRkb2N1bWVudEJpbmQsIGtleW1hcCwgZXZlbnRzKSB7CisgICAgICAgICAgICAgICAgcmV0dXJuIHsKKyAgICAgICAgICAgICAgICAgICAgcmVzdHJpY3Q6ICdFQScsCisgICAgICAgICAgICAgICAgICAgIHNjb3BlOiB7CisgICAgICAgICAgICAgICAgICAgICAgICB0eXBlOiAiQGRyb3Bkb3dudHlwZSIKKyAgICAgICAgICAgICAgICAgICAgfSwKKyAgICAgICAgICAgICAgICAgICAgcmVwbGFjZTogdHJ1ZSwKKyAgICAgICAgICAgICAgICAgICAgdHJhbnNjbHVkZTogdHJ1ZSwKKyAgICAgICAgICAgICAgICAgICAgdGVtcGxhdGVVcmw6ICdhcHAvc2NyaXB0cy9uZ19qc19hdHRfdHBscy9idXR0b25zL2J1dHRvbkRyb3Bkb3duLmh0bWwnLAorICAgICAgICAgICAgICAgICAgICBsaW5rOiBmdW5jdGlvbiAoc2NvcGUsIGVsZW1lbnQpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIHNjb3BlLmlzT3BlbiA9IGZhbHNlOworICAgICAgICAgICAgICAgICAgICAgICAgdmFyIGN1cnJlbnRJbmRleCA9IC0xOworICAgICAgICAgICAgICAgICAgICAgICAgLy8gQ2FwdHVyZSBhbGwgdGhlIGxpIGVsZW1lbnRzIGFmdGVyIGNvbXBpbGF0aW9uCisgICAgICAgICAgICAgICAgICAgICAgICB2YXIgbGlzdCA9IFtdLCBidXR0b24gPSB1bmRlZmluZWQ7CisgICAgICAgICAgICAgICAgICAgICAgICAkdGltZW91dChmdW5jdGlvbigpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBsaXN0ID0gZWxlbWVudC5maW5kKCdsaScpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJ1dHRvbiA9IGVsZW1lbnQuZmluZCgnYnV0dG9uJylbMF07CisgICAgICAgICAgICAgICAgICAgICAgICB9LCAxMCk7CisgICAgICAgICAgICAgICAgICAgICAgICB2YXIgdG9nZ2xlID0gc2NvcGUudG9nZ2xlID0gZnVuY3Rpb24gKHNob3cpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoYW5ndWxhci5pc1VuZGVmaW5lZChzaG93KSB8fCBzaG93ID09PSAnJykgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzY29wZS5pc09wZW4gPSAhc2NvcGUuaXNPcGVuOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBlbHNlIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2NvcGUuaXNPcGVuID0gc2hvdzsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICB9OworICAgICAgICAgICAgICAgICAgICAgICAgdmFyIHNlbGVjdE5leHQgPSBmdW5jdGlvbigpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoY3VycmVudEluZGV4KzEgPCBsaXN0Lmxlbmd0aCkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjdXJyZW50SW5kZXgrKzsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbGlzdFtjdXJyZW50SW5kZXhdLmZvY3VzKCk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgfTsKKyAgICAgICAgICAgICAgICAgICAgICAgIHZhciBzZWxlY3RQcmV2ID0gZnVuY3Rpb24oKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGN1cnJlbnRJbmRleC0xID49IDApIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY3VycmVudEluZGV4LS07CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxpc3RbY3VycmVudEluZGV4XS5mb2N1cygpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgIH07CisgICAgICAgICAgICAgICAgICAgICAgICBlbGVtZW50LmJpbmQoImtleWRvd24iLCBmdW5jdGlvbigkZXZlbnQpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YXIga2V5Q29kZSA9ICRldmVudC5rZXlDb2RlOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChrZXltYXAuaXNBbGxvd2VkS2V5KGtleUNvZGUpIHx8IGtleW1hcC5pc0NvbnRyb2woJGV2ZW50KSB8fCBrZXltYXAuaXNGdW5jdGlvbktleSgkZXZlbnQpKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHN3aXRjaCAoa2V5Q29kZSkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY2FzZSBrZXltYXAuS0VZLkVOVEVSOgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChjdXJyZW50SW5kZXggPiAwKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJ1dHRvbi5mb2N1cygpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzY29wZS4kYXBwbHkoKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjYXNlIGtleW1hcC5LRVkuRVNDOgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRvZ2dsZShmYWxzZSk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY3VycmVudEluZGV4ID0gLTE7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnV0dG9uLmZvY3VzKCk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2NvcGUuJGFwcGx5KCk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjYXNlIGtleW1hcC5LRVkuRE9XTjoKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzZWxlY3ROZXh0KCk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2NvcGUuJGFwcGx5KCk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZXZlbnRzLnByZXZlbnREZWZhdWx0KCRldmVudCk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZXZlbnRzLnN0b3BQcm9wYWdhdGlvbigkZXZlbnQpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY2FzZSBrZXltYXAuS0VZLlVQOgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNlbGVjdFByZXYoKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzY29wZS4kYXBwbHkoKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBldmVudHMucHJldmVudERlZmF1bHQoJGV2ZW50KTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBldmVudHMuc3RvcFByb3BhZ2F0aW9uKCRldmVudCk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBkZWZhdWx0OgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIGlmIChrZXlDb2RlID09PSBrZXltYXAuS0VZLlRBQikgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0b2dnbGUoZmFsc2UpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjdXJyZW50SW5kZXggPSAtMTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2NvcGUuJGFwcGx5KCk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgfSk7CisgICAgICAgICAgICAgICAgICAgICAgICB2YXIgb3V0c2lkZUNsaWNrID0gZnVuY3Rpb24gKGUpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YXIgaXNFbGVtZW50ID0gJGlzRWxlbWVudChhbmd1bGFyLmVsZW1lbnQoZS50YXJnZXQpLCBlbGVtZW50LCAkZG9jdW1lbnQpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICghaXNFbGVtZW50KSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRvZ2dsZShmYWxzZSk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGN1cnJlbnRJbmRleCA9IC0xOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBmb3IgKHZhciBpID0gMDsgaSA8IGxpc3QubGVuZ3RoOyBpKyspIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGFuZ3VsYXIuZWxlbWVudChsaXN0W2ldKS5yZW1vdmVDbGFzcygnc2VsZWN0ZWQnKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBidXR0b24uZm9jdXMoKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2NvcGUuJGFwcGx5KCk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgfTsKKyAgICAgICAgICAgICAgICAgICAgICAgICRkb2N1bWVudEJpbmQuY2xpY2soJ2lzT3BlbicsIG91dHNpZGVDbGljaywgc2NvcGUpOworICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgfTsKKyAgICAgICAgICAgIH1dKTsKK2FuZ3VsYXIubW9kdWxlKCdhdHQuYWJzLmNoZWNrYm94JywgW10pCisuY29uc3RhbnQoImF0dENoZWNrYm94Q29uZmlnIiwgeworICAgIGFjdGl2ZUNsYXNzIDogImF0dC1jaGVja2JveC0tb24iLAorICAgIGRpc2FibGVkQ2xhc3MgOiAiYXR0LWNoZWNrYm94LS1kaXNhYmxlZCIKK30pCisuZGlyZWN0aXZlKCdjaGVja2JveExpbWl0JywgZnVuY3Rpb24gKCkgeworcmV0dXJuIHsKKyAgICBzY29wZTogeworICAgICAgICBjaGVja2JveExpbWl0Oic9JywKKyAgICAgICAgc2VsZWN0TGltaXQ6J0A/JywKKyAgICAgICAgbWF4U2VsZWN0ZWQ6JyY/JworICAgIH0sCisgICAgcmVzdHJpY3Q6ICdBJywKKyAgICByZXF1aXJlOidjaGVja2JveExpbWl0JywKKyAgICBjb250cm9sbGVyOiBbJyRzY29wZScsZnVuY3Rpb24oJHNjb3BlKQorICAgIHsKKyAgICAgICAgJHNjb3BlLmxpbWl0PXRydWU7CisgICAgICAgIHRoaXMuZ2V0TWF4TGltaXRzPWZ1bmN0aW9uKCl7CisgICAgICAgICAgICByZXR1cm4gJHNjb3BlLmxpbWl0OworICAgICAgICB9OworICAgICAgICB0aGlzLnNldE1heExpbWl0cz1mdW5jdGlvbih2YWx1ZSl7CisgICAgICAgICAgICAkc2NvcGUubGltaXQ9dmFsdWU7CisgICAgICAgIH07CisgICAgICAgIHRoaXMubWF4Q2hlY2tib3hTZWxlY3RlZD1mdW5jdGlvbigpeworICAgICAgICAgICAgJHNjb3BlLm1heFNlbGVjdGVkKCk7CisgICAgICAgIH07CisgICAgfV0sCisgICAgbGluazogZnVuY3Rpb24gKHNjb3BlLCBlbGVtZW50LCBhdHRyaWJ1dGUsIGN0cmwpIHsKKyAgICAgICAgc2NvcGUuJHdhdGNoKCdjaGVja2JveExpbWl0JywgZnVuY3Rpb24oKQorICAgICAgICB7CisgICAgICAgICAgICB2YXIgY291bnRUcnVlID0gMDsKKyAgICAgICAgICAgIGZvciAodmFyIGtleXMgaW4gc2NvcGUuY2hlY2tib3hMaW1pdCkgeworICAgICAgICAgICAgICAgIGlmIChzY29wZS5jaGVja2JveExpbWl0Lmhhc093blByb3BlcnR5KGtleXMpICYmIHNjb3BlLmNoZWNrYm94TGltaXRba2V5c10pIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIGNvdW50VHJ1ZSA9IGNvdW50VHJ1ZSArIDE7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfTsKKyAgICAgICAgICAgIGlmKGNvdW50VHJ1ZT49cGFyc2VJbnQoc2NvcGUuc2VsZWN0TGltaXQpKXsKKyAgICAgICAgICAgICAgICBjdHJsLnNldE1heExpbWl0cyhmYWxzZSk7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBlbHNleworICAgICAgICAgICAgICAgIGN0cmwuc2V0TWF4TGltaXRzKHRydWUpOworICAgICAgICAgICAgfQorICAgICAgICAgICAgfSwgdHJ1ZSk7CisgICAgfQorfTsKK30pCisuZGlyZWN0aXZlKCdhdHRDaGVja2JveCcsIFsnJGNvbXBpbGUnLCAiYXR0Q2hlY2tib3hDb25maWciLCBmdW5jdGlvbiAoJGNvbXBpbGUsIGF0dENoZWNrYm94Q29uZmlnKSB7CisgICAgcmV0dXJuIHsKKyAgICAgICAgc2NvcGU6IHt9LAorICAgICAgICByZXN0cmljdDogJ0EnLAorICAgICAgICByZXF1aXJlOiBbJ25nTW9kZWwnLCdeP2NoZWNrYm94TGltaXQnXSwKKyAgICAgICAgbGluazogZnVuY3Rpb24gKHNjb3BlLCBlbGVtZW50LCBhdHRyaWJ1dGUsIGN0cmwpIHsKKyAgICAgICAgICAgIHZhciBuZ0N0cmwgPSBjdHJsWzBdOworICAgICAgICAgICAgdmFyIGNoZWNrYm94TGltaXRDdHJsID0gY3RybFsxXTsKKyAgICAgICAgICAgIHZhciBwYXJlbnREaXYgPSAkY29tcGlsZSgnPGRpdiB0YWJpbmRleD0iMCIgcm9sZT0iY2hlY2tib3giIGF0dC1hY2Nlc3NpYmlsaXR5LWNsaWNrPSIxMywzMiIgYXJpYS1sYWJlbD0iQ2hlY2tib3giIG5nLWNsaWNrPSJ1cGRhdGVNb2RlbCgkZXZlbnQpIiBjbGFzcz0iYXR0LWNoZWNrYm94Ij48L2Rpdj4nKShzY29wZSk7CisgICAgICAgICAgICBlbGVtZW50LmNzcyh7ZGlzcGxheTonbm9uZSd9KTsKKyAgICAgICAgICAgIGVsZW1lbnQud3JhcChwYXJlbnREaXYpOworICAgICAgICAgICAgZWxlbWVudC5wYXJlbnQoKS5hcHBlbmQoJzxkaXYgY2xhc3M9ImF0dC1jaGVja2JveF9faW5kaWNhdG9yIj48L2Rpdj4nKTsKKyAgICAgICAgICAgIGVsZW1lbnQucGFyZW50KCkuYXR0cigidGl0bGUiLCBhdHRyaWJ1dGUudGl0bGUpOworICAgICAgICAgICAgZWxlbWVudC5wYXJlbnQoKS5hdHRyKCJhcmlhLWxhYmVsIiwgYXR0cmlidXRlLnRpdGxlKTsKKyAgICAgICAgICAgIGVsZW1lbnQucGFyZW50KCkuYXR0cigiaWQiLCBhdHRyaWJ1dGUuaWQpOworICAgICAgICAgICAgZWxlbWVudC5yZW1vdmVBdHRyKCJpZCIpOworICAgICAgICAgICAgLy9lbGVtZW50LnJlbW92ZUF0dHIoInRpdGxlIik7CisgICAgICAgICAgICAvL21vZGVsIC0+IFVJCisgICAgICAgICAgICBuZ0N0cmwuJHJlbmRlciA9IGZ1bmN0aW9uICgpIHsKKyAgICAgICAgICAgICAgICB2YXIgc2VsZWN0ZWQgPSBuZ0N0cmwuJG1vZGVsVmFsdWUgPyB0cnVlIDogZmFsc2U7CisgICAgICAgICAgICAgICAgZWxlbWVudC5wYXJlbnQoKS50b2dnbGVDbGFzcyhhdHRDaGVja2JveENvbmZpZy5hY3RpdmVDbGFzcywgc2VsZWN0ZWQpOworICAgICAgICAgICAgICAgIGVsZW1lbnQucGFyZW50KCkuYXR0cigiYXJpYS1jaGVja2VkIiwgc2VsZWN0ZWQpOworICAgICAgICAgICAgfTsKKworICAgICAgICAgICAgLy91aS0+bW9kZWwKKyAgICAgICAgICAgIHNjb3BlLnVwZGF0ZU1vZGVsID0gZnVuY3Rpb24gKGV2dCkgeworICAgICAgICAgICAgICAgIGlmICghc2NvcGUuZGlzYWJsZWQpIHsKKyAgICAgICAgICAgICAgICAgICAgbmdDdHJsLiRzZXRWaWV3VmFsdWUoZWxlbWVudC5wYXJlbnQoKS5oYXNDbGFzcyhhdHRDaGVja2JveENvbmZpZy5hY3RpdmVDbGFzcykgPyBmYWxzZSA6IHRydWUpOworICAgICAgICAgICAgICAgICAgICBpZihjaGVja2JveExpbWl0Q3RybCAmJiAhKGNoZWNrYm94TGltaXRDdHJsLmdldE1heExpbWl0cygpKSl7CisgICAgICAgICAgICAgICAgICAgICAgICBpZighbmdDdHJsLiRtb2RlbFZhbHVlKXsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBuZ0N0cmwuJHJlbmRlcigpOworICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgZWxzZXsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBjaGVja2JveExpbWl0Q3RybC5tYXhDaGVja2JveFNlbGVjdGVkKCk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgbmdDdHJsLiRzZXRWaWV3VmFsdWUoZWxlbWVudC5wYXJlbnQoKS5oYXNDbGFzcyhhdHRDaGVja2JveENvbmZpZy5hY3RpdmVDbGFzcykgPyB0cnVlIDogZmFsc2UpOworICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgIGVsc2V7CisgICAgICAgICAgICAgICAgICAgICAgICBuZ0N0cmwuJHJlbmRlcigpOworICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIGV2dC5wcmV2ZW50RGVmYXVsdCgpOworICAgICAgICAgICAgfTsKKworICAgICAgICAgICAgYXR0cmlidXRlLiRvYnNlcnZlKCdkaXNhYmxlZCcsIGZ1bmN0aW9uKHZhbCkgeworICAgICAgICAgICAgICAgIHNjb3BlLmRpc2FibGVkID0gKHZhbCB8fCB2YWwgPT09ICJkaXNhYmxlZCIgfHwgdmFsID09PSAidHJ1ZSIpOworICAgICAgICAgICAgICAgIGVsZW1lbnQucGFyZW50KCkudG9nZ2xlQ2xhc3MoYXR0Q2hlY2tib3hDb25maWcuZGlzYWJsZWRDbGFzcywgc2NvcGUuZGlzYWJsZWQpOworICAgICAgICAgICAgICAgIGVsZW1lbnQucGFyZW50KCkuYXR0cigidGFiaW5kZXgiLCBzY29wZS5kaXNhYmxlZCA/ICItMSIgOiAiMCIpOworICAgICAgICAgICAgfSk7CisgICAgICAgIH0KKyAgICB9OworfV0pCisuZGlyZWN0aXZlKCdjaGVja2JveEdyb3VwJywgWyckY29tcGlsZScsZnVuY3Rpb24oJGNvbXBpbGUpIHsKKyAgICByZXR1cm4geworICAgICAgICBzY29wZTp7CisgICAgICAgICAgICBjaGVja2JveEdyb3VwOiAiPSIsCisgICAgICAgICAgICBjaGVja2JveEdyb3VwVmFsdWU6ICI9PyIKKyAgICAgICAgfSwKKyAgICAgICAgcmVzdHJpY3Q6ICdBJywKKyAgICAgICAgbGluazogZnVuY3Rpb24oc2NvcGUsIGVsZW1lbnQsIGF0dHJpYnV0ZSl7CisgICAgICAgICAgICAgICAgc2NvcGUuY2hlY2tib3hTdGF0ZSA9ICdub25lJzsKKyAgICAgICAgICAgICAgICBpZiAoc2NvcGUuY2hlY2tib3hHcm91cFZhbHVlID09PSB1bmRlZmluZWQpIHsKKyAgICAgICAgICAgICAgICAgICAgc2NvcGUuY2hlY2tib3hHcm91cFZhbHVlID0gImluZGV0ZXJtaW5hdGUiOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICBlbGVtZW50LmNzcyh7ZGlzcGxheTonbm9uZSd9KTsKKyAgICAgICAgICAgICAgICBlbGVtZW50LndyYXAoJGNvbXBpbGUoJzxkaXYgdGFiaW5kZXg9IjAiIHJvbGU9ImNoZWNrYm94IiBhdHQtYWNjZXNzaWJpbGl0eS1jbGljaz0iMTMsMzIiIG5nLWNsaWNrPSJ1cGRhdGVNb2RlbCgkZXZlbnQpIiBjbGFzcz0iYXR0LWNoZWNrYm94Ij48L2Rpdj4nKShzY29wZSkpOworICAgICAgICAgICAgICAgIGVsZW1lbnQucGFyZW50KCkuYXBwZW5kKCc8ZGl2IGNsYXNzPSJhdHQtY2hlY2tib3hfX2luZGljYXRvciI+PC9kaXY+Jyk7CisgICAgICAgICAgICAgICAgZWxlbWVudC5wYXJlbnQoKS5hdHRyKCJ0aXRsZSIsIGF0dHJpYnV0ZS50aXRsZSk7CisgICAgICAgICAgICAgICAgZWxlbWVudC5wYXJlbnQoKS5hdHRyKCJhcmlhLWxhYmVsIiwgYXR0cmlidXRlLnRpdGxlKTsKKyAgICAgICAgICAgICAgICBzY29wZS4kd2F0Y2goJ2NoZWNrYm94U3RhdGUnLCBmdW5jdGlvbih2YWwpIHsKKyAgICAgICAgICAgICAgICAgICAgaWYgKHZhbCA9PT0gJ2FsbCcpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIGVsZW1lbnQucGFyZW50KCkuYWRkQ2xhc3MoJ2F0dC1jaGVja2JveC0tb24nKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIGVsZW1lbnQucGFyZW50KCkucmVtb3ZlQ2xhc3MoJ2F0dC1jaGVja2JveC0taW5kZXRlcm1pbmF0ZScpOworICAgICAgICAgICAgICAgICAgICAgICAgZWxlbWVudC5wYXJlbnQoKS5hdHRyKCJhcmlhLWNoZWNrZWQiLCB0cnVlKTsKKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICBlbHNlIGlmICh2YWwgPT09ICdub25lJykgeworICAgICAgICAgICAgICAgICAgICAgICAgZWxlbWVudC5wYXJlbnQoKS5yZW1vdmVDbGFzcygnYXR0LWNoZWNrYm94LS1vbicpOworICAgICAgICAgICAgICAgICAgICAgICAgZWxlbWVudC5wYXJlbnQoKS5yZW1vdmVDbGFzcygnYXR0LWNoZWNrYm94LS1pbmRldGVybWluYXRlJyk7CisgICAgICAgICAgICAgICAgICAgICAgICBlbGVtZW50LnBhcmVudCgpLmF0dHIoImFyaWEtY2hlY2tlZCIsIGZhbHNlKTsKKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICBlbHNlIGlmICh2YWwgPT09ICdpbmRldGVybWluYXRlJykgeworICAgICAgICAgICAgICAgICAgICAgICAgZWxlbWVudC5wYXJlbnQoKS5yZW1vdmVDbGFzcygnYXR0LWNoZWNrYm94LS1vbicpOworICAgICAgICAgICAgICAgICAgICAgICAgZWxlbWVudC5wYXJlbnQoKS5hZGRDbGFzcygnYXR0LWNoZWNrYm94LS1pbmRldGVybWluYXRlJyk7CisgICAgICAgICAgICAgICAgICAgICAgICBlbGVtZW50LnBhcmVudCgpLmF0dHIoImFyaWEtY2hlY2tlZCIsIHRydWUpOworICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgfSk7CisgICAgICAgICAgICAgICAgc2NvcGUudXBkYXRlTW9kZWwgPSBmdW5jdGlvbihldnQpeworICAgICAgICAgICAgICAgICAgICBpZiAoZWxlbWVudC5wYXJlbnQoKS5oYXNDbGFzcygnYXR0LWNoZWNrYm94LS1vbicpKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgZWxlbWVudC5wYXJlbnQoKS5yZW1vdmVDbGFzcygnYXR0LWNoZWNrYm94LS1vbicpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZvciAodmFyIGtleXMgaW4gc2NvcGUuY2hlY2tib3hHcm91cCkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoc2NvcGUuY2hlY2tib3hHcm91cC5oYXNPd25Qcm9wZXJ0eShrZXlzKSkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2NvcGUuY2hlY2tib3hHcm91cFtrZXlzXSA9IGZhbHNlOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgfTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgIGVsc2UgeworICAgICAgICAgICAgICAgICAgICAgICAgZWxlbWVudC5wYXJlbnQoKS5hZGRDbGFzcygnYXR0LWNoZWNrYm94LS1vbicpOworICAgICAgICAgICAgICAgICAgICAgICAgZm9yICh2YXIga2V5IGluIHNjb3BlLmNoZWNrYm94R3JvdXApIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoc2NvcGUuY2hlY2tib3hHcm91cC5oYXNPd25Qcm9wZXJ0eShrZXkpKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNjb3BlLmNoZWNrYm94R3JvdXBba2V5XSA9IHRydWU7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgfTsKKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICBldnQucHJldmVudERlZmF1bHQoKTsKKyAgICAgICAgICAgICAgICB9OworICAgICAgICAgICAgICAgIHNjb3BlLiR3YXRjaCgnY2hlY2tib3hHcm91cFZhbHVlJywgZnVuY3Rpb24gKHZhbHVlKSB7CisgICAgICAgICAgICAgICAgICAgIGlmICh2YWx1ZT09PWZhbHNlKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgZWxlbWVudC5wYXJlbnQoKS5yZW1vdmVDbGFzcygnYXR0LWNoZWNrYm94LS1vbicpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZvciAodmFyIGtleXMgaW4gc2NvcGUuY2hlY2tib3hHcm91cCkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoc2NvcGUuY2hlY2tib3hHcm91cC5oYXNPd25Qcm9wZXJ0eShrZXlzKSkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNjb3BlLmNoZWNrYm94R3JvdXBba2V5c10gPSBmYWxzZTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgICAgIH07CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICBlbHNlIGlmICh2YWx1ZSA9PT0gdHJ1ZSl7CisgICAgICAgICAgICAgICAgICAgICAgICBlbGVtZW50LnBhcmVudCgpLmFkZENsYXNzKCdhdHQtY2hlY2tib3gtLW9uJyk7CisgICAgICAgICAgICAgICAgICAgICAgICBmb3IgKHZhciBrZXkgaW4gc2NvcGUuY2hlY2tib3hHcm91cCkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChzY29wZS5jaGVja2JveEdyb3VwLmhhc093blByb3BlcnR5KGtleSkpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNjb3BlLmNoZWNrYm94R3JvdXBba2V5XSA9IHRydWU7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgfTsKKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIH0pOworICAgICAgICAgICAgc2NvcGUuJHdhdGNoKCdjaGVja2JveEdyb3VwJywgZnVuY3Rpb24oKXsKKyAgICAgICAgICAgICAgICB2YXIgY291bnRUcnVlID0gMDsKKyAgICAgICAgICAgICAgICB2YXIgY291bnRGYWxzZSA9IDA7CisgICAgICAgICAgICAgICAgdmFyIGNvdW50ID0gMDsKKyAgICAgICAgICAgICAgICBmb3IgKHZhciBrZXlzIGluIHNjb3BlLmNoZWNrYm94R3JvdXApIHsKKyAgICAgICAgICAgICAgICAgICAgaWYgKHNjb3BlLmNoZWNrYm94R3JvdXAuaGFzT3duUHJvcGVydHkoa2V5cykpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIGNvdW50ID0gY291bnQgKyAxOworICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHNjb3BlLmNoZWNrYm94R3JvdXBba2V5c10pIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb3VudFRydWUgPSBjb3VudFRydWUgKyAxOworICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgZWxzZSBpZiAoIXNjb3BlLmNoZWNrYm94R3JvdXBba2V5c10pIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb3VudEZhbHNlID0gY291bnRGYWxzZSArIDE7CisgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICB9OworICAgICAgICAgICAgICAgIGlmIChjb3VudCA9PT0gY291bnRUcnVlKSB7CisgICAgICAgICAgICAgICAgICAgIHNjb3BlLmNoZWNrYm94U3RhdGUgPSAiYWxsIjsKKyAgICAgICAgICAgICAgICAgICAgIHNjb3BlLmNoZWNrYm94R3JvdXBWYWx1ZT10cnVlOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICBlbHNlIGlmIChjb3VudCA9PT0gY291bnRGYWxzZSkgeworICAgICAgICAgICAgICAgICAgICBzY29wZS5jaGVja2JveFN0YXRlID0gIm5vbmUiOworICAgICAgICAgICAgICAgICAgICBzY29wZS5jaGVja2JveEdyb3VwVmFsdWU9ZmFsc2U7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIGVsc2UgeworICAgICAgICAgICAgICAgICAgICBzY29wZS5jaGVja2JveFN0YXRlID0gImluZGV0ZXJtaW5hdGUiOworICAgICAgICAgICAgICAgICAgICBzY29wZS5jaGVja2JveEdyb3VwVmFsdWU9ImluZGV0ZXJtaW5hdGUiOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICB9LCB0cnVlKTsKKyAgICAgICAgfQorICAgIH07Cit9XSk7CisKK2FuZ3VsYXIubW9kdWxlKCdhdHQuYWJzLmNvbG9yc2VsZWN0b3InLCBbXSkKKyAgICAuZGlyZWN0aXZlKCdjb2xvclNlbGVjdG9yV3JhcHBlcicsIFtmdW5jdGlvbigpIHsKKyAgICAgICAgcmV0dXJuIHsKKyAgICAgICAgICAgIHNjb3BlOiB7CisgICAgICAgICAgICAgICAgc2VsZWN0ZWQ6ICc9JywKKyAgICAgICAgICAgICAgICBpY29uQ29sb3I6ICdAJworICAgICAgICAgICAgICAgIAorICAgICAgICAgICAgfSwKKyAgICAgICAgICAgIHJlc3RyaWN0OiAnQUUnLAorICAgICAgICAgICAgdHJhbnNjbHVkZTogdHJ1ZSwKKyAgICAgICAgICAgIHRlbXBsYXRlVXJsOiAnYXBwL3NjcmlwdHMvbmdfanNfYXR0X3RwbHMvY29sb3JzZWxlY3Rvci9jb2xvcnNlbGVjdG9yLmh0bWwnLAorICAgICAgICAgICAgbGluazogZnVuY3Rpb24oc2NvcGUpIHsKKyAgICAgICAgICAgICAgICBzY29wZS5hcHBseWNvbG9yID0geydiYWNrZ3JvdW5kLWNvbG9yJzogc2NvcGUuaWNvbkNvbG9yfTsKKyAgICAgICAgICAgICAgICBzY29wZS5zZWxlY3RlZGNvbG9yID0gZnVuY3Rpb24oaWNvbkNvbG9yKSB7CisgICAgICAgICAgICAgICAgICAgIHNjb3BlLnNlbGVjdGVkID0gaWNvbkNvbG9yOworICAgICAgICAgICAgICAgIH07CisgICAgICAgICAgICB9CisgICAgICAgIH07CisgICAgIH1dKQorICAgIC5kaXJlY3RpdmUoJ2NvbG9yU2VsZWN0b3InLCBbJyRjb21waWxlJywgZnVuY3Rpb24oJGNvbXBpbGUpIHsKKyAgICAgICAgcmV0dXJueworICAgICAgICAgICAgcmVzdHJpY3Q6ICdBJywKKyAgICAgICAgICAgIHNjb3BlOiB7CisgICAgICAgICAgICAgICAgY29sb3JTZWxlY3RvcjogJ0AnLCAgICAgICAgICAgICAgICAKKyAgICAgICAgICAgICAgICBuZ01vZGVsOiAnPScKKyAgICAgICAgICAgIH0sCisgICAgICAgICAgICBsaW5rOiBmdW5jdGlvbihzY29wZSwgZWxlbWVudCwgYXR0cikgeworICAgICAgICAgICAgICAgIGVsZW1lbnQucmVtb3ZlQXR0cignY29sb3Itc2VsZWN0b3InKTsKKyAgICAgICAgICAgICAgICB2YXIgY29sb3JUaXRsZSA9IGF0dHIudGl0bGU7CisgICAgICAgICAgICAgICAgdmFyIHd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gICAgICAgfQorICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgfTsKKworICAgIHZhciBiaW5kU2NvcGUgPSBmdW5jdGlvbiAoYXR0ciwgc2NvcGUpIHsKKyAgICAgICAgaWYgKGFuZ3VsYXIuaXNEZWZpbmVkKGF0dHIpICYmIGF0dHIgIT09IG51bGwgJiYgYW5ndWxhci5pc0RlZmluZWQoc2NvcGUpICYmIHNjb3BlICE9PSBudWxsKSB7CisgICAgICAgICAgICB2YXIgZXZhbEZ1bmN0aW9uID0gZnVuY3Rpb24gKGtleSwgdmFsKSB7CisgICAgICAgICAgICAgICAgc2NvcGVba2V5XSA9IHNjb3BlLiRwYXJlbnQuJGV2YWwodmFsKTsKKyAgICAgICAgICAgIH07CisKKyAgICAgICAgICAgIHZhciB3YXRjaEZ1bmN0aW9uID0gZnVuY3Rpb24gKGtleSwgdmFsKSB7CisgICAgICAgICAgICAgICAgc2NvcGUuJHBhcmVudC4kd2F0Y2godmFsLCBmdW5jdGlvbiAodmFsdWUpIHsKKyAgICAgICAgICAgICAgICAgICAgc2NvcGVba2V5XSA9IHZhbHVlOworICAgICAgICAgICAgICAgIH0pOworICAgICAgICAgICAgICAgIHNjb3BlLiR3YXRjaChrZXksIGZ1bmN0aW9uICh2YWx1ZSkgeworICAgICAgICAgICAgICAgICAgICBzY29wZS4kcGFyZW50W3ZhbF0gPSB2YWx1ZTsKKyAgICAgICAgICAgICAgICB9KTsKKyAgICAgICAgICAgIH07CisKKyAgICAgICAgICAgIHZhciBldmFsQXR0cmlidXRlcyA9IGRhdGVwaWNrZXJDb25maWcuZGF0ZXBpY2tlckV2YWxBdHRyaWJ1dGVzOworICAgICAgICAgICAgdmFyIHdhdGNoQXR0cmlidXRlcyA9IGRhdGVwaWNrZXJDb25maWcuZGF0ZXBpY2tlcldhdGNoQXR0cmlidXRlczsKKyAgICAgICAgICAgIGZvciAodmFyIGtleSBpbiBhdHRyKSB7CisgICAgICAgICAgICAgICAgdmFyIHZhbCA9IGF0dHJba2V5XTsKKyAgICAgICAgICAgICAgICBpZiAoZXZhbEF0dHJpYnV0ZXMuaW5kZXhPZihrZXkpICE9PSAtMSAmJiBhbmd1bGFyLmlzRGVmaW5lZCh2YWwpKSB7CisgICAgICAgICAgICAgICAgICAgIGV2YWxGdW5jdGlvbihrZXksIHZhbCk7CisgICAgICAgICAgICAgICAgfSBlbHNlIGlmICh3YXRjaEF0dHJpYnV0ZXMuaW5kZXhPZihrZXkpICE9PSAtMSAmJiBhbmd1bGFyLmlzRGVmaW5lZCh2YWwpKSB7CisgICAgICAgICAgICAgICAgICAgIHdhdGNoRnVuY3Rpb24oa2V5LCB2YWwpOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgIH07CisKKyAgICB2YXIgdmFsaWRhdGVEYXRlU3RyaW5nID0gZnVuY3Rpb24gKGRhdGVTdHJpbmcsIGRhdGVGb3JtYXQpIHsKKyAgICAgICAgaWYgKGRhdGVTdHJpbmcgJiYgZGF0ZUZvcm1hdCkgeworICAgICAgICAgICAgdmFyIGRlbGltaXRlcjsKKyAgICAgICAgICAgIGlmIChkYXRlRm9ybWF0LmluZGV4T2YoJy8nKSAhPT0gLTEpIHsKKyAgICAgICAgICAgICAgICBkZWxpbWl0ZXIgPSAnLyc7CisgICAgICAgICAgICB9IGVsc2UgaWYgKGRhdGVGb3JtYXQuaW5kZXhPZignLScpICE9PSAtMSkgeworICAgICAgICAgICAgICAgIGRlbGltaXRlciA9ICctJzsKKyAgICAgICAgICAgIH0gZWxzZSBpZiAoZGF0ZUZvcm1hdC5pbmRleE9mKCcuJykgIT09IC0xKSB7CisgICAgICAgICAgICAgICAgZGVsaW1pdGVyID0gJy4nOworICAgICAgICAgICAgfQorCisgICAgICAgICAgICB2YXIgZGF0ZVN0cmluZ0FycmF5ID0gZGF0ZVN0cmluZy5zcGxpdChkZWxpbWl0ZXIpOworICAgICAgICAgICAgdmFyIGRhdGVGb3JtYXRBcnJheSA9IGRhd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OiBudWxsOworICAgICRzY29wZS5tYXhEYXRlID0gZHRDb25maWcubWF4RGF0ZSA/ICRzY29wZS5yZXNldFRpbWUoZHRDb25maWcubWF4RGF0ZSkgOiBudWxsOworCisgICAgZnVuY3Rpb24gZ2V0VmFsdWUodmFsdWUsIGRlZmF1bHRWYWx1ZSkgeworICAgICAgICByZXR1cm4gYW5ndWxhci5pc0RlZmluZWQodmFsdWUpID8gJHNjb3BlLiRwYXJlbnQuJGV2YWwodmFsdWUpIDogZGVmYXVsdFZhbHVlOworICAgIH0KKworICAgIGZ1bmN0aW9uIGdldERheXNJbk1vbnRoKHllYXIsIG1vbnRoKSB7CisgICAgICAgIHJldHVybiBuZXcgRGF0ZSh5ZWFyLCBtb250aCwgMCkuZ2V0RGF0ZSgpOworICAgIH0KKworICAgIGZ1bmN0aW9uIGdldERhdGVzKHN0YXJ0RGF0ZSwgbikgeworICAgICAgICB2YXIgZGF0ZXMgPSBbXTsKKyAgICAgICAgdmFyIGN1cnJlbnQgPSBzdGFydERhdGUsIGkgPSAwOworICAgICAgICB3aGlsZSAoaSA8IG4pIHsKKyAgICAgICAgICAgIGRhdGVzW2krK10gPSBuZXcgRGF0ZShjdXJyZW50KTsKKyAgICAgICAgICAgIGN1cnJlbnQuc2V0RGF0ZShjdXJyZW50LmdldERhdGUoKSArIDEpOworICAgICAgICB9CisgICAgICAgIHJldHVybiBkYXRlczsKKyAgICB9CisKKyAgICB2YXIgY29tcGFyZSA9IHRoaXMuY29tcGFyZSA9IGZ1bmN0aW9uKGRhdGUxLCBkYXRlMikgeworICAgICAgICByZXR1cm4gKG5ldyBEYXRlKGRhdGUxLmdldEZ1bGxZZWFyKCksIGRhdGUxLmdldE1vbnRoKCksIGRhdGUxLmdldERhdGUoKSkgLSBuZXcgRGF0ZShkYXRlMi5nZXRGdWxsWWVhcigpLCBkYXRlMi5nZXRNb250aCgpLCBkYXRlMi5nZXREYXRlKCkpKTsKKyAgICB9OworCisgICAgZnVuY3Rpb24gaXNTZ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LCAxKSwgbGFzdERheU9mTW9udGggPSBuZXcgRGF0ZSh5ZWFyLCBtb250aCsxLCAwKTsKKyAgICAgICAgICAgICAgICB2YXIgZGlmZmVyZW5jZSA9IHN0YXJ0aW5nRGF5IC0gZmlyc3REYXlPZk1vbnRoLmdldERheSgpLAorICAgICAgICAgICAgICAgICAgICAgICAgbnVtRGlzcGxheWVkRnJvbVByZXZpb3VzTW9udGggPSAoZGlmZmVyZW5jZSA+IDApID8gNyAtIGRpZmZlcmVuY2UgOiAtZGlmZmVyZW5jZSwKKyAgICAgICAgICAgICAgICAgICAgICAgIGZpcnN0RGF0ZSA9IG5ldyBEYXRlKGZpcnN0RGF5T2ZNb250aCksIG51bURhdGVzID0gMDsKKworICAgICAgICAgICAgICAgIGlmIChudW1EaXNwbGF5ZWRGcm9tUHJldmlvdXNNb250aCA+IDApIHsKKyAgICAgICAgICAgICAgICAgICAgZmlyc3REYXRlLnNldERhdGUoLW51bURpc3BsYXllZEZyb21QcmV2aW91c01vbnRoICsgMSk7CisgICAgICAgICAgICAgICAgICAgIG51bURhdGVzICs9IG51bURpc3BsYXllZEZyb21QcmV2aW91c01vbnRoOyAvLyBQcmV2aW91cworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICBudW1EYXRlcyArPSBnZXREYXlzSW5Nb250aCh5ZWFyLCBtb250aCArIDEpOyAvLyBDdXJyZW50CisgICAgICAgICAgICAgICAgbnVtRGF0ZXMgKz0gKDcgLSBudW1EYXRlcyAlIDcpICUgNzsgLy8gTmV4dAorCisgICAgICAgICAgICAgICAgdmFyIGRheXMgPSBnZXREYXRlcyhmaXJzdERhdGUsIG51bURhdGVzKSwgbGFiZWxzID0gW107CisgICAgICAgICAgICAgICAgZm9yICh2YXIgaSA9IDA7IGkgPCBudW1EYXRlczsgaSsrKSB7CisgICAgICAgICAgICAgICAgICAgIHZhciBkdCA9IG5ldyBEYXRlKGRheXNbaV0pOworICAgICAgICAgICAgICAgICAgICBkYXlzW2ldID0gbWFrZURhdGUoe2RhdGU6ZHQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZvcm1hdERheTpmb3JtYXQuZGF5LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBmb3JtYXRIZWFkZXI6Zm9ybWF0LmRheUhlYWRlciwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaXNGb2N1c2VkOmlzRm9jdXNlZChkdCksCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlzU2VsZWN0ZWQ6aXNTZWxlY3RlZChkdCksCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlzRnJvbURhdGU6aXNGcm9tRGF0ZShkdCksCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlzVG9EYXRlOmlzVG9EYXRlKGR0KSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaXNEYXRlUmFuZ2U6aXNEYXRlUmFuZ2UoZHQpLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBvbGRNb250aDoobmV3IERhdGUoZHQuZ2V0RnVsbFllYXIoKSwgZHQuZ2V0TW9udGgoKSwgMSwgMCwgMCwgMCkuZ2V0VGltZSgpIDwgbmV3IERhdGUoeWVhciwgbW9udGgsIDEsIDAsIDAsIDApLmdldFRpbWUoKSksCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG5ld01vbnRoOihuZXcgRGF0ZShkdC5nZXRGdWxsWWVhcigpLCBkdC5nZXRNb250aCgpLCAxLCAwLCAwLCAwKS5nZXRUaW1lKCkgPiBuZXcgRGF0ZSh5ZWFyLCBtb250aCwgMSwgMCwgMCwgMCkuZ2V0VGltZSgpKSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaXNEaXNhYmxlZDppc0Rpc2FibGVkKGR0KSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaXNUb2RheTppc1RvZGF5KGR0KSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaXNXZWFrZW5kOmlzV2Vla2VuZChkdCl9KTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgZm9yICh2YXIgaiA9IDA7IGogPCA3OyBqKyspIHsKKyAgICAgICAgICAgICAgICAgICAgbGFiZWxzW2pdID0gZ2V0TGFiZWwoZGF0ZUZpbHRlcihkYXlzW2pdLmRhdGUsIGZvcm1hdC5kYXlIZWFkZXIpKTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgaWYgKGNhbGVuZGFyID09PSAndG9wJykgeworICAgICAgICAgICAgICAgICAgICAkc2NvcGUuZGlzYWJsZVByZXZUb3AgPSBpc01pbkRhdGVBdmFpbGFibGUoZmlyc3REYXlPZk1vbnRoLCBsYXN0RGF5T2ZNb250aCk7CisgICAgICAgICAgICAgICAgICAgICRzY29wZS5kaXNhYmxlTmV4dFRvcCA9IGlzTWF4RGF0ZUF2YWlsYWJsZShmaXJzdERheU9mTW9udGgsIGxhc3REYXlPZk1vbnRoKTsKKyAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKGNhbGVuZGFyID09PSAnYm90dG9tJykgeworICAgICAgICAgICAgICAgICAgICAkc2NvcGUuZGlzYWJsZVByZXZCb3R0b20gPSBpc01pbkRhdGVBdmFpbGFibGUoZmlyc3REYXlPZk1vbnRoLCBsYXN0RGF5T2ZNb250aCk7CisgICAgICAgICAgICAgICAgICAgICRzY29wZS5kaXNhYmxlTmV4dEJvdHRvbSA9IGlzTWF4RGF0ZUF2YWlsYWJsZShmaXJzdERheU9mTW9udGgsIGxhc3REYXlPZk1vbnRoKTsKKyAgICAgICAgICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgICAgICAgICAkc2NvcGUuZGlzYWJsZVByZXZUb3AgPSAkc2NvcGUuZGlzYWJsZVByZXZCb3R0b20gPSBpc01pbkRhdGVBdmFpbGFibGUoZmlyc3REYXlPZk1vbnRoLCBsYXN0RGF5T2ZNb250aCk7CisgICAgICAgICAgICAgICAgICAgICRzY29wZS5kaXNhYmxlTmV4dFRvcCA9ICRzY29wZS5kaXNhYmxlTmV4dEJvdHRvbSA9IGlzTWF4RGF0ZUF2YWlsYWJsZShmaXJzdERheU9mTW9udGgsIGxhc3REYXlPZk1vbnRoKTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgJHNjb3BlLmRpc2FibGVQcmV2ID0gJHNjb3BlLmRpc2FibGVQcmV2VG9wIHx8ICRzY29wZS5kaXNhYmxlUHJldkJvdHRvbTsKKyAgICAgICAgICAgICAgICAkc2NvcGUuZGlzYWJsZU5leHQgPSAkc2NvcGUuZGlzYWJsZU5leHRUb3AgfHwgJHNjb3BlLmRpc2FibGVOZXh0Qm90dG9tOworICAgICAgICAgICAgICAgIHJldHVybiB7b2JqZWN0czogZGF5cywgdGl0bGU6IGRhdGVGaWx0ZXIoZGF0ZSwgZm9ybWF0LmRheVRpdGxlKSwgbGFiZWxzOiBsYWJlbHN9OworICAgICAgICAgICAgfSwKKyAgICAgICAgICAgIHNwbGl0OiA3LAorICAgICAgICAgICAgc3RlcDoge21vbnRoczogMX0KKyAgICAgICAgfSwKKyAgICAgICAgeworICAgICAgICAgICAgbmFtZTogJ21vbnRoJywKKyAgICAgICAgICAgIGdldFZpc2libGVEYXRlczogZnVuY3Rpb24oZGF0ZSkgeworICAgICAgICAgICAgICAgIHZhciBtb250aHMgPSBbXSwgbGFiZWxzID0gW10sIHllYXIgPSBkYXRlLmdldEZ1bGxZZWFyKCk7CisgICAgICAgICAgICAgICAgZm9yICh2YXIgaSA9IDA7IGkgPCAxMjsgaSsrKSB7CisgICAgICAgICAgICAgICAgICAgdmFyIGR0ID0gbmV3IERhdGUoeWVhcixpLDEpOworICAgICAgICAgICAgICAgICAgICBtb250aHNbaV0gPSBtYWtlRGF0ZSh7ZGF0ZTpkdCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZm9ybWF0RGF5OmZvcm1hdC5tb250aCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZm9ybWF0SGVhZGVyOmZvcm1hdC5tb250aCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaXNGb2N1c2VkOmlzRm9jdXNlZChkdCksCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlzU2VsZWN0ZWQ6aXNTZWxlY3RlZChkdCksCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlzRnJvbURhdGU6aXNGcm9tRGF0ZShkdCksCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlzVG9EYXRlOmlzVG9EYXRlKGR0KSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaXNEYXRlUmFuZ2U6aXNEYXRlUmFuZ2UoZHQpLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBvbGRNb250aDpmYWxzZSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbmV3TW9udGg6ZmFsc2UsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlzRGlzYWJsZWQ6aXNEaXNhYmxlZChkdCksCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlzVG9kYXk6aXNUb2RheShkdCksCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlzV2Vha2VuZDpmYWxzZX0pOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICByZXR1cm4ge29iamVjdHM6IG1vbnRocywgdGl0bGU6IGRhdGVGaWx0ZXIoZGF0ZSwgZm9ybWF0LnllYXIpLCBsYWJlbHM6IGxhYmVsc307CisgICAgICAgICAgICB9LAorICAgICAgICAgICAgc3BsaXQ6MywKKyAgICAgICAgICAgIHN0ZXA6IHt5ZWFyczogMX0KKyAgICAgICAgfQorICAgIF07CisKK31dKQorCisuZGlyZWN0aXZlKCdkYXRlcGlja2VyJywgWyckdGltZW91dCcsIGZ1bmN0aW9uICgkdGltZW91dCkgeworICAgIHJldHVybiB7CisgICAgICAgIHJlc3RyaWN0OiAnRUEnLAorICAgICAgICByZXBsYWNlOiB0cnVlLAorICAgICAgICB0cmFuc2NsdWRlOiB0cnVlLAorICAgICAgICB0ZW1wbGF0ZVVybDogJ2FwcC9zY3JpcHRzL25nX2pzX2F0dF90cGxzL2RhdGVwaWNrZXIvZGF0ZXBpY2tlci5odG1sJywKKyAgICAgICAgc2NvcGU6IHsKKyAgICAgICAgICAgIGN1cnJlbnREYXRlOiAiPT9jdXJyZW50IiwKKyAgICAgICAgICAgIGZyb21EYXRlOiAiPT9mcm9tIgorICAgICAgICB9LAorICAgICAgICByZXF1aXJlOiAnZGF0ZXBpY2tlcicsCisgICAgICAgIGNvbnRyb2xsZXI6ICdEYXRlcGlja2VyQ29udHJvbGxlcicsCisgICAgICAgIGxpbms6IGZ1bmN0aW9uKHNjb3BlLCBlbGVtZW50LCBhdHRycywgY3RybCkgeworICAgICAgICAgICAgdmFyIGRhdGVwaWNrZXJDdHJsID0gY3RybDsKKyAgICAgICAgICAgIHZhciBzZWxlY3RlZCwgY2FsZW5kYXJTZWxlY3RlZCA9IGZhbHNlOworICAgICAgICAgICAgc2NvcGUuZm9jdXNlZERhdGU7CisKKyAgICAgICAgICAgIHNjb3BlLnJlc2V0VGltZSA9IGZ1bmN0aW9uKGRhdGUpIHsKKyAgICAgICAgICAgICAgICB2YXIgZHQ7CisgICAgICAgICAgICAgICAgaWYgKCFpc05hTihuZXcgRGF0ZShkYXRlKSkpIHsKKyAgICAgICAgICAgICAgICAgICAgZHQgPSBuZXcgRGF0ZShkYXRlKTsKKyAgICAgICAgICAgICAgICAgICAgaWYoc2NvcGUubW9kZSA9PT0gMSl7CisgICAgICAgICAgICAgICAgICAgICAgICBkdCA9IG5ldyBEYXRlKGR0LmdldEZ1bGxZZWFyKCksIGR0LmdldE1vbnRoKCkpOworICAgICAgICAgICAgICAgICAgICB9ZWxzZXsKKyAgICAgICAgICAgICAgICAgICAgICAgIGR0ID0gbmV3IERhdGUoZHQuZ2V0RnVsbFllYXIoKSwgZHQuZ2V0TW9udGgoKSwgZHQuZ2V0RGF0ZSgpKTsKKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICAgICAgICAgIHJldHVybiBudWxsOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICByZXR1cm4gZHQ7CisgICAgICAgICAgICB9OworCisgICAgICAgICAgICBpZiAoYXR0cnMubWluKSB7CisgICAgICAgICAgICAgICAgc2NvcGUuJHBhcmVudC4kd2F0Y2goYXR0cnMubWluLCBmdW5jdGlvbih2YWx1ZSkgeworICAgICAgICAgICAgICAgICAgICBzY29wZS5taW5EYXRlID0gdmFsdWUgPyBzY29wZS5yZXNldFRpbWUodmFsdWUpIDogbnVsbDsKKyAgICAgICAgICAgICAgICAgICAgcmVmaWxsKCk7CisgICAgICAgICAgICAgICAgfSk7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBpZiAoYXR0cnMubWF4KSB7CisgICAgICAgICAgICAgICAgc2NvcGUuJHBhcmVudC4kd2F0Y2goYXR0cnMubWF4LCBmdW5jdGlvbih2YWx1ZSkgeworICAgICAgICAgICAgICAgICAgICBzY29wZS5tYXhEYXRlID0gdmFsdWUgPyBzY29wZS5yZXNldFRpbWUodmFsdWUpIDogbnVsbDsKKyAgICAgICAgICAgICAgICAgICAgcmVmaWxsKCk7CisgICAgICAgICAgICAgICAgfSk7CisgICAgICAgICAgICB9CisKKyAgICAgICAgICAgIC8vIFNwbGl0IGFycmF5IGludG8gc21hbGxlciBhcnJheXMKKyAgICAgICAgICAgIGZ1bmN0aW9uIHNwbGl0KGFyciwgc2l6ZSkgeworICAgICAgICAgICAgICAgIHZhciBhcnJheXMgPSBbXTsKKyAgICAgICAgICAgICAgICB3aGlsZSAoYXJyLmxlbmd0aCA+IDApIHsKKyAgICAgICAgICAgICAgICAgICAgYXJyYXlzLnB1c2goYXJyLnNwbGljZSgwLCBzaXplKSk7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIHJldHVybiBhcnJheXM7CisgICAgICAgICAgICB9CisgICAgICAgICAgICB2YXIgbW92ZU1vbnRoID0gZnVuY3Rpb24oc2VsZWN0ZWREYXRlLCBkaXJlY3Rpb24pIHsKKyAgICAgICAgICAgICAgICB2YXIgc3RlcCA9IGRhdGVwaWNrZXJDdHJsLm1vZGVzW3Njb3BlLm1vZGVdLnN0ZXA7CisgICAgICAgICAgICAgICAgc2VsZWN0ZWREYXRlLnNldERhdGUoMSk7CisgICAgICAgICAgICAgICAgc2VsZWN0ZWREYXRlLnNldE1vbnRoKHNlbGVjdGVkRGF0ZS5nZXRNb250aCgpICsgZGlyZWN0aW9uICogKHN0ZXAubW9udGhzIHx8IDApKTsKKyAgICAgICAgICAgICAgICBzZWxlY3RlZERhdGUuc2V0RnVsbFllYXIoc2VsZWN0ZWREYXRlLmdldEZ1bGxZZWFyKCkgKyBkaXJlY3Rpb24gKiAoc3RlcC55ZWFycyB8fCAwKSk7CisKKyAgICAgICAgICAgICAgICByZXR1cm4gc2VsZWN0ZWREYXRlOworICAgICAgICAgICAgfTsKKworICAgICAgICAgICAgZnVuY3Rpb24gcmVmaWxsKGRhdGUpIHsKKyAgICAgICAgICAgICAgICBpZiAoYW5ndWxhci5pc0RhdGUoZGF0ZSkgJiYgIWlzTmFOKGRhdGUpKSB7CisgICAgICAgICAgICAgICAgICAgIHNlbGVjdGVkID0gbmV3IERhdGUoZGF0ZSk7CisgICAgICAgICAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgICAgICAgICAgaWYgKCFzZWxlY3RlZCkgeworICAgICAgICAgICAgICAgICAgICAgICAgc2VsZWN0ZWQgPSBuZXcgRGF0ZSgpOworICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgfQorCisgICAgICAgICAgICAgICAgaWYgKHNlbGVjdGVkKSB7CisgICAgICAgICAgICAgICAgICAgIHZhciBzZWxlY3RlZENhbGVuZGFyOworICAgICAgICAgICAgICAgICAgICBpZihzY29wZS5tb2RlID09PSAxKXsKKyAgICAgICAgICAgICAgICAgICAgICAgIHNlbGVjdGVkID0gbmV3IERhdGUoKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIHNlbGVjdGVkQ2FsZW5kYXIgPSBtb3ZlTW9udGgoYW5ndWxhci5jb3B5KHNlbGVjdGVkKSwgLTEpOworICAgICAgICAgICAgICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgICAgICAgICAgICAgc2VsZWN0ZWRDYWxlbmRhciA9IGFuZ3VsYXIuY29weShzZWxlY3RlZCk7CisgICAgICAgICAgICAgICAgICAgIH0KKworICAgICAgICAgICAgICAgICAgICB2YXIgY3VycmVudE1vZGUgPSBkYXRlcGlja2VyQ3RybC5tb2Rlc1tzY29wZS5tb2RlXTsKKyAgICAgICAgICAgICAgICAgICAgdmFyIGN1cnJlbnREYXRhID0gY3VycmVudE1vZGUuZ2V0VmlzaWJsZURhdGVzKHNlbGVjdGVkQ2FsZW5kYXIsICd0b3AnKTsKKyAgICAgICAgICAgICAgICAgICAgc2NvcGUuY3VycmVudFJvd3MgPSBzcGxpdChjdXJyZW50RGF0YS5vYmplY3RzLCBjdXJyZW50TW9kZS5zcGxpdCk7CisgICAgICAgICAgICAgICAgICAgIHNjb3BlLmN1cnJlbnRUaXRsZSA9IGN1cnJlbnREYXRhLnRpdGxlOworICAgICAgICAgICAgICAgICAgICBzY29wZS5sYWJlbHMgPSBjdXJyZW50RGF0YS5sYWJlbHMgfHwgW107CisKKyAgICAgICAgICAgICAgICAgICAgdmFyIG5leHREYXRhID0gY3VycmVudE1vZGUuZ2V0VmlzaWJsZURhdGVzKG1vdmVNb250aChhbmd1bGFyLmNvcHkoc2VsZWN0ZWRDYWxlbmRhciksIDEpLCAnYm90dG9tJyk7CisgICAgICAgICAgICAgICAgICAgIHNjb3BlLm5leHRSb3dzID0gc3BsaXQobmV4dERhdGEub2JqZWN0cywgY3VycmVudE1vZGUuc3BsaXQpOworICAgICAgICAgICAgICAgICAgICBzY29wZS5uZXh0VGl0bGUgPSBuZXh0RGF0YS50aXRsZTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9CisKKyAgICAgICAgICAgIHZhciBzZWxlY3RDdXJyZW50RGF0ZSA9IGZ1bmN0aW9uKGRhdGUpIHsKKyAgICAgICAgICAgICAgICB2YXIgZHQgPSBuZXcgRGF0ZShkYXRlLmdldEZ1bGxZZWFyKCksIGRhdGUuZ2V0TW9udGgoKSwgZGF0ZS5nZXREYXRlKCkpOworICAgICAgICAgICAgICAgIHNjb3BlLmN1cnJlbnREYXRlID0gZHQ7CisgICAgICAgICAgICB9OworCisgICAgICAgICAgICB2YXIgc2VsZWN0RnJvbURhdGUgPSBmdW5jdGlvbihkYXRlKSB7CisgICAgICAgICAgICAgICAgdmFyIGR0ID0gbmV3IERhdGUoZGF0ZS5nZXRGdWxsWWVhcigpLCBkYXRlLmdldE1vbnRoKCksIGRhdGUuZ2V0RGF0ZSgpKTsKKyAgICAgICAgICAgICAgICBzY29wZS5mcm9tRGF0ZSA9IGR0OworICAgICAgICAgICAgfTsKKworICAgICAgICAgICAgc2NvcGUuc2VsZWN0ID0gZnVuY3Rpb24oZGF0ZSkgeworICAgICAgICAgICAgICAgIGNhbGVuZGFyU2VsZWN0ZWQgPSB0cnVlOworICAgICAgICAgICAgICAgIGlmKGF0dHJzLmZyb20pIHsKKyAgICAgICAgICAgICAgICAgICAgaWYoIShhbmd1bGFyLmlzRGF0ZShzY29wZS5mcm9tRGF0ZSkgJiYgYW5ndWxhci5pc0RhdGUoc2NvcGUuY3VycmVudERhdGUpKSkgeworICAgICAgICAgICAgICAgICAgICAgICAgaWYoYW5ndWxhci5pc0RhdGUoc2NvcGUuZnJvbURhdGUpKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2VsZWN0Q3VycmVudERhdGUoZGF0ZSk7CisgICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2UgaWYoIWFuZ3VsYXIuaXNEYXRlKHNjb3BlLmZyb21EYXRlKSkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNlbGVjdEZyb21EYXRlKGRhdGUpOworICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgICAgICAgICAgc2VsZWN0Q3VycmVudERhdGUoZGF0ZSk7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIHNjb3BlLmZvY3VzZWREYXRlID0gZGF0ZTsKKyAgICAgICAgICAgIH07CisKKyAgICAgICAgICAgIHZhciBzd2FwRGF0ZSA9IGZ1bmN0aW9uKGZyb21EYXRlLCBjdXJyZW50RGF0ZSkgeworICAgICAgICAgICAgICAgIHNlbGVjdEZyb21EYXRlKGN1cnJlbnREYXRlKTsKKyAgICAgICAgICAgICAgICAkdGltZW91dChmdW5jdGlvbiAoKSB7CisgICAgICAgICAgICAgICAgICAgIGNhbGVuZGFyU2VsZWN0ZWQgPSB0cnVlOworICAgICAgICAgICAgICAgICAgICBzY29wZS5mb2N1c2VkRGF0ZSA9IGN1cnJlbnREYXRlOworICAgICAgICAgICAgICAgICAgICBzZWxlY3RDdXJyZW50RGF0ZShmcm9tRGF0ZSk7CisgICAgICAgICAgICAgICAgfSk7CisgICAgICAgICAgICB9OworCisgICAgICAgICAgICBzY29wZS5tb3ZlID0gZnVuY3Rpb24oZGlyZWN0aW9uKSB7CisgICAgICAgICAgICAgICAgc2VsZWN0ZWQgPSBtb3ZlTW9udGgoYW5ndWxhci5jb3B5KHNlbGVjdGVkKSwgZGlyZWN0aW9uKTsKKyAgICAgICAgICAgICAgICByZWZpbGwoKTsKKyAgICAgICAgICAgIH07CisKKyAgICAgICAgICAgIHNjb3BlLiR3YXRjaCgnY3VycmVudERhdGUnLCBmdW5jdGlvbiAodmFsdWUpIHsKKyAgICAgICAgICAgICAgICBpZihhbmd1bGFyLmlzRGF0ZSh2YWx1ZSkgJiYgIWlzTmFOKHZhbHVlKSAmJiBkYXRlcGlja2VyQ3RybC5pc0Rpc2FibGVkKHZhbHVlKSkgeworICAgICAgICAgICAgICAgICAgICBzY29wZS5jdXJyZW50RGF0ZSA9IG51bGw7CisgICAgICAgICAgICAgICAgICAgIHJldHVybjsKKyAgICAgICAgICAgICAgICB9CisKKyAgICAgICAgICAgICAgICBpZiAoYXR0cnMuZnJvbSAmJiAhaXNOYU4odmFsdWUpICYmICFpc05hTihzY29wZS5mcm9tRGF0ZSkgJiYgZGF0ZXBpY2tlckN0cmwuY29tcGFyZSh2YWx1ZSwgc2NvcGUuZnJvbURhdGUpIDwgMCkgeworICAgICAgICAgICAgICAgICAgICAgICAgc3dhcERhdGUoc2NvcGUuZnJvbURhdGUsIHZhbHVlKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybjsKKyAgICAgICAgICAgICAgICB9CisKKyAgICAgICAgICAgICAgICBpZiAoY2FsZW5kYXJTZWxlY3RlZCkgeworICAgICAgICAgICAgICAgICAgICByZWZpbGwoKTsKKyAgICAgICAgICAgICAgICAgICAgY2FsZW5kYXJTZWxlY3RlZCA9IGZhbHNlOworICAgICAgICAgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICAgICAgICAgIGlmIChhbmd1bGFyLmlzRGVmaW5lZCh2YWx1ZSkgJiYgdmFsdWUgIT09IG51bGwpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIHJlZmlsbCh2YWx1ZSk7CisgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICAgICAgICAgICAgICByZWZpbGwoKTsKKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICBzY29wZS5mb2N1c2VkRGF0ZSA9IHVuZGVmaW5lZDsKKyAgICAgICAgICAgIH0pOworCisgICAgICAgICAgICBzY29wZS4kd2F0Y2goJ2Zyb21EYXRlJywgZnVuY3Rpb24gKHZhbHVlKSB7CisgICAgICAgICAgICAgICAgaWYoYW5ndWxhci5pc0RhdGUodmFsdWUpICYmICFpc05hTih2YWx1ZSkgJiYgZGF0ZXBpY2tlckN0cmwuaXNEaXNhYmxlZCh2YWx1ZSkpIHsKKyAgICAgICAgICAgICAgICAgICAgc2NvcGUuZnJvbURhdGUgPSBudWxsOworICAgICAgICAgICAgICAgICAgICByZXR1cm47CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIGlmIChhdHRycy5mcm9tKSB7CisgICAgICAgICAgICAgICAgICAgIGlmICghaXNOYU4oc2NvcGUuY3VycmVudERhdGUpICYmICFpc05hTih2YWx1ZSkgJiYgZGF0ZXBpY2tlckN0cmwuY29tcGFyZShzY29wZS5jdXJyZW50RGF0ZSwgdmFsdWUpIDwgMCkgeworICAgICAgICAgICAgICAgICAgICAgICAgc3dhcERhdGUodmFsdWUsIHNjb3BlLmN1cnJlbnREYXRlKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybjsKKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICBpZiAoY2FsZW5kYXJTZWxlY3RlZCkgeworICAgICAgICAgICAgICAgICAgICAgICAgcmVmaWxsKCk7CisgICAgICAgICAgICAgICAgICAgICAgICBjYWxlbmRhclNlbGVjdGVkID0gZmFsc2U7CisgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICAgICAgICAgICAgICBpZiAoYW5ndWxhci5pc0RlZmluZWQodmFsdWUpICYmIHZhbHVlICE9PSBudWxsKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmVmaWxsKHZhbHVlKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmVmaWxsKCk7CisgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgc2NvcGUuZm9jdXNlZERhdGUgPSB1bmRlZmluZWQ7CisgICAgICAgICAgICB9KTsKKyAgICAgICAgfQorICAgIH07Cit9XSkKKy5kaXJlY3RpdmUoJ2RhdGVwaWNrZXJQb3B1cCcsIFsnJGRvY3VtZW50JywgJ2RhdGVwaWNrZXJTZXJ2aWNlJywgJyRpc0VsZW1lbnQnLCAnJGRvY3VtZW50QmluZCcsIGZ1bmN0aW9uKCRkb2N1bWVudCwgZGF0ZXBpY2tlclNlcnZpY2UsICRpc0VsZW1lbnQsICRkb2N1bWVudEJpbmQpIHsKKyAgICB2YXIgbGluayA9IGZ1bmN0aW9uIChzY29wZSwgZWxlbSwgYXR0cikgeworICAgICAgICBkYXRlcGlja2VyU2VydmljZS5iaW5kU2NvcGUoYXR0ciwgc2NvcGUpOworCisgICAgICAgIHNjb3BlLmlzT3BlbiA9IGZhbHNlOworCisgICAgICAgIHZhciB0b2dnbGUgPSBzY29wZS50b2dnbGUgPSBmdW5jdGlvbiAoc2hvdykgeworICAgICAgICAgICAgaWYoc2hvdyA9PT0gdHJ1ZSB8fCBzaG93ID09PSBmYWxzZSkgeworICAgICAgICAgICAgICAgIHNjb3BlLmlzT3BlbiA9IHNob3c7CisgICAgICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgICAgIHNjb3BlLmlzT3BlbiA9ICFzY29wZS5pc09wZW47CisgICAgICAgICAgICB9CisgICAgICAgIH07CisKKyAgICAgICAgc2NvcGUuJHdhdGNoKCdjdXJyZW50JywgZnVuY3Rpb24gKCkgeworICAgICAgICAgICAgdG9nZ2xlKGZhbHNlKTsKKyAgICAgICAgfSk7CisKKyAgICAgICAgdmFyIG91dHNpZGVDbGljayA9IGZ1bmN0aW9uIChlKSB7CisgICAgICAgICAgICB2YXIgaXNFbGVtZW50ID0gJGlzRWxlbWVudChhbmd1bGFyLmVsZW1lbnQoZS50YXJnZXQpLCBlbGVtLCAkZG9jdW1lbnQpOworICAgICAgICAgICAgaWYoIWlzRWxlbWVudCkgeworICAgICAgICAgICAgICAgIHRvZ2dsZShmYWxzZSk7CisgICAgICAgICAgICAgICAgc2NvcGUuJGFwcGx5KCk7CisgICAgICAgICAgICB9CisgICAgICAgIH07CisKKyAgICAgICAgJGRvY3VtZW50QmluZC5jbGljaygnaXNPcGVuJywgb3V0c2lkZUNsaWNrLCBzY29wZSk7CisgICAgfTsKKworICAgIHJldHVybiB7CisgICAgICAgIHJlc3RyaWN0OiAnRUEnLAorICAgICAgICByZXBsYWNlOiB0cnVlLAorICAgICAgICB0cmFuc2NsdWRlOiB0cnVlLAorICAgICAgICB0ZW1wbGF0ZVVybDogJ2FwcC9zY3JpcHRzL25nX2pzX2F0dF90cGxzL2RhdGVwaWNrZXIvZGF0ZXBpY2tlclBvcHVwLmh0bWwnLAorICAgICAgICBzY29wZTogeworICAgICAgICAgICAgY3VycmVudDogIj1jdXJyZW50IgorICAgICAgICB9LAorICAgICAgICBjb21waWxlOiBmdW5jdGlvbiAoZWxlbSwgYXR0cikgeworICAgICAgICAgICAgdmFyIHdyYXBwZXJFbGVtZW50ID0gZWxlbS5maW5kKCdzcGFuJykuZXEoMSk7CisgICAgICAgICAgICB3cmFwcGVyRWxlbWVudC5hdHRyKCdjdXJyZW50JywgJ2N1cnJlbnQnKTsKKyAgICAgICAgICAgIGRhdGVwaWNrZXJTZXJ2aWNlLnNldEF0dHJpYnV0ZXMoYXR0ciwgd3JhcHBlckVsZW1lbnQpOworCisgICAgICAgICAgICByZXR1cm4gbGluazsKKyAgICAgICAgfQorICAgIH07Cit9XSkKKworLmRpcmVjdGl2ZSgnYXR0RGF0ZXBpY2tlcicsIFsnJGxvZycsIGZ1bmN0aW9uKCRsb2cpIHsKKyAgICByZXR1cm4geworICAgICAgICByZXN0cmljdDogJ0EnLAorICAgICAgICByZXF1aXJlOiAnbmdNb2RlbCcsCisgICAgICAgIHNjb3BlOiB7fSwKKyAgICAgICAgY29udHJvbGxlcjogWyckc2NvcGUnLCAnJGVsZW1lbnQnLCA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eworICAgICAgICAgICAgaWYgKCFjdHJsKSB7CisgICAgICAgICAgICAgICAgLy8gZG8gbm90aGluZyBpZiBubyBuZy1tb2RlbAorICAgICAgICAgICAgICAgICRsb2cuZXJyb3IoIm5nLW1vZGVsIGlzIHJlcXVpcmVkLiIpOworICAgICAgICAgICAgICAgIHJldHVybjsKKyAgICAgICAgICAgIH0KKworICAgICAgICAgICAgc2NvcGUuJHdhdGNoKCdjdXJyZW50JywgZnVuY3Rpb24odmFsdWUpIHsKKyAgICAgICAgICAgICAgICBjdHJsLiRzZXRWaWV3VmFsdWUodmFsdWUpOworICAgICAgICAgICAgfSk7CisgICAgICAgICAgICBjdHJsLiRyZW5kZXIgPSBmdW5jdGlvbigpIHsKKyAgICAgICAgICAgICAgICBzY29wZS5jdXJyZW50ID0gY3RybC4kdmlld1ZhbHVlOworICAgICAgICAgICAgfTsKKyAgICAgICAgfQorICAgIH07Cit9XSkKKworLmRpcmVjdGl2ZSgnZm9ybWF0RGF0ZScsIFsnZGF0ZUZpbHRlcicsICdkYXRlcGlja2VyU2VydmljZScsIGZ1bmN0aW9uKGRhdGVGaWx0ZXIsIGRhdGVwaWNrZXJTZXJ2aWNlKSB7CisgICAgcmV0dXJuIHsKKyAgICAgICAgcmVzdHJpY3Q6ICdBJywKKyAgICAgICAgcmVxdWlyZTogJ25nTW9kZWwnLAorICAgICAgICBsaW5rOiBmdW5jdGlvbihzY29wZSwgZWxlbSwgYXR0ciwgY3RybCkgeworICAgICAgICAgICAgdmFyIGZvcm1hdERhdGUgPSAiIjsKKyAgICAgICAgICAgIGF0dHIuJG9ic2VydmUoJ2Zvcm1hdERhdGUnLCBmdW5jdGlvbiAodmFsdWUpIHsKKyAgICAgICAgICAgICAgICBmb3JtYXREYXRlID0gdmFsdWU7CisgICAgICAgICAgICB9KTsKKyAgICAgICAgICAgIHZhciBkYXRlVG9TdHJpbmcgPSBmdW5jdGlvbih2YWx1ZSkgeworICAgICAgICAgICAgICAgIGlmICh2YWx1ZSkgeworICAgICAgICAgICAgICAgICAgICBjdHJsLiRzZXRWYWxpZGl0eSgnaW52YWxpZERhdGUnLCB0cnVlKTsKKyAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGRhdGVGaWx0ZXIodmFsdWUsIGZvcm1hdERhdGUpOworICAgICAgICAgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICAgICAgICAgIGN0cmwuJHNldFZhbGlkaXR5KCdpbnZhbGlkRGF0ZScsIGZhbHNlKTsKKyAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGVsZW0udmFsKCk7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfTsKKyAgICAgICAgICAgIHZhciBzdHJpbmdUb0RhdGUgPSBmdW5jdGlvbih2YWx1ZSkgeworICAgICAgICAgICAgICAgIGlmKGRhdGVwaWNrZXJTZXJ2aWNlLnZhbGlkYXRlRGF0ZVN0cmluZyh2YWx1ZSwgZm9ybWF0RGF0ZSkpIHsKKyAgICAgICAgICAgICAgICAgICAgY3RybC4kc2V0VmFsaWRpdHkoJ2ludmFsaWREYXRlJywgdHJ1ZSk7CisgICAgICAgICAgICAgICAgICAgIHJldHVybiBuZXcgRGF0ZSh2YWx1ZSk7CisgICAgICAgICAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgICAgICAgICAgY3RybC4kc2V0VmFsaWRpdHkoJ2ludmFsaWREYXRlJywgZmFsc2UpOworICAgICAgICAgICAgICAgICAgICByZXR1cm4gbnVsbDsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9OworICAgICAgICAgICAgY3RybC4kZm9ybWF0dGVycy51bnNoaWZ0KGRhdGVUb1N0cmluZyk7CisgICAgICAgICAgICBjdHJsLiRwYXJzZXJzLnVuc2hpZnQoc3RyaW5nVG9EYXRlKTsKKyAgICAgICAgfQorICAgIH07Cit9XSkKKworLmRpcmVjdGl2ZSgnYXR0RGF0ZUZpbHRlcicsIFsnJGRvY3VtZW50JywgJ2RhdGVGaWx0ZXInLCAn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F0ZUZvcm1hdFN0cmluZy50b1VwcGVyQ2FzZSgpOworICAgICAgICAgICAgdmFyIGN1cnJlbnREYXRlVGV4dCA9IGRhdGVGb3JtYXRTdHJpbmcudG9VcHBlckNhc2UoKTsKKworICAgICAgICAgICAgaWYoIWlzTmFOKG5ldyBEYXRlKHNjb3BlLmZyb21EYXRlKSkpIHsKKyAgICAgICAgICAgICAgICBmcm9tRGF0ZVRleHQgPSBkYXRlRmlsdGVyKHNjb3BlLmZyb21EYXRlLCBkYXRlRm9ybWF0U3RyaW5nKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGlmKCFpc05hTihuZXcgRGF0ZShzY29wZS5jdXJyZW50RGF0ZSkpKSB7CisgICAgICAgICAgICAgICAgY3VycmVudERhdGVUZXh0ID0gZGF0ZUZpbHRlcihzY29wZS5jdXJyZW50RGF0ZSwgZGF0ZUZvcm1hdFN0cmluZyk7CisgICAgICAgICAgICB9CisKKyAgICAgICAgICAgIGlmKHZhbHVlID09PSAnQ3VzdG9tIFNpbmdsZSBEYXRlJykgeworICAgICAgICAgICAgICAgIGN0cmwuJHNldFZhbGlkaXR5KCdpbnZhbGlkRGF0ZScsIHRydWUpOworICAgICAgICAgICAgICAgIHNjb3BlLm1heExlbmd0aCA9IDEwOworICAgICAgICAgICAgICAgIHNjb3BlLnNlbGVjdGVkT3B0aW9uID0gY3VycmVudERhdGVUZXh0OworICAgICAgICAgICAgfSBlbHNlIGlmKHZhbHVlID09PSAnQ3VzdG9tIFJhbmdlJykgeworICAgICAgICAgICAgICAgIGN0cmwuJHNldFZhbGlkaXR5KCdpbnZhbGlkRGF0ZScsIHRydWUpOworICAgICAgICAgICAgICAgIGN0cmwuJHNldFZhbGlkaXR5KCdpbnZhbGlkRGF0ZVJhbmdlJywgdHJ1ZSk7CisgICAgICAgICAgICAgICAgc2NvcGUubWF4TGVuZ3RoID0gMjE7CisgICAgICAgICAgICAgICAgc2NvcGUuc2VsZWN0ZWRPcHRpb24gPSBmcm9tRGF0ZVRleHQgKyAnLScgKyBjdXJyZW50RGF0ZVRleHQ7CisgICAgICAgICAgICB9CisgICAgICAgIH07CisKKyAgICAgICAgdmFyIGNsZWFyID0gc2NvcGUuY2xlYXIgPSBmdW5jdGlvbihwYXJ0aWFsKSB7CisgICAgICAgICAgICBzY29wZS5mcm9tRGF0ZSA9IHVuZGVmaW5lZDsKKyAgICAgICAgICAgIHNjb3BlLmN1cnJlbnREYXRlID0gdW5kZWZpbmVkOworICAgICAgICAgICAgc2NvcGUuYXBwbHlCdXR0b25UeXBlID0gImRpc2FibGVkIjsKKyAgICAgICAgICAgIGlmKCFwYXJ0aWFsKSB7CisgICAgICAgICAgICAgICAgY3RybC4kc2V0VmFsaWRpdHkoJ2ludmFsaWREYXRlJywgdHJ1ZSk7CisgICAgICAgICAgICAgICAgY3RybC4kc2V0VmFsaWRpdHkoJ2ludmFsaWREYXRlUmFuZ2UnLCB0cnVlKTsKKyAgICAgICAgICAgICAgICBzZXREcm9wZG93blRleHQoc2NvcGUuY3VycmVudFNlbGVjdGlvbik7CisgICAgICAgICAgICB9CisgICAgICAgIH07CisKKyAgICAgICAgdmFyIHNob3dDYWxlbmRhciA9IGZ1bmN0aW9uKCkgeworICAgICAgICAgICAgc2NvcGUuc2hvd0NhbGVuZGFyID0gdHJ1ZTsKKyAgICAgICAgfTsKKworICAgICAgICB2YXIgaGlkZUNhbGVuZGFyID0gZnVuY3Rpb24oKSB7CisgICAgICAgICAgICBzY29wZS5zaG93Q2FsZW5kYXIgPSBmYWxzZTsKKyAgICAgICAgICAgIGlmKHNjb3BlLmN1cnJlbnRTZWxlY3Rpb24gIT09ICdDdXN0b20gU2luZ2xlIERhdGUnICYmIHNjb3BlLmN1cnJlbnRTZWxlY3Rpb24gIT09ICdDdXN0b20gUmFuZ2UnKSB7CisgICAgICAgICAgICAgICAgY2xlYXIodHJ1ZSk7CisgICAgICAgICAgICB9CisgICAgICAgIH07CisKKyAgICAgICAgdmFyIHNob3dEcm9wZG93biA9IHNjb3BlLnNob3dEcm9wZG93biA9IGZ1bmN0aW9uIChzaG93KSB7CisgICAgICAgICAgICBpZihzaG93ID09PSB0cnVlIHx8IHNob3cgPT09IGZhbHNlKSB7CisgICAgICAgICAgICAgICAgc2NvcGUuc2hvd0Ryb3Bkb3duTGlzdCA9IHNob3c7CisgICAgICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgICAgIHNjb3BlLnNob3dEcm9wZG93bkxpc3QgPSAhc2NvcGUuc2hvd0Ryb3Bkb3duTGlzdDsKKyAgICAgICAgICAgIH0KKworICAgICAgICAgICAgaWYgKCFzY29wZS5zaG93RHJvcGRvd25MaXN0KSB7CisgICAgICAgICAgICAgICAgc2NvcGUuZm9jdXNJbnB1dEJ1dHRvbiA9IHRydWU7CisgICAgICAgICAgICAgICAgaGlkZUNhbGVuZGFyKCk7CisgICAgICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgICAgIGlmIChzY29wZS5jdXJyZW50U2VsZWN0aW9uID09PSAnQ3VzdG9tIFNpbmdsZSBEYXRlJyB8fCBzY29wZS5jdXJyZW50U2VsZWN0aW9uID09PSAnQ3VzdG9tIFJhbmdlJykgeworICAgICAgICAgICAgICAgICAgICBzaG93Q2FsZW5kYXIoKTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9CisgICAgICAgIH07CisKKyAgICAgICAgc2NvcGUucmVzZXRUaW1lID0gZnVuY3Rpb24oZGF0ZSkgeworICAgICAgICAgICAgdmFyIGR0OworICAgICAgICAgICAgaWYgKCFpc05hTihuZXcgRGF0ZShkYXRlKSkpIHsKKyAgICAgICAgICAgICAgICBkdCA9IG5ldyBEYXRlKGRhdGUpOworICAgICAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgICAgICByZXR1cm4gbnVsbDsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIHJldHVybiBuZXcgRGF0ZShkdC5nZXRGdWxsWWVhcigpLCBkdC5nZXRNb250aCgpLCBkdC5nZXREYXRlKCkpOworICAgICAgICB9OworCisgICAgICAgIHNjb3BlLmdldERyb3Bkb3duVGV4dCA9IGZ1bmN0aW9uICgpIHsKKyAgICAgICAgICAgIGlucHV0Q2hhbmdlID0gdHJ1ZTsKKyAgICAgICAgICAgIHZhciBkcm9wZG93blRleHQgPSBzY29wZS5zZWxlY3RlZE9wdGlvbjsKKworICAgICAgICAgICAgaWYgKHNjb3BlLmN1cnJlbnRTZWxlY3Rpb24gPT09ICdDdXN0b20gU2luZ2xlIERhdGUnKSB7CisgICAgICAgICAgICAgICAgaWYgKCFpc05hTihuZXcgRGF0ZShkcm9wZG93blRleHQpKSAmJiBkYXRlcGlja2VyU2VydmljZS52YWxpZGF0ZURhdGVTdHJpbmcoZHJvcGRvd25UZXh0LCBkYXRlRm9ybWF0U3RyaW5nKSkgeworICAgICAgICAgICAgICAgICAgICBjdHJsLiRzZXRWYWxpZGl0eSgnaW52YWxpZERhdGUnLCB0cnVlKTsKKyAgICAgICAgICAgICAgICAgICAgc2NvcGUuZnJvbURhdGUgPSB1bmRlZmluZWQ7CisgICAgICAgICAgICAgICAgICAgIHNjb3BlLmN1cnJlbnREYXRlID0gbmV3IERhdGUoZHJvcGRvd25UZXh0KTsKKyAgICAgICAgICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgICAgICAgICBjdHJsLiRzZXRWYWxpZGl0eSgnaW52YWxpZERhdGUnLCBmYWxzZSk7CisgICAgICAgICAgICAgICAgICAgIGNsZWFyKHRydWUpOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0gZWxzZSBpZiAoc2NvcGUuY3VycmVudFNlbGVjdGlvbiA9PT0gJ0N1c3RvbSBSYW5nZScpIHsKKyAgICAgICAgICAgICAgICBpZiAoZHJvcGRvd25UZXh0LmluZGV4T2YoJy0nKSAhPT0gLTEgJiYgKGRyb3Bkb3duVGV4dC5zcGxpdCgnLScpLmxlbmd0aCA9PT0gMiB8fCBkcm9wZG93blRleHQuc3BsaXQoJy0nKS5sZW5ndGggPT09IDYpKSB7CisgICAgICAgICAgICAgICAgICAgIGN0cmwuJHNldFZhbGlkaXR5KCdpbnZhbGlkRGF0ZVJhbmdlJywgdHJ1ZSk7CisgICAgICAgICAgICAgICAgICAgIHZhciByZXN1bHREcm9wZG93blRleHQgPSBkcm9wZG93blRleHQuc3BsaXQoJy0nKTsKKyAgICAgICAgICAgICAgICAgICAgaWYgKHJlc3VsdERyb3Bkb3duVGV4dC5sZW5ndGggPT09IDIpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIHJlc3VsdERyb3Bkb3duVGV4dFswXSA9IHJlc3VsdERyb3Bkb3duVGV4dFswXS50cmltKCk7CisgICAgICAgICAgICAgICAgICAgICAgICByZXN1bHREcm9wZG93blRleHRbMV0gPSByZXN1bHREcm9wZG93blRleHRbMV0udHJpbSgpOworICAgICAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKHJlc3VsdERyb3Bkb3duVGV4dC5sZW5ndGggPT09IDYpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIHZhciBmaXJzdERhdGVTdHJpbmcgPSByZXN1bHREcm9wZG93blRleHRbMF0udHJpbSgpICsgJy0nICsgcmVzdWx0RHJvcGRvd25UZXh0WzFdLnRyaW0oKSArICctJyArIHJlc3VsdERyb3Bkb3duVGV4dFsyXS50cmltKCk7CisgICAgICAgICAgICAgICAgICAgICAgICB2YXIgc2Vjb25kRGF0ZVN0cmluZyA9IHJlc3VsdERyb3Bkb3duVGV4dFszXS50cmltKCkgKyAnLScgKyByZXN1bHREcm9wZG93blRleHRbNF0udHJpbSgpICsgJy0nICsgcmVzdWx0RHJvcGRvd25UZXh0WzVdLnRyaW0oKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIHJlc3VsdERyb3Bkb3duVGV4dFswXSA9IGZpcnN0RGF0ZVN0cmluZzsKKyAgICAgICAgICAgICAgICAgICAgICAgIHJlc3VsdERyb3Bkb3duVGV4dFsxXSA9IHNlY29uZERhdGVTdHJpbmc7CisgICAgICAgICAgICAgICAgICAgIH0KKworICAgICAgICAgICAgICAgICAgICBpZiAoIWlzTmFOKG5ldyBEYXRlKHJlc3VsdERyb3Bkb3duVGV4dFswXSkpICYmICFpc05hTihuZXcgRGF0ZShyZXN1bHREcm9wZG93blRleHRbMV0pKSAmJiBkYXRlcGlja2VyU2VydmljZS52YWxpZGF0ZURhdGVTdHJpbmcocmVzdWx0RHJvcGRvd25UZXh0WzBdLCBkYXRlRm9ybWF0U3RyaW5nKSAmJiBkYXRlcGlja2VyU2VydmljZS52YWxpZGF0ZURhdGVTdHJpbmcocmVzdWx0RHJvcGRvd25UZXh0WzFdLCBkYXRlRm9ybWF0U3RyaW5nKSkgeworICAgICAgICAgICAgICAgICAgICAgICAgY3RybC4kc2V0VmFsaWRpdHkoJ2ludmFsaWREYXRlJywgdHJ1ZSk7CisgICAgICAgICAgICAgICAgICAgICAgICB2YXIgZnJvbURhdGUgPSBuZXcgRGF0ZShyZXN1bHREcm9wZG93blRleHRbMF0pOworICAgICAgICAgICAgICAgICAgICAgICAgdmFyIGN1cnJlbnREYXRlID0gbmV3IERhdGUocmVzdWx0RHJvcGRvd25UZXh0WzFdKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIGlmKGZyb21EYXRlLmdldFRpbWUoKSA8IGN1cnJlbnREYXRlLmdldFRpbWUoKSkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGN0cmwuJHNldFZhbGlkaXR5KCdpbnZhbGlkRGF0ZVJhbmdlJywgdHJ1ZSk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2NvcGUuZnJvbURhdGUgPSBmcm9tRGF0ZTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBzY29wZS5jdXJyZW50RGF0ZSA9IGN1cnJlbnREYXRlOworICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBjdHJsLiRzZXRWYWxpZGl0eSgnaW52YWxpZERhdGVSYW5nZScsIGZhbHNlKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBjbGVhcih0cnVlKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIGN0cmwuJHNldFZhbGlkaXR5KCdpbnZhbGlkRGF0ZScsIGZhbHNlKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIGNsZWFyKHRydWUpOworICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgICAgICAgICAgY3RybC4kc2V0VmFsaWRpdHkoJ2ludmFsaWREYXRlUmFuZ2UnLCBmYWxzZSk7CisgICAgICAgICAgICAgICAgICAgIGNsZWFyKHRydWUpOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0KKyAgICAgICAgfTsKKworICAgICAgICBzY29wZS51bnRyYWNrSW5wdXRDaGFuZ2UgPSBmdW5jdGlvbigpIHsKKyAgICAgICAgICAgIGlucHV0Q2hhbmdlID0gZmFsc2U7CisgICAgICAgIH07CisKKyAgICAgICAgc2NvcGUuc2VsZWN0QWR2YW5jZWRPcHRpb24gPSBmdW5jdGlvbiAodmFsdWUsIG5vdENsZWFyRmxhZykgeworICAgICAgICAgICAgc2NvcGUuY3VycmVudFNlbGVjdGlvbiA9IHZhbHVlOworICAgICAgICAgICAgaWYoIW5vdENsZWFyRmxhZyl7CisgICAgICAgICAgICAgICAgY2xlYXIoKTsKKyAgICAgICAgICAgICAgICBzaG93Q2FsZW5kYXIoKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIHNjb3BlLiR3YXRjaCgnY3VycmVudERhdGUnLCBmdW5jdGlvbih2YWwpIHsKKyAgICAgICAgICAgICAgICBpZighaXNOYU4obmV3IERhdGUodmFsKSkpIHsKKyAgICAgICAgICAgICAgICAgICAgc2NvcGUuYXBwbHlCdXR0b25UeXBlID0gInByaW1hcnkiOworICAgICAgICAgICAgICAgICAgICBzZXREcm9wZG93blRleHQodmFsdWUpOworICAgICAgICAgICAgICAgICAgICBpZiAoIWlucHV0Q2hhbmdlKSB7CisgICAgICAgICAgICAgICAgICAgICAgICBzY29wZS5mb2N1c0FwcGx5QnV0dG9uID0gdHJ1ZTsKKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0pOworICAgICAgICAgICAgc2NvcGUuJHdhdGNoKCdmcm9tRGF0ZScsIGZ1bmN0aW9uKHZhbCkgeworICAgICAgICAgICAgICAgIGlmKCFpc05hTihuZXcgRGF0ZSh2YWwpKSkgeworICAgICAgICAgICAgICAgICAgICBzZXREcm9wZG93blRleHQodmFsdWUpOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0pOworICAgICAgICAgICAgaWYgKHZhbHVlID09PSAnQ3VzdG9tIFNpbmdsZSBEYXRlJykgeworICAgICAgICAgICAgICAgIHNjb3BlLmZvY3VzU2luZ2xlRGF0ZUNhbGVuZGFyID0gdHJ1ZTsKKyAgICAgICAgICAgIH0gZWxzZSBpZiAodmFsdWUgPT09ICdDdXN0b20gUmFuZ2UnKSB7CisgICAgICAgICAgICAgICAgc2NvcGUuZm9jdXNSYW5nZUNhbGVuZGFyID0gdHJ1ZTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfTsKKworICAgICAgICBzY29wZS5yZXNldEZvY3VzID0gZnVuY3Rpb24gKCkgeworICAgICAgICAgICAgc2NvcGUuZm9jdXNTaW5nbGVEYXRlQ2FsZW5kYXIgPSBmYWxzZTsKKyAgICAgICAgICAgIHNjb3BlLmZvY3VzUmFuZ2VDYWxlbmRhciA9IGZhbHNlOworICAgICAgICAgICAgc2NvcGUuZm9jdXNBcHBseUJ1dHRvbiA9IGZhbHNlOworICAgICAgICB9OworCisgICAgICAgIHNjb3BlLmFwcGx5ID0gZnVuY3Rpb24oKSB7CisgICAgICAgICAgICBzY29wZS5kYXRlUmFuZ2Uuc2VsZWN0aW9uID0gc2NvcGUuc2VsZWN0ZWRPcHRpb247CisgICAgICAgICAgICBpZighaXNOYU4obmV3IERhdGUoc2NvcGUuZnJvbURhdGUpKSkgeworICAgICAgICAgICAgICAgIHNjb3BlLmZyb20gPSBzY29wZS5mcm9tRGF0ZTsKKyAgICAgICAgICAgICAgICBzY29wZS5kYXRlUmFuZ2UuZnJvbSA9IHNjb3BlLmZyb21EYXRlOworICAgICAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgICAgICBzY29wZS5mcm9tID0gdW5kZWZpbmVkOworICAgICAgICAgICAgICAgIHNjb3BlLmRhdGVSYW5nZS5mcm9tID0gdW5kZWZpbmVkOworICAgICAgICAgICAgfQorICAgICAgICAgICAgaWYoIWlzTmFOKG5ldyBEYXRlKHNjb3BlLmN1cnJlbnREYXRlKSkpIHsKKyAgICAgICAgICAgICAgICBzY29wZS5jdXJyZW50ID0gc2NvcGUuY3VycmVudERhdGU7CisgICAgICAgICAgICAgICAgc2NvcGUuZGF0ZVJhbmdlLmN1cnJlbnQgPSBzY29wZS5jdXJyZW50RGF0ZTsKKyAgICAgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICAgICAgc2NvcGUuY3VycmVudCA9IHVuZGVmaW5lZDsKKyAgICAgICAgICAgICAgICBzY29wZS5kYXRlUmFuZ2UuY3VycmVudCA9IHVuZGVmaW5lZDsKKyAgICAgICAgICAgIH0KKworICAgICAgICAgICAgc2hvd0Ryb3Bkb3duKCk7CisgICAgICAgIH07CisKKyAgICAgICAgc2NvcGUuJHdhdGNoQ29sbGVjdGlvbihmdW5jdGlvbigpIHsKKyAgICAgICAgICAgIHJldHVybiBzY29wZS5kYXRlUmFuZ2U7CisgICAgICAgIH0sIGZ1bmN0aW9uKHZhbHVlKSB7CisgICAgICAgICAgICBpZihjdHJsKSB7CisgICAgICAgICAgICAgICAgdmFyIGZpbmFsRGF0ZVJhbmdlID0gYW5ndWxhci5jb3B5KHZhbHVlKTs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SA9IHVuZGVmaW5lZDsKKyAgICAgICAgICAgICAgICAgICAgc2NvcGUuZGF0ZVJhbmdlLmN1cnJlbnQgPSBzY29wZS5jdXJyZW50RGF0ZTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9CisgICAgICAgIH07CisgICAgICAgIAorICAgICAgICBzY29wZS5jYW5jZWwgPSBmdW5jdGlvbigpIHsKKyAgICAgICAgICAgIHNjb3BlLmN1cnJlbnRTZWxlY3Rpb24gPSAiIjsKKyAgICAgICAgICAgIHNjb3BlLnNlbGVjdGVkT3B0aW9uID0gZGF0ZXBpY2tlckNvbmZpZy5kYXRlRmlsdGVyLmRlZmF1bHRUZXh0OworICAgICAgICAgICAgc2hvd0Ryb3Bkb3duKCk7CisgICAgICAgIH07CisKKyAgICAgICAgdmFyIG91dHNpZGVDbGljayA9IGZ1bmN0aW9uIChlKSB7CisgICAgICAgICAgICB2YXIgaXNFbGVtZW50ID0gJGlzRWxlbWVudChhbmd1bGFyLmVsZW1lbnQoZS50YXJnZXQpLCBlbGVtLCAkZG9jdW1lbnQpOworICAgICAgICAgICAgaWYoIWlzRWxlbWVudCkgeworICAgICAgICAgICAgICAgIHNjb3BlLmNhbmNlbCgpOworICAgICAgICAgICAgICAgIHNjb3BlLiRhcHBseSgpOworICAgICAgICAgICAgfQorICAgICAgICB9OworICAgICAgICAkZG9jdW1lbnRCaW5kLmNsaWNrKCdzaG93RHJvcGRvd25MaXN0Jywgb3V0c2lkZUNsaWNrLCBzY29wZSk7CisgICAgfTsKKworICAgIHJldHVybiB7CisgICAgICAgIHJlc3RyaWN0OiAnRUEnLAorICAgICAgICBzY29wZTogeworICAgICAgICAgICAgZnJvbTogJz0/ZnJvbScsCisgICAgICAgICAgICBjdXJyZW50OiAiPT9jdXJyZW50IgorICAgICAgICB9LAorICAgICAgICByZXBsYWNlOiB0cnVlLAorICAgICAgICByZXF1aXJlOiAnP25nTW9kZWwnLAorICAgICAgICB0cmFuc2NsdWRlOnRydWUsCisgICAgICAgIHRlbXBsYXRlVXJsOiAnYXBwL3NjcmlwdHMvbmdfanNfYXR0X3RwbHMvZGF0ZXBpY2tlci9kYXRlRmlsdGVyLmh0bWwnLAorICAgICAgICBjb250cm9sbGVyOlsnJHNjb3BlJywgJyRlbGVtZW50JywgJyRhdHRycycsZnVuY3Rpb24oJHNjb3BlKXsKKyAgICAgICAgICAgICRzY29wZS5kYXRlUmFuZ2UgPSB7CisgICAgICAgICAgICAgICAgc2VsZWN0aW9uOiB1bmRlZmluZWQsCisgICAgICAgICAgICAgICAgZnJvbTogdW5kZWZpbmVkLAorICAgICAgICAgICAgICAgIGN1cnJlbnQ6IHVuZGVmaW5lZAorICAgICAgICAgICAgfTsKKyAgICAgICAgICAgIHRoaXMuc2VsZWN0T3B0aW9uID0gZnVuY3Rpb24gKGZyb21EYXRlLHRvRGF0ZSxjYXB0aW9uKSB7CisgICAgICAgICAgICAgICAgJHNjb3BlLnNlbGVjdGVkT3B0aW9uID0gY2FwdGlvbjsKKyAgICAgICAgICAgICAgICAkc2NvcGUuY3VycmVudFNlbGVjdGlvbiA9Y2FwdGlvbjsKKyAgICAgICAgICAgICAgICAkc2NvcGUuZGF0ZVJhbmdlLnNlbGVjdGlvbiA9IGNhcHRpb247CisgICAgICAgICAgICAgICAgJHNjb3BlLmRhdGVSYW5nZS5jdXJyZW50ID0gJHNjb3BlLnJlc2V0VGltZSh0b0RhdGUpOworICAgICAgICAgICAgICAgICRzY29wZS5kYXRlUmFuZ2UuZnJvbSA9ICRzY29wZS5yZXNldFRpbWUoZnJvbURhdGUpOworICAgICAgICAgICAgICAgICRzY29wZS5zaG93RHJvcGRvd24oKTsKKyAgICAgICAgfTsKKyAgICAgICAgICRzY29wZS5jaGVja0N1cnJlbnRTZWxlY3Rpb249dGhpcy5jaGVja0N1cnJlbnRTZWxlY3Rpb24gPSBmdW5jdGlvbih2YWx1ZSkgeworICAgICAgICAgICAgaWYodmFsdWUgPT09ICRzY29wZS5jdXJyZW50U2VsZWN0aW9uKSB7CisgICAgICAgICAgICAgICAgcmV0dXJuIHRydWU7CisgICAgICAgICAgICB9CisgICAgICAgICAgICByZXR1cm4gZmFsc2U7CisgICAgICAgIH07CisgICAgICAgIH1dLAorICAgICAgICBjb21waWxlOiBmdW5jdGlvbihlbGVtLCBhdHRyKSB7CisgICAgICAgICAgICB2YXIgc2luZ2xlRGF0ZUNhbGVuZGFyID0gZWxlbS5maW5kKCdzcGFuJykuZXEoNCk7CisgICAgICAgICAgICB2YXIgcmFuZ2VDYWxlbmRhciA9IGVsZW0uZmluZCgnc3BhbicpLmVxKDUpOworICAgICAgICAgICAgcmFuZ2VDYWxlbmRhci5hdHRyKCdmcm9tJywgJ2Zyb21EYXRlJyk7CisgICAgICAgICAgICBzaW5nbGVEYXRlQ2FsZW5kYXIuYXR0cignY3VycmVudCcsICdjdXJyZW50RGF0ZScpOworICAgICAgICAgICAgcmFuZ2VDYWxlbmRhci5hdHRyKCdjdXJyZW50JywgJ2N1cnJlbnREYXRlJyk7CisgICAgICAgICAgICBkYXRlcGlja2VyU2VydmljZS5zZXRBdHRyaWJ1dGVzKGF0dHIsIHNpbmdsZURhdGVDYWxlbmRhcik7CisgICAgICAgICAgICBkYXRlcGlja2VyU2VydmljZS5zZXRBdHRyaWJ1dGVzKGF0dHIsIHJhbmdlQ2FsZW5kYXIpOworCisgICAgICAgICAgICByZXR1cm4gbGluazsKKyAgICAgICAgfQorICAgIH07Cit9XSkKKy5kaXJlY3RpdmUoJ2F0dERhdGVGaWx0ZXJMaXN0JyxmdW5jdGlvbigpeworICAgIHJldHVybnsKKyAgICAgICAgcmVzdHJpY3Q6J0VBJywKKyAgICAgICAgc2NvcGU6eworICAgICAgICAgICAgZnJvbURhdGU6Jz1mcm9tRGF0ZScsCisgICAgICAgICAgICB0b0RhdGU6Jz10b0RhdGUnLAorICAgICAgICAgICAgY2FwdGlvbjonPWNhcHRpb24nLAorICAgICAgICAgICAgZGlzYWJsZWQ6Jz1kaXNhYmxlZCcKKyAgICAgICAgfSwKKyAgICAgICAgcmVxdWlyZTonXmF0dERhdGVGaWx0ZXInLAorICAgICAgICB0cmFuc2NsdWRlOnRydWUsCisgICAgICAgIHJlcGxhY2U6dHJ1ZSwKKyAgICAgICAgdGVtcGxhdGVVcmw6J2FwcC9zY3JpcHRzL25nX2pzX2F0dF90cGxzL2RhdGVwaWNrZXIvZGF0ZUZpbHRlckxpc3QuaHRtbCcsCisgICAgICAgIGxpbms6ZnVuY3Rpb24oc2NvcGUsZWxlbSxhdHRyLGN0cmwpeworICAgICAgICAgICAgc2NvcGUuc2VsZWN0T3B0aW9uPWZ1bmN0aW9uKGZyb21EYXRlLHRvRGF0ZSxjYXB0aW9uKXsKKyAgICAgICAgICAgICAgICBjdHJsLnNlbGVjdE9wdGlvbihmcm9tRGF0ZSx0b0RhdGUsY2FwdGlvbik7CisgICAgICAgICAgICB9OworICAgICAgICAgICAgc2NvcGUuY2hlY2tDdXJyZW50U2VsZWN0aW9uPWN0cmwuY2hlY2tDdXJyZW50U2VsZWN0aW9uOworICAgICAgICB9CisgICAgfTsKK30pOworYW5ndWxhci5tb2R1bGUoJ2F0dC5hYnMuZGV2Tm90ZXMnLCBbXSkKKworICAuZGlyZWN0aXZlKCdhdHREZXZOb3RlcycsIGZ1bmN0aW9uKCkgeworICAgIHJldHVybiB7CisgICAgICByZXN0cmljdDogJ0VBJywKKyAgICAgIHRyYW5zY2x1ZGU6IHRydWUsCisgICAgICBzY29wZToge30sCisgICAgICBjb250cm9sbGVyOiBmdW5jdGlvbigkc2NvcGUpeworICAgICAgICB2YXIgcGFuZXMgPSAkc2NvcGUucGFuZXMgPSBbXTsKKyAgICAgICAgJHNjb3BlLnNlbGVjdCA9IGZ1bmN0aW9uKHBhbmUpCisgICAgICAgIHsKKyAgICAgICAgICAgIGFuZ3VsYXIuZm9yRWFjaChwYW5lcywgZnVuY3Rpb24ocGFuZSkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBwYW5lLnNlbGVjdGVkID0gZmFsc2U7CisgICAgICAgICAgICB9KTsKKyAgICAgICAgICAgIHBhbmUuc2VsZWN0ZWQgPSB0cnVlOworICAgICAgICB9OworICAgICAgICB0aGlzLmFkZFBhbmUgPSBmdW5jdGlvbihwYW5lKSB7CisgICAgICAgICAgICBpZiAocGFuZXMubGVuZ3RoID09PSAwKSB7CisgICAgICAgICAgICAgICAgJHNjb3BlLnNlbGVjdChwYW5lKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICBwYW5lcy5wdXNoKHBhbmUpOworICAgICAgICB9OworICAgICAgfSwKKyAgICAgIHRlbXBsYXRlOic8ZGl2PicrCisgICAgICAgICc8dWwgY2xhc3M9InRhYnMiPicgKworICAgICAgICAgICAgJzxsaSBuZy1yZXBlYXQ9InBhbmUgaW4gcGFuZXMiIG5nLWNsYXNzPSJ7YWN0aXZlOnBhbmUuc2VsZWN0ZWR9Ij4nKworICAgICAgICAgICAgICAnPGEgaHJlZj0iamF2YXNjcmlwdDp2b2lkKDApIiBuZy1jbGljaz0ic2VsZWN0KHBhbmUpIj57e3BhbmUudGl0bGV9fTwvYT4nICsKKyAgICAgICAgICAgICc8L2xpPicgKworICAgICAgICAgICc8L3VsPicgKworICAgICAgICAgICc8ZGl2IG5nLXRyYW5zY2x1ZGU+PC9kaXY+JysKKyAgICAgICAgICAnPC9kaXY+JywKKyAgICAgICAgICByZXBsYWNlOiB0cnVlCisgICAgfTsKKyAgfSkKKworICAuZGlyZWN0aXZlKCdwYW5lJywgZnVuY3Rpb24oKSB7CisgICAgcmV0dXJuIHsKKyAgICAgIHJlcXVpcmU6ICdeYXR0RGV2Tm90ZXMnLAorICAgICAgcmVzdHJpY3Q6ICdFQScsCisgICAgICB0cmFuc2NsdWRlOiB0cnVlLAorICAgICAgc2NvcGU6IHsKKyAgICAgICAgICB0aXRsZTogJ0AnCisgICAgICB9LAorICAgICAgbGluazogZnVuY3Rpb24oc2NvcGUsIGVsZW1lbnQsIGF0dHJzLCB0YWJzQ3RybCkgeworICAgICAgICB0YWJzQ3RybC5hZGRQYW5lKHNjb3BlKTsKKyAgICAgIH0sCisgICAgICB0ZW1wbGF0ZToKKyAgICAgICAgJzxkaXYgY2xhc3M9InRhYi1wYW5lIiBuZy1jbGFzcz0ie2FjdGl2ZTogc2VsZWN0ZWR9Ij4nICsKKyAgICAgICAgJzxwcmUgbmctY2xhc3M9IntcJ2xhbmd1YWdlLW1hcmt1cFwnOnRpdGxlPT1cJ0hUTUxcJyxcJ2xhbmd1YWdlLWphdmFzY3JpcHRcJzp0aXRsZT09XCdKYXZhU2NyaXB0XCcsXCdsYW5ndWFnZS1qc29uXCc6dGl0bGU9PVwnSlNPTlwnfSIgIGNsYXNzPSIgbGluZS1udW1iZXJzIj4nICsKKyAgICAgICAgICc8Y29kZSBuZy10cmFuc2NsdWRlPjwvY29kZT4nICsKKyAgICAgICAgICc8L3ByZT4nICsKKyAgICAgICAgJzwvZGl2PicsCisgICAgICByZXBsYWNlOiB0cnVlCisgICAgfTsKKyAgfSk7CisKK2FuZ3VsYXIubW9kdWxlKCdhdHQuYWJzLmRpdmlkZXJMaW5lcycsIFtdKQorICAgICAgICAuZGlyZWN0aXZlKCdhdHREaXZpZGVyTGluZXMnLCBbZnVuY3Rpb24oKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIHJldHVybiB7CisgICAgICAgICAgICAgICAgICAgIHNjb3BlOiB7CisgICAgICAgICAgICAgICAgICAgICAgICBhdHREaXZpZGVyTGluZXM6ICdAJworICAgICAgICAgICAgICAgICAgICB9LAorICAgICAgICAgICAgICAgICAgICByZXN0cmljdDogJ0EnLAorICAgICAgICAgICAgICAgICAgICByZXBsYWNlOiB0cnVlLAorICAgICAgICAgICAgICAgICAgICB0ZW1wbGF0ZVVybDogJ2FwcC9zY3JpcHRzL25nX2pzX2F0dF90cGxzL2RpdmlkZXJMaW5lcy9kaXZpZGVyTGluZXMuaHRtbCcsCisgICAgICAgICAgICAgICAgICAgIGxpbms6IGZ1bmN0aW9uKHNjb3BlLCBlbGVtZW50LCBhdHRyaWJ1dGUpCisgICAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIHNjb3BlLmxpZ2h0Q29udGFpbmVyID0gYXR0cmlidXRlLmF0dERpdmlkZXJMaW5lczsKKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIH07CisgICAgICAgICAgICB9XSk7CisKK2FuZ3VsYXIubW9kdWxlKCdhdHQuYWJzLmRyYWdkcm9wJywgW10pCisgICAgICAgIC5kaXJlY3RpdmUoJ2F0dEZpbGVEcm9wJywgWyckcGFyc2UnLCBmdW5jdGlvbigkcGFyc2UpIHsKKyAgICAgICAgICAgICAgICByZXR1cm4geworICAgICAgICAgICAgICAgICAgICByZXN0cmljdDogJ0EnLAorICAgICAgICAgICAgICAgICAgICBzY29wZTogeworICAgICAgICAgICAgICAgICAgICAgICAgZmlsZU1vZGVsIDogJz0nLAorICAgICAgICAgICAgICAgICAgICAgICAgb25Ecm9wIDogJyYnLAorICAgICAgICAgICAgICAgICAgICAgICAgYXR0RmlsZURyb3AgOiAnJicKKyAgICAgICAgICAgICAgICAgICAgfSwKKyAgICAgICAgICAgICAgICAgICAgY29udHJvbGxlcjogWyckc2NvcGUnLCAnJGF0dHJzJywgZnVuY3Rpb24oJHNjb3BlLCAkYXR0cnMpeworICAgICAgICAgICAgICAgICAgICAgICAgaWYoJGF0dHJzLmF0dEZpbGVEcm9wIT09IiIpeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICRzY29wZS5vbkRyb3A9JHNjb3BlLmF0dEZpbGVEcm9wOworICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgdGhpcy5vbkRyb3AgPSAkc2NvcGUub25Ecm9wOworICAgICAgICAgICAgICAgICAgICB9XSwKKyAgICAgICAgICAgICAgICAgICAgbGluazogZnVuY3Rpb24oc2NvcGUsIGVsZW1lbnQpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIGVsZW1lbnQuYWRkQ2xhc3MoJ2RyYWdkcm9wJyk7CisgICAgICAgICAgICAgICAgICAgICAgICBlbGVtZW50LmJpbmQoCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgJ2RyYWdvdmVyJywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBmdW5jdGlvbihlKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmKGUub3JpZ2luYWxFdmVudCl7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBlLmRhdGFUcmFuc2ZlciA9IGUub3JpZ2luYWxFdmVudC5kYXRhVHJhbnNmZXI7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZS5kYXRhVHJhbnNmZXIuZHJvcEVmZmVjdCA9ICdtb3ZlJzsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gYWxsb3dzIHVzIHRvIGRyb3AKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGUucHJldmVudERlZmF1bHQpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGUucHJldmVudERlZmF1bHQoKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBlbGVtZW50LmFkZENsYXNzKCdkcmFnZHJvcC1vdmVyJyk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBmYWxzZTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICApOworICAgICAgICAgICAgICAgICAgICAgICAgZWxlbWVudC5iaW5kKAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICdkcmFnZW50ZXInLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZ1bmN0aW9uKGUpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gYWxsb3dzIHVzIHRvIGRyb3AKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGUucHJldmVudERlZmF1bHQpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGUucHJldmVudERlZmF1bHQoKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBlbGVtZW50LmFkZENsYXNzKCdkcmFnZHJvcC1vdmVyJyk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBmYWxzZTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICApOworICAgICAgICAgICAgICAgICAgICAgICAgZWxlbWVudC5iaW5kKAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICdkcmFnbGVhdmUnLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZ1bmN0aW9uKCkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBlbGVtZW50LnJlbW92ZUNsYXNzKCdkcmFnZHJvcC1vdmVyJyk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBmYWxzZTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICApOworICAgICAgICAgICAgICAgICAgICAgICAgZWxlbWVudC5iaW5kKAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICdkcm9wJywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBmdW5jdGlvbihlKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vIFN0b3BzIHNvbWUgYnJvd3NlcnMgZnJvbSByZWRpcmVjdGluZy4KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYoZS5wcmV2ZW50RGVmYXVsdCkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZS5wcmV2ZW50RGVmYXVsdCgpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChlLnN0b3BQcm9wYWdhdGlvbikgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZS5zdG9wUHJvcGFnYXRpb24oKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZihlLm9yaWdpbmFsRXZlbnQpeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZS5kYXRhVHJhbnNmZXIgPSBlLm9yaWdpbmFsRXZlbnQuZGF0YVRyYW5zZmVyOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGVsZW1lbnQucmVtb3ZlQ2xhc3MoJ2RyYWdkcm9wLW92ZXInKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYoZS5kYXRhVHJhbnNmZXIuZmlsZXMgJiYgZS5kYXRhVHJhbnNmZXIuZmlsZXMubGVuZ3RoID4gMCl7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzY29wZS5maWxlTW9kZWwgPSBlLmRhdGFUcmFuc2Zlci5maWxlc1swXTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNjb3BlLiRhcHBseSgpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYodHlwZW9mIHNjb3BlLm9uRHJvcCA9PT0gImZ1bmN0aW9uIil7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2NvcGUub25Ecm9wID0gJHBhcnNlKHNjb3BlLm9uRHJvcCk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2NvcGUub25Ecm9wKCk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGZhbHNlOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgICk7CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICB9OworICAgICAgICAgICAgfV0pCisgICAgICAgIC5kaXJlY3RpdmUoJ2F0dEZpbGVMaW5rJywgWyBmdW5jdGlvbigpIHsKKyAgICAgICAgICAgICAgICByZXR1cm4geworICAgICAgICAgICAgICAgICAgICByZXN0cmljdDogJ0VBJywKKyAgICAgICAgICAgICAgICAgICAgcmVxdWlyZTogJ14/YXR0RmlsZURyb3AnLAorICAgICAgICAgICAgICAgICAgICByZXBsYWNlOiB0cnVlLAorICAgICAgICAgICAgICAgICAgICB0cmFuc2NsdWRlOiB0cnVlLAorICAgICAgICAgICAgICAgICAgICB0ZW1wbGF0ZVVybDogJ2FwcC9zY3JpcHRzL25nX2pzX2F0dF90cGxzL2RyYWdkcm9wL2ZpbGVVcGxvYWQuaHRtbCcsCisgICAgICAgICAgICAgICAgICAgIHNjb3BlOiB7CisgICAgICAgICAgICAgICAgICAgICAgICBmaWxlTW9kZWwgOiAnPT8nLAorICAgICAgICAgICAgICAgICAgICAgICAgb25GaWxlU2VsZWN0IDogJyYnLAorICAgICAgICAgICAgICAgICAgICAgICAgYXR0RmlsZUxpbmsgOiAnJicKKyAgICAgICAgICAgICAgICAgICAgfSwKKyAgICAgICAgICAgICAgICAgICAgY29udHJvbGxlcjogWyckc2NvcGUnLCAnJHBhcnNlJywgZnVuY3Rpb24oJHNjb3BlLCAkcGFyc2UpeworICAgICAgICAgICAgICAgICAgICAgICAgdGhpcy5zZXRGaWxlTW9kZWw9IGZ1bmN0aW9uKGZpbGVNb2RlbCl7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYoJHNjb3BlLnRha2VGaWxlTW9kZWxGcm9tUGFyZW50KXsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJHNjb3BlLiRwYXJlbnQuZmlsZU1vZGVsID0gZmlsZU1vZGVsOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAkc2NvcGUuJHBhcmVudC4kYXBwbHkoKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgZWxzZXsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJHNjb3BlLmZpbGVNb2RlbCA9IGZpbGVNb2RlbDsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJHNjb3BlLiRhcHBseSgpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgIH07CisgICAgICAgICAgICAgICAgICAgICAgICB0aGlzLmNhbGxiYWNrRnVuY3Rpb249IGZ1bmN0aW9uKCl7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYodHlwZW9mICRzY29wZS5vbkZpbGVTZWxlY3QgPT09ICJmdW5jdGlvbiIpeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAkc2NvcGUub25GaWxlU2VsZWN0ID0gJHBhcnNlKCRzY29wZS5vbkZpbGVTZWxlY3QpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAkc2NvcGUub25GaWxlU2VsZWN0KCk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgfTsKKyAgICAgICAgICAgICAgICAgICAgICAKKyAgICAgICAgICAgICAgICAgICAgfV0sCisgICAgICAgICAgICAgICAgICAgIGxpbms6IGZ1bmN0aW9uKHNjb3BlLCBlbGVtZW50LCBhdHRyLCBhdHRGaWxlRHJvcEN0cmwpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIHNjb3BlLnRha2VGaWxlTW9kZWxGcm9tUGFyZW50ID0gZmFsc2U7CisgICAgICAgICAgICAgICAgICAgICAgICBpZighKGF0dHIuZmlsZU1vZGVsKSAmJiBhdHRGaWxlRHJvcEN0cmwpeworICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNjb3BlLnRha2VGaWxlTW9kZWxGcm9tUGFyZW50ID0gdHJ1ZTsKKyAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgIGlmKGF0dHIuYXR0RmlsZUxpbmshPT0iIil7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2NvcGUub25GaWxlU2VsZWN0PXNjb3BlLmF0dEZpbGVMaW5rOworICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgZWxzZSBpZighKGF0dHIub25GaWxlU2VsZWN0KSAmJiBhdHRGaWxlRHJvcEN0cmwpeworICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNjb3BlLm9uRmlsZVNlbGVjdCA9IGF0dEZpbGVEcm9wQ3RybC5vbkRyb3A7CisgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICB9OworICAgICAgICAgICAgfV0pCisgICAgICAgIC5kaXJlY3RpdmUoJ2F0dEZpbGVDaGFuZ2UnLCBbJyRsb2cnLCckcm9vdFNjb3BlJyxmdW5jdGlvbigkbG9nLCRyb290U2NvcGUpIHsKKyAgICAgICAgICAgICAgICByZXR1cm4geworICAgICAgICAgICAgICAgICAgICByZXN0cmljdDogJ0EnLAorICAgICAgICAgICAgICAgICAgICByZXF1aXJlOiAnXmF0dEZpbGVMaW5rJywKKyAgICAgICAgICAgICAgICAgICAgbGluazogZnVuY3Rpb24oc2NvcGUsIGVsZW1lbnQsIGF0dHIsIGF0dEZpbGVMaW5rQ3RybCkgeworICAgICAgICAgICAgICAgICAgICAgICAgZWxlbWVudC5iaW5kKCdjaGFuZ2UnLGNoYW5nZUZpbGVNb2RlbCk7CisgICAgICAgICAgICAgICAgICAgICAgICBmdW5jdGlvbiBjaGFuZ2VGaWxlTW9kZWwoZSkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChlLnRhcmdldC5maWxlcyAmJiBlLnRhcmdldC5maWxlcy5sZW5ndGggPiAwKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGF0dEZpbGVMaW5rQ3RybC5zZXRGaWxlTW9kZWwoZS50YXJnZXQuZmlsZXNbMF0pOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBhdHRGaWxlTGlua0N0cmwuY2FsbGJhY2tGdW5jdGlvbigpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBlbHNlIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFyIHN0ckZpbGVOYW1lID0gZS50YXJnZXQudmFsdWU7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRyeSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YXIgb2JqRlNPID0gbmV3IEFjdGl2ZVhPYmplY3QoIlNjcmlwdGluZy5GaWxlU3lzdGVtT2JqZWN0Iik7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBhdHRGaWxlTGlua0N0cmwuc2V0RmlsZU1vZGVsKG9iakZTTy5nZXRGaWxlKHN0ckZpbGVOYW1lKSk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBhdHRGaWxlTGlua0N0cmwuY2FsbGJhY2tGdW5jdGlvbigpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNhdGNoIChlKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YXIgZXJyTXNnID0gIkVycm9yOiBQbGVhc2UgZm9sbG93IHRoZSBndWlkZWxpbmVzIG9mIERyYWcgYW5kIERyb3AgY29tcG9uZW50IG9uIFNhbmRib3ggZGVtbyBwYWdlLiI7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAkbG9nLmVycm9yKGVyck1zZyk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAkcm9vdFNjb3BlLiRicm9hZGNhc3QoJ2F0dC1maWxlLWxpbmstZmFpbHVyZScsIGVyck1zZyk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICB9OworICAgICAgICAgICAgfV0pOworYW5ndWxhci5tb2R1bGUoImF0dC5hYnMuZHJhd2VyIiwgWydhdHQuYWJzLnV0aWxpdGllcyddKQorLmRpcmVjdGl2ZSgnYXR0RHJhd2VyJywgWyckZG9jdW1lbnQnLCAnJHRpbWVvdXQnLCAnRE9NSGVscGVyJywgZnVuY3Rpb24gKCRkb2N1bWVudCwgJHRpbWVvdXQsIERPTUhlbHBlcikgeworICAgICAgICByZXR1cm4geworICAgICAgICAgICAgcmVzdHJpY3Q6ICdFQScsCisgICAgICAgICAgICByZXBsYWNlOiB0cnVlLAorICAgICAgICAgICAgdHJhbnNjbHVkZTogdHJ1ZSwKKyAgICAgICAgICAgIHNjb3BlOiB7CisgICAgICAgICAgICAgICAgZHJhd2VyT3BlbjogIj0/IiwKKyAgICAgICAgICAgICAgICBkcmF3ZXJBdXRvQ2xvc2U6ICImPyIKKyAgICAgICAgICAgIH0sCisgICAgICAgICAgICB0ZW1wbGF0ZTogJzxkaXY+PGRpdiBjbGFzcz0iYXR0LWRyYXdlciIgbmctdHJhbnNjbHVkZT48L2Rpdj48ZGl2IG5nLWNsYXNzPSJ7XCdkcmF3ZXItYmFja2Ryb3BcJzpkcmF3ZXJPcGVufSI+PC9kaXY+PC9kaXY+JywKKyAgICAgICAgICAgIGxpbms6IGZ1bmN0aW9uICgkc2NvcGUsIGVsZW1lbnQsIGF0dHJzKSB7CisgICAgICAgICAgICAgICAgdmFyIHBhcmFtID0ge307CisgICAgICAgICAgICAgICAgLy8gRmlyc3QgRWxlbWVudCBpbiBEcmF3ZXIgY29tcG9uZW50CisgICAgICAgICAgICAgICAgdmFyIGZpcnN0RWxlbWVudCA9IHVuZGVmaW5lZDsKKyAgICAgICAgICAgICAgICAvLyBFbGVtZW50IGRyYXdlciBpcyB0b2dnbGVkIGZyb20KKyAgICAgICAgICAgICAgICB2YXIgZHJhd2VyTGF1bmNoaW5nRWxlbWVudCA9IHVuZGVmaW5lZDsKKyAgICAgICAgICAgICAgICAvLyBPdmVycmlkZSBkZWZhdWx0IHBhcmFtZXRlcnMKKyAgICAgICAgICAgICAgICBwYXJhbS5zaWRlID0gYXR0cnMuZHJhd2VyU2xpZGUgfHwgJ3RvcCc7CisgICAgICAgICAgICAgICAgcGFyYW0uc3BlZWQgPSBhdHRycy5kcmF3ZXJTcGVlZCB8fCAnMC4yNSc7CisgICAgICAgICAgICAgICAgcGFyYW0uc2l6ZSA9IGF0dHJzLmRyYXdlclNpemUgfHwgJzMwMHB4JzsKKyAgICAgICAgICAgICAgICBwYXJhbS56aW5kZXggPSBhdHRycy5kcmF3ZXJaaW5kZXggfHwgMTAwMDsKKyAgICAgICAgICAgICAgICBwYXJhbS5jbGFzc05hbWUgPSBhdHRycy5kcmF3ZXJDbGFzcyB8fCAnYXR0LWRyYXdlcic7CisgICAgICAgICAgICAgICAgdmFyIHNsaWRlciA9IGVsZW1lbnQuZXEoMCkuY2hpbGRyZW4oKVswXTsKKyAgICAgICAgICAgICAgICB2YXIgY29udGVudCA9IGFuZ3VsYXIuZWxlbWVudChzbGlkZXIpLmNoaWxkcmVuKClbMF07CisgICAgICAgICAgICAgICAgc2xpZGVyLmNsYXNzTmFtZSA9IHBhcmFtLmNsYXNzTmFtZTsKKyAgICAgICAgICAgICAgICAvKiBTdHlsZSBzZXR1cCAqLworICAgICAgICAgICAgICAgIHNsaWRlci5zdHlsZS50cmFuc2l0aW9uRHVyYXRpb24gPSBwYXJhbS5zcGVlZCArICdzJzsKKyAgICAgICAgICAgICAgICBzbGlkZXIuc3R5bGUud2Via2l0VHJhbnNpdGlvbkR1cmF0aW9uID0gcGFyYW0uc3BlZWQgKyAncyc7CisgICAgICAgICAgICAgICAgc2xpZGVyLnN0eWxlLnpJbmRleCA9IHBhcmFtLnppbmRleDsKKyAgICAgICAgICAgICAgICBzbGlkZXIuc3R5bGUucG9zaXRpb24gPSAnZml4ZWQnOworICAgICAgICAgICAgICAgIHNsaWRlci5zdHlsZS53aWR0aCA9IDA7CisgICAgICAgICAgICAgICAgc2xpZGVyLnN0eWxlLmhlaWdodCA9IDA7CisgICAgICAgICAgICAgICAgc2xpZGVyLnN0eWxlLnRyYW5zaXRpb25Qcm9wZXJ0eSA9ICd3aWR0aCwgaGVpZ2h0JzsKKyAgICAgICAgICAgICAgICBpZihwYXJhbS5zaWRlPT09J3JpZ2h0Jyl7CisgICAgICAgICAgICAgICAgICAgIHNsaWRlci5zdHlsZS5oZWlnaHQgPSBhdHRycy5kcmF3ZXJDdXN0b21IZWlnaHQgfHwgJzEwMCUnOworICAgICAgICAgICAgICAgICAgICBzbGlkZXIuc3R5bGUudG9wID0gYXR0cnMuZHJhd2VyQ3VzdG9tVG9wIHx8ICAnMHB4JzsKKyAgICAgICAgICAgICAgICAgICAgc2xpZGVyLnN0eWxlLmJvdHRvbSA9IGF0dHJzLmRyYXdlckN1c3RvbUJvdHRvbSB8fCAgJzBweCc7CisgICAgICAgICAgICAgICAgICAgIHNsaWRlci5zdHlsZS5yaWdodCA9IGF0dHJzLmRyYXdlckN1c3RvbVJpZ2h0IHx8ICAnMHB4JzsKKyAgICAgICAgICAgICAgICB9ZWxzZSBpZihwYXJhbS5zaWRlPT09J2xlZnQnKXsgICAgICAvKkFkZGVkIHRoaXMgcGFydCBmb3IgRUNPTSovCisgICAgICAgICAgICAgICAgCXNsaWRlci5zdHlsZS5oZWlnaHQgPSBhdHRycy5kcmF3ZXJDdXN0b21IZWlnaHQgfHwgJzEwMCUnOworICAgICAgICAgICAgICAgIAlzbGlkZXIuc3R5bGUudG9wID0gYXR0cnMuZHJhd2VyQ3VzdG9tVG9wIHx8ICAnMHB4JzsKKyAgICAgICAgICAgICAgICAJc2xpZGVyLnN0eWxlLmJvdHRvbSA9IGF0dHJzLmRyYXdlckN1c3RvbUJvdHRvbSB8fCAgJzBweCc7CisgICAgICAgICAgICAgICAgCXNsaWRlci5zdHlsZS5sZWZ0ID0gYXR0cnMuZHJhd2VyQ3VzdG9tUmlnaHQgfHwgICcwcHgnOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICBlbHNlIGlmKHBhcmFtLnNpZGU9PT0ndG9wJyB8fCBwYXJhbS5zaWRlPT09J2JvdHRvbScpeworICAgICAgICAgICAgICAgICAgICBzbGlkZXIuc3R5bGUud2lkdGggPSBhdHRycy5kcmF3ZXJDdXN0b21XaWR0aCB8fCAnMTAwJSc7CisgICAgICAgICAgICAgICAgICAgIHNsaWRlci5zdHlsZS5sZWZ0ID0gYXR0cnMuZHJhd2VyQ3VzdG9tTGVmdCB8fCAnMHB4JzsKKyAgICAgICAgICAgICAgICAgICAgc2xpZGVyLnN0eWxlLnRvcCA9IGF0dHJzLmRyYXdlckN1c3RvbVRvcCB8fCAnMHB4JzsKKyAgICAgICAgICAgICAgICAgICAgc2xpZGVyLnN0eWxlLnJpZ2h0ID0gYXR0cnMuZHJhd2VyQ3VzdG9tUmlnaHQgfHwgJzBweCc7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICR0aW1lb3V0KGZ1bmN0aW9uKCkgeworICAgICAgICAgICAgICAgICAgICBmaXJzdEVsZW1lbnQgPSBET01IZWxwZXIuZmlyc3RUYWJhYmxlRWxlbWVudChlbGVtZW50WzBdKTsKKyAgICAgICAgICAgICAgICB9LCAxMCwgZmFsc2UpOworICAgICAgICAgICAgICAgIC8qIENsb3NlZCAqLworICAgICAgICAgICAgICAgIGZ1bmN0aW9uIGRyYXdlckNsb3NlKHNsaWRlciwgcGFyYW0pIHsKKyAgICAgICAgICAgICAgICAgICAgaWYgKHNsaWRlciAmJiBzbGlkZXIuc3R5bGUud2lkdGggIT09IDAgJiYgc2xpZGVyLnN0eWxlLmhlaWdodCAhPT0gMCl7CisgICAgICAgICAgICAgICAgICAgICAgICBjb250ZW50LnN0eWxlLmRpc3BsYXkgPSAnbm9uZSc7CisgICAgICAgICAgICAgICAgICAgICAgICBpZihwYXJhbS5zaWRlPT09J3JpZ2h0JyB8fCBwYXJhbS5zaWRlPT09J2xlZnQnKXsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBzbGlkZXIuc3R5bGUud2lkdGggPSAnMHB4JzsKKyAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgIGVsc2UgaWYocGFyYW0uc2lkZT09PSd0b3AnIHx8IHBhcmFtLnNpZGU9PT0nYm90dG9tJyl7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2xpZGVyLnN0eWxlLmhlaWdodCA9ICcwcHgnOworICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICRzY29wZS5kcmF3ZXJPcGVuID0gZmFsc2U7CisgICAgICAgICAgICAgICAgICAgIC8vIFNoaWZ0IGZvY3VzCisgICAgICAgICAgICAgICAgICAgIGlmIChhbmd1bGFyLmlzRGVmaW5lZChkcmF3ZXJMYXVuY2hpbmdFbGVtZW50KSAmJiBkcmF3ZXJMYXVuY2hpbmdFbGVtZW50ICE9IG51bGwpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIGRyYXdlckxhdW5jaGluZ0VsZW1lbnQuZm9jdXMoKTsKKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAvKiBPcGVuICovCisgICAgICAgICAgICAgICAgZnVuY3Rpb24gZHJhd2VyT3BlbihzbGlkZXIsIHBhcmFtKSB7CisgICAgICAgICAgICAgICAgICAgIC8vIEJlZm9yZSBvcGVuaW5nIGRyYXdlciwgZmluZCB0aGUgZm9jdXNlZCBlbGVtZW50CisgICAgICAgICAgICAgICAgICAgIGRyYXdlckxhdW5jaGluZ0VsZW1lbnQgPSBkb2N1bWVudC5hY3RpdmVFbGVtZW50OworICAgICAgICAgICAgICAgICAgICBpZiAoc2xpZGVyLnN0eWxlLndpZHRoICE9PSAwICYmIHNsaWRlci5zdHlsZS5oZWlnaHQgIT09IDApeworICAgICAgICAgICAgICAgICAgICAgICAgaWYocGFyYW0uc2lkZT09PSdyaWdodCcgfHwgcGFyYW0uc2lkZT09PSdsZWZ0Jyl7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2xpZGVyLnN0eWxlLndpZHRoID0gcGFyYW0uc2l6ZTsKKyAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgIGVsc2UgaWYocGFyYW0uc2lkZT09PSd0b3AnIHx8IHBhcmFtLnNpZGU9PT0nYm90dG9tJyl7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2xpZGVyLnN0eWxlLmhlaWdodCA9IHBhcmFtLnNpemU7CisgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICAkdGltZW91dChmdW5jdGlvbigpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb250ZW50LnN0eWxlLmRpc3BsYXkgPSAnYmxvY2snOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vIFNoaWZ0IGZvY3VzCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGFuZ3VsYXIuaXNEZWZpbmVkKGZpcnN0RWxlbWVudCkgJiYgZmlyc3RFbGVtZW50ICE9IG51bGwpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZmlyc3RFbGVtZW50LmZvY3VzKCk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgfSwocGFyYW0uc3BlZWQgKiAxMDAwKSk7CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgZnVuY3Rpb24gaXNGdW5jdGlvbihmdW5jdGlvblRvQ2hlY2spIHsKKyAgICAgICAgICAgICAgICAgICAgdmFyIGdldFR5cGUgPSB7fTsKKyAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGZ1bmN0aW9uVG9DaGVjayAmJiBnZXRUeXBlLnRvU3RyaW5nLmNhbGwoZnVuY3Rpb25Ub0NoZWNrKSA9PT0gJ1tvYmplY3QgRnVuY3Rpb25dJzsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgLyoKKyAgICAgICAgICAgICAgICAqIFdhdGNoZXJzCisgICAgICAgICAgICAgICAgKiAqLworICAgICAgICAgICAgICAgIGlmKGF0dHJzLmRyYXdlclNpemUpIHsKKyAgICAgICAgICAgICAgICAgICAgJHNjb3BlLiR3YXRjaChmdW5jdGlvbigpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBhdHRycy5kcmF3ZXJTaXplOworICAgICAgICAgICAgICAgICAgICB9LCBmdW5jdGlvbihuZXdWYWwpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIHBhcmFtLnNpemUgPSBuZXdWYWw7CisgICAgICAgICAgICAgICAgICAgICAgICBpZigkc2NvcGUuZHJhd2VyT3BlbikgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRyYXdlck9wZW4oc2xpZGVyLHBhcmFtKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgfSk7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICRzY29wZS4kd2F0Y2goImRyYXdlck9wZW4iLCBmdW5jdGlvbiAodmFsdWUpeworICAgICAgICAgICAgICAgICAgICBpZiAoISF2YWx1ZSkgeworICAgICAgICAgICAgICAgICAgICAgICAgLy8gT3BlbgorICAgICAgICAgICAgICAgICAgICAgICAgZHJhd2VyT3BlbihzbGlkZXIscGFyYW0pOworICAgICAgICAgICAgICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgICAgICAgICAgICAgLy8gQ2xvc2UKKyAgICAgICAgICAgICAgICAgICAgICAgIGRyYXdlckNsb3NlKHNsaWRlcixwYXJhbSk7CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICB9KTsKKyAgICAgICAgICAgICAgICAvLyBjbG9zZSBwYW5lbCBvbiBsb2NhdGlvbiBjaGFuZ2UKKyAgICAgICAgICAgICAgICBpZigkc2NvcGUuZHJhd2VyQXV0b0Nsb3NlKCkpIHsKKyAgICAgICAgICAgICAgICAgICAgJHNjb3BlLiRvbigiJGxvY2F0aW9uQ2hhbmdlU3RhcnQiLCBmdW5jdGlvbigpeworICAgICAgICAgICAgICAgICAgICAgICAgZHJhd2VyQ2xvc2Uoc2xpZGVyLCBwYXJhbSk7CisgICAgICAgICAgICAgICAgICAgICAgICBpZihpc0Z1bmN0aW9uKCRzY29wZS5kcmF3ZXJBdXRvQ2xvc2UoKSkpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAkc2NvcGUuZHJhd2VyQXV0b0Nsb3NlKCk7CisgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgIH0pOworICAgICAgICAgICAgICAgICAgICAkc2NvcGUuJG9uKCIkc3RhdGVDaGFuZ2VTdGFydCIsIGZ1bmN0aW9uKCl7CisgICAgICAgICAgICAgICAgICAgICAgICBkcmF3ZXJDbG9zZShzbGlkZXIsIHBhcmFtKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIGlmKGlzRnVuY3Rpb24oJHNjb3BlLmRyYXdlckF1dG9DbG9zZSkpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAkc2NvcGUuZHJhd2VyQXV0b0Nsb3NlKCk7CisgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgIH0pOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0KKyAgICAgICAgfTsKKyAgICB9CitdKTsKK2FuZ3VsYXIubW9kdWxlKCdhdHQuYWJzLm1lc3NhZ2UnLCBbXSkKKworLmRpcmVjdGl2ZSgnYXR0TWVzc2FnZXMnLCBbZnVuY3Rpb24oKSB7CisgICAgcmV0dXJuIHsKKyAgICAgICAgcmVzdHJpY3Q6ICdFQScsCisgICAgICAgIHNjb3BlOiB7CisgICAgICAgICAgICBtZXNzYWdlVHlwZTogJz0/JworICAgICAgICB9LAorICAgICAgICBjb250cm9sbGVyOiBbJyRzY29wZScsICckZWxlbWVudCcsICckYXR0cnMnLCBmdW5jdGlvbigkc2NvcGUsICRlbGVtZW50LCAkYXR0cnMpIHsKKyAgICAgICAgICAgICRzY29wZS5tZXNzYWdlU2NvcGUgPSBbXTsKKyAgICAgICAgICAgIHRoaXMucmVnaXN0ZXJTY29wZSA9IGZ1bmN0aW9uKG1lc3NhZ2VTY29wZSkgeworICAgICAgICAgICAgICAgICRzY29wZS5tZXNzYWdlU2NvcGUucHVzaChtZXNzYWdlU2NvcGUpOworICAgICAgICAgICAgfTsKKyAgICAgICAgICAgICRzY29wZS4kcGFyZW50LiR3YXRjaENvbGxlY3Rpb24oJGF0dHJzWydmb3InXSwgZnVuY3Rpb24oZXJyb3JzKSB7CisgICAgICAgICAgICAgICAgZm9yICh2YXIga2V5IGluIGVycm9ycykgeworICAgICAgICAgICAgICAgICAgICBpZiAoZXJyb3JzW2tleV0pIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICRzY29wZS5lcnJvciA9IGtleTsKKyAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgICAgICAgICAgICAgJHNjb3BlLmVycm9yID0gbnVsbDsKKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICBmb3IgKHZhciBpID0gMDsgaSA8ICRzY29wZS5tZXNzYWdlU2NvcGUubGVuZ3RoOyBpKyspIHsKKyAgICAgICAgICAgICAgICAgICAgaWYoJHNjb3BlLm1lc3NhZ2VTY29wZVtpXS53aGVuID09PSAkc2NvcGUuZXJyb3IpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICRzY29wZS5tZXNzYWdlU2NvcGVbaV0uc2hvdygpOworICAgICAgICAgICAgICAgICAgICAgICAgJHNjb3BlLnNldE1lc3NhZ2VUeXBlKCRzY29wZS5tZXNzYWdlU2NvcGVbaV0udHlwZSk7CisgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICAgICAgICAgICAgICAkc2NvcGUubWVzc2FnZVNjb3BlW2ldLmhpZGUoKTsKKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICBpZigkc2NvcGUuZXJyb3IgPT09IG51bGwpIHsKKyAgICAgICAgICAgICAgICAgICAgJHNjb3BlLnNldE1lc3NhZ2VUeXBlKG51bGwpOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0pOworICAgICAgICAgICAgJHNjb3BlLnNldE1lc3NhZ2VUeXBlID0gdGhpcy5zZXRNZXNzYWdlVHlwZSA9IGZ1bmN0aW9uKG1lc3NhZ2VUeXBlKSB7CisgICAgICAgICAgICAgICAgaWYoJGF0dHJzLm1lc3NhZ2VUeXBlKSB7CisgICAgICAgICAgICAgICAgICAgICRzY29wZS5tZXNzYWdlVHlwZSA9IG1lc3NhZ2VUeXBlOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH07CisgICAgICAgIH1dCisgICAgfTsKK31dKQorCisuZGlyZWN0aXZlKCdhdHRNZXNzYWdlJywgW2Z1bmN0aW9uKCkgeworICAgIHJldHVybiB7CisgICAgICAgIHJlc3RyaWN0OiAnRUEnLAorICAgICAgICBzY29wZToge30sCisgICAgICAgIHJlcXVpcmU6ICdeYXR0TWVzc2FnZXMnLAorICAgICAgICBsaW5rOiBmdW5jdGlvbihzY29wZSwgZWxlbSwgYXR0ciwgY3RybCkgeworICAgICAgICAgICAgY3RybC5yZWdpc3RlclNjb3BlKHNjb3BlKTsKKyAgICAgICAgICAgIGVsZW0uYXR0cigncm9sZScsICdhbGVydCcpOyAvL1RyaW5pdHkgQ0FUTworICAgICAgICAgICAgc2NvcGUud2hlbiA9IGF0dHIud2hlbiB8fCBhdHRyLmF0dE1lc3NhZ2U7CisgICAgICAgICAgICBzY29wZS50eXBlID0gYXR0ci50eXBlOworICAgICAgICAgICAgc2NvcGUuc2hvdyA9IGZ1bmN0aW9uKCkgeworICAgICAgICAgICAgICAgIGVsZW0uY3NzKHtkaXNwbGF5OiAnYmxvY2snfSk7CisgICAgICAgICAgICB9OworICAgICAgICAgICAgc2NvcGUuaGlkZSA9IGZ1bmN0aW9uKCkgeworICAgICAgICAgICAgICAgIGVsZW0uY3NzKHtkaXNwbGF5OiAnbm9uZSd9KTsKKyAgICAgICAgICAgIH07CisgICAgICAgICAgICBzY29wZS5oaWRlKCk7CisgICAgICAgIH0KKyAgICB9OworfV0pOworCithbmd1bGFyLm1vZHVsZSgnYXR0LmFicy5mb3JtRmllbGQnLCBbJ2F0dC5hYnMubWVzc2FnZScsICdhdHQuYWJzLnV0aWxpdGllcyddKQorLmRpcmVjdGl2ZSgnYXR0Rm9ybUZpZWxkJywgW2Z1bmN0aW9uKCkgeworICAgIHJldHVybiB7CisgICAgICAgIHByaW9yaXR5OiAxMDEsCisgICAgICAgIHJlc3RyaWN0OiAnQScsCisgICAgICAgIGNvbnRyb2xsZXI6ZnVuY3Rpb24oKSB7CisgICAgICAgIH0sCisgICAgICAgIGxpbms6IGZ1bmN0aW9uKHNjb3BlLCBlbGVtLCBhdHRyKSB7CisgICAgICAgICAgICBl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taGlkZScpOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0pOworICAgICAgICB9CisgICAgfTsKK31dKQorLmRpcmVjdGl2ZSgnYXR0Rm9ybUZpZWxkVmFsaWRhdGlvbicsIFsnJGNvbXBpbGUnLCAnJGxvZycsIGZ1bmN0aW9uKCRjb21waWxlLCAkbG9nKSB7CisgICAgcmV0dXJuIHsKKyAgICAgICAgcHJpb3JpdHk6IDEwMiwKKyAgICAgICAgc2NvcGU6IHt9LAorICAgICAgICByZXN0cmljdDogJ0EnLAorICAgICAgICByZXF1aXJlOiBbJz9uZ01vZGVsJywgJz9hdHRGb3JtRmllbGQnXSwKKyAgICAgICAgbGluazogZnVuY3Rpb24oc2NvcGUsIGVsZW0sIGF0dHIsIGN0cmwpIHsKKyAgICAgICAgICAgIHZhciBuZ0N0cmwgPSBjdHJsWzBdOworICAgICAgICAgICAgdmFyIGF0dEZvcm1GaWVsZEN0cmwgPSBjdHJsWzFdOworICAgICAgICAgICAgc2NvcGUudmFsaWQgPSAiIjsKKyAgICAgICAgICAgIGlmICghbmdDdHJsKSB7CisgICAgICAgICAgICAgICAgJGxvZy5lcnJvcigiYXR0LWZvcm0tZmllbGQtdmFsaWRhdGlvbiA6OiBuZy1tb2RlbCBkaXJlY3RpdmUgaXMgcmVxdWlyZWQuIik7CisgICAgICAgICAgICAgICAgcmV0dXJuOworICAgICAgICAgICAgfQorICAgICAgICAgICAgaWYgKCFhdHRGb3JtRmllbGRDdHJsKSB7CisgICAgICAgICAgICAgICAgJGxvZy5lcnJvcigiYXR0LWZvcm0tZmllbGQtdmFsaWRhdGlvbiA6OiBhdHQtZm9ybS1maWVsZCBkaXJlY3RpdmUgaXMgcmVxdWlyZWQuIik7CisgICAgICAgICAgICAgICAgcmV0dXJuOworICAgICAgICAgICAgfQorCisgICAgICAgICAgICBlbGVtLnBhcmVudCgpLmFwcGVuZCgkY29tcGlsZShhbmd1bGFyLmVsZW1lbnQoJzxpIGNsYXNzPSJpY29uLWluZm8tYWxlcnQgZXJyb3IiIG5nLXNob3c9InZhbGlkPT09ZmFsc2UiPiZuYnNwOzwvaT4nKSkoc2NvcGUpKTsKKyAgICAgICAgICAgIGVsZW0ucGFyZW50KCkuYXBwZW5kKCRjb21waWxlKGFuZ3VsYXIuZWxlbWVudCgnPGkgY2xhc3M9Imljb24taW5mby1zdWNjZXNzIHN1Y2Nlc3MiIG5nLXNob3c9InZhbGlkPT09dHJ1ZSI+Jm5ic3A7PC9pPicpKShzY29wZSkpOworCisgICAgICAgICAgICBzY29wZS4kd2F0Y2goJ3ZhbGlkJywgZnVuY3Rpb24odmFsdWUpIHsKKyAgICAgICAgICAgICAgICBpZiAodmFsdWUpIHsKKyAgICAgICAgICAgICAgICAgICAgZWxlbS5wYXJlbnQoKS5wYXJlbnQoKS5hZGRDbGFzcygnc3VjY2VzcycpOworICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAodmFsdWUgPT09IGZhbHNlKSB7CisgICAgICAgICAgICAgICAgICAgIGVsZW0ucGFyZW50KCkucGFyZW50KCkuYWRkQ2xhc3MoJ2Vycm9yJyk7CisgICAgICAgICAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgICAgICAgICAgZWxlbS5wYXJlbnQoKS5wYXJlbnQoKS5yZW1vdmVDbGFzcygnc3VjY2VzcycpLnJlbW92ZUNsYXNzKCdlcnJvcicpOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0pOworCisgICAgICAgICAgICBlbGVtLmJpbmQoJ2tleXVwJywgZnVuY3Rpb24oKSB7CisgICAgICAgICAgICAgICAgaWYgKG5nQ3RybC4kdmFsaWQpIHsKKyAgICAgICAgICAgICAgICAgICAgc2NvcGUudmFsaWQgPSB0cnVlOworICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAobmdDdHJsLiRpbnZhbGlkKSB7CisgICAgICAgICAgICAgICAgICAgIHNjb3BlLnZhbGlkID0gZmFsc2U7CisgICAgICAgICAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgICAgICAgICAgc2NvcGUudmFsaWQgPSAiIjsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgc2NvcGUuJGFwcGx5KCk7CisgICAgICAgICAgICB9KTsKKyAgICAgICAgfQorICAgIH07Cit9XSkKKy5kaXJlY3RpdmUoJ2F0dEZvcm1GaWVsZFZhbGlkYXRpb25BbGVydCcsIFsnJHRpbWVvdXQnLCBmdW5jdGlvbigkdGltZW91dCkgeworICAgICAgICByZXR1cm4geworICAgICAgICBzY29wZTogeworICAgICAgICAgICAgbWVzc2FnZVR5cGU6ICc9PycKKyAgICAgICAgfSwKKyAgICAgICAgcmVzdHJpY3Q6ICdFQScsCisgICAgICAgIHJlcGxhY2U6IHRydWUsCisgICAgICAgIHRyYW5zY2x1ZGU6IHRydWUsCisgICAgICAgIHRlbXBsYXRlVXJsOiAnYXBwL3NjcmlwdHMvbmdfanNfYXR0X3RwbHMvZm9ybUZpZWxkL2F0dEZvcm1GaWVsZFZhbGlkYXRpb25BbGVydC5odG1sJywKKyAgICAgICAgbGluazogZnVuY3Rpb24oc2NvcGUsIGVsZW0sIGF0dHIsIGN0cmwpIHsKKyAgICAgICAgICAgIHNjb3BlLnNob3dMYWJlbCA9IGZhbHNlOworICAgICAgICAgICAgc2NvcGUuaGlkZUxhYmVsID0gZmFsc2U7CisgICAgICAgICAgICBzY29wZS5lcnJvck1lc3NhZ2UgPSBmYWxzZTsKKyAgICAgICAgICAgIHNjb3BlLndhcm5pbmdNZXNzYWdlID0gZmFsc2U7CisgICAgICAgICAgICB2YXIgY2hlY2tNZXNzYWdlVHlwZSA9IGZ1bmN0aW9uKCkgeworICAgICAgICAgICAgICAgIHZhciBtZXNzYWdlVHlwZSA9IHNjb3BlLm1lc3NhZ2VUeXBlOworICAgICAgICAgICAgICAgIGlmIChtZXNzYWdlVHlwZSA9PT0gJ2Vycm9yJykgeworICAgICAgICAgICAgICAgICAgICBzY29wZS5lcnJvck1lc3NhZ2UgPSB0cnVlOworICAgICAgICAgICAgICAgICAgICBzY29wZS53YXJuaW5nTWVzc2FnZSA9IGZhbHNlOworICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAobWVzc2FnZVR5cGUgPT09ICd3YXJuaW5nJykgeworICAgICAgICAgICAgICAgICAgICBzY29wZS5lcnJvck1lc3NhZ2UgPSBmYWxzZTsKKyAgICAgICAgICAgICAgICAgICAgc2NvcGUud2FybmluZ01lc3NhZ2UgPSB0cnVlOworICAgICAgICAgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICAgICAgICAgIHNjb3BlLmVycm9yTWVzc2FnZSA9IGZhbHNlOworICAgICAgICAgICAgICAgICAgICBzY29wZS53YXJuaW5nTWVzc2FnZSA9IGZhbHNlOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH07CisgICAgICAgICAgICB2YXIgb2xkSUUgPSBuYXZpZ2F0b3IudXNlckFnZW50LnRvTG93ZXJDYXNlKCkuaW5kZXhPZignbXNpZSA4LjAnKSAhPT0gLTE7CisgICAgICAgICAgICBlbGVtLmZpbmQoJ2xhYmVsJykudGV4dChlbGVtLmZpbmQoJ2lucHV0JykuYXR0cigncGxhY2Vob2xkZXInKSk7CisgICAgICAgICAgICBlbGVtLmZpbmQoJ2lucHV0JykuYmluZCgna2V5dXAnLCBmdW5jdGlvbigpIHsKKyAgICAgICAgICAgICAgICBpZiAodGhpcy52YWx1ZSAhPT0gJycpIHsKKyAgICAgICAgICAgICAgICAgICAgc2NvcGUuc2hvd0xhYmVsID0gdHJ1ZTsKKyAgICAgICAgICAgICAgICAgICAgc2NvcGUuaGlkZUxhYmVsID0gZmFsc2U7CisgICAgICAgICAgICAgICAgICAgIGlmIChvbGRJRSkgeworICAgICAgICAgICAgICAgICAgICAgICAgZWxlbS5maW5kKCdsYWJlbCcpLmNzcyh7dG9wOiAnLTIwcHgnfSk7CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgICAgICAgICBzY29wZS5zaG93TGFiZWwgPSBmYWxzZTsKKyAgICAgICAgICAgICAgICAgICAgc2NvcGUuaGlkZUxhYmVsID0gdHJ1ZTsKKyAgICAgICAgICAgICAgICAgICAgaWYgKG9sZElFKSB7CisgICAgICAgICAgICAgICAgICAgICAgICBlbGVtLmZpbmQoJ2xhYmVsJykuY3NzKHt0b3A6ICcwcHgnfSk7CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgY2hlY2tNZXNzYWdlVHlwZSgpOworICAgICAgICAgICAgICAgIHNjb3BlLiRhcHBseSgpOworICAgICAgICAgICAgfSk7CisKKyAgICAgICAgICAgIGVsZW0uZmluZCgnaW5wdXQnKS5iaW5kKCdibHVyJywgZnVuY3Rpb24oKSB7CisgICAgICAgICAgICAgICAgaWYgKHRoaXMudmFsdWUgPT09ICcnKSB7CisgICAgICAgICAgICAgICAgICAgIHNjb3BlLnNob3dMYWJlbCA9IGZhbHNlOworICAgICAgICAgICAgICAgICAgICBzY29wZS5oaWRlTGFiZWwgPSBmYWxzZTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgc2NvcGUuJGFwcGx5KCk7CisgICAgICAgICAgICB9KTsKKyAgICAgICAgICAgICR0aW1lb3V0KGZ1bmN0aW9uKCkgeworICAgICAgICAgICAgICAgIGNoZWNrTWVzc2FnZVR5cGUoKTsKKyAgICAgICAgICAgIH0sIDEwMCk7CisgICAgICAgIH0KKyAgICB9OworfV0pCisuY29uc3RhbnQoIkNvcmVGb3Jtc1VpQ29uZmlnIiwgeworICAgICAgICAgICAgcGhvbmVNYXNrOiAnKF9fXykgX19fLV9fX18nCisgICAgICAgIH0pCisuZGlyZWN0aXZlKCdhdHRQaG9uZU1hc2snLCBbJyRwYXJzZScsICdDb3JlRm9ybXNVaUNvbmZpZycsIGZ1bmN0aW9uKCRwYXJzZSwgQ29yZUZvcm1zVWlDb25maWcpIHsKKyAgICAgICAgICAgICAgICByZXR1cm4geworICAgICAgICAgICAgICAgICAgICByZXF1aXJlOiAnbmdNb2RlbCcsCisgICAgICAgICAgICAgICAgICAgIHNjb3BlOiB7CisgICAgICAgICAgICAgICAgICAgICAgICBuZ01vZGVsOiAnPScKKyAgICAgICAgICAgICAgICAgICAgfSwKKyAgICAgICAgICAgICAgICAgICAgbGluazogZnVuY3Rpb24oc2NvcGUsIGlFbGVtZW50LCBpQXR0cnMsIGN0cmwpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIHZhciBCID0gbmF2aWdhdG9yLnVzZXJBZ2VudC50b0xvd2VyQ2FzZSgpLCBDID0gQi5pbmRleE9mKCJhbmRyb2lkIikgPiAtMSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgb2xkSUUgPSBCLmluZGV4T2YoJ21zaWUgOC4wJykgIT09IC0xOzsKKyAgICAgICAgICAgICAgICAgICAgICAgIHZhciBBID0gJyc7CisgICAgICAgICAgICAgICAgICAgICAgICB2YXIgdmFsaWRQaG9uZU51bWJlciA9IGZhbHNlOworICAgICAgICAgICAgICAgICAgICAgICAgaWYgKEMpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBBID0gIl9fX19fX19fX18iOworICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgZWxzZSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgQSA9IENvcmVGb3Jtc1VpQ29uZmlnLnBob25lTWFzazsKKyAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgIGlFbGVtZW50LmF0dHIoIm1heGxlbmd0aCIsIEEubGVuZ3RoKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIHZhciBjaGVja1ZhbGlkaXR5ID0gZnVuY3Rpb24odW5tYXNrZWRWYWx1ZSkgeworICAgICAgICAgICAgICAgICAgICAgICAgdmFyIHZhbGlkID0gZmFsc2U7CisgICAgICAgICAgICAgICAgICAgICAgICBpZiAodW5tYXNrZWRWYWx1ZSl7CisgICAgICAgICAgICAgICAgICAgICAgICB2YWxpZCA9ICh1bm1hc2tlZFZhbHVlLmxlbmd0aCA9PT0gMTApO30KKyAgICAgICAgICAgICAgICAgICAgICAgIGN0cmwuJHNldFZhbGlkaXR5KCdpbnZhbGlkUGhvbmVOdW1iZXInLCB2YWxpZFBob25lTnVtYmVyKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIGN0cmwuJHNldFZhbGlkaXR5KCdtYXNrJywgdmFsaWQpOworICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHZhbGlkOworICAgICAgICAgICAgICAgICAgICAgICAgfTsKKyAgICAgICAgICAgICAgICAgICAgICAgIAorICAgICAgICAgICAgICAgICAgICAgICAgdmFyIGhhbmRsZUtleXVwID0gZnVuY3Rpb24oKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFyIEUsRCA9IGN0cmwuJG1vZGVsVmFsdWU7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKCFELmxlbmd0aCkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm47CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhciBMLCBLLCBHLCBKLCBJOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIEogPSBbXTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBHID0gQS5zcGxpdCgiIik7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgSSA9IEcubGVuZ3RoOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIEwgPSBELnN1YnN0cmluZygwLCBBLmxlbmd0aCk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgSyA9IEQucmVwbGFjZSgvW14wLTldL2csICIiKS5zcGxpdCgiIik7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgZm9yIChFID0gMDsgRSA8IEk7IEUrKykgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBKLnB1c2goR1tFXSA9PT0gIl8iID8gSy5zaGlmdCgpIDogR1tFXSk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChLLmxlbmd0aCA9PT0gMCkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgRCA9IEouam9pbigiIik7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKEQgPT09ICcoJyl7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEQgPSAnJzt9CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgY3RybC4kc2V0Vmlld1ZhbHVlKEQpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGN0cmwuJHJlbmRlcigpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBEOworICAgICAgICAgICAgICAgICAgICAgICAgfTsKKworCisgICAgICAgICAgICAgICAgICAgICAgICAvLyBzaW5jZSB3ZSBhcmUgb25seSBhbGxvd2luZyAwLTksIHdoeSBldmVuIGxldCB0aGUga2V5cHJlc3MgZ28gZm9yd2FyZD8KKyAgICAgICAgICAgICAgICAgICAgICAgIC8vIGFsc28gYWRkZWQgaW4gZGVsZXRlLi4uIGluIGNhc2UgdGhleSB3YW50IHRvIGRlbGV0ZSA6KQorICAgICAgICAgICAgICAgICAgICAgICAgdmFyIGhhbmRsZVByZXNzID0gZnVuY3Rpb24oZSkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChlLndoaWNoKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICgoZS53aGljaCA8IDQ4IHx8IGUud2hpY2ggPiA1NykgJiYgKGUud2hpY2ggPCA5NiB8fCBlLndoaWNoID4gMTA1KSkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoZS53aGljaCAhPT0gOCAmJiBlLndoaWNoICE9PSA5ICYmIGUud2hpY2ggIT09IDQ2ICYmIGUud2hpY2ggIT09IDEzICYmIGUud2hpY2ggIT09IDM3ICYmIGUud2hpY2ggIT09IDM5ICYmCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vIEFsbG93OiBDdHJsK1YvdgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoZS5jdHJsS2V5ICE9PSB0cnVlICYmIChlLndoaWNoICE9PSAnMTE4JyB8fCBlLndoaWNoICE9PSAnODYnKSkmJgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gQWxsb3c6IEN0cmwrQy9jCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChlLmN0cmxLZXkgIT09IHRydWUgJiYgKGUud2hpY2ggIT09ICc5OScgfHwgZS53aGljaCAhPT0gJzY3JykpJiYKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gQWxsb3c6IEN0cmwrWC94CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChlLmN0cmxLZXkgIT09IHRydWUgJiYgKGUud2hpY2ggIT09ICcxMjAnIHx8IGUud2hpY2ggIT09ICc4OCcpKSkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgeworCQkJCQkJZS5wcmV2ZW50RGVmYXVsdCA/IGUucHJldmVudERlZmF1bHQoKSA6IGUucmV0dXJuVmFsdWUgPSBmYWxzZTsKKwkJCQkJCWlFbGVtZW50LmF0dHIoImFyaWEtbGFiZWwiLCJPbmx5IG51bWJlcnMgYXJlIGFsbG93ZWQiKTsKKwkJCQkJCXZhbGlkUGhvbmVOdW1iZXIgPSBmYWxzZTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfX0KKwkJCQllbHNleworCQkJCQlpRWxlbWVudC5yZW1vdmVBdHRyKCJhcmlhLWxhYmVsIik7CisJCQkJCXZhbGlkUGhvbmVOdW1iZXIgPSB0cnVlOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2NvcGUuJGFwcGx5KCk7CisgICAgICAgICAgICAgICAgICAgICAgICB9OworICAgICAgICAgICAgICAgICAgICAgICAgLy8gaSBtb3ZlZCB0aGlzIG91dCBiZWNhdXNlIGkgdGhvdWdodCBpIG1pZ2h0IG5lZWQgZm9jdXMgYXMgd2VsbC4uCisgICAgICAgICAgICAgICAgICAgICAgICAvLyB0byBoYW5kbGUgc2V0dGluZyB0aGUgbW9kZWwgYXMgdGhlIHZpZXcgY2hhbmdlcworICAgICAgICAgICAgICAgICAgICAgICAgdmFyIHBhcnNlciA9IGZ1bmN0aW9uKGZyb21WaWV3VmFsdWUpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YXIgbGV0dGVycyA9IC9eW0EtWmEtel0rJC87CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFyIG51bWJlcnMgPSAvXlswLTldKyQvOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmKGZyb21WaWV3VmFsdWUubWF0Y2gobGV0dGVycykpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHt2YWxpZFBob25lTnVtYmVyID0gZmFsc2U7fQorICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmKGZyb21WaWV3VmFsdWUubWF0Y2gobnVtYmVycykpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHt2YWxpZFBob25lTnVtYmVyID0gdHJ1ZTt9CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFyIGNsZWFuID0gIiI7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGZyb21WaWV3VmFsdWUgJiYgZnJvbVZpZXdWYWx1ZS5sZW5ndGggPiAwKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNsZWFuID0gZnJvbVZpZXdWYWx1ZS5yZXBsYWNlKC9bXjAtOV0vZywgJycpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBjaGVja1ZhbGlkaXR5KGNsZWFuKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gY2xlYW47CisgICAgICAgICAgICAgICAgICAgICAgICB9OworCisgICAgICAgICAgICAgICAgICAgICAgICAvL3RvIGhhbmRsZSByZWFkaW5nIHRoZSBtb2RlbCBhbmQgZm9ybWF0dGluZyBpdAorICAgICAgICAgICAgICAgICAgICAgICAgdmFyIGZvcm1hdHRlciA9IGZ1bmN0aW9uKGZyb21Nb2RlbFZpZXcpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YXIgaW5wdXQgPSAnJzsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBjaGVja1ZhbGlkaXR5KGZyb21Nb2RlbFZpZXcpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChmcm9tTW9kZWxWaWV3KXsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaW5wdXQgPSBoYW5kbGVLZXl1cCgpO30KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gaW5wdXQ7CisgICAgICAgICAgICAgICAgICAgICAgICB9OworICAgICAgICAgICAgICAgICAgICAgICAgY3RybC4kcGFyc2Vycy5wdXNoKHBhcnNlcik7CisgICAgICAgICAgICAgICAgICAgICAgICBjdHJsLiRmb3JtYXR0ZXJzLnB1c2goZm9ybWF0dGVyKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIGlFbGVtZW50LmJpbmQoJ2tleXVwJywgaGFuZGxlS2V5dXApOworICAgICAgICAgICAgICAgICAgICAgICAgaUVsZW1lbnQuYmluZCgna2V5ZG93bicsIGhhbmRsZVByZXNzKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIGlFbGVtZW50LmJpbmQoJ2lucHV0JywgZnVuY3Rpb24oZSl7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgaGFuZGxlS2V5dXAoZSk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgaGFuZGxlUHJlc3MoZSk7CisgICAgICAgICAgICAgICAgICAgICAgICB9KTsKKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIH07Cit9XSkKKy5jb25zdGFudCgndmFsaWRhdGlvblR5cGVJbnQnLCB7CisgICAgICAgICAgICB2YWxpZGF0aW9uTnVtOiB7J251bWJlcic6JzEnLCd0ZXh0JzonMicsJ2VtYWlsJzonMyd9CisgICAgICAgIH0pICAgICAgICAKKy5kaXJlY3RpdmUoJ2F0dEZvcm1GaWVsZFBydicsIFsgJ2tleU1hcEFjJywgJ3ZhbGlkYXRpb25UeXBlSW50JywgZnVuY3Rpb24oIGtleU1hcEFjLCB2YWxpZGF0aW9uVHlwZUludCApIHsKKyAgICByZXR1cm4geworICAgICAgICBwcmlvcml0eTogMTAxLAorICAgICAgICByZXN0cmljdDogJ0FFJywKKwkJY29udHJvbGxlcjpbJyRzY29wZScsIGZ1bmN0aW9uKCRzY29wZSkgeworCQkJdGhpcy5zaG93SGlkZUVycm9yTWVzc2FnZSA9IGZ1bmN0aW9uICggYm9vbGVhblZhbHVlICl7CisJCQkJaWYoICAkc2NvcGUuJCRwcmV2U2libGluZyAhPSBudWxsICYmIGFuZ3VsYXIuaXNEZWZpbmVkKCAkc2NvcGUuJCRwcmV2U2libGluZyApCisJCQkJCSYmIGFuZ3VsYXIuaXNEZWZpbmVkKCAkc2NvcGUuJCRwcmV2U2libGluZy5oaWRlRXJyb3JNc2cgKSApeworCQkJCQkkc2NvcGUuJCRwcmV2U2libGluZy5oaWRl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HBlbiBvbiBudW1lcmljIGFuZCBhbHBoYW51bWVyaWMgZmllbGRzICovCisJCQllbGVtLmJpbmQoJ2tleXByZXNzJywgZnVuY3Rpb24oIGV2ZW50ICl7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmKCEoZXZlbnQud2hpY2gpKXsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmKGV2ZW50LmtleUNvZGUpeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGV2ZW50LndoaWNoID0gZXZlbnQua2V5Q29kZTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGVsc2UgaWYoZXZlbnQuY2hhckNvZGUpeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGV2ZW50LndoaWNoID0gZXZlbnQuY2hhckNvZGU7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KKwkJCQl2YXIgY2hhckZvdW5kID0gYXR0Rm9ybUZpZWxkQ3RybC5maW5kQWxsb3dlZENoYXJhY3RvciggZXZlbnQud2hpY2ggKTsKKwkJCQl2YXIgaW5zaWRlQ29uZE9uZSA9ICggYW5ndWxhci5pc0RlZmluZWQoIHNjb3BlLnZhbGlkYXRpb25UeXBlICkgJiYgc2NvcGUudmFsaWRhdGlvblR5cGUgIT09ICcnKTsKKwkJCQl2YXIgaW5zaWRlQ29uZFR3byA9ICggZXZlbnQud2hpY2ggIT09IGFsbG93ZWRLZXlzWydUQUInXQorCQkJCQkmJiBldmVudC53aGljaCAhPT0gYWxsb3dlZEtleXNbJ0JBQ0tTUEFDRSddICYmIGV2ZW50LndoaWNoIT09IGFsbG93ZWRLZXlzWydERUxFVEUnXSApOworCQkJCXZhciBnb0luc2lkZSA9IGluc2lkZUNvbmRPbmUgJiYgaW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sdEZvcm1hdCA9IC8oXGR7MSw0fSkvZzsKKyAgICAgICAgdmFyIGRlZmF1bHRJbnB1dEZvcm1hdCA9IC8oPzpefFxzKShcZHs0fSkkLzsKKyAgICAgICAgdmFyIGNhcmRzID0gWworICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIHR5cGU6ICdkaXNjb3ZlcicsCisgICAgICAgICAgICAgICAgcGF0dGVybjogL14oNjAxMXw2NXw2NFs0LTldfDYyMikvLAorICAgICAgICAgICAgICAgIGZvcm1hdDogZGVmYXVsdEZvcm1hdCwKKyAgICAgICAgICAgICAgICBpbnB1dEZvcm1hdDogZGVmYXVsdElucHV0Rm9ybWF0LAorICAgICAgICAgICAgICAgIGxlbmd0aDogWzE2XSwKKyAgICAgICAgICAgICAgICBjdmNMZW5ndGg6IFszXSwKKyAgICAgICAgICAgICAgICBjdmNTZWN1cml0eUltZzogJ3Zpc2FJJywKKyAgICAgICAgICAgICAgICB6aXBMZW5ndGg6IFs1XSwKKyAgICAgICAgICAgICAgICBsdWhuOiB0cnVlCisgICAgICAgICAgICB9LAorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIHR5cGU6ICdtYycsCisgICAgICAgICAgICAgICAgcGF0dGVybjogL141WzEtNV0vLAorICAgICAgICAgICAgICAgIGZvcm1hdDogZGVmYXVsdEZvcm1hdCwKKyAgICAgICAgICAgICAgICBpbnB1dEZvcm1hdDogZGVmYXVsdElucHV0Rm9ybWF0LAorICAgICAgICAgICAgICAgIGxlbmd0aDogWzE2XSwKKyAgICAgICAgICAgICAgICBjdmNMZW5ndGg6IFszXSwKKyAgICAgICAgICAgICAgICBjdmNTZWN1cml0eUltZzogJ3Zpc2FJJywKKyAgICAgICAgICAgICAgICB6aXBMZW5ndGg6IFs1XSwKKyAgICAgICAgICAgICAgICBsdWhuOiB0cnVlCisgICAgICAgICAgICB9LAorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIHR5cGU6ICdhbWV4JywKKyAgICAgICAgICAgICAgICBwYXR0ZXJuOiAvXjNbNDddLywKKyAgICAgICAgICAgICAgICBmb3JtYXQ6IC8oXGR7MSw0fSkoXGR7MSw2fSk/KFxkezEsNX0pPy8sCisgICAgICAgICAgICAgICAgaW5wdXRGb3JtYXQ6IC9eKFxkezR9fFxkezR9XHNcZHs2fSkkLywKKyAgICAgICAgICAgICAgICBsZW5ndGg6IFsxNV0sCisgICAgICAgICAgICAgICAgY3ZjTGVuZ3RoOiBbNF0sCisgICAgICAgICAgICAgICAgY3ZjU2VjdXJpdHlJbWc6ICdhbWV4SScsCisgICAgICAgICAgICAgICAgemlwTGVuZ3RoOiBbNV0sCisgICAgICAgICAgICAgICAgbHVobjogdHJ1ZQorICAgICAgICAgICAgfSwKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICB0eXBlOiAndmlzYScsCisgICAgICAgICAgICAgICAgcGF0dGVybjogL140LywKKyAgICAgICAgICAgICAgICBmb3JtYXQ6IGRlZmF1bHRGb3JtYXQsCisgICAgICAgICAgICAgICAgaW5wdXRGb3JtYXQ6IGRlZmF1bHRJbnB1dEZvcm1hdCwKKyAgICAgICAgICAgICAgICBsZW5ndGg6IFsxNl0sCisgICAgICAgICAgICAgICAgY3ZjTGVuZ3RoOiBbM10sCisgICAgICAgICAgICAgICAgY3ZjU2VjdXJpdHlJbWc6ICd2aXNhSScsCisgICAgICAgICAgICAgICAgemlwTGVuZ3RoOiBbNV0sCisgICAgICAgICAgICAgICAgbHVobjogdHJ1ZQorICAgICAgICAgICAgfQorICAgICAgICBdOworCisgICAgICAgIHZhciBfZnJvbU51bWJlciA9IGZ1bmN0aW9uKG51bSkgeworICAgICAgICAgICAgdmFyIGNhcmQsIGksIGxlbjsKKworICAgICAgICAgICAgbnVtID0gKG51bSArICcnKS5yZXBsYWNlKC9cRC9nLCAnJyk7CisKKyAgICAgICAgICAgIGZvciAoaSA9IDAsIGxlbiA9IGNhcmRzLmxlbmd0aDsgaSA8IGxlbjsgaSsrKSB7CisKKyAgICAgICAgICAgICAgICBjYXJkID0gY2FyZHNbaV07CisKKyAgICAgICAgICAgICAgICBpZiAoY2FyZC5wYXR0ZXJuLnRlc3QobnVtKSkgeworICAgICAgICAgICAgICAgICAgICByZXR1cm4gY2FyZDsKKyAgICAgICAgICAgICAgICB9CisKKyAgICAgICAgICAgIH0KKyAgICAgICAgfTsKKworICAgICAgICB2YXIgX2Zyb21UeXBlID0gZnVuY3Rpb24odHlwZSkgeworICAgICAgICAgICAgdmFyIGNhcmQsIGksIGxlbjsKKworICAgICAgICAgICAgZm9yIChpID0gMCwgbGVuID0gY2FyZHMubGVuZ3RoOyBpIDwgbGVuOyBpKyspIHsKKworICAgICAgICAgICAgICAgIGNhcmQgPSBjYXJkc1tpXTsKKworICAgICAgICAgICAgICAgIGlmIChjYXJkLnR5cGUgPT09IHR5cGUpIHsKKyAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGNhcmQ7CisgICAgICAgICAgICAgICAgfQorCisgICAgICAgICAgICB9CisgICAgICAgIH07CisKKyAgICAgICAgcmV0dXJuIHsKKyAgICAgICAgICAgIGZyb21OdW1iZXI6IGZ1bmN0aW9uKHZhbCkgeworICAgICAgICAgICAgICAgIHJldHVybiBfZnJvbU51bWJlcih2YWwpOworICAgICAgICAgICAgfSwKKyAgICAgICAgICAgIGZyb21UeXBlOiBmdW5jdGlvbih2YWwpIHsKKyAgICAgICAgICAgICAgICByZXR1cm4gX2Zyb21UeXBlKHZhbCk7CisgICAgICAgICAgICB9LAorICAgICAgICAgICAgZGVmYXVsdEZvcm1hdDogZnVuY3Rpb24oKSB7CisgICAgICAgICAgICAgICAgcmV0dXJuIGRlZmF1bHRGb3JtYXQ7CisgICAgICAgICAgICB9LAorICAgICAgICAgICAgZGVmYXVsdElucHV0Rm9ybWF0OiBmdW5jdGlvbigpIHsKKyAgICAgICAgICAgICAgICByZXR1cm4gZGVmYXVsdElucHV0Rm9ybWF0OworICAgICAgICAgICAgfQorICAgICAgICB9OworCisgICAgfV0pCisuZmFjdG9yeSgnX1ZhbGlkYXRlJywgWydDYXJkcycsICckcGFyc2UnLCBmdW5jdGlvbihDYXJkcywgJHBhcnNlKSB7CisgICAgICAgIHZhciBfX2luZGV4T2YgPSBbXS5pbmRleE9mIHx8IGZ1bmN0aW9uKGl0ZW0pCisgICAgICAgIHsKKyAgICAgICAgICAgIGZvciAodmFyIGkgPSAwLCBsID0gdGhpcy5sZW5ndGg7IGkgPCBsOyBpKyspCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgaWYgKGkgaW4gdGhpcyAmJiB0aGlzW2ldID09PSBpdGVtKQorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGk7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfQorICAgICAgICAgICAgcmV0dXJuIC0xOworICAgICAgICB9OworCisgICAgICAgIHZhciBfbHVobkNoZWNrID0gZnVuY3Rpb24obnVtKSB7CisgICAgICAgICAgICB2YXIgZGlnaXQsIGRpZ2l0cywgb2RkLCBzdW0sIGksIGxlbjsKKworICAgICAgICAgICAgb2RkID0gdHJ1ZTsKKyAgICAgICAgICAgIHN1bSA9IDA7CisgICAgICAgICAgICBkaWdpdHMgPSAobnVtICsgJycpLnNwbGl0KCcnKS5yZXZlcnNlKCk7CisKKyAgICAgICAgICAgIGZvciAoaSA9IDAsIGxlbiA9IGRpZ2l0cy5sZW5ndGg7IGkgPCBsZW47IGkrKykgeworCisgICAgICAgICAgICAgICAgZGlnaXQgPSBkaWdpdHNbaV07CisgICAgICAgICAgICAgICAgZGlnaXQgPSBwYXJzZUludChkaWdpdCwgMTApOworCisgICAgICAgICAgICAgICAgaWYgKChvZGQgPSAhb2RkKSkgeworICAgICAgICAgICAgICAgICAgICBkaWdpdCAqPSAyOworICAgICAgICAgICAgICAgIH0KKworICAgICAgICAgICAgICAgIGlmIChkaWdpdCA+IDkpIHsKKyAgICAgICAgICAgICAgICAgICAgZGlnaXQgLT0gOTsKKyAgICAgICAgICAgICAgICB9CisKKyAgICAgICAgICAgICAgICBzdW0gKz0gZGlnaXQ7CisKKyAgICAgICAgICAgIH0KKworICAgICAgICAgICAgcmV0dXJuIHN1bSAlIDEwID09PSAwOworICAgICAgICB9OworCisgICAgICAgIHZhciBfdmFsaWRhdG9ycyA9IHt9OworCisgICAgICAgIF92YWxpZGF0b3JzWydjdmMnXSA9IGZ1bmN0aW9uKGN2YywgY3RybCwgc2NvcGUsIGF0dHIpIHsKKyAgICAgICAgICAgIHZhciByZWYsIHJlZjE7CisKKyAgICAgICAgICAgIC8vIHZhbGlkIGlmIGVtcHR5IC0gbGV0IG5nLXJlcXVpcmVkIGhhbmRsZSBlbXB0eQorICAgICAgICAgICAgaWYgKChhbmd1bGFyLmlzVW5kZWZpbmVkKGN2YykpIHx8IChjdmMgPT09IG51bGwpIHx8IChjdmMubGVuZ3RoID09PSAwKSkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICByZXR1cm4gdHJ1ZTsKKyAgICAgICAgICAgIH0KKworICAgICAgICAgICAgaWYgKCEvXlxkKyQvLnRlc3QoY3ZjKSkgeworICAgICAgICAgICAgICAgIHJldHVybiBmYWxzZTsKKyAgICAgICAgICAgIH0KKworICAgICAgICAgICAgdmFyIHR5cGU7CisgICAgICAgICAgICBpZiAoYXR0ci5wYXltZW50c1R5cGVNb2RlbCkgeworICAgICAgICAgICAgICAgIHZhciB0eXBlTW9kZWwgPSAkcGFyc2UoYXR0ci5wYXltZW50c1R5cGVNb2RlbCk7CisgICAgICAgICAgICAgICAgdHlwZSA9IHR5cGVNb2RlbChzY29wZSk7CisgICAgICAgICAgICB9CisKKyAgICAgICAgICAgIGlmICh0eXBlKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIHJlZjEgPSBDYXJkcy5mcm9tVHlwZSh0eXBlKTsKKyAgICAgICAgICAgICAgICByZXR1cm4gKHJlZiA9IGN2Yy5sZW5ndGgsIF9faW5kZXhPZi5jYWxsKChyZWYxICE9PSBudWxsKSA/IHJlZjEuY3ZjTGVuZ3RoIDogdm9pZCAwLCByZWYpKSA+PSAwOworICAgICAgICAgICAgfQorICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIHJldHVybiBjdmMubGVuZ3RoID49IDMgJiYgY3ZjLmxlbmd0aCA8PSA0OworICAgICAgICAgICAgfQorICAgICAgICB9OworICAgICAgICBfdmFsaWRhdG9yc1snemlwJ10gPSBmdW5jdGlvbih6aXAsIGN0cmwsIHNjb3BlLCBhdHRyKSB7CisgICAgICAgICAgICB2YXIgcmVmLCByZWYxOworCisgICAgICAgICAgICAvLyB2YWxpZCBpZiBlbXB0eSAtIGxldCBuZy1yZXF1aXJlZCBoYW5kbGUgZW1wdHkKKyAgICAgICAgICAgIGlmICgoYW5ndWxhci5pc1VuZGVmaW5lZCh6aXApKSB8fCAoemlwID09PSBudWxsKSB8fCAoemlwLmxlbmd0aCA9PT0gMCkpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgcmV0dXJuIHRydWU7CisgICAgICAgICAgICB9CisKKyAgICAgICAgICAgIGlmICghL15cZCskLy50ZXN0KHppcCkpIHsKKyAgICAgICAgICAgICAgICByZXR1cm4gZmFsc2U7CisgICAgICAgICAgICB9CisKKyAgICAgICAgICAgIHZhciB0eXBlOworICAgICAgICAgICAgaWYgKGF0dHIucGF5bWVudHNUeXBlTW9kZWwpIHsKKyAgICAgICAgICAgICAgICB2YXIgdHlwZU1vZGVsID0gJHBhcnNlKGF0dHIucGF5bWVudHNUeXBlTW9kZWwpOworICAgICAgICAgICAgICAgIHR5cGUgPSB0eXBlTW9kZWwoc2NvcGUpOworICAgICAgICAgICAgfQorICAgICAgICAgICAgaWYgKHR5cGUpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgcmVmMSA9IENhcmRzLmZyb21UeXBlKHR5cGUpOworICAgICAgICAgICAgICAgIHJldHVybiAocmVmID0gemlwLmxlbmd0aCwgX19pbmRleE9mLmNhbGwocmVmMSAhPT0gbnVsbCA/IHJlZjEuemlwTGVuZ3RoIDogdm9pZCAwLCByZWYpKSA+PSAwOworICAgICAgICAgICAgfQorICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIHJldHVybiB6aXAubGVuZ3RoIDwgNjsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfTsKKyAgICAgICAgX3ZhbGlkYXRvcnNbJ2NhcmQnXSA9IGZ1bmN0aW9uKG51bSwgY3RybCwgc2NvcGUsIGF0dHIpIHsKKyAgICAgICAgICAgIHZhciBjYXJkLCByZWYsIHR5cGVNb2RlbDsKKworICAgICAgICAgICAgaWYgKGF0dHIucGF5bWVudHNUeXBlTW9kZWwpIHsKKyAgICAgICAgICAgICAgICB0eXBlTW9kZWwgPSAkcGFyc2UoYXR0ci5wYXltZW50c1R5cGVNb2RlbCk7CisgICAgICAgICAgICB9CisKKyAgICAgICAgICAgIHZhciBjbGVhckNhcmQgPSBmdW5jdGlvbigpIHsKKyAgICAgICAgICAgICAgICBpZiAodHlwZU1vZGVsKSB7CisgICAgICAgICAgICAgICAgICAgIHR5cGVNb2RlbC5hc3NpZ24oc2NvcGUsIG51bGwpOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICBjdHJsLiRjYXJkID0gbnVsbDsKKyAgICAgICAgICAgIH07CisKKyAgICAgICAgICAgIC8vIHZhbGlkIGlmIGVtcHR5IC0gbGV0IG5nLXJlcXVpcmVkIGhhbmRsZSBlbXB0eQorICAgICAgICAgICAgaWYgKChhbmd1bGFyLmlzVW5kZWZpbmVkKG51bSkpIHx8IChudW0gPT09IG51bGwpIHx8IChudW0ubGVuZ3RoID09PSAwKSkgeworICAgICAgICAgICAgICAgIGNsZWFyQ2FyZCgpOworICAgICAgICAgICAgICAgIHJldHVybiB0cnVlOworICAgICAgICAgICAgfQorCisgICAgICAgICAgICBudW0gPSAobnVtICsgJycpLnJlcGxhY2UoL1xzK3wtL2csICcnKTsKKworICAgICAgICAgICAgaWYgKCEvXlxkKyQvLnRlc3QobnVtKSkgeworICAgICAgICAgICAgICAgIGNsZWFyQ2FyZCgpOworICAgICAgICAgICAgICAgIHJldHVybiBmYWxzZTsKKyAgICAgICAgICAgIH0KKworICAgICAgICAgICAgY2FyZCA9IENhcmRzLmZyb21OdW1iZXIobnVtKTsKKyAgICAgICAgICAgIGlmICghY2FyZCkgeworICAgICAgICAgICAgICAgIGNsZWFyQ2FyZCgpOworICAgICAgICAgICAgICAgIHJldHVybiBmYWxzZTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGN0cmwuJGNhcmQgPSBhbmd1bGFyLmNvcHkoY2FyZCk7CisKKyAgICAgICAgICAgIGlmICh0eXBlTW9kZWwpIHsKKyAgICAgICAgICAgICAgICB0eXBlTW9kZWwuYXNzaWduKHNjb3BlLCBjYXJkLnR5cGUpOworICAgICAgICAgICAgfQorCisgICAgICAgICAgICByZXQgPSAocmVmID0gbnVtLmxlbmd0aCwgX19pbmRleE9mLmNhbGwoY2FyZC5sZW5ndGgsIHJlZikgPj0gMCkgJiYgKGNhcmQubHVobiA9PT0gZmFsc2UgfHwgX2x1aG5DaGVjayhudW0pKTsKKyAgICAgICAgICAgIHJldHVybiByZXQ7CisgICAgICAgIH07CisgICAgICAgIHJldHVybiBmdW5jdGlvbih0eXBlLCB2YWwsIGN0cmwsIHNjb3BlLCBhdHRyKSB7CisgICAgICAgICAgICBpZiAoIV92YWxpZGF0b3JzW3R5cGVdKSB7CisKKyAgICAgICAgICAgICAgICB0eXBlcyA9IE9iamVjdC5rZXlzKF92YWxpZGF0b3JzKTsKKworICAgICAgICAgICAgICAgIGVycnN0ciA9ICdVbmtub3duIHR5cGUgZm9yIHZhbGlkYXRpb246ICInICsgdHlwZSArICciLiAnOworICAgICAgICAgICAgICAgIGVycnN0ciArPSAnU2hvdWxkIGJlIG9uZSBvZjogIicgKyB0eXBlcy5qb2luKCciLCAiJykgKyAnIic7CisKKyAgICAgICAgICAgICAgICB0aHJvdyBlcnJzdHI7CisgICAgICAgICAgICB9CisgICAgICAgICAgICByZXR1cm4gX3ZhbGlkYXRvcnNbdHlwZV0odmFsLCBjdHJsLCBzY29wZSwgYXR0cik7CisgICAgICAgIH07CisgICAgfV0pCisuZmFjdG9yeSgnX1ZhbGlkYXRlV2F0Y2gnLCBbJ19WYWxpZGF0ZScsIGZ1bmN0aW9uKF9WYWxpZGF0ZSkgeworCisgICAgICAgIHZhciBfdmFsaWRhdG9yV2F0Y2hlcyA9IHt9OworCisgICAgICAgIF92YWxpZGF0b3JXYXRjaGVzWydjdmMnXSA9IGZ1bmN0aW9uKHR5cGUsIGN0cmwsIHNjb3BlLCBhdHRyKSB7CisgICAgICAgICAgICBpZiAoYXR0ci5wYXltZW50c1R5cGVNb2RlbCkgeworICAgICAgICAgICAgICAgIHNjb3BlLiR3YXRjaChhdHRyLnBheW1lbnRzVHlwZU1vZGVsLCBmdW5jdGlvbihuZXdWYWwsIG9sZFZhbCkgeworICAgICAgICAgICAgICAgICAgICBpZiAobmV3VmFsICE9PSBvbGRWYWwpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIHZhciB2YWxpZCA9IF9WYWxpZGF0ZSh0eXBlLCBjdHJsLiRtb2RlbFZhbHVlLCBjdHJsLCBzY29wZSwgYXR0cik7CisgICAgICAgICAgICAgICAgICAgICAgICBjdHJsLiRzZXRWYWxpZGl0eSh0eXBlLCB2YWxpZCk7CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICB9KTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfTsKKyAgICAgICAgX3ZhbGlkYXRvcldhdGNoZXNbJ3ppcCddID0gZnVuY3Rpb24odHlwZSwgY3RybCwgc2NvcGUsIGF0dHIpIHsKKyAgICAgICAgICAgIGlmIChhdHRyLnBheW1lbnRzVHlwZU1vZGVsKSB7CisgICAgICAgICAgICAgICAgc2NvcGUuJHdhdGNoKGF0dHIucGF5bWVudHNUeXBlTW9kZWwsIGZ1bmN0aW9uKG5ld1ZhbCwgb2xkVmFsKSB7CisgICAgICAgICAgICAgICAgICAgIGlmIChuZXdWYWwgIT09IG9sZFZhbCkgeworICAgICAgICAgICAgICAgICAgICAgICAgdmFyIHZhbGlkID0gX1ZhbGlkYXRlKHR5cGUsIGN0cmwuJG1vZGVsVmFsdWUsIGN0cmwsIHNjb3BlLCBhdHRyKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIGN0cmwuJHNldFZhbGlkaXR5KHR5cGUsIHZhbGlkKTsKKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIH0pOworICAgICAgICAgICAgfQorICAgICAgICB9OworICAgICAgICByZXR1cm4gZnVuY3Rpb24odHlwZSwgY3RybCwgc2NvcGUsIGF0dHIpIHsKKyAgICAgICAgICAgIGlmIChfdmFsaWRhdG9yV2F0Y2hlc1t0eXBlXSkgeworICAgICAgICAgICAgICAgIHJldHVybiBfdmFsaWRhdG9yV2F0Y2hlc1t0eXBlXSh0eXBlLCBjdHJsLCBzY29wZSwgYXR0cik7CisgICAgICAgICAgICB9CisgICAgICAgIH07CisgICAgfV0pCisuZGlyZWN0aXZlKCd2YWxpZGF0ZUNhcmQnLCBbJyR3aW5kb3cnLCAnX1ZhbGlkYXRlJywgJ19WYWxpZGF0ZVdhdGNoJywgZnVuY3Rpb24oJHdpbmRvdywgX1ZhbGlkYXRlLCBfVmFsaWRhdGVXYXRjaCkgeworICAgICAgICByZXR1cm4geworICAgICAgICAgICAgcmVzdHJpY3Q6ICdBJywKKyAgICAgICAgICAgIHJlcXVpcmU6ICduZ01vZGVsJywKKyAgICAgICAgICAgIGxpbms6IGZ1bmN0aW9uKHNjb3BlLCBlbGVtLCBhdHRyLCBjdHJsKSB7CisKKyAgICAgICAgICAgICAgICB2YXIgdHlwZSA9IGF0dHIudmFsaWRhdGVDYXJkOworICAgICAgICAgICAgICAgIF9WYWxpZGF0ZVdhdGNoKHR5cGUsIGN0cmwsIHNjb3BlLCBhdHRyKTsKKyAgICAgICAgICAgICAgICB2YXIgdmFsaWRhdGVGbiA9IGZ1bmN0aW9uKHZhbCkgeworICAgICAgICAgICAgICAgICAgICB2YXIgdmFsaWQgPSBfVmFsaWRhdGUodHlwZSwgdmFsLCBjdHJsLCBzY29wZSwgYXR0cik7CisgICAgICAgICAgICAgICAgICAgIGN0cmwuJHNldFZhbGlkaXR5KHR5cGUsIHZhbGlkKTsKKyAgICAgICAgICAgICAgICAgICAgaWYgKHR5cGUgPT09ICdjYXJkJykKKyAgICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGN0cmwuJGNhcmQgPT09IG51bGwpCisgICAgICAgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKCh2YWwgPT0gbnVsbCkgfHwgKHZhbCA9PT0gIiIpIHx8ICh2YWwgPT09ICcnKSkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNjb3BlLmludmFsaWRDYXJkRXJyb3IgPSAnJzsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2NvcGUuaW52YWxpZENhcmQgPSAiIjsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgZWxzZSBpZiAodmFsLmxlbmd0aCA+PSAxKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2NvcGUuaW52YWxpZENhcmRFcnJvciA9ICdlcnJvcic7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNjb3BlLmludmFsaWRDYXJkID0gIlRoZSBudW1iZXIgZW50ZXJlZCBpcyBub3QgYSByZWNvZ25pemVkIGNyZWRpdCBjYXJkIG51bWJlci4iOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoIXZhbGlkKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGN0cmwuJGNhcmQubGVuZ3RoLmluZGV4T2YodmFsLmxlbmd0aCkgPj0gMCkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2NvcGUuaW52YWxpZENhcmRFcnJvciA9ICdlcnJvcic7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzY29wZS5pbnZhbGlkQ2FyZCA9ICJUaGUgbnVtYmVyIGVudGVyZWQgaXMgbm90IGEgcmVjb2duaXplZCBjcmVkaXQgY2FyZCBudW1iZXIuIjsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNjb3BlLmludmFsaWRDYXJkRXJyb3IgPSAnJzsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNjb3BlLmludmFsaWRDYXJkID0gIiI7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2NvcGUuaW52YWxpZENhcmRFcnJvciA9ICcnOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzY29wZS5pbnZhbGlkQ2FyZCA9ICIiOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgIGVsZW0uYmluZCgiYmx1ciIsIGZ1bmN0aW9uKCkKKyAgICAgICAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoKCF2YWxpZCkgfHwgKGN0cmwuJGNhcmQgPT09IG51bGwpKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2NvcGUuaW52YWxpZENhcmRFcnJvciA9ICdlcnJvcic7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNjb3BlLmludmFsaWRDYXJkID0gIlRoZSBudW1iZXIgZW50ZXJlZCBpcyBub3QgYSByZWNvZ25pemVkIGNyZWRpdCBjYXJkIG51bWJlci4iOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzY29wZS5pbnZhbGlkQ2FyZEVycm9yID0gJyc7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNjb3BlLmludmFsaWRDYXJkID0gIiI7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgfSk7CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHZhbGlkID8gdmFsIDogdW5kZWZpbmVkOworICAgICAgICAgICAgICAgIH07CisgICAgICAgICAgICAgICAgY3RybC4kZm9ybWF0dGVycy5wdXNoKHZhbGlkYXRlRm4pOworICAgICAgICAgICAgICAgIGN0cmwuJHBhcnNlcnMucHVzaCh2YWxpZGF0ZUZuKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfTsKKyAgICB9XSkKKy5kaXJlY3RpdmUoJ2NyZWRpdENhcmRJbWFnZScsIGZ1bmN0aW9uKCkgeworICAgIHJldHVybnsKKyAgICAgICAgdGVtcGxhdGVVcmw6ICdhcHAvc2NyaXB0cy9uZ19qc19hdHRfdHBscy9mb3JtRmllbGQvY3JlZGl0Q2FyZEltYWdlLmh0bWwnLAorICAgICAgICByZXBsYWNlOiBmYWxzZSwKKyAgICAgICAgdHJhbnNjbHVkZTogZmFsc2UsCisgICAgICAgIGxpbms6IGZ1bmN0aW9uKHNjb3BlLCBlbGVtZW50LCBhdHRyKQorICAgICAgICB7CisgICAgICAgICAgICBzY29wZS4kd2F0Y2goYXR0ci5jcmVkaXRDYXJkSW1hZ2UsIGZ1bmN0aW9uKG5ld1ZhbCwgb2xkVmFsKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIGlmIChuZXdWYWwgIT09IG9sZFZhbCkKKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgIHNjb3BlLmN2YyA9ICcnOworICAgICAgICAgICAgICAgICAgICBpZiAoIWFuZ3VsYXIuaXNVbmRlZmluZWQobmV3VmFsKSAmJiBuZXdWYWwgIT09IG51bGwpCisgICAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIHNjb3BlLm5ld1ZhbENDSSA9ICdzaG93LScgKyBuZXdWYWw7CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgaWYgKG5ld1ZhbCA9PT0gbnVsbCkKKyAgICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAgICAgc2NvcGUubmV3VmFsQ0NJID0gJyc7CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9KTsKKyAgICAgICAgfQorICAgIH07Cit9KQorLmRpcmVjdGl2ZSgnc2VjdXJpdHlDb2RlSW1hZ2UnLCBbJyRkb2N1bWVudCcsIGZ1bmN0aW9uKCRkb2N1bWVudCkgeworICAgICAgICByZXR1cm57CisgICAgICAgICAgICB0ZW1wbGF0ZVVybDogJ2FwcC9zY3JpcHRzL25nX2pzX2F0dF90cGxzL2Zvcm1GaWVsZC9jdmNTZWN1cml0eUltZy5odG1sJywKKyAgICAgICAgICAgIHJlcGxhY2U6IGZhbHNlLAorICAgICAgICAgICAgdHJhbnNjbHVkZTogZmFsc2UsCisgICAgICAgICAgICBsaW5rOiBmdW5jdGlvbihzY29wZSwgZWxlbWVudCwgYXR0cikKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICBzY29wZS4kd2F0Y2goYXR0ci5zZWN1cml0eUNvZGVJbWFnZSwgZnVuY3Rpb24obmV3VmFsLCBvbGRWYWwpCisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICBpZiAobmV3VmFsICE9PSBvbGRWYWwpCisgICAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIGlmICghYW5ndWxhci5pc1VuZGVmaW5lZChuZXdWYWwpICYmIG5ld1ZhbCAhPT0gbnVsbCkKKyAgICAgICAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAobmV3VmFsID09PSAnYW1leEknKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2NvcGUubmV3VmFsSSA9ICdjY3YyLXNlY3VyaXR5LWFtZXgnOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzY29wZS5uZXdWYWxJQWx0ID0gIlRoZSA0IGRpZ2l0IENWQyBzZWN1cml0eSBjb2RlIGlzIG9uIHRoZSBmcm9udCBvZiB0aGUgY2FyZC4iOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzY29wZS5jdmNQbGFjZWhvbGRlciA9ICI0IGRpZ2l0cyI7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNjb3BlLmN2Y01heGxlbmd0aCA9IDQ7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgICAgIGVsc2UgaWYgKG5ld1ZhbCA9PT0gJ3Zpc2FJJykKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNjb3BlLm5ld1ZhbEkgPSAnY2N2Mi1zZWN1cml0eSc7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNjb3BlLm5ld1ZhbElBbHQgPSAiVGhlIENWQyBzZWN1cml0eSBjb2RlIGlzIG9uIHRoZSBiYWNrIG9mIHlvdXIgY2FyZCByaWdodCBhZnRlciB0aGUgY3JlZGl0IGNhcmQgbnVtYmVyLiI7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNjb3BlLmN2Y1BsYWNlaG9sZGVyID0gIjMgZGlnaXRzIjsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2NvcGUuY3ZjTWF4bGVuZ3RoID0gMzsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICBpZiAobmV3VmFsID09PSBudWxsKQorICAgICAgICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNjb3BlLm5ld1ZhbEkgPSAnY2N2Mi1zZWN1cml0eSc7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2NvcGUuY3ZjUGxhY2Vob2xkZXIgPSAiMyBkaWdpdHMiOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNjb3BlLmN2Y01heGxlbmd0aCA9IDM7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2NvcGUubmV3VmFsSUFsdCA9ICJUaGUgQ1ZDIHNlY3VyaXR5IGNvZGUgaXMgb24gdGhlIGJhY2sgb2YgeW91ciBjYXJkIHJpZ2h0IGFmdGVyIHRoZSBjcmVkaXQgY2FyZCBudW1iZXIuIjsKKyAgICAgICAgICAgICAgICAgICAgICAgIH0KKworICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgfSk7CisgICAgICAgICAgICAgICAgZWxlbWVudC5iaW5kKCJjbGljayIsIGZ1bmN0aW9uKGV2KSB7CisgICAgICAgICAgICAgICAgICAgIGV2LnByZXZlbnREZWZhdWx0KCk7CisgICAgICAgICAgICAgICAgICAgIGlmIChlbGVtZW50LmZpbmQoImJ1dHRvbiIpLmhhc0NsYXNzKCJhY3RpdmUiKSkgeworICAgICAgICAgICAgICAgICAgICAgICAgZWxlbWVudC5maW5kKCJidXR0b24iKS5yZW1vdmVDbGFzcygiYWN0aXZlIik7CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgZWxzZSB7CisgICAgICAgICAgICAgICAgICAgICAgICBlbGVtZW50LmZpbmQoImJ1dHRvbiIpLmFkZENsYXNzKCJhY3RpdmUiKTsKKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIH0pOworCisgICAgICAgICAgICAgICAgdmFyIHdpbmRvdyA9IGFuZ3VsYXIuZWxlbWVudCgkZG9jdW1lbnQpOworICAgICAgICAgICAgICAgIHdpbmRvdy5iaW5kKCJjbGljayIsIGZ1bmN0aW9uKGV2KSB7CisgICAgICAgICAgICAgICAgICAgIHZhciB0YXJnZXRDbGFzc25hbWUgPSBldi50YXJnZXQuY2xhc3NOYW1lOworICAgICAgICAgICAgICAgICAgICBpZiAoKHRhcmdldENsYXNzbmFtZSAhPT0gImJ0biBidG4tYWx0IGJ0bi10b29sdGlwIGFjdGl2ZSIpKSB7CisgICAgICAgICAgICAgICAgICAgICAgICBpZiAoZWxlbWVudC5maW5kKCJidXR0b24iKS5oYXNDbGFzcygiYWN0aXZlIikpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBlbGVtZW50LmZpbmQoImJ1dHRvbiIpLnJlbW92ZUNsYXNzKCJhY3RpdmUiKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgfQorCisgICAgICAgICAgICAgICAgfSk7CisgICAgICAgICAgICB9CisgICAgICAgIH07CisgICAgfV0pOworCithbmd1bGFyLm1vZHVsZSgnYXR0LmFicy5ob3VycGlja2VyJywgWydhdHQuYWJzLnV0aWxpdGllcyddKQorICAgIC5jb25zdGFudCgnaG91cnBpY2tlckNvbmZpZycsIHsKKyAgICAgICAgZGF5czogWydNb24nLCAnVHVlJywgJ1dlZCcsICdUaHUnLCAnRnJpJywgJ1NhdCcsICdTdW4nXSwKKyAgICAgICAgY3VzdG9tT3B0aW9uOiAnQ3VzdG9tJworICAgIH0pCisKKy5jb250cm9sbGVyKCdob3VyUGlja2VyQ29udHJvbGxlcicsIFsnJHNjb3BlJywgZnVuY3Rpb24gKCRzY29wZSkgeworCisgICAgJHNjb3BlLm9wdGlvbnMgPSBbXTsKKyAgICB0aGlzLnNldE9wdGlvbnMgPSBmdW5jdGlvbiAodmFsdWUsIGZyb210aW1lLCB0b3RpbWUsIHByZXNlbGVjdCwgdW5jaGVja2VkRnJvbVRpbWUsIHVuY2hlY2tlZFRvVGltZSkgeworICAgICAgICAkc2NvcGUub3B0aW9ucy5wdXNoKHZhbHVlKTsKKworICAgICAgICBpZiAocHJlc2VsZWN0ICE9PSB1bmRlZmluZWQpIHsKKyAgICAgICAgICAgICRzY29wZS5wcmVzZWxlY3QgPSBwcmVzZWxlY3Q7CisgICAgICAgIH0KKworICAgICAgICB2YXIgZGF5Y291bnQ7CisKKyAgICAgICAgaWYgKGZyb210aW1lICE9PSB1bmRlZmluZWQpIHsKKyAgICAgICAgICAgICRzY29wZS5mcm9tdGltZSA9IGZyb210aW1lOworICAgICAgICAgICAgZm9yIChkYXljb3VudCBpbiAkc2NvcGUuZGF5cykgeworICAgICAgICAgICAgICAgIGlmICgkc2NvcGUuZGF5cy5oYXNPd25Qcm9wZXJ0eShkYXljb3VudCkpIHsKKyAgICAgICAgICAgICAgICAgICAgJHNjb3BlLkZydGltZUxpc3RbJHNjb3BlLmRheXNbZGF5Y291bnRdXSA9IHt9OworICAgICAgICAgICAgICAgICAgICBpZiAodW5jaGVja2VkRnJvbVRpbWUgIT09IHVuZGVmaW5lZCkgeworICAgICAgICAgICAgICAgICAgICAgICAgJHNjb3BlLkZydGltZUxpc3RbJHNjb3BlLmRheXNbZGF5Y291bnRdXS52YWx1ZSA9IHVuY2hlY2tlZEZyb21UaW1lOworICAgICAgICAgICAgICAgICAgICAgICAgJHNjb3BlLnNlbGVjdGVkRnJvbU9wdGlvblskc2NvcGUuZGF5c1tkYXljb3VudF1dID0gdW5jaGVja2VkRnJvbVRpbWU7CisgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICAgICAgICAgICAgICAkc2NvcGUuRnJ0aW1lTGlzdFskc2NvcGUuZGF5c1tkYXljb3VudF1dLnZhbHVlID0gZnJvbXRpbWVbMF0udmFsdWU7CisgICAgICAgICAgICAgICAgICAgICAgICAkc2NvcGUuc2VsZWN0ZWRGcm9tT3B0aW9uWyRzY29wZS5kYXlzW2RheWNvdW50XV0gPSBmcm9tdGltZVswXS52YWx1ZTsKKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgICAgICBpZiAodG90aW1lICE9PSB1bmRlZmluZWQpIHsKKyAgICAgICAgICAgICRzY29wZS50b3RpbWUgPSB0b3RpbWU7CisgICAgICAgICAgICBmb3IgKGRheWNvdW50IGluICRzY29wZS5kYXlzKSB7CisgICAgICAgICAgICAgICAgaWYgKCRzY29wZS5kYXlzLmhhc093blByb3BlcnR5KGRheWNvdW50KSkgeworICAgICAgICAgICAgICAgICAgICAkc2NvcGUuVG90aW1lTGlzdFskc2NvcGUuZGF5c1tkYXljb3VudF1dID0ge307CisgICAgICAgICAgICAgICAgICAgIGlmICh1bmNoZWNrZWRUb1RpbWUgIT09IHVuZGVmaW5lZCkgeworICAgICAgICAgICAgICAgICAgICAgICAgJHNjb3BlLlRvdGltZUxpc3RbJHNjb3BlLmRheXNbZGF5Y291bnRdXS52YWx1ZSA9IHVuY2hlY2tlZFRvVGltZTsKKyAgICAgICAgICAgICAgICAgICAgICAgICRzY29wZS5zZWxlY3RlZFRvT3B0aW9uWyRzY29wZS5kYXlzW2RheWNvdW50XV0gPSB1bmNoZWNrZWRUb1RpbWU7CisgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICAgICAgICAgICAgICAkc2NvcGUuVG90aW1lTGlzdFskc2NvcGUuZGF5c1tkYXljb3VudF1dLnZhbHVlID0gdG90aW1lWzBdLnZhbHVlOworICAgICAgICAgICAgICAgICAgICAgICAgJHNjb3BlLnNlbGVjdGVkVG9PcHRpb25bJHNjb3BlLmRheXNbZGF5Y291bnRdXSA9IHRvdGltZVswXS52YWx1ZTsKKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAkc2NvcGUuc2hvd1RvVGltZUVycm9yRGF5WyRzY29wZS5kYXlzW2RheWNvdW50XV0gPSBmYWxzZTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9CisgICAgICAgIH0KKworICAgICAgICBpZiAodW5jaGVja2VkRnJvbVRpbWUgIT09IHVuZGVmaW5lZCkgeworICAgICAgICAgICAgJHNjb3BlLnVuY2hlY2tlZEZyb21UaW1lID0gdW5jaGVja2VkRnJvbVRpbWU7CisgICAgICAgIH0KKyAgICAgICAgaWYgKHVuY2hlY2tlZFRvVGltZSAhPT0gdW5kZWZpbmVkKSB7CisgICAgICAgICAgICAkc2NvcGUudW5jaGVja2VkVG9UaW1lID0gdW5jaGVja2VkVG9UaW1lOworICAgICAgICB9CisgICAgfTsKKworICAgIHRoaXMuZ2V0U2VsZWN0ZWRPcHRpb24gPSBmdW5jdGlvbiAoKSB7CisgICAgICAgIHJldHVybiAkc2NvcGUuc2VsZWN0ZWRPcHRpb247CisgICAgfTsKKworICAgIHRoaXMuc2V0VG9UaW1lRXJyb3JEYXkgPSBmdW5jdGlvbiAoZGF5LCBmbGFnKSB7CisgICAgICAgICRzY29wZS5zaG93VG9UaW1lRXJyb3JEYXlbZGF5XSA9IGZsYWc7CisgICAgfTsKK31dKQorCisuZGlyZWN0aXZlKCdhdHRIb3VycGlja2VyT3B0aW9uJywgW2Z1bmN0aW9uICgpIHsKKyAgICByZXR1cm4geworICAgICAgICByZXN0cmljdDogJ0VBJywKKyAgICAgICAgcmVxdWlyZTogJ15hdHRIb3VycGlja2VyJywKKyAgICAgICAgc2NvcGU6IHsKKyAgICAgICAgICAgIG9wdGlvbjogIj1vcHRpb24iLAorICAgICAgICAgICAgZnJvbXRpbWU6ICI9ZnJvbXRpbWUiLAorICAgICAgICAgICAgdG90aW1lOiAiPXRvdGltZSIsCisgICAgICAgICAgICBwcmVzZWxlY3Q6ICI9cHJlc2VsZWN0IiwKKyAgICAgICAgICAgIHVuY2hlY2tlZEZyb21UaW1lOiAiPSIsCisgICAgICAgICAgICB1bmNoZWNrZWRUb1RpbWU6ICI9IgorICAgICAgICB9LAorICAgICAgICBsaW5rOiBmdW5jdGlvbiAoc2NvcGUsIGVsZW1lbnQsIGF0dHIsIGN0cmwpIHsKKyAgICAgICAgICAgIGN0cmwuc2V0T3B0aW9ucyhzY29wZS5vcHRpb24sCisgICAgICAgICAgICAgICAgc2NvcGUuZnJvbXRpbWUsCisgICAgICAgICAgICAgICAgc2NvcGUudG90aW1lLAorICAgICAgICAgICAgICAgIHNjb3BlLnByZXNlbGVjdCwKKyAgICAgICAgICAgICAgICBzY29wZS51bmNoZWNrZWRGcm9tVGltZSwKKyAgICAgICAgICAgICAgICBzY29wZS51bmNoZWNrZWRUb1RpbWUpOworICAgICAgICB9CisgICAgfTsKK31dKQorCisuZGlyZWN0aXZlKCdhdHRIb3VycGlja2VyJywgWyJob3VycGlja2VyQ29uZmlnIiwgIiRkb2N1bWVudCIsICIkbG9nIiwgIiRkb2N1bWVudEJpbmQiLCAiJHRpbWVvdXQiLCBmdW5jdGlvbiAoaG91cnBpY2tlckNvbmZpZywgJGRvY3VtZW50LCAkbG9nLCAkZG9jdW1lbnRCaW5kLCAkdGltZW91dCkgeworICAgIHJldHVybiB7CisgICAgICAgIHJlcXVpcmU6ICduZ01vZGVsJywKKyAgICAgICAgcmVzdHJpY3Q6ICdFQScsCisgICAgICAgIGNvbnRyb2xsZXI6ICdob3VyUGlja2VyQ29udHJvbGxlcicsCisgICAgICAgIHRyYW5zY2x1ZGU6IHRydWUsCisgICAgICAgIHNjb3BlOiB7CisgICAgICAgICAgICBtb2RlbDogIj1uZ01vZGVsIiwKKyAgICAgICAgICAgIHJlc2V0RmxhZzogIj0/IgorICAgICAgICB9LAorICAgICAgICB0ZW1wbGF0ZVVybDogJ2FwcC9zY3JpcHRzL25nX2pzX2F0dF90cGxzL2hvdXJwaWNrZXIvaG91cnBpY2tlci5odG1sJywKKyAgICAgICAgbGluazogZnVuY3Rpb24gKHNjb3BlLCBlbGVtZW50LCBhdHRyLCBjdHJsKSB7CisgICAgICAgICAgICB2YXIgZmxhZyA9IGZhbHNlOworICAgICAgICAgICAgc2NvcGUuaXNGcm9tRHJvcERvd25PcGVuID0gZmFsc2U7CisgICAgICAgICAgICBzY29wZS5pc1RvRHJvcERvd25PcGVuID0gZmFsc2U7CisgICAgICAgICAgICB2YXIgZHJvcERvd25PcGVuVmFsdWUgPSAiIjsKKyAgICAgICAgICAgIHZhciBjdXN0VGltZSA9IHt9OworICAgICAgICAgICAgc2NvcGUuZGF5cyA9IGhvdXJwaWNrZXJDb25maWcuZGF5czsKKyAgICAgICAgICAgIHNjb3BlLmRheXNMaXN0ID0ge307CisgICAgICAgICAgICBzY29wZS5GcnRpbWVMaXN0ID0ge307CisgICAgICAgICAgICBzY29wZS5GcnRpbWVMaXN0RGF5ID0ge307CisgICAgICAgICAgICBzY29wZS5Ub3RpbWVMaXN0RGF5ID0ge307CisgICAgICAgICAgICBzY29wZS5zZWxlY3RlZEZyb21PcHRpb24gPSB7fTsKKyAgICAgICAgICAgIHNjb3BlLnNlbGVjdGVkVG9PcHRpb24gPSB7fTsKKyAgICAgICAgICAgIHNjb3BlLlRvdGltZUxpc3QgPSB7fTsKKyAgICAgICAgICAgIHNjb3BlLnNlbGVjdGVkSW5kZXggPSAwOworICAgICAgICAgICAgc2NvcGUuc2VsZWN0ZWRPcHRpb24gPSAiU2VsZWN0IGZyb20gbGlzdCI7CisgICAgICAgICAgICBzY29wZS5jdXN0b21UaW1lID0gW107CisKKyAgICAgICAgICAgIHNjb3BlLnJlc2V0RmxhZyA9IGZhbHNlOworICAgICAgICAgICAgc2NvcGUuc2hvd1RvVGltZUVycm9yRGF5ID0ge307CisgICAgICAgICAgICBzY29wZS52YWxpZGF0ZWRDdXN0b21QcmVzZWxlY3QgPSBbXTsKKworICAgICAgICAgICAgc2NvcGUuJHdhdGNoKCdyZXNldEZsYWcnLCBmdW5jdGlvbiAobmV3VmFsLCBvbGRWYWwpIHsKKyAgICAgICAgICAgICAgICBpZiAobmV3VmFsICE9PSBvbGRWYWwpIHsKKyAgICAgICAgICAgICAgICAgICAgaWYgKG5ld1ZhbCAmJiBzY29wZS5zZWxlY3RlZE9wdGlvbiA9PT0gaG91cnBpY2tlckNvbmZpZy5jdXN0b21PcHRpb24pIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIC8vZGlzYWJsZSBhbmQgcmVzZXQgYWxsIGRheXMgY2hlY2tib3gKKyAgICAgICAgICAgICAgICAgICAgICAgIGZvciAoZGF5IGluIHNjb3BlLmRheXNMaXN0KSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHNjb3BlLmRheXNMaXN0Lmhhc093blByb3BlcnR5KGRheSkpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2NvcGUuZGF5c0xpc3RbZGF5XSA9IGZhbHNlOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzY29wZS5hZGRTZWxlY3RlZFZhbHVlKGRheSk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgc2NvcGUucHJlc2VsZWN0VXBkYXRlRnhuKHNjb3BlLnByZXNlbGVjdCk7CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgc2NvcGUucmVzZXRGbGFnID0gZmFsc2U7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfSk7CisKKyAgICAgICAgICAgIHNjb3BlLiR3YXRjaCgnc2VsQ2F0ZWdvcnknLCBmdW5jdGlvbiAodmFsdWUpIHsKKyAgICAgICAgICAgICAgICBpZiAodmFsdWUpIHsKKyAgICAgICAgICAgICAgICAgICAgY3RybC4kc2V0Vmlld1ZhbHVlKHZhbHVlKTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9LCB0cnVlKTsKKworICAgICAgICAgICAgc2NvcGUudXBkYXRlRGF0YSA9IGZ1bmN0aW9uICh2YWx1ZSkgeworICAgICAgICAgICAgICAgIGlmICh2YWx1ZS5jb25zdHJ1Y3RvciA9PT0gQXJyYXkpIHsKKyAgICAgICAgICAgICAgICAgICAgc2NvcGUuc2hvd0RheXNTZWxlY3RvciA9IHRydWU7CisgICAgICAgICAgICAgICAgICAgIHNjb3BlLnNlbGVjdGVkT3B0aW9uID0gaG91cnBpY2tlckNvbmZpZy5jdXN0b21PcHRpb247CisgICAgICAgICAgICAgICAgICAgIGZvciAodmFyIGFycnkgaW4gdmFsdWUpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIGlmICh2YWx1ZS5oYXNPd25Qcm9wZXJ0eShhcnJ5KSkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhciBkYXkgPSB2YWx1ZVthcnJ5XS5kYXk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHR5cGVvZiB2YWx1ZVthcnJ5XS5wcmVFbmFibGVkID09PSAnYm9vbGVhbicgJiYgdmFsdWVbYXJyeV0ucHJlRW5hYmxlZCkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzY29wZS5kYXlzTGlzdFtkYXldID0gdHJ1ZTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzY29wZS5kYXlzTGlzdFtkYXldID0gZmFsc2U7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgICAgIAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZvciAodmFyIGZyb21jb3VudCBpbiBzY29wZS5mcm9tdGltZSkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoc2NvcGUuZnJvbXRpbWVbZnJvbWNvdW50XS52YWx1ZSA9PT0gdmFsdWVbYXJyeV0uRnJvbVRpbWUgJiYgIXNjb3BlLnVuY2hlY2tlZEZyb21UaW1lKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzY29wZS5GcnRpbWVMaXN0W2RheV0udmFsdWUgPSBzY29wZS5mcm9tdGltZVtmcm9tY291bnRdLnZhbHVlOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2NvcGUuc2VsZWN0ZWRGcm9tT3B0aW9uW2RheV0gPSBzY29wZS5GcnRpbWVMaXN0W2RheV0udmFsdWU7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgZm9yICh2YXIgdG9jb3VudCBpbiBzY29wZS50b3RpbWUpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHNjb3BlLnRvdGltZVt0b2NvdW50XS52YWx1ZSA9PT0gdmFsdWVbYXJyeV0uVG9UaW1lICYmICFzY29wZS51bmNoZWNrZWRUb1RpbWUpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNjb3BlLlRvdGltZUxpc3RbZGF5XS52YWx1ZSA9IHNjb3BlLnRvdGltZVt0b2NvdW50XS52YWx1ZTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNjb3BlLnNlbGVjdGVkVG9PcHRpb25bZGF5XSA9IHNjb3BlLlRvdGltZUxpc3RbZGF5XS52YWx1ZTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBzY29wZS5hZGRTZWxlY3RlZFZhbHVlKGRheSwgdmFsdWVbYXJyeV0uRnJvbVRpbWUsIHZhbHVlW2FycnldLlRvVGltZSk7CisKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAvL2ZvciBJRTggRml4CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHBhcnNlSW50KGFycnkpICsgMSA9PT0gdmFsdWUubGVuZ3RoKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICAgICAgICAgIHNjb3BlLnNlbGVjdE9wdGlvbih2YWx1ZS5kYXkpOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH07CisKKyAgICAgICAgICAgIHNjb3BlLiR3YXRjaCgncHJlc2VsZWN0JywgZnVuY3Rpb24gKHZhbHVlKSB7CisgICAgICAgICAgICAgICAgc2NvcGUucHJlc2VsZWN0VXBkYXRlRnhuKHZhbHVlKTsKKyAgICAgICAgICAgIH0pOworCisgICAgICAgICAgICBzY29wZS5wcmVzZWxlY3RVcGRhdGVGeG4gPSBmdW5jdGlvbiAodmFsdWUpIHsKKyAgICAgICAgICAgICAgICBpZiAodmFsdWUgIT09IHVuZGVmaW5lZCkgeworICAgICAgICAgICAgICAgICAgICBpZiAoc2NvcGUub3B0aW9ucykgeworICAgICAgICAgICAgICAgICAgICAgICAgdmFsdWUgPSBzY29wZS52YWxpZGF0ZVByZXNlbGVjdERhdGEodmFsdWUpOworICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgIGlmICh2YWx1ZSA9PT0gIiIpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybjsKKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICBzY29wZS51cGRhdGVEYXRhKHZhbHVlKTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9OworCisgICAgICAgICAgICBzY29wZS52YWxpZGF0ZVByZXNlbGVjdERhdGEgPSBmdW5jdGlvbiAodmFsdWUpIHsKKyAgICAgICAgICAgICAgICBpZiAodmFsdWUuY29uc3RydWN0b3IgPT09IEFycmF5KSB7CisgICAgICAgICAgICAgICAgICAgIGZvciAodmFyIGFycnkgaW4gdmFsdWUpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIGlmICh2YWx1ZS5oYXNPd25Qcm9wZXJ0eShhcnJ5KSkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhciBkYXkgPSB2YWx1ZVthcnJ5XS5kYXk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFyIGlzRGF5Rm91bmQgPSBmYWxzZTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YXIgaXNGcm1Gb3VuZCA9IGZhbHNlOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhciBpc1RvRm91bmQgPSBmYWxzZTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBmb3IgKHZhciBkYXljb3VudCBpbiBzY29wZS5kYXlzKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChzY29wZS5kYXlzW2RheWNvdW50XSA9PT0gZGF5KSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpc0RheUZvdW5kID0gdHJ1ZTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICghaXNEYXlGb3VuZCkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YWx1ZS5zcGxpY2UoYXJyeSwgMSk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbnRpbnVlOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBmb3IgKHZhciBmcm9tY291bnQgaW4gc2NvcGUuZnJvbXRpbWUpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHNjb3BlLmZyb210aW1lW2Zyb21jb3VudF0udmFsdWUgPT09IHZhbHVlW2FycnldLkZyb21UaW1lKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpc0ZybUZvdW5kID0gdHJ1ZTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICghaXNGcm1Gb3VuZCkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YWx1ZVthcnJ5XS5Gcm9tVGltZSA9IHNjb3BlLmZyb210aW1lWzBdLnZhbHVlOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBmb3IgKHZhciB0b2NvdW50IGluIHNjb3BlLnRvdGltZSkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoc2NvcGUudG90aW1lW3RvY291bnRdLnZhbHVlID09PSB2YWx1ZVthcnJ5XS5Ub1RpbWUpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlzVG9Gb3VuZCA9IHRydWU7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoIWlzVG9Gb3VuZCkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YWx1ZVthcnJ5XS5Ub1RpbWUgPSBzY29wZS50b3RpbWVbMF0udmFsdWU7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQorCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHR5cGVvZiB2YWx1ZVthcnJ5XS5wcmVFbmFibGVkID09PSAnYm9vbGVhbicgJiYgdmFsdWVbYXJyeV0ucHJlRW5hYmxlZCkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YWx1ZVthcnJ5XS5wcmVFbmFibGVkID0gdHJ1ZTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YWx1ZVthcnJ5XS5wcmVFbmFibGVkID0gZmFsc2U7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgICAgIAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNjb3BlLnZhbGlkYXRlZEN1c3RvbVByZXNlbGVjdFtkYXldID0ge307CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2NvcGUudmFsaWRhdGVkQ3VzdG9tUHJlc2VsZWN0W2RheV0uRnJvbVRpbWUgPSB2YWx1ZVthcnJ5XS5Gcm9tVGltZTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBzY29wZS52YWxpZGF0ZWRDdXN0b21QcmVzZWxlY3RbZGF5XS5Ub1RpbWUgPSB2YWx1ZVthcnJ5XS5Ub1RpbWU7CisKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAvL2ZvciBJRTggRml4CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHBhcnNlSW50KGFycnkpICsgMSA9PT0gdmFsdWUubGVuZ3RoKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICAgICAgICAgIHZhciBpc09wdGlvbkZvdW5kID0gZmFsc2U7CisgICAgICAgICAgICAgICAgICAgIGZvciAodmFyIG9wdGNvdW50IGluIHNjb3BlLm9wdGlvbnMpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIGlmIChzY29wZS5vcHRpb25zW29wdGNvdW50XSA9PT0gdmFsdWUuZGF5KSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgaXNPcHRpb25Gb3VuZCA9IHRydWU7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgaWYgKCFpc09wdGlvbkZvdW5kKSB7CisgICAgICAgICAgICAgICAgICAgICAgICB2YWx1ZSA9ICIiOworICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIHJldHVybiB2YWx1ZTsKKyAgICAgICAgICAgIH07CisKKyAgICAgICAgICAgIHNjb3BlLnNlbGVjdFByZXZOZXh0VmFsdWUgPSBmdW5jdGlvbiAoJGV2ZW50LCBhcnJheVZhbHVlcywgY3VyclZhbHVlKSB7CisKKyAgICAgICAgICAgICAgICB2YXIgdmFsdWU7CisgICAgICAgICAgICAgICAgdmFyIGluZGV4ID0gMDsKKyAgICAgICAgICAgICAgICBpZiAoJGV2ZW50LmtleUNvZGUgPT09IDM4KSB7CisgICAgICAgICAgICAgICAgICAgIHZhbHVlID0gLTE7CisgICAgICAgICAgICAgICAgfSBlbHNlIGlmICgkZXZlbnQua2V5Q29kZSA9PT0gNDApIHsKKyAgICAgICAgICAgICAgICAgICAgdmFsdWUgPSAxOworICAgICAgICAgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICAgICAgICAgIHJldHVybiBjdXJyVmFsdWU7CisgICAgICAgICAgICAgICAgfQorCisgICAgICAgICAgICAgICAgaWYgKGFycmF5VmFsdWVzLmluZGV4T2YoY3VyclZhbHVlKSAhPT0gLTEpIHsKKyAgICAgICAgICAgICAgICAgICAgaW5kZXggPSBhcnJheVZhbHVlcy5pbmRleE9mKGN1cnJWYWx1ZSkgKyB2YWx1ZTsKKyAgICAgICAgICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgICAgICAgICBmb3IgKHZhciBjb3VudCBpbiBhcnJheVZhbHVlcykgeworICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGFycmF5VmFsdWVzW2NvdW50XS52YWx1ZSA9PT0gY3VyclZhbHVlKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgaW5kZXggPSBwYXJzZUludChjb3VudCkgKyB2YWx1ZTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIH0KKworICAgICAgICAgICAgICAgIGlmIChpbmRleCA9PT0gYXJyYXlWYWx1ZXMubGVuZ3RoKSB7CisgICAgICAgICAgICAgICAgICAgIGluZGV4ID0gaW5kZXggLSAxOworICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAoaW5kZXggPT09IC0xKSB7CisgICAgICAgICAgICAgICAgICAgIGluZGV4ID0gaW5kZXggKyAxOworICAgICAgICAgICAgICAgIH0KKworICAgICAgICAgICAgICAgICRldmVudC5wcmV2ZW50RGVmYXVsdCgpOworICAgICAgICAgICAgICAgIGlmIChhcnJheVZhbHVlc1tpbmRleF0udmFsdWUpIHsKKyAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGFycmF5VmFsdWVzW2luZGV4XS52YWx1ZTsKKyAgICAgICAgICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgICAgICAgICByZXR1cm4gYXJyYXlWYWx1ZXNbaW5kZXhdOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH07CisKKyAgICAgICAgICAgIHNjb3BlLnNob3dEcm9wZG93biA9IGZ1bmN0aW9uICgpIHsKKyAgICAgICAgICAgICAgICBzY29wZS5zaG93bGlzdCA9ICFzY29wZS5zaG93bGlzdDsKKyAgICAgICAgICAgICAgICBmbGFnID0gIWZsYWc7CisgICAgICAgICAgICB9OworCisgICAgICAgICAgICBzY29wZS5zaG93ZnJvbURheURyb3Bkb3duID0gZnVuY3Rpb24gKHZhbHVlKSB7CisgICAgICAgICAgICAgICAgLy9jbG9zZSBkcm9wZG93biBpZiBhbnkgb3RoZXIgRnJvbSBkcm9wIGRvd24gaXMgb3BlbmVkCisgICAgICAgICAgICAgICAgZm9yIChjb3VudCBpbiBzY29wZS5GcnRpbWVMaXN0RGF5KSB7CisgICAgICAgICAgICAgICAgICAgIGlmIChjb3VudCAhPT0gdmFsdWUgJiYgc2NvcGUuRnJ0aW1lTGlzdERheVtjb3VudF0pIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIHNjb3BlLkZydGltZUxpc3REYXlbY291bnRdID0gZmFsc2U7CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgZm9yIChjb3VudCBpbiBzY29wZS5Ub3RpbWVMaXN0RGF5KSB7CisgICAgICAgICAgICAgICAgICAgIGlmIChzY29wZS5Ub3RpbWVMaXN0RGF5W2NvdW50XSkgeworICAgICAgICAgICAgICAgICAgICAgICAgc2NvcGUuVG90aW1lTGlzdERheVtjb3VudF0gPSBmYWxzZTsKKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICBzY29wZS5GcnRpbWVMaXN0RGF5W3ZhbHVlXSA9ICFzY29wZS5GcnRpbWVMaXN0RGF5W3ZhbHVlXTsKKyAgICAgICAgICAgICAgICBmbGFnID0gIWZsYWc7CisgICAgICAgICAgICAgICAgc2NvcGUuc2hvd2xpc3QgPSBmYWxzZTsKKworICAgICAgICAgICAgICAgIC8vc2F2ZSBtb2RlbCB2YWx1ZSBzbyB3ZSBjYW4gY2xvc2UgY3VycmVudCBkcm9wZG93biBvbiBjbGljayBvZiBvdGhlciBwYXJ0IG9mIHRoZSBkb2N1bWVudAorICAgICAgICAgICAgICAgIGlmIChzY29wZS5GcnRpbWVMaXN0RGF5W3ZhbHVlXSkgeworICAgICAgICAgICAgICAgICAgICBzY29wZS5pc0Zyb21Ecm9wRG93bk9wZW4gPSB0cnVlOworICAgICAgICAgICAgICAgICAgICBkcm9wRG93bk9wZW5WYWx1ZSA9IHZhbHVlOworICAgICAgICAgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICAgICAgICAgIHNjb3BlLmlzRnJvbURyb3BEb3duT3BlbiA9IGZhbHNlOworICAgICAgICAgICAgICAgIH0KKworICAgICAgICAgICAgICAgICR0aW1lb3V0KGZ1bmN0aW9uICgpIHsKKyAgICAgICAgICAgICAgICAgICAgaWYgKHNjb3BlLkZydGltZUxpc3REYXlbdmFsdWVdKSB7CisgICAgICAgICAgICAgICAgICAgICAgICB2YXIgZGF5c0NvbnRhaW5lckRJViA9IGFuZ3VsYXIuZWxlbWVudChlbGVtZW50KVswXS5xdWVyeVNlbGVjdG9yKCIuY3VzdG9tZGF5cy13aWR0aCIpOworICAgICAgICAgICAgICAgICAgICAgICAgdmFyIGNvbnRhaW5lclVMID0gYW5ndWxhci5lbGVtZW50KGRheXNDb250YWluZXJESVYucXVlcnlTZWxlY3RvcignLnNlbGVjdDItY29udGFpbmVyLWFjdGl2ZScpKS5wYXJlbnQoKVswXS5xdWVyeVNlbGVjdG9yKCJ1bCIpOworICAgICAgICAgICAgICAgICAgICAgICAgdmFyIHNlbGVjdGVkRWxlbVRvcFBvcyA9IGFuZ3VsYXIuZWxlbWVudChjb250YWluZXJVTC5xdWVyeVNlbGVjdG9yKCcuc2VsZWN0ZWRJdGVtSW5Ecm9wRG93bicpKVswXS5vZmZzZXRUb3A7CisgICAgICAgICAgICAgICAgICAgICAgICBhbmd1bGFyLmVsZW1lbnQoY29udGFpbmVyVUwpWzBdLnNjcm9sbFRvcCA9IHNlbGVjdGVkRWxlbVRvcFBvczsKKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIH0pOworICAgICAgICAgICAgfTsKKworICAgICAgICAgICAgc2NvcGUuc2hvd3RvRGF5RHJvcGRvd24gPSBmdW5jdGlvbiAodmFsdWUpIHsKKyAgICAgICAgICAgICAgICAvL2Nsb3NlIGRyb3Bkb3duIGlmIGFueSBvdGhlciBUbyBkcm9wIGRvd24gaXMgb3BlbmVkCisgICAgICAgICAgICAgICAgZm9yIChjb3VudCBpbiBzY29wZS5Ub3RpbWVMaXN0RGF5KSB7CisgICAgICAgICAgICAgICAgICAgIGlmIChjb3VudCAhPT0gdmFsdWUgJiYgc2NvcGUuVG90aW1lTGlzdERheVtjb3VudF0pIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIHNjb3BlLlRvdGltZUxpc3REYXlbY291bnRdID0gZmFsc2U7CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgZm9yIChjb3VudCBpbiBzY29wZS5GcnRpbWVMaXN0RGF5KSB7CisgICAgICAgICAgICAgICAgICAgIGlmIChzY29wZS5GcnRpbWVMaXN0RGF5W2NvdW50XSkgeworICAgICAgICAgICAgICAgICAgICAgICAgc2NvcGUuRnJ0aW1lTGlzdERheVtjb3VudF0gPSBmYWxzZTsKKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICBzY29wZS5Ub3RpbWVMaXN0RGF5W3ZhbHVlXSA9ICFzY29wZS5Ub3RpbWVMaXN0RGF5W3ZhbHVlXTsKKyAgICAgICAgICAgICAgICBmbGFnID0gIWZsYWc7CisgICAgICAgICAgICAgICAgc2NvcGUuc2hvd2xpc3QgPSBmYWxzZTsKKworICAgICAgICAgICAgICAgIC8vc2F2ZSBtb2RlbCB2YWx1ZSBzbyB3ZSBjYW4gY2xvc2UgY3VycmVudCBkcm9wZG93biBvbiBjbGljayBvZiBvdGhlciBwYXJ0IG9mIHRoZSBkb2N1bWVudAorICAgICAgICAgICAgICAgIGlmIChzY29wZS5Ub3RpbWVMaXN0RGF5W3ZhbHVlXSkgeworICAgICAgICAgICAgICAgICAgICBzY29wZS5pc1RvRHJvcERvd25PcGVuID0gdHJ1ZTsKKyAgICAgICAgICAgICAgICAgICAgZHJvcERvd25PcGVuVmFsdWUgPSB2YWx1ZTsKKworICAgICAgICAgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICAgICAgICAgIHNjb3BlLmlzVG9Ecm9wRG93bk9wZW4gPSBmYWxzZTsKKyAgICAgICAgICAgICAgICB9CisKKyAgICAgICAgICAgICAgICAkdGltZW91dChmdW5jdGlvbiAoKSB7CisgICAgICAgICAgICAgICAgICAgIGlmIChzY29wZS5Ub3RpbWVMaXN0RGF5W3ZhbHVlXSkgeworICAgICAgICAgICAgICAgICAgICAgICAgdmFyIGRheXNDb250YWluZXJESVYgPSBhbmd1bGFyLmVsZW1lbnQoZWxlbWVudClbMF0ucXVlcnlTZWxlY3RvcigiLmN1c3RvbWRheXMtd2lkdGgiKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIHZhciBjb250YWluZXJVTCA9IGFuZ3VsYXIuZWxlbWVudChkYXlzQ29udGFpbmVyRElWLnF1ZXJ5U2VsZWN0b3IoJy5zZWxlY3QyLWNvbnRhaW5lci1hY3RpdmUnKSkucGFyZW50KClbMF0ucXVlcnlTZWxlY3RvcigidWwiKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIHZhciBzZWxlY3RlZEVsZW1Ub3BQb3MgPSBhbmd1bGFyLmVsZW1lbnQoY29udGFpbmVyVUwucXVlcnlTZWxlY3RvcignLnNlbGVjdGVkSXRlbUluRHJvcERvd24nKSlbMF0ub2Zmc2V0VG9wOworICAgICAgICAgICAgICAgICAgICAgICAgYW5ndWxhci5lbGVtZW50KGNvbnRhaW5lclVMKVswXS5zY3JvbGxUb3AgPSBzZWxlY3RlZEVsZW1Ub3BQb3M7CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICB9KTsKKyAgICAgICAgICAgIH07CisKKyAgICAgICAgICAgIHNjb3BlLnNlbGVjdEZyb21EYXlPcHRpb24gPSBmdW5jdGlvbiAoZGF5LCB2YWx1ZSkgeworICAgICAgICAgICAgICAgIHNjb3BlLnNlbGVjdGVkRnJvbU9wdGlvbltkYXldID0gdmFsdWU7CisgICAgICAgICAgICAgICAgc2NvcGUuRnJ0aW1lTGlzdFtkYXldLnZhbHVlID0gdmFsdWU7CisgICAgICAgICAgICAgICAgc2NvcGUuRnJ0aW1lTGlzdERheVtkYXldID0gZmFsc2U7CisgICAgICAgICAgICAgICAgc2NvcGUuaXNGcm9tRHJvcERvd25PcGVuID0gZmFsc2U7CisgICAgICAgICAgICB9OworCisgICAgICAgICAgICBzY29wZS5zZWxlY3RUb0RheU9wdGlvbiA9IGZ1bmN0aW9uIChkYXksIHZhbHVlKSB7CisgICAgICAgICAgICAgICAgc2NvcGUuc2VsZWN0ZWRUb09wdGlvbltkYXldID0gdmFsdWU7CisgICAgICAgICAgICAgICAgc2NvcGUuVG90aW1lTGlzdFtkYXldLnZhbHVlID0gdmFsdWU7CisgICAgICAgICAgICAgICAgc2NvcGUuVG90aW1lTGlzdERheVtkYXldID0gZmFsc2U7CisgICAgICAgICAgICAgICAgc2NvcGUuaXNUb0Ryb3BEb3duT3BlbiA9IGZhbHNlOworICAgICAgICAgICAgfTsKKworICAgICAgICAgICAgc2NvcGUuYWRkU2VsZWN0ZWRWYWx1ZSA9IGZ1bmN0aW9uICh2YWx1ZSwgZnJvbXRpbWUsIHRvdGltZSkgeworICAgICAgICAgICAgICAgIHZhciBjb3VudCwgbGVuOworICAgICAgICAgICAgICAgIGlmIChzY29wZS5kYXlzTGlzdFt2YWx1ZV0gIT09IHVuZGVmaW5lZCAmJiAhc2NvcGUuZGF5c0xpc3RbdmFsdWVdKSB7CisgICAgICAgICAgICAgICAgICAgIGZvciAoY291bnQgPSAwLCBsZW4gPSBzY29wZS5jdXN0b21UaW1lLmxlbmd0aDsgY291bnQgPCBsZW47IGNvdW50KyspIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIGlmIChzY29wZS5jdXN0b21UaW1lW2NvdW50XS5kYXkgPT09IHZhbHVlKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHNjb3BlLnVuY2hlY2tlZEZyb21UaW1lKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNjb3BlLnNlbGVjdGVkRnJvbU9wdGlvbltzY29wZS5jdXN0b21UaW1lW2NvdW50XS5kYXldID0gc2NvcGUudW5jaGVja2VkRnJvbVRpbWU7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2NvcGUuc2VsZWN0ZWRGcm9tT3B0aW9uW3Njb3BlLmN1c3RvbVRpbWVbY291bnRdLmRheV0gPSBzY29wZS5GcnRpbWVMaXN0W3Njb3BlLmN1c3RvbVRpbWVbY291bnRdLmRheV0udmFsdWU7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQorCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHNjb3BlLnVuY2hlY2tlZFRvVGltZSkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzY29wZS5zZWxlY3RlZFRvT3B0aW9uW3Njb3BlLmN1c3RvbVRpbWVbY291bnRdLmRheV0gPSBzY29wZS51bmNoZWNrZWRUb1RpbWU7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2NvcGUuc2VsZWN0ZWRUb09wdGlvbltzY29wZS5jdXN0b21UaW1lW2NvdW50XS5kYXldID0gc2NvcGUuVG90aW1lTGlzdFtzY29wZS5jdXN0b21UaW1lW2NvdW50XS5kYXldLnZhbHVlOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KKworICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNjb3BlLmN1c3RvbVRpbWUuc3BsaWNlKGNvdW50LCAxKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICAgICAgICAgIGlmIChzY29wZS5zZWxlY3RlZEZyb21PcHRpb25bdmFsdWVdID09PSBzY29wZS51bmNoZWNrZWRGcm9tVGltZSkgeworCisgICAgICAgICAgICAgICAgICAgICAgICBpZiAoYW5ndWxhci5pc0RlZmluZWQoc2NvcGUudmFsaWRhdGVkQ3VzdG9tUHJlc2VsZWN0W3ZhbHVlXSkpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBzY29wZS5zZWxlY3RlZEZyb21PcHRpb25bdmFsdWVdID0gc2NvcGUudmFsaWRhdGVkQ3VzdG9tUHJlc2VsZWN0W3ZhbHVlXS5Gcm9tVGltZTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBmcm9tdGltZSA9IHNjb3BlLnZhbGlkYXRlZEN1c3RvbVByZXNlbGVjdFt2YWx1ZV0uRnJvbVRpbWU7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2NvcGUuRnJ0aW1lTGlzdFt2YWx1ZV0udmFsdWUgPSBzY29wZS52YWxpZGF0ZWRDdXN0b21QcmVzZWxlY3RbdmFsdWVdLkZyb21UaW1lOworICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBzY29wZS5zZWxlY3RlZEZyb21PcHRpb25bdmFsdWVdID0gc2NvcGUuZnJvbXRpbWVbMF0udmFsdWU7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgZnJvbXRpbWUgPSBzY29wZS5mcm9tdGltZVswXS52YWx1ZTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBzY29wZS5GcnRpbWVMaXN0W3ZhbHVlXS52YWx1ZSA9IHNjb3BlLmZyb210aW1lWzBdLnZhbHVlOworICAgICAgICAgICAgICAgICAgICAgICAgfQorCisgICAgICAgICAgICAgICAgICAgIH0KKworICAgICAgICAgICAgICAgICAgICBpZiAoc2NvcGUuc2VsZWN0ZWRUb09wdGlvblt2YWx1ZV0gPT09IHNjb3BlLnVuY2hlY2tlZFRvVGltZSkgeworCisgICAgICAgICAgICAgICAgICAgICAgICBpZiAoYW5ndWxhci5pc0RlZmluZWQoc2NvcGUudmFsaWRhdGVkQ3VzdG9tUHJlc2VsZWN0W3ZhbHVlXSkpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBzY29wZS5zZWxlY3RlZFRvT3B0aW9uW3ZhbHVlXSA9IHNjb3BlLnZhbGlkYXRlZEN1c3RvbVByZXNlbGVjdFt2YWx1ZV0uVG9UaW1lOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRvdGltZSA9IHNjb3BlLnZhbGlkYXRlZEN1c3RvbVByZXNlbGVjdFt2YWx1ZV0uVG9UaW1lOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNjb3BlLlRvdGltZUxpc3RbdmFsdWVdLnZhbHVlID0gc2NvcGUudmFsaWRhdGVkQ3VzdG9tUHJlc2VsZWN0W3ZhbHVlXS5Ub1RpbWU7CisgICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNjb3BlLnNlbGVjdGVkVG9PcHRpb25bdmFsdWVdID0gc2NvcGUudG90aW1lWzBdLnZhbHVlOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRvdGltZSA9IHNjb3BlLnRvdGltZVswXS52YWx1ZTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBzY29wZS5Ub3RpbWVMaXN0W3ZhbHVlXS52YWx1ZSA9IHNjb3BlLnRvdGltZVswXS52YWx1ZTsKKyAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgfQorCisgICAgICAgICAgICAgICAgICAgIGN1c3RUaW1lWyJkYXkiXSA9IHZhbHVlOworICAgICAgICAgICAgICAgICAgICBjdXN0VGltZVsiRnJvbVRpbWUiXSA9IHNjb3BlLkZydGltZUxpc3RbdmFsdWVdLnZhbHVlOworICAgICAgICAgICAgICAgICAgICBjdXN0VGltZVsiVG9UaW1lIl0gPSBzY29wZS5Ub3RpbWVMaXN0W3ZhbHVlXS52YWx1ZTsKKworICAgICAgICAgICAgICAgICAgICBmb3IgKGNvdW50ID0gMCwgbGVuID0gc2NvcGUuY3VzdG9tVGltZS5sZW5ndGg7IGNvdW50IDwgbGVuOyBjb3VudCsrKSB7CisgICAgICAgICAgICAgICAgICAgICAgICBpZiAoc2NvcGUuY3VzdG9tVGltZVtjb3VudF0uZGF5ID09PSB2YWx1ZSkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNjb3BlLmN1c3RvbVRpbWVbY291bnRdLkZyb21UaW1lID0gY3VzdFRpbWVbIkZyb21UaW1lIl07CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2NvcGUuY3VzdG9tVGltZVtjb3VudF0uVG9UaW1lID0gY3VzdFRpbWVbIlRvVGltZSJdOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgIGlmIChjb3VudCA9PT0gbGVuKSB7CisgICAgICAgICAgICAgICAgICAgICAgICB2YXIgeCA9IGFuZ3VsYXIuY29weShjdXN0VGltZSk7CisgICAgICAgICAgICAgICAgICAgICAgICBzY29wZS5jdXN0b21UaW1lLnB1c2goeCk7CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgc2NvcGUuc2VsQ2F0ZWdvcnkgPSBzY29wZS5jdXN0b21UaW1lOworICAgICAgICAgICAgfTsKKworCisgICAgICAgICAgICB2YXIgb3V0c2lkZUNsaWNrID0gZnVuY3Rpb24gKCkgeworICAgICAgICAgICAgICAgIGlmIChzY29wZS5zaG93bGlzdCkgeworICAgICAgICAgICAgICAgICAgICBzY29wZS4kYXBwbHkoZnVuY3Rpb24gKCkgeworICAgICAgICAgICAgICAgICAgICAgICAgc2NvcGUuc2hvd2xpc3QgPSBmYWxzZTsKKyAgICAgICAgICAgICAgICAgICAgfSk7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfTsKKworICAgICAgICAgICAgJGRvY3VtZW50QmluZC5jbGljaygnc2hvd2xpc3QnLCBvdXRzaWRlQ2xpY2ssIHNjb3BlKTsKKworICAgICAgICAgICAgdmFyIG91dHNpZGVDbGlja0Zyb21Ecm9wZG93biA9IGZ1bmN0aW9uICgpIHsKKyAgICAgICAgICAgICAgICBzY29wZS4kYXBwbHkoZnVuY3Rpb24gKCkgeworICAgICAgICAgICAgICAgICAgICBpZiAoc2NvcGUuaXNGcm9tRHJvcERvd25PcGVuKSB7CisgICAgICAgICAgICAgICAgICAgICAgICBzY29wZS5GcnRpbWVMaXN0RGF5W2Ryb3BEb3duT3BlblZhbHVlXSA9IGZhbHNlOworICAgICAgICAgICAgICAgICAgICAgICAgc2NvcGUuaXNGcm9tRHJvcERvd25PcGVuID0gZmFsc2U7CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICB9KTsKKyAgICAgICAgICAgIH07CisKKyAgICAgICAgICAgICRkb2N1bWVudEJpbmQuY2xpY2soJ2lzRnJvbURyb3BEb3duT3BlbicsIG91dHNpZGVDbGlja0Zyb21Ecm9wZG93biwgc2NvcGUpOworCisgICAgICAgICAgICB2YXIgb3V0c2lkZUNsaWNrVG9Ecm9wZG93biA9IGZ1bmN0aW9uICgpIHsKKyAgICAgICAgICAgICAgICBzY29wZS4kYXBwbHkoZnVuY3Rpb24gKCkgeworICAgICAgICAgICAgICAgICAgICBpZiAoc2NvcGUuaXNUb0Ryb3BEb3duT3BlbikgeworICAgICAgICAgICAgICAgICAgICAgICAgc2NvcGUuVG90aW1lTGlzdERheVtkcm9wRG93bk9wZW5WYWx1ZV0gPSBmYWxzZTsKKyAgICAgICAgICAgICAgICAgICAgICAgIHNjb3BlLmlzVG9Ecm9wRG93bk9wZW4gPSBmYWxzZTsKKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIH0pOworICAgICAgICAgICAgfTsKKworICAgICAgICAgICAgJGRvY3VtZW50QmluZC5jbGljaygnaXNUb0Ryb3BEb3duT3BlbicsIG91dHNpZGVDbGlja1RvRHJvcGRvd24sIHNjb3BlKTsKKworICAgICAgICAgICAgc2NvcGUuc2VsZWN0T3B0aW9uID0gZnVuY3Rpb24gKHNJdGVtKSB7CisKKyAgICAgICAgICAgICAgICBpZiAoc0l0ZW0gPT09IGhvdXJwaWNrZXJDb25maWcuY3VzdG9tT3B0aW9uKSB7CisgICAgICAgICAgICAgICAgICAgIHNjb3BlLnNob3dEYXlzU2VsZWN0b3IgPSB0cnVlOworICAgICAgICAgICAgICAgICAgICBzY29wZS5zZWxDYXRlZ29yeSA9IHNjb3BlLmN1c3RvbVRpbWU7CisgICAgICAgICAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgICAgICAgICAgc2NvcGUuc2hvd0RheXNTZWxlY3RvciA9IGZhbHNlOworICAgICAgICAgICAgICAgICAgICB2YXIgZnJvbVRpbWUgPSAvWzAtOV1ccz9hbS9pLmV4ZWMoc0l0ZW0pOworICAgICAgICAgICAgICAgICAgICB2YXIgdG9UaW1lID0gL1swLTldXHM/cG0vaS5leGVjKHNJdGVtKTsKKyAgICAgICAgICAgICAgICAgICAgc2NvcGUuc2VsQ2F0ZWdvcnkgPSB7CisgICAgICAgICAgICAgICAgICAgICAgICBkYXk6IHNJdGVtLAorICAgICAgICAgICAgICAgICAgICAgICAgRnJvbVRpbWU6IGZyb21UaW1lID09PSBudWxsID8gJ05BJyA6IGZyb21UaW1lWzBdLAorICAgICAgICAgICAgICAgICAgICAgICAgVG9UaW1lOiB0b1RpbWUgPT09IG51bGwgPyAnTkEnIDogdG9UaW1lWzBdCisgICAgICAgICAgICAgICAgICAgIH07CisgICAgICAgICAgICAgICAgfQorCisgICAgICAgICAgICAgICAgc2NvcGUuc2hvd2xpc3QgPSBmYWxzZTsKKyAgICAgICAgICAgICAgICBmbGFnID0gZmFsc2U7CisgICAgICAgICAgICAgICAgc2NvcGUuc2VsZWN0ZWRPcHRpb24gPSBzSXRlbTsKKyAgICAgICAgICAgIH07CisgICAgICAgIH0KKyAgICB9OworfV0pCisKKy5kaXJlY3RpdmUoJ2F0dEhvdXJwaWNrZXJWYWxpZGF0b3InLCBbJ2hvdXJwaWNrZXJDb25maWcnLCBmdW5jdGlvbiAoaG91cnBpY2tlckNvbmZpZykgeworICAgIHJldHVybiB7CisgICAgICAgIHJlc3RyaWN0OiAnQScsCisgICAgICAgIHJlcXVpcmU6IFsnYXR0SG91cnBpY2tlcicsICduZ01vZGVsJ10sCisgICAgICAgIGxpbms6IGZ1bmN0aW9uIChzY29wZSwgZWxlbWVudCwgYXR0ciwgY3RybCkgeworCisgICAgICAgICAgICB2YXIgYXR0SG91cnBpY2tlckN0cmwgPSBjdHJsWzBdOworICAgICAgICAgICAgdmFyIG5nTW9kZWxDdHJsID0gY3RybFsxXTsKKworICAgICAgICAgICAgLy9yZXF1aXJlZCBmb3JtYXQgW2g6TU0gdHRdIGxpa2UgJzE6MTAgUE0nCisgICAgICAgICAgICB2YXIgY29udmVydFRpbWVTdHJuZ1RvTWlsaXRhcnlGb3JtYXQgPSBmdW5jdGlvbiAodGltZSkgeworICAgICAgICAgICAgICAgIHZhciBob3VycyA9IE51bWJlcih0aW1lLm1hdGNoKC9eKFxkKykvKVsxXSk7CisgICAgICAgICAgICAgICAgdmFyIG1pbnV0ZXMgPSBOdW1iZXIodGltZS5tYXRjaCgvOihcZCspLylbMV0pOworICAgICAgICAgICAgICAgIHZhciBBTVBNID0gKHRpbWUubWF0Y2goL1xzKC4qKSQvKVsxXSkudG9VcHBlckNhc2UoKTsKKyAgICAgICAgICAgICAgICBpZiAoQU1QTSA9PT0gJ1BNJyAmJiBob3VycyA8IDEyKSB7CisgICAgICAgICAgICAgICAgICAgIGhvdXJzID0gaG91cnMgKyAxMjsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgaWYgKEFNUE0gPT09ICdBTScgJiYgaG91cnMgPT09IDEyKSB7CisgICAgICAgICAgICAgICAgICAgIGhvdXJzID0gaG91cnMgLSAxMjsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgdmFyIHNIb3VycyA9IGhvdXJzLnRvU3RyaW5nKCk7CisgICAgICAgICAgICAgICAgdmFyIHNNaW51dGVzID0gbWludXRlcy50b1N0cmluZygpOworICAgICAgICAgICAgICAgIGlmIChob3VycyA8IDEwKSB7CisgICAgICAgICAgICAgICAgICAgIHNIb3VycyA9ICcwJyArIHNIb3VyczsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgaWYgKG1pbnV0ZXMgPCAxMCkgeworICAgICAgICAgICAgICAgICAgICBzTWludXRlcyA9ICcwJyArIHNNaW51dGVzOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICByZXR1cm4gcGFyc2VJbnQoc0hvdXJzICsgc01pbnV0ZXMsIDEwKTsKKyAgICAgICAgICAgIH07CisKKyAgICAgICAgICAgIHZhciBjb21wYXJlVGltZVN0cmluZ3MgPSBmdW5jdGlvbiAoZnJvbVRpbWVTdHJpbmcsIHRvVGltZVN0cmluZykgeworICAgICAgICAgICAgICAgIHZhciBmcm9tTWlsaXRhcnlUaW1lID0gY29udmVydFRpbWVTdHJuZ1RvTWlsaXRhcnlGb3JtYXQoZnJvbVRpbWVTdHJpbmcpOworICAgICAgICAgICAgICAgIHZhciB0b01pbGl0YXJ5VGltZSA9IGNvbnZlcnRUaW1lU3RybmdUb01pbGl0YXJ5Rm9ybWF0KHRvVGltZVN0cmluZyk7CisgICAgICAgICAgICAgICAgcmV0dXJuICh0b01pbGl0YXJ5VGltZSAtIGZyb21NaWxpdGFyeVRpbWUpOworICAgICAgICAgICAgfTsKKworICAgICAgICAgICAgdmFyIHZhbGlkYXRlQ3VzdG9tRGF0YSA9IGZ1bmN0aW9uIChmaW5hbERhdGFNb2RhbCkgeworCisgICAgICAgICAgICAgICAgaWYgKGF0dEhvdXJwaWNrZXJDdHJsLmdldFNlbGVjdGVkT3B0aW9uKCkgPT09IGhvdXJwaWNrZXJDb25maWcuY3VzdG9tT3B0aW9uKSB7CisKKyAgICAgICAgICAgICAgICAgICAgdmFyIGVycm9yRGF5c0NvdW50ID0gMDsKKworICAgICAgICAgICAgICAgICAgICBmb3IgKHZhciBpdGVtIGluIGZpbmFsRGF0YU1vZGFsKSB7CisgICAgICAgICAgICAgICAgICAgICAgICBpZiAoZmluYWxEYXRhTW9kYWwuaGFzT3duUHJvcGVydHkoaXRlbSkpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoY29tcGFyZVRpbWVTdHJpbmdzKGZpbmFsRGF0YU1vZGFsW2l0ZW1dLkZyb21UaW1lLCBmaW5hbERhdGFNb2RhbFtpdGVtXS5Ub1RpbWUpIDw9IDApIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYXR0SG91cnBpY2tlckN0cmwuc2V0VG9UaW1lRXJyb3JEYXkoZmluYWxEYXRhTW9kYWxbaXRlbV0uZGF5LCB0cnVlKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZXJyb3JEYXlzQ291bnQrKzsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBhdHRIb3VycGlja2VyQ3RybC5zZXRUb1RpbWVFcnJvckRheShmaW5hbERhdGFNb2RhbFtpdGVtXS5kYXksIGZhbHNlKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgIH0KKworICAgICAgICAgICAgICAgICAgICBpZiAoZXJyb3JEYXlzQ291bnQgPiAwKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAvL3ZhbGlkYXRpb24gZXJyb3IKKyAgICAgICAgICAgICAgICAgICAgICAgIG5nTW9kZWxDdHJsLiRzZXRWYWxpZGl0eSgndmFsaWRhdGlvblN0YXR1cycsIGZhbHNlKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBbXTsKKyAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIC8vdmFsaWRhdGlvbiBzdWNjZXNzZnVsCisgICAgICAgICAgICAgICAgICAgICAgICBuZ01vZGVsQ3RybC4kc2V0VmFsaWRpdHkoJ3ZhbGlkYXRpb25TdGF0dXMnLCB0cnVlKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBmaW5hbERhdGFNb2RhbDsKKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICAgICAgICAgIC8vZGVmYXVsdCBjYXNlIG5vIHZhbGlkYXRpb24KKyAgICAgICAgICAgICAgICAgICAgbmdNb2RlbEN0cmwuJHNldFZhbGlkaXR5KCd2YWxpZGF0aW9uU3RhdHVzJywgdHJ1ZSk7CisgICAgICAgICAgICAgICAgICAgIHJldHVybiBmaW5hbERhdGFNb2RhbDsKKyAgICAgICAgICAgICAgICB9CisKKyAgICAgICAgICAgIH07CisKKyAgICAgICAgICAgIG5nTW9kZWxDdHJsLiRwYXJzZXJzLnVuc2hpZnQodmFsaWRhdGVDdXN0b21EYXRhKTsKKyAgICAgICAgfQorICAgIH07Cit9XSk7Cithbmd1bGFyLm1vZHVsZSgnYXR0LmFicy5pY29uQnV0dG9ucycsIFtdKQorICAgICAgICAuY29uc3RhbnQoJ2J1dHRvbkNvbmZpZycsIHsKKyAgICAgICAgICAgIGFjdGl2ZUNsYXNzOiAnYWN0aXZlLS1idXR0b24nLAorICAgICAgICAgICAgdG9nZ2xlRXZlbnQ6ICdjbGljaycKKyAgICAgICAgfSkKKyAgICAgICAgLmRpcmVjdGl2ZSgnYXR0SWNvbkJ0blJhZGlvJywgWydidXR0b25Db25maWcnLCBmdW5jdGlvbihidXR0b25Db25maWcpIHsKKyAgICAgICAgICAgICAgICB2YXIgYWN0aXZlQ2xhc3MgPSBidXR0b25Db25maWcuYWN0aXZlQ2xhc3MgfHwgJ2FjdGl2ZS0tYnV0dG9uJzsKKyAgICAgICAgICAgICAgICB2YXIgdG9nZ2xlRXZlbnQgPSBidXR0b25Db25maWcudG9nZ2xlRXZlbnQgfHwgJ2NsaWNrJzsKKyAgICAgICAgICAgICAgICByZXR1cm4geworICAgICAgICAgICAgICAgICAgICByZXF1aXJlOiAnbmdNb2RlbCcsCisgICAgICAgICAgICAgICAgICAgIGxpbms6IGZ1bmN0aW9uKHNjb3BlLCBlbGVtZW50LCBhdHRycywgbmdNb2RlbEN0cmwpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIGVsZW1lbnQuYXR0cigidGFiaW5kZXgiLCIwIik7CisgICAgICAgICAgICAgICAgICAgICAgICBlbGVtZW50LmFwcGVuZCgiPHNwYW4gY2xhc3M9J2hpZGRlbi1zcG9rZW4nPiIrYXR0cnMuYXR0SWNvbkJ0blJhZGlvKyI8L3NwYW4+Iik7CisgICAgICAgICAgICAgICAgICAgICAgICAvL21vZGVsIC0+IFVJCisgICAgICAgICAgICAgICAgICAgICAgICBuZ01vZGVsQ3RybC4kcmVuZGVyID0gZnVuY3Rpb24oKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgZWxlbWVudC5wYXJlbnQoKS50b2dnbGVDbGFzcyhhY3RpdmVDbGFzcywgYW5ndWxhci5lcXVhbHMobmdNb2RlbEN0cmwuJG1vZGVsVmFsdWUsIGF0dHJzLmF0dEljb25CdG5SYWRpbykpOworICAgICAgICAgICAgICAgICAgICAgICAgfTsKKyAgICAgICAgICAgICAgICAgICAgICAgIC8vdWktPm1vZGVsCisgICAgICAgICAgICAgICAgICAgICAgICBlbGVtZW50LnBhcmVudCgpLmJpbmQodG9nZ2xlRXZlbnQsIGZ1bmN0aW9uKCkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICghZWxlbWVudC5wYXJlbnQoKS5oYXNDbGFzcyhhY3RpdmVDbGFzcykpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2NvcGUuJGFwcGx5KGZ1bmN0aW9uKCkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbmdNb2RlbEN0cmwuJHNldFZpZXdWYWx1ZShhdHRycy5hdHRJY29uQnRuUmFkaW8pOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbmdNb2RlbEN0cmwuJHJlbmRlcigpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9KTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICB9KTsKKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIH07CisgICAgICAgICAgICB9XSkKKyAgICAgICAgLmRpcmVjdGl2ZSgnYXR0SWNvbkJ0bkNoZWNrYm94JywgWydidXR0b25Db25maWcnLCBmdW5jdGlvbihidXR0b25Db25maWcpIHsKKyAgICAgICAgICAgICAgICB2YXIgYWN0aXZlQ2xhc3MgPSBidXR0b25Db25maWcuYWN0aXZlQ2xhc3MgfHwgJ2FjdGl2ZS0tYnV0dG9uJzsKKyAgICAgICAgICAgICAgICB2YXIgdG9nZ2xlRXZlbnQgPSBidXR0b25Db25maWcudG9nZ2xlRXZlbnQgfHwgJ2NsaWNrJzsKKyAgICAgICAgICAgICAgICByZXR1cm4geworICAgICAgICAgICAgICAgICAgICByZXF1aXJlOiAnbmdNb2RlbCcsCisgICAgICAgICAgICAgICAgICAgIGxpbms6IGZ1bmN0aW9uKHNjb3BlLCBlbGVtZW50LCBhdHRycywgbmdNb2RlbEN0cmwpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIGVsZW1lbnQuYXR0cigidGFiaW5kZXgiLCIwIik7CisgICAgICAgICAgICAgICAgICAgICAgICBlbGVtZW50LmFwcGVuZCgiPHNwYW4gY2xhc3M9J2hpZGRlbi1zcG9rZW4nPiIrYXR0cnMuYXR0SWNvbkJ0bkNoZWNrYm94KyI8L3NwYW4+Iik7CisgICAgICAgICAgICAgICAgICAgICAgICBmdW5jdGlvbiBnZXRUcnVlVmFsdWUoKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFyIHRydWVWYWx1ZSA9IHNjb3BlLiRldmFsKGF0dHJzLmJ0bkNoZWNrYm94VHJ1ZSk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGFuZ3VsYXIuaXNEZWZpbmVkKHRydWVWYWx1ZSkgPyB0cnVlVmFsdWUgOiB0cnVlOworICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgZnVuY3Rpb24gZ2V0RmFsc2VWYWx1ZSgpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YXIgZmFsc2VWYWx1ZSA9IHNjb3BlLiRldmFsKGF0dHJzLmJ0bkNoZWNrYm94RmFsc2UpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBhbmd1bGFyLmlzRGVmaW5lZChmYWxzZVZhbHVlKSA/IGZhbHNlVmFsdWUgOiBmYWxzZTsKKyAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgIC8vbW9kZWwgLT4gVUkKKyAgICAgICAgICAgICAgICAgICAgICAgIG5nTW9kZWxDdHJsLiRyZW5kZXIgPSBmdW5jdGlvbigpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBlbGVtZW50LnBhcmVudCgpLnRvZ2dsZUNsYXNzKGFjdGl2ZUNsYXNzLCBhbmd1bGFyLmVxdWFscyhuZ01vZGVsQ3RybC4kbW9kZWxWYWx1ZSwgZ2V0VHJ1ZVZhbHVlKCkpKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIH07CisgICAgICAgICAgICAgICAgICAgICAgICAvL3VpLT5tb2RlbAorICAgICAgICAgICAgICAgICAgICAgICAgZWxlbWVudC5wYXJlbnQoKS5iaW5kKHRvZ2dsZUV2ZW50LCBmdW5jdGlvbigpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBzY29wZS4kYXBwbHkoZnVuY3Rpb24oKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG5nTW9kZWxDdHJsLiRzZXRWaWV3VmFsdWUoZWxlbWVudC5wYXJlbnQoKS5oYXNDbGFzcyhhY3RpdmVDbGFzcykgPyBnZXRGYWxzZVZhbHVlKCkgOiBnZXRUcnVlVmFsdWUoKSk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG5nTW9kZWxDdHJsLiRyZW5kZXIoKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB9KTsKKyAgICAgICAgICAgICAgICAgICAgICAgIH0pOworICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgfTsKKyAgICAgICAgICAgIH1dKTsKKworYW5ndWxhci5tb2R1bGUoJ2F0dC5hYnMubGlua3MnLCBbJ25nU2FuaXRpemUnXSkKKyAgICAgICAgLmRpcmVjdGl2ZSgnYXR0TGluaycsIFtmdW5jdGlvbigpIHsKKyAgICAgICAgICAgICAgICByZXR1cm4geworICAgICAgICAgICAgICAgICAgICByZXN0cmljdDogJ0EnLAorICAgICAgICAgICAgICAgICAgICBsaW5rOiBmdW5jdGlvbihzY29wZSwgZWxlbSkgeworICAgICAgICAgICAgICAgICAgICAgICAgZWxlbS5hZGRDbGFzcygnbGluaycpOworICAgICAgICAgICAgICAgICAgICAgICAgaWYoIShlbGVtLmF0dHIoJ2hyZWYnKSkpeworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGVsZW0uYXR0cigidGFiaW5kZXgiLCAiMCIpOworICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgfTsKKyAgICAgICAgICAgIH1dKQorICAgICAgICAuZGlyZWN0aXZlKCdhdHRMaW5rVmlzaXRlZCcsIFtmdW5jdGlvbigpIHsKKyAgICAgICAgICAgICAgICByZXR1cm4geworICAgICAgICAgICAgICAgICAgICByZXN0cmljdDogJ0EnLAorICAgICAgICAgICAgICAgICAgICBsaW5rOiBmdW5jdGlvbihzY29wZSwgZWxlbSkgeworICAgICAgICAgICAgICAgICAgICAgICAgZWxlbS5hZGRDbGFzcygnbGluay0tdmlzaXRlZCcpOworICAgICAgICAgICAgICAgICAgICAgICAgaWYoIShlbGVtLmF0dHIoJ2hyZWYnKSkpeworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGVsZW0uYXR0cigidGFiaW5kZXgiLCAiMCIpOworICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgfTsKKyAgICAgICAgICAgIH1dKQorICAgICAgICAuZGlyZWN0aXZlKCdhdHRSZWFkbW9yZScsIFsnJHRpbWVvdXQnLGZ1bmN0aW9uKCR0aW1lb3V0KSB7CisgICAgICAgICAgICAgICAgcmV0dXJuIHsKKyAgICAgICAgICAgICAgICAgICAgcmVzdHJpY3Q6ICdBJywKKyAgICAgICAgICAgICAgICAgICAgc2NvcGU6IHsKKyAgICAgICAgICAgICAgICAgICAgICAgIGxpbmVzOiJAbm9PZkxpbmVzIiwKKyAgICAgICAgICAgICAgICAgICAgICAgIHRleHRNb2RlbDogIj0iLAorICAgICAgICAgICAgICAgICAgICAgICAgLy9hdHRyaWJ1dGUgdG8gdXNlIHJlYWRtb3JlIGluc2lkZSBhY2NvcmRpb24KKyAgICAgICAgICAgICAgICAgICAgICAgIGlzT3BlbjogIj0iCisgICAgICAgICAgICAgICAgICAgIH0sCisgICAgICAgICAgICAgICAgICAgIHRlbXBsYXRlVXJsOiAnYXBwL3NjcmlwdHMvbmdfanNfYXR0X3RwbHMvbGlua3MvcmVhZE1vcmUuaHRtbCcsCisgICAgICAgICAgICAgICAgICAgIGxpbms6IGZ1bmN0aW9uKHNjb3BlLCBlbGVtKSB7CisgICAgICAgICAgICAgICAgICAgICAgICB2YXIgaGVpZ2h0ID0gMTsKKyAgICAgICAgICAgICAgICAgICAgICAgIHNjb3BlLiR3YXRjaCgndGV4dE1vZGVsJywgZnVuY3Rpb24odmFsKXsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZighdmFsKXsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2NvcGUudGV4dFRvRGlzcGxheSA9ICcnOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzY29wZS5yZWFkTW9yZUxpbmsgPSBmYWxzZTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2NvcGUucmVhZExlc3NMaW5rID0gZmFsc2U7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNjb3BlLnJlYWRGbGFnID0gZmFsc2U7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgICAgIGVsc2V7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICh0eXBlb2YgU3RyaW5nLnByb3RvdHlwZS50cmltICE9PSAnZnVuY3Rpb24nKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBTdHJpbmcucHJvdG90eXBlLnRyaW0gPSBmdW5jdGlvbigpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiB0aGlzLnJlcGxhY2UoL15ccyt8XHMrJC9nLCAnJyk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9OworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNjb3BlLnRleHRUb0Rpc3BsYXkgPSB2YWwudHJpbSgpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzY29wZS5yZWFkRmxhZyA9IHRydWU7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICR0aW1lb3V0KGZ1bmN0aW9uKCkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFyIHJlYWRFbGVtID0gZWxlbVswXS5jaGlsZHJlblswXS5jaGlsZHJlblswXTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmKGhlaWdodD09PTEpeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmKHdpbmRvdy5nZXRDb21wdXRlZFN0eWxlKXsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaGVpZ2h0ID0gcGFyc2VJbnQoc2NvcGUubGluZXMpICogcGFyc2VGbG9hdCh3aW5kb3cuZ2V0Q29tcHV0ZWRTdHlsZShyZWFkRWxlbSxudWxsKS5nZXRQcm9wZXJ0eVZhbHVlKCJoZWlnaHQiKSk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGVsc2UgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBoZWlnaHQgPSBwYXJzZUludChzY29wZS5saW5lcykgKiBwYXJzZUZsb2F0KHJlYWRFbGVtLmN1cnJlbnRTdHlsZS5oZWlnaHQpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzY29wZS5lbGVtSGVpZ2h0ID0gaGVpZ2h0OworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNjb3BlLnJlYWRMaW5rU3R5bGUgPSB7J2hlaWdodCc6IHNjb3BlLmVsZW1IZWlnaHQgKyAncHgnfTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNjb3BlLnJlYWRNb3JlTGluayA9IHRydWU7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNjb3BlLnJlYWRMZXNzTGluayA9IGZhbHNlOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgIH0pOworICAgICAgICAgICAgICAgICAgICAgICAgLy8gQ29kZSB0byB1c2UgcmVhZG1vcmUgaW5zaWRlIGFjY29yZGlvbgorICAgICAgICAgICAgICAgICAgICAgICAgdmFyIHBhcmVudEVsZW0gPSBlbGVtLnBhcmVudCgpOworICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHBhcmVudEVsZW0uaGFzQ2xhc3MoJ2F0dC1hY2NvcmRpb25fX2JvZHknKSkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNjb3BlLiR3YXRjaCgnaXNPcGVuJywgZnVuY3Rpb24odmFsKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICghdmFsKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzY29wZS5yZWFkTW9yZUxpbmsgPSB0cnVlOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2NvcGUucmVhZExlc3NMaW5rID0gZmFsc2U7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzY29wZS5yZWFkTGlua1N0eWxlID0geydoZWlnaHQnOiBzY29wZS5lbGVtSGVpZ2h0ICsgJ3B4J307CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzY29wZS5yZWFkRmxhZyA9IHRydWU7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB9KTsKKyAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgIHNjb3BlLnJlYWRNb3JlID0gZnVuY3Rpb24oKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2NvcGUucmVhZE1vcmVMaW5rID0gZmFsc2U7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2NvcGUucmVhZExlc3NMaW5rID0gdHJ1ZTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBzY29wZS5yZWFkTGlua1N0eWxlID0geydoZWlnaHQnOiAnYXV0byd9OworICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNjb3BlLnJlYWRGbGFnID0gZmFsc2U7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFyIG1vcmVMaW5rID0gYW5ndWxhci5lbGVtZW50KGVsZW0pLmNoaWxkcmVuKCkuZXEoMSkuZmluZCgnYScpWzBdOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICR0aW1lb3V0KGZ1bmN0aW9uKCkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBtb3JlTGluay5mb2N1cygpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9KTsKKyAgICAgICAgICAgICAgICAgICAgICAgIH07CisgICAgICAgICAgICAgICAgICAgICAgICBzY29wZS5yZWFkTGVzcyA9IGZ1bmN0aW9uKCkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNjb3BlLnJlYWRNb3JlTGluayA9IHRydWU7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2NvcGUucmVhZExlc3NMaW5rID0gZmFsc2U7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2NvcGUucmVhZExpbmtTdHlsZSA9IHsnaGVpZ2h0Jzogc2NvcGUuZWxlbUhlaWdodCArICdweCd9OworICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNjb3BlLnJlYWRGbGFnID0gdHJ1ZTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YXIgcmVhZExlc3NMaW5rID0gYW5ndWxhci5lbGVtZW50KGVsZW0pLmNoaWxkcmVuKCkuZXEoMCkuZmluZCgnYScpWzBdOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICR0aW1lb3V0KGZ1bmN0aW9uKCkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZWFkTGVzc0xpbmsuZm9jdXMoKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSk7CisgICAgICAgICAgICAgICAgICAgICAgICB9OworICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgfTsKKyAgICAgICAgICAgIH1dKQorICAgICAgICAuZGlyZWN0aXZlKCdhdHRMaW5rc0xpc3QnLCBbZnVuY3Rpb24oKSB7CisgICAgICAgICAgICAgICAgcmV0dXJuIHsKKyAgICAgICAgICAgICAgICAgICAgcmVzdHJpY3Q6ICdBJywKKyAgICAgICAgICAgICAgICAgICAgY29udHJvbGxlcjogZnVuY3Rpb24oKSB7CisgICAgICAgICAgICAgICAgICAgIH0sCisgICAgICAgICAgICAgICAgICAgIGxpbms6IGZ1bmN0aW9uKHNjb3BlLCBlbGVtKSB7CisgICAgICAgICAgICAgICAgICAgICAgICBlbGVtLmFkZENsYXNzKCdsaW5rcy1saXN0Jyk7CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICB9OworICAgICAgICAgICAgfV0pCisgICAgICAgIC5kaXJlY3RpdmUoJ2F0dExpbmtzTGlzdEl0ZW0nLCBbZnVuY3Rpb24oKSB7CisgICAgICAgICAgICAgICAgcmV0dXJuIHsKKyAgICAgICAgICAgICAgICAgICAgcmVzdHJpY3Q6ICdBJywKKyAgICAgICAgICAgICAgICAgICAgcmVxdWlyZTogJ15hdHRMaW5rc0xpc3QnLAorICAgICAgICAgICAgICAgICAgICBsaW5rOiBmdW5jdGlvbihzY29wZSwgZWxlbSkgeworICAgICAgICAgICAgICAgICAgICAgICAgZWxlbS5hZGRDbGFzcygnbGlua3MtbGlzdF9faXRlbScpOworICAgICAgICAgICAgICAgICAgICAgICAgaWYoIShlbGVtLmF0dHIoJ2hyZWYnKSkpeworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGVsZW0uYXR0cigidGFiaW5kZXgiLCAiMCIpOworICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgfTsKKyAgICAgICAgICAgIH1dKTsKK2FuZ3VsYXIubW9kdWxlKCdhdHQuYWJzLmxvYWRpbmcnLCBbXSkKKyAgICAgICAgLmRpcmVjdGl2ZSgnYXR0TG9hZGluZycsIFsnJHdpbmRvdycsZnVuY3Rpb24oJHdpbmRvdykgeworICAgICAgICAgICAgICAgIHJldHVybiB7CisgICAgICAgICAgICAgICAgICAgIHJlc3RyaWN0OiAnQScsCisgICAgICAgICAgICAgICAgICAgIHJlcGxhY2U6IHRydWUsCisgICAgICAgICAgICAgICAgICAgIHNjb3BlOiB7CisgICAgICAgICAgICAgICAgICAgICAgICBpY29uOiAnQGF0dExvYWRpbmcnLAorICAgICAgICAgICAgICAgICAgICAgICAgcHJvZ3Jlc3NTdGF0dXM6ICc9PycsCisgICAgICAgICAgICAgICAgICAgICAgICBjb2xvckNsYXNzOiAnPT8nCisgICAgICAgICAgICAgICAgICAgIH0sCisgICAgICAgICAgICAgICAgICAgIHRlbXBsYXRlVXJsOiAnYXBwL3NjcmlwdHMvbmdfanNfYXR0X3RwbHMvbG9hZGluZy9sb2FkaW5nLmh0bWwnLAorICAgICAgICAgICAgICAgICAgICBsaW5rOiBmdW5jdGlvbihzY29wZSwgZWxlbWVudCkgeworICAgICAgICAgICAgICAgICAgICAgICAgdmFyIHByb2dyZXNzdmFsdWUgPSBzY29wZS5wcm9ncmVzc1N0YXR1czsKKyAgICAgICAgICAgICAgICAgICAgICAgIHNjb3BlLnByb2dyZXNzU3RhdHVzID0gTWF0aC5taW4oMTAwLCBNYXRoLm1heCgwLCBwcm9ncmVzc3ZhbHVlKSk7CisgICAgICAgICAgICAgICAgICAgICAgICBpZigkd2luZG93Lm5hdmlnYXRvci51c2VyQWdlbnQuaW5kZXhPZigiTVNJRSA4LiIpIT09LTEpeworICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhciBzaGlmdFggPSAwLCBzaGlmdFkgPSBzY29wZS5wcm9ncmVzc1N0YXR1cyAqIDM2OworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGVsZW1lbnQuY3NzKHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJ2JhY2tncm91bmQtcG9zaXRpb24teCcgOiBzaGlmdFgsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICdiYWNrZ3JvdW5kLXBvc2l0aW9uLXknIDogLXNoaWZ0WQorICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0pOworICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9OworICAgICAgICB9XSk7Cithbmd1bGFyLm1vZHVsZSgnYXR0LmFicy5tb2RhbCcsIFsnYXR0LmFicy51dGlsaXRpZXMnXSkKKy8qKgorICogQSBoZWxwZXIsIGludGVybmFsIGRhdGEgc3RydWN0dXJlIHRoYXQgYWN0cyBhcyBhIG1hcCBidXQgYWxzbyBhbGxvd3MgZ2V0dGluZyAvIHJlbW92aW5nCisgKiBlbGVtZW50cyBpbiB0aGUgTElGTyBvcmRlcgorICovCisgIC5mYWN0b3J5KCckJHN0YWNrZWRNYXAnLCBmdW5jdGlvbiAoKSB7CisgICAgcmV0dXJuIHsKKyAgICAgIGNyZWF0ZU5ldzogZnVuY3Rpb24gKCkgeworICAgICAgICB2YXIgc3RhY2sgPSBbXTsKKworICAgICAgICByZXR1cm4geworICAgICAgICAgIGFkZDogZnVuY3Rpb24gKGtleSwgdmFsdWUpIHsKKyAgICAgICAgICAgIHN0YWNrLnB1c2goeworICAgICAgICAgICAgICBrZXk6IGtleSwKKyAgICAgICAgICAgICAgdmFsdWU6IHZhbHVlCisgICAgICAgICAgICB9KTsKKyAgICAgICAgICB9LAorICAgICAgICAgIGdldDogZnVuY3Rpb24gKGtleSkgeworICAgICAgICAgICAgZm9yICh2YXIgaSA9IDA7IGkgPCBzdGFjay5sZW5ndGg7IGkrKykgeworICAgICAgICAgICAgICBpZiAoa2V5ID09PSBzdGFja1tpXS5rZXkpIHsKKyAgICAgICAgICAgICAgICByZXR1cm4gc3RhY2tbaV07CisgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0KKyAgICAgICAgICB9LAorICAgICAgICAgIGtleXM6IGZ1bmN0aW9uKCkgeworICAgICAgICAgICAgdmFyIGtleXMgPSBbXTsKKyAgICAgICAgICAgIGZvciAodmFyIGkgPSAwOyBpIDwgc3RhY2subGVuZ3RoOyBpKyspIHsKKyAgICAgICAgICAgICAga2V5cy5wdXNoKHN0YWNrW2ldLmtleSk7CisgICAgICAgICAgICB9CisgICAgICAgICAgICByZXR1cm4ga2V5czsKKyAgICAgICAgICB9LAorICAgICAgICAgIHRvcDogZnVuY3Rpb24gKCkgeworICAgICAgICAgICAgcmV0dXJuIHN0YWNrW3N0YWNrLmxlbmd0aCAtIDFdOworICAgICAgICAgIH0sCisgICAgICAgICAgcmVtb3ZlOiBmdW5jdGlvbiAoa2V5KSB7CisgICAgICAgICAgICB2YXIgaWR4ID0gLTE7CisgICAgICAgICAgICBmb3IgKHZhciBpID0gMDsgaSA8IHN0YWNrLmxlbmd0aDsgaSsrKSB7CisgICAgICAgICAgICAgIGlmIChrZXkgPT09IHN0YWNrW2ldLmtleSkgeworICAgICAgICAgICAgICAgIGlkeCA9IGk7CisgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIHJldHVybiBzdGFjay5zcGxpY2UoaWR4LCAxKVswXTsKKyAgICAgICAgICB9LAorICAgICAgICAgIHJlbW92ZVRvcDogZnVuY3Rpb24gKCkgeworICAgICAgICAgICAgcmV0dXJuIHN0YWNrLnNwbGljZShzdGFjay5sZW5ndGggLSAxLCAxKVswXTsKKyAgICAgICAgICB9LAorICAgICAgICAgIGxlbmd0aDogZnVuY3Rpb24gKCkgeworICAgICAgICAgICAgcmV0dXJuIHN0YWNrLmxlbmd0aDsKKyAgICAgICAgICB9CisgICAgICAgIH07CisgICAgICB9CisgICAgfTsKKyAgfSkKKworLyoqCisgKiBBIGhlbHBlciBkaXJlY3RpdmUgZm9yIHRoZSAkbW9kYWwgc2VydmljZS4gSXQgY3JlYXRlcyBhIGJhY2tkcm9wIGVsZW1lbnQuCisgKi8KKyAgLmRpcmVjdGl2ZSgnbW9kYWxCY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YmIGF0dHJzWydtb2RhbFRpdGxlJ10hPT0iIikgeworCQkJZWxlbWVudFswXS5zZXRBdHRyaWJ1dGUoJ2FyaWEtbGFiZWwnLCBhdHRyc1snbW9kYWxUaXRsZSddKTsKKwkJCWVsZW1lbnRbMF0ucmVtb3ZlQXR0cmlidXRlKCdtb2RhbC10aXRsZScpOworCQl9CisgICAgICAgICR0aW1lb3V0KGZ1bmN0aW9uICgpIHsKKyAgICAgICAgICAgIC8vIHRyaWdnZXIgQ1NTIHRyYW5zaXRpb25zCisgICAgICAgICAgICBzY29wZS5mb2N1c01vZGFsRmxhZyA9IHRydWU7CisgICAgICAgICAgICBzY29wZS5hbmltYXRlID0gdHJ1ZTsKKyAgICAgICAgfSk7CisJCSRkb2N1bWVudC5vbignZm9jdXMga2V5ZG93bicsIGZ1bmN0aW9uKGUpeworICAgICAgICAgICAgICAgICAgICBpZiAoZS53aGljaCA9PT05KSB7CisJCQlTdHJpbmcucHJvdG90eXBlLmNvbnRhaW5zID0gZnVuY3Rpb24oaXQpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gdGhpcy5pbmRleE9mKGl0KSAhPT0gLTE7CisgICAgICAgICAgICAgICAgICAgICAgICB9OworCQkJaWYgKGVsZW1lbnRbMF0gIT09IGUudGFyZ2V0ICYmICFlbGVtZW50WzBdLmNvbnRhaW5zKCBlLnRhcmdldCApKSB7CisJCQkJZWxlbWVudFswXS5mb2N1cygpOworCQkJfQorCQkJfQorCQl9KTsKKyAgICAgICAgc2NvcGUuY2xvc2UgPSBmdW5jdGlvbiAoZXZ0KSB7CisgICAgICAgICAgICB2YXIgbW9kYWwgPSAkbW9kYWxTdGFjay5nZXRUb3AoKTsKKyAgICAgICAgICAgIGlmIChtb2RhbCAmJiBtb2RhbC52YWx1ZS5iYWNrZHJvcCAmJiBtb2RhbC52YWx1ZS5iYWNrZHJvcCAhPSAnc3RhdGljJyAgJiYgKGV2dC50YXJnZXQgPT09IGV2dC5jdXJyZW50VGFyZ2V0KSkgeworICAgICAgICAgICAgLy8gQ2hlY2sgaWYgcHJldmVudERlZmF1bHQgZXhpc3RzIGR1ZSB0byBsYWNrIG9mIHN1cHBvcnQgZm9yIElFOAorICAgICAgICAgICAgaWYgKGV2dC5wcmV2ZW50RGVmYXVsdCkgeworICAgICAgICAgICAgICBldnQucHJldmVudERlZmF1bHQoKTsKKyAgICAgICAgICAgICAgZXZ0LnN0b3BQcm9wYWdhdGlvbigpOworICAgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICAgIGV2dC5yZXR1cm5WYWx1ZSA9IGZhbHNlOworICAgICAgICAgICAgfQorICAgICAgICAgICAgJG1vZGFsU3RhY2suZGlzbWlzcyhtb2RhbC5rZXksICdiYWNrZHJvcCBjbGljaycpOworICAgICAgICAgIH0KKyAgICAgICAgfTsKKyAgICAgIH0KKyAgICB9OworICB9XSkKKworICAuZmFjdG9yeSgnJG1vZGFsU3RhY2snLCBbJyRkb2N1bWVudCcsICckY29tcGlsZScsICckcm9vdFNjb3BlJywgJyQkc3RhY2tlZE1hcCcsICdldmVudHMnLCAna2V5bWFwJywKKyAgICBmdW5jdGlvbiAoJGRvY3VtZW50LCAkY29tcGlsZSwgJHJvb3RTY29wZSwgJCRzdGFja2VkTWFwLCBldmVudHMsIGtleW1hcCkgeworICAgICAgdmFyIE9QRU5FRF9NT0RBTF9DTEFTUyA9ICdtb2RhbC1vcGVuJzsKKyAgICAgIHZhciBiYWNrZHJvcGpxTGl0ZUVsLCBiYWNrZHJvcERvbUVsOworICAgICAgdmFyIGJhY2tkcm9wU2NvcGUgPSAkcm9vdFNjb3BlLiRuZXcodHJ1ZSk7CisgICAgICB2YXIgb3BlbmVkV2luZG93cyA9ICQkc3RhY2tlZE1hcC5jcmVhdGVOZXcoKTsKKyAgICAgIHZhciAkbW9kYWxTdGFjayA9IHt9OworICAgICAgdmFyIG1vZGFsTGF1bmNoaW5nRWxlbWVudCA9IHVuZGVmaW5lZDsKKyAgICAgIGZ1bmN0aW9uIGJhY2tkcm9wSW5kZXgoKSB7CisgICAgICAgIHZhciB0b3BCYWNrZHJvcEluZGV4ID0gLTE7CisgICAgICAgIHZhciBvcGVuZWQgPSBvcGVuZWRXaW5kb3dzLmtleXMoKTsKKyAgICAgICAgZm9yICh2YXIgaSA9IDA7IGkgPCBvcGVuZWQubGVuZ3RoOyBpKyspIHsKKyAgICAgICAgICBpZiAob3BlbmVkV2luZG93cy5nZXQob3BlbmVkW2ldKS52YWx1ZS5iYWNrZHJvcCkgeworICAgICAgICAgICAgdG9wQmFja2Ryb3BJbmRleCA9IGk7CisgICAgICAgICAgfQorICAgICAgICB9CisgICAgICAgIHJldHVybiB0b3BCYWNrZHJvcEluZGV4OworICAgICAgfQorCisgICAgICAkcm9vdFNjb3BlLiR3YXRjaChiYWNrZHJvcEluZGV4LCBmdW5jdGlvbihuZXdCYWNrZHJvcEluZGV4KXsKKyAgICAgICAgYmFja2Ryb3BTY29wZS5pbmRleCA9IG5ld0JhY2tkcm9wSW5kZXg7CisgICAgICB9KTsKKworICAgICAgZnVuY3Rpb24gcmVtb3ZlTW9kYWxXaW5kb3cobW9kYWxJbnN0YW5jZSkgeworCisgICAgICAgIHZhciBib2R5ID0gJGRvY3VtZW50LmZpbmQoJ2JvZHknKS5lcSgwKTsKKyAgICAgICAgdmFyIGh0bWwgPSAkZG9jdW1lbnQuZmluZCgnaHRtbCcpLmVxKDApOworICAgICAgICB2YXIgbW9kYWxXaW5kb3cgPSBvcGVuZWRXaW5kb3dzLmdldChtb2RhbEluc3RhbmNlKS52YWx1ZTsKKyAgICAgICAgLy9jbGVhbiB1cCB0aGUgc3RhY2sKKyAgICAgICAgb3BlbmVkV2luZG93cy5yZW1vdmUobW9kYWxJbnN0YW5jZSk7CisgICAgICAgIC8vLy9yZW1vdmUgd2luZG93IERPTSBlbGVtZW50CisgICAgICAgIG1vZGFsV2luZG93Lm1vZGFsRG9tRWwucmVtb3ZlKCk7CisgICAgICAgIGJvZHkudG9nZ2xlQ2xhc3MoT1BFTkVEX01PREFMX0NMQVNTLCBvcGVuZWRXaW5kb3dzLmxlbmd0aCgpID4gMCk7CisgICAgICAgIGh0bWwuY3NzKHtvdmVyZmxvdzogJ3Njcm9sbCd9KTsKKworICAgICAgICAvL3JlbW92ZSBiYWNrZHJvcCBpZiBubyBsb25nZXIgbmVlZGVkCisgICAgICAgIGlmIChiYWNrZHJvcERvbUVsICYmIGJhY2tkcm9wSW5kZXgoKSA9PSAtMSkgeworICAgICAgICAgIGJhY2tkcm9wRG9tRWwucmVtb3ZlKCk7CisgICAgICAgICAgYmFja2Ryb3BEb21FbCA9IHVuZGVmaW5lZDsKKyAgICAgICAgfQorICAgICAgICAvL2Rlc3Ryb3kgc2NvcGUKKyAgICAgICAgbW9kYWxXaW5kb3cubW9kYWxTY29wZS4kZGVzdHJveSgpOworICAgICAgICAgIAorICAgICAgICAvLyBTaGlmdCBmb2N1cworICAgICAgICBpZiAoYW5ndWxhci5pc0RlZmluZWQobW9kYWxMYXVuY2hpbmdFbGVtZW50KSAmJiBtb2RhbExhdW5jaGluZ0VsZW1lbnQgIT0gbnVsbCkgeworICAgICAgICAgICAgbW9kYWxMYXVuY2hpbmdFbGVtZW50LmZvY3VzKCk7CisgICAgICAgIH0KKyAgICAgIH0KKyAgICAgICRkb2N1bWVudC5iaW5kKCdrZXlkb3duJywgZnVuY3Rpb24gKGV2dCkgeworICAgICAgICB2YXIgbW9kYWw7CisgICAgICAgIGlmIChldnQud2hpY2ggPT09IDI3KSB7CisgICAgICAgICAgbW9kYWwgPSBvcGVuZWRXaW5kb3dzLnRvcCgpOworICAgICAgICAgIGlmIChtb2RhbCAmJiBtb2RhbC52YWx1ZS5rZXlib2FyZCkgeworICAgICAgICAgICAgJHJvb3RTY29wZS4kYXBwbHkoZnVuY3Rpb24gKCkgeworICAgICAgICAgICAgICAkbW9kYWxTdGFjay5kaXNtaXNzKG1vZGFsLmtleSk7CisgICAgICAgICAgICB9KTsKKyAgICAgICAgICB9CisgICAgICAgIH0gZWxzZSBpZiAoZXZ0LmtleUNvZGUgPT09IGtleW1hcC5LRVkuQkFDS1NQQUNFKSB7CisgICAgICAgICAgdmFyIGRvUHJldmVudCA9IGZhbHNlOworICAgICAgICAgIHZhciBkID0gZXZ0LnNyY0VsZW1lbnQgfHwgZXZ0LnRhcmdldDsKKyAgICAgICAgICB2YXIgdHlwZTsKKyAgICAgICAgICBpZiAoZC50eXBlID09PSB1bmRlZmluZWQpIHsgCisgICAgICAgICAgICAgICAgZG9QcmV2ZW50ID0gdHJ1ZTsKKyAgICAgICAgICB9IGVsc2UgaWYgKGQudGFnTmFtZS50b1VwcGVyQ2FzZSgpID09PSAnSU5QVVQnICYmIAorICAgICAgICAgICAgKCAodHlwZSA9IGQudHlwZS50b1VwcGVyQ2FzZSgpKSA9PT0gJ1RFWFQnIHx8IAorICAgICAgICAgICAgICB0eXBlID09PSAnUEFTU1dPUkQnIHx8IAorICAgICAgICAgICAgICB0eXBlID09PSAnRklMRScgfHwKKyAgICAgICAgICAgICAgdHlwZSA9PT0gJ1NFQVJDSCcgfHwKKyAgICAgICAgICAgICAgdHlwZSA9PT0gJ0VNQUlMJyB8fAorICAgICAgICAgICAgICB0eXBlID09PSAnTlVNQkVSJyB8fAorICAgICAgICAgICAgICB0eXBlID09PSAnREFURScgfHwKKyAgICAgICAgICAgICAgdHlwZSA9PT0gJ1RFTCcgfHwKKyAgICAgICAgICAgICAgdHlwZSA9PT0gJ1VSTCcgfHwKKyAgICAgICAgICAgICAgdHlwZSA9PT0gJ1RJTUUnKQorICAgICAgICAgICAgfHwgZC50YWdOYW1lLnRvVXBwZXJDYXNlKCkgPT09ICdURVhUQVJFQScpIHsKKyAgICAgICAgICAgICAgICBkb1ByZXZlbnQgPSBkLnJlYWRPbmx5IHx8IGQuZGlzYWJsZWQ7CisgICAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgIGRvUHJldmVudCA9IHRydWU7CisgICAgICAgICAgfQorICAgICAgICAgIGlmIChkb1ByZXZlbnQpIHsKKyAgICAgICAgICAgICAgZXZlbnRzLnByZXZlbnREZWZhdWx0KGV2dCk7CisgICAgICAgICAgfQorICAgICAgICB9CisgICAgICB9KTsKKworICAgICAgJG1vZGFsU3RhY2sub3BlbiA9IGZ1bmN0aW9uIChtb2RhbEluc3RhbmNlLCBtb2RhbCkgeworICAgICAgICAgIG9wZW5lZFdpbmRvd3MuYWRkKG1vZGFsSW5zdGFuY2UsIHsKKyAgICAgICAgICBkZWZlcnJlZDogbW9kYWwuZGVmZXJyZWQsCisgICAgICAgICAgbW9kYWxTY29wZTogbW9kYWwuc2NvcGUsCisgICAgICAgICAgYmFja2Ryb3A6IG1vZGFsLmJhY2tkcm9wLAorICAgICAgICAgIGtleWJvYXJkOiBtb2RhbC5rZXlib2FyZAorICAgICAgICB9KTsKKyAgICAgICAgCisgICAgICAgIC8vQmVmb3JlIG9wZW5pbmcgbW9kYWwsIGZpbmQgdGhlIGZvY3VzZWQgZWxlbWVudAorICAgICAgICBtb2RhbExhdW5jaGluZ0VsZW1lbnQgPSBkb2N1bWVudC5hY3RpdmVFbGVtZW50OworICAgICAgICAKKyAgICAgICAgdmFyIGJvZHkgPSAkZG9jdW1lbnQuZmluZCgnYm9keScpLmVxKDApOworICAgICAgICB2YXIgaHRtbCA9ICRkb2N1bWVudC5maW5kKCdodG1sJykuZXEoMCk7CisKKyAgICAgICAgaWYgKGJhY2tkcm9wSW5kZXgoKSA+PSAwICYmICFiYWNrZHJvcERvbUVsKSB7CisgICAgICAgICAgICBiYWNrZHJvcGpxTGl0ZUVsID0gYW5ndWxhci5lbGVtZW50KCc8ZGl2IG1vZGFsLWJhY2tkcm9wPjwvZGl2PicpOworICAgICAgICAgICAgYmFja2Ryb3BEb21FbCA9ICRjb21waWxlKGJhY2tkcm9wanFMaXRlRWwpKGJhY2tkcm9wU2NvcGUpOworICAgICAgICAgICAgYm9keS5hcHBlbmQoYmFja2Ryb3BEb21FbCk7CisgICAgICAgIH0KKyA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ZnVuY3Rpb24gKG1vZGFsSW5zdGFuY2UsIHJlYXNvbikgeworICAgICAgICB2YXIgbW9kYWxXaW5kb3cgPSBvcGVuZWRXaW5kb3dzLmdldChtb2RhbEluc3RhbmNlKS52YWx1ZTsKKyAgICAgICAgaWYgKG1vZGFsV2luZG93KSB7CisgICAgICAgICAgbW9kYWxXaW5kb3cuZGVmZXJyZWQucmVqZWN0KHJlYXNvbik7CisgICAgICAgICAgcmVtb3ZlTW9kYWxXaW5kb3cobW9kYWxJbnN0YW5jZSk7CisgICAgICAgIH0KKyAgICAgIH07CisKKyAgICAgICRtb2RhbFN0YWNrLmdldFRvcCA9IGZ1bmN0aW9uICgpIHsKKyAgICAgICAgcmV0dXJuIG9wZW5lZFdpbmRvd3MudG9wKCk7CisgICAgICB9OworCisgICAgICByZXR1cm4gJG1vZGFsU3RhY2s7CisgICAgfV0pCisKKyAgLnByb3ZpZGVyKCckbW9kYWwnLCBmdW5jdGlvbiAoKSB7CisKKyAgICB2YXIgJG1vZGFsUHJvdmlkZXIgPSB7CisgICAgICBvcHRpb25zOiB7CisgICAgICAgIC8vY2FuIGJlIGFsc28gZmFsc2Ugb3IgJ3N0YXRpYycKKyAgICAgICAgYmFja2Ryb3A6IHRydWUsCisgICAgICAgIGtleWJvYXJkOiB0cnVlCisgICAgICB9LAorICAgICAgJGdldDogWyckaW5qZWN0b3InLCAnJHJvb3RTY29wZScsICckcScsICckaHR0cCcsICckdGVtcGxhdGVDYWNoZScsICckY29udHJvbGxlcicsICckbW9kYWxTdGFjaycsCisgICAgICAgIGZ1bmN0aW9uICgkaW5qZWN0b3IsICRyb290U2NvcGUsICRxLCAkaHR0cCwgJHRlbXBsYXRlQ2FjaGUsICRjb250cm9sbGVyLCAkbW9kYWxTdGFjaykgeworICAgICAgICAgICAgdmFyICRtb2RhbCA9IHt9OworICAgICAgICAgICAgZnVuY3Rpb24gZ2V0VGVtcGxhdGVQcm9taXNlKG9wdGlvbnMpIHsKKyAgICAgICAgICAgIHJldHVybiBvcHRpb25zLnRlbXBsYXRlID8gJHEud2hlbihvcHRpb25zLnRlbXBsYXRlKSA6CisgICAgICAgICAgICAgICRodHRwLmdldChvcHRpb25zLnRlbXBsYXRlVXJsLCB7Y2FjaGU6ICR0ZW1wbGF0ZUNhY2hlfSkudGhlbihmdW5jdGlvbiAocmVzdWx0KSB7CisgICAgICAgICAgICAgICAgcmV0dXJuIHJlc3VsdC5kYXRhOworICAgICAgICAgICAgICB9KTsKKyAgICAgICAgICB9CisKKyAgICAgICAgICBmdW5jdGlvbiBnZXRSZXNvbHZlUHJvbWlzZXMocmVzb2x2ZXMpIHsKKyAgICAgICAgICAgIHZhciBwcm9taXNlc0FyciA9IFtdOworICAgICAgICAgICAgYW5ndWxhci5mb3JFYWNoKHJlc29sdmVzLCBmdW5jdGlvbiAodmFsdWUpIHsKKyAgICAgICAgICAgICAgaWYgKGFuZ3VsYXIuaXNGdW5jdGlvbih2YWx1ZSkgfHwgYW5ndWxhci5pc0FycmF5KHZhbHVlKSkgeworICAgICAgICAgICAgICAgIHByb21pc2VzQXJyLnB1c2goJHEud2hlbigkaW5qZWN0b3IuaW52b2tlKHZhbHVlKSkpOworICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9KTsKKyAgICAgICAgICAgIHJldHVybiBwcm9taXNlc0FycjsKKyAgICAgICAgICB9CisgICAgICAgICAgJG1vZGFsLm9wZW4gPSBmdW5jdGlvbiAobW9kYWxPcHRpb25zKSB7CisgICAgICAgICAgICB2YXIgbW9kYWxSZXN1bHREZWZlcnJlZCA9ICRxLmRlZmVyKCk7CisgICAgICAgICAgICB2YXIgbW9kYWxPcGVuZWREZWZlcnJlZCA9ICRxLmRlZmVyKCk7CisKKyAgICAgICAgICAgIC8vcHJlcGFyZSBhbiBpbnN0YW5jZSBvZiBhIG1vZGFsIHRvIGJlIGluamVjdGVkIGludG8gY29udHJvbGxlcnMgYW5kIHJldHVybmVkIHRvIGEgY2FsbGVyCisgICAgICAgICAgICB2YXIgbW9kYWxJbnN0YW5jZSA9IHsKKyAgICAgICAgICAgICAgcmVzdWx0OiBtb2RhbFJlc3VsdERlZmVycmVkLnByb21pc2UsCisgICAgICAgICAgICAgIG9wZW5lZDogbW9kYWxPcGVuZWREZWZlcnJlZC5wcm9taXNlLAorICAgICAgICAgICAgICBjbG9zZTogZnVuY3Rpb24gKHJlc3VsdCkgeworICAgICAgICAgICAgICAgICRtb2RhbFN0YWNrLmNsb3NlKG1vZGFsSW5zdGFuY2UsIHJlc3VsdCk7CisgICAgICAgICAgICAgIH0sCisgICAgICAgICAgICAgIGRpc21pc3M6IGZ1bmN0aW9uIChyZWFzb24pIHsKKyAgICAgICAgICAgICAgICAkbW9kYWxTdGFjay5kaXNtaXNzKG1vZGFsSW5zdGFuY2UsIHJlYXNvbik7CisgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH07CisgICAgICAgICAgICAvL21lcmdlIGFuZCBjbGVhbiB1cCBvcHRpb25zCisgICAgICAgICAgICBtb2RhbE9wdGlvbnMgPSBhbmd1bGFyLmV4dGVuZCh7fSwgJG1vZGFsUHJvdmlkZXIub3B0aW9ucywgbW9kYWxPcHRpb25zKTsKKyAgICAgICAgICAgIG1vZGFsT3B0aW9ucy5yZXNvbHZlID0gbW9kYWxPcHRpb25zLnJlc29sdmUgfHwge307CisKKyAgICAgICAgICAgIC8vdmVyaWZ5IG9wdGlvbnMKKyAgICAgICAgICAgIGlmICghbW9kYWxPcHRpb25zLnRlbXBsYXRlICYmICFtb2RhbE9wdGlvbnMudGVtcGxhdGVVcmwpIHsKKyAgICAgICAgICAgICAgdGhyb3cgbmV3IEVycm9yKCdPbmUgb2YgdGVtcGxhdGUgb3IgdGVtcGxhdGVVcmwgb3B0aW9ucyBpcyByZXF1aXJlZC4nKTsKKyAgICAgICAgICAgIH0KKworICAgICAgICAgICAgdmFyIHRlbXBsYXRlQW5kUmVzb2x2ZVByb21pc2UgPQorICAgICAgICAgICAgICAkcS5hbGwoW2dldFRlbXBsYXRlUHJvbWlzZShtb2RhbE9wdGlvbnMpXS5jb25jYXQoZ2V0UmVzb2x2ZVByb21pc2VzKG1vZGFsT3B0aW9ucy5yZXNvbHZlKSkpOworICAgICAgICAgICAgICB0ZW1wbGF0ZUFuZFJlc29sdmVQcm9taXNlLnRoZW4oZnVuY3Rpb24odHBsQW5kVmFycykgeworICAgICAgICAgICAgICB2YXIgbW9kYWxTY29wZSA9IChtb2RhbE9wdGlvbnMuc2NvcGUgfHwgJHJvb3RTY29wZSkuJG5ldygpOworICAgICAgICAgICAgICBtb2RhbFNjb3BlLiRjbG9zZSA9IG1vZGFsSW5zdGFuY2UuY2xvc2U7CisgICAgICAgICAgICAgIG1vZGFsU2NvcGUuJGRpc21pc3MgPSBtb2RhbEluc3RhbmNlLmRpc21pc3M7CisKKyAgICAgICAgICAgICAgdmFyIGN0cmxJbnN0YW5jZSwgY3RybExvY2FscyA9IHt9OworICAgICAgICAgICAgICB2YXIgcmVzb2x2ZUl0ZXIgPSAxOworCisgICAgICAgICAgICAgIC8vY29udHJvbGxlcnMKKyAgICAgICAgICAgICAgaWYgKG1vZGFsT3B0aW9ucy5jb250cm9sbGVyKSB7CisgICAgICAgICAgICAgICAgY3RybExvY2Fscy4kc2NvcGUgPSBtb2RhbFNjb3BlOworICAgICAgICAgICAgICAgIGN0cmxMb2NhbHMuJG1vZGFsSW5zdGFuY2UgPSBtb2RhbEluc3RhbmNlOworICAgICAgICAgICAgICAgIGFuZ3VsYXIuZm9yRWFjaChtb2RhbE9wdGlvbnMucmVzb2x2ZSwgZnVuY3Rpb24gKHZhbHVlLCBrZXkpIHsKKyAgICAgICAgICAgICAgICAgIGN0cmxMb2NhbHNba2V5XSA9IHRwbEFuZFZhcnNbcmVzb2x2ZUl0ZXIrK107CisgICAgICAgICAgICAgICAgfSk7CisKKyAgICAgICAgICAgICAgICBjdHJsSW5zdGFuY2UgPSAkY29udHJvbGxlcihtb2RhbE9wdGlvbnMuY29udHJvbGxlciwgY3RybExvY2Fscyk7CisgICAgICAgICAgICAgIH0KKworICAgICAgICAgICAgICAkbW9kYWxTdGFjay5vcGVuKG1vZGFsSW5zdGFuY2UsIHsKKyAgICAgICAgICAgICAgICBzY29wZTogbW9kYWxTY29wZSwKKyAgICAgICAgICAgICAgICBkZWZlcnJlZDogbW9kYWxSZXN1bHREZWZlcnJlZCwKKyAgICAgICAgICAgICAgICBjb250ZW50OiB0cGxBbmRWYXJzWzBdLAorICAgICAgICAgICAgICAgIGJhY2tkcm9wOiBtb2RhbE9wdGlvbnMuYmFja2Ryb3AsCisgICAgICAgICAgICAgICAga2V5Ym9hcmQ6IG1vZGFsT3B0aW9ucy5rZXlib2FyZCwKKyAgICAgICAgICAgICAgICB3aW5kb3dDbGFzczogbW9kYWxPcHRpb25zLndpbmRvd0NsYXNzLAorCQkJCW1vZGFsVGl0bGU6IG1vZGFsT3B0aW9ucy5tb2RhbFRpdGxlCisgICAgICAgICAgICAgIH0pOworCisgICAgICAgICAgICB9LCBmdW5jdGlvbihyZWFzb24pIHsKKyAgICAgICAgICAgICAgbW9kYWxSZXN1bHREZWZlcnJlZC5yZWplY3QocmVhc29uKTsKKyAgICAgICAgICAgIH0pOworCisgICAgICAgICAgICB0ZW1wbGF0ZUFuZFJlc29sdmVQcm9taXNlLnRoZW4oZnVuY3Rpb24gKCkgeworICAgICAgICAgICAgICBtb2RhbE9wZW5lZERlZmVycmVkLnJlc29sdmUodHJ1ZSk7CisgICAgICAgICAgICB9LCBmdW5jdGlvbiAoKSB7CisgICAgICAgICAgICAgIG1vZGFsT3BlbmVkRGVmZXJyZWQucmVqZWN0KGZhbHNlKTsKKyAgICAgICAgICAgIH0pOworCisgICAgICAgICAgICByZXR1cm4gbW9kYWxJbnN0YW5jZTsKKyAgICAgICAgICB9OworCisgICAgICAgICAgcmV0dXJuICRtb2RhbDsKKyAgICAgICAgfV0KKyAgICB9OworCisgICAgcmV0dXJuICRtb2RhbFByb3ZpZGVyOworICB9KQorCisuZGlyZWN0aXZlKCJzaW1wbGVNb2RhbCIsIFsiJG1vZGFsIiwgZnVuY3Rpb24oJG1vZGFsKSB7CisgICAgICAgIHJldHVybiB7CisgICAgICAgICAgICByZXN0cmljdDogJ0VBJywKKyAgICAgICAgICAgIHNjb3BlOiB7CisgICAgICAgICAgICAgICAgc2ltcGxlTW9kYWw6ICdAJywKKyAgICAgICAgICAgICAgICBiYWNrZHJvcDonQCcsCisgICAgICAgICAgICAgICAga2V5Ym9hcmQ6J0AnLAorICAgICAgICAgICAgICAgIG1vZGFsT2s6JyYnLAorICAgICAgICAgICAgICAgIG1vZGFsQ2FuY2VsOicmJywKKyAgICAgICAgICAgICAgICB3aW5kb3dDbGFzczonQCcsCisgICAgICAgICAgICAgICAgY29udHJvbGxlcjonQCcsCisJCQkJbW9kYWxUaXRsZTogJ0A/JworICAgICAgICAgICAgfSwKKyAgICAgICAgICAgIGxpbms6IGZ1bmN0aW9uKHNjb3BlLCBlbG0pIHsKKyAgICAgICAgICAgICAgICBlbG0uYmluZCgnY2xpY2snLCBmdW5jdGlvbihldikgeworICAgICAgICAgICAgICAgICAgICBldi5wcmV2ZW50RGVmYXVsdCgpOworICAgICAgICAgICAgICAgICAgICBpZiAoYW5ndWxhci5pc0RlZmluZWQoZWxtLmF0dHIoImhyZWYiKSkgJiYgZWxtLmF0dHIoImhyZWYiKSAhPT0gIiIpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIHNjb3BlLnNpbXBsZU1vZGFsID0gZWxtLmF0dHIoImhyZWYiKTsKKyAgICAgICAgICAgICAgICAgICAgfQorCisgICAgICAgICAgICAgICAgICAgIHNjb3BlLmJhY2tkcm9wID09PSAiZmFsc2UiID8gc2NvcGUuYmFja2Ryb3BjbGljayA9ICdzdGF0aWMnIDogc2NvcGUuYmFja2Ryb3BjbGljayA9IHRydWU7CisgICAgICAgICAgICAgICAgICAgIHNjb3BlLmtleWJvYXJkID09PSAiZmFsc2UiID8gc2NvcGUua2V5Ym9hcmRldiA9IGZhbHNlIDogc2NvcGUua2V5Ym9hcmRldiA9IHRydWU7CisKKyAgICAgICAgICAgICAgICAgICAgJG1vZGFsLm9wZW4oeworICAgICAgICAgICAgICAgICAgICAgICAgdGVtcGxhdGVVcmw6IHNjb3BlLnNpbXBsZU1vZGFsLAorICAgICAgICAgICAgICAgICAgICAgICAgYmFja2Ryb3A6c2NvcGUuYmFja2Ryb3BjbGljaywKKyAgICAgICAgICAgICAgICAgICAgICAgIGtleWJvYXJkOnNjb3BlLmtleWJvYXJkZXYsCisgICAgICAgICAgICAgICAgICAgICAgICB3aW5kb3dDbGFzczpzY29wZS53aW5kb3dDbGFzcywKKyAgICAgICAgICAgICAgICAgICAgICAgIGNvbnRyb2xsZXI6IHNjb3BlLmNvbnRyb2xsZXIsCisJCQkJCQltb2RhbFRpdGxlOiBzY29wZS5tb2RhbFRpdGxlCisgICAgICAgICAgICAgICAgICAgIH0pLnJlc3VsdC50aGVuKHNjb3BlLm1vZGFsT2ssIHNjb3BlLm1vZGFsQ2FuY2VsKTsKKyAgICAgICAgICAgICAgICB9KTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfTsKKyAgICB9XSkKKworLmRpcmVjdGl2ZSgndGFiYmVkSXRlbScsIFsnJG1vZGFsJywgJyRsb2cnLGZ1bmN0aW9uICgkbW9kYWwsICRsb2cpeworICAgIHJldHVybiB7CisgICAgICAgIHJlc3RyaWN0OiAnQUUnLAorICAgICAgICByZXBsYWNlOiB0cnVlLAorICAgICAgICBzY29wZTogeworICAgICAgICAgICAgaXRlbXM6ICI9aXRlbXMiLAorICAgICAgICAgICAgY29udHJvbGxlcjogIkAiLAorICAgICAgICAgICAgdGVtcGxhdGVJZDoiQCIsCisJCQltb2RhbFRpdGxlOiAnQD8nCisgICAgICAgIH0sCisgICAgICAgIHRlbXBsYXRlVXJsOiAnYXBwL3NjcmlwdHMvbmdfanNfYXR0X3RwbHMvbW9kYWwvdGFiYmVkSXRlbS5odG1sJywKKyAgICAgICAgY29udHJvbGxlcjogWyckc2NvcGUnLCAnJHJvb3RTY29wZScsICckYXR0cnMnLCBmdW5jdGlvbiAoJHNjb3BlKSB7CisgICAgICAgICAgICAgICAgJHNjb3BlLmNsaWNrVGFiID0gZnVuY3Rpb24gKGluZGV4KSB7CisgICAgICAgICAgICAgICAgICAgIGZvciAodmFyIGkgPSAwOyBpIDwgJHNjb3BlLml0ZW1zLmxlbmd0aDsgaSsrKSB7CisgICAgICAgICAgICAgICAgICAgICAgICBpZiAoaSA9PT0gaW5kZXgpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAkc2NvcGUuaXRlbXNbaV0uaXNUYWJPcGVuID0gdHJ1ZTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAkc2NvcGUuaXRlbXNbaV0uc2hvd0RhdGEgPSB0cnVlOworICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgZWxzZSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgJHNjb3BlLml0ZW1zW2ldLmlzVGFiT3BlbiA9IGZhbHNlOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICRzY29wZS5pdGVtc1tpXS5zaG93RGF0YSA9IGZhbHNlOworICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgIHZhciBtb2RhbEluc3RhbmNlID0gJG1vZGFsLm9wZW4oeworICAgICAgICAgICAgICAgICAgICAgICAgdGVtcGxhdGVVcmw6ICRzY29wZS50ZW1wbGF0ZUlkLAorICAgICAgICAgICAgICAgICAgICAgICAgY29udHJvbGxlcjogJHNjb3BlLmNvbnRyb2xsZXIsCisgICAgICAgICAgICAgICAgICAgICAgICB3aW5kb3dDbGFzczogJ3RhYmJlZE92ZXJsYXlfbW9kYWwnLAorCQkJCQkJbW9kYWxUaXRsZTogJHNjb3BlLm1vZGFsVGl0bGUsCisgICAgICAgICAgICAgICAgICAgICAgICByZXNvbHZlOiB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgaXRlbXM6IGZ1bmN0aW9uICgpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuICRzY29wZS5pdGVtczsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgIH0pOworICAgICAgICAgICAgICAgICAgICBtb2RhbEluc3RhbmNlLnJlc3VsdC50aGVuKGZ1bmN0aW9uIChzZWxlY3RlZEl0ZW0pIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICRzY29wZS5zZWxlY3RlZCA9IHNlbGVjdGVkSXRlbTsKKyAgICAgICAgICAgICAgICAgICAgfSwgZnVuY3Rpb24gKCkgeworICAgICAgICAgICAgICAgICAgICAgICAgJGxvZy5pbmZvKCdNb2RhbCBkaXNtaXNzZWQgYXQ6ICcgKyBuZXcgRGF0ZSgpKTsKKyAgICAgICAgICAgICAgICAgICAgfSk7CisgICAgICAgICAgICAgICAgfTsKKyAgICAgICAgICAgICAgICAkc2NvcGUuaXNBY3RpdmVUYWIgPSBmdW5jdGlvbiAoaW5kZXgpIHsKKyAgICAgICAgICAgICAgICAgICAgcmV0dXJuICRzY29wZS5pdGVtcyAmJiAkc2NvcGUuaXRlbXNbaW5kZXhdICYmICRzY29wZS5pdGVtc1tpbmRleF0uaXNUYWJPcGVuOworICAgICAgICAgICAgICAgIH07CisgICAgICAgICAgICB9XQorICAgICAgICAgICAgICAgIH07Cit9XSkKKworLmRpcmVjdGl2ZSgndGFiYmVkT3ZlcmxheScsIFtmdW5jdGlvbiAoKSB7CisgICAgcmV0dXJuIHsKKyAgICAgICAgcmVzdHJpY3Q6ICdBRScsCisgICAgICAgIHJlcGxhY2U6IHRydWUsCisgICAgICAgIHNjb3BlOiB7CisgICAgICAgICAgICBpdGVtczogIj0iCisgICAgICAgIH0sCisgICAgICAgIHRyYW5zY2x1ZGU6IHRydWUsCisgICAgICAgIHRlbXBsYXRlVXJsOiAnYXBwL3NjcmlwdHMvbmdfanNfYXR0X3RwbHMvbW9kYWwvdGFiYmVkT3ZlcmxheUl0ZW0uaHRtbCcsCisgICAgICAgIGNvbnRyb2xsZXI6IFsnJHNjb3BlJywgZnVuY3Rpb24gKCRzY29wZSkgeworICAgICAgICAgICAgICAgICRzY29wZS5jbGlja1RhYiA9IGZ1bmN0aW9uIChpbmRleCkgeworICAgICAgICAgICAgICAgICAgICBmb3IgKHZhciBpID0gMDsgaSA8ICRzY29wZS5pdGVtcy5sZW5ndGg7IGkrKykgeworICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGkgPT09IGluZGV4KSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgJHNjb3BlLml0ZW1zW2ldLmlzVGFiT3BlbiA9IHRydWU7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgJHNjb3BlLml0ZW1zW2ldLnNob3dEYXRhID0gdHJ1ZTsKKyAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgIGVsc2UgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICRzY29wZS5pdGVtc1tpXS5pc1RhYk9wZW4gPSBmYWxzZTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAkc2NvcGUuaXRlbXNbaV0uc2hvd0RhdGEgPSBmYWxzZTsKKyAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIH07CisgICAgICAgICAgICAgICAgJHNjb3BlLmlzQWN0aXZlVGFiID0gZnVuY3Rpb24gKGluZGV4KSB7CisgICAgICAgICAgICAgICAgICAgIHJldHVybiAkc2NvcGUuaXRlbXMgJiYgJHNjb3BlLml0ZW1zW2luZGV4XSAmJiAkc2NvcGUuaXRlbXNbaW5kZXhdLmlzVGFiT3BlbjsKKyAgICAgICAgICAgICAgICB9OworICAgICAgICAgICAgfV0KKyAgICB9OworfV0pOworYW5ndWxhci5tb2R1bGUoJ2F0dC5hYnMucGFnaW5hdGlvbicsIFsnYXR0LmFicy51dGlsaXRpZXMnXSkKKy5kaXJlY3RpdmUoJ2F0dFBhZ2luYXRpb24nLCBbIGZ1bmN0aW9uKCkgeworICAgICByZXR1cm4geworICAgICAgICByZXN0cmljdDogJ0VBJywKKyAgICAgICAgc2NvcGU6IHsKKyAgICAgICAgICAgIHRvdGFsUGFnZXM6ICc9JywKKyAgICAgICAgICAgIGN1cnJlbnRQYWdlOiAnPScsCisgICAgICAgICAgICBzaG93SW5wdXQ6ICc9JywKKyAgICAgICAgICAgIGNsaWNrSGFuZGxlcjogJz0/JworICAgICAgICB9LAorICAgICAgICByZXBsYWNlOiB0cnVlLAorICAgICAgICB0ZW1wbGF0ZVVybDogJ2FwcC9zY3JpcHRzL25nX2pzX2F0dF90cGxzL3BhZ2luYXRpb24vcGFnaW5hdGlvbi5odG1sJywKKyAgICAgICAgbGluazogZnVuY3Rpb24oc2NvcGUpIHsKKyAgICAgICAgICAgIHNjb3BlLmZvY3VzZWRQYWdlOworICAgICAgICAgICAgc2NvcGUuJHdhdGNoKCd0b3RhbFBhZ2VzJywgZnVuY3Rpb24odmFsdWUpIHsKKyAgICAgICAgICAgICAgICBpZihhbmd1bGFyLmlzRGVmaW5lZCh2YWx1ZSkgJiYgdmFsdWUgIT09IG51bGwpeworICAgICAgICAgICAgICAgICAgICBzY29wZS5wYWdlcyA9IFtdOworICAgICAgICAgICAgICAgICAgICBpZiAodmFsdWUgPCAxKSB7CisgICAgICAgICAgICAgICAgICAgICAgICBzY29wZS50b3RhbFBhZ2VzID0gMTsKKyAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybjsKKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICBpZiAodmFsdWUgPD0gNykgeworICAgICAgICAgICAgICAgICAgICAgICAgZm9yICh2YXIgaSA9IDE7IGkgPD0gdmFsdWU7IGkrKykgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNjb3BlLnBhZ2VzLnB1c2goaSk7CisgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAodmFsdWUgPiA3KSB7CisgICAgICAgICAgICAgICAgICAgICAgICB2YXIgbWlkVmFsID0gTWF0aC5jZWlsKHZhbHVlIC8gMik7CisgICAgICAgICAgICAgICAgICAgICAgICBzY29wZS5wYWdlcyA9IFttaWRWYWwgLSAxLCBtaWRWYWwsIG1pZFZhbCArIDFdOworICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgIGN1cnJlbnRQYWdlQ2hhbmdlZCgxKTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9KTsKKyAgICAgICAgICAgIHNjb3BlLiR3YXRjaCgnY3VycmVudFBhZ2UnLCBmdW5jdGlvbih2YWx1ZSkgeworICAgICAgICAgICAgICAgIGN1cnJlbnRQYWdlQ2hhbmdlZCh2YWx1ZSk7CisgICAgICAgICAgICB9KTsKKyAgICAgICAgICAgIHZhciBjYWxsYmFja0hhbmRsZXIgPSBmdW5jdGlvbihudW0pIHsKKyAgICAgICAgICAgICAgICBpZiAoYW5ndWxhci5pc0Z1bmN0aW9uKHNjb3BlLmNsaWNrSGFuZGxlcikpeworICAgICAgICAgICAgICAgICAgICBzY29wZS5jbGlja0hhbmRsZXIobnVtKTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9OworICAgICAgICAgICAgZnVuY3Rpb24gY3VycmVudFBhZ2VDaGFuZ2VkKHZhbHVlKSB7CisgICAgICAgICAgICAgICAgaWYgKGFuZ3VsYXIuaXNEZWZpbmVkKHZhbHVlKSAmJiB2YWx1ZSAhPT0gbnVsbCkgeworICAgICAgICAgICAgICAgICAgICBpZiAoIXZhbHVlIHx8IHZhbHVlIDwgMSkgeworICAgICAgICAgICAgICAgICAgICAgICAgdmFsdWUgPSAxOworICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgIGlmICh2YWx1ZSA+IHNjb3BlLnRvdGFsUGFnZXMpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIHZhbHVlID0gc2NvcGUudG90YWxQYWdlczsKKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICBpZihzY29wZS5jdXJyZW50UGFnZSAhPT0gdmFsdWUpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIHNjb3BlLmN1cnJlbnRQYWdlID0gdmFsdWU7CisgICAgICAgICAgICAgICAgICAgICAgICBjYWxsYmFja0hhbmRsZXIoc2NvcGUuY3VycmVudFBhZ2UpOworICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgIGlmIChzY29wZS50b3RhbFBhZ2VzID4gNykgeworICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHZhbHVlIDwgc2NvcGUucGFnZXNbMF0gJiYgdmFsdWUgPiAzKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2NvcGUucGFnZXMgPSBbdmFsdWUsIHZhbHVlICsgMSwgdmFsdWUgKyAyXTsKKyAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAodmFsdWUgPiBzY29wZS5wYWdlc1syXSAmJiB2YWx1ZSA8IHNjb3BlLnRvdGFsUGFnZXMgLSAyKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICBzY29wZS5wYWdlcyA9IFt2YWx1ZSAtIDIsIHZhbHVlIC0gMSwgdmFsdWVdOworICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIGlmICh2YWx1ZSA8PSAzKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNjb3BlLnBhZ2VzID0gWzEsIDIsIDNdOworICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIGlmICh2YWx1ZSA+PSBzY29wZS50b3RhbFBhZ2VzIC0gMikgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzY29wZS5wYWdlcyA9IFtzY29wZS50b3RhbFBhZ2VzIC0gMiwgc2NvcGUudG90YWxQYWdlcyAtIDEsIHNjb3BlLnRvdGFsUGFnZXNdOworICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfQorICAgICAgICAgICAgc2NvcGUubmV4dCA9IGZ1bmN0aW9uKGV2ZW50KSB7CisgICAgICAgICAgICAgICAgZXZlbnQucHJldmVudERlZmF1bHQoKTsKKyAgICAgICAgICAgICAgICBpZiAoc2NvcGUuY3VycmVudFBhZ2UgPCBzY29wZS50b3RhbFBhZ2VzKSB7CisgICAgICAgICAgICAgICAgICAgIHNjb3BlLmN1cnJlbnRQYWdlICs9IDE7CisgICAgICAgICAgICAgICAgICAgIGNhbGxiYWNrSGFuZGxlcihzY29wZS5jdXJyZW50UGFnZSk7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfTsKKyAgICAgICAgICAgIHNjb3BlLnByZXYgPSBmdW5jdGlvbihldmVudCkgeworICAgICAgICAgICAgICAgIGV2ZW50LnByZXZlbnREZWZhdWx0KCk7CisgICAgICAgICAgICAgICAgaWYgKHNjb3BlLmN1cnJlbnRQYWdlID4gMSkgeworICAgICAgICAgICAgICAgICAgICBzY29wZS5jdXJyZW50UGFnZSAtPSAxOworICAgICAgICAgICAgICAgICAgICBjYWxsYmFja0hhbmRsZXIoc2NvcGUuY3VycmVudFBhZ2UpOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH07CisgICAgICAgICAgICBzY29wZS5zZWxlY3RQYWdlID0gZnVuY3Rpb24odmFsdWUsIGV2ZW50KSB7CisgICAgICAgICAgICAgICAgZXZlbnQucHJldmVudERlZmF1bHQoKTsKKyAgICAgICAgICAgICAgICBzY29wZS5jdXJyZW50UGFnZSA9IHZhbHVlOworICAgICAgICAgICAgICAgIHNjb3BlLmZvY3VzZWRQYWdlID0gdmFsdWU7CisgICAgICAgICAgICAgICAgY2FsbGJhY2tIYW5kbGVyKHNjb3BlLmN1cnJlbnRQYWdlKTsKKyAgICAgICAgICAgIH07CisgICAgICAgICAgICBzY29wZS5jaGVja1NlbGVjdGVkUGFnZSA9IGZ1bmN0aW9uKHZhbHVlKSB7CisgICAgICAgICAgICAgICAgaWYoc2NvcGUuY3VycmVudFBhZ2UgPT09IHZhbHVlKSB7CisgICAgICAgICAgICAgICAgICAgIHJldHVybiB0cnVlOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICByZXR1cm4gZmFsc2U7CisgICAgICAgICAgICB9OworICAgICAgICAgICAgc2NvcGUuaXNGb2N1c2VkID0gZnVuY3Rpb24ocGFnZSkgeworICAgICAgICAgICAgICAgICByZXR1cm4gc2NvcGUuZm9jdXNlZFBhZ2UgPT09IHBhZ2U7CisgICAgICAgICAgICB9OworICAgICAgICB9CisgICAgfTsKK31dKTsKKworYW5ndWxhci5tb2R1bGUoJ2F0dC5hYnMucGFuZVNlbGVjdG9yJyxbJ2F0dC5hYnMudXRpbGl0aWVzJ10pCisuY29uc3RhbnQoJ3BhbmVHcm91cENvbnN0YW50cycseworICAgIFNJREVfV0lEVEhfREVGQVVMVDogJzMzJScsCisgICAgSU5ORVJfUEFORV9ERUZBVUxUOiAnNjclJywKKyAgICBTSURFX1BBTkVfSUQ6ICdzaWRlUGFuZScsCisgICAgTk9fRFJJTExfRE9XTjogJ25vbmUnCit9KQorLmZhY3RvcnkoJ2FuaW1hdGlvbicsIGZ1bmN0aW9uKCl7CisgICAgcmV0dXJuIFR3ZWVuTGl0ZTsKK30pLmRpcmVjdGl2ZSgnYXR0UGFuZUFjY2Vzc2liaWxpdHknLFsna2V5bWFwJywnJHdpbmRvdycsZnVuY3Rpb24oa2V5bWFwLCR3aW5kb3cpIHsKKyAgICAgICAgcmV0dXJueworICAgICAgICAgICAgcmVzdHJpY3Q6ICdBJywKKyAgICAgICAgICAgIHJlcXVpcmU6IFsnXj9zaWRlUGFuZScsJ14/aW5uZXJQYW5lJ10sCisgICAgICAgICAgICBsaW5rOiBmdW5jdGlvbiAoc2NvcGUsIGVsZW0sYXR0cixjdHJsKSB7CisgICAgICAgICAgICAgICAgdmFyIHNpZGVwYW5lQ3RybCA9IGN0cmxbMF0saW5uZXJQYW5lQ3RybCA9IGN0cmxbMV0saWVGbGFnPWZhbHNlOworICAgICAgICAgICAgICAgIHNjb3BlLmllID0gKGZ1bmN0aW9uICgpIHsKKyAgICAgICAgICAgICAgICAgICAgdmFyIHVuZGVmLHYgPSAzLGRpdiA9IGRvY3VtZW50LmNyZWF0ZUVsZW1lbnQoJ2RpdicpLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIGFsbCA9IGRpdi5nZXRFbGVtZW50c0J5VGFnTmFtZSgnaScpOworICAgICAgICAgICAgICAgICAgICB3aGlsZSAoCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgZGl2LmlubmVySFRNTCA9ICc8IS0tW2lmIGd0IElFICcgKyAoKyt2KSArICddPjxpPjwvaT48ICFbZW5kaWZdLS0+JywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBhbGxbMF0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICApOworICAgICAgICAgICAgICAgICAgICByZXR1cm4gdiA+IDQgPyB2IDogdW5kZWY7CisgICAgICAgICAgICAgICAgfSgpKTsKKyAgICAgICAgICAgICAgICAgaWYoc2NvcGUuaWUgPT09IDgpeworICAgICAgICAgICAgICAgICAgICAgICAgaWVGbGFnID0gdHJ1ZTsKKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICBlbHNleworICAgICAgICAgICAgICAgICAgICAgICAgaWVGbGFnID0gZmFsc2U7CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICBlbGVtLmJpbmQoJ2tleWRvd24nLGZ1bmN0aW9uKGV2KXsKKyAgICAgICAgICAgICAgICAgICAgaWYgKGtleW1hcC5pc0FsbG93ZWRLZXkoZXYua2V5Q29kZSkgfHwga2V5bWFwLmlzQ29udHJvbChldikgfHwga2V5bWFwLmlzRnVuY3Rpb25LZXkoZXYpKSB7CisgICAgICAgICAgICAgICAgICAgICAgICBldi5wcmV2ZW50RGVmYXVsdCgpOworICAgICAgICAgICAgICAgICAgICAgICAgZXYuc3RvcFByb3BhZ2F0aW9uKCk7CisgICAgICAgICAgICAgICAgICAgICAgICB2YXIgZWw7CisgICAgICAgICAgICAgICAgICAgIHN3aXRjaCAoZXYua2V5Q29kZSkgeworICAgICAgICAgICAgICAgICAgICAgICAgY2FzZSBrZXltYXAuS0VZLkRPV046CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgZWwgPSBhbmd1bGFyLmVsZW1lbnQoZWxlbVswXSlbMF07CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYoZWwgJiYgZWwubmV4dEVsZW1lbnRTaWJsaW5nKXsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZWwubmV4dEVsZW1lbnRTaWJsaW5nLmZvY3VzKCk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8qSUU4IGZpeCovCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYoaWVGbGFnKXsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZG8geworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGVsICYmIGVsLm5leHRTaWJsaW5nKXsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBlbCA9IGVsLm5leHRTaWJsaW5nOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZWxzZXsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSB3aGlsZSAoZWwgJiYgZWwudGFnTmFtZSAhPT0gJ0RJVicpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBlbC5mb2N1cygpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICAgICAgICAgIGNhc2Uga2V5bWFwLktFWS5VUDoKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBlbCA9IGFuZ3VsYXIuZWxlbWVudChlbGVtWzBdKVswXTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZihlbCAmJiBlbC5wcmV2aW91c0VsZW1lbnRTaWJsaW5nKXsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZWwucHJldmlvdXNFbGVtZW50U2libGluZy5mb2N1cygpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLypJRTggZml4Ki8KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYoaWVGbGFnKXsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZG8geworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGVsICYmIGVsLnByZXZpb3VzU2libGluZyl7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZWwgPSBlbC5wcmV2aW91c1NpYmxpbmc7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBlbHNleworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9IHdoaWxlIChlbCAmJiBlbC50YWdOYW1lICE9PSAnRElWJyk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGVsLmZvY3VzKCk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgICAgICAgICAgY2FzZSBrZXltYXAuS0VZLlJJR0hUOgorICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmKGFuZ3VsYXIuaXNEZWZpbmVkKHNpZGVwYW5lQ3RybCkpeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBlbCA9IHNpZGVwYW5lQ3RybC5nZXRFbGVtZW50KClbMF07CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmKGFuZ3VsYXIuaXNEZWZpbmVkKGlubmVyUGFuZUN0cmwpKXsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZWwgPSBpbm5lclBhbmVDdHJsLmdldEVsZW1lbnQoKVswXTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgZG8geworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoZWwgJiYgZWwubmV4dEVsZW1lbnRTaWJsaW5nKXsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGVsID0gZWwubmV4dEVsZW1lbnRTaWJsaW5nOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGVsc2V7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgICAgIH13aGlsZSh3aW5kb3cuZ2V0Q29tcHV0ZWRTdHlsZShlbCwgbnVsbCkuZ2V0UHJvcGVydHlWYWx1ZSgiZGlzcGxheSIpID09PSAnbm9uZScpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8qSUU4IGZpeCovCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYoaWVGbGFnKXsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZG8geworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGVsICYmIGVsLm5leHRTaWJsaW5nKXsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBlbCA9IGVsLm5leHRTaWJsaW5nOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZWxzZXsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfXdoaWxlICgoZWwgJiYgZWwudGFnTmFtZSA9PSAnRElWJykgJiYgZWwuY3VycmVudFN0eWxlWydkaXNwbGF5J10gPT0gJ25vbmUnKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoZWwpeworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGVsLnF1ZXJ5U2VsZWN0b3IoIlthdHQtcGFuZS1hY2Nlc3NpYmlsaXR5XSIpLmZvY3VzKCk7CisgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICAgICAgICAgIGNhc2Uga2V5bWFwLktFWS5MRUZUOgorICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmKGFuZ3VsYXIuaXNEZWZpbmVkKHNpZGVwYW5lQ3RybCkpeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBlbCA9IHNpZGVwYW5lQ3RybC5nZXRFbGVtZW50KClbMF07CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmKGFuZ3VsYXIuaXNEZWZpbmVkKGlubmVyUGFuZUN0cmwpKXsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZWwgPSBpbm5lclBhbmVDdHJsLmdldEVsZW1lbnQoKVswXTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgZG8geworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoZWwgJiYgZWwucHJldmlvdXNFbGVtZW50U2libGluZyl7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBlbCA9IGVsLnByZXZpb3VzRWxlbWVudFNpYmxpbmc7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZWxzZXsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH13aGlsZSAod2luZG93LmdldENvbXB1dGVkU3R5bGUoZWwsIG51bGwpLmdldFByb3BlcnR5VmFsdWUoImRpc3BsYXkiKSA9PSAnbm9uZScpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgLypJRTggZml4Ki8KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZihpZUZsYWcpeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBkbyB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoZWwgJiYgZWwucHJldmlvdXNTaWJsaW5nKXsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBlbCA9IGVsLnByZXZpb3VzU2libGluZzsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGVsc2V7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH13aGlsZSgoZWwgJiYgZWwudGFnTmFtZSA9PSAnRElWJykgJiYgZWwuY3VycmVudFN0eWxlWydkaXNwbGF5J10gPT0gJ25vbmUnKTsgICAKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGVsKXsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBlbC5xdWVyeVNlbGVjdG9yKCJbYXR0LXBhbmUtYWNjZXNzaWJpbGl0eV0iKS5mb2N1cygpOworICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgICAgICAgICBkZWZhdWx0OgorICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgfSk7CisgICAgICAgICAgICB9CisgICAgICAgIH07Cit9XSkKKy5kaXJlY3RpdmUoJ3NpZGVSb3cnLCBbZnVuY3Rpb24oKXsKKyAgICByZXR1cm4geworICAgICAgICByZXN0cmljdDogJ0EnLAorICAgICAgICByZXBsYWNlOnRydWUsCisgICAgICAgIHJlcXVpcmU6IFsnXnNpZGVQYW5lJywnXnBhbmVHcm91cCddLAorICAgICAgICBsaW5rOiBmdW5jdGlvbihzY29wZSxlbGVtZW50LGF0dHIsY3RybHMpeworICAgICAgICAgICAgdmFyIHNpZGVQYW5lQ3RybCA9IGN0cmxzWzBdOworICAgICAgICAgICAgdmFyIHBhbmVHcm91cEN0cmwgPSBjdHJsc1sxXTsKKyAgICAgICAgICAgIGlmKHNjb3BlLiRmaXJzdCl7CisgICAgICAgICAgICAgICAgLyoKKyAgICA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cy5jdXJyZW50V2lkdGggPSBwYW5lR3JvdXBDb25zdGFudHMuU0lERV9XSURUSF9ERUZBVUxUOworICAgICAgICB0aGlzLnBhbmVJZCA9IHBhbmVHcm91cENvbnN0YW50cy5TSURFX1BBTkVfSUQ7CisJdGhpcy5jdXJyZW50U2VsZWN0ZWRSb3dQYW5lSWQ7CisJdGhpcy5kcmlsbERvd25Ub01hcHBlciA9IHt9OworCXRoaXMuc2lkZVBhbmVSb3dzID0gW107CisJdGhpcy5pbml0ID0gZnVuY3Rpb24oKXsKKyAgICAgICAgICAgIHZhciBzaWRlUGFuZVJvd3MgPSB0aGlzLnNpZGVQYW5lUm93czsKKyAgICAgICAgICAgIGlmKHNpZGVQYW5lUm93cyl7CisgICAgICAgICAgICAgICAgZm9yKHZhciBpbmRleCBpbiBzaWRlUGFuZVJvd3MpeworICAgICAgICAgICAgICAgICAgICBpZiAoc2lkZVBhbmVSb3dzLmhhc093blByb3BlcnR5KGluZGV4KSkgeworICAgICAgICAgICAgICAgICAgICAgICAgdmFyIHBhbmVJZCA9IHNpZGVQYW5lUm93c1tpbmRleF0ucGFuZUlkOworICAgICAgICAgICAgICAgICAgICAgICAgdmFyIGRyaWxsRG93blRvID0gc2lkZVBhbmVSb3dzW2luZGV4XS5kcmlsbERvd25UbzsKKyAgICAgICAgICAgICAgICAgICAgICAgIHRoaXMuZHJpbGxEb3duVG9NYXBwZXJbcGFuZUlkXSA9IGRyaWxsRG93blRvOworICAgICAgICAgICAgICAgICAgICAgICAgaWYoaW5kZXggPT0gMCl7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgdGhpcy5jdXJyZW50U2VsZWN0ZWRSb3dQYW5lSWQgPSBwYW5lSWQ7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgdGhpcy5zaWRlUGFuZVRyYWNrZXJbcGFuZUlkXSA9IFtdOworICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfQorCX07CisJdGhpcy5nZXRTaWRlUGFuZXNMaXN0ID0gZnVuY3Rpb24oKXsKKyAgICAgICAgICAgIHJldHVybiB0aGlzLnNpZGVQYW5lVHJhY2tlclt0aGlzLmN1cnJlbnRTZWxlY3RlZFJvd1BhbmVJZF07CisJfTsKKwl0aGlzLmFkZFRvU2lkZVBhbmVzTGlzdCA9IGZ1bmN0aW9uKG5ld1BhbmVJZCl7CisgICAgICAgICAgICBpZih0aGlzLnNpZGVQYW5lVHJhY2tlclt0aGlzLmN1cnJlbnRTZWxlY3RlZFJvd1BhbmVJZF0gPT09IHVuZGVmaW5lZCl7CisgICAgICAgICAgICAgICAgdGhpcy5zaWRlUGFuZVRyYWNrZXJbdGhpcy5jdXJyZW50U2VsZWN0ZWRSb3dQYW5lSWRdID0gW107CisgICAgICAgICAgICB9CisgICAgICAgICAgICBlbHNlIGlmKG5ld1BhbmVJZCl7CisgICAgICAgICAgICAgICAgdGhpcy5zaWRlUGFuZVRyYWNrZXJbdGhpcy5jdXJyZW50U2VsZWN0ZWRSb3dQYW5lSWRdLnB1c2gobmV3UGFuZUlkKTsKKyAgICAgICAgICAgIH0KKwl9OworCXRoaXMuc2V0V2lkdGggPSBmdW5jdGlvbih2YWwpeworICAgICAgICAgICAgaWYodmFsKXsKKyAgICAgICAgICAgICAgICB0aGlzLmN1cnJlbnRXaWR0aCA9IHZhbDsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGFuaW1hdGlvbi5zZXQoJGVsZW1lbnQse3dpZHRoOnRoaXMuY3VycmVudFdpZHRofSk7CisJfTsKKwl0aGlzLnJlc2l6ZVdpZHRoID0gZnVuY3Rpb24odmFsKXsKKyAgICAgICAgICAgIGlmKHZhbCl7CisgICAgICAgICAgICAgICAgdGhpcy5jdXJyZW50V2lkdGggPSB2YWw7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBhbmltYXRpb24udG8oJGVsZW1lbnQsLjUse3dpZHRoOnZhbH0pOworCX07C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50LGF0dHIsY3RybHMpeworICAgICAgICAgICAgdmFyIGlubmVyUGFuZUN0cmwgPSBjdHJsc1swXTsKKyAgICAgICAgICAgIHZhciBwYW5lR3JvdXBDdHJsID0gY3RybHNbMV07CisgICAgICAgICAgICBlbGVtZW50Lm9uKCdjbGljaycsIGZ1bmN0aW9uKCl7CisgICAgICAgICAgICAgICAgICAgIHZhciBkcmlsbERvd25UbyA9IGlubmVyUGFuZUN0cmwuZHJpbGxEb3duVG87CisgICAgICAgICAgICAgICAgICAgIGlmKGlubmVyUGFuZUN0cmwuZHJpbGxEb3duVG8gIT09IHBhbmVHcm91cENvbnN0YW50cy5OT19EUklMTF9ET1dOKXsKKyAgICAgICAgICAgICAgICAgICAgICAgIHBhbmVHcm91cEN0cmwuc2xpZGVPdXRQYW5lKGRyaWxsRG93blRvKTsKKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICBlbGVtZW50WzBdLmZvY3VzKCk7CisgICAgICAgICAgICB9KTsKKyAgICAgICAgfQorICAgIH07Cit9XSkKKy5jb250cm9sbGVyKCdJbm5lclBhbmVDdHJsJywgWyckc2NvcGUnLCAnJGVsZW1lbnQnLCdhbmltYXRpb24nLCAncGFuZUdyb3VwQ29uc3RhbnRzJywKKwlmdW5jdGlvbigkc2NvcGUsJGVsZW1lbnQsYW5pbWF0aW9uLHBhbmVHcm91cENvbnN0YW50cyl7CisgICAgICAgIHRoaXMuZ2V0RWxlbWVudCA9IGZ1bmN0aW9uKCl7CisgICAgICAgICAgICByZXR1cm4gJGVsZW1lbnQ7CisgICAgICAgIH07CisJdGhpcy5wYW5lSWQgPSAkc2NvcGUucGFuZUlkOworCXRoaXMuZHJpbGxEb3duVG87CisJdGhpcy5jdXJyZW50V2lkdGggPSBwYW5lR3JvdXBDb25zdGFudHMuSU5ORVJfUEFORV9ERUZBVUxUOworCXRoaXMuc2V0V2lkdGggPSBmdW5jdGlvbih2YWwpeworICAgICAgICAgICAgaWYodmFsKXsKKyA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9IGZ1bmN0aW9uKCl7CisgICAgICAgICAgICBhbmltYXRpb24uc2V0KCRlbGVtZW50LHtib3JkZXJSaWdodFdpZHRoOiAnMHB4J30pOworCX07CisJdGhpcy5zaG93UmlnaHRCb3JkZXIgPSBmdW5jdGlvbigpeworICAgICAgICAgICAgYW5pbWF0aW9uLnNldCgkZWxlbWVudCwge2JvcmRlclJpZ2h0V2lkdGg6ICcxcHgnfSk7CisJfTsKKwl0aGlzLnNsaWRlRnJvbVJpZ2h0ID0gZnVuY3Rpb24oKXsKKyAgICAgICAgICAgIGFuaW1hdGlvbi5zZXQoJGVsZW1lbnQsIHtmbG9hdDoncmlnaHQnfSk7CisgICAgICAgICAgICBhbmltYXRpb24uc2V0KCRlbGVtZW50LCB7d2lkdGg6IHRoaXMuY3VycmVudFdpZHRofSk7CisJfTsKKwl0aGlzLnN0YXJ0T3BlbiA9IGZ1bmN0aW9uKCl7CisgICAgICAgICAgICByZXR1cm4gJHNjb3BlLnN0YXJ0T3BlbjsKKwl9OworfV0pCisuZGlyZWN0aXZlKCdpbm5lclBhbmUnLCBmdW5jdGlvbigpeworICAgIHJldHVybiB7CisgICAgICAgIHJlc3RyaWN0OiAnRUEnLAorICAgICAgICByZXBsYWNlOiB0cnVlLAorICAgICAgICB0cmFuc2NsdWRlOiB0cnVlLAorICAgICAgICB0ZW1wbGF0ZVVybDogJ2FwcC9zY3JpcHRzL25nX2pzX2F0dF90cGxzL3BhbmVTZWxlY3Rvci9pbm5lclBhbmUuaHRtbCcsCisgICAgICAgIHJlcXVpcmU6IFsnXnBhbmVHcm91cCcsICdpbm5lclBhbmUnXSwKKyAgICAgICAgY29udHJvbGxlcjogJ0lubmVyUGFuZUN0cmwnLAorICAgICAgICBzY29wZTp7CisgICAgICAgICAgICAgICAgcGFuZUlkOidAJworICAgICAgICB9LAorICAgICAgICBsaW5rOiBmdW5jdGlvbihzY29wZSxlbGVtZW50LGF0dHIsY3RybHMpeworICAgICAgICAgICAgaWYoYXR0ci5zdGFydE9wZW4gPT09ICIiKXsKKyAgICAgICAgICAgICAgICBzY29wZS5zdGFydE9wZW4gID0gdHJ1ZTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIHZhciBwYW5lR3JvdXBDdHJsID0gY3RybHNbMF07CisgICAgICAgICAgICB2YXIgaW5uZXJQYW5lQ3RybCA9IGN0cmxzWzFdOworICAgICAgICAgICAgcGFuZUdyb3VwQ3RybC5hZGRQYW5lQ3RybChzY29wZS5wYW5lSWQsaW5uZXJQYW5lQ3RybCk7CisgICAgICAgIH0KKyAgICB9OworfSkKKy5jb250cm9sbGVyKCdQYW5lR3JvdXBDdHJsJywgWyckc2NvcGUnLCAnJGVsZW1lbnQnLCAncGFuZUdyb3VwQ29uc3RhbnRzJyxmdW5jdGlvbigkc2NvcGUsJGVsZW1lbnQscGFuZUdyb3VwQ29uc3RhbnRzKXsKKyAgICAgICAgdGhpcy5wYW5lcyA9IHt9OworCXRoaXMuYWNjb3VudExldmVsUGFuZU1vZGVsID0gW107CisJdGhpcy50aXRsZSA9ICRzY29wZS50aXRsZTsKKwl0aGlzLmluaXQgPSBmdW5jdGlvbigpeworCQl2YXIgc2lkZVBhbmUgPSB0aGlzLnBhbmVzW3BhbmVHcm91cENvbnN0YW50cy5TSURFX1BBTkVfSURdOworCQlpZihzaWRlUGFuZSl7CisgICAgICAgICAgICAgICAgICAgIHNpZGVQYW5lLmluaXQoKTsKKworICAgICAgICAgICAgICAgICAgICAvL1Nob3cgdGhlIG90aGVyIHBhbmVzIHRoYXQgbWF5IGJlIHNldCB0byBzdGFydE9wZW4KKyAgICAgICAgICAgICAgICAgICAgLy9udW1PcGVuIHN0YXJ0cyBhdCAxIGJlY2F1c2Ugb2YgdGhlIHNpZGUgcGFuZQorICAgICAgICAgICAgICAgICAgICB2YXIgbnVtT3BlbiA9IDE7CisgICAgICAgICAgICAgICAgICAgIHZhciBrZXk7CisgICAgICAgICAgICAgICAgICAgIGZvcihrZXkgaW4gdGhpcy5wYW5lcyl7CisgICAgICAgICAgICAgICAgICAgICAgICBpZih0aGlzLnBhbmVzW2tleV0uc3RhcnRPcGVuICYmIHRoaXMucGFuZXNba2V5XS5zdGFydE9wZW4oKSl7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG51bU9wZW4rKzsKKyAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICB2YXIgd2lkdGg7CisgICAgICAgICAgICAgICAgICAgIGlmKG51bU9wZW4gPj0gMyl7CisgICAgICAgICAgICAgICAgICAgICAgICB3aWR0aCA9ICgoMTAwL251bU9wZW4pKSArICclJzsKKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICBpZih0aGlzLnBhbmVzW3NpZGVQYW5lLmN1cnJlbnRTZWxlY3RlZFJvd1BhbmVJZF0pCisgICAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIGlmKHdpZHRoKXsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBzaWRlUGFuZS5zZXRXaWR0aCh3aWR0aCk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgdGhpcy5wYW5lc1tzaWRlUGFuZS5jdXJyZW50U2VsZWN0ZWRSb3dQYW5lSWRdLnNldFdpZHRoKHdpZHRoKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgIGVsc2V7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2lkZVBhbmUuc2V0V2lkdGgoKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB0aGlzLnBhbmVzW3NpZGVQYW5lLmN1cnJlbnRTZWxlY3RlZFJvd1BhbmVJZF0uc2V0V2lkdGgoKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgIHRoaXMucGFuZXNbc2lkZVBhbmUuY3VycmVudFNlbGVjdGVkUm93UGFuZUlkXS5kaXNwbGF5QmxvY2soKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIGZvcihrZXkgaW4gdGhpcy5wYW5lcyl7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYoa2V5ICE9PSBwYW5lR3JvdXBDb25zdGFudHMuU0lERV9QQU5FX0lEICYmIGtleSAhPT0gc2lkZVBhbmUuY3VycmVudFNlbGVjdGVkUm93UGFuZUlkKXsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdGhpcy5wYW5lc1trZXldLmRpc3BsYXlOb25lKCk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0aGlzLnBhbmVzW2tleV0uZHJpbGxEb3duVG8gPSBzaWRlUGFuZS5kcmlsbERvd25Ub01hcHBlcltrZXldOworICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgIG9wZW5PdGhlclBhbmVzT25TdGFydChzaWRlUGFuZSwgdGhpcy5wYW5lcyk7CisgICAgICAgICAgICAgICAgfQorCisJCWZ1bmN0aW9uIG9wZW5PdGhlclBhbmVzT25TdGFydChzaWRlUGFuZSwgcGFuZXMpeworICAgICAgICAgICAgICAgICAgICAvL0J1aWxkIGFuIGFycmF5IG9mIHRoZSBwYW5lcyB0aGF0IG5lZWQgdG8gYmUgb3V0CisgICAgICAgICAgICAgICAgICAgIHZhciBvdGhlclBhbmVzU3RhcnRPcGVuZWQgPSBbXTsKKyAgICAgICAgICAgICAgICAgICAgdmFyIGluZGV4OworICAgICAgICAgICAgICAgICAgICBmb3IoaW5kZXggaW4gc2lkZVBhbmUuc2lkZVBhbmVSb3dzKXsKKyAgICAgICAgICAgICAgICAgICAgICAgIGlmIChzaWRlUGFuZS5zaWRlUGFuZVJvd3MuaGFzT3duUHJvcGVydHkoaW5kZXgpKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFyIHBhbmUgPSBzaWRlUGFuZS5zaWRlUGFuZVJvd3NbaW5kZXhdOworCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgLy9Ta2lwIHRoZSBmaXJzdCBwYW5lIHJvdyBzaW5jZSB3ZSBoYW5kbGVkIGl0IGluIHRoZSBiZWdpbmluZworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmKGluZGV4ID4gMCAmJiBwYW5lc1twYW5lLnBhbmVJZF0uc3RhcnRPcGVuICYmIHBhbmVzW3BhbmUucGFuZUlkXS5zdGFydE9wZW4oKSl7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBvdGhlclBhbmVzU3RhcnRPcGVuZWQucHVzaChwYW5lKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vUmVtZW1iZXIgdGhlIHBhbmVzIHRoYXQgYXJlIG9wZW5lZCBmb3IgdGhlIGZpcnN0IHBhbmUgcm93IEluZGV4CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzaWRlUGFuZS5hZGRUb1NpZGVQYW5lc0xpc3QocGFuZS5wYW5lSWQpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgfQorCisgICAgICAgICAgICAgICAgICAgIGlmKHdpZHRoKXsKKyAgICAgICAgICAgICAgICAgICAgICAgIGZvcihpbmRleCBpbiBvdGhlclBhbmVzU3RhcnRPcGVuZWQpeworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChvdGhlclBhbmVzU3RhcnRPcGVuZWQuaGFzT3duUHJvcGVydHkoaW5kZXgpKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhciBwYW5lSWQgPSBvdGhlclBhbmVzU3RhcnRPcGVuZWRbaW5kZXhdLnBhbmVJZDsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFyIHBhbmVDdHJsID0gcGFuZXNbcGFuZUlkXTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYocGFuZUN0cmwgJiYgcGFuZUN0cmwuc2V0V2lkdGggJiYgcGFuZUN0cmwuZGlzcGxheUJsb2NrKXsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBhbmVDdHJsLnNldFdpZHRoKHdpZHRoKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBhbmVDdHJsLmRpc3BsYXlCbG9jaygpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICB9CisKKwkJfQorCX07CisKKwkvKgorCSAgUmVzZXRzIGFsbCB0aGUgcGFuZWxzIHRvIHRoZWlyIG9yaWdpbmFsIHBvc2l0aW9ucyBhdCB0aGUgZW5kIG9mIGEgc2lkZWJhciBjbGljaworCSAgQnkgc2V0dGluZyB0aGUgc2lkZUJhciB0byBpdHMgZGVmYXVsdCB3aWR0aAorCSAgU2V0dGluZyBhbGwgcGFuZXMgdG8gZmxvYXQgbGVmdCBhbmQgZGlzcGxheW5vbmUKKwkgIFNldHRpbmcgdGhlIHBhbmUgdGhhdCB3YXMgY2xpY2tlZCB0byBkZWZhdWx0IHdpZHRoIGFuZCBzbGlkZSByaWdodAorCSovCisKKwl0aGlzLnJlc2V0UGFuZXMgPSBmdW5jdGlvbigpeworICAgICAgICAgICAgZm9yKHZhciBrZXkgaW4gdGhpcy5wYW5lcyl7CisgICAgICAgICAgICAgICAgaWYodGhpcy5wYW5lcy5oYXNPd25Qcm9wZXJ0eShrZXkpKXsKKyAgICAgICAgICAgICAgICAgICAgdmFyIHBhbmUgPSB0aGlzLnBhbmVzW2tleV07CisgICAgICAgICAgICAgICAgICAgIGlmKHBhbmUgJiYgKHBhbmUucGFuZUlkICE9PSBwYW5lR3JvdXBDb25zdGFudHMuU0lERV9QQU5FX0lEKSl7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgcGFuZS5mbG9hdExlZnQoKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBwYW5lLmRpc3BsYXlOb25lKCk7CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9CisKKyAgICAgICAgICAgIGlmKHRoaXMucGFuZXNbcGFuZUdyb3VwQ29uc3RhbnRzLlNJREVfUEFORV9JRF0peworICAgICAgICAgICAgICAgIHRoaXMucGFuZXNbcGFuZUdyb3VwQ29uc3RhbnRzLlNJREVfUEFORV9JRF0uc2V0V2lkdGgocGFuZUdyb3VwQ29uc3RhbnRzLlNJREVfV0lEVEhfREVGQVVMVCk7CisgICAgICAgICAgICB9CisJfTsKKworCXRoaXMuYWRkUGFuZUN0cmwgPSBmdW5jdGlvbihwYW5lSWQscGFuZUN0cmwpeworICAgICAgICAgICAgdGhpcy5wYW5lc1twYW5lSWRdID0gcGFuZUN0cmw7CisJfTsKKworCXRoaXMuX3NsaWRlT3V0UGFuZSA9IGZ1bmN0aW9uKHBhbmVJZCxpc0Zyb21TaWRlUGFuZSl7CisJCXRoaXMucmVzZXRQYW5lcygpOworICAgICAgICAgICAgICAgIC8vQ2hlY2sgY3VycmVudCBzaWRlIHBhbmUgc3RhY2sgdG8gc2VlIGhvdyBtYW55IHBhbmVzIGFyZSBhbHJlYWR5IG9wZW4gZm9yIHRoYXQgc2lkZSBwYW5lIGNob2ljZQorCQkvL3RoZW4gYWRkIHRoZSBuZXcgcGFuZSB0aGF0IG5lZWRzIHRvIGJlIHRoZXJlCisgICAgICAgICAgICAgICAgdmFyIHBhbmVzTGlzdDsKKyAgICAgICAgICAgICAgICBpZihpc0Zyb21TaWRlUGFuZSl7CisKKyAgICAgICAgICAgICAgICAgICAgLy9DaGVjayBpZiB0aGUgc2lkZSBwYW5lIGlkIGhhcyBhbHJlYWR5IGJlZW4gY2xpY2tlZAorICAgICAgICAgICAgICAgICAgICBpZih0aGlzLnBhbmVzW3BhbmVHcm91cENvbnN0YW50cy5TSURFX1BBTkVfSURdKXsKKyAgICAgICAgICAgICAgICAgICAgICAgIHBhbmVzTGlzdCA9IHRoaXMucGFuZXNbcGFuZUdyb3VwQ29uc3RhbnRzLlNJREVfUEFORV9JRF0uZ2V0U2lkZVBhbmVzTGlzdCgpOworICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgIGlmKCFwYW5lc0xpc3QpeworICAgICAgICAgICAgICAgICAgICAgICAgaWYodGhpcy5wYW5lcyAmJiB0aGlzLnBhbmVzW3BhbmVHcm91cENvbnN0YW50cy5TSURFX1BBTkVfSURdICYmIHRoaXMucGFuZXNbcGFuZUlkXSl7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgdGhpcy5wYW5lc1twYW5lR3JvdXBDb25zdGFudHMuU0lERV9QQU5FX0lEXS5jdXJyZW50U2VsZWN0ZWRSb3dQYW5lSWQgPSBwYW5lSWQ7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgdGhpcy5wYW5lc1twYW5lR3JvdXBDb25zdGFudHMuU0lERV9QQU5FX0lEXS5hZGRUb1NpZGVQYW5lc0xpc3QoKTsKKworICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRoaXMucGFuZXNbcGFuZUlkXS5zbGlkZUZyb21SaWdodCgpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRoaXMucGFuZXNbcGFuZUlkXS5kaXNwbGF5QmxvY2soKTsKKworICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRoaXMucGFuZXNbcGFuZUlkXS5zZXRXaWR0aChwYW5lR3JvdXBDb25zdGFudHMuSU5ORVJfUEFORV9ERUZBVUxUKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICBlbHNlIGlmKHRoaXMucGFuZXMgJiYgdGhpcy5wYW5lc1twYW5lR3JvdXBDb25zdGFudHMuU0lERV9QQU5FX0lEXSl7CisJCQkJLy9SZXN0b3JlIHRoZSBwYW5lcyBiYXNlZCBvbiB0aGUgcGFuZWxpc3QKKyAgICAgICAgICAgICAgICAgICAgICAgIGlmKHBhbmVzTGlzdC5sZW5ndGggPT09IDAgJiYgdGhpcy5wYW5lc1twYW5lSWRdKXsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAvL09ubHkgb25lIHBhbmUgaXMgb3V0CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgdGhpcy5wYW5lc1twYW5lR3JvdXBDb25zdGFudHMuU0lERV9QQU5FX0lEXS5zZXRXaWR0aChwYW5lR3JvdXBDb25zdGFudHMuU0lERV9XSURUSF9ERUZBVUxUKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB0aGlzLnBhbmVzW3BhbmVJZF0uZGlzcGxheUJsb2NrKCk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgdGhpcy5wYW5lc1twYW5lSWRdLnNldFdpZHRoKHBhbmVHcm91cENvbnN0YW50cy5JTk5FUl9QQU5FX0RFRkFVTFQpOworICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgZWxzZXsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAvL011bHRpcGxlIHBhbmVzIG91dAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhciBudW1QYW5lcyA9IHBhbmVzTGlzdC5sZW5ndGggKyAyOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhciB3aWR0aCA9ICgoMTAwL251bVBhbmVzKSkgKyAnJSc7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgdGhpcy5wYW5lc1twYW5lR3JvdXBDb25zdGFudHMuU0lERV9QQU5FX0lEXS5zZXRXaWR0aCh3aWR0aCk7CisKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAvL1NldCB0aGUgc2lkZVBhbmVzIHBhbmUKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAvL3NldCB0aGUgcGFuZXMgY2hpbGRyZW4gbGlzdAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmKHRoaXMucGFuZXNbdGhpcy5wYW5lc1twYW5lR3JvdXBDb25zdGFudHMuU0lERV9QQU5FX0lEXS5jdXJyZW50U2VsZWN0ZWRSb3dQYW5lSWRdKXsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdGhpcy5wYW5lc1t0aGlzLnBhbmVzW3BhbmVHcm91cENvbnN0YW50cy5TSURFX1BBTkVfSURdLmN1cnJlbnRTZWxlY3RlZFJvd1BhbmVJZF0uZGlzcGxheUJsb2NrKCk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRoaXMucGFuZXNbdGhpcy5wYW5lc1twYW5lR3JvdXBDb25zdGFudHMuU0lERV9QQU5FX0lEXS5jdXJyZW50U2VsZWN0ZWRSb3dQYW5lSWRdLnNldFdpZHRoKHdpZHRoKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgZm9yKHZhciBpIGluIHBhbmVzTGlzdCl7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmKHRoaXMucGFuZXNbcGFuZXNMaXN0W2ldXSl7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdGhpcy5wYW5lc1twYW5lc0xpc3RbaV1dLmRpc3BsYXlCbG9jaygpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRoaXMucGFuZXNbcGFuZXNMaXN0W2ldXS5zZXRXaWR0aCh3aWR0aCk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICB9CisJCWVsc2V7CisKKyAgICAgICAgICAgICAgICAgICAgLy9IYXZlIHRvIGNoZWNrIHRoZSBwYW5lSWQgdGhhdCB3YXMgZ2l2ZW4gYW5kIHdoZXJlIGl0IGlzIGRyaWxsaW5nIGRvd24gdG8KKyAgICAgICAgICAgICAgICAgICAgdmFyIGlzUGFuZUluU3RhY2sgPSBmYWxzZTsKKyAgICAgICAgICAgICAgICAgICAgdmFyIHN0YWNrUGFuZUxpc3Q7CisgICAgICAgICAgICAgICAgICAgIGlmKHRoaXMucGFuZXNbcGFuZUdyb3VwQ29uc3RhbnRzLlNJREVfUEFORV9JRF0peworICAgICAgICAgICAgICAgICAgICAgICAgc3RhY2tQYW5lTGlzdCA9IHRoaXMucGFuZXNbcGFuZUdyb3VwQ29uc3RhbnRzLlNJREVfUEFORV9JRF0uZ2V0U2lkZVBhbmVzTGlzdCgpOworICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgIGZvcih2YXIgaiBpbiBzdGFja1BhbmVMaXN0KXsKKyAgICAgICAgICAgICAgICAgICAgICAgIGlmKHN0YWNrUGFuZUxpc3QuaGFzT3duUHJvcGVydHkoaikpeworICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhciBwSWQgPSBzdGFja1BhbmVMaXN0W2pdOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmKHBJZCA9PT0gcGFuZUlkKXsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaXNQYW5lSW5TdGFjayA9IHRydWU7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICBpZighaXNQYW5lSW5TdGFjayAmJiB0aGlzLnBhbmVzW3BhbmVHcm91cENvbnN0YW50cy5TSURFX1BBTkVfSURdKXsKKyAgICAgICAgICAgICAgICAgICAgICAgIHRoaXMucGFuZXNbcGFuZUdyb3VwQ29uc3RhbnRzLlNJREVfUEFORV9JRF0uYWRkVG9TaWRlUGFuZXNMaXN0KHBhbmVJZCk7CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgdmFyIHNpZGVQYW5lc0xpc3RMZW5ndGg7CisgICAgICAgICAgICAgICAgICAgIGlmKHRoaXMucGFuZXNbcGFuZUdyb3VwQ29uc3RhbnRzLlNJREVfUEFORV9JRF0peworICAgICAgICAgICAgICAgICAgICAgICAgc2lkZVBhbmVzTGlzdExlbmd0aCA9IHRoaXMucGFuZXNbcGFuZUdyb3VwQ29uc3RhbnRzLlNJREVfUEFORV9JRF0uZ2V0U2lkZVBhbmVzTGlzdCgpLmxlbmd0aDsKKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICB2YXIgbnVtYmVyUGFuZXMgPSBzaWRlUGFuZXNMaXN0TGVuZ3RoICsgMjsKKyAgICAgICAgICAgICAgICAgICAgdmFyIHdpZHRoVG9TZXQgPSAoKDEwMC9udW1iZXJQYW5lcykpICsgJyUnOworICAgICAgICAgICAgICAgICAgICBpZih0aGlzLnBhbmVzW3BhbmVHcm91cENvbnN0YW50cy5TSURFX1BBTkVfSURdKXsKKyAgICAgICAgICAgICAgICAgICAgICAgIHRoaXMucGFuZXNbcGFuZUdyb3VwQ29uc3RhbnRzLlNJREVfUEFORV9JRF0uc2V0V2lkdGgod2lkdGhUb1NldCk7CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgdmFyIHNsaWRlSW5QYW5lSWQ7CisKKyAgICAgICAgICAgICAgICAgICAgaWYodGhpcy5wYW5lc1twYW5lR3JvdXBDb25zdGFudHMuU0lERV9QQU5FX0lEXSl7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2xpZGVJblBhbmVJZCA9IHRoaXMucGFuZXNbcGFuZUdyb3VwQ29uc3RhbnRzLlNJREVfUEFORV9JRF0uZ2V0U2lkZVBhbmVzTGlzdCgpW3NpZGVQYW5lc0xpc3RMZW5ndGggLSAxXTsKKyAgICAgICAgICAgICAgICAgICAgfQorCisgICAgICAgICAgICAgICAgICAgIHZhciB0aGF0ID0gdGhpczsKKworICAgICAgICAgICAgICAgICAgICBpZih0aGF0LnBhbmVzW3BhbmVHcm91cENvbnN0YW50cy5TSURFX1BBTkVfSURdKXsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBwYW5lc0xpc3QgPSB0aGF0LnBhbmVzW3BhbmVHcm91cENvbnN0YW50cy5TSURFX1BBTkVfSURdLmdldFNpZGVQYW5lc0xpc3QoKTsKKyAgICAgICAgICAgICAgICAgICAgfQorCisgICAgICAgICAgICAgICAgICAgIGZvcih2YXIgcCBpbiBwYW5lc0xpc3QpeworICAgICAgICAgICAgICAgICAgICAgICAgaWYocGFuZXNMaXN0Lmhhc093blByb3BlcnR5KHApKXsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YXIgcGFuZUxpc3RQYW5lSWQgPSBwYW5lc0xpc3RbcF07CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFyIHBhbmUgPSB0aGlzLnBhbmVzW3BhbmVMaXN0UGFuZUlkXTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZihwYW5lTGlzdFBhbmVJZCAhPT0gc2xpZGVJblBhbmVJZCAmJiBwYW5lKXsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBhbmUuc2V0V2lkdGgod2lkdGhUb1NldCk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwYW5lLmRpc3BsYXlCbG9jaygpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcGFuZS5mbG9hdExlZnQoKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgIH0KKworICAgICAgICAgICAgICAgICAgICBpZih0aGlzLnBhbmVzW3RoaXMucGFuZXNbcGFuZUdyb3VwQ29uc3RhbnRzLlNJREVfUEFORV9JRF0uY3VycmVudFNlbGVjdGVkUm93UGFuZUlkXSl7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgdGhpcy5wYW5lc1t0aGlzLnBhbmVzW3BhbmVHcm91cENvbnN0YW50cy5TSURFX1BBTkVfSURdLmN1cnJlbnRTZWxlY3RlZFJvd1BhbmVJZF0uZGlzcGxheUJsb2NrKCk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgdGhpcy5wYW5lc1t0aGlzLnBhbmVzW3BhbmVHcm91cENvbnN0YW50cy5TSURFX1BBTkVfSURdLmN1cnJlbnRTZWxlY3RlZFJvd1BhbmVJZF0uc2hvd1JpZ2h0Qm9yZGVyKCk7CisKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB0aGlzLnBhbmVzW3RoaXMucGFuZXNbcGFuZUdyb3VwQ29uc3RhbnRzLlNJREVfUEFORV9JRF0uY3VycmVudFNlbGVjdGVkUm93UGFuZUlkXS5yZXNpemVXaWR0aCh3aWR0aFRvU2V0LGZ1bmN0aW9uKCl7CisKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmKHRoYXQucGFuZXNbc2xpZGVJblBhbmVJZF0gJiYgdGhhdC5wYW5lc1t0aGF0LnBhbmVzW3BhbmVHcm91cENvbnN0YW50cy5TSURFX1BBTkVfSURdLmN1cnJlbnRTZWxlY3RlZFJvd1BhbmVJZF0peworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0aGF0LnBhbmVzW3RoYXQucGFuZXNbcGFuZUdyb3VwQ29uc3RhbnRzLlNJREVfUEFORV9JRF0uY3VycmVudFNlbGVjdGVkUm93UGFuZUlkXS5oaWRlUmlnaHRCb3JkZXIoKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdGhhdC5wYW5lc1tzbGlkZUluUGFuZUlkXS5zZXRXaWR0aCh3aWR0aFRvU2V0KTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdGhhdC5wYW5lc1tzbGlkZUluUGFuZUlkXS5zbGlkZUZyb21SaWdodCgpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0aGF0LnBhbmVzW3NsaWRlSW5QYW5lSWRdLmRpc3BsYXlCbG9jaygpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0aGF0LnBhbmVzW3NsaWRlSW5QYW5lSWRdLmZsb2F0TGVmdCgpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQorCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSk7CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICB9CisJfTsKKworCXRoaXMuc2xpZGVPdXRQYW5lID0gZnVuY3Rpb24ocGFuZUlkLGlzRnJvbVNpZGVQYW5lKXsKKyAgICAgICAgICAgIHRoaXMuX3NsaWRlT3V0UGFuZShwYW5lSWQsaXNGcm9tU2lkZVBhbmUpOworCX07Cit9XSkKKy5kaXJlY3RpdmUoJ3BhbmVHcm91cCcsIFsnJHRpbWVvdXQnLGZ1bmN0aW9uKCR0aW1lb3V0KXsKKwlyZXR1cm4geworCQlyZXN0cmljdDogJ0VBJywKKwkJdHJhbnNjbHVkZTogdHJ1ZSwKKwkJcmVwbGFjZTogdHJ1ZSwKKwkJdGVtcGxhdGVVcmw6ICdhcHAvc2NyaXB0cy9uZ19qc19hdHRfdHBscy9wYW5lU2VsZWN0b3IvcGFuZUdyb3VwLmh0bWwnLAorCQlzY29wZTp7CisJCX0sCisJCWNvbnRyb2xsZXI6ICdQYW5lR3JvdXBDdHJsJywKKwkJbGluazogZnVuY3Rpb24oc2NvcGUsZWxlbWVudCxhdHRyLGN0cmwpeworCQkJJHRpbWVvdXQoaW5pdGlhbGl6ZSwxMDApOworCQkJZnVuY3Rpb24gaW5pdGlhbGl6ZSgpeworCQkJCWN0cmwuaW5pdCgpOworCQkJfQorCQl9CisJfTsKK31dKTsKK2FuZ3VsYXIubW9kdWxlKCdhdHQuYWJzLnRvb2x0aXAnLCBbJ2F0dC5hYnMucG9zaXRpb24nLCAnYXR0LmFicy51dGlsaXRpZXMnLCAnbmdTYW5pdGl6ZSddKQorICAgICAgICAvLyBUaGUgZGVmYXVsdCBvcHRpb25zIHRvb2x0aXAgYW5kIHBvcG92ZXIuCisgICAgICAgIC5jb25zdGFudCgndG9vbHRpcERlZmF1bHRPcHRpb25zJywgeworICAgICAgICAgICAgcGxhY2VtZW50OiAnYWJvdmUnLAorICAgICAgICAgICAgYW5pbWF0aW9uOiBmYWxzZSwKKyAgICAgICAgICAgIHBvcHVwRGVsYXk6IDAsCisgICAgICAgICAgICBzdHlsZXR0OiAnZGFyaycsCisgICAgICAgICAgICBhcHBlbmRUb0JvZHk6IHRydWUKKyAgICAgICAgfSkKKworICAgICAgICAvKioKKyAgICAgICAgICogVGhlICR0b29sdGlwIHNlcnZpY2UgY3JlYXRlcyB0b29sdGlwLSBhbmQgcG9wb3Zlci1saWtlIGRpcmVjdGl2ZXMgYXMgd2VsbCBhcworICAgICAgICAgKiBob3VzZXMgZ2xvYmFsIG9wdGlvbnMgZm9yIHRoZW0uCisgICAgICAgICAqLworICAgICAgICAucHJvdmlkZXIoJyR0b29sdGlwJywgWyd0b29sdGlwRGVmYXVsdE9wdGlvbnMnLCBmdW5jdGlvbih0b29sdGlwRGVmYXVsdE9wdGlvbnMpIHsKKworICAgICAgICAgICAgLy8gRGVmYXVsdCBoaWRlIHRyaWdnZXJzIGZvciBlYWNoIHNob3cgdHJpZ2dlcgorICAgICAgICAgICAgdmFyIHRyaWdnZXJNYXAgPSB7CisgICAgICAgICAgICAgICAgJ21vdXNlZW50ZXInOiAnbW91c2VsZWF2ZScsCisgICAgICAgICAgICAgICAgJ2NsaWNrJzogJ2NsaWNrJywKKyAgICAgICAgICAgICAgICAnZm9jdXMnOiAnYmx1cicsCisgICAgICAgICAgICAgICAgJ21vdXNlb3Zlcic6J21vdXNlb3V0JworICAgICAgICAgICAgfTsKKworICAgICAgICAgICAgLy8gVGhlIG9wdGlvbnMgc3BlY2lmaWVkIHRvIHRoZSBwcm92aWRlciBnbG9iYWxseS4KKyAgICAgICAgICAgIHZhciBnbG9iYWxPcHRpb25zID0ge307CisKKyAgICAgICAgICAgIHRoaXMub3B0aW9ucyA9IGZ1bmN0aW9uKHZhbHVlKSB7CisgICAgICAgICAgICAgICAgYW5ndWxhci5leHRlbmQoZ2xvYmFsT3B0aW9ucywgdmFsdWUpOworICAgICAgICAgICAgfTsKKworICAgICAgICAgICAgLyoqCisgICAgICAgICAgICAgKiBUaGlzIGFsbG93cyB5b3UgdG8gZXh0ZW5kIHRoZSBzZXQgb2YgdHJpZ2dlciBtYXBwaW5ncyBhdmFpbGFibGUuIEUuZy46CisgICAgICAgICAgICAgKgorICAgICAgICAgICAgICogICAkdG9vbHRpcFByb3ZpZGVyLnNldFRyaWdnZXJzKCAnb3BlblRyaWdnZXInOiAnY2xvc2VUcmlnZ2VyJyApOworICAgICAgICAgICAgICovCisgICAgICAgICAgICB0aGlzLnNldFRyaWdnZXJzID0gZnVuY3Rpb24odHJpZ2dlcnMpIHsKKyAgICAgICAgICAgICAgICBhbmd1bGFyLmV4dGVuZCh0cmlnZ2VyTWFwLCB0cmlnZ2Vycyk7CisgICAgICAgICAgICB9OworCisgICAgICAgICAgICAvKioKKyAgICAgICAgICAgICAqIFRoaXMgaXMgYSBoZWxwZXIgZnVuY3Rpb24gZm9yIHRyYW5zbGF0aW5nIGNhbWVsLWNhc2UgdG8gc25ha2UtY2FzZS4KKyAgICAgICAgICAgICAqLworICAgICAgICAgICAgZnVuY3Rpb24gc25ha2VDYXNlKG5hbWUpIHsKKyAgICAgICAgICAgICAgICB2YXIgcmVnZXhwID0gL1tBLVpdL2c7CisgICAgICAgICAgICAgICAgdmFyIHNlcGFyYXRvciA9ICctJzsKKyAgICAgICAgICAgICAgICByZXR1cm4gbmFtZS5yZXBsYWNlKHJlZ2V4cCwgZnVuY3Rpb24obGV0dGVyLCBwb3MpIHsKKyAgICAgICAgICAgICAgICAgICAgcmV0dXJuIChwb3MgPyBzZXBhcmF0b3IgOiAnJykgKyBsZXR0ZXIudG9Mb3dlckNhc2UoKTsKKyAgICAgICAgICAgICAgICB9KTsKKyAgICAgICAgICAgIH0KKworICAgICAgICAgICAgLyoqCisgICAgICAgICAgICAgKiBSZXR1cm5zIHRoZSBhY3R1YWwgaW5zdGFuY2Ugb2YgdGhlICR0b29sdGlwIHNlcnZpY2UuCisgICAgICAgICAgICAgKi8KKyAgICAgICAgICAgIHRoaXMuJGdldCA9IFsnJHdpbmRvdycsICckY29tcGlsZScsICckdGltZW91dCcsICckcGFyc2UnLCAnJGRvY3VtZW50JywgJyRwb3NpdGlvbicsICckaW50ZXJwb2xhdGUnLCAnJGF0dEVsZW1lbnREZXRhY2gnLCBmdW5jdGlvbigkd2luZG93LCAkY29tcGlsZSwgJHRpbWVvdXQsICRwYXJzZSwgJGRvY3VtZW50LCAkcG9zaXRpb24sICRpbnRlcnBvbGF0ZSwgJGF0dEVsZW1lbnREZXRhY2gpIHsKKyAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGZ1bmN0aW9uICh0eXBlLCBwcmVmaXgsIGRlZmF1bHRUcmlnZ2VyU2hvdykgeworICAgICAgICAgICAgICAgICAgICAgICAgdmFyIG9wdGlvbnMgPSBhbmd1bGFyLmV4dGVuZCh7fSwgdG9vbHRpcERlZmF1bHRPcHRpb25zLCBnbG9iYWxPcHRpb25zKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIC8qKgorICAgICAgICAgICAgICAgICAgICAgICAgICogUmV0dXJucyBhbiBvYmplY3Qgb2Ygc2hvdyBhbmQgaGlkZSB0cmlnZ2Vycy4KKyAgICAgICAgICAgICAgICAgICAgICAgICAqCisgICAgICAgICAgICAgICAgICAgICAgICAgKiBJZiBhIHRyaWdnZXIgaXMgc3VwcGxpZWQsCisgICAgICAgICAgICAgICAgICAgICAgICAgKiBpdCBpcyB1c2VkIHRvIHNob3cgdGhlIHRvb2x0aXA7IG90aGVyd2lzZSwgaXQgd2lsbCB1c2UgdGhlIGB0cmlnZ2VyYAorICAgICAgICAgICAgICAgICAgICAgICAgICogb3B0aW9uIHBhc3NlZCB0byB0aGUgYCR0b29sdGlwUHJvdmlkZXIub3B0aW9uc2AgbWV0aG9kOyBlbHNlIGl0IHdpbGwKKyAgICAgICAgICAgICAgICAgICAgICAgICAqIGRlZmF1bHQgdG8gdGhlIHRyaWdnZXIgc3VwcGxpZWQgdG8gdGhpcyBkaXJlY3RpdmUgZmFjdG9yeS4KKyAgICAgICAgICAgICAgICAgICAgICAgICAqCisgICAgICAgICAgICAgICAgICAgICAgICAgKiBUaGUgaGlkZSB0cmlnZ2VyIGlzIGJhc2VkIG9uIHRoZSBzaG93IHRyaWdnZXIuIElmIHRoZSBgdHJpZ2dlcmAgb3B0aW9uCisgICAgICAgICAgICAgICAgICAgICAgICAgKiB3YXMgcGFzc2VkIHRvIHRoZSBgJHRvb2x0aXBQcm92aWRlci5vcHRpb25zYCBtZXRob2QsIGl0IHdpbGwgdXNlIHRoZQorICAgICAgICAgICAgICAgICAgICAgICAgICogbWFwcGVkIHRyaWdnZXIgZnJvbSBgdHJpZ2dlck1hcGAgb3IgdGhlIHBhc3NlZCB0cmlnZ2VyIGlmIHRoZSBtYXAgaXMKKyAgICAgICAgICAgICAgICAgICAgICAgICAqIHVuZGVmaW5lZDsgb3RoZXJ3aXNlLCBpdCB1c2VzIHRoZSBgdHJpZ2dlck1hcGAgdmFsdWUgb2YgdGhlIHNob3cKKyAgICAgICAgICAgICAgICAgICAgICAgICAqIHRyaWdnZXI7IGVsc2UgaXQgd2lsbCBqdXN0IHVzZSB0aGUgc2hvdyB0cmlnZ2VyLgorICAgICAgICAgICAgICAgICAgICAgICAgICovCisgICAgICAgICAgICAgICAgICAgICAgICBmdW5jdGlvbiBnZXRUcmlnZ2Vycyh0cmlnZ2VyKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFyIHNob3cgPSB0cmlnZ2VyIHx8IG9wdGlvbnMudHJpZ2dlciB8fCBkZWZhdWx0VHJpZ2dlclNob3c7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFyIGhpZGUgPSB0cmlnZ2VyTWFwW3Nob3ddIHx8IHNob3c7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2hvdzogc2hvdywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaGlkZTogaGlkZQorICAgICAgICAgICAgICAgICAgICAgICAgICAgIH07CisgICAgICAgICAgICAgICAgICAgICAgICB9CisKKyAgICAgICAgICAgICAgICAgICAgICAgIHZhciBkaXJlY3RpdmVOYW1lID0gc25ha2VDYXNlKHR5cGUpOworCisgICAgICAgICAgICAgICAgICAgICAgICB2YXIgc3RhcnRTeW0gPSAkaW50ZXJwb2xhdGUuc3RhcnRTeW1ib2woKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIHZhciBlbmRTeW0gPSAkaW50ZXJwb2xhdGUuZW5kU3ltYm9sKCk7CisKKyAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmVzdHJpY3Q6ICdFQScsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2NvcGU6IHRydWUsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgbGluazogZnVuY3Rpb24gKHNjb3BlLCBlbGVtZW50LCBhdHRycykgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvKiBBbGxvd3MgYSBkZXZlbG9wZXIgdG8gZm9yY2UgZWxlbWVudCB0byBiZSBub24tdGFiYWJsZSAqLworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoIWVsZW1lbnQuYXR0cigndGFiaW5kZXgnKSkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZWxlbWVudC5hdHRyKCd0YWJpbmRleCcsICcwJyk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0gCisKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFyIGlzRWxlbWVudEhvdmVyZWQgPSBmYWxzZTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZWxlbWVudC5iaW5kKCdtb3VzZWVudGVyJywgZnVuY3Rpb24oKXsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlzRWxlbWVudEhvdmVyZWQgPSB0cnVlOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZWxlbWVudC5yZW1vdmVBdHRyKCd0aXRsZScpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9KTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZWxlbWVudC5iaW5kKCdtb3VzZWxlYXZlJywgZnVuY3Rpb24oKXsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlzRWxlbWVudEhvdmVyZWQgPSBmYWxzZTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vICAgc2V0VG9vbHRpcEFyaWFMYWJlbCgpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9KTsKKworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvKiBXZSBzdG9yZSBvdXIgYXR0cmlidXRlcyBvbiBvdXIgc2NvcGUgc28gYW55IHVzZXIgb2YgJHRvb2x0aXAgc2VydmljZSBjYW4gYWNjZXNzIGF0dHJpYnV0ZXMgKi8KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2NvcGUucGFyZW50QXR0cnMgPSBhdHRyczsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFyIHRlbXBsYXRlID0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAnPGRpdiAnICsgZGlyZWN0aXZlTmFtZSArICctcG9wdXAgJyArCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJ3RpdGxlPSInICsgc3RhcnRTeW0gKyAndHRfdGl0bGUnICsgZW5kU3ltICsgJyIgJyArCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJ2NvbnRlbnQ9IicgKyBzdGFydFN5bSArICd0dF9jb250ZW50JyArIGVuZFN5bSArICciICcgKworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICdwbGFjZW1lbnQ9IicgKyBzdGFydFN5bSArICd0dF9wbGFjZW1lbnQnICsgZW5kU3ltICsgJyIgJyArCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJ2FuaW1hdGlvbj0idHRfYW5pbWF0aW9uKCkiICcgKworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICdpcy1vcGVuPSJ0dF9pc09wZW4iICcgKworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICdzdHlsZXR0PSInICsgc3RhcnRTeW0gKyAndHRfc3R5bGUnICsgZW5kU3ltICsgJyIgJyArCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJz4nICsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAnPC9kaXY+JzsKKworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YXIgdG9vbHRpcCA9ICRjb21waWxlKHRlbXBsYXRlKShzY29wZSk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhciB0cmFuc2l0aW9uVGltZW91dDsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFyIHBvcHVwVGltZW91dDsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFyICRib2R5OworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YXIgYXBwZW5kVG9Cb2R5ID0gYW5ndWxhci5pc0RlZmluZWQob3B0aW9ucy5hcHBlbmRUb0JvZHkpID8gb3B0aW9ucy5hcHBlbmRUb0JvZHkgOiBmYWxzZTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFyIHRyaWdnZXJzID0gZ2V0VHJpZ2dlcnModW5kZWZpbmVkKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFyIGhhc1JlZ2lzdGVyZWRUcmlnZ2VycyA9IGZhbHNlOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YXIgaGFzRW5hYmxlRXhwID0gYW5ndWxhci5pc0RlZmluZWQoYXR0cnNbcHJlZml4ICsgJ0VuYWJsZSddKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFyIHRvb2x0aXBPZmZzZXQgPSAwOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YXIgdG9vbHRpcEFyaWFMYWJlbERlZmluZWQgPSBmYWxzZTsKKworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyBCeSBkZWZhdWx0LCB0aGUgdG9vbHRpcCBpcyBub3Qgb3Blbi4KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gYWRkIGFiaWxpdHkgdG8gc3RhcnQgdG9vbHRpcCBvcGVuZWQKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2NvcGUudHRfaXNPcGVuID0gZmFsc2U7CisKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLy9BZGRpbmcgYSBzY29wZSB3YXRjaCwgdG8gcmVtb3ZlIHRoZSBjcmVhdGVkIHBvcHVwIGZyb20gRE9NLCBpbmNhc2UgaXQgaXMgdXBkYXRlZCBvdXRzaWRlIHRoZSBwcm92aWRlciBjb2RlLgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzY29wZS4kd2F0Y2goJ3R0X2lzT3BlbicsIGZ1bmN0aW9uKG5ld1ZhbCwgb2xkVmFsKXsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmKG5ld1ZhbCAhPT0gb2xkVmFsICYmICFuZXdWYWwpeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICRhdHRFbGVtZW50RGV0YWNoKHRvb2x0aXBbMF0pOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9KTsKKworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBmdW5jdGlvbiB0b2dnbGVUb29sdGlwQmluZCgpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICghc2NvcGUudHRfaXNPcGVuKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2hvd1Rvb2x0aXBCaW5kKCk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGhpZGVUb29sdGlwQmluZCgpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CisKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gU2hvdyB0aGUgdG9vbHRpcCB3aXRoIGRlbGF5IGlmIHNwZWNpZmllZCwgb3RoZXJ3aXNlIHNob3cgaXQgaW1tZWRpYXRlbHkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZnVuY3Rpb24gc2hvd1Rvb2x0aXBCaW5kKCkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGhhc0VuYWJsZUV4cCAmJiAhc2NvcGUuJGV2YWwoYXR0cnNbcHJlZml4ICsgJ0VuYWJsZSddKSkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybjsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChzY29wZS50dF9wb3B1cERlbGF5KSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcG9wdXBUaW1lb3V0ID0gJHRpbWVvdXQoc2hvdywgc2NvcGUudHRfcG9wdXBEZWxheSk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNjb3BlLiRhcHBseShzaG93KTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQorCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZ1bmN0aW9uIGhpZGVUb29sdGlwQmluZCgpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNjb3BlLiRhcHBseShmdW5jdGlvbigpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBoaWRlKCk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9KTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQorCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vIFNob3cgdGhlIHRvb2x0aXAgcG9wdXAgZWxlbWVudC4KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZnVuY3Rpb24gc2hvdygpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhciBwb3NpdGlvbiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdHRXaWR0aCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdHRIZWlnaHQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHR0UG9zaXRpb247CisKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vIERvbid0IHNob3cgZW1wdHkgdG9vbHRpcHMuCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoIXNjb3BlLnR0X2NvbnRlbnQpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm47CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CisKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vIElmIHRoZXJlIGlzIGEgcGVuZGluZyByZW1vdmUgdHJhbnNpdGlvbiwgd2UgbXVzdCBjYW5jZWwgaXQsIGxlc3QgdGhlCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyB0b29sdGlwIGJlIG15c3RlcmlvdXNseSByZW1vdmVkLgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHRyYW5zaXRpb25UaW1lb3V0KSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJHRpbWVvdXQuY2FuY2VsKHRyYW5zaXRpb25UaW1lb3V0KTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KKworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gU2V0IHRoZSBpbml0aWFsIHBvc2l0aW9uaW5nLgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdG9vbHRpcC5jc3Moe3RvcDogMCwgbGVmdDogMCwgZGlzcGxheTogJ2Jsb2NrJywgJ3otaW5kZXgnOiA5OTk5fSk7CisKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vIE5vdyB3ZSBhZGQgaXQgdG8gdGhlIERPTSBiZWNhdXNlIG5lZWQgc29tZSBpbmZvIGFib3V0IGl0LiBCdXQgaXQncyBub3QKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vIHZpc2libGUgeWV0IGFueXdheS4KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChhcHBlbmRUb0JvZHkpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAkYm9keSA9ICRib2R5IHx8ICRkb2N1bWVudC5maW5kKCdib2R5Jyk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJGJvZHkuYXBwZW5kKHRvb2x0aXApOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBlbGVtZW50LmFmdGVyKHRvb2x0aXApOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQorCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyBHZXQgdGhlIHBvc2l0aW9uIG9mIHRoZSBkaXJlY3RpdmUgZWxlbWVudC4KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBvc2l0aW9uID0gYXBwZW5kVG9Cb2R5ID8gJHBvc2l0aW9uLm9mZnNldChlbGVtZW50KSA6ICRwb3NpdGlvbi5wb3NpdGlvbihlbGVtZW50KTsKKworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gR2V0IHRoZSBoZWlnaHQgYW5kIHdpZHRoIG9mIHRoZSB0b29sdGlwIHNvIHdlIGNhbiBjZW50ZXIgaXQuCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0dFdpZHRoID0gdG9vbHRpcC5wcm9wKCdvZmZzZXRXaWR0aCcpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdHRIZWlnaHQgPSB0b29sdGlwLnByb3AoJ29mZnNldEhlaWdodCcpOworCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyBDYWxjdWxhdGUgdGhlIHRvb2x0aXAncyB0b3AgYW5kIGxlZnQgY29vcmRpbmF0ZXMgdG8gY2VudGVyIGl0IHdpdGgKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vIHRoaXMgZGlyZWN0aXZlLgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFyIHR0QXJyb3dPZmZzZXQgPSAxMDsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHN3aXRjaCAoc2NvcGUudHRfcGxhY2VtZW50KSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY2FzZSAncmlnaHQnOgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZihhcHBlbmRUb0JvZHkpeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdHRQb3NpdGlvbiA9IHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0b3A6IHBvc2l0aW9uLnRvcCArIHBvc2l0aW9uLmhlaWdodCAvIDIgLSB0dEhlaWdodCAvIDIsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbGVmdDogKHBvc2l0aW9uLmxlZnQgKyBwb3NpdGlvbi53aWR0aCkgKyB0b29sdGlwT2Zmc2V0CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9OworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9ZWxzZXsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHR0UG9zaXRpb24gPSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdG9wOiBwb3NpdGlvbi50b3AgKyBwb3NpdGlvbi5oZWlnaHQgLyAyIC0gdHRIZWlnaHQgLyAyLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxlZnQ6IChwb3NpdGlvbi5sZWZ0ICsgcG9zaXRpb24ud2lkdGggKyB0dEFycm93T2Zmc2V0KSArIHRvb2x0aXBPZmZzZXQKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH07CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY2FzZSAnYmVsb3cnOgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZihhcHBlbmRUb0JvZHkpeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdHRQb3NpdGlvbiA9IHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0b3A6IChwb3NpdGlvbi50b3AgKyBwb3NpdGlvbi5oZWlnaHQpICsgdG9vbHRpcE9mZnNldCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBsZWZ0OiBwb3NpdGlvbi5sZWZ0ICsgcG9zaXRpb24ud2lkdGggLyAyIC0gdHRXaWR0aCAvIDIKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH07CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1lbHNleworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdHRQb3NpdGlvbiA9IHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0b3A6IChwb3NpdGlvbi50b3AgKyBwb3NpdGlvbi5oZWlnaHQgKyB0dEFycm93T2Zmc2V0KSArIHRvb2x0aXBPZmZzZXQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbGVmdDogcG9zaXRpb24ubGVmdCArIHBvc2l0aW9uLndpZHRoIC8gMiAtIHR0V2lkdGggLyAyCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9OworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNhc2UgJ2xlZnQnOgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZihhcHBlbmRUb0JvZHkpeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdHRQb3NpdGlvbiA9IHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0b3A6IHBvc2l0aW9uLnRvcCArIHBvc2l0aW9uLmhlaWdodCAvIDIgLSB0dEhlaWdodCAvIDIsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbGVmdDogKHBvc2l0aW9uLmxlZnQgLSB0dFdpZHRoKSAtIHRvb2x0aXBPZmZzZXQKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH07CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1lbHNleworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdHRQb3NpdGlvbiA9IHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0b3A6IHBvc2l0aW9uLnRvcCArIHBvc2l0aW9uLmhlaWdodCAvIDIgLSB0dEhlaWdodCAvIDIsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbGVmdDogKHBvc2l0aW9uLmxlZnQgLSB0dFdpZHRoIC0gdHRBcnJvd09mZnNldCkgLSB0b29sdGlwT2Zmc2V0CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9OworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRlZmF1bHQ6CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmKGFwcGVuZFRvQm9keSl7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0dFBvc2l0aW9uID0geworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRvcDogKHBvc2l0aW9uLnRvcCAtIHR0SGVpZ2h0KSAtIHRvb2x0aXBPZmZzZXQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbGVmdDogcG9zaXRpb24ubGVmdCArIHBvc2l0aW9uLndpZHRoIC8gMiAtIHR0V2lkdGggLyAyCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9OworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9ZWxzZXsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHR0UG9zaXRpb24gPSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdG9wOiAocG9zaXRpb24udG9wIC0gdHRIZWlnaHQgLSB0dEFycm93T2Zmc2V0KSAtIHRvb2x0aXBPZmZzZXQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbGVmdDogcG9zaXRpb24ubGVmdCArIHBvc2l0aW9uLndpZHRoIC8gMiAtIHR0V2lkdGggLyAyCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9OworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQorCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0dFBvc2l0aW9uLnRvcCArPSAncHgnOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdHRQb3NpdGlvbi5sZWZ0ICs9ICdweCc7CisKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vIE5vdyBzZXQgdGhlIGNhbGN1bGF0ZWQgcG9zaXRpb25pbmcuCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0b29sdGlwLmNzcyh0dFBvc2l0aW9uKTsKKworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gQW5kIHNob3cgdGhlIHRvb2x0aXAuCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzY29wZS50dF9pc09wZW4gPSB0cnVlOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CisKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gSGlkZSB0aGUgdG9vbHRpcCBwb3B1cCBlbGVtZW50LgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBmdW5jdGlvbiBoaWRlKCkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gRmlyc3QgdGhpbmdzIGZpcnN0OiB3ZSBkb24ndCBzaG93IGl0IGFueW1vcmUuCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzY29wZS50dF9pc09wZW4gPSBmYWxzZTsKKworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLy9pZiB0b29sdGlwIGlzIGdvaW5nIHRvIGJlIHNob3duIGFmdGVyIGRlbGF5LCB3ZSBtdXN0IGNhbmNlbCB0aGlzCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAkdGltZW91dC5jYW5jZWwocG9wdXBUaW1lb3V0KTsKKworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gQW5kIG5vdyB3ZSByZW1vdmUgaXQgZnJvbSB0aGUgRE9NLiBIb3dldmVyLCBpZiB3ZSBoYXZlIGFuaW1hdGlvbiwgd2UKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vIG5lZWQgdG8gd2FpdCBmb3IgaXQgdG8gZXhwaXJlIGJlZm9yZWhhbmQuCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyBUaGlzIGlzIGEgcGxhY2Vob2xkZXIgZm9yIGEgcG9ydCBvZiB0aGUgdHJhbnNpdGlvbnMgbGlicmFyeS4KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChhbmd1bGFyLmlzRGVmaW5lZChzY29wZS50dF9hbmltYXRpb24pICYmIHNjb3BlLnR0X2FuaW1hdGlvbigpKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdHJhbnNpdGlvblRpbWVvdXQgPSAkdGltZW91dChmdW5jdGlvbigpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJGF0dEVsZW1lbnREZXRhY2godG9vbHRpcFswXSk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSwgNTAwKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJGF0dEVsZW1lbnREZXRhY2godG9vbHRpcFswXSk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KKworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBmdW5jdGlvbiBzZXRUb29sdGlwQXJpYUxhYmVsKCkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZWxlbWVudC5yZW1vdmVBdHRyKCd0aXRsZScpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYoIWlzRWxlbWVudEhvdmVyZWQpeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICh0b29sdGlwQXJpYUxhYmVsRGVmaW5lZCkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBlbGVtZW50LmF0dHIoJ3RpdGxlJywgc2NvcGUudG9vbHRpcEFyaWFMYWJlbCk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZWxlbWVudC5hdHRyKCd0aXRsZScsIHNjb3BlLnR0X2NvbnRlbnQpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQorCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8qKgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKiBPYnNlcnZlIHRoZSByZWxldmFudCBhdHRyaWJ1dGVzLgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYXR0cnMuJG9ic2VydmUodHlwZSwgZnVuY3Rpb24odmFsKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAodmFsKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2NvcGUudHRfY29udGVudCA9IHZhbDsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vIHNldFRvb2x0aXBBcmlhTGFiZWwoKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHNjb3BlLnR0X2lzT3BlbikgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBoaWRlKCk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9KTsKKworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBhdHRycy4kb2JzZXJ2ZShwcmVmaXggKyAnVGl0bGUnLCBmdW5jdGlvbih2YWwpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNjb3BlLnR0X3RpdGxlID0gdmFsOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9KTsKKworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBhdHRycy4kb2JzZXJ2ZShwcmVmaXggKyAnUGxhY2VtZW50JywgZnVuY3Rpb24odmFsKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzY29wZS50dF9wbGFjZW1lbnQgPSBhbmd1bGFyLmlzRGVmaW5lZCh2YWwpID8gdmFsIDogb3B0aW9ucy5wbGFjZW1lbnQ7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0pOworCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGF0dHJzLiRvYnNlcnZlKHByZWZpeCArICdTdHlsZScsIGZ1bmN0aW9uKHZhbCkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2NvcGUudHRfc3R5bGUgPSBhbmd1bGFyLmlzRGVmaW5lZCh2YWwpID8gdmFsIDogb3B0aW9ucy5zdHlsZXR0OworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9KTsKKworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBhdHRycy4kb2JzZXJ2ZShwcmVmaXggKyAnQW5pbWF0aW9uJywgZnVuY3Rpb24odmFsKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzY29wZS50dF9hbmltYXRpb24gPSBhbmd1bGFyLmlzRGVmaW5lZCh2YWwpID8gJHBhcnNlKHZhbCkgOiBmdW5jdGlvbigpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gb3B0aW9ucy5hbmltYXRpb247CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9OworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9KTsKKworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBhdHRycy4kb2JzZXJ2ZShwcmVmaXggKyAnUG9wdXBEZWxheScsIGZ1bmN0aW9uKHZhbCkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFyIGRlbGF5ID0gcGFyc2VJbnQodmFsLCAxMCk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzY29wZS50dF9wb3B1cERlbGF5ID0gIWlzTmFOKGRlbGF5KSA/IGRlbGF5IDogb3B0aW9ucy5wb3B1cERlbGF5OworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9KTsKKworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBhdHRycy4kb2JzZXJ2ZShwcmVmaXggKyAnVHJpZ2dlcicsIGZ1bmN0aW9uKHZhbCkgeworCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoaGFzUmVnaXN0ZXJlZFRyaWdnZXJzKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZWxlbWVudC51bmJpbmQodHJpZ2dlcnMuc2hvdywgc2hvd1Rvb2x0aXBCaW5kKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBlbGVtZW50LnVuYmluZCh0cmlnZ2Vycy5oaWRlLCBoaWRlVG9vbHRpcEJpbmQpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQorCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0cmlnZ2VycyA9IGdldFRyaWdnZXJzKHZhbCk7CisKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8qIFRoaXMgZml4ZXMgaXNzdWUgaW4gd2hpY2ggYSBjbGljayBvbiBpbnB1dCBmaWVsZCB3aXRoIHRyaWdnZXIgYXMgZm9jdXMgCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY2F1c2VzIGZvY3VzIHRvIGZpcmUgZm9sbG93aW5nIGNsaWNrIHRodXMgbWFraW5nIHRvb2x0aXAgZmxhc2guICovCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAodHJpZ2dlcnMuc2hvdyA9PT0gJ2ZvY3VzJykgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGVsZW1lbnQuYmluZCgnZm9jdXMnLCBzaG93VG9vbHRpcEJpbmQpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGVsZW1lbnQuYmluZCgnYmx1cicsIGhpZGVUb29sdGlwQmluZCk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZWxlbWVudC5iaW5kKCdjbGljaycsIGZ1bmN0aW9uKGUpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZS5zdG9wUHJvcGFnYXRpb24oKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9KTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAodHJpZ2dlcnMuc2hvdyA9PT0gdHJpZ2dlcnMuaGlkZSkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGVsZW1lbnQuYmluZCh0cmlnZ2Vycy5zaG93LCB0b2dnbGVUb29sdGlwQmluZCk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGVsZW1lbnQuYmluZCh0cmlnZ2Vycy5zaG93LCBzaG93VG9vbHRpcEJpbmQpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGVsZW1lbnQuYmluZCh0cmlnZ2Vycy5oaWRlLCBoaWRlVG9vbHRpcEJpbmQpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQorCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBoYXNSZWdpc3RlcmVkVHJpZ2dlcnMgPSB0cnVlOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9KTsKKworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBhdHRycy4kb2JzZXJ2ZShwcmVmaXggKyAnQXBwZW5kVG9Cb2R5JywgZnVuY3Rpb24gKHZhbCkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYXBwZW5kVG9Cb2R5ID0gYW5ndWxhci5pc0RlZmluZWQodmFsKSA/ICRwYXJzZSh2YWwpKHNjb3BlKSA6IGFwcGVuZFRvQm9keTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSk7CisKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYXR0cnMuJG9ic2VydmUocHJlZml4ICsgJ09mZnNldCcsIGZ1bmN0aW9uICh2YWwpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRvb2x0aXBPZmZzZXQgPSBhbmd1bGFyLmlzRGVmaW5lZCh2YWwpID8gcGFyc2VJbnQodmFsLCAxMCkgOiAwOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9KTsKKworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBhdHRycy4kb2JzZXJ2ZShwcmVmaXggKyAnQXJpYUxhYmVsJywgZnVuY3Rpb24gKHZhbCkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGFuZ3VsYXIuaXNEZWZpbmVkKHZhbCkpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzY29wZS50b29sdGlwQXJpYUxhYmVsID0gdmFsOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRvb2x0aXBBcmlhTGFiZWxEZWZpbmVkID0gdHJ1ZTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdG9vbHRpcEFyaWFMYWJlbERlZmluZWQgPSBmYWxzZTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNldFRvb2x0aXBBcmlhTGFiZWwoKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSk7CisKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gaWYgYSB0b29sdGlwIGlzIGF0dGFjaGVkIHRvIDxib2R5PiB3ZSBuZWVkIHRvIHJlbW92ZSBpdCBvbgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyBsb2NhdGlvbiBjaGFuZ2UgYXMgaXRzIHBhcmVudCBzY29wZSB3aWxsIHByb2JhYmx5IG5vdCBiZSBkZXN0cm95ZWQKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gYnkgdGhlIGNoYW5nZS4KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGFwcGVuZFRvQm9keSkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2NvcGUuJG9uKCckbG9jYXRpb25DaGFuZ2VTdWNjZXNzJywgZnVuY3Rpb24oKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHNjb3BlLnR0X2lzT3BlbikgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBoaWRlKCk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KKworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyBNYWtlIHN1cmUgdG9vbHRpcCBpcyBkZXN0cm95ZWQgYW5kIHJlbW92ZWQuCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNjb3BlLiRvbignJGRlc3Ryb3knLCBmdW5jdGlvbigpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChzY29wZS50dF9pc09wZW4pIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBoaWRlKCk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRvb2x0aXAucmVtb3ZlKCk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0pOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgIH07CisgICAgICAgICAgICAgICAgICAgIH07CisgICAgICAgICAgICAgICAgfV07CisgICAgICAgIH1dKQorCisgICAgICAgIC5kaXJlY3RpdmUoJ3Rvb2x0aXBQb3B1cCcsIFsnJGRvY3VtZW50JywgJyRkb2N1bWVudEJpbmQnLCBmdW5jdGlvbigkZG9jdW1lbnQsICRkb2N1bWVudEJpbmQpIHsKKyAgICAgICAgICAgIHJldHVybiB7CisgICAgICAgICAgICAgICAgcmVzdHJpY3Q6ICdFQScsCisgICAgICAgICAgICAgICAgcmVwbGFjZTogdHJ1ZSwKKyAgICAgICAgICAgICAgICB0cmFuc2NsdWRlOiB0cnVlLAorICAgICAgICAgICAgICAgIHNjb3BlOiB7Y29udGVudDogJ0AnLCBwbGFjZW1lbnQ6ICdAJywgYW5pbWF0aW9uOiAnJicsIGlzT3BlbjogJz0nLCBzdHlsZXR0OiAnQCd9LAorICAgICAgICAgICAgICAgIHRlbXBsYXRlVXJsOiAnYXBwL3NjcmlwdHMvbmdfanNfYXR0X3RwbHMvdG9vbHRpcC90b29sdGlwLXBvcHVwLmh0bWwnLAorICAgICAgICAgICAgICAgIGxpbms6IGZ1bmN0aW9uKHNjb3BlLCBlbGVtKSB7CisgICAgICAgICAgICAgICAgICAgIHNjb3BlLiR3YXRjaCgiaXNPcGVuIiwgZnVuY3Rpb24oKSB7CisgICAgICAgICAgICAgICAgICAgICAgICBzY29wZS5pc09wZW47CisgICAgICAgICAgICAgICAgICAgIH0pOworICAgICAgICAgICAgICAgICAgICBlbGVtLmJpbmQoJ2NsaWNrJywgZnVuY3Rpb24gKGUpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIGUuc3RvcFByb3BhZ2F0aW9uKCk7CisgICAgICAgICAgICAgICAgICAgIH0pOworICAgICAgICAgICAgICAgICAgICB2YXIgb3V0c2lkZUNsaWNrID0gZnVuY3Rpb24oKSB7CisgICAgICAgICAgICAgICAgICAgICAgICBzY29wZS4kYXBwbHkoZnVuY3Rpb24oKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2NvcGUuaXNPcGVuID0gZmFsc2U7CisgICAgICAgICAgICAgICAgICAgICAgICB9KTsKKyAgICAgICAgICAgICAgICAgICAgfTsKKworICAgICAgICAgICAgICAgICAgICAkZG9jdW1lbnRCaW5kLmV2ZW50KCdjbGljaycsICdpc09wZW4nLCBvdXRzaWRlQ2xpY2ssIHNjb3BlLCB0cnVlLCAxMCk7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfTsKKyAgICAgICAgfV0pCisKKyAgICAgICAgLmRpcmVjdGl2ZSgndG9vbHRpcCcsIFsnJHRvb2x0aXAnLCBmdW5jdGlvbigkdG9vbHRpcCkgeworICAgICAgICAgICAgcmV0dXJuICR0b29sdGlwKCd0b29sdGlwJywgJ3Rvb2x0aXAnLCAnbW91c2VlbnRlcicpOworICAgICAgICB9XSkKKworICAgICAgICAuZGlyZWN0aXZlKCd0b29sdGlwQ29uZGl0aW9uJywgWyAnJHRpbWVvdXQnLGZ1bmN0aW9uKCR0aW1lb3V0KSB7CisgICAgICAgICAgICAgICAgcmV0dXJuICB7CisgICAgICAgICAgICAgICAgICAgIHJlc3RyaWN0OiAnRUEnLAorICAgICAgICAgICAgICAgICAgICByZXBsYWNlOiB0cnVlLAorICAgICAgICAgICAgICAgICAgICBzY29wZTp7CisgICAgICAgICAgICAgICAgICAgICAgICB0b29sdGlwQ29uZGl0aW9uOiJAPyIKKyAgICAgICAgICAgICAgICAgICAgfSwKKyAgICAgICAgICAgICAgICAgICAgdGVtcGxhdGU6JzxwPjxzcGFuIHRvb2x0aXA9XCJ7e3Rvb2x0aXBDb25kaXRpb259fVwiIG5nLWlmPVwic2hvd3BvcFwiPnt7dG9vbHRpcENvbmRpdGlvbn19PC9zcGFuPjxzcGFuIGlkPVwiaW5uZXJFbGVtZW50XCIgbmctaGlkZT1cInNob3dwb3BcIj57e3Rvb2x0aXBDb25kaXRpb259fTwvc3Bhbj48L3A+JywKKyAgICAgICAgICAgICAgICAgICAgbGluazogZnVuY3Rpb24oc2NvcGUsIGVsZW0sIGF0dHIpeworICAgICAgICAgICAgICAgICAgICAgICAgc2NvcGUuc2hvd3BvcD1mYWxzZTsKKyAgICAgICAgICAgICAgICAgICAgICAgIGlmKGF0dHIuaGVpZ2h0PT09J3RydWUnKXsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAkdGltZW91dChmdW5jdGlvbiAoKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFyIG1heEhlaWdodD0oZWxlbVswXS5vZmZzZXRIZWlnaHQpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhciBlbGVtSGVpZ2h0PWVsZW0uY2hpbGRyZW4oMClbMF0ub2Zmc2V0SGVpZ2h0OworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmKGVsZW1IZWlnaHQgPiBtYXhIZWlnaHQpeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzY29wZS5zaG93cG9wPXRydWU7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0pOworICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgZWxzZSBpZihzY29wZS50b29sdGlwQ29uZGl0aW9uLmxlbmd0aD49MjUpeworICAgICAgICAgICAgICAgICAgICAgICAgc2NvcGUuc2hvd3BvcD10cnVlOworICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgfTsKKyAgICAgICAgfV0pOworYW5ndWxhci5tb2R1bGUoJ2F0dC5hYnMucG9wT3ZlcnMnLCBbJ2F0dC5hYnMudG9vbHRpcCcsICdhdHQuYWJzLnV0aWxpdGllcycsICduZ1Nhbml0aXplJ10pCisgICAgICAgIC5kaXJlY3RpdmUoJ3BvcG92ZXInLCBbJyR0b29sdGlwJywgZnVuY3Rpb24oJHRvb2x0aXApIHsKKyAgICAgICAgICAgICAgICByZXR1cm4gJHRvb2x0aXAoJ3BvcG92ZXInLCAncG9wb3ZlcicsICdjbGljaycpOworICAgICAgICAgICAgfV0pCisgICAgICAgIC5kaXJlY3RpdmUoJ3BvcG92ZXJQb3B1cCcsIFsnJGRvY3VtZW50JywgJyRkb2N1bWVudEJpbmQnLCAnJHRpbWVvdXQnLCAnZXZlbnRzJywgJ0RPTUhlbHBlcicsIGZ1bmN0aW9uKCRkb2N1bWVudCwgJGRvY3VtZW50QmluZCwgJHRpbWVvdXQsIGV2ZW50cywgRE9NSGVscGVyKSB7CisgICAgICAgICAgICAgICAgcmV0dXJuIHsKKyAgICAgICAgICAgICAgICAgICAgcmVzdHJpY3Q6ICdFQScsCisgICAgICAgICAgICAgICAgICAgIHJlcGxhY2U6IHRydWUsCisgICAgICAgICAgICAgICAgICAgIHRyYW5zY2x1ZGU6IHRydWUsCisgICAgICAgICAgICAgICAgICAgIHRlbXBsYXRlVXJsOiAnYXBwL3NjcmlwdHMvbmdfanNfYXR0X3RwbHMvcG9wT3ZlcnMvcG9wT3ZlcnMuaHRtbCcsCisgICAgICAgICAgICAgICAgICAgIHNjb3BlOiB7Y29udGVudDogJ0AnLCBwbGFjZW1lbnQ6ICdAJywgYW5pbWF0aW9uOiAnJicsIGlzT3BlbjogJz0nLCBzdHlsZXR0OiAnQCd9LAorICAgICAgICAgICAgICAgICAgICBsaW5rOiBmdW5jdGlvbihzY29wZSwgZWxlbSwgYXR0ciwgY3RybCkgeworCisgICAgICAgICAgICAgICAgICAgICAgICBzY29wZS5jbG9zZWFibGUgPSBmYWxzZTsKKyAgICAgICAgICAgICAgICAgICAgICAgIHRyeSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2NvcGUuY2xvc2VhYmxlID0gc2NvcGUuJHBhcmVudC5wYXJlbnRBdHRyc1snY2xvc2VhYmxlJ10gPT09ICcnID8gdHJ1ZSA6IGZhbHNlOworICAgICAgICAgICAgICAgICAgICAgICAgfSBjYXRjaCAoZSkge30KKworICAgICAgICAgICAgICAgICAgICAgICAgLyogQmVmb3JlIG9wZW5pbmcgbW9kYWwsIGZpbmQgdGhlIGZvY3VzZWQgZWxlbWVudCAqLworICAgICAgICAgICAgICAgICAgICAgICAgdmFyIGxhdW5jaGluZ0VsZW1lbnQgPSB1bmRlZmluZWQsIAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZpcnN0VGFiYWJsZUVsZW1lbnQgPSB1bmRlZmluZWQ7CisKKyAgICAgICAgICAgICAgICAgICAgICAgIHZhciBvdXRzaWRlQ2xpY2sgPSBmdW5jdGlvbihldnQpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBzY29wZS4kYXBwbHkoZnVuY3Rpb24oKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNjb3BlLmlzT3BlbiA9IGZhbHNlOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0pOworICAgICAgICAgICAgICAgICAgICAgICAgfTsKKyAgICAgICAgICAgICAgICAgICAgICAgIHZhciBlc2NLZXlkb3duID0gZnVuY3Rpb24oZXZ0KSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGV2dC53aGljaCA9PT0gMjcgfHwgZXZ0LmtleUNvZGUgPT09IDI3KSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb25zb2xlLmxvZygnRVNDIHdhcyBwcmVzc2VkIScpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2NvcGUuJGFwcGx5KGZ1bmN0aW9uKCkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNjb3BlLmlzT3BlbiA9IGZhbHNlOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9KTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICB9OworCisgICAgICAgICAgICAgICAgICAgICAgICAkdGltZW91dChmdW5jdGlvbigpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBmaXJzdFRhYmFibGVFbGVtZW50ID0gRE9NSGVscGVyLmZpcnN0VGFiYWJsZUVsZW1lbnQoZWxlbSk7CisgICAgICAgICAgICAgICAgICAgICAgICB9LCAxMCwgZmFsc2UpOworICAgICAgICAgICAgICAgICAgICAgICAgCisgICAgICAgICAgICAgICAgICAgICAgICBzY29wZS4kd2F0Y2goJ2lzT3BlbicsIGZ1bmN0aW9uKHZhbHVlKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHNjb3BlLmlzT3BlbikgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBsYXVuY2hpbmdFbGVtZW50ID0gZG9jdW1lbnQuYWN0aXZlRWxlbWVudDsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLyogRm9jdXMgb24gZmlyc3QgdGFiYmFibGUgZWxlbWVudCAqLworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoYW5ndWxhci5pc0RlZmluZWQoZmlyc3RUYWJhYmxlRWxlbWVudCkpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRyeSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZmlyc3RUYWJhYmxlRWxlbWVudC5mb2N1cygpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSBjYXRjaChlKSB7fQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGFuZ3VsYXIuaXNEZWZpbmVkKGxhdW5jaGluZ0VsZW1lbnQpKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0cnkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxhdW5jaGluZ0VsZW1lbnQuZm9jdXMoKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0gY2F0Y2ggKGUpIHt9IC8qIElFOCB3aWxsIHRocm93IGV4Y2VwdGlvbiAqLworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgfSk7CisgICAgICAgICAgICAgICAgICAgICAgICAKKyAgICAgICAgICAgICAgICAgICAgICAgIHNjb3BlLiR3YXRjaCgic3R5bGV0dCIsIGZ1bmN0aW9uKHZhbHVlKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2NvcGUucG9wT3ZlclN0eWxlID0gdmFsdWU7CisgICAgICAgICAgICAgICAgICAgICAgICB9KTsKKworICAgICAgICAgICAgICAgICAgICAgICAgc2NvcGUuJHdhdGNoKCJwbGFjZW1lbnQiLCBmdW5jdGlvbih2YWx1ZSkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNjb3BlLnBvcE92ZXJQbGFjZW1lbnQgPSB2YWx1ZTsKKyAgICAgICAgICAgICAgICAgICAgICAgIH0pOworICAgICAgICAgICAgICAgICAgICAgICAgCisgICAgICAgICAgICAgICAgICAgICAgICBzY29wZS5jbG9zZU1lID0gZnVuY3Rpb24oKXsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgIHNjb3BlLmlzT3BlbiA9IGZhbHNlOworICAgICAgICAgICAgICAgICAgICAgICAgfTsKKyAgICAgICAgICAgICAgICAgICAgICAgIAorICAgICAgICAgICAgICAgICAgICAgICAgZWxlbS5iaW5kKCdjbGljaycsIGZ1bmN0aW9uIChlKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgZXZlbnRzLnN0b3BQcm9wYWdhdGlvbihlKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIH0pOworICAgICAgICAgICAgICAgICAgICAgICAgCisgICAgICAgICAgICAgICAgICAgICAgICAkZG9jdW1lbnRCaW5kLmV2ZW50KCdjbGljaycsICdpc09wZW4nLCBvdXRzaWRlQ2xpY2ssIHNjb3BlLCB0cnVlLCAxMCk7CisgICAgICAgICAgICAgICAgICAgICAgICAkZG9jdW1lbnRCaW5kLmV2ZW50KCdrZXlkb3duJywgJ2lzT3BlbicsIGVzY0tleWRvd24sIHNjb3BlLCB0cnVlLCAxMCk7CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICB9OworICAgICAgICAgICAgfV0pOworCithbmd1bGFyLm1vZHVsZSgnYXR0LmFicy5wcm9maWxlQ2FyZCcsIFtdKQorICAgICAgICAgICAgLmNvbnN0YW50KCdwcm9maWxlU3RhdHVzJyx7CisgICAgICAgICAgICAgICAgc3RhdHVzOnsKKyAgICAgICAgICAgICAgICAgICAgQUNUSVZFOntzdGF0dXM6IkFjdGl2ZSIsY29sb3I6ImdyZWVuIn0sCisgICAgICAgICAgICAgICAgICAgIERFQUNUSVZBVEVEOntzdGF0dXM6IkRlYWN0aXZhdGVkIixjb2xvcjoicmVkIn0sCisgICAgICAgICAgICAgICAgICAgIExPQ0tFRDp7c3RhdHVzOiJMb2NrZWQiLGNvbG9yOiJyZWQifSwKKyAgICAgICAgICAgICAgICAgICAgSURMRTp7c3RhdHVzOiJJZGxlIixjb2xvcjoieWVsbG93In0sCisgICAgICAgICAgICAgICAgICAgIFBFTkRJTkc6e3N0YXR1czoiUGVuZGluZyIsY29sb3I6ImJsdWUifQorICAgICAgICAgICAgICAgICAgICB9LAorICAgICAgICAgICAgICAgIHJvbGU6IkNPTVBBTlkgQURNSU5JU1RSQVRPUiIKKyAgICAgICAgICAgICAgICB9KQorICAgICAgICAgICAgLmRpcmVjdGl2ZSgncHJvZmlsZUNhcmQnLFsnJGh0dHAnLCckcScsJ3Byb2ZpbGVTdGF0dXMnLCBmdW5jdGlvbigkaHR0cCwkcSxwcm9maWxlU3RhdHVzKSB7CisgICAgICAgICAgICAgICByZXR1cm4geworICAgICAgICAgICAgICAgICAgICByZXN0cmljdDogJ0VBJywKKyAgICAgICAgICAgICAgICAgICAgcmVwbGFjZTondHJ1ZScsCisgICAgICAgICAgICAgICAgICAgIHRlbXBsYXRlVXJsOmZ1bmN0aW9uKGVsZW1lbnQsIGF0dHJzKXsKKyAgICAgICAgICAgICAgICAgICAgICAgIGlmKCFhdHRycy5hZGRVc2VyKXsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gJ2FwcC9zY3JpcHRzL25nX2pzX2F0dF90cGxzL3Byb2ZpbGVDYXJkL3Byb2ZpbGVDYXJkLmh0bWwnOworICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgZWxzZXsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gJ2FwcC9zY3JpcHRzL25nX2pzX2F0dF90cGxzL3Byb2ZpbGVDYXJkL2FkZFVzZXIuaHRtbCc7CisgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgIH0sCisgICAgICAgICAgICAgICAgICAgIHNjb3BlOnsKKyAgICAgICAgICAgICAgICAgICAgICAgIHByb2ZpbGU6Jz0nCisgICAgICAgICAgICAgICAgICAgIH0sCisgICAgICAgICAgICAgICAgICAgIGxpbms6IGZ1bmN0aW9uKHNjb3BlLCBlbGVtLCBhdHRyKXsKKyAgICAgICAgICAgICAgICAgICAgICAgIHNjb3BlLmltYWdlPXRydWU7CisgICAgICAgICAgICAgICAgICAgICAgICBmdW5jdGlvbiBpc0ltYWdlKHNyYykgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhciBkZWZlcnJlZCA9ICRxLmRlZmVyKCk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFyIGltYWdlID0gbmV3IEltYWdlKCk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgaW1hZ2Uub25lcnJvciA9IGZ1bmN0aW9uKCkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBkZWZlcnJlZC5yZWplY3QoZmFsc2UpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIH07CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgaW1hZ2Uub25sb2FkID0gZnVuY3Rpb24oKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRlZmVycmVkLnJlc29sdmUodHJ1ZSk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgfTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZihzcmMhPT11bmRlZmluZWQgJiYgc3JjLmxlbmd0aD4wICl7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGltYWdlLnNyYyA9IHNyYzsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB9ZWxzZXsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRlZmVycmVkLnJlamVjdChmYWxzZSk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBkZWZlcnJlZC5wcm9taXNlOworICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgaWYoIWF0dHIuYWRkVXNlcil7CisgICAgICAgICAgICAgICAgICAgICAgICBzY29wZS5pbWFnZT1mYWxzZTsKKyAgICAgICAgICAgICAgICAgICAgICAgIGlzSW1hZ2Uoc2NvcGUucHJvZmlsZS5pbWcpLnRoZW4oZnVuY3Rpb24oaW1nKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2NvcGUuaW1hZ2U9aW1nOworICAgICAgICAgICAgICAgICAgICAgICAgfSk7CisgICAgICAgICAgICAgICAgICAgICAgICB2YXIgc3BsaXROYW1lPShzY29wZS5wcm9maWxlLm5hbWUpLnNwbGl0KCcgJyk7CisgICAgICAgICAgICAgICAgICAgICAgICBzY29wZS5pbml0aWFscz0nJzsKKyAgICAgICAgICAgICAgICAgICAgICAgIGZvcih2YXIgaT0wO2k8c3BsaXROYW1lLmxlbmd0aDtpKyspeworICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNjb3BlLmluaXRpYWxzICs9IHNwbGl0TmFtZVtpXVswXTsKKyAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgIGlmKHNjb3BlLnByb2ZpbGUucm9sZS50b1VwcGVyQ2FzZSgpPT09cHJvZmlsZVN0YXR1cy5yb2xlKXsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBzY29wZS5iYWRnZT10cnVlOworICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgdmFyIHByb2ZpbGVTdGF0ZT1wcm9maWxlU3RhdHVzLnN0YXR1c1tzY29wZS5wcm9maWxlLnN0YXRlLnRvVXBwZXJDYXNlKCldOworICAgICAgICAgICAgICAgICAgICAgICAgaWYocHJvZmlsZVN0YXRlKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2NvcGUucHJvZmlsZS5zdGF0ZT1wcm9maWxlU3RhdHVzLnN0YXR1c1tzY29wZS5wcm9maWxlLnN0YXRlLnRvVXBwZXJDYXNlKCldLnN0YXR1czsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBzY29wZS5jb2xvckljb249cHJvZmlsZVN0YXR1cy5zdGF0dXNbc2NvcGUucHJvZmlsZS5zdGF0ZS50b1VwcGVyQ2FzZSgpXS5jb2xvcjsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZihzY29wZS5wcm9maWxlLnN0YXRlLnRvVXBwZXJDYXNlKCk9PT1wcm9maWxlU3RhdHVzLnN0YXR1cy5QRU5ESU5HLnN0YXR1cy50b1VwcGVyQ2FzZSgpfHxzY29wZS5wcm9maWxlLnN0YXRlLnRvVXBwZXJDYXNlKCk9PT1wcm9maWxlU3RhdHVzLnN0YXR1cy5MT0NLRUQuc3RhdHVzLnRvVXBwZXJDYXNlKCkpeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2NvcGUucHJvZmlsZS5sYXN0TG9naW49c2NvcGUucHJvZmlsZS5zdGF0ZTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICB2YXIgdG9kYXk9bmV3IERhdGUoKS5nZXRUaW1lKCk7CisgICAgICAgICAgICAgICAgICAgICAgICB2YXIgbGFzdGxvZ2luPW5ldyBEYXRlKHNjb3BlLnByb2ZpbGUubGFzdExvZ2luKS5nZXRUaW1lKCk7CisgICAgICAgICAgICAgICAgICAgICAgICB2YXIgZGlmZj0odG9kYXktbGFzdGxvZ2luKS8oMTAwMCo2MCo2MCoyNCk7CisgICAgICAgICAgICAgICAgICAgICAgICBpZihkaWZmPD0xKXsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBzY29wZS5wcm9maWxlLmxhc3RMb2dpbj0iVG9kYXkiOworICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgZWxzZSBpZihkaWZmPD0yKXsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBzY29wZS5wcm9maWxlLmxhc3RMb2dpbj0iWWVzdGVyZGF5IjsKKyAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH07CisgICAgICAgIH1dKTsKK2FuZ3VsYXIubW9kdWxlKCdhdHQuYWJzLnByb2dyZXNzQmFycycsIFtdKQorCisuZGlyZWN0aXZlKCdhdHRQcm9ncmVzc0JhcicsIFtmdW5jdGlvbigpeworICAgIHJldHVybiB7CisgICAgICAgIHJlc3RyaWN0OiAnQScsCisgICAgICAgIHJlcGxhY2U6IHRydWUsCisgICAgICAgIHRlbXBsYXRlVXJ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ZW1lbnQuYXR0cigibmctbW9kZWwiLCJyYWRpb1ZhbCIpOworICAgICAgICAgICAgcGFyZW50RGl2LmFwcGVuZChlbGVtZW50LnByb3AoJ291dGVySFRNTCcpKTsKKyAgICAgICAgICAgIHBhcmVudERpdi5hcHBlbmQoJzxkaXYgY2xhc3M9ImF0dC1yYWRpb19faW5kaWNhdG9yIj48L2Rpdj4nKTsKKyAgICAgICAgICAgIHBhcmVudERpdi5hdHRyKCJ0aXRsZSIsIGF0dHIudGl0bGUpOworCisgICAgICAgICAgICB2YXIgZWxtID0gcGFyZW50RGl2LnByb3AoJ291dGVySFRNTCcpOworICAgICAgICAgICAgZWxtID0gJGNvbXBpbGUoZWxtKShzY29wZSk7CisgICAgICAgICAgICBlbGVtZW50ID0gZWxlbWVudC5yZXBsYWNlV2l0aChlbG0pOworICAgICAgICAgICAgdmFyIHJhZGlvRWxtID0gZWxtLmZpbmQoImlucHV0Iik7CisKKyAgICAgICAgICAgIHJhZGlvRWxtLm9uKCdmb2N1cycsIGZ1bmN0aW9uKCkgeyAgICAgICAgICAgICAgICAKKyAgICAgICAgICAgICAgICBlbG0uY3NzKCJvdXRsaW5lIiwiMnB4IHNvbGlkICM1RTlFRDYiKTsKKyAgICAgICAgICAgICAgIC8vIGVsbS5jc3MoIm91dGxpbmUiLCItbW9zLWZvY3VzLXJpbmctY29sb3IgYXV0byA1cHgiKTsKKyAgICAgICAgICAgICAgICBlbG0uY3NzKCJvdXRsaW5lIiwiLXdlYmtpdC1mb2N1cy1yaW5nLWNvbG9yIGF1dG8gNXB4Iik7CisgICAgICAgICAgICAgICAKKyAgICAgICAgICAgIH0pOworICAgICAgICAgICAgcmFkaW9FbG0ub24oJ2JsdXInLCBmdW5jdGlvbigpIHsKKyAgICAgICAgICAgICAgIGVsbS5jc3MoIm91dGxpbmUiLCJub25lIik7CisgICAgICAgICAgICB9KTsKKworICAgICAgICAgICAgbmdDdHJsLiRyZW5kZXIgPSBmdW5jdGlvbiAoKSB7CisgICAgICAgICAgICAgICAgc2NvcGUucmFkaW9WYWwgPSBuZ0N0cmwuJG1vZGVsVmFsdWU7CisgICAgICAgICAgICAgICAgdmFyIHNlbGVjdGVkID0gYW5ndWxhci5lcXVhbHMobmdDdHJsLiRtb2RlbFZhbHVlLCBhdHRyLmF0dFJhZGlvKTsgICAgICAgICAgICAgICAgCisgICAgICAgICAgICAgICAgZWxtLnRvZ2dsZUNsYXNzKGF0dFJhZGlvQ29uZmlnLmFjdGl2ZUNsYXNzLCBzZWxlY3RlZCk7CisgICAgICAgICAgICB9OworCisgICAgICAgICAgICBzY29wZS51cGRhdGVNb2RlbCA9IGZ1bmN0aW9uICgpIHsKKyAgICAgICAgICAgICAgIHJhZGlvRWxtWzBdLmZvY3VzKCk7CisgICAgICAgICAgICAgICAgdmFyIGlzQWN0aXZlID0gZWxtLmhhc0NsYXNzKGF0dFJhZGlvQ29uZmlnLmFjdGl2ZUNsYXNzKTsKKworICAgICAgICAgICAgICAgIGlmICghaXNBY3RpdmUgJiYgIXNjb3BlLmRpc2FibGVkKSB7CisgICAgICAgICAgICAgICAgICAgIG5nQ3RybC4kc2V0Vmlld1ZhbHVlKGlzQWN0aXZlID8gbnVsbCA6IGF0dHIuYXR0UmFkaW8pOwkKKyAgICAgICAgICAgICAgICAgICAgbmdDdHJsLiRyZW5kZXIoKTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9OworCisgICAgICAgICAgICBhdHRyLiRvYnNlcnZlKCdkaXNhYmxlZCcsIGZ1bmN0aW9uICh2YWwpIHsKKyAgICAgICAgICAgICAgICBzY29wZS5kaXNhYmxlZCA9ICh2YWwgfHwgdmFsID09PSAiZGlzYWJsZWQiIHx8IHZhbCA9PT0gInRydWUiKTsKKyAgICAgICAgICAgICAgICBpZiAoc2NvcGUuZGlzYWJsZWQpeworICAgICAgICAgICAgICAgICAgICBlbG0uYWRkQ2xhc3MoYXR0UmFkaW9Db25maWcuZGlzYWJsZWRDbGFzcyk7CisgICAgICAgICAgICAgICAgICAgIGVsbS5hdHRyKCJ0YWJpbmRleCIsICItMSIpOworICAgICAgICAgICAgICAgIH1lbHNlIHsgCisgICAgICAgICAgICAgICAgICAgIGVsbS5yZW1vdmVDbGFzcyhhdHRSYWRpb0NvbmZpZy5kaXNhYmxlZENsYXNzKTsgCisgICAgICAgICAgICAgICAgICAgIGVsbS5hdHRyKCJ0YWJpbmRleCIsICIwIik7IAorICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0pOworICAgICAgICB9CisgICAgfTsKK31dKTsKK2FuZ3VsYXIubW9kdWxlKCdhdHQuYWJzLnNjcm9sbGJhcicsIFsnYXR0LmFicy5wb3NpdGlvbiddKQorCisuY29uc3RhbnQoJ2F0dFNjcm9sbGJhckNvbnN0YW50JywgeworICAgIGRlZmF1bHRzOiB7CisgICAgICAgIC8vIFZlcnRpY2FsIG9yIGhvcml6b250YWwgc2Nyb2xsYmFyPyAoIHggfHwgeSApLgorICAgICAgICBheGlzOiAneScsCisgICAgICAgIC8vIFdoZXRoZXIgbmF2aWdhdGlvbiBwYW5lIGlzIHJlcXVpcmVkIG9mIG5vdC4KKyAgICAgICAgbmF2aWdhdGlvbjogZmFsc2UsCisgICAgICAgIC8vIEVuYWJsZSBvciBkaXNhYmxlIHRoZSBtb3VzZXdoZWVsLgorICAgICAgICB3aGVlbDogdHJ1ZSwKKyAgICAgICAgLy8gSG93IG1hbnkgcGl4ZWxzIG11c3QgdGhlIG1vdXN3aGVlbCBzY3JvbGwgYXQgYSB0aW1lLgorICAgICAgICB3aGVlbFNwZWVkOiA0MCwKKyAgICAgICAgLy8gTG9jayBkZWZhdWx0IHNjcm9sbGluZyB3aW5kb3cgd2hlbiB0aGVyZSBpcyBubyBtb3JlIGNvbnRlbnQuCisgICAgICAgIHdoZWVsTG9jazogdHJ1ZSwKKyAgICAgICAgLy8vLyBFbmFibGUgaW52ZXJ0IHN0eWxlIHNjcm9sbGluZworICAgICAgICBzY3JvbGxJbnZlcnQ6IGZh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yQ29uc3RhbnQuZGVmYXVsdHMuYXhpcywKKyAgICAgICAgICAgICAgICBuYXZpZ2F0aW9uOiAkYXR0cnMubmF2aWdhdGlvbiB8fCBhdHRTY3JvbGxiYXJDb25zdGFudC5kZWZhdWx0cy5uYXZpZ2F0aW9uLAorICAgICAgICAgICAgICAgIHdoZWVsOiBhdHRTY3JvbGxiYXJDb25zdGFudC5kZWZhdWx0cy53aGVlbCwKKyAgICAgICAgICAgICAgICB3aGVlbFNwZWVkOiBhdHRTY3JvbGxiYXJDb25zdGFudC5kZWZhdWx0cy53aGVlbFNwZWVkLAorICAgICAgICAgICAgICAgIHdoZWVsTG9jazogYXR0U2Nyb2xsYmFyQ29uc3RhbnQuZGVmYXVsdHMud2hlZWxMb2NrLAorICAgICAgICAgICAgICAgIHNjcm9sbEludmVydDogYXR0U2Nyb2xsYmFyQ29uc3RhbnQuZGVmYXVsdHMuc2Nyb2xsSW52ZXJ0LAorICAgICAgICAgICAgICAgIHRyYWNrU2l6ZTogYXR0U2Nyb2xsYmFyQ29uc3RhbnQuZGVmYXVsdHMudHJhY2tTaXplLAorICAgICAgICAgICAgICAgIHRodW1iU2l6ZTogYXR0U2Nyb2xsYmFyQ29uc3RhbnQuZGVmYXVsdHMudGh1bWJTaXplLAorICAgICAgICAgICAgICAgIGFsd2F5c1Zpc2libGU6IGF0dFNjcm9sbGJhckNvbnN0YW50LmRlZmF1bHRzLmFsd2F5c1Zpc2libGUKKyAgICAgICAgICAgIH07CisgICAgICAgICAgICB2YXIgb3B0aW9ucyA9ICRhdHRycy5zY3JvbGxiYXI7CisgICAgICAgICAgICBpZiAob3B0aW9ucykgeworICAgICAgICAgICAgICAgIG9wdGlvbnMgPSAkcGFyc2Uob3B0aW9ucykoJHNjb3BlKTsKKyAgICAgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICAgICAgb3B0aW9ucyA9IHt9OworICAgICAgICAgICAgfQorICAgICAgICAgICAgdGhpcy5vcHRpb25zID0gYW5ndWxhci5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m9ud2hlZWwiIGluIGRvY3VtZW50ID8gIndoZWVsIiA6CisgICAgICAgICAgICAgICAgICAgIC8vIFdlYmtpdCBhbmQgSUUgc3VwcG9ydCBhdCBsZWFzdCAibW91c2V3aGVlbCIKKyAgICAgICAgICAgICAgICAgICAgZG9jdW1lbnQub25tb3VzZXdoZWVsICE9PSB1bmRlZmluZWQgPyAibW91c2V3aGVlbCIgOgorICAgICAgICAgICAgICAgICAgICAvLyBsZXQncyBhc3N1bWUgdGhhdCByZW1haW5pbmcgYnJvd3NlcnMgYXJlIG9sZGVyIEZpcmVmb3gKKyAgICAgICAgICAgICAgICAgICAgIkRPTU1vdXNlU2Nyb2xsIiksCisgICAgICAgICAgICAgICAgc2l6ZUxhYmVsID0gaXNIb3Jpem9udGFsID8gJ3dpZHRoJyA6ICdoZWlnaHQnLAorICAgICAgICAgICAgICAgIHNpemVMYWJlbENhcCA9IHNpemVMYWJlbC5jaGFyQXQoMCkudG9VcHBlckNhc2UoKSArIHNpemVMYWJlbC5zbGljZSgxKS50b0xvd2VyQ2FzZSgpLAorICAgICAgICAgICAgICAgIHBvc2lMYWJlbCA9IGlzSG9yaXpvbnRhbCA/ICdsZWZ0JyA6ICd0b3AnLAorICAgICAgICAgICAgICAgIC8vIG1vdmVFdmVudCA9IGRvY3VtZW50LmNyZWF0ZUV2ZW50KCdIVE1MRXZlbnRzJyksCisgICAgICAgICAgICAgICAgcmVzdG9yZVZpc2liaWxpdHlBZnRlcldoZWVsLAorICAgICAgICAgICAgICAgIHRodW1ic2Nyb2xsdG91Y2ggPSBmYWxzZSwKKyAgICAgICAgICAgICAgICBkb2N1bW5ldHNjcm9sbHRvdWNoID0gZmFsc2U7CisgICAgICAgICAgICBpZiAoKCdvbnRvdWNoc3RhcnQnIGluIHdpbmRvdykgfHwgd2luZG93LkRvY3VtZW50VG91Y2ggJiYgZG9jdW1lbnQgaW5zdGFuY2VvZiBEb2N1bWVudFRvdWNoKSB7CisgICAgICAgICAgICAgICAgaGFzVG91Y2hFdmVudHMgPSB0cnVlOworICAgICAgICAgICAgfQorCisgICAgICAgICAgICAvL21vdmVFdmVudC5pbml0RXZlbnQoJ21vdmUnLCB0cnVlLCB0cnVlKTsKKyAgICAgICAgICAgIHRoaXMuY29udGVudFBvc2l0aW9uID0gMDsKKyAgICAgICAgICAgIHRoaXMudmlld3BvcnRTaXplID0gMDsKKyAgICAgICAgICAgIHRoaXMuY29udGVudFNpemUgPSAwOworICAgICAgICAgICAgdGhpcy5jb250ZW50UmF0aW8gPSAwOworICAgICAgICAgICAgdGhpcy50cmFja1NpemUgPSAwOworICAgICAgICAgICAgdGhpcy50cmFja1JhdGlvID0gMDsKKyAgICAgICAgICAgIHRoaXMudGh1bWJTaXplID0gMDsKKyAgICAgICAgICAgIHRoaXMudGh1bWJQb3NpdGlvbiA9IDA7CisKKyAgICAgICAgICAgIHRoaXMuaW5pdGlhbGl6ZSA9IGZ1bmN0aW9uICgpIHsKKyAgICAgICAgICAgICAgICBpZiAoIXRoaXMub3B0aW9ucy5hbHdheXNWaXNpYmxlKSB7CisgICAgICAgICAgICAgICAgICAgICRzY3JvbGxiYXIuY3NzKCdvcGFjaXR5JywgMCk7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIHNlbGYudXBkYXRlKCk7CisgICAgICAgICAgICAgICAgc2V0RXZlbnRzKCk7CisgICAgICAgICAgICAgICAgcmV0dXJuIHNlbGY7CisgICAgICAgICAgICB9OworCisgICAgICAgICAgICB0aGlzLnNldFNpemVEYXRhID0gZnVuY3Rpb24gKCkgeworICAgICAgICAgICAgICAgIHRoaXMudmlld3BvcnRTaXplID0gJHZpZXdwb3J0LnByb3AoJ29mZnNldCcgKyBzaXplTGFiZWxDYXApIHx8IDE7CisgICAgICAgICAgICAgICAgdGhpcy5jb250ZW50U2l6ZSA9ICRvdmVydmlldy5wcm9wKCdzY3JvbGwnICsgc2l6ZUxhYmVsQ2FwKSB8fCAxOworICAgICAgICAgICAgICAgIHRoaXMuY29udGVudFJhdGlvID0gdGhpcy52aWV3cG9ydFNpemUgLyB0aGlzLmNvbnRlbnRTaXplOworICAgICAgICAgICAgICAgIHRoaXMudHJhY2tTaXplID0gdGhpcy5vcHRpb25zLnRyYWNrU2l6ZSB8fCB0aGlzLnZpZXdwb3J0U2l6ZTsKKyAgICAgICAgICAgICAgICB0aGlzLnRodW1iU2l6ZSA9IE1hdGgubWluKHRoaXMudHJhY2tTaXplLCBNYXRoLm1heCgwLCAodGhpcy5vcHRpb25zLnRodW1iU2l6ZSB8fCAodGhpcy50cmFja1NpemUgKiB0aGlzLmNvbnRlbnRSYXRpbykpKSk7CisgICAgICAgICAgICAgICAgdGhpcy50cmFja1JhdGlvID0gdGhpcy5vcHRpb25zLnRodW1iU2l6ZSA/ICh0aGlzLmNvbnRlbnRTaXplIC0gdGhpcy52aWV3cG9ydFNpemUpIC8gKHRoaXMudHJhY2tTaXplIC0gdGhpcy50aHVtYlNpemUpIDogKHRoaXMuY29udGVudFNpemUgLyB0aGlzLnRyYWNrU2l6ZSk7CisgICAgICAgICAgICB9OworCisgICAgICAgICAgICB0aGlzLnVwZGF0ZSA9IGZ1bmN0aW9uIChzY3JvbGxUbykgeworICAgICAgICAgICAgICAgIHNlbGYuc2V0U2l6ZURhdGEoKTsKKyAgICAgICAgICAgICAgICBtb3VzZVBvc2l0aW9uID0gJHNjcm9sbGJhci5wcm9wKCdvZmZzZXRUb3AnKTsKKworICAgICAgICAgICAgICAgICRzY3JvbGxiYXIudG9nZ2xlQ2xhc3MoJ2Rpc2FibGUnLCB0aGlzLmNvbnRlbnRSYXRpbyA+PSAxIHx8IGlzTmFOKHRoaXMuY29udGVudFJhdGlvKSk7CisKKyAgICAgICAgICAgICAgICBpZiAoIXRoaXMub3B0aW9ucy5hbHdheXNWaXNpYmxlICYmIHRoaXMuY29udGVudFJhdGlvIDwgMSAmJiB0aGlzLnZpZXdwb3J0U2l6ZSA+IDApIHsKKyAgICAgICAgICAgICAgICAgICAgLy9mbGFzaCB0aGUgc2Nyb2xsYmFyIHdoZW4gdXBkYXRlIGhhcHBlbnMKKyAgICAgICAgICAgICAgICAgICAgJGFuaW1hdGUuYWRkQ2xhc3MoJHNjcm9sbGJhciwgJ3Zpc2libGUnKS50aGVuKGZ1bmN0aW9uICgpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICRhbmltYXRlLnJlbW92ZUNsYXNzKCRzY3JvbGxiYXIsICd2aXNpYmxlJyk7CisgICAgICAgICAgICAgICAgICAgICAgICAkc2NvcGUuJGRpZ2VzdCgpOworICAgICAgICAgICAgICAgICAgICB9KTsKKyAgICAgICAgICAgICAgICB9CisKKyAgICAgICAgICAgICAgICBpZiAoc2Nyb2xsVG8gIT09IG51bGwpIHsKKyAgICAgICAgICAgICAgICAgICAgaWYgKHNjcm9sbFRvID09PSAnYm90dG9tJykgeworICAgICAgICAgICAgICAgICAgICAgICAgdGhpcy5jb250ZW50UG9zaXRpb24gPSB0aGlzLmNvbnRlbnRTaXplIC0gdGhpcy52aWV3cG9ydFNpemU7CisgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICAgICAgICAgICAgICB0aGlzLmNvbnRlbnRQb3NpdGlvbiA9IHBhcnNlSW50KHNjcm9sbFRvLCAxMCkgfHwgMDsKKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIH0KKworICAgICAgICAgICAgICAgIGVuc3VyZUNvbnRlbnRQb3NpdGlvbigpOworICAgICAgICAgICAgICAgICR0aHVtYi5jc3MocG9zaUxhYmVsLCBzZWxmLmNvbnRlbnRQb3NpdGlvbiAvIHNlbGYudHJhY2tSYXRpbyArICdweCcpOworICAgICAgICAgICAgICAgICRzY3JvbGxiYXIuY3NzKHNpemVMYWJlbCwgc2VsZi50cmFja1NpemUgKyAncHgnKTsKKyAgICAgICAgICAgICAgICAkdGh1bWIuY3NzKHNpemVMYWJlbCwgc2VsZi50aHVtYlNpemUgKyAncHgnKTsKKyAgICAgICAgICAgICAgICAkb3ZlcnZpZXcuY3NzKHBvc2lMYWJlbCwgLXNlbGYuY29udGVudFBvc2l0aW9uICsgJ3B4Jyk7CisKKyAgICAgICAgICAgICAgICByZXR1cm4gdGhpczsKKyAgICAgICAgICAgIH07CisKKyAgICAgICAgICAgIGZpcmVFdmVudCA9IGZ1bmN0aW9uIChvYmosIGV2dCkgeworICAgICAgICAgICAgICAgIHZhciBmaXJlT25UaGlzID0gb2JqOworICAgICAgICAgICAgICAgIHZhciBldnRPYmo7CisgICAgICAgICAgICAgICAgaWYgKGRvY3VtZW50LmNyZWF0ZUV2ZW50KSB7CisgICAgICAgICAgICAgICAgICAgIC8vIGFsZXJ0KCJGRiIpOworICAgICAgICAgICAgICAgICAgICBldnRPYmogPSBkb2N1bWVudC5jcmVhdGVFdmVudCgnSFRNTEV2ZW50cycpOworICAgICAgICAgICAgICAgICAgICBldnRPYmouaW5pdEV2ZW50KGV2dCwgdHJ1ZSwgZmFsc2UpOworICAgICAgICAgICAgICAgICAgICBmaXJlT25UaGlzLmRpc3BhdGNoRXZlbnQoZXZ0T2JqKTsKKyAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKGRvY3VtZW50LmNyZWF0ZUV2ZW50T2JqZWN0KSB7CisgICAgICAgICAgICAgICAgICAgIC8vIGFsZXJ0KCJJRTgiKTsKKyAgICAgICAgICAgICAgICAgICAgZXZ0T2JqID0gZG9jdW1lbnQuY3JlYXRlRXZlbnRPYmplY3QoKTsKKyAgICAgICAgICAgICAgICAgICAgZmlyZU9uVGhpcy5maXJlRXZlbnQoJ29uJyArIGV2dCwgZXZ0T2JqKTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9OworCisgICAgICAgICAgICBmdW5jdGlvbiBlbnN1cmVDb250ZW50UG9zaXRpb24oKSB7CisgICAgICAgICAgICAgICAgLy8gaWYgc2Nyb2xsYmFyIGlzIG9uLCBlbnN1cmUgdGhlIGJvdHRvbSBvZiB0aGUgY29udGVudCBkb2VzIG5vdCBnbyBhYm92ZSB0aGUgYm90dG9tIG9mIHRoZSB2aWV3cG9ydAorICAgICAgICAgICAgICAgIGlmIChzZWxmLmNvbnRlbnRSYXRpbyA8PSAxICYmIHNlbGYuY29udGVudFBvc2l0aW9uID4gc2VsZi5jb250ZW50U2l6ZSAtIHNlbGYudmlld3BvcnRTaXplKSB7CisgICAgICAgICAgICAgICAgICAgIHNlbGYuY29udGVudFBvc2l0aW9uID0gc2VsZi5jb250ZW50U2l6ZSAtIHNlbGYudmlld3BvcnRTaXplOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAvLyBpZiBzY3JvbGxiYXIgaXMgb2ZmLCBlbnN1cmUgdGhlIHRvcCBvZiB0aGUgY29udGVudCBkb2VzIG5vdCBnbyBiZWxvdyB0aGUgdG9wIG9mIHRoZSB2aWV3cG9ydAorICAgICAgICAgICAgICAgIGVsc2UgaWYgKHNlbGYuY29udGVudFJhdGlvID4gMSAmJiBzZWxmLmNvbnRlbnRQb3NpdGlvbiA+IDApIHsKKyAgICAgICAgICAgICAgICAgICAgc2VsZi5jb250ZW50UG9zaXRpb24gPSAwOworICAgICAgICAgICAgICAgIH0KKworICAgICAgICAgICAgICAgIGlmIChzZWxmLmNvbnRlbnRQb3NpdGlvbiA8PSAwKSB7CisgICAgICAgICAgICAgICAgICAgICRzY29wZS5wcmV2QXZhaWxhYmxlID0gZmFsc2U7CisgICAgICAgICAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgICAgICAgICAgJHNjb3BlLnByZXZBdmFpbGFibGUgPSB0cnVlOworICAgICAgICAgICAgICAgIH0KKworICAgICAgICAgICAgICAgIGlmIChzZWxmLmNvbnRlbnRQb3NpdGlvbiA+PSAoc2VsZi5jb250ZW50U2l6ZSAtIHNlbGYudmlld3BvcnRTaXplKSkgeworICAgICAgICAgICAgICAgICAgICAkc2NvcGUubmV4dEF2YWlsYWJsZSA9IGZhbHNlOworICAgICAgICAgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICAgICAgICAgICRzY29wZS5uZXh0QXZhaWxhYmxlID0gdHJ1ZTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9CisKKyAgICAgICAgICAgIGZ1bmN0aW9uIHNldEV2ZW50cygpIHsKKyAgICAgICAgICAgICAgICBpZiAoaGFzVG91Y2hFdmVudHMpIHsKKyAgICAgICAgICAgICAgICAgICAgJHZpZXdwb3J0Lm9uKCd0b3VjaHN0YXJ0JywgdG91Y2hzdGFydCk7CisgICAgICAgICAgICAgICAgICAgICR0aHVtYi5vbigndG91Y2hzdGFydCcsIHRvdWNoc3RhcnQpOworICAgICAgICAgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICAgICAgICAgICR0aHVtYi5vbignbW91c2Vkb3duJywgc3RhcnQpOworICAgICAgICAgICAgICAgICAgICAkc2Nyb2xsYmFyLm9uKCdtb3VzZWRvd24nLCBkcmFnKTsKKyAgICAgICAgICAgICAgICB9CisKKyAgICAgICAgICAgICAgICBhbmd1bGFyLmVsZW1lbnQoJHdpbmRvdykub24oJ3Jlc2l6ZScsIHJlc2l6ZSk7CisKKyAgICAgICAgICAgICAgICBpZiAoc2VsZi5vcHRpb25zLndoZWVsKSB7CisgICAgICAgICAgICAgICAgICAgICRlbGVtZW50Lm9uKHdoZWVsRXZlbnQsIHdoZWVsKTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9CisKKyAgICAgICAgICAgIGZ1bmN0aW9uIHJlc2l6ZSgpIHsKKyAgICAgICAgICAgICAgICBzZWxmLnVwZGF0ZSgpOworICAgICAgICAgICAgfQorCisgICAgICAgICAgICBmdW5jdGlvbiB0b3VjaHN0YXJ0KGV2ZW50KSB7CisgICAgICAgICAgICAgICAgaWYgKDEgPT09IGV2ZW50LnRvdWNoZXMubGVuZ3RoKSB7CisgICAgICAgICAgICAgICAgICAgIGV2ZW50LnN0b3BQcm9wYWdhdGlvbigpOworICAgICAgICAgICAgICAgICAgICBzdGFydChldmVudC50b3VjaGVzWzBdKTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9CisKKyAgICAgICAgICAgIGZ1bmN0aW9uIHN0YXJ0KGV2ZW50KSB7CisgICAgICAgICAgICAgICAgJGJvZHkuYWRkQ2xhc3MoJ3Njcm9sbC1uby1zZWxlY3QnKTsKKyAgICAgICAgICAgICAgICAkZWxlbWVudC5hZGRDbGFzcygnc2Nyb2xsLW5vLXNlbGVjdCcpOworCisgICAgICAgICAgICAgICAgaWYgKCFzZWxmLm9wdGlvbnMuYWx3YXlzVmlzaWJsZSkgeworICAgICAgICAgICAgICAgICAgICAkc2Nyb2xsYmFyLmFkZENsYXNzKCd2aXNpYmxlJyk7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIG1vdXNlUG9zaXRpb24gPSBpc0hvcml6b250YWwgPyBldmVudC5jbGllbnRYIDogZXZlbnQuY2xpZW50WTsKKyAgICAgICAgICAgICAgICBzZWxmLnRodW1iUG9zaXRpb24gPSBwYXJzZUludCgkdGh1bWIuY3NzKHBvc2lMYWJlbCksIDEwKSB8fCAwOworCisgICAgICAgICAgICAgICAgaWYgKGhhc1RvdWNoRXZlbnRzKSB7CisgICAgICAgICAgICAgICAgICAgIGRvY3VtbmV0c2Nyb2xsdG91Y2ggPSBmYWxzZTsKKyAgICAgICAgICAgICAgICAgICAgdGh1bWJzY3JvbGx0b3VjaCA9IGZhbHNlOworICAgICAgICAgICAgICAgICAgICAkdmlld3BvcnQub24oJ3RvdWNobW92ZScsIHRvdWNoZHJhZyk7CisgICAgICAgICAgICAgICAgICAgICR2aWV3cG9ydC5vbigndG91Y2hlbmQnLCBlbmQpOworICAgICAgICAgICAgICAgICAgICAkdGh1bWIub24oJ3RvdWNobW92ZScsIHRvdWNoZHJhZ3RodW1iKTsKKyAgICAgICAgICAgICAgICAgICAgJHRodW1iLm9uKCd0b3VjaGVuZCcsIGVuZCk7CisgICAgICAgICAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgICAgICAgICAgJGRvY3VtZW50Lm9uKCdtb3VzZW1vdmUnLCBkcmFnKTsKKyAgICAgICAgICAgICAgICAgICAgJGRvY3VtZW50Lm9uKCdtb3VzZXVwJywgZW5kKTsKKyAgICAgICAgICAgICAgICAgICAgJHRodW1iLm9uKCdtb3VzZXVwJywgZW5kKTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9CisKKyAgICAgICAgICAgIGZ1bmN0aW9uIHdoZWVsKGV2ZW50KSB7CisgICAgICAgICAgICAgICAgaWYgKHNlbGYuY29udGVudFJhdGlvID49IDEpIHsKKyAgICAgICAgICAgICAgICAgICAgcmV0dXJuOworICAgICAgICAgICAgICAgIH0KKworICAgICAgICAgICAgICAgIGlmICghc2VsZi5vcHRpb25zLmFsd2F5c1Zpc2libGUpIHsKKyAgICAgICAgICAgICAgICAgICAgLy9jYW5jZWwgcmVtb3ZpbmcgdmlzaWJpbGl0eSBpZiB3aGVlbCBldmVudCBpcyB0cmlnZ2VyZWQgYmVmb3JlIHRoZSB0aW1lb3V0CisgICAgICAgICAgICAgICAgICAgIGlmIChyZXN0b3JlVmlzaWJpbGl0eUFmdGVyV2hlZWwpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICR0aW1lb3V0LmNhbmNlbChyZXN0b3JlVmlzaWJpbGl0eUFmdGVyV2hlZWwpOworICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICRzY3JvbGxiYXIuYWRkQ2xhc3MoJ3Zpc2libGUnKTsKKworICAgICAgICAgICAgICAgICAgICByZXN0b3JlVmlzaWJpbGl0eUFmdGVyV2hlZWwgPSAkdGltZW91dChmdW5jdGlvbiAoKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAkc2Nyb2xsYmFyLnJlbW92ZUNsYXNzKCd2aXNpYmxlJyk7CisgICAgICAgICAgICAgICAgICAgIH0sIDEwMCk7CisgICAgICAgICAgICAgICAgfQorCisgICAgICAgICAgICAgICAgdmFyIGV2bnRPYmogPSAoZXZlbnQgJiYgZXZlbnQub3JpZ2luYWxFdmVudCkgfHwgZXZlbnQgfHwgJHdpbmRvdy5ldmVudCwKKyAgICAgICAgICAgICAgICAgICAgZGVsdGFEaXIgPSBzZWxmLm9wdGlvbnMuYXhpcy50b1VwcGVyQ2FzZSgpLAorICAgICAgICAgICAgICAgICAgICBkZWx0YSA9IHsKKyAgICAgICAgICAgICAgICAgICAgICAgIFg6IGV2bnRPYmouZGVsdGFYIHx8IDAsCisgICAgICAgICAgICAgICAgICAgICAgICBZOiBldm50T2JqLmRlbHRhWSB8fCAwCisgICAgICAgICAgICAgICAgICAgIH0sCisgICAgICAgICAgICAgICAgICAgIHdoZWVsU3BlZWQgPSBldm50T2JqLmRlbHRhTW9kZSA9PT0gMCA/IHNlbGYub3B0aW9ucy53aGVlbFNwZWVkIDogMTsKKworICAgICAgICAgICAgICAgIGlmIChzZWxmLm9wdGlvbnMuc2Nyb2xsSW52ZXJ0KSB7CisgICAgICAgICAgICAgICAgICAgIHdoZWVsU3BlZWQgKj0gLTE7CisgICAgICAgICAgICAgICAgfQorCisgICAgICAgICAgICAgICAgaWYgKHdoZWVsRXZlbnQgPT09ICdtb3VzZXdoZWVsJykgeworICAgICAgICAgICAgICAgICAgICBkZWx0YS5ZID0gLTEgKiBldm50T2JqLndoZWVsRGVsdGEgLyA0MDsKKyAgICAgICAgICAgICAgICAgICAgaWYgKGV2bnRPYmoud2hlZWxEZWx0YVgpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIGRlbHRhLlggPSAtMSAqIGV2bnRPYmoud2hlZWxEZWx0YVggLyA0MDsKKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICBkZWx0YS5YICo9IC0xIC8gd2hlZWxTcGVlZDsKKyAgICAgICAgICAgICAgICBkZWx0YS5ZICo9IC0xIC8gd2hlZWxTcGVlZDsKKworICAgICAgICAgICAgICAgIHZhciB3aGVlbFNwZWVkRGVsdGEgPSBkZWx0YVtkZWx0YURpcl07CisKKyAgICAgICAgICAgICAgICBzZWxmLmNvbnRlbnRQb3NpdGlvbiAtPSB3aGVlbFNwZWVkRGVsdGEgKiBzZWxmLm9wdGlvbnMud2hlZWxTcGVlZDsKKyAgICAgICAgICAgICAgICBzZWxmLmNvbnRlbnRQb3NpdGlvbiA9IE1hdGgubWluKChzZWxmLmNvbnRlbnRTaXplIC0gc2VsZi52aWV3cG9ydFNpemUpLCBNYXRoLm1heCgwLCBzZWxmLmNvbnRlbnRQb3NpdGlvbikpOworCisgICAgICAgICAgICAgICAgZmlyZUV2ZW50KCRlbGVtZW50WzBdLCAnbW92ZScpOworCisgICAgICAgICAgICAgICAgZW5zdXJlQ29udGVudFBvc2l0aW9uKCk7CisgICAgICAgICAgICAgICAgJHRodW1iLmNzcyhwb3NpTGFiZWwsIHNlbGYuY29udGVudFBvc2l0aW9uIC8gc2VsZi50cmFja1JhdGlvICsgJ3B4Jyk7CisgICAgICAgICAgICAgICAgJG92ZXJ2aWV3LmNzcyhwb3NpTGFiZWwsIC1zZWxmLmNvbnRlbnRQb3NpdGlvbiArICdweCcpOworCisgICAgICAgICAgICAgICAgaWYgKHNlbGYub3B0aW9ucy53aGVlbExvY2sgfHwgKHNlbGYuY29udGVudFBvc2l0aW9uICE9PSAoc2VsZi5jb250ZW50U2l6ZSAtIHNlbGYudmlld3BvcnRTaXplKSAmJiBzZWxmLmNvbnRlbnRQb3NpdGlvbiAhPT0gMCkpIHsKKyAgICAgICAgICAgICAgICAgICAgZXZudE9iai5wcmV2ZW50RGVmYXVsdCgpOworICAgICAgICAgICAgICAgIH0KKworICAgICAgICAgICAgICAgICRzY29wZS4kYXBwbHkoKTsKKyAgICAgICAgICAgIH0KKworICAgICAgICAgICAgZnVuY3Rpb24gdG91Y2hkcmFnKGV2ZW50KSB7CisgICAgICAgICAgICAgICAgZXZlbnQucHJldmVudERlZmF1bHQoKTsKKyAgICAgICAgICAgICAgICBkb2N1bW5ldHNjcm9sbHRvdWNoID0gdHJ1ZTsKKyAgICAgICAgICAgICAgICBkcmFnKGV2ZW50LnRvdWNoZXNbMF0pOworICAgICAgICAgICAgfQorCisgICAgICAgICAgICBmdW5jdGlvbiB0b3VjaGRyYWd0aHVtYihldmVudCkgeworICAgICAgICAgICAgICAgIGV2ZW50LnByZXZlbnREZWZhdWx0KCk7CisgICAgICAgICAgICAgICAgdGh1bWJzY3JvbGx0b3VjaCA9IHRydWU7CisgICAgICAgICAgICAgICAgZHJhZyhldmVudC50b3VjaGVzWzBdKTsKKyAgICAgICAgICAgIH0KKworICAgICAgICAgICAgZnVuY3Rpb24gZHJhZyhldmVudCkgeworICAgICAgICAgICAgICAgIGlmIChzZWxmLmNvbnRlbnRSYXRpbyA+PSAxKSB7CisgICAgICAgICAgICAgICAgICAgIHJldHVybjsKKyAgICAgICAgICAgICAgICB9CisKKyAgICAgICAgICAgICAgICB2YXIgbW91c2VQb3NpdGlvbk5ldyA9IGlzSG9yaXpvbnRhbCA/IGV2ZW50LmNsaWVudFggOiBldmVudC5jbGllbnRZLAorICAgICAgICAgICAgICAgICAgICB0aHVtYlBvc2l0aW9uRGVsdGEgPSBtb3VzZVBvc2l0aW9uTmV3IC0gbW91c2VQb3NpdGlvbjsKKworICAgICAgICAgICAgICAgIGlmICgoc2VsZi5vcHRpb25zLnNjcm9sbEludmVydCAmJiAhaGFzVG91Y2hFdmVudHMpIHx8CisgICAgICAgICAgICAgICAgICAgIChoYXNUb3VjaEV2ZW50cyAmJiAhc2VsZi5vcHRpb25zLnNjcm9sbEludmVydCkpIHsKKyAgICAgICAgICAgICAgICAgICAgdGh1bWJQb3NpdGlvbkRlbHRhID0gbW91c2VQb3NpdGlvbiAtIG1vdXNlUG9zaXRpb25OZXc7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIGlmIChkb2N1bW5ldHNjcm9sbHRvdWNoICYmIGhhc1RvdWNoRXZlbnRzKSB7CisgICAgICAgICAgICAgICAgICAgIHRodW1iUG9zaXRpb25EZWx0YSA9IG1vdXNlUG9zaXRpb24gLSBtb3VzZVBvc2l0aW9uTmV3OworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICBpZiAodGh1bWJzY3JvbGx0b3VjaCAmJiBoYXNUb3VjaEV2ZW50cykgeworICAgICAgICAgICAgICAgICAgICB0aHVtYlBvc2l0aW9uRGVsdGEgPSBtb3VzZVBvc2l0aW9uTmV3IC0gbW91c2VQb3NpdGlvbjsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgdmFyIHRodW1iUG9zaXRpb25OZXcgPSBNYXRoLm1pbigoc2VsZi50cmFja1NpemUgLSBzZWxmLnRodW1iU2l6ZSksIE1hdGgubWF4KDAsIHNlbGYudGh1bWJQb3NpdGlvbiArIHRodW1iUG9zaXRpb25EZWx0YSkpOworICAgICAgICAgICAgICAgIHNlbGYuY29udGVudFBvc2l0aW9uID0gdGh1bWJQb3NpdGlvbk5ldyAqIHNlbGYudHJhY2tSYXRpbzsKKworICAgICAgICAgICAgICAgIGZpcmVFdmVudCgkZWxlbWVudFswXSwgJ21vdmUnKTsKKworICAgICAgICAgICAgICAgIGVuc3VyZUNvbnRlbnRQb3NpdGlvbigpOworICAgICAgICAgICAgICAgICR0aHVtYi5jc3MocG9zaUxhYmVsLCB0aHVtYlBvc2l0aW9uTmV3ICsgJ3B4Jyk7CisgICAgICAgICAgICAgICAgJG92ZXJ2aWV3LmNzcyhwb3NpTGFiZWwsIC1zZWxmLmNvbnRlbnRQb3NpdGlvbiArICdweCcpOworCisgICAgICAgICAgICAgICAgJHNjb3BlLiRhcHBseSgpOworICAgICAgICAgICAgfQorCisgICAgICAgICAgICAkc2NvcGUuY3VzdG9tU2Nyb2xsID0gZnVuY3Rpb24gKGRpcmVjdGlvbikgeworICAgICAgICAgICAgICAgIGlmIChzZWxmLmNvbnRlbnRSYXRpbyA+PSAxKSB7CisgICAgICAgICAgICAgICAgICAgIHJldHVybjsKKyAgICAgICAgICAgICAgICB9CisKKyAgICAgICAgICAgICAgICB2YXIgY3VzdG9tU2Nyb2xsRGVsdGE7CisgICAgICAgICAgICAgICAgdmFyIHZpZXdwb3J0RGltZW5zaW9uID0gJHBvc2l0aW9uLnBvc2l0aW9uKCR2aWV3cG9ydCk7CisKKyAgICAgICAgICAgICAgICBpZiAoaXNIb3Jpem9udGFsKSB7CisgICAgICAgICAgICAgICAgICAgIGN1c3RvbVNjcm9sbERlbHRhID0gdmlld3BvcnREaW1lbnNpb24ud2lkdGg7CisgICAgICAgICAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgICAgICAgICAgY3VzdG9tU2Nyb2xsRGVsdGEgPSB2aWV3cG9ydERpbWVuc2lvbi5oZWlnaHQ7CisgICAgICAgICAgICAgICAgfQorCisgICAgICAgICAgICAgICAgaWYgKGRpcmVjdGlvbikgeworICAgICAgICAgICAgICAgICAgICBzZWxmLmNvbnRlbnRQb3NpdGlvbiArPSBjdXN0b21TY3JvbGxEZWx0YTsKKyAgICAgICAgICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgICAgICAgICBzZWxmLmNvbnRlbnRQb3NpdGlvbiAtPSBjdXN0b21TY3JvbGxEZWx0YTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgc2VsZi5jb250ZW50UG9zaXRpb24gPSBNYXRoLm1pbigoc2VsZi5jb250ZW50U2l6ZSAtIHNlbGYudmlld3BvcnRTaXplKSwgTWF0aC5tYXgoMCwgc2VsZi5jb250ZW50UG9zaXRpb24pKTsKKworICAgICAgICAgICAgICAgIGZpcmVFdmVudCgkZWxlbWVudFswXSwgJ21vdmUnKTsKKworICAgICAgICAgICAgICAgIGVuc3VyZUNvbnRlbnRQb3NpdGlvbigpOworICAgICAgICAgICAgICAgICR0aHVtYi5jc3MocG9zaUxhYmVsLCBzZWxmLmNvbnRlbnRQb3NpdGlvbiAvIHNlbGYudHJhY2tSYXRpbyArICdweCcpOworICAgICAgICAgICAgICAgICRvdmVydmlldy5jc3MocG9zaUxhYmVsLCAtc2VsZi5jb250ZW50UG9zaXRpb24gKyAncHgnKTsKKyAgICAgICAgICAgIH07CisKKyAgICAgICAgICAgIGZ1bmN0aW9uIGVuZCgpIHsKKyAgICAgICAgICAgICAgICAkYm9keS5yZW1vdmVDbGFzcygnc2Nyb2xsLW5vLXNlbGVjdCcpOworICAgICAgICAgICAgICAgICRlbGVtZW50LnJlbW92ZUNsYXNzKCdzY3JvbGwtbm8tc2VsZWN0Jyk7CisgICAgICAgICAgICAgICAgaWYgKCFzZWxmLm9wdGlvbnMuYWx3YXlzVmlzaWJsZSkgeworICAgICAgICAgICAgICAgICAgICAkc2Nyb2xsYmFyLnJlbW92ZUNsYXNzKCd2aXNpYmxlJyk7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICRkb2N1bWVudC5vZmYoJ21vdXNlbW92ZScsIGRyYWcpOworICAgICAgICAgICAgICAgICRkb2N1bWVudC5vZmYoJ21vdXNldXAnLCBlbmQpOworICAgICAgICAgICAgICAgICR0aHVtYi5vZmYoJ21vdXNldXAnLCBlbmQpOworICAgICAgICAgICAgICAgICRkb2N1bWVudC5vZmYoJ3RvdWNobW92ZScsIHRvdWNoZHJhZyk7CisgICAgICAgICAgICAgICAgJGRvY3VtZW50Lm9mZignb250b3VjaGVuZCcsIGVuZCk7CisgICAgICAgICAgICAgICAgJHRodW1iLm9mZigndG91Y2htb3ZlJywgdG91Y2hkcmFndGh1bWIpOworICAgICAgICAgICAgICAgICR0aHVtYi5vZmYoJ3RvdWNoZW5kJywgZW5kKTsKKyAgICAgICAgICAgIH0KKworICAgICAgICAgICAgdGhpcy5jbGVhbnVwID0gZnVuY3Rpb24gKCkgeworICAgICAgICAgICAgICAgICR2aWV3cG9ydC5vZmYoJ3RvdWNoc3RhcnQnLCB0b3VjaHN0YXJ0KTsKKyAgICAgICAgICAgICAgICAkdGh1bWIub2ZmKCdtb3VzZWRvd24nLCBzdGFydCk7CisgICAgICAgICAgICAgICAgJHNjcm9sbGJhci5vZmYoJ21vdXNlZG93bicsIGRyYWcpOworICAgICAgICAgICAgICAgICR0aHVtYi5vZmYoJ3RvdWNobW92ZScsIHRvdWNoZHJhZ3RodW1iKTsKKyAgICAgICAgICAgICAgICAkdGh1bWIub2ZmKCd0b3VjaGVuZCcsIGVuZCk7CisgICAgICAgICAgICAgICAgYW5ndWxhci5lbGVtZW50KCR3aW5kb3cpLm9mZigncmVzaXplJywgcmVzaXplKTsKKyAgICAgICAgICAgICAgICAkZWxlbWVudC5vZmYod2hlZWxFdmVudCwgd2hlZWwpOworICAgICAgICAgICAgICAgIC8vZW5zdXJlIHNjcm9sbGJhciBpc24ndCBhY3RpdmF0ZWQKKyAgICAgICAgICAgICAgICBzZWxmLm9wdGlvbnMuYWx3YXlzVmlzaWJsZSA9IHRydWU7CisgICAgICAgICAgICAgICAgZW5kKCk7CisgICAgICAgICAgICB9OworICAgICAgICB9XSwKKyAgICAgICAgbGluazogZnVuY3Rpb24gKHNjb3BlLCBpRWxlbWVudCwgaUF0dHJzLCBjb250cm9sbGVyKSB7CisgICAgICAgICAgICBzY29wZS5uYXZpZ2F0aW9uID0gY29udHJvbGxlci5vcHRpb25zLm5hdmlnYXRpb247CisgICAgICAgICAgICBzY29wZS52aWV3cG9ydEhlaWdodCA9IGlBdHRycy52aWV3cG9ydEhlaWdodDsKKyAgICAgICAgICAgIHNjb3BlLnZpZXdwb3J0V2lkdGggPSBpQXR0cnMudmlld3BvcnRXaWR0aDsKKyAgICAgICAgICAgIHNjb3BlLnNjcm9sbGJhckF4aXMgPSBjb250cm9sbGVyLm9wdGlvbnMuYXhpczsKKyAgICAgICAgICAgIGlmIChzY29wZS5zY3JvbGxiYXJBeGlzID09PSAneCcpIHsKKyAgICAgICAgICAgICAgICBpRWxlbWVudC5hZGRDbGFzcygnaG9yaXpvbnRhbCcpOworICAgICAgICAgICAgfSBlbHNlIGlmIChzY29wZS5zY3JvbGxiYXJBeGlzID09PSAneScpIHsKKyAgICAgICAgICAgICAgICBpRWxlbWVudC5hZGRDbGFzcygndmVydGljYWwnKTsKKyAgICAgICAgICAgIH0KKworICAgICAgICAgICAgdmFyIHBvc2l0aW9uID0gaUVsZW1lbnQuY3NzKCdwb3NpdGlvbicpOworICAgICAgICAgICAgaWYgKHBvc2l0aW9uICE9PSAncmVsYXRpdmUnICYmIHBvc2l0aW9uICE9PSAnYWJzb2x1dGUnKSB7CisgICAgICAgICAgICAgICAgaUVsZW1lbnQuY3NzKCdwb3NpdGlvbicsICdyZWxhdGl2ZScpOworICAgICAgICAgICAgfQorCisgICAgICAgICAgICBzY29wZS4kd2F0Y2goZnVuY3Rpb24gKCkgeworICAgICAgICAgICAgICAgICR0aW1lb3V0KHJlZnJlc2hTY3JvbGxiYXIsIDEwMCwgZmFsc2UpOworICAgICAgICAgICAgfSk7CisKKyAgICAgICAgICAgIHZhciByZWZyZXNoU2Nyb2xsYmFyID0gZnVuY3Rpb24gKCkgeworICAgICAgICAgICAgICAgIHZhciAkb3ZlcnZpZXcgPSBhbmd1bGFyLmVsZW1lbnQoaUVsZW1lbnRbMF0ucXVlcnlTZWxlY3RvckFsbCgnLnNjcm9sbC1vdmVydmlldycpWzBdKTsKKyAgICAgICAgICAgICAgICB2YXIgbmV3VmFsdWUgPSAkb3ZlcnZpZXcucHJvcCgnc2Nyb2xsSGVpZ2h0Jyk7CisgICAgICAgICAgICAgICAgdmFyIG9sZFZhbHVlID0gc2NvcGUub2xkVmFsdWU7CisgICAgICAgICAgICAgICAgaWYgKG5ld1ZhbHVlICE9PSBvbGRWYWx1ZSkgeworICAgICAgICAgICAgICAgICAgICBzY29wZS5vbGRWYWx1ZSA9IG5ld1ZhbHVlOworICAgICAgICAgICAgICAgICAgICBjb250cm9sbGVyLnVwZGF0ZSgpOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH07CisKKyAgICAgICAgICAgIGNvbnRyb2xsZXIuaW5pdGlhbGl6ZSgpOworICAgICAgICAgICAgaUVsZW1lbnQub24oJyRkZXN0cm95JywgZnVuY3Rpb24gKCkgeworICAgICAgICAgICAgICAgIGNvbnRyb2xsZXIuY2xlYW51cCgpOworICAgICAgICAgICAgfSk7CisgICAgICAgIH0KKyAgICB9OworfV0pOworCithbmd1bGFyLm1vZHVsZSgnYXR0LmFicy5zZWFyY2gnLCBbJ2F0dC5hYnMudXRpbGl0aWVzJywgJ2F0dC5hYnMucG9zaXRpb24nLCAnYXR0LmFicy51dGlsaXRpZXMnXSkKKy5kaXJlY3RpdmUoJ2F0dFNlYXJjaCcsIFsnJGRvY3VtZW50JywgJyRmaWx0ZXInLCAnJGlzRWxlbWVudCcsICckZG9jdW1lbnRCaW5kJywgJyR0aW1lb3V0JywgJyRsb2cnLCAna2V5bWFwJywgZnVuY3Rpb24oJGRvY3VtZW50LCAkZmlsdGVyLCAkaXNFbGVtZW50LCAkZG9jdW1lbnRCaW5kLCAkdGltZW91dCwgJGxvZywga2V5bWFwKXsKKyAgICByZXR1cm57CisgICAgICAgIHJlc3RyaWN0OiAnQScsCisgICAgICAgIHNjb3BlOntjTmFtZTogJz1hdHRTZWFyY2gnfSwKKyAgICAgICAgdHJhbnNjbHVkZTogZmFsc2UsCisgICAgICAgIHJlcGxhY2U6IGZhbHNlLAorICAgICAgICByZXF1aXJlOiduZ01vZGVsJywKKyAgICAgICAgdGVtcGxhdGVVcmw6ICdhcHAvc2NyaXB0cy9uZ19qc19hdHRfdHBscy9zZWFyY2gvc2VhcmNoLmh0bWwnLAorICAgICAgICBsaW5rOiBmdW5jdGlvbihzY29wZSwgZWxlbWVudCwgYXR0ciwgY3RybCkgeworICAgICAgICAgICAgc2NvcGUuc2VsZWN0ZWRJbmRleCA9IC0xOworICAgICAgICAgICAgc2NvcGUuc2VsZWN0ZWRPcHRpb24gPSBhdHRyLnBsYWNlaG9sZGVyOworICAgICAgICAgICAgc2NvcGUuaXNEaXNhYmxlZCA9IGZhbHNlOworICAgICAgICAgICAgc2NvcGUuY2xhc3NOYW1lID0gInNlbGVjdDItbWF0Y2giOworICAgICAgICAgICAgc2NvcGUuc2hvd1NlYXJjaCA9IGZhbHNlOworICAgICAgICAgICAgc2NvcGUuc2hvd2xpc3QgPSBmYWxzZTsKKworICAgICAgICAgICAgLy8gVGhpcyBpcyB1c2VkIHRvIGp1bXAgdG8gZWxlbWVudHMgaW4gbGlzdAorICAgICAgICAgICAgdmFyIHNlYXJjaCA9ICcnOworICAgICAgICAgICAgLy8gVGhpcyBpcyB1c2VkIHRvIGVuc3VyZSBzZWFyY2hlcyBvbmx5IHBlcnNpc3Qgc28gbWFueSBtcy4KKyAgICAgICAgICAgIHZhciBwcmV2U2VhcmNoRGF0ZSA9IG5ldyBEYXRlKCk7CisgICAgICAgICAgICAvLyBUaGlzIGlzIHVzZWQgdG8gc2hpZnQgZm9jdXMgYmFjayBhZnRlciBjbG9zaW5nIGRyb3Bkb3duCisgICAgICAgICAgICB2YXIgZHJvcGRvd25FbGVtZW50ID0gdW5kZWZpbmVkOworICAgICAgICAgICAgLy8gVXNlZCB0byBlbnN1cmUgZm9jdXMgb24gZHJvcGRvd24gZWxlbWVudHMKKyAgICAgICAgICAgIHZhciBsaXN0ID0gW107CisgICAgICAgICAgICAkdGltZW91dChmdW5jdGlvbigpIHsKKyAgICAgICAgICAgICAgICBsaXN0ID0gZWxlbWVudC5maW5kKCdsaScpOworICAgICAgICAgICAgfSwgMTApOworCisgICAgICAgICAgICAkbG9nLndhcm4oJ2F0dFNlYXJjaCBpcyBkZXByZWNhdGVkLCBwbGVhc2UgdXNlIGF0dFNlbGVjdCBpbnN0ZWFkLiBUaGlzIGNvbXBvbmVudCB3aWxsIGJlIHJlbW92ZWQgYnkgdmVyc2lvbiAyLjcuJykKKyAgCQkJLy9zY29wZS5ub0ZpbHRlciA9IHRydWU7CisgICAgICAgICAgICBpZiAoYXR0ci5ub0ZpbHRlciB8fCBhdHRyLm5vRmlsdGVyID09PSAndHJ1ZScpIHsKKyAgICAgICAgICAgICAgICBzY29wZS5ub0ZpbHRlciA9IHRydWU7CisgICAgICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgICAgIHNjb3BlLm5vRmlsdGVyID0gZmFsc2U7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBpZiAoYXR0ci5wbGFjZWhvbGRlckFzT3B0aW9uID09PSAnZmFsc2UnKSB7CisgICAgICAgICAgICAgICAgLy9zY29wZS5zZWxlY3RNc2cgPSAnJzsKKyAgICAgICAgICAgICAgICBzY29wZS5zZWxlY3RlZE9wdGlvbiA9IGF0dHIucGxhY2Vob2xkZXI7CisgICAgICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgICAgIHNjb3BlLnNlbGVjdE1zZyA9IGF0dHIucGxhY2Vob2xkZXI7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBpZiAoYXR0ci5zdGFydHNXaXRoRmlsdGVyIHx8IGF0dHIuc3RhcnRzV2l0aEZpbHRlciA9PT0gJ3RydWUnKSB7CisgICAgICAgICAgICAgICAgc2NvcGUuc3RhcnRzV2l0aEZpbHRlciA9IHRydWU7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBpZiAoYXR0ci5zaG93SW5wdXRGaWx0ZXIgPT09ICd0cnVlJykgeworICAgICAgICAgICAgICAgIHNjb3BlLnNob3dTZWFyY2ggPSBmYWxzZTsKKyAgICAgICAgICAgICAgICAkbG9nLndhcm4oJ3Nob3dJbnB1dEZpbHRlciBmdW5jdGlvbmFsaXR5IGhhcyBiZWVuIHJlbW92ZWQgZnJvbSB0aGUgbGlicmFyeS4nKTsKKyAgICAgICAgICAgICAgICAvLyBUaGlzIGlzIGRlcHJlY2F0ZWQKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGlmIChhdHRyLmRpc2FibGVkKSB7CisgICAgICAgICAgICAgICAgc2NvcGUuaXNEaXNhYmxlZCA9IHRydWU7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBkcm9wZG93bkVsZW1lbnQgPSBhbmd1bGFyLmVsZW1lbnQoZWxlbWVudCkuY2hpbGRyZW4oKS5lcSgwKS5maW5kKCdhJylbMF07CisgICAgICAgICAgICB2YXIgcHJldkluZGV4ID0gMDsKKyAgICAgICAgICAgIHZhciBzZWxlY3RPcHRpb25Gcm9tU2VhcmNoID0gZnVuY3Rpb24oKSB7CisgICAgICAgICAgICAgICAgaWYgKCFzY29wZS5ub0ZpbHRlcikgeworICAgICAgICAgICAgICAgICAgICByZXR1cm47CisgICAgICAgICAgICAgICAgfQorCisgICAgICAgICAgICAgICAgLy8gRmluZCBuZXh0IGVsZW1lbnQgdGhhdCBtYXRjaGVzIHNlYXJjaCBjcml0ZXJpYS4gCisgICAgICAgICAgICAgICAgLy8gSWYgbm8gZWxlbWVudCBpcyBmb3VuZCwgbG9vcCB0byBiZWdpbm5pbmcgYW5kIHNlYXJjaC4KKyAgICAgICAgICAgICAgICB2YXIgY3JpdGVyaWEgPSBzZWFyY2g7CisgICAgICAgICAgICAgICAgdmFyIGkgPSAwOworICAgICAgICAgICAgICAgIGZvciAoaSA9IHByZXZJbmRleDsgaSA8IHNjb3BlLmNOYW1lLmxlbmd0aDsgaSsrKSB7CisgICAgICAgICAgICAgICAgICAgIC8vIE5lZWQgdG8gZW5zdXJlIHdlIGtlZXAgc2VhcmNoaW5nIHVudGlsIGFsbCBzdGFydHNXaXRoIGhhdmUgcGFzc2VkIGJlZm9yZSBsb29waW5nCisgICAgICAgICAgICAgICAgICAgIGlmIChzY29wZS5jTmFtZVtpXS50aXRsZS5zdGFydHNXaXRoKGNyaXRlcmlhKSAmJiBpICE9PSBzY29wZS5zZWxlY3RlZEluZGV4KSB7CisgICAgICAgICAgICAgICAgICAgICAgICBzY29wZS5zZWxlY3RPcHRpb24oc2NvcGUuY05hbWVbaV0sIGksIHNjb3BlLnNob3dsaXN0KTsKKyAgICAgICAgICAgICAgICAgICAgICAgIHByZXZJbmRleCA9IGk7CisgICAgICAgICAgICAgICAgICAgICAgICBzZWFyY2ggPSAnJzsKKyAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIGlmICgoaSA+PSBzY29wZS5jTmFtZS5sZW5ndGggfHwgIXNjb3BlLmNOYW1lW2krMV0udGl0bGUuc3RhcnRzV2l0aChjcml0ZXJpYSkpICYmIHByZXZJbmRleCA+IDApIHsKKyAgICAgICAgICAgICAgICAgICAgcHJldkluZGV4ID0gMDsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9OworICAgICAgICAgICAgc2NvcGUuc2hvd0Ryb3Bkb3duID0gZnVuY3Rpb24oKSB7CisgICAgICAgICAgICAgICAgaWYgKCEoYXR0ci5kaXNhYmxlZCkpIHsKKyAgICAgICAgICAgICAgICAgICAgc2NvcGUuc2hvd2xpc3QgPSAhc2NvcGUuc2hvd2xpc3Q7CisgICAgICAgICAgICAgICAgICAgIHNjb3BlLnNldFNlbGVjdFRvcCgpOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH07CisgICAgICAgICAgICBlbGVtZW50LmJpbmQoJ2tleWRvd24nLCBmdW5jdGlvbihlKSB7CisgICAgICAgICAgICAgICAgaWYgKGtleW1hcC5pc0FsbG93ZWRLZXkoZS5rZXlDb2RlKSB8fCBrZXltYXAuaXNDb250cm9sKGUpIHx8IGtleW1hcC5pc0Z1bmN0aW9uS2V5KGUpKSB7CisgICAgICAgICAgICAgICAgICAgIGUucHJldmVudERlZmF1bHQoKTsKKyAgICAgICAgICAgICAgICAgICAgZS5zdG9wUHJvcGFnYXRpb24oKTsKKworICAgICAgICAgICAgICAgICAgICBzd2l0Y2ggKGUua2V5Q29kZSkgeworICAgICAgICAgICAgICAgICAgICAgICAgY2FzZSBrZXltYXAuS0VZLkRPV046CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2NvcGUuc2VsZWN0TmV4dCgpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgICAgICAgICAgY2FzZSBrZXltYXAuS0VZLlVQOgorICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNjb3BlLnNlbGVjdFByZXYoKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBzZWFyY2ggPSAnJzsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICAgICAgICAgIGNhc2Uga2V5bWFwLktFWS5FTlRFUjoKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBzY29wZS5zZWxlY3RDdXJyZW50KCk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2VhcmNoID0gJyc7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgICAgICAgICBjYXNlIGtleW1hcC5LRVkuQkFDS1NQQUNFOgorICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNjb3BlLnRpdGxlID0gJyc7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2VhcmNoID0gJyc7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2NvcGUuJGFwcGx5KCk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgICAgICAgICBjYXNlIGtleW1hcC5LRVkuU1BBQ0U6CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKCFzY29wZS5ub0ZpbHRlcikgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzY29wZS50aXRsZSArPSAnICc7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNjb3BlLiRhcHBseSgpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgICAgICAgICAgY2FzZSBrZXltYXAuS0VZLkVTQzoKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoc2NvcGUudGl0bGUgPT09ICcnIHx8IHNjb3BlLnRpdGxlID09PSB1bmRlZmluZWQpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2NvcGUuc2hvd2xpc3QgPSBmYWxzZTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZHJvcGRvd25FbGVtZW50LmZvY3VzKCk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNjb3BlLiRhcHBseSgpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNjb3BlLnRpdGxlID0gJyc7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNjb3BlLiRhcHBseSgpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoc2NvcGUubm9GaWx0ZXIpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2VhcmNoID0gJyc7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRyb3Bkb3duRWxlbWVudC5mb2N1cygpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzY29wZS5zaG93bGlzdCA9IGZhbHNlOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICAgICAgICAgIGRlZmF1bHQ6CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgICAgICAgICBpZiAoZS5rZXlDb2RlICE9PSA5KQorICAgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgICAgICBpZiAoIXNjb3BlLm5vRmlsdGVyKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2NvcGUuc2hvd2xpc3QgPSB0cnVlOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNjb3BlLnRpdGxlID0gc2NvcGUudGl0bGUgPyBzY29wZS50aXRsZSArIFN0cmluZy5mcm9tQ2hhckNvZGUoZS5rZXlDb2RlKSA6IFN0cmluZy5mcm9tQ2hhckNvZGUoZS5rZXlDb2RlKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFyIGRhdGUgPSBuZXcgRGF0ZSgpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhciBkZWx0YSA9IE1hdGguYWJzKHByZXZTZWFyY2hEYXRlLmdldE1pbGxpc2Vjb25kcygpIC0gZGF0ZS5nZXRNaWxsaXNlY29uZHMoKSk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgcHJldlNlYXJjaERhdGUgPSBkYXRlOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChkZWx0YSA+IDEwMCkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzZWFyY2ggPSAnJzsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2VhcmNoID0gc2VhcmNoID8gc2VhcmNoICsgU3RyaW5nLmZyb21DaGFyQ29kZShlLmtleUNvZGUpIDogU3RyaW5nLmZyb21DaGFyQ29kZShlLmtleUNvZGUpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChzZWFyY2gubGVuZ3RoID4gMikgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzZWFyY2ggPSBzZWFyY2guc3Vic3RyaW5nKDAsIDIpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBzZWxlY3RPcHRpb25Gcm9tU2VhcmNoKCk7CisgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICBzY29wZS4kYXBwbHkoKTsKKyAgICAgICAgICAgICAgICAgICAgfSBlbHNlIGlmIChlLmtleUNvZGUgPT09IDkpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIHNjb3BlLnNob3dsaXN0ID0gZmFsc2U7CisgICAgICAgICAgICAgICAgICAgICAgICBzY29wZS50aXRsZSA9ICcnOworICAgICAgICAgICAgICAgICAgICAgICAgc2NvcGUuJGFwcGx5KCk7CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9KTsKKyAgICAgICAgICAgIHNjb3BlLnNlbGVjdE9wdGlvbiA9IGZ1bmN0aW9uKHNUaXRsZSwgc0luZGV4LCBrZWVwT3BlbikgeworICAgICAgICAgICAgICAgIGlmIChzSW5kZXggPT09IC0xIHx8IHNJbmRleCA9PT0gJy0xJykgeworICAgICAgICAgICAgICAgICAgICBzY29wZS5zZWxDYXRlZ29yeSA9ICcnOworICAgICAgICAgICAgICAgICAgICBzY29wZS5zZWxlY3RlZEluZGV4ID0gLTE7CisgICAgICAgICAgICAgICAgICAgIGN0cmwuJHNldFZpZXdWYWx1ZSgnJyk7CisgICAgICAgICAgICAgICAgICAgIGlmKGF0dHIucGxhY2Vob2xkZXJBc09wdGlvbiAhPT0gJ2ZhbHNlJykKKyAgICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAgICAgc2NvcGUuc2VsZWN0ZWRPcHRpb24gPSBzY29wZS5zZWxlY3RNc2c7CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgICAgICAgICBzY29wZS5zZWxDYXRlZ29yeSA9IHNjb3BlLmNOYW1lW3NJbmRleF07CisgICAgICAgICAgICAgICAgICAgIHNjb3BlLnNlbGVjdGVkSW5kZXggPSBzSW5kZXg7CisgICAgICAgICAgICAgICAgICAgIGN0cmwuJHNldFZpZXdWYWx1ZShzY29wZS5zZWxDYXRlZ29yeSk7CisgICAgICAgICAgICAgICAgICAgIHNjb3BlLnNlbGVjdGVkT3B0aW9uID0gc2NvcGUuc2VsQ2F0ZWdvcnkudGl0bGU7CisgICAgICAgICAgICAgICAgICAgIGlmIChhbmd1bGFyLmlzRGVmaW5lZChsaXN0W3NJbmRleF0pKSB7CisgICAgICAgICAgICAgICAgICAgICAgICBsaXN0W3NJbmRleF0uZm9jdXMoKTsKKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICBzY29wZS50aXRsZSA9ICcnOworICAgICAgICAgICAgICAgIGlmICgha2VlcE9wZW4pIHsKKyAgICAgICAgICAgICAgICAgICAgc2NvcGUuc2hvd2xpc3QgPSBmYWxzZTsKKyAgICAgICAgICAgICAgICAgICAgZHJvcGRvd25FbGVtZW50LmZvY3VzKCk7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIHNjb3BlLiRhcHBseSgpOworICAgICAgICAgICAgfTsKKyAgICAgICAgICAgIHNjb3BlLnNlbGVjdEN1cnJlbnQgPSBmdW5jdGlvbigpIHsKKyAgICAgICAgICAgICAgICBpZiAoc2NvcGUuc2hvd2xpc3QpIHsKKyAgICAgICAgICAgICAgICAgICAgc2NvcGUuc2VsZWN0T3B0aW9uKHNjb3BlLnNlbGVjdE1zZywgc2NvcGUuc2VsZWN0ZWRJbmRleCwgZmFsc2UpOworICAgICAgICAgICAgICAgICAgICBzY29wZS4kYXBwbHkoKTsKKyAgICAgICAgICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgICAgICAgICBzY29wZS5zaG93bGlzdCA9IHRydWU7CisgICAgICAgICAgICAgICAgICAgIHNjb3BlLnNldFNlbGVjdFRvcCgpOworICAgICAgICAgICAgICAgICAgICBzY29wZS4kYXBwbHkoKTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9OworICAgICAgICAgICAgc2NvcGUuaG92ZXJJbiA9IGZ1bmN0aW9uKGNJdGVtKSB7CisgICAgICAgICAgICAgICAgc2NvcGUuc2VsZWN0ZWRJbmRleCA9IGNJdGVtOworICAgICAgICAgICAgICAgIHNjb3BlLmZvY3VzbWUoKTsKKyAgICAgICAgICAgIH07CisgICAgICAgICAgICBzY29wZS5zZXRTZWxlY3RUb3AgPSBmdW5jdGlvbigpIHsKKyAgICAgICAgICAgICAgICAkdGltZW91dChmdW5jdGlvbigpIHsKKyAgICAgICAgICAgICAgICAgICAgaWYgKHNjb3BlLnNob3dsaXN0ICYmICFzY29wZS5ub0ZpbHRlcikKKyAgICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAgICAgdmFyIGNvbnRhaW5lclVMID0gYW5ndWxhci5lbGVtZW50KGVsZW1lbnQpWzBdLnF1ZXJ5U2VsZWN0b3IoIi5zZWxlY3QyLXJlc3VsdHMiKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIGlmKGFuZ3VsYXIuZWxlbWVudChjb250YWluZXJVTC5xdWVyeVNlbGVjdG9yKCcuc2VsZWN0Mi1yZXN1bHQtY3VycmVudCcpKVswXSkKKyAgICAgICAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YXIgc2VsZWN0ZWRFbGVtVG9wUG9zID0gYW5ndWxhci5lbGVtZW50KGNvbnRhaW5lclVMLnF1ZXJ5U2VsZWN0b3IoJy5zZWxlY3QyLXJlc3VsdC1jdXJyZW50JykpWzBdLm9mZnNldFRvcDsKKyAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgIGFuZ3VsYXIuZWxlbWVudChjb250YWluZXJVTClbMF0uc2Nyb2xsVG9wID0gc2VsZWN0ZWRFbGVtVG9wUG9zOworICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgfSk7CisgICAgICAgICAgICB9OworICAgICAgICAgICAgc2NvcGUuc2V0Q3VycmVudFRvcCA9IGZ1bmN0aW9uKCkgeworICAgICAgICAgICAgICAgICR0aW1lb3V0KGZ1bmN0aW9uKCkgeworICAgICAgICAgICAgICAgICAgICBpZiAoc2NvcGUuc2hvd2xpc3QpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIHZhciBjb250YWluZXJVTCA9IGFuZ3VsYXIuZWxlbWVudChlbGVtZW50KVswXS5xdWVyeVNlbGVjdG9yKCIuc2VsZWN0Mi1yZXN1bHRzIik7CisgICAgICAgICAgICAgICAgICAgICAgICBpZihhbmd1bGFyLmVsZW1lbnQoY29udGFpbmVyVUwucXVlcnlTZWxlY3RvcignLmhvdnN0eWxlJykpWzBdKQorICAgICAgICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhciBzZWxlY3RlZEVsZW1Ub3BQb3MgPSBhbmd1bGFyLmVsZW1lbnQoY29udGFpbmVyVUwucXVlcnlTZWxlY3RvcignLmhvdnN0eWxlJykpWzBdLm9mZnNldFRvcDsKKyAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgIGlmIChzZWxlY3RlZEVsZW1Ub3BQb3MgPCAoYW5ndWxhci5lbGVtZW50KGNvbnRhaW5lclVMKVswXS5zY3JvbGxUb3ApKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgYW5ndWxhci5lbGVtZW50KGNvbnRhaW5lclVMKVswXS5zY3JvbGxUb3AgLT0gMzA7CisgICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKChzZWxlY3RlZEVsZW1Ub3BQb3MgKyAzMCkgPiAoYW5ndWxhci5lbGVtZW50KGNvbnRhaW5lclVMKVswXS5jbGllbnRIZWlnaHQpKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgYW5ndWxhci5lbGVtZW50KGNvbnRhaW5lclVMKVswXS5zY3JvbGxUb3AgKz0gMzA7CisgICAgICAgICAgICAgICAgICAgICAgICB9CisKKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIH0pOworICAgICAgICAgICAgfTsKKyAgICAgICAgICAgIHNjb3BlLnNlbGVjdE5leHQgPSBmdW5jdGlvbigpIHsKKyAgICAgICAgICAgICAgICBpZiAoKHNjb3BlLnNlbGVjdGVkSW5kZXggKyAxKSA8PSAoc2NvcGUuY05hbWUubGVuZ3RoIC0gMSkpIHsKKyAgICAgICAgICAgICAgICAgICAgc2NvcGUuc2VsZWN0ZWRJbmRleCArPSAxOworICAgICAgICAgICAgICAgICAgICBpZiAoIXNjb3BlLnNob3dsaXN0KSB7CisgICAgICAgICAgICAgICAgICAgICAgICBzY29wZS5zZWxlY3RPcHRpb24oc2NvcGUuc2VsZWN0TXNnLCBzY29wZS5zZWxlY3RlZEluZGV4LCBmYWxzZSk7CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgc2NvcGUuZm9jdXNtZSgpOworICAgICAgICAgICAgICAgICAgICBzY29wZS4kYXBwbHkoKTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgc2NvcGUuc2V0Q3VycmVudFRvcCgpOworICAgICAgICAgICAgfTsKKyAgICAgICAgICAgIHNjb3BlLnNlbGVjdFByZXYgPSBmdW5jdGlvbigpIHsKKyAgICAgICAgICAgICAgICBpZiAoKHNjb3BlLnNlbGVjdGVkSW5kZXggLSAxKSA+PSAwKSB7CisgICAgICAgICAgICAgICAgICAgIHNjb3BlLnNlbGVjdGVkSW5kZXggLT0gMTsKKyAgICAgICAgICAgICAgICAgICAgaWYgKCFzY29wZS5zaG93bGlzdCkgeworICAgICAgICAgICAgICAgICAgICAgICAgc2NvcGUuc2VsZWN0T3B0aW9uKHNjb3BlLnNlbGVjdE1zZywgc2NvcGUuc2VsZWN0ZWRJbmRleCwgZmFsc2UpOworICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgIHNjb3BlLmZvY3VzbWUoKTsKKyAgICAgICAgICAgICAgICAgICAgc2NvcGUuJGFwcGx5KCk7CisgICAgICAgICAgICAgICAgfSBlbHNlIGlmIChzY29wZS5zZWxlY3RlZEluZGV4IC0gMSA8IDApIHsKKyAgICAgICAgICAgICAgICAgICAgLy8gSWYgcGxhY2Vob2xkZXJBc09wdGlvbiBpcyB0cnVlIG9yIHVuZGVmaW5lZCAoZGVmYXVsdCksIGVuc3VyZSB3ZSBjYW4gc2VsZWN0IGl0IG9uIHVwIGtleS4KKyAgICAgICAgICAgICAgICAgICAgaWYgKGF0dHIucGxhY2Vob2xkZXJBc09wdGlvbiA9PT0gdW5kZWZpbmVkIHx8IGF0dHIucGxhY2Vob2xkZXJBc09wdGlvbiA9PT0gJ3RydWUnKSB7CisgICAgICAgICAgICAgICAgICAgICAgICBzY29wZS5zZWxlY3RlZEluZGV4ID0gLTE7CisgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICAgICAgICAgICAgICBzY29wZS5zZWxlY3RlZEluZGV4ID0gMDsKKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICBpZiAoIXNjb3BlLnNob3dsaXN0KSB7CisgICAgICAgICAgICAgICAgICAgICAgICBzY29wZS5zZWxlY3RPcHRpb24oc2NvcGUuc2VsZWN0TXNnLCBzY29wZS5zZWxlY3RlZEluZGV4LCBmYWxzZSk7CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgc2NvcGUuZm9jdXNtZSgpOworICAgICAgICAgICAgICAgICAgICBzY29wZS4kYXBwbHkoKTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgc2NvcGUuc2V0Q3VycmVudFRvcCgpOworICAgICAgICAgICAgfTsKKyAgICAgICAgICAgIHNjb3BlLnVwZGF0ZVNlbGVjdGlvbiA9IGZ1bmN0aW9uKHNJdGVtKSB7CisgICAgICAgICAgICAgICAgc2NvcGUuc2VsZWN0ZWRPcHRpb24gPSBzSXRlbS50aXRsZTsKKyAgICAgICAgICAgICAgICBzY29wZS50aXRsZSA9ICIiOworICAgICAgICAgICAgfTsKKyAgICAgICAgICAgIHNjb3BlLmZvY3VzbWUgPSBmdW5jdGlvbigpIHsKKyAgICAgICAgICAgICAgICAkdGltZW91dChmdW5jdGlvbigpIHsKKyAgICAgICAgICAgICAgICAgICAgdmFyIGxpc3QgPSBhbmd1bGFyLmVsZW1lbnQoZWxlbWVudCkuZmluZCgndWwnKS5maW5kKCdsaScpOworICAgICAgICAgICAgICAgICAgICB2YXIgaW5kZXggPSBzY29wZS5zZWxlY3RlZEluZGV4ICsgMjsKKyAgICAgICAgICAgICAgICAgICAgaWYgKHNjb3BlLm5vRmlsdGVyKSB7CisgICAgICAgICAgICAgICAgICAgICAgICBpbmRleCA9IHNjb3BlLnNlbGVjdGVkSW5kZXg7CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgaWYgKGFuZ3VsYXIuaXNEZWZpbmVkKGxpc3RbaW5kZXhdKSkgeworICAgICAgICAgICAgICAgICAgICAgICAgbGlzdFtpbmRleF0uZm9jdXMoKTsKKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIH0pOworICAgICAgICAgICAgfTsKKyAgICAgICAgICAgIHNjb3BlLiR3YXRjaCgnc2VsQ2F0ZWdvcnknLCBmdW5jdGlvbih2YWx1ZSkgeworICAgICAgICAgICAgICAgIGlmICh2YWx1ZSkgeworICAgICAgICAgICAgICAgICAgICBzY29wZS51cGRhdGVTZWxlY3Rpb24odmFsdWUpOworICAgICAgICAgICAgICAgIH07CisgICAgICAgICAgICB9KTsKKyAgICAgICAgICAgIGN0cmwuJHZpZXdDaGFuZ2VMaXN0ZW5lcnMucHVzaChmdW5jdGlvbigpIHsKKyAgICAgICAgICAgICAgICBzY29wZS4kZXZhbChhdHRyLm5nQ2hhbmdlKTsKKyAgICAgICAgICAgIH0pOworICAgICAgICAgICAgY3RybC4kcmVuZGVyID0gZnVuY3Rpb24oKSB7CisgICAgICAgICAgICAgICAgc2NvcGUuc2VsQ2F0ZWdvcnkgPSBjdHJsLiR2aWV3VmFsdWU7CisgICAgICAgICAgICB9OworICAgICAgICAgICAgdmFyIG91dHNpZGVDbGljayA9IGZ1bmN0aW9uKGUpIHsKKyAgICAgICAgICAgICAgICB2YXIgaXNFbGVtZW50ID0gJGlzRWxlbWVudChhbmd1bGFyLmVsZW1lbnQoZS50YXJnZXQpLCBlbGVtZW50LCAkZG9jdW1lbnQpOworICAgICAgICAgICAgICAgIGlmICghaXNFbGVtZW50KSB7CisgICAgICAgICAgICAgICAgICAgIHNjb3BlLnNob3dsaXN0ID0gZmFsc2U7CisgICAgICAgICAgICAgICAgICAgIGRyb3Bkb3duRWxlbWVudC5mb2N1cygpOworICAgICAgICAgICAgICAgICAgICBzY29wZS4kYXBwbHkoKTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9OworICAgICAgICAgICAgJGRvY3VtZW50QmluZC5jbGljaygnc2hvd2xpc3QnLCBvdXRzaWRlQ2xpY2ssIHNjb3BlKTsKKyAgICAgICAgfQorICAgIH07Cit9XSk7Cithbmd1bGFyLm1vZHVsZSgnYXR0LmFicy5zZWxlY3QnLCBbJ2F0dC5hYnMudXRpbGl0aWVzJywgJ2F0dC5hYnMucG9zaXRpb24nLCAnYXR0LmFicy51dGlsaXRpZXMnXSkKKy5kaXJlY3RpdmUoJ2F0dFNlbGVjdCcsIFsiJGRvY3VtZW50IiwgIiRmaWx0ZXIiLCAiJGlzRWxlbWVudCIsICckZG9jdW1lbnRCaW5kJywgJyR0aW1lb3V0JywgJ2tleW1hcCcsICckbG9nJywgZnVuY3Rpb24oJGRvY3VtZW50LCAkZmlsdGVyLCAkaXNFbGVtZW50LCAkZG9jdW1lbnRCaW5kLCAkdGltZW91dCwga2V5bWFwLCAkbG9nKSB7CisgICAgcmV0dXJuIHsKKyAgICAgICAgcmVzdHJpY3Q6ICdBJywKKyAgICAgICAgc2NvcGU6IHsKKyAgICAgICAgICAgIGNOYW1lOiAnPWF0dFNlbGVjdCcKKyAgICAgICAgfSwKKyAgICAgICAgdHJhbnNjbHVkZTogZmFsc2UsCisgICAgICA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Z0IGZvY3VzIGJhY2sgYWZ0ZXIgY2xvc2luZyBkcm9wZG93bgorICAgICAgICAgICAgdmFyIGRyb3Bkb3duRWxlbWVudCA9IHVuZGVmaW5lZDsKKyAgICAgICAgICAgIC8vIFVzZWQgdG8gZW5zdXJlIGZvY3VzIG9uIGRyb3Bkb3duIGVsZW1lbnRzCisgICAgICAgICAgICB2YXIgbGlzdCA9IFtdOworICAgICAgICAgICAgJHRpbWVvdXQoZnVuY3Rpb24oKSB7CisgICAgICAgICAgICAgICAgbGlzdCA9IGVsZW1lbnQuZmluZCgnbGknKTsKKyAgICAgICAgICAgIH0sIDEwKTsKKwkJCS8vc2NvcGUubm9GaWx0ZXIgPSB0cnVlOworICAgICAgICAgICAgaWYgKGF0dHIubm9GaWx0ZXIgfHwgYXR0ci5ub0ZpbHRlciA9PT0gJ3RydWUnKSB7CisgICAgICAgICAgICAgICAgc2NvcGUubm9GaWx0ZXIgPSB0cnVlOworICAgICAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgICAgICBzY29wZS5ub0ZpbHRlciA9IGZhbHNlOworICAgICAgICAgICAgfQorICAgICAgICAgICAgaWYgKGF0dHIucGxhY2Vob2xkZXJBc09wdGlvbiA9PT0gJ2ZhbHNlJykgeworICAgICAgICAgICAgICAgIHNjb3BlLnNlbGVjdGVkT3B0aW9uID0gYXR0ci5wbGFjZWhvbGRlcjsKKyAgICAgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICAgICAgc2NvcGUuc2VsZWN0TXNnID0gYXR0ci5wbGFjZWhvbGRlcjsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGlmIChhdHRyLnN0YXJ0c1dpdGhGaWx0ZXIgfHwgYXR0ci5zdGFydHNXaXRoRmlsdGVyID09PSAndHJ1ZScpIHsKKyAgICAgICAgICAgICAgICBzY29wZS5zdGFydHNXaXRoRmlsdGVyID0gdHJ1ZTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGlmIChhdHRyLnNob3dJbnB1dEZpbHRlciA9PT0gJ3RydWUnKSB7CisgICAgICAgICAgICAgICAgc2NvcGUuc2hvd1NlYXJjaCA9IGZhbHNlOworICAgICAgICAgICAgICAgIC8qIFRoaXMgaXMgZGVwcmVjYXRlZCAqLworICAgICAgICAgICAgICAgICRsb2cud2Fybignc2hvd0lucHV0RmlsdGVyIGZ1bmN0aW9uYWxpdHkgaGFzIGJlZW4gcmVtb3ZlZCBmcm9tIHRoZSBsaWJyYXJ5LicpOyAgIAorICAgICAgICAgICAgfQorICAgICAgICAgICAgaWYgKGF0dHIuZGlzYWJsZWQpIHsKKyAgICAgICAgICAgICAgICBzY29wZS5pc0Rpc2FibGVkID0gdHJ1ZTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIHZhciBnZXRGaWx0ZXJUeXBlID0gZnVuY3Rpb24oKSB7CisgICAgICAgICAgICAgICAgaWYgKHNjb3BlLnN0YXJ0c1dpdGhGaWx0ZXIpIHsKKyAgICAgICAgICAgICAgICAgICAgcmV0dXJuICdzdGFydHNXaXRoJzsKKyAgICAgICAgICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgICAgICAgICByZXR1cm4gJ2ZpbHRlcic7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfTsKKyAgICAgICAgICAgIGRyb3Bkb3duRWxlbWVudCA9IGFuZ3VsYXIuZWxlbWVudChlbGVtZW50KS5jaGlsZHJlbigpLmVxKDApLmZpbmQoJ3NwYW4nKVswXTsKKyAgICAgICAgICAgIHZhciBwcmV2SW5kZXggPSAwOworICAgICAgICAgICAgdmFyIHNlbGVjdE9wdGlvbkZyb21TZWFyY2ggPSBmdW5jdGlvbigpIHsKKyAgICAgICAgICAgICAgICBpZiAoIXNjb3BlLm5vRmlsdGVyKSB7CisgICAgICAgICAgICAgICAgICAgIHJldHVybjsKKyAgICAgICAgICAgICAgICB9CisKKyAgICAgICAgICAgICAgICAvLyBGaW5kIG5leHQgZWxlbWVudCB0aGF0IG1hdGNoZXMgc2VhcmNoIGNyaXRlcmlhLgorICAgICAgICAgICAgICAgIC8vIElmIG5vIGVsZW1lbnQgaXMgZm91bmQsIGxvb3AgdG8gYmVnaW5uaW5nIGFuZCBzZWFyY2guCisgICAgICAgICAgICAgICAgdmFyIGNyaXRlcmlhID0gc2VhcmNoOworICAgICAgICAgICAgICAgIHZhciBpID0gMDsKKyAgICAgICAgICAgICAgICBmb3IgKGkgPSBwcmV2SW5kZXg7IGkgPCBzY29wZS5jTmFtZS5sZW5ndGg7IGkrKykgeworICAgICAgICAgICAgICAgICAgICAvLyBOZWVkIHRvIGVuc3VyZSB3ZSBrZWVwIHNlYXJjaGluZyB1bnRpbCBhbGwgc3RhcnRzV2l0aCBoYXZlIHBhc3NlZCBiZWZvcmUgbG9vcGluZworICAgICAgICAgICAgICAgICAgICBpZiAoc2NvcGUuY05hbWVbaV0udGl0bGUuc3RhcnRzV2l0aChjcml0ZXJpYSkgJiYgaSAhPT0gc2NvcGUuc2VsZWN0ZWRJbmRleCkgeworICAgICAgICAgICAgICAgICAgICAgICAgc2NvcGUuc2VsZWN0T3B0aW9uKHNjb3BlLmNOYW1lW2ldLCBpLCBzY29wZS5zaG93bGlzdCk7CisgICAgICAgICAgICAgICAgICAgICAgICBwcmV2SW5kZXggPSBpOworICAgICAgICAgICAgICAgICAgICAgICAgc2VhcmNoID0gJyc7CisgICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICBpZiAoKGkgPj0gc2NvcGUuY05hbWUubGVuZ3RoIHx8ICFzY29wZS5jTmFtZVtpKzFdLnRpdGxlLnN0YXJ0c1dpdGgoY3JpdGVyaWEpKSAmJiBwcmV2SW5kZXggPiAwKSB7CisgICAgICAgICAgICAgICAgICAgIHByZXZJbmRleCA9IDA7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfTsKKyAgICAgICAgICAgIHNjb3BlLnNob3dEcm9wZG93biA9IGZ1bmN0aW9uKCkgeworICAgICAgICAgICAgICAgIGlmICghKGF0dHIuZGlzYWJsZWQpKSB7CisgICAgICAgICAgICAgICAgICAgIHNjb3BlLnNob3dsaXN0ID0gIXNjb3BlLnNob3dsaXN0OworICAgICAgICAgICAgICAgICAgICBzY29wZS5zZXRTZWxlY3RUb3AoKTsKKyAgICAgICAgICAgICAgICAgICAgLyogRW5zdXJlIHNlbGVjdGVkIGVsZW1lbnQgaXMgZm9jdXNlZCB1cG9uIG9wZW5pbmcgZHJvcGRvd24gKi8KKyAgICAgICAgICAgICAgICAgICAgc2NvcGUuZm9jdXNtZSgpOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH07CisgICAgICAgICAgICBlbGVtZW50LmJpbmQoJ2tleWRvd24nLCBmdW5jdGlvbihlKSB7CisgICAgICAgICAgICAgICAgaWYgKGtleW1hcC5pc0FsbG93ZWRLZXkoZS5rZXlDb2RlKSB8fCBrZXltYXAuaXNDb250cm9sKGUpIHx8IGtleW1hcC5pc0Z1bmN0aW9uS2V5KGUpKSB7CisgICAgICAgICAgICAgICAgICAgIGUucHJldmVudERlZmF1bHQoKTsKKyAgICAgICAgICAgICAgICAgICAgZS5zdG9wUHJvcGFnYXRpb24oKTsKKworICAgICAgICAgICAgICAgICAgICBzd2l0Y2ggKGUua2V5Q29kZSkgeworICAgICAgICAgICAgICAgICAgICAgICAgY2FzZSBrZXltYXAuS0VZLkRPV046CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2NvcGUuc2VsZWN0TmV4dCgpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgICAgICAgICAgY2FzZSBrZXltYXAuS0VZLlVQOgorICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNjb3BlLnNlbGVjdFByZXYoKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBzZWFyY2ggPSAnJzsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICAgICAgICAgIGNhc2Uga2V5bWFwLktFWS5FTlRFUjoKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBzY29wZS5zZWxlY3RDdXJyZW50KCk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2VhcmNoID0gJyc7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgICAgICAgICBjYXNlIGtleW1hcC5LRVkuQkFDS1NQQUNFOgorICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNjb3BlLnRpdGxlID0gJyc7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2VhcmNoID0gJyc7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2NvcGUuJGFwcGx5KCk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgICAgICAgICBjYXNlIGtleW1hcC5LRVkuU1BBQ0U6CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKCFzY29wZS5ub0ZpbHRlcikgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzY29wZS50aXRsZSArPSAnICc7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNjb3BlLiRhcHBseSgpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgICAgICAgICAgY2FzZSBrZXltYXAuS0VZLkVTQzoKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoc2NvcGUudGl0bGUgPT09ICcnIHx8IHNjb3BlLnRpdGxlID09PSB1bmRlZmluZWQpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2NvcGUuc2hvd2xpc3QgPSBmYWxzZTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZHJvcGRvd25FbGVtZW50LmZvY3VzKCk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNjb3BlLiRhcHBseSgpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNjb3BlLnRpdGxlID0gJyc7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNjb3BlLiRhcHBseSgpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoc2NvcGUubm9GaWx0ZXIpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2VhcmNoID0gJyc7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRyb3Bkb3duRWxlbWVudC5mb2N1cygpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzY29wZS5zaG93bGlzdCA9IGZhbHNlOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICAgICAgICAgIGRlZmF1bHQ6CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgICAgICAgICBpZiAoZS5rZXlDb2RlICE9PSBrZXltYXAuS0VZLlRBQikKKyAgICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAgICAgaWYgKCFzY29wZS5ub0ZpbHRlcikgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNjb3BlLnNob3dsaXN0ID0gdHJ1ZTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBzY29wZS50aXRsZSA9IHNjb3BlLnRpdGxlID8gc2NvcGUudGl0bGUgKyBTdHJpbmcuZnJvbUNoYXJDb2RlKGUua2V5Q29kZSkgOiBTdHJpbmcuZnJvbUNoYXJDb2RlKGUua2V5Q29kZSk7CisKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAvKiBQZXJmb3JtIGluZGV4IGNvcnJlY3Rpb24gKi8KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoc2NvcGUudGl0bGUgIT0gJycpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFyIGZpbHRlcmVkQXJyYXkgPSAkZmlsdGVyKGdldEZpbHRlclR5cGUoKSkoc2NvcGUuY05hbWUsIHNjb3BlLnRpdGxlKTsKKworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBmb3IgKHZhciBpID0gMDsgaSA8IGZpbHRlcmVkQXJyYXkubGVuZ3RoOyBpKyspIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZvciAodmFyIGogPSAwOyBqIDwgc2NvcGUuY05hbWUubGVuZ3RoOyBqKyspIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoIWFuZ3VsYXIuaXNEZWZpbmVkKHNjb3BlLmNOYW1lW3Njb3BlLnNlbGVjdGVkSW5kZXhdKSkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGZpbHRlcmVkQXJyYXlbaV1bJ3RpdGxlJ10gPT09IHNjb3BlLmNOYW1lW3Njb3BlLnNlbGVjdGVkSW5kZXhdWyd0aXRsZSddKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNjb3BlLnNlbGVjdGVkSW5kZXggPSBpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzY29wZS5mb2N1c21lKCk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFyIGRhdGUgPSBuZXcgRGF0ZSgpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhciBkZWx0YSA9IE1hdGguYWJzKHByZXZTZWFyY2hEYXRlLmdldE1pbGxpc2Vjb25kcygpIC0gZGF0ZS5nZXRNaWxsaXNlY29uZHMoKSk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgcHJldlNlYXJjaERhdGUgPSBkYXRlOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChkZWx0YSA+IDEwMCkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzZWFyY2ggPSAnJzsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2VhcmNoID0gc2VhcmNoID8gc2VhcmNoICsgU3RyaW5nLmZyb21DaGFyQ29kZShlLmtleUNvZGUpIDogU3RyaW5nLmZyb21DaGFyQ29kZShlLmtleUNvZGUpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChzZWFyY2gubGVuZ3RoID4gMikgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzZWFyY2ggPSBzZWFyY2guc3Vic3RyaW5nKDAsIDIpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBzZWxlY3RPcHRpb25Gcm9tU2VhcmNoKCk7CisgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICBzY29wZS4kYXBwbHkoKTsKKyAgICAgICAgICAgICAgICAgICAgfSBlbHNlIGlmIChlLmtleUNvZGUgPT09IGtleW1hcC5LRVkuVEFCKSB7CisgICAgICAgICAgICAgICAgICAgICAgICBzY29wZS5zaG93bGlzdCA9IGZhbHNlOworICAgICAgICAgICAgICAgICAgICAgICAgc2NvcGUudGl0bGUgPSAnJzsKKyAgICAgICAgICAgICAgICAgICAgICAgIHNjb3BlLiRhcHBseSgpOworICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfSk7CisgICAgICAgICAgICBzY29wZS5zZWxlY3RPcHRpb24gPSBmdW5jdGlvbihzVGl0bGUsIHNJbmRleCwga2VlcE9wZW4pIHsKKworICAgICAgICAgICAgICAgIGlmIChzSW5kZXggPT09IC0xIHx8IHNJbmRleCA9PT0gJy0xJykgeworICAgICAgICAgICAgICAgICAgICBzY29wZS5zZWxDYXRlZ29yeSA9ICcnOworICAgICAgICAgICAgICAgICAgICBzY29wZS5zZWxlY3RlZEluZGV4ID0gLTE7CisgICAgICAgICAgICAgICAgICAgIGN0cmwuJHNldFZpZXdWYWx1ZSgnJyk7CisgICAgICAgICAgICAgICAgICAgIGlmKGF0dHIucGxhY2Vob2xkZXJBc09wdGlvbiAhPT0gJ2ZhbHNlJykKKyAgICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAgICAgc2NvcGUuc2VsZWN0ZWRPcHRpb24gPSBzY29wZS5zZWxlY3RNc2c7CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgZWxzZSB7CisgICAgICAgICAgICAgICAgICAgIC8qIEFwcGx5IGZpbHRlciBoZXJlIHRvIHJlbWFwIHRoZSBzZWxlY3RlZCBpbmRleCBhbmQgc2hpZnQgZm9jdXMqLworICAgICAgICAgICAgICAgICAgICBpZiAoc2NvcGUudGl0bGUgIT0gJycpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIHZhciBmaWx0ZXJlZEFycmF5ID0gJGZpbHRlcihnZXRGaWx0ZXJUeXBlKCkpKHNjb3BlLmNOYW1lLCBzY29wZS50aXRsZSk7CisKKyAgICAgICAgICAgICAgICAgICAgICAgIGlmIChhbmd1bGFyLmlzRGVmaW5lZChmaWx0ZXJlZEFycmF5KSAmJiBhbmd1bGFyLmlzRGVmaW5lZChmaWx0ZXJlZEFycmF5W3NJbmRleF0pKQorICAgICAgICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZvciAodmFyIGkgPSAwOyBpIDwgc2NvcGUuY05hbWUubGVuZ3RoOyBpKyspIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGZpbHRlcmVkQXJyYXlbc0luZGV4XVsndGl0bGUnXSA9PT0gc2NvcGUuY05hbWVbaV1bJ3RpdGxlJ10pIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNJbmRleCA9IGk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICBzY29wZS5zZWxDYXRlZ29yeSA9IHNjb3BlLmNOYW1lW3NJbmRleF07CisgICAgICAgICAgICAgICAgICAgIHNjb3BlLnNlbGVjdGVkSW5kZXggPSBzSW5kZXg7CisgICAgICAgICAgICAgICAgICAgIGN0cmwuJHNldFZpZXdWYWx1ZShzY29wZS5zZWxDYXRlZ29yeSk7CisgICAgICAgICAgICAgICAgICAgIHNjb3BlLnNlbGVjdGVkT3B0aW9uID0gc2NvcGUuc2VsQ2F0ZWdvcnkudGl0bGU7CisgICAgICAgICAgICAgICAgICAgIGN0cmwuJHJlbmRlcigpOworCisgICAgICAgICAgICAgICAgICAgICR0aW1lb3V0KGZ1bmN0aW9uKCl7CisgICAgICAgICAgICAgICAgICAgICAgICBpZiAoYW5ndWxhci5pc0RlZmluZWQobGlzdFtzSW5kZXhdKSkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRyeXsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbGlzdFtpbmRleF0uZm9jdXMoKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB9IGNhdGNoIChlKSB7fSAvKiBJRTggd2lsbCB0aHJvdyBleGNlcHRpb24gaWYgZGlzcGxheTpub25lIG9yIG5vdCBpbiBET00gKi8KKyAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgfSk7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIHNjb3BlLnRpdGxlID0gJyc7CisgICAgICAgICAgICAgICAgaWYgKCFrZWVwT3BlbikgeworICAgICAgICAgICAgICAgICAgICBzY29wZS5zaG93bGlzdCA9IGZhbHNlOworICAgICAgICAgICAgICAgICAgICBkcm9wZG93bkVsZW1lbnQuZm9jdXMoKTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9OworICAgICAgICAgICAgc2NvcGUuc2VsZWN0Q3VycmVudCA9IGZ1bmN0aW9uKCkgeworICAgICAgICAgICAgICAgIGlmIChzY29wZS5zaG93bGlzdCkgeworICAgICAgICAgICAgICAgICAgICBzY29wZS5zZWxlY3RPcHRpb24oc2NvcGUuc2VsZWN0TXNnLHNjb3BlLnNlbGVjdGVkSW5kZXgsZmFsc2UpOworICAgICAgICAgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICAgICAgICAgIHNjb3BlLnNob3dsaXN0ID0gdHJ1ZTsKKyAgICAgICAgICAgICAgICAgICAgc2NvcGUuc2V0U2VsZWN0VG9wKCk7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIHNjb3BlLiRhcHBseSgpOworICAgICAgICAgICAgfTsKKyAgICAgICAgICAgIHNjb3BlLmhvdmVySW4gPSBmdW5jdGlvbihjSXRlbSkgeworICAgICAgICAgICAgICAgIHNjb3BlLnNlbGVjdGVkSW5kZXggPSBjSXRlbTsKKyAgICAgICAgICAgICAgICBzY29wZS5mb2N1c21lKCk7CisgICAgICAgICAgICB9OworICAgICAgICAgICAgc2NvcGUuc2V0U2VsZWN0VG9wID0gZnVuY3Rpb24oKSB7CisgICAgICAgICAgICAgICAgJHRpbWVvdXQoZnVuY3Rpb24oKSB7CisgICAgICAgICAgICAgICAgICAgIGlmIChzY29wZS5zaG93bGlzdCAmJiAhc2NvcGUubm9GaWx0ZXIpCisgICAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIHZhciBjb250YWluZXJVTCA9IGFuZ3VsYXIuZWxlbWVudChlbGVtZW50KVswXS5xdWVyeVNlbGVjdG9yKCIuc2VsZWN0Mi1yZXN1bHRzIik7CisgICAgICAgICAgICAgICAgICAgICAgICBpZihhbmd1bGFyLmVsZW1lbnQoY29udGFpbmVyVUwucXVlcnlTZWxlY3RvcignLnNlbGVjdDItcmVzdWx0LWN1cnJlbnQnKSlbMF0pCisgICAgICAgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFyIHNlbGVjdGVkRWxlbVRvcFBvcyA9IGFuZ3VsYXIuZWxlbWVudChjb250YWluZXJVTC5xdWVyeVNlbGVjdG9yKCcuc2VsZWN0Mi1yZXN1bHQtY3VycmVudCcpKVswXS5vZmZzZXRUb3A7CisgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICBhbmd1bGFyLmVsZW1lbnQoY29udGFpbmVyVUwpWzBdLnNjcm9sbFRvcCA9IHNlbGVjdGVkRWxlbVRvcFBvczsKKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIH0pOworICAgICAgICAgICAgfTsKKyAgICAgICAgICAgIHNjb3BlLnNldEN1cnJlbnRUb3AgPSBmdW5jdGlvbigpIHsKKyAgICAgICAgICAgICAgICAkdGltZW91dChmdW5jdGlvbigpIHsKKyAgICAgICAgICAgICAgICAgICAgaWYgKHNjb3BlLnNob3dsaXN0KSB7CisgICAgICAgICAgICAgICAgICAgICAgICB2YXIgY29udGFpbmVyVUwgPSBhbmd1bGFyLmVsZW1lbnQoZWxlbWVudClbMF0ucXVlcnlTZWxlY3RvcigiLnNlbGVjdDItcmVzdWx0cyIpOworICAgICAgICAgICAgICAgICAgICAgICAgaWYoYW5ndWxhci5lbGVtZW50KGNvbnRhaW5lclVMLnF1ZXJ5U2VsZWN0b3IoJy5ob3ZzdHlsZScpKVswXSkKKyAgICAgICAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YXIgc2VsZWN0ZWRFbGVtVG9wUG9zID0gYW5ndWxhci5lbGVtZW50KGNvbnRhaW5lclVMLnF1ZXJ5U2VsZWN0b3IoJy5ob3ZzdHlsZScpKVswXS5vZmZzZXRUb3A7CisgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICBpZiAoc2VsZWN0ZWRFbGVtVG9wUG9zIDwgKGFuZ3VsYXIuZWxlbWVudChjb250YWluZXJVTClbMF0uc2Nyb2xsVG9wKSkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGFuZ3VsYXIuZWxlbWVudChjb250YWluZXJVTClbMF0uc2Nyb2xsVG9wIC09IDMwOworICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIGlmICgoc2VsZWN0ZWRFbGVtVG9wUG9zICsgMzApID4gKGFuZ3VsYXIuZWxlbWVudChjb250YWluZXJVTClbMF0uY2xpZW50SGVpZ2h0KSkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGFuZ3VsYXIuZWxlbWVudChjb250YWluZXJVTClbMF0uc2Nyb2xsVG9wICs9IDMwOworICAgICAgICAgICAgICAgICAgICAgICAgfQorCisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICB9KTsKKyAgICAgICAgICAgIH07CisgICAgICAgICAgICBzY29wZS5zZWxlY3ROZXh0ID0gZnVuY3Rpb24oKSB7CisgICAgICAgICAgICAgICAgdmFyIGxlbmd0aCA9IHNjb3BlLmNOYW1lLmxlbmd0aDsKKyAgICAgICAgICAgICAgICAKKyAgICAgICAgICAgICAgICBpZiAoKHNjb3BlLnNlbGVjdGVkSW5kZXggKyAxKSA8PSAoc2NvcGUuY05hbWUubGVuZ3RoIC0gMSkpIHsKKyAgICAgICAgICAgICAgICAgICAgc2NvcGUuc2VsZWN0ZWRJbmRleCArPSAxOworICAgICAgICAgICAgICAgICAgICB2YXIgbmV4dERpc2FibGVkID0gc2NvcGUuY05hbWVbc2NvcGUuc2VsZWN0ZWRJbmRleF0uZGlzYWJsZWQ7CisgICAgICAgICAgICAgICAgICAgIGlmIChuZXh0RGlzYWJsZWQpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIHNjb3BlLnNlbGVjdGVkSW5kZXggKz0gMTsKKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICBpZiAoIXNjb3BlLnNob3dsaXN0KSB7CisgICAgICAgICAgICAgICAgICAgICAgICBzY29wZS5zZWxlY3RPcHRpb24oc2NvcGUuc2VsZWN0TXNnLCBzY29wZS5zZWxlY3RlZEluZGV4LGZhbHNlKTsKKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICBzY29wZS5mb2N1c21lKCk7CisgICAgICAgICAgICAgICAgICAgIHNjb3BlLiRhcHBseSgpOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICBzY29wZS5zZXRDdXJyZW50VG9wKCk7CisgICAgICAgICAgICB9OworICAgICAgICAgICAgc2NvcGUuc2VsZWN0UHJldiA9IGZ1bmN0aW9uKCkgeworICAgICAgICAgICAgICAgIGlmICgoc2NvcGUuc2VsZWN0ZWRJbmRleCAtIDEpID49IDApIHsKKyAgICAgICAgICAgICAgICAgICAgc2NvcGUuc2VsZWN0ZWRJbmRleCAtPSAxOworICAgICAgICAgICAgICAgICAgICB2YXIgcHJldkRpc2FibGVkID0gc2NvcGUuY05hbWVbc2NvcGUuc2VsZWN0ZWRJbmRleF0uZGlzYWJsZWQ7CisgICAgICAgICAgICAgICAgICAgIGlmIChwcmV2RGlzYWJsZWQpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIHNjb3BlLnNlbGVjdGVkSW5kZXggLT0gMTsKKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICBpZiAoIXNjb3BlLnNob3dsaXN0KSB7CisgICAgICAgICAgICAgICAgICAgICAgICBzY29wZS5zZWxlY3RPcHRpb24oc2NvcGUuc2VsZWN0TXNnLCBzY29wZS5zZWxlY3RlZEluZGV4LGZhbHNlKTsKKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICBzY29wZS5mb2N1c21lKCk7CisgICAgICAgICAgICAgICAgICAgIHNjb3BlLiRhcHBseSgpOworICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAoc2NvcGUuc2VsZWN0ZWRJbmRleCAtIDEgPCAwKSB7CisgICAgICAgICAgICAgICAgICAgIC8vIElmIHBsYWNlaG9sZGVyQXNPcHRpb24gaXMgdHJ1ZSBvciB1bmRlZmluZWQgKGRlZmF1bHQpLCBlbnN1cmUgd2UgY2FuIHNlbGVjdCBpdCBvbiB1cCBrZXkuCisgICAgICAgICAgICAgICAgICAgIGlmIChhdHRyLnBsYWNlaG9sZGVyQXNPcHRpb24gPT09IHVuZGVmaW5lZCB8fCBhdHRyLnBsYWNlaG9sZGVyQXNPcHRpb24gPT09ICd0cnVlJykgeworICAgICAgICAgICAgICAgICAgICAgICAgaWYoYXR0ci5wbGFjZWhvbGRlciA9PT0gdW5kZWZpbmVkICl7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2NvcGUuc2VsZWN0ZWRJbmRleCA9IDA7CisgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICBlbHNleworICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNjb3BlLnNlbGVjdGVkSW5kZXggPSAtMTsKKyAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIHNjb3BlLnNlbGVjdGVkSW5kZXggPSAwOworICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgIGlmICghc2NvcGUuc2hvd2xpc3QpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIHNjb3BlLnNlbGVjdE9wdGlvbihzY29wZS5zZWxlY3RNc2csIHNjb3BlLnNlbGVjdGVkSW5kZXgsZmFsc2UpOworICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgIHNjb3BlLmZvY3VzbWUoKTsKKyAgICAgICAgICAgICAgICAgICAgc2NvcGUuJGFwcGx5KCk7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIHNjb3BlLnNldEN1cnJlbnRUb3AoKTsKKyAgICAgICAgICAgIH07CisgICAgICAgICAgICBzY29wZS51cGRhdGVTZWxlY3Rpb24gPSBmdW5jdGlvbihzSXRlbSkgeworICAgICAgICAgICAgICAgIHNjb3BlLnNlbGVjdGVkT3B0aW9uID0gc0l0ZW0udGl0bGU7CisgICAgICAgICAgICAgICAgc2NvcGUudGl0bGUgPSAnJzsKKworICAgICAgICAgICAgICAgIGlmIChzSXRlbS5pbmRleCA8IDApIHsKKyAgICAgICAgICAgICAgICAgICAgc2NvcGUuc2VsZWN0T3B0aW9uKHNjb3BlLnNlbGVjdE1zZywgc0l0ZW0uaW5kZXgsIHNjb3BlLnNob3dsaXN0KTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9OworICAgICAgICAgICAgc2NvcGUuZm9jdXNtZSA9IGZ1bmN0aW9uKCkgeworICAgICAgICAgICAgICAgICR0aW1lb3V0KGZ1bmN0aW9uKCkgeworICAgICAgICAgICAgICAgICAgICB2YXIgbGlzdCA9IGFuZ3VsYXIuZWxlbWVudChlbGVtZW50KS5maW5kKCd1bCcpLmZpbmQoJ2xpJyk7CisgICAgICAgICAgICAgICAgICAgIHZhciBpbmRleCA9IHNjb3BlLnNlbGVjdGVkSW5kZXggKyAyOworICAgICAgICAgICAgICAgICAgICBpZiAoc2NvcGUubm9GaWx0ZXIpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIGluZGV4ID0gc2NvcGUuc2VsZWN0ZWRJbmRleDsKKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICBpZiAoYW5ndWxhci5pc0RlZmluZWQobGlzdFtpbmRleF0pKSB7CisgICAgICAgICAgICAgICAgICAgICAgICB0cnkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxpc3RbaW5kZXhdLmZvY3VzKCk7CisgICAgICAgICAgICAgICAgICAgICAgICB9IGNhdGNoIChlKSB7fSAvKiBJRTggd2lsbCB0aHJvdyBleGNlcHRpb24gaWYgZGlzcGxheTpub25lIG9yIG5vdCBpbiBET00gKi8gIAorICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgfSk7CisgICAgICAgICAgICB9OworICAgICAgICAgICAgc2NvcGUuJHdhdGNoKCdzZWxDYXRlZ29yeScsIGZ1bmN0aW9uKHZhbHVlKSB7CisgICAgICAgICAgICAgICAgaWYgKHZhbHVlKSB7CisgICAgICAgICAgICAgICAgICAgIHNjb3BlLnVwZGF0ZVNlbGVjdGlvbih2YWx1ZSk7CisgICAgICAgICAgICAgICAgfTsKKyAgICAgICAgICAgIH0pOworICAgICAgICAgICAgY3RybC4kdmlld0NoYW5nZUxpc3RlbmVycy5wdXNoKGZ1bmN0aW9uKCkgeworICAgICAgICAgICAgICAgIHNjb3BlLiRldmFsKGF0dHIubmdDaGFuZ2UpOworICAgICAgICAgICAgfSk7CisgICAgICAgICAgICBjdHJsLiRyZW5kZXIgPSBmdW5jdGlvbigpIHsKKyAgICAgICAgICAgICAgICBzY29wZS5zZWxDYXRlZ29yeSA9IGN0cmwuJHZpZXdWYWx1ZTsKKyAgICAgICAgICAgIH07CisgICAgICAgICAgICB2YXIgb3V0c2lkZUNsaWNrID0gZnVuY3Rpb24oZSkgeworICAgICAgICAgICAgICAgIHZhciBpc0VsZW1lbnQgPSAkaXNFbGVtZW50KGFuZ3VsYXIuZWxlbWVudChlLnRhcmdldCksIGVsZW1lbnQsICRkb2N1bWVudCk7CisgICAgICAgICAgICAgICAgaWYgKCFpc0VsZW1lbnQpIHsKKyAgICAgICAgICAgICAgICAgICAgc2NvcGUuc2hvd2xpc3QgPSBmYWxzZTsKKyAgICAgICAgICAgICAgICAgICAgZHJvcGRvd25FbGVtZW50LmZvY3VzKCk7CisgICAgICAgICAgICAgICAgICAgIHNjb3BlLiRhcHBseSgpOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH07CisgICAgICAgICAgICAkZG9jdW1lbnRCaW5kLmNsaWNrKCdzaG93bGlzdCcsIG91dHNpZGVDbGljaywgc2NvcGUpOworICAgICAgICB9CisgICAgfTsKK31dKQorLmRpcmVjdGl2ZSgndGV4dERyb3Bkb3duJywgWyckZG9jdW1lbnQnLCAnJGlzRWxlbWVudCcsICckZG9jdW1lbnRCaW5kJywgImtleW1hcCIsIGZ1bmN0aW9uKCRkb2N1bWVudCwgJGlzRWxlbWVudCwgJGRvY3VtZW50QmluZCwga2V5bWFwKSB7CisgICAgcmV0dXJuIHsKKyAgICAgICAgcmVzdHJpY3Q6ICdFQScsCisgICAgICAgIHJlcGxhY2U6IHRydWUsCisgICAgICAgIHNjb3BlOiB7CisgICAgICAgICAgICBhY3Rpb25zOiAnPWFjdGlvbnMnLAorICAgICAgICAgICAgZGVmYXVsdEFjdGlvbjogJz1kZWZhdWx0QWN0aW9uJywKKyAgICAgICAgICAgIG9uQWN0aW9uQ2xpY2tlZDogJz0/JworICAgICAgICB9LAorIC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AgICAgICAgICAgaWYgKHNjb3BlLmFjdGlvbnNbYWN0XSA9PT0gc2NvcGUuZGVmYXVsdEFjdGlvbikgeworICAgICAgICAgICAgICAgICAgICAgICAgc2NvcGUuY3VycmVudEFjdGlvbiA9IHNjb3BlLmFjdGlvbnNbYWN0XTsKKyAgICAgICAgICAgICAgICAgICAgICAgIHNjb3BlLnNlbGVjdGVkSW5kZXggPSBzY29wZS5hY3Rpb25zLmluZGV4T2YoYWN0KTsKKyAgICAgICAgICAgICAgICAgICAgICAgIHNjb3BlLmlzQWN0aW9uc1Nob3duID0gZmFsc2U7CisgICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICAgICAgc2NvcGUuY3VycmVudEFjdGlvbiA9IHNjb3BlLmFjdGlvbnNbMF07CisgICAgICAgICAgICB9CisgICAgICAgICAgICBzY29wZS50b2dnbGUgPSBmdW5jdGlvbigpIHsKKyAgICAgICAgICAgICAgICBzY29wZS5pc0FjdGlvbnNTaG93biA9ICFzY29wZS5pc0FjdGlvbnNTaG93bjsKKyAgICAgICAgICAgIH07CisgICAgICAgICAgICBzY29wZS5jaG9vc2VBY3Rpb24gPSBmdW5jdGlvbigkZXZlbnQsIGFjdGlvbiwgJGluZGV4KSB7CisgICAgICAgICAgICAgICAgaWYgKCRldmVudCAhPSBudWxsKSB7CisgICAgICAgICAgICAgICAgICAgIHNjb3BlLmN1cnJlbnRBY3Rpb24gPSBhY3Rpb247CisgICAgICAgICAgICAgICAgICAgIHNjb3BlLnNlbGVjdGVkSW5kZXggPSAkaW5kZXg7CisgICAgICAgICAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgICAgICAgICAgc2NvcGUuY3VycmVudEFjdGlvbiA9IHNjb3BlLmFjdGlvbnNbc2NvcGUuc2VsZWN0ZWRJbmRleF07CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIGlmIChhbmd1bGFyLmlzRnVuY3Rpb24oc2NvcGUub25BY3Rpb25DbGlja2VkKSkgeworICAgICAgICAgICAgICAgICAgICBzY29wZS5vbkFjdGlvbkNsaWNrZWQoc2NvcGUuY3VycmVudEFjdGlvbik7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIHNjb3BlLnRvZ2dsZSgpOworICAgICAgICAgICAgfTsKKyAgICAgICAgICAgIHNjb3BlLmlzQ3VycmVudEFjdGlvbiA9IGZ1bmN0aW9uKGFjdGlvbikgeworICAgICAgICAgICAgICAgIHJldHVybiAoYWN0aW9uID09PSBzY29wZS5jdXJyZW50QWN0aW9uKTsKKyAgICAgICAgICAgIH07CisgICAgICAgICAgICBlbGVtZW50LmJpbmQoImtleWRvd24iLCBmdW5jdGlvbihlKSB7CisgICAgICAgICAgICAgICAgaWYgKGtleW1hcC5pc0FsbG93ZWRLZXkoZS5rZXlDb2RlKSB8fCBrZXltYXAuaXNDb250cm9sKGUpIHx8IGtleW1hcC5pc0Z1bmN0aW9uS2V5KGUpKSB7CisgICAgICAgICAgICAgICAgICAgIGUucHJldmVudERlZmF1bHQoKTsKKyAgICAgICAgICAgICAgICAgICAgZS5zdG9wUHJvcGFnYXRpb24oKTsKKyAgICAgICAgICAgICAgICAgICAgc3dpdGNoIChlLmtleUNvZGUpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIGNhc2Uga2V5bWFwLktFWS5ET1dOOgorICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNjb3BlLnNlbGVjdE5leHQoKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICAgICAgICAgIGNhc2Uga2V5bWFwLktFWS5VUDoKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBzY29wZS5zZWxlY3RQcmV2KCk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgICAgICAgICBjYXNlIGtleW1hcC5LRVkuRU5URVI6CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2NvcGUuc2VsZWN0Q3VycmVudCgpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgICAgICAgICAgY2FzZSBrZXltYXAuS0VZLkVTQzoKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBzY29wZS5pc0FjdGlvbnNTaG93biA9IGZhbHNlOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRyb3Bkb3duRWxlbWVudC5mb2N1cygpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNjb3BlLiRhcHBseSgpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgICAgICAgICAgZGVmYXVsdDoKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICBzY29wZS4kYXBwbHkoKTsKKyAgICAgICAgICAgICAgICAgICAgcmV0dXJuOworICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAoZS5rZXlDb2RlID09PSBrZXltYXAuS0VZLlRBQikgeworICAgICAgICAgICAgICAgICAgICBzY29wZS5pc0FjdGlvbnNTaG93biA9IGZhbHNlOworICAgICAgICAgICAgICAgICAgICBzY29wZS4kYXBwbHkoKTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9KTsKKyAgICAgICAgICAgIHNjb3BlLnNlbGVjdEN1cnJlbnQgPSBmdW5jdGlvbigpIHsKKyAgICAgICAgICAgICAgICBpZiAoc2NvcGUuc2VsZWN0ZWRJbmRleCA8IDApIHsKKyAgICAgICAgICAgICAgICAgICAgc2NvcGUuc2VsZWN0ZWRJbmRleCA9IDA7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIGlmICghc2NvcGUuaXNBY3Rpb25zU2hvd24pIHsKKyAgICAgICAgICAgICAgICAgICAgc2NvcGUudG9nZ2xlKCk7CisgICAgICAgICAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgICAgICAgICAgc2NvcGUuY2hvb3NlQWN0aW9uKG51bGwsIHNjb3BlLmN1cnJlbnRBY3Rpb24pOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH07CisgICAgICAgICAgICBzY29wZS5zZWxlY3ROZXh0ID0gZnVuY3Rpb24oKSB7CisgICAgICAgICAgICAgICAgaWYgKHNjb3BlLmlzQWN0aW9uc1Nob3duKSB7CisgICAgICAgICAgICAgICAgICAgIGlmICgoc2NvcGUuc2VsZWN0ZWRJbmRleCArIDEpIDwgc2NvcGUuYWN0aW9ucy5sZW5ndGgpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIHNjb3BlLnNlbGVjdGVkSW5kZXggKz0gMTsKKyAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIHNjb3BlLnNlbGVjdGVkSW5kZXggPSAoc2NvcGUuYWN0aW9ucy5sZW5ndGggLSAxKTsKKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICBzY29wZS4kYXBwbHkoKTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9OworICAgICAgICAgICAgc2NvcGUuc2VsZWN0UHJldiA9IGZ1bmN0aW9uKCkgeworICAgICAgICAgICAgICAgIGlmIChzY29wZS5pc0FjdGlvbnNTaG93bikgeworICAgICAgICAgICAgICAgICAgICBpZiAoKHNjb3BlLnNlbGVjdGVkSW5kZXggLSAxKSA+PSAwKSB7CisgICAgICAgICAgICAgICAgICAgICAgICBzY29wZS5zZWxlY3RlZEluZGV4IC09IDE7CisgICAgICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAoc2NvcGUuc2VsZWN0ZWRJbmRleCAtIDEgPCAwKSB7CisgICAgICAgICAgICAgICAgICAgICAgICBzY29wZS5zZWxlY3RlZEluZGV4ID0gMDsKKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICBzY29wZS4kYXBwbHkoKTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9OworICAgICAgICAgICAgc2NvcGUuaG92ZXJJbiA9IGZ1bmN0aW9uKGNJdGVtKSB7CisgICAgICAgICAgICAgICAgc2NvcGUuc2VsZWN0ZWRJbmRleCA9IGNJdGVtOworICAgICAgICAgICAgfTsKKyAgICAgICAgICAgIC8vZW5kIGNhdG8KKyAgICAgICAgICAgIHZhciBvdXRzaWRlQ2xpY2sgPSBmdW5jdGlvbihlKSB7CisgICAgICAgICAgICAgICAgdmFyIGlzRWxlbWVudCA9ICRpc0VsZW1lbnQoYW5ndWxhci5lbGVtZW50KGUudGFyZ2V0KSwgZWxlbWVudCwgJGRvY3VtZW50KTsKKyAgICAgICAgICAgICAgICBpZiAoIWlzRWxlbWVudCkgeworICAgICAgICAgICAgICAgICAgICBzY29wZS50b2dnbGUoKTsKKyAgICAgICAgICAgICAgICAgICAgc2NvcGUuJGFwcGx5KCk7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfTsKKyAgICAgICAgICAgICRkb2N1bWVudEJpbmQuY2xpY2soJ2lzQWN0aW9uc1Nob3duJywgb3V0c2lkZUNsaWNrLCBzY29wZSk7CisgICAgICAgIH0KKyAgICB9OworfV0pOworYW5ndWxhci5tb2R1bGUoJ2F0dC5hYnMuc2xpZGVyJywgWydhdHQuYWJzLnBvc2l0aW9uJ10pCisgICAgICAgIC5jb25zdGFudCgnc2xpZGVyRGVmYXVsdE9wdGlvbnMnLCB7CisgICAgICAgICAgICB3aWR0aDogMzAwLAorICAgICAgICAgICAgc3RlcDogMSwKKyAgICAgICAgICAgIHByZWNpc2lvbjogMCwKKyAgICAgICAgICAgIGRpc2FibGVkV2lkdGg6IDExNgorICAgICAgICB9KQorICAgICAgICAuZGlyZWN0aXZlKCdhdHRTbGlkZXInLCBbJ3NsaWRlckRlZmF1bHRPcHRpb25zJywnJHBvc2l0aW9uJywnJGRvY3VtZW50JywgZnVuY3Rpb24oc2xpZGVyRGVmYXVsdE9wdGlvbnMsJHBvc2l0aW9uLCRkb2N1bWVudCkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICByZXR1cm4geworICAgICAgICAgICAgICAgICAgICByZXN0cmljdDogJ0VBJywKKyAgICAgICAgICAgICAgICAgICAgcmVwbGFjZTogdHJ1ZSwKKyAgICAgICAgICAgICAgICAgICAgdHJhbnNjbHVkZTogdHJ1ZSwKKyAgICAgICAgICAgICAgICAgICAgc2NvcGU6IHsKKyAgICAgICAgICAgICAgICAgICAgICAgIGZsb29yOiAiPSIsCisgICAgICAgICAgICAgICAgICAgICAgICBjZWlsaW5nOiAiPSIsCisgICAgICAgICAgICAgICAgICAgICAgICBzdGVwOiAiQCIsCisgICAgICAgICAgICAgICAgICAgICAgICBwcmVjaXNpb246ICJAIiwKKyAgICAgICAgICAgICAgICAgICAgICAgIHdpZHRoOiAiQCIsCisgICAgICAgICAgICAgICAgICAgICAgICB0ZXh0RGlzcGxheTogIj0iLAorICAgICAgICAgICAgICAgICAgICAgICAgdmFsdWU6ICI9IiwKKyAgICAgICAgICAgICAgICAgICAgICAgIG5nTW9kZWxTaW5nbGU6ICc9PycsCisgICAgICAgICAgICAgICAgICAgICAgICBuZ01vZGVsTG93OiAnPT8nLAorICAgICAgICAgICAgICAgICAgICAgICAgbmdNb2RlbEhpZ2g6ICc9PycsCisgICAgICAgICAgICAgICAgICAgICAgICBuZ01vZGVsRGlzYWJsZWQ6ICc9PycKKyAgICAgICAgICAgICAgICAgICAgfSwKKyAgICAgICAgICAgICAgICAgICAgdGVtcGxhdGVVcmw6ICdhcHAvc2NyaXB0cy9uZ19qc19hdHRfdHBscy9zbGlkZXIvc2xpZGVyLmh0bWwnLAorICAgICAgICAgICAgICAgICAgICBsaW5rOiBmdW5jdGlvbihzY29wZSwgZWxlbSwgYXR0cikKKyAgICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAgICAgdmFyIG1pbk9mZnNldCwgbWF4T2Zmc2V0LCBuZXdPZmZzZXQsIG5ld09mZnNldDEsIG5ld09mZnNldDIsIG9mZnNldFJhbmdlLCB2YWx1ZVJhbmdlLCBzdGFydF94ID0gMCwgZGlzYWJsZWRSYW5nZSwgZGlzYWJsZWQsIGV2RmxhZyA9IGZhbHNlLCBtaW5WYWx1ZSwgbWF4VmFsdWUsIHJhbmdlLCByZWZMb3csIHJlZkhpZ2gsIG1heFB0ciwgbWluUHRyLCBzaW5nbGVQdHIsIGdldEhhbmRsZXM7CisgICAgICAgICAgICAgICAgICAgICAgICBzY29wZS5taW5QdHJPZmZzZXQgPSAwOworICAgICAgICAgICAgICAgICAgICAgICAgc2NvcGUubWF4UHRyT2Zmc2V0ID0gMDsKKyAgICAgICAgICAgICAgICAgICAgICAgIHZhciBkaXNhYmxlV2lkdGggPSBzbGlkZXJEZWZhdWx0T3B0aW9ucy5kaXNhYmxlZFdpZHRoOworICAgICAgICAgICAgICAgICAgICAgICAgLy9HZXQgaGFuZGxlcworICAgICAgICAgICAgICAgICAgICAgICAgdmFyIG9iaiA9IGVsZW0uY2hpbGRyZW4oKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIGRpc2FibGVkUmFuZ2UgPSBvYmpbMF0uY2hpbGRyZW47CisgICAgICAgICAgICAgICAgICAgICAgICBkaXNhYmxlZFJhbmdlID0gYW5ndWxhci5lbGVtZW50KGRpc2FibGVkUmFuZ2VbMF0pOworICAgICAgICAgICAgICAgICAgICAgICAgZ2V0SGFuZGxlcyA9IG9ialsxXS5jaGlsZHJlbjsKKyAgICAgICAgICAgICAgICAgICAgICAgIHNpbmdsZVB0ciA9IGFuZ3VsYXIuZWxlbWVudChnZXRIYW5kbGVzWzBdKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIG1pblB0ciA9IGFuZ3VsYXIuZWxlbWVudChnZXRIYW5kbGVzWzFdKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIG1heFB0ciA9IGFuZ3VsYXIuZWxlbWVudChnZXRIYW5kbGVzWzJdKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIGRpc2FibGVkID0gKChhdHRyLm5nTW9kZWxTaW5nbGUgPT0gbnVsbCkgJiYgKGF0dHIubmdNb2RlbExvdyA9PSBudWxsKSAmJiAoYXR0ci5uZ01vZGVsSGlnaCA9PSBudWxsKSkgJiYgKGF0dHIubmdNb2RlbERpc2FibGVkICE9IG51bGwpOworICAgICAgICAgICAgICAgICAgICAgICAgcmFuZ2UgPSAoYXR0ci5uZ01vZGVsU2luZ2xlID09IG51bGwpICYmICgoYXR0ci5uZ01vZGVsTG93ICE9IG51bGwpICYmIChhdHRyLm5nTW9kZWxIaWdoICE9IG51bGwpKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIHJlZkxvdyA9ICduZ01vZGVsTG93JzsKKyAgICAgICAgICAgICAgICAgICAgICAgIHJlZkhpZ2ggPSAnbmdNb2RlbEhpZ2gnOworICAgICAgICAgICAgICAgICAgICAgICAgaWYgKCFyYW5nZSkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1pblB0ci5yZW1vdmUoKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBtYXhQdHIucmVtb3ZlKCk7CisgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICBlbHNlIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBzaW5nbGVQdHIucmVtb3ZlKCk7CisgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICBpZiAoIWRpc2FibGVkKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgZGlzYWJsZWRSYW5nZS5yZW1vdmUoKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgIGVsc2UgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNjb3BlLmRpc2FibGVkU3R5bGUgPSB7d2lkdGg6IGRpc2FibGVXaWR0aCArICdweCcsIHpJbmRleDogMX07CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2NvcGUuaGFuZGxlU3R5bGUgPSB7bGVmdDogZGlzYWJsZVdpZHRoICsgJ3B4J307CisgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICBtaW5WYWx1ZSA9IHBhcnNlRmxvYXQoc2NvcGUuZmxvb3IpOworICAgICAgICAgICAgICAgICAgICAgICAgbWF4VmFsdWUgPSBwYXJzZUZsb2F0KHNjb3BlLmNlaWxpbmcpOworICAgICAgICAgICAgICAgICAgICAgICAgdmFsdWVSYW5nZSA9IG1heFZhbHVlIC0gbWluVmFsdWU7CisgICAgICAgICAgICAgICAgICAgICAgICBtaW5PZmZzZXQgPSAwOworICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGF0dHIud2lkdGggIT09IHVuZGVmaW5lZCkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1heE9mZnNldCA9IGF0dHIud2lkdGg7CisgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICBlbHNlIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoZWxlbVswXS5jbGllbnRXaWR0aCAhPT0gMCkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBtYXhPZmZzZXQgPSBlbGVtWzBdLmNsaWVudFdpZHRoOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBlbHNlIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbWF4T2Zmc2V0ID0gc2xpZGVyRGVmYXVsdE9wdGlvbnMud2lkdGg7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgb2Zmc2V0UmFuZ2UgPSBtYXhPZmZzZXQgLSBtaW5PZmZzZXQ7CisgICAgICAgICAgICAgICAgICAgICAgICAvL0tleSBEb3duIEV2ZW50CisgICAgICAgICAgICAgICAgICAgICAgICAgc2NvcGUua2V5RG93biA9IGZ1bmN0aW9uKGV2KXsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZihldi5rZXlDb2RlID09PSAzOSl7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhciBlbGVtTGVmdCA9ICRwb3NpdGlvbi5wb3NpdGlvbihlbGVtKS5sZWZ0OworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAobmV3T2Zmc2V0KXsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmKHNjb3BlLnJlZiA9PT0gIm5nTW9kZWxMb3ciKXsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBuZXdPZmZzZXQxID0gc2xpZGVyRGVmYXVsdE9wdGlvbnMuc3RlcCArIG5ld09mZnNldDE7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbmV3T2Zmc2V0ID0gbmV3T2Zmc2V0MTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGVsc2UgaWYoc2NvcGUucmVmID09PSAibmdNb2RlbEhpZ2giKXsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBuZXdPZmZzZXQyID0gc2xpZGVyRGVmYXVsdE9wdGlvbnMuc3RlcCArIG5ld09mZnNldDI7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbmV3T2Zmc2V0ID0gbmV3T2Zmc2V0MjsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGVsc2V7bmV3T2Zmc2V0ID0gc2xpZGVyRGVmYXVsdE9wdGlvbnMuc3RlcCArIG5ld09mZnNldDt9CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZWxzZSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZihyYW5nZSAmJnNjb3BlLnJlZiA9PT0gIm5nTW9kZWxMb3ciKXsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm47CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBlbHNlIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBuZXdPZmZzZXQgPSBzbGlkZXJEZWZhdWx0T3B0aW9ucy5zdGVwICsgZWxlbUxlZnQ7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbmV3T2Zmc2V0MSA9IG5ld09mZnNldDIgPSBuZXdPZmZzZXQ7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgICAgIGVsc2UgaWYoZXYua2V5Q29kZSA9PT0gMzcpeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YXIgcHRyTGVmdCA9ICRwb3NpdGlvbi5wb3NpdGlvbihzaW5nbGVQdHIpLmxlZnQ7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmKG5ld09mZnNldCl7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICghKG5ld09mZnNldDw9MCkpeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYoc2NvcGUucmVmID09PSAibmdNb2RlbExvdyIpeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG5ld09mZnNldDEgPSBuZXdPZmZzZXQxIC0gc2xpZGVyRGVmYXVsdE9wdGlvbnMuc3RlcDsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBuZXdPZmZzZXQgPSBuZXdPZmZzZXQxOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZWxzZSBpZihzY29wZS5yZWYgPT09ICJuZ01vZGVsSGlnaCIpeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG5ld09mZnNldDIgPSBuZXdPZmZzZXQyIC0gc2xpZGVyRGVmYXVsdE9wdGlvbnMuc3RlcDsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBuZXdPZmZzZXQgPSBuZXdPZmZzZXQyOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZWxzZSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbmV3T2Zmc2V0ID0gbmV3T2Zmc2V0IC0gc2xpZGVyRGVmYXVsdE9wdGlvbnMuc3RlcDsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBuZXdPZmZzZXQxID0gbmV3T2Zmc2V0MiA9IG5ld09mZnNldDsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGVsc2UgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbmV3T2Zmc2V0ID0gcHRyTGVmdCAtIHNsaWRlckRlZmF1bHRPcHRpb25zLnN0ZXA7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmKG5ld09mZnNldD49MCl7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNjb3BlLnB0ck9mZnNldChuZXdPZmZzZXQpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgIH07CisgICAgICAgICAgICAgICAgICAgICAgICAvL01vdXNlIERvd24gRXZlbnQgICAgICAgICAgICAgICAgICAgICAgICAgCisgICAgICAgICAgICAgICAgICAgICAgICBzY29wZS5tb3VzZURvd24gPSBmdW5jdGlvbihlLCByZWYpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBzY29wZS5yZWYgPSByZWY7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgZXZGbGFnID0gdHJ1ZTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoIXJhbmdlKXsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKG5ld09mZnNldCkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc3RhcnRfeCA9IGUuY2xpZW50WCAtIG5ld09mZnNldDsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBlbHNlIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHN0YXJ0X3ggPSBlLmNsaWVudFg7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoc2NvcGUucmVmID09PSByZWZMb3cpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHN0YXJ0X3ggPSBlLmNsaWVudFggLSBzY29wZS5taW5QdHJPZmZzZXQ7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZWxzZSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzdGFydF94ID0gZS5jbGllbnRYIC0gc2NvcGUubWF4UHRyT2Zmc2V0OworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChkaXNhYmxlZCkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzY29wZS5yZWY9ICduZ01vZGVsRGlzYWJsZWQnOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzY29wZS5kaXNhYmxlZFN0eWxlID0ge3dpZHRoOiBkaXNhYmxlV2lkdGggKyAncHgnLCB6SW5kZXg6IDF9OworICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgIH07CisgICAgICAgICAgICAgICAgICAgICAgICAvLyBNb3VzZSBNb3ZlIEV2ZW50CisgICAgICAgICAgICAgICAgICAgICAgICBzY29wZS5tb3ZlRWxlbSA9IGZ1bmN0aW9uKGV2KSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGV2RmxhZykgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YXIgZXZlbnRYOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBldmVudFggPSBldi5jbGllbnRYOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBuZXdPZmZzZXQgPSBldmVudFggLSBzdGFydF94OworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzY29wZS5wdHJPZmZzZXQobmV3T2Zmc2V0KTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICB9OworICAgICAgICAgICAgICAgICAgICAgICAgc2NvcGUuZm9jdXM9ZnVuY3Rpb24oZXYscmVmKXsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb25zb2xlLmxvZyhyZWYpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNjb3BlLnJlZj1yZWY7CisgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICAvLyBNb3VzZSBVcCBFdmVudAorICAgICAgICAgICAgICAgICAgICAgICAgc2NvcGUubW91c2VVcCA9IGZ1bmN0aW9uKGV2KSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgZXZGbGFnID0gZmFsc2U7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgbWluUHRyLnJlbW92ZUNsYXNzKCdkcmFnZ2luZycpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1heFB0ci5yZW1vdmVDbGFzcygnZHJhZ2dpbmcnKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBzaW5nbGVQdHIucmVtb3ZlQ2xhc3MoJ2RyYWdnaW5nJyk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgJGRvY3VtZW50Lm9mZignbW91c2Vtb3ZlJyk7CisgICAgICAgICAgICAgICAgICAgICAgICB9OworICAgICAgICAgICAgICAgICAgICAgICAgLy8ga2V5IFVwIEV2ZW50CisgICAgICAgICAgICAgICAgICAgICAgICBzY29wZS5rZXlVcCA9IGZ1bmN0aW9uKGV2KSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgZXZGbGFnID0gZmFsc2U7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgbWluUHRyLnJlbW92ZUNsYXNzKCdkcmFnZ2luZycpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1heFB0ci5yZW1vdmVDbGFzcygnZHJhZ2dpbmcnKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBzaW5nbGVQdHIucmVtb3ZlQ2xhc3MoJ2RyYWdnaW5nJyk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgJGRvY3VtZW50Lm9mZignbW91c2Vtb3ZlJyk7CisgICAgICAgICAgICAgICAgICAgICAgICB9OworICAgICAgICAgICAgICAgICAgICAgICAgLy9GdW5jdGlvbiB0byBjYWxjdWxhdGUgdGhlIGN1cnJlbnQgUG9zaXRpb25WYWx1ZQorICAgICAgICAgICAgICAgICAgICAgICAgc2NvcGUuY2FsU3RlcCA9IGZ1bmN0aW9uKHZhbHVlLCBwcmVjaXNpb24sIHN0ZXAsIGZsb29yKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFyIGRlY2ltYWxzLCByZW1haW5kZXIsIHJvdW5kZWRWYWx1ZSwgc3RlcHBlZFZhbHVlOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChmbG9vciA9PT0gbnVsbCkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBmbG9vciA9IDA7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChzdGVwID09PSBudWxsKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHN0ZXAgPSAxIC8gTWF0aC5wb3coMTAsIHByZWNpc2lvbik7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJlbWFpbmRlciA9ICh2YWx1ZSAtIGZsb29yKSAlIHN0ZXA7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgc3RlcHBlZFZhbHVlID0gcmVtYWluZGVyID4gKHN0ZXAgLyAyKSA/IHZhbHVlICsgc3RlcCAtIHJlbWFpbmRlciA6IHZhbHVlIC0gcmVtYWluZGVyOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRlY2ltYWxzID0gTWF0aC5wb3coMTAsIHByZWNpc2lvbik7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgcm91bmRlZFZhbHVlID0gc3RlcHBlZFZhbHVlICogZGVjaW1hbHMgLyBkZWNpbWFsczsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gcm91bmRlZFZhbHVlLnRvRml4ZWQocHJlY2lzaW9uKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIH07CisgICAgICAgICAgICAgICAgICAgICAgICAvL0Z1bmN0aW9uIHRvIGNhbGN1bGF0ZSBPZmZzZXQgUGVyY2VudAorICAgICAgICAgICAgICAgICAgICAgICAgc2NvcGUucGVyY2VudE9mZnNldCA9IGZ1bmN0aW9uKG9mZnNldCkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiAoKG9mZnNldCAtIG1pbk9mZnNldCkgLyBvZmZzZXRSYW5nZSkgKiAxMDA7CisgICAgICAgICAgICAgICAgICAgICAgICB9OworICAgICAgICAgICAgICAgICAgICAgICAgLy9GdW5jdGlvbiB0byBjYWxjdWxhdGUgT2Zmc2V0IHBvc2l0aW9uCisgICAgICAgICAgICAgICAgICAgICAgICBzY29wZS5wdHJPZmZzZXQgPSBmdW5jdGlvbihuZXdPZmZzZXQpeworICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhciBuZXdQZXJjZW50LCBuZXdWYWx1ZTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbmV3T2Zmc2V0ID0gTWF0aC5tYXgoTWF0aC5taW4obmV3T2Zmc2V0LCBtYXhPZmZzZXQpLCBtaW5PZmZzZXQpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBuZXdQZXJjZW50ID0gc2NvcGUucGVyY2VudE9mZnNldChuZXdPZmZzZXQpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBuZXdWYWx1ZSA9IG1pblZhbHVlICsgKHZhbHVlUmFuZ2UgKiBuZXdQZXJjZW50IC8gMTAwLjApOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAocmFuZ2UpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhciByYW5nZVNsaWRlcldpZHRoOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHNjb3BlLnJlZiA9PT0gcmVmTG93KSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2NvcGUubWluSGFuZGxlU3R5bGUgPSB7bGVmdDogbmV3T2Zmc2V0ICsgInB4In07CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2NvcGUubWluTmV3VmFsID0gbmV3VmFsdWU7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2NvcGUubWluUHRyT2Zmc2V0ID0gbmV3T2Zmc2V0OworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1pblB0ci5hZGRDbGFzcygnZHJhZ2dpbmcnKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAobmV3VmFsdWUgPiBzY29wZS5tYXhOZXdWYWwpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2NvcGUucmVmID0gcmVmSGlnaDsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbWF4UHRyWzBdLmZvY3VzKCk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNjb3BlLm1heE5ld1ZhbCA9IG5ld1ZhbHVlOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzY29wZS5tYXhQdHJPZmZzZXQgPSBuZXdPZmZzZXQ7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1heFB0ci5hZGRDbGFzcygnZHJhZ2dpbmcnKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbWluUHRyLnJlbW92ZUNsYXNzKCdkcmFnZ2luZycpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzY29wZS5tYXhIYW5kbGVTdHlsZSA9IHtsZWZ0OiBuZXdPZmZzZXQgKyAicHgifTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBlbHNlIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzY29wZS5tYXhIYW5kbGVTdHlsZSA9IHtsZWZ0OiBuZXdPZmZzZXQgKyAicHgifTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzY29wZS5tYXhOZXdWYWwgPSBuZXdWYWx1ZTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzY29wZS5tYXhQdHJPZmZzZXQgPSBuZXdPZmZzZXQ7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbWF4UHRyLmFkZENsYXNzKCdkcmFnZ2luZycpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChuZXdWYWx1ZSA8IHNjb3BlLm1pbk5ld1ZhbCkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzY29wZS5yZWYgPSByZWZMb3c7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1pblB0clswXS5mb2N1cygpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzY29wZS5taW5WYWwgPSBuZXdWYWx1ZTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2NvcGUubWluUHRyT2Zmc2V0ID0gbmV3T2Zmc2V0OworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBtaW5QdHIuYWRkQ2xhc3MoJ2RyYWdnaW5nJyk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1heFB0ci5yZW1vdmVDbGFzcygnZHJhZ2dpbmcnKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2NvcGUubWluSGFuZGxlU3R5bGUgPSB7bGVmdDogbmV3T2Zmc2V0ICsgInB4In07CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmFuZ2VTbGlkZXJXaWR0aCA9IHBhcnNlSW50KHNjb3BlLm1heFB0ck9mZnNldCkgLSBwYXJzZUludChzY29wZS5taW5QdHJPZmZzZXQpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2NvcGUucmFuZ2VTdHlsZSA9IHt3aWR0aDogcmFuZ2VTbGlkZXJXaWR0aCArICJweCIsIGxlZnQ6IHNjb3BlLm1pblB0ck9mZnNldCArICJweCJ9OworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGVsc2UgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGRpc2FibGVkICYmIG5ld09mZnNldCA+IGRpc2FibGVXaWR0aCkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNjb3BlLnJhbmdlU3R5bGUgPSB7d2lkdGg6IG5ld09mZnNldCArICJweCIsIHpJbmRleDogMH07CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBlbHNlIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzaW5nbGVQdHIuYWRkQ2xhc3MoJ2RyYWdnaW5nJyk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2NvcGUucmFuZ2VTdHlsZSA9IHt3aWR0aDogbmV3T2Zmc2V0ICsgInB4In07CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzY29wZS5oYW5kbGVTdHlsZSA9IHtsZWZ0OiBuZXdPZmZzZXQgKyAicHgifTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoKHNjb3BlLnByZWNpc2lvbiA9PT0gdW5kZWZpbmVkKSB8fCAoc2NvcGUuc3RlcCA9PT0gdW5kZWZpbmVkKSkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2NvcGUucHJlY2lzaW9uID0gc2xpZGVyRGVmYXVsdE9wdGlvbnMucHJlY2lzaW9uOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2NvcGUuc3RlcCA9IHNsaWRlckRlZmF1bHRPcHRpb25zLnN0ZXA7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbmV3VmFsdWUgPSBzY29wZS5jYWxTdGVwKG5ld1ZhbHVlLCBwYXJzZUludChzY29wZS5wcmVjaXNpb24pLCBwYXJzZUZsb2F0KHNjb3BlLnN0ZXApLCBwYXJzZUZsb2F0KHNjb3BlLmZsb29yKSk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNjb3BlW3Njb3BlLnJlZl0gPSBuZXdWYWx1ZTsKKyAgICAgICAgICAgICAgICAgICAgICAgIH07CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICB9OworICAgICAgICAgICAgfQorICAgICAgICBdKS5kaXJlY3RpdmUoJ2F0dFNsaWRlck1pbicsW2Z1bmN0aW9uKCkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICByZXR1cm57CisgICAgICAgICAgICAgICAgIHJlcXVpcmU6ICdeYXR0U2xpZGVyJywKKyAgICAgICAgICAgICAgICAgcmVzdHJpY3Q6ICdFQScsCisgICAgICAgICAgICAgICAgIHJlcGxhY2U6IHRydWUsCisgICAgICAgICAgICAgICAgIHRyYW5zY2x1ZGU6IHRydWUsCisgICAgICAgICAgICAgICAgIHRlbXBsYXRlVXJsOiAnYXBwL3NjcmlwdHMvbmdfanNfYXR0X3RwbHMvc2xpZGVyL21pbkNvbnRlbnQuaHRtbCcKKyAgICAgICAgICAgICAgIH07CisgICAgICAgICB9CisgICAgXSkuZGlyZWN0aXZlKCdhdHRTbGlkZXJNYXgnLFtmdW5jdGlvbigpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgcmV0dXJueworICAgICAgICAgICAgICAgICByZXF1aXJlOiAnXmF0dFNsaWRlcicsCisgICAgICAgICAgICAgICAgIHJlc3RyaWN0OiAnRUEnLAorICAgICAgICAgICAgICAgICByZXBsYWNlOiB0cnVlLAorICAgICAgICAgICAgICAgICB0cmFuc2NsdWRlOiB0cnVlLAorICAgICAgICAgICAgICAgICB0ZW1wbGF0ZVVybDogJ2FwcC9zY3JpcHRzL25nX2pzX2F0dF90cGxzL3NsaWRlci9tYXhDb250ZW50Lmh0bWwnCisgICAgICAgICAgICAgfTsKKyAgICAgICAgIH0KKyAgICBdKTsKK2FuZ3VsYXIubW9kdWxlKCdhdHQuYWJzLnNwbGl0QnV0dG9uRHJvcGRvd24nLCBbJ2F0dC5hYnMudXRpbGl0aWVzJywnYXR0LmFicy5wb3NpdGlvbiddKQorICAgIC5kaXJlY3RpdmUoJ2F0dEJ1dHRvbkRyb3Bkb3duJywgWyckZG9jdW1lbnQnLCAnJHBhcnNlJywgJyRkb2N1bWVudEJpbmQnLCAnJHRpbWVvdXQnLCckaXNFbGVtZW50JywgZnVuY3Rpb24gKCRkb2N1bWVudCwgJHBhcnNlLCAkZG9jdW1lbnRCaW5kLCAkdGltZW91dCwkaXNFbGVtZW50KSB7CisgICAgICAgIHJldHVybiB7CisgICAgICAgICAgICByZXN0cmljdDogJ0VBJywKKyAgICAgICAgICAgIHJlcGxhY2U6IHRydWUsCisgICAgICAgICAgICB0cmFuc2NsdWRlOiB0cnVlLCAgICAgICAgICAgIAorICAgICAgICAgICAgdGVtcGxhdGVVcmw6ICdhcHAvc2NyaXB0cy9uZ19qc19hdHRfdHBscy9zcGxpdEJ1dHRvbkRyb3Bkb3duL3NwbGl0QnV0dG9uRHJvcGRvd24uaHRtbCcsCisgICAgICAgICAgICBzY29wZTogeworICAgICAgICAgICAgICAgIGJ0blRleHQ6ICJAIiwKKyAgICAgICAgICAgICAgICBidG5UeXBlOiAiQCIsCisgICAgICAgICAgICAgICAgYnRuTGluazogIkAiLAorICAgICAgICAgICAgICAgIGJ0bkNsaWNrOiAiJiIsCisgICAgICAgICAgICAgICAgdG9nZ2xlVGl0bGU6IkAiLCAgICAgICAgICAgICAgICAKKyAgICAgICAgICAgIH0sCisgICAgICAgICAgICBjb250cm9sbGVyOiBbJyRzY29wZScsICckZWxlbWVudCcsIGZ1bmN0aW9uICgkc2NvcGUsICRlbGVtZW50KSB7CisgICAgICAgICAgICAgICAgICAgIAorICAgICAgICAgICAgICAgIHRoaXMuY1NlbGVjdGVkID0gMDsgICAgCisgICAgICAgICAgICAgICAgdGhpcy5jbG9zZUFuZEZvY3VzRHJvcGRvd24gPSBmdW5jdGlvbiAoKSB7CisgICAgICAgICAgICAgICAgICAgIGlmICgkc2NvcGUuaXNEcm9wRG93bk9wZW4pIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICRzY29wZS4kYXBwbHkoZnVuY3Rpb24gKCkgeworICAgICAgICAgICAgICAgICAgICAgICAgJHNjb3BlLmlzRHJvcERvd25PcGVuID0gZmFsc2U7CisgICAgICAgICAgICAgICAgICAgICAgICBhbmd1bGFyLmVsZW1lbnQoJGVsZW1lbnRbMF0ucXVlcnlTZWxlY3RvcignYS5kcm9wZG93bi10b2dnbGUnKSlbMF0uZm9jdXMoKTsgICAgICAgICAgICAgICAgICAgICAgICAKKyAgICAgICAgICAgICAgICAgICAgICAgIH0pOworICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgfTsgICAgICAgICAgICAgCisgICAgICAgICAgICAgICAgCisgICAgICAgICAgICAgICAgdGhpcy5mb2N1c05leHQgPSBmdW5jdGlvbiAoKSB7ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKKyAgICAgICAgICAgICAgICAgICAgdGhpcy5jU2VsZWN0ZWQgPSB0aGlzLmNTZWxlY3RlZCArIDEgPj0gdGhpcy5jaGlsZFNjb3Blcy5sZW5ndGggPygkc2NvcGUuY3ljbGVTZWxlY3Rpb24gPT09IHRydWUgPyAwIDogdGhpcy5jaGlsZFNjb3Blcy5sZW5ndGgtMSk6IHRoaXMuY1NlbGVjdGVkICsxOworICAgICAgICAgICAgICAgICAgICB0aGlzLmNoaWxkU2NvcGVzW3RoaXMuY1NlbGVjdGVkXS5zRmxhZyA9IHRydWU7ICAgICAgICAgICAgICAgICAgICAKKyAgICAgICAgICAgICAgICAgICAgdGhpcy5yZXNldEZsYWcodGhpcy5jU2VsZWN0ZWQpOyAgICAgICAgICAgICAgICAgICAgCisgICAgICAgICAgICAgICAgfTsgCisgICAgICAgICAgICAgICAgCisgICAgICAgICAgICAgICAgdGhpcy5mb2N1c1ByZXYgPSBmdW5jdGlvbiAoKSB7ICAgICAgICAgICAgICAgICAgICAgICAgCisgICAgICAgICAgICAgICAgICAgIHRoaXMuY1NlbGVjdGVkID0gdGhpcy5jU2VsZWN0ZWQgLTEgPCAwID8gKCRzY29wZS5jeWNsZVNlbGVjdGlvbiA9PT0gdHJ1ZSA/IHRoaXMuY2hpbGRTY29wZXMubGVuZ3RoLTEgOiAwKSA6IHRoaXMuY1NlbGVjdGVkIC0gMSA7CisgICAgICAgICAgICAgICAgICAgIHRoaXMuY2hpbGRTY29wZXNbdGhpcy5jU2VsZWN0ZWRdLnNGbGFnID0gdHJ1ZTsgICAgICAgICAgICAgICAgICAgIAorICAgICAgICAgICAgICAgICAgICB0aGlzLnJlc2V0RmxhZyh0aGlzLmNTZWxlY3RlZCk7ICAgICAgICAgICAgICAgICAgICAKKyAgICAgICAgICAgICAgICB9OyAgICAgICAgICAgICAgICAgCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKKyAgICAgICAgICAgICAgICB0aGlzLmNoaWxkU2NvcGVzID0gW107CisgICAgICAgICAgICAgICAgdGhpcy5yZWdpc3RlclNjb3BlID0gZnVuY3Rpb24oY2hpbGRTY29wZSkKKyAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgIHRoaXMuY2hpbGRTY29wZXMucHVzaChjaGlsZFNjb3BlKTsgICAgICAgICAgICAgICAgICAgIAorICAgICAgICAgICAgICAgIH07CisgICAgICAgICAgICAgICAgCisgICAgICAgICAgICAgICAgdGhpcy5yZXNldEZsYWcgPSBmdW5jdGlvbihpbmRleCl7ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAorICAgICAgICAgICAgICAgICAgICBmb3IodmFyIGk9MDsgaSA8IHRoaXMuY2hpbGRTY29wZXMubGVuZ3RoOyBpKyspIAorICAgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgICAgICBpZihpICE9PSBpbmRleCkKKyAgICAgICAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB0aGlzLmNoaWxkU2NvcGVzW2ldLnNGbGFnID0gZmFsc2U7CisgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICB9OworICAgICAgICAgICAgICAgIAorICAgICAgICAgICAgfV0sCisgICAgICAgICAgICBsaW5rOiBmdW5jdGlvbiAoc2NvcGUsIGVsZW1lbnQsIGF0dHIpIHsgICAgICAgICAgICAgICAgCisgICAgICAgICAgICAgICAgc2NvcGUuaXNTbWFsbCA9IGF0dHIuc21hbGwgPT09ICIiID8gdHJ1ZSA6IGZhbHNlOworICAgICAgICAgICAgICAgIHNjb3BlLm11bHRpc2VsZWN0ID0gYXR0ci5tdWx0aXNlbGVjdCA9PT0gIiI/IHRydWUgOiBmYWxzZTsKKyAgICAgICAgICAgICAgICBzY29wZS5jeWNsZVNlbGVjdGlvbiA9IGF0dHIuY3ljbGVTZWxlY3Rpb24gPT09ICIiID8gdHJ1ZSA6IGZhbHNlOworICAgICAgICAgICAgICAgIHNjb3BlLmlzRHJvcERvd25PcGVuID0gZmFsc2U7CisgICAgICAgICAgICAgICAgc2NvcGUuaXNBY3Rpb25Ecm9wZG93biA9IGZhbHNlOworICAgICAgICAgICAgICAgCisgICAgICAgICAgICAgICAgaWYgKCEoc2NvcGUuYnRuVGV4dCkpIHsKKyAgICAgICAgICAgICAgICAgICAgc2NvcGUuaXNBY3Rpb25Ecm9wZG93biA9IHRydWU7CisgICAgICAgICAgICAgICAgfQorCisgICAgICAgICAgICAgICAgc2NvcGUuY2xpY2tGeG4gPSBmdW5jdGlvbiAoKSB7CisgICAgICAgICAgICAgICAgICAgIGlmICh0eXBlb2Ygc2NvcGUuYnRuQ2xpY2sgPT09ICJmdW5jdGlvbiIgJiYgIXNjb3BlLmJ0bkxpbmspIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIHNjb3BlLmJ0bkNsaWNrID0gJHBhcnNlKHNjb3BlLmJ0bkNsaWNrKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIHNjb3BlLmJ0bkNsaWNrKCk7CisgICAgICAgICAgICAgICAgICAgIH0gICAgICAgICAgICAgICAgICAgIAorICAgICAgICAgICAgICAgICAgICBpZihzY29wZS5tdWx0aXNlbGVjdCA9PT0gdHJ1ZSkKKyAgICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAgICAgc2NvcGUuaXNEcm9wRG93bk9wZW4gPSBmYWxzZTsKKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIH07CisKKyAgICAgICAgICAgICAgICBzY29wZS50b2dnbGVEcm9wZG93biA9IGZ1bmN0aW9uICgpIHsKKyAgICAgICAgICAgICAgICAgICAgaWYgKCEoc2NvcGUuYnRuVHlwZSA9PT0gJ2Rpc2FibGVkJykpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIHNjb3BlLmlzRHJvcERvd25PcGVuID0gIXNjb3BlLmlzRHJvcERvd25PcGVuOworICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHNjb3BlLmlzRHJvcERvd25PcGVuKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgJHRpbWVvdXQoZnVuY3Rpb24gKCkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBhbmd1bGFyLmVsZW1lbnQoZWxlbWVudFswXS5xdWVyeVNlbGVjdG9yKCdsaScpKVswXS5mb2N1cygpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0pOworICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgfTsKKworICAgICAgICAgICAgICAgIHNjb3BlLmJ0blR5cGVTZWxlY3RvciA9IGZ1bmN0aW9uIChkaXJlY3RpdmVWYWx1ZSwgYXR0clZhbHVlKSB7CisgICAgICAgICAgICAgICAgICAgIGlmIChkaXJlY3RpdmVWYWx1ZSAhPT0gIiIpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIHNjb3BlLmJ0blR5cGVGaW5hbCA9IGRpcmVjdGl2ZVZhbHVlOworICAgICAgICAgICAgICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgICAgICAgICAgICAgc2NvcGUuYnRuVHlwZUZpbmFsID0gYXR0clZhbHVlOworICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgfTsKKworICAgICAgICAgICAgICAgIHZhciBvdXRzaWRlQ2xpY2sgPSBmdW5jdGlvbihlKSB7CisgICAgICAgICAgICAgICAgICAgIHZhciBpc0VsZW1lbnQgPSAkaXNFbGVtZW50KGFuZ3VsYXIuZWxlbWVudChlLnRhcmdldCksIGVsZW1lbnQuZmluZCgndWwnKS5lcSgwKSwgJGRvY3VtZW50KTsKKyAgICAgICAgICAgICAgICAgICAgaWYgKCFpc0VsZW1lbnQpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIHNjb3BlLmlzRHJvcERvd25PcGVuID0gZmFsc2U7CisgICAgICAgICAgICAgICAgICAgICAgICBzY29wZS4kYXBwbHkoKTsKKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIH07CisKKyAgICAgICAgICAgICAgICAkZG9jdW1lbnRCaW5kLmNsaWNrKCdpc0Ryb3BEb3duT3BlbicsIG91dHNpZGVDbGljaywgc2NvcGUpOworCisgICAgICAgICAgICAgICAgYXR0ci4kb2JzZXJ2ZSgnYnRuVHlwZScsIGZ1bmN0aW9uICh2YWwpIHsKKyAgICAgICAgICAgICAgICAgICAgc2NvcGUuYnRuVHlwZSA9IHZhbDsKKyAgICAgICAgICAgICAgICB9KTsKKyAgICAgICAgICAgICAgICBhdHRyLiRvYnNlcnZlKCdhdHRCdXR0b25Ecm9wZG93bicsIGZ1bmN0aW9uICh2YWwpIHsKKyAgICAgICAgICAgICAgICAgICAgYXR0ci5hdHRCdXR0b25Ecm9wZG93biA9IHZhbDsKKyAgICAgICAgICAgICAgICAgICAgc2NvcGUuYnRuVHlwZVNlbGVjdG9yKGF0dHIuYXR0QnV0dG9uRHJvcGRvd24sIHNjb3BlLmJ0blR5cGUpOworICAgICAgICAgICAgICAgIH0pOworICAgICAgICAgICAgfQorICAgICAgICB9OworCisgICAgICAgICAgICB9XSkKKyAgICAgICAKKy5kaXJlY3RpdmUoJ2F0dEJ1dHRvbkRyb3Bkb3duSXRlbScsIFsnJGxvY2F0aW9uJywna2V5bWFwJywgZnVuY3Rpb24gKCRsb2NhdGlvbixrZXltYXApIHsKKyAgICAgICAgcmV0dXJuIHsKKyAgICAgICAgICAgIHJlc3RyaWN0OiAnRUEnLAorICAgICAgICAgICAgcmVxdWlyZTogWydeYXR0QnV0dG9uRHJvcGRvd24nLCc/bmdNb2RlbCddLAorICAgICAgICAgICAgcmVwbGFjZTogdHJ1ZSwKKyAgICAgICAgICAgIHRyYW5zY2x1ZGU6IHRydWUsICAgICAgICAgICAgCisgICAgICAgICAgICB0ZW1wbGF0ZVVybDonYXBwL3NjcmlwdHMvbmdfanNfYXR0X3RwbHMvc3BsaXRCdXR0b25Ecm9wZG93bi9zcGxpdEJ1dHRvbkRyb3Bkb3duSXRlbS5odG1sJywgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2NvcGU6IHsKKyAgICAgICAgICAgICAgICBpdGVtTGluazogIkAiCisgICAgICAgICAgICB9LAorICAgICAgICAgICAgbGluazogZnVuY3Rpb24gKHNjb3BlLCBlbGVtZW50LCBhdHRyLCBjdHJsKSB7CisgICAgICAgICAgICAgICAgdmFyIHJvb3RMaW5rID0gYW5ndWxhci5lbGVtZW50KGVsZW1lbnRbMF0ucXVlcnlTZWxlY3RvcignYScpKTsKKyAgICAgICAgICAgICAgICBzY29wZS5zRmxhZyA9IGZhbHNlOworICAgICAgICAgICAgICAgIGN0cmxbMF0ucmVnaXN0ZXJTY29wZShzY29wZSk7CisgICAgICAgICAgICAgICAgdmFyIGNsaWNrT25MaW5rID0gZnVuY3Rpb24gKCkgeworICAgICAgICAgICAgICAgICAgICBpZiAoc2NvcGUuaXRlbUxpbmtGaW5hbCkgeworICAgICAgICAgICAgICAgICAgICAgICAgJGxvY2F0aW9uLnVybChzY29wZS5pdGVtTGlua0ZpbmFsKTsKKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIH07CisgICAgICAgICAgICAgICAgCisgICAgICAgICAgICAgICAgaWYoY3RybFsxXSl7CisgICAgICAgICAgICAgICAgICAgIHNjb3BlLmlzU2VsZWN0ZWQgPSBjdHJsWzFdLiR2aWV3VmFsdWU7CisgICAgICAgICAgICAgICAgfWVsc2V7CisgICAgICAgICAgICAgICAgICAgIHNjb3BlLmlzU2VsZWN0ZWQgPSBmYWxzZTsKKyAgICAgICAgICAgICAgICB9ICAgICAgICAgICAgICAgIAorICAgICAgICAgICAgICAgIAorICAgICAgICAgICAgICAgIGVsZW1lbnQuYmluZCgna2V5ZG93bicsIGZ1bmN0aW9uKGUpIHsKKyAgICAgICAgICAgICAgICBpZiAoa2V5bWFwLmlzQWxsb3dlZEtleShlLmtleUNvZGUpIHx8IGtleW1hcC5pc0NvbnRyb2woZSkgfHwga2V5bWFwLmlzRnVuY3Rpb25LZXkoZSkpIHsKKyAgICAgICAgICAgICAgICAgICAgZS5wcmV2ZW50RGVmYXVsdCgpOworICAgICAgICAgICAgICAgICAgICBlLnN0b3BQcm9wYWdhdGlvbigpOworICAgICAgICAgICAgICAgICAgICBzd2l0Y2ggKGUua2V5Q29kZSkgeworICAgICAgICAgICAgICAgICAgICAgICAgY2FzZSBrZXltYXAuS0VZLkRPV046IAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIGN0cmxbMF0uZm9jdXNOZXh0KCk7ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICAgICAgICAgIGNhc2Uga2V5bWFwLktFWS5VUDogICAgICAgICAgICAgICAgICAgICAgICAgICAgCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgY3RybFswXS5mb2N1c1ByZXYoKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICAgICAgICAgIGNhc2Uga2V5bWFwLktFWS5FTlRFUjogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNjb3BlLnNlbGVjdEl0ZW0oKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICAgICAgICAgIGNhc2Uga2V5bWFwLktFWS5FU0M6CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgY3RybFswXS5jbG9zZUFuZEZvY3VzRHJvcGRvd24oKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICAgICAgICAgIGRlZmF1bHQ6CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgCisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICBzY29wZS4kYXBwbHkoKTsKKyAgICAgICAgICAgICAgICB9KTsgCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKKyAgICAgICAgICAgICAgICBzY29wZS5zZWxlY3RJdGVtID0gZnVuY3Rpb24oKQorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgaWYoY3RybFsxXSl7CisgICAgICAgICAgICAgICAgICAgICAgICBzY29wZS4kZXZhbEFzeW5jKGZ1bmN0aW9uKCl7Y3RybFsxXS4kc2V0Vmlld1ZhbHVlKCFjdHJsWzFdLiR2aWV3VmFsdWUpfSk7CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICB9OyAKKworICAgICAgICAgICAgfQorICAgICAgICB9OworICAgIH1dKTsKKworYW5ndWxhci5tb2R1bGUoJ2F0dC5hYnMuc3BsaXRJY29uQnV0dG9uJywgWydhdHQuYWJzLnV0aWxpdGllcyddKQorLmNvbnN0YW50KCdpY29uU3RhdGVDb25zdGFudHMnLCB7CisgICAgTUlERExFOiAnbWlkZGxlJywKKyAgICBMRUZUOiAnbGVmdCcsCisgICAgUklHSFQ6ICdyaWdodCcsCisgICAgTkVYVF9UT19EUk9QRE9XTjonbmV4dC10by1kcm9wZG93bicsCisgICAgTEVGVF9ORVhUX1RPX0RST1BET1dOOidsZWZ0LW5leHQtdG8tZHJvcGRvd24nLAorICAgIERJUl9UWVBFOiB7CisgICAgICAgIExFRlQ6ICdsZWZ0JywKKyAgICAgICAgUklHSFQ6ICAncmlnaHQnLAorICAgICAgICBCVVRUT046ICdidXR0b24nCisgICAgfSwKKyAgICBTUExJVF9JQ09OX0JUTl9FVkVOVF9FTUlUVEVSX0tFWTogJ3NwbGl0SWNvbkJ1dHRvblRhcCcKK30pCisuZGlyZWN0aXZlKCdleHBhbmRhYmxlTGluZScsIFtmdW5jdGlvbigpeworICAgIHJldHVybiB7CisgICAgICAgIHJlc3RyaWN0OiAnRUEnLAorICAgICAgICByZXBsYWNlOiB0cnVlLAorICAgICAgICBwcmlvcml0eTogMzAwLAorICAgICAgICByZXF1aXJlOiBbJ15hdHRTcGxpdEljb25CdXR0b24nLCAnZXhwYW5kYWJsZUxpbmUnXSwKKyAgICAgICAgY29udHJvbGxlcjogWyckc2NvcGUnLCBmdW5jdGlvbigkc2NvcGUpeworICAgICAgICAgICAgJHNjb3BlLmlzQWN0aXZlID0gZmFsc2U7CisgICAgICAgICAgICB0aGlzLnNldEFjdGl2ZVN0YXRlID0gZnVuY3Rpb24oaXNBY3RpdmUpeworICAgICAgICAgICAgICAgICRzY29wZS5pc0FjdGl2ZSA9IGlzQWN0aXZlOworICAgICAgICAgICAgfTsKKyAgICAgICAgICAgIHRoaXMuaXNBY3RpdmUgPSAkc2NvcGUuaXNBY3RpdmU7CisgICAgICAgICAgICB0aGlzLmRpclR5cGUgPSAkc2NvcGUuZGlyVHlwZTsKKyAgICAgICAgfV0sCisgICAgICAgIHRlbXBsYXRlOiAnPGRpdiBuZy1jbGFzcz0ie1wnZXhwYW5kLWxpbmUtY29udGFpbmVyXCc6ICFpc0FjdGl2ZSwgXCdleHBhbmQtbGluZS1jb250YWluZXItYWN0aXZlXCc6IGlzQWN0aXZlfSI+IDxkaXYgbmctY2xhc3M9IntcJ2hvdmVyZWQtbGluZVwnOmlzQWN0a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tZW50QmluZCcsJ2V2ZW50cycsICdrZXltYXAnLAorIGZ1bmN0aW9uKCRkb2N1bWVudCwkdGltZW91dCxpY29uU3RhdGVDb25zdGFudHMsJGRvY3VtZW50QmluZCwgZXZlbnRzLCBrZXltYXApeworICAgIHJldHVybiB7CisgICAgICAgIHJlc3RyaWN0OiAnRUEnLAorICAgICAgICByZXBsYWNlOiB0cnVlLAorICAgICAgICBwcmlvcml0eTogMjAwLAorICAgICAgICB0cmFuc2NsdWRlOiB0cnVlLAorICAgICAgICByZXF1aXJlOiBbJ15hdHRTcGxpdEljb25CdXR0b24nLCdhdHRTcGxpdEljb24nXSwKKyAgICAgICAgdGVtcGxhdGVVcmw6ICdhcHAvc2NyaXB0cy9uZ19qc19hdHRfdHBscy9zcGxpdEljb25CdXR0b24vc3BsaXRJY29uLmh0bWwnLAorICAgICAgICBzY29wZTp7CisgICAgICAgICAgICBpY29uOiAnQCcsCisgICAgICAgICAgICBpY29uVGl0bGU6ICdAdGl0bGUnLAorICAgICAgICAgICAgaG92ZXJXYXRjaDogJz0nLAorICAgICAgICAgICAgZHJvcERvd25XYXRjaDogJz0nLAorICAgICAgICAgICAgZGlyVHlwZTogJ0AnCisgICAgICAgIH0sCisgICAgICAgIGNvbnRyb2xsZXI6J0F0dFNwbGl0SWNvbkN0cmwnLAorICAgICAgICBsaW5rOiBmdW5jdGlvbihzY29wZSxlbGVtZW50LGF0dHIsY3RybHMpeworICAgICAgICAgICAgdmFyIGF0dFNwbGl0SWNvbkJ1dHRvbkN0cmwgPSBjdHJsc1swXTsKKyAgICAgICAgICAgIHZhciBhdHRTcGxpdEljb25DdHJsID0gY3RybHNbMV07CisgICAgICAgICAgICBhdHRTcGxpdEljb25CdXR0b25DdHJsLmFkZFN1YkN0cmwoYXR0U3BsaXRJY29uQ3RybCk7CisgICAgICAgICAgICBzY29wZS5pY29uU3RhdGVDb25zdGFudHMgPSBpY29uU3RhdGVDb25zdGFudHM7CisgICAgICAgICAgICB2YXIgY3VycmVudEluZGV4ID0gMDsKKyAgICAgICAgICAgIHZhciBpc015RWxlbWVudCA9IGZhbHNlOworICAgICAgICAgICAgdmFyIGxpc3RFbGVtZW50czsKKyAgICAgICAgICAgIHNjb3BlLmlzRHJvcGRvd24gPSBmYWxzZTsKKyAgICAgICAgICAgIHNjb3BlLmlzRHJvcGRvd25PcGVuID0gZmFsc2U7CisgICAgICAgICAgICB2YXIgb3V0c2lkZUNsaWNrID0gZnVuY3Rpb24oZSkgeworICAgICAgICAgICAgICAgIGlmKHNjb3BlLmlzRHJvcGRvd24peworICAgICAgICAgICAgICAgICAgICBpZiAoaXNNeUVsZW1lbnQpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIGlzTXlFbGVtZW50ID0gZmFsc2U7CisgICAgICAgICAgICAgICAgICAgICAgICBzY29wZS50b2dnbGVEcm9wZG93bigpOworICAgICAgICAgICAgICAgICAgICB9IGVsc2V7CisgICAgICAgICAgICAgICAgICAgICAgICBzY29wZS50b2dnbGVEcm9wZG93bihmYWxzZSk7CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgc2NvcGUuJGFwcGx5KCk7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfTsKKyAgICAgICAgICAgIGlmKGF0dHIuZHJvcERvd25JZCAmJiBhdHRyLmRyb3BEb3duSWQgIT09ICcnKXsKKyAgICAgICAgICAgICAgICBzY29wZS5kcm9wRG93bklkID0gYXR0ci5kcm9wRG93bklkOworICAgICAgICAgICAgICAgIHNjb3BlLmlzRHJvcGRvd24gPSB0cnVlOworICAgICAgICAgICAgfQorICAgICAgICAgICAgc2NvcGUuJG9uKGljb25TdGF0ZUNvbnN0YW50cy5TUExJVF9JQ09OX0JUTl9FVkVOVF9FTUlUVEVSX0tFWSwgZnVuY3Rpb24oZXZudCwgZGF0YSl7CisgICAgICAgICAgICAgICAgaWYodHlwZW9mIGRhdGEgPT09ICdib29sZWFuJyAmJiBkYXRhKSB7CisgICAgICAgICAgICAgICAgICAgIHNjb3BlLmRyb3BEb3duQ2xpY2tlZCgpOyAgICAgCisgICAgICAgICAgICAgICAgICAgIC8qCisgICAgICAgICAgICAgICAgICAgICAgICBDaGVjayBpZiB0aGUgZHJvcGRvd24gaXMgb3BlbiBhbmQgaWYgd2UgYXJlIHNlbGVjdGluZyBvbmUKKyAgICAgICAgICAgICAgICAgICAgICAgIG9mIHRoZSBpdGVtcywgc28gdGhhdCB3aGVuIHByZXNzaW5nIGVudGVyIGl0IHdpbGwgdHJpZ2dlciBpdC4KKyAgICAgICAgICAgICAgICAgICAgKi8KKyAgICAgICAgICAgICAgICAgICAgaWYoc2NvcGUuaXNEcm9wRG93bk9wZW4pIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIGxpc3RFbGVtZW50c1tjdXJyZW50SW5kZXhdLmVxKDApLmZpbmQoJ2EnKVswXS5jbGljaygpOworICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgICAgICAgICAgdmFyIGUgPSBkYXRhOworICAgICAgICAgICAgICAgICAgICAvL09ubHkgdHJpZ2dlciB0aGUga2V5Ym9hcmQgZXZlbnQgaWYgdGhlIGljb24gYnV0dG9uIGlzIGEgZHJvcGRvd24gdHlwZQorICAgICAgICAgICAgICAgICAgICBpZihzY29wZS5pc0Ryb3Bkb3duKSB7CisgICAgICAgICAgICAgICAgICAgICAgICB0cmlnZ2VyS2V5Ym9hcmRFdmVudHMoZSk7ICAgCisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgZnVuY3Rpb24gdHJpZ2dlcktleWJvYXJkRXZlbnRzKGUpIHsKKyAgICAgICAgICAgICAgICAgICAgc3dpdGNoKGUud2hpY2gpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIGNhc2UgKGtleW1hcC5LRVkuVEFCKToKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBzY29wZS50b2dnbGVEcm9wZG93bihmYWxzZSk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2NvcGUuJGRpZ2VzdCgpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgICAgICAgICAgY2FzZSAoa2V5bWFwLktFWS5FU0MpOiAKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBvdXRzaWRlQ2xpY2soKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICAgICAgICAgIGNhc2UgKGtleW1hcC5LRVkuRU5URVIpOgorICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChzY29wZS5pc0Ryb3BEb3duT3BlbikgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBsaXN0RWxlbWVudHNJbml0KCk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgICAgICAgICAgY2FzZSAoa2V5bWFwLktFWS5VUCk6CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgZS5wcmV2ZW50RGVmYXVsdCgpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGV2ZW50cy5zdG9wUHJvcGFnYXRpb24oZSk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYoc2NvcGUuaXNEcm9wRG93bk9wZW4pIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2NvcGUucHJldmlvdXNJdGVtSW5Ecm9wZG93bigpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICAgICAgICAgIGNhc2UgKGtleW1hcC5LRVkuRE9XTik6CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgZS5wcmV2ZW50RGVmYXVsdCgpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGV2ZW50cy5zdG9wUHJvcGFnYXRpb24oZSk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgLy9Ecm9wZG93biBpcyBvcGVuIGFuZCB0aGUgdXNlciB0YXBzIGRvd24gYWdhaW4KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZihzY29wZS5pc0Ryb3BEb3duT3BlbikgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvL05vdyB3ZSBuZWVkIHRvIGdvIHRocm91Z2ggdGhlIHJvd3MgaW4gdGhlIGRyb3Bkb3duCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNjb3BlLm5leHRJdGVtSW5Ecm9wZG93bigpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlzTXlFbGVtZW50ID0gdHJ1ZTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgb3V0c2lkZUNsaWNrKCk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxpc3RFbGVtZW50c0luaXQoKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgICAgICAgICBkZWZhdWx0OgorICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIGZ1bmN0aW9uIGxpc3RFbGVtZW50c0luaXQoKSB7CisgICAgICAgICAgICAgICAgICAgIGlmKGxpc3RFbGVtZW50cyA9PT0gdW5kZWZpbmVkKSB7CisgICAgICAgICAgICAgICAgICAgICAgICBsaXN0RWxlbWVudHMgPSBbXTsKKyAgICAgICAgICAgICAgICAgICAgICAgIHZhciBsaVRlbXBzID0gZWxlbWVudC5maW5kKCdsaScpOworICAgICAgICAgICAgICAgICAgICAgICAgZm9yKHZhciBpID0gMDsgaSA8IGxpVGVtcHMubGVuZ3RoOyBpKyspIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBsaXN0RWxlbWVudHMucHVzaChsaVRlbXBzLmVxKGkpKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgIGxpc3RFbGVtZW50c1tjdXJyZW50SW5kZXhdLmNoaWxkcmVuKCkuZXEoMCkuYWRkQ2xhc3MoJ3NlbGVjdGVkLWl0ZW0nKTsKKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0pOworICAgICAgICAgICAgc2NvcGUubmV4dEl0ZW1JbkRyb3Bkb3duID0gZnVuY3Rpb24oKXsKKyAgICAgICAgICAgICAgICBpZihsaXN0RWxlbWVudHMgJiYgY3VycmVudEluZGV4IDwgbGlzdEVsZW1lbnRzLmxlbmd0aCAtIDEpeworICAgICAgICAgICAgICAgICAgICBjdXJyZW50SW5kZXgrKzsKKyAgICAgICAgICAgICAgICAgICAgbGlzdEVsZW1lbnRzW2N1cnJlbnRJbmRleCAtIDFdLmNoaWxkcmVuKCkuZXEoMCkucmVtb3ZlQ2xhc3MoJ3NlbGVjdGVkLWl0ZW0nKTsKKyAgICAgICAgICAgICAgICAgICAgbGlzdEVsZW1lbnRzW2N1cnJlbnRJbmRleF0uY2hpbGRyZW4oKS5lcSgwKS5hZGRDbGFzcygnc2VsZWN0ZWQtaXRlbScpOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH07CisgICAgICAgICAgICBzY29wZS5wcmV2aW91c0l0ZW1JbkRyb3Bkb3duID0gZnVuY3Rpb24oKXsKKyAgICAgICAgICAgICAgICBpZihjdXJyZW50SW5kZXggPiAwKSB7CisgICAgICAgICAgICAgICAgICAgIGN1cnJlbnRJbmRleC0tOworICAgICAgICAgICAgICAgICAgICBsaXN0RWxlbWVudHNbY3VycmVudEluZGV4XS5jaGlsZHJlbigpLmVxKDApLmFkZENsYXNzKCdzZWxlY3RlZC1pdGVtJyk7CisKKyAgICAgICAgICAgICAgICAgICAgaWYoY3VycmVudEluZGV4ICsgMSA8IGxpc3RFbGVtZW50cy5sZW5ndGgpCisgICAgICAgICAgICAgICAgICAgICAgICBsaXN0RWxlbWVudHNbY3VycmVudEluZGV4ICsgMV0uY2hpbGRyZW4oKS5lcSgwKS5yZW1vdmVDbGFzcygnc2VsZWN0ZWQtaXRlbScpOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH07CisgICAgICAgICAgICBzY29wZS4kd2F0Y2goJ2lzSWNvbkhvdmVyZWQnLCBmdW5jdGlvbih2YWwpIHsKKyAgICAgICAgICAgICAgICBzY29wZS5ob3ZlcldhdGNoID0gdmFsOworICAgICAgICAgICAgfSk7CisgICAgICAgICAgICBzY29wZS4kd2F0Y2goJ3R5cGUnLCBmdW5jdGlvbih2YWwpIHsKKyAgICAgICAgICAgICAgICBmdW5jdGlvbiB0b2dnbGVWYWx1ZXMoaXNNaWRkbGUsaXNOZXh0VG9Ecm9wRG93bixpc1JpZ2h0LGlzTGVmdCxpc0xlZnROZXh0RHJvcGRvd24peworICAgICAgICAgICAgICAgICAgICBzY29wZVsnaXNNaWRkbGUnXSAgPSBpc01pZGRsZTsKKyAgICAgICAgICAgICAgICAgICAgc2NvcGVbJ2lzTmV4dFRvRHJvcERvd24nXSA9IGlzTmV4dFRvRHJvcERvd247CisgICAgICAgICAgICAgICAgICAgIHNjb3BlWydpc1JpZ2h0J10gID0gaXNSaWdodDsKKyAgICAgICAgICAgICAgICAgICAgc2NvcGVbJ2lzTGVmdCddID0gaXNMZWZ0OworICAgICAgICAgICAgICAgICAgICBzY29wZVsnaXNMZWZ0TmV4dERyb3Bkb3duJ10gPSBpc0xlZnROZXh0RHJvcGRvd247CisgICAgICAgICAgICAgICAgfTsKKyAgICAgICAgICAgICAgICBzd2l0Y2godmFsKSB7CisgICAgICAgICAgICAgICAgICAgIGNhc2UgKHNjb3BlLmljb25TdGF0ZUNvbnN0YW50cy5NSURETEUpOgorICAgICAgICAgICAgICAgICAgICAgICAgdG9nZ2xlVmFsdWVzKHRydWUsZmFsc2UsZmFsc2UsdHJ1ZSxmYWxzZSk7CisgICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICAgICAgY2FzZSAoc2NvcGUuaWNvblN0YXRlQ29uc3RhbnRzLkxFRlQpOgorICAgICAgICAgICAgICAgICAgICAgICAgdG9nZ2xlVmFsdWVzKGZhbHNlLGZhbHNlLGZhbHNlLHRydWUsZmFsc2UpOworICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgICAgIGNhc2UgKHNjb3BlLmljb25TdGF0ZUNvbnN0YW50cy5SSUdIVCk6CisgICAgICAgICAgICAgICAgICAgICAgICB0b2dnbGVWYWx1ZXMoZmFsc2UsZmFsc2UsdHJ1ZSxmYWxzZSxmYWxzZSk7CisgICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICAgICAgY2FzZSAoc2NvcGUuaWNvblN0YXRlQ29uc3RhbnRzLk5FWFRfVE9fRFJPUERPV04pOgorICAgICAgICAgICAgICAgICAgICAgICAgdG9nZ2xlVmFsdWVzKGZhbHNlLHRydWUsdHJ1ZSx0cnVlLGZhbHNlKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgICAgICBjYXNlIChzY29wZS5pY29uU3RhdGVDb25zdGFudHMuTEVGVF9ORVhUX1RPX0RST1BET1dOKToKKyAgICAgICAgICAgICAgICAgICAgICAgIHRvZ2dsZVZhbHVlcyhmYWxzZSxmYWxzZSxmYWxzZSx0cnVlLHRydWUpOworICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgICAgIGRlZmF1bHQ6CisgICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9KTsKKyAgICAgICAgICAgIHNjb3BlLmRyb3BEb3duQ2xpY2tlZCA9IGZ1bmN0aW9uKCkgeworICAgICAgICAgICAgICAgIGlzTXlFbGVtZW50ID0gdHJ1ZTsKKyAgICAgICAgICAgIH07CisgICAgICAgICAgICBzY29wZS50b2dnbGVEcm9wZG93biA9IGZ1bmN0aW9uKHZhbCkgeworICAgICAgICAgICAgICAgIGlmKHZhbCAhPT0gdW5kZWZpbmVkKSB7CisgICAgICAgICAgICAgICAgICAgIHNjb3BlLmlzRHJvcERvd25PcGVuID0gdmFsOworICAgICAgICAgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICAgICAgICAgIHNjb3BlLmlzRHJvcERvd25PcGVuID0gIXNjb3BlLmlzRHJvcERvd25PcGVuOyAKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgc2NvcGUuZHJvcERvd25XYXRjaCA9IHNjb3BlLmlzRHJvcERvd25PcGVuOworICAgICAgICAgICAgfTsKKyAgICAgICAgICAgICRkb2N1bWVudEJpbmQuY2xpY2soJ2lzRHJvcGRvd24nLCBvdXRzaWRlQ2xpY2ssIHNjb3BlKTsKKyAgICAgICAgfQorICAgIH07Cit9XSkKKy5jb250cm9sbGVyKCdBdHRTcGxpdEljb25CdXR0b25DdHJsJyxbJyRzY29wZScsICdpY29uU3RhdGVDb25zdGFudHMnLGZ1bmN0aW9uKCRzY29wZSxpY29uU3RhdGVDb25zdGFudHMpeworICAgIHRoaXMuc3ViQ3RybHMgPSBbXTsKKyAgICAkc2NvcGUuaXNMZWZ0TGluZVNob3duPXRydWU7CisgICAgJHNjb3BlLmlzUmlnaHRMaW5lU2hvd249dHJ1ZTsKKyAgICAkc2NvcGUuY2hpbGRyZW5TY29wZXMgPSBbXTsKKyAgICB2YXIgdGhhdCA9IHRoaXM7CisKKyAgICBmdW5jdGlvbiBnZXREaXJJbmRleChkaXJUeXBlKSB7CisgICAgICAgIHZhciBpbmRleCA9IC0xOworICAgICAgICBmb3IodmFyIGMgaW4gdGhhdC5zdWJDdHJscykgeworICAgICAgICAgICAgdmFyIGN0cmwgPSB0aGF0LnN1YkN0cmxzW2NdOworICAgICAgICAgICAgaWYoY3RybC5kaXJUeXBlID09PSBkaXJUeXBlKSB7CisgICAgICAgICAgICAgICAgaW5kZXggPSBjOworICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgICAgIHJldHVybiBpbmRleDsKKyAgICB9CisgICAgdGhpcy5hZGRTdWJDdHJsID0gIGZ1bmN0aW9uKHN1YikgeworICAgICAgICB0aGlzLnN1YkN0cmxzLnB1c2goc3ViKTsKKyAgICB9OworICAgIHRoaXMuaXNMZWZ0TGluZVNob3duID0gZnVuY3Rpb24oaXNTaG93bikgeworICAgICAgICBpZihpc1Nob3duID09PSB1bmRlZmluZWQpIHsKKyAgICAgICAgICAgIHJldHVybiAkc2NvcGUuaXNMZWZ0TGluZVNob3duOworICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgJHNjb3BlLmlzTGVmdExpbmVTaG93biA9IGlzU2hvd247CisgICAgICAgIH0KKyAgICB9OworICAgIHRoaXMuaXNSaWdodExpbmVTaG93biA9IGZ1bmN0aW9uKGlzU2hvd24pIHsKKyAgICAgICAgaWYoaXNTaG93biA9PT0gdW5kZWZpbmVkKSB7CisgICAgICAgICAgICByZXR1cm4gJHNjb3BlLmlzUmlnaHRMaW5lU2hvd247CisgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICAkc2NvcGUuaXNSaWdodExpbmVTaG93biA9IGlzU2hvd247CisgICAgICAgIH0KKyAgICB9OworICAgIHRoaXMuc2V0TGVmdExpbmVIb3ZlciA9IGZ1bmN0aW9uKGlzSG92ZXJlZCkgeworICAgICAgICB2YXIgbGVmdExpbmVJbmRleCA9IGdldERpckluZGV4KGljb25TdGF0ZUNvbnN0YW50cy5ESVJfVFlQRS5MRUZUKTsKKworICAgICAgICBpZigkc2NvcGUuaXNMZWZ0TGluZVNob3duICY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BY3RpdmVTdGF0ZSkgeworICAgICAgICAgICAgICAgICAgICAgICAgc3ViSWNvbkJ1dHRvbnNbaS0xXS5zdWJDdHJsc1tyaWdodExpbmVJbmRleF0uc2V0QWN0aXZlU3RhdGUoaXNIb3ZlcmVkKTsKKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9CisgICAgICAgIH0gICAKKyAgICAgICAgaWYoaXNEcm9wRG93bk9wZW4pIHsKKyAgICAgICAgICAgIC8qCisgICAgICAgICAgICAgIElmIHRoZSBidXR0b24gaXMgbmV4dCB0byB0aGUgZHJvcGRvd24gYnV0dG9uIHRoZW4ganVzdCBrZWVwIHRoZSAKKyAgICAgICAgICAgICAgYnV0dG9ucyBsZWZ0IGxpbmUgb3IgaXRzIGxlZnQgbmVpZ2hib3JzIHJpZ2h0IGxpbmUgdG9nZ2xlZCBvbgorICAgICAgICAgICAgICBJZiB0aGUgYnV0dG9uIGlzIHRoZSBkcm9wZG93biBidXR0b24gZG9uJ3QgZG8gYW55dGhpbmcKKyAgICAgICAgICAgICAgZWxzZSBkbyB0aGluZ3Mgbm9ybWFsbHkgd2l0aHQgdGhlIGJ1dHRvbgorICAgICAgICAgICAgKi8KKyAgICAgICAgICAgIC8qaWYoc3ViSWNvbkJ1dHRvbnNbc3ViSWNvbkJ1dHRvbnNMZW5ndGgtMV0gPT09IGJ1dHRvbkN0cmwpIHsKKworICAgICAgICAgICAgfQorICAgICAgICAgICAgZWxzZSAqLworICAgICAgICAgICAgaWYoc3ViSWNvbkJ1dHRvbnNbc3ViSWNvbkJ1dHRvbnNMZW5ndGgtMl09PWJ1dHRvbkN0cmwpIHsKKyAgICAgICAgICAgICAgICBpZihzdWJJY29uQnV0dG9uc1tzdWJJY29uQnV0dG9uc0xlbmd0aC0yXS5pc0xlZnRMaW5lU2hvd24oKSkgeworICAgICAgICAgICAgICAgICAgICBzdWJJY29uQnV0dG9uc1tzdWJJY29uQnV0dG9uc0xlbmd0aC0yXS5zdWJDdHJsc1tsZWZ0TGluZUluZGV4XS5zZXRBY3RpdmVTdGF0ZShpc0hvdmVyZWQpOworICAgICAgICAgICAgICAgIH0gZWxzZSBpZihzdWJJY29uQnV0dG9uc0xlbmd0aCAgLSAzID49IDApIHsKKyAgICAgICAgICAgICAgICAgICAgaWYoc3ViSWNvbkJ1dHRvbnNbc3ViSWNvbkJ1dHRvbnNMZW5ndGgtM10uaXNSaWdodExpbmVTaG93bigpKSB7CisgICAgICAgICAgICAgICAgICAgICAgICBzdWJJY29uQnV0dG9uc1tzdWJJY29uQnV0dG9uc0xlbmd0aC0zXS5zdWJDdHJsc1tyaWdodExpbmVJbmRleF0uc2V0QWN0aXZlU3RhdGUoaXNIb3ZlcmVkKTsKKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICAgICAgbm9WZXJ0aWNhbExpbmVUb2dnbGUoKTsKKworICAgICAgICAgICAgICAgIGlmKCRzY29wZS5pc0xlZnRMaW5lU2hvd24pIHsKKyAgICAgICAgICAgICAgICAgICAgdGhpcy5zdWJDdHJsc1tsZWZ0TGluZUluZGV4XS5zZXRBY3RpdmVTdGF0ZShpc0hvdmVyZWQpOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICBpZigkc2NvcGUuaXNSaWdodExpbmVTaG93bikgeworICAgICAgICAgICAgICAgICAgICB0aGlzLnN1YkN0cmxzW3JpZ2h0TGluZUluZGV4XS5zZXRBY3RpdmVTdGF0ZShpc0hvdmVyZWQpOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0KKyAgICAgICAgfSBlbHNlIHsgLy8gRW5kIG9mIGlmKGlzRHJvcERvd25PcGVuKQorICAgICAgICAgICAgLy9IYW5kbGUgU3BlY2lhbCBjYXNlcyB3aGVyZSB0aGV5IGFyZW4ndCBzaG93aW5nIGFueSB2ZXJ0aWNhbCBsaW5lcworICAgICAgICAgICAgLy9hbmQgdGhlIGRyb3Bkb3duIGlzbid0IGRvd24KKyAgICAgICAgICAgIGlmKCEkc2NvcGUuaXNMZWZ0TGluZVNob3duICYmICEkc2NvcGUuaXNSaWdodExpbmVTaG93bikgeworICAgICAgICAgICAgICAgIG5vVmVydGljYWxMaW5lVG9nZ2xlKCk7CisgICAgICAgICAgICB9ICAgCisgICAgICAgICAgICBpZigkc2NvcGUuaXNMZWZ0TGluZVNob3duICYmIHRoaXMuc3ViQ3RybHNbbGVmdExpbmVJbmRleF0uc2V0QWN0aXZlU3RhdGUpIHsKKyAgICAgICAgICAgICAgICB0aGlzLnN1YkN0cmxzW2xlZnRMaW5lSW5kZXhdLnNldEFjdGl2ZVN0YXRlKGlzSG92ZXJlZCk7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBpZigkc2NvcGUuaXNSaWdodExpbmVTaG93biAmJiB0aGlzLnN1YkN0cmxzW3JpZ2h0TGluZUluZGV4XS5zZXRBY3RpdmVTdGF0ZSl7CisgICAgICAgICAgICAgICAgdGhpcy5zdWJDdHJsc1tyaWdodExpbmVJbmRleF0uc2V0QWN0aXZlU3RhdGUoaXNIb3ZlcmVkKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgIH07CisgICAgdGhpcy5zZXRCdXR0b25UeXBlID0gZnVuY3Rpb24odHlwZSl7CisgICAgICAgIHZhciBidXR0b25JbmRleCA9IGdldERpckluZGV4KGljb25TdGF0ZUNvbnN0YW50cy5ESVJfVFlQRS5CVVRUT04pOworICAgICAgICBpZih0aGlzLnN1YkN0cmxzW2J1dHRvbkluZGV4XSAmJiB0aGlzLnN1YkN0cmxzW2J1dHRvbkluZGV4XS5zZXRUeXBlKSB7CisgICAgICAgICAgICB0aGlzLnN1YkN0cmxzW2J1dHRvbkluZGV4XS5zZXRUeXBlKHR5cGUpOworICAgICAgICB9CisgICAgfTsKK31dKQorLmRpcmVjdGl2ZSgn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24oYXR0U3BsaXRJY29uQnV0dG9uQ3RybCk7CisgICAgICAgICAgICBlbGVtZW50LmJpbmQoJ2tleWRvd24nLCBmdW5jdGlvbihlKXsKKyAgICAgICAgICAgICAgICAvL0NoZWNrIGlmIHRoZSBrZXkgaXMgdGhlIHVwIG9yIGRvd24ga2V5CisgICAgICAgICAgICAgICAgaWYoZS53aGljaCA9PT0ga2V5bWFwLktFWS5FU0MgfHwKKyAgICAgICAgICAgICAgICAgICAgZS53aGljaCA9PT0ga2V5bWFwLktFWS5ET1dOIHx8CisgICAgICAgICAgICAgICAgICAgIGUud2hpY2ggPT09IGtleW1hcC5LRVkuRU5URVIgfHwKKyAgICAgICAgICAgICAgICAgICAgZS53aGljaCA9PT0ga2V5bWFwLktFWS5VUCB8fAorICAgICAgICAgICAgICAgICAgICBlLndoaWNoID09PSBrZXltYXAuS0VZLlRBQiApIHsKKyAgICAgICAgICAgICAgICAgICAgc2NvcGUuY2xpY2tIYW5kbGVyKCk7CisgICAgICAgICAgICAgICAgICAgIHNjb3BlLiRicm9hZGNhc3QoaWNvblN0YXRlQ29uc3RhbnRzLlNQTElUX0lDT05fQlROX0VWRU5UX0VNSVRURVJfS0VZLCBlKTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9KTsKKyAgICAgICAgICAgIHNjb3BlLmRyb3BEb3duV2F0Y2ggPSBmYWxzZTsKKyAgICAgICAgICAgIHNjb3BlLmljb25TdGF0ZUNvbnN0YW50cyA9IGljb25TdGF0ZUNvbnN0YW50czsKKyAgICAgICAgICAgIHNjb3BlLmNsaWNrSGFuZGxlciA9IGZ1bmN0aW9uKCkgeworICAgICAgICAgICAgICAgIGF0dFNwbGl0QnV0dG9uR3JvdXBDdHJsLmhpZGVMZWZ0TGluZVJpZ2h0QnV0dG9uKGF0dFNwbGl0SWNvbkJ1dHRvbkN0cmwpOworICAgICAgICAgICAgfTsKKyAgICAgICAgICAgIHNjb3BlLiR3YXRjaCgnaXNIb3ZlcmVkJywgZnVuY3Rpb24odmFsKXsKKyAgICAgICAgICAgICAgICBpZih2YWwpIHsKKyAgICAgICAgICAgICAgICAgICAgYXR0U3BsaXRJY29uQnV0dG9uQ3RybC50b2dnbGVMaW5lcyh2YWwsYXR0U3BsaXRCdXR0b25Hcm91cEN0cmwsYXR0U3BsaXRJY29uQnV0dG9uQ3RybCxhdHRTcGxpdEJ1dHRvbkdyb3VwQ3RybC5pc0Ryb3BEb3duT3Blbik7CisgICAgICAgICAgICAgICAgfSBlbHNleworICAgICAgICAgICAgICAgICAgICBhdHRTcGxpdEljb25CdXR0b25DdHJsLnRvZ2dsZUxpbmVzKHZhbCxhdHRTcGxpdEJ1dHRvbkdyb3VwQ3RybCxhdHRTcGxpdEljb25CdXR0b25DdHJsLGF0dFNwbGl0QnV0dG9uR3JvdXBDdHJsLmlzRHJvcERvd25PcGVuKTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9KTsKKyAgICAgICAgICAgIHNjb3BlLiR3YXRjaCgnZHJvcERvd25XYXRjaCcsIGZ1bmN0aW9uKHZhbCkgeworICAgICAgICAgICAgICAgIGF0dFNwbGl0QnV0dG9uR3JvdXBDdHJsLmlzRHJvcERvd25PcGVuID0gdmFsOworICAgICAgICAgICAgICAgIGF0dFNwbGl0QnV0dG9uR3JvdXBDdHJsLnRvZ2dsZURyb3Bkb3duU3RhdGUodmFsKTsKKyAgICAgICAgICAgIH0pOworICAgICAgICB9CisgICAgfQorfV0pCisuY29udHJvbGxlcignQXR0U3BsaXRJY29uQnV0dG9uR3JvdXBDdHJsJywgICBbJyRzY29wZScsJ2ljb25TdGF0ZUNvbnN0YW50cycsZnVuY3Rpb24oJHNjb3BlLGljb25TdGF0ZUNvbnN0YW50cyl7CisgICAgdGhpcy5zdWJJY29uQnV0dG9ucyA9IFtdOworICAgIHRoaXMuYWRkSWNvbkJ1dHRvbiA9IGZ1bmN0aW9uKGljb25CdXR0b24peworICAgICAgIHRoaXMuc3ViSWNvbkJ1dHRvbnM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CRkb2N1bWVudCwkdGltZW91dCxpY29uU3RhdGVDb25zdGFudHMpeworICAgIHJldHVybiB7CisgICAgICAgIHJlc3RyaWN0OiAnRUEnLAorICAgICAgICByZXBsYWNlOiB0cnVlLAorICAgICAgICBwcmlvcml0eTogNTAsCisgICAgICAgIHRyYW5zY2x1ZGU6IHRydWUsCisgICAgICAgIHJlcXVpcmU6ICdhdHRTcGxpdEljb25CdXR0b25Hcm91cCcsCisgICAgICAgIGNvbnRyb2xsZXI6ICdBdHRTcGxpdEljb25CdXR0b25Hcm91cEN0cmwnLAorICAgICAgICB0ZW1wbGF0ZVVybDogJ2FwcC9zY3JpcHRzL25nX2pzX2F0dF90cGxzL3NwbGl0SWNvbkJ1dHRvbi9zcGxpdEljb25CdXR0b25Hcm91cC5odG1sJywKKyAgICAgICAgc2NvcGU6e30sCisgICAgICAgIGxpbms6IGZ1bmN0aW9uKHNjb3BlLGVsZW1lbnQsYXR0cixjdHJscyl7CisgICAgICAgICAgICAkdGltZW91dChpbml0aWFsaXplLDEwMCk7CisgICAgICAgICAgICBmdW5jdGlvbiBpbml0aWFsaXplKCl7CisgICAgICAgICAgICAgICAgdmFyIHN1Ykljb25CdXR0b25DdHJscyA9IGN0cmxzLnN1Ykljb25CdXR0b25zOworICAgICAgICAgICAgICAgIHZhciBsZWZ0TW9zdEJ1dHRvbkluZGV4ID0gMDsKKyAgICAgICAgICAgICAgICB2YXIgcmlnaHRNb3N0QnV0dG9uSW5kZXggPXN1Ykljb25CdXR0b25DdHJscy5sZW5ndGgtMTsKKyAgICAgICAgICAgICAgICAvL2xlZnQgbW9zdCBidXR0b24gY29uZmlnCisgICAgICAgICAgICAgICAgc3ViSWNvbkJ1dHRvbkN0cmxzW2xlZnRNb3N0QnV0dG9uSW5kZXhdLnNldEJ1dHRvblR5cGUoaWNvblN0YXRlQ29uc3RhbnRzLkxFRlQpOworICAgICAgICAgICAgICAgIHN1Ykljb25CdXR0b25DdHJsc1tsZWZ0TW9zdEJ1dHRvbkluZGV4XS5pc0xlZnRMaW5lU2hvd24oZmFsc2UpOworICAgICAgICAgICAgICAgIHN1Ykljb25CdXR0b25DdHJsc1tsZWZ0TW9zdEJ1dHRvbkluZGV4XS5pc1JpZ2h0TGluZVNob3duKHRydWUpOworICAgICAgICAgICAgICAgIC8vcmlnaHQgbW9zdCBidXR0b24gY29uZmlnCisgICAgICAgICAgICAgICAgc3ViSWNvbkJ1dHRvbkN0cmxzW3JpZ2h0TW9zdEJ1dHRvbkluZGV4XS5zZXRCdXR0b25UeXBlKGljb25TdGF0ZUNvbnN0YW50cy5SSUdIVCk7CisgICAgICAgICAgICAgICAgc3ViSWNvbkJ1dHRvbkN0cmxzW3JpZ2h0TW9zdEJ1dHRvbkluZGV4XS5pc1JpZ2h0TGluZVNob3duKGZhbHNlKTsKKyAgICAgICAgICAgICAgICBzdWJJY29uQnV0dG9uQ3RybHNbcmlnaHRNb3N0QnV0dG9uSW5kZXhdLmlzTGVmdExpbmVTaG93bihmYWxzZSk7CisgICAgICAgICAgICAgICAgLy9taWRkbGUgYnV0dG9ucyBjb25maWcKKyAgICAgICAgICAgICAgICBpZihyaWdodE1vc3RCdXR0b25JbmRleCA+PSAyKSB7CisgICAgICAgICAgICAgICAgICAgIHZhciBpbmRleCA9IDE7CisgICAgICAgICAgICAgICAgICAgIHdoaWxlKGluZGV4IDwgcmlnaHRNb3N0QnV0dG9uSW5kZXgpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIHN1Ykljb25CdXR0b25DdHJsc1tpbmRleF0uc2V0QnV0dG9uVHlwZShpY29uU3RhdGVDb25zdGFudHMuTUlERExFKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIHN1Ykljb25CdXR0b25DdHJsc1tpbmRleF0uaXNSaWdodExpbmVTaG93bihmYWxzZSk7CisgICAgICAgICAgICAgICAgICAgICAgICBzdWJJY29uQnV0dG9uQ3RybHNbaW5kZXhdLmlzTGVmdExpbmVTaG93bihmYWxzZSk7CisgICAgICAgICAgICAgICAgICAgICAgICBpbmRleCsrOworICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgIHZhciBza2lwSW5kZXggPSAyOworICAgICAgICAgICAgICAgICAgICB3aGlsZShza2lwSW5kZXggPD0gcmlnaHRNb3N0QnV0dG9uSW5kZXgpeworICAgICAgICAgICAgICAgICAgICAgICAgaWYoc2tpcEluZGV4ID09IHJpZ2h0TW9zdEJ1dHRvbkluZGV4KSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgc3ViSWNvbkJ1dHRvbkN0cmxzW3NraXBJbmRleF0uaXNMZWZ0TGluZVNob3duKHRydWUpOworICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBzdWJJY29uQnV0dG9uQ3RybHNbc2tpcEluZGV4XS5pc1JpZ2h0TGluZVNob3duKHRydWUpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIHN1Ykljb25CdXR0b25DdHJsc1tza2lwSW5kZXhdLmlzTGVmdExpbmVTaG93bih0cnVlKTsgCisgICAgICAgICAgICAgICAgICAgICAgICB9IAorICAgICAgICAgICAgICAgICAgICAgICAgc2tpcEluZGV4ID0gc2tpcEluZGV4ICsgMjsKKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAvL3JlcG9zaXRpb24gdGhlIGRyb3Bkb3duCisgICAgICAgICAgICAgICAgdmFyIHVsRWxlbSA9IGVsZW1lbnQuZmluZCgndWwnKTsKKyAgICAgICAgICAgICAgICBpZih1bEVsZW0ubGVuZ3RoID4gMCkgeworICAgICAgICAgICAgICAgICAgICB2YXIgbnVtQnV0dG9ucyA9IHJpZ2h0TW9zdEJ1dHRvbkluZGV4KzE7CisgICAgICAgICAgICAgICAgICAgIGlmKG51bUJ1dHRvbnMgPiAyKSB7CisgICAgICAgICAgICAgICAgICAgICAgICB2YXIgb2Zmc2V0ID0gKG51bUJ1dHRvbnMpKjM0LTcwKyhudW1CdXR0b25zLzEuNSkgKyAwLjU7CisgICAgICAgICAgICAgICAgICAgICAgICB2YXIgb2ZmU2V0U3RyID0gb2Zmc2V0KydweCc7CisgICAgICAgICAgICAgICAgICAgICAgICBhbmd1bGFyLmVsZW1lbnQodWxFbGVtKS5jc3MoJ2xlZnQnLG9mZlNldFN0cik7CisgICAgICAgICAgICAgICAgICAgICAgICBhbmd1bGFyLmVsZW1lbnQodWxFbGVtKS5jc3MoJ2JvcmRlci10b3AtbGVmdC1yYWRpdXMnLCcwcHgnKTsKKyAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIGFuZ3VsYXIuZWxlbWVudCh1bEVsZW0pLmNzcygnbGVmdCcsJzBweCcpOworICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgfQorfV0pOworCithbmd1bGFyLm1vZHVsZSgnYXR0LmFicy5zdGVwU2xpZGVyJywgWydhdHQuYWJzLnBvc2l0aW9uJ10pCisgICAgICAgIC5jb25zdGFudCgnc2xpZGVyQ29uc3RhbnRzJywgeworICAgICAgICAgICAgLyoKKyAgICAgICAgICAgICBUaGUgTUlUIExpY2Vuc2UgKE1JVCkKKyAgICAgICAgICAgICBDb3B5cmlnaHQgKGMpIDIwMTMgSnVsaWVuIFZhbMOpcnkKKyAgICAgICAgICAgICAqLworICAgICAgICAgICAgU0xJREVSOiB7CisgICAgICAgICAgICAgICAgc2V0dGluZ3M6IHsKKyAgICAgICAgICAgICAgICAgICAgZnJvbTogMSwKKyAgICAgICAgICAgICAgICAgICAgdG86IDQwLAorICAgICAgICAgICAgICAgICAgICBzdGVwOiAxLAorICAgICAgICAgICAgICAgICAgICBzbW9vdGg6IHRydWUsCisgICAgICAgICAgICAgICAgICAgIGxpbWl0czogdHJ1ZSwKKyAgICAgICAgICAgICAgICAgICAgdmFsdWU6ICIzIiwKKyAgICAgICAgICAgICAgICAgICAgZGltZW5zaW9uOiAiIiwKKyAgICAgICAgICAgICAgICAgICAgdmVydGljYWw6IGZhbHNlCisgICAgICAgICAgICAgICAgfSwKKyAgICAgICAgICAgICAgICBjbGFzc05hbWU6ICJqc2xpZGVyIiwKKyAgICAgICAgICAgICAgICBzZWxlY3RvcjogIi5qc2xpZGVyLSIKKyAgICAgICAgICAgIH0sCisgICAgICAgICAgICBFVkVOVFM6IHsKKyAgICAgICAgICAgIH0sCisgICAgICAgICAgICBDT0xPUlM6IHsKKyAgICAgICAgICAgICAgICBHUkVFTjogJ2dyZWVuJywKKyAgICAgICAgICAgICAgICBCTFVFX0hJR0hMSUdIVDogJ2JsdWUnLAorICAgICAgICAgICAgICAgIE1BR0VOVEE6ICdtYWdlbnRhJywKKyAgICAgICAgICAgICAgICBHT0xEOiAnZ29sZCcsCisgICAgICAgICAgICAgICAgUFVSUExFOiAncHVycGxlJywKKyAgICAgICAgICAgICAgICBEQVJLX0JMVUU6ICdkYXJrLWJsdWUnLAorICAgICAgICAgICAgICAgIFJFR1VMQVI6ICdyZWd1bGFyJywKKyAgICAgICAgICAgICAgICBXSElURTogJ3doaXRlJworICAgICAgICAgICAgfQorICAgICAgICB9KQorICAgICAgICAuZmFjdG9yeSgndXRpbHMnLCBmdW5jdGlvbiAoKSB7CisgICAgICAgICAgICAvKgorICAgICAgICAgICAgIFRoZSBNSVQgTGljZW5zZSAoTUlUKQorICAgICAgICAgICAgIENvcHlyaWdodCAoYykgMjAxMyBKdWxpZW4gVmFsw6lyeQorICAgICAgICAgICAgICovCisgICAgICAgICAgICByZXR1cm4geworICAgICAgICAgICAgICAgIG9mZnNldDogZnVuY3Rpb24gKGVsbSkgeworICAgICAgICAgICAgICAgICAgICB2YXIgcmF3RG9tID0gZWxtWzBdOworICAgICAgICAgICAgICAgICAgICB2YXIgX3ggPSAwOworICAgICAgICAgICAgICAgICAgICB2YXIgX3kgPSAwOworICAgICAgICAgICAgICAgICAgICB2YXIgYm9keSA9IGRvY3VtZW50LmRvY3VtZW50RWxlbWVudCB8fCBkb2N1bWVudC5ib2R5OworICAgICAgICAgICAgICAgICAgICB2YXIgc2Nyb2xsWCA9IHdpbmRvdy5wYWdlWE9mZnNldCB8fCBib2R5LnNjcm9sbExlZnQ7CisgICAgICAgICAgICAgICAgICAgIHZhciBzY3JvbGxZID0gd2luZG93LnBhZ2VZT2Zmc2V0IHx8IGJvZHkuc2Nyb2xsVG9wOworICAgICAgICAgICAgICAgICAgICBfeCA9IHJhd0RvbS5nZXRCb3VuZGluZ0NsaWVudFJlY3QoKS5sZWZ0ICsgc2Nyb2xsWDsKKyAgICAgICAgICAgICAgICAgICAgX3kgPSByYXdEb20uZ2V0Qm91bmRpbmdDbGllbnRSZWN0KCkudG9wICsgc2Nyb2xsWTsKKyAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHtsZWZ0OiBfeCwgdG9wOiBfeX07CisgICAgICAgICAgICAgICAgfSwKKyAgICAgICAgICAgICAgICByb3VuZFVwVG9TY2FsZTogZnVuY3Rpb24gKG1vdXNlUHJjLCBzY2FsZSwgY3V0T2ZmV2lkdGgsIGN1dE9mZkluZGV4KSB7CisgICAgICAgICAgICAgICAgICAgIHZhciBsb3dlclZhbDsKKyAgICAgICAgICAgICAgICAgICAgdmFyIGhpZ2hlclZhbDsKKyAgICAgICAgICAgICAgICAgICAgdmFyIG5ld01vdXNlUHJjOworICAgICAgICAgICAgICAgICAgICB2YXIgbWlkZGxlOworCisgICAgICAgICAgICAgICAgICAgIGZvciAodmFyIGluZGV4ID0gMTsgaW5kZXggPCBzY2FsZS5sZW5ndGg7IGluZGV4KyspIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIGxvd2VyVmFsID0gc2NhbGVbaW5kZXggLSAxXTsKKyAgICAgICAgICAgICAgICAgICAgICAgIGhpZ2hlclZhbCA9IHNjYWxlW2luZGV4XTsKKyAgICAgICAgICAgICAgICAgICAgICAgIG1pZGRsZSA9ICgoaGlnaGVyVmFsIC0gbG93ZXJWYWwpICogLjUpICsgbG93ZXJWYWw7CisgICAgICAgICAgICAgICAgICAgICAgICAvKgorICAgICAgICAgICAgICAgICAgICAgICAgIEhhbmRsZXMgYSBzaXR1YXRpb24gd2hlcmUgdGhlIHVzZXIgY2xpY2tzIGNsb3NlIHRvIHRoZSBzdGFydCBwb2ludCBvZgorICAgICAgICAgICAgICAgICAgICAgICAgIHRoZSBzbGlkZXIgYnV0IHRoZSBwb2ludGVyIGRvZXNuJ3QgbW92ZQorICAgICAgICAgICAgICAgICAgICAgICAgICovCisgICAgICAgICAgICAgICAgICAgICAgICBpZiAoKGxvd2VyVmFsID09PSAwICYmIG1vdXNlUHJjIDw9IG1pZGRsZSkgfHwgY2hlY2tFcXVhbGl0eShsb3dlclZhbCwgbW91c2VQcmMpKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgbmV3TW91c2VQcmMgPSBsb3dlclZhbDsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgIGVsc2UgaWYgKGxvd2VyVmFsIDwgbW91c2VQcmMgJiYgKG1vdXNlUHJjIDwgaGlnaGVyVmFsIHx8CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNoZWNrRXF1YWxpdHkobW91c2VQcmMsIGhpZ2hlclZhbCkpKQorICAgICAgICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgIG5ld01vdXNlUHJjID0gaGlnaGVyVmFsOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgIC8vQ2hlY2sgaWYgdGhlIG5ld01vdXNlUHJjIGlzIDw9IHRoZSBjdXR0T2ZmUG9pbnQKKyAgICAgICAgICAgICAgICAgICAgaWYgKGN1dE9mZldpZHRoICYmIG5ld01vdXNlUHJjIDwgY3V0T2ZmV2lkdGgpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBzY2FsZVtjdXRPZmZJbmRleF07CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgZWxzZSB7CisgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gbmV3TW91c2VQcmM7CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgLyoKKyAgICAgICAgICAgICAgICAgICAgIENoZWNrcyB0byBzZWUgaWYgMiBwb2ludHMgYXJlIHNvIGNsb3NlIHRoYXQgdGhleSBhcmUKKyAgICAgICAgICAgICAgICAgICAgIGJhc2ljYWxseSBlcXVhbC4KKyAgICAgICAgICAgICAgICAgICAgICovCisgICAgICAgICAgICAgICAgICAgIGZ1bmN0aW9uIGNoZWNrRXF1YWxpdHkocG9pbnQxLCBwb2ludDIpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIHZhciBwcmVjaXNpb24gPSAwLjE7CisgICAgICAgICAgICAgICAgICAgICAgICBpZiAoTWF0aC5hYnMocG9pbnQyIC0gcG9pbnQxKSA8PSBwcmVjaXNpb24pIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gdHJ1ZTsKKyAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBmYWxzZTsKKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIH0sCisgICAgICAgICAgICAgICAgdmFsdWVGb3JEaWZmZXJlbnRTY2FsZTogZnVuY3Rpb24gKGZyb20sIHRvLCBwcmMsIHByY1RvVmFsdWVNYXBwZXIpIHsKKyAgICAgICAgICAgICAgICAgICAgdmFyIGRlY2ltYWxQcmMgPSBwcmMgLyAxMDA7CisgICAgICAgICAgICAgICAgICAgIGlmIChkZWNpbWFsUHJjID09PSAwKSB7CisgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gZnJvbTsKKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICByZXR1cm4gcHJjVG9WYWx1ZU1hcHBlcltwcmNdOworICAgICAgICAgICAgICAgIH0sCisgICAgICAgICAgICAgICAgLyogY29udmVydHMgdGhlIGRlZmF1bHQgdmFsdWUgS2JwcyB0byBNYnBzIG9yIEdicHMgKi8KKyAgICAgICAgICAgICAgICBjb252ZXJ0VG9NYnBzR2JwczogZnVuY3Rpb24gKHVuaXRWYWx1ZSwgdW5pdExhYmVsLCBjb25maWdEZWNpbWFsUGxhY2VzKSB7CisgICAgICAgICAgICAgICAgICAgIHZhciBkZWZhdWx0RGVjaW1hbFBsYWNlcyA9IDM7IC8qIHRoaXMgaXMgdGhlIGRlZmF1bHQgZGVjaW1hbCBwbGFjZXMgYXMgcGVyIGJ1c2luZXNzIHJlcXVpcmVtZW50cyAqLworICAgICAgICAgICAgICAgICAgICBpZiAoY29uZmlnRGVjaW1hbFBsYWNlcykgeworICAgICAgICAgICAgICAgICAgICAgICAgZGVmYXVsdERlY2ltYWxQbGFjZXMgPSBjb25maWdEZWNpbWFsUGxhY2VzOworICAgICAgICAgICAgICAgICAgICB9CisKKyAgICAgICAgICAgICAgICAgICAgaWYgKCh1bml0VmFsdWUgPiAxMDI0ICYmIHVuaXRWYWx1ZSA8IDEwMDAwMDApICYmIGFuZ3VsYXIuZXF1YWxzKHVuaXRMYWJlbCwgJ0ticHMnKSkgeworICAgICAgICAgICAgICAgICAgICAgICAgdW5pdFZhbHVlID0gdHJ1bmNhdG9yKCh1bml0VmFsdWUvMTAwMCksIGRlZmF1bHREZWNpbWFsUGxhY2VzKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIHVuaXRMYWJlbCA9ICdNYnBzJzsKKyAgICAgICAgICAgICAgICAgICAgfSBlbHNlIGlmICgodW5pdFZhbHVlID4gMTAyNCAmJiB1bml0VmFsdWUgPCAxMDAwMDAwKSAmJiBhbmd1bGFyLmVxdWFscyh1bml0TGFiZWwsICdNYnBzJykpeworICAgICAgICAgICAgICAgICAgICAgICAgdW5pdFZhbHVlID0gdHJ1bmNhdG9yKCh1bml0VmFsdWUvMTAwMCksIGRlZmF1bHREZWNpbWFsUGxhY2VzKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIHVuaXRMYWJlbCA9ICdNYnBzJzsKKyAgICAgICAgICAgICAgICAgICAgfSBlbHNlIGlmICh1bml0VmFsdWUgPD0gMTAyNCAmJiBhbmd1bGFyLmVxdWFscyh1bml0TGFiZWwsICdNYnBzJykpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIHVuaXRMYWJlbCA9ICdLYnBzJzsKKyAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIHVuaXRMYWJlbCA9ICdLYnBzJzsKKyAgICAgICAgICAgICAgICAgICAgfQorCisgICAgICAgICAgICAgICAgICAgIGlmICh1bml0VmFsdWUgPj0gMTAwMDAwMCAmJiBhbmd1bGFyLmVxdWFscyh1bml0TGFiZWwsICdLYnBzJykpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIHVuaXRWYWx1ZSA9IHRydW5jYXRvcigodW5pdFZhbHVlLzEwMDAwMDApLCBkZWZhdWx0RGVjaW1hbFBsYWNlcyk7CisgICAgICAgICAgICAgICAgICAgICAgICB1bml0TGFiZWwgPSAnR2Jwcyc7CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIHVuaXRWYWx1ZTogdW5pdFZhbHVlLCAKKyAgICAgICAgICAgICAgICAgICAgICAgIHVuaXRMYWJlbDogdW5pdExhYmVsCisgICAgICAgICAgICAgICAgICAgIH07CisgICAgICAgICAgICAgICAgICAgIAorICAgICAgICAgICAgICAgICAgICBmdW5jdGlvbiB0cnVuY2F0b3IobnVtVG9UcnVuY2F0ZSwgaW50RGVjaW1hbFBsYWNlcykgeyAgICAKKyAgICAgICAgICAgICAgICAgICAgICAgIHZhciBjbnZydGROdW0gPSBNYXRoLnBvdygxMCwgaW50RGVjaW1hbFBsYWNlcyk7CisgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gfn4obnVtVG9UcnVuY2F0ZSAqIGNudnJ0ZE51bSkvY252cnRkTnVtOworICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgfSwKKyAgICAgICAgICAgICAgICBnZXRDb252ZXJzaW9uRmFjdG9yVmFsdWU6IGZ1bmN0aW9uICh2YWx1ZSwgY29udmVyc2lvbiwgZmlyc3REaW1lbnNpb24pIHsKKyAgICAgICAgICAgICAgICAgICAgLyoKKyAgICAgICAgICAgICAgICAgICAgIExvb3AgdGhyb3VnaCB0aGUgY29udmVyc2lvbiBhcnJheSBhbmQga2VlcCBjaGVja2luZyB0aGUKKyAgICAgICAgICAgICAgICAgICAgIHN0YXJ0VmFsCisgICAgICAgICAgICAgICAgICAgICAqLworICAgICAgICAgICAgICAgICAgICBpZiAodmFsdWUgPD0gY29udmVyc2lvblswXS5zdGFydFZhbCkgeworICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJueworICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNjYWxlZFZhbDogdmFsdWUsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2NhbGVkRGltZW5zaW9uOiBmaXJzdERpbWVuc2lvbgorICAgICAgICAgICAgICAgICAgICAgICAgfTsKKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICB2YXIgZW5kSW5kZXggPSAwOworICAgICAgICAgICAgICAgICAgICBmb3IgKHZhciBpbmRleCBpbiBjb252ZXJzaW9uKSB7CisgICAgICAgICAgICAgICAgICAgICAgICB2YXIgYyA9IGNvbnZlcnNpb25baW5kZXhdOworICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHZhbHVlID4gYy5zdGFydFZhbCkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGVuZEluZGV4ID0gaW5kZXg7CisgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgdmFyIHNjYWxlRmFjdG9yID0gY29udmVyc2lvbltlbmRJbmRleF0uc2NhbGVGYWN0b3I7CisgICAgICAgICAgICAgICAgICAgIHZhciBzY2FsZWRWYWwgPSB2YWx1ZSAvIHNjYWxlRmFjdG9yOworICAgICAgICAgICAgICAgICAgICB2YXIgc2NhbGVkRGltZW5zaW9uID0gY29udmVyc2lvbltlbmRJbmRleF0uZGltZW5zaW9uOworICAgICAgICAgICAgICAgICAgICByZXR1cm4geworICAgICAgICAgICAgICAgICAgICAgICAgc2NhbGVkVmFsOiBzY2FsZWRWYWwsCisgICAgICAgICAgICAgICAgICAgICAgICBzY2FsZWREaW1lbnNpb246IHNjYWxlZERpbWVuc2lvbgorICAgICAgICAgICAgICAgICAgICB9OworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH07CisgICAgICAgIH0pCisgICAgICAgIC5mYWN0b3J5KCdzbGlkZXJEcmFnZ2FibGUnLCBbJ3V0aWxzJywgZnVuY3Rpb24gKHV0aWxzKSB7CisgICAgICAgICAgICAgICAgLyoKKyAgICAgICAgICAgICAgICAgVGhlIE1JVCBMaWNlbnNlIChNSVQpCisgICAgICAgICAgICAgICAgIENvcHlyaWdodCAoYykgMjAxMyBKdWxpZW4gVmFsw6lyeQorICAgICAgICAgICAgICAgICAqLworICAgICAgICAgICAgICAgIGZ1bmN0aW9uIERyYWdnYWJsZSgpIHsKKyAgICAgICAgICAgICAgICAgICAgdGhpcy5faW5pdC5hcHBseSh0aGlzLCBhcmd1bWVudHMpOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICBEcmFnZ2FibGUucHJvdG90eXBlLm9uaW5pdCA9IGZ1bmN0aW9uICgpIHsKKyAgICAgICAgICAgICAgICB9OworICAgICAgICAgICAgICAgIERyYWdnYWJsZS5wcm90b3R5cGUuZXZlbnRzID0gZnVuY3Rpb24gKCkgeworICAgICAgICAgICAgICAgIH07CisgICAgICAgICAgICAgICAgRHJhZ2dhYmxlLnByb3RvdHlwZS5vbm1vdXNlZG93biA9IGZ1bmN0aW9uICgpIHsKKyAgICAgICAgICAgICAgICAgICAgdGhpcy5wdHIuY3NzKHtwb3NpdGlvbjogImFic29sdXRlIn0pOworICAgICAgICAgICAgICAgIH07CisgICAgICAgICAgICAgICAgRHJhZ2dhYmxlLnByb3RvdHlwZS5vbm1vdXNlbW92ZSA9IGZ1bmN0aW9uIChldnQsIHgsIHkpIHsKKyAgICAgICAgICAgICAgICAgICAgdGhpcy5wdHIuY3NzKHtsZWZ0OiB4LCB0b3A6IHl9KTsKKyAgICAgICAgICAgICAgICB9OworICAgICAgICAgICAgICAgIERyYWdnYWJsZS5wcm90b3R5cGUub25tb3VzZXVwID0gZnVuY3Rpb24gKCkgeworICAgICAgICAgICAgICAgIH07CisgICAgICAgICAgICAgICAgRHJhZ2dhYmxlLnByb3RvdHlwZS5pc0RlZmF1bHQgPSB7CisgICAgICAgICAgICAgICAgICAgIGRyYWc6IGZhbHNlLAorICAgICAgICAgICAgICAgICAgICBjbGlja2VkOiBmYWxzZSwKKyAgICAgICAgICAgICAgICAgICAgdG9jbGljazogdHJ1ZSwKKyAgICAgICAgICAgICAgICAgICAgbW91c2V1cDogZmFsc2UKKyAgICAgICAgICAgICAgICB9OworICAgICAgICAgICAgICAgIERyYWdnYWJsZS5wcm90b3R5cGUuX2luaXQgPSBmdW5jdGlvbiAoKSB7CisgICAgICAgICAgICAgICAgICAgIGlmIChhcmd1bWVudHMubGVuZ3RoID4gMCkgeworICAgICAgICAgICAgICAgICAgICAgICAgdGhpcy5wdHIgPSBhcmd1bWVudHNbMF07CisgICAgICAgICAgICAgICAgICAgICAgICB0aGlzLnBhcmVudCA9IGFyZ3VtZW50c1syXTsKKyAgICAgICAgICAgICAgICAgICAgICAgIGlmICghdGhpcy5wdHIpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm47CisgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICB0aGlzLmlzID0ge307CisgICAgICAgICAgICAgICAgICAgICAgICBhbmd1bGFyLmV4dGVuZCh0aGlzLmlzLCB0aGlzLmlzRGVmYXVsdCk7CisgICAgICAgICAgICAgICAgICAgICAgICB2YXIgb2Zmc2V0ID0gdXRpbHMub2Zmc2V0KHRoaXMucHRyKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIHRoaXMuZCA9IHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBsZWZ0OiBvZmZzZXQubGVmdCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB0b3A6IG9mZnNldC50b3AsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgd2lkdGg6IHRoaXMucHRyWzBdLmNsaWVudFdpZHRoLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIGhlaWdodDogdGhpcy5wdHJbMF0uY2xpZW50SGVpZ2h0CisgICAgICAgICAgICAgICAgICAgICAgICB9OworICAgICAgICAgICAgICAgICAgICAgICAgdGhpcy5vbmluaXQuYXBwbHkodGhpcywgYXJndW1lbnRzKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIHRoaXMuX2V2ZW50cygpOworICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgfTsKKyAgICAgICAgICAgICAgICBEcmFnZ2FibGUucHJvdG90eXBlLl9nZXRQYWdlQ29vcmRzID0gZnVuY3Rpb24gKGV2ZW50KSB7CisgICAgICAgICAgICAgICAgICAgIHZhciB2YWx1ZSA9IHt9OworICAgICAgICAgICAgICAgICAgICBpZiAoZXZlbnQudGFyZ2V0VG91Y2hlcyAmJiBldmVudC50YXJnZXRUb3VjaGVzWzBdKSB7CisgICAgICAgICAgICAgICAgICAgICAgICB2YWx1ZSA9IHt4OiBldmVudC50YXJnZXRUb3VjaGVzWzBdLnBhZ2VYLCB5OiBldmVudC50YXJnZXRUb3VjaGVzWzBdLnBhZ2VZfTsKKyAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIHZhbHVlID0ge3g6IGV2ZW50LnBhZ2VYLCB5OiBldmVudC5wYWdlWX07CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHZhbHVlOworICAgICAgICAgICAgICAgIH07CisgICAgICAgICAgICAgICAgRHJhZ2dhYmxlLnByb3RvdHlwZS5fYmluZEV2ZW50ID0gZnVuY3Rpb24gKHB0ciwgZXZlbnRUeXBlLCBoYW5kbGVyKSB7CisgICAgICAgICAgICAgICAgICAgIGlmICh0aGlzLnN1cHBvcnRUb3VjaGVzXykgeworICAgICAgICAgICAgICAgICAgICAgICAgcHRyWzBdLmF0dGFjaEV2ZW50KHRoaXMuZXZlbnRzX1sgZXZlbnRUeXBlIF0sIGhhbmRsZXIpOworICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgIGVsc2UgeworICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHB0ci5iaW5kKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgcHRyLmJpbmQodGhpcy5ldmVudHNfWyBldmVudFR5cGUgXSwgaGFuZGxlcik7CisgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICB9OworICAgICAgICAgICAgICAgIERyYWdnYWJsZS5wcm90b3R5cGUuX2V2ZW50cyA9IGZ1bmN0aW9uICgpIHsKKyAgICAgICAgICAgICAgICAgICAgdmFyIHNlbGYgPSB0aGlzOworICAgICAgICAgICAgICAgICAgICB0aGlzLnN1cHBvcnRUb3VjaGVzXyA9ICdvbnRvdWNoZW5kJyBpbiBkb2N1bWVudDsKKyAgICAgICAgICAgICAgICAgICAgdGhpcy5ldmVudHNfID0geworICAgICAgICAgICAgICAgICAgICAgICAgImNsaWNrIjogdGhpcy5zdXBwb3J0VG91Y2hlc18gPyAidG91Y2hzdGFydCIgOiAiY2xpY2siLAorICAgICAgICAgICAgICAgICAgICAgICAgImRvd24iOiB0aGlzLnN1cHBvcnRUb3VjaGVzXyA/ICJ0b3VjaHN0YXJ0IiA6ICJtb3VzZWRvd24iLAorICAgICAgICAgICAgICAgICAgICAgICAgIm1vdmUiOiB0aGlzLnN1cHBvcnRUb3VjaGVzXyA/ICJ0b3VjaG1vdmUiIDogIm1vdXNlbW92ZSIsCisgICAgICAgICAgICAgICAgICAgICAgICAidXAiOiB0aGlzLnN1cHBvcnRUb3VjaGVzXyA/ICJ0b3VjaGVuZCIgOiAibW91c2V1cCIsCisgICAgICAgICAgICAgICAgICAgICAgICAibW91c2Vkb3duIjogdGhpcy5zdXBwb3J0VG91Y2hlc18gPyAibW91c2Vkb3duIiA6ICJtb3VzZWRvd24iCisgICAgICAgICAgICAgICAgICAgIH07CisgICAgICAgICAgICAgICAgICAgIHZhciBkb2N1bWVudEVsdCA9IGFuZ3VsYXIuZWxlbWVudCh3aW5kb3cuZG9jdW1lbnQpOworICAgICAgICAgICAgICAgICAgICB0aGlzLl9iaW5kRXZlbnQoZG9jdW1lbnRFbHQsICJtb3ZlIiwgZnVuY3Rpb24gKGV2ZW50KSB7CisgICAgICAgICAgICAgICAgICAgICAgICBpZiAoc2VsZi5pcy5kcmFnKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgZXZlbnQuc3RvcFByb3BhZ2F0aW9uKCk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgZXZlbnQucHJldmVudERlZmF1bHQoKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoIXNlbGYucGFyZW50LmRpc2FibGVkKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNlbGYuX21vdXNlbW92ZShldmVudCk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICB9KTsKKyAgICAgICAgICAgICAgICAgICAgdGhpcy5fYmluZEV2ZW50KGRvY3VtZW50RWx0LCAiZG93biIsIGZ1bmN0aW9uIChldmVudCkgeworICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHNlbGYuaXMuZHJhZykgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGV2ZW50LnN0b3BQcm9wYWdhdGlvbigpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGV2ZW50LnByZXZlbnREZWZhdWx0KCk7CisgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgIH0pOworICAgICAgICAgICAgICAgICAgICB0aGlzLl9iaW5kRXZlbnQoZG9jdW1lbnRFbHQsICJ1cCIsIGZ1bmN0aW9uIChldmVudCkgeworICAgICAgICAgICAgICAgICAgICAgICAgc2VsZi5fbW91c2V1cChldmVudCk7CisgICAgICAgICAgICAgICAgICAgIH0pOworICAgICAgICAgICAgICAgICAgICB0aGlzLl9iaW5kRXZlbnQodGhpcy5wdHIsICJkb3duIiwgZnVuY3Rpb24gKGV2ZW50KSB7CisgICAgICAgICAgICAgICAgICAgICAgICBzZWxmLl9tb3VzZWRvd24oZXZlbnQpOworICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGZhbHNlOworICAgICAgICAgICAgICAgICAgICB9KTsKKyAgICAgICAgICAgICAgICAgICAgdGhpcy5fYmluZEV2ZW50KHRoaXMucHRyLCAidXAiLCBmdW5jdGlvbiAoZXZlbnQpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIHNlbGYuX21vdXNldXAoZXZlbnQpOworICAgICAgICAgICAgICAgICAgICB9KTsKKyAgICAgICAgICAgICAgICAgICAgdGhpcy5ldmVudHMoKTsKKyAgICAgICAgICAgICAgICB9OworICAgICAgICAgICAgICAgIERyYWdnYWJsZS5wcm90b3R5cGUuX21vdXNlZG93biA9IGZ1bmN0aW9uIChldnQpIHsKKyAgICAgICAgICAgICAgICAgICAgdGhpcy5pcy5kcmFnID0gdHJ1ZTsKKyAgICAgICAgICAgICAgICAgICAgdGhpcy5pcy5jbGlja2VkID0gZmFsc2U7CisgICAgICAgICAgICAgICAgICAgIHRoaXMuaXMubW91c2V1cCA9IGZhbHNlOworICAgICAgICAgICAgICAgICAgICB2YXIgY29vcmRzID0gdGhpcy5fZ2V0UGFnZUNvb3JkcyhldnQpOworICAgICAgICAgICAgICAgICAgICB0aGlzLmN4ID0gY29vcmRzLnggLSB0aGlzLnB0clswXS5vZmZzZXRMZWZ0OworICAgICAgICAgICAgICAgICAgICB0aGlzLmN5ID0gY29vcmRzLnkgLSB0aGlzLnB0clswXS5vZmZzZXRUb3A7CisgICAgICAgICAgICAgICAgICAgIGFuZ3VsYXIuZXh0ZW5kKHRoaXMuZCwgeworICAgICAgICAgICAgICAgICAgICAgICAgbGVmdDogdGhpcy5wdHJbMF0ub2Zmc2V0TGVmdCwKKyAgICAgICAgICAgICAgICAgICAgICAgIHRvcDogdGhpcy5wdHJbMF0ub2Zmc2V0VG9wLAorICAgICAgICAgICAgICAgICAgICAgICAgd2lkdGg6IHRoaXMucHRyWzBdLmNsaWVudFdpZHRoLAorICAgICAgICAgICAgICAgICAgICAgICAgaGVpZ2h0OiB0aGlzLnB0clswXS5jbGllbnRIZWlnaHQKKyAgICAgICAgICAgICAgICAgICAgfSk7CisgICAgICAgICAgICAgICAgICAgIGlmICh0aGlzLm91dGVyICYmIHRoaXMub3V0ZXIuZ2V0KDApKSB7CisgICAgICAgICAgICAgICAgICAgICAgICB0aGlzLm91dGVyLmNzcyh7aGVpZ2h0OiBNYXRoLm1heCh0aGlzLm91dGVyLmhlaWdodCgpLCAkKGRvY3VtZW50LmJvZHkpLmhlaWdodCgpKSwgb3ZlcmZsb3c6ICJoaWRkZW4ifSk7CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgdGhpcy5vbm1vdXNlZG93bihldnQpOworICAgICAgICAgICAgICAgIH07CisgICAgICAgICAgICAgICAgRHJhZ2dhYmxlLnByb3RvdHlwZS5fbW91c2Vtb3ZlID0gZnVuY3Rpb24gKGV2dCkgeworICAgICAgICAgICAgICAgICAgICBpZiAodGhpcy51aWQgPT09IDApIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybjsKKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICB0aGlzLmlzLnRvY2xpY2sgPSBmYWxzZTsKKyAgICAgICAgICAgICAgICAgICAgdmFyIGNvb3JkcyA9IHRoaXMuX2dldFBhZ2VDb29yZHMoZXZ0KTsKKyAgICAgICAgICAgICAgICAgICAgdGhpcy5vbm1vdXNlbW92ZShldnQsIGNvb3Jkcy54IC0gdGhpcy5jeCwgY29vcmRzLnkgLSB0aGlzLmN5KTsKKyAgICAgICAgICAgICAgICB9OworICAgICAgICAgICAgICAgIERyYWdnYWJsZS5wcm90b3R5cGUuX21vdXNldXAgPSBmdW5jdGlvbiAoZXZ0KSB7CisgICAgICAgICAgICAgICAgICAgIGlmICh0aGlzLmlzLmRyYWcpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIHRoaXMuaXMuZHJhZyA9IGZhbHNlOworICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHRoaXMub3V0ZXIgJiYgdGhpcy5vdXRlci5nZXQoMCkpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoJC5icm93c2VyLm1vemlsbGEpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdGhpcy5vdXRlci5jc3Moe292ZXJmbG93OiAiaGlkZGVuIn0pOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRoaXMub3V0ZXIuY3NzKHtvdmVyZmxvdzogInZpc2libGUifSk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICgkLmJyb3dzZXIubXNpZSAmJiAkLmJyb3dzZXIudmVyc2lvbiA9PT0gJzYuMCcpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdGhpcy5vdXRlci5jc3Moe2hlaWdodDogIjEwMCUifSk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdGhpcy5vdXRlci5jc3Moe2hlaWdodDogImF1dG8ifSk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgdGhpcy5vbm1vdXNldXAoZXZ0KTsKKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIH07CisgICAgICAgICAgICAgICAgcmV0dXJuIERyYWdnYWJsZTsKKyAgICAgICAgICAgIH1dKQorICAgICAgICAuZmFjdG9yeSgnc2xpZGVyUG9pbnRlcicsIFsnc2xpZGVyRHJhZ2dhYmxlJywgJ3V0aWxzJywgZnVuY3Rpb24gKERyYWdnYWJsZSwgdXRpbHMpIHsKKyAgICAgICAgICAgICAgICAvKgorICAgICAgICAgICAgICAgICBUaGUgTUlUIExpY2Vuc2UgKE1JVCkKKyAgICAgICAgICAgICAgICAgQ29weXJpZ2h0IChjKSAyMDEzIEp1bGllbiBWYWzDqXJ5CisgICAgICAgICAgICAgICAgICovCisgICAgICAgICAgICAgICAgZnVuY3Rpb24gU2xpZGVyUG9pbnRlcigpIHsKKyAgICAgICAgICAgICAgICAgICAgRHJhZ2dhYmxlLmFwcGx5KHRoaXMsIGFyZ3VtZW50cyk7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIFNsaWRlclBvaW50ZXIucHJvdG90eXBlID0gbmV3IERyYWdnYWJsZSgpOworICAgICAgICAgICAgICAgIFNsaWRlclBvaW50ZXIucHJvdG90eXBlLm9uaW5pdCA9IGZ1bmN0aW9uIChwdHIsIGlkLCBfY29uc3RydWN0b3IpIHsKKyAgICAgICAgICAgICAgICAgICAgdGhpcy51aWQgPSBpZDsKKyAgICAgICAgICAgICAgICAgICAgdGhpcy5wYXJlbnQgPSBfY29uc3RydWN0b3I7CisgICAgICAgICAgICAgICAgICAgIHRoaXMudmFsdWUgPSB7fTsKKyAgICAgICAgICAgICAgICAgICAgdGhpcy5zZXR0aW5ncyA9IGFuZ3VsYXIuY29weShfY29uc3RydWN0b3Iuc2V0dGluZ3MpOworICAgICAgICAgICAgICAgIH07CisgICAgICAgICAgICAgICAgU2xpZGVyUG9pbnRlci5wcm90b3R5cGUub25tb3VzZWRvd24gPSBmdW5jdGlvbiAoZXZ0KSB7CisgICAgICAgICAgICAgICAgICAgIHZhciBvZmYgPSB1dGlscy5vZmZzZXQodGhpcy5wYXJlbnQuZG9tTm9kZSk7CisgICAgICAgICAgICAgICAgICAgIHZhciBvZmZzZXQgPSB7CisgICAgICAgICAgICAgICAgICAgICAgICBsZWZ0OiBvZmYubGVmdCwKKyAgICAgICAgICAgICAgICAgICAgICAgIHRvcDogb2ZmLnRvcCwKKyAgICAgICAgICAgICAgICAgICAgICAgIHdpZHRoOiB0aGlzLnBhcmVudC5kb21Ob2RlWzBdLmNsaWVudFdpZHRoLAorICAgICAgICAgICAgICAgICAgICAgICAgaGVpZ2h0OiB0aGlzLnBhcmVudC5kb21Ob2RlWzBdLmNsaWVudEhlaWdodAorICAgICAgICAgICAgICAgICAgICB9OworICAgICAgICAgICAgICAgICAgICB0aGlzLl9wYXJlbnQgPSB7CisgICAgICAgICAgICAgICAgICAgICAgICBvZmZzZXQ6IG9mZnNldCwKKyAgICAgICAgICAgICAgICAgICAgICAgIHdpZHRoOiBvZmZzZXQud2lkdGgsCisgICAgICAgICAgICAgICAgICAgICAgICBoZWlnaHQ6IG9mZnNldC5oZWlnaHQKKyAgICAgICAgICAgICAgICAgICAgfTsKKyAgICAgICAgICAgICAgICAgICAgdGhpcy5wdHIuYWRkQ2xhc3MoImpzbGlkZXItcG9pbnRlci1ob3ZlciIpOworICAgICAgICAgICAgICAgICAgICB0aGlzLnNldEluZGV4T3ZlcigpOworICAgICAgICAgICAgICAgIH07CisgICAgICAgICAgICAgICAgU2xpZGVyUG9pbnRlci5wcm90b3R5cGUub25tb3VzZW1vdmUgPSBmdW5jdGlvbiAoZXZ0LCB4LCB5KSB7CisgICAgICAgICAgICAgICAgICAgIHZhciBjb29yZHMgPSB0aGlzLl9nZXRQYWdlQ29vcmRzKGV2dCk7CisgICAgICAgICAgICAgICAgICAgIC8vdmFsIGlzIHRoZSBwZXJjZW50IHdoZXJlIHRoZSBzbGlkZXIgcG9pbnRlciBpcyBsb2NhdGVkCisgICAgICAgICAgICAgICAgICAgIHZhciB2YWwgPSB0aGlzLmNhbGMoY29vcmRzLngpOworICAgICAgICAgICAgICAgICAgICBpZiAoIXRoaXMucGFyZW50LnNldHRpbmdzLnNtb290aCkgeworICAgICAgICAgICAgICAgICAgICAgICAgdmFsID0gdXRpbHMucm91bmRVcFRvU2NhbGUodmFsLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0aGlzLnBhcmVudC5zZXR0aW5ncy5zY2FsZSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdGhpcy5wYXJlbnQuc2V0dGluZ3MuY3V0T2ZmV2lkdGgsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRoaXMucGFyZW50LnNldHRpbmdzLmN1dE9mZkluZGV4KTsKKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICB2YXIgY3V0T2ZmV2lkdGggPSB0aGlzLnBhcmVudC5zZXR0aW5ncy5jdXRPZmZXaWR0aDsKKyAgICAgICAgICAgICAgICAgICAgaWYgKGN1dE9mZldpZHRoICYmIHZhbCA8IGN1dE9mZldpZHRoKSB7CisgICAgICAgICAgICAgICAgICAgICAgICB2YWwgPSBjdXRPZmZXaWR0aDsKKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICB0aGlzLl9zZXQodmFsKTsKKyAgICAgICAgICAgICAgICB9OworICAgICAgICAgICAgICAgIFNsaWRlclBvaW50ZXIucHJvdG90eXBlLm9ubW91c2V1cCA9IGZ1bmN0aW9uIChldnQpIHsKKyAgICAgICAgICAgICAgICAgICAgaWYgKHRoaXMuc2V0dGluZ3MuY2FsbGJhY2sgJiYgYW5ndWxhci5pc0Z1bmN0aW9uKHRoaXMuc2V0dGluZ3MuY2FsbGJhY2spKSB7CisgICAgICAgICAgICAgICAgICAgICAgICB2YXIgdmFsID0gdGhpcy5wYXJlbnQuZ2V0VmFsdWUoKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIHRoaXMuc2V0dGluZ3MuY2FsbGJhY2suY2FsbCh0aGlzLnBhcmVudCwgdmFsKTsKKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICB0aGlzLnB0ci5yZW1vdmVDbGFzcygianNsaWRlci1wb2ludGVyLWhvdmVyIik7CisgICAgICAgICAgICAgICAgfTsKKyAgICAgICAgICAgICAgICBTbGlkZXJQb2ludGVyLnByb3RvdHlwZS5zZXRJbmRleE92ZXIgPSBmdW5jdGlvbiAoKSB7CisgICAgICAgICAgICAgICAgICAgIHRoaXMucGFyZW50LnNldFBvaW50ZXJzSW5kZXgoMSk7CisgICAgICAgICAgICAgICAgICAgIHRoaXMuaW5kZXgoMik7CisgICAgICAgICAgICAgICAgfTsKKyAgICAgICAgICAgICAgICBTbGlkZXJQb2ludGVyLnByb3RvdHlwZS5pbmRleCA9IGZ1bmN0aW9uIChpKSB7CisgICAgICAgICAgICAgICAgfTsKKyAgICAgICAgICAgICAgICBTbGlkZXJQb2ludGVyLnByb3RvdHlwZS5saW1pdHMgPSBmdW5jdGlvbiAoeCkgeworICAgICAgICAgICAgICAgICAgICByZXR1cm4gdGhpcy5wYXJlbnQubGltaXRzKHgsIHRoaXMpOworICAgICAgICAgICAgICAgIH07CisgICAgICAgICAgICAgICAgU2xpZGVyUG9pbnRlci5wcm90b3R5cGUuY2FsYyA9IGZ1bmN0aW9uIChjb29yZHMpIHsKKyAgICAgICAgICAgICAgICAgICAgdmFyIGRpZmYgPSBjb29yZHMgLSB0aGlzLl9wYXJlbnQub2Zmc2V0LmxlZnQ7CisgICAgICAgICAgICAgICAgICAgIHZhciB2YWwgPSB0aGlzLmxpbWl0cygoZGlmZiAqIDEwMCkgLyB0aGlzLl9wYXJlbnQud2lkdGgpOworICAgICAgICAgICAgICAgICAgICByZXR1cm4gdmFsOworICAgICAgICAgICAgICAgIH07CisgICAgICAgICAgICAgICAgU2xpZGVyUG9pbnRlci5wcm90b3R5cGUuc2V0ID0gZnVuY3Rpb24gKHZhbHVlLCBvcHRfb3JpZ2luKSB7CisgICAgICAgICAgICAgICAgICAgIHRoaXMudmFsdWUub3JpZ2luID0gdGhpcy5wYXJlbnQucm91bmQodmFsdWUpOworICAgICAgICAgICAgICAgICAgICB0aGlzLl9zZXQodGhpcy5wYXJlbnQudmFsdWVUb1ByYyh2YWx1ZSwgdGhpcyksIG9wdF9vcmlnaW4pOworICAgICAgICAgICAgICAgIH07CisgICAgICAgICAgICAgICAgU2xpZGVyUG9pbnRlci5wcm90b3R5cGUuX3NldCA9IGZ1bmN0aW9uIChwcmMsIG9wdF9vcmlnaW4pIHsKKyAgICAgICAgICAgICAgICAgICAgaWYgKCFvcHRfb3JpZ2luKSB7CisgICAgICAgICAgICAgICAgICAgICAgICB0aGlzLnZhbHVlLm9yaWdpbiA9IHRoaXMucGFyZW50LnByY1RvVmFsdWUocHJjKTsKKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICB0aGlzLnZhbHVlLnByYyA9IHByYzsKKyAgICAgICAgICAgICAgICAgICAgLy9TZXRzIHRoZSBsb2NhdGlvbiBvZiB0aGUgU2xpZGVyUG9pbnRlcgorICAgICAgICAgICAgICAgICAgICB0aGlzLnB0ci5jc3Moe2xlZnQ6IHByYyArICclJ30pOworICAgICAgICAgICAgICAgICAgICB0aGlzLnBhcmVudC5yZWRyYXcodGhpcyk7CisgICAgICAgICAgICAgICAgfTsKKyAgICAgICAgICAgICAgICByZXR1cm4gU2xpZGVyUG9pbnRlcjsKKyAgICAgICAgICAgIH1dKQorICAgICAgICAuZmFjdG9yeSgnc2xpZGVyJywgWydzbGlkZXJQb2ludGVyJywgJ3NsaWRlckNvbnN0YW50cycsICd1dGlscycsIGZ1bmN0aW9uIChTbGlkZXJQb2ludGVyLCBzbGlkZXJDb25zdGFudHMsIHV0aWxzKSB7CisgICAgICAgICAgICAgICAgLyoKKyAgICAgICAgICAgICAgICAgVGhlIE1JVCBMaWNlbnNlIChNSVQpCisgICAgICAgICAgICAgICAgIENvcHlyaWdodCAoYykgMjAxMyBKdWxpZW4gVmFsw6lyeQorICAgICAgICAgICAgICAgICAqLworICAgICAgICAgICAgICAgIHZhciBjdXRPZmZEb207CisgICAgICAgICAgICAgICAgZnVuY3Rpb24gU2xpZGVyKCkgeworICAgICAgICAgICAgICAgICAgICByZXR1cm4gdGhpcy5pbml0LmFwcGx5KHRoaXMsIGFyZ3VtZW50cyk7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIGZ1bmN0aW9uIGNoYW5nZUN1dE9mZldpZHRoKHdpZHRoKSB7CisgICAgICAgICAgICAgICAgICAgIGN1dE9mZkRvbS5jc3MoJ3dpZHRoJywgd2lkdGgpOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICA7CisgICAgICAgICAgICAgICAgU2xpZGVyLnByb3RvdHlwZS5jaGFuZ2VDdXRPZmZXaWR0aCA9IGNoYW5nZUN1dE9mZldpZHRoOworICAgICAgICAgICAgICAgIFNsaWRlci5wcm90b3R5cGUuaW5pdCA9IGZ1bmN0aW9uIChpbnB1dE5vZGUsIHRlbXBsYXRlTm9kZSwgc2V0dGluZ3MpIHsKKyAgICAgICAgICAgICAgICAgICAgdGhpcy5zZXR0aW5ncyA9IHNsaWRlckNvbnN0YW50cy5TTElERVIuc2V0dGluZ3M7CisgICAgICAgICAgICAgICAgICAgIGFuZ3VsYXIuZXh0ZW5kKHRoaXMuc2V0dGluZ3MsIGFuZ3VsYXIuY29weShzZXR0aW5ncykpOworICAgICAgICAgICAgICAgICAgICB0aGlzLmlucHV0Tm9kZSA9IGlucHV0Tm9kZTsKKyAgICAgICAgICAgICAgICAgICAgdGhpcy5pbnB1dE5vZGUuYWRkQ2xhc3MoIm5nLWhpZGUiKTsKKyAgICAgICAgICAgICAgICAgICAgdGhpcy5zZXR0aW5ncy5pbnRlcnZhbCA9IHRoaXMuc2V0dGluZ3MudG8gLSB0aGlzLnNldHRpbmdzLmZyb207CisgICAgICAgICAgICAgICAgICAgIGlmICh0aGlzLnNldHRpbmdzLmNhbGN1bGF0ZSAmJiAkLmlzRnVuY3Rpb24odGhpcy5zZXR0aW5ncy5jYWxjdWxhdGUpKSB7CisgICAgICAgICAgICAgICAgICAgICAgICB0aGlzLm5pY2UgPSB0aGlzLnNldHRpbmdzLmNhbGN1bGF0ZTsKKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICBpZiAodGhpcy5zZXR0aW5ncy5vbnN0YXRlY2hhbmdlICYmICQuaXNGdW5jdGlvbih0aGlzLnNldHRpbmdzLm9uc3RhdGVjaGFuZ2UpKSB7CisgICAgICAgICAgICAgICAgICAgICAgICB0aGlzLm9uc3RhdGVjaGFuZ2UgPSB0aGlzLnNldHRpbmdzLm9uc3RhdGVjaGFuZ2U7CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgdGhpcy5pcyA9IHtpbml0OiBmYWxzZX07CisgICAgICAgICAgICAgICAgICAgIHRoaXMubyA9IHt9OworICAgICAgICAgICAgICAgICAgICB0aGlzLmNyZWF0ZSh0ZW1wbGF0ZU5vZGUpOworICAgICAgICAgICAgICAgIH07CisgICAgICAgICAgICAgICAgU2xpZGVyLnByb3RvdHlwZS5jcmVhdGUgPSBmdW5jdGlvbiAodGVtcGxhdGVOb2RlKSB7CisgICAgICAgICAgICAgICAgICAgIHZhciAkdGhpcyA9IHRoaXM7CisgICAgICAgICAgICAgICAgICAgIHRoaXMuZG9tTm9kZSA9IHRlbXBsYXRlTm9kZTsKKyAgICAgICAgICAgICAgICAgICAgdmFyIG9mZiA9IHV0aWxzLm9mZnNldCh0aGlzLmRvbU5vZGUpOworICAgICAgICAgICAgICAgICAgICB2YXIgb2Zmc2V0ID0geworICAgICAgICAgICAgICAgICAgICAgICAgbGVmdDogb2ZmLmxlZnQsCisgICAgICAgICAgICAgICAgICAgICAgICB0b3A6IG9mZi50b3AsCisgICAgICAgICAgICAgICAgICAgICAgICB3aWR0aDogdGhpcy5kb21Ob2RlWzBdLmNsaWVudFdpZHRoLAorICAgICAgICAgICAgICAgICAgICAgICAgaGVpZ2h0OiB0aGlzLmRvbU5vZGVbMF0uY2xpZW50SGVpZ2h0CisgICAgICAgICAgICAgICAgICAgIH07CisgICAgICAgICAgICAgICAgICAgIHRoaXMuc2l6ZXMgPSB7ZG9tV2lkdGg6IHRoaXMuZG9tTm9kZVswXS5jbGllbnRXaWR0aCwgZG9tT2Zmc2V0OiBvZmZzZXR9OworICAgICAgICAgICAgICAgICAgICBhbmd1bGFyLmV4dGVuZCh0aGlzLm8sIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIHBvaW50ZXJzOiB7fSwKKyAgICAgICAgICAgICAgICAgICAgICAgIGxhYmVsczogeworICAgICAgICAgICAgICAgICAgICAgICAgICAgIDA6IHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbzogYW5ndWxhci5lbGVtZW50KHRoaXMuZG9tTm9kZS5maW5kKCdkaXYnKVs1XSkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB9LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIDE6IHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbzogYW5ndWxhci5lbGVtZW50KHRoaXMuZG9tTm9kZS5maW5kKCdkaXYnKVs2XSkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICB9LAorICAgICAgICAgICAgICAgICAgICAgICAgbGltaXRzOiB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgMDogYW5ndWxhci5lbGVtZW50KHRoaXMuZG9tTm9kZS5maW5kKCdkaXYnKVszXSksCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgMTogYW5ndWxhci5lbGVtZW50KHRoaXMuZG9tTm9kZS5maW5kKCdkaXYnKVs1XSkKKyAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgfSk7CisgICAgICAgICAgICAgICAgICAgIGFuZ3VsYXIuZXh0ZW5kKHRoaXMuby5sYWJlbHNbMF0sIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIHZhbHVlOiB0aGlzLm8ubGFiZWxzWzBdLm8uZmluZCgic3BhbiIpCisgICAgICAgICAgICAgICAgICAgIH0pOworICAgICAgICAgICAgICAgICAgICBhbmd1bGFyLmV4dGVuZCh0aGlzLm8ubGFiZWxzWzFdLCB7CisgICAgICAgICAgICAgICAgICAgICAgICB2YWx1ZTogdGhpcy5vLmxhYmVsc1sxXS5vLmZpbmQoInNwYW4iKQorICAgICAgICAgICAgICAgICAgICB9KTsKKyAgICAgICAgICAgICAgICAgICAgaWYgKCEkdGhpcy5zZXR0aW5ncy52YWx1ZS5zcGxpdCgiOyIpWzFdKSB7CisgICAgICAgICAgICAgICAgICAgICAgICB0aGlzLnNldHRpbmdzLnNpbmdsZSA9IHRydWU7CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgdmFyIGRvbU5vZGVEaXZzID0gdGhpcy5kb21Ob2RlLmZpbmQoJ2RpdicpOworICAgICAgICAgICAgICAgICAgICBjdXRPZmZEb20gPSBhbmd1bGFyLmVsZW1lbnQoZG9tTm9kZURpdnNbOF0pOworICAgICAgICAgICAgICAgICAgICBpZiAoY3V0T2ZmRG9tICYmIGN1dE9mZkRvbS5jc3MpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIGN1dE9mZkRvbS5jc3MoJ3dpZHRoJywgJzAlJyk7CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgdmFyIHBvaW50ZXJzID0gW2FuZ3VsYXIuZWxlbWVudChkb21Ob2RlRGl2c1sxXSksIGFuZ3VsYXIuZWxlbWVudChkb21Ob2RlRGl2c1syXSldOworICAgICAgICAgICAgICAgICAgICBhbmd1bGFyLmZvckVhY2gocG9pbnRlcnMsIGZ1bmN0aW9uIChwb2ludGVyLCBrZXkpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICR0aGlzLnNldHRpbmdzID0gYW5ndWxhci5jb3B5KCR0aGlzLnNldHRpbmdzKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIHZhciB2YWx1ZSA9ICR0aGlzLnNldHRpbmdzLnZhbHVlLnNwbGl0KCc7Jylba2V5XTsKKyAgICAgICAgICAgICAgICAgICAgICAgIGlmICh2YWx1ZSkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICR0aGlzLm8ucG9pbnRlcnNba2V5XSA9IG5ldyBTbGlkZXJQb2ludGVyKHBvaW50ZXIsIGtleSwgJHRoaXMpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhciBwcmV2ID0gJHRoaXMuc2V0dGluZ3MudmFsdWUuc3BsaXQoJzsnKVtrZXkgLSAxXTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAocHJldiAmJiBwYXJzZUludCh2YWx1ZSwgMTApIDwgcGFyc2VJbnQocHJldiwgMTApKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhbHVlID0gcHJldjsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFyIHZhbHVlMSA9IHZhbHVlIDwgJHRoaXMuc2V0dGluZ3MuZnJvbSA/ICR0aGlzLnNldHRpbmdzLmZyb20gOiB2YWx1ZTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YWx1ZTEgPSB2YWx1ZSA+ICR0aGlzLnNldHRpbmdzLnRvID8gJHRoaXMuc2V0dGluZ3MudG8gOiB2YWx1ZTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAkdGhpcy5vLnBvaW50ZXJzW2tleV0uc2V0KHZhbHVlMSwgdHJ1ZSk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGtleSA9PT0gMCkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAkdGhpcy5kb21Ob2RlLmJpbmQoJ21vdXNlZG93bicsICR0aGlzLmNsaWNrSGFuZGxlci5hcHBseSgkdGhpcykpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgfSk7CisgICAgICAgICAgICAgICAgICAgIHRoaXMuby52YWx1ZSA9IGFuZ3VsYXIuZWxlbWVudCh0aGlzLmRvbU5vZGUuZmluZCgiaSIpWzJdKTsKKyAgICAgICAgICAgICAgICAgICAgdGhpcy5pcy5pbml0ID0gdHJ1ZTsKKyAgICAgICAgICAgICAgICAgICAgYW5ndWxhci5mb3JFYWNoKHRoaXMuby5wb2ludGVycywgZnVuY3Rpb24gKHBvaW50ZXIpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICR0aGlzLnJlZHJhdyhwb2ludGVyKTsKKyAgICAgICAgICAgICAgICAgICAgfSk7CisgICAgICAgICAgICAgICAgfTsKKyAgICAgICAgICAgICAgICBTbGlkZXIucHJvdG90eXBlLmNsaWNrSGFuZGxlciA9IGZ1bmN0aW9uICgpIHsKKyAgICAgICAgICAgICAgICAgICAgdmFyIHNlbGYgPSB0aGlzOworICAgICAgICAgICAgICAgICAgICByZXR1cm4gZnVuY3Rpb24gKGV2dCkgeworICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHNlbGYuZGlzYWJsZWQpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm47CisgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICB2YXIgY2xhc3NOYW1lID0gZXZ0LnRhcmdldC5jbGFzc05hbWU7CisgICAgICAgICAgICAgICAgICAgICAgICB2YXIgdGFyZ2V0SWR4ID0gMDsKKyAgICAgICAgICAgICAgICAgICAgICAgIGlmIChjbGFzc05hbWUuaW5kZXhPZignanNsaWRlci1wb2ludGVyLXRvJykgPiAwKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgdGFyZ2V0SWR4ID0gMTsKKyAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgIHZhciBfb2ZmID0gdXRpbHMub2Zmc2V0KHNlbGYuZG9tTm9kZSk7CisgICAgICAgICAgICAgICAgICAgICAgICB2YXIgb2Zmc2V0ID0geworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxlZnQ6IF9vZmYubGVmdCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB0b3A6IF9vZmYudG9wLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIHdpZHRoOiBzZWxmLmRvbU5vZGVbMF0uY2xpZW50V2lkdGgsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgaGVpZ2h0OiBzZWxmLmRvbU5vZGVbMF0uY2xpZW50SGVpZ2h0CisgICAgICAgICAgICAgICAgICAgICAgICB9OworICAgICAgICAgICAgICAgICAgICAgICAgdGFyZ2V0SWR4ID0gMTsKKyAgICAgICAgICAgICAgICAgICAgICAgIHZhciB0YXJnZXRQdHIgPSBzZWxmLm8ucG9pbnRlcnNbdGFyZ2V0SWR4XTsKKyAgICAgICAgICAgICAgICAgICAgICAgIHRhcmdldFB0ci5fcGFyZW50ID0ge29mZnNldDogb2Zmc2V0LCB3aWR0aDogb2Zmc2V0LndpZHRoLCBoZWlnaHQ6IG9mZnNldC5oZWlnaHR9OworICAgICAgICAgICAgICAgICAgICAgICAgdGFyZ2V0UHRyLl9tb3VzZW1vdmUoZXZ0KTsKKyAgICAgICAgICAgICAgICAgICAgICAgIHRhcmdldFB0ci5vbm1vdXNldXAoKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBmYWxzZTsKKyAgICAgICAgICAgICAgICAgICAgfTsKKyAgICAgICAgICAgICAgICB9OworICAgICAgICAgICAgICAgIFNsaWRlci5wcm90b3R5cGUuZGlzYWJsZSA9IGZ1bmN0aW9uIChib29sKSB7CisgICAgICAgICAgICAgICAgICAgIHRoaXMuZGlzYWJsZWQgPSBib29sOworICAgICAgICAgICAgICAgIH07CisgICAgICAgICAgICAgICAgU2xpZGVyLnByb3RvdHlwZS5uaWNlID0gZnVuY3Rpb24gKHZhbHVlKSB7CisgICAgICAgICAgICAgICAgICAgIHJldHVybiB2YWx1ZTsKKyAgICAgICAgICAgICAgICB9OworICAgICAgICAgICAgICAgIFNsaWRlci5wcm90b3R5cGUub25zdGF0ZWNoYW5nZSA9IGZ1bmN0aW9uICgpIHsKKyAgICAgICAgICAgICAgICB9OworICAgICAgICAgICAgICAgIFNsaWRlci5wcm90b3R5cGUubGltaXRzID0gZnVuY3Rpb24gKHgsIHBvaW50ZXIpIHsKKyAgICAgICAgICAgICAgICAgICAgaWYgKCF0aGlzLnNldHRpbmdzLnNtb290aCkgeworICAgICAgICAgICAgICAgICAgICAgICAgdmFyIHN0ZXAgPSB0aGlzLnNldHRpbmdzLnN0ZXAgKiAxMDAgLyAodGhpcy5zZXR0aW5ncy5pbnRlcnZhbCk7CisgICAgICAgICAgICAgICAgICAgICAgICB4ID0gTWF0aC5yb3VuZCh4IC8gc3RlcCkgKiBzdGVwOworICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgIHZhciBhbm90aGVyID0gdGhpcy5vLnBvaW50ZXJzWzEgLSBwb2ludGVyLnVpZF07CisgICAgICAgICAgICAgICAgICAgIGlmIChhbm90aGVyICYmIHBvaW50ZXIudWlkICYmIHggPCBhbm90aGVyLnZhbHVlLnByYykgeworICAgICAgICAgICAgICAgICAgICAgICAgeCA9IGFub3RoZXIudmFsdWUucHJjOworICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgIGlmIChhbm90aGVyICYmICFwb2ludGVyLnVpZCAmJiB4ID4gYW5vdGhlci52YWx1ZS5wcmMpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIHggPSBhbm90aGVyLnZhbHVlLnByYzsKKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICBpZiAoeCA8IDApIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIHggPSAwOworICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgIGlmICh4ID4gMTAwKSB7CisgICAgICAgICAgICAgICAgICAgICAgICB4ID0gMTAwOworICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgIHZhciB2YWwgPSBNYXRoLnJvdW5kKHggKiAxMCkgLyAxMDsKKyAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHZhbDsKKyAgICAgICAgICAgICAgICB9OworICAgICAgICAgICAgICAgIFNsaWRlci5wcm90b3R5cGUuc2V0UG9pbnRlcnNJbmRleCA9IGZ1bmN0aW9uIChpKSB7CisgICAgICAgICAgICAgICAgICAgIGFuZ3VsYXIuZm9yRWFjaCh0aGlzLmdldFBvaW50ZXJzKCksIGZ1bmN0aW9uIChwb2ludGVyLCBpKSB7CisgICAgICAgICAgICAgICAgICAgICAgICBwb2ludGVyLmluZGV4KGkpOworICAgICAgICAgICAgICAgICAgICB9KTsKKyAgICAgICAgICAgICAgICB9OworICAgICAgICAgICAgICAgIFNsaWRlci5wcm90b3R5cGUuZ2V0UG9pbnRlcnMgPSBmdW5jdGlvbiAoKSB7CisgICAgICAgICAgICAgICAgICAgIHJldHVybiB0aGlzLm8ucG9pbnRlcnM7CisgICAgICAgICAgICAgICAgfTsKKyAgICAgICAgICAgICAgICBTbGlkZXIucHJvdG90eXBlLm9ucmVzaXplID0gZnVuY3Rpb24gKCkgeworICAgICAgICAgICAgICAgICAgICB2YXIgc2VsZiA9IHRoaXM7CisgICAgICAgICAgICAgICAgICAgIHRoaXMuc2l6ZXMgPSB7CisgICAgICAgICAgICAgICAgICAgICAgICBkb21XaWR0aDogdGhpcy5kb21Ob2RlWzBdLmNsaWVudFdpZHRoLAorICAgICAgICAgICAgICAgICAgICAgICAgZG9tSGVpZ2h0OiB0aGlzLmRvbU5vZGVbMF0uY2xpZW50SGVpZ2h0LAorICAgICAgICAgICAgICAgICAgICAgICAgZG9tT2Zmc2V0OiB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgbGVmdDogdGhpcy5kb21Ob2RlWzBdLm9mZnNldExlZnQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgdG9wOiB0aGlzLmRvbU5vZGVbMF0ub2Zmc2V0VG9wLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIHdpZHRoOiB0aGlzLmRvbU5vZGVbMF0uY2xpZW50V2lkdGgsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgaGVpZ2h0OiB0aGlzLmRvbU5vZGVbMF0uY2xpZW50SGVpZ2h0CisgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgIH07CisgICAgICAgICAgICAgICAgICAgIGFuZ3VsYXIuZm9yRWFjaCh0aGlzLm8ucG9pbnRlcnMsIGZ1bmN0aW9uIChwdHIsIGtleSkgeworICAgICAgICAgICAgICAgICAgICAgICAgc2VsZi5yZWRyYXcocHRyKTsKKyAgICAgICAgICAgICAgICAgICAgfSk7CisgICAgICAgICAgICAgICAgfTsKKyAgICAgICAgICAgICAgICBTbGlkZXIucHJvdG90eXBlLnVwZGF0ZSA9IGZ1bmN0aW9uICgpIHsKKyAgICAgICAgICAgICAgICAgICAgdGhpcy5vbnJlc2l6ZSgpOworICAgICAgICAgICAgICAgICAgICB0aGlzLmRyYXdTY2FsZSgpOworICAgICAgICAgICAgICAgIH07CisgICAgICAgICAgICAgICAgU2xpZGVyLnByb3RvdHlwZS5kcmF3U2NhbGUgPSBmdW5jdGlvbiAoKSB7CisgICAgICAgICAgICAgICAgfTsKKyAgICAgICAgICAgICAgICBTbGlkZXIucHJvdG90eXBlLnJlZHJhdyA9IGZ1bmN0aW9uIChwb2ludGVyKSB7CisgICAgICAgICAgICAgICAgICAgIGlmICghdGhpcy5zZXR0aW5ncy5zbW9vdGgpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIHZhciBuZXdNb3VzZVByYyA9IHV0aWxzLnJvdW5kVXBUb1NjYWxlKHBvaW50ZXIudmFsdWUucHJjLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0aGlzLnNldHRpbmdzLnNjYWxlLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0aGlzLnNldHRpbmdzLmN1dE9mZldpZHRoLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0aGlzLnNldHRpbmdzLmN1dE9mZkluZGV4KTsKKyAgICAgICAgICAgICAgICAgICAgICAgIHBvaW50ZXIudmFsdWUub3JpZ2luID0gbmV3TW91c2VQcmM7CisgICAgICAgICAgICAgICAgICAgICAgICBwb2ludGVyLnZhbHVlLnByYyA9IG5ld01vdXNlUHJjOworICAgICAgICAgICAgICAgICAgICB9CisKKyAgICAgICAgICAgICAgICAgICAgaWYgKCF0aGlzLmlzLmluaXQpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBmYWxzZTsKKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICB0aGlzLnNldFZhbHVlKCk7CisgICAgICAgICAgICAgICAgICAgIHZhciB3aWR0aCA9IHRoaXMuby5wb2ludGVyc1sxXS52YWx1ZS5wcmM7CisgICAgICAgICAgICAgICAgICAgIHZhciBuZXdQb3MgPSB7bGVmdDogJzAlJywgd2lkdGg6IHdpZHRoICsgJyUnfTsKKyAgICAgICAgICAgICAgICAgICAgdGhpcy5vLnZhbHVlLmNzcyhuZXdQb3MpOworICAgICAgICAgICAgICAgICAgICB2YXIgaHRtbFZhbHVlID0gdGhpcy5uaWNlKHBvaW50ZXIudmFsdWUub3JpZ2luKTsKKyAgICAgICAgICAgICAgICAgICAgdmFyIHNjYWxlZERpbWVuc2lvbiA9IHRoaXMuc2V0dGluZ3MuZmlyc3REaW1lbnNpb247CisgICAgICAgICAgICAgICAgICAgIGlmICh0aGlzLnNldHRpbmdzLnN0ZXBXaXRoRGlmZmVyZW50U2NhbGUgJiYgIXRoaXMuc2V0dGluZ3Muc21vb3RoKSB7CisgICAgICAgICAgICAgICAgICAgICAgICBodG1sVmFsdWUgPSB1dGlscy52YWx1ZUZvckRpZmZlcmVudFNjYWxlKHRoaXMuc2V0dGluZ3MuZnJvbSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdGhpcy5zZXR0aW5ncy50bywgaHRtbFZhbHVlLCB0aGlzLnNldHRpbmdzLnByY1RvVmFsdWVNYXBwZXIpOworICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgIC8vVGhpcyBpcyB0aGUgYmFzZSB2YWx1ZSBiZWZvcmUgdGhlIGNvbnZlcnNpb24KKyAgICAgICAgICAgICAgICAgICAgaWYgKHRoaXMuc2V0dGluZ3MucmVhbHRpbWVDYWxsYmFjayAmJiBhbmd1bGFyLmlzRnVuY3Rpb24odGhpcy5zZXR0aW5ncy5yZWFsdGltZUNhbGxiYWNrKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIHRoaXMuc2V0dGluZ3MuY3V0T2ZmVmFsICE9PSB1bmRlZmluZWQgJiYgcG9pbnRlci51aWQgPT09IDEpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIHRoaXMuc2V0dGluZ3MucmVhbHRpbWVDYWxsYmFjayhodG1sVmFsdWUpOworICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgIC8vTmVlZCB0byBjaGFuZ2UgdGhpcyB0byB0aGUgY29ycmVjdCB2YWx1ZSBmb3IgdGhlIHNjYWxlCisgICAgICAgICAgICAgICAgICAgIGlmICh0aGlzLnNldHRpbmdzLmNvbnZlcnNpb24pIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIHZhciBjb252ZXJzaW9uT2JqID0gdXRpbHMuZ2V0Q29udmVyc2lvbkZhY3RvclZhbHVlKHBhcnNlSW50KGh0bWxWYWx1ZSksCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRoaXMuc2V0dGluZ3MuY29udmVyc2lvbiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdGhpcy5zZXR0aW5ncy5maXJzdERpbWVuc2lvbik7CisgICAgICAgICAgICAgICAgICAgICAgICBodG1sVmFsdWUgPSBjb252ZXJzaW9uT2JqLnNjYWxlZFZhbDsKKyAgICAgICAgICAgICAgICAgICAgICAgIHNjYWxlZERpbWVuc2lvbiA9IGNvbnZlcnNpb25PYmouc2NhbGVkRGltZW5zaW9uOworICAgICAgICAgICAgICAgICAgICB9CisKKyAgICAgICAgICAgICAgICAgICAgaHRtbFZhbHVlID0gcGFyc2VGbG9hdChodG1sVmFsdWUpOworICAgICAgICAgICAgICAgICAgICB2YXIgdG9vbHRpcExhYmVsID0gdXRpbHMuY29udmVydFRvTWJwc0dicHMoaHRtbFZhbHVlLCBzY2FsZWREaW1lbnNpb24sIHRoaXMuc2V0dGluZ3MuZGVjaW1hbFBsYWNlcyk7CisKKyAgICAgICAgICAgICAgICAgICAgdGhpcy5vLmxhYmVsc1twb2ludGVyLnVpZF0udmFsdWUuaHRtbCh0b29sdGlwTGFiZWwudW5pdFZhbHVlICsgJyAnICsgdG9vbHRpcExhYmVsLnVuaXRMYWJlbCk7CisgICAgICAgICAgICAgICAgICAgIC8vVG9wIHRvb2x0aXAgbGFiZWwKKyAgICAgICAgICAgICAgICAgICAgdGhpcy5yZWRyYXdMYWJlbHMocG9pbnRlcik7CisgICAgICAgICAgICAgICAgfTsKKyAgICAgICAgICAgICAgICBTbGlkZXIucHJvdG90eXBlLnJlZHJhd0xhYmVscyA9IGZ1bmN0aW9uIChwb2ludGVyKSB7CisgICAgICAgICAgICAgICAgICAgIGZ1bmN0aW9uIHNldFBvc2l0aW9uKGxhYmVsLCBzaXplcywgcHJjKSB7CisgICAgICAgICAgICAgICAgICAgICAgICBzaXplcy5tYXJnaW4gPSAtc2l6ZXMubGFiZWwgLyAyOworICAgICAgICAgICAgICAgICAgICAgICAgdmFyIGRvbVNpemUgPSBzZWxmLnNpemVzLmRvbVdpZHRoOworICAgICAgICAgICAgICAgICAgICAgICAgdmFyIGxhYmVsX2xlZnQgPSBzaXplcy5ib3JkZXIgKyBzaXplcy5tYXJnaW47CisgICAgICAgICAgICAgICAgICAgICAgICBpZiAobGFiZWxfbGVmdCA8IDApIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBzaXplcy5tYXJnaW4gLT0gbGFiZWxfbGVmdDsKKyAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgIGlmIChzaXplcy5ib3JkZXIgKyBzaXplcy5sYWJlbCAvIDIgPiBkb21TaXplKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2l6ZXMubWFyZ2luID0gMDsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBzaXplcy5yaWdodCA9IHRydWU7CisgICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2UKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBzaXplcy5yaWdodCA9IGZhbHNlOworICAgICAgICAgICAgICAgICAgICAgICAgLy9BZGp1c3QgdGhlIHRvb2x0aXAgbG9jYXRpb24KKyAgICAgICAgICAgICAgICAgICAgICAgIHNpemVzLm1hcmdpbiA9IC0oKGxhYmVsLm9bMF0uY2xpZW50V2lkdGggLyAyKSAtIGxhYmVsLm9bMF0uY2xpZW50V2lkdGggLyAyMCk7CisgICAgICAgICAgICAgICAgICAgICAgICBsYWJlbC5vLmNzcyh7bGVmdDogcHJjICsgIiUiLCBtYXJnaW5MZWZ0OiBzaXplcy5tYXJnaW4sIHJpZ2h0OiAiYXV0byJ9KTsKKyAgICAgICAgICAgICAgICAgICAgICAgIGlmIChzaXplcy5yaWdodCkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBsYWJlbC5vLmNzcyh7bGVmdDogImF1dG8iLCByaWdodDogMH0pOworICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHNpemVzOworICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgIHZhciBzZWxmID0gdGhpczsKKyAgICAgICAgICAgICAgICAgICAgdmFyIGxhYmVsID0gdGhpcy5vLmxhYmVsc1twb2ludGVyLnVpZF07CisgICAgICAgICAgICAgICAgICAgIHZhciBwcmMgPSBwb2ludGVyLnZhbHVlLnByYzsKKyAgICAgICAgICAgICAgICAgICAgdmFyIHNpemVzID0geworICAgICAgICAgICAgICAgICAgICAgICAgbGFiZWw6IGxhYmVsLm9bMF0ub2Zmc2V0V2lkdGgsCisgICAgICAgICAgICAgICAgICAgICAgICByaWdodDogZmFsc2UsCisgICAgICAgICAgICAgICAgICAgICAgICBib3JkZXI6IChwcmMgKiBkb21TaXplKSAvIDEwMAorICAgICAgICAgICAgICAgICAgICB9OworICAgICAgICAgICAgICAgICAgICB2YXIgYW5vdGhlcl9sYWJlbCA9IG51bGw7CisgICAgICAgICAgICAgICAgICAgIHZhciBhbm90aGVyID0gbnVsbDsKKyAgICAgICAgICAgICAgICAgICAgaWYgKCF0aGlzLnNldHRpbmdzLnNpbmdsZSkgeworICAgICAgICAgICAgICAgICAgICAgICAgYW5vdGhlciA9IHRoaXMuby5wb2ludGVyc1sxIC0gcG9pbnRlci51aWRdOworICAgICAgICAgICAgICAgICAgICAgICAgYW5vdGhlcl9sYWJlbCA9IHRoaXMuby5sYWJlbHNbYW5vdGhlci51aWRdOworICAgICAgICAgICAgICAgICAgICAgICAgc3dpdGNoIChwb2ludGVyLnVpZCkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNhc2UgMDoKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHNpemVzLmJvcmRlciArIHNpemVzLmxhYmVsIC8gMiA+IGFub3RoZXJfbGFiZWwub1swXS5vZmZzZXRMZWZ0IC0gdGhpcy5zaXplcy5kb21PZmZzZXQubGVmdCkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYW5vdGhlcl9sYWJlbC5vLmNzcyh7dmlzaWJpbGl0eTogImhpZGRlbiJ9KTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGFub3RoZXJfbGFiZWwudmFsdWUuaHRtbCh0aGlzLm5pY2UoYW5vdGhlci52YWx1ZS5vcmlnaW4pKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxhYmVsLm8uY3NzKHt2aXNpYmlsaXR5OiAiaGlkZGVuIn0pOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcHJjID0gKGFub3RoZXIudmFsdWUucHJjIC0gcHJjKSAvIDIgKyBwcmM7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoYW5vdGhlci52YWx1ZS5wcmMgIT09IHBvaW50ZXIudmFsdWUucHJjKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbGFiZWwudmFsdWUuaHRtbCh0aGlzLm5pY2UocG9pbnRlci52YWx1ZS5vcmlnaW4pICsgIiZuYnNwOyZuZGFzaDsmbmJzcDsiICsgdGhpcy5uaWNlKGFub3RoZXIudmFsdWUub3JpZ2luKSk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2l6ZXMubGFiZWwgPSBsYWJlbC5vWzBdLmNsaWVudFdpZHRoOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNpemVzLmJvcmRlciA9IChwcmMgKiBkb21TaXplKSAvIDEwMDsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGFub3RoZXJfbGFiZWwuby5jc3Moe3Zpc2liaWxpdHk6ICJ2aXNpYmxlIn0pOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNhc2UgMToKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHNpemVzLmJvcmRlciAtIHNpemVzLmxhYmVsIC8gMiA8IGFub3RoZXJfbGFiZWwub1swXS5vZmZzZXRMZWZ0IC0gdGhpcy5zaXplcy5kb21PZmZzZXQubGVmdCArIGFub3RoZXJfbGFiZWwub1swXS5jbGllbnRXaWR0aCkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYW5vdGhlcl9sYWJlbC5vLmNzcyh7dmlzaWJpbGl0eTogImhpZGRlbiJ9KTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGFub3RoZXJfbGFiZWwudmFsdWUuaHRtbCh0aGlzLm5pY2UoYW5vdGhlci52YWx1ZS5vcmlnaW4pKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxhYmVsLm8uY3NzKHt2aXNpYmlsaXR5OiAidmlzaWJsZSJ9KTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHByYyA9IChwcmMgLSBhbm90aGVyLnZhbHVlLnByYykgLyAyICsgYW5vdGhlci52YWx1ZS5wcmM7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoYW5vdGhlci52YWx1ZS5wcmMgIT09IHBvaW50ZXIudmFsdWUucHJjKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbGFiZWwudmFsdWUuaHRtbCh0aGlzLm5pY2UoYW5vdGhlci52YWx1ZS5vcmlnaW4pICsgIiZuYnNwOyZuZGFzaDsmbmJzcDsiICsgdGhpcy5uaWNlKHBvaW50ZXIudmFsdWUub3JpZ2luKSk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2l6ZXMubGFiZWwgPSBsYWJlbC5vWzBdLmNsaWVudFdpZHRoOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNpemVzLmJvcmRlciA9IChwcmMgKiBkb21TaXplKSAvIDEwMDsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGFub3RoZXJfbGFiZWwuby5jc3Moe3Zpc2liaWxpdHk6ICJ2aXNpYmxlIn0pOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgIHNpemVzID0gc2V0UG9zaXRpb24obGFiZWwsIHNpemVzLCBwcmMpOworICAgICAgICAgICAgICAgICAgICB2YXIgZG9tU2l6ZSA9IHNlbGYuc2l6ZXMuZG9tV2lkdGg7CisgICAgICAgICAgICAgICAgICAgIC8vVGhpcyBpcyB0aGUgMHRoIHBvaW50ZXIKKyAgICAgICAgICAgICAgICAgICAgaWYgKGFub3RoZXJfbGFiZWwpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIHNpemVzID0geworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxhYmVsOiBhbm90aGVyX2xhYmVsLm9bMF0uY2xpZW50V2lkdGgsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmlnaHQ6IGZhbHNlLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJvcmRlcjogKGFub3RoZXIudmFsdWUucHJjICogdGhpcy5zaXplcy5kb21XaWR0aCkgLyAxMDAKKyAgICAgICAgICAgICAgICAgICAgICAgIH07CisgICAgICAgICAgICAgICAgICAgICAgICBzaXplcyA9IHNldFBvc2l0aW9uKGFub3RoZXJfbGFiZWwsIHNpemVzLCBhbm90aGVyLnZhbHVlLnByYyk7CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICB9OworICAgICAgICAgICAgICAgIFNsaWRlci5wcm90b3R5cGUucmVkcmF3TGltaXRzID0gZnVuY3Rpb24gKCkgeworICAgICAgICAgICAgICAgICAgICBpZiAodGhpcy5zZXR0aW5ncy5saW1pdHMpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIHZhciBsaW1pdHMgPSBbdHJ1ZSwgdHJ1ZV07CisgICAgICAgICAgICAgICAgICAgICAgICBmb3IgKHZhciBrZXkgaW4gdGhpcy5vLnBvaW50ZXJzKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKCF0aGlzLnNldHRpbmdzLnNpbmdsZSB8fCBrZXkgPT09IDApIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFyIHBvaW50ZXIgPSB0aGlzLm8ucG9pbnRlcnNba2V5XTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFyIGxhYmVsID0gdGhpcy5vLmxhYmVsc1twb2ludGVyLnVpZF07CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhciBsYWJlbF9sZWZ0ID0gbGFiZWwub1swXS5vZmZzZXRMZWZ0IC0gdGhpcy5zaXplcy5kb21PZmZzZXQubGVmdDsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFyIGxpbWl0ID0gdGhpcy5vLmxpbWl0c1swXTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGxhYmVsX2xlZnQgPCBsaW1pdFswXS5jbGllbnRXaWR0aCkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxpbWl0c1swXSA9IGZhbHNlOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBsaW1pdCA9IHRoaXMuby5saW1pdHNbMV07CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChsYWJlbF9sZWZ0ICsgbGFiZWwub1swXS5jbGllbnRXaWR0aCA+IHRoaXMuc2l6ZXMuZG9tV2lkdGggLSBsaW1pdFswXS5jbGllbnRXaWR0aCkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxpbWl0c1sxXSA9IGZhbHNlOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgIGZvciAodmFyIGkgPSAwOyBpIDwgbGltaXRzLmxlbmd0aDsgaSsrKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGxpbWl0c1tpXSl7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGFuZ3VsYXIuZWxlbWVudCh0aGlzLm8ubGltaXRzW2ldKS5hZGRDbGFzcygiYW5pbWF0ZS1zaG93Iik7fQorICAgICAgICAgICAgICAgICAgICAgICAgICAgIGVsc2V7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGFuZ3VsYXIuZWxlbWVudCh0aGlzLm8ubGltaXRzW2ldKS5hZGRDbGFzcygiYW5pbWF0ZS1oaWRkZSIpO30KKyAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIH07CisgICAgICAgICAgICAgICAgU2xpZGVyLnByb3RvdHlwZS5zZXRWYWx1ZSA9IGZ1bmN0aW9uICgpIHsKKyAgICAgICAgICAgICAgICAgICAgdmFyIHZhbHVlID0gdGhpcy5nZXRWYWx1ZSgpOworICAgICAgICAgICAgICAgICAgICB0aGlzLmlucHV0Tm9kZS5hdHRyKCJ2YWx1ZSIsIHZhbHVlKTsKKyAgICAgICAgICAgICAgICAgICAgdGhpcy5vbnN0YXRlY2hhbmdlLmNhbGwodGhpcywgdmFsdWUsIHRoaXMuaW5wdXROb2RlKTsKKyAgICAgICAgICAgICAgICB9OworICAgICAgICAgICAgICAgIFNsaWRlci5wcm90b3R5cGUuZ2V0VmFsdWUgPSBmdW5jdGlvbiAoKSB7CisgICAgICAgICAgICAgICAgICAgIGlmICghdGhpcy5pcy5pbml0KXsKKyAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBmYWxzZTt9CisgICAgICAgICAgICAgICAgICAgIHZhciAkdGhpcyA9IHRoaXM7CisgICAgICAgICAgICAgICAgICAgIHZhciB2YWx1ZSA9ICIiOworICAgICAgICAgICAgICAgICAgICBhbmd1bGFyLmZvckVhY2godGhpcy5vLnBvaW50ZXJzLCBmdW5jdGlvbiAocG9pbnRlciwga2V5KSB7CisgICAgICAgICAgICAgICAgICAgICAgICBpZiAocG9pbnRlci52YWx1ZS5wcmMgIT09IHVuZGVmaW5lZCAmJiAhaXNOYU4ocG9pbnRlci52YWx1ZS5wcmMpKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFyIHBvaW50ZXJQcmMgPSBwb2ludGVyLnZhbHVlLnByYzsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YXIgbXlWYWx1ZSA9ICR0aGlzLnByY1RvVmFsdWUocG9pbnRlclByYyk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKCEkdGhpcy5zZXR0aW5ncy5zbW9vdGgpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFyIG15VmFsdWUgPSB1dGlscy52YWx1ZUZvckRpZmZlcmVudFNjYWxlKCR0aGlzLnNldHRpbmdzLmZyb20sCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJHRoaXMuc2V0dGluZ3MudG8sCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcG9pbnRlclByYywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAkdGhpcy5zZXR0aW5ncy5wcmNUb1ZhbHVlTWFwcGVyKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFsdWUgKz0gKGtleSA+IDAgPyAiOyIgOiAiIikgKyBteVZhbHVlOworICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICB9KTsKKyAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHZhbHVlOworICAgICAgICAgICAgICAgIH07CisgICAgICAgICAgICAgICAgU2xpZGVyLnByb3RvdHlwZS5nZXRQcmNWYWx1ZSA9IGZ1bmN0aW9uICgpIHsKKyAgICAgICAgICAgICAgICAgICAgaWYgKCF0aGlzLmlzLmluaXQpCisgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gZmFsc2U7CisgICAgICAgICAgICAgICAgICAgIHZhciB2YWx1ZSA9ICIiOworICAgICAgICAgICAgICAgICAgICAkLmVhY2godGhpcy5vLnBvaW50ZXJzLCBmdW5jdGlvbiAoaSkgeworICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHRoaXMudmFsdWUucHJjICE9PSB1bmRlZmluZWQgJiYgIWlzTmFOKHRoaXMudmFsdWUucHJjKSkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YWx1ZSArPSAoaSA+IDAgPyAiOyIgOiAiIikgKyB0aGlzLnZhbHVlLnByYzsKKyAgICAgICAgICAgICAgICAgICAgfSk7CisgICAgICAgICAgICAgICAgICAgIHJldHVybiB2YWx1ZTsKKyAgICAgICAgICAgICAgICB9OworICAgICAgICAgICAgICAgIFNsaWRlci5wcm90b3R5cGUucHJjVG9WYWx1ZSA9IGZ1bmN0aW9uIChwcmMpIHsKKyAgICAgICAgICAgICAgICAgICAgdmFyIHZhbHVlOworICAgICAgICAgICAgICAgICAgICBpZiAodGhpcy5zZXR0aW5ncy5oZXRlcm9nZW5laXR5ICYmIHRoaXMuc2V0dGluZ3MuaGV0ZXJvZ2VuZWl0eS5sZW5ndGggPiAwKSB7CisgICAgICAgICAgICAgICAgICAgICAgICB2YXIgaCA9IHRoaXMuc2V0dGluZ3MuaGV0ZXJvZ2VuZWl0eTsKKyAgICAgICAgICAgICAgICAgICAgICAgIHZhciBfc3RhcnQgPSAwOworICAgICAgICAgICAgICAgICAgICAgICAgdmFyIF9mcm9tID0gdGhpcy5zZXR0aW5ncy5mcm9tOworICAgICAgICAgICAgICAgICAgICAgICAgZm9yICh2YXIgaSA9IDA7IGkgPD0gaC5sZW5ndGg7IGkrKykgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhciB2OworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChoW2ldKXsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdiA9IGhbaV0uc3BsaXQoIi8iKTt9CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgZWxzZXsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdiA9IFsxMDAsIHRoaXMuc2V0dGluZ3MudG9dO30KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAocHJjID49IF9zdGFydCAmJiBwcmMgPD0gdlswXSkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YWx1ZSA9IF9mcm9tICsgKChwcmMgLSBfc3RhcnQpICogKHZbMV0gLSBfZnJvbSkpIC8gKHZbMF0gLSBfc3RhcnQpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBfc3RhcnQgPSB2WzBdOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIF9mcm9tID0gdlsxXTsKKyAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICBlbHNlIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIHZhbHVlID0gdGhpcy5zZXR0aW5ncy5mcm9tICsgKHByYyAqIHRoaXMuc2V0dGluZ3MuaW50ZXJ2YWwpIC8gMTAwOworICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgIHZhciByb3VuZGVkVmFsdWUgPSB0aGlzLnJvdW5kKHZhbHVlKTsKKyAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHJvdW5kZWRWYWx1ZTsKKyAgICAgICAgICAgICAgICB9OworICAgICAgICAgICAgICAgIFNsaWRlci5wcm90b3R5cGUudmFsdWVUb1ByYyA9IGZ1bmN0aW9uICh2YWx1ZSwgcG9pbnRlcikgeworICAgICAgICAgICAgICAgICAgICB2YXIgcHJjOworICAgICAgICAgICAgICAgICAgICBpZiAodGhpcy5zZXR0aW5ncy5oZXRlcm9nZW5laXR5ICYmIHRoaXMuc2V0dGluZ3MuaGV0ZXJvZ2VuZWl0eS5sZW5ndGggPiAwKSB7CisgICAgICAgICAgICAgICAgICAgICAgICB2YXIgaCA9IHRoaXMuc2V0dGluZ3MuaGV0ZXJvZ2VuZWl0eTsKKyAgICAgICAgICAgICAgICAgICAgICAgIHZhciBfc3RhcnQgPSAwOworICAgICAgICAgICAgICAgICAgICAgICAgdmFyIF9mcm9tID0gdGhpcy5zZXR0aW5ncy5mcm9tOworICAgICAgICAgICAgICAgICAgICAgICAgZm9yICh2YXIgaSA9IDA7IGkgPD0gaC5sZW5ndGg7IGkrKykgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhciB2OworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChoW2ldKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2ID0gaFtpXS5zcGxpdCgiLyIpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdiA9IFsxMDAsIHRoaXMuc2V0dGluZ3MudG9dOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICh2YWx1ZSA+PSBfZnJvbSAmJiB2YWx1ZSA8PSB2WzFdKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHByYyA9IHBvaW50ZXIubGltaXRzKF9zdGFydCArICh2YWx1ZSAtIF9mcm9tKSAqICh2WzBdIC0gX3N0YXJ0KSAvICh2WzFdIC0gX2Zyb20pKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgX3N0YXJ0ID0gdlswXTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBfZnJvbSA9IHZbMV07CisgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICAgICAgICAgICAgICBwcmMgPSBwb2ludGVyLmxpbWl0cygodmFsdWUgLSB0aGlzLnNldHRpbmdzLmZyb20pICogMTAwIC8gdGhpcy5zZXR0aW5ncy5pbnRlcnZhbCk7CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHByYzsKKyAgICAgICAgICAgICAgICB9OworICAgICAgICAgICAgICAgIFNsaWRlci5wcm90b3R5cGUucm91bmQgPSBmdW5jdGlvbiAodmFsdWUpIHsKKyAgICAgICAgICAgICAgICAgICAgdmFsdWUgPSBNYXRoLnJvdW5kKHZhbHVlIC8gdGhpcy5zZXR0aW5ncy5zdGVwKSAqIHRoaXMuc2V0dGluZ3Muc3RlcDsKKyAgICAgICAgICAgICAgICAgICAgaWYgKHRoaXMuc2V0dGluZ3Mucm91bmQpeworICAgICAgICAgICAgICAgICAgICAgICAgdmFsdWUgPSBNYXRoLnJvdW5kKHZhbHVlICogTWF0aC5wb3coMTAsIHRoaXMuc2V0dGluZ3Mucm91bmQpKSAvIE1hdGgucG93KDEwLCB0aGlzLnNldHRpbmdzLnJvdW5kKTt9CisgICAgICAgICAgICAgICAgICAgIGVsc2V7CisgICAgICAgICAgICAgICAgICAgICAgICB2YWx1ZSA9IE1hdGgucm91bmQodmFsdWUpO30KKyAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHZhbHVlOworICAgICAgICAgICAgICAgIH07CisgICAgICAgICAgICAgICAgcmV0dXJuIFNsaWRlcjsKKyAgICAgICAgICAgIH1dKQorICAgICAgICAuZGlyZWN0aXZlKCdhdHRTdGVwU2xpZGVyJywgWworICAgICAgICAgICAgJyRjb21waWxlJywgJyR0ZW1wbGF0ZUNhY2hlJywgJyR0aW1lb3V0JywgJyR3aW5kb3cnLCAnc2xpZGVyJywgJ3NsaWRlckNvbnN0YW50cycsICd1dGlscycsCisgICAgICAgICAgICBmdW5jdGlvbiAoY29tcGlsZSwgdGVtcGxhdGVDYWNoZSwgdGltZW91dCwgd2luLCBTbGlkZXIsIHNsaWRlckNvbnN0YW50cywgdXRpbHMpIHsKKyAgICAgICAgICAgICAgICAvKgorICAgICAgICAgICAgICAgICBUaGUgTUlUIExpY2Vuc2UgKE1JVCkKKyAgICAgICAgICAgICAgICAgQ29weXJpZ2h0IChjKSAyMDEzIEp1bGllbiBWYWzDqXJ5CisgICAgICAgICAgICAgICAgICovCisgICAgICAgICAgICAgICAgdmFyIHRlbXBsYXRlVXJsID0gJ2FwcC9zY3JpcHRzL25nX2pzX2F0dF90cGxzL3N0ZXBTbGlkZXIvYXR0U3RlcFNsaWRlci5odG1sJzsKKyAgICAgICAgICAgICAgICByZXR1cm4geworICAgICAgICAgICAgICAgICAgICByZXN0cmljdDogJ0FFJywKKyAgICAgICAgICAgICAgICAgICAgcmVxdWlyZTogJz9uZ01vZGVsJywKKyAgICAgICAgICAgICAgICAgICAgc2NvcGU6IHsKKyAgICAgICAgICAgICAgICAgICAgICAgIG9wdGlvbnM6ICc9JywKKyAgICAgICAgICAgICAgICAgICAgICAgIGN1dE9mZjogJz0nCisgICAgICAgICAgICAgICAgICAgIH0sCisgICAgICAgICAgICAgICAgICAgIHByaW9yaXR5OiAxLAorICAgICAgICAgICAgICAgICAgICB0ZW1wbGF0ZVVybDogdGVtcGxhdGVVcmwsCisgICAgICAgICAgICAgICAgICAgIGxpbms6IGZ1bmN0aW9uIChzY29wZSwgZWxlbWVudCwgYXR0cnMsIG5nTW9kZWwpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIGlmICghbmdNb2RlbCkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm47CisgICAgICAgICAgICAgICAgICAgICAgICBzY29wZS5tYWluU2xpZGVyQ2xhc3MgPSAnc3RlcC1zbGlkZXInOworICAgICAgICAgICAgICAgICAgICAgICAgZWxlbWVudC5hZnRlcihjb21waWxlKHRlbXBsYXRlQ2FjaGUuZ2V0KHRlbXBsYXRlVXJsKSkoc2NvcGUsIGZ1bmN0aW9uIChjbG9uZWRFbGVtZW50LCBzY29wZSkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNjb3BlLnRtcGxFbHQgPSBjbG9uZWRFbGVtZW50OworICAgICAgICAgICAgICAgICAgICAgICAgfSkpOworICAgICAgICAgICAgICAgICAgICAgICAgbmdNb2RlbC4kcmVuZGVyID0gZnVuY3Rpb24gKCkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChuZ01vZGVsLiR2aWV3VmFsdWUuc3BsaXQgJiYgbmdNb2RlbC4kdmlld1ZhbHVlLnNwbGl0KCI7IikubGVuZ3RoID09PSAxKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG5nTW9kZWwuJHZpZXdWYWx1ZSA9ICcwOycgKyBuZ01vZGVsLiR2aWV3VmFsdWU7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIGlmICh0eXBlb2YgKG5nTW9kZWwuJHZpZXdWYWx1ZSkgPT09ICdudW1iZXInKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG5nTW9kZWwuJHZpZXdWYWx1ZSA9ICcwOycgKyBuZ01vZGVsLiR2aWV3VmFsdWU7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICghbmdNb2RlbC4kdmlld1ZhbHVlICYmIG5nTW9kZWwuJHZpZXdWYWx1ZSAhPT0gMCkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm47CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICh0eXBlb2YgKG5nTW9kZWwuJHZpZXdWYWx1ZSkgPT09ICdudW1iZXInKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG5nTW9kZWwuJHZpZXdWYWx1ZSA9ICcnICsgbmdNb2RlbC4kdmlld1ZhbHVlOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoc2NvcGUuc2xpZGVyKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhciBmaXJzdFBvaW50ZXIgPSAnMCc7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNjb3BlLnNsaWRlci5nZXRQb2ludGVycygpWzBdLnNldChmaXJzdFBvaW50ZXIsIHRydWUpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAobmdNb2RlbC4kdmlld1ZhbHVlLnNwbGl0KCI7IilbMV0pIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhciB2YWx1ZSA9IG5nTW9kZWwuJHZpZXdWYWx1ZS5zcGxpdCgiOyIpWzFdOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHZhbHVlLmxlbmd0aCA+PSA0KSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFsdWUgPSB2YWx1ZS5zdWJzdHJpbmcoMCwgMik7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoIXNjb3BlLm9wdGlvbnMucmVhbHRpbWUpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2NvcGUub3B0aW9ucy5jYWxsYmFjayhwYXJzZUZsb2F0KG5nTW9kZWwuJHZpZXdWYWx1ZS5zcGxpdCgiOyIpWzFdKSk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzY29wZS5zbGlkZXIuZ2V0UG9pbnRlcnMoKVsxXS5zZXQobmdNb2RlbC4kdmlld1ZhbHVlLnNwbGl0KCI7IilbMV0sIHRydWUpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgfTsKKyAgICAgICAgICAgICAgICAgICAgICAgIHZhciBpbml0ID0gZnVuY3Rpb24gKCkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNjb3BlLmZyb20gPSAnJyArIHNjb3BlLm9wdGlvbnMuZnJvbTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBzY29wZS50byA9ICcnICsgc2NvcGUub3B0aW9ucy50bzsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoc2NvcGUub3B0aW9ucy5jYWxjdWxhdGUgJiYgdHlwZW9mIHNjb3BlLm9wdGlvbnMuY2FsY3VsYXRlID09PSAnZnVuY3Rpb24nKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNjb3BlLmZyb20gPSBzY29wZS5vcHRpb25zLmNhbGN1bGF0ZShzY29wZS5mcm9tKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2NvcGUudG8gPSBzY29wZS5vcHRpb25zLmNhbGN1bGF0ZShzY29wZS50byk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNjb3BlLnNob3dEaXZpZGVycyA9IHNjb3BlLm9wdGlvbnMuc2hvd0RpdmlkZXJzOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNjb3BlLkNPTE9SUyA9IHNsaWRlckNvbnN0YW50cy5DT0xPUlM7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2NvcGUuc2xpZGVyQ29sb3IgPSBzY29wZS5vcHRpb25zLnNsaWRlckNvbG9yOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICghc2NvcGUuc2xpZGVyQ29sb3IpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNjb3BlLnNsaWRlckNvbG9yID0gc2xpZGVyQ29uc3RhbnRzLkNPTE9SUy5SRUdVTEFSOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhciBzY2FsZUFycmF5ID0gc2NvcGUub3B0aW9ucy5zY2FsZTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAvKiBNYWtlIGEgY29weSBvZiB0aGUgc2NhbGVBcnJheSBiZWZvcmUgY29udmVydGluZyBpdCB0byBwZXJjZW50YWdlIGZvciB0aGUgYmFycyAqLworICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhciBub25QZXJjZW50U2NhbGVBcnJheSA9IFtdOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8qIERlZmluZSB2YXJpYWJsZSBmb3IgZGlzcGxheWluZyBsb3dlciByYW5nZSB2YWx1ZXMgKi8KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YXIgc2NhbGVkVXBWYWx1ZUFycmF5PVtdOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8qIENyZWF0ZSBNYXBwZXIgZm9yIHRoZSBwZXJjZW50YWdlIHRvIHZhbHVlICovCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFyIHByY1RvVmFsdWVNYXBwZXIgPSB7fTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBmb3IgKHZhciBpIGluIHNjYWxlQXJyYXkpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFyIHMgPSBzY2FsZUFycmF5W2ldOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBub25QZXJjZW50U2NhbGVBcnJheS5wdXNoKHMpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBmdW5jdGlvbiBhZGRTY2FsZUFycmF5U3RhcnRBbmRFbmQoKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChzY2FsZUFycmF5WzBdICE9PSAwKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzY2FsZUFycmF5LnNwbGljZSgwLCAwLCAwKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoc2NhbGVBcnJheVtzY2FsZUFycmF5Lmxlbmd0aCAtIDFdICE9PSAxMDApIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNjYWxlQXJyYXkuc3BsaWNlKHNjYWxlQXJyYXkubGVuZ3RoLCAwLCAxMDApOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZ1bmN0aW9uIGNvbnZlcnRTY2FsZUFycmF5VG9QZXJjZW50YWdlKCkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoc2NhbGVBcnJheVtzY2FsZUFycmF5Lmxlbmd0aCAtIDFdICE9PSBzY29wZS5vcHRpb25zLnRvKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzY2FsZUFycmF5LnNwbGljZShzY2FsZUFycmF5Lmxlbmd0aCwgMCwgc2NvcGUub3B0aW9ucy50byk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KKworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZihzY29wZS5vcHRpb25zLmRpc3BsYXlTY2FsZWR2YWx1ZXMpeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZm9yKHZhciBpIGluIHNjYWxlQXJyYXkpeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNjYWxlZFVwVmFsdWVBcnJheS5wdXNoKE1hdGgubG9nMihzY2FsZUFycmF5W2ldKSk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YXIgbWF4U2NhbGVkVXBWYWx1ZT1zY2FsZWRVcFZhbHVlQXJyYXlbc2NhbGVkVXBWYWx1ZUFycmF5Lmxlbmd0aC0xXTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQorCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZvciAodmFyIGkgaW4gc2NhbGVBcnJheSkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFyIHByY1ZhbHVlOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFyIGZyb21WYWx1ZUNoZWNrID0gKHNjYWxlQXJyYXlbaV0gLyBzY29wZS5vcHRpb25zLmZyb20pOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFyIHRvVmFsdWVDaGVjayA9IChzY2FsZUFycmF5W2ldIC8gc2NvcGUub3B0aW9ucy50byk7CisKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChzY29wZS5vcHRpb25zLmRpc3BsYXlTY2FsZWR2YWx1ZXMpeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHByY1ZhbHVlID0gKHNjYWxlZFVwVmFsdWVBcnJheVtpXSAvbWF4U2NhbGVkVXBWYWx1ZSkqMTAwOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwcmNWYWx1ZSA9ICgoc2NhbGVBcnJheVtpXSAtIHNjb3BlLm9wdGlvbnMuZnJvbSkgLyAoc2NvcGUub3B0aW9ucy50byAtIHNjb3BlLm9wdGlvbnMuZnJvbSkpICogMTAwOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQorCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YXIgcmVhbFZhbHVlID0gc2NhbGVBcnJheVtpXTsKKworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHRvVmFsdWVDaGVjayA9PT0gMSkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHByY1ZhbHVlID0gMTAwOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZWxzZSBpZiAoZnJvbVZhbHVlQ2hlY2sgPT09IDEpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwcmNWYWx1ZSA9IDA7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzY2FsZUFycmF5W2ldID0gcHJjVmFsdWU7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwcmNUb1ZhbHVlTWFwcGVyWycnICsgcHJjVmFsdWVdID0gcmVhbFZhbHVlOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICgoc2NvcGUub3B0aW9ucy5mcm9tICE9PSAwIHx8IHNjb3BlLm9wdGlvbnMudG8gIT09IDEwMCkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIHNjb3BlLm9wdGlvbnMuc21vb3RoKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8qCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzY2FsZSBhcnJheSBpcyBpbiByZWFsIHZhbHVlcy4KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGFkZFNjYWxlQXJyYXlTdGFydEFuZEVuZCgpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzY29wZS5vcHRpb25zLnN0ZXBXaXRoRGlmZmVyZW50U2NhbGUgPSB0cnVlOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBlbHNlIGlmICgoc2NvcGUub3B0aW9ucy5mcm9tICE9PSAwIHx8IHNjb3BlLm9wdGlvbnMudG8gIT09IDEwMCkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmICFzY29wZS5vcHRpb25zLnNtb290aCkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvKgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgQ2FzZSBmb3IgZGlmZmVyZW50IGZyb20gYW5kIHRvIHZhbHVlcyBvdGhlciB0aGFuIDAgYW5kIDEwMAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc28gd2UgaGF2ZSB0byBkbyBzb21lIGRpZmZlcmVudCBjYWxjdWxhdGlvbnMKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNjb3BlLm9wdGlvbnMuc3RlcFdpdGhEaWZmZXJlbnRTY2FsZSA9IHRydWU7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbnZlcnRTY2FsZUFycmF5VG9QZXJjZW50YWdlKCk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGFkZFNjYWxlQXJyYXlTdGFydEFuZEVuZCgpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBlbHNlIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLyoKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFRoaXMgaXMgdGhlIG5vcm1hbCBjYXNlIHdoZXJlIHRoZSBmcm9tIGFuZCB0byB2YWx1ZXMgYXJlIDAgYW5kCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAxMDAgcmVzcGVjdGl2ZWx5LiAgICAgICAgCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvL0NoZWNrIHRoYXQgdGhlIHNjYWxlIHN0YXJ0cyBhdCAwIGFuZCAxMDAKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY29udmVydFNjYWxlQXJyYXlUb1BlcmNlbnRhZ2UoKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYWRkU2NhbGVBcnJheVN0YXJ0QW5kRW5kKCk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhciBkZWNpbWFsUGxhY2VzID0gMDsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoc2NvcGUub3B0aW9ucy5kZWNpbWFsUGxhY2VzKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRlY2ltYWxQbGFjZXMgPSBzY29wZS5vcHRpb25zLmRlY2ltYWxQbGFjZXM7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vTW9kaWZ5IHRoZSBlbmREaW1lbnNpb24gYmFzZWQgb24gd2hldGhlciBjb252ZXJpc29uIHdhcyBwYXNzZWQgaW4KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAvL0Fsc28gY2hhbmdlIHRoZSB0b1N0ciB2YWx1ZSB0byBzY2FsZSB0byB0aGUgbGFzdCBmYWN0b3IKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBzY29wZS5lbmREaW1lbnNpb24gPSBzY29wZS5vcHRpb25zLmRpbWVuc2lvbjsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoc2NvcGUub3B0aW9ucy5jb252ZXJzaW9uKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vR2V0IHRoZSBkaW1lbnNpb24gb2YgdGhlIGxhc3QgY29udmVyc2lvbgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YXIgbGFzdEluZGV4ID0gc2NvcGUub3B0aW9ucy5jb252ZXJzaW9uLmxlbmd0aCAtIDE7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhciBsYXN0RGltZW5zaW9uID0gc2NvcGUub3B0aW9ucy5jb252ZXJzaW9uW2xhc3RJbmRleF0uZGltZW5zaW9uOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YXIgbGFzdFNjYWxlRmFjdG9yID0gc2NvcGUub3B0aW9ucy5jb252ZXJzaW9uW2xhc3RJbmRleF0uc2NhbGVGYWN0b3I7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNjb3BlLmVuZERpbWVuc2lvbiA9ICcgJyArIGxhc3REaW1lbnNpb247CisKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFyIHRvVmFsID0gKHNjb3BlLnRvIC8gbGFzdFNjYWxlRmFjdG9yKS50b0ZpeGVkKGRlY2ltYWxQbGFjZXMpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzY29wZS50b1N0ciA9IHRvVmFsOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNjb3BlLnRvU3RyID0gc2NvcGUub3B0aW9ucy50bzsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CisKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YXIgdG9vbHRpcExhYmVsID0gdXRpbHMuY29udmVydFRvTWJwc0dicHMoc2NvcGUudG9TdHIsIHNjb3BlLmVuZERpbWVuc2lvbiwgc2NvcGUub3B0aW9ucy5kZWNpbWFsUGxhY2VzKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBzY29wZS50b1N0ciA9IHRvb2x0aXBMYWJlbC51bml0VmFsdWU7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2NvcGUuZW5kRGltZW5zaW9uID0gJyAnICsgdG9vbHRpcExhYmVsLnVuaXRMYWJlbDsKKworICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhciBPUFRJT05TID0geworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBmcm9tOiBzY29wZS5vcHRpb25zLmZyb20sCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRvOiBzY29wZS5vcHRpb25zLnRvLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzdGVwOiBzY29wZS5vcHRpb25zLnN0ZXAsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNtb290aDogc2NvcGUub3B0aW9ucy5zbW9vdGgsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxpbWl0czogdHJ1ZSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc3RlcFdpdGhEaWZmZXJlbnRTY2FsZTogc2NvcGUub3B0aW9ucy5zdGVwV2l0aERpZmZlcmVudFNjYWxlLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByb3VuZDogc2NvcGUub3B0aW9ucy5yb3VuZCB8fCBmYWxzZSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFsdWU6IG5nTW9kZWwuJHZpZXdWYWx1ZSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2NhbGU6IHNjb3BlLm9wdGlvbnMuc2NhbGUsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG5vblBlcmNlbnRTY2FsZUFycmF5OiBub25QZXJjZW50U2NhbGVBcnJheSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcHJjVG9WYWx1ZU1hcHBlcjogcHJjVG9WYWx1ZU1hcHBlciwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZmlyc3REaW1lbnNpb246IHNjb3BlLm9wdGlvbnMuZGltZW5zaW9uLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBkZWNpbWFsUGxhY2VzOiBkZWNpbWFsUGxhY2VzLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb252ZXJzaW9uOiBzY29wZS5vcHRpb25zLmNvbnZlcnNpb24sCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJlYWx0aW1lQ2FsbGJhY2s6IHNjb3BlLm9wdGlvbnMuY2FsbGJhY2sKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB9OworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChhbmd1bGFyLmlzRnVuY3Rpb24oc2NvcGUub3B0aW9ucy5yZWFsdGltZSkpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgT1BUSU9OUy5yZWFsdGltZUNhbGxiYWNrID0gZnVuY3Rpb24gKHZhbHVlKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBuZ01vZGVsLiRzZXRWaWV3VmFsdWUodmFsdWUpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2NvcGUub3B0aW9ucy5jYWxsYmFjayh2YWx1ZSk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH07CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgICAgIGVsc2UgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBPUFRJT05TLmNhbGxiYWNrID0gZm9yY2VBcHBseTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgT1BUSU9OUy5jYWxjdWxhdGUgPSBzY29wZS5vcHRpb25zLmNhbGN1bGF0ZSB8fCB1bmRlZmluZWQ7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgT1BUSU9OUy5vbnN0YXRlY2hhbmdlID0gc2NvcGUub3B0aW9ucy5vbnN0YXRlY2hhbmdlIHx8IHVuZGVmaW5lZDsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB0aW1lb3V0KGZ1bmN0aW9uICgpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFyIHNjYWxlRGl2ID0gc2NvcGUudG1wbEVsdC5maW5kKCdkaXYnKVs3XTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKCFPUFRJT05TLmNvbnZlcnNpb24pIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNjb3BlLnRtcGxFbHQuZmluZCgnZGl2JykuZXEoNikuZmluZCgnc3BhbicpLmVxKDApLmNzcygncGFkZGluZy1sZWZ0JywgJzEwcHgnKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNjb3BlLnRtcGxFbHQuZmluZCgnZGl2JykuZXEoNikuZmluZCgnc3BhbicpLmVxKDApLmNzcygncGFkZGluZy1yaWdodCcsICcxNXB4Jyk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2NvcGUuc2xpZGVyID0gYW5ndWxhci5lbGVtZW50LnNsaWRlcihlbGVtZW50LCBzY29wZS50bXBsRWx0LCBPUFRJT05TKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYW5ndWxhci5lbGVtZW50KHNjYWxlRGl2KS5odG1sKHNjb3BlLmdlbmVyYXRlU2NhbGUoKSk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNjb3BlLmRyYXdTY2FsZShzY2FsZURpdik7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGluaXRMaXN0ZW5lcigpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzY29wZS4kd2F0Y2goJ29wdGlvbnMuZGlzYWJsZScsIGZ1bmN0aW9uICh2YWwpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChzY29wZS5zbGlkZXIpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzY29wZS50bXBsRWx0LnRvZ2dsZUNsYXNzKCdkaXNhYmxlZCcsIHZhbCk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2NvcGUuc2xpZGVyLmRpc2FibGUodmFsKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNjb3BlLiR3YXRjaCgnY3V0T2ZmJywgZnVuY3Rpb24gKGN1dE9mZlZhbCkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGN1dE9mZlZhbCAmJiBjdXRPZmZWYWwgPiAwKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFyIGN1dE9mZlByYyA9IChjdXRPZmZWYWwgLSBzY29wZS5zbGlkZXIuc2V0dGluZ3MuZnJvbSkgLyAoc2NvcGUuc2xpZGVyLnNldHRpbmdzLnRvIC0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNjb3BlLnNsaWRlci5zZXR0aW5ncy5mcm9tKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjdXRPZmZQcmMgPSBjdXRPZmZQcmMgKiAxMDA7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2NvcGUuaXNDdXRPZmZTbGlkZXIgPSB0cnVlOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNjb3BlLnNsaWRlci5zZXR0aW5ncy5jdXRPZmZXaWR0aCA9IGN1dE9mZlByYzsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvL2N1dE9mZlZhbCBpcyB0aGUgYWN0dWFsIHZhbHVlIG9mIHRoZSBjdXRvZmYgcG9pbnQKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzY29wZS5jdXRPZmZWYWwgPSBjdXRPZmZWYWw7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHNjb3BlLm9wdGlvbnMuY29udmVyc2lvbikgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YXIgY29udmVydGVkVmFsID0gdXRpbHMuZ2V0Q29udmVyc2lvbkZhY3RvclZhbHVlKGN1dE9mZlZhbCwgc2NvcGUub3B0aW9ucy5jb252ZXJzaW9uLCBzY29wZS5vcHRpb25zLmRpbWVuc2lvbik7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbnZlcnRlZFZhbC5zY2FsZWRWYWwgPSBwYXJzZUZsb2F0KGNvbnZlcnRlZFZhbC5zY2FsZWRWYWwpLnRvRml4ZWQoc2NvcGUub3B0aW9ucy5kZWNpbWFsUGxhY2VzKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2NvcGUuY3V0T2ZmVmFsID0gY29udmVydGVkVmFsLnNjYWxlZFZhbCArICcgJyArIGNvbnZlcnRlZFZhbC5zY2FsZWREaW1lbnNpb247CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNjb3BlLnNsaWRlci5zZXR0aW5ncy5jdXRPZmZWYWwgPSBjdXRPZmZWYWw7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLy9DYWxjdWxhdGUgdGhlIGN1dE9mZiBwZXJjZW50YWdlCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2NvcGUuc2xpZGVyLmNoYW5nZUN1dE9mZldpZHRoKGN1dE9mZlByYyArICclJyk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFyIHNjYWxlID0gc2NvcGUuc2xpZGVyLnNldHRpbmdzLm5vblBlcmNlbnRTY2FsZUFycmF5OworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vQ2FsY3VsYXRlIHdoZXJlIHRoZSBjdXRPZmYgcG9pbnQgaW4gcmVsYXRpb24gdG8gdGhlIHNjYWxlIGFycmF5CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZm9yICh2YXIgaSBpbiBzY2FsZSkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoaSA+PSAxKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YXIgbG93ZXJWYWwgPSBzY2FsZVtpIC0gMV07CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YXIgaGlnaGVyVmFsID0gc2NhbGVbaV07CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoY3V0T2ZmVmFsID4gbG93ZXJWYWwgJiYgY3V0T2ZmVmFsIDw9IGhpZ2hlclZhbCkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNjb3BlLnNsaWRlci5zZXR0aW5ncy5jdXRPZmZJbmRleCA9IGk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNjb3BlLnNsaWRlci5zZXR0aW5ncy5jdXRPZmZWYWwgPSAwOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9KTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB9KTsKKyAgICAgICAgICAgICAgICAgICAgICAgIH07CisgICAgICAgICAgICAgICAgICAgICAgICBmdW5jdGlvbiBpbml0TGlzdGVuZXIoKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgYW5ndWxhci5lbGVtZW50KHdpbikuYmluZCgncmVzaXplJywgZnVuY3Rpb24gKGV2ZW50KSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNjb3BlLnNsaWRlci5vbnJlc2l6ZSgpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0pOworICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgc2NvcGUuZ2VuZXJhdGVTY2FsZSA9IGZ1bmN0aW9uICgpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoc2NvcGUub3B0aW9ucy5zY2FsZSAmJiBzY29wZS5vcHRpb25zLnNjYWxlLmxlbmd0aCA+IDApIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFyIHN0ciA9ICIiOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YXIgcyA9IHNjb3BlLm9wdGlvbnMuc2NhbGU7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhciBwb3NpdGlvbiA9ICdsZWZ0JzsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZm9yICh2YXIgaSA9IDA7IGkgPCBzLmxlbmd0aDsgaSsrKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoaSAhPT0gMCAmJiBpICE9PSBzLmxlbmd0aCAtIDEpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YXIgc2NhbGVkUG9zaXRpb24gPSAoKHNbaV0gLSBzY29wZS5mcm9tKSAvIChzY29wZS50byAtIHNjb3BlLmZyb20pKSAqIDEwMDsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoc2NvcGUub3B0aW9ucy5zdGVwV2l0aERpZmZlcmVudFNjYWxlICYmICFzY29wZS5vcHRpb25zLnNtb290aCkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzY2FsZWRQb3NpdGlvbiA9IHNbaV07CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHN0ciArPSAnPHNwYW4gc3R5bGU9IicgKyBwb3NpdGlvbiArICc6ICcgKyBzY2FsZWRQb3NpdGlvbiArICclIj48L3NwYW4+JzsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gc3RyOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gIiI7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuICIiOworICAgICAgICAgICAgICAgICAgICAgICAgfTsKKyAgICAgICAgICAgICAgICAgICAgICAgIHNjb3BlLmRyYXdTY2FsZSA9IGZ1bmN0aW9uIChzY2FsZURpdikgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGFuZ3VsYXIuZm9yRWFjaChhbmd1bGFyLmVsZW1lbnQoc2NhbGVEaXYpLmZpbmQoJ2lucycpLCBmdW5jdGlvbiAoc2NhbGVMYWJlbCwga2V5KSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNjYWxlTGFiZWwuc3R5bGUubWFyZ2luTGVmdCA9IC1zY2FsZUxhYmVsLmNsaWVudFdpZHRoIC8gMjsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB9KTsKKyAgICAgICAgICAgICAgICAgICAgICAgIH07CisgICAgICAgICAgICAgICAgICAgICAgICB2YXIgZm9yY2VBcHBseSA9IGZ1bmN0aW9uICh2YWx1ZSkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhciB2YWwgPSB2YWx1ZS5zcGxpdCgiOyIpWzFdOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNjb3BlLiRhcHBseShmdW5jdGlvbiAoKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG5nTW9kZWwuJHNldFZpZXdWYWx1ZShwYXJzZUludCh2YWwpKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB9KTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoc2NvcGUub3B0aW9ucy5jYWxsYmFjaykgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzY29wZS5vcHRpb25zLmNhbGxiYWNrKHBhcnNlSW50KHZhbCkpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgIH07CisgICAgICAgICAgICAgICAgICAgICAgICBzY29wZS4kd2F0Y2goJ29wdGlvbnMnLCBmdW5jdGlvbiAodmFsdWUpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBpbml0KCk7CisgICAgICAgICAgICAgICAgICAgICAgICB9KTsKKyAgICAgICAgICAgICAgICAgICAgICAgIGFuZ3VsYXIuZWxlbWVudC5zbGlkZXIgPSBmdW5jdGlvbiAoaW5wdXRFbGVtZW50LCBlbGVtZW50LCBzZXR0aW5ncykgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICghZWxlbWVudC5kYXRhKCdqc2xpZGVyJykpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGVsZW1lbnQuZGF0YSgnanNsaWRlcicsIG5ldyBTbGlkZXIoaW5wdXRFbGVtZW50LCBlbGVtZW50LCBzZXR0aW5ncykpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhciBzbGlkZXJPYmogPSBlbGVtZW50LmRhdGEoJ2pzbGlkZXInKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gc2xpZGVyT2JqOworICAgICAgICAgICAgICAgICAgICAgICAgfTsKKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIH07CisgICAgICAgICAgICB9XSk7Cithbmd1bGFyLm1vZHVsZSgnYXR0LmFicy5zdGVwdHJhY2tlcicsIFsnYXR0LmFicy50cmFuc2l0aW9uJ10pCisgICAgICAgIC5kaXJlY3RpdmUoJ3N0ZXB0cmFja2VyJywgWyckdGltZW91dCcsIGZ1bmN0aW9uICgkdGltZW91dCkgeworICAgICAgICAgICAgICAgIHJldHVybiB7CisgICAgICAgICAgICAgICAgICAgIC8vIFRoaXMgYWxsb3dzIGRldidzIGNsaWNrSGFuZGxlciB0byBjYW5jZWwgYW4gb3BlcmF0aW9uCisgICAgICAgICAgICAgICAgICAgIHByaW9yaXR5OiAxMDAsCisgICAgICAgICAgICAgICAgICAgIHNjb3BlOiB7CisgICAgICAgICAgICAgICAgICAgICAgICBzZGF0YTogIj1zZGF0YSIsCisgICAgICAgICAgICAgICAgICAgICAgICBjc3RlcDogIj1jdXJyZW50U3RlcCIsCisgICAgICAgICAgICAgICAgICAgICAgICBjbGlja0hhbmRsZXI6ICc9PycsCisgICAgICAgICAgICAgICAgICAgICAgICBkaXNhYmxlQ2xpY2s6ICc9PycKKyAgICAgICAgICAgICAgICAgICAgfSwKKyAgICAgICAgICAgICAgICAgICAgcmVzdHJpY3Q6ICdFQScsCisgICAgICAgICAgICAgICAgICAgIHJlcGxhY2U6IHRydWUsCisgICAgICAgICAgICAgICAgICAgIHRlbXBsYXRlVXJsOiAnYXBwL3NjcmlwdHMvbmdfanNfYXR0X3RwbHMvc3RlcHRyYWNrZXIvc3RlcC10cmFja2VyLmh0bWwnLAorICAgICAgICAgICAgICAgICAgICBsaW5rOiBmdW5jdGlvbiAoc2NvcGUsIGVsZW0pIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIGlmIChzY29wZS5kaXNhYmxlQ2xpY2sgPT09IHVuZGVmaW5lZCkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNjb3BlLmRpc2FibGVDbGljayA9IGZhbHNlOworICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgJHRpbWVvdXQoZnVuY3Rpb24gKCkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChzY29wZS5jc3RlcCA8IDEpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2NvcGUuY3N0ZXAgPSAxOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBlbHNlIGlmIChzY29wZS5jc3RlcCA+IHNjb3BlLnNkYXRhLmxlbmd0aCkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzY29wZS5jc3RlcCA9IHNjb3BlLnNkYXRhLmxlbmd0aDsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFyIGRpdnMgPSBlbGVtLmZpbmQoJ2RpdicpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhciBzbGlkZXJ0cmFja3MgPSBbXTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBmb3IgKHZhciBpIGluIGRpdnMpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGRpdnMuZXEoaSlbMF0pIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhciBlbCA9IGRpdnMuZXEoaSlbMF0uY2xhc3NOYW1lOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGVsLmluZGV4T2YoJ3RyYWNrIG5nLXNjb3BlJykgPiAtMSkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNsaWRlcnRyYWNrcy5wdXNoKGRpdnMuZXEoaSkpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhciBjdXJyZW50UGFnZSx0b3RhbFBhZ2UsY3VycmVudFRyYWNrID0gdXBkYXRlQ3VycmVudFRyYWNrKHNjb3BlLmNzdGVwKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBmdW5jdGlvbiB1cGRhdGVDdXJyZW50VHJhY2soc3RlcCkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyBBbHdheXMgcmV0dXJuIHRoZSBzdGVwLTEgYmVjYXVzZSBhcnJheSBzdGFydHMgYXQgMAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gYW5ndWxhci5lbGVtZW50KHNsaWRlcnRyYWNrc1tzdGVwIC0gMV0pOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBmdW5jdGlvbiB1cGRhdGVUcmFja1dpZHRoKCkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoc2NvcGUuY3N0ZXAgPiAwICYmIHNjb3BlLmNzdGVwIDw9IHNjb3BlLnNkYXRhLmxlbmd0aCAtIDEgJiYgY3VycmVudFBhZ2UgPiAwKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YXIgbmV3V2lkdGggPSAoKGN1cnJlbnRQYWdlIC8gdG90YWxQYWdlKSAqIDEwMCkgKyAiJSI7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjdXJyZW50VHJhY2sgPSB1cGRhdGVDdXJyZW50VHJhY2soc2NvcGUuY3N0ZXApOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY3VycmVudFRyYWNrLmNzcygnd2lkdGgnLCBuZXdXaWR0aCk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgZnVuY3Rpb24gdXBkYXRlUGFnZXMoKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChzY29wZS5jc3RlcCA8PSBzY29wZS5zZGF0YS5sZW5ndGgpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGN1cnJlbnRQYWdlID0gc2NvcGUuc2RhdGFbc2NvcGUuY3N0ZXAgLSAxXVsnY3VycmVudFBhZ2UnXTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRvdGFsUGFnZSA9IHNjb3BlLnNkYXRhW3Njb3BlLmNzdGVwIC0gMV1bJ3RvdGFsUGFnZXMnXTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyBkeW5hbWljYWxseSBhZGQgd2lkdGggZm9yIHN0ZXBzLCBkZXBlbmRpbmcgb24gdGhlIG51bWJlciBvZiBzdGVwcy4KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBzY29wZS5zZXRfd2lkdGggPSBmdW5jdGlvbiAoaW5kZXh2YWwpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFyIHNldHdpZHRoID0gKDEwMCAvIChzY29wZS5zZGF0YS5sZW5ndGggLSAxKSkgKyAiJSI7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vIHNraXAgbGFzdCBlbGVtZW50IGFuZCBhZGQgd2lkdGggZm9yIGFsbCBvdGhlciBlbGVtZW50CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICgoc2NvcGUuc2RhdGEubGVuZ3RoIC0gMSkgPiBpbmRleHZhbCkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHsnd2lkdGgnOiBzZXR3aWR0aH07CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB9OworICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNjb3BlLiR3YXRjaCgnc2RhdGEnLCBmdW5jdGlvbiAoKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHVwZGF0ZVBhZ2VzKCk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhciBwcmV2U3RlcCA9IHNjb3BlLmNzdGVwOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyBCZWZvcmUgYW55dGhpbmcsIGVuc3VyZSBjdXJyZW50UGFnZSBpcyBuZXZlciBiZWxvdyAxCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChjdXJyZW50UGFnZSA8IDEpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGN1cnJlbnRQYWdlID0gMTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChzY29wZS5jc3RlcCAhPT0gMSkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vIERlY3JlYXNlIHN0ZXAsIGN1cnJlbnQgdHJhY2sgd2lkdGggaXMgMCUsIG5ldyBzdGVwIHdpZHRoIHVwZGF0ZXMKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzY29wZS5jc3RlcC0tOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHVwZGF0ZVBhZ2VzKCk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gTW92ZSB0byBuZXh0IHN0ZXAsIHJlc2V0IGN1cnJlbnRQYWdlLCB0b3RhbFBhZ2UsIGFuZCBlbnN1cmUgcHJldmlvdXMgc3RlcHMgYXJlIGNvbXBsZXRlZAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoY3VycmVudFBhZ2UgPiB0b3RhbFBhZ2UpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChzY29wZS5jc3RlcCA+IHNjb3BlLnNkYXRhLmxlbmd0aCAtIDEpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzY29wZS5jc3RlcCsrOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybjsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY3VycmVudFBhZ2UgPSB0b3RhbFBhZ2U7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdXBkYXRlVHJhY2tXaWR0aCgpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNjb3BlLmNzdGVwKys7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdXBkYXRlUGFnZXMoKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB1cGRhdGVUcmFja1dpZHRoKCk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGN1cnJlbnRQYWdlIDwgMSAmJiBwcmV2U3RlcCA9PT0gc2NvcGUuY3N0ZXApIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGN1cnJlbnRQYWdlID0gMTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChzY29wZS5jc3RlcCA+IDEpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzY29wZS5jc3RlcC0tOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNjb3BlLnNkYXRhW3Njb3BlLmNzdGVwIC0gMV1bJ2N1cnJlbnRQYWdlJ10gPSBzY29wZS5zZGF0YVtzY29wZS5jc3RlcCAtIDFdWyd0b3RhbFBhZ2VzJ107CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2NvcGUuc2RhdGFbc2NvcGUuY3N0ZXBdWydjdXJyZW50UGFnZSddID0gMTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB1cGRhdGVUcmFja1dpZHRoKCk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSwgdHJ1ZSk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgLy9hZGQgdGhlIGFjdGl2ZSBjbGFzcyBmb3IgY3VycmVudCBzdGVwCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2NvcGUuYWN0aXZlc3RlcCA9IGZ1bmN0aW9uIChpbmRleCkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gKGluZGV4ID09PSBzY29wZS5jc3RlcCAtIDEpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIH07CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgLy9hZGQgdGhlIGRvbmUgY2xhc3MgZm9yIGZpbmlzaGVkIHN0ZXAKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBzY29wZS5kb25lc3RlcHMgPSBmdW5jdGlvbiAoaW5kZXgpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIChpbmRleCA8IHNjb3BlLmNzdGVwIC0gMSk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgfTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAvL2FkZCB0aGUgbGFzdCBjbGFzcyBmb3IgZmluYWwgc3RlcAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNjb3BlLmxhc3RzdGVwID0gZnVuY3Rpb24gKGluZGV4KSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiAoaW5kZXggPT09IHNjb3BlLnNkYXRhLmxlbmd0aCAtIDEpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIH07CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2NvcGUuaXNJbmNvbXBsZXRlID0gZnVuY3Rpb24gKGluZGV4KSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChpbmRleCA9PT0gc2NvcGUuY3N0ZXAgLSAxKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gZmFsc2U7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGluZGV4ID49IDAgJiYgaW5kZXggPCBzY29wZS5zZGF0YS5sZW5ndGggLSAxKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YXIgc3RlcCA9IHNjb3BlLnNkYXRhW2luZGV4XTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiAoc3RlcFsnY3VycmVudFBhZ2UnXSA8PSBzdGVwWyd0b3RhbFBhZ2VzJ10pOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgfTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAvL2NsaWNrIGV2ZW50CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2NvcGUuc3RlcGNsaWNrID0gZnVuY3Rpb24gKCRldmVudCwgc3RlcHMpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gSWYgd2UgYXJlIGRlY3JlYXNpbmcgc3RlcHMsIHJlc2V0IGFsbCBjdXJyZW50UGFnZSBjb3VudHMgdG8gMQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoc3RlcHMgPCBzY29wZS5jc3RlcCkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZm9yICh2YXIgaSA9IHNjb3BlLmNzdGVwIC0gMTsgaSA+IHN0ZXBzOyBpLS0pIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzY29wZS5zZGF0YVtpXVsnY3VycmVudFBhZ2UnXSA9IDE7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzY29wZS5zZGF0YVtzdGVwc11bJ2N1cnJlbnRQYWdlJ10tLTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoYW5ndWxhci5pc0Z1bmN0aW9uKHNjb3BlLmNsaWNrSGFuZGxlcikpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNjb3BlLmNsaWNrSGFuZGxlcigkZXZlbnQsIHN0ZXBzKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzY29wZS5jc3RlcCA9IHN0ZXBzICsgMTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gSW4gdGhlIGNhc2Ugd2UgZGVjcmVtZW50ZWQgcHJldmlvdXNseSBmcm9tIHRoaXMgc3RlcCwgd2UgbmVlZCB0byByZXNldCBjdXJyZW50cGFnZSB0byBkZWZhdWx0CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChzY29wZS5jc3RlcCA8PSBzY29wZS5zZGF0YS5sZW5ndGggJiYgc2NvcGUuc2RhdGFbc2NvcGUuY3N0ZXBdWydjdXJyZW50UGFnZSddIDwgMSkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2NvcGUuc2RhdGFbc2NvcGUuY3N0ZXBdWydjdXJyZW50UGFnZSddID0gMTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB1cGRhdGVQYWdlcygpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB1cGRhdGVUcmFja1dpZHRoKCk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgfTsKKyAgICAgICAgICAgICAgICAgICAgICAgIH0sIDEwMCk7CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICB9OworICAgICAgICAgICAgfQorICAgICAgICBdKQorICAgICAgICAuY29uc3RhbnQoJ3RpbWVsaW5lQ29uc3RhbnRzJywgeworICAgICAgICAgICAgU1RFUF9UWVBFOiB7CisgICAgICAgICAgICAgICAgQUxFUlQ6ICdhbGVydCcsCisgICAgICAgICAgICAgICAgQ09NUExFVEVEOiAnY29tcGxldGVkJywKKyAgICAgICAgICAgICAgICBDQU5DRUxMRUQ6ICdjYW5jZWxsZWQnCisgICAgICAgICAgICB9CisgICAgICAgIH0pCisgICAgICAgIC5jb250cm9sbGVyKCdBdHRUaW1lbGluZUN0cmwnLCBbJyRzY29wZScsICckdGltZW91dCcsIGZ1bmN0aW9uICgkc2NvcGUsICR0aW1lb3V0KSB7CisgICAgICAgICAgICAgICAgdmFyIHRpbWVsaW5lQmFyQ3RybHMgPSBbXTsKKyAgICAgICAgICAgICAgICB2YXIgdGltZWxpbmVEb3RDdHJscyA9IFtdOworICAgICAgICAgICAgICAgIHRoaXMubnVtU3RlcHMgPSAwOworICAgICAgICAgICAgICAgIHRoaXMuaXNBbHRlcm5hdGUgPSBmdW5jdGlvbiAoKSB7CisgICAgICAgICAgICAgICAgICAgIHJldHVybiAkc2NvcGUuYWx0ZXJuYXRlOworICAgICAgICAgICAgICAgIH07CisgICAgICAgICAgICAgICAgdGhpcy5hZGRUaW1lbGluZUJhckN0cmxzID0gZnVuY3Rpb24gKHQpIHsKKyAgICAgICAgICAgICAgICAgICAgdGltZWxpbmVCYXJDdHJscy5wdXNoKHQpOworICAgICAgICAgICAgICAgIH07CisgICAgICAgICAgICAgICAgdGhpcy5hZGRUaW1lbGluZURvdEN0cmxzID0gZnVuY3Rpb24gKGIpIHsKKyAgICAgICAgICAgICAgICAgICAgdGltZWxpbmVEb3RDdHJscy5wdXNoKGIpOworICAgICAgICAgICAgICAgIH07CisgICAgICAgICAgICAgICAgJHRpbWVvdXQoaW5pdCwgMjAwKTsKKyAgICAgICAgICAgICAgICBmdW5jdGlvbiBpbml0KCkgeworICAgICAgICAgICAgICAgICAgICBmdW5jdGlvbiBjb21wYXJlKGEsIGIpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIGlmIChhLm9yZGVyIDwgYi5vcmRlcikgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiAtMTsKKyAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgIGlmIChhLm9yZGVyID4gYi5vcmRlcikgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiAxOworICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIDA7CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgdGltZWxpbmVEb3RDdHJscy5zb3J0KGNvbXBhcmUpOworICAgICAgICAgICAgICAgICAgICB0aW1lbGluZUJhckN0cmxzLnNvcnQoY29tcGFyZSk7CisgICAgICAgICAgICAgICAgICAgIGlmICgkc2NvcGUuJHBhcmVudC5hbmltYXRlKSB7CisgICAgICAgICAgICAgICAgICAgICAgICBhbmltYXRlU2VxdWVuY2UoKTsKKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAkc2NvcGUuJHdhdGNoKCd0cmlnZ2VyJywgZnVuY3Rpb24gKHZhbCkgeworICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHZhbCkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICRzY29wZS5yZXNldFRpbWVsaW5lKCk7CisgICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICRzY29wZS4kcGFyZW50LmFuaW1hdGUgPSBmYWxzZTsKKyAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgfSk7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIGZ1bmN0aW9uIGFuaW1hdGVTZXF1ZW5jZSgpIHsKKyAgICAgICAgICAgICAgICAgICAgdmFyIGRvdHNEdXJhdGlvbiA9IC4yNTsKKyAgICAgICAgICAgICAgICAgICAgdmFyIHRpbWVsaW5lQmFyUHJvZ3Jlc3NEdXJhdGlvbiA9IC4yNTsKKyAgICAgICAgICAgICAgICAgICAgaWYgKHR5cGVvZiAkc2NvcGUuYmFyQW5pbWF0ZUR1cmF0aW9uID09PSAnbnVtYmVyJykgeworICAgICAgICAgICAgICAgICAgICAgICAgdGltZWxpbmVCYXJQcm9ncmVzc0R1cmF0aW9uID0gJHNjb3BlLmJhckFuaW1hdGVEdXJhdGlvbjsKKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICB2YXIgc3RhcnQgPSBjcmVhdGVBbmltYXRpb24oMCwgdGltZWxpbmVCYXJQcm9ncmVzc0R1cmF0aW9uKTsKKyAgICAgICAgICAgICAgICAgICAgZnVuY3Rpb24gc2V0VG9JbmFjdGl2ZVN0YXRlcygpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIGZvciAodmFyIGkgaW4gdGltZWxpbmVEb3RDdHJscykgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhciBkb3RDdHJsID0gdGltZWxpbmVEb3RDdHJsc1tpXTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoaSAlIDIgPT09IDApIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZG90Q3RybC51bmhvdmVyZWRTdGF0ZUZvckJlbG93KC4yNSk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZG90Q3RybC51bmhvdmVyZWRTdGF0ZUZvckFib3ZlKC4yNSk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChkb3RDdHJsLmlzU3RvcCgpKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICBmdW5jdGlvbiBjcmVhdGVBbmltYXRpb24oaSwgZHVyYXRpb24pIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIGlmIChpID09PSAwKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGZ1bmN0aW9uICgpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHRpbWVsaW5lRG90Q3RybHNbaSArIDFdLmlzU3RvcCgpICYmIHRpbWVsaW5lRG90Q3RybHNbaSArIDFdLmlzQ2FuY2VsbGVkKCkpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRpbWVsaW5lQmFyQ3RybHNbaV0uaXNDYW5jZWxsZWQodHJ1ZSk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdGltZWxpbmVCYXJDdHJsc1tpXS5hbmltYXRlKGNyZWF0ZUFuaW1hdGlvbihpICsgMSwgZHVyYXRpb24pLCBkdXJhdGlvbik7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgfTsKKyAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAoaSA9PT0gdGltZWxpbmVCYXJDdHJscy5sZW5ndGggLSAxKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGZ1bmN0aW9uICgpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLy9SZW1vdmVzIHRoZSBib2xkZWQgdGV4dCBmcm9tIHRoZSBzdGFydAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAodGltZWxpbmVEb3RDdHJsc1swXS5pc0N1cnJlbnRTdGVwKCkpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRpbWVsaW5lRG90Q3RybHNbMF0uaXNDdXJyZW50U3RlcChmYWxzZSk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHRpbWVsaW5lRG90Q3RybHNbaV0uaXNTdG9wKCkpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRpbWVsaW5lRG90Q3RybHNbaSAtIDFdLnNocmlua0FuaW1hdGUoZG90c0R1cmF0aW9uKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRpbWVsaW5lRG90Q3RybHNbaV0uaXNDdXJyZW50U3RlcCh0cnVlKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRpbWVsaW5lRG90Q3RybHNbaSAtIDFdLnNocmlua0FuaW1hdGUoZG90c0R1cmF0aW9uKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRpbWVsaW5lQmFyQ3RybHNbaV0uYW5pbWF0ZShjcmVhdGVBbmltYXRpb24oaSArIDEsIGR1cmF0aW9uKSwgZHVyYXRpb24pOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRpbWVsaW5lRG90Q3RybHNbaV0uZXhwYW5kZWRBbmltYXRlKGRvdHNEdXJhdGlvbik7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICR0aW1lb3V0KGZ1bmN0aW9uICgpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNldFRvSW5hY3RpdmVTdGF0ZXMoKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSwgNTAwKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB9OworICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgLy9FbmQgRG90CisgICAgICAgICAgICAgICAgICAgICAgICBlbHNlIGlmIChpID09PSB0aW1lbGluZUJhckN0cmxzLmxlbmd0aCkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBmdW5jdGlvbiAoKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vUmVtb3ZlcyB0aGUgYm9sZGVkIHRleHQgZnJvbSB0aGUgc3RhcnQKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHRpbWVsaW5lRG90Q3RybHNbMF0uaXNDdXJyZW50U3RlcCgpKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0aW1lbGluZURvdEN0cmxzWzBdLmlzQ3VycmVudFN0ZXAoZmFsc2UpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRpbWVsaW5lRG90Q3RybHNbaSAtIDFdLnNocmlua0FuaW1hdGUoZG90c0R1cmF0aW9uKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdGltZWxpbmVEb3RDdHJsc1tpXS5leHBhbmRlZEFuaW1hdGUoZG90c0R1cmF0aW9uKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdGltZWxpbmVEb3RDdHJsc1tpXS5pc0N1cnJlbnRTdGVwKHRydWUpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAkdGltZW91dChmdW5jdGlvbiAoKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzZXRUb0luYWN0aXZlU3RhdGVzKCk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0sIDUwMCk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgfTsKKyAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgIGVsc2UgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBmdW5jdGlvbiAoKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vUmVtb3ZlcyB0aGUgYm9sZGVkIHRleHQgZnJvbSB0aGUgc3RhcnQKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHRpbWVsaW5lRG90Q3RybHNbMF0uaXNDdXJyZW50U3RlcCgpKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0aW1lbGluZURvdEN0cmxzWzBdLmlzQ3VycmVudFN0ZXAoZmFsc2UpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICh0aW1lbGluZURvdEN0cmxzW2ldLmlzU3RvcCgpKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0aW1lbGluZURvdEN0cmxzW2kgLSAxXS5zaHJpbmtBbmltYXRlKGRvdHNEdXJhdGlvbik7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0aW1lbGluZURvdEN0cmxzW2ldLmV4cGFuZGVkQW5pbWF0ZShkb3RzRHVyYXRpb24pOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdGltZWxpbmVEb3RDdHJsc1tpXS5pc0N1cnJlbnRTdGVwKHRydWUpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJHRpbWVvdXQoZnVuY3Rpb24gKCkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNldFRvSW5hY3RpdmVTdGF0ZXMoKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0sIDUwMCk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAodGltZWxpbmVEb3RDdHJsc1tpICsgMV0uaXNTdG9wKCkgJiYgdGltZWxpbmVEb3RDdHJsc1tpICsgMV0uaXNDYW5jZWxsZWQoKSkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRpbWVsaW5lQmFyQ3RybHNbaV0uaXNDYW5jZWxsZWQodHJ1ZSk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0aW1lbGluZURvdEN0cmxzW2kgLSAxXS5zaHJpbmtBbmltYXRlKGRvdHNEdXJhdGlvbik7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0aW1lbGluZUJhckN0cmxzW2ldLmFuaW1hdGUoY3JlYXRlQW5pbWF0aW9uKGkgKyAxLCBkdXJhdGlvbiksIGR1cmF0aW9uKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRpbWVsaW5lRG90Q3RybHNbaV0uZXhwYW5kZWRBbmltYXRlKGRvdHNEdXJhdGlvbik7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB9OworICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgIHN0YXJ0KCk7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfV0pCisgICAgICAgIC5kaXJlY3RpdmUoJ2F0dFRpbWVsaW5lJywgWyckdGltZW91dCcsICckY29tcGlsZScsIGZ1bmN0aW9uICgkdGltZW91dCwgJGNvbXBpbGUpIHsKKyAgICAgICAgICAgICAgICByZXR1cm4geworICAgICAgICAgICAgICAgICAgICByZXN0cmljdDogJ0VBJywKKyAgICAgICAgICAgICAgICAgICAgcmVwbGFjZTogdHJ1ZSwKKyAgICAgICAgICAgICAgICAgICAgc2NvcGU6IHsKKyAgICAgICAgICAgICAgICAgICAgICAgIHN0ZXBzOiAnPScsCisgICAgICAgICAgICAgICAgICAgICAgICB0cmlnZ2VyOiAnPScsCisgICAgICAgICAgICAgICAgICAgICAgICBhbHRlcm5hdGU6ICc9JywKKyAgICAgICAgICAgICAgICAgICAgICAgIGJhckFuaW1hdGVEdXJhdGlvbjogJz0nCisgICAgICAgICAgICAgICAgICAgIH0sCisgICAgICAgICAgICAgICAgICAgIHRlbXBsYXRlVXJsOiAnYXBwL3NjcmlwdHMvbmdfanNfYXR0X3RwbHMvc3RlcHRyYWNrZXIvdGltZWxpbmUuaHRtbCcsCisgICAgICAgICAgICAgICAgICAgIGNvbnRyb2xsZXI6ICdBdHRUaW1lbGluZUN0cmwnLAorICAgICAgICAgICAgICAgICAgICBsaW5rOiBmdW5jdGlvbiAoc2NvcGUsIGVsZW1lbnQsIGF0dHJzLCBjdHJsKSB7CisgICAgICAgICAgICAgICAgICAgICAgICB2YXIgaW5pdCA9IGZ1bmN0aW9uICgpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YXIgc3RlcHMgPSBzY29wZS5zdGVwczsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YXIgbWlkZGxlU3RlcHMgPSBbXTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBmb3IgKHZhciBpID0gMTsgaSA8IHN0ZXBzLmxlbmd0aDsgaSsrKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhciBhU3RlcCA9IHN0ZXBzW2ldOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBtaWRkbGVTdGVwcy5wdXNoKGFTdGVwKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2NvcGUubWlkZGxlU3RlcHMgPSBtaWRkbGVTdGVwczsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAvL1VzZWQgaW4gY2FsY3VsYXRpbmcgdGhlIHdpZHRoIG9mIHRoZSBsb2FkaW5nIGJhcnMKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBjdHJsLm51bVN0ZXBzID0gc3RlcHMubGVuZ3RoIC0gMTsKKyAgICAgICAgICAgICAgICAgICAgICAgIH07CisgICAgICAgICAgICAgICAgICAgICAgICBpbml0KCk7CisgICAgICAgICAgICAgICAgICAgICAgICAvL1JlY29tcGlsZSBpbiBjYXNlIG9mIHNjb3BlIGNoYW5nZXMKKyAgICAgICAgICAgICAgICAgICAgICAgIHNjb3BlLnJlc2V0VGltZWxpbmUgPSBmdW5jdGlvbiAoKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2NvcGUuYW5pbWF0ZSA9IHRydWU7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgJGNvbXBpbGUoZWxlbWVudCkoc2NvcGUpOworICAgICAgICAgICAgICAgICAgICAgICAgfTsKKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIH07CisgICAgICAgICAgICB9XSkKKyAgICAgICAgLmNvbnRyb2xsZXIoJ1RpbWVsaW5lQmFyQ3RybCcsIFsnJHNjb3BlJywgZnVuY3Rpb24gKCRzY29wZSkgeworICAgICAgICAgICAgICAgIHRoaXMudHlwZSA9ICd0aW1lbGluZWJhcic7CisgICAgICAgICAgICAgICAgdGhpcy5vcmRlciA9IHBhcnNlSW50KCRzY29wZS5vcmRlcik7CisgICAgICAgICAgICAgICAgdGhpcy5hbmltYXRlID0gZnVuY3Rpb24gKGNhbGxiYWNrLCBkdXJhdGlvbikgeworICAgICAgICAgICAgICAgICAgICAkc2NvcGUubG9hZGluZ0FuaW1hdGlvbihjYWxsYmFjaywgZHVyYXRpb24pOworICAgICAgICAgICAgICAgIH07CisgICAgICAgICAgICAgICAgdGhpcy5pc0NhbmNlbGxlZCA9IGZ1bmN0aW9uIChpc0NhbmNlbGxlZCkgeworICAgICAgICAgICAgICAgICAgICAkc2NvcGUuaXNDYW5jZWxsZWQgPSBpc0NhbmNlbGxlZDsKKyAgICAgICAgICAgICAgICB9OworICAgICAgICAgICAgfV0pCisgICAgICAgIC5kaXJlY3RpdmUoJ3RpbWVsaW5lQmFyJywgWydhbmltYXRpb24nLCAnJHByb2dyZXNzQmFyJywgZnVuY3Rpb24gKGFuaW1hdGlvbiwgJHByb2dyZXNzQmFyKSB7CisgICAgICAgICAgICAgICAgcmV0dXJuIHsKKyAgICAgICAgICAgICAgICAgICAgcmVzdHJpY3Q6ICdFQScsCisgICAgICAgICAgICAgICAgICAgIHJlcGxhY2U6IHRydWUsCisgICAgICAgICAgICAgICAgICAgIHRlbXBsYXRlVXJsOiAnYXBwL3NjcmlwdHMvbmdfanNfYXR0X3RwbHMvc3RlcHRyYWNrZXIvdGltZWxpbmVCYXIuaHRtbCcsCisgICAgICAgICAgICAgICAgICAgIHNjb3BlOiB7CisgICAgICAgICAgICAgICAgICAgICAgICBvcmRlcjogJ0AnCisgICAgICAgICAgICAgICAgICAgIH0sCisgICAgICAgICAgICAgICAgICAgIHJlcXVpcmU6IFsnXmF0dFRpbWVsaW5lJywgJ3RpbWVsaW5lQmFyJ10sCisgICAgICAgICAgICAgICAgICAgIGNvbnRyb2xsZXI6ICdUaW1lbGluZUJhckN0cmwnLAorICAgICAgICAgICAgICAgICAgICBsaW5rOiBmdW5jdGlvbiAoc2NvcGUsIGVsZW1lbnQsIGF0dHJzLCBjdHJscykgeworICAgICAgICAgICAgICAgICAgICAgICAgdmFyIGF0dFRpbWVsaW5lQ3RybCA9IGN0cmxzWzBdOworICAgICAgICAgICAgICAgICAgICAgICAgdmFyIHRpbWVsaW5lQmFyQ3RybCA9IGN0cmxzWzFdOworICAgICAgICAgICAgICAgICAgICAgICAgYXR0VGltZWxpbmVDdHJsLmFkZFRpbWVsaW5lQmFyQ3RybHModGltZWxpbmVCYXJDdHJsKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIHNjb3BlLmlzQ29tcGxldGVkID0gdHJ1ZTsKKyAgICAgICAgICAgICAgICAgICAgICAgIHZhciB3aWR0aFBlcmMgPSAoMTAwIC8gYXR0VGltZWxpbmVDdHJsLm51bVN0ZXBzKSAtIDM7CisgICAgICAgICAgICAgICAgICAgICAgICBlbGVtZW50LmNzcygnd2lkdGgnLCB3aWR0aFBlcmMgKyAnJScpOworICAgICAgICAgICAgICAgICAgICAgICAgdmFyIGVsZW0gPSBlbGVtZW50LmZpbmQoJ2RpdicpLmVxKDApOworICAgICAgICAgICAgICAgICAgICAgICAgYW5pbWF0aW9uLnNldChlbGVtLCB7b3BhY2l0eTogMC4wfSk7CisgICAgICAgICAgICAgICAgICAgICAgICB2YXIgdXBkYXRlQ2FsbGJhY2sgPSBmdW5jdGlvbiAoc2VsZkVsZW1lbnQpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBhbmltYXRpb24uc2V0KGVsZW0sIHtvcGFjaXR5OiAxLjB9KTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBhbmltYXRpb24uc2V0KGVsZW0sIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2NhbGVYOiBzZWxmRWxlbWVudC5wcm9ncmVzcygpLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0cmFuc2Zvcm1PcmlnaW46ICJsZWZ0IgorICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0pOworICAgICAgICAgICAgICAgICAgICAgICAgfTsKKyAgICAgICAgICAgICAgICAgICAgICAgIHNjb3BlLmxvYWRpbmdBbmltYXRpb24gPSAkcHJvZ3Jlc3NCYXIodXBkYXRlQ2FsbGJhY2spOworICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgfTsKKyAgICAgICAgICAgIH1dKQorICAgICAgICAuY29udHJvbGxlcignVGltZWxpbmVEb3RDdHJsJywgWyckc2NvcGUnLCAnJHRpbWVvdXQnLCAndGltZWxpbmVDb25zdGFudHMnLCBmdW5jdGlvbiAoJHNjb3BlLCAkdGltZW91dCwgdGltZWxpbmVDb25zdGFudHMpIHsKKyAgICAgICAgICAgICAgICB0aGlzLnR5cGUgPSAnZG90JzsKKyAgICAgICAgICAgICAgICB0aGlzLm9yZGVyID0gcGFyc2VJbnQoJHNjb3BlLm9yZGVyKTsKKyAgICAgICAgICAgICAgICB2YXIgc2VsZiA9IHRoaXM7CisgICAgICAgICAgICAgICAgJHRpbWVvdXQoZnVuY3Rpb24gKCkgeworICAgICAgICAgICAgICAgICAgICBpZiAoc2VsZi5vcmRlciAhPT0gMCkgeworICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHNlbGYub3JkZXIgJSAyICE9PSAwKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgJHNjb3BlLmluaXRpYWxpemVBYm92ZUZvckFuaW1hdGlvbigpOworICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgZWxzZSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgJHNjb3BlLmluaXRpYWxpemVCZWxvd0ZvckFuaW1hdGlvbigpOworICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgfSk7CisgICAgICAgICAgICAgICAgdGhpcy5leHBhbmRlZEFuaW1hdGUgPSBmdW5jdGlvbiAoZHVyYXRpb24pIHsKKyAgICAgICAgICAgICAgICAgICAgJHNjb3BlLnNldENvbG9yKCk7CisgICAgICAgICAgICAgICAgICAgICRzY29wZS5leHBhbmRlZEFuaW1hdGUoZHVyYXRpb24pOworICAgICAgICAgICAgICAgICAgICBpZiAoc2VsZi5vcmRlciAhPT0gMCAmJiAhJHNjb3BlLmlzU3RlcHNMZXNzVGhhbkZpdmUoKSkgeworICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHNlbGYub3JkZXIgJSAyICE9PSAwKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgJHNjb3BlLmV4cGFuZENvbnRlbnRGb3JBYm92ZShkdXJhdGlvbik7CisgICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICRzY29wZS5leHBhbmRDb250ZW50Rm9yQmVsb3coZHVyYXRpb24pOworICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgfTsKKyAgICAgICAgICAgICAgICB0aGlzLnVuaG92ZXJlZFN0YXRlRm9yQWJvdmUgPSBmdW5jdGlvbiAoZHVyYXRpb24pIHsKKyAgICAgICAgICAgICAgICAgICAgJHNjb3BlLnVuaG92ZXJlZFN0YXRlRm9yQWJvdmUoZHVyYXRpb24pOworICAgICAgICAgICAgICAgIH07CisgICAgICAgICAgICAgICAgdGhpcy51bmhvdmVyZWRTdGF0ZUZvckJlbG93ID0gZnVuY3Rpb24gKGR1cmF0aW9uKSB7CisgICAgICAgICAgICAgICAgICAgICRzY29wZS51bmhvdmVyZWRTdGF0ZUZvckJlbG93KGR1cmF0aW9uKTsKKyAgICAgICAgICAgICAgICB9OworICAgICAgICAgICAgICAgIHRoaXMuc2hyaW5rQW5pbWF0ZSA9IGZ1bmN0aW9uIChkdXJhdGlvbikgeworICAgICAgICAgICAgICAgICAgICAkc2NvcGUuc2hyaW5rQW5pbWF0ZShkdXJhdGlvbik7CisgICAgICAgICAgICAgICAgfTsKKyAgICAgICAgICAgICAgICB0aGlzLnNldEV4cGFuZGVkID0gZnVuY3Rpb24gKCkgeworICAgICAgICAgICAgICAgICAgICAkc2NvcGUuc2V0U2l6ZSgzKTsKKyAgICAgICAgICAgICAgICB9OworICAgICAgICAgICAgICAgIHRoaXMuaXNTdG9wID0gZnVuY3Rpb24gKCkgeworICAgICAgICAgICAgICAgICAgICByZXR1cm4gJHNjb3BlLmlzU3RvcDsKKyAgICAgICAgICAgICAgICB9OworICAgICAgICAgICAgICAgIHRoaXMuaXNDYW5jZWxsZWQgPSBmdW5jdGlvbiAoKSB7CisgICAgICAgICAgICAgICAgICAgIHJldHVybiAoJHNjb3BlLnR5cGUgPT09IHRpbWVsaW5lQ29uc3RhbnRzLlNURVBfVFlQRS5DQU5DRUxMRUQpOworICAgICAgICAgICAgICAgIH07CisgICAgICAgICAgICAgICAgdGhpcy5pc0FsZXJ0ID0gZnVuY3Rpb24gKCkgeworICAgICAgICAgICAgICAgICAgICByZXR1cm4gKCRzY29wZS50eXBlID09PSB0aW1lbGluZUNvbnN0YW50cy5TVEVQX1RZUEUuQUxFUlQpOworICAgICAgICAgICAgICAgIH07CisgICAgICAgICAgICAgICAgLy9TZXRzIHRoZSBib2xkZWQgdGV4dAorICAgICAgICAgICAgICAgIHRoaXMuaXNDdXJyZW50U3RlcCA9IGZ1bmN0aW9uIChpc0N1cnJlbnRTdGVwKSB7CisgICAgICAgICAgICAgICAgICAgIGlmIChpc0N1cnJlbnRTdGVwICE9PSB1bmRlZmluZWQpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICRzY29wZS5pc0N1cnJlbnRTdGVwID0gaXNDdXJyZW50U3RlcDsKKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICByZXR1cm4gJHNjb3BlLmlzQ3VycmVudFN0ZXA7CisgICAgICAgICAgICAgICAgfTsKKyAgICAgICAgICAgIH1dKQorICAgICAgICAuZGlyZWN0aXZlKCd0aW1lbGluZURvdCcsIFsnYW5pbWF0aW9uJywgJ3RpbWVsaW5lQ29uc3RhbnRzJywKKyAgICAgICAgICAgIGZ1bmN0aW9uIChhbmltYXRpb24sIHRpbWVsaW5lQ29uc3RhbnRzKSB7CisgICAgICAgICAgICAgICAgcmV0dXJuIHsKKyAgICAgICAgICAgICAgICAgICAgcmVzdHJpY3Q6ICdFQScsCisgICAgICAgICAgICAgICAgICAgIHJlcGxhY2U6IHRydWUsCisgICAgICAgICAgICAgICAgICAgIHNjb3BlOiB7CisgICAgICAgICAgICAgICAgICAgICAgICBvcmRlcjogJ0AnLAorICAgICAgICAgICAgICAgICAgICAgICAgdGl0bGU6ICdAJywKKyAgICAgICAgICAgICAgICAgICAgICAgIGRlc2NyaXB0aW9uOiAnQCcsCisgICAgICAgICAgICAgICAgICAgICAgICBieTogJ0AnLAorICAgICAgICAgICAgICAgICAgICAgICAgZGF0ZTogJ0AnLAorICAgICAgICAgICAgICAgICAgICAgICAgdHlwZTogJ0AnCisgICAgICAgICAgICAgICAgICAgIH0sCisgICAgICAgICAgICAgICAgICAgIHRlbXBsYXRlVXJsOiAnYXBwL3NjcmlwdHMvbmdfanNfYXR0X3RwbHMvc3RlcHRyYWNrZXIvdGltZWxpbmVEb3QuaHRtbCcsCisgICAgICAgICAgICAgICAgICAgIHJlcXVpcmU6IFsnXmF0dFRpbWVsaW5lJywgJ3RpbWVsaW5lRG90J10sCisgICAgICAgICAgICAgICAgICAgIGNvbnRyb2xsZXI6ICdUaW1lbGluZURvdEN0cmwnLAorICAgICAgICAgICAgICAgICAgICBsaW5rOiBmdW5jdGlvbiAoc2NvcGUsIGVsZW1lbnQsIGF0dHJzLCBjdHJscykgeworICAgICAgICAgICAgICAgICAgICAgICAgdmFyIGF0dFRpbWVsaW5lQ3RybCA9IGN0cmxzWzBdOworICAgICAgICAgICAgICAgICAgICAgICAgdmFyIHRpbWVsaW5lRG90Q3RybCA9IGN0cmxzWzFdOworICAgICAgICAgICAgICAgICAgICAgICAgYXR0VGltZWxpbmVDdHJsLmFkZFRpbWVsaW5lRG90Q3RybHModGltZWxpbmVEb3RDdHJsKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIHNjb3BlLm51bVN0ZXBzID0gYXR0VGltZWxpbmVDdHJsLm51bVN0ZXBzICsgMTsKKyAgICAgICAgICAgICAgICAgICAgICAgIHNjb3BlLmlzQ3VycmVudFN0ZXAgPSBmYWxzZTsKKyAgICAgICAgICAgICAgICAgICAgICAgIHNjb3BlLmlzQ29tcGxldGVkID0gZmFsc2U7CisgICAgICAgICAgICAgICAgICAgICAgICBzY29wZS5pc1N0b3AgPSBmYWxzZTsKKyAgICAgICAgICAgICAgICAgICAgICAgIGlmIChzY29wZS50eXBlID09PSB0aW1lbGluZUNvbnN0YW50cy5TVEVQX1RZUEUuQUxFUlQgfHwgc2NvcGUudHlwZSA9PT0gdGltZWxpbmVDb25zdGFudHMuU1RFUF9UWVBFLkNBTkNFTExFRCkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNjb3BlLmlzU3RvcCA9IHRydWU7CisgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICBzY29wZS5pc0luYWN0aXZlID0gdHJ1ZTsKKyAgICAgICAgICAgICAgICAgICAgICAgIHZhciBkaXZzID0gZWxlbWVudC5maW5kKCdkaXYnKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIHZhciBiaWdnZXJDaXJjbGVFbGVtID0gZGl2cy5lcSgwKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIHZhciBleHBhbmRhYmxlQ2lyY2xlRWxlbSA9IGRpdnMuZXEoMik7CisgICAgICAgICAgICAgICAgICAgICAgICB2YXIgaW5mb2JveEVsZW0gPSBkaXZzLmVxKDMpOworICAgICAgICAgICAgICAgICAgICAgICAgdmFyIHRpdGxlRWxlbSA9IGRpdnMuZXEoNSk7CisgICAgICAgICAgICAgICAgICAgICAgICB2YXIgY29udGVudEVsZW0gPSBkaXZzLmVxKDYpOworICAgICAgICAgICAgICAgICAgICAgICAgdmFyIGRhdGVFbGVtID0gZGl2cy5lcSg5KTsKKyAgICAgICAgICAgICAgICAgICAgICAgIGZ1bmN0aW9uIGlzRW1wdHlTdGVwKCkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICghc2NvcGUuZGVzY3JpcHRpb24gJiYgIXNjb3BlLmJ5ICYmICFzY29wZS5kYXRlKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiB0cnVlOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gZmFsc2U7CisgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICBzY29wZS5pc1N0ZXBzTGVzc1RoYW5GaXZlID0gZnVuY3Rpb24gKCkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChzY29wZS5udW1TdGVwcyA8IDUpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHRydWU7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBmYWxzZTsKKyAgICAgICAgICAgICAgICAgICAgICAgIH07CisgICAgICAgICAgICAgICAgICAgICAgICBzY29wZS50aXRsZU1vdXNlb3ZlciA9IGZ1bmN0aW9uIChudW0pIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoIXNjb3BlLmlzU3RlcHNMZXNzVGhhbkZpdmUoKSAmJiAhaXNFbXB0eVN0ZXAoKSkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAobnVtID09PSAxICYmIHNjb3BlLm9yZGVyICUgMiA9PT0gMCkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2NvcGUuZXhwYW5kQ29udGVudEZvckJlbG93KC4yNSk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKG51bSA9PT0gMiAmJiBzY29wZS5vcmRlciAlIDIgIT09IDApIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNjb3BlLmV4cGFuZENvbnRlbnRGb3JBYm92ZSguMjUpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgfTsKKyAgICAgICAgICAgICAgICAgICAgICAgIHNjb3BlLnRpdGxlTW91c2VsZWF2ZSA9IGZ1bmN0aW9uICgpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoc2NvcGUub3JkZXIgJSAyID09PSAwKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNjb3BlLnVuaG92ZXJlZFN0YXRlRm9yQmVsb3coLjI1KTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgZWxzZSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNjb3BlLnVuaG92ZXJlZFN0YXRlRm9yQWJvdmUoLjI1KTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICB9OworICAgICAgICAgICAgICAgICAgICAgICAgc2NvcGUuaW5pdGlhbGl6ZUFib3ZlRm9yQW5pbWF0aW9uID0gZnVuY3Rpb24gKCkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICghc2NvcGUuaXNTdGVwc0xlc3NUaGFuRml2ZSgpICYmIGF0dFRpbWVsaW5lQ3RybC5pc0FsdGVybmF0ZSgpKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGFuaW1hdGlvbi5zZXQoY29udGVudEVsZW0sIHtvcGFjaXR5OiAwfSk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGFuaW1hdGlvbi5zZXQoZGF0ZUVsZW0sIHtvcGFjaXR5OiAwfSk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICghaXNFbXB0eVN0ZXAoKSkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFyIHlPZmZzZXQgPSBjb250ZW50RWxlbVswXS5vZmZzZXRIZWlnaHQgKyBkYXRlRWxlbVswXS5vZmZzZXRIZWlnaHQ7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBhbmltYXRpb24uc2V0KHRpdGxlRWxlbSwgeyd0b3AnOiB5T2Zmc2V0fSk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICB9OworICAgICAgICAgICAgICAgICAgICAgICAgc2NvcGUuZXhwYW5kQ29udGVudEZvckFib3ZlID0gZnVuY3Rpb24gKGR1cmF0aW9uKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKCFzY29wZS5pc1N0ZXBzTGVzc1RoYW5GaXZlKCkgJiYgYXR0VGltZWxpbmVDdHJsLmlzQWx0ZXJuYXRlKCkpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYW5pbWF0aW9uLnRvKHRpdGxlRWxlbSwgZHVyYXRpb24sIHsndG9wJzogMH0pOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBhbmltYXRpb24udG8oY29udGVudEVsZW0sIGR1cmF0aW9uLCB7b3BhY2l0eTogMX0pOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBhbmltYXRpb24udG8oZGF0ZUVsZW0sIGR1cmF0aW9uLCB7b3BhY2l0eTogMX0pOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgIH07CisgICAgICAgICAgICAgICAgICAgICAgICBzY29wZS51bmhvdmVyZWRTdGF0ZUZvckFib3ZlID0gZnVuY3Rpb24gKGR1cmF0aW9uKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKCFzY29wZS5pc1N0ZXBzTGVzc1RoYW5GaXZlKCkgJiYgYXR0VGltZWxpbmVDdHJsLmlzQWx0ZXJuYXRlKCkpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYW5pbWF0aW9uLnNldChjb250ZW50RWxlbSwge29wYWNpdHk6IDB9KTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYW5pbWF0aW9uLnNldChkYXRlRWxlbSwge29wYWNpdHk6IDF9KTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFyIHlPZmZzZXQgPSBjb250ZW50RWxlbVswXS5vZmZzZXRIZWlnaHQ7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGFuaW1hdGlvbi50byh0aXRsZUVsZW0sIGR1cmF0aW9uLCB7J3RvcCc6IHlPZmZzZXR9KTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICB9OworICAgICAgICAgICAgICAgICAgICAgICAgc2NvcGUuaW5pdGlhbGl6ZUJlbG93Rm9yQW5pbWF0aW9uID0gZnVuY3Rpb24gKCkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICghc2NvcGUuaXNTdGVwc0xlc3NUaGFuRml2ZSgpICYmIGF0dFRpbWVsaW5lQ3RybC5pc0FsdGVybmF0ZSgpKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGFuaW1hdGlvbi5zZXQoY29udGVudEVsZW0sIHtoZWlnaHQ6ICcwJScsIG9wYWNpdHk6IDAsIHRvcDogJy0yMHB4J30pOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBhbmltYXRpb24uc2V0KGRhdGVFbGVtLCB7b3BhY2l0eTogMH0pOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgIH07CisgICAgICAgICAgICAgICAgICAgICAgICBzY29wZS5leHBhbmRDb250ZW50Rm9yQmVsb3cgPSBmdW5jdGlvbiAoZHVyYXRpb24pIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoIXNjb3BlLmlzU3RlcHNMZXNzVGhhbkZpdmUoKSAmJiBhdHRUaW1lbGluZUN0cmwuaXNBbHRlcm5hdGUoKSkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBhbmltYXRpb24uc2V0KGRhdGVFbGVtLCB7b3BhY2l0eTogMX0pOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBhbmltYXRpb24udG8oY29udGVudEVsZW0sIGR1cmF0aW9uLCB7aGVpZ2h0OiAnYXV0bycsIG9wYWNpdHk6IDEsIHRvcDogJzBweCd9KTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICB9OworICAgICAgICAgICAgICAgICAgICAgICAgc2NvcGUudW5ob3ZlcmVkU3RhdGVGb3JCZWxvdyA9IGZ1bmN0aW9uIChkdXJhdGlvbikgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICghc2NvcGUuaXNTdGVwc0xlc3NUaGFuRml2ZSgpICYmIGF0dFRpbWVsaW5lQ3RybC5pc0FsdGVybmF0ZSgpKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGFuaW1hdGlvbi50byhjb250ZW50RWxlbSwgZHVyYXRpb24sIHtoZWlnaHQ6ICcwJScsIG9wYWNpdHk6IDAsIHRvcDogJy0yMHB4JywgcG9zaXRpb246ICdyZWxhdGl2ZSd9KTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYW5pbWF0aW9uLnNldChkYXRlRWxlbSwge29wYWNpdHk6IDF9KTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICB9OworICAgICAgICAgICAgICAgICAgICAgICAgLypEZWZhdWx0IEluaXRpYWxpemF6dGlvbiovCisgICAgICAgICAgICAgICAgICAgICAgICAvL0lmIHRoZSBpbmZvIGJveCBpcyBhYm92ZSBhbmQgdGhlIGRlc2NyaXB0aW9uIGFuZCBkYXRlIGFuZCBieSBhcmUgZW1wdHkgdGhlbiB3ZSBoYXZlIGRvIHJlc2V0IGl0cyBwb3NpdGlvbgorICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGlzRW1wdHlTdGVwKCkgJiYgKHNjb3BlLm9yZGVyICUgMiAhPT0gMCAmJiBhdHRUaW1lbGluZUN0cmwuaXNBbHRlcm5hdGUoKSkpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBpbmZvYm94RWxlbS5jc3MoJ3RvcCcsICctNDdweCcpOworICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgLy9DaGVjayBpZiB0aGUgb3JkZXIgaXMgb2RkIGFuZCBzZXQgdGhlIGFwcHJvcGlhdGUgYWJvdmUgb3IgYmVsb3cgYW5kIG90aGVyIGVmZmVjdHMKKyAgICAgICAgICAgICAgICAgICAgICAgIGlmIChzY29wZS5vcmRlciAlIDIgPT09IDAgfHwgIWF0dFRpbWVsaW5lQ3RybC5pc0FsdGVybmF0ZSgpKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2NvcGUuaXNCZWxvd0luZm9Cb3hTaG93biA9IHRydWU7CisgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICBlbHNlIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBzY29wZS5pc0JlbG93SW5mb0JveFNob3duID0gZmFsc2U7CisgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICAvL21vZGlmeSBzb21lIGNzcyBmb3Igc3RlcHMgbGVzcyB0aGFuIDUgYW5kIG5vdCBhbHRlcm5hdGluZworICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHNjb3BlLmlzU3RlcHNMZXNzVGhhbkZpdmUoKSAmJiAhYXR0VGltZWxpbmVDdHJsLmlzQWx0ZXJuYXRlKCkpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBhbmltYXRpb24uc2V0KGRhdGVFbGVtLCB7bWFyZ2luVG9wOiAxMH0pOworICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgLy9Gb3IgSUUgOCBmaXgKKyAgICAgICAgICAgICAgICAgICAgICAgIGFuaW1hdGlvbi5zZXQoYmlnZ2VyQ2lyY2xlRWxlbSwge29wYWNpdHk6ICcuNSd9KTsKKyAgICAgICAgICAgICAgICAgICAgICAgIC8vc2hyaW5rIHRoZSBleHBhbmRhYmxlQ2lyY2xlIHRvIHdlIGNhbiBleHBhbmQgaXQgbGF0ZXIKKyAgICAgICAgICAgICAgICAgICAgICAgIGFuaW1hdGlvbi5zZXQoZXhwYW5kYWJsZUNpcmNsZUVsZW0sIHtvcGFjaXR5OiAnMC4wJ30pOworICAgICAgICAgICAgICAgICAgICAgICAgYW5pbWF0aW9uLnNldChleHBhbmRhYmxlQ2lyY2xlRWxlbSwge3NjYWxlOiAuMTB9KTsKKyAgICAgICAgICAgICAgICAgICAgICAgIGlmIChzY29wZS5vcmRlciA9PT0gMCkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGFuaW1hdGlvbi5zZXQoZXhwYW5kYWJsZUNpcmNsZUVsZW0sIHtvcGFjaXR5OiAnMS4wJ30pOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGFuaW1hdGlvbi5zZXQoZXhwYW5kYWJsZUNpcmNsZUVsZW0sIHtzY2FsZTogMX0pOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGFuaW1hdGlvbi5zZXQoYmlnZ2VyQ2lyY2xlRWxlbSwge3NjYWxlOiAzfSk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2NvcGUuaXNDdXJyZW50U3RlcCA9IHRydWU7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2NvcGUuaXNJbmFjdGl2ZSA9IGZhbHNlOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNjb3BlLmlzQ29tcGxldGVkID0gdHJ1ZTsKKyAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgIHNjb3BlLnNldENvbG9yID0gZnVuY3Rpb24gKCkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNjb3BlLmlzSW5hY3RpdmUgPSBmYWxzZTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoc2NvcGUudHlwZSA9PT0gdGltZWxpbmVDb25zdGFudHMuU1RFUF9UWVBFLkNBTkNFTExFRCkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzY29wZS5pc0NhbmNlbGxlZCA9IHRydWU7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgICAgIGVsc2UgaWYgKHNjb3BlLnR5cGUgPT09IHRpbWVsaW5lQ29uc3RhbnRzLlNURVBfVFlQRS5BTEVSVCkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzY29wZS5pc0FsZXJ0ID0gdHJ1ZTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgZWxzZSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNjb3BlLmlzQ29tcGxldGVkID0gdHJ1ZTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKCFzY29wZS4kcGhhc2UpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2NvcGUuJGFwcGx5KCk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgfTsKKyAgICAgICAgICAgICAgICAgICAgICAgIHNjb3BlLnNldFNpemUgPSBmdW5jdGlvbiAoc2l6ZSkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGFuaW1hdGlvbi5zZXQoYmlnZ2VyQ2lyY2xlLCB7c2NhbGU6IHNpemV9KTsKKyAgICAgICAgICAgICAgICAgICAgICAgIH07CisgICAgICAgICAgICAgICAgICAgICAgICBzY29wZS5zZXRFeHBhbmRlZENpcmNsZSA9IGZ1bmN0aW9uICgpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBhbmltYXRpb24uc2V0KGV4cGFuZGFibGVDaXJjbGVFbGVtLCB7b3BhY2l0eTogJzEuMCd9KTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBhbmltYXRpb24uc2V0KGV4cGFuZGFibGVDaXJjbGVFbGVtLCB7c2NhbGU6IDF9KTsKKyAgICAgICAgICAgICAgICAgICAgICAgIH07CisgICAgICAgICAgICAgICAgICAgICAgICBzY29wZS5leHBhbmRlZEFuaW1hdGUgPSBmdW5jdGlvbiAoZHVyYXRpb24pIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBhbmltYXRpb24udG8oYmlnZ2VyQ2lyY2xlRWxlbSwgZHVyYXRpb24sIHtzY2FsZTogM30pOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGFuaW1hdGlvbi5zZXQoZXhwYW5kYWJsZUNpcmNsZUVsZW0sIHtvcGFjaXR5OiAnMS4wJ30pOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGFuaW1hdGlvbi50byhleHBhbmRhYmxlQ2lyY2xlRWxlbSwgZHVyYXRpb24sIHtzY2FsZTogMX0pOworICAgICAgICAgICAgICAgICAgICAgICAgfTsKKyAgICAgICAgICAgICAgICAgICAgICAgIHNjb3BlLnNocmlua0FuaW1hdGUgPSBmdW5jdGlvbiAoZHVyYXRpb24pIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBhbmltYXRpb24udG8oYmlnZ2VyQ2lyY2xlRWxlbSwgZHVyYXRpb24sIHtzY2FsZTogMX0pOworICAgICAgICAgICAgICAgICAgICAgICAgfTsKKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIH07CisgICAgICAgICAgICB9XSk7Cithbmd1bGFyLm1vZHVsZSgnYXR0LmFicy50YWJsZScsIFsnYXR0LmFicy51dGlsaXRpZXMnXSkKKy5jb25zdGFudCgndGFibGVDb25maWcnLCB7CisgICAgLy90cnVlIGZvciBkZXNjZW5kaW5nICYgZmFsc2UgZm9yIGFzY2VuZGluZworICAgIGRlZmF1bHRTb3J0UGF0dGVybjogZmFsc2UsCisgICAgaGlnaGxpZ2h0U2VhcmNoU3RyaW5nQ2xhc3M6ICd0YWJsZXNvcnRlci1zZWFyY2gtaGlnaGxpZ2h0JworfSkKKworLmRpcmVjdGl2ZSgnYXR0VGFibGUnLCBbJyRmaWx0ZXInLCBmdW5jdGlvbigkZmlsdGVyKSB7CisgICAgcmV0dXJuIHsKKyAgICAgICAgcmVzdHJpY3Q6ICdFQScsCisgICAgICAgIHJlcGxhY2U6IHRydWUsCisgICAgICAgIHRyYW5zY2x1ZGU6IHRydWUsCisgICAgICAgIHNjb3BlOiB7CisgICAgICAgICAgICB0YWJsZURhdGE6ICI9IiwKKyAgICAgICAgICAgIHZpZXdQZXJQYWdlOiAiPSIsCisgICAgICAgICAgICBjdXJyZW50UGFnZTogIj0iLAorICAgICAgICAgICAgdG90YWxQYWdlOiAiPSIsCisgICAgICAgICAgICBzZWFyY2hDYXRlZ29yeTogIj0iLAorICAgICAgICAgICAgc2VhcmNoU3RyaW5nOiAiPSIKKyAgICAgICAgfSwKKyAgICAgICAgcmVxdWlyZTogJ2F0dFRhYmxlJywKKyAgICAgICAgdGVtcGxhdGVVcmw6ICdhcHAvc2NyaXB0cy9uZ19qc19hdHRfdHBscy90YWJsZS9hdHRUYWJsZS5odG1sJywKKyAgICAgICAgY29udHJvbGxlcjogWyckc2NvcGUnLCBmdW5jdGlvbigkc2NvcGUpIHsKKyAgICAgICAgICAgIHRoaXMuaGVhZGVycyA9IFtdOworICAgICAgICAgICAgdGhpcy5jdXJyZW50U29ydEluZGV4ID0gbnVsbDsKKyAgICAgICAgICAgIHRoaXMuc2V0SW5kZXggPSBmdW5jdGlvbihoZWFkZXJTY29wZSkgeworICAgICAgICAgICAgICAgIHRoaXMuaGVhZGVycy5wdXNoKGhlYWRlclNjb3BlKTsKKyAgICAgICAgICAgIH07CisgICAgICAgICAgICB0aGlzLmdldEluZGV4ID0gZnVuY3Rpb24oaGVhZGVyTmFtZSkgeworICAgICAgICAgICAgICAgIGZvciAodmFyIGkgPSAwOyBpIDwgdGhpcy5oZWFkZXJzLmxlbmd0aDsgaSsrKSB7CisgICAgICAgICAgICAgICAgICAgIGlmICh0aGlzLmhlYWRlcnNbaV0uaGVhZGVyTmFtZSA9PT0gaGVhZGVyTmFtZSkgeworICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHRoaXMuaGVhZGVyc1tpXS5pbmRleDsKKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICByZXR1cm4gbnVsbDsKKyAgICAgICAgICAgIH07CisgICAgICAgICAgICB0aGlzLnNvcnREYXRhID0gZnVuY3Rpb24oY29sdW1uSW5kZXgsIHJldmVyc2UpIHsKKyAgICAgICAgICAgICAgICAkc2NvcGUuJHBhcmVudC5jb2x1bW5JbmRleCA9IGNvbHVtbkluZGV4OworICAgICAgICAgICAgICAgICRzY29wZS4kcGFyZW50LnJldmVyc2UgPSByZXZlcnNlOworICAgICAgICAgICAgICAgIHRoaXMuY3VycmVudFNvcnRJbmRleCA9IGNvbHVtbkluZGV4OworICAgICAgICAgICAgICAgICRzY29wZS5jdXJyZW50UGFnZSA9IDE7CisgICAgICAgICAgICAgICAgdGhpcy5yZXNldFNvcnRQYXR0ZXJuKCk7CisgICAgICAgICAgICB9OworICAgICAgICAgICAgdGhpcy5nZXRTZWFyY2hTdHJpbmcgPSBmdW5jdGlvbigpIHsKKyAgICAgICAgICAgICAgICByZXR1cm4gJHNjb3BlLnNlYXJjaFN0cmluZzsKKyAgICAgICAgICAgIH07CisgICAgICAgICAgICB0aGlzLnJlc2V0U29ydFBhdHRlcm4gPSBmdW5jdGlvbigpIHsKKyAgICAgICAgICAgICAgICBmb3IodmFyIGkgPSAwOyBpIDwgdGhpcy5oZWFkZXJzLmxlbmd0aDsgaSsrKSB7CisgICAgICAgICAgICAgICAgICAgIHZhciBjdXJyZW50U2NvcGUgPSB0aGlzLmhlYWRlcnNbaV07CisgICAgICAgICAgICAgICAgICAgIGlmKGN1cnJlbnRTY29wZS5pbmRleCAhPT0gdGhpcy5jdXJyZW50U29ydEluZGV4KSB7CisgICAgICAgICAgICAgICAgICAgICAgICBjdXJyZW50U2NvcGUucmVzZXRTb3J0UGF0dGVybigpOworICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfTsKKyAgICAgICAgfV0sCisgICAgICAgIGxpbms6IGZ1bmN0aW9uKHNjb3BlLCBlbGVtLCBhdHRyLCBjdHJsKSB7CisgICAgICAgICAgICBzY29wZS5zZWFyY2hDcml0ZXJpYSA9IHt9OworICAgICAgICAgICAgc2NvcGUuJHdhdGNoQ29sbGVjdGlvbigndGFibGVEYXRhJywgZnVuY3Rpb24odmFsdWUpIHsKKyAgICAgICAgICAgICAgICBpZih2YWx1ZSAmJiAhaXNOYU4odmFsdWUubGVuZ3RoKSkgeworICAgICAgICAgICAgICAgICAgICBzY29wZS50b3RhbFJvd3MgPSB2YWx1ZS5sZW5ndGg7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfSk7CisgICAgICAgICAgICBzY29wZS4kd2F0Y2goJ2N1cnJlbnRQYWdlJywgZnVuY3Rpb24odmFsKSB7CisgICAgICAgICAgICAgICAgc2NvcGUuJHBhcmVudC5jdXJyZW50UGFnZSA9IHZhbDsKKyAgICAgICAgICAgIH0pOworICAgICAgICAgICAgc2NvcGUuJHdhdGNoKCd2aWV3UGVyUGFnZScsIGZ1bmN0aW9uKHZhbCkgeworICAgICAgICAgICAgICAgIHNjb3BlLiRwYXJlbnQudmlld1BlclBhZ2UgPSB2YWw7CisgICAgICAgICAgICB9KTsKKyAgICAgICAgICAgIHNjb3BlLiR3YXRjaChmdW5jdGlvbigpIHsKKyAgICAgICAgICAgICAgICByZXR1cm4gc2NvcGUudG90YWxSb3dzIC8gc2NvcGUudmlld1BlclBhZ2U7CisgICAgICAgICAgICB9LCBmdW5jdGlvbih2YWx1ZSkgeworICAgICAgICAgICAgICAgIGlmKCFpc05hTih2YWx1ZSkpIHsKKyAgICAgICAgICAgICAgICAgICAgc2NvcGUudG90YWxQYWdlID0gTWF0aC5jZWlsKHZhbHVlKTsKKyAgICAgICAgICAgICAgICAgICAgc2NvcGUuY3VycmVudFBhZ2UgPSAxOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0pOworICAgICAgICAgICAgdmFyIHNlYXJjaFZhbENoZWNrID0gZnVuY3Rpb24odmFsKXsKKyAgICAgICAgICAgICAgICBpZihhbmd1bGFyLmlzRGVmaW5lZCh2YWwpICYmIHZhbCAhPT0gbnVsbCAmJiB2YWwgIT09ICIiKXsKKyAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHRydWU7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfTsKKyAgICAgICAgICAgIHZhciBzZXRTZWFyY2hDcml0ZXJpYSA9IGZ1bmN0aW9uKHYxLHYyKXsKKyAgICAgICAgICAgICAgICBpZihzZWFyY2hWYWxDaGVjayh2MSkgJiYgc2VhcmNoVmFsQ2hlY2sodjIpKXsKKyAgICAgICAgICAgICAgICAgICAgdmFyIGluZGV4ID0gY3RybC5nZXRJbmRleCh2Mik7CisgICAgICAgICAgICAgICAgICAgIHNjb3BlLnNlYXJjaENyaXRlcmlhID0ge307CisgICAgICAgICAgICAgICAgICAgIGlmIChpbmRleCAhPT0gbnVsbCkgeworICAgICAgICAgICAgICAgICAgICAgICAgc2NvcGUuc2VhcmNoQ3JpdGVyaWFbaW5kZXhdID0gdjE7CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICB9ZWxzZSBpZihzZWFyY2hWYWxDaGVjayh2MSkgJiYgKCFhbmd1bGFyLmlzRGVmaW5lZCh2MikgfHwgdjIgPT09IG51bGwgfHwgdjIgPT09ICIiKSl7CisgICAgICAgICAgICAgICAgICAgIHNjb3BlLnNlYXJjaENyaXRlcmlhID0geworICAgICAgICAgICAgICAgICAgICAgICAgJDogdjEKKyAgICAgICAgICAgICAgICAgICAgfTsKKyAgICAgICAgICAgICAgICB9ZWxzZSB7CisgICAgICAgICAgICAgICAgICAgIHNjb3BlLnNlYXJjaENyaXRlcmlhID0ge307CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfTsKKyAgICAgICAgICAgIHNjb3BlLiR3YXRjaCgnc2VhcmNoQ2F0ZWdvcnknLCBmdW5jdGlvbihuZXdWYWwsb2xkVmFsKSB7CisgICAgICAgICAgICAgICAgaWYobmV3VmFsICE9PSBvbGRWYWwpeworICAgICAgICAgICAgICAgICAgICBzZXRTZWFyY2hDcml0ZXJpYShzY29wZS5zZWFyY2hTdHJpbmcsbmV3VmFsKTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9KTsKKyAgICAgICAgICAgIHNjb3BlLiR3YXRjaCgnc2VhcmNoU3RyaW5nJywgZnVuY3Rpb24gKG5ld1ZhbCxvbGRWYWwpIHsKKyAgICAgICAgICAgICAgICBpZihuZXdWYWwgIT09IG9sZFZhbCl7CisgICAgICAgICAgICAgICAgICAgIHNldFNlYXJjaENyaXRlcmlhKG5ld1ZhbCxzY29wZS5zZWFyY2hDYXRlZ29yeSk7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfSk7CisgICAgICAgICAgICBzY29wZS4kd2F0Y2hDb2xsZWN0aW9uKCdzZWFyY2hDcml0ZXJpYScsIGZ1bmN0aW9uKHZhbCkgeworICAgICAgICAgICAgICAgIHNjb3BlLiRwYXJlbnQuc2VhcmNoQ3JpdGVyaWEgPSB2YWw7CisgICAgICAgICAgICAgICAgc2NvcGUudG90YWxSb3dzID0gc2NvcGUudGFibGVEYXRhICYmICgkZmlsdGVyKCdmaWx0ZXInKShzY29wZS50YWJsZURhdGEsIHZhbCwgZmFsc2UpKS5sZW5ndGggfHwgMDsKKyAgICAgICAgICAgICAgICBzY29wZS5jdXJyZW50UGFnZSA9IDE7CisgICAgICAgICAgICB9KTsKKyAgICAgICAgfQorICAgIH07Cit9XSkKKworLmRpcmVjdGl2ZSgnYXR0VGFibGVSb3cnLCBbZnVuY3Rpb24oKSB7CisgICAgcmV0dXJuIHsKKyAgICAgICAgcmVzdHJpY3Q6ICdFQScsCisgICAgICAgIGNvbXBpbGU6IGZ1bmN0aW9uIChlbGVtLCBhdHRyKSB7CisgICAgICAgICAgICBpZiAoYXR0ci50eXBlID09PSAnaGVhZGVyJykgeworICAgICAgICAgICAgICAgIGVsZW0uZmluZCgndHInKS5lcSgwKS5hZGRDbGFzcygndGFibGVzb3J0ZXItaGVhZGVyUm93Jyk7CisgICAgICAgICAgICB9IGVsc2UgaWYgKGF0dHIudHlwZSA9PT0gJ2JvZHknKSB7CisgICAgICAgICAgICAgICAgdmFyIGh0bWwgPSBlbGVtLmNoaWxkcmVuKCk7CisgICAgICAgICAgICAgICAgaWYoYXR0ci5yb3dSZXBlYXQpeworICAgICAgICAgICAgICAgICAgICBpZiAoYXR0ci50cmFja0J5KSB7CisgICAgICAgICAgICAgICAgICAgICAgICBodG1sLmF0dHIoJ25nLXJlcGVhdCcsIGF0dHIucm93UmVwZWF0LmNvbmNhdCgiIHwgb3JkZXJCeSA6IGNvbHVtbkluZGV4IDogcmV2ZXJzZSB8IGZpbHRlciA6IHNlYXJjaENyaXRlcmlhIDogZmFsc2UgfCBhdHRMaW1pdFRvIDogdmlld1BlclBhZ2UgOiB2aWV3UGVyUGFnZSooY3VycmVudFBhZ2UtMSkgdHJhY2sgYnkgIiArIGF0dHIudHJhY2tCeSkpOworICAgICAgICAgICAgICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgICAgICAgICAgICAgaHRtbC5hdHRyKCduZy1yZXBlYXQnLCBhdHRyLnJvd1JlcGVhdC5jb25jYXQoIiB8IG9yZGVyQnkgOiBjb2x1bW5JbmRleCA6IHJldmVyc2UgfCBmaWx0ZXIgOiBzZWFyY2hDcml0ZXJpYSA6IGZhbHNlIHwgYXR0TGltaXRUbyA6IHZpZXdQZXJQYWdlIDogdmlld1BlclBhZ2UqKGN1cnJlbnRQYWdlLTEpIHRyYWNrIGJ5ICRpbmRleCIpKTsKKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICBodG1sLmF0dHIoJ25nLWNsYXNzJywgInsnYWx0LXJvdyc6ICRldmVuLCdub3JtYWwtcm93JzogJG9kZH0iKTsKKyAgICAgICAgICAgICAgICBlbGVtLmFwcGVuZChodG1sKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgIH07Cit9XSkKKworLmRpcmVjdGl2ZSgnYXR0VGFibGVIZWFkZXInLCBbJ3RhYmxlQ29uZmlnJywgZnVuY3Rpb24odGFibGVDb25maWcpIHsgCisgICAgcmV0dXJuIHsgCisgICAgICAgIHJlc3RyaWN0OiAnRUEnLCAKKyAgICAgICAgcmVwbGFjZTogdHJ1ZSwgCisgICAgICAgIHRyYW5zY2x1ZGU6IHRydWUsIAorICAgICAgICBzY29wZTogeyAKKyAgICAgICAgICAgIHNvcnRhYmxlOiAnQCcsIAorICAgICAgICAgICAgZGVmYXVsdFNvcnQ6ICdAJywgCisgICAgICAgICAgICBpbmRleDogJ0BrZXknIAorICAgICAgICB9LCAKKyAgICAgICAgcmVxdWlyZTogJ15hdHRUYWJsZScsIAorICAgICAgICB0ZW1wbGF0ZVVybDogJ2FwcC9zY3JpcHRzL25nX2pzX2F0dF90cGxzL3RhYmxlL2F0dFRhYmxlSGVhZGVyLmh0bWwnLCAKKyAgICAgICAgbGluazogZnVuY3Rpb24oc2NvcGUsIGVsZW0sIGF0dHIsIGN0cmwpIHsgCisgICAgICAgICAgICB2YXIgcmV2ZXJzZSA9IHRhYmxlQ29uZmlnLmRlZmF1bHRTb3J0UGF0dGVybjsgCisgICAgICAgICAgICBzY29wZS5oZWFkZXJOYW1lID0gZWxlbS50ZXh0KCk7IAorICAgICAgICAgICAgc2NvcGUuc29ydFBhdHRlcm4gPSBudWxsOyAKKyAgICAgICAgICAgIGN0cmwuc2V0SW5kZXgoc2NvcGUpOyAKKyAKKyAgICAgICAgICAgIHNjb3BlLiR3YXRjaChmdW5jdGlvbigpIHsgCisgICAgICAgICAgICAgICAgcmV0dXJuIGVsZW0udGV4dCgpOyAKKyAgICAgICAgICAgIH0sIGZ1bmN0aW9uKHZhbHVlKSB7IAorICAgICAgICAgICAgICAgIHNjb3BlLmhlYWRlck5hbWUgPSB2YWx1ZTsgCisgICAgICAgICAgICB9KTsgCisgICAgICAgICAgICBzY29wZS5zb3J0ID0gZnVuY3Rpb24oc29ydFR5cGUpIHsgCisgICAgICAgICAgICAgICAgaWYodHlwZW9mIHNvcnRUeXBlID09PSAnYm9vbGVhbicpIHsgCisgICAgICAgICAgICAgICAgICAgIHJldmVyc2UgPSBzb3J0VHlwZTsgCisgICAgICAgICAgICAgICAgfSAKKyAgICAgICAgICAgICAgICBjdHJsLnNvcnREYXRhKHNjb3BlLmluZGV4LCByZXZlcnNlKTsgCisgICAgICAgICAgICAgICAgc2NvcGUuc29ydFBhdHRlcm4gPSByZXZlcnNlID8gJ2Rlc2NlbmRpbmcnIDogJ2FzY2VuZGluZyc7IAorICAgICAgICAgICAgICAgIHJldmVyc2UgPSAhcmV2ZXJzZTsgCisgICAgICAgICAgICB9OyAKKyAgICAgICAgICAgIHNjb3BlLiR3YXRjaChmdW5jdGlvbigpIHsgCisgICAgICAgICAgICAgICAgcmV0dXJuIGN0cmwuY3VycmVudFNvcnRJbmRleDsgCisgICAgICAgICAgICB9LCBmdW5jdGlvbih2YWx1ZSkgeyAKKyAgICAgICAgICAgICAgICBpZiAodmFsdWUgIT09IHNjb3BlLmluZGV4KSB7IAorICAgICAgICAgICAgICAgICAgICBzY29wZS5zb3J0UGF0dGVybiA9IG51bGw7IAorICAgICAgICAgICAgICAgIH0gCisgICAgICAgICAgICB9KTsgCisgCisgICAgICAgICAgICBpZiAoc2NvcGUuc29ydGFibGUgPT09IHVuZGVmaW5lZCB8fCBzY29wZS5zb3J0YWJsZSA9PT0gJ3RydWUnIHx8IHNjb3BlLnNvcnRhYmxlID09PSB0cnVlKSB7IAorICAgICAgICAgICAgICAgIHNjb3BlLnNvcnRhYmxlID0gJ3RydWUnOyAKKyAgICAgICAgICAgIH0gZWxzZSBpZiAoc2NvcGUuc29ydGFibGUgPT09IGZhbHNlIHx8IHNjb3BlLnNvcnRhYmxlID09PSAnZmFsc2UnKSB7IAorICAgICAgICAgICAgICAgIHNjb3BlLnNvcnRhYmxlID0gJ2ZhbHNlJzsgCisgICAgICAgICAgICB9IAorIAorICAgICAgICAgICAgaWYoc2NvcGUuc29ydGFibGUgIT09ICdmYWxzZScpIHsgCisgICAgICAgICAgICAgICAgaWYoc2NvcGUuZGVmYXVsdFNvcnQgPT09ICdBJyB8fCBzY29wZS5kZWZhdWx0U29ydCA9PT0gJ2EnKSB7IAorICAgICAgICAgICAgICAgICAgICBzY29wZS5zb3J0KGZhbHNlKTsgCisgICAgICAgICAgICAgICAgfSBlbHNlIGlmKHNjb3BlLmRlZmF1bHRTb3J0ID09PSAnRCcgfHwgc2NvcGUuZGVmYXVsdFNvcnQgPT09ICdkJykgeyAKKyAgICAgICAgICAgICAgICAgICAgc2NvcGUuc29ydCh0cnVlKTsgCisgICAgICAgICAgICAgICAgfSAKKyAgICAgICAgICAgIH0gCisgICAgICAgICAgICBzY29wZS5yZXNldFNvcnRQYXR0ZXJuID0gZnVuY3Rpb24oKSB7IAorICAgICAgICAgICAgICAgIHJldmVyc2UgPSB0YWJsZUNvbmZpZy5kZWZhdWx0U29ydFBhdHRlcm47IAorICAgICAgICAgICAgfTsgCisgICAgICAgIH0gCisgICAgfTsgCit9XSkKKworLmRpcmVjdGl2ZSgnYXR0VGFibGVCb2R5JywgWyckZmlsdGVyJywgJyR0aW1lb3V0JywgJ3RhYmxlQ29uZmlnJywgZnVuY3Rpb24oJGZpbHRlciwgJHRpbWVvdXQsIHRhYmxlQ29uZmlnKSB7CisgICAgcmV0dXJuIHsKKyAgICAgICAgcmVzdHJpY3Q6ICdFQScsCisgICAgICAgIHJlcXVpcmU6ICdeYXR0VGFibGUnLAorICAgICAgICByZXBsYWNlOiB0cnVlLAorICAgICAgICB0cmFuc2NsdWRlOiB0cnVlLAorICAgICAgICB0ZW1wbGF0ZVVybDogJ2FwcC9zY3JpcHRzL25nX2pzX2F0dF90cGxzL3RhYmxlL2F0dFRhYmxlQm9keS5odG1sJywKKyAgICAgICAgbGluazogZnVuY3Rpb24gKHNjb3BlLCBlbGVtLCBhdHRyLCBjdHJsKSB7CisgICAgICAgICAgICB2YXIgaGlnaGxpZ2h0U2VhcmNoU3RyaW5nQ2xhc3MgPSB0YWJsZUNvbmZpZy5oaWdobGlnaHRTZWFyY2hTdHJpbmdDbGFzczsKKyAgICAgICAgICAgIHZhciBzZWFyY2hTdHJpbmcgPSAiIjsKKyAgICAgICAgICAgIHZhciB3cmFwRWxlbWVudCA9IGZ1bmN0aW9uIChlbGVtKSB7CisgICAgICAgICAgICAgICAgdmFyIHRleHQgPSBlbGVtLnRleHQoKTsKKyAgICAgICAgICAgICAgICBlbGVtLmh0bWwoJGZpbHRlcignaGlnaGxpZ2h0JykodGV4dCwgc2VhcmNoU3RyaW5nLCBoaWdobGlnaHRTZWFyY2hTdHJpbmdDbGFzcykpOworICAgICAgICAgICAgfTsKKyAgICAgICAgICAgIHZhciB0cmF2ZXJzZSA9IGZ1bmN0aW9uIChlbGVtKSB7CisgICAgICAgICAgICAgICAgdmFyIGlubmVySHRtbCA9IGVsZW0uY2hpbGRyZW4oKTsKKyAgICAgICAgICAgICAgICBpZiAoaW5uZXJIdG1sLmxlbmd0aCA+IDApIHsKKyAgICAgICAgICAgICAgICAgICAgZm9yICh2YXIgaSA9IDA7IGkgPCBpbm5lckh0bWwubGVuZ3RoOyBpKyspIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIHRyYXZlcnNlKGlubmVySHRtbC5lcShpKSk7CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgICAgICAgICB3cmFwRWxlbWVudChlbGVtKTsKKyAgICAgICAgICAgICAgICAgICAgcmV0dXJuOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH07CisgICAgICAgICAgICB2YXIgY2xlYXJXcmFwID0gZnVuY3Rpb24gKGVsZW0pIHsKKyAgICAgICAgICAgICAgICB2YXIgZWxlbXMgPSBlbGVtLmZpbmQoJyonKTsKKyAgICAgICAgICAgICAgICBmb3IgKHZhciBpID0gMDsgaSA8IGVsZW1zLmxlbmd0aDsgaSsrKSB7CisgICAgICAgICAgICAgICAgICAgIGlmIChlbGVtcy5lcShpKS5hdHRyKCdjbGFzcycpICYmIGVsZW1zLmVxKGkpLmF0dHIoJ2NsYXNzJykuaW5kZXhPZihoaWdobGlnaHRTZWFyY2hTdHJpbmdDbGFzcykgIT09IC0xKSB7CisgICAgICAgICAgICAgICAgICAgICAgICB2YXIgdGV4dCA9IGVsZW1zLmVxKGkpLnRleHQoKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIGVsZW1zLmVxKGkpLnJlcGxhY2VXaXRoKHRleHQpOworICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfTsKKyAgICAgICAgICAgICR0aW1lb3V0KGZ1bmN0aW9uICgpIHsKKyAgICAgICAgICAgICAgICB2YXIgYWN0dWFsSHRtbCA9IGVsZW0uY2hpbGRyZW4oKTsKKyAgICAgICAgICAgICAgICBzY29wZS4kd2F0Y2goZnVuY3Rpb24gKCkgeworICAgICAgICAgICAgICAgICAgICByZXR1cm4gY3RybC5nZXRTZWFyY2hTdHJpbmcoKTsKKyAgICAgICAgICAgICAgICB9LCBmdW5jdGlvbiAodmFsKSB7CisgICAgICAgICAgICAgICAgICAgIHNlYXJjaFN0cmluZyA9IHZhbDsKKyAgICAgICAgICAgICAgICAgICAgY2xlYXJXcmFwKGVsZW0pOworICAgICAgICAgICAgICAgICAgICBpZiAoYWN0dWFsSHRtbC5sZW5ndGggPiAwKSB7CisgICAgICAgICAgICAgICAgICAgICAgICB0cmF2ZXJzZShlbGVtKTsKKyAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIHdyYXBFbGVtZW50KGVsZW0pOworICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgfSk7CisgICAgICAgICAgICB9LCA1MCk7CisgICAgICAgIH0KKyAgICB9OworfV0pOworCithbmd1bGFyLm1vZHVsZSgnYXR0LmFicy50YWJsZU1lc3NhZ2VzJywgWydhdHQuYWJzLnV0aWxpdGllcyddKQorICAgIC5jb25zdGFudCgnbWVzc2FnZUNvbnN0YW50cycsIHsKKyAgICAgICAgICAgIFRBQkxFX01FU1NBR0VfVFlQRVM6IHsKKyAgICAgICAgICAgICAgICBub01hdGNoaW5nOiAxLAorICAgICAgICAgICAgICAgIGVycm9yTG9hZGluZzogMiwKKyAgICAgICAgICAgICAgICBtYWduaWZ5U2VhcmNoOiAzLAorICAgICAgICAgICAgICAgIGlzTG9hZGluZzogNH0sCisgICAgICAgIFVTRVJfTUVTU0FHRV9UWVBFUzogeworICAgICAgICAgICAgc3VjY2VzczogMSwKKyAgICAgICAgICAgIGVycm9yOiAwCisgICAgICAgICAgICB9CisgICAgICAgIH0pCisgICAgICAgIC5kaXJlY3RpdmUoJ2F0dFRhYmxlTWVzc2FnZScsIFsnbWVzc2FnZUNvbnN0YW50cycsIGZ1bmN0aW9uKG1lc3NhZ2VDb25zdGFudHMpIHsKKyAgICAgICAgICAgICAgICByZXR1cm4geworICAgICAgICAgICAgICAgICAgICByZXN0cmljdDogJ0FFJywKKyAgICAgICAgICAgICAgICAgICAgcmVwbGFjZTogdHJ1ZSwKKyAgICAgICAgICAgICAgICAgICAgdHJhbnNjbHVkZTogdHJ1ZSwKKyAgICAgICAgICAgICAgICAgICAgc2NvcGU6IHsKKyAgICAgICAgICAgICAgICAgICAgICAgIG1zZ1R5cGU6ICc9JywKKyAgICAgICAgICAgICAgICAgICAgICAgIG9uUmVmcmVzaENsaWNrOiAnJicKKyAgICAgICAgICAgICAgICAgICAgfSwKKyAgICAgICAgICAgICAgICAgICAgdGVtcGxhdGVVcmw6ICdhcHAvc2NyaXB0cy9uZ19qc19hdHRfdHBscy90YWJsZU1lc3NhZ2VzL2F0dFRhYmxlTWVzc2FnZS5odG1sJywKKyAgICAgICAgICAgICAgICAgICAgbGluazogZnVuY3Rpb24oc2NvcGUpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIHNjb3BlLm1lc3NhZ2VDb25zdGFudHMgPSBtZXNzYWdlQ29uc3RhbnRzOworICAgICAgICAgICAgICAgICAgICAgICAgc2NvcGUucmVmcmVzaEFjdGlvbiA9IGZ1bmN0aW9uKGV2dCkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNjb3BlLm9uUmVmcmVzaENsaWNrKGV2dCk7CisgICAgICAgICAgICAgICAgICAgICAgICB9OworICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgfTsKKyAgICAgICAgfV0pLmRpcmVjdGl2ZSgnYXR0VXNlck1lc3NhZ2UnLCBbJ21lc3NhZ2VDb25zdGFudHMnLCAnJHRpbWVvdXQnLCAnRE9NSGVscGVyJywgZnVuY3Rpb24obWVzc2FnZUNvbnN0YW50cywgJHRpbWVvdXQsIERPTUhlbHBlcikgeworICAgICAgICAgICAgcmV0dXJuIHsKKyAgICAgICAgICAgICAgICByZXN0cmljdDogJ0FFJywKKyAgICAgICAgICAgICAgICByZXBsYWNlOiB0cnVlLAorICAgICAgICAgICAgICAgIHRyYW5zY2x1ZGU6IHRydWUsCisgICAgICAgICAgICAgICAgc2NvcGU6IHsKKyAgICAgICAgICAgICAgICAgICAgdGhldGl0bGU6ICc9JywKKyAgICAgICAgICAgICAgICAgICAgdHlwZTogJz0nLAorICAgICAgICAgICAgICAgICAgICBtZXNzYWdlOiAnPScsCisgICAgICAgICAgICAgICAgICAgIHRyaWdnZXI6ICc9JworICAgICAgICAgICAgICAgIH0sCisgICAgICAgICAgICAgICAgdGVtcGxhdGVVcmw6ICdhcHAvc2NyaXB0cy9uZ19qc19hdHRfdHBscy90YWJsZU1lc3NhZ2VzL2F0dFVzZXJNZXNzYWdlLmh0bWwnLAorICAgICAgICAgICAgICAgIGxpbms6IGZ1bmN0aW9uKHNjb3BlLCBlbGVtZW50KSB7CisgICAgICAgICAgICAgICAgICAgIHZhciBwcmV2QWN0aXZlRWxlbWVudCA9IHVuZGVmaW5lZDsKKyAgICAgICAgICAgICAgICAgICAgdmFyIGZpcnN0RWxlbWVudCA9IHVuZGVmaW5lZDsKKyAgICAgICAgICAgICAgICAgICAgc2NvcGUubWVzc2FnZUNvbnN0YW50cyA9IG1lc3NhZ2VDb25zdGFudHM7CisKKyAgICAgICAgICAgICAgICAgICAgJHRpbWVvdXQoZnVuY3Rpb24oKSB7CisgICAgICAgICAgICAgICAgICAgICAgICBmaXJzdEVsZW1lbnQgPSBET01IZWxwZXIuZmlyc3RUYWJhYmxlRWxlbWVudChlbGVtZW50WzBdKTsKKyAgICAgICAgICAgICAgICAgICAgfSwgMTApOworCisgICAgICAgICAgICAgICAgICAgIAorICAgICAgICAgICAgICAgICAgICBzY29wZS4kd2F0Y2goJ3RyaWdnZXInLCBmdW5jdGlvbigpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIGlmIChzY29wZS50cmlnZ2VyKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgcHJldkFjdGl2ZUVsZW1lbnQgPSBkb2N1bWVudC5hY3RpdmVFbGVtZW50OworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChhbmd1bGFyLmlzRGVmaW5lZChmaXJzdEVsZW1lbnQpKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZpcnN0RWxlbWVudC5mb2N1cygpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGFuZ3VsYXIuaXNEZWZpbmVkKHByZXZBY3RpdmVFbGVtZW50KSkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwcmV2QWN0aXZlRWxlbWVudC5mb2N1cygpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgfSkKKworICAgICAgICAgICAgICAgICAgICAKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9OworICAgIH1dKTsKK2FuZ3VsYXIubW9kdWxlKCdhdHQuYWJzLnRhYnMnLCBbJ2F0dC5hYnMudXRpbGl0aWVzJ10pCisgICAgLmRpcmVjdGl2ZSgnYXR0VGFicycsIGZ1bmN0aW9uICgpIHsKKyAgICAgICAgcmV0dXJueworICAgICAgICAgICAgcmVzdHJpY3Q6ICdFQScsCisgICAgICAgICAgICB0cmFuc2NsdWRlOiBmYWxzZSwKKyAgICAgICAgICAgIHJlcGxhY2U6IHRydWUsCisgICAgICAgICAgICBzY29wZTogeworICAgICAgICAgICAgICAgIHRhYnM6ICI9dGl0bGUiCisgICAgICAgICAgICB9LAorICAgICAgICAgICAgY29udHJvbGxlcjogWyckc2NvcGUnLCBmdW5jdGlvbiAoJHNjb3BlKSB7CisgICAgICAgICAgICAgICAgdGhpcy5nZXREYXRhID0gZnVuY3Rpb24gKCkgeworICAgICAgICAgICAgICAgICAgICByZXR1cm4gJHNjb3BlLnRhYnM7CisgICAgICAgICAgICAgICAgfTsKKyAgICAgICAgICAgICAgICB0aGlzLm9uQ2xpY2tUYWIgPSBmdW5jdGlvbiAodGFiKSB7CisgICAgICAgICAgICAgICAgICAgICRzY29wZS5jdXJyZW50VGFiID0gdGFiLnVybDsKKyAgICAgICAgICAgICAgICAgICAgcmV0dXJuICRzY29wZS5jdXJyZW50VGFiOworICAgICAgICAgICAgICAgIH07CisgICAgICAgICAgICAgICAgdGhpcy5pc0FjdGl2ZVRhYiA9IGZ1bmN0aW9uICh0YWIpIHsKKyAgICAgICAgICAgICAgICAgICAgcmV0dXJuICh0YWIgPT09ICRzY29wZS5jdXJyZW50VGFiKTsKKyAgICAgICAgICAgICAgICB9OworICAgICAgICAgICAgfV0sCisgICAgICAgICAgICBsaW5rOiBmdW5jdGlvbiAoc2NvcGUpIHsKKyAgICAgICAgICAgICAgICBmb3IgKHZhciBpID0gMDsgaSA8IHNjb3BlLnRhYnMubGVuZ3RoOyBpKyspIHsKKyAgICAgICAgICAgICAgICAgICAgaWYgKChzY29wZS50YWJzW2ldLnNlbGVjdGVkKSAmJiAoc2NvcGUudGFic1tpXS51cmwpKSB7CisgICAgICAgICAgICAgICAgICAgICAgICBzY29wZS5jdXJyZW50VGFiID0gc2NvcGUudGFic1tpXS51cmw7CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9CisgICAgICAgIH07CisgICAgfSkKKyAgICAuZGlyZWN0aXZlKCdmbG9hdGluZ1RhYnMnLCBmdW5jdGlvbiAoKSB7CisgICAgICAgIHJldHVybiB7CisgICAgICAgICAgICByZXF1aXJlOiAnXmF0dFRhYnMnLAorICAgICAgICAgICAgcmVzdHJpY3Q6ICdFQScsCisgICAgICAgICAgICB0cmFuc2NsdWRlOiBmYWxzZSwKKyAgICAgICAgICAgIHJlcGxhY2U6IHRydWUsCisgICAgICAgICAgICBzY29wZTogeworICAgICAgICAgICAgICAgIHNpemU6ICJAIgorICAgICAgICAgICAgfSwKKyAgICAgICAgICAgIHRlbXBsYXRlVXJsOiAnYXBwL3NjcmlwdHMvbmdfanNfYXR0X3RwbHMvdGFicy9mbG9hdGluZ1RhYnMuaHRtbCcsCisgICAgICAgICAgICBsaW5rOiBmdW5jdGlvbiAoc2NvcGUsIGVsZW0sIGF0dHIsIGF0dFRhYnNDdHJsKSB7CisgICAgICAgICAgICAgICAgc2NvcGUudGFicyA9IGF0dFRhYnNDdHJsLmdldERhdGEoKTsKKyAgICAgICAgICAgICAgICBzY29wZS5vbkNsaWNrVGFiID0gYXR0VGFic0N0cmwub25DbGlja1RhYjsKKyAgICAgICAgICAgICAgICBzY29wZS5pc0FjdGl2ZVRhYiA9IGF0dFRhYnNDdHJsLmlzQWN0aXZlVGFiOworICAgICAgICAgICAgfQorICAgICAgICB9OworICAgIH0pCisgICAgLmRpcmVjdGl2ZSgnc2ltcGxpZmllZFRhYnMnLCBmdW5jdGlvbiAoKSB7CisgICAgICAgIHJldHVybiB7CisgICAgICAgICAgICByZXF1aXJlOiAnXmF0dFRhYnMnLAorICAgICAgICAgICAgcmVzdHJpY3Q6ICdFQScsCisgICAgICAgICAgICB0cmFuc2NsdWRlOiBmYWxzZSwKKyAgICAgICAgICAgIHJlcGxhY2U6IHRydWUsCisgICAgICAgICAgICBzY29wZTogeworICAgICAgICAgICAgICAgIGN0YWI6ICI9bmdNb2RlbCIKKyAgICAgICAgICAgIH0sCisgICAgICAgICAgICB0ZW1wbGF0ZVVybDogJ2FwcC9zY3JpcHRzL25nX2pzX2F0dF90cGxzL3RhYnMvc2ltcGxpZmllZFRhYnMuaHRtbCcsCisgICAgICAgICAgICBsaW5rOiBmdW5jdGlvbiAoc2NvcGUsIGVsZW0sIGF0dHIsIGF0dFRhYnNDdHJsKSB7CisgICAgICAgICAgICAgICAgc2NvcGUudGFicyA9IGF0dFRhYnNDdHJsLmdldERhdGEoKTsKKyAgICAgICAgICAgICAgICBzY29wZS5jbGlja1RhYiA9IGZ1bmN0aW9uICh0YWIpIHsKKyAgICAgICAgICAgICAgICAgICAgc2NvcGUuY3RhYiA9IHRhYi5pZDsKKyAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHNjb3BlLmN0YWI7CisgICAgICAgICAgICAgICAgfTsKKyAgICAgICAgICAgICAgICBzY29wZS5pc0FjdGl2ZSA9IGZ1bmN0aW9uICh0YWIpIHsKKyAgICAgICAgICAgICAgICAgICAgcmV0dXJuICh0YWIgPT09IHNjb3BlLmN0YWIpOworICAgICAgICAgICAgICAgIH07CisgICAgICAgICAgICB9CisgICAgICAgIH07CisgICAgfSkKKyAgICAuZGlyZWN0aXZlKCdnZW5lcmljVGFicycsIGZ1bmN0aW9uICgpIHsKKyAgICAgICAgcmV0dXJuIHsKKyAgICAgICAgICAgIHJlcXVpcmU6ICdeYXR0VGFicycsCisgICAgICAgICAgICByZXN0cmljdDogJ0VBJywKKyAgICAgICAgICAgIHRyYW5zY2x1ZGU6IGZhbHNlLAorICAgICAgICAgICAgcmVwbGFjZTogdHJ1ZSwKKyAgICAgICAgICAgIHNjb3BlOiB7CisgICAgICAgICAgICAgICAgY3RhYjogIj1uZ01vZGVsIgorICAgICAgICAgICAgfSwKKyAgICAgICAgICAgIHRlbXBsYXRlVXJsOiAnYXBwL3NjcmlwdHMvbmdfanNfYXR0X3RwbHMvdGFicy9nZW5lcmljVGFicy5odG1sJywKKyAgICAgICAgICAgIGxpbms6IGZ1bmN0aW9uIChzY29wZSwgZWxlbSwgYXR0ciwgYXR0VGFic0N0cmwpIHsKKyAgICAgICAgICAgICAgICBzY29wZS50YWJzID0gYXR0VGFic0N0cmwuZ2V0RGF0YSgpOworICAgICAgICAgICAgICAgIHNjb3BlLmNsaWNrVGFiID0gZnVuY3Rpb24gKHRhYikgeworICAgICAgICAgICAgICAgICAgICBzY29wZS5jdGFiID0gdGFiLmlkOworICAgICAgICAgICAgICAgICAgICByZXR1cm4gc2NvcGUuY3RhYjsKKyAgICAgICAgICAgICAgICB9OworICAgICAgICAgICAgICAgIHNjb3BlLmlzQWN0aXZlID0gZnVuY3Rpb24gKHRhYikgeworICAgICAgICAgICAgICAgICAgICByZXR1cm4gKHRhYiA9PT0gc2NvcGUuY3RhYik7CisgICAgICAgICAgICAgICAgfTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfTsKKyAgICB9KQorICAgIC5kaXJlY3RpdmUoJ3NraXBOYXZpZ2F0aW9uJywgZnVuY3Rpb24oKXsKKyAgICAgICAgcmV0dXJueworICAgICAgICAgICAgbGluazogZnVuY3Rpb24oc2NvcGUsZWxlbSxhdHRyKXsKKyAgICAgICAgICAgICAgICBlbGVtLmJpbmQoJ2NsaWNrJywgZnVuY3Rpb24oKXsKKyAgICAgICAgICAgICAgICAgICAgdmFyIHNraXB0b0JvZHkgPSBhbmd1bGFyLmVsZW1lbnQoZWxlbS5wYXJlbnQoKS5wYXJlbnQoKS5wYXJlbnQoKS5wYXJlbnQoKSlbMF0ucXVlcnlTZWxlY3RvcignYS5za2lwdG9Cb2R5Jyk7CisgICAgICAgICAgICAgICAgICAgIChhbmd1bGFyLmVsZW1lbnQoc2tpcHRvQm9keSkpLmF0dHIoJ3RhYmluZGV4JywtMSk7CisgICAgICAgICAgICAgICAgICAgIHNraXB0b0JvZHkuZm9jdXMoKTsKKyAgICAgICAgICAgICAgICB9KTsKKworICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgfSkKKyAgICAuZGlyZWN0aXZlKCdwYXJlbnRUYWInLCBbZnVuY3Rpb24gKCkgeworICAgICAgICByZXR1cm4geworICAgICAgICAgICAgcmVzdHJpY3Q6ICdFQScsCisgICAgICAgICAgICBzY29wZTogeworICAgICAgICAgICAgICAgIG1lbnVJdGVtczogJz0nLAorICAgICAgICAgICAgICAgIGFjdGl2ZVN1Yk1lbnU6ICc9JywKKyAgICAgICAgICAgICAgICBhY3RpdmVNZW51OiAnPScKKyAgICAgICAgICAgIH0sCisgICAgICAgICAgICBjb250cm9sbGVyOiBbJyRzY29wZScsIGZ1bmN0aW9uICgkc2NvcGUpIHsKKyAgICAgICAgICAgICAgICAkc2NvcGUubWVnYU1lbnUgPSAkc2NvcGUubWVudUl0ZW1zOworICAgICAgICAgICAgICAgICRzY29wZS5tZWdhTWVudVRhYjsKKyAgICAgICAgICAgICAgICAkc2NvcGUubWVnYU1lbnVIb3ZlclRhYjsKKyAgICAgICAgICAgICAgICB0aGlzLnNldE1lbnUgPSBmdW5jdGlvbiAoKSB7CisgICAgICAgICAgICAgICAgICAgICRzY29wZS5tZW51SXRlbXMgPSAkc2NvcGUubWVnYU1lbnU7CisgICAgICAgICAgICAgICAgICAgICRzY29wZS5hY3RpdmVTdWJNZW51LnNjcm9sbD1mYWxzZTsKKyAgICAgICAgICAgICAgICAgICAgZm9yICh2YXIgaSA9IDA7IGkgPCAkc2NvcGUubWVudUl0ZW1zLmxlbmd0aDsgaSsrKSB7CisgICAgICAgICAgICAgICAgICAgICAgICBpZiAoJHNjb3BlLm1lbnVJdGVtc1tpXS5hY3RpdmUpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAkc2NvcGUuYWN0aXZlTWVudSA9ICRzY29wZS5tZW51SXRlbXNbaV07CisgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgdGhpcy5zZXRTdWJNZW51U3RhdHVzKGZhbHNlKTsKKyAgICAgICAgICAgICAgICAgICAgJHNjb3BlLiRhcHBseSgpOworICAgICAgICAgICAgICAgIH07CisgICAgICAgICAgICAgICAgdGhpcy5zZXRBY3RpdmVNZW51ID0gZnVuY3Rpb24gKCkgeworICAgICAgICAgICAgICAgICAgICBpZiAoISgkc2NvcGUubWVnYU1lbnVUYWIgPT09IHVuZGVmaW5lZCB8fCAkc2NvcGUubWVnYU1lbnVUYWIgPT09IG51bGwpKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAkc2NvcGUubWVudUl0ZW1zID0gWyRzY29wZS5tZWdhTWVudVRhYl07CisgICAgICAgICAgICAgICAgICAgICAgICAkc2NvcGUubWVnYU1lbnVUYWIuc2Nyb2xsID0gdHJ1ZTsKKyAgICAgICAgICAgICAgICAgICAgICAgICRzY29wZS5hY3RpdmVNZW51ID0ge307CisgICAgICAgICAgICAgICAgICAgICAgICAkc2NvcGUuYWN0aXZlU3ViTWVudSA9ICRzY29wZS5tZWdhTWVudVRhYjsKKyAgICAgICAgICAgICAgICAgICAgICAgIHRoaXMuc2V0U3ViTWVudVN0YXR1cyh0cnVlKTsKKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICBlbHNleworICAgICAgICAgICAgICAgICAgICAgICAgZm9yKHZhciBpPTA7IGk8JHNjb3BlLm1lbnVJdGVtcy5sZW5ndGg7IGkrKyl7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgKCRzY29wZS5tZW51SXRlbXNbaV0uYWN0aXZlID0gZmFsc2UpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmKCRzY29wZS5tZW51SXRlbXNbaV0uc3ViSXRlbXMpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZvcih2YXIgaj0wOyBqPCRzY29wZS5tZW51SXRlbXNbaV0uc3ViSXRlbXMubGVuZ3RoOyBqKyspeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJHNjb3BlLm1lbnVJdGVtc1tpXS5zdWJJdGVtc1tqXS5hY3RpdmUgPSBmYWxzZTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfTsKKyAgICAgICAgICAgICAgICAgICAgICAgIH07CisgICAgICAgICAgICAgICAgICAgICAgICAkc2NvcGUubWVudUl0ZW1zPSRzY29wZS5tZWdhTWVudTsKKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAkc2NvcGUuJGFwcGx5KCk7CisgICAgICAgICAgICAgICAgfTsKKyAgICAgICAgICAgICAgICB2YXIgY2hlY2tTdWJNZW51U3RhdHVzID0gZmFsc2U7CisgICAgICAgICAgICAgICAgdGhpcy5zZXRTdWJNZW51U3RhdHVzID0gZnVuY3Rpb24gKHZhbHVlKSB7CisgICAgICAgICAgICAgICAgICAgIGNoZWNrU3ViTWVudVN0YXR1cyA9IHZhbHVlOworICAgICAgICAgICAgICAgIH07CisgICAgICAgICAgICAgICAgdGhpcy5nZXRTdWJNZW51U3RhdHVzID0gZnVuY3Rpb24gKCkgeworICAgICAgICAgICAgICAgICAgICByZXR1cm4gY2hlY2tTdWJNZW51U3RhdHVzOworICAgICAgICAgICAgICAgIH07CisgICAgICAgICAgICAgICAgdGhpcy5zZXRBY3RpdmVNZW51VGFiID0gZnVuY3Rpb24gKHRhYikgeworICAgICAgICAgICAgICAgICAgICAkc2NvcGUubWVnYU1lbnVUYWIgPSB0YWI7CisgICAgICAgICAgICAgICAgfTsKKyAgICAgICAgICAgICAgICB0aGlzLnNldEFjdGl2ZU1lbnVIb3ZlclRhYiA9IGZ1bmN0aW9uICh0YWIpIHsKKyAgICAgICAgICAgICAgICAgICAgJHNjb3BlLm1lZ2FNZW51SG92ZXJUYWIgPSB0YWI7CisgICAgICAgICAgICAgICAgfTsKKyAgICAgICAgICAgICAgICB0aGlzLnNldEFjdGl2ZVN1Yk1lbnVUYWIgPSBmdW5jdGlvbiAoKSB7CisgICAgICAgICAgICAgICAgICAgICRzY29wZS5tZWdhTWVudVRhYiA9ICRzY29wZS5tZWdhTWVudUhvdmVyVGFiOworICAgICAgICAgICAgICAgIH07CisgICAgICAgICAgICAgICAgdGhpcy5yZXNldE1lbnVUYWIgPSBmdW5jdGlvbiAoKSB7CisgICAgICAgICAgICAgICAgICAgICRzY29wZS5tZWdhTWVudVRhYiA9IHVuZGVmaW5lZDsKKyAgICAgICAgICAgICAgICB9OworICAgICAgICAgICAgICAgIHRoaXMuY2xlYXJTdWJNZW51ID0gZnVuY3Rpb24gKCkgeworICAgICAgICAgICAgICAgICAgICAvKiBDbGVhcnMgU3ViLXRlbXMgd2hlbiBmb2N1cyBzaGlmdHMgZnJvbSBTdWItbWVudSB0byBNZWdhIG1lbnUqLworICAgICAgICAgICAgICAgICAgICAkc2NvcGUuJGV2YWxBc3luYyhmdW5jdGlvbigpeworICAgICAgICAgICAgICAgICAgICAgICAgJHNjb3BlLm1lZ2FNZW51VGFiID0gdW5kZWZpbmVkOworICAgICAgICAgICAgICAgICAgICAgICAgJHNjb3BlLm1lZ2FNZW51SG92ZXJUYWIgPSB1bmRlZmluZWQ7CisgICAgICAgICAgICAgICAgICAgIH0pCisgICAgICAgICAgICAgICAgfTsKKyAgICAgICAgICAgIH1dCisgICAgICAgIH07CisgICAgfV0pCisgICAgLmRpcmVjdGl2ZSgncGFyZW50bWVudVRhYnMnLCBbZnVuY3Rpb24gKCkgeworICAgICAgICByZXR1cm4geworICAgICAgICAgICAgcmVzdHJpY3Q6ICdFQScsCisgICAgICAgICAgICB0cmFuc2NsdWRlOiB0cnVlLAorICAgICAgICAgICAgcmVwbGFjZTogdHJ1ZSwKKyAgICAgICAgICAgIHNjb3BlOiB7CisgICAgICAgICAgICAgICAgbWVnYU1lbnU6ICdAJywKKyAgICAgICAgICAgICAgICBtZW51SXRlbXM6ICc9JworICAgICAgICAgICAgfSwKKyAgICAgICAgICAgIGNvbnRyb2xsZXI6IFsnJHNjb3BlJywgZnVuY3Rpb24gKCRzY29wZSkgeworICAgICAgICAgICAgICAgIHRoaXMuZ2V0TWVudSA9IGZ1bmN0aW9uICgpIHsKKyAgICAgICAgICAgICAgICAgICAgcmV0dXJuICRzY29wZS5tZW51SXRlbXM7CisgICAgICAgICAgICAgICAgfTsKKyAgICAgICAgICAgICAgICB0aGlzLnNldE1lbnUgPSBmdW5jdGlvbiAobWVudUl0ZW0pIHsKKyAgICAgICAgICAgICAgICAgICAgJHNjb3BlLm1lbnVJdGVtcyA9IG1lbnVJdGVtOworICAgICAgICAgICAgICAgIH07CisgICAgICAgICAgICB9XSwKKyAgICAgICAgICAgIHRlbXBsYXRlVXJsOiAnYXBwL3NjcmlwdHMvbmdfanNfYXR0X3RwbHMvdGFicy9wYXJlbnRtZW51VGFiLmh0bWwnCisgICAgICAgIH07CisgICAgfV0pCisKKyAgICAuZGlyZWN0aXZlKCdtZW51VGFicycsIFsiJHdpbmRvdyIsICIkZG9jdW1lbnQiLCdldmVudHMnLCdrZXltYXAnLCBmdW5jdGlvbiAod2luLCAkZG9jdW1lbnQsIGV2ZW50cywga2V5bWFwKSB7CisgICAgICAgIHJldHVybiB7CisgICAgICAgICAgICByZXN0cmljdDogJ0VBJywKKyAgICAgICAgICAgIHRyYW5zY2x1ZGU6IHRydWUsCisgICAgICAgICAgICByZXBsYWNlOiB0cnVlLAorICAgICAgICAgICAgcmVxdWlyZTogWydeP3BhcmVudFRhYicsICdeP3BhcmVudG1lbnVUYWJzJ10sCisgICAgICAgICAgICBzY29wZTogeworICAgICAgICAgICAgICAgIGFjdGl2ZU1lbnU6ICI9IiwKKyAgICAgICAgICAgICAgICBtZW51SXRlbTogIj0iLAorICAgICAgICAgICAgICAgIHN1Yk1lbnU6ICJAIiwKKyAgICAgICAgICAgICAgICBzdWJJdGVtQWN0aXZlOiAiQCIsCisgICAgICAgICAgICAgICAgdGFiTmFtZTogIj0/IiwKKyAgICAgICAgICAgICAgICB0YWJVcmw6ICI9PyIKKyAgICAgICAgICAgIH0sCisgICAgICAgICAgICB0ZW1wbGF0ZVVybDogZnVuY3Rpb24gKGVsZW1lbnQsIGF0dHJzKSB7CisgICAgICAgICAgICAgICAgaWYgKGF0dHJzLm1lZ2FNZW51KSB7CisgICAgICAgICAgICAgICAgICAgIHJldHVybiAnYXBwL3NjcmlwdHMvbmdfanNfYXR0X3RwbHMvdGFicy9tZW51VGFiLmh0bWwnOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICBlbHNlIHsKKyAgICAgICAgICAgICAgICAgICAgcmV0dXJuICdhcHAvc2NyaXB0cy9uZ19qc19hdHRfdHBscy90YWJzL3N1Ym1lbnVUYWIuaHRtbCc7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfSwKKyAgICAgICAgICAgIGxpbms6IGZ1bmN0aW9uIChzY29wZSwgZWxlbSwgYXR0ciwgY3RybCkgeworICAgICAgICAgICAgICAgIHZhciBwYXJlbnRDdHJsID0gY3RybFswXTsKKyAgICAgICAgICAgICAgICB2YXIgcGFyZW50bWVudUN0cmwgPSBjdHJsWzFdOworICAgICAgICAgICAgICAgIHNjb3BlLmNsaWNrSW5hY3RpdmUgPSB0cnVlOworICAgICAgICAgICAgICAgIHNjb3BlLnNob3dIb3ZlckNoaWxkID0gZnVuY3Rpb24gKGUpIHsKKyAgICAgICAgICAgICAgICAgICAgc2NvcGUuY2xpY2tJbmFjdGl2ZSA9IGZhbHNlOworICAgICAgICAgICAgICAgICAgICBzY29wZS5ob3ZlckNoaWxkID0gY3RybFswXS5nZXRTdWJNZW51U3RhdHVzKCk7CisgICAgICAgICAgICAgICAgICAgIGlmIChlLnR5cGUgPT09ICJtb3VzZW92ZXIiICYmIGN0cmxbMF0uZ2V0U3ViTWVudVN0YXR1cygpKQorICAgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgICAgICAvL3Njb3BlLnNob3dDaGlsZHJlbihlKTsKKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAKKyAgICAgICAgICAgICAgICB9OworICAgICAgICAgICAgICAgIHNjb3BlLnNob3dDaGlsZHJlbiA9IGZ1bmN0aW9uIChlKSB7CisgICAgICAgICAgICAgICAgICAgIHNjb3BlLnBhcmVudE1lbnVJdGVtcyA9IHBhcmVudG1lbnVDdHJsLmdldE1lbnUoKTsKKyAgICAgICAgICAgICAgICAgICAgZm9yICh2YXIgaSA9IDA7IGkgPCBzY29wZS5wYXJlbnRNZW51SXRlbXMubGVuZ3RoOyBpKyspIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIHNjb3BlLnBhcmVudE1lbnVJdGVtc1tpXS5hY3RpdmUgPSBmYWxzZTsKKyAgICAgICAgICAgICAgICAgICAgICAgIGlmIChzY29wZS5wYXJlbnRNZW51SXRlbXNbaV0uc3ViSXRlbXMpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBmb3IgKHZhciBqID0gMDsgaiA8IHNjb3BlLnBhcmVudE1lbnVJdGVtc1tpXS5zdWJJdGVtcy5sZW5ndGg7IGorKykgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzY29wZS5wYXJlbnRNZW51SXRlbXNbaV0uc3ViSXRlbXNbal0uYWN0aXZlID0gZmFsc2U7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgc2NvcGUuY2xpY2tJbmFjdGl2ZSA9IHRydWU7CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgc2NvcGUubWVudUl0ZW0uYWN0aXZlID0gdHJ1ZTsKKyAgICAgICAgICAgICAgICAgICAgc2NvcGUuYWN0aXZlTWVudSA9IHNjb3BlLm1lbnVJdGVtOworICAgICAgICAgICAgICAgICAgICBlLnN0b3BQcm9wYWdhdGlvbigpOworICAgICAgICAgICAgICAgIH07CisgICAgICAgICAgICAgICAgc2NvcGUuJHdhdGNoKCJzdWJJdGVtQWN0aXZlIiwgZnVuY3Rpb24gKHZhbHVlKSB7CisgICAgICAgICAgICAgICAgICAgIGlmICh2YWx1ZSA9PT0gInRydWUiICYmIHNjb3BlLnN1Yk1lbnUgPT09ICd0cnVlJykgeworICAgICAgICAgICAgICAgICAgICAgICAgcGFyZW50Q3RybC5zZXRBY3RpdmVNZW51SG92ZXJUYWIoc2NvcGUubWVudUl0ZW0pOworICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgfSk7CisgICAgICAgICAgICAgICAgc2NvcGUuc2hvd01lbnVDbGljayA9IGZ1bmN0aW9uIChlKSB7CisgICAgICAgICAgICAgICAgICAgIHBhcmVudEN0cmwuc2V0QWN0aXZlTWVudVRhYihzY29wZS5tZW51SXRlbSk7CisgICAgICAgICAgICAgICAgICAgIGUuc3RvcFByb3BhZ2F0aW9uKCk7CisgICAgICAgICAgICAgICAgfTsKKyAgICAgICAgICAgICAgICBzY29wZS5zaG93U3ViTWVudUNsaWNrID0gZnVuY3Rpb24gKGUpIHsKKyAgICAgICAgICAgICAgICAgICAgcGFyZW50Q3RybC5zZXRBY3RpdmVTdWJNZW51VGFiKCk7CisgICAgICAgICAgICAgICAgICAgIGUuc3RvcFByb3BhZ2F0aW9uKCk7CisgICAgICAgICAgICAgICAgfTsKKyAgICAgICAgICAgICAgICBzY29wZS5yZXNldE1lbnUgPSBmdW5jdGlvbiAoZSkgeworICAgICAgICAgICAgICAgICAgICBwYXJlbnRDdHJsLnJlc2V0TWVudVRhYigpOworICAgICAgICAgICAgICAgICAgICBlLnN0b3BQcm9wYWdhdGlvbigpOworICAgICAgICAgICAgICAgIH07CisgICAgICAgICAgICAgICAgZnVuY3Rpb24gZGVib3VuY2UobWV0aG9kLCBkZWxheSkgeworICAgICAgICAgICAgICAgICAgICBjbGVhclRpbWVvdXQobWV0aG9kLl90SWQpOworICAgICAgICAgICAgICAgICAgICBtZXRob2QuX3RJZCA9IHNldFRpbWVvdXQoZnVuY3Rpb24gKCkgeworICAgICAgICAgICAgICAgICAgICAgICAgcGFyZW50Q3RybC5zZXRNZW51KCk7CisgICAgICAgICAgICAgICAgICAgIH0sIGRlbGF5KTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgZnVuY3Rpb24gZGVib3VuY2UxKG1ldGhvZCwgZGVsYXkpIHsKKyAgICAgICAgICAgICAgICAgICAgY2xlYXJUaW1lb3V0KG1ldGhvZC5fdElkKTsKKyAgICAgICAgICAgICAgICAgICAgbWV0aG9kLl90SWQgPSBzZXRUaW1lb3V0KGZ1bmN0aW9uICgpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIHBhcmVudEN0cmwuc2V0QWN0aXZlTWVudSgpOworICAgICAgICAgICAgICAgICAgICB9LCBkZWxheSk7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICRkb2N1bWVudC5iaW5kKCdzY3JvbGwnLCBmdW5jdGlvbiAoKSB7CisgICAgICAgICAgICAgICAgICAgIGlmICh3aW4ucGFnZVlPZmZzZXQgPT09IDApIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIGRlYm91bmNlKHBhcmVudEN0cmwuc2V0TWVudSwgMTAwKTsKKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICBlbHNlIGlmICh3aW4ucGFnZVlPZmZzZXQgPiAxICYmIHdpbi5wYWdlWU9mZnNldCA8IDE1MDApIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIGRlYm91bmNlMShwYXJlbnRDdHJsLnNldEFjdGl2ZU1lbnUsIDEwMCk7CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICB9KTsKKyAgICAgICAgICAgICAgICBlbGVtLmJpbmQoJ2tleWRvd24nLCBmdW5jdGlvbihldnQpeworICAgICAgICAgICAgICAgICAgICBpZiAoIShldnQua2V5Q29kZSkpeworICAgICAgICAgICAgICAgICAgICAgICAgZXZ0LmtleUNvZGUgPSBldnQud2hpY2g7CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgaWYoZXZ0LmtleUNvZGUgIT09IGtleW1hcC5LRVkuVEFCKXsKKyAgICAgICAgICAgICAgICAgICAgICAgIGV2ZW50cy5wcmV2ZW50RGVmYXVsdChldnQpOworICAgICAgICAgICAgICAgICAgICAgICAgZXZlbnRzLnN0b3BQcm9wYWdhdGlvbihldnQpOworICAgICAgICAgICAgICAgICAgICB9CisKKyAgICAgICAgICAgICAgICAgICAgc3dpdGNoIChldnQua2V5Q29kZSkgeworICAgICAgICAgICAgICAgICAgICAgICAgY2FzZSBrZXltYXAuS0VZLkVTQzoKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YXIgc2tpcHRvQm9keTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoIShlbGVtLmF0dHIoJ21lZ2EtbWVudScpKSkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoZWxlbS5hdHRyKCJzdWItbWVudSIpID09PSAidHJ1ZSIpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8qIGNvbmRpdGlvbiB0cnVlIHdoZW4gdXNlciBuYXZpZ2F0ZXMgdGhyb3VnaCBTdWItbWVudSovCisKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNraXB0b0JvZHkgPSBhbmd1bGFyLmVsZW1lbnQoZWxlbS5wYXJlbnQoKS5wYXJlbnQoKS5wYXJlbnQoKS5wYXJlbnQoKS5wYXJlbnQoKS5wYXJlbnQoKS5wYXJlbnQoKSlbMF0ucXVlcnlTZWxlY3RvcignYS5za2lwdG9Cb2R5Jyk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoYW5ndWxhci5lbGVtZW50KHNraXB0b0JvZHkpKS5hdHRyKCd0YWJpbmRleCcsLTEpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2tpcHRvQm9keS5mb2N1cygpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGVsc2UgaWYgKGVsZW0uYXR0cigic3ViLW1lbnUiKSA9PT0gdW5kZWZpbmVkKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBza2lwdG9Cb2R5ID0gYW5ndWxhci5lbGVtZW50KGVsZW0ucGFyZW50KCkucGFyZW50KCkucGFyZW50KCkucGFyZW50KCkucGFyZW50KCkucGFyZW50KCkucGFyZW50KCkucGFyZW50KCkucGFyZW50KCkucGFyZW50KCkpWzBdLnF1ZXJ5U2VsZWN0b3IoJ2Euc2tpcHRvQm9keScpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKGFuZ3VsYXIuZWxlbWVudChza2lwdG9Cb2R5KSkuYXR0cigndGFiaW5kZXgnLC0xKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNraXB0b0JvZHkuZm9jdXMoKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoZWxlbS5hdHRyKCJtZW51LWl0ZW0iKSA9PT0gIml0ZW0iKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvKiBXb3JrcyB3aGVuIHVzZXIgb24gTWVnYSBtZW51Ki8KKworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2tpcHRvQm9keSA9IGFuZ3VsYXIuZWxlbWVudChlbGVtLnBhcmVudCgpLnBhcmVudCgpLnBhcmVudCgpLnBhcmVudCgpKVswXS5xdWVyeVNlbGVjdG9yKCdhLnNraXB0b0JvZHknKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChhbmd1bGFyLmVsZW1lbnQoc2tpcHRvQm9keSkpLmF0dHIoJ3RhYmluZGV4JywtMSk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBza2lwdG9Cb2R5LmZvY3VzKCk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgICAgICAgICBjYXNlIGtleW1hcC5LRVkuUklHSFQ6CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKCEoZWxlbS5hdHRyKCdtZWdhLW1lbnUnKSkpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhciBlbCA9IGFuZ3VsYXIuZWxlbWVudChlbGVtKVswXTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGVsZW0uYXR0cigic3ViLW1lbnUiKSA9PT0gInRydWUiKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvKiBjb25kaXRpb24gdHJ1ZSB3aGVuIHVzZXIgbmF2aWdhdGVzIHRocm91Z2ggU3ViLW1lbnUqLworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYoZWwubmV4dEVsZW1lbnRTaWJsaW5nID09PSBudWxsKXsgYnJlYWs7fQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYoZWwubmV4dEVsZW1lbnRTaWJsaW5nKXsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBlbC5uZXh0RWxlbWVudFNpYmxpbmcucXVlcnlTZWxlY3RvcigiYSIpLmZvY3VzKCk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBlbHNleworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRveworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoZWwgJiYgZWwubmV4dFNpYmxpbmcpeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZWwgPSBlbC5uZXh0U2libGluZzsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBlbHNleworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9IHdoaWxlIChlbCAmJiBlbC50YWdOYW1lICE9PSAnTEknKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZihlbCl7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChlbC5xdWVyeVNlbGVjdG9yKCJhIikgPT0gbnVsbCl7fQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBlbHNleworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBlbC5xdWVyeVNlbGVjdG9yKCJhIikuZm9jdXMoKTt9CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGV2ZW50cy5wcmV2ZW50RGVmYXVsdChldnQpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGV2ZW50cy5zdG9wUHJvcGFnYXRpb24oZXZ0KTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBlbHNlIGlmIChlbGVtLmF0dHIoInN1Yi1tZW51IikgPT09IHVuZGVmaW5lZCkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYoZWwubmV4dEVsZW1lbnRTaWJsaW5nID09PSBudWxsKSBicmVhazsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmKGVsLm5leHRFbGVtZW50U2libGluZyl7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZWwubmV4dEVsZW1lbnRTaWJsaW5nLnF1ZXJ5U2VsZWN0b3IoImEiKS5mb2N1cygpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZWxzZXsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBkb3sKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGVsICYmIGVsLm5leHRTaWJsaW5nKXsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGVsID0gZWwubmV4dFNpYmxpbmc7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZWxzZXsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSB3aGlsZSAoZWwgJiYgZWwudGFnTmFtZSAhPT0gJ0xJJyk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYoZWwpeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoZWwucXVlcnlTZWxlY3RvcigiYSIpID09IG51bGwpe30KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZWxzZXsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZWwucXVlcnlTZWxlY3RvcigiYSIpLmZvY3VzKCk7fQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KKworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChlbGVtLmF0dHIoIm1lbnUtaXRlbSIpID09PSAiaXRlbSIpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8qIFdoZW4gdXNlciBuYXZpZ2F0ZXMgdGhyb3VnaCBvbiBNZWdhIG1lbnUqLworCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YXIgZWwgPSBhbmd1bGFyLmVsZW1lbnQoZWxlbSlbMF07CisKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZihlbC5uZXh0RWxlbWVudFNpYmxpbmcpeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZihlbC5uZXh0RWxlbWVudFNpYmxpbmcucXVlcnlTZWxlY3Rvcigic3BhbiIpID09IG51bGwpeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGVsc2UgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZWwubmV4dEVsZW1lbnRTaWJsaW5nLnF1ZXJ5U2VsZWN0b3IoInNwYW4iKS5mb2N1cygpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBlbHNleworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRveworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoZWwgJiYgZWwubmV4dFNpYmxpbmcpeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZWwgPSBlbC5uZXh0U2libGluZzsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBlbHNleworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9IHdoaWxlIChlbCAmJiBlbC50YWdOYW1lICE9PSAnTEknKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZihlbCl7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmKGVsLnF1ZXJ5U2VsZWN0b3IoInNwYW4iKSA9PT0gbnVsbCl7fQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBlbHNlIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGVsLnF1ZXJ5U2VsZWN0b3IoInNwYW4iKS5mb2N1cygpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGV2ZW50cy5wcmV2ZW50RGVmYXVsdChldnQpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGV2ZW50cy5zdG9wUHJvcGFnYXRpb24oZXZ0KTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICAgICAgICAgIGNhc2Uga2V5bWFwLktFWS5ET1dOOgorCisKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoZWxlbS5hdHRyKCdtZWdhLW1lbnUnKSkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvKiBXaGVuIHVzZXIgbmF2aWdhdGVzIGZyb20gdG9wIG1lbnUgdG8gU3ViLW1lbnUqLworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBhbmd1bGFyLmVsZW1lbnQoZWxlbSlbMF0ucXVlcnlTZWxlY3RvckFsbCgiLm1lZ2FtZW51X19pdGVtcyIpWzBdLnF1ZXJ5U2VsZWN0b3IoImEiKS5mb2N1cygpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBlbHNlIGlmKGVsZW0uYXR0cigic3ViLW1lbnUiKSA9PT0gdW5kZWZpbmVkKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgLypXaGVuIHVzZXIgbmF2aWdhdGVzIHdpdGhpbiBTdWIgSXRlbXMqLworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YXIgZWwgPSBkb2N1bWVudC5hY3RpdmVFbGVtZW50OworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZihlbC5uZXh0RWxlbWVudFNpYmxpbmcgPT09IG51bGwpIGJyZWFrOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYoZWwubmV4dEVsZW1lbnRTaWJsaW5nKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBlbC5uZXh0RWxlbWVudFNpYmxpbmcuZm9jdXMoKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfWVsc2V7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZG8geworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoZWwgJiYgZWwubmV4dFNpYmxpbmcpeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZWwgPSBlbC5uZXh0U2libGluZzsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBlbHNleworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9IHdoaWxlIChlbCAmJiBlbC50YWdOYW1lICE9PSAnQScpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmKGVsLmF0dHJpYnV0ZXMgIT09IG51bGwpeyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZWwuZm9jdXMoKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZXZlbnRzLnN0b3BQcm9wYWdhdGlvbihldnQpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQorCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgICAgIGVsc2UgaWYgKGVsZW0uYXR0cigic3ViLW1lbnUiKT09PSAidHJ1ZSIgKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8qIGNvbmRpdGlvbiB0cnVlIHdoZW4gdXNlciBuYXZpZ2F0ZXMgZnJvbSBzdWIgbWVudSB0byAgU3ViIEl0ZW0qLworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YXIgY2hpbGRJdGVtcyA9IGFuZ3VsYXIuZWxlbWVudChlbGVtKVswXS5xdWVyeVNlbGVjdG9yKCJzcGFuIikucXVlcnlTZWxlY3RvcignYScpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZihjaGlsZEl0ZW1zID09PSBudWxsKSBicmVhazsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY2hpbGRJdGVtcy5mb2N1cygpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKKworICAgICAgICAgICAgICAgICAgICAgICAgY2FzZSBrZXltYXAuS0VZLkxFRlQ6CisKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoIShlbGVtLmF0dHIoJ21lZ2EtbWVudScpKSkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YXIgZWwgPSBhbmd1bGFyLmVsZW1lbnQoZWxlbSlbMF07CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChlbGVtLmF0dHIoInN1Yi1tZW51IikgPT09ICJ0cnVlIikgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLyogY29uZGl0aW9uIHRydWUgd2hlbiB1c2VyIG5hdmlnYXRlcyB0aHJvdWdoIFN1Yi1tZW51Ki8KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmKGVsLnByZXZpb3VzRWxlbWVudFNpYmxpbmcgPT09IG51bGwpIGJyZWFrOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYoZWwucHJldmlvdXNFbGVtZW50U2libGluZyl7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZWwucHJldmlvdXNFbGVtZW50U2libGluZy5xdWVyeVNlbGVjdG9yKCJhIikuZm9jdXMoKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGVsc2V7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZG97CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChlbCAmJiBlbC5wcmV2aW91c1NpYmxpbmcpeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZWwgPSBlbC5wcmV2aW91c1NpYmxpbmc7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZWxzZXsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSB3aGlsZSAoZWwgJiYgZWwudGFnTmFtZSAhPT0gJ0xJJyk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYoZWwpeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoZWwucXVlcnlTZWxlY3RvcigiYSIpID09IG51bGwpe30KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZWxzZXsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZWwucXVlcnlTZWxlY3RvcigiYSIpLmZvY3VzKCk7fQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBldmVudHMucHJldmVudERlZmF1bHQoZXZ0KTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBldmVudHMuc3RvcFByb3BhZ2F0aW9uKGV2dCk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CisKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8qZWwucHJldmlvdXNFbGVtZW50U2libGluZy5xdWVyeVNlbGVjdG9yKCJzcGFuIikuZm9jdXMoKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGV2ZW50cy5zdG9wUHJvcGFnYXRpb24oZXZ0KTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOyovCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZWxzZSBpZiAoZWxlbS5hdHRyKCJzdWItbWVudSIpID09PSB1bmRlZmluZWQpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmKGVsLnByZXZpb3VzRWxlbWVudFNpYmxpbmcgPT09IG51bGwpIGJyZWFrOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYoZWwucHJldmlvdXNFbGVtZW50U2libGluZyl7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZWwucHJldmlvdXNFbGVtZW50U2libGluZy5xdWVyeVNlbGVjdG9yKCJhIikuZm9jdXMoKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGVsc2V7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZG97CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChlbCAmJiBlbC5wcmV2aW91c1NpYmxpbmcpeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZWwgPSBlbC5wcmV2aW91c1NpYmxpbmc7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZWxzZXsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSB3aGlsZSAoZWwgJiYgZWwudGFnTmFtZSAhPT0gJ0xJJyk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYoZWwpeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoZWwucXVlcnlTZWxlY3RvcigiYSIpID09IG51bGwpe30KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZWxzZXsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZWwucXVlcnlTZWxlY3RvcigiYSIpLmZvY3VzKCk7fQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoZWxlbS5hdHRyKCJtZW51LWl0ZW0iKSA9PT0gIml0ZW0iKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvKiBXb3JrcyB3aGVuIHVzZXIgb24gTWVnYSBtZW51Ki8KKworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFyIGVsID0gYW5ndWxhci5lbGVtZW50KGVsZW0pWzBdOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmKGVsLnByZXZpb3VzRWxlbWVudFNpYmxpbmcpeworCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmKGVsLnByZXZpb3VzRWxlbWVudFNpYmxpbmcucXVlcnlTZWxlY3Rvcigic3BhbiIpID09PSBudWxsKXsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBlbHNlIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGVsLnByZXZpb3VzRWxlbWVudFNpYmxpbmcucXVlcnlTZWxlY3Rvcigic3BhbiIpLmZvY3VzKCk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBlbHNleworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRveworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoZWwgJiYgZWwucHJldmlvdXNTaWJsaW5nKXsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGVsID0gZWwucHJldmlvdXNTaWJsaW5nOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGVsc2V7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0gd2hpbGUgKGVsICYmIGVsLnRhZ05hbWUgIT09ICdMSScpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmKGVsKXsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGVsLnF1ZXJ5U2VsZWN0b3IoInNwYW4iKSA9PT0gbnVsbCkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGVsc2UgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBlbC5xdWVyeVNlbGVjdG9yKCJzcGFuIikuZm9jdXMoKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBldmVudHMucHJldmVudERlZmF1bHQoZXZ0KTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBldmVudHMuc3RvcFByb3BhZ2F0aW9uKGV2dCk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgICAgICAgICBjYXNlIGtleW1hcC5LRVkuVVA6CisKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoZWxlbS5hdHRyKCJzdWItbWVudSIpID09PSAidHJ1ZSIpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFyIGVsID0gZG9jdW1lbnQuYWN0aXZlRWxlbWVudDsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFyIHBhcmVudF9tZW51ID0gYW5ndWxhci5lbGVtZW50KGVsZW0ucGFyZW50KCkucGFyZW50KCkucGFyZW50KCkucGFyZW50KCkpWzBdLnF1ZXJ5U2VsZWN0b3IoInNwYW4iKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcGFyZW50X21lbnUuZm9jdXMoKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcGFyZW50Q3RybC5jbGVhclN1Yk1lbnUoKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2NvcGUubWVudUl0ZW0uYWN0aXZlID0gZmFsc2U7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBlbHNlIGlmKGVsZW0uYXR0cigic3ViLW1lbnUiKSA9PT0gdW5kZWZpbmVkKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8qIGNvbmRpdGlvbiB0cnVlIHdoZW4gdXNlciBuYXZpZ2F0ZXMgd2l0aGluIFN1YiBJdGVtcyovCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhciBlbCA9IGRvY3VtZW50LmFjdGl2ZUVsZW1lbnQ7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhciBwYXJlbnRfbWVudSA9IGFuZ3VsYXIuZWxlbWVudChlbGVtLnBhcmVudCgpLnBhcmVudCgpLnBhcmVudCgpLnBhcmVudCgpKVswXS5xdWVyeVNlbGVjdG9yKCJhIik7ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYoZG9jdW1lbnQuYWN0aXZlRWxlbWVudCA9PT0gYW5ndWxhci5lbGVtZW50KGVsKS5wYXJlbnQoKS5wYXJlbnQoKVswXS5xdWVyeVNlbGVjdG9yQWxsKCdhJylbMF0peworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcGFyZW50X21lbnUuZm9jdXMoKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9OworCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmKGVsLnByZXZpb3VzRWxlbWVudFNpYmxpbmcpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhciBwcmV2X2EgPSAgZWwucHJldmlvdXNFbGVtZW50U2libGluZzsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChlbC5wcmV2aW91c0VsZW1lbnRTaWJsaW5nICE9IG51bGwpPyBlbC5wcmV2aW91c0VsZW1lbnRTaWJsaW5nLmZvY3VzKCk6IHBhcmVudF9tZW51LmZvY3VzKCk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1lbHNleworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZG97CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGVsICYmIGVsLnByZXZpb3VzU2libGluZyl7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGVsID0gZWwucHJldmlvdXNTaWJsaW5nOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBlbHNleworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9IHdoaWxlIChlbCAmJiBlbC50YWdOYW1lICE9PSAnQScpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYoZWwgJiYgKGVsLm5vZGVUeXBlICE9PSAzKSl7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZWwuZm9jdXMoKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGV2ZW50cy5wcmV2ZW50RGVmYXVsdChldnQpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZXZlbnRzLnN0b3BQcm9wYWdhdGlvbihldnQpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CisKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgZGVmYXVsdDoKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIH0pOworICAgICAgICAgICAgfQorICAgICAgICB9OworICAgIH1dKTsKKworYW5ndWxhci5tb2R1bGUoJ2F0dC5hYnMudGFnQmFkZ2VzJywgW10pCisgICAgICAgIC5kaXJlY3RpdmUoJ3RhZ0JhZGdlcycsIFsnJHBhcnNlJywgJyR0aW1lb3V0JywgZnVuY3Rpb24oJHBhcnNlLCAkdGltZW91dCkgeworICAgICAgICAgICAgICAgIHJldHVybiB7CisgICAgICAgICAgICAgICAgICAgIHJlc3RyaWN0OiAnRUEnLAorICAgICAgICAgICAgICAgICAgICByZXBsYWNlOiBmYWxzZSwKKyAgICAgICAgICAgICAgICAgICAgdHJhbnNjbHVkZTogdHJ1ZSwKKyAgICAgICAgICAgICAgICAgICAgdGVtcGxhdGVVcmw6ICdhcHAvc2NyaXB0cy9uZ19qc19hdHRfdHBscy90YWdCYWRnZXMvdGFnQmFkZ2VzLmh0bWwnLAorICAgICAgICAgICAgICAgICAgICBzY29wZTogeworICAgICAgICAgICAgICAgICAgICAgICAgc3R5bGVUeXBlOiAiQCIsCisgICAgICAgICAgICAgICAgICAgICAgICBvbkNsb3NlOiAiJiIKKyAgICAgICAgICAgICAgICAgICAgfSwKKyAgICAgICAgICAgICAgICAgICAgbGluazogZnVuY3Rpb24oc2NvcGUsIGVsZW0sIGF0dHIpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIHNjb3BlLmlzU21hbGwgPSBmYWxzZTsKKyAgICAgICAgICAgICAgICAgICAgICAgIHNjb3BlLmlzSWNvbiA9IGZhbHNlOworICAgICAgICAgICAgICAgICAgICAgICAgc2NvcGUuaXNDb2xvciA9IGZhbHNlOworICAgICAgICAgICAgICAgICAgICAgICAgc2NvcGUuZGlzcGxheSA9IHRydWU7CisgICAgICAgICAgICAgICAgICAgICAgICBzY29wZS5pc0Nsb3NhYmxlID0gZmFsc2U7CisgICAgICAgICAgICAgICAgICAgICAgICBzY29wZS5pc0hpZ2hsaWdodCA9IGZhbHNlOworICAgICAgICAgICAgICAgICAgICAgICAgc2NvcGUuY3VzdG9tQ29sb3IgPSBmYWxzZTsKKworICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGF0dHIuc21hbGwgPT09ICIiKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2NvcGUuaXNTbWFsbCA9IHRydWU7CisgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICBpZiAoc2NvcGUuc3R5bGVUeXBlID09PSAiaWNvbiIpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBzY29wZS5pc0ljb24gPSB0cnVlOworICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgZWxzZSBpZiAoc2NvcGUuc3R5bGVUeXBlID09PSAiY29sb3IiKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2NvcGUuaXNDb2xvciA9IHRydWU7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYoYXR0ci5jb2xvciAhPT0gdW5kZWZpbmVkICYmIGF0dHIuY29sb3IgIT09ICIiKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNjb3BlLmN1c3RvbUNvbG9yID0gdHJ1ZTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYXR0ci4kb2JzZXJ2ZSgiY29sb3IiLCBmdW5jdGlvbih2YWwpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNjb3BlLmJvcmRlcl90eXBlX2JvcmRlckNvbG9yID0gdmFsOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2NvcGUuYmFja2dyb3VuZF90eXBlX2JhY2tncm91bmRDb2xvciA9IHZhbDsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNjb3BlLmJhY2tncm91bmRfdHlwZV9ib3JkZXJDb2xvciA9IHZhbDsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgc2NvcGUuYWN0aXZlSGlnaGxpZ2h0ID0gZnVuY3Rpb24oc3RhdGUpeworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmKHNjb3BlLmN1c3RvbUNvbG9yKXsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYoc3RhdGUpeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2NvcGUuaXNIaWdobGlnaHQgPSB0cnVlOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGVsc2V7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzY29wZS5pc0hpZ2hsaWdodCA9IGZhbHNlOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgfTsKKyAgICAgICAgICAgICAgICAgICAgICAgIGlmIChhdHRyLmNsb3NhYmxlID09PSAiIikgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNjb3BlLmlzQ2xvc2FibGUgPSB0cnVlOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNjb3BlLmNsb3NlTWUgPSBmdW5jdGlvbigpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2NvcGUuZGlzcGxheSA9IGZhbHNlOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAkdGltZW91dChmdW5jdGlvbigpeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZWxlbS5hdHRyKCJ0YWJpbmRleCIsICIwIik7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBlbGVtWzBdLmZvY3VzKCk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBlbGVtLmJpbmQoJ2JsdXInLCBmdW5jdGlvbigpeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGVsZW0ucmVtb3ZlKCk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9KTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmKGF0dHJbJ29uQ2xvc2UnXSl7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzY29wZS5vbkNsb3NlID0gJHBhcnNlKHNjb3BlLm9uQ2xvc2UpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2NvcGUub25DbG9zZSgpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgfTsKKyAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIH07CisgICAgICAgICAgICB9XSk7Cithbmd1bGFyLm1vZHVsZSgnYXR0LmFicy50ZXh0T3ZlcmZsb3cnLCBbXSkKKyAgICAgICAgLmNvbnN0YW50KCd0ZXh0RGVmYXVsdE9wdGlvbnMnLCB7CisgICAgICAgICAgICB3aWR0aDogJzUwJScKKyAgICAgICAgfSkKKy5kaXJlY3RpdmUoJ2F0dFRleHRPdmVyZmxvdycsIFsndGV4dERlZmF1bHRPcHRpb25zJywnJGNvbXBpbGUnLGZ1bmN0aW9uKHRleHREZWZhdWx0T3B0aW9ucywkY29tcGlsZSkKK3sKKyAgICByZXR1cm4geworICAgICAgICByZXN0cmljdDogJ0EnLAorICAgICAgICBsaW5rOiBmdW5jdGlvbihzY29wZSwgZWxlbSwgYXR0cnMpCisgICAgICAgIHsKKyAgICAgICAgICAgIHZhciB0b29sdGlwVGV4dCA9IGVsZW0udGV4dCgpOworICAgICAgICAgICAgZWxlbS5hZGRDbGFzcygndGV4dC1lbGxpcHNpcycpOworICAgICAgICAgICAgYXR0cnMuJG9ic2VydmUoJ2F0dFRleHRPdmVyZmxvdycsIGZ1bmN0aW9uKHZhbCl7CisgICAgICAgICAgICAgICAgaWYodmFsKXsKKyAgICAgICAgICAgICAgICAgICAgZWxlbS5jc3MoeyJ3aWR0aCI6dmFsfSk7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIGVsc2V7CisgICAgICAgICAgICAgICAgICAgIGVsZW0uY3NzKHsid2lkdGgiOnRleHREZWZhdWx0T3B0aW9ucy53aWR0aH0pOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0pOworICAgICAgICAgICAgaWYoIShlbGVtLmF0dHIoJ3Rvb2x0aXAnKSkpeworICAgICAgICAgICAgICAgIGVsZW0uYXR0cigidG9vbHRpcCIsIHRvb2x0aXBUZXh0KTsKKyAgICAgICAgICAgICAgICBlbGVtLmF0dHIoInRvb2x0aXAtcGxhY2VtZW50IiwgJ2Fib3ZlJyk7CisgICAgICAgICAgICAgICAgdmFyIG5ld0VsZW0gPSAgYW5ndWxhci5lbGVtZW50KGVsZW0pOworICAgICAgICAgICAgICAgICRjb21waWxlKG5ld0VsZW0pKHNjb3BlKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgIH07Cit9XSk7CisKK2FuZ3VsYXIubW9kdWxlKCdhdHQuYWJzLnRvZ2dsZScsIFsnYW5ndWxhci1nZXN0dXJlcycsICdhdHQuYWJzLnBvc2l0aW9uJ10pCisgICAgICAgIC5kaXJlY3RpdmUoJ2F0dFRvZ2dsZVRlbXBsYXRlJywgWyckY29tcGlsZScsICckbG9nJywgJyRwb3NpdGlvbicsIGZ1bmN0aW9uICgkY29tcGlsZSwgJGxvZywgJHBvc2l0aW9uKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAgIHJldHVybnsKKyAgICAgICAgICAgICAgICAgICAgcmVzdHJpY3Q6ICdBJywKKyAgICAgICAgICAgICAgICAgICAgcmVxdWlyZTogJ25nTW9kZWwnLAorICAgICAgICAgICAgICAgICAgICB0cmFuc2NsdWRlOiB0cnVlLAorICAgICAgICAgICAgICAgICAgICBzY29wZTogeworICAgICAgICAgICAgICAgICAgICAgICAgbW9kZWxWYWw6ICI9bmdNb2RlbCIKKyAgICAgICAgICAgICAgICAgICAgfSwKKyAgICAgICAgICAgICAgICAgICAgdGVtcGxhdGVVcmw6ICdhcHAvc2NyaXB0cy9uZ19qc19hdHRfdHBscy90b2dnbGUvZGVtb1RvZ2dsZS5odG1sJywKKyAgICAgICAgICAgICAgICAgICAgbGluazogZnVuY3Rpb24gKHNjb3BlLCBlbGVtZW50LCBhdHRyKSB7CisgICAgICAgICAgICAgICAgICAgICAgICBzY29wZS5pbml0aWFsRHJhZ1Bvc2l0aW9uID0gMDsKKyAgICAgICAgICAgICAgICAgICAgICAgIHZhciBkcmFnU3RhdHVzID0gMDsKKyAgICAgICAgICAgICAgICAgICAgICAgIHZhciBzd2l0Y2hNb3ZlbWVudFBhdGggPSAoJHBvc2l0aW9uLm9mZnNldChlbGVtZW50LmNoaWxkcmVuKCkuZXEoMSkuY2hpbGRyZW4oKS5lcSgwKSkud2lkdGggLSAxKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIHZhciB1cGRhdGVNb2RlbFZhbCA9IGZ1bmN0aW9uICgpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoc2NvcGUuYXR0clZhbHVlID09PSBhdHRyLm5nVHJ1ZVZhbHVlIHx8IHNjb3BlLmF0dHJWYWx1ZSkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNjb3BlLm1vZGVsVmFsID0gZmFsc2U7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNjb3BlLm1vZGVsVmFsID0gdHJ1ZTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICB9OworICAgICAgICAgICAgICAgICAgICAgICAgc2NvcGUudXBkYXRlTW9kZWwgPSBmdW5jdGlvbiAoZW52KSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoZHJhZ1N0YXR1cyAhPT0gMSkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdXBkYXRlTW9kZWxWYWwoKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRyYWdTdGF0dXMgPSAwOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgICAgIGVudi5wcmV2ZW50RGVmYXVsdCgpOworICAgICAgICAgICAgICAgICAgICAgICAgfTsKKyAgICAgICAgICAgICAgICAgICAgICAgIHNjb3BlLmRyYWcgPSBmdW5jdGlvbiAoZSkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRyYWdTdGF0dXMgPSAxOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChlLnR5cGUgPT09ICdkcmFnc3RhcnQnKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNjb3BlLmluaXRpYWxEcmFnUG9zaXRpb24gPSAkcG9zaXRpb24ucG9zaXRpb24oZWxlbWVudC5jaGlsZHJlbigpLmVxKDEpKS5sZWZ0OworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBlbGVtZW50LmNoaWxkcmVuKCkuZXEoMSkuYWRkQ2xhc3MoJ2RyYWdnaW5nJyk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIGlmIChlLnR5cGUgPT09ICdkcmFnJykgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YXIgbGVmdCA9IE1hdGgubWluKDAsIE1hdGgubWF4KHNjb3BlLmluaXRpYWxEcmFnUG9zaXRpb24gKyBlLmdlc3R1cmUuZGVsdGFYLCAtc3dpdGNoTW92ZW1lbnRQYXRoKSk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGVsZW1lbnQuY2hpbGRyZW4oKS5lcSgxKS5jc3MoeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbGVmdDogbGVmdCArICdweCcKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIGlmIChlLnR5cGUgPT09ICdkcmFnZW5kJykgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YXIgaXNPbiA9ICRwb3NpdGlvbi5wb3NpdGlvbihlbGVtZW50LmNoaWxkcmVuKCkuZXEoMSkpLmxlZnQgPiAoc3dpdGNoTW92ZW1lbnRQYXRoICogLTEpIC8gMjsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZWxlbWVudC5jaGlsZHJlbigpLmVxKDEpLnJlbW92ZUNsYXNzKCdkcmFnZ2luZycpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBUd2Vlbk1heC50byhlbGVtZW50LmNoaWxkcmVuKCkuZXEoMSksIC4xLCB7bGVmdDogaXNPbiA/IDAgOiAoc3dpdGNoTW92ZW1lbnRQYXRoICogLTEpLCBlYXNlOiBQb3dlcjQuZWFzZU91dCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG9uQ29tcGxldGU6IGZ1bmN0aW9uICgpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBlbGVtZW50LmNoaWxkcmVuKCkuZXEoMSkuY3NzKHtsZWZ0OiAnJ30pOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfX0pOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoaXNPbiB8fCAoIWlzT24gJiYgZS5nZXN0dXJlLmRpcmVjdGlvbiA9PT0gImxlZnQiKSkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdXBkYXRlTW9kZWxWYWwoKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBkcmFnU3RhdHVzID0gMDsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CisKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gZmFsc2U7CisgICAgICAgICAgICAgICAgICAgICAgICB9OworCisgICAgICAgICAgICAgICAgICAgICAgICBzY29wZS5kaXJlY3RpdmVWYWx1ZSA9IGF0dHIuYXR0VG9nZ2xlVGVtcGxhdGU7CisgICAgICAgICAgICAgICAgICAgICAgICBzY29wZS5vbiA9IGF0dHIudHJ1ZVZhbHVlOworICAgICAgICAgICAgICAgICAgICAgICAgc2NvcGUub2ZmID0gYXR0ci5mYWxzZVZhbHVlOworICAgICAgICAgICAgICAgICAgICAgICAgdmFyIHN3aXRjaE1vdmVtZW50UGF0aFBpeGVscyA9ICgoc3dpdGNoTW92ZW1lbnRQYXRoKSAqIC0xKSArICdweCc7CisgICAgICAgICAgICAgICAgICAgICAgICBzY29wZS4kd2F0Y2goJ21vZGVsVmFsJywgZnVuY3Rpb24gKG5ld1ZhbCkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNjb3BlLmF0dHJWYWx1ZSA9IG5ld1ZhbDsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAobmV3VmFsID09PSBhdHRyLm5nVHJ1ZVZhbHVlIHx8IG5ld1ZhbCkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBlbGVtZW50LmNoaWxkcmVuKCkuZXEoMSkuY3NzKHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxlZnQ6ICcwcHgnCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0pOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBlbGVtZW50LmFkZENsYXNzKCdhdHQtY2hlY2tib3gtLW9uJyk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhciBlbGVtID0gZWxlbWVudC5maW5kKCdkaXYnKS5maW5kKCdkaXYnKS5lcSgxKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZWxlbS5hdHRyKCJhcmlhLWNoZWNrZWQiLCB0cnVlKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZHJhZ1N0YXR1cyA9IDA7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZWxlbWVudC5jaGlsZHJlbigpLmVxKDEpLmNzcyh7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBsZWZ0OiBzd2l0Y2hNb3ZlbWVudFBhdGhQaXhlbHMKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGVsZW1lbnQucmVtb3ZlQ2xhc3MoJ2F0dC1jaGVja2JveC0tb24nKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhciBlbGVtID0gZWxlbWVudC5maW5kKCdkaXYnKS5maW5kKCdkaXYnKS5lcSgxKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZWxlbS5hdHRyKCJhcmlhLWNoZWNrZWQiLCBmYWxzZSk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRyYWdTdGF0dXMgPSAwOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBlbGVtZW50LmNoaWxkcmVuKCkuZXEoMSkuY3NzKHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbGVmdDogJycKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB9KTsKKyAgICAgICAgICAgICAgICAgICAgICAgIH0pOworICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgfTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgXSkKKworICAgICAgICAuZGlyZWN0aXZlKCdhdHRUb2dnbGVNYWluJywgWyckY29tcGlsZScsIGZ1bmN0aW9uICgkY29tcGlsZSkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICByZXR1cm57CisgICAgICAgICAgICAgICAgICAgIHJlc3RyaWN0OiAnQScsCisgICAgICAgICAgICAgICAgICAgIHJlcXVpcmU6ICduZ01vZGVsJywKKyAgICAgICAgICAgICAgICAgICAgdHJhbnNjbHVkZTogdHJ1ZSwKKyAgICAgICAgICAgICAgICAgICAgcmVwbGFjZTogdHJ1ZSwKKyAgICAgICAgICAgICAgICAgICAgc2NvcGU6IHsKKyAgICAgICAgICAgICAgICAgICAgICAgIG1vZGVsVmFsdWU6ICI9bmdNb2RlbCIsCisgICAgICAgICAgICAgICAgICAgICAgICB0cnVlVmFsdWU6ICI9bmdUcnVlVmFsdWUiLAorICAgICAgICAgICAgICAgICAgICAgICAgZmFsc2VWYWx1ZTogIj1uZ0ZhbHNlVmFsdWUiCisgICAgICAgICAgICAgICAgICAgIH0sCisgICAgICAgICAgICAgICAgICAgIGxpbms6IGZ1bmN0aW9uIChzY29wZSwgZWxlbWVudCwgYXR0cikgeworICAgICAgICAgICAgICAgICAgICAgICAgdmFyIGh0bWwgPSAiIjsKKyAgICAgICAgICAgICAgICAgICAgICAgIHZhciBhdHRyVmFsID0gIiI7CisgICAgICAgICAgICAgICAgICAgICAgICBlbGVtZW50LnJlbW92ZUF0dHIoJ2F0dC10b2dnbGUtbWFpbicpOworICAgICAgICAgICAgICAgICAgICAgICAgc2NvcGUub24gPSBhdHRyLm5nVHJ1ZVZhbHVlOworICAgICAgICAgICAgICAgICAgICAgICAgc2NvcGUub2ZmID0gYXR0ci5uZ0ZhbHNlVmFsdWU7CisgICAgICAgICAgICAgICAgICAgICAgICBzY29wZS5sYXJnZVZhbHVlID0gYXR0ci5hdHRUb2dnbGVNYWluOworICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGFuZ3VsYXIuaXNEZWZpbmVkKGF0dHIubmdUcnVlVmFsdWUpKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgaHRtbCArPSAnIHRydWUtdmFsdWU9Int7b259fSIgZmFsc2UtdmFsdWU9Int7b2ZmfX0iJzsKKyAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgIGlmIChzY29wZS5sYXJnZVZhbHVlICE9PSB1bmRlZmluZWQpCisgICAgICAgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgYXR0clZhbCArPSAnID0ie3tsYXJnZVZhbHVlfX0iJzsKKyAgICAgICAgICAgICAgICAgICAgICAgIH0KKworICAgICAgICAgICAgICAgICAgICAgICAgZWxlbWVudC5jc3Moe2Rpc3BsYXk6ICdub25lJ30pOworICAgICAgICAgICAgICAgICAgICAgICAgdmFyIGVsbSA9IGFuZ3VsYXIuZWxlbWVudCgnPGRpdiBjbGFzcz0iYXR0LXN3aXRjaCBhdHQtc3dpdGNoLWFsdCIgbmctY2xhc3M9IntcJ2xhcmdlXCcgOiBsYXJnZVZhbHVlID09IFwnbGFyZ2VcJ30iIG5nLW1vZGVsPSJtb2RlbFZhbHVlIicgKyBodG1sICsgJyBhdHQtdG9nZ2xlLXRlbXBsYXRlJyArIGF0dHJWYWwgKyAnPicgKyBlbGVtZW50LnByb3AoJ291dGVySFRNTCcpICsgJzwvZGl2PicpOworICAgICAgICAgICAgICAgICAgICAgICAgZWxtID0gJGNvbXBpbGUoZWxtKShzY29wZSk7CisgICAgICAgICAgICAgICAgICAgICAgICBlbGVtZW50LnJlcGxhY2VXaXRoKGVsbSk7CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICB9OworICAgICAgICAgICAgfV0pOworYW5ndWxhci5tb2R1bGUoJ2F0dC5hYnMudHJlZXZpZXcnLCBbXSkKKyAgICAgICAgLmRpcmVjdGl2ZSgndHJlZVZpZXcnLCBmdW5jdGlvbigpIHsKKyAgICAgICAgICAgIHJldHVybnsKKyAgICAgICAgICAgICAgICByZXN0cmljdDogJ0EnLAorICAgICAgICAgICAgICAgIGxpbms6IGZ1bmN0aW9uKHNjb3BlLCBlbGVtKSB7CisgICAgICAgICAgICAgICAgICAgIHZhciBlbCA9IGVsZW0uY2hpbGRyZW4oJ3VsIGxpJyk7CisgICAgICAgICAgICAgICAgICAgIHZhciBsaXN0ID0gVHdlZW5NYXguZnJvbShlbCwgLjIsIHtkaXNwbGF5OiAnbm9uZScsIHBhdXNlZDogdHJ1ZSwgcmV2ZXJzZWQ6IHRydWV9KTsKKyAgICAgICAgICAgICAgICAgICAgZWxlbS5hdHRyKCJ0YWJpbmRleCIsIjAiKTsKKyAgICAgICAgICAgICAgICAgICAgZnVuY3Rpb24gdG9nZ2xlQnJhbmNoKCkgeworICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGxpc3QucmV2ZXJzZWQoKSkKKyAgICAgICAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBsaXN0LnBsYXkoKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZQorICAgICAgICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxpc3QucmV2ZXJzZSgpOworICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICB9OworICAgICAgICAgICAgICAgICAgICBmdW5jdGlvbiB0b2dnbGVUcmVlKGUpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIGUuc3RvcFByb3BhZ2F0aW9uKCk7CisgICAgICAgICAgICAgICAgICAgICAgICBpZiAoYW5ndWxhci5lbGVtZW50KGUudGFyZ2V0KS5hdHRyKCJ0cmVlLXZpZXciKSAhPT0gdW5kZWZpbmVkKQorICAgICAgICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChlbGVtLmhhc0NsYXNzKCdtaW51cycpKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZWxlbS5yZW1vdmVDbGFzcygnbWludXMnKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgZWxzZQorICAgICAgICAgICAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZWxlbS5hZGRDbGFzcygnbWludXMnKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgdG9nZ2xlQnJhbmNoKCk7CisgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgZWxlbS5vbignY2xpY2snLCBmdW5jdGlvbihlKSB7CisgICAgICAgICAgICAgICAgICAgICAgICB0b2dnbGVUcmVlKGUpOworICAgICAgICAgICAgICAgICAgICB9KTsKKyAgICAgICAgICAgICAgICAgICAgZWxlbS5vbigna2V5cHJlc3MnLCBmdW5jdGlvbiAoZSkgeworICAgICAgICAgICAgICAgICAgICAgICAgdmFyIGFjdGl2ZUNvZGUgPSBlLmtleUNvZGUgPyBlLmtleUNvZGUgOiBlLmNoYXJDb2RlOworICAgICAgICAgICAgICAgICAgICAgICAgdmFyIGtleUNvZGUgPSBbMTMsMzJdOworICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGtleUNvZGUubGVuZ3RoID4gMCAmJiAoKGFjdGl2ZUNvZGUgJiYga2V5Q29kZS5pbmRleE9mKGFjdGl2ZUNvZGUpID4gLTEpKSkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRvZ2dsZVRyZWUoZSk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgZS5wcmV2ZW50RGVmYXVsdCgpOworICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICB9KTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9OworICAgICAgICB9KTsKKworYW5ndWxhci5tb2R1bGUoJ2F0dC5hYnMudHlwZUFoZWFkJywgWydhdHQuYWJzLnRhZ0JhZGdlcyddKQorCisgICAgICAgIC5kaXJlY3RpdmUoJ2ZvY3VzTWUnLFsnJHRpbWVvdXQnLCAnJHBhcnNlJywgZnVuY3Rpb24oJHRpbWVvdXQsICRwYXJzZSkgeworICAgICAgICAgICAgcmV0dXJuIHsKKyAgICAgICAgICAgICAgICBsaW5rOiBmdW5jdGlvbihzY29wZSwgZWxlbWVudCwgYXR0cnMpIHsKKyAgICAgICAgICAgICAgICAgICAgdmFyIG1vZGVsID0gJHBhcnNlKGF0dHJzLmZvY3VzTWUpOworICAgICAgICAgICAgICAgICAgICBzY29wZS4kd2F0Y2gobW9kZWwsIGZ1bmN0aW9uKHZhbHVlKSB7CisgICAgICAgICAgICAgICAgICAgICAgICBpZiAodmFsdWUpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAkdGltZW91dChmdW5jdGlvbigpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZWxlbWVudFswXS5mb2N1cygpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzY29wZS5pbnB1dEFjdGl2ZT10cnVlOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0pOworICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICB9KTsKKyAgICAgICAgICAgICAgICAgICAgZWxlbWVudC5iaW5kKCdibHVyJywgZnVuY3Rpb24oKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgbW9kZWwuYXNzaWduKHNjb3BlLCBmYWxzZSk7CisgICAgICAgICAgICAgICAgICAgICAgICAgc2NvcGUuaW5wdXRBY3RpdmU9ZmFsc2U7CisgICAgICAgICAgICAgICAgICAgICAgICAgc2NvcGUuJGRpZ2VzdCgpOworICAgICAgICAgICAgICAgICAgICAgfSk7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfTsKKyAgICAgICAgfV0pCisKKyAgICAgICAgLmRpcmVjdGl2ZSgndHlwZUFoZWFkJywgWyckdGltZW91dCcsJyRsb2cnLCBmdW5jdGlvbigkdGltZW91dCwkbG9nKSB7CisgICAgICAgICAgICAgICAgcmV0dXJuIHsKKyAgICAgICAgICAgICAgICAgICAgcmVzdHJpY3Q6ICdFQScsCisgICAgICAgICAgICAgICAgICAgIHRlbXBsYXRlVXJsOiAnYXBwL3NjcmlwdHMvbmdfanNfYXR0X3RwbHMvdHlwZUFoZWFkL3R5cGVBaGVhZC5odG1sJywKKyAgICAgICAgICAgICAgICAgICAgcmVwbGFjZTogdHJ1ZSwKKyAgICAgICAgICAgICAgICAgICAgc2NvcGU6IHsKKyAgICAgICAgICAgICAgICAgICAgICAgIGl0ZW1zOiAnPScsCisgICAgICAgICAgICAgICAgICAgICAgICB0aXRsZTogJ0A/JywKKyAgICAgICAgICAgICAgICAgICAgICAgIHRpdGxlTmFtZTogJ0AnLAorICAgICAgICAgICAgICAgICAgICAgICAgc3VidGl0bGU6ICdAJywKKyAgICAgICAgICAgICAgICAgICAgICAgIG1vZGVsOiAnPScsCisgICAgICAgICAgICAgICAgICAgICAgICBlbWFpbElkTGlzdDonPScsCisgICAgICAgICAgICAgICAgICAgICAgICBlbWFpbE1lc3NhZ2U6Jz0nCisgICAgICAgICAgICAgICAgICAgIH0sCisgICAgICAgICAgICAgICAgICAgIGxpbms6IGZ1bmN0aW9uKHNjb3BlLCBlbGVtKSB7CisgICAgICAgICAgICAgICAgICAgICAgICBpZighYW5ndWxhci5pc0RlZmluZWQoc2NvcGUudGl0bGVOYW1lKSAmJiBhbmd1bGFyLmlzRGVmaW5lZChzY29wZS50aXRsZSkpeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAkdGltZW91dChmdW5jdGlvbigpeworICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNjb3BlLnRpdGxlTmFtZSA9IHNjb3BlLnRpdGxlOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICRsb2cud2FybigidGl0bGUgYXR0cmlidXRlIGlzIGRlcHJlY2F0ZWQgYW5kIHRpdGxlLW5hbWUgYXR0cmlidXRlIGlzIHVzZWQgaW5zdGVhZCBhcyBpdCBpcyBjb25mbGljdGluZyB3aXRoIGh0bWwgdGl0bGUgYXR0cmlidXRlIik7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0pOworICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgc2NvcGUubGluZUl0ZW1zID0gW107CisgICAgICAgICAgICAgICAgICAgICAgICBzY29wZS5maWx0ZXJlZExpc3RMZW5ndGggPSAtMTsKKyAgICAgICAgICAgICAgICAgICAgICAgIHNjb3BlLmZpbHRlcmVkTGlzdCA9IFtdOworICAgICAgICAgICAgICAgICAgICAgICAgc2NvcGUuc2V0Rm9jdXMgPSBmdW5jdGlvbigpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIHNjb3BlLmNsaWNrRm9jdXMgPSB0cnVlOworICAgICAgICAgICAgICAgICAgICAgICAgfTsKKyAgICAgICAgICAgICAgICAgICAgICAgIHNjb3BlLnNldEZvY3VzKCk7CisgICAgICAgICAgICAgICAgICAgICAgICBzY29wZS5oYW5kbGVTZWxlY3Rpb24gPSBmdW5jdGlvbihzZWxlY3RlZEl0ZW0sZW1haWxJdGVtKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2NvcGUubGluZUl0ZW1zLnB1c2goc2VsZWN0ZWRJdGVtKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBzY29wZS5lbWFpbElkTGlzdC5wdXNoKGVtYWlsSXRlbSk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2NvcGUubW9kZWwgPSAiIjsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBzY29wZS5jdXJyZW50ID0gMDsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBzY29wZS5zZWxlY3RlZCA9IHRydWU7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2NvcGUuY2xpY2tGb2N1cyA9IHRydWU7CisgICAgICAgICAgICAgICAgICAgICAgICB9OworICAgICAgICAgICAgICAgICAgICAgICAgc2NvcGUudGhlTWV0aG9kVG9CZUNhbGxlZCA9IGZ1bmN0aW9uKGluZGV4KSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFyIHRlbXBBcnIgPSBzY29wZS5saW5lSXRlbXMuc2xpY2UoKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBzY29wZS5lbWFpbElkTGlzdC5zcGxpY2UoaW5kZXgsIDEpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRlbXBBcnIuc3BsaWNlKGluZGV4LCAxKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAkdGltZW91dChmdW5jdGlvbigpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2NvcGUubGluZUl0ZW1zID0gW107CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNjb3BlLiRhcHBseSgpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzY29wZS5saW5lSXRlbXMgPSBzY29wZS5saW5lSXRlbXMuY29uY2F0KHRlbXBBcnIpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0pOworICAgICAgICAgICAgICAgICAgICAgICAgfTsKKworICAgICAgICAgICAgICAgICAgICAgICAgc2NvcGUuY3VycmVudCA9IDA7CisgICAgICAgICAgICAgICAgICAgICAgICBzY29wZS5zZWxlY3RlZCA9IHRydWU7CisKKyAgICAgICAgICAgICAgICAgICAgICAgIHNjb3BlLmlzQ3VycmVudCA9IGZ1bmN0aW9uKGluZGV4LCBpdGVtTmFtZSxpdGVtRW1haWwsZHJvcGRvd25MZW5ndGgpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoc2NvcGUuY3VycmVudCA9PT0gaW5kZXgpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2NvcGUuaXRlbU5hbWUgPSBpdGVtTmFtZTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2NvcGUuaXRlbUVtYWlsID0gaXRlbUVtYWlsOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBzY29wZS5kcm9wZG93bkxlbmd0aD1kcm9wZG93bkxlbmd0aDsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gc2NvcGUuY3VycmVudCA9PT0gaW5kZXg7CisgICAgICAgICAgICAgICAgICAgICAgICB9OworCisgICAgICAgICAgICAgICAgICAgICAgICBzY29wZS5zZXRDdXJyZW50ID0gZnVuY3Rpb24oaW5kZXgpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBzY29wZS5jdXJyZW50ID0gaW5kZXg7CisgICAgICAgICAgICAgICAgICAgICAgICB9OworCisgICAgICAgICAgICAgICAgICAgICAgICBzY29wZS5zZWxlY3Rpb25JbmRleCA9IGZ1bmN0aW9uKGV2dCkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChldnQua2V5Q29kZSA9PT0gMzggJiYgc2NvcGUuY3VycmVudCA+IDApIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBldnQucHJldmVudERlZmF1bHQoKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2NvcGUuY3VycmVudCA9IHNjb3BlLmN1cnJlbnQgLSAxOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzY29wZS5pc0N1cnJlbnQoc2NvcGUuY3VycmVudCk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIGlmIChldnQua2V5Q29kZSA9PT0gOSkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzY29wZS5zZWxlY3RlZCA9IHRydWU7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIGlmIChldnQua2V5Q29kZSA9PT0gMTMgJiYgc2NvcGUuZHJvcGRvd25MZW5ndGghPT1zY29wZS5pdGVtcy5sZW5ndGgpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2NvcGUuaGFuZGxlU2VsZWN0aW9uKHNjb3BlLml0ZW1OYW1lLHNjb3BlLml0ZW1FbWFpbCk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIGlmICgoZXZ0LmtleUNvZGUgPT09IDggJiYgc2NvcGUubW9kZWwubGVuZ3RoID09PSAwKSB8fCBldnQua2V5Q29kZSA9PT0gNDYpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2NvcGUudGhlTWV0aG9kVG9CZUNhbGxlZChzY29wZS5saW5lSXRlbXMubGVuZ3RoIC0gMSk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIGlmIChldnQua2V5Q29kZSA9PT0gNDAgJiYgc2NvcGUuY3VycmVudCA8IHNjb3BlLmRyb3Bkb3duTGVuZ3RoLTEpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZXZ0LnByZXZlbnREZWZhdWx0KCk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNjb3BlLmN1cnJlbnQgPSBzY29wZS5jdXJyZW50ICsgMTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2NvcGUuaXNDdXJyZW50KHNjb3BlLmN1cnJlbnQpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBlbGVtWzBdLnF1ZXJ5U2VsZWN0b3IoJy5saXN0LXNjcm9sbGFibGUnKS5zY3JvbGxUb3AgPSAoc2NvcGUuY3VycmVudCAtIDEpICogMzU7CisgICAgICAgICAgICAgICAgICAgICAgICB9OworICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgfTsKKyAgICAgICAgICAgIH1dKTsKK2FuZ3VsYXIubW9kdWxlKCdhdHQuYWJzLnZlcnRpY2FsU3RlcHRyYWNrZXInLCBbJ25nU2FuaXRpemUnXSkKKyAgICAuZGlyZWN0aXZlKCd2ZXJ0aWNhbFN0ZXB0cmFja2VyJywgWyBmdW5jdGlvbigpeworICAgICAgICByZXR1cm4geworICAgICAgICAgICAgcmVzdHJpY3Q6ICdFQScsCisgICAgICAgICAgICB0cmFuc2NsdWRlOiB0cnVlLAorICAgICAgICAgICAgcmVwbGFjZTogZmFsc2UsCisgICAgICAgICAgICBzY29wZToge30sCisgICAgICAgICAgICB0ZW1wbGF0ZTogJzxkaXYgY2xhc3M9InZlcnRpY2FsLW5hdiI+PHVsIG5nLXRyYW5zY2x1ZGUgYXJpYWwtbGFiZWw9InN0ZXAgbGlzdCIgcm9sZT0icHJlc2VudGF0aW9uIiBjbGFzcz0idGlja2V0cy1saXN0LWhlaWdodCI+PC91bD48L2Rpdj4nLAorICAgICAgICAgICAgbGluazogZnVuY3Rpb24gKCkge30KKyAgICAgICAgfTsKKyAgICB9XSkKKyAgICAuZGlyZWN0aXZlKCd2ZXJ0aWNhbFN0ZXB0cmFja2VyU3RlcCcsWyBmdW5jdGlvbigpeworICAgICAgICByZXR1cm4geworICAgICAgICAgICAgcmVzdHJpY3Q6ICdFQScsCisgICAgICAgICAgICB0cmFuc2NsdWRlOiB0cnVlLAorICAgICAgICAgICAgcmVwbGFjZTogZmFsc2UsCisgICAgICAgICAgICBzY29wZTogeworICAgICAgICAgICAgICAgIHR5cGU6ICI9dHlwZSIsCisgICAgICAgICAgICAgICAgaWQ6ICI9aWQiCisgICAgICAgICAgICB9LAorICAgICAgICAgICAgdGVtcGxhdGVVcmw6ICdhcHAvc2NyaXB0cy9uZ19qc19hdHRfdHBscy92ZXJ0aWNhbFN0ZXB0cmFja2VyL3ZlcnRpY2FsLXN0ZXAtdHJhY2tlci5odG1sJywKKyAgICAgICAgICAgIGxpbms6IGZ1bmN0aW9uKCl7fQorICAgICAgICAgfTsKKyAgICB9XSkKKyAgICAuZGlyZWN0aXZlKCdhdHRBYnNMaW5rJyxbIGZ1bmN0aW9uKCl7CisgICAgICAgIHJldHVybnsKKyAgICAgICAgICAgIHJlc3RyaWN0OiAnRUEnLAorICAgICAgICAgICAgdHJhbnNjbHVkZTogdHJ1ZSwKKyAgICAgICAgICAgIHJlcGxhY2U6IGZhbHNlLAorICAgICAgICAgICAgdGVtcGxhdGU6ICc8c3BhbiBuZy10cmFuc2NsdWRlIGNsYXNzPSJ2aWV3LWxvZyI+PC9zcGFuPicKKyAgICAgICAgfTsKKyAgICB9XSk7Cithbmd1bGFyLm1vZHVsZSgnYXR0LmFicy52aWRlb0NvbnRyb2xzJywgW10pCisgICAgICAgIC5jb25maWcoWyckY29tcGlsZVByb3ZpZGVyJyAsIGZ1bmN0aW9uICgkY29tcGlsZVByb3ZpZGVyKSB7CisgICAgICAgICAgICAgICAgJGNvbXBpbGVQcm92aWRlci5hSHJlZlNhbml0aXphdGlvbldoaXRlbGlzdCgvXlxzKihodHRwcz98amF2YXNjcmlwdCk6Lyk7CisgICAgICAgICAgICB9XSkKKyAgICAgICAgLmRpcmVjdGl2ZSgndmlkZW9Db250cm9scycsIFtmdW5jdGlvbigpIHsKKyAgICAgICAgICAgICAgICByZXR1cm4geworICAgICAgICAgICAgICAgICAgICByZXN0cmljdDogJ0VBJywKKyAgICAgICAgICAgICAgICAgICAgcmVwbGFjZTogdHJ1ZSwKKyAgICAgICAgICAgICAgICAgICAgdHJhbnNjbHVkZTogdHJ1ZSwKKyAgICAgICAgICAgICAgICAgICAgdGVtcGxhdGVVcmw6ICdhcHAvc2NyaXB0cy9uZ19qc19hdHRfdHBscy92aWRlb0NvbnRyb2xzL3ZpZGVvQ29udHJvbHMuaHRtbCcKKyAgICAgICAgICAgICAgICB9OworICAgICAgICAgICAgfV0pCisgICAgICAgIC5kaXJlY3RpdmUoJ3Bob3RvQ29udHJvbHMnLCBbZnVuY3Rpb24oKSB7CisgICAgICAgICAgICAgICAgcmV0dXJuIHsKKyAgICAgICAgICAgICAgICAgICAgcmVzdHJpY3Q6ICdFQScsCisgICAgICAgICAgICAgICAgICAgIHJlcGxhY2U6IHRydWUsCisgICAgICAgICAgICAgICAgICAgIHRyYW5zY2x1ZGU6IHRydWUsCisgICAgICAgICAgICAgICAgICAgIHRlbXBsYXRlVXJsOiAnYXBwL3NjcmlwdHMvbmdfanNfYXR0X3RwbHMvdmlkZW9Db250cm9scy9waG90b0NvbnRyb2xzLmh0bWwnLAorICAgICAgICAgICAgICAgICAgICBzY29wZTogeworICAgICAgICAgICAgICAgICAgICAgICAgcHJldkxpbms6ICJAIiwKKyAgICAgICAgICAgICAgICAgICAgICAgIG5leHRMaW5rOiAiQCIKKyAgICAgICAgICAgICAgICAgICAgfSwKKyAgICAgICAgICAgICAgICAgICAgbGluazogZnVuY3Rpb24oc2NvcGUsIGVsZW0sIGF0dHIpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIGlmKCFhdHRyWydwcmV2TGluayddKXsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBzY29wZS5wcmV2TGluayA9ICdqYXZhc2NyaXB0OnZvaWQoMCknOworICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgaWYoIWF0dHJbJ25leHRMaW5rJ10peworICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNjb3BlLm5leHRMaW5rID0gJ2phdmFzY3JpcHQ6dm9pZCgwKSc7CisgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICBzY29wZS5saW5rcyA9IHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBwcmV2TGluayA6IHNjb3BlLnByZXZMaW5rLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIG5leHRMaW5rIDogc2NvcGUubmV4dExpbmsKKyAgICAgICAgICAgICAgICAgICAgICAgIH07CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICB9OworICAgICAgICAgICAgfV0pOworYW5ndWxhci5tb2R1bGUoImFwcC9zY3JpcHRzL25nX2pzX2F0dF90cGxzL2FjY29yZGlvbi9hY2NvcmRpb24uaHRtbCIsIFtdKS5ydW4oWyIkdGVtcGxhdGVDYWNoZSIsIGZ1bmN0aW9uKCR0ZW1wbGF0ZUNhY2hlKSB7CisJICAkdGVtcGxhdGVDYWNoZS5wdXQoImFwcC9zY3JpcHRzL25nX2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LWFjY29yZGlvbl9fdG9nZ2xlXCIgXG4iICsKKyAgICAiICAgICAgIGFyaWEtc2VsZWN0ZWQ9XCJ7e2ZvY3VzZWR9fVwiIFxuIiArCisgICAgIiAgICAgICBhcmlhLWNvbnRyb2xzPVwicGFuZWx7e2luZGV4fX1cIiBcbiIgKworICAgICIgICAgICAgbmctY2xhc3M9XCJ7Zm9jdXM6IGZvY3VzZWQsIHNlbGVjdGVkOiBmb2N1c2VkfVwiIFxuIiArCisgICAgIiAgICAgICBhcmlhLWV4cGFuZGVkPVwie3tpc09wZW59fVwiIFxuIiArCisgICAgIiAgICAgICByb2xlPVwidGFiXCIgXG4iICsKKyAgICAiICAgICAgIG5nLWNsaWNrPVwidG9nZ2xlKClcIiBcbiIgKworICAgICIgICAgICAgYWNjb3JkaW9uLXRyYW5zY2x1ZGU9XCJoZWFkaW5nXCI+ICAgICAgICBcbiIgKworICAgICIgICAgPC9hPlxuIiArCisgICAgIiAgICA8c3Bhbj57e2hlYWRpbmd9fTwvc3Bhbj5cbiIgKworICAgICIgICAgPGRpdiBhcmlhLWxhYmVsPVwie3toZWFkaW5nfX1cIiBcbiIgKworICAgICIgICAgICAgICBhcmlhLWhpZGRlbj1cInt7IWlzT3Blbn19XCIgXG4iICsKKyAgICAiICAgICAgICAgcm9sZT1cInRhYnBhbmVsXCIgXG4iICsKKyAgICAiICAgICAgICAgY29sbGFwc2U9XCIhaXNPcGVuXCIgXG4iICsKKyAgICAiICAgICAgICAgY2xhc3M9XCJhdHQtYWNjb3JkaW9uX19ib2R5XCIgXG4iICsKKyAgICAiICAgICAgICAgaWQ9XCJwYW5lbHt7aW5kZXh9fVwiIFxuIiArCisgICAgIiAgICAgICAgIG5nLXRyYW5zY2x1ZGU+XG4iICsKKyAgICAiICAgIDwvZGl2PlxuIiArCisgICAgIjwvZGl2PiAiKTsKK31dKTsKKworYW5ndWxhci5tb2R1bGUoImFwcC9zY3JpcHRzL25nX2pzX2F0dF90cGxzL2FjY29yZGlvbi9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8ICd0cnVlJ319XCIgdGFiaW5kZXg9XCJ7eyFkaXNhYmxlTmV4dCAmJiAnMCd8fCAnLTEnfX1cIiBhdHQtYWNjZXNzaWJpbGl0eS1jbGljaz1cIjEzLDMyXCIgbmctY2xpY2s9XCIhZGlzYWJsZU5leHQgJiYgbW92ZSgxKVwiPlxuIiArCisgICAgIiAgICAgICAgICAgIDxkaXYgY2xhc3M9XCJpY29ucy1saXN0XCIgZGF0YS1zaXplPVwibWVkaXVtXCI+PGkgY2xhc3M9XCJpY29uLWFycm93LXJpZ2h0LWNpcmNsZVwiIG5nLWNsYXNzPVwieydkaXNhYmxlZCc6IGRpc2FibGVOZXh0fVwiIGFsdD1cIlJpZ2h0IEFycm93XCI+PC9pPlxuIiArCisgICAgIiAgICAgICAgICAgIDwvZGl2PjxzcGFuIGNsYXNzPVwiaGlkZGVuLXNwb2tlblwiPk5leHQgTW9udGg8L3NwYW4+XG4iICsKKyAgICAiICAgICAgICAgICAgPC90aD5cbiIgKworICAgICIgICAgICAgICAgICA8L3RyPlxuIiArCisgICAgIiAgICAgICAgICAgIDx0ciBuZy1pZj1cImxhYmVscy5sZW5ndGggPiAwXCI+XG4iICsKKyAgICAiICAgICAgICAgICAgICAgIDx0aCB0YWJpbmRleD1cIi0xXCIgY2xhc3M9XCJkb3cgd2Vla2RheVwiIG5nLXJlcGVhdD1cImxhYmVsIGluIGxhYmVsc1wiPjxzcGFuPnt7bGFiZWwucHJlfX08L3NwYW4+PC90aD5cbiIgKworICAgICIgICAgICAgICAgICA8L3RyPlxuIiArCisgICAgIiAgICAgICAgICAgIDwvdGhlYWQ+XG4iICsKKyAgICAiICAgICAgICAgICAgPHRib2R5PlxuIiArCisgICAgIiAgICAgICAgICAgICAgICA8dHI+XG4iICsKKyAgICAiICAgICAgICAgICAgICAgICAgICA8dGQgaWQ9XCJkYXRlcGlja2VyQm9keVwiIGF0dC1zY3JvbGxiYXIgY29sc3Bhbj1cInt7Y3VycmVudFJvd3NbMF0ubGVuZ3RofX1cIiBzdHlsZT1cInBhZGRpbmc6IDBweDtcIiBoZWFkZXJzPVwiXCI+XG4iICsKKyAgICAiICAgICAgICAgICAgICAgICAgICAgICAgPHRhYmxlIG5nLWNsYXNzPVwieyd0YWJsZS1jb25kZW5zZWQnOiBtb2RlID09PSAwLCAnbW9udGh0YWJsZS1jb25kZW5zZWQnOiBtb2RlID09PSAxfVwiIHN0eWxlPVwicGFkZGluZzogMHB4O1wiPlxuIiArCisgICAgIiAgICAgICAgICAgICAgICAgICAgICAgICAgICA8dGhlYWQgY2xhc3M9XCJoaWRkZW4tc3Bva2VuXCI+XG4iICsKKyAgICAiICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA8dHIgbmctc2hvdz1cImxhYmVscy5sZW5ndGggPiAwXCI+XG4iICsKKyAgICAiICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPHRoIGlkPVwie3tsYWJlbC5wb3N0fX1cIiB0YWJpbmRleD1cIi0xXCIgY2xhc3M9XCJkb3cgd2Vla2RheVwiIG5nLXJlcGVhdD1cImxhYmVsIGluIGxhYmVsc1wiPjwvdGg+XG4iICsKKyAgICAiICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA8L3RyPlxuIiArCisgICAgIiAgICAgICAgICAgICAgICAgICAgICAgICAgICA8L3RoZWFkPlxuIiArCisgICAgIiAgICAgICAgICAgICAgICAgICAgICAgICAgICA8dGJvZHk+XG4iICsKKyAgICAiICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA8dHIgbmctcmVwZWF0PVwicm93IGluIGN1cnJlbnRSb3dzXCI+XG4iICsKKyAgICAiICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPHRkIGhlYWRlcnM9XCJ7eyhtb2RlID09PSAwKSAmJiBkdC5oZWFkZXIgfHwgJ21vbnRoJ319XCIgYXR0LWVsZW1lbnQtZm9jdXM9XCJkdC5mb2N1c2VkXCIgYXJpYS1oaWRkZW49XCJ7eyghZHQub2xk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Sb3dzWzBdLmxlbmd0aH19XCI+PGhyPjwvdGQ+PC90cj5cbiIgKworICAgICIgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDx0cj5cbiIgKworICAgICIgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA8dGggaWQ9XCJtb250aFwiIHRhYmluZGV4PVwiMFwiIGNsYXNzPVwiZGF0ZXBpY2tlci1zd2l0Y2ggaW50ZXJuYWxcIiBjb2xzcGFuPVwie3tuZXh0Um93c1swXS5sZW5ndGh9fVwiIHN0eWxlPVwidGV4dC1hbGlnbjpsZWZ0XCI+e3tuZXh0VGl0bGV9fTwvdGg+XG4iICsKKyAgICAiICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA8L3RyPlxuIiArCisgICAgIiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPHRyIG5nLXJlcGVhdD1cInJvdyBpbiBuZXh0Um93c1wiPlxuIiArCisgICAgIiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDx0ZCBoZWFkZXJzPVwie3sobW9kZSA9PT0gMCkgJiYgZHQuaGVhZGVyIHx8ICdtb250aCd9fVwiIGF0dC1lbGVtZW50LWZvY3VzPVwiZHQuZm9jdXNlZFwiIGFyaWEtaGlkZGVuPVwie3soIWR0Lm9sZE1vbnRoICYmICFkdC5uZXh0TW9udGggJiYgIWR0LmRpc2FibGVkICYmICdmYWxzZScpIHx8ICd0cnVlJ319XCIgdGFiaW5kZXg9XCJ7eyghZHQub2xkTW9udGggJiYgIWR0Lm5leHRNb250aCAmJiAhZHQuZGlzYWJsZWQgJiYgJzAnKSB8fCAnLTEnfX1cIiBuZy1yZXBlYXQ9XCJkdCBpbiByb3dcIiBjbGFzcz1cImRheXNcIiBuZy1jbGFzcz1cInsnYWN0aXZlJzogZHQuc2VsZWN0ZWQgfHwgZHQuZnJvbSB8fCBkdC50bywgJ2Zyb20nOiBkdC5mcm9tLCAndG8nOiBkdC50bywgJ3JhbmdlJzogZHQuZGF0ZVJhbmdlLCAncHJldi1tb250aCAnOiBkdC5vbGRNb250aCwgJ25leHQtbW9udGgnOiBkdC5uZXh0TW9udGgsICdkaXNhYmxlZCc6IGR0LmRpc2FibGVkLCAndG9kYXknOiBkdC50b2RheSwgJ3dlZWtlbmQnOiBkdC53ZWVrZW5kfVwiIG5nLWNsaWNrPVwiIWR0LnNlbGVjdGVkICYmICFkdC5mcm9tICYmICFkdC50byAmJiAhZHQuZGlzYWJsZWQgJiYgIWR0Lm9sZE1vbnRoICYmICFkdC5uZXh0TW9udGggJiYgc2VsZWN0KGR0LmRhdGUpXCIgYXR0LWFjY2Vzc2liaWxpdHktY2xpY2s9XCIxMywzMlwiIGFyaWEtbGFiZWw9XCJ7e2R0LmRhdGUgfCBkYXRlIDogJ0VFRUUsIE1NTU0gZCd9fVwiPjxzcGFuIGNsYXNzPVwiZGF5XCI+e3tkdC5sYWJlbH19PC9zcGFuPjwvdGQ+XG4iICsKKyAgICAiICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA8L3RyPlxuIiArCisgICAgIiAgICAgICAgICAgICAgICAgICAgICAgICAgICA8L3Rib2R5PlxuIiArCisgICAgIiAgICAgICAgICAgICAgICAgICAgICAgIDwvdGFibGU+XG4iICsKKyAgICAiICAgICAgICAgICAgICAgICAgICA8L3RkPlxuIiArCisgICAgIiAgICAgICAgICAgICAgICA8L3RyPlxuIiArCisgICAgIiAgICAgICAgICAgIDwvdGJvZHk+XG4iICsKKyAgICAiICAgICAgICA8L3RhYmxlPlxuIiArCisgICAgIiAgICA8L2Rpdj5cbiIgKworICAgICI8L2Rpdj5cbiIgKworICAgICIiKTsKK31dKTsKKworYW5ndWxhci5tb2R1bGUoImFwcC9zY3JpcHRzL25nX2pzX2F0dF90cGxzL2RhdGVwaWNrZXIvZGF0ZXBpY2tlclBvcHVwLmh0bWwiLCBbXSkucnVuKFsiJHRlbXBsYXRlQ2FjaGUiLCBmdW5jdGlvbigkdGVtcGxhdGVDYWNoZSkg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dC1sYWJlbFwiPjxzcGFuID57e29wdGlvbn19PC9zcGFuPjwvZGl2PjwvbGk+ICAgICAgICAgICAgICAgICAgICAgICAgXG4iICsKKyAgICAiICAgICAgICA8L3VsPlxuIiArCisgICAgIiAgICAgICAgPC9kaXY+XG4iICsKKyAgICAiICAgIDwvZGl2PlxuIiArCisgICAgIiAgICA8ZGl2IG5nLXNob3c9XCJzaG93RGF5c1NlbGVjdG9yXCIgY2xhc3M9XCJjdXN0b21kYXlzLXdpZHRoXCI+XG4iICsKKyAgICAiICAgICAgICA8ZGl2IGF0dC1kaXZpZGVyLWxpbmVzIGNsYXNzPVwiZGl2aWRlci1tYXJnaW4tZlwiPjwvZGl2PiAgXG4iICsKKyAgICAiICAgICAgICA8ZGl2IGNsYXNzPVwiY29sLW1kLTMgZnJvbXRvLW1hcmdpblwiPlxuIiArCisgICAgIiAgICAgICAgICAgIDxkaXY+RnJvbTwvZGl2PiA8YnI+XG4iICsKKyAgICAiICAgICAgICAgICAgPGRpdj5UbzwvZGl2PlxuIiArCisgICAgIiAgICAgICAgPC9kaXY+XG4iICsKKyAgICAiICAgICAgICA8ZGl2IG5nLXJlcGVhdD1cImRheSBpbiBkYXlzXCI+XG4iICsKKyAgICAiICAgICAgICAgICAgPGRpdiBjbGFzcz1cImNvbC1tZC0zIGNvbC1tZC1kYXlzXCI+XG4iICsKKyAgICAiICAgICAgICAgICAgICAgIDxkaXYgIGNsYXNzPVwiY29sLW1kLTEgZGF5c3NlbGVjdC1tYXJnaW5cIj5cbiIgKworICAgICIgICAgICAgICAgICAgICAgICAgIDxpbnB1dCB0eXBlPVwiY2hlY2tib3hcIiBuZy1tb2RlbD1cImRheXNMaXN0W2RheV1cIiB0aXRsZT1cIkRheSBzZWxlY3Rpb24ge3skaW5kZXh9fVwiIGF0dC1jaGVja2JveCBuZy1jaGFuZ2U9XCJhZGRTZWxlY3RlZFZhbHVlKGRheSlcIj4gICAgXG4iICsKKyAgICAiICAgICAgICAgICAgICAgIDwvZ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duTWFyZ2luUmlnaHRcIiA+e3tzZWxlY3RlZEZyb21PcHRpb25bZGF5XX19IDxpIG5nLWlmPVwiZGF5c0xpc3RbZGF5XVwiIG5nLWNsYXNzPVwiRnJ0aW1lTGlzdERheVtkYXldID8gJ2ljb24tZHJvcGRvd24tdXAnIDogJ2ljb24tZHJvcGRvd24tZG93bidcIj48L2k+PC9zcGFuPlxuIiArCisgICAgIiAgICAgICAgICAgICAgICAgICAgICAgIDwvYT5cbiIgKworICAgICIgICAgICAgICAgICAgICAgICAgIDwvZGl2PiAgICAgICAgICAgICBcbiIgKworICAgICIgICAgICAgICAgICAgICAgICAgIFxuIiArCisgICAgIiAgICAgICAgICAgICAgICAgICAgPGRpdiBjbGFzcz1cInNlbGVjdDItZGlzcGxheS1ub25lIHNlbGVjdDItd2l0aC1zZWFyY2hib3ggc2VsZWN0Mi1kcm9wLWFjdGl2ZSBzaG93LXNlYXJjaCByZXN1bHRGcm9tRHJvcERvd25cIiAgbmctc2hvdz1cIkZydGltZUxpc3REYXlbZGF5XVwiPiAgICAgICBcbiIgKworICAgICIgICAgICAgICAgICAgICAgICAgIDx1bCBjbGFzcz1cInNlbGVjdDItcmVzdWx0cyByZXN1bHRUb3BNYXJnaW5cIiA+ICAgICAgICAgICAgICAgICAgICAgICBcbiIgKworICAgICIgICAgICAgICAgICAgICAgICAgICAgICA8bGkgbmctY2xpY2s9XCJzZWxlY3RGcm9tRGF5T3B0aW9uKGRheSx0aW1lLnZhbHVlKTthZGRTZWxlY3RlZFZhbHVlKGRheSk7XCIgbmctcmVwZWF0PVwidGltZSBpbiBmcm9tdGltZVwiICBjbGFzcz1cInNlbGVjdDItcmVzdWx0cy1kZXB0LTAgc2VsZWN0Mi1yZXN1bHQgc2VsZWN0Mi1yZXN1bHQtc2VsZWN0YWJsZVwiPjxkaXYgY2xhc3M9XCJzZWxlY3QyLXJlc3VsdC1sYWJlbFwiIG5nLWNsYXNzPVwieydzZWxlY3RlZEl0ZW1JbkRyb3BEb3duJzogKHRpbWUudmFsdWU9PXNlbGVjdGVkRnJvbU9wdGlvbltkYXldKX1cIj48c3BhbiA+e3t0aW1lLnZhbHVlfX08L3NwYW4+PC9kaXY+PC9saT4gICAgICAgICAgICAgICAgICAgICAgICBcbiIgKworICAgICIgICAgICAgICAgICAgICAgICAgIDwvdWw+XG4iICsKKyAgICAiICAgICAgICAgICAgICAgICAgICA8L2Rpdj5cbiIgKworICAgICIgICAgICAgICAgICAgICAgPC9kaXY+XG4iICsKKyAgICAiICAgICAgICAgICAgICAgIFxuIiArCisgICAgIiAgICAgICAgICAgICAgICA8ZGl2IGNsYXNzPVwiZHJvcERvd25NYXJnaW5Cb3R0b21cIj5cbiIgKworICAgICIgICAgICAgICAgICAgICAgICAgIDxkaXYgY2xhc3M9XCJzZWxlY3QyLWNvbnRhaW5lciB0b3BEcm9wRG93bldpZHRoXCIgbmctY2xhc3M9XCJ7J3NlbGVjdDItZHJvcGRvd24tb3BlbiBzZWxlY3QyLWNvbnRhaW5lci1hY3RpdmUnOiBUb3RpbWVMaXN0RGF5W2RheV19XCIgPlxuIiArCisgICAgIiAgICAgICAgICAgICAgICAgICAgICAgIDxhIGNsYXNzPVwic2VsZWN0Mi1jaG9pY2Ugc2VsZWN0RHJvcERvd25cIiBocmVmPVwiamF2YXNjcmlwdDp2b2lkKDApXCIgdGFiaW5kZXg9XCJ7e2RheXNMaXN0W2RheV0gPyAnMCcgOiAnLTEnfX1cIiBhdHQtYWNjZXNzaWJpbGl0eS1jbGljaz1cIjEzXCIgbmctY2xpY2s9XCJkYXlzTGlzdFtkYXldICYmIHNob3d0b0RheURyb3Bkb3duKGRheSlcIiBuZy1jbGFzcz1cInsnc2VsZWN0Mi1jaG9zZW4tZGlzYWJsZWQnOiFkYXlzTGlzdFtkYXldLCAnc2VsZWN0RHJvcERvd24tZXJyb3InOmRheXNMaXN0W2RheV0gJiYgc2hvd1RvVGltZUVycm9yRGF5W2RheV19XCIgIG5nLWtleWRvd249XCJkYXlzTGlzdFtkYXldICYmIHNlbGVjdFRvRGF5T3B0aW9uKGRheSAsIHNlbGVjdFByZXZOZXh0VmFsdWUoJGV2ZW50LHRvdGltZSxzZWxlY3RlZFRvT3B0aW9uW2RheV0pKTtkYXlzTGlzdFtkYXldICYmIGFkZFNlbGVjdGVkVmFsdWUoZGF5KTtcIj5cbiIgKworICAgICIgICAgICAgICAgICAgICAgICAgICAgICAgICAgPHNwYW4gY2xhc3M9XCJzZWxlY3QyLWNob3NlbiBkcm9wRG93bk1hcmdpblJpZ2h0XCI+e3tzZWxlY3RlZFRvT3B0aW9uW2RheV19fSA8aSBuZy1pZj1cImRheXNMaXN0W2RheV1cIiBuZy1jbGFzcz1cIlRvdGltZUxpc3REYXlbZGF5XSA/ICdpY29uLWRyb3Bkb3duLXVwJyA6ICdpY29uLWRyb3Bkb3duLWRvd24nXCIgPjwvaT48L3NwYW4+XG4iICsKKyAgICAiICAgICAgICAgICAgICAgICAgICAgICAgPC9hPlxuIiArCisgICAgIiAgICAgICAgICAgICAgICAgICAgPC9kaXY+XG4iICsKKyAgICAiICAgICAgICAgICAgICAgICAgICBcbiIgKworICAgICIgICAgICAgICAgICAgICAgICAgIDxkaXYgY2xhc3M9XCJzZWxlY3QyLWRpc3BsYXktbm9uZSBzZWxlY3QyLXdpdGgtc2VhcmNoYm94IHNlbGVjdDItZHJvcC1hY3RpdmUgc2hvdy1zZWFyY2ggcmVzdWx0VG9Ecm9wRG93blwiIG5nLXNob3c9XCJUb3RpbWVMaXN0RGF5W2RheV1cIj4gICAgICAgXG4iICsKKyAgICAiICAgICAgICAgICAgICAgICAgICA8dWwgY2xhc3M9XCJzZWxlY3QyLXJlc3VsdHMgcmVzdWx0VG9wTWFyZ2luXCIgPiAgICAgICAgICAgICAgICAgICAgICAgXG4iICsKKyAgICAiICAgICAgICAgICAgICAgICAgICAgICAgPGxpIG5nLWNsaWNrPVwic2VsZWN0VG9EYXlPcHRpb24oZGF5LHRpbWUudmFsdWUpO2FkZFNlbGVj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G4iICsKKyAgICAiICAgICAgICAgICAgPHNwYW4gbmctaGlkZT1cImltYWdlXCIgY2xhc3M9XCJkZWZhdWx0LWltZ1wiPnt7aW5pdGlhbHN9fTwvc3Bhbj5cbiIgKworICAgICIgICAgICAgICAgICA8cCBjbGFzcz1cIm5hbWVcIiB0b29sdGlwLWNvbmRpdGlvbj1cInt7cHJvZmlsZS5uYW1lfX1cIiBoZWlnaHQ9XCJ0cnVlXCI+PC9wPlxuIiArCisgICAgIiAgICAgICAgICAgIDxwIGNsYXNzPVwic3RhdHVzXCI+XG4iICsKKyAgICAiICAgICAgICAgICAgICAgIDxzcGFuIGNsYXNzPVwic3RhdHVzLWljb25cIiBuZy1jbGFzcz1cInsnaWNvbi1ncmVlbic6Y29sb3JJY29uPT09J2dyZWVuJywnaWNvbi1yZWQnOmNvbG9ySWNvbj09PSdyZWQnLCdpY29uLWJsdWUnOmNvbG9ySWNvbj09PSdibHVlJywnaWNvbi15ZWxsb3cnOmNvbG9ySWNvbj09PSd5ZWxsb3cnfVwiPiAgIFxuIiArCisgICAgIiAgICAgICAgICAgICAgICA8L3NwYW4+XG4iICsKKyAgICAiICAgICAgICAgICAgICAgIDxzcGFuPnt7cHJvZmlsZS5zdGF0ZX19PHNwYW4gbmctaWY9XCJiYWRnZVwiIGNsYXNzPVwic3RhdHVzLWJhZGdlXCI+QWRtaW48L3NwYW4+PC9zcGFuPlxuIiArCisgICAgIiAgICAgICAgICAgIDwvcD5cbiIgKworICAgICIgICAgICAgIDwvZGl2PlxuIiArCisgICAgIiAgICA8L2Rpdj5cbiIgKworICAgICIgICAgPGRpdiBjbGFzcz1cImJvdHRvbS1ibG9ja1wiPlxuIiArCisgICAgIiAgICAgICAgIDxkaXYgY2xhc3M9XCJwcm9maWxlLWRldGFpbHNcIj5cbiIgKworICAgICIgICAgICAgICAgICA8bGFiZWw+VXNlcm5hbWU8L2xhYmVsPlxuIiArCisgICAgIiAgICAgICAgICAgIDxwIGF0dC10ZXh0LW92ZXJm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IgKworICAgICIgICAgPGlucHV0IGNsYXNzPVwic2VsZWN0Mi1mb2N1c3NlciBzZWxlY3QyLW9mZnNjcmVlblwiICAgICAgICAgICAgXG4iICsKKyAgICAiICAgICAgICAgICB0YWJpbmRleD1cIi0xXCIgXG4iICsKKyAgICAiICAgICAgICAgICB0eXBlPVwidGV4dFwiIFxuIiArCisgICAgIiAgICAgICAgICAgYXJpYS1oaWRkZW49XCJ0cnVlXCIgXG4iICsKKyAgICAiICAgICAgICAgICB0aXRsZT1cImhpZGRlblwiICAgICAgICAgICBcbiIgKworICAgICIgICAgICAgICAgIGFyaWEtaGFzcG9wdXA9XCJ0cnVlXCIgICAgICAgICAgIFxuIiArCisgICAgIiAgICAgICAgICAgcm9sZT1cImJ1dHRvblwiPiAgICBcbiIgKworICAgICI8L2Rpdj5cbiIgKworICAgICJcbiIgKworICAgICI8ZGl2IGNsYXNzPVwic2VsZWN0Mi1kcm9wIHNlbGVjdDItd2l0aC1zZWFyY2hib3ggc2VsZWN0Mi1kcm9wLWF1dG8td2lkdGggc2VsZWN0Mi1kcm9wLWFjdGl2ZVwiIG5nLWNsYXNzPVwieydzZWxlY3QyLWRpc3BsYXktbm9uZSc6KCFzaG93bGlzdCB8fCBpc0Rpc2FibGVkKX1cIiBzdHlsZT1cIndpZHRoOjEwMCU7ei1pbmRleDogMTBcIj5cbiIgKworICAgICIgICAgPGRpdiBjbGFzcz1cInNlbGVjdDItc2VhcmNoXCI+XG4iICsKKyAgICAiICAgICAgICA8bGFiZWwgbmctaWY9XCIhbm9GaWx0ZXJcIiBjbGFzcz1cInNlbGVjdDItb2Zmc2NyZWVuXCIgYXJpYS1sYWJlbD1cIklubGluZSBTZWFyY2ggRmllbGRcIiBhcmlhLWhpZGRlbj1cInRydWVcIj5JbmxpbmUgU2VhcmNoIEZpZWxkPC9sYWJlbD5cbiIgKworICAgICIgICAgICAgIDxpbnB1dCBuZy1pZj1cIiFub0ZpbHRlclwiIG5nLW1vZGVsPVwidGl0bGVc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ICAgICAgPGRpdiBjbGFzcz1cImpzbGlkZXItbGFiZWwganNsaWRlci1sYWJlbC10b1wiPjxzcGFuIG5nLWJpbmQ9XCJ0b1N0clwiPjwvc3Bhbj48c3BhbiBuZy1iaW5kPVwiZW5kRGltZW5zaW9uXCI+PC9zcGFuPjwvZGl2PlxuIiArCisgICAgIiAgICAgICAgICAgICAgICA8ZGl2IGNsYXNzPVwianNsaWRlci12YWx1ZVwiIGlkPVwianNsaWRlci12YWx1ZS1sZWZ0XCI+PHNwYW4+PC9zcGFuPnt7b3B0aW9ucy5kaW1lbnNpb259fTwvZGl2PlxuIiArCisgICAgIiAgICAgICAgICAgICAgICA8ZGl2IGNsYXNzPVwianNsaWRlci12YWx1ZSBqc2xpZGVyLXZhbHVlLXRvXCI+PHNwYW4+PC9zcGFuPnt7dG9vbFRpcERpbWVuc2lvbn19PC9kaXY+XG4iICsKKyAgICAiICAgICAgICAgICAgICAgIDxkaXYgY2xhc3M9XCJqc2xpZGVyLXNjYWxlXCIgbmctY2xhc3M9XCJ7J3Nob3ctZGl2aWRlcnMnOiBzaG93RGl2aWRlcnMsICdjdXRvZmYtc2xpZGVyLWRpdmlkZXJzJzppc0N1dE9mZlNsaWRlcn1cIj5cbiIgKworICAgICIgICAgICAgICAgICAgICAgPC9kaXY+XG4iICsKKyAgICAiICAgICAgICAgICAgICAgIDxkaXYgY2xhc3M9XCJqc2xpZGVyLWN1dG9mZlwiPlxuIiArCisgICAgIiAgICAgICAgICAgICAgICAgICAgPGRpdiBjbGFzcz1cImpzbGlkZXItbGFiZWwganNsaWRlci1sYWJlbC1jdXRvZmZcIj5cbiIgKworICAgICIgICAgICAgICAgICAgICAgICAgICAgICA8c3BhbiBuZy1iaW5kPVwiY3V0T2ZmVmFsXCI+PC9zcGFuPlxuIiArCisgICAgIiAgICAgICAgICAgICAgICAgICAgPC9kaXY+XG4iICsKKyAgICAiICAgICAgICAgICAgICAgIDwvZGl2PlxuIiArCisgICAgIiAgICAgICAgICAgIDw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gICAgICAgICAgICAgICAgICAgICAgPHRyIG5nLXNob3c9ImxhYmVscy5sZW5ndGggPiAwIj5cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDx0aCBpZD0ie3tsYWJlbC5wb3N0fX0iIHRhYmluZGV4PSItMSIgY2xhc3M9ImRvdyB3ZWVrZGF5IiBuZy1yZXBlYXQ9ImxhYmVsIGluIGxhYmVscyI+PC90aD5cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPC90cj5cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICA8L3RoZWFkPlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIDx0Ym9keT5cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPHRyIG5nLXJlcGVhdD0icm93IGluIGN1cnJlbnRSb3dzIj5cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDx0ZCBoZWFkZXJzPSJ7eyhtb2RlID09PSAwKSAmJiBkdC5oZWFkZXIgfHwgXCdtb250aFwnfX0iIGF0dC1lbGVtZW50LWZvY3VzPSJkdC5mb2N1c2VkIiBhcmlhLWhpZGRlbj0ie3soIWR0Lm9sZE1vbnRoICYmICFkdC5uZXh0TW9udGggJiYgIWR0LmRpc2FibGVkICYmIFwnZmFsc2VcJykgfHwgXCd0cnVlXCd9fSIgdGFiaW5kZXg9Int7KCFkdC5vbGRNb250aCAmJiAhZHQubmV4dE1vbnRoICYmICFkdC5kaXNhYmxlZCAmJiBcJzBcJykgfHwgXCctMVwnfX0iIG5nLXJlcGVhdD0iZHQgaW4gcm93IiBjbGFzcz0iZGF5cyIgbmctY2xhc3M9IntcJ2FjdGl2ZVwnOiBkdC5zZWxlY3RlZCB8fCBkdC5mcm9tIHx8IGR0LnRvLCBcJ2Zyb21cJzogZHQuZnJvbSwgXCd0b1wnOiBkdC50bywgXCdyYW5nZVwnOiBkdC5kYXRlUmFuZ2UsIFwncHJldi1tb250aCBcJzogZHQub2xkTW9udGgsIFwnbmV4dC1tb250aFwnOiBkdC5uZXh0TW9udGgsIFwnZGlzYWJsZWRcJzogZHQuZGlzYWJsZWQsIFwndG9kYXlcJzogZHQudG9kYXksIFwnd2Vla2VuZFwnOiBkdC53ZWVrZW5kfSIgbmctY2xpY2s9IiFkdC5zZWxlY3RlZCAmJiAhZHQuZnJvbSAmJiAhZHQudG8gJiYgIWR0LmRpc2FibGVkICYmICFkdC5vbGRNb250aCAmJiAhZHQubmV4dE1vbnRoICYmIHNlbGVjdChkdC5kYXRlKSIgYXR0LWFjY2Vzc2liaWxpdHktY2xpY2s9IjEzLDMyIiBhcmlhLWxhYmVsPSJ7e2R0LmRhdGUgfCBkYXRlIDogXCdFRUVFLCBNTU1NIGRcJ319Ij48c3BhbiBjbGFzcz0iZGF5Ij57e2R0LmxhYmVsfX08L3NwYW4+PC90ZD5cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPC90cj5cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPHRyIG5nLWlmPSJtb2RlID09PSAxIiBjbGFzcz0iZGl2aWRlciI+PHRkIGNvbHNwYW49Int7bmV4dFJvd3NbMF0ubGVuZ3RofX0iPjxocj48L3RkPjwvdHI+XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDx0cj5cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDx0aCBpZD0ibW9udGgiIHRhYmluZGV4PSIwIiBjbGFzcz0iZGF0ZXBpY2tlci1zd2l0Y2ggaW50ZXJuYWwiIGNvbHNwYW49Int7bmV4dFJvd3NbMF0ubGVuZ3RofX0iIHN0eWxlPSJ0ZXh0LWFsaWduOmxlZnQiPnt7bmV4dFRpdGxlfX08L3RoPlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA8L3RyPlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA8dHIgbmctcmVwZWF0PSJyb3cgaW4gbmV4dFJvd3MiPlxuJysiICAgICAgICAgICAgICAgIC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sZXIgeworICAgIHBvc2l0aW9uOiBhYnNvbHV0ZTsKKyAgICBmb250LXNpemU6IDFweDsKKyAgICBkaXNwbGF5OiBibG9jaworfQorCisuaGFuZGxlLXNlIHsKKyAgICBjdXJzb3I6IHNlLXJlc2l6ZTsKKyAgICB3aWR0aDogMDsKKyAgICBoZWlnaHQ6IDA7CisgICAgcmlnaHQ6IDFweDsKKyAgICBib3R0b206IDFweDsKKyAgICBib3JkZXItc3R5bGU6IHNvbGlkOworICAgIGJvcmRlci13aWR0aDogMCAwIDEycHggMTJweDsKKyAgICBib3JkZXItY29sb3I6IHRyYW5zcGFyZW50Cit9CisKKy5oYW5kbGUtbmUgeworICAgIGN1cnNvcjogbmUtcmVzaXplOworICAgIHdpZHRoOiAxMnB4OworICAgIGhlaWdodDogMTJweDsKKyAgICByaWdodDogMXB4OworICAgIHRvcDogMXB4Cit9CisKKy5oYW5kbGUtbncgeworICAgIGN1cnNvcjogbnctcmVzaXplOworICAgIHdpZHRoOiAxMnB4OworICAgIGhlaWdodDogMTJweDsKKyAgICBsZWZ0OiAxcHg7CisgICAgdG9wOiAxcHgKK30KKworLmhhbmRsZS1zdyB7CisgICAgY3Vyc29yOiBzdy1yZXNpemU7CisgICAgd2lkdGg6IDEycHg7CisgICAgaGVpZ2h0OiAxMnB4OworICAgIGxlZnQ6IDFweDsKKyAgICBib3R0b206IDFweAorfQorCisuaGFuZGxlLWUgeworICAgIGN1cnNvcjogZS1yZXNpemU7CisgICAgd2lkdGg6IDEycHg7CisgICAgYm90dG9tOiAwOworICAgIHJpZ2h0OiAxcHg7CisgICAgdG9wOiAwCit9CisKKy5oYW5kbGUtcyB7CisgICAgY3Vyc29yOiBzLXJlc2l6ZTsKKyAgICBoZWlnaHQ6IDEycHg7CisgICAgcmlnaHQ6IDA7CisgICAgYm90dG9tOiAxcHg7CisgICAgbGVmdDogMAorfQorCisuaGFuZGxlLW4geworICAgIGN1cnNvcjogbi1yZXNpemU7CisgICAgaGVpZ2h0OiAxM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geyB3aWR0aDogOTklOworICAJCQkJCSAgZm9udC1mYW1pbHk6IEFyaWFsOworICAgIAkJCQkgIGZvbnQtc2l6ZTogMTFweDsKKwkJCQkJICBjb2xvcjogIzFmMWYxZjsKKyAgICAgICAgICAgICAgICAgICAgICBwYWRkaW5nOiAzcHg7CisgICAgICAgICAgICAgICAgICAgICAgYm9yZGVyOiAxcHggI2VlYjQyMCBzb2xpZDsKKyAgICAgICAgICAgICAgICAgICAgICBtYXJnaW46IDNweDsKKyAgICAgICAgICAgICAgICAgICAgICBiYWNrZ3JvdW5kOiAjZmZmOWU1OworICAgICAgICAgICAgICAgICAgICB9ICAgICAgICAgICAgICAgICAgICAgIAorCisgIC5tZW51YmFyIHsKKyAgICBib3JkZXItd2lkdGg6IDBweCAwcHggMHB4IDFweDsgYm9yZGVyLXN0eWxlOiBzb2xpZDsgYm9yZGVyLWNvbG9yOiAjOTU5NTk1OworICB9CisKKyAgLmZvb3RlciB7CisgICAgLypjbGVhcjogYm90aDsqLworICAgIGJvcmRlci13aWR0aDogMHB4IDFweCAwcHggMXB4OyBib3JkZXItc3R5bGU6IHNvbGlkOyBib3JkZXItY29sb3I6ICM5NTk1OTU7CisgIAlmb250LWZhbWlseTogVmVyZGFuYSxBcmlhbCxIZWx2ZXRpY2EsIHNhbnMtc2VyaWY7CisgICAgZm9udC1zaXplOiA5cHg7ICAgIAorICAgIHBhZGRpbmc6ICAgMTBweCAxMHB4IDMwcHggMTBweDsKKyAgICBiYWNrZ3JvdW5kOiB3aGl0ZTsKKyAgfQorCisgIC5wYWdlVGl0bGUgeworICAgIGZvbnQtZmFtaWx5OiBBcmlhbDsKKyAgICBmb250LXNpemU6IDE4cHg7CisgICAgZm9udC13ZWlnaHQ6IGJvbGQ7CisgICAgbWFyZ2luLXRvcDogNXB4OyAgICAKKyAgfQorCisgIC5jb250ZW50IHsKKwlib3JkZXItd2lkdGg6ICAwcHggMXB4IDBweCAxcHg7CisgICAgYm9yZGVyLXN0eWxlOiAgc29saWQ7CisgICAgYm9yZGVyLWNvbG9yOiAgIzk1OTU5NTsKKyAgCWZvbnQtZmFtaWx5OiBBcmlhbDsKKyAgICBmb250LXNpemU6IDExcHg7CisgICAgcGFkZGluZzogNXB4OworICAgIGJhY2tncm91bmQ6ICAgd2hpdGU7CisgICAgLypoZWlnaHQ6IDYwMHB4OyovCisgIH0KKworICAucG9wdXBDb250ZW50IHsKKyAgICBmb250LWZhbWlseTogQXJpYWw7CisgICAgZm9udC1zaXplOiAxMXB4OworICAgIHBhZGRpbmc6IDNweDsKKyAgfQorCisgIC5sb2dvIHsKKwlib3JkZXItd2lkdGg6ICAwcHggMXB4IDBweCAxcHg7CisgICAgYm9yZGVyLXN0eWxlOiAgc29saWQ7CisgICAgYm9yZGVyLWNvbG9yOiAgIzk1OTU5NTsKKyAgCXRleHQtYWxpZ246IHJpZ2h0OworICB9CisKKyAgLnNlcCB7CisgICAgYm9yZGVyOiAxcHggc29saWQgYmxhY2sKKyAgfQorCisgIC5hdHRMb2dvCQl7ICAvKnBvc2l0aW9uOiByZWxhdGl2ZTsqLworICAgICAgICAgICAgICAgICAgIGZsb2F0OmxlZnQ7CisgICAgICAgICAgICAgICAgICAgcGFkZGluZy10b3A6IDI1cHg7CisgICAgICAgICAgICAgICAgICAgcGFkZGluZy1sZWZ0OiAyNXB4OyAgIAorICAgICAgICAgICAgICAgIH0KKworICAuYXBwbGljYXRpb25Mb2dvCQl7IGZsb2F0OnJpZ2h0OyAKKyAgICAgICAgICAgICAgICAgICAgICAgICAgcGFkZGluZy10b3A6IDI1cHg7CisgICAgICAgICAgICAgICAgICAgICAgICAgIHBhZGRpbmctcmlnaHQ6IDI1cHg7ICAgICAgICAgICAgICAgICAgICAgICAgICAKKyAgICAgICAgICAgICAgICAgICAgICAgIH0KKworICAuYXBwbGlua1doaXRlCQl7IGZvbnQtZmFtaWx5OiBBcmlhbDsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgZm9udC1zaXplOiAxM3B4OworICAgICAgICAgICAgICAgICAgICAgICAgICBmb250LXdlaWdodDogOTAwOworICAgICAgICAgICAgICAgICAgICAgICAgICBjb2xvcjogI0ZGRkZGRjsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgdGV4dC1kZWNvcmF0aW9uOiBub25lOyB9CisKKyAgLnRlcm1zICAgICAgICAgICAgICAgIHsgZm9udC1mYW1pbHk6IFZlcmRhbmEsIEFyaWFsLCBIZWx2ZXRpY2EsIHNhbnMtc2VyaWY7CisgICAgICAgICAgICAgICAgICAgICAgICAgIGZvbnQtc2l6ZTogOXB4OworICAgICAgICAgICAgICAgICAgICAgICAgfQorCisgIC5icm9hZGNhc3RNZXNzYWdlICAgICB7IGNvbG9yOiByZWQ7IH0KKyAgLmJyb2FkY2FzdE1lc3NhZ2VMaXN0IHsgY29sb3I6IHJlZDsgfQorCisgIC5idXR0b24gICAgICAgICAgICAgICB7ICAKKwkJCQkJICAgICAgbWFyZ2luOiA1cHggMXB4IDVweCAxcHg7CisgICAgICAgICAgICAgICAgICAgICAgICAgIHBhZGRpbmc6IDNweDsgfQorCisgIC50b29sYmFyYnV0dG9uOmhvdmVyIHsKKyAgICBjb2xvcjojMDA1NDkxOworICB9CisKKyAgLmhlYWRlclRleHQJCXsgZm9udC1mYW1pbHk6IEFyaWFsOworICAgICAgICAgICAgICAgICAgICAgIGZvbnQtc2l6ZTogMTVweDsKKwkJCSAgICAgICAgICBmb250LXdlaWdodDogNzAwOworICAgICAgICAgICAgICAgICAgICAgIGNvbG9yOiAjMDAwMDAwOyB9CisKKyAgLmhlYWRlckJhY2tncm91bmQJeyBiYWNrZ3JvdW5kOiAjMzM2Njk5OyB9CisKKyAgLmVycm9yTWVzc2FnZVRleHQgeyBmb250LWZhbWlseTogQXJpYWw7CisgICAgICAgICAgICAgICAgICAgICAgZm9udC1zaXplOiAxMXB4OworICAgICAgICAgICAgICAgICAgICAgIGZvbnQtd2VpZ2h0OiBib2xkOyAKKyAgICAgICAgICAgICAgICAgICAgICBjb2xvcjogcmVkOyAgIH0KKyAgIAorCisgIC5ub3JtYWxUZXh0CQl7IGZvbnQtZmFtaWx5OiBBcmlhbDsKKyAgICAgICAgICAgICAgICAgICAgICBmb250LXNpemU6IDExcHg7CisgICAgICAgICAgICAgICAgICAgICAgY29sb3I6ICMwMDAwMDA7IH0KKworICAubm9ybWFsVGV4dFJlZAl7IGZvbnQtZmFtaWx5OiBBcmlhbDsKKyAgICAgICAgICAgICAgICAgICAgICBmb250LXNpemU6IDExcHg7CisgICAgICAgICAgICAgICAgICAgICAgY29sb3I6IHJlZDsgfQorCisKKyAgLnNtYWxsTm9ybWFsVGV4dAl7IGZvbnQtZmFtaWx5OiBBcmlhbDsKKyAgICAgICAgICAgICAgICAgICAgICBmb250LXNpemU6IDlweDsKKyAgICAgICAgICAgICAgICAgICAgICBjb2xvcjogIzAwMDAwMDsgfQorCisgIC50YWJsZUJvcmRlciAgICAgICAgICB7IGJvcmRlcjoxcHggb3V0c2V0IHRlYWwgfQorCisgIC52YWxpZGF0aW9uRXJyb3IgICAgICB7IGJhY2tncm91bmQ6ICNiOWVhZmY7IH0KKworICAudGVtcGxhdGVib2R5ICAgICAgICAgeyAgCisgIAkJCQkJCSAgYmFja2dyb3VuZDogdXJsKC4uL2ltYWdlcy9ib2R5X2dyYXBoaWMuanBnKSByZXBlYXQteDsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgLyptYXJnaW46IDQwcHggODBweCA0MHB4IDgwcHg7Ki8gIAkJCQkJCSAgIAorICAJCQkJCQl9CisKKyAgLyotLS0tLS0tLS0tLS0tLS0tLS0tLS0gR2VuZXJhbCBDb250ZW50IC0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSovCSAgCisKKyAgLnJlbGF0aXZlIHsKKyAgICBwb3NpdGlvbjpyZWxhdGl2ZTsKKyAgfQorICAKKyAgLmNsZWFyeworICAgIGNsZWFyOmJvdGg7CisgIH0gCisKKyAgLmxlZnQgeworICAgIGZsb2F0O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iAgIDdwdDsKKwkgICAgICAgICAgICAgICAgICBmb250LWFsaWduOiAganVzdGlmeTsKKwkgICAgICAgICAgICAgICAgICBmb250LXdlaWdodDogYm9sZDsKKwkgICAgICAgICAgICAgICAgICBkaXNwbGF5OiAgICAgYmxvY2s7fQorCisgICAgLmdyaWRGaWx0ZXJUZXh0ICB7aGVpZ2h0OiAgICAgMTdweDsKKwkgICAgICAgICAgICAgICAgICBmb250LXNpemU6ICA4cHQ7CisJICAgICAgICAgICAgICAgICAgd2lkdGg6ICAgICAgNjAlOworCSAgICAgICAgICAgICAgICAgIGZvbnQtYWxpZ246IGp1c3RpZnk7fQorCisgICAgLmdyaWROYXZpZ2F0aW9uQmFyIHsgZm9udC1mYW1pbHk6QXJpYWwsVmVyZGFuYTsKKwkJICAgICAgICAgICAgICAgICAgZm9udC1zaXplOjExcHg7CisJCSAgICAgICAgICAgICAgICAgIGZvbnQtd2VpZ2h0Om5vcm1hbDsKKwkJICAgICAgICAgICAgICAgICAgY29sb3I6IzAwMDsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgbWFyZ2luOiAwcHg7CisgICAgICAgICAgICAgICAgICAgICAgICAgIHdpZHRoOiAxMDAlOworICAgICAgICAgICAgICAgICAgICAgICAgICB2ZXJ0aWNhbC1hbGlnbjogbWlkZGxlOworICAgIH0KKyAgICAKKyAgICAuZ3JpZE5hdmlnYXRpb25CYXIgLm5hdkxpbmtzIHsgZmxvYXQ6IGxlZnQ7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1hcmdpbi1yaWdodDoxNXB4OworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwYWRkaW5nLXRvcDogMnB4OworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBoZWlnaHQ6ICAgICAgMTlweDsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbGluZS1oZWlnaHQ6IDE5cHg7ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KKworICAgIC5ncmlkTmF2aWdhdGlvbkJhciAucGFnZUNvbnRyb2xzICB7IGZsb2F0OiAgICAgICAgbGVmdDsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBtYXJnaW4tcmlnaHQ6IDE1cHg7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaGVpZ2h0OiAgICAgICAxOXB4OyAgCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbGluZS1oZWlnaHQ6ICAxOXB4OyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQorCisgICAgLmdyaWROYXZpZ2F0aW9uQmFyIC5wYWdlQ29udHJvbHMgaW5wdXQgeyBmb250LXNpemU6ICAgICAgOHB0OworCQkJCQkJCQkJICAgICAgICAgaGVpZ2h0OiAgICAgICAgIDE3cHg7CisJCQkJCQkJCQkgICAgICAgICB2ZXJ0aWNhbC1hbGlnbjogbWlkZGxlOyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KKworICAgIC5ncmlkTmF2aWdhdGlvbkJhciAucGFnZUluZm8geyAgZmxvYXQ6ICAgICAgICAgIHJpZ2h0OyAKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZlcnRpY2FsLWFsaWduOiBtaWRkbGU7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBoZWlnaHQ6ICAgICAgICAgMTlweDsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxpbmUtaGVpZ2h0OiAgICAxOXB4OworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQorCisgICAgLmdyaWROYXZpZ2F0aW9uQmFyIC5wYWdlSW5mbyBpbnB1dCB7IGZvbnQtc2l6ZTogICAgICA4cHQ7CisJCQkJCQkJCSAgICAgICAgIGhlaWdodDogICAgICAgICAxN3B4OworCQkJCQkJCQkgICAgICAgICB2ZXJ0aWNhbC1hbGlnbjogbWlkZGxlOyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQorCisKKyAgICAuZ3JpZE5hdmlnYXRpb25CYXIgc3BhbiB7IHBhZGRpbmc6IDNweDsgfQorCisgICAgLmdyaWROYXZpZ2F0aW9uQmFyIGEgeworCSAgdGV4dC1kZWNvcmF0aW9uOnVuZGVybGluZTsKKwkgIGNvbG9yOiMwMDA7CisJICBmb250LXdlaWdodDpub3JtYWw7CisJfQorCisgICAgLmdyaWROYXZpZ2F0aW9uQmFyIGltZyB7IHZlcnRpY2FsLWFsaWduOiBtaWRkbGU7IH0KKyAgCisgICAgLmdyaWRCdWxrVXBkYXRlUm93IHsKKyAgICAgIGhlaWdodDogMzVweDsgCisgICAgICBsaW5lLWhlaWdodDogMzVweDsKKyAgICB9IAorCisgICAgLmdyaWRCdWxrVXBkYXRlUm93IGlucHV0IHsKKyAgICAgIHZlcnRpY2FsLWFsaWduOiBtaWRkbGU7CisgICAgfSAKKworCisgICAgLyogZHVtbXkgY2xhc3MgdXNlZCB0byBsb2NrIHRoZSBmb3JtIGVsZW1lbnRzIG9mIGEgZ3JpZCAtIGV4LiBidWxrIHRyYW5zYWN0aW9uIHByb2Nlc3NpbmcgKi8KKyAgICAuYWx3YXlzRW5hYmxlZCB7fQorCisgICAgLmhpZGRlbiB7CisJICBkaXNwbGF5OiBub25lOworICAgIH0KKyAgCisgICAgLnNlbGVjdGVkUGFnZSB7CisJCWJhY2tncm91bmQtY29sb3I6I0M0REZGQjsKKwkJY29sb3I6ICAgICAgICAgIHdoaXRlOworICAgICAgICBib3JkZXItc3R5bGU6ICAgc29saWQ7CisgICAgICAgIG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yZGlvbiAudWktYWNjb3JkaW9uLWljb25zIC51aS1hY2NvcmRpb24taWNvbnMgeworCXBhZGRpbmctbGVmdDogMi4yZW07Cit9CisudWktYWNjb3JkaW9uIC51aS1hY2NvcmRpb24taGVhZGVyIC51aS1hY2NvcmRpb24taGVhZGVyLWljb24geworCXBvc2l0aW9uOiBhYnNvbHV0ZTsKKwlsZWZ0OiAuNWVtOworCXRvcDogNTAlOworCW1hcmdpbi10b3A6IC04cHg7Cit9CisudWktYWNjb3JkaW9uIC51aS1hY2NvcmRpb24tY29udGVudCB7CisJcGFkZGluZzogMWVtIDIuMmVtOworCWJvcmRlci10b3A6IDA7CisJb3ZlcmZsb3c6IGF1dG87Cit9CisudWktYXV0b2NvbXBsZXRlIHsKKwlwb3NpdGlvbjogYWJzb2x1dGU7CisJdG9wOiAwOworCWxlZnQ6IDA7CisJY3Vyc29yOiBkZWZhdWx0OworfQorLnVpLWJ1dHRvbiB7CisJZGlzcGxheTogaW5saW5lLWJsb2NrOworCXBvc2l0aW9uOiByZWxhdGl2ZTsKKwlwYWRkaW5nOiAwOworCWxpbmUtaGVpZ2h0OiBub3JtYWw7CisJbWFyZ2luLXJpZ2h0OiAuMWVtOworCWN1cnNvcjogcG9pbnRlcjsKKwl2ZXJ0aWNhbC1hbGlnbjogbWlkZGxlOworCXRleHQtYWxpZ246IGNlbnRlcjsKKwlvdmVyZmxvdzogdmlzaWJsZTsgLyogcmVtb3ZlcyBleHRyYSB3aWR0aCBpbiBJRSAqLworfQorLnVpLWJ1dHRvbiwKKy51aS1idXR0b246bGluaywKKy51aS1idXR0b246dmlzaXRlZCwKKy51aS1idXR0b246aG92ZXIsCisudWktYnV0dG9uOmFjdGl2ZSB7CisJdGV4dC1kZWNvcmF0aW9uOiBub25lOworfQorLyogdG8gbWFrZSByb29tIGZvciB0aGUgaWNvbiwgYSB3aWR0aCBuZWVkcyB0byBiZSBzZXQgaGVyZSAqLworLnVpLWJ1dHRvbi1pY29uLW9ubHkgeworCXdp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bGVmdDogMXB4OworfQorLnVpLWRhdGVwaWNrZXIgLnVpLWRhdGVwaWNrZXItbmV4dC1ob3ZlciB7CisJcmlnaHQ6IDFweDsKK30KKy51aS1kYXRlcGlja2VyIC51aS1kYXRlcGlja2VyLXByZXYgc3BhbiwKKy51aS1kYXRlcGlja2VyIC51aS1kYXRlcGlja2VyLW5leHQgc3BhbiB7CisJZGlzcGxheTogYmxvY2s7CisJcG9zaXRpb246IGFic29sdXRlOworCWxlZnQ6IDUwJTsKKwltYXJnaW4tbGVmdDogLThweDsKKwl0b3A6IDUwJTsKKwltYXJnaW4tdG9wOiAtOHB4OworfQorLnVpLWRhdGVwaWNrZXIgLnVpLWRhdGVwaWNrZXItdGl0bGUgeworCW1hcmdpbjogMCAyLjNlbTsKKwlsaW5lLWhlaWdodDogMS44ZW07CisJdGV4dC1hbGlnbjogY2VudGVyOworfQorLnVpLWRhdGVwaWNrZXIgLnVpLWRhdGVwaWNrZXItdGl0bGUgc2VsZWN0IHsKKwlmb250LXNpemU6IDFlbTsKKwltYXJnaW46IDFweCAwOworfQorLnVpLWRhdGVwaWNrZXIgc2VsZWN0LnVpLWRhdGVwaWNrZXItbW9udGgsCisudWktZGF0ZXBpY2tlciBzZWxlY3QudWktZGF0ZXBpY2tlci15ZWFyIHsKKwl3aWR0aDogNDUlOworfQorLnVpLWRhdGVwaWNrZXIgdGFibGUgeworCXdpZHRoOiAxMDAlOworCWZvbnQtc2l6ZTogLjllbTsKKwlib3JkZXItY29sbGFwc2U6IGNvbGxhcHNlOworCW1hcmdpbjogMCAwIC40ZW07Cit9CisudWktZGF0ZXBpY2tlciB0aCB7CisJcGFkZGluZzogLjdlbSAuM2VtOworCXRleHQtYWxpZ246IGNlbnRlcjsKKwlmb250LXdlaWdodDogYm9sZDsKKwlib3JkZXI6IDA7Cit9CisudWktZGF0ZXBpY2tlciB0ZCB7CisJYm9yZGVyOiAwOworCXBhZGRpbmc6IDFweDsKK30KKy51aS1kYXRlcGlja2VyIHRkI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cjogbi1yZXNpemU7CisJaGVpZ2h0OiA3cHg7CisJd2lkdGg6IDEwMCU7CisJdG9wOiAtNXB4OworCWxlZnQ6IDA7Cit9CisudWktcmVzaXphYmxlLXMgeworCWN1cnNvcjogcy1yZXNpemU7CisJaGVpZ2h0OiA3cHg7CisJd2lkdGg6IDEwMCU7CisJYm90dG9tOiAtNXB4OworCWxlZnQ6IDA7Cit9CisudWktcmVzaXphYmxlLWUgeworCWN1cnNvcjogZS1yZXNpemU7CisJd2lkdGg6IDdweDsKKwlyaWdodDogLTVweDsKKwl0b3A6IDA7CisJaGVpZ2h0OiAxMDAlOworfQorLnVpLXJlc2l6YWJsZS13IHsKKwljdXJzb3I6IHctcmVzaXplOworCXdpZHRoOiA3cHg7CisJbGVmdDogLTVweDsKKwl0b3A6IDA7CisJaGVpZ2h0OiAxMDAlOworfQorLnVpLXJlc2l6YWJsZS1zZSB7CisJY3Vyc29yOiBzZS1yZXNpemU7CisJd2lkdGg6IDEycHg7CisJaGVpZ2h0OiAxMnB4OworCXJpZ2h0OiAxcHg7CisJYm90dG9tOiAxcHg7Cit9CisudWktcmVzaXphYmxlLXN3IHsKKwljdXJzb3I6IHN3LXJlc2l6ZTsKKwl3aWR0aDogOXB4OworCWhlaWdodDogOXB4OworCWxlZnQ6IC01cHg7CisJYm90dG9tOiAtNXB4OworfQorLnVpLXJlc2l6YWJsZS1udyB7CisJY3Vyc29yOiBudy1yZXNpemU7CisJd2lkdGg6IDlweDsKKwloZWlnaHQ6IDlweDsKKwlsZWZ0OiAtNXB4OworCXRvcDogLTVweDsKK30KKy51aS1yZXNpemFibGUtbmUgeworCWN1cnNvcjogbmUtcmVzaXplOworCXdpZHRoOiA5cHg7CisJaGVpZ2h0OiA5cHg7CisJcmlnaHQ6IC01cHg7CisJdG9wOiAtNXB4OworfQorLnVpLXNlbGVjdGFibGUgeworCS1tcy10b3VjaC1hY3Rpb246IG5vbmU7CisJdG91Y2gtYWN0aW9uOiBub25lOworfQorLnVpLXNlbGVjdGFibGUtaGVscGVyIHsKKwlwb3NpdGlvbjogYWJzb2x1dGU7CisJei1pbmRleDogMTAwOworCWJvcmRlcjogMXB4IGRvdHRlZCBibGFjazsKK30KKy51aS1zZWxlY3RtZW51LW1lbnUgeworCXBhZGRpbmc6IDA7CisJbWFyZ2luOiAwOworCXBvc2l0aW9uOiBhYnNvbHV0ZTsKKwl0b3A6IDA7CisJbGVmdDogMDsKKwlkaXNwbGF5OiBub25lOworfQorLnVpLXNlbGVjdG1lbnUtbWVudSAudWktbWVudSB7CisJb3ZlcmZsb3c6IGF1dG87CisJLyogU3VwcG9ydDogSUU3ICovCisJb3ZlcmZsb3cteDogaGlkZGVuOworCXBhZGRpbmctYm90dG9tOiAxcHg7Cit9CisudWktc2VsZWN0bWVudS1tZW51IC51aS1tZW51IC51aS1zZWxlY3RtZW51LW9wdGdyb3VwIHsKKwlmb250LXNpemU6IDFlbTsKKwlmb250LXdlaWdodDogYm9sZDsKKwlsaW5lLWhlaWdodDogMS41OworCXBhZGRpbmc6IDJweCAwLjRlbTsKKwltYXJnaW46IDAuNWVtIDAgMCAwOworCWhlaWdodDogYXV0bzsKKwlib3JkZXI6IDA7Cit9CisudWktc2VsZWN0bWVudS1vcGVuIHsKKwlkaXNwbGF5OiBibG9jazsKK30KKy51aS1zZWxlY3RtZW51LWJ1dHRvbiB7CisJZGlzcGxheTogaW5saW5lLWJsb2NrOworCW92ZXJmbG93OiBoaWRkZW47CisJcG9zaXRpb246IHJlbGF0aXZlOworCXRleHQtZGVjb3JhdGlvbjogbm9uZTsKKwljdXJzb3I6IHBvaW50ZXI7Cit9CisudWktc2VsZWN0bWVudS1idXR0b24gc3Bhbi51aS1pY29uIHsKKwlyaWdodDogMC41ZW07CisJbGVmdDogYXV0bzsKKwltYXJnaW4tdG9wOiAtOHB4OworCXBvc2l0aW9uOiBhYnNvbHV0ZTsKKwl0b3A6IDUwJTsKK30KKy51aS1zZWxlY3RtZW51LWJ1dHRvbiBzcGFuLnVpLX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S42ZW07Cit9CisudWktc2xpZGVyLWhvcml6b250YWwgLnVpLXNsaWRlci1yYW5nZSB7CisJdG9wOiAwOworCWhlaWdodDogMTAwJTsKK30KKy51aS1zbGlkZXItaG9yaXpvbnRhbCAudWktc2xpZGVyLXJhbmdlLW1pbiB7CisJbGVmdDogMDsKK30KKy51aS1zbGlkZXItaG9yaXpvbnRhbCAudWktc2xpZGVyLXJhbmdlLW1heCB7CisJcmlnaHQ6IDA7Cit9CisKKy51aS1zbGlkZXItdmVydGljYWwgeworCXdpZHRoOiAuOGVtOworCWhlaWdodDogMTAwcHg7Cit9CisudWktc2xpZGVyLXZlcnRpY2FsIC51aS1zbGlkZXItaGFuZGxlIHsKKwlsZWZ0OiAtLjNlbTsKKwltYXJnaW4tbGVmdDogMDsKKwltYXJnaW4tYm90dG9tOiAtLjZlbTsKK30KKy51aS1zbGlkZXItdmVydGljYWwgLnVpLXNsaWRlci1yYW5nZSB7CisJbGVmdDogMDsKKwl3aWR0aDogMTAwJTsKK30KKy51aS1zbGlkZXItdmVydGljYWwgLnVpLXNsaWRlci1yYW5nZS1taW4geworCWJvdHRvbTogMDsKK30KKy51aS1zbGlkZXItdmVydGljYWwgLnVpLXNsaWRlci1yYW5nZS1tYXggeworCXRvcDogMDsKK30KKy51aS1zb3J0YWJsZS1oYW5kbGUgeworCS1tcy10b3VjaC1hY3Rpb246IG5vbmU7CisJdG91Y2gtYWN0aW9uOiBub25lOworfQorLnVpLXNwaW5uZXIgeworCXBvc2l0aW9uOiByZWxhdGl2ZTsKKwlkaXNwbGF5OiBpbmxpbmUtYmxvY2s7CisJb3ZlcmZsb3c6IGhpZGRlbjsKKwlwYWRkaW5nOiAwOworCXZlcnRpY2FsLWFsaWduOiBtaWRkbGU7Cit9CisudWktc3Bpbm5lci1pbnB1dCB7CisJYm9yZGVyOiBub25lOworCWJhY2tncm91bmQ6IG5vbmU7CisJY29sb3I6IGluaGVyaXQ7CisJcGFkZGluZzogMDsKKwltYXJnaW46IC4yZ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BJRSBzY3JvbGwgYnVnIChlbGVtZW50IHdpdGggcG9zaXRpb246IHJlbGF0aXZlIGluc2lkZSBjb250YWluZXIgd2l0aCBvdmVyZmxvdzogYXV0byBhcHBlYXIgYXMgImZpeGVkIikgKi8KKwlwYWRkaW5nOiAuMmVtOworfQorLnVpLXRhYnMgLnVpLXRhYnMtbmF2IHsKKwltYXJnaW46IDA7CisJcGFkZGluZzogLjJlbSAuMmVtIDA7Cit9CisudWktdGFicyAudWktdGFicy1uYXYgbGkgeworCWxpc3Qtc3R5bGU6IG5vbmU7CisJZmxvYXQ6IGxlZnQ7CisJcG9zaXRpb246IHJlbGF0aXZlOworCXRvcDogMDsKKwltYXJnaW46IDFweCAuMmVtIDAgMDsKKwlib3JkZXItYm90dG9tLXdpZHRoOiAwOworCXBhZGRpbmc6IDA7CisJd2hpdGUtc3BhY2U6IG5vd3JhcDsKK30KKy51aS10YWJzIC51aS10YWJzLW5hdiAudWktdGFicy1hbmNob3IgeworCWZsb2F0OiBsZWZ0OworCXBhZGRpbmc6IC41ZW0gMWVtOworCXRleHQtZGVjb3JhdGlvbjogbm9uZTsKK30KKy51aS10YWJzIC51aS10YWJzLW5hdiBsaS51aS10YWJzLWFjdGl2ZSB7CisJbWFyZ2luLWJvdHRvbTogLTFweDsKKwlwYWRkaW5nLWJvdHRvbTogMXB4OworfQorLnVpLXRhYnMgLnVpLXRhYnMtbmF2IGxpLnVpLXRhYnMtYWN0aXZlIC51aS10YWJzLWFuY2hvciwKKy51aS10YWJzIC51aS10YWJzLW5hdiBsaS51aS1zdGF0ZS1kaXNhYmxlZCAudWktdGFicy1hbmNob3IsCisudWktdGFicyAudWktdGFicy1uYXYgbGkudWktdGFicy1sb2FkaW5nIC51aS10YWJzLWFuY2hvciB7CisJY3Vyc29yOiB0ZXh0OworfQorLnVpLXRhYnMtY29sbGFwc2libGUgLnVpLXRhYnMtbmF2IGxpLnVpLXRhYnMtYWN0aXZlIC51aS10YWJzLWFuY2hvciB7CisJY3V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MHB4IC05NnB4OyB9CisudWktaWNvbi10cmFzaCB7IGJhY2tncm91bmQtcG9zaXRpb246IC0xNzZweCAtOTZweDsgfQorLnVpLWljb24tbG9ja2VkIHsgYmFja2dyb3VuZC1wb3NpdGlvbjogLTE5MnB4IC05NnB4OyB9CisudWktaWNvbi11bmxvY2tlZCB7IGJhY2tncm91bmQtcG9zaXRpb246IC0yMDhweCAtOTZweDsgfQorLnVpLWljb24tYm9va21hcmsgeyBiYWNrZ3JvdW5kLXBvc2l0aW9uOiAtMjI0cHggLTk2cHg7IH0KKy51aS1pY29uLXRhZyB7IGJhY2tncm91bmQtcG9zaXRpb246IC0yNDBweCAtOTZweDsgfQorLnVpLWljb24taG9tZSB7IGJhY2tncm91bmQtcG9zaXRpb246IDAgLTExMnB4OyB9CisudWktaWNvbi1mbGFnIHsgYmFja2dyb3VuZC1wb3NpdGlvbjogLTE2cHggLTExMnB4OyB9CisudWktaWNvbi1jYWxlbmRhciB7IGJhY2tncm91bmQtcG9zaXRpb246IC0zMnB4IC0xMTJweDsgfQorLnVpLWljb24tY2FydCB7IGJhY2tncm91bmQtcG9zaXRpb246IC00OHB4IC0xMTJweDsgfQorLnVpLWljb24tcGVuY2lsIHsgYmFja2dyb3VuZC1wb3NpdGlvbjogLTY0cHggLTExMnB4OyB9CisudWktaWNvbi1jbG9jayB7IGJhY2tncm91bmQtcG9zaXRpb246IC04MHB4IC0xMTJweDsgfQorLnVpLWljb24tZGlzayB7IGJhY2tncm91bmQtcG9zaXRpb246IC05NnB4IC0xMTJweDsgfQorLnVpLWljb24tY2FsY3VsYXRvciB7IGJhY2tncm91bmQtcG9zaXRpb246IC0xMTJweCAtMTEycHg7IH0KKy51aS1pY29uLXpvb21pbiB7IGJhY2tncm91bmQtcG9zaXRpb246IC0xMjhweCAtMTEycHg7IH0KKy51aS1pY29uLXpvb21vdXQgeyBiYWNrZ3JvdW5kLXBvc2l0aW9uOiAtMTQ0cHggLTExMnB4OyB9CisudWktaWNvbi1zZWF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TAwbXMgbGluZWFyOworICAtbW96LXRyYW5zaXRpb246IG9wYWNpdHkgNTAwbXMgbGluZWFyOworICAtd2Via2l0LXRyYW5zaXRpb246IG9wYWNpdHkgNTAwbXMgbGluZWFyOworCisgIHRyYW5zaXRpb24tZGVsYXk6IDUwMG1zOworICAtbW96LXRyYW5zaXRpb24tZGVsYXk6IDUwMG1zOworICAtd2Via2l0LXRyYW5zaXRpb24tZGVsYXk6IDUwMG1zOworCisgIC1tb3otYm94LXNoYWRvdzogNHB4IDRweCA4cHggcmdiYSgwLDAsMCwuNSk7CisgIC13ZWJraXQtYm94LXNoYWRvdzogNHB4IDRweCA4cHggcmdiYSgwLDAsMCwuNSk7CisgIGJveC1zaGFkb3c6IDRweCA0cHggOHB4IHJnYmEoMCwwLDAsLjUpOworCisgIC1tb3otYm9yZGVyLXJhZGl1czogMTBweDsKKyAgYm9yZGVyLXJhZGl1czogMTBweDsKKworICBwb2ludGVyLWV2ZW50czogbm9uZTsKKworICAtd2Via2l0LXRvdWNoLWNhbGxvdXQ6IG5vbmU7CisgIC13ZWJraXQtdXNlci1zZWxlY3Q6IG5vbmU7CisgIC1raHRtbC11c2VyLXNlbGVjdDogbm9uZTsKKyAgLW1vei11c2VyLXNlbGVjdDogbm9uZTsKKyAgLW1zLXVzZXItc2VsZWN0OiBub25lOworICB1c2VyLXNlbGVjdDogbm9uZTsKK30KKworLm52dG9vbHRpcCBoMyB7CisgIG1hcmdpbjogMDsKKyAgcGFkZGluZzogMDsKKyAgdGV4dC1hbGlnbjogY2VudGVyOworfQorCisubnZ0b29sdGlwIHAgeworICBtYXJnaW46IDA7CisgIHBhZGRpbmc6IDA7CisgIHRleHQtYWxpZ246IGNlbnRlcjsKK30KKworLm52dG9vbHRpcCBzcGFuIHsKKyAgZGlzcGxheTogaW5saW5lLWJsb2NrOworICBtYXJnaW46IDJweCAwOworfQorCisubnZ0b29sdGlwLXBlbmRpbmctcmVtb3ZhbCB7CisgIHBvc2l0aW9uOiBhYnNvbHV0ZTsKKyAgcG9pbnRlci1ldmVudHM6IG5vbmU7Cit9CisKKworLyoqKioqKioqKioqKioqKioqKioqCisgKiBTVkcgQ1NTCisgKi8KKworCitzdmcgeworICAtd2Via2l0LXRvdWNoLWNhbGxvdXQ6IG5vbmU7CisgIC13ZWJraXQtdXNlci1zZWxlY3Q6IG5vbmU7CisgIC1raHRtbC11c2VyLXNlbGVjdDogbm9uZTsKKyAgLW1vei11c2VyLXNlbGVjdDogbm9uZTsKKyAgLW1zLXVzZXItc2VsZWN0OiBub25lOworICB1c2VyLXNlbGVjdDogbm9uZTsKKyAgLyogVHJ5aW5nIHRvIGdldCBTVkcgdG8gYWN0IGxpa2UgYSBncmVlZHkgYmxvY2sgaW4gYWxsIGJyb3dzZXJzICovCisgIGRpc3BsYXk6IGJsb2NrOworICB3aWR0aDoxMDAlOworICBoZWlnaHQ6MTAwJTsKK30KKworCitzdmcgdGV4dCB7CisgIGZvbnQ6IG5vcm1hbCAxMnB4IEFyaWFsOworfQorCitzdmcgLnRpdGxlIHsKKyBmb250OiBib2xkIDE0cHggQXJpYWw7Cit9CisKKy5udmQzIC5udi1iYWNrZ3JvdW5kIHsKKyAgZmlsbDogd2hpdGU7CisgIGZpbGwtb3BhY2l0eTogMDsKKyAgLyoKKyAgcG9pbnRlci1ldmVudHM6IG5vbmU7CisgICovCit9CisKKy5udmQzLm52LW5vRGF0YSB7CisgIGZvbnQtc2l6ZTogMThweDsKKyAgZm9udC13ZWlnaHQ6IGJvbGY7Cit9CisKKworLyoqKioqKioqKioKKyogIEJydXNoCisqLworCisubnYtYnJ1c2ggLmV4dGVudCB7CisgIGZpbGwtb3BhY2l0eTogLjEyNTsKKyAgc2hhcGUtcmVuZGVyaW5nOiBjcmlzcEVkZ2VzOworfQorCisKKworLyoqKioqKioqKioKKyogIExlZ2VuZAorKi8KKworLm52ZDMgLm52LWxlZ2VuZCAubnYtc2VyaWVzIHsKKyAgY3Vyc29yOiBwb2ludGVyOworfQorCisubnZkMyAubnYtbGVnZW5kIC5kaXNhYmxlZCBjaXJjbGUgeworICBmaWxsLW9wYWNpdHk6IDA7Cit9CisKKworCisvKioqKioqKioqKgorKiAgQXhlcworKi8KKworLm52ZDMgLm52LWF4aXMgcGF0aCB7CisgIGZpbGw6IG5vbmU7CisgIHN0cm9rZTogIzAwMDsKKyAgc3Ryb2tlLW9wYWNpdHk6IC43NTsKKyAgc2hhcGUtcmVuZGVyaW5nOiBjcmlzcEVkZ2VzOworfQorCisubnZkMyAubnYtYXhpcyBwYXRoLmRvbWFpbiB7CisgIHN0cm9rZS1vcGFjaXR5OiAuNzU7Cit9CisKKy5udmQzIC5udi1heGlzLm52LXggcGF0aC5kb21haW4geworICBzdHJva2Utb3BhY2l0eTogMDsKK30KKworLm52ZDMgLm52LWF4aXMgbGluZSB7CisgIGZpbGw6IG5vbmU7CisgIHN0cm9rZTogIzAwMDsKKyAgc3Ryb2tlLW9wYWNpdHk6IC4yNTsKKyAgc2hhcGUtcmVuZGVyaW5nOiBjcmlzcEVkZ2VzOworfQorCisubnZkMyAubnYtYXhpcyBsaW5lLnplcm8geworICBzdHJva2Utb3BhY2l0eTogLjc1OworfQorCisubnZkMyAubnYtYXhpcyAubnYtYXhpc01heE1pbiB0ZXh0IHsKKyAgZm9udC13ZWlnaHQ6IGJvbGQ7Cit9CisKKy5udmQzIC54ICAubnYtYXhpcyAubnYtYXhpc01heE1pbiB0ZXh0LAorLm52ZDMgLngyIC5udi1heGlzIC5udi1heGlzTWF4TWluIHRleHQsCisubnZkMyAueDMgLm52LWF4aXMgLm52LWF4aXNNYXhNaW4gdGV4dCB7CisgIHRleHQtYW5jaG9yOiBtaWRkbGUKK30KKworCisKKy8qKioqKioqKioqCisqICBCcnVzaAorKi8KKworLm52LWJydXNoIC5yZXNpemUgcGF0aCB7CisgIGZpbGw6ICNlZWU7CisgIHN0cm9rZTogIzY2NjsKK30KKworCisKKy8qKioqKioqKioqCisqICBCYXJzCisqLworCisubnZkMyAubnYtYmFycyA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ZS1vcGFjaXR5OiAxOworfQorCisubnZkMy5udi1waWUgLmhvdmVyIHBhdGggeworICBmaWxsLW9wYWNpdHk6IC43OworLyoKKyAgc3Ryb2tlLXdpZHRoOiA2cHg7CisgIHN0cm9rZS1vcGFjaXR5OiAxOworKi8KK30KKworLm52ZDMubnYtcGllIC5udi1sYWJlbCByZWN0IHsKKyAgZmlsbC1vcGFjaXR5OiAwOworICBzdHJva2Utb3BhY2l0eTogMDsKK30KKworLyoqKioqKioqKioKKyogTGluZXMKKyovCisKKy5udmQzIC5udi1ncm91cHMgcGF0aC5udi1saW5lIHsKKyAgZmlsbDogbm9uZTsKKyAgc3Ryb2tlLXdpZHRoOiAyLjVweDsKKyAgLyoKKyAgc3Ryb2tlLWxpbmVjYXA6IHJvdW5kOworICBzaGFwZS1yZW5kZXJpbmc6IGdlb21ldHJpY1ByZWNpc2lvbjsKKworICB0cmFuc2l0aW9uOiBzdHJva2Utd2lkdGggMjUwbXMgbGluZWFyOworICAtbW96LXRyYW5zaXRpb246IHN0cm9rZS13aWR0aCAyNTBtcyBsaW5lYXI7CisgIC13ZWJraXQtdHJhbnNpdGlvbjogc3Ryb2tlLXdpZHRoIDI1MG1zIGxpbmVhcjsKKworICB0cmFuc2l0aW9uLWRlbGF5OiAyNTBtcworICAtbW96LXRyYW5zaXRpb24tZGVsYXk6IDI1MG1zOworICAtd2Via2l0LXRyYW5zaXRpb24tZGVsYXk6IDI1MG1zOworICAqLworfQorCisubnZkMyAubnYtZ3JvdXBzIHBhdGgubnYtYXJlYSB7CisgIHN0cm9rZTogbm9uZTsKKyAgLyoKKyAgc3Ryb2tlLWxpbmVjYXA6IHJvdW5kOworICBzaGFwZS1yZW5kZXJpbmc6IGdlb21ldHJpY1ByZWNpc2lvbjsKKworICBzdHJva2Utd2lkdGg6IDIuNXB4OworICB0cmFuc2l0aW9uOiBzdHJva2Utd2lkdGggMjUwbXMgbGluZWFyOworICAtbW96LXRyYW5zaXRpb246IHN0cm9rZS13aWR0aC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GVyIC5udi1ncm91cHMgLm52LXBvaW50LmhvdmVyLAorLm52ZDMgLm52LWdyb3VwcyAubnYtcG9pbnQuaG92ZXIgeworICBzdHJva2Utd2lkdGg6IDIwcHg7CisgIGZpbGwtb3BhY2l0eTogLjUgIWltcG9ydGFudDsKKyAgc3Ryb2tlLW9wYWNpdHk6IC41ICFpbXBvcnRhbnQ7Cit9CisKKworLm52ZDMgLm52LXBvaW50LXBhdGhzIHBhdGggeworICBzdHJva2U6ICNhYWE7CisgIHN0cm9rZS1vcGFjaXR5OiAwOworICBmaWxsOiAjZWVlOworICBmaWxsLW9wYWNpdHk6IDA7Cit9CisKKworCisubnZkMyAubnYtaW5kZXhMaW5lIHsKKyAgY3Vyc29yOiBldy1yZXNpemU7Cit9CisKKworLyoqKioqKioqKioKKyogRGlzdHJpYnV0aW9uCisqLworCisubnZkMyAubnYtZGlzdHJpYnV0aW9uIHsKKyAgcG9pbnRlci1ldmVudHM6IG5vbmU7Cit9CisKKworCisvKioqKioqKioqKgorKiAgU2NhdHRlcgorKi8KKworLyogKipBdHRlbXB0aW5nIHRvIHJlbW92ZSB0aGlzIGZvciB1c2VWb3Jvbm9pKGZhbHNlKSwgbmVlZCB0byBzZWUgaWYgaXQncyByZXF1aXJlZCBhbnl3aGVyZQorLm52ZDMgLm52LWdyb3VwcyAubnYtcG9pbnQgeworICBwb2ludGVyLWV2ZW50czogbm9uZTsKK30KKyovCisKKy5udmQzIC5udi1ncm91cHMgLm52LXBvaW50LmhvdmVyIHsKKyAgc3Ryb2tlLXdpZHRoOiAyMHB4OworICBzdHJva2Utb3BhY2l0eTogLjU7Cit9CisKKy5udmQzIC5udi1zY2F0dGVyIC5udi1wb2ludC5ob3ZlciB7CisgIGZpbGwtb3BhY2l0eTogMTsKK30KKworLyoKKy5udi1ncm91cC5ob3ZlciAubnYtcG9pbnQgeworICBmaWxsLW9wYWNpdHk6IDE7Cit9CisqLworCisKKy8qKioqKioqKioqCisqICBTdGFja2VkIEFyZWEKKy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ib2xkOyB9CisubnZkMy5udi1idWxsZXQgLm52LXN1YnRpdGxlIHsgZmlsbDogIzk5OTsgfQorCisKKy5udmQzLm52LWJ1bGxldCAubnYtcmFuZ2UgeworICBmaWxsOiAjOTk5OworICBmaWxsLW9wYWNpdHk6IC40OworfQorLm52ZDMubnYtYnVsbGV0IC5udi1yYW5nZTpob3ZlciB7CisgIGZpbGwtb3BhY2l0eTogLjc7Cit9CisKKworCisvKioqKioqKioqKgorKiBTcGFya2xpbmUKKyovCisKKy5udmQzLm52LXNwYXJrbGluZSBwYXRoIHsKKyAgZmlsbDogbm9uZTsKK30KKworLm52ZDMubnYtc3BhcmtsaW5lcGx1cyBnLm52LWhvdmVyVmFsdWUgeworICBwb2ludGVyLWV2ZW50czogbm9uZTsKK30KKworLm52ZDMubnYtc3BhcmtsaW5lcGx1cyAubnYtaG92ZXJWYWx1ZSBsaW5lIHsKKyAgc3Ryb2tlOiAjMzMzOworICBzdHJva2Utd2lkdGg6IDEuNXB4OworIH0KKworLm52ZDMubnYtc3BhcmtsaW5lcGx1cywKKy5udmQzLm52LXNwYXJrbGluZXBsdXMgZyB7CisgIHBvaW50ZXItZXZlbnRzOiBhbGw7Cit9CisKKy5udmQzIC5udi1ob3ZlckFyZWEgeworICBmaWxsLW9wYWNpdHk6IDA7CisgIHN0cm9rZS1vcGFjaXR5OiAwOworfQorCisubnZkMy5udi1zcGFya2xpbmVwbHVzIC5udi14VmFsdWUsCisubnZkMy5udi1zcGFya2xpbmVwbHVzIC5udi15VmFsdWUgeworICAvKgorICBzdHJva2U6ICM2NjY7CisgICovCisgIHN0cm9rZS13aWR0aDogMDsKKyAgZm9udC1zaXplOiAuOWVtOworICBmb250LXdlaWdodDogbm9ybWFsOworfQorCisubnZkMy5udi1zcGFya2xpbmVwbHVzIC5udi15VmFsdWUgeworICBzdHJva2U6ICNmNjY7Cit9CisKKy5udmQzLm52LXNwYXJrbGluZXBsdXMgLm52LW1heFZhbHVlIHsKKyAgc3Ryb2tlOiAjMmNhMDJjOworICBmaWxsOiAjMmNhMDJjOworfQorCisubnZkMy5udi1zcGFya2xpbmVwbHVzIC5udi1taW5WYWx1ZSB7CisgIHN0cm9rZTogI2Q2MjcyODsKKyAgZmlsbDogI2Q2MjcyODsKK30KKworLm52ZDMubnYtc3BhcmtsaW5lcGx1cyAubnYtY3VycmVudFZhbHVlIHsKKyAgLyoKKyAgc3Ryb2tlOiAjNDQ0OworICBmaWxsOiAjMDAwOworICAqLworICBmb250LXdlaWdodDogYm9sZDsKKyAgZm9udC1zaXplOiAxLjFlbTsKK30KKworLyoqKioqKioqKioKKyogaGlzdG9yaWNhbCBzdG9jaworKi8KKworLm52ZDMubnYtb2hsY0JhciAubnYtdGlja3MgLm52LXRpY2sgeworICBzdHJva2Utd2lkdGg6IDJweDsKK30KKworLm52ZDMubnYtb2hsY0JhciAubnYtdGlja3MgLm52LXRpY2suaG92ZXIgeworICBzdHJva2Utd2lkdGg6IDRweDsKK30KKworLm52ZDMubnYtb2hsY0JhciAubnYtdGlja3MgLm52LXRpY2sucG9zaXRpdmUgeworIHN0cm9rZTogIzJjYTAyYzsKK30KKworLm52ZDMubnYtb2hsY0JhciAubnYtdGlja3MgLm52LXRpY2submVnYXRpdmUgeworIHN0cm9rZTogI2Q2MjcyODsKK30KKworLm52ZDMubnYtaGlzdG9yaWNhbFN0b2NrQ2hhcnQgLm52LWF4aXMgLm52LWF4aXNsYWJlbCB7CisgIGZvbnQtd2VpZ2h0OiBib2xkOworfQorCisubnZkMy5udi1oaXN0b3JpY2FsU3RvY2tDaGFydCAubnYtZHJhZ1RhcmdldCB7CisgIGZpbGwtb3BhY2l0eTogMDsKKyAgc3Ryb2tlOiBub25lOworICBjdXJzb3I6IG1vdmU7Cit9CisKKy5udmQzIC5udi1icnVzaCAuZXh0ZW50IHsKKyAgLyoKKyAgY3Vyc29yOiBldy1yZXNpemUgIWltcG9ydGFudDsKKyAgKi8KKyAgZmlsbC1vcGFjaXR5OiAwICFpbXBvcnRhbn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sLmEsIGwuYikpKQorICAgICAgICA6IGxjaCgrbCwgK2MsICtoKTsKKyAgfTsKKworICBjaWUuaW50ZXJwb2xhdGVMYWIgPSBmdW5jdGlvbihhLCBiKSB7CisgICAgYSA9IGNpZS5sYWIoYSk7CisgICAgYiA9IGNpZS5sYWIoYik7CisgICAgdmFyIGFsID0gYS5sLAorICAgICAgICBhYSA9IGEuYSwKKyAgICAgICAgYWIgPSBhLmIsCisgICAgICAgIGJsID0gYi5sIC0gYWwsCisgICAgICAgIGJhID0gYi5hIC0gYWEsCisgICAgICAgIGJiID0gYi5iIC0gYWI7CisgICAgcmV0dXJuIGZ1bmN0aW9uKHQpIHsKKyAgICAgIHJldHVybiBsYWJfcmdiKGFsICsgYmwgKiB0LCBhYSArIGJhICogdCwgYWIgKyBiYiAqIHQpICsgIiI7CisgICAgfTsKKyAgfTsKKworICBjaWUuaW50ZXJwb2xhdGVMY2ggPSBmdW5jdGlvbihhLCBiKSB7CisgICAgYSA9IGNpZS5sY2goYSk7CisgICAgYiA9IGNpZS5sY2goYik7CisgICAgdmFyIGFsID0gYS5sLAorICAgICAgICBhYyA9IGEuYywKKyAgICAgICAgYWggPSBhLmgsCisgICAgICAgIGJsID0gYi5sIC0gYWwsCisgICAgICAgIGJjID0gYi5jIC0gYWMsCisgICAgICAgIGJoID0gYi5oIC0gYWg7CisgICAgaWYgKGJoID4gMTgwKSBiaCAtPSAzNjA7IGVsc2UgaWYgKGJoIDwgLTE4MCkgYmggKz0gMzYwOyAvLyBzaG9ydGVzdCBwYXRoCisgICAgcmV0dXJuIGZ1bmN0aW9uKHQpIHsKKyAgICAgIHJldHVybiBsY2hfbGFiKGFsICsgYmwgKiB0LCBhYyArIGJjICogdCwgYWggKyBiaCAqIHQpICsgIiI7CisgICAgfTsKKyAgfTsKKworICBmdW5jdGlvbiBsYWIobCwgYSwgYikgeworICAgIHJldHVybiBuZXcgTGFiKGwsIGEsIGIpOworICB9CisKKyAgZnVuY3Rpb24gTGFiKGwsIGEsIGIpIHsKKyAgICB0aGlzLmwgPSBsOworICAgIHRoaXMuYSA9IGE7CisgICAgdGhpcy5iID0gYjsKKyAgfQorCisgIExhYi5wcm90b3R5cGUuYnJpZ2h0ZXIgPSBmdW5jdGlvbihrKSB7CisgICAgcmV0dXJuIGxhYihNYXRoLm1pbigxMDAsIHRoaXMubCArIEsgKiAoYXJndW1lbnRzLmxlbmd0aCA/IGsgOiAxKSksIHRoaXMuYSwgdGhpcy5iKTsKKyAgfTsKKworICBMYWIucHJvdG90eXBlLmRhcmtlciA9IGZ1bmN0aW9uKGspIHsKKyAgICByZXR1cm4gbGFiKE1hdGgubWF4KDAsIHRoaXMubCAtIEsgKiAoYXJndW1lbnRzLmxlbmd0aCA/IGsgOiAxKSksIHRoaXMuYSwgdGhpcy5iKTsKKyAgfTsKKworICBMYWIucHJvdG90eXBlLnJnYiA9IGZ1bmN0aW9uKCkgeworICAgIHJldHVybiBsYWJfcmdiKHRoaXMubCwgdGhpcy5hLCB0aGlzLmIpOworICB9OworCisgIExhYi5wcm90b3R5cGUudG9TdHJpbmcgPSBmdW5jdGlvbigpIHsKKyAgICByZXR1cm4gdGhpcy5yZ2IoKSArICIiOworICB9OworCisgIGZ1bmN0aW9uIGxjaChsLCBjLCBoKSB7CisgICAgcmV0dXJuIG5ldyBMY2gobCwgYywgaCk7CisgIH0KKworICBmdW5jdGlvbiBMY2gobCwgYywgaCkgeworICAgIHRoaXMubCA9IGw7CisgICAgdGhpcy5jID0gYzsKKyAgICB0aGlzLmggPSBoOworICB9CisKKyAgTGNoLnByb3RvdHlwZS5icmlnaHRlciA9IGZ1bmN0aW9uKGspIHsKKyAgICByZXR1cm4gbGNoKE1hdGgubWluKDEwMCwgdGhpcy5sICsgSyAqIChhcmd1bWVudHMubGVuZ3RoID8gayA6IDEpKSwgdGhpcy5jLCB0aGlzLmgpOworICB9OworCisgIExjaC5wcm90b3R5cGUuZGFya2VyID0gZnVuY3Rpb24oaykgeworICAgIHJldHVybiBsY2goT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BnID0gcmdiX3h5eihnKTsKKyAgICBiID0gcmdiX3h5eihiKTsKKyAgICB2YXIgeCA9IHh5el9sYWIoKDAuNDEyNDU2NCAqIHIgKyAwLjM1NzU3NjEgKiBnICsgMC4xODA0Mzc1ICogYikgLyBYKSwKKyAgICAgICAgeSA9IHh5el9sYWIoKDAuMjEyNjcyOSAqIHIgKyAwLjcxNTE1MjIgKiBnICsgMC4wNzIxNzUwICogYikgLyBZKSwKKyAgICAgICAgeiA9IHh5el9sYWIoKDAuMDE5MzMzOSAqIHIgKyAwLjExOTE5MjAgKiBnICsgMC45NTAzMDQxICogYikgLyBaKTsKKyAgICByZXR1cm4gbGFiKDExNiAqIHkgLSAxNiwgNTAwICogKHggLSB5KSwgMjAwICogKHkgLSB6KSk7CisgIH0KKworICBmdW5jdGlvbiBsYWJfbGNoKGwsIGEsIGIpIHsKKyAgICB2YXIgYyA9IE1hdGguc3FydChhICogYSArIGIgKiBiKSwKKyAgICAgICAgaCA9IE1hdGguYXRhbjIoYiwgYSkgLyBNYXRoLlBJICogMTgwOworICAgIHJldHVybiBsY2gobCwgYywgaCk7CisgIH0KKworICBmdW5jdGlvbiBsY2hfbGFiKGwsIGMsIGgpIHsKKyAgICBoID0gaCAqIE1hdGguUEkgLyAxODA7CisgICAgcmV0dXJuIGxhYihsLCBNYXRoLmNvcyhoKSAqIGMsIE1hdGguc2luKGgpICogYyk7CisgIH0KKworICBmdW5jdGlvbiBsYWJfeHl6KHgpIHsKKyAgICByZXR1cm4geCA+IDAuMjA2ODkzMDM0ID8geCAqIHggKiB4IDogKHggLSA0IC8gMjkpIC8gNy43ODcwMzc7CisgIH0KKworICBmdW5jdGlvbiB4eXpfbGFiKHgpIHsKKyAgICByZXR1cm4geCA+IDAuMDA4ODU2ID8gTWF0aC5wb3coeCwgMSAvIDMpIDogNy43ODcwMzcgKiB4ICsgNCAvIDI5OworICB9CisKKyAgZnVuY3Rpb24geHl6X3JnYihyKSB7CisgICAgcmV0dXJuIE1hdGguc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vbi9kMy9qcy9jb3JlLmpzCkBAIC0wLDAgKzEsMTIyIEBACisKK3ZhciBudiA9IHdpbmRvdy5udiB8fCB7fTsKKworCitudi52ZXJzaW9uID0gJzEuMS4xM2InOworbnYuZGV2ID0gdHJ1ZSAvL3NldCBmYWxzZSB3aGVuIGluIHByb2R1Y3Rpb24KKword2luZG93Lm52ID0gbnY7CisKK252LnRvb2x0aXAgPSB7fTsgLy8gRm9yIHRoZSB0b29sdGlwIHN5c3RlbQorbnYudXRpbHMgPSBudi51dGlscyB8fCB7fTsgLy8gVXRpbGl0eSBzdWJzeXN0ZW0KK252Lm1vZGVscyA9IHt9OyAvL3N0b3JlcyBhbGwgdGhlIHBvc3NpYmxlIG1vZGVscy9jb21wb25lbnRzCitudi5jaGFydHMgPSB7fTsgLy9zdG9yZXMgYWxsIHRoZSByZWFkeSB0byB1c2UgY2hhcnRzCitudi5ncmFwaHMgPSBbXTsgLy9zdG9yZXMgYWxsIHRoZSBncmFwaHMgY3VycmVudGx5IG9uIHRoZSBwYWdlCitudi5sb2dzID0ge307IC8vc3RvcmVzIHNvbWUgc3RhdGlzdGljcyBhbmQgcG90ZW50aWFsIGVycm9yIG1lc3NhZ2VzCisKK252LmRpc3BhdGNoID0gZDMuZGlzcGF0Y2goJ3JlbmRlcl9zdGFydCcsICdyZW5kZXJfZW5kJyk7CisKKy8vICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKKy8vICBEZXZlbG9wbWVudCByZW5kZXIgdGltZXJzIC0gZGlzYWJsZWQgaWYgZGV2ID0gZmFsc2UKKworaWYgKG52LmRldikgeworICBudi5kaXNwYXRjaC5vbigncmVuZGVyX3N0YXJ0JywgZnVuY3Rpb24oZSkgeworICAgIG52LmxvZ3Muc3RhcnRUaW1lID0gK25ldyBEYXRlKCk7CisgIH0pOworCisgIG52LmRpc3BhdGNoLm9uKCdyZW5kZXJfZW5kJywgZnVuY3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lwZW9mIGFyZ3VtZW50c1swXSA9PT0gdHlwZW9mKEZ1bmN0aW9uKSkKKyAgICBvYmogPSB7Z2VuZXJhdGU6IGFyZ3VtZW50c1swXSwgY2FsbGJhY2s6IGFyZ3VtZW50c1sxXX07CisKKyAgbnYucmVuZGVyLnF1ZXVlLnB1c2gob2JqKTsKKworICBpZiAoIW52LnJlbmRlci5hY3RpdmUpIG52LnJlbmRlcigpOworfTsKKworbnYuaWRlbnRpdHkgPSBmdW5jdGlvbihkKSB7IHJldHVybiBkOyB9OworCitudi5zdHJpcCA9IGZ1bmN0aW9uKHMpIHsgcmV0dXJuIHMucmVwbGFjZSgvKFxzfCYpL2csJycpOyB9OworCitmdW5jdGlvbiBkYXlzSW5Nb250aChtb250aCx5ZWFyKSB7CisgIHJldHVybiAobmV3IERhdGUoeWVhciwgbW9udGgrMSwgMCkpLmdldERhdGUoKTsKK30KKworZnVuY3Rpb24gZDNfdGltZV9yYW5nZShmbG9vciwgc3RlcCwgbnVtYmVyKSB7CisgIHJldHVybiBmdW5jdGlvbih0MCwgdDEsIGR0KSB7CisgICAgdmFyIHRpbWUgPSBmbG9vcih0MCksIHRpbWVzID0gW107CisgICAgaWYgKHRpbWUgPCB0MCkgc3RlcCh0aW1lKTsKKyAgICBpZiAoZHQgPiAxKSB7CisgICAgICB3aGlsZSAodGltZSA8IHQxKSB7CisgICAgICAgIHZhciBkYXRlID0gbmV3IERhdGUoK3RpbWUpOworICAgICAgICBpZiAoKG51bWJlcihkYXRlKSAlIGR0ID09PSAwKSkgdGltZXMucHVzaChkYXRlKTsKKyAgICAgICAgc3RlcCh0aW1lKTsKKyAgICAgIH0KKyAgICB9IGVsc2UgeworICAgICAgd2hpbGUgKHRpbWUgPCB0MSkgeyB0aW1lcy5wdXNoKG5ldyBEYXRlKCt0aW1lKSk7IHN0ZXAodGltZSk7IH0KKyAgICB9CisgICAgcmV0dXJuIHRpbWVzOworICB9OworfQorCitkMy50aW1lLm1vbnRoRW5kID0gZnVuY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VtrXSwgeGsgPSBmKGVrKTsKKyAgICAgICAgaWYgKHhrIDwgcGl2b3RWYWx1ZTEpIHsKKyAgICAgICAgICBpZiAoayAhPT0gbGVzcykgeworICAgICAgICAgICAgYVtrXSA9IGFbbGVzc107CisgICAgICAgICAgICBhW2xlc3NdID0gZWs7CisgICAgICAgICAgfQorICAgICAgICAgICsrbGVzczsKKyAgICAgICAgfSBlbHNlIGlmICh4ayA+IHBpdm90VmFsdWUxKSB7CisKKyAgICAgICAgICAvLyBGaW5kIHRoZSBmaXJzdCBlbGVtZW50IDw9IHBpdm90IGluIHRoZSByYW5nZSBbayAtIDEsIGdyZWF0XSBhbmQKKyAgICAgICAgICAvLyBwdXQgWzplazpdIHRoZXJlLiBXZSBrbm93IHRoYXQgc3VjaCBhbiBlbGVtZW50IG11c3QgZXhpc3Q6CisgICAgICAgICAgLy8gV2hlbiBrID09IGxlc3MsIHRoZW4gZWwzICh3aGljaCBpcyBlcXVhbCB0byBwaXZvdCkgbGllcyBpbiB0aGUKKyAgICAgICAgICAvLyBpbnRlcnZhbC4gT3RoZXJ3aXNlIGFbayAtIDFdID09IHBpdm90IGFuZCB0aGUgc2VhcmNoIHN0b3BzIGF0IGstMS4KKyAgICAgICAgICAvLyBOb3RlIHRoYXQgaW4gdGhlIGxhdHRlciBjYXNlIGludmFyaWFudCAyIHdpbGwgYmUgdmlvbGF0ZWQgZm9yIGEKKyAgICAgICAgICAvLyBzaG9ydCBhbW91bnQgb2YgdGltZS4gVGhlIGludmFyaWFudCB3aWxsIGJlIHJlc3RvcmVkIHdoZW4gdGhlCisgICAgICAgICAgLy8gcGl2b3RzIGFyZSBwdXQgaW50byB0aGVpciBmaW5hbCBwb3NpdGlvbnMuCisgICAgICAgICAgd2hpbGUgKHRydWUpIHsKKyAgICAgICAgICAgIHZhciBncmVhdFZhbHVlID0gZihhW2dyZWF0XSk7CisgICAgICAgICAgICBpZiAoZ3JlYXRWYWx1ZSA+IHBpdm90VmFsdWUxKSB7CisgICAgICAgICAgICAgIGdyZWF0LS07CisgICAgICAgICAgICAgIC8vIFRoaXMgaXMgdGhlIG9ubHkgbG9jYXRpb24gaW4gdGhlIHdoaWxlLWxvb3Agd2hlcmUgYSBuZXcKKyAgICAgICAgICAgICAgLy8gaXRlcmF0aW9uIGlzIHN0YXJ0ZWQuCisgICAgICAgICAgICAgIGNvbnRpbnVlOworICAgICAgICAgICAgfSBlbHNlIGlmIChncmVhdFZhbHVlIDwgcGl2b3RWYWx1ZTEpIHsKKyAgICAgICAgICAgICAgLy8gVHJpcGxlIGV4Y2hhbmdlLgorICAgICAgICAgICAgICBhW2tdID0gYVtsZXNzXTsKKyAgICAgICAgICAgICAgYVtsZXNzKytdID0gYVtncmVhdF07CisgICAgICAgICAgICAgIGFbZ3JlYXQtLV0gPSBlazsKKyAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgICBhW2tdID0gYVtncmVhdF07CisgICAgICAgICAgICAgIGFbZ3JlYXQtLV0gPSBlazsKKyAgICAgICAgICAgICAgLy8gTm90ZTogaWYgZ3JlYXQgPCBrIHRoZW4gd2Ugd2lsbCBleGl0IHRoZSBvdXRlciBsb29wIGFuZCBmaXgKKyAgICAgICAgICAgICAgLy8gaW52YXJpYW50IDIgKHdoaWNoIHdlIGp1c3QgdmlvbGF0ZWQpLgorICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICB9CisgICAgICAgIH0KKyAgICAgIH0KKyAgICB9IGVsc2UgeworCisgICAgICAvLyBXZSBwYXJ0aXRpb24gdGhlIGxpc3QgaW50byB0aHJlZSBwYXJ0czoKKyAgICAgIC8vICAxLiA8IHBpdm90MQorICAgICAgLy8gIDIuID49IHBpdm90MSAmJiA8PSBwaXZvdDIKKyAgICAgIC8vICAzLiA+IHBpdm90MgorICAgICAgLy8KKyAgICAgIC8vIER1cmluZyB0aGUgbG9vcCB3ZSBoYXZlOgorICAgICAgLy8gWyB8IDwgcGl2b3QxIHwgPj0gcGl2b3QxICYmIDw9IHBpdm90MiB8IHVucGFydGl0aW9uZWQgIHwgPiBwaXZvdDIgIHwgXQorICAgICAgLy8gIF4gICAgICAgICAgICBeICAgICAgICAgICAgICAgICAgICAgICAgXiAgICAgICAgICAgICAgXiAgICAgICAgICAgICBeCisgICAgICAvLyBsZWZ0ICAgICAgICAgbGVzcyAgICAgICAgICAgICAgICAgICAgIGsgICAgICAgICAgICAgIGdyZWF0ICAgICAgICByaWdodAorICAgICAgLy8KKyAgICAgIC8vIGFbbGVmdF0gYW5kIGFbcmlnaHRdIGFyZSB1bmRlZmluZWQgYW5kIGFyZSBmaWxsZWQgYWZ0ZXIgdGhlCisgICAgICAvLyBwYXJ0aXRpb25pbmcuCisgICAgICAvLworICAgICAgLy8gSW52YXJpYW50czoKKyAgICAgIC8vICAgMS4gZm9yIHggaW4gXWxlZnQsIGxlc3NbIDogeCA8IHBpdm90MQorICAgICAgLy8gICAyLiBmb3IgeCBpbiBbbGVzcywga1sgOiBwaXZvdDEgPD0geCAmJiB4IDw9IHBpdm90MgorICAgICAgLy8gICAzLiBmb3IgeCBpbiBdZ3JlYXQsIHJpZ2h0WyA6IHggPiBwaXZvdDIKKyAgICAgIGZvciAodmFyIGsgPSBsZXNzOyBrIDw9IGdyZWF0OyBrKyspIHsKKyAgICAgICAgdmFyIGVrID0gYVtrXSwgeGsgPSBmKGVrKTsKKyAgICAgICAgaWYgKHhrIDwgcGl2b3RWYWx1ZTEpIHsKKyAgICAgICAgICBpZiAoayAhPT0gbGVzcykgeworICAgICAgICAgICAgYVtrXSA9IGFbbGVzc107CisgICAgICAgICAgICBhW2xlc3NdID0gZWs7CisgICAgICAgICAgfQorICAgICAgICAgICsrbGVzczsKKyAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICBpZiAoeGsgPiBwaXZvdFZhbHVlMikgeworICAgICAgICAgICAgd2hpbGUgKHRydWUpIHsKKyAgICAgICAgICAgICAgdmFyIGdyZWF0VmFsdWUgPSBmKGFbZ3JlYXRdKTsKKyAgICAgICAgICAgICAgaWYgKGdyZWF0VmFsdWUgPiBwaXZvdFZhbHVlMikgeworICAgICAgICAgICAgICAgIGdyZWF0LS07CisgICAgICAgICAgICAgICAgaWYgKGdyZWF0IDwgaykgYnJlYWs7CisgICAgICAgICAgICAgICAgLy8gVGhpcyBpcyB0aGUgb25seSBsb2NhdGlvbiBpbnNpZGUgdGhlIGxvb3Agd2hlcmUgYSBuZXcKKyAgICAgICAgICAgICAgICAvLyBpdGVyYXRpb24gaXMgc3RhcnRlZC4KKyAgICAgICAgICAgICAgICBjb250aW51ZTsKKyAgICAgICAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgICAgICAvLyBhW2dyZWF0XSA8PSBwaXZvdDIuCisgICAgICAgICAgICAgICAgaWYgKGdyZWF0VmFsdWUgPCBwaXZvdFZhbHVlMSkgeworICAgICAgICAgICAgICAgICAgLy8gVHJpcGxlIGV4Y2hhbmdlLgorICAgICAgICAgICAgICAgICAgYVtrXSA9IGFbbGVzc107CisgICAgICAgICAgICAgICAgICBhW2xlc3MrK10gPSBhW2dyZWF0XTsKKyAgICAgICAgICAgICAgICAgIGFbZ3JlYXQtLV0gPSBlazsKKyAgICAgICAgICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgICAgICAgLy8gYVtncmVhdF0gPj0gcGl2b3QxLgorICAgICAgICAgICAgICAgICAgYVtrXSA9IGFbZ3JlYXRdOworICAgICAgICAgICAgICAgICAgYVtncmVhdC0tXSA9IGVrOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfQorICAgICAgICAgIH0KKyAgICAgICAgfQorICAgICAgfQorICAgIH0KKworICAgIC8vIE1vdmUgcGl2b3RzIGludG8gdGhlaXIgZmluYWwgcG9zaXRpb25zLgorICAgIC8vIFdlIHNocnVuayB0aGUgbGlzdCBmcm9tIGJvdGggc2lkZ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dm90MiB8IHVucGFydGl0aW9uZWQgIHwgPT0gcGl2b3QyIF0KKyAgICAgIC8vICAgICAgICAgICAgICBeICAgICAgICAgICAgICAgICAgICAgIF4gICAgICAgICAgICAgIF4KKyAgICAgIC8vICAgICAgICAgICAgbGVzcyAgICAgICAgICAgICAgICAgICAgIGsgICAgICAgICAgICAgIGdyZWF0CisgICAgICAvLworICAgICAgLy8gSW52YXJpYW50czoKKyAgICAgIC8vICAgMS4gZm9yIHggaW4gWyAqLCBsZXNzWyA6IHggPT0gcGl2b3QxCisgICAgICAvLyAgIDIuIGZvciB4IGluIFtsZXNzLCBrWyA6IHBpdm90MSA8IHggJiYgeCA8IHBpdm90MgorICAgICAgLy8gICAzLiBmb3IgeCBpbiBdZ3JlYXQsICogXSA6IHggPT0gcGl2b3QyCisgICAgICBmb3IgKHZhciBrID0gbGVzczsgayA8PSBncmVhdDsgaysrKSB7CisgICAgICAgIHZhciBlayA9IGFba10sIHhrID0gZihlayk7CisgICAgICAgIGlmICh4ayA8PSBwaXZvdFZhbHVlMSAmJiB4ayA+PSBwaXZvdFZhbHVlMSkgeworICAgICAgICAgIGlmIChrICE9PSBsZXNzKSB7CisgICAgICAgICAgICBhW2tdID0gYVtsZXNzXTsKKyAgICAgICAgICAgIGFbbGVzc10gPSBlazsKKyAgICAgICAgICB9CisgICAgICAgICAgbGVzcysrOworICAgICAgICB9IGVsc2UgeworICAgICAgICAgIGlmICh4ayA8PSBwaXZvdFZhbHVlMiAmJiB4ayA+PSBwaXZvdFZhbHVlMikgeworICAgICAgICAgICAgd2hpbGUgKHRydWUpIHsKKyAgICAgICAgICAgICAgdmFyIGdyZWF0VmFsdWUgPSBmKGFbZ3JlYXRdKTsKKyAgICAgICAgICAgICAgaWYgKGdyZWF0VmFsdWUgPD0gcGl2b3RWYWx1ZTIgJiYgZ3JlYXRWYWx1ZSA+PSBwaXZvdFZhbHVlMikgeworICAgICAgICAgICAgICAgIGdyZWF0LS07CisgICAgICAgICAgICAgICAgaWYgKGdyZWF0IDwgaykgYnJlYWs7CisgICAgICAgICAgICAgICAgLy8gVGhpcyBpcyB0aGUgb25seSBsb2NhdGlvbiBpbnNpZGUgdGhlIGxvb3Agd2hlcmUgYSBuZXcKKyAgICAgICAgICAgICAgICAvLyBpdGVyYXRpb24gaXMgc3RhcnRlZC4KKyAgICAgICAgICAgICAgICBjb250aW51ZTsKKyAgICAgICAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgICAgICAvLyBhW2dyZWF0XSA8IHBpdm90Mi4KKyAgICAgICAgICAgICAgICBpZiAoZ3JlYXRWYWx1ZSA8IHBpdm90VmFsdWUxKSB7CisgICAgICAgICAgICAgICAgICAvLyBUcmlwbGUgZXhjaGFuZ2UuCisgICAgICAgICAgICAgICAgICBhW2tdID0gYVtsZXNzXTsKKyAgICAgICAgICAgICAgICAgIGFbbGVzcysrXSA9IGFbZ3JlYXRdOworICAgICAgICAgICAgICAgICAgYVtncmVhdC0tXSA9IGVrOworICAgICAgICAgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICAgICAgICAvLyBhW2dyZWF0XSA9PSBwaXZvdDEuCisgICAgICAgICAgICAgICAgICBhW2tdID0gYVtncmVhdF07CisgICAgICAgICAgICAgICAgICBhW2dyZWF0LS1dID0gZWs7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9CisgICAgICAgICAgfQorICAgICAgICB9CisgICAgICB9CisgICAgfQorCisgICAgLy8gVGhlIHNlY29uZCBwYXJ0aXRpb24gaGFzIG5vdyBiZWVuIGNsZWFyZWQgb2YgcGl2b3QgZWxlbWVudHMgYW5kIGxvb2tzCisgICAgLy8gYXMgZm9sbG93czoKKyAgICAvLyBbICAqICB8ICA+IHBpdm90MSAmJiA8IHBpdm90MiAgfCAqIF0KKyAgICAvLyAgICAgICAgXiAgICAgICAgICAgICAgICAgICAgICBeCisgICAgLy8gICAgICAgbGVzcyAgICA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oZSBwdWJsaWMgZmlsdGVyIG1ldGhvZHMuCisgICAgZnVuY3Rpb24gZmlsdGVySW5kZXgoYm91bmRzKSB7CisgICAgICB2YXIgaSwKKyAgICAgICAgICBqLAorICAgICAgICAgIGssCisgICAgICAgICAgbG8xID0gYm91bmRzWzBdLAorICAgICAgICAgIGhpMSA9IGJvdW5kc1sxXSwKKyAgICAgICAgICBhZGRlZCA9IFtdLAorICAgICAgICAgIHJlbW92ZWQgPSBbXTsKKworICAgICAgLy8gRmFzdCBpbmNyZW1lbnRhbCB1cGRhdGUgYmFzZWQgb24gcHJldmlvdXMgbG8gaW5kZXguCisgICAgICBpZiAobG8xIDwgbG8wKSB7CisgICAgICAgIGZvciAoaSA9IGxvMSwgaiA9IE1hdGgubWluKGxvMCwgaGkxKTsgaSA8IGo7ICsraSkgeworICAgICAgICAgIGZpbHRlcnNbayA9IGluZGV4W2ldXSBePSBvbmU7CisgICAgICAgICAgYWRkZWQucHVzaChrKTsKKyAgICAgICAgfQorICAgICAgfSBlbHNlIGlmIChsbzEgPiBsbzApIHsKKyAgICAgICAgZm9yIChpID0gbG8wLCBqID0gTWF0aC5taW4obG8xLCBoaTApOyBpIDwgajsgKytpKSB7CisgICAgICAgICAgZmlsdGVyc1trID0gaW5kZXhbaV1dIF49IG9uZTsKKyAgICAgICAgICByZW1vdmVkLnB1c2goayk7CisgICAgICAgIH0KKyAgICAgIH0KKworICAgICAgLy8gRmFzdCBpbmNyZW1lbnRhbCB1cGRhdGUgYmFzZWQgb24gcHJldmlvdXMgaGkgaW5kZXguCisgICAgICBpZiAoaGkxID4gaGkwKSB7CisgICAgICAgIGZvciAoaSA9IE1hdGgubWF4KGxvMSwgaGkwKSwgaiA9IGhpMTsgaSA8IGo7ICsraSkgeworICAgICAgICAgIGZpbHRlcnNbayA9IGluZGV4W2ldXSBePSBvbmU7CisgICAgICAgICAgYWRkZWQucHVzaChrKTsKKyAgICAgICAgfQorICAgICAgfSBlbHNlIGlmIChoaTEgPCBoaT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4W2ldXSkgeworICAgICAgICAgIGFycmF5LnB1c2goZGF0YVtqXSk7CisgICAgICAgICAgLS1rOworICAgICAgICB9CisgICAgICB9CisKKyAgICAgIHJldHVybiBhcnJheTsKKyAgICB9CisKKyAgICAvLyBBZGRzIGEgbmV3IGdyb3VwIHRvIHRoaXMgZGltZW5zaW9uLCB1c2luZyB0aGUgc3BlY2lmaWVkIGtleSBmdW5jdGlvbi4KKyAgICBmdW5jdGlvbiBncm91cChrZXkpIHsKKyAgICAgIHZhciBncm91cCA9IHsKKyAgICAgICAgdG9wOiB0b3AsCisgICAgICAgIGFsbDogYWxsLAorICAgICAgICByZWR1Y2U6IHJlZHVjZSwKKyAgICAgICAgcmVkdWNlQ291bnQ6IHJlZHVjZUNvdW50LAorICAgICAgICByZWR1Y2VTdW06IHJlZHVjZVN1bSwKKyAgICAgICAgb3JkZXI6IG9yZGVyLAorICAgICAgICBvcmRlck5hdHVyYWw6IG9yZGVyTmF0dXJhbCwKKyAgICAgICAgc2l6ZTogc2l6ZQorICAgICAgfTsKKworICAgICAgdmFyIGdyb3VwcywgLy8gYXJyYXkgb2Yge2tleSwgdmFsdWV9CisgICAgICAgICAgZ3JvdXBJbmRleCwgLy8gb2JqZWN0IGlkIOKGpiBncm91cCBpZAorICAgICAgICAgIGdyb3VwV2lkdGggPSA4LAorICAgICAgICAgIGdyb3VwQ2FwYWNpdHkgPSBjcm9zc2ZpbHRlcl9jYXBhY2l0eShncm91cFdpZHRoKSwKKyAgICAgICAgICBrID0gMCwgLy8gY2FyZGluYWxpdHkKKyAgICAgICAgICBzZWxlY3QsCisgICAgICAgICAgaGVhcCwKKyAgICAgICAgICByZWR1Y2VBZGQsCisgICAgICAgICAgcmVkdWNlUmVtb3ZlLAorICAgICAgICAgIHJlZHVjZUluaXRpYWwsCisgICAgICAgICAgdXBkYXRlID0gY3Jvc3NmaWx0ZXJfbnVsbCwKKyAgICAgICAgICByZXNldCA9IGNyb3NzZmlsdGVyX251bGwsCisgICAgICAg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BvbGRHcm91cHNbMF0pLmtleTsKKworICAgICAgICAvLyBGaW5kIHRoZSBmaXJzdCBuZXcga2V5ICh4MSksIHNraXBwaW5nIE5hTiBrZXlzLgorICAgICAgICB3aGlsZSAoaTEgPCBuMSAmJiAhKCh4MSA9IGtleShuZXdWYWx1ZXNbaTFdKSkgPj0geDEpKSArK2kxOworCisgICAgICAgIC8vIFdoaWxlIG5ldyBrZXlzIHJlbWFpbuKApgorICAgICAgICB3aGlsZSAoaTEgPCBuMSkgeworCisgICAgICAgICAgLy8gRGV0ZXJtaW5lIHRoZSBsZXNzZXIgb2YgdGhlIHR3byBjdXJyZW50IGtleXM7IG5ldyBhbmQgb2xkLgorICAgICAgICAgIC8vIElmIHRoZXJlIGFyZSBubyBvbGQga2V5cyByZW1haW5pbmcsIHRoZW4gYWx3YXlzIGFkZCB0aGUgbmV3IGtleS4KKyAgICAgICAgICBpZiAoZzAgJiYgeDAgPD0geDEpIHsKKyAgICAgICAgICAgIGcgPSBnMCwgeCA9IHgwOworCisgICAgICAgICAgICAvLyBSZWNvcmQgdGhlIG5ldyBpbmRleCBvZiB0aGUgb2xkIGdyb3VwLgorICAgICAgICAgICAgcmVJbmRleFtpMF0gPSBrOworCisgICAgICAgICAgICAvLyBSZXRyaWV2ZSB0aGUgbmV4dCBvbGQga2V5LgorICAgICAgICAgICAgaWYgKGcwID0gb2xkR3JvdXBzWysraTBdKSB4MCA9IGcwLmtleTsKKyAgICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgZyA9IHtrZXk6IHgxLCB2YWx1ZTogaW5pdGlhbCgpfSwgeCA9IHgxOworICAgICAgICAgIH0KKworICAgICAgICAgIC8vIEFkZCB0aGUgbGVzc2VyIGdyb3VwLgorICAgICAgICAgIGdyb3Vwc1trXSA9IGc7CisKKyAgICAgICAgICAvLyBBZGQgYW55IHNlbGVjdGVkIHJlY29yZHMgYmVsb25naW5nIHRvIHRoZSBhZGRlZCBncm91cCwgd2hpbGUKKyAgICAgICAgICAv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4KKyAgICAgICAgZm9yIChpID0gMCwgbiA9IGFkZGVkLmxlbmd0aDsgaSA8IG47ICsraSkgeworICAgICAgICAgIGlmICghKGZpbHRlcnNbayA9IGFkZGVkW2ldXSAmIHplcm8pKSB7CisgICAgICAgICAgICBnID0gZ3JvdXBzW2dyb3VwSW5kZXhba11dOworICAgICAgICAgICAgZy52YWx1ZSA9IHJlZHVjZUFkZChnLnZhbHVlLCBkYXRhW2tdKTsKKyAgICAgICAgICB9CisgICAgICAgIH0KKworICAgICAgICAvLyBSZW1vdmUgdGhlIHJlbW92ZWQgdmFsdWVzLgorICAgICAgICBmb3IgKGkgPSAwLCBuID0gcmVtb3ZlZC5sZW5ndGg7IGkgPCBuOyArK2kpIHsKKyAgICAgICAgICBpZiAoKGZpbHRlcnNbayA9IHJlbW92ZWRbaV1dICYgemVybykgPT09IGZpbHRlck9uZSkgeworICAgICAgICAgICAgZyA9IGdyb3Vwc1tncm91cEluZGV4W2tdXTsKKyAgICAgICAgICAgIGcudmFsdWUgPSByZWR1Y2VSZW1vdmUoZy52YWx1ZSwgZGF0YVtrXSk7CisgICAgICAgICAgfQorICAgICAgICB9CisgICAgICB9CisKKyAgICAgIC8vIFJlZHVjZXMgdGhlIHNwZWNpZmllZCBzZWxlY3RlZCBvciBkZXNlbGVjdGVkIHJlY29yZHMuCisgICAgICAvLyBUaGlzIGZ1bmN0aW9uIGlzIG9ubHkgdXNlZCB3aGVuIHRoZSBjYXJkaW5hbGl0eSBpcyAxLgorICAgICAgZnVuY3Rpb24gdXBkYXRlT25lKGZpbHRlck9uZSwgYWRkZWQsIHJlbW92ZWQpIHsKKyAgICAgICAgaWYgKGZpbHRlck9uZSA9PT0gb25lIHx8IHJlc2V0TmVlZGVkKSByZXR1cm47CisKKyAgICAgICAgdmFyIGksCisgICAgICAgICAgICBrLAorICAgICAgICAgICAgbiwKKyAgICAgICAgICAgIGcgPSBncm91cHNbMF07CisKKyAgICAgICAgLy8gQWRkIHRoZSBhZGRlZCB2YWx1ZXMuCisgICAgICAgIGZvciAoaSA9IDAsIG4gPSBhZGRlZC5sZW5ndGg7IGkgPCBuOyArK2kpIHsKKyAgICAgICAgICBpZiAoIShmaWx0ZXJzW2sgPSBhZGRlZFtpXV0gJiB6ZXJvKSkgeworICAgICAgICAgICAgZy52YWx1ZSA9IHJlZHVjZUFkZChnLnZhbHVlLCBkYXRhW2tdKTsKKyAgICAgICAgICB9CisgICAgICAgIH0KKworICAgICAgICAvLyBSZW1vdmUgdGhlIHJlbW92ZWQgdmFsdWVzLgorICAgICAgICBmb3IgKGkgPSAwLCBuID0gcmVtb3ZlZC5sZW5ndGg7IGkgPCBuOyArK2kpIHsKKyAgICAgICAgICBpZiAoKGZpbHRlcnNbayA9IHJlbW92ZWRbaV1dICYgemVybykgPT09IGZpbHRlck9uZSkgeworICAgICAgICAgICAgZy52YWx1ZSA9IHJlZHVjZVJlbW92ZShnLnZhbHVlLCBkYXRhW2tdKTsKKyAgICAgICAgICB9CisgICAgICAgIH0KKyAgICAgIH0KKworICAgICAgLy8gUmVjb21wdXRlcyB0aGUgZ3JvdXAgcmVkdWNlIHZhbHVlcyBmcm9tIHNjcmF0Y2guCisgICAgICAvLyBUaGlzIGZ1bmN0aW9uIGlzIG9ubHkgdXNlZCB3aGVuIHRoZSBjYXJkaW5hbGl0eSBpcyBncmVhdGVyIHRoYW4gMS4KKyAgICAgIGZ1bmN0aW9uIHJlc2V0TWFueSgpIHsKKyAgICAgICAgdmFyIGksCisgICAgICAgICAgICBnOworCisgICAgICAgIC8vIFJlc2V0IGFsbCBncm91cCB2YWx1ZXMuCisgICAgICAgIGZvciAoaSA9IDA7IGkgPCBrOyArK2kpIHsKKyAgICAgICAgICBncm91cHNbaV0udmFsdWUgPSByZWR1Y2VJbml0aWFsKCk7CisgICAgICAgIH0KKworICAgICAgICAvLyBBZGQgYW55IHNlbGVjdGVkIHJlY29yZHMuCisgICAgICAgIGZvciAoaSA9IDA7IGkgPCBuOyArK2kpIHsKKyAgICAgICAgICBpZiAoIShmaWx0ZXJzW2ldICYgemVybykpIHsKKyAgICAgICAgICAgIGcgPSBncm91cHNbZ3JvdXBJbmRleFtpXV07CisgICAgICAgICAgICBnLnZhbHVlID0gcmVkdWNlQWRkKGcudmFsdWUsIGRhdGFbaV0pOworICAgICAgICAgIH0KKyAgICAgICAgfQorICAgICAgfQorCisgICAgICAvLyBSZWNvbXB1dGVzIHRoZSBncm91cCByZWR1Y2UgdmFsdWVzIGZyb20gc2NyYXRjaC4KKyAgICAgIC8vIFRoaXMgZnVuY3Rpb24gaXMgb25seSB1c2VkIHdoZW4gdGhlIGNhcmRpbmFsaXR5IGlzIDEuCisgICAgICBmdW5jdGlvbiByZXNldE9uZSgpIHsKKyAgICAgICAgdmFyIGksCisgICAgICAgICAgICBnID0gZ3JvdXBzWzBdOworCisgICAgICAgIC8vIFJlc2V0IHRoZSBzaW5nbGV0b24gZ3JvdXAgdmFsdWVzLgorICAgICAgICBnLnZhbHVlID0gcmVkdWNlSW5pdGlhbCgpOworCisgICAgICAgIC8vIEFkZCBhbnkgc2VsZWN0ZWQgcmVjb3Jkcy4KKyAgICAgICAgZm9yIChpID0gMDsgaSA8IG47ICsraSkgeworICAgICAgICAgIGlmICghKGZpbHRlcnNbaV0gJiB6ZXJvKSkgeworICAgICAgICAgICAgZy52YWx1ZSA9IHJlZHVjZUFkZChnLnZhbHVlLCBkYXRhW2ldKTsKKyAgICAgICAgICB9CisgICAgICAgIH0KKyAgICAgIH0KKworICAgICAgLy8gUmV0dXJucyB0aGUgYXJyYXkgb2YgZ3JvdXAgdmFsdWVzLCBpbiB0aGUgZGltZW5zaW9uJ3MgbmF0dXJhbCBvcmRlci4KKyAgICAgIGZ1bmN0aW9uIGFsbCgpIHsKKyAgICAgICAgaWYgKHJlc2V0TmVlZGVkKSByZXNldCgpLCByZXNldE5lZWRlZCA9IGZhbHNlOworICAgICAgICByZXR1cm4gZ3JvdXBzOworICAgICAgfQorCisgICAgICAvLyBSZXR1cm5zIGE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yBuZXh0IHkgZGlyZWN0aW9uCisgICAgICBwZHggPSBOYU4sIC8vIHByZXZpb3VzIHggZGlyZWN0aW9uCisgICAgICBwZHkgPSBOYU4sIC8vIHByZXZpb3VzIHkgZGlyZWN0aW9uCisgICAgICBpID0gMDsKKworICBkbyB7CisgICAgLy8gZGV0ZXJtaW5lIG1hcmNoaW5nIHNxdWFyZXMgaW5kZXgKKyAgICBpID0gMDsKKyAgICBpZiAoZ3JpZCh4LTEsIHktMSkpIGkgKz0gMTsKKyAgICBpZiAoZ3JpZCh4LCAgIHktMSkpIGkgKz0gMjsKKyAgICBpZiAoZ3JpZCh4LTEsIHkgICkpIGkgKz0gNDsKKyAgICBpZiAoZ3JpZCh4LCAgIHkgICkpIGkgKz0gODsKKworICAgIC8vIGRldGVybWluZSBuZXh0IGRpcmVjdGlvbgorICAgIGlmIChpID09IDYpIHsKKyAgICAgIGR4ID0gcGR5ID09IC0xID8gLTEgOiAxOworICAgICAgZHkgPSAwOworICAgIH0gZWxzZSBpZiAoaSA9PSA5KSB7CisgICAgICBkeCA9IDA7CisgICAgICBkeSA9IHBkeCA9PSAxID8gLTEgOiAxOworICAgIH0gZWxzZSB7CisgICAgICBkeCA9IGQzX2dlb21fY29udG91ckR4W2ldOworICAgICAgZHkgPSBkM19nZW9tX2NvbnRvdXJEeVtpXTsKKyAgICB9CisKKyAgICAvLyB1cGRhdGUgY29udG91ciBwb2x5Z29uCisgICAgaWYgKGR4ICE9IHBkeCAmJiBkeSAhPSBwZHkpIHsKKyAgICAgIGMucHVzaChbeCwgeV0pOworICAgICAgcGR4ID0gZHg7CisgICAgICBwZHkgPSBkeTsKKyAgICB9CisKKyAgICB4ICs9IGR4OworICAgIHkgKz0gZHk7CisgIH0gd2hpbGUgKHNbMF0gIT0geCB8fCBzWzFdICE9IHkpOworCisgIHJldHVybiBjOworfTsKKworLy8gbG9va3VwIHRhYmxlcyBmb3IgbWFyY2hpbmcgZGlyZWN0aW9ucwordmFyIGQzX2dlb21fY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NvcnQoZnVuY3Rpb24oYSwgYikgeyByZXR1cm4gYS5hbmdsZSAtIGIuYW5nbGU7IH0pOworCisgIC8vIHRvc3Mgb3V0IGR1cGxpY2F0ZSBhbmdsZXMKKyAgYSA9IHBvaW50c1swXS5hbmdsZTsKKyAgdiA9IHBvaW50c1swXS5pbmRleDsKKyAgdSA9IDA7CisgIGZvciAoaT0xOyBpPHBsZW47ICsraSkgeworICAgIGogPSBwb2ludHNbaV0uaW5kZXg7CisgICAgaWYgKGEgPT0gcG9pbnRzW2ldLmFuZ2xlKSB7CisgICAgICAvLyBrZWVwIGFuZ2xlIGZvciBwb2ludCBtb3N0IGRpc3RhbnQgZnJvbSB0aGUgcmVmZXJlbmNlCisgICAgICB4MSA9IHZlcnRpY2VzW3ZdWzBdIC0gdmVydGljZXNbaF1bMF07CisgICAgICB5MSA9IHZlcnRpY2VzW3ZdWzFdIC0gdmVydGljZXNbaF1bMV07CisgICAgICB4MiA9IHZlcnRpY2VzW2pdWzBdIC0gdmVydGljZXNbaF1bMF07CisgICAgICB5MiA9IHZlcnRpY2VzW2pdWzFdIC0gdmVydGljZXNbaF1bMV07CisgICAgICBpZiAoKHgxKngxICsgeTEqeTEpID49ICh4Mip4MiArIHkyKnkyKSkgeworICAgICAgICBwb2ludHNbaV0uaW5kZXggPSAtMTsKKyAgICAgIH0gZWxzZSB7CisgICAgICAgIHBvaW50c1t1XS5pbmRleCA9IC0xOworICAgICAgICBhID0gcG9pbnRzW2ldLmFuZ2xlOworICAgICAgICB1ID0gaTsKKyAgICAgICAgdiA9IGo7CisgICAgICB9CisgICAgfSBlbHNlIHsKKyAgICAgIGEgPSBwb2ludHNbaV0uYW5nbGU7CisgICAgICB1ID0gaTsKKyAgICAgIHYgPSBqOworICAgIH0KKyAgfQorCisgIC8vIGluaXRpYWxpemUgdGhlIHN0YWNrCisgIHN0YWNrLnB1c2goaCk7CisgIGZvciAoaT0wLCBqPTA7IGk8MjsgKytqKSB7CisgICAgaWYgKHBvaW50c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lb20ucG9seWdvbiA9IGZ1bmN0aW9uKGNvb3JkaW5hdGVzKSB7CisKKyAgY29vcmRpbmF0ZXMuYXJlYSA9IGZ1bmN0aW9uKCkgeworICAgIHZhciBpID0gMCwKKyAgICAgICAgbiA9IGNvb3JkaW5hdGVzLmxlbmd0aCwKKyAgICAgICAgYSA9IGNvb3JkaW5hdGVzW24gLSAxXVswXSAqIGNvb3JkaW5hdGVzWzBdWzFdLAorICAgICAgICBiID0gY29vcmRpbmF0ZXNbbiAtIDFdWzFdICogY29vcmRpbmF0ZXNbMF1bMF07CisgICAgd2hpbGUgKCsraSA8IG4pIHsKKyAgICAgIGEgKz0gY29vcmRpbmF0ZXNbaSAtIDFdWzBdICogY29vcmRpbmF0ZXNbaV1bMV07CisgICAgICBiICs9IGNvb3JkaW5hdGVzW2kgLSAxXVsxXSAqIGNvb3JkaW5hdGVzW2ldWzBdOworICAgIH0KKyAgICByZXR1cm4gKGIgLSBhKSAqIC41OworICB9OworCisgIGNvb3JkaW5hdGVzLmNlbnRyb2lkID0gZnVuY3Rpb24oaykgeworICAgIHZhciBpID0gLTEsCisgICAgICAgIG4gPSBjb29yZGluYXRlcy5sZW5ndGggLSAxLAorICAgICAgICB4ID0gMCwKKyAgICAgICAgeSA9IDAsCisgICAgICAgIGEsCisgICAgICAgIGIsCisgICAgICAgIGM7CisgICAgaWYgKCFhcmd1bWVudHMubGVuZ3RoKSBrID0gMSAvICg2ICogY29vcmRpbmF0ZXMuYXJlYSgpKTsKKyAgICB3aGlsZSAoKytpIDwgbikgeworICAgICAgYSA9IGNvb3JkaW5hdGVzW2ldOworICAgICAgYiA9IGNvb3JkaW5hdGVzW2kgKyAxXTsKKyAgICAgIGMgPSBhWzBdICogYlsxXSAtIGJbMF0gKiBhWzFdOworICAgICAgeCArPSAoYVswXSArIGJbMF0pICogYzsKKyAgICAgIHkgKz0gKGFbMV0gKyBiWzFdKSAqIGM7CisgICAgfQorICAgIHJldHVybiBbeCAqIGssIHkgKiBrXTsKKyAgfTsKKworICAvLyBUaGUgU3V0aGVybGFuZC1Ib2RnbWFuIGNsaXBwaW5nIGFsZ29yaXRobS4KKyAgY29vcmRpbmF0ZXMuY2xpcCA9IGZ1bmN0aW9uKHN1YmplY3QpIHsKKyAgICB2YXIgaW5wdXQsCisgICAgICAgIGkgPSAtMSwKKyAgICAgICAgbiA9IGNvb3JkaW5hdGVzLmxlbmd0aCwKKyAgICAgICAgaiwKKyAgICAgICAgbSwKKyAgICAgICAgYSA9IGNvb3JkaW5hdGVzW24gLSAxXSwKKyAgICAgICAgYiwKKyAgICAgICAgYywKKyAgICAgICAgZDsKKyAgICB3aGlsZSAoKytpIDwgbikgeworICAgICAgaW5wdXQgPSBzdWJqZWN0LnNsaWNlKCk7CisgICAgICBzdWJqZWN0Lmxlbmd0aCA9IDA7CisgICAgICBiID0gY29vcmRpbmF0ZXNbaV07CisgICAgICBjID0gaW5wdXRbKG0gPSBpbnB1dC5sZW5ndGgpIC0gMV07CisgICAgICBqID0gLTE7CisgICAgICB3aGlsZSAoKytqIDwgbSkgeworICAgICAgICBkID0gaW5wdXRbal07CisgICAgICAgIGlmIChkM19nZW9tX3BvbHlnb25JbnNpZGUoZCwgYSwgYikpIHsKKyAgICAgICAgICBpZiAoIWQzX2dlb21fcG9seWdvbkluc2lkZShjLCBhLCBiKSkgeworICAgICAgICAgICAgc3ViamVjdC5wdXNoKGQzX2dlb21fcG9seWdvbkludGVyc2VjdChjLCBkLCBhLCBiKSk7CisgICAgICAgICAgfQorICAgICAgICAgIHN1YmplY3QucHVzaChkKTsKKyAgICAgICAgfSBlbHNlIGlmIChkM19nZW9tX3BvbHlnb25JbnNpZGUoYywgYSwgYikpIHsKKyAgICAgICAgICBzdWJqZWN0LnB1c2goZDNfZ2VvbV9wb2x5Z29uSW50ZXJzZWN0KGMsIGQsIGEsIGIpKTsKKyAgICAgICAgfQorICAgICAgICBjID0gZDsKKyAgICAgIH0KKyAgICAgIGEgPSBiOworICAgIH0KKyAgICByZXR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FtIHZlcnRpY2VzIFtbeDEsIHkxXSwgW3gyLCB5Ml0sIOKApl0KKyAqIEByZXR1cm5zIHBvbHlnb25zIFtbW3gxLCB5MV0sIFt4MiwgeTJdLCDigKZdLCDigKZdCisgKi8KK2QzLmdlb20udm9yb25vaSA9IGZ1bmN0aW9uKHZlcnRpY2VzKSB7CisgIHZhciBwb2x5Z29ucyA9IHZlcnRpY2VzLm1hcChmdW5jdGlvbigpIHsgcmV0dXJuIFtdOyB9KTsKKworICAvLyBOb3RlOiB3ZSBleHBlY3QgdGhlIGNhbGxlciB0byBjbGlwIHRoZSBwb2x5Z29ucywgaWYgbmVlZGVkLgorICBkM192b3Jvbm9pX3Rlc3NlbGxhdGUodmVydGljZXMsIGZ1bmN0aW9uKGUpIHsKKyAgICB2YXIgczEsCisgICAgICAgIHMyLAorICAgICAgICB4MSwKKyAgICAgICAgeDIsCisgICAgICAgIHkxLAorICAgICAgICB5MjsKKyAgICBpZiAoZS5hID09IDEgJiYgZS5iID49IDApIHsKKyAgICAgIHMxID0gZS5lcC5yOworICAgICAgczIgPSBlLmVwLmw7CisgICAgfSBlbHNlIHsKKyAgICAgIHMxID0gZS5lcC5sOworICAgICAgczIgPSBlLmVwLnI7CisgICAgfQorICAgIGlmIChlLmEgPT0gMSkgeworICAgICAgeTEgPSBzMSA/IHMxLnkgOiAtMWU2OworICAgICAgeDEgPSBlLmMgLSBlLmIgKiB5MTsKKyAgICAgIHkyID0gczIgPyBzMi55IDogMWU2OworICAgICAgeDIgPSBlLmMgLSBlLmIgKiB5MjsKKyAgICB9IGVsc2UgeworICAgICAgeDEgPSBzMSA/IHMxLnggOiAtMWU2OworICAgICAgeTEgPSBlLmMgLSBlLmEgKiB4MTsKKyAgICAgIHgyID0gczIgPyBzMi54IDogMWU2OworICAgICAgeTIgPSBlLmMgLSBlLmEgKiB4MjsKKyAgICB9CisgICAgdmFyIHYxID0gW3gxLCB5MV0sCisgICAgICAgIHYyID0gW3gyLCB5Ml07CisgICAgcG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uY3Rpb24oYSwgYikgeworICAgICAgICByZXR1cm4gYS55IDwgYi55ID8gLTEKKyAgICAgICAgICA6IGEueSA+IGIueSA/IDEKKyAgICAgICAgICA6IGEueCA8IGIueCA/IC0xCisgICAgICAgICAgOiBhLnggPiBiLnggPyAxCisgICAgICAgICAgOiAwOworICAgICAgfSksCisgICAgYm90dG9tU2l0ZTogbnVsbAorICB9OworCisgIHZhciBFZGdlTGlzdCA9IHsKKyAgICBsaXN0OiBbXSwKKyAgICBsZWZ0RW5kOiBudWxsLAorICAgIHJpZ2h0RW5kOiBudWxsLAorCisgICAgaW5pdDogZnVuY3Rpb24oKSB7CisgICAgICBFZGdlTGlzdC5sZWZ0RW5kID0gRWRnZUxpc3QuY3JlYXRlSGFsZkVkZ2UobnVsbCwgImwiKTsKKyAgICAgIEVkZ2VMaXN0LnJpZ2h0RW5kID0gRWRnZUxpc3QuY3JlYXRlSGFsZkVkZ2UobnVsbCwgImwiKTsKKyAgICAgIEVkZ2VMaXN0LmxlZnRFbmQuciA9IEVkZ2VMaXN0LnJpZ2h0RW5kOworICAgICAgRWRnZUxpc3QucmlnaHRFbmQubCA9IEVkZ2VMaXN0LmxlZnRFbmQ7CisgICAgICBFZGdlTGlzdC5saXN0LnVuc2hpZnQoRWRnZUxpc3QubGVmdEVuZCwgRWRnZUxpc3QucmlnaHRFbmQpOworICAgIH0sCisKKyAgICBjcmVhdGVIYWxmRWRnZTogZnVuY3Rpb24oZWRnZSwgc2lkZSkgeworICAgICAgcmV0dXJuIHsKKyAgICAgICAgZWRnZTogZWRnZSwKKyAgICAgICAgc2lkZTogc2lkZSwKKyAgICAgICAgdmVydGV4OiBudWxsLAorICAgICAgICAibCI6IG51bGwsCisgICAgICAgICJyIjogbnVsbAorICAgICAgfTsKKyAgICB9LAorCisgICAgaW5zZXJ0OiBmdW5jdGlvbihsYiwgaGUpIHsKKyAgICAgIGhlLmwgPSBsYjsKKyAgICAgIGhlLnIgPSBsYi5yOworICAgICAgbGIuci5sID0gaGU7CisgICAgICBsYi5yID0gaGU7CisgICAgfSwKKworICAgIGxlZnRCb3VuZDogZnVuY3Rpb24ocCkgeworICAgICAgdmFyIGhlID0gRWRnZUxpc3QubGVmdEVuZDsKKyAgICAgIGRvIHsKKyAgICAgICAgaGUgPSBoZS5yOworICAgICAgfSB3aGlsZSAoaGUgIT0gRWRnZUxpc3QucmlnaHRFbmQgJiYgR2VvbS5yaWdodE9mKGhlLCBwKSk7CisgICAgICBoZSA9IGhlLmw7CisgICAgICByZXR1cm4gaGU7CisgICAgfSwKKworICAgIGRlbDogZnVuY3Rpb24oaGUpIHsKKyAgICAgIGhlLmwuciA9IGhlLnI7CisgICAgICBoZS5yLmwgPSBoZS5sOworICAgICAgaGUuZWRnZSA9IG51bGw7CisgICAgfSwKKworICAgIHJpZ2h0OiBmdW5jdGlvbihoZSkgeworICAgICAgcmV0dXJuIGhlLnI7CisgICAgfSwKKworICAgIGxlZnQ6IGZ1bmN0aW9uKGhlKSB7CisgICAgICByZXR1cm4gaGUubDsKKyAgICB9LAorCisgICAgbGVmdFJlZ2lvbjogZnVuY3Rpb24oaGUpIHsKKyAgICAgIHJldHVybiBoZS5lZGdlID09IG51bGwKKyAgICAgICAgICA/IFNpdGVzLmJvdHRvbVNpdGUKKyAgICAgICAgICA6IGhlLmVkZ2UucmVnaW9uW2hlLnNpZGVdOworICAgIH0sCisKKyAgICByaWdodFJlZ2lvbjogZnVuY3Rpb24oaGUpIHsKKyAgICAgIHJldHVybiBoZS5lZGdlID09IG51bGwKKyAgICAgICAgICA/IFNpdGVzLmJvdHRvbVNpdGUKKyAgICAgICAgICA6IGhlLmVkZ2UucmVnaW9uW2QzX3Zvcm9ub2lfb3Bwb3NpdGVbaGUuc2lkZV1dOworICAgIH0KKyAgfTsKKworICB2YXIgR2VvbSA9IHsKKworICAgIGJpc2VjdDogZnVuY3Rpb24oczEsIHMyKSB7CisgICAgICB2YXIgbmV3RWRnZSA9IHsKKyAgICAgICAgcmVnaW9uOiB7ImwiOiBzMSwgInIiOiBzMn0sCisgICAgICAgIGVwOiB7ImwiOiBudWxsLCAiciI6IG51bGx9CisgICAgICB9OworCisgICAgICB2YXIgZHggPSBzMi54IC0gczEueCwKKyAgICAgICAgICBkeSA9IHMyLnkgLSBzMS55LAorICAgICAgICAgIGFkeCA9IGR4ID4gMCA/IGR4IDogLWR4LAorICAgICAgICAgIGFkeSA9IGR5ID4gMCA/IGR5IDogLWR5OworCisgICAgICBuZXdFZGdlLmMgPSBzMS54ICogZHggKyBzMS55ICogZHkKKyAgICAgICAgICArIChkeCAqIGR4ICsgZHkgKiBkeSkgKiAuNTsKKworICAgICAgaWYgKGFkeCA+IGFkeSkgeworICAgICAgICBuZXdFZGdlLmEgPSAxOworICAgICAgICBuZXdFZGdlLmIgPSBkeSAvIGR4OworICAgICAgICBuZXdFZGdlLmMgLz0gZHg7CisgICAgICB9IGVsc2UgeworICAgICAgICBuZXdFZGdlLmIgPSAxOworICAgICAgICBuZXdFZGdlLmEgPSBkeCAvIGR5OworICAgICAgICBuZXdFZGdlLmMgLz0gZHk7CisgICAgICB9CisKKyAgICAgIHJldHVybiBuZXdFZGdlOworICAgIH0sCisKKyAgICBpbnRlcnNlY3Q6IGZ1bmN0aW9uKGVsMSwgZWwyKSB7CisgICAgICB2YXIgZTEgPSBlbDEuZWRnZSwKKyAgICAgICAgICBlMiA9IGVsMi5lZGdlOworICAgICAgaWYgKCFlMSB8fCAhZTIgfHwgKGUxLnJlZ2lvbi5yID09IGUyLnJlZ2lvbi5yKSkgeworICAgICAgICByZXR1cm4gbnVsbDsKKyAgICAgIH0KKyAgICAgIHZhciBkID0gKGUxLmEgKiBlMi5iKSAtIChlMS5iICogZTIuYSk7CisgICAgICBpZiAoTWF0aC5hYnMoZCkgPCAxZS0xMCkgeworICAgICAgICByZXR1cm4gbnVsbDsKKyAgICAgIH0KKyAgICAgIHZhciB4aW50ID0gKGUxLmMgKiBlMi5iIC0gZTIuYyAqIGUxLmIpIC8gZCwKKyAgICAgICAgICB5aW50ID0gKGUyLmMgKiBlMS5hIC0gZTEuYyAqIGUyLmEpIC8gZCwKKyAgICAgICAgICBlMXIgPSBlMS5yZWdpb24uciwKKyAgICAgICAgICBlMnIgPSBlMi5yZWdpb24uciwKKyAgICAgICAgICBlbCwKKyAgICAgICAgICBlOworICAgICAgaWYgKChlMXIueSA8IGUyci55KSB8fAorICAgICAgICAgKGUxci55ID09IGUyci55ICYmIGUxci54IDwgZTJyLngpKSB7CisgICAgICAgIGVsID0gZWwxOworICAgICAgICBlID0gZTE7CisgICAgICB9IGVsc2UgeworICAgICAgICBlbCA9IGVsMjsKKyAgICAgICAgZSA9IGUyOworICAgICAgfQorICAgICAgdmFyIHJpZ2h0T2ZTaXRlID0gKHhpbnQgPj0gZS5yZWdpb24uci54KTsKKyAgICAgIGlmICgocmlnaHRPZlNpdGUgJiYgKGVsLnNpZGUgPT0gImwiKSkgfHwKKyAgICAgICAgKCFyaWdodE9mU2l0ZSAmJiAoZWwuc2lkZSA9PSAiciIpKSkgeworICAgICAgICByZXR1cm4gbnVsbDsKKyAgICAgIH0KKyAgICAgIHJldHVybiB7CisgICAgICAgIHg6IHhpbnQsCisgICAgICAgIHk6IHlpbnQKKyAgICAgIH07CisgICAgfSwKKworICAgIHJpZ2h0T2Y6IGZ1bmN0aW9uKGhlLCBwKSB7CisgICAgICB2YXIgZSA9IGhlLmVkZ2UsCisgICAgICAgICAgdG9wc2l0ZSA9IGUucmVnaW9uLnIsCisgICAgICAgICAgcmlnaHRPZlNpdGUgPSAocC54ID4gdG9wc2l0ZS54KTsKKworICAgICAgaWYgKHJpZ2h0T2ZTaXRlICYmIChoZS5zaWRlID09ICJsIikpIHsKKyAgICAgICAgcmV0dXJuIDE7CisgICAgICB9CisgICAgICBpZiAoIXJpZ2h0T2ZTaXRlICYmIChoZS5zaWRlID09ICJyIikpIHsKKyAgICAgICAgcmV0dXJuIDA7CisgICAgICB9CisgICAgICBpZiAoZS5hID09IDEpIHsKKyAgICAgICAgdmFyIGR5cCA9IHAueSAtIHRvcHNpdGUueSwKKyAgICAgICAgICAgIGR4cCA9IHAueCAtIHRvcHNpdGUueCwKKyAgICAgICAgICAgIGZhc3QgPSAwLAorICAgICAgICAgICAgYWJvdmUgPSAwOworCisgICAgICAgIGlmICgoIXJpZ2h0T2ZTaXRlICYmIChlLmIgPCAwKSkgfHwKKyAgICAgICAgICAocmlnaHRPZlNpdGUgJiYgKGUuYiA+PSAwKSkpIHsKKyAgICAgICAgICBhYm92ZSA9IGZhc3QgPSAoZHlwID49IGUuYiAqIGR4cCk7CisgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgYWJvdmUgPSAoKHAueCArIHAueSAqIGUuYikgPiBlLmMpOworICAgICAgICAgIGlmIChlLmIgPCAwKSB7CisgICAgICAgICAgICBhYm92ZSA9ICFhYm92ZTsKKyAgICAgICAgICB9CisgICAgICAgICAgaWYgKCFhYm92ZSkgeworICAgICAgICAgICAgZmFzdCA9IDE7CisgICAgICAgICAgfQorICAgICAgICB9CisgICAgICAgIGlmICghZmFzdCkgeworICAgICAgICAgIHZhciBkeHMgPSB0b3BzaXRlLnggLSBlLnJlZ2lvbi5sLng7CisgICAgICAgICAgYWJvdmUgPSAoZS5iICogKGR4cCAqIGR4cCAtIGR5cCAqIGR5cCkpIDwKKyAgICAgICAgICAgIChkeHMgKiBkeXAgKiAoMSArIDIgKiBkeHAgLyBkeHMgKyBlLmIgKiBlLmIpKTsKKworICAgICAgICAgIGlmIChlLmIgPCAwKSB7CisgICAgICAgICAgICBhYm92ZSA9ICFhYm92ZTsKKyAgICAgICAgICB9CisgICAgICAgIH0KKyAgICAgIH0gZWxzZSAvKiBlLmIgPT0gMSAqLyB7CisgICAgICAgIHZhciB5bCA9IGUuYyAtIGUuYSAqIHAueCwKKyAgICAgICAgICAgIHQxID0gcC55IC0geWwsCisgICAgICAgICAgICB0MiA9IHAueCAtIHRvcHNpdGUueCwKKyAgICAgICAgICAgIHQzID0geWwgLSB0b3BzaXRlLnk7CisKKyAgICAgICAgYWJvdmUgPSAodDEgKiB0MSkgPiAodDIgKiB0MiArIHQzICogdDMpOworICAgICAgfQorICAgICAgcmV0dXJuIGhlLnNpZGUgPT0gImwiID8gYWJvdmUgOiAhYWJvdmU7CisgICAgfSwKKworICAgIGVuZFBvaW50OiBmdW5jdGlvbihlZGdlLCBzaWRlLCBzaXRlKSB7CisgICAgICBlZGdlLmVwW3NpZGVdID0gc2l0ZTsKKyAgICAgIGlmICghZWRnZS5lcFtkM192b3Jvbm9pX29wcG9zaXRlW3NpZGVdXSkgcmV0dXJuOworICAgICAgY2FsbGJhY2soZWRnZSk7CisgICAgfSwKKworICAgIGRpc3RhbmNlOiBmdW5jdGlvbihzLCB0KSB7CisgICAgICB2YXIgZHggPSBzLnggLSB0LngsCisgICAgICAgICAgZHkgPSBzLnkgLSB0Lnk7CisgICAgICByZXR1cm4gTWF0aC5zcXJ0KGR4ICogZHggKyBkeSAqIGR5KTsKKyAgICB9CisgIH07CisKKyAgdmFyIEV2ZW50UXVldWUgPSB7CisgICAgbGlzdDogW10sCisKKyAgICBpbnNlcnQ6IGZ1bmN0aW9uKGhlLCBzaXRlLCBvZmZzZXQpIHsKKyAgICAgIGhlLnZlcnRleCA9IHNpdGU7CisgICAgICBoZS55c3RhciA9IHNpdGUueSArIG9mZnNldDsKKyAgICAgIGZvciAodmFyIGk9MCwgbGlzdD1FdmVudFF1ZXVlLmxpc3QsIGw9bGlzdC5sZW5ndGg7IGk8bDsgaSsrKSB7CisgICAgICAgIHZhciBuZXh0ID0gbGlzdFtpXTsKKyAgICAgICAgaWYgKGhlLnlzdGFyID4gbmV4dC55c3RhciB8fAorICAgICAgICAgIChoZS55c3RhciA9PSBuZXh0LnlzdGFyICYmCisgICAgICAgICAgc2l0ZS54ID4gbmV4dC52ZXJ0ZXgueCkpIHsKKyAgICAgICAgICBjb250aW51ZTsKKyAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICBicmVhazsKKyAgICAgICAgfQorICAgICAgfQorICAgICAgbGlzdC5zcGxpY2UoaSwgMCwgaGUpOworICAgIH0sCisKKyAgICBkZWw6IGZ1bmN0aW9uKGhlKSB7CisgICAgICBmb3IgKHZhciBpPTAsIGxzPUV2ZW50UXVldWUubGlzdCwgbD1scy5sZW5ndGg7IGk8bCAmJiAobHNbaV0gIT0gaGUpOyArK2kpIHt9CisgICAgICBscy5zcGxpY2UoaSwgMSk7CisgICAgfSwKKworICAgIGVtcHR5OiBmdW5jdGlvbigpIHsgcmV0dXJuIEV2ZW50UXVldWUubGlzdC5sZW5ndGggPT0gMDsgfSwKKworICAgIG5leHRFdmVudDogZnVuY3Rpb24oaGUpIHsKKyAgICAgIGZvciAodmFyIGk9MCwgbHM9RXZlbnRRdWV1ZS5saXN0LCBsPWxzLmxlbmd0aDsgaTxsOyArK2kpIHsKKyAgICAgICAgaWYgKGxzW2ldID09IGhlKSByZXR1cm4gbHNbaSsxXTsKKyAgICAgIH0KKyAgICAgIHJldHVybiBudWxsOworICAgIH0sCisKKyAgICBtaW46IGZ1bmN0aW9uKCkgeworICAgICAgdmFyIGVsZW0gPSBFdmVudFF1ZXVlLmxpc3RbMF07CisgICAgICByZXR1cm4geworICAgICAgICB4OiBlbGVtLnZlcnRleC54LAorICAgICAgICB5OiBlbGVtLnlzdGFyCisgICAgICB9OworICAgIH0sCisKKyAgICBleHRyYWN0TWluOiBmdW5jdGlvbigpIHsKKyAgICAgIHJldHVybiBFdmVudFF1ZXVlLmxpc3Quc2hpZnQoKTsKKyAgICB9CisgIH07CisKKyAgRWRnZUxpc3QuaW5pdCgpOworICBTaXRlcy5ib3R0b21TaXRlID0gU2l0ZXMubGlzdC5zaGlmdCgpOworCisgIHZhciBuZXdTaXRlID0gU2l0ZXMubGlzdC5zaGlmdCgpLCBuZXdJbnRTdGFyOworICB2YXIgbGJuZCwgcmJuZCwgbGxibmQsIHJyYm5kLCBiaXNlY3RvcjsKKyAgdmFyIGJvdCwgdG9wLCB0ZW1wLCBwLCB2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2VjdG9yLCByYm5kKTsKKyAgICAgIGlmIChwKSB7CisgICAgICAgIEV2ZW50UXVldWUuaW5zZXJ0KGJpc2VjdG9yLCBwLCBHZW9tLmRpc3RhbmNlKHAsIG5ld1NpdGUpKTsKKyAgICAgIH0KKyAgICAgIG5ld1NpdGUgPSBTaXRlcy5saXN0LnNoaWZ0KCk7CisgICAgfSBlbHNlIGlmICghRXZlbnRRdWV1ZS5lbXB0eSgpKSB7IC8vaW50ZXJzZWN0aW9uIGlzIHNtYWxsZXN0CisgICAgICBsYm5kID0gRXZlbnRRdWV1ZS5leHRyYWN0TWluKCk7CisgICAgICBsbGJuZCA9IEVkZ2VMaXN0LmxlZnQobGJuZCk7CisgICAgICByYm5kID0gRWRnZUxpc3QucmlnaHQobGJuZCk7CisgICAgICBycmJuZCA9IEVkZ2VMaXN0LnJpZ2h0KHJibmQpOworICAgICAgYm90ID0gRWRnZUxpc3QubGVmdFJlZ2lvbihsYm5kKTsKKyAgICAgIHRvcCA9IEVkZ2VMaXN0LnJpZ2h0UmVnaW9uKHJibmQpOworICAgICAgdiA9IGxibmQudmVydGV4OworICAgICAgR2VvbS5lbmRQb2ludChsYm5kLmVkZ2UsIGxibmQuc2lkZSwgdik7CisgICAgICBHZW9tLmVuZFBvaW50KHJibmQuZWRnZSwgcmJuZC5zaWRlLCB2KTsKKyAgICAgIEVkZ2VMaXN0LmRlbChsYm5kKTsKKyAgICAgIEV2ZW50UXVldWUuZGVsKHJibmQpOworICAgICAgRWRnZUxpc3QuZGVsKHJibmQpOworICAgICAgcG0gPSAibCI7CisgICAgICBpZiAoYm90LnkgPiB0b3AueSkgeworICAgICAgICB0ZW1wID0gYm90OworICAgICAgICBib3QgPSB0b3A7CisgICAgICAgIHRvcCA9IHRlbXA7CisgICAgICAgIHBtID0gInIiOworICAgICAgfQorICAgICAgZSA9IEdlb20uYmlzZWN0KGJvdCwgdG9wKTsKKyAgICAgIGJpc2VjdG9yID0gRWRnZUxpc3QuY3JlYXRlSGFs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ICAgIGNsb3VkLnN0YXJ0ID0gZnVuY3Rpb24oKSB7CisgICAgICB2YXIgYm9hcmQgPSB6ZXJvQXJyYXkoKHNpemVbMF0gPj4gNSkgKiBzaXplWzFdKSwKKyAgICAgICAgICBib3VuZHMgPSBudWxsLAorICAgICAgICAgIG4gPSB3b3Jkcy5sZW5ndGgsCisgICAgICAgICAgaSA9IC0xLAorICAgICAgICAgIHRhZ3MgPSBbXSwKKyAgICAgICAgICBkYXRhID0gd29yZHMubWFwKGZ1bmN0aW9uKGQsIGkpIHsKKyAgICAgICAgICAgIGQudGV4dCA9IHRleHQuY2FsbCh0aGlzLCBkLCBpKTsKKyAgICAgICAgICAgIGQuZm9udCA9IGZvbnQuY2FsbCh0aGlzLCBkLCBpKTsKKyAgICAgICAgICAgIGQuc3R5bGUgPSBmb250U3R5bGUuY2FsbCh0aGlzLCBkLCBpKTsKKyAgICAgICAgICAgIGQud2VpZ2h0ID0gZm9udFdlaWdodC5jYWxsKHRoaXMsIGQsIGkpOworICAgICAgICAgICAgZC5yb3RhdGUgPSByb3RhdGUuY2FsbCh0aGlzLCBkLCBpKTsKKyAgICAgICAgICAgIGQuc2l6ZSA9IH5+Zm9udFNpemUuY2FsbCh0aGlzLCBkLCBpKTsKKyAgICAgICAgICAgIGQucGFkZGluZyA9IHBhZGRpbmcuY2FsbCh0aGlzLCBkLCBpKTsKKyAgICAgICAgICAgIHJldHVybiBkOworICAgICAgICAgIH0pLnNvcnQoZnVuY3Rpb24oYSwgYikgeyByZXR1cm4gYi5zaXplIC0gYS5zaXplOyB9KTsKKy8vICAgICAgY3JlYXRlTWFzaygpOworLyogICAgICB2YXIgYmQgPSAzMDAwOworICAgICAgd2hpbGUgKGJkIDwgNDAwMCkgeworICAgICAgICBib2FyZFtiZF0gPSAtMTsKKyAgICAgICAgYmQrKworICAgICAgfQorICAgICAgKi8KKyAgICAgIGZ1bmN0aW9uIGNyZWF0ZU1hc2soKQorICAgICAgeworICAgICAgICBkMy5zZWxlY3QoImJvZHkiKS5hcHBlbmQoImNhbnZhcyIpLmF0dHIoImlkIiwgIm1hc2tDYW52YXMiKQorICAgICAgICBtYXNrQ2FudmFzID0gZG9jdW1lbnQuZ2V0RWxlbWVudEJ5SWQoJ21hc2tDYW52YXMnKSwKKyAgICAgICAgbWFza0NhbnZhcy53aWR0aCA9IDg1OworICAgICAgICBtYXNrQ2FudmFzLmhlaWdodCA9IDg1OworICAgICAgICBtYXNrQ29udGV4dCA9IG1hc2tDYW52YXMuZ2V0Q29udGV4dCgnMmQnKTsKKyAgICAgICAgbWFza0ltYWdlID0gbmV3IEltYWdlKCk7CisgICAgICAgIG1hc2tJbWFnZS5zcmMgPSAnbWFzay5wbmcnOworICAgICAgICBtYXNrSW1hZ2Uub25sb2FkID0gZnVuY3Rpb24oKXsKKyAgICAgICAgbWFza0NvbnRleHQuZHJhd0ltYWdlKG1hc2tJbWFnZSwwLDAsODUsODUgKiBtYXNrSW1hZ2UuaGVpZ2h0IC8gbWFza0ltYWdlLndpZHRoKTsKKyAgICAgICAgbWFza0RhdGEgPSBtYXNrQ29udGV4dC5nZXRJbWFnZURhdGEoMCwwLDg1LDg1KS5kYXRhOworLyoKKyAgICAgICAgdmFyIGhoID0gMDsKKyAgICAgICAgd2hpbGUgKGhoIDwgbWFza0RhdGEubGVuZ3RoKSB7CisgICAgICAgICAgaWYgKGhoJTQgPT0gMCkgeworICAgICAgICAgICAgaWYgKG1hc2tEYXRhW2hoXSA9PSAwKSB7CisgICAgICAgICAgICAgIGJvYXJkW35+KGhoLzQpXSA9IC0xOworICAgICAgICAgICAgfQorICAgICAgICAgIH0KKyAgICAgICAgICBoaCsrOworICAgICAgICB9CisgICAgICAgICovCisKKyAgICAgICAgfQorICAgICAgfQorICAgICAgaWYgKHRpbWVyKSBjbGVhckludGVydmFsKHRpbWVyKTsKKyAgICAgIHRpbWVyID0gc2V0SW50ZXJ2YWwoc3RlcCwgMCk7CisgICAgICBzdGVwKCk7CisKKyAgICAgIHJldHVybiBjbG91ZDsKKworICAgICAgZnVuY3Rpb24gc3RlcCgpIHsKKyAgICAgICAgdmFyIHN0YXJ0ID0gK25ldyBEYXRlLAorICAgICAgICAgICAgZDsKKyAgICAgICAgd2hpbGUgKCtuZXcgRGF0ZSAtIHN0YXJ0IDwgdGltZUludGVydmFsICYmICsraSA8IG4gJiYgdGltZXIpIHsKKyAgICAgICAgICBkID0gZGF0YVtpXTsKKyAgICAgICAgICBkLnggPSAoc2l6ZVswXSAqIChNYXRoLnJhbmRvbSgpICsgLjUpKSA+PiAxOworICAgICAgICAgIGQueSA9IChzaXplWzFdICogKE1hdGgucmFuZG9tKCkgKyAuNSkpID4+IDE7CisgICAgICAgICAgY2xvdWRTcHJpdGUoZCwgZGF0YSwgaSk7CisgICAgICAgICAgaWYgKGQuaGFzVGV4dCAmJiBwbGFjZShib2FyZCwgZCwgYm91bmRzKSkgeworICAgICAgICAgICAgdGFncy5wdXNoKGQpOworICAgICAgICAgICAgZXZlbnQud29yZChkKTsKKyAgICAgICAgICAgIGlmIChib3VuZHMpIGNsb3VkQm91bmRzKGJvdW5kcywgZCk7CisgICAgICAgICAgICBlbHNlIGJvdW5kcyA9IFt7eDogZC54ICsgZC54MCwgeTogZC55ICsgZC55MH0sIHt4OiBkLnggKyBkLngxLCB5OiBkLnkgKyBkLnkxfV07CisgICAgICAgICAgICAvLyBUZW1wb3JhcnkgaGFjaworICAgICAgICAgICAgZC54IC09IHNpemVbMF0gPj4gMTsKKyAgICAgICAgICAgIGQueSAtPSBzaXplWzFdID4+IDE7CisgICAgICAgICAgfQorICAgICAgICB9CisgICAgICAgIGlmIChpID49IG4pIHsKKyAgICAgICAgICBjbG91ZC5zdG9wKCk7CisgICAgICAgICAgZXZlbnQuZW5kKHRhZ3MsIGJvdW5kcyk7CisgICAgICAgIH0KKyAgICAgIH0KKyAgICB9CisKKyAgICBjbG91ZC5zdG9wID0gZnVuY3Rpb24oKSB7CisgICAgICBpZiAodGltZXIpIHsKKyAgICAgICAgY2xlYXJJbnRlcnZhbCh0aW1lcik7CisgICAgICAgIHRpbWVyID0gbnVsbDsKKyAgICAgIH0KKyAgICAgIHJldHVybiBjbG91ZDsKKyAgICB9OworCisgICAgY2xvdWQudGltZUludGVydmFsID0gZnVuY3Rpb24oeCkgeworICAgICAgaWYgKCFhcmd1bWVudHMubGVuZ3RoKSByZXR1cm4gdGltZUludGVydmFsOworICAgICAgdGltZUludGVydmFsID0geCA9PSBudWxsID8gSW5maW5pdHkgOiB4OworICAgICAgcmV0dXJuIGNsb3VkOworICAgIH07CisKKyAgICBmdW5jdGlvbiBwbGFjZShib2FyZCwgdGFnLCBib3VuZHMpIHsKKyAgICAgIHZhciBwZXJpbWV0ZXIgPSBbe3g6IDAsIHk6IDB9LCB7eDogc2l6ZVswXSwgeTogc2l6ZVsxXX1dLAorICAgICAgICAgIHN0YXJ0WCA9IHRhZy54LAorICAgICAgICAgIHN0YXJ0WSA9IHRhZy55LAorICAgICAgICAgIG1heERlbHRhID0gTWF0aC5zcXJ0KHNpemVbMF0gKiBzaXplWzBdICsgc2l6ZVsxXSAqIHNpemVbMV0pLAorICAgICAgICAgIHMgPSBzcGlyYWwoc2l6ZSksCisgICAgICAgICAgZHQgPSBNYXRoLnJhbmRvbSgpIDwgLjUgPyAxIDogLTEsCisgICAgICAgICAgdCA9IC1kdCwKKyAgICAgICAgICBkeGR5LAorICAgICAgICAgIGR4LAorICAgICAgICAgIGR5OworCisgICAgICB3aGlsZSAoZHhkeSA9IHModCArPSBkdCkpIHsKKyAgICAgICAgZHggPSB+fmR4ZHlbMF07CisgICAgICAgIGR5ID0gfn5keGR5WzFdOworCisgICAgICAgIGlmIChNYXRoLm1pbihkeCwgZHkpID4gbWF4RGVsdGEpIGJyZWFrOworCisgICAgICAgIHRhZy54ID0gc3RhcnRYICsgZHg7CisgICAgICAgIHRhZy55ID0gc3RhcnRZICsgZHk7CisKKyAgICAgICAgaWYgKHRhZy54ICsgdGFnLngwIDwgMCB8fCB0YWcueSArIHRhZy55MCA8IDAgfHwKKyAgICAgICAgICAgIHRhZy54ICsgdGFnLngxID4gc2l6ZVswXSB8fCB0YWcueSArIHRhZy55MSA+IHNpemVbMV0pIGNvbnRpbnVlOworICAgICAgICAvLyBUT0RPIG9ubHkgY2hlY2sgZm9yIGNvbGxpc2lvbnMgd2l0aGluIGN1cnJlbnQgYm91bmRzLgorICAgICAgICBpZiAoIWJvdW5kcyB8fCAhY2xvdWRDb2xsaWRlKHRhZywgYm9hcmQsIHNpemVbMF0pKSB7CisgICAgICAgICAgaWYgKCFib3VuZHMgfHwgY29sbGlkZVJlY3RzKHRhZywgYm91bmRzKSkgeworICAgICAgICAgICAgdmFyIHNwcml0ZSA9IHRhZy5zcHJpdGUsCisgICAgICAgICAgICAgICAgdyA9IHRhZy53aWR0aCA+PiA1LAorICAgICAgICAgICAgICAgIHN3ID0gc2l6ZVswXSA+PiA1LAorICAgICAgICAgICAgICAgIGx4ID0gdGFnLnggLSAodyA8PCA0KSwKKyAgICAgICAgICAgICAgICBzeCA9IGx4ICYgMHg3ZiwKKyAgICAgICAgICAgICAgICBtc3ggPSAzMiAtIHN4LAorICAgICAgICAgICAgICAgIGggPSB0YWcueTEgLSB0YWcueTAsCisgICAgICAgICAgICAgICAgeCA9ICh0YWcueSArIHRhZy55MCkgKiBzdyArIChseCA+PiA1KSwKKyAgICAgICAgICAgICAgICBsYXN0OworICAgICAgICAgICAgZm9yICh2YXIgaiA9IDA7IGogPCBoOyBqKyspIHsKKyAgICAgICAgICAgICAgbGFzdCA9IDA7CisgICAgICAgICAgICAgIGZvciAodmFyIGkgPSAwOyBpIDw9IHc7IGkrKykgeworICAgICAgICAgICAgICAgIGJvYXJkW3ggKyBpXSB8PSAobGFzdCA8PCBtc3gpIHwgKGkgPCB3ID8gKGxhc3QgPSBzcHJpdGVbaiAqIHcgKyBpXSkgPj4+IHN4IDogMCk7CisgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgeCArPSBzdzsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGRlbGV0ZSB0YWcuc3ByaXRlOworICAgICAgICAgICAgcmV0dXJuIHRydWU7CisgICAgICAgICAgfQorICAgICAgICB9CisgICAgICB9CisgICAgICByZXR1cm4gZmFsc2U7CisgICAgfQorCisgICAgY2xvdWQud29yZHMgPSBmdW5jdGlvbih4KSB7CisgICAgICBpZiAoIWFyZ3VtZW50cy5sZW5ndGgpIHJldHVybiB3b3JkczsKKyAgICAgIHdvcmRzID0geDsKKyAgICAgIHJldHVybiBjbG91ZDsKKyAgICB9OworCisgICAgY2xvdWQuc2l6ZSA9IGZ1bmN0aW9uKHgpIHsKKyAgICAgIGlmICghYXJndW1lbnRzLmxlbmd0aCkgcmV0dXJuIHNpemU7CisgICAgICBzaXplID0gWyt4WzBdLCAreFsxXV07CisgICAgICByZXR1cm4gY2xvdWQ7CisgICAgfTsKKworICAgIGNsb3VkLmZvbnQgPSBmdW5jdGlvbih4KSB7CisgICAgICBpZiAoIWFyZ3VtZW50cy5sZW5ndGgpIHJldHVybiBmb250OworICAgICAgZm9udCA9IGQzLmZ1bmN0b3IoeCk7CisgICAgICByZXR1cm4gY2xvdWQ7CisgICAgfTsKKworICAgIGNsb3VkLmZvbnRTdHlsZSA9IGZ1bmN0aW9uKHgpIHsKKyAgICAgIGlmICghYXJndW1lbnRzLmxlbmd0aCkgcmV0dXJuIGZvbnRTdHlsZTsKKyAgICAgIGZvbnRTdHlsZSA9IGQzLmZ1bmN0b3IoeCk7CisgICAgICByZXR1cm4gY2xvdWQ7CisgICAgfTsKKworICAgIGNsb3VkLmZvbnRXZWlnaHQgPSBmdW5jdGlvbih4KSB7CisgICAgICBpZiAoIWFyZ3VtZW50cy5sZW5ndGgpIHJldHVybiBmb250V2VpZ2h0OworICAgICAgZm9udFdlaWdodCA9IGQzLmZ1bmN0b3IoeCk7CisgICAgICByZXR1cm4gY2xvdWQ7CisgICAgfTsKKworICAgIGNsb3VkLnJvdGF0ZSA9IGZ1bmN0aW9uKHgpIHsKKyAgICAgIGlmICghYXJndW1lbnRzLmxlbmd0aCkgcmV0dXJuIHJvdGF0ZTsKKyAgICAgIHJvdGF0ZSA9IGQzLmZ1bmN0b3IoeCk7CisgICAgICByZXR1cm4gY2xvdWQ7CisgICAgfTsKKworICAgIGNsb3VkLnRleHQgPSBmdW5jdGlvbih4KSB7CisgICAgICBpZiAoIWFyZ3VtZW50cy5sZW5ndGgpIHJldHVybiB0ZXh0OworICAgICAgdGV4dCA9IGQzLmZ1bmN0b3IoeCk7CisgICAgICByZXR1cm4gY2xvdWQ7CisgICAgfTsKKworICAgIGNsb3VkLnNwaXJhbCA9IGZ1bmN0aW9uKHgpIHsKKyAgICAgIGlmICghYXJndW1lbnRzLmxlbmd0aCkgcmV0dXJuIHNwaXJhbDsKKyAgICAgIHNwaXJhbCA9IHNwaXJhbHNbeCArICIiXSB8fCB4OworICAgICAgcmV0dXJuIGNsb3VkOworICAgIH07CisKKyAgICBjbG91ZC5mb250U2l6ZSA9IGZ1bmN0aW9uKHgpIHsKKyAgICAgIGlmICghYXJndW1lbnRzLmxlbmd0aCkgcmV0dXJuIGZvbnRTaXplOworICAgICAgZm9udFNpemUgPSBkMy5mdW5jdG9yKHgpOworICAgICAgcmV0dXJuIGNsb3VkOworICAgIH07CisKKyAgICBjbG91ZC5wYWRkaW5nID0gZnVuY3Rpb24oeCkgeworICAgICAgaWYgKCFhcmd1bWVudHMubGVuZ3RoKSByZXR1cm4gcGFkZGluZzsKKyAgICAgIHBhZGRpbmcgPSBkMy5mdW5jdG9yKHgpOworICAgICAgcmV0dXJuIGNsb3VkOworICAgIH07CisKKyAgICByZXR1cm4gZDMucmViaW5kKGNsb3VkLCBldmVudCwgIm9uIik7CisgIH0KKworICBmdW5jdGlvbiBjbG91ZFRleHQoZCkgeworICAgIHJldHVybiBkLnRleHQ7CisgIH0KKworICBmdW5jdGlvbiBjbG91ZEZvbnQoKSB7CisgICAgcmV0dXJuICJzZXJpZiI7CisgIH0KKworICBmdW5jdGlvbiBjbG91ZEZvbnROb3JtYWwoKSB7CisgICAgcmV0dXJuICJub3JtYWwiOworICB9CisKKyAgZnVuY3Rpb24gY2xvdWRGb250U2l6ZShkKSB7CisgICAgcmV0dXJuIE1hdGguc3FydChkLnZhbHVlKTsKKyAgfQorCisgIGZ1bmN0aW9uIGNsb3VkUm90YXRlKCkgeworICAgIHJldHVybiAofn4oTWF0aC5yYW5kb20oKSAqIDYpIC0gMykgKiAzMDsKKyAgfQorCisgIGZ1bmN0aW9uIGNsb3VkUGFkZGluZygpIHsKKyAgICByZXR1cm4gMTsKKyAgfQorCisgIC8vIEZldGNoZXMgYSBtb25vY2hyb21lIHNwcml0ZSBiaXRtYXAgZm9yIHRoZSBzcGVjaWZpZWQgdGV4dC4KKyAgLy8gTG9hZCBpbiBiYXRjaGVzIGZvciBzcGVlZC4KKyAgZnVuY3Rpb24gY2xvdWRTcHJpdGUoZCwgZGF0YSwgZGkpIHsKKyAgICBpZiAoZC5zcHJpdGUpIHJldHVybjsKKyAgICBjLmNsZWFyUmVjdCgwLCAwLCAoY3cgPDwgNSkgLyByYXRpbywgY2ggLyByYXRpbyk7CisgICAgdmFyIHggPSAwLAorICAgICAgICB5ID0gMCwKKyAgICAgICAgbWF4aCA9IDAsCisgICAgICAgIG4gPSBkYXRhLmxlbmd0aDsKKyAgICAtLWRpOworICAgIHdoaWxlICgrK2RpIDwgbikgeworICAgICAgZCA9IGRhdGFbZGldOworICAgICAgYy5zYXZlKCk7CisgICAgICBjLmZvbnQgPSBkLnN0eWxlICsgIiAiICsgZC53ZWlnaHQgKyAiICIgKyB+figoZC5zaXplICsgMSkgLyByYXRpbykgKyAicHggIiArIGQuZm9udDsKKyAgICAgIHZhciB3ID0gYy5tZWFzdXJlVGV4dChkLnRleHQgKyAibSIpLndpZHRoICogcmF0aW8sCisgICAgICAgICAgaCA9IGQuc2l6ZSA8PCAxOworICAgICAgaWYgKGQucm90YXRlKSB7CisgICAgICAgIHZhciBzciA9IE1hdGguc2luKGQucm90YXRlICogY2xvdWRSYWRpYW5zKSwKKyAgICAgICAgICAgIGNyID0gTWF0aC5jb3MoZC5yb3RhdGUgKiBjbG91ZFJhZGlhbnMpLAorICAgICAgICAgICAgd2NyID0gdyAqIGNyLAorICAgICAgICAgICAgd3NyID0gdyAqIHNyLAorICAgICAgICAgICAgaGNyID0gaCAqIGNyLAorICAgICAgICAgICAgaHNyID0gaCAqIHNyOworICAgICAgICB3ID0gKE1hdGgubWF4KE1hdGguYWJzKHdjciArIGhzciksIE1hdGguYWJzKHdjciAtIGhzcikpICsgMHgxZikgPj4gNSA8PCA1OworICAgICAgICBoID0gfn5NYXRoLm1heChNYXRoLmFicyh3c3IgKyBoY3IpLCBNYXRoLmFicyh3c3IgLSBoY3IpKTsKKyAgICAgIH0gZWxzZSB7CisgICAgICAgIHcgPSAodyArIDB4MWYpID4+IDUgPDwgNTsKKyAgICAgIH0KKyAgICAgIGlmIChoID4gbWF4aCkgbWF4aCA9IGg7CisgICAgICBpZiAoeCArIHcgPj0gKGN3IDw8IDUpKSB7CisgICAgICAgIHggPSAwOworICAgICAgICB5ICs9IG1heGg7CisgICAgICAgIG1heGggPSAwOworICAgICAgfQorICAgICAgaWYgKHkgKyBoID49IGNoKSBicmVhazsKKyAgICAgIGMudHJhbnNsYXRlKCh4ICsgKHcgPj4gMSkpIC8gcmF0aW8sICh5ICsgKGggPj4gMSkpIC8gcmF0aW8pOworICAgICAgaWYgKGQucm90YXRlKSBjLnJvdGF0ZShkLnJvdGF0ZSAqIGNsb3VkUmFkaWFucyk7CisgICAgICBjLmZpbGxUZXh0KGQudGV4dCwgMCwgMCk7CisgICAgICBpZiAoZC5wYWRkaW5nKSBjLmxpbmVXaWR0aCA9IDIgKiBkLnBhZGRpbmcsIGMuc3Ryb2tlVGV4dChkLnRleHQsIDAsIDApOworICAgICAgYy5yZXN0b3JlKCk7CisgICAgICBkLndpZHRoID0gdzsKKyAgICAgIGQuaGVpZ2h0ID0gaDsKKyAgICAgIGQueG9mZiA9IHg7CisgICAgICBkLnlvZmYgPSB5OworICAgICAgZC54MSA9IHcgPj4gMTsKKyAgICAgIGQueTEgPSBoID4+IDE7CisgICAgICBkLngwID0gLWQueDE7CisgICAgICBkLnkwID0gLWQueTE7CisgICAgICBkLmhhc1RleHQgPSB0cnVlOworICAgICAgeCArPSB3OworICAgIH0KKyAgICB2YXIgcGl4ZWxzID0gYy5nZXRJbWFnZURhdGEoMCwgMCwgKGN3IDw8IDUpIC8gcmF0aW8sIGNoIC8gcmF0aW8pLmRhdGEsCisgICAgICAgIHNwcml0ZSA9IFtdOworICAgIHdoaWxlICgtLWRpID49IDApIHsKKyAgICAgIGQgPSBkYXRhW2RpXTsKKyAgICAgIGlmICghZC5oYXNUZXh0KSBjb250aW51ZTsKKyAgICAgIHZhciB3ID0gZC53aWR0aCwKKyAgICAgICAgICB3MzIgPSB3ID4+IDUsCisgICAgICAgICAgaCA9IGQueTEgLSBkLnkwOworICAgICAgLy8gWmVybyB0aGUgYnVmZmVyCisgICAgICBmb3IgKHZhciBpID0gMDsgaSA8IGggKiB3MzI7IGkrKykgc3ByaXRlW2ldID0gMDsKKyAgICAgIHggPSBkLnhvZmY7CisgICAgICBpZiAoeCA9PSBudWxsKSByZXR1cm47CisgICAgICB5ID0gZC55b2ZmOworICAgICAgdmFyIHNlZW4gPSAwLAorICAgICAgICAgIHNlZW5Sb3cgPSAtMTsKKyAgICAgIGZvciAodmFyIGogPSAwOyBqIDwgaDsgaisrKSB7CisgICAgICAgIGZvciAodmFyIGkgPSAwOyBpIDwgdzsgaSsrKSB7CisgICAgICAgICAgdmFyIGsgPSB3MzIgKiBqICsgKGkgPj4gNSksCisgICAgICAgICAgICAgIG0gPSBwaXhlbHNbKCh5ICsgaikgKiAoY3cgPDwgNSkgKyAoeCArIGkpKSA8PCAyXSA/IDEgPDwgKDMxIC0gKGkgJSAzMikpIDogMDsKKyAgICAgICAgICBzcHJpdGVba10gfD0gbTsKKyAgICAgICAgICBzZWVuIHw9IG07CisgICAgICAgIH0KKyAgICAgICAgaWYgKHNlZW4pIHNlZW5Sb3cgPSBqOworICAgICAgICBlbHNlIHsKKyAgICAgICAgICBkLnkwKys7CisgICAgICAgICAgaC0tOworICAgICAgICAgIGotLTsKKyAgICAgICAgICB5Kys7CisgICAgICAgIH0KKyAgICAgIH0KKyAgICAgIGQueTEgPSBkLnkwICsgc2VlblJvdzsKKyAgICAgIGQuc3ByaXRlID0gc3ByaXRlLnNsaWNlKDAsIChkLnkxIC0gZC55MCkgKiB3MzIpOworICAgIH0KKyAgfQorCisgIC8vIFVzZSBtYXNrLWJhc2VkIGNvbGxpc2lvbiBkZXRlY3Rpb24uCisgIGZ1bmN0aW9uIGNsb3VkQ29sbGlkZSh0YWcsIGJvYXJkLCBzdykgeworICAgIHN3ID4+PSA1OworICAgIHZhciBzcHJpdGUgPSB0YWcuc3ByaXRlLAorICAgICAgICB3ID0gdGFnLndpZHRoID4+IDUsCisgICAgICAgIGx4ID0gdGFnLnggLSAodyA8PCA0KSwKKyAgICAgICAgc3ggPSBseCAmIDB4N2YsCisgICAgICAgIG1zeCA9IDMyIC0gc3gsCisgICAgICAgIGggPSB0YWcueTEgLSB0YWcueTAsCisgICAgICAgIHggPSAodGFnLnkgKyB0YWcueTApICogc3cgKyAobHggPj4gNSksCisgICAgICAgIGxhc3Q7CisgICAgZm9yICh2YXIgaiA9IDA7IGogPCBoOyBqKyspIHsKKyAgICAgIGxhc3QgPSAwOworICAgICAgZm9yICh2YXIgaSA9IDA7IGkgPD0gdzsgaSsrKSB7CisgICAgICAgIGlmICgoKGxhc3QgPDwgbXN4KSB8IChpIDwgdyA/IChsYXN0ID0gc3ByaXRlW2ogKiB3ICsgaV0pID4+PiBzeCA6IDApKQorICAgICAgICAgICAgJiBib2FyZFt4ICsgaV0pIHJldHVybiB0cnVlOworICAgICAgfQorICAgICAgeCArPSBzdzsKKyAgICB9CisgICAgcmV0dXJuIGZhbHNlOworICB9CisKKyAgZnVuY3Rpb24gY2xvdWRCb3VuZHMoYm91bmRzLCBkKSB7CisgICAgdmFyIGIwID0gYm91bmRzWzBdLAorICAgICAgICBiMSA9IGJvdW5kc1sxXTsKKyAgICBpZiAoZC54ICsgZC54MCA8IGIwLngpIGIwLnggPSBkLnggKyBkLngwOworICAgIGlmIChkLnkgKyBkLnkwIDwgYjAueSkgYjAueSA9IGQueSArIGQueTA7CisgICAgaWYgKGQueCArIGQueDEgPiBiMS54KSBiMS54ID0gZC54ICsgZC54MTsKKyAgICBpZiAoZC55ICsgZC55MSA+IGIxLnkpIGIxLnkgPSBkLnkgKyBkLnkxOworICB9CisKKyAgZnVuY3Rpb24gY29sbGlkZVJlY3RzKGEsIGIpIHsKKyAgICByZXR1cm4gYS54ICsgYS54MSA+IGJbMF0ueCAmJiBhLnggKyBhLngwIDwgYlsxXS54ICYmIGEueSArIGEueTEgPiBiWzBdLnkgJiYgYS55ICsgYS55MCA8IGJbMV0ueTsKKyAgfQorCisgIGZ1bmN0aW9uIGFyY2hpbWVkZWFuU3BpcmFsKHNpemUpIHsKKyAgICB2YXIgZSA9IHNpemVbMF0gLyBzaXplWzFdOworICAgIHJldHVybiBmdW5jdGlvbih0KSB7CisgICAgICByZXR1cm4gW2UgKiAodCAqPSAuMSkgKiBNYXRoLmNvcyh0KSwgdCAqIE1hdGguc2luKHQpXTsKKyAgICB9OworICB9CisKKyAgZnVuY3Rpb24gcmVjdGFuZ3VsYXJTcGlyYWwoc2l6ZSkgeworICAgIHZhciBkeSA9IDQsCisgICAgICAgIGR4ID0gZHkgKiBzaXplWzBdIC8gc2l6ZVsxXSwKKyAgICAgICAgeCA9IDAsCisgICAgICAgIHkgPSAwOworICAgIHJldHVybiBmdW5jdGlvbih0KSB7CisgICAgICB2YXIgc2lnbiA9IHQgPCAwID8gLTEgOiAxOworICAgICAgLy8gU2VlIHRyaWFuZ3VsYXIgbnVtYmVyczogVF9uID0gbiAqIChuICsgMSkgLyAyLgorICAgICAgc3dpdGNoICgoTWF0aC5zcXJ0K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cywKKyAgICAgIHNvcnRTdWJncm91cHMsCisgICAgICBzb3J0Q2hvcmRzOworCisgIGZ1bmN0aW9uIHJlbGF5b3V0KCkgeworICAgIHZhciBzdWJncm91cHMgPSB7fSwKKyAgICAgICAgZ3JvdXBTdW1zID0gW10sCisgICAgICAgIGdyb3VwSW5kZXggPSBkMy5yYW5nZShuKSwKKyAgICAgICAgc3ViZ3JvdXBJbmRleCA9IFtdLAorICAgICAgICBrLAorICAgICAgICB4LAorICAgICAgICB4MCwKKyAgICAgICAgaSwKKyAgICAgICAgajsKKworICAgIGNob3JkcyA9IFtdOworICAgIGdyb3VwcyA9IFtdOworCisgICAgLy8gQ29tcHV0ZSB0aGUgc3VtLgorICAgIGsgPSAwLCBpID0gLTE7IHdoaWxlICgrK2kgPCBuKSB7CisgICAgICB4ID0gMCwgaiA9IC0xOyB3aGlsZSAoKytqIDwgbikgeworICAgICAgICB4ICs9IG1hdHJpeFtpXVtqXTsKKyAgICAgIH0KKyAgICAgIGdyb3VwU3Vtcy5wdXNoKHgpOworICAgICAgc3ViZ3JvdXBJbmRleC5wdXNoKGQzLnJhbmdlKG4pKTsKKyAgICAgIGsgKz0geDsKKyAgICB9CisKKyAgICAvLyBTb3J0IGdyb3Vwc+KApgorICAgIGlmIChzb3J0R3JvdXBzKSB7CisgICAgICBncm91cEluZGV4LnNvcnQoZnVuY3Rpb24oYSwgYikgeworICAgICAgICByZXR1cm4gc29ydEdyb3Vwcyhncm91cFN1bXNbYV0sIGdyb3VwU3Vtc1tiXSk7CisgICAgICB9KTsKKyAgICB9CisKKyAgICAvLyBTb3J0IHN1Ymdyb3Vwc+KApgorICAgIGlmIChzb3J0U3ViZ3JvdXBzKSB7CisgICAgICBzdWJncm91cEluZGV4LmZvckVhY2goZnVuY3Rpb24oZCwgaSkgeworICAgICAgICBkLnNvcnQoZnVuY3Rpb24oYSwgYikgeworICAgICAgICAgIHJldHVybiBzb3J0U3ViZ3JvdXBzKG1hdHJpeFtpXVthXSwgbWF0cml4W2ldW2JdKTsKKyAgICAgICAgfSk7CisgICAgICB9KTsKKyAgICB9CisKKyAgICAvLyBDb252ZXJ0IHRoZSBzdW0gdG8gc2NhbGluZyBmYWN0b3IgZm9yIFswLCAycGldLgorICAgIC8vIFRPRE8gQWxsb3cgc3RhcnQgYW5kIGVuZCBhbmdsZSB0byBiZSBzcGVjaWZpZWQuCisgICAgLy8gVE9ETyBBbGxvdyBwYWRkaW5nIHRvIGJlIHNwZWNpZmllZCBhcyBwZXJjZW50YWdlPworICAgIGsgPSAoMiAqIE1hdGguUEkgLSBwYWRkaW5nICogbikgLyBrOworCisgICAgLy8gQ29tcHV0ZSB0aGUgc3RhcnQgYW5kIGVuZCBhbmdsZSBmb3IgZWFjaCBncm91cCBhbmQgc3ViZ3JvdXAuCisgICAgeCA9IDAsIGkgPSAtMTsgd2hpbGUgKCsraSA8IG4pIHsKKyAgICAgIHgwID0geCwgaiA9IC0xOyB3aGlsZSAoKytqIDwgbikgeworICAgICAgICB2YXIgZGkgPSBncm91cEluZGV4W2ldLAorICAgICAgICAgICAgZGogPSBzdWJncm91cEluZGV4W2ldW2pdLAorICAgICAgICAgICAgdiA9IG1hdHJpeFtkaV1bZGpdOworICAgICAgICBzdWJncm91cHNbZGkgKyAiLSIgKyBkal0gPSB7CisgICAgICAgICAgaW5kZXg6IGRpLAorICAgICAgICAgIHN1YmluZGV4OiBkaiwKKyAgICAgICAgICBzdGFydEFuZ2xlOiB4LAorICAgICAgICAgIGVuZEFuZ2xlOiB4ICs9IHYgKiBrLAorICAgICAgICAgIHZhbHVlOiB2CisgICAgICAgIH07CisgICAgICB9CisgICAgICBncm91cHMucHVzaCh7CisgICAgICAgIGluZGV4OiBkaSwKKyAgICAgICAgc3RhcnRBbmdsZTogeDAsCisgICAgICAgIGVuZEFuZ2xlOiB4LAorICAgICAgICB2YWx1ZTogKHggLSB4MCkgLyBrCisgICAgICB9KTsKKyAgICAgIHggKz0gcGFkZGluZzsKKyAgICB9CisKKyAgICAvLyBHZW5lcmF0ZSBjaG9yZHMgZm9yIGVhY2ggKG5vbi1lbXB0eSkgc3ViZ3JvdXAtc3ViZ3JvdXAgbGluay4KKyAgICBpID0gLTE7IHdoaWxlICgrK2kgPCBuKSB7CisgICAgICBqID0gaSAtIDE7IHdoaWxlICgrK2ogPCBuKSB7CisgICAgICAgIHZhciBzb3VyY2UgPSBzdWJncm91cHNbaSArICItIiArIGpdLAorICAgICAgICAgICAgdGFyZ2V0ID0gc3ViZ3JvdXBzW2ogKyAiLSIgKyBpXTsKKyAgICAgICAgaWYgKHNvdXJjZS52YWx1ZSB8fCB0YXJnZXQudmFsdWUpIHsKKyAgICAgICAgICBjaG9yZHMucHVzaCh7CisgICAgICAgICAgICBzb3VyY2U6IHNvdXJjZSwKKyAgICAgICAgICAgIHRhcmdldDogdGFyZ2V0CisgICAgICAgICAgfSkKKyAgICAgICAgfQorICAgICAgfQorICAgIH0KKworICAgIGlmIChzb3J0Q2hvcmRzKSByZXNvcnQoKTsKKyAgfQorCisgIGZ1bmN0aW9uIHJlc29ydCgpIHsKKyAgICBjaG9yZHMuc29ydChmdW5jdGlvbihhLCBiKSB7CisgICAgICBhID0gTWF0aC5taW4oYS5zb3VyY2UudmFsdWUsIGEudGFyZ2V0LnZhbHVlKTsKKyAgICAgIGIgPSBNYXRoLm1pbihiLnNvdXJjZS52YWx1ZSwgYi50YXJnZXQudmFsdWUpOworICAgICAgcmV0dXJuIHNvcnRDaG9yZHMoYSwgYik7CisgICAgfSk7CisgIH0KKworICBjaG9yZC5tYXRyaXggPSBmdW5jdGlvbih4KSB7CisgICAgaWYgKCFhcmd1bWVudHMubGVuZ3RoKSByZXR1cm4gbWF0cml4OworICAgIG4gPSAobWF0cml4ID0geCkgJiYgbWF0cml4Lmxlbmd0aDsKKyAgICBjaG9yZHMgPSBncm91cHMgPSBudWxsOworICAgIHJldHVybiBjaG9yZDsKKyAgfTsKKworICBjaG9yZC5wYWRkaW5nID0gZnVuY3Rpb24oeCkgeworICAgIGlmICghYXJndW1lbnRzLmxlbmd0aCkgcmV0dXJuIHBhZGRpbmc7CisgICAgcGFkZGluZyA9IHg7CisgICAgY2hvcmRzID0gZ3JvdXBzID0gbnVsbDsKKyAgICByZXR1cm4gY2hvcmQ7CisgIH07CisKKyAgY2hvcmQuc29ydEdyb3VwcyA9IGZ1bmN0aW9uKHgpIHsKKyAgICBpZiAoIWFyZ3VtZW50cy5sZW5ndGgpIHJldHVybiBzb3J0R3JvdXBzOworICAgIHNvcnRHcm91cHMgPSB4OworICAgIGNob3JkcyA9IGdyb3VwcyA9IG51bGw7CisgICAgcmV0dXJuIGNob3JkOworICB9OworCisgIGNob3JkLnNvcnRTdWJncm91cHMgPSBmdW5jdGlvbih4KSB7CisgICAgaWYgKCFhcmd1bWVudHMubGVuZ3RoKSByZXR1cm4gc29ydFN1Ymdyb3VwczsKKyAgICBzb3J0U3ViZ3JvdXBzID0geDsKKyAgICBjaG9yZHMgPSBudWxsOworICAgIHJldHVybiBjaG9yZDsKKyAgfTsKKworICBjaG9yZC5zb3J0Q2hvcmRzID0gZnVuY3Rpb24oeCkgeworICAgIGlmICghYXJndW1lbnRzLmxlbmd0aCkgcmV0dXJuIHNvcnRDaG9yZHM7CisgICAgc29ydENob3JkcyA9IHg7CisgICAgaWYgKGNob3JkcykgcmVzb3J0KCk7CisgICAgcmV0dXJuIGNob3JkOworICB9OworCisgIGNob3JkLmNob3JkcyA9IGZ1bmN0aW9uKCkgeworICAgIGlmICghY2hvcmRzKSByZWxheW91dCgpOworICAgIHJldHVybiBjaG9yZHM7CisgIH07CisKKyAgY2hvcmQuZ3JvdXBzID0gZnVuY3Rpb24oKSB7CisgICAgaWYgKCFncm91cHMpIHJlbGF5b3V0KCk7CisgICAgcmV0dXJuIGdyb3VwczsKKyAgfTsKKworICByZXR1cm4gY2hvcmQ7Cit9OworLy8gQSBydWRpbWVudGFyeSBmb3JjZSBsYXlvdXQgdXNpbmcgR2F1c3MtU2VpZGVsLgorZDMubGF5b3V0LmZvcmNlID0gZnVuY3Rpb24oKSB7CisgIHZhciBmb3JjZSA9IHt9LAorICAgICAgZXZlbnQgPSBkMy5kaXNwYXRjaCgidGljayIpLAorICAgICAgc2l6ZSA9IFsxLCAxXSwKKyAgICAgIGFscGhhID0gLjUsCisgICAgICBkaXN0YW5jZSA9IDMwLAorICAgICAgaW50ZXJ2YWwsCisgICAgICBub2RlcywKKyAgICAgIGxpbmtzLAorICAgICAgZGlzdGFuY2VzOworCisgIGZ1bmN0aW9uIHRpY2soKSB7CisgICAgdmFyIG4gPSBkaXN0YW5jZXMubGVuZ3RoLAorICAgICAgICBpLCAvLyBjdXJyZW50IGluZGV4CisgICAgICAgIG8sIC8vIGN1cnJlbnQgbGluaworICAgICAgICBzLCAvLyBjdXJyZW50IHNvdXJjZQorICAgICAgICB0LCAvLyBjdXJyZW50IHRhcmdldAorICAgICAgICBsLCAvLyBjdXJyZW50IGRpc3RhbmNlCisgICAgICAgIHgsIC8vIHgtZGlzdGFuY2UKKyAgICAgICAgeTsgLy8geS1kaXN0YW5jZQorCisgICAgLy8gZ2F1c3Mtc2VpZGVsIHJlbGF4YXRpb24KKyAgICBmb3IgKGkgPSAwOyBpIDwgbjsgKytpKSB7CisgICAgICBvID0gZGlzdGFuY2VzW2ldOworICAgICAgcyA9IG8uc291cmNlOworICAgICAgdCA9IG8udGFyZ2V0OworICAgICAgeCA9IHQueCAtIHMueDsKKyAgICAgIHkgPSB0LnkgLSBzLnk7CisgICAgICBpZiAobCA9IE1hdGguc3FydCh4ICogeCArIHkgKiB5KSkgeworICAgICAgICBsID0gYWxwaGEgLyAoby5kaXN0YW5jZSAqIG8uZGlzdGFuY2UpICogKGwgLSBkaXN0YW5jZSAqIG8uZGlzdGFuY2UpIC8gbDsKKyAgICAgICAgeCAqPSBsOworICAgICAgICB5ICo9IGw7CisgICAgICAgIGlmICghdC5maXhlZCkgeworICAgICAgICAgIHQueCAtPSB4OworICAgICAgICAgIHQueSAtPSB5OworICAgICAgICB9CisgICAgICAgIGlmICghcy5maXhlZCkgeworICAgICAgICAgIHMueCArPSB4OworICAgICAgICAgIHMueSArPSB5OworICAgICAgICB9CisgICAgICB9CisgICAgfQorCisgICAgZXZlbnQudGljay5kaXNwYXRjaCh7dHlwZTogInRpY2sifSk7CisKKyAgICAvLyBzaW11bGF0ZWQgYW5uZWFsaW5nLCBiYXNpY2FsbHkKKyAgICByZXR1cm4gKGFscGhhICo9IC45OSkgPCAuMDA1OworICB9CisKKyAgZm9yY2Uub24gPSBmdW5jdGlvbih0eXBlLCBsaXN0ZW5lcikgeworICAgIGV2ZW50W3R5cGVdLmFkZChsaXN0ZW5lcik7CisgICAgcmV0dXJuIGZvcmNlOworICB9OworCisgIGZvcmNlLm5vZGVzID0gZnVuY3Rpb24oeCkgeworICAgIGlmICghYXJndW1lbnRzLmxlbmd0aCkgcmV0dXJuIG5vZGVzOworICAgIG5vZGVzID0geDsKKyAgICByZXR1cm4gZm9yY2U7CisgIH07CisKKyAgZm9yY2UubGlua3MgPSBmdW5jdGlvbih4KSB7CisgICAgaWYgKCFhcmd1bWVudHMubGVuZ3RoKSByZXR1cm4gbGlua3M7CisgICAgbGlua3MgPSB4OworICAgIHJldHVybiBmb3JjZTsKKyAgfTsKKworICBmb3JjZS5zaXplID0gZnVuY3Rpb24oeCkgeworICAgIGlmICghYXJndW1lbnRzLmxlbmd0aCkgcmV0dXJuIHNpemU7CisgICAgc2l6ZSA9IHg7CisgICAgcmV0dXJuIGZvcmNlOworICB9OworCisgIGZvcmNlLmRpc3RhbmNlID0gZnVuY3Rpb24oZCkgeworICAgIGlmICghYXJndW1lbnRzLmxlbmd0aCkgcmV0dXJuIGRpc3RhbmNlOworICAgIGRpc3RhbmNlID0gZDsKKyAgICByZXR1cm4gZm9yY2U7CisgIH07CisKKyAgZm9yY2Uuc3RhcnQgPSBmdW5jdGlvbigpIHsKKyAgICB2YXIgaSwKKyAgICAgICAgaiwKKyAgICAgICAgaywKKyAgICAgICAgbiA9IG5vZGVzLmxlbmd0aCwKKyAgICAgICAgbSA9IGxpbmtzLmxlbmd0aCwKKyAgICAgICAgdyA9IHNpemVbMF0sCisgICAgICAgIGggPSBzaXplWzFdLAorICAgICAgICBvOworCisgICAgdmFyIHBhdGhzID0gW107CisgICAgZm9yIChpID0gMDsgaSA8IG47ICsraSkgeworICAgICAgbyA9IG5vZGVzW2ldOworICAgICAgby54ID0gby54IHx8IE1hdGgucmFuZG9tKCkgKiB3OworICAgICAgby55ID0gby55IHx8IE1hdGgucmFuZG9tKCkgKiBoOworICAgICAgby5maXhlZCA9IDA7CisgICAgICBwYXRoc1tpXSA9IFtdOworICAgICAgZm9yIChqID0gMDsgaiA8IG47ICsraikgeworICAgICAgICBwYXRoc1tpXVtqXSA9IEluZmluaXR5OworICAgICAgfQorICAgICAgcGF0aHNbaV1baV0gPSAwOworICAgIH0KKworICAgIGZvciAoaSA9IDA7IGkgPCBtOyArK2kpIHsKKyAgICAgIG8gPSBsaW5rc1tpXTsKKyAgICAgIHBhdGhzW28uc291cmNlXVtvLnRhcmdldF0gPSAxOworICAgICAgcGF0aHNbby50YXJnZXRdW28uc291cmNlXSA9IDE7CisgICAgICBvLnNvdXJjZSA9IG5vZGVzW28uc291cmNlXTsKKyAgICAgIG8udGFyZ2V0ID0gbm9kZXNbby50YXJnZXRdOworICAgIH0KKworICAgIC8vIEZsb3lkLVdhcnNoYWxsCisgICAgZm9yIChrID0gMDsgayA8IG47ICsraykgeworICAgICAgZm9yIChpID0gMDsgaSA8IG47ICsraSkgeworICAgICAgICBmb3IgKGogPSAwOyBqIDwgbjsgKytqKSB7CisgICAgICAgICAgcGF0aHNbaV1bal0gPSBNYXRoLm1pbihwYXRoc1tpXVtqXSwgcGF0aHNbaV1ba10gKyBwYXRoc1trXVtqXSk7CisgICAgICAgIH0KKyAgICAgIH0KKyAgICB9CisKKyAgICBkaXN0YW5jZXMgPSBbXTsKKyAgICBmb3IgKGkgPSAwOyBpIDwgbjsgKytpKSB7CisgICAgICBmb3IgKGogPSBpICsgMTsgaiA8IG47ICsraikgeworICAgICAgICBkaXN0YW5jZXMucHVzaCh7CisgICAgICAgICAgc291cmNlOiBub2Rlc1tpXSwKKyAgICAgICAgICB0YXJnZXQ6IG5vZGVzW2pdLAorICAgICAgICAgIGRpc3RhbmNlOiBwYXRoc1tpXVtqXSAqIHBhdGhzW2ldW2pdCisgICAgICAgIH0pOworICAgICAgfQorICAgIH0KKworICAgIGRpc3RhbmNlcy5zb3J0KGZ1bmN0aW9uKGEsIGIpIHsKKyAgICAgIHJldHVybiBhLmRpc3RhbmNlIC0gYi5kaXN0YW5jZTsKKyAgICB9KTsKKworICAgIGQzLnRpbWVyKHRpY2spOworICAgIHJldHVybiBmb3JjZTsKKyAgfTsKKworICBmb3JjZS5yZXN1bWUgPSBmdW5jdGlvbigpIHsKKyAgICBhbHBoYSA9IC4xOworICAgIGQzLnRpbWVyKHRpY2spOworICAgIHJldHVybiBmb3JjZTsKKyAgfTsKKworICBmb3JjZS5zdG9wID0gZnVuY3Rpb24oKSB7CisgICAgYWxwaGEgPSAwOworICAgIHJldHVybiBmb3JjZTsKKyAgfTsKKworICAvLyB1c2UgYG5vZGUuY2FsbChmb3JjZS5kcmFnKWAgdG8gbWFrZSBub2RlcyBkcmFnZ2FibGUKKyAgZm9yY2UuZHJhZyA9IGZ1bmN0aW9uKCkgeworICAgIHZhciBub2RlLCBlbGVtZW50OworCisgICAgdGhpcworICAgICAgLm9uKCJtb3VzZW92ZXIiLCBmdW5jdGlvbihkKSB7IGQuZml4ZWQgPSB0cnVlOyB9KQorICAgICAgLm9uKCJtb3VzZW91dCIsIGZ1bmN0aW9uKGQpIHsgaWYgKGQgIT0gbm9kZSkgZC5maXhlZCA9IGZhbHNlOyB9KQorICAgICAgLm9uKCJtb3VzZWRvd24iLCBtb3VzZWRvd24pOworCisgICAgZDMuc2VsZWN0KHdpbmRvdykKKyAgICAgIC5vbigibW91c2Vtb3ZlIiwgbW91c2Vtb3ZlKQorICAgICAgLm9uKCJtb3VzZXVwIiwgbW91c2V1cCk7CisKKyAgICBmdW5jdGlvbiBtb3VzZWRvd24oZCkgeworICAgICAgKG5vZGUgPSBkKS5maXhlZCA9IHRydWU7CisgICAgICBlbGVtZW50ID0gdGhpczsKKyAgICAgIGQzLmV2ZW50LnByZXZlbnREZWZhdWx0KCk7CisgICAgfQorCisgICAgZnVuY3Rpb24gbW91c2Vtb3ZlKCkgeworICAgICAgaWYgKCFub2RlKSByZXR1cm47CisgICAgICB2YXIgbSA9IGQzLnN2Zy5tb3VzZShlbGVtZW50KTsKKyAgICAgIG5vZGUueCA9IG1bMF07CisgICAgICBub2RlLnkgPSBtWzFdOworICAgICAgZm9yY2UucmVzdW1lKCk7IC8vIHJlc3RhcnQgYW5uZWFsaW5nCisgICAgfQorCisgICAgZnVuY3Rpb24gbW91c2V1cCgpIHsKKyAgICAgIGlmICghbm9kZSkgcmV0dXJuOworICAgICAgbW91c2Vtb3ZlKCk7CisgICAgICBub2RlLmZpeGVkID0gZmFsc2U7CisgICAgICBub2RlID0gZWxlbWVudCA9IG51bGw7CisgICAgfQorCisgICAgcmV0dXJuIGZvcmNlOworICB9OworCisgIHJldHVybiBmb3JjZTsKK307CitkMy5sYXlvdXQucGFydGl0aW9uID0gZnVuY3Rpb24oKSB7CisgIHZhciBoaWVyYXJjaHkgPSBkMy5sYXlvdXQuaGllcmFyY2h5KCksCisgICAgICBzaXplID0gWzEsIDFdOyAvLyB3aWR0aCwgaGVpZ2h0CisKKyAgZnVuY3Rpb24gcG9zaXRpb24obm9kZSwgeCwgZHgsIGR5KSB7CisgICAgdmFyIGNoaWxkcmVuID0gbm9kZS5jaGlsZHJlbjsKKyAgICBub2RlLnggPSB4OworICAgIG5vZGUueSA9IG5vZGUuZGVwdGggKiBkeTsKKyAgICBub2RlLmR4ID0gZHg7CisgICAgbm9kZS5keSA9IGR5OworICAgIGlmIChjaGlsZHJlbikgeworICAgICAgdmFyIGkgPSAtMSwKKyAgICAgICAgICBuID0gY2h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GJvdHRvbSA9IDAsCisgICAgICAgIHRvcHMgPSBbXSwKKyAgICAgICAgYm90dG9tcyA9IFtdOworICAgIGZvciAoaSA9IDA7IGkgPCBuOyBpKyspIHsKKyAgICAgIGogPSBpbmRleFtpXTsKKyAgICAgIGlmICh0b3AgPCBib3R0b20pIHsKKyAgICAgICAgdG9wICs9IHN1bXNbal07CisgICAgICAgIHRvcHMucHVzaChqKTsKKyAgICAgIH0gZWxzZSB7CisgICAgICAgIGJvdHRvbSArPSBzdW1zW2pdOworICAgICAgICBib3R0b21zLnB1c2goaik7CisgICAgICB9CisgICAgfQorICAgIHJldHVybiBib3R0b21zLnJldmVyc2UoKS5jb25jYXQodG9wcyk7CisgIH0sCisKKyAgInJldmVyc2UiOiBmdW5jdGlvbihkYXRhKSB7CisgICAgcmV0dXJuIGQzLnJhbmdlKGRhdGEubGVuZ3RoKS5yZXZlcnNlKCk7CisgIH0sCisKKyAgImRlZmF1bHQiOiBmdW5jdGlvbihkYXRhKSB7CisgICAgcmV0dXJuIGQzLnJhbmdlKGRhdGEubGVuZ3RoKTsKKyAgfQorCit9OworCit2YXIgZDNfbGF5b3V0X3N0YWNrT2Zmc2V0cyA9IHsKKworICAic2lsaG91ZXR0ZSI6IGZ1bmN0aW9uKGRhdGEsIGluZGV4KSB7CisgICAgdmFyIG4gPSBkYXRhLmxlbmd0aCwKKyAgICAgICAgbSA9IGRhdGFbMF0ubGVuZ3RoLAorICAgICAgICBzdW1zID0gW10sCisgICAgICAgIG1heCA9IDAsCisgICAgICAgIGksCisgICAgICAgIGosCisgICAgICAgIG87CisgICAgZm9yIChqID0gMDsgaiA8IG07ICsraikgeworICAgICAgZm9yIChpID0gMCwgbyA9IDA7IGkgPCBuOyBpKyspIG8gKz0gZGF0YVtpXVtqXS55OworICAgICAgaWYgKG8gPiBtYXgpIG1heCA9IG87CisgICAgICBzdW1zLnB1c2gobyk7CisgICAgfQorICAgIGZvciAoaiA9IDAsIGkgPSBpbmRleFswXTsgaiA8IG07ICsraikgeworICAgICAgZGF0YVtpXVtqXS55MCA9IChtYXggLSBzdW1zW2pdKSAvIDI7CisgICAgfQorICB9LAorCisgICJ3aWdnbGUiOiBmdW5jdGlvbihkYXRhLCBpbmRleCkgeworICAgIHZhciBuID0gZGF0YS5sZW5ndGgsCisgICAgICAgIHggPSBkYXRhWzBdLAorICAgICAgICBtID0geC5sZW5ndGgsCisgICAgICAgIG1heCA9IDAsCisgICAgICAgIGksCisgICAgICAgIGosCisgICAgICAgIGssCisgICAgICAgIGlpLAorICAgICAgICBpaywKKyAgICAgICAgaTAgPSBpbmRleFswXSwKKyAgICAgICAgczEsCisgICAgICAgIHMyLAorICAgICAgICBzMywKKyAgICAgICAgZHgsCisgICAgICAgIG8sCisgICAgICAgIG8wOworICAgIGRhdGFbaTBdWzBdLnkwID0gbyA9IG8wID0gMDsKKyAgICBmb3IgKGogPSAxOyBqIDwgbTsgKytqKSB7CisgICAgICBmb3IgKGkgPSAwLCBzMSA9IDA7IGkgPCBuOyArK2kpIHMxICs9IGRhdGFbaV1bal0ueTsKKyAgICAgIGZvciAoaSA9IDAsIHMyID0gMCwgZHggPSB4W2pdLnggLSB4W2ogLSAxXS54OyBpIDwgbjsgKytpKSB7CisgICAgICAgIGZvciAoayA9IDAsIGlpID0gaW5kZXhbaV0sIHMzID0gKGRhdGFbaWldW2pdLnkgLSBkYXRhW2lpXVtqIC0gMV0ueSkgLyAoMiAqIGR4KTsgayA8IGk7ICsraykgeworICAgICAgICAgIHMzICs9IChkYXRhW2lrID0gaW5kZXhba11dW2pdLnkgLSBkYXRhW2lrXVtqIC0gMV0ueSkgLyBkeDsKKyAgICAgICAgfQorICAgICAgICBzMiArPSBzMyAqIGRhdGFbaWldW2pdLnk7CisgICAgICB9CisgICAgICBkYXRhW2kwXVtqXS55MCA9IG8gLT0gczEgPyBzMiAvIHMxICogZHggOiAwOworICAgICAgaWYgKG8gPCBvMCkgbzAgPSBvOworICAgIH0KKyAgICBmb3IgKGogPSAwOyBqIDwgbTsgKytqKSBkYXRhW2kwXVtqXS55MCAtPSBvMDsKKyAgfSwKKworICAiemVybyI6IGZ1bmN0aW9uKGRhdGEsIGluZGV4KSB7CisgICAgdmFyIGogPSAwLAorICAgICAgICBtID0gZGF0YVswXS5sZW5ndGgsCisgICAgICAgIGkwID0gaW5kZXhbMF07CisgICAgZm9yICg7IGogPCBtOyArK2opIGRhdGFbaTBdW2pdLnkwID0gMDsKKyAgfQorCit9OworCitmdW5jdGlvbiBkM19sYXlvdXRfc3RhY2tSZWR1Y2VTdW0oZCkgeworICByZXR1cm4gZC5yZWR1Y2UoZDNfbGF5b3V0X3N0YWNrU3VtLCAwKTsKK30KKworZnVuY3Rpb24gZDNfbGF5b3V0X3N0YWNrTWF4SW5kZXgoYXJyYXkpIHsKKyAgdmFyIGkgPSAxLAorICAgICAgaiA9IDAsCisgICAgICB2ID0gYXJyYXlbMF0ueSwKKyAgICAgIGssCisgICAgICBuID0gYXJyYXkubGVuZ3RoOworICBmb3IgKDsgaSA8IG47ICsraSkgeworICAgIGlmICgoayA9IGFycmF5W2ldLnkpID4gdikgeworICAgICAgaiA9IGk7CisgICAgICB2ID0gazsKKyAgICB9CisgIH0KKyAgcmV0dXJuIGo7Cit9CisKK2Z1bmN0aW9uIGQzX2xheW91dF9zdGFja1N1bShwLCBkKSB7CisgIHJldHVybiBwICsgZC55OworfQorZDMubGF5b3V0LmhpZXJhcmNoeSA9IGZ1bmN0aW9uKCkgeworICB2YXIgc29ydCA9IGQzX2xheW91dF9oaWVyYXJjaHlTb3J0LAorICAgICAgY2hpbGRyZW4gPSBkM19sYXlvdXRfaGllcmFyY2h5Q2hpbGRyZW4sCisgICAgICB2YWx1ZSA9IGQzX2xheW91dF9oaWVyYXJjaHlWYWx1ZTsKKworICAvLyBSZWN1cnNpdmVseSBjb21wdXRlIHRoZSBub2RlIGRlcHRoIGFuZCB2YWx1ZS4KKyAgLy8gQWxzbyBjb252ZXJ0cyB0aGUgZGF0YSByZXByZXNlbnRhdGlvbiBpbnRvIGEgc3RhbmRhcmQgaGllcmFyY2h5IHN0cnVjdHVyZS4KKyAgZnVuY3Rpb24gcmVjdXJzZShkYXRhLCBkZXB0aCwgbm9kZXMpIHsKKyAgICB2YXIgZGF0YXMgPSBjaGlsZHJlbi5jYWxsKGhpZXJhcmNoeSwgZGF0YSwgZGVwdGgpLAorICAgICAgICBub2RlID0ge2RlcHRoOiBkZXB0aCwgZGF0YTogZGF0YX07CisgICAgbm9kZXMucHVzaChub2RlKTsKKyAgICBpZiAoZGF0YXMpIHsKKyAgICAgIHZhciBpID0gLTEsCisgICAgICAgICAgbiA9IGRhdGFzLmxlbmd0aCwKKyAgICAgICAgICBjID0gbm9kZS5jaGlsZHJlbiA9IFtdLAorICAgICAgICAgIHYgPSAwLAorICAgICAgICAgIGogPSBkZXB0aCArIDE7CisgICAgICB3aGlsZSAoKytpIDwgbikgeworICAgICAgICBkID0gcmVjdXJzZShkYXRhc1tpXSwgaiwgbm9kZXMpOworICAgICAgICBpZiAoZC52YWx1ZSA+IDApIHsgLy8gaWdub3JlIE5hTiwgbmVnYXRpdmUsIGV0Yy4KKyAgICAgICAgICBjLnB1c2goZCk7CisgICAgICAgICAgdiArPSBkLnZhbHVlOworICAgICAgICAgIGQucGFyZW50ID0gbm9kZTsKKyAgICAgICAgfQorICAgICAgfQorICAgICAgaWYgKHNvcnQpIGMuc29ydChzb3J0KTsKKyAgICAgIG5vZGUudmFsdWUgPSB2OworICAgIH0gZWxzZSB7CisgICAgICBub2RlLnZhbHVlID0gdmFsdWUuY2FsbChoaWVyYXJjaHksIGRhdGEsIGRlcHRoKTsKKyAgICB9CisgICAgcmV0dXJuIG5vZGU7CisgIH0KKworICAvLyBSZWN1cnNpdmVseSByZS1ldmFsdWF0ZXMgdGhlIG5vZGUgdmFsdWUuCisgIGZ1bmN0aW9uIHJldmFsdWUobm9kZSwgZGVwdGgpIHsKKyAgICB2YXIgY2hpbGRyZW4gPSBub2RlLmNoaWxkcmVuLAorIC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HggOiByZWN0LmR5LCByZWN0LCAhY2hpbGRyZW4ubGVuZ3RoKTsKKyAgICAgICAgcm93Lmxlbmd0aCA9IHJvdy5hcmVhID0gMDsKKyAgICAgIH0KKyAgICB9CisgICAgbm9kZS5jaGlsZHJlbi5mb3JFYWNoKHN0aWNraWZ5KTsKKyAgfQorCisgIC8vIENvbXB1dGVzIHRoZSBzY29yZSBmb3IgdGhlIHNwZWNpZmllZCByb3csIGFzIHRoZSB3b3JzdCBhc3BlY3QgcmF0aW8uCisgIGZ1bmN0aW9uIHdvcnN0KHJvdywgdSkgeworICAgIHZhciBzID0gcm93LmFyZWEsCisgICAgICAgIHIsCisgICAgICAgIHJtYXggPSAwLAorICAgICAgICBybWluID0gSW5maW5pdHksCisgICAgICAgIGkgPSAtMSwKKyAgICAgICAgbiA9IHJvdy5sZW5ndGg7CisgICAgd2hpbGUgKCsraSA8IG4pIHsKKyAgICAgIHIgPSByb3dbaV0uYXJlYTsKKyAgICAgIGlmIChyIDwgcm1pbikgcm1pbiA9IHI7CisgICAgICBpZiAociA+IHJtYXgpIHJtYXggPSByOworICAgIH0KKyAgICBzICo9IHM7CisgICAgdSAqPSB1OworICAgIHJldHVybiBNYXRoLm1heCgodSAqIHJtYXgpIC8gcywgcyAvICh1ICogcm1pbikpOworICB9CisKKyAgLy8gUG9zaXRpb25zIHRoZSBzcGVjaWZpZWQgcm93IG9mIG5vZGVzLiBNb2RpZmllcyBgcmVjdGAuCisgIGZ1bmN0aW9uIHBvc2l0aW9uKHJvdywgdSwgcmVjdCwgZmx1c2gpIHsKKyAgICB2YXIgaSA9IC0xLAorICAgICAgICBuID0gcm93Lmxlbmd0aCwKKyAgICAgICAgeCA9IHJlY3QueCwKKyAgICAgICAgeSA9IHJlY3QueSwKKyAgICAgICAgdiA9IHUgPyByb3VuZChyb3cuYXJlYSAvIHUpIDogMCwKKyAgICAgICAgbzsKKyAgICBpZiAodSA9PSByZWN0LmR4KSB7IC8vIGhvcml6b250YWwgc3ViZGl2aXNpb24KKyAgICAgIGlmIChmbHVzaCB8fCB2ID4gcmVjdC5keSkgdiA9IHJlY3QuZHk7IC8vIG92ZXIrdW5kZXJmbG93CisgICAgICB3aGlsZSAoKytpIDwgbikgeworICAgICAgICBvID0gcm93W2ldOworICAgICAgICBvLnggPSB4OworICAgICAgICBvLnkgPSB5OworICAgICAgICBvLmR5ID0gdjsKKyAgICAgICAgeCArPSBvLmR4ID0gcm91bmQoby5hcmVhIC8gdik7CisgICAgICB9CisgICAgICBvLnogPSB0cnVlOworICAgICAgby5keCArPSByZWN0LnggKyByZWN0LmR4IC0geDsgLy8gcm91bmRpbmcgZXJyb3IKKyAgICAgIHJlY3QueSArPSB2OworICAgICAgcmVjdC5keSAtPSB2OworICAgIH0gZWxzZSB7IC8vIHZlcnRpY2FsIHN1YmRpdmlzaW9uCisgICAgICBpZiAoZmx1c2ggfHwgdiA+IHJlY3QuZHgpIHYgPSByZWN0LmR4OyAvLyBvdmVyK3VuZGVyZmxvdworICAgICAgd2hpbGUgKCsraSA8IG4pIHsKKyAgICAgICAgbyA9IHJvd1tpXTsKKyAgICAgICAgby54ID0geDsKKyAgICAgICAgby55ID0geTsKKyAgICAgICAgby5keCA9IHY7CisgICAgICAgIHkgKz0gby5keSA9IHJvdW5kKG8uYXJlYSAvIHYpOworICAgICAgfQorICAgICAgby56ID0gZmFsc2U7CisgICAgICBvLmR5ICs9IHJlY3QueSArIHJlY3QuZHkgLSB5OyAvLyByb3VuZGluZyBlcnJvcgorICAgICAgcmVjdC54ICs9IHY7CisgICAgICByZWN0LmR4IC09IHY7CisgICAgfQorICB9CisKKyAgZnVuY3Rpb24gdHJlZW1hcChkKSB7CisgICAgdmFyIG5vZGVzID0gc3RpY2tpZXMgfHwgaGllcmFyY2h5KGQpLAorICAgICAgICByb290ID0gbm9kZXNbMF07CisgICAgcm9vdC54ID0gMDsKKyAgICByb290LnkgPSAwOworICAgIHJvb3QuZHggPSBzaXplWzBdOworICAgIHJvb3QuZHkgPSBzaXplWzFdOworICAgIGlmIChzdGlja2llcykgaGllcmFyY2h5LnJldmFsdWUocm9vdCk7CisgICAgc2NhbGUocm9vdCwgc2l6ZVswXSAqIHNpemVbMV0gLyByb290LnZhbHVlKTsKKyAgICAoc3RpY2tpZXMgPyBzdGlja2lmeSA6IHNxdWFyaWZ5KShyb290KTsKKyAgICBpZiAoc3RpY2t5KSBzdGlja2llcyA9IG5vZGVzOworICAgIHJldHVybiBub2RlczsKKyAgfQorCisgIHRyZWVtYXAuc29ydCA9IGQzLnJlYmluZCh0cmVlbWFwLCBoaWVyYXJjaHkuc29ydCk7CisgIHRyZWVtYXAuY2hpbGRyZW4gPSBkMy5yZWJpbmQodHJlZW1hcCwgaGllcmFyY2h5LmNoaWxkcmVuKTsKKyAgdHJlZW1hcC52YWx1ZSA9IGQzLnJlYmluZCh0cmVlbWFwLCBoaWVyYXJjaHkudmFsdWUpOworCisgIHRyZWVtYXAuc2l6ZSA9IGZ1bmN0aW9uKHgpIHsKKyAgICBpZiAoIWFyZ3VtZW50cy5sZW5ndGgpIHJldHVybiBzaXplOworICAgIHNpemUgPSB4OworICAgIHJldHVybiB0cmVlbWFwOworICB9OworCisgIHRyZWVtYXAucm91bmQgPSBmdW5jdGlvbih4KSB7CisgICAgaWYgKCFhcmd1bWVudHMubGVuZ3RoKSByZXR1cm4gcm91bmQgIT0gTnVtYmVyOworICAgIHJvdW5kID0geCA/IE1hdGgucm91bmQgOiBOdW1iZXI7CisgICAgcmV0dXJuIHRyZWVtYXA7CisgIH07CisKKyAgdHJlZW1hcC5zdGlja3kgPSBmdW5jdGlvbih4KSB7CisgICAgaWYgKCFhcmd1bWVudHMubGVuZ3RoKSByZXR1cm4gc3RpY2t5OworICAgIHN0aWNreSA9IHg7CisgICAgc3RpY2tpZXMgPSBudWxsOworICAgIHJldHVybiB0cmVlbWFwOworICB9OworCisgIHJldHVybiB0cmVlbWFwOworfTsKK30pKCkKXCBObyBuZXdsaW5lIGF0IGVuZCBvZiBmaWxl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SAtIHQpOworICAgIH07CisgIH0KKyAgZnVuY3Rpb24gZDNfZWFzZV9yZWZsZWN0KGYpIHsKKyAgICByZXR1cm4gZnVuY3Rpb24odCkgeworICAgICAgcmV0dXJuIC41ICogKHQgPCAuNSA/IGYoMiAqIHQpIDogMiAtIGYoMiAtIDIgKiB0KSk7CisgICAgfTsKKyAgfQorICBmdW5jdGlvbiBkM19lYXNlX2lkZW50aXR5KHQpIHsKKyAgICByZXR1cm4gdDsKKyAgfQorICBmdW5jdGlvbiBkM19lYXNlX3BvbHkoZSkgeworICAgIHJldHVybiBmdW5jdGlvbih0KSB7CisgICAgICByZXR1cm4gTWF0aC5wb3codCwgZSk7CisgICAgfTsKKyAgfQorICBmdW5jdGlvbiBkM19lYXNlX3Npbih0KSB7CisgICAgcmV0dXJuIDEgLSBNYXRoLmNvcyh0ICogTWF0aC5QSSAvIDIpOworICB9CisgIGZ1bmN0aW9uIGQzX2Vhc2VfZXhwKHQpIHsKKyAgICByZXR1cm4gTWF0aC5wb3coMiwgMTAgKiAodCAtIDEpKTsKKyAgfQorICBmdW5jdGlvbiBkM19lYXNlX2NpcmNsZSh0KSB7CisgICAgcmV0dXJuIDEgLSBNYXRoLnNxcnQoMSAtIHQgKiB0KTsKKyAgfQorICBmdW5jdGlvbiBkM19lYXNlX2VsYXN0aWMoYSwgcCkgeworICAgIHZhciBzOworICAgIGlmIChhcmd1bWVudHMubGVuZ3RoIDwgMikgcCA9IC40NTsKKyAgICBpZiAoYXJndW1lbnRzLmxlbmd0aCA8IDEpIHsKKyAgICAgIGEgPSAxOworICAgICAgcyA9IHAgLyA0OworICAgIH0gZWxzZSBzID0gcCAvICgyICogTWF0aC5QSSkgKiBNYXRoLmFzaW4oMSAvIGEpOworICAgIHJldHVybiBmdW5jdGlvbih0KSB7CisgICAgICByZXR1cm4gMSArIGEgKiBNYXRoLnBvdygyLCAxMCAqIC10KSAqIE1hdGguc2luKCh0IC0gcykgKiAyICogTWF0aC5QSSAvIHApOworICAgI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ICAgICByZXR1cm4gZnVuY3Rpb24oZTEpIHsKKyAgICAgICAgdHJ5IHsKKyAgICAgICAgICB2YXIgZTAgPSBlMS5zb3VyY2VFdmVudCA9IGQzLmV2ZW50OworICAgICAgICAgIGUxLnRhcmdldCA9IHRhcmdldDsKKyAgICAgICAgICBkMy5ldmVudCA9IGUxOworICAgICAgICAgIGRpc3BhdGNoW2UxLnR5cGVdLmFwcGx5KHRoaXosIGFyZ3VtZW50eik7CisgICAgICAgIH0gZmluYWxseSB7CisgICAgICAgICAgZDMuZXZlbnQgPSBlMDsKKyAgICAgICAgfQorICAgICAgfTsKKyAgICB9OworICAgIHJldHVybiBkaXNwYXRjaDsKKyAgfQorICBmdW5jdGlvbiBkM190cmFuc2Zvcm0obSkgeworICAgIHZhciByMCA9IFsgbS5hLCBtLmIgXSwgcjEgPSBbIG0uYywgbS5kIF0sIGt4ID0gZDNfdHJhbnNmb3JtTm9ybWFsaXplKHIwKSwga3ogPSBkM190cmFuc2Zvcm1Eb3QocjAsIHIxKSwga3kgPSBkM190cmFuc2Zvcm1Ob3JtYWxpemUoZDNfdHJhbnNmb3JtQ29tYmluZShyMSwgcjAsIC1reikpIHx8IDA7CisgICAgaWYgKHIwWzBdICogcjFbMV0gPCByMVswXSAqIHIwWzFdKSB7CisgICAgICByMFswXSAqPSAtMTsKKyAgICAgIHIwWzFdICo9IC0xOworICAgICAga3ggKj0gLTE7CisgICAgICBreiAqPSAtMTsKKyAgICB9CisgICAgdGhpcy5yb3RhdGUgPSAoa3ggPyBNYXRoLmF0YW4yKHIwWzFdLCByMFswXSkgOiBNYXRoLmF0YW4yKC1yMVswXSwgcjFbMV0pKSAqIGQzX3RyYW5zZm9ybURlZ3JlZXM7CisgICAgdGhpcy50cmFuc2xhdGUgPSBbIG0uZSwgbS5mIF07CisgICAgdGhpcy5zY2FsZSA9IFsga3gsIGt5IF07CisgICAgdGhpcy5za2V3ID0ga3kgPyBNYXRoLmF0YW4yKGt6LCBreSkgKiBkM190cmFuc2Zvcm1EZWdyZWVzIDogMDsKKyAgfQorICBmdW5jdGlvbiBkM190cmFuc2Zvcm1Eb3QoYSwgYikgeworICAgIHJldHVybiBhWzBdICogYlswXSArIGFbMV0gKiBiWzFdOworICB9CisgIGZ1bmN0aW9uIGQzX3RyYW5zZm9ybU5vcm1hbGl6ZShhKSB7CisgICAgdmFyIGsgPSBNYXRoLnNxcnQoZDNfdHJhbnNmb3JtRG90KGEsIGEpKTsKKyAgICBpZiAoaykgeworICAgICAgYVswXSAvPSBrOworICAgICAgYVsxXSAvPSBrOworICAgIH0KKyAgICByZXR1cm4gazsKKyAgfQorICBmdW5jdGlvbiBkM190cmFuc2Zvcm1Db21iaW5lKGEsIGIsIGspIHsKKyAgICBhWzBdICs9IGsgKiBiWzBdOworICAgIGFbMV0gKz0gayAqIGJbMV07CisgICAgcmV0dXJuIGE7CisgIH0KKyAgZnVuY3Rpb24gZDNfaW50ZXJwb2xhdGVCeU5hbWUobmFtZSkgeworICAgIHJldHVybiBuYW1lID09ICJ0cmFuc2Zvcm0iID8gZDMuaW50ZXJwb2xhdGVUcmFuc2Zvcm0gOiBkMy5pbnRlcnBvbGF0ZTsKKyAgfQorICBmdW5jdGlvbiBkM191bmludGVycG9sYXRlTnVtYmVyKGEsIGIpIHsKKyAgICBiID0gYiAtIChhID0gK2EpID8gMSAvIChiIC0gYSkgOiAwOworICAgIHJldHVybiBmdW5jdGlvbih4KSB7CisgICAgICByZXR1cm4gKHggLSBhKSAqIGI7CisgICAgfTsKKyAgfQorICBmdW5jdGlvbiBkM191bmludGVycG9sYXRlQ2xhbXAoYSwgYikgeworICAgIGIgPSBiIC0gKGEgPSArYSkgPyAxIC8gKGIgLSBhKSA6IDA7CisgICAgcmV0dXJuIGZ1bmN0aW9uKHgpIHsKKyAgICAgIHJldHVybiBNYXRoLm1heCgwLCBNYXRoLm1pbigxLCAoeCAtIGEpICogYikpOworICAgIH07CisgIH0KKyAgZnVuY3Rpb24gZDNfcmdiKHIsIGcsIGIpIHsKKyAgICByZXR1cm4gbmV3IGQzX1JnYihyLCBnLCBiKTsKKyAgfQorICBmdW5jdGlvbiBkM19SZ2IociwgZywgYikgeworICAgIHRoaXMuciA9IHI7CisgICAgdGhpcy5nID0gZzsKKyAgICB0aGlzLmIgPSBiOworICB9CisgIGZ1bmN0aW9uIGQzX3JnYl9oZXgodikgeworICAgIHJldHVybiB2IDwgMTYgPyAiMCIgKyBNYXRoLm1heCgwLCB2KS50b1N0cmluZygxNikgOiBNYXRoLm1pbigyNTUsIHYpLnRvU3RyaW5nKDE2KTsKKyAgfQorICBmdW5jdGlvbiBkM19yZ2JfcGFyc2UoZm9ybWF0LCByZ2IsIGhzbCkgeworICAgIHZhciByID0gMCwgZyA9IDAsIGIgPSAwLCBtMSwgbTIsIG5hbWU7CisgICAgbTEgPSAvKFthLXpdKylcKCguKilcKS9pLmV4ZWMoZm9ybWF0KTsKKyAgICBpZiAobTEpIHsKKyAgICAgIG0yID0gbTFbMl0uc3BsaXQoIiwiKTsKKyAgICAgIHN3aXRjaCAobTFbMV0pIHsKKyAgICAgICBjYXNlICJoc2wiOgorICAgICAgICB7CisgICAgICAgICAgcmV0dXJuIGhzbChwYXJzZUZsb2F0KG0yWzBdKSwgcGFyc2VGbG9hdChtMlsxXSkgLyAxMDAsIHBhcnNlRmxvYXQobTJbMl0pIC8gMTAwKTsKKyAgICAgICAgfQorICAgICAgIGNhc2UgInJnYiI6CisgICAgICAgIHsKKyAgICAgICAgICByZXR1cm4gcmdiKGQzX3JnYl9wYXJzZU51bWJlcihtMlswXSksIGQzX3JnYl9wYXJzZU51bWJlcihtMlsxXSksIGQzX3JnYl9wYXJzZU51bWJlcihtMlsyXSkpOworICAgICAgICB9CisgICAgICB9CisgICAgfQorICAgIGlmIChuYW1lID0gZDNfcmdiX25hbWVzLmdldChmb3JtYXQpKSByZXR1cm4gcmdiKG5hbWUuciwgbmFtZS5nLCBuYW1lLmIpOworICAgIGlmIChmb3JtYXQgIT0gbnVsbCAmJiBmb3JtYXQuY2hhckF0KDApID09PSAiIyIpIHsKKyAgICAgIGlmIChmb3JtYXQubGVuZ3RoID09PSA0KSB7CisgICAgICAgIHIgPSBmb3JtYXQuY2hhckF0KDEpOworICAgICAgICByICs9IHI7CisgICAgICAgIGcgPSBmb3JtYXQuY2hhckF0KDIpOworICAgICAgICBnICs9IGc7CisgICAgICAgIGIgPSBmb3JtYXQuY2hhckF0KDMpOworICAgICAgICBiICs9IGI7CisgICAgICB9IGVsc2UgaWYgKGZvcm1hdC5sZW5ndGggPT09IDcpIHsKKyAgICAgICAgciA9IGZvcm1hdC5zdWJzdHJpbmcoMSwgMyk7CisgICAgICAgIGcgPSBmb3JtYXQuc3Vic3RyaW5nKDMsIDUpOworICAgICAgICBiID0gZm9ybWF0LnN1YnN0cmluZyg1LCA3KTsKKyAgICAgIH0KKyAgICAgIHIgPSBwYXJzZUludChyLCAxNik7CisgICAgICBnID0gcGFyc2VJbnQoZywgMTYpOworICAgICAgYiA9IHBhcnNlSW50KGIsIDE2KTsKKyAgICB9CisgICAgcmV0dXJuIHJnYihyLCBnLCBiKTsKKyAgfQorICBmdW5jdGlvbiBkM19yZ2JfaHNsKHIsIGcsIGIpIHsKKyAgICB2YXIgbWluID0gTWF0aC5taW4ociAvPSAyNTUsIGcgLz0gMjU1LCBiIC89IDI1NSksIG1heCA9IE1hdGgubWF4KHIsIGcsIGIpLCBkID0gbWF4IC0gbWluLCBoLCBzLCBsID0gKG1heCArIG1pbikgLyAyOworICAgIGlmIChkKSB7CisgICAgICBzID0gbCA8IC41ID8gZCAvIChtYXggKyBtaW4pIDogZCAvICgyIC0gbWF4IC0gbWluKTsKKyAgICAgIGlmIChyID09IG1heCkgaCA9IChnIC0gYikgLyBkICsgKGcgPCBiID8gNiA6IDApOyBlbHNlIGlmIChnID09IG1heCkgaCA9IChiIC0gcikgLyBkICsgMjsgZWxzZSBoID0gKHIgLSBnKSAvIGQgKyA0OworICAgICAgaCAqPSA2MDsKKyAgICB9IGV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g7CisgICAgdGhpcy5zID0gczsKKyAgICB0aGlzLmwgPSBsOworICB9CisgIGZ1bmN0aW9uIGQzX2hzbF9yZ2IoaCwgcywgbCkgeworICAgIGZ1bmN0aW9uIHYoaCkgeworICAgICAgaWYgKGggPiAzNjApIGggLT0gMzYwOyBlbHNlIGlmIChoIDwgMCkgaCArPSAzNjA7CisgICAgICBpZiAoaCA8IDYwKSByZXR1cm4gbTEgKyAobTIgLSBtMSkgKiBoIC8gNjA7CisgICAgICBpZiAoaCA8IDE4MCkgcmV0dXJuIG0yOworICAgICAgaWYgKGggPCAyNDApIHJldHVybiBtMSArIChtMiAtIG0xKSAqICgyNDAgLSBoKSAvIDYwOworICAgICAgcmV0dXJuIG0xOworICAgIH0KKyAgICBmdW5jdGlvbiB2dihoKSB7CisgICAgICByZXR1cm4gTWF0aC5yb3VuZCh2KGgpICogMjU1KTsKKyAgICB9CisgICAgdmFyIG0xLCBtMjsKKyAgICBoID0gaCAlIDM2MDsKKyAgICBpZiAoaCA8IDApIGggKz0gMzYwOworICAgIHMgPSBzIDwgMCA/IDAgOiBzID4gMSA/IDEgOiBzOworICAgIGwgPSBsIDwgMCA/IDAgOiBsID4gMSA/IDEgOiBsOworICAgIG0yID0gbCA8PSAuNSA/IGwgKiAoMSArIHMpIDogbCArIHMgLSBsICogczsKKyAgICBtMSA9IDIgKiBsIC0gbTI7CisgICAgcmV0dXJuIGQzX3JnYih2dihoICsgMTIwKSwgdnYoaCksIHZ2KGggLSAxMjApKTsKKyAgfQorICBmdW5jdGlvbiBkM19oY2woaCwgYywgbCkgeworICAgIHJldHVybiBuZXcgZDNfSGNsKGgsIGMsIGwpOworICB9CisgIGZ1bmN0aW9uIGQzX0hjbChoLCBjLCBsKSB7CisgICAgdGhpcy5oID0gaDsKKyAgICB0aGlzLmMgPSBjOworICAgIHRoaXMubCA9IGw7CisgIH0KKyAgZnVuY3Rpb24gZDNfaGNsX2xhYihoLCBjLCBsKSB7CisgICAgcmV0dXJuIGQzX2x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dXJuIGNvbXBhcmF0b3IoYSAmJiBhLl9fZGF0YV9fLCBiICYmIGIuX19kYXRhX18pOworICAgIH07CisgIH0KKyAgZnVuY3Rpb24gZDNfc2VsZWN0aW9uX29uKHR5cGUsIGxpc3RlbmVyLCBjYXB0dXJlKSB7CisgICAgZnVuY3Rpb24gb25SZW1vdmUoKSB7CisgICAgICB2YXIgd3JhcHBlciA9IHRoaXNbbmFtZV07CisgICAgICBpZiAod3JhcHBlcikgeworICAgICAgICB0aGlzLnJlbW92ZUV2ZW50TGlzdGVuZXIodHlwZSwgd3JhcHBlciwgd3JhcHBlci4kKTsKKyAgICAgICAgZGVsZXRlIHRoaXNbbmFtZV07CisgICAgICB9CisgICAgfQorICAgIGZ1bmN0aW9uIG9uQWRkKCkgeworICAgICAgZnVuY3Rpb24gd3JhcHBlcihlKSB7CisgICAgICAgIHZhciBvID0gZDMuZXZlbnQ7CisgICAgICAgIGQzLmV2ZW50ID0gZTsKKyAgICAgICAgYXJnc1swXSA9IG5vZGUuX19kYXRhX187CisgICAgICAgIHRyeSB7CisgICAgICAgICAgbGlzdGVuZXIuYXBwbHkobm9kZSwgYXJncyk7CisgICAgICAgIH0gZmluYWxseSB7CisgICAgICAgICAgZDMuZXZlbnQgPSBvOworICAgICAgICB9CisgICAgICB9CisgICAgICB2YXIgbm9kZSA9IHRoaXMsIGFyZ3MgPSBhcmd1bWVudHM7CisgICAgICBvblJlbW92ZS5jYWxsKHRoaXMpOworICAgICAgdGhpcy5hZGRFdmVudExpc3RlbmVyKHR5cGUsIHRoaXNbbmFtZV0gPSB3cmFwcGVyLCB3cmFwcGVyLiQgPSBjYXB0dXJlKTsKKyAgICAgIHdyYXBwZXIuXyA9IGxpc3RlbmVyOworICAgIH0KKyAgICB2YXIgbmFtZSA9ICJfX29uIiArIHR5cGUsIGkgPSB0eXBlLmluZGV4T2YoIi4iKTsKKyAgICBpZiAoaSA+IDApIHR5cGUgPSB0eXBlLnN1YnN0cmluZygwLCBpKTsKKyAg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H0KKyAgICAgICAgICB9KTsKKyAgICAgICAgICBldmVudC5zdGFydC5jYWxsKG5vZGUsIGQsIGkpOworICAgICAgICAgIGlmICghdGljayhlbGFwc2VkKSkgZDMudGltZXIodGljaywgMCwgdGltZSk7CisgICAgICAgICAgcmV0dXJuIDE7CisgICAgICAgIH0KKyAgICAgICAgZnVuY3Rpb24gdGljayhlbGFwc2VkKSB7CisgICAgICAgICAgaWYgKGxvY2suYWN0aXZlICE9PSBpZCkgcmV0dXJuIHN0b3AoKTsKKyAgICAgICAgICB2YXIgdCA9IChlbGFwc2VkIC0gZGVsYXkpIC8gZHVyYXRpb24sIGUgPSBlYXNlKHQpLCBuID0gdHdlZW5lZC5sZW5ndGg7CisgICAgICAgICAgd2hpbGUgKG4gPiAwKSB7CisgICAgICAgICAgICB0d2VlbmVkWy0tbl0uY2FsbChub2RlLCBlKTsKKyAgICAgICAgICB9CisgICAgICAgICAgaWYgKHQgPj0gMSkgeworICAgICAgICAgICAgc3RvcCgpOworICAgICAgICAgICAgZDNfdHJhbnNpdGlvbklkID0gaWQ7CisgICAgICAgICAgICBldmVudC5lbmQuY2FsbChub2RlLCBkLCBpKTsKKyAgICAgICAgICAgIGQzX3RyYW5zaXRpb25JZCA9IDA7CisgICAgICAgICAgICByZXR1cm4gMTsKKyAgICAgICAgICB9CisgICAgICAgIH0KKyAgICAgICAgZnVuY3Rpb24gc3RvcCgpIHsKKyAgICAgICAgICBpZiAoIS0tbG9jay5jb3VudCkgZGVsZXRlIG5vZGUuX190cmFuc2l0aW9uX187CisgICAgICAgICAgcmV0dXJuIDE7CisgICAgICAgIH0KKyAgICAgICAgdmFyIHR3ZWVuZWQgPSBbXSwgZGVsYXkgPSBub2RlLmRlbGF5LCBkdXJhdGlvbiA9IG5vZGUuZHVyYXRpb24sIGxvY2sgPSAobm9kZSA9IG5vZGUubm9kZSkuX190cmFuc2l0aW9uX18gfHwgKG5vZGUuX190cmFuc2l0aW9uX18gPSB7CisgICAgICAgICAgYWN0a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AgICAgdDEgPSB0MCA/IHQwLm5leHQgPSB0MS5uZXh0IDogZDNfdGltZXJfcXVldWUgPSB0MS5uZXh0OworICAgICAgfSBlbHNlIHsKKyAgICAgICAgdGhlbiA9IE1hdGgubWluKHRoZW4sIHQxLnRoZW4gKyB0MS5kZWxheSk7CisgICAgICAgIHQxID0gKHQwID0gdDEpLm5leHQ7CisgICAgICB9CisgICAgfQorICAgIHJldHVybiB0aGVuOworICB9CisgIGZ1bmN0aW9uIGQzX21vdXNlUG9pbnQoY29udGFpbmVyLCBlKSB7CisgICAgdmFyIHN2ZyA9IGNvbnRhaW5lci5vd25lclNWR0VsZW1lbnQgfHwgY29udGFpbmVyOworICAgIGlmIChzdmcuY3JlYXRlU1ZHUG9pbnQpIHsKKyAgICAgIHZhciBwb2ludCA9IHN2Zy5jcmVhdGVTVkdQb2ludCgpOworICAgICAgaWYgKGQzX21vdXNlX2J1ZzQ0MDgzIDwgMCAmJiAod2luZG93LnNjcm9sbFggfHwgd2luZG93LnNjcm9sbFkpKSB7CisgICAgICAgIHN2ZyA9IGQzLnNlbGVjdChkb2N1bWVudC5ib2R5KS5hcHBlbmQoInN2ZyIpLnN0eWxlKCJwb3NpdGlvbiIsICJhYnNvbHV0ZSIpLnN0eWxlKCJ0b3AiLCAwKS5zdHlsZSgibGVmdCIsIDApOworICAgICAgICB2YXIgY3RtID0gc3ZnWzBdWzBdLmdldFNjcmVlbkNUTSgpOworICAgICAgICBkM19tb3VzZV9idWc0NDA4MyA9ICEoY3RtLmYgfHwgY3RtLmUpOworICAgICAgICBzdmcucmVtb3ZlKCk7CisgICAgICB9CisgICAgICBpZiAoZDNfbW91c2VfYnVnNDQwODMpIHsKKyAgICAgICAgcG9pbnQueCA9IGUucGFnZVg7CisgICAgICAgIHBvaW50LnkgPSBlLnBhZ2VZOworICAgICAgfSBlbHNlIHsKKyAgICAgICAgcG9pbnQueCA9IGUuY2xpZW50WDsKKyAgICAgICAgcG9pbnQueSA9IGUuY2xpZW50WTs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0dXJuIGRvbWFpbjsKKyAgICAgIGRvbWFpbiA9IHgubWFwKE51bWJlcik7CisgICAgICByZXR1cm4gcmVzY2FsZSgpOworICAgIH07CisgICAgc2NhbGUucmFuZ2UgPSBmdW5jdGlvbih4KSB7CisgICAgICBpZiAoIWFyZ3VtZW50cy5sZW5ndGgpIHJldHVybiByYW5nZTsKKyAgICAgIHJhbmdlID0geDsKKyAgICAgIHJldHVybiByZXNjYWxlKCk7CisgICAgfTsKKyAgICBzY2FsZS5yYW5nZVJvdW5kID0gZnVuY3Rpb24oeCkgeworICAgICAgcmV0dXJuIHNjYWxlLnJhbmdlKHgpLmludGVycG9sYXRlKGQzLmludGVycG9sYXRlUm91bmQpOworICAgIH07CisgICAgc2NhbGUuY2xhbXAgPSBmdW5jdGlvbih4KSB7CisgICAgICBpZiAoIWFyZ3VtZW50cy5sZW5ndGgpIHJldHVybiBjbGFtcDsKKyAgICAgIGNsYW1wID0geDsKKyAgICAgIHJldHVybiByZXNjYWxlKCk7CisgICAgfTsKKyAgICBzY2FsZS5pbnRlcnBvbGF0ZSA9IGZ1bmN0aW9uKHgpIHsKKyAgICAgIGlmICghYXJndW1lbnRzLmxlbmd0aCkgcmV0dXJuIGludGVycG9sYXRlOworICAgICAgaW50ZXJwb2xhdGUgPSB4OworICAgICAgcmV0dXJuIHJlc2NhbGUoKTsKKyAgICB9OworICAgIHNjYWxlLnRpY2tzID0gZnVuY3Rpb24obSkgeworICAgICAgcmV0dXJuIGQzX3NjYWxlX2xpbmVhclRpY2tzKGRvbWFpbiwgbSk7CisgICAgfTsKKyAgICBzY2FsZS50aWNrRm9ybWF0ID0gZnVuY3Rpb24obSkgeworICAgICAgcmV0dXJuIGQzX3NjYWxlX2xpbmVhclRpY2tGb3JtYXQoZG9tYWluLCBtKTsKKyAgICB9OworICAgIHNjYWxlLm5pY2UgPSBmdW5jdGlvbigpIHsKKyAgICAgIGQzX3NjYWxlX25pY2UoZG9tYWluLCBkM19zY2FsZV9saW5lYXJOa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bnRlcnBvbGF0ZSwgaW50ZXJwb2xhdGUpIHsKKyAgICB2YXIgdSA9IFtdLCBpID0gW10sIGogPSAwLCBrID0gTWF0aC5taW4oZG9tYWluLmxlbmd0aCwgcmFuZ2UubGVuZ3RoKSAtIDE7CisgICAgaWYgKGRvbWFpbltrXSA8IGRvbWFpblswXSkgeworICAgICAgZG9tYWluID0gZG9tYWluLnNsaWNlKCkucmV2ZXJzZSgpOworICAgICAgcmFuZ2UgPSByYW5nZS5zbGljZSgpLnJldmVyc2UoKTsKKyAgICB9CisgICAgd2hpbGUgKCsraiA8PSBrKSB7CisgICAgICB1LnB1c2godW5pbnRlcnBvbGF0ZShkb21haW5baiAtIDFdLCBkb21haW5bal0pKTsKKyAgICAgIGkucHVzaChpbnRlcnBvbGF0ZShyYW5nZVtqIC0gMV0sIHJhbmdlW2pdKSk7CisgICAgfQorICAgIHJldHVybiBmdW5jdGlvbih4KSB7CisgICAgICB2YXIgaiA9IGQzLmJpc2VjdChkb21haW4sIHgsIDEsIGspIC0gMTsKKyAgICAgIHJldHVybiBpW2pdKHVbal0oeCkpOworICAgIH07CisgIH0KKyAgZnVuY3Rpb24gZDNfc2NhbGVfbG9nKGxpbmVhciwgbG9nKSB7CisgICAgZnVuY3Rpb24gc2NhbGUoeCkgeworICAgICAgcmV0dXJuIGxpbmVhcihsb2coeCkpOworICAgIH0KKyAgICB2YXIgcG93ID0gbG9nLnBvdzsKKyAgICBzY2FsZS5pbnZlcnQgPSBmdW5jdGlvbih4KSB7CisgICAgICByZXR1cm4gcG93KGxpbmVhci5pbnZlcnQoeCkpOworICAgIH07CisgICAgc2NhbGUuZG9tYWluID0gZnVuY3Rpb24oeCkgeworICAgICAgaWYgKCFhcmd1bWVudHMubGVuZ3RoKSByZXR1cm4gbGluZWFyLmRvbWFpbigpLm1hcChwb3cpOworICAgICAgbG9nID0geFswXSA8IDAgPyBkM19zY2FsZV9sb2duIDogZDNfc2NhbGVfbG9ncDsKKyAgICAgIHBvdyA9IGxvZy5wb3c7CisgICAgICBsaW5lYXIuZG9tYWluKHgubWFwKGxvZykpOworICAgICAgcmV0dXJuIHNjYWxlOworICAgIH07CisgICAgc2NhbGUubmljZSA9IGZ1bmN0aW9uKCkgeworICAgICAgbGluZWFyLmRvbWFpbihkM19zY2FsZV9uaWNlKGxpbmVhci5kb21haW4oKSwgZDNfc2NhbGVfbmljZURlZmF1bHQpKTsKKyAgICAgIHJldHVybiBzY2FsZTsKKyAgICB9OworICAgIHNjYWxlLnRpY2tzID0gZnVuY3Rpb24oKSB7CisgICAgICB2YXIgZXh0ZW50ID0gZDNfc2NhbGVFeHRlbnQobGluZWFyLmRvbWFpbigpKSwgdGlja3MgPSBbXTsKKyAgICAgIGlmIChleHRlbnQuZXZlcnkoaXNGaW5pdGUpKSB7CisgICAgICAgIHZhciBpID0gTWF0aC5mbG9vcihleHRlbnRbMF0pLCBqID0gTWF0aC5jZWlsKGV4dGVudFsxXSksIHUgPSBwb3coZXh0ZW50WzBdKSwgdiA9IHBvdyhleHRlbnRbMV0pOworICAgICAgICBpZiAobG9nID09PSBkM19zY2FsZV9sb2duKSB7CisgICAgICAgICAgdGlja3MucHVzaChwb3coaSkpOworICAgICAgICAgIGZvciAoOyBpKysgPCBqOyApIGZvciAodmFyIGsgPSA5OyBrID4gMDsgay0tKSB0aWNrcy5wdXNoKHBvdyhpKSAqIGspOworICAgICAgICB9IGVsc2UgeworICAgICAgICAgIGZvciAoOyBpIDwgajsgaSsrKSBmb3IgKHZhciBrID0gMTsgayA8IDEwOyBrKyspIHRpY2tzLnB1c2gocG93KGkpICogayk7CisgICAgICAgICAgdGlja3MucHVzaChwb3coaSkpOworICAgICAgICB9CisgICAgICAgIGZvciAoaSA9IDA7IHRpY2tzW2ldIDwgdTsgaSsrKSB7fQorICAgICAgICBmb3IgKGogPSB0aWNrcy5sZW5ndGg7IHRpY2tzW2ogLSAxXSA+IHY7IGotLSkge30KKyAgICAgICAgdGlja3MgPSB0aWNrcy5zbGljZShpLCB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cm4gbGluZWFyKHBvd3AoeCkpOworICAgIH0KKyAgICB2YXIgcG93cCA9IGQzX3NjYWxlX3Bvd1BvdyhleHBvbmVudCksIHBvd2IgPSBkM19zY2FsZV9wb3dQb3coMSAvIGV4cG9uZW50KTsKKyAgICBzY2FsZS5pbnZlcnQgPSBmdW5jdGlvbih4KSB7CisgICAgICByZXR1cm4gcG93YihsaW5lYXIuaW52ZXJ0KHgpKTsKKyAgICB9OworICAgIHNjYWxlLmRvbWFpbiA9IGZ1bmN0aW9uKHgpIHsKKyAgICAgIGlmICghYXJndW1lbnRzLmxlbmd0aCkgcmV0dXJuIGxpbmVhci5kb21haW4oKS5tYXAocG93Yik7CisgICAgICBsaW5lYXIuZG9tYWluKHgubWFwKHBvd3ApKTsKKyAgICAgIHJldHVybiBzY2FsZTsKKyAgICB9OworICAgIHNjYWxlLnRpY2tzID0gZnVuY3Rpb24obSkgeworICAgICAgcmV0dXJuIGQzX3NjYWxlX2xpbmVhclRpY2tzKHNjYWxlLmRvbWFpbigpLCBtKTsKKyAgICB9OworICAgIHNjYWxlLnRpY2tGb3JtYXQgPSBmdW5jdGlvbihtKSB7CisgICAgICByZXR1cm4gZDNfc2NhbGVfbGluZWFyVGlja0Zvcm1hdChzY2FsZS5kb21haW4oKSwgbSk7CisgICAgfTsKKyAgICBzY2FsZS5uaWNlID0gZnVuY3Rpb24oKSB7CisgICAgICByZXR1cm4gc2NhbGUuZG9tYWluKGQzX3NjYWxlX25pY2Uoc2NhbGUuZG9tYWluKCksIGQzX3NjYWxlX2xpbmVhck5pY2UpKTsKKyAgICB9OworICAgIHNjYWxlLmV4cG9uZW50ID0gZnVuY3Rpb24oeCkgeworICAgICAgaWYgKCFhcmd1bWVudHMubGVuZ3RoKSByZXR1cm4gZXhwb25lbnQ7CisgICAgICB2YXIgZG9tYWluID0gc2NhbGUuZG9tYWluKCk7CisgICAgICBwb3dwID0gZDNfc2NhbGVfcG93UG93KGV4cG9uZW50ID0geCk7CisgICAgICBwb3diID0gZDNfc2NhbGVfcG93UG93KDEgLyBleHBvbmVudCk7CisgICAgICByZXR1cm4gc2NhbGUuZG9tYWluKGRvbWFpbik7CisgICAgfTsKKyAgICBzY2FsZS5jb3B5ID0gZnVuY3Rpb24oKSB7CisgICAgICByZXR1cm4gZDNfc2NhbGVfcG93KGxpbmVhci5jb3B5KCksIGV4cG9uZW50KTsKKyAgICB9OworICAgIHJldHVybiBkM19zY2FsZV9saW5lYXJSZWJpbmQoc2NhbGUsIGxpbmVhcik7CisgIH0KKyAgZnVuY3Rpb24gZDNfc2NhbGVfcG93UG93KGUpIHsKKyAgICByZXR1cm4gZnVuY3Rpb24oeCkgeworICAgICAgcmV0dXJuIHggPCAwID8gLU1hdGgucG93KC14LCBlKSA6IE1hdGgucG93KHgsIGUpOworICAgIH07CisgIH0KKyAgZnVuY3Rpb24gZDNfc2NhbGVfb3JkaW5hbChkb21haW4sIHJhbmdlcikgeworICAgIGZ1bmN0aW9uIHNjYWxlKHgpIHsKKyAgICAgIHJldHVybiByYW5nZVsoKGluZGV4LmdldCh4KSB8fCBpbmRleC5zZXQoeCwgZG9tYWluLnB1c2goeCkpKSAtIDEpICUgcmFuZ2UubGVuZ3RoXTsKKyAgICB9CisgICAgZnVuY3Rpb24gc3RlcHMoc3RhcnQsIHN0ZXApIHsKKyAgICAgIHJldHVybiBkMy5yYW5nZShkb21haW4ubGVuZ3RoKS5tYXAoZnVuY3Rpb24oaSkgeworICAgICAgICByZXR1cm4gc3RhcnQgKyBzdGVwICogaTsKKyAgICAgIH0pOworICAgIH0KKyAgICB2YXIgaW5kZXgsIHJhbmdlLCByYW5nZUJhbmQ7CisgICAgc2NhbGUuZG9tYWluID0gZnVuY3Rpb24oeCkgeworICAgICAgaWYgKCFhcmd1bWVudHMubGVuZ3RoKSByZXR1cm4gZG9tYWluOworICAgICAgZG9tYWluID0gW107CisgICAgICBpbmRleCA9IG5ldyBkM19NYXA7CisgICAgICB2YXIgaSA9IC0xLCBuID0geC5sZW5ndGgsIHhpOworICAgICAgd2hpbGUgKCsraSA8IG4pIGlmICghaW5kZXguaGFzKHhpID0geFtpXSkpIGluZGV4LnNldCh4aSwgZG9tYWluLnB1c2goeGkpKTsKKyAgICAgIHJldHVybiBzY2FsZVtyYW5nZXIudF0uYXBwbHkoc2NhbGUsIHJhbmdlci5hKTsKKyAgICB9OworICAgIHNjYWxlLnJhbmdlID0gZnVuY3Rpb24oeCkgeworICAgICAgaWYgKCFhcmd1bWVudHMubGVuZ3RoKSByZXR1cm4gcmFuZ2U7CisgICAgICByYW5nZSA9IHg7CisgICAgICByYW5nZUJhbmQgPSAwOworICAgICAgcmFuZ2VyID0geworICAgICAgICB0OiAicmFuZ2UiLAorICAgICAgICBhOiBhcmd1bWVudHMKKyAgICAgIH07CisgICAgICByZXR1cm4gc2NhbGU7CisgICAgfTsKKyAgICBzY2FsZS5yYW5nZVBvaW50cyA9IGZ1bmN0aW9uKHgsIHBhZGRpbmcpIHsKKyAgICAgIGlmIChhcmd1bWVudHMubGVuZ3RoIDwgMikgcGFkZGluZyA9IDA7CisgICAgICB2YXIgc3RhcnQgPSB4WzBdLCBzdG9wID0geFsxXSwgc3RlcCA9IChzdG9wIC0gc3RhcnQpIC8gKE1hdGgubWF4KDEsIGRvbWFpbi5sZW5ndGggLSAxKSArIHBhZGRpbmcpOworICAgICAgcmFuZ2UgPSBzdGVwcyhkb21haW4ubGVuZ3RoIDwgMiA/IChzdGFydCArIHN0b3ApIC8gMiA6IHN0YXJ0ICsgc3RlcCAqIHBhZGRpbmcgLyAyLCBzdGVwKTsKKyAgICAgIHJhbmdlQmFuZCA9IDA7CisgICAgICByYW5nZXIgPSB7CisgICAgICAgIHQ6ICJyYW5nZVBvaW50cyIsCisgICAgICAgIGE6IGFyZ3VtZW50cworICAgICAgfTsKKyAgICAgIHJldHVybiBzY2FsZTsKKyAgICB9OworICAgIHNjYWxlLnJhbmdlQmFuZHMgPSBmdW5jdGlvbih4LCBwYWRkaW5nLCBvdXRlclBhZG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AgICAgcmV0dXJuIHNjYWxlOworICAgIH0KKyAgICBmdW5jdGlvbiBzY2FsZSh4KSB7CisgICAgICBpZiAoaXNOYU4oeCA9ICt4KSkgcmV0dXJuIE5hTjsKKyAgICAgIHJldHVybiByYW5nZVtkMy5iaXNlY3QodGhyZXNob2xkcywgeCldOworICAgIH0KKyAgICB2YXIgdGhyZXNob2xkczsKKyAgICBzY2FsZS5kb21haW4gPSBmdW5jdGlvbih4KSB7CisgICAgICBpZiAoIWFyZ3VtZW50cy5sZW5ndGgpIHJldHVybiBkb21haW47CisgICAgICBkb21haW4gPSB4LmZpbHRlcihmdW5jdGlvbihkKSB7CisgICAgICAgIHJldHVybiAhaXNOYU4oZCk7CisgICAgICB9KS5zb3J0KGQzLmFzY2VuZGluZyk7CisgICAgICByZXR1cm4gcmVzY2FsZSgpOworICAgIH07CisgICAgc2NhbGUucmFuZ2UgPSBmdW5jdGlvbih4KSB7CisgICAgICBpZiAoIWFyZ3VtZW50cy5sZW5ndGgpIHJldHVybiByYW5nZTsKKyAgICAgIHJhbmdlID0geDsKKyAgICAgIHJldHVybiByZXNjYWxlKCk7CisgICAgfTsKKyAgICBzY2FsZS5xdWFudGlsZXMgPSBmdW5jdGlvbigpIHsKKyAgICAgIHJldHVybiB0aHJlc2hvbGRzOworICAgIH07CisgICAgc2NhbGUuY29weSA9IGZ1bmN0aW9uKCkgeworICAgICAgcmV0dXJuIGQzX3NjYWxlX3F1YW50aWxlKGRvbWFpbiwgcmFuZ2UpOworICAgIH07CisgICAgcmV0dXJuIHJlc2NhbGUoKTsKKyAgfQorICBmdW5jdGlvbiBkM19zY2FsZV9xdWFudGl6ZSh4MCwgeDEsIHJhbmdlKSB7CisgICAgZnVuY3Rpb24gc2NhbGUoeCkgeworICAgICAgcmV0dXJuIHJhbmdlW01hdGgubWF4KDAsIE1hdGgubWluKGksIE1hdGguZmxvb3Ioa3ggKiAoeCAtIHgwKSkpKV07CisgICAgfQorICAgIGZ1bmN0aW9uIHJlc2NhbGUoKSB7CisgICAgICBreCA9IHJhbmdlLmxlbmd0aCAvICh4MSAtIHgwKTsKKyAgICAgIGkgPSByYW5nZS5sZW5ndGggLSAxOworICAgICAgcmV0dXJuIHNjYWxlOworICAgIH0KKyAgICB2YXIga3gsIGk7CisgICAgc2NhbGUuZG9tYWluID0gZnVuY3Rpb24oeCkgeworICAgICAgaWYgKCFhcmd1bWVudHMubGVuZ3RoKSByZXR1cm4gWyB4MCwgeDEgXTsKKyAgICAgIHgwID0gK3hbMF07CisgICAgICB4MSA9ICt4W3gubGVuZ3RoIC0gMV07CisgICAgICByZXR1cm4gcmVzY2FsZSgpOworICAgIH07CisgICAgc2NhbGUucmFuZ2UgPSBmdW5jdGlvbih4KSB7CisgICAgICBpZiAoIWFyZ3VtZW50cy5sZW5ndGgpIHJldHVybiByYW5nZTsKKyAgICAgIHJhbmdlID0geDsKKyAgICAgIHJldHVybiByZXNjYWxlKCk7CisgICAgfTsKKyAgICBzY2FsZS5jb3B5ID0gZnVuY3Rpb24oKSB7CisgICAgICByZXR1cm4gZDNfc2NhbGVfcXVhbnRpemUoeDAsIHgxLCByYW5nZSk7CisgICAgfTsKKyAgICByZXR1cm4gcmVzY2FsZSgpOworICB9CisgIGZ1bmN0aW9uIGQzX3NjYWxlX3RocmVzaG9sZChkb21haW4sIHJhbmdlKSB7CisgICAgZnVuY3Rpb24gc2NhbGUoeCkgeworICAgICAgcmV0dXJuIHJhbmdlW2QzLmJpc2VjdChkb21haW4sIHgpXTsKKyAgICB9CisgICAgc2NhbGUuZG9tYWluID0gZnVuY3Rpb24oXykgeworICAgICAgaWYgKCFhcmd1bWVudHMubGVuZ3RoKSByZXR1cm4gZG9tYWluOworICAgICAgZG9tYWluID0gXzsKKyAgICAgIHJldHVybiBzY2FsZTsKKyAgICB9OworICAgIHNjYWxlLnJhbmdlID0gZnVuY3Rpb24oXykgeworICAgICAgaWYgKCFhcmd1bWVudHMubGVuZ3RoKSByZXR1cm4gcmFuZ2U7CisgICAgICByYW5nZSA9IF87CisgICAgICByZXR1cm4gc2NhbGU7CisgICAgfTsKKyAgICBzY2FsZS5jb3B5ID0gZnVuY3Rpb24oKSB7CisgICAgICByZXR1cm4gZDNfc2NhbGVfdGhyZXNob2xkKGRvbWFpbiwgcmFuZ2UpOworICAgIH07CisgICAgcmV0dXJuIHNjYWxlOworICB9CisgIGZ1bmN0aW9uIGQzX3NjYWxlX2lkZW50aXR5KGRvbWFpbikgeworICAgIGZ1bmN0aW9uIGlkZW50aXR5KHgpIHsKKyAgICAgIHJldHVybiAreDsKKyAgICB9CisgICAgaWRlbnRpdHkuaW52ZXJ0ID0gaWRlbnRpdHk7CisgICAgaWRlbnRpdHkuZG9tYWluID0gaWRlbnRpdHkucmFuZ2UgPSBmdW5jdGlvbih4KSB7CisgICAgICBpZiAoIWFyZ3VtZW50cy5sZW5ndGgpIHJldHVybiBkb21haW47CisgICAgICBkb21haW4gPSB4Lm1hcChpZGVudGl0eSk7CisgICAgICByZXR1cm4gaWRlbnRpdHk7CisgICAgfTsKKyAgICBpZGVudGl0eS50aWNrcyA9IGZ1bmN0aW9uKG0pIHsKKyAgICAgIHJldHVybiBkM19zY2FsZV9saW5lYXJUaWNrcyhkb21haW4sIG0pOworICAgIH07CisgICAgaWRlbnRpdHkudGlja0Zvcm1hdCA9IGZ1bmN0aW9uKG0pIHsKKyAgICAgIHJldHVybiBkM19zY2FsZV9saW5lYXJUaWNrRm9ybWF0KGRvbWFpbiwgbSk7CisgICAgfTsKKyAgICBpZGVudGl0eS5jb3B5ID0gZnVuY3Rpb24oKSB7CisgICAgICByZXR1cm4gZDNfc2NhbGVfaWRlbnRpdHkoZG9tYWluKTsKKyAgICB9OworICAgIHJldHVybiBpZGVudGl0eTsKKyAgfQorICBmdW5jdGlvbiBkM19zdmdfYXJjSW5uZXJSYWRpdXMoZCkgeworICAgIHJldHVybiBkLmlubmVyUmFkaXVzOworICB9CisgIGZ1bmN0aW9uIGQzX3N2Z19hcmNPdXRlclJhZGl1c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5ID0gZDNfc3ZnX2xpbmVZLCBkZWZpbmVkID0gZDNfdHJ1ZSwgaW50ZXJwb2xhdGUgPSBkM19zdmdfbGluZUxpbmVhciwgaW50ZXJwb2xhdGVLZXkgPSBpbnRlcnBvbGF0ZS5rZXksIHRlbnNpb24gPSAuNzsKKyAgICBsaW5lLnggPSBmdW5jdGlvbihfKSB7CisgICAgICBpZiAoIWFyZ3VtZW50cy5sZW5ndGgpIHJldHVybiB4OworICAgICAgeCA9IF87CisgICAgICByZXR1cm4gbGluZTsKKyAgICB9OworICAgIGxpbmUueSA9IGZ1bmN0aW9uKF8pIHsKKyAgICAgIGlmICghYXJndW1lbnRzLmxlbmd0aCkgcmV0dXJuIHk7CisgICAgICB5ID0gXzsKKyAgICAgIHJldHVybiBsaW5lOworICAgIH07CisgICAgbGluZS5kZWZpbmVkID0gZnVuY3Rpb24oXykgeworICAgICAgaWYgKCFhcmd1bWVudHMubGVuZ3RoKSByZXR1cm4gZGVmaW5lZDsKKyAgICAgIGRlZmluZWQgPSBfOworICAgICAgcmV0dXJuIGxpbmU7CisgICAgfTsKKyAgICBsaW5lLmludGVycG9sYXRlID0gZnVuY3Rpb24oXykgeworICAgICAgaWYgKCFhcmd1bWVudHMubGVuZ3RoKSByZXR1cm4gaW50ZXJwb2xhdGVLZXk7CisgICAgICBpZiAodHlwZW9mIF8gPT09ICJmdW5jdGlvbiIpIGludGVycG9sYXRlS2V5ID0gaW50ZXJwb2xhdGUgPSBfOyBlbHNlIGludGVycG9sYXRlS2V5ID0gKGludGVycG9sYXRlID0gZDNfc3ZnX2xpbmVJbnRlcnBvbGF0b3JzLmdldChfKSB8fCBkM19zdmdfbGluZUxpbmVhcikua2V5OworICAgICAgcmV0dXJuIGxpbmU7CisgICAgfTsKKyAgICBsaW5lLnRlbnNpb24gPSBmdW5jdGlvbihfKSB7CisgICAgICBpZiAoIWFyZ3VtZW50cy5sZW5ndGgpIHJldHVybiB0ZW5zaW9uOworICAgICAgdGVuc2lvbiA9I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zLmxlbmd0aCArIDIpIHsKKyAgICAgIHJldHVybiBkM19zdmdfbGluZUxpbmVhcihwb2ludHMpOworICAgIH0KKyAgICB2YXIgcXVhZCA9IHBvaW50cy5sZW5ndGggIT0gdGFuZ2VudHMubGVuZ3RoLCBwYXRoID0gIiIsIHAwID0gcG9pbnRzWzBdLCBwID0gcG9pbnRzWzFdLCB0MCA9IHRhbmdlbnRzWzBdLCB0ID0gdDAsIHBpID0gMTsKKyAgICBpZiAocXVhZCkgeworICAgICAgcGF0aCArPSAiUSIgKyAocFswXSAtIHQwWzBdICogMiAvIDMpICsgIiwiICsgKHBbMV0gLSB0MFsxXSAqIDIgLyAzKSArICIsIiArIHBbMF0gKyAiLCIgKyBwWzFdOworICAgICAgcDAgPSBwb2ludHNbMV07CisgICAgICBwaSA9IDI7CisgICAgfQorICAgIGlmICh0YW5nZW50cy5sZW5ndGggPiAxKSB7CisgICAgICB0ID0gdGFuZ2VudHNbMV07CisgICAgICBwID0gcG9pbnRzW3BpXTsKKyAgICAgIHBpKys7CisgICAgICBwYXRoICs9ICJDIiArIChwMFswXSArIHQwWzBdKSArICIsIiArIChwMFsxXSArIHQwWzFdKSArICIsIiArIChwWzBdIC0gdFswXSkgKyAiLCIgKyAocFsxXSAtIHRbMV0pICsgIiwiICsgcFswXSArICIsIiArIHBbMV07CisgICAgICBmb3IgKHZhciBpID0gMjsgaSA8IHRhbmdlbnRzLmxlbmd0aDsgaSsrLCBwaSsrKSB7CisgICAgICAgIHAgPSBwb2ludHNbcGldOworICAgICAgICB0ID0gdGFuZ2VudHNbaV07CisgICAgICAgIHBhdGggKz0gIlMiICsgKHBbMF0gLSB0WzBdKSArICIsIiArIChwWzFdIC0gdFsxXSkgKyAiLCIgKyBwWzBdICsgIiwiICsgcFsxXTsKKyAgICAgIH0KKyAgICB9CisgICAgaWYgKHF1YWQpIHsKKyAgICAgIHZhciBscCA9IHBvaW50c1twaV07CisgICAgICBwYXRoICs9ICJRIiArIChwWzBdICsgdFswXS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XNoKHBpWzBdKTsKKyAgICAgIHB5LnNoaWZ0KCk7CisgICAgICBweS5wdXNoKHBpWzFdKTsKKyAgICAgIGQzX3N2Z19saW5lQmFzaXNCZXppZXIocGF0aCwgcHgsIHB5KTsKKyAgICB9CisgICAgaSA9IC0xOworICAgIHdoaWxlICgrK2kgPCAyKSB7CisgICAgICBweC5zaGlmdCgpOworICAgICAgcHgucHVzaChwaVswXSk7CisgICAgICBweS5zaGlmdCgpOworICAgICAgcHkucHVzaChwaVsxXSk7CisgICAgICBkM19zdmdfbGluZUJhc2lzQmV6aWVyKHBhdGgsIHB4LCBweSk7CisgICAgfQorICAgIHJldHVybiBwYXRoLmpvaW4oIiIpOworICB9CisgIGZ1bmN0aW9uIGQzX3N2Z19saW5lQmFzaXNPcGVuKHBvaW50cykgeworICAgIGlmIChwb2ludHMubGVuZ3RoIDwgNCkgcmV0dXJuIGQzX3N2Z19saW5lTGluZWFyKHBvaW50cyk7CisgICAgdmFyIHBhdGggPSBbXSwgaSA9IC0xLCBuID0gcG9pbnRzLmxlbmd0aCwgcGksIHB4ID0gWyAwIF0sIHB5ID0gWyAwIF07CisgICAgd2hpbGUgKCsraSA8IDMpIHsKKyAgICAgIHBpID0gcG9pbnRzW2ldOworICAgICAgcHgucHVzaChwaVswXSk7CisgICAgICBweS5wdXNoKHBpWzFdKTsKKyAgICB9CisgICAgcGF0aC5wdXNoKGQzX3N2Z19saW5lRG90NChkM19zdmdfbGluZUJhc2lzQmV6aWVyMywgcHgpICsgIiwiICsgZDNfc3ZnX2xpbmVEb3Q0KGQzX3N2Z19saW5lQmFzaXNCZXppZXIzLCBweSkpOworICAgIC0taTsKKyAgICB3aGlsZSAoKytpIDwgbikgeworICAgICAgcGkgPSBwb2ludHNbaV07CisgICAgICBweC5zaGlmdCgpOworICAgICAgcHgucHVzaChwaVswXSk7CisgICAgICBweS5zaGlmdCgpOworICAgICAgcHkucHVzaChwaVsxXSk7CisgICAgICBkM19zdmdfbGluZUJhc2lzQmV6aWVyKHBhdGgsIHB4LCBweSk7CisgICAgfQorICAgIHJldHVybiBwYXRoLmpvaW4oIiIpOworICB9CisgIGZ1bmN0aW9uIGQzX3N2Z19saW5lQmFzaXNDbG9zZWQocG9pbnRzKSB7CisgICAgdmFyIHBhdGgsIGkgPSAtMSwgbiA9IHBvaW50cy5sZW5ndGgsIG0gPSBuICsgNCwgcGksIHB4ID0gW10sIHB5ID0gW107CisgICAgd2hpbGUgKCsraSA8IDQpIHsKKyAgICAgIHBpID0gcG9pbnRzW2kgJSBuXTsKKyAgICAgIHB4LnB1c2gocGlbMF0pOworICAgICAgcHkucHVzaChwaVsxXSk7CisgICAgfQorICAgIHBhdGggPSBbIGQzX3N2Z19saW5lRG90NChkM19zdmdfbGluZUJhc2lzQmV6aWVyMywgcHgpLCAiLCIsIGQzX3N2Z19saW5lRG90NChkM19zdmdfbGluZUJhc2lzQmV6aWVyMywgcHkpIF07CisgICAgLS1pOworICAgIHdoaWxlICgrK2kgPCBtKSB7CisgICAgICBwaSA9IHBvaW50c1tpICUgbl07CisgICAgICBweC5zaGlmdCgpOworICAgICAgcHgucHVzaChwaVswXSk7CisgICAgICBweS5zaGlmdCgpOworICAgICAgcHkucHVzaChwaVsxXSk7CisgICAgICBkM19zdmdfbGluZUJhc2lzQmV6aWVyKHBhdGgsIHB4LCBweSk7CisgICAgfQorICAgIHJldHVybiBwYXRoLmpvaW4oIiIpOworICB9CisgIGZ1bmN0aW9uIGQzX3N2Z19saW5lQnVuZGxlKHBvaW50cywgdGVuc2lvbikgeworICAgIHZhciBuID0gcG9pbnRzLmxlbmd0aCAtIDE7CisgICAgaWYgKG4pIHsKKyAgICAgIHZhciB4MCA9IHBvaW50c1swXVswXSwgeTAgPSBwb2ludHNbMF1bMV0sIGR4ID0gcG9pbnRzW25dWzBdIC0geDAsIGR5ID0gcG9pbnRzW25dWzFdIC0geTAsIGkgPSAtMSwgcCwgdDsKKyAgICAgIHdoaWxlICgrK2kgPD0gbikgeworICAgICAgICBw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nRzKSB7CisgICAgdmFyIGkgPSAwLCBqID0gcG9pbnRzLmxlbmd0aCAtIDEsIG0gPSBbXSwgcDAgPSBwb2ludHNbMF0sIHAxID0gcG9pbnRzWzFdLCBkID0gbVswXSA9IGQzX3N2Z19saW5lU2xvcGUocDAsIHAxKTsKKyAgICB3aGlsZSAoKytpIDwgaikgeworICAgICAgbVtpXSA9IChkICsgKGQgPSBkM19zdmdfbGluZVNsb3BlKHAwID0gcDEsIHAxID0gcG9pbnRzW2kgKyAxXSkpKSAvIDI7CisgICAgfQorICAgIG1baV0gPSBkOworICAgIHJldHVybiBtOworICB9CisgIGZ1bmN0aW9uIGQzX3N2Z19saW5lTW9ub3RvbmVUYW5nZW50cyhwb2ludHMpIHsKKyAgICB2YXIgdGFuZ2VudHMgPSBbXSwgZCwgYSwgYiwgcywgbSA9IGQzX3N2Z19saW5lRmluaXRlRGlmZmVyZW5jZXMocG9pbnRzKSwgaSA9IC0xLCBqID0gcG9pbnRzLmxlbmd0aCAtIDE7CisgICAgd2hpbGUgKCsraSA8IGopIHsKKyAgICAgIGQgPSBkM19zdmdfbGluZVNsb3BlKHBvaW50c1tpXSwgcG9pbnRzW2kgKyAxXSk7CisgICAgICBpZiAoTWF0aC5hYnMoZCkgPCAxZS02KSB7CisgICAgICAgIG1baV0gPSBtW2kgKyAxXSA9IDA7CisgICAgICB9IGVsc2UgeworICAgICAgICBhID0gbVtpXSAvIGQ7CisgICAgICAgIGIgPSBtW2kgKyAxXSAvIGQ7CisgICAgICAgIHMgPSBhICogYSArIGIgKiBiOworICAgICAgICBpZiAocyA+IDkpIHsKKyAgICAgICAgICBzID0gZCAqIDMgLyBNYXRoLnNxcnQocyk7CisgICAgICAgICAgbVtpXSA9IHMgKiBhOworICAgICAgICAgIG1baSArIDFdID0gcyAqIGI7CisgICAgICAgIH0KKyAgICAgIH0KKyAgICB9CisgICAgaSA9IC0xOworICAgIHdoaWxlICgrK2kgPD0gaikgeworICAgICAgcyA9IChwb2ludHNbTWF0aC5taW4oaiwgaSArIDEpXVswXSAtIHBvaW50c1tNYXRoLm1heCgwLCBpIC0gMSldWzBdKSAvICg2ICogKDEgKyBtW2ldICogbVtpXSkpOworICAgICAgdGFuZ2VudHMucHVzaChbIHMgfHwgMCwgbVtpXSAqIHMgfHwgMCBdKTsKKyAgICB9CisgICAgcmV0dXJuIHRhbmdlbnRzOworICB9CisgIGZ1bmN0aW9uIGQzX3N2Z19saW5lTW9ub3RvbmUocG9pbnRzKSB7CisgICAgcmV0dXJuIHBvaW50cy5sZW5ndGggPCAzID8gZDNfc3ZnX2xpbmVMaW5lYXIocG9pbnRzKSA6IHBvaW50c1swXSArIGQzX3N2Z19saW5lSGVybWl0ZShwb2ludHMsIGQzX3N2Z19saW5lTW9ub3RvbmVUYW5nZW50cyhwb2ludHMpKTsKKyAgfQorICBmdW5jdGlvbiBkM19zdmdfbGluZVJhZGlhbChwb2ludHMpIHsKKyAgICB2YXIgcG9pbnQsIGkgPSAtMSwgbiA9IHBvaW50cy5sZW5ndGgsIHIsIGE7CisgICAgd2hpbGUgKCsraSA8IG4pIHsKKyAgICAgIHBvaW50ID0gcG9pbnRzW2ldOworICAgICAgciA9IHBvaW50WzBdOworICAgICAgYSA9IHBvaW50WzFdICsgZDNfc3ZnX2FyY09mZnNldDsKKyAgICAgIHBvaW50WzBdID0gciAqIE1hdGguY29zKGEpOworICAgICAgcG9pbnRbMV0gPSByICogTWF0aC5zaW4oYSk7CisgICAgfQorICAgIHJldHVybiBwb2ludHM7CisgIH0KKyAgZnVuY3Rpb24gZDNfc3ZnX2FyZWEocHJvamVjdGlvbikgeworICAgIGZ1bmN0aW9uIGFyZWEoZGF0YSkgeworICAgICAgZnVuY3Rpb24gc2VnbWVudCgpIHsKKyAgICAgICAgc2VnbWVudHMucHVzaCgiTSIsIGludGVycG9sYXRlKHByb2plY3Rpb24ocG9pbnRzMSksIHRlbnNpb24pLCBMLCBpbnRlcnBvbGF0ZVJldmVyc2UocHJvamVjdGlvbihwb2ludHMwLnJldmVyc2UoKSksIHRlbnNpb24pLCAiWiIpOworICAgICAgfQorICAgICAgdmFyIHNlZ21lbnRzID0gW10sIHBvaW50czAgPSBbXSwgcG9pbnRzMSA9IFtdLCBpID0gLTEsIG4gPSBkYXRhLmxlbmd0aCwgZCwgZngwID0gZDNfZnVuY3Rvcih4MCksIGZ5MCA9IGQzX2Z1bmN0b3IoeTApLCBmeDEgPSB4MCA9PT0geDEgPyBmdW5jdGlvbigpIHsKKyAgICAgICAgcmV0dXJuIHg7CisgICAgICB9IDogZDNfZnVuY3Rvcih4MSksIGZ5MSA9IHkwID09PSB5MSA/IGZ1bmN0aW9uKCkgeworICAgICAgICByZXR1cm4geTsKKyAgICAgIH0gOiBkM19mdW5jdG9yKHkxKSwgeCwgeTsKKyAgICAgIHdoaWxlICgrK2kgPCBuKSB7CisgICAgICAgIGlmIChkZWZpbmVkLmNhbGwodGhpcywgZCA9IGRhdGFbaV0sIGkpKSB7CisgICAgICAgICAgcG9pbnRzMC5wdXNoKFsgeCA9ICtmeDAuY2FsbCh0aGlzLCBkLCBpKSwgeSA9ICtmeTAuY2FsbCh0aGlzLCBkLCBpKSBdKTsKKyAgICAgICAgICBwb2ludHMxLnB1c2goWyArZngxLmNhbGwodGhpcywgZCwgaSksICtmeTEuY2FsbCh0aGlzLCBkLCBpKSBdKTsKKyAgICAgICAgfSBlbHNlIGlmIChwb2ludHMwLmxlbmd0aCkgeworICAgICAgICAgIHNlZ21lbnQoKTsKKyAgICAgICAgICBwb2ludHMwID0gW107CisgICAgICAgICAgcG9pbnRzMSA9IFtdOworICAgICAgICB9CisgICAgICB9CisgICAgICBpZiAocG9pbnRzMC5sZW5ndGgpIHNlZ21lbnQoKTsKKyAgICAgIHJldHVybiBzZWdtZW50cy5sZW5ndGggPyBzZWdtZW50cy5qb2luKCIiKSA6IG51bGw7CisgICAgfQorICAgIHZhciB4MCA9IGQzX3N2Z19saW5lWCwgeDEgPSBkM19zdmdfbGluZVgsIHkwID0gMCwgeTEgPSBkM19zdmdfbGluZVksIGRlZmluZWQgPSBkM190cnVlLCBpbnRlcnBvbGF0ZSA9IGQzX3N2Z19saW5lTGluZWFyLCBpbnRlcnBvbGF0ZUtleSA9IGludGVycG9sYXRlLmtleSwgaW50ZXJwb2xhdGVSZXZlcnNlID0gaW50ZXJwb2xhdGUsIEwgPSAiTCIsIHRlbnNpb24gPSAuNzsKKyAgICBhcmVhLnggPSBmdW5jdGlvbihfKSB7CisgICAgICBpZiAoIWFyZ3VtZW50cy5sZW5ndGgpIHJldHVybiB4MTsKKyAgICAgIHgwID0geDEgPSBfOworICAgICAgcmV0dXJuIGFyZWE7CisgICAgfTsKKyAgICBhcmVhLngwID0gZnVuY3Rpb24oXykgeworICAgICAgaWYgKCFhcmd1bWVudHMubGVuZ3RoKSByZXR1cm4geDA7CisgICAgICB4MCA9IF87CisgICAgICByZXR1cm4gYXJlYTsKKyAgICB9OworICAgIGFyZWEueDEgPSBmdW5jdGlvbihfKSB7CisgICAgICBpZiAoIWFyZ3VtZW50cy5sZW5ndGgpIHJldHVybiB4MTsKKyAgICAgIHgxID0gXzsKKyAgICAgIHJldHVybiBhcmVhOworICAgIH07CisgICAgYXJlYS55ID0gZnVuY3Rpb24oXykgeworICAgICAgaWYgKCFhcmd1bWVudHMubGVuZ3RoKSByZXR1cm4geTE7CisgICAgICB5MCA9IHkxID0gXzsKKyAgICAgIHJldHVybiBhcmVhOworICAgIH07CisgICAgYXJlYS55MCA9IGZ1bmN0aW9uKF8pIHsKKyAgICAgIGlmICghYXJndW1lbnRzLmxlbmd0aCkgcmV0dXJuIHkwOworICAgICAgeTAgPSBfOworICAgICAgcmV0dXJuIGFyZWE7CisgICAgfTsKKyAgICBhcmVhLnkxID0gZnVuY3Rpb24oXykgeworICAgICAgaWYgKCFhcmd1bWVudHMubGVuZ3RoKSByZXR1cm4geTE7CisgICAgICB5MSA9IF87CisgICAgICByZXR1cm4gYXJlYTsKKyAgICB9OworICAgIGFyZWEuZGVmaW5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uY3Rpb24oZCkgeworICAgICAgcmV0dXJuICJ0cmFuc2xhdGUoIiArIHgoZCkgKyAiLDApIjsKKyAgICB9KTsKKyAgfQorICBmdW5jdGlvbiBkM19zdmdfYXhpc1koc2VsZWN0aW9uLCB5KSB7CisgICAgc2VsZWN0aW9uLmF0dHIoInRyYW5zZm9ybSIsIGZ1bmN0aW9uKGQpIHsKKyAgICAgIHJldHVybiAidHJhbnNsYXRlKDAsIiArIHkoZCkgKyAiKSI7CisgICAgfSk7CisgIH0KKyAgZnVuY3Rpb24gZDNfc3ZnX2F4aXNTdWJkaXZpZGUoc2NhbGUsIHRpY2tzLCBtKSB7CisgICAgc3VidGlja3MgPSBbXTsKKyAgICBpZiAobSAmJiB0aWNrcy5sZW5ndGggPiAxKSB7CisgICAgICB2YXIgZXh0ZW50ID0gZDNfc2NhbGVFeHRlbnQoc2NhbGUuZG9tYWluKCkpLCBzdWJ0aWNrcywgaSA9IC0xLCBuID0gdGlja3MubGVuZ3RoLCBkID0gKHRpY2tzWzFdIC0gdGlja3NbMF0pIC8gKyttLCBqLCB2OworICAgICAgd2hpbGUgKCsraSA8IG4pIHsKKyAgICAgICAgZm9yIChqID0gbTsgLS1qID4gMDsgKSB7CisgICAgICAgICAgaWYgKCh2ID0gK3RpY2tzW2ldIC0gaiAqIGQpID49IGV4dGVudFswXSkgeworICAgICAgICAgICAgc3VidGlja3MucHVzaCh2KTsKKyAgICAgICAgICB9CisgICAgICAgIH0KKyAgICAgIH0KKyAgICAgIGZvciAoLS1pLCBqID0gMDsgKytqIDwgbSAmJiAodiA9ICt0aWNrc1tpXSArIGogKiBkKSA8IGV4dGVudFsxXTsgKSB7CisgICAgICAgIHN1YnRpY2tzLnB1c2godik7CisgICAgICB9CisgICAgfQorICAgIHJldHVybiBzdWJ0aWNrczsKKyAgfQorICBmdW5jdGlvbiBkM19iZWhhdmlvcl96b29tRGVsdGEoKSB7CisgICAgaWYgKCFkM19iZWhhdmlvcl96b29tRGl2KSB7CisgICAg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mNlRHJhZ2VuZChkKSB7CisgICAgZC5maXhlZCAmPSAxOworICB9CisgIGZ1bmN0aW9uIGQzX2xheW91dF9mb3JjZU1vdXNlb3ZlcihkKSB7CisgICAgZC5maXhlZCB8PSA0OworICB9CisgIGZ1bmN0aW9uIGQzX2xheW91dF9mb3JjZU1vdXNlb3V0KGQpIHsKKyAgICBkLmZpeGVkICY9IDM7CisgIH0KKyAgZnVuY3Rpb24gZDNfbGF5b3V0X2ZvcmNlQWNjdW11bGF0ZShxdWFkLCBhbHBoYSwgY2hhcmdlcykgeworICAgIHZhciBjeCA9IDAsIGN5ID0gMDsKKyAgICBxdWFkLmNoYXJnZSA9IDA7CisgICAgaWYgKCFxdWFkLmxlYWYpIHsKKyAgICAgIHZhciBub2RlcyA9IHF1YWQubm9kZXMsIG4gPSBub2Rlcy5sZW5ndGgsIGkgPSAtMSwgYzsKKyAgICAgIHdoaWxlICgrK2kgPCBuKSB7CisgICAgICAgIGMgPSBub2Rlc1tpXTsKKyAgICAgICAgaWYgKGMgPT0gbnVsbCkgY29udGludWU7CisgICAgICAgIGQzX2xheW91dF9mb3JjZUFjY3VtdWxhdGUoYywgYWxwaGEsIGNoYXJnZXMpOworICAgICAgICBxdWFkLmNoYXJnZSArPSBjLmNoYXJnZTsKKyAgICAgICAgY3ggKz0gYy5jaGFyZ2UgKiBjLmN4OworICAgICAgICBjeSArPSBjLmNoYXJnZSAqIGMuY3k7CisgICAgICB9CisgICAgfQorICAgIGlmIChxdWFkLnBvaW50KSB7CisgICAgICBpZiAoIXF1YWQubGVhZikgeworICAgICAgICBxdWFkLnBvaW50LnggKz0gTWF0aC5yYW5kb20oKSAtIC41OworICAgICAgICBxdWFkLnBvaW50LnkgKz0gTWF0aC5yYW5kb20oKSAtIC41OworICAgICAgfQorICAgICAgdmFyIGsgPSBhbHBoYSAqIGNoYXJnZXNbcXVhZC5wb2ludC5pbmRleF07CisgICAgICBxdWFkLmNoYXJnZSArPSBxdWFkLnBvaW50Q2hhcmdlID0gazsKKyAgICAgIGN4ICs9IGsgKiBxdWFkLnBvaW50Lng7CisgICAgICBjeSArPSBrICogcXVhZC5wb2ludC55OworICAgIH0KKyAgICBxdWFkLmN4ID0gY3ggLyBxdWFkLmNoYXJnZTsKKyAgICBxdWFkLmN5ID0gY3kgLyBxdWFkLmNoYXJnZTsKKyAgfQorICBmdW5jdGlvbiBkM19sYXlvdXRfZm9yY2VMaW5rRGlzdGFuY2UobGluaykgeworICAgIHJldHVybiAyMDsKKyAgfQorICBmdW5jdGlvbiBkM19sYXlvdXRfZm9yY2VMaW5rU3RyZW5ndGgobGluaykgeworICAgIHJldHVybiAxOworICB9CisgIGZ1bmN0aW9uIGQzX2xheW91dF9zdGFja1goZCkgeworICAgIHJldHVybiBkLng7CisgIH0KKyAgZnVuY3Rpb24gZDNfbGF5b3V0X3N0YWNrWShkKSB7CisgICAgcmV0dXJuIGQueTsKKyAgfQorICBmdW5jdGlvbiBkM19sYXlvdXRfc3RhY2tPdXQoZCwgeTAsIHkpIHsKKyAgICBkLnkwID0geTA7CisgICAgZC55ID0geTsKKyAgfQorICBmdW5jdGlvbiBkM19sYXlvdXRfc3RhY2tPcmRlckRlZmF1bHQoZGF0YSkgeworICAgIHJldHVybiBkMy5yYW5nZShkYXRhLmxlbmd0aCk7CisgIH0KKyAgZnVuY3Rpb24gZDNfbGF5b3V0X3N0YWNrT2Zmc2V0WmVybyhkYXRhKSB7CisgICAgdmFyIGogPSAtMSwgbSA9IGRhdGFbMF0ubGVuZ3RoLCB5MCA9IFtdOworICAgIHdoaWxlICgrK2ogPCBtKSB5MFtqXSA9IDA7CisgICAgcmV0dXJuIHkwOworICB9CisgIGZ1bmN0aW9uIGQzX2xheW91dF9zdGFja01heEluZGV4KGFycmF5KSB7CisgICAgdmFyIGkgPSAxLCBqID0gMCwgdiA9IGFycmF5WzBdWzFdLCBrLCBuID0gYXJyYXkubGVuZ3RoOworICAgIGZvciAoOyBpIDwgbjsgKytpKSB7CisgICAgICBpZiAo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plY3QubGlua3MgPSBkM19sYXlvdXRfaGllcmFyY2h5TGlua3M7CisgICAgb2JqZWN0Lm5vZGVzID0gZnVuY3Rpb24oZCkgeworICAgICAgZDNfbGF5b3V0X2hpZXJhcmNoeUlubGluZSA9IHRydWU7CisgICAgICByZXR1cm4gKG9iamVjdC5ub2RlcyA9IG9iamVjdCkoZCk7CisgICAgfTsKKyAgICByZXR1cm4gb2JqZWN0OworICB9CisgIGZ1bmN0aW9uIGQzX2xheW91dF9oaWVyYXJjaHlDaGlsZHJlbihkKSB7CisgICAgcmV0dXJuIGQuY2hpbGRyZW47CisgIH0KKyAgZnVuY3Rpb24gZDNfbGF5b3V0X2hpZXJhcmNoeVZhbHVlKGQpIHsKKyAgICByZXR1cm4gZC52YWx1ZTsKKyAgfQorICBmdW5jdGlvbiBkM19sYXlvdXRfaGllcmFyY2h5U29ydChhLCBiKSB7CisgICAgcmV0dXJuIGIudmFsdWUgLSBhLnZhbHVlOworICB9CisgIGZ1bmN0aW9uIGQzX2xheW91dF9oaWVyYXJjaHlMaW5rcyhub2RlcykgeworICAgIHJldHVybiBkMy5tZXJnZShub2Rlcy5tYXAoZnVuY3Rpb24ocGFyZW50KSB7CisgICAgICByZXR1cm4gKHBhcmVudC5jaGlsZHJlbiB8fCBbXSkubWFwKGZ1bmN0aW9uKGNoaWxkKSB7CisgICAgICAgIHJldHVybiB7CisgICAgICAgICAgc291cmNlOiBwYXJlbnQsCisgICAgICAgICAgdGFyZ2V0OiBjaGlsZAorICAgICAgICB9OworICAgICAgfSk7CisgICAgfSkpOworICB9CisgIGZ1bmN0aW9uIGQzX2xheW91dF9wYWNrU29ydChhLCBiKSB7CisgICAgcmV0dXJuIGEudmFsdWUgLSBiLnZhbHVlOworICB9CisgIGZ1bmN0aW9uIGQzX2xheW91dF9wYWNrSW5zZXJ0KGEsIGIpIHsKKyAgICB2YXIgYyA9IGEuX3BhY2tfbmV4dDsKKyAgICBhLl9wYWNrX25leHQgPSBiOworICAgIGIuX3BhY2tfcHJldiA9IGE7CisgICAgYi5fcGFja19uZXh0ID0gYzsKKyAgICBjLl9wYWNrX3ByZXYgPSBiOworICB9CisgIGZ1bmN0aW9uIGQzX2xheW91dF9wYWNrU3BsaWNlKGEsIGIpIHsKKyAgICBhLl9wYWNrX25leHQgPSBiOworICAgIGIuX3BhY2tfcHJldiA9IGE7CisgIH0KKyAgZnVuY3Rpb24gZDNfbGF5b3V0X3BhY2tJbnRlcnNlY3RzKGEsIGIpIHsKKyAgICB2YXIgZHggPSBiLnggLSBhLngsIGR5ID0gYi55IC0gYS55LCBkciA9IGEuciArIGIucjsKKyAgICByZXR1cm4gZHIgKiBkciAtIGR4ICogZHggLSBkeSAqIGR5ID4gLjAwMTsKKyAgfQorICBmdW5jdGlvbiBkM19sYXlvdXRfcGFja1NpYmxpbmdzKG5vZGUpIHsKKyAgICBmdW5jdGlvbiBib3VuZChub2RlKSB7CisgICAgICB4TWluID0gTWF0aC5taW4obm9kZS54IC0gbm9kZS5yLCB4TWluKTsKKyAgICAgIHhNYXggPSBNYXRoLm1heChub2RlLnggKyBub2RlLnIsIHhNYXgpOworICAgICAgeU1pbiA9IE1hdGgubWluKG5vZGUueSAtIG5vZGUuciwgeU1pbik7CisgICAgICB5TWF4ID0gTWF0aC5tYXgobm9kZS55ICsgbm9kZS5yLCB5TWF4KTsKKyAgICB9CisgICAgaWYgKCEobm9kZXMgPSBub2RlLmNoaWxkcmVuKSB8fCAhKG4gPSBub2Rlcy5sZW5ndGgpKSByZXR1cm47CisgICAgdmFyIG5vZGVzLCB4TWluID0gSW5maW5pdHksIHhNYXggPSAtSW5maW5pdHksIHlNaW4gPSBJbmZpbml0eSwgeU1heCA9IC1JbmZpbml0eSwgYSwgYiwgYywgaSwgaiwgaywgbjsKKyAgICBub2Rlcy5mb3JFYWNoKGQzX2xheW91dF9wYWNrTGluayk7CisgICAgYSA9IG5vZGVzWzBdOworICAgIGEueCA9IC1hLnI7CisgICAgYS55ID0gMDsKKyAgICBib3VuZChhKTsKKyAgICBpZiAobiA+IDEpIHsKKyAgICAgIGIgPSBub2Rlc1sxXTsKKyAgICAgIGIueCA9IGIucjsKKyAgICAgIGIueSA9IDA7CisgICAgICBib3VuZChiKTsKKyAgICAgIGlmIChuID4gMikgeworICAgICAgICBjID0gbm9kZXNbMl07CisgICAgICAgIGQzX2xheW91dF9wYWNrUGxhY2UoYSwgYiwgYyk7CisgICAgICAgIGJvdW5kKGMpOworICAgICAgICBkM19sYXlvdXRfcGFja0luc2VydChhLCBjKTsKKyAgICAgICAgYS5fcGFja19wcmV2ID0gYzsKKyAgICAgICAgZDNfbGF5b3V0X3BhY2tJbnNlcnQoYywgYik7CisgICAgICAgIGIgPSBhLl9wYWNrX25leHQ7CisgICAgICAgIGZvciAoaSA9IDM7IGkgPCBuOyBpKyspIHsKKyAgICAgICAgICBkM19sYXlvdXRfcGFja1BsYWNlKGEsIGIsIGMgPSBub2Rlc1tpXSk7CisgICAgICAgICAgdmFyIGlzZWN0ID0gMCwgczEgPSAxLCBzMiA9IDE7CisgICAgICAgICAgZm9yIChqID0gYi5fcGFja19uZXh0OyBqICE9PSBiOyBqID0gai5fcGFja19uZXh0LCBzMSsrKSB7CisgICAgICAgICAgICBpZiAoZDNfbGF5b3V0X3BhY2tJbnRlcnNlY3RzKGosIGMpKSB7CisgICAgICAgICAgICAgIGlzZWN0ID0gMTsKKyAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICB9CisgICAgICAgICAgfQorICAgICAgICAgIGlmIChpc2VjdCA9PSAxKSB7CisgICAgICAgICAgICBmb3IgKGsgPSBhLl9wYWNrX3ByZXY7IGsgIT09IGouX3BhY2tfcHJldjsgayA9IGsuX3BhY2tfcHJldiwgczIrKykgeworICAgICAgICAgICAgICBpZiAoZDNfbGF5b3V0X3BhY2tJbnRlcnNlY3RzKGssIGMpKSB7CisgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0KKyAgICAgICAgICB9CisgICAgICAgICAgaWYgKGlzZWN0KSB7CisgICAgICAgICAgICBpZiAoczEgPCBzMiB8fCBzMSA9PSBzMiAmJiBiLnIgPCBhLnIpIGQzX2xheW91dF9wYWNrU3BsaWNlKGEsIGIgPSBqKTsgZWxzZSBkM19sYXlvdXRfcGFja1NwbGljZShhID0gaywgYik7CisgICAgICAgICAgICBpLS07CisgICAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgIGQzX2xheW91dF9wYWNrSW5zZXJ0KGEsIGMpOworICAgICAgICAgICAgYiA9IGM7CisgICAgICAgICAgICBib3VuZChjKTsKKyAgICAgICAgICB9CisgICAgICAgIH0KKyAgICAgIH0KKyAgICB9CisgICAgdmFyIGN4ID0gKHhNaW4gKyB4TWF4KSAvIDIsIGN5ID0gKHlNaW4gKyB5TWF4KSAvIDIsIGNyID0gMDsKKyAgICBmb3IgKGkgPSAwOyBpIDwgbjsgaSsrKSB7CisgICAgICBjID0gbm9kZXNbaV07CisgICAgICBjLnggLT0gY3g7CisgICAgICBjLnkgLT0gY3k7CisgICAgICBjciA9IE1hdGgubWF4KGNyLCBjLnIgKyBNYXRoLnNxcnQoYy54ICogYy54ICsgYy55ICogYy55KSk7CisgICAgfQorICAgIG5vZGUuciA9IGNyOworICAgIG5vZGVzLmZvckVhY2goZDNfbGF5b3V0X3BhY2tVbmxpbmspOworICB9CisgIGZ1bmN0aW9uIGQzX2xheW91dF9wYWNrTGluayhub2RlKSB7CisgICAgbm9kZS5fcGFja19uZXh0ID0gbm9kZS5fcGFja19wcmV2ID0gbm9kZTsKKyAgfQorICBmdW5jdGlvbiBkM19sYXlvdXRfcGFja1VubGluayhub2RlKSB7CisgICAgZGVsZXRlIG5vZGUuX3BhY2tfbmV4dDsKKyAgICBkZWxldGUgbm9kZS5fcGFja19wcmV2OworICB9CisgIGZ1bmN0aW9uIGQzX2xheW91dF9wYWNrVHJhbnNmb3JtKG5vZGUsIHgsIHksIGspIHsKKyAgICB2YXIgY2hpbGRyZW4gPSBub2RlLmNoaWxkcmVuOworICAgIG5vZGUueCA9IHggKz0gayAqIG5vZGUueDsKKyAgICBub2RlLnkgPSB5ICs9IGsgKiBub2RlLnk7CisgICAgbm9kZS5yICo9IGs7CisgICAgaWYgKGNoaWxkcmVuKSB7CisgICAgICB2YXIgaSA9IC0xLCBuID0gY2hpbGRyZW4ubGVuZ3RoOworICAgICAgd2hpbGUgKCsraSA8IG4pIGQzX2xheW91dF9wYWNrVHJhbnNmb3JtKGNoaWxkcmVuW2ldLCB4LCB5LCBrKTsKKyAgICB9CisgIH0KKyAgZnVuY3Rpb24gZDNfbGF5b3V0X3BhY2tQbGFjZShhLCBiLCBjKSB7CisgICAgdmFyIGRiID0gYS5yICsgYy5yLCBkeCA9IGIueCAtIGEueCwgZHkgPSBiLnkgLSBhLnk7CisgICAgaWYgKGRiICYmIChkeCB8fCBkeSkpIHsKKyAgICAgIHZhciBkYSA9IGIuciArIGMuciwgZGMgPSBkeCAqIGR4ICsgZHkgKiBkeTsKKyAgICAgIGRhICo9IGRhOworICAgICAgZGIgKj0gZGI7CisgICAgICB2YXIgeCA9IC41ICsgKGRiIC0gZGEpIC8gKDIgKiBkYyksIHkgPSBNYXRoLnNxcnQoTWF0aC5tYXgoMCwgMiAqIGRhICogKGRiICsgZGMpIC0gKGRiIC09IGRjKSAqIGRiIC0gZGEgKiBkYSkpIC8gKDIgKiBkYyk7CisgICAgICBjLnggPSBhLnggKyB4ICogZHggKyB5ICogZHk7CisgICAgICBjLnkgPSBhLnkgKyB4ICogZHkgLSB5ICogZHg7CisgICAgfSBlbHNlIHsKKyAgICAgIGMueCA9IGEueCArIGRiOworICAgICAgYy55ID0gYS55OworICAgIH0KKyAgfQorICBmdW5jdGlvbiBkM19sYXlvdXRfY2x1c3RlclkoY2hpbGRyZW4pIHsKKyAgICByZXR1cm4gMSArIGQzLm1heChjaGlsZHJlbiwgZnVuY3Rpb24oY2hpbGQpIHsKKyAgICAgIHJldHVybiBjaGlsZC55OworICAgI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sIGNhbGxiYWNrKSB7CisgICAgICBkMy50ZXh0KHVybCwgbWltZVR5cGUsIGZ1bmN0aW9uKHRleHQpIHsKKyAgICAgICAgY2FsbGJhY2sodGV4dCAmJiBkc3YucGFyc2UodGV4dCkpOworICAgICAgfSk7CisgICAgfQorICAgIGZ1bmN0aW9uIGZvcm1hdFJvdyhyb3cpIHsKKyAgICAgIHJldHVybiByb3cubWFwKGZvcm1hdFZhbHVlKS5qb2luKGRlbGltaXRlcik7CisgICAgfQorICAgIGZ1bmN0aW9uIGZvcm1hdFZhbHVlKHRleHQpIHsKKyAgICAgIHJldHVybiByZUZvcm1hdC50ZXN0KHRleHQpID8gJyInICsgdGV4dC5yZXBsYWNlKC9cIi9nLCAnIiInKSArICciJyA6IHRleHQ7CisgICAgfQorICAgIHZhciByZVBhcnNlID0gbmV3IFJlZ0V4cCgiXHJcbnxbIiArIGRlbGltaXRlciArICJcclxuXSIsICJnIiksIHJlRm9ybWF0ID0gbmV3IFJlZ0V4cCgnWyInICsgZGVsaW1pdGVyICsgIlxuXSIpLCBkZWxpbWl0ZXJDb2RlID0gZGVsaW1pdGVyLmNoYXJDb2RlQXQoMCk7CisgICAgZHN2LnBhcnNlID0gZnVuY3Rpb24odGV4dCkgeworICAgICAgdmFyIGhlYWRlcjsKKyAgICAgIHJldHVybiBkc3YucGFyc2VSb3dzKHRleHQsIGZ1bmN0aW9uKHJvdywgaSkgeworICAgICAgICBpZiAoaSkgeworICAgICAgICAgIHZhciBvID0ge30sIGogPSAtMSwgbSA9IGhlYWRlci5sZW5ndGg7CisgICAgICAgICAgd2hpbGUgKCsraiA8IG0pIG9baGVhZGVyW2pdXSA9IHJvd1tqXTsKKyAgICAgICAgICByZXR1cm4gbzsKKyAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICBoZWFkZXIgPSByb3c7CisgICAgICAgICAgcmV0dXJuIG51bGw7CisgICAgICAgIH0KKyAgICAgIH0pOworICAgIH07CisgICAgZHN2LnBhcnNlUm93cyA9IGZ1bmN0aW9uKHRleHQsIGYpIHsKKyAgICAgIGZ1bmN0aW9uIHRva2VuKCkgeworICAgICAgICBpZiAocmVQYXJzZS5sYXN0SW5kZXggPj0gdGV4dC5sZW5ndGgpIHJldHVybiBFT0Y7CisgICAgICAgIGlmIChlb2wpIHsKKyAgICAgICAgICBlb2wgPSBmYWxzZTsKKyAgICAgICAgICByZXR1cm4gRU9MOworICAgICAgICB9CisgICAgICAgIHZhciBqID0gcmVQYXJzZS5sYXN0SW5kZXg7CisgICAgICAgIGlmICh0ZXh0LmNoYXJDb2RlQXQoaikgPT09IDM0KSB7CisgICAgICAgICAgdmFyIGkgPSBqOworICAgICAgICAgIHdoaWxlIChpKysgPCB0ZXh0Lmxlbmd0aCkgeworICAgICAgICAgICAgaWYgKHRleHQuY2hhckNvZGVBdChpKSA9PT0gMzQpIHsKKyAgICAgICAgICAgICAgaWYgKHRleHQuY2hhckNvZGVBdChpICsgMSkgIT09IDM0KSBicmVhazsKKyAgICAgICAgICAgICAgaSsrOworICAgICAgICAgICAgfQorICAgICAgICAgIH0KKyAgICAgICAgICByZVBhcnNlLmxhc3RJbmRleCA9IGkgKyAyOworICAgICAgICAgIHZhciBjID0gdGV4dC5jaGFyQ29kZUF0KGkgKyAxKTsKKyAgICAgICAgICBpZiAoYyA9PT0gMTMpIHsKKyAgICAgICAgICAgIGVvbCA9IHRydWU7CisgICAgICAgICAgICBpZiAodGV4dC5jaGFyQ29kZUF0KGkgKyAyKSA9PT0gMTApIHJlUGFyc2UubGFzdEluZGV4Kys7CisgICAgICAgICAgfSBlbHNlIGlmIChjID09PSAxMCkgeworICAgICAgICAgICAgZW9sID0gdHJ1ZTsKKyAgICAgICAgICB9CisgICAgICAgICAgcmV0dXJuIHRleHQuc3Vic3RyaW5nKGogKyAxLCBpKS5yZXBsYWNlKC8iIi9nLCAnIicpOworICAgICAgICB9CisgICAgICAgIHZhciBtID0gcmVQYXJzZS5leGVjKHRleHQpOworICAgICAgICBpZiAobSkgeworICAgICAgICAgIGVvbCA9IG1bMF0uY2hhckNvZGVBdCgwKSAhPT0gZGVsaW1pdGVyQ29kZTsKKyAgICAgICAgICByZXR1cm4gdGV4dC5zdWJzdHJpbmcoaiwgbS5pbmRleCk7CisgICAgICAgIH0KKyAgICAgICAgcmVQYXJzZS5sYXN0SW5kZXggPSB0ZXh0Lmxlbmd0aDsKKyAgICAgICAgcmV0dXJuIHRleHQuc3Vic3RyaW5nKGopOworICAgICAgfQorICAgICAgdmFyIEVPTCA9IHt9LCBFT0YgPSB7fSwgcm93cyA9IFtdLCBuID0gMCwgdCwgZW9sOworICAgICAgcmVQYXJzZS5sYXN0SW5kZXggPSAwOworICAgICAgd2hpbGUgKCh0ID0gdG9rZW4oKSkgIT09IEVPRikgeworICAgICAgICB2YXIgYSA9IFtdOworICAgICAgICB3aGlsZSAodCAhPT0gRU9MICYmIHQgIT09IEVPRikgeworICAgICAgICAgIGEucHVzaCh0KTsKKyAgICAgICAgICB0ID0gdG9rZW4oKTsKKyAgICAgICAgfQorICAgICAgICBpZiAoZiAmJiAhKGEgPSBmKGEsIG4rKykpKSBjb250aW51ZTsKKyAgICAgICAgcm93cy5wdXNoKGEpOworICAgICAgfQorICAgICAgcmV0dXJuIHJvd3M7CisgICAgfTsKKyAgICBkc3YuZm9ybWF0ID0gZnVuY3Rpb24ocm93cykgeworICAgICAgcmV0dXJuIHJvd3MubWFwKGZvcm1hdFJvdykuam9pbigiXG4iKTsKKyAgICB9OworICAgIHJldHVybiBkc3Y7CisgIH0KKyAgZnVuY3Rpb24gZDNfZ2VvX3R5cGUodHlwZXMsIGRlZmF1bHRWYWx1ZSkgeworICAgIHJldHVybiBmdW5jdGlvbihvYmplY3QpIHsKKyAgICAgIHJldHVybiBvYmplY3QgJiYgdHlwZXMuaGFzT3duUHJvcGVydHkob2JqZWN0LnR5cGUpID8gdHlwZXNbb2JqZWN0LnR5cGVdKG9iamVjdCkgOiBkZWZhdWx0VmFsdWU7CisgICAgfTsKKyAgfQor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IG47IGkrKykgeworICAgICAgZi5hcHBseShudWxsLCBhW2ldKTsKKyAgICB9CisgIH0KKyAgZnVuY3Rpb24gZDNfZ2VvX2JvdW5kc011bHRpTGluZVN0cmluZyhvLCBmKSB7CisgICAgZm9yICh2YXIgYSA9IG8uY29vcmRpbmF0ZXMsIGkgPSAwLCBuID0gYS5sZW5ndGg7IGkgPCBuOyBpKyspIHsKKyAgICAgIGZvciAodmFyIGIgPSBhW2ldLCBqID0gMCwgbSA9IGIubGVuZ3RoOyBqIDwgbTsgaisrKSB7CisgICAgICAgIGYuYXBwbHkobnVsbCwgYltqXSk7CisgICAgICB9CisgICAgfQorICB9CisgIGZ1bmN0aW9uIGQzX2dlb19ib3VuZHNNdWx0aVBvbHlnb24obywgZikgeworICAgIGZvciAodmFyIGEgPSBvLmNvb3JkaW5hdGVzLCBpID0gMCwgbiA9IGEubGVuZ3RoOyBpIDwgbjsgaSsrKSB7CisgICAgICBmb3IgKHZhciBiID0gYVtpXVswXSwgaiA9IDAsIG0gPSBiLmxlbmd0aDsgaiA8IG07IGorKykgeworICAgICAgICBmLmFwcGx5KG51bGwsIGJbal0pOworICAgICAgfQorICAgIH0KKyAgfQorICBmdW5jdGlvbiBkM19nZW9fYm91bmRzUG9pbnQobywgZikgeworICAgIGYuYXBwbHkobnVsbCwgby5jb29yZGluYXRlcyk7CisgIH0KKyAgZnVuY3Rpb24gZDNfZ2VvX2JvdW5kc1BvbHlnb24obywgZikgeworICAgIGZvciAodmFyIGEgPSBvLmNvb3JkaW5hdGVzWzBdLCBpID0gMCwgbiA9IGEubGVuZ3RoOyBpIDwgbjsgaSsrKSB7CisgICAgICBmLmFwcGx5KG51bGwsIGFbaV0pOworICAgIH0KKyAgfQorICBmdW5jdGlvbiBkM19nZW9fZ3JlYXRBcmNTb3VyY2UoZCkgeworICAgIHJldHVybiBkLnNvdXJjZTsKKyAgfQorICBmdW5jdGlvbiBkM19nZW9fZ3JlYXRBcmNUYXJnZXQoZCkgeworICAgIHJld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SBjeTAgKiBzeDA7CisgICAgICBkID0gbnVsbDsKKyAgICAgIHJldHVybiBpbnRlcnBvbGF0ZTsKKyAgICB9OworICAgIGludGVycG9sYXRlLnRhcmdldCA9IGZ1bmN0aW9uKF8pIHsKKyAgICAgIHZhciBjeDEgPSBNYXRoLmNvcyh4MSA9IF9bMF0gKiBkM19nZW9fcmFkaWFucyksIHN4MSA9IE1hdGguc2luKHgxKTsKKyAgICAgIGN5MSA9IE1hdGguY29zKHkxID0gX1sxXSAqIGQzX2dlb19yYWRpYW5zKTsKKyAgICAgIHN5MSA9IE1hdGguc2luKHkxKTsKKyAgICAgIGt4MSA9IGN5MSAqIGN4MTsKKyAgICAgIGt5MSA9IGN5MSAqIHN4MTsKKyAgICAgIGQgPSBudWxsOworICAgICAgcmV0dXJuIGludGVycG9sYXRlOworICAgIH07CisgICAgcmV0dXJuIGludGVycG9sYXRlOworICB9CisgIGZ1bmN0aW9uIGQzX2dlb19ncmVhdEFyY0ludGVycG9sYXRlKGEsIGIpIHsKKyAgICB2YXIgaSA9IGQzX2dlb19ncmVhdEFyY0ludGVycG9sYXRvcigpLnNvdXJjZShhKS50YXJnZXQoYik7CisgICAgaS5kaXN0YW5jZSgpOworICAgIHJldHVybiBpOworICB9CisgIGZ1bmN0aW9uIGQzX2dlb21fY29udG91clN0YXJ0KGdyaWQpIHsKKyAgICB2YXIgeCA9IDAsIHkgPSAwOworICAgIHdoaWxlICh0cnVlKSB7CisgICAgICBpZiAoZ3JpZCh4LCB5KSkgeworICAgICAgICByZXR1cm4gWyB4LCB5IF07CisgICAgICB9CisgICAgICBpZiAoeCA9PT0gMCkgeworICAgICAgICB4ID0geSArIDE7CisgICAgICAgIHkgPSAwOworICAgICAgfSBlbHNlIHsKKyAgICAgICAgeCA9IHggLSAxOworICAgICAgICB5ID0geSArIDE7CisgICAgICB9CisgICAgfQorICB9CisgIGZ1bmN0aW9uIGQzX2dlb21faHVsbENDVyhpMSwgaTIsIGkzLCB2KSB7CisgICAgd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ICAgICAgaW5kZXg6IGksCisgICAgICAgICAgeDogdlswXSwKKyAgICAgICAgICB5OiB2WzFdCisgICAgICAgIH07CisgICAgICB9KS5zb3J0KGZ1bmN0aW9uKGEsIGIpIHsKKyAgICAgICAgcmV0dXJuIGEueSA8IGIueSA/IC0xIDogYS55ID4gYi55ID8gMSA6IGEueCA8IGIueCA/IC0xIDogYS54ID4gYi54ID8gMSA6IDA7CisgICAgICB9KSwKKyAgICAgIGJvdHRvbVNpdGU6IG51bGwKKyAgICB9OworICAgIHZhciBFZGdlTGlzdCA9IHsKKyAgICAgIGxpc3Q6IFtdLAorICAgICAgbGVmdEVuZDogbnVsbCwKKyAgICAgIHJpZ2h0RW5kOiBudWxsLAorICAgICAgaW5pdDogZnVuY3Rpb24oKSB7CisgICAgICAgIEVkZ2VMaXN0LmxlZnRFbmQgPSBFZGdlTGlzdC5jcmVhdGVIYWxmRWRnZShudWxsLCAibCIpOworICAgICAgICBFZGdlTGlzdC5yaWdodEVuZCA9IEVkZ2VMaXN0LmNyZWF0ZUhhbGZFZGdlKG51bGwsICJsIik7CisgICAgICAgIEVkZ2VMaXN0LmxlZnRFbmQuciA9IEVkZ2VMaXN0LnJpZ2h0RW5kOworICAgICAgICBFZGdlTGlzdC5yaWdodEVuZC5sID0gRWRnZUxpc3QubGVmdEVuZDsKKyAgICAgICAgRWRnZUxpc3QubGlzdC51bnNoaWZ0KEVkZ2VMaXN0LmxlZnRFbmQsIEVkZ2VMaXN0LnJpZ2h0RW5kKTsKKyAgICAgIH0sCisgICAgICBjcmVhdGVIYWxmRWRnZTogZnVuY3Rpb24oZWRnZSwgc2lkZSkgeworICAgICAgICByZXR1cm4geworICAgICAgICAgIGVkZ2U6IGVkZ2UsCisgICAgICAgICAgc2lkZTogc2lkZSwKKyAgICAgICAgICB2ZXJ0ZXg6IG51bGwsCisgICAgICAgICAgbDogbnVsbCwKKyAgICAgICAgICByOiBudWxsCisgICAgICAgIH07CisgICAgICB9LAorICAgICAgaW5zZXJ0OiBmdW5jdGlvbihsYiwgaGUpIHsKKyAgICAgICAgaGUubCA9IGxiOworICAgICAgICBoZS5yID0gbGIucjsKKyAgICAgICAgbGIuci5sID0gaGU7CisgICAgICAgIGxiLnIgPSBoZTsKKyAgICAgIH0sCisgICAgICBsZWZ0Qm91bmQ6IGZ1bmN0aW9uKHApIHsKKyAgICAgICAgdmFyIGhlID0gRWRnZUxpc3QubGVmdEVuZDsKKyAgICAgICAgZG8geworICAgICAgICAgIGhlID0gaGUucjsKKyAgICAgICAgfSB3aGlsZSAoaGUgIT0gRWRnZUxpc3QucmlnaHRFbmQgJiYgR2VvbS5yaWdodE9mKGhlLCBwKSk7CisgICAgICAgIGhlID0gaGUubDsKKyAgICAgICAgcmV0dXJuIGhlOworICAgICAgfSwKKyAgICAgIGRlbDogZnVuY3Rpb24oaGUpIHsKKyAgICAgICAgaGUubC5yID0gaGUucjsKKyAgICAgICAgaGUuci5sID0gaGUubDsKKyAgICAgICAgaGUuZWRnZSA9IG51bGw7CisgICAgICB9LAorICAgICAgcmlnaHQ6IGZ1bmN0aW9uKGhlKSB7CisgICAgICAgIHJldHVybiBoZS5yOworICAgICAgfSwKKyAgICAgIGxlZnQ6IGZ1bmN0aW9uKGhlKSB7CisgICAgICAgIHJldHVybiBoZS5sOworICAgICAgfSwKKyAgICAgIGxlZnRSZWdpb246IGZ1bmN0aW9uKGhlKSB7CisgICAgICAgIHJldHVybiBoZS5lZGdlID09IG51bGwgPyBTaXRlcy5ib3R0b21TaXRlIDogaGUuZWRnZS5yZWdpb25baGUuc2lkZV07CisgICAgICB9LAorICAgICAgcmlnaHRSZWdpb246IGZ1bmN0aW9uKGhlKSB7CisgICAgICAgIHJldHVybiBoZS5lZGdlID09IG51bGwgPyBTaXRlcy5ib3R0b21TaXRlIDogaGUuZWRnZS5yZWdpb25bZDNfdm9yb25vaV9vcHBvc2l0ZVtoZS5zaWRlXV07CisgICAgICB9CisgICAgfTsKKyAgICB2YXIgR2VvbSA9IHsKKyAgICAgIGJpc2VjdDogZnVuY3Rpb24oczEsIHMyKSB7CisgICAgICAgIHZhciBuZXdFZGdlID0geworICAgICAgICAgIHJlZ2lvbjogeworICAgICAgICAgICAgbDogczEsCisgICAgICAgICAgICByOiBzMgorICAgICAgICAgIH0sCisgICAgICAgICAgZXA6IHsKKyAgICAgICAgICAgIGw6IG51bGwsCisgICAgICAgICAgICByOiBudWxsCisgICAgICAgICAgfQorICAgICAgICB9OworICAgICAgICB2YXIgZHggPSBzMi54IC0gczEueCwgZHkgPSBzMi55IC0gczEueSwgYWR4ID0gZHggPiAwID8gZHggOiAtZHgsIGFkeSA9IGR5ID4gMCA/IGR5IDogLWR5OworICAgICAgICBuZXdFZGdlLmMgPSBzMS54ICogZHggKyBzMS55ICogZHkgKyAoZHggKiBkeCArIGR5ICogZHkpICogLjU7CisgICAgICAgIGlmIChhZHggPiBhZHkpIHsKKyAgICAgICAgICBuZXdFZGdlLmEgPSAxOworICAgICAgICAgIG5ld0VkZ2UuYiA9IGR5IC8gZHg7CisgICAgICAgICAgbmV3RWRnZS5jIC89IGR4OworICAgICAgICB9IGVsc2UgeworICAgICAgICAgIG5ld0VkZ2UuYiA9IDE7CisgICAgICAgICAgbmV3RWRnZS5hID0gZHggLyBkeTsKKyAgICAgICAgICBuZXdFZGdlLmMgLz0gZHk7CisgICAgICAgIH0KKyAgICAgICAgcmV0dXJuIG5ld0VkZ2U7CisgICAgICB9LAorICAgICAgaW50ZXJzZWN0OiBmdW5jdGlvbihlbDEsIGVsMikgeworICAgICAgICB2YXIgZTEgPSBlbDEuZWRnZSwgZTIgPSBlbDIuZWRnZTsKKyAgICAgICAgaWYgKCFlMSB8fCAhZTIgfHwgZTEucmVnaW9uLnIgPT0gZTIucmVnaW9uLnIpIHsKKyAgICAgICAgICByZXR1cm4gbnVsbDsKKyAgICAgICAgfQorICAgICAgICB2YXIgZCA9IGUxLmEgKiBlMi5iIC0gZTEuYiAqIGUyLmE7CisgICAgICAgIGlmIChNYXRoLmFicyhkKSA8IDFlLTEwKSB7CisgICAgICAgICAgcmV0dXJuIG51bGw7CisgICAgICAgIH0KKyAgICAgICAgdmFyIHhpbnQgPSAoZTEuYyAqIGUyLmIgLSBlMi5jICogZTEuYikgLyBkLCB5aW50ID0gKGUyLmMgKiBlMS5hIC0gZTEuYyAqIGUyLmEpIC8gZCwgZTFyID0gZTEucmVnaW9uLnIsIGUyciA9IGUyLnJlZ2lvbi5yLCBlbCwgZTsKKyAgICAgICAgaWYgKGUxci55IDwgZTJyLnkgfHwgZTFyLnkgPT0gZTJyLnkgJiYgZTFyLnggPCBlMnIueCkgeworICAgICAgICAgIGVsID0gZWwxOworICAgICAgICAgIGUgPSBlMTsKKyAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICBlbCA9IGVsMjsKKyAgICAgICAgICBlID0gZTI7CisgICAgICAgIH0KKyAgICAgICAgdmFyIHJpZ2h0T2ZTaXRlID0geGludCA+PSBlLnJlZ2lvbi5yLng7CisgICAgICAgIGlmIChyaWdodE9mU2l0ZSAmJiBlbC5zaWRlID09PSAibCIgfHwgIXJpZ2h0T2ZTaXRlICYmIGVsLnNpZGUgPT09ICJyIikgeworICAgICAgICAgIHJldHVybiBudWxsOworICAgICAgICB9CisgICAgICAgIHJldHVybiB7CisgICAgICAgICAgeDogeGludCwKKyAgICAgICAgICB5OiB5aW50CisgICAgICAgIH07CisgICAgICB9LAorICAgICAgcmlnaHRPZjogZnVuY3Rpb24oaGUsIHApIHsKKyAgICAgICAgdmFyIGUgPSBoZS5lZGdlLCB0b3BzaXRlID0gZS5yZWdpb24uciwgcmlnaHRPZlNpdGUgPSBwLnggPiB0b3BzaXRlLng7CisgICAgICAgIGlmIChyaWdodE9mU2l0ZSAmJiBoZS5zaWRlID09PSAibCIpIHsKKyAgICAgICAgICByZXR1cm4gMTsKKyAgICAgICAgfQorICAgICAgICBpZiAoIXJpZ2h0T2ZTaXRlICYmIGhlLnNpZGUgPT09ICJyIikgeworICAgICAgICAgIHJldHVybiAwOworICAgICAgICB9CisgICAgICAgIGlmIChlLmEgPT09IDEpIHsKKyAgICAgICAgICB2YXIgZHlwID0gcC55IC0gdG9wc2l0ZS55LCBkeHAgPSBwLnggLSB0b3BzaXRlLngsIGZhc3QgPSAwLCBhYm92ZSA9IDA7CisgICAgICAgICAgaWYgKCFyaWdodE9mU2l0ZSAmJiBlLmIgPCAwIHx8IHJpZ2h0T2ZTaXRlICYmIGUuYiA+PSAwKSB7CisgICAgICAgICAgICBhYm92ZSA9IGZhc3QgPSBkeXAgPj0gZS5iICogZHhwOworICAgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICBhYm92ZSA9IHAueCArIHAueSAqIGUuYiA+IGUuYzsKKyAgICAgICAgICAgIGlmIChlLmIgPCAwKSB7CisgICAgICAgICAgICAgIGFib3ZlID0gIWFib3ZlOworICAgICAgICAgICAgfQorICAgICAgICAgICAgaWYgKCFhYm92ZSkgeworICAgICAgICAgICAgICBmYXN0ID0gMTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICB9CisgICAgICAgICAgaWYgKCFmYXN0KSB7CisgICAgICAgICAgICB2YXIgZHhzID0gdG9wc2l0ZS54IC0gZS5yZWdpb24ubC54OworICAgICAgICAgICAgYWJvdmUgPSBlLmIgKiAoZHhwICogZHhwIC0gZHlwICogZHlwKSA8IGR4cyAqIGR5cCAqICgxICsgMiAqIGR4cCAvIGR4cyArIGUuYiAqIGUuYik7CisgICAgICAgICAgICBpZiAoZS5iIDwgMCkgeworICAgICAgICAgICAgICBhYm92ZSA9ICFhYm92ZTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICB9CisgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgdmFyIHlsID0gZS5jIC0gZS5hICogcC54LCB0MSA9IHAueSAtIHlsLCB0MiA9IHAueCAtIHRvcHNpdGUueCwgdDMgPSB5bCAtIHRvcHNpdGUueTsKKyAgICAgICAgICBhYm92ZSA9IHQxICogdDEgPiB0MiAqIHQyICsgdDMgKiB0MzsKKyAgICAgICAgfQorICAgICAgICByZXR1cm4gaGUuc2lkZSA9PT0gImwiID8gYWJvdmUgOiAhYWJvdmU7CisgICAgICB9LAorICAgICAgZW5kUG9pbnQ6IGZ1bmN0aW9uKGVkZ2UsIHNpZGUsIHNpdGUpIHsKKyAgICAgICAgZWRnZS5lcFtzaWRlXSA9IHNpdGU7CisgICAgICAgIGlmICghZWRnZS5lcFtkM192b3Jvbm9pX29wcG9zaXRlW3NpZGVdXSkgcmV0dXJuOworICAgICAgICBjYWxsYmFjayhlZGdlKTsKKyAgICAgIH0sCisgICAgICBkaXN0YW5jZTogZnVuY3Rpb24ocywgdCkgeworICAgICAgICB2YXIgZHggPSBzLnggLSB0LngsIGR5ID0gcy55IC0gdC55OworICAgICAgICByZXR1cm4gTWF0aC5zcXJ0KGR4ICogZHggKyBkeSAqIGR5KTsKKyAgICAgIH0KKyAgICB9OworICAgIHZhciBFdmVudFF1ZXVlID0geworICAgICAgbGlzdDogW10sCisgICAgICBpbnNlcnQ6IGZ1bmN0aW9uKGhlLCBzaXRlLCBvZmZzZXQpIHsKKyAgICAgICAgaGUudmVydGV4ID0gc2l0ZTsKKyAgICAgICAgaGUueXN0YXIgPSBzaXRlLnkgKyBvZmZzZXQ7CisgICAgICAgIGZvciAodmFyIGkgPSAwLCBsaXN0ID0gRXZlbnRRdWV1ZS5saXN0LCBsID0gbGlzdC5sZW5ndGg7IGkgPCBsOyBpKyspIHsKKyAgICAgICAgICB2YXIgbmV4dCA9IGxpc3RbaV07CisgICAgICAgICAgaWYgKGhlLnlzdGFyID4gbmV4dC55c3RhciB8fCBoZS55c3RhciA9PSBuZXh0LnlzdGFyICYmIHNpdGUueCA+IG5leHQudmVydGV4LngpIHsKKyAgICAgICAgICAgIGNvbnRpbnVlOworICAgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICB9CisgICAgICAgIH0KKyAgICAgICAgbGlzdC5zcGxpY2UoaSwgMCwgaGUpOworICAgICAgfSwKKyAgICAgIGRlbDogZnVuY3Rpb24oaGUpIHsKKyAgICAgICAgZm9yICh2YXIgaSA9IDAsIGxzID0gRXZlbnRRdWV1ZS5saXN0LCBsID0gbHMubGVuZ3RoOyBpIDwgbCAmJiBsc1tpXSAhPSBoZTsgKytpKSB7fQorICAgICAgICBscy5zcGxpY2UoaSwgMSk7CisgICAgICB9LAorICAgICAgZW1wdHk6IGZ1bmN0aW9uKCkgeworICAgICAgICByZXR1cm4gRXZlbnRRdWV1ZS5saXN0Lmxlbmd0aCA9PT0gMDsKKyAgICAgIH0sCisgICAgICBuZXh0RXZlbnQ6IGZ1bmN0aW9uKGhlKSB7CisgICAgICAgIGZvciAodmFyIGkgPSAwLCBscyA9IEV2ZW50UXVldWUubGlzdCwgbCA9IGxzLmxlbmd0aDsgaSA8IGw7ICsraSkgeworICAgICAgICAgIGlmIChsc1tpXSA9PSBoZSkgcmV0dXJuIGxzW2kgKyAxXTsKKyAgICAgICAgfQorICAgICAgICByZXR1cm4gbnVsbDsKKyAgICAgIH0sCisgICAgICBtaW46IGZ1bmN0aW9uKCkgeworICAgICAgICB2YXIgZWxlbSA9IEV2ZW50UXVldWUubGlzdFswXTsKKyAgICAgICAgcmV0dXJuIHsKKyAgICAgICAgICB4OiBlbGVtLnZlcnRleC54LAorICAgICAgICAgIHk6IGVsZW0ueXN0YXIKKyAgICAgICAgfTsKKyAgICAgIH0sCisgICAgICBleHRyYWN0TWluOiBmdW5jdGlvbigpIHsKKyAgICAgICAgcmV0dXJuIEV2ZW50UXVldWUubGlzdC5zaGlmdCgpOworICAgICAgfQorICAgIH07CisgICAgRWRnZUxpc3QuaW5pdCgpOworICAgIFNpdGVzLmJvdHRvbVNpdGUgPSBTaXRlcy5saXN0LnNoaWZ0KCk7CisgICAgdmFyIG5ld1NpdGUgPSBTaXRlcy5saXN0LnNoaWZ0KCksIG5ld0ludFN0YXI7CisgICAgdmFyIGxibmQsIHJibmQsIGxsYm5kLCBycmJuZCwgYmlz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KGxibmQsIGJpc2VjdG9yKTsKKyAgICAgICAgcCA9IEdlb20uaW50ZXJzZWN0KGJpc2VjdG9yLCByYm5kKTsKKyAgICAgICAgaWYgKHApIHsKKyAgICAgICAgICBFdmVudFF1ZXVlLmluc2VydChiaXNlY3RvciwgcCwgR2VvbS5kaXN0YW5jZShwLCBuZXdTaXRlKSk7CisgICAgICAgIH0KKyAgICAgICAgbmV3U2l0ZSA9IFNpdGVzLmxpc3Quc2hpZnQoKTsKKyAgICAgIH0gZWxzZSBpZiAoIUV2ZW50UXVldWUuZW1wdHkoKSkgeworICAgICAgICBsYm5kID0gRXZlbnRRdWV1ZS5leHRyYWN0TWluKCk7CisgICAgICAgIGxsYm5kID0gRWRnZUxpc3QubGVmdChsYm5kKTsKKyAgICAgICAgcmJuZCA9IEVkZ2VMaXN0LnJpZ2h0KGxibmQpOworICAgICAgICBycmJuZCA9IEVkZ2VMaXN0LnJpZ2h0KHJibmQpOworICAgICAgICBib3QgPSBFZGdlTGlzdC5sZWZ0UmVnaW9uKGxibmQpOworICAgICAgICB0b3AgPSBFZGdlTGlzdC5yaWdodFJlZ2lvbihyYm5kKTsKKyAgICAgICAgdiA9IGxibmQudmVydGV4OworICAgICAgICBHZW9tLmVuZFBvaW50KGxibmQuZWRnZSwgbGJuZC5zaWRlLCB2KTsKKyAgICAgICAgR2VvbS5lbmRQb2ludChyYm5kLmVkZ2UsIHJibmQuc2lkZSwgdik7CisgICAgICAgIEVkZ2VMaXN0LmRlbChsYm5kKTsKKyAgICAgICAgRXZlbnRRdWV1ZS5kZWwocmJuZCk7CisgICAgICAgIEVkZ2VMaXN0LmRlbChyYm5kKTsKKyAgICAgICAgcG0gPSAibCI7CisgICAgICAgIGlmIChib3QueSA+IHRvcC55KSB7CisgICAgICAgICAgdGVtcCA9IGJvdDsKKyAgICAgICAgICBib3QgPSB0b3A7CisgICAgICAgICAgdG9wID0gdGVtcDsKKyAgICAgICAgICBwbSA9ICJyIjsKKyAgICAgICAgfQorICAg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CisgICAgICB9CisgICAgICByZXR1cm4gdGltZXM7CisgICAgfQorICAgIGZ1bmN0aW9uIHJhbmdlX3V0Yyh0MCwgdDEsIGR0KSB7CisgICAgICB0cnkgeworICAgICAgICBkM190aW1lID0gZDNfdGltZV91dGM7CisgICAgICAgIHZhciB1dGMgPSBuZXcgZDNfdGltZV91dGM7CisgICAgICAgIHV0Yy5fID0gdDA7CisgICAgICAgIHJldHVybiByYW5nZSh1dGMsIHQxLCBkdCk7CisgICAgICB9IGZpbmFsbHkgeworICAgICAgICBkM190aW1lID0gRGF0ZTsKKyAgICAgIH0KKyAgICB9CisgICAgbG9jYWwuZmxvb3IgPSBsb2NhbDsKKyAgICBsb2NhbC5yb3VuZCA9IHJvdW5kOworICAgIGxvY2FsLmNlaWwgPSBjZWlsOworICAgIGxvY2FsLm9mZnNldCA9IG9mZnNldDsKKyAgICBsb2NhbC5yYW5nZSA9IHJhbmdlOworICAgIHZhciB1dGMgPSBsb2NhbC51dGMgPSBkM190aW1lX2ludGVydmFsX3V0Yyhsb2NhbCk7CisgICAgdXRjLmZsb29yID0gdXRjOworICAgIHV0Yy5yb3VuZCA9IGQzX3RpbWVfaW50ZXJ2YWxfdXRjKHJvdW5kKTsKKyAgICB1dGMuY2VpbCA9IGQzX3RpbWVfaW50ZXJ2YWxfdXRjKGNlaWwpOworICAgIHV0Yy5vZmZzZXQgPSBkM190aW1lX2ludGVydmFsX3V0YyhvZmZzZXQpOworICAgIHV0Yy5yYW5nZSA9IHJhbmdlX3V0YzsKKyAgICByZXR1cm4gbG9jYWw7CisgIH0KKyAgZnVuY3Rpb24gZDNfdGltZV9pbnRlcnZhbF91dGMobWV0aG9kKSB7CisgICAgcmV0dXJuIGZ1bmN0aW9uKGRhdGUsIGspIHsKKyAgICAgIHRyeSB7CisgICAgICAgIGQzX3RpbWUgPSBkM190aW1lX3V0YzsKKyAgICAgICAgdmFyIHV0YyA9IG5ldyBkM190aW1lX3V0YzsKKyAgICAgICAgdXRjLl8gPSBkYXRlOworICAgICAgICByZXR1cm4gbWV0aG9kKHV0YywgaykuXzsKKyAgICAgIH0gZmluYWxseSB7CisgICAgICAgIGQzX3RpbWUgPSBEYXRlOworICAgICAgfQorICAgIH07CisgIH0KKyAgZnVuY3Rpb24gZDNfdGltZV9zY2FsZShsaW5lYXIsIG1ldGhvZHMsIGZvcm1hdCkgeworICAgIGZ1bmN0aW9uIHNjYWxlKHgpIHsKKyAgICAgIHJldHVybiBsaW5lYXIoeCk7CisgICAgfQorICAgIHNjYWxlLmludmVydCA9IGZ1bmN0aW9uKHgpIHsKKyAgICAgIHJldHVybiBkM190aW1lX3NjYWxlRGF0ZShsaW5lYXIuaW52ZXJ0KHgpKTsKKyAgICB9OworICAgIHNjYWxlLmRvbWFpbiA9IGZ1bmN0aW9uKHgpIHsKKyAgICAgIGlmICghYXJndW1lbnRzLmxlbmd0aCkgcmV0dXJuIGxpbmVhci5kb21haW4oKS5tYXAoZDNfdGltZV9zY2FsZURhdGUpOworICAgICAgbGluZWFyLmRvbWFpbih4KTsKKyAgICAgIHJldHVybiBzY2FsZTsKKyAgICB9OworICAgIHNjYWxlLm5pY2UgPSBmdW5jdGlvbihtKSB7CisgICAgICByZXR1cm4gc2NhbGUuZG9tYWluKGQzX3NjYWxlX25pY2Uoc2NhbGUuZG9tYWluKCksIGZ1bmN0aW9uKCkgeworICAgICAgICByZXR1cm4gbTsKKyAgICAgIH0pKTsKKyAgICB9OworICAgIHNjYWxlLnRpY2tzID0gZnVuY3Rpb24obSwgaykgeworICAgICAgdmFyIGV4dGVudCA9IGQzX3RpbWVfc2NhbGVFeHRlbnQoc2NhbGUuZG9tYWluKCkpOworICAgICAgaWYgKHR5cGVvZiBtICE9PSAiZnVuY3Rpb24iKSB7CisgICAgICAgIHZhciBzcGFuID0gZXh0ZW50WzFdIC0gZXh0ZW50WzBdLCB0YXJnZXQgPSBzcGFuIC8gbSwgaSA9IGQzLmJpc2VjdChkM190aW1lX3NjYWxlU3RlcHMsIHRhcmd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C0gZDApIC8gKGQxIC0gZDApOworICB9CisgIGlmICghRGF0ZS5ub3cpIERhdGUubm93ID0gZnVuY3Rpb24oKSB7CisgICAgcmV0dXJuICsobmV3IERhdGUpOworICB9OworICB0cnkgeworICAgIGRvY3VtZW50LmNyZWF0ZUVsZW1lbnQoImRpdiIpLnN0eWxlLnNldFByb3BlcnR5KCJvcGFjaXR5IiwgMCwgIiIpOworICB9IGNhdGNoIChlcnJvcikgeworICAgIHZhciBkM19zdHlsZV9wcm90b3R5cGUgPSBDU1NTdHlsZURlY2xhcmF0aW9uLnByb3RvdHlwZSwgZDNfc3R5bGVfc2V0UHJvcGVydHkgPSBkM19zdHlsZV9wcm90b3R5cGUuc2V0UHJvcGVydHk7CisgICAgZDNfc3R5bGVfcHJvdG90eXBlLnNldFByb3BlcnR5ID0gZnVuY3Rpb24obmFtZSwgdmFsdWUsIHByaW9yaXR5KSB7CisgICAgICBkM19zdHlsZV9zZXRQcm9wZXJ0eS5jYWxsKHRoaXMsIG5hbWUsIHZhbHVlICsgIiIsIHByaW9yaXR5KTsKKyAgICB9OworICB9CisgIGQzID0geworICAgIHZlcnNpb246ICIyLjEwLjIiCisgIH07CisgIHZhciBkM19hcnJheSA9IGQzX2FycmF5U2xpY2U7CisgIHRyeSB7CisgICAgZDNfYXJyYXkoZG9jdW1lbnQuZG9jdW1lbnRFbGVtZW50LmNoaWxkTm9kZXMpWzBdLm5vZGVUeXBlOworICB9IGNhdGNoIChlKSB7CisgICAgZDNfYXJyYXkgPSBkM19hcnJheUNvcHk7CisgIH0KKyAgdmFyIGQzX2FycmF5U3ViY2xhc3MgPSBbXS5fX3Byb3RvX18gPyBmdW5jdGlvbihhcnJheSwgcHJvdG90eXBlKSB7CisgICAgYXJyYXkuX19wcm90b19fID0gcHJvdG90eXBlOworICB9IDogZnVuY3Rpb24oYXJyYXksIHByb3RvdHlwZSkgeworICAgIGZvciAodmFyIHByb3BlcnR5IGluIHByb3RvdHlwZSkgYXJyYXlbcHJvcGVydHldID0gcHJvdG90eXBlW3Byb3BlcnR5XTsKKyAgfTsKKyAgZDMubWFwID0gZnVuY3Rpb24ob2JqZWN0KSB7CisgICAgdmFyIG1hcCA9IG5ldyBkM19NYXA7CisgICAgZm9yICh2YXIga2V5IGluIG9iamVjdCkgbWFwLnNldChrZXksIG9iamVjdFtrZXldKTsKKyAgICByZXR1cm4gbWFwOworICB9OworICBkM19jbGFzcyhkM19NYXAsIHsKKyAgICBoYXM6IGZ1bmN0aW9uKGtleSkgeworICAgICAgcmV0dXJuIGQzX21hcF9wcmVmaXggKyBrZXkgaW4gdGhpczsKKyAgICB9LAorICAgIGdldDogZnVuY3Rpb24oa2V5KSB7CisgICAgICByZXR1cm4gdGhpc1tkM19tYXBfcHJlZml4ICsga2V5XTsKKyAgICB9LAorICAgIHNldDogZnVuY3Rpb24oa2V5LCB2YWx1ZSkgeworICAgICAgcmV0dXJuIHRoaXNbZDNfbWFwX3ByZWZpeCArIGtleV0gPSB2YWx1ZTsKKyAgICB9LAorICAgIHJlbW92ZTogZnVuY3Rpb24oa2V5KSB7CisgICAgICBrZXkgPSBkM19tYXBfcHJlZml4ICsga2V5OworICAgICAgcmV0dXJuIGtleSBpbiB0aGlzICYmIGRlbGV0ZSB0aGlzW2tleV07CisgICAgfSwKKyAgICBrZXlzOiBmdW5jdGlvbigpIHsKKyAgICAgIHZhciBrZXlzID0gW107CisgICAgICB0aGlzLmZvckVhY2goZnVuY3Rpb24oa2V5KSB7CisgICAgICAgIGtleXMucHVzaChrZXkpOworICAgICAgfSk7CisgICAgICByZXR1cm4ga2V5czsKKyAgICB9LAorICAgIHZhbHVlczogZnVuY3Rpb24oKSB7CisgICAgICB2YXIgdmFsdWVzID0gW107CisgICAgICB0aGlzLmZvckVhY2goZnVuY3Rpb24oa2V5LCB2YWx1ZSkgeworICAgICAgICB2YWx1ZXMucHVzaCh2YWx1ZSk7CisgICAgICB9KTsKKyAgICAgIHJldHVybiB2YWx1ZXM7CisgICAgfSwKKyAgICBlbnRyaWVzOiBmdW5jdGlvbigpIHsKKyAgICAgIHZhciBlbnRyaWVzID0gW107CisgICAgICB0aGlzLmZvckVhY2goZnVuY3Rpb24oa2V5LCB2YWx1ZSkgeworICAgICAgICBlbnRyaWVzLnB1c2goeworICAgICAgICAgIGtleToga2V5LAorICAgICAgICAgIHZhbHVlOiB2YWx1ZQorICAgICAgICB9KTsKKyAgICAgIH0pOworICAgICAgcmV0dXJuIGVudHJpZXM7CisgICAgfSwKKyAgICBmb3JFYWNoOiBmdW5jdGlvbihmKSB7CisgICAgICBmb3IgKHZhciBrZXkgaW4gdGhpcykgeworICAgICAgICBpZiAoa2V5LmNoYXJDb2RlQXQoMCkgPT09IGQzX21hcF9wcmVmaXhDb2RlKSB7CisgICAgICAgICAgZi5jYWxsKHRoaXMsIGtleS5zdWJzdHJpbmcoMSksIHRoaXNba2V5XSk7CisgICAgICAgIH0KKyAgICAgIH0KKyAgICB9CisgIH0pOworICB2YXIgZDNfbWFwX3ByZWZpeCA9ICJcMCIsIGQzX21hcF9wcmVmaXhDb2RlID0gZDNfbWFwX3ByZWZpeC5jaGFyQ29kZUF0KDApOworICBkMy5mdW5jdG9yID0gZDNfZnVuY3RvcjsKKyAgZDMucmViaW5kID0gZnVuY3Rpb24odGFyZ2V0LCBzb3VyY2UpIHsKKyAgICB2YXIgaSA9IDEsIG4gPSBhcmd1bWVudHMubGVuZ3RoLCBtZXRob2Q7CisgICAgd2hpbGUgKCsraSA8IG4pIHRhcmdldFttZXRob2QgPSBhcmd1bWVudHNbaV1dID0gZDNfcmViaW5kKHRhcmdldCwgc291cmNlLCBzb3VyY2VbbWV0aG9kXSk7CisgICAgcmV0dXJuIHRhcmdldDsKKyAgfTsKKyAgZDMuYXNjZW5kaW5nID0gZnVuY3Rpb24oYSwgYikgeworICAgIHJldHVybiBhIDwgYiA/IC0xIDogYSA+IGIgPyAxIDogYSA+PSBiID8gMCA6IE5hTjsKKyAgfTsKKyAgZDMuZGVzY2VuZGluZyA9IGZ1bmN0aW9uKGEsIGIpIHsKKyAgICByZXR1cm4gYiA8IGEgPyAtMSA6IGIgPiBhID8gMSA6IGIgPj0gYSA/IDAgOiBOYU47CisgIH07CisgIGQzLm1lYW4gPSBmdW5jdGlvbihhcnJheSwgZikgeworICAgIHZhciBuID0gYXJyYXkubGVuZ3RoLCBhLCBtID0gMCwgaSA9IC0xLCBqID0gMDsKKyAgICBpZiAoYXJndW1lbnRzLmxlbmd0aCA9PT0gMSkgeworICAgICAgd2hpbGUgKCsraSA8IG4pIGlmIChkM19udW1iZXIoYSA9IGFycmF5W2ldKSkgbSArPSAoYSAtIG0pIC8gKytqOworICAgIH0gZWxzZSB7CisgICAgICB3aGlsZSAoKytpIDwgbikgaWYgKGQzX251bWJlcihhID0gZi5jYWxsKGFycmF5LCBhcnJheVtpXSwgaSkpKSBtICs9IChhIC0gbSkgLyArK2o7CisgICAgfQorICAgIHJldHVybiBqID8gbSA6IHVuZGVmaW5lZDsKKyAgfTsKKyAgZDMubWVkaWFuID0gZnVuY3Rpb24oYXJyYXksIGYpIHsKKyAgICBpZiAoYXJndW1lbnRzLmxlbmd0aCA+IDEpIGFycmF5ID0gYXJyYXkubWFwKGYpOworICAgIGFycmF5ID0gYXJyYXkuZmlsdGVyKGQzX251bWJlcik7CisgICAgcmV0dXJuIGFycmF5Lmxlbmd0aCA/IGQzLnF1YW50aWxlKGFycmF5LnNvcnQoZDMuYXNjZW5kaW5nKSwgLjUpIDogdW5kZWZpbmVkOworICB9OworICBkMy5taW4gPSBmdW5jdGlvbihhcnJheSwgZikgeworICAgIHZhciBpID0gLTEsIG4gPSBhcnJheS5sZW5ndGgsIGEsIGI7CisgICAgaWYgKGFyZ3VtZW50cy5sZW5ndGggPT09IDEpIHsKKyAgICAgIHdoaWxlICgrK2kgPCBuICYmICgoYSA9IGFycmF5W2ldKSA9PSBudWxsIHx8IGEgIT0gYSkpIGEgPSB1bmRlZmluZWQ7CisgICAgICB3aGlsZSAoKytpIDwgbikgaWYgK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HMubGVuZ3RoID09PSAxKSB7CisgICAgICB3aGlsZSAoKytpIDwgbiAmJiAoKGEgPSBjID0gYXJyYXlbaV0pID09IG51bGwgfHwgYSAhPSBhKSkgYSA9IGMgPSB1bmRlZmluZWQ7CisgICAgICB3aGlsZSAoKytpIDwgbikgaWYgKChiID0gYXJyYXlbaV0pICE9IG51bGwpIHsKKyAgICAgICAgaWYgKGEgPiBiKSBhID0gYjsKKyAgICAgICAgaWYgKGMgPCBiKSBjID0gYjsKKyAgICAgIH0KKyAgICB9IGVsc2UgeworICAgICAgd2hpbGUgKCsraSA8IG4gJiYgKChhID0gYyA9IGYuY2FsbChhcnJheSwgYXJyYXlbaV0sIGkpKSA9PSBudWxsIHx8IGEgIT0gYSkpIGEgPSB1bmRlZmluZWQ7CisgICAgICB3aGlsZSAoKytpIDwgbikgaWYgKChiID0gZi5jYWxsKGFycmF5LCBhcnJheVtpXSwgaSkpICE9IG51bGwpIHsKKyAgICAgICAgaWYgKGEgPiBiKSBhID0gYjsKKyAgICAgICAgaWYgKGMgPCBiKSBjID0gYjsKKyAgICAgIH0KKyAgICB9CisgICAgcmV0dXJuIFsgYSwgYyBdOworICB9OworICBkMy5yYW5kb20gPSB7CisgICAgbm9ybWFsOiBmdW5jdGlvbijCtSwgz4MpIHsKKyAgICAgIHZhciBuID0gYXJndW1lbnRzLmxlbmd0aDsKKyAgICAgIGlmIChuIDwgMikgz4MgPSAxOworICAgICAgaWYgKG4gPCAxKSDCtSA9IDA7CisgICAgICByZXR1cm4gZnVuY3Rpb24oKSB7CisgICAgICAgIHZhciB4LCB5LCByOworICAgICAgICBkbyB7CisgICAgICAgICAgeCA9IE1hdGgucmFuZG9tKCkgKiAyIC0gMTsKKyAgICAgICAgICB5ID0gTWF0aC5yYW5kb20oKSAqIDIgLSAxOworICAgICAgICAgIHIgPSB4ICogeCArIHkgKiB5OworICAgICAgICB9IHdoaWxlICghciB8fCByID4gMSk7CisgICAgICAgIHJldHVybiDCtSArIM+DICogeCAqIE1hdGguc3FydCgtMiAqIE1hdGgubG9nKHIpIC8gcik7CisgICAgICB9OworICAgIH0sCisgICAgbG9nTm9ybWFsOiBmdW5jdGlvbijCtSwgz4MpIHsKKyAgICAgIHZhciBuID0gYXJndW1lbnRzLmxlbmd0aDsKKyAgICAgIGlmIChuIDwgMikgz4MgPSAxOworICAgICAgaWYgKG4gPCAxKSDCtSA9IDA7CisgICAgICB2YXIgcmFuZG9tID0gZDMucmFuZG9tLm5vcm1hbCgpOworICAgICAgcmV0dXJuIGZ1bmN0aW9uKCkgeworICAgICAgICByZXR1cm4gTWF0aC5leHAowrUgKyDPgyAqIHJhbmRvbSgpKTsKKyAgICAgIH07CisgICAgfSwKKyAgICBpcndpbkhhbGw6IGZ1bmN0aW9uKG0pIHsKKyAgICAgIHJldHVybiBmdW5jdGlvbigpIHsKKyAgICAgICAgZm9yICh2YXIgcyA9IDAsIGogPSAwOyBqIDwgbTsgaisrKSBzICs9IE1hdGgucmFuZG9tKCk7CisgICAgICAgIHJldHVybiBzIC8gbTsKKyAgICAgIH07CisgICAgfQorICB9OworICBkMy5zdW0gPSBmdW5jdGlvbihhcnJheSwgZikgeworICAgIHZhciBzID0gMCwgbiA9IGFycmF5Lmxlbmd0aCwgYSwgaSA9IC0xOworICAgIGlmIChhcmd1bWVudHMubGVuZ3RoID09PSAxKSB7CisgICAgICB3aGlsZSAoKytpIDwgbikgaWYgKCFpc05hTihhID0gK2FycmF5W2ldKSkgcyArPSBhOworICAgIH0gZWxzZSB7CisgICAgICB3aGlsZSAoKytpIDwgbikgaWYgKCFpc05hTihhID0gK2YuY2FsbChhcnJheSwgYXJyYXlbaV0sIGkpKSkgcyArPSBhOworICAgIH0KKyAgICByZXR1cm4gczsKKyAgfTsKKyAgZDMucXVhbnRpbGUgPSBmdW5jdGlvbih2YWx1ZXMsIHApIHsKKyAgICB2YXIgSCA9ICh2YWx1ZXMubGVuZ3RoIC0gMSkgKiBwICsgMSwgaCA9IE1hdGguZmxvb3IoSCksIHYgPSB2YWx1ZXNbaCAtIDFdLCBlID0gSCAtIGg7CisgICAgcmV0dXJuIGUgPyB2ICsgZSAqICh2YWx1ZXNbaF0gLSB2KSA6IHY7CisgIH07CisgIGQzLnRyYW5zcG9zZSA9IGZ1bmN0aW9uKG1hdHJpeCkgeworICAgIHJldHVybiBkMy56aXAuYXBwbHkoZDMsIG1hdHJpeCk7CisgIH07CisgIGQzLnppcCA9IGZ1bmN0aW9uKCkgeworICAgIGlmICghKG4gPSBhcmd1bWVudHMubGVuZ3RoKSkgcmV0dXJuIFtdOworICAgIGZvciAodmFyIGkgPSAtMSwgbSA9IGQzLm1pbihhcmd1bWVudHMsIGQzX3ppcExlbmd0aCksIHppcHMgPSBuZXcgQXJyYXkobSk7ICsraSA8IG07ICkgeworICAgICAgZm9yICh2YXIgaiA9IC0xLCBuLCB6aXAgPSB6aXBzW2ldID0gbmV3IEFycmF5KG4pOyArK2ogPCBuOyApIHsKKyAgICAgICAgemlwW2pdID0gYXJndW1lbnRzW2pdW2ldOworICAgICAgfQorICAgIH0KKyAgICByZXR1cm4gemlwczsKKyAgfTsKKyAgZDMuYmlzZWN0b3IgPSBmdW5jdGlvbihmKSB7CisgICAgcmV0dXJuIHsKKyAgICAgIGxlZnQ6IGZ1bmN0aW9uKGEsIHgsIGxvLCBoaSkgeworICAgICAgICBpZiAoYXJndW1lbnRzLmxlbmd0aCA8IDMpIGxvID0gMDsKKyAgICAgICAgaWYgKGFyZ3VtZW50cy5sZW5ndGggPCA0KSBoaSA9IGEubGVuZ3RoOworICAgICAgICB3aGlsZSAobG8gPCBoaSkgeworICAgICAgICAgIHZhciBtaWQgPSBsbyArIGhpID4+PiAxOworICAgICAgICAgIGlmIChmLmNhbGwoYSwgYVttaWRdLCBtaWQpIDwgeCkgbG8gPSBtaWQgKyAxOyBlbHNlIGhpID0gbWlkOworICAgICAgICB9CisgICAgICAgIHJldHVybiBsbzsKKyAgICAgIH0sCisgICAgICByaWdodDogZnVuY3Rpb24oYSw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ZiAoZGVwdGggPj0ga2V5cy5sZW5ndGgpIHJldHVybiBtYXA7CisgICAgICB2YXIgYSA9IFtdLCBzb3J0S2V5ID0gc29ydEtleXNbZGVwdGgrK10sIGtleTsKKyAgICAgIGZvciAoa2V5IGluIG1hcCkgeworICAgICAgICBhLnB1c2goeworICAgICAgICAgIGtleToga2V5LAorICAgICAgICAgIHZhbHVlczogZW50cmllcyhtYXBba2V5XSwgZGVwdGgpCisgICAgICAgIH0pOworICAgICAgfQorICAgICAgaWYgKHNvcnRLZXkpIGEuc29ydChmdW5jdGlvbihhLCBiKSB7CisgICAgICAgIHJldHVybiBzb3J0S2V5KGEua2V5LCBiLmtleSk7CisgICAgICB9KTsKKyAgICAgIHJldHVybiBhOworICAgIH0KKyAgICB2YXIgbmVzdCA9IHt9LCBrZXlzID0gW10sIHNvcnRLZXlzID0gW10sIHNvcnRWYWx1ZXMsIHJvbGx1cDsKKyAgICBuZXN0Lm1hcCA9IGZ1bmN0aW9uKGFycmF5KSB7CisgICAgICByZXR1cm4gbWFwKGFycmF5LCAwKTsKKyAgICB9OworICAgIG5lc3QuZW50cmllcyA9IGZ1bmN0aW9uKGFycmF5KSB7CisgICAgICByZXR1cm4gZW50cmllcyhtYXAoYXJyYXksIDApLCAwKTsKKyAgICB9OworICAgIG5lc3Qua2V5ID0gZnVuY3Rpb24oZCkgeworICAgICAga2V5cy5wdXNoKGQpOworICAgICAgcmV0dXJuIG5lc3Q7CisgICAgfTsKKyAgICBuZXN0LnNvcnRLZXlzID0gZnVuY3Rpb24ob3JkZXIpIHsKKyAgICAgIHNvcnRLZXlzW2tleXMubGVuZ3RoIC0gMV0gPSBvcmRlcjsKKyAgICAgIHJldHVybiBuZXN0OworICAgIH07CisgICAgbmVzdC5zb3J0VmFsdWVzID0gZnVuY3Rpb24ob3JkZXIpIHsKKyAgICAgIHNvcnRWYWx1ZXMgPSBvcmRlcjsKKyAgICAgIHJldHVybiBuZXN0OworICAgIH07CisgICAgbmVzdC5yb2xsdXAgPSBmdW5jdGlvbihmKSB7CisgICAgICByb2xsdXAgPSBmOworICAgICAgcmV0dXJuIG5lc3Q7CisgICAgfTsKKyAgICByZXR1cm4gbmVzdDsKKyAgfTsKKyAgZDMua2V5cyA9IGZ1bmN0aW9uKG1hcCkgeworICAgIHZhciBrZXlzID0gW107CisgICAgZm9yICh2YXIga2V5IGluIG1hcCkga2V5cy5wdXNoKGtleSk7CisgICAgcmV0dXJuIGtleXM7CisgIH07CisgIGQzLnZhbHVlcyA9IGZ1bmN0aW9uKG1hcCkgeworICAgIHZhciB2YWx1ZXMgPSBbXTsKKyAgICBmb3IgKHZhciBrZXkgaW4gbWFwKSB2YWx1ZXMucHVzaChtYXBba2V5XSk7CisgICAgcmV0dXJuIHZhbHVlczsKKyAgfTsKKyAgZDMuZW50cmllcyA9IGZ1bmN0aW9uKG1hcCkgeworICAgIHZhciBlbnRyaWVzID0gW107CisgICAgZm9yICh2YXIga2V5IGluIG1hcCkgZW50cmllcy5wdXNoKHsKKyAgICAgIGtleToga2V5LAorICAgICAgdmFsdWU6IG1hcFtrZXldCisgICAgfSk7CisgICAgcmV0dXJuIGVudHJpZXM7CisgIH07CisgIGQzLnBlcm11dGUgPSBmdW5jdGlvbihhcnJheSwgaW5kZXhlcykgeworICAgIHZhciBwZXJtdXRlcyA9IFtdLCBpID0gLTEsIG4gPSBpbmRleGVzLmxlbmd0aDsKKyAgICB3aGlsZSAoKytpIDwgbikgcGVybXV0ZXNbaV0gPSBhcnJheVtpbmRleGVzW2ldXTsKKyAgICByZXR1cm4gcGVybXV0ZXM7CisgIH07CisgIGQzLm1lcmdlID0gZnVuY3Rpb24oYXJyYXlzKSB7CisgICAgcmV0dXJuIEFycmF5LnByb3RvdHlwZS5jb25jYXQuYXBwbHkoW10sIGFycmF5cyk7CisgIH07CisgIGQzLnNwbGl0ID0gZnVuY3Rpb24oYXJyYXksIGYpIHsKKyAgICB2YXIgYXJyYXlzID0gW10sIHZhbHVlcyA9IFtdLCB2YWx1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UsIGNhbGxiYWNrKSB7CisgICAgZnVuY3Rpb24gcmVhZHkocmVxKSB7CisgICAgICBjYWxsYmFjayhyZXEgJiYgcmVxLnJlc3BvbnNlVGV4dCk7CisgICAgfQorICAgIGlmIChhcmd1bWVudHMubGVuZ3RoIDwgMykgeworICAgICAgY2FsbGJhY2sgPSBtaW1lOworICAgICAgbWltZSA9IG51bGw7CisgICAgfQorICAgIGQzLnhocih1cmwsIG1pbWUsIHJlYWR5KTsKKyAgfTsKKyAgZDMuanNvbiA9IGZ1bmN0aW9uKHVybCwgY2FsbGJhY2spIHsKKyAgICBkMy50ZXh0KHVybCwgImFwcGxpY2F0aW9uL2pzb24iLCBmdW5jdGlvbih0ZXh0KSB7CisgICAgICBjYWxsYmFjayh0ZXh0ID8gSlNPTi5wYXJzZSh0ZXh0KSA6IG51bGwpOworICAgIH0pOworICB9OworICBkMy5odG1sID0gZnVuY3Rpb24odXJsLCBjYWxsYmFjaykgeworICAgIGQzLnRleHQodXJsLCAidGV4dC9odG1sIiwgZnVuY3Rpb24odGV4dCkgeworICAgICAgaWYgKHRleHQgIT0gbnVsbCkgeworICAgICAgICB2YXIgcmFuZ2UgPSBkb2N1bWVudC5jcmVhdGVSYW5nZSgpOworICAgICAgICByYW5nZS5zZWxlY3ROb2RlKGRvY3VtZW50LmJvZHkpOworICAgICAgICB0ZXh0ID0gcmFuZ2UuY3JlYXRlQ29udGV4dHVhbEZyYWdtZW50KHRleHQpOworICAgICAgfQorICAgICAgY2FsbGJhY2sodGV4dCk7CisgICAgfSk7CisgIH07CisgIGQzLnhtbCA9IGZ1bmN0aW9uKHVybCwgbWltZSwgY2FsbGJhY2spIHsKKyAgICBmdW5jdGlvbiByZWFkeShyZXEpIHsKKyAgICAgIGNhbGxiYWNrKHJlcSAmJiByZXEucmVzcG9uc2VYTUwpOworICAgIH0KKyAgICBpZiAoYXJndW1lbnRzLmxlbmd0aCA8IDMpIHsKKyAgICAgIGNhbGxiYWNrID0gbWltZTsKKyAgICA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BlID0gImciOworICAgICAgYnJlYWs7CisgICAgIGNhc2UgIiUiOgorICAgICAgc2NhbGUgPSAxMDA7CisgICAgICBzdWZmaXggPSAiJSI7CisgICAgICB0eXBlID0gImYiOworICAgICAgYnJlYWs7CisgICAgIGNhc2UgInAiOgorICAgICAgc2NhbGUgPSAxMDA7CisgICAgICBzdWZmaXggPSAiJSI7CisgICAgICB0eXBlID0gInIiOworICAgICAgYnJlYWs7CisgICAgIGNhc2UgImQiOgorICAgICAgaW50ZWdlciA9IHRydWU7CisgICAgICBwcmVjaXNpb24gPSAwOworICAgICAgYnJlYWs7CisgICAgIGNhc2UgInMiOgorICAgICAgc2NhbGUgPSAtMTsKKyAgICAgIHR5cGUgPSAiciI7CisgICAgICBicmVhazsKKyAgICB9CisgICAgaWYgKHR5cGUgPT0gInIiICYmICFwcmVjaXNpb24pIHR5cGUgPSAiZyI7CisgICAgdHlwZSA9IGQzX2Zvcm1hdF90eXBlcy5nZXQodHlwZSkgfHwgZDNfZm9ybWF0X3R5cGVEZWZhdWx0OworICAgIHJldHVybiBmdW5jdGlvbih2YWx1ZSkgeworICAgICAgaWYgKGludGVnZXIgJiYgdmFsdWUgJSAxKSByZXR1cm4gIiI7CisgICAgICB2YXIgbmVnYXRpdmUgPSB2YWx1ZSA8IDAgJiYgKHZhbHVlID0gLXZhbHVlKSA/ICItIiA6IHNpZ247CisgICAgICBpZiAoc2NhbGUgPCAwKSB7CisgICAgICAgIHZhciBwcmVmaXggPSBkMy5mb3JtYXRQcmVmaXgodmFsdWUsIHByZWNpc2lvbik7CisgICAgICAgIHZhbHVlID0gcHJlZml4LnNjYWxlKHZhbHVlKTsKKyAgICAgICAgc3VmZml4ID0gcHJlZml4LnN5bWJvbDsKKyAgICAgIH0gZWxzZSB7CisgICAgICAgIHZhbHVlICo9IHNjYWxlOworICAgICAgfQorICAgICAgdmFsdWUgPSB0eXBlKHZhbHVlLCBwcmVjaXNpb24pOworICAgICAgaWYgKHpmaWxsKSB7CisgICAgIC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yAgICBjOiAwLAorICAgIGQ6IDEsCisgICAgZTogMCwKKyAgICBmOiAwCisgIH07CisgIGQzLmludGVycG9sYXRlID0gZnVuY3Rpb24oYSwgYikgeworICAgIHZhciBpID0gZDMuaW50ZXJwb2xhdG9ycy5sZW5ndGgsIGY7CisgICAgd2hpbGUgKC0taSA+PSAwICYmICEoZiA9IGQzLmludGVycG9sYXRvcnNbaV0oYSwgYikpKSA7CisgICAgcmV0dXJuIGY7CisgIH07CisgIGQzLmludGVycG9sYXRlTnVtYmVyID0gZnVuY3Rpb24oYSwgYikgeworICAgIGIgLT0gYTsKKyAgICByZXR1cm4gZnVuY3Rpb24odCkgeworICAgICAgcmV0dXJuIGEgKyBiICogdDsKKyAgICB9OworICB9OworICBkMy5pbnRlcnBvbGF0ZVJvdW5kID0gZnVuY3Rpb24oYSwgYikgeworICAgIGIgLT0gYTsKKyAgICByZXR1cm4gZnVuY3Rpb24odCkgeworICAgICAgcmV0dXJuIE1hdGgucm91bmQoYSArIGIgKiB0KTsKKyAgICB9OworICB9OworICBkMy5pbnRlcnBvbGF0ZVN0cmluZyA9IGZ1bmN0aW9uKGEsIGIpIHsKKyAgICB2YXIgbSwgaSwgaiwgczAgPSAwLCBzMSA9IDAsIHMgPSBbXSwgcSA9IFtdLCBuLCBvOworICAgIGQzX2ludGVycG9sYXRlX251bWJlci5sYXN0SW5kZXggPSAwOworICAgIGZvciAoaSA9IDA7IG0gPSBkM19pbnRlcnBvbGF0ZV9udW1iZXIuZXhlYyhiKTsgKytpKSB7CisgICAgICBpZiAobS5pbmRleCkgcy5wdXNoKGIuc3Vic3RyaW5nKHMwLCBzMSA9IG0uaW5kZXgpKTsKKyAgICAgIHEucHVzaCh7CisgICAgICAgIGk6IHMubGVuZ3RoLAorICAgICAgICB4OiBtWzBdCisgICAgICB9KTsKKyAgICAgIHMucHVzaChudWxsKTsKKyAgICAgIHMwID0gZDNfaW50ZXJwb2xhdGVfbnVtYmVyLmxhc3RJbmRleDsKKyAgICB9CisgICAgaWYgKHMwIDwgYi5sZW5ndGgpIHMucHVzaChiLnN1YnN0cmluZyhzMCkpOworICAgIGZvciAoaSA9IDAsIG4gPSBxLmxlbmd0aDsgKG0gPSBkM19pbnRlcnBvbGF0ZV9udW1iZXIuZXhlYyhhKSkgJiYgaSA8IG47ICsraSkgeworICAgICAgbyA9IHFbaV07CisgICAgICBpZiAoby54ID09IG1bMF0pIHsKKyAgICAgICAgaWYgKG8uaSkgeworICAgICAgICAgIGlmIChzW28uaSArIDFdID09IG51bGwpIHsKKyAgICAgICAgICAgIHNbby5pIC0gMV0gKz0gby54OworICAgICAgICAgICAgcy5zcGxpY2Uoby5pLCAxKTsKKyAgICAgICAgICAgIGZvciAoaiA9IGkgKyAxOyBqIDwgbjsgKytqKSBxW2pdLmktLTsKKyAgICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgc1tvLmkgLSAxXSArPSBvLnggKyBzW28uaSArIDFdOworICAgICAgICAgICAgcy5zcGxpY2Uoby5pLCAyKTsKKyAgICAgICAgICAgIGZvciAoaiA9IGkgKyAxOyBqIDwgbjsgKytqKSBxW2pdLmkgLT0gMjsKKyAgICAgICAgICB9CisgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgaWYgKHNbby5pICsgMV0gPT0gbnVsbCkgeworICAgICAgICAgICAgc1tvLmldID0gby54OworICAgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICBzW28uaV0gPSBvLnggKyBzW28uaSArIDFdOworICAgICAgICAgICAgcy5zcGxpY2Uoby5pICsgMSwgMSk7CisgICAgICAgICAgICBmb3IgKGogPSBpICsgMTsgaiA8IG47ICsraikgcVtqXS5pLS07CisgICAgICAgICAgfQorICAgICAgICB9CisgICAgICAgIHEuc3BsaWNlKGksIDEpOworICAgICAgICBuLS07CisgICAgICAgIGktLTsKKyAgICAgIH0gZWxzZSB7CisgICAgICAgIG8ueCA9IGQzLmludGVycG9sYXRlTnVtYmVyKHBhcnNlRmxvYXQobVswXSksIHBhcnNlRmxvYXQoby54KSk7CisgICAgICB9CisgICAgfQorICAgIHdoaWxlIChpIDwgbikgeworICAgICAgbyA9IHEucG9wKCk7CisgICAgICBpZiAoc1tvLmkgKyAxXSA9PSBudWxsKSB7CisgICAgICAgIHNbby5pXSA9IG8ueDsKKyAgICAgIH0gZWxzZSB7CisgICAgICAgIHNbby5pXSA9IG8ueCArIHNbby5pICsgMV07CisgICAgICAgIHMuc3BsaWNlKG8uaSArIDEsIDEpOworICAgICAgfQorICAgICAgbi0tOworICAgIH0KKyAgICBpZiAocy5sZW5ndGggPT09IDEpIHsKKyAgICAgIHJldHVybiBzWzBdID09IG51bGwgPyBxWzBdLnggOiBmdW5jdGlvbigpIHsKKyAgICAgICAgcmV0dXJuIGI7CisgICAgICB9OworICAgIH0KKyAgICByZXR1cm4gZnVuY3Rpb24odCkgeworICAgICAgZm9yIChpID0gMDsgaSA8IG47ICsraSkgc1sobyA9IHFbaV0pLmldID0gby54KHQpOworICAgICAgcmV0dXJuIHMuam9pbigiIik7CisgICAgfTsKKyAgfTsKKyAgZDMuaW50ZXJwb2xhdGVUcmFuc2Zvcm0gPSBmdW5jdGlvbihhLCBiKSB7CisgICAgdmFyIHMgPSBbXSwgcSA9IFtdLCBuLCBBID0gZDMudHJhbnNmb3JtKGEpLCBCID0gZDMudHJhbnNmb3JtKGIpLCB0YSA9IEEudHJhbnNsYXRlLCB0YiA9IEIudHJhbnNsYXRlLCByYSA9IEEucm90YXRlLCByYiA9IEIucm90YXRlLCB3YSA9IEEuc2tldywgd2IgPSBCLnNrZXcsIGthID0gQS5zY2FsZSwga2IgPSBCLnNjYWxlOworICAgIGlmICh0YVswXSAhPSB0YlswXSB8fCB0YVsxXSAhPSB0YlsxXSkgeworICAgICAgcy5wdXNoKCJ0cmFuc2xhdGUoIiwgbnVsbCwgIiwiLCBudWxsLCAiKSIpOworICAgICAgcS5wdXNoKHsKKyAgICAgICAgaTogMSwKKyAgICAgICAgeDogZDMuaW50ZXJwb2xhdGVOdW1iZXIodGFbMF0sIHRiWzBdKQorICAgICAgfSwgeworICAgICAgICBpOiAzLAorICAgICAgICB4OiBkMy5pbnRlcnBvbGF0ZU51bWJlcih0YVsxXSwgdGJbMV0pCisgICAgICB9KTsKKyAgICB9IGVsc2UgaWYgKHRiWzBdIHx8IHRiWzFdKSB7CisgICAgICBzLnB1c2goInRyYW5zbGF0ZSgiICsgdGIgKyAiKSIpOworICAgIH0gZWxzZSB7CisgICAgICBzLnB1c2goIiIpOworICAgIH0KKyAgICBpZiAocmEgIT0gcmIpIHsKKyAgICAgIGlmIChyYSAtIHJiID4gMTgwKSByYiArPSAzNjA7IGVsc2UgaWYgKHJiIC0gcmEgPiAxODApIHJhICs9IDM2MDsKKyAgICAgIHEucHVzaCh7CisgICAgICAgIGk6IHMucHVzaChzLnBvcCgpICsgInJvdGF0ZSgiLCBudWxsLCAiKSIpIC0gMiwKKyAgICAgICAgeDogZDMuaW50ZXJwb2xhdGVOdW1iZXIocmEsIHJiKQorICAgICAgfSk7CisgICAgfSBlbHNlIGlmIChyYikgeworICAgICAgcy5wdXNoKHMucG9wKCkgKyAicm90YXRlKCIgKyByYiArICIpIik7CisgICAgfQorICAgIGlmICh3YSAhPSB3YikgeworICAgICAgcS5wdXNoKHsKKyAgICAgICAgaTogcy5wdXNoKHMucG9wKCkgKyAic2tld1goIiwgbnVsbCwgIikiKSAtIDIsCisgICAgICAgIHg6IGQzLmludGVycG9sYXRlTnVtYmVyKHdhLCB3YikKKyAgICAgIH0pOworICAgIH0gZWxzZSBpZiAod2IpIHsKKyAgICAgIHMucHVzaChzLnBvcCgpICsgInNrZXdYKCIgKyB3YiArICIpIik7CisgICAgfQorICAgIGlmIChrYVswXSAhPSBrYlswXSB8fCBrYVsxXSAhPSBrYlsxXSkgeworICAgICAgbiA9IHMucHVzaChzLnBvcCgpICsgInNjYWxlKCIsIG51bGwsICIsIiwgbnVsbCwgIikiKTsKKyAgICAgIHEucHVzaCh7CisgICAgICAgIGk6IG4gLSA0LAorICAgICAgICB4OiBkMy5pbnRlcnBvbGF0ZU51bWJlcihrYVswXSwga2JbMF0pCisgICAgICB9LCB7CisgICAgICAgIGk6IG4gLSAyLAorICAgICAgICB4OiBkMy5pbnRlcnBvbGF0ZU51bWJlcihrYVsxXSwga2JbMV0pCisgICAgICB9KTsKKyAgICB9IGVsc2UgaWYgKGtiWzBdICE9IDEgfHwga2JbMV0gIT0gMSkgeworICAgICAgcy5wdXNoKHMucG9wKCkgKyAic2NhbGUoIiArIGtiICsgIikiKTsKKyAgICB9CisgICAgbiA9IHEubGVuZ3RoOworICAgIHJldHVybiBmdW5jdGlvbih0KSB7CisgICAgICB2YXIgaSA9IC0xLCBvOworICAgICAgd2hpbGUgKCsraSA8IG4pIHNbKG8gPSBxW2ldKS5pXSA9IG8ueCh0KTsKKyAgICAgIHJldHVybiBzLmpvaW4oIiIpOworICAgIH07CisgIH07CisgIGQzLmludGVycG9sYXRlUmdiID0gZnVuY3Rpb24oYSwgYikgeworICAgIGEgPSBkMy5yZ2IoYSk7CisgICAgYiA9IGQzLnJnYihiKTsKKyAgICB2YXIgYXIgPSBhLnIsIGFnID0gYS5nLCBhYiA9IGEuYiwgYnIgPSBiLnIgLSBhciwgYmcgPSBiLmcgLSBhZywgYmIgPSBiLmIgLSBhYjsKKyAgICByZXR1cm4gZnVuY3Rpb24odCkgeworICAgICAgcmV0dXJuICIjIiArIGQzX3JnYl9oZXgoTWF0aC5yb3VuZChhciArIGJyICogdCkpICsgZDNfcmdiX2hleChNYXRoLnJvdW5kKGFnICsgYmcgKiB0KSkgKyBkM19yZ2JfaGV4KE1hdGgucm91bmQoYWIgKyBiYiAqIHQpKTsKKyAgICB9OworICB9OworICBkMy5pbnRlcnBvbGF0ZUhzbCA9IGZ1bmN0aW9uKGEsIGIpIHsKKyAgICBhID0gZDMuaHNsKGEpOworICAgIGIgPSBkMy5oc2woYik7CisgICAgdmFyIGgwID0gYS5oLCBzMCA9IGEucywgbDAgPSBhLmwsIGgxID0gYi5oIC0gaDAsIHMxID0gYi5zIC0gczAsIGwxID0gYi5sIC0gbDA7CisgICAgaWYgKGgxID4gMTgwKSBoMSAtPSAzNjA7IGVsc2UgaWYgKGgxIDwgLTE4MCkgaDEgKz0gMzYwOworICAgIHJldHVybiBmdW5jdGlvbih0KSB7CisgICAgICByZXR1cm4gZDNfaHNsX3JnYihoMCArIGgxICogdCwgczAgKyBzMSAqIHQsIGwwICsgbDEgKiB0KSArICIiOworICAgIH07CisgIH07CisgIGQzLmludGVycG9sYXRlTGFiID0gZnVuY3Rpb24oYSwgYikgeworICAgIGEgPSBkMy5sYWIoYSk7CisgICAgYiA9IGQzLmxhYihiKTsKKyAgICB2YXIgYWwgPSBhLmwsIGFhID0gYS5hLCBhYiA9IGEuYiwgYmwgPSBiLmwgLSBhbCwgYmEgPSBiLmEgLSBhYSwgYmIgPSBiLmIgLSBhYjsKKyAgICByZXR1cm4gZnVuY3Rpb24odCkgeworICAgICAgcmV0dXJuIGQzX2xhYl9yZ2IoYWwgKyBibCAqIHQsIGFhICsgYmEgKiB0LCBhYiArIGJiICogdCkgKyAiIjsKKyAgICB9OworICB9OworICBkMy5pbnRlcnBvbGF0ZUhjbCA9IGZ1bmN0aW9uKGEsIGIpIHsKKyAgICBhID0gZDMuaGNsKGEpOworICAgIGIgPSBkMy5oY2woYik7CisgICAgdmFyIGFoID0gYS5oLCBhYyA9IGEuYywgYWwgPSBhLmwsIGJoID0gYi5oIC0gYWgsIGJjID0gYi5jIC0gYWMsIGJsID0gYi5sIC0gYWw7CisgICAgaWYgKGJoID4gMTgwKSBiaCAtPSAzNjA7IGVsc2UgaWYgKGJoIDwgLTE4MCkgYmggKz0gMzYwOworICAgIHJldHVybiBmdW5jdGlvbih0KSB7CisgICAgICByZXR1cm4gZDNfaGNsX2xhYihhaCArIGJoICogdCwgYWMgKyBiYyAqIHQsIGFsICsgYmwgKiB0KSArICIiOworICAgIH07CisgIH07CisgIGQzLmludGVycG9sYXRlQXJyYXkgPSBmdW5jdGlvbihhLCBiKSB7CisgICAgdmFyIHggPSBbXSwgYyA9IFtdLCBuYSA9IGEubGVuZ3RoLCBuYiA9IGIubGVuZ3RoLCBuMCA9IE1hdGgubWluKGEubGVuZ3RoLCBiLmxlbmd0aCksIGk7CisgICAgZm9yIChpID0gMDsgaSA8IG4wOyArK2kpIHgucHVzaChkMy5pbnRlcnBvbGF0ZShhW2ldLCBiW2ldKSk7CisgICAgZm9yICg7IGkgPCBuYTsgKytpKSBjW2ldID0gYVtpXTsKKyAgICBmb3IgKDsgaSA8IG5iOyArK2kpIGNbaV0gPSBiW2ldOworICAgIHJldHVybiBmdW5jdGlvbih0KSB7CisgICAgICBmb3IgKGkgPSAwOyBpIDwgbjA7ICsraSkgY1tpXSA9IHhbaV0odCk7CisgICAgICByZXR1cm4gYzsKKyAgICB9OworICB9OworICBkMy5pbnRlcnBvbGF0ZU9iamVjdCA9IGZ1bmN0aW9uKGEsIGIpIHsKKyAgICB2YXIgaSA9IHt9LCBjID0ge30sIGs7CisgICAgZm9yIChrIGluIGEpIHsKKyAgICAgIGlmIChrIGluIGIpIHsKKyAgICAgICAgaVtrXSA9IGQzX2ludGVycG9sYXRlQnlOYW1lKGspKGFba10sIGJba10pOworICAgICAgfSBlbHNlIHsKKyAgICAgICAgY1trXSA9IGFba107CisgICAgICB9CisgICAgfQorICAgIGZvciAoayBpbiBiKSB7CisgICAgICBpZiAoIShrIGluIGEpKSB7CisgICAgICAgIGNba10gPSBiW2tdOworICAgICAgfQorICAgIH0KKyAgICByZXR1cm4gZnVuY3Rpb24odCkgeworICAgICAgZm9yIChrIGluIGkpIGNba10gPSBpW2tdKHQpOworICAgICAgcmV0dXJuIGM7CisgICAgfTsKKyAgfTsKKyAgdmFyIGQzX2ludGVycG9sYXRlX251bWJlciA9IC9bLStdPyg/OlxkK1wuP1xkKnxcLj9cZCspKD86W2VFXVstK10/XGQrKT8vZzsKKyAgZDMuaW50ZXJwb2xhdG9ycyA9IFsgZDMuaW50ZXJwb2x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sdWUgPSBuZXcgZDNfTWFwLCBrZXlWYWx1ZXMgPSBbXSwga2V5VmFsdWUsIGogPSBncm91cERhdGEubGVuZ3RoOworICAgICAgICBmb3IgKGkgPSAtMTsgKytpIDwgbjsgKSB7CisgICAgICAgICAga2V5VmFsdWUgPSBrZXkuY2FsbChub2RlID0gZ3JvdXBbaV0sIG5vZGUuX19kYXRhX18sIGkpOworICAgICAgICAgIGlmIChub2RlQnlLZXlWYWx1ZS5oYXMoa2V5VmFsdWUpKSB7CisgICAgICAgICAgICBleGl0Tm9kZXNbaisrXSA9IG5vZGU7CisgICAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgIG5vZGVCeUtleVZhbHVlLnNldChrZXlWYWx1ZSwgbm9kZSk7CisgICAgICAgICAgfQorICAgICAgICAgIGtleVZhbHVlcy5wdXNoKGtleVZhbHVlKTsKKyAgICAgICAgfQorICAgICAgICBmb3IgKGkgPSAtMTsgKytpIDwgbTsgKSB7CisgICAgICAgICAga2V5VmFsdWUgPSBrZXkuY2FsbChncm91cERhdGEsIG5vZGVEYXRhID0gZ3JvdXBEYXRhW2ldLCBpKTsKKyAgICAgICAgICBpZiAobm9kZUJ5S2V5VmFsdWUuaGFzKGtleVZhbHVlKSkgeworICAgICAgICAgICAgdXBkYXRlTm9kZXNbaV0gPSBub2RlID0gbm9kZUJ5S2V5VmFsdWUuZ2V0KGtleVZhbHVlKTsKKyAgICAgICAgICAgIG5vZGUuX19kYXRhX18gPSBub2RlRGF0YTsKKyAgICAgICAgICAgIGVudGVyTm9kZXNbaV0gPSBleGl0Tm9kZXNbaV0gPSBudWxsOworICAgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICBlbnRlck5vZGVzW2ldID0gZDNfc2VsZWN0aW9uX2RhdGFOb2RlKG5vZGVEYXRhKTsKKyAgICAgICAgICAgIHVwZGF0ZU5vZGVzW2ldID0gZXhpdE5vZGVzW2ldID0gbnVsbDsKKyAgICAgICAgICB9CisgICAgICAgICAgbm9kZUJ5S2V5VmFsdWUucmVtb3ZlKGtleVZhbHVlKTsKKyAgICAgICAgfQorICAgICAgICBmb3IgKGkgPSAtMTsgKytpIDwgbjsgKSB7CisgICAgICAgICAgaWYgKG5vZGVCeUtleVZhbHVlLmhhcyhrZXlWYWx1ZXNbaV0pKSB7CisgICAgICAgICAgICBleGl0Tm9kZXNbaV0gPSBncm91cFtpXTsKKyAgICAgICAgICB9CisgICAgICAgIH0KKyAgICAgIH0gZWxzZSB7CisgICAgICAgIGZvciAoaSA9IC0xOyArK2kgPCBuMDsgKSB7CisgICAgICAgICAgbm9kZSA9IGdyb3VwW2ldOworICAgICAgICAgIG5vZGVEYXRhID0gZ3JvdXBEYXRhW2ldOworICAgICAgICAgIGlmIChub2RlKSB7CisgICAgICAgICAgICBub2RlLl9fZGF0YV9fID0gbm9kZURhdGE7CisgICAgICAgICAgICB1cGRhdGVOb2Rlc1tpXSA9IG5vZGU7CisgICAgICAgICAgICBlbnRlck5vZGVzW2ldID0gZXhpdE5vZGVzW2ldID0gbnVsbDsKKyAgICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgZW50ZXJOb2Rlc1tpXSA9IGQzX3NlbGVjdGlvbl9kYXRhTm9kZShub2RlRGF0YSk7CisgICAgICAgICAgICB1cGRhdGVOb2Rlc1tpXSA9IGV4aXROb2Rlc1tpXSA9IG51bGw7CisgICAgICAgICAgfQorICAgICAgICB9CisgICAgICAgIGZvciAoOyBpIDwgbTsgKytpKSB7CisgICAgICAgICAgZW50ZXJOb2Rlc1tpXSA9IGQzX3NlbGVjdGlvbl9kYXRhTm9kZShncm91cERhdGFbaV0pOworICAgICAgICAgIHVwZGF0ZU5vZGVzW2ldID0gZXhpdE5vZGVzW2ldID0gbnVsbDsKKyAgICAgICAgfQorICAgICAgICBmb3IgKDsgaSA8IG4xOyArK2kpIHsKKyAgICAgICAgICBleGl0Tm9kZXNbaV0gPSBncm91cFtpXTsKKyAgICAgICAgICBlbnRlck5vZGVzW2ldID0gdXBkYXRlTm9kZXNbaV0gPSBudWxsOworICAgICAgICB9CisgICAgICB9CisgICAgICBlbnRlck5vZGVzLnVwZGF0ZSA9IHVwZGF0ZU5vZGVzOworICAgICAgZW50ZXJOb2Rlcy5wYXJlbnROb2RlID0gdXBkYXRlTm9kZXMucGFyZW50Tm9kZSA9IGV4aXROb2Rlcy5wYXJlbnROb2RlID0gZ3JvdXAucGFyZW50Tm9kZTsKKyAgICAgIGVudGVyLnB1c2goZW50ZXJOb2Rlcyk7CisgICAgICB1cGRhdGUucHVzaCh1cGRhdGVOb2Rlcyk7CisgICAgICBleGl0LnB1c2goZXhpdE5vZGVzKTsKKyAgICB9CisgICAgdmFyIGkgPSAtMSwgbiA9IHRoaXMubGVuZ3RoLCBncm91cCwgbm9kZTsKKyAgICBpZiAoIWFyZ3VtZW50cy5sZW5ndGgpIHsKKyAgICAgIHZhbHVlID0gbmV3IEFycmF5KG4gPSAoZ3JvdXAgPSB0aGlzWzBdKS5sZW5ndGgpOworICAgICAgd2hpbGUgKCsraSA8IG4pIHsKKyAgICAgICAgaWYgKG5vZGUgPSBncm91cFtpXSkgeworICAgICAgICAgIHZhbHVlW2ldID0gbm9kZS5fX2RhdGFfXzsKKyAgICAgICAgfQorICAgICAgfQorICAgICAgcmV0dXJuIHZhbHVlOworICAgIH0KKyAgICB2YXIgZW50ZXIgPSBkM19zZWxlY3Rpb25fZW50ZXIoW10pLCB1cGRhdGUgPSBkM19zZWxlY3Rpb24oW10pLCBleGl0ID0gZDNfc2VsZWN0aW9uKFtdKTsKKyAgICBpZiAodHlwZW9mIHZhbHVlID09PSAiZnVuY3Rpb24iKSB7CisgICAgICB3aGlsZSAoKytpIDwgbikgeworICAgICAgICBiaW5kKGdyb3VwID0gdGhpc1tpXSwgdmFsdWUuY2FsbChncm91cCwgZ3JvdXAucGFyZW50Tm9kZS5fX2RhdGFfXywgaSkpOworICAgICAgfQorICAgIH0gZWxzZSB7CisgICAgICB3aGlsZSAoKytpIDwgbikgeworICAgICAgIC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SkgeworICAgICAgICAgIGlmICgiX19kYXRhX18iIGluIG5vZGUubm9kZSkgc3Vibm9kZS5fX2RhdGFfXyA9IG5vZGUubm9kZS5fX2RhdGFfXzsKKyAgICAgICAgICBzdWJncm91cC5wdXNoKHsKKyAgICAgICAgICAgIG5vZGU6IHN1Ym5vZGUsCisgICAgICAgICAgICBkZWxheTogbm9kZS5kZWxheSwKKyAgICAgICAgICAgIGR1cmF0aW9uOiBub2RlLmR1cmF0aW9uCisgICAgICAgICAgfSk7CisgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgc3ViZ3JvdXAucHVzaChudWxsKTsKKyAgICAgICAgfQorICAgICAgfQorICAgIH0KKyAgICByZXR1cm4gZDNfdHJhbnNpdGlvbihzdWJncm91cHMsIHRoaXMuaWQsIHRoaXMudGltZSkuZWFzZSh0aGlzLmVhc2UoKSk7CisgIH07CisgIGQzX3RyYW5zaXRpb25Qcm90b3R5cGUuc2VsZWN0QWxsID0gZnVuY3Rpb24oc2VsZWN0b3IpIHsKKyAgICB2YXIgc3ViZ3JvdXBzID0gW10sIHN1Ymdyb3VwLCBzdWJub2Rlcywgbm9kZTsKKyAgICBpZiAodHlwZW9mIHNlbGVjdG9yICE9PSAiZnVuY3Rpb24iKSBzZWxlY3RvciA9IGQzX3NlbGVjdGlvbl9zZWxlY3RvckFsbChzZWxlY3Rvcik7CisgICAgZm9yICh2YXIgaiA9IC0xLCBtID0gdGhpcy5sZW5ndGg7ICsraiA8IG07ICkgeworICAgICAgZm9yICh2YXIgZ3JvdXAgPSB0aGlzW2pdLCBpID0gLTEsIG4gPSBncm91cC5sZW5ndGg7ICsraSA8IG47ICkgeworICAgICAgICBpZiAobm9kZSA9IGdyb3VwW2ldKSB7CisgICAgICAgICAgc3Vibm9kZXMgPSBzZWxlY3Rvci5jYWxsKG5vZGUubm9kZSwgbm9kZS5ub2RlLl9fZGF0YV9fLCBpKTsKKyAgICAgICAgICBzdWJncm91cHMucHVzaChzdWJncm91cCA9IFtdKTsKKyAgICAgICAgICBmb3IgKHZhciBrID0gLTEsIG8gPSBzdWJub2Rlcy5sZW5ndGg7ICsrayA8IG87ICkgeworICAgICAgICAgICAgc3ViZ3JvdXAucHVzaCh7CisgICAgICAgICAgICAgIG5vZGU6IHN1Ym5vZGVzW2tdLAorICAgICAgICAgICAgICBkZWxheTogbm9kZS5kZWxheSwKKyAgICAgICAgICAgICAgZHVyYXRpb246IG5vZGUuZHVyYXRpb24KKyAgICAgICAgICAgIH0pOworICAgICAgICAgIH0KKyAgICAgICAgfQorICAgICAgfQorICAgIH0KKyAgICByZXR1cm4gZDNfdHJhbnNpdGlvbihzdWJncm91cHMsIHRoaXMuaWQsIHRoaXMudGltZSkuZWFzZSh0aGlzLmVhc2UoKSk7CisgIH07CisgIGQzX3RyYW5zaXRpb25Qcm90b3R5cGUuZmlsdGVyID0gZnVuY3Rpb24oZmlsdGVyKSB7CisgICAgdmFyIHN1Ymdyb3VwcyA9IFtdLCBzdWJncm91cCwgZ3JvdXAsIG5vZGU7CisgICAgaWYgKHR5cGVvZiBmaWx0ZXIgIT09ICJmdW5jdGlvbiIpIGZpbHRlciA9IGQzX3NlbGVjdGlvbl9maWx0ZXIoZmlsdGVyKTsKKyAgICBmb3IgKHZhciBqID0gMCwgbSA9IHRoaXMubGVuZ3RoOyBqIDwgbTsgaisrKSB7CisgICAgICBzdWJncm91cHMucHVzaChzdWJncm91cCA9IFtdKTsKKyAgICAgIGZvciAodmFyIGdyb3VwID0gdGhpc1tqXSwgaSA9IDAsIG4gPSBncm91cC5sZW5ndGg7IGkgPCBuOyBpKyspIHsKKyAgICAgICAgaWYgKChub2RlID0gZ3JvdXBbaV0pICYmIGZpbHRlci5jYWxsKG5vZGUubm9kZSwgbm9kZS5ub2RlLl9fZGF0YV9fLCBpKSkgeworICAgICAgICAgIHN1Ymdyb3VwLnB1c2gobm9kZSk7CisgICAgICAgIH0KKyAgICAgIH0KKyAgICB9CisgICAgcmV0dXJuIGQzX3RyYW5zaXRpb24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vbGF0ZShhLCB2KTsKKyAgICB9CisgICAgZnVuY3Rpb24gdHdlZW5TdHJpbmcoZCwgaSwgYSkgeworICAgICAgcmV0dXJuIGEgIT0gYiAmJiBpbnRlcnBvbGF0ZShhLCBiKTsKKyAgICB9CisgICAgcmV0dXJuIHR5cGVvZiBiID09PSAiZnVuY3Rpb24iID8gdHdlZW5GdW5jdGlvbiA6IGIgPT0gbnVsbCA/IGQzX3R3ZWVuTnVsbCA6IChiICs9ICIiLCB0d2VlblN0cmluZyk7CisgIH07CisgIHZhciBkM190d2VlblJlbW92ZSA9IHt9OworICB2YXIgZDNfdGltZXJfcXVldWUgPSBudWxsLCBkM190aW1lcl9pbnRlcnZhbCwgZDNfdGltZXJfdGltZW91dDsKKyAgZDMudGltZXIgPSBmdW5jdGlvbihjYWxsYmFjaywgZGVsYXksIHRoZW4pIHsKKyAgICB2YXIgZm91bmQgPSBmYWxzZSwgdDAsIHQxID0gZDNfdGltZXJfcXVldWU7CisgICAgaWYgKGFyZ3VtZW50cy5sZW5ndGggPCAzKSB7CisgICAgICBpZiAoYXJndW1lbnRzLmxlbmd0aCA8IDIpIGRlbGF5ID0gMDsgZWxzZSBpZiAoIWlzRmluaXRlKGRlbGF5KSkgcmV0dXJuOworICAgICAgdGhlbiA9IERhdGUubm93KCk7CisgICAgfQorICAgIHdoaWxlICh0MSkgeworICAgICAgaWYgKHQxLmNhbGxiYWNrID09PSBjYWxsYmFjaykgeworICAgICAgICB0MS50aGVuID0gdGhlbjsKKyAgICAgICAgdDEuZGVsYXkgPSBkZWxheTsKKyAgICAgICAgZm91bmQgPSB0cnVlOworICAgICAgICBicmVhazsKKyAgICAgIH0KKyAgICAgIHQwID0gdDE7CisgICAgICB0MSA9IHQxLm5leHQ7CisgICAgfQorICAgIGlmICghZm91bmQpIGQzX3RpbWVyX3F1ZXVlID0geworICAgICAgY2FsbGJhY2s6IGNhbGxiYWNrLAorICAgICAgdGhlbjogdGhlbiwKKyAgICAgIGRlbGF5OiBkZ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AgMSwxIDAsIiArIC1yMSArICJBIiArIHIxICsgIiwiICsgcjEgKyAiIDAgMSwxIDAsIiArIHIxICsgIloiIDogcjAgPyAiTSIgKyByMSAqIGMwICsgIiwiICsgcjEgKiBzMCArICJBIiArIHIxICsgIiwiICsgcjEgKyAiIDAgIiArIGRmICsgIiwxICIgKyByMSAqIGMxICsgIiwiICsgcjEgKiBzMSArICJMIiArIHIwICogYzEgKyAiLCIgKyByMCAqIHMxICsgIkEiICsgcjAgKyAiLCIgKyByMCArICIgMCAiICsgZGYgKyAiLDAgIiArIHIwICogYzAgKyAiLCIgKyByMCAqIHMwICsgIloiIDogIk0iICsgcjEgKiBjMCArICIsIiArIHIxICogczAgKyAiQSIgKyByMSArICIsIiArIHIxICsgIiAwICIgKyBkZiArICIsMSAiICsgcjEgKiBjMSArICIsIiArIHIxICogczEgKyAiTDAsMCIgKyAiWiI7CisgICAgfQorICAgIHZhciBpbm5lclJhZGl1cyA9IGQzX3N2Z19hcmNJbm5lclJhZGl1cywgb3V0ZXJSYWRpdXMgPSBkM19zdmdfYXJjT3V0ZXJSYWRpdXMsIHN0YXJ0QW5nbGUgPSBkM19zdmdfYXJjU3RhcnRBbmdsZSwgZW5kQW5nbGUgPSBkM19zdmdfYXJjRW5kQW5nbGU7CisgICAgYXJjLmlubmVyUmFkaXVzID0gZnVuY3Rpb24odikgeworICAgICAgaWYgKCFhcmd1bWVudHMubGVuZ3RoKSByZXR1cm4gaW5uZXJSYWRpdXM7CisgICAgICBpbm5lclJhZGl1cyA9IGQzX2Z1bmN0b3Iodik7CisgICAgICByZXR1cm4gYXJjOworICAgIH07CisgICAgYXJjLm91dGVyUmFkaXVzID0gZnVuY3Rpb24odikgeworICAgICAgaWYgKCFhcmd1bWVudHMubGVuZ3RoKSByZXR1cm4gb3V0ZXJSYWRpdXM7CisgICAgICBvdXRlclJhZGl1cyA9IGQzX2Z1bmN0b3Iodik7CisgICAgICByZXR1cm4gYXJjOworICAgIH07CisgICAgYXJjLnN0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IHMuYTEgLSBzLmEwKSArIChlcXVhbHMocywgdCkgPyBjdXJ2ZShzLnIsIHMucDEsIHMuciwgcy5wMCkgOiBjdXJ2ZShzLnIsIHMucDEsIHQuciwgdC5wMCkgKyBhcmModC5yLCB0LnAxLCB0LmExIC0gdC5hMCkgKyBjdXJ2ZSh0LnIsIHQucDEsIHMuciwgcy5wMCkpICsgIloiOworICAgIH0KKyAgICBmdW5jdGlvbiBzdWJncm91cChzZWxmLCBmLCBkLCBpKSB7CisgICAgICB2YXIgc3ViZ3JvdXAgPSBmLmNhbGwoc2VsZiwgZCwgaSksIHIgPSByYWRpdXMuY2FsbChzZWxmLCBzdWJncm91cCwgaSksIGEwID0gc3RhcnRBbmdsZS5jYWxsKHNlbGYsIHN1Ymdyb3VwLCBpKSArIGQzX3N2Z19hcmNPZmZzZXQsIGExID0gZW5kQW5nbGUuY2FsbChzZWxmLCBzdWJncm91cCwgaSkgKyBkM19zdmdfYXJjT2Zmc2V0OworICAgICAgcmV0dXJuIHsKKyAgICAgICAgcjogciwKKyAgICAgICAgYTA6IGEwLAorICAgICAgICBhMTogYTEsCisgICAgICAgIHAwOiBbIHIgKiBNYXRoLmNvcyhhMCksIHIgKiBNYXRoLnNpbihhMCkgXSwKKyAgICAgICAgcDE6IFsgciAqIE1hdGguY29zKGExKSwgciAqIE1hdGguc2luKGExKSBdCisgICAgICB9OworICAgIH0KKyAgICBmdW5jdGlvbiBlcXVhbHMoYSwgYikgeworICAgICAgcmV0dXJuIGEuYTAgPT0gYi5hMCAmJiBhLmExID09IGIuYTE7CisgICAgfQorICAgIGZ1bmN0aW9uIGFyYyhyLCBwLCBhKSB7CisgICAgICByZXR1cm4gIkEiICsgciArICIsIiArIHIgKyAiIDAgIiArICsoYSA+IE1hdGguUEkpICsgIiwxICIgKyBwOworICAgIH0KKyAgICBmdW5jdGlvbiBjdXJ2ZShyMCwgcDAsIHIxLCBwMSkgeworICAgICAgcmV0dXJuICJRIDAsMCAiICsgcDE7CisgICAgf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nbGUgPSBkM19mdW5jdG9yKHYpOworICAgICAgcmV0dXJuIGNob3JkOworICAgIH07CisgICAgcmV0dXJuIGNob3JkOworICB9OworICBkMy5zdmcuZGlhZ29uYWwgPSBmdW5jdGlvbigpIHsKKyAgICBmdW5jdGlvbiBkaWFnb25hbChkLCBpKSB7CisgICAgICB2YXIgcDAgPSBzb3VyY2UuY2FsbCh0aGlzLCBkLCBpKSwgcDMgPSB0YXJnZXQuY2FsbCh0aGlzLCBkLCBpKSwgbSA9IChwMC55ICsgcDMueSkgLyAyLCBwID0gWyBwMCwgeworICAgICAgICB4OiBwMC54LAorICAgICAgICB5OiBtCisgICAgICB9LCB7CisgICAgICAgIHg6IHAzLngsCisgICAgICAgIHk6IG0KKyAgICAgIH0sIHAzIF07CisgICAgICBwID0gcC5tYXAocHJvamVjdGlvbik7CisgICAgICByZXR1cm4gIk0iICsgcFswXSArICJDIiArIHBbMV0gKyAiICIgKyBwWzJdICsgIiAiICsgcFszXTsKKyAgICB9CisgICAgdmFyIHNvdXJjZSA9IGQzX3N2Z19jaG9yZFNvdXJjZSwgdGFyZ2V0ID0gZDNfc3ZnX2Nob3JkVGFyZ2V0LCBwcm9qZWN0aW9uID0gZDNfc3ZnX2RpYWdvbmFsUHJvamVjdGlvbjsKKyAgICBkaWFnb25hbC5zb3VyY2UgPSBmdW5jdGlvbih4KSB7CisgICAgICBpZiAoIWFyZ3VtZW50cy5sZW5ndGgpIHJldHVybiBzb3VyY2U7CisgICAgICBzb3VyY2UgPSBkM19mdW5jdG9yKHgpOworICAgICAgcmV0dXJuIGRpYWdvbmFsOworICAgIH07CisgICAgZGlhZ29uYWwudGFyZ2V0ID0gZnVuY3Rpb24oeCkgeworICAgICAgaWYgKCFhcmd1bWVudHMubGVuZ3RoKSByZXR1cm4gdGFyZ2V0OworICAgICAgdGFyZ2V0ID0gZDNfZnVuY3Rvcih4KTsKKyAgICAgIHJldHVybiBkaWFnb25hbDsKKyAgICB9OworICAgIGRpYWdvbmFsLn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worICAgICAgaWYgKCFhcmd1bWVudHMubGVuZ3RoKSByZXR1cm4gdHlwZTsKKyAgICAgIHR5cGUgPSBkM19mdW5jdG9yKHgpOworICAgICAgcmV0dXJuIHN5bWJvbDsKKyAgICB9OworICAgIHN5bWJvbC5zaXplID0gZnVuY3Rpb24oeCkgeworICAgICAgaWYgKCFhcmd1bWVudHMubGVuZ3RoKSByZXR1cm4gc2l6ZTsKKyAgICAgIHNpemUgPSBkM19mdW5jdG9yKHgpOworICAgICAgcmV0dXJuIHN5bWJvbDsKKyAgICB9OworICAgIHJldHVybiBzeW1ib2w7CisgIH07CisgIHZhciBkM19zdmdfc3ltYm9scyA9IGQzLm1hcCh7CisgICAgY2lyY2xlOiBkM19zdmdfc3ltYm9sQ2lyY2xlLAorICAgIGNyb3NzOiBmdW5jdGlvbihzaXplKSB7CisgICAgICB2YXIgciA9IE1hdGguc3FydChzaXplIC8gNSkgLyAyOworICAgICAgcmV0dXJuICJNIiArIC0zICogciArICIsIiArIC1yICsgIkgiICsgLXIgKyAiViIgKyAtMyAqIHIgKyAiSCIgKyByICsgIlYiICsgLXIgKyAiSCIgKyAzICogciArICJWIiArIHIgKyAiSCIgKyByICsgIlYiICsgMyAqIHIgKyAiSCIgKyAtciArICJWIiArIHIgKyAiSCIgKyAtMyAqIHIgKyAiWiI7CisgICAgfSwKKyAgICBkaWFtb25kOiBmdW5jdGlvbihzaXplKSB7CisgICAgICB2YXIgcnkgPSBNYXRoLnNxcnQoc2l6ZSAvICgyICogZDNfc3ZnX3N5bWJvbFRhbjMwKSksIHJ4ID0gcnkgKiBkM19zdmdfc3ltYm9sVGFuMzA7CisgICAgICByZXR1cm4gIk0wLCIgKyAtcnkgKyAiTCIgKyByeCArICIsMCIgKyAiIDAsIiArIHJ5ICsgIiAiICsgLXJ4ICsgIiwwIiArICJaIjsKKyAgICB9LAorICAgIHNxdWFyZTogZnVuY3Rpb24oc2l6ZSkgeworICAgICAgdmFyIHIgPSBNYXRoLnNxcnQoc2l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IoIngyIiwgMCkuYXR0cigieTIiLCB0aWNrTWlub3JTaXplKTsKKyAgICAgICAgICAgIGxpbmVFbnRlci5hdHRyKCJ5MiIsIHRpY2tNYWpvclNpemUpOworICAgICAgICAgICAgdGV4dEVudGVyLmF0dHIoInkiLCBNYXRoLm1heCh0aWNrTWFqb3JTaXplLCAwKSArIHRpY2tQYWRkaW5nKTsKKyAgICAgICAgICAgIGxpbmVVcGRhdGUuYXR0cigieDIiLCAwKS5hdHRyKCJ5MiIsIHRpY2tNYWpvclNpemUpOworICAgICAgICAgICAgdGV4dFVwZGF0ZS5hdHRyKCJ4IiwgMCkuYXR0cigieSIsIE1hdGgubWF4KHRpY2tNYWpvclNpemUsIDApICsgdGlja1BhZGRpbmcpOworICAgICAgICAgICAgdGV4dC5hdHRyKCJkeSIsICIuNzFlbSIpLmF0dHIoInRleHQtYW5jaG9yIiwgIm1pZGRsZSIpOworICAgICAgICAgICAgcGF0aFVwZGF0ZS5hdHRyKCJkIiwgIk0iICsgcmFuZ2VbMF0gKyAiLCIgKyB0aWNrRW5kU2l6ZSArICJWMEgiICsgcmFuZ2VbMV0gKyAiViIgKyB0aWNrRW5kU2l6ZSk7CisgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICB9CisgICAgICAgICBjYXNlICJ0b3AiOgorICAgICAgICAgIHsKKyAgICAgICAgICAgIHRpY2tUcmFuc2Zvcm0gPSBkM19zdmdfYXhpc1g7CisgICAgICAgICAgICBzdWJ0aWNrRW50ZXIuYXR0cigieTIiLCAtdGlja01pbm9yU2l6ZSk7CisgICAgICAgICAgICBzdWJ0aWNrVXBkYXRlLmF0dHIoIngyIiwgMCkuYXR0cigieTIiLCAtdGlja01pbm9yU2l6ZSk7CisgICAgICAgICAgICBsaW5lRW50ZXIuYXR0cigieTIiLCAtdGlja01ham9yU2l6ZSk7CisgICAgICAgICAgICB0ZXh0RW50ZXIuYXR0cigieSIsIC0oTWF0aC5tYXgodGlja01ham9yU2l6ZSwgMCkgKyB0aWNrUGFkZGluZykpOworICAgICAgICAgICAgbGluZVVwZGF0ZS5hdHRyKCJ4MiIsIDApLmF0dHIoInkyIiwgLXRpY2tNYWpvclNpemUpOworICAgICAgICAgICAgdGV4dFVwZGF0ZS5hdHRyKCJ4IiwgMCkuYXR0cigieSIsIC0oTWF0aC5tYXgodGlja01ham9yU2l6ZSwgMCkgKyB0aWNrUGFkZGluZykpOworICAgICAgICAgICAgdGV4dC5hdHRyKCJkeSIsICIwZW0iKS5hdHRyKCJ0ZXh0LWFuY2hvciIsICJtaWRkbGUiKTsKKyAgICAgICAgICAgIHBhdGhVcGRhdGUuYXR0cigiZCIsICJNIiArIHJhbmdlWzBdICsgIiwiICsgLXRpY2tFbmRTaXplICsgIlYwSCIgKyByYW5nZVsxXSArICJWIiArIC10aWNrRW5kU2l6ZSk7CisgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICB9CisgICAgICAgICBjYXNlICJsZWZ0IjoKKyAgICAgICAgICB7CisgICAgICAgICAgICB0aWNrVHJhbnNmb3JtID0gZDNfc3ZnX2F4aXNZOworICAgICAgICAgICAgc3VidGlja0VudGVyLmF0dHIoIngyIiwgLXRpY2tNaW5vclNpemUpOworICAgICAgICAgICAgc3VidGlja1VwZGF0ZS5hdHRyKCJ4MiIsIC10aWNrTWlub3JTaXplKS5hdHRyKCJ5MiIsIDApOworICAgICAgICAgICAgbGluZUVudGVyLmF0dHIoIngyIiwgLXRpY2tNYWpvclNpemUpOworICAgICAgICAgICAgdGV4dEVudGVyLmF0dHIoIngiLCAtKE1hdGgubWF4KHRpY2tNYWpvclNpemUsIDApICsgdGlja1BhZGRpbmcpKTsKKyAgICAgICAgICAgIGxpbmVVcGRhdGUuYXR0cigieDIiLCAtdGlja01ham9yU2l6ZSkuYXR0cigieTIiLCAwKTsKKyAgICAgICAgICAgIHRleHRVcGRhdGUuYXR0cigieCIsIC0oTWF0aC5tYXgodGlja01ham9yU2l6ZSwgMCkgKyB0aWNrUGFkZGluZykpLmF0dHIoInkiLCAwKTsKKyAgICAgICAgICAgIHRleHQuYXR0cigiZHkiLCAiLjMyZW0iKS5hdHRyKCJ0ZXh0LWFuY2hvciIsICJlbmQiKTsKKyAgICAgICAgICAgIHBhdGhVcGRhdGUuYXR0cigiZCIsICJNIiArIC10aWNrRW5kU2l6ZSArICIsIiArIHJhbmdlWzBdICsgIkgwViIgKyByYW5nZVsxXSArICJIIiArIC10aWNrRW5kU2l6ZSk7CisgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICB9CisgICAgICAgICBjYXNlICJyaWdodCI6CisgICAgICAgICAgeworICAgICAgICAgICAgdGlja1RyYW5zZm9ybSA9IGQzX3N2Z19heGlzWTsKKyAgICAgICAgICAgIHN1YnRpY2tFbnRlci5hdHRyKCJ4MiIsIHRpY2tNaW5vclNpemUpOworICAgICAgICAgICAgc3VidGlja1VwZGF0ZS5hdHRyKCJ4MiIsIHRpY2tNaW5vclNpemUpLmF0dHIoInkyIiwgMCk7CisgICAgICAgICAgICBsaW5lRW50ZXIuYXR0cigieDIiLCB0aWNrTWFqb3JTaXplKTsKKyAgICAgICAgICAgIHRleHRFbnRlci5hdHRyKCJ4IiwgTWF0aC5tYXgodGlja01ham9yU2l6ZSwgMCkgKyB0aWNrUGFkZGluZyk7CisgICAgICAgICAgICBsaW5lVXBkYXRlLmF0dHIoIngyIiwgdGlja01ham9yU2l6ZSkuYXR0cigieTIiLCAwKTsKKyAgICAgICAgICAgIHRleHRVcGRhdGUuYXR0cigieCIsIE1hdGgubWF4KHRpY2tNYWpvclNpemUsIDApICsgdGlja1BhZGRpbmcpLmF0dHIoInkiLCAwKTsKKyAgICAgICAgICAgIHRleHQuYXR0cigiZHkiLCAiLjMyZW0iKS5hdHRyKCJ0ZXh0LWFuY2hvciIsICJzdGFydCIpOworICAgICAgICAgICAgcGF0aFVwZGF0ZS5hdHRyKCJkIiwgIk0iICsgdGlja0VuZFNpemUgKyAiLCIgKyByYW5nZVswXSArICJIMFYiICsgcmFuZ2VbMV0gK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XywgdGlja1N1YmRpdmlkZSA9IDA7CisgICAgYXhpcy5zY2FsZSA9IGZ1bmN0aW9uKHgpIHsKKyAgICAgIGlmICghYXJndW1lbnRzLmxlbmd0aCkgcmV0dXJuIHNjYWxlOworICAgICAgc2NhbGUgPSB4OworICAgICAgcmV0dXJuIGF4aXM7CisgICAgfTsKKyAgICBheGlzLm9yaWVudCA9IGZ1bmN0aW9uKHgpIHsKKyAgICAgIGlmICghYXJndW1lbnRzLmxlbmd0aCkgcmV0dXJuIG9yaWVudDsKKyAgICAgIG9yaWVudCA9IHg7CisgICAgICByZXR1cm4gYXhpczsKKyAgICB9OworICAgIGF4aXMudGlja3MgPSBmdW5jdGlvbigpIHsKKyAgICAgIGlmICghYXJndW1lbnRzLmxlbmd0aCkgcmV0dXJuIHRpY2tBcmd1bWVudHNfOworICAgICAgdGlja0FyZ3VtZW50c18gPSBhcmd1bWVudHM7CisgICAgICByZXR1cm4gYXhpczsKKyAgICB9OworICAgIGF4aXMudGlja1ZhbHVlcyA9IGZ1bmN0aW9uKHgpIHsKKyAgICAgIGlmICghYXJndW1lbnRzLmxlbmd0aCkgcmV0dXJuIHRpY2tWYWx1ZXM7CisgICAgICB0aWNrVmFsdWVzID0geDsKKyAgICAgIHJldHVybiBheGlzOworICAgIH07CisgICAgYXhpcy50aWNrRm9ybWF0ID0gZnVuY3Rpb24oeCkgeworICAgICAgaWYgKCFhcmd1bWVudHMubGVuZ3RoKSByZXR1cm4gdGlja0Zvcm1hdF87CisgICAgICB0aWNrRm9ybWF0XyA9IHg7CisgICAgICByZXR1cm4gYXhpczsKKyAgICB9OworICAgIGF4aXMudGlja1NpemUgPSBmdW5jdGlvbih4LCB5LCB6KSB7CisgICAgICBpZiAoIWFyZ3VtZW50cy5sZW5ndGgpIHJldHVybiB0aWNrTWFqb3JTaXplOworICAgICAgdmFyIG4gPSBhcmd1bWVudHMubGVuZ3RoIC0gMTsKKyAgICAgIHRpY2tNYWpvclNpemUgPSAreDsKKyAgICAgI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N0IikuYXR0cigiY2xhc3MiLCAiYmFja2dyb3VuZCIpLnN0eWxlKCJ2aXNpYmlsaXR5IiwgImhpZGRlbiIpLnN0eWxlKCJjdXJzb3IiLCAiY3Jvc3NoYWlyIik7CisgICAgICAgIGZnLmVudGVyKCkuYXBwZW5kKCJyZWN0IikuYXR0cigiY2xhc3MiLCAiZXh0ZW50Iikuc3R5bGUoImN1cnNvciIsICJtb3ZlIik7CisgICAgICAgIHR6LmVudGVyKCkuYXBwZW5kKCJnIikuYXR0cigiY2xhc3MiLCBmdW5jdGlvbihkKSB7CisgICAgICAgICAgcmV0dXJuICJyZXNpemUgIiArIGQ7CisgICAgICAgIH0pLnN0eWxlKCJjdXJzb3IiLCBmdW5jdGlvbihkKSB7CisgICAgICAgICAgcmV0dXJuIGQzX3N2Z19icnVzaEN1cnNvcltkXTsKKyAgICAgICAgfSkuYXBwZW5kKCJyZWN0IikuYXR0cigieCIsIGZ1bmN0aW9uKGQpIHsKKyAgICAgICAgICByZXR1cm4gL1tld10kLy50ZXN0KGQpID8gLTMgOiBudWxsOworICAgICAgICB9KS5hdHRyKCJ5IiwgZnVuY3Rpb24oZCkgeworICAgICAgICAgIHJldHVybiAvXltuc10vLnRlc3QoZCkgPyAtMyA6IG51bGw7CisgICAgICAgIH0pLmF0dHIoIndpZHRoIiwgNikuYXR0cigiaGVpZ2h0IiwgNikuc3R5bGUoInZpc2liaWxpdHkiLCAiaGlkZGVuIik7CisgICAgICAgIHR6LnN0eWxlKCJkaXNwbGF5IiwgYnJ1c2guZW1wdHkoKSA/ICJub25lIiA6IG51bGwpOworICAgICAgICB0ei5leGl0KCkucmVtb3ZlKCk7CisgICAgICAgIGlmICh4KSB7CisgICAgICAgICAgZSA9IGQzX3NjYWxlUmFuZ2UoeCk7CisgICAgICAgICAgYmcuYXR0cigieCIsIGVbMF0pLmF0dHIoIndpZHRoIiwgZVsxXSAtIGVbMF0pOworICAgICAgICAgIHJlZHJhd1goZyk7CisgICAgICAgIH0KKyA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hlczsKKyAgICAgICAgcmV0dXJuIHRvdWNoZXMgPyBkMy50b3VjaGVzKHRhcmdldCwgdG91Y2hlcylbMF0gOiBkMy5tb3VzZSh0YXJnZXQpOworICAgICAgfQorICAgICAgZnVuY3Rpb24ga2V5ZG93bigpIHsKKyAgICAgICAgaWYgKGQzLmV2ZW50LmtleUNvZGUgPT0gMzIpIHsKKyAgICAgICAgICBpZiAoIWRyYWdnaW5nKSB7CisgICAgICAgICAgICBjZW50ZXIgPSBudWxsOworICAgICAgICAgICAgb3JpZ2luWzBdIC09IGV4dGVudFsxXVswXTsKKyAgICAgICAgICAgIG9yaWdpblsxXSAtPSBleHRlbnRbMV1bMV07CisgICAgICAgICAgICBkcmFnZ2luZyA9IDI7CisgICAgICAgICAgfQorICAgICAgICAgIGQzX2V2ZW50Q2FuY2VsKCk7CisgICAgICAgIH0KKyAgICAgIH0KKyAgICAgIGZ1bmN0aW9uIGtleXVwKCkgeworICAgICAgICBpZiAoZDMuZXZlbnQua2V5Q29kZSA9PSAzMiAmJiBkcmFnZ2luZyA9PSAyKSB7CisgICAgICAgICAgb3JpZ2luWzBdICs9IGV4dGVudFsxXVswXTsKKyAgICAgICAgICBvcmlnaW5bMV0gKz0gZXh0ZW50WzFdWzFdOworICAgICAgICAgIGRyYWdnaW5nID0gMDsKKyAgICAgICAgICBkM19ldmVudENhbmNlbCgpOworICAgICAgICB9CisgICAgICB9CisgICAgICBmdW5jdGlvbiBicnVzaG1vdmUoKSB7CisgICAgICAgIHZhciBwb2ludCA9IG1vdXNlKCksIG1vdmVkID0gZmFsc2U7CisgICAgICAgIGlmIChvZmZzZXQpIHsKKyAgICAgICAgICBwb2ludFswXSArPSBvZmZzZXRbMF07CisgICAgICAgICAgcG9pbnRbMV0gKz0gb2Zmc2V0WzFdOworICAgICAgICB9CisgICAgICAgIGlmICghZHJhZ2dpbmcpIHsKKyAgICAgICAgICBpZiAoZDMuZXZlbnQuYWx0S2V5KSB7CisgICAgICAgICAgICBpZiAoIWNlbnRlcikgY2VudGVyID0gWyAoZXh0ZW50WzBdWzBdICsgZXh0ZW50WzFdWzBdKSAvIDIsIChleHRlbnRbMF1bMV0gKyBleHRlbnRbMV1bMV0pIC8gMiBdOworICAgICAgICAgICAgb3JpZ2luWzBdID0gZXh0ZW50WysocG9pbnRbMF0gPCBjZW50ZXJbMF0pXVswXTsKKyAgICAgICAgICAgIG9yaWdpblsxXSA9IGV4dGVudFsrKHBvaW50WzFdIDwgY2VudGVyWzFdKV1bMV07CisgICAgICAgICAgfSBlbHNlIGNlbnRlciA9IG51bGw7CisgICAgICAgIH0KKyAgICAgICAgaWYgKHJlc2l6aW5nWCAmJiBtb3ZlMShwb2ludCwgeCwgMCkpIHsKKyAgICAgICAgICByZWRyYXdYKGcpOworICAgICAgICAgIG1vdmVkID0gdHJ1ZTsKKyAgICAgICAgfQorICAgICAgICBpZiAocmVzaXppbmdZICYmIG1vdmUxKHBvaW50LCB5LCAxKSkgeworICAgICAgICAgIHJlZHJhd1koZyk7CisgICAgICAgICAgbW92ZWQgPSB0cnVlOworICAgICAgICB9CisgICAgICAgIGlmIChtb3ZlZCkgeworICAgICAgICAgIHJlZHJhdyhnKTsKKyAgICAgICAgICBldmVudF8oeworICAgICAgICAgICAgdHlwZTogImJydXNoIiwKKyAgICAgICAgICAgIG1vZGU6IGRyYWdnaW5nID8gIm1vdmUiIDogInJlc2l6ZSIKKyAgICAgICAgICB9KTsKKyAgICAgICAgfQorICAgICAgfQorICAgICAgZnVuY3Rpb24gbW92ZTEocG9pbnQsIHNjYWxlLCBpKSB7CisgICAgICAgIHZhciByYW5nZSA9IGQzX3NjYWxlUmFuZ2Uoc2NhbGUpLCByMCA9IHJhbmdlWzBdLCByMSA9IHJhbmdlWzFdLCBwb3NpdGlvbiA9IG9yaWdpbltpXSwgc2l6ZSA9IGV4dGVudFsxXVtpXSAtIGV4dGVudFswXVtpXSwgbWluLCBtYXg7CisgICAgICAgIGlmIChkcmFnZ2luZykgeworICAgICAgICAgIHIwIC09IHBvc2l0aW9uOworICAgICAgICAgIHIxIC09IHNpemUgKyBwb3NpdGlvbjsKKyAgICAgICAgfQorICAgICAgICBtaW4gPSBNYXRoLm1heChyMCwgTWF0aC5taW4ocjEsIHBvaW50W2ldKSk7CisgICAgICAgIGlmIChkcmFnZ2luZykgeworICAgICAgICAgIG1heCA9IChtaW4gKz0gcG9zaXRpb24pICsgc2l6ZTsKKyAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICBpZiAoY2VudGVyKSBwb3NpdGlvbiA9IE1hdGgubWF4KHIwLCBNYXRoLm1pbihyMSwgMiAqIGNlbnRlcltpXSAtIG1pbikpOworICAgICAgICAgIGlmIChwb3NpdGlvbiA8IG1pbikgeworICAgICAgICAgICAgbWF4ID0gbWluOworICAgICAgICAgICAgbWluID0gcG9zaXRpb247CisgICAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgIG1heCA9IHBvc2l0aW9uOworICAgICAgICAgIH0KKyAgICAgICAgfQorICAgICAgICBpZiAoZXh0ZW50WzBdW2ldICE9PSBtaW4gfHwgZXh0ZW50WzFdW2ldICE9PSBtYXgpIHsKKyAgICAgICAgICBleHRlbnREb21haW4gPSBudWxsOworICAgICAgICAgIGV4dGVudFswXVtpXSA9IG1pbjsKKyAgICAgICAgICBleHRlbnRbMV1baV0gPSBtYXg7CisgICAgICAgICAgcmV0dXJuIHRydWU7CisgICAgICAgIH0KKyAgICAgIH0KKyAgICAgIGZ1bmN0aW9uIGJydXNoZW5kKCkgeworICAgICAgICBicnVzaG1vdmUoKTsKKyAgICAgICAgZy5zdHlsZSgicG9pbnRlci1ldmVudHMiLCAiYWxsIikuc2VsZWN0QWxsKCIucmVzaXplIikuc3R5bGUoImRpc3BsYXkiLCBicnVzaC5lbXB0eSgpID8gIm5vbmUiIDogbnVsbCk7CisgICAgICAgIGQzLnNlbGVjdCgiYm9keSIpLnN0eWxlKCJjdXJzb3IiLCBudWxsKTsKKyAgICAgICAgdy5vbigibW91c2Vtb3ZlLmJydXNoIiwgbnVsbCkub24oIm1vdXNldXAuYnJ1c2giLCBudWxsKS5vbigidG91Y2htb3ZlLmJydXNoIiwgbnVsbCkub24oInRvdWNoZW5kLmJydXNoIiwgbnVsbCkub24oImtleWRvd24uYnJ1c2giLCBudWxsKS5vbigia2V5dXAuYnJ1c2giLCBudWxsKTsKKyAgICAgICAgZXZlbnRfKHsKKyAgICAgICAgICB0eXBlOiAiYnJ1c2hlbmQiCisgICAgICAgIH0pOworICAgICAgICBkM19ldmVudENhbmNlbCgpOworICAgICAgfQorICAgICAgdmFyIHRhcmdldCA9IHRoaXMsIGV2ZW50VGFyZ2V0ID0gZDMuc2VsZWN0KGQzLmV2ZW50LnRhcmdldCksIGV2ZW50XyA9IGV2ZW50Lm9mKHRhcmdldCwgYXJndW1lbnRzKSwgZyA9IGQzLnNlbGVjdCh0YXJnZXQpLCByZXNpemluZyA9IGV2ZW50VGFyZ2V0LmRhdHVtKCksIHJlc2l6aW5nWCA9ICEvXihufHMpJC8udGVzdChyZXNpemluZykgJiYgeCwgcmVzaXppbmdZID0gIS9eKGV8dykkLy50ZXN0KHJlc2l6aW5nKSAmJiB5LCBkcmFnZ2luZyA9IGV2ZW50VGFyZ2V0LmNsYXNzZWQoImV4dGVudCIpLCBjZW50ZXIsIG9yaWdpbiA9IG1vdXNlKCksIG9mZnNldDsKKyAgICAgIHZhciB3ID0gZDMuc2VsZWN0KHdpbmRvdykub24oIm1vdXNlbW92ZS5icnVzaCIsIGJydXNobW92ZSkub24oIm1vdXNldXAuYnJ1c2giLCBicnVzaGVuZCkub24oInRvdWNobW92ZS5icnVzaCIsIGJydXNobW92ZSkub24oInRvdWNoZW5kLmJydXNoIiwgYnJ1c2hlbmQpLm9uKCJrZXlkb3duLmJydXNoIiwga2V5ZG93bikub24oImtleXVwLmJydXNoIiwga2V5dXApOworICAgICAgaWYgKGRyYWdnaW5nKSB7CisgICAgICAgIG9yaWdpblswXSA9IGV4dGVudFswXVswXSAtIG9yaWdp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HsKKyAgICAgIGlmICghYXJndW1lbnRzLmxlbmd0aCkgcmV0dXJuIHg7CisgICAgICB4ID0gejsKKyAgICAgIHJlc2l6ZXMgPSBkM19zdmdfYnJ1c2hSZXNpemVzWyF4IDw8IDEgfCAheV07CisgICAgICByZXR1cm4gYnJ1c2g7CisgICAgfTsKKyAgICBicnVzaC55ID0gZnVuY3Rpb24oeikgeworICAgICAgaWYgKCFhcmd1bWVudHMubGVuZ3RoKSByZXR1cm4geTsKKyAgICAgIHkgPSB6OworICAgICAgcmVzaXplcyA9IGQzX3N2Z19icnVzaFJlc2l6ZXNbIXggPDwgMSB8ICF5XTsKKyAgICAgIHJldHVybiBicnVzaDsKKyAgICB9OworICAgIGJydXNoLmV4dGVudCA9IGZ1bmN0aW9uKHopIHsKKyAgICAgIHZhciB4MCwgeDEsIHkwLCB5MSwgdDsKKyAgICAgIGlmICghYXJndW1lbnRzLmxlbmd0aCkgeworICAgICAgICB6ID0gZXh0ZW50RG9tYWluIHx8IGV4dGVudDsKKyAgICAgICAgaWYgKHgpIHsKKyAgICAgICAgICB4MCA9IHpbMF1bMF0sIHgxID0gelsxXVswXTsKKyAgICAgICAgICBpZiAoIWV4dGVudERvbWFpbikgeworICAgICAgICAgICAgeDAgPSBleHRlbnRbMF1bMF0sIHgxID0gZXh0ZW50WzFdWzBdOworICAgICAgICAgICAgaWYgKHguaW52ZXJ0KSB4MCA9IHguaW52ZXJ0KHgwKSwgeDEgPSB4LmludmVydCh4MSk7CisgICAgICAgICAgICBpZiAoeDEgPCB4MCkgdCA9IHgwLCB4MCA9IHgxLCB4MSA9IHQ7CisgICAgICAgICAgfQorICAgICAgICB9CisgICAgICAgIGlmICh5KSB7CisgICAgICAgICAgeTAgPSB6WzBdWzFdLCB5MSA9IHpbMV1bMV07CisgICAgICAgICAgaWYgKCFleHRlbnREb21haW4pIHsKKyAgICAgICAgICAgIHkwID0gZXh0ZW50WzBdWzFdLCB5MSA9IGV4dGVudFsxXVsxXTsKKyAgICAgICAgICAgIGlmICh5LmludmVydCkgeTAgPSB5LmludmVydCh5MCksIHkxID0geS5pbnZlcnQoeTEpOworICAgICAgICAgICAgaWYgKHkxIDwgeTApIHQgPSB5MCwgeTAgPSB5MSwgeTEgPSB0OworICAgICAgICAgIH0KKyAgICAgICAgfQorICAgICAgICByZXR1cm4geCAmJiB5ID8gWyBbIHgwLCB5MCBdLCBbIHgxLCB5MSBdIF0gOiB4ID8gWyB4MCwgeDEgXSA6IHkgJiYgWyB5MCwgeTEgXTsKKyAgICAgIH0KKyAgICAgIGV4dGVudERvbWFpbiA9IFsgWyAwLCAwIF0sIFsgMCwgMCBdIF07CisgICAgICBpZiAoeCkgeworICAgICAgICB4MCA9IHpbMF0sIHgxID0gelsxXTsKKyAgICAgICAgaWYgKHkpIHgwID0geDBbMF0sIHgxID0geDFbMF07CisgICAgICAgIGV4dGVudERvbWFpblswXVswXSA9IHgwLCBleHRlbnREb21haW5bMV1bMF0gPSB4MTsKKyAgICAgICAgaWYgKHguaW52ZXJ0KSB4MCA9IHgoeDApLCB4MSA9IHgoeDEpOworICAgICAgICBpZiAoeDEgPCB4MCkgdCA9IHgwLCB4MCA9IHgxLCB4MSA9IHQ7CisgICAgICAgIGV4dGVudFswXVswXSA9IHgwIHwgMCwgZXh0ZW50WzFdWzBdID0geDEgfCAwOworICAgICAgfQorICAgICAgaWYgKHkpIHsKKyAgICAgICAgeTAgPSB6WzBdLCB5MSA9IHpbMV07CisgICAgICAgIGlmICh4KSB5MCA9IHkwWzFdLCB5MSA9IHkxWzFdOworICAgICAgICBleHRlbnREb21haW5bMF1bMV0gPSB5MCwgZXh0ZW50RG9tYWluWzFdWzFdID0geTE7CisgICAgICAgIGlmICh5LmludmVydCkgeTAgPSB5KHkwKSwgeTEgPSB5KHkxKTsKKyAgICAgICAgaWYgKHkxIDwgeTApIHQgPSB5MCwgeTAgPSB5MSwgeTEgPSB0OworICAgICAgICBleHRlbnRbMF1bMV0gPSB5MCB8IDAsIGV4dGVudFsxXVsxXSA9IHkxIHwgMDsKKyAgICAgIH0KKyAgICAgIHJldHVybiBicnVzaDsKKyAgICB9OworICAgIGJydXNoLmNsZWFyID0gZnVuY3Rpb24oKSB7CisgICAgICBleHRlbnREb21haW4gPSBudWxsOworICAgICAgZXh0ZW50WzBdWzBdID0gZXh0ZW50WzBdWzFdID0gZXh0ZW50WzFdWzBdID0gZXh0ZW50WzFdWzFdID0gMDsKKyAgICAgIHJldHVybiBicnVzaDsKKyAgICB9OworICAgIGJydXNoLmVtcHR5ID0gZnVuY3Rpb24oKSB7CisgICAgICByZXR1cm4geCAmJiBleHRlbnRbMF1bMF0gPT09IGV4dGVudFsxXVswXSB8fCB5ICYmIGV4dGVudFswXVsxXSA9PT0gZXh0ZW50WzFdWzFdOworICAgIH07CisgICAgcmV0dXJuIGQzLnJlYmluZChicnVzaCwgZXZlbnQsICJvbiIpOworICB9OworICB2YXIgZDNfc3ZnX2JydXNoQ3Vyc29yID0geworICAgIG46ICJucy1yZXNpemUiLAorICAgIGU6ICJldy1yZXNpemUiLAorICAgIHM6ICJucy1yZXNpemUiLAorICAgIHc6ICJldy1yZXNpemUiLAorICAgIG53OiAibndzZS1yZXNpemUiLAorICAgIG5lOiAibmVzdy1yZXNpemUiLAorICAgIHNlOiAibndzZS1yZXNpemUiLAorICAgIHN3OiAibmVzdy1yZXNpemUiCisgIH07CisgIHZhciBkM19zdmdfYnJ1c2hSZXNpemVzID0gWyBbICJuIiwgImUiLCAicyIsICJ3IiwgIm53IiwgIm5lIiwgInNlIiwgInN3IiBdLCBbICJlIiwgInciIF0sIFsgIm4iLCAicyIgXSwgW10gXTsKKyAgZDMuYmVoYXZpb3IgPSB7fTsKKyAgZDMuYmVoYXZpb3IuZHJhZyA9IGZ1bmN0aW9uKCkgeworICAgIGZ1bmN0aW9uIGRyYWcoKSB7CisgICAgICB0aGlzLm9uKCJtb3VzZWRvd24uZHJhZyIsIG1vdXNlZG93bikub24oInRvdWNoc3RhcnQuZHJhZyIsIG1vdXNlZG93bik7CisgICAgfQorICAgIGZ1bmN0aW9uIG1vdXNlZG93bigpIHsKKyAgICAgIGZ1bmN0aW9uIHBvaW50KCkgeworICAgICAgICB2YXIgcCA9IHRhcmdldC5wYXJlbnROb2RlOworICAgICAgICByZXR1cm4gdG91Y2hJZCA/IGQzLnRvdWNoZXMocCkuZmlsdGVyKGZ1bmN0aW9uKHApIHsKKyAgICAgICAgICByZXR1cm4gcC5pZGVudGlmaWVyID09PSB0b3VjaElkOworICAgICAgICB9KVswXSA6IGQzLm1vdXNlKHApOworICAgICAgfQorICAgICAgZnVuY3Rpb24gZHJhZ21vdmUoKSB7CisgICAgICAgIGlmICghdGFyZ2V0LnBhcmVudE5vZGUpIHJldHVybiBkcmFnZW5kKCk7CisgICAgICAgIHZhciBwID0gcG9pbnQoKSwgZHggPSBwWzBdIC0gb3JpZ2luX1swXSwgZHkgPSBwWzFdIC0gb3JpZ2luX1sxXTsKKyAgICAgICAgbW92ZWQgfD0gZHggfCBkeTsKKyAgICAgICAgb3JpZ2luXyA9IHA7CisgICAgICAgIGQzX2V2ZW50Q2FuY2VsKCk7CisgICAgICAgIGV2ZW50Xyh7CisgICAgICAgICAgdHlwZTogImRyYWciLAorICAgICAgICAgIHg6IHBbMF0gKyBvZmZzZXRbMF0sCisgICAgICAgICAgeTogcFsxXSArIG9mZnNldFsxXSwKKyAgICAgICAgICBkeDogZHgsCisgICAgICAgICAgZHk6IGR5CisgICAgICAgIH0pOworICAgICAgfQorICAgICAgZnVuY3Rpb24gZHJhZ2VuZCgpIHsKKyAgICAgICAgZXZlbnRfKHsKKyAgICAgICAgICB0eXBlOiAiZHJhZ2VuZCIKKyAgICAgICAgfSk7CisgICAgICAgIGlmIChtb3ZlZCkgeworICAgICAgICAgIGQzX2V2ZW50Q2FuY2VsKCk7CisgICAgICAgICAgaWYgKGQzLmV2ZW50LnRhcmdldCA9PT0gZXZlbnRUYXJnZXQpIHcub24oImNsaWNrLmRyYWciLCBjbGljaywgdHJ1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8oZDMubW91c2UodGhpcyksIHRyYW5zbGF0ZTApOworICAgICAgZGlzcGF0Y2goZXZlbnQub2YodGhpcywgYXJndW1lbnRzKSk7CisgICAgfQorICAgIGZ1bmN0aW9uIG1vdXNlbW92ZSgpIHsKKyAgICAgIHRyYW5zbGF0ZTAgPSBudWxsOworICAgIH0KKyAgICBmdW5jdGlvbiBkYmxjbGljaygpIHsKKyAgICAgIHZhciBwID0gZDMubW91c2UodGhpcyksIGwgPSBsb2NhdGlvbihwKTsKKyAgICAgIHNjYWxlVG8oZDMuZXZlbnQuc2hpZnRLZXkgPyBzY2FsZSAvIDIgOiBzY2FsZSAqIDIpOworICAgICAgdHJhbnNsYXRlVG8ocCwgbCk7CisgICAgICBkaXNwYXRjaChldmVudC5vZih0aGlzLCBhcmd1bWVudHMpKTsKKyAgICB9CisgICAgZnVuY3Rpb24gdG91Y2hzdGFydCgpIHsKKyAgICAgIHZhciB0b3VjaGVzID0gZDMudG91Y2hlcyh0aGlzKSwgbm93ID0gRGF0ZS5ub3coKTsKKyAgICAgIHNjYWxlMCA9IHNjYWxlOworICAgICAgdHJhbnNsYXRlMCA9IHt9OworICAgICAgdG91Y2hlcy5mb3JFYWNoKGZ1bmN0aW9uKHQpIHsKKyAgICAgICAgdHJhbnNsYXRlMFt0LmlkZW50aWZpZXJdID0gbG9jYXRpb24odCk7CisgICAgICB9KTsKKyAgICAgIGQzX2V2ZW50Q2FuY2VsKCk7CisgICAgICBpZiAodG91Y2hlcy5sZW5ndGggPT09IDEpIHsKKyAgICAgICAgaWYgKG5vdyAtIHRvdWNodGltZSA8IDUwMCkgeworICAgICAgICAgIHZhciBwID0gdG91Y2hlc1swXSwgbCA9IGxvY2F0aW9uKHRvdWNoZXNbMF0pOworICAgICAgICAgIHNjYWxlVG8oc2NhbGUgKiAyKTsKKyAgICAgICAgICB0cmFuc2xhdGVUbyhwLCBsKTsKKyAgICAgICAgICBkaXNwYXRjaChldmVudC5vZih0aGlzLCBhcmd1bWVudHMpK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KyAgICB9OworICAgIHpvb20uc2NhbGUgPSBmdW5jdGlvbih4KSB7CisgICAgICBpZiAoIWFyZ3VtZW50cy5sZW5ndGgpIHJldHVybiBzY2FsZTsKKyAgICAgIHNjYWxlID0gK3g7CisgICAgICByZXR1cm4gem9vbTsKKyAgICB9OworICAgIHpvb20uc2NhbGVFeHRlbnQgPSBmdW5jdGlvbih4KSB7CisgICAgICBpZiAoIWFyZ3VtZW50cy5sZW5ndGgpIHJldHVybiBzY2FsZUV4dGVudDsKKyAgICAgIHNjYWxlRXh0ZW50ID0geCA9PSBudWxsID8gZDNfYmVoYXZpb3Jfem9vbUluZmluaXR5IDogeC5tYXAoTnVtYmVyKTsKKyAgICAgIHJldHVybiB6b29tOworICAgIH07CisgICAgem9vbS54ID0gZnVuY3Rpb24oeikgeworICAgICAgaWYgKCFhcmd1bWVudHMubGVuZ3RoKSByZXR1cm4geDE7CisgICAgICB4MSA9IHo7CisgICAgICB4MCA9IHouY29weSgpOworICAgICAgcmV0dXJuIHpvb207CisgICAgfTsKKyAgICB6b29tLnkgPSBmdW5jdGlvbih6KSB7CisgICAgICBpZiAoIWFyZ3VtZW50cy5sZW5ndGgpIHJldHVybiB5MTsKKyAgICAgIHkxID0gejsKKyAgICAgIHkwID0gei5jb3B5KCk7CisgICAgICByZXR1cm4gem9vbTsKKyAgICB9OworICAgIHJldHVybiBkMy5yZWJpbmQoem9vbSwgZXZlbnQsICJvbiIpOworICB9OworICB2YXIgZDNfYmVoYXZpb3Jfem9vbURpdiwgZDNfYmVoYXZpb3Jfem9vbUluZmluaXR5ID0gWyAwLCBJbmZpbml0eSBdOworICBkMy5sYXlvdXQgPSB7fTsKKyAgZDMubGF5b3V0LmJ1bmRsZSA9IGZ1bmN0aW9uKCkgeworICAgIHJldHVybiBmdW5jdGlvbihsaW5rcykgeworICAgICAgdmFyIHBhdGhzID0gW10sIGkgPSAtMSwgbiA9IGxpbmtzLmxlbmd0aDsKKyAgICAgIHdoaWxlICgrK2kgPCBuKSBwYXRocy5wdXNoKGQzX2xheW91dF9idW5kbGVQYXRoKGxpbmtzW2ldKSk7CisgICAgICByZXR1cm4gcGF0aHM7CisgICAgfTsKKyAgfTsKKyAgZDMubGF5b3V0LmNob3JkID0gZnVuY3Rpb24oKSB7CisgICAgZnVuY3Rpb24gcmVsYXlvdXQoKSB7CisgICAgICB2YXIgc3ViZ3JvdXBzID0ge30sIGdyb3VwU3VtcyA9IFtdLCBncm91cEluZGV4ID0gZDMucmFuZ2UobiksIHN1Ymdyb3VwSW5kZXggPSBbXSwgaywgeCwgeDAsIGksIGo7CisgICAgICBjaG9yZHMgPSBbXTsKKyAgICAgIGdyb3VwcyA9IFtdOworICAgICAgayA9IDAsIGkgPSAtMTsKKyAgICAgIHdoaWxlICgrK2kgPCBuKSB7CisgICAgICAgIHggPSAwLCBqID0gLTE7CisgICAgICAgIHdoaWxlICgrK2ogPCBuKSB7CisgICAgICAgICAgeCArPSBtYXRyaXhbaV1bal07CisgICAgICAgIH0KKyAgICAgICAgZ3JvdXBTdW1zLnB1c2goeCk7CisgICAgICAgIHN1Ymdyb3VwSW5kZXgucHVzaChkMy5yYW5nZShuKSk7CisgICAgICAgIGsgKz0geDsKKyAgICAgIH0KKyAgICAgIGlmIChzb3J0R3JvdXBzKSB7CisgICAgICAgIGdyb3VwSW5kZXguc29ydChmdW5jdGlvbihhLCBiKSB7CisgICAgICAgICAgcmV0dXJuIHNvcnRHcm91cHMoZ3JvdXBTdW1zW2FdLCBncm91cFN1bXNbYl0pOworICAgICAgICB9KTsKKyAgICAgIH0KKyAgICAgIGlmIChzb3J0U3ViZ3JvdXBzKSB7CisgICAgICAgIHN1Ymdyb3VwSW5kZXguZm9yRWFjaChmdW5jdGlvbihkLCBpKSB7CisgICAgICAgICAgZC5zb3J0KGZ1bmN0aW9uKGEsIGIpIHsKKyAgICAgICAgICAgIHJldHVybiBzb3J0U3ViZ3JvdXBzKG1hdHJpeFtpXVthXSwgbWF0cml4W2ldW2JdKTsKKyAgICAgICAgICB9KTsKKyAgICAgICAgfSk7CisgICAgICB9CisgICAgICBrID0gKDIgKiBNYXRoLlBJIC0gcGFkZGluZyAqIG4pIC8gazsKKyAgICAgIHggPSAwLCBpID0gLTE7CisgICAgICB3aGlsZSAoKytpIDwgbikgeworICAgICAgICB4MCA9IHgsIGogPSAtMTsKKyAgICAgICAgd2hpbGUgKCsraiA8IG4pIHsKKyAgICAgICAgICB2YXIgZGkgPSBncm91cEluZGV4W2ldLCBkaiA9IHN1Ymdyb3VwSW5kZXhbZGldW2pdLCB2ID0gbWF0cml4W2RpXVtkal0sIGEwID0geCwgYTEgPSB4ICs9IHYgKiBrOworICAgICAgICAgIHN1Ymdyb3Vwc1tkaSArICItIiArIGRqXSA9IHsKKyAgICAgICAgICAgIGluZGV4OiBkaSwKKyAgICAgICAgICAgIHN1YmluZGV4OiBkaiwKKyAgICAgICAgICAgIHN0YXJ0QW5nbGU6IGEwLAorICAgICAgICAgICAgZW5kQW5nbGU6IGExLAorICAgICAgICAgICAgdmFsdWU6IHYKKyAgICAgICAgICB9OworICAgICAgICB9CisgICAgICAgIGdyb3Vwc1tkaV0gPSB7CisgICAgICAgICAgaW5kZXg6IGRpLAorICAgICAgICAgIHN0YXJ0QW5nbGU6IHgwLAorICAgICAgICAgIGVuZEFuZ2xlOiB4LAorICAgICAgICAgIHZhbHVlOiAoeCAtIHgwKSAvIGsKKyAgICAgICAgfTsKKyAgICAgICAgeCArPSBwYWRkaW5nOworICAgICAgfQorICAgICAgaSA9IC0xOworICAgICAgd2hpbGUgKCsraSA8IG4pIHsKKyAgICAgICAgaiA9IGkgLSAxOworICAgICAgICB3aGlsZSAoKytqIDwgbikgeworICAgICAgICAgIHZhciBzb3VyY2UgPSBzdWJncm91cHNbaSArICItIiArIGpdLCB0YXJnZXQgPSBzdWJncm91cHNbaiArICItIiArIGldOworICAgICAgICAgIGlmIChzb3VyY2UudmFsdWUgfHwgdGFyZ2V0LnZhbHVlKSB7CisgICAgICAgICAgICBjaG9yZHMucHVzaChzb3VyY2UudmFsdWUgPCB0YXJnZXQudmFsdWUgPyB7CisgICAgICAgICAgICAgIHNvdXJjZTogdGFyZ2V0LAorICAgICAgICAgICAgICB0YXJnZXQ6IHNvdXJjZQorICAgICAgICAgICAgfSA6IHsKKyAgICAgICAgICAgICAgc291cmNlOiBzb3VyY2UsCisgICAgICAgICAgICAgIHRhcmdldDogdGFyZ2V0CisgICAgICAgICAgICB9KTsKKyAgICAgICAgICB9CisgICAgICAgIH0KKyAgICAgIH0KKyAgICAgIGlmIChzb3J0Q2hvcmRzKSByZXNvcnQoKTsKKyAgICB9CisgICAgZnVuY3Rpb24gcmVzb3J0KCkgeworICAgICAgY2hvcmRzLnNvcnQoZnVuY3Rpb24oYSwgYikgeworICAgICAgICByZXR1cm4gc29ydENob3JkcygoYS5zb3VyY2UudmFsdWUgKyBhLnRhcmdldC52YWx1ZSkgLyAyLCAoYi5zb3VyY2UudmFsdWUgKyBiLnRhcmdldC52YWx1ZSkgLyAyKTsKKyAgICAgIH0pOworICAgIH0KKyAgICB2YXIgY2hvcmQgPSB7fSwgY2hvcmRzLCBncm91cHMsIG1hdHJpeCwgbiwgcGFkZGluZyA9IDAsIHNvcnRHcm91cHMsIHNvcnRTdWJncm91cHMsIHNvcnRDaG9yZHM7CisgICAgY2hvcmQubWF0cml4ID0gZnVuY3Rpb24oeCkgeworICAgICAgaWYgKCFhcmd1bWVudHMubGVuZ3RoKSByZXR1cm4gbWF0cml4OworICAgICAgbiA9IChtYXRyaXggPSB4KSAmJiBtYXRyaXgubGVuZ3RoOworICAgICAgY2hvcmRzID0gZ3JvdXBzID0gbnVsbDsKKyAgICAgIHJldHVybiBjaG9yZDsKKyAgICB9OworICAgIGNob3JkLnBhZGRpbmcgPSBmdW5jdGlvbih4KSB7CisgICAgICBpZiAoIWFyZ3VtZW50cy5sZW5ndGgpIHJldHVybiBwYWRkaW5nOworICAgICAgcGFkZGluZyA9IHg7CisgICAgICBjaG9yZHMgPSBncm91cHMgPSBudWxsOworICAgICAgcmV0dXJuIGNob3JkOworICAgIH07CisgICAgY2hvcmQuc29ydEdyb3VwcyA9IGZ1bmN0aW9uKHgpIHsKKyAgICAgIGlmICghYXJndW1lbnRzLmxlbmd0aCkgcmV0dXJuIHNvcnRHcm91cHM7CisgICAgICBzb3J0R3JvdXBzID0geDsKKyAgICAgIGNob3JkcyA9IGdyb3VwcyA9IG51bGw7CisgICAgICByZXR1cm4gY2hvcmQ7CisgICAgfTsKKyAgICBjaG9yZC5zb3J0U3ViZ3JvdXBzID0gZnVuY3Rpb24oeCkgeworICAgICAgaWYgKCFhcmd1bWVudHMubGVuZ3RoKSByZXR1cm4gc29ydFN1Ymdyb3VwczsKKyAgICAgIHNvcnRTdWJncm91cHMgPSB4OworICAgICAgY2hvcmRzID0gbnVsbDsKKyAgICAgIHJldHVybiBjaG9yZDsKKyAgICB9OworICAgIGNob3JkLnNvcnRDaG9yZHMgPSBmdW5jdGlvbih4KSB7CisgICAgICBpZiAoIWFyZ3VtZW50cy5sZW5ndGgpIHJldHVybiBzb3J0Q2hvcmRzOworICAgICAgc29ydENob3JkcyA9IHg7CisgICAgICBpZiAoY2hvcmRzKSByZXNvcnQoKTsKKyAgICAgIHJldHVybiBjaG9yZDsKKyAgICB9OworICAgIGNob3JkLmNob3JkcyA9IGZ1bmN0aW9uKCkgeworICAgICAgaWYgKCFjaG9yZHMpIHJlbGF5b3V0KCk7CisgICAgICByZXR1cm4gY2hvcmRzOworICAgIH07CisgICAgY2hvcmQuZ3JvdXBzID0gZnVuY3Rpb24oKSB7CisgICAgICBpZiAoIWdyb3VwcykgcmVsYXlvdXQoKTsKKyAgICAgIHJldHVybiBncm91cHM7CisgICAgfTsKKyAgICByZXR1cm4gY2hvcmQ7CisgIH07CisgIGQzLmxheW91dC5mb3JjZSA9IGZ1bmN0aW9uKCkgeworICAgIGZ1bmN0aW9uIHJlcHVsc2Uobm9kZSkgeworICAgICAgcmV0dXJuIGZ1bmN0aW9uKHF1YWQsIHgxLCB5MSwgeDIsIHkyKSB7CisgICAgICAgIGlmIChxdWFkLnBvaW50ICE9PSBub2RlKSB7CisgICAgICAgICAgdmFyIGR4ID0gcXVhZC5jeCAtIG5vZGUueCwgZHkgPSBxdWFkLmN5IC0gbm9kZS55LCBkbiA9IDEgLyBNYXRoLnNxcnQoZHggKiBkeCArIGR5ICogZHkpOworICAgICAgICAgIGlmICgoeDIgLSB4MSkgKiBkbiA8IHRoZXRhKSB7CisgICAgICAgICAgICB2YXIgayA9IHF1YWQuY2hhcmdlICogZG4gKiBkbjsKKyAgICAgICAgICAgIG5vZGUucHggLT0gZHggKiBrOworICAgICAgICAgICAgbm9kZS5weSAtPSBkeSAqIGs7CisgICAgICAgICAgICByZXR1cm4gdHJ1ZTsKKyAgICAgICAgICB9CisgICAgICAgICAgaWYgKHF1YWQucG9pbnQgJiYgaXNGaW5pdGUoZG4pKSB7CisgICAgICAgICAgICB2YXIgayA9IHF1YWQucG9pbnRDaGFyZ2UgKiBkbiAqIGRuOworICAgICAgICAgICAgbm9kZS5weCAtPSBkeCAqIGs7CisgICAgICAgICAgICBub2RlLnB5IC09IGR5ICogazsKKyAgICAgICAgICB9CisgICAgICAgIH0KKyAgICAgICAgcmV0dXJuICFxdWFkLmNoYXJnZTsKKyAgICAgIH07CisgICAgfQorICAgIGZ1bmN0aW9uIGRyYWdtb3ZlKGQpIHsKKyAgICAgIGQucHggPSBkMy5ldmVudC54OworICAgICAgZC5weSA9IGQzLmV2ZW50Lnk7CisgICAgICBmb3JjZS5yZXN1bWUoKTsKKyAgICB9CisgICAgdmFyIGZvcmNlID0ge30sIGV2ZW50ID0gZDMuZGlzcGF0Y2goInN0YXJ0IiwgInRpY2siLCAiZW5kIiksIHNpemUgPSBbIDEsIDEgXSwgZHJhZywgYWxwaGEsIGZyaWN0aW9uID0gLjksIGxpbmtEaXN0YW5jZSA9IGQzX2xheW91dF9mb3JjZUxpbmtEaXN0YW5jZSwgbGlua1N0cmVuZ3RoID0gZDNfbGF5b3V0X2ZvcmNlTGlua1N0cmVuZ3RoLCBjaGFyZ2UgPSAtMzAsIGdyYXZpdHkgPSAuMSwgdGhldGEgPSAuOCwgaW50ZXJ2YWwsIG5vZGVzID0gW10sIGxpbmtzID0gW10sIGRpc3RhbmNlcywgc3RyZW5ndGhzLCBjaGFyZ2VzOworICAgIGZvcmNlLnRpY2sgPSBmdW5jdGlvbigpIHsKKyAgICAgIGlmICgoYWxwaGEgKj0gLjk5KSA8IC4wMDUpIHsKKyAgICAgICAgZXZlbnQuZW5kKHsKKyAgICAgICAgICB0eXBlOiAiZW5kIiwKKyAgICAgICAgICBhbHBoYTogYWxwaGEgPSAwCisgICAgICAgIH0pOworICAgICAgICByZXR1cm4gdHJ1ZTsKKyAgICAgIH0KKyAgICAgIHZhciBuID0gbm9kZXMubGVuZ3RoLCBtID0gbGlua3MubGVuZ3RoLCBxLCBpLCBvLCBzLCB0LCBsLCBrLCB4LCB5OworICAgICAgZm9yIChpID0gMDsgaSA8IG07ICsraSkgeworICAgICAgICBvID0gbGlua3NbaV07CisgICAgICAgIHMgPSBvLnNvdXJjZTsKKyAgICAgICAgdCA9IG8udGFyZ2V0OworICAgICAgICB4ID0gdC54IC0gcy54OworICAgICAgICB5ID0gdC55IC0gcy55OworICAgICAgICBpZiAobCA9IHggKiB4ICsgeSAqIHkpIHsKKyAgICAgICAgICBsID0gYWxwaGEgKiBzdHJlbmd0aHNbaV0gKiAoKGwgPSBNYXRoLnNxcnQobCkpIC0gZGlzdGFuY2VzW2ldKSAvIGw7CisgICAgICAgICAgeCAqPSBsOworICAgICAgICAgIHkgKj0gbDsKKyAgICAgICAgICB0LnggLT0geCAqIChrID0gcy53ZWlnaHQgLyAodC53ZWlnaHQgKyBzLndlaWdodCkpOworICAgICAgICAgIHQueSAtPSB5ICogazsKKyAgICAgICAgICBzLnggKz0geCAqIChrID0gMSAtIGspOworICAgICAgICAgIHMueSArPSB5ICogazsKKyAgICAgICAgfQorICAgICAgfQorICAgICAgaWYgKGsgPSBhbHBoYSAqIGdyYXZpdHkpIHsKKyAgICAgICAgeCA9IHNpemVbMF0gLyAyOworICAgICAgICB5ID0gc2l6ZVsxXSAvIDI7CisgICAgICAgIGkgPSAtMTsKKyAgICAgICAgaWYgKGspIHdoaWxlICgrK2kgPCBuKSB7CisgICAgICAgICAgbyA9IG5vZGVzW2ldOworICAgICAgICAgIG8ueCArPSAoeCAtIG8ueCkgKiBrOworICAgICAgICAgIG8ueSArPSAoeSAtIG8ueSkgKiBrOworICAgICAgICB9CisgICAgICB9CisgICAgICBpZiAoY2hhcmdlKSB7CisgICAgICAgIGQzX2xheW91dF9mb3JjZUFjY3VtdWxhdGUocSA9IGQzLmdlb20ucXVhZHRyZWUobm9kZXMpLCBhbHBoYSwgY2hhcmdlcyk7CisgICAgICAgIGkgPSAtMTsKKyAgICAgICAgd2hpbGUgKCsraSA8IG4pIHsKKyAgICAgICAgICBpZiAoIShvID0gbm9kZXNbaV0pLmZpeGVkKSB7CisgICAgICAgICAgICBxLnZpc2l0KHJlcHVsc2UobykpOworICAgICAgICAgIH0KKyAgICAgICAgfQorICAgICAgfQorICAgICAgaSA9IC0xOworICAgICAgd2hpbGUgKCsraSA8IG4pIHsKKyAgICAgICAgbyA9IG5vZGVzW2ldOworICAgICAgICBpZiAoby5maXhlZCkgeworICAgICAgICAgIG8ueCA9IG8ucHg7CisgICAgICAgICAgby55ID0gby5weTsKKyAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICBvLnggLT0gKG8ucHggLSAoby5weCA9IG8ueCkpICogZnJpY3Rpb247CisgICAgICAgICAgby55IC09IChvLnB5IC0gKG8ucHkgPSBvLnkpKSAqIGZyaWN0aW9uOworICAgICAgICB9CisgICAgICB9CisgICAgICBldmVudC50aWNrKHsKKyAgICAgICAgdHlwZTogInRpY2siLAorICAgICAgICBhbHBoYTogYWxwaGEKKyAgICAgIH0pOworICAgIH07CisgICAgZm9yY2Uubm9kZXMgPSBmdW5jdGlvbih4KSB7CisgICAgICBpZiAoIWFyZ3VtZW50cy5sZW5ndGgpIHJldHVybiBub2RlczsKKyAgICAgIG5vZGVzID0geDsKKyAgICAgIHJldHVybiBmb3JjZTsKKyAgICB9OworICAgIGZvcmNlLmxpbmtzID0gZnVuY3Rpb24oeCkgeworICAgICAgaWYgKCFhcmd1bWVudHMubGVuZ3RoKSByZXR1cm4gbGlua3M7CisgICAgICBsaW5rcyA9IHg7CisgICAgICByZXR1cm4gZm9yY2U7CisgICAgfTsKKyAgICBmb3JjZS5zaXplID0gZnVuY3Rpb24oeCkgeworICAgICAgaWYgKCFhcmd1bWVudHMubGVuZ3RoKSByZXR1cm4gc2l6ZTsKKyAgICAgIHNpemUgPSB4OworICAgICAgcmV0dXJuIGZvcmNlOworICAgIH07CisgICAgZm9yY2UubGlua0Rpc3RhbmNlID0gZnVuY3Rpb24oeCkgeworICAgICAgaWYgKCFhcmd1bWVudHMubGVuZ3RoKSByZXR1cm4gbGlua0Rpc3RhbmNlOworICAgICAgbGlua0Rpc3RhbmNlID0gZDNfZnVuY3Rvcih4KTsKKyAgICAgIHJldHVybiBmb3JjZTsKKyAgICB9OworICAgIGZvcmNlLmRpc3RhbmNlID0gZm9yY2UubGlua0Rpc3RhbmNlOworICAgIGZvcmNlLmxpbmtTdHJlbmd0aCA9IGZ1bmN0aW9uKHgpIHsKKyAgICAgIGlmICghYXJndW1lbnRzLmxlbmd0aCkgcmV0dXJuIGxpbmtTdHJlbmd0aDsKKyAgICAgIGxpbmtTdHJlbmd0aCA9IGQzX2Z1bmN0b3IoeCk7CisgICAgICByZXR1cm4gZm9yY2U7CisgICAgfTsKKyAgICBmb3JjZS5mcmljdGlvbiA9IGZ1bmN0aW9uKHgpIHsKKyAgICAgIGlmICghYXJndW1lbnRzLmxlbmd0aCkgcmV0dXJuIGZyaWN0aW9uOworICAgICAgZnJpY3Rpb24gPSB4OworICAgICAgcmV0dXJuIGZvcmNlOworICAgIH07CisgICAgZm9yY2UuY2hhcmdlID0gZnVuY3Rpb24oeCkgeworICAgICAgaWYgKCFhcmd1bWVudHMubGVuZ3RoKSByZXR1cm4gY2hhcmdlOworICAgICAgY2hhcmdlID0gdHlwZW9mIHggPT09ICJmdW5jdGlvbiIgPyB4IDogK3g7CisgICAgICByZXR1cm4gZm9yY2U7CisgICAgfTsKKyAgICBmb3JjZS5ncmF2aXR5ID0gZnVuY3Rpb24oeCkgeworICAgICAgaWYgKCFhcmd1bWVudHMubGVuZ3RoKSByZXR1cm4gZ3Jhdml0eTsKKyAgICAgIGdyYXZpdHkgPSB4OworICAgICAgcmV0dXJuIGZvcmNlOworICAgIH07CisgICAgZm9yY2UudGhldGEgPSBmdW5jdGlvbih4KSB7CisgICAgICBpZiAoIWFyZ3VtZW50cy5sZW5ndGgpIHJldHVybiB0aGV0YTsKKyAgICAgIHRoZXRhID0geDsKKyAgICAgIHJldHVybiBmb3JjZTsKKyAgICB9OworICAgIGZvcmNlLmFscGhhID0gZnVuY3Rpb24oeCkgeworICAgICAgaWYgKCFhcmd1bWVudHMubGVuZ3RoKSByZXR1cm4gYWxwaGE7CisgICAgICBpZiAoYWxwaGEpIHsKKyAgICAgICAgaWYgKHggPiAwKSBhbHBoYSA9IHg7IGVsc2UgYWxwaGEgPSAwOworICAgICAgfSBlbHNlIGlmICh4ID4gMCkgeworICAgICAgICBldmVudC5zdGFydCh7CisgICAgICAgICAgdHlwZTogInN0YXJ0IiwKKyAgICAgICAgICBhbHBoYTogYWxwaGEgPSB4CisgICAgICAgIH0pOworICAgICAgICBkMy50aW1lcihmb3JjZS50aWNrKTsKKyAgICAgIH0KKyAgICAgIHJldHVybiBmb3JjZTsKKyAgICB9OworICAgIGZvcmNlLnN0YXJ0ID0gZnVuY3Rpb24oKSB7CisgICAgICBmdW5jdGlvbiBwb3NpdGlvbihkaW1lbnNpb24sIHNpemUpIHsKKyAgICAgICAgdmFyIG5laWdoYm9ycyA9IG5laWdoYm9yKGkpLCBqID0gLTEsIG0gPSBuZWlnaGJvcnMubGVuZ3RoLCB4OworICAgICAgICB3aGlsZSAoKytqIDwgbSkgaWYgKCFpc05hTih4ID0gbmVpZ2hib3JzW2pdW2RpbWVuc2lvbl0pKSByZXR1cm4geDsKKyAgICAgICAgcmV0dXJuIE1hdGgucmFuZG9tKCkgKiBzaXplOworICAgICAgfQorICAgICAgZnVuY3Rpb24gbmVpZ2hib3IoKSB7CisgICAgICAgIGlmICghbmVpZ2hib3JzKSB7CisgICAgICAgICAgbmVpZ2hib3JzID0gW107CisgICAgICAgICAgZm9yIChqID0gMDsgaiA8IG47ICsraikgeworICAgICAgICAgICAgbmVpZ2hib3JzW2pdID0gW107CisgICAgICAgICAgfQorICAgICAgICAgIGZvciAoaiA9IDA7IGogPCBtOyArK2opIHsKKyAgICAgICAgICAgIHZhciBvID0gbGlua3Nbal07CisgICAgICAgICAgICBuZWlnaGJvcnNbby5zb3VyY2UuaW5kZXhdLnB1c2goby50YXJnZXQpOworICAgICAgICAgICAgbmVpZ2hib3JzW28udGFyZ2V0LmluZGV4XS5wdXNoKG8uc291cmNlKTsKKyAgICAgICAgICB9CisgICAgICAgIH0KKyAgICAgICAgcmV0dXJuIG5laWdoYm9yc1tpXTsKKyAgICAgIH0KKyAgICAgIHZhciBpLCBqLCBuID0gbm9kZXMubGVuZ3RoLCBtID0gbGlua3MubGVuZ3RoLCB3ID0gc2l6ZVswXSwgaCA9IHNpemVbMV0sIG5laWdoYm9ycywgbzsKKyAgICAgIGZvciAoaSA9IDA7IGkgPCBuOyArK2kpIHsKKyAgICAgICAgKG8gPSBub2Rlc1tpXSkuaW5kZXggPSBpOworICAgICAgICBvLndlaWdodCA9IDA7CisgICAgICB9CisgICAgICBkaXN0YW5jZXMgPSBbXTsKKyAgICAgIHN0cmVuZ3RocyA9IFtdOworICAgICAgZm9yIChpID0gMDsgaSA8IG07ICsraSkgeworICAgICAgICBvID0gbGlua3NbaV07CisgICAgICAgIGlmICh0eXBlb2Ygby5zb3VyY2UgPT0gIm51bWJlciIpIG8uc291cmNlID0gbm9kZXNbby5zb3VyY2VdOworICAgICAgICBpZiAodHlwZW9mIG8udGFyZ2V0ID09ICJudW1iZXIiKSBvLnRhcmdldCA9IG5vZGVzW28udGFyZ2V0XTsKKyAgICAgICAgZGlzdGFuY2VzW2ldID0gbGlua0Rpc3RhbmNlLmNhbGwodGhpcywgbywgaSk7CisgICAgICAgIHN0cmVuZ3Roc1tpXSA9IGxpbmtTdHJlbmd0aC5jYWxsKHRoaXMsIG8sIGkpOworICAgICAgICArK28uc291cmNlLndlaWdodDsKKyAgICAgICAgKytvLnRhcmdldC53ZWlnaHQ7CisgICAgICB9CisgICAgICBmb3IgKGkgPSAwOyBpIDwgbjsgKytpKSB7CisgICAgICAgIG8gPSBub2Rlc1tpXTsKKyAgICAgICAgaWYgKGlzTmFOKG8ueCkpIG8ueCA9IHBvc2l0aW9uKCJ4Iiwgdyk7CisgICAgICAgIGlmIChpc05hTihvLnkpKSBvLnkgPSBwb3NpdGlvbigieSIsIGgpOworICAgICAgICBpZiAoaXNOYU4oby5weCkpIG8ucHggPSBvLng7CisgICAgICAgIGlmIChpc05hTihvLnB5KSkgby5weSA9IG8ueTsKKyAgICAgIH0KKyAgICAgIGNoYXJnZXMgPSBbXTsKKyAgICAgIGlmICh0eXBlb2YgY2hhcmdlID09PSAiZnVuY3Rpb24iKSB7CisgICAgICAgIGZvciAoaSA9IDA7IGkgPCBuOyArK2kpIHsKKyAgICAgICAgICBjaGFyZ2VzW2ldID0gK2NoYXJnZS5jYWxsKHRoaXMsIG5vZGVzW2ldLCBpKTsKKyAgICAgICAgfQorICAgICAgfSBlbHNlIHsKKyAgICAgICAgZm9yIChpID0gMDsgaSA8IG47ICsraSkgeworICAgICAgICAgIGNoYXJnZXNbaV0gPSBjaGFyZ2U7CisgICAgICAgIH0KKyAgICAgIH0KKyAgICAgIHJldHVybiBmb3JjZS5yZXN1bWUoKTsKKyAgICB9OworICAgIGZvcmNlLnJlc3VtZSA9IGZ1bmN0aW9uKCkgeworICAgICAgc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raSA8IG4pIHsKKyAgICAgICAgICBwb3NpdGlvbihjID0gY2hpbGRyZW5baV0sIHgsIGQgPSBjLnZhbHVlICogZHgsIGR5KTsKKyAgICAgICAgICB4ICs9IGQ7CisgICAgICAgIH0KKyAgICAgIH0KKyAgICB9CisgICAgZnVuY3Rpb24gZGVwdGgobm9kZSkgeworICAgICAgdmFyIGNoaWxkcmVuID0gbm9kZS5jaGlsZHJlbiwgZCA9IDA7CisgICAgICBpZiAoY2hpbGRyZW4gJiYgKG4gPSBjaGlsZHJlbi5sZW5ndGgpKSB7CisgICAgICAgIHZhciBpID0gLTEsIG47CisgICAgICAgIHdoaWxlICgrK2kgPCBuKSBkID0gTWF0aC5tYXgoZCwgZGVwdGgoY2hpbGRyZW5baV0pKTsKKyAgICAgIH0KKyAgICAgIHJldHVybiAxICsgZDsKKyAgICB9CisgICAgZnVuY3Rpb24gcGFydGl0aW9uKGQsIGkpIHsKKyAgICAgIHZhciBub2RlcyA9IGhpZXJhcmNoeS5jYWxsKHRoaXMsIGQsIGkpOworICAgICAgcG9zaXRpb24obm9kZXNbMF0sIDAsIHNpemVbMF0sIHNpemVbMV0gLyBkZXB0aChub2Rlc1swXSkpOworICAgICAgcmV0dXJuIG5vZGVzOworICAgIH0KKyAgICB2YXIgaGllcmFyY2h5ID0gZDMubGF5b3V0LmhpZXJhcmNoeSgpLCBzaXplID0gWyAxLCAxIF07CisgICAgcGFydGl0aW9uLnNpemUgPSBmdW5jdGlvbih4KSB7CisgICAgICBpZiAoIWFyZ3VtZW50cy5sZW5ndGgpIHJldHVybiBzaXplOworICAgICAgc2l6ZSA9IHg7CisgICAgICByZXR1cm4gcGFydGl0aW9uOworICAgIH07CisgICAgcmV0dXJuIGQzX2xheW91dF9oaWVyYXJjaHlSZWJpbmQocGFydGl0aW9uLCBoaWVyYXJjaHkpOworICB9OworICBkMy5sYXlvdXQucGllID0gZnVuY3Rpb24oKSB7CisgICAgZnVuY3Rpb24gcGllKGRhdGEsIGkpIHsKKy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gPSBkM19sYXlvdXRfc3RhY2tZOworICAgIHN0YWNrLnZhbHVlcyA9IGZ1bmN0aW9uKHgpIHsKKyAgICAgIGlmICghYXJndW1lbnRzLmxlbmd0aCkgcmV0dXJuIHZhbHVlczsKKyAgICAgIHZhbHVlcyA9IHg7CisgICAgICByZXR1cm4gc3RhY2s7CisgICAgfTsKKyAgICBzdGFjay5vcmRlciA9IGZ1bmN0aW9uKHgpIHsKKyAgICAgIGlmICghYXJndW1lbnRzLmxlbmd0aCkgcmV0dXJuIG9yZGVyOworICAgICAgb3JkZXIgPSB0eXBlb2YgeCA9PT0gImZ1bmN0aW9uIiA/IHggOiBkM19sYXlvdXRfc3RhY2tPcmRlcnMuZ2V0KHgpIHx8IGQzX2xheW91dF9zdGFja09yZGVyRGVmYXVsdDsKKyAgICAgIHJldHVybiBzdGFjazsKKyAgICB9OworICAgIHN0YWNrLm9mZnNldCA9IGZ1bmN0aW9uKHgpIHsKKyAgICAgIGlmICghYXJndW1lbnRzLmxlbmd0aCkgcmV0dXJuIG9mZnNldDsKKyAgICAgIG9mZnNldCA9IHR5cGVvZiB4ID09PSAiZnVuY3Rpb24iID8geCA6IGQzX2xheW91dF9zdGFja09mZnNldHMuZ2V0KHgpIHx8IGQzX2xheW91dF9zdGFja09mZnNldFplcm87CisgICAgICByZXR1cm4gc3RhY2s7CisgICAgfTsKKyAgICBzdGFjay54ID0gZnVuY3Rpb24oeikgeworICAgICAgaWYgKCFhcmd1bWVudHMubGVuZ3RoKSByZXR1cm4geDsKKyAgICAgIHggPSB6OworICAgICAgcmV0dXJuIHN0YWNrOworICAgIH07CisgICAgc3RhY2sueSA9IGZ1bmN0aW9uKHopIHsKKyAgICAgIGlmICghYXJndW1lbnRzLmxlbmd0aCkgcmV0dXJuIHk7CisgICAgICB5ID0gejsKKyAgICAgIHJldHVybiBzdGFjazsKKyAgICB9OworICAgIHN0YWNrLm91dCA9IGZ1bmN0aW9uKHopIHsKKyAgICAgIGlmICghYXJndW1lbnRzLmxlbmd0aCkgcmV0dXJuIG91dDsKKyAgICAgIG91dCA9IHo7CisgICAgICByZXR1cm4gc3RhY2s7CisgICAgfTsKKyAgICByZXR1cm4gc3RhY2s7CisgIH07CisgIHZhciBkM19sYXlvdXRfc3RhY2tPcmRlcnMgPSBkMy5tYXAoeworICAgICJpbnNpZGUtb3V0IjogZnVuY3Rpb24oZGF0YSkgeworICAgICAgdmFyIG4gPSBkYXRhLmxlbmd0aCwgaSwgaiwgbWF4ID0gZGF0YS5tYXAoZDNfbGF5b3V0X3N0YWNrTWF4SW5kZXgpLCBzdW1zID0gZGF0YS5tYXAoZDNfbGF5b3V0X3N0YWNrUmVkdWNlU3VtKSwgaW5kZXggPSBkMy5yYW5nZShuKS5zb3J0KGZ1bmN0aW9uKGEsIGIpIHsKKyAgICAgICAgcmV0dXJuIG1heFthXSAtIG1heFtiXTsKKyAgICAgIH0pLCB0b3AgPSAwLCBib3R0b20gPSAwLCB0b3BzID0gW10sIGJvdHRvbXMgPSBbXTsKKyAgICAgIGZvciAoaSA9IDA7IGkgPCBuOyArK2kpIHsKKyAgICAgICAgaiA9IGluZGV4W2ldOworICAgICAgICBpZiAodG9wIDwgYm90dG9tKSB7CisgICAgICAgICAgdG9wICs9IHN1bXNbal07CisgICAgICAgICAgdG9wcy5wdXNoKGopOworICAgICAgICB9IGVsc2UgeworICAgICAgICAgIGJvdHRvbSArPSBzdW1zW2pdOworICAgICAgICAgIGJvdHRvbXMucHVzaChqKTsKKyAgICAgICAgfQorICAgICAgfQorICAgICAgcmV0dXJuIGJvdHRvbXMucmV2ZXJzZSgpLmNvbmNhdCh0b3BzKTsKKyAgICB9LAorICAgIHJldmVyc2U6IGZ1bmN0aW9uKGRhdGEpIHsKKyAgICAgIHJldHVybiBkMy5yYW5nZShkYXRhLmxlbmd0aCkucmV2ZXJzZSgpOworICAgIH0sCisgICAgImRlZmF1bHQiOiBkM19sYXlvdXRfc3RhY2tPcmRlckRlZmF1bHQKKyAgfSk7CisgIHZhciBkM19sYXlvdXRfc3RhY2tPZmZzZXRzID0gZDMubWFwKHsKKyAgICBzaWxob3VldHRlOiBmdW5jdGlvbihkYXRhKSB7CisgICAgICB2YXIgbiA9IGRhdGEubGVuZ3RoLCBtID0gZGF0YVswXS5sZW5ndGgsIHN1bXMgPSBbXSwgbWF4ID0gMCwgaSwgaiwgbywgeTAgPSBbXTsKKyAgICAgIGZvciAoaiA9IDA7IGogPCBtOyArK2opIHsKKyAgICAgICAgZm9yIChpID0gMCwgbyA9IDA7IGkgPCBuOyBpKyspIG8gKz0gZGF0YVtpXVtqXVsxXTsKKyAgICAgICAgaWYgKG8gPiBtYXgpIG1heCA9IG87CisgICAgICAgIHN1bXMucHVzaChvKTsKKyAgICAgIH0KKyAgICAgIGZvciAoaiA9IDA7IGogPCBtOyArK2opIHsKKyAgICAgICAgeTBbal0gPSAobWF4IC0gc3Vtc1tqXSkgLyAyOworICAgICAgfQorICAgICAgcmV0dXJuIHkwOworICAgIH0sCisgICAgd2lnZ2xlOiBmdW5jdGlvbihkYXRhKSB7CisgICAgICB2YXIgbiA9IGRhdGEubGVuZ3RoLCB4ID0gZGF0YVswXSwgbSA9IHgubGVuZ3RoLCBtYXggPSAwLCBpLCBqLCBrLCBzMSwgczIsIHMzLCBkeCwgbywgbzAsIHkwID0gW107CisgICAgICB5MFswXSA9IG8gPSBvMCA9IDA7CisgICAgICBmb3IgKGogPSAxOyBqIDwgbTsgKytqKSB7CisgICAgICAgIGZvciAoaSA9IDAsIHMxID0gMDsgaSA8IG47ICsraSkgczEgKz0gZGF0YVtpXVtqXVsxXTsKKyAgICAgICAgZm9yIChpID0gMCwgczIgPSAwLCBkeCA9IHhbal1bMF0gLSB4W2ogLSAxXVswXTsgaSA8IG47ICsraSkgeworICAgICAgICAgIGZvciAoayA9IDAsIHMzID0gKGRhdGFbaV1bal1bMV0gLSBkYXRhW2ldW2ogLSAxXVsxXSkgLyAoMiAqIGR4KTsgayA8IGk7ICsraykgeworICAgICAgICAgICAgcz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sYXlvdXRfaGllcmFyY2h5SW5saW5lID0gZmFsc2U7CisgIGQzLmxheW91dC5wYWNrID0gZnVuY3Rpb24oKSB7CisgICAgZnVuY3Rpb24gcGFjayhkLCBpKSB7CisgICAgICB2YXIgbm9kZXMgPSBoaWVyYXJjaHkuY2FsbCh0aGlzLCBkLCBpKSwgcm9vdCA9IG5vZGVzWzBdOworICAgICAgcm9vdC54ID0gMDsKKyAgICAgIHJvb3QueSA9IDA7CisgICAgICBkM19sYXlvdXRfdHJlZVZpc2l0QWZ0ZXIocm9vdCwgZnVuY3Rpb24oZCkgeworICAgICAgICBkLnIgPSBNYXRoLnNxcnQoZC52YWx1ZSk7CisgICAgICB9KTsKKyAgICAgIGQzX2xheW91dF90cmVlVmlzaXRBZnRlcihyb290LCBkM19sYXlvdXRfcGFja1NpYmxpbmdzKTsKKyAgICAgIHZhciB3ID0gc2l6ZVswXSwgaCA9IHNpemVbMV0sIGsgPSBNYXRoLm1heCgyICogcm9vdC5yIC8gdywgMiAqIHJvb3QuciAvIGgpOworICAgICAgaWYgKHBhZGRpbmcgPiAwKSB7CisgICAgICAgIHZhciBkciA9IHBhZGRpbmcgKiBrIC8gMjsKKyAgICAgICAgZDNfbGF5b3V0X3RyZWVWaXNpdEFmdGVyKHJvb3QsIGZ1bmN0aW9uKGQpIHsKKyAgICAgICAgICBkLnIgKz0gZHI7CisgICAgICAgIH0pOworICAgICAgICBkM19sYXlvdXRfdHJlZVZpc2l0QWZ0ZXIocm9vdCwgZDNfbGF5b3V0X3BhY2tTaWJsaW5ncyk7CisgICAgICAgIGQzX2xheW91dF90cmVlVmlzaXRBZnRlcihyb290LCBmdW5jdGlvbihkKSB7CisgICAgICAgICAgZC5yIC09IGRyOworICAgICAgICB9KTsKKyAgICAgICAgayA9IE1hdGgubWF4KDIgKiByb290LnIgLyB3LCAyICogcm9vdC5yIC8gaCk7CisgICAgICB9CisgICAgICBkM19sYXlvdXRfcGFja1RyYW5zZm9ybShyb290LCB3IC8gMiwg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kcmVuKTsKKyAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICBub2RlLnggPSBwcmV2aW91c05vZGUgPyB4ICs9IHNlcGFyYXRpb24obm9kZSwgcHJldmlvdXNOb2RlKSA6IDA7CisgICAgICAgICAgbm9kZS55ID0gMDsKKyAgICAgICAgICBwcmV2aW91c05vZGUgPSBub2RlOworICAgICAgICB9CisgICAgICB9KTsKKyAgICAgIHZhciBsZWZ0ID0gZDNfbGF5b3V0X2NsdXN0ZXJMZWZ0KHJvb3QpLCByaWdodCA9IGQzX2xheW91dF9jbHVzdGVyUmlnaHQocm9vdCksIHgwID0gbGVmdC54IC0gc2VwYXJhdGlvbihsZWZ0LCByaWdodCkgLyAyLCB4MSA9IHJpZ2h0LnggKyBzZXBhcmF0aW9uKHJpZ2h0LCBsZWZ0KSAvIDI7CisgICAgICBkM19sYXlvdXRfdHJlZVZpc2l0QWZ0ZXIocm9vdCwgZnVuY3Rpb24obm9kZSkgeworICAgICAgICBub2RlLnggPSAobm9kZS54IC0geDApIC8gKHgxIC0geDApICogc2l6ZVswXTsKKyAgICAgICAgbm9kZS55ID0gKDEgLSAocm9vdC55ID8gbm9kZS55IC8gcm9vdC55IDogMSkpICogc2l6ZVsxXTsKKyAgICAgIH0pOworICAgICAgcmV0dXJuIG5vZGVzOworICAgIH0KKyAgICB2YXIgaGllcmFyY2h5ID0gZDMubGF5b3V0LmhpZXJhcmNoeSgpLnNvcnQobnVsbCkudmFsdWUobnVsbCksIHNlcGFyYXRpb24gPSBkM19sYXlvdXRfdHJlZVNlcGFyYXRpb24sIHNpemUgPSBbIDEsIDEgXTsKKyAgICBjbHVzdGVyLnNlcGFyYXRpb24gPSBmdW5jdGlvbih4KSB7CisgICAgICBpZiAoIWFyZ3VtZW50cy5sZW5ndGgpIHJldHVybiBzZXBhcmF0aW9uOworICAgICAgc2VwYXJhdGlvbiA9IHg7CisgICAgICByZXR1cm4gY2x1c3RlcjsKKyAgICB9OworICAgIGNsdXN0ZXIuc2l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ICAgICBpZiAocHJldmlvdXNTaWJsaW5nKSB7CisgICAgICAgICAgICBsYXlvdXQucHJlbGltID0gcHJldmlvdXNTaWJsaW5nLl90cmVlLnByZWxpbSArIHNlcGFyYXRpb24obm9kZSwgcHJldmlvdXNTaWJsaW5nKTsKKyAgICAgICAgICAgIGxheW91dC5tb2QgPSBsYXlvdXQucHJlbGltIC0gbWlkcG9pbnQ7CisgICAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgIGxheW91dC5wcmVsaW0gPSBtaWRwb2ludDsKKyAgICAgICAgICB9CisgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgaWYgKHByZXZpb3VzU2libGluZykgeworICAgICAgICAgICAgbGF5b3V0LnByZWxpbSA9IHByZXZpb3VzU2libGluZy5fdHJlZS5wcmVsaW0gKyBzZXBhcmF0aW9uKG5vZGUsIHByZXZpb3VzU2libGluZyk7CisgICAgICAgICAgfQorICAgICAgICB9CisgICAgICB9CisgICAgICBmdW5jdGlvbiBzZWNvbmRXYWxrKG5vZGUsIHgpIHsKKyAgICAgICAgbm9kZS54ID0gbm9kZS5fdHJlZS5wcmVsaW0gKyB4OworICAgICAgICB2YXIgY2hpbGRyZW4gPSBub2RlLmNoaWxkcmVuOworICAgICAgICBpZiAoY2hpbGRyZW4gJiYgKG4gPSBjaGlsZHJlbi5sZW5ndGgpKSB7CisgICAgICAgICAgdmFyIGkgPSAtMSwgbjsKKyAgICAgICAgICB4ICs9IG5vZGUuX3RyZWUubW9kOworICAgICAgICAgIHdoaWxlICgrK2kgPCBuKSB7CisgICAgICAgICAgICBzZWNvbmRXYWxrKGNoaWxkcmVuW2ldLCB4KTsKKyAgICAgICAgICB9CisgICAgICAgIH0KKyAgICAgIH0KKyAgICAgIGZ1bmN0aW9uIGFwcG9ydGlvbihub2RlLCBwcmV2aW91c1NpYmxpbmcsIGFuY2VzdG9yKSB7CisgICAgICAgIGlmIChwcmV2aW91c1NpYmxpbmcpIHsKKyAgICAgICAgICB2YXIgdmlwID0gbm9kZSwgdm9wID0gbm9kZSwgdmltID0gcHJldmlvdXNTaWJsaW5nLCB2b20gPSBub2RlLnBhcmVudC5jaGlsZHJlblswXSwgc2lwID0gdmlwLl90cmVlLm1vZCwgc29wID0gdm9wLl90cmVlLm1vZCwgc2ltID0gdmltLl90cmVlLm1vZCwgc29tID0gdm9tLl90cmVlLm1vZCwgc2hpZnQ7CisgICAgICAgICAgd2hpbGUgKHZpbSA9IGQzX2xheW91dF90cmVlUmlnaHQodmltKSwgdmlwID0gZDNfbGF5b3V0X3RyZWVMZWZ0KHZpcCksIHZpbSAmJiB2aXApIHsKKyAgICAgICAgICAgIHZvbSA9IGQzX2xheW91dF90cmVlTGVmdCh2b20pOworICAgICAgICAgICAgdm9wID0gZDNfbGF5b3V0X3RyZWVSaWdodCh2b3ApOworICAgICAgICAgICAgdm9wLl90cmVlLmFuY2VzdG9yID0gbm9kZTsKKyAgICAgICAgICAgIHNoaWZ0ID0gdmltLl90cmVlLnByZWxpbSArIHNpbSAtIHZpcC5fdHJlZS5wcmVsaW0gLSBzaXAgKyBzZXBhcmF0aW9uKHZpbSwgdmlwKTsKKyAgICAgICAgICAgIGlmIChzaGlmdCA+IDApIHsKKyAgICAgICAgICAgICAgZDNfbGF5b3V0X3RyZWVNb3ZlKGQzX2xheW91dF90cmVlQW5jZXN0b3IodmltLCBub2RlLCBhbmNlc3RvciksIG5vZGUsIHNoaWZ0KTsKKyAgICAgICAgICAgICAgc2lwICs9IHNoaWZ0OworICAgICAgICAgICAgICBzb3AgKz0gc2hpZnQ7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBzaW0gKz0gdmltLl90cmVlLm1vZDsKKyAgICAgICAgICAgIHNpcCArPSB2aXAuX3RyZWUubW9kOworICAgICAgICAgICAgc29tICs9IHZvbS5fdHJlZS5tb2Q7CisgICAgICAgICAgICBzb3AgKz0gdm9wLl90cmVlLm1vZDsKKyAgICAgICAgICB9CisgICAgICAgICAgaWYgKHZpbSAmJiAhZDNfbGF5b3V0X3RyZWVSaWdodCh2b3ApKSB7CisgICAgICAgICAgICB2b3AuX3RyZWUudGhyZWFkID0gdmltOworICAgICAgICAgICAgdm9wLl90cmVlLm1vZCArPSBzaW0gLSBzb3A7CisgICAgICAgICAgfQorICAgICAgICAgIGlmICh2aXAgJiYgIWQzX2xheW91dF90cmVlTGVmdCh2b20pKSB7CisgICAgICAgICAgICB2b20uX3RyZWUudGhyZWFkID0gdmlwOworICAgICAgICAgICAgdm9tLl90cmVlLm1vZCArPSBzaXAgLSBzb207CisgICAgICAgICAgICBhbmNlc3RvciA9IG5vZGU7CisgICAgICAgICAgfQorICAgICAgICB9CisgICAgICAgIHJldHVybiBhbmNlc3RvcjsKKyAgICAgIH0KKyAgICAgIHZhciBub2RlcyA9IGhpZXJhcmNoeS5jYWxsKHRoaXMsIGQsIGkpLCByb290ID0gbm9kZXNbMF07CisgICAgICBkM19sYXlvdXRfdHJlZVZpc2l0QWZ0ZXIocm9vdCwgZnVuY3Rpb24obm9kZSwgcHJldmlvdXNTaWJsaW5nKSB7CisgICAgICAgIG5vZGUuX3RyZWUgPSB7CisgICAgICAgICAgYW5jZXN0b3I6IG5vZGUsCisgICAgICAgICAgcHJlbGltOiAwLAorICAgICAgICAgIG1vZDogMCwKKyAgICAgICAgICBjaGFuZ2U6IDAsCisgICAgICAgICAgc2hpZnQ6IDAsCisgICAgICAgICAgbnVtYmVyOiBwcmV2aW91c1NpYmxpbmcgPyBwcmV2aW91c1NpYmxpbmcuX3RyZWUubnVtYmVyICsgMSA6IDAKKyAgICAgICAgfTsKKyAgICAgIH0pOworICAgICAgZmlyc3RXYWxrKHJvb3QpOworICAgICAgc2Vjb25kV2Fsayhyb290LCAtcm9vdC5fdHJlZS5wcmVsaW0pOworICAgICAgdmFyIGxlZnQgPSBkM19sYXlvdXRfdHJlZVNlYXJjaChyb290LCBkM19sYXlvdXRfdHJlZUxlZnRtb3N0KSwgcmlnaHQgPSBkM19sYXlvdXRfdHJlZVNlYXJjaChyb290LCBkM19sYXlvdXRfdHJlZVJpZ2h0bW9zdCksIGRlZXAgPSBkM19sYXlvdXRfdHJlZVNlYXJjaChyb290LCBkM19sYXlvdXRfdHJlZURlZXBlc3QpLCB4MCA9IGxlZnQueCAtIHNlcGFyYXRpb24obGVmdCwgcmlnaHQpIC8gMiwgeDEgPSByaWdodC54ICsgc2VwYXJhdGlvbihyaWdodCwgbGVmdCkgLyAyLCB5MSA9IGRlZXAuZGVwdGggfHwgMTsKKyAgICAgIGQzX2xheW91dF90cmVlVmlzaXRBZnRlcihyb290LCBmdW5jdGlvbihub2RlKSB7CisgICAgICAgIG5vZGUueCA9IChub2RlLnggLSB4MCkgLyAoeDEgLSB4MCkgKiBzaXplWzBdOworICAgICAgICBub2RlLnkgPSBub2RlLmRlcHRoIC8geTEgKiBzaXplWzFdOworICAgICAgICBkZWxldGUgbm9kZS5fdHJlZTsKKyAgICAgIH0pOworICAgICAgcmV0dXJuIG5vZGVzOworICAgIH0KKyAgICB2YXIgaGllcmFyY2h5ID0gZDMubGF5b3V0LmhpZXJhcmNoeSgpLnNvcnQobnVsbCkudmFsdWUobnVsbCksIHNlcGFyYXRpb24gPSBkM19sYXlvdXRfdHJlZVNlcGFyYXRpb24sIHNpemUgPSBbIDEsIDEgXTsKKyAgICB0cmVlLnNlcGFyYXRpb24gPSBmdW5jdGlvbih4KSB7CisgICAgICBpZiAoIWFyZ3VtZW50cy5sZW5ndGgpIHJldHVybiBzZXBhcmF0aW9uOworICAgICAgc2VwYXJhdGlvbiA9IHg7CisgICAgICByZXR1cm4gdHJlZTsKKyAgICB9OworICAgIHRyZWUuc2l6ZSA9IGZ1bmN0aW9uKHgpIHsKKyAgICAgIGlmICghYXJndW1lbnRzLmxlbmd0aCkgcmV0dXJuIHNpemU7CisgICAgICBzaXplID0geDsKKyAgICAgIHJldHVybiB0cmVlOworICAgIH07CisgICAgcmV0dXJuIGQzX2xheW91dF9oaWVyYXJjaHlSZWJpbmQodHJlZSwgaGllcmFyY2h5KTsKKyAgfTsKKyAgZDMubGF5b3V0LnRyZWVtYXAgPSBmdW5jdGlvbigpIHsKKyAgICBmdW5jdGlvbiBzY2FsZShjaGlsZHJlbiwgaykgeworICAgICAgdmFyIGkgPSAtMSwgbiA9IGNoaWxkcmVuLmxlbmd0aCwgY2hpbGQsIGFyZWE7CisgICAgICB3aGlsZSAoKytpIDwgbikgeworICAgICAgICBhcmVhID0gKGNoaWxkID0gY2hpbGRyZW5baV0pLnZhbHVlICogKGsgPCAwID8gMCA6IGspOworICAgICAgICBjaGlsZC5hcmVhID0gaXNOYU4oYXJlYSkgfHwgYXJlYSA8PSAwID8gMCA6IGFyZWE7CisgICAgICB9CisgICAgfQorICAgIGZ1bmN0aW9uIHNxdWFyaWZ5KG5vZGUpIHsKKyAgICAgIHZhciBjaGlsZHJlbiA9IG5vZGUuY2hpbGRyZW47CisgICAgICBpZiAoY2hpbGRyZW4gJiYgY2hpbGRyZW4ubGVuZ3RoKSB7CisgICAgICAgIHZhciByZWN0ID0gcGFkKG5vZGUpLCByb3cgPSBbXSwgcmVtYWluaW5nID0gY2hpbGRyZW4uc2xpY2UoKSwgY2hpbGQsIGJlc3QgPSBJbmZpbml0eSwgc2NvcmUsIHUgPSBNYXRoLm1pbihyZWN0LmR4LCByZWN0LmR5KSwgbjsKKyAgICAgICAgc2NhbGUocmVtYWluaW5nLCByZWN0LmR4ICogcmVjdC5keSAvIG5vZGUudmFsdWUpOworICAgICAgICByb3cuYXJlYSA9IDA7CisgICAgICAgIHdoaWxlICgobiA9IHJlbWFpbmluZy5sZW5ndGgpID4gMCkgeworICAgICAgICAgIHJvdy5wdXNoKGNoaWxkID0gcmVtYWluaW5nW24gLSAxXSk7CisgICAgICAgICAgcm93LmFyZWEgKz0gY2hpbGQuYXJlYTsKKyAgICAgICAgICBpZiAoKHNjb3JlID0gd29yc3Qocm93LCB1KSkgPD0gYmVzdCkgeworICAgICAgICAgICAgcmVtYWluaW5nLnBvcCgpOworICAgICAgICAgICAgYmVzdCA9IHNjb3JlOworICAgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICByb3cuYXJlYSAtPSByb3cucG9wKCkuYXJlYTsKKyAgICAgICAgICAgIHBvc2l0aW9uKHJvdywgdSwgcmVjdCwgZmFsc2UpOworICAgICAgICAgICAgdSA9IE1hdGgubWluKHJlY3QuZHgsIHJlY3QuZHkpOworICAgICAgICAgICAgcm93Lmxlbmd0aCA9IHJvdy5hcmVhID0gMDsKKyAgICAgICAgICAgIGJlc3QgPSBJbmZpbml0eTsKKyAgICAgICAgICB9CisgICAgICAgIH0KKyAgICAgICAgaWYgKHJvdy5sZW5ndGgpIHsKKyAgICAgICAgICBwb3NpdGlvbihyb3csIHUsIHJlY3QsIHRydWUpOworICAgICAgICAgIHJvdy5sZW5ndGggPSByb3cuYXJlYSA9IDA7CisgICAgICAgIH0KKyAgICAgICAgY2hpbGRyZW4uZm9yRWFjaChzcXVhcmlmeSk7CisgICAgICB9CisgICAgfQorICAgIGZ1bmN0aW9uIHN0aWNraWZ5KG5vZGUpIHsKKyAgICAgIHZhciBjaGlsZHJlbiA9IG5vZGUuY2hpbGRyZW47CisgICAgICBpZiAoY2hpbGRyZW4gJiYgY2hpbGRyZW4ubGVuZ3RoKSB7CisgICAgICAgIHZhciByZWN0ID0gcGFkKG5vZGUpLCByZW1haW5pbmcgPSBjaGlsZHJlbi5zbGljZSgpLCBjaGlsZCwgcm93ID0gW107CisgICAgICAgIHNjYWxlKHJlbWFpbmluZywgcmVjdC5keCAqIHJlY3QuZHkgLyBub2RlLnZhbHVlKTsKKyAgICAgICAgcm93LmFyZWEgPSAwOworICAgICAgICB3aGlsZSAoY2hpbGQgPSByZW1haW5pbmcucG9wKCkpIHsKKyAgICAgICAgICByb3cucHVzaChjaGlsZCk7CisgICAgICAgICAgcm93LmFyZWEgKz0gY2hpbGQuYXJlYTsKKyAgICAgICAgICBpZiAoY2hpbGQueiAhPSBudWxsKSB7CisgICAgICAgICAgICBwb3NpdGlvbihyb3csIGNoaWxkLnogPyByZWN0LmR4IDogcmVjdC5keSwgcmVjdCwgIXJlbWFpbmluZy5sZW5ndGgpOworICAgICAgICAgICAgcm93Lmxlbmd0aCA9IHJvdy5hcmVhID0gMDsKKyAgICAgICAgICB9CisgICAgICAgIH0KKyAgICAgICAgY2hpbGRyZW4uZm9yRWFjaChzdGlja2lmeSk7CisgICAgICB9CisgICAgfQorICAgIGZ1bmN0aW9uIHdvcnN0KHJvdywgdSkgeworICAgICAgdmFyIHMgPSByb3cuYXJlYSwgciwgcm1heCA9IDAsIHJtaW4gPSBJbmZpbml0eSwgaSA9IC0xLCBuID0gcm93Lmxlbmd0aDsKKyAgICAgIHdoaWxlICgrK2kgPCBuKSB7CisgICAgICAgIGlmICghKHIgPSByb3dbaV0uYXJlYSkpIGNvbnRpbnVlOworICAgICAgICBpZiAociA8IHJtaW4pIHJtaW4gPSByOworICAgICAgICBpZiAociA+IHJtYXgpIHJtYXggPSByOworICAgICAgfQorICAgICAgcyAqPSBzOworICAgICAgdSAqPSB1OworICAgICAgcmV0dXJuIHMgPyBNYXRoLm1heCh1ICogcm1heCAqIHJhdGlvIC8gcywgcyAvICh1ICogcm1pbiAqIHJhdGlvKSkgOiBJbmZpbml0eTsKKyAgICB9CisgICAgZnVuY3Rpb24gcG9zaXRpb24ocm93LCB1LCByZWN0LCBmbHVzaCkgeworICAgICAgdmFyIGkgPSAtMSwgbiA9IHJvdy5sZW5ndGgsIHggPSByZWN0LngsIHkgPSByZWN0LnksIHYgPSB1ID8gcm91bmQocm93LmFyZWEgLyB1KSA6IDAsIG87CisgICAgICBpZiAodSA9PSByZWN0LmR4KSB7CisgICAgICAgIGlmIChmbHVzaCB8fCB2ID4gcmVjdC5keSkgdiA9IHJlY3QuZHk7CisgICAgICAgIHdoaWxlICgrK2kgPCBuKSB7CisgICAgICAgICAgbyA9IHJvd1tpXTsKKyAgICAgICAgICBvLnggPSB4OworICAgICAgICAgIG8ueSA9IHk7CisgICAgICAgICAgby5keSA9IHY7CisgICAgICAgICAgeCArPSBvLmR4ID0gTWF0aC5taW4ocmVjdC54ICsgcmVjdC5keCAtIHgsIHYgPyByb3VuZChvLmFyZWEgLyB2KSA6IDApOworICAgICAgICB9CisgICAgICAgIG8ueiA9IHRydWU7CisgICAgICAgIG8uZHggKz0gcmVjdC54ICsgcmVjdC5keCAtIHg7CisgICAgICAgIHJlY3QueSArPSB2OworICAgICAgICByZWN0LmR5IC09IHY7CisgICAgICB9IGVsc2UgeworICAgICAgICBpZiAoZmx1c2ggfHwgdiA+IHJlY3QuZHgpIHYgPSByZWN0LmR4OworICAgICAgICB3aGlsZSAoKytpIDwgbikgeworICAgICAgICAgIG8gPSByb3dbaV07CisgICAgICAgICAgby54ID0geDsKKyAgICAgICAgICBvLnkgPSB5OworICAgICAgICAgIG8uZHggPSB2OworICAgICAgICAgIHkgKz0gby5keSA9IE1hdGgubWluKHJlY3QueSArIHJlY3QuZHkgLSB5LCB2ID8gcm91bmQoby5hcmVhIC8gdikgOiAwKTsKKyAgICAgICAgfQorICAgICAgICBvLnogPSBmYWxzZTsKKyAgICAgICAgby5keSArPSByZWN0LnkgKyByZWN0LmR5IC0geTsKKyAgICAgICAgcmVjdC54ICs9IHY7CisgICAgICAgIHJlY3QuZHggLT0gdjsKKyAgICAgIH0KKyAgICB9CisgICAgZnVuY3Rpb24gdHJlZW1hcChkKSB7CisgICAgICB2YXIgbm9kZXMgPSBzdGlja2llcyB8fCBoaWVyYXJjaHkoZCksIHJvb3QgPSBub2Rlc1swXTsKKyAgICAgIHJvb3QueCA9IDA7CisgICAgICByb290LnkgPSAwOworICAgICAgcm9vdC5keCA9IHNpemVbMF07CisgICAgICByb290LmR5ID0gc2l6ZVsxXTsKKyAgICAgIGlmIChzdGlja2llcykgaGllcmFyY2h5LnJldmFsdWUocm9vdCk7CisgICAgICBzY2FsZShbIHJvb3QgXSwgcm9vdC5keCAqIHJvb3QuZHkgLyByb290LnZhbHVlKTsKKyAgICAgIChzdGlja2llcyA/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ICAgIHJldHVybiByZWxvYWQoKTsKKyAgICB9OworICAgIGFsYmVycy5wYXJhbGxlbHMgPSBmdW5jdGlvbih4KSB7CisgICAgICBpZiAoIWFyZ3VtZW50cy5sZW5ndGgpIHJldHVybiBwYXJhbGxlbHM7CisgICAgICBwYXJhbGxlbHMgPSBbICt4WzBdLCAreFsxXSBdOworICAgICAgcmV0dXJuIHJlbG9hZCgpOworICAgIH07CisgICAgYWxiZXJzLnNjYWxlID0gZnVuY3Rpb24oeCkgeworICAgICAgaWYgKCFhcmd1bWVudHMubGVuZ3RoKSByZXR1cm4gc2NhbGU7CisgICAgICBzY2FsZSA9ICt4OworICAgICAgcmV0dXJuIGFsYmVyczsKKyAgICB9OworICAgIGFsYmVycy50cmFuc2xhdGUgPSBmdW5jdGlvbih4KSB7CisgICAgICBpZiAoIWFyZ3VtZW50cy5sZW5ndGgpIHJldHVybiB0cmFuc2xhdGU7CisgICAgICB0cmFuc2xhdGUgPSBbICt4WzBdLCAreFsxXSBdOworICAgICAgcmV0dXJuIGFsYmVyczsKKyAgICB9OworICAgIHJldHVybiByZWxvYWQoKTsKKyAgfTsKKyAgZDMuZ2VvLmFsYmVyc1VzYSA9IGZ1bmN0aW9uKCkgeworICAgIGZ1bmN0aW9uIGFsYmVyc1VzYShjb29yZGluYXRlcykgeworICAgICAgdmFyIGxvbiA9IGNvb3JkaW5hdGVzWzBdLCBsYXQgPSBjb29yZGluYXRlc1sxXTsKKyAgICAgIHJldHVybiAobGF0ID4gNTAgPyBhbGFza2EgOiBsb24gPCAtMTQwID8gaGF3YWlpIDogbGF0IDwgMjEgPyBwdWVydG9SaWNvIDogbG93ZXI0OCkoY29vcmRpbmF0ZXMpOworICAgIH0KKyAgICB2YXIgbG93ZXI0OCA9IGQzLmdlby5hbGJlcnMoKTsKKyAgICB2YXIgYWxhc2thID0gZDMuZ2VvLmFsYmVycygpLm9yaWdpbihbIC0xNjAsIDYwIF0pLnBhcmFsbGVscyhbIDU1LCA2NSBdKTsKK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gPSBmZWF0dXJlcy5sZW5ndGg7CisgICAgICAgIHdoaWxlICgrK2kgPCBuKSBidWZmZXIucHVzaChwYXRoVHlwZShmZWF0dXJlc1tpXS5nZW9tZXRyeSkpOworICAgICAgfSwKKyAgICAgIEZlYXR1cmU6IGZ1bmN0aW9uKG8pIHsKKyAgICAgICAgcGF0aFR5cGUoby5nZW9tZXRyeSk7CisgICAgICB9LAorICAgICAgUG9pbnQ6IGZ1bmN0aW9uKG8pIHsKKyAgICAgICAgYnVmZmVyLnB1c2goIk0iLCBwcm9qZWN0KG8uY29vcmRpbmF0ZXMpLCBwb2ludENpcmNsZSk7CisgICAgICB9LAorICAgICAgTXVsdGlQb2ludDogZnVuY3Rpb24obykgeworICAgICAgICB2YXIgY29vcmRpbmF0ZXMgPSBvLmNvb3JkaW5hdGVzLCBpID0gLTEsIG4gPSBjb29yZGluYXRlcy5sZW5ndGg7CisgICAgICAgIHdoaWxlICgrK2kgPCBuKSBidWZmZXIucHVzaCgiTSIsIHByb2plY3QoY29vcmRpbmF0ZXNbaV0pLCBwb2ludENpcmNsZSk7CisgICAgICB9LAorICAgICAgTGluZVN0cmluZzogZnVuY3Rpb24obykgeworICAgICAgICB2YXIgY29vcmRpbmF0ZXMgPSBvLmNvb3JkaW5hdGVzLCBpID0gLTEsIG4gPSBjb29yZGluYXRlcy5sZW5ndGg7CisgICAgICAgIGJ1ZmZlci5wdXNoKCJNIik7CisgICAgICAgIHdoaWxlICgrK2kgPCBuKSBidWZmZXIucHVzaChwcm9qZWN0KGNvb3JkaW5hdGVzW2ldKSwgIkwiKTsKKyAgICAgICAgYnVmZmVyLnBvcCgpOworICAgICAgfSwKKyAgICAgIE11bHRpTGluZVN0cmluZzogZnVuY3Rpb24obykgeworICAgICAgICB2YXIgY29vcmRpbmF0ZXMgPSBvLmNvb3JkaW5hdGVzLCBpID0gLTEsIG4gPSBjb29yZGluYXRlcy5sZW5ndGgsIHN1YmNvb3JkaW5hdGVzLCBqLCBtOworICAgICAgICB3aGlsZSAoKytpIDwgbikgeworICAgICAgICAgIHN1YmNvb3JkaW5hdGVzID0gY29vcmRpbmF0ZXNbaV07CisgICAgICAgICAgaiA9IC0xOworICAgICAgICAgIG0gPSBzdWJjb29yZGluYXRlcy5sZW5ndGg7CisgICAgICAgICAgYnVmZmVyLnB1c2goIk0iKTsKKyAgICAgICAgICB3aGlsZSAoKytqIDwgbSkgYnVmZmVyLnB1c2gocHJvamVjdChzdWJjb29yZGluYXRlc1tqXSksICJMIik7CisgICAgICAgICAgYnVmZmVyLnBvcCgpOworICAgICAgICB9CisgICAgICB9LAorICAgICAgUG9seWdvbjogZnVuY3Rpb24obykgeworICAgICAgICB2YXIgY29vcmRpbmF0ZXMgPSBvLmNvb3JkaW5hdGVzLCBpID0gLTEsIG4gPSBjb29yZGluYXRlcy5sZW5ndGgsIHN1YmNvb3JkaW5hdGVzLCBqLCBtOworICAgICAgICB3aGlsZSAoKytpIDwgbikgeworICAgICAgICAgIHN1YmNvb3JkaW5hdGVzID0gY29vcmRpbmF0ZXNbaV07CisgICAgICAgICAgaiA9IC0xOworICAgICAgICAgIGlmICgobSA9IHN1YmNvb3JkaW5hdGVzLmxlbmd0aCAtIDEpID4gMCkgeworICAgICAgICAgICAgYnVmZmVyLnB1c2goIk0iKTsKKyAgICAgICAgICAgIHdoaWxlICgrK2ogPCBtKSBidWZmZXIucHVzaChwcm9qZWN0KHN1YmNvb3JkaW5hdGVzW2pdKSwgIkwiKTsKKyAgICAgICAgICAgIGJ1ZmZlcltidWZmZXIubGVuZ3RoIC0gMV0gPSAiWiI7CisgICAgICAgICAgfQorICAgICAgICB9CisgICAgICB9LAorICAgICAgTXVsdGlQb2x5Z29uOiBmdW5jdGlvbihvKSB7CisgICAgICAgIHZhciBjb29yZGluYXRlcyA9IG8uY29vcmRpbmF0ZXMsIGkgPSAtMSwgbiA9IGNvb3JkaW5hdGVzLmxlbmd0aCwgc3ViY29vcmRpbmF0ZXMsIGosIG0sIHN1YnN1YmNvb3JkaW5hdGVzLCBrLCBwOworICAgICAgICB3aGlsZSAoKytpIDwgbikgeworICAgICAgICAgIHN1YmNvb3JkaW5hdGVzID0gY29vcmRpbmF0ZXNbaV07CisgICAgICAgICAgaiA9IC0xOworICAgICAgICAgIG0gPSBzdWJjb29yZGluYXRlcy5sZW5ndGg7CisgICAgICAgICAgd2hpbGUgKCsraiA8IG0pIHsKKyAgICAgICAgICAgIHN1YnN1YmNvb3JkaW5hdGVzID0gc3ViY29vcmRpbmF0ZXNbal07CisgICAgICAgICAgICBrID0gLTE7CisgICAgICAgICAgICBpZiAoKHAgPSBzdWJzdWJjb29yZGluYXRlcy5sZW5ndGggLSAxKSA+IDApIHsKKyAgICAgICAgICAgICAgYnVmZmVyLnB1c2goIk0iKTsKKyAgICAgICAgICAgICAgd2hpbGUgKCsrayA8IHApIGJ1ZmZlci5wdXNoKHByb2plY3Qoc3Vic3ViY29vcmRpbmF0ZXNba10pLCAiTCIpOworICAgICAgICAgICAgICBidWZmZXJbYnVmZmVyLmxlbmd0aCAtIDFdID0gIloiOworICAgICAgICAgICAgfQorICAgICAgICAgIH0KKyAgICAgICAgfQorICAgICAgfSwKKyAgICAgIEdlb21ldHJ5Q29sbGVjdGlvbjogZnVuY3Rpb24obykgeworICAgICAgICB2YXIgZ2VvbWV0cmllcyA9IG8uZ2VvbWV0cmllcywgaSA9IC0xLCBuID0gZ2VvbWV0cmllcy5sZW5ndGg7CisgICAgICAgIHdoaWxlICgrK2kgPCBuKSBidWZmZXIucHVzaChwYXRoVHlwZShnZW9tZXRyaWVzW2ldKSk7CisgICAgICB9CisgICAgfSk7CisgICAgdmFyIGFyZWFUeXBlID0gcGF0aC5hcmVhID0gZDNfZ2VvX3R5cGUoeworICAgICAgRmVhdHVyZUNvbGxlY3Rpb246IGZ1bmN0aW9uKG8pIHsKKyAgICAgICAgdmFyIGFyZWEgPSAwLCBmZWF0dXJlcyA9IG8uZmVhdHVyZXMsIGkgPSAtMSwgbiA9IGZlYXR1cmVzLmxlbmd0aDsKKyAgICAgICAgd2hpbGUgKCsraSA8IG4pIGFyZWEgKz0gYXJlYVR5cGUoZmVhdHVyZXNbaV0pOworICAgICAgICByZXR1cm4gYXJlYTsKKyAgICAgIH0sCisgICAgICBGZWF0dXJlOiBmdW5jdGlvbihvKSB7CisgICAgICAgIHJldHVybiBhcmVhVHlwZShvLmdlb21ldHJ5KTsKKyAgICAgIH0sCisgICAgICBQb2x5Z29uOiBmdW5jdGlvbihvKSB7CisgICAgICAgIHJldHVybiBwb2x5Z29uQXJlYShvLmNvb3JkaW5hdGVzKTsKKyAgICAgIH0sCisgICAgICBNdWx0aVBvbHlnb246IGZ1bmN0aW9uKG8pIHsKKyAgICAgICAgdmFyIHN1bSA9IDAsIGNvb3JkaW5hdGVzID0gby5jb29yZGluYXRlcywgaSA9IC0xLCBuID0gY29vcmRpbmF0ZXMubGVuZ3RoOworICAgICAgICB3aGlsZSAoKytpIDwgbikgc3VtICs9IHBvbHlnb25BcmVhKGNvb3JkaW5hdGVzW2ldKTsKKyAgICAgICAgcmV0dXJuIHN1bTsKKyAgICAgIH0sCisgICAgICBHZW9tZXRyeUNvbGxlY3Rpb246IGZ1bmN0aW9uKG8pIHsKKyAgICAgICAgdmFyIHN1bSA9IDAsIGdlb21ldHJpZXMgPSBvLmdlb21ldHJpZXMsIGkgPSAtMSwgbiA9IGdlb21ldHJpZXMubGVuZ3RoOworICAgICAgICB3aGlsZSAoKytpIDwgbikgc3VtICs9IGFyZWFUeXBlKGdlb21ldHJpZXNbaV0pOworICAgICAgICByZXR1cm4gc3VtOworICAgICAgfQorICAgIH0sIDApOworICAgIHZhciBjZW50cm9pZFR5cGUgPSBwYXRoLmNlbnRyb2lkID0gZDNfZ2VvX3R5cGUoeworICAgICAgRmVhdHVyZTogZnVuY3Rpb24obykgeworICAgICAgICByZXR1cm4gY2VudHJvaWRUeXBlKG8uZ2VvbWV0cnkpOworICAgICAgfSwKKyAgICAgIFBvbHlnb246IGZ1bmN0aW9uKG8pIHsKKyAgICAgICAgdmFyIGNlbnRyb2lkID0gcG9seWdvbkNlbnRyb2lkKG8uY29vcmRpbmF0ZXMpOworICAgICAgICByZXR1cm4gWyBjZW50cm9pZFswXSAvIGNlbnRyb2lkWzJdLCBjZW50cm9pZFsxXSAvIGNlbnRyb2lkWzJdIF07CisgICAgICB9LAorICAgICAgTXVsdGlQb2x5Z29uOiBmdW5jdGlvbihvKSB7CisgICAgICAgIHZhciBhcmVhID0gMCwgY29vcmRpbmF0ZXMgPSBvLmNvb3JkaW5hdGVzLCBjZW50cm9pZCwgeCA9IDAsIHkgPSAwLCB6ID0gMCwgaSA9IC0xLCBuID0gY29vcmRpbmF0ZXMubGVuZ3RoOworICAgICAgICB3aGlsZSAoKytpIDwgbikgeworICAgICAgICAgIGNlbnRyb2lkID0gcG9seWdvbkNlbnRyb2lkKGNvb3JkaW5hdGVzW2ldKTsKKyAgICAgICAgICB4ICs9IGNlbnRyb2lkWzBdOworICAgICAgICAgIHkgKz0gY2VudHJvaWRbMV07CisgICAgICAgICAgeiArPSBjZW50cm9pZFsyXTsKKyAgICAgICAgfQorICAgICAgICByZXR1cm4gWyB4IC8geiwgeSAvIHogXTsKKyAgICAgIH0KKyAgICB9KTsKKyAgICBwYXRoLnByb2plY3Rpb24gPSBmdW5jdGlvbih4KSB7CisgICAgICBwcm9qZWN0aW9uID0geDsKKyAgICAgIHJldHVybiBwYXRoOworICAgIH07CisgICAgcGF0aC5wb2ludFJhZGl1cyA9IGZ1bmN0aW9uKHgpIHsKKyAgICAgIGlmICh0eXBlb2YgeCA9PT0gImZ1bmN0aW9uIikgcG9pbnRSYWRpdXMgPSB4OyBlbHNlIHsKKyAgICAgICAgcG9pbnRSYWRpdXMgPSAreDsKKyAgICAgICAgcG9pbnRDaXJjbGUgPSBkM19wYXRoX2NpcmNsZShwb2ludFJhZGl1cyk7CisgICAgICB9CisgICAgICByZXR1cm4gcGF0aDsKKyAgICB9OworICAgIHJldHVybiBwYXRoOworICB9OworICBk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worICAgIGZ1bmN0aW9uIGNpcmNsZSgpIHt9CisgICAgZnVuY3Rpb24gdmlzaWJsZShwb2ludCkgeworICAgICAgcmV0dXJuIGFyYy5kaXN0YW5jZShwb2ludCkgPCByYWRpYW5zOworICAgIH0KKyAgICBmdW5jdGlvbiBjbGlwKGNvb3JkaW5hdGVzKSB7CisgICAgICB2YXIgaSA9IC0xLCBuID0gY29vcmRpbmF0ZXMubGVuZ3RoLCBjbGlwcGVkID0gW10sIHAwLCBwMSwgcDIsIGQwLCBkMTsKKyAgICAgIHdoaWxlICgrK2kgPCBuKSB7CisgICAgICAgIGQxID0gYXJjLmRpc3RhbmNlKHAyID0gY29vcmRpbmF0ZXNbaV0pOworICAgICAgICBpZiAoZDEgPCByYWRpYW5zKSB7CisgICAgICAgICAgaWYgKHAxKSBjbGlwcGVkLnB1c2goZDNfZ2VvX2dyZWF0QXJjSW50ZXJwb2xhdGUocDEsIHAyKSgoZDAgLSByYWRpYW5zKSAvIChkMCAtIGQxKSkpOworICAgICAgICAgIGNsaXBwZWQucHVzaChwMik7CisgICAgICAgICAgcDAgPSBwMSA9IG51bGw7CisgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgcDEgPSBwMjsKKyAgICAgICAgICBpZiAoIXAwICYmIGNsaXBwZWQubGVuZ3RoKSB7CisgICAgICAgICAgICBjbGlwcGVkLnB1c2goZDNfZ2VvX2dyZWF0QXJjSW50ZXJwb2xhdGUoY2xpcHBlZFtjbGlwcGVkLmxlbmd0aCAtIDFdLCBwMSkoKHJhZGlhbnMgLSBkMCkgLyAoZDEgLSBkMCkpKTsKKyAgICAgICAgICAgIHAwID0gcDE7CisgICAgICAgICAgfQorICAgICAgICB9CisgICAgICAgIGQwID0gZDE7CisgICAgICB9CisgICAgICBwMCA9IGNvb3JkaW5hdGVzWzBdOworICAgICAgcDEgPSBjbGlwcGVkWzBdOworICAgICAgaWYgKHAxICYmIHAyWzBdID09PSBwMFswXSAmJiBwMlsxXSA9PT0gcDBbMV0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cmVhdGUobyksIG8uY29vcmRpbmF0ZXMgPSBjb29yZGluYXRlcywgbyk7CisgICAgICB9LAorICAgICAgTXVsdGlMaW5lU3RyaW5nOiBmdW5jdGlvbihvKSB7CisgICAgICAgIHZhciBjb29yZGluYXRlcyA9IG8uY29vcmRpbmF0ZXMubWFwKGNsaXApLmZpbHRlcihmdW5jdGlvbihkKSB7CisgICAgICAgICAgcmV0dXJuIGQubGVuZ3RoOworICAgICAgICB9KTsKKyAgICAgICAgcmV0dXJuIGNvb3JkaW5hdGVzLmxlbmd0aCAmJiAobyA9IE9iamVjdC5jcmVhdGUobyksIG8uY29vcmRpbmF0ZXMgPSBjb29yZGluYXRlcywgbyk7CisgICAgICB9LAorICAgICAgUG9seWdvbjogZnVuY3Rpb24obykgeworICAgICAgICB2YXIgY29vcmRpbmF0ZXMgPSBvLmNvb3JkaW5hdGVzLm1hcChjbGlwKTsKKyAgICAgICAgcmV0dXJuIGNvb3JkaW5hdGVzWzBdLmxlbmd0aCAmJiAobyA9IE9iamVjdC5jcmVhdGUobyksIG8uY29vcmRpbmF0ZXMgPSBjb29yZGluYXRlcywgbyk7CisgICAgICB9LAorICAgICAgTXVsdGlQb2x5Z29uOiBmdW5jdGlvbihvKSB7CisgICAgICAgIHZhciBjb29yZGluYXRlcyA9IG8uY29vcmRpbmF0ZXMubWFwKGZ1bmN0aW9uKGQpIHsKKyAgICAgICAgICByZXR1cm4gZC5tYXAoY2xpcCk7CisgICAgICAgIH0pLmZpbHRlcihmdW5jdGlvbihkKSB7CisgICAgICAgICAgcmV0dXJuIGRbMF0ubGVuZ3RoOworICAgICAgICB9KTsKKyAgICAgICAgcmV0dXJuIGNvb3JkaW5hdGVzLmxlbmd0aCAmJiAobyA9IE9iamVjdC5jcmVhdGUobyksIG8uY29vcmRpbmF0ZXMgPSBjb29yZGluYXRlcywgbyk7CisgICAgICB9LAorICAgICAgR2VvbWV0cnlDb2xsZWN0aW9uOiBmdW5jdGlvbihvKSB7CisgICAgICAgIH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XVsxXSkgeworICAgICAgICBoID0gdmVydGljZXNbaV1bMF0gPCB2ZXJ0aWNlc1toXVswXSA/IGkgOiBoOworICAgICAgfQorICAgIH0KKyAgICBmb3IgKGkgPSAwOyBpIDwgbGVuOyArK2kpIHsKKyAgICAgIGlmIChpID09PSBoKSBjb250aW51ZTsKKyAgICAgIHkxID0gdmVydGljZXNbaV1bMV0gLSB2ZXJ0aWNlc1toXVsxXTsKKyAgICAgIHgxID0gdmVydGljZXNbaV1bMF0gLSB2ZXJ0aWNlc1toXVswXTsKKyAgICAgIHBvaW50cy5wdXNoKHsKKyAgICAgICAgYW5nbGU6IE1hdGguYXRhbjIoeTEsIHgxKSwKKyAgICAgICAgaW5kZXg6IGkKKyAgICAgIH0pOworICAgIH0KKyAgICBwb2ludHMuc29ydChmdW5jdGlvbihhLCBiKSB7CisgICAgICByZXR1cm4gYS5hbmdsZSAtIGIuYW5nbGU7CisgICAgfSk7CisgICAgYSA9IHBvaW50c1swXS5hbmdsZTsKKyAgICB2ID0gcG9pbnRzWzBdLmluZGV4OworICAgIHUgPSAwOworICAgIGZvciAoaSA9IDE7IGkgPCBwbGVuOyArK2kpIHsKKyAgICAgIGogPSBwb2ludHNbaV0uaW5kZXg7CisgICAgICBpZiAoYSA9PSBwb2ludHNbaV0uYW5nbGUpIHsKKyAgICAgICAgeDEgPSB2ZXJ0aWNlc1t2XVswXSAtIHZlcnRpY2VzW2hdWzBdOworICAgICAgICB5MSA9IHZlcnRpY2VzW3ZdWzFdIC0gdmVydGljZXNbaF1bMV07CisgICAgICAgIHgyID0gdmVydGljZXNbal1bMF0gLSB2ZXJ0aWNlc1toXVswXTsKKyAgICAgICAgeTIgPSB2ZXJ0aWNlc1tqXVsxXSAtIHZlcnRpY2VzW2hdWzFdOworICAgICAgICBpZiAoeDEgKiB4MSArIHkxICogeTEgPj0geDIgKiB4MiArIHkyICogeTIpIHsKKyAgICAgICAgICBwb2ludHNbaV0uaW5kZXggPSAtMTsKKyAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICBwb2ludHNbdV0uaW5kZXggPSAtMTsKKyAgICAgICAgICBhID0gcG9pbnRzW2ldLmFuZ2xlOworICAgICAgICAgIHUgPSBpOworICAgICAgICAgIHYgPSBqOworICAgICAgICB9CisgICAgICB9IGVsc2UgeworICAgICAgICBhID0gcG9pbnRzW2ldLmFuZ2xlOworICAgICAgICB1ID0gaTsKKyAgICAgICAgdiA9IGo7CisgICAgICB9CisgICAgfQorICAgIHN0YWNrLnB1c2goaCk7CisgICAgZm9yIChpID0gMCwgaiA9IDA7IGkgPCAyOyArK2opIHsKKyAgICAgIGlmIChwb2ludHNbal0uaW5kZXggIT09IC0xKSB7CisgICAgICAgIHN0YWNrLnB1c2gocG9pbnRzW2pdLmluZGV4KTsKKyAgICAgICAgaSsrOworICAgICAgfQorICAgIH0KKyAgICBzcCA9IHN0YWNrLmxlbmd0aDsKKyAgICBmb3IgKDsgaiA8IHBsZW47ICsraikgeworICAgICAgaWYgKHBvaW50c1tqXS5pbmRleCA9PT0gLTEpIGNvbnRpbnVlOworICAgICAgd2hpbGUgKCFkM19nZW9tX2h1bGxDQ1coc3RhY2tbc3AgLSAyXSwgc3RhY2tbc3AgLSAxXSwgcG9pbnRzW2pdLmluZGV4LCB2ZXJ0aWNlcykpIHsKKyAgICAgICAgLS1zcDsKKyAgICAgIH0KKyAgICAgIHN0YWNrW3NwKytdID0gcG9pbnRzW2pdLmluZGV4OworICAgIH0KKyAgICB2YXIgcG9seSA9IFtdOworICAgIGZvciAoaSA9IDA7IGkgPCBzcDsgKytpKSB7CisgICAgICBwb2x5LnB1c2godmVydGljZXNbc3RhY2tbaV1dKTsKKyAgICB9CisgICAgcmV0dXJuIHBvbHk7CisgIH07CisgIGQzLmdlb20ucG9seWdvbiA9IGZ1bmN0aW9uKGNvb3JkaW5hdGVzKSB7CisgICAgY29vcmRpbmF0ZXMuYXJlYSA9IGZ1bmN0aW9uKCkgeworICAgICAgdmFyIGkgPSAwLCBuID0gY29vcmRpbmF0ZXMubGVuZ3RoLCBhID0gY29vcmRpbmF0ZXNbbiAtIDFdWzBdICogY29vcmRpbmF0ZXNbMF1bMV0sIGIgPSBjb29yZGluYXRlc1tuIC0gMV1bMV0gKiBjb29yZGluYXRlc1swXVswXTsKKyAgICAgIHdoaWxlICgrK2kgPCBuKSB7CisgICAgICAgIGEgKz0gY29vcmRpbmF0ZXNbaSAtIDFdWzBdICogY29vcmRpbmF0ZXNbaV1bMV07CisgICAgICAgIGIgKz0gY29vcmRpbmF0ZXNbaSAtIDFdWzFdICogY29vcmRpbmF0ZXNbaV1bMF07CisgICAgICB9CisgICAgICByZXR1cm4gKGIgLSBhKSAqIC41OworICAgIH07CisgICAgY29vcmRpbmF0ZXMuY2VudHJvaWQgPSBmdW5jdGlvbihrKSB7CisgICAgICB2YXIgaSA9IC0xLCBuID0gY29vcmRpbmF0ZXMubGVuZ3RoLCB4ID0gMCwgeSA9IDAsIGEsIGIgPSBjb29yZGluYXRlc1tuIC0gMV0sIGM7CisgICAgICBpZiAoIWFyZ3VtZW50cy5sZW5ndGgpIGsgPSAtMSAvICg2ICogY29vcmRpbmF0ZXMuYXJlYSgpKTsKKyAgICAgIHdoaWxlICgrK2kgPCBuKSB7CisgICAgICAgIGEgPSBiOworICAgICAgICBiID0gY29vcmRpbmF0ZXNbaV07CisgICAgICAgIGMgPSBhWzBdICogYlsxXSAtIGJbMF0gKiBhWzFdOworICAgICAgICB4ICs9IChhWzBdICsgYlswXSkgKiBjOworICAgICAgICB5ICs9IChhWzFdICsgYlsxXSkgKiBjOworICAgICAgfQorICAgICAgcmV0dXJuIFsgeCAqIGssIHkgKiBrIF07CisgICAgfTsKKyAgICBjb29yZGluYXRlcy5jbGlwID0gZnVuY3Rpb24oc3ViamVjdCkgeworICAgICAgdmFyIGlucHV0LCBpID0gLTEsIG4gPSBjb29yZGluYXRlcy5sZW5ndGgsIGosIG0sIGEgPSBjb29yZGluYXRlc1tuIC0gMV0sIGIsIGMsIGQ7CisgICAgICB3aGlsZSAoKytpIDwgbikgeworICAgICAgICBpbnB1dCA9IHN1YmplY3Quc2xpY2UoKTsKKyAgICAgICAgc3ViamVjdC5sZW5ndGggPSAwOworICAgICAgICBiID0gY29vcmRpbmF0ZXNbaV07CisgICAgICAgIGMgPSBpbnB1dFsobSA9IGlucHV0Lmxlbmd0aCkgLSAxXTsKKyAgICAgICAgaiA9IC0xOworICAgICAgICB3aGlsZSAoKytqIDwgbSkgeworICAgICAgICAgIGQgPSBpbnB1dFtqXTsKKyAgICAgICAgICBpZiAoZDNfZ2VvbV9wb2x5Z29uSW5zaWRlKGQsIGEsIGIpKSB7CisgICAgICAgICAgICBpZiAoIWQzX2dlb21fcG9seWdvbkluc2lkZShjLCBhLCBiKSkgeworICAgICAgICAgICAgICBzdWJqZWN0LnB1c2goZDNfZ2VvbV9wb2x5Z29uSW50ZXJzZWN0KGMsIGQsIGEsIGIpKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIHN1YmplY3QucHVzaChkKTsKKyAgICAgICAgICB9IGVsc2UgaWYgKGQzX2dlb21fcG9seWdvbkluc2lkZShjLCBhLCBiKSkgeworICAgICAgICAgICAgc3ViamVjdC5wdXNoKGQzX2dlb21fcG9seWdvbkludGVyc2VjdChjLCBkLCBhLCBiKSk7CisgICAgICAgICAgfQorICAgICAgICAgIGMgPSBkOworICAgICAgICB9CisgICAgICAgIGEgPSBiOworICAgICAgfQorICAgICAgcmV0dXJuIHN1YmplY3Q7CisgICAgfTsKKyAgICByZXR1cm4gY29vcmRpbmF0ZXM7CisgIH07CisgIGQzLmdlb20udm9yb25vaSA9IGZ1bmN0aW9uKHZlcnRpY2VzKSB7CisgICAgdmFyIHBvbHlnb25zID0gdmVydGljZXMubWFwKGZ1bmN0aW9uKCkgeworICAgICAgcmV0dXJuIFtdOworICAgIH0pOworICAgIGQzX3Zvcm9ub2lfdGVzc2VsbGF0ZSh2ZXJ0aWNlcywgZnVuY3Rpb24oZSkgeworICAgICAgdmFy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dXNoKFsgdiwgZWRnZVtqXSwgZWRnZVtqICsgMV0gXSk7CisgICAgICB9CisgICAgfSk7CisgICAgcmV0dXJuIHRyaWFuZ2xlczsKKyAgfTsKKyAgZDMuZ2VvbS5xdWFkdHJlZSA9IGZ1bmN0aW9uKHBvaW50cywgeDEsIHkxLCB4MiwgeTIpIHsKKyAgICBmdW5jdGlvbiBpbnNlcnQobiwgcCwgeDEsIHkxLCB4MiwgeTIpIHsKKyAgICAgIGlmIChpc05hTihwLngpIHx8IGlzTmFOKHAueSkpIHJldHVybjsKKyAgICAgIGlmIChuLmxlYWYpIHsKKyAgICAgICAgdmFyIHYgPSBuLnBvaW50OworICAgICAgICBpZiAodikgeworICAgICAgICAgIGlmIChNYXRoLmFicyh2LnggLSBwLngpICsgTWF0aC5hYnModi55IC0gcC55KSA8IC4wMSkgeworICAgICAgICAgICAgaW5zZXJ0Q2hpbGQobiwgcCwgeDEsIHkxLCB4MiwgeTIpOworICAgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICBuLnBvaW50ID0gbnVsbDsKKyAgICAgICAgICAgIGluc2VydENoaWxkKG4sIHYsIHgxLCB5MSwgeDIsIHkyKTsKKyAgICAgICAgICAgIGluc2VydENoaWxkKG4sIHAsIHgxLCB5MSwgeDIsIHkyKTsKKyAgICAgICAgICB9CisgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgbi5wb2ludCA9IHA7CisgICAgICAgIH0KKyAgICAgIH0gZWxzZSB7CisgICAgICAgIGluc2VydENoaWxkKG4sIHAsIHgxLCB5MSwgeDIsIHkyKTsKKyAgICAgIH0KKyAgICB9CisgICAgZnVuY3Rpb24gaW5zZXJ0Q2hpbGQobiwgcCwgeDEsIHkxLCB4MiwgeTIpIHsKKyAgICAgIHZhciBzeCA9ICh4MSArIHgyKSAqIC41LCBzeSA9ICh5MSArIHkyKSAqIC41LCByaWdodCA9IHAueCA+PSBzeCwgYm90dG9tID0gcC55ID49IHN5LCBpID0gKGJvdHRvbSA8PCAxKSArIHJpZ2h0OworICAgICAgbi5sZWFmID0gZmFsc2U7CisgICAgICBuID0gbi5ub2Rlc1tpXSB8fCAobi5ub2Rlc1tpXSA9IGQzX2dlb21fcXVhZHRyZWVOb2RlKCkpOworICAgICAgaWYgKHJpZ2h0KSB4MSA9IHN4OyBlbHNlIHgyID0gc3g7CisgICAgICBpZiAoYm90dG9tKSB5MSA9IHN5OyBlbHNlIHkyID0gc3k7CisgICAgICBpbnNlcnQobiwgcCwgeDEsIHkxLCB4MiwgeTIpOworICAgIH0KKyAgICB2YXIgcCwgaSA9IC0xLCBuID0gcG9pbnRzLmxlbmd0aDsKKyAgICBpZiAobiAmJiBpc05hTihwb2ludHNbMF0ueCkpIHBvaW50cyA9IHBvaW50cy5tYXAoZDNfZ2VvbV9xdWFkdHJlZVBvaW50KTsKKyAgICBpZiAoYXJndW1lbnRzLmxlbmd0aCA8IDUpIHsKKyAgICAgIGlmIChhcmd1bWVudHMubGVuZ3RoID09PSAzKSB7CisgICAgICAgIHkyID0geDIgPSB5MTsKKyAgICAgICAgeTEgPSB4MTsKKyAgICAgIH0gZWxzZSB7CisgICAgICAgIHgxID0geTEgPSBJbmZpbml0eTsKKyAgICAgICAgeDIgPSB5MiA9IC1JbmZpbml0eTsKKyAgICAgICAgd2hpbGUgKCsraSA8IG4pIHsKKyAgICAgICAgICBwID0gcG9pbnRzW2ldOworICAgICAgICAgIGlmIChwLnggPCB4MSkgeDEgPSBwLng7CisgICAgICAgICAgaWYgKHAueSA8IHkxKSB5MSA9IHAueTsKKyAgICAgICAgICBpZiAocC54ID4geDIpIHgyID0gcC54OworICAgICAgICAgIGlmIChwLnkgPiB5MikgeTIgPSBwLnk7CisgICAgICAgIH0KKyAgICAgICAgdmFyIGR4ID0geDIgLSB4MSwgZHkgPSB5MiAtIHkxOworICAgICAgICBpZiAoZHggPiBkeSkgeTIgPSB5MSArIGR4OyBlbHNlIHgyID0geDEgKyBkeTsKKyAgICAgIH0KKyAgICB9CisgICAgdmF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iwgIk9jdG9iZXIiLCAiTm92ZW1iZXIiLCAiRGVjZW1iZXIiIF0sIGQzX3RpbWVfbW9udGhBYmJyZXZpYXRpb25zID0gZDNfdGltZV9tb250aHMubWFwKGQzX3RpbWVfZm9ybWF0QWJicmV2aWF0ZSk7CisgIGQzLnRpbWUuZm9ybWF0ID0gZnVuY3Rpb24odGVtcGxhdGUpIHsKKyAgICBmdW5jdGlvbiBmb3JtYXQoZGF0ZSkgeworICAgICAgdmFyIHN0cmluZyA9IFtdLCBpID0gLTEsIGogPSAwLCBjLCBmOworICAgICAgd2hpbGUgKCsraSA8IG4pIHsKKyAgICAgICAgaWYgKHRlbXBsYXRlLmNoYXJDb2RlQXQoaSkgPT0gMzcpIHsKKyAgICAgICAgICBzdHJpbmcucHVzaCh0ZW1wbGF0ZS5zdWJzdHJpbmcoaiwgaSksIChmID0gZDNfdGltZV9mb3JtYXRzW2MgPSB0ZW1wbGF0ZS5jaGFyQXQoKytpKV0pID8gZihkYXRlKSA6IGMpOworICAgICAgICAgIGogPSBpICsgMTsKKyAgICAgICAgfQorICAgICAgfQorICAgICAgc3RyaW5nLnB1c2godGVtcGxhdGUuc3Vic3RyaW5nKGosIGkpKTsKKyAgICAgIHJldHVybiBzdHJpbmcuam9pbigiIik7CisgICAgfQorICAgIHZhciBuID0gdGVtcGxhdGUubGVuZ3RoOworICAgIGZvcm1hdC5wYXJzZSA9IGZ1bmN0aW9uKHN0cmluZykgeworICAgICAgdmFyIGQgPSB7CisgICAgICAgIHk6IDE5MDAsCisgICAgICAgIG06IDAsCisgICAgICAgIGQ6IDEsCisgICAgICAgIEg6IDAsCisgICAgICAgIE06IDAsCisgICAgICAgIFM6IDAsCisgICAgICAgIEw6IDAKKyAgICAgIH0sIGkgPSBkM190aW1lX3BhcnNlKGQsIHRlbXBsYXRlLCBzdHJpbmcsIDApOworICAgICAgaWYgKGkgIT0gc3RyaW5nLmxlbmd0aCkgcmV0dXJuIG51bGw7CisgICAgICBpZiAoInAiIGluIGQpIGQuSCA9IGQuSCAlIDEyICsgZC5wICogMTI7CisgICAgICB2YXIgZGF0ZSA9IG5ldyBkM190aW1lOworICAgICAgZGF0ZS5zZXRGdWxsWWVhcihkLnksIGQubSwgZC5kKTsKKyAgICAgIGRhdGUuc2V0SG91cnMoZC5ILCBkLk0sIGQuUywgZC5MKTsKKyAgICAgIHJldHVybiBkYXRlOworICAgIH07CisgICAgZm9ybWF0LnRvU3RyaW5nID0gZnVuY3Rpb24oKSB7CisgICAgICByZXR1cm4gdGVtcGxhdGU7CisgICAgfTsKKyAgICByZXR1cm4gZm9ybWF0OworICB9OworICB2YXIgZDNfdGltZV96ZmlsbDIgPSBkMy5mb3JtYXQoIjAyZCIpLCBkM190aW1lX3pmaWxsMyA9IGQzLmZvcm1hdCgiMDNkIiksIGQzX3RpbWVfemZpbGw0ID0gZDMuZm9ybWF0KCIwNGQiKSwgZDNfdGltZV9zZmlsbDIgPSBkMy5mb3JtYXQoIjJkIik7CisgIHZhciBkM190aW1lX2RheVJlID0gZDNfdGltZV9mb3JtYXRSZShkM190aW1lX2RheXMpLCBkM190aW1lX2RheUFiYnJldlJlID0gZDNfdGltZV9mb3JtYXRSZShkM190aW1lX2RheUFiYnJldmlhdGlvbnMpLCBkM190aW1lX21vbnRoUmUgPSBkM190aW1lX2Zvcm1hdFJlKGQzX3RpbWVfbW9udGhzKSwgZDNfdGltZV9tb250aExvb2t1cCA9IGQzX3RpbWVfZm9ybWF0TG9va3VwKGQzX3RpbWVfbW9udGhzKSwgZDNfdGltZV9tb250aEFiYnJldlJlID0gZDNfdGltZV9mb3JtYXRSZShkM190aW1lX21vbnRoQWJicmV2aWF0aW9ucyksIGQzX3RpbWVfbW9udGhBYmJyZXZMb29rdXAgPSBkM190aW1lX2Zvcm1hdExvb2t1cChkM190aW1lX21vbnRoQWJicmV2aWF0aW9ucyk7CisgIHZhciBkM190aW1lX2Zvcm1hdHMgPSB7CisgICAgYTogZnVuY3Rpb24oZCkgeworICAgICAgcmV0dXJuIGQzX3RpbWVfZGF5QWJicmV2aWF0aW9uc1tkLmdldERheSgpXTsKKyAgICB9LAorICAgIEE6IGZ1bmN0aW9uKGQpIHsKKyAgICAgIHJldHVybiBkM190aW1lX2RheXNbZC5nZXREYXkoKV07CisgICAgfSwKKyAgICBiOiBmdW5jdGlvbihkKSB7CisgICAgICByZXR1cm4gZDNfdGltZV9tb250aEFiYnJldmlhdGlvbnNbZC5nZXRNb250aCgpXTsKKyAgICB9LAorICAgIEI6IGZ1bmN0aW9uKGQpIHsKKyAgICAgIHJldHVybiBkM190aW1lX21vbnRoc1tkLmdldE1vbnRoKCldOworICAgIH0sCisgICAgYzogZDMudGltZS5mb3JtYXQoZDNfdGltZV9mb3JtYXREYXRlVGltZSksCisgICAgZDogZnVuY3Rpb24oZCkgeworICAgICAgcmV0dXJuIGQzX3RpbWVfemZpbGwyKGQuZ2V0RGF0ZSgpKTsKKyAgICB9LAorICAgIGU6IGZ1bmN0aW9uKGQpIHsKKyAgICAgIHJldHVybiBkM190aW1lX3NmaWxsMihkLmdldERhdGUoKSk7CisgICAgfSwKKyAgICBIOiBmdW5jdGlvbihkKSB7CisgICAgICByZXR1cm4gZDNfdGltZV96ZmlsbDIoZC5nZXRIb3VycygpKTsKKyAgICB9LAorICAgIEk6IGZ1bmN0aW9uKGQpIHsKKyAgICAgIHJldHVybiBkM190aW1lX3pmaWxsMihkLmdldEhvdXJzKCkgJSAxMiB8fCAxMik7CisgICAgfSwKKyAgICBqOiBmdW5jdGlvbihkKSB7CisgICAgICByZXR1cm4gZDNfdGltZV96ZmlsbDMoMSArIGQzLnRpbWUuZGF5T2ZZZWFyKGQpKTsKKyAgICB9LAorICAgIEw6IGZ1bmN0aW9uKGQpIHsKKyAgICAgIHJldHVybiBkM190aW1lX3pmaWxsMyhkLmdldE1pbGxpc2Vjb25kcygpKTsKKyAgICB9LAorICAgIG06IGZ1bmN0aW9uKGQpIHsKKyAgICAgIHJldHVybiBkM190aW1lX3pmaWxsMihkLmdldE1vbnRoKCkgKyAxKTsKKyAgICB9LAorICAgIE06IGZ1bmN0aW9uKGQpIHsKKyAgICAgIHJldHVybiBkM190aW1lX3pmaWxsMihkLmdldE1pbnV0ZXMoKSk7CisgICAgfSwKKyAgICBwOiBmdW5jdGlvbihkKSB7CisgICAgICByZXR1cm4gZC5nZXRIb3VycygpID49IDEyID8gIlBNIiA6ICJBTSI7CisgICAgfSwKKyAgICBTOiBmdW5jdGlvbihkKSB7CisgICAgICByZXR1cm4gZDNfdGltZV96ZmlsbDIoZC5nZXRTZWNvbmRzKCkpOworICAgIH0sCisgICAgVTogZnVuY3Rpb24oZCkgeworICAgICAgcmV0dXJuIGQzX3RpbWVfemZpbGwyKGQzLnRpbWUuc3VuZGF5T2ZZZWFyKGQpKTsKKyAgICB9LAorICAgIHc6IGZ1bmN0aW9uKGQpIHsKKyAgICAgIHJldHVybiBkLmdldERheSgpOworICAgIH0sCisgICAgVzogZnVuY3Rpb24oZCkgeworICAgICAgcmV0dXJuIGQzX3RpbWVfemZpbGwyKGQzLnRpbWUubW9uZGF5T2ZZZWFyKGQpKTsKKyAgICB9LAorICAgIHg6IGQzLnRpbWUuZm9ybWF0KGQzX3RpbWVfZm9ybWF0RGF0ZSksCisgICAgWDogZDMudGltZS5mb3JtYXQoZDNfdGltZV9mb3JtYXRUaW1lKSwKKyAgICB5OiBmdW5jdGlvbihkKSB7CisgICAgICByZXR1cm4gZDNfdGltZV96ZmlsbDIoZC5nZXRGdWxsWWVhcigpICUgMTAwKTsKKyAgICB9LAorICAgIFk6IGZ1bmN0aW9uKGQpIHsKKyAgICAgIHJldHVybiBkM190aW1lX3pmaWxsNChkLmdldEZ1bGxZZWFyKCkgJSAxZTQpOworICAgIH0sCisgICAgWjogZDNfdGltZV96b25lLAorICAgICIlIjogZnVuY3Rpb24oZCkgeworICAgICAgcmV0dXJuICIlIjsKKyAgICB9CisgIH07CisgIHZhciBkM190aW1lX3BhcnNlcnMgPSB7CisgICAgYTogZDNfdGltZV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eTogZC55LCB6OiAxfTsKKyAgICAgICAgdmFyIGsgPSBrMCAqICgxIC0gTWF0aC5leHAoLWRkICogazEpKSAvIGRkICogLjc1ICsgLjI1OworICAgICAgICByZXR1cm4ge3g6IGZvY3VzWzBdICsgZHggKiBrLCB5OiBmb2N1c1sxXSArIGR5ICogaywgejogTWF0aC5taW4oaywgMTApfTsKKyAgICAgIH0KKworICAgICAgZnVuY3Rpb24gcmVzY2FsZSgpIHsKKyAgICAgICAgazAgPSBNYXRoLmV4cChkaXN0b3J0aW9uKTsKKyAgICAgICAgazAgPSBrMCAvIChrMCAtIDEpICogcmFkaXVzOworICAgICAgICBrMSA9IGRpc3RvcnRpb24gLyByYWRpdXM7CisgICAgICAgIHJldHVybiBmaXNoZXllOworICAgICAgfQorCisgICAgICBmaXNoZXllLnJhZGl1cyA9IGZ1bmN0aW9uKF8pIHsKKyAgICAgICAgaWYgKCFhcmd1bWVudHMubGVuZ3RoKSByZXR1cm4gcmFkaXVzOworICAgICAgICByYWRpdXMgPSArXzsKKyAgICAgICAgcmV0dXJuIHJlc2NhbGUoKTsKKyAgICAgIH07CisKKyAgICAgIGZpc2hleWUuZGlzdG9ydGlvbiA9IGZ1bmN0aW9uKF8pIHsKKyAgICAgICAgaWYgKCFhcmd1bWVudHMubGVuZ3RoKSByZXR1cm4gZGlzdG9ydGlvbjsKKyAgICAgICAgZGlzdG9ydGlvbiA9ICtfOworICAgICAgICByZXR1cm4gcmVzY2FsZSgpOworICAgICAgfTsKKworICAgICAgZmlzaGV5ZS5mb2N1cyA9IGZ1bmN0aW9uKF8pIHsKKyAgICAgICAgaWYgKCFhcmd1bWVudHMubGVuZ3RoKSByZXR1cm4gZm9jdXM7CisgICAgICAgIGZvY3VzID0gXzsKKyAgICAgICAgcmV0dXJuIGZpc2hleWU7CisgICAgICB9OworCisgICAgICByZXR1cm4gcmVzY2FsZSgpOworICAgIH0KKyAgfTsKKworICBmdW5jdGlvbiBkM19maXNoZXllX3NjYWxlKHNjYWxlLCBkLCBhKSB7CisKKyAgICBmdW5jdGlvbiBmaXNoZXllKF8pIHsKKyAgICAgIHZhciB4ID0gc2NhbGUoXyksCisgICAgICAgICAgbGVmdCA9IHggPCBhLAorICAgICAgICAgIHYsCisgICAgICAgICAgcmFuZ2UgPSBkMy5leHRlbnQoc2NhbGUucmFuZ2UoKSksCisgICAgICAgICAgbWluID0gcmFuZ2VbMF0sCisgICAgICAgICAgbWF4ID0gcmFuZ2VbMV0sCisgICAgICAgICAgbSA9IGxlZnQgPyBhIC0gbWluIDogbWF4IC0gYTsKKyAgICAgIGlmIChtID09IDApIG0gPSBtYXggLSBtaW47CisgICAgICByZXR1cm4gKGxlZnQgPyAtMSA6IDEpICogbSAqIChkICsgMSkgLyAoZCArIChtIC8gTWF0aC5hYnMoeCAtIGEpKSkgKyBhOworICAgIH0KKworICAgIGZpc2hleWUuZGlzdG9ydGlvbiA9IGZ1bmN0aW9uKF8pIHsKKyAgICAgIGlmICghYXJndW1lbnRzLmxlbmd0aCkgcmV0dXJuIGQ7CisgICAgICBkID0gK187CisgICAgICByZXR1cm4gZmlzaGV5ZTsKKyAgICB9OworCisgICAgZmlzaGV5ZS5mb2N1cyA9IGZ1bmN0aW9uKF8pIHsKKyAgICAgIGlmICghYXJndW1lbnRzLmxlbmd0aCkgcmV0dXJuIGE7CisgICAgICBhID0gK187CisgICAgICByZXR1cm4gZmlzaGV5ZTsKKyAgICB9OworCisgICAgZmlzaGV5ZS5jb3B5ID0gZnVuY3Rpb24oKSB7CisgICAgICByZXR1cm4gZDNfZmlzaGV5ZV9zY2FsZShzY2FsZS5jb3B5KCksIGQsIGEpOworICAgIH07CisKKyAgICBmaXNoZXllLm5pY2UgPSBzY2FsZS5uaWNlOworICAgIGZpc2hleWUudGlja3MgPSBzY2FsZS50aWNrczsKKyAgICBmaXNoZXllLnRpY2tGb3JtYXQgPSBzY2FsZS50aWNrRm9ybWF0OworICAgIHJldHVybiBkMy5yZWJpbmQoZmlzaGV5ZSwgc2N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yAodC5hIC0gcy5hKSAvIDMsCisgICAgICAgIGEyID0gdC5hIC0gKHQuYSAtIHMuYSkgLyAzOworICAgIHJldHVybiBzLnIwIC0gcy5yMSB8fCB0LnIwIC0gdC5yMQorICAgICAgICA/ICJNIiArIE1hdGguY29zKHMuYSkgKiBzLnIwICsgIiwiICsgTWF0aC5zaW4ocy5hKSAqIHMucjAKKyAgICAgICAgKyAiTCIgKyBNYXRoLmNvcyhzLmEpICogcy5yMSArICIsIiArIE1hdGguc2luKHMuYSkgKiBzLnIxCisgICAgICAgICsgIkMiICsgTWF0aC5jb3MoYTEpICogcy5yMSArICIsIiArIE1hdGguc2luKGExKSAqIHMucjEKKyAgICAgICAgKyAiICIgKyBNYXRoLmNvcyhhMikgKiB0LnIxICsgIiwiICsgTWF0aC5zaW4oYTIpICogdC5yMQorICAgICAgICArICIgIiArIE1hdGguY29zKHQuYSkgKiB0LnIxICsgIiwiICsgTWF0aC5zaW4odC5hKSAqIHQucjEKKyAgICAgICAgKyAiTCIgKyBNYXRoLmNvcyh0LmEpICogdC5yMCArICIsIiArIE1hdGguc2luKHQuYSkgKiB0LnIwCisgICAgICAgICsgIkMiICsgTWF0aC5jb3MoYTIpICogdC5yMCArICIsIiArIE1hdGguc2luKGEyKSAqIHQucjAKKyAgICAgICAgKyAiICIgKyBNYXRoLmNvcyhhMSkgKiBzLnIwICsgIiwiICsgTWF0aC5zaW4oYTEpICogcy5yMAorICAgICAgICArICIgIiArIE1hdGguY29zKHMuYSkgKiBzLnIwICsgIiwiICsgTWF0aC5zaW4ocy5hKSAqIHMucjAKKyAgICAgICAgOiAiTSIgKyBNYXRoLmNvcyhzLmEpICogcy5yMCArICIsIiArIE1hdGguc2luKHMuYSkgKiBzLnIwCisgICAgICAgICsgIkMiICsgTWF0aC5jb3MoYTEpICogcy5yMSArICIsIiArIE1hdGguc2luKGExKSAqIHMucjEKKyAgICAgICAgKyAiICIgKyBNYXRoLmNvcyhhMikgKiB0LnIxICsgIiwiICsgTWF0aC5zaW4oYTIpICogdC5yMQorICAgICAgICArICIgIiArIE1hdGguY29zKHQuYSkgKiB0LnIxICsgIiwiICsgTWF0aC5zaW4odC5hKSAqIHQucjE7CisgIH0KKworICBmdW5jdGlvbiBub2RlKG1ldGhvZCwgdGhpeiwgZCwgaSkgeworICAgIHZhciBub2RlID0gbWV0aG9kLmNhbGwodGhpeiwgZCwgaSksCisgICAgICAgIGEgPSArKHR5cGVvZiBhbmdsZSA9PT0gImZ1bmN0aW9uIiA/IGFuZ2xlLmNhbGwodGhpeiwgbm9kZSwgaSkgOiBhbmdsZSkgKyBhcmNPZmZzZXQsCisgICAgICAgIHIwID0gKyh0eXBlb2Ygc3RhcnRSYWRpdXMgPT09ICJmdW5jdGlvbiIgPyBzdGFydFJhZGl1cy5jYWxsKHRoaXosIG5vZGUsIGkpIDogc3RhcnRSYWRpdXMpLAorICAgICAgICByMSA9IChzdGFydFJhZGl1cyA9PT0gZW5kUmFkaXVzID8gcjAgOiArKHR5cGVvZiBlbmRSYWRpdXMgPT09ICJmdW5jdGlvbiIgPyBlbmRSYWRpdXMuY2FsbCh0aGl6LCBub2RlLCBpKSA6IGVuZFJhZGl1cykpOworICAgIHJldHVybiB7cjA6IHIwLCByMTogcjEsIGE6IGF9OworICB9CisKKyAgbGluay5zb3VyY2UgPSBmdW5jdGlvbihfKSB7CisgICAgaWYgKCFhcmd1bWVudHMubGVuZ3RoKSByZXR1cm4gc291cmNlOworICAgIHNvdXJjZSA9IF87CisgICAgcmV0dXJuIGxpbms7CisgIH07CisKKyAgbGluay50YXJnZXQgPSBmdW5jdGlvbihfKSB7CisgICAgaWYgKCFhcmd1bWVudHMubGVuZ3RoKSByZXR1cm4gdGFyZ2V0OworICAgIHRhcmdldCA9IF87CisgICAgcmV0dXJuIGxpbms7CisgIH07CisKKyAgbGluay5hbmdsZSA9IGZ1bmN0aW9uKF8pIHsKKyAgICBpZiAoIWFyZ3VtZW50cy5sZW5ndGgpIHJldHVybiBhbmdsZTsKKy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gorICAgICAgICBpbnRlcnBvbGF0ZSA9ICJsaW5lYXIiLCAvLyBvciBiYXNpcywgbW9ub3RvbmUsIHN0ZXAtYmVmb3JlLCBldGMuCisgICAgICAgIHggPSBkM19ob3Jpem9uWCwKKyAgICAgICAgeSA9IGQzX2hvcml6b25ZLAorICAgICAgICB3ID0gOTYwLAorICAgICAgICBoID0gNDAsCisgICAgICAgIGR1cmF0aW9uID0gMDsKKworICAgIHZhciBjb2xvciA9IGQzLnNjYWxlLmxpbmVhcigpCisgICAgICAgIC5kb21haW4oWy0xLCAwLCAxXSkKKyAgICAgICAgLnJhbmdlKFsiI2Q2MjcyOCIsICIjZmZmIiwgIiMxZjc3YjQiXSk7CisKKyAgICAvLyBGb3IgZWFjaCBzbWFsbCBtdWx0aXBsZeKApgorICAgIGZ1bmN0aW9uIGhvcml6b24oZykgeworICAgICAgZy5lYWNoKGZ1bmN0aW9uKGQsIGkpIHsKKyAgICAgICAgdmFyIGcgPSBkMy5zZWxlY3QodGhpcyksCisgICAgICAgICAgICBuID0gMiAqIGJhbmRzICsgMSwKKyAgICAgICAgICAgIHhNaW4gPSBJbmZpbml0eSwKKyAgICAgICAgICAgIHhNYXggPSAtSW5maW5pdHksCisgICAgICAgICAgICB5TWF4ID0gLUluZmluaXR5LAorICAgICAgICAgICAgeDAsIC8vIG9sZCB4LXNjYWxlCisgICAgICAgICAgICB5MCwgLy8gb2xkIHktc2NhbGUKKyAgICAgICAgICAgIGlkOyAvLyB1bmlxdWUgaWQgZm9yIHBhdGhzCisKKyAgICAgICAgLy8gQ29tcHV0ZSB4LSBhbmQgeS12YWx1ZXMgYWxvbmcgd2l0aCBleHRlbnRzLgorICAgICAgICB2YXIgZGF0YSA9IGQubWFwKGZ1bmN0aW9uKGQsIGkpIHsKKyAgICAgICAgICB2YXIgeHYgPSB4LmNhbGwodGhpcywgZCwgaSksCisgICAgICAgICAgICAgIHl2ID0geS5jYWxsKHRoaXMsIGQsIGkpOworICAgICAgICAgIGlmICh4diA8IHhNaW4pIHhNaW4gPSB4djsKKyAgICAgICAgICBpZiAoeHYgPiB4TWF4KSB4TWF4ID0geHY7CisgICAgICAgICAgaWYgKC15diA+IHlNYXgpIHlNYXggPSAteXY7CisgICAgICAgICAgaWYgKHl2ID4geU1heCkgeU1heCA9IHl2OworICAgICAgICAgIHJldHVybiBbeHYsIHl2XTsKKyAgICAgICAgfSk7CisKKyAgICAgICAgLy8gQ29tcHV0ZSB0aGUgbmV3IHgtIGFuZCB5LXNjYWxlcywgYW5kIHRyYW5zZm9ybS4KKyAgICAgICAgdmFyIHgxID0gZDMuc2NhbGUubGluZWFyKCkuZG9tYWluKFt4TWluLCB4TWF4XSkucmFuZ2UoWzAsIHddKSwKKyAgICAgICAgICAgIHkxID0gZDMuc2NhbGUubGluZWFyKCkuZG9tYWluKFswLCB5TWF4XSkucmFuZ2UoWzAsIGggKiBiYW5kc10pLAorICAgICAgICAgICAgdDEgPSBkM19ob3Jpem9uVHJhbnNmb3JtKGJhbmRzLCBoLCBtb2RlKTsKKworICAgICAgICAvLyBSZXRyaWV2ZSB0aGUgb2xkIHNjYWxlcywgaWYgdGhpcyBpcyBhbiB1cGRhdGUuCisgICAgICAgIGlmICh0aGlzLl9fY2hhcnRfXykgeworICAgICAgICAgIHgwID0gdGhpcy5fX2NoYXJ0X18ueDsKKyAgICAgICAgICB5MCA9IHRoaXMuX19jaGFydF9fLnk7CisgICAgICAgICAgdDAgPSB0aGlzLl9fY2hhcnRfXy50OworICAgICAgICAgIGlkID0gdGhpcy5fX2NoYXJ0X18uaWQ7CisgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgeDAgPSB4MS5jb3B5KCk7CisgICAgICAgICAgeTAgPSB5MS5jb3B5KCk7CisgICAgICAgICAgdDAgPSB0MTsKKyAgICAgICAgICBpZCA9ICsrZDNfaG9yaXpvbklkOworICAgICAgICB9CisKKyAgICAgICAgLy8gV2UnbGwgdXNlIGEgZGVmcyB0byBzdG9yZSB0aGUgYXJlYSBwYXRoIGFuZCB0aGUgY2xpcCBwYXRoLgorICAgICAgICB2YXIgZGVmcyA9IGcuc2VsZWN0QWxsKCJkZWZzIikKKyAgICAgICAgICAgIC5kYXRhKFtudWxsXSk7CisKKyAgICAgICAgLy8gVGhlIGNsaXAgcGF0aCBpcyBhIHNpbXBsZSByZWN0LgorICAgICAgICBkZWZzLmVudGVyKCkuYXBwZW5kKCJkZWZzIikuYXBwZW5kKCJjbGlwUGF0aCIpCisgICAgICAgICAgICAuYXR0cigiaWQiLCAiZDNfaG9yaXpvbl9jbGlwIiArIGlkKQorICAgICAgICAgIC5hcHBlbmQoInJlY3QiKQorICAgICAgICAgICAgLmF0dHIoIndpZHRoIiwgdykKKyAgICAgICAgICAgIC5hdHRyKCJoZWlnaHQiLCBoKTsKKworICAgICAgICBkZWZzLnNlbGVjdCgicmVjdCIpLnRyYW5zaXRpb24oKQorICAgICAgICAgICAgLmR1cmF0aW9uKGR1cmF0aW9uKQorICAgICAgICAgICAgLmF0dHIoIndpZHRoIiwgdykKKyAgICAgICAgICAgIC5hdHRyKCJoZWlnaHQiLCBoKTsKKworICAgICAgICAvLyBXZSdsbCB1c2UgYSBjb250YWluZXIgdG8gY2xpcCBhbGwgaG9yaXpvbiBsYXllcnMgYXQgb25jZS4KKyAgICAgICAgZy5zZWxlY3RBbGwoImciKQorICAgICAgICAgICAgLmRhdGEoW251bGxdKQorICAgICAgICAgIC5lbnRlcigpLmFwcGVuZCgiZyIpCisgICAgICAgICAgICAuYXR0cigiY2xpcC1wYXRoIiwgInVybCgjZDNfaG9yaXpvbl9jbGlwIiArIGlkICsgIikiKTsKKworICAgICAgICAvLyBJbnN0YW50aWF0ZSBlYWNoIGNvcHkgb2YgdGhlIHBhdGggd2l0aCBkaWZmZXJlbnQgdHJhbnNmb3Jtcy4KKyAgICAgICAgdmFyIHBhdGggPSBnLnNlbGVjdCgiZyIpLnNlbGVjdEFsbCgicGF0aCIpCisgICAgICAgICAgICAuZGF0YShkMy5yYW5nZSgtMSwgLWJhbmRzIC0gMSwgLTEpLmNvbmNhdChkMy5yYW5nZSgxLCBiYW5kcyArIDEpKSwgTnVtYmVyKTsKKworICAgICAgICB2YXIgZDAgPSBkM19ob3Jpem9uQXJlYQorICAgICAgICAgICAgLmludGVycG9sYXRlKGludGVycG9sYXRlKQorICAgICAgICAgICAgLngoZnVuY3Rpb24oZCkgeyByZXR1cm4geDAoZFswXSk7IH0pCisgICAgICAgICAgICAueTAoaCAqIGJhbmRzKQorICAgICAgICAgICAgLnkxKGZ1bmN0aW9uKGQpIHsgcmV0dXJuIGggKiBiYW5kcyAtIHkwKGRbMV0pOyB9KQorICAgICAgICAgICAgKGRhdGEpOworCisgICAgICAgIHZhciBkMSA9IGQzX2hvcml6b25BcmVhCisgICAgICAgICAgICAueChmdW5jdGlvbihkKSB7IHJldHVybiB4MShkWzBdKTsgfSkKKyAgICAgICAgICAgIC55MShmdW5jdGlvbihkKSB7IHJldHVybiBoICogYmFuZHMgLSB5MShkWzFdKTsgfSkKKyAgICAgICAgICAgIChkYXRhKTsKKworICAgICAgICBwYXRoLmVudGVyKCkuYXBwZW5kKCJwYXRoIikKKyAgICAgICAgICAgIC5zdHlsZSgiZmlsbCIsIGNvbG9yKQorICAgICAgICAgICAgLmF0dHIoInRyYW5zZm9ybSIsIHQwKQorICAgICAgICAgICAgLmF0dHIoImQiLCBkMCk7CisKKyAgICAgICAgcGF0aC50cmFuc2l0aW9uKCkKKyAgICAgICAgICAgIC5kdXJhdGlvbihkdXJhdGlvbikKKyAgICAgICAgICAgIC5zdHlsZSgiZmlsbCIsIGNvbG9yKQorICAgICAgICAgICAgLmF0dHIoInRyYW5zZm9ybSIsIHQxKQorICAgICAgICAgICAgLmF0dHIoImQiLCBkMSk7CisKKyAgICAgICAgcGF0aC5leGl0KCkudHJhbnNpdGlvbigpCisgICAgICAgICAgICAuZHVyYXRpb24oZHVyYXRpb24pCisgICAgICAgICAgICAuYXR0cigidHJhbnNmb3JtIiwgdDEpCisgICAgICAgICAgICAuYXR0cigiZCIsIGQxKQorICAgICAgICAgICAgLnJlbW92ZSgpOworCisgICAgICAgIC8vIFN0YXNoIHRoZSBuZXcgc2NhbGVzLgorICAgICAgICB0aGlzLl9fY2hhcnRfXyA9IHt4OiB4MSwgeTogeTEsIHQ6IHQxLCBpZDogaWR9OworICAgICAgfSk7CisgICAgICBkMy50aW1lci5mbHVzaCgpOworICAgIH0KKworICAgIGhvcml6b24uZHVyYXRpb24gPSBmdW5jdGlvbih4KSB7CisgICAgICBpZiAoIWFyZ3VtZW50cy5sZW5ndGgpIHJldHVybiBkdXJhdGlvbjsKKyAgICAgIGR1cmF0aW9uID0gK3g7CisgICAgICByZXR1cm4gaG9yaXpvbjsKKyAgICB9OworCisgICAgaG9yaXpvbi5iYW5kcyA9IGZ1bmN0aW9uKHgpIHsKKyAgICAgIGlmICghYXJndW1lbnRzLmxlbmd0aCkgcmV0dXJuIGJhbmRzOworICAgICAgYmFuZHMgPSAreDsKKyAgICAgIGNvbG9yLmRvbWFpbihbLWJhbmRzLCAwLCBiYW5kc10pOworICAgICAgcmV0dXJuIGhvcml6b247CisgICAgfTsKKworICAgIGhvcml6b24ubW9kZSA9IGZ1bmN0aW9uKHgpIHsKKyAgICAgIGlmICghYXJndW1lbnRzLmxlbmd0aCkgcmV0dXJuIG1vZGU7CisgICAgICBtb2RlID0geCArICIiOworICAgICAgcmV0dXJuIGhvcml6b247CisgICAgfTsKKworICAgIGhvcml6b24uY29sb3JzID0gZnVuY3Rpb24oeCkgeworICAgICAgaWYgKCFhcmd1bWVudHMubGVuZ3RoKSByZXR1cm4gY29sb3IucmFuZ2UoKTsKKyAgICAgIGNvbG9yLnJhbmdlKHgpOworICAgICAgcmV0dXJuIGhvcml6b247CisgICAgfTsKKworICAgIGhvcml6b24uaW50ZXJwb2xhdGUgPSBmdW5jdGlvbih4KSB7CisgICAgICBpZiAoIWFyZ3VtZW50cy5sZW5ndGgpIHJldHVybiBpbnRlcnBvbGF0ZTsKKyAgICAgIGludGVycG9sYXRlID0geCArICIiOworICAgICAgcmV0dXJuIGhvcml6b247CisgICAgfTsKKworICAgIGhvcml6b24ueCA9IGZ1bmN0aW9uKHopIHsKKyAgICAgIGlmICghYXJndW1lbnRzLmxlbmd0aCkgcmV0dXJuIHg7CisgICAgICB4ID0gejsKKyAgICAgIHJldHVybiBob3Jpem9uOworICAgIH07CisKKyAgICBob3Jpem9uLnkgPSBmdW5jdGlvbih6KSB7CisgICAgICBpZiAoIWFyZ3VtZW50cy5sZW5ndGgpIHJldHVybiB5OworICAgICAgeSA9IHo7CisgICAgICByZXR1cm4gaG9yaXpvbjsKKyAgICB9OworCisgICAgaG9yaXpvbi53aWR0aCA9IGZ1bmN0aW9uKHgpIHsKKyAgICAgIGlmICghYXJndW1lbnRzLmxlbmd0aCkgcmV0dXJuIHc7CisgICAgICB3ID0gK3g7CisgICAgICByZXR1cm4gaG9yaXpvbjsKKyAgICB9OworCisgICAgaG9yaXpvbi5oZWlnaHQgPSBmdW5jdGlvbih4KSB7CisgICAgICBpZiAoIWFyZ3VtZW50cy5sZW5ndGgpIHJldHVybiBoOworICAgICAgaCA9ICt4OworICAgICAgcmV0dXJuIGhvcml6b247CisgICAgfTsKKworICAgIHJldHVybiBob3Jpem9uOworICB9OworCisgIHZhciBkM19ob3Jpem9uQXJlYSA9IGQzLnN2Zy5hcmVhKCksCisgICAgICBkM19ob3Jpem9uSWQgPSAwOworCisgIGZ1bmN0aW9uIGQzX2hvcml6b25YKGQpIHsKKyAgICByZXR1cm4gZFswXTsKKyAgfQorCisgIGZ1bmN0aW9uIGQzX2hvcml6b25ZKGQpIHsKKyAgICByZXR1cm4gZFsxXTsKKyAgfQorCisgIGZ1bmN0aW9uIGQzX2hvcml6b25UcmFuc2Zvcm0oYmFuZHMsIGgsIG1vZGUpIHsKKyAgICByZXR1cm4gbW9kZSA9PSAib2Zmc2V0IgorICAgICAgICA/IGZ1bmN0aW9uKGQpIHsgcmV0dXJuICJ0cmFuc2xhdGUoM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G1vdXNlWSA9IGQzbW91c2VbMV07CisgICAgICAgICAgICAgICAgICAgICAgdmFyIHN1YnRyYWN0TWFyZ2luID0gdHJ1ZTsKKyAgICAgICAgICAgICAgICAgICAgICB2YXIgbW91c2VPdXRBbnlSZWFzb24gPSBmYWxzZTsKKyAgICAgICAgICAgICAgICAgICAgICBpZiAoaXNNU0lFKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgLyoKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBEMy5qcyAob3IgbWF5YmUgU1ZHLmdldFNjcmVlbkNUTSkgaGFzIGEgbmFzdHkgYnVnIGluIEludGVybmV0IEV4cGxvcmVyIDEwLgorICAgICAgICAgICAgICAgICAgICAgICAgICAgIGQzLm1vdXNlKCkgcmV0dXJucyBpbmNvcnJlY3QgWCxZIG1vdXNlIGNvb3JkaW5hdGVzIHdoZW4gbW91c2UgbW92aW5nCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgb3ZlciBhIHJlY3QgaW4gSUUgMTAuCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgSG93ZXZlciwgZDMuZXZlbnQub2Zmc2V0WC9ZIGFsc28gcmV0dXJucyB0aGUgbW91c2UgY29vcmRpbmF0ZXMKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICByZWxhdGl2ZSB0byB0aGUgdHJpZ2dlcmluZyA8cmVjdD4uIFNvIHdlIHVzZSBvZmZzZXRYL1kgb24gSUUuICAKKyAgICAgICAgICAgICAgICAgICAgICAgICAqLworICAgICAgICAgICAgICAgICAgICAgICAgIG1vdXNlWCA9IGQzLmV2ZW50Lm9mZnNldFg7CisgICAgICAgICAgICAgICAgICAgICAgICAgbW91c2VZID0gZDMuZXZlbnQub2Zmc2V0WTsKKworICAgICAgICAgICAgICAgICAgICAgICAgIC8qCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgT24gSUUsIGlmIHlvdSBhdHRhY2ggYSBtb3VzZSBldmVudCBsaXN0ZW5lciB0byB0aGUgPHN2Zz4gY29udGFpbmVyLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIGl0IHdpbGwgYWN0dWFsbHkgdHJpZ2dlciBpdCBmb3IgYWxsIHRoZSBjaGlsZCBlbGVtZW50cyAobGlrZSA8cGF0aD4sIDxjaXJjbGU+LCBldGMpLgorICAgICAgICAgICAgICAgICAgICAgICAgICAgIFdoZW4gdGhpcyBoYXBwZW5zIG9uIElFLCB0aGUgb2Zmc2V0WC9ZIGlzIHNldCB0byB3aGVyZSBldmVyIHRoZSBjaGlsZCBlbGVtZW50CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgaXMgbG9jYXRlZC4KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBBcyBhIHJlc3VsdCwgd2UgZG8gTk9UIG5lZWQgdG8gc3VidHJhY3QgbWFyZ2lucyB0byBmaWd1cmUgb3V0IHRoZSBtb3VzZSBYL1kKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBwb3NpdGlvbiB1bmRlciB0aGlzIHNjZW5hcmlvLiBSZW1vdmluZyB0aGUgbGluZSBiZWxvdyAqd2lsbCogY2F1c2UgCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgdGhlIGludGVyYWN0aXZlIGxheWVyIHRvIG5vdCB3b3JrIHJpZ2h0IG9uIElFLgorICAgICAgICAgICAgICAgICAgICAgICAgICovCisgICAgICAgICAgICAgICAgICAgICAgICAgaWYoZDMuZXZlbnQudGFyZ2V0LnRhZ05hbWUgIT09ICJzdmciKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgIHN1YnRyYWN0TWFyZ2luID0gZmFsc2U7CisKKyAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoZDMuZXZlbnQudGFyZ2V0LmNsYXNzTmFtZS5iYXNlVmFsLm1hdGNoKCJudi1sZWdlbmQiKSkKKyAgICAgICAgICAgICAgICAgICAgICAgICAJbW91c2VPdXRBbnlSZWFzb24gPSB0cnVlOworICAgICAgICAgICAgICAgICAgICAgICAgICAKKyAgICAgICAgICAgICAgICAgICAgICB9CisKKyAgICAgICAgICAgICAgICAgICAgICBpZihzdWJ0cmFjdE1hcmdpbikgeworICAgICAgICAgICAgICAgICAgICAgICAgIG1vdXNlWCAtPSBtYXJnaW4ubGVmdDsKKyAgICAgICAgICAgICAgICAgICAgICAgICBtb3VzZVkgLT0gbWFyZ2luLnRvcDsKKyAgICAgICAgICAgICAgICAgICAgICB9CisKKyAgICAgICAgICAgICAgICAgICAgICAvKiBJZiBtb3VzZVgvWSBpcyBvdXRzaWRlIG9mIHRoZSBjaGFydCdzIGJvdW5kcywKKyAgICAgICAgICAgICAgICAgICAgICB0cmlnZ2VyIGEgbW91c2VPdXQgZXZlbnQuCisgICAgICAgICAgICAgICAgICAgICAgKi8KKyAgICAgICAgICAgICAgICAgICAgICBpZiAobW91c2VYIDwgMCB8fCBtb3VzZVkgPCAwIAorICAgICAgICAgICAgICAgICAgICAgICAgfHwgbW91c2VYID4gYXZhaWxhYmxlV2lkdGggfHwgbW91c2VZID4gYXZhaWxhYmxlSGVpZ2h0CisgICAgICAgICAgICAgICAgICAgICAgICB8fCAoZDMuZXZlbnQucmVsYXRlZFRhcmdldCAmJiBkMy5ldmVudC5yZWxhdGVkVGFyZ2V0Lm93bmVyU1ZHRWxlbWVudCA9PT0gdW5kZWZpbmVkKQorICAgICAgICAgICAgICAgICAgICAgICAgfHwgbW91c2VPdXRBbnlSZWFzb24KKyAgICAgICAgICAgICAgICAgICAgICAgICkgCisgICAgICAgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAgICAgIAkJaWYgKGlzTVNJRSkgeworICAgICAgICAgICAgICAgICAgICAgIAkJCWlmIChkMy5ldmVudC5yZWxhdGVkVGFyZ2V0IAorICAgICAgICAgICAgICAgICAgICAgIAkJCQkmJiBkMy5ldmVudC5yZWxhdGVkVGFyZ2V0Lm93bmVyU1ZHRWxlbWVudCA9PT0gdW5kZWZpbmVkCisgICAgICAgICAgICAgICAgICAgICAgCQkJCSYmIGQzLmV2ZW50LnJlbGF0ZWRUYXJnZXQuY2xhc3NOYW1lLm1hdGNoKHRvb2x0aXAubnZQb2ludGVyRXZlbnRzQ2xhc3MpKSB7CisgICAgICAgICAgICAgICAgICAgICAgCQkJCXJldHVybjsKKyAgICAgICAgICAgICAgICAgICAgICAJCQl9CisgICAgICAgICAgICAgICAgICAgICAgCQl9CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgZGlzcGF0Y2guZWxlbWVudE1vdXNlb3V0KHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBtb3VzZVg6IG1vdXNlWCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBtb3VzZVk6IG1vdXNlWQorICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0pOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxheWVyLnJlbmRlckd1aWRlTGluZShudWxsKTsgLy9oaWRlIHRoZSBndWlkZWxpbmUKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm47CisgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgIAorICAgICAgICAgICAgICAgICAgICAgIHZhciBwb2ludFhWYWx1ZSA9IHhTY2FsZS5pbnZlcnQobW91c2VYKTsKKyAgICAgICAgICAgICAgICAgICAgICBkaXNwYXRjaC5lbGVtZW50TW91c2Vtb3ZlKHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBtb3VzZVg6IG1vdXNlWCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBtb3VzZVk6IG1vdXNlWSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBwb2ludFhWYWx1ZTogcG9pbnRYVmFsdWUKKyAgICAgICAgICAgICAgICAgICAgICB9KTsKKworICAgICAgICAgICAgICAgICAgICAgIC8vSWYgdXNlciBkb3VibGUgY2xpY2tzIHRoZSBsYXllciwgZmlyZSBhIGVsZW1lbnREYmxjbGljayBkaXNwYXRjaC4KKyAgICAgICAgICAgICAgICAgICAgICBpZiAoZDMuZXZlbnQudHlwZSA9PT0gImRibGNsaWNrIikgeworICAgICAgICAgICAgICAgICAgICAgICAgZGlzcGF0Y2guZWxlbWVudERibGNsaWNrKHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBtb3VzZVg6IG1vdXNlWCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBtb3VzZVk6IG1vdXNlWSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBwb2ludFhWYWx1ZTogcG9pbnRYVmFsdWUKKyAgICAgICAgICAgICAgICAgICAgICAgIH0pOworICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICB9CisKKwkJCQlzdmdDb250YWluZXIKKwkJCQkgICAgICAub24oIm1vdXNlbW92ZSIsbW91c2VIYW5kbGVyLCB0cnVlKQorCQkJCSAgICAgIC5vbigibW91c2VvdXQiICxtb3VzZUhhbmRsZXIsdHJ1ZSkKKyAgICAgICAgICAgICAgICAgICAgICAub24oImRibGNsaWNrIiAsbW91c2VIYW5kbGVyKQorCQkJCSAgICAgIDsKKworCQkJCSAvL0RyYXdzIGEgdmVydGljYWwgZ3VpZGVsaW5lIGF0IHRoZSBnaXZlbiBYIHBvc3Rpb24uCisJCQkJbGF5ZXIucmVuZGVyR3VpZGVMaW5lID0gZnVuY3Rpb24oeCkgeworCQkJCSAJaWYgKCFzaG93R3VpZGVMaW5lKSByZXR1cm47CisJCQkJIAl2YXIgbGluZSA9IHdyYXAuc2VsZWN0KCIubnYtaW50ZXJhY3RpdmVHdWlkZUxpbmUiKQorCQkJCSAJICAgICAgLnNlbGVjdEFsbCgibGluZSIpCisJCQkJIAkgICAgICAuZGF0YSgoeCAhPSBudWxsKSA/IFtudi51dGlscy5OYU50b1plcm8oeCldIDogW10sIFN0cmluZyk7CisKKwkJCQkgCWxpbmUuZW50ZXIoKQorCQkJCSAJCS5hcHBlbmQoImxpbmUiKQorCQkJCSAJCS5hdHRyKCJjbGFzcyIsICJudi1ndWlkZWxpb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iAwLCByaWdodDogMCwgYm90dG9tOiAwLCBsZWZ0OiAwfQorICAgICwgd2lkdGggPSA3NSAvL29ubHkgdXNlZCBmb3IgdGlja0xhYmVsIGN1cnJlbnRseQorICAgICwgaGVpZ2h0ID0gNjAgLy9vbmx5IHVzZWQgZm9yIHRpY2tMYWJlbCBjdXJyZW50bHkKKyAgICAsIHNjYWxlID0gZDMuc2NhbGUubGluZWFyKCkKKyAgICAsIGF4aXNMYWJlbFRleHQgPSBudWxsCisgICAgLCBzaG93TWF4TWluID0gdHJ1ZSAvL1RPRE86IHNob3dNYXhNaW4gc2hvdWxkIGJlIGRpc2FibGVkIG9uIGFsbCBvcmRpbmFsIHNjYWxlZCBheGVzCisgICAgLCBoaWdobGlnaHRaZXJvID0gdHJ1ZQorICAgICwgcm90YXRlTGFiZWxzID0gMAorICAgICwgcm90YXRlWUxhYmVsID0gdHJ1ZQorICAgICwgc3RhZ2dlckxhYmVscyA9IGZhbHNlCisgICAgLCBpc09yZGluYWwgPSBmYWxzZQorICAgICwgdGlja3MgPSBudWxsCisJLCBsb2dTY2FsZSA9IGZhbHNlCisgICAgLCBheGlzTGFiZWxEaXN0YW5jZSA9IDEyIC8vVGhlIGxhcmdlciB0aGlzIG51bWJlciBpcywgdGhlIGNsb3NlciB0aGUgYXhpcyBsYWJlbCBpcyB0byB0aGUgYXhpcy4KKyAgICA7CisKKyAgYXhpcworICAgIC5zY2FsZShzY2FsZSkKKyAgICAub3JpZW50KCdib3R0b20nKQorICAgIC50aWNrRm9ybWF0KGZ1bmN0aW9uKGQpIHsgcmV0dXJuIGQgfSkKKyAgICA7CisKKyAgLy89PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKworCisgIC8vPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisgIC8vIFByaXZhdGUgVmFyaWFibGVzCisgIC8vLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tCisKKyAgdmFyIHNjYWxlMDsKKworICAvLz09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorCisKKyAgZnVuY3Rpb24gY2hhcnQoc2VsZWN0aW9uKSB7CisgICAgc2VsZWN0aW9uLmVhY2goZnVuY3Rpb24oZGF0YSkgeworICAgICAgdmFyIGNvbnRhaW5lciA9IGQzLnNlbGVjdCh0aGlzKTsKKworCisgICAgICAvLy0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLQorICAgICAgLy8gU2V0dXAgY29udGFpbmVycyBhbmQgc2tlbGV0b24gb2YgY2hhcnQKKworICAgICAgdmFyIHdyYXAgPSBjb250YWluZXIuc2VsZWN0QWxsKCdnLm52LXdyYXAubnYtYXhpcycpLmRhdGEoW2RhdGFdKTsKKyAgICAgIHZhciB3cmFwRW50ZXIgPSB3cmFwLmVudGVyKCkuYXBwZW5kKCdnJykuYXR0cignY2xhc3MnLCAnbnZkMyBudi13cmFwIG52LWF4aXMnKTsKKyAgICAgIHZhciBnRW50ZXIgPSB3cmFwRW50ZXIuYXBwZW5kKCdnJyk7CisgICAgICB2YXIgZyA9IHdyYXAuc2VsZWN0KCdnJykKKworICAgICAgLy8tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0KKworCisgICAgICBpZiAodGlja3MgIT09IG51bGwpCisgICAgICAgIGF4aXMudGlja3ModGlja3MpOworICAgICAgZWxzZSBpZiAoYXhpcy5vcmllbnQoKSA9PSAndG9wJyB8fCBheGlzLm9yaWVudCgpID09ICdib3R0b20nKQorICAgICAgICBheGlzLnRpY2tzKE1hdGguYWJzKHNjYWxlLnJhbmdlKClbMV0gLSBzY2FsZS5yYW5nZSgpWzBdKSAvIDEwMCk7CisKKworICAgICAgLy9UT0RPOiBjb25zaWRlciBjYWxjdWxhdGluZyB3aWR0aC9oZWlnaHQgYmFzZWQgb24gd2hldGhlciBvciBub3QgbGFiZWwgaXMgYWRkZWQsIGZvciByZWZlcmVuY2UgaW4gY2hhcnRzIHVzaW5nIHRoaXMgY29tcG9uZW50CisKKworICAgICAgZy50cmFuc2l0aW9uKCkuY2FsbChheGlzKTsKKworICAgICAgc2NhbGUwID0gc2NhbGUwIHx8IGF4aXMuc2NhbGUoKTsKKworICAgICAgdmFyIGZtdCA9IGF4aXMudGlja0Zvcm1hdCgpOworICAgICAgaWYgKGZtdCA9PSBudWxsKSB7CisgICAgICAgIGZtdCA9IHNjYWxlMC50aWNrRm9ybWF0KCk7CisgICAgICB9CisKKyAgICAgIHZhciBheGlzTGFiZWwgPSBnLnNlbGVjdEFsbCgndGV4dC5udi1heGlzbGFiZWwnKQorICAgICAgICAgIC5kYXRhKFtheGlzTGFiZWxUZXh0IHx8IG51bGxdKTsKKyAgICAgIGF4aXNMYWJlbC5leGl0KCkucmVtb3ZlKCk7CisgICAgICBzd2l0Y2ggKGF4aXMub3JpZW50KCkpIHsKKyAgICAgICAgY2FzZSAndG9wJzoKKyAgICAgICAgICBheGlzTGFiZWwuZW50ZXIoKS5hcHBlbmQoJ3RleHQnKS5hdHRyKCdjbGFzcycsICdudi1heGlzbGFiZWwnKTsKKyAgICAgICAgICB2YXIgdyA9IChzY2FsZS5yYW5nZSgpLmxlbmd0aD09MikgPyBzY2FsZS5yYW5nZSgpWzFdIDogKHNjYWxlLnJhbmdlKClbc2NhbGUucmFuZ2UoKS5sZW5ndGgtMV0rKHNjYWxlLnJhbmdlKClbMV0tc2NhbGUucmFuZ2UoKVswXSkpOworICAgICAgICAgIGF4aXNMYWJlbAorICAgICAgICAgICAgICAuYXR0cigndGV4dC1hbmNob3InLCAnbWlkZGxlJykKKyAgICAgICAgICAgICAgLmF0dHIoJ3knLCAwKQorICAgICAgICAgICAgICAuYXR0cigneCcsIHcvMik7CisgICAgICAgICAgaWYgKHNob3dNYXhNaW4pIHsKKyAgICAgICAgICAgIHZhciBheGlzTWF4TWluID0gd3JhcC5zZWxlY3RBbGwoJ2cubnYtYXhpc01heE1pbicpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAuZGF0YShzY2FsZS5kb21haW4oKSk7CisgICAgICAgICAgICBheGlzTWF4TWluLmVudGVyKCkuYXBwZW5kKCdnJykuYXR0cignY2xhc3MnLCAnbnYtYXhpc01heE1pbicpLmFwcGVuZCgndGV4dCcpOworICAgICAgICAgICAgYXhpc01heE1pbi5leGl0KCkucmVtb3ZlKCk7CisgICAgICAgICAgICBheGlzTWF4TWluCisgICAgICAgICAgICAgICAgLmF0dHIoJ3RyYW5zZm9ybScsIGZ1bmN0aW9uKGQsaSkgeworICAgICAgICAgICAgICAgICAgcmV0dXJuICd0cmFuc2xhdGUoJyArIHNjYWxlKGQpICsgJywwKScKKyAgICAgICAgICAgICAgICB9KQorICAgICAgICAgICAgICAuc2VsZWN0KCd0ZXh0JykKKyAgICAgICAgICAgICAgICAuYXR0cignZHknLCAnMGVtJykKKyAgICAgICAgICAgICAgICAuYXR0cigneScsIC1heGlzLnRpY2tQYWRkaW5nKCkpCisgICAgICAgICAgICAgICAgLmF0dHIoJ3RleHQtYW5jaG9yJywgJ21pZGRsZScpCisgICAgICAgICAgICAgICAgLnRleHQoZnVuY3Rpb24oZCxpKSB7CisgICAgICAgICAgICAgICAgICAvL3ZhciB2ID0gZm10KGQpOworCQkJCSAgdmFyIHYgPSBkOworCQkJCSAgaWYobG9nU2NhbGUpIHsKKwkJCQkJdiA9IE1hdGgucG93KDEwLHYpOworCQkJCQl2ID0gZm10KHYpOworCQkJCQkvL2ZtdCA9IGQzLmZvcm1hdCgnLC4yZicpOworCQkJCQkvL3YgPSBmbXQodik7CisJCQkJICB9IGVsc2UKKwkJCQkgIHYgPSBmbXQodik7CisgICAgICAgICAgICAgICAgICByZXR1cm4gKCcnICsgdikubWF0Y2goJ05hTicpID8gJycgOiB2OworICAgICAgICAgICAgICAgIH0pOworICAgICAgICAgICAgYXhpc01heE1pbi50cmFuc2l0aW9uKCkKKyAgICAgICAgICAgICAgICAuYXR0cigndHJhbnNmb3JtJywgZnVuY3Rpb24oZCxpKSB7CisgICAgICAgICAgICAgICAgICByZXR1cm4gJ3RyYW5zbGF0ZSgnICsgc2NhbGUucmFuZ2UoKVtpXSArICcsMCknCisgICAgICAgICAgICAgICAgfSk7CisgICAgICAgICAgfQorICAgICAgICAgIGJyZWFrOworICAgICAgICBjYXNlICdib3R0b20nOgorICAgICAgICAgIHZhciB4TGFiZWxNYXJnaW4gPSAzNjsKKyAgICAgICAgICB2YXIgbWF4VGV4dFdpZHRoID0gMzA7CisgICAgICAgICAgdmFyIHhUaWNrcyA9IGcuc2VsZWN0QWxsKCdnJykuc2VsZWN0KCJ0ZXh0Iik7CisgICAgICAgICAgaWYgKHJvdGF0ZUxhYmVscyUzNjApIHsKKyAgICAgICAgICAgIC8vQ2FsY3VsYXRlIHRoZSBsb25nZXN0IHhUaWNrIHdpZHRoCisgICAgICAgICAgICB4VGlja3MuZWFjaChmdW5jdGlvbihkLGkpeworICAgICAgICAgICAgICB2YXIgd2lkdGggPSB0aGlzLmdldEJCb3goKS53aWR0aDsKKyAgICAgICAgICAgICAgaWYod2lkdGggPiBtYXhUZXh0V2lkdGgpIG1heFRleHRXaWR0aCA9IHdpZHRoOworICAgICAgICAgICAgfSk7CisgICAgICAgICAgICAvL0NvbnZlcnQgdG8gcmFkaWFucyBiZWZvcmUgY2FsY3VsYXRpbmcgc2luLiBBZGQgMzAgdG8gbWFyZ2luIGZvciBoZWFsdGh5IHBhZGRpbmcuCisgICAgICAgICAgICB2YXIgc2luID0gTWF0aC5hYnMoTWF0aC5zaW4ocm90YXRlTGFiZWxzKk1hdGguUEkvMTgwKSk7CisgICAgICAgICAgICB2YXIgeExhYmVsTWFyZ2luID0gKHNpbiA/IHNpbiptYXhUZXh0V2lkdGggOiBtYXhUZXh0V2lkdGgpKzMwOworICAgICAgICAgICAgLy9Sb3RhdGUgYWxsIHhUaWNrcworICAgICAgICAgICAgeFRpY2tzCisgICAgICAgICAgICAgIC5hdHRyKCd0cmFuc2Zvcm0nLCBmdW5jdGlvbihkLGksaikgeyByZXR1cm4gJ3JvdGF0ZSgnICsgcm90YXRlTGFiZWxzICsgJyAwLDApJyB9KQorICAgICAgICAgICAgICAuc3R5bGUoJ3RleHQtYW5jaG9yJywgcm90YXRlTGFiZWxzJTM2MCA+IDAgPyAnc3RhcnQnIDogJ2VuZCcpOworICAgICAgICAgIH0KKyAgICAgICAgICBheGlzTGFiZWwuZW50ZXIoKS5hcHBlbmQoJ3RleHQnKS5hdHRyKCdjbGFzcycsICdudi1heGlzbGFiZWwnKTsKKyAgICAgICAgICB2YXIgdyA9IChzY2FsZS5yYW5nZSgpLmxlbmd0aD09MikgPyBzY2FsZS5yYW5nZSgpWzFdIDogKHNjYWxlLnJhbmdlKClbc2NhbGUucmFuZ2UoKS5sZW5ndGgtMV0rKHNjYWxlLnJhbmdlKClbMV0tc2NhbGUucmFuZ2UoKVswXSkpOworICAgICAgICAgIGF4aXNMYWJlbAorICAgICAgICAgICAgICAuYXR0cigndGV4dC1hbmNob3InLCAnbWlkZGxlJykKKyAgICAgICAgICAgICAgLmF0dHIoJ3knLCB4TGFiZWxNYXJnaW4pCisgICAgICAgICAgICAgIC5hdHRyKCd4Jywgdy8yKTsKKyAgICAgICAgICBpZiAoc2hvd01heE1pbikgeworICAgICAgICAgIC8vaWYgKHNob3dNYXhNaW4gJiYgIWlzT3JkaW5hbCkgeworICAgICAgICAgICAgdmFyIGF4aXNNYXhNaW4gPSB3cmFwLnNlbGVjdEFsbCgnZy5udi1heGlzTWF4TWluJykKKyAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vLmRhdGEoc2NhbGUuZG9tYWluKCkpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAuZGF0YShbc2NhbGUuZG9tYWluKClbMF0sIHNjYWxlLmRvbWFpbigpW3NjYWxlLmRvbWFpbigpLmxlbmd0aCAtIDFdXSk7CisgICAgICAgICAgICBheGlzTWF4TWluLmVudGVyKCkuYXBwZW5kKCdnJykuYXR0cignY2xhc3MnLCAnbnYtYXhpc01heE1pbicpLmFwcGVuZCgndGV4dCcpOworICAgICAgICAgICAgYXhpc01heE1pbi5leGl0KCkucmVtb3ZlKCk7CisgICAgICAgICAgICBheGlzTWF4TWluCisgICAgICAgICAgICAgICAgLmF0dHIoJ3RyYW5zZm9ybScsIGZ1bmN0aW9uKGQsaSkgeworICAgICAgICAgICAgICAgICAgcmV0dXJuICd0cmFuc2xhdGUoJyArIChzY2FsZShkKSArIChpc09yZGluYWwgPyBzY2FsZS5yYW5nZUJhbmQoKSAvIDIgOiAwKSkgKyAnLDApJworICAgICAgICAgICAgICAgIH0pCisgICAgICAgICAgICAgIC5zZWxlY3QoJ3RleHQnKQorICAgICAgICAgICAgICAgIC5hdHRyKCdkeScsICcuNzFlbScpCisgICAgICAgICAgICAgICAgLmF0dHIoJ3knLCBheGlzLnRpY2tQYWRkaW5nKCkpCisgICAgICAgICAgICAgICAgLmF0dHIoJ3RyYW5zZm9ybScsIGZ1bmN0aW9uKGQsaSxqKSB7IHJldHVybiAncm90YXRlKCcgKyByb3RhdGVMYWJlbHMgKyAnIDAsMCknIH0pCisgICAgICAgICAgICAgICAgLnN0eWxlKCd0ZXh0LWFuY2hvcicsIHJvdGF0ZUxhYmVscyA/IChyb3RhdGVMYWJlbHMlMzYwID4gMCA/ICdzdGFydCcgOiAnZW5kJykgOiAnbWlkZGxlJykKKyAgICAgICAgICAgICAgICAudGV4dChmdW5jdGlvbihkLGkpIHsKKyAgICAgICAgICAgICAgICAgIC8vdmFyIHYgPSBmbXQoZCk7CisJCQkJICB2YXIgdiA9IGQ7CisJCQkJICBpZihsb2dTY2FsZSkgeworCQkJCQl2ID0gTWF0aC5wb3coMTAsdik7CisJCQkJCXYgPSBmbXQodik7CisJCQkJCS8vZm10ID0gZDMuZm9ybWF0KCcsLjJmJyk7CisJCQkJCS8vdiA9IGZtdCh2KTsKKwkJCQkgIH0gZWxzZQorCQkJCSAgdiA9IGZtdCh2KTsKKyAgICAgICAgICAgICAgICAgIHJldHVybiAoJycgKyB2KS5tYXRjaCgnTmFOJykgPyAnJyA6IHY7CisgICAgICAgICAgICAgICAgfSk7CisgICAgICAgICAgICBheGlzTWF4TWluLnRyYW5zaXRpb24oKQorICAgICAgICAgICAgICAgIC5hdHRyKCd0cmFuc2Zvcm0nLCBmdW5jdGlvbihkLGkpIHsKKyAgICAgICAgICAgICAgICAgIC8vcmV0dXJuICd0cmFuc2xhdGUoJyArIHNjYWxlLnJhbmdlKClbaV0gKyAnLDApJworICAgICAgICAgICAgICAgICAgLy9yZXR1cm4gJ3RyYW5zbGF0ZSgnICsgc2NhbGUoZCkgKyAnLDApJworICAgICAgICAgICAgICAgICAgcmV0dXJuICd0cmFuc2xhdGUoJyArIChzY2FsZShkKSArIChpc09yZGluYWwgPyBzY2FsZS5yYW5nZUJhbmQoKSAvIDIgOiAwKSkgKyAnLDApJworICAgICAgICAgICAgICAgIH0pOworICAgICAgICAgIH0KKyAgICAgICAgICBpZiAoc3RhZ2dlckxhYmVscykKKyAgICAgICAgICAgIHhUaWNrcworICAgICAgICAgICAgICAgIC5hdHRyKCd0cmFuc2Zvcm0nLCBmdW5jdGlvbihkLGkpIHsgcmV0dXJuICd0cmFuc2xhdGUoMCwnICsgKGkgJSAyID09IDAgPyAnMCcgOiAnMTInKSArICcpJyB9KTsKKworICAgICAgICAgIGJyZWFrOworICAgICAgICBjYXNlICdyaWdodCc6CisgICAgICAgICAgYXhpc0xhYmVsLmVudGVyKCkuYXBwZW5kKCd0ZXh0JykuYXR0cignY2xhc3MnLCAnbnYtYXhpc2xhYmVsJyk7CisgICAgICAgICAgYXhpc0xhYmVsCisgICAgICAgICAgICAgIC5zdHlsZSgndGV4dC1hbmNob3InLCByb3RhdGVZTGFiZWwgPyAnbWlkZGxlJyA6ICdiZWdpbicpCisgICAgICAgICAgICAgIC5hdHRyKCd0cmFuc2Zvcm0nLCByb3RhdGVZTGFiZWwgPyAncm90YXRlKDkwKScgOiAnJykKKyAgICAgICAgICAgICAgLmF0dHIoJ3knLCByb3RhdGVZTGFiZWwgPyAoLU1hdGgubWF4KG1hcmdpbi5yaWdodCx3aWR0aCkgKyAxMikgOiAtMTApIC8vVE9ETzogY29uc2lkZXIgY2FsY3VsYXRpbmcgdGhpcyBiYXNlZCBvbiBsYXJnZXN0IHRpY2sgd2lkdGguLi4gT1IgYXQgbGVhc3QgZXhwb3NlIHRoaXMgb24gY2hhcnQKKyAgICAgICAgICAgICAgLmF0dHIoJ3gnLCByb3RhdGVZTGFiZWwgPyAoc2NhbGUucmFuZ2UoKVswXSAvIDIpIDogYXhpcy50aWNrUGFkZGluZygpKTsKKyAgICAgICAgICBpZiAoc2hvd01heE1pbikgeworICAgICAgICAgICAgdmFyIGF4aXNNYXhNaW4gPSB3cmFwLnNlbGVjdEFsbCgnZy5udi1heGlzTWF4TWluJykKKyAgICAgICAgICAgICAgICAgICAgICAgICAgIC5kYXRhKHNjYWxlLmRvbWFpbigpKTsKKyAgICAgICAgICAgIGF4aXNNYXhNaW4uZW50ZXIoKS5hcHBlbmQoJ2cnKS5hdHRyKCdjbGFzcycsICdudi1heGlzTWF4TWluJykuYXBwZW5kKCd0ZXh0JykKKyAgICAgICAgICAgICAgICAuc3R5bGUoJ29wYWNpdHknLCAwKTsKKyAgICAgICAgICAgIGF4aXNNYXhNaW4uZXhpdCgpLnJlbW92ZSgpOworICAgICAgICAgICAgYXhpc01heE1pbgorICAgICAgICAgICAgICAgIC5hdHRyKCd0cmFuc2Zvcm0nLCBmdW5jdGlvbihkLGkpIHsKKyAgICAgICAgICAgICAgICAgIHJldHVybiAndHJhbnNsYXRlKDAsJyArIHNjYWxlKGQpICsgJyknCisgICAgICAgICAgICAgICAgfSkKKyAgICAgICAgICAgICAgLnNlbGVjdCgndGV4dCcpCisgICAgICAgICAgICAgICAgLmF0dHIoJ2R5JywgJy4zMmVtJykKKyAgICAgICAgICAgICAgICAuYXR0cigneScsIDApCisgICAgICAgICAgICAgICAgLmF0dHIoJ3gnLCBheGlzLnRpY2tQYWRkaW5nKCkpCisgICAgICAgICAgICAgICAgLnN0eWxlKCd0ZXh0LWFuY2hvcicsICdzdGFydCcpCisgICAgICAgICAgICAgICAgLnRleHQoZnVuY3Rpb24oZCxpKSB7CisgICAgICAgICAgICAgICAgICAvL3ZhciB2ID0gZm10KGQpOworCQkJCSAgdmFyIHYgPSBkOworCQkJCSAgaWYobG9nU2NhbGUpIHsKKwkJCQkJdiA9IE1hdGgucG93KDEwLHYpOworCQkJCQl2ID0gZm10KHYpOworCQkJCQkvL2ZtdCA9IGQzLmZvcm1hdCgnLC4yZicpOworCQkJCQkvL3YgPSBmbXQodik7CisJCQkJICB9IGVsc2UKKwkJCQkgICAgdiA9IGZtdCh2KTsKKyAgICAgICAgICAgICAgICAgIHJldHVybiAoJycgKyB2KS5tYXRjaCgnTmFOJykgPyAnJyA6IHY7CisgICAgICAgICAgICAgICAgfSk7CisgICAgICAgICAgICBheGlzTWF4TWluLnRyYW5zaXRpb24oKQorICAgICAgICAgICAgICAgIC5hdHRyKCd0cmFuc2Zvcm0nLCBmdW5jdGlvbihkLGkpIHsKKyAgICAgICAgICAgICAgICAgIHJldHVybiAndHJhbnNsYXRlKDAsJyArIHNjYWxlLnJhbmdlKClbaV0gKyAnKScKKyAgICAgICAgICAgICAgICB9KQorICAgICAgICAgICAgICAuc2VsZWN0KCd0ZXh0JykKKyAgICAgICAgICAgICAgICAuc3R5bGUoJ29wYWNpdHknLCAxKTsKKyAgICAgICAgICB9CisgICAgICAgICAgYnJlYWs7CisgICAgICAgIGNhc2UgJ2xlZnQnOgorICAgICAgICAgIC8qCisgICAgICAgICAgLy9Gb3IgZHluYW1pY2FsbHkgcGxhY2luZyB0aGU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ZGluZygpKTsKKyAgICAgICAgICBpZiAoc2hvd01heE1pbikgeworICAgICAgICAgICAgdmFyIGF4aXNNYXhNaW4gPSB3cmFwLnNlbGVjdEFsbCgnZy5udi1heGlzTWF4TWluJykKKyAgICAgICAgICAgICAgICAgICAgICAgICAgIC5kYXRhKHNjYWxlLmRvbWFpbigpKTsKKyAgICAgICAgICAgIGF4aXNNYXhNaW4uZW50ZXIoKS5hcHBlbmQoJ2cnKS5hdHRyKCdjbGFzcycsICdudi1heGlzTWF4TWluJykuYXBwZW5kKCd0ZXh0JykKKyAgICAgICAgICAgICAgICAuc3R5bGUoJ29wYWNpdHknLCAwKTsKKyAgICAgICAgICAgIGF4aXNNYXhNaW4uZXhpdCgpLnJlbW92ZSgpOworICAgICAgICAgICAgYXhpc01heE1pbgorICAgICAgICAgICAgICAgIC5hdHRyKCd0cmFuc2Zvcm0nLCBmdW5jdGlvbihkLGkpIHsKKyAgICAgICAgICAgICAgICAgIHJldHVybiAndHJhbnNsYXRlKDAsJyArIHNjYWxlMChkKSArICcpJworICAgICAgICAgICAgICAgIH0pCisgICAgICAgICAgICAgIC5zZWxlY3QoJ3RleHQnKQorICAgICAgICAgICAgICAgIC5hdHRyKCdkeScsICcuMzJlbScpCisgICAgICAgICAgICAgICAgLmF0dHIoJ3knLCAwKQorICAgICAgICAgICAgICAgIC5hdHRyKCd4JywgLWF4aXMudGlja1BhZGRpbmcoKSkKKyAgICAgICAgICAgICAgICAuYXR0cigndGV4dC1hbmNob3InLCAnZW5kJykKKyAgICAgICAgICAgICAgICAudGV4dChmdW5jdGlvbihkLGkpIHsKKyAgICAgICAgICAgICAgICAgIC8vdmFyIHYgPSBmbXQoZCk7CisJCQkJICB2YXIgdiA9IGQ7CisJCQkJICBpZihsb2dTY2FsZSkgeworCQkJCQl2ID0gTWF0aC5wb3coMTAsdik7CisJCQkJCXYgPSBmbXQodik7CisJCQkJCS8vZm10ID0gZDMuZm9ybWF0KCcsLjJmJyk7CisJCQkJCS8vdiA9IGZtdCh2KTsKKwkJCQkgIH0gZWxzZQorCQkJCQl2ID0gZm10KHYpOworICAgICAgICAgICAgICAgICAgcmV0dXJuICgnJyArIHYpLm1hdGNoKCdOYU4nKSA/ICcnIDogdjsKKyAgICAgICAgICAgICAgICB9KTsKKyAgICAgICAgICAgIGF4aXNNYXhNaW4udHJhbnNpdGlvbigpCisgICAgICAgICAgICAgICAgLmF0dHIoJ3RyYW5zZm9ybScsIGZ1bmN0aW9uKGQsaSkgeworICAgICAgICAgICAgICAgICAgcmV0dXJuICd0cmFuc2xhdGUoMCwnICsgc2NhbGUucmFuZ2UoKVtpXSArICcpJworICAgICAgICAgICAgICAgIH0pCisgICAgICAgICAgICAgIC5zZWxlY3QoJ3RleHQnKQorICAgICAgICAgICAgICAgIC5zdHlsZSgnb3BhY2l0eScsIDEpOworICAgICAgICAgIH0KKyAgICAgICAgICBicmVhazsKKyAgICAgIH0KKyAgICAgIGF4aXNMYWJlbAorICAgICAgICAgIC50ZXh0KGZ1bmN0aW9uKGQpIHsgcmV0dXJuIGQgfSk7CisKKworICAgICAgaWYgKHNob3dNYXhNaW4gJiYgKGF4aXMub3JpZW50KCkgPT09ICdsZWZ0JyB8fCBheGlzLm9yaWVudCgpID09PSAncmlnaHQnKSkgeworICAgICAgICAvL2NoZWNrIGlmIG1heCBhbmQgbWluIG92ZXJsYXAgb3RoZXIgdmFsdWVzLCBpZiBzbywgaGlkZSB0aGUgdmFsdWVzIHRoYXQgb3ZlcmxhcAorICAgICAgICBnLnNlbGVjdEFsbCgnZycpIC8vIHRoZSBnJ3Mgd3JhcHBpbmcgZWFjaCB0aWNrCisgICAgICAgICAgICAuZWFjaChmdW5jdGlvbihkLGkpIHsKKyAgICAgICAgICAgICAgZDMuc2VsZWN0KHRoaXMpLnNlbGVjdCgndGV4dCcpLmF0dHIoJ29wYWNpdHknLCAxKTsKKwkJCSAgdmFyIHY7IAorCQkJICBpZihsb2dTY2FsZSkgeworCQkJCXYgPSBNYXRoLnBvdyg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bGUuZG9tYWluKClbMV0gJiYgc2NhbGUuZG9tYWluKClbMF0gPT0gMCkKKyAgICAgICAgICB3cmFwLnNlbGVjdEFsbCgnZy5udi1heGlzTWF4TWluJykKKyAgICAgICAgICAgIC5zdHlsZSgnb3BhY2l0eScsIGZ1bmN0aW9uKGQsaSkgeyByZXR1cm4gIWkgPyAxIDogMCB9KTsKKworICAgICAgfQorCisgICAgICBpZiAoc2hvd01heE1pbiAmJiAoYXhpcy5vcmllbnQoKSA9PT0gJ3RvcCcgfHwgYXhpcy5vcmllbnQoKSA9PT0gJ2JvdHRvbScpKSB7CisgICAgICAgIHZhciBtYXhNaW5SYW5nZSA9IFtdOworICAgICAgICB3cmFwLnNlbGVjdEFsbCgnZy5udi1heGlzTWF4TWluJykKKyAgICAgICAgICAgIC5lYWNoKGZ1bmN0aW9uKGQsaSkgeworICAgICAgICAgICAgICB0cnkgeworICAgICAgICAgICAgICAgICAgaWYgKGkpIC8vIGk9PSAxLCBtYXggcG9zaXRpb24KKyAgICAgICAgICAgICAgICAgICAgICBtYXhNaW5SYW5nZS5wdXNoKHNjYWxlKGQpIC0gdGhpcy5nZXRCQm94KCkud2lkdGggLSA0KSAgLy9hc3N1bWluZyB0aGUgbWF4IGFuZCBtaW4gbGFiZWxzIGFyZSBhcyB3aWRlIGFzIHRoZSBuZXh0IHRpY2sgKHdpdGggYW4gZXh0cmEgNCBwaXhlbHMganVzdCBpbiBjYXNlKQorICAgICAgICAgICAgICAgICAgZWxzZSAvLyBpPT0wLCBtaW4gcG9zaXRpb24KKyAgICAgICAgICAgICAgICAgICAgICBtYXhNaW5SYW5nZS5wdXNoKHNjYWxlKGQpICsgdGhpcy5nZXRCQm94KCkud2lkdGggKyA0KQorICAgICAgICAgICAgICB9Y2F0Y2ggKGVycikgeworICAgICAgICAgICAgICAgICAgaWYgKGkpIC8vIGk9PSAxLCBtYXggcG9zaXRpb24KKyAgICAgICAgICAgICAgICAgICAgICBtYXhNaW5SYW5nZS5wdXNoKHN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IGJlIHByb2JsZW1hdGljIGlmIHRoZSBzY2FsZSBpcyBFWFRSRU1FTFkgU01BTEwKKyAgICAgICAgICAgICAgICAgIGQzLnNlbGVjdCh0aGlzKS5yZW1vdmUoKTsKKyAgICAgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICAgICAgICBkMy5zZWxlY3QodGhpcykuc2VsZWN0KCd0ZXh0JykucmVtb3ZlKCk7IC8vIERvbid0IHJlbW92ZSB0aGUgWkVSTyBsaW5lISEKKyAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfSk7CisgICAgICB9CisKKworICAgICAgLy9oaWdobGlnaHQgemVybyBsaW5lIC4uLiBNYXliZSBzaG91bGQgbm90IGJlIGFuIG9wdGlvbiBhbmQgc2hvdWxkIGp1c3QgYmUgaW4gQ1NTPworICAgICAgaWYgKGhpZ2hsaWdodFplcm8pCisgICAgICAgIGcuc2VsZWN0QWxsKCcudGljaycpCisgICAgICAgICAgLmZpbHRlcihmdW5jdGlvbihkKSB7IHJldHVybiAhcGFyc2VGbG9hdChNYXRoLnJvdW5kKGQuX19kYXRhX18qMTAwMDAwKS8xMDAwMDAwKSAmJiAoZC5fX2RhdGFfXyAhPT0gdW5kZWZpbmVkKSB9KSAvL3RoaXMgaXMgYmVjYXVzZSBzb21ldGltZXMgdGhlIDAgdGljayBpcyBhIHZlcnkgc21hbGwgZnJhY3Rpb24sIFRPRE86IHRoaW5rIG9mIGNsZWFuZXIgdGVjaG5pcXVlCisgICAgICAgICAgICAuY2xhc3NlZCgnemVybycsIHRydWUpOworCisgICAgICAvL3N0b3JlIG9sZCBzY2FsZXMgZm9yIHVzZSBpbiB0cmFuc2l0aW9ucyBvbiB1cGRhdGUKKyAgICAgIHNjYWxlMCA9IHNjYWxlLmNvcHkoKTsKKworICAgIH0pOworCisgICAgcmV0dXJuIGNoYXJ0OworICB9CisKKworICAvLz09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorICAvL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Ghlc2UgbGFiZWxzIGEgdmFyaWFibGUKKyAgICAgICAgICAgICAgICBwb3M6IFt4MShkKSwgaGVpZ2h0RnJvbVRvcF0KKyAgICAgICAgICAgICAgfSkKKyAgICAgICAgICB9KQorICAgICAgICAgIC5vbignbW91c2VvdXQnLCBmdW5jdGlvbihkLGkpIHsgCisgICAgICAgICAgICAgIGRpc3BhdGNoLmVsZW1lbnRNb3VzZW91dCh7CisgICAgICAgICAgICAgICAgdmFsdWU6IGQsCisgICAgICAgICAgICAgICAgbGFiZWw6IChpIDw9IDApID8gJ01pbmltdW0nIDogKGkgPj0xKSA/ICdNYXhpbXVtJyA6ICdNZWFuJyAvL1RPRE86IG1ha2UgdGhlc2UgbGFiZWxzIGEgdmFyaWFibGUKKyAgICAgICAgICAgICAgfSkKKyAgICAgICAgICB9KQorCisgICAgICBkMy50cmFuc2l0aW9uKHJhbmdlKQorICAgICAgICAgIC5hdHRyKCd4JywgcmV2ZXJzZSA/IHgxIDogMCkKKyAgICAgICAgICAuYXR0cignd2lkdGgnLCB3MSkKKyAgICAgICAgICAuYXR0cignaGVpZ2h0JywgYXZhaWxhYmxlSGVpZ2h0KTsKKworCisgICAgICAvLyBVcGRhdGUgdGhlIG1lYXN1cmUgcmVjdHMuCisgICAgICB2YXIgbWVhc3VyZSA9IGcuc2VsZWN0QWxsKCdyZWN0Lm52LW1lYXN1cmUnKQorICAgICAgICAgIC5kYXRhKG1lYXN1cmV6KTsKKworICAgICAgbWVhc3VyZS5lbnRlcigpLmFwcGVuZCgncmVjdCcpCisgICAgICAgICAgLmF0dHIoJ2NsYXNzJywgZnVuY3Rpb24oZCwgaSkgeyByZXR1cm4gJ252LW1lYXN1cmUgbnYtcycgKyBpOyB9KQorICAgICAgICAgIC5hdHRyKCd3aWR0aCcsIHcwKQorICAgICAgICAgIC5hdHRyKCdoZWlnaHQnLCBhdmFpbGFibGVIZWlnaHQgLyAzKQorICAgICAgICAgIC5hdHRyKCd4JywgcmV2ZXJzZSA/IHgwIDogMCkKKyAgICAgICAgICAuYXR0cigneScsIGF2YWlsYWJsZUhlaWdodCAvIDMpCisgICAgICAgICAgLm9uKCdtb3VzZW92ZXInLCBmdW5jdGlvbihkKSB7IAorICAgICAgICAgICAgICBkaXNwYXRjaC5lbGVtZW50TW91c2VvdmVyKHsKKyAgICAgICAgICAgICAgICB2YWx1ZTogZCwKKyAgICAgICAgICAgICAgICBsYWJlbDogJ0N1cnJlbnQnLCAvL1RPRE86IG1ha2UgdGhlc2UgbGFiZWxzIGEgdmFyaWFibGUKKyAgICAgICAgICAgICAgICBwb3M6IFt4MShkKSwgaGVpZ2h0RnJvbVRvcF0KKyAgICAgICAgICAgICAgfSkKKyAgICAgICAgICB9KQorICAgICAgICAgIC5vbignbW91c2VvdXQnLCBmdW5jdGlvbihkKSB7IAorICAgICAgICAgICAgICBkaXNwYXRjaC5lbGVtZW50TW91c2VvdXQoeworICAgICAgICAgICAgICAgIHZhbHVlOiBkLAorICAgICAgICAgICAgICAgIGxhYmVsOiAnQ3VycmVudCcgLy9UT0RPOiBtYWtlIHRoZXNlIGxhYmVscyBhIHZhcmlhYmxlCisgICAgICAgICAgICAgIH0pCisgICAgICAgICAgfSkKKworICAgICAgZDMudHJhbnNpdGlvbihtZWFzdXJlKQorICAgICAgICAgIC5hdHRyKCd3aWR0aCcsIHcxKQorICAgICAgICAgIC5hdHRyKCdoZWlnaHQnLCBhdmFpbGFibGVIZWlnaHQgLyAzKQorICAgICAgICAgIC5hdHRyKCd4JywgcmV2ZXJzZSA/IHgxIDogMCkKKyAgICAgICAgICAuYXR0cigneScsIGF2YWlsYWJsZUhlaWdodCAvIDMpOworCisKKworICAgICAgLy8gVXBkYXRlIHRoZSBtYXJrZXIgbGluZXMuCisgICAgICB2YXIgbWFya2VyID0gZy5zZWxlY3RBbGwoJ3BhdGgubnYtbWFya2VyVHJpYW5nbGUnKQorICAgICAgICAgIC5kYXRhKG1hcmtlcnopOworCisgICAgICB2YXIgaDMgPSAgYXZhaWxhYmxlSGVpZ2h0IC8gNjsKKyAgICAgIG1hcmtlci5lbnRlcigpLmFwcGVuZCgncGF0aCcpCisgICAgICAgICAgLmF0dHIoJ2NsYXNzJywgJ252LW1hcmtlclRyaWFuZ2xlJykKKyAgICAgICAgICAuYXR0cigndHJhbnNmb3JtJywgZnVuY3Rpb24oZCkgeyByZXR1cm4gJ3RyYW5zbGF0ZSgnICsgeDAoZCkgKyAnLCcgKyAoYXZhaWxhYmxlSGVpZ2h0IC8gMikgKyAnKScgfSkKKyAgICAgICAgICAuYXR0cignZCcsICdNMCwnICsgaDMgKyAnTCcgKyBoMyArICcsJyArICgtaDMpICsgJyAnICsgKC1oMykgKyAnLCcgKyAoLWgzKSArICdaJykKKyAgICAgICAgICAub24oJ21vdXNlb3ZlcicsIGZ1bmN0aW9uKGQsaSkgeworICAgICAgICAgICAgICBkaXNwYXRjaC5lbGVtZW50TW91c2VvdmVyKHsKKyAgICAgICAgICAgICAgICB2YWx1ZTogZCwKKyAgICAgICAgICAgICAgICBsYWJlbDogJ1ByZXZpb3VzJywKKyAgICAgICAgICAgICAgICBwb3M6IFt4MShkKSwgaGVpZ2h0RnJvbVRvcF0KKyAgICAgICAgICAgICAgfSkKKyAgICAgICAgICB9KQorICAgICAgICAgIC5vbignbW91c2VvdXQnLCBmdW5jdGlvbihkLGkpIHsKKyAgICAgICAgICAgICAgZGlzcGF0Y2guZWxlbWVudE1vdXNlb3V0KHsKKyAgICAgICAgICAgICAgICB2YWx1ZTogZCwKKyAgICAgICAgICAgICAgICBsYWJlbDogJ1ByZXZpb3VzJworICAgICAgICAgICAgICB9KQorICAgICAgICAgIH0pOworCisgICAgICBkMy50cmFuc2l0aW9uKG1hcmtlcikKKyAgICAgICAgICAuYXR0cigndHJhbnNmb3JtJywgZnVuY3Rpb24oZCkgeyByZXR1cm4gJ3RyYW5zbGF0ZSgnICsgeDEoZCkgKyAnLCcgKyAoYXZhaWxhYmxlSGVpZ2h0IC8gMikgKyAnKScgfSk7CisKKy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JykKKyAgICA7CisKKyAgLy89PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKworCisgIC8vPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisgIC8vIFByaXZhdGUgVmFyaWFibGVzCisgIC8vLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tCisKKyAgdmFyIHNob3dUb29sdGlwID0gZnVuY3Rpb24oZSwgcGFyZW50RWxlbWVudCkgeworICAgIHZhciBvZmZzZXRFbGVtZW50ID0gcGFyZW50RWxlbWVudC5wYXJlbnROb2RlLnBhcmVudE5vZGUsCisgICAgICAgIGxlZnQgPSBlLnBvc1swXSArIG9mZnNldEVsZW1lbnQub2Zmc2V0TGVmdCArIG1hcmdpbi5sZWZ0LAorICAgICAgICB0b3AgPSBlLnBvc1sxXSArIG9mZnNldEVsZW1lbnQub2Zmc2V0VG9wICsgbWFyZ2luLnRvcDsKKworICAgIHZhciBjb250ZW50ID0gJzxoMz4nICsgZS5sYWJlbCArICc8L2gzPicgKworICAgICAgICAgICAgJzxwPicgKyBlLnZhbHVlICsgJzwvcD4nOworCisgICAgbnYudG9vbHRpcC5zaG93KFtsZWZ0LCB0b3BdLCBjb250ZW50LCBlLnZhbHVlIDwgMCA/ICdlJyA6ICd3JywgbnVsbCwgb2Zmc2V0RWxlbWVudC5wYXJlbnROb2RlKTsKKyAgfTsKKworICAvLz09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorCisKKyAgZnVuY3Rpb24gY2hhcnQoc2VsZWN0aW9uKSB7CisgICAgc2VsZWN0aW9uLmVhY2goZnVuY3Rpb24oZCwgaSkgeworICAgICAgdmFyIGNvbnRhaW5lciA9IGQzLnNlbGVjdCh0aGlzKTsKKworICAgICAgdmFyIG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WR0aF0pOworCisgICAgICAvLyBSZXRyaWV2ZSB0aGUgb2xkIHgtc2NhbGUsIGlmIHRoaXMgaXMgYW4gdXBkYXRlLgorICAgICAgdmFyIHgwID0gdGhpcy5fX2NoYXJ0X18gfHwgZDMuc2NhbGUubGluZWFyKCkKKyAgICAgICAgICAuZG9tYWluKFswLCBJbmZpbml0eV0pCisgICAgICAgICAgLnJhbmdlKHgxLnJhbmdlKCkpOworCisgICAgICAvLyBTdGFzaCB0aGUgbmV3IHNjYWxlLgorICAgICAgdGhpcy5fX2NoYXJ0X18gPSB4MTsKKworICAgICAgLyoKKyAgICAgIC8vIERlcml2ZSB3aWR0aC1zY2FsZXMgZnJvbSB0aGUgeC1zY2FsZXMuCisgICAgICB2YXIgdzAgPSBidWxsZXRXaWR0aCh4MCksCisgICAgICAgICAgdzEgPSBidWxsZXRXaWR0aCh4MSk7CisKKyAgICAgIGZ1bmN0aW9uIGJ1bGxldFdpZHRoKHgpIHsKKyAgICAgICAgdmFyIHgwID0geCgwKTsKKyAgICAgICAgcmV0dXJuIGZ1bmN0aW9uKGQpIHsKKyAgICAgICAgICByZXR1cm4gTWF0aC5hYnMoeChkKSAtIHgoMCkpOworICAgICAgICB9OworICAgICAgfQorCisgICAgICBmdW5jdGlvbiBidWxsZXRUcmFuc2xhdGUoeCkgeworICAgICAgICByZXR1cm4gZnVuY3Rpb24oZCkgeworICAgICAgICAgIHJldHVybiAndHJhbnNsYXRlKCcgKyB4KGQpICsgJywwKSc7CisgICAgICAgIH07CisgICAgICB9CisgICAgICAqLworCisgICAgICB2YXIgdzAgPSBmdW5jdGlvbihkKSB7IHJldHVybiBNYXRoLmFicyh4MChkKSAtIHgwKDApKSB9LCAvLyBUT0RPOiBjb3VsZCBvcHRpbWl6ZSBieSBwcmVjYWxjdWxhdGluZyB4MCgwKSBhbmQgeDEoMCkKKyAgICAgICAgICB3MSA9IGZ1bmN0aW9uKGQpIHsgcmV0dXJuIE1hdGguYWJzKHgxKGQpIC0geDEoMCkpIH07CisKKworICAgICAgdmFyIHRpdGxlID0gZ0VudGVyLnNlbGVjdCgnLm52LXRpdGxlcycpLmFwcGVuZCgiZyIpCisgICAgICAgICAgLmF0dHIoInRleHQtYW5jaG9yIiwgImVuZCIpCisgICAgICAgICAgLmF0dHIoInRyYW5zZm9ybSIsICJ0cmFuc2xhdGUoLTYsIiArIChoZWlnaHQgLSBtYXJnaW4udG9wIC0gbWFyZ2luLmJvdHRvbSkgLyAyICsgIikiKTsKKyAgICAgIHRpdGxlLmFwcGVuZCgidGV4dCIpCisgICAgICAgICAgLmF0dHIoImNsYXNzIiwgIm52LXRpdGxlIikKKyAgICAgICAgICAudGV4dChmdW5jdGlvbihkKSB7IHJldHVybiBkLnRpdGxlOyB9KTsKKworICAgICAgdGl0bGUuYXBwZW5kKCJ0ZXh0IikKKyAgICAgICAgICAuYXR0cigiY2xhc3MiLCAibnYtc3VidGl0bGUiKQorICAgICAgICAgIC5hdHRyKCJkeSIsICIxZW0iKQorICAgICAgICAgIC50ZXh0KGZ1bmN0aW9uKGQpIHsgcmV0dXJuIGQuc3VidGl0bGU7IH0pOworCisKKworICAgICAgYnVsbGV0CisgICAgICAgIC53aWR0aChhdmFpbGFibGVXaWR0aCkKKyAgICAgICAgLmhlaWdodChhdmFpbGFibGVIZWlnaHQpCisKKyAgICAgIHZhciBidWxsZXRXcmFwID0gZy5zZWxlY3QoJy5udi1idWxsZXRXcmFwJyk7CisKKyAgICAgIGQzLnRyYW5zaXRpb24oYnVsbGV0V3JhcCkuY2FsbChidWxsZXQpOworCisKKworICAgICAgLy8gQ29tcHV0ZSB0aGUgdGljayBmb3JtYXQuCisgICAgICB2YXIgZm9ybWF0ID0gdGlja0Zvcm1hdCB8fCB4MS50aWNrRm9ybWF0KDgpOworCisgICAgICAvLyBVcGRhdGUgdGhlIHRpY2sgZ3JvdXBzLgorICAgICAgdmFyIHRpY2sgPSBnLnNlbGVjdEFsbCgnZy5udi10aWNrJykKKyAgICAgICAgICAuZGF0YSh4MS50aWNrcyg4KSwgZnVuY3Rpb24oZCkgeworICAgICAgICAgICAgcmV0dXJuIHRoaXMudGV4dENvbnRlbnQgfHwgZm9ybWF0KGQpOworICAgICAgICAgIH0pOworCisgICAgICAvLyBJbml0aWFsaXplIHRoZSB0aWNrcyB3aXRoIHRoZSBvbGQgc2NhbGUsIHgwLgorICAgICAgdmFyIHRpY2tFbnRlciA9IHRpY2suZW50ZXIoKS5hcHBlbmQoJ2cnKQorICAgICAgICAgIC5hdHRyKCdjbGFzcycsICdudi10aWNrJykKKyAgICAgICAgICAuYXR0cigndHJhbnNmb3JtJywgZnVuY3Rpb24oZCkgeyByZXR1cm4gJ3RyYW5zbGF0ZSgnICsgeDAoZCkgKyAnLDApJyB9KQorICAgICAgICAgIC5zdHlsZSgnb3BhY2l0eScsIDFlLTYpOworCisgICAgICB0aWNrRW50ZXIuYXBwZW5kKCdsaW5lJykKKyAgICAgICAgICAuYXR0cigneTEnLCBhdmFpbGFibGVIZWlnaHQpCisgICAgICAgICAgLmF0dHIoJ3kyJywgYXZhaWxhYmxlSGVpZ2h0ICogNyAvIDYpOworCisgICAgICB0aWNrRW50ZXIuYXBwZW5kKCd0ZXh0JykKKyAgICAgICAgICAuYXR0cigndGV4dC1hbmNob3InLCAnbWlkZGxlJykKKyAgICAgICAgICAuYXR0cignZHknLCAnMWVtJykKKyAgICAgICAgICAuYXR0cigneScsIGF2YWlsYWJsZUhlaWdodCAqIDcgLyA2KQorICAgICAgICAgIC50ZXh0KGZvcm1hdCk7CisKKyAgICAgIC8vIFRyYW5zaXRpb24gdGhlIGVudGVyaW5nIHRpY2tzIHRvIHRoZSBuZXcgc2NhbGUsIHgxLgorICAgICAgZDMudHJhbnNpdGlvbih0aWNrRW50ZXIpCisgICAgICAgICAgLmF0dHIoJ3RyYW5zZm9ybScsIGZ1bmN0aW9uKGQpIHsgcmV0dXJuICd0cmFuc2xhdGUoJyArIHgxKGQpICsgJywwKScgfSkKKyAgICAgICAgICAuc3R5bGUoJ29wYWNpdHknLCAxKTsKKworICAgICAgLy8gVHJhbnNpdGlvbiB0aGUgdXBkYXRpbmcgdGlja3MgdG8gdGhlIG5ldyBzY2FsZSwgeDEuCisgICAgICB2YXIgdGlja1VwZGF0ZSA9IGQzLnRyYW5zaXRpb24odGljaykKKyAgICAgICAgICAuYXR0cigndHJhbnNmb3JtJywgZnVuY3Rpb24oZCkgeyByZXR1cm4gJ3RyYW5zbGF0ZSgnICsgeDEoZCkgKyAnLDApJyB9KQorICAgICAgICAgIC5zdHlsZSgnb3BhY2l0eScsIDEpOworCisgICAgICB0aWNrVXBkYXRlLnNlbGVjdCgnbGluZScpCisgICAgICAgICAgLmF0dHIoJ3kxJywgYXZhaWxhYmxlSGVpZ2h0KQorICAgICAgICAgIC5hdHRyKCd5MicsIGF2YWlsYWJsZUhlaWdodCAqIDcgLyA2KTsKKworICAgICAgdGlja1VwZGF0ZS5zZWxlY3QoJ3RleHQnKQorICAgICAgICAgIC5hdHRyKCd5JywgYXZhaWxhYmxlSGVpZ2h0ICogNyAvIDYpOworCisgICAgICAvLyBUcmFuc2l0aW9uIHRoZSBleGl0aW5nIHRpY2tzIHRvIHRoZSBuZXcgc2NhbGUsIHgxLgorICAgICAgZDMudHJhbnNpdGlvbih0aWNrLmV4aXQoKSkKKyAgICAgICAgICAuYXR0cigndHJhbnNmb3JtJywgZnVuY3Rpb24oZCkgeyByZXR1cm4gJ3RyYW5zbGF0ZSgnICsgeDEoZCkgKyAnLDApJyB9KQorICAgICAgICAgIC5zdHlsZSgnb3BhY2l0eScsIDFlLTYpCisgICAgICAgICAgLnJlbW92ZSgpOworCisKKyAgICAgIC8vPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisgICAgICAvLyBFdmVudCBIYW5kbGluZy9EaXNwYXRjaGluZyAoaW4gY2hhcnQncyBzY29wZSkKKyAgICAgIC8vLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tCisKKyAgICAgIGRpc3BhdGNoLm9uKCd0b29sdGlwU2hvdycsIGZ1bmN0aW9uKGUpIHsKKyAgICAgICAgaWYgKHRvb2x0aXBzKSBzaG93VG9vbHRpcChlLCB0aGF0LnBhcmVudE5vZGUpOworICAgICAgfSk7CisKKyAgICAgIC8vPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisKKyAgICB9KTsKKworICAgIGQzLnRpbWVyLmZsdXNoKCk7CisKKyAgICByZXR1cm4gY2hhcnQ7CisgIH0KKworCisgIC8vPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisgIC8vIEV2ZW50IEhhbmRsaW5nL0Rpc3BhdGNoaW5nIChvdXQgb2YgY2hhcnQncyBzY29wZSkKKyAgLy8tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0KKworICBidWxsZXQuZGlzcGF0Y2gub24oJ2VsZW1lbnRNb3VzZW92ZXIudG9vbHRpcCcsIGZ1bmN0aW9uKGUpIHsKKyAgICBkaXNwYXRjaC50b29sdGlwU2hvdyhlKTsKKyAgfSk7CisKKyAgYnVsbGV0LmRpc3BhdGNoLm9uKCdlbGVtZW50TW91c2VvdXQudG9vbHRpcCcsIGZ1bmN0aW9uKGUpIHsKKyAgICBkaXNwYXRjaC50b29sdGlwSGlkZShlKTsKKyAgfSk7CisKKyAgZGlzcGF0Y2gub24oJ3Rvb2x0aXBIaWRlJywgZnVuY3Rpb24oKSB7CisgICAgaWYgKHRvb2x0aXBzKSBudi50b29sdGlwLmNsZWFudXAoKTsKKyAgfSk7CisKKyAgLy89PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKworCisgIC8v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9OworCisgIGNoYXJ0LnRvb2x0aXBzID0gZnVuY3Rpb24oXykgeworICAgIGlmICghYXJndW1lbnRzLmxlbmd0aCkgcmV0dXJuIHRvb2x0aXBzOworICAgIHRvb2x0aXBzID0gXzsKKyAgICByZXR1cm4gY2hhcnQ7CisgIH07CisKKyAgY2hhcnQudG9vbHRpcENvbnRlbnQgPSBmdW5jdGlvbihfKSB7CisgICAgaWYgKCFhcmd1bWVudHMubGVuZ3RoKSByZXR1cm4gdG9vbHRpcDsKKyAgICB0b29sdGlwID0gXzsKKyAgICByZXR1cm4gY2hhcnQ7CisgIH07CisKKyAgY2hhcnQubm9EYXRhID0gZnVuY3Rpb24oXykgeworICAgIGlmICghYXJndW1lbnRzLmxlbmd0aCkgcmV0dXJuIG5vRGF0YTsKKyAgICBub0RhdGEgPSBfOworICAgIHJldHVybiBjaGFydDsKKyAgfTsKKworICAvLz09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorCisKKyAgcmV0dXJuIGNoYXJ0OworfTsKKworCmRpZmYgLS1naXQgYS9lY29tcC1wb3J0YWwtQkUvd2FyL3N0YXRpYy9mdXNpb24vZDMvanMvbW9kZWxzL2JvaWxlcnBsYXRlLmpzIGIvZWNvbXAtcG9ydGFsLUJFL3dhci9zdGF0aWMvZnVzaW9uL2QzL2pzL21vZGVscy9ib2lsZXJwbGF0ZS5qcwpuZXcgZmlsZSBtb2RlIDEwMDY0NAppbmRleCAwMDAwMDAwLi4zZDIzNjBhCi0tLSAvZGV2L251bGwKKysrIGIvZWNvbXAtcG9ydGFsLUJFL3dhci9zdGF0aWMvZnVzaW9uL2QzL2pzL21vZGVscy9ib2lsZXJwbGF0ZS5qcwpAQCAtMCwwICsxLDEwNCBAQAorCitudi5tb2RlbHMuY2hhcnROYW1lID0gZnVuY3Rpb24oKSB7CisgICJ1c2Ugc3RyaWN0IjsKKyAgLy89PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKyAgLy8gUHVibGljIFZhcmlhYmxlcyB3aXRoIERlZmF1bHQgU2V0dGluZ3MKKyAgLy8tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0KKworCisgIHZhciBtYXJnaW4gPSB7dG9wOiAzMCwgcmlnaHQ6IDEwLCBib3R0b206IDEwLCBsZWZ0OiAxMH0KKyAgICAsIHdpZHRoID0gOTYwCisgICAgLCBoZWlnaHQgPSA1MDAKKyAgICAsIGNvbG9yID0gbnYudXRpbHMuZ2V0Q29sb3IoZDMuc2NhbGUuY2F0ZWdvcnkyMGMoKS5yYW5nZSgpKQorICAgICwgZGlzcGF0Y2ggPSBkMy5kaXNwYXRjaCgnc3RhdGVDaGFuZ2UnLCAnY2hhbmdlU3RhdGUnKQorICAgIDsKKworICAvLz09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorCisKKyAgLy89PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKyAgLy8gUHJpdmF0ZSBWYXJpYWJsZXMKKyAgLy8tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0KKworCisgIC8vPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisKKworICBmdW5jdGlvbiBjaGFydChzZWxlY3Rpb24pIHsKKyAgICBzZWxlY3Rpb24uZWFjaChmdW5jdGlvbihkYXRhKSB7CisgICAgICB2YXIgYXZhaWxhYmxlV2lkdGggPSB3aWR0aCAtIG1hcmdpbi5sZWZ0IC0gbWFyZ2luLnJpZ2h0LAorICAgICAgICAgIGF2YWlsYWJsZUhlaWdodCA9IGhlaWdodCAtIG1hcmd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wgaGVpZ2h0ID0gMzAKKyAgICAsIHRpY2tGb3JtYXQgPSBudWxsCisgICAgLCBjb2xvciA9IG52LnV0aWxzLmdldENvbG9yKFsnIzFmNzdiNCddKQorICAgICwgZGlzcGF0Y2ggPSBkMy5kaXNwYXRjaCgnZWxlbWVudE1vdXNlb3ZlcicsICdlbGVtZW50TW91c2VvdXQnKQorICAgIDsKKworICAvLz09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorCisKKyAgZnVuY3Rpb24gY2hhcnQoc2VsZWN0aW9uKSB7CisgICAgc2VsZWN0aW9uLmVhY2goZnVuY3Rpb24oZCwgaSkgeworICAgICAgdmFyIGF2YWlsYWJsZVdpZHRoID0gd2lkdGggLSBtYXJnaW4ubGVmdCAtIG1hcmdpbi5yaWdodCwKKyAgICAgICAgICBhdmFpbGFibGVIZWlnaHQgPSBoZWlnaHQgLSBtYXJnaW4udG9wIC0gbWFyZ2luLmJvdHRvbSwKKyAgICAgICAgICBjb250YWluZXIgPSBkMy5zZWxlY3QodGhpcyk7CisKKyAgICAgIHZhciByYW5nZXogPSByYW5nZXMuY2FsbCh0aGlzLCBkLCBpKS5zbGljZSgpLnNvcnQoZDMuZGVzY2VuZGluZyksCisgICAgICAgICAgbWFya2VyeiA9IG1hcmtlcnMuY2FsbCh0aGlzLCBkLCBpKS5zbGljZSgpLnNvcnQoZDMuZGVzY2VuZGluZyksCisgICAgICAgICAgbWVhc3VyZXogPSBtZWFzdXJlcy5jYWxsKHRoaXMsIGQsIGkpLnNsaWNlKCkuc29ydChkMy5kZXNjZW5kaW5nKSwKKyAgICAgICAgICByYW5nZUxhYmVseiA9IHJhbmdlTGFiZWxzLmNhbGwodGhpcywgZCwgaSkuc2xpY2UoKSwKKyAgICAgICAgICBtYXJrZXJMYWJlbHogPSBtYXJrZXJMYWJlbHMuY2FsbCh0aGlzLCBkLCBpKS5zbGljZSgpLAorICAgICAgICAgIG1lYXN1cmVMY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CA9IGZ1bmN0aW9uKGQpIHsgcmV0dXJuIE1hdGguYWJzKHgwKGQpIC0geDAoMCkpIH0sIC8vIFRPRE86IGNvdWxkIG9wdGltaXplIGJ5IHByZWNhbGN1bGF0aW5nIHgwKDApIGFuZCB4MSgwKQorICAgICAgICAgIHcxID0gZnVuY3Rpb24oZCkgeyByZXR1cm4gTWF0aC5hYnMoeDEoZCkgLSB4MSgwKSkgfTsKKyAgICAgIHZhciB4cDAgPSBmdW5jdGlvbihkKSB7IHJldHVybiBkIDwgMCA/IHgwKGQpIDogeDAoMCkgfSwKKyAgICAgICAgICB4cDEgPSBmdW5jdGlvbihkKSB7IHJldHVybiBkIDwgMCA/IHgxKGQpIDogeDEoMCkgfTsKKworCisgICAgICBnLnNlbGVjdCgncmVjdC5udi1yYW5nZU1heCcpCisgICAgICAgICAgLmF0dHIoJ2hlaWdodCcsIGF2YWlsYWJsZUhlaWdodCkKKyAgICAgICAgICAuYXR0cignd2lkdGgnLCB3MShyYW5nZU1heCA+IDAgPyByYW5nZU1heCA6IHJhbmdlTWluKSkKKyAgICAgICAgICAuYXR0cigneCcsIHhwMShyYW5nZU1heCA+IDAgPyByYW5nZU1heCA6IHJhbmdlTWluKSkKKyAgICAgICAgICAuZGF0dW0ocmFuZ2VNYXggPiAwID8gcmFuZ2VNYXggOiByYW5nZU1pbikKKyAgICAgICAgICAvKgorICAgICAgICAgIC5hdHRyKCd4JywgcmFuZ2VNaW4gPCAwID8KKyAgICAgICAgICAgICAgICAgICAgICAgICByYW5nZU1heCA+IDAgPworICAgICAgICAgICAgICAgICAgICAgICAgICAgICB4MShyYW5nZU1pbikKKyAgICAgICAgICAgICAgICAgICAgICAgICAgIDogeDEocmFuZ2VNYXgpCisgICAgICAgICAgICAgICAgICAgICAgIDogeDEoMCkpCisgICAgICAgICAgICAgICAgICAgICAgKi8KKworICAgICAgZy5zZWxlY3QoJ3JlY3QubnYtcmFuZ2VBdmcnKQorICAgICAgICAgIC5hdHRyKCdoZWlnaHQnLCBhdmFpbGFibGVIZWlnaHQpCisgICAgICAgICAgLmF0dHIoJ3dpZHRoJywgdzEocmFuZ2VBdmcpKQorICAgICAgICAgIC5hdHRyKCd4JywgeHAxKHJhbmdlQXZnKSkKKyAgICAgICAgICAuZGF0dW0ocmFuZ2VBdmcpCisgICAgICAgICAgLyoKKyAgICAgICAgICAuYXR0cignd2lkdGgnLCByYW5nZU1heCA8PSAwID8KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgeDEocmFuZ2VNYXgpIC0geDEocmFuZ2VBdmcpCisgICAgICAgICAgICAgICAgICAgICAgICAgICA6IHgxKHJhbmdlQXZnKSAtIHgxKHJhbmdlTWluKSkKKyAgICAgICAgICAuYXR0cigneCcsIHJhbmdlTWF4IDw9IDAgPworICAgICAgICAgICAgICAgICAgICAgICAgIHgxKHJhbmdlQXZnKQorICAgICAgICAgICAgICAgICAgICAgICA6IHgxKHJhbmdlTWluKSkKKyAgICAgICAgICAgICAgICAgICAgICAqLworCisgICAgICBnLnNlbGVjdCgncmVjdC5udi1yYW5nZU1pbicpCisgICAgICAgICAgLmF0dHIoJ2hlaWdodCcsIGF2YWlsYWJsZUhlaWdodCkKKyAgICAgICAgICAuYXR0cignd2lkdGgnLCB3MShyYW5nZU1heCkpCisgICAgICAgICAgLmF0dHIoJ3gnLCB4cDEocmFuZ2VNYXgpKQorICAgICAgICAgIC5hdHRyKCd3aWR0aCcsIHcxKHJhbmdlTWF4ID4gMCA/IHJhbmdlTWluIDogcmFuZ2VNYXgpKQorICAgICAgICAgIC5hdHRyKCd4JywgeHAxKHJhbmdlTWF4ID4gMCA/IHJhbmdlTWluIDogcmFuZ2VNYXgpKQorICAgICAgICAgIC5kYXR1bShyYW5nZU1heCA+IDAgPyByYW5nZU1pbiA6IHJhbmdlTWF4KQorICAgICAgICAgIC8qCisgICAgICAgICAgLmF0dHIoJ3dpZHRoJywgcmFuZ2VNYXggPD0gMCA/CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHgxKHJhbmdlQXZnKSAtIHgxKHJhbmdlTWluKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgOiB4MShyYW5nZU1heCkgLSB4MShyYW5nZUF2ZykpCisgICAgICAgICAgLmF0dHIoJ3gnLCByYW5nZU1heCA8PSAwID8KKyAgICAgICAgICAgICAgICAgICAgICAgICB4MShyYW5nZU1pbikKKyAgICAgICAgICAgICAgICAgICAgICAgOiB4MShyYW5nZUF2ZykpCisgICAgICAgICAgICAgICAgICAgICAgKi8KKworICAgICAgZy5zZWxlY3QoJ3JlY3QubnYtbWVhc3VyZScpCisgICAgICAgICAgLnN0eWxlKCdmaWxsJywgY29sb3IpCisgICAgICAgICAgLmF0dHIoJ2hlaWdodCcsIGF2YWlsYWJsZUhlaWdodCAvIDMpCisgICAgICAgICAgLmF0dHIoJ3knLCBhdmFpbGFibGVIZWlnaHQgLyAzKQorICAgICAgICAgIC5hdHRyKCd3aWR0aCcsIG1lYXN1cmV6IDwgMCA/CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHgxKDApIC0geDEobWVhc3VyZXpbMF0pCisgICAgICAgICAgICAgICAgICAgICAgICAgICA6IHgxKG1lYXN1cmV6WzBdKSAtIHgxKDApKQorICAgICAgICAgIC5hdHRyKCd4JywgeHAxKG1lYXN1cmV6KSkKKyAgICAgICAgICAub24oJ21vdXNlb3ZlcicsIGZ1bmN0aW9uKCkgeworICAgICAgICAgICAgICBkaXNwYXRjaC5lbGVtZW50TW91c2VvdmVyKHsKKyAgICAgICAgICAgICAgICB2YWx1ZTogbWVhc3VyZXpbMF0sCisgICAgICAgICAgICAgICAgbGFiZWw6IG1lYXN1cmVMYWJlbHpbMF0gfHwgJ0N1cnJlbnQnLAorICAgICAgICAgICAgICAgIHBvczogW3gxKG1lYXN1cmV6WzBdKSwgYXZhaWxhYmxlSGVpZ2h0LzJdCisgICAgICAgICAgICAgIH0pCisgICAgICAgICAgfSkKKyAgICAgICAgICAub24oJ21vdXNlb3V0JywgZnVuY3Rpb24oKSB7CisgICAgICAgICAgICAgIGRpc3BhdGNoLmVsZW1lbnRNb3VzZW91dCh7CisgICAgICAgICAgICAgICAgdmFsdWU6IG1lYXN1cmV6WzBdLAorICAgICAgICAgICAgICAgIGxhYmVsOiBtZWFzdXJlTGFiZWx6WzBdIHx8ICdDdXJyZW50JworICAgICAgICAgICAgICB9KQorICAgICAgICAgIH0pCisKKyAgICAgIHZhciBoMyA9ICBhdmFpbGFibGVIZWlnaHQgLyA2OworICAgICAgaWYgKG1hcmtlcnpbMF0pIHsKKyAgICAgICAgZy5zZWxlY3RBbGwoJ3BhdGgubnYtbWFya2VyVHJpYW5nbGUnKQorICAgICAgICAgICAgLmF0dHIoJ3RyYW5zZm9ybScsIGZ1bmN0aW9uKGQpIHsgcmV0dXJuICd0cmFuc2xhdGUoJyArIHgxKG1hcmtlcnpbMF0pICsgJywnICsgKGF2YWlsYWJsZUhlaWdodCAvIDIpICsgJyknIH0pCisgICAgICAgICAgICAuYXR0cignZCcsICdNMCwnICsgaDMgKyAnTCcgKyBoMyArICcsJyArICgtaDMpICsgJyAnICsgKC1oMykgKyAnLCcgKyAoLWgzKSArICdaJykKKyAgICAgICAgICAgIC5vbignbW91c2VvdmVyJywgZnVuY3Rpb24oKSB7CisgICAgICAgICAgICAgIGRpc3BhdGNoLmVsZW1lbnRNb3VzZW92ZXIoeworICAgICAgICAgICAgICAgIHZhbHVlOiBtYXJrZXJ6WzBdLAorICAgICAgICAgICAgICAgIGxhYmVsOiBtYXJrZXJMYWJlbHpbMF0gfHwgJ1ByZXZpb3VzJywKKyAgICAgICAgICAgICAgICBwb3M6IFt4MShtYXJrZXJ6WzBdKSwgYXZhaWxhYmxlSGVpZ2h0LzJdCisgICAgICAgICAgICAgIH0pCisgICAgICAgICAgICB9KQorICAgICAgICAgICAgLm9uKCdtb3VzZW91dCcsIGZ1bmN0aW9uKCkgeworICAgICAgICAgICAgICBkaXNwYXRjaC5lbGVtZW50TW91c2VvdXQoeworICAgICAgICAgICAgICAgIHZhbHVlOiBtYXJrZXJ6WzBdLAorICAgICAgICAgICAgICAgIGxhYmVsOiBtYXJrZXJMYWJlbHpbMF0gfHwgJ1ByZXZpb3VzJworICAgICAgICAgICAgICB9KQorICAgICAgICAgICAgfSk7CisgICAgICB9IGVsc2UgeworICAgICAgICBnLnNlbGVjdEFsbCgncGF0aC5udi1tYXJrZXJUcmlhbmdsZScpLnJlbW92ZSgpOworICAgICAgfQorCisKKyAgICAgIHdyYXAuc2VsZWN0QWxsKCcubnYtcmFuZ2UnKQorICAgICAgICAgIC5vbignbW91c2VvdmVyJywgZnVuY3Rpb24oZCxpKSB7CisgICAgICAgICAgICB2YXIgbGFiZWwgPSByYW5nZUxhYmVseltpXSB8fCAoIWkgPyAiTWF4aW11bSIgOiBpID09IDEgPyAiTWVhbiIgOiAiTWluaW11bSIpOworCisgICAgICAgICAgICBkaXNwYXRjaC5lbGVtZW50TW91c2VvdmVyKHsKKyAgICAgICAgICAgICAgdmFsdWU6IGQsCisgICAgICAgICAgICAgIGxhYmVsOiBsYWJlbCwKKyAgICAgICAgICAgICAgcG9zOiBbeDEoZCksIGF2YWlsYWJsZUhlaWdodC8yXQorICAgICAgICAgICAgfSkKKyAgICAgICAgICB9KQorICAgICAgICAgIC5vbignbW91c2VvdXQnLCBmdW5jdGlvbihkLGkpIHsKKyAgICAgICAgICAgIHZhciBsYWJlbCA9IHJhbmdlTGFiZWx6W2ldIHx8ICghaSA/ICJNYXhpbXVtIiA6IGkgPT0gMSA/ICJNZWFuIiA6ICJNaW5pbXVtIik7CisKKyAgICAgICAgICAgIGRpc3BhdGNoLmVsZW1lbnRNb3VzZW91dCh7CisgICAgICAgICAgICAgIHZhbHVlOiBkLAorICAgICAgICAgICAgICBsYWJlbDogbGFiZWwKKyAgICAgICAgICAgIH0pCisgICAgICAgICAgfSkKKworLyogLy8gVEhJUyBJUyBUSEUgUFJFVklPVVMgQlVMTEVUIElNUExFTUVOVEFUSU9OLCBXSUxMIFJFTU9WRSBTSE9SVExZCisgICAgICAvLyBVcGRhdGUgdGhlIHJhbmdlIHJlY3RzLgorICAgICAgdmFyIHJhbmdlID0gZy5zZWxlY3RBbGwoJ3JlY3QubnYtcmFuZ2UnKQorICAgICAgICAgIC5kYXRhKHJhbmdleik7CisKKyAgICAgIHJhbmdlLmVudGVyKCkuYXBwZW5kKCdyZWN0JykKKyAgICAgICAgICAuYXR0cignY2xhc3MnLCBmdW5jdGlvbihkLCBpKSB7IHJldHVybiAnbnYtcmFuZ2UgbnYtcycgKyBpOyB9KQorICAgICAgICAgIC5hdHRyKCd3aWR0aCcsIHcwKQorICAgICAgICAgIC5hdHRyKCdoZWlnaHQnLCBhdmFpbGFibGVIZWlnaHQpCisgICAgICAgICAgLmF0dHIoJ3gnLCByZXZlcnNlID8geDAgOiAwKQorICAgICAgICAgIC5vbignbW91c2VvdmVyJywgZnVuY3Rpb24oZCxpKSB7IAorICAgICAgICAgICAgICBkaXNwYXRjaC5lbGVtZW50TW91c2VvdmVyKHsKKyAgICAgICAgICAgICAgICB2YWx1ZTogZCwKKyAgICAgICAgICAgICAgICBsYWJlbDogKGkgPD0gMCkgPyAnTWF4aW11bScgOiAoaSA+IDEpID8gJ01pbmltdW0nIDogJ01lYW4nLCAvL1RPRE86IG1ha2UgdGhlc2UgbGFiZWxzIGEgdmFyaWFibGUKKyAgICAgICAgICAgICAgICBwb3M6IFt4MShkKSwgYXZhaWxhYmxlSGVpZ2h0LzJdCisgICAgICAgICAgICAgIH0pCisgICAgICAgICAgfSkKKyAgICAgICAgICAub24oJ21vdXNlb3V0JywgZnVuY3Rpb24oZCxpKSB7IAorICAgICAgICAgICAgICBkaXNwYXRjaC5lbGVtZW50TW91c2VvdXQoeworICAgICAgICAgICAgICAgIHZhbHVlOiBkLAorICAgICAgICAgICAgICAgIGxhYmVsOiAoaSA8PSAwKSA/ICdNaW5pbXVtJyA6IChpID49MSkgPyAnTWF4aW11bScgOiAnTWVhbicgLy9UT0RPOiBtYWtlIHRoZXNlIGxhYmVscyBhIHZhcmlhYmxlCisgICAgICAgICAgICAgIH0pCisgICAgICAgICAgfSkKKworICAgICAgZDMudHJhbnNpdGlvbihyYW5nZSkKKyAgICAgICAgICAuYXR0cigneCcsIHJldmVyc2UgPyB4MSA6IDApCisgICAgICAgICAgLmF0dHIoJ3dpZHRoJywgdzEpCisgICAgICAgICAgLmF0dHIoJ2hlaWdodCcsIGF2YWlsYWJsZUhlaWdodCk7CisKKworICAgICAgLy8gVXBkYXRlIHRoZSBtZWFzdXJlIHJlY3RzLgorICAgICAgdmFyIG1lYXN1cmUgPSBnLnNlbGVjdEFsbCgncmVjdC5udi1tZWFzdXJlJykKKyAgICAgICAgICAuZGF0YShtZWFzdXJleik7CisKKyAgICAgIG1lYXN1cmUuZW50ZXIoKS5hcHBlbmQoJ3JlY3QnKQorICAgICAgICAgIC5hdHRyKCdjbGFzcycsIGZ1bmN0aW9uKGQsIGkpIHsgcmV0dXJuICdudi1tZWFzdXJlIG52LXMnICsgaTsgfSkKKyAgICAgICAgICAuc3R5bGUoJ2ZpbGwnLCBmdW5jdGlvbihkLGkpIHsgcmV0dXJuIGNvbG9yKGQsaSApIH0pCisgICAgICAgICAgLmF0dHIoJ3dpZHRoJywgdzApCisgICAgICAgICAgLmF0dHIoJ2hlaWdodCcsIGF2YWlsYWJsZUhlaWdodCAvIDMpCisgICAgICAgICAgLmF0dHIoJ3gnLCByZXZlcnNlID8geDAgOiAwKQorICAgICAgICAgIC5hdHRyKCd5JywgYXZhaWxhYmxlSGVpZ2h0IC8gMykKKyAgICAgICAgICAub24oJ21vdXNlb3ZlcicsIGZ1bmN0aW9uKGQpIHsgCisgICAgICAgICAgICAgIGRpc3BhdGNoLmVsZW1lbnRNb3VzZW92ZXIoeworICAgICAgICAgICAgICAgIHZhbHVlOiBkLAorICAgICAgICAgICAgICAgIGxhYmVsOiAnQ3VycmVudCcsIC8vVE9ETzogbWFrZSB0aGVzZSBsYWJlbHMgYSB2YXJpYWJsZQorICAgICAgICAgICAgICAgIHBvczogW3gxKGQpLCBhdmFpbGFibGVIZWlnaHQvMl0KKyAgICAgICAgICAgICAgfSkKKyAgICAgICAgICB9KQorICAgICAgICAgIC5vbignbW91c2VvdXQnLCBmdW5jdGlvbihkKSB7IAorICAgICAgICAgICAgICBkaXNwYXRjaC5lbGVtZW50TW91c2VvdXQoeworICAgICAgICAgICAgICAgIHZhbHVlOiBkLAorICAgICAgICAgICAgICAgIGxhYmVsOiAnQ3VycmVudCcgLy9UT0RPOiBtYWtlIHRoZXNlIGxhYmVscyBhIHZhcmlhYmxlCisgICAgICAgICAgICAgIH0pCisgICAgICAgICAgfSkKKworICAgICAgZDMudHJhbnNpdGlvbihtZWFzdXJlKQorICAgICAgICAgIC5hdHRyKCd3aWR0aCcsIHcxKQorICAgICAgICAgIC5hdHRyKCdoZWlnaHQnLCBhdmFpbGFibGVIZWlnaHQgLyAzKQorICAgICAgICAgIC5hdHRyKCd4JywgcmV2ZXJzZSA/IHgxIDogMCkKKyAgICAgICAgICAuYXR0cigneScsIGF2YWlsYWJsZUhlaWdodCAvIDMpOworCisKKworICAgICAgLy8gVXBkYXRlIHRoZSBtYXJrZXIgbGluZXMuCisgICAgICB2YXIgbWFya2VyID0gZy5zZWxlY3RBbGwoJ3BhdGgubnYtbWFya2VyVHJpYW5nbGUnKQorICAgICAgICAgIC5kYXRhKG1hcmtlcnopOworCisgICAgICB2YXIgaDMgPSAgYXZhaWxhYmxlSGVpZ2h0IC8gNjsKKyAgICAgIG1hcmtlci5lbnRlcigpLmFwcGVuZCgncGF0aCcpCisgICAgICAgICAgLmF0dHIoJ2NsYXNzJywgJ252LW1hcmtlclRyaWFuZ2xlJykKKyAgICAgICAgICAuYXR0cigndHJhbnNmb3JtJywgZnVuY3Rpb24oZCkgeyByZXR1cm4gJ3RyYW5zbGF0ZSgnICsgeDAoZCkgKyAnLCcgKyAoYXZhaWxhYmxlSGVpZ2h0IC8gMikgKyAnKScgfSkKKyAgICAgICAgICAuYXR0cignZCcsICdNMCwnICsgaDMgKyAnTCcgKyBoMyArICcsJyArICgtaDMpICsgJyAnICsgKC1oMykgKyAnLCcgKyAoLWgzKSArICdaJykKKyAgICAgICAgICAub24oJ21vdXNlb3ZlcicsIGZ1bmN0aW9uKGQsaSkgeworICAgICAgICAgICAgICBkaXNwYXRjaC5lbGVtZW50TW91c2VvdmVyKHsKKyAgICAgICAgICAgICAgICB2YWx1ZTogZCwKKyAgICAgICAgICAgICAgICBsYWJlbDogJ1ByZXZpb3VzJywKKyAgICAgICAgICAgICAgICBwb3M6IFt4MShkKSwgYXZhaWxhYmxlSGVpZ2h0LzJdCisgICAgICAgICAgICAgIH0pCisgICAgICAgICAgfSkKKyAgICAgICAgICAub24oJ21vdXNlb3V0JywgZnVuY3Rpb24oZCxpKSB7CisgICAgICAgICAgICAgIGRpc3BhdGNoLmVsZW1lbnRNb3VzZW91dCh7CisgICAgICAgICAgICAgICAgdmFsdWU6IGQsCisgICAgICAgICAgICAgICAgbGFiZWw6ICdQcmV2aW91cycKKyAgICAgICAgICAgICAgfSkKKyAgICAgICAgICB9KTsKKworICAgICAgZDMudHJhbnNpdGlvbihtYXJrZXIpCisgICAgICAgICAgLmF0dHIoJ3RyYW5zZm9ybScsIGZ1bmN0aW9uKGQpIHsgcmV0dXJuICd0cmFuc2xhdGUoJyArICh4MShkKSAtIHgxKDApKSArICcsJyArIChhdmFpbGFibGVIZWlnaHQgLyAyKSArICcpJyB9KTsKKworICAgICAgbWFya2VyLmV4aXQoKS5yZW1vdmUoKTsKKyovCisKKyAgICB9KTsKKworICAgIC8vIGQzLnRpbWVyLmZsdXNoKCk7ICAvLyBOb3QgbmVlZGVkPworCisgICAgcmV0dXJuIGNoYXJ0OworICB9CisKKworICAvLz09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorICAvLyBFeHBvc2UgUHVibGljIFZhcmlhYmxlcworICAvLy0tLS0tLS0tLS0tLS0tLS0tLS0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worICAgIHRpY2tGb3JtYXQgPSBfOworICAgIHJldHVybiBjaGFydDsKKyAgfTsKKworICBjaGFydC5jb2xvciA9IGZ1bmN0aW9uKF8pIHsKKyAgICBpZiAoIWFyZ3VtZW50cy5sZW5ndGgpIHJldHVybiBjb2xvcjsKKyAgICBjb2xvciA9IG52LnV0aWxzLmdldENvbG9yKF8pOworICAgIHJldHVybiBjaGFydDsKKyAgfTsKKworICAvLz09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorCisKKyAgcmV0dXJuIGNoYXJ0OworfTsKKworCmRpZmYgLS1naXQgYS9lY29tcC1wb3J0YWwtQkUvd2FyL3N0YXRpYy9mdXNpb24vZDMvanMvbW9kZWxzL2J1bGxldENoYXJ0LmpzIGIvZWNvbXAtcG9ydGFsLUJFL3dhci9zdGF0aWMvZnVzaW9uL2QzL2pzL21vZGVscy9idWxsZXRDaGFydC5qcwpuZXcgZmlsZSBtb2RlIDEwMDY0NAppbmRleCAwMDAwMDAwLi5mYTViZDU5Ci0tLSAvZGV2L251bGwKKysrIGIvZWNvbXAtcG9ydGFsLUJFL3dhci9zdGF0aWMvZnVzaW9uL2QzL2pzL21vZGVscy9idWxsZXRDaGFydC5qcwpAQCAtMCwwICsxLDM0MyBAQAorCisvLyBDaGFydCBkZXNpZ24gYmFzZWQgb24gdGhlIHJlY29tbWVuZGF0aW9ucyBvZiBTdGVwaGVuIEZldy4gSW1wbGVtZW50YXRpb24KKy8vIGJhc2VkIG9uIHRoZSB3b3JrIG9mIENsaW50IEl2eSwgSmFtaWUgTG92ZSwgYW5kIEphc29uIERhdmllcy4KKy8vIGh0dHA6Ly9wcm9qZWN0cy5pbnN0YW50Y29nbml0aW9uLmNvbS9wcm90b3Zpcy9idWxsZXRjaGFydC8KK252Lm1vZGVscy5idWxsZXRDaGFydCA9IGZ1bmN0aW9uKCkgeworICAidXNlIHN0cmljdCI7CisgIC8vPT09PT09PT09PT09PT09PT09P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PT09PT09PT09PT09PT09PT09PT09PT0KKworCisgIC8vPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisgIC8vIFByaXZhdGUgVmFyaWFibGVzCisgIC8vLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tCisKKyAgdmFyIHNob3dUb29sdGlwID0gZnVuY3Rpb24oZSwgb2Zmc2V0RWxlbWVudCkgeworICAgIHZhciBsZWZ0ID0gZS5wb3NbMF0gKyAoIG9mZnNldEVsZW1lbnQub2Zmc2V0TGVmdCB8fCAwICkgKyBtYXJnaW4ubGVmdCwKKyAgICAgICAgdG9wID0gZS5wb3NbMV0gKyAoIG9mZnNldEVsZW1lbnQub2Zmc2V0VG9wIHx8IDApICsgbWFyZ2luLnRvcCwKKyAgICAgICAgY29udGVudCA9IHRvb2x0aXAoZS5rZXksIGUubGFiZWwsIGUudmFsdWUsIGUsIGNoYXJ0KTsKKworICAgIG52LnRvb2x0aXAuc2hvdyhbbGVmdCwgdG9wXSwgY29udGVudCwgZS52YWx1ZSA8IDAgPyAnZScgOiAndycsIG51bGwsIG9mZnNldEVsZW1lbnQpOworICB9OworCisgIC8vPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisKKworICBmdW5jdGlvbiBjaGFydChzZWxlY3Rpb24pIHsKKyAgICBzZWxlY3Rpb24uZWFjaChmdW5jdGlvbihkLCBpKSB7CisgICAgICB2YXIgY29udGFpbmVyID0gZDMuc2VsZWN0KHRoaXMpOworCisgICAgICB2YXIgYXZhaWxhYmxlV2lkdGggPSAod2lkdGggIHx8IHBhcnNlSW50KGNvbnRhaW5lci5zdHlsZSgnd2lkdGgnKSkgfHwgOTYwKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAtIG1hcmdpbi5sZWZ0IC0gbWFyZ2luLnJpZ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sbGV0V2lkdGgoeCkgeworICAgICAgICB2YXIgeDAgPSB4KDApOworICAgICAgICByZXR1cm4gZnVuY3Rpb24oZCkgeworICAgICAgICAgIHJldHVybiBNYXRoLmFicyh4KGQpIC0geCgwKSk7CisgICAgICAgIH07CisgICAgICB9CisKKyAgICAgIGZ1bmN0aW9uIGJ1bGxldFRyYW5zbGF0ZSh4KSB7CisgICAgICAgIHJldHVybiBmdW5jdGlvbihkKSB7CisgICAgICAgICAgcmV0dXJuICd0cmFuc2xhdGUoJyArIHgoZCkgKyAnLDApJzsKKyAgICAgICAgfTsKKyAgICAgIH0KKyAgICAgICovCisKKyAgICAgIHZhciB3MCA9IGZ1bmN0aW9uKGQpIHsgcmV0dXJuIE1hdGguYWJzKHgwKGQpIC0geDAoMCkpIH0sIC8vIFRPRE86IGNvdWxkIG9wdGltaXplIGJ5IHByZWNhbGN1bGF0aW5nIHgwKDApIGFuZCB4MSgwKQorICAgICAgICAgIHcxID0gZnVuY3Rpb24oZCkgeyByZXR1cm4gTWF0aC5hYnMoeDEoZCkgLSB4MSgwKSkgfTsKKworCisgICAgICB2YXIgdGl0bGUgPSBnRW50ZXIuc2VsZWN0KCcubnYtdGl0bGVzJykuYXBwZW5kKCdnJykKKyAgICAgICAgICAuYXR0cigndGV4dC1hbmNob3InLCAnZW5kJykKKyAgICAgICAgICAuYXR0cigndHJhbnNmb3JtJywgJ3RyYW5zbGF0ZSgtNiwnICsgKGhlaWdodCAtIG1hcmdpbi50b3AgLSBtYXJnaW4uYm90dG9tKSAvIDIgKyAnKScpOworICAgICAgdGl0bGUuYXBwZW5kKCd0ZXh0JykKKyAgICAgICAgICAuYXR0cignY2xhc3MnLCAnbnYtdGl0bGUnKQorICAgICAgICAgIC50ZXh0KGZ1bmN0aW9uKGQpIHsgcmV0dXJuIGQudGl0bGU7IH0pOworCisgICAgICB0aXRsZS5hcHBlbmQoJ3RleHQnKQorICAgICAgICAgIC5hdHRyKCdjbGFzcycsICdudi1zdWJ0aXRsZ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wYWNpdHknLCAxZS02KTsKKworICAgICAgdGlja0VudGVyLmFwcGVuZCgnbGluZScpCisgICAgICAgICAgLmF0dHIoJ3kxJywgYXZhaWxhYmxlSGVpZ2h0KQorICAgICAgICAgIC5hdHRyKCd5MicsIGF2YWlsYWJsZUhlaWdodCAqIDcgLyA2KTsKKworICAgICAgdGlja0VudGVyLmFwcGVuZCgndGV4dCcpCisgICAgICAgICAgLmF0dHIoJ3RleHQtYW5jaG9yJywgJ21pZGRsZScpCisgICAgICAgICAgLmF0dHIoJ2R5JywgJzFlbScpCisgICAgICAgICAgLmF0dHIoJ3knLCBhdmFpbGFibGVIZWlnaHQgKiA3IC8gNikKKyAgICAgICAgICAudGV4dChmb3JtYXQpOworCisKKyAgICAgIC8vIFRyYW5zaXRpb24gdGhlIHVwZGF0aW5nIHRpY2tzIHRvIHRoZSBuZXcgc2NhbGUsIHgxLgorICAgICAgdmFyIHRpY2tVcGRhdGUgPSBkMy50cmFuc2l0aW9uKHRpY2spCisgICAgICAgICAgLmF0dHIoJ3RyYW5zZm9ybScsIGZ1bmN0aW9uKGQpIHsgcmV0dXJuICd0cmFuc2xhdGUoJyArIHgxKGQpICsgJywwKScgfSkKKyAgICAgICAgICAuc3R5bGUoJ29wYWNpdHknLCAxKTsKKworICAgICAgdGlja1VwZGF0ZS5zZWxlY3QoJ2xpbmUnKQorICAgICAgICAgIC5hdHRyKCd5MScsIGF2YWlsYWJsZUhlaWdodCkKKyAgICAgICAgICAuYXR0cigneTInLCBhdmFpbGFibGVIZWlnaHQgKiA3IC8gNik7CisKKyAgICAgIHRpY2tVcGRhdGUuc2VsZWN0KCd0ZXh0JykKKyAgICAgICAgICAuYXR0cigneScsIGF2YWlsYWJsZUhlaWdodCAqIDcgLyA2KTsKKworICAgICAgLy8gVHJhbnNpdGlvbiB0aGUgZXhpdGluZyB0aWNrcyB0byB0aGUgbmV3IHNjYWxlLCB4MS4KKyAgICAgIGQzLnRyYW5zaXRpb24odGljay5leGl0KCkpCisgICAgICAgICAgLmF0dHIoJ3RyYW5zZm9ybScsIGZ1bmN0aW9uKGQpIHsgcmV0dXJuICd0cmFuc2xhdGUoJyArIHgxKGQpICsgJywwKScgfSkKKyAgICAgICAgICAuc3R5bGUoJ29wYWNpdHknLCAxZS02KQorICAgICAgICAgIC5yZW1vdmUoKTsKKworCisgICAgICAvLz09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorICAgICAgLy8gRXZlbnQgSGFuZGxpbmcvRGlzcGF0Y2hpbmcgKGluIGNoYXJ0J3Mgc2NvcGUpCisgICAgICAvLy0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLQorCisgICAgICBkaXNwYXRjaC5vbigndG9vbHRpcFNob3cnLCBmdW5jdGlvbihlKSB7CisgICAgICAgIGUua2V5ID0gZC50aXRsZTsKKyAgICAgICAgaWYgKHRvb2x0aXBzKSBzaG93VG9vbHRpcChlLCB0aGF0LnBhcmVudE5vZGUpOworICAgICAgfSk7CisKKyAgICAgIC8vPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisKKyAgICB9KTsKKworICAgIGQzLnRpbWVyLmZsdXNoKCk7CisKKyAgICByZXR1cm4gY2hhcnQ7CisgIH0KKworCisgIC8vPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisgIC8vIEV2ZW50IEhhbmRsaW5nL0Rpc3BhdGNoaW5nIChvdXQgb2YgY2hhcnQncyBzY29wZSkKKyAgLy8tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0KKworICBidWxsZXQuZGlzcGF0Y2gub24oJ2VsZW1lbnRNb3VzZW92ZXIudG9vbHRpcCcsIGZ1bmN0aW9uKGUpIHsKKyAgICBkaXNwYXRjaC50b29sdGlwU2hvdyhlKTsKKyAgfSk7CisKKyAgYnVsbGV0LmRpc3BhdGNoLm9uKCdlbGVtZW50TW91c2VvdXQudG9vbHRpcCcsIGZ1bmN0aW9uKGUpIHsKKyAgICBkaXNwYXRjaC50b29sdGlwSGlkZShlKTsKKyAgfSk7CisKKyAgZGlzcGF0Y2gub24oJ3Rvb2x0aXBIaWRlJywgZnVuY3Rpb24oKSB7CisgICAgaWYgKHRvb2x0aXBzKSBudi50b29sdGlwLmNsZWFudXAoKTsKKyAgfSk7CisKKyAgLy89PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKworCisgIC8vPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisgIC8vIEV4cG9zZSBQdWJsaWMgVmFyaWFibGVzCisgIC8vLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tCisKKyAgY2hhcnQuZGlzcGF0Y2ggPSBkaXNwYXRjaDsKKyAgY2hhcnQuYnVsbGV0ID0gYnVsbGV0OworCisgIGQzLnJlYmluZChjaGFydCwgYnVsbGV0LCAnY29sb3InKTsKKworICBjaGFydC5vcHRpb25zID0gbnYudXRpbHMub3B0aW9uc0Z1bmMuYmluZChjaGFydCk7CisgIAorICAvLyBsZWZ0LCByaWdodCwgdG9wLCBib3R0b20KKyAgY2hhcnQub3JpZW50ID0gZnVuY3Rpb24oeCkgeworICAgIGlmICghYXJndW1lbnRzLmxlbmd0aCkgcmV0dXJuIG9yaWVudDsKKyAgICBvcmllbnQgPSB4OworICAgIHJldmVyc2UgPSBvcmllbnQgPT0gJ3JpZ2h0JyB8fCBvcmllbnQgPT0gJ2JvdHRvbSc7CisgICAgcmV0dXJuIGNoYXJ0OworICB9OworCisgIC8vIHJhbmdl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uZ2UnLCAnY2hhbmdlU3RhdGUnKQorICAgICwgdHJhbnNpdGlvbkR1cmF0aW9uID0gMjUwCisgICAgOworCisgIHhBeGlzCisgICAgLm9yaWVudCgnYm90dG9tJykKKyAgICAudGlja1BhZGRpbmcoNykKKyAgICA7CisgIHlBeGlzCisgICAgLm9yaWVudCgocmlnaHRBbGlnbllBeGlzKSA/ICdyaWdodCcgOiAnbGVmdCcpCisgICAgOworCisgIC8vPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisgIGNvbnRyb2xzLnVwZGF0ZVN0YXRlKGZhbHNlKTsKKworICAvLz09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorICAvLyBQcml2YXRlIFZhcmlhYmxlcworICAvLy0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLQorCisgICB2YXIgZHggPSBkMy5zY2FsZS5saW5lYXIoKQorICAgICAsIGluZGV4ID0ge2k6IDAsIHg6IDB9CisgICAgIDsKKworICB2YXIgc2hvd1Rvb2x0aXAgPSBmdW5jdGlvbihlLCBvZmZzZXRFbGVtZW50KSB7CisgICAgdmFyIGxlZnQgPSBlLnBvc1swXSArICggb2Zmc2V0RWxlbWVudC5vZmZzZXRMZWZ0IHx8IDAgKSwKKyAgICAgICAgdG9wID0gZS5wb3NbMV0gKyAoIG9mZnNldEVsZW1lbnQub2Zmc2V0VG9wIHx8IDApLAorICAgICAgICB4ID0geEF4aXMudGlja0Zvcm1hdCgpKGxpbmVzLngoKShlLnBvaW50LCBlLnBvaW50SW5kZXgpKSwKKyAgICAgICAgeSA9IHlBeGlzLnRpY2tGb3JtYXQoKShsaW5lcy55KCkoZS5wb2ludCwgZS5wb2ludEluZGV4KSksCisgICAgICAgIGNvbnRlbnQgPSB0b29sdGlwKGUuc2VyaWVzLmtleSwgeCwgeSwgZSwgY2hhcnQpOworCisgICAgbnYudG9vbHRpcC5zaG93KFtsZWZ0LCB0b3BdLCBjb250ZW50LCBudWxsLCBudWxsLCBvZmZzZXRFbGVtZW50KTsKKyAgfTsKKworLyoKKyAgLy9Nb3ZlZCB0byBzZWUgaWYgd2UgY2FuIGdldCBiZXR0ZXIgYmVoYXZpb3IgdG8gZml4IGlzc3VlICMzMTUKKyAgdmFyIGluZGV4RHJhZyA9IGQzLmJlaGF2aW9yLmRyYWcoKQorICAgICAgICAgICAgICAgICAgICAub24oJ2RyYWdzdGFydCcsIGRyYWdTdGFydCkKKyAgICAgICAgICAgICAgICAgICAgLm9uKCdkcmFnJywgZHJhZ01vdmUpCisgICAgICAgICAgICAgICAgICAgIC5vbignZHJhZ2VuZCcsIGRyYWdFbmQpOworCisgIGZ1bmN0aW9uIGRyYWdTdGFydChkLGkpIHsKKyAgICBkMy5zZWxlY3QoY2hhcnQuY29udGFpbmVyKQorICAgICAgICAuc3R5bGUoJ2N1cnNvcicsICdldy1yZXNpemUnKTsKKyAgfQorCisgIGZ1bmN0aW9uIGRyYWdNb3ZlKGQsaSkgeworICAgIGQueCArPSBkMy5ldmVudC5keDsKKyAgICBkLmkgPSBNYXRoLnJvdW5kKGR4LmludmVydChkLngpKTsKKworICAgIGQzLnNlbGVjdCh0aGlzKS5hdHRyKCd0cmFuc2Zvcm0nLCAndHJhbnNsYXRlKCcgKyBkeChkLmkpICsgJywwKScpOworICAgIGNoYXJ0LnVwZGF0ZSgpOworICB9CisKKyAgZnVuY3Rpb24gZHJhZ0VuZChkLGkpIHsKKyAgICBkMy5zZWxlY3QoY2hhcnQuY29udGFpbmVyKQorICAgICAgICAuc3R5bGUoJ2N1cnNvcicsICdhdXRvJyk7CisgICAgY2hhcnQudXBkYXRlKCk7CisgIH0KKyovCisKKyAgLy89PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKworCisgIGZ1bmN0aW9uIGNoYXJ0KHNlbGVjdGlvbikgeworICAgIHNlbGVjdGlvbi5lYWNoKGZ1bmN0aW9uKGRhdGEpIHsKKyAgICAgIHZhciBjb250YWluZXIgPSBkMy5zZWxlY3QodGhpcykuY2xhc3NlZCgnbnYtY2hhcnQtJyArIGlkLCB0cnVlKSwKKyAgICAgICAgICB0aGF0ID0gdGhpczsKKworICAgICAgdmFyIGF2YWlsYWJsZVdpZHRoID0gKHdpZHRoICB8fCBwYXJzZUludChjb250YWluZXIuc3R5bGUoJ3dpZHRoJykpIHx8IDk2MCkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLSBtYXJnaW4ubGVmdCAtIG1hcmdpbi5yaWdodCwKKyAgICAgICAgICBhdmFpbGFibGVIZWlnaHQgPSAoaGVpZ2h0IHx8IHBhcnNlSW50KGNvbnRhaW5lci5zdHlsZSgnaGVpZ2h0JykpIHx8IDQwMCkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLSBtYXJnaW4udG9wIC0gbWFyZ2luLmJvdHRvbTsKKworCisgICAgICBjaGFydC51cGRhdGUgPSBmdW5jdGlvbigpIHsgY29udGFpbmVyLnRyYW5zaXRpb24oKS5kdXJhdGlvbih0cmFuc2l0aW9uRHVyYXRpb24pLmNhbGwoY2hhcnQpIH07CisgICAgICBjaGFydC5jb250YWluZXIgPSB0aGlzOworCisgICAgICAvL3NldCBzdGF0ZS5kaXNhYmxlZAorICAgICAgc3RhdGUuZGlzYWJsZWQgPSBkYXRhLm1hcChmdW5jdGlvbihkKSB7IHJldHVybiAhIWQuZGlzYWJsZWQgfSk7CisKKyAgICAgIGlmICghZGVmYXVsdFN0YXRlKSB7CisgICAgICAgIHZhciBrZXk7CisgICAgICAgIGRlZmF1bHRTdGF0ZSA9IHt9OworICAgICAgICBmb3IgKGtleSBpbiBzdGF0ZSkgeworICAgICAgICAgIGlmIChzdGF0ZVtrZXldIGluc3RhbmNlb2YgQXJyYXkpCisgICAgICAgICAgICBkZWZhdWx0U3RhdGVba2V5XSA9IHN0YXRlW2tleV0uc2xpY2UoMCk7CisgICAgICAgICAgZWxzZQorICAgICAgICAgICAgZGVmYXVsdFN0YXRlW2tleV0gPSBzdGF0ZVtrZXldOworICAgICAgICB9CisgICAgICB9CisKKyAgICAgIHZhciBpbmRleERyYWcgPSBkMy5iZWhhdmlvci5kcmFnKCkKKyAgICAgICAgICAgICAgICAgICAgICAgIC5vbignZHJhZ3N0YXJ0JywgZHJhZ1N0YXJ0KQorICAgICAgICAgICAgICAgICAgICAgICAgLm9uKCdkcmFnJywgZHJhZ01vdmUpCisgICAgICAgICAgICAgICAgICAgICAgICAub24oJ2RyYWdlbmQnLCBkcmFnRW5kKTsKKworCisgICAgICBmdW5jdGlvbiBkcmFnU3RhcnQoZCxpKSB7CisgICAgICAgIGQzLnNlbGVjdChjaGFydC5jb250YWluZXIpCisgICAgICAgICAgICAuc3R5bGUoJ2N1cnNvcicsICdldy1yZXNpemUnKTsKKyAgICAgIH0KKworICAgICAgZnVuY3Rpb24gZHJhZ01vdmUoZCxpKSB7CisgICAgICAgIGluZGV4LnggPSBkMy5ldmVudC54OworICAgICAgICBpbmRleC5pID0gTWF0aC5yb3VuZChkeC5pbnZlcnQoaW5kZXgueCkpOworICAgICAgICB1cGRhdGVaZXJvKCk7CisgICAgICB9CisKKyAgICAgIGZ1bmN0aW9uIGRyYWdFbmQoZCxpKSB7CisgICAgICAgIGQzLnNlbGVjdChjaGFydC5jb250YWluZXIpCisgICAgICAgICAgICAuc3R5bGUoJ2N1cnNvcicsICdhdXRvJyk7CisKKyAgICAgICAgLy8gdXBkYXRlIHN0YXRlIGFuZCBzZW5kIHN0YXRlQ2hhbmdlIHdpdGggbmV3IGluZGV4CisgICAgICAgIHN0YXRlLmluZGV4ID0gaW5kZXguaTsKKyAgICAgICAgZGlzcGF0Y2guc3RhdGVDaGFuZ2Uoc3RhdGUpOworICAgICAgfQorCisgICAgICAvLy0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS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S0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLQorICAgICAgLy8gU2V0dXAgU2NhbGVzCisKKyAgICAgIHggPSBsaW5lcy54U2NhbGUoKTsKKyAgICAgIHkgPSBsaW5lcy55U2NhbGUoKTsKKworCisgICAgICBpZiAoIXJlc2NhbGVZKSB7CisgICAgICAgIHZhciBzZXJpZXNEb21haW5zID0gZGF0YQorICAgICAgICAgIC5maWx0ZXIoZnVuY3Rpb24oc2VyaWVzKSB7IHJldHVybiAhc2VyaWVzLmRpc2FibGVkIH0pCisgICAgICAgICAgLm1hcChmdW5jdGlvbihzZXJpZXMsaSkgeworICAgICAgICAgICAgdmFyIGluaXRpYWxEb21haW4gPSBkMy5leHRlbnQoc2VyaWVzLnZhbHVlcywgbGluZXMueSgpKTsKKworICAgICAgICAgICAgLy9hY2NvdW50IGZvciBzZXJpZXMgYmVpbmcgZGlzYWJsZWQgd2hlbiBsb3NpbmcgOTUlIG9yIG1vcmUKKyAgICAgICAgICAgIGlmIChpbml0aWFsRG9tYWluWzBdIDwgLS45NSkgaW5pdGlhbERvbWFpblswXSA9IC0uOTU7CisKKyAgICAgICAgICAgIHJldHVybiBbCisgICAgICAgICAgICAgIChpbml0aWFsRG9tYWluWzBdIC0gaW5pdGlhbERvbWFpblsxXSkgLyAoMSArIGluaXRpYWxEb21haW5bMV0pLAorICAgICAgICAgICAgICAoaW5pdGlhbERvbWFpblsxXSAtIGluaXRpYWxEb21haW5bMF0pIC8gKDEgKyBpbml0aWFsRG9tYWluWzBdKQorICAgICAgICAgICAgXTsKKyAgICAgICAgICB9KTsKKworICAgICAgICB2YXIgY29tcGxldGVEb21haW4gPSBbCisgICAgICAgICAgZDMubWluKHNlcmllc0RvbWFpbnMsIGZ1bmN0aW9uKGQpIHsgcmV0dXJuIGRbMF0gfSksCisgICAgICAgICAgZDMubWF4KHNlcmllc0RvbWFpbnMsIGZ1bmN0aW9uKGQpIHsgcmV0dXJuIGRbMV0gfSkKKyAgICAgIC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wICE9IGxlZ2VuZC5oZWlnaHQoKSkgeworICAgICAgICAgIG1hcmdpbi50b3AgPSBsZWdlbmQuaGVpZ2h0KCk7CisgICAgICAgICAgYXZhaWxhYmxlSGVpZ2h0ID0gKGhlaWdodCB8fCBwYXJzZUludChjb250YWluZXIuc3R5bGUoJ2hlaWdodCcpKSB8fCA0MDApCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC0gbWFyZ2luLnRvcCAtIG1hcmdpbi5ib3R0b207CisgICAgICAgIH0KKworICAgICAgICBnLnNlbGVjdCgnLm52LWxlZ2VuZFdyYXAnKQorICAgICAgICAgICAgLmF0dHIoJ3RyYW5zZm9ybScsICd0cmFuc2xhdGUoMCwnICsgKC1tYXJnaW4udG9wKSArJyknKQorICAgICAgfQorCisgICAgICAvLy0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLQorCisKKyAgICAgIC8vLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tCisgICAgICAvLyBDb250cm9scworCisgICAgICBpZiAoc2hvd0NvbnRyb2xzKSB7CisgICAgICAgIHZhciBjb250cm9sc0RhdGEgPSBbCisgICAgICAgICAgeyBrZXk6ICdSZS1zY2FsZSB5LWF4aXMnLCBkaXNhYmxlZDogIXJlc2NhbGVZIH0KKyAgICAgICAgXTsKKworICAgICAgICBjb250cm9scy53aWR0aCgxNDApLmNvbG9yKFsnIzQ0NCcsICcjNDQ0JywgJyM0NDQnXSk7CisgICAgICAgIGcuc2VsZWN0KCcubnYtY29udHJvbHNXcmFwJykKKyAgICAgICAgICAgIC5kYXR1bShjb250cm9sc0RhdGEpCisgICAgICAgICAgICAuYXR0cigndHJhbnNmb3JtJywgJ3RyYW5zbGF0ZSgwLCcgKyAoLW1hcmdpbi50b3ApICsnKScpCisgICAgICAgICAgICAuY2FsbChjb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GNhbm5vdCBiZSBjYWxjdWxhdGVkIGZvciB0aGlzIHRpbWUgcGVyaW9kLicpOworICAgICAgfQorCisgICAgICAvLy0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLQorICAgICAgLy8gTWFpbiBDaGFydCBDb21wb25lbnQocykKKyAgICAgIAorICAgICAgLy8tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0KKyAgICAgIC8vU2V0IHVwIGludGVyYWN0aXZlIGxheWVyCisgICAgICBpZiAodXNlSW50ZXJhY3RpdmVHdWlkZWxpbmUpIHsKKyAgICAgICAgaW50ZXJhY3RpdmVMYXllcgorICAgICAgICAgIC53aWR0aChhdmFpbGFibGVXaWR0aCkKKyAgICAgICAgICAuaGVpZ2h0KGF2YWlsYWJsZUhlaWdodCkKKyAgICAgICAgICAubWFyZ2luKHtsZWZ0Om1hcmdpbi5sZWZ0LHRvcDptYXJnaW4udG9wfSkKKyAgICAgICAgICAuc3ZnQ29udGFpbmVyKGNvbnRhaW5lcikKKyAgICAgICAgICAueFNjYWxlKHgpOworICAgICAgICB3cmFwLnNlbGVjdCgiLm52LWludGVyYWN0aXZlIikuY2FsbChpbnRlcmFjdGl2ZUxheWVyKTsKKyAgICAgIH0KKworICAgICAgZ0VudGVyLnNlbGVjdCgnLm52LWJhY2tncm91bmQnKQorICAgICAgICAuYXBwZW5kKCdyZWN0Jyk7CisKKyAgICAgIGcuc2VsZWN0KCcubnYtYmFja2dyb3VuZCByZWN0JykKKyAgICAgICAgICAuYXR0cignd2lkdGgnLCBhdmFpbGFibGVXaWR0aCkKKyAgICAgICAgICAuYXR0cignaGVpZ2h0JywgYXZhaWxhYmxlSGVpZ2h0KTsKKworICAgICAgbGluZXMKKyAgICAgICAgLy8ueChmdW5jdGlvbihkKSB7IHJldHVybiBkLnggfSkKK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B2YXIgYXZnTGluZXMgPSBnLnNlbGVjdCgiLm52LWF2Z0xpbmVzV3JhcCIpLnNlbGVjdEFsbCgibGluZSIpCisgICAgICAgICAgICAgIC5kYXRhKGF2Z0xpbmVEYXRhLCBmdW5jdGlvbihkKSB7IHJldHVybiBkLmtleTsgfSk7CisKKyAgICAgIHZhciBnZXRBdmdMaW5lWSA9IGZ1bmN0aW9uKGQpIHsKKyAgICAgICAgICAvL0lmIGF2ZXJhZ2UgbGluZXMgZ28gb2ZmIHRoZSBzdmcgZWxlbWVudCwgY2xhbXAgdGhlbSB0byB0aGUgc3ZnIGJvdW5kcy4KKyAgICAgICAgICB2YXIgeVZhbCA9IHkoYXZlcmFnZShkKSk7CisgICAgICAgICAgaWYgKHlWYWwgPCAwKSByZXR1cm4gMDsKKyAgICAgICAgICBpZiAoeVZhbCA+IGF2YWlsYWJsZUhlaWdodCkgcmV0dXJuIGF2YWlsYWJsZUhlaWdodDsKKyAgICAgICAgICByZXR1cm4geVZhbDsKKyAgICAgIH07CisKKyAgICAgIGF2Z0xpbmVzLmVudGVyKCkKKyAgICAgICAgICAgICAgLmFwcGVuZCgnbGluZScpCisgICAgICAgICAgICAgIC5zdHlsZSgnc3Ryb2tlLXdpZHRoJywyKQorICAgICAgICAgICAgICAuc3R5bGUoJ3N0cm9rZS1kYXNoYXJyYXknLCcxMCwxMCcpCisgICAgICAgICAgICAgIC5zdHlsZSgnc3Ryb2tlJyxmdW5jdGlvbiAoZCxpKSB7CisgICAgICAgICAgICAgICAgICByZXR1cm4gbGluZXMuY29sb3IoKShkLGQuc2VyaWVzSW5kZXgpOworICAgICAgICAgICAgICB9KQorICAgICAgICAgICAgICAuYXR0cigneDEnLDApCisgICAgICAgICAgICAgIC5hdHRyKCd4MicsYXZhaWxhYmxlV2lkdGgpCisgICAgICAgICAgICAgIC5hdHRyKCd5MScsIGdldEF2Z0xpbmVZKQorICAgICAgICAgICAgICAuYXR0cigneTInLCBnZXRBdmdMaW5lWSk7CisKKyAgICAgIGF2Z0xpbmVzCisgICAgICAgICAgICAgIC5zdHlsZSgnc3Ryb2tlLW9wYWNpdHknLGZ1bmN0aW9uKGQpeworICAgICAgICAgICAgICAgICAgLy9JZiBhdmVyYWdlIGxpbmVzIGdvIG9mZnNjcmVlbiwgbWFrZSB0aGVtIHRyYW5zcGFyZW50CisgICAgICAgICAgICAgICAgICB2YXIgeVZhbCA9IHkoYXZlcmFnZShkKSk7CisgICAgICAgICAgICAgICAgICBpZiAoeVZhbCA8IDAgfHwgeVZhbCA+IGF2YWlsYWJsZUhlaWdodCkgcmV0dXJuIDA7CisgICAgICAgICAgICAgICAgICByZXR1cm4gMTsKKyAgICAgICAgICAgICAgfSkKKyAgICAgICAgICAgICAgLmF0dHIoJ3gxJywwKQorICAgICAgICAgICAgICAuYXR0cigneDInLGF2YWlsYWJsZVdpZHRoKQorICAgICAgICAgICAgICAuYXR0cigneTEnLCBnZXRBdmdMaW5lWSkKKyAgICAgICAgICAgICAgLmF0dHIoJ3kyJywgZ2V0QXZnTGluZVkpOworCisgICAgICBhdmdMaW5lcy5leGl0KCkucmVtb3ZlKCk7CisKKyAgICAgIC8vQ3JlYXRlIGluZGV4IGxpbmUgLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0KKworICAgICAgdmFyIGluZGV4TGluZSA9IGxpbmVzV3JhcC5zZWxlY3RBbGwoJy5udi1pbmRleExpbmUnKQorICAgICAgICAgIC5kYXRhKFtpbmRleF0pOworICAgICAgaW5kZXhMaW5lLmVudGVyKCkuYXBwZW5kKCdyZWN0JykuYXR0cignY2xhc3MnLCAnbnYtaW5kZXhMaW5lJykKKyAgICAgICAgICAuYXR0cignd2lkdGgnLCAzKQorICAgICAgICAgIC5hdHRyKCd4JywgLTIpCisgICAgICAgICAgLmF0dHIoJ2ZpbGwnLCAncmVkJykKKyAgICAgICAgICAuYXR0cignZmlsbC1vcGFjaXR5JywgLjUpCisgICAgICAgICAgLnN0eWxlKCJwb2ludGVyLWV2ZW50cyIsImFsbCIpCisgICAgICAgICAgLmNhbGwoaW5kZXhEcmFnKQorCisgICAgICBpbmRleExpbmUKKyAgICAgICAgICAuYXR0cigndHJhbnNmb3JtJywgZnVuY3Rpb24oZCkgeyByZXR1cm4gJ3RyYW5zbGF0ZSgnICsgZHgoZC5pKSArICcsMCknIH0pCisgICAgICAgICAgLmF0dHIoJ2hlaWdodCcsIGF2YWlsYWJsZUhlaWdodCkKKworICAgICAgLy8tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0KKworCisgICAgICAvLy0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLQorICAgICAgLy8gU2V0dXAgQXhlcworCisgICAgICBpZiAoc2hvd1hBeGlzKSB7CisgICAgICAgIHhBeGlzCisgICAgICAgICAgLnNjYWxlKHgpCisgICAgICAgICAgLy9TdWdnZXN0IGhvdyBtYW55IHRpY2tzIGJhc2VkIG9uIHRoZSBjaGFydCB3aWR0aCBhbmQgRDMgc2hvdWxkIGxpc3RlbiAoNzAgaXMgdGhlIG9wdGltYWwgbnVtYmVyIGZvciBNTS9ERC9ZWSBkYXRlcykKKyAgICAgICAgICAudGlja3MoIE1hdGgubWluKGRhdGFbMF0udmFsdWVzLmxlbmd0aCxhdmFpbGFibGVXaWR0aC83MCkgKQorICAgICAgICAgIC50aWNrU2l6ZSgtYXZhaWxhYmxlSGVpZ2h0LCAwKTsKKworICAgICAgICBnLnNlbGVjdCgnLm52LXgubnYtYXhpcycpCisgICAgICAgICAgICAuYXR0cigndHJhbnNmb3JtJywgJ3RyYW5zbGF0ZSgwLCcgKyB5LnJhbmdlKClbMF0gKyAnKScpOworICAgICAgICBkMy50cmFuc2l0aW9uKGcuc2VsZWN0KCcubnYteC5udi1heGlzJykpCisgICAgICAgICAgICAuY2FsbCh4QXhpcyk7CisgICAgICB9CisKKworICAgICAgaWYgKHNob3dZQXhpcykgeworICAgICAgICB5QXhpcworICAgICAgICAgIC5zY2FsZSh5KQorICAgICAgICAgIC50aWNrcyggYXZhaWxhYmxlSGVpZ2h0IC8gMzYgKQorICAgICAgICAgIC50aWNrU2l6ZSggLWF2YWlsYWJsZVdpZHRoLCAwKTsKKworICAgICAgICBkMy50cmFuc2l0aW9uKGcuc2VsZWN0KCcubnYteS5udi1heGlzJykpCisgICAgICAgICAgICAuY2FsbCh5QXhpcyk7CisgICAgICB9CisgICAgICAvLy0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLQorCisKKyAgICAgIC8vPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisgICAgICAvLyBFdmVudCBIYW5kbGluZy9EaXNwYXRjaGluZyAoaW4gY2hhcnQncyBzY29wZSkKKyAgICAgIC8vLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tCisKKworICAgICAgZnVuY3Rpb24gdXBkYXRlWmVybygpIHsKKyAgICAgICAgaW5kZXhMaW5lCisgICAgICAgICAgLmRhdGEoW2luZGV4XSk7CisgICAgICAgIAorICAgICAgICAvL1doZW4gZHJhZ2dpbmcgdGhlIGluZGV4IGxpbmUsIHR1cm4gb2ZmIGxpbmUgdHJhbnNpdGlvbnMuCisgICAgICAgIC8vIFRoZW4gdHVybiB0aGVtIGJhY2sgb24gd2hlbiBkb25lIGRyYWdnaW5nLgorICAgICAgICB2YXIgb2xkRHVyYXRpb24gPSBjaGFydC50cmFuc2l0aW9uRHVyYXRpb24oKTsKKyAgICAgICAgY2hhcnQudHJhbnNpdGlvbkR1cmF0aW9uKDApOworICAgICAgICBjaGFydC51cGRhdGUoKTsKKyAgICAgICAgY2hhcnQudHJhbnNpdGlvbkR1cmF0aW9uKG9sZER1cmF0aW9uKTsKKyAgICAgIH0KKworICAgICAgZy5zZWxlY3QoJy5udi1iYWNrZ3JvdW5kIHJlY3QnKQorICAgICAgICAgIC5vbignY2xpY2snLCBmdW5jdGlvbigpIHsKKyAgICAgICAgICAgIGluZGV4LnggPSBkMy5tb3VzZSh0aGlzKVswXTsKKyAgICAgICAgICAgIGluZGV4LmkgPSBNYXRoLnJvdW5kKGR4LmludmVydChpbmRleC54KSk7CisKKyAgICAgICAgICAgIC8vIHVwZGF0ZSBzdGF0ZSBhbmQgc2VuZCBzdGF0ZUNoYW5nZSB3aXRoIG5ldyBpbmRleAorICAgICAgICAgICAgc3RhdGUuaW5kZXggPSBpbmRleC5pOworICAgICAgICAgICAgZGlzcGF0Y2guc3RhdGVDaGFuZ2Uoc3RhdGUpOworCisgICAgICAgICAgICB1cGRhdGVaZXJvKCk7CisgICAgICAgICAgfSk7CisKKyAgICAgIGxpbmVzLmRpc3BhdGNoLm9uKCdlbGVtZW50Q2xpY2snLCBmdW5jdGlvbihlKSB7CisgICAgICAgIGluZGV4LmkgPSBlLnBvaW50SW5kZXg7CisgICAgICAgIGluZGV4LnggPSBkeChpbmRleC5pKTsKKworICAgICAgICAvLyB1cGRhdGUgc3RhdGUgYW5kIHNlbmQgc3RhdGVDaGFuZ2Ugd2l0aCBuZXcgaW5kZXgKKyAgICAgICAgc3RhdGUuaW5kZXggPSBpbmRleC5pOworICAgICAgICBkaXNwYXRjaC5zdGF0ZUNoYW5nZShzdGF0ZSk7CisKKyAgICAgICAgdXBkYXRlWmVybygpOworICAgICAgfSk7CisKKyAgICAgIGNvbnRyb2xzLmRpc3BhdGNoLm9uKCdsZWdlbmRDbGljaycsIGZ1bmN0aW9uKGQsaSkgeyAKKyAgICAgICAgZC5kaXNhYmxlZCA9ICFkLmRpc2FibGVkOworICAgICAgICByZXNjYWxlWSA9ICFkLmRpc2FibGVkOworCisgICAgICAgIHN0YXRlLnJlc2NhbGVZID0gcmVzY2FsZVk7CisgICAgICAgIGRpc3BhdGNoLnN0YXRlQ2hhbmdlKHN0YXRlKTsKKyAgICAgICAgY2hhcnQudXBkYXRlKCk7CisgICAgICB9KTsKKworCisgICAgICBsZWdlbmQuZGlzcGF0Y2gub24oJ3N0YXRlQ2hhbmdlJywgZnVuY3Rpb24obmV3U3RhdGUpIHsKKyAgICAgICAgc3RhdGUuZGlzYWJsZWQgPSBuZXdTdGF0ZS5kaXNhYmxlZDsgCisgICAgICAgIGRpc3BhdGNoLnN0YXRlQ2hhbmdlKHN0YXRlKTsKKyAgICAgICAgY2hhcnQudXBkYXRlKCk7CisgICAgICB9KTsKKworICAgICAgaW50ZXJhY3RpdmVMYXllci5kaXNwYXRjaC5vbignZWxlbWVudE1vdXNlbW92ZScsIGZ1bmN0aW9uKGUpIHsKKyAgICAgICAgICBsaW5lcy5jbGVhckhpZ2hsaWdodHMoKTsKKyAgICAgICAgICB2YXIgc2luZ2xlUG9pbnQsIHBvaW50SW5kZXgsIHBvaW50WExvY2F0aW9uLCBhbGxEYXRhID0gW107CisgICAgICAgICAgCisgICAgICAgICAgCisgICAgICAgICAgZGF0YQorICAgICAgICAgIC5maWx0ZXIoZnVuY3Rpb24oc2VyaWVzLCBpKSB7IAorICAgICAgICAgICAgc2VyaWVzLnNlcmllc0luZGV4ID0gaTsKKyAgICAgICAgICAgIHJldHVybiAhc2VyaWVzLmRpc2FibGVkOyAKKyAgICAgICAgICB9KQorICAgICAgICAgIC5mb3JFYWNoKGZ1bmN0aW9uKHNlcmllcyxpKSB7CisgICAgICAgICAgICAgIHBvaW50SW5kZXggPSBudi5pbnRlcmFjdGl2ZUJpc2VjdChzZXJpZXMudmFsdWVzLCBlLnBvaW50WFZhbHVlLCBjaGFydC54KCkpOworICAgICAgICAgICAgICBsaW5lcy5oaWdobGlnaHRQb2ludChpLCBwb2ludEluZGV4LCB0cnVlKTsKKyAgICAgICAgICAgICAgdmFyIHBvaW50ID0gc2VyaWVzLnZhbHVlc1twb2ludEluZGV4XTsKKyAgICAgICAgICAgICAgaWYgKHR5cGVvZiBwb2ludCA9PT0gJ3VuZGVmaW5lZCcpIHJldHVybjsKKyAgICAgICAgICAgICAgaWYgKHR5cGVvZiBzaW5nbGVQb2ludCA9PT0gJ3VuZGVmaW5lZCcpIHNpbmdsZVBvaW50ID0gcG9pbnQ7CisgICAgICAgICAgICAgIGlmICh0eXBlb2YgcG9pbnRYTG9jYXRpb24gPT09ICd1bmRlZmluZWQnKSBwb2ludFhMb2NhdGlvbiA9IGNoYXJ0LnhTY2FsZSgpKGNoYXJ0LngoKShwb2ludCxwb2ludEluZGV4KSk7CisgICAgICAgICAgICAgIGFsbERhdGEucHVzaCh7CisgICAgICAgICAgICAgICAgICBrZXk6IHNlcmllcy5rZXksCisgICAgICAgICAgICAgICAgICB2YWx1ZTogY2hhcnQueSgpKHBvaW50LCBwb2ludEluZGV4KSwKKyAgICAgICAgICAgICAgICAgIGNvbG9yOiBjb2xvcihzZXJpZXMsc2VyaWVzLnNlcmllc0luZGV4KQorICAgICAgICAgICAgICB9KTsKKyAgICAgICAgICB9KTsKKworICAgICAgICAgIC8vSGlnaGxpZ2h0IHRoZSB0b29sdGlwIGVudHJ5IGJhc2VkIG9uIHdoaWNoIHBvaW50IHRoZSBtb3VzZSBpcyBjbG9zZXN0IHRvLgorICAgICAgICAgIGlmIChhbGxEYXRhLmxlbmd0aCA+IDIpIHsKKyAgICAgICAgICAgIHZhciB5VmFsdWUgPSBjaGFydC55U2NhbGUoKS5pbnZlcnQoZS5tb3VzZVkpOworICAgICAgICAgICAgdmFyIGRvbWFpbkV4dGVudCA9IE1hdGguYWJzKGNoYXJ0LnlTY2FsZSgpLmRvbWFpbigpWzBdIC0gY2hhcnQueVNjYWxlKCkuZG9tYWluKClbMV0pOworICAgICAgICAgICAgdmFyIHRocmVzaG9sZCA9IDAuMDMgKiBkb21haW5FeHRlbnQ7CisgICAgICAgICAgICB2YXIgaW5kZXhUb0hpZ2hsaWdodCA9IG52Lm5lYXJlc3RWYWx1ZUluZGV4KGFsbERhdGEubWFwKGZ1bmN0aW9uKGQpe3JldHVybiBkLnZhbHVlfSkseVZhbHVlLHRocmVzaG9sZCk7CisgICAgICAgICAgICBpZiAoaW5kZXhUb0hpZ2hsaWdodCAhPT0gbnVsbCkKKyAgICAgICAgICAgICAgYWxsRGF0YVtpbmRleFRvSGlnaGxpZ2h0XS5oaWdobGlnaHQgPSB0cnVlOworICAgICAgICAgIH0KKworICAgICAgICAgIHZhciB4VmFsdWUgPSB4QXhpcy50aWNrRm9ybWF0KCkoY2hhcnQueCgpKHNpbmdsZVBvaW50LHBvaW50SW5kZXgpLCBwb2ludEluZGV4KTsKKyAgICAgICAgICBpbnRlcmFjdGl2ZUxheWVyLnRvb2x0aXAKKyAgICAgICAgICAgICAgICAgIC5wb3NpdGlvbih7bGVmdDogcG9pbnRYTG9jYXRpb24gKyBtYXJnaW4ubGVmdCwgdG9wOiBlLm1vdXNlWSArIG1hcmdpbi50b3B9KQorICAgICAgICAgICAgICAgICAgLmNoYXJ0Q29udGFpbmVyKHRoYXQucGFyZW50Tm9kZSkKKyAgICAgICAgICAgICAgICAgIC5lbmFibGVkKHRvb2x0aXBzKQorICAgICAgICAgICAgICAgICAgLnZhbHVlRm9ybWF0dGVyKGZ1bmN0aW9uKGQsaSkgeworICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHlBeGlzLnRpY2tGb3JtYXQoKShkKTsKKyAgICAgICAgICAgICAgICAgIH0pCisgICAgICAgICAgICAgICAgICAuZGF0YSgKKyAgICAgICAgICAgICAgICAgICAgICB7CisgICAgICAgICAgICAgICAgICAgICAgICB2YWx1ZTogeFZhbHVlLAorICAgICAgICAgICAgICAgICAgICAgICAgc2VyaWVzOiBhbGxEYXRhCisgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgKSgpOworCisgICAgICAgICAgaW50ZXJhY3RpdmVMYXllci5yZW5kZXJHdWlkZUxpbmUocG9pbnRYTG9jYXRpb24pOworCisgICAgICB9KTsKKworICAgICAgaW50ZXJhY3RpdmVMYXllci5kaXNwYXRjaC5vbigiZWxlbWVudE1vdXNlb3V0IixmdW5jdGlvbihlKSB7CisgICAgICAgICAgZGlzcGF0Y2gudG9vbHRpcEhpZGUoKTsKKyAgICAgICAgICBsaW5lcy5jbGVhckhpZ2hsaWdodHMoKTsKKyAgICAgIH0pOworCisgICAgICBkaXNwYXRjaC5vbigndG9vbHRpcFNob3cnLCBmdW5jdGlvbihlKSB7CisgICAgICAgIGlmICh0b29sdGlwcykgc2hvd1Rvb2x0aXAoZSwgdGhhdC5wYXJlbnROb2RlKTsKKyAgICAgIH0pOworCisKKyAgICAgIC8vIFVwZGF0ZSBjaGFydCBmcm9tIGEgc3RhdGUgb2JqZWN0IHBhc3NlZCB0byBldmVudCBoYW5kbGVyCisgICAgICBkaXNwYXRjaC5vbignY2hhbmdlU3RhdGUnLCBmdW5jdGlvbihlKSB7CisKKyAgICAgICAgaWYgKHR5cGVvZiBlLmRpc2FibGVkICE9PSAndW5kZWZpbmVkJykgeworICAgICAgICAgIGRhdGEuZm9yRWFjaChmdW5jdGlvbihzZXJpZXMsaSkgeworICAgICAgICAgICAgc2VyaWVzLmRpc2FibGVkID0gZS5kaXNhYmxlZFtpXTsKKyAgICAgICAgICB9KTsKKworICAgICAgICAgIHN0YXRlLmRpc2FibGVkID0gZS5kaXNhYmxlZDsKKyAgICAgICAgfQorCisKKyAgICAgICAgaWYgKHR5cGVvZiBlLmluZGV4ICE9PSAndW5kZWZpbmVkJykgeworICAgICAgICAgIGluZGV4LmkgPSBlLmluZGV4OworICAgICAgICAgIGluZGV4LnggPSBkeChpbmRleC5pKTsKKworICAgICAgICAgIHN0YXRlLmluZGV4ID0gZS5pbmRleDsKKworICAgICAgICAgIGluZGV4TGluZQorICAgICAgICAgICAgLmRhdGEoW2luZGV4XSk7CisgICAgICAgIH0KKworCisgICAgICAgIGlmICh0eXBlb2YgZS5yZXNjYWxlWSAhPT0gJ3VuZGVmaW5lZCcpIHsKKyAgICAgICAgICByZXNjYWxlWSA9IGUucmVzY2FsZVk7CisgICAgICAgIH0KKworICAgICAgICBjaGFydC51cGRhdGUoKTsKKyAgICAgIH0pOworCisgICAgICAvLz09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorCisgICAgfSk7CisKKyAgICByZXR1cm4gY2hhcnQ7CisgIH0KKworCisgIC8vPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisgIC8vIEV2ZW50IEhhbmRsaW5nL0Rpc3BhdGNoaW5nIChvdXQgb2YgY2hhcnQncyBzY29wZSkKKyAgLy8tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0KKworICBsaW5lcy5kaXNwYXRjaC5vbignZWxlbWVudE1vdXNlb3Zlci50b29sdGlwJywgZnVuY3Rpb24oZSkgeworICAgIGUucG9zID0gW2UucG9zWzBdICsgIG1hcmdpbi5sZWZ0LCBlLnBvc1sxXSArIG1hcmdpbi50b3BdOworICAgIGRpc3BhdGNoLnRvb2x0aXBTaG93KGUpOworICB9KTsKKworICBsaW5lcy5kaXNwYXRjaC5vbignZWxlbWVudE1vdXNlb3V0LnRvb2x0aXAnLCBmdW5jdGlvbihlKSB7CisgICAgZGlzcGF0Y2gudG9vbHRpcEhpZGUoZSk7CisgIH0pOworCisgIGRpc3BhdGNoLm9uKCd0b29sdGlwSGlkZScsIGZ1bmN0aW9uKCkgeworICAgIGlmICh0b29sdGlwcykgbnYudG9vbHRpcC5jbGVhbnVwKCk7CisgIH0pOworCisgIC8vPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisKKworICAvLz09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT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yZ2luLnJpZ2h0OworICAgIG1hcmdpbi5ib3R0b20gPSB0eXBlb2YgXy5ib3R0b20gIT0gJ3VuZGVmaW5lZCcgPyBfLmJvdHRvbSA6IG1hcmdpbi5ib3R0b207CisgICAgbWFyZ2luLmxlZnQgICA9IHR5cGVvZiBfLmxlZnQgICAhPSAndW5kZWZpbmVkJyA/IF8ubGVmdCAgIDogbWFyZ2luLmxlZnQ7CisgICAgcmV0dXJuIGNoYXJ0OworICB9OworCisgIGNoYXJ0LndpZHRoID0gZnVuY3Rpb24oXykgeworICAgIGlmICghYXJndW1lbnRzLmxlbmd0aCkgcmV0dXJuIHdpZHRoOworICAgIHdpZHRoID0gXzsKKyAgICByZXR1cm4gY2hhcnQ7CisgIH07CisKKyAgY2hhcnQuaGVpZ2h0ID0gZnVuY3Rpb24oXykgeworICAgIGlmICghYXJndW1lbnRzLmxlbmd0aCkgcmV0dXJuIGhlaWdodDsKKyAgICBoZWlnaHQgPSBfOworICAgIHJldHVybiBjaGFydDsKKyAgfTsKKworICBjaGFydC5jb2xvciA9IGZ1bmN0aW9uKF8pIHsKKyAgICBpZiAoIWFyZ3VtZW50cy5sZW5ndGgpIHJldHVybiBjb2xvcjsKKyAgICBjb2xvciA9IG52LnV0aWxzLmdldENvbG9yKF8pOworICAgIGxlZ2VuZC5jb2xvcihjb2xvcik7CisgICAgcmV0dXJuIGNoYXJ0OworICB9OworCisgIGNoYXJ0LnJlc2NhbGVZID0gZnVuY3Rpb24oXykgeworICAgIGlmICghYXJndW1lbnRzLmxlbmd0aCkgcmV0dXJuIHJlc2NhbGVZOworICAgIHJlc2NhbGVZID0gXzsKKyAgICByZXR1cm4gY2hhcnQ7CisgIH07CisKKyAgY2hhcnQuc2hvd0NvbnRyb2xzID0gZnVuY3Rpb24oXykgeworICAgIGlmICghYXJndW1lbnRzLmxlbmd0aCkgcmV0dXJuIHNob3dDb250cm9sczsKKyAgICBzaG93Q29udHJvbHMgPSBfOworICAgIHJldHVybiBjaGFydDsKK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5kaXNwYXRjaCgnY2hhcnRDbGljaycsICdlbGVtZW50Q2xpY2snLCAnZWxlbWVudERibENsaWNrJywgJ2VsZW1lbnRNb3VzZW92ZXInLCAnZWxlbWVudE1vdXNlb3V0JykKKyAgICAsIHJlY3RDbGFzcyA9ICdkaXNjcmV0ZUJhcicKKyAgICA7CisKKyAgLy89PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKworCisgIC8vPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisgIC8vIFByaXZhdGUgVmFyaWFibGVzCisgIC8vLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tCisKKyAgdmFyIHgwLCB5MDsKKworICAvLz09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorCisKKyAgZnVuY3Rpb24gY2hhcnQoc2VsZWN0aW9uKSB7CisgICAgc2VsZWN0aW9uLmVhY2goZnVuY3Rpb24oZGF0YSkgeworICAgICAgdmFyIGF2YWlsYWJsZVdpZHRoID0gd2lkdGggLSBtYXJnaW4ubGVmdCAtIG1hcmdpbi5yaWdodCwKKyAgICAgICAgICBhdmFpbGFibGVIZWlnaHQgPSBoZWlnaHQgLSBtYXJnaW4udG9wIC0gbWFyZ2luLmJvdHRvbSwKKyAgICAgICAgICBjb250YWluZXIgPSBkMy5zZWxlY3QodGhpcyk7CisKKworICAgICAgLy9hZGQgc2VyaWVzIGluZGV4IHRvIGVhY2ggZGF0YSBwb2ludCBmb3IgcmVmZXJlbmNlCisgICAgICBkYXRhLmZvckVhY2goZnVuY3Rpb24oc2VyaWVzLCBpKSB7CisgICAgICAgIHNlcmllcy52YWx1ZXMuZm9yRWFjaChmdW5jdGlvbihwb2ludCkgeworICAgICAgICAgIHBvaW50LnNlcmllc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c2l0aW9uKCkKKyAgICAgICAgICAuc3R5bGUoJ3N0cm9rZS1vcGFjaXR5JywgMSkKKyAgICAgICAgICAuc3R5bGUoJ2ZpbGwtb3BhY2l0eScsIC43NSk7CisKKworICAgICAgdmFyIGJhcnMgPSBncm91cHMuc2VsZWN0QWxsKCdnLm52LWJhcicpCisgICAgICAgICAgLmRhdGEoZnVuY3Rpb24oZCkgeyByZXR1cm4gZC52YWx1ZXMgfSk7CisKKyAgICAgIGJhcnMuZXhpdCgpLnJlbW92ZSgpOworCisKKyAgICAgIHZhciBiYXJzRW50ZXIgPSBiYXJzLmVudGVyKCkuYXBwZW5kKCdnJykKKyAgICAgICAgICAuYXR0cigndHJhbnNmb3JtJywgZnVuY3Rpb24oZCxpLGopIHsKKyAgICAgICAgICAgICAgcmV0dXJuICd0cmFuc2xhdGUoJyArICh4KGdldFgoZCxpKSkgKyB4LnJhbmdlQmFuZCgpICogLjA1ICkgKyAnLCAnICsgeSgwKSArICcpJworICAgICAgICAgIH0pCisgICAgICAgICAgLm9uKCdtb3VzZW92ZXInLCBmdW5jdGlvbihkLGkpIHsgLy9UT0RPOiBmaWd1cmUgb3V0IHdoeSBqIHdvcmtzIGFib3ZlLCBidXQgbm90IGhlcmUKKyAgICAgICAgICAgIGQzLnNlbGVjdCh0aGlzKS5jbGFzc2VkKCdob3ZlcicsIHRydWUpOworICAgICAgICAgICAgZGlzcGF0Y2guZWxlbWVudE1vdXNlb3Zlcih7CisgICAgICAgICAgICAgIHZhbHVlOiBnZXRZKGQsaSksCisgICAgICAgICAgICAgIHBvaW50OiBkLAorICAgICAgICAgICAgICBzZXJpZXM6IGRhdGFbZC5zZXJpZXNdLAorICAgICAgICAgICAgICBwb3M6IFt4KGdldFgoZCxpKSkgKyAoeC5yYW5nZUJhbmQoKSAqIChkLnNlcmllcyArIC41KSAvIGRhdGEubGVuZ3RoKSwgeShnZXRZKGQsaSkpXSwgIC8vIFRPRE86IEZpZ3VyZSBvdXQgd2h5IHRoZSB2YWx1ZSBhcHBlYXJzIHRvIGJlIHNoaWZ0ZWQKKyAgICAgICAgICAgICAgcG9pbnRJbmRleDogaSwKKyAgICAgICAgICAgICAgc2VyaWVzSW5kZXg6IGQuc2VyaWVzLAorICAgICAgICAgICAgICBlOiBkMy5ldmVudAorICAgICAgICAgICAgfSk7CisgICAgICAgICAgfSkKKyAgICAgICAgICAub24oJ21vdXNlb3V0JywgZnVuY3Rpb24oZCxpKSB7CisgICAgICAgICAgICBkMy5zZWxlY3QodGhpcykuY2xhc3NlZCgnaG92ZXInLCBmYWxzZSk7CisgICAgICAgICAgICBkaXNwYXRjaC5lbGVtZW50TW91c2VvdXQoeworICAgICAgICAgICAgICB2YWx1ZTogZ2V0WShkLGkpLAorICAgICAgICAgICAgICBwb2ludDogZCwKKyAgICAgICAgICAgICAgc2VyaWVzOiBkYXRhW2Quc2VyaWVzXSwKKyAgICAgICAgICAgICAgcG9pbnRJbmRleDogaSwKKyAgICAgICAgICAgICAgc2VyaWVzSW5kZXg6IGQuc2VyaWVzLAorICAgICAgICAgICAgICBlOiBkMy5ldmVudAorICAgICAgICAgICAgfSk7CisgICAgICAgICAgfSkKKyAgICAgICAgICAub24oJ2NsaWNrJywgZnVuY3Rpb24oZCxpKSB7CisgICAgICAgICAgICBkaXNwYXRjaC5lbGVtZW50Q2xpY2soeworICAgICAgICAgICAgICB2YWx1ZTogZ2V0WShkLGkpLAorICAgICAgICAgICAgICBwb2ludDogZCwKKyAgICAgICAgICAgICAgc2VyaWVzOiBkYXRhW2Quc2VyaWVzXSwKKyAgICAgICAgICAgICAgcG9zOiBbeChnZXRYKGQsaSkpICsgKHgucmFuZ2VCYW5kKCkgKiAoZC5zZXJpZXMgKyAuNSkgLyBkYXRhLmxlbmd0aCksIHkoZ2V0WShkLGkpKV0sICAvLyBUT0RPOiBGaWd1cmUgb3V0IHdoeSB0aGUgdmFsdWUgYXBwZWFycyB0byBiZSBzaGlmdGVkCisgICAgICAgICAgICAgIHBvaW50SW5kZXg6IGksCisgICAgICAgICAgICAgIHNlcmllc0luZGV4OiBkLnNlcmllcywKKyAgICAgICAgICAgICAgZTogZDMuZXZlbnQKKyAgICAgICAgICAgIH0pOworICAgICAgICAgICAgZDMuZXZlbnQuc3RvcFByb3BhZ2F0aW9uKCk7CisgICAgICAgICAgfSkKKyAgICAgICAgICAub24oJ2RibGNsaWNrJywgZnVuY3Rpb24oZCxpKSB7CisgICAgICAgICAgICBkaXNwYXRjaC5lbGVtZW50RGJsQ2xpY2soeworICAgICAgICAgICAgICB2YWx1ZTogZ2V0WShkLGkpLAorICAgICAgICAgICAgICBwb2ludDogZCwKKyAgICAgICAgICAgICAgc2VyaWVzOiBkYXRhW2Quc2VyaWVzXSwKKyAgICAgICAgICAgICAgcG9zOiBbeChnZXRYKGQsaSkpICsgKHgucmFuZ2VCYW5kKCkgKiAoZC5zZXJpZXMgKyAuNSkgLyBkYXRhLmxlbmd0aCksIHkoZ2V0WShkLGkpKV0sICAvLyBUT0RPOiBGaWd1cmUgb3V0IHdoeSB0aGUgdmFsdWUgYXBwZWFycyB0byBiZSBzaGlmdGVkCisgICAgICAgICAgICAgIHBvaW50SW5kZXg6IGksCisgICAgICAgICAgICAgIHNlcmllc0luZGV4OiBkLnNlcmllcywKKyAgICAgICAgICAgICAgZTogZDMuZXZlbnQKKyAgICAgICAgICAgIH0pOworICAgICAgICAgICAgZDMuZXZlbnQuc3RvcFByb3BhZ2F0aW9uKCk7CisgICAgICAgICAgfSk7CisKKyAgICAgIGJhcnNFbnRlci5hcHBlbmQoJ3JlY3QnKQorICAgICAgICAgIC5hdHRyKCdoZWlnaHQnLCAwKQorICAgICAgICAgIC5hdHRyKCd3aWR0aCcsIHgucmFuZ2VCYW5kKCkgKiAuOSAvIGRhdGEubGVuZ3RoICkKKworICAgICAgaWYgKHNob3dWYWx1ZXMpIHsKKyAgICAgICAgYmFyc0VudGVyLmFwcGVuZCgndGV4dCcpCisgICAgICAgICAgLmF0dHIoJ3RleHQtYW5jaG9yJ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SB7IHJldHVybiBpICogMTIwMCAvIGRhdGFbMF0udmFsdWVzLmxlbmd0aCB9KQorICAgICAgICAgIC5hdHRyKCd0cmFuc2Zvcm0nLCBmdW5jdGlvbihkLGkpIHsKKyAgICAgICAgICAgIHZhciBsZWZ0ID0geChnZXRYKGQsaSkpICsgeC5yYW5nZUJhbmQoKSAqIC4wNSwKKyAgICAgICAgICAgICAgICB0b3AgPSBnZXRZKGQsaSkgPCAwID8KKyAgICAgICAgICAgICAgICAgICAgICAgIHkoMCkgOgorICAgICAgICAgICAgICAgICAgICAgICAgeSgwKSAtIHkoZ2V0WShkLGkpKSA8IDEgPworICAgICAgICAgICAgICAgICAgICAgICAgICB5KDApIC0gMSA6IC8vbWFrZSAxIHB4IHBvc2l0aXZlIGJhcnMgc2hvdyB1cCBhYm92ZSB5PTAKKyAgICAgICAgICAgICAgICAgICAgICAgICAgeShnZXRZKGQsaSkpOworCisgICAgICAgICAgICAgIHJldHVybiAndHJhbnNsYXRlKCcgKyBsZWZ0ICsgJywgJyArIHRvcCArICcpJworICAgICAgICAgIH0pCisgICAgICAgIC5zZWxlY3QoJ3JlY3QnKQorICAgICAgICAgIC5hdHRyKCdoZWlnaHQnLCBmdW5jdGlvbihkLGkpIHsKKyAgICAgICAgICAgIHJldHVybiAgTWF0aC5tYXgoTWF0aC5hYnMoeShnZXRZKGQsaSkpIC0geSgoeURvbWFpbiAmJiB5RG9tYWluWzBdKSB8fCAwKSkgfHwgMSkKKyAgICAgICAgICB9KTsKKworCisgICAgICAvL3N0b3JlIG9sZCBzY2FsZXMgZm9yIHVzZSBpbiB0cmFuc2l0aW9ucyBvbiB1cGRhdGUKKyAgICAgIHgwID0geC5jb3B5KCk7CisgICAgICB5MCA9IHkuY29weSgpOworCisgICAgfSk7CisKKyAgICByZXR1cm4gY2hhcnQ7CisgIH0KKworCisgIC8vPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisgIC8vIEV4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GggPSBmdW5jdGlvbihfKSB7CisgICAgaWYgKCFhcmd1bWVudHMubGVuZ3RoKSByZXR1cm4gd2lkdGg7CisgICAgd2lkdGggPSBfOworICAgIHJldHVybiBjaGFydDsKKyAgfTsKKworICBjaGFydC5oZWlnaHQgPSBmdW5jdGlvbihfKSB7CisgICAgaWYgKCFhcmd1bWVudHMubGVuZ3RoKSByZXR1cm4gaGVpZ2h0OworICAgIGhlaWdodCA9IF87CisgICAgcmV0dXJuIGNoYXJ0OworICB9OworCisgIGNoYXJ0LnhTY2FsZSA9IGZ1bmN0aW9uKF8pIHsKKyAgICBpZiAoIWFyZ3VtZW50cy5sZW5ndGgpIHJldHVybiB4OworICAgIHggPSBfOworICAgIHJldHVybiBjaGFydDsKKyAgfTsKKworICBjaGFydC55U2NhbGUgPSBmdW5jdGlvbihfKSB7CisgICAgaWYgKCFhcmd1bWVudHMubGVuZ3RoKSByZXR1cm4geTsKKyAgICB5ID0gXzsKKyAgICByZXR1cm4gY2hhcnQ7CisgIH07CisKKyAgY2hhcnQueERvbWFpbiA9IGZ1bmN0aW9uKF8pIHsKKyAgICBpZiAoIWFyZ3VtZW50cy5sZW5ndGgpIHJldHVybiB4RG9tYWluOworICAgIHhEb21haW4gPSBfOworICAgIHJldHVybiBjaGFydDsKKyAgfTsKKworICBjaGFydC55RG9tYWluID0gZnVuY3Rpb24oXykgeworICAgIGlmICghYXJndW1lbnRzLmxlbmd0aCkgcmV0dXJuIHlEb21haW47CisgICAgeURvbWFpbiA9IF87CisgICAgcmV0dXJuIGNoYXJ0OworICB9OworCisgIGNoYXJ0LnhSYW5nZSA9IGZ1bmN0aW9uKF8pIHsKKyAgICBpZiAoIWFyZ3VtZW50cy5sZW5ndGgpIHJldHVybiB4UmFuZ2U7CisgICAgeFJhbmdlID0gXzsKKyAgICByZXR1cm4gY2hhcnQ7CisgIH07CisKKyAgY2hhcnQueVJhbmdlID0gZnVuY3Rpb24oXykgeworICAgIGlmICghYXJndW1lbnRzLmxlbmd0aCkgcmV0dXJuIHlSYW5nZTsKKyAgICB5UmFuZ2UgPSBfOworICAgIHJldHVybiBjaGFydDsKKyAgfTsKKworICBjaGFydC5mb3JjZVkgPSBmdW5jdGlvbihfKSB7CisgICAgaWYgKCFhcmd1bWVudHMubGVuZ3RoKSByZXR1cm4gZm9yY2VZOworICAgIGZvcmNlWSA9IF87CisgICAgcmV0dXJuIGNoYXJ0OworICB9OworCisgIGNoYXJ0LmNvbG9yID0gZnVuY3Rpb24oXykgeworICAgIGlmICghYXJndW1lbnRzLmxlbmd0aCkgcmV0dXJuIGNvbG9yOworICAgIGNvbG9yID0gbnYudXRpbHMuZ2V0Q29sb3IoXyk7CisgICAgcmV0dXJuIGNoYXJ0OworICB9OworCisgIGNoYXJ0LmlkID0gZnVuY3Rpb24oXykgeworICAgIGlmICghYXJndW1lbnRzLmxlbmd0aCkgcmV0dXJuIGlkOworICAgIGlkID0gXzsKKyAgICByZXR1cm4gY2hhcnQ7CisgIH07CisKKyAgY2hhcnQuc2hvd1ZhbHVlcyA9IGZ1bmN0aW9uKF8pIHsKKyAgICBpZiAoIWFyZ3VtZW50cy5sZW5ndGgpIHJldHVybiBzaG93VmFsdWVzOworICAgIHNob3dWYWx1ZXMgPSBfOworICAgIHJldHVybiBjaGFydDsKKyAgfTsKKworICBjaGFydC52YWx1ZUZvcm1hdD0gZnVuY3Rpb24oXykgeworICAgIGlmICghYXJndW1lbnRzLmxlbmd0aCkgcmV0dXJuIHZhbHVlRm9ybWF0OworICAgIHZhbHVlRm9ybWF0ID0gXzsKKyAgICByZXR1cm4gY2hhcnQ7CisgIH07CisKKyAgY2hhcnQucmVjdENsYXNzPSBmdW5jdGlvbihfKSB7CisgICAgaWYgKCFhcmd1bWVudHMubGVuZ3RoKSByZXR1cm4gcmVjdENsYXNzOworICAgIHJlY3RDbGFzcyA9IF87CisgICAgcmV0dXJuIGNoYXJ0OworICB9OworICAvLz09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09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2V0Q29sb3IoKQorICAgICwgc2hvd1hBeGlzID0gdHJ1ZQorICAgICwgc2hvd1lBeGlzID0gdHJ1ZQorICAgICwgcmlnaHRBbGlnbllBeGlzID0gZmFsc2UKKyAgICAsIHN0YWdnZXJMYWJlbHMgPSBmYWxzZQorICAgICwgdG9vbHRpcHMgPSB0cnVlCisgICAgLCB0b29sdGlwID0gZnVuY3Rpb24oa2V5LCB4LCB5LCBlLCBncmFwaCkgeworICAgICAgICByZXR1cm4gJzxoMz4nICsgeCArICc8L2gzPicgKworICAgICAgICAgICAgICAgJzxwPicgKyAgeSArICc8L3A+JworICAgICAgfQorICAgICwgeAorICAgICwgeQorICAgICwgbm9EYXRhID0gIk5vIERhdGEgQXZhaWxhYmxlLiIKKyAgICAsIGRpc3BhdGNoID0gZDMuZGlzcGF0Y2goJ3Rvb2x0aXBTaG93JywgJ3Rvb2x0aXBIaWRlJywgJ2JlZm9yZVVwZGF0ZScpCisgICAgLCB0cmFuc2l0aW9uRHVyYXRpb24gPSAyNTAKKyAgICA7CisKKyAgeEF4aXMKKyAgICAub3JpZW50KCdib3R0b20nKQorICAgIC5oaWdobGlnaHRaZXJvKGZhbHNlKQorICAgIC5zaG93TWF4TWluKGZhbHNlKQorICAgIC50aWNrRm9ybWF0KGZ1bmN0aW9uKGQpIHsgcmV0dXJuIGQgfSkKKyAgICA7CisgIHlBeGlzCisgICAgLm9yaWVudCgocmlnaHRBbGlnbllBeGlzKSA/ICdyaWdodCcgOiAnbGVmdCcpCisgICAgLnRpY2tGb3JtYXQoZDMuZm9ybWF0KCcsLjFmJykpCisgICAgOworCisgIC8vPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisKKworICAvLz09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorICAvLyBQcml2YXRlIFZhcmlhYmxlcworICAvLy0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLQorCisgIHZhciBzaG93VG9vbHRpcCA9IGZ1bmN0aW9uKGUsIG9mZnNldEVsZW1lbnQpIHsKKyAgICB2YXIgbGVmdCA9IGUucG9zWzBdICsgKCBvZmZzZXRFbGVtZW50Lm9mZnNldExlZnQgfHwgMCApLAorICAgICAgICB0b3AgPSBlLnBvc1sxXSArICggb2Zmc2V0RWxlbWVudC5vZmZzZXRUb3AgfHwgMCksCisgICAgICAgIHggPSB4QXhpcy50aWNrRm9ybWF0KCkoZGlzY3JldGViYXIueCgpKGUucG9pbnQsIGUucG9pbnRJbmRleCkpLAorICAgICAgICB5ID0geUF4aXMudGlja0Zvcm1hdCgpKGRpc2NyZXRlYmFyLnkoKShlLnBvaW50LCBlLnBvaW50SW5kZXgpKSwKKyAgICAgICAgY29udGVudCA9IHRvb2x0aXAoZS5zZXJpZXMua2V5LCB4LCB5LCBlLCBjaGFydCk7CisKKyAgICBudi50b29sdGlwLnNob3coW2xlZnQsIHRvcF0sIGNvbnRlbnQsIGUudmFsdWUgPCAwID8gJ24nIDogJ3MnLCBudWxsLCBvZmZzZXRFbGVtZW50KTsKKyAgfTsKKworICAvLz09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorCisKKyAgZnVuY3Rpb24gY2hhcnQoc2VsZWN0aW9uKSB7CisgICAgc2VsZWN0aW9uLmVhY2goZnVuY3Rpb24oZGF0YSkgeworICAgICAgdmFyIGNvbnRhaW5lciA9IGQzLnNlbGVjdCh0aGlzKSwKKyAgICAgICAgICB0aGF0ID0gdGhpczsKKworICAgICAgdmFyIGF2YWlsYWJsZVdpZHRoID0gKHdpZHRoICB8fCBwYXJzZUludChjb250YWluZXIuc3R5bGUoJ3dpZHRoJykpIHx8IDk2MCkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLSBtYXJnaW4ubGVmdCAtIG1hcmdp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xhYmxlSGVpZ2h0LCAwKTsKKworICAgICAgICAgIGcuc2VsZWN0KCcubnYteC5udi1heGlzJykKKyAgICAgICAgICAgICAgLmF0dHIoJ3RyYW5zZm9ybScsICd0cmFuc2xhdGUoMCwnICsgKHkucmFuZ2UoKVswXSArICgoZGlzY3JldGViYXIuc2hvd1ZhbHVlcygpICYmIHkuZG9tYWluKClbMF0gPCAwKSA/IDE2IDogMCkpICsgJyknKTsKKyAgICAgICAgICAvL2QzLnRyYW5zaXRpb24oZy5zZWxlY3QoJy5udi14Lm52LWF4aXMnKSkKKyAgICAgICAgICBnLnNlbGVjdCgnLm52LXgubnYtYXhpcycpLnRyYW5zaXRpb24oKQorICAgICAgICAgICAgICAuY2FsbCh4QXhpcyk7CisKKworICAgICAgICAgIHZhciB4VGlja3MgPSBnLnNlbGVjdCgnLm52LXgubnYtYXhpcycpLnNlbGVjdEFsbCgnZycpOworCisgICAgICAgICAgaWYgKHN0YWdnZXJMYWJlbHMpIHsKKyAgICAgICAgICAgIHhUaWNrcworICAgICAgICAgICAgICAgIC5zZWxlY3RBbGwoJ3RleHQnKQorICAgICAgICAgICAgICAgIC5hdHRyKCd0cmFuc2Zvcm0nLCBmdW5jdGlvbihkLGksaikgeyByZXR1cm4gJ3RyYW5zbGF0ZSgwLCcgKyAoaiAlIDIgPT0gMCA/ICc1JyA6ICcxNycpICsgJyknIH0pCisgICAgICAgICAgfQorICAgICAgfQorCisgICAgICBpZiAoc2hvd1lBeGlzKSB7CisgICAgICAgICAgeUF4aXMKKyAgICAgICAgICAgIC5zY2FsZSh5KQorICAgICAgICAgICAgLnRpY2tzKCBhdmFpbGFibGVIZWlnaHQgLyAzNiApCisgICAgICAgICAgICAudGlja1NpemUoIC1hdmFpbGFibGVXaWR0aCwgMCk7CisKKyAgICAgICAgICBnLnNlbGVjdCgnLm52LXkubnYtYXhpcycpLnRyYW5zaXRpb24oKQorICAgICAgICAgICAgICAuY2FsbCh5QXhpcyk7CisgICAgICB9CisKKyAgICAgIC8vLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tCisKKworICAgICAgLy89PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKyAgICAgIC8vIEV2ZW50IEhhbmRsaW5nL0Rpc3BhdGNoaW5nIChpbiBjaGFydCdzIHNjb3BlKQorICAgICAgLy8tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0KKworICAgICAgZGlzcGF0Y2gub24oJ3Rvb2x0aXBTaG93JywgZnVuY3Rpb24oZSkgeworICAgICAgICBpZiAodG9vbHRpcHMpIHNob3dUb29sdGlwKGUsIHRoYXQucGFyZW50Tm9kZSk7CisgICAgICB9KTsKKworICAgICAgLy89PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKworCisgICAgfSk7CisKKyAgICByZXR1cm4gY2hhcnQ7CisgIH0KKworICAvLz09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorICAvLyBFdmVudCBIYW5kbGluZy9EaXNwYXRjaGluZyAob3V0IG9mIGNoYXJ0J3Mgc2NvcGUpCisgIC8vLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tCisKKyAgZGlzY3JldGViYXIuZGlzcGF0Y2gub24oJ2VsZW1lbnRNb3VzZW92ZXIudG9vbHRpcCcsIGZ1bmN0aW9uKGUpIHsKKyAgICBlLnBvcyA9IFtlLnBvc1swXSArICBtYXJnaW4ubGVmdCwgZS5wb3NbMV0gKyBtYXJnaW4udG9wXTsKKyAgICBkaXNwYXRjaC50b29sdGlwU2hvdyhlKTsKKyAgfSk7CisKKyAgZGlzY3JldGViYXIuZGlzcGF0Y2gub24oJ2VsZW1lbnRNb3VzZW91dC50b29sdGlwJywgZnVuY3Rpb24oZSkgeworICAgIGRpc3BhdGNoLnRvb2x0aXBIaWRlKGUpOworICB9KTsKKworICBkaXNwYXRjaC5vbigndG9vbHRpcEhpZGUnLCBmdW5jdGlvbigpIHsKKyAgICBpZiAodG9vbHRpcHMpIG52LnRvb2x0aXAuY2xlYW51cCgpOworICB9KTsKKworICAvLz09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorCisKKyAgLy89PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKyAgLy8gRXhwb3NlIFB1YmxpYyBWYXJpYWJsZXMKKyAgLy8tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0KKworICAvLyBleHBvc2UgY2hhcnQncyBzdWItY29tcG9uZW50cworICBjaGFydC5kaXNwYXRjaCA9IGRpc3BhdGNoOworICBjaGFydC5kaXNjcmV0ZWJhciA9IGRpc2NyZXRlYmFyOworICBjaGFydC54QXhpcyA9IHhBeGlzOworICBjaGFydC55QXhpcyA9IHlBeGlzOworCisgIGQzLnJlYmluZChjaGFydCwgZGlzY3JldGViYXIsICd4JywgJ3knLCAneERvbWFpbicsICd5RG9tYWluJywgJ3hSYW5nZScsICd5UmFuZ2UnLCAnZm9yY2VYJywgJ2ZvcmNlWScsICdpZCcsICdzaG93VmFsdWVzJywgJ3ZhbHVlRm9ybWF0Jyk7CisKKyAgY2hhcnQub3B0aW9ucyA9IG52LnV0aWxzLm9wdGlvbnNGdW5jLmJpbmQoY2hhcnQpOworICAKKyAgY2hhcnQubWFyZ2luID0gZnVuY3Rpb24oXykgeworICAgIGlmICghYXJndW1lbnRzLmxlbmd0aCkgcmV0dXJuIG1hcmdpbjsKKyAg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hBeGlzID0gXzsKKyAgICByZXR1cm4gY2hhcnQ7CisgIH07CisKKyAgY2hhcnQuc2hvd1lBeGlzID0gZnVuY3Rpb24oXykgeworICAgIGlmICghYXJndW1lbnRzLmxlbmd0aCkgcmV0dXJuIHNob3dZQXhpczsKKyAgICBzaG93WUF4aXMgPSBfOworICAgIHJldHVybiBjaGFydDsKKyAgfTsKKworICBjaGFydC5yaWdodEFsaWduWUF4aXMgPSBmdW5jdGlvbihfKSB7CisgICAgaWYoIWFyZ3VtZW50cy5sZW5ndGgpIHJldHVybiByaWdodEFsaWduWUF4aXM7CisgICAgcmlnaHRBbGlnbllBeGlzID0gXzsKKyAgICB5QXhpcy5vcmllbnQoIChfKSA/ICdyaWdodCcgOiAnbGVmdCcpOworICAgIHJldHVybiBjaGFydDsKKyAgfTsKKworICBjaGFydC5zdGFnZ2VyTGFiZWxzID0gZnVuY3Rpb24oXykgeworICAgIGlmICghYXJndW1lbnRzLmxlbmd0aCkgcmV0dXJuIHN0YWdnZXJMYWJlbHM7CisgICAgc3RhZ2dlckxhYmVscyA9IF87CisgICAgcmV0dXJuIGNoYXJ0OworICB9OworCisgIGNoYXJ0LnRvb2x0aXBzID0gZnVuY3Rpb24oXykgeworICAgIGlmICghYXJndW1lbnRzLmxlbmd0aCkgcmV0dXJuIHRvb2x0aXBzOworICAgIHRvb2x0aXBzID0gXzsKKyAgICByZXR1cm4gY2hhcnQ7CisgIH07CisKKyAgY2hhcnQudG9vbHRpcENvbnRlbnQgPSBmdW5jdGlvbihfKSB7CisgICAgaWYgKCFhcmd1bWVudHMubGVuZ3RoKSByZXR1cm4gdG9vbHRpcDsKKyAgICB0b29sdGlwID0gXzsKKyAgICByZXR1cm4gY2hhcnQ7CisgIH07CisKKyAgY2hhcnQubm9EYXRhID0gZnVuY3Rpb24oXykgeworICAgIGlmICghYXJndW1lbnRzLmxlbmd0aCkgcmV0dXJuIG5vRGF0YTsKKyAgICBub0RhdGEgPSBfOworICAgIHJldHVybiBjaGFyd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KyAgICAsIHdpZHRoID0gNDAwIC8vdGVjaG5pY2FsbHkgd2lkdGggb3IgaGVpZ2h0IGRlcGVuZGluZyBvbiB4IG9yIHkuLi4uCisgICAgLCBzaXplID0gOAorICAgICwgYXhpcyA9ICd4JyAvLyAneCcgb3IgJ3knLi4uIGhvcml6b250YWwgb3IgdmVydGljYWwKKyAgICAsIGdldERhdGEgPSBmdW5jdGlvbihkKSB7IHJldHVybiBkW2F4aXNdIH0gIC8vIGRlZmF1bHRzIGQueCBvciBkLnkKKyAgICAsIGNvbG9yID0gbnYudXRpbHMuZGVmYXVsdENvbG9yKCkKKyAgICAsIHNjYWxlID0gZDMuc2NhbGUubGluZWFyKCkKKyAgICAsIGRvbWFpbgorICAgIDsKKworICAvLz09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorCisKKyAgLy89PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKyAgLy8gUHJpdmF0ZSBWYXJpYWJsZXMKKyAgLy8tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0KKworICB2YXIgc2NhbGUwOworCisgIC8vPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisKKworICBmdW5jdGlvbiBjaGFydChzZWxlY3Rpb24pIHsKKyAgICBzZWxlY3Rpb24uZWFjaChmdW5jdGlvbihkYXRhKSB7CisgICAgICB2YXIgYXZhaWxhYmxlTGVuZ3RoID0gd2lkdGggLSAoYXhpcyA9PT0gJ3gnID8gbWFyZ2luLmxlZnQgKyBtYXJnaW4ucmlnaHQgOiBtYXJnaW4udG9wICsgbWFyZ2luLmJvdHRvbSksCisgICAgICAgICAgbmF4aXMgPSBheGlzID09ICd4JyA/ICd5JyA6ICd4JywKKyAgICAgICAgICBjb250YW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gICAgIGRpc3QKKyAgICAgICAgICAuYXR0cignY2xhc3MnLCBmdW5jdGlvbihkLGkpIHsgcmV0dXJuICdudi1kaXN0JyArIGF4aXMgKyAnIG52LWRpc3QnICsgYXhpcyArICctJyArIGkgfSkKKyAgICAgICAgICAuYXR0cihuYXhpcyArICcxJywgMCkKKyAgICAgICAgICAuYXR0cihuYXhpcyArICcyJywgc2l6ZSk7CisgICAgICBkaXN0CisgICAgICAgICAgLnRyYW5zaXRpb24oKQorICAgICAgICAgIC5hdHRyKGF4aXMgKyAnMScsIGZ1bmN0aW9uKGQsaSkgeyByZXR1cm4gc2NhbGUoZ2V0RGF0YShkLGkpKSB9KQorICAgICAgICAgIC5hdHRyKGF4aXMgKyAnMicsIGZ1bmN0aW9uKGQsaSkgeyByZXR1cm4gc2NhbGUoZ2V0RGF0YShkLGkpKSB9KQorCisKKyAgICAgIHNjYWxlMCA9IHNjYWxlLmNvcHkoKTsKKworICAgIH0pOworCisgICAgcmV0dXJuIGNoYXJ0OworICB9CisKKworICAvLz09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorICAvLyBFeHBvc2UgUHVibGljIFZhcmlhYmxlcworICAvLy0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLQorICBjaGFydC5vcHRpb25zID0gbnYudXRpbHMub3B0aW9uc0Z1bmMuYmluZChjaGFydCk7CisgIAorICBjaGFydC5tYXJnaW4gPSBmdW5jdGlvbihfKSB7CisgICAgaWYgKCFhcmd1bWVudHMubGVuZ3RoKSByZXR1cm4gbWFyZ2luOworICAgIG1hcmdpbi50b3AgICAgPSB0eXBlb2YgXy50b3AgICAgIT0gJ3VuZGVmaW5lZCcgPyBfLnRvcCAgICA6IG1hcmdpbi50b3A7CisgICAgbWFyZ2luLnJpZ2h0ICA9IHR5cGVvZiBfLnJpZ2h0ICAhPSAndW5k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HRvbTogMCwgbGVmdDogMH0KKyAgICAsIHdpZHRoID0gOTYwCisgICAgLCBoZWlnaHQgPSA1MDAKKyAgICAsIGlkID0gTWF0aC5mbG9vcihNYXRoLnJhbmRvbSgpICogMTAwMDApIC8vQ3JlYXRlIHNlbWktdW5pcXVlIElEIGluIGNhc2UgdXNlciBkb2Vzbid0IHNlbGVjdCBvbmUKKyAgICAsIHggPSBkMy5zY2FsZS5saW5lYXIoKQorICAgICwgeSA9IGQzLnNjYWxlLmxpbmVhcigpCisgICAgLCBnZXRYID0gZnVuY3Rpb24oZCkgeyByZXR1cm4gZC54IH0KKyAgICAsIGdldFkgPSBmdW5jdGlvbihkKSB7IHJldHVybiBkLnkgfQorICAgICwgZm9yY2VYID0gW10KKyAgICAsIGZvcmNlWSA9IFswXQorICAgICwgcGFkRGF0YSA9IGZhbHNlCisgICAgLCBjbGlwRWRnZSA9IHRydWUKKyAgICAsIGNvbG9yID0gbnYudXRpbHMuZGVmYXVsdENvbG9yKCkKKyAgICAsIHhEb21haW4KKyAgICAsIHlEb21haW4KKyAgICAsIHhSYW5nZQorICAgICwgeVJhbmdlCisgICAgLCBkaXNwYXRjaCA9IGQzLmRpc3BhdGNoKCdjaGFydENsaWNrJywgJ2VsZW1lbnRDbGljaycsICdlbGVtZW50RGJsQ2xpY2snLCAnZWxlbWVudE1vdXNlb3ZlcicsICdlbGVtZW50TW91c2VvdXQnKQorICAgICwgaW50ZXJhY3RpdmUgPSB0cnVlCisgICAgOworCisgIC8vPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisKKworICBmdW5jdGlvbiBjaGFydChzZWxlY3Rpb24pIHsKKyAgICBzZWxlY3Rpb24uZWFjaChmdW5jdGlvbihkYXRhKSB7CisgICAgICB2YXIgYXZhaWxhYmxlV2lkdGggPSB3aWR0aCAtIG1hcmdpbi5sZWZ0IC0gbWFyZ2luLnJpZ2h0LAorICAgICAgICAgIGF2YWlsYWJ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ICAgICAgICAgIHguZG9tYWluKFt4LmRvbWFpbigpWzBdIC0geC5kb21haW4oKVswXSAqIDAuMDEsIHguZG9tYWluKClbMV0gKyB4LmRvbWFpbigpWzFdICogMC4wMV0pCisgICAgICAgICAgOiB4LmRvbWFpbihbLTEsMV0pOworCisgICAgICBpZiAoeS5kb21haW4oKVswXSA9PT0geS5kb21haW4oKVsxXSkKKyAgICAgICAgeS5kb21haW4oKVswXSA/CisgICAgICAgICAgICB5LmRvbWFpbihbeS5kb21haW4oKVswXSArIHkuZG9tYWluKClbMF0gKiAwLjAxLCB5LmRvbWFpbigpWzFdIC0geS5kb21haW4oKVsxXSAqIDAuMDFdKQorICAgICAgICAgIDogeS5kb21haW4oWy0xLDFdKTsKKworICAgICAgLy8tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0KKworCisgICAgICAvLy0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLQorICAgICAgLy8gU2V0dXAgY29udGFpbmVycyBhbmQgc2tlbGV0b24gb2YgY2hhcnQKKworICAgICAgdmFyIHdyYXAgPSBjb250YWluZXIuc2VsZWN0QWxsKCdnLm52LXdyYXAubnYtaGlzdG9yaWNhbEJhci0nICsgaWQpLmRhdGEoW2RhdGFbMF0udmFsdWVzXSk7CisgICAgICB2YXIgd3JhcEVudGVyID0gd3JhcC5lbnRlcigpLmFwcGVuZCgnZycpLmF0dHIoJ2NsYXNzJywgJ252ZDMgbnYtd3JhcCBudi1oaXN0b3JpY2FsQmFyLScgKyBpZCk7CisgICAgICB2YXIgZGVmc0VudGVyID0gd3JhcEVudGVyLmFwcGVuZCgnZGVmcycpOworICAgICAgdmFyIGdFbnRlciA9IHdyYXBFbnRlci5hcHBlbmQoJ2cnKTsKKyAgICAgIHZhciBnID0gd3JhcC5zZWxlY3QoJ2cnKTsKKworICAgICAgZ0VudGVyLmFwcGVuZCgnZycpLmF0dHIoJ2NsYXNzJywgJ252LWJhcnMnKTsKKworICAgICAgd3JhcC5hdHRyKCd0cmFuc2Zvcm0nLCAndHJhbnNsYXRlKCcgKyBtYXJnaW4ubGVmdCArICcsJyArIG1hcmdpbi50b3AgKyAnKScpOworCisgICAgICAvLy0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLQorCisKKyAgICAgIGNvbnRhaW5lcgorICAgICAgICAgIC5vbignY2xpY2snLCBmdW5jdGlvbihkLGkpIHsKKyAgICAgICAgICAgIGRpc3BhdGNoLmNoYXJ0Q2xpY2soeworICAgICAgICAgICAgICAgIGRhdGE6IGQsCisgICAgICAgICAgICAgICAgaW5kZXg6IGksCisgICAgICAgICAgICAgICAgcG9zOiBkMy5ldmVudCwKKyAgICAgICAgICAgICAgICBpZDogaWQKKyAgICAgICAgICAgIH0pOworICAgICAgICAgIH0pOworCisKKyAgICAgIGRlZnNFbnRlci5hcHBlbmQoJ2NsaXBQYXRoJykKKyAgICAgICAgICAuYXR0cignaWQnLCAnbnYtY2hhcnQtY2xpcC1wYXRoLScgKyBpZCkKKyAgICAgICAgLmFwcGVuZCgncmVjdCcpOworCisgICAgICB3cmFwLnNlbGVjdCgnI252LWNoYXJ0LWNsaXAtcGF0aC0nICsgaWQgKyAnIHJlY3QnKQorICAgICAgICAgIC5hdHRyKCd3aWR0aCcsIGF2YWlsYWJsZVdpZHRoKQorICAgICAgICAgIC5hdHRyKCdoZWlnaHQnLCBhdmFpbGFibGVIZWlnaHQpOworCisgICAgICBnICAgLmF0dHIoJ2NsaXAtcGF0aCcsIGNsaXBFZGdlID8gJ3VybCgjbnYtY2hhcnQtY2xpcC1wYXRoLScgKyBpZCArICcpJyA6ICcnKTsKKworCisKKyAgICAgIHZhciBiYXJzID0gd3JhcC5zZWxlY3QoJy5udi1iYXJzJykuc2VsZW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zcGF0Y2guZWxlbWVudE1vdXNlb3Zlcih7CisgICAgICAgICAgICAgICAgcG9pbnQ6IGQsCisgICAgICAgICAgICAgICAgc2VyaWVzOiBkYXRhWzBdLAorICAgICAgICAgICAgICAgIHBvczogW3goZ2V0WChkLGkpKSwgeShnZXRZKGQsaSkpXSwgIC8vIFRPRE86IEZpZ3VyZSBvdXQgd2h5IHRoZSB2YWx1ZSBhcHBlYXJzIHRvIGJlIHNoaWZ0ZWQKKyAgICAgICAgICAgICAgICBwb2ludEluZGV4OiBpLAorICAgICAgICAgICAgICAgIHNlcmllc0luZGV4OiAwLAorICAgICAgICAgICAgICAgIGU6IGQzLmV2ZW50CisgICAgICAgICAgICB9KTsKKworICAgICAgICAgIH0pCisgICAgICAgICAgLm9uKCdtb3VzZW91dCcsIGZ1bmN0aW9uKGQsaSkgeworICAgICAgICAgICAgICAgIGlmICghaW50ZXJhY3RpdmUpIHJldHVybjsKKyAgICAgICAgICAgICAgICBkMy5zZWxlY3QodGhpcykuY2xhc3NlZCgnaG92ZXInLCBmYWxzZSk7CisgICAgICAgICAgICAgICAgZGlzcGF0Y2guZWxlbWVudE1vdXNlb3V0KHsKKyAgICAgICAgICAgICAgICAgICAgcG9pbnQ6IGQsCisgICAgICAgICAgICAgICAgICAgIHNlcmllczogZGF0YVswXSwKKyAgICAgICAgICAgICAgICAgICAgcG9pbnRJbmRleDogaSwKKyAgICAgICAgICAgICAgICAgICAgc2VyaWVzSW5kZXg6IDAsCisgICAgICAgICAgICAgICAgICAgIGU6IGQzLmV2ZW50CisgICAgICAgICAgICAgICAgfSk7CisgICAgICAgICAgfSkKKyAgICAgICAgICAub24oJ2NsaWNrJywgZnVuY3Rpb24oZCxpKSB7CisgICAgICAgICAgICAgICAgaWYgKCFpbnRlcmFjdGl2ZSkgcmV0dXJuOworICAgICAgICAgICAgICAgIGRpc3BhdGNoLmVsZW1lbnRDbGljayh7CisgICAgICAgICAgICAgICAgICAgIC8vbGFiZWw6IGRbbGFiZWxdLAorICAgICAgICAgICAgICAgICAgICB2YWx1ZTogZ2V0WShkLGkpLAorICAgICAgICAgICAgICAgICAgICBkYXRhOiBkLAorICAgICAgICAgICAgICAgICAgICBpbmRleDogaSwKKyAgICAgICAgICAgICAgICAgICAgcG9zOiBbeChnZXRYKGQsaSkpLCB5KGdldFkoZCxpKSldLAorICAgICAgICAgICAgICAgICAgICBlOiBkMy5ldmVudCwKKyAgICAgICAgICAgICAgICAgICAgaWQ6IGlkCisgICAgICAgICAgICAgICAgfSk7CisgICAgICAgICAgICAgIGQzLmV2ZW50LnN0b3BQcm9wYWdhdGlvbigpOworICAgICAgICAgIH0pCisgICAgICAgICAgLm9uKCdkYmxjbGljaycsIGZ1bmN0aW9uKGQsaSkgeworICAgICAgICAgICAgICBpZiAoIWludGVyYWN0aXZlKSByZXR1cm47CisgICAgICAgICAgICAgIGRpc3BhdGNoLmVsZW1lbnREYmxDbGljayh7CisgICAgICAgICAgICAgICAgICAvL2xhYmVsOiBkW2xhYmVsXSwKKyAgICAgICAgICAgICAgICAgIHZhbHVlOiBnZXRZKGQsaSksCisgICAgICAgICAgICAgICAgICBkYXRhOiBkLAorICAgICAgICAgICAgICAgICAgaW5kZXg6IGksCisgICAgICAgICAgICAgICAgICBwb3M6IFt4KGdldFgoZCxpKSksIHkoZ2V0WShkLGkpKV0sCisgICAgICAgICAgICAgICAgICBlOiBkMy5ldmVudCwKKyAgICAgICAgICAgICAgICAgIGlkOiBpZAorICAgICAgICAgICAgICB9KTsKKyAgICAgICAgICAgICAgZDMuZXZlbnQuc3RvcFByb3BhZ2F0aW9uKCk7CisgICAgICAgICAgfSk7CisKKyAgICAgIGJhcnMKKyAgICAgICAgICAuYXR0cignZmlsbCcsIGZ1bmN0aW9uKGQsaSkgeyByZXR1cm4gY29sb3IoZCwgaSk7IH0pCisgICAgICAgICAgLmF0dHIoJ2NsYXNzJywgZnVuY3Rpb24oZCxpLGopIHsgcmV0dXJuIChnZXRZKGQsaSkgPCAwID8gJ252LWJhciBuZWdhdGl2ZScgOiAnbnYtYmFyIHBvc2l0aXZlJykgKyAnIG52LWJhci0nICsgaiArICctJyArIGkgfSkKKyAgICAgICAgICAudHJhbnNpdGlvbigpCisgICAgICAgICAgLmF0dHIoJ3RyYW5zZm9ybScsIGZ1bmN0aW9uKGQsaSkgeyByZXR1cm4gJ3RyYW5zbGF0ZSgnICsgKHgoZ2V0WChkLGkpKSAtIGF2YWlsYWJsZVdpZHRoIC8gZGF0YVswXS52YWx1ZXMubGVuZ3RoICogLjQ1KSArICcsMCknOyB9KSAKKyAgICAgICAgICAgLy9UT0RPOiBiZXR0ZXIgd2lkdGggY2FsY3VsYXRpb25zIHRoYXQgZG9uJ3QgYXNzdW1lIGFsd2F5cyB1bmlmb3JtIGRhdGEgc3BhY2luZzt3CisgICAgICAgICAgLmF0dHIoJ3dpZHRoJywgKGF2YWlsYWJsZVdpZHRoIC8gZGF0YVswXS52YWx1ZXMubGVuZ3RoKSAqIC45ICk7CisKKworICAgICAgYmFycy50cmFuc2l0aW9uKCkKKyAgICAgICAgICAuYXR0cigneScsIGZ1bmN0aW9uKGQsaSkgeworICAgICAgICAgICAgdmFyIHJ2YWwgPSBnZXRZKGQsaSkgPCAwID8KKyAgICAgICAgICAgICAgICAgICAgeSgwKSA6CisgICAgICAgICAgICAgICAgICAgIHkoMCkgLSB5KGdldFkoZCxpKSkgPCAxID8KKyAgICAgICAgICAgICAgICAgICAgICB5KDApIC0gMSA6CisgICAgICAgICAgICAgICAgICAgICAgeShnZXRZKGQsaSkpOworICAgICAgICAgICAgcmV0dXJuIG52LnV0aWxzLk5hTnRvWmVybyhydmFsKTsKKyAgICAgICAgICB9KQorICAgICAgICAgIC5hdHRyKCdoZWlnaHQnLCBmdW5jdGlvbihkLGkpIHsgcmV0dXJuIG52LnV0aWxzLk5hTnRvWmVybyhNYXRoLm1heChNYXRoLmFicyh5KGdldFkoZCxpKSkgLSB5KDApKSwxKSkgfSk7CisKKyAgICB9KTsKKworICAgIHJldHVybiBjaGFydDsKKyAgfQorCisgIC8vQ3JlYXRlIG1ldGhvZHMgdG8gYWxsb3cgb3V0c2lkZSBmdW5jdGlvbnMgdG8gaGlnaGxpZ2h0IGEgc3BlY2lmaWMgYmFyLgorICBjaGFydC5oaWdobGlnaHRQb2ludCA9IGZ1bmN0aW9uKHBvaW50SW5kZXgsIGlzSG92ZXJPdmVyKSB7CisgICAgICBkMy5zZWxlY3QoIi5udi1oaXN0b3JpY2FsQmFyLSIgKyBpZCkKKyAgICAgICAgLnNlbGVjdCgiLm52LWJhcnMgLm52LWJhci0wLSIgKyBwb2ludEluZGV4KQorICAgICAgICAgICAgICAuY2xhc3NlZCgiaG92ZXIiLCBpc0hvdmVyT3ZlcikKKyAgICAgICAgICAgICAgIDsKKyAgfTsKKworICBjaGFydC5jbGVhckhpZ2hsaWdodHMgPSBmdW5jdGlvbigpIHsKKyAgICAgIGQzLnNlbGVjdCgiLm52LWhpc3RvcmljYWxCYXItIiArIGlkKQorICAgICAgICAuc2VsZWN0KCIubnYtYmFycyAubnYtYmFyLmhvdmVyIikKKyAgICAgICAgICAgICAgLmNsYXNzZWQoImhvdmVyIiwgZmFsc2UpCisgICAgICAgICAgICAgICA7CisgIH07CisgIC8vPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisgIC8vIEV4cG9zZSBQdWJsaWMgVmFyaWFibGVzCisgIC8vLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tCisKKyAgY2hhcnQuZGlzcGF0Y2ggPSBkaXNwYXRjaDsKKworICBjaGFydC5vcHRpb25zID0gbnYudXRpbHMub3B0aW9uc0Z1bmMuYmluZChjaGFydCk7CisgIAorICBjaGFydC54ID0gZnVuY3Rpb24oXykgeworICAgIGlmICghYXJndW1lbnRzLmxlbmd0aCkgcmV0dXJuIGdldFg7CisgICAgZ2V0WCA9IF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XJndW1lbnRzLmxlbmd0aCkgcmV0dXJuIHg7CisgICAgeCA9IF87CisgICAgcmV0dXJuIGNoYXJ0OworICB9OworCisgIGNoYXJ0LnlTY2FsZSA9IGZ1bmN0aW9uKF8pIHsKKyAgICBpZiAoIWFyZ3VtZW50cy5sZW5ndGgpIHJldHVybiB5OworICAgIHkgPSBfOworICAgIHJldHVybiBjaGFydDsKKyAgfTsKKworICBjaGFydC54RG9tYWluID0gZnVuY3Rpb24oXykgeworICAgIGlmICghYXJndW1lbnRzLmxlbmd0aCkgcmV0dXJuIHhEb21haW47CisgICAgeERvbWFpbiA9IF87CisgICAgcmV0dXJuIGNoYXJ0OworICB9OworCisgIGNoYXJ0LnlEb21haW4gPSBmdW5jdGlvbihfKSB7CisgICAgaWYgKCFhcmd1bWVudHMubGVuZ3RoKSByZXR1cm4geURvbWFpbjsKKyAgICB5RG9tYWluID0gXzsKKyAgICByZXR1cm4gY2hhcnQ7CisgIH07CisKKyAgY2hhcnQueFJhbmdlID0gZnVuY3Rpb24oXykgeworICAgIGlmICghYXJndW1lbnRzLmxlbmd0aCkgcmV0dXJuIHhSYW5nZTsKKyAgICB4UmFuZ2UgPSBfOworICAgIHJldHVybiBjaGFydDsKKyAgfTsKKworICBjaGFydC55UmFuZ2UgPSBmdW5jdGlvbihfKSB7CisgICAgaWYgKCFhcmd1bWVudHMubGVuZ3RoKSByZXR1cm4geVJhbmdlOworICAgIHlSYW5nZSA9IF87CisgICAgcmV0dXJuIGNoYXJ0OworICB9OworCisgIGNoYXJ0LmZvcmNlWCA9IGZ1bmN0aW9uKF8pIHsKKyAgICBpZiAoIWFyZ3VtZW50cy5sZW5ndGgpIHJldHVybiBmb3JjZVg7CisgICAgZm9yY2VYID0gXzsKKyAgICByZXR1cm4gY2hhcnQ7CisgIH07CisKKyAgY2hhcnQuZm9yY2VZID0gZnVuY3Rpb24oXykgeworICAgIGlmICghYXJndW1lbnRzLmxlbmd0aCkgcmV0dXJuIGZvcmNlWTsKKyAgICBmb3JjZVkgPSBfOworICAgIHJldHVybiBjaGFydDsKKyAgfTsKKworICBjaGFydC5wYWREYXRhID0gZnVuY3Rpb24oXykgeworICAgIGlmICghYXJndW1lbnRzLmxlbmd0aCkgcmV0dXJuIHBhZERhdGE7CisgICAgcGFkRGF0YSA9IF87CisgICAgcmV0dXJuIGNoYXJ0OworICB9OworCisgIGNoYXJ0LmNsaXBFZGdlID0gZnVuY3Rpb24oXykgeworICAgIGlmICghYXJndW1lbnRzLmxlbmd0aCkgcmV0dXJuIGNsaXBFZGdlOworICAgIGNsaXBFZGdlID0gXzsKKyAgICByZXR1cm4gY2hhcnQ7CisgIH07CisKKyAgY2hhcnQuY29sb3IgPSBmdW5jdGlvbihfKSB7CisgICAgaWYgKCFhcmd1bWVudHMubGVuZ3RoKSByZXR1cm4gY29sb3I7CisgICAgY29sb3IgPSBudi51dGlscy5nZXRDb2xvcihfKTsKKyAgICByZXR1cm4gY2hhcnQ7CisgIH07CisKKyAgY2hhcnQuaWQgPSBmdW5jdGlvbihfKSB7CisgICAgaWYgKCFhcmd1bWVudHMubGVuZ3RoKSByZXR1cm4gaWQ7CisgICAgaWQgPSBfOworICAgIHJldHVybiBjaGFydDsKKyAgfTsKKworICBjaGFydC5pbnRlcmFjdGl2ZSA9IGZ1bmN0aW9uKF8pIHsKKyAgICBpZighYXJndW1lbnRzLmxlbmd0aCkgcmV0dXJuIGludGVyYWN0aXZlOworICAgIGludGVyYWN0aXZlID0gZmFsc2U7CisgICAgcmV0dXJuIGNoYXJ0OworICB9OworCisgIC8vPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisKKworICByZXR1cm4gY2hhcnQ7Cit9CmRpZmYgLS1naXQgYS9lY29tcC1wb3J0YWwtQkUvd2FyL3N0YXRpYy9mdXNpb24vZDMvanMvbW9kZWxzL2hpc3RvcmljYWxCYXJDaGFydC5qcyBiL2Vjb21wLXBvcnRhbC1CRS93YXIvc3Rhd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Fsc2UKKyAgICAsIHRvb2x0aXBzID0gdHJ1ZQorICAgICwgdG9vbHRpcCA9IGZ1bmN0aW9uKGtleSwgeCwgeSwgZSwgZ3JhcGgpIHsKKyAgICAgICAgcmV0dXJuICc8aDM+JyArIGtleSArICc8L2gzPicgKworICAgICAgICAgICAgICAgJzxwPicgKyAgeSArICcgYXQgJyArIHggKyAnPC9wPicKKyAgICAgIH0KKyAgICAsIHgKKyAgICAsIHkKKyAgICAsIHN0YXRlID0ge30KKyAgICAsIGRlZmF1bHRTdGF0ZSA9IG51bGwKKyAgICAsIG5vRGF0YSA9ICdObyBEYXRhIEF2YWlsYWJsZS4nCisgICAgLCBkaXNwYXRjaCA9IGQzLmRpc3BhdGNoKCd0b29sdGlwU2hvdycsICd0b29sdGlwSGlkZScsICdzdGF0ZUNoYW5nZScsICdjaGFuZ2VTdGF0ZScpCisgICAgLCB0cmFuc2l0aW9uRHVyYXRpb24gPSAyNTAKKyAgICA7CisKKyAgeEF4aXMKKyAgICAub3JpZW50KCdib3R0b20nKQorICAgIC50aWNrUGFkZGluZyg3KQorICAgIDsKKyAgeUF4aXMKKyAgICAub3JpZW50KCAocmlnaHRBbGlnbllBeGlzKSA/ICdyaWdodCcgOiAnbGVmdCcpCisgICAgOworCisgIC8vPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisKKworICAvLz09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorICAvLyBQcml2YXRlIFZhcmlhYmxlcworICAvLy0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLQorCisgIHZhciBzaG93VG9vbHRpcCA9IGZ1bmN0aW9uKGUsIG9mZnNldEVsZW1lbnQpIHsKKworICAgIC8vIE5ldyBhZGRpdGlvbiB0byBjYWxjdWxhdGUgcG9zaXRpb24gaWYg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Lz09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorCisKKyAgZnVuY3Rpb24gY2hhcnQoc2VsZWN0aW9uKSB7CisgICAgc2VsZWN0aW9uLmVhY2goZnVuY3Rpb24oZGF0YSkgeworICAgICAgdmFyIGNvbnRhaW5lciA9IGQzLnNlbGVjdCh0aGlzKSwKKyAgICAgICAgICB0aGF0ID0gdGhpczsKKworICAgICAgdmFyIGF2YWlsYWJsZVdpZHRoID0gKHdpZHRoICB8fCBwYXJzZUludChjb250YWluZXIuc3R5bGUoJ3dpZHRoJykpIHx8IDk2MCkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLSBtYXJnaW4ubGVmdCAtIG1hcmdpbi5yaWdodCwKKyAgICAgICAgICBhdmFpbGFibGVIZWlnaHQgPSAoaGVpZ2h0IHx8IHBhcnNlSW50KGNvbnRhaW5lci5zdHlsZSgnaGVpZ2h0JykpIHx8IDQwMCkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLSBtYXJnaW4udG9wIC0gbWFyZ2luLmJvdHRvbTsKKworCisgICAgICBjaGFydC51cGRhdGUgPSBmdW5jdGlvbigpIHsgY29udGFpbmVyLnRyYW5zaXRpb24oKS5kdXJhdGlvbih0cmFuc2l0aW9uRHVyYXRpb24pLmNhbGwoY2hhcnQpIH07CisgICAgICBjaGFydC5jb250YWluZXIgPSB0aGlzOworCisgICAgICAvL3NldCBzdGF0ZS5kaXNhYmxlZAorICAgICAgc3RhdGUuZGlzYWJsZWQgPSBkYXRhLm1hcChmdW5jdGlvbihkKSB7IHJldHVybiAhIWQuZGlzYWJsZWQgfSk7CisKKyAgICAgIGlmICghZGVmYXVsdFN0YXRlKSB7CisgICAgICAgIHZhciBrZXk7CisgICAgICAgIGRlZmF1bHRTdGF0ZSA9IHt9OworICAgICAgICBmb3IgKGtleSBpbiBzdGF0ZSkgeworICAgICAgICAgIGlmIChzdGF0ZVtrZXldIGluc3RhbmNlb2YgQXJyYXkpCisgICAgICAgICAgICBkZWZhdWx0U3RhdGVba2V5XSA9IHN0YXRlW2tleV0uc2xpY2UoMCk7CisgICAgICAgICAgZWxzZQorICAgICAgICAgICAgZGVmYXVsdFN0YXRlW2tleV0gPSBzdGF0ZVtrZXldOworICAgICAgICB9CisgICAgICB9CisKKyAgICAgIC8vLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tCisgICAgICAvLyBEaXNwbGF5IG5vRGF0YSBtZXNzYWdlIGlmIHRoZXJlJ3Mgbm90aGluZyB0byBzaG93LgorCisgICAgICBpZiAoIWRhdGEgfHwgIWRhdGEubGVuZ3RoIHx8ICFkYXRhLmZpbHRlcihmdW5jdGlvbihkKSB7IHJldHVybiBkLnZhbHVlcy5sZW5ndGggfSkubGVuZ3RoKSB7CisgICAgICAgIHZhciBub0RhdGFUZXh0ID0gY29udGFpbmVyLnNlbGVjdEFsbCgnLm52LW5vRGF0YScpLmRhdGEoW25vRGF0YV0pOworCisgICAgICAgIG5vRGF0YVRleHQuZW50ZXIoKS5hcHBlbmQoJ3RleHQnKQorICAgICAgICAgIC5hdHRyKCdjbGFzcycsICdudmQzIG52LW5vRGF0YScpCisgICAgICAgICAgLmF0dHIoJ2R5JywgJy0uN2VtJykKKyAgICAgICAgICAuc3R5bGUoJ3RleHQtYW5jaG9yJywgJ21pZGRsZScpOworCisgICAgICAgIG5vRGF0YVRleHQKKyAgICAgICAgICAuYXR0cigneCcsIG1hcmdpbi5sZWZ0ICsgYXZhaWxhYmxlV2lkdGggLyAyKQorICAgICAgICAgIC5hdHRyKCd5JywgbWFyZ2luLnRvcCArIGF2YWlsYWJsZUhlaWdodCAvIDIpCisgICAgICAgICAgLnRleHQoZnVuY3Rpb24oZCkgeyByZXR1cm4gZCB9KTsKKworICAgICAgICByZXR1cm4gY2hhcnQ7CisgICAgICB9IGVsc2UgeworICAgICAgICBjb250Y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0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tCisgICAgICAvLyBTZXR1cCBBeGVzCisKKyAgICAgIGlmIChzaG93WEF4aXMpIHsKKyAgICAgICAgeEF4aXMKKyAgICAgICAgICAuc2NhbGUoeCkKKyAgICAgICAgICAudGlja1NpemUoLWF2YWlsYWJsZUhlaWdodCwgMCk7CisKKyAgICAgICAgZy5zZWxlY3QoJy5udi14Lm52LWF4aXMnKQorICAgICAgICAgICAgLmF0dHIoJ3RyYW5zZm9ybScsICd0cmFuc2xhdGUoMCwnICsgeS5yYW5nZSgpWzBdICsgJyknKTsKKyAgICAgICAgZy5zZWxlY3QoJy5udi14Lm52LWF4aXMnKQorICAgICAgICAgICAgLnRyYW5zaXRpb24oKQorICAgICAgICAgICAgLmNhbGwoeEF4aXMpOworICAgICAgfQorCisgICAgICBpZiAoc2hvd1lBeGlzKSB7CisgICAgICAgIHlBeGlzCisgICAgICAgICAgLnNjYWxlKHkpCisgICAgICAgICAgLnRpY2tzKCBhdmFpbGFibGVIZWlnaHQgLyAzNiApCisgICAgICAgICAgLnRpY2tTaXplKCAtYXZhaWxhYmxlV2lkdGgsIDApOworCisgICAgICAgIGcuc2VsZWN0KCcubnYteS5udi1heGlzJykKKyAgICAgICAgICAudHJhbnNpdGlvbigpCisgICAgICAgICAgICAuY2FsbCh5QXhpcyk7CisgICAgICB9CisgICAgICAvLy0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLQorCisKKyAgICAgIC8vPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisgICAgICAvLyBFdmVudCBIYW5kbGluZy9EaXNwYXRjaGluZyAoaW4gY2hhcnQncyBzY29wZSkKKyAgICAgIC8vLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0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gICAgICAgc3RhdGUuZGlzYWJsZWQgPSBkYXRhLm1hcChmdW5jdGlvbihkKSB7IHJldHVybiAhIWQuZGlzYWJsZWQgfSk7CisgICAgICAgICAgZGlzcGF0Y2guc3RhdGVDaGFuZ2Uoc3RhdGUpOworICAgICAgICAgIGNoYXJ0LnVwZGF0ZSgpOworICAgICAgfSk7CisKKyAgICAgIGRpc3BhdGNoLm9uKCd0b29sdGlwU2hvdycsIGZ1bmN0aW9uKGUpIHsKKyAgICAgICAgaWYgKHRvb2x0aXBzKSBzaG93VG9vbHRpcChlLCB0aGF0LnBhcmVudE5vZGUpOworICAgICAgfSk7CisKKworICAgICAgZGlzcGF0Y2gub24oJ2NoYW5nZVN0YXRlJywgZnVuY3Rpb24oZSkgeworCisgICAgICAgIGlmICh0eXBlb2YgZS5kaXNhYmxlZCAhPT0gJ3VuZGVmaW5lZCcpIHsKKyAgICAgICAgICBkYXRhLmZvckVhY2goZnVuY3Rpb24oc2VyaWVzLGkpIHsKKyAgICAgICAgICAgIHNlcmllcy5kaXNhYmxlZCA9IGUuZGlzYWJsZWRbaV07CisgICAgICAgICAgfSk7CisKKyAgICAgICAgICBzdGF0ZS5kaXNhYmxlZCA9IGUuZGlzYWJsZWQ7CisgICAgICAgIH0KKworICAgICAgICBzZWxlY3Rpb24uY2FsbChjaGFydCk7CisgICAgICB9KTsKKworICAgICAgLy89PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKworICAgIH0pOworCisgICAgcmV0dXJuIGNoYXJ0OworICB9CisKKworICAvLz09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorICAvLyBFdmVudCBIYW5kbGluZy9EaXNwYXRjaGluZyAob3V0IG9mIGNoYXJ0J3Mgc2NvcGUpCisgIC8vLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t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SBmdW5jdGlvbihfKSB7CisgICAgaWYgKCFhcmd1bWVudHMubGVuZ3RoKSByZXR1cm4gdG9vbHRpcHM7CisgICAgdG9vbHRpcHMgPSBfOworICAgIHJldHVybiBjaGFydDsKKyAgfTsKKworICBjaGFydC50b29sdGlwQ29udGVudCA9IGZ1bmN0aW9uKF8pIHsKKyAgICBpZiAoIWFyZ3VtZW50cy5sZW5ndGgpIHJldHVybiB0b29sdGlwOworICAgIHRvb2x0aXAgPSBfOworICAgIHJldHVybiBjaGFydDsKKyAgfTsKKworICBjaGFydC5zdGF0ZSA9IGZ1bmN0aW9uKF8pIHsKKyAgICBpZiAoIWFyZ3VtZW50cy5sZW5ndGgpIHJldHVybiBzdGF0ZTsKKyAgICBzdGF0ZSA9IF87CisgICAgcmV0dXJuIGNoYXJ0OworICB9OworCisgIGNoYXJ0LmRlZmF1bHRTdGF0ZSA9IGZ1bmN0aW9uKF8pIHsKKyAgICBpZiAoIWFyZ3VtZW50cy5sZW5ndGgpIHJldHVybiBkZWZhdWx0U3RhdGU7CisgICAgZGVmYXVsdFN0YXRlID0gXzsKKyAgICByZXR1cm4gY2hhcnQ7CisgIH07CisKKyAgY2hhcnQubm9EYXRhID0gZnVuY3Rpb24oXykgeworICAgIGlmICghYXJndW1lbnRzLmxlbmd0aCkgcmV0dXJuIG5vRGF0YTsKKyAgICBub0RhdGEgPSBfOworICAgIHJldHVybiBjaGFydDsKKyAgfTsKKworICBjaGFydC50cmFuc2l0aW9uRHVyYXRpb24gPSBmdW5jdGlvbihfKSB7CisgICAgaWYgKCFhcmd1bWVudHMubGVuZ3RoKSByZXR1cm4gdHJhbnNpdGlvbkR1cmF0aW9uOworICAgIHRyYW5zaXRpb25EdXJhdGlvbiA9IF87CisgICAgcmV0dXJuIGNoYXJ0OworICB9OworCisgIC8vPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisKKworICByZXR1cm4gY2hhcnQ7Cit9CmRpZ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W5zLmZvckVhY2goZnVuY3Rpb24oY29sdW1uLCBpbmRleCkgeworCisgICAgICAgIHZhciBub2RlTmFtZSA9IG5vZGVFbnRlci5hcHBlbmQoJ3RkJykKKyAgICAgICAgICAgIC5zdHlsZSgncGFkZGluZy1sZWZ0JywgZnVuY3Rpb24oZCkgeyByZXR1cm4gKGluZGV4ID8gMCA6IGQuZGVwdGggKiBjaGlsZEluZGVudCArIDEyICsgKGljb24oZCkgPyAwIDogMTYpKSArICdweCcgfSwgJ2ltcG9ydGFudCcpIC8vVE9ETzogY2hlY2sgd2h5IEkgZGlkIHRoZSB0ZXJuYXJ5IGhlcmUKKyAgICAgICAgICAgIC5zdHlsZSgndGV4dC1hbGlnbicsIGNvbHVtbi50eXBlID09ICdudW1lcmljJyA/ICdyaWdodCcgOiAnbGVmdCcpOworCisKKyAgICAgICAgaWYgKGluZGV4ID09IDApIHsKKyAgICAgICAgICBub2RlTmFtZS5hcHBlbmQoJ2ltZycpCisgICAgICAgICAgICAgIC5jbGFzc2VkKCdudi10cmVlaWNvbicsIHRydWUpCisgICAgICAgICAgICAgIC5jbGFzc2VkKCdudi1mb2xkZWQnLCBmb2xkZWQpCisgICAgICAgICAgICAgIC5hdHRyKCdzcmMnLCBpY29uKQorICAgICAgICAgICAgICAuc3R5bGUoJ3dpZHRoJywgJzE0cHgnKQorICAgICAgICAgICAgICAuc3R5bGUoJ2hlaWdodCcsICcxNHB4JykKKyAgICAgICAgICAgICAgLnN0eWxlKCdwYWRkaW5nJywgJzAgMXB4JykKKyAgICAgICAgICAgICAgLnN0eWxlKCdkaXNwbGF5JywgZnVuY3Rpb24oZCkgeyByZXR1cm4gaWNvbihkKSA/ICdpbmxpbmUtYmxvY2snIDogJ25vbmUnOyB9KQorICAgICAgICAgICAgICAub24oJ2NsaWNrJywgY2xpY2spOworICAgICAgICB9CisKKworICAgICAgICBub2RlTmFtZS5lYWNoKGZ1bmN0aW9uKGQpIHsKKyAgICAgICAgICBpZiAoIWluZGV4ICYmIGdldFVybChkKSkKKyAgICAgICAgICAgIGQzLnNlbGVjdCh0aGlzKQorICAgICAgICAgICAgICAuYXBwZW5kKCdhJykKKyAgICAgICAgICAgICAgLmF0dHIoJ2hyZWYnLGdldFVybCkKKyAgICAgICAgICAgICAgLmF0dHIoJ2NsYXNzJywgZDMuZnVuY3Rvcihjb2x1bW4uY2xhc3NlcykpCisgICAgICAgICAgICAgIC5hcHBlbmQoJ3NwYW4nKQorICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgIGQzLnNlbGVjdCh0aGlzKQorICAgICAgICAgICAgICAuYXBwZW5kKCdzcGFuJykKKworICAgICAgICAgICAgZDMuc2VsZWN0KHRoaXMpLnNlbGVjdCgnc3BhbicpCisgICAgICAgICAgICAgIC5hdHRyKCdjbGFzcycsIGQzLmZ1bmN0b3IoY29sdW1uLmNsYXNzZXMpICkKKyAgICAgICAgICAgICAgLnRleHQoZnVuY3Rpb24oZCkgeyByZXR1cm4gY29sdW1uLmZvcm1hdCA/IGNvbHVtbi5mb3JtYXQoZCkgOgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChkW2NvbHVtbi5rZXldIHx8ICctJykgfSk7CisgICAgICAgICAgfSk7CisKKyAgICAgICAgaWYgIChjb2x1bW4uc2hvd0NvdW50KSB7CisgICAgICAgICAgbm9kZU5hbWUuYXBwZW5kKCdzcGFuJykKKyAgICAgICAgICAgICAgLmF0dHIoJ2NsYXNzJywgJ252LWNoaWxkcmVuQ291bnQnKTsKKworICAgICAgICAgIG5vZGUuc2VsZWN0QWxsKCdzcGFuLm52LWNoaWxkcmVuQ291bnQnKS50ZXh0KGZ1bmN0aW9uKGQpIHsKKyAgICAgICAgICAgICAgICByZXR1cm4gKChkLnZhbHVlcyAmJiBkLnZhbHVlcy5sZW5ndGgpIHx8IChkLl92YWx1ZXMgJiYgZC5fdmFsdWVzLmxlbmd0aCkpID8gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vSWYgdGhpcyBpcyBhIHBhcmVudAorICAgICAgICAgICAgICAgICAgICAnKCcgKyAoKGQudmFsdWVzICYmIChkLnZhbHVlcy5maWx0ZXIoZnVuY3Rpb24oZCkgeyByZXR1cm4gZmlsdGVyWmVybyA/IGZpbHRlclplcm8oZCkgOiAgdHJ1ZTsgfSkubGVuZ3RoKSkgLy9JZiBjaGlsZHJlbiBhcmUgaW4gdmFsdWVzIGNoZWNrIGl0cyBjaGlsZHJlbiBhbmQgZmlsdGVyCisgICAgICAgICAgICAgICAgICAgIHx8IChkLl92YWx1ZXMgJiYgZC5fdmFsdWVzLmZpbHRlcihmdW5jdGlvbihkKSB7IHJldHVybiBmaWx0ZXJaZXJvID8gZmlsdGVyWmVybyhkKSA6ICB0cnVlOyB9KS5sZW5ndGgpICAgICAvL090aGVyd2lzZSwgZG8gdGhlIHNhbWUsIGJ1dCB3aXRoIHRoZSBvdGhlciBuYW1lLCBfdmFsdWVzLi4uCisgICAgICAgICAgICAgICAgICAgIHx8IDApICsgJyknICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvL1RoaXMgaXMgdGhlIGNhdGNoLWFsbCBpbiBjYXNlIHRoZXJlIGFyZSBubyBjaGlsZHJlbiBhZnRlciBhIGZpbHRlcgorICAgICAgICAgICAgICAgICAgICA6ICcnICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvL0lmIHRoaXMgaXMgbm90IGEgcGFyZW50LCBqdXN0IGdpdmUgYW4gZW1wdHkgc3RyaW5nCisgICAgICAgICAgICB9KTsKKyAgICAgICAgfQorCisgICAgICAgIC8vIGlmIChjb2x1bW4uY2xpY2spCisgICAgICAgIC8vICAgbm9kZU5hbWUuc2VsZWN0KCdzcGFuJykub24oJ2NsaWNrJywgY29sdW1uLmNsaWNrKTsKKworICAgICAgfSk7CisKKyAgICAgIG5vZGUKKyAgICAgICAgLm9yZGVyKCkKKyAgICAgICAgLm9uKCdjbGljaycsIGZ1bmN0aW9uKGQpIHsgCisgICAgICAgICAgZGlzcGF0Y2guZWxlbWVudENsaWNrKHsKKyAgICAgICAgICAgIHJvdzogdGhpcywgLy9UT0RPOiBkZWNpZGUgd2hldGhlciBvciBub3QgdGhpcyBzaG91bGQgYmUgY29uc2lzdGVudCB3aXRoIHNjYXR0ZXIvbGluZSBldmVudHMgb3Igc2hvdWxkIGJlIGFuIGh0bWwgbGluayAoYSBocmVmKQorICAgICAgICAgICAgZGF0YTogZCwKKyAgICAgICAgICAgIHBvczogW2QueCwgZC55XQorICAgICAgICAgIH0pOworICAgICAgICB9KQorICAgICAgICAub24oJ2RibGNsaWNrJywgZnVuY3Rpb24oZCkgeyAKKyAgICAgICAgICBkaXNwYXRjaC5lbGVtZW50RGJsY2xpY2soeworICAgICAgICAgICAgcm93OiB0aGlzLAorICAgICAgICAgICAgZGF0YTogZCwKKyAgICAgICAgICAgIHBvczogW2QueCwgZC55XQorICAgICAgICAgIH0pOworICAgICAgICB9KQorICAgICAgICAub24oJ21vdXNlb3ZlcicsIGZ1bmN0aW9uKGQpIHsgCisgICAgICAgICAgZGlzcGF0Y2guZWxlbWVudE1vdXNlb3Zlcih7CisgICAgICAgICAgICByb3c6IHRoaXMsCisgICAgICAgICAgICBkYXRhOiBkLAorICAgICAgICAgICAgcG9zOiBbZC54LCBkLnldCisgICAgICAgICAgfSk7CisgICAgICAgIH0pCisgICAgICAgIC5vbignbW91c2VvdXQnLCBmdW5jdGlvbihkKSB7IAorICAgICAgICAgIGRpc3BhdGNoLmVsZW1lbnRNb3VzZW91dCh7CisgICAgICAgICAgICByb3c6IHRoaXMsCisgICAgICAgICAgICBkYXRhOiBkLAorICAgICAgICAgICAgcG9zOiBbZC54LCBkLnldCisgICAgICAgICAgfSk7CisgICAgICAgIH0pOworCisKKworCisgICAgICAvLyBUb2dnbGUgY2hpbGRyZW4gb24gY2xpY2suCisgICAgICBmdW5jdGlvbiBjbGljayhkLCBfLCB1bnNoaWZ0KSB7CisgICAgICAgIGQzLmV2ZW50LnN0b3BQcm9wYWdhdGlvbigpOworCisgICAgICAgIGlmKGQzLmV2ZW50LnNoaWZ0S2V5ICYmICF1bnNoaWZ0KSB7CisgICAgICAgICAgLy9JZiB5b3Ugc2hpZnQtY2xpY2ssIGl0J2xsIHRvZ2dsZSBmb2xkIGFsbCB0aGUgY2hpbGRyZW4sIGluc3RlYWQgb2YgaXRzZWxmCisgICAgICAgICAgZDMuZXZlbnQuc2hpZnRLZXkgPSBmYWxzZTsKKyAgICAgICAgICBkLnZhbHVlcyAmJiBkLnZhbHVlcy5mb3JFYWNoKGZ1bmN0aW9uKG5vZGUpeworICAgICAgICAgICAgaWYgKG5vZGUudmFsdWVzIHx8IG5vZGUuX3ZhbHVlcykgeworICAgICAgICAgICAgICBjbGljayhub2RlLCAwLCB0cnVlKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICB9KTsKKyAgICAgICAgICByZXR1cm4gdHJ1ZTsKKyAgICAgICAgfQorICAgICAgICBpZighaGFzQ2hpbGRyZW4oZCkpIHsKKyAgICAgICAgICAvL2Rvd25sb2FkIGZpbGUKKyAgICAgICAgICAvL3dpbmRvdy5sb2NhdGlvbi5ocmVmID0gZC51cmw7CisgICAgICAgICAgcmV0dXJuIHRydWU7CisgICAgICAgIH0KKyAgICAgICAgaWYgKGQudmFsdWVzKSB7CisgICAgICAgICAgZC5fdmFsdWVzID0gZC52YWx1ZXM7CisgICAgICAgICAgZC52YWx1ZXMgPSBudWxsOworICAgICAgICB9IGVsc2UgeworICAgICAgICAgIGQudmFsdWVzID0gZC5fdmFsdWVzOworICAgICAgICAgIGQuX3ZhbHVlcyA9IG51bGw7CisgICAgICAgIH0KKyAgICAgICAgY2hhcnQudXBkYXRlKCk7CisgICAgICB9CisKKworICAgICAgZnVuY3Rpb24gaWNvbihkKSB7CisgICAgICAgIHJldHVybiAoZC5fdmFsdWVzICYmIGQuX3ZhbHVlcy5sZW5ndGgpID8gaWNvbk9wZW4gOiAoZC52YWx1ZXMgJiYgZC52YWx1ZXMubGVuZ3RoKSA/IGljb25DbG9zZSA6ICcnOworICAgICAgfQorCisgICAgICBmdW5jdGlvbiBmb2xkZWQoZCkgeworICAgICAgICByZXR1cm4gKGQuX3ZhbHVlcyAmJiBkLl92YWx1ZXMubGVuZ3RoKTsKKyAgICAgIH0KKworICAgICAgZnVuY3Rpb24gaGFzQ2hpbGRyZW4oZCkgeworICAgICAgICB2YXIgdmFsdWVzID0gZC52YWx1ZXMgfHwgZC5fdmFsdWVzOworCisgICAgICAgIHJldHVybiAodmFsdWVzICYmIHZhbHVlcy5sZW5ndGgpOworICAgICAgfQorCisKKyAgICB9KTsKKworICAgIHJldHVybiBjaGFydDsKKyAgfQorCisKKyAgLy89PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKyAgLy8gRXhwb3NlIFB1YmxpYyBWYXJpYWJsZXMKKyAgLy8tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0KKyAgY2hhcnQub3B0aW9ucyA9IG52LnV0aWxzLm9wdGlvbnNGdW5jLmJpbmQoY2hhcnQpOworICAKKyAgY2hhcnQubWFyZ2luID0gZnVuY3Rpb24oXykgeworICAgIGlmICghYXJndW1lbnRzLmxlbmd0aCkgcmV0dXJuIG1hcmdpbjsKKyAgICBtYXJnaW4udG9wICAgID0gdHlwZW9mIF8udG9wICAgICE9ICd1bmRlZmluZWQnID8gXy50b3AgICAgOiBtYXJnaW4udG9wOworICAgIG1hcmdpbi5yaWdodCAgPSB0eXBlb2YgXy5yaWdodCAgIT0gJ3VuZGVmaW5lZCcgPyBfLnJpZ2h0ICA6IG1hcmdpbi5yaWdodDs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B9CisKKyAgLy89PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKworCisgIHJldHVybiBjaGFydDsKK307ClwgTm8gbmV3bGluZSBhdCBlbmQgb2YgZmlsZQpkaWZmIC0tZ2l0IGEvZWNvbXAtcG9ydGFsLUJFL3dhci9zdGF0aWMvZnVzaW9uL2QzL2pzL21vZGVscy9sZWdlbmQuanMgYi9lY29tcC1wb3J0YWwtQkUvd2FyL3N0YXRpYy9mdXNpb24vZDMvanMvbW9kZWxzL2xlZ2VuZC5qcwpuZXcgZmlsZSBtb2RlIDEwMDY0NAppbmRleCAwMDAwMDAwLi4yMWY5ZjlhCi0tLSAvZGV2L251bGwKKysrIGIvZWNvbXAtcG9ydGFsLUJFL3dhci9zdGF0aWMvZnVzaW9uL2QzL2pzL21vZGVscy9sZWdlbmQuanMKQEAgLTAsMCArMSwyNzAgQEAKK252Lm1vZGVscy5sZWdlbmQgPSBmdW5jdGlvbigpIHsKKyAgInVzZSBzdHJpY3QiOworICAvLz09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorICAvLyBQdWJsaWMgVmFyaWFibGVzIHdpdGggRGVmYXVsdCBTZXR0aW5ncworICAvLy0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLQorCisgIHZhciBtYXJnaW4gPSB7dG9wOiA1LCByaWdodDogMCwgYm90dG9tOiA1LCBsZWZ0OiAwfQorICAgICwgd2lkdGggPSA0MDAKKyAgICAsIGhlaWdodCA9IDIwCisgICAgLCBnZXRLZXkgPSBmdW5jdGlvbihkKSB7IHJldHVybiBkLmtleSB9CisgICAgLCBjb2xvciA9IG52LnV0aWxzLmRlZmF1bHRDb2xvcigpCisgICAgLCBhbGlnbiA9IHRydWUKKyAgICAsIHJpZ2h0QWxpZ24gPSB0cnVlCisgICAg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bk1vZGUpIHsKKyAgICAgICAgICAgICAgICAgICAvL1JhZGlvIGJ1dHRvbiBtb2RlOiBzZXQgZXZlcnkgc2VyaWVzIHRvIGRpc2FibGVkLAorICAgICAgICAgICAgICAgICAgIC8vICBhbmQgZW5hYmxlIHRoZSBjbGlja2VkIHNlcmllcy4KKyAgICAgICAgICAgICAgICAgICBkYXRhLmZvckVhY2goZnVuY3Rpb24oc2VyaWVzKSB7IHNlcmllcy5kaXNhYmxlZCA9IHRydWV9KTsKKyAgICAgICAgICAgICAgICAgICBkLmRpc2FibGVkID0gZmFsc2U7CisgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICBlbHNlIHsKKyAgICAgICAgICAgICAgICAgICBkLmRpc2FibGVkID0gIWQuZGlzYWJsZWQ7CisgICAgICAgICAgICAgICAgICAgaWYgKGRhdGEuZXZlcnkoZnVuY3Rpb24oc2VyaWVzKSB7IHJldHVybiBzZXJpZXMuZGlzYWJsZWR9KSkgeworICAgICAgICAgICAgICAgICAgICAgICAvL3RoZSBkZWZhdWx0IGJlaGF2aW9yIG9mIE5WRDMgbGVnZW5kcyBpcywgaWYgZXZlcnkgc2luZ2xlIHNlcmllcworICAgICAgICAgICAgICAgICAgICAgICAvLyBpcyBkaXNhYmxlZCwgdHVybiBhbGwgc2VyaWVzJyBiYWNrIG9uLgorICAgICAgICAgICAgICAgICAgICAgICBkYXRhLmZvckVhY2goZnVuY3Rpb24oc2VyaWVzKSB7IHNlcmllcy5kaXNhYmxlZCA9IGZhbHNlfSk7CisgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgZGlzcGF0Y2guc3RhdGVDaGFuZ2UoeworICAgICAgICAgICAgICAgICAgZGlzYWJsZWQ6IGRhdGEubWFwKGZ1bmN0aW9uKGQpIHsgcmV0dXJuICEhZC5kaXNhYmxlZCB9KQorICAgICAgICAgICAgICAgfSk7CisgICAgICAgICAgICB9CisgICAgICAgICAgfSkKKyAgICAgICAgICAub24oJ2RibGNsaWNrJywgZnVuY3Rpb24oZCxpKSB7CisgICAgICAgICAgICBkaXNwYXRjaC5sZWdlbmREYmxjbGljayhkLGkpOworICAgICAgICAgICAgaWYgKHVwZGF0ZVN0YXRlKSB7CisgICAgICAgICAgICAgICAgLy90aGUgZGVmYXVsdCBiZWhhdmlvciBvZiBOVkQzIGxlZ2VuZHMsIHdoZW4gZG91YmxlIGNsaWNraW5nIG9uZSwKKyAgICAgICAgICAgICAgICAvLyBpcyB0byBzZXQgYWxsIG90aGVyIHNlcmllcycgdG8gZmFsc2UsIGFuZCBtYWtlIHRoZSBkb3VibGUgY2xpY2tlZCBzZXJpZXMgZW5hYmxlZC4KKyAgICAgICAgICAgICAgICBkYXRhLmZvckVhY2goZnVuY3Rpb24oc2VyaWVzKSB7CisgICAgICAgICAgICAgICAgICAgc2VyaWVzLmRpc2FibGVkID0gdHJ1ZTsKKyAgICAgICAgICAgICAgICB9KTsKKyAgICAgICAgICAgICAgICBkLmRpc2FibGVkID0gZmFsc2U7IAorICAgICAgICAgICAgICAgIGRpc3BhdGNoLnN0YXRlQ2hhbmdlKHsKKyAgICAgICAgICAgICAgICAgICAgZGlzYWJsZWQ6IGRhdGEubWFwKGZ1bmN0aW9uKGQpIHsgcmV0dXJuICEhZC5kaXNhYmxlZCB9KQorICAgICAgICAgICAgICAgIH0pOworICAgICAgICAgICAgfQorICAgICAgICAgIH0pOworICAgICAgc2VyaWVzRW50ZXIuYXBwZW5kKCdjaXJjbGUnKQorICAgICAgICAgIC5zdHlsZSgnc3Ryb2tlLXdpZHRoJywgMikKKyAgICAgICAgICAuYXR0cignY2xhc3MnLCdudi1sZWdlbmQtc3ltYm9sJykKKyAgICAgICAgICAuYXR0cigncicsIDUpOworICAgICAgc2VyaWVzRW50ZXIuYXBwZW5kKCd0ZXh0JykKKyAgICAgICAgICAuYXR0cigndGV4dC1hbmNob3InLCAnc3RhcnQnKQorICAgICAgICAgIC5hdHRyKCdjbGFzcycsJ252LWxl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lbmd0aCgpOworICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgIGNhdGNoKGUpIHsKKyAgICAgICAgICAgICAgICBub2RlVGV4dExlbmd0aCA9IG52LnV0aWxzLmNhbGNBcHByb3hUZXh0V2lkdGgobGVnZW5kVGV4dCk7CisgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAKKyAgICAgICAgICAgICAgc2VyaWVzV2lkdGhzLnB1c2gobm9kZVRleHRMZW5ndGggKyAyOCk7IC8vIDI4IGlzIH4gdGhlIHdpZHRoIG9mIHRoZSBjaXJjbGUgcGx1cyBzb21lIHBhZGRpbmcKKyAgICAgICAgICAgIH0pOworCisgICAgICAgIHZhciBzZXJpZXNQZXJSb3cgPSAwOworICAgICAgICB2YXIgbGVnZW5kV2lkdGggPSAwOworICAgICAgICB2YXIgY29sdW1uV2lkdGhzID0gW107CisKKyAgICAgICAgd2hpbGUgKCBsZWdlbmRXaWR0aCA8IGF2YWlsYWJsZVdpZHRoICYmIHNlcmllc1BlclJvdyA8IHNlcmllc1dpZHRocy5sZW5ndGgpIHsKKyAgICAgICAgICBjb2x1bW5XaWR0aHNbc2VyaWVzUGVyUm93XSA9IHNlcmllc1dpZHRoc1tzZXJpZXNQZXJSb3ddOworICAgICAgICAgIGxlZ2VuZFdpZHRoICs9IHNlcmllc1dpZHRoc1tzZXJpZXNQZXJSb3crK107CisgICAgICAgIH0KKyAgICAgICAgaWYgKHNlcmllc1BlclJvdyA9PT0gMCkgc2VyaWVzUGVyUm93ID0gMTsgLy9taW5pbXVtIG9mIG9uZSBzZXJpZXMgcGVyIHJvdworCisKKyAgICAgICAgd2hpbGUgKCBsZWdlbmRXaWR0aCA+IGF2YWlsYWJsZVdpZHRoICYmIHNlcmllc1BlclJvdyA+IDEgKSB7CisgICAgICAgICAgY29sdW1uV2lkdGhzID0gW107CisgICAgICAgICAgc2VyaWVzUGVyUm93LS07CisKKyAgICAgICAgICBmb3IgKHZhciBrID0gMDsgayA8IHNlcmllc1dpZHRocy5sZW5ndGg7IGsrKykgeworICAgICAgICAgICAgaWYgKHNlcmllc1dpZHRoc1trXSA+IChjb2x1bW5XaWR0aHNbayAlIHNlcmllc1BlclJvd10gfHwgMCkgKQorICAgICAgICAgICAgICBjb2x1bW5XaWR0aHNbayAlIHNlcmllc1BlclJvd10gPSBzZXJpZXNXaWR0aHNba107CisgICAgICAgICAgfQorCisgICAgICAgICAgbGVnZW5kV2lkdGggPSBjb2x1bW5XaWR0aHMucmVkdWNlKGZ1bmN0aW9uKHByZXYsIGN1ciwgaW5kZXgsIGFycmF5KSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBwcmV2ICsgY3VyOworICAgICAgICAgICAgICAgICAgICAgICAgfSk7CisgICAgICAgIH0KKworICAgICAgICB2YXIgeFBvc2l0aW9ucyA9IFtdOworICAgICAgICBmb3IgKHZhciBpID0gMCwgY3VyWCA9IDA7IGkgPCBzZXJpZXNQZXJSb3c7IGkrKykgeworICAgICAgICAgICAgeFBvc2l0aW9uc1tpXSA9IGN1clg7CisgICAgICAgICAgICBjdXJYICs9IGNvbHVtbldpZHRoc1tpXTsKKyAgICAgICAgfQorCisgICAgICAgIHNlcmllcworICAgICAgICAgICAgLmF0dHIoJ3RyYW5zZm9ybScsIGZ1bmN0aW9uKGQsIGkpIHsKKyAgICAgICAgICAgICAgcmV0dXJuICd0cmFuc2xhdGUoJyArIHhQb3NpdGlvbnNbaSAlIHNlcmllc1BlclJvd10gKyAnLCcgKyAoNSArIE1hdGguZmxvb3IoaSAvIHNlcmllc1BlclJvdykgKiAyMCkgKyAnKSc7CisgICAgICAgICAgICB9KTsKKworICAgICAgICAvL3Bvc2l0aW9uIGxlZ2VuZCBhcyBmYXIgcmlnaHQgYXMgcG9zc2libGUgd2l0aGluIHRoZSB0b3RhbCB3aWR0aAorICAgICAgICBpZiAocmlnaHRBbGlnbikgeworICAgICAgICAgICBnLmF0dHIoJ3RyYW5zZm9ybScsICd0cmFuc2xhdGUoJyArICh3aWR0aCAtIG1hcmdpbi5yaWdodCAtIGxlZ2VuZFdpZHRoKSArICcsJyArIG1hcmdpbi50b3AgKyAnKScpOworICAgICAgICB9CisgICAgICAgIGVsc2UgeworICAgICAgICAgICBnLmF0dHIoJ3RyYW5zZm9ybScsICd0cmFuc2xhdGUoMCcgKyAnLCcgKyBtYXJnaW4udG9wICsgJyknKTsKKyAgICAgICAgfQorCisgICAgICAgIGhlaWdodCA9IG1hcmdpbi50b3AgKyBtYXJnaW4uYm90dG9tICsgKE1hdGguY2VpbChzZXJpZXNXaWR0aHMubGVuZ3RoIC8gc2VyaWVzUGVyUm93KSAqIDIwKTsKKworICAgICAgfSBlbHNlIHsKKworICAgICAgICB2YXIgeXBvcyA9IDUsCisgICAgICAgICAgICBuZXd4cG9zID0gNSwKKyAgICAgICAgICAgIG1heHdpZHRoID0gMCwKKyAgICAgICAgICAgIHhwb3M7CisgICAgICAgIHNlcmllcworICAgICAgICAgICAgLmF0dHIoJ3RyYW5zZm9ybScsIGZ1bmN0aW9uKGQsIGkpIHsKKyAgICAgICAgICAgICAgdmFyIGxlbmd0aCA9IGQzLnNlbGVjdCh0aGlzKS5zZWxlY3QoJ3RleHQnKS5ub2RlKCkuZ2V0Q29tcHV0ZWRUZXh0TGVuZ3RoKCkgKyAyODsKKyAgICAgICAgICAgICAgeHBvcyA9IG5ld3hwb3M7CisKKyAgICAgICAgICAgICAgaWYgKHdpZHRoIDwgbWFyZ2luLmxlZnQgKyBtYXJnaW4ucmlnaHQgKyB4cG9zICsgbGVuZ3RoKSB7CisgICAgICAgICAgICAgICAgbmV3eHBvcyA9IHhwb3MgPSA1OworICAgICAgICAgICAgICAgIHlwb3MgKz0gMjA7CisgICAgICAgICAgICAgIH0KKworICAgICAgICAgICAgICBuZXd4cG9zICs9IGxlbmd0aDsKKyAgICAgICAgICAgICAgaWYgKG5ld3hwb3MgPiBtYXh3aWR0aCkgbWF4d2lkdGggPSBuZXd4cG9zOworCisgICAgICAgICAgICAgIHJldHVyb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0aCkgcmV0dXJuIHJpZ2h0QWxpZ247CisgICAgcmlnaHRBbGlnbiA9IF87CisgICAgcmV0dXJuIGNoYXJ0OworICB9OworCisgIGNoYXJ0LnVwZGF0ZVN0YXRlID0gZnVuY3Rpb24oXykgeworICAgIGlmICghYXJndW1lbnRzLmxlbmd0aCkgcmV0dXJuIHVwZGF0ZVN0YXRlOworICAgIHVwZGF0ZVN0YXRlID0gXzsKKyAgICByZXR1cm4gY2hhcnQ7CisgIH07CisKKyAgY2hhcnQucmFkaW9CdXR0b25Nb2RlID0gZnVuY3Rpb24oXykgeworICAgIGlmICghYXJndW1lbnRzLmxlbmd0aCkgcmV0dXJuIHJhZGlvQnV0dG9uTW9kZTsKKyAgICByYWRpb0J1dHRvbk1vZGUgPSBfOworICAgIHJldHVybiBjaGFydDsKKyAgfTsKKworICAvLz09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorCisKKyAgcmV0dXJuIGNoYXJ0OworfQpkaWZmIC0tZ2l0IGEvZWNvbXAtcG9ydGFsLUJFL3dhci9zdGF0aWMvZnVzaW9uL2QzL2pzL21vZGVscy9saW5lLmpzIGIvZWNvbXAtcG9ydGFsLUJFL3dhci9zdGF0aWMvZnVzaW9uL2QzL2pzL21vZGVscy9saW5lLmpzCm5ldyBmaWxlIG1vZGUgMTAwNjQ0CmluZGV4IDAwMDAwMDAuLjg1NWNjNTQKLS0tIC9kZXYvbnVsbAorKysgYi9lY29tcC1wb3J0YWwtQkUvd2FyL3N0YXRpYy9mdXNpb24vZDMvanMvbW9kZWxzL2xpbmUuanMKQEAgLTAsMCArMSwyODQgQEAKKworbnYubW9kZWxzLmxpbmUgPSBmdW5jdGlvbigpIHsKKyAgInVzZSBzdHJpY3QiOworICAvLz09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorICAvLyBQdWJsaWMgVmFyaWFibGVzIHdpdGggRGVmYXV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hcnQueFNjYWxlKCkKKyAgICAsIHkgLy9jYW4gYmUgYWNjZXNzZWQgdmlhIGNoYXJ0LnlTY2FsZSgpCisgICAgLCBpbnRlcnBvbGF0ZSA9ICJsaW5lYXIiIC8vIGNvbnRyb2xzIHRoZSBsaW5lIGludGVycG9sYXRpb24KKyAgICA7CisKKyAgc2NhdHRlcgorICAgIC5zaXplKDE2KSAvLyBkZWZhdWx0IHNpemUKKyAgICAuc2l6ZURvbWFpbihbMTYsMjU2XSkgLy9zZXQgdG8gc3BlZWQgdXAgY2FsY3VsYXRpb24sIG5lZWRzIHRvIGJlIHVuc2V0IGlmIHRoZXJlIGlzIGEgY3VzdG9tIHNpemUgYWNjZXNzb3IKKyAgICA7CisgICAgCisgIC8vPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisKKworICAvLz09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorICAvLyBQcml2YXRlIFZhcmlhYmxlcworICAvLy0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLQorCisgIHZhciB4MCwgeTAgLy91c2VkIHRvIHN0b3JlIHByZXZpb3VzIHNjYWxlcworICAgICAgOworCisgIC8vPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisKKworICBmdW5jdGlvbiBjaGFydChzZWxlY3Rpb24pIHsKKyAgICBzZWxlY3Rpb24uZWFjaChmdW5jdGlvbihkYXRhKSB7CisgICAgICB2YXIgYXZhaWxhYmxlV2lkdGggPSB3aWR0aCAtIG1hcmdpbi5sZWZ0IC0gbWFyZ2luLnJpZ2h0LAorICAgICAgICAgIGF2YWlsYWJsZUhlaWdodCA9IGhlaWdodCAtIG1hcmdpbi50b3AgLSBtYXJnaW4uYm90dG9tLAorICAgICAgICAg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b3BhY2l0eScsIDEpCisgICAgICAgICAgLnN0eWxlKCdmaWxsLW9wYWNpdHknLCAuNSk7CisKKworCisgICAgICB2YXIgYXJlYVBhdGhzID0gZ3JvdXBzLnNlbGVjdEFsbCgncGF0aC5udi1hcmVhJykKKyAgICAgICAgICAuZGF0YShmdW5jdGlvbihkKSB7IHJldHVybiBpc0FyZWEoZCkgPyBbZF0gOiBbXSB9KTsgLy8gdGhpcyBpcyBkb25lIGRpZmZlcmVudGx5IHRoYW4gbGluZXMgYmVjYXVzZSBJIG5lZWQgdG8gY2hlY2sgaWYgc2VyaWVzIGlzIGFuIGFyZWEKKyAgICAgIGFyZWFQYXRocy5lbnRlcigpLmFwcGVuZCgncGF0aCcpCisgICAgICAgICAgLmF0dHIoJ2NsYXNzJywgJ252LWFyZWEnKQorICAgICAgICAgIC5hdHRyKCdkJywgZnVuY3Rpb24oZCkgeworICAgICAgICAgICAgcmV0dXJuIGQzLnN2Zy5hcmVhKCkKKyAgICAgICAgICAgICAgICAuaW50ZXJwb2xhdGUoaW50ZXJwb2xhdGUpCisgICAgICAgICAgICAgICAgLmRlZmluZWQoZGVmaW5lZCkKKyAgICAgICAgICAgICAgICAueChmdW5jdGlvbihkLGkpIHsgcmV0dXJuIG52LnV0aWxzLk5hTnRvWmVybyh4MChnZXRYKGQsaSkpKSB9KQorICAgICAgICAgICAgICAgIC55MChmdW5jdGlvbihkLGkpIHsgcmV0dXJuIG52LnV0aWxzLk5hTnRvWmVybyh5MChnZXRZKGQsaSkpKSB9KQorICAgICAgICAgICAgICAgIC55MShmdW5jdGlvbihkLGkpIHsgcmV0dXJuIHkwKCB5LmRvbWFpbigpWzBdIDw9IDAgPyB5LmRvbWFpbigpWzFdID49IDAgPyAwIDogeS5kb21haW4oKVsxXSA6IHkuZG9tYWluKClbMF0gKSB9KQorICAgICAgICAgICAgICAgIC8vLnkxKGZ1bmN0aW9uKGQsaSkgeyByZXR1cm4geTAoMCkgfSkgLy9hc3N1bWluZyAwIGlzIHdpdGhpbiB5IGRvbWFpbi4uIG1heSBuZWVkIHRvIHR3ZWFrIHRoaXMKKyAgICAgICAgICAgICAgICAuYXBwbHkodGhpcywgW2QudmFsdWVzXSkKKyAgICAgICAgICB9KTsKKyAgICAgIGdyb3Vwcy5leGl0KCkuc2VsZWN0QWxsKCdwYXRoLm52LWFyZWEnKQorICAgICAgICAgICAucmVtb3ZlKCk7CisgICAgICAgICAgIAorICAgICAgYXJlYVBhdGhzCisgICAgICAgICAgLnRyYW5zaXRpb24oKQorICAgICAgICAgIC5hdHRyKCdkJywgZnVuY3Rpb24oZCkgeworICAgICAgICAgICAgcmV0dXJuIGQzLnN2Zy5hcmVhKCkKKyAgICAgICAgICAgICAgICAuaW50ZXJwb2xhdGUoaW50ZXJwb2xhdGUpCisgICAgICAgICAgICAgICAgLmRlZmluZWQoZGVmaW5lZCkKKyAgICAgICAgICAgICAgICAueChmdW5jdGlvbihkLGkpIHsgcmV0dXJuIG52LnV0aWxzLk5hTnRvWmVybyh4KGdldFgoZCxpKSkpIH0pCisgICAgICAgICAgICAgICAgLnkwKGZ1bmN0aW9uKGQsaSkgeyByZXR1cm4gbnYudXRpbHMuTmFOdG9aZXJvKHkoZ2V0WShkLGkpKSkgfSkKKyAgICAgICAgICAgICAgICAueTEoZnVuY3Rpb24oZCxpKSB7IHJldHVybiB5KCB5LmRvbWFpbigpWzBdIDw9IDAgPyB5LmRvbWFpbigpWzFdID49IDAgPyAwIDogeS5kb21haW4oKVsxXSA6IHkuZG9tYWluKClbMF0gKSB9KQorICAgICAgICAgICAgICAgIC8vLnkxKGZ1bmN0aW9uKGQsaSkgeyByZXR1cm4geTAoMCkgfSkgLy9hc3N1bWluZyAwIGlzIHdpdGhpbiB5IGRvbWFpbi4uIG1heSBuZWVkIHRvIHR3ZWFrIHRoaXMKKyAgICAgICAgICAgICAgICAuYXBwbHkodGhpcywgW2QudmFsdWVzXSkKKyAgICAgICAgICB9KTsKKworCisKKyAgICAgIHZhciBsaW5lUGF0aHMgPSBncm91cHMuc2VsZWN0QWxsKCdwYXRoLm52LWxpbmUnKQorICAgICAgICAgIC5kYXRhKGZ1bmN0aW9uKGQpIHsgcmV0dXJuIFtkLnZhbHVlc10gfSk7CisgICAgICBsaW5lUGF0aHMuZW50ZXIoKS5hcHBlbmQoJ3BhdGgnKQorICAgICAgICAgIC5hdHRyKCdjbGFzcycsICdudi1saW5lJykKKyAgICAgICAgICAuYXR0cignZCcsCisgICAgICAgICAgICBkMy5zdmcubGluZSgpCisgICAgICAgICAgICAgIC5pbnRlcnBvbGF0ZShpbnRlcnBvbGF0ZSkKKyAgICAgICAgICAgICAgLmRlZmluZWQoZGVmaW5lZCkKKyAgICAgICAgICAgICAgLngoZnVuY3Rpb24oZCxpKSB7IHJldHVybiBudi51dGlscy5OYU50b1plcm8oeDAoZ2V0WChkLGkpKSkgfSkKKyAgICAgICAgICAgICAgLnkoZnVuY3Rpb24oZCxpKSB7IHJldHVybiBudi51dGlscy5OYU50b1plcm8oeTAoZ2V0WShkLGkpKSkgfSkKKyAgICAgICAgICApOworICAgICAgZ3JvdXBzLmV4aXQoKS5zZWxlY3RBbGwoJ3BhdGgubnYtbGluZScpCisgICAgICAgICAgLnRyYW5zaXRpb24oKQorICAgICAgICAgIC5hdHRyKCdkJywKKyAgICAgICAgICAgIGQzLnN2Zy5saW5lKCkKKyAgICAgICAgICAgICAgLmludGVycG9sYXRlKGludGVycG9sYXRlKQorICAgICAgICAgICAgICAuZGVmaW5lZChkZWZpbmVkKQorICAgICAgICAgICAgICAueChmdW5jdGlvbihkLGkpIHsgcmV0dXJuIG52LnV0aWxzLk5hTnRvWmVybyh4KGdldFgoZCxpKSkpIH0pCisgICAgICAgICAgICAgIC55KGZ1bmN0aW9uKGQsaSkgeyByZXR1cm4gbnYudXRpbHMuTmFOdG9aZXJvKHkoZ2V0WShkLGkpKSkgfSkKKyAgICAgICAgICApOworICAgICAgbGluZVBhdGhzCisgICAgICAgICAgLnRyYW5zaXRpb24oKQorICAgICAgICAgIC5hdHRyKCdkJywKKyAgICAgICAgICAgIGQzLnN2Zy5saW5lKCkKKyAgICAgICAgICAgICAgLmludGVycG9sYXRlKGludGVycG9sYXRlKQorICAgICAgICAgICAgICAuZGVmaW5lZChkZWZpbmVkKQorICAgICAgICAgICAgICAueChmdW5jdGlvbihkLGkpIHsgcmV0dXJuIG52LnV0aWxzLk5hTnRvWmVybyh4KGdldFgoZCxpKSkpIH0pCisgICAgICAgICAgICAgIC55KGZ1bmN0aW9uKGQsaSkgeyByZXR1cm4gbnYudXRpbHMuTmFOdG9aZXJvKHkoZ2V0WShkLGkpKSkgfSkKKyAgICAgICAgICApOworCisKKworICAgICAgLy9zdG9yZSBvbGQgc2NhbGVzIGZvciB1c2UgaW4gdHJhbnNpdGlvbnMgb24gdXBkYXRlCisgICAgICB4MCA9IHguY29weSgpOworICAgICAgeTAgPSB5LmNvcHkoKTsKKworICAgIH0pOworCisgICAgcmV0dXJuIGNoYXJ0OworICB9CisKKworICAvLz09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorICAvLyBFeHBvc2UgUHVibGljIFZhcmlhYmxlcworICAvLy0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLQorCisgIGNoYXJ0LmRpc3BhdGNoID0gc2NhdHRlci5kaXNwYXRjaDsKKyAgY2hhcnQuc2NhdHRlciA9IHNjYXR0ZXI7CisKKyAgZDMucmViaW5kKGNoYXJ0LCBzY2F0dGVyLCAnaWQnLCAnaW50ZXJhY3RpdmUnLCAnc2l6ZScsICd4U2NhbGUnLCAneVNjYWxlJywgJ3pTY2FsZScsICd4RG9tYWluJywgJ3lEb21haW4nLCAneFJhbmdlJywgJ3lSYW5nZScsIAorICAgICdzaXplRG9tYWluJywgJ2ZvcmNlWCcsICdmb3JjZVknLCAnZm9yY2VTaXplJywgJ2NsaXBWb3Jvb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xlbmd0aCkgcmV0dXJuIGdldFg7CisgICAgZ2V0WCA9IF87CisgICAgc2NhdHRlci54KF8pOworICAgIHJldHVybiBjaGFydDsKKyAgfTsKKworICBjaGFydC55ID0gZnVuY3Rpb24oXykgeworICAgIGlmICghYXJndW1lbnRzLmxlbmd0aCkgcmV0dXJuIGdldFk7CisgICAgZ2V0WSA9IF87CisgICAgc2NhdHRlci55KF8pOworICAgIHJldHVybiBjaGFydDsKKyAgfTsKKworICBjaGFydC5jbGlwRWRnZSA9IGZ1bmN0aW9uKF8pIHsKKyAgICBpZiAoIWFyZ3VtZW50cy5sZW5ndGgpIHJldHVybiBjbGlwRWRnZTsKKyAgICBjbGlwRWRnZSA9IF87CisgICAgcmV0dXJuIGNoYXJ0OworICB9OworCisgIGNoYXJ0LmNvbG9yID0gZnVuY3Rpb24oXykgeworICAgIGlmICghYXJndW1lbnRzLmxlbmd0aCkgcmV0dXJuIGNvbG9yOworICAgIGNvbG9yID0gbnYudXRpbHMuZ2V0Q29sb3IoXyk7CisgICAgc2NhdHRlci5jb2xvcihjb2xvcik7CisgICAgcmV0dXJuIGNoYXJ0OworICB9OworCisgIGNoYXJ0LmludGVycG9sYXRlID0gZnVuY3Rpb24oXykgeworICAgIGlmICghYXJndW1lbnRzLmxlbmd0aCkgcmV0dXJuIGludGVycG9sYXRlOworICAgIGludGVycG9sYXRlID0gXzsKKyAgICByZXR1cm4gY2hhcnQ7CisgIH07CisKKyAgY2hhcnQuZGVmaW5lZCA9IGZ1bmN0aW9uKF8pIHsKKyAgICBpZiAoIWFyZ3VtZW50cy5sZW5ndGgpIHJldHVybiBkZWZpbmVkOworICAgIGRlZmluZWQgPSBfOworICAgIHJldHVybiBjaGFydDsKKyAgfTsKKworICBjaGFydC5pc0FyZWEgPSBmdW5jdGlvbihfKSB7CisgICAgaWYgKCFhcmd1bWVudHMubGVuZ3RoKSByZXR1cm4gaXNBcmVhOworICAgIGlzQXJlYSA9IGQzLmZ1bmN0b3IoXyk7CisgICA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AsIHJpZ2h0OiAyMCwgYm90dG9tOiA1MCwgbGVmdDogNjB9CisgICAgLCBjb2xvciA9IG52LnV0aWxzLmRlZmF1bHRDb2xvcigpCisgICAgLCB3aWR0aCA9IG51bGwKKyAgICAsIGhlaWdodCA9IG51bGwKKyAgICAsIHNob3dMZWdlbmQgPSB0cnVlCisgICAgLCBzaG93WEF4aXMgPSB0cnVlCisgICAgLCBzaG93WUF4aXMgPSB0cnVlCisgICAgLCByaWdodEFsaWduWUF4aXMgPSBmYWxzZQorICAgICwgdXNlSW50ZXJhY3RpdmVHdWlkZWxpbmUgPSBmYWxzZQorICAgICwgdG9vbHRpcHMgPSB0cnVlCisgICAgLCB0b29sdGlwID0gZnVuY3Rpb24oa2V5LCB4LCB5LCBlLCBncmFwaCkgeworICAgICAgICByZXR1cm4gJzxoMz4nICsga2V5ICsgJzwvaDM+JyArCisgICAgICAgICAgICAgICAnPHA+JyArICB5ICsgJyBhdCAnICsgeCArICc8L3A+JworICAgICAgfQorICAgICwgeAorICAgICwgeQorICAgICwgc3RhdGUgPSB7fQorICAgICwgZGVmYXVsdFN0YXRlID0gbnVsbAorICAgICwgbm9EYXRhID0gJ05vIERhdGEgQXZhaWxhYmxlLicKKyAgICAsIGRpc3BhdGNoID0gZDMuZGlzcGF0Y2goJ3Rvb2x0aXBTaG93JywgJ3Rvb2x0aXBIaWRlJywgJ3N0YXRlQ2hhbmdlJywgJ2NoYW5nZVN0YXRlJykKKyAgICAsIHRyYW5zaXRpb25EdXJhdGlvbiA9IDI1MAorICAgIDsKKworICB4QXhpcworICAgIC5vcmllbnQoJ2JvdHRvbScpCisgICAgLnRpY2tQYWRkaW5nKDcpCisgICAgOworICB5QXhpcworICAgIC5vcmllbnQoKHJpZ2h0QWxpZ25ZQXhpcykgPyAncmlnaHQnIDogJ2xlZnQnKQorICAgIDsKKworICAvLz09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorCisKKyAgLy89PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKyAgLy8gUHJpdmF0ZSBWYXJpYWJsZXMKKyAgLy8tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0KKworICB2YXIgc2hvd1Rvb2x0aXAgPSBmdW5jdGlvbihlLCBvZmZzZXRFbGVtZW50KSB7CisgICAgdmFyIGxlZnQgPSBlLnBvc1swXSArICggb2Zmc2V0RWxlbWVudC5vZmZzZXRMZWZ0IHx8IDAgKSwKKyAgICAgICAgdG9wID0gZS5wb3NbMV0gKyAoIG9mZnNldEVsZW1lbnQub2Zmc2V0VG9wIHx8IDApLAorICAgICAgICB4ID0geEF4aXMudGlja0Zvcm1hdCgpKGxpbmVzLngoKShlLnBvaW50LCBlLnBvaW50SW5kZXgpKSwKKyAgICAgICAgeSA9IHlBeGlzLnRpY2tGb3JtYXQoKShsaW5lcy55KCkoZS5wb2ludCwgZS5wb2ludEluZGV4KSksCisgICAgICAgIGNvbnRlbnQgPSB0b29sdGlwKGUuc2VyaWVzLmtleSwgeCwgeSwgZSwgY2hhcnQpOworCisgICAgbnYudG9vbHRpcC5zaG93KFtsZWZ0LCB0b3BdLCBjb250ZW50LCBudWxsLCBudWxsLCBvZmZzZXRFbGVtZW50KTsKKyAgfTsKKworICAvLz09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorCisKKyAgZnVuY3Rpb24gY2hhcnQoc2VsZWN0aW9uKSB7CisgICAgc2VsZWN0aW9uLmVhY2goZnVuY3Rpb24oZGF0YSkgeworICAgICAgdmFyIGNvbnRhaW5lciA9IGQzLnNlbGVjdCh0aGlzKSwKKyAgICAgICAgICB0aGF0ID0gdGhpczsKKworICAgICAgdmFyIGF2YWlsYWJsZVdpZHRoID0gKHdpZHRoICB8fCBwYXJzZUludChjb250YWluZXIuc3R5bGUoJ3dpZHRoJykpIHx8IDk2MCkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLSBtYXJnaW4ubGVmdCAtIG1hcmdpbi5yaWdodCwKKyAgICAgICAgICBhdmFpbGFibGVIZWlnaHQgPSAoaGVpZ2h0IHx8IHBhcnNlSW50KGNvbnRhaW5lci5zdHlsZSgnaGVpZ2h0JykpIHx8IDQwMCkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLSBtYXJnaW4udG9wIC0gbWFyZ2luLmJvdHRvbTsKKworCisgICAgICBjaGFydC51cGRhdGUgPSBmdW5jdGlvbigpIHsgY29udGFpbmVyLnRyYW5zaXRpb24oKS5kdXJhdGlvbih0cmFuc2l0aW9uRHVyYXRpb24pLmNhbGwoY2hhcnQpIH07CisgICAgICBjaGFydC5jb250YWluZXIgPSB0aGlzOworCisgICAgICAvL3NldCBzdGF0ZS5kaXNhYmxlZAorICAgICAgc3RhdGUuZGlzYWJsZWQgPSBkYXRhLm1hcChmdW5jdGlvbihkKSB7IHJldHVybiAhIWQuZGlzYWJsZWQgfSk7CisKKyAgICAKKyAgICAgIGlmICghZGVmYXVsdFN0YXRlKSB7CisgICAgICAgIHZhciBrZXk7CisgICAgICAgIGRlZmF1bHRTdGF0ZSA9IHt9OworICAgICAgICBmb3IgKGtleSBpbiBzdGF0ZSkgeworICAgICAgICAgIGlmIChzdGF0ZVtrZXldIGluc3RhbmNlb2YgQXJyYXkpCisgICAgICAgICAgICBkZWZhdWx0U3RhdGVba2V5XSA9IHN0YXRlW2tleV0uc2xpY2UoMCk7CisgICAgICAgICAgZWxzZQorICAgICAgICAgICAgZGVmYXVsdFN0YXRlW2tleV0gPSBzdGF0ZVtrZXldOworICAgICAgICB9CisgICAgICB9CisKKyAgICAgIC8vLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tCisgICAgICAvLyBEaXNwbGF5IG5vRGF0YSBtZXNzYWdlIGlmIHRoZXJlJ3Mgbm90aGluZyB0byBzaG93LgorCisgICAgICBpZiAoIWRhdGEgfHwgIWRhdGEubGVuZ3RoIHx8ICFkYXRhLmZpbHRlcihmdW5jdGlvbihkKSB7IHJldHVybiBkLnZhbHVlcy5sZW5ndGggfSkubGVuZ3RoKSB7CisgICAgICAgIHZhciBub0RhdGFUZXh0ID0gY29udGFpbmVyLnNlbGVjdEFsbCgnLm52LW5vRGF0YScpLmRhdGEoW25vRGF0YV0pOworCisgICAgICAgIG5vRGF0YVRleHQuZW50ZXIoKS5hcHBlbmQoJ3RleHQnKQorICAgICAgICAgIC5hdHRyKCdjbGFzcycsICdudmQzIG52LW5vRGF0YScpCisgICAgICAgICAgLmF0dHIoJ2R5JywgJy0uN2VtJykKKyAgICAgICAgICAuc3R5bGUoJ3RleHQtYW5jaG9yJywgJ21pZGRsZScpOworCisgICAgICAgIG5vRGF0YVRleHQKKyAgICAgICAgICAuYXR0cigneCcsIG1hcmdpbi5sZWZ0ICsgYXZhaWxhYmxlV2lkdGggLyAyKQorICAgICAgICAgIC5hdHRyKCd5JywgbWFyZ2luLnRvcCArIGF2YWlsYWJsZUhlaWdodCAvIDIpCisgICAgICAgICAgLnRleHQoZnVuY3Rpb24oZCkgeyByZXR1cm4gZCB9KTsKKworICAgICAgICByZXR1cm4gY2hhcnQ7CisgICAgICB9IGVsc2UgeworICAgICAgICBjb250YWluZXIuc2VsZWN0QWxsKCcubnYtbm9EYXRhJykucmVtb3ZlKCk7CisgICAgICB9CisKKyAgICAgIC8vLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tCisKKworICAgICAgLy8tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0KKyAgICAgIC8vIFNldHVwIFNjYWxlcworCisgICAgICB4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H0pLmZpbHRlcihmdW5jdGlvbihkLGkpIHsgcmV0dXJuICFkYXRhW2ldLmRpc2FibGVkIH0pKTsKKworCisgICAgICB2YXIgbGluZXNXcmFwID0gZy5zZWxlY3QoJy5udi1saW5lc1dyYXAnKQorICAgICAgICAgIC5kYXR1bShkYXRhLmZpbHRlcihmdW5jdGlvbihkKSB7IHJldHVybiAhZC5kaXNhYmxlZCB9KSkKKworICAgICAgbGluZXNXcmFwLnRyYW5zaXRpb24oKS5jYWxsKGxpbmVzKTsKKworICAgICAgLy8tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0KKworCisgICAgICAvLy0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLQorICAgICAgLy8gU2V0dXAgQXhlcworCisgICAgICBpZiAoc2hvd1hBeGlzKSB7CisgICAgICAgIHhBeGlzCisgICAgICAgICAgLnNjYWxlKHgpCisgICAgICAgICAgLnRpY2tzKCBhdmFpbGFibGVXaWR0aCAvIDEwMCApCisgICAgICAgICAgLnRpY2tTaXplKC1hdmFpbGFibGVIZWlnaHQsIDApOworCisgICAgICAgIGcuc2VsZWN0KCcubnYteC5udi1heGlzJykKKyAgICAgICAgICAgIC5hdHRyKCd0cmFuc2Zvcm0nLCAndHJhbnNsYXRlKDAsJyArIHkucmFuZ2UoKVswXSArICcpJyk7CisgICAgICAgIGcuc2VsZWN0KCcubnYteC5udi1heGlzJykKKyAgICAgICAgICAgIC50cmFuc2l0aW9uKCkKKyAgICAgICAgICAgIC5jYWxsKHhBeGlzKTsKKyAgICAgIH0KKworICAgICAgaWYgKHNob3dZQXhpcykgeworICAgICAgICB5QXhpcworICAgICAgICAgIC5zY2FsZSh5KQorICAgICAgICAgIC50aWNrcyggYXZhaWxhYmxlSGVpZ2h0IC8gMzYgKQorICAgICAgICAgIC50aWNrU2l6ZSggLWF2YWlsYWJsZVdpZHRoLCAwKTsKKworICAgICAgICBnLnNlbGVjdCgnLm52LXkubnYtYXhpcycpCisgICAgICAgICAgICAudHJhbnNpdGlvbigpCisgICAgICAgICAgICAuY2FsbCh5QXhpcyk7CisgICAgICB9CisgICAgICAvLy0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLQorCisKKyAgICAgIC8vPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisgICAgICAvLyBFdmVudCBIYW5kbGluZy9EaXNwYXRjaGluZyAoaW4gY2hhcnQncyBzY29wZSkKKyAgICAgIC8vLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tCisKKyAgICAgIGxlZ2VuZC5kaXNwYXRjaC5vbignc3RhdGVDaGFuZ2UnLCBmdW5jdGlvbihuZXdTdGF0ZSkgeworICAgICAgICAgIHN0YXRlID0gbmV3U3RhdGU7CisgICAgICAgICAgZGlzcGF0Y2guc3RhdGVDaGFuZ2Uoc3RhdGUpOworICAgICAgICAgIGNoYXJ0LnVwZGF0ZSgpOworICAgICAgfSk7CisKKyAgICAgIGludGVyYWN0aXZlTGF5ZXIuZGlzcGF0Y2gub24oJ2VsZW1lbnRNb3VzZW1vdmUnLCBmdW5jdGlvbihlKSB7CisgICAgICAgICAgbGluZXMuY2xlYXJIaWdobGlnaHRzKCk7CisgICAgICAgICAgdmFyIHNpbmdsZVBvaW50LCBwb2ludEluZGV4LCBwb2ludFhMb2NhdGlvbiwgYWxsRGF0YSA9IFtdOworICAgICAgICAgIGRhdGEKKyAgICAgICAgICAuZmlsdGVyKGZ1bmN0aW9uKHNlcmllcywgaSkgeyAKKyAgICAgICAgICAgIHNlcmllcy5zZXJpZXNJbmRleCA9IGk7CisgICAgICAgICAgICByZXR1cm4gIXNlcmllcy5kaXNhYmxlZDsgCisgICAgICAgICAgfSkKKyAgICAgICAgICAuZm9yRWFjaChmdW5jdGlvbihzZXJpZXMsaSkgeworICAgICAgICAgICAgICBwb2ludEluZGV4ID0gbnYuaW50ZXJhY3RpdmVCaXNlY3Qoc2VyaWVzLnZhbHVlcywgZS5wb2ludFhWYWx1ZSwgY2hhcnQueCgpKTsKKyAgICAgICAgICAgICAgbGluZXMuaGlnaGxpZ2h0UG9pbnQoaSwgcG9pbnRJbmRleCwgdHJ1ZSk7CisgICAgICAgICAgICAgIHZhciBwb2ludCA9IHNlcmllcy52YWx1ZXNbcG9pbnRJbmRleF07CisgICAgICAgICAgICAgIGlmICh0eXBlb2YgcG9pbnQgPT09ICd1bmRlZmluZWQnKSByZXR1cm47CisgICAgICAgICAgICAgIGlmICh0eXBlb2Ygc2luZ2xlUG9pbnQgPT09ICd1bmRlZmluZWQnKSBzaW5nbGVQb2ludCA9IHBvaW50OworICAgICAgICAgICAgICBpZiAodHlwZW9mIHBvaW50WExvY2F0aW9uID09PSAndW5kZWZpbmVkJykgcG9pbnRYTG9jYXRpb24gPSBjaGFydC54U2NhbGUoKShjaGFydC54KCkocG9pbnQscG9pbnRJbmRleCkpOworICAgICAgICAgICAgICBhbGxEYXRhLnB1c2goeworICAgICAgICAgICAgICAgICAga2V5OiBzZXJpZXMua2V5LAorICAgICAgICAgICAgICAgICAgdmFsdWU6IGNoYXJ0LnkoKShwb2ludCwgcG9pbnRJbmRleCksCisgICAgICAgICAgICAgICAgICBjb2xvcjogY29sb3Ioc2VyaWVzLHNlcmllcy5zZXJpZXNJbmRleCkKKyAgICAgICAgICAgICAgfSk7CisgICAgICAgICAgfSk7CisgICAgICAgICAgLy9IaWdobGlnaHQgdGhlIHRvb2x0aXAgZW50cnkgYmFzZWQgb24gd2hpY2ggcG9pbnQgdGhlIG1vdXNlIGlzIGNsb3Nlc3QgdG8uCisgICAgICAgICAgaWYgKGFsbERhdGEubGVuZ3RoID4gMikgeworICAgICAgICAgICAgdmFyIHlWYWx1ZSA9IGNoYXJ0LnlTY2FsZSgpLmludmVydChlLm1vdXNlWSk7CisgICAgICAgICAgICB2YXIgZG9tYWluRXh0ZW50ID0gTWF0aC5hYnMoY2hhcnQueVNjYWxlKCkuZG9tYWluKClbMF0gLSBjaGFydC55U2NhbGUoKS5kb21haW4oKVsxXSk7CisgICAgICAgICAgICB2YXIgdGhyZXNob2xkID0gMC4wMyAqIGRvbWFpbkV4dGVudDsKKyAgICAgICAgICAgIHZhciBpbmRleFRvSGlnaGxpZ2h0ID0gbnYubmVhcmVzdFZhbHVlSW5kZXgoYWxsRGF0YS5tYXAoZnVuY3Rpb24oZCl7cmV0dXJuIGQudmFsdWV9KSx5VmFsdWUsdGhyZXNob2xkKTsKKyAgICAgICAgICAgIGlmIChpbmRleFRvSGlnaGxpZ2h0ICE9PSBudWxsKQorICAgICAgICAgICAgICBhbGxEYXRhW2luZGV4VG9IaWdobGlnaHRdLmhpZ2hsaWdodCA9IHRydWU7CisgICAgICAgICAgfQorCisgICAgICAgICAgdmFyIHhWYWx1ZSA9IHhBeGlzLnRpY2tGb3JtYXQoKShjaGFydC54KCkoc2luZ2xlUG9pbnQscG9pbnRJbmRleCkpOworICAgICAgICAgIGludGVyYWN0aXZlTGF5ZXIudG9vbHRpcAorICAgICAgICAgICAgICAgICAgLnBvc2l0aW9uKHtsZWZ0OiBwb2ludFhMb2NhdGlvbiArIG1hcmdpbi5sZWZ0LCB0b3A6IGUubW91c2VZICsgbWFyZ2luLnRvcH0pCisgICAgICAgICAgICAgICAgICAuY2hhcnRDb250YWluZXIodGhhdC5wYXJlbnROb2RlKQorICAgICAgICAgICAgICAgICAgLmVuYWJsZWQodG9vbHRpcHMpCisgICAgICAgICAgICAgICAgICAudmFsdWVGb3JtYXR0ZXIoZnVuY3Rpb24oZCxpKSB7CisgICAgICAgICAgICAgICAgICAgICByZXR1cm4geUF4aXMudGlja0Zvcm1hdCgpKGQpOworICAgICAgICAgICAgICAgICAgfSkKKyAgICAgICAgICAgICAgICAgIC5kYXRhKAorICAgICAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIHZhbHVlOiB4VmFsdWUsCisgICAgICAgICAgICAgICAgICAgICAgICBzZXJpZXM6IGFsbERhdGEKKyAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICApKCk7CisKKyAgICAgICAgICBpbnRlcmFjdGl2ZUxheWVyLnJlbmRlckd1aWRlTGluZShwb2ludFhMb2NhdGlvbik7CisKKyAgICAgIH0pOworCisgICAgICBpbnRlcmFjdGl2ZUxheWVyLmRpc3BhdGNoLm9uKCJlbGVtZW50TW91c2VvdXQiLGZ1bmN0aW9uKGUpIHsKKyAgICAgICAgICBkaXNwYXRjaC50b29sdGlwSGlkZSgpOworICAgICAgICAgIGxpbmVzLmNsZWFySGlnaGxpZ2h0cygpOworICAgICAgfSk7CisKKyAgICAgIGRpc3BhdGNoLm9uKCd0b29sdGlwU2hvdycsIGZ1bmN0aW9uKGUpIHsKKyAgICAgICAgaWYgKHRvb2x0aXBzKSBzaG93VG9vbHRpcChlLCB0aGF0LnBhcmVudE5vZGUpOworICAgICAgfSk7CisKKworICAgICAgZGlzcGF0Y2gub24oJ2NoYW5nZVN0YXRlJywgZnVuY3Rpb24oZSkgeworCisgICAgICAgIGlmICh0eXBlb2YgZS5kaXNhYmxlZCAhPT0gJ3VuZGVmaW5lZCcpIHsKKyAgICAgICAgICBkYXRhLmZvckVhY2goZnVuY3Rpb24oc2VyaWVzLGkpIHsKKyAgICAgICAgICAgIHNlcmllcy5kaXNhYmxlZCA9IGUuZGlzYWJsZWRbaV07CisgICAgICAgICAgfSk7CisKKyAgICAgICAgICBzdGF0ZS5kaXNhYmxlZCA9IGUuZGlzYWJsZWQ7CisgICAgICAgIH0KKworICAgICAgICBjaGFydC51cGRhdGUoKTsKKyAgICAgIH0pOworCisgICAgICAvLz09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorCisgICAgfSk7CisKKyAgICByZXR1cm4gY2hhcnQ7CisgIH0KKworCisgIC8vPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisgIC8vIEV2ZW50IEhhbmRsaW5nL0Rpc3BhdGNoaW5nIChvdXQgb2YgY2hhcnQncyBzY29wZSkKKyAgLy8tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0KKworICBsaW5lcy5kaXNwYXRjaC5vbignZWxlbWVudE1vdXNlb3Zlci50b29sdGlwJywgZnVuY3Rpb24oZSkgeworICAgIGUucG9zID0gW2UucG9zWzBdICsgIG1hcmdpbi5sZWZ0LCBlLnBvc1sxXSArIG1hcmdpbi50b3BdOworICAgIGRpc3BhdGNoLnRvb2x0aXBTaG93KGUpOworICB9KTsKKworICBsaW5lcy5kaXNwYXRjaC5vbignZWxlbWVudE1vdXNlb3V0LnRvb2x0aXAnLCBmdW5jdGlvbihlKSB7CisgICAgZGlzcGF0Y2gudG9vbHRpcEhpZGUoZSk7CisgIH0pOworCisgIGRpc3BhdGNoLm9uKCd0b29sdGlwSGlkZScsIGZ1bmN0aW9uKCkgeworICAgIGlmICh0b29sdGlwcykgbnYudG9vbHRpcC5jbGVhbnVwKCk7CisgIH0pOworCisgIC8vPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisKKworICAvLz09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorICAvLyBFeHBvc2UgUHVibGljIFZhcmlhYmxlcworICAvLy0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLQorCisgIC8vIGV4cG9zZSBj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BjaGFydDsKKyAgfTsKKworICBjaGFydC5yaWdodEFsaWduWUF4aXMgPSBmdW5jdGlvbihfKSB7CisgICAgaWYoIWFyZ3VtZW50cy5sZW5ndGgpIHJldHVybiByaWdodEFsaWduWUF4aXM7CisgICAgcmlnaHRBbGlnbllBeGlzID0gXzsKKyAgICB5QXhpcy5vcmllbnQoIChfKSA/ICdyaWdodCcgOiAnbGVmdCcpOworICAgIHJldHVybiBjaGFydDsKKyAgfTsKKworICBjaGFydC51c2VJbnRlcmFjdGl2ZUd1aWRlbGluZSA9IGZ1bmN0aW9uKF8pIHsKKyAgICBpZighYXJndW1lbnRzLmxlbmd0aCkgcmV0dXJuIHVzZUludGVyYWN0aXZlR3VpZGVsaW5lOworICAgIHVzZUludGVyYWN0aXZlR3VpZGVsaW5lID0gXzsKKyAgICBpZiAoXyA9PT0gdHJ1ZSkgeworICAgICAgIGNoYXJ0LmludGVyYWN0aXZlKGZhbHNlKTsKKyAgICAgICBjaGFydC51c2VWb3Jvbm9pKGZhbHNlKTsKKyAgICB9CisgICAgcmV0dXJuIGNoYXJ0OworICB9OworCisgIGNoYXJ0LnRvb2x0aXBzID0gZnVuY3Rpb24oXykgeworICAgIGlmICghYXJndW1lbnRzLmxlbmd0aCkgcmV0dXJuIHRvb2x0aXBzOworICAgIHRvb2x0aXBzID0gXzsKKyAgICByZXR1cm4gY2hhcnQ7CisgIH07CisKKyAgY2hhcnQudG9vbHRpcENvbnRlbnQgPSBmdW5jdGlvbihfKSB7CisgICAgaWYgKCFhcmd1bWVudHMubGVuZ3RoKSByZXR1cm4gdG9vbHRpcDsKKyAgICB0b29sdGlwID0gXzsKKyAgICByZXR1cm4gY2hhcnQ7CisgIH07CisKKyAgY2hhcnQuc3RhdGUgPSBmdW5jdGlvbihfKSB7CisgICAgaWYgKCFhcmd1bWVudHMubGVuZ3RoKSByZXR1cm4gc3RhdGU7CisgICAgc3RhdGUgPSBfOworICAgIHJldHVybiBjaGFydDsKKyAgfTsKKworICBjaGF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GlvbigpIHsKKyAgInVzZSBzdHJpY3QiOworICAvLz09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorICAvLyBQdWJsaWMgVmFyaWFibGVzIHdpdGggRGVmYXVsdCBTZXR0aW5ncworICAvLy0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLQorCisgIHZhciBsaW5lcyA9IG52Lm1vZGVscy5saW5lKCkKKyAgICAsIGJhcnMgPSBudi5tb2RlbHMuaGlzdG9yaWNhbEJhcigpCisgICAgLCB4QXhpcyA9IG52Lm1vZGVscy5heGlzKCkKKyAgICAsIHkxQXhpcyA9IG52Lm1vZGVscy5heGlzKCkKKyAgICAsIHkyQXhpcyA9IG52Lm1vZGVscy5heGlzKCkKKyAgICAsIGxlZ2VuZCA9IG52Lm1vZGVscy5sZWdlbmQoKQorICAgIDsKKworICB2YXIgbWFyZ2luID0ge3RvcDogMzAsIHJpZ2h0OiA2MCwgYm90dG9tOiA1MCwgbGVmdDogNjB9CisgICAgLCB3aWR0aCA9IG51bGwKKyAgICAsIGhlaWdodCA9IG51bGwKKyAgICAsIGdldFggPSBmdW5jdGlvbihkKSB7IHJldHVybiBkLnggfQorICAgICwgZ2V0WSA9IGZ1bmN0aW9uKGQpIHsgcmV0dXJuIGQueSB9CisgICAgLCBjb2xvciA9IG52LnV0aWxzLmRlZmF1bHRDb2xvcigpCisgICAgLCBzaG93TGVnZW5kID0gdHJ1ZQorICAgICwgdG9vbHRpcHMgPSB0cnVlCisgICAgLCB0b29sdGlwID0gZnVuY3Rpb24oa2V5LCB4LCB5LCBlLCBncmFwaCkgeworICAgICAgICByZXR1cm4gJzxoMz4nICsga2V5ICsgJzwvaDM+JyArCisgICAgICAgICAgICAgICAnPHA+JyArICB5ICsgJyBhdCAnICsgeCArICc8L3A+JzsKKyAgICAgIH0KKyAgICAsIHgKKyAgICAsIHkxCisgICAgLCB5MgorICAgICwgc3RhdGUgPSB7fQorICAgICwgZGVmYXVsdFN0YXRlID0gbnVsbAorICAgICwgbm9EYXRhID0gIk5vIERhdGEgQXZhaWxhYmxlLiIKKyAgICAsIGRpc3BhdGNoID0gZDMuZGlzcGF0Y2goJ3Rvb2x0aXBTaG93JywgJ3Rvb2x0aXBIaWRlJywgJ3N0YXRlQ2hhbmdlJywgJ2NoYW5nZVN0YXRlJykKKyAgICA7CisKKyAgYmFycworICAgIC5wYWREYXRhKHRydWUpCisgICAgOworICBsaW5lcworICAgIC5jbGlwRWRnZShmYWxzZSkKKyAgICAucGFkRGF0YSh0cnVlKQorICAgIDsKKyAgeEF4aXMKKyAgICAub3JpZW50KCdib3R0b20nKQorICAgIC50aWNrUGFkZGluZyg3KQorICAgIC5oaWdobGlnaHRaZXJvKGZhbHNlKQorICAgIDsKKyAgeTFBeGlzCisgICAgLm9yaWVudCgnbGVmdCcpCisgICAgOworICB5MkF4aXMKKyAgICAub3JpZW50KCdyaWdodCcpCisgICAgOworCisgIC8vPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisKKworICAvLz09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorICAvLyBQcml2YXRlIFZhcmlhYmxlcworICAvLy0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLQorCisgIHZhciBzaG93VG9vbHRpcCA9IGZ1bmN0aW9uKGUsIG9mZnNldEVsZW1lbnQpIHsKKyAgICAgIHZhciBsZWZ0ID0gZS5wb3NbMF0gKyAoIG9mZnNldEVsZW1lbnQub2Zmc2V0TGVmdCB8fCAwICksCisgICAgICAgICAgdG9wID0gZS5wb3NbMV0gKyAoIG9mZnNldEVsZW1lbnQub2Zmc2V0VG9wIHx8IDApLAorICAgICAgICAgIHggP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SBzaG93VG9vbHRpcChlLCB0aGF0LnBhcmVudE5vZGUpOworICAgICAgfSk7CisKKworICAgICAgLy8gVXBkYXRlIGNoYXJ0IGZyb20gYSBzdGF0ZSBvYmplY3QgcGFzc2VkIHRvIGV2ZW50IGhhbmRsZXIKKyAgICAgIGRpc3BhdGNoLm9uKCdjaGFuZ2VTdGF0ZScsIGZ1bmN0aW9uKGUpIHsKKworICAgICAgICBpZiAodHlwZW9mIGUuZGlzYWJsZWQgIT09ICd1bmRlZmluZWQnKSB7CisgICAgICAgICAgZGF0YS5mb3JFYWNoKGZ1bmN0aW9uKHNlcmllcyxpKSB7CisgICAgICAgICAgICBzZXJpZXMuZGlzYWJsZWQgPSBlLmRpc2FibGVkW2ldOworICAgICAgICAgIH0pOworCisgICAgICAgICAgc3RhdGUuZGlzYWJsZWQgPSBlLmRpc2FibGVkOworICAgICAgICB9CisKKyAgICAgICAgY2hhcnQudXBkYXRlKCk7CisgICAgICB9KTsKKworICAgICAgLy89PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKworCisgICAgfSk7CisKKyAgICByZXR1cm4gY2hhcnQ7CisgIH0KKworCisgIC8vPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisgIC8vIEV2ZW50IEhhbmRsaW5nL0Rpc3BhdGNoaW5nIChvdXQgb2YgY2hhcnQncyBzY29wZSkKKyAgLy8tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0KKworICBsaW5lcy5kaXNwYXRjaC5vbignZWxlbWVudE1vdXNlb3Zlci50b29sdGlwJywgZnVuY3Rpb24oZSkgeworICAgIGUucG9zID0gW2UucG9zWzBdICsgIG1hcmdpbi5sZWZ0LCBlLnBvc1sxXSArIG1hcmdpbi50b3BdOworICAgIGRpc3BhdGNoLnRvb2x0aXBTaG93KGUpOworICB9KTsKKworICBsaW5lcy5kaXNwYXRjaC5vbignZWxlbWVudE1vdXNlb3V0LnRvb2x0aXAnLCBmdW5jdGlvbihlKSB7CisgICAgZGlzcGF0Y2gudG9vbHRpcEhpZGUoZSk7CisgIH0pOworCisgIGJhcnMuZGlzcGF0Y2gub24oJ2VsZW1lbnRNb3VzZW92ZXIudG9vbHRpcCcsIGZ1bmN0aW9uKGUpIHsKKyAgICBlLnBvcyA9IFtlLnBvc1swXSArICBtYXJnaW4ubGVmdCwgZS5wb3NbMV0gKyBtYXJnaW4udG9wXTsKKyAgICBkaXNwYXRjaC50b29sdGlwU2hvdyhlKTsKKyAgfSk7CisKKyAgYmFycy5kaXNwYXRjaC5vbignZWxlbWVudE1vdXNlb3V0LnRvb2x0aXAnLCBmdW5jdGlvbihlKSB7CisgICAgZGlzcGF0Y2gudG9vbHRpcEhpZGUoZSk7CisgIH0pOworCisgIGRpc3BhdGNoLm9uKCd0b29sdGlwSGlkZScsIGZ1bmN0aW9uKCkgeworICAgIGlmICh0b29sdGlwcykgbnYudG9vbHRpcC5jbGVhbnVwKCk7CisgIH0pOworCisgIC8vPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisKKworICAvLz09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorICAvLyBFeHBvc2UgUHVibGljIFZhcmlhYmxlcworICAvLy0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLQorCisgIC8vIGV4cG9zZSBjaGFydCdzIHN1Yi1jb21wb25lbnRzCisgIGNoYXJ0LmRpc3BhdGNoID0gZGlzcGF0Y2g7CisgIGNoYXJ0LmxlZ2VuZCA9IGxlZ2VuZDsKKyAgY2hhcnQubGluZXMgPSBsaW5lczsKKyAgY2hhcnQuYmFycyA9IGJhcnM7C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ZWdlbmQgPSBfOworICAgIHJldHVybiBjaGFydDsKKyAgfTsKKworICBjaGFydC50b29sdGlwcyA9IGZ1bmN0aW9uKF8pIHsKKyAgICBpZiAoIWFyZ3VtZW50cy5sZW5ndGgpIHJldHVybiB0b29sdGlwczsKKyAgICB0b29sdGlwcyA9IF87CisgICAgcmV0dXJuIGNoYXJ0OworICB9OworCisgIGNoYXJ0LnRvb2x0aXBDb250ZW50ID0gZnVuY3Rpb24oXykgeworICAgIGlmICghYXJndW1lbnRzLmxlbmd0aCkgcmV0dXJuIHRvb2x0aXA7CisgICAgdG9vbHRpcCA9IF87CisgICAgcmV0dXJuIGNoYXJ0OworICB9OworCisgIGNoYXJ0LnN0YXRlID0gZnVuY3Rpb24oXykgeworICAgIGlmICghYXJndW1lbnRzLmxlbmd0aCkgcmV0dXJuIHN0YXRlOworICAgIHN0YXRlID0gXzsKKyAgICByZXR1cm4gY2hhcnQ7CisgIH07CisKKyAgY2hhcnQuZGVmYXVsdFN0YXRlID0gZnVuY3Rpb24oXykgeworICAgIGlmICghYXJndW1lbnRzLmxlbmd0aCkgcmV0dXJuIGRlZmF1bHRTdGF0ZTsKKyAgICBkZWZhdWx0U3RhdGUgPSBfOworICAgIHJldHVybiBjaGFydDsKKyAgfTsKKworICBjaGFydC5ub0RhdGEgPSBmdW5jdGlvbihfKSB7CisgICAgaWYgKCFhcmd1bWVudHMubGVuZ3RoKSByZXR1cm4gbm9EYXRhOworICAgIG5vRGF0YSA9IF87CisgICAgcmV0dXJuIGNoYXJ0OworICB9OworCisgIC8vPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisKKworICByZXR1cm4gY2hhcnQ7Cit9CmRpZmYgLS1naXQgYS9lY29tcC1wb3J0YWwtQkUvd2FyL3N0YXRpYy9mdXNpb24vZDMvanMvbW9kZWxzL2xpbmVQbHVzQmFyV2l0aEZvY3VzQ2hhcnQuanMgYi9lY29tcC1wb3J0YWwtQk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HMubGVnZW5kKCkKKyAgICAsIGJydXNoID0gZDMuc3ZnLmJydXNoKCkKKyAgICA7CisKKyAgdmFyIG1hcmdpbiA9IHt0b3A6IDMwLCByaWdodDogMzAsIGJvdHRvbTogMzAsIGxlZnQ6IDYwfQorICAgICwgbWFyZ2luMiA9IHt0b3A6IDAsIHJpZ2h0OiAzMCwgYm90dG9tOiAyMCwgbGVmdDogNjB9CisgICAgLCB3aWR0aCA9IG51bGwKKyAgICAsIGhlaWdodCA9IG51bGwKKyAgICAsIGhlaWdodDIgPSAxMDAKKyAgICAsIGdldFggPSBmdW5jdGlvbihkKSB7IHJldHVybiBkLnggfQorICAgICwgZ2V0WSA9IGZ1bmN0aW9uKGQpIHsgcmV0dXJuIGQueSB9CisgICAgLCBjb2xvciA9IG52LnV0aWxzLmRlZmF1bHRDb2xvcigpCisgICAgLCBzaG93TGVnZW5kID0gdHJ1ZQorICAgICwgZXh0ZW50CisgICAgLCBicnVzaEV4dGVudCA9IG51bGwKKyAgICAsIHRvb2x0aXBzID0gdHJ1ZQorICAgICwgdG9vbHRpcCA9IGZ1bmN0aW9uKGtleSwgeCwgeSwgZSwgZ3JhcGgpIHsKKyAgICAgICAgcmV0dXJuICc8aDM+JyArIGtleSArICc8L2gzPicgKworICAgICAgICAgICAgICAgJzxwPicgKyAgeSArICcgYXQgJyArIHggKyAnPC9wPic7CisgICAgICB9CisgICAgLCB4CisgICAgLCB4MgorICAgICwgeTEKKyAgICAsIHkyCisgICAgLCB5MworICAgICwgeTQKKyAgICAsIG5vRGF0YSA9ICJObyBEYXRhIEF2YWlsYWJsZS4iCisgICAgLCBkaXNwYXRjaCA9IGQzLmRpc3BhdGNoKCd0b29sdGlwU2hvdycsICd0b29sdGlwSGlkZScsICdicnVzaCcpCisgICAgLCB0cmFuc2l0aW9uRHVyYXRpb24gPSAwCisgICAgOworCisgIGxpbmVzCisgICAgLmNsaXBFZGdlKHRydWUpCisgICAgOworICBsaW5lczIKKyAgICAuaW50ZXJhY3RpdmUoZmFsc2UpCisgICAgOworICB4QXhpcworICAgIC5vcmllbnQoJ2JvdHRvbScpCisgICAgLnRpY2tQYWRkaW5nKDUpCisgICAgOworICB5MUF4aXMKKyAgICAub3JpZW50KCdsZWZ0JykKKyAgICA7CisgIHkyQXhpcworICAgIC5vcmllbnQoJ3JpZ2h0JykKKyAgICA7CisgIHgyQXhpcworICAgIC5vcmllbnQoJ2JvdHRvbScpCisgICAgLnRpY2tQYWRkaW5nKDUpCisgICAgOworICB5M0F4aXMKKyAgICAub3JpZW50KCdsZWZ0JykKKyAgICA7CisgIHk0QXhpcworICAgIC5vcmllbnQoJ3JpZ2h0JykKKyAgICA7CisKKyAgLy89PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKworCisgIC8vPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisgIC8vIFByaXZhdGUgVmFyaWFibGVzCisgIC8vLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tCisKKyAgdmFyIHNob3dUb29sdGlwID0gZnVuY3Rpb24oZSwgb2Zmc2V0RWxlbWVudCkgeworICAgIGlmIChleHRlbnQpIHsKKyAgICAgICAgZS5wb2ludEluZGV4ICs9IE1hdGguY2VpbChleHRlbnRbMF0pOworICAgIH0KKyAgICB2YXIgbGVmdCA9IGUucG9zWzBdICsgKCBvZmZzZXRFbGVtZW50Lm9mZnNldExlZnQgfHwgMCApLAorICAgICAgICB0b3AgPSBlLnBvc1sxXSArICggb2Zmc2V0RWxlbWVudC5vZmZzZXRUb3AgfHwgMCksCisgICAgICAgIHggPSB4QXhpcy50aWNrRm9ybWF0KCkobGluZXMueCgpKGUucG9pbnQsIGUucG9pbnRJbmRleCkpLAorICAgICAgICB5ID0gKGUuc2VyaWVzLmJhciA/IHkxQXhpcyA6IHkyQX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IDQwMCkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLSBtYXJnaW4udG9wIC0gbWFyZ2luLmJvdHRvbSAtIGhlaWdodDI7CisgICAgICAgIH0KKworICAgICAgICBnLnNlbGVjdCgnLm52LWxlZ2VuZFdyYXAnKQorICAgICAgICAgICAgLmF0dHIoJ3RyYW5zZm9ybScsICd0cmFuc2xhdGUoJyArICggYXZhaWxhYmxlV2lkdGggLyAyICkgKyAnLCcgKyAoLW1hcmdpbi50b3ApICsnKScpOworICAgICAgfQorCisgICAgICAvLy0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLQorCisKKyAgICAgIHdyYXAuYXR0cigndHJhbnNmb3JtJywgJ3RyYW5zbGF0ZSgnICsgbWFyZ2luLmxlZnQgKyAnLCcgKyBtYXJnaW4udG9wICsgJyknKTsKKworCisgICAgICAvLy0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLQorICAgICAgLy8gQ29udGV4dCBDb21wb25lbnRzCisKKyAgICAgIGJhcnMyCisgICAgICAgIC53aWR0aChhdmFpbGFibGVXaWR0aCkKKyAgICAgICAgLmhlaWdodChhdmFpbGFibGVIZWlnaHQyKQorICAgICAgICAuY29sb3IoZGF0YS5tYXAoZnVuY3Rpb24oZCxpKSB7CisgICAgICAgICAgcmV0dXJuIGQuY29sb3IgfHwgY29sb3IoZCwgaSk7CisgICAgICAgIH0pLmZpbHRlcihmdW5jdGlvbihkLGkpIHsgcmV0dXJuICFkYXRhW2ldLmRpc2FibGVkICYmIGRhdGFbaV0uYmFyIH0pKTsKKworICAgICAgbGluZXMyCisgICAgICAgIC53aWR0aChhdmFpbGFibGVXaWR0aCkKKyAgICAgICAgLmhlaWdodChhdmFpbGFibGVIZWlnaHQyKQorICAgICAgICAuY29sb3IoZGF0YS5tYXAoZnVuY3Rpb24oZCxpKSB7CisgICAgICAgICAgcmV0dXJuIGQuY29sb3IgfHwgY29sb3IoZCwgaSk7CisgICAgICAgIH0pLmZpbHRlcihmdW5jdGlvbihkLGkpIHsgcmV0dXJuICFkYXRhW2ldLmRpc2FibGVkICYmICFkYXRhW2ldLmJhciB9KSk7CisgICAgICAgIAorICAgICAgdmFyIGJhcnMyV3JhcCA9IGcuc2VsZWN0KCcubnYtY29udGV4dCAubnYtYmFyc1dyYXAnKQorICAgICAgICAgIC5kYXR1bShkYXRhQmFycy5sZW5ndGggPyBkYXRhQmFycyA6IFt7dmFsdWVzOltdfV0pOworCisgICAgICB2YXIgbGluZXMyV3JhcCA9IGcuc2VsZWN0KCcubnYtY29udGV4dCAubnYtbGluZXNXcmFwJykKKyAgICAgICAgICAuZGF0dW0oIWRhdGFMaW5lc1swXS5kaXNhYmxlZCA/IGRhdGFMaW5lcyA6IFt7dmFsdWVzOltdfV0pOworICAgICAgICAgIAorICAgICAgZy5zZWxlY3QoJy5udi1jb250ZXh0JykKKyAgICAgICAgICAuYXR0cigndHJhbnNmb3JtJywgJ3RyYW5zbGF0ZSgwLCcgKyAoIGF2YWlsYWJsZUhlaWdodDEgKyBtYXJnaW4uYm90dG9tICsgbWFyZ2luMi50b3ApICsgJyknKQorCisgICAgICBiYXJzMldyYXAudHJhbnNpdGlvbigpLmNhbGwoYmFyczIpOworICAgICAgbGluZXMyV3JhcC50cmFuc2l0aW9uKCkuY2FsbChsaW5lczIpOworCisgICAgICAvLy0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLQorCisKKworICAgICAgLy8tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0KKyAgICAgIC8vIFNldHVwIEJydXNoCisKKyAgICAgIGJydXNoCisgICAgICAgIC54KHgyKQorICAgICAgICAub24oJ2JydXNoJywgb25CcnVzaCk7CisKKyAgICAgIGlmIChicnVzaEV4dGVudCkgYnJ1c2guZXh0ZW50KGJydXNoRXh0ZW50KTsKKworICAgICAgdmFyIGJydXNoQkcgPSBnLnNlbGVjdCgnLm52LWJydXNoQmFja2dyb3VuZCcpLnNlbGVjdEFsbCgnZycpCisgICAgICAgICAgLmRhdGEoW2JydXNoRXh0ZW50IHx8IGJydXNoLmV4dGVudCgpXSkKKworICAgICAgdmFyIGJydXNoQkdlbnRlciA9IGJydXNoQkcuZW50ZXIoKQorICAgICAgICAgIC5hcHBlbmQoJ2cnKTsKKworICAgICAgYnJ1c2hCR2VudGVyLmFwcGVuZCgncmVjdCcpCisgICAgICAgICAgLmF0dHIoJ2NsYXNzJywgJ2xlZnQnKQorICAgICAgICAgIC5hdHRyKCd4JywgMCkKKyAgICAgICAgICAuYXR0cigneScsIDApCisgICAgICAgICAgLmF0dHIoJ2hlaWdodCcsIGF2YWlsYWJsZUhlaWdodDIpOworCisgICAgICBicnVzaEJHZW50ZXIuYXBwZW5kKCdyZWN0JykKKyAgICAgICAgICAuYXR0cignY2xhc3MnLCAncmlnaHQnKQorICAgICAgICAgIC5hdHRyKCd4JywgMCkKKyAgICAgICAgICAuYXR0cigneScsIDApCisgICAgICAgICAgLmF0dHIoJ2hlaWdodCcsIGF2YWlsYWJsZUhlaWdodDIpOworCisgICAgICB2YXIgZ0JydXNoID0gZy5zZWxlY3QoJy5udi14Lm52LWJydXNoJykKKyAgICAgICAgICAuY2FsbChicnVzaCk7CisgICAgICBnQnJ1c2guc2VsZWN0QWxsKCdyZWN0JykKKyAgICAgICAgICAvLy5hdHRyKCd5JywgLTUpCisgICAgICAgICAgLmF0dHIoJ2hlaWdodCcsIGF2YWlsYWJsZUhlaWdodDIpOworICAgICAgZ0JydXNoLnNlbGVjdEFsbCgnLnJlc2l6ZScpLmFwcGVuZCgncGF0aCcpLmF0dHIoJ2QnLCByZXNpemVQYXRoKTsKKworICAgICAgLy8tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0KKworICAgICAgLy8tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0KKyAgICAgIC8vIFNldHVwIFNlY29uZGFyeSAoQ29udGV4dCkgQXhlcworCisgICAgICB4MkF4aXMKKyAgICAgICAgLnRpY2tzKCBhdmFpbGFibGVXaWR0aCAvIDEwMCApCisgICAgICAgIC50aWNrU2l6ZSgtYXZhaWxhYmxlSGVpZ2h0MiwgMCk7CisKKyAgICAgIGcuc2VsZWN0KCcubnYtY29udGV4dCAubnYteC5udi1heGlzJykKKyAgICAgICAgICAuYXR0cigndHJhbnNmb3JtJywgJ3RyYW5zbGF0ZSgwLCcgKyB5My5yYW5nZSgpWzBdICsgJyknKTsKKyAgICAgIGcuc2VsZWN0KCcubnYtY29udGV4dCAubnYteC5udi1heGlzJykudHJhbnNpdGlvbigpCisgICAgICAgICAgLmNhbGwoeDJBeGlzKTsKKworCisgICAgICB5M0F4aXMKKyAgICAgICAgLnNjYWxlKHkzKQorICAgICAgICAudGlja3MoIGF2YWlsYWJsZUhlaWdodDIgLyAzNiApCisgICAgICAgIC50aWNrU2l6ZSggLWF2YWlsYWJsZVdpZHRoLCAwKTsKKworICAgICAgZy5zZWxlY3QoJy5udi1jb250ZXh0IC5udi15MS5udi1heGlzJykKKyAgICAgICAgICAuc3R5bGUoJ29wYWNpdHknLCBkYXRhQmFycy5sZW5ndGggPyAxIDogMCkKKyAgICAgICAgICAuYXR0cigndHJhbnNmb3JtJywgJ3RyYW5zbGF0ZSgwLCcgKyB4Mi5yYW5nZSgpWzBdICsgJyknKTsKKyAgICAgICAgICAKKyAgICAgIGcuc2VsZWN0KCcubnYtY29udGV4dCAubnYteTEubnYtYXhpcycpLnRyYW5zaXRpb24oKQorICAgICAgICAgIC5jYWxsKHkzQXhpcyk7CisgICAgICAgICAgCisKKyAgICAgIHk0QXhpcworICAgICAgICAuc2NhbGUoeTQpCisgICAgICAgIC50aWNrcyggYXZhaWxhYmxlSGVpZ2h0MiAvIDM2ICkKKyAgICAgICAgLnRpY2tTaXplKGRhdGFCYXJzLmxlbmd0aCA/IDAgOiAtYXZhaWxhYmxlV2lkdGgsIDApOyAvLyBTaG93IHRoZSB5MiBydWxlcyBvbmx5IGlmIHkxIGhhcyBub25lCisKKyAgICAgIGcuc2VsZWN0KCcubnYtY29udGV4dCAubnYteTIubnYtYXhpcycpCisgICAgICAgICAgLnN0eWxlKCdvcGFjaXR5JywgZGF0YUxpbmVzLmxlbmd0aCA/IDEgOiAwKQorICAgICAgICAgIC5hdHRyKCd0cmFuc2Zvcm0nLCAndHJhbnNsYXRlKCcgKyB4Mi5yYW5nZSgpWzFdICsgJywwKScpOworCisgICAgICBnLnNlbGVjdCgnLm52LWNvbnRleHQgLm52LXkyLm52LWF4aXMnKS50cmFuc2l0aW9uKCkKKyAgICAgICAgICAuY2FsbCh5NEF4aXMpOworICAgICAgICAgIAorICAgICAgLy8tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0KKworICAgICAgLy89PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKyAgICAgIC8vIEV2ZW50IEhhbmRsaW5nL0Rpc3BhdGNoaW5nIChpbiBjaGFydCdzIHNjb3BlKQorICAgICAgLy8tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0KKworICAgICAgbGVnZW5kLmRpc3BhdGNoLm9uKCdzdGF0ZUNoYW5nZScsIGZ1bmN0aW9uKG5ld1N0YXRlKSB7IAorICAgICAgICBjaGFydC51cGRhdGUoKTsKKyAgICAgIH0pOworCisgICAgICBkaXNwYXRjaC5vbigndG9vbHRpcFNob3cnLCBmdW5jdGlvbihlKSB7CisgICAgICAgIGlmICh0b29sdGlwcykgc2hvd1Rvb2x0aXAoZSwgdGhhdC5wYXJlbnROb2RlKTsKKyAgICAgIH0pOworCisgICAgICAvLz09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorCisKKyAgICAgIC8vPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisgICAgICAvLyBGdW5jdGlvbnMKKyAgICAgIC8vLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tCisKKyAgICAgIC8vIFRha2VuIGZyb20gY3Jvc3NmaWx0ZXIgKGh0dHA6Ly9zcXVhcmUuZ2l0aHViLmNvbS9jcm9zc2ZpbHRlci8pCisgICAgICBmdW5jdGlvbiByZXNpemVQYXRoKGQpIHsKKyAgICAgICAgdmFyIGUgPSArKGQgPT0gJ2UnKSwKKyAgICAgICAgICAgIHggPSBlID8gMSA6IC0xLAorICAgICAgICAgICAgeSA9IGF2YWlsYWJsZUhlaWdodDIgLyAzOworICAgICAgICByZXR1cm4gJ00nICsgKC41ICogeCkgKyAnLCcgKyB5CisgICAgICAgICAgICArICdBNiw2IDAgMCAnICsgZSArICcgJyArICg2LjUgKiB4KSArICcsJyArICh5ICsgNikKKyAgICAgICAgICAgICsgJ1YnICsgKDIgKiB5IC0gNikKKyAgICAgICAgICAgICsgJ0E2LDYgMCAwICcgKyBlICsgJyAnICsgKC41ICogeCkgKyAnLCcgKyAoMiAqIHkpCisgICAgICAgICAgICArICdaJworICAgICAgICAgICAgKyAnTScgKyAoMi41ICogeCkgKyAnLCcgKyAoeSArIDgpCisgICAgICAgICAgICArICdWJyArICgyICogeSAtIDgpCisgICAgICAgICAgICArICdNJyArICg0LjUgKiB4KSArICcsJyArICh5ICsgOCkKKyAgICAgICAgICAgICsgJ1YnICsgKDIgKiB5IC0gOCk7CisgICAgICB9CisKKworICAgICAgZnVuY3Rpb24gdXBkYXRlQnJ1c2hCRygpIHsKKyAgICAgICAgaWYgKCFicnVzaC5lbXB0eSgpKSBicnVzaC5leHRlbnQoYnJ1c2hFeHRlbnQpOworICAgICAgICBicnVzaEJHCisgICAgICAgICAgICAuZGF0YShbYnJ1c2guZW1wdHkoKSA/IHgyLmRvbWFpbigpIDogYnJ1c2hFeHRlbnRdKQorICAgICAgICAgICAgLmVhY2goZnVuY3Rpb24oZCxpKSB7CisgICAgICAgICAgICAgIHZhciBsZWZ0V2lkdGggPSB4MihkWzBdKSAtIHgyLnJhbmdlKClbMF0sCisgICAgICAgICAgICAgICAgICByaWdodFdpZHRoID0geDIucmFuZ2UoKVsxXSAtIHgyKGRbMV0pOworICAgICAgICAgICAgICBkMy5zZWxlY3QodGhpcykuc2VsZWN0KCcubGVmdCcpCisgICAgICAgICAgICAgICAgLmF0dHIoJ3dpZHRoJywgIGxlZnRXaWR0aCA8IDAgPyAwIDogbGVmdFdpZHRoKTsKKworICAgICAgICAgICAgICBkMy5zZWxlY3QodGhpcykuc2VsZWN0KCcucmlnaHQnKQorICAgICAgICAgICAgICAgIC5hdHRyKCd4JywgeDIoZFsxXSkpCisgICAgICAgICAgICAgICAgLmF0dHIoJ3dpZHRoJywgcmlnaHRXaWR0aCA8IDAgPyAwIDogcmlnaHRXaWR0aCk7CisgICAgICAgICAgICB9KTsKKyAgICAgIH0KKworCisgICAgICBmdW5jdGlvbiBvbkJydXNoKCkgeworICAgICAgICBicnVzaEV4dGVudCA9IGJydXNoLmVtcHR5KCkgPyBudWxsIDogYnJ1c2guZXh0ZW50KCk7CisgICAgICAgIGV4dGVudCA9IGJydXNoLmVtcHR5KCkgPyB4Mi5kb21haW4oKSA6IGJydXNoLmV4dGVudCgpOworCisKKyAgICAgICAgZGlzcGF0Y2guYnJ1c2goe2V4dGVudDogZXh0ZW50LCBicnVzaDogYnJ1c2h9KTsKKworICAgICAgICB1cGRhdGVCcnVzaEJHKCk7CisKKworICAgICAgICAvLy0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLQorICAgICAgICAvLyBQcmVwYXJlIE1haW4gKEZvY3VzKSBCYXJzIGFuZCBMaW5lcworICAgICAgICAKKyAgICAgICAgYmFycworICAgICAgICAud2lkdGgoYXZhaWxhYmxlV2lkdGgpCisgICAgICAgIC5oZWlnaHQoYXZhaWxhYmxlSGVpZ2h0MSkKKyAgICAgICAgLmNvbG9yKGRhdGEubWFwKGZ1bmN0aW9uKGQsaSkgeworICAgICAgICAgIHJldHVybiBkLmNvbG9yIHx8IGNvbG9yKGQsIGkpOworICAgICAgICB9KS5maWx0ZXIoZnVuY3Rpb24oZCxpKSB7IHJldHVybiAhZGF0YVtpXS5kaXNhYmxlZCAmJiBkYXRhW2ldLmJhciB9KSk7CisKKworICAgICAgICBsaW5lcworICAgICAgICAud2lkdGgoYXZhaWxhYmxlV2lkdGgpCisgICAgICAgIC5oZWlnaHQoYXZhaWxhYmxlSGVpZ2h0MSkKKyAgICAgICAgLmNvbG9yKGRhdGEubWFwKGZ1bmN0aW9uKGQsaSkgeworICAgICAgICAgIHJldHVybiBkLmNvbG9yIHx8IGNvbG9yKGQsIGkpOworICAgICAgICB9KS5maWx0ZXIoZnVuY3Rpb24oZCxpKSB7IHJldHVybiAhZGF0YVtpXS5kaXNhYmxlZCAmJiAhZGF0YVtpXS5iYXIgfSkpOworCisgICAgICAgIHZhciBmb2N1c0JhcnNXcmFwID0gZy5zZWxlY3QoJy5udi1mb2N1cyAubnYtYmFyc1dyYXAnKQorICAgICAgICAgICAgLmRhdHVtKCFkYXRhQmFycy5sZW5ndGggPyBbe3ZhbHVlczpbXX1dIDoKKyAgICAgICAgICAgICAgZGF0YUJhcnMKKyAgICAgICAgICAgICAgICAubWFwKGZ1bmN0aW9uKGQsaSkgeworICAgICAgICAgICAgICAgICAgcmV0dXJuIHsKKyAgICAgICAgICAgICAgICAgICAga2V5OiBkLmtleSwKKyAgICAgICAgICAgICAgICAgICAgdmFsdWVzOiBkLnZhbHVlcy5maWx0ZXIoZnVuY3Rpb24oZCxpKSB7CisgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGJhcnMueCgpKGQsaSkgPj0gZXh0ZW50WzBdICYmIGJhcnMueCgpKGQsaSkgPD0gZXh0ZW50WzFdOworICAgICAgICAgICAgICAgICAgICB9KQorICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIH0pCisgICAgICAgICAgICApOworICAgICAgICAKKyAgICAgICAgdmFyIGZvY3VzTGluZXNXcmFwID0gZy5zZWxlY3QoJy5udi1mb2N1cyAubnYtbGluZXNXcmFwJykKKyAgICAgICAgICAgIC5kYXR1bShkYXRhTGluZXNbMF0uZGlzYWJsZWQgPyBbe3ZhbHVlczpbXX1dIDoKKyAgICAgICAgICAgICAgZGF0YUxpbmVzCisgICAgICAgICAgICAgICAgLm1hcChmdW5jdGlvbihkLGkpIHsKKyAgICAgICAgICAgICAgICAgIHJldHVybiB7CisgICAgICAgICAgICAgICAgICAgIGtleTogZC5rZXksCisgICAgICAgICAgICAgICAgICAgIHZhbHVlczogZC52YWx1ZXMuZmlsdGVyKGZ1bmN0aW9uKGQsaSkgeworICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBsaW5lcy54KCkoZCxpKSA+PSBleHRlbnRbMF0gJiYgbGluZXMueCgpKGQsaSkgPD0gZXh0ZW50WzFdOworICAgICAgICAgICAgICAgICAgICB9KQorICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIH0pCisgICAgICAgICAgICAgKTsKKyAgICAgICAgICAgICAgICAgCisgICAgICAgIC8vLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tCisgICAgICAgI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KyAgICAgICAgZy5zZWxlY3QoJy5udi1mb2N1cyAubnYteTIubnYtYXhpcycpCisgICAgICAgICAgLnN0eWxlKCdvcGFjaXR5JywgZGF0YUxpbmVzLmxlbmd0aCA/IDEgOiAwKQorICAgICAgICAgIC5hdHRyKCd0cmFuc2Zvcm0nLCAndHJhbnNsYXRlKCcgKyB4LnJhbmdlKClbMV0gKyAnLDApJyk7CisKKyAgICAgICAgZy5zZWxlY3QoJy5udi1mb2N1cyAubnYteTEubnYtYXhpcycpLnRyYW5zaXRpb24oKS5kdXJhdGlvbih0cmFuc2l0aW9uRHVyYXRpb24pCisgICAgICAgICAgICAuY2FsbCh5MUF4aXMpOworICAgICAgICBnLnNlbGVjdCgnLm52LWZvY3VzIC5udi15Mi5udi1heGlzJykudHJhbnNpdGlvbigpLmR1cmF0aW9uKHRyYW5zaXRpb25EdXJhdGlvbikKKyAgICAgICAgICAgIC5jYWxsKHkyQXhpcyk7CisgICAgICB9CisKKyAgICAgIC8vPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisKKyAgICAgIG9uQnJ1c2goKTsKKworICAgIH0pOworCisgICAgcmV0dXJuIGNoYXJ0OworICB9CisKKworICAvLz09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorICAvLyBFdmVudCBIYW5kbGluZy9EaXNwYXRjaGluZyAob3V0IG9mIGNoYXJ0J3Mgc2NvcGUpCisgIC8vLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tCisKKyAgbGluZXMuZGlzcGF0Y2gub24oJ2VsZW1lbnRNb3VzZW92ZXIudG9vbHRpcCcsIGZ1bmN0aW9uKGUpIHsKKyAgICBlLnBvcyA9IFtlLnBvc1swXSArICBtYXJnaW4ubGVmdCwgZS5wb3NbMV0gKyBtYXJnaW4udG9wXTsKKyAgICBkaXNwYXRjaC50b29sdGlwU2hvdyhlKTsKKyAgfSk7CisKKyAgbGluZXMuZGlzcGF0Y2gub24oJ2VsZW1lbnRNb3VzZW91dC50b29sdGlwJywgZnVuY3Rpb24oZSkgeworICAgIGRpc3BhdGNoLnRvb2x0aXBIaWRlKGUpOworICB9KTsKKworICBiYXJzLmRpc3BhdGNoLm9uKCdlbGVtZW50TW91c2VvdmVyLnRvb2x0aXAnLCBmdW5jdGlvbihlKSB7CisgICAgZS5wb3MgPSBbZS5wb3NbMF0gKyAgbWFyZ2luLmxlZnQsIGUucG9zWzFdICsgbWFyZ2luLnRvcF07CisgICAgZGlzcGF0Y2gudG9vbHRpcFNob3coZSk7CisgIH0pOworCisgIGJhcnMuZGlzcGF0Y2gub24oJ2VsZW1lbnRNb3VzZW91dC50b29sdGlwJywgZnVuY3Rpb24oZSkgeworICAgIGRpc3BhdGNoLnRvb2x0aXBIaWRlKGUpOworICB9KTsKKworICBkaXNwYXRjaC5vbigndG9vbHRpcEhpZGUnLCBmdW5jdGlvbigpIHsKKyAgICBpZiAodG9vbHRpcHMpIG52LnRvb2x0aXAuY2xlYW51cCgpOworICB9KTsKKworICAvLz09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorCisKKyAgLy89PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKyAgLy8gRXhwb3NlIFB1YmxpYyBWYXJpYWJsZXMKKyAgLy8tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0KKworICAvLyBleHBvc2UgY2hhcnQncyBzdWItY29tcG9uZW50cworICBjaGFydC5kaXNwYXRjaCA9IGRpc3BhdGNoOworICBjaGFydC5sZWdlbmQgPSBsZWdlbmQ7CisgIGNoYXJ0LmxpbmVzID0gbGluZXM7CisgIGNoYXJ0Lm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IHkgc2NhbGUKKyAgICAgIGludGVycG9sYXRlID0gImxpbmVhciI7IC8vIGNvbnRyb2xzIHRoZSBsaW5lIGludGVycG9sYXRpb24KKworCisgIHZhciBzY2F0dGVyID0gbnYubW9kZWxzLnNjYXR0ZXIoKQorICAgICAgICAgICAgICAgICAgLmlkKGlkKQorICAgICAgICAgICAgICAgICAgLnNpemUoMTYpIC8vIGRlZmF1bHQgc2l6ZQorICAgICAgICAgICAgICAgICAgLnNpemVEb21haW4oWzE2LDI1Nl0pLCAvL3NldCB0byBzcGVlZCB1cCBjYWxjdWxhdGlvbiwgbmVlZHMgdG8gYmUgdW5zZXQgaWYgdGhlcmUgaXMgYSBjdXN0b20gc2l6ZSBhY2Nlc3NvcgorICAgICAgLy94ID0gc2NhdHRlci54U2NhbGUoKSwKKyAgICAgIC8veSA9IHNjYXR0ZXIueVNjYWxlKCksCisgICAgICB4LCB5LAorICAgICAgeDAsIHkwLCB0aW1lb3V0SUQ7CisKKworICBmdW5jdGlvbiBjaGFydChzZWxlY3Rpb24pIHsKKyAgICBzZWxlY3Rpb24uZWFjaChmdW5jdGlvbihkYXRhKSB7CisgICAgICB2YXIgYXZhaWxhYmxlV2lkdGggPSB3aWR0aCAtIG1hcmdpbi5sZWZ0IC0gbWFyZ2luLnJpZ2h0LAorICAgICAgICAgIGF2YWlsYWJsZUhlaWdodCA9IGhlaWdodCAtIG1hcmdpbi50b3AgLSBtYXJnaW4uYm90dG9tOworCisgICAgICAvL2dldCB0aGUgc2NhbGVzIGluc2Nhc2Ugc2NhdHRlciBzY2FsZSB3YXMgc2V0IG1hbnVhbGx5CisgICAgICB4ID0geCB8fCBzY2F0dGVyLnhTY2FsZSgpOworICAgICAgeSA9IHkgfHwgc2NhdHRlci55U2NhbGUoKTsKKworICAgICAgLy9zdG9yZSBvbGQgc2NhbGVzIGlmIHRoZXkgZXhpc3QKKyAgICAgIHgwID0geDAgfHwgeDsKKyAgICAgIHkwID0geTAgfHwgeTsKKworCisgICAgICB2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bihfKSB7CisgICAgaWYgKCFhcmd1bWVudHMubGVuZ3RoKSByZXR1cm4gbWFyZ2luOworICAgIG1hcmdpbiA9IF87CisgICAgcmV0dXJuIGNoYXJ0OworICB9OworCisgIGNoYXJ0LndpZHRoID0gZnVuY3Rpb24oXykgeworICAgIGlmICghYXJndW1lbnRzLmxlbmd0aCkgcmV0dXJuIHdpZHRoOworICAgIHdpZHRoID0gXzsKKyAgICByZXR1cm4gY2hhcnQ7CisgIH07CisKKyAgY2hhcnQuaGVpZ2h0ID0gZnVuY3Rpb24oXykgeworICAgIGlmICghYXJndW1lbnRzLmxlbmd0aCkgcmV0dXJuIGhlaWdodDsKKyAgICBoZWlnaHQgPSBfOworICAgIHJldHVybiBjaGFydDsKKyAgfTsKKworICBjaGFydC54ID0gZnVuY3Rpb24oXykgeworICAgIGlmICghYXJndW1lbnRzLmxlbmd0aCkgcmV0dXJuIGdldFg7CisgICAgZ2V0WCA9IF87CisgICAgc2NhdHRlci54KF8pOworICAgIHJldHVybiBjaGFydDsKKyAgfTsKKworICBjaGFydC55ID0gZnVuY3Rpb24oXykgeworICAgIGlmICghYXJndW1lbnRzLmxlbmd0aCkgcmV0dXJuIGdldFk7CisgICAgZ2V0WSA9IF87CisgICAgc2NhdHRlci55KF8pOworICAgIHJldHVybiBjaGFydDsKKyAgfTsKKworICBjaGFydC5jbGlwRWRnZSA9IGZ1bmN0aW9uKF8pIHsKKyAgICBpZiAoIWFyZ3VtZW50cy5sZW5ndGgpIHJldHVybiBjbGlwRWRnZTsKKyAgICBjbGlwRWRnZSA9IF87CisgICAgcmV0dXJuIGNoYXJ0OworICB9OworCisgIGNoYXJ0LmNvbG9yID0gZnVuY3Rpb24oXykgeworICAgIGlmICghYXJndW1lbnRzLmxlbmd0aCkgcmV0dXJuIGNvbG9yOworICAgIGNvbG9yID0gbnYudXRpbHMuZ2V0Q29sb3IoXyk7CisgICAgc2NhdHRlci5jb2xvcihjb2xvcik7CisgICAgcmV0dXJuIGNoYXJ0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PSBudi51dGlscy5kZWZhdWx0Q29sb3IoKSwKKyAgICAgIHdpZHRoID0gbnVsbCwgCisgICAgICBoZWlnaHQgPSBudWxsLAorICAgICAgc2hvd0xlZ2VuZCA9IHRydWUsCisgICAgICBzaG93Q29udHJvbHMgPSB0cnVlLAorICAgICAgZmlzaGV5ZSA9IDAsCisgICAgICBwYXVzZUZpc2hleWUgPSBmYWxzZSwKKyAgICAgIHRvb2x0aXBzID0gdHJ1ZSwKKyAgICAgIHRvb2x0aXAgPSBmdW5jdGlvbihrZXksIHgsIHksIGUsIGdyYXBoKSB7IAorICAgICAgICByZXR1cm4gJzxoMz4nICsga2V5ICsgJzwvaDM+JyArCisgICAgICAgICAgICAgICAnPHA+JyArICB5ICsgJyBhdCAnICsgeCArICc8L3A+JworICAgICAgfSwKKyAgICAgIG5vRGF0YSA9ICJObyBEYXRhIEF2YWlsYWJsZS4iCisgICAgICA7CisKKworICB2YXIgeCA9IGQzLmZpc2hleWUuc2NhbGUoZDMuc2NhbGUubGluZWFyKS5kaXN0b3J0aW9uKDApOworCisgIHZhciBsaW5lcyA9IG52Lm1vZGVscy5saW5lKCkueFNjYWxlKHgpLAorICAgICAgLy94ID0gbGluZXMueFNjYWxlKCksCisgICAgICB5ID0gbGluZXMueVNjYWxlKCksCisgICAgICB4QXhpcyA9IG52Lm1vZGVscy5heGlzKCkuc2NhbGUoeCkub3JpZW50KCdib3R0b20nKS50aWNrUGFkZGluZyg1KSwKKyAgICAgIHlBeGlzID0gbnYubW9kZWxzLmF4aXMoKS5zY2FsZSh5KS5vcmllbnQoJ2xlZnQnKSwKKyAgICAgIGxlZ2VuZCA9IG52Lm1vZGVscy5sZWdlbmQoKS5oZWlnaHQoMzApLAorICAgICAgY29udHJvbHMgPSBudi5tb2RlbHMubGVnZW5kKCkuaGVpZ2h0KDMwKS51cGRhdGVTdGF0ZShmYWxzZSksCisgICAgICBkaXNwYXRjaCA9IGQzLmRpc3BhdGNoKCd0b29sdGlwU2hvdycsICd0b29sdGlwSGlkZScpOworCisKKyAgdmFyIHNob3dUb29sdGlwID0gZnVuY3Rpb24oZSwgb2Zmc2V0RWxlbWVudCkgeworICAgIHZhciBsZWZ0ID0gZS5wb3NbMF0gKyAoIG9mZnNldEVsZW1lbnQub2Zmc2V0TGVmdCB8fCAwICksCisgICAgICAgIHRvcCA9IGUucG9zWzFdICsgKCBvZmZzZXRFbGVtZW50Lm9mZnNldFRvcCB8fCAwKSwKKyAgICAgICAgeCA9IHhBeGlzLnRpY2tGb3JtYXQoKShsaW5lcy54KCkoZS5wb2ludCwgZS5wb2ludEluZGV4KSksCisgICAgICAgIHkgPSB5QXhpcy50aWNrRm9ybWF0KCkobGluZXMueSgpKGUucG9pbnQsIGUucG9pbnRJbmRleCkpLAorICAgICAgICBjb250ZW50ID0gdG9vbHRpcChlLnNlcmllcy5rZXksIHgsIHksIGUsIGNoYXJ0KTsKKworICAgIG52LnRvb2x0aXAuc2hvdyhbbGVmdCwgdG9wXSwgY29udGVudCwgbnVsbCwgbnVsbCwgb2Zmc2V0RWxlbWVudCk7CisgIH07CisKKworICB2YXIgY29udHJvbHNEYXRhID0gWworICAgIHsga2V5OiAnTWFnbmlmeScsIGRpc2FibGVkOiB0cnVlIH0KKyAgXTsKKworCisgIGZ1bmN0aW9uIGNoYXJ0KHNlbGVjdGlvbikgeworICAgIHNlbGVjdGlvbi5lYWNoKGZ1bmN0aW9uKGRhdGEpIHsKKyAgICAgIHZhciBjb250YWluZXIgPSBkMy5zZWxlY3QodGhpcyksCisgICAgICAgICAgdGhhdCA9IHRoaXM7CisKKyAgICAgIHZhciBhdmFpbGFibGVXaWR0aCA9ICh3aWR0aCAgfHwgcGFyc2VJbnQoY29udGFpbmVyLnN0eWxlKCd3aWR0aCcpKSB8fCA5NjApCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC0gbWFyZ2luLmxlZnQgLSBtYXJnaW4ucmlnaHQsCisgICAgICAgICAgYXZhaWxhYmxlSGVpZ2h0ID0gKGhla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jb250cm9sc1dyYXAnKTsKKworCisgICAgICB2YXIgZyA9IHdyYXAuc2VsZWN0KCdnJyk7CisKKworCisKKyAgICAgIGlmIChzaG93TGVnZW5kKSB7CisgICAgICAgIGxlZ2VuZC53aWR0aChhdmFpbGFibGVXaWR0aCk7CisKKyAgICAgICAgZy5zZWxlY3QoJy5udi1sZWdlbmRXcmFwJykKKyAgICAgICAgICAgIC5kYXR1bShkYXRhKQorICAgICAgICAgICAgLmNhbGwobGVnZW5kKTsKKworICAgICAgICBpZiAoIG1hcmdpbi50b3AgIT0gbGVnZW5kLmhlaWdodCgpKSB7CisgICAgICAgICAgbWFyZ2luLnRvcCA9IGxlZ2VuZC5oZWlnaHQoKTsKKyAgICAgICAgICBhdmFpbGFibGVIZWlnaHQgPSAoaGVpZ2h0IHx8IHBhcnNlSW50KGNvbnRhaW5lci5zdHlsZSgnaGVpZ2h0JykpIHx8IDQwMCkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLSBtYXJnaW4udG9wIC0gbWFyZ2luLmJvdHRvbTsKKyAgICAgICAgfQorCisgICAgICAgIGcuc2VsZWN0KCcubnYtbGVnZW5kV3JhcCcpCisgICAgICAgICAgICAuYXR0cigndHJhbnNmb3JtJywgJ3RyYW5zbGF0ZSgwLCcgKyAoLW1hcmdpbi50b3ApICsnKScpCisgICAgICB9CisKKyAgICAgIGlmIChzaG93Q29udHJvbHMpIHsKKyAgICAgICAgY29udHJvbHMud2lkdGgoMTgwKS5jb2xvcihbJyM0NDQnXSk7CisgICAgICAgIGcuc2VsZWN0KCcubnYtY29udHJvbHNXcmFwJykKKyAgICAgICAgICAgIC5kYXR1bShjb250cm9sc0RhdGEpCisgICAgICAgICAgICAuYXR0cigndHJhbnNmb3JtJywgJ3RyYW5zbGF0ZSgwLCcgKyAoLW1hcmdpbi50b3ApICsnKScpCisgICAgICAgICAgICAuY2FsbChjb250cm9scyk7CisgICAgICB9CisKKworCisgICAgICBsaW5lcworICAgICAgICAud2lkdGgoYXZhaWxhYmxlV2lkdGgpCisgICAgICAgIC5oZWlnaHQoYXZhaWxhYmxlSGVpZ2h0KQorICAgICAgICAuY29sb3IoZGF0YS5tYXAoZnVuY3Rpb24oZCxpKSB7CisgICAgICAgICAgcmV0dXJuIGQuY29sb3IgfHwgY29sb3IoZCwgaSk7CisgICAgICAgIH0pLmZpbHRlcihmdW5jdGlvbihkLGkpIHsgcmV0dXJuICFkYXRhW2ldLmRpc2FibGVkIH0pKTsKKworCisKKyAgICAgIGcuYXR0cigndHJhbnNmb3JtJywgJ3RyYW5zbGF0ZSgnICsgbWFyZ2luLmxlZnQgKyAnLCcgKyBtYXJnaW4udG9wICsgJyknKTsKKworCisgICAgICB2YXIgbGluZXNXcmFwID0gZy5zZWxlY3QoJy5udi1saW5lc1dyYXAnKQorICAgICAgICAgIC5kYXR1bShkYXRhLmZpbHRlcihmdW5jdGlvbihkKSB7IHJldHVybiAhZC5kaXNhYmxlZCB9KSkKKworICAgICAgZDMudHJhbnNpdGlvbihsaW5lc1dyYXApLmNhbGwobGluZXMpOworCisKKworICAgICAgeEF4aXMKKyAgICAgICAgLy8uc2NhbGUoeCkKKyAgICAgICAgLnRpY2tzKCBhdmFpbGFibGVXaWR0aCAvIDEwMCApCisgICAgICAgIC50aWNrU2l6ZSgtYXZhaWxhYmxlSGVpZ2h0LCAwKTsKKworICAgICAgZy5zZWxlY3QoJy5udi14Lm52LWF4aXMnKQorICAgICAgICAgIC5hdHRyKCd0cmFuc2Zvcm0nLCAndHJhbnNsYXRlKDAsJyArIHkucmFuZ2UoKVswXSArICcpJyk7CisgICAgICBkMy50cmFuc2l0aW9uKGcuc2VsZWN0KCcubnYteC5udi1heGlzJykpCisgICAgICAgICAgLmNhbGwoeEF4aXMpOworCisKKyAgICAgIHlBeGlzCisgICAgICAgIC8vLnNjYWxlKHkpCisgICAgICAgIC50aWNrcyggYXZhaWxhYmxlSGVpZ2h0IC8gMzYgKQorICAgICAgICAudGlja1NpemUoIC1hdmFpbGFibGV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KGZpc2hleWUpLmZvY3VzKG1vdXNlWzBdKTsKKyAgICAgIH0KKworCisgICAgICBjb250cm9scy5kaXNwYXRjaC5vbignbGVnZW5kQ2xpY2snLCBmdW5jdGlvbihkLGkpIHsgCisgICAgICAgIGQuZGlzYWJsZWQgPSAhZC5kaXNhYmxlZDsKKworICAgICAgICBmaXNoZXllID0gZC5kaXNhYmxlZCA/IDAgOiA1OworICAgICAgICBnLnNlbGVjdCgnLm52LWJhY2tncm91bmQnKSAuc3R5bGUoJ3BvaW50ZXItZXZlbnRzJywgZC5kaXNhYmxlZCA/ICdub25lJyA6ICdhbGwnKTsKKyAgICAgICAgZy5zZWxlY3QoJy5udi1wb2ludC1wYXRocycpLnN0eWxlKCdwb2ludGVyLWV2ZW50cycsIGQuZGlzYWJsZWQgPyAnYWxsJyA6ICdub25lJyApOworCisgICAgICAgIC8vc2NhdHRlci5pbnRlcmFjdGl2ZShkLmRpc2FibGVkKTsKKyAgICAgICAgLy90b29sdGlwcyA9IGQuZGlzYWJsZWQ7CisKKyAgICAgICAgaWYgKGQuZGlzYWJsZWQpIHsKKyAgICAgICAgICB4LmRpc3RvcnRpb24oZmlzaGV5ZSkuZm9jdXMoMCk7CisKKyAgICAgICAgICBsaW5lc1dyYXAuY2FsbChsaW5lcyk7CisgICAgICAgICAgZy5zZWxlY3QoJy5udi14Lm52LWF4aXMnKS5jYWxsKHhBeGlzKTsKKyAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICBwYXVzZUZpc2hleWUgPSBmYWxzZTsKKyAgICAgICAgfQorCisgICAgICAgIGNoYXJ0LnVwZGF0ZSgpOworICAgICAgfSk7CisKKworICAgICAgbGVnZW5kLmRpc3BhdGNoLm9uKCdzdGF0ZUNoYW5nZScsIGZ1bmN0aW9uKG5ld1N0YXRlKSB7IAorICAgICAgICBjaGFydC51cGRhdGUoKTsKKyAgICAgIH0pOworCisgICAgICBsaW5lcy5kaXNwYXRjaC5vbignZWxlbWVudE1vdXNlb3Zlci50b29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OworICAKKyAgY2hhcnQubWFyZ2luID0gZnVuY3Rpb24oXykgeworICAgIGlmICghYXJndW1lbnRzLmxlbmd0aCkgcmV0dXJuIG1hcmdpbjsKKyAgICBtYXJnaW4gPSBfOworICAgIHJldHVybiBjaGFydDsKKyAgfTsKKworICBjaGFydC53aWR0aCA9IGZ1bmN0aW9uKF8pIHsKKyAgICBpZiAoIWFyZ3VtZW50cy5sZW5ndGgpIHJldHVybiB3aWR0aDsKKyAgICB3aWR0aCA9IF87CisgICAgcmV0dXJuIGNoYXJ0OworICB9OworCisgIGNoYXJ0LmhlaWdodCA9IGZ1bmN0aW9uKF8pIHsKKyAgICBpZiAoIWFyZ3VtZW50cy5sZW5ndGgpIHJldHVybiBoZWlnaHQ7CisgICAgaGVpZ2h0ID0gXzsKKyAgICByZXR1cm4gY2hhcnQ7CisgIH07CisKKyAgY2hhcnQuY29sb3IgPSBmdW5jdGlvbihfKSB7CisgICAgaWYgKCFhcmd1bWVudHMubGVuZ3RoKSByZXR1cm4gY29sb3I7CisgICAgY29sb3IgPSBudi51dGlscy5nZXRDb2xvcihfKTsKKyAgICBsZWdlbmQuY29sb3IoY29sb3IpOworICAgIHJldHVybiBjaGFydDsKKyAgfTsKKworICBjaGFydC5zaG93TGVnZW5kID0gZnVuY3Rpb24oXykgeworICAgIGlmICghYXJndW1lbnRzLmxlbmd0aCkgcmV0dXJuIHNob3dMZWdlbmQ7CisgICAgc2hvd0xlZ2VuZCA9IF87CisgICAgcmV0dXJuIGNoYXJ0OworICB9OworCisgIGNoYXJ0LnRvb2x0aXBzID0gZnVuY3Rpb24oXykgeworICAgIGlmICghYXJndW1lbnRzLmxlbmd0aCkgcmV0dXJuIHRvb2x0aXBzOworICAgIHRvb2x0aXBzID0gXzsKKyAgICByZXR1cm4gY2hhcnQ7CisgIH07CisKKyAgY2hhcnQudG9vbHRpcENvbnRlbnQgPSBmdW5jdGlvbihfKSB7CisgICAgaWYgKCFhcmd1bWVudHMubGVuZ3RoKSByZXR1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scy5heGlzKCkKKyAgICAsIHlBeGlzID0gbnYubW9kZWxzLmF4aXMoKQorICAgICwgeDJBeGlzID0gbnYubW9kZWxzLmF4aXMoKQorICAgICwgeTJBeGlzID0gbnYubW9kZWxzLmF4aXMoKQorICAgICwgbGVnZW5kID0gbnYubW9kZWxzLmxlZ2VuZCgpCisgICAgLCBicnVzaCA9IGQzLnN2Zy5icnVzaCgpCisgICAgOworCisgIHZhciBtYXJnaW4gPSB7dG9wOiAzMCwgcmlnaHQ6IDMwLCBib3R0b206IDMwLCBsZWZ0OiA2MH0KKyAgICAsIG1hcmdpbjIgPSB7dG9wOiAwLCByaWdodDogMzAsIGJvdHRvbTogMjAsIGxlZnQ6IDYwfQorICAgICwgY29sb3IgPSBudi51dGlscy5kZWZhdWx0Q29sb3IoKQorICAgICwgd2lkdGggPSBudWxsCisgICAgLCBoZWlnaHQgPSBudWxsCisgICAgLCBoZWlnaHQyID0gMTAwCisgICAgLCB4CisgICAgLCB5CisgICAgLCB4MgorICAgICwgeTIKKyAgICAsIHNob3dMZWdlbmQgPSB0cnVlCisgICAgLCBicnVzaEV4dGVudCA9IG51bGwKKyAgICAsIHRvb2x0aXBzID0gdHJ1ZQorICAgICwgdG9vbHRpcCA9IGZ1bmN0aW9uKGtleSwgeCwgeSwgZSwgZ3JhcGgpIHsKKyAgICAgICAgcmV0dXJuICc8aDM+JyArIGtleSArICc8L2gzPicgKworICAgICAgICAgICAgICAgJzxwPicgKyAgeSArICcgYXQgJyArIHggKyAnPC9wPicKKyAgICAgIH0KKyAgICAsIG5vRGF0YSA9ICJObyBEYXRhIEF2YWlsYWJsZS4iCisgICAgLCBkaXNwYXRjaCA9IGQzLmRpc3BhdGNoKCd0b29sdGlwU2hvdycsICd0b29sdGlwSGlkZScsICdicnVzaCcpCisgICAgLCB0cmFuc2l0aW9uRHVyYXRpb24gPSAyNTAKKyAgICA7CisKKyAgbGluZXMKKyAgICAuY2xpcEVkZ2UodHJ1ZSkKKyAgICA7CisgIGxpbmVzMgorICAgIC5pbnRlcmFjdGl2ZShmYWxzZSkKKyAgICA7CisgIHhBeGlzCisgICAgLm9yaWVudCgnYm90dG9tJykKKyAgICAudGlja1BhZGRpbmcoNSkKKyAgICA7CisgIHlBeGlzCisgICAgLm9yaWVudCgnbGVmdCcpCisgICAgOworICB4MkF4aXMKKyAgICAub3JpZW50KCdib3R0b20nKQorICAgIC50aWNrUGFkZGluZyg1KQorICAgIDsKKyAgeTJBeGlzCisgICAgLm9yaWVudCgnbGVmdCcpCisgICAgOworICAvLz09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorCisKKyAgLy89PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKyAgLy8gUHJpdmF0ZSBWYXJpYWJsZXMKKyAgLy8tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0KKworICB2YXIgc2hvd1Rvb2x0aXAgPSBmdW5jdGlvbihlLCBvZmZzZXRFbGVtZW50KSB7CisgICAgdmFyIGxlZnQgPSBlLnBvc1swXSArICggb2Zmc2V0RWxlbWVudC5vZmZzZXRMZWZ0IHx8IDAgKSwKKyAgICAgICAgdG9wID0gZS5wb3NbMV0gKyAoIG9mZnNldEVsZW1lbnQub2Zmc2V0VG9wIHx8IDApLAorICAgICAgICB4ID0geEF4aXMudGlja0Zvcm1hdCgpKGxpbmVzLngoKShlLnBvaW50LCBlLnBvaW50SW5kZXgpKSwKKyAgICAgICAgeSA9IHlBeGlzLnRpY2tGb3JtYXQoKShsaW5lcy55KCkoZS5wb2ludCwgZS5wb2ludEluZGV4KSksCisgICAgICAgIGNvbnRlbnQgPSB0b29sdGlwKGUuc2VyaWVzLmtleSwgeCwgeSwgZSwgY2hhcnQpOworCisgICAgbnYudG9vbHRpcC5zaG93KFtsZWZ0LCB0b3BdLCBjb250ZW50LCBudWxsLCBudWxsLCBvZmZzZXRFbGVtZW50KTsKKyAgfTsKKworICAvLz09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorCisKKyAgZnVuY3Rpb24gY2hhcnQoc2VsZWN0aW9uKSB7CisgICAgc2VsZWN0aW9uLmVhY2goZnVuY3Rpb24oZGF0YSkgeworICAgICAgdmFyIGNvbnRhaW5lciA9IGQzLnNlbGVjdCh0aGlzKSwKKyAgICAgICAgICB0aGF0ID0gdGhpczsKKworICAgICAgdmFyIGF2YWlsYWJsZVdpZHRoID0gKHdpZHRoICB8fCBwYXJzZUludChjb250YWluZXIuc3R5bGUoJ3dpZHRoJykpIHx8IDk2MCkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLSBtYXJnaW4ubGVmdCAtIG1hcmdpbi5yaWdodCwKKyAgICAgICAgICBhdmFpbGFibGVIZWlnaHQxID0gKGhlaWdodCB8fCBwYXJzZUludChjb250YWluZXIuc3R5bGUoJ2hlaWdodCcpKSB8fCA0MDApCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC0gbWFyZ2luLnRvcCAtIG1hcmdpbi5ib3R0b20gLSBoZWlnaHQyLAorICAgICAgICAgIGF2YWlsYWJsZUhlaWdodDIgPSBoZWlnaHQyIC0gbWFyZ2luMi50b3AgLSBtYXJnaW4yLmJvdHRvbTsKKworICAgICAgY2hhcnQudXBkYXRlID0gZnVuY3Rpb24oKSB7IGNvbnRhaW5lci50cmFuc2l0aW9uKCkuZHVyYXRpb24odHJhbnNpdGlvbkR1cmF0aW9uKS5jYWxsKGNoYXJ0KSB9OworICAgICAgY2hhcnQuY29udGFpbmVyID0gdGhpczsKKworCisgICAgICAvLy0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLQorICAgICAgLy8gRGlzcGxheSBObyBEYXRhIG1lc3NhZ2Ug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W5lc1dyYXAnKTsKKworICAgICAgdmFyIGNvbnRleHRFbnRlciA9IGdFbnRlci5hcHBlbmQoJ2cnKS5hdHRyKCdjbGFzcycsICdudi1jb250ZXh0Jyk7CisgICAgICBjb250ZXh0RW50ZXIuYXBwZW5kKCdnJykuYXR0cignY2xhc3MnLCAnbnYteCBudi1heGlzJyk7CisgICAgICBjb250ZXh0RW50ZXIuYXBwZW5kKCdnJykuYXR0cignY2xhc3MnLCAnbnYteSBudi1heGlzJyk7CisgICAgICBjb250ZXh0RW50ZXIuYXBwZW5kKCdnJykuYXR0cignY2xhc3MnLCAnbnYtbGluZXNXcmFwJyk7CisgICAgICBjb250ZXh0RW50ZXIuYXBwZW5kKCdnJykuYXR0cignY2xhc3MnLCAnbnYtYnJ1c2hCYWNrZ3JvdW5kJyk7CisgICAgICBjb250ZXh0RW50ZXIuYXBwZW5kKCdnJykuYXR0cignY2xhc3MnLCAnbnYteCBudi1icnVzaCcpOworCisgICAgICAvLy0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLQorCisKKyAgICAgIC8vLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tCisgICAgICAvLyBMZWdlbmQKKworICAgICAgaWYgKHNob3dMZWdlbmQpIHsKKyAgICAgICAgbGVnZW5kLndpZHRoKGF2YWlsYWJsZVdpZHRoKTsKKworICAgICAgICBnLnNlbGVjdCgnLm52LWxlZ2VuZFdyYXAnKQorICAgICAgICAgICAgLmRhdHVtKGRhdGEpCisgICAgICAgICAgICAuY2FsbChsZWdlbmQpOworCisgICAgICAgIGlmICggbWFyZ2luLnRvcCAhPSBsZWdlbmQuaGVpZ2h0KCkpIHsKKyAgICAgICAgICBtYXJnaW4udG9wID0gbGVnZW5kLmhlaWdodCgpOworICAgICAgICAgIGF2YWlsYWJsZUhlaWdodDEgPSAoaGVpZ2h0IHx8IHBhcnNlSW50KGNvbnRhaW5lci5zdHlsZSgnaGVpZ2h0JykpIHx8IDQwMCkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLSBtYXJnaW4udG9wIC0gbWFyZ2luLmJvdHRvbSAtIGhlaWdodDI7CisgICAgICAgIH0KKworICAgICAgICBnLnNlbGVjdCgnLm52LWxlZ2VuZFdyYXAnKQorICAgICAgICAgICAgLmF0dHIoJ3RyYW5zZm9ybScsICd0cmFuc2xhdGUoMCwnICsgKC1tYXJnaW4udG9wKSArJyknKQorICAgICAgfQorCisgICAgICAvLy0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLQorCisKKyAgICAgIHdyYXAuYXR0cigndHJhbnNmb3JtJywgJ3RyYW5zbGF0ZSgnICsgbWFyZ2luLmxlZnQgKyAnLCcgKyBtYXJnaW4udG9wICsgJyknKTsKKworCisgICAgICAvLy0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLQorICAgICAgLy8gTWFpbiBDaGFydCBDb21wb25lbnQocykKKworICAgICAgbGluZXMKKyAgICAgICAgLndpZHRoKGF2YWlsYWJsZVdpZHRoKQorICAgICAgICAuaGVpZ2h0KGF2YWlsYWJsZUhlaWdodDEpCisgICAgICAgIC5jb2xvcigKKyAgICAgICAgICBkYXRhCisgICAgICAgICAgICAubWFwKGZ1bmN0aW9uKGQsaSkgeworICAgICAgICAgICAgICByZXR1cm4gZC5jb2xvciB8fCBjb2xvcihkLCBpKTsKKyAgICAgICAgICAgIH0pCisgICAgICAgICAgICAuZmlsdGVyKGZ1bmN0aW9uKGQsaSkgeworICAgICAgICAgICAgICByZXR1cm4gIWRhdGFbaV0uZGlzYWJsZWQ7CisgICAgICAgICAgfSkKKyAgICAgICAgKTsKKworICAgICAgbGluZXMyCisgICAgICAgIC5kZWZpbmVkKGxpbmVzLmRlZmluZWQoKSkKKyAgICAgICAgLndpZHRoKGF2YWlsYWJsZVdpZHRoKQorICAgICAgICAuaGVpZ2h0KGF2YWlsYWJsZUhlaWdodDIpCisgICAgICAgIC5jb2xvcigKKyAgICAgICAgICBkYXRhCisgICAgICAgICAgICAubWFwKGZ1bmN0aW9uKGQsaSkgeworICAgICAgICAgICAgICByZXR1cm4gZC5jb2xvciB8fCBjb2xvcihkLCBpKTsKKyAgICAgICAgICAgIH0pCisgICAgICAgICAgICAuZmlsdGVyKGZ1bmN0aW9uKGQsaSkgeworICAgICAgICAgICAgICByZXR1cm4gIWRhdGFbaV0uZGlzYWJsZWQ7CisgICAgICAgICAgfSkKKyAgICAgICAgKTsKKworICAgICAgZy5zZWxlY3QoJy5udi1jb250ZXh0JykKKyAgICAgICAgICAuYXR0cigndHJhbnNmb3JtJywgJ3RyYW5zbGF0ZSgwLCcgKyAoIGF2YWlsYWJsZUhlaWdodDEgKyBtYXJnaW4uYm90dG9tICsgbWFyZ2luMi50b3ApICsgJyknKQorCisgICAgICB2YXIgY29udGV4dExpbmVzV3JhcCA9IGcuc2VsZWN0KCcubnYtY29udGV4dCAubnYtbGluZXNXcmFwJykKKyAgICAgICAgICAuZGF0dW0oZGF0YS5maWx0ZXIoZnVuY3Rpb24oZCkgeyByZXR1cm4gIWQuZGlzYWJsZWQgfSkpCisKKyAgICAgIGQzLnRyYW5zaXRpb24oY29udGV4dExpbmVzV3JhcCkuY2FsbChsaW5lczIpOworCisgICAgICAvLy0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLQorCisKKyAgICAgIC8qCisgICAgICB2YXIgZm9jdXNMaW5lc1dyYXAgPSBnLnNlbGVjdCgnLm52LWZvY3VzIC5udi1saW5lc1dyYXAnKQorICAgICAgICAgIC5kYXR1bShkYXRhLmZpbHRlcihmdW5jdGlvbihkKSB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0IG5lZWRzIHRvIGNoYW5nZSBpbW1lZGlhdGVseS4KKyAgICAgICAgICAgIHZhciBvbGRUcmFuc2l0aW9uID0gY2hhcnQudHJhbnNpdGlvbkR1cmF0aW9uKCk7CisgICAgICAgICAgICBjaGFydC50cmFuc2l0aW9uRHVyYXRpb24oMCk7IAorICAgICAgICAgICAgb25CcnVzaCgpOworICAgICAgICAgICAgY2hhcnQudHJhbnNpdGlvbkR1cmF0aW9uKG9sZFRyYW5zaXRpb24pOworICAgICAgICB9KTsKKworICAgICAgaWYgKGJydXNoRXh0ZW50KSBicnVzaC5leHRlbnQoYnJ1c2hFeHRlbnQpOworCisgICAgICB2YXIgYnJ1c2hCRyA9IGcuc2VsZWN0KCcubnYtYnJ1c2hCYWNrZ3JvdW5kJykuc2VsZWN0QWxsKCdnJykKKyAgICAgICAgICAuZGF0YShbYnJ1c2hFeHRlbnQgfHwgYnJ1c2guZXh0ZW50KCldKQorCisgICAgICB2YXIgYnJ1c2hCR2VudGVyID0gYnJ1c2hCRy5lbnRlcigpCisgICAgICAgICAgLmFwcGVuZCgnZycpOworCisgICAgICBicnVzaEJHZW50ZXIuYXBwZW5kKCdyZWN0JykKKyAgICAgICAgICAuYXR0cignY2xhc3MnLCAnbGVmdCcpCisgICAgICAgICAgLmF0dHIoJ3gnLCAwKQorICAgICAgICAgIC5hdHRyKCd5JywgMCkKKyAgICAgICAgICAuYXR0cignaGVpZ2h0JywgYXZhaWxhYmxlSGVpZ2h0Mik7CisKKyAgICAgIGJydXNoQkdlbnRlci5hcHBlbmQoJ3JlY3QnKQorICAgICAgICAgIC5hdHRyKCdjbGFzcycsICdyaWdodCcpCisgICAgICAgICAgLmF0dHIoJ3gnLCAwKQorICAgICAgICAgIC5hdHRyKCd5JywgMCkKKyAgICAgICAgICAuYXR0cignaGVpZ2h0JywgYXZhaWxhYmxlSGVpZ2h0Mik7CisKKyAgICAgIHZhciBnQnJ1c2ggPSBnLnNlbGVjdCgnLm52LXgubnYtYnJ1c2gnKQorICAgICAgICAgIC5jYWxsKGJydXNoKTsKKyAgICAgIGdCcnVzaC5zZWxlY3RBbGwoJ3JlY3QnKQorICAgICAgICAgIC8vLmF0dHIoJ3knLCAtNSkKKyAgICAgICAgICAuYXR0cignaGVpZ2h0JywgYXZhaWxhYmxlSGVpZ2h0Mik7CisgICAgICBnQnJ1c2guc2VsZWN0QWxsKCcucmVzaXplJykuYXBwZW5kKCdwYXRoJykuYXR0cignZCcsIHJlc2l6ZVBhdGgpOworCisgICAgICBvbkJydXNoKCk7CisKKyAgICAgIC8vLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tCisKKworICAgICAgLy8tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0KKyAgICAgIC8vIFNldHVwIFNlY29uZGFyeSAoQ29udGV4dCkgQXhlcworCisgICAgICB4MkF4aXMKKyAgICAgICAgLnNjYWxlKHgyKQorICAgICAgICAudGlja3MoIGF2YWlsYWJsZVdpZHRoIC8gMTAwICkKKyAgICAgICAgLnRpY2tTaXplKC1hdmFpbGFibGVIZWlnaHQyLCAwKTsKKworICAgICAgZy5zZWxlY3QoJy5udi1jb250ZXh0IC5udi14Lm52LWF4aXMnKQorICAgICAgICAgIC5hdHRyKCd0cmFuc2Zvcm0nLCAndHJhbnNsYXRlKDAsJyArIHkyLnJhbmdlKClbMF0gKyAnKScpOworICAgICAgZDMudHJhbnNpdGlvbihnLnNlbGVjdCgnLm52LWNvbnRleHQgLm52LXgubnYtYXhpcycpKQorICAgICAgICAgIC5jYWxsKHgyQXhpcyk7CisKKworICAgICAgeTJBeGlzCisgICAgICAgIC5zY2FsZSh5MikKKyAgICAgICAgLnRpY2tzKCBhdmFpbGFibGVIZWlnaHQyIC8gMzYgKQorICAgICAgICAudGlja1NpemUoIC1hdmFpbGFibGVXaWR0aCwgMCk7CisKKyAgICAgIGQzLnRyYW5zaXRpb24oZy5zZWxlY3QoJy5udi1jb250ZXh0IC5udi15Lm52LWF4aXMnKSkKKyAgICAgICAgICAuY2FsbCh5MkF4aXMpOworCisgICAgICBnLnNlbGVjdCgnLm52LWNvbnRleHQgLm52LXgubnYtYXhpcycpCisgICAgICAgICAgLmF0dHIoJ3RyYW5zZm9ybScsICd0cmFuc2xhdGUoMCwnICsgeTIucmFuZ2UoKVswXSArICcpJyk7CisKKyAgICAgIC8vLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tCisKKworICAgICAgLy89PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKyAgICAgIC8vIEV2ZW50IEhhbmRsaW5nL0Rpc3BhdGNoaW5nIChpbiBjaGFydCdzIHNjb3BlKQorICAgICAgLy8tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0KKworICAgICAgbGVnZW5kLmRpc3BhdGNoLm9uKCdzdGF0ZUNoYW5nZScsIGZ1bmN0aW9uKG5ld1N0YXRlKSB7IAorICAgICAgICBjaGFydC51cGRhdGUoKTsKKyAgICAgIH0pOworCisgICAgICBkaXNwYXRjaC5vbigndG9vbHRpcFNob3cnLCBmdW5jdGlvbihlKSB7CisgICAgICAgIGlmICh0b29sdGlwcykgc2hvd1Rvb2x0aXAoZSwgdGhhdC5wYXJlbnROb2RlKTsKKyAgICAgIH0pOworCisgICAgICAvLz09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorCisKKyAgICAgIC8vPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisgICAgICAvLyBGdW5jdGlvbnMKKyAgICAgIC8vLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tCisKKyAgICAgIC8vIFRha2VuIGZyb20gY3Jvc3NmaWx0ZXIgKGh0dHA6Ly9zcXVhcmUuZ2l0aHViLmNvbS9jcm9zc2ZpbHRlci8pCisgICAgICBmdW5jdGlvbiByZXNpemVQYXRoKGQpIHsKKyAgICAgICAgdmFyIGUgPSArKGQgPT0gJ2UnKSwKKyAgICAgICAgICAgIHggPSBlID8gMSA6IC0xLAorICAgICAgICAgICAgeSA9IGF2YWlsYWJsZUhlaWdodDIgLyAzOworICAgICAgICByZXR1cm4gJ00nICsgKC41ICogeCkgKyAnLCcgKyB5CisgICAgICAgICAgICArICdBNiw2IDAgMCAnICsgZSArICcgJyArICg2LjUgKiB4KSArICcsJyArICh5ICsgNikKKyAgICAgICAgICAgICsgJ1YnICsgKDIgKiB5IC0gNikKKyAgICAgICAgICAgICsgJ0E2LDYgMCAwICcgKyBlICsgJyAnICsgKC41ICogeCkgKyAnLCcgKyAoMiAqIHkpCisgICAgICAgICAgICArICdaJworICAgICAgICAgICAgKyAnTScgKyAoMi41ICogeCkgKyAnLCcgKyAoeSArIDgpCisgICAgICAgICAgICArICdWJyArICgyICogeSAtIDgpCisgICAgICAgICAgICArICdNJyArICg0LjUgKiB4KSArICcsJyArICh5ICsgOCkKKyAgICAgICAgICAgICsgJ1YnICsgKDIgKiB5IC0gOCk7CisgICAgICB9CisKKworICAgICAgZnVuY3Rpb24gdXBkYXRlQnJ1c2hCRygpIHsKKyAgICAgICAgaWYgKCFicnVzaC5lbXB0eSgpKSBicnVzaC5leHRlbnQoYnJ1c2hFeHRlbnQpOworICAgICAgICBicnVzaEJHCisgICAgICAgICAgICAuZGF0YShbYnJ1c2guZW1wdHkoKSA/IHgyLmRvbWFpbigpIDogYnJ1c2hFeHRlbnRdKQorICAgICAgICAgICAgLmVhY2goZnVuY3Rpb24oZCxpKSB7CisgICAgICAgICAgICAgIHZhciBsZWZ0V2lkdGggPSB4MihkWzBdKSAtIHgucmFuZ2UoKVswXSwKKyAgICAgICAgICAgICAgICAgIHJpZ2h0V2lkdGggPSB4LnJhbmdlKClbMV0gLSB4MihkWzFdKTsKKyAgICAgICAgICAgICAgZDMuc2VsZWN0KHRoaXMpLnNlbGVjdCgnLmxlZnQnKQorICAgICAgICAgICAgICAgIC5hdHRyKCd3aWR0aCcsICBsZWZ0V2lkdGggPCAwID8gMCA6IGxlZnRXaWR0aCk7CisKKyAgICAgICAgICAgICAgZDMuc2VsZWN0KHRoaXMpLnNlbGVjdCgnLnJpZ2h0JykKKyAgICAgICAgICAgICAgICAuYXR0cigneCcsIHgyKGRbMV0pKQorICAgICAgICAgICAgICAgIC5hdHRyKCd3aWR0aCcsIHJpZ2h0V2lkdGggPCAwID8gMCA6IHJpZ2h0V2lkdGgpOworICAgICAgICAgICAgfSk7CisgICAgICB9CisKKworICAgICAgZnVuY3Rpb24gb25CcnVzaCgpIHsKKyAgICAgICAgYnJ1c2hFeHRlbnQgPSBicnVzaC5lbXB0eSgpID8gbnVsbCA6IGJydXNoLmV4dGVudCgpOworICAgICAgICB2YXIgZXh0ZW50ID0gYnJ1c2guZW1wdHkoKSA/IHgyLmRvbWFpbigpIDogYnJ1c2guZXh0ZW50KCk7CisKKyAgICAgICAgLy9UaGUgYnJ1c2ggZXh0ZW50IGNhbm5vdCBiZSBsZXNzIHRoYW4gb25lLiAgSWYgaXQgaXMsIGRvbid0IHVwZGF0ZSB0aGUgbGluZSBjaGFydC4KKyAgICAgICAgaWYgKE1hdGguYWJzKGV4dGVudFswXSAtIGV4dGVudFsxXSkgPD0gMSkgeworICAgICAgICAgIHJldHVybjsKKyAgICAgICAgfQorCisgICAgICAgIGRpc3BhdGNoLmJydXNoKHtleHRlbnQ6IGV4dGVudCwgYnJ1c2g6IGJydXNofSk7CisKKworICAgICAgICB1cGRhdGVCcnVzaEJHKCk7CisKKyAgICAgICAgLy8gVXBkYXRlIE1haW4gKEZvY3VzKQorICAgICAgICB2YXIgZm9jdXNMaW5lc1dyYXAgPSBnLnNlbGVjdCgnLm52LWZvY3VzIC5udi1saW5lc1dyYXAnKQorICAgICAgICAgICAgLmRhdHVtKAorICAgICAgICAgICAgICBkYXRhCisgICAgICAgICAgICAgICAgLmZpbHRlcihmdW5jdGlvbihkKSB7IHJldHVybiAhZC5kaXNhYmxlZCB9KQorICAgICAgICAgICAgICAgIC5tYXAoZnVuY3Rpb24oZCxpKSB7CisgICAgICAgICAgICAgICAgICByZXR1cm4geworICAgICAgICAgICAgICAgICAgICBrZXk6IGQua2V5LAorICAgICAgICAgICAgICAgICAgICB2YWx1ZXM6IGQudmFsdWVzLmZpbHRlcihmdW5jdGlvbihkLGkpIHsKKyAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gbGluZXMueCgpKGQsaSkgPj0gZXh0ZW50WzBdICYmIGxpbmVzLngoKShkLGkpIDw9IGV4dGVudFsxXTsKKyAgICAgICAgICAgICAgICAgICAgfSkKKyAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICB9KQorICAgICAgICAgICAgKTsKKyAgICAgICAgZm9jdXNMaW5lc1dyYXAudHJhbnNpdGlvbigpLmR1cmF0aW9uKHRyYW5zaXRpb25EdXJhdGlvbikuY2FsbChsaW5lcyk7CisKKworICAgICAgICAvLyBVcGRhdGUgTWFpbiAoRm9jdXMpIEF4ZXMKKyAgICAgICAgZy5zZWxlY3QoJy5udi1mb2N1cyAubnYteC5udi1heGlzJykudHJhbnNpdGlvbigpLmR1cmF0aW9uKHRyYW5zaXRpb25EdXJhdGlvbikKKyAgICAgICAgICAgIC5jYWxsKHhBeGlzKTsKKyAgICAgICAgZy5zZWxlY3QoJy5udi1mb2N1cyAubnYteS5udi1heGlzJykudHJhbnNpdGlvbigpLmR1cmF0aW9uKHRyYW5zaXRpb25EdXJhdGlvbikKKyAgICAgICAgICAgIC5jYWxsKHlBeGlzKTsKKyAgICAgIH0KKworICAgICAgLy89PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKworCisgICAgfSk7CisKKyAgICByZXR1cm4gY2hhcnQ7CisgIH0KKworCisgIC8vPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisgIC8vIEV2ZW50IEhhbmRsaW5nL0Rpc3BhdGNoaW5nIChvdXQgb2YgY2hhcnQncyBzY29wZSkKKyAgLy8tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0KKworICBsaW5lcy5kaXNwYXRjaC5vbignZWxlbWVudE1vdXNlb3Zlci50b29sdGlwJywgZnVuY3Rpb24oZSkgeworICAgIGUucG9zID0gW2UucG9zWzBdICsgIG1hcmdpbi5sZWZ0LCBlLnBvc1sxXSArIG1hcmdpbi50b3BdOworICAgIGRpc3BhdGNoLnRvb2x0aXBTaG93KGUpOworICB9KTsKKworICBsaW5lcy5kaXNwYXRjaC5vbignZWxlbWVudE1vdXNlb3V0LnRvb2x0aXAnLCBmdW5jdGlvbihlKSB7CisgICAgZGlzcGF0Y2gudG9vbHRpcEhpZGUoZSk7CisgIH0pOworCisgIGRpc3BhdGNoLm9uKCd0b29sdGlwSGlkZScsIGZ1bmN0aW9uKCkgeworICAgIGlmICh0b29sdGlwcykgbnYudG9vbHRpcC5jbGVhbnVwKCk7CisgIH0pOworCisgIC8vPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisKKworICAvLz09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorICAvLyBFeHBvc2UgUHVibGljIFZhcmlhYmxlcworICAvLy0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tL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dW5jdGlvbihfKSB7CisgICAgaWYgKCFhcmd1bWVudHMubGVuZ3RoKSByZXR1cm4gY29sb3I7CisgICAgY29sb3IgPW52LnV0aWxzLmdldENvbG9yKF8pOworICAgIGxlZ2VuZC5jb2xvcihjb2xvcik7CisgICAgcmV0dXJuIGNoYXJ0OworICB9OworCisgIGNoYXJ0LnNob3dMZWdlbmQgPSBmdW5jdGlvbihfKSB7CisgICAgaWYgKCFhcmd1bWVudHMubGVuZ3RoKSByZXR1cm4gc2hvd0xlZ2VuZDsKKyAgICBzaG93TGVnZW5kID0gXzsKKyAgICByZXR1cm4gY2hhcnQ7CisgIH07CisKKyAgY2hhcnQudG9vbHRpcHMgPSBmdW5jdGlvbihfKSB7CisgICAgaWYgKCFhcmd1bWVudHMubGVuZ3RoKSByZXR1cm4gdG9vbHRpcHM7CisgICAgdG9vbHRpcHMgPSBfOworICAgIHJldHVybiBjaGFydDsKKyAgfTsKKworICBjaGFydC50b29sdGlwQ29udGVudCA9IGZ1bmN0aW9uKF8pIHsKKyAgICBpZiAoIWFyZ3VtZW50cy5sZW5ndGgpIHJldHVybiB0b29sdGlwOworICAgIHRvb2x0aXAgPSBfOworICAgIHJldHVybiBjaGFydDsKKyAgfTsKKworICBjaGFydC5pbnRlcnBvbGF0ZSA9IGZ1bmN0aW9uKF8pIHsKKyAgICBpZiAoIWFyZ3VtZW50cy5sZW5ndGgpIHJldHVybiBsaW5lcy5pbnRlcnBvbGF0ZSgpOworICAgIGxpbmVzLmludGVycG9sYXRlKF8pOworICAgIGxpbmVzMi5pbnRlcnBvbGF0ZShfKTsKKyAgICByZXR1cm4gY2hhcnQ7CisgIH07CisKKyAgY2hhcnQubm9EYXRhID0gZnVuY3Rpb24oXykgeworICAgIGlmICghYXJndW1lbnRzLmxlbmd0aCkgcmV0dXJuIG5vRGF0YTsKKyAgICBub0RhdGEgPSBfOworICAgIHJldHVybiBjaGFydDsKKyAgfTsKKworICAvLyBDaGFydCBoYXMgbXVsdGlwbGUgc2ltaWxhciBBeGVzLCB0byBwcmV2ZW50IGNvZGUgZHVwbGljYXRpb24sIHByb2JhYmx5IG5lZWQgdG8gbGluayBhbGwgYXhpcyBmdW5jdGlvbnMgbWFudWFsbHkgbGlrZSBiZWxvdworICBjaGFydC54VGlja0Zvcm1hdCA9IGZ1bmN0aW9uKF8pIHsKKyAgICBpZiAoIWFyZ3VtZW50cy5sZW5ndGgpIHJldHVybiB4QXhpcy50aWNrRm9ybWF0KCk7CisgICAgeEF4aXMudGlja0Zvcm1hdChfKTsKKyAgICB4MkF4aXMudGlja0Zvcm1hdChfKTsKKyAgICByZXR1cm4gY2hhcnQ7CisgIH07CisKKyAgY2hhcnQueVRpY2tGb3JtYXQgPSBmdW5jdGlvbihfKSB7CisgICAgaWYgKCFhcmd1bWVudHMubGVuZ3RoKSByZXR1cm4geUF4aXMudGlja0Zvcm1hdCgpOworICAgIHlBeGlzLnRpY2tGb3JtYXQoXyk7CisgICAgeTJBeGlzLnRpY2tGb3JtYXQoXyk7CisgICAgcmV0dXJuIGNoYXJ0OworICB9OworICAKKyAgY2hhcnQuYnJ1c2hFeHRlbnQgPSBmdW5jdGlvbihfKSB7CisgICAgaWYgKCFhcmd1bWVudHMubGVuZ3RoKSByZXR1cm4gYnJ1c2hFeHRlbnQ7CisgICAgYnJ1c2hFeHRlbnQgPSBfOworICAgIHJldHVybiBjaGFydDsKKyAgfTsKKworICBjaGFydC50cmFuc2l0aW9uRHVyYXRpb24gPSBmdW5jdGlvbihfKSB7CisgICAgaWYgKCFhcmd1bWVudHMubGVuZ3RoKSByZXR1cm4gdHJhbnNpdGlvbkR1cmF0aW9uOworICAgIHRyYW5zaXRpb25EdXJhdGlvbiA9IF87CisgICAgcmV0dXJuIGNoYXJ0OworICB9OworCisgIC8vPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisKKworICByZXR1cm4gY2hhcnQ7Cit9CmRpZmYgLS1naXQgYS9lY29tcC1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09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorCisKKyAgLy89PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKyAgLy8gUHJpdmF0ZSBWYXJpYWJsZXMKKyAgLy8tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0KKworICB2YXIgeDAsIHkwIC8vdXNlZCB0byBzdG9yZSBwcmV2aW91cyBzY2FsZXMKKyAgICAgIDsKKworICAvLz09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorCisKKyAgZnVuY3Rpb24gY2hhcnQoc2VsZWN0aW9uKSB7CisgICAgc2VsZWN0aW9uLmVhY2goZnVuY3Rpb24oZGF0YSkgeworICAgICAgdmFyIGF2YWlsYWJsZVdpZHRoID0gd2lkdGggLSBtYXJnaW4ubGVmdCAtIG1hcmdpbi5yaWdodCwKKyAgICAgICAgICBhdmFpbGFibGVIZWlnaHQgPSBoZWlnaHQgLSBtYXJnaW4udG9wIC0gbWFyZ2luLmJvdHRvbSwKKyAgICAgICAgICBjb250YWluZXIgPSBkMy5zZWxlY3QodGhpcyk7CisKKyAgICAgIGlmKGhpZGVhYmxlICYmIGRhdGEubGVuZ3RoKSBoaWRlYWJsZSA9IFt7CisgICAgICAgIHZhbHVlczogZGF0YVswXS52YWx1ZXMubWFwKGZ1bmN0aW9uKGQpIHsKKyAgICAgICAgcmV0dXJuIHsKKyAgICAgICAgICB4OiBkLngsCisgICAgICAgICAgeTogMCwKKyAgICAgICAgICBzZXJpZXM6IGQuc2VyaWVzLAorICAgICAgICAgIHNpemU6IDAuMDEKKyAgICAgICAgfTt9CisgICAgICApfV07CisKKyAgICAgIGlmIChzdGFja2VkKQorICAgICAgICBkYXRhID0gZDMubGF5b3V0LnN0YWNrKCkKKyAgICAgICAgICAgICAgICAgLm9mZnNldChzdGFja09mZnNldCkKKyAgICAgICAgICAgICAgICAgLnZhbHVlcyhmdW5jdGlvbihkKXsgcmV0dXJuIGQudmFsdWVzIH0pCisgICAgICAgICAgICAgICAgIC55KGdldFkpCisgICAgICAgICAgICAgICAgICghZGF0YS5sZW5ndGggJiYgaGlkZWFibGUgPyBoaWRlYWJsZSA6IGRhdGEpOworCisKKyAgICAgIC8vYWRkIHNlcmllcyBpbmRleCB0byBlYWNoIGRhdGEgcG9pbnQgZm9yIHJlZmVyZW5jZQorICAgICAgZGF0YS5mb3JFYWNoKGZ1bmN0aW9uKHNlcmllcywgaSkgeworICAgICAgICBzZXJpZXMudmFsdWVzLmZvckVhY2goZnVuY3Rpb24ocG9pbnQpIHsKKyAgICAgICAgICBwb2ludC5zZXJpZXMgPSBpOworICAgICAgICB9KTsKKyAgICAgIH0pOworCisKKyAgICAgIC8vLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tCisgICAgICAvLyBIQUNLIGZvciBuZWdhdGl2ZSB2YWx1ZSBzdGFja2luZworICAgICAgaWYgKHN0YWNrZWQpCisgICAgICAgIGRhdGFbMF0udmFsdWVzLm1hcChmdW5jdGlvbihkLGkpIHsKKyAgICAgICAgICB2YXIgcG9zQmFzZSA9IDAsIG5lZ0Jhc2UgPSAwOworICAgICAgICAgIGRhdGEubWFwKGZ1bmN0aW9uKGQpIHsKKyAgICAgICAgICAgIHZhciBmID0gZC52YWx1ZXNbaV0KKyAgICAgICAgICAgIGYuc2l6ZSA9IE1hdGguYWJzKGYueSk7CisgICAgICAgICAgICBpZiAoZi55PDApICB7CisgICAgICAgICAgICAgIGYueTEgPSBuZWdCYXNlOworICAgICAgICAgICAgICBuZWdCYXNlID0gbmVnQmFzZSAtIGYuc2l6ZTsKKyAgICAgICAgICAgIH0gZWxzZQorICAgICAgICAgICAgeworICAgICAgICA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C55ICsgKHN0YWNrZWQgPyBkLnkxIDogMCkgfSkuY29uY2F0KGZvcmNlWSkpKQorICAgICAgeSAgIC5kb21haW4oeURvbWFpbiB8fCBkMy5leHRlbnQoZDMubWVyZ2Uoc2VyaWVzRGF0YSkubWFwKGZ1bmN0aW9uKGQpIHsgcmV0dXJuIHN0YWNrZWQgPyAoZC55ID4gMCA/IGQueTEgOiBkLnkxICsgZC55ICkgOiBkLnkgfSkuY29uY2F0KGZvcmNlWSkpKQorICAgICAgICAgIC5yYW5nZSh5UmFuZ2UgfHwgW2F2YWlsYWJsZUhlaWdodCwgMF0pOworCisgICAgICAvLyBJZiBzY2FsZSdzIGRvbWFpbiBkb24ndCBoYXZlIGEgcmFuZ2UsIHNsaWdodGx5IGFkanVzdCB0byBtYWtlIG9uZS4uLiBzbyBhIGNoYXJ0IGNhbiBzaG93IGEgc2luZ2xlIGRhdGEgcG9pbnQKKyAgICAgIGlmICh4LmRvbWFpbigpWzBdID09PSB4LmRvbWFpbigpWzFdKQorICAgICAgICB4LmRvbWFpbigpWzBdID8KKyAgICAgICAgICAgIHguZG9tYWluKFt4LmRvbWFpbigpWzBdIC0geC5kb21haW4oKVswXSAqIDAuMDEsIHguZG9tYWluKClbMV0gKyB4LmRvbWFpbigpWzFdICogMC4wMV0pCisgICAgICAgICAgOiB4LmRvbWFpbihbLTEsMV0pOworCisgICAgICBpZiAoeS5kb21haW4oKVswXSA9PT0geS5kb21haW4oKVsxXSkKKyAgICAgICAgeS5kb21haW4oKVswXSA/CisgICAgICAgICAgICB5LmRvbWFpbihbeS5kb21haW4oKVswXSArIHkuZG9tYWluKClbMF0gKiAwLjAxLCB5LmRvbWFpbigpWzFdIC0geS5kb21haW4oKVsxXSAqIDAuMDFdKQorICAgICAgICAgIDogeS5kb21haW4oWy0xLDFdKTsKKworCisgICAgICB4MCA9IHgwIHx8IHg7CisgICAgICB5MCA9IHkwIHx8IHk7CisKKyAgICAgIC8vLS0tLS0tLS0tLS0tLS0tLS0tL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HJlY3QnKQorICAgICAgICAgIC5hdHRyKCd3aWR0aCcsIGF2YWlsYWJsZVdpZHRoKQorICAgICAgICAgIC5hdHRyKCdoZWlnaHQnLCBhdmFpbGFibGVIZWlnaHQpOworCisgICAgICBnICAgLmF0dHIoJ2NsaXAtcGF0aCcsIGNsaXBFZGdlID8gJ3VybCgjbnYtZWRnZS1jbGlwLScgKyBpZCArICcpJyA6ICcnKTsKKworCisKKyAgICAgIHZhciBncm91cHMgPSB3cmFwLnNlbGVjdCgnLm52LWdyb3VwcycpLnNlbGVjdEFsbCgnLm52LWdyb3VwJykKKyAgICAgICAgICAuZGF0YShmdW5jdGlvbihkKSB7IHJldHVybiBkIH0sIGZ1bmN0aW9uKGQsaSkgeyByZXR1cm4gaSB9KTsKKyAgICAgIGdyb3Vwcy5lbnRlcigpLmFwcGVuZCgnZycpCisgICAgICAgICAgLnN0eWxlKCdzdHJva2Utb3BhY2l0eScsIDFlLTYpCisgICAgICAgICAgLnN0eWxlKCdmaWxsLW9wYWNpdHknLCAxZS02KTsKKyAgICAgIGdyb3Vwcy5leGl0KCkKKyAgICAgICAgLnRyYW5zaXRpb24oKQorICAgICAgICAuc2VsZWN0QWxsKCdyZWN0Lm52LWJhcicpCisgICAgICAgIC5kZWxheShmdW5jdGlvbihkLGkpIHsKKyAgICAgICAgICAgICByZXR1cm4gaSAqIGRlbGF5LyBkYXRhWzBdLnZhbHVlcy5sZW5ndGg7CisgICAgICAgIH0pCisgICAgICAgICAgLmF0dHIoJ3knLCBmdW5jdGlvbihkKSB7IHJldHVybiBzdGFja2VkID8geTAoZC55MCkgOiB5MCgwKSB9KQorICAgICAgICAgIC5hdHRyKCdoZWlnaHQnLCAwKQorICAgICAgICAgIC5yZW1vdmUoKTsKKyAgICAgIGdyb3VwcworICAgICAgICAgIC5hdHRyKCdjbGFzcycsIGZ1bmN0aW9uKGQsaSkgeyByZXR1cm4gJ252LWdyb3VwIG52LXNlcmllcy0nICsgaSB9KQorICAgICAgICAgIC5j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WFycyB0byBiZSBzaGlmdGVkCisgICAgICAgICAgICAgIHBvaW50SW5kZXg6IGksCisgICAgICAgICAgICAgIHNlcmllc0luZGV4OiBkLnNlcmllcywKKyAgICAgICAgICAgICAgZTogZDMuZXZlbnQKKyAgICAgICAgICAgIH0pOworICAgICAgICAgIH0pCisgICAgICAgICAgLm9uKCdtb3VzZW91dCcsIGZ1bmN0aW9uKGQsaSkgeworICAgICAgICAgICAgZDMuc2VsZWN0KHRoaXMpLmNsYXNzZWQoJ2hvdmVyJywgZmFsc2UpOworICAgICAgICAgICAgZGlzcGF0Y2guZWxlbWVudE1vdXNlb3V0KHsKKyAgICAgICAgICAgICAgdmFsdWU6IGdldFkoZCxpKSwKKyAgICAgICAgICAgICAgcG9pbnQ6IGQsCisgICAgICAgICAgICAgIHNlcmllczogZGF0YVtkLnNlcmllc10sCisgICAgICAgICAgICAgIHBvaW50SW5kZXg6IGksCisgICAgICAgICAgICAgIHNlcmllc0luZGV4OiBkLnNlcmllcywKKyAgICAgICAgICAgICAgZTogZDMuZXZlbnQKKyAgICAgICAgICAgIH0pOworICAgICAgICAgIH0pCisgICAgICAgICAgLm9uKCdjbGljaycsIGZ1bmN0aW9uKGQsaSkgeworICAgICAgICAgICAgZGlzcGF0Y2guZWxlbWVudENsaWNrKHsKKyAgICAgICAgICAgICAgdmFsdWU6IGdldFkoZCxpKSwKKyAgICAgICAgICAgICAgcG9pbnQ6IGQsCisgICAgICAgICAgICAgIHNlcmllczogZGF0YVtkLnNlcmllc10sCisgICAgICAgICAgICAgIHBvczogW3goZ2V0WChkLGkpKSArICh4LnJhbmdlQmFuZCgpICogKHN0YWNrZWQgPyBkYXRhLmxlbmd0aCAvIDIgOiBkLnNlcmllcyArIC41KSAvIGRhdGEubGVuZ3RoKSwgeShnZXRZKGQsaSkgKyAoc3RhY2tlZCA/IGQueTAgOiAwKSldLCAgLy8gVE9ETzogRmlndXJlIG91dCB3aHkgdGhlIHZhbHVlIGFwcGVhcnMgdG8gYmUgc2hpZnRlZAorICAgICAgICAgICAgICBwb2ludEluZGV4OiBpLAorICAgICAgICAgICAgICBzZXJpZXNJbmRleDogZC5zZXJpZXMsCisgICAgICAgICAgICAgIGU6IGQzLmV2ZW50CisgICAgICAgICAgICB9KTsKKyAgICAgICAgICAgIGQzLmV2ZW50LnN0b3BQcm9wYWdhdGlvbigpOworICAgICAgICAgIH0pCisgICAgICAgICAgLm9uKCdkYmxjbGljaycsIGZ1bmN0aW9uKGQsaSkgeworICAgICAgICAgICAgZGlzcGF0Y2guZWxlbWVudERibENsaWNrKHsKKyAgICAgICAgICAgICAgdmFsdWU6IGdldFkoZCxpKSwKKyAgICAgICAgICAgICAgcG9pbnQ6IGQsCisgICAgICAgICAgICAgIHNlcmllczogZGF0YVtkLnNlcmllc10sCisgICAgICAgICAgICAgIHBvczogW3goZ2V0WChkLGkpKSArICh4LnJhbmdlQmFuZCgpICogKHN0YWNrZWQgPyBkYXRhLmxlbmd0aCAvIDIgOiBkLnNlcmllcyArIC41KSAvIGRhdGEubGVuZ3RoKSwgeShnZXRZKGQsaSkgKyAoc3RhY2tlZCA/IGQueTAgOiAwKSldLCAgLy8gVE9ETzogRmlndXJlIG91dCB3aHkgdGhlIHZhbHVlIGFwcGVhcnMgdG8gYmUgc2hpZnRlZAorICAgICAgICAgICAgICBwb2ludEluZGV4OiBpLAorICAgICAgICAgICAgICBzZXJpZXNJbmRleDogZC5zZXJpZXMsCisgICAgICAgICAgICAgIGU6IGQzLmV2ZW50CisgICAgICAgICAgICB9KTsKKyAgICAgICAgICAgIGQzLmV2ZW50LnN0b3BQcm9wYWdhdGlvbigpOworICAgICAgICAgIH0pOworICAgICAgYmFycworICAgICAgICAgIC5hdHRyKCdjbGFzcycsIGZ1bmN0aW9uKGQsaSkgeyByZXR1cm4gZ2V0WShkLGkpIDwgMCA/ICdudi1iYXIgbmVnYXRpdmUnIDogJ252LWJhciBwb3NpdGl2ZSd9KQorICAgICAgICAgIC50cmFuc2l0aW9uKCkKKyAgICAgICAgICAuYXR0cigndHJhbnNmb3JtJywgZnVuY3Rpb24oZCxpKSB7IHJldHVybiAndHJhbnNsYXRlKCcgKyB4KGdldFgoZCxpKSkgKyAnLDApJzsgfSkKKworICAgICAgaWYgKGJhckNvbG9yKSB7CisgICAgICAgIGlmICghZGlzYWJsZWQpIGRpc2FibGVkID0gZGF0YS5tYXAoZnVuY3Rpb24oKSB7IHJldHVybiB0cnVlIH0pOworICAgICAgICBiYXJzCisgICAgICAgICAgLnN0eWxlKCdmaWxsJywgZnVuY3Rpb24oZCxpLGopIHsgcmV0dXJuIGQzLnJnYihiYXJDb2xvcihkLGkpKS5kYXJrZXIoICBkaXNhYmxlZC5tYXAoZnVuY3Rpb24oZCxpKSB7IHJldHVybiBpIH0pLmZpbHRlcihmdW5jdGlvbihkLGkpeyByZXR1cm4gIWRpc2FibGVkW2ldICB9KVtqXSAgICkudG9TdHJpbmcoKTsgfSkKKyAgICAgICAgICAuc3R5bGUoJ3N0cm9rZScsIGZ1bmN0aW9uKGQsaSxqKSB7IHJldHVybiBkMy5yZ2IoYmFyQ29sb3IoZCxpKSkuZGFya2VyKCAgZGlzYWJsZWQubWFwKGZ1bmN0aW9uKGQsaSkgeyByZXR1cm4gaSB9KS5maWx0ZXIoZnVuY3Rpb24oZCxpKXsgcmV0dXJuICFkaXNhYmxlZFtpXSAgfSlbal0gICApLnRvU3RyaW5nKCk7IH0pOworICAgICAgfQorCisKKyAgICAgIGlmIChzdGFja2VkKQorICAgICAgICAgIGJhcnMudHJhbnNpdGlvbigpCisgICAgICAgICAgICAuZGVsYXkoZnVuY3Rpb24oZCxpKSB7CisKKyAgICAgICAgICAgICAgICAgIHJldHVybiBpICogZGVsYXkgLyBkYXRhWzBdLnZhbHVlcy5sZW5ndGg7CisgICAgICAgICAgICB9KQorICAgICAgICAgICAgLmF0dHIoJ3knLCBmdW5jdGlvbihkLGkpIHsKKworICAgICAgICAgICAgICByZXR1cm4geSgoc3RhY2tlZCA/IGQueTEgOiAwKSk7CisgICAgICAgICAgICB9KQorICAgICAgICAgICAgLmF0dHIoJ2hlaWdodCcsIGZ1bmN0aW9uKGQsaSkgeworICAgICAgICAgICAgICByZXR1cm4gTWF0aC5tYXgoTWF0aC5hYnMoeShkLnkgKyAoc3RhY2tlZCA/IGQueTAgOiAwKSkgLSB5KChzdGFja2VkID8gZC55MCA6IDApKSksMSk7CisgICAgICAgICAgICB9KQorICAgICAgICAgICAgLmF0dHIoJ3gnLCBmdW5jdGlvbihkLGkpIHsKKyAgICAgICAgICAgICAgICAgIHJldHVybiBzdGFja2VkID8gMCA6IChkLnNlcmllcyAqIHgucmFuZ2VCYW5kKCkgLyBkYXRhLmxlbmd0aCApCisgICAgICAgICAgICB9KQorICAgICAgICAgICAgLmF0dHIoJ3dpZHRoJywgeC5yYW5nZUJhbmQoKSAvIChzdGFja2VkID8gMSA6IGRhdGEubGVuZ3RoKSApOworICAgICAgZWxzZQorICAgICAgICAgIGJhcnMudHJhbnNpdGlvbigpCisgICAgICAgICAgICAuZGVsYXkoZnVuY3Rpb24oZCxpKSB7CisgICAgICAgICAgICAgICAgcmV0dXJuIGkgKiBkZWxheS8gZGF0YVswXS52YWx1ZXMubGVuZ3RoOworICAgICAgICAgICAgfSkKKyAgICAgICAgICAgIC5hdHRyKCd4JywgZnVuY3Rpb24oZCxpKSB7CisgICAgICAgICAgICAgIHJldHVybiBkLnNlcmllcyAqIHgucmFuZ2VCYW5kKCkgLyBkYXRhLmxlbmd0aAorICAgICAgICAgICAgfSkKKyAgICAgICAgICAgIC5hdHRyKCd3aWR0aCcsIHgucmFuZ2VCYW5kKCkgLyBkYXRhLmxlbmd0aCkKKyAgICAgICAgICAgIC5hdHRyKCd5JywgZnVuY3Rpb24oZCxpKSB7CisgICAgICAgICAgICAgICAgcmV0dXJuIGdldFkoZCxpKSA8IDAgPworICAgICAgICAgICAgICAgICAgICAgICAgeSgwKSA6CisgICAgICAgICAgICAgICAgICAgICAgICB5KDApIC0geShnZXRZKGQsaSkpIDwgMSA/CisgICAgICAgICAgICAgICAgICAgICAgICAgIHkoMCkgLSAxIDoKKyAgICAgICAgICAgICAgICAgICAgICAgIHkoZ2V0WShkLGkpKSB8fCAwOworICAgICAgICAgICAgfSkKKyAgICAgICAgICAgIC5hdHRyKCdoZWlnaHQnLCBmdW5jdGlvbihkLGkpIHsKKyAgICAgICAgICAgICAgICByZXR1cm4gTWF0aC5tYXgoTWF0aC5hYnMoeShnZXRZKGQsaSkpIC0geSgwKSksMSkgfHwgMDsKKyAgICAgICAgICAgIH0pOworCisKKworICAgICAgLy9zdG9yZSBvbGQgc2NhbGVzIGZvciB1c2UgaW4gdHJhbnNpdGlvbnMgb24gdXBkYXRlCisgICAgICB4MCA9IHguY29weSgpOworICAgICAgeTAgPSB5LmNvcHkoKTsKKworICAgIH0pOworCisgICAgcmV0dXJuIGNoYXJ0OworICB9CisKKworICAvLz09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorICAvLyBFeHBvc2UgUHVibGljIFZhcmlhYmxlcworICAvLy0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLQorCisgIGNoYXJ0LmRpc3BhdGNoID0gZGlzcGF0Y2g7CisKKyAgY2hhcnQub3B0aW9ucyA9IG52LnV0aWxzLm9wdGlvbnNGdW5jLmJpbmQoY2hhcnQpOworCisgIGNoYXJ0LnggPSBmdW5jdGlvbihfKSB7CisgICAgaWYgKCFhcmd1bWVudHMubGVuZ3RoKSByZXR1cm4gZ2V0WDsKKyAgICBnZXRYID0gXzsKKyAgICByZXR1cm4gY2hhcnQ7CisgIH07CisKKyAgY2hhcnQueSA9IGZ1bmN0aW9uKF8pIHsKKyAgICBpZiAoIWFyZ3VtZW50cy5sZW5ndGgpIHJldHVybiBnZXRZOworICAgIGdldFkgPSBfOworICAgIHJldHVybiBjaGFydDsKKyAgfTsKKworICBj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87CisgICAgcmV0dXJuIGNoYXJ0OworICB9OworCisgIGNoYXJ0LnhEb21haW4gPSBmdW5jdGlvbihfKSB7CisgICAgaWYgKCFhcmd1bWVudHMubGVuZ3RoKSByZXR1cm4geERvbWFpbjsKKyAgICB4RG9tYWluID0gXzsKKyAgICByZXR1cm4gY2hhcnQ7CisgIH07CisKKyAgY2hhcnQueURvbWFpbiA9IGZ1bmN0aW9uKF8pIHsKKyAgICBpZiAoIWFyZ3VtZW50cy5sZW5ndGgpIHJldHVybiB5RG9tYWluOworICAgIHlEb21haW4gPSBfOworICAgIHJldHVybiBjaGFydDsKKyAgfTsKKworICBjaGFydC54UmFuZ2UgPSBmdW5jdGlvbihfKSB7CisgICAgaWYgKCFhcmd1bWVudHMubGVuZ3RoKSByZXR1cm4geFJhbmdlOworICAgIHhSYW5nZSA9IF87CisgICAgcmV0dXJuIGNoYXJ0OworICB9OworCisgIGNoYXJ0LnlSYW5nZSA9IGZ1bmN0aW9uKF8pIHsKKyAgICBpZiAoIWFyZ3VtZW50cy5sZW5ndGgpIHJldHVybiB5UmFuZ2U7CisgICAgeVJhbmdlID0gXzsKKyAgICByZXR1cm4gY2hhcnQ7CisgIH07CisKKyAgY2hhcnQuZm9yY2VZID0gZnVuY3Rpb24oXykgeworICAgIGlmICghYXJndW1lbnRzLmxlbmd0aCkgcmV0dXJuIGZvcmNlWTsKKyAgICBmb3JjZVkgPSBfOworICAgIHJldHVybiBjaGFydDsKKyAgfTsKKworICBjaGFydC5zdGFja2VkID0gZnVuY3Rpb24oXykgeworICAgIGlmICghYXJndW1lbnRzLmxlbmd0aCkgcmV0dXJuIHN0YWNrZWQ7CisgICAgc3RhY2tlZCA9IF87CisgICAgcmV0dXJuIGNoYXJ0OworICB9OworCisgIGNoYXJ0LnN0YWNrT2Zmc2V0ID0gZnVuY3Rpb24oXykgeworICAgIGlmICghYXJndW1lbnRzLmxlbmd0aCkgcmV0dXJuIHN0YWNrT2Zmc2V0OworICAgIHN0YWNrT2Zm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sIHN0YXRlID0geyBzdGFja2VkOiBmYWxzZSB9CisgICAgLCBkZWZhdWx0U3RhdGUgPSBudWxsCisgICAgLCBub0RhdGEgPSAiTm8gRGF0YSBBdmFpbGFibGUuIgorICAgICwgZGlzcGF0Y2ggPSBkMy5kaXNwYXRjaCgndG9vbHRpcFNob3cnLCAndG9vbHRpcEhpZGUnLCAnc3RhdGVDaGFuZ2UnLCAnY2hhbmdlU3RhdGUnKQorICAgICwgY29udHJvbFdpZHRoID0gZnVuY3Rpb24oKSB7IHJldHVybiBzaG93Q29udHJvbHMgPyAxODAgOiAwIH0KKyAgICAsIHRyYW5zaXRpb25EdXJhdGlvbiA9IDI1MAorICAgIDsKKworICBtdWx0aWJhcgorICAgIC5zdGFja2VkKGZhbHNlKQorICAgIDsKKyAgeEF4aXMKKyAgICAub3JpZW50KCdib3R0b20nKQorICAgIC50aWNrUGFkZGluZyg3KQorICAgIC5oaWdobGlnaHRaZXJvKHRydWUpCisgICAgLnNob3dNYXhNaW4oZmFsc2UpCisgICAgLnRpY2tGb3JtYXQoZnVuY3Rpb24oZCkgeyByZXR1cm4gZCB9KQorICAgIDsKKyAgeUF4aXMKKyAgICAub3JpZW50KChyaWdodEFsaWduWUF4aXMpID8gJ3JpZ2h0JyA6ICdsZWZ0JykKKyAgICAudGlja0Zvcm1hdChkMy5mb3JtYXQoJywuMWYnKSkKKyAgICA7CisKKyAgY29udHJvbHMudXBkYXRlU3RhdGUoZmFsc2UpOworICAvLz09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorCisKKyAgLy89PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKyAgLy8gUHJpdmF0ZSBWYXJpYWJsZXMKKyAgLy8tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0KKworICB2YXIgc2hvd1Rvb2x0aXAgPSBmdW5jdGlvbihlLCBvZmZzZXRFbGVtZW50KSB7CisgICAgdmFyIGxlZnQgPSBlLnBvc1swXSArICggb2Zmc2V0RWxlbWVudC5vZmZzZXRMZWZ0IHx8IDAgKSwKKyAgICAgICAgdG9wID0gZS5wb3NbMV0gKyAoIG9mZnNldEVsZW1lbnQub2Zmc2V0VG9wIHx8IDApLAorICAgICAgICB4ID0geEF4aXMudGlja0Zvcm1hdCgpKG11bHRpYmFyLngoKShlLnBvaW50LCBlLnBvaW50SW5kZXgpKSwKKyAgICAgICAgeSA9IHlBeGlzLnRpY2tGb3JtYXQoKShtdWx0aWJhci55KCkoZS5wb2ludCwgZS5wb2ludEluZGV4KSksCisgICAgICAgIGNvbnRlbnQgPSB0b29sdGlwKGUuc2VyaWVzLmtleSwgeCwgeSwgZSwgY2hhcnQpOworCisgICAgbnYudG9vbHRpcC5zaG93KFtsZWZ0LCB0b3BdLCBjb250ZW50LCBlLnZhbHVlIDwgMCA/ICduJyA6ICdzJywgbnVsbCwgb2Zmc2V0RWxlbWVudCk7CisgIH07CisKKyAgLy89PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKworCisgIGZ1bmN0aW9uIGNoYXJ0KHNlbGVjdGlvbikgeworICAgIHNlbGVjdGlvbi5lYWNoKGZ1bmN0aW9uKGRhdGEpIHsKKyAgICAgIHZhciBjb250YWluZXIgPSBkMy5zZWxlY3QodGhpcyksCisgICAgICAgICAgdGhhdCA9IHRoaXM7CisKKyAgICAgIHZhciBhdmFpbGFibGVXaWR0aCA9ICh3aWR0aCAgfHwgcGFyc2VJbnQoY29udGFpbmVyLnN0eWxlKCd3aWR0aCcpKSB8fCA5NjApCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC0gbWFyZ2luLmxlZnQgLSBtYXJnaW4ucmlnaHQsCisgICAgICAgICAgYXZhaWxhYmxlSGVpZ2h0ID0gKGhlaWdodCB8fC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5sZW5ndGggfSkubGVuZ3RoKSB7CisgICAgICAgIHZhciBub0RhdGFUZXh0ID0gY29udGFpbmVyLnNlbGVjdEFsbCgnLm52LW5vRGF0YScpLmRhdGEoW25vRGF0YV0pOworCisgICAgICAgIG5vRGF0YVRleHQuZW50ZXIoKS5hcHBlbmQoJ3RleHQnKQorICAgICAgICAgIC5hdHRyKCdjbGFzcycsICdudmQzIG52LW5vRGF0YScpCisgICAgICAgICAgLmF0dHIoJ2R5JywgJy0uN2VtJykKKyAgICAgICAgICAuc3R5bGUoJ3RleHQtYW5jaG9yJywgJ21pZGRsZScpOworCisgICAgICAgIG5vRGF0YVRleHQKKyAgICAgICAgICAuYXR0cigneCcsIG1hcmdpbi5sZWZ0ICsgYXZhaWxhYmxlV2lkdGggLyAyKQorICAgICAgICAgIC5hdHRyKCd5JywgbWFyZ2luLnRvcCArIGF2YWlsYWJsZUhlaWdodCAvIDIpCisgICAgICAgICAgLnRleHQoZnVuY3Rpb24oZCkgeyByZXR1cm4gZCB9KTsKKworICAgICAgICByZXR1cm4gY2hhcnQ7CisgICAgICB9IGVsc2UgeworICAgICAgICBjb250YWluZXIuc2VsZWN0QWxsKCcubnYtbm9EYXRhJykucmVtb3ZlKCk7CisgICAgICB9CisKKyAgICAgIC8vLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tCisKKworICAgICAgLy8tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0KKyAgICAgIC8vIFNldHVwIFNjYWxlcworCisgICAgICB4ID0gbXVsdGliYXIueFNjYWxlKCk7CisgICAgICB5ID0gbXVsdGliYXIueVNjYWxlKCk7CisKKyAgICAgIC8vLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tCis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0tLQorICAgICAgLy8gQ29udHJvbHMKKworICAgICAgaWYgKHNob3dDb250cm9scykgeworICAgICAgICB2YXIgY29udHJvbHNEYXRhID0gWworICAgICAgICAgIHsga2V5OiAnR3JvdXBlZCcsIGRpc2FibGVkOiBtdWx0aWJhci5zdGFja2VkKCkgfSwKKyAgICAgICAgICB7IGtleTogJ1N0YWNrZWQnLCBkaXNhYmxlZDogIW11bHRpYmFyLnN0YWNrZWQoKSB9CisgICAgICAgIF07CisKKyAgICAgICAgY29udHJvbHMud2lkdGgoY29udHJvbFdpZHRoKCkpLmNvbG9yKFsnIzQ0NCcsICcjNDQ0JywgJyM0NDQnXSk7CisgICAgICAgIGcuc2VsZWN0KCcubnYtY29udHJvbHNXcmFwJykKKyAgICAgICAgICAgIC5kYXR1bShjb250cm9sc0RhdGEpCisgICAgICAgICAgICAuYXR0cigndHJhbnNmb3JtJywgJ3RyYW5zbGF0ZSgwLCcgKyAoLW1hcmdpbi50b3ApICsnKScpCisgICAgICAgICAgICAuY2FsbChjb250cm9scyk7CisgICAgICB9CisKKyAgICAgIC8vLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tCisKKworICAgICAgd3JhcC5hdHRyKCd0cmFuc2Zvcm0nLCAndHJhbnNsYXRlKCcgKyBtYXJnaW4ubGVmdCArICcsJyArIG1hcmdpbi50b3AgKyAnKScpOworCisgICAgICBpZiAocmlnaHRBbGlnbllBeGlzKSB7CisgICAgICAgICAgZy5zZWxlY3QoIi5udi15Lm52LWF4aXMiKQorICAgICAgICAgICAgICAuYXR0cigidHJhbnNmb3JtIiwgInRyYW5zbGF0ZSgiICsgYXZhaWxhYmxlV2lkdGggKyAiLDApIik7CisgICAgICB9CisKKyAgICAgIC8vLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tCisgICAgICAvLyBNYWluIENoYXJ0IENvbXBvbmVudChzKQorCisgICAgICBtdWx0aWJhcgorICAgICAgICAuZGlzYWJsZWQoZGF0YS5tYXAoZnVuY3Rpb24oc2VyaWVzKSB7IHJldHVybiBzZXJpZXMuZGlzYWJsZWQgfSkpCisgICAgICAgIC53aWR0aChhdmFpbGFibGVXaWR0aCkKKyAgICAgICAgLmhlaWdodChhdmFpbGFibGVIZWlnaHQpCisgICAgICAgIC5jb2xvcihkYXRhLm1hcChmdW5jdGlvbihkLGkpIHsKKyAgICAgICAgICByZXR1cm4gZC5jb2xvciB8fCBjb2xvcihkLCBpKTsKKyAgICAgICAgfSkuZmlsdGVyKGZ1bmN0aW9uKGQsaSkgeyByZXR1cm4gIWRhdGFbaV0uZGlzYWJsZWQgfSkpCisKKworICAgICAgdmFyIGJhcnNXcmFwID0gZy5zZWxlY3QoJy5udi1iYXJzV3JhcCcpCisgICAgICAgICAgLmRhdHVtKGRhdGEuZmlsdGVyKGZ1bmN0aW9uKGQpIHsgcmV0dXJuICFkLmRpc2FibGVkIH0pKQorCisgICAgICBiYXJzV3JhcC50cmFuc2l0aW9uKCkuY2FsbChtdWx0aWJhcik7CisKKyAgICAgIC8vLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tCisKKworICAgICAgLy8tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0KKyAgICAgIC8vIFNldHVwIEF4ZXMKKworICAgICAgaWYgKHNob3dYQXhpcykgeworICAgICAgICAgIHhBeGlzCisgICAgICAgICAgICAuc2NhbGUoeCkKKyAgICAgICAgICAgIC50aWNrcyggYXZhaWxhYmxlV2lkdGggLyAxMDAgKQorICAgICAgICAgICAgLnRpY2tTaXplKC1hdmFpbGFibGVIZWlnaHQsIDApOworCisgICAgICAgICAgZy5zZWxlY3QoJy5udi14Lm52LWF4aXMnKQorICAgICAgICAgICAgICAuYXR0cigndHJhbnNmb3JtJywgJ3RyYW5zbGF0ZSgwLCcgKyB5LnJhbmdlKClbMF0gKyAnKScpOworICAgICAgICAgIGcuc2VsZWN0KCcubnYteC5udi1heGlzJykudHJhbnNpdGlvbigpCisgICAgICAgICAgICAgIC5jYWxsKHhBeGlzKTsKKworICAgICAgICAgIHZhciB4VGlja3MgPSBnLnNlbGVjdCgnLm52LXgubnYtYXhpcyA+IGcnKS5zZWxlY3RBbGwoJ2cnKTsKKworICAgICAgICAgIHhUaWNrcworICAgICAgICAgICAgICAuc2VsZWN0QWxsKCdsaW5lLCB0ZXh0JykKKyAgICAgICAgICAgICAgLnN0eWxlKCdvcGFjaXR5JywgMSkKKworICAgICAgICAgIGlmIChzdGFnZ2VyTGFiZWxzKSB7CisgICAgICAgICAgICAgIHZhciBnZXRUcmFuc2xhdGUgPSBmdW5jdGlvbih4LHkpIHsKKyAgICAgICAgICAgICAgICAgIHJldHVybiAidHJhbnNsYXRlKCIgKyB4ICsgIiwiICsgeSArICIpIjsKKyAgICAgICAgICAgICAgfTsKKworICAgICAgICAgICAgICB2YXIgc3RhZ2dlclVwID0gNSwgc3RhZ2dlckRvd24gPSAxNzsgIC8vcGl4ZWxzIHRvIHN0YWdnZXIgYnkKKyAgICAgICAgICAgICAgLy8gSXNzdWUgIzE0MAorICAgICAgICAgICAgICB4VGlja3MKKyAgICAgICAgICAgICAgICAuc2VsZWN0QWxsKCJ0ZXh0IikKKyAgICAgICAgICAgICAgICAuYXR0cigndHJhbnNmb3JtJywgZnVuY3Rpb24oZCxpLGopIHsgCisgICAgICAgICAgICAgICAgICAgIHJldHVybiAgZ2V0VHJhbnNsYXRlKDAsIChqICUgMiA9PSAwID8gc3RhZ2dlclVwIDogc3RhZ2dlckRvd24pKTsKKyAgICAgICAgICAgICAgICAgIH0pOworCisgICAgICAgICAgICAgIHZhciB0b3RhbEluQmV0d2VlblRpY2tzID0gZDMuc2VsZWN0QWxsKCIubnYteC5udi1heGlzIC5udi13cmFwIGcgZyB0ZXh0IilbMF0ubGVuZ3RoOworICAgICAgICAgICAgICBnLnNlbGVjdEFsbCgiLm52LXgubnYtYXhpcyAubnYtYXhpc01heE1pbiB0ZXh0IikKKyAgICAgICAgICAgICAgICAuYXR0cigidHJhbnNmb3JtIiwgZnVuY3Rpb24oZCxpKSB7CisgICAgICAgICAgICAgICAgICAgIHJldHVybiBnZXRUcmFuc2xhdGUoMCwgKGkgPT09IDAgfHwgdG90YWxJbkJldHdlZW5UaWNrcyAlIDIgIT09IDApID8gc3RhZ2dlckRvd24gOiBzdGFnZ2VyVXApOworICAgICAgICAgICAgICAgIH0pOworICAgICAgICAgIH0KKworICAgICAgICAgIGlmIChyZWR1Y2VYVGlja3MpCisgICAgICAgICAgICB4VGlja3MKKyAgICAgICAgICAgICAgLmZpbHRlcihmdW5jdGlvbihkLGkpIHsKKyAgICAgICAgICAgICAgICAgIHJldHVybiBpICUgTWF0aC5jZWlsKGRhdGFbMF0udmFsdWVzLmxlbmd0aCAvIChhdmFpbGFibGVXaWR0aCAvIDEwMCkpICE9PSAwOworICAgICAgICAgICAgICAgIH0pCisgICAgICAgICAgICAgIC5zZWxlY3RBbGwoJ3RleHQsIGxpbmUnKQorICAgICAgICAgICAgICAuc3R5bGUoJ29wYWNpdHknLCAwKTsKKworICAgICAgICAgIGlmKHJvdGF0ZUxhYmVscykKKyAgICAgICAgICAgIHhUaWNrcworICAgICAgICAgICAgICAuc2VsZWN0QWxsKCcudGljayB0ZXh0JykKKyAgICAgICAgICAgICAgLmF0dHIoJ3RyYW5zZm9ybScsICdyb3RhdGUoJyArIHJvdGF0ZUxhYmVscyArICcgMCwwKScpCisgICAgICAgICAgICAgIC5zdHlsZSgndGV4dC1hbmNob3InLCByb3RhdGVMYWJlbHMgPiAwID8gJ3N0YXJ0JyA6ICdlbmQnKTsKKyAgICAgICAgICAKKyAgICAgICAgICBnLnNlbGVjdCgnLm52LXgubnYtYXhpcycpLnNlbGVjdEFsbCgnZy5udi1heGlzTWF4TWluIHRleHQnKQorICAgICAgICAgICAgICAuc3R5bGUoJ29wYWNpdHknLCAxKTsKKyAgICAgIH0KKworCisgICAgICBpZiAoc2hvd1lBeGlzKSB7ICAgICAgCisgICAgICAgICAgeUF4aXMKKyAgICAgICAgICAgIC5zY2FsZSh5KQorICAgICAgICAgICAgLnRpY2tzKCBhdmFpbGFibGVIZWlnaHQgLyAzNiApCisgICAgICAgICAgICAudGlja1NpemUoIC1hdmFpbGFibGVXaWR0aCwgMCk7CisKKyAgICAgICAgICBnLnNlbGVjdCgnLm52LXkubnYtYXhpcycpLnRyYW5zaXRpb24oKQorICAgICAgICAgICAgICAuY2FsbCh5QXhpcyk7CisgICAgICB9CisKKworICAgICAgLy8tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0KKworCisKKyAgICAgIC8vPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisgICAgICAvLyBFdmVudCBIYW5kbGluZy9EaXNwYXRjaGluZyAoaW4gY2hhcnQncyBzY29wZSkKKyAgICAgIC8vLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tCisKKyAgICAgIGxlZ2VuZC5kaXNwYXRjaC5vbignc3RhdGVDaGFuZ2UnLCBmdW5jdGlvbihuZXdTdGF0ZSkgeyAKKyAgICAgICAgc3RhdGUgPSBuZXdTdGF0ZTsKKyAgICAgICAgZGlzcGF0Y2guc3RhdGVDaGFuZ2Uoc3RhdGUpOworICAgICAgICBjaGFydC51cGRhdGUoKTsKKyAgICAgIH0pOworCisgICAgICBjb250cm9scy5kaXNwYXRjaC5vbignbGVnZW5kQ2xpY2snLCBmdW5jdGlvbihkLGkpIHsKKyAgICAgICAgaWYgKCFkLmRpc2FibGVkKSByZXR1cm47CisgICAgICAgIGNvbnRyb2xzRGF0YSA9IGNvbnRyb2xzRGF0YS5tYXAoZnVuY3Rpb24ocykgeworICAgICAgICAgIHMuZGlzYWJsZWQgPSB0cnVlOworICAgICAgICAgIHJldHVybiBzOworICAgICAgICB9KTsKKyAgICAgICAgZC5kaXNhYmxlZCA9IGZhbHNlOworCisgICAgICAgIHN3aXRjaCAoZC5rZXkpIHsKKyAgICAgICAgICBjYXNlICdHcm91cGVkJzoKKyAgICAgICAgICAgIG11bHRpYmFyLnN0YWNrZWQoZmFsc2UpOworICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgY2FzZSAnU3RhY2tlZCc6CisgICAgICAgICAgICBtdWx0aWJhci5zdGFja2VkKHRydWUpOworICAgICAgICAgICAgYnJlYWs7CisgICAgICAgIH0KKworICAgICAgICBzdGF0ZS5zdGFja2VkID0gbXVsdGliYXIuc3RhY2tlZCgpOworICAgICAgICBkaXNwYXRjaC5zdGF0ZUNoYW5nZShzdGF0ZSk7CisKKyAgICAgICAgY2hhcnQudXBkYXRlKCk7CisgICAgICB9KTsKKworICAgICAgZGlzcGF0Y2gub24oJ3Rvb2x0aXBTaG93JywgZnVuY3Rpb24oZSkgeworICAgICAgICBpZiAodG9vbHRpcHMpIHNob3dUb29sdGlwKGUsIHRoYXQucGFyZW50Tm9kZSkKKyAgICAgIH0pOworCisgICAgICAvLyBVcGRhdGUgY2hhcnQgZnJvbSBhIHN0YXRlIG9iamVjdCBwYXNzZWQgdG8gZXZlbnQgaGFuZGxlcgorICAgICAgZGlzcGF0Y2gub24oJ2NoYW5nZVN0YXRlJywgZnVuY3Rpb24oZSkgeworCisgICAgICAgIGlmICh0eXBlb2YgZS5kaXNhYmxlZCAhPT0gJ3VuZGVmaW5lZCcpIHsKKyAgICAgICAgICBkYXRhLmZvckVhY2goZnVuY3Rpb24oc2VyaWVzLGkpIHsKKyAgICAgICAgICAgIHNlcmllcy5kaXNhYmxlZCA9IGUuZGlzYWJsZWRbaV07CisgICAgICAgICAgfSk7CisKKyAgICAgICAgICBzdGF0ZS5kaXNhYmxlZCA9IGUuZGlzYWJsZWQ7CisgICAgICAgIH0KKworICAgICAgICBpZiAodHlwZW9mIGUuc3RhY2tlZCAhPT0gJ3VuZGVmaW5lZCcpIHsKKyAgICAgICAgICBtdWx0aWJhci5zdGFja2VkKGUuc3RhY2tlZCk7CisgICAgICAgICAgc3RhdGUuc3RhY2tlZCA9IGUuc3RhY2tlZDsKKyAgICAgICAgfQorCisgICAgICAgIGNoYXJ0LnVwZGF0ZSgpOworICAgICAgfSk7CisKKyAgICAgIC8vPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisKKworICAgIH0pOworCisgICAgcmV0dXJuIGNoYXJ0OworICB9CisKKworICAvLz09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorICAvLyBFdmVudCBIYW5kbGluZy9EaXNwYXRjaGluZyAob3V0IG9mIGNoYXJ0J3Mgc2NvcGUpCisgIC8vLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tCisKKyAgbXVsdGliYXIuZGlzcGF0Y2gub24oJ2VsZW1lbnRNb3VzZW92ZXIudG9vbHRpcCcsIGZ1bmN0aW9uKGUpIHsKKyAgICBlLnBvcyA9IFtlLnBvc1swXSArICBtYXJnaW4ubGVmdCwgZS5wb3NbMV0gKyBtYXJnaW4udG9wXTsKKyAgICBkaXNwYXRjaC50b29sdGlwU2hvdyhlKTsKKyAgfSk7CisKKyAgbXVsdGliYXIuZGlzcGF0Y2gub24oJ2VsZW1lbnRNb3VzZW91dC50b29sdGlwJywgZnVuY3Rpb24oZSkgeworICAgIGRpc3BhdGNoLnRvb2x0aXBIaWRlKGUpOworICB9KTsKKyAgZGlzcGF0Y2gub24oJ3Rvb2x0aXBIaWRlJywgZnVuY3Rpb24oKSB7CisgICAgaWYgKHRvb2x0aXBzKSBudi50b29sdGlwLmNsZWFudXAoKTsKKyAgfSk7CisKKyAgLy89PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKworCisgIC8vPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisgIC8vIEV4cG9zZSBQdWJsaWMgVmFyaWFibGVzCisgIC8vLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tCisKKyAgLy8gZXhwb3NlIGNoYXJ0J3Mgc3ViLWNvbXBvbmVudHMKKyAgY2hhcnQuZGlzcGF0Y2ggPSBkaXNwYXRjaDsKKyAgY2hhcnQubXVsdGliYXIgPSBtdWx0aWJhcjsKKyAgY2hhcnQubGVnZW5kID0gbGVnZW5kOworICBjaGFydC54QXhpcyA9IHhBeGlzOworICBjaGFydC55QXhpcyA9IHlBeGlzOworCisgIGQzLnJlYmluZChjaGFydCwgbXVsdGliYXIsICd4JywgJ3knLCAneERvbWFpbicsICd5RG9tYWluJywgJ3hSYW5nZScsICd5UmFuZ2UnLCAnZm9yY2VYJywgJ2ZvcmNlWScsICdjbGlwRWRnZScsCisgICAnaWQnLCAnc3RhY2tlZCcsICdzdGFja09mZnNldCcsICdkZWxheScsICdiYXJDb2xvcicsJ2dyb3VwU3BhY2luZycpOworCisgIGNoYXJ0Lm9wdGlvbnMgPSBudi51dGlscy5vcHRpb25zRnVuYy5iaW5kKGNoYXJ0KTsKKyAgCisgIGNoYXJ0Lm1hcmdpbiA9IGZ1bmN0aW9uKF8pIHsKKyAgICBpZiAoIWFyZ3VtZW50cy5sZW5ndGgpIHJldHVybiBtYXJnaW47CisgICAgbWFyZ2luLnRvcCAgICA9IHR5cGVvZiBfLnRvcCAgICAhPSAndW5kZWZpbmVkJyA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ZnVuY3Rpb24oXykgeworICAgIGlmICghYXJndW1lbnRzLmxlbmd0aCkgcmV0dXJuIHNob3dMZWdlbmQ7CisgICAgc2hvd0xlZ2VuZCA9IF87CisgICAgcmV0dXJuIGNoYXJ0OworICB9OworCisgIGNoYXJ0LnNob3dYQXhpcyA9IGZ1bmN0aW9uKF8pIHsKKyAgICBpZiAoIWFyZ3VtZW50cy5sZW5ndGgpIHJldHVybiBzaG93WEF4aXM7CisgICAgc2hvd1hBeGlzID0gXzsKKyAgICByZXR1cm4gY2hhcnQ7CisgIH07CisKKyAgY2hhcnQuc2hvd1lBeGlzID0gZnVuY3Rpb24oXykgeworICAgIGlmICghYXJndW1lbnRzLmxlbmd0aCkgcmV0dXJuIHNob3dZQXhpczsKKyAgICBzaG93WUF4aXMgPSBfOworICAgIHJldHVybiBjaGFydDsKKyAgfTsKKworICBjaGFydC5yaWdodEFsaWduWUF4aXMgPSBmdW5jdGlvbihfKSB7CisgICAgaWYoIWFyZ3VtZW50cy5sZW5ndGgpIHJldHVybiByaWdodEFsaWduWUF4aXM7CisgICAgcmlnaHRBbGlnbllBeGlzID0gXzsKKyAgICB5QXhpcy5vcmllbnQoIChfKSA/ICdyaWdodCcgOiAnbGVmdCcpOworICAgIHJldHVybiBjaGFydDsKKyAgfTsKKworICBjaGFydC5yZWR1Y2VYVGlja3M9IGZ1bmN0aW9uKF8pIHsKKyAgICBpZiAoIWFyZ3VtZW50cy5sZW5ndGgpIHJldHVybiByZWR1Y2VYVGlja3M7CisgICAgcmVkdWNlWFRpY2tzID0gXzsKKyAgICByZXR1cm4gY2hhcnQ7CisgIH07CisKKyAgY2hhcnQucm90YXRlTGFiZWxzID0gZnVuY3Rpb24oXykgeworICAgIGlmICghYXJndW1lbnRzLmxlbmd0aCkgcmV0dXJuIHJvdGF0ZUxhYmVsczsKKyAgICByb3RhdGVMYWJlbHMgPSBfOworICAgIHJldHVybiBjaGFydDsKKyAgfQorCisgIGNoYXJ0LnN0YWdnZXJMYWJlb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zsKKyAgICByZXR1cm4gY2hhcnQ7CisgIH07CisKKyAgY2hhcnQudHJhbnNpdGlvbkR1cmF0aW9uID0gZnVuY3Rpb24oXykgeworICAgIGlmICghYXJndW1lbnRzLmxlbmd0aCkgcmV0dXJuIHRyYW5zaXRpb25EdXJhdGlvbjsKKyAgICB0cmFuc2l0aW9uRHVyYXRpb24gPSBfOworICAgIHJldHVybiBjaGFydDsKKyAgfTsKKworICAvLz09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorCisKKyAgcmV0dXJuIGNoYXJ0OworfQpkaWZmIC0tZ2l0IGEvZWNvbXAtcG9ydGFsLUJFL3dhci9zdGF0aWMvZnVzaW9uL2QzL2pzL21vZGVscy9tdWx0aUJhckhvcml6b250YWwuanMgYi9lY29tcC1wb3J0YWwtQkUvd2FyL3N0YXRpYy9mdXNpb24vZDMvanMvbW9kZWxzL211bHRpQmFySG9yaXpvbnRhbC5qcwpuZXcgZmlsZSBtb2RlIDEwMDY0NAppbmRleCAwMDAwMDAwLi5kMTZkNDYwCi0tLSAvZGV2L251bGwKKysrIGIvZWNvbXAtcG9ydGFsLUJFL3dhci9zdGF0aWMvZnVzaW9uL2QzL2pzL21vZGVscy9tdWx0aUJhckhvcml6b250YWwuanMKQEAgLTAsMCArMSw0MjQgQEAKKworbnYubW9kZWxzLm11bHRpQmFySG9yaXpvbnRhbCA9IGZ1bmN0aW9uKCkgeworICAidXNlIHN0cmljdCI7CisgIC8vPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisgIC8vIFB1YmxpYyBWYXJpYWJsZXMgd2l0aCBEZWZhdWx0IFNldHRpbmdzCisgIC8vLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tCisKKyAgdmFyIG1hcmdpbiA9IHt0b3A6IDAsIHJpZ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WF0KCcsLjJmJykKKyAgICAsIGRlbGF5ID0gMTIwMAorICAgICwgeERvbWFpbgorICAgICwgeURvbWFpbgorICAgICwgeFJhbmdlCisgICAgLCB5UmFuZ2UKKyAgICAsIGRpc3BhdGNoID0gZDMuZGlzcGF0Y2goJ2NoYXJ0Q2xpY2snLCAnZWxlbWVudENsaWNrJywgJ2VsZW1lbnREYmxDbGljaycsICdlbGVtZW50TW91c2VvdmVyJywgJ2VsZW1lbnRNb3VzZW91dCcpCisgICAgOworCisgIC8vPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisKKworICAvLz09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorICAvLyBQcml2YXRlIFZhcmlhYmxlcworICAvLy0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLQorCisgIHZhciB4MCwgeTAgLy91c2VkIHRvIHN0b3JlIHByZXZpb3VzIHNjYWxlcworICAgICAgOworCisgIC8vPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisKKworICBmdW5jdGlvbiBjaGFydChzZWxlY3Rpb24pIHsKKyAgICBzZWxlY3Rpb24uZWFjaChmdW5jdGlvbihkYXRhKSB7CisgICAgICB2YXIgYXZhaWxhYmxlV2lkdGggPSB3aWR0aCAtIG1hcmdpbi5sZWZ0IC0gbWFyZ2luLnJpZ2h0LAorICAgICAgICAgIGF2YWlsYWJsZUhlaWdodCA9IGhlaWdodCAtIG1hcmdpbi50b3AgLSBtYXJnaW4uYm90dG9tLAorICAgICAgICAgIGNvbnRhaW5lciA9IGQzLnNlbGVjdCh0aGlzKTsKKworCisgICAgICBpZiAoc3RhY2tlZCkKKyAgICAgICAgZGF0YSA9IGQzLmxheW91dC5zdGFjaygpCisgICAgICAgICAgICAgICAgIC5vZmZzZXQoJ3plcm8nKQorICAgICAgICAgICAgICAgICAudmFsdWVzKGZ1bmN0aW9uKGQpeyByZXR1cm4gZC52YWx1ZXMgfSkKKyAgICAgICAgICAgICAgICAgLnkoZ2V0WSkKKyAgICAgICAgICAgICAgICAgKGRhdGEpOworCisKKyAgICAgIC8vYWRkIHNlcmllcyBpbmRleCB0byBlYWNoIGRhdGEgcG9pbnQgZm9yIHJlZmVyZW5jZQorICAgICAgZGF0YS5mb3JFYWNoKGZ1bmN0aW9uKHNlcmllcywgaSkgeworICAgICAgICBzZXJpZXMudmFsdWVzLmZvckVhY2goZnVuY3Rpb24ocG9pbnQpIHsKKyAgICAgICAgICBwb2ludC5zZXJpZXMgPSBpOworICAgICAgICB9KTsKKyAgICAgIH0pOworCisKKworICAgICAgLy8tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0KKyAgICAgIC8vIEhBQ0sgZm9yIG5lZ2F0aXZlIHZhbHVlIHN0YWNraW5nCisgICAgICBpZiAoc3RhY2tlZCkKKyAgICAgICAgZGF0YVswXS52YWx1ZXMubWFwKGZ1bmN0aW9uKGQsaSkgeworICAgICAgICAgIHZhciBwb3NCYXNlID0gMCwgbmVnQmFzZSA9IDA7CisgICAgICAgICAgZGF0YS5tYXAoZnVuY3Rpb24oZCkgeworICAgICAgICAgICAgdmFyIGYgPSBkLnZhbHVlc1tpXQorICAgICAgICAgICAgZi5zaXplID0gTWF0aC5hYnMoZi55KTsKKyAgICAgICAgICAgIGlmIChmLnk8MCkgIHsKKyAgICAgICAgICAgICAgZi55MSA9IG5lZ0Jhc2UgLSBmLnNpemU7CisgICAgICAgICAgICAgIG5lZ0Jhc2UgPSBuZWdCYXNlIC0gZi5zaXplOworICAgICAgICAgICAgfSBlbHNlCisgICAgICAgICAgICB7CisgICAgICAgICAgICAgIGYueTEgPSBwb3NCYXNlOworICAgICAgICAgICAgICB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WQgPyAxIDogZGF0YS5sZW5ndGgpICkKKworICAgICAgYmFycworICAgICAgICAgIC5vbignbW91c2VvdmVyJywgZnVuY3Rpb24oZCxpKSB7IC8vVE9ETzogZmlndXJlIG91dCB3aHkgaiB3b3JrcyBhYm92ZSwgYnV0IG5vdCBoZXJlCisgICAgICAgICAgICBkMy5zZWxlY3QodGhpcykuY2xhc3NlZCgnaG92ZXInLCB0cnVlKTsKKyAgICAgICAgICAgIGRpc3BhdGNoLmVsZW1lbnRNb3VzZW92ZXIoeworICAgICAgICAgICAgICB2YWx1ZTogZ2V0WShkLGkpLAorICAgICAgICAgICAgICBwb2ludDogZCwKKyAgICAgICAgICAgICAgc2VyaWVzOiBkYXRhW2Quc2VyaWVzXSwKKyAgICAgICAgICAgICAgcG9zOiBbIHkoZ2V0WShkLGkpICsgKHN0YWNrZWQgPyBkLnkwIDogMCkpLCB4KGdldFgoZCxpKSkgKyAoeC5yYW5nZUJhbmQoKSAqIChzdGFja2VkID8gZGF0YS5sZW5ndGggLyAyIDogZC5zZXJpZXMgKyAuNSkgLyBkYXRhLmxlbmd0aCkgXSwKKyAgICAgICAgICAgICAgcG9pbnRJbmRleDogaSwKKyAgICAgICAgICAgICAgc2VyaWVzSW5kZXg6IGQuc2VyaWVzLAorICAgICAgICAgICAgICBlOiBkMy5ldmVudAorICAgICAgICAgICAgfSk7CisgICAgICAgICAgfSkKKyAgICAgICAgICAub24oJ21vdXNlb3V0JywgZnVuY3Rpb24oZCxpKSB7CisgICAgICAgICAgICBkMy5zZWxlY3QodGhpcykuY2xhc3NlZCgnaG92ZXInLCBmYWxzZSk7CisgICAgICAgICAgICBkaXNwYXRjaC5lbGVtZW50TW91c2VvdXQoeworICAgICAgICAgICAgICB2YWx1ZTogZ2V0WShkLGkpLAorICAgICAgICAgICAgICBwb2ludDogZCwKKyAgICAgICAgICAgICAgc2VyaWVzOiBkYXRhW2Quc2VyaWVzXSwKKyAgICAgICAgICAgICAgcG9pbnRJbmRleDogaSwKKyAgICAgICAgICAgICAgc2VyaWVzSW5kZXg6IGQuc2VyaWVzLAorICAgICAgICAgICAgICBlOiBkMy5ldmVudAorICAgICAgICAgICAgfSk7CisgICAgICAgICAgfSkKKyAgICAgICAgICAub24oJ2NsaWNrJywgZnVuY3Rpb24oZCxpKSB7CisgICAgICAgICAgICBkaXNwYXRjaC5lbGVtZW50Q2xpY2soeworICAgICAgICAgICAgICB2YWx1ZTogZ2V0WShkLGkpLAorICAgICAgICAgICAgICBwb2ludDogZCwKKyAgICAgICAgICAgICAgc2VyaWVzOiBkYXRhW2Quc2VyaWVzXSwKKyAgICAgICAgICAgICAgcG9zOiBbeChnZXRYKGQsaSkpICsgKHgucmFuZ2VCYW5kKCkgKiAoc3RhY2tlZCA/IGRhdGEubGVuZ3RoIC8gMiA6IGQuc2VyaWVzICsgLjUpIC8gZGF0YS5sZW5ndGgpLCB5KGdldFkoZCxpKSArIChzdGFja2VkID8gZC55MCA6IDApKV0sICAvLyBUT0RPOiBGaWd1cmUgb3V0IHdoeSB0aGUgdmFsdWUgYXBwZWFycyB0byBiZSBzaGlmdGVkCisgICAgICAgICAgICAgIHBvaW50SW5kZXg6IGksCisgICAgICAgICAgICAgIHNlcmllc0luZGV4OiBkLnNlcmllcywKKyAgICAgICAgICAgICAgZTogZDMuZXZlbnQKKyAgICAgICAgICAgIH0pOworICAgICAgICAgICAgZDMuZXZlbnQuc3RvcFByb3BhZ2F0aW9uKCk7CisgICAgICAgICAgfSkKKyAgICAgICAgICAub24oJ2RibGNsaWNrJywgZnVuY3Rpb24oZCxpKSB7CisgICAgICAgICAgICBkaXNwYXRjaC5lbGVtZW50RGJsQ2xpY2soeworICAgICAgICAgICAgICB2YWx1ZTogZ2V0WShkLGkpLAorICAgICAgICAgICAgICBwb2ludDogZCwKKyAgICAgICAgICAgICAgc2VyaWVzOiBkYXRhW2Quc2VyaWVzXSwKKyAgICAgICAgICAgICAgcG9zOiBbeChnZXRYKGQsaSkpICsgKHgucmFuZ2VCYW5kKCkgKiAoc3RhY2tlZCA/IGRhdGEubGVuZ3RoIC8gMiA6IGQuc2VyaWVzICsgLjUpIC8gZGF0YS5sZW5ndGgpLCB5KGdldFkoZCxpKSArIChzdGFja2VkID8gZC55MCA6IDApKV0sICAvLyBUT0RPOiBGaWd1cmUgb3V0IHdoeSB0aGUgdmFsdWUgYXBwZWFycyB0byBiZSBzaGlmdGVkCisgICAgICAgICAgICAgIHBvaW50SW5kZXg6IGksCisgICAgICAgICAgICAgIHNlcmllc0luZGV4OiBkLnNlcmllcywKKyAgICAgICAgICAgICAgZTogZDMuZXZlbnQKKyAgICAgICAgICAgIH0pOworICAgICAgICAgICAgZDMuZXZlbnQuc3RvcFByb3BhZ2F0aW9uKCk7CisgICAgICAgICAgfSk7CisKKworICAgICAgYmFyc0VudGVyLmFwcGVuZCgndGV4dCcpOworCisgICAgICBpZiAoc2hvd1ZhbHVlcyAmJiAhc3RhY2tlZCkgeworICAgICAgICBiYXJzLnNlbGVjdCgndGV4dCcpCisgICAgICAgICAgICAuYXR0cigndGV4dC1hbmNob3InLCBmdW5jdGlvbihkLGkpIHsgcmV0dXJuIGdldFkoZCxpKSA8IDAgPyAnZW5kJyA6ICdzdGFydCcgfSkKKyAgICAgICAgICAgIC5hdHRyKCd5JywgeC5yYW5nZUJhbmQoKSAvIChkYXRhLmxlbmd0aCAqIDIpKQorICAgICAgICAgICAgLmF0dHIoJ2R5JywgJy4zMmVtJykKKyAgICAgICAgICAgIC50ZXh0KGZ1bmN0aW9uKGQsaSkgeyByZXR1cm4gdmFsdWVGb3JtYXQoZ2V0WShkLGkpKSB9KQorICAgICAgICBiYXJzLnRyYW5zaXRpb24oKQorICAgICAgICAgIC5zZWxlY3QoJ3RleHQnKQorICAgICAgICAgICAgLmF0dHIoJ3gnLCBmdW5jdGlvbihkLGkpIHsgcmV0dXJuIGdldFkoZCxpKSA8IDAgPyAtNCA6IHkoZ2V0WShkLGkpKSAtIHkoMCkgKyA0IH0pCisgICAgICB9IGVsc2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gJyknCisgICAgICAgICAgICB9KQorICAgICAgICAgIC5zZWxlY3QoJ3JlY3QnKQorICAgICAgICAgICAgLmF0dHIoJ3dpZHRoJywgZnVuY3Rpb24oZCxpKSB7CisgICAgICAgICAgICAgIHJldHVybiBNYXRoLmFicyh5KGdldFkoZCxpKSArIGQueTApIC0geShkLnkwKSkKKyAgICAgICAgICAgIH0pCisgICAgICAgICAgICAuYXR0cignaGVpZ2h0JywgeC5yYW5nZUJhbmQoKSApOworICAgICAgZWxzZQorICAgICAgICBiYXJzLnRyYW5zaXRpb24oKQorICAgICAgICAgICAgLmF0dHIoJ3RyYW5zZm9ybScsIGZ1bmN0aW9uKGQsaSkgeworICAgICAgICAgICAgICAvL1RPRE86IHN0YWNrZWQgbXVzdCBiZSBhbGwgcG9zaXRpdmUgb3IgYWxsIG5lZ2F0aXZlLCBub3QgYm90aD8KKyAgICAgICAgICAgICAgcmV0dXJuICd0cmFuc2xhdGUoJyArCisgICAgICAgICAgICAgIChnZXRZKGQsaSkgPCAwID8geShnZXRZKGQsaSkpIDogeSgwKSkKKyAgICAgICAgICAgICAgKyAnLCcgKworICAgICAgICAgICAgICAoZC5zZXJpZXMgKiB4LnJhbmdlQmFuZCgpIC8gZGF0YS5sZW5ndGgKKyAgICAgICAgICAgICAgKworICAgICAgICAgICAgICB4KGdldFgoZCxpKSkgKQorICAgICAgICAgICAgICArICcpJworICAgICAgICAgICAgfSkKKyAgICAgICAgICAuc2VsZWN0KCdyZWN0JykKKyAgICAgICAgICAgIC5hdHRyKCdoZWlnaHQnLCB4LnJhbmdlQmFuZCgpIC8gZGF0YS5sZW5ndGggKQorICAgICAgICAgICAgLmF0dHIoJ3dpZHRoJywgZnVuY3Rpb24oZCxpKSB7CisgICAgICAgICAgICAgIHJldHVybiBNYXRoLm1heChNYXRoLmFicyh5KGdldFkoZCxpKSkgLSB5KDApKSwxKQorICAgICAgICAgICAgfSk7CisKKworICAgICAgLy9zdG9yZSBvbGQgc2NhbGVzIGZvciB1c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ib3R0b20gIT0gJ3VuZGVmaW5lZCcgPyBfLmJvdHRvbSA6IG1hcmdpbi5ib3R0b207CisgICAgbWFyZ2luLmxlZnQgICA9IHR5cGVvZiBfLmxlZnQgICAhPSAndW5kZWZpbmVkJyA/IF8ubGVmdCAgIDogbWFyZ2luLmxlZnQ7CisgICAgcmV0dXJuIGNoYXJ0OworICB9OworCisgIGNoYXJ0LndpZHRoID0gZnVuY3Rpb24oXykgeworICAgIGlmICghYXJndW1lbnRzLmxlbmd0aCkgcmV0dXJuIHdpZHRoOworICAgIHdpZHRoID0gXzsKKyAgICByZXR1cm4gY2hhcnQ7CisgIH07CisKKyAgY2hhcnQuaGVpZ2h0ID0gZnVuY3Rpb24oXykgeworICAgIGlmICghYXJndW1lbnRzLmxlbmd0aCkgcmV0dXJuIGhlaWdodDsKKyAgICBoZWlnaHQgPSBfOworICAgIHJldHVybiBjaGFydDsKKyAgfTsKKworICBjaGFydC54U2NhbGUgPSBmdW5jdGlvbihfKSB7CisgICAgaWYgKCFhcmd1bWVudHMubGVuZ3RoKSByZXR1cm4geDsKKyAgICB4ID0gXzsKKyAgICByZXR1cm4gY2hhcnQ7CisgIH07CisKKyAgY2hhcnQueVNjYWxlID0gZnVuY3Rpb24oXykgeworICAgIGlmICghYXJndW1lbnRzLmxlbmd0aCkgcmV0dXJuIHk7CisgICAgeSA9IF87CisgICAgcmV0dXJuIGNoYXJ0OworICB9OworCisgIGNoYXJ0LnhEb21haW4gPSBmdW5jdGlvbihfKSB7CisgICAgaWYgKCFhcmd1bWVudHMubGVuZ3RoKSByZXR1cm4geERvbWFpbjsKKyAgICB4RG9tYWluID0gXzsKKyAgICByZXR1cm4gY2hhcnQ7CisgIH07CisKKyAgY2hhcnQueURvbWFpbiA9IGZ1bmN0aW9uKF8pIHsKKyAgICBpZiAoIWFyZ3VtZW50cy5sZW5ndGgpIHJldHVybiB5RG9tYWluOworICAgIHlEb21haW4gPSBfOworICAgIHJldHVybiBjaGFydDsKKyAgfTsKKworICBjaGFydC54UmFuZ2UgPSBmdW5jdGlvbihfKSB7CisgICAgaWYgKCFhcmd1bWVudHMubGVuZ3RoKSByZXR1cm4geFJhbmdlOworICAgIHhSYW5nZSA9IF87CisgICAgcmV0dXJuIGNoYXJ0OworICB9OworCisgIGNoYXJ0LnlSYW5nZSA9IGZ1bmN0aW9uKF8pIHsKKyAgICBpZiAoIWFyZ3VtZW50cy5sZW5ndGgpIHJldHVybiB5UmFuZ2U7CisgICAgeVJhbmdlID0gXzsKKyAgICByZXR1cm4gY2hhcnQ7CisgIH07CisKKyAgY2hhcnQuZm9yY2VZID0gZnVuY3Rpb24oXykgeworICAgIGlmICghYXJndW1lbnRzLmxlbmd0aCkgcmV0dXJuIGZvcmNlWTsKKyAgICBmb3JjZVkgPSBfOworICAgIHJldHVybiBjaGFydDsKKyAgfTsKKworICBjaGFydC5zdGFja2VkID0gZnVuY3Rpb24oXykgeworICAgIGlmICghYXJndW1lbnRzLmxlbmd0aCkgcmV0dXJuIHN0YWNrZWQ7CisgICAgc3RhY2tlZCA9IF87CisgICAgcmV0dXJuIGNoYXJ0OworICB9OworCisgIGNoYXJ0LmNvbG9yID0gZnVuY3Rpb24oXykgeworICAgIGlmICghYXJndW1lbnRzLmxlbmd0aCkgcmV0dXJuIGNvbG9yOworICAgIGNvbG9yID0gbnYudXRpbHMuZ2V0Q29sb3IoXyk7CisgICAgcmV0dXJuIGNoYXJ0OworICB9OworCisgIGNoYXJ0LmJhckNvbG9yID0gZnVuY3Rpb24oXykgeworICAgIGlmICghYXJndW1lbnRzLmxlbmd0aCkgcmV0dXJuIGJhckNvbG9yOworICAgIGJhckNvbG9yID0gbnYudXRpbHMuZ2V0Q29sb3IoXyk7CisgICAgcmV0dXJuIGNoYXJ0OworICB9OworCisgIGNoYXJ0LmRpc2FibGVkID0gZnVuY3Rpb24oXykgeworICAgIGlmICghYXJndW1lbnRzLmxlbmd0aCkgcmV0dXJuIGRpc2FibGVkOworICAgIGRpc2FibGVkID0gXzsK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C5vcmllbnQoJ2JvdHRvbScpCisgICAgLnRpY2tGb3JtYXQoZDMuZm9ybWF0KCcsLjFmJykpCisgICAgOworCisgIGNvbnRyb2xzLnVwZGF0ZVN0YXRlKGZhbHNlKTsKKyAgLy89PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKworCisgIC8vPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisgIC8vIFByaXZhdGUgVmFyaWFibGVzCisgIC8vLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tCisKKyAgdmFyIHNob3dUb29sdGlwID0gZnVuY3Rpb24oZSwgb2Zmc2V0RWxlbWVudCkgeworICAgIHZhciBsZWZ0ID0gZS5wb3NbMF0gKyAoIG9mZnNldEVsZW1lbnQub2Zmc2V0TGVmdCB8fCAwICksCisgICAgICAgIHRvcCA9IGUucG9zWzFdICsgKCBvZmZzZXRFbGVtZW50Lm9mZnNldFRvcCB8fCAwKSwKKyAgICAgICAgeCA9IHhBeGlzLnRpY2tGb3JtYXQoKShtdWx0aWJhci54KCkoZS5wb2ludCwgZS5wb2ludEluZGV4KSksCisgICAgICAgIHkgPSB5QXhpcy50aWNrRm9ybWF0KCkobXVsdGliYXIueSgpKGUucG9pbnQsIGUucG9pbnRJbmRleCkpLAorICAgICAgICBjb250ZW50ID0gdG9vbHRpcChlLnNlcmllcy5rZXksIHgsIHksIGUsIGNoYXJ0KTsKKworICAgIG52LnRvb2x0aXAuc2hvdyhbbGVmdCwgdG9wXSwgY29udGVudCwgZS52YWx1ZSA8IDAgPyAnZScgOiAndycsIG51bGwsIG9mZnNldEVsZW1lbnQpOworICB9OworCisgIC8vPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisKKworICBmdW5jdGlvbiBjaGFydChzZWxlY3Rpb24pIHsKKyAgICBzZWxlY3Rpb24uZWFjaChmdW5jdGlvbihkYXRhKSB7CisgICAgICB2YXIgY29udGFpbmVyID0gZDMuc2VsZWN0KHRoaXMpLAorICAgICAgICAgIHRoYXQgPSB0aGlzOworCisgICAgICB2YXIgYXZhaWxhYmxlV2lkdGggPSAod2lkdGggIHx8IHBhcnNlSW50KGNvbnRhaW5lci5zdHlsZSgnd2lkdGgnKSkgfHwgOTYwKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAtIG1hcmdpbi5sZWZ0IC0gbWFyZ2luLnJpZ2h0LAorICAgICAgICAgIGF2YWlsYWJsZUhlaWdodCA9IChoZWlnaHQgfHwgcGFyc2VJbnQoY29udGFpbmVyLnN0eWxlKCdoZWlnaHQnKSkgfHwgNDAwKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAtIG1hcmdpbi50b3AgLSBtYXJnaW4uYm90dG9tOworCisgICAgICBjaGFydC51cGRhdGUgPSBmdW5jdGlvbigpIHsgY29udGFpbmVyLnRyYW5zaXRpb24oKS5kdXJhdGlvbih0cmFuc2l0aW9uRHVyYXRpb24pLmNhbGwoY2hhcnQpIH07CisgICAgICBjaGFydC5jb250YWluZXIgPSB0aGlzOworCisgICAgICAvL3NldCBzdGF0ZS5kaXNhYmxlZAorICAgICAgc3RhdGUuZGlzYWJsZWQgPSBkYXRhLm1hcChmdW5jdGlvbihkKSB7IHJldHVybiAhIWQuZGlzYWJsZWQgfSk7CisKKyAgICAgIGlmICghZGVmYXVsdFN0YXRlKSB7CisgICAgICAgIHZhciBrZXk7CisgICAgICAgIGRlZmF1bHRTdGF0ZSA9IHt9OworICAgICAgICBmb3IgKGtleSBpbiBzdGF0ZSkgeworICAgICAgICAgIGlmIChzdGF0ZVtrZXldIGluc3RhbmNlb2YgQXJyYXkpCisgICAgICAgICAgICBkZWZhdWx0U3RhdGVba2V5XSA9IHN0YXRlW2tleV0uc2xpY2UoMCk7CisgICAgICAgICA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XAgQXhlcworCisgICAgICB4QXhpcworICAgICAgICAuc2NhbGUoeCkKKyAgICAgICAgLnRpY2tzKCBhdmFpbGFibGVIZWlnaHQgLyAyNCApCisgICAgICAgIC50aWNrU2l6ZSgtYXZhaWxhYmxlV2lkdGgsIDApOworCisgICAgICBnLnNlbGVjdCgnLm52LXgubnYtYXhpcycpLnRyYW5zaXRpb24oKQorICAgICAgICAgIC5jYWxsKHhBeGlzKTsKKworICAgICAgdmFyIHhUaWNrcyA9IGcuc2VsZWN0KCcubnYteC5udi1heGlzJykuc2VsZWN0QWxsKCdnJyk7CisKKyAgICAgIHhUaWNrcworICAgICAgICAgIC5zZWxlY3RBbGwoJ2xpbmUsIHRleHQnKQorICAgICAgICAgIC5zdHlsZSgnb3BhY2l0eScsIDEpCisKKworICAgICAgeUF4aXMKKyAgICAgICAgLnNjYWxlKHkpCisgICAgICAgIC50aWNrcyggYXZhaWxhYmxlV2lkdGggLyAxMDAgKQorICAgICAgICAudGlja1NpemUoIC1hdmFpbGFibGVIZWlnaHQsIDApOworCisgICAgICBnLnNlbGVjdCgnLm52LXkubnYtYXhpcycpCisgICAgICAgICAgLmF0dHIoJ3RyYW5zZm9ybScsICd0cmFuc2xhdGUoMCwnICsgYXZhaWxhYmxlSGVpZ2h0ICsgJyknKTsKKyAgICAgIGcuc2VsZWN0KCcubnYteS5udi1heGlzJykudHJhbnNpdGlvbigpCisgICAgICAgICAgLmNhbGwoeUF4aXMpOworCisgICAgICAvLy0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLQorCisKKworICAgICAgLy89PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKyAgICAgIC8vIEV2ZW50IEhhbmRsaW5nL0Rpc3BhdGNoaW5nIChpbiBjaGFydCdzIHNjb3BlKQorICAgICAgLy8tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0KKworICAgICAgbGVnZW5kLmRpc3BhdGNoLm9uKCdzdGF0ZUNoYW5nZScsIGZ1bmN0aW9uKG5ld1N0YXRlKSB7IAorICAgICAgICBzdGF0ZSA9IG5ld1N0YXRlOworICAgICAgICBkaXNwYXRjaC5zdGF0ZUNoYW5nZShzdGF0ZSk7CisgICAgICAgIGNoYXJ0LnVwZGF0ZSgpOworICAgICAgfSk7CisKKyAgICAgIGNvbnRyb2xzLmRpc3BhdGNoLm9uKCdsZWdlbmRDbGljaycsIGZ1bmN0aW9uKGQsaSkgeworICAgICAgICBpZiAoIWQuZGlzYWJsZWQpIHJldHVybjsKKyAgICAgICAgY29udHJvbHNEYXRhID0gY29udHJvbHNEYXRhLm1hcChmdW5jdGlvbihzKSB7CisgICAgICAgICAgcy5kaXNhYmxlZCA9IHRydWU7CisgICAgICAgICAgcmV0dXJuIHM7CisgICAgICAgIH0pOworICAgICAgICBkLmRpc2FibGVkID0gZmFsc2U7CisKKyAgICAgICAgc3dpdGNoIChkLmtleSkgeworICAgICAgICAgIGNhc2UgJ0dyb3VwZWQnOgorICAgICAgICAgICAgbXVsdGliYXIuc3RhY2tlZChmYWxzZSk7CisgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICBjYXNlICdTdGFja2VkJzoKKyAgICAgICAgICAgIG11bHRpYmFyLnN0YWNrZWQodHJ1ZSk7CisgICAgICAgICAgICBicmVhazsKKyAgICAgICAgfQorCisgICAgICAgIHN0YXRlLnN0YWNrZWQgPSBtdWx0aWJhci5zdGFja2VkKCk7CisgICAgICAgIGRpc3BhdGNoLnN0YXRlQ2hhbmdlKHN0YXRlKTsKKworICAgICAgICBjaGFydC51cGRhdGUoKTsKKyAgICAgIH0pOworCisgICAgICBkaXNwYXRjaC5vbigndG9vbHRpcFNob3cnLCBmdW5jdGlvbihlKSB7CisgICAgICAgIGlmICh0b29sdGlwcykgc2hvd1Rvb2x0aXAoZSwgdGhhdC5wYXJlbnROb2RlKTsKKyAgICAgIH0pOworCisgICAgICAvLyBVcGRhdGUgY2hhcnQgZnJvbSBhIHN0YXRlIG9iamVjdCBwYXNzZWQgdG8gZXZlbnQgaGFuZGxlcgorICAgICAgZGlzcGF0Y2gub24oJ2NoYW5nZVN0YXRlJywgZnVuY3Rpb24oZSkgeworCisgICAgICAgIGlmICh0eXBlb2YgZS5kaXNhYmxlZCAhPT0gJ3VuZGVmaW5lZCcpIHsKKyAgICAgICAgICBkYXRhLmZvckVhY2goZnVuY3Rpb24oc2VyaWVzLGkpIHsKKyAgICAgICAgICAgIHNlcmllcy5kaXNhYmxlZCA9IGUuZGlzYWJsZWRbaV07CisgICAgICAgICAgfSk7CisKKyAgICAgICAgICBzdGF0ZS5kaXNhYmxlZCA9IGUuZGlzYWJsZWQ7CisgICAgICAgIH0KKworICAgICAgICBpZiAodHlwZW9mIGUuc3RhY2tlZCAhPT0gJ3VuZGVmaW5lZCcpIHsKKyAgICAgICAgICBtdWx0aWJhci5zdGFja2VkKGUuc3RhY2tlZCk7CisgICAgICAgICAgc3RhdGUuc3RhY2tlZCA9IGUuc3RhY2tlZDsKKyAgICAgICAgfQorCisgICAgICAgIHNlbGVjdGlvbi5jYWxsKGNoYXJ0KTsKKyAgICAgIH0pOworICAgICAgLy89PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKworCisgICAgfSk7CisKKyAgICByZXR1cm4gY2hhcnQ7CisgIH0KKworCisgIC8vPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisgIC8vIEV2ZW50IEhhbmRsaW5nL0Rpc3BhdGNoaW5nIChvdXQgb2YgY2hhcnQncyBzY29wZSkKKyAgLy8tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0KKworICBtdWx0aWJhci5kaXNwYXRjaC5vbignZWxlbWVudE1vdXNlb3Zlci50b29sdGlwJywgZnVuY3Rpb24oZSkgeworICAgIGUucG9zID0gW2UucG9zWzBdICsgIG1hcmdpbi5sZWZ0LCBlLnBvc1sxXSArIG1hcmdpbi50b3BdOworICAgIGRpc3BhdGNoLnRvb2x0aXBTaG93KGUpOworICB9KTsKKworICBtdWx0aWJhci5kaXNwYXRjaC5vbignZWxlbWVudE1vdXNlb3V0LnRvb2x0aXAnLCBmdW5jdGlvbihlKSB7CisgICAgZGlzcGF0Y2gudG9vbHRpcEhpZGUoZSk7CisgIH0pOworICBkaXNwYXRjaC5vbigndG9vbHRpcEhpZGUnLCBmdW5jdGlvbigpIHsKKyAgICBpZiAodG9vbHRpcHMpIG52LnRvb2x0aXAuY2xlYW51cCgpOworICB9KTsKKworICAvLz09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorCisKKyAgLy89PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKyAgLy8gRXhwb3NlIFB1YmxpYyBWYXJpYWJsZXMKKyAgLy8tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0KKworICAvLyBleHBvc2UgY2hhcnQncyBzdWItY29tcG9uZW50cworICBjaGFydC5kaXNwYXRjaCA9IGRpc3BhdGNoOworICBjaGFydC5tdWx0aWJhciA9IG11bHRpYmFyOworICBjaGFydC5sZWdlbmQgPSBsZWdlbmQ7CisgIGNoYXJ0LnhBeGlzID0geEF4aXM7CisgIGNoYXJ0LnlBeGlzID0geUF4aXM7CisKKyAgZDMucmViaW5kKGNoYXJ0LCBtdWx0aWJhciwgJ3gnLCAneScsICd4RG9tYWluJywgJ3lEb21haW4nLCAneFJhbmdlJywgJ3lSYW5nZScsICdmb3JjZVgnLCAnZm9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b24oXykgeworICAgIGlmICghYXJndW1lbnRzLmxlbmd0aCkgcmV0dXJuIGNvbG9yOworICAgIGNvbG9yID0gbnYudXRpbHMuZ2V0Q29sb3IoXyk7CisgICAgbGVnZW5kLmNvbG9yKGNvbG9yKTsKKyAgICByZXR1cm4gY2hhcnQ7CisgIH07CisKKyAgY2hhcnQuc2hvd0NvbnRyb2xzID0gZnVuY3Rpb24oXykgeworICAgIGlmICghYXJndW1lbnRzLmxlbmd0aCkgcmV0dXJuIHNob3dDb250cm9sczsKKyAgICBzaG93Q29udHJvbHMgPSBfOworICAgIHJldHVybiBjaGFydDsKKyAgfTsKKworICBjaGFydC5zaG93TGVnZW5kID0gZnVuY3Rpb24oXykgeworICAgIGlmICghYXJndW1lbnRzLmxlbmd0aCkgcmV0dXJuIHNob3dMZWdlbmQ7CisgICAgc2hvd0xlZ2VuZCA9IF87CisgICAgcmV0dXJuIGNoYXJ0OworICB9OworCisgIGNoYXJ0LnRvb2x0aXAgPSBmdW5jdGlvbihfKSB7CisgICAgaWYgKCFhcmd1bWVudHMubGVuZ3RoKSByZXR1cm4gdG9vbHRpcDsKKyAgICB0b29sdGlwID0gXzsKKyAgICByZXR1cm4gY2hhcnQ7CisgIH07CisKKyAgY2hhcnQudG9vbHRpcHMgPSBmdW5jdGlvbihfKSB7CisgICAgaWYgKCFhcmd1bWVudHMubGVuZ3RoKSByZXR1cm4gdG9vbHRpcHM7CisgICAgdG9vbHRpcHMgPSBfOworICAgIHJldHVybiBjaGFydDsKKyAgfTsKKworICBjaGFydC50b29sdGlwQ29udGVudCA9IGZ1bmN0aW9uKF8pIHsKKyAgICBpZiAoIWFyZ3VtZW50cy5sZW5ndGgpIHJldHVybiB0b29sdGlwOworICAgIHRvb2x0aXAgPSBfOworICAgIHJldHVybiBjaGFydDsKKyAgfTsKKworICBjaGFydC5zdGF0ZSA9IGZ1bmN0aW9uKF8pIHsKKyAgICBpZiAoIWFyZ3VtZW50cy5sZW5ndGgpIHJldHVybiBzdGF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yAgICAsIHhEb21haW4KKyAgICAsIHlEb21haW4KKyAgICAsIHhSYW5nZQorICAgICwgeVJhbmdlCisgICAgLCBkaXNwYXRjaCA9IGQzLmRpc3BhdGNoKCdjaGFydENsaWNrJywgJ2VsZW1lbnRDbGljaycsICdlbGVtZW50RGJsQ2xpY2snLCAnZWxlbWVudE1vdXNlb3ZlcicsICdlbGVtZW50TW91c2VvdXQnKQorICAgIDsKKworICAvLz09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorCisKKyAgLy89PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKyAgLy8gUHJpdmF0ZSBWYXJpYWJsZXMKKyAgLy8tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0KKworICB2YXIgeDAsIHkwIC8vdXNlZCB0byBzdG9yZSBwcmV2aW91cyBzY2FsZXMKKyAgICAgIDsKKworICAvLz09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorCisKKyAgZnVuY3Rpb24gY2hhcnQoc2VsZWN0aW9uKSB7CisgICAgc2VsZWN0aW9uLmVhY2goZnVuY3Rpb24oZGF0YSkgeworICAgICAgdmFyIGF2YWlsYWJsZVdpZHRoID0gd2lkdGggLSBtYXJnaW4ubGVmdCAtIG1hcmdpbi5yaWdodCwKKyAgICAgICAgICBhdmFpbGFibGVIZWlnaHQgPSBoZWlnaHQgLSBtYXJnaW4udG9wIC0gbWFyZ2luLmJvdHRvbSwKKyAgICAgICAgICBjb250YWluZXIgPSBkMy5zZWxlY3QodGhpcyk7CisKKyAgICAgIGlmIChzdGFja2VkKQorICAgICAgICBkYXRhID0gZDMubGF5b3V0LnN0YWNrKCkKKyAgICAgICAgICAgICAgICAgLm9mZnNldCgnemVybycpCisgICAgICAgICAgICAgICAgIC52YWx1ZXMoZnVuY3Rpb24oZCl7IHJldHVybiBkLnZhbHVlcyB9KQorICAgICAgICAgICAgICAgICAueShnZXRZKQorICAgICAgICAgICAgICAgICAoZGF0YSk7CisKKworICAgICAgLy9hZGQgc2VyaWVzIGluZGV4IHRvIGVhY2ggZGF0YSBwb2ludCBmb3IgcmVmZXJlbmNlCisgICAgICBkYXRhLmZvckVhY2goZnVuY3Rpb24oc2VyaWVzLCBpKSB7CisgICAgICAgIHNlcmllcy52YWx1ZXMuZm9yRWFjaChmdW5jdGlvbihwb2ludCkgeworICAgICAgICAgIHBvaW50LnNlcmllcyA9IGk7CisgICAgICAgIH0pOworICAgICAgfSk7CisKKyAgICAgIC8vLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tCisgICAgICAvLyBTZXR1cCBTY2FsZXMKKworICAgICAgLy8gcmVtYXAgYW5kIGZsYXR0ZW4gdGhlIGRhdGEgZm9yIHVzZSBpbiBjYWxjdWxhdGluZyB0aGUgc2NhbGVzJyBkb21haW5zCisgICAgICB2YXIgc2VyaWVzRGF0YSA9ICh4RG9tYWluICYmIHlEb21haW4pID8gW10gOiAvLyBpZiB3ZSBrbm93IHhEb21haW4gYW5kIHlEb21haW4sIG5vIG5lZWQgdG8gY2FsY3VsYXRlCisgICAgICAgICAgICBkYXRhLm1hcChmdW5jdGlvbihkKSB7CisgICAgICAgICAgICAgIHJldHVybiBkLnZhbHVlcy5tYXAoZnVuY3Rpb24oZCxpKSB7CisgICAgICAgICAgICAgICAgcmV0dXJuIHsgeDogZ2V0WChkLGkpLCB5OiBnZXRZKGQsaSksIHkwOiBkLnkwIH0KKyAgICAgICAgICAgICAgfSkKKyAgICAgICAgICAgIH0pOworCisgICAgICB4ICAgLmRvbWFpbih4RG9tYWluIHx8IGQzLmV4dGVudChkMy5tZXJnZShzZXJpZXNEYXRhKS5tYXAoZnVuY3Rpb24oZCkgeyByZXR1cm4gZC54IH0pKSkKKyAgICAgICAgICAucmFuZ2UoeFJhbmdlIHx8IFswLCBhdmFpbGFibGVXaWR0aF0pOworCisgICAgICB5ICAgLmRvbWFpbih5RG9tYWluIHx8IGQzLmV4dGVudChkMy5tZXJnZShzZXJpZXNEYXRhKS5tYXAoZnVuY3Rpb24oZCkgeyByZXR1cm4gZC55ICsgKHN0YWNrZWQgPyBkLnkwIDogMCkgfSkuY29uY2F0KGZvcmNlWSkpKQorICAgICAgICAgIC5yYW5nZSh5UmFuZ2UgfHwgW2F2YWlsYWJsZUhlaWdodCwgMF0pOworCisKKyAgICAgIC8vIElmIHNjYWxlJ3MgZG9tYWluIGRvbid0IGhhdmUgYSByYW5nZSwgc2xpZ2h0bHkgYWRqdXN0IHRvIG1ha2Ugb25lLi4uIHNvIGEgY2hhcnQgY2FuIHNob3cgYSBzaW5nbGUgZGF0YSBwb2ludAorICAgICAgaWYgKHguZG9tYWluKClbMF0gPT09IHguZG9tYWluKClbMV0pCisgICAgICAgIHguZG9tYWluKClbMF0gPworICAgICAgICAgICAgeC5kb21haW4oW3guZG9tYWluKClbMF0gLSB4LmRvbWFpbigpWzBdICogMC4wMSwgeC5kb21haW4oKVsxXSArIHguZG9tYWluKClbMV0gKiAwLjAxXSkKKyAgICAgICAgICA6IHguZG9tYWluKFstMSwxXSk7CisKKyAgICAgIGlmICh5LmRvbWFpbigpWzBdID09PSB5LmRvbWFpbigpWzFdKQorICAgICAgICB5LmRvbWFpbigpWzBdID8KKyAgICAgICAgICAgIHkuZG9tYWluKFt5LmRvbWFpbigpWzBdICsgeS5kb21haW4oKVswXSAqIDAuMDEsIHkuZG9tYWluKClbMV0gLSB5LmRvbWFpbigpWzFdICogMC4wMV0pCisgICAgICAgICAgOiB5LmRvbWFpbihbLTEsMV0pOworCisKKyAgICAgIHgwID0geDAgfHwgeDsKKyAgICAgIHkwID0geTAgfHwgeTsKKworICAgICAgLy8tLS0tLS0tLS0tLS0tLS0tL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BpZCArICcgcmVjdCcpCisgICAgICAgICAgLmF0dHIoJ3dpZHRoJywgYXZhaWxhYmxlV2lkdGgpCisgICAgICAgICAgLmF0dHIoJ2hlaWdodCcsIGF2YWlsYWJsZUhlaWdodCk7CisKKyAgICAgIGcgICAuYXR0cignY2xpcC1wYXRoJywgY2xpcEVkZ2UgPyAndXJsKCNudi1lZGdlLWNsaXAtJyArIGlkICsgJyknIDogJycpOworCisKKworICAgICAgdmFyIGdyb3VwcyA9IHdyYXAuc2VsZWN0KCcubnYtZ3JvdXBzJykuc2VsZWN0QWxsKCcubnYtZ3JvdXAnKQorICAgICAgICAgIC5kYXRhKGZ1bmN0aW9uKGQpIHsgcmV0dXJuIGQgfSwgZnVuY3Rpb24oZCkgeyByZXR1cm4gZC5rZXkgfSk7CisgICAgICBncm91cHMuZW50ZXIoKS5hcHBlbmQoJ2cnKQorICAgICAgICAgIC5zdHlsZSgnc3Ryb2tlLW9wYWNpdHknLCAxZS02KQorICAgICAgICAgIC5zdHlsZSgnZmlsbC1vcGFjaXR5JywgMWUtNik7CisgICAgICBkMy50cmFuc2l0aW9uKGdyb3Vwcy5leGl0KCkpCisgICAgICAgICAgLy8uc3R5bGUoJ3N0cm9rZS1vcGFjaXR5JywgMWUtNikKKyAgICAgICAgICAvLy5zdHlsZSgnZmlsbC1vcGFjaXR5JywgMWUtNikKKyAgICAgICAgLnNlbGVjdEFsbCgncmVjdC5udi1iYXInKQorICAgICAgICAuZGVsYXkoZnVuY3Rpb24oZCxpKSB7IHJldHVybiBpICogZGVsYXkvIGRhdGFbMF0udmFsdWVzLmxlbmd0aCB9KQorICAgICAgICAgIC5hdHRyKCd5JywgZnVuY3Rpb24oZCkgeyByZXR1cm4gc3RhY2tlZCA/IHkwKGQueTApIDogeTAoMCkgfSkKKyAgICAgICAgICAuYXR0cignaGVpZ2h0JywgMCkKKyAgICAgICAgICAucmVtb3ZlKCk7CisgICAgICBncm91cHMKKyAgICAgICAgICAuYXR0cignY2xhc3MnLCB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XJzIHRvIGJlIHNoaWZ0ZWQKKyAgICAgICAgICAgICAgcG9pbnRJbmRleDogaSwKKyAgICAgICAgICAgICAgc2VyaWVzSW5kZXg6IGQuc2VyaWVzLAorICAgICAgICAgICAgICBlOiBkMy5ldmVudAorICAgICAgICAgICAgfSk7CisgICAgICAgICAgfSkKKyAgICAgICAgICAub24oJ21vdXNlb3V0JywgZnVuY3Rpb24oZCxpKSB7CisgICAgICAgICAgICBkMy5zZWxlY3QodGhpcykuY2xhc3NlZCgnaG92ZXInLCBmYWxzZSk7CisgICAgICAgICAgICBkaXNwYXRjaC5lbGVtZW50TW91c2VvdXQoeworICAgICAgICAgICAgICB2YWx1ZTogZ2V0WShkLGkpLAorICAgICAgICAgICAgICBwb2ludDogZCwKKyAgICAgICAgICAgICAgc2VyaWVzOiBkYXRhW2Quc2VyaWVzXSwKKyAgICAgICAgICAgICAgcG9pbnRJbmRleDogaSwKKyAgICAgICAgICAgICAgc2VyaWVzSW5kZXg6IGQuc2VyaWVzLAorICAgICAgICAgICAgICBlOiBkMy5ldmVudAorICAgICAgICAgICAgfSk7CisgICAgICAgICAgfSkKKyAgICAgICAgICAub24oJ2NsaWNrJywgZnVuY3Rpb24oZCxpKSB7CisgICAgICAgICAgICBkaXNwYXRjaC5lbGVtZW50Q2xpY2soeworICAgICAgICAgICAgICB2YWx1ZTogZ2V0WShkLGkpLAorICAgICAgICAgICAgICBwb2ludDogZCwKKyAgICAgICAgICAgICAgc2VyaWVzOiBkYXRhW2Quc2VyaWVzXSwKKyAgICAgICAgICAgICAgcG9zOiBbeChnZXRYKGQsaSkpICsgKGJhcldpZHRoICogKHN0YWNrZWQgPyBkYXRhLmxlbmd0aCAvIDIgOiBkLnNlcmllcyArIC41KSAvIGRhdGEubGVuZ3RoKSwgeShnZXRZKGQsaSkgKyAoc3RhY2tlZCA/IGQueTAgOiAwKSldLCAgLy8gVE9ETzogRmlndXJlIG91dCB3aHkgdGhlIHZhbHVlIGFwcGVhcnMgdG8gYmUgc2hpZnRlZAorICAgICAgICAgICAgICBwb2ludEluZGV4OiBpLAorICAgICAgICAgICAgICBzZXJpZXNJbmRleDogZC5zZXJpZXMsCisgICAgICAgICAgICAgIGU6IGQzLmV2ZW50CisgICAgICAgICAgICB9KTsKKyAgICAgICAgICAgIGQzLmV2ZW50LnN0b3BQcm9wYWdhdGlvbigpOworICAgICAgICAgIH0pCisgICAgICAgICAgLm9uKCdkYmxjbGljaycsIGZ1bmN0aW9uKGQsaSkgeworICAgICAgICAgICAgZGlzcGF0Y2guZWxlbWVudERibENsaWNrKHsKKyAgICAgICAgICAgICAgdmFsdWU6IGdldFkoZCxpKSwKKyAgICAgICAgICAgICAgcG9pbnQ6IGQsCisgICAgICAgICAgICAgIHNlcmllczogZGF0YVtkLnNlcmllc10sCisgICAgICAgICAgICAgIHBvczogW3goZ2V0WChkLGkpKSArIChiYXJXaWR0aCAqIChzdGFja2VkID8gZGF0YS5sZW5ndGggLyAyIDogZC5zZXJpZXMgKyAuNSkgLyBkYXRhLmxlbmd0aCksIHkoZ2V0WShkLGkpICsgKHN0YWNrZWQgPyBkLnkwIDogMCkpXSwgIC8vIFRPRE86IEZpZ3VyZSBvdXQgd2h5IHRoZSB2YWx1ZSBhcHBlYXJzIHRvIGJlIHNoaWZ0ZWQKKyAgICAgICAgICAgICAgcG9pbnRJbmRleDogaSwKKyAgICAgICAgICAgICAgc2VyaWVzSW5kZXg6IGQuc2VyaWVzLAorICAgICAgICAgICAgICBlOiBkMy5ldmVudAorICAgICAgICAgICAgfSk7CisgICAgICAgICAgICBkMy5ldmVudC5zdG9wUHJvcGFnYXRpb24oKTsKKyAgICAgICAgICB9KTsKKyAgICAgIGJhcnMKKyAgICAgICAgICAuYXR0cignY2xhc3MnLCBmdW5jdGlvbihkLGkpIHsgcmV0dXJuIGdldFkoZCxpKSA8IDAgPyAnbnYtYmFyIG5lZ2F0aXZlJyA6ICdudi1iYXIgcG9zaXRpdmUnfSkKKyAgICAgICAgICAuYXR0cigndHJhbnNmb3JtJywgZnVuY3Rpb24oZCxpKSB7IHJldHVybiAndHJhbnNsYXRlKCcgKyB4KGdldFgoZCxpKSkgKyAnLDApJzsgfSkKKyAgICAgIGlmIChzdGFja2VkKQorICAgICAgICBkMy50cmFuc2l0aW9uKGJhcnMpCisgICAgICAgICAgICAuZGVsYXkoZnVuY3Rpb24oZCxpKSB7IHJldHVybiBpICogZGVsYXkgLyBkYXRhWzBdLnZhbHVlcy5sZW5ndGggfSkKKyAgICAgICAgICAgIC5hdHRyKCd5JywgZnVuY3Rpb24oZCxpKSB7CisgICAgICAgICAgICAgIHJldHVybiB5KGdldFkoZCxpKSArIChzdGFja2VkID8gZC55MCA6IDApKTsKKyAgICAgICAgICAgIH0pCisgICAgICAgICAgICAuYXR0cignaGVpZ2h0JywgZnVuY3Rpb24oZCxpKSB7CisgICAgICAgICAgICAgIHJldHVybiBNYXRoLmFicyh5KGQueSArIChzdGFja2VkID8gZC55MCA6IDApKSAtIHkoKHN0YWNrZWQgPyBkLnkwIDogMCkpKQorICAgICAgICAgICAgfSkKKyAgICAgICAgICAgIC5lYWNoKCdlbmQnLCBmdW5jdGlvbigpIHsKKyAgICAgICAgICAgICAgZDMudHJhbnNpdGlvbihkMy5zZWxlY3QodGhpcykpCisgICAgICAgICAgICAgICAgLmF0dHIoJ3gnLCBmdW5jdGlvbihkLGkpIHsKKyAgICAgICAgICAgICAgICAgIHJldHVybiBzdGFja2VkID8gMCA6IChpICogYmFuZFdpZHRoKSArICggaiAqIGJhcldpZHRoICkKKyAgICAgICAgICAgICAgICB9KQorICAgICAgICAgICAgICAgIC5hdHRyKCd3aWR0aCcsIHN0YWNrZWQgPyBiYW5kV2lkdGggOiBiYXJXaWR0aCApOworICAgICAgICAgICAgfSkKKyAgICAgIGVsc2UKKyAgICAgICAgZDMudHJhbnNpdGlvbihiYXJzKQorICAgICAgICAgIC5kZWxheShmdW5jdGlvbihkLGkpIHsgcmV0dXJuIGkgKiBkZWxheS8gZGF0YVswXS52YWx1ZXMubGVuZ3RoIH0pCisgICAgICAgICAgICAuYXR0cigneCcsIGZ1bmN0aW9uKGQsaSkgeworICAgICAgICAgICAgICByZXR1cm4gZC5zZXJpZXMgKiBiYXJXaWR0aAorICAgICAgICAgICAgfSkKKyAgICAgICAgICAgIC5hdHRyKCd3aWR0aCcsIGJhcldpZHRoKQorICAgICAgICAgICAgLmVhY2goJ2VuZCcsIGZ1bmN0aW9uKCkgeworICAgICAgICAgICAgICBkMy50cmFuc2l0aW9uKGQzLnNlbGVjdCh0aGlzKSkKKyAgICAgICAgICAgICAgICAuYXR0cigneScsIGZ1bmN0aW9uKGQsaSkgeworICAgICAgICAgICAgICAgICAgcmV0dXJuIGdldFkoZCxpKSA8IDAgPworICAgICAgICAgICAgICAgICAgICB5KDApIDoKKyAgICAgICAgICAgICAgICAgICAgeShnZXRZKGQsaSkpCisgICAgICAgICAgICAgICAgfSkKKyAgICAgICAgICAgICAgICAuYXR0cignaGVpZ2h0JywgZnVuY3Rpb24oZCxpKSB7CisgICAgICAgICAgICAgICAgICByZXR1cm4gTWF0aC5hYnMoeShnZXRZKGQsaSkpIC0geSgwKSkKKyAgICAgICAgICAgICAgICB9KTsKKyAgICAgICAgICAgIH0pCisKKworICAgICAgLy9zdG9yZSBvbGQgc2NhbGVzIGZvciB1c2UgaW4gdHJhbnNpdGlvbnMgb24gdXBkYXRlCisgICAgICB4MCA9IHguY29weSgpOworICAgICAgeTAgPSB5LmNvcHkoKTsKKworICAgIH0pOworCisgICAgcmV0dXJuIGNoYXJ0OworICB9CisKKworICAvLz09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorICAvLyBFeHBvc2UgUHVibGljIFZhcmlhYmxlcworICAvLy0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLQorCisgIGNoYXJ0LmRpc3BhdGNoID0gZGlzcGF0Y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ID0gZnVuY3Rpb24oXykgeworICAgIGlmICghYXJndW1lbnRzLmxlbmd0aCkgcmV0dXJuIGhlaWdodDsKKyAgICBoZWlnaHQgPSBfOworICAgIHJldHVybiBjaGFydDsKKyAgfTsKKworICBjaGFydC54U2NhbGUgPSBmdW5jdGlvbihfKSB7CisgICAgaWYgKCFhcmd1bWVudHMubGVuZ3RoKSByZXR1cm4geDsKKyAgICB4ID0gXzsKKyAgICByZXR1cm4gY2hhcnQ7CisgIH07CisKKyAgY2hhcnQueVNjYWxlID0gZnVuY3Rpb24oXykgeworICAgIGlmICghYXJndW1lbnRzLmxlbmd0aCkgcmV0dXJuIHk7CisgICAgeSA9IF87CisgICAgcmV0dXJuIGNoYXJ0OworICB9OworCisgIGNoYXJ0LnhEb21haW4gPSBmdW5jdGlvbihfKSB7CisgICAgaWYgKCFhcmd1bWVudHMubGVuZ3RoKSByZXR1cm4geERvbWFpbjsKKyAgICB4RG9tYWluID0gXzsKKyAgICByZXR1cm4gY2hhcnQ7CisgIH07CisKKyAgY2hhcnQueURvbWFpbiA9IGZ1bmN0aW9uKF8pIHsKKyAgICBpZiAoIWFyZ3VtZW50cy5sZW5ndGgpIHJldHVybiB5RG9tYWluOworICAgIHlEb21haW4gPSBfOworICAgIHJldHVybiBjaGFydDsKKyAgfTsKKworICBjaGFydC54UmFuZ2UgPSBmdW5jdGlvbihfKSB7CisgICAgaWYgKCFhcmd1bWVudHMubGVuZ3RoKSByZXR1cm4geFJhbmdlOworICAgIHhSYW5nZSA9IF87CisgICAgcmV0dXJuIGNoYXJ0OworICB9OworCisgIGNoYXJ0LnlSYW5nZSA9IGZ1bmN0aW9uKF8pIHsKKyAgICBpZiAoIWFyZ3VtZW50cy5sZW5ndGgpIHJldHVybiB5UmFuZ2U7CisgICAgeVJhbmdlID0gXzsKKyAgICByZXR1cm4gY2hhcnQ7CisgIH07CisKKyAgY2hhcnQuZm9yY2VZID0gZnVuY3Rpb24oXykgeworICAgIGlmICghYXJndW1lbnRzLmxlbmd0aCkgcmV0dXJuIGZvcmNlWTsKKyAgICBmb3JjZVkgPSBfOworICAgIHJldHVybiBjaGFydDsKKyAgfTsKKworICBjaGFydC5zdGFja2VkID0gZnVuY3Rpb24oXykgeworICAgIGlmICghYXJndW1lbnRzLmxlbmd0aCkgcmV0dXJuIHN0YWNrZWQ7CisgICAgc3RhY2tlZCA9IF87CisgICAgcmV0dXJuIGNoYXJ0OworICB9OworCisgIGNoYXJ0LmNsaXBFZGdlID0gZnVuY3Rpb24oXykgeworICAgIGlmICghYXJndW1lbnRzLmxlbmd0aCkgcmV0dXJuIGNsaXBFZGdlOworICAgIGNsaXBFZGdlID0gXzsKKyAgICByZXR1cm4gY2hhcnQ7CisgIH07CisKKyAgY2hhcnQuY29sb3IgPSBmdW5jdGlvbihfKSB7CisgICAgaWYgKCFhcmd1bWVudHMubGVuZ3RoKSByZXR1cm4gY29sb3I7CisgICAgY29sb3IgPSBudi51dGlscy5nZXRDb2xvcihfKTsKKyAgICByZXR1cm4gY2hhcnQ7CisgIH07CisKKyAgY2hhcnQuaWQgPSBmdW5jdGlvbihfKSB7CisgICAgaWYgKCFhcmd1bWVudHMubGVuZ3RoKSByZXR1cm4gaWQ7CisgICAgaWQgPSBfOworICAgIHJldHVybiBjaGFydDsKKyAgfTsKKworICBjaGFydC5kZWxheSA9IGZ1bmN0aW9uKF8pIHsKKyAgICBpZiAoIWFyZ3VtZW50cy5sZW5ndGgpIHJldHVybiBkZWxheTsKKyAgICBkZWxheSA9IF87CisgICAgcmV0dXJuIGNoYXJ0OworICB9OworCisgIC8vPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisKKworICByZXR1cm4gY2hhcnQ7Cit9CisKZGlmZiAtLWdpdCBhL2Vjb21wLXBvcnRhbC1CRS93YXIvc3RhdGljL2Z1c2lvbi9kMy9qcy9tb2RlbHMvbXVsdGlCYXJUaW1lU2VyaWVzQ2hhcnQuanMgYi9lY29tc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aG93TGVnZW5kID0gdHJ1ZQorICAgICwgcmVkdWNlWFRpY2tzID0gdHJ1ZSAvLyBpZiBmYWxzZSBhIHRpY2sgd2lsbCBzaG93IGZvciBldmVyeSBkYXRhIHBvaW50CisgICAgLCByb3RhdGVMYWJlbHMgPSAwCisgICAgLCB0b29sdGlwcyA9IHRydWUKKyAgICAsIHRvb2x0aXAgPSBmdW5jdGlvbihrZXksIHgsIHksIGUsIGdyYXBoKSB7CisgICAgICAgIHJldHVybiAnPGgzPicgKyBrZXkgKyAnPC9oMz4nICsKKyAgICAgICAgICAgICAgICc8cD4nICsgIHkgKyAnIG9uICcgKyB4ICsgJzwvcD4nCisgICAgICB9CisgICAgLCB4IC8vY2FuIGJlIGFjY2Vzc2VkIHZpYSBjaGFydC54U2NhbGUoKQorICAgICwgeSAvL2NhbiBiZSBhY2Nlc3NlZCB2aWEgY2hhcnQueVNjYWxlKCkKKyAgICAsIG5vRGF0YSA9ICJObyBEYXRhIEF2YWlsYWJsZS4iCisgICAgLCBkaXNwYXRjaCA9IGQzLmRpc3BhdGNoKCd0b29sdGlwU2hvdycsICd0b29sdGlwSGlkZScpCisgICAgOworCisgIG11bHRpYmFyCisgICAgLnN0YWNrZWQoZmFsc2UpCisgICAgOworICB4QXhpcworICAgIC5vcmllbnQoJ2JvdHRvbScpCisgICAgLnRpY2tQYWRkaW5nKDcpCisgICAgLmhpZ2hsaWdodFplcm8oZmFsc2UpCisgICAgLnNob3dNYXhNaW4oZmFsc2UpCisgICAgOworICB5QXhpcworICAgIC5vcmllbnQoJ2xlZnQnKQorICAgIC50aWNrRm9ybWF0KGQzLmZvcm1hdCgnLC4xZicpKQorICAgIDsKKworICAvLz09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorCisKKyAgLy89PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKyAgLy8gUHJpdmF0ZSBWYXJp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nZycpOworICAgICAgdmFyIGcgPSB3cmFwLnNlbGVjdCgnZycpOworCisgICAgICBnRW50ZXIuYXBwZW5kKCdnJykuYXR0cignY2xhc3MnLCAnbnYteCBudi1heGlzJyk7CisgICAgICBnRW50ZXIuYXBwZW5kKCdnJykuYXR0cignY2xhc3MnLCAnbnYteSBudi1heGlzJyk7CisgICAgICBnRW50ZXIuYXBwZW5kKCdnJykuYXR0cignY2xhc3MnLCAnbnYtYmFyc1dyYXAnKTsKKyAgICAgIGdFbnRlci5hcHBlbmQoJ2cnKS5hdHRyKCdjbGFzcycsICdudi1sZWdlbmRXcmFwJyk7CisgICAgICBnRW50ZXIuYXBwZW5kKCdnJykuYXR0cignY2xhc3MnLCAnbnYtY29udHJvbHNXcmFwJyk7CisKKyAgICAgIC8vLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tCisKKworICAgICAgLy8tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0KKyAgICAgIC8vIExlZ2VuZAorCisgICAgICBpZiAoc2hvd0xlZ2VuZCkgeworICAgICAgICBsZWdlbmQud2lkdGgoYXZhaWxhYmxlV2lkdGggLyAyKTsKKworICAgICAgICBnLnNlbGVjdCgnLm52LWxlZ2VuZFdyYXAnKQorICAgICAgICAgICAgLmRhdHVtKGRhdGEpCisgICAgICAgICAgICAuY2FsbChsZWdlbmQpOworCisgICAgICAgIGlmICggbWFyZ2luLnRvcCAhPSBsZWdlbmQuaGVpZ2h0KCkpIHsKKyAgICAgICAgICBtYXJnaW4udG9wID0gbGVnZW5kLmhlaWdodCgpOworICAgICAgICAgIGF2YWlsYWJsZUhlaWdodCA9IChoZWlnaHQgfHwgcGFyc2VJbnQoY29udGFpbmVyLnN0eWxlKCdoZWlnaHQnKSkgfHwgNDAwKQorICAgICAgICAgICAgICAgICAgIC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AgLnRpY2tzKGF2YWlsYWJsZVdpZHRoIC8gMTAwKSAgICAgICAgCisgICAgICAgIC50aWNrU2l6ZSgtYXZhaWxhYmxlSGVpZ2h0LCAwKTsKKworICAgICAgZy5zZWxlY3QoJy5udi14Lm52LWF4aXMnKQorICAgICAgICAgIC5hdHRyKCd0cmFuc2Zvcm0nLCAndHJhbnNsYXRlKDAsJyArIHkucmFuZ2UoKVswXSArICcpJyk7CisgICAgICBkMy50cmFuc2l0aW9uKGcuc2VsZWN0KCcubnYteC5udi1heGlzJykpCisgICAgICAgICAgLmNhbGwoeEF4aXMpOworCisgICAgICB2YXIgeFRpY2tzID0gZy5zZWxlY3QoJy5udi14Lm52LWF4aXMgPiBnJykuc2VsZWN0QWxsKCdnJyk7CisKKyAgICAgIHhUaWNrcworICAgICAgICAgIC5zZWxlY3RBbGwoJ2xpbmUsIHRleHQnKQorICAgICAgICAgIC5zdHlsZSgnb3BhY2l0eScsIDEpCisKKyAgICAgIGlmIChyZWR1Y2VYVGlja3MpCisgICAgICAgIHhUaWNrcworICAgICAgICAgIC5maWx0ZXIoZnVuY3Rpb24oZCxpKSB7CisgICAgICAgICAgICAgIHJldHVybiBpICUgTWF0aC5jZWlsKGRhdGFbMF0udmFsdWVzLmxlbmd0aCAvIChhdmFpbGFibGVXaWR0aCAvIDEwMCkpICE9PSAwOworICAgICAgICAgICAgfSkKKyAgICAgICAgICAuc2VsZWN0QWxsKCd0ZXh0LCBsaW5lJykKKyAgICAgICAgICAuc3R5bGUoJ29wYWNpdHknLCAwKTsKKworICAgICAgaWYocm90YXRlTGFiZWxzKQorICAgICAgICB4VGlja3MKKyAgICAgICAgICAgIC5zZWxlY3RBbGwoJ3RleHQnKQorICAgICAgICAgICAgLmF0dHIoJ3RyYW5zZm9ybScsIGZ1bmN0aW9uKGQsaSxqKSB7IHJldHVybiAncm90YXRlKCcrcm90YXRlTGFiZWxzKycgMCwwKScgfSkKKyAgICAgICAgICAgIC5hdHRyKCd0ZXh0LXRyYW5zZm9ybScsIHJvdGF0ZUxhYmVscyA+IDAgPyAnc3RhcnQnIDogJ2VuZCcpOworCisgICAgICB5QXhpcworICAgICAgICAuc2NhbGUoeSkKKyAgICAgICAgLnRpY2tzKCBhdmFpbGFibGVIZWlnaHQgLyAzNiApCisgICAgICAgIC50aWNrU2l6ZSggLWF2YWlsYWJsZVdpZHRoLCAwKTsKKworICAgICAgZDMudHJhbnNpdGlvbihnLnNlbGVjdCgnLm52LXkubnYtYXhpcycpKQorICAgICAgICAgIC5jYWxsKHlBeGlzKTsKKworICAgICAgLy8tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0KKworCisKKyAgICAgIC8vPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisgICAgICAvLyBFdmVudCBIYW5kbGluZy9EaXNwYXRjaGluZyAoaW4gY2hhcnQncyBzY29wZSkKKyAgICAgIC8vLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tCisKKyAgICAgIGxlZ2VuZC5kaXNwYXRjaC5vbignbGVnZW5kQ2xpY2snLCBmdW5jdGlvbihkLGkpIHsKKyAgICAgICAgZC5kaXNhYmxlZCA9ICFkLmRpc2FibGVkOworCisgICAgICAgIGlmICghZGF0YS5maWx0ZXIoZnVuY3Rpb24oZCkgeyByZXR1cm4gIWQuZGlzYWJsZWQgfSkubGVuZ3RoKSB7CisgICAgICAgICAgZGF0YS5tYXAoZnVuY3Rpb24oZCkgeworICAgICAgICAgICAgZC5kaXNhYmxlZCA9IGZhbHNlOworICAgICAgICAgICAgd3JhcC5zZWxlY3RBbGwoJy5udi1zZXJpZXMnKS5jbGFzc2VkKCdkaXNhYmxlZCcsIGZhbHNlKTsKKyAgICAgICAgICAgIHJldHVybiBkOworICAgICAgICAgIH0pOworICAgICAgICB9CisKKyAgICAgICAgc2VsZWN0aW9uLnRyYW5zaXRpb24oKS5jYWxsKGNoYXJ0KTsKKyAgICAgIH0pOworCisgICAgICBjb250cm9scy5kaXNwYXRjaC5vbignbGVnZW5kQ2xpY2snLCBmdW5jdGlvbihkLGkpIHsKKyAgICAgICAgaWYgKCFkLmRpc2FibGVkKSByZXR1cm47CisgICAgICAgIGNvbnRyb2xzRGF0YSA9IGNvbnRyb2xzRGF0YS5tYXAoZnVuY3Rpb24ocykgeworICAgICAgICAgIHMuZGlzYWJsZWQgPSB0cnVlOworICAgICAgICAgIHJldHVybiBzOworICAgICAgICB9KTsKKyAgICAgICAgZC5kaXNhYmxlZCA9IGZhbHNlOworCisgICAgICAgIHN3aXRjaCAoZC5rZXkpIHsKKyAgICAgICAgICBjYXNlICdHcm91cGVkJzoKKyAgICAgICAgICAgIG11bHRpYmFyLnN0YWNrZWQoZmFsc2UpOworICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgY2FzZSAnU3RhY2tlZCc6CisgICAgICAgICAgICBtdWx0aWJhci5zdGFja2VkKHRydWUpOworICAgICAgICAgICAgYnJlYWs7CisgICAgICAgIH0KKworICAgICAgICBzZWxlY3Rpb24udHJhbnNpdGlvbigpLmNhbGwoY2hhcnQpOworICAgICAgfSk7CisKKyAgICAgIGRpc3BhdGNoLm9uKCd0b29sdGlwU2hvdycsIGZ1bmN0aW9uKGUpIHsKKyAgICAgICAgaWYgKHRvb2x0aXBzKSBzaG93VG9vbHRpcChlLCB0aGF0LnBhcmVudE5vZGUpCisgICAgICB9KTsKKworICAgICAgLy89PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKworCisgICAgfSk7CisKKyAgICByZXR1cm4gY2hhcnQ7CisgIH0KKworCisgIC8vPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisgIC8vIEV2ZW50IEhhbmRsaW5nL0Rpc3BhdGNoaW5nIChvdXQgb2YgY2hhcnQncyBzY29wZSkKKyAgLy8tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0KKworICBtdWx0aWJhci5kaXNwYXRjaC5vbignZWxlbWVudE1vdXNlb3Zlci50b29sdGlwJywgZnVuY3Rpb24oZSkgeworICAgIGUucG9zID0gW2UucG9zWzBdICsgIG1hcmdpbi5sZWZ0LCBlLnBvc1sxXSArIG1hcmdpbi50b3BdOworICAgIGRpc3BhdGNoLnRvb2x0aXBTaG93KGUpOworICB9KTsKKworICBtdWx0aWJhci5kaXNwYXRjaC5vbignZWxlbWVudE1vdXNlb3V0LnRvb2x0aXAnLCBmdW5jdGlvbihlKSB7CisgICAgZGlzcGF0Y2gudG9vbHRpcEhpZGUoZSk7CisgIH0pOworICBkaXNwYXRjaC5vbigndG9vbHRpcEhpZGUnLCBmdW5jdGlvbigpIHsKKyAgICBpZiAodG9vbHRpcHMpIG52LnRvb2x0aXAuY2xlYW51cCgpOworICB9KTsKKworICAvLz09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorCisKKyAgLy89PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKyAgLy8gRXhwb3NlIFB1YmxpYyBWYXJpYWJsZXMKKyAgLy8tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0KKworICAvLyBleHBvc2UgY2hhcnQncyBzdWItY29tcG9uZW50cworICBjaGFydC5kaXNwYXRjaCA9IGRpc3BhdGNoOworICBjaGFydC5tdWx0aWJhciA9IG11bHRpYmFyOworICBjaGFydC5sZWdlbmQgPSBsZWdlbmQ7CisgIGNoYXJ0LnhBeGlzID0geEF4aXM7CisgIGNoYX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ByZXR1cm4gY2hhcnQ7CisgIH07CisKKyAgY2hhcnQudG9vbHRpcHMgPSBmdW5jdGlvbihfKSB7CisgICAgaWYgKCFhcmd1bWVudHMubGVuZ3RoKSByZXR1cm4gdG9vbHRpcHM7CisgICAgdG9vbHRpcHMgPSBfOworICAgIHJldHVybiBjaGFydDsKKyAgfTsKKworICBjaGFydC50b29sdGlwQ29udGVudCA9IGZ1bmN0aW9uKF8pIHsKKyAgICBpZiAoIWFyZ3VtZW50cy5sZW5ndGgpIHJldHVybiB0b29sdGlwOworICAgIHRvb2x0aXAgPSBfOworICAgIHJldHVybiBjaGFydDsKKyAgfTsKKworICBjaGFydC5ub0RhdGEgPSBmdW5jdGlvbihfKSB7CisgICAgaWYgKCFhcmd1bWVudHMubGVuZ3RoKSByZXR1cm4gbm9EYXRhOworICAgIG5vRGF0YSA9IF87CisgICAgcmV0dXJuIGNoYXJ0OworICB9OworCisgIC8vPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisKKworICByZXR1cm4gY2hhcnQ7Cit9CisKZGlmZiAtLWdpdCBhL2Vjb21wLXBvcnRhbC1CRS93YXIvc3RhdGljL2Z1c2lvbi9kMy9qcy9tb2RlbHMvbXVsdGlDaGFydC5qcyBiL2Vjb21wLXBvcnRhbC1CRS93YXIvc3RhdGljL2Z1c2lvbi9kMy9qcy9tb2RlbHMvbXVsdGlDaGFydC5qcwpuZXcgZmlsZSBtb2RlIDEwMDY0NAppbmRleCAwMDAwMDAwLi5lM2UyYzVlCi0tLSAvZGV2L251bGwKKysrIGIvZWNvbXAtcG9ydGFsLUJFL3dhci9zdGF0aWMvZnVzaW9uL2QzL2pzL21vZGVscy9tdWx0aUNoYXJ0LmpzCkBAIC0wLDAgKzEsNDUyIEBACitudi5tb2RlbHMubXVsdGlDaGFydCA9IGZ1bmN0aW9uKCkgeworICAidXNlIHN0cmljdCI7CisgIC8vPT09PT09PT09PT09PT09PT09PT09PT09P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FsZTIgPSBkMy5zY2FsZS5saW5lYXIoKSwKKworICAgICAgbGluZXMxID0gbnYubW9kZWxzLmxpbmUoKS55U2NhbGUoeVNjYWxlMSksCisgICAgICBsaW5lczIgPSBudi5tb2RlbHMubGluZSgpLnlTY2FsZSh5U2NhbGUyKSwKKworICAgICAgYmFyczEgPSBudi5tb2RlbHMubXVsdGlCYXIoKS5zdGFja2VkKGZhbHNlKS55U2NhbGUoeVNjYWxlMSksCisgICAgICBiYXJzMiA9IG52Lm1vZGVscy5tdWx0aUJhcigpLnN0YWNrZWQoZmFsc2UpLnlTY2FsZSh5U2NhbGUyKSwKKworICAgICAgc3RhY2sxID0gbnYubW9kZWxzLnN0YWNrZWRBcmVhKCkueVNjYWxlKHlTY2FsZTEpLAorICAgICAgc3RhY2syID0gbnYubW9kZWxzLnN0YWNrZWRBcmVhKCkueVNjYWxlKHlTY2FsZTIpLAorCisgICAgICB4QXhpcyA9IG52Lm1vZGVscy5heGlzKCkuc2NhbGUoeCkub3JpZW50KCdib3R0b20nKS50aWNrUGFkZGluZyg1KSwKKyAgICAgIHlBeGlzMSA9IG52Lm1vZGVscy5heGlzKCkuc2NhbGUoeVNjYWxlMSkub3JpZW50KCdsZWZ0JyksCisgICAgICB5QXhpczIgPSBudi5tb2RlbHMuYXhpcygpLnNjYWxlKHlTY2FsZTIpLm9yaWVudCgncmlnaHQnKSwKKworICAgICAgbGVnZW5kID0gbnYubW9kZWxzLmxlZ2VuZCgpLmhlaWdodCgzMCksCisgICAgICBkaXNwYXRjaCA9IGQzLmRpc3BhdGNoKCd0b29sdGlwU2hvdycsICd0b29sdGlwSGlkZScpOworCisgIHZhciBzaG93VG9vbHRpcCA9IGZ1bmN0aW9uKGUsIG9mZnNldEVsZW1lbnQpIHsKKyAgICB2YXIgbGVmdCA9IGUucG9zWzBdICsgKCBvZmZzZXRFbGVtZW50Lm9mZnNldExlZnQgfHwgMCApLAorICAgICAgICB0b3AgPSBlLnBvc1sxXSArICggb2Zmc2V0RWxlbWVudC5vZmZzZXRUb3AgfHwgMCksCisgICAgICAgIHggPSB4QXhpcy50aWNrRm9ybWF0KCkobGluZXMxLngoKShlLnBvaW50LCBlLnBvaW50SW5kZXgpKSwKKyAgICAgICAgeSA9ICgoZS5zZXJpZXMueUF4aXMgPT0gMikgPyB5QXhpczIgOiB5QXhpczEpLnRpY2tGb3JtYXQoKShsaW5lczEueSgpKGUucG9pbnQsIGUucG9pbnRJbmRleCkpLAorICAgICAgICBjb250ZW50ID0gdG9vbHRpcChlLnNlcmllcy5rZXksIHgsIHksIGUsIGNoYXJ0KTsKKworICAgIG52LnRvb2x0aXAuc2hvdyhbbGVmdCwgdG9wXSwgY29udGVudCwgdW5kZWZpbmVkLCB1bmRlZmluZWQsIG9mZnNldEVsZW1lbnQub2Zmc2V0UGFyZW50KTsKKyAgfTsKKworICBmdW5jdGlvbiBjaGFydChzZWxlY3Rpb24pIHsKKyAgICBzZWxlY3Rpb24uZWFjaChmdW5jdGlvbihkYXRhKSB7CisgICAgICB2YXIgY29udGFpbmVyID0gZDMuc2VsZWN0KHRoaXMpLAorICAgICAgICAgIHRoYXQgPSB0aGlzOworCisgICAgICBjaGFydC51cGRhdGUgPSBmdW5jdGlvbigpIHsgY29udGFpbmVyLnRyYW5zaXRpb24oKS5jYWxsKGNoYXJ0KTsgfTsKKyAgICAgIGNoYXJ0LmNvbnRhaW5lciA9IHRoaXM7CisKKyAgICAgIHZhciBhdmFpbGFibGVXaWR0aCA9ICh3aWR0aCAgfHwgcGFyc2VJbnQoY29udGFpbmVyLnN0eWxlKCd3aWR0aCcpKSB8fCA5NjApCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC0gbWFyZ2luLmxlZnQgLSBtYXJnaW4ucmlnaHQsCisgICAgICAgICAgYXZhaWxhYmxlSGVpZ2h0ID0gKGhlaWdodCB8fCBwYXJzZUludChjb250YWluZXIuc3R5bGUoJ2hlaWdodCcpKSB8fCA0MDApCisgICAgICAgICAgICAgICAgICAgICAgICA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XMubWFwKGZ1bmN0aW9uKGQsaSkgeworICAgICAgICAgICAgICAgIHJldHVybiB7IHg6IGQueCwgeTogZC55IH0KKyAgICAgICAgICAgICAgfSkKKyAgICAgICAgICAgIH0pCisKKyAgICAgIHZhciBzZXJpZXMyID0gZGF0YS5maWx0ZXIoZnVuY3Rpb24oZCkge3JldHVybiAhZC5kaXNhYmxlZCAmJiBkLnlBeGlzID09IDJ9KQorICAgICAgICAgICAgLm1hcChmdW5jdGlvbihkKSB7CisgICAgICAgICAgICAgIHJldHVybiBkLnZhbHVlcy5tYXAoZnVuY3Rpb24oZCxpKSB7CisgICAgICAgICAgICAgICAgcmV0dXJuIHsgeDogZC54LCB5OiBkLnkgfQorICAgICAgICAgICAgICB9KQorICAgICAgICAgICAgfSkKKworICAgICAgeCAgIC5kb21haW4oZDMuZXh0ZW50KGQzLm1lcmdlKHNlcmllczEuY29uY2F0KHNlcmllczIpKSwgZnVuY3Rpb24oZCkgeyByZXR1cm4gZC54IH0gKSkKKyAgICAgICAgICAucmFuZ2UoWzAsIGF2YWlsYWJsZVdpZHRoXSk7CisKKyAgICAgIHZhciB3cmFwID0gY29udGFpbmVyLnNlbGVjdEFsbCgnZy53cmFwLm11bHRpQ2hhcnQnKS5kYXRhKFtkYXRhXSk7CisgICAgICB2YXIgZ0VudGVyID0gd3JhcC5lbnRlcigpLmFwcGVuZCgnZycpLmF0dHIoJ2NsYXNzJywgJ3dyYXAgbnZkMyBtdWx0aUNoYXJ0JykuYXBwZW5kKCdnJyk7CisKKyAgICAgIGdFbnRlci5hcHBlbmQoJ2cnKS5hdHRyKCdjbGFzcycsICd4IGF4aXMnKTsKKyAgICAgIGdFbnRlci5hcHBlbmQoJ2cnKS5hdHRyKCdjbGFzcycsICd5MSBheGlzJyk7CisgICAgICBnRW50ZXIuYXBwZW5kKCdnJykuYXR0cignY2xhc3MnLCAneTIgYXhpcycpOworICAgICAgZ0VudGVyLmFwcGVuZCgnZycpLmF0dHIoJ2NsYXNzJywgJ2xpbmVzMVdyYXAnKTsKKyAgICAgIGdFbnRlci5hcHBlbmQoJ2cnKS5hdHRyKCdjbGFzcycsICdsaW5lczJXcmFwJyk7CisgICAgICBnRW50ZXIuYXBwZW5kKCdnJykuYXR0cignY2xhc3MnLCAnYmFyczFXcmFwJyk7CisgICAgICBnRW50ZXIuYXBwZW5kKCdnJykuYXR0cignY2xhc3MnLCAnYmFyczJXcmFwJyk7CisgICAgICBnRW50ZXIuYXBwZW5kKCdnJykuYXR0cignY2xhc3MnLCAnc3RhY2sxV3JhcCcpOworICAgICAgZ0VudGVyLmFwcGVuZCgnZycpLmF0dHIoJ2NsYXNzJywgJ3N0YWNrMldyYXAnKTsKKyAgICAgIGdFbnRlci5hcHBlbmQoJ2cnKS5hdHRyKCdjbGFzcycsICdsZWdlbmRXcmFwJyk7CisKKyAgICAgIHZhciBnID0gd3JhcC5zZWxlY3QoJ2cnKTsKKworICAgICAgaWYgKHNob3dMZWdlbmQpIHsKKyAgICAgICAgbGVnZW5kLndpZHRoKCBhdmFpbGFibGVXaWR0aCAvIDIgKTsKKworICAgICAgICBnLnNlbGVjdCgnLmxlZ2VuZFdyYXAnKQorICAgICAgICAgICAgLmRhdHVtKGRhdGEubWFwKGZ1bmN0aW9uKHNlcmllcykgeyAKKyAgICAgICAgICAgICAgc2VyaWVzLm9yaWdpbmFsS2V5ID0gc2VyaWVzLm9yaWdpbmFsS2V5ID09PSB1bmRlZmluZWQgPyBzZXJpZXMua2V5IDogc2VyaWVzLm9yaWdpbmFsS2V5OworICAgICAgICAgICAgICBzZXJpZXMua2V5ID0gc2VyaWVzLm9yaWdpbmFsS2V5ICsgKHNlcmllcy55QXhpcyA9PSAxID8gJycgOiAnIChyaWdodCBheGlzKScpOworICAgICAgICAgICAgICByZXR1cm4gc2VyaWVzOworICAgICAgICAgICAgfSkpCisgICAgICAgICAgLmNhbGwobGVnZW5kKTsKKworICAgICAgICBpZiAoIG1hcmdpbi50b3AgIT0gbGVnZW5kLmhlaWdodCgpKSB7CisgICAgICAgICAgbWFyZ2luLnRvcCA9IGxlZ2VuZC5oZWlnaHQoKTsKKyAgICAgICAgICBhdmFpbGFibGVIZWlnaHQgPSAoaGVpZ2h0IHx8IHBhcnNlSW50KGNvbnRhaW5lci5zdHlsZSgnaGVpZ2h0JykpIHx8IDQwMCkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLSBtYXJnaW4udG9wIC0gbWFyZ2luLmJvdHRvbTsKKyAgICAgICAgfQorCisgICAgICAgIGcuc2VsZWN0KCcubGVnZW5kV3JhcCcpCisgICAgICAgICAgICAuYXR0cigndHJhbnNmb3JtJywgJ3RyYW5zbGF0ZSgnICsgKCBhdmFpbGFibGVXaWR0aCAvIDIgKSArICcsJyArICgtbWFyZ2luLnRvcCkgKycpJyk7CisgICAgICB9CisKKworICAgICAgbGluZXMxCisgICAgICAgIC53aWR0aChhdmFpbGFibGVXaWR0aCkKKyAgICAgICAgLmhlaWdodChhdmFpbGFibGVIZWlnaHQpCisgICAgICAgIC5pbnRlcnBvbGF0ZSgibW9ub3RvbmUiKQorICAgICAgICAuY29sb3IoZGF0YS5tYXAoZnVuY3Rpb24oZCxpKSB7CisgICAgICAgICAgcmV0dXJuIGQuY29sb3IgfHwgY29sb3JbaSAlIGNvbG9yLmxlbmd0aF07CisgICAgICAgIH0pLmZpbHRlcihmdW5jdGlvbihkLGkpIHsgcmV0dXJuICFkYXRhW2ldLmRpc2FibGVkICYmIGRhdGFbaV0ueUF4aXMgPT0gMSAmJiBkYXRhW2ldLnR5cGUgPT0gJ2xpbmUnfSkpOworCisgICAgICBsaW5lczIKKyAgICAgICAgLndpZHRoKGF2YWlsYWJsZVdpZHRoKQorICAgICAgICAuaGVpZ2h0KGF2YWlsYWJsZUhlaWdodCkKKyAgICAgICAgLmludGVycG9sYXRlKCJtb25vdG9uZSIpCisgICAgICAgIC5jb2xvcihkYXRhLm1hcChmdW5jdGlvbihkLGkpIHsKKyAgICAgICAgICByZXR1cm4gZC5jb2x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geworICAgICAgICAgIHJldHVybiBkLmNvbG9yIHx8IGNvbG9yW2kgJSBjb2xvci5sZW5ndGhdOworICAgICAgICB9KS5maWx0ZXIoZnVuY3Rpb24oZCxpKSB7IHJldHVybiAhZGF0YVtpXS5kaXNhYmxlZCAmJiBkYXRhW2ldLnlBeGlzID09IDEgJiYgZGF0YVtpXS50eXBlID09ICdhcmVhJ30pKTsKKworICAgICAgc3RhY2syCisgICAgICAgIC53aWR0aChhdmFpbGFibGVXaWR0aCkKKyAgICAgICAgLmhlaWdodChhdmFpbGFibGVIZWlnaHQpCisgICAgICAgIC5jb2xvcihkYXRhLm1hcChmdW5jdGlvbihkLGkpIHsKKyAgICAgICAgICByZXR1cm4gZC5jb2xvciB8fCBjb2xvcltpICUgY29sb3IubGVuZ3RoXTsKKyAgICAgICAgfSkuZmlsdGVyKGZ1bmN0aW9uKGQsaSkgeyByZXR1cm4gIWRhdGFbaV0uZGlzYWJsZWQgJiYgZGF0YVtpXS55QXhpcyA9PSAyICYmIGRhdGFbaV0udHlwZSA9PSAnYXJlYSd9KSk7CisKKyAgICAgIGcuYXR0cigndHJhbnNmb3JtJywgJ3RyYW5zbGF0ZSgnICsgbWFyZ2luLmxlZnQgKyAnLCcgKyBtYXJnaW4udG9wICsgJyknKTsKKworCisgICAgICB2YXIgbGluZXMxV3JhcCA9IGcuc2VsZWN0KCcubGluZXMxV3JhcCcpCisgICAgICAgICAgLmRhdHVtKGRhdGFMaW5lczEpCisgICAgICB2YXIgYmFyczFXcmFwID0gZy5zZWxlY3QoJy5iYXJzMVdyYXAnKQorICAgICAgICAgIC5kYXR1bShkYXRhQmFyczEpCisgICAgICB2YXIgc3RhY2sxV3JhcCA9IGcuc2VsZWN0KCcuc3RhY2sxV3JhcCcpCisgICAgICAgICAgLmRhdHVtKGRhdGFTdGFjazEpCisKKyAgICAgIHZhciBsaW5lczJXcmFwID0gZy5zZWxlY3QoJy5saW5lczJXcmFwJykKKyAgICAgICAgICAuZGF0dW0oZGF0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y5tZXJnZShzZXJpZXMyKS5jb25jYXQoZXh0cmFWYWx1ZTIpLCBmdW5jdGlvbihkKSB7IHJldHVybiBkLnkgfSApKQorICAgICAgICAgICAgICAucmFuZ2UoWzAsIGF2YWlsYWJsZUhlaWdodF0pCisKKyAgICAgIGxpbmVzMS55RG9tYWluKHlTY2FsZTEuZG9tYWluKCkpCisgICAgICBiYXJzMS55RG9tYWluKHlTY2FsZTEuZG9tYWluKCkpCisgICAgICBzdGFjazEueURvbWFpbih5U2NhbGUxLmRvbWFpbigpKQorCisgICAgICBsaW5lczIueURvbWFpbih5U2NhbGUyLmRvbWFpbigpKQorICAgICAgYmFyczIueURvbWFpbih5U2NhbGUyLmRvbWFpbigpKQorICAgICAgc3RhY2syLnlEb21haW4oeVNjYWxlMi5kb21haW4oKSkKKworICAgICAgaWYoZGF0YVN0YWNrMS5sZW5ndGgpe2QzLnRyYW5zaXRpb24oc3RhY2sxV3JhcCkuY2FsbChzdGFjazEpO30KKyAgICAgIGlmKGRhdGFTdGFjazIubGVuZ3RoKXtkMy50cmFuc2l0aW9uKHN0YWNrMldyYXApLmNhbGwoc3RhY2syKTt9CisKKyAgICAgIGlmKGRhdGFCYXJzMS5sZW5ndGgpe2QzLnRyYW5zaXRpb24oYmFyczFXcmFwKS5jYWxsKGJhcnMxKTt9CisgICAgICBpZihkYXRhQmFyczIubGVuZ3RoKXtkMy50cmFuc2l0aW9uKGJhcnMyV3JhcCkuY2FsbChiYXJzMik7fQorCisgICAgICBpZihkYXRhTGluZXMxLmxlbmd0aCl7ZDMudHJhbnNpdGlvbihsaW5lczFXcmFwKS5jYWxsKGxpbmVzMSk7fQorICAgICAgaWYoZGF0YUxpbmVzMi5sZW5ndGgpe2QzLnRyYW5zaXRpb24obGluZXMyV3JhcCkuY2FsbChsaW5lczIpO30KKyAgICAgIAorCisKKyAgICAgIHhBeGlzCisgICAgICAgIC50aWNrcyggYXZhaWxhYmxlV2lkdGggLyAxMDAgKQorICAgICAgICAudGlja1NpemUoLWF2YWlsYWJsZUhlaWdodCwgMCk7CisKKyAgICAgIGcuc2VsZWN0KCcueC5heGlzJykKKyAgICAgICAgICAuYXR0cigndHJhbnNmb3JtJywgJ3RyYW5zbGF0ZSgwLCcgKyBhdmFpbGFibGVIZWlnaHQgKyAnKScpOworICAgICAgZDMudHJhbnNpdGlvbihnLnNlbGVjdCgnLnguYXhpcycpKQorICAgICAgICAgIC5jYWxsKHhBeGlzKTsKKworICAgICAgeUF4aXMxCisgICAgICAgIC50aWNrcyggYXZhaWxhYmxlSGVpZ2h0IC8gMzYgKQorICAgICAgICAudGlja1NpemUoIC1hdmFpbGFibGVXaWR0aCwgMCk7CisKKworICAgICAgZDMudHJhbnNpdGlvbihnLnNlbGVjdCgnLnkxLmF4aXMnKSkKKyAgICAgICAgICAuY2FsbCh5QXhpczEpOworCisgICAgICB5QXhpczIKKyAgICAgICAgLnRpY2tzKCBhdmFpbGFibGVIZWlnaHQgLyAzNiApCisgICAgICAgIC50aWNrU2l6ZSggLWF2YWlsYWJsZVdpZHRoLCAwKTsKKworICAgICAgZDMudHJhbnNpdGlvbihnLnNlbGVjdCgnLnkyLmF4aXMnKSkKKyAgICAgICAgICAuY2FsbCh5QXhpczIpOworCisgICAgICBnLnNlbGVjdCgnLnkyLmF4aXMnKQorICAgICAgICAgIC5zdHlsZSgnb3BhY2l0eScsIHNlcmllczIubGVuZ3RoID8gMSA6IDApCisgICAgICAgICAgLmF0dHIoJ3RyYW5zZm9ybScsICd0cmFuc2xhdGUoJyArIHgucmFuZ2UoKVsxXSArICcsMCknKTsKKworICAgICAgbGVnZW5kLmRpc3BhdGNoLm9uKCdzdGF0ZUNoYW5nZScsIGZ1bmN0aW9uKG5ld1N0YXRlKSB7IAorICAgICAgICBjaGFydC51cGRhdGUoKTsKKyAgICAgIH0pOworICAgICAKKyAgICAgIGRpc3BhdGNoLm9uKCd0b29sdGlwU2hvdycsIGZ1bmN0aW9uKGUpIHsKKyAgICAgICAgaWYgKHRvb2x0a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AgIGUucG9zID0gW2UucG9zWzBdICsgbWFyZ2luLmxlZnQsIGUucG9zWzFdICsgbWFyZ2luLnRvcF0sCisgICAgZGlzcGF0Y2gudG9vbHRpcFNob3coZSk7CisgIH0pOworCisgIHN0YWNrMi5kaXNwYXRjaC5vbigndG9vbHRpcEhpZGUnLCBmdW5jdGlvbihlKSB7CisgICAgZGlzcGF0Y2gudG9vbHRpcEhpZGUoZSk7CisgIH0pOworCisgICAgbGluZXMxLmRpc3BhdGNoLm9uKCdlbGVtZW50TW91c2VvdmVyLnRvb2x0aXAnLCBmdW5jdGlvbihlKSB7CisgICAgZS5wb3MgPSBbZS5wb3NbMF0gKyAgbWFyZ2luLmxlZnQsIGUucG9zWzFdICsgbWFyZ2luLnRvcF07CisgICAgZGlzcGF0Y2gudG9vbHRpcFNob3coZSk7CisgIH0pOworCisgIGxpbmVzMS5kaXNwYXRjaC5vbignZWxlbWVudE1vdXNlb3V0LnRvb2x0aXAnLCBmdW5jdGlvbihlKSB7CisgICAgZGlzcGF0Y2gudG9vbHRpcEhpZGUoZSk7CisgIH0pOworCisgIGxpbmVzMi5kaXNwYXRjaC5vbignZWxlbWVudE1vdXNlb3Zlci50b29sdGlwJywgZnVuY3Rpb24oZSkgeworICAgIGUucG9zID0gW2UucG9zWzBdICsgIG1hcmdpbi5sZWZ0LCBlLnBvc1sxXSArIG1hcmdpbi50b3BdOworICAgIGRpc3BhdGNoLnRvb2x0aXBTaG93KGUpOworICB9KTsKKworICBsaW5lczIuZGlzcGF0Y2gub24oJ2VsZW1lbnRNb3VzZW91dC50b29sdGlwJywgZnVuY3Rpb24oZSkgeworICAgIGRpc3BhdGNoLnRvb2x0aXBIaWRlKGUpOworICB9KTsKKworICBkaXNwYXRjaC5vbigndG9vbHRpcEhpZGUnLCBmdW5jdGlvbigpIHsKKyAgICBpZiAodG9vbHRpcHMpIG52LnRvb2x0aXAuY2xlYW51cCgpOworICB9KTsKKworCisKKyAgLy89PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKyAgLy8gR2xvYmFsIGdldHRlcnMgYW5kIHNldHRlcnMKKyAgLy8tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0KKworICBjaGFydC5kaXNwYXRjaCA9IGRpc3BhdGNoOworICBjaGFydC5saW5lczEgPSBsaW5lczE7CisgIGNoYXJ0LmxpbmVzMiA9IGxpbmVzMjsKKyAgY2hhcnQuYmFyczEgPSBiYXJzMTsKKyAgY2hhcnQuYmFyczIgPSBiYXJzMjsKKyAgY2hhcnQuc3RhY2sxID0gc3RhY2sxOworICBjaGFydC5zdGFjazIgPSBzdGFjazI7CisgIGNoYXJ0LnhBeGlzID0geEF4aXM7CisgIGNoYXJ0LnlBeGlzMSA9IHlBeGlzMTsKKyAgY2hhcnQueUF4aXMyID0geUF4aXMyOworICBjaGFydC5vcHRpb25zID0gbnYudXRpbHMub3B0aW9uc0Z1bmMuYmluZChjaGFydCk7CisKKyAgY2hhcnQueCA9IGZ1bmN0aW9uKF8pIHsKKyAgICBpZiAoIWFyZ3VtZW50cy5sZW5ndGgpIHJldHVybiBnZXRYOworICAgIGdldFggPSBfOworICAgIGxpbmVzMS54KF8pOworICAgIGJhcnMxLngoXyk7CisgICAgcmV0dXJuIGNoYXJ0OworICB9OworCisgIGNoYXJ0LnkgPSBmdW5jdGlvbihfKSB7CisgICAgaWYgKCFhcmd1bWVudHMubGVuZ3RoKSByZXR1cm4gZ2V0WTsKKyAgICBnZXRZID0gXzsKKyAgICBsaW5lczEueShfKTsKKyAgICBiYXJzMS55KF8pOworICAgIHJldHVybiBjaGFydDsKKyAgfTsKKworICBjaGFydC55RG9tYWluMSA9IGZ1bmN0aW9uKF8pIHsKKyAgICBpZiAoIWFyZ3VtZW50cy5sZW5ndGgpIHJldHVybiB5RG9tYWluMTsKKyAgICB5RG9tYWluMSA9IF87CisgICAg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09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKworICAvLz09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorICAvLyBQcml2YXRlIFZhcmlhYmxlcworICAvLy0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLQorCisgIC8vVE9ETzogc3RvcmUgb2xkIHNjYWxlcyBmb3IgdHJhbnNpdGlvbnMKKworICAvLz09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorCisKKyAgZnVuY3Rpb24gY2hhcnQoc2VsZWN0aW9uKSB7CisgICAgc2VsZWN0aW9uLmVhY2goZnVuY3Rpb24oZGF0YSkgeworICAgICAgdmFyIGF2YWlsYWJsZVdpZHRoID0gd2lkdGggLSBtYXJnaW4ubGVmdCAtIG1hcmdpbi5yaWdodCwKKyAgICAgICAgICBhdmFpbGFibGVIZWlnaHQgPSBoZWlnaHQgLSBtYXJnaW4udG9wIC0gbWFyZ2luLmJvdHRvbSwKKyAgICAgICAgICBjb250YWluZXIgPSBkMy5zZWxlY3QodGhpcyk7CisKKworICAgICAgLy8tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0KKyAgICAgIC8vIFNldHVwIFNjYWxlcworCisgICAgICB4ICAgLmRvbWFpbih4RG9tYWluIHx8IGQzLmV4dGVudChkYXRhWzBdLnZhbHVlcy5tYXAoZ2V0WCkuY29uY2F0KGZvcmNlWCkgKSk7CisKKyAgICAgIGlmIChwYWREYXRhKQorICAgICAgICB4LnJhbmdlKHhSYW5nZSB8fCBbYXZhaWxhYmxlV2lkdGggKiAuNSAvIGRhdGFbMF0udmFsdWVzLmxlbmd0aCwgYXZhaWxhYmxlV2lkdGggKiAoZGF0YVswXS52YWx1ZXMubGVuZ3RoIC0gLjUpICAvIGRhdGFbMF0udmFsdWVzLmxlbmd0aCBdKTsKKyAgICAgIGVsc2UKKyAgICAgICAgeC5yYW5nZSh4UmFuZ2UgfHwgWzAsIGF2YWlsYWJsZVdpZHRoXSk7CisKKyAgICAgIHkgICAuZG9tYWluKHlEb21haW4gfHwgWworICAgICAgICAgICAgZDMubWluKGRhdGFbMF0udmFsdWVzLm1hcChnZXRMb3cpLmNvbmNhdChmb3JjZVkpKSwKKyAgICAgICAgICAgIGQzLm1heChkYXRhWzBdLnZhbHVlcy5tYXAoZ2V0SGlnaCkuY29uY2F0KGZvcmNlWSkpCisgICAgICAgICAgXSkKKyAgICAgICAgICAucmFuZ2UoeVJhbmdlIHx8IFthdmFpbGFibGVIZWlnaHQsIDBdKTsKKworICAgICAgLy8gSWYgc2NhbGUncyBkb21haW4gZG9uJ3QgaGF2ZSBhIHJhbmdlLCBzbGlnaHRseSBhZGp1c3QgdG8gbWFrZSBvbmUuLi4gc28gYSBjaGFydCBjYW4gc2hvdyBhIHNpbmdsZSBkYXRhIHBvaW50CisgICAgICBpZiAoeC5kb21haW4oKVswXSA9PT0geC5kb21haW4oKVsxXSkKKyAgICAgICAgeC5kb21haW4oKVswXSA/CisgICAgICAgICAgICB4LmRvbWFpbihbeC5kb21haW4oKVswXSAtIHguZG9tYWluKClbMF0gKiAwLjAxLCB4LmRvbWFpbigpWzFdICsgeC5kb21haW4oKVsxXSAqIDAuMDFdKQorICAgICAgICAgIDogeC5kb21haW4oWy0xLDFdKTsKKworICAgICAgaWYgKHkuZG9tYWluKClbMF0gPT09IHkuZG9tYWluKClbMV0pCisgICAgICAgIHkuZG9tYWluKClbMF0gPworICAgICAgICAgICAgeS5kb21haW4oW3kuZG9tYWluKClbMF0gKyB5LmRvbWFpbigpWzBdICogMC4wMSwgeS5kb21haW4oKVsxXSAtIHkuZG9tYWluKClbMV0gKiAwLjAxXSkKKyAgICAgICAgICA6IHkuZG9tYWluKFstMSwxXS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ICAgZGF0YTogZCwKKyAgICAgICAgICAgICAgICBpbmRleDogaSwKKyAgICAgICAgICAgICAgICBwb3M6IGQzLmV2ZW50LAorICAgICAgICAgICAgICAgIGlkOiBpZAorICAgICAgICAgICAgfSk7CisgICAgICAgICAgfSk7CisKKworICAgICAgZGVmc0VudGVyLmFwcGVuZCgnY2xpcFBhdGgnKQorICAgICAgICAgIC5hdHRyKCdpZCcsICdudi1jaGFydC1jbGlwLXBhdGgtJyArIGlkKQorICAgICAgICAuYXBwZW5kKCdyZWN0Jyk7CisKKyAgICAgIHdyYXAuc2VsZWN0KCcjbnYtY2hhcnQtY2xpcC1wYXRoLScgKyBpZCArICcgcmVjdCcpCisgICAgICAgICAgLmF0dHIoJ3dpZHRoJywgYXZhaWxhYmxlV2lkdGgpCisgICAgICAgICAgLmF0dHIoJ2hlaWdodCcsIGF2YWlsYWJsZUhlaWdodCk7CisKKyAgICAgIGcgICAuYXR0cignY2xpcC1wYXRoJywgY2xpcEVkZ2UgPyAndXJsKCNudi1jaGFydC1jbGlwLXBhdGgtJyArIGlkICsgJyknIDogJycpOworCisKKworICAgICAgdmFyIHRpY2tzID0gd3JhcC5zZWxlY3QoJy5udi10aWNrcycpLnNlbGVjdEFsbCgnLm52LXRpY2snKQorICAgICAgICAgIC5kYXRhKGZ1bmN0aW9uKGQpIHsgcmV0dXJuIGQgfSk7CisKKyAgICAgIHRpY2tzLmV4aXQoKS5yZW1vdmUoKTsKKworCisgICAgICB2YXIgdGlja3NFbnRlciA9IHRpY2tzLmVudGVyKCkuYXBwZW5kKCdwYXRoJykKKyAgICAgICAgICAuYXR0cignY2xhc3MnLCBmdW5jdGlvbihkLGksaikgeyByZXR1cm4gKGdldE9wZW4oZCxpKSA+IGdldENsb3NlKGQsaSkgPyAnbnYtdGljayBuZWdhdGl2ZScgOiAnbnYtdGljayBwb3NpdGl2ZScpICsgJyBudi10aWNrLScgKyBqICsgJy0nICsgaSB9KQorICAgICAgICAgIC5hdHRyKCdkJywgZnVuY3Rpb24oZCxpKSB7CisgICAgICAgICAgICB2YXIgdyA9IChhdmFpbGFibGVXaWR0aCAvIGRhdGFbMF0udmFsdWVzLmxlbmd0aCkgKiAuOTsKKyAgICAgICAgICAgIHJldHVybiAnbTAsMGwwLCcKKyAgICAgICAgICAgICAgICAgKyAoeShnZXRPcGVuKGQsaSkpCisgICAgICAgICAgICAgICAgIC0geShnZXRIaWdoKGQsaSkpKQorICAgICAgICAgICAgICAgICArICdsJworICAgICAgICAgICAgICAgICArICgtdy8yKQorICAgICAgICAgICAgICAgICArICcsMGwnCisgICAgICAgICAgICAgICAgICsgKHcvMikKKyAgICAgICAgICAgICAgICAgKyAnLDBsMCwnCisgICAgICAgICAgICAgICAgICsgKHkoZ2V0TG93KGQsaSkpIC0geShnZXRPcGVuKGQsaSkpKQorICAgICAgICAgICAgICAgICArICdsMCwnCisgICAgICAgICAgICAgICAgICsgKHkoZ2V0Q2xvc2UoZCxpKSkKKyAgICAgICAgICAgICAgICAgLSB5KGdldExvdyhkLGkpKSkKKyAgICAgICAgICAgICAgICAgKyAnbCcKKyAgICAgICAgICAgICAgICAgKyAody8yKQorICAgICAgICAgICAgICAgICArICcsMGwnCisgICAgICAgICAgICAgICAgICsgKC13LzIpCisgICAgICAgICAgICAgICAgICsgJywweic7CisgICAgICAgICAgfSkKKyAgICAgICAgICAuYXR0cigndHJhbnNmb3JtJywgZnVuY3Rpb24oZCxpKSB7IHJldHVybiAndHJhbnNsYXRlKCcgKyB4KGdldFgoZCxpKSkgKyAnLCcgKyB5KGdldEhpZ2goZCxpKSkgKyAnKSc7IH0pCisgICAgICAgICAgLy8uYXR0cignZmlsbCcsIGZ1bmN0aW9uKGQsaSkgeyByZXR1cm4gY29sb3JbMF07IH0pCisgICAgICAgICAgLy8uYXR0cignc3Ryb2tlJywgZnVuY3Rpb24oZCxpKSB7IHJldHVybiBjb2xvclswXTsgfSkKKyAgICAgICAgICAvLy5hdHRyKCd4JywgMCApCisgICAgICAgICAgLy8uYXR0cigneScsIGZ1bmN0aW9uKGQsaSkgeyAgcmV0dXJuIHkoTWF0aC5tYXgoMCwgZ2V0WShkLGkpKSkgfSkKKyAgICAgICAgICAvLy5hdHRyKCdoZWlnaHQnLCBmdW5jdGlvbihkLGkpIHsgcmV0dXJuIE1hdGguYWJzKHkoZ2V0WShkLGkpKSAtIHkoMCkpIH0pCisgICAgICAgICAgLm9uKCdtb3VzZW92ZXInLCBmdW5jdGlvbihkLGkpIHsKKyAgICAgICAgICAgIGQzLnNlbGVjdCh0aGlzKS5jbGFzc2VkKCdob3ZlcicsIHRydWUpOworICAgICAgICAgICAgZGlzcGF0Y2guZWxlbWVudE1vdXNlb3Zlcih7CisgICAgICAgICAgICAgICAgcG9pbnQ6IGQsCisgICAgICAgICAgICAgICAgc2VyaWVzOiBkYXRhWzBdLAorICAgICAgICAgICAgICAgIHBvczogW3goZ2V0WChkLGkpKSwgeShnZXRZKGQsaSkpXSwgIC8vIFRPRE86IEZpZ3VyZSBvdXQgd2h5IHRoZSB2YWx1ZSBhcHBlYXJzIHRvIGJlIHNoaWZ0ZWQKKyAgICAgICAgICAgICAgICBwb2ludEluZGV4OiBpLAorICAgICAgICAgICAgICAgIHNlcmllc0luZGV4OiAwLAorICAgICAgICAgICAgICAgIGU6IGQzLmV2ZW50CisgICAgICAgICAgICB9KTsKKworICAgICAgICAgIH0pCisgICAgICAgICAgLm9uKCdtb3VzZW91dCcsIGZ1bmN0aW9uKGQsaSkgeworICAgICAgICAgICAgICAgIGQzLnNlbGVjdCh0aGlzKS5jbGFzc2VkKCdob3ZlcicsIGZhbHNlKTsKKyAgICAgICAgICAgICAgICBkaXNwYXRjaC5lbGVtZW50TW91c2VvdXQoeworICAgICAgICAgICAgICAgICAgICBwb2ludDogZCwKKyAgICAgICAgICAgICAgICAgICAgc2VyaWVzOiBkYXRhWzBdLAorICAgICAgICAgICAgICAgICAgICBwb2ludEluZGV4OiBpLAorICAgICAgICAgICAgICAgICAgICBzZXJpZXNJbmRleDogMCwKKyAgICAgICAgICAgICAgICAgICAgZTogZDMuZXZlbnQKKyAgICAgICAgICAgICAgICB9KTsKKyAgICAgICAgICB9KQorICAgICAgICAgIC5vbignY2xpY2snLCBmdW5jdGlvbihkLGkpIHsKKyAgICAgICAgICAgICAgICBkaXNwYXRjaC5lbGVtZW50Q2xpY2soeworICAgICAgICAgICAgICAgICAgICAvL2xhYmVsOiBkW2xhYmVsXSwKKyAgICAgICAgICAgICAgICAgICAgdmFsdWU6IGdldFkoZCxpKSwKKyAgICAgICAgICAgICAgICAgICAgZGF0YTogZCwKKyAgICAgICAgICAgICAgICAgICAgaW5kZXg6IGksCisgICAgICAgICAgICAgICAgICAgIHBvczogW3goZ2V0WChkLGkpKSwgeShnZXRZKGQsaSkpXSwKKyAgICAgICAgICAgICAgICAgICAgZTogZDMuZXZlbnQsCisgICAgICAgICAgICAgICAgICAgIGlkOiBpZAorICAgICAgICAgICAgICAgIH0pOworICAgICAgICAgICAgICBkMy5ldmVudC5zdG9wUHJvcGFnYXRpb24oKTsKKyAgICAgICAgICB9KQorICAgICAgICAgIC5vbignZGJsY2xpY2snLCBmdW5jdGlvbihkLGkpIHsKKyAgICAgICAgICAgICAgZGlzcGF0Y2guZWxlbWVudERibENsaWNrKHsKKyAgICAgICAgICAgICAgICAgIC8vbGFiZWw6IGRbbGFiZWxdLAorICAgICAgICAgICAgICAgICAgdmFsdWU6IGdldFkoZCxpKSwKKyAgICAgICAgICAgICAgICAgIGRhdGE6IGQsCisgICAgICAgICAgICAgICAgICBpbmRleDogaSwKKyAgICAgICAgICAgICAgICAgIHBvczogW3goZ2V0WChkLGkpKSwgeShnZXRZKGQsaSkpXSwKKyAgICAgICAgICAgICAgICAgIGU6IGQzLmV2ZW50LAorICAgICAgICAgICAgICAgICAgaWQ6IGlkCisgICAgICAgICAgICAgIH0pOworICAgICAgICAgICAgICBkMy5ldmVudC5zdG9wUHJvcGFnYXRpb24oKTsKKyAgICAgICAgICB9KTsKKworICAgICAgdGlja3MKKyAgICAgICAgICAuYXR0cignY2xhc3MnLCBmdW5jdGlvbihkLGksaikgeyByZXR1cm4gKGdldE9wZW4oZCxpKSA+IGdldENsb3NlKGQsaSkgPyAnbnYtdGljayBuZWdhdGl2ZScgOiAnbnYtdGljayBwb3NpdGl2ZScpICsgJyBudi10aWNrLScgKyBqICsgJy0nICsgaSB9KQorICAgICAgZDMudHJhbnNpdGlvbih0aWNrcykKKyAgICAgICAgICAuYXR0cigndHJhbnNmb3JtJywgZnVuY3Rpb24oZCxpKSB7IHJldHVybiAndHJhbnNsYXRlKCcgKyB4KGdldFgoZCxpKSkgKyAnLCcgKyB5KGdldEhpZ2goZCxpKSkgKyAnKSc7IH0pCisgICAgICAgICAgLmF0dHIoJ2QnLCBmdW5jdGlvbihkLGkpIHsKKyAgICAgICAgICAgIHZhciB3ID0gKGF2YWlsYWJsZVdpZHRoIC8gZGF0YVswXS52YWx1ZXMubGVuZ3RoKSAqIC45OworICAgICAgICAgICAgcmV0dXJuICdtMCwwbDAsJworICAgICAgICAgICAgICAgICArICh5KGdldE9wZW4oZCxpKSkKKyAgICAgICAgICAgICAgICAgLSB5KGdldEhpZ2goZCxpKSkpCisgICAgICAgICAgICAgICAgICsgJ2wnCisgICAgICAgICAgICAgICAgICsgKC13LzIpCisgICAgICAgICAgICAgICAgICsgJywwbCcKKyAgICAgICAgICAgICAgICAgKyAody8yKQorICAgICAgICAgICAgICAgICArICcsMGwwLCcKKyAgICAgICAgICAgICAgICAgKyAoeShnZXRMb3coZCxpKSkKKyAgICAgICAgICAgICAgICAgLSB5KGdldE9wZW4oZCxpKSkpCisgICAgICAgICAgICAgICAgICsgJ2wwLCcKKyAgICAgICAgICAgICAgICAgKyAoeShnZXRDbG9zZShkLGkpKQorICAgICAgICAgICAgICAgICAtIHkoZ2V0TG93KGQsaSkpKQorICAgICAgICAgICAgICAgICArICdsJworICAgICAgICAgICAgICAgICArICh3LzIpCisgICAgICAgICAgICAgICAgICsgJywwbCcKKyAgICAgICAgICAgICAgICAgKyAoLXcvMikKKyAgICAgICAgICAgICAgICAgKyAnLDB6JzsKKyAgICAgICAgICB9KQorICAgICAgICAgIC8vLmF0dHIoJ3dpZHRoJywgKGF2YWlsYWJsZVdpZHRoIC8gZGF0YVswXS52YWx1ZXMubGVuZ3RoKSAqIC45ICkKKworCisgICAgICAvL2QzLnRyYW5zaXRpb24odGlja3MpCisgICAgICAgICAgLy8uYXR0cigneScsIGZ1bmN0aW9uKGQsaSkgeyAgcmV0dXJuIHkoTWF0aC5tYXgoMCwgZ2V0WShkLGkpKSkgfSkKKyAgICAgICAgICAvLy5hdHRyKCdoZWlnaHQnLCBmdW5jdGlvbihkLGkpIHsgcmV0dXJuIE1hdGguYWJzKHkoZ2V0WShkLGkpKSAtIHkoMCkpIH0pOworICAgICAgICAgIC8vLm9yZGVyKCk7ICAvLyBub3Qgc3VyZSBpZiB0aGlzIG1ha2VzIGFueSBzZW5zZSBmb3IgdGhpcyBtb2RlbAorCisgICAgfSk7CisKKyAgICByZXR1cm4gY2hhcnQ7CisgIH0KKworCisgIC8vPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisgIC8vIEV4cG9zZSBQdWJsaWMgVmFyaWFibGVzCisgIC8vLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tCisKKyAgY2hhcnQuZGlzcGF0Y2ggPSBkaXNwYXRjaDsKKworICBjaGFydC5vcHRpb25zID0gbnYudXRpbHMub3B0aW9uc0Z1bmMuYmluZChjaGFydCk7CisKKyAgY2hhcnQueCA9IGZ1bmN0aW9uKF8pIHsKKyAgICBpZiAoIWFyZ3VtZW50cy5sZW5ndGgpIHJldHVybiBnZXRYOworICAgIGdldFggPSBfOworICAgIHJldHVybiBjaGFydDsKKyAgfTsKKworICBjaGFydC55ID0gZnVuY3Rpb24oXykgeworICAgIGlmICghYXJndW1l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0b20gOiBtYXJnaW4uYm90dG9tOworICAgIG1hcmdpbi5sZWZ0ICAgPSB0eXBlb2YgXy5sZWZ0ICAgIT0gJ3VuZGVmaW5lZCcgPyBfLmxlZnQgICA6IG1hcmdpbi5sZWZ0OworICAgIHJldHVybiBjaGFydDsKKyAgfTsKKworICBjaGFydC53aWR0aCA9IGZ1bmN0aW9uKF8pIHsKKyAgICBpZiAoIWFyZ3VtZW50cy5sZW5ndGgpIHJldHVybiB3aWR0aDsKKyAgICB3aWR0aCA9IF87CisgICAgcmV0dXJuIGNoYXJ0OworICB9OworCisgIGNoYXJ0LmhlaWdodCA9IGZ1bmN0aW9uKF8pIHsKKyAgICBpZiAoIWFyZ3VtZW50cy5sZW5ndGgpIHJldHVybiBoZWlnaHQ7CisgICAgaGVpZ2h0ID0gXzsKKyAgICByZXR1cm4gY2hhcnQ7CisgIH07CisKKyAgY2hhcnQueFNjYWxlID0gZnVuY3Rpb24oXykgeworICAgIGlmICghYXJndW1lbnRzLmxlbmd0aCkgcmV0dXJuIHg7CisgICAgeCA9IF87CisgICAgcmV0dXJuIGNoYXJ0OworICB9OworCisgIGNoYXJ0LnlTY2FsZSA9IGZ1bmN0aW9uKF8pIHsKKyAgICBpZiAoIWFyZ3VtZW50cy5sZW5ndGgpIHJldHVybiB5OworICAgIHkgPSBfOworICAgIHJldHVybiBjaGFydDsKKyAgfTsKKworICBjaGFydC54RG9tYWluID0gZnVuY3Rpb24oXykgeworICAgIGlmICghYXJndW1lbnRzLmxlbmd0aCkgcmV0dXJuIHhEb21haW47CisgICAgeERvbWFpbiA9IF87CisgICAgcmV0dXJuIGNoYXJ0OworICB9OworCisgIGNoYXJ0LnlEb21haW4gPSBmdW5jdGlvbihfKSB7CisgICAgaWYgKCFhcmd1bWVudHMubGVuZ3RoKSByZXR1cm4geURvbWFpbjsKKyAgICB5RG9tYWluID0gXzsKKyAgICByZXR1cm4gY2hhcnQ7CisgIH07CisKKyAgY2hhcnQueFJhbmdlID0gZnVuY3Rpb24oXykgeworICAgIGlmICghYXJndW1lbnRzLmxlbmd0aCkgcmV0dXJuIHhSYW5nZTsKKyAgICB4UmFuZ2UgPSBfOworICAgIHJldHVybiBjaGFydDsKKyAgfTsKKworICBjaGFydC55UmFuZ2UgPSBmdW5jdGlvbihfKSB7CisgICAgaWYgKCFhcmd1bWVudHMubGVuZ3RoKSByZXR1cm4geVJhbmdlOworICAgIHlSYW5nZSA9IF87CisgICAgcmV0dXJuIGNoYXJ0OworICB9OworCisgIGNoYXJ0LmZvcmNlWCA9IGZ1bmN0aW9uKF8pIHsKKyAgICBpZiAoIWFyZ3VtZW50cy5sZW5ndGgpIHJldHVybiBmb3JjZVg7CisgICAgZm9yY2VYID0gXzsKKyAgICByZXR1cm4gY2hhcnQ7CisgIH07CisKKyAgY2hhcnQuZm9yY2VZID0gZnVuY3Rpb24oXykgeworICAgIGlmICghYXJndW1lbnRzLmxlbmd0aCkgcmV0dXJuIGZvcmNlWTsKKyAgICBmb3JjZVkgPSBfOworICAgIHJldHVybiBjaGFydDsKKyAgfTsKKworICBjaGFydC5wYWREYXRhID0gZnVuY3Rpb24oXykgeworICAgIGlmICghYXJndW1lbnRzLmxlbmd0aCkgcmV0dXJuIHBhZERhdGE7CisgICAgcGFkRGF0YSA9IF87CisgICAgcmV0dXJuIGNoYXJ0OworICB9OworCisgIGNoYXJ0LmNsaXBFZGdlID0gZnVuY3Rpb24oXykgeworICAgIGlmICghYXJndW1lbnRzLmxlbmd0aCkgcmV0dXJuIGNsaXBFZGdlOworICAgIGNsaXBFZGdlID0gXzsKKyAgICByZXR1cm4gY2hhcnQ7CisgIH07CisKKyAgY2hhcnQuY29sb3IgPSBmdW5jdGlvbihfKSB7CisgICAgaWYgKCFhcmd1bWVudHMubGVuZ3RoKSByZXR1cm4gY29sb3I7CisgICAgY29sb3IgPSBudi51dGlscy5nZXRDb2xvcihfKTsKKyAgICByZXR1cm4gY2hhcnQ7CisgIH07CisKKyAgY2hhcnQuaWQgPSBmdW5jd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KworCisgIHZhciBtYXJnaW4gPSB7dG9wOiAzMCwgcmlnaHQ6IDEwLCBib3R0b206IDEwLCBsZWZ0OiAxMH0KKyAgICAsIHdpZHRoID0gOTYwCisgICAgLCBoZWlnaHQgPSA1MDAKKyAgICAsIHggPSBkMy5zY2FsZS5vcmRpbmFsKCkKKyAgICAsIHkgPSB7fQorICAgICwgZGltZW5zaW9ucyA9IFtdCisgICAgLCBjb2xvciA9IG52LnV0aWxzLmdldENvbG9yKGQzLnNjYWxlLmNhdGVnb3J5MjBjKCkucmFuZ2UoKSkKKyAgICAsIGF4aXNMYWJlbCA9IGZ1bmN0aW9uKGQpIHsgcmV0dXJuIGQ7IH0KKyAgICAsIGZpbHRlcnMgPSBbXQorICAgICwgYWN0aXZlID0gW10KKyAgICAsIGRpc3BhdGNoID0gZDMuZGlzcGF0Y2goJ2JydXNoJykKKyAgICA7CisKKyAgLy89PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKworCisgIC8vPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisgIC8vIFByaXZhdGUgVmFyaWFibGVzCisgIC8vLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tCisKKworICAvLz09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorCisKKyAgZnVuY3Rpb24gY2hhcnQoc2VsZWN0aW9uKSB7CisgICAgc2VsZWN0aW9uLmVhY2goZnVuY3Rpb24oZGF0YSkgeworICAgICAgdmFyIGF2YWlsYWJsZVdpZHRoID0gd2lkdGggLSBtYXJnaW4ubGVmdCAtIG1hcmdpbi5yaWdodCwKKyAgICAgICAgICBhdmFpbGFibGVIZWlnaHQgPSBoZWlnaHQgLSBtYXJnaW4udG9wIC0gbWFyZ2luLmJv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QgPSBnRW50ZXIuYXBwZW5kKCdnJykKKyAgICAgICAgICAuYXR0cignY2xhc3MnLCAnYmFja2dyb3VuZCcpCisgICAgICAgIC5zZWxlY3RBbGwoJ3BhdGgnKQorICAgICAgICAgIC5kYXRhKGRhdGEpCisgICAgICAgIC5lbnRlcigpLmFwcGVuZCgncGF0aCcpCisgICAgICAgICAgLmF0dHIoJ2QnLCBwYXRoKQorICAgICAgICA7CisKKyAgICAgIC8vIEFkZCBibHVlIGZvcmVncm91bmQgbGluZXMgZm9yIGZvY3VzLgorICAgICAgZm9yZWdyb3VuZCA9IGdFbnRlci5hcHBlbmQoJ2cnKQorICAgICAgICAgIC5hdHRyKCdjbGFzcycsICdmb3JlZ3JvdW5kJykKKyAgICAgICAgLnNlbGVjdEFsbCgncGF0aCcpCisgICAgICAgICAgLmRhdGEoZGF0YSkKKyAgICAgICAgLmVudGVyKCkuYXBwZW5kKCdwYXRoJykKKyAgICAgICAgICAuYXR0cignZCcsIHBhdGgpCisgICAgICAgIDsKKworICAgICAgLy8gQWRkIGEgZ3JvdXAgZWxlbWVudCBmb3IgZWFjaCBkaW1lbnNpb24uCisgICAgICB2YXIgZGltZW5zaW9uID0gZy5zZWxlY3RBbGwoJy5kaW1lbnNpb24nKQorICAgICAgICAgIC5kYXRhKGRpbWVuc2lvbnMpCisgICAgICAgIC5lbnRlcigpLmFwcGVuZCgnZycpCisgICAgICAgICAgLmF0dHIoJ2NsYXNzJywgJ2RpbWVuc2lvbicpCisgICAgICAgICAgLmF0dHIoJ3RyYW5zZm9ybScsIGZ1bmN0aW9uKGQpIHsgcmV0dXJuICd0cmFuc2xhdGUoJyArIHgoZCkgKyAnLDApJzsgfSk7CisKKyAgICAgIC8vIEFkZCBhbiBheGlzIGFuZCB0aXRsZS4KKyAgICAgIGRpbWVuc2lvbi5hcHBlbmQoJ2cnKQorICAgICAgICAgIC5hdHRyKCdjbGFzcycsICdheGlzJykKKyAgICAgICAgICAuZWFjaChmdW5jdGlvbihkKSB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IHsgcmV0dXJuIHlbcF0uYnJ1c2guZXh0ZW50KCk7IH0pOworCisgICAgICAgIGZpbHRlcnMgPSBbXTsgLy9lcmFzZSBjdXJyZW50IGZpbHRlcnMKKyAgICAgICAgYWN0aXZlcy5mb3JFYWNoKGZ1bmN0aW9uKGQsaSkgeworICAgICAgICAgIGZpbHRlcnNbaV0gPSB7CisgICAgICAgICAgICBkaW1lbnNpb246IGQsCisgICAgICAgICAgICBleHRlbnQ6IGV4dGVudHNbaV0KKyAgICAgICAgICB9CisgICAgICAgIH0pOworCisgICAgICAgIGFjdGl2ZSA9IFtdOyAvL2VyYXNlIGN1cnJlbnQgYWN0aXZlIGxpc3QKKyAgICAgICAgZm9yZWdyb3VuZC5zdHlsZSgnZGlzcGxheScsIGZ1bmN0aW9uKGQpIHsKKyAgICAgICAgICB2YXIgaXNBY3RpdmUgPSBhY3RpdmVzLmV2ZXJ5KGZ1bmN0aW9uKHAsIGkpIHsKKyAgICAgICAgICAgIHJldHVybiBleHRlbnRzW2ldWzBdIDw9IGRbcF0gJiYgZFtwXSA8PSBleHRlbnRzW2ldWzFdOworICAgICAgICAgIH0pOworICAgICAgICAgIGlmIChpc0FjdGl2ZSkgYWN0aXZlLnB1c2goZCk7CisgICAgICAgICAgcmV0dXJuIGlzQWN0aXZlID8gbnVsbCA6ICdub25lJzsKKyAgICAgICAgfSk7CisKKyAgICAgICAgZGlzcGF0Y2guYnJ1c2goeworICAgICAgICAgIGZpbHRlcnM6IGZpbHRlcnMsCisgICAgICAgICAgYWN0aXZlOiBhY3RpdmUKKyAgICAgICAgfSk7CisKKyAgICAgIH0KKworCisKKyAgICB9KTsKKworICAgIHJldHVybiBjaGFydDsKKyAgfQorCisKKyAgLy89PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKyAgLy8gRXhwb3NlIFB1YmxpYyBWYXJpYWJsZXMKKyAgLy8tLS0tLS0tLS0tLS0tLS0tLS0tLS0tL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ndW1lbnRzLmxlbmd0aCkgcmV0dXJuIGNvbG9yOworICAgIGNvbG9yID0gbnYudXRpbHMuZ2V0Q29sb3IoXykKKyAgICByZXR1cm4gY2hhcnQ7CisgIH07CisKKyAgY2hhcnQueFNjYWxlID0gZnVuY3Rpb24oXykgeworICAgIGlmICghYXJndW1lbnRzLmxlbmd0aCkgcmV0dXJuIHg7CisgICAgeCA9IF87CisgICAgcmV0dXJuIGNoYXJ0OworICB9OworCisgIGNoYXJ0LnlTY2FsZSA9IGZ1bmN0aW9uKF8pIHsKKyAgICBpZiAoIWFyZ3VtZW50cy5sZW5ndGgpIHJldHVybiB5OworICAgIHkgPSBfOworICAgIHJldHVybiBjaGFydDsKKyAgfTsKKworICBjaGFydC5kaW1lbnNpb25zID0gZnVuY3Rpb24oXykgeworICAgIGlmICghYXJndW1lbnRzLmxlbmd0aCkgcmV0dXJuIGRpbWVuc2lvbnM7CisgICAgZGltZW5zaW9ucyA9IF87CisgICAgcmV0dXJuIGNoYXJ0OworICB9OworCisgIGNoYXJ0LmZpbHRlcnMgPSBmdW5jdGlvbigpIHsKKyAgICByZXR1cm4gZmlsdGVyczsKKyAgfTsKKworICBjaGFydC5hY3RpdmUgPSBmdW5jdGlvbigpIHsKKyAgICByZXR1cm4gYWN0aXZlOworICB9OworCisgIC8vPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisKKworICByZXR1cm4gY2hhcnQ7Cit9CmRpZmYgLS1naXQgYS9lY29tcC1wb3J0YWwtQkUvd2FyL3N0YXRpYy9mdXNpb24vZDMvanMvbW9kZWxzL3BpZS5qcyBiL2Vjb21wLXBvcnRhbC1CRS93YXIvc3RhdGljL2Z1c2lvbi9kMy9qcy9tb2RlbHMvcGllLmpzCm5ldyBmaWxlIG1vZGUgMTAwNjQ0CmluZGV4IDAwMDAwMDAuLjIwOTljOGYKLS0tIC9kZXYvbnVsbAorKysgYi9lY29tcC1wb3J0YWwtQkUv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CBjb250YWluZXJzIGFuZCBza2VsZXRvbiBvZiBjaGFydAorCisgICAgICAvL3ZhciB3cmFwID0gY29udGFpbmVyLnNlbGVjdEFsbCgnLm52LXdyYXAubnYtcGllJykuZGF0YShbZGF0YV0pOworICAgICAgdmFyIHdyYXAgPSBjb250YWluZXIuc2VsZWN0QWxsKCcubnYtd3JhcC5udi1waWUnKS5kYXRhKGRhdGEpOworICAgICAgdmFyIHdyYXBFbnRlciA9IHdyYXAuZW50ZXIoKS5hcHBlbmQoJ2cnKS5hdHRyKCdjbGFzcycsJ252ZDMgbnYtd3JhcCBudi1waWUgbnYtY2hhcnQtJyArIGlkKTsKKyAgICAgIHZhciBnRW50ZXIgPSB3cmFwRW50ZXIuYXBwZW5kKCdnJyk7CisgICAgICB2YXIgZyA9IHdyYXAuc2VsZWN0KCdnJyk7CisKKyAgICAgIGdFbnRlci5hcHBlbmQoJ2cnKS5hdHRyKCdjbGFzcycsICdudi1waWUnKTsKKworICAgICAgd3JhcC5hdHRyKCd0cmFuc2Zvcm0nLCAndHJhbnNsYXRlKCcgKyBtYXJnaW4ubGVmdCArICcsJyArIG1hcmdpbi50b3AgKyAnKScpOworICAgICAgZy5zZWxlY3QoJy5udi1waWUnKS5hdHRyKCd0cmFuc2Zvcm0nLCAndHJhbnNsYXRlKCcgKyBhdmFpbGFibGVXaWR0aCAvIDIgKyAnLCcgKyBhdmFpbGFibGVIZWlnaHQgLyAyICsgJyknKTsKKworICAgICAgLy8tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0KKworCisgICAgICBjb250YWluZXIKKyAgICAgICAgICAub24oJ2NsaWNrJywgZnVuY3Rpb24oZCxpKSB7CisgICAgICAgICAgICAgIGRpc3BhdGNoLmNoYXJ0Q2xpY2soeworICAgICAgICAgICAgICAgICAgZGF0YTogZCwKKyAgICAgICAgICAgICAgICAgIGluZGV4OiBpLAorICAgICAgICAgICAgICAgICAgcG9zOiBkMy5ldmVudCwKKyAgICAgICAgICAgICAgICAgIGlkOiBpZAorICAgICAgICAgICAgICB9KTsKKyAgICAgICAgICB9KTsKKworCisgICAgICB2YXIgYXJjID0gZDMuc3ZnLmFyYygpCisgICAgICAgICAgICAgICAgICAub3V0ZXJSYWRpdXMoYXJjUmFkaXVzKTsKKworICAgICAgaWYgKHN0YXJ0QW5nbGUpIGFyYy5zdGFydEFuZ2xlKHN0YXJ0QW5nbGUpCisgICAgICBpZiAoZW5kQW5nbGUpIGFyYy5lbmRBbmdsZShlbmRBbmdsZSk7CisgICAgICBpZiAoZG9udXQpIGFyYy5pbm5lclJhZGl1cyhyYWRpdXMgKiBkb251dFJhdGlvKTsKKworICAgICAgLy8gU2V0dXAgdGhlIFBpZSBjaGFydCBhbmQgY2hvb3NlIHRoZSBkYXRhIGVsZW1lbnQKKyAgICAgIHZhciBwaWUgPSBkMy5sYXlvdXQucGllKCkKKyAgICAgICAgICAuc29ydChudWxsKQorICAgICAgICAgIC52YWx1ZShmdW5jdGlvbihkKSB7IHJldHVybiBkLmRpc2FibGVkID8gMCA6IGdldFkoZCkgfSk7CisKKyAgICAgIHZhciBzbGljZXMgPSB3cmFwLnNlbGVjdCgnLm52LXBpZScpLnNlbGVjdEFsbCgnLm52LXNsaWNlJykKKyAgICAgICAgICAuZGF0YShwaWUpOworCisgICAgICBzbGljZXMuZXhpdCgpLnJlbW92ZSgpOworCisgICAgICB2YXIgYWUgPSBzbGljZXMuZW50ZXIoKS5hcHBlbmQoJ2cnKQorICAgICAgICAgICAgICAuYXR0cignY2xhc3MnLCAnbnYtc2xpY2UnKQorICAgICAgICAgICAgICAub24oJ21vdXNlb3ZlcicsIGZ1bmN0aW9uKGQsaSl7CisgICAgICAgICAgICAgICAgZDMuc2VsZWN0KHRoaXMpLmNsYXNzZWQoJ2hvdmVyJywgdHJ1ZSk7CisgICAgICAgICAgICAgICAgZGlzcGF0Y2guZWxlbWVudE1vdXNlb3Zlcih7CisgICAgICAgICAgICAgICAgICAgIGxhYmVsOiBnZXRYKGQuZGF0YSksCisgICAgICAgICAgICAgICAgICAgIHZhbHVlOiBnZXRZKGQuZGF0YSksCisgICAgICAgICAgICAgICAgICAgIHBvaW50OiBkLmRhdGEsCisgICAgICAgICAgICAgICAgICAgIHBvaW50SW5kZXg6IGksCisgICAgICAgICAgICAgICAgICAgIHBvczogW2QzLmV2ZW50LnBhZ2VYLCBkMy5ldmVudC5wYWdlWV0sCisgICAgICAgICAgICAgICAgICAgIGlkOiBpZAorICAgICAgICAgICAgICAgIH0pOworICAgICAgICAgICAgICB9KQorICAgICAgICAgICAgICAub24oJ21vdXNlb3V0JywgZnVuY3Rpb24oZCxpKXsKKyAgICAgICAgICAgICAgICBkMy5zZWxlY3QodGhpcykuY2xhc3NlZCgnaG92ZXInLCBmYWxzZSk7CisgICAgICAgICAgICAgICAgZGlzcGF0Y2guZWxlbWVudE1vdXNlb3V0KHsKKyAgICAgICAgICAgICAgICAgICAgbGFiZWw6IGdldFgoZC5kYXRhKSwKKyAgICAgICAgICAgICAgICAgICAgdmFsdWU6IGdldFkoZC5kYXRhKSwKKyAgICAgICAgICAgICAgICAgICAgcG9pbnQ6IGQuZGF0YSwKKyAgICAgICAgICAgICAgICAgICAgaW5kZXg6IGksCisgICAgICAgICAgICAgICAgICAgIGlkOiBpZAorICAgICAgICAgICAgICAgIH0pOworICAgICAgICAgICAgICB9KQorICAgICAgICAgICAgICAub24oJ2NsaWNrJywgZnVuY3Rpb24oZCxpKSB7CisgICAgICAgICAgICAgICAgZGlzcGF0Y2guZWxlbWVudENsaWNrKHsKKyAgICAgICAgICAgICAgICAgICAgbGFiZWw6IGdldFgoZC5kYXRhKSwKKyAgICAgICAgICAgICAgICAgICAgdmFsdWU6IGdldFkoZC5kYXRhKSwKKyAgICAgICAgICAgICAgICAgICAgcG9pbnQ6IGQuZGF0YSwKKyAgICAgICAgICAgICAgICAgICAgaW5kZXg6IGksCisgICAgICAgICAgICAgICAgICAgIHBvczogZDMuZXZlbnQsCisgICAgICAgICAgICAgICAgICAgIGlkOiBpZAorICAgICAgICAgICAgICAgIH0pOworICAgICAgICAgICAgICAgIGQzLmV2ZW50LnN0b3BQcm9wYWdhdGlvbigpOworICAgICAgICAgICAgICB9KQorICAgICAgICAgICAgICAub24oJ2RibGNsaWNrJywgZnVuY3Rpb24oZCxpKSB7CisgICAgICAgICAgICAgICAgZGlzcGF0Y2guZWxlbWVudERibENsaWNrKHsKKyAgICAgICAgICAgICAgICAgICAgbGFiZWw6IGdldFgoZC5kYXRhKSwKKyAgICAgICAgICAgICAgICAgICAgdmFsdWU6IGdldFkoZC5kYXRhKSwKKyAgICAgICAgICAgICAgICAgICAgcG9pbnQ6IGQuZGF0YSwKKyAgICAgICAgICAgICAgICAgICAgaW5kZXg6IGksCisgICAgICAgICAgICAgICAgICAgIHBvczogZDMuZXZlbnQsCisgICAgICAgICAgICAgICAgICAgIGlkOiBpZAorICAgICAgICAgICAgICAgIH0pOworICAgICAgICAgICAgICAgIGQzLmV2ZW50LnN0b3BQcm9wYWdhdGlvbigpOworICAgICAgICAgICAgICB9KTsKKworICAgICAgICBzbGljZXMKKyAgICAgICAgICAgIC5hdHRyKCdmaWxsJywgZnVuY3Rpb24oZCxpKSB7IHJldHVybiBjb2xvcihkLCBpKTsgfSkKKyAgICAgICAgICAgIC5hdHRyKCdzdHJva2UnLCBmdW5jdGlvbihkLGkpIHsgcmV0dXJuIGNvbG9yKGQsIGkpOyB9KTsKKworICAgICAgICB2YXIgcGF0aHMgPSBhZS5hcHBlbmQoJ3BhdGgnKQorICAgICAgICAgICAgLmVhY2goZnVuY3Rpb24oZCkgeyB0aGlzLl9jdXJyZW50ID0gZDsgfSk7CisgICAgICAgICAgICAvLy5hdHRyKCdkJywgYXJjKTsKKworICAgICAgICBkMy50cmFuc2l0aW9uKHNsaWNlcy5zZWxlY3QoJ3BhdGgnKSkKKyAgICAgICAgICAgIC5hdHRyKCdkJywgYXJjKTsKKyAgICAgICAgICAgIC8vLmF0dHJUd2VlbignZCcsIGFyY1R3ZWVuKTsKKworICAgICAgICBpZiAoc2hvd0xhYmVscykgeworICAgICAgICAgIC8vIFRoaXMgZG9lcyB0aGUgbm9ybWFsIGxhYmVsCisgICAgICAgICAgdmFyIGxhYmVsc0FyYyA9IGQzLnN2Zy5hcmMoKS5pbm5lclJhZGl1cygwKTsKKyAgICAgICAgICAKKyAgICAgICAgICBpZiAocGllTGFiZWxzT3V0c2lkZSl7IGxhYmVsc0FyYyA9IGFyYzsgfQorCisgICAgICAgICAgaWYgKGRvbnV0TGFiZWxzT3V0c2lkZSkgeyBsYWJlbHNBcmMgPSBkMy5zdmcuYXJjKCkub3V0ZXJSYWRpdXMoYXJjLm91dGVyUmFkaXVzKCkpOyB9CisKKyAgICAgICAgICBhZS5hcHBlbmQoImciKS5jbGFzc2VkKCJudi1sYWJlbCIsIHRydWUpCisgICAgICAgICAgICAuZWFjaChmdW5jdGlvbihkLCBpKSB7CisgICAgICAgICAgICAgIHZhciBncm91cCA9IGQzLnNlbGVjdCh0aGlzKTsKKworICAgICAgICAgICAgICBncm91cAorICAgICAgICAgICAgICAgIC5hdHRyKCd0cmFuc2Zvcm0nLCBmdW5jdGlvbihkKSB7CisgICAgICAgICAgICAgICAgICAgICBpZiAobGFiZWxTdW5iZWFtTGF5b3V0KSB7CisgICAgICAgICAgICAgICAgICAgICAgIGQub3V0ZXJSYWRpdXMgPSBhcmNSYWRpdXMgKyAxMDsgLy8gU2V0IE91dGVyIENvb3JkaW5hdGUKKyAgICAgICAgICAgICAgICAgICAgICAgZC5pbm5lclJhZGl1cyA9IGFyY1JhZGl1cyArIDE1OyAvLyBTZXQgSW5uZXIgQ29vcmRpbmF0ZQorICAgICAgICAgICAgICAgICAgICAgICB2YXIgcm90YXRlQW5nbGUgPSAoZC5zdGFydEFuZ2xlICsgZC5lbmRBbmdsZSkgLyAyICogKDE4MCAvIE1hdGguUEkpOworICAgICAgICAgICAgICAgICAgICAgICBpZiAoKGQuc3RhcnRBbmdsZStkLmVuZEFuZ2xlKS8yIDwgTWF0aC5QSSkgeworICAgICAgICAgICAgICAgICAgICAgICAJIHJvdGF0ZUFuZ2xlIC09IDkwOworICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgICAgICAgICAgICAJIHJvdGF0ZUFuZ2xlICs9IDkwOworICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiAndHJhbnNsYXRlKCcgKyBsYWJlbHNBcmMuY2VudHJvaWQoZCkgKyAnKSByb3RhdGUoJyArIHJvdGF0ZUFuZ2xlICsgJyknOworICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgICAgICAgICAgICAgZC5vdXRlclJhZGl1cyA9IHJhZGl1cyArIDEwOyAvLyBTZXQgT3V0ZXIgQ29vcmRpbmF0ZQorICAgICAgICAgICAgICAgICAgICAgICBkLmlubmVyUmFkaXVzID0gcmFkaXVzICsgMTU7IC8vIFNldCBJbm5lciBDb29yZGluYXRlCisgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiAndHJhbnNsYXRlKCcgKyBsYWJlbHNBcmMuY2VudHJvaWQoZCkgKyAnKScKKyAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICB9KTsKKworICAgICAgICAgICAgICBncm91cC5hcHBlbmQoJ3JlY3QnKQorICAgICAgICAgICAgICAgICAgLnN0eWxlKCdzdHJva2UnLCAnI2ZmZicpCisgICAgICAgICAgICAgICAgICAuc3R5bGUoJ2ZpbGwnLCAnI2ZmZicpCisgICAgICAgICAgICAgICAgICAuYXR0cigicngiLCAzKQorICAgICAgICAgICAgICAgICAgLmF0dHIoInJ5IiwgMyk7CisKKyAgICAgICAgICAgICAgZ3JvdXAuYXBwZW5kKCd0ZXh0JykKKyAgICAgICAgICAgICAgICAgIC5zdHlsZSgndGV4dC1hbmNob3InLCBsYWJlbFN1bmJlYW1MYXlvdXQgPyAoKGQuc3RhcnRBbmdsZSArIGQuZW5kQW5nbGUpIC8gMiA8IE1hdGguUEkgPyAnc3RhcnQnIDogJ2VuZCcpIDogJ21pZGRsZScpIC8vY2VudGVyIHRoZSB0ZXh0IG9uIGl0J3Mgb3JpZ2luIG9yIGJlZ2luL2VuZCBpZiBvcnRob2dvbmFsIGFsaWduZWQKKyAgICAgICAgICAgICAgICAgIC5zdHlsZSgnZmlsbCcsICcjMDAwJykKKworCisgICAgICAgICAgfSk7CisKKyAgICAgICAgICBzbGljZXMuc2VsZWN0KCIubnYtbGFiZWwiKS50cmFuc2l0aW9uKCkKKyAgICAgICAgICAgIC5hdHRyKCd0cmFuc2Zvcm0nLCBmdW5jdGlvbihkKSB7CisgICAgICAgICAgICAJaWYgKGxhYmVsU3VuYmVhbUxheW91dCkgeworICAgICAgICAgICAgICAgICAgZC5vdXRlclJhZGl1cyA9IGFyY1JhZGl1cyArIDEwOyAvLyBTZXQgT3V0ZXIgQ29vcmRpbmF0ZQorICAgICAgICAgICAgICAgICAgZC5pbm5lclJhZGl1cyA9IGFyY1JhZGl1cyArIDE1OyAvLyBTZXQgSW5uZXIgQ29vcmRpbmF0ZQorICAgICAgICAgICAgICAgICAgdmFyIHJvdGF0ZUFuZ2xlID0gKGQuc3RhcnRBbmdsZSArIGQuZW5kQW5nbGUpIC8gMiAqICgxODAgLyBNYXRoLlBJKTsKKyAgICAgICAgICAgICAgICAgIGlmICgoZC5zdGFydEFuZ2xlK2QuZW5kQW5nbGUpLzIgPCBNYXRoLlBJKSB7CisgICAgICAgICAgICAgICAgICAgIHJvdGF0ZUFuZ2xlIC09IDkwOworICAgICAgICAgICAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgICAgICAgICAgcm90YXRlQW5nbGUgKz0gOTA7CisgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICByZXR1cm4gJ3RyYW5zbGF0ZSgnICsgbGFiZWxzQXJjLmNlbnRyb2lkKGQpICsgJykgcm90YXRlKCcgKyByb3RhdGVBbmdsZSArICcpJzsKKyAgICAgICAgICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgICAgICAgZC5vdXRlclJhZGl1cyA9IHJhZGl1cyArIDEwOyAvLyBTZXQgT3V0ZXIgQ29vcmRpbmF0ZQorICAgICAgICAgICAgICAgICAgZC5pbm5lclJhZGl1cyA9IHJhZGl1cyArIDE1OyAvLyBTZXQgSW5uZXIgQ29vcmRpbmF0ZQorICAgICAgICAgICAgICAgICAgcmV0dXJuICd0cmFuc2xhdGUoJyArIGxhYmVsc0FyYy5jZW50cm9pZChkKSArICcpJworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0pOworCisgICAgICAgICAgc2xpY2VzLmVhY2goZnVuY3Rpb24oZCwgaSkgeworICAgICAgICAgICAgdmFyIHNsaWNlID0gZDMuc2VsZWN0KHRoaXMpOworCisgICAgICAgICAgICBzbGljZQorICAgICAgICAgICAgICAuc2VsZWN0KCIubnYtbGFiZWwgdGV4dCIpCisgICAgICAgICAgICAgICAgLnN0eWxlKCd0ZXh0LWFuY2hvcicsIGxhYmVsU3VuYmVhbUxheW91dCA/ICgoZC5zdGFydEFuZ2xlICsgZC5lbmRBbmdsZSkgLyAyIDwgTWF0aC5QSSA/ICdzdGFydCcgOiAnZW5kJykgOiAnbWlkZGxlJykgLy9jZW50ZXIgdGhlIHRleHQgb24gaXQncyBvcmlnaW4gb3IgYmVnaW4vZW5kIGlmIG9ydGhvZ29uYWwgYWxpZ25lZAorICAgICAgICAgICAgICAgIC50ZXh0KGZ1bmN0aW9uKGQsIGkpIHsKKyAgICAgICAgICAgICAgICAgIHZhciBwZXJjZW50ID0gKGQuZW5kQW5nbGUgLSBkLnN0YXJ0QW5nbGUpIC8gKDIgKiBNYXRoLlBJKTsKKwkJCQkgIHJldHVybiBNYXRoLnJvdW5kKHBlcmNlbnQqMTAwMS8xMCkrIiUiOworICAgICAgICAgICAgICAgICAgLyp2YXIgbGFiZWxUeXBlcyA9IHsKKyAgICAgICAgICAgICAgICAgICAgImtleSIgOiBnZXRYKGQuZGF0YSksCisgICAgICAgICAgICAgICAgICAgICJ2YWx1ZSI6IGdldFkoZC5kYXRhKSwKKyAgICAgICAgICAgICAgICAgICAgInBlcmNlbnQiOiBkMy5mb3JtYXQoJyUnKShwZXJjZW50KQorICAgICAgICAgICAgICAgICAgfTsKKyAgICAgICAgICAgICAgICAgIHJldHVybiAoZC52YWx1ZSAmJiBwZXJjZW50ID4gbGFiZWxUaHJlc2hvbGQpID8gbGFiZWxUeXBlc1tsYWJlbFR5cGVdIDogJyc7CisJCQkJICAqLworICAgICAgICAgICAgICAgIH0pOworCisgICAgICAgICAgICB2YXIgdGV4dEJveCA9IHNsaWNlLnNlbGVjdCgndGV4dCcpLm5vZGUoKS5nZXRCQm94KCk7CisgICAgICAgICAgICBzbGljZS5zZWxlY3QoIi5udi1sYWJlbCByZWN0IikKKyAgICAgICAgICAgICAgLmF0dHIoIndpZHRoIiwgdGV4dEJveC53aWR0aCArIDEwKQorICAgICAgICAgICAgICAuYXR0cigiaGVpZ2h0IiwgdGV4dEJveC5oZWlnaHQgKyAxMCkKKyAgICAgICAgICAgICAgLmF0dHIoInRyYW5zZm9ybSIsIGZ1bmN0aW9uKCkgeworICAgICAgICAgICAgICAgIHJldHVybiAidHJhbnNsYXRlKCIgKyBbdGV4dEJveC54IC0gNSwgdGV4dEJveC55IC0gNV0gKyAiKSI7CisgICAgICAgICAgICAgIH0pOworICAgICAgICAgIH0pOworICAgICAgICB9CisKKworICAgICAgICAvLyBDb21wdXRlcyB0aGUgYW5nbGUgb2YgYW4gYXJjLCBjb252ZXJ0aW5nIGZyb20gcmFkaWFucyB0byBkZWdyZWVzLgorICAgICAgICBmdW5jdGlvbiBhbmdsZShkKSB7CisgICAgICAgICAgdmFyIGEgPSAoZC5zdGFydEFuZ2xlICsgZC5lbmRBbmdsZSkgKiA5MCAvIE1hdGguUEkgLSA5MDsKKyAgICAgICAgICByZXR1cm4gYSA+IDkwID8gYSAtIDE4MCA6IGE7CisgICAgICAgIH0KKworICAgICAgICBmdW5jdGlvbiBhcmNUd2VlbihhKSB7CisgICAgICAgICAgYS5lbmRBbmdsZSA9IGlzTmFOKGEuZW5kQW5nbGUpID8gMCA6IGEuZW5kQW5nbGU7CisgICAgICAgICAgYS5zdGFydEFuZ2xlID0gaXNOYU4oYS5zdGFydEFuZ2xlKSA/IDAgOiBhLnN0YXJ0QW5nbGU7CisgICAgICAgICAgaWYgKCFkb251dCkgYS5pbm5lclJhZGl1cyA9IDA7CisgICAgICAgICAgdmFyIGkgPSBkMy5pbnRlcnBvbGF0ZSh0aGlzLl9jdXJyZW50LCBhKTsKKyAgICAgICAgICB0aGlzLl9jdXJyZW50ID0gaSgwKTsKKyAgICAgICAgICByZXR1cm4gZnVuY3Rpb24odCkgeworICAgICAgICAgICAgcmV0dXJuIGFyYyhpKHQpKTsKKyAgICAgICAgICB9OworICAgICAgICB9CisKKyAgICAgICAgZnVuY3Rpb24gdHdlZW5QaWUoYikgeworICAgICAgICAgIGIuaW5uZXJSYWRpdXMgPSAwOworICAgICAgICAgIHZhciBpID0gZDMuaW50ZXJwb2xhdGUoe3N0YXJ0QW5nbGU6IDAsIGVuZEFuZ2xlOiAwfSwgYik7CisgICAgICAgICAgcmV0dXJuIGZ1bmN0aW9uKHQpIHsKKyAgICAgICAgICAgICAgcmV0dXJuIGFyYyhpKHQpKTsKKyAgICAgICAgICB9OworICAgICAgICB9CisKKyAgICB9KTsKKworICAgIHJldHVybiBjaGFydDsKKyAgfQorCisKKyAgLy89PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKyAgLy8gRXhwb3NlIFB1YmxpYyBWYXJpYWJsZXMKKyAgLy8tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0KKworICBjaGFydC5kaXNwYXRjaCA9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EAKK252Lm1vZGVscy5waWVDaGFydCA9IGZ1bmN0aW9uKCkgeworICAidXNlIHN0cmljdCI7CisgIC8vPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisgIC8vIFB1YmxpYyBWYXJpYWJsZXMgd2l0aCBEZWZhdWx0IFNldHRpbmdzCisgIC8vLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tCisKKyAgdmFyIHBpZSA9IG52Lm1vZGVscy5waWUoKQorICAgICwgbGVnZW5kID0gbnYubW9kZWxzLmxlZ2VuZCgpCisgICAgOworCisgIHZhciBtYXJnaW4gPSB7dG9wOiAzMCwgcmlnaHQ6IDIwLCBib3R0b206IDIwLCBsZWZ0OiAyMH0KKyAgICAsIHdpZHRoID0gbnVsbAorICAgICwgaGVpZ2h0ID0gbnVsbAorICAgICwgc2hvd0xlZ2VuZCA9IHRydWUKKyAgICAsIGNvbG9yID0gbnYudXRpbHMuZGVmYXVsdENvbG9yKCkKKyAgICAsIHRvb2x0aXBzID0gZmFsc2UKKyAgICAsIHRvb2x0aXAgPSBmdW5jdGlvbihrZXksIHksIGUsIGdyYXBoKSB7CisgICAgICAgIHJldHVybiAnPGgzPicgKyBrZXkgKyAnPC9oMz4nICsKKyAgICAgICAgICAgICAgICc8cD4nICsgIHkgKyAnPC9wPicKKyAgICAgIH0KKyAgICAsIHN0YXRlID0ge30KKyAgICAsIGRlZmF1bHRTdGF0ZSA9IG51bGwKKyAgICAsIG5vRGF0YSA9ICJObyBEYXRhIEF2YWlsYWJsZS4iCisgICAgLCBkaXNwYXRjaCA9IGQzLmRpc3BhdGNoKCd0b29sdGlwU2hvdycsICd0b29sdGlwSGlkZScsICdzdGF0ZUNoYW5nZScsICdjaGFuZ2VTdGF0ZScpCisgICAgOworCisgIC8vPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisKKworICAvLz09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorICAvLyBQcml2YXRlIFZhcmlhYmxlcworICAvLy0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLQorCisgIHZhciBzaG93VG9vbHRpcCA9IGZ1bmN0aW9uKGUsIG9mZnNldEVsZW1lbnQpIHsKKyAgICB2YXIgdG9vbHRpcExhYmVsID0gcGllLmRlc2NyaXB0aW9uKCkoZS5wb2ludCkgfHwgcGllLngoKShlLnBvaW50KQorICAgIHZhciBsZWZ0ID0gZS5wb3NbMF0gKyAoIChvZmZzZXRFbGVtZW50ICYmIG9mZnNldEVsZW1lbnQub2Zmc2V0TGVmdCkgfHwgMCApLAorICAgICAgICB0b3AgPSBlLnBvc1sxXSArICggKG9mZnNldEVsZW1lbnQgJiYgb2Zmc2V0RWxlbWVudC5vZmZzZXRUb3ApIHx8IDApLAorICAgICAgICB5ID0gcGllLnZhbHVlRm9ybWF0KCkocGllLnkoKShlLnBvaW50KSksCisgICAgICAgIGNvbnRlbnQgPSB0b29sdGlwKHRvb2x0aXBMYWJlbCwgeSwgZSwgY2hhcnQpOworCisgICAgbnYudG9vbHRpcC5zaG93KFtsZWZ0LCB0b3BdLCBjb250ZW50LCBlLnZhbHVlIDwgMCA/ICduJyA6ICdzJywgbnVsbCwgb2Zmc2V0RWxlbWVudCk7CisgIH07CisKKyAgLy89PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKworCisgIGZ1bmN0aW9uIGNoYXJ0KHNlbGVjdGlvbikgeworICAgIHNlbGVjdGlvbi5lYWNoKGZ1bmN0aW9uKGRhdGEpIHsKKyAgICAgIHZhciBjb250YWluZXIgPSBkMy5zZWxlY3QodGhpcyksCisgICAgICAgICAgdGhhdCA9IHRoaXM7CisKKyAgICAgIHZhciBhdmFpbGFibGVXaWR0aCA9ICh3aWR0aCB8fCBwYXJzZUludChjb250YWluZXIuc3R5bGUoJ3dpZHRoJykpIHx8IDk2MCkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLSBtYXJnaW4ubGVmdCAtIG1hcmdpbi5yaWdodCwKKyAgICAgICAgICBhdmFpbGFibGVIZWlnaHQgPSAoaGVpZ2h0IHx8IHBhcnNlSW50KGNvbnRhaW5lci5zdHlsZSgnaGVpZ2h0JykpIHx8IDQwMCkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLSBtYXJnaW4udG9wIC0gbWFyZ2luLmJvdHRvbTsKKworICAgICAgY2hhcnQudXBkYXRlID0gZnVuY3Rpb24oKSB7IGNvbnRhaW5lci50cmFuc2l0aW9uKCkuY2FsbChjaGFydCk7IH07CisgICAgICBjaGFydC5jb250YWluZXIgPSB0aGlzOworCisgICAgICAvL3NldCBzdGF0ZS5kaXNhYmxlZAorICAgICAgc3RhdGUuZGlzYWJsZWQgPSBkYXRhLm1hcChmdW5jdGlvbihkKSB7IHJldHVybiAhIWQuZGlzYWJsZWQgfSk7CisKKyAgICAgIGlmICghZGVmYXVsdFN0YXRlKSB7CisgICAgICAgIHZhciBrZXk7CisgICAgICAgIGRlZmF1bHRTdGF0ZSA9IHt9OworICAgICAgICBmb3IgKGtleSBpbiBzdGF0ZSkgeworICAgICAgICAgIGlmIChzdGF0ZVtrZXldIGluc3RhbmNlb2YgQXJyYXkpCisgICAgICAgICAgICBkZWZhdWx0U3RhdGVba2V5XSA9IHN0YXRlW2tleV0uc2xpY2UoMCk7CisgICAgICAgICAgZWxzZQorICAgICAgICAgICAgZGVmYXVsdFN0YXRlW2tleV0gPSBzdGF0ZVtrZXldOworICAgICAgICB9CisgICAgICB9CisKKyAgICAgIC8vLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0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gNDAwKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAtIG1hcmdpbi50b3AgLSBtYXJnaW4uYm90dG9tOworICAgICAgICB9CisKKyAgICAgICAgd3JhcC5zZWxlY3QoJy5udi1sZWdlbmRXcmFwJykKKyAgICAgICAgICAgIC5hdHRyKCd0cmFuc2Zvcm0nLCAndHJhbnNsYXRlKDAsJyArICgtbWFyZ2luLnRvcCkgKycpJyk7CisgICAgICB9CisKKyAgICAgIC8vLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tCisKKworICAgICAgd3JhcC5hdHRyKCd0cmFuc2Zvcm0nLCAndHJhbnNsYXRlKCcgKyBtYXJnaW4ubGVmdCArICcsJyArIG1hcmdpbi50b3AgKyAnKScpOworCisKKyAgICAgIC8vLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tCisgICAgICAvLyBNYWluIENoYXJ0IENvbXBvbmVudChzKQorCisgICAgICBwaWUKKyAgICAgICAgLndpZHRoKGF2YWlsYWJsZVdpZHRoKQorICAgICAgICAuaGVpZ2h0KGF2YWlsYWJsZUhlaWdodCk7CisKKworICAgICAgdmFyIHBpZVdyYXAgPSBnLnNlbGVjdCgnLm52LXBpZVdyYXAnKQorICAgICAgICAgIC5kYXR1bShbZGF0YV0pOworCisgICAgICBkMy50cmFuc2l0aW9uKHBpZVdyYXApLmNhbGwocGllKTsKKworICAgICAgLy8tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0KKworCisgICAgICAvLz09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorICAgICAgLy8gRXZlbnQgSGFuZGxpbmcvRGlzcGF0Y2hpbmcgKGluIGNoYXJ0J3Mgc2NvcGUpCisgICAgICAvLy0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLQorCisgICAgICAvKmxlZ2VuZC5kaXNwYXRjaC5vbignc3RhdGVDaGFuZ2UnLCBmdW5jdGlvbihuZXdTdGF0ZSkgeworICAgICAgICBzdGF0ZSA9IG5ld1N0YXRlOworICAgICAgICBkaXNwYXRjaC5zdGF0ZUNoYW5nZShzdGF0ZSk7CisgICAgICAgIGNoYXJ0LnVwZGF0ZSgpOworICAgICAgfSk7Ki8KKworICAgICAgcGllLmRpc3BhdGNoLm9uKCdlbGVtZW50TW91c2VvdXQudG9vbHRpcCcsIGZ1bmN0aW9uKGUpIHsKKyAgICAgICAgZGlzcGF0Y2gudG9vbHRpcEhpZGUoZSk7CisgICAgICB9KTsKKworICAgICAgLy8gVXBkYXRlIGNoYXJ0IGZyb20gYSBzdGF0ZSBvYmplY3QgcGFzc2VkIHRvIGV2ZW50IGhhbmRsZXIKKyAgICAgIGRpc3BhdGNoLm9uKCdjaGFuZ2VTdGF0ZScsIGZ1bmN0aW9uKGUpIHsKKworICAgICAgICBpZiAodHlwZW9mIGUuZGlzYWJsZWQgIT09ICd1bmRlZmluZWQnKSB7CisgICAgICAgICAgZGF0YS5mb3JFYWNoKGZ1bmN0aW9uKHNlcmllcyxpKSB7CisgICAgICAgICAgICBzZXJpZXMuZGlzYWJsZWQgPSBlLmRpc2FibGVkW2ldOworICAgICAgICAgIH0pOworCisgICAgICAgICAgc3RhdGUuZGlzYWJsZWQgPSBlLmRpc2FibGVkOworICAgICAgICB9CisKKyAgICAgICAgY2hhcnQudXBkYXRlKCk7CisgICAgICB9KTsKKworICAgICAgLy89PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKworCisgICAgfSk7CisKKyAgICByZXR1cm4gY2hhcnQ7CisgIH0KKworICAvLz09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorICAvLyBFdmVudCBIYW5kbGluZy9EaXNwYXRjaGluZyAob3V0IG9mIGNoYXJ0J3Mgc2NvcGUpCisgIC8vLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tCisKKyAgcGllLmRpc3BhdGNoLm9uKCdlbGVtZW50TW91c2VvdmVyLnRvb2x0aXAnLCBmdW5jdGlvbihlKSB7CisgICAgZS5wb3MgPSBbZS5wb3NbMF0gKyAgbWFyZ2luLmxlZnQsIGUucG9zWzFdICsgbWFyZ2luLnRvcF07CisgICAgZGlzcGF0Y2gudG9vbHRpcFNob3coZSk7CisgIH0pOworCisgIGRpc3BhdGNoLm9uKCd0b29sdGlwU2hvdycsIGZ1bmN0aW9uKGUpIHsKKyAgICBpZiAodG9vbHRpcHMpIHNob3dUb29sdGlwKGUpOworICB9KTsKKworICBkaXNwYXRjaC5vbigndG9vbHRpcEhpZGUnLCBmdW5jdGlvbigpIHsKKyAgICBpZiAodG9vbHRpcHMpIG52LnRvb2x0aXAuY2xlYW51cCgpOworICB9KTsKKworICAvLz09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorCisKKyAgLy89PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKyAgLy8gRXhwb3NlIFB1YmxpYyBWYXJpYWJsZXMKKyAgLy8tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0KKworICAvLyBleHBvc2UgY2hhcnQncyBzdWItY29tcG9uZW50cworICBjaGFydC5sZWdlbmQgPSBsZWdlbmQ7CisgIGNoYXJ0LmRpc3BhdGNoID0gZGlzcGF0Y2g7CisgIGNoYXJ0L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mICghYXJndW1lbnRzLmxlbmd0aCkgcmV0dXJuIGhlaWdodDsKKyAgICBoZWlnaHQgPSBfOworICAgIHJldHVybiBjaGFydDsKKyAgfTsKKworICBjaGFydC5jb2xvciA9IGZ1bmN0aW9uKF8pIHsKKyAgICBpZiAoIWFyZ3VtZW50cy5sZW5ndGgpIHJldHVybiBjb2xvcjsKKyAgICBjb2xvciA9IG52LnV0aWxzLmdldENvbG9yKF8pOworICAgIGxlZ2VuZC5jb2xvcihjb2xvcik7CisgICAgcGllLmNvbG9yKGNvbG9yKTsKKyAgICByZXR1cm4gY2hhcnQ7CisgIH07CisKKyAgY2hhcnQuc2hvd0xlZ2VuZCA9IGZ1bmN0aW9uKF8pIHsKKyAgICBpZiAoIWFyZ3VtZW50cy5sZW5ndGgpIHJldHVybiBzaG93TGVnZW5kOworICAgIHNob3dMZWdlbmQgPSBfOworICAgIHJldHVybiBjaGFydDsKKyAgfTsKKworICBjaGFydC50b29sdGlwcyA9IGZ1bmN0aW9uKF8pIHsKKyAgICBpZiAoIWFyZ3VtZW50cy5sZW5ndGgpIHJldHVybiB0b29sdGlwczsKKyAgICB0b29sdGlwcyA9IF87CisgICAgcmV0dXJuIGNoYXJ0OworICB9OworCisgIGNoYXJ0LnRvb2x0aXBDb250ZW50ID0gZnVuY3Rpb24oXykgeworICAgIGlmICghYXJndW1lbnRzLmxlbmd0aCkgcmV0dXJuIHRvb2x0aXA7CisgICAgdG9vbHRpcCA9IF87CisgICAgcmV0dXJuIGNoYXJ0OworICB9OworCisgIGNoYXJ0LnN0YXRlID0gZnVuY3Rpb24oXykgeworICAgIGlmICghYXJndW1lbnRzLmxlbmd0aCkgcmV0dXJuIHN0YXRlOworICAgIHN0YXRlID0gXzsKKyAgICByZXR1cm4gY2hhcnQ7CisgIH07CisKKyAgY2hhcnQuZGVmYXVsdFN0YXRlID0gZnVuY3Rpb24oXykgeworICAgIGlmICghYXJndW1lbnRzLmxlbmd0aCkgcmV0dXJuIGRlZmF1bHRTdGF0ZTsKKyAgICBkZWZhdWx0U3RhdGUgPSBfOworICAgIHJldHVybiBjaGFydDsKKyAgfTsKKworICBjaGFydC5ub0RhdGEgPSBmdW5jdGlvbihfKSB7CisgICAgaWYgKCFhcmd1bWVudHMubGVuZ3RoKSByZXR1cm4gbm9EYXRhOworICAgIG5vRGF0YSA9IF87CisgICAgcmV0dXJuIGNoYXJ0OworICB9OworCisgIC8vPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisKKworICByZXR1cm4gY2hhcnQ7Cit9CmRpZmYgLS1naXQgYS9lY29tcC1wb3J0YWwtQkUvd2FyL3N0YXRpYy9mdXNpb24vZDMvanMvbW9kZWxzL3NjYXR0ZXIuanMgYi9lY29tcC1wb3J0YWwtQkUvd2FyL3N0YXRpYy9mdXNpb24vZDMvanMvbW9kZWxzL3NjYXR0ZXIuanMKbmV3IGZpbGUgbW9kZSAxMDA2NDQKaW5kZXggMDAwMDAwMC4uMTZjYmVlNgotLS0gL2Rldi9udWxsCisrKyBiL2Vjb21wLXBvcnRhbC1CRS93YXIvc3RhdGljL2Z1c2lvbi9kMy9qcy9tb2RlbHMvc2NhdHRlci5qcwpAQCAtMCwwICsxLDY3NCBAQAorCitudi5tb2RlbHMuc2NhdHRlciA9IGZ1bmN0aW9uKCkgeworICAidXNlIHN0cmljdCI7CisgIC8vPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisgIC8vIFB1YmxpYyBWYXJpYWJsZXMgd2l0aCBEZWZhdWx0IFNldHRpbmdzCisgIC8vLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tCisKKyAgdmFyIG1hcmdpbiAgICAgICA9IHt0b3A6IDAsIHJpZ2h0OiAwLCBib3R0b206IDAsIGxlZnQ6IDB9CisgICAgLCB3aWR0aCAgICAgIC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2h0bHkgaW5jcmVhc2UgcGVyZm9ybWFuY2UKKyAgICAsIGNsaXBSYWRpdXMgICA9IGZ1bmN0aW9uKCkgeyByZXR1cm4gMjUgfSAvLyBmdW5jdGlvbiB0byBnZXQgdGhlIHJhZGl1cyBmb3Igdm9yb25vaSBwb2ludCBjbGlwcworICAgICwgeERvbWFpbiAgICAgID0gbnVsbCAvLyBPdmVycmlkZSB4IGRvbWFpbiAoc2tpcHMgdGhlIGNhbGN1bGF0aW9uIGZyb20gZGF0YSkKKyAgICAsIHlEb21haW4gICAgICA9IG51bGwgLy8gT3ZlcnJpZGUgeSBkb21haW4KKyAgICAsIHhSYW5nZSAgICAgICA9IG51bGwgLy8gT3ZlcnJpZGUgeCByYW5nZQorICAgICwgeVJhbmdlICAgICAgID0gbnVsbCAvLyBPdmVycmlkZSB5IHJhbmdlCisgICAgLCBzaXplRG9tYWluICAgPSBudWxsIC8vIE92ZXJyaWRlIHBvaW50IHNpemUgZG9tYWluCisgICAgLCBzaXplUmFuZ2UgICAgPSBudWxsCisgICAgLCBzaW5nbGVQb2ludCAgPSBmYWxzZQorICAgICwgZGlzcGF0Y2ggICAgID0gZDMuZGlzcGF0Y2goJ2VsZW1lbnRDbGljaycsICdlbGVtZW50TW91c2VvdmVyJywgJ2VsZW1lbnRNb3VzZW91dCcpCisgICAgLCB1c2VWb3Jvbm9pICAgPSB0cnVlCisgICAgOworCisgIC8vPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisKKworICAvLz09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorICAvLyBQcml2YXRlIFZhcmlhYmxlcworICAvLy0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLQorCisgIHZhciB4MCwgeTAsIHowIC8vIHVzZWQgdG8gc3RvcmUgcHJldml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kb21haW4oKVsxXSArIHguZG9tYWluKClbMV0gKiAwLjAxXSkKKyAgICAgICAgICA6IHguZG9tYWluKFstMSwxXSk7CisKKyAgICAgIGlmICh5LmRvbWFpbigpWzBdID09PSB5LmRvbWFpbigpWzFdKQorICAgICAgICB5LmRvbWFpbigpWzBdID8KKyAgICAgICAgICAgIHkuZG9tYWluKFt5LmRvbWFpbigpWzBdIC0geS5kb21haW4oKVswXSAqIDAuMDEsIHkuZG9tYWluKClbMV0gKyB5LmRvbWFpbigpWzFdICogMC4wMV0pCisgICAgICAgICAgOiB5LmRvbWFpbihbLTEsMV0pOworCisgICAgICBpZiAoIGlzTmFOKHguZG9tYWluKClbMF0pKSB7CisgICAgICAgICAgeC5kb21haW4oWy0xLDFdKTsKKyAgICAgIH0KKworICAgICAgaWYgKCBpc05hTih5LmRvbWFpbigpWzBdKSkgeworICAgICAgICAgIHkuZG9tYWluKFstMSwxXSk7CisgICAgICB9CisKKworICAgICAgeDAgPSB4MCB8fCB4OworICAgICAgeTAgPSB5MCB8fCB5OworICAgICAgejAgPSB6MCB8fCB6OworCisgICAgICAvLy0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLQorCisKKyAgICAgIC8vLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tCisgICAgICAvLyBTZXR1cCBjb250YWluZXJzIGFuZCBza2VsZXRvbiBvZiBjaGFydAorCisgICAgICB2YXIgd3JhcCA9IGNvbnRhaW5lci5zZWxlY3RBbGwoJ2cubnYtd3JhcC5udi1zY2F0dGVyJykuZGF0YShbZGF0YV0pOworICAgICAgdmFyIHdyYXBFbnRlciA9IHdyYXAuZW50ZXIoKS5hcHBlbmQoJ2cnKS5hdHRyKCdjbGFzcycsICdudmQzIG52LXdyYXAgbnYtc2NhdHRlciBudi1jaGFydC0nICsga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AgICAgaWYgKCFpbnRlcmFjdGl2ZSkgcmV0dXJuIGZhbHNlOworCisgICAgICAgIHZhciBldmVudEVsZW1lbnRzOworCisgICAgICAgIHZhciB2ZXJ0aWNlcyA9IGQzLm1lcmdlKGRhdGEubWFwKGZ1bmN0aW9uKGdyb3VwLCBncm91cEluZGV4KSB7CisgICAgICAgICAgICByZXR1cm4gZ3JvdXAudmFsdWVzCisgICAgICAgICAgICAgIC5tYXAoZnVuY3Rpb24ocG9pbnQsIHBvaW50SW5kZXgpIHsKKyAgICAgICAgICAgICAgICAvLyAqQWRkaW5nIG5vaXNlIHRvIG1ha2UgZHVwbGljYXRlcyB2ZXJ5IHVubGlrZWx5CisgICAgICAgICAgICAgICAgLy8gKkluamVjdGluZyBzZXJpZXMgYW5kIHBvaW50IGluZGV4IGZvciByZWZlcmVuY2UKKyAgICAgICAgICAgICAgICAvKiAqQWRkaW5nIGEgJ2ppdHRlcicgdG8gdGhlIHBvaW50cywgYmVjYXVzZSB0aGVyZSdzIGFuIGlzc3VlIGluIGQzLmdlb20udm9yb25vaS4KKyAgICAgICAgICAgICAgICAqLworICAgICAgICAgICAgICAgIHZhciBwWCA9IGdldFgocG9pbnQscG9pbnRJbmRleCk7CisgICAgICAgICAgICAgICAgdmFyIHBZID0gZ2V0WShwb2ludCxwb2ludEluZGV4KTsKKworICAgICAgICAgICAgICAgIHJldHVybiBbeChwWCkrIE1hdGgucmFuZG9tKCkgKiAxZS03LAorICAgICAgICAgICAgICAgICAgICAgICAgeShwWSkrIE1hdGgucmFuZG9tKCkgKiAxZS03LAorICAgICAgICAgICAgICAgICAgICAgICAgZ3JvdXBJbmRleCwKKyAgICAgICAgICAgICAgICAgICAgICAgIHBvaW50SW5kZXgsIHBvaW50XTsgLy90ZW1wIGhhY2sgdG8gYWRkIG5vaXNlIHVudGlsbCBJIHRoaW5rIG9mIGEgYmV0dGVyIHdheSBzbyB0aGVyZSBhcmUgbm8gZHVwbGljYXRlcworICAgICAgICAgICAgICB9KQorICAgICAgICAgICAgICAuZmlsdGVyKGZ1bmN0aW9uKHBvaW50QXJyYXksIHBvaW50SW5kZXgpIHsKKyAgICAgICAgICAgICAgICByZXR1cm4gcG9pbnRBY3RpdmUocG9pbnRBcnJheVs0XSwgcG9pbnRJbmRleCk7IC8vIElzc3VlICMyMzcuLiBtb3ZlIGZpbHRlciB0byBhZnRlciBtYXAsIHNvIHBvaW50SW5kZXggaXMgY29ycmVjdCEKKyAgICAgICAgICAgICAgfSkKKyAgICAgICAgICB9KQorICAgICAgICApOworCisKKworICAgICAgICAvL2luamVjdCBzZXJpZXMgYW5kIHBvaW50IGluZGV4IGZvciByZWZlcmVuY2UgaW50byB2b3Jvbm9pCisgICAgICAgIGlmICh1c2VWb3Jvbm9pID09PSB0cnVlKSB7CisKKyAgICAgICAgICBpZiAoY2xpcFZvcm9ub2kpIHsKKyAgICAgICAgICAgIHZhciBwb2ludENsaXBzRW50ZXIgPSB3cmFwLnNlbGVjdCgnZGVmcycpLnNlbGVjdEFsbCgnLm52LXBvaW50LWNsaXBzJykKKyAgICAgICAgICAgICAgICAuZGF0YShbaWRdKQorICAgICAgICAgICAgICAuZW50ZXIoKTsKKworICAgICAgICAgICAgcG9pbnRDbGlwc0VudGVyLmFwcGVuZCgnY2xpcFBhdGgnKQorICAgICAgICAgICAgICAgICAgLmF0dHIoJ2NsYXNzJywgJ252LXBvaW50LWNsaXBzJykKKyAgICAgICAgICAgICAgICAgIC5hdHRyKCdpZCcsICdudi1wb2ludHMtY2xpcC0nICsgaWQpOworCisgICAgICAgICAgICB2YXIgcG9pbnRDbGlwcyA9IHdyYXAuc2VsZWN0KCcjbnYtcG9pbnRzLWNsaXAtJyArIGlkKS5zZWxlY3RBbGwoJ2NpcmNsZScpCisgICAgICAgICAgICAgICAgLmRhdGEodmVydGljZXMpOworICAgICAgICAgICAgcG9pbnRDbGlwcy5lbnRlcigpLmFwcGVuZCgnY2lyY2xlJykKKyAgICAgICAgICAgICAgICAuYXR0cigncicsIG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KFsKKyAgICAgICAgICAgICAgWy0xMCwtMTBdLAorICAgICAgICAgICAgICBbLTEwLGhlaWdodCArIDEwXSwKKyAgICAgICAgICAgICAgW3dpZHRoICsgMTAsaGVpZ2h0ICsgMTBdLAorICAgICAgICAgICAgICBbd2lkdGggKyAxMCwtMTBdCisgICAgICAgICAgXSk7CisKKyAgICAgICAgICB2YXIgdm9yb25vaSA9IGQzLmdlb20udm9yb25vaSh2ZXJ0aWNlcykubWFwKGZ1bmN0aW9uKGQsIGkpIHsKKyAgICAgICAgICAgICAgcmV0dXJuIHsKKyAgICAgICAgICAgICAgICAnZGF0YSc6IGJvdW5kcy5jbGlwKGQpLAorICAgICAgICAgICAgICAgICdzZXJpZXMnOiB2ZXJ0aWNlc1tpXVsyXSwKKyAgICAgICAgICAgICAgICAncG9pbnQnOiB2ZXJ0aWNlc1tpXVszXQorICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9KTsKKworCisgICAgICAgICAgdmFyIHBvaW50UGF0aHMgPSB3cmFwLnNlbGVjdCgnLm52LXBvaW50LXBhdGhzJykuc2VsZWN0QWxsKCdwYXRoJykKKyAgICAgICAgICAgICAgLmRhdGEodm9yb25vaSk7CisgICAgICAgICAgcG9pbnRQYXRocy5lbnRlcigpLmFwcGVuZCgncGF0aCcpCisgICAgICAgICAgICAgIC5hdHRyKCdjbGFzcycsIGZ1bmN0aW9uKGQsaSkgeyByZXR1cm4gJ252LXBhdGgtJytpOyB9KTsKKyAgICAgICAgICBwb2ludFBhdGhzLmV4aXQoKS5yZW1vdmUoKTsKKyAgICAgICAgICBwb2ludFBhdGhzCisgICAgICAgICAgICAgIC5hdHRyKCdkJywgZnVuY3Rpb24oZCkgeworICAgICAgICAgICAgICAgIGlmIChkLmRhdGEubGVuZ3RoID09PSAwKQorICAgICAgICAgICAgICAgICAgICByZXR1cm4gJ00gMCAwJworICAgICAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgICAgICAgICAgcmV0dXJuICdNJyArIGQuZGF0YS5qb2luKCdMJykgKyAnWic7CisgICAgICAgICAgICAgIH0pOworCisgICAgICAgICAgdmFyIG1vdXNlRXZlbnRDYWxsYmFjayA9IGZ1bmN0aW9uKGQsbURpc3BhdGNoKSB7CisgICAgICAgICAgICAgICAgaWYgKG5lZWRzVXBkYXRlKSByZXR1cm4gMDsKKyAgICAgICAgICAgICAgICB2YXIgc2VyaWVzID0gZGF0YVtkLnNlcmllc107CisgICAgICAgICAgICAgICAgaWYgKHR5cGVvZiBzZXJpZXMgPT09ICd1bmRlZmluZWQnKSByZXR1cm47CisKKyAgICAgICAgICAgICAgICB2YXIgcG9pbnQgID0gc2VyaWVzLnZhbHVlc1tkLnBvaW50XTsKKworICAgICAgICAgICAgICAgIG1EaXNwYXRjaCh7CisgICAgICAgICAgICAgICAgICBwb2ludDogcG9pbnQsCisgICAgICAgICAgICAgICAgICBzZXJpZXM6IHNlcmllcywKKyAgICAgICAgICAgICAgICAgIHBvczogW3goZ2V0WChwb2ludCwgZC5wb2ludCkpICsgbWFyZ2luLmxlZnQsIHkoZ2V0WShwb2ludCwgZC5wb2ludCkpICsgbWFyZ2luLnRvcF0sCisgICAgICAgICAgICAgICAgICBzZXJpZXNJbmRleDogZC5zZXJpZXMsCisgICAgICAgICAgICAgICAgICBwb2ludEluZGV4OiBkLnBvaW50CisgICAgICAgICAgICAgICAgfSk7CisgICAgICAgICAgfTsKKworICAgICAgICAgIHBvaW50UGF0aHMKKyAgICAgICAgICAgICAgLm9uKCdjbGljaycsIGZ1bmN0aW9uKGQpIHsKKyAgICAgICAgICAgICAgICBtb3VzZUV2ZW50Q2FsbGJhY2soZCwgZGlzcGF0Y2guZWxlbWVudENsaWNrKTsKKyAgICAgICAgICAgICAgfSkKKyAgICAgICAgICAgICAgLm9uKCdtb3VzZW92ZXInLCBmdW5jdGlvbihkKSB7CisgICAgICAgICAgICAgICAgbW91c2VFdmVudENhbGxiYWNrKGQsIGRpc3BhdGNoLmVsZW1lbnRNb3VzZW92ZXIpOworICAgICAgICAgICAgICB9KQorICAgICAgICAgICAgICAub24oJ21vdXNlb3V0JywgZnVuY3Rpb24oZCwgaSkgeworICAgICAgICAgICAgICAgIG1vdXNlRXZlbnRDYWxsYmFjayhkLCBkaXNwYXRjaC5lbGVtZW50TW91c2VvdXQpOworICAgICAgICAgICAgICB9KTsKKworCisgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgLyoKKyAgICAgICAgICAvLyBicmluZyBkYXRhIGluIGZvcm0gbmVlZGVkIGZvciBjbGljayBoYW5kbGVycworICAgICAgICAgIHZhciBkYXRhV2l0aFBvaW50cyA9IHZlcnRpY2VzLm1hcChmdW5jdGlvbihkLCBpKSB7CisgICAgICAgICAgICAgIHJldHVybiB7CisgICAgICAgICAgICAgICAgJ2RhdGEnOiBkLAorICAgICAgICAgICAgICAgICdzZXJpZXMnOiB2ZXJ0aWNlc1tpXVsyXSwKKyAgICAgICAgICAgICAgICAncG9pbnQnOiB2ZXJ0aWNlc1tpXVszXQorICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9KTsKKyAgICAgICAgICAgKi8KKworICAgICAgICAgIC8vIGFkZCBldmVudCBoYW5kbGVycyB0byBwb2ludHMgaW5zdGVhZCB2b3Jvbm9pIHBhdGhzCisgICAgICAgICAgd3JhcC5zZWxlY3QoJy5udi1ncm91cHMnKS5zZWxlY3RBbGwoJy5udi1ncm91cCcpCisgICAgICAgICAgICAuc2VsZWN0QWxsKCcubnYtcG9pbnQnKQorICAgICAgICAgICAgICAvLy5kYXRhKGRhdGFXaXRoUG9pbnRzKQorICAgICAgICAgICAgICAvLy5zdHlsZSgncG9pbnRlci1ldmVudHMnLCAnYXV0bycpIC8vIHJlY2F0aXZhdGUgZXZlbnRzLCBkaXNhYmxlZCBieSBjc3MKKyAgICAgICAgICAgICAgLm9uKCdjbGljaycsIGZ1bmN0aW9uKGQsaSkgeworICAgICAgICAgICAgICAgIC8vbnYubG9nKCd0ZXN0JywgZCwgaSk7CisgICAgICAgICAgICAgICAgaWYgKG5lZWRzVXBkYXRlIHx8ICFkYXRhW2Quc2VyaWVzXSkgcmV0dXJuIDA7IC8vY2hlY2sgaWYgdGhpcyBpcyBhIGR1bW15IHBvaW50CisgICAgICAgICAgICAgICAgdmFyIHNlcmllcyA9IGRhdGFbZC5zZXJpZXNdLAorICAgICAgICAgICAgICAgICAgICBwb2ludCAgPSBzZXJpZXMudmFsdWVzW2ldOworCisgICAgICAgICAgICAgICAgZGlzcGF0Y2guZWxlbWVudENsaWNrKHsKKyAgICAgICAgICAgICAgICAgIHBvaW50OiBwb2ludCwKKyAgICAgICAgICAgICAgICAgIHNlcmllczogc2VyaWVzLAorICAgICAgICAgICAgICAgICAgcG9zOiBbeChnZXRYKHBvaW50LCBpKSkgKyBtYXJnaW4ubGVmdCwgeShnZXRZKHBvaW50LCBpKSkgKyBtYXJnaW4udG9wXSwKKyAgICAgICAgICAgICAgICAgIHNlcmllc0luZGV4OiBkLnNlcmllcywKKyAgICAgICAgICAgICAgICAgIHBvaW50SW5kZXg6IGkKKyAgICAgICAgICAgICAgICB9KTsKKyAgICAgICAgICAgICAgfSkKKyAgICAgICAgICAgICAgLm9uKCdtb3VzZW92ZXInLCBmdW5jdGlvbihkLGkpIHsKKyAgICAgICAgICAgICAgICBpZiAobmVlZHNVcGRhdGUgfHwgIWRhdGFbZC5zZXJpZXNdKSByZXR1cm4gMDsgLy9jaGVjayBpZiB0aGlzIGlzIGEgZHVtbXkgcG9pbnQKKyAgICAgICAgICAgICAgICB2YXIgc2VyaWVzID0gZGF0YVtkLnNlcmllc10sCisgICAgICAgICAgICAgICAgICAgIHBvaW50ICA9IHNlcmllcy52YWx1ZXNbaV07CisKKyAgICAgICAgICAgICAgICBkaXNwYXRjaC5lbGVtZW50TW91c2VvdmVyKHsKKyAgICAgICAgICAgICAgICAgIHBvaW50OiBwb2ludCwKKyAgICAgICAgICAgICAgICAgIHNlcmllczogc2VyaWVzLAorICAgICAgICAgICAgICAgICAgcG9zOiBbeChnZXRYKHBvaW50LCBpKSkgKyBtYXJnaW4ubGVmdCwgeShnZXRZKHBvaW50LCBpKSkgKyBtYXJnaW4udG9wXSwKKyAgICAgICAgICAgICAgICAgIHNlcmllc0luZGV4OiBkLnNlcmllcywKKyAgICAgICAgICAgICAgICAgIHBvaW50SW5kZXg6IGkKKyAgICAgICAgICAgICAgICB9KTsKKyAgICAgICAgICAgICAgfSkKKyAgICAgICAgICAgICAgLm9uKCdtb3VzZW91dCcsIGZ1bmN0aW9uKGQsaSkgeworICAgICAgICAgICAgICAgIGlmIChuZWVkc1VwZGF0ZSB8fCAhZGF0YVtkLnNlcmllc10pIHJldHVybiAwOyAvL2NoZWNrIGlmIHRoaXMgaXMgYSBkdW1teSBwb2ludAorICAgICAgICAgICAgICAgIHZhciBzZXJpZXMgPSBkYXRhW2Quc2VyaWVzXSwKKyAgICAgICAgICAgICAgICAgICAgcG9pbnQgID0gc2VyaWVzLnZhbHVlc1tpXTsKKworICAgICAgICAgICAgICAgIGRpc3BhdGNoLmVsZW1lbnRNb3VzZW91dCh7CisgICAgICAgICAgICAgICAgICBwb2ludDogcG9pbnQsCisgICAgICAgICAgICAgICAgICBzZXJpZXM6IHNlcmllcywKKyAgICAgICAgICAgICAgICAgIHNlcmllc0luZGV4OiBkLnNlcmllcywKKyAgICAgICAgICAgICAgICAgIHBvaW50SW5kZXg6IGkKKyAgICAgICAgICAgICAgICB9KTsKKyAgICAgICAgICAgICAgfSk7CisgICAgICAgICAgfQorCisgICAgICAgICAgbmVlZHNVcGRhdGUgPSBmYWxzZTsKKyAgICAgIH0KKworICAgICAgbmVlZHNVcGRhdGUgPSB0cnVlOworCisgICAgICB2YXIgZ3JvdXBzID0gd3JhcC5zZWxlY3QoJy5udi1ncm91cHMnKS5zZWxlY3RBbGwoJy5udi1ncm91cCcpCisgICAgICAgICAgLmRhdGEoZnVuY3Rpb24oZCkgeyByZXR1cm4gZCB9LCBmdW5jdGlvbihkKSB7IHJldHVybiBkLmtleSB9KTsKKyAgICA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mdW5jdGlvbiAoZCxpKSB7IHJldHVybiBkLmNvbG9yIH0pCisgICAgICAgICAgICAuYXR0cignY3gnLCBmdW5jdGlvbihkLGkpIHsgcmV0dXJuIG52LnV0aWxzLk5hTnRvWmVybyh4MChnZXRYKGQsaSkpKSB9KQorICAgICAgICAgICAgLmF0dHIoJ2N5JywgZnVuY3Rpb24oZCxpKSB7IHJldHVybiBudi51dGlscy5OYU50b1plcm8oeTAoZ2V0WShkLGkpKSkgfSkKKyAgICAgICAgICAgIC5hdHRyKCdyJywgZnVuY3Rpb24oZCxpKSB7IHJldHVybiBNYXRoLnNxcnQoeihnZXRTaXplKGQsaSkpL01hdGguUEkpIH0pOworICAgICAgICBwb2ludHMuZXhpdCgpLnJlbW92ZSgpOworICAgICAgICBncm91cHMuZXhpdCgpLnNlbGVjdEFsbCgncGF0aC5udi1wb2ludCcpLnRyYW5zaXRpb24oKQorICAgICAgICAgICAgLmF0dHIoJ2N4JywgZnVuY3Rpb24oZCxpKSB7IHJldHVybiBudi51dGlscy5OYU50b1plcm8oeChnZXRYKGQsaSkpKSB9KQorICAgICAgICAgICAgLmF0dHIoJ2N5JywgZnVuY3Rpb24oZCxpKSB7IHJldHVybiBudi51dGlscy5OYU50b1plcm8oeShnZXRZKGQsaSkpKSB9KQorICAgICAgICAgICAgLnJlbW92ZSgpOworICAgICAgICBwb2ludHMuZWFjaChmdW5jdGlvbihkLGkpIHsKKyAgICAgICAgICBkMy5zZWxlY3QodGhpcykKKyAgICAgICAgICAgIC5jbGFzc2VkKCdudi1wb2ludCcsIHRydWUpCisgICAgICAgICAgICAuY2xhc3NlZCgnbnYtcG9pbnQtJyArIGksIHRydWUpCisgICAgICAgICAgICAuY2xhc3NlZCgnaG92ZXInLGZhbHNlKQorICAgICAgICAgICAgOworICAgICAgICB9KTsKKyAgICAgICAgcG9pbnRzLnRyYW5zaXRpb24oKQorICAgICAgICAgICAgLmF0dHIoJ2N4JywgZnVuY3Rpb24oZCxpKSB7IHJldHVybiBudi51dGlscy5OYU50b1plcm8oeChnZXRYKGQsaSkpKSB9KQorICAgICAgICAgICAgLmF0dHIoJ2N5JywgZnVuY3Rpb24oZCxpKSB7IHJldHVybiBudi51dGlscy5OYU50b1plcm8oeShnZXRZKGQsaSkpKSB9KQorICAgICAgICAgICAgLmF0dHIoJ3InLCBmdW5jdGlvbihkLGkpIHsgcmV0dXJuIE1hdGguc3FydCh6KGdldFNpemUoZCxpKSkvTWF0aC5QSSkgfSk7CisKKyAgICAgIH0gZWxzZSB7CisKKyAgICAgICAgdmFyIHBvaW50cyA9IGdyb3Vwcy5zZWxlY3RBbGwoJ3BhdGgubnYtcG9pbnQnKQorICAgICAgICAgICAgLmRhdGEoZnVuY3Rpb24oZCkgeyByZXR1cm4gZC52YWx1ZXMgfSk7CisgICAgICAgIHBvaW50cy5lbnRlcigpLmFwcGVuZCgncGF0aCcpCisgICAgICAgICAgICAuc3R5bGUoJ2ZpbGwnLCBmdW5jdGlvbiAoZCxpKSB7IHJldHVybiBkLmNvbG9yIH0pCisgICAgICAgICAgICAuc3R5bGUoJ3N0cm9rZScsIGZ1bmN0aW9uIChkLGkpIHsgcmV0dXJuIGQuY29sb3IgfSkKKyAgICAgICAgICAgIC5hdHRyKCd0cmFuc2Zvcm0nLCBmdW5jdGlvbihkLGkpIHsKKyAgICAgICAgICAgICAgcmV0dXJuICd0cmFuc2xhdGUoJyArIHgwKGdldFgoZCxpKSkgKyAnLCcgKyB5MChnZXRZKGQsaSkpICsgJyknCisgICAgICAgICAgICB9KQorICAgICAgICAgICAgLmF0dHIoJ2QnLAorICAgICAgICAgICAgICBkMy5zdmcuc3ltYm9sKCkKKyAgICAgICAgICAgICAgICAudHlwZShnZXRTaGFwZSkKKyAgICAgICAgICAgICAgICAuc2l6ZShmdW5jdGlvbihkLGkpIHsgcmV0dXJuIHooZ2V0U2l6ZShkLGkpKSB9KQorICAgICAgICAgICAgKTsKKyAgICAgICAgcG9pbnRzLmV4aXQoKS5yZW1vdmUoKTsKKyAgICAgICAgZ3JvdXBzLmV4aXQoKS5zZWxlY3RBbGwoJ3BhdGgubnYtcG9pbnQnKQorICAgICAgICAgICAgLnRyYW5zaXRpb24oKQorICAgICAgICAgICAgLmF0dHIoJ3RyYW5zZm9ybScsIGZ1bmN0aW9uKGQsaSkgeworICAgICAgICAgICAgICByZXR1cm4gJ3RyYW5zbGF0ZSgnICsgeChnZXRYKGQsaSkpICsgJywnICsgeShnZXRZKGQsaSkpICsgJyknCisgICAgICAgICAgICB9KQorICAgICAgICAgICAgLnJlbW92ZSgpOworICAgICAgICBwb2ludHMuZWFjaChmdW5jdGlvbihkLGkpIHsKKyAgICAgICAgICBkMy5zZWxlY3QodGhpcykKKyAgICAgICAgICAgIC5jbGFzc2VkKCdudi1wb2ludCcsIHRydWUpCisgICAgICAgICAgICAuY2xhc3NlZCgnbnYtcG9pbnQtJyArIGksIHRydWUpCisgICAgICAgICAgICAuY2xhc3NlZCgnaG92ZXInLGZhbHNlKQorICAgICAgICAgICAgOworICAgICAgICB9KTsKKyAgICAgICAgcG9pbnRzLnRyYW5zaXRpb24oKQorICAgICAgICAgICAgLmF0dHIoJ3RyYW5zZm9ybScsIGZ1bmN0aW9uKGQsaSkgeworICAgICAgICAgICAgICAvL252LmxvZyhkLGksZ2V0WChkLGkpLCB4KGdldFgoZCxpKSkpOworICAgICAgICAgICAgICByZXR1cm4gJ3RyYW5zbGF0ZSgnICsgeChnZXRYKGQsaSkpICsgJywnICsgeShnZXRZKGQsaSkpICsgJyknCisgICAgICAgICAgICB9KQorICAgICAgICAgICAgLmF0dHIoJ2QnLAorICAgICAgICAgICAgICBkMy5zdmcuc3ltYm9sKCkKKyAgICAgICAgICAgICAgICAudHlwZShnZXRTaGFwZSkKKyAgICAgICAgICAgICAgICAuc2l6ZShmdW5jdGlvbihkLGkpIHsgcmV0dXJuIHooZ2V0U2l6ZShkLGkpKSB9KQorICAgICAgICAgICAgKTsKKyAgICAgIH0KKworCisgICAgICAvLyBEZWxheSB1cG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sKKworICBjaGFydC5oZWlnaHQgPSBmdW5jdGlvbihfKSB7CisgICAgaWYgKCFhcmd1bWVudHMubGVuZ3RoKSByZXR1cm4gaGVpZ2h0OworICAgIGhlaWdodCA9IF87CisgICAgcmV0dXJuIGNoYXJ0OworICB9OworCisgIGNoYXJ0LnhTY2FsZSA9IGZ1bmN0aW9uKF8pIHsKKyAgICBpZiAoIWFyZ3VtZW50cy5sZW5ndGgpIHJldHVybiB4OworICAgIHggPSBfOworICAgIHJldHVybiBjaGFydDsKKyAgfTsKKworICBjaGFydC55U2NhbGUgPSBmdW5jdGlvbihfKSB7CisgICAgaWYgKCFhcmd1bWVudHMubGVuZ3RoKSByZXR1cm4geTsKKyAgICB5ID0gXzsKKyAgICByZXR1cm4gY2hhcnQ7CisgIH07CisKKyAgY2hhcnQuelNjYWxlID0gZnVuY3Rpb24oXykgeworICAgIGlmICghYXJndW1lbnRzLmxlbmd0aCkgcmV0dXJuIHo7CisgICAgeiA9IF87CisgICAgcmV0dXJuIGNoYXJ0OworICB9OworCisgIGNoYXJ0LnhEb21haW4gPSBmdW5jdGlvbihfKSB7CisgICAgaWYgKCFhcmd1bWVudHMubGVuZ3RoKSByZXR1cm4geERvbWFpbjsKKyAgICB4RG9tYWluID0gXzsKKyAgICByZXR1cm4gY2hhcnQ7CisgIH07CisKKyAgY2hhcnQueURvbWFpbiA9IGZ1bmN0aW9uKF8pIHsKKyAgICBpZiAoIWFyZ3VtZW50cy5sZW5ndGgpIHJldHVybiB5RG9tYWluOworICAgIHlEb21haW4gPSBfOworICAgIHJldHVybiBjaGFydDsKKyAgfTsKKworICBjaGFydC5zaXplRG9tYWluID0gZnVuY3Rpb24oXykgeworICAgIGlmICghYXJndW1lbnRzLmxlbmd0aCkgcmV0dXJuIHNpemVEb21haW47CisgICAgc2l6ZURvbWFpbiA9IF87CisgICAgcmV0dXJuIGNoYXJ0OworICB9OworCisgIGNoYXJ0LnhSYW5nZSA9IGZ1bmN0aW9uKF8pIHsKKyAgICBpZiAoIWFyZ3VtZW50cy5sZW5ndGgpIHJldHVybiB4UmFuZ2U7CisgICAgeFJhbmdlID0gXzsKKyAgICByZXR1cm4gY2hhcnQ7CisgIH07CisKKyAgY2hhcnQueVJhbmdlID0gZnVuY3Rpb24oXykgeworICAgIGlmICghYXJndW1lbnRzLmxlbmd0aCkgcmV0dXJuIHlSYW5nZTsKKyAgICB5UmFuZ2UgPSBfOworICAgIHJldHVybiBjaGFydDsKKyAgfTsKKworICBjaGFydC5zaXplUmFuZ2UgPSBmdW5jdGlvbihfKSB7CisgICAgaWYgKCFhcmd1bWVudHMubGVuZ3RoKSByZXR1cm4gc2l6ZVJhbmdlOworICAgIHNpemVSYW5nZSA9IF87CisgICAgcmV0dXJuIGNoYXJ0OworICB9OworCisgIGNoYXJ0LmZvcmNlWCA9IGZ1bmN0aW9uKF8pIHsKKyAgICBpZiAoIWFyZ3VtZW50cy5sZW5ndGgpIHJldHVybiBmb3JjZVg7CisgICAgZm9yY2VYID0gXzsKKyAgICByZXR1cm4gY2hhcnQ7CisgIH07CisKKyAgY2hhcnQuZm9yY2VZID0gZnVuY3Rpb24oXykgeworICAgIGlmICghYXJndW1lbnRzLmxlbmd0aCkgcmV0dXJuIGZvcmNlWTsKKyAgICBmb3JjZVkgPSBfOworICAgIHJldHVybiBjaGFydDsKKyAgfTsKKworICBjaGFydC5mb3JjZVNpemUgPSBmdW5jdGlvbihfKSB7CisgICAgaWYgKCFhcmd1bWVudHMubGVuZ3RoKSByZXR1cm4gZm9yY2VTaXplOworICAgIGZvcmNlU2l6ZSA9IF87CisgICAgcmV0dXJuIGNoYXJ0OworICB9OworCisgIGNoYXJ0LmludGVyYWN0aXZlID0gZnVuY3Rpb24oXykgeworICAgIGlmICghYXJndW1lbnRzLmxlbmd0aCkgcmV0dXJuIGludGVyYWN0aXZlOworICAgIGludGVyYWN0aXZlID0gXzsKKyAgICByZXR1cm4gY2hhcnQ7CisgIH07CisKKyAgY2hhcnQucG9pbnRLZXkgPSB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ICAgc2luZ2xlUG9pbnQgPSBfOworICAgIHJldHVybiBjaGFydDsKKyAgfTsKKworICAvLz09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorCisKKyAgcmV0dXJuIGNoYXJ0OworfQpkaWZmIC0tZ2l0IGEvZWNvbXAtcG9ydGFsLUJFL3dhci9zdGF0aWMvZnVzaW9uL2QzL2pzL21vZGVscy9zY2F0dGVyQ2hhcnQuanMgYi9lY29tcC1wb3J0YWwtQkUvd2FyL3N0YXRpYy9mdXNpb24vZDMvanMvbW9kZWxzL3NjYXR0ZXJDaGFydC5qcwpuZXcgZmlsZSBtb2RlIDEwMDY0NAppbmRleCAwMDAwMDAwLi42NWI2ZTM4Ci0tLSAvZGV2L251bGwKKysrIGIvZWNvbXAtcG9ydGFsLUJFL3dhci9zdGF0aWMvZnVzaW9uL2QzL2pzL21vZGVscy9zY2F0dGVyQ2hhcnQuanMKQEAgLTAsMCArMSw2MjggQEAKK252Lm1vZGVscy5zY2F0dGVyQ2hhcnQgPSBmdW5jdGlvbigpIHsKKyAgInVzZSBzdHJpY3QiOworICAvLz09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorICAvLyBQdWJsaWMgVmFyaWFibGVzIHdpdGggRGVmYXVsdCBTZXR0aW5ncworICAvLy0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLQorCisgIHZhciBzY2F0dGVyICAgICAgPSBudi5tb2RlbHMuc2NhdHRlcigpCisgICAgLCB4QXhpcyAgICAgICAgPSBudi5tb2RlbHMuYXhpcygpCisgICAgLCB5QXhpcyAgICAgICAgPSBudi5tb2RlbHMuYXhpcygpCisgICAgLCBsZWdlbmQgICAgICAgPSBudi5tb2RlbHMubGVnZW5kKCkKKyAgICAsIGNvbnRyb2xzICAgICA9IG52Lm1vZGVscy5sZWdlbmQoKQorICAgICwgZGlzdFggICAgICAgID0gbnYubW9kZWxzLmRpc3RyaWJ1dGlvbigpCisgICAgLCBkaXN0WSAgICAgICAgPSBudi5tb2RlbHMuZGlzdHJpYnV0aW9uKCkKKyAgICA7CisKKyAgdmFyIG1hcmdpbiAgICAgICA9IHt0b3A6IDMwLCByaWdodDogMjAsIGJvdHRvbTogNTAsIGxlZnQ6IDc1fQorICAgICwgd2lkdGggICAgICAgID0gbnVsbAorICAgICwgaGVpZ2h0ICAgICAgID0gbnVsbAorICAgICwgY29sb3IgICAgICAgID0gbnYudXRpbHMuZGVmYXVsdENvbG9yKCkKKyAgICAsIHggICAgICAgICAgICA9IGQzLmZpc2hleWUgPyBkMy5maXNoZXllLnNjYWxlKGQzLnNjYWxlLmxpbmVhcikuZGlzdG9ydGlvbigwKSA6IHNjYXR0ZXIueFNjYWxlKCkKKyAgICAsIHkgICAgICAgICAgICA9IGQzLmZpc2hleWUgPyBkMy5maXNoZXllLnNjYWxlKGQzLnNjYWxlLmxpbmVhcikuZGlzdG9ydGlvbigwKSA6IHNjYXR0ZXIueVNjYWxlKCkKKyAgICAsIHhQYWRkaW5nICAgICA9IDAKKyAgICAsIHlQYWRkaW5nICAgICA9IDAKKyAgICAsIHNob3dEaXN0WCAgICA9IGZhbHNlCisgICAgLCBzaG93RGlzdFkgICAgPSBmYWxzZQorICAgICwgc2hvd0xlZ2VuZCAgID0gdHJ1ZQorICAgICwgc2hvd1hBeGlzICAgID0gdHJ1ZQorICAgICwgc2hvd1lBeGlzICAgID0gdHJ1ZQorICAgICwgcmlnaHRBbGlnbllBeGlzID0gZmFsc2UKKyAgICAsIHNob3dDb250cm9scyA9ICEhZDMuZmlzaGV5ZQorICAgICwgZmlzaGV5ZSAgICAgID0gMAorICAgICwgcGF1c2VGaXNoZXllID0gZmFsc2UKKyAgICAsIHRvb2x0aXBzICAgICA9IHRydWUKKyAgICAsIHRvb2x0aXBYICAgICA9IGZ1bmN0aW9uKGtleSwgeCwgeSkgeyByZXR1cm4gJzxzdHJvbmc+JyArIHggKyAnPC9zdHJvbmc+JyB9CisgICAgLCB0b29sdGlwWSAgICAgPSBmdW5jdGlvbihrZXksIHgsIHkpIHsgcmV0dXJuICc8c3Ryb25nPicgKyB5ICsgJzwvc3Ryb25nPicgfQorICAgICwgdG9vbHRpcCAgICAgID0gbnVsbAorICAgICwgc3RhdGUgPSB7fQorICAgICwgZGVmYXVsdFN0YXRlID0gbnVsbAorICAgICwgZGlzcGF0Y2ggICAgID0gZDMuZGlzcGF0Y2goJ3Rvb2x0aXBTaG93JywgJ3Rvb2x0aXBIaWRlJywgJ3N0YXRlQ2hhbmdlJywgJ2NoYW5nZVN0YXRlJykKKyAgICAsIG5vRGF0YSAgICAgICA9ICJObyBEYXRhIEF2YWlsYWJsZS4iCisgICAgLCB0cmFuc2l0aW9uRHVyYXRpb24gPSAyNTAKKyAgICA7CisKKyAgc2NhdHRlcgorICAgIC54U2NhbGUoeCkKKyAgICAueVNjYWxlKHkpCisgICAgOworICB4QXhpcworICAgIC5vcmllbnQoJ2JvdHRvbScpCisgICAgLnRpY2tQYWRkaW5nKDEwKQorICAgIDsKKyAgeUF4aXMKKyAgICAub3JpZW50KChyaWdodEFsaWduWUF4aXMpID8gJ3JpZ2h0JyA6ICdsZWZ0JykKKyAgICAudGlja1BhZGRpbmcoMTApCisgICAgOworICBkaXN0WAorICAgIC5heGlzKCd4JykKKyAgICA7CisgIGRpc3RZCisgICAgLmF4aXMoJ3knKQorICAgIDsKKworICBjb250cm9scy51cGRhdGVTdGF0ZShmYWxzZSk7CisKKyAgLy89PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKworCisgIC8vPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisgIC8vIFByaXZhdGUgVmFyaWFibGVzCisgIC8vLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0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XZhaWxhYmxlSGVpZ2h0ID0gKGhlaWdodCB8fCBwYXJzZUludChjb250YWluZXIuc3R5bGUoJ2hlaWdodCcpKSB8fCA0MDApCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC0gbWFyZ2luLnRvcCAtIG1hcmdpbi5ib3R0b207CisKKyAgICAgIGNoYXJ0LnVwZGF0ZSA9IGZ1bmN0aW9uKCkgeyBjb250YWluZXIudHJhbnNpdGlvbigpLmR1cmF0aW9uKHRyYW5zaXRpb25EdXJhdGlvbikuY2FsbChjaGFydCk7IH07CisgICAgICBjaGFydC5jb250YWluZXIgPSB0aGlzOworCisgICAgICAvL3NldCBzdGF0ZS5kaXNhYmxlZAorICAgICAgc3RhdGUuZGlzYWJsZWQgPSBkYXRhLm1hcChmdW5jdGlvbihkKSB7IHJldHVybiAhIWQuZGlzYWJsZWQgfSk7CisKKyAgICAgIGlmICghZGVmYXVsdFN0YXRlKSB7CisgICAgICAgIHZhciBrZXk7CisgICAgICAgIGRlZmF1bHRTdGF0ZSA9IHt9OworICAgICAgICBmb3IgKGtleSBpbiBzdGF0ZSkgeworICAgICAgICAgIGlmIChzdGF0ZVtrZXldIGluc3RhbmNlb2YgQXJyYXkpCisgICAgICAgICAgICBkZWZhdWx0U3RhdGVba2V5XSA9IHN0YXRlW2tleV0uc2xpY2UoMCk7CisgICAgICAgICAgZWxzZQorICAgICAgICAgICAgZGVmYXVsdFN0YXRlW2tleV0gPSBzdGF0ZVtrZXldOworICAgICAgICB9CisgICAgICB9CisKKyAgICAgIC8vLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tCisgICAgICAvLyBEaXNwbGF5IG5vRGF0YSBtZXNzYWdlIGlmIHRoZXJlJ3Mgbm90aGluZyB0byBzaG93LgorCisgICAgICBpZiAoIWRhdGEgfHwgIWRhdGEubGVuZ3RoIHx8ICFkYXRhLmZpbHRlcihmdW5jdGlvbihk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AgICAvLy0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLQorCisKKyAgICAgIC8vLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tCisgICAgICAvLyBDb250cm9scworCisgICAgICBpZiAoc2hvd0NvbnRyb2xzKSB7CisgICAgICAgIGNvbnRyb2xzLndpZHRoKDE4MCkuY29sb3IoWycjNDQ0J10pOworICAgICAgICBnLnNlbGVjdCgnLm52LWNvbnRyb2xzV3JhcCcpCisgICAgICAgICAgICAuZGF0dW0oY29udHJvbHNEYXRhKQorICAgICAgICAgICAgLmF0dHIoJ3RyYW5zZm9ybScsICd0cmFuc2xhdGUoMCwnICsgKC1tYXJnaW4udG9wKSArJyknKQorICAgICAgICAgICAgLmNhbGwoY29udHJvbHMpOworICAgICAgfQorCisgICAgICAvLy0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLQorCisKKyAgICAgIHdyYXAuYXR0cigndHJhbnNmb3JtJywgJ3RyYW5zbGF0ZSgnICsgbWFyZ2luLmxlZnQgKyAnLCcgKyBtYXJnaW4udG9wICsgJyknKTsKKworICAgICAgaWYgKHJpZ2h0QWxpZ25ZQXhpcykgeworICAgICAgICAgIGcuc2VsZWN0KCIubnYteS5udi1heGlzIikKKyAgICAgICAgICAgICAgLmF0dHIoInRyYW5zZm9ybSIsICJ0cmFuc2xhdGUoIiArIGF2YWlsYWJsZVdpZHRoICsgIiwwKSIpOworICAgICAgfQorCisgICAgICAvLy0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLQorICAgICAgLy8gTWFpbiBDaGFydCBDb21wb25lbnQocykKKworICAgICAgc2NhdHRlcgorICAgICAgICAgIC53aWR0aChhdmFpbGFibGVXaWR0aCkKKyAgICAgICAgICAuaGVpZ2h0KGF2YWlsYWJsZUhlaWdodCkKKyAgICAgICAgICAuY29sb3IoZGF0YS5tYXAoZnVuY3Rpb24oZCxpKSB7CisgICAgICAgICAgICByZXR1cm4gZC5jb2xvciB8fCBjb2xvcihkLCBpKTsKKyAgICAgICAgICB9KS5maWx0ZXIoZnVuY3Rpb24oZCxpKSB7IHJldHVybiAhZGF0YVtpXS5kaXNhYmxlZCB9KSk7CisKKyAgICAgIGlmICh4UGFkZGluZyAhPT0gMCkKKyAgICAgICAgc2NhdHRlci54RG9tYWluKG51bGwpOworCisgICAgICBpZiAoeVBhZGRpbmcgIT09IDApCisgICAgICAgIHNjYXR0ZXIueURvbWFpbihudWxsKTsKKworICAgICAgd3JhcC5zZWxlY3QoJy5udi1zY2F0dGVyV3JhcCcpCisgICAgICAgICAgLmRhdHVtKGRhdGEuZmlsdGVyKGZ1bmN0aW9uKGQpIHsgcmV0dXJuICFkLmRpc2FibGVkIH0pKQorICAgICAgICAgIC5jYWxsKHNjYXR0ZXIpOworCisgICAgICAvL0FkanVzdCBmb3IgeCBhbmQgeSBwYWRkaW5nCisgICAgICBpZiAoeFBhZGRpbmcgIT09IDApIHsKKyAgICAgICAgdmFyIHhSYW5nZSA9IHguZG9tYWluKClbMV0gLSB4LmRvbWFpbigpWzBdOworICAgICAgICBzY2F0dGVyLnhEb21haW4oW3guZG9tYWluKClbMF0gLSAoeFBhZGRpbmcgKiB4UmFuZ2UpLCB4LmRvbWFpbigpWzFdICsgKHhQYWRkaW5nICogeFJhbmdlKV0pOworICAgICAgfQorCisgICAgICBpZiAoeVBhZGRpbmcgIT09IDApIHsKKyAgICAgICAgdmFyIHlSYW5nZSA9IHkuZG9tYWluKClbMV0gLSB5LmRvbWFpbigpWzBdOworICAgICAgICBzY2F0dGVyLnlEb21haW4oW3kuZG9tYWluKClbMF0gLSAoeVBhZGRpbmcgKiB5UmFuZ2UpLCB5LmRvbWFpbigpWzFdICsgKHlQYWRkaW5nICogeVJhbmdlKV0pOworICAgICAgfQorCisgICAgICAvL09ubHkgbmVlZCB0byB1cGRhdGUgdGhlIHNjYXR0ZXIgYWdhaW4gaWYgeC95UGFkZGluZyBjaGFuZ2VkIHRoZSBkb21haW4uCisgICAgICBpZiAoeVBhZGRpbmcgIT09IDAgfHwgeFBhZGRpbmcgIT09IDApIHsKKyAgICAgICAgd3JhcC5zZWxlY3QoJy5udi1zY2F0dGVyV3JhcCcpCisgICAgICAgICAgICAuZGF0dW0oZGF0YS5maWx0ZXIoZnVuY3Rpb24oZCkgeyByZXR1cm4gIWQuZGlzYWJsZWQgfSkpCisgICAgICAgICAgICAuY2FsbChzY2F0dGVyKTsKKyAgICAgIH0KKworICAgICAgLy8tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0KKworCisgICAgICAvLy0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLQorICAgICAgLy8gU2V0dXAgQXhlcworICAgICAgaWYgKHNob3dYQXhpcykgeworICAgICAgICB4QXhpcworICAgICAgICAgICAgLnNjYWxlKHgpCisgICAgICAgICAgICAudGlja3MoIHhBeGlzLnRpY2tzKCkgJiYgeEF4aXMudGlja3MoKS5sZW5ndGggPyB4QXhpcy50aWNrcygpIDogYXZhaWxhYmxlV2lkdGggLyAxMDAgKQorICAgICAgICAgICAgLnRpY2tTaXplKCAtYXZhaWxhYmxlSGVpZ2h0ICwgMCk7CisKKyAgICAgICAgZy5zZWxlY3QoJy5udi14Lm52LWF4aXMnKQorICAgICAgICAgICAgLmF0dHIoJ3RyYW5zZm9ybScsICd0cmFuc2xhdGUoMCwnICsgeS5yYW5nZSgpWzBdICsgJyknKQorICAgICAgICAgICAgLmNhbGwoeEF4aXMpOworCisgICAgICB9CisKKyAgICAgIGlmIChzaG93WUF4aXMpIHsKKyAgICAgICAgeUF4aXMKKyAgICAgICAgICAgIC5zY2FsZSh5KQorICAgICAgICAgICAgLnRpY2tzKCB5QXhpcy50aWNrcygpICYmIHlBeGlzLnRpY2tzKCkubGVuZ3RoID8geUF4aXMudGlja3MoKSA6IGF2YWlsYWJsZUhlaWdodCAvIDM2ICkKKyAgICAgICAgICAgIC50aWNrU2l6ZSggLWF2YWlsYWJsZVdpZHRoLCAwKTsKKworICAgICAgICBnLnNlbGVjdCgnLm52LXkubnYtYXhpcycpCisgICAgICAgICAgICAuY2FsbCh5QXhpcyk7CisgICAgICB9CisKKworICAgICAgaWYgKHNob3dEaXN0WCkgeworICAgICAgICBkaXN0WAorICAgICAgICAgICAgLmdldERhdGEoc2NhdHRlci54KCkpCisgICAgICAgICAgICAuc2NhbGUoeCkKKyAgICAgICAgICAgIC53aWR0aChhdmFpbGFibGVXaWR0aCkKKyAgICAgICAgICAgIC5jb2xvcihkYXRhLm1hcChmdW5jdGlvbihkLGkpIHsKKyAgICAgICAgICAgICAgcmV0dXJuIGQuY29sb3IgfHwgY29sb3IoZCwgaSk7CisgICAgICAgICAgICB9KS5maWx0ZXIoZnVuY3Rpb24oZCxpKSB7IHJldHVybiAhZGF0YVtpXS5kaXNhYmxlZCB9KSk7CisgICAgICAgIGdFbnRlci5zZWxlY3QoJy5udi1kaXN0V3JhcCcpLmFwcGVuZCgnZycpCisgICAgICAgICAgICAuYXR0cignY2xhc3MnLCAnbnYtZGlzdHJpYnV0aW9uWCcpOworICAgICAgICBnLnNlbGVjdCgnLm52LWRpc3RyaWJ1dGlvblgnKQorICAgICAgICAgICAgLmF0dHIoJ3RyYW5zZm9ybScsICd0cmFuc2xhdGUoMCwnICsgeS5yYW5nZSgpWzBdICsgJyknKQorICAgICAgICAgICAgLmRhdHVtKGRhdGEuZmlsdGVyKGZ1bmN0aW9uKGQpIHsgcmV0dXJuICFkLmRpc2FibGVkIH0pKQorICAgICAgICAgICAgLmNhbGwoZGlzdFgpOworICAgICAgfQorCisgICAgICBpZiAoc2hvd0Rpc3RZKSB7CisgICAgICAgIGRpc3RZCisgICAgICAgICAgICAuZ2V0RGF0YShzY2F0dGVyLnkoKSkKKyAgICAgICAgICAgIC5zY2FsZSh5KQorICAgICAgICAgICAgLndpZHRoKGF2YWlsYWJsZUhlaWdodCkKKyAgICAgICAgICAgIC5jb2xvcihkYXRhLm1hcChmdW5jdGlvbihkLGkpIHsKKyAgICAgICAgICAgICAgcmV0dXJuIGQuY29sb3IgfHwgY29sb3IoZCwgaSk7CisgICAgICAgICAgICB9KS5maWx0ZXIoZnVuY3Rpb24oZCxpKSB7IHJldHVybiAhZGF0YVtpXS5kaXNhYmxlZCB9KSk7CisgICAgICAgIGdFbnRlci5zZWxlY3QoJy5udi1kaXN0V3JhcCcpLmFwcGVuZCgnZycpCisgICAgICAgICAgICAuYXR0cignY2xhc3MnLCAnbnYtZGlzdHJpYnV0aW9uWScpOworICAgICAgICBnLnNlbGVjdCgnLm52LWRpc3RyaWJ1dGlvblknKQorICAgICAgICAgICAgLmF0dHIoJ3RyYW5zZm9ybScsIAorICAgICAgICAgICAgICAndHJhbnNsYXRlKCcgKyAocmlnaHRBbGlnbllBeGlzID8gYXZhaWxhYmxlV2lkdGggOiAtZGlzdFkuc2l6ZSgpICkgKyAnLDApJykKKyAgICAgICAgICAgIC5kYXR1bShkYXRhLmZpbHRlcihmdW5jdGlvbihkKSB7IHJldHVybiAhZC5kaXNhYmxlZCB9KSkKKyAgICAgICAgICAgIC5jYWxsKGRpc3RZKTsKKyAgICAgIH0KKworICAgICAgLy8tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0KKworCisKKworICAgICAgaWYgKGQzLmZpc2hleWUpIHsKKyAgICAgICAgZy5zZWxlY3QoJy5udi1iYWNrZ3JvdW5kJykKKyAgICAgICAgICAgIC5hdHRyKCd3aWR0aCcsIGF2YWlsYWJsZVdpZHRoKQorICAgICAgICAgICAgLmF0dHIoJ2hlaWdodCcsIGF2YWlsYWJsZUhlaWdodCk7CisKKyAgICAgICAgZy5zZWxlY3QoJy5udi1iYWNrZ3JvdW5kJykub24oJ21vdXNlbW92ZScsIHVwZGF0ZUZpc2hleWUpOworICAgICAgICBnLnNlbGVjdCgnLm52LWJhY2tncm91bmQnKS5vbignY2xpY2snLCBmdW5jdGlvbigpIHsgcGF1c2VGaXNoZXllID0gIXBhdXNlRmlzaGV5ZTt9KTsKKyAgICAgICAgc2NhdHRlci5kaXNwYXRjaC5vbignZWxlbWVudENsaWNrLmZyZWV6ZUZpc2hleWUnLCBmdW5jdGlvbigpIHsKKyAgICAgICAgICBwYXVzZUZpc2hleWUgPSAhcGF1c2VGaXNoZXllOworICAgICAgICB9KTsKKyAgICAgIH0KKworCisgICAgICBmdW5jdGlvbiB1cGRhdGVGaXNoZXllKCkgeworICAgICAgICBpZiAocGF1c2VGaXNoZXllKSB7CisgICAgICAgICAgZy5zZWxlY3QoJy5udi1wb2ludC1wYXRocycpLnN0eWxlKCdwb2ludGVyLWV2ZW50cycsICdhbGwnKTsKKyAgICAgICAgICByZXR1cm4gZmFsc2U7CisgICAgICAgIH0KKworICAgICAgICBnLnNlbGVjdCgnLm52LXBvaW50LXBhdGhzJykuc3R5bGUoJ3BvaW50ZXItZXZlbnRzJywgJ25vbmUnICk7CisKKyAgICAgICAgdmFyIG1vdXNlID0gZDMubW91c2UodGhpcyk7CisgICAgICAgIHguZGlzdG9ydGlvbihmaXNoZXllKS5mb2N1cyhtb3VzZVswXSk7CisgICAgICAgIHkuZGlzdG9ydGlvbihmaXNoZXllKS5mb2N1cyhtb3VzZVsxXSk7CisKKyAgICAgICAgZy5zZWxlY3QoJy5udi1zY2F0dGVyV3JhcCcpCisgICAgICAgICAgICAuY2FsbChzY2F0dGVyKTsKKworICAgICAgICBpZiAoc2hvd1hBeGlzKQorICAgICAgICAgIGcuc2VsZWN0KCcubnYteC5udi1heGlzJykuY2FsbCh4QXhpcyk7CisgICAgICAgIAorICAgICAgICBpZiAoc2hvd1lBeGlzKQorICAgICAgICAgIGcuc2VsZWN0KCcubnYteS5udi1heGlzJykuY2FsbCh5QXhpcyk7CisgICAgICAgIAorICAgICAgICBnLnNlbGVjdCgnLm52LWRpc3RyaWJ1dGlvblgnKQorICAgICAgICAgICAgLmRhdHVtKGRhdGEuZmlsdGVyKGZ1bmN0aW9uKGQpIHsgcmV0dXJuICFkLmRpc2FibGVkIH0pKQorICAgICAgICAgICAgLmNhbGwoZGlzdFgpOworICAgICAgICBnLnNlbGVjdCgnLm52LWRpc3RyaWJ1dGlvblknKQorICAgICAgICAgICAgLmRhdHVtKGRhdGEuZmlsdGVyKGZ1bmN0aW9uKGQpIHsgcmV0dXJuICFkLmRpc2FibGVkIH0pKQorICAgICAgICAgICAgLmNhbGwoZGlzdFkpOworICAgICAgfQorCisKKworICAgICAgLy89PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKyAgICAgIC8vIEV2ZW50IEhhbmRsaW5nL0Rpc3BhdGNoaW5nIChpbiBjaGFydCdzIHNjb3BlKQorICAgICAgLy8tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0KKworICAgICAgY29udHJvbHMuZGlzcGF0Y2gub24oJ2xlZ2VuZENsaWNrJywgZnVuY3Rpb24oZCxpKSB7CisgICAgICAgIGQuZGlzYWJsZWQgPSAhZC5kaXNhYmxlZDsKKworICAgICAgICBmaXNoZXllID0gZC5kaXNhYmxlZCA/IDAgOiAyLjU7CisgICAgICAgIGcuc2VsZWN0KCcubnYtYmFja2dyb3VuZCcpIC5zdHlsZSgncG9pbnRlci1ldmVudHMnLCBkLmRpc2FibGVkID8gJ25vbmUnIDogJ2FsbCcpOworICAgICAgICBnLnNlbGVjdCgnLm52LXBvaW50LXBhdGhzJykuc3R5bGUoJ3BvaW50ZXItZXZlbnRzJywgZC5kaXNhYmxlZCA/ICdhbGwnIDogJ25vbmUnICk7CisKKyAgICAgICAgaWYgKGQuZGlzYWJsZWQpIHsKKyAgICAgICAgICB4LmRpc3RvcnRpb24oZmlzaGV5ZSkuZm9jdXMoMCk7CisgICAgICAgICAgeS5kaXN0b3J0aW9uKGZpc2hleWUpLmZvY3VzKDApOworCisgICAgICAgICAgZy5zZWxlY3QoJy5udi1zY2F0dGVyV3JhcCcpLmNhbGwoc2NhdHRlcik7CisgICAgICAgICAgZy5zZWxlY3QoJy5udi14Lm52LWF4aXMnKS5jYWxsKHhBeGlzKTsKKyAgICAgICAgICBnLnNlbGVjdCgnLm52LXkubnYtYXhpcycpLmNhbGwoeUF4aXMpOworICAgICAgICB9IGVsc2UgeworICAgICAgICAgIHBhdXNlRmlzaGV5ZSA9IGZhbHNlOworICAgICAgICB9CisKKyAgICAgICAgY2hhcnQudXBkYXRlKCk7CisgICAgICB9KTsKKworICAgICAgbGVnZW5kLmRpc3BhdGNoLm9uKCdzdGF0ZUNoYW5nZScsIGZ1bmN0aW9uKG5ld1N0YXRlKSB7CisgICAgICAgIHN0YXRlLmRpc2FibGVkID0gbmV3U3RhdGUuZGlzYWJsZWQ7CisgICAgICAgIGRpc3BhdGNoLnN0YXRlQ2hhbmdlKHN0YXRlKTsKKyAgICAgICAgY2hhcnQudXBkYXRlKCk7CisgICAgICB9KTsKKworICAgICAgc2NhdHRlci5kaXNwYXRjaC5vbignZWxlbWVudE1vdXNlb3Zlci50b29sdGlwJywgZnVuY3Rpb24oZSkgeworICAgICAgICBkMy5zZWxlY3QoJy5udi1jaGFydC0nICsgc2NhdHRlci5pZCgpICsgJyAubnYtc2VyaWVzLScgKyBlLnNlcmllc0luZGV4ICsgJyAubnYtZGlzdHgtJyArIGUucG9pbnRJbmRleCkKKyAgICAgICAgICAgIC5hdHRyKCd5MScsIGZ1bmN0aW9uKGQsaSkgeyByZXR1cm4gZS5wb3NbMV0gLSBhdmFpbGFibGVIZWlnaHQ7fSk7CisgICAgICAgIGQzLnNlbGVjdCgnLm52LWNoYXJ0LScgKyBzY2F0dGVyLmlkKCkgKyAnIC5udi1zZXJpZXMtJyArIGUuc2VyaWVzSW5kZXggKyAnIC5udi1kaXN0eS0nICsgZS5wb2ludEluZGV4KQorICAgICAgICAgICAgLmF0dHIoJ3gyJywgZS5wb3NbMF0gKyBkaXN0WC5zaXplKCkpOworCisgICAgICAgIGUucG9zID0gW2UucG9zWzBdICsgbWFyZ2luLmxlZnQsIGUucG9zWzFdICsgbWFyZ2luLnRvcF07CisgICAgICAgIGRpc3BhdGNoLnRvb2x0aXBTaG93KGUpOworICAgICAgfSk7CisKKyAgICAgIGRpc3BhdGNoLm9uKCd0b29sdGlwU2hvdycsIGZ1bmN0aW9uKGUpIHsKKyAgICAgICAgaWYgKHRvb2x0aXBzKSBzaG93VG9vbHRpcChlLCB0aGF0LnBhcmVudE5vZGUpOworICAgICAgfSk7CisKKyAgICAgIC8vIFVwZGF0ZSBjaGFydCBmcm9tIGEgc3RhdGUgb2JqZWN0IHBhc3NlZCB0byBldmVudCBoYW5kbGVyCisgICAgICBkaXNwYXRjaC5vbignY2hhbmdlU3RhdGUnLCBmdW5jdGlvbihlKSB7CisKKyAgICAgICAgaWYgKHR5cGVvZiBlLmRpc2FibGVkICE9PSAndW5kZWZpbmVkJykgeworICAgICAgICAgIGRhdGEuZm9yRWFjaChmdW5jdGlvbihzZXJpZXMsaSkgeworICAgICAgICAgICAgc2VyaWVzLmRpc2FibGVkID0gZS5kaXNhYmxlZFtpXTsKKyAgICAgICAgICB9KTsKKworICAgICAgICAgIHN0YXRlLmRpc2FibGVkID0gZS5kaXNhYmxlZDsKKyAgICAgICAgfQorCisgICAgICAgIGNoYXJ0LnVwZGF0ZSgpOworICAgICAgfSk7CisKKyAgICAgIC8vPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisKKworICAgICAgLy9zdG9yZSBvbGQgc2NhbGVzIGZvciB1c2UgaW4gdHJhbnNpdGlvbnMgb24gdXBkYXRlCisgICAgICB4MCA9IHguY29weSgpOworICAgICAgeTAgPSB5LmNvcHkoKTsKKworCisgICAgfSk7CisKKyAgICByZXR1cm4gY2hhcnQ7CisgIH0KKworCisgIC8vPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisgIC8vIEV2ZW50IEhhbmRsaW5nL0Rpc3BhdGNoaW5nIChvdXQgb2YgY2hhcnQncyBzY29wZSkKKyAgLy8tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0KKworICBzY2F0dGVyLmRpc3BhdGNoLm9uKCdlbGVtZW50TW91c2VvdXQudG9vbHRpcCcsIGZ1bmN0aW9uKGUpIHsKKyAgICBkaXNwYXRjaC50b29sdGlwSGlkZShlKTsKKworICAgIGQzLnNlbGVjdCgnLm52LWNoYXJ0LScgKyBzY2F0dGVyLmlkKCkgKyAnIC5udi1zZXJpZXMtJyArIGUuc2VyaWVzSW5kZXggKyAnIC5udi1kaXN0eC0nICsgZS5wb2ludEluZGV4KQorICAgICAgICAuYXR0cigneTEnLCAwKTsKKyAgICBkMy5zZWxlY3QoJy5udi1jaGFydC0nICsgc2NhdHRlci5pZCgpICsgJyAubnYtc2VyaWVzLScgKyBlLnNlcmllc0luZGV4ICsgJyAubnYtZGlzdHktJyArIGUucG9pbnRJbmRleCkKKyAgICAgICAgLmF0dHIoJ3gyJywgZGlzdFkuc2l6ZSgpKTsKKyAgfSk7CisgIGRpc3BhdGNoLm9uKCd0b29sdGlwSGlkZScsIGZ1bmN0aW9uKCkgeworICAgIGlmICh0b29sdGlwcykgbnYudG9vbHRpcC5jbGVhbnVwKCk7CisgIH0pOworCisgIC8vPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09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CisgICAgaWYgKCFhcmd1bWVudHMubGVuZ3RoKSByZXR1cm4gc2hvd0Rpc3RYOworICAgIHNob3dEaXN0WCA9IF87CisgICAgcmV0dXJuIGNoYXJ0OworICB9OworCisgIGNoYXJ0LnNob3dEaXN0WSA9IGZ1bmN0aW9uKF8pIHsKKyAgICBpZiAoIWFyZ3VtZW50cy5sZW5ndGgpIHJldHVybiBzaG93RGlzdFk7CisgICAgc2hvd0Rpc3RZID0gXzsKKyAgICByZXR1cm4gY2hhcnQ7CisgIH07CisKKyAgY2hhcnQuc2hvd0NvbnRyb2xzID0gZnVuY3Rpb24oXykgeworICAgIGlmICghYXJndW1lbnRzLmxlbmd0aCkgcmV0dXJuIHNob3dDb250cm9sczsKKyAgICBzaG93Q29udHJvbHMgPSBfOworICAgIHJldHVybiBjaGFydDsKKyAgfTsKKworICBjaGFydC5zaG93TGVnZW5kID0gZnVuY3Rpb24oXykgeworICAgIGlmICghYXJndW1lbnRzLmxlbmd0aCkgcmV0dXJuIHNob3dMZWdlbmQ7CisgICAgc2hvd0xlZ2VuZCA9IF87CisgICAgcmV0dXJuIGNoYXJ0OworICB9OworCisgIGNoYXJ0LnNob3dYQXhpcyA9IGZ1bmN0aW9uKF8pIHsKKyAgICBpZiAoIWFyZ3VtZW50cy5sZW5ndGgpIHJldHVybiBzaG93WEF4aXM7CisgICAgc2hvd1hBeGlzID0gXzsKKyAgICByZXR1cm4gY2hhcnQ7CisgIH07CisKKyAgY2hhcnQuc2hvd1lBeGlzID0gZnVuY3Rpb24oXykgeworICAgIGlmICghYXJndW1lbnRzLmxlbmd0aCkgcmV0dXJuIHNob3dZQXhpczsKKyAgICBzaG93WUF4aXMgPSBfOworICAgIHJldHVybiBjaGFydDsKKyAgfTsKKworICBjaGFydC5yaWdodEFsaWduWUF4aXMgPSBmdW5jdGlvbihfKSB7CisgICAgaWYoIWFyZ3VtZW50cy5sZW5ndGgpIHJldHVybiByaWdodEFsaWduWUF4aXM7CisgICAgcmlnaHRBbGlnbllBeGlzID0gXzsKKyAgICB5QXhpcy5vcmllbnQoIChfKSA/ICdyaWdodCcgOiAnbGVmdCcpOworICAgIHJldHVybiBjaGFydDsKKyAgfTsKKworCisgIGNoYXJ0LmZpc2hleWUgPSBmdW5jdGlvbihfKSB7CisgICAgaWYgKCFhcmd1bWVudHMubGVuZ3RoKSByZXR1cm4gZmlzaGV5ZTsKKyAgICBmaXNoZXllID0gXzsKKyAgICByZXR1cm4gY2hhcnQ7CisgIH07CisKKyAgY2hhcnQueFBhZGRpbmcgPSBmdW5jdGlvbihfKSB7CisgICAgaWYgKCFhcmd1bWVudHMubGVuZ3RoKSByZXR1cm4geFBhZGRpbmc7CisgICAgeFBhZGRpbmcgPSBfOworICAgIHJldHVybiBjaGFydDsKKyAgfTsKKworICBjaGFydC55UGFkZGluZyA9IGZ1bmN0aW9uKF8pIHsKKyAgICBpZiAoIWFyZ3VtZW50cy5sZW5ndGgpIHJldHVybiB5UGFkZGluZzsKKyAgICB5UGFkZGluZyA9IF87CisgICAgcmV0dXJuIGNoYXJ0OworICB9OworCisgIGNoYXJ0LnRvb2x0aXBzID0gZnVuY3Rpb24oXykgeworICAgIGlmICghYXJndW1lbnRzLmxlbmd0aCkgcmV0dXJuIHRvb2x0aXBzOworICAgIHRvb2x0aXBzID0gXzsKKyAgICByZXR1cm4gY2hhcnQ7CisgIH07CisKKyAgY2hhcnQudG9vbHRpcENvbnRlbnQgPSBmdW5jdGlvbihfKSB7CisgICAgaWYgKCFhcmd1bWVudHMubGVuZ3RoKSByZXR1cm4gdG9vbHRpcDsKKyAgICB0b29sdGlwID0gXzsKKyAgICByZXR1cm4gY2hhcnQ7CisgIH07CisKKyAgY2hhcnQudG9vbHRpcFhDb250ZW50ID0gZnVuY3Rpb24oXykgeworICAgIGlmICghYXJndW1lbnRzLmxlbmd0aCkgcmV0dXJuIHRvb2x0aXBYOworICAgIHRvb2x0aXBYID0gXzsKKyAgICByZXR1cm4gY2hhcnQ7CisgIH07CisKKyAgY2hhcnQudG9vbHRpcFlDb250ZW50ID0gZnVuY3Rpb24oXykgeworICAgIGlmICghYXJndW1lbnRzLmxlbmd0aCkgcmV0dXJuIHRvb2x0aXBZOworICAgIHRvb2x0aXBZID0gXzsKKyAgICByZXR1cm4gY2hhcnQ7CisgIH07CisKKyAgY2hhcnQuc3RhdGUgPSBmdW5jdGlvbihfKSB7CisgICAgaWYgKCFhcmd1bWVudHMubGVuZ3RoKSByZXR1cm4gc3RhdGU7CisgICAgc3RhdGUgPSBfOworICAgIHJldHVybiBjaGFydDsKKyAgfTsKKworICBjaGFydC5kZWZhdWx0U3RhdGUgPSBmdW5jdGlvbihfKSB7CisgICAgaWYgKCFhcmd1bWVudHMubGVuZ3RoKSByZXR1cm4gZGVmYXVsdFN0YXRlOworICAgIGRlZmF1bHRTdGF0ZSA9IF87CisgICAgcmV0dXJuIGNoYXJ0OworICB9OworICAKKyAgY2hhcnQubm9EYXRhID0gZnVuY3Rpb24oXykgeworICAgIGlmICghYXJndW1lbnRzLmxlbmd0aCkgcmV0dXJuIG5vRGF0YTsKKyAgICBub0RhdGEgPSBfOworICAgIHJldHVybiBjaGFydDsKKyAgfTsKKworICBjaGFydC50cmFuc2l0aW9uRHVyYXRpb24gPSBmdW5jdGlvbihfKSB7CisgICAgaWYgKCFhcmd1bWVudHMubGVuZ3RoKSByZXR1cm4gdHJhbnNpdGlvbkR1cmF0aW9uOworICAgIHRyYW5zaXRpb25EdXJhdGlvbiA9IF87CisgICAgcmV0dXJuIGNoYXJ0OworICB9OworCisgIC8vPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisKKworICByZXR1cm4gY2hhcnQ7Cit9CmRpZmYgLS1naXQgYS9lY29tcC1wb3J0YWwtQkUvd2FyL3N0YXRpYy9mdXNpb24vZDMvanMvbW9kZWxzL3NjYXR0ZXJQbHVzTGluZUNoYXJ0LmpzIGIvZWNvbXAtcG9ydGFsLUJFL3dhci9zdGF0aWMvZnVzaW9uL2QzL2pzL21vZGVscy9zY2F0dGVyUGx1c0xpbmVDaGFydC5qcwpuZXcgZmlsZSBtb2RlIDEwMDY0NAppbmRleCAwMDAwMDAwLi4yM2M4Nzg1Ci0tLSAvZGV2L251bGwKKysrIGIvZWNvbXAtcG9ydGFsLUJFL3dhci9zdGF0aWMvZnVzaW9uL2QzL2pzL21vZGVscy9zY2F0dGVyUGx1c0xpbmVDaGFydC5qcwpAQCAtMCwwICsxLDYyMCBAQAorCitudi5tb2RlbHMuc2NhdHRlclBsdXNMaW5lQ2hhcnQgPSBmdW5jdGlvbigpIHsKKyAgInVzZSBzdHJpY3QiOworICAvLz09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorICAvLyBQdWJsaWMgVmFyaWFibGVzIHdpdGggRGVmYXVsdCBTZXR0aW5ncworICAvLy0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLQorCisgIHZhciBzY2F0dGVyICAgICAgPSBudi5tb2RlbHMuc2NhdHRlcigpCisgICAgLCB4QXhpcyAgICAgICAgPSBudi5tb2RlbHMuYXhpcygpCisgICAgLCB5QXhpcyAgICAgICAgPSBudi5tb2RlbHMuYXhpcygpCisgICAgLCBsZWdlbmQgICAgICAgPSBudi5tb2RlbHMubGVnZW5kKCkKKyAgICAsIGNvbnRyb2xzICAgICA9IG52Lm1vZGVscy5sZWdlbmQoKQorICAgICwgZGlzdFggICAgICAgID0gbnYubW9kZWxzLmRpc3RyaWJ1dGlvbigpCisgICAgLCBkaXN0WSAgICAgICAgPSBudi5tb2RlbHMuZGlzdHJpYnV0aW9uKCkKKyAgICA7CisKKyAgdmFyIG1hcmdpbiAgICAgICA9IHt0b3A6IDMwLCByaWdodDogMjAsIGJvdHRvbTogNTAsIGxlZnQ6IDc1fQorICAgICwgd2lkdGggICAgICAgID0gbnVsbAorICAgICwgaGVpZ2h0ICAgICAgID0gbnVsbAorICAgICwgY29sb3IgICAgICAgID0gbnYudXRpbHMuZGVmYXVsdENvbG9yKCkKKyAgICAsIHggICAgICAgICAgICA9IGQzLmZpc2hleWUgPyBkMy5maXNoZXllLnNjYWxlKGQzLnNjYWxlLmxpbmVhcikuZGlzdG9ydGlvbigwKSA6IHNjYXR0ZXIueFNjYWxlKCkKKyAgICAsIHkgICAgICAgICAgICA9IGQzLmZpc2hleWUgPyBkMy5maXNoZXllLnNjYWxlKGQzLnNjYWxlLmxpbmVhcikuZGlzdG9ydGlvbigwKSA6IHNjYXR0ZXIueVNjYWxlKCkKKyAgICAsIHNob3dEaXN0WCAgICA9IGZhbHNlCisgICAgLCBzaG93RGlzdFkgICAgPSBmYWxzZQorICAgICwgc2hvd0xlZ2VuZCAgID0gdHJ1ZQorICAgICwgc2hvd1hBeGlzICAgID0gdHJ1ZQorICAgICwgc2hvd1lBeGlzICAgID0gdHJ1ZQorICAgICwgcmlnaHRBbGlnbllBeGlzID0gZmFsc2UKKyAgICAsIHNob3dDb250cm9scyA9ICEhZDMuZmlzaGV5ZQorICAgICwgZmlzaGV5ZSAgICAgID0gMAorICAgICwgcGF1c2VGaXNoZXllID0gZmFsc2UKKyAgICAsIHRvb2x0aXBzICAgICA9IHRydWUKKyAgICAsIHRvb2x0aXBYICAgICA9IGZ1bmN0aW9uKGtleSwgeCwgeSkgeyByZXR1cm4gJzxzdHJvbmc+JyArIHggKyAnPC9zdHJvbmc+JyB9CisgICAgLCB0b29sdGlwWSAgICAgPSBmdW5jdGlvbihrZXksIHgsIHkpIHsgcmV0dXJuICc8c3Ryb25nPicgKyB5ICsgJzwvc3Ryb25nPicgfQorICAgICwgdG9vbHRpcCAgICAgID0gZnVuY3Rpb24oa2V5LCB4LCB5LCBkYXRlKSB7IHJldHVybiAnPGgzPicgKyBrZXkgKyAnPC9oMz4nIAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKyAnPHA+JyArIGRhdGUgKyAnPC9wPicgfQorICAgICwgc3RhdGUgPSB7fQorICAgICwgZGVmYXVsdFN0YXRlID0gbnVsbAorICAgICwgZGlzcGF0Y2ggPSBkMy5kaXNwYXRjaCgndG9vbHRpcFNob3cnLCAndG9vbHRpcEhpZGUnLCAnc3RhdGVDaGFuZ2UnLCAnY2hhbmdlU3RhdGUnKQorICAgICwgbm9EYXRhICAgICAgID0gIk5vIERhdGEgQXZhaWxhYmxlLiIKKyAgICAsIHRyYW5zaXRpb25EdXJhdGlvbiA9IDI1MAorICAgIDsKKworICBzY2F0dGVyCisgICAgLnhTY2FsZSh4KQorICAgIC55U2NhbGUoeSkKKyAgICA7CisgIHhBeGlzCisgICAgLm9yaWVudCgnYm90dG9tJykKKyAgICAudGlja1BhZGRpbmcoMTApCisgICAgOworICB5QXhpcworICAgIC5vcmllbnQoKHJpZ2h0QWxpZ25ZQXhpcykgPyAncmlnaHQnIDogJ2xlZnQnKQorICAgIC50aWNrUGFkZGluZygxMCkKKyAgICA7CisgIGRpc3RYCisgICAgLmF4aXMoJ3gnKQorICAgIDsKKyAgZGlzdFkKKyAgICAuYXhpcygneScpCisgICAgOworICAKKyAgY29udHJvbHMudXBkYXRlU3RhdGUoZmFsc2UpOworICAvLz09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorCisKKyAgLy89PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKyAgLy8gUHJpdmF0ZSBWYXJpYWJsZXMKKyAgLy8tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0KKworICB2YXIgeDAsIHkwOworCisgIHZhciBzaG93VG9vbHRpcCA9IGZ1bmN0aW9uKGUsIG9mZnNldEVsZW1lbnQpIHsKKyAgICAvL1RPRE86IG1ha2UgdG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AgICAgICBudi50b29sdGlwLnNob3coW2xlZnRZLCB0b3BZXSwgdG9vbHRpcFkoZS5zZXJpZXMua2V5LCB4VmFsLCB5VmFsLCBlLCBjaGFydCksICdlJywgMSwgb2Zmc2V0RWxlbWVudCwgJ3ktbnZ0b29sdGlwJyk7CisgICAgICBpZiggdG9vbHRpcCAhPSBudWxsICkKKyAgICAgICAgICBudi50b29sdGlwLnNob3coW2xlZnQsIHRvcF0sIHRvb2x0aXAoZS5zZXJpZXMua2V5LCB4VmFsLCB5VmFsLCBlLnBvaW50LnRvb2x0aXAsIGUsIGNoYXJ0KSwgZS52YWx1ZSA8IDAgPyAnbicgOiAncycsIG51bGwsIG9mZnNldEVsZW1lbnQpOworICB9OworCisgIHZhciBjb250cm9sc0RhdGEgPSBbCisgICAgeyBrZXk6ICdNYWduaWZ5JywgZGlzYWJsZWQ6IHRydWUgfQorICBdOworCisgIC8vPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisKKworICBmdW5jdGlvbiBjaGFydChzZWxlY3Rpb24pIHsKKyAgICBzZWxlY3Rpb24uZWFjaChmdW5jdGlvbihkYXRhKSB7CisgICAgICB2YXIgY29udGFpbmVyID0gZDMuc2VsZWN0KHRoaXMpLAorICAgICAgICAgIHRoYXQgPSB0aGlzOworCisgICAgICB2YXIgYXZhaWxhYmxlV2lkdGggPSAod2lkdGggIHx8IHBhcnNlSW50KGNvbnRhaW5lci5zdHlsZSgnd2lkdGgnKSkgfHwgOTYwKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAtIG1hcmdpbi5sZWZ0IC0gbWFyZ2luLnJpZ2h0LAorICAgICAgICAgIGF2YWlsYWJsZUhlaWdodCA9IChoZWlnaHQgfHwgcGFyc2VJbnQoY29udGFpbmVyLnN0eWxlKCdoZWlnaHQnKSkgfHwgNDAwKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAtIG1hcmdpbi50b3AgLSBtYXJnaW4u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mRXcmFwJyk7CisgICAgICBnRW50ZXIuYXBwZW5kKCdnJykuYXR0cignY2xhc3MnLCAnbnYtY29udHJvbHNXcmFwJyk7CisKKyAgICAgIHdyYXAuYXR0cigndHJhbnNmb3JtJywgJ3RyYW5zbGF0ZSgnICsgbWFyZ2luLmxlZnQgKyAnLCcgKyBtYXJnaW4udG9wICsgJyknKTsKKworICAgICAgaWYgKHJpZ2h0QWxpZ25ZQXhpcykgeworICAgICAgICAgIGcuc2VsZWN0KCIubnYteS5udi1heGlzIikKKyAgICAgICAgICAgICAgLmF0dHIoInRyYW5zZm9ybSIsICJ0cmFuc2xhdGUoIiArIGF2YWlsYWJsZVdpZHRoICsgIiwwKSIpOworICAgICAgfQorCisgICAgICAvLy0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLQorCisKKyAgICAgIC8vLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tCisgICAgICAvLyBMZWdlbmQKKworICAgICAgaWYgKHNob3dMZWdlbmQpIHsKKyAgICAgICAgbGVnZW5kLndpZHRoKCBhdmFpbGFibGVXaWR0aCAvIDIgKTsKKworICAgICAgICB3cmFwLnNlbGVjdCgnLm52LWxlZ2VuZFdyYXAnKQorICAgICAgICAgICAgLmRhdHVtKGRhdGEpCisgICAgICAgICAgICAuY2FsbChsZWdlbmQpOworCisgICAgICAgIGlmICggbWFyZ2luLnRvcCAhPSBsZWdlbmQuaGVpZ2h0KCkpIHsKKyAgICAgICAgICBtYXJnaW4udG9wID0gbGVnZW5kLmhlaWdodCgpOworICAgICAgICAgIGF2YWlsYWJsZUhlaWdodCA9IChoZWlnaHQgfHwgcGFyc2VJbnQoY29udGFpbmVyLnN0eWxlKCdoZWlnaHQnKSkgfHwgNDAwKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAtIG1hcmd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cmVnTGluZScpCisgICAgICAgICAgICAgICAgICAgICAgIC5zdHlsZSgnc3Ryb2tlLW9wYWNpdHknLCAwKTsKKworICAgICAgcmVnTGluZQorICAgICAgICAgIC50cmFuc2l0aW9uKCkKKyAgICAgICAgICAuYXR0cigneDEnLCB4LnJhbmdlKClbMF0pCisgICAgICAgICAgLmF0dHIoJ3gyJywgeC5yYW5nZSgpWzFdKQorICAgICAgICAgIC5hdHRyKCd5MScsIGZ1bmN0aW9uKGQsaSkge3JldHVybiB5KHguZG9tYWluKClbMF0gKiBkLnNsb3BlICsgZC5pbnRlcmNlcHQpIH0pCisgICAgICAgICAgLmF0dHIoJ3kyJywgZnVuY3Rpb24oZCxpKSB7IHJldHVybiB5KHguZG9tYWluKClbMV0gKiBkLnNsb3BlICsgZC5pbnRlcmNlcHQpIH0pCisgICAgICAgICAgLnN0eWxlKCdzdHJva2UnLCBmdW5jdGlvbihkLGksaikgeyByZXR1cm4gY29sb3IoZCxqKSB9KQorICAgICAgICAgIC5zdHlsZSgnc3Ryb2tlLW9wYWNpdHknLCBmdW5jdGlvbihkLGkpIHsKKyAgICAgICAgICAgIHJldHVybiAoZC5kaXNhYmxlZCB8fCB0eXBlb2YgZC5zbG9wZSA9PT0gJ3VuZGVmaW5lZCcgfHwgdHlwZW9mIGQuaW50ZXJjZXB0ID09PSAndW5kZWZpbmVkJykgPyAwIDogMSAKKyAgICAgICAgICB9KTsKKworICAgICAgLy8tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0KKworCisgICAgICAvLy0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLQorICAgICAgLy8gU2V0dXAgQXhlcworCisgICAgICBpZiAoc2hvd1hBeGlzKSB7CisgICAgICAgIHhBeGlzCisgICAgICAgICAgICAuc2NhbGUoeCkKKyAgICAgICAgICAgIC50aWNrcyggeEF4aXMudGlja3MoKSA/IHhBeGlzLnRpY2tzKCkgOiBhdmFpbGFibGVXaWR0aCAvIDEwMCApCisgICAgICAgICAgICAudGlja1NpemUoIC1hdmFpbGFibGVIZWlnaHQgLCAwKTsKKworICAgICAgICBnLnNlbGVjdCgnLm52LXgubnYtYXhpcycpCisgICAgICAgICAgICAuYXR0cigndHJhbnNmb3JtJywgJ3RyYW5zbGF0ZSgwLCcgKyB5LnJhbmdlKClbMF0gKyAnKScpCisgICAgICAgICAgICAuY2FsbCh4QXhpcyk7CisgICAgICB9CisKKyAgICAgIGlmIChzaG93WUF4aXMpIHsKKyAgICAgICAgeUF4aXMKKyAgICAgICAgICAgIC5zY2FsZSh5KQorICAgICAgICAgICAgLnRpY2tzKCB5QXhpcy50aWNrcygpID8geUF4aXMudGlja3MoKSA6IGF2YWlsYWJsZUhlaWdodCAvIDM2ICkKKyAgICAgICAgICAgIC50aWNrU2l6ZSggLWF2YWlsYWJsZVdpZHRoLCAwKTsKKworICAgICAgICBnLnNlbGVjdCgnLm52LXkubnYtYXhpcycpCisgICAgICAgICAgICAuY2FsbCh5QXhpcyk7CisgICAgICB9CisKKworICAgICAgaWYgKHNob3dEaXN0WCkgeworICAgICAgICBkaXN0WAorICAgICAgICAgICAgLmdldERhdGEoc2NhdHRlci54KCkpCisgICAgICAgICAgICAuc2NhbGUoeCkKKyAgICAgICAgICAgIC53aWR0aChhdmFpbGFibGVXaWR0aCkKKyAgICAgICAgICAgIC5jb2xvcihkYXRhLm1hcChmdW5jdGlvbihkLGkpIHsKKyAgICAgICAgICAgICAgcmV0dXJuIGQuY29sb3IgfHwgY29sb3IoZCwgaSk7CisgICAgICAgICAgICB9KS5maWx0ZXIoZnVuY3Rpb24oZCxpKSB7IHJldHVybiAhZGF0YVtpXS5kaXNhYmxlZCB9KSk7CisgICAgICAgIGdFbnRlci5zZWxlY3QoJy5udi1kaXN0V3JhcCcpLmFwcGVuZCgnZycpCisgICAgICAgICAgICAuYXR0cignY2xhc3MnLCAnbnYtZGlzdHJpYnV0aW9uWCcpOworICAgICAgICBnLnNlbGVjdCgnLm52LWRpc3RyaWJ1dGlvblgnKQorICAgICAgICAgICAgLmF0dHIoJ3RyYW5zZm9ybScsICd0cmFuc2xhdGUoMCwnICsgeS5yYW5nZSgpWzBdICsgJyknKQorICAgICAgICAgICAgLmRhdHVtKGRhdGEuZmlsdGVyKGZ1bmN0aW9uKGQpIHsgcmV0dXJuICFkLmRpc2FibGVkIH0pKQorICAgICAgICAgICAgLmNhbGwoZGlzdFgpOworICAgICAgfQorCisgICAgICBpZiAoc2hvd0Rpc3RZKSB7CisgICAgICAgIGRpc3RZCisgICAgICAgICAgICAuZ2V0RGF0YShzY2F0dGVyLnkoKSkKKyAgICAgICAgICAgIC5zY2FsZSh5KQorICAgICAgICAgICAgLndpZHRoKGF2YWlsYWJsZUhlaWdodCkKKyAgICAgICAgICAgIC5jb2xvcihkYXRhLm1hcChmdW5jdGlvbihkLGkpIHsKKyAgICAgICAgICAgICAgcmV0dXJuIGQuY29sb3IgfHwgY29sb3IoZCwgaSk7CisgICAgICAgICAgICB9KS5maWx0ZXIoZnVuY3Rpb24oZCxpKSB7IHJldHVybiAhZGF0YVtpXS5kaXNhYmxlZCB9KSk7CisgICAgICAgIGdFbnRlci5zZWxlY3QoJy5udi1kaXN0V3JhcCcpLmFwcGVuZCgnZycpCisgICAgICAgICAgICAuYXR0cignY2xhc3MnLCAnbnYtZGlzdHJpYnV0aW9uWScpOworICAgICAgICBnLnNlbGVjdCgnLm52LWRpc3RyaWJ1dGlvblknKQorICAgICAgICAgICAgLmF0dHIoJ3RyYW5zZm9ybScsICd0cmFuc2xhdGUoJyArIChyaWdodEFsaWduWUF4aXMgPyBhdmFpbGFibGVXaWR0aCA6IC1kaXN0WS5zaXplKCkgKSArICcsMCknKQorICAgICAgICAgICAgLmRhdHVtKGRhdGEuZmlsdGVyKGZ1bmN0aW9uKGQpIHsgcmV0dXJuICFkLmRpc2FibGVkIH0pKQorICAgICAgICAgICAgLmNhbGwoZGlzdFkpOworICAgICAgfQorCisgICAgICAvLy0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLQorCisKKworCisgICAgICBpZiAoZDMuZmlzaGV5ZSkgeworICAgICAgICBnLnNlbGVjdCgnLm52LWJhY2tncm91bmQnKQorICAgICAgICAgICAgLmF0dHIoJ3dpZHRoJywgYXZhaWxhYmxlV2lkdGgpCisgICAgICAgICAgICAuYXR0cignaGVpZ2h0JywgYXZhaWxhYmxlSGVpZ2h0KQorICAgICAgICAgICAgOworCisgICAgICAgIGcuc2VsZWN0KCcubnYtYmFja2dyb3VuZCcpLm9uKCdtb3VzZW1vdmUnLCB1cGRhdGVGaXNoZXllKTsKKyAgICAgICAgZy5zZWxlY3QoJy5udi1iYWNrZ3JvdW5kJykub24oJ2NsaWNrJywgZnVuY3Rpb24oKSB7IHBhdXNlRmlzaGV5ZSA9ICFwYXVzZUZpc2hleWU7fSk7CisgICAgICAgIHNjYXR0ZXIuZGlzcGF0Y2gub24oJ2VsZW1lbnRDbGljay5mcmVlemVGaXNoZXllJywgZnVuY3Rpb24oKSB7CisgICAgICAgICAgcGF1c2VGaXNoZXllID0gIXBhdXNlRmlzaGV5ZTsKKyAgICAgICAgfSk7CisgICAgICB9CisKKworICAgICAgZnVuY3Rpb24gdXBkYXRlRmlzaGV5ZSgpIHsKKyAgICAgICAgaWYgKHBhdXNlRmlzaGV5ZSkgeworICAgICAgICAgIGcuc2VsZWN0KCcubnYtcG9pbnQtcGF0aHMnKS5zdHlsZSgncG9pbnRlci1ldmVudHMnLCAnYWxsJyk7CisgICAgICAgICAgcmV0dXJuIGZhbHNlOworICAgICAgICB9CisKKyAgICAgICAgZy5zZWxlY3QoJy5udi1wb2ludC1wYXRocycpLnN0eWxlKCdwb2ludGVyLWV2ZW50cycsICdub25lJyApOworCisgICAgICAgIHZhciBtb3VzZSA9IGQzLm1vdXNlKHRoaXMpOworICAgICAgICB4LmRpc3RvcnRpb24oZmlzaGV5ZSkuZm9jdXMobW91c2VbMF0pOworICAgICAgICB5LmRpc3RvcnRpb24oZmlzaGV5ZSkuZm9jdXMobW91c2VbMV0pOworCisgICAgICAgIGcuc2VsZWN0KCcubnYtc2NhdHRlcldyYXAnKQorICAgICAgICAgICAgLmRhdHVtKGRhdGEuZmlsdGVyKGZ1bmN0aW9uKGQpIHsgcmV0dXJuICFkLmRpc2FibGVkIH0pKQorICAgICAgICAgICAgLmNhbGwoc2NhdHRlcik7CisKKyAgICAgICAgaWYgKHNob3dYQXhpcykKKyAgICAgICAgICBnLnNlbGVjdCgnLm52LXgubnYtYXhpcycpLmNhbGwoeEF4aXMpOworCisgICAgICAgIGlmIChzaG93WUF4aXMpCisgICAgICAgICAgZy5zZWxlY3QoJy5udi15Lm52LWF4aXMnKS5jYWxsKHlBeGlzKTsKKyAgICAgICAgCisgICAgICAgIGcuc2VsZWN0KCcubnYtZGlzdHJpYnV0aW9uWCcpCisgICAgICAgICAgICAuZGF0dW0oZGF0YS5maWx0ZXIoZnVuY3Rpb24oZCkgeyByZXR1cm4gIWQuZGlzYWJsZWQgfSkpCisgICAgICAgICAgICAuY2FsbChkaXN0WCk7CisgICAgICAgIGcuc2VsZWN0KCcubnYtZGlzdHJpYnV0aW9uWScpCisgICAgICAgICAgICAuZGF0dW0oZGF0YS5maWx0ZXIoZnVuY3Rpb24oZCkgeyByZXR1cm4gIWQuZGlzYWJsZWQgfSkpCisgICAgICAgICAgICAuY2FsbChkaXN0WSk7CisgICAgICB9CisKKworCisgICAgICAvLz09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorICAgICAgLy8gRXZlbnQgSGFuZGxpbmcvRGlzcGF0Y2hpbmcgKGluIGNoYXJ0J3Mgc2NvcGUpCisgICAgICAvLy0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLQorCisgICAgICBjb250cm9scy5kaXNwYXRjaC5vbignbGVnZW5kQ2xpY2snLCBmdW5jdGlvbihkLGkpIHsKKyAgICAgICAgZC5kaXNhYmxlZCA9ICFkLmRpc2FibGVkOworCisgICAgICAgIGZpc2hleWUgPSBkLmRpc2FibGVkID8gMCA6IDIuNTsKKyAgICAgICAgZy5zZWxlY3QoJy5udi1iYWNrZ3JvdW5kJykgLnN0eWxlKCdwb2ludGVyLWV2ZW50cycsIGQuZGlzYWJsZWQgPyAnbm9uZScgOiAnYWxsJyk7CisgICAgICAgIGcuc2VsZWN0KCcubnYtcG9pbnQtcGF0aHMnKS5zdHlsZSgncG9pbnRlci1ldmVudHMnLCBkLmRpc2FibGVkID8gJ2FsbCcgOiAnbm9uZScgKTsKKworICAgICAgICBpZiAoZC5kaXNhYmxlZCkgeworICAgICAgICAgIHguZGlzdG9ydGlvbihmaXNoZXllKS5mb2N1cygwKTsKKyAgICAgICAgICB5LmRpc3RvcnRpb24oZmlzaGV5ZSkuZm9jdXMoMCk7CisKKyAgICAgICAgICBnLnNlbGVjdCgnLm52LXNjYXR0ZXJXcmFwJykuY2FsbChzY2F0dGVyKTsKKyAgICAgICAgICBnLnNlbGVjdCgnLm52LXgubnYtYXhpcycpLmNhbGwoeEF4aXMpOworICAgICAgICAgIGcuc2VsZWN0KCcubnYteS5udi1heGlzJykuY2FsbCh5QXhpcyk7CisgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgcGF1c2VGaXNoZXllID0gZmFsc2U7CisgICAgICAgIH0KKworICAgICAgICBjaGFydC51cGRhdGUoKTsKKyAgICAgIH0pOworCisgICAgICBsZWdlbmQuZGlzcGF0Y2gub24oJ3N0YXRlQ2hhbmdlJywgZnVuY3Rpb24obmV3U3RhdGUpIHsgCisgICAgICAgIHN0YXRlID0gbmV3U3RhdGU7CisgICAgICAgIGRpc3BhdGNoLnN0YXRlQ2hhbmdlKHN0YXRlKTsKKyAgICAgICAgY2hhcnQudXBkYXRlKCk7CisgICAgICB9KTsKKworCisgICAgICBzY2F0dGVyLmRpc3BhdGNoLm9uKCdlbGVtZW50TW91c2VvdmVyLnRvb2x0aXAnLCBmdW5jdGlvbihlKSB7CisgICAgICAgIGQzLnNlbGVjdCgnLm52LWNoYXJ0LScgKyBzY2F0dGVyLmlkKCkgKyAnIC5udi1zZXJpZXMtJyArIGUuc2VyaWVzSW5kZXggKyAnIC5udi1kaXN0eC0nICsgZS5wb2ludEluZGV4KQorICAgICAgICAgICAgLmF0dHIoJ3kxJywgZS5wb3NbMV0gLSBhdmFpbGFibGVIZWlnaHQpOworICAgICAgICBkMy5zZWxlY3QoJy5udi1jaGFydC0nICsgc2NhdHRlci5pZCgpICsgJyAubnYtc2VyaWVzLScgKyBlLnNlcmllc0luZGV4ICsgJyAubnYtZGlzdHktJyArIGUucG9pbnRJbmRleCkKKyAgICAgICAgICAgIC5hdHRyKCd4MicsIGUucG9zWzBdICsgZGlzdFguc2l6ZSgpKTsKKworICAgICAgICBlLnBvcyA9IFtlLnBvc1swXSArIG1hcmdpbi5sZWZ0LCBlLnBvc1sxXSArIG1hcmdpbi50b3BdOworICAgICAgICBkaXNwYXRjaC50b29sdGlwU2hvdyhlKTsKKyAgICAgIH0pOworCisgICAgICBkaXNwYXRjaC5vbigndG9vbHRpcFNob3cnLCBmdW5jdGlvbihlKSB7CisgICAgICAgIGlmICh0b29sdGlwcykgc2hvd1Rvb2x0aXAoZSwgdGhhdC5wYXJlbnROb2RlKTsKKyAgICAgIH0pOworCisgICAgICAvLyBVcGRhdGUgY2hhcnQgZnJvbSBhIHN0YXRlIG9iamVjdCBwYXNzZWQgdG8gZXZlbnQgaGFuZGxlcgorICAgICAgZGlzcGF0Y2gub24oJ2NoYW5nZVN0YXRlJywgZnVuY3Rpb24oZSkgeworCisgICAgICAgIGlmICh0eXBlb2YgZS5kaXNhYmxlZCAhPT0gJ3VuZGVmaW5lZCcpIHsKKyAgICAgICAgICBkYXRhLmZvckVhY2goZnVuY3Rpb24oc2VyaWVzLGkpIHsKKyAgICAgICAgICAgIHNlcmllcy5kaXNhYmxlZCA9IGUuZGlzYWJsZWRbaV07CisgICAgICAgICAgfSk7CisKKyAgICAgICAgICBzdGF0ZS5kaXNhYmxlZCA9IGUuZGlzYWJsZWQ7CisgICAgICAgIH0KKworICAgICAgICBjaGFydC51cGRhdGUoKTsKKyAgICAgIH0pOworCisgICAgICAvLz09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorCisKKyAgICAgIC8vc3RvcmUgb2xkIHNjYWxlcyBmb3IgdXNlIGluIHRyYW5zaXRpb25zIG9uIHVwZGF0ZQorICAgICAgeDAgPSB4LmNvcHkoKTsKKyAgICAgIHkwID0geS5jb3B5KCk7CisKKworICAgIH0pOworCisgICAgcmV0dXJuIGNoYXJ0OworICB9CisKKworICAvLz09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorICAvLyBFdmVudCBIYW5kbGluZy9EaXNwYXRjaGluZyAob3V0IG9mIGNoYXJ0J3Mgc2NvcGUpCisgIC8vLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tCisKKyAgc2NhdHRlci5kaXNwYXRjaC5vbignZWxlbWVudE1vdXNlb3V0LnRvb2x0aXAnLCBmdW5jdGlvbihlKSB7CisgICAgZGlzcGF0Y2gudG9vbHRpcEhpZGUoZSk7CisKKyAgICBkMy5zZWxlY3QoJy5udi1jaGFydC0nICsgc2NhdHRlci5pZCgpICsgJyAubnYtc2VyaWVzLScgKyBlLnNlcmllc0luZGV4ICsgJyAubnYtZGlzdHgtJyArIGUucG9pbnRJbmRleCkKKyAgICAgICAgLmF0dHIoJ3kxJywgMCk7CisgICAgZDMuc2VsZWN0KCcubnYtY2hhcnQtJyArIHNjYXR0ZXIuaWQoKSArICcgLm52LXNlcmllcy0nICsgZS5zZXJpZXNJbmRleCArICcgLm52LWRpc3R5LScgKyBlLnBvaW50SW5kZXgpCisgICAgICAgIC5hdHRyKCd4MicsIGRpc3RZLnNpemUoKSk7CisgIH0pOworICBkaXNwYXRjaC5vbigndG9vbHRpcEhpZGUnLCBmdW5jdGlvbigpIHsKKyAgICBpZiAodG9vbHRpcHMpIG52LnRvb2x0aXAuY2xlYW51cCgpOworICB9KTsKKworICAvLz09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorCisKKyAgLy89PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKyAgLy8gRXhwb3NlIFB1YmxpYyBWYXJpYWJsZXMKKyAgLy8tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0KKworICAvLyBleHBvc2UgY2hhcnQncyBzdWItY29tcG9uZW50cworICBjaGFydC5kaXNwYXRjaCA9IGRpc3BhdGNoOworICBjaGFydC5zY2F0dGVyID0gc2NhdHRlcjsKKyAgY2hhcnQubGVnZW5kID0gbGVnZW5kOworICBjaGFydC5jb250cm9scyA9IGNvbnRyb2xzOworICBjaGFydC54QXhpcyA9IHhBeGlzOworICBjaGFydC55QXhpcyA9IHlBeGlzOworICBjaGFydC5kaXN0WCA9IGRpc3RYOworICBjaGFydC5kaXN0WSA9IGRpc3RZOworCisgIGQzLnJlYmluZChjaGFydCwgc2NhdHRlciwgJ2lkJywgJ2ludGVyYWN0aXZlJywgJ3BvaW50QWN0aXZlJywgJ3gnLCAneScsICdzaGFwZScsICdzaXplJywgJ3hTY2FsZScsICd5U2NhbGUnLCAnelNjYWxlJywgJ3hEb21haW4nLCAneURvbWFpbicsICd4UmFuZ2UnLCAneVJhbmdlJywgJ3NpemVEb21haW4n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uY3Rpb24oXykgeworICAgIGlmICghYXJndW1lbnRzLmxlbmd0aCkgcmV0dXJuIGNvbG9yOworICAgIGNvbG9yID0gbnYudXRpbHMuZ2V0Q29sb3IoXyk7CisgICAgbGVnZW5kLmNvbG9yKGNvbG9yKTsKKyAgICBkaXN0WC5jb2xvcihjb2xvcik7CisgICAgZGlzdFkuY29sb3IoY29sb3IpOworICAgIHJldHVybiBjaGFydDsKKyAgfTsKKworICBjaGFydC5zaG93RGlzdFggPSBmdW5jdGlvbihfKSB7CisgICAgaWYgKCFhcmd1bWVudHMubGVuZ3RoKSByZXR1cm4gc2hvd0Rpc3RYOworICAgIHNob3dEaXN0WCA9IF87CisgICAgcmV0dXJuIGNoYXJ0OworICB9OworCisgIGNoYXJ0LnNob3dEaXN0WSA9IGZ1bmN0aW9uKF8pIHsKKyAgICBpZiAoIWFyZ3VtZW50cy5sZW5ndGgpIHJldHVybiBzaG93RGlzdFk7CisgICAgc2hvd0Rpc3RZID0gXzsKKyAgICByZXR1cm4gY2hhcnQ7CisgIH07CisKKyAgY2hhcnQuc2hvd0NvbnRyb2xzID0gZnVuY3Rpb24oXykgeworICAgIGlmICghYXJndW1lbnRzLmxlbmd0aCkgcmV0dXJuIHNob3dDb250cm9sczsKKyAgICBzaG93Q29udHJvbHMgPSBfOworICAgIHJldHVybiBjaGFydDsKKyAgfTsKKworICBjaGFydC5zaG93TGVnZW5kID0gZnVuY3Rpb24oXykgeworICAgIGlmICghYXJndW1lbnRzLmxlbmd0aCkgcmV0dXJuIHNob3dMZWdlbmQ7CisgICAgc2hvd0xlZ2VuZCA9IF87CisgICAgcmV0dXJuIGNoYXJ0OworICB9OworCisgIGNoYXJ0LnNob3dYQXhpcyA9IGZ1bmN0aW9uKF8pIHsKKyAgICBpZiAoIWFyZ3VtZW50cy5sZW5ndGgpIHJldHVybiBzaG93WEF4aXM7CisgICAgc2hvd1hBeGlzID0gXzsKKyAgICByZXR1cm4gY2hhcnQ7CisgIH07CisKKyAgY2hhcnQuc2hvd1lBeGlzID0gZnVuY3Rpb24oXykgeworICAgIGlmICghYXJndW1lbnRzLmxlbmd0aCkgcmV0dXJuIHNob3dZQXhpczsKKyAgICBzaG93WUF4aXMgPSBfOworICAgIHJldHVybiBjaGFydDsKKyAgfTsKKworICBjaGFydC5yaWdodEFsaWduWUF4aXMgPSBmdW5jdGlvbihfKSB7CisgICAgaWYoIWFyZ3VtZW50cy5sZW5ndGgpIHJldHVybiByaWdodEFsaWduWUF4aXM7CisgICAgcmlnaHRBbGlnbllBeGlzID0gXzsKKyAgICB5QXhpcy5vcmllbnQoIChfKSA/ICdyaWdodCcgOiAnbGVmdCcpOworICAgIHJldHVybiBjaGFydDsKKyAgfTsKKworICBjaGFydC5maXNoZXllID0gZnVuY3Rpb24oXykgeworICAgIGlmICghYXJndW1lbnRzLmxlbmd0aCkgcmV0dXJuIGZpc2hleWU7CisgICAgZmlzaGV5ZSA9IF87CisgICAgcmV0dXJuIGNoYXJ0OworICB9OworCisgIGNoYXJ0LnRvb2x0aXBzID0gZnVuY3Rpb24oXykgeworICAgIGlmICghYXJndW1lbnRzLmxlbmd0aCkgcmV0dXJuIHRvb2x0aXBzOworICAgIHRvb2x0aXBzID0gXzsKKyAgICByZXR1cm4gY2hhcnQ7CisgIH07CisKKyAgY2hhcnQudG9vbHRpcENvbnRlbnQgPSBmdW5jdGlvbihfKSB7CisgICAgaWYgKCFhcmd1bWVudHMubGVuZ3RoKSByZXR1cm4gdG9vbHRpcDsKKyAgICB0b29sdGlwID0gXzsKKyAgICByZXR1cm4gY2hhcnQ7CisgIH07CisKKyAgY2hhcnQudG9vbHRpcFhDb250ZW50ID0gZnVuY3Rpb24oXykgeworICAgIGlmICghYXJndW1lbnRzLmxlbmd0aCkgcmV0dXJuIHRvb2x0aXBYOworICAgIHRvb2x0aXBYID0gXzsKKyAgICByZXR1cm4gY2hhcnQ7CisgIH07CisKKyAgY2hhcnQudG9vbHRpcFlDb250ZW50ID0gZnVuY3Rpb24oXykgeworICAgIGlmICghYXJndW1lbnRzLmxlbmd0aCkgcmV0dXJuIHRvb2x0aXBZOworICAgIHRvb2x0aXBZID0gXzsKKyAgICByZXR1cm4gY2hhcnQ7CisgIH07CisKKyAgY2hhcnQuc3RhdGUgPSBmdW5jdGlvbihfKSB7CisgICAgaWYgKCFhcmd1bWVudHMubGVuZ3RoKSByZXR1cm4gc3RhdGU7CisgICAgc3RhdGUgPSBfOworICAgIHJldHVybiBjaGFydDsKKyAgfTsKKworICBjaGFydC5kZWZhdWx0U3RhdGUgPSBmdW5jdGlvbihfKSB7CisgICAgaWYgKCFhcmd1bWVudHMubGVuZ3RoKSByZXR1cm4gZGVmYXVsdFN0YXRlOworICAgIGRlZmF1bHRTdGF0ZSA9IF87CisgICAgcmV0dXJuIGNoYXJ0OworICB9OworCisgIGNoYXJ0Lm5vRGF0YSA9IGZ1bmN0aW9uKF8pIHsKKyAgICBpZiAoIWFyZ3VtZW50cy5sZW5ndGgpIHJldHVybiBub0RhdGE7CisgICAgbm9EYXRhID0gXzsKKyAgICByZXR1cm4gY2hhcnQ7CisgIH07CisKKyAgY2hhcnQudHJhbnNpdGlvbkR1cmF0aW9uID0gZnVuY3Rpb24oXykgeworICAgIGlmICghYXJndW1lbnRzLmxlbmd0aCkgcmV0dXJuIHRyYW5zaXRpb25EdXJhdGlvbjsKKyAgICB0cmFuc2l0aW9uRHVyYXRpb24gPSBfOworICAgIHJldHVybiBjaGFydDsKKyAgfTsKKworICAvLz09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorCisKKyAgcmV0dXJuIGNoYXJ0OworfQpkaWZmIC0tZ2l0IGEvZWNvbXAtcG9ydGFsLUJFL3dhci9zdGF0aWMvZnVzaW9uL2QzL2pzL21vZGVscy9zcGFya2xpbmUuanMgYi9lY29tcC1wb3J0YWwtQkUvd2FyL3N0YXRpYy9mdXNpb24vZDMvanMvbW9kZWxzL3NwYXJrbGluZS5qcwpuZXcg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gLmRhdGEoZnVuY3Rpb24oZGF0YSkgeworICAgICAgICAgICAgICB2YXIgeVZhbHVlcyA9IGRhdGEubWFwKGZ1bmN0aW9uKGQsIGkpIHsgcmV0dXJuIGdldFkoZCxpKTsgfSk7CisgICAgICAgICAgICAgIGZ1bmN0aW9uIHBvaW50SW5kZXgoaW5kZXgpIHsKKyAgICAgICAgICAgICAgICAgIGlmIChpbmRleCAhPSAtMSkgeworCSAgICAgICAgICAgICAgdmFyIHJlc3VsdCA9IGRhdGFbaW5kZXhdOworICAgICAgICAgICAgICAgICAgICAgIHJlc3VsdC5wb2ludEluZGV4ID0gaW5kZXg7CisgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHJlc3VsdDsKKyAgICAgICAgICAgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIG51bGw7CisgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgdmFyIG1heFBvaW50ID0gcG9pbnRJbmRleCh5VmFsdWVzLmxhc3RJbmRleE9mKHkuZG9tYWluKClbMV0pKSwKKyAgICAgICAgICAgICAgICAgIG1pblBvaW50ID0gcG9pbnRJbmRleCh5VmFsdWVzLmluZGV4T2YoeS5kb21haW4oKVswXSkpLAorICAgICAgICAgICAgICAgICAgY3VycmVudFBvaW50ID0gcG9pbnRJbmRleCh5VmFsdWVzLmxlbmd0aCAtIDEpOworICAgICAgICAgICAgICByZXR1cm4gW21pblBvaW50LCBtYXhQb2ludCwgY3VycmVudFBvaW50XS5maWx0ZXIoZnVuY3Rpb24gKGQpIHtyZXR1cm4gZCAhPSBudWxsO30pOworICAgICAgICAgIH0pOworICAgICAgcG9pbnRzLmVudGVyKCkuYXBwZW5kKCdjaXJjbGUnKTsKKyAgICAgIHBvaW50cy5leGl0KCkucmVtb3ZlKCk7CisgICAgICBwb2ludHMKKyAgICAgICAgICAuYXR0cignY3gnLCBmdW5jdGlvbihkLGkpIHsgcmV0dXJuIHgoZ2V0WChkLGQucG9pbnRJbmRleCkpIH0pCisgICAgICAgICAgLmF0dHIoJ2N5JywgZnVuY3Rpb24oZCxpKSB7IHJldHVybiB5KGdldFkoZCxkLnBvaW50SW5kZXgpKSB9KQorICAgICAgICAgIC5hdHRyKCdyJywgMikKKyAgICAgICAgICAuYXR0cignY2xhc3MnLCBmdW5jdGlvbihkLGkpIHsKKyAgICAgICAgICAgIHJldHVybiBnZXRYKGQsIGQucG9pbnRJbmRleCkgPT0geC5kb21haW4oKVsxXSA/ICdudi1wb2ludCBudi1jdXJyZW50VmFsdWUnIDoKKyAgICAgICAgICAgICAgICAgICBnZXRZKGQsIGQucG9pbnRJbmRleCkgPT0geS5kb21haW4oKVswXSA/ICdudi1wb2ludCBudi1taW5WYWx1ZScgOiAnbnYtcG9pbnQgbnYtbWF4VmFsdWUnCisgICAgICAgICAgfSk7CisgICAgfSk7CisKKyAgICByZXR1cm4gY2hhcnQ7CisgIH0KKworCisgIC8vPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisgIC8vIEV4cG9zZSBQdWJsaWMgVmFyaWFibGVzCisgIC8vLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tCisgIGNoYXJ0Lm9wdGlvbnMgPSBudi51dGlscy5vcHRpb25zRnVuYy5iaW5kKGNoYXJ0KTsKKyAgCisgIGNoYXJ0Lm1hcmdpbiA9IGZ1bmN0aW9uKF8pIHsKKyAgICBpZiAoIWFyZ3VtZW50cy5sZW5ndGgpIHJldHVybiBtYXJnaW47CisgICAgbWFyZ2luLnRvcCAgICA9IHR5cGVvZiBfLnRvcCAgICAhPSAndW5kZWZpbmVkJyA/IF8udG9wICAgIDogbWFyZ2luLnRvcDsKKyAgICBtYXJnaW4ucmlnaHQgID0gdHlwZW9mIF8ucmlnaHQgICE9ICd1bmRlZmluZWQnID8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YXJndW1lbnRzLmxlbmd0aCkgcmV0dXJuIHk7CisgICAgeSA9IF87CisgICAgcmV0dXJuIGNoYXJ0OworICB9OworCisgIGNoYXJ0LnhEb21haW4gPSBmdW5jdGlvbihfKSB7CisgICAgaWYgKCFhcmd1bWVudHMubGVuZ3RoKSByZXR1cm4geERvbWFpbjsKKyAgICB4RG9tYWluID0gXzsKKyAgICByZXR1cm4gY2hhcnQ7CisgIH07CisKKyAgY2hhcnQueURvbWFpbiA9IGZ1bmN0aW9uKF8pIHsKKyAgICBpZiAoIWFyZ3VtZW50cy5sZW5ndGgpIHJldHVybiB5RG9tYWluOworICAgIHlEb21haW4gPSBfOworICAgIHJldHVybiBjaGFydDsKKyAgfTsKKworICBjaGFydC54UmFuZ2UgPSBmdW5jdGlvbihfKSB7CisgICAgaWYgKCFhcmd1bWVudHMubGVuZ3RoKSByZXR1cm4geFJhbmdlOworICAgIHhSYW5nZSA9IF87CisgICAgcmV0dXJuIGNoYXJ0OworICB9OworCisgIGNoYXJ0LnlSYW5nZSA9IGZ1bmN0aW9uKF8pIHsKKyAgICBpZiAoIWFyZ3VtZW50cy5sZW5ndGgpIHJldHVybiB5UmFuZ2U7CisgICAgeVJhbmdlID0gXzsKKyAgICByZXR1cm4gY2hhcnQ7CisgIH07CisKKyAgY2hhcnQuYW5pbWF0ZSA9IGZ1bmN0aW9uKF8pIHsKKyAgICBpZiAoIWFyZ3VtZW50cy5sZW5ndGgpIHJldHVybiBhbmltYXRlOworICAgIGFuaW1hdGUgPSBfOworICAgIHJldHVybiBjaGFydDsKKyAgfTsKKworICBjaGFydC5jb2xvciA9IGZ1bmN0aW9uKF8pIHsKKyAgICBpZiAoIWFyZ3VtZW50cy5sZW5ndGgpIHJldHVybiBjb2xvcjsKKyAgICBjb2xvciA9IG52LnV0aWxzLmdldENvbG9yKF8pOworICAgIHJldHVybiBjaGFydDsKKyAgfTsKKworICAvLz09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09P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gnLC4yZicpCisgICAgLCBzaG93VmFsdWUgPSB0cnVlCisgICAgLCBhbGlnblZhbHVlID0gdHJ1ZQorICAgICwgcmlnaHRBbGlnblZhbHVlID0gZmFsc2UKKyAgICAsIG5vRGF0YSA9ICJObyBEYXRhIEF2YWlsYWJsZS4iCisgICAgOworCisgIC8vPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisKKworICBmdW5jdGlvbiBjaGFydChzZWxlY3Rpb24pIHsKKyAgICBzZWxlY3Rpb24uZWFjaChmdW5jdGlvbihkYXRhKSB7CisgICAgICB2YXIgY29udGFpbmVyID0gZDMuc2VsZWN0KHRoaXMpOworCisgICAgICB2YXIgYXZhaWxhYmxlV2lkdGggPSAod2lkdGggIHx8IHBhcnNlSW50KGNvbnRhaW5lci5zdHlsZSgnd2lkdGgnKSkgfHwgOTYwKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAtIG1hcmdpbi5sZWZ0IC0gbWFyZ2luLnJpZ2h0LAorICAgICAgICAgIGF2YWlsYWJsZUhlaWdodCA9IChoZWlnaHQgfHwgcGFyc2VJbnQoY29udGFpbmVyLnN0eWxlKCdoZWlnaHQnKSkgfHwgNDAwKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAtIG1hcmdpbi50b3AgLSBtYXJnaW4uYm90dG9tOworCisgICAgICAKKworICAgICAgY2hhcnQudXBkYXRlID0gZnVuY3Rpb24oKSB7IGNoYXJ0KHNlbGVjdGlvbikgfTsKKyAgICAgIGNoYXJ0LmNvbnRhaW5lciA9IHRoaXM7CisKKworICAgICAgLy8tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0KKyAgICAgIC8vIERpc3BsYXkgTm8gRGF0YSBtZXNzYWdlIGlmIHRoZXJlJ3Mgbm90aGluZyB0byBzaG93LgorCisgICAgICBpZiAoIWRhdGEgfHwgIWRhdGEubGVuZ3RoKSB7CisgICAgICAgIHZhciBub0RhdGFUZXh0ID0gY29udGFpbmVyLnNlbGVjdEFsbCgnLm52LW5vRGF0YScpLmRhdGEoW25vRGF0YV0pOworCisgICAgICAgIG5vRGF0YVRleHQuZW50ZXIoKS5hcHBlbmQoJ3RleHQnKQorICAgICAgICAgIC5hdHRyKCdjbGFzcycsICdudmQzIG52LW5vRGF0YScpCisgICAgICAgICAgLmF0dHIoJ2R5JywgJy0uN2VtJykKKyAgICAgICAgICAuc3R5bGUoJ3RleHQtYW5jaG9yJywgJ21pZGRsZScpOworCisgICAgICAgIG5vRGF0YVRleHQKKyAgICAgICAgICAuYXR0cigneCcsIG1hcmdpbi5sZWZ0ICsgYXZhaWxhYmxlV2lkdGggLyAyKQorICAgICAgICAgIC5hdHRyKCd5JywgbWFyZ2luLnRvcCArIGF2YWlsYWJsZUhlaWdodCAvIDIpCisgICAgICAgICAgLnRleHQoZnVuY3Rpb24oZCkgeyByZXR1cm4gZCB9KTsKKworICAgICAgICByZXR1cm4gY2hhcnQ7CisgICAgICB9IGVsc2UgeworICAgICAgICBjb250YWluZXIuc2VsZWN0QWxsKCcubnYtbm9EYXRhJykucmVtb3ZlKCk7CisgICAgICB9CisKKyAgICAgIHZhciBjdXJyZW50VmFsdWUgPSBzcGFya2xpbmUueSgpKGRhdGFbZGF0YS5sZW5ndGgtMV0sIGRhdGEubGVuZ3RoLTEpOworCisgICAgICAvLy0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLQorCisKKworICAgICAgLy8tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0KKyAgICAgIC8vIFNldHVwIFNjYWxlcworCisgICAgICB4ID0gc3BhcmtsaW5lLnhTY2FsZSgpOworICAgICAgeSA9IHNwYXJrbGluZS55U2NhbGUoKT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ydCksIG1heSBvciBtYXkgbm90IGtlZXAgaXQgdGhhdCB3YXkKKyAgICAgICAgaWYgKHBhdXNlZCkgcmV0dXJuOworCisgICAgICAgIHZhciBob3ZlclZhbHVlID0gZy5zZWxlY3RBbGwoJy5udi1ob3ZlclZhbHVlJykuZGF0YShpbmRleCkKKworICAgICAgICB2YXIgaG92ZXJFbnRlciA9IGhvdmVyVmFsdWUuZW50ZXIoKQorICAgICAgICAgIC5hcHBlbmQoJ2cnKS5hdHRyKCdjbGFzcycsICdudi1ob3ZlclZhbHVlJykKKyAgICAgICAgICAgIC5zdHlsZSgnc3Ryb2tlLW9wYWNpdHknLCAwKQorICAgICAgICAgICAgLnN0eWxlKCdmaWxsLW9wYWNpdHknLCAwKTsKKworICAgICAgICBob3ZlclZhbHVlLmV4aXQoKQorICAgICAgICAgIC50cmFuc2l0aW9uKCkuZHVyYXRpb24oMjUwKQorICAgICAgICAgICAgLnN0eWxlKCdzdHJva2Utb3BhY2l0eScsIDApCisgICAgICAgICAgICAuc3R5bGUoJ2ZpbGwtb3BhY2l0eScsIDApCisgICAgICAgICAgICAucmVtb3ZlKCk7CisKKyAgICAgICAgaG92ZXJWYWx1ZQorICAgICAgICAgICAgLmF0dHIoJ3RyYW5zZm9ybScsIGZ1bmN0aW9uKGQpIHsgcmV0dXJuICd0cmFuc2xhdGUoJyArIHgoc3BhcmtsaW5lLngoKShkYXRhW2RdLGQpKSArICcsMCknIH0pCisgICAgICAgICAgLnRyYW5zaXRpb24oKS5kdXJhdGlvbigyNTApCisgICAgICAgICAgICAuc3R5bGUoJ3N0cm9rZS1vcGFjaXR5JywgMSkKKyAgICAgICAgICAgIC5zdHlsZSgnZmlsbC1vcGFjaXR5JywgMSk7CisKKyAgICAgICAgaWYgKCFpbmRleC5sZW5ndGgpIHJldHVybjsKKworICAgICAgICBob3ZlckVudGVyLmFwcGVuZCgnbGluZScpCisgICAgICAgICAgICAuYXR0cigneDEnLCAwKQorICAgICAgICAgICAgLmF0dHIoJ3kxJywgLW1hcmdpbi50b3ApCisgICAgICAgICAgICAuYXR0cigneDInLCAwKQorICAgICAgICAgICAgLmF0dHIoJ3kyJywgYXZhaWxhYmxlSGVpZ2h0KTsKKworCisgICAgICAgIGhvdmVyRW50ZXIuYXBwZW5kKCd0ZXh0JykuYXR0cignY2xhc3MnLCAnbnYteFZhbHVlJykKKyAgICAgICAgICAgIC5hdHRyKCd4JywgLTYpCisgICAgICAgICAgICAuYXR0cigneScsIC1tYXJnaW4udG9wKQorICAgICAgICAgICAgLmF0dHIoJ3RleHQtYW5jaG9yJywgJ2VuZCcpCisgICAgICAgICAgICAuYXR0cignZHknLCAnLjllbScpCisKKworICAgICAgICBnLnNlbGVjdCgnLm52LWhvdmVyVmFsdWUgLm52LXhWYWx1ZScpCisgICAgICAgICAgICAudGV4dCh4VGlja0Zvcm1hdChzcGFya2xpbmUueCgpKGRhdGFbaW5kZXhbMF1dLCBpbmRleFswXSkpKTsKKworICAgICAgICBob3ZlckVudGVyLmFwcGVuZCgndGV4dCcpLmF0dHIoJ2NsYXNzJywgJ252LXlWYWx1ZScpCisgICAgICAgICAgICAuYXR0cigneCcsIDYpCisgICAgICAgICAgICAuYXR0cigneScsIC1tYXJnaW4udG9wKQorICAgICAgICAgICAgLmF0dHIoJ3RleHQtYW5jaG9yJywgJ3N0YXJ0JykKKyAgICAgICAgICAgIC5hdHRyKCdkeScsICcuOWVtJykKKworICAgICAgICBnLnNlbGVjdCgnLm52LWhvdmVyVmFsdWUgLm52LXlWYWx1ZScpCisgICAgICAgICAgICAudGV4dCh5VGlja0Zvcm1hdChzcGFya2xpbmUueSgpKGRhdGFbaW5kZXhbMF1dLCBpbmRleFswXSkpKTsKKworICAgICAgfQorCisKKyAgICAgIGZ1bmN0aW9uIHNwYXJrbGluZUhvdmVyKCkgeworICAgICAgICBpZiAocGF1c2VkKSByZXR1cm47CisKKyAgICAgICAgdmFyIHBvcyA9IGQzLm1vdXNlKHRoaXMpWzBdIC0gbWFyZ2luLmxlZnQ7CisKKyAgICAgICAgZnVuY3Rpb24gZ2V0Q2xvc2VzdEluZGV4KGRhdGEsIHgpIHsKKyAgICAgICAgICB2YXIgZGlzdGFuY2UgPSBNYXRoLmFicyhzcGFya2xpbmUueCgpKGRhdGFbMF0sIDApIC0geCk7CisgICAgICAgICAgdmFyIGNsb3Nlc3RJbmRleCA9IDA7CisgICAgICAgICAgZm9yICh2YXIgaSA9IDA7IGkgPCBkYXRhLmxlbmd0aDsgaSsrKXsKKyAgICAgICAgICAgIGlmIChNYXRoLmFicyhzcGFya2xpbmUueCgpKGRhdGFbaV0sIGkpIC0geCkgPCBkaXN0YW5jZSkgeworICAgICAgICAgICAgICBkaXN0YW5jZSA9IE1hdGguYWJzKHNwYXJrbGluZS54KCkoZGF0YVtpXSwgaSkgLSB4KTsKKyAgICAgICAgICAgICAgY2xvc2VzdEluZGV4ID0gaTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICB9CisgICAgICAgICAgcmV0dXJuIGNsb3Nlc3RJbmRleDsKKyAgICAgICAgfQorCisgICAgICAgIGluZGV4ID0gW2dldENsb3Nlc3RJbmRleChkYXRhLCBNYXRoLnJvdW5kKHguaW52ZXJ0KHBvcykpKV07CisKKyAgICAgICAgdXBkYXRlVmFsdWVMaW5lKCk7CisgICAgICB9CisKKyAgICB9KTsKKworICAgIHJldHVybiBjaGFydDsKKyAgfQorCisKKyAgLy89PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKyAgLy8gRXhwb3NlIFB1YmxpYyBWYXJpYWJsZXMKKyAgLy8tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0KKworICAvLyBleHBvc2UgY2hhcnQncyBzdWItY29tcG9uZW50cworICBjaGFydC5zcGFya2xpbmUgPSBzcGFya2xpbmU7CisKKyAgZDMucmViaW5kKGNoYXJ0LCBzcGFya2x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UaWNrRm9ybWF0OworICAgIHhUaWNrRm9ybWF0ID0gXzsKKyAgICByZXR1cm4gY2hhcnQ7CisgIH07CisKKyAgY2hhcnQueVRpY2tGb3JtYXQgPSBmdW5jdGlvbihfKSB7CisgICAgaWYgKCFhcmd1bWVudHMubGVuZ3RoKSByZXR1cm4geVRpY2tGb3JtYXQ7CisgICAgeVRpY2tGb3JtYXQgPSBfOworICAgIHJldHVybiBjaGFydDsKKyAgfTsKKworICBjaGFydC5zaG93VmFsdWUgPSBmdW5jdGlvbihfKSB7CisgICAgaWYgKCFhcmd1bWVudHMubGVuZ3RoKSByZXR1cm4gc2hvd1ZhbHVlOworICAgIHNob3dWYWx1ZSA9IF87CisgICAgcmV0dXJuIGNoYXJ0OworICB9OworCisgIGNoYXJ0LmFsaWduVmFsdWUgPSBmdW5jdGlvbihfKSB7CisgICAgaWYgKCFhcmd1bWVudHMubGVuZ3RoKSByZXR1cm4gYWxpZ25WYWx1ZTsKKyAgICBhbGlnblZhbHVlID0gXzsKKyAgICByZXR1cm4gY2hhcnQ7CisgIH07CisKKyAgY2hhcnQucmlnaHRBbGlnblZhbHVlID0gZnVuY3Rpb24oXykgeworICAgIGlmICghYXJndW1lbnRzLmxlbmd0aCkgcmV0dXJuIHJpZ2h0QWxpZ25WYWx1ZTsKKyAgICByaWdodEFsaWduVmFsdWUgPSBfOworICAgIHJldHVybiBjaGFydDsKKyAgfTsKKworICBjaGFydC5ub0RhdGEgPSBmdW5jdGlvbihfKSB7CisgICAgaWYgKCFhcmd1bWVudHMubGVuZ3RoKSByZXR1cm4gbm9EYXRhOworICAgIG5vRGF0YSA9IF87CisgICAgcmV0dXJuIGNoYXJ0OworICB9OworCisgIC8vPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisKKworICByZXR1cm4gY2hhcnQ7Cit9CmRpZmYgLS1naXQgYS9lY29tcC1wb3J0YWwtQkUvd2FyL3N0YXRpYy9mdXNpb24v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MsIGkpIHsKKyAgICAgICAgYXNlcmllcy5zZXJpZXNJbmRleCA9IGk7CisgICAgICAgIGFzZXJpZXMudmFsdWVzID0gYXNlcmllcy52YWx1ZXMubWFwKGZ1bmN0aW9uKGQsIGopIHsKKyAgICAgICAgICBkLmluZGV4ID0gajsKKyAgICAgICAgICBkLnNlcmllc0luZGV4ID0gaTsKKyAgICAgICAgICByZXR1cm4gZDsKKyAgICAgICAgfSk7CisgICAgICB9KTsKKworICAgICAgdmFyIGRhdGFGaWx0ZXJlZCA9IGRhdGEuZmlsdGVyKGZ1bmN0aW9uKHNlcmllcykgeworICAgICAgICAgICAgcmV0dXJuICFzZXJpZXMuZGlzYWJsZWQ7CisgICAgICB9KTsKKworICAgICAgZGF0YSA9IGQzLmxheW91dC5zdGFjaygpCisgICAgICAgICAgICAgICAub3JkZXIob3JkZXIpCisgICAgICAgICAgICAgICAub2Zmc2V0KG9mZnNldCkKKyAgICAgICAgICAgICAgIC52YWx1ZXMoZnVuY3Rpb24oZCkgeyByZXR1cm4gZC52YWx1ZXMgfSkgIC8vVE9ETzogbWFrZSB2YWx1ZXMgY3VzdG9taXplYWJsZSBpbiBFVkVSWSBtb2RlbCBpbiB0aGlzIGZhc2hpb24KKyAgICAgICAgICAgICAgIC54KGdldFgpCisgICAgICAgICAgICAgICAueShnZXRZKQorICAgICAgICAgICAgICAgLm91dChmdW5jdGlvbihkLCB5MCwgeSkgeworICAgICAgICAgICAgICAgICAgICB2YXIgeUhlaWdodCA9IChnZXRZKGQpID09PSAwKSA/IDAgOiB5OworICAgICAgICAgICAgICAgICAgICBkLmRpc3BsYXkgPSB7CisgICAgICAgICAgICAgICAgICAgICAgeTogeUhlaWdodCwKKyAgICAgICAgICAgICAgICAgICAgIHkwOiB5MAorICAgICAgICAgICAgICAgICAgICB9OworICAgICAgICAgICAgICAgIH0pCisgICAgICAgICAgICAgIChkYXRhRmlsdGVyZWQpOworCisKKyAgICAgIC8vLS0tLS0tLS0tLS0tLS0tLS0tL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AgfSkKKyAgICAgICAgLmZvcmNlWShbMF0pCisgICAgICAgIC5jb2xvcihkYXRhLm1hcChmdW5jdGlvbihkLGkpIHsKKyAgICAgICAgICByZXR1cm4gZC5jb2xvciB8fCBjb2xvcihkLCBkLnNlcmllc0luZGV4KTsKKyAgICAgICAgfSkpOworCisKKyAgICAgIHZhciBzY2F0dGVyV3JhcCA9IGcuc2VsZWN0KCcubnYtc2NhdHRlcldyYXAnKQorICAgICAgICAgIC5kYXR1bShkYXRhKTsKKworICAgICAgc2NhdHRlcldyYXAuY2FsbChzY2F0dGVyKTsKKworICAgICAgZGVmc0VudGVyLmFwcGVuZCgnY2xpcFBhdGgnKQorICAgICAgICAgIC5hdHRyKCdpZCcsICdudi1lZGdlLWNsaXAtJyArIGlkKQorICAgICAgICAuYXBwZW5kKCdyZWN0Jyk7CisKKyAgICAgIHdyYXAuc2VsZWN0KCcjbnYtZWRnZS1jbGlwLScgKyBpZCArICcgcmVjdCcpCisgICAgICAgICAgLmF0dHIoJ3dpZHRoJywgYXZhaWxhYmxlV2lkdGgpCisgICAgICAgICAgLmF0dHIoJ2hlaWdodCcsIGF2YWlsYWJsZUhlaWdodCk7CisKKyAgICAgIGcgICAuYXR0cignY2xpcC1wYXRoJywgY2xpcEVkZ2UgPyAndXJsKCNudi1lZGdlLWNsaXAtJyArIGlkICsgJyknIDogJycpOworCisgICAgICB2YXIgYXJlYSA9IGQzLnN2Zy5hcmVhKCkKKyAgICAgICAgICAueChmdW5jdGlvbihkLGkpICB7IHJldHVybiB4KGdldFgoZCxpKSkgfSkKKyAgICAgICAgICAueTAoZnVuY3Rpb24oZCkgeworICAgICAgICAgICAgICByZXR1cm4geShkLmRpc3BsYXkueTApCisgICAgICAgICAgfSkKKyAgICAgICAgICAueTEoZnVuY3Rpb24oZCkgeworICAgICAgICAgICAgICByZXR1cm4geShkLmRpc3BsYXkueSArIGQuZGlzcGxheS55MCkKKyAgICAgICAgICB9KQorICAgICAgICAgIC5pbnRlcnBvbGF0ZShpbnRlcnBvbGF0ZSk7CisKKyAgICAgIHZhciB6ZXJvQXJlYSA9IGQzLnN2Zy5hcmVhKCkKKyAgICAgICAgICAueChmdW5jdGlvbihkLGkpICB7IHJldHVybiB4KGdldFgoZCxpKSkgfSkKKyAgICAgICAgICAueTAoZnVuY3Rpb24oZCkgeyByZXR1cm4geShkLmRpc3BsYXkueTApIH0pCisgICAgICAgICAgLnkxKGZ1bmN0aW9uKGQpIHsgcmV0dXJuIHkoZC5kaXNwbGF5LnkwKSB9KTsKKworCisgICAgICB2YXIgcGF0aCA9IGcuc2VsZWN0KCcubnYtYXJlYVdyYXAnKS5zZWxlY3RBbGwoJ3BhdGgubnYtYXJlYScpCisgICAgICAgICAgLmRhdGEoZnVuY3Rpb24oZCkgeyByZXR1cm4gZCB9KTsKKworICAgICAgcGF0aC5lbnRlcigpLmFwcGVuZCgncGF0aCcpLmF0dHIoJ2NsYXNzJywgZnVuY3Rpb24oZCxpKSB7IHJldHVybiAnbnYtYXJlYSBudi1hcmVhLScgKyBpIH0pCisgICAgICAgICAgLmF0dHIoJ2QnLCBmdW5jdGlvbihkLGkpeworICAgICAgICAgICAgcmV0dXJuIHplcm9BcmVhKGQudmFsdWVzLCBkLnNlcmllc0luZGV4KTsKKyAgICAgICAgICB9KQorICAgICAgICAgIC5vbignbW91c2VvdmVyJywgZnVuY3Rpb24oZCxpKSB7CisgICAgICAgICAgICBkMy5zZWxlY3QodGhpcykuY2xhc3NlZCgnaG92ZXInLCB0cnVlKTsKKyAgICAgICAgICAgIGRpc3BhdGNoLmFyZWFNb3VzZW92ZXIoeworICAgICAgICAgICAgICBwb2ludDogZCwKKyAgICAgICAgICAgICAgc2VyaWVzOiBkLmtleSwKKyAgICAgICAgICAgICAgcG9zOiBbZDMuZXZlbnQucGFnZVgsIGQzLmV2ZW50LnBhZ2VZXSwKKyAgICAgICAgICAgICAgc2VyaWVzSW5kZXg6IGkKKyAgICAgICAgICAgIH0pOworICAgICAgICAgIH0pCisgICAgICAgICAgLm9uKCdtb3VzZW91dCcsIGZ1bmN0aW9uKGQsaSkgeworICAgICAgICAgICAgZDMuc2VsZWN0KHRoaXMpLmNsYXNzZWQoJ2hvdmVyJywgZmFsc2UpOworICAgICAgICAgICAgZGlzcGF0Y2guYXJlYU1vdXNlb3V0KHsKKyAgICAgICAgICAgICAgcG9pbnQ6IGQsCisgICAgICAgICAgICAgIHNlcmllczogZC5rZXksCisgICAgICAgICAgICAgIHBvczogW2QzLmV2ZW50LnBhZ2VYLCBkMy5ldmVudC5wYWdlWV0sCisgICAgICAgICAgICAgIHNlcmllc0luZGV4OiBpCisgICAgICAgICAgICB9KTsKKyAgICAgICAgICB9KQorICAgICAgICAgIC5vbignY2xpY2snLCBmdW5jdGlvbihkLGkpIHsKKyAgICAgICAgICAgIGQzLnNlbGVjdCh0aGlzKS5jbGFzc2VkKCdob3ZlcicsIGZhbHNlKTsKKyAgICAgICAgICAgIGRpc3BhdGNoLmFyZWFDbGljayh7CisgICAgICAgICAgICAgIHBvaW50OiBkLAorICAgICAgICAgICAgICBzZXJpZXM6IGQua2V5LAorICAgICAgICAgICAgICBwb3M6IFtkMy5ldmVudC5wYWdlWCwgZDMuZXZlbnQucGFnZVldLAorICAgICAgICAgICAgICBzZXJpZXNJbmRleDogaQorICAgICAgICAgICAgfSk7CisgICAgICAgICAgfSkKKyAgICAgIHBhdGguZXhpdCgpLnRyYW5zaXRpb24oKQorICAgICAgICAgIC5hdHRyKCdkJywgZnVuY3Rpb24oZCxpKSB7IHJldHVybiB6ZXJvQXJlYShkLnZhbHVlcyxpKSB9KQorICAgICAgICAgIC5yZW1vdmUoKTsKKyAgICAgIHBhdGgKKyAgICAgICAgICAuc3R5bGUoJ2ZpbGwnLCBmdW5jdGlvbihkLGkpeworICAgICAgICAgICAgcmV0dXJuIGQuY29sb3IgfHwgY29sb3IoZCwgZC5zZXJpZXNJbmRleCkKKyAgICAgICAgICB9KQorICAgICAgICAgIC5zdHlsZSgnc3Ryb2tlJywgZnVuY3Rpb24oZCxpKXsgcmV0dXJuIGQuY29sb3IgfHwgY29sb3IoZCwgZC5zZXJpZXNJbmRleCkgfSk7CisgICAgICBwYXRoLnRyYW5zaXRpb24oKQorICAgICAgICAgIC5hdHRyKCdkJywgZnVuY3Rpb24oZCxpKSB7CisgICAgICAgICAgICByZXR1cm4gYXJlYShkLnZhbHVlcyxpKQorICAgICAgICAgIH0pOworCisKKworICAgICAgLy89PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKyAgICAgIC8vIEV2ZW50IEhhbmRsaW5nL0Rpc3BhdGNoaW5nIChpbiBjaGFydCdzIHNjb3BlKQorICAgICAgLy8tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0KKworICAgICAgc2NhdHRlci5kaXNwYXRjaC5vbignZWxlbWVudE1vdXNlb3Zlci5hcmVhJywgZnVuY3Rpb24oZSkgeworICAgICAgICBnLnNlbGVjdCgnLm52LWNoYXJ0LScgKyBpZCArICcgLm52LWFyZWEtJyArIGUuc2VyaWVzSW5kZXgpLmNsYXNzZWQoJ2hvdmVyJywgdHJ1ZSk7CisgICAgICB9KTsKKyAgICAgIHNjYXR0ZXIuZGlzcGF0Y2gub24oJ2VsZW1lbnRNb3VzZW91dC5hcmVhJywgZnVuY3Rpb24oZSkgeworICAgICAgICBnLnNlbGVjdCgnLm52LWNoYXJ0LScgKyBpZCArICcgLm52LWFyZWEtJyArIGUuc2VyaWVzSW5kZXgpLmNsYXNzZWQoJ2hvdmVyJywgZmFsc2UpOworICAgICAgfSk7CisKKyAgICAgIC8vPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisgICAgICAvL1NwZWNpYWwgb2Zmc2V0IGZ1bmN0aW9ucworICAgICAgY2hhcnQuZDNfc3RhY2tlZE9mZnNldF9zdGFja1BlcmNlbnQgPSBmdW5jdGlvbihzdGFja0RhdGEpIHsKKyAgICAgICAgICB2YXIgbiA9IHN0YWNrRGF0YS5sZW5ndGgsICAgIC8vSG93IG1hbnkgc2VyaWVzCisgICAgICAgICAgbSA9IHN0YWNrRGF0YVswXS5sZW5ndGgsICAgICAvL2hvdyBtYW55IHBvaW50cyBwZXIgc2VyaWVzCisgICAgICAgICAgayA9IDEgLyBuLAorICAgICAgICAgICBpLAorICAgICAgICAgICBqLAorICAgICAgICAgICBvLAorICAgICAgICAgICB5MCA9IFtdOworCisgICAgICAgICAgZm9yIChqID0gMDsgaiA8IG07ICsraikgeyAvL0xvb3BpbmcgdGhyb3VnaCBhbGwgcG9pbnRzCisgICAgICAgICAgICBmb3IgKGkgPSAwLCBvID0gMDsgaSA8IGRhdGFSYXcubGVuZ3RoOyBpKyspICAvL2xvb3BpbmcgdGhyb3VnaCBzZXJpZXMnCisgICAgICAgICAgICAgICAgbyArPSBnZXRZKGRhdGFSYXdbaV0udmFsdWVzW2pdKSAgIC8vdG90YWwgdmFsdWUgb2YgYWxsIHBvaW50cyBhdCBhIGNlcnRpYW4gcG9pbnQgaW4gdGltZS4KKworICAgICAgICAgICAgaWYgKG8pIGZvciAoaSA9IDA7IGkgPCBuOyBpKyspCisgICAgICAgICAgICAgICBzdGFja0RhdGFbaV1bal1bMV0gLz0gbzsKKyAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgICAgZm9yIChpID0gMDsgaSA8IG47IGkrKykKKyAgICAgICAgICAgICAgIHN0YWNrRGF0YVtpXVtqXVsxXSA9IGs7CisgICAgICAgICAgfQorICAgICAgICAgIGZvciAoaiA9IDA7IGogPCBtOyArK2opIHkwW2pdID0gMDsKKyAgICAgICAgICByZXR1cm4geTA7CisgICAgICB9OworCisgICAgfSk7CisKKworICAgIHJldHVybiBjaGFydDsKKyAgfQorCisKKyAgLy89PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKyAgLy8gRXZlbnQgSGFuZGxpbmcvRGlzcGF0Y2hpbmcgKG91dCBvZiBjaGFydCdzIHNjb3BlKQorICAvLy0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLQorCisgIHNjYXR0ZXIuZGlzcGF0Y2gub24oJ2VsZW1lbnRDbGljay5hcmVhJywgZnVuY3Rpb24oZSkgeworICAgIGRpc3BhdGNoLmFyZWFDbGljayhlKTsKKyAgfSkKKyAgc2NhdHRlci5kaXNwYXRjaC5vbignZWxlbWVudE1vdXNlb3Zlci50b29sdGlwJywgZnVuY3Rpb24oZSkgeworICAgICAgICBlLnBvcyA9IFtlLnBvc1swXSArIG1hcmdpbi5sZWZ0LCBlLnBvc1sxXSArIG1hcmdpbi50b3BdLAorICAgICAgICBkaXNwYXRjaC50b29sdGlwU2hvdyhlKTsKKyAgfSk7CisgIHNjYXR0ZXIuZGlzcGF0Y2gub24oJ2VsZW1lbnRNb3VzZW91dC50b29sdGlwJywgZnVuY3Rpb24oZSkgeworICAgICAgICBkaXNwYXRjaC50b29sdGlwSGlkZShlKTsKKyAgfSk7CisKKyAgLy89PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKworICAvLz09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorICAvLyBHbG9iYWwgZ2V0dGVycyBhbmQgc2V0dGVycworICAvLy0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLQorCisgIGNoYXJ0LmRpc3BhdGNoID0gZGlzcGF0Y2g7CisgIGNoYXJ0LnNjYXR0ZXIgPSBzY2F0dGVyOworCisgIGQzLnJlYmluZChjaGFydCwgc2NhdHRlciwgJ2ludGVyYWN0aXZlJywgJ3NpemU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V0ICsgb3JkZXIKKyAgY2hhcnQuc3R5bGUgPSBmdW5jdGlvbihfKSB7CisgICAgaWYgKCFhcmd1bWVudHMubGVuZ3RoKSByZXR1cm4gc3R5bGU7CisgICAgc3R5bGUgPSBfOworCisgICAgc3dpdGNoIChzdHlsZSkgeworICAgICAgY2FzZSAnc3RhY2snOgorICAgICAgICBjaGFydC5vZmZzZXQoJ3plcm8nKTsKKyAgICAgICAgY2hhcnQub3JkZXIoJ2RlZmF1bHQnKTsKKyAgICAgICAgYnJlYWs7CisgICAgICBjYXNlICdzdHJlYW0nOgorICAgICAgICBjaGFydC5vZmZzZXQoJ3dpZ2dsZScpOworICAgICAgICBjaGFydC5vcmRlcignaW5zaWRlLW91dCcpOworICAgICAgICBicmVhazsKKyAgICAgIGNhc2UgJ3N0cmVhbS1jZW50ZXInOgorICAgICAgICAgIGNoYXJ0Lm9mZnNldCgnc2lsaG91ZXR0ZScpOworICAgICAgICAgIGNoYXJ0Lm9yZGVyKCdpbnNpZGUtb3V0Jyk7CisgICAgICAgICAgYnJlYWs7CisgICAgICBjYXNlICdleHBhbmQnOgorICAgICAgICBjaGFydC5vZmZzZXQoJ2V4cGFuZCcpOworICAgICAgICBjaGFydC5vcmRlcignZGVmYXVsdCcpOworICAgICAgICBicmVhazsKKyAgICAgIGNhc2UgJ3N0YWNrX3BlcmNlbnQnOgorICAgICAgICBjaGFydC5vZmZzZXQoY2hhcnQuZDNfc3RhY2tlZE9mZnNldF9zdGFja1BlcmNlbnQpOworICAgICAgICBjaGFydC5vcmRlcignZGVmYXVsdCcpOworICAgICAgICBicmVhazsKKyAgICB9CisKKyAgICByZXR1cm4gY2hhcnQ7CisgIH07CisKKyAgY2hhcnQuaW50ZXJwb2xhdGUgPSBmdW5jdGlvbihfKSB7CisJICAgIGlmICghYXJndW1lbnRzLmxlbmd0aCkgcmV0dXJuIGludGVycG9sYXRlOworCSAgICBpbnRlcnBvbGF0ZSA9IF87CisJICAgIHJldHVybiBjaGFydDsKKyA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hdGNoKCd0b29sdGlwU2hvdycsICd0b29sdGlwSGlkZScsICdzdGF0ZUNoYW5nZScsICdjaGFuZ2VTdGF0ZScpCisgICAgLCBjb250cm9sV2lkdGggPSAyNTAKKyAgICAsIGNEYXRhID0gWydTdGFja2VkJywnU3RyZWFtJywnRXhwYW5kZWQnXQorICAgICwgY29udHJvbExhYmVscyA9IHt9CisgICAgLCB0cmFuc2l0aW9uRHVyYXRpb24gPSAyNTAKKyAgICA7CisKKyAgeEF4aXMKKyAgICAub3JpZW50KCdib3R0b20nKQorICAgIC50aWNrUGFkZGluZyg3KQorICAgIDsKKyAgeUF4aXMKKyAgICAub3JpZW50KChyaWdodEFsaWduWUF4aXMpID8gJ3JpZ2h0JyA6ICdsZWZ0JykKKyAgICA7CisKKyAgY29udHJvbHMudXBkYXRlU3RhdGUoZmFsc2UpOworICAvLz09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorCisKKyAgLy89PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKyAgLy8gUHJpdmF0ZSBWYXJpYWJsZXMKKyAgLy8tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0KKworICB2YXIgc2hvd1Rvb2x0aXAgPSBmdW5jdGlvbihlLCBvZmZzZXRFbGVtZW50KSB7CisgICAgdmFyIGxlZnQgPSBlLnBvc1swXSArICggb2Zmc2V0RWxlbWVudC5vZmZzZXRMZWZ0IHx8IDAgKSwKKyAgICAgICAgdG9wID0gZS5wb3NbMV0gKyAoIG9mZnNldEVsZW1lbnQub2Zmc2V0VG9wIHx8IDApLAorICAgICAgICB4ID0geEF4aXMudGlja0Zvcm1hdCgpKHN0YWNrZWQueCgpKGUucG9pbnQsIGUucG9pbnRJbmRleCkpLAorICAgICAgICB5ID0geUF4aXMudGlja0Zvcm1hdCgpKHN0YWNrZWQueSgpKGUucG9pbnQsIGUucG9pbnRJbmRleCkpLAorICAgICAgICBjb250ZW50ID0gdG9vbHRpcChlLnNlcmllcy5rZXksIHgsIHksIGUsIGNoYXJ0KTsKKworICAgIG52LnRvb2x0aXAuc2hvdyhbbGVmdCwgdG9wXSwgY29udGVudCwgZS52YWx1ZSA8IDAgPyAnbicgOiAncycsIG51bGwsIG9mZnNldEVsZW1lbnQpOworICB9OworCisgIC8vPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisKKworICBmdW5jdGlvbiBjaGFydChzZWxlY3Rpb24pIHsKKyAgICBzZWxlY3Rpb24uZWFjaChmdW5jdGlvbihkYXRhKSB7CisgICAgICB2YXIgY29udGFpbmVyID0gZDMuc2VsZWN0KHRoaXMpLAorICAgICAgICAgIHRoYXQgPSB0aGlzOworCisgICAgICB2YXIgYXZhaWxhYmxlV2lkdGggPSAod2lkdGggIHx8IHBhcnNlSW50KGNvbnRhaW5lci5zdHlsZSgnd2lkdGgnKSkgfHwgOTYwKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAtIG1hcmdpbi5sZWZ0IC0gbWFyZ2luLnJpZ2h0LAorICAgICAgICAgIGF2YWlsYWJsZUhlaWdodCA9IChoZWlnaHQgfHwgcGFyc2VJbnQoY29udGFpbmVyLnN0eWxlKCdoZWlnaHQnKSkgfHwgNDAwKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAtIG1hcmdpbi50b3AgLSBtYXJnaW4uYm90dG9tOworCisgICAgICBjaGFydC51cGRhdGUgPSBmdW5jdGlvbigpIHsgY29udGFpbmVyLnRyYW5zaXRpb24oKS5kdXJhdGlvbih0cmFuc2l0aW9uRHVyYXRpb24pLmNhbGwoY2hhcnQpOyB9OworICAgICAgY2hhcnQuY29udGFpbmVyID0gdGhpczsKKworICAgICAgLy9zZXQgc3RhdGUuZGlzYWJsZWQKKyAgICAgIHN0YXRlLmRpc2FibGVkID0gZGF0YS5tYXAoZnVuY3Rpb24oZCkgeyByZXR1cm4gISFkLmRpc2FibGVkIH0pOworCisgICAgICBpZiAoIWRlZmF1bHRTdGF0ZSkgeworICAgICAgICB2YXIga2V5OworICAgICAgICBkZWZhdWx0U3RhdGUgPSB7fTsKKyAgICAgICAgZm9yIChrZXkgaW4gc3RhdGUpIHsKKyAgICAgICAgICBpZiAoc3RhdGVba2V5XSBpbnN0YW5jZW9mIEFycmF5KQorICAgICAgICAgICAgZGVmYXVsdFN0YXRlW2tleV0gPSBzdGF0ZVtrZXldLnNsaWNlKDApOworICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgIGRlZmF1bHRTdGF0ZVtrZXldID0gc3RhdGVba2V5XTsKKyAgICAgICAgfQorICAgICAgfQorCisgICAgICAvLy0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLQorICAgICAgLy8gRGlzcGxheSBObyBEYXRhIG1lc3NhZ2UgaWYgdGhlcmUncyBub3RoaW5nIHRvIHNob3cuCisKKyAgICAgIGlmICghZGF0YSB8fCAhZGF0YS5sZW5ndGggfHwgIWRhdGEuZmlsdGVyKGZ1bmN0aW9uKGQpIHsgcmV0dXJuIGQudmFsdWVzLmxlbmd0aCB9KS5sZW5ndGgpIHsKKyAgICAgICAgdmFyIG5vRGF0YVRleHQgPSBjb250YWluZXIuc2VsZWN0QWxsKCcubnYtbm9EYXRhJykuZGF0YShbbm9EYXRhXSk7CisKKyAgICAgICAgbm9EYXRhVGV4dC5lbnRlcigpLmFwcGVuZCgndGV4dCcpCisgICAgICAgICAgLmF0dHIoJ2NsYXNzJywgJ252ZDMgbnYtbm9EYXRhJykKKyAgICAgICAgICAuYXR0cignZHknLCAnLS43ZW0nKQorICAgICAgICAgIC5zdHlsZSgndGV4dC1hbmNob3InLCAnbWlkZGxlJyk7CisKKyAgICAgICAgbm9EYXRhVGV4dAorICAgICA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c2VsZWN0KCcubnYtbGVnZW5kV3JhcCcpCisgICAgICAgICAgICAuZGF0dW0oZGF0YSkKKyAgICAgICAgICAgIC5jYWxsKGxlZ2VuZCk7CisKKyAgICAgICAgaWYgKCBtYXJnaW4udG9wICE9IGxlZ2VuZC5oZWlnaHQoKSkgeworICAgICAgICAgIG1hcmdpbi50b3AgPSBsZWdlbmQuaGVpZ2h0KCk7CisgICAgICAgICAgYXZhaWxhYmxlSGVpZ2h0ID0gKGhlaWdodCB8fCBwYXJzZUludChjb250YWluZXIuc3R5bGUoJ2hlaWdodCcpKSB8fCA0MDApCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC0gbWFyZ2luLnRvcCAtIG1hcmdpbi5ib3R0b207CisgICAgICAgIH0KKworICAgICAgICBnLnNlbGVjdCgnLm52LWxlZ2VuZFdyYXAnKQorICAgICAgICAgICAgLmF0dHIoJ3RyYW5zZm9ybScsICd0cmFuc2xhdGUoJyArIChhdmFpbGFibGVXaWR0aC1sZWdlbmRXaWR0aCkgKyAnLCcgKyAoLW1hcmdpbi50b3ApICsnKScpOworICAgICAgfQorCisgICAgICAvLy0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLQorCisKKyAgICAgIC8vLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tCisgICAgICAvLyBDb250cm9scworCisgICAgICBpZiAoc2hvd0NvbnRyb2xzKSB7CisgICAgICAgIHZhciBjb250cm9sc0RhdGEgPSBbCisgICAgICAgICAgeworICAgICAgICAgICAga2V5OiBjb250cm9sTGFiZWxzLnN0YWNrZWQgfHwgJ1N0YWNrZWQnLCAKKyAgICAgICAgICAgIG1ldGFLZXk6ICdTdGFja2VkJywgCisgICAgICAgICAgICBkaXNhYmxlZDogc3RhY2tlZC5zdHlsZSgpICE9ICdzdGFjaycsIAorICAgICAgICAgICAgc3R5bGU6ICdzdGFjaycgCisgICAgICAgICAgfSwKKyAgICAgICAgICB7CisgICAgICAgICAgICBrZXk6IGNvbnRyb2xMYWJlbHMuc3RyZWFtIHx8ICdTdHJlYW0nLCAKKyAgICAgICAgICAgIG1ldGFLZXk6ICdTdHJlYW0nLCAKKyAgICAgICAgICAgIGRpc2FibGVkOiBzdGFja2VkLnN0eWxlKCkgIT0gJ3N0cmVhbScsIAorICAgICAgICAgICAgc3R5bGU6ICdzdHJlYW0nIAorICAgICAgICAgIH0sCisgICAgICAgICAgeworICAgICAgICAgICAga2V5OiBjb250cm9sTGFiZWxzLmV4cGFuZGVkIHx8ICdFeHBhbmRlZCcsIAorICAgICAgICAgICAgbWV0YUtleTogJ0V4cGFuZGVkJywgCisgICAgICAgICAgICBkaXNhYmxlZDogc3RhY2tlZC5zdHlsZSgpICE9ICdleHBhbmQnLCAKKyAgICAgICAgICAgIHN0eWxlOiAnZXhwYW5kJyAKKyAgICAgICAgICB9LAorICAgICAgICAgIHsKKyAgICAgICAgICAgIGtleTogY29udHJvbExhYmVscy5zdGFja19wZXJjZW50IHx8ICdTdGFjayAlJywgCisgICAgICAgICAgICBtZXRhS2V5OiAnU3RhY2tfUGVyY2VudCcsIAorICAgICAgICAgICAgZGlzYWJsZWQ6IHN0YWNrZWQuc3R5bGUoKSAhPSAnc3RhY2tfcGVyY2VudCcsIAorICAgICAgICAgICAgc3R5bGU6ICdzdGFja19wZXJjZW50JyAKKyAgICAgICAgICB9CisgICAgICAgIF07CisKKyAgICAgICAgY29udHJvbFdpZHRoID0gKGNEYXRhLmxlbmd0aC8zKSAqIDI2MDsKKworICAgICAgICBjb250cm9sc0RhdGEgPSBjb250cm9sc0RhdGEuZmlsdGVyKGZ1bmN0aW9uKGQpIHsKKyAgICAgICAgICByZXR1cm4gY0RhdGEuaW5kZXhPZihkLm1ldGFLZXkpICE9PSAtMTsKKyAgICAgICAgfSkKKworICAgICAgICBjb250cm9scworICAgICAgICAgIC53aWR0aCggY29udHJvbFdpZHRoICkKKyAgICAgICAgICAuY29sb3IoWycjNDQ0JywgJyM0NDQnLCAnIzQ0NCddKTsKKworICAgICAgICBnLnNlbGVjdCgnLm52LWNvbnRyb2xzV3JhcCcpCisgICAgICAgICAgICAuZGF0dW0oY29udHJvbHNEYXRhKQorICAgICAgICAgICAgLmNhbGwoY29udHJvbHMpOworCisKKyAgICAgICAgaWYgKCBtYXJnaW4udG9wICE9IE1hdGgubWF4KGNvbnRyb2xzLmhlaWdodCgpLCBsZWdlbmQuaGVpZ2h0KCkpICkgeworICAgICAgICAgIG1hcmdpbi50b3AgPSBNYXRoLm1heChjb250cm9scy5oZWlnaHQoKSwgbGVnZW5kLmhlaWdodCgpKTsKKyAgICAgICAgICBhdmFpbGFibGVIZWlnaHQgPSAoaGVpZ2h0IHx8IHBhcnNlSW50KGNvbnRhaW5lci5zdHlsZSgnaGVpZ2h0JykpIHx8IDQwMCkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLSBtYXJnaW4udG9wIC0gbWFyZ2luLmJvdHRvbTsKKyAgICAgICAgfQorCisKKyAgICAgICAgZy5zZWxlY3QoJy5udi1jb250cm9sc1dyYXAnKQorICAgICAgICAgICAgLmF0dHIoJ3RyYW5zZm9ybScsICd0cmFuc2xhdGUoMCwnICsgKC1tYXJnaW4udG9wKSArJyknKTsKKyAgICAgIH0KKworICAgICAgLy8tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0KKworCisgICAgICB3cmFwLmF0dHIoJ3RyYW5zZm9ybScsICd0cmFuc2xhdGUoJyArIG1hcmdpbi5sZWZ0ICsgJywnICsgbWFyZ2luLnRvcCArICcpJyk7CisKKyAgICAgIGlmIChyaWdodEFsaWduWUF4aXMpIHsKKyAgICAgICAgICBnLnNlbGVjdCgiLm52LXkubnYtYXhpcyIpCisgICAgICAgICAgICAgIC5hdHRyKCJ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S0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLQorCisKKyAgICAgIC8vLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tCisgICAgICAvLyBTZXR1cCBBeGVzCisKKyAgICAgIGlmIChzaG93WEF4aXMpIHsKKyAgICAgICAgeEF4aXMKKyAgICAgICAgICAuc2NhbGUoeCkKKyAgICAgICAgICAudGlja3MoIGF2YWlsYWJsZVdpZHRoIC8gMTAwICkKKyAgICAgICAgICAudGlja1NpemUoIC1hdmFpbGFibGVIZWlnaHQsIDApOworCisgICAgICAgIGcuc2VsZWN0KCcubnYteC5udi1heGlzJykKKyAgICAgICAgICAgIC5hdHRyKCd0cmFuc2Zvcm0nLCAndHJhbnNsYXRlKDAsJyArIGF2YWlsYWJsZUhlaWdodCArICcpJyk7CisKKyAgICAgICAgZy5zZWxlY3QoJy5udi14Lm52LWF4aXMnKQorICAgICAgICAgIC50cmFuc2l0aW9uKCkuZHVyYXRpb24oMCkKKyAgICAgICAgICAgIC5jYWxsKHhBeGlzKTsKKyAgICAgIH0KKworICAgICAgaWYgKHNob3dZQXhpcykgeworICAgICAgICB5QXhpcworICAgICAgICAgIC5zY2FsZSh5KQorICAgICAgICAgIC50aWNrcyhzdGFja2VkLm9mZnNldCgpID09ICd3aWdnbGUnID8gMCA6IGF2YWlsYWJsZUhlaWdodCAvIDM2KQorICAgICAgICAgIC50aWNrU2l6ZSgtYXZhaWxhYmxlV2lkdGgsIDApCisgICAgICAgICAgLnNldFRpY2tGb3JtYXQoIChzdGFja2VkLnN0eWxlKCkgPT0gJ2V4cGFuZCcgfHwgc3RhY2tlZC5zdHlsZSgpID09ICdzdGFja19wZXJjZW50JykgCisgICAgICAgICAgICAgICAgPyBkMy5mb3JtYXQoJyUnKSA6IHlBeGlzVGlja0Zvcm1hdCk7CisKKyAgICAgICAgZy5zZWxlY3QoJy5udi15Lm52LWF4aXMnKQorICAgICAgICAgIC50cmFuc2l0aW9uKCkuZHVyYXRpb24oMCkKKyAgICAgICAgICAgIC5jYWxsKHlBeGlzKTsKKyAgICAgIH0KKworICAgICAgLy8tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0KKworCisgICAgICAvLz09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorICAgICAgLy8gRXZlbnQgSGFuZGxpbmcvRGlzcGF0Y2hpbmcgKGluIGNoYXJ0J3Mgc2NvcGUpCisgICAgICAvLy0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLQorCisgICAgICBzdGFja2VkLmRpc3BhdGNoLm9uKCdhcmVhQ2xpY2sudG9nZ2xlJywgZnVuY3Rpb24oZSkgeworICAgICAgICBpZiAoZGF0YS5maWx0ZXIoZnVuY3Rpb24oZCkgeyByZXR1cm4gIWQuZGlzYWJsZWQgfSkubGVuZ3RoID09PSAxKQorICAgICAgICAgIGRhdGEuZm9yRWFjaChmdW5jdGlvbihkKSB7CisgICAgICAgICAgICBkLmRpc2FibGVkID0gZmFsc2U7CisgICAgICAgICAgfSk7CisgICAgICAgIGVsc2UKKyAgICAgICAgICBkYXRhLmZvckVhY2goZnVuY3Rpb24oZCxpKSB7CisgICAgICAgICAgICBkLmRpc2FibGVkID0gKGkgIT0gZS5zZXJpZXNJbmRleCk7CisgICAgICAgICAgfSk7CisKKyAgICAgICAgc3RhdGUuZGlzYWJsZWQgPSBkYXRhLm1hcChmdW5jdGlvbihkKSB7IHJldHVybiAhIWQuZGlzYWJsZWQgfSk7CisgICAgICAgIGRpc3BhdGNoLnN0YXRlQ2hhbmdlKHN0YXRlKTsKKworICAgICAgICBjaGFydC51cGRhdGUoKTsKKyAgICAgIH0pOworCisgICAgICBsZWdlbmQuZGlzcGF0Y2gub24oJ3N0YXRlQ2hhbmdlJywgZnVuY3Rpb24obmV3U3RhdGUpIHsKKyAgICAgICAgc3RhdGUuZGlzYWJsZWQgPSBuZXdTdGF0ZS5kaXNhYmxlZDsKKyAgICAgICAgZGlzcGF0Y2guc3RhdGVDaGFuZ2Uoc3RhdGUpOworICAgICAgICBjaGFydC51cGRhdGUoKTsKKyAgICAgIH0pOworCisgICAgICBjb250cm9scy5kaXNwYXRjaC5vbignbGVnZW5kQ2xpY2snLCBmdW5jdGlvbihkLGkpIHsKKyAgICAgICAgaWYgKCFkLmRpc2FibGVkKSByZXR1cm47CisKKyAgICAgICAgY29udHJvbHNEYXRhID0gY29udHJvbHNEYXRhLm1hcChmdW5jdGlvbihzKSB7CisgICAgICAgICAgcy5kaXNhYmxlZCA9IHRydWU7CisgICAgICAgICAgcmV0dXJuIHM7CisgICAgICAgIH0pOworICAgICAgICBkLmRpc2FibGVkID0gZmFsc2U7CisKKyAgICAgICAgc3RhY2tlZC5zdHlsZShkLnN0eWxlKTsKKyAgICAKKworICAgICAgICBzdGF0ZS5zdHlsZSA9IHN0YWNrZWQuc3R5bGUoKTsKKyAgICAgICAgZGlzcGF0Y2guc3RhdGVDaGFuZ2Uoc3RhdGUpOworCisgICAgICAgIGNoYXJ0LnVwZGF0ZSgpOworICAgICAgfSk7CisKKworICAgICAgaW50ZXJhY3RpdmVMYXllci5kaXNwYXRjaC5vbignZWxlbWVudE1vdXNlbW92ZScsIGZ1bmN0aW9uKGUpIHsKKyAgICAgICAgICBzdGFja2VkLmNsZWFySGlnaGxpZ2h0cygpOworICAgICAgICAgIHZhciBzaW5nbGVQb2ludCwgcG9pbnRJbmRleCwgcG9pbnRYTG9jYXRpb24sIGFsbERhdGEgPSBbXTsKKyAgICAgICAgICBkYXRhCisgICAgICAgICAgLmZpbHRlcihmdW5jdGlvbihzZXJpZXMsIGkpIHsKKyAgICAgICAgICAgIHNlcmllcy5zZXJpZXNJbmRleCA9IGk7CisgICAgICAgICAgICByZXR1cm4gIXNlcmllcy5kaXNhYmxlZDsKKyAgICAgICAgICB9KQorICAgICAgICAgIC5mb3JFYWNoKGZ1bmN0aW9uKHNlcmllcyxpKSB7CisgICAgICAgICAgICAgIHBvaW50SW5kZXggPSBudi5pbnRlcmFjdGl2ZUJpc2VjdChzZXJpZXMudmFsdWVzLCBlLnBvaW50WFZhbHVlLCBjaGFydC54KCkpOworICAgICAgICAgICAgICBzdGFja2VkLmhpZ2hsaWdodFBvaW50KGksIHBvaW50SW5kZXgsIHRydWUpOworICAgICAgICAgICAgICB2YXIgcG9pbnQgPSBzZXJpZXMudmFsdWVzW3BvaW50SW5kZXhdOworICAgICAgICAgICAgICBpZiAodHlwZW9mIHBvaW50ID09PSAndW5kZWZpbmVkJykgcmV0dXJuOworICAgICAgICAgICAgICBpZiAodHlwZW9mIHNpbmdsZVBvaW50ID09PSAndW5kZWZpbmVkJykgc2luZ2xlUG9pbnQgPSBwb2ludDsKKyAgICAgICAgICAgICAgaWYgKHR5cGVvZiBwb2ludFhMb2NhdGlvbiA9PT0gJ3VuZGVmaW5lZCcpIHBvaW50WExvY2F0aW9uID0gY2hhcnQueFNjYWxlKCkoY2hhcnQueCgpKHBvaW50LHBvaW50SW5kZXgpKTsKKworICAgICAgICAgICAgICAvL0lmIHdlIGFyZSBpbiAnZXhwYW5kJyBtb2RlLCB1c2UgdGhlIHN0YWNrZWQgcGVyY2VudCB2YWx1ZSBpbnN0ZWFkIG9mIHJhdyB2YWx1ZS4KKyAgICAgICAgICAgICAgdmFyIHRvb2x0aXBWYWx1ZSA9IChzdGFja2VkLnN0eWxlKCkgPT0gJ2V4cGFuZCcpID8gcG9pbnQuZGlzcGxheS55IDogY2hhcnQueSgpKHBvaW50LHBvaW50SW5kZXgpOworICAgICAgICAgICAgICBhbGxEYXRhLnB1c2goeworICAgICAgICAgICAgICAgICAga2V5OiBzZXJpZXMua2V5LAorICAgICAgICAgICAgICAgICAgdmFsdWU6IHRvb2x0aXBWYWx1ZSwKKyAgICAgICAgICAgICAgICAgIGNvbG9yOiBjb2xvcihzZXJpZXMsc2VyaWVzLnNlcmllc0luZGV4KSwKKyAgICAgICAgICAgICAgICAgIHN0YWNrZWRWYWx1ZTogcG9pbnQuZGlzcGxheQorICAgICAgICAgICAgICB9KTsKKyAgICAgICAgICB9KTsKKworICAgICAgICAgIGFsbERhdGEucmV2ZXJzZSgpOworCisgICAgICAgICAgLy9IaWdobGlnaHQgdGhlIHRvb2x0aXAgZW50cnkgYmFzZWQgb24gd2hpY2ggc3RhY2sgdGhlIG1vdXNlIGlzIGNsb3Nlc3QgdG8uCisgICAgICAgICAgaWYgKGFsbERhdGEubGVuZ3RoID4gMikgeworICAgICAgICAgICAgdmFyIHlWYWx1ZSA9IGNoYXJ0LnlTY2FsZSgpLmludmVydChlLm1vdXNlWSk7CisgICAgICAgICAgICB2YXIgeURpc3RNYXggPSBJbmZpbml0eSwgaW5kZXhUb0hpZ2hsaWdodCA9IG51bGw7CisgICAgICAgICAgICBhbGxEYXRhLmZvckVhY2goZnVuY3Rpb24oc2VyaWVzLGkpIHsKKyAgICAgICAgICAgICAgIGlmICggeVZhbHVlID49IHNlcmllcy5zdGFja2VkVmFsdWUueTAgJiYgeVZhbHVlIDw9IChzZXJpZXMuc3RhY2tlZFZhbHVlLnkwICsgc2VyaWVzLnN0YWNrZWRWYWx1ZS55KSkKKyAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgIGluZGV4VG9IaWdobGlnaHQgPSBpOworICAgICAgICAgICAgICAgICAgcmV0dXJuOworICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfSk7CisgICAgICAgICAgICBpZiAoaW5kZXhUb0hpZ2hsaWdodCAhPSBudWxsKQorICAgICAgICAgICAgICAgYWxsRGF0YVtpbmRleFRvSGlnaGxpZ2h0XS5oaWdobGlnaHQgPSB0cnVlOworICAgICAgICAgIH0KKworICAgICAgICAgIHZhciB4VmFsdWUgPSB4QXhpcy50aWNrRm9ybWF0KCkoY2hhcnQueCgpKHNpbmdsZVBvaW50LHBvaW50SW5kZXgpKTsKKworICAgICAgICAgIC8vSWYgd2UgYXJlIGluICdleHBhbmQnIG1vZGUsIGZvcmNlIHRoZSBmb3JtYXQgdG8gYmUgYSBwZXJjZW50YWdlLgorICAgICAgICAgIHZhciB2YWx1ZUZvcm1hdHRlciA9IChzdGFja2VkLnN0eWxlKCkgPT0gJ2V4cGFuZCcpID8gCisgICAgICAgICAgICAgICBmdW5jdGlvbihkLGkpIHtyZXR1cm4gZDMuZm9ybWF0KCIuMSUiKShkKTt9IDoKKyAgICAgICAgICAgICAgIGZ1bmN0aW9uKGQsaSkge3JldHVybiB5QXhpcy50aWNrRm9ybWF0KCkoZCk7IH07CisgICAgICAgICAgaW50ZXJhY3RpdmVMYXllci50b29sdGlwCisgICAgICAgICAgICAgICAgICAucG9zaXRpb24oe2xlZnQ6IHBvaW50WExvY2F0aW9uICsgbWFyZ2luLmxlZnQsIHRvcDogZS5tb3VzZVkgKyBtYXJnaW4udG9wfSkKKyAgICAgICAgICAgICAgICAgIC5jaGFydENvbnRhaW5lcih0aGF0LnBhcmVudE5vZGUpCisgICAgICAgICAgICAgICAgICAuZW5hYmxlZCh0b29sdGlwcykKKyAgICAgICAgICAgICAgICAgIC52YWx1ZUZvcm1hdHRlcih2YWx1ZUZvcm1hdHRlcikKKyAgICAgICAgICAgICAgICAgIC5kYXRhKAorICAgICAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIHZhbHVlOiB4VmFsdWUsCisgICAgICAgICAgICAgICAgICAgICAgICBzZXJpZXM6IGFsbERhdGEKKyAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICApKCk7CisKKyAgICAgICAgICBpbnRlcmFjdGl2ZUxheWVyLnJlbmRlckd1aWRlTGluZShwb2ludFhMb2NhdGlvbik7CisKKyAgICAgIH0pOworCisgICAgICBpbnRlcmFjdGl2ZUxheWVyLmRpc3BhdGNoLm9uKCJlbGVtZW50TW91c2VvdXQiLGZ1bmN0aW9uKGUpIHsKKyAgICAgICAgICBkaXNwYXRjaC50b29sdGlwSGlkZSgpOworICAgICAgICAgIHN0YWNrZWQuY2xlYXJIaWdobGlnaHRzKCk7CisgICAgICB9KTsKKworCisgICAgICBkaXNwYXRjaC5vbigndG9vbHRpcFNob3cnLCBmdW5jdGlvbihlKSB7CisgICAgICAgIGlmICh0b29sdGlwcykgc2hvd1Rvb2x0aXAoZSwgdGhhdC5wYXJlbnROb2RlKTsKKyAgICAgIH0pOworCisgICAgICAvLyBVcGRhdGUgY2hhcnQgZnJvbSBhIHN0YXRlIG9iamVjdCBwYXNzZWQgdG8gZXZlbnQgaGFuZGxlcgorICAgICAgZGlzcGF0Y2gub24oJ2NoYW5nZVN0YXRlJywgZnVuY3Rpb24oZSkgeworCisgICAgICAgIGlmICh0eXBlb2YgZS5kaXNhYmxlZCAhPT0gJ3VuZGVmaW5lZCcpIHsKKyAgICAgICAgICBkYXRhLmZvckVhY2goZnVuY3Rpb24oc2VyaWVzLGkpIHsKKyAgICAgICAgICAgIHNlcmllcy5kaXNhYmxlZCA9IGUuZGlzYWJsZWRbaV07CisgICAgICAgICAgfSk7CisKKyAgICAgICAgICBzdGF0ZS5kaXNhYmxlZCA9IGUuZGlzYWJsZWQ7CisgICAgICAgIH0KKworICAgICAgICBpZiAodHlwZW9mIGUuc3R5bGUgIT09ICd1bmRlZmluZWQnKSB7CisgICAgICAgICAgc3RhY2tlZC5zdHlsZShlLnN0eWxlKTsKKyAgICAgICAgfQorCisgICAgICAgIGNoYXJ0LnVwZGF0ZSgpOworICAgICAgfSk7CisKKyAgICB9KTsKKworCisgICAgcmV0dXJuIGNoYXJ0OworICB9CisKKworICAvLz09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorICAvLyBFdmVudCBIYW5kbGluZy9EaXNwYXRjaGluZy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hhcnQ7CisgIH07CisKKyAgY2hhcnQuc2hvd0NvbnRyb2xzID0gZnVuY3Rpb24oXykgeworICAgIGlmICghYXJndW1lbnRzLmxlbmd0aCkgcmV0dXJuIHNob3dDb250cm9sczsKKyAgICBzaG93Q29udHJvbHMgPSBfOworICAgIHJldHVybiBjaGFydDsKKyAgfTsKKworICBjaGFydC5zaG93TGVnZW5kID0gZnVuY3Rpb24oXykgeworICAgIGlmICghYXJndW1lbnRzLmxlbmd0aCkgcmV0dXJuIHNob3dMZWdlbmQ7CisgICAgc2hvd0xlZ2VuZCA9IF87CisgICAgcmV0dXJuIGNoYXJ0OworICB9OworCisgIGNoYXJ0LnNob3dYQXhpcyA9IGZ1bmN0aW9uKF8pIHsKKyAgICBpZiAoIWFyZ3VtZW50cy5sZW5ndGgpIHJldHVybiBzaG93WEF4aXM7CisgICAgc2hvd1hBeGlzID0gXzsKKyAgICByZXR1cm4gY2hhcnQ7CisgIH07CisKKyAgY2hhcnQuc2hvd1lBeGlzID0gZnVuY3Rpb24oXykgeworICAgIGlmICghYXJndW1lbnRzLmxlbmd0aCkgcmV0dXJuIHNob3dZQXhpczsKKyAgICBzaG93WUF4aXMgPSBfOworICAgIHJldHVybiBjaGFydDsKKyAgfTsKKworICBjaGFydC5yaWdodEFsaWduWUF4aXMgPSBmdW5jdGlvbihfKSB7CisgICAgaWYoIWFyZ3VtZW50cy5sZW5ndGgpIHJldHVybiByaWdodEFsaWduWUF4aXM7CisgICAgcmlnaHRBbGlnbllBeGlzID0gXzsKKyAgICB5QXhpcy5vcmllbnQoIChfKSA/ICdyaWdodCcgOiAnbGVmdCcpOworICAgIHJldHVybiBjaGFydDsKKyAgfTsKKworICBjaGFydC51c2VJbnRlcmFjdGl2ZUd1aWRlbGluZSA9IGZ1bmN0aW9uKF8pIHsKKyAgICBpZighYXJndW1lbnRzLmxlbmd0aCkgcmV0dXJuIHVzZUludGVyYWN0aXZlR3VpZGVsaW5lOworICAgIHVzZUludGVyYWN0aXZlR3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vRGF0YTsKKyAgICBub0RhdGEgPSBfOworICAgIHJldHVybiBjaGFydDsKKyAgfTsKKworICBjaGFydC50cmFuc2l0aW9uRHVyYXRpb24gPSBmdW5jdGlvbihfKSB7CisgICAgaWYgKCFhcmd1bWVudHMubGVuZ3RoKSByZXR1cm4gdHJhbnNpdGlvbkR1cmF0aW9uOworICAgIHRyYW5zaXRpb25EdXJhdGlvbiA9IF87CisgICAgcmV0dXJuIGNoYXJ0OworICB9OworCisgIGNoYXJ0LmNvbnRyb2xzRGF0YSA9IGZ1bmN0aW9uKF8pIHsKKyAgICBpZiAoIWFyZ3VtZW50cy5sZW5ndGgpIHJldHVybiBjRGF0YTsKKyAgICBjRGF0YSA9IF87CisgICAgcmV0dXJuIGNoYXJ0OworICB9OworCisgIGNoYXJ0LmNvbnRyb2xMYWJlbHMgPSBmdW5jdGlvbihfKSB7CisgICAgaWYgKCFhcmd1bWVudHMubGVuZ3RoKSByZXR1cm4gY29udHJvbExhYmVsczsKKyAgICBpZiAodHlwZW9mIF8gIT09ICdvYmplY3QnKSByZXR1cm4gY29udHJvbExhYmVsczsKKyAgICBjb250cm9sTGFiZWxzID0gXzsKKyAgICByZXR1cm4gY2hhcnQ7CisgIH07CisKKyAgeUF4aXMuc2V0VGlja0Zvcm1hdCA9IHlBeGlzLnRpY2tGb3JtYXQ7CisKKyAgeUF4aXMudGlja0Zvcm1hdCA9IGZ1bmN0aW9uKF8pIHsKKyAgICBpZiAoIWFyZ3VtZW50cy5sZW5ndGgpIHJldHVybiB5QXhpc1RpY2tGb3JtYXQ7CisgICAgeUF4aXNUaWNrRm9ybWF0ID0gXzsKKyAgICByZXR1cm4geUF4aXM7CisgIH07CisKKworICAvLz09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorCisgIHJldHVybiBjaGFydDsKK30KZGlmZiAtLWdpdCBhL2Vjb21wLXBvcnRhbC1CRS93YXIvc3RhdGljL2Z1c2lvbi9kM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U6IGFyZ3VtZW50c1swXSwgY2FsbGJhY2s6IGFyZ3VtZW50c1sxXX07CisKKyAgbnYucmVuZGVyLnF1ZXVlLnB1c2gob2JqKTsKKworICBpZiAoIW52LnJlbmRlci5hY3RpdmUpIG52LnJlbmRlcigpOworfTsKKworbnYuaWRlbnRpdHkgPSBmdW5jdGlvbihkKSB7IHJldHVybiBkOyB9OworCitudi5zdHJpcCA9IGZ1bmN0aW9uKHMpIHsgcmV0dXJuIHMucmVwbGFjZSgvKFxzfCYpL2csJycpOyB9OworCitmdW5jdGlvbiBkYXlzSW5Nb250aChtb250aCx5ZWFyKSB7CisgIHJldHVybiAobmV3IERhdGUoeWVhciwgbW9udGgrMSwgMCkpLmdldERhdGUoKTsKK30KKworZnVuY3Rpb24gZDNfdGltZV9yYW5nZShmbG9vciwgc3RlcCwgbnVtYmVyKSB7CisgIHJldHVybiBmdW5jdGlvbih0MCwgdDEsIGR0KSB7CisgICAgdmFyIHRpbWUgPSBmbG9vcih0MCksIHRpbWVzID0gW107CisgICAgaWYgKHRpbWUgPCB0MCkgc3RlcCh0aW1lKTsKKyAgICBpZiAoZHQgPiAxKSB7CisgICAgICB3aGlsZSAodGltZSA8IHQxKSB7CisgICAgICAgIHZhciBkYXRlID0gbmV3IERhdGUoK3RpbWUpOworICAgICAgICBpZiAoKG51bWJlcihkYXRlKSAlIGR0ID09PSAwKSkgdGltZXMucHVzaChkYXRlKTsKKyAgICAgICAgc3RlcCh0aW1lKTsKKyAgICAgIH0KKyAgICB9IGVsc2UgeworICAgICAgd2hpbGUgKHRpbWUgPCB0MSkgeyB0aW1lcy5wdXNoKG5ldyBEYXRlKCt0aW1lKSk7IHN0ZXAodGltZSk7IH0KKyAgICB9CisgICAgcmV0dXJuIHRpbWVzOworICB9OworfQorCitkMy50aW1lLm1vbnRoRW5kID0gZnVuY3Rpb24oZGF0ZSkgeworICByZXR1cm4gbmV3IERhdGUoZGF0ZS5nZXRGdWxsWWVhcigpLCBkYXRlLmdldE1vb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0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tCisKKyAgdmFyIGF4aXMgPSBkMy5zdmcuYXhpcygpCisgICAgOworCisgIHZhciBtYXJnaW4gPSB7dG9wOiAwLCByaWdodDogMCwgYm90dG9tOiAwLCBsZWZ0OiAwfQorICAgICwgd2lkdGggPSA3NSAvL29ubHkgdXNlZCBmb3IgdGlja0xhYmVsIGN1cnJlbnRseQorICAgICwgaGVpZ2h0ID0gNjAgLy9vbmx5IHVzZWQgZm9yIHRpY2tMYWJlbCBjdXJyZW50bHkKKyAgICAsIHNjYWxlID0gZDMuc2NhbGUubGluZWFyKCkKKyAgICAsIGF4aXNMYWJlbFRleHQgPSBudWxsCisgICAgLCBzaG93TWF4TWluID0gdHJ1ZSAvL1RPRE86IHNob3dNYXhNaW4gc2hvdWxkIGJlIGRpc2FibGVkIG9uIGFsbCBvcmRpbmFsIHNjYWxlZCBheGVzCisgICAgLCBoaWdobGlnaHRaZXJvID0gdHJ1ZQorICAgICwgcm90YXRlTGFiZWxzID0gMAorICAgICwgcm90YXRlWUxhYmVsID0gdHJ1ZQorICAgICwgc3RhZ2dlckxhYmVscyA9IGZhbHNlCisgICAgLCBpc09yZGluYWwgPSBmYWxzZQorICAgICwgdGlja3MgPSBudWxsCisgICAgLCBsb2dTY2FsZT1mYWxzZQkKKyAgICA7CisKKyAgYXhpcworICAgIC5zY2FsZShzY2FsZSkKKyAgICAub3JpZW50KCdib3R0b20nKQorICAgIC50aWNrRm9ybWF0KGZ1bmN0aW9uKGQpIHsgcmV0dXJuIGQgfSkKKyAgICA7CisKKyAgLy89PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKworCisgIC8vPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisgIC8vIFByaXZhdGUgVmFyaWFibGVzCisgIC8vLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tCisKKyAgdmFyIHNjYWxlMDsKKworICAvLz09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorCisKKyAgZnVuY3Rpb24gY2hhcnQoc2VsZWN0aW9uKSB7CisgICAgc2VsZWN0aW9uLmVhY2goZnVuY3Rpb24oZGF0YSkgeworICAgICAgdmFyIGNvbnRhaW5lciA9IGQzLnNlbGVjdCh0aGlzKTsKKworCisgICAgICAvLy0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLQorICAgICAgLy8gU2V0dXAgY29udGFpbmVycyBhbmQgc2tlbGV0b24gb2YgY2hhcnQKKworICAgICAgdmFyIHdyYXAgPSBjb250YWluZXIuc2VsZWN0QWxsKCdnLm52LXdyYXAubnYtYXhpcycpLmRhdGEoW2RhdGFdKTsKKyAgICAgIHZhciB3cmFwRW50ZXIgPSB3cmFwLmVudGVyKCkuYXBwZW5kKCdnJykuYXR0cignY2xhc3MnLCAnbnZkMyBudi13cmFwIG52LWF4aXMnKTsKKyAgICAgIHZhciBnRW50ZXIgPSB3cmFwRW50ZXIuYXBwZW5kKCdnJyk7CisgICAgICB2YXIgZyA9IHdyYXAuc2VsZWN0KCdnJykKKworICAgICAgLy8tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0KKworCisgICAgICBpZiAodGlja3MgIT09IG51bGwpCisgICAgICAgIGF4aXMudGlja3ModGlja3MpOworICAgICAgZWxzZSBpZiAoYXhpcy5vcmllbnQoKSA9PSAndG9wJyB8fCBheGlzLm9yaWVudCgpID09ICdib3R0b20nKQorICAgICAgICBheGlzLnRpY2tzKE1hdGguYWJzKHNjYWxlLnJhbmdlKClbMV0gLS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KQorICAgICAgICAgICAgICAuYXR0cigneScsIDApCisgICAgICAgICAgICAgIC5hdHRyKCd4Jywgdy8yKTsKKyAgICAgICAgICBpZiAoc2hvd01heE1pbikgeworICAgICAgICAgICAgdmFyIGF4aXNNYXhNaW4gPSB3cmFwLnNlbGVjdEFsbCgnZy5udi1heGlzTWF4TWluJykKKyAgICAgICAgICAgICAgICAgICAgICAgICAgIC5kYXRhKHNjYWxlLmRvbWFpbigpKTsKKyAgICAgICAgICAgIGF4aXNNYXhNaW4uZW50ZXIoKS5hcHBlbmQoJ2cnKS5hdHRyKCdjbGFzcycsICdudi1heGlzTWF4TWluJykuYXBwZW5kKCd0ZXh0Jyk7CisgICAgICAgICAgICBheGlzTWF4TWluLmV4aXQoKS5yZW1vdmUoKTsKKyAgICAgICAgICAgIGF4aXNNYXhNaW4KKyAgICAgICAgICAgICAgICAuYXR0cigndHJhbnNmb3JtJywgZnVuY3Rpb24oZCxpKSB7CisgICAgICAgICAgICAgICAgICByZXR1cm4gJ3RyYW5zbGF0ZSgnICsgc2NhbGUoZCkgKyAnLDApJworICAgICAgICAgICAgICAgIH0pCisgICAgICAgICAgICAgIC5zZWxlY3QoJ3RleHQnKQorICAgICAgICAgICAgICAgIC5hdHRyKCdkeScsICcwZW0nKQorICAgICAgICAgICAgICAgIC5hdHRyKCd5JywgLWF4aXMudGlja1BhZGRpbmcoKSkKKyAgICAgICAgICAgICAgICAuYXR0cigndGV4dC1hbmNob3InLCAnbWlkZGxlJykKKyAgICAgICAgICAgICAgICAudGV4dChmdW5jdGlvbihkLGkpIHsKKyAgICAgICAgICAgICAgICAgIHZhciB2ID0gZm10KGQpOworICAgICAgICAgICAgICAgICAgcmV0dXJuICgnJyArIHYpLm1hdGNoKCdOYU4nKSA/ICcnIDogdjsKKyAgICAgICAgICAgICAgICB9KTsKKyAgICAgICAgICAgIGQzLnRyYW5zaXRpb24oYXhpc01heE1pbikKKyAgICAgICAgICAgICAgICAuYXR0cigndHJhbnNmb3JtJywgZnVuY3Rpb24oZCxpKSB7CisgICAgICAgICAgICAgICAgICByZXR1cm4gJ3RyYW5zbGF0ZSgnICsgc2NhbGUucmFuZ2UoKVtpXSArICcsMCknCisgICAgICAgICAgICAgICAgfSk7CisgICAgICAgICAgfQorICAgICAgICAgIGJyZWFrOworICAgICAgICBjYXNlICdib3R0b20nOgorICAgICAgICAgIHZhciB4TGFiZWxNYXJnaW4gPSAzNjsKKyAgICAgICAgICB2YXIgbWF4VGV4dFdpZHRoID0gMzA7CisgICAgICAgICAgdmFyIHhUaWNrcyA9IGcuc2VsZWN0QWxsKCdnJykuc2VsZWN0KCJ0ZXh0Iik7CisgICAgICAgICAgaWYgKHJvdGF0ZUxhYmVscyUzNjApIHsKKyAgICAgICAgICAgIC8vQ2FsY3VsYXRlIHRoZSBsb25nZXN0IHhUaWNrIHdpZHRoCisgICAgICAgICAgICB4VGlja3MuZWFjaChmdW5jdGlvbihkLGkpeworICAgICAgICAgICAgICB2YXIgd2lkdGggPSB0aGlzLmdldEJCb3goKS53aWR0aDsKKyAgICAgICAgICAgICAgaWYod2lkdGggPiBtYXhUZXh0V2lkdGgpIG1heFRleHRXaWR0aCA9IHdpZHRoOworICAgICAgICAgICAgfSk7CisgICAgICAgICAgICAvL0NvbnZlcnQgdG8gcmFkaWFucyBiZWZvcmUgY2FsY3VsYXRpbmcgc2luLiBBZGQgMzAgdG8gbWFyZ2luIGZvciBoZWFsdGh5IHBhZGRpbmcuCisgICAgICAgICAgICB2YXIgc2luID0gTWF0aC5hYnMoTWF0aC5zaW4ocm90YXRlTGFiZWxzKk1hdGguUEkvMTgwKSk7CisgICAgICAgICAgICB2YXIgeExhYmVsTWFyZ2luID0gKHNpbiA/IHNpbiptYXhUZXh0V2lkdGggOiBtYXhUZXh0V2lkdGgpKzMwOworICAgICAgICAgICAgLy9Sb3RhdGUgYWxsIHhUaWNrcworICAgICAgICAgICAgeFRpY2tzCisgICAgICAgICAgICAgIC5hdHRyKCd0cmFuc2Zvcm0nLCBmdW5jdGlvbihkLGksaikgeyByZXR1cm4gJ3JvdGF0ZSgnICsgcm90YXRlTGFiZWxzICsgJyAwLDApJyB9KQorICAgICAgICAgICAgICAuYXR0cigndGV4dC1hbmNob3InLCByb3RhdGVMYWJlbHMlMzYwID4gMCA/ICdzdGFydCcgOiAnZW5kJyk7CisgICAgICAgICAgfQorICAgICAgICAgIGF4aXNMYWJlbC5lbnRlcigpLmFwcGVuZCgndGV4dCcpLmF0dHIoJ2NsYXNzJywgJ252LWF4aXNsYWJlbCcpOworICAgICAgICAgIHZhciB3ID0gKHNjYWxlLnJhbmdlKCkubGVuZ3RoPT0yKSA/IHNjYWxlLnJhbmdlKClbMV0gOiAoc2NhbGUucmFuZ2UoKVtzY2FsZS5yYW5nZSgpLmxlbmd0aC0xXSsoc2NhbGUucmFuZ2UoKVsxXS1zY2FsZS5yYW5nZSgpWzBdKSk7CisgICAgICAgICAgYXhpc0xhYmVsCisgICAgICAgICAgICAgIC5hdHRyKCd0ZXh0LWFuY2hvcicsICdtaWRkbGUnKQorICAgICAgICAgICAgICAuYXR0cigneScsIHhMYWJlbE1hcmdpbikKKyAgICAgICAgICAgICAgLmF0dHIoJ3gnLCB3LzIpOworICAgICAgICAgIGlmIChzaG93TWF4TWluKSB7CisgICAgICAgICAgLy9pZiAoc2hvd01heE1pbiAmJiAhaXNPcmRpbmFsKSB7CisgICAgICAgICAgICB2YXIgYXhpc01heE1pbiA9IHdyYXAuc2VsZWN0QWxsKCdnLm52LWF4aXNNYXhNaW4nKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8uZGF0YShzY2FsZS5kb21haW4oKSkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgIC5kYXRhKFtzY2FsZS5kb21haW4oKVswXSwgc2NhbGUuZG9tYWluKClbc2NhbGUuZG9tYWluKCkubGVuZ3RoIC0gMV1dKTsKKyAgICAgICAgICAgIGF4aXNNYXhNaW4uZW50ZXIoKS5hcHBlbmQoJ2cnKS5hdHRyKCdjbGFzcycsICdudi1heGlzTWF4TWluJykuYXBwZW5kKCd0ZXh0Jyk7CisgICAgICAgICAgICBheGlzTWF4TWluLmV4aXQoKS5yZW1vdmUoKTsKKyAgICAgICAgICAgIGF4aXNNYXhNaW4KKyAgICAgICAgICAgICAgICAuYXR0cigndHJhbnNmb3JtJywgZnVuY3Rpb24oZCxpKSB7CisgICAgICAgICAgICAgICAgICByZXR1cm4gJ3RyYW5zbGF0ZSgnICsgKHNjYWxlKGQpICsgKGlzT3JkaW5hbCA/IHNjYWxlLnJhbmdlQmFuZCgpIC8gMiA6IDApKSArICcsMCknCisgICAgICAgICAgICAgICAgfSkKKyAgICAgICAgICAgICAgLnNlbGVjdCgndGV4dCcpCisgICAgICAgICAgICAgICAgLmF0dHIoJ2R5JywgJy43MWVtJykKKyAgICAgICAgICAgICAgICAuYXR0cigneScsIGF4aXMudGlja1BhZGRpbmcoKSkKKyAgICAgICAgICAgICAgICAuYXR0cigndHJhbnNmb3JtJywgZnVuY3Rpb24oZCxpLGopIHsgcmV0dXJuICdyb3RhdGUoJyArIHJvdGF0ZUxhYmVscyArICcgMCwwKScgfSkKKyAgICAgICAgICAgICAgICAuYXR0cigndGV4dC1hbmNob3InLCByb3RhdGVMYWJlbHMgPyAocm90YXRlTGFiZWxzJTM2MCA+IDAgPyAnc3RhcnQnIDogJ2VuZCcpIDogJ21pZGRsZScpCisgICAgICAgICAgICAgICAgLnRleHQoZnVuY3Rpb24oZCxpKSB7CisgICAgICAgICAgICAgICAgICB2YXIgdiA9IGZtdChkKTsKKyAgICAgICAgICAgICAgICAgIHJldHVybiAoJycgKyB2KS5tYXRjaCgnTmFOJykgPyAnJyA6IHY7CisgICAgICAgICAgICAgICAgfSk7CisgICAgICAgICAgICBkMy50cmFuc2l0aW9uKGF4aXNNYXhNaW4pCisgICAgICAgICAgICAgICAgLmF0dHIoJ3RyYW5zZm9ybScsIGZ1bmN0aW9uKGQsaSkgeworICAgICAgICAgICAgICAgICAgLy9yZXR1cm4gJ3RyYW5zbGF0ZSgnICsgc2NhbGUucmFuZ2UoKVtpXSArICcsMCknCisgICAgICAgICAgICAgICAgICAvL3JldHVybiAndHJhbnNsYXRlKCcgKyBzY2FsZShkKSArICcsMCknCisgICAgICAgICAgICAgICAgICByZXR1cm4gJ3RyYW5zbGF0ZSgnICsgKHNjYWxlKGQpICsgKGlzT3JkaW5hbCA/IHNjYWxlLnJhbmdlQmFuZCgpIC8gMiA6IDApKSArICcsMCknCisgICAgICAgICAgICAgICAgfSk7CisgICAgICAgICAgfQorICAgICAgICAgIGlmIChzdGFnZ2VyTGFiZWxzKQorICAgICAgICAgICAgeFRpY2tzCisgICAgICAgICAgICAgICAgLmF0dHIoJ3RyYW5zZm9ybScsIGZ1bmN0aW9uKGQsaSkgeyByZXR1cm4gJ3RyYW5zbGF0ZSgwLCcgKyAoaSAlIDIgPT0gMCA/ICcwJyA6ICcxMicpICsgJyknIH0pOworCisgICAgICAgICAgYnJlYWs7CisgICAgICAgIGNhc2UgJ3JpZ2h0JzoKKyAgICAgICAgICBheGlzTGFiZWwuZW50ZXIoKS5hcHBlbmQoJ3RleHQnKS5hdHRyKCdjbGFzcycsICdudi1heGlzbGFiZWwnKTsKKyAgICAgICAgICBheGlzTGFiZWwKKyAgICAgICAgICAgICAgLmF0dHIoJ3RleHQtYW5jaG9yJywgcm90YXRlWUxhYmVsID8gJ21pZGRsZScgOiAnYmVnaW4nKQorICAgICAgICAgICAgICAuYXR0cigndHJhbnNmb3JtJywgcm90YXRlWUxhYmVsID8gJ3JvdGF0ZSg5MCknIDogJycpCisgICAgICAgICAgICAgIC5hdHRyKCd5Jywgcm90YXRlWUxhYmVsID8gKC1NYXRoLm1heChtYXJnaW4ucmlnaHQsd2lkdGgpICsgMTIpIDogLTEwKSAvL1RPRE86IGNvbnNpZGVyIGNhbGN1bGF0aW5nIHRoaXMgYmFzZWQgb24gbGFyZ2VzdCB0aWNrIHdpZHRoLi4uIE9SIGF0IGxlYXN0IGV4cG9zZSB0aGlzIG9uIGNoYXJ0CisgICAgICAgICAgICAgIC5hdHRyKCd4Jywgcm90YXRlWUxhYmVsID8gKHNjYWxlLnJhbmdlKClbMF0gLyAyKSA6IGF4aXMudGlja1BhZGRpbmcoKSk7CisgICAgICAgICAgaWYgKHNob3dNYXhNaW4pIHsKKyAgICAgICAgICAgIHZhciBheGlzTWF4TWluID0gd3JhcC5zZWxlY3RBbGwoJ2cubnYtYXhpc01heE1pbicpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAuZGF0YShzY2FsZS5kb21haW4oKSk7CisgICAgICAgICAgICBheGlzTWF4TWluLmVudGVyKCkuYXBwZW5kKCdnJykuYXR0cignY2xhc3MnLCAnbnYtYXhpc01heE1pbicpLmFwcGVuZCgndGV4dCcpCisgICAgICAgICAgICAgICAgLnN0eWxlKCdvcGFjaXR5JywgMCk7CisgICAgICAgICAgICBheGlzTWF4TWluLmV4aXQoKS5yZW1vdmUoKTsKKyAgICAgICAgICAgIGF4aXNNYXhNaW4KKyAgICAgICAgICAgICAgICAuYXR0cigndHJhbnNmb3JtJywgZnVuY3Rpb24oZCxpKSB7CisgICAgICAgICAgICAgICAgICByZXR1cm4gJ3RyYW5zbGF0ZSgwLCcgKyBzY2FsZShkKSArICcpJworICAgICAgICAgICAgICAgIH0pCisgICAgICAgICAgICAgIC5zZWxlY3QoJ3RleHQnKQorICAgICAgICAgICAgICAgIC5hdHRyKCdkeScsICcuMzJlbScpCisgICAgICAgICAgICAgICAgLmF0dHIoJ3knLCAwKQorICAgICAgICAgICAgICAgIC5hdHRyKCd4JywgYXhpcy50aWNrUGFkZGluZygpKQorICAgICAgICAgICAgICAgIC5hdHRyKCd0ZXh0LWFuY2hvcicsICdzdGFydCcpCisgICAgICAgICAgICAgICAgLnRleHQoZnVuY3Rpb24oZCxpKSB7CisgICAgICAgICAgICAgICAgICB2YXIgdiA9IGZtdChkKTsKKyAgICAgICAgICAgICAgICAgIHJldHVybiAoJycgKyB2KS5tYXRjaCgnTmFOJykgPyAnJyA6IHY7CisgICAgICAgICAgICAgICAgfSk7CisgICAgICAgICAgICBkMy50cmFuc2l0aW9uKGF4aXNNYXhNaW4pCisgICAgICAgICAgICAgICAgLmF0dHIoJ3RyYW5zZm9ybScsIGZ1bmN0aW9uKGQsaSkgeworICAgICAgICAgICAgICAgICAgcmV0dXJuICd0cmFuc2xhdGUoMCwnICsgc2NhbGUucmFuZ2UoKVtpXSArICcpJworICAgICAgICAgICAgICAgIH0pCisgICAgICAgICAgICAgIC5zZWxlY3QoJ3RleHQnKQorICAgICAgICAgICAgICAgIC5zdHlsZSgnb3BhY2l0eScsIDEpOworICAgICAgICAgIH0KKyAgICAgICAgICBicmVhazsKKyAgICAgICAgY2FzZSAnbGVmdCc6CisgICAgICAgICAgLyoKKyAgICAgICAgICAvL0ZvciBkeW5hbWljYWxseSBwbGFjaW5nIHRoZSBsYWJlbC4gQ2FuIGJlIHVzZWQgd2l0aCBkeW5hbWljYWxseS1zaXplZCBjaGFydCBheGlzIG1hcmdpbnMKKyAgICAgICAgICB2YXIgeVRpY2tzID0gZy5zZWxlY3RBbGwoJ2cnKS5zZWxlY3QoInRleHQiKTsKKyAgICAgICAgICB5VGlja3MuZWFjaChmdW5jdGlvbihkLGkpeworICAgICAgICAgICAgdmFyIGxhYmVsUGFkZGluZyA9IHRoaXMuZ2V0QkJveCgpLndpZHRoICsgYXhpcy50aWNrUGFkZGluZygpICsgMTY7CisgICAgICAgICAgICBpZihsYWJlbFBhZGRpbmcgPiB3aWR0aCkgd2lkdGggPSBsYWJlbFBhZGRpbmc7CisgICAgICAgICAgfSk7CisgICAgICAgICAgKi8KKyAgICAgICAgICBheGlzTGFiZWwuZW50ZXIoKS5hcHBlbmQoJ3RleHQnKS5hdHRyKCdjbGFzcycsICdudi1heGlzbGFiZWwnKTsKKyAgICAgICAgICBheGlzTGFiZWwKKyAgICAgICAgICAgICAgLmF0dHIoJ3RleHQtYW5jaG9yJywgcm90YXRlWUxhYmVsID8gJ21pZGRsZScgOiAnZW5kJykKKyAgICAgICAgICAgICAgLmF0dHIoJ3RyYW5zZm9ybScsIHJvdGF0ZVlMYWJlbCA/ICdyb3RhdGUoLTkwKScgOiAnJykKKyAgICAgICAgICAgICAgLmF0dHIoJ3knLCByb3RhdGVZTGFiZWwgPyAoLU1hdGgubWF4KG1hcmdpbi5sZWZ0LHdpZHRoKSArIDEyKSA6IC0xMCkgLy9UT0RPOiBjb25zaWRlciBjYWxjdWxhdGluZyB0aGlzIGJhc2VkIG9uIGxhcmdlc3QgdGljayB3aWR0aC4uLiBPUiBhdCBsZWFzdCBleHBvc2UgdGhpcyBvbiBjaGFydAorICAgICAgICAgICAgICAuYXR0cigneCcsIHJvdGF0ZVlMYWJlbCA/ICgtc2NhbGUucmFuZ2UoKVswXSAvIDIpIDogLWF4aXMudGlja1BhZGRpbmcoKSk7CisgICAgICAgICAgaWYgKHNob3dNYXhNaW4pIHsKKyAgICAgICAgICAgIHZhciBheGlzTWF4TWluID0gd3JhcC5zZWxlY3RBbGwoJ2cubnYtYXhpc01heE1pbicpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAuZGF0YShzY2FsZS5kb21haW4oKSk7CisgICAgICAgICAgICBheGlzTWF4TWluLmVudGVyKCkuYXBwZW5kKCdnJykuYXR0cignY2xhc3MnLCAnbnYtYXhpc01heE1pbicpLmFwcGVuZCgndGV4dCcpCisgICAgICAgICAgICAgICAgLnN0eWxlKCdvcGFjaXR5JywgMCk7CisgICAgICAgICAgICBheGlzTWF4TWluLmV4aXQoKS5yZW1vdmUoKTsKKyAgICAgICAgICAgIGF4aXNNYXhNaW4KKyAgICAgICAgICAgICAgICAuYXR0cigndHJhbnNmb3JtJywgZnVuY3Rpb24oZCxpKSB7CisgICAgICAgICAgICAgICAgICByZXR1cm4gJ3RyYW5zbGF0ZSgwLCcgKyBzY2FsZTAoZCkgKyAnKScKKyAgICAgICAgICAgICAgICB9KQorICAgICAgICAgICAgICAuc2VsZWN0KCd0ZXh0JykKKyAgICAgICAgICAgICAgICAuYXR0cignZHknLCAnLjMyZW0nKQorICAgICAgICAgICAgICAgIC5hdHRyKCd5JywgMCkKKyAgICAgICAgICAgICAgICAuYXR0cigneCcsIC1heGlzLnRpY2tQYWRkaW5nKCkpCisgICAgICAgICAgICAgICAgLmF0dHIoJ3RleHQtYW5jaG9yJywgJ2VuZCcpCisgICAgICAgICAgICAgICAgLnRleHQoZnVuY3Rpb24oZCxpKSB7CisgICAgICAgICAgICAgICAgICB2YXIgdiA9IGZtdChkKTsKKyAgICAgICAgICAgICAgICAgIHJldHVybiAoJycgKyB2KS5tYXRjaCgnTmFOJykgPyAnJyA6IHY7CisgICAgICAgICAgICAgICAgfSk7CisgICAgICAgICAgICBkMy50cmFuc2l0aW9uKGF4aXNNYXhNaW4pCisgICAgICAgICAgICAgICAgLmF0dHIoJ3RyYW5zZm9ybScsIGZ1bmN0aW9uKGQsaSkgeworICAgICAgICAgICAgICAgICAgcmV0dXJuICd0cmFuc2xhdGUoMCwnICsgc2NhbGUucmFuZ2UoKVtpXSArICcpJworICAgICAgICAgICAgICAgIH0pCisgICAgICAgICAgICAgIC5zZWxlY3QoJ3RleHQnKQorICAgICAgICAgICAgICAgIC5zdHlsZSgnb3BhY2l0eScsIDEpOworICAgICAgICAgIH0KKyAgICAgICAgICBicmVhazsKKyAgICAgIH0KKyAgICAgIGF4aXNMYWJlbAorICAgICAgICAgIC50ZXh0KGZ1bmN0aW9uKGQpIHsgcmV0dXJuIGQgfSk7CisKKworICAgICAgaWYgKHNob3dNYXhNaW4gJiYgKGF4aXMub3JpZW50KCkgPT09ICdsZWZ0JyB8fCBheGlzLm9yaWVudCgpID09PSAncmlnaHQnKSkgeworICAgICAgICAvL2NoZWNrIGlmIG1heCBhbmQgbWluIG92ZXJsYXAgb3RoZXIgdmFsdWVzLCBpZiBzbywgaGlkZSB0aGUgdmFsdWVzIHRoYXQgb3ZlcmxhcAorICAgICAgICBnLnNlbGVjdEFsbCgnZycpIC8vIHRoZSBnJ3Mgd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eScsIGZ1bmN0aW9uKGQsaSkgeyByZXR1cm4gIWkgPyAxIDogMCB9KTsKKworICAgICAgfQorCisgICAgICBpZiAoc2hvd01heE1pbiAmJiAoYXhpcy5vcmllbnQoKSA9PT0gJ3RvcCcgfHwgYXhpcy5vcmllbnQoKSA9PT0gJ2JvdHRvbScpKSB7CisgICAgICAgIHZhciBtYXhNaW5SYW5nZSA9IFtdOworICAgICAgICB3cmFwLnNlbGVjdEFsbCgnZy5udi1heGlzTWF4TWluJykKKyAgICAgICAgICAgIC5lYWNoKGZ1bmN0aW9uKGQsaSkgeworICAgICAgICAgICAgICB0cnkgeworICAgICAgICAgICAgICAgICAgaWYgKGkpIC8vIGk9PSAxLCBtYXggcG9zaXRpb24KKyAgICAgICAgICAgICAgICAgICAgICBtYXhNaW5SYW5nZS5wdXNoKHNjYWxlKGQpIC0gdGhpcy5nZXRCQm94KCkud2lkdGggLSA0KSAgLy9hc3N1bWluZyB0aGUgbWF4IGFuZCBtaW4gbGFiZWxzIGFyZSBhcyB3aWRlIGFzIHRoZSBuZXh0IHRpY2sgKHdpdGggYW4gZXh0cmEgNCBwaXhlbHMganVzdCBpbiBjYXNlKQorICAgICAgICAgICAgICAgICAgZWxzZSAvLyBpPT0wLCBtaW4gcG9zaXRpb24KKyAgICAgICAgICAgICAgICAgICAgICBtYXhNaW5SYW5nZS5wdXNoKHNjYWxlKGQpICsgdGhpcy5nZXRCQm94KCkud2lkdGggKyA0KQorICAgICAgICAgICAgICB9Y2F0Y2ggKGVycikgeworICAgICAgICAgICAgICAgICAgaWYgKGkpIC8vIGk9PSAxLCBtYXggcG9zaXRpb24KKyAgICAgICAgICAgICAgICAgICAgICBtYXhNaW5SYW5nZS5wdXNoKHNjYWxlKGQpIC0gNCkgIC8vYXNzdW1pbmcgdGhlIG1heCBhbmQgbWluIGxhYmVscyBhcmUgYXMgd2lkZSBhcyB0aGUgbmV4dCB0aWNrICh3aXRoIGFuIGV4dHJhIDQgcGl4ZWxzIGp1c3QgaW4gY2FzZSkKKyAgICAgICAgICAgICAgICAgIGVsc2UgLy8gaT09MCwgbWluIHBvc2l0aW9uCisgICAgICAgICAgICAgICAgICAgICAgbWF4TWluUmFuZ2UucHVzaChzY2FsZShkKSArIDQpCisgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0pOworICAgICAgICBnLnNlbGVjdEFsbCgnZycpIC8vIHRoZSBnJ3Mgd3JhcHBpbmcgZWFjaCB0aWNrCisgICAgICAgICAgICAuZWFjaChmdW5jdGlvbihkLGkpIHsKKyAgICAgICAgICAgICAgaWYgKHNjYWxlKGQpIDwgbWF4TWluUmFuZ2VbMF0gfHwgc2NhbGUoZCkgPiBtYXhNaW5SYW5nZVsxXSkgeworICAgICAgICAgICAgICAgIGlmIChkID4gMWUtMTAgfHwgZCA8IC0xZS0xMCkgLy8gYWNjb3VudHMgZm9yIG1pbm9yIGZsb2F0aW5nIHBvaW50IGVycm9ycy4uLiB0aG91Z2ggY291bGQgYmUgcHJvYmxlbWF0aWMgaWYgdGhlIHNjYWxlIGlzIEVYVFJFTUVMWSBTTUFMTAorICAgICAgICAgICAgICAgICAgZDMuc2VsZWN0KHRoaXMpLnJlbW92ZSgpOworICAgICAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgICAgICAgIGQzLnNlbGVjdCh0aGlzKS5zZWxlY3QoJ3RleHQnKS5yZW1vdmUoKTsgLy8gRG9uJ3QgcmVtb3ZlIHRoZSBaRVJPIGxpbmUhIQorICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9KTsKKyAgICAgIH0KKworCisgICAgICAvL2hpZ2hsaWdodCB6ZXJvIGxpbmUgLi4uIE1heWJlIHNob3VsZCBub3QgYmUgYW4gb3B0aW9uIGFuZCBzaG91bGQganVzdCBiZSBpbiBDU1M/CisgICAgICBpZiAoaGlnaGxpZ2h0WmVybykKKyAgICAgICAgZy5zZWxlY3RBbGwoJy50aWNrJykKKyAgICAgICAgICAuZmlsdGVyKGZ1bmN0aW9uKGQpI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AgKyAnKScpOworCisgICAgICAvLy0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLQorCisKKworICAgICAgdmFyIHcwID0gZnVuY3Rpb24oZCkgeyByZXR1cm4gTWF0aC5hYnMoeDAoZCkgLSB4MCgwKSkgfSwgLy8gVE9ETzogY291bGQgb3B0aW1pemUgYnkgcHJlY2FsY3VsYXRpbmcgeDAoMCkgYW5kIHgxKDApCisgICAgICAgICAgdzEgPSBmdW5jdGlvbihkKSB7IHJldHVybiBNYXRoLmFicyh4MShkKSAtIHgxKDApKSB9OworICAgICAgdmFyIHhwMCA9IGZ1bmN0aW9uKGQpIHsgcmV0dXJuIGQgPCAwID8geDAoZCkgOiB4MCgwKSB9LAorICAgICAgICAgIHhwMSA9IGZ1bmN0aW9uKGQpIHsgcmV0dXJuIGQgPCAwID8geDEoZCkgOiB4MSgwKSB9OworCisKKyAgICAgIGcuc2VsZWN0KCdyZWN0Lm52LXJhbmdlTWF4JykKKyAgICAgICAgICAuYXR0cignaGVpZ2h0JywgYXZhaWxhYmxlSGVpZ2h0KQorICAgICAgICAgIC5hdHRyKCd3aWR0aCcsIHcxKHJhbmdlTWF4ID4gMCA/IHJhbmdlTWF4IDogcmFuZ2VNaW4pKQorICAgICAgICAgIC5hdHRyKCd4JywgeHAxKHJhbmdlTWF4ID4gMCA/IHJhbmdlTWF4IDogcmFuZ2VNaW4pKQorICAgICAgICAgIC5kYXR1bShyYW5nZU1heCA+IDAgPyByYW5nZU1heCA6IHJhbmdlTWluKQorICAgICAgICAgIC8qCisgICAgICAgICAgLmF0dHIoJ3gnLCByYW5nZU1pbiA8IDAgPworICAgICAgICAgICAgICAgICAgICAgICAgIHJhbmdlTWF4ID4gMCA/CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHgxKHJhbmdlTWluKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgOiB4MShyYW5nZU1heCkKKyAgICAgICAgICAgICAgICAgICAgICAgOiB4MSgwKSkKKyAgICAgICAgICAgICAgICAgICAgICAqLworCisgICAgICBnLnNlbGVjdCgncmVjdC5udi1yYW5nZUF2ZycpCisgICAgICAgICAgLmF0dHIoJ2hlaWdodCcsIGF2YWlsYWJsZUhlaWdodCkKKyAgICAgICAgICAuYXR0cignd2lkdGgnLCB3MShyYW5nZUF2ZykpCisgICAgICAgICAgLmF0dHIoJ3gnLCB4cDEocmFuZ2VBdmcpKQorICAgICAgICAgIC5kYXR1bShyYW5nZUF2ZykKKyAgICAgICAgICAvKgorICAgICAgICAgIC5hdHRyKCd3aWR0aCcsIHJhbmdlTWF4IDw9IDAgPworICAgICAgICAgICAgICAgICAgICAgICAgICAgICB4MShyYW5nZU1heCkgLSB4MShyYW5nZUF2ZykKKyAgICAgICAgICAgICAgICAgICAgICAgICAgIDogeDEocmFuZ2VBdmcpIC0geDEocmFuZ2VNaW4pKQorICAgICAgICAgIC5hdHRyKCd4JywgcmFuZ2VNYXggPD0gMCA/CisgICAgICAgICAgICAgICAgICAgICAgICAgeDEocmFuZ2VBdmcpCisgICAgICAgICAgICAgICAgICAgICAgIDogeDEocmFuZ2VNaW4pKQorICAgICAgICAgICAgICAgICAgICAgICovCisKKyAgICAgIGcuc2VsZWN0KCdyZWN0Lm52LXJhbmdlTWluJykKKyAgICAgICAgICAuYXR0cignaGVpZ2h0JywgYXZhaWxhYmxlSGVpZ2h0KQorICAgICAgICAgIC5hdHRyKCd3aWR0aCcsIHcxKHJhbmdlTWF4KSkKKyAgICAgICAgICAuYXR0cigneCcsIHhwMShyYW5nZU1heCkpCisgICAgICAgICAgLmF0dHIoJ3dpZHRoJywgdzEocmFuZ2VNYXggPiAwID8gcmFuZ2VNaW4gOiByYW5nZU1heCkpCisgICAgICAgICAgLmF0dHIoJ3gnLCB4cDEocmFuZ2VNYXggPiAwID8gcmFuZ2VNaW4gOiByYW5nZU1heCkpCisgICAgICAgICAgLmRhdHVtKHJhbmdlTWF4ID4gMCA/IHJhbmdlTWluIDogcmFuZ2VNYXgpCisgICAgICAgICAgLyoKKyAgICAgICAgICAuYXR0cignd2lkdGgnLCByYW5nZU1heCA8PSAwID8KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgeDEocmFuZ2VBdmcpIC0geDEocmFuZ2VNaW4pCisgICAgICAgICAgICAgICAgICAgICAgICAgICA6IHgxKHJhbmdlTWF4KSAtIHgxKHJhbmdlQXZnKSkKKyAgICAgICAgICAuYXR0cigneCcsIHJhbmdlTWF4IDw9IDAgPworICAgICAgICAgICAgICAgICAgICAgICAgIHgxKHJhbmdlTWluKQorICAgICAgICAgICAgICAgICAgICAgICA6IHgxKHJhbmdlQXZnKSkKKyAgICAgICAgICAgICAgICAgICAgICAqLworCisgICAgICBnLnNlbGVjdCgncmVjdC5udi1tZWFzdXJlJykKKyAgICAgICAgICAuc3R5bGUoJ2ZpbGwnLCBjb2xvcikKKyAgICAgICAgICAuYXR0cignaGVpZ2h0JywgYXZhaWxhYmxlSGVpZ2h0IC8gMykKKyAgICAgICAgICAuYXR0cigneScsIGF2YWlsYWJsZUhlaWdodCAvIDMpCisgICAgICAgICAgLmF0dHIoJ3dpZHRoJywgbWVhc3VyZXogPCAwID8KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgeDEoMCkgLSB4MShtZWFzdXJlelswXSkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgIDogeDEobWVhc3VyZXpbMF0pIC0geDEoMCkpCisgICAgICAgICAgLmF0dHIoJ3gnLCB4cDEobWVhc3VyZXopKQorICAgICAgICAgIC5vbignbW91c2VvdmVyJywgZnVuY3Rpb24oKSB7CisgICAgICAgICAgICAgIGRpc3BhdGNoLmVsZW1lbnRNb3VzZW92ZXIoeworICAgICAgICAgICAgICAgIHZhbHVlOiBtZWFzdXJlelswXSwKKyAgICAgICAgICAgICAgICBsYWJlbDogJ0N1cnJlbnQnLAorICAgICAgICAgICAgICAgIHBvczogW3gxKG1lYXN1cmV6WzBdKSwgYXZhaWxhYmxlSGVpZ2h0LzJdCisgICAgICAgICAgICAgIH0pCisgICAgICAgICAgfSkKKyAgICAgICAgICAub24oJ21vdXNlb3V0JywgZnVuY3Rpb24oKSB7CisgICAgICAgICAgICAgIGRpc3BhdGNoLmVsZW1lbnRNb3VzZW91dCh7CisgICAgICAgICAgICAgICAgdmFsdWU6IG1lYXN1cmV6WzBdLAorICAgICAgICAgICAgICAgIGxhYmVsOiAnQ3VycmVudCcKKyAgICAgICAgICAgICAgfSkKKyAgICAgICAgICB9KQorCisgICAgICB2YXIgaDMgPSAgYXZhaWxhYmxlSGVpZ2h0IC8gNjsKKyAgICAgIGlmIChtYXJrZXJ6WzBdKSB7CisgICAgICAgIGcuc2VsZWN0QWxsKCdwYXRoLm52LW1hcmtlclRyaWFuZ2xlJykKKyAgICAgICAgICAgIC5hdHRyKCd0cmFuc2Zvcm0nLCBmdW5jdGlvbihkKSB7IHJldHVybiAndHJhbnNsYXRlKCcgKyB4MShtYXJrZXJ6WzBdKSArICcsJyArIChhdmFpbGFibGVIZWlnaHQgLyAyKSArICcpJyB9KQorICAgICAgICAgICAgLmF0dHIoJ2QnLCAnTTAsJyArIGgzICsgJ0wnICsgaDMgKyAnLCcgKyAoLWgzKSArICcgJyArICgtaDMpICsgJywnICsgKC1oMykgKyAnWicpCisgICAgICAgICAgICAub24oJ21vdXNlb3ZlcicsIGZ1bmN0aW9uKCkgeworICAgICAgICAgICAgICBkaXNwYXRjaC5lbGVtZW50TW91c2VvdmVyKHsKKyAgICAgICAgICAgICAgICB2YWx1ZTogbWFya2VyelswXSwKKyAgICAgICAgICAgICAgICBsYWJlbDogJ1ByZXZpb3VzJywKKyAgICAgICAgICAgICAgICBwb3M6IFt4MShtYXJrZXJ6WzBdKSwgYXZhaWxhYmxlSGVpZ2h0LzJdCisgICAgICAgICAgICAgIH0pCisgICAgICAgICAgICB9KQorICAgICAgICAgICAgLm9uKCdtb3VzZW91dCcsIGZ1bmN0aW9uKCkgeworICAgICAgICAgICAgICBkaXNwYXRjaC5lbGVtZW50TW91c2VvdXQoeworICAgICAgICAgICAgICAgIHZhbHVlOiBtYXJrZXJ6WzBdLAorICAgICAgICAgICAgICAgIGxhYmVsOiAnUHJldmlvdXMnCisgICAgICAgICAgICAgIH0pCisgICAgICAgICAgICB9KTsKKyAgICAgIH0gZWxzZSB7CisgICAgICAgIGcuc2VsZWN0QWxsKCdwYXRoLm52LW1hcmtlclRyaWFuZ2xlJykucmVtb3ZlKCk7CisgICAgICB9CisKKworICAgICAgd3JhcC5zZWxlY3RBbGwoJy5udi1yYW5nZScpCisgICAgICAgICAgLm9uKCdtb3VzZW92ZXInLCBmdW5jdGlvbihkLGkpIHsKKyAgICAgICAgICAgIHZhciBsYWJlbCA9ICFpID8gIk1heGltdW0iIDogaSA9PSAxID8gIk1lYW4iIDogIk1pbmltdW0iOworCisgICAgICAgICAgICBkaXNwYXRjaC5lbGVtZW50TW91c2VvdmVyKHsKKyAgICAgICAgICAgICAgdmFsdWU6IGQsCisgICAgICAgICAgICAgIGxhYmVsOiBsYWJlbCwKKyAgICAgICAgICAgICAgcG9zOiBbeDEoZCksIGF2YWlsYWJsZUhlaWdodC8yXQorICAgICAgICAgICAgfSkKKyAgICAgICAgICB9KQorICAgICAgICAgIC5vbignbW91c2VvdXQnLCBmdW5jdGlvbihkLGkpIHsKKyAgICAgICAgICAgIHZhciBsYWJlbCA9ICFpID8gIk1heGltdW0iIDogaSA9PSAxID8gIk1lYW4iIDogIk1pbmltdW0iOworCisgICAgICAgICAgICBkaXNwYXRjaC5lbGVtZW50TW91c2VvdXQoeworICAgICAgICAgICAgICB2YWx1ZTogZCwKKyAgICAgICAgICAgICAgbGFiZWw6IGxhYmVsCisgICAgICAgICAgICB9KQorICAgICAgICAgIH0pCisKKy8qIC8vIFRISVMgSVMgVEhFIFBSRVZJT1VTIEJVTExFVCBJTVBMRU1FTlRBVElPTiwgV0lMTCBSRU1PVkUgU0hPUlRMWQorICAgICAgLy8gVXBkYXRlIHRoZSByYW5nZSByZWN0cy4KKyAgICAgIHZhciByYW5nZSA9IGcuc2VsZWN0QWxsKCdyZWN0Lm52LXJhbmdlJykKKyAgICAgICAgICAuZGF0YShyYW5nZXopOworCisgICAgICByYW5nZS5lbnRlcigpLmFwcGVuZCgncmVjdCcpCisgICAgICAgICAgLmF0dHIoJ2NsYXNzJywgZnVuY3Rpb24oZCwgaSkgeyByZXR1cm4gJ252LXJhbmdlIG52LXMnICsgaTsgfSkKKyAgICAgICAgICAuYXR0cignd2lkdGgnLCB3MCkKKyAgICAgICAgICAuYXR0cignaGVpZ2h0JywgYXZhaWxhYmxlSGVpZ2h0KQorICAgICAgICAgIC5hdHRyKCd4JywgcmV2ZXJzZSA/IHgwIDogMCkKKyAgICAgICAgICAub24oJ21vdXNlb3ZlcicsIGZ1bmN0aW9uKGQsaSkgeyAKKyAgICAgICAgICAgICAgZGlzcGF0Y2guZWxlbWVudE1vdXNlb3Zlcih7CisgICAgICAgICAgICAgICAgdmFsdWU6IGQsCisgICAgICAgICAgICAgICAgbGFiZWw6IChpIDw9IDApID8gJ01heGltdW0nIDogKGkgPiAxKSA/ICdNaW5pbXVtJyA6ICdNZWFuJywgLy9UT0RPOiBtYWtlIHRoZXNlIGxhYmVscyBhIHZhcmlhYmxlCisgICAgICAgICAgICAgICAgcG9zOiBbeDEoZCksIGF2YWlsYWJsZUhlaWdodC8yXQorICAgICAgICAgICAgICB9KQorICAgICAgICAgIH0pCisgICAgICAgICAgLm9uKCdtb3VzZW91dCcsIGZ1bmN0aW9uKGQsaSkgeyAKKyAgICAgICAgICAgICAgZGlzcGF0Y2guZWxlbWVudE1vdXNlb3V0KHsKKyAgICAgICAgICAgICAgICB2YWx1ZTogZCwKKyAgICAgICAgICAgICAgICBsYWJlbDogKGkgPD0gMCkgPyAnTWluaW11bScgOiAoaSA+PTEpID8gJ01heGltdW0nIDogJ01lYW4nIC8vVE9ETzogbWFrZSB0aGVzZSBsYWJlbHMgYSB2YXJpYWJsZQorICAgICAgICAgICAgICB9KQorICAgICAgICAgIH0pCisKKyAgICAgIGQzLnRyYW5zaXRpb24ocmFuZ2UpCisgICAgICAgICAgLmF0dHIoJ3gnLCByZXZlcnNlID8geDEgOiAwKQorICAgICAgICAgIC5hdHRyKCd3aWR0aCcsIHcxKQorICAgICAgICAgIC5hdHRyKCdoZWlnaHQnLCBhdmFpbGFibGVIZWlnaHQpOworCisKKyAgICAgIC8vIFVwZGF0ZSB0aGUgbWVhc3VyZSByZWN0cy4KKyAgICAgIHZhciBtZWFzdXJlID0gZy5zZWxlY3RBbGwoJ3JlY3QubnYtbWVhc3VyZScpCisgICAgICAgICAgLmRhdGEobWVhc3VyZXopOworCisgICAgICBtZWFzdXJlLmVudGVyKCkuYXBwZW5kKCdyZWN0JykKKyAgICAgICAgICAuYXR0cignY2xhc3MnLCBmdW5jdGlvbihkLCBpKSB7IHJldHVybiAnbnYtbWVhc3VyZSBudi1zJyArIGk7IH0pCisgICAgICAgICAgLnN0eWxlKCdmaWxsJywgZnVuY3Rpb24oZCxpKSB7IHJldHVybiBjb2xvcihkLGkgKSB9KQorICAgICAgICAgIC5hdHRyKCd3aWR0aCcsIHcwKQorICAgICAgICAgIC5hdHRyKCdoZWlnaHQnLCBhdmFpbGFibGVIZWlnaHQgLyAzKQorICAgICAgICAgIC5hdHRyKCd4JywgcmV2ZXJzZSA/IHgwIDogMCkKKyAgICAgICAgICAuYXR0cigneScsIGF2YWlsYWJsZUhlaWdodCAvIDMpCisgICAgICAgICAgLm9uKCdtb3VzZW92ZXInLCBmdW5jdGlvbihkKSB7IAorICAgICAgICAgICAgICBkaXNwYXRjaC5lbGVtZW50TW91c2VvdmVyKHsKKyAgICAgICAgICAgICAgICB2YWx1ZTogZCwKKyAgICAgICAgICAgICAgICBsYWJlbDogJ0N1cnJlbnQnLCAvL1RPRE86IG1ha2UgdGhlc2UgbGFiZWxzIGEgdmFyaWFibGUKKyAgICAgICAgICAgICAgICBwb3M6IFt4MShkKSwgYXZhaWxhYmxlSGVpZ2h0LzJdCisgICAgICAgICAgICAgIH0pCisgICAgICAgICAgfSkKKyAgICAgICAgICAub24oJ21vdXNlb3V0JywgZnVuY3Rpb24oZCkgeyAKKyAgICAgICAgICAgICAgZGlzcGF0Y2guZWxlbWVudE1vdXNlb3V0KHsKKyAgICAgICAgICAgICAgICB2YWx1ZTogZCwKKyAgICAgICAgICAgICAgICBsYWJlbDogJ0N1cnJlbnQnIC8vVE9ETzogbWFrZSB0aGVzZSBsYWJlbHMgYSB2YXJpYWJsZQorICAgICAgICAgICAgICB9KQorICAgICAgICAgIH0pCisKKyAgICAgIGQzLnRyYW5zaXRpb24obWVhc3VyZSkKKyAgICAgICAgICAuYXR0cignd2lkdGgnLCB3MSkKKyAgICAgICAgICAuYXR0cignaGVpZ2h0JywgYXZhaWxhYmxlSGVpZ2h0IC8gMykKKyAgICAgICAgICAuYXR0cigneCcsIHJldmVyc2UgPyB4MSA6IDApCisgICAgICAgICAgLmF0dHIoJ3knLCBhdmFpbGFibGVIZWlnaHQgLyAzKTsKKworCisKKyAgICAgIC8vIFVwZGF0ZSB0aGUgbWFya2VyIGxpbmVzLgorICAgICAgdmFyIG1hcmtlciA9IGcuc2VsZWN0QWxsKCdwYXRoLm52LW1hcmtlclRyaWFuZ2xlJykKKyAgICAgICAgICAuZGF0YShtYXJrZXJ6KTsKKworICAgICAgdmFyIGgzID0gIGF2YWlsYWJsZUhlaWdodCAvIDY7CisgICAgICBtYXJrZXIuZW50ZXIoKS5hcHBlbmQoJ3BhdGgnKQorICAgICAgICAgIC5hdHRyKCdjbGFzcycsICdudi1tYXJrZXJUcmlhbmdsZScpCisgICAgICAgICAgLmF0dHIoJ3RyYW5zZm9ybScsIGZ1bmN0aW9uKGQpIHsgcmV0dXJuICd0cmFuc2xhdGUoJyArIHgwKGQpICsgJywnICsgKGF2YWlsYWJsZUhlaWdodCAvIDIpICsgJyknIH0pCisgICAgICAgICAgLmF0dHIoJ2QnLCAnTTAsJyArIGgzICsgJ0wnICsgaDMgKyAnLCcgKyAoLWgzKSArICcgJyArICgtaDMpICsgJywnICsgKC1oMykgKyAnWicpCisgICAgICAgICAgLm9uKCdtb3VzZW92ZXInLCBmdW5jdGlvbihkLGkpIHsKKyAgICAgICAgICAgICAgZGlzcGF0Y2guZWxlbWVudE1vdXNlb3Zlcih7CisgICAgICAgICAgICAgICAgdmFsdWU6IGQsCisgICAgICAgICAgICAgICAgbGFiZWw6ICdQcmV2aW91cycsCisgICAgICAgICAgICAgICAgcG9zOiBbeDEoZCksIGF2YWlsYWJsZUhlaWdodC8yXQorICAgICAgICAgICAgICB9KQorICAgICAgICAgIH0pCisgICAgICAgICAgLm9uKCdtb3VzZW91dCcsIGZ1bmN0aW9uKGQsaSkgeworICAgICAgICAgICAgICBkaXNwYXRjaC5lbGVtZW50TW91c2VvdXQoeworICAgICAgICAgICAgICAgIHZhbHVlOiBkLAorICAgICAgICAgICAgICAgIGxhYmVsOiAnUHJldmlvdXMnCisgICAgICAgICAgICAgIH0pCisgICAgICAgICAgfSk7CisKKyAgICAgIGQzLnRyYW5zaXRpb24obWFya2VyKQorICAgICAgICAgIC5hdHRyKCd0cmFuc2Zvcm0nLCBmdW5jdGlvbihkKSB7IHJldHVybiAndHJhbnNsYXRlKCcgKyAoeDEoZCkgLSB4MSgwKSkgKyAnLCcgKyAoYXZhaWxhYmxlSGVpZ2h0IC8gMikgKyAnKScgfSk7CisKKyAgICAgIG1hcmtlci5leGl0KCkucmVtb3ZlKCk7CisqLworCisgICAgfSk7CisKKyAgICAvLyBkMy50aW1lci5mbHVzaCgpOyAgLy8gTm90IG5lZWRlZD8KKworICAgIHJldHVybiBjaGFydDsKKyAgfQorCisKKyAgLy89PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKyAgLy8gRXhwb3NlIFB1YmxpYyBWYXJpYWJsZXMKKyAgLy8tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t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gICAgaWYgKCFhcmd1bWVudHMubGVuZ3RoKSByZXR1cm4gY29sb3I7CisgICAgY29sb3IgPSBudi51dGlscy5nZXRDb2xvcihfKTsKKyAgICByZXR1cm4gY2hhcnQ7CisgIH07CisKKyAgLy89PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKworCisgIHJldHVybiBjaGFydDsKK307CisKKworCisvLyBDaGFydCBkZXNpZ24gYmFzZWQgb24gdGhlIHJlY29tbWVuZGF0aW9ucyBvZiBTdGVwaGVuIEZldy4gSW1wbGVtZW50YXRpb24KKy8vIGJhc2VkIG9uIHRoZSB3b3JrIG9mIENsaW50IEl2eSwgSmFtaWUgTG92ZSwgYW5kIEphc29uIERhdmllcy4KKy8vIGh0dHA6Ly9wcm9qZWN0cy5pbnN0YW50Y29nbml0aW9uLmNvbS9wcm90b3Zpcy9idWxsZXRjaGFydC8KK252Lm1vZGVscy5idWxsZXRDaGFydCA9IGZ1bmN0aW9uKCkgeworCisgIC8vPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisgIC8vIFB1YmxpYyBWYXJpYWJsZXMgd2l0aCBEZWZhdWx0IFNldHRpbmdzCisgIC8vLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tCisKKyAgdmFyIGJ1bGxldCA9IG52Lm1vZGVscy5idWxsZXQoKQorICAgIDsKKworICB2YXIgb3JpZW50ID0gJ2xlZnQnIC8vIFRPRE8gdG9wICYgYm90dG9tCisgICAgLCByZXZlcnNlID0gZmFsc2UKKyAgICAsIG1hcmdpbiA9IHt0b3A6IDUsIHJpZ2h0OiA0MCwgYm90dG9tOiAyMCwgbGVmdDogMTIwfQorICAgICwgcmFuZ2VzID0gZnVuY3Rpb24oZCkgeyByZXR1cm4gZC5yYW5nZXMgfQorICAgICwgbWFya2VycyA9IGZ1bmN0aW9uKGQpIHsgcmV0dXJuIGQubWFya2VycyB9CisgICAgLCBtZWFzdXJlcyA9IGZ1bmN0aW9uKGQpIHsgcmV0dXJuIGQubWVhc3VyZXMgfQorICAgICwgd2lkdGggPSBudWxsCisgICAgLCBoZWlnaHQgPSA1NQorICAgICwgdGlja0Zvcm1hdCA9IG51bGwKKyAgICAsIHRvb2x0aXBzID0gdHJ1ZQorICAgICwgdG9vbHRpcCA9IGZ1bmN0aW9uKGtleSwgeCwgeSwgZSwgZ3JhcGgpIHsKKyAgICAgICAgcmV0dXJuICc8aDM+JyArIHggKyAnPC9oMz4nICsKKyAgICAgICAgICAgICAgICc8cD4nICsgeSArICc8L3A+JworICAgICAgfQorICAgICwgbm9EYXRhID0gJ05vIERhdGEgQXZhaWxhYmxlLicKKyAgICAsIGRpc3BhdGNoID0gZDMuZGlzcGF0Y2goJ3Rvb2x0aXBTaG93JywgJ3Rvb2x0aXBIaWRlJykKKyAgICA7CisKKyAgLy89PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKworCisgIC8vPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisgIC8vIFByaXZhdGUgVmFyaWFibGVzCisgIC8vLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tCisKKyAgdmFyIHNob3dUb29sdGlwID0gZnVuY3Rpb24oZSwgb2Zmc2V0RWxlbWVudCkgeworICAgIHZhciBsZWZ0ID0gZS5wb3NbMF0gKyAoIG9mZnNldEVsZW1lbnQub2Zmc2V0TGVmdCB8fCAwICkgKyBtYXJnaW4ubGVmdCwKKyAgICAgICAgdG9wID0gZS5wb3NbMV0gKyAoIG9mZnNldEVsZW1lbnQub2Zmc2V0VG9wIHx8IDApICsgbWFyZ2luLnRvcCwKKyAgICAgICAgY29udGVudCA9IHRvb2x0aXAoZS5rZXksIGUubGFiZWwsIGUudmFsdWUsIGUsIGNoYXJ0KTsKKworICAgIG52LnRvb2x0aXAuc2hvdyhbbGVmdCwgdG9wXSwgY29udGVudCwgZS52YWx1ZSA8IDAgPyAnZScgOiAndycsIG51bGwsIG9mZnNldEVsZW1lbnQpOworICB9OworCisgIC8vPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisKKworICBmdW5jdGlvbiBjaGFydChzZWxlY3Rpb24pIHsKKyAgICBzZWxlY3Rpb24uZWFjaChmdW5jdGlvbihkLCBpKSB7CisgICAgICB2YXIgY29udGFpbmVyID0gZDMuc2VsZWN0KHRoaXMpOworCisgICAgICB2YXIgYXZhaWxhYmxlV2lkdGggPSAod2lkdGggIHx8IHBhcnNlSW50KGNvbnRhaW5lci5zdHlsZSgnd2lkdGgnKSkgfHwgOTYwKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAtIG1hcmdpbi5sZWZ0IC0gbWFyZ2luLnJpZ2h0LAorICAgICAgICAgIGF2YWlsYWJsZUhlaWdodCA9IGhlaWdodCAtIG1hcmdpbi50b3AgLSBtYXJnaW4uYm90dG9tLAorICAgICAgICAgIHRoYXQgPSB0aGlzOworCisKKyAgICAgIGNoYXJ0LnVwZGF0ZSA9IGZ1bmN0aW9uKCkgeyBjaGFydChzZWxlY3Rpb24pIH07CisgICAgICBjaGFydC5jb250YWluZXIgPSB0aGlzOworCisgICAgICAvLy0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLQorICAgICAgLy8gRGlzcGxheSBObyBEYXRhIG1lc3NhZ2UgaWYgdGhlcmUncyBub3RoaW5nIHRvIHNob3cuCisKKyAgICAgIGlmICghZCB8fCAhcmFuZ2VzLmNhbGwodGhpcywgZCwgaSkpIHsKKyAgICAgICAgdmFyIG5vRGF0YV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CisKKyAgICAgIC8vIFVwZGF0ZSB0aGUgdGljayBncm91cHMuCisgICAgICB2YXIgdGljayA9IGcuc2VsZWN0QWxsKCdnLm52LXRpY2snKQorICAgICAgICAgIC5kYXRhKHgxLnRpY2tzKCBhdmFpbGFibGVXaWR0aCAvIDUwICksIGZ1bmN0aW9uKGQpIHsKKyAgICAgICAgICAgIHJldHVybiB0aGlzLnRleHRDb250ZW50IHx8IGZvcm1hdChkKTsKKyAgICAgICAgICB9KTsKKworICAgICAgLy8gSW5pdGlhbGl6ZSB0aGUgdGlja3Mgd2l0aCB0aGUgb2xkIHNjYWxlLCB4MC4KKyAgICAgIHZhciB0aWNrRW50ZXIgPSB0aWNrLmVudGVyKCkuYXBwZW5kKCdnJykKKyAgICAgICAgICAuYXR0cignY2xhc3MnLCAnbnYtdGljaycpCisgICAgICAgICAgLmF0dHIoJ3RyYW5zZm9ybScsIGZ1bmN0aW9uKGQpIHsgcmV0dXJuICd0cmFuc2xhdGUoJyArIHgwKGQpICsgJywwKScgfSkKKyAgICAgICAgICAuc3R5bGUoJ29wYWNpdHknLCAxZS02KTsKKworICAgICAgdGlja0VudGVyLmFwcGVuZCgnbGluZScpCisgICAgICAgICAgLmF0dHIoJ3kxJywgYXZhaWxhYmxlSGVpZ2h0KQorICAgICAgICAgIC5hdHRyKCd5MicsIGF2YWlsYWJsZUhlaWdodCAqIDcgLyA2KTsKKworICAgICAgdGlja0VudGVyLmFwcGVuZCgndGV4dCcpCisgICAgICAgICAgLmF0dHIoJ3RleHQtYW5jaG9yJywgJ21pZGRsZScpCisgICAgICAgICAgLmF0dHIoJ2R5JywgJzFlbScpCisgICAgICAgICAgLmF0dHIoJ3knLCBhdmFpbGFibGVIZWlnaHQgKiA3IC8gNikKKyAgICAgICAgICAudGV4dChmb3JtYXQpOworCisKKyAgICAgIC8vIFRyYW5zaXRpb24gdGhlIHVwZGF0aW5nIHRpY2tzIHRvIHRoZSBuZXcgc2NhbGUsIHgxLgorICAgICAgdmFyIHRpY2tVcGRhdGUgPSBkMy50cmFuc2l0aW9uKHRpY2spCisgICAgICAgICAgLmF0dHIoJ3RyYW5zZm9ybScsIGZ1bmN0aW9uKGQpIHsgcmV0dXJuICd0cmFuc2xhdGUoJyArIHgxKGQpICsgJywwKScgfSkKKyAgICAgICAgICAuc3R5bGUoJ29wYWNpdHknLCAxKTsKKworICAgICAgdGlja1VwZGF0ZS5zZWxlY3QoJ2xpbmUnKQorICAgICAgICAgIC5hdHRyKCd5MScsIGF2YWlsYWJsZUhlaWdodCkKKyAgICAgICAgICAuYXR0cigneTInLCBhdmFpbGFibGVIZWlnaHQgKiA3IC8gNik7CisKKyAgICAgIHRpY2tVcGRhdGUuc2VsZWN0KCd0ZXh0JykKKyAgICAgICAgICAuYXR0cigneScsIGF2YWlsYWJsZUhlaWdodCAqIDcgLyA2KTsKKworICAgICAgLy8gVHJhbnNpdGlvbiB0aGUgZXhpdGluZyB0aWNrcyB0byB0aGUgbmV3IHNjYWxlLCB4MS4KKyAgICAgIGQzLnRyYW5zaXRpb24odGljay5leGl0KCkpCisgICAgICAgICAgLmF0dHIoJ3RyYW5zZm9ybScsIGZ1bmN0aW9uKGQpIHsgcmV0dXJuICd0cmFuc2xhdGUoJyArIHgxKGQpICsgJywwKScgfSkKKyAgICAgICAgICAuc3R5bGUoJ29wYWNpdHknLCAxZS02KQorICAgICAgICAgIC5yZW1vdmUoKTsKKworCisgICAgICAvLz09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorICAgICAgLy8gRXZlbnQgSGFuZGxpbmcvRGlzcGF0Y2hpbmcgKGluIGNoYXJ0J3Mgc2NvcGUpCisgICAgICAvLy0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLQorCisgICAgICBkaXNwYXRjaC5vbigndG9vbHRpcFNob3cnLCBmdW5jdGlvbihlKSB7CisgICAgICAgIGUua2V5ID0gZC50aXRsZTsKKyAgICAgICAgaWYgKHRvb2x0aXBzKSBzaG93VG9vbHRpcChlLCB0aGF0LnBhcmVudE5vZGUpOworICAgICAgfSk7CisKKyAgICAgIC8vPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisKKyAgICB9KTsKKworICAgIGQzLnRpbWVyLmZsdXNoKCk7CisKKyAgICByZXR1cm4gY2hhcnQ7CisgIH0KKworCisgIC8vPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisgIC8vIEV2ZW50IEhhbmRsaW5nL0Rpc3BhdGNoaW5nIChvdXQgb2YgY2hhcnQncyBzY29wZSkKKyAgLy8tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0KKworICBidWxsZXQuZGlzcGF0Y2gub24oJ2VsZW1lbnRNb3VzZW92ZXIudG9vbHRpcCcsIGZ1bmN0aW9uKGUpIHsKKyAgICBkaXNwYXRjaC50b29sdGlwU2hvdyhlKTsKKyAgfSk7CisKKyAgYnVsbGV0LmRpc3BhdGNoLm9uKCdlbGVtZW50TW91c2VvdXQudG9vbHRpcCcsIGZ1bmN0aW9uKGUpIHsKKyAgICBkaXNwYXRjaC50b29sdGlwSGlkZShlKTsKKyAgfSk7CisKKyAgZGlzcGF0Y2gub24oJ3Rvb2x0aXBIaWRlJywgZnVuY3Rpb24oKSB7CisgICAgaWYgKHRvb2x0aXBzKSBudi50b29sdGlwLmNsZWFudXAoKTsKKyAgfSk7CisKKyAgLy89PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKworCisgIC8vPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisgIC8vIEV4cG9zZSBQdWJsaWMgV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1bmN0aW9uKF8pIHsKKyAgICBpZiAoIWFyZ3VtZW50cy5sZW5ndGgpIHJldHVybiB0b29sdGlwczsKKyAgICB0b29sdGlwcyA9IF87CisgICAgcmV0dXJuIGNoYXJ0OworICB9OworCisgIGNoYXJ0LnRvb2x0aXBDb250ZW50ID0gZnVuY3Rpb24oXykgeworICAgIGlmICghYXJndW1lbnRzLmxlbmd0aCkgcmV0dXJuIHRvb2x0aXA7CisgICAgdG9vbHRpcCA9IF87CisgICAgcmV0dXJuIGNoYXJ0OworICB9OworCisgIGNoYXJ0Lm5vRGF0YSA9IGZ1bmN0aW9uKF8pIHsKKyAgICBpZiAoIWFyZ3VtZW50cy5sZW5ndGgpIHJldHVybiBub0RhdGE7CisgICAgbm9EYXRhID0gXzsKKyAgICByZXR1cm4gY2hhcnQ7CisgIH07CisKKyAgLy89PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKworCisgIHJldHVybiBjaGFydDsKK307CisKKworCitudi5tb2RlbHMuY3VtdWxhdGl2ZUxpbmVDaGFydCA9IGZ1bmN0aW9uKCkgeworCisgIC8vPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisgIC8vIFB1YmxpYyBWYXJpYWJsZXMgd2l0aCBEZWZhdWx0IFNldHRpbmdzCisgIC8vLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tCisKKyAgdmFyIGxpbmVzID0gbnYubW9kZWxzLmxpbmUoKQorICAgICwgeEF4aXMgPSBudi5tb2RlbHMuYXhpcygpCisgICAgLCB5QXhpcyA9IG52Lm1vZGVscy5heGlzKCkKKyAgICAsIGxlZ2VuZCA9IG52Lm1vZGVscy5sZWdlbmQoKQorICAgICwgY29udHJvbHMgPSBudi5tb2RlbHMubGVnZW5kKCkKKyAgICA7CisKKyAgdmFy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nKQorICAgIDsKKworICAvLz09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorCisKKyAgLy89PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKyAgLy8gUHJpdmF0ZSBWYXJpYWJsZXMKKyAgLy8tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0KKworICAgdmFyIGR4ID0gZDMuc2NhbGUubGluZWFyKCkKKyAgICAgLCBpbmRleCA9IHtpOiAwLCB4OiAwfQorICAgICA7CisKKyAgdmFyIHNob3dUb29sdGlwID0gZnVuY3Rpb24oZSwgb2Zmc2V0RWxlbWVudCkgeworICAgIHZhciBsZWZ0ID0gZS5wb3NbMF0gKyAoIG9mZnNldEVsZW1lbnQub2Zmc2V0TGVmdCB8fCAwICksCisgICAgICAgIHRvcCA9IGUucG9zWzFdICsgKCBvZmZzZXRFbGVtZW50Lm9mZnNldFRvcCB8fCAwKSwKKyAgICAgICAgeCA9IHhBeGlzLnRpY2tGb3JtYXQoKShsaW5lcy54KCkoZS5wb2ludCwgZS5wb2ludEluZGV4KSksCisgICAgICAgIHkgPSB5QXhpcy50aWNrRm9ybWF0KCkobGluZXMueSgpKGUucG9pbnQsIGUucG9pbnRJbmRleCkpLAorICAgICAgICBjb250ZW50ID0gdG9vbHRpcChlLnNlcmllcy5rZXksIHgsIHksIGUsIGNoYXJ0KTsKKworICAgIG52LnRvb2x0aXAuc2hvdyhbbGVmdCwgdG9wXSwgY29udGVudCwgbnVsbCwgbnVsbCwgb2Zmc2V0RWxlbWVudCk7CisgIH07CisKKy8qCisgIC8vTW92ZWQgdG8gc2VlIGlmIHdlIGNhbiBnZXQgYmV0dGVyIGJlaGF2aW9yIHRvIGZpeCBpc3N1ZSAjMzE1CisgIHZhciBpbmRleERyYWcgPSBkMy5iZWhhdmlvci5kcmFnKCkKKyAgICAgICAgICAgICAgICAgICAgLm9uKCdkcmFnc3RhcnQnLCBkcmFnU3RhcnQpCisgICAgICAgICAgICAgICAgICAgIC5vbignZHJhZycsIGRyYWdNb3ZlKQorICAgICAgICAgICAgICAgICAgICAub24oJ2RyYWdlbmQnLCBkcmFnRW5kKTsKKworICBmdW5jdGlvbiBkcmFnU3RhcnQoZCxpKSB7CisgICAgZDMuc2VsZWN0KGNoYXJ0LmNvbnRhaW5lcikKKyAgICAgICAgLnN0eWxlKCdjdXJzb3InLCAnZXctcmVzaXplJyk7CisgIH0KKworICBmdW5jdGlvbiBkcmFnTW92ZShkLGkpIHsKKyAgICBkLnggKz0gZDMuZXZlbnQuZHg7CisgICAgZC5pID0gTWF0aC5yb3VuZChkeC5pbnZlcnQoZC54KSk7CisKKyAgICBkMy5zZWxlY3QodGhpcykuYXR0cigndHJhbnNmb3JtJywgJ3RyYW5zbGF0ZSgnICsgZHgoZC5pKSArICcsMCknKTsKKyAgICBjaGFydC51cGRhdGUoKTsKKyAgfQorCisgIGZ1bmN0aW9uIGRyYWdFbmQoZCxpKSB7CisgICAgZDMuc2VsZWN0KGNoYXJ0LmNvbnRhaW5lcikKKyAgICAgICAgLnN0eWxlKCdjdXJzb3InLCAnYXV0bycpOworICAgIGNoYXJ0LnVwZGF0ZSgpOworICB9CisqLworCisgIC8vPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisKKworICBmdW5jdGlvbiBjaGFydChzZWxlY3Rpb24pIHsKKyAgICBzZWxlY3Rpb24uZWFjaChmdW5jdGlvbihkYXRhKSB7CisgICAgICB2YXIgY29udGFpbmVyID0gZDMuc2VsZWN0KHRoaXMpLmNsYXNzZWQoJ252LWNoYXJ0LScgKyBpZCwgdHJ1ZSksCisgICAgICAgICAgdGhhdCA9IHRoaXM7CisKKyAgICAgIHZhciBhdmFpbGFibGVXaWR0aCA9ICh3aWR0aCAgfHwgcGFyc2VJbnQoY29udGFpbmVyLnN0eWxlKCd3aWR0aCcpKSB8fCA5NjApCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC0gbWFyZ2luLmxlZnQgLSBtYXJnaW4ucmlnaHQsCisgICAgICAgICAgYXZhaWxhYmxlSGVpZ2h0ID0gKGhlaWdodCB8fCBwYXJzZUludChjb250YWluZXIuc3R5bGUoJ2hlaWdodCcpKSB8fCA0MDApCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC0gbWFyZ2luLnRvcCAtIG1hcmdpbi5ib3R0b207CisKKworICAgICAgY2hhcnQudXBkYXRlID0gZnVuY3Rpb24oKSB7IGNvbnRhaW5lci50cmFuc2l0aW9uKCkuY2FsbChjaGFydCkgfTsKKyAgICAgIGNoYXJ0LmNvbnRhaW5lciA9IHRoaXM7CisKKyAgICAgIC8vc2V0IHN0YXRlLmRpc2FibGVkCisgICAgICBzdGF0ZS5kaXNhYmxlZCA9IGRhdGEubWFwKGZ1bmN0aW9uKGQpIHsgcmV0dXJuICEhZC5kaXNhYmxlZCB9KTsKKworICAgICAgaWYgKCFkZWZhdWx0U3RhdGUpIHsKKyAgICAgICAgdmFyIGtleTsKKyAgICAgICAgZGVmYXVsdFN0YXRlID0ge307CisgICAgICAgIGZvciAoa2V5IGluIHN0YXRlKSB7CisgICAgICAgICAgaWYgKHN0YXRlW2tleV0gaW5zdGFuY2VvZiBBcnJheSkKKyAgICAgICAgICAgIGRlZmF1bHRTdGF0ZVtrZXldID0gc3RhdGVba2V5XS5zbGljZSgwKTsKKyAgICAgICAgICBlbHNlCisgICAgICAgICAgICBkZWZhdWx0U3RhdGVba2V5XSA9IHN0YXRlW2tleV07CisgICAgICAgIH0KKyAgICAgIH0KKworICAgICAgdmFyIGluZGV4RHJhZyA9IGQzLmJlaGF2aW9yLmRyYWcoKQorICAgICAgICAgICAgICAgICAgICAgICAgLm9uKCdkcmFnc3RhcnQnLCBkcmFnU3RhcnQpCisgICAgICAgICAgICAgICAgICAgICAgIC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bmd0aCkgeworICAgICAgICB2YXIgbm9EYXRhVGV4dCA9IGNvbnRhaW5lci5zZWxlY3RBbGwoJy5udi1ub0RhdGEnKS5kYXRhKFtub0RhdGFdKTsKKworICAgICAgICBub0RhdGFUZXh0LmVudGVyKCkuYXBwZW5kKCd0ZXh0JykKKyAgICAgICAgICAuYXR0cignY2xhc3MnLCAnbnZkMyBudi1ub0RhdGEnKQorICAgICAgICAgIC5hdHRyKCdkeScsICctLjdlbScpCisgICAgICAgICAgLnN0eWxlKCd0ZXh0LWFuY2hvcicsICdtaWRkbGUnKTsKKworICAgICAgICBub0RhdGFUZXh0CisgICAgICAgICAgLmF0dHIoJ3gnLCBtYXJnaW4ubGVmdCArIGF2YWlsYWJsZVdpZHRoIC8gMikKKyAgICAgICAgICAuYXR0cigneScsIG1hcmdpbi50b3AgKyBhdmFpbGFibGVIZWlnaHQgLyAyKQorICAgICAgICAgIC50ZXh0KGZ1bmN0aW9uKGQpIHsgcmV0dXJuIGQgfSk7CisKKyAgICAgICAgcmV0dXJuIGNoYXJ0OworICAgICAgfSBlbHNlIHsKKyAgICAgICAgY29udGFpbmVyLnNlbGVjdEFsbCgnLm52LW5vRGF0YScpLnJlbW92ZSgpOworICAgICAgfQorCisgICAgICAvLy0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLQorCisKKyAgICAgIC8vLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tCisgICAgICAvLyBTZXR1cCBTY2FsZXMKKworICAgICAgeCA9IGxpbmVzLnhTY2FsZSgpOworICAgICAgeSA9IGxpbmVzLnlTY2FsZSgpOworCisKKyAgICAgIGlmICghcmVzY2FsZVkpIHsKKyAgICAgICAgdmFyIHNlcmllc0RvbWFpbnMgPSBkYXRhCisgICAgICAgICAgLmZpbHRlcihmdW5jdGlvbihzZXJpZXMpIHsgcmV0dXJuICFzZXJpZXMuZGlzYWJsZWQgfSkKKyAgICAgICAgICAubWFwKGZ1bmN0aW9uKHNlcmllcyxpKSB7CisgICAgICAgICAgICB2YXIgaW5pdGlhbERvbWFpbiA9IGQzLmV4dGVudChzZXJpZXMudmFsdWVzLCBsaW5lcy55KCkpOworCisgICAgICAgICAgICAvL2FjY291bnQgZm9yIHNlcmllcyBiZWluZyBkaXNhYmxlZCB3aGVuIGxvc2luZyA5NSUgb3IgbW9yZQorICAgICAgICAgICAgaWYgKGluaXRpYWxEb21haW5bMF0gPCAtLjk1KSBpbml0aWFsRG9tYWluWzBdID0gLS45NTsKKworICAgICAgICAgICAgcmV0dXJuIFsKKyAgICAgICAgICAgICAgKGluaXRpYWxEb21haW5bMF0gLSBpbml0aWFsRG9tYWluWzFdKSAvICgxICsgaW5pdGlhbERvbWFpblsxXSksCisgICAgICAgICAgICAgIChpbml0aWFsRG9tYWluWzFdIC0gaW5pdGlhbERvbWFpblswXSkgLyAoMSArIGluaXRpYWxEb21haW5bMF0pCisgICAgICAgICAgICBdOworICAgICAgICAgIH0pOworCisgICAgICAgIHZhciBjb21wbGV0ZURvbWFpbiA9IFsKKyAgICAgICAgICBkMy5taW4oc2VyaWVzRG9tYWlucywgZnVuY3Rpb24oZCkgeyByZXR1cm4gZFswXSB9KSwKKyAgICAgICAgICBkMy5tYXgoc2VyaWVzRG9tYWlucywgZnVuY3Rpb24oZCkgeyByZXR1cm4gZFsxXSB9KQorICAgICAgICBdCisKKyAgICAgICAgbGluZXMueURvbWFpbihjb21wbGV0ZURvbWFpbik7CisgICAgICB9IGVsc2UgeworICAgICAgICBsaW5lcy55RG9tYWluKG51bGwpOworICAgICAgfQorCisKKyAgICAgIGR4ICAuZG9tYWluKFswLCBkYXRhWzBdLnZhbHVlcy5sZW5ndGggLSAxXSkgLy9Bc3N1bWVzIGFsbCBzZXJpZXMgaGF2ZSBzYW1lIGxlbmd0aAorICAgICAgICAgIC5yYW5nZSh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S0KKworCisgICAgICAvLy0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLQorICAgICAgLy8gQ29udHJvbHMKKworICAgICAgaWYgKHNob3dDb250cm9scykgeworICAgICAgICB2YXIgY29udHJvbHNEYXRhID0gWworICAgICAgICAgIHsga2V5OiAnUmUtc2NhbGUgeS1heGlzJywgZGlzYWJsZWQ6ICFyZXNjYWxlWSB9CisgICAgICAgIF07CisKKyAgICAgICAgY29udHJvbHMud2lkdGgoMTQwKS5jb2xvcihbJyM0NDQnLCAnIzQ0NCcsICcjNDQ0J10pOworICAgICAgICBnLnNlbGVjdCgnLm52LWNvbnRyb2xzV3JhcCcpCisgICAgICAgICAgICAuZGF0dW0oY29udHJvbHNEYXRhKQorICAgICAgICAgICAgLmF0dHIoJ3RyYW5zZm9ybScsICd0cmFuc2xhdGUoMCwnICsgKC1tYXJnaW4udG9wKSArJyknKQorICAgICAgICAgICAgLmNhbGwoY29udHJvbHMpOworICAgICAgfQorCisgICAgICAvLy0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLQorCisKKyAgICAgIHdyYXAuYXR0cigndHJhbnNmb3JtJywgJ3RyYW5zbGF0ZSgnICsgbWFyZ2luLmxlZnQgKyAnLCcgKyBtYXJnaW4udG9wICsgJyknKTsKKworCisgICAgICAvLyBTaG93IGVycm9yIGlmIHNlcmllcyBnb2VzIGJlbG93IDEwMCUKKyAgICAgIHZhciB0ZW1wRGlzYWJsZWQgPSBkYXRhLmZpbHRlcihmdW5jdGlvbihkKSB7IHJldHVybiBkLnRlbXBEaXNhYmxlZCB9KTsKKworICAgICAgd3JhcC5zZWxlY3QoJy50ZW1wRGlzYWJsZWQnKS5yZW1vdmUoKTsgLy9jbGVhbi11cCBhbmQgcHJldmVudCBkdXBsaWNhdGVzCisgICAgICBpZiAodGVt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hdmdMaW5lcy5lbnRlcigpCisgICAgICAgICAgICAgIC5hcHBlbmQoJ2xpbmUnKQorICAgICAgICAgICAgICAuc3R5bGUoJ3N0cm9rZS13aWR0aCcsMikKKyAgICAgICAgICAgICAgLnN0eWxlKCdzdHJva2UtZGFzaGFycmF5JywnMTAsMTAnKQorICAgICAgICAgICAgICAuc3R5bGUoJ3N0cm9rZScsZnVuY3Rpb24gKGQsaSkgeworICAgICAgICAgICAgICAgICAgcmV0dXJuIGxpbmVzLmNvbG9yKCkoZCxkLnNlcmllc0luZGV4KTsKKyAgICAgICAgICAgICAgfSkKKyAgICAgICAgICAgICAgLmF0dHIoJ3gxJywwKQorICAgICAgICAgICAgICAuYXR0cigneDInLGF2YWlsYWJsZVdpZHRoKQorICAgICAgICAgICAgICAuYXR0cigneTEnLCBmdW5jdGlvbihkKSB7IHJldHVybiB5KGF2ZXJhZ2UoZCkpOyB9KQorICAgICAgICAgICAgICAuYXR0cigneTInLCBmdW5jdGlvbihkKSB7IHJldHVybiB5KGF2ZXJhZ2UoZCkpOyB9KTsKKworICAgICAgYXZnTGluZXMKKyAgICAgICAgICAgICAgLmF0dHIoJ3gxJywwKQorICAgICAgICAgICAgICAuYXR0cigneDInLGF2YWlsYWJsZVdpZHRoKQorICAgICAgICAgICAgICAuYXR0cigneTEnLCBmdW5jdGlvbihkKSB7IHJldHVybiB5KGF2ZXJhZ2UoZCkpOyB9KQorICAgICAgICAgICAgICAuYXR0cigneTInLCBmdW5jdGlvbihkKSB7IHJldHVybiB5KGF2ZXJhZ2UoZCkpOyB9KTsKKworICAgICAgYXZnTGluZXMuZXhpdCgpLnJlbW92ZSgpOworCisgICAgICAvL0NyZWF0ZSBpbmRleCBsaW5lIC0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tCisKKyAgICAgIHZhciBpbmRleExpbmUgPSBsaW5lc1dyYXAuc2VsZWN0QWxsKCcubnYtaW5kZXhMaW5lJykKKyAgICAgIC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AgICAgZy5zZWxlY3QoJy5udi14Lm52LWF4aXMnKQorICAgICAgICAgIC5hdHRyKCd0cmFuc2Zvcm0nLCAndHJhbnNsYXRlKDAsJyArIHkucmFuZ2UoKVswXSArICcpJyk7CisgICAgICBkMy50cmFuc2l0aW9uKGcuc2VsZWN0KCcubnYteC5udi1heGlzJykpCisgICAgICAgICAgLmNhbGwoeEF4aXMpOworCisKKyAgICAgIHlBeGlzCisgICAgICAgIC5zY2FsZSh5KQorICAgICAgICAudGlja3MoIGF2YWlsYWJsZUhlaWdodCAvIDM2ICkKKyAgICAgICAgLnRpY2tTaXplKCAtYXZhaWxhYmxlV2lkdGgsIDApOworCisgICAgICBkMy50cmFuc2l0aW9uKGcuc2VsZWN0KCcubnYteS5udi1heGlzJykpCisgICAgICAgICAgLmNhbGwoeUF4aXMpOworCisgICAgICAvLy0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLQorCisKKyAgICAgIC8vPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisgICAgICAvLyBFdmVudCBIYW5kbGluZy9EaXNwYXRjaGluZyAoaW4gY2hhcnQncyBzY29wZSkKKyAgICAgIC8vLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tCisKKworICAgICAgZnVuY3Rpb24gdXBkYXRlWmVybygpIHsKKyAgICAgICAgaW5kZXhMaW5lCisgICAgICAgICAgLmRhdGEoW2luZGV4XSk7CisKKyAgICAgICAgY29udGFpbmVyLmNhbGwoY2hhcnQpOworICAgICAgfQorCisgICAgICBnLnNlbGVjdCgnLm52LWJhY2tncm91bmQgcmVjdCcpCisgICAgICAgICAgLm9uKCdjbGljaycsIGZ1bmN0aW9uKCkgeworICAgICAgICAgICAgaW5kZXgueCA9IGQzLm1vdXNlKH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gc3RhdGUuZGlzYWJsZWQgPSBlLmRpc2FibGVkOworICAgICAgICB9CisKKworICAgICAgICBpZiAodHlwZW9mIGUuaW5kZXggIT09ICd1bmRlZmluZWQnKSB7CisgICAgICAgICAgaW5kZXguaSA9IGUuaW5kZXg7CisgICAgICAgICAgaW5kZXgueCA9IGR4KGluZGV4LmkpOworCisgICAgICAgICAgc3RhdGUuaW5kZXggPSBlLmluZGV4OworCisgICAgICAgICAgaW5kZXhMaW5lCisgICAgICAgICAgICAuZGF0YShbaW5kZXhdKTsKKyAgICAgICAgfQorCisKKyAgICAgICAgaWYgKHR5cGVvZiBlLnJlc2NhbGVZICE9PSAndW5kZWZpbmVkJykgeworICAgICAgICAgIHJlc2NhbGVZID0gZS5yZXNjYWxlWTsKKyAgICAgICAgfQorCisgICAgICAgIGNoYXJ0LnVwZGF0ZSgpOworICAgICAgfSk7CisKKyAgICAgIC8vPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisKKyAgICB9KTsKKworICAgIHJldHVybiBjaGFydDsKKyAgfQorCisKKyAgLy89PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKyAgLy8gRXZlbnQgSGFuZGxpbmcvRGlzcGF0Y2hpbmcgKG91dCBvZiBjaGFydCdzIHNjb3BlKQorICAvLy0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLQorCisgIGxpbmVzLmRpc3BhdGNoLm9uKCdlbGVtZW50TW91c2VvdmVyLnRvb2x0aXAnLCBmdW5jdGlvbihlKSB7CisgICAgZS5wb3MgPSBbZS5wb3NbMF0gKyAgbWFyZ2luLmxlZnQsIGUucG9zWzFdICsgbWFyZ2luLnRvcF07CisgICAgZGlzcGF0Y2gudG9vbHRpcFNob3coZSk7CisgIH0pOworCisgIGxpbmVzLmRpc3BhdGNoLm9uKCdlbGVtZW50TW91c2VvdXQudG9vbHRpcCcsIGZ1bmN0aW9uKGUpIHsKKyAgICBkaXNwYXRjaC50b29sdGlwSGlkZShlKTsKKyAgfSk7CisKKyAgZGlzcGF0Y2gub24oJ3Rvb2x0aXBIaWRlJywgZnVuY3Rpb24oKSB7CisgICAgaWYgKHRvb2x0aXBzKSBudi50b29sdGlwLmNsZWFudXAoKTsKKyAgfSk7CisKKyAgLy89PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKworCisgIC8vPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisgIC8vIEV4cG9zZSBQdWJsaWMgVmFyaWFibGVzCisgIC8vLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tCisKKyAgLy8gZXhwb3NlIGNoYXJ0J3Mgc3ViLWNvbXBvbmVudHMKKyAgY2hhcnQuZGlzcGF0Y2ggPSBkaXNwYXRjaDsKKyAgY2hhcnQubGluZXMgPSBsaW5lczsKKyAgY2hhcnQubGVnZW5kID0gbGVnZW5kOworICBjaGFydC54QXhpcyA9IHhBeGlzOworICBjaGFydC55QXhpcyA9IHlBeGlzOworCisgIGQzLnJlYmluZChjaGFydCwgbGluZXMsICdkZWZpbmVkJywgJ2lzQXJlYScsICd4JywgJ3knLCAnc2l6ZScsICd4RG9tYWluJywgJ3lEb21haW4nLCAnZm9yY2VYJywgJ2ZvcmNlWScsICdpbnRlcmFjdGl2ZScsICdjbGlwRWRnZScsICdjbGlwVm9yb25vaScsICdpZCcpOworCisgIGNoYXJ0Lm1hcmdpbiA9IGZ1bmN0aW9uKF8pIHsKKyAgICBpZiAoIWFyZ3VtZW50cy5sZW5ndGgpIHJldHVybiBtYXJnaW47CisgICAgbWFyZ2luLnRvcCAgICA9IHR5cGVvZiBfLnRvc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XJ0LnNob3dDb250cm9scyA9IGZ1bmN0aW9uKF8pIHsKKyAgICBpZiAoIWFyZ3VtZW50cy5sZW5ndGgpIHJldHVybiBzaG93Q29udHJvbHM7CisgICAgc2hvd0NvbnRyb2xzID0gXzsKKyAgICByZXR1cm4gY2hhcnQ7CisgIH07CisKKyAgY2hhcnQuc2hvd0xlZ2VuZCA9IGZ1bmN0aW9uKF8pIHsKKyAgICBpZiAoIWFyZ3VtZW50cy5sZW5ndGgpIHJldHVybiBzaG93TGVnZW5kOworICAgIHNob3dMZWdlbmQgPSBfOworICAgIHJldHVybiBjaGFydDsKKyAgfTsKKworICBjaGFydC50b29sdGlwcyA9IGZ1bmN0aW9uKF8pIHsKKyAgICBpZiAoIWFyZ3VtZW50cy5sZW5ndGgpIHJldHVybiB0b29sdGlwczsKKyAgICB0b29sdGlwcyA9IF87CisgICAgcmV0dXJuIGNoYXJ0OworICB9OworCisgIGNoYXJ0LnRvb2x0aXBDb250ZW50ID0gZnVuY3Rpb24oXykgeworICAgIGlmICghYXJndW1lbnRzLmxlbmd0aCkgcmV0dXJuIHRvb2x0aXA7CisgICAgdG9vbHRpcCA9IF87CisgICAgcmV0dXJuIGNoYXJ0OworICB9OworCisgIGNoYXJ0LnN0YXRlID0gZnVuY3Rpb24oXykgeworICAgIGlmICghYXJndW1lbnRzLmxlbmd0aCkgcmV0dXJuIHN0YXRlOworICAgIHN0YXRlID0gXzsKKyAgICByZXR1cm4gY2hhcnQ7CisgIH07CisKKyAgY2hhcnQuZGVmYXVsdFN0YXRlID0gZnVuY3Rpb24oXykgeworICAgIGlmICghYXJndW1lbnRzLmxlbmd0aCkgcmV0dXJuIGRlZmF1bHRTdGF0ZTsKKyAgICBkZWZhdWx0U3RhdGUgPSBfOworICAgIHJldHVybiBjaGFydDsKKyAgfTsKKworICBjaGFydC5ub0RhdGEgPSBmdW5jdGlvbihfKSB7CisgICAgaWYgKCFhcmd1bWVudHMubGVuZ3RoKSByZXR1cm4gbm9EYXRhOworICAgIG5vRGF0YSA9IF87CisgICAgcmV0dXJuIGNoYXJ0OworICB9OworCisgIGNoYXJ0LmF2ZXJhZ2UgPSBmdW5jdGlvbihfKSB7CisgICAgIGlmKCFhcmd1bWVudHMubGVuZ3RoKSByZXR1cm4gYXZlcmFnZTsKKyAgICAgYXZlcmFnZSA9IF87CisgICAgIHJldHVybiBjaGFydDsKKyAgfTsKKworICAvLz09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorCisKKyAgLy89PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKyAgLy8gRnVuY3Rpb25zCisgIC8vLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tCisKKyAgLyogTm9ybWFsaXplIHRoZSBkYXRhIGFjY29yZGluZyB0byBhbiBpbmRleCBwb2ludC4gKi8KKyAgZnVuY3Rpb24gaW5kZXhpZnkoaWR4LCBkYXRhKSB7CisgICAgcmV0dXJuIGRhdGEubWFwKGZ1bmN0aW9uKGxpbmUsIGkpIHsKKyAgICAgIGlmICghbGluZS52YWx1ZXMpIHsKKyAgICAgICAgIHJldHVybiBsaW5lOworICAgICAgfQorICAgICAgdmFyIHYgPSBsaW5lcy55KCkobGluZS52YWx1ZXNbaWR4XSwgaWR4KTsKKworICAgICAgLy9UT0RPOiBpbXBsZW1lbnQgY2hlY2sgYmVsb3csIGFuZCBkaXNhYmxlIHNlcmllcyBpZiBzZXJpZXMgbG9zZXMgMTAwJSBvciBtb3JlIGNhdXNlIGRpdmlkZSBieSAwIGlzc3VlCisgICAgICBpZiAodiA8IC0uOTUpIHsKKyAgICAgICAgLy9pZiBhIHNlcmllcyBsb3NlcyBtb3JlIHRoYW4gMTAwJSwgY2FsY3VsYXRpb25zIGZhaWwuLiBhbnl0aGluZyBjbG9zZSBjYW4gY2F1c2UgbWFqb3IgZGlzdG9ydGlvbiAoYnV0IGlzIG1hdGhlbWF0aWNhbGx5IGNvcnJlY3QgdGlsbCBpdCBoaXRzIDEwMCkKKyAgICAgICAgbGluZS50ZW1wRGlzYWJsZWQgPSB0cnVlOworICAgICAgICByZXR1cm4gbGluZTsKKyAgICAgIH0KKworICAgICAgbGluZS50ZW1wRGlzYWJsZWQgPSBmYWxzZTsKKworICAgICAgbGluZS52YWx1ZXMgPSBsaW5lLnZhbHVlcy5tYXAoZnVuY3Rpb24ocG9pbnQsIHBvaW50SW5kZXgpIHsKKyAgICAgICAgcG9pbnQuZGlzcGxheSA9IHsneSc6IChsaW5lcy55KCkocG9pbnQsIHBvaW50SW5kZXgpIC0gdikgLyAoMSArIHYpIH07CisgICAgICAgIHJldHVybiBwb2ludDsKKyAgICAgIH0pCisKKyAgICAgIHJldHVybiBsaW5lOworICAgIH0pCisgIH0KKworICAvLz09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorCisKKyAgcmV0dXJuIGNoYXJ0OworfQorLy9UT0RPOiBjb25zaWRlciBkZXByZWNhdGluZyBieSBhZGRpbmcgbmVjZXNzYXJ5IGZlYXR1cmVzIHRvIG11bHRpQmFyIG1vZGVsCitudi5tb2RlbHMuZGlzY3JldGVCYXIgPSBmdW5jdGlvbigpIHsKKworICAvLz09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorICAvLyBQdWJsaWMgVmFyaWFibGVzIHdpdGggRGVmYXVsdCBTZXR0aW5ncworICAvLy0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLQorCisgIHZhciBtYXJnaW4gPSB7dG9wOiAwLCByaWdodDogMCwgYm90dG9tOiAwLCBsZWZ0OiAwfQorICAgICwgd2lkdGggPSA5NjAKKyAgICAsIGhlaWdodCA9IDUwMAorICAgICwgaWQgPSBNYXRoLmZsb29yKE1hdGgucmFuZG9tKCkgKiAxMDAwMCkgLy9DcmVhdGUgc2VtaS11bmlxdWUgSUQgaW4gY2FzZSB1c2VyIGRvZXNuJ3Qgc2VsZWN0IG9uZQorICAgICwgeCA9IGQzLnNjYWxlLm9yZGluYWwoKQorICAgICwgeSA9IGQzLnNjYWxlLmxpbmVhcigpCisgICAgLCBnZXRYID0gZnVuY3Rpb24oZCkgeyByZXR1cm4gZC54IH0KKyAgICAsIGdldFkgPSBmdW5jdGlvbihkKSB7IHJldHVybiBkLnkgfQorICAgICwgZm9yY2VZID0gWzBdIC8vIDAgaXMgZm9yY2VkIGJ5IGRlZmF1bHQuLiB0aGlzIG1ha2VzIHNlbnNlIGZvciB0aGUgbWFqb3JpdHkgb2YgYmFyIGdyYXBocy4uLiB1c2VyIGNhbiBhbHdheXMgZG8gY2hhcnQuZm9yY2VZKFtdKSB0byByZW1vdmUKKyAgICAsIGNvbG9yID0gbnYudXRpbHMuZGVmYXVsdENvbG9yKCkKKyAgICAsIHNob3dWYWx1ZXMgPSBmYWxzZQorICAgICwgdmFsdWVGb3JtYXQgPSBkMy5mb3JtYXQoJywuMmYnKQorICAgICwgeERvbWFpbgorICAgICwgeURvbWFpbgorICAgICwgZGlzcGF0Y2ggPSBkMy5kaXNwYXRjaCgnY2hhcnRDbGljaycsICdlbGVtZW50Q2xpY2snLCAnZWxlbWVudERibENsaWNrJywgJ2VsZW1lbnRNb3VzZW92ZXInLCAnZWxlbWVudE1vdXNlb3V0JykKKyAgICAsIHJlY3RDbGFzcyA9ICdkaXNjcmV0ZUJhcicKKyAgICA7CisKKyAgLy89PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKworCisgIC8vPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisgIC8vIFByaXZhdGUgVmFyaWFibGVzCisgIC8vLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tCisKKyAgdmFyIHgwLCB5MDsKKworICAvLz09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorCisKKyAgZnVuY3Rpb24gY2hhcnQoc2VsZWN0aW9uKSB7CisgICAgc2VsZWN0aW9uLmVhY2goZnVuY3Rpb24oZGF0YSkgeworICAgICAgdmFyIGF2YWlsYWJsZVdpZHRoID0gd2lkdGggLSBtYXJnaW4ubGVmdCAtIG1hcmdpbi5yaWdodCwKKyAgICAgICAgICBhdmFpbGFibGVIZWlnaHQgPSBoZWlnaHQgLSBtYXJnaW4udG9wIC0gbWFyZ2luLmJvdHRvbSwKKyAgICAgICAgICBjb250YWluZXIgPSBkMy5zZWxlY3QodGhpcyk7CisKKworICAgICAgLy9hZGQgc2VyaWVzIGluZGV4IHRvIGVhY2ggZGF0YSBwb2ludCBmb3IgcmVmZXJlbmNlCisgICAgICBkYXRhID0gZGF0YS5tYXAoZnVuY3Rpb24oc2VyaWVzLCBpKSB7CisgICAgICAgIHNlcmllcy52YWx1ZXMgPSBzZXJpZXMudmFsdWVzLm1hcChmdW5jdGlvbihwb2ludCkgeworICAgICAgICAgIHBvaW50LnNlcmllcyA9IGk7CisgICAgICAgICAgcmV0dXJuIHBvaW50OworICAgICAgICB9KTsKKyAgICAgICAgcmV0dXJuIHNlcmllczsKKyAgICAgIH0pOworCisKKyAgICAgIC8vLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tCisgICAgICAvLyBTZXR1cCBTY2FsZXMKKworICAgICAgLy8gcmVtYXAgYW5kIGZsYXR0ZW4gdGhlIGRhdGEgZm9yIHVzZSBpbiBjYWxjdWxhdGluZyB0aGUgc2NhbGVzJyBkb21haW5zCisgICAgICB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nKQorICAgICAgICAgIC5hdHRyKCd0cmFuc2Zvcm0nLCBmdW5jdGlvbihkLGksaikgeworICAgICAgICAgICAgICByZXR1cm4gJ3RyYW5zbGF0ZSgnICsgKHgoZ2V0WChkLGkpKSArIHgucmFuZ2VCYW5kKCkgKiAuMDUgKSArICcsICcgKyB5KDApICsgJyknIAorICAgICAgICAgIH0pCisgICAgICAgICAgLm9uKCdtb3VzZW92ZXInLCBmdW5jdGlvbihkLGkpIHsgLy9UT0RPOiBmaWd1cmUgb3V0IHdoeSBqIHdvcmtzIGFib3ZlLCBidXQgbm90IGhlcmUKKyAgICAgICAgICAgIGQzLnNlbGVjdCh0aGlzKS5jbGFzc2VkKCdob3ZlcicsIHRydWUpOworICAgICAgICAgICAgZGlzcGF0Y2guZWxlbWVudE1vdXNlb3Zlcih7CisgICAgICAgICAgICAgIHZhbHVlOiBnZXRZKGQsaSksCisgICAgICAgICAgICAgIHBvaW50OiBkLAorICAgICAgICAgICAgICBzZXJpZXM6IGRhdGFbZC5zZXJpZXNdLAorICAgICAgICAgICAgICBwb3M6IFt4KGdldFgoZCxpKSkgKyAoeC5yYW5nZUJhbmQoKSAqIChkLnNlcmllcyArIC41KSAvIGRhdGEubGVuZ3RoKSwgeShnZXRZKGQsaSkpXSwgIC8vIFRPRE86IEZpZ3VyZSBvdXQgd2h5IHRoZSB2YWx1ZSBhcHBlYXJzIHRvIGJlIHNoaWZ0ZWQKKyAgICAgICAgICAgICAgcG9pbnRJbmRleDogaSwKKyAgICAgICAgICAgICAgc2VyaWVzSW5kZXg6IGQuc2VyaWVzLAorICAgICAgICAgICAgICBlOiBkMy5ldmVudAorICAgICAgICAgICAgfSk7CisgICAgICAgICAgfSkKKyAgICAgICAgICAub24oJ21vdXNlb3V0JywgZnVuY3Rpb24oZCxpKSB7CisgICAgICAgICAgICBkMy5zZWxlY3QodGhpcykuY2xhc3NlZCgnaG92ZXInLCBmYWxzZSk7CisgICAgICAgICAgICBkaXNwYXRjaC5lbGVtZW50TW91c2VvdXQoeworICAgICAgICAgICAgICB2YWx1ZTogZ2V0WShkLGkpLAorICAgICAgICAgICAgICBwb2ludDogZCwKKyAgICAgICAgICAgICAgc2VyaWVzOiBkYXRhW2Quc2VyaWVzXSwKKyAgICAgICAgICAgICAgcG9pbnRJbmRleDogaSwKKyAgICAgICAgICAgICAgc2VyaWVzSW5kZXg6IGQuc2VyaWVzLAorICAgICAgICAgICAgICBlOiBkMy5ldmVudAorICAgICAgICAgICAgfSk7CisgICAgICAgICAgfSkKKyAgICAgICAgICAub24oJ2NsaWNrJywgZnVuY3Rpb24oZCxpKSB7CisgICAgICAgICAgICBkaXNwYXRjaC5lbGVtZW50Q2xpY2soeworICAgICAgICAgICAgICB2YWx1ZTogZ2V0WShkLGkpLAorICAgICAgICAgICAgICBwb2ludDogZCwKKyAgICAgICAgICAgICAgc2VyaWVzOiBkYXRhW2Quc2VyaWVzXSwKKyAgICAgICAgICAgICAgcG9zOiBbeChnZXRYKGQsaSkpICsgKHgucmFuZ2VCYW5kKCkgKiAoZC5zZXJpZXMgKyAuNSkgLyBkYXRhLmxlbmd0aCksIHkoZ2V0WShkLGkpKV0sICAvLyBUT0RPOiBGaWd1cmUgb3V0IHdoeSB0aGUgdmFsdWUgYXBwZWFycyB0byBiZSBzaGlmdGVkCisgICAgICAgICAgICAgIHBvaW50SW5kZXg6IGksCisgICAgICAgICAgICAgIHNlcmllc0luZGV4OiBkLnNlcmllcywKKyAgICAgICAgICAgICAgZTogZDMuZXZlbnQKKyAgICAgICAgICAgIH0pOworICAgICAgICAgICAgZDMuZXZlbnQuc3RvcFByb3BhZ2F0aW9uKCk7CisgICAgICAgICAgfSkKKyAgICAgICAgICAub24oJ2RibGNsaWNrJywgZnVuY3Rpb24oZCxpKSB7CisgICAgICAgICAgICBkaXNwYXRjaC5lbGVtZW50RGJsQ2xpY2soeworICAgICAgICAgICAgICB2YWx1ZTogZ2V0WShkLGkpLAorICAgICAgICAgICAgICBwb2ludDogZCwKKyAgICAg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ob3cgdXAgYWJvdmUgeT0wCisgICAgICAgICAgICAgICAgICAgICAgICAgIHkoZ2V0WShkLGkpKTsKKworICAgICAgICAgICAgICByZXR1cm4gJ3RyYW5zbGF0ZSgnICsgbGVmdCArICcsICcgKyB0b3AgKyAnKScKKyAgICAgICAgICB9KQorICAgICAgICAuc2VsZWN0KCdyZWN0JykKKyAgICAgICAgICAuYXR0cignaGVpZ2h0JywgZnVuY3Rpb24oZCxpKSB7CisgICAgICAgICAgICByZXR1cm4gIE1hdGgubWF4KE1hdGguYWJzKHkoZ2V0WShkLGkpKSAtIHkoMCkpIHx8IDEpCisgICAgICAgICAgfSk7CisKKworICAgICAgLy9zdG9yZSBvbGQgc2NhbGVzIGZvciB1c2UgaW4gdHJhbnNpdGlvbnMgb24gdXBkYXRlCisgICAgICB4MCA9IHguY29weSgpOworICAgICAgeTAgPSB5LmNvcHkoKTsKKworICAgIH0pOworCisgICAgcmV0dXJuIGNoYXJ0OworICB9CisKKworICAvLz09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorICAvLyBFeHBvc2UgUHVibGljIFZhcmlhYmxlcworICAvLy0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLQorCisgIGNoYXJ0LmRpc3BhdGNoID0gZGlzcGF0Y2g7CisKKyAgY2hhcnQueCA9IGZ1bmN0aW9uKF8pIHsKKyAgICBpZiAoIWFyZ3VtZW50cy5sZW5ndGgpIHJldHVybiBnZXRYOworICAgIGdldFggPSBfOworICAgIHJldHVybiBjaGFydDsKKyAgfTsKKworICBjaGFydC55ID0gZnVuY3Rpb24oXykgeworICAgIGlmICghYXJndW1lbnRzLmxlbmd0aCkgcmV0dXJuIGdldFk7CisgICAgZ2V0WSA9IF87CisgICAgcmV0dXJuIGNoYXJ0OworICB9OworCisgIGNoYXJ0Lm1hcmdpbiA9IGZ1bmN0a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7CisgIH07CisKKyAgY2hhcnQueERvbWFpbiA9IGZ1bmN0aW9uKF8pIHsKKyAgICBpZiAoIWFyZ3VtZW50cy5sZW5ndGgpIHJldHVybiB4RG9tYWluOworICAgIHhEb21haW4gPSBfOworICAgIHJldHVybiBjaGFydDsKKyAgfTsKKworICBjaGFydC55RG9tYWluID0gZnVuY3Rpb24oXykgeworICAgIGlmICghYXJndW1lbnRzLmxlbmd0aCkgcmV0dXJuIHlEb21haW47CisgICAgeURvbWFpbiA9IF87CisgICAgcmV0dXJuIGNoYXJ0OworICB9OworCisgIGNoYXJ0LmZvcmNlWSA9IGZ1bmN0aW9uKF8pIHsKKyAgICBpZiAoIWFyZ3VtZW50cy5sZW5ndGgpIHJldHVybiBmb3JjZVk7CisgICAgZm9yY2VZID0gXzsKKyAgICByZXR1cm4gY2hhcnQ7CisgIH07CisKKyAgY2hhcnQuY29sb3IgPSBmdW5jdGlvbihfKSB7CisgICAgaWYgKCFhcmd1bWVudHMubGVuZ3RoKSByZXR1cm4gY29sb3I7CisgICAgY29sb3IgPSBudi51dGlscy5nZXRDb2xvcihfKTsKKyAgICByZXR1cm4gY2hhcnQ7CisgIH07CisKKyAgY2hhcnQuaWQgPSBmdW5jdGlvbihfKSB7CisgICAgaWYgKCFhcmd1bWVudHMubGVuZ3RoKSByZXR1cm4gaWQ7CisgICAgaWQgPSBfOworICAgIHJldHVybiBjaGFydDsKKyAgfTsKKworICBjaGFydC5zaG93VmFsdWVzID0gZnVuY3Rpb24oXykgeworICAgIGlmICghYXJndW1lbnRzLmxlbmd0aCkgcmV0dXJuIHNob3dWYWx1ZXM7CisgICAgc2hvd1ZhbHVlcyA9IF87CisgICAgcmV0dXJuIGNoYXJ0OworICB9OworCisgIGNoYXJ0LnZhbHVlRm9ybWF0PSBmdW5jdGlvbihfKSB7CisgICAgaWYgKCFhcmd1bWVudHMubGVuZ3RoKSByZXR1cm4gdmFsdWVGb3JtYXQ7CisgICAgdmFsdWVGb3JtYXQgPSBfOworICAgIHJldHVybiBjaGFydDsKKyAgfTsKKworICBjaGFydC5yZWN0Q2xhc3M9IGZ1bmN0aW9uKF8pIHsKKyAgICBpZiAoIWFyZ3VtZW50cy5sZW5ndGgpIHJldHVybiByZWN0Q2xhc3M7CisgICAgcmVjdENsYXNzID0gXzsKKyAgICByZXR1cm4gY2hhcnQ7CisgIH0KKyAgLy89PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKworCisgIHJldHVybiBjaGFydDsKK30KKworbnYubW9kZWxzLmRpc2NyZXRlQmFyQ2hhcnQgPSBmdW5jdGlvbigpIHsKKworICAvLz09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorICAvLyBQdWJsaWMgVmFyaWFibGVzIHdpdGggRGVmYXVsdCBTZXR0aW5ncworICAvLy0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLQorCisgIHZhciBkaXNjcmV0ZWJhciA9IG52Lm1vZGVscy5kaXNjcmV0ZUJhcigpCisgICAgLCB4QXhpcyA9IG52Lm1vZGVscy5heGlzKCkKKyAgICAsIHlBeGlzID0gbnYubW9kZWxzLmF4aXMoKQorICAgIDsKKworICB2YXIgbWFyZ2luID0ge3RvcDogMTUsIHJpZ2h0OiAxMCwgYm90dG9tOiA1MCwgbGVmdDogNjB9CisgICAgLCB3aWR0aCA9IG51bGwKKyAgICAsIGhlaWdodCA9IG51bGwKKyAgICAsIGNvbG9yID0gbnYudXRpbHMuZ2V0Q29sb3IoKQorICAgICwgc3RhZ2dlckxhYmVscyA9IGZhbHNlCisgICAgLCB0b29sdGlwcyA9IHRydWUKKyAgICAsIHRvb2x0aXAgPSBmdW5jdGlvbihrZXksIHgsIHksIGUsIGdyYXBoKSB7CisgICAgICAgIHJldHVybiAnPGgzPicgKyB4ICsgJzwvaDM+JyArCisgICAgICAgICAgICAgICAnPHA+JyArICB5ICsgJzwvcD4nCisgICAgICB9CisgICAgLCB4CisgICAgLCB5CisgICAgLCBub0RhdGEgPSAiTm8gRGF0YSBBdmFpbGFibGUuIgorICAgICwgZGlzcGF0Y2ggPSBkMy5kaXNwYXRjaCgndG9vbHRpcFNob3cnLCAndG9vbHRpcEhpZGUnLCAnYmVmb3JlVXBkYXRlJykKKyAgICA7CisKKyAgeEF4aXMKKyAgICAub3JpZW50KCdib3R0b20nKQorICAgIC5oaWdobGlnaHRaZXJvKGZhbHNlKQorICAgIC5zaG93TWF4TWluKGZhbHNlKQorICAgIC50aWNrRm9ybWF0KGZ1bmN0aW9uKGQpIHsgcmV0dXJuIGQgfSkKKyAgICA7CisgIHlBeGlzCisgICAgLm9yaWVudCgnbGVmdCcpCisgICAgLnRpY2tGb3JtYXQoZDMuZm9ybWF0KCcsLjFmJykpCisgICAgOworCisgIC8vPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisKKworICAvLz09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorICAvLyBQcml2YXRlIFZhcmlhYmxlcworICAvLy0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLQorCisgIHZhciBzaG93VG9vbHRpcCA9IGZ1bmN0aW9uKGUsIG9mZnNldEVsZW1lbnQpIHsKKyAgICB2YXIgbGVmdCA9IGUucG9zWzBdICsgKCBvZmZzZXRFbGVtZW50Lm9mZnNldExlZnQgfHwgMCApLAorICAgICAgICB0b3AgPSBlLnBvc1sxXSArICggb2Zmc2V0RWxlbWVudC5vZmZzZXRUb3AgfHwgMCksCisgICAgICAgIHggPSB4QXhpcy50aWNrRm9ybWF0KCkoZGlzY3JldGViYXIueCgpKGUucG9pbnQsIGUucG9pbnRJbmRleCkpLAorICAgICAgICB5ID0geUF4aXMudGlja0Zvcm1hdCgpKGRpc2NyZXRlYmFyLnkoKShlLnBvaW50LCBlLnBvaW50SW5kZXgpKSwKKyAgICAgICAgY29udGVudCA9IHRvb2x0aXAoZS5zZXJpZXMua2V5LCB4LCB5LCBlLCBjaGFydCk7CisKKyAgICBudi50b29sdGlwLnNob3coW2xlZnQsIHRvcF0sIGNvbnRlbnQsIGUudmFsdWUgPCAwID8gJ24nIDogJ3MnLCBudWxsLCBvZmZzZXRFbGVtZW50KTsKKyAgfTsKKworICAvLz09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorCisKKyAgZnVuY3Rpb24gY2hhcnQoc2VsZWN0aW9uKSB7CisgICAgc2VsZWN0aW9uLmVhY2goZnVuY3Rpb24oZGF0YSkgeworICAgICAgdmFyIGNvbnRhaW5lciA9IGQzLnNlbGVjdCh0aGlzKSwKKyAgICAgICAgICB0aGF0ID0gdGhpczsKKworICAgICAgdmFyIGF2YWlsYWJsZVdpZHRoID0gKHdpZHRoICB8fCBwYXJzZUludChjb250YWluZXIuc3R5bGUoJ3dpZHRoJykpIHx8IDk2MCkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLSBtYXJnaW4ubGVmdCAtIG1hcmdpbi5yaWdodCwKKyAgICAgICAgICBhdmFpbGFibGVIZWlnaHQgPSAoaGVpZ2h0IHx8IHBhcnNlSW50KGNvbnRhaW5lci5zdHlsZSgnaGVpZ2h0JykpIHx8IDQwMCkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLSBtYXJnaW4udG9wIC0gbWFyZ2luLmJvdHRvbTsKKworCisgICAgICBjaGFydC51cGRhdGUgPSBmdW5jdGlvbigpIHsgZGlzcGF0Y2guYmVmb3JlVXBkYXRlKCk7IGNvbnRhaW5lci50cmFuc2l0aW9uKCkuY2FsbChjaGFydCk7IH07CisgICAgICBjaGFydC5jb250YWluZXIgPSB0aGlzOworCisKKyAgICAg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gICAgICAgICAgLmF0dHIoJ2hlaWdodCcsIDE2KQorICAgICAgICAgIC5hdHRyKCd4JywgLXgucmFuZ2VCYW5kKCkgLyAoc3RhZ2dlckxhYmVscyA/IDEgOiAyICkpOworCisKKyAgICAgIC8vLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tCisgICAgICAvLyBTZXR1cCBBeGVzCisKKyAgICAgIHhBeGlzCisgICAgICAgIC5zY2FsZSh4KQorICAgICAgICAudGlja3MoIGF2YWlsYWJsZVdpZHRoIC8gMTAwICkKKyAgICAgICAgLnRpY2tTaXplKC1hdmFpbGFibGVIZWlnaHQsIDApOworCisgICAgICBnLnNlbGVjdCgnLm52LXgubnYtYXhpcycpCisgICAgICAgICAgLmF0dHIoJ3RyYW5zZm9ybScsICd0cmFuc2xhdGUoMCwnICsgKHkucmFuZ2UoKVswXSArICgoZGlzY3JldGViYXIuc2hvd1ZhbHVlcygpICYmIHkuZG9tYWluKClbMF0gPCAwKSA/IDE2IDogMCkpICsgJyknKTsKKyAgICAgIC8vZDMudHJhbnNpdGlvbihnLnNlbGVjdCgnLm52LXgubnYtYXhpcycpKQorICAgICAgZy5zZWxlY3QoJy5udi14Lm52LWF4aXMnKS50cmFuc2l0aW9uKCkuZHVyYXRpb24oMCkKKyAgICAgICAgICAuY2FsbCh4QXhpcyk7CisKKworICAgICAgdmFyIHhUaWNrcyA9IGcuc2VsZWN0KCcubnYteC5udi1heGlzJykuc2VsZWN0QWxsKCdnJyk7CisKKyAgICAgIGlmIChzdGFnZ2VyTGFiZWxzKSB7CisgICAgICAgIHhUaWNrcworICAgICAgICAgICAgLnNlbGVjdEFsbCgndGV4dCcpCisgICAgICAgICAgICAuYXR0cigndHJhbnNmb3JtJywgZnVuY3Rpb24oZCxpLGopIHsgcmV0dXJuICd0cmFuc2xhdGUoMCwnICsgKGogJSAyID09IDAgPyAnNScgOiAnMTcnKSArICcpJyB9KQorICAgICAgfQorCisgICAgICB5QXhpcworICAgICAgICAuc2NhbGUoeSkKKyAgICAgICAgLnRpY2tzKCBhdmFpbGFibGVIZWlnaHQgLyAzNiApCisgICAgICAgIC50aWNrU2l6ZSggLWF2YWlsYWJsZVdpZHRoLCAwKTsKKworICAgICAgZDMudHJhbnNpdGlvbihnLnNlbGVjdCgnLm52LXkubnYtYXhpcycpKQorICAgICAgICAgIC5jYWxsKHlBeGlzKTsKKworICAgICAgLy8tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0KKworCisgICAgICAvLz09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorICAgICAgLy8gRXZlbnQgSGFuZGxpbmcvRGlzcGF0Y2hpbmcgKGluIGNoYXJ0J3Mgc2NvcGUpCisgICAgICAvLy0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLQorCisgICAgICBkaXNwYXRjaC5vbigndG9vbHRpcFNob3cnLCBmdW5jdGlvbihlKSB7CisgICAgICAgIGlmICh0b29sdGlwcykgc2hvd1Rvb2x0aXAoZSwgdGhhdC5wYXJlbnROb2RlKTsKKyAgICAgIH0pOworCisgICAgICAvLz09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorCisKKyAgICB9KTsKKworICAgIHJldHVybiBjaGFydDsKKyAgfQorCisgIC8vPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisgIC8vIEV2ZW50IEhhbmRsaW5nL0Rpc3BhdGNoaW5nIChvdXQgb2YgY2hhcnQncyBzY29wZSkKKyAgLy8tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0KKworICBkaXNjcmV0ZWJhci5kaXNwYXRjaC5vbignZWxlbWVudE1vdXNlb3Zlci50b29sdGlwJywgZnVuY3Rpb24oZSkgeworICAgIGUucG9zID0gW2UucG9zWzBdICsgIG1hcmdpbi5sZWZ0LCBlLnBvc1sxXSArIG1hcmdpbi50b3BdOworICAgIGRpc3BhdGNoLnRvb2x0aXBTaG93KGUpOworICB9KTsKKworICBkaXNjcmV0ZWJhci5kaXNwYXRjaC5vbignZWxlbWVudE1vdXNlb3V0LnRvb2x0aXAnLCBmdW5jdGlvbihlKSB7CisgICAgZGlzcGF0Y2gudG9vbHRpcEhpZGUoZSk7CisgIH0pOworCisgIGRpc3BhdGNoLm9uKCd0b29sdGlwSGlkZScsIGZ1bmN0aW9uKCkgeworICAgIGlmICh0b29sdGlwcykgbnYudG9vbHRpcC5jbGVhbnVwKCk7CisgIH0pOworCisgIC8vPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisKKworICAvLz09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorICAvLyBFeHBvc2UgUHVibGljIFZhcmlhYmxlcworICAvLy0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLQorCisgIC8vIGV4cG9zZSBjaGFydCdzIHN1Yi1jb21wb25lbnRzCisgIGNoYXJ0LmRpc3BhdGNoID0gZGlzcGF0Y2g7CisgIGNoYXJ0LmRpc2NyZXRlYmFyID0gZGlzY3JldGViYXI7CisgIGNoYXJ0LnhBeGlzID0geEF4aXM7CisgIGNoYXJ0LnlBeGlzID0geUF4aXM7CisKKyAgZDMucmViaW5kKGNoYXJ0LCBkaXNjcmV0ZWJhciwgJ3gnLCAneScsICd4RG9tYWluJywgJ3lEb21haW4nLCAnZm9yY2VYJywgJ2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jb2xvcik7CisgICAgcmV0dXJuIGNoYXJ0OworICB9OworCisgIGNoYXJ0LnN0YWdnZXJMYWJlbHMgPSBmdW5jdGlvbihfKSB7CisgICAgaWYgKCFhcmd1bWVudHMubGVuZ3RoKSByZXR1cm4gc3RhZ2dlckxhYmVsczsKKyAgICBzdGFnZ2VyTGFiZWxzID0gXzsKKyAgICByZXR1cm4gY2hhcnQ7CisgIH07CisKKyAgY2hhcnQudG9vbHRpcHMgPSBmdW5jdGlvbihfKSB7CisgICAgaWYgKCFhcmd1bWVudHMubGVuZ3RoKSByZXR1cm4gdG9vbHRpcHM7CisgICAgdG9vbHRpcHMgPSBfOworICAgIHJldHVybiBjaGFydDsKKyAgfTsKKworICBjaGFydC50b29sdGlwQ29udGVudCA9IGZ1bmN0aW9uKF8pIHsKKyAgICBpZiAoIWFyZ3VtZW50cy5sZW5ndGgpIHJldHVybiB0b29sdGlwOworICAgIHRvb2x0aXAgPSBfOworICAgIHJldHVybiBjaGFydDsKKyAgfTsKKworICBjaGFydC5ub0RhdGEgPSBmdW5jdGlvbihfKSB7CisgICAgaWYgKCFhcmd1bWVudHMubGVuZ3RoKSByZXR1cm4gbm9EYXRhOworICAgIG5vRGF0YSA9IF87CisgICAgcmV0dXJuIGNoYXJ0OworICB9OworCisgIC8vPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisKKworICByZXR1cm4gY2hhcnQ7Cit9CisKK252Lm1vZGVscy5kaXN0cmlidXRpb24gPSBmdW5jdGlvbigpIHsKKworICAvLz09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorICAvLyBQdWJsaWMgVmFyaWFibGVzIHdpdGggRGVmYXVsdCBTZXR0aW5ncworICAvLy0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLQorCisgIHZhciBtYXJnaW4gPSB7dG9wOiAwLCByaWdodDogMCwgYm90dG9tOiAwLCBsZWZ0OiAwfQorICAgICwgd2lkdGggPSA0MDAgLy90ZWNobmljYWxseSB3aWR0aCBvciBoZWlnaHQgZGVwZW5kaW5nIG9uIHggb3IgeS4uLi4KKyAgICAsIHNpemUgPSA4CisgICAgLCBheGlzID0gJ3gnIC8vICd4JyBvciAneScuLi4gaG9yaXpvbnRhbCBvciB2ZXJ0aWNhbAorICAgICwgZ2V0RGF0YSA9IGZ1bmN0aW9uKGQpIHsgcmV0dXJuIGRbYXhpc10gfSAgLy8gZGVmYXVsdHMgZC54IG9yIGQueQorICAgICwgY29sb3IgPSBudi51dGlscy5kZWZhdWx0Q29sb3IoKQorICAgICwgc2NhbGUgPSBkMy5zY2FsZS5saW5lYXIoKQorICAgICwgZG9tYWluCisgICAgOworCisgIC8vPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisKKworICAvLz09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorICAvLyBQcml2YXRlIFZhcmlhYmxlcworICAvLy0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLQorCisgIHZhciBzY2FsZTA7CisKKyAgLy89PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKworCisgIGZ1bmN0aW9uIGNoYXJ0KHNlbGVjdGlvbikgeworICAgIHNlbGVjdGlvbi5lYWNoKGZ1bmN0aW9uKGRhdGEpIHsKKyAgICAgIHZhciBhdmFpbGFibGVMZW5ndGggPSB3aWR0aCAtIChheGlzID09PSAneCcgPyBtYXJnaW4ubGVmdCArIG1hcmdpbi5yaWdodCA6IG1hcmdpbi50b3AgKyBtYXJnaW4uYm90dG9tKSwKKyAgICAgICAgICBuYXhpcyA9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GUoJ3N0cm9rZS1vcGFjaXR5JywgMCkKKyAgICAgICAgICAucmVtb3ZlKCk7CisgICAgICBkaXN0CisgICAgICAgICAgLmF0dHIoJ2NsYXNzJywgZnVuY3Rpb24oZCxpKSB7IHJldHVybiAnbnYtZGlzdCcgKyBheGlzICsgJyBudi1kaXN0JyArIGF4aXMgKyAnLScgKyBpIH0pCisgICAgICAgICAgLmF0dHIobmF4aXMgKyAnMScsIDApCisgICAgICAgICAgLmF0dHIobmF4aXMgKyAnMicsIHNpemUpOworICAgICAgZDMudHJhbnNpdGlvbihkaXN0KQorICAgICAgICAgIC5hdHRyKGF4aXMgKyAnMScsIGZ1bmN0aW9uKGQsaSkgeyByZXR1cm4gc2NhbGUoZ2V0RGF0YShkLGkpKSB9KQorICAgICAgICAgIC5hdHRyKGF4aXMgKyAnMicsIGZ1bmN0aW9uKGQsaSkgeyByZXR1cm4gc2NhbGUoZ2V0RGF0YShkLGkpKSB9KQorCisKKyAgICAgIHNjYWxlMCA9IHNjYWxlLmNvcHkoKTsKKworICAgIH0pOworCisgICAgcmV0dXJuIGNoYXJ0OworICB9CisKKworICAvLz09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorICAvLyBFeHBvc2UgUHVibGljIFZhcmlhYmxlcworICAvLy0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLQorCisgIGNoYXJ0Lm1hcmdpbiA9IGZ1bmN0aW9uKF8pIHsKKyAgICBpZiAoIWFyZ3VtZW50cy5sZW5ndGgpIHJldHVybiBtYXJnaW47CisgICAgbWFyZ2luLnRvcCAgICA9IHR5cGVvZiBfLnRvcCAgICAhPSAndW5kZWZpbmVkJyA/IF8udG9wICAgIDogbWFyZ2luLnRvcDsKKyAgICBtYXJnaW4ucmlnaHQgID0gdHlwZW9mIF8ucmlnaHQgICE9ICd1bmRlZmluZWQnID8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lmICghYXJndW1lbnRzLmxlbmd0aCkgcmV0dXJuIGNvbG9yOworICAgIGNvbG9yID0gbnYudXRpbHMuZ2V0Q29sb3IoXyk7CisgICAgcmV0dXJuIGNoYXJ0OworICB9OworCisgIC8vPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisKKworICByZXR1cm4gY2hhcnQ7Cit9CisvL1RPRE86IGNvbnNpZGVyIGRlcHJlY2F0aW5nIGFuZCB1c2luZyBtdWx0aWJhciB3aXRoIHNpbmdsZSBzZXJpZXMgZm9yIHRoaXMKK252Lm1vZGVscy5oaXN0b3JpY2FsQmFyID0gZnVuY3Rpb24oKSB7CisKKyAgLy89PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKyAgLy8gUHVibGljIFZhcmlhYmxlcyB3aXRoIERlZmF1bHQgU2V0dGluZ3MKKyAgLy8tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0KKworICB2YXIgbWFyZ2luID0ge3RvcDogMCwgcmlnaHQ6IDAsIGJvdHRvbTogMCwgbGVmdDogMH0KKyAgICAsIHdpZHRoID0gOTYwCisgICAgLCBoZWlnaHQgPSA1MDAKKyAgICAsIGlkID0gTWF0aC5mbG9vcihNYXRoLnJhbmRvbSgpICogMTAwMDApIC8vQ3JlYXRlIHNlbWktdW5pcXVlIElEIGluIGNhc2UgdXNlciBkb2Vzbid0IHNlbGVjdCBvbmUKKyAgICAsIHggPSBkMy5zY2FsZS5saW5lYXIoKQorICAgICwgeSA9IGQzLnNjYWxlLmxpbmVhcigpCisgICAgLCBnZXRYID0gZnVuY3Rpb24oZCkgeyByZXR1cm4gZC54IH0KKyAgICAsIGdldFkgPSBmdW5jdGlvbihkKSB7IHJldHVybiBkLnkgfQorICAgICwgZm9yY2VYID0gW10KKyAgICAsIGZvcmNlWSA9IFswXQorICAgICwgcGFkRGF0YSA9IGZhbHNlCisgICAgLCBjbGlwRWRnZSA9IHRydWUKKyAgICAsIGNvbG9yID0gbnYudXRpbHMuZGVmYXVsdENvbG9yKCkKKyAgICAsIHhEb21haW4KKyAgICAsIHlEb21haW4KKyAgICAsIGRpc3BhdGNoID0gZDMuZGlzcGF0Y2goJ2NoYXJ0Q2xpY2snLCAnZWxlbWVudENsaWNrJywgJ2VsZW1lbnREYmxDbGljaycsICdlbGVtZW50TW91c2VvdmVyJywgJ2VsZW1lbnRNb3VzZW91dCcpCisgICAgOworCisgIC8vPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisKKworICBmdW5jdGlvbiBjaGFydChzZWxlY3Rpb24pIHsKKyAgICBzZWxlY3Rpb24uZWFjaChmdW5jdGlvbihkYXRhKSB7CisgICAgICB2YXIgYXZhaWxhYmxlV2lkdGggPSB3aWR0aCAtIG1hcmdpbi5sZWZ0IC0gbWFyZ2luLnJpZ2h0LAorICAgICAgICAgIGF2YWlsYWJsZUhlaWdodCA9IGhlaWdodCAtIG1hcmdpbi50b3AgLSBtYXJnaW4uYm90dG9tLAorICAgICAgICAgIGNvbnRhaW5lciA9IGQzLnNlbGVjdCh0aGlzKTsKKworCisgICAgICAvLy0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLQorICAgICAgLy8gU2V0dXAgU2NhbGVzCisKKyAgICAgIHggICAuZG9tYWluKHhEb21haW4gfHwgZDMuZXh0ZW50KGRhdGFbMF0udmFsdWVzLm1hcChnZXRYKS5jb25jYXQoZm9yY2VYKSApKQorCisgICAgICBpZiAocGFkRGF0YSkKKyAgICAgICAgeC5yYW5nZShbYXZhaWxhYmxlV2lkdGggKiAuNSAvIGRhdGFbMF0udmFsdWVzLmxlbmd0aCwgYXZhaWxhYmxlV2lkdGggKiAoZGF0YVswXS52YWx1ZXMubGVuZ3RoIC0gLjUpICAvIGRhdGFbMF0udmFsdWVzLmxlbmd0aCBdKTsKKyAgICAgIGVsc2UKKyAgICAgICAgeC5yYW5nZShbMCwgYXZhaWxhYmxlV2lkdGhdKTsKKworICAgICAgeSAgIC5kb21haW4oeURvbWFpbiB8fCBkMy5leHRlbnQoZGF0YVswXS52YWx1ZXMubWFwKGdldFkpLmNvbmNhdChmb3JjZVkpICkpCisgICAgICAgICAgLnJhbmdlKFthdmFpbGFibGVIZWlnaHQsIDBdKTsKKworICAgICAgLy8gSWYgc2NhbGUncyBkb21haW4gZG9uJ3QgaGF2ZSBhIHJhbmdlLCBzbGlnaHRseSBhZGp1c3QgdG8gbWFrZSBvbmUuLi4gc28gYSBjaGFydCBjYW4gc2hvdyBhIHNpbmdsZSBkYXRhIHBvaW50CisgICAgICBpZiAoeC5kb21haW4oKVswXSA9PT0geC5kb21haW4oKVsxXSB8fCB5LmRvbWFpbigpWzBdID09PSB5LmRvbWFpbigpWzFdKSBzaW5nbGVQb2ludCA9IHRydWU7CisgICAgICBpZiAoeC5kb21haW4oKVswXSA9PT0geC5kb21haW4oKVsxXSkKKyAgICAgICAgeC5kb21haW4oKVswXSA/CisgICAgICAgICAgICB4LmRvbWFpbihbeC5kb21haW4oKVswXSAtIHguZG9tYWluKClbMF0gKiAwLjAxLCB4LmRvbWFpbigpWzFdICsgeC5kb21haW4oKVsxXSAqIDAuMDFdKQorICAgICAgICAgIDogeC5kb21haW4oWy0xLDFdKTsKKworICAgICAgaWYgKHkuZG9tYWluKClbMF0gPT09IHkuZG9tYWluKClbMV0pCisgICAgICAgIHkuZG9tYWluKClbMF0gPworICAgICAgICAgICAgeS5kb21haW4oW3kuZG9tYWluKClbMF0gKyB5LmRvbWFpbigpWzBdICogMC4wMSwgeS5kb21haW4oKVsxXSAtIHkuZG9tYWluKClbMV0gKiAwLjAxXSkKKyAgICAgICAgICA6IHkuZG9tYWluKFstMSwxXSk7CisKKyAgICA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ogaSwKKyAgICAgICAgICAgICAgICBwb3M6IGQzLmV2ZW50LAorICAgICAgICAgICAgICAgIGlkOiBpZAorICAgICAgICAgICAgfSk7CisgICAgICAgICAgfSk7CisKKworICAgICAgZGVmc0VudGVyLmFwcGVuZCgnY2xpcFBhdGgnKQorICAgICAgICAgIC5hdHRyKCdpZCcsICdudi1jaGFydC1jbGlwLXBhdGgtJyArIGlkKQorICAgICAgICAuYXBwZW5kKCdyZWN0Jyk7CisKKyAgICAgIHdyYXAuc2VsZWN0KCcjbnYtY2hhcnQtY2xpcC1wYXRoLScgKyBpZCArICcgcmVjdCcpCisgICAgICAgICAgLmF0dHIoJ3dpZHRoJywgYXZhaWxhYmxlV2lkdGgpCisgICAgICAgICAgLmF0dHIoJ2hlaWdodCcsIGF2YWlsYWJsZUhlaWdodCk7CisKKyAgICAgIGcgICAuYXR0cignY2xpcC1wYXRoJywgY2xpcEVkZ2UgPyAndXJsKCNudi1jaGFydC1jbGlwLXBhdGgtJyArIGlkICsgJyknIDogJycpOworCisKKworICAgICAgdmFyIGJhcnMgPSB3cmFwLnNlbGVjdCgnLm52LWJhcnMnKS5zZWxlY3RBbGwoJy5udi1iYXInKQorICAgICAgICAgIC5kYXRhKGZ1bmN0aW9uKGQpIHsgcmV0dXJuIGQgfSk7CisKKyAgICAgIGJhcnMuZXhpdCgpLnJlbW92ZSgpOworCisKKyAgICAgIHZhciBiYXJzRW50ZXIgPSBiYXJzLmVudGVyKCkuYXBwZW5kKCdyZWN0JykKKyAgICAgICAgICAvLy5hdHRyKCdjbGFzcycsIGZ1bmN0aW9uKGQsaSxqKSB7IHJldHVybiAoZ2V0WShkLGkpIDwgMCA/ICdudi1iYXIgbmVnYXRpdmUnIDogJ252LWJhciBwb3NpdGl2ZScpICsgJyBudi1iYXItJyArIGogKyAnLScgKyBpIH0pCisgICAgICAgICAgLmF0dHIoJ3gnLCAwICkKKyAgICAgICAgICAuYXR0cigneScsIGZ1bmN0aW9uKGQsaSkgeyAgcmV0dXJuIHkoTWF0aC5tYXgoMCwgZ2V0WShkLGkpKSkgfSkKKyAgICAgICAgICAuYXR0cignaGVpZ2h0JywgZnVuY3Rpb24oZCxpKSB7IHJldHVybiBNYXRoLmFicyh5KGdldFkoZCxpKSkgLSB5KDApKSB9KQorICAgICAgICAgIC5vbignbW91c2VvdmVyJywgZnVuY3Rpb24oZCxpKSB7CisgICAgICAgICAgICBkMy5zZWxlY3QodGhpcykuY2xhc3NlZCgnaG92ZXInLCB0cnVlKTsKKyAgICAgICAgICAgIGRpc3BhdGNoLmVsZW1lbnRNb3VzZW92ZXIoeworICAgICAgICAgICAgICAgIHBvaW50OiBkLAorICAgICAgICAgICAgICAgIHNlcmllczogZGF0YVswXSwKKyAgICAgICAgICAgICAgICBwb3M6IFt4KGdldFgoZCxpKSksIHkoZ2V0WShkLGkpKV0sICAvLyBUT0RPOiBGaWd1cmUgb3V0IHdoeSB0aGUgdmFsdWUgYXBwZWFycyB0byBiZSBzaGlmdGVkCisgICAgICAgICAgICAgICAgcG9pbnRJbmRleDogaSwKKyAgICAgICAgICAgICAgICBzZXJpZXNJbmRleDogMCwKKyAgICAgICAgICAgICAgICBlOiBkMy5ldmVudAorICAgICAgICAgICAgfSk7CisKKyAgICAgICAgICB9KQorICAgICAgICAgIC5vbignbW91c2VvdXQnLCBmdW5jdGlvbihkLGkpIHsKKyAgICAgICAgICAgICAgICBkMy5zZWxlY3QodGhpcykuY2xhc3NlZCgnaG92ZXInLCBmYWxzZSk7CisgICAgICAgICAgICAgICAgZGlzcGF0Y2guZWxlbWVudE1vdXNlb3V0KHsKKyAgICAgICAgICAgICAgICAgICAgcG9pbnQ6IGQsCisgICAgICAgICAgICAgICAgICAgIHNlcmllczogZGF0YVswXSwKKyAgICAgICAgICAgICAgICAgICAgcG9pbnRJbmRleDogaSwKKyAgICAgICAgICAgICAgICAgICAgc2VyaWVzSW5kZXg6IDAsCisgICAgICAgICAgICAgICAgICAgIGU6IGQzLmV2ZW50CisgICAgICAgICAgICAgICAgfSk7CisgICAgICAgICAgfSkKKyAgICAgICAgICAub24oJ2NsaWNrJywgZnVuY3Rpb24oZCxpKSB7CisgICAgICAgICAgICAgICAgZGlzcGF0Y2guZWxlbWVudENsaWNrKHsKKyAgICAgICAgICAgICAgICAgICAgLy9sYWJlbDogZFtsYWJlbF0sCisgICAgICAgICAgICAgICAgICAgIHZhbHVlOiBnZXRZKGQsaSksCisgICAgICAgICAgICAgICAgICAgIGRhdGE6IGQsCisgICAgICAgICAgICAgICAgICAgIGluZGV4OiBpLAorICAgICAgICAgICAgICAgICAgICBwb3M6IFt4KGdldFgoZCxpKSksIHkoZ2V0WShkLGkpKV0sCisgICAgICAgICAgICAgICAgICAgIGU6IGQzLmV2ZW50LAorICAgICAgICAgICAgICAgICAgICBpZDogaWQKKyAgICAgICAgICAgICAgICB9KTsKKyAgICAgICAgICAgICAgZDMuZXZlbnQuc3RvcFByb3BhZ2F0aW9uKCk7CisgICAgICAgICAgfSkKKyAgICAgICAgICAub24oJ2RibGNsaWNrJywgZnVuY3Rpb24oZCxpKSB7CisgICAgICAgICAgICAgIGRpc3BhdGNoLmVsZW1lbnREYmxDbGljayh7CisgICAgICAgICAgICAgICAgICAvL2xhYmVsOiBkW2xhYmVsXSwKKyAgICAgICAgICAgICAgICAgIHZhbHVlOiBnZXRZKGQsaSksCisgICAgICAgICAgICAgICAgICBkYXRhOiBkLAorICAgICAgICAgICAgICAgICAgaW5kZXg6IGksCisgICAgICAgICAgICAgICAgICBwb3M6IFt4KGdldFgoZCxpKSksIHkoZ2V0WShkLGkpKV0sCisgICAgICAgICAgICAgICAgICBlOiBkMy5ldmVudCwKKyAgICAgICAgICAgICAgICAgIGlkOiBpZAorICAgICAgICAgICAgICB9KTsKKyAgICAgICAgICAgICAgZDMuZXZlbnQuc3RvcFByb3BhZ2F0aW9uKCk7CisgICAgICAgICAgfSk7CisKKyAgICAgIGJhcnMKKyAgICAgICAgICAuYXR0cignZmlsbCcsIGZ1bmN0aW9uKGQsaSkgeyByZXR1cm4gY29sb3IoZCwgaSk7IH0pCisgICAgICAgICAgLmF0dHIoJ2NsYXNzJywgZnVuY3Rpb24oZCxpLGopIHsgcmV0dXJuIChnZXRZKGQsaSkgPCAwID8gJ252LWJhciBuZWdhdGl2ZScgOiAnbnYtYmFyIHBvc2l0aXZlJykgKyAnIG52LWJhci0nICsgaiArICctJyArIGkgfSkKKyAgICAgICAgICAuYXR0cigndHJhbnNmb3JtJywgZnVuY3Rpb24oZCxpKSB7IHJldHVybiAndHJhbnNsYXRlKCcgKyAoeChnZXRYKGQsaSkpIC0gYXZhaWxhYmxlV2lkdGggLyBkYXRhWzBdLnZhbHVlcy5sZW5ndGggKiAuNDUpICsgJywwKSc7IH0pICAvL1RPRE86IGJldHRlciB3aWR0aCBjYWxjdWxhdGlvbnMgdGhhdCBkb24ndCBhc3N1bWUgYWx3YXlzIHVuaWZvcm0gZGF0YSBzcGFjaW5nO3cKKyAgICAgICAgICAuYXR0cignd2lkdGgnLCAoYXZhaWxhYmxlV2lkdGggLyBkYXRhWzBdLnZhbHVlcy5sZW5ndGgpICogLjkgKQorCisKKyAgICAgIGQzLnRyYW5zaXRpb24oYmFycykKKyAgICAgICAgICAvLy5hdHRyKCd5JywgZnVuY3Rpb24oZCxpKSB7ICByZXR1cm4geShNYXRoLm1heCgwLCBnZXRZKGQsaSkpKSB9KQorICAgICAgICAgIC5hdHRyKCd5JywgZnVuY3Rpb24oZCxpKSB7CisgICAgICAgICAgICByZXR1cm4gZ2V0WShkLGkpIDwgMCA/CisgICAgICAgICAgICAgICAgICAgIHkoMCkgOgorICAgICAgICAgICAgICAgICAgICB5KDApIC0geShnZXRZKGQsaSkpIDwgMSA/CisgICAgICAgICAgICAgICAgICAgICAgeSgwKSAtIDEgOgorICAgICAgICAgICAgICAgICAgICAgIHkoZ2V0WShkLGkpKQorICAgICAgICAgIH0pCisgICAgICAgICAgLmF0dHIoJ2hlaWdodCcsIGZ1bmN0aW9uKGQsaSkgeyByZXR1c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b2YgXy5ib3R0b20gIT0gJ3VuZGVmaW5lZCcgPyBfLmJvdHRvbSA6IG1hcmdpbi5ib3R0b207CisgICAgbWFyZ2luLmxlZnQgICA9IHR5cGVvZiBfLmxlZnQgICAhPSAndW5kZWZpbmVkJyA/IF8ubGVmdCAgIDogbWFyZ2luLmxlZnQ7CisgICAgcmV0dXJuIGNoYXJ0OworICB9OworCisgIGNoYXJ0LndpZHRoID0gZnVuY3Rpb24oXykgeworICAgIGlmICghYXJndW1lbnRzLmxlbmd0aCkgcmV0dXJuIHdpZHRoOworICAgIHdpZHRoID0gXzsKKyAgICByZXR1cm4gY2hhcnQ7CisgIH07CisKKyAgY2hhcnQuaGVpZ2h0ID0gZnVuY3Rpb24oXykgeworICAgIGlmICghYXJndW1lbnRzLmxlbmd0aCkgcmV0dXJuIGhlaWdodDsKKyAgICBoZWlnaHQgPSBfOworICAgIHJldHVybiBjaGFydDsKKyAgfTsKKworICBjaGFydC54U2NhbGUgPSBmdW5jdGlvbihfKSB7CisgICAgaWYgKCFhcmd1bWVudHMubGVuZ3RoKSByZXR1cm4geDsKKyAgICB4ID0gXzsKKyAgICByZXR1cm4gY2hhcnQ7CisgIH07CisKKyAgY2hhcnQueVNjYWxlID0gZnVuY3Rpb24oXykgeworICAgIGlmICghYXJndW1lbnRzLmxlbmd0aCkgcmV0dXJuIHk7CisgICAgeSA9IF87CisgICAgcmV0dXJuIGNoYXJ0OworICB9OworCisgIGNoYXJ0LnhEb21haW4gPSBmdW5jdGlvbihfKSB7CisgICAgaWYgKCFhcmd1bWVudHMubGVuZ3RoKSByZXR1cm4geERvbWFpbjsKKyAgICB4RG9tYWluID0gXzsKKyAgICByZXR1cm4gY2hhcnQ7CisgIH07CisKKyAgY2hhcnQueURvbWFpbiA9IGZ1bmN0aW9uKF8pIHsKKyAgICBpZiAoIWFyZ3VtZW50cy5sZW5ndGgpIHJldHVybiB5RG9tYWluOworICAgIHlEb21haW4gPSBfOworICAgIHJldHVybiBjaGFydDsKKyAgfTsKKworICBjaGFydC5mb3JjZVggPSBmdW5jdGlvbihfKSB7CisgICAgaWYgKCFhcmd1bWVudHMubGVuZ3RoKSByZXR1cm4gZm9yY2VYOworICAgIGZvcmNlWCA9IF87CisgICAgcmV0dXJuIGNoYXJ0OworICB9OworCisgIGNoYXJ0LmZvcmNlWSA9IGZ1bmN0aW9uKF8pIHsKKyAgICBpZiAoIWFyZ3VtZW50cy5sZW5ndGgpIHJldHVybiBmb3JjZVk7CisgICAgZm9yY2VZID0gXzsKKyAgICByZXR1cm4gY2hhcnQ7CisgIH07CisKKyAgY2hhcnQucGFkRGF0YSA9IGZ1bmN0aW9uKF8pIHsKKyAgICBpZiAoIWFyZ3VtZW50cy5sZW5ndGgpIHJldHVybiBwYWREYXRhOworICAgIHBhZERhdGEgPSBfOworICAgIHJldHVybiBjaGFydDsKKyAgfTsKKworICBjaGFydC5jbGlwRWRnZSA9IGZ1bmN0aW9uKF8pIHsKKyAgICBpZiAoIWFyZ3VtZW50cy5sZW5ndGgpIHJldHVybiBjbGlwRWRnZTsKKyAgICBjbGlwRWRnZSA9IF87CisgICAgcmV0dXJuIGNoYXJ0OworICB9OworCisgIGNoYXJ0LmNvbG9yID0gZnVuY3Rpb24oXykgeworICAgIGlmICghYXJndW1lbnRzLmxlbmd0aCkgcmV0dXJuIGNvbG9yOworICAgIGNvbG9yID0gbnYudXRpbHMuZ2V0Q29sb3IoXyk7CisgICAgcmV0dXJuIGNoYXJ0OworICB9OworCisgIGNoYXJ0LmlkID0gZnVuY3Rpb24oXykgeworICAgIGlmICghYXJndW1lbnRzLmxlbmd0aCkgcmV0dXJuIGlkOworICAgIGlkID0gXzsKKyAgICByZXR1cm4gY2hhcnQ7CisgIH07CisKKyAgLy89PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKworCisgIHJldHVybiBjaGFydDsKK30KKworbnYubW9kZWxzLmhpc3RvcmljYWxCYXJDaGFydCA9IGZ1bmN0aW9uKCkgeworCisgIC8vPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisgIC8vIFB1YmxpYyBWYXJpYWJsZXMgd2l0aCBEZWZhdWx0IFNldHRpbmdzCisgIC8vLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tCisKKyAgdmFyIGJhcnMgPSBudi5tb2RlbHMuaGlzdG9yaWNhbEJhcigpCisgICAgLCB4QXhpcyA9IG52Lm1vZGVscy5heGlzKCkKKyAgICAsIHlBeGlzID0gbnYubW9kZWxzLmF4aXMoKQorICAgICwgbGVnZW5kID0gbnYubW9kZWxzLmxlZ2VuZCgpCisgICAgOworCisgIHZhciBtYXJnaW4gPSB7dG9wOiAzMCwgcmlnaHQ6IDkwLCBib3R0b206IDUwLCBsZWZ0OiA5MH0KKyAgICAsIGNvbG9yID0gbnYudXRpbHMuZGVmYXVsdENvbG9yKCkKKyAgICAsIHdpZHRoID0gbnVsbAorICAgICwgaGVpZ2h0ID0gbnVsbAorICAgICwgc2hvd0xlZ2VuZCA9IGZhbHNlCisgICAgLCBzaG93WEF4aXMgPSB0cnVlCisgICAgLCBzaG93WUF4aXMgPSB0cnVlCisgICAgLCByaWdodEFsaWduWUF4aXMgPSBmYWxzZQorICAgICwgdG9vbHRpcHMgPSB0cnVlCisgICAgLCB0b29sdGlwID0gZnVuY3Rpb24oa2V5LCB4LCB5LCBlLCBncmFwaCkgeworICAgICAgICByZXR1cm4gJzxoMz4nICsga2V5ICsgJzwvaDM+JyArCisgICAgICAgICAgICAgICAnPHA+JyArICB5ICsgJyBhdCAnICsgeCArICc8L3A+JworICAgICAgfQorICAgICwgeAorICAgICwgeQorICAgICwgc3RhdGUgPSB7fQorICAgICwgZGVmYXVsdFN0YXRlID0gbnVsbAorICAgICwgbm9EYXRhID0gJ05vIERhdGEgQXZhaWxhYmxlLicKKyAgICAsIGRpc3BhdGNoID0gZDMuZGlzcGF0Y2goJ3Rvb2x0aXBTaG93JywgJ3Rvb2x0aXBIaWRlJywgJ3N0YXRlQ2hhbmdlJywgJ2NoYW5nZVN0YXRlJykKKyAgICA7CisKKyAgeEF4aXMKKyAgICAub3JpZW50KCdib3R0b20nKQorICAgIC50aWNrUGFkZGluZyg3KQorICAgIDsKKyAgeUF4aXMKKyAgICAub3JpZW50KCAocmlnaHRBbGlnbllBeGlzKSA/ICdyaWdodCcgOiAnbGVmdCcpCisgICAgOworCisgIC8vPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisKKworICAvLz09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorICAvLyBQcml2YXRlIFZhcmlhYmxlcworICAvLy0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLQorCisgIHZhciBzaG93VG9vbHRpcCA9IGZ1bmN0aW9uKGUsIG9mZnNldEVsZW1lbnQpIHsKKworICAgIC8vIE5ldyBhZGRpdGlvbiB0byBjYWxjdWxhdGUgcG9zaXRpb24gaWYgU1ZHIGlzIHNjYWxlZCB3aXRoIHZpZXdCb3gsIG1heSBtb3ZlIFRPRE86IGNvbnNpZGVyIGltcGxlbWVudGluZyBldmVyeXdoZXJlIGVsc2UKKyAgICBpZiAob2Zmc2V0RWxlbWVudCkgeworICAgICAgdmFyIHN2ZyA9IGQzLnNlbGVjdChvZmZzZXRFbGVtZW50KS5zZWxlY3QoJ3N2ZycpOworICAgICAgdmFyIHZpZXdCb3ggPSAoc3ZnLm5vZGUoKSkgPyBzdmcuYXR0cigndmlld0JveCcpIDogbnVsbDsKKyAgICAgIGlmICh2aWV3Qm94KSB7CisgICAgICAgIHZpZXdCb3ggPSB2aWV3Qm94LnNwbGl0KCcgJyk7CisgICAgICAgIHZhciByYXRpbyA9IHBhcnNlSW50KHN2Zy5zdHlsZSgnd2lkdGgnKSkgLyB2aWV3Qm94WzJdOworICAgICAgICBlLnBvc1swXSA9IGUucG9zWzBdICogcmF0aW87CisgICAgICAgIGUucG9zWzFdID0gZS5wb3NbMV0gKiByYXRpbzsKKyAgICAgIH0KKyAgICB9CisKKyAgICB2YXIgbGVmdCA9IGUucG9zWzBdICsgKCBvZmZzZXRFbGVtZW50Lm9mZnNldExlZnQgfHwgMCApLAorICAgICAgICB0b3AgPSBlLnBvc1sxXSArICggb2Zmc2V0RWxlbWVudC5vZmZzZXRUb3AgfHwgMCksCisgICAgICAgIHggPSB4QXhpcy50aWNrRm9ybWF0KCkoYmFycy54KCkoZS5wb2ludCwgZS5wb2ludEluZGV4KSksCisgICAgICAgIHkgPSB5QXhpcy50aWNrRm9ybWF0KCkoYmFycy55KCkoZS5wb2ludCwgZS5wb2ludEluZGV4KSksCisgICAgICAgIGNvbnRlbnQgPSB0b29sdGlwKGUuc2VyaWVzLmtleSwgeCwgeSwgZSwgY2hhcnQpOworCisgICAgbnYudG9vbHRpcC5zaG93KFtsZWZ0LCB0b3BdLCBjb250ZW50LCBudWxsLCBudWxsLCBvZmZzZXRFbGVtZW50KTsKKyAgfTsKKworICAvLz09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorCisKKyAgZnVuY3Rpb24gY2hhcnQoc2VsZWN0aW9uKSB7CisgICAgc2VsZWN0aW9uLmVhY2goZnVuY3Rpb24oZGF0YSkgeworICAgICAgdmFyIGNvbnRhaW5lciA9IGQzLnNlbGVjdCh0aGlzKSwKKyAgICAgICAgICB0aGF0ID0gdGhpczsKKworICAgICAgdmFyIGF2YWlsYWJsZVdpZHRoID0gKHdpZHRoICB8fCBwYXJzZUludChjb250YWluZXIuc3R5bGUoJ3dpZHRoJykpIHx8IDk2MCkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLSBtYXJna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udChzKQorCisgICAgICBiYXJzCisgICAgICAgIC53aWR0aChhdmFpbGFibGVXaWR0aCkKKyAgICAgICAgLmhlaWdodChhdmFpbGFibGVIZWlnaHQpCisgICAgICAgIC5jb2xvcihkYXRhLm1hcChmdW5jdGlvbihkLGkpIHsKKyAgICAgICAgICByZXR1cm4gZC5jb2xvciB8fCBjb2xvcihkLCBpKTsKKyAgICAgICAgfSkuZmlsdGVyKGZ1bmN0aW9uKGQsaSkgeyByZXR1cm4gIWRhdGFbaV0uZGlzYWJsZWQgfSkpOworCisKKyAgICAgIHZhciBiYXJzV3JhcCA9IGcuc2VsZWN0KCcubnYtYmFyc1dyYXAnKQorICAgICAgICAgIC5kYXR1bShkYXRhLmZpbHRlcihmdW5jdGlvbihkKSB7IHJldHVybiAhZC5kaXNhYmxlZCB9KSkKKworICAgICAgZDMudHJhbnNpdGlvbihiYXJzV3JhcCkuY2FsbChiYXJzKTsKKworICAgICAgLy8tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0KKworCisgICAgICAvLy0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLQorICAgICAgLy8gU2V0dXAgQXhlcworCisgICAgICBpZiAoc2hvd1hBeGlzKSB7CisgICAgICAgIHhBeGlzCisgICAgICAgICAgLnNjYWxlKHgpCisgICAgICAgICAgLnRpY2tTaXplKC1hdmFpbGFibGVIZWlnaHQsIDApOworCisgICAgICAgIGcuc2VsZWN0KCcubnYteC5udi1heGlzJykKKyAgICAgICAgICAgIC5hdHRyKCd0cmFuc2Zvcm0nLCAndHJhbnNsYXRlKDAsJyArIHkucmFuZ2UoKVswXSArICcpJyk7CisgICAgICAgIGcuc2VsZWN0KCcubnYteC5udi1heGlzJykKKyAgICAgICAgICAudHJhbnNpdGlvbigpCisgICAgICAgICAgICAuY2FsbCh4QXhpcyk7CisgICAgICB9CisKKyAgICAgIGlmIChzaG93WUF4aXMpIHsKKyAgICAgICAgeUF4aXMKKyAgICAgICAgICAuc2NhbGUoeSkKKyAgICAgICAgICAudGlja3MoIGF2YWlsYWJsZUhlaWdodCAvIDM2ICkKKyAgICAgICAgICAudGlja1NpemUoIC1hdmFpbGFibGVXaWR0aCwgMCk7CisKKyAgICAgICAgZy5zZWxlY3QoJy5udi15Lm52LWF4aXMnKQorICAgICAgICAgIC50cmFuc2l0aW9uKCkuZHVyYXRpb24oMCkKKyAgICAgICAgICAgIC5jYWxsKHlBeGlzKTsKKyAgICAgIH0KKyAgICAgIC8vLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tCisKKworICAgICAgLy89PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKyAgICAgIC8vIEV2ZW50IEhhbmRsaW5nL0Rpc3BhdGNoaW5nIChpbiBjaGFydCdzIHNjb3BlKQorICAgICAgLy8tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0KKworICAgICAgbGVnZW5kLmRpc3BhdGNoLm9uKCdsZWdlbmRDbGljaycsIGZ1bmN0aW9uKGQsaSkgeyAKKyAgICAgICAgZC5kaXNhYmxlZCA9ICFkLmRpc2FibGVkOworCisgICAgICAgIGlmICghZGF0YS5maWx0ZXIoZnVuY3Rpb24oZCkgeyByZXR1cm4gIWQuZGlzYWJsZWQgfSkubGVuZ3RoKSB7CisgICAgICAgICAgZGF0YS5tYXAoZnVuY3Rpb24oZCkgeworICAgICAgICAgICAgZC5kaXNhYmxlZCA9IGZhbHNlOworICAgICAgICAgICAgd3JhcC5zZWxlY3RBbGwoJy5udi1zZXJpZXMnKS5jbGFzc2VkKCdkaXNhYmxlZCcsIGZhbHNlKTsKKyAgICAgICAgICAgIHJldHVybiBkOworICAgICAgICAgIH0pOworICAgICAgICB9CisKKyAgICAgICAgc3RhdGUuZGlzYWJsZWQgPSBkYXRhLm1hcChmdW5jdGlvbihkKSB7IHJldHVybiAhIWQuZGlzYWJsZWQgfSk7CisgICAgICAgIGRpc3BhdGNoLnN0YXRlQ2hhbmdlKHN0YXRlKTsKKworICAgICAgICBzZWxlY3Rpb24udHJhbnNpdGlvbigpLmNhbGwoY2hhcnQpOworICAgICAgfSk7CisKKyAgICAgIGxlZ2VuZC5kaXNwYXRjaC5vbignbGVnZW5kRGJsY2xpY2snLCBmdW5jdGlvbihkKSB7CisgICAgICAgICAgLy9Eb3VibGUgY2xpY2tpbmcgc2hvdWxkIGFsd2F5cyBlbmFibGUgY3VycmVudCBzZXJpZXMsIGFuZCBkaXNhYmxlZCBhbGwgb3RoZXJzLgorICAgICAgICAgIGRhdGEuZm9yRWFjaChmdW5jdGlvbihkKSB7CisgICAgICAgICAgICAgZC5kaXNhYmxlZCA9IHRydWU7CisgICAgICAgICAgfSk7CisgICAgICAgICAgZC5kaXNhYmxlZCA9IGZhbHNlOyAgCisKKyAgICAgICAgICBzdGF0ZS5kaXNhYmxlZCA9IGRhdGEubWFwKGZ1bmN0aW9uKGQpIHsgcmV0dXJuICEhZC5kaXNhYmxlZCB9KTsKKyAgICAgICAgICBkaXNwYXRjaC5zdGF0ZUNoYW5nZShzdGF0ZSk7CisgICAgICAgICAgY2hhcnQudXBkYXRlKCk7CisgICAgICB9KTsKKworCisvKgorICAgICAgbGVnZW5kLmRpc3BhdGNoLm9uKCdsZWdlbmRNb3VzZW92ZXInLCBmdW5jdGlvbihkLCBpKSB7CisgICAgICAgIGQuaG92ZXIgPSB0cnVlOworICAgICAgICBzZWxlY3Rpb24udHJhbnNpdGlvbigpLmNhbGwoY2hhcnQpCisgICAgICB9KTsKKworICAgICAgbGVnZW5kLmRpc3BhdGNoLm9uKCdsZWdlbmRNb3VzZW91dCcsIGZ1bmN0aW9uKGQsIGkpIHsKKyAgICAgICAgZC5ob3ZlciA9IGZhbHNlOworICAgICAgICBzZWxlY3Rpb24udHJhbnNpdGlvbigpLmNhbGwoY2hhcnQpCisgICAgICB9KTsKKyovCisKKyAgICAgIGRpc3BhdGNoLm9uKCd0b29sdGlwU2hvdycsIGZ1bmN0aW9uKGUpIHsKKyAgICAgICAgaWYgKHRvb2x0aXBzKSBzaG93VG9vbHRpcChlLCB0aGF0LnBhcmVudE5vZGUpOworICAgICAgfSk7CisKKworICAgICAgZGlzcGF0Y2gub24oJ2NoYW5nZVN0YXRlJywgZnVuY3Rpb24oZSkgeworCisgICAgICAgIGlmICh0eXBlb2YgZS5kaXNhYmxlZCAhPT0gJ3VuZGVmaW5lZCcpIHsKKyAgICAgICAgICBkYXRhLmZvckVhY2goZnVuY3Rpb24oc2VyaWVzLGkpIHsKKyAgICAgICAgICAgIHNlcmllcy5kaXNhYmxlZCA9IGUuZGlzYWJsZWRbaV07CisgICAgICAgICAgfSk7CisKKyAgICAgICAgICBzdGF0ZS5kaXNhYmxlZCA9IGUuZGlzYWJsZWQ7CisgICAgICAgIH0KKworICAgICAgICBzZWxlY3Rpb24uY2FsbChjaGFydCk7CisgICAgICB9KTsKKworICAgICAgLy89PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKworICAgIH0pOworCisgICAgcmV0dXJuIGNoYXJ0OworICB9CisKKworICAvLz09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorICAvLyBFdmVudCBIYW5kbGluZy9EaXNwYXRjaGluZyAob3V0IG9mIGNoYXJ0J3Mgc2NvcGUpCisgIC8vLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tCisKKyAgYmFycy5kaXNwYXRjaC5vbignZWxlbWVudE1vdXNlb3Zlci50b29sdG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BsZWdlbmQuY29sb3IoY29sb3IpOworICAgIHJldHVybiBjaGFydDsKKyAgfTsKKworICBjaGFydC5zaG93TGVnZW5kID0gZnVuY3Rpb24oXykgeworICAgIGlmICghYXJndW1lbnRzLmxlbmd0aCkgcmV0dXJuIHNob3dMZWdlbmQ7CisgICAgc2hvd0xlZ2VuZCA9IF87CisgICAgcmV0dXJuIGNoYXJ0OworICB9OworCisgIGNoYXJ0LnNob3dYQXhpcyA9IGZ1bmN0aW9uKF8pIHsKKyAgICBpZiAoIWFyZ3VtZW50cy5sZW5ndGgpIHJldHVybiBzaG93WEF4aXM7CisgICAgc2hvd1hBeGlzID0gXzsKKyAgICByZXR1cm4gY2hhcnQ7CisgIH07CisKKyAgY2hhcnQuc2hvd1lBeGlzID0gZnVuY3Rpb24oXykgeworICAgIGlmICghYXJndW1lbnRzLmxlbmd0aCkgcmV0dXJuIHNob3dZQXhpczsKKyAgICBzaG93WUF4aXMgPSBfOworICAgIHJldHVybiBjaGFydDsKKyAgfTsKKworICBjaGFydC5yaWdodEFsaWduWUF4aXMgPSBmdW5jdGlvbihfKSB7CisgICAgaWYoIWFyZ3VtZW50cy5sZW5ndGgpIHJldHVybiByaWdodEFsaWduWUF4aXM7CisgICAgcmlnaHRBbGlnbllBeGlzID0gXzsKKyAgICB5QXhpcy5vcmllbnQoIChfKSA/ICdyaWdodCcgOiAnbGVmdCcpOworICAgIHJldHVybiBjaGFydDsKKyAgfTsKKworICBjaGFydC50b29sdGlwcyA9IGZ1bmN0aW9uKF8pIHsKKyAgICBpZiAoIWFyZ3VtZW50cy5sZW5ndGgpIHJldHVybiB0b29sdGlwczsKKyAgICB0b29sdGlwcyA9IF87CisgICAgcmV0dXJuIGNoYXJ0OworICB9OworCisgIGNoYXJ0LnRvb2x0aXBDb250ZW50ID0gZnVuY3Rpb24oXykgeworICAgIGlmICghYXJndW1lbnRzLmxlbmd0aCkgcmV0dXJuIHRvb2x0aXA7CisgICAgdG9vbHRpcCA9IF87CisgICAgcmV0dXJuIGNoYXJ0OworICB9OworCisgIGNoYXJ0LnN0YXRlID0gZnVuY3Rpb24oXykgeworICAgIGlmICghYXJndW1lbnRzLmxlbmd0aCkgcmV0dXJuIHN0YXRlOworICAgIHN0YXRlID0gXzsKKyAgICByZXR1cm4gY2hhcnQ7CisgIH07CisKKyAgY2hhcnQuZGVmYXVsdFN0YXRlID0gZnVuY3Rpb24oXykgeworICAgIGlmICghYXJndW1lbnRzLmxlbmd0aCkgcmV0dXJuIGRlZmF1bHRTdGF0ZTsKKyAgICBkZWZhdWx0U3RhdGUgPSBfOworICAgIHJldHVybiBjaGFydDsKKyAgfTsKKworICBjaGFydC5ub0RhdGEgPSBmdW5jdGlvbihfKSB7CisgICAgaWYgKCFhcmd1bWVudHMubGVuZ3RoKSByZXR1cm4gbm9EYXRhOworICAgIG5vRGF0YSA9IF87CisgICAgcmV0dXJuIGNoYXJ0OworICB9OworCisgIC8vPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisKKworICByZXR1cm4gY2hhcnQ7Cit9Citudi5tb2RlbHMuaW5kZW50ZWRUcmVlID0gZnVuY3Rpb24oKSB7CisKKyAgLy89PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKyAgLy8gUHVibGljIFZhcmlhYmxlcyB3aXRoIERlZmF1bHQgU2V0dGluZ3MKKyAgLy8tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0KKworICB2YXIgbWFyZ2luID0ge3RvcDogMCwgcmlnaHQ6IDAsIGJvdHRvbTogMCwgbGVmdDogMH0gLy9UT0RPOiBpbXBsZW1lbnQsIG1heWJlIGFzIG1hcmdpbiBvbiB0aGUgY29udGFpbmluZyBkaXYKKyAgICAsIHdpZHRoID0gOTYwCisgICAgLCBoZWlnaHQgPSA1MDAKKyAg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7IH0pCisgICAgICAgICAgICAgIC5vbignY2xpY2snLCBjbGljayk7CisgICAgICAgIH0KKworCisgICAgICAgIG5vZGVOYW1lLmFwcGVuZCgnc3BhbicpCisgICAgICAgICAgICAuYXR0cignY2xhc3MnLCBkMy5mdW5jdG9yKGNvbHVtbi5jbGFzc2VzKSApCisgICAgICAgICAgICAudGV4dChmdW5jdGlvbihkKSB7IHJldHVybiBjb2x1bW4uZm9ybWF0ID8gY29sdW1uLmZvcm1hdChkKSA6CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKGRbY29sdW1uLmtleV0gfHwgJy0nKSB9KTsKKworICAgICAgICBpZiAgKGNvbHVtbi5zaG93Q291bnQpIHsKKyAgICAgICAgICBub2RlTmFtZS5hcHBlbmQoJ3NwYW4nKQorICAgICAgICAgICAgICAuYXR0cignY2xhc3MnLCAnbnYtY2hpbGRyZW5Db3VudCcpOworCisgICAgICAgICAgbm9kZS5zZWxlY3RBbGwoJ3NwYW4ubnYtY2hpbGRyZW5Db3VudCcpLnRleHQoZnVuY3Rpb24oZCkgeworICAgICAgICAgICAgICAgIHJldHVybiAoKGQudmFsdWVzICYmIGQudmFsdWVzLmxlbmd0aCkgfHwgKGQuX3ZhbHVlcyAmJiBkLl92YWx1ZXMubGVuZ3RoKSkgPyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLy9JZiB0aGlzIGlzIGEgcGFyZW50CisgICAgICAgICAgICAgICAgICAgICcoJyArICgoZC52YWx1ZXMgJiYgKGQudmFsdWVzLmZpbHRlcihmdW5jdGlvbihkKSB7IHJldHVybiBmaWx0ZXJaZXJvID8gZmlsdGVyWmVybyhkKSA6ICB0cnVlOyB9KS5sZW5ndGgpKSAvL0lmIGNoaWxkcmVuIGFyZSBpbiB2YWx1ZXMgY2hlY2sgaXRzIGNoaWxkcmVuIGFuZCBmaWx0ZXIKKyAgICAgICAgICAgICAgICAgICAgfHwgKGQuX3ZhbHVlcyAmJiBkLl92YWx1ZXMuZmlsdGVyKGZ1bmN0aW9uKGQpIHsgcmV0dXJuIGZpbHRlclplcm8gPyBmaWx0ZXJaZXJvKGQpIDogIHRydWU7IH0pLmxlbmd0aCkgICAgIC8vT3RoZXJ3aXNlLCBkbyB0aGUgc2FtZSwgYnV0IHdpdGggdGhlIG90aGVyIG5hbWUsIF92YWx1ZXMuLi4KKyAgICAgICAgICAgICAgICAgICAgfHwgMCkgKyAnKScgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vVGhpcyBpcyB0aGUgY2F0Y2gtYWxsIGluIGNhc2UgdGhlcmUgYXJlIG5vIGNoaWxkcmVuIGFmdGVyIGEgZmlsdGVyCisgICAgICAgICAgICAgICAgICAgIDogJycgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vSWYgdGhpcyBpcyBub3QgYSBwYXJlbnQsIGp1c3QgZ2l2ZSBhbiBlbXB0eSBzdHJpbmcKKyAgICAgICAgICAgIH0pOworICAgICAgICB9CisKKyAgICAgICAgaWYgKGNvbHVtbi5jbGljaykKKyAgICAgICAgICBub2RlTmFtZS5zZWxlY3QoJ3NwYW4nKS5vbignY2xpY2snLCBjb2x1bW4uY2xpY2spOworCisgICAgICB9KTsKKworICAgICAgbm9kZQorICAgICAgICAub3JkZXIoKQorICAgICAgICAub24oJ2NsaWNrJywgZnVuY3Rpb24oZCkgeyAKKyAgICAgICAgICBkaXNwYXRjaC5lbGVtZW50Q2xpY2soeworICAgICAgICAgICAgcm93OiB0aGlzLCAvL1RPRE86IGRlY2lkZSB3aGV0aGVyIG9yIG5vdCB0aGlzIHNob3VsZCBiZSBjb25zaXN0ZW50IHdpdGggc2NhdHRlci9saW5lIGV2ZW50cyBvciBzaG91bGQgYmUgYW4gaHRtbCBsaW5rIChhIGhyZWYpCisgICAgICAgICAgICBkYXRhOiBkLAorICAgICAgICAgICAgcG9zOiBbZC54LCBkLnldCisgICAgICAgICAgfSk7CisgICAgICAgIH0pCisgICAgICAgIC5vbignZGJsY2xpY2snLCBmdW5jdGlvbihkKSB7IAorICAgICAgICAgIGRpc3BhdGNoLmVsZW1lbnREYmxjbGljayh7CisgICAgICAgICAgICByb3c6IHRoaXMsCisgICAgICAgICAgICBkYXRhOiBkLAorICAgICAgICAgICAgcG9zOiBbZC54LCBkLnldCisgICAgICAgICAgfSk7CisgICAgICAgIH0pCisgICAgICAgIC5vbignbW91c2VvdmVyJywgZnVuY3Rpb24oZCkgeyAKKyAgICAgICAgICBkaXNwYXRjaC5lbGVtZW50TW91c2VvdmVyKHsKKyAgICAgICAgICAgIHJvdzogdGhpcywKKyAgICAgICAgICAgIGRhdGE6IGQsCisgICAgICAgICAgICBwb3M6IFtkLngsIGQueV0KKyAgICAgICAgICB9KTsKKyAgICAgICAgfSkKKyAgICAgICAgLm9uKCdtb3VzZW91dCcsIGZ1bmN0aW9uKGQpIHsgCisgICAgICAgICAgZGlzcGF0Y2guZWxlbWVudE1vdXNlb3V0KHsKKyAgICAgICAgICAgIHJvdzogdGhpcywKKyAgICAgICAgICAgIGRhdGE6IGQsCisgICAgICAgICAgICBwb3M6IFtkLngsIGQueV0KKyAgICAgICAgICB9KTsKKyAgICAgICAgfSk7CisKKworCisKKyAgICAgIC8vIFRvZ2dsZSBjaGlsZHJlbiBvbiBjbGljay4KKyAgICAgIGZ1bmN0aW9uIGNsaWNrKGQsIF8sIHVuc2hpZnQpIHsKKyAgICAgICAgZDMuZXZlbnQuc3RvcFByb3BhZ2F0aW9uKCk7CisKKyAgICAgICAgaWYoZDMuZXZlbnQuc2hpZnRLZXkgJiYgIXVuc2hpZnQpIHsKKyAgICAgICAgICAvL0lmIHlvdSBzaGlmdC1jbGljaywgaXQnbGwgdG9nZ2xlIGZvbGQgYWxsIHRoZSBjaGlsZHJlbiwgaW5zdGVhZCBvZiBpdHNlbGYKKyAgICAgICAgICBkMy5ldmVudC5zaGlmdEtleSA9IGZhbHNlOworICAgICAgICAgIGQudmFsdWVzICYmIGQudmFsdWVzLmZvckVhY2goZnVuY3Rpb24obm9kZSl7CisgICAgICAgICAgICBpZiAobm9kZS52YWx1ZXMgfHwgbm9kZS5fdmFsdWVzKSB7CisgICAgICAgICAgICAgIGNsaWNrKG5vZGUsIDAsIHRydWUpOworICAgICAgICAgICAgfQorICAgICAgICAgIH0pOworICAgICAgICAgIHJldHVybiB0cnVlOworICAgICAgICB9CisgICAgICAgIGlmKCFoYXNDaGlsZHJlbihkKSkgeworICAgICAgICAgIC8vZG93bmxvYWQgZmlsZQorICAgICAgICAgIC8vd2luZG93LmxvY2F0aW9uLmhyZWYgPSBkLnVybDsKKyAgICAgICAgICByZXR1cm4gdHJ1ZTsKKyAgICAgICAgfQorICAgICAgICBpZiAoZC52YWx1ZXMpIHsKKyAgICAgICAgICBkLl92YWx1ZXMgPSBkLnZhbHVlczsKKyAgICAgICAgICBkLnZhbHVlcyA9IG51bGw7CisgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgZC52YWx1ZXMgPSBkLl92YWx1ZXM7CisgICAgICAgICAgZC5fdmFsdWVzID0gbnVsbDsKKyAgICAgICAgfQorICAgICAgICBjaGFydC51cGRhdGUoKTsKKyAgICAgIH0KKworCisgICAgICBmdW5jdGlvbiBpY29uKGQpIHsKKyAgICAgICAgcmV0dXJuIChkLl92YWx1ZXMgJiYgZC5fdmFsdWVzLmxlbmd0aCkgPyBpY29uT3BlbiA6IChkLnZhbHVlcyAmJiBkLnZhbHVlcy5sZW5ndGgpID8gaWNvbkNsb3NlIDogJyc7CisgICAgICB9CisKKyAgICAgIGZ1bmN0aW9uIGZvbGRlZChkKSB7CisgICAgICAgIHJldHVybiAoZC5fdmFsdWVzICYmIGQuX3ZhbHVlcy5sZW5ndGgpOworICAgICAgfQorCisgICAgICBmdW5j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HJldHVybiBjaGFydDsKKyAgfTsKKworICBjaGFydC5oZWlnaHQgPSBmdW5jdGlvbihfKSB7CisgICAgaWYgKCFhcmd1bWVudHMubGVuZ3RoKSByZXR1cm4gaGVpZ2h0OworICAgIGhlaWdodCA9IF87CisgICAgcmV0dXJuIGNoYXJ0OworICB9OworCisgIGNoYXJ0LmNvbG9yID0gZnVuY3Rpb24oXykgeworICAgIGlmICghYXJndW1lbnRzLmxlbmd0aCkgcmV0dXJuIGNvbG9yOworICAgIGNvbG9yID0gbnYudXRpbHMuZ2V0Q29sb3IoXyk7CisgICAgc2NhdHRlci5jb2xvcihjb2xvcik7CisgICAgcmV0dXJuIGNoYXJ0OworICB9OworCisgIGNoYXJ0LmlkID0gZnVuY3Rpb24oXykgeworICAgIGlmICghYXJndW1lbnRzLmxlbmd0aCkgcmV0dXJuIGlkOworICAgIGlkID0gXzsKKyAgICByZXR1cm4gY2hhcnQ7CisgIH07CisKKyAgY2hhcnQuaGVhZGVyID0gZnVuY3Rpb24oXykgeworICAgIGlmICghYXJndW1lbnRzLmxlbmd0aCkgcmV0dXJuIGhlYWRlcjsKKyAgICBoZWFkZXIgPSBfOworICAgIHJldHVybiBjaGFydDsKKyAgfTsKKworICBjaGFydC5ub0RhdGEgPSBmdW5jdGlvbihfKSB7CisgICAgaWYgKCFhcmd1bWVudHMubGVuZ3RoKSByZXR1cm4gbm9EYXRhOworICAgIG5vRGF0YSA9IF87CisgICAgcmV0dXJuIGNoYXJ0OworICB9OworCisgIGNoYXJ0LmZpbHRlclplcm8gPSBmdW5jdGlvbihfKSB7CisgICAgaWYgKCFhcmd1bWVudHMubGVuZ3RoKSByZXR1cm4gZmlsdGVyWmVybzsKKyAgICBmaWx0ZXJaZXJvID0gXzsKKyAgICByZXR1cm4gY2hhcnQ7CisgIH07CisKKyAgY2hhcnQuY29sdW1ucyA9IGZ1bmN0aW9uKF8pIHsKKyAgICBpZiAoIWFyZ3VtZW50cy5sZW5ndGgpIHJldHVybiBjb2x1bW5zOworICAgIGNvbHVtbnMgPSBfOworICAgIHJldHVybiBjaGFydDsKKyAgfTsKKworICBjaGFydC50YWJsZUNsYXNzID0gZnVuY3Rpb24oXykgeworICAgIGlmICghYXJndW1lbnRzLmxlbmd0aCkgcmV0dXJuIHRhYmxlQ2xhc3M7CisgICAgdGFibGVDbGFzcyA9IF87CisgICAgcmV0dXJuIGNoYXJ0OworICB9OworCisgIGNoYXJ0Lmljb25PcGVuID0gZnVuY3Rpb24oXyl7CisgICAgIGlmICghYXJndW1lbnRzLmxlbmd0aCkgcmV0dXJuIGljb25PcGVuOworICAgIGljb25PcGVuID0gXzsKKyAgICByZXR1cm4gY2hhcnQ7CisgIH0KKworICBjaGFydC5pY29uQ2xvc2UgPSBmdW5jdGlvbihfKXsKKyAgICAgaWYgKCFhcmd1bWVudHMubGVuZ3RoKSByZXR1cm4gaWNvbkNsb3NlOworICAgIGljb25DbG9zZSA9IF87CisgICAgcmV0dXJuIGNoYXJ0OworICB9CisKKyAgLy89PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKworCisgIHJldHVybiBjaGFydDsKK307bnYubW9kZWxzLmxlZ2VuZCA9IGZ1bmN0aW9uKCkgeworCisgIC8vPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisgIC8vIFB1YmxpYyBWYXJpYWJsZXMgd2l0aCBEZWZhdWx0IFNldHRpbmdzCisgIC8vLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tCisKKyAgdmFyIG1hcmdpbiA9IHt0b3A6IDUsIHJpZ2h0OiAwLCBib3R0b206IDUsIGxlZnQ6IDB9CisgICAgLCB3aWR0aCA9IDQwMAorICAgICwgaGVpZ2h0ID0gMjAKKyAgICAsIGdldEtleSA9IGZ1bmN0aW9uKGQpIHsgcmV0dXJu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0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tCisKKworICAgICAgdmFyIHNlcmllcyA9IGcuc2VsZWN0QWxsKCcubnYtc2VyaWVzJykKKyAgICAgICAgICAuZGF0YShmdW5jdGlvbihkKSB7IHJldHVybiBkIH0pOworICAgICAgdmFyIHNlcmllc0VudGVyID0gc2VyaWVzLmVudGVyKCkuYXBwZW5kKCdnJykuYXR0cignY2xhc3MnLCAnbnYtc2VyaWVzJykKKyAgICAgICAgICAub24oJ21vdXNlb3ZlcicsIGZ1bmN0aW9uKGQsaSkgeworICAgICAgICAgICAgZGlzcGF0Y2gubGVnZW5kTW91c2VvdmVyKGQsaSk7ICAvL1RPRE86IE1ha2UgY29uc2lzdGVudCB3aXRoIG90aGVyIGV2ZW50IG9iamVjdHMKKyAgICAgICAgICB9KQorICAgICAgICAgIC5vbignbW91c2VvdXQnLCBmdW5jdGlvbihkLGkpIHsKKyAgICAgICAgICAgIGRpc3BhdGNoLmxlZ2VuZE1vdXNlb3V0KGQsaSk7CisgICAgICAgICAgfSkKKyAgICAgICAgICAub24oJ2NsaWNrJywgZnVuY3Rpb24oZCxpKSB7CisgICAgICAgICAgICBkaXNwYXRjaC5sZWdlbmRDbGljayhkLGkpOworICAgICAgICAgIH0pCisgICAgICAgICAgLm9uKCdkYmxjbGljaycsIGZ1bmN0aW9uKGQsaSkgeworICAgICAgICAgICAgZGlzcGF0Y2gubGVnZW5kRGJsY2xpY2soZCxpKTsKKyAgICAgICAgICB9KTsKKyAgICAgIHNlcmllc0VudGVyLmFwcGVuZCgnY2lyY2xlJykKKyAgICAgICAgICAuc3R5bGUoJ3N0cm9rZS13aWR0aCcsIDIpCisgICAgICAgICAgLmF0dHIoJ3InLCA1KTsKKyAgICAgIHNlcmllc0VudGVyLmFwcGVuZCgndGV4dCcpCisgICAgICAgICAgLmF0dHIoJ3RleHQtYW5jaG9yJywgJ3N0YXJ0JykKK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MuY2FsY0FwcHJveFRleHRXaWR0aChsZWdlbmRUZXh0KTsKKyAgICAgICAgICAgICAgc2VyaWVzV2lkdGhzLnB1c2goc3ZnQ29tcHV0ZWRUZXh0TGVuZ3RoICsgMjgpOyAvLyAyOCBpcyB+IHRoZSB3aWR0aCBvZiB0aGUgY2lyY2xlIHBsdXMgc29tZSBwYWRkaW5nCisgICAgICAgICAgICB9KTsKKworICAgICAgICAvL252LmxvZygnU2VyaWVzIFdpZHRoczogJywgSlNPTi5zdHJpbmdpZnkoc2VyaWVzV2lkdGhzKSk7CisKKyAgICAgICAgdmFyIHNlcmllc1BlclJvdyA9IDA7CisgICAgICAgIHZhciBsZWdlbmRXaWR0aCA9IDA7CisgICAgICAgIHZhciBjb2x1bW5XaWR0aHMgPSBbXTsKKworICAgICAgICB3aGlsZSAoIGxlZ2VuZFdpZHRoIDwgYXZhaWxhYmxlV2lkdGggJiYgc2VyaWVzUGVyUm93IDwgc2VyaWVzV2lkdGhzLmxlbmd0aCkgeworICAgICAgICAgIGNvbHVtbldpZHRoc1tzZXJpZXNQZXJSb3ddID0gc2VyaWVzV2lkdGhzW3Nlcmllc1BlclJvd107CisgICAgICAgICAgbGVnZW5kV2lkdGggKz0gc2VyaWVzV2lkdGhzW3Nlcmllc1BlclJvdysrXTsKKyAgICAgICAgfQorCisKKyAgICAgICAgd2hpbGUgKCBsZWdlbmRXaWR0aCA+IGF2YWlsYWJsZVdpZHRoICYmIHNlcmllc1BlclJvdyA+IDEgKSB7CisgICAgICAgICAgY29sdW1uV2lkdGhzID0gW107CisgICAgICAgICAgc2VyaWVzUGVyUm93LS07CisKKyAgICAgICAgICBmb3IgKGsgPSAwOyBrIDwgc2VyaWVzV2lkdGhzLmxlbmd0aDsgaysrKSB7CisgICAgICAgICAgICBpZiAoc2VyaWVzV2lkdGhzW2tdID4gKGNvbHVtbldpZHRoc1trICUgc2VyaWVzUGVyUm93XSB8fCAwKSApCisgICAgICAgICAgICAgIGNvbHVtbldpZHRoc1trICUgc2VyaWVzUGVyUm93XSA9IHNlcmllc1dpZHRoc1trXTsKKyAgICAgICAgICB9CisKKyAgICAgICAgICBsZWdlbmRXaWR0aCA9IGNvbHVtbldpZHRocy5yZWR1Y2UoZnVuY3Rpb24ocHJldiwgY3VyLCBpbmRleCwgYXJyYXkpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHByZXYgKyBjdXI7CisgICAgICAgICAgICAgICAgICAgICAgICB9KTsKKyAgICAgICAgfQorICAgICAgICAvL2NvbnNvbGUubG9nKGNvbHVtbldpZHRocywgbGVnZW5kV2lkdGgsIHNlcmllc1BlclJvdyk7CisKKyAgICAgICAgdmFyIHhQb3NpdGlvbnMgPSBbXTsKKyAgICAgICAgZm9yICh2YXIgaSA9IDAsIGN1clggPSAwOyBpIDwgc2VyaWVzUGVyUm93OyBpKyspIHsKKyAgICAgICAgICAgIHhQb3NpdGlvbnNbaV0gPSBjdXJYOworICAgICAgICAgICAgY3VyWCArPSBjb2x1bW5XaWR0aHNbaV07CisgICAgICAgIH0KKworICAgICAgICBzZXJpZXMKKyAgICAgICAgICAgIC5hdHRyKCd0cmFuc2Zvcm0nLCBmdW5jdGlvbihkLCBpKSB7CisgICAgICAgICAgICAgIHJldHVybiAndHJhbnNsYXRlKCcgKyB4UG9zaXRpb25zW2kgJSBzZXJpZXNQZXJSb3ddICsgJywnICsgKDUgKyBNYXRoLmZsb29yKGkgLyBzZXJpZXNQZXJSb3cpICogMjApICsgJyknOworICAgICAgICAgICAgfSk7CisKKyAgICAgICAgLy9wb3NpdGlvbiBsZWdlbmQgYXMgZmFyIHJpZ2h0IGFzIHBvc3NpYmxlIHdpdGhpbiB0aGUgdG90YWwgd2lkdGgKKyAgICAgICAgZy5hdHRyKCd0cmFuc2Zvcm0nLCAndHJhbnNsYXRlKCcgKyAod2lkdGggLSBtYXJnaW4ucmlnaHQgLSBsZWdlbmRXaWR0aCkgKyAnLCcgKyBtYXJnaW4udG9wICsgJyknKTsKKworICAgICAgICBoZWlnaHQgPSBtYXJnaW4udG9wICsgbWFyZ2luLmJvdHRvbSArIChNYXRoLmNlaWwoc2VyaWVzV2lkdGhzLmxlbmd0aCAvIHNlcmllc1BlclJvdykgKiAyMCk7CisKKyAgICAgIH0gZWxzZSB7CisKKyAgICAgICAgdmFyIHlwb3MgPSA1LAorICAgICAgICAgICAgbmV3eHBvcyA9IDUsCisgICAgICAgICAgICBtYXh3aWR0aCA9IDAsCisgICAgICAgICAgICB4cG9zOworICAgICAgICBzZXJpZXMKKyAgICAgICAgICAgIC5hdHRyKCd0cmFuc2Zvcm0nLCBmdW5jdGlvbihkLCBpKSB7CisgICAgICAgICAgICAgIHZhciBsZW5ndGggPSBkMy5zZWxlY3QodGhpcykuc2VsZWN0KCd0ZXh0Jykubm9kZSgpLmdldENvbXB1dGVkVGV4dExlbmd0aCgpICsgMjg7CisgICAgICAgICAgICAgIHhwb3MgPSBuZXd4cG9zOworCisgICAgICAgICAgICAgIGlmICh3aWR0aCA8IG1hcmdpbi5sZWZ0ICsgbWFyZ2luLnJpZ2h0ICsgeHBvcyArIGxlbmd0aCkgeworICAgICAgICAgICAgICAgIG5ld3hwb3MgPSB4cG9zID0gNTsKKyAgICAgICAgICAgICAgICB5cG9zICs9IDIwOworICAgICAgICAgICAgICB9CisKKyAgICAgICAgICAgICAgbmV3eHBvcyArPSBsZW5ndGg7CisgICAgICAgICAgICAgIGlmIChuZXd4cG9zID4gbWF4d2lkdGgpIG1heHdpZHRoID0gbmV3eHBvczsKKworICAgICAgICAgICAgICByZXR1cm4gJ3RyYW5zbGF0ZSgnICsgeHBvcyArICcsJyArIHlwb3MgKyAnKSc7CisgICAgICAgICAgICB9KTsKKworICAgICAgICAvL3Bvc2l0aW9uIGxlZ2VuZCBhcyBmYXIgcmlnaHQgYXMgcG9zc2libGUgd2l0aGluIHRoZSB0b3RhbCB3aWR0aAorICAgICAgICBnLmF0dHIoJ3RyYW5zZm9ybScsICd0cmFuc2xhdGUoJyArICh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Z3RoKSByZXR1cm4gd2lkdGg7CisgICAgd2lkdGggPSBfOworICAgIHJldHVybiBjaGFydDsKKyAgfTsKKworICBjaGFydC5oZWlnaHQgPSBmdW5jdGlvbihfKSB7CisgICAgaWYgKCFhcmd1bWVudHMubGVuZ3RoKSByZXR1cm4gaGVpZ2h0OworICAgIGhlaWdodCA9IF87CisgICAgcmV0dXJuIGNoYXJ0OworICB9OworCisgIGNoYXJ0LmtleSA9IGZ1bmN0aW9uKF8pIHsKKyAgICBpZiAoIWFyZ3VtZW50cy5sZW5ndGgpIHJldHVybiBnZXRLZXk7CisgICAgZ2V0S2V5ID0gXzsKKyAgICByZXR1cm4gY2hhcnQ7CisgIH07CisKKyAgY2hhcnQuY29sb3IgPSBmdW5jdGlvbihfKSB7CisgICAgaWYgKCFhcmd1bWVudHMubGVuZ3RoKSByZXR1cm4gY29sb3I7CisgICAgY29sb3IgPSBudi51dGlscy5nZXRDb2xvcihfKTsKKyAgICByZXR1cm4gY2hhcnQ7CisgIH07CisKKyAgY2hhcnQuYWxpZ24gPSBmdW5jdGlvbihfKSB7CisgICAgaWYgKCFhcmd1bWVudHMubGVuZ3RoKSByZXR1cm4gYWxpZ247CisgICAgYWxpZ24gPSBfOworICAgIHJldHVybiBjaGFydDsKKyAgfTsKKworICAvLz09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorCisKKyAgcmV0dXJuIGNoYXJ0OworfQorCitudi5tb2RlbHMubGluZSA9IGZ1bmN0aW9uKCkgeworCisgIC8vPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisgIC8vIFB1YmxpYyBWYXJpYWJsZXMgd2l0aCBEZWZhdWx0IFNldHRpbmdzCisgIC8vLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tCisKKyAgdmFyICBzY2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gY29udHJvbHMgdGhlIGxpbmUgaW50ZXJwb2xhdGlvbgorICAgIDsKKworICBzY2F0dGVyCisgICAgLnNpemUoMTYpIC8vIGRlZmF1bHQgc2l6ZQorICAgIC5zaXplRG9tYWluKFsxNiwyNTZdKSAvL3NldCB0byBzcGVlZCB1cCBjYWxjdWxhdGlvbiwgbmVlZHMgdG8gYmUgdW5zZXQgaWYgdGhlcmUgaXMgYSBjdXN0b20gc2l6ZSBhY2Nlc3NvcgorICAgIDsKKyAgICAKKyAgLy89PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKworCisgIC8vPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisgIC8vIFByaXZhdGUgVmFyaWFibGVzCisgIC8vLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tCisKKyAgdmFyIHgwLCB5MCAvL3VzZWQgdG8gc3RvcmUgcHJldmlvdXMgc2NhbGVzCisgICAgICA7CisKKyAgLy89PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKworCisgIGZ1bmN0aW9uIGNoYXJ0KHNlbGVjdGlvbikgeworICAgIHNlbGVjdGlvbi5lYWNoKGZ1bmN0aW9uKGRhdGEpIHsKKyAgICAgIHZhciBhdmFpbGFibGVXaWR0aCA9IHdpZHRoIC0gbWFyZ2luLmxlZnQgLSBtYXJnaW4ucmlnaHQsCisgICAgICAgICAgYXZhaWxhYmxlSGVpZ2h0ID0gaGVpZ2h0IC0gbWFyZ2luLnRvcCAtIG1hcmdpbi5ib3R0b20sCisgICAgICAgICAgY29udGFpbmVyID0gZDMuc2VsZWN0KHRoaXMpOworCisgICAgICAvLy0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0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CdwYXRoLm52LWFyZWEnKQorICAgICAgICAgIC5kYXRhKGZ1bmN0aW9uKGQpIHsgcmV0dXJuIGlzQXJlYShkKSA/IFtkXSA6IFtdIH0pOyAvLyB0aGlzIGlzIGRvbmUgZGlmZmVyZW50bHkgdGhhbiBsaW5lcyBiZWNhdXNlIEkgbmVlZCB0byBjaGVjayBpZiBzZXJpZXMgaXMgYW4gYXJlYQorICAgICAgYXJlYVBhdGhzLmVudGVyKCkuYXBwZW5kKCdwYXRoJykKKyAgICAgICAgICAuYXR0cignY2xhc3MnLCAnbnYtYXJlYScpCisgICAgICAgICAgLmF0dHIoJ2QnLCBmdW5jdGlvbihkKSB7CisgICAgICAgICAgICByZXR1cm4gZDMuc3ZnLmFyZWEoKQorICAgICAgICAgICAgICAgIC5pbnRlcnBvbGF0ZShpbnRlcnBvbGF0ZSkKKyAgICAgICAgICAgICAgICAuZGVmaW5lZChkZWZpbmVkKQorICAgICAgICAgICAgICAgIC54KGZ1bmN0aW9uKGQsaSkgeyByZXR1cm4geDAoZ2V0WChkLGkpKSB9KQorICAgICAgICAgICAgICAgIC55MChmdW5jdGlvbihkLGkpIHsgcmV0dXJuIHkwKGdldFkoZCxpKSkgfSkKKyAgICAgICAgICAgICAgICAueTEoZnVuY3Rpb24oZCxpKSB7IHJldHVybiB5MCggeS5kb21haW4oKVswXSA8PSAwID8geS5kb21haW4oKVsxXSA+PSAwID8gMCA6IHkuZG9tYWluKClbMV0gOiB5LmRvbWFpbigpWzBdICkgfSkKKyAgICAgICAgICAgICAgICAvLy55MShmdW5jdGlvbihkLGkpIHsgcmV0dXJuIHkwKDApIH0pIC8vYXNzdW1pbmcgMCBpcyB3aXRoaW4geSBkb21haW4uLiBtYXkgbmVlZCB0byB0d2VhayB0aGlzCisgICAgICAgICAgICAgICAgLmFwcGx5KHRoaXMsIFtkLnZhbHVlc10pCisgICAgICAgICAgfSk7CisgICAgICBkMy50cmFuc2l0aW9uKGdyb3Vwcy5leGl0KCkuc2VsZWN0QWxsKCdwYXRoLm52LWFyZWEnKSkKKyAgICAgICAgICAuYXR0cignZCcsIGZ1bmN0aW9uKGQpIHsKKyAgICAgICAgICAgIHJldHVybiBkMy5zdmcuYXJlYSgpCisgICAgICAgICAgICAgICAgLmludGVycG9sYXRlKGludGVycG9sYXRlKQorICAgICAgICAgICAgICAgIC5kZWZpbmVkKGRlZmluZWQpCisgICAgICAgICAgICAgICAgLngoZnVuY3Rpb24oZCxpKSB7IHJldHVybiB4KGdldFgoZCxpKSkgfSkKKyAgICAgICAgICAgICAgICAueTAoZnVuY3Rpb24oZCxpKSB7IHJldHVybiB5KGdldFkoZCxpKSkgfSkKKyAgICAgICAgICAgICAgICAueTEoZnVuY3Rpb24oZCxpKSB7IHJldHVybiB5KCB5LmRvbWFpbigpWzBdIDw9IDAgPyB5LmRvbWFpbigpWzFdID49IDAgPyAwIDogeS5kb21haW4oKVsxXSA6IHkuZG9tYWluKClbMF0gKSB9KQorICAgICAgICAgICAgICAgIC8vLnkxKGZ1bmN0aW9uKGQsaSkgeyByZXR1cm4geTAoMCkgfSkgLy9hc3N1bWluZyAwIGlzIHdpdGhpbiB5IGRvbWFpbi4uIG1heSBuZWVkIHRvIHR3ZWFrIHRoaXMKKyAgICAgICAgICAgICAgICAuYXBwbHkodGhpcywgW2QudmFsdWVzXSkKKyAgICAgICAgICB9KTsKKyAgICAgIGQzLnRyYW5zaXRpb24oYXJlYVBhdGhzKQorICAgICAgICAgIC5hdHRyKCdkJywgZnVuY3Rpb24oZCkgeworICAgICAgICAgICAgcmV0dXJuIGQzLnN2Zy5hcmVhKCkKKyAgICAgICAgICAgICAgICAuaW50ZXJwb2xhdGUoaW50ZXJwb2xhdGUpCisgICAgICAgICAgICAgICAgLmRlZmluZWQoZGVmaW5lZCkKKyAgICAgICAgICAgICAgICAueChmdW5jdGlvbihkLGkpIHsgcmV0dXJuIHgoZ2V0WChkLGkpKSB9KQorICAgICAgICAgICAgICAgIC55MChmdW5jdGlvbihkLGkpIHsgcmV0dXJuIHkoZ2V0WShkLGkpKSB9KQorICAgICAgICAgICAgICAgIC55MShmdW5jdGlvbihkLGkpIHsgcmV0dXJuIHkoIHkuZG9tYWluKClbMF0gPD0gMCA/IHkuZG9tYWluKClbMV0gPj0gMCA/IDAgOiB5LmRvbWFpbigpWzFdIDogeS5kb21haW4oKVswXSApIH0pCisgICAgICAgICAgICAgICAgLy8ueTEoZnVuY3Rpb24oZCxpKSB7IHJldHVybiB5MCgwKSB9KSAvL2Fzc3VtaW5nIDAgaXMgd2l0aGluIHkgZG9tYWluLi4gbWF5IG5lZWQgdG8gdHdlYWsgdGhpcworICAgICAgICAgICAgICAgIC5hcHBseSh0aGlzLCBbZC52YWx1ZXNdKQorICAgICAgICAgIH0pOworCisKKworICAgICAgdmFyIGxpbmVQYXRocyA9IGdyb3Vwcy5zZWxlY3RBbGwoJ3BhdGgubnYtbGluZScpCisgICAgICAgICAgLmRhdGEoZnVuY3Rpb24oZCkgeyByZXR1cm4gW2QudmFsdWVzXSB9KTsKKyAgICAgIGxpbmVQYXRocy5lbnRlcigpLmFwcGVuZCgncGF0aCcpCisgICAgICAgICAgLmF0dHIoJ2NsYXNzJywgJ252LWxpbmUnKQorICAgICAgICAgIC5hdHRyKCdkJywKKyAgICAgICAgICAgIGQzLnN2Zy5saW5lKCkKKyAgICAgICAgICAgICAgLmludGVycG9sYXRlKGludGVycG9sYXRlKQorICAgICAgICAgICAgICAuZGVmaW5lZChkZWZpbmVkKQorICAgICAgICAgICAgICAueChmdW5jdGlvbihkLGkpIHsgcmV0dXJuIHgwKGdldFgoZCxpKSkgfSkKKyAgICAgICAgICAgICAgLnkoZnVuY3Rpb24oZCxpKSB7IHJldHVybiB5MChnZXRZKGQsaSkpIH0pCisgICAgICAgICAgKTsKKyAgICAgIGQzLnRyYW5zaXRpb24oZ3JvdXBzLmV4aXQoKS5zZWxlY3RBbGwoJ3BhdGgubnYtbGluZScpKQorICAgICAgICAgIC5hdHRyKCdkJywKKyAgICAgICAgICAgIGQzLnN2Zy5saW5lKCkKKyAgICAgICAgICAgICAgLmludGVycG9sYXRlKGludGVycG9sYXRlKQorICAgICAgICAgICAgICAuZGVmaW5lZChkZWZpbmVkKQorICAgICAgICAgICAgICAueChmdW5jdGlvbihkLGkpIHsgcmV0dXJuIHgoZ2V0WChkLGkpKSB9KQorICAgICAgICAgICAgICAueShmdW5jdGlvbihkLGkpIHsgcmV0dXJuIHkoZ2V0WShkLGkpKSB9KQorICAgICAgICAgICk7CisgICAgICBkMy50cmFuc2l0aW9uKGxpbmVQYXRocykKKyAgICAgICAgICAuYXR0cignZCcsCisgICAgICAgICAgICBkMy5zdmcubGluZSgpCisgICAgICAgICAgICAgIC5pbnRlcnBvbGF0ZShpbnRlcnBvbGF0ZSkKKyAgICAgICAgICAgICAgLmRlZmluZWQoZGVmaW5lZCkKKyAgICAgICAgICAgICAgLngoZnVuY3Rpb24oZCxpKSB7IHJldHVybiB4KGdldFgoZCxpKSkgfSkKKyAgICAgICAgICAgICAgLnkoZnVuY3Rpb24oZCxpKSB7IHJldHVybiB5KGdldFkoZCxpKSkgfSkKKyAgICAgICAgICApOworCisKKworICAgICAgLy9zdG9yZSBvbGQgc2NhbGVzIGZvciB1c2UgaW4gdHJhbnNpdGlvbnMgb24gdXBkYXRlCisgICAgICB4MCA9IHguY29weSgpOworICAgICAgeTAgPSB5LmNvcHkoKTsKKworICAgIH0pOworCisgICAgcmV0dXJuIGNoYXJ0OworICB9CisKKworICAvLz09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorICAvLyBFeHBvc2UgUHVibGljIFZhcmlhYmxlcworICAvLy0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLQorCisgIGNoYXJ0LmRpc3BhdGNoID0gc2NhdHRlci5kaXNwYXRjaDsKKyAgY2hhcnQuc2NhdHRlciA9IHNjYXR0ZX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SBfOworICAgIHJldHVybiBjaGFydDsKKyAgfTsKKworICBjaGFydC54ID0gZnVuY3Rpb24oXykgeworICAgIGlmICghYXJndW1lbnRzLmxlbmd0aCkgcmV0dXJuIGdldFg7CisgICAgZ2V0WCA9IF87CisgICAgc2NhdHRlci54KF8pOworICAgIHJldHVybiBjaGFydDsKKyAgfTsKKworICBjaGFydC55ID0gZnVuY3Rpb24oXykgeworICAgIGlmICghYXJndW1lbnRzLmxlbmd0aCkgcmV0dXJuIGdldFk7CisgICAgZ2V0WSA9IF87CisgICAgc2NhdHRlci55KF8pOworICAgIHJldHVybiBjaGFydDsKKyAgfTsKKworICBjaGFydC5jbGlwRWRnZSA9IGZ1bmN0aW9uKF8pIHsKKyAgICBpZiAoIWFyZ3VtZW50cy5sZW5ndGgpIHJldHVybiBjbGlwRWRnZTsKKyAgICBjbGlwRWRnZSA9IF87CisgICAgcmV0dXJuIGNoYXJ0OworICB9OworCisgIGNoYXJ0LmNvbG9yID0gZnVuY3Rpb24oXykgeworICAgIGlmICghYXJndW1lbnRzLmxlbmd0aCkgcmV0dXJuIGNvbG9yOworICAgIGNvbG9yID0gbnYudXRpbHMuZ2V0Q29sb3IoXyk7CisgICAgc2NhdHRlci5jb2xvcihjb2xvcik7CisgICAgcmV0dXJuIGNoYXJ0OworICB9OworCisgIGNoYXJ0LmludGVycG9sYXRlID0gZnVuY3Rpb24oXykgeworICAgIGlmICghYXJndW1lbnRzLmxlbmd0aCkgcmV0dXJuIGludGVycG9sYXRlOworICAgIGludGVycG9sYXRlID0gXzsKKyAgICByZXR1cm4gY2hhcnQ7CisgIH07CisKKyAgY2hhcnQuZGVmaW5lZCA9IGZ1bmN0aW9uKF8pIHsKKyAgICBpZiAoIWFyZ3VtZW50cy5sZW5ndGgpIHJldHVybiBkZWZpbmVkOworICAgIGRlZmluZWQgPSBfOworICAgIHJldHVybiBjaGFydDsKKyAgfTsKKworICBjaGFydC5pc0FyZWEgPSBmdW5jdGlvbihfKSB7CisgICAgaWYgKCFhcmd1bWVudHMubGVuZ3RoKSByZXR1cm4gaXNBcmVhOworICAgIGlzQXJlYSA9IGQzLmZ1bmN0b3IoXyk7CisgICAgcmV0dXJuIGNoYXJ0OworICB9OworCisgIC8vPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisKKworICByZXR1cm4gY2hhcnQ7Cit9CisKK252Lm1vZGVscy5saW5lQ2hhcnQgPSBmdW5jdGlvbigpIHsKKworICAvLz09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorICAvLyBQdWJsaWMgVmFyaWFibGVzIHdpdGggRGVmYXVsdCBTZXR0aW5ncworICAvLy0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLQorCisgIHZhciBsaW5lcyA9IG52Lm1vZGVscy5saW5lKCkKKyAgICAsIHhBeGlzID0gbnYubW9kZWxzLmF4aXMoKQorICAgICwgeUF4aXMgPSBudi5tb2RlbHMuYXhpcygpCisgICAgLCBsZWdlbmQgPSBudi5tb2RlbHMubGVnZW5kKCkKKyAgICA7CisKKy8vc2V0IG1hcmdpbi5yaWdodCB0byAyMyB0byBmaXQgZGF0ZXMgb24gdGhlIHgtYXhpcyB3aXRoaW4gdGhlIGNoYXJ0CisgIHZhciBtYXJnaW4gPSB7dG9wOiAzMCwgcmlnaHQ6IDIwLCBib3R0b206IDUwLCBsZWZ0OiA2MH0KKyAgICAsIGNvbG9yID0gbnYudXRpbHMuZGVmYXVsdENvbG9yKCkKKyAgICAsIHdpZHRoID0gbnVsbAorICAgICwgaGVpZ2h0ID0gbnVsbAorICAgICwgc2hvd0xlZ2VuZCA9IHRydWUKKyAgICAsIHNob3dYQXhpcyA9IHRydWUKKyAgICAsIHNob3dZQXhpcyA9IHRydWUKKyAgICAsIHJpZ2h0QWxpZ25ZQXhpcyA9IGZhbHNlCisgICAgLCB0b29sdGlwcyA9IHRydWUKKyAgICAsIHRvb2x0aXAgPSBmdW5jdGlvbihrZXksIHgsIHksIGUsIGdyYXBoKSB7CisgICAgICAgIHJldHVybiAnPGgzPicgKyBrZXkgKyAnPC9oMz4nICsKKyAgICAgICAgICAgICAgICc8cD4nICsgIHkgKyAnIGF0ICcgKyB4ICsgJzwvcD4nCisgICAgICB9CisgICAgLCB4CisgICAgLCB5CisgICAgLCBzdGF0ZSA9IHt9CisgICAgLCBkZWZhdWx0U3RhdGUgPSBudWxsCisgICAgLCBub0RhdGEgPSAnTm8gRGF0YSBBdmFpbGFibGUuJworICAgICwgZGlzcGF0Y2ggPSBkMy5kaXNwYXRjaCgndG9vbHRpcFNob3cnLCAndG9vbHRpcEhpZGUnLCAnc3RhdGVDaGFuZ2UnLCAnY2hhbmdlU3RhdGUnKQorICAgIDsKKworICB4QXhpcworICAgIC5vcmllbnQoJ2JvdHRvbScpCisgICAgLnRpY2tQYWRkaW5nKDcpCisgICAgOworICB5QXhpcworICAgIC5vcmllbnQoKHJpZ2h0QWxpZ25ZQXhpcykgPyAncmlnaHQnIDogJ2xlZnQnKQorICAgIDsKKworICAvLz09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorCisKKyAgLy89PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKyAgLy8gUHJpdmF0ZSBWYXJpYWJsZXMKKyAgLy8tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0KKworICB2YXIgc2hvd1Rvb2x0aXAgPSBmdW5jdGlvbihlLCBvZmZzZXRFbGVtZW50KSB7CisKKyAgICAvLyBOZXcgYWRkaXRpb24gdG8gY2FsY3VsYXRlIHBvc2l0aW9uIGlmIFNWRyBpcyBzY2FsZWQgd2l0aCB2aWV3Qm94LCBtYXkgbW92ZSBUT0RPOiBjb25zaWRlciBpbXBsZW1lbnRpbmcgZXZlcnl3aGVyZSBlbHNlCisgICAgaWYgKG9mZnNldEVsZW1lbnQpIHsKKyAgICAgIHZhciBzdmcgPSBkMy5zZWxlY3Qob2Zmc2V0RWxlbWVudCkuc2VsZWN0KCdzdmcnKTsKKyAgICAgIHZhciB2aWV3Qm94ID0gKHN2Zy5ub2RlKCkpID8gc3ZnLmF0dHIoJ3ZpZXdCb3gnKSA6IG51bGw7CisgICAgICBpZiAodmlld0JveCkgeworICAgICAgICB2aWV3Qm94ID0gdmlld0JveC5zcGxpdCgnICcpOworICAgICAgICB2YXIgcmF0aW8gPSBwYXJzZUludChzdmcuc3R5bGUoJ3dpZHRoJykpIC8gdmlld0JveFsyXTsKKyAgICAgICAgZS5wb3NbMF0gPSBlLnBvc1swXSAqIHJhdGlvOworICAgICAgICBlLnBvc1sxXSA9IGUucG9zWzFdICogcmF0aW87CisgICAgICB9CisgICAgfQorCisgICAgdmFyIGxlZnQgPSBlLnBvc1swXSArICggb2Zmc2V0RWxlbWVudC5vZmZzZXRMZWZ0IHx8IDAgKSwKKyAgICAgICAgdG9wID0gZS5wb3NbMV0gKyAoIG9mZnNldEVsZW1lbnQub2Zmc2V0VG9wIHx8IDApLAorICAgICAgICB4ID0geEF4aXMudGlja0Zvcm1hdCgpKGxpbmVzLngoKShlLnBvaW50LCBlLnBvaW50SW5kZXgpKSwKKyAgICAgICAgeSA9IHlBeGlzLnRpY2tGb3JtYXQoKShsaW5lcy55KCkoZS5wb2ludCwgZS5wb2ludEluZGV4KSksCisgICAgICAgIGNvbnRlbnQgPSB0b29sdGlwKGUuc2VyaWVzLmtleSwgeCwgeSwgZSwgY2hhcnQpOworCisgICAgbnYudG9vbHRpcC5zaG93KFtsZWZ0LCB0b3BdLCBjb250ZW50LCBudWxsLCBudWxsLCBvZmZzZXRFbGVtZW50KTsKKyAgfTsKKworICAvLz09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorCisKKyAgZnVuY3Rpb24gY2hhcnQoc2VsZWN0aW9uKSB7CisgICAgc2VsZWN0aW9uLmVhY2goZnVuY3Rpb24oZGF0YSkgeworICAgICAgdmFyIGNvbnRhaW5lciA9IGQzLnNlbGVjdCh0aGlzKSwKKyAgICAgICAgICB0aGF0ID0gdGhpczsKKworICAgICAgdmFyIGF2YWlsYWJsZVdpZHRoID0gKHdpZHRoICB8fCBwYXJzZUludChjb250YWluZXIuc3R5bGUoJ3dpZHRoJykpIHx8IDk2MCkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLSBtYXJnaW4ubGVmdCAtIG1hcmdpbi5yaWdodCwKKyAgICAgICAgICBhdmFpbGFibGVIZWlnaHQgPSAoaGVpZ2h0IHx8IHBhcnNlSW50KGNvbnRhaW5lci5zdHlsZSgnaGVpZ2h0JykpIHx8IDQwMCkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLSBtYXJnaW4udG9wIC0gbWFyZ2luLmJvdHRvbTsKKworCisgICAgICBjaGFydC51cGRhdGUgPSBmdW5jdGlvbigpIHsgY29udGFpbmVyLnRyYW5zaXRpb24oKS5jYWxsKGNoYXJ0KSB9OworICAgICAgY2hhcnQuY29udGFpbmVyID0gdGhpczsKKworICAgICAgLy9zZXQgc3RhdGUuZGlzYWJsZWQKKyAgICAgIHN0YXRlLmRpc2FibGVkID0gZGF0YS5tYXAoZnVuY3Rpb24oZCkgeyByZXR1cm4gISFkLmRpc2FibGVkIH0pOworCisgICAgICBpZiAoIWRlZmF1bHRTdGF0ZSkgeworICAgICAgICB2YXIga2V5OworICAgICAgICBkZWZhdWx0U3RhdGUgPSB7fTsKKyAgICAgICAgZm9yIChrZXkgaW4gc3RhdGUpIHsKKyAgICAgICAgICBpZiAoc3RhdGVba2V5XSBpbnN0YW5jZW9mIEFycmF5KQorICAgICAgICAgICAgZGVmYXVsdFN0YXRlW2tleV0gPSBzdGF0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tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLQorICAgICAgLy8gU2V0dXAgQXhlcworCisgICAgICBpZiAoc2hvd1hBeGlzKSB7CisgICAgICAgIHhBeGlzCisgICAgICAgICAgLnNjYWxlKHgpCisgICAgICAgICAgLnRpY2tzKCBhdmFpbGFibGVXaWR0aCAvIDEwMCApCisgICAgICAgICAgLnRpY2tTaXplKC1hdmFpbGFibGVIZWlnaHQsIDApOworCisgICAgICAgIGcuc2VsZWN0KCcubnYteC5udi1heGlzJykKKyAgICAgICAgICAgIC5hdHRyKCd0cmFuc2Zvcm0nLCAndHJhbnNsYXRlKDAsJyArIHkucmFuZ2UoKVswXSArICcpJyk7CisgICAgICAgIGQzLnRyYW5zaXRpb24oZy5zZWxlY3QoJy5udi14Lm52LWF4aXMnKSkKKyAgICAgICAgICAgIC5jYWxsKHhBeGlzKTsKKyAgICAgIH0KKworICAgICAgaWYgKHNob3dZQXhpcykgeworICAgICAgICB5QXhpcworICAgICAgICAgIC5zY2FsZSh5KQorICAgICAgICAgIC50aWNrcyggYXZhaWxhYmxlSGVpZ2h0IC8gMzYgKQorICAgICAgICAgIC50aWNrU2l6ZSggLWF2YWlsYWJsZVdpZHRoLCAwKTsKKworICAgICAgICBkMy50cmFuc2l0aW9uKGcuc2VsZWN0KCcubnYteS5udi1heGlzJykpCisgICAgICAgICAgICAuY2FsbCh5QXhpcyk7CisgICAgICB9CisgICAgICAvLy0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLQorCisKKyAgICAgIC8vPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisgICAgICAvLyBFdmVudCBIYW5kbGluZy9EaXNwYXRjaGluZyAoaW4gY2hhcnQncyBzY29wZSkKKyAgICAgIC8vLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS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Fsc2U7ICAKKworICAgICAgICAgIHN0YXRlLmRpc2FibGVkID0gZGF0YS5tYXAoZnVuY3Rpb24oZCkgeyByZXR1cm4gISFkLmRpc2FibGVkIH0pOworICAgICAgICAgIGRpc3BhdGNoLnN0YXRlQ2hhbmdlKHN0YXRlKTsKKyAgICAgICAgICBjaGFydC51cGRhdGUoKTsKKyAgICAgIH0pOworCisKKy8qCisgICAgICBsZWdlbmQuZGlzcGF0Y2gub24oJ2xlZ2VuZE1vdXNlb3ZlcicsIGZ1bmN0aW9uKGQsIGkpIHsKKyAgICAgICAgZC5ob3ZlciA9IHRydWU7CisgICAgICAgIHNlbGVjdGlvbi50cmFuc2l0aW9uKCkuY2FsbChjaGFydCkKKyAgICAgIH0pOworCisgICAgICBsZWdlbmQuZGlzcGF0Y2gub24oJ2xlZ2VuZE1vdXNlb3V0JywgZnVuY3Rpb24oZCwgaSkgeworICAgICAgICBkLmhvdmVyID0gZmFsc2U7CisgICAgICAgIHNlbGVjdGlvbi50cmFuc2l0aW9uKCkuY2FsbChjaGFydCkKKyAgICAgIH0pOworKi8KKworICAgICAgZGlzcGF0Y2gub24oJ3Rvb2x0aXBTaG93JywgZnVuY3Rpb24oZSkgeworICAgICAgICBpZiAodG9vbHRpcHMpIHNob3dUb29sdGlwKGUsIHRoYXQucGFyZW50Tm9kZSk7CisgICAgICB9KTsKKworCisgICAgICBkaXNwYXRjaC5vbignY2hhbmdlU3RhdGUnLCBmdW5jdGlvbihlKSB7CisKKyAgICAgICAgaWYgKHR5cGVvZiBlLmRpc2FibGVkICE9PSAndW5kZWZpbmVkJykgeworICAgICAgICAgIGRhdGEuZm9yRWFjaChmdW5jdGlvbihzZXJpZXMsaSkgeworICAgICAgICAgICAgc2VyaWVzLmRpc2FibGVkID0gZS5kaXNhYmxlZFtpXTsKKyAgICAgICAgICB9KTsKKworICAgICAgICAgIHN0YXRlLmRpc2FibGVkID0gZS5kaXNhYmxlZDsKKyAgICAgICAgfQorCisgICAgICAgIGNoYXJ0LnVwZGF0ZSgpOworICAgICAgfSk7CisKKyAgICAgIC8vPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisKKyAgICB9KTsKKworICAgIHJldHVybiBjaGFydDsKKyAgfQorCisKKyAgLy89PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKyAgLy8gRXZlbnQgSGFuZGxpbmcvRGlzcGF0Y2hpbmcgKG91dCBvZiBjaGFydCdzIHNjb3BlKQorICAvLy0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLQorCisgIGxpbmVzLmRpc3BhdGNoLm9uKCdlbGVtZW50TW91c2VvdmVyLnRvb2x0aXAnLCBmdW5jdGlvbihlKSB7CisgICAgZS5wb3MgPSBbZS5wb3NbMF0gKyAgbWFyZ2luLmxlZnQsIGUucG9zWzFdICsgbWFyZ2luLnRvcF07CisgICAgZGlzcGF0Y2gudG9vbHRpcFNob3coZSk7CisgIH0pOworCisgIGxpbmVzLmRpc3BhdGNoLm9uKCdlbGVtZW50TW91c2VvdXQudG9vbHRpcCcsIGZ1bmN0aW9uKGUpIHsKKyAgICBkaXNwYXRjaC50b29sdGlwSGlkZShlKTsKKyAgfSk7CisKKyAgZGlzcGF0Y2gub24oJ3Rvb2x0aXBIaWRlJywgZnVuY3Rpb24oKSB7CisgICAgaWYgKHRvb2x0aXBzKSBudi50b29sdGlwLmNsZWFudXAoKTsKKyAgfSk7CisKKyAgLy89PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKworCisgIC8vPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisgIC8vIEV4cG9zZSBQdWJsaWMgVmFyaWFibGVzCisgIC8vLS0tLS0tLS0tLS0tLS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5ndGgpIHJldHVybiByaWdodEFsaWduWUF4aXM7CisgICAgcmlnaHRBbGlnbllBeGlzID0gXzsKKyAgICB5QXhpcy5vcmllbnQoIChfKSA/ICdyaWdodCcgOiAnbGVmdCcpOworICAgIHJldHVybiBjaGFydDsKKyAgfTsKKworICBjaGFydC50b29sdGlwcyA9IGZ1bmN0aW9uKF8pIHsKKyAgICBpZiAoIWFyZ3VtZW50cy5sZW5ndGgpIHJldHVybiB0b29sdGlwczsKKyAgICB0b29sdGlwcyA9IF87CisgICAgcmV0dXJuIGNoYXJ0OworICB9OworCisgIGNoYXJ0LnRvb2x0aXBDb250ZW50ID0gZnVuY3Rpb24oXykgeworICAgIGlmICghYXJndW1lbnRzLmxlbmd0aCkgcmV0dXJuIHRvb2x0aXA7CisgICAgdG9vbHRpcCA9IF87CisgICAgcmV0dXJuIGNoYXJ0OworICB9OworCisgIGNoYXJ0LnN0YXRlID0gZnVuY3Rpb24oXykgeworICAgIGlmICghYXJndW1lbnRzLmxlbmd0aCkgcmV0dXJuIHN0YXRlOworICAgIHN0YXRlID0gXzsKKyAgICByZXR1cm4gY2hhcnQ7CisgIH07CisKKyAgY2hhcnQuZGVmYXVsdFN0YXRlID0gZnVuY3Rpb24oXykgeworICAgIGlmICghYXJndW1lbnRzLmxlbmd0aCkgcmV0dXJuIGRlZmF1bHRTdGF0ZTsKKyAgICBkZWZhdWx0U3RhdGUgPSBfOworICAgIHJldHVybiBjaGFydDsKKyAgfTsKKworICBjaGFydC5ub0RhdGEgPSBmdW5jdGlvbihfKSB7CisgICAgaWYgKCFhcmd1bWVudHMubGVuZ3RoKSByZXR1cm4gbm9EYXRhOworICAgIG5vRGF0YSA9IF87CisgICAgcmV0dXJuIGNoYXJ0OworICB9OworCisgIC8vPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisKKworICByZXR1cm4gY2hhcnQ7Cit9CisKK252Lm1vZGVscy5saW5lUGx1c0JhckNoYXJ0ID0gZnVuY3Rpb24oKSB7CisKKyAgLy89PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKyAgLy8gUHVibGljIFZhcmlhYmxlcyB3aXRoIERlZmF1bHQgU2V0dGluZ3MKKyAgLy8tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0KKworICB2YXIgbGluZXMgPSBudi5tb2RlbHMubGluZSgpCisgICAgLCBiYXJzID0gbnYubW9kZWxzLmhpc3RvcmljYWxCYXIoKQorICAgICwgeEF4aXMgPSBudi5tb2RlbHMuYXhpcygpCisgICAgLCB5MUF4aXMgPSBudi5tb2RlbHMuYXhpcygpCisgICAgLCB5MkF4aXMgPSBudi5tb2RlbHMuYXhpcygpCisgICAgLCBsZWdlbmQgPSBudi5tb2RlbHMubGVnZW5kKCkKKyAgICA7CisKKyAgdmFyIG1hcmdpbiA9IHt0b3A6IDMwLCByaWdodDogNjAsIGJvdHRvbTogNTAsIGxlZnQ6IDYwfQorICAgICwgd2lkdGggPSBudWxsCisgICAgLCBoZWlnaHQgPSBudWxsCisgICAgLCBnZXRYID0gZnVuY3Rpb24oZCkgeyByZXR1cm4gZC54IH0KKyAgICAsIGdldFkgPSBmdW5jdGlvbihkKSB7IHJldHVybiBkLnkgfQorICAgICwgY29sb3IgPSBudi51dGlscy5kZWZhdWx0Q29sb3IoKQorICAgICwgc2hvd0xlZ2VuZCA9IHRydWUKKyAgICAsIHRvb2x0aXBzID0gdHJ1ZQorICAgICwgdG9vbHRpcCA9IGZ1bmN0aW9uKGtleSwgeCwgeSwgZSwgZ3JhcGgpIHsKKyAgICAgICAgcmV0dXJuICc8aDM+JyArIGtleSArICc8L2gzPicgKworICAgICAgICAgICAgICAgJzxwPicgKyAgeSArICcgYXQgJyArIHggKyAnPC9wPic7CisgICAgICB9CisgICAgLCB4CisgICAgLCB5MQorICAgICwgeTIKKyAgICAsIHN0YXRlID0ge30KKyAgICAsIGRlZmF1bHRTdGF0ZSA9IG51bGwKKyAgICAsIG5vRGF0YSA9ICJObyBEYXRhIEF2YWlsYWJsZS4iCisgICAgLCBkaXNwYXRjaCA9IGQzLmRpc3BhdGNoKCd0b29sdGlwU2hvdycsICd0b29sdGlwSGlkZScsICdzdGF0ZUNoYW5nZScsICdjaGFuZ2VTdGF0ZScpCisgICAgOworCisgIGJhcnMKKyAgICAucGFkRGF0YSh0cnVlKQorICAgIDsKKyAgbGluZXMKKyAgICAuY2xpcEVkZ2UoZmFsc2UpCisgICAgLnBhZERhdGEodHJ1ZSkKKyAgICA7CisgIHhBeGlzCisgICAgLm9yaWVudCgnYm90dG9tJykKKyAgICAudGlja1BhZGRpbmcoNykKKyAgICAuaGlnaGxpZ2h0WmVybyhmYWxzZSkKKyAgICA7CisgIHkxQXhpcworICAgIC5vcmllbnQoJ2xlZnQnKQorICAgIDsKKyAgeTJBeGlzCisgICAgLm9yaWVudCgncmlnaHQnKQorICAgIDsKKworICAvLz09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorCisKKyAgLy89PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKyAgLy8gUHJpdmF0ZSBWYXJpYWJsZXMKKyAgLy8tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0KKworICB2YXIgc2hvd1Rvb2x0aXAgPSBmdW5jdGlvbihlLCBvZmZzZXRFbGVtZW50KSB7CisgICAgICB2YXIgbGVmdCA9IGUucG9zWzBdICsgKCBvZmZzZXRFbGVtZW50Lm9mZnNldExlZnQgfHwgMCApLAorICAgICAgICAgIHRvcCA9IGUucG9zWzFdICsgKCBvZmZzZXRFbGVtZW50Lm9mZnNldFRvcCB8fCAwKSwKKyAgICAgICAgICB4ID0geEF4aXMudGlja0Zvcm1hdCgpKGxpbmVzLngoKShlLnBvaW50LCBlLnBvaW50SW5kZXgpKSwKKyAgICAgICAgICB5ID0gKGUuc2VyaWVzLmJhciA/IHkxQXhpcyA6IHkyQXhpcykudGlja0Zvcm1hdCgpKGxpbmVzLnkoKShlLnBvaW50LCBlLnBvaW50SW5kZXgpKSwKKyAgICAgICAgICBjb250ZW50ID0gdG9vbHRpcChlLnNlcmllcy5rZXksIHgsIHksIGUsIGNoYXJ0KTsKKworICAgICAgbnYudG9vbHRpcC5zaG93KFtsZWZ0LCB0b3BdLCBjb250ZW50LCBlLnZhbHVlIDwgMCA/ICduJyA6ICdzJywgbnVsbCwgb2Zmc2V0RWxlbWVudCk7CisgICAgfQorICAgIDsKKworICAvLy0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLQorCisKKworICBmdW5jdGlvbiBjaGFydChzZWxlY3Rpb24pIHsKKyAgICBzZWxlY3Rpb24uZWFjaChmdW5jdGlvbihkYXRhKSB7CisgICAgICB2YXIgY29udGFpbmVyID0gZDMuc2VsZWN0KHRoaXMpLAorICAgICAgICAgIHRoYXQgPSB0aGlzOworCisgICAgICB2YXIgYXZhaWxhYmxlV2lkdGggPSAod2lkdGggIHx8IHBhcnNlSW50KGNvbnRhaW5lci5zdHlsZSgnd2lkdGgnKSkgfHwgOTYwKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAtIG1hcmdpbi5sZWZ0IC0gbWFyZ2luLnJpZ2h0LAorICAgICAgICAgIGF2YWlsYWJsZUhlaWdodCA9IChoZWlnaHQgfHwgcGFyc2VJbnQoY29udGFpbmVyLnN0eWxlKCdoZWlnaHQnKSkgfHwgNDAwKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAtIG1hcmdpbi50b3AgLSBtYXJnaW4uYm90dG9tOworCisgICAgICBjaGFydC51cGRhdGUgPSBmdW5jdG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0pKQorICAgICAgICAgIC5jYWxsKGxlZ2VuZCk7CisKKyAgICAgICAgaWYgKCBtYXJnaW4udG9wICE9IGxlZ2VuZC5oZWlnaHQoKSkgeworICAgICAgICAgIG1hcmdpbi50b3AgPSBsZWdlbmQuaGVpZ2h0KCk7CisgICAgICAgICAgYXZhaWxhYmxlSGVpZ2h0ID0gKGhlaWdodCB8fCBwYXJzZUludChjb250YWluZXIuc3R5bGUoJ2hlaWdodCcpKSB8fCA0MDApCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC0gbWFyZ2luLnRvcCAtIG1hcmdpbi5ib3R0b207CisgICAgICAgIH0KKworICAgICAgICBnLnNlbGVjdCgnLm52LWxlZ2VuZFdyYXAnKQorICAgICAgICAgICAgLmF0dHIoJ3RyYW5zZm9ybScsICd0cmFuc2xhdGUoJyArICggYXZhaWxhYmxlV2lkdGggLyAyICkgKyAnLCcgKyAoLW1hcmdpbi50b3ApICsnKScpOworICAgICAgfQorCisgICAgICAvLy0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLQorCisKKyAgICAgIHdyYXAuYXR0cigndHJhbnNmb3JtJywgJ3RyYW5zbGF0ZSgnICsgbWFyZ2luLmxlZnQgKyAnLCcgKyBtYXJnaW4udG9wICsgJyknKTsKKworCisgICAgICAvLy0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLQorICAgICAgLy8gTWFpbiBDaGFydCBDb21wb25lbnQocykKKworCisgICAgICBsaW5lcworICAgICAgICAud2lkdGgoYXZhaWxhYmxlV2lkdGgpCisgICAgICAgIC5oZWlnaHQoYXZhaWxhYmxlSGVpZ2h0KQorICAgICAgICAuY29sb3IoZGF0YS5tYXAoZnVuY3Rpb24oZCxpKSB7CisgICAgICAgICAgcmV0dXJuIGQuY29sb3IgfHwgY29sb3IoZCwg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tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLQorCisKKyAgICAgIC8vLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tCisgICAgICAvLyBTZXR1cCBBeGVzCisKKyAgICAgIHhBeGlzCisgICAgICAgIC5zY2FsZSh4KQorICAgICAgICAudGlja3MoIGF2YWlsYWJsZVdpZHRoIC8gMTAwICkKKyAgICAgICAgLnRpY2tTaXplKC1hdmFpbGFibGVIZWlnaHQsIDApOworCisgICAgICBnLnNlbGVjdCgnLm52LXgubnYtYXhpcycpCisgICAgICAgICAgLmF0dHIoJ3RyYW5zZm9ybScsICd0cmFuc2xhdGUoMCwnICsgeTEucmFuZ2UoKVswXSArICcpJyk7CisgICAgICBkMy50cmFuc2l0aW9uKGcuc2VsZWN0KCcubnYteC5udi1heGlzJykpCisgICAgICAgICAgLmNhbGwoeEF4aXMpOworCisKKyAgICAgIHkxQXhpcworICAgICAgICAuc2NhbGUoeTEpCisgICAgICAgIC50aWNrcyggYXZhaWxhYmxlSGVpZ2h0IC8gMzYgKQorICAgICAgICAudGlja1NpemUoLWF2YWlsYWJsZVdpZHRoLCAwKTsKKworICAgICAgZDMudHJhbnNpdGlvbihnLnNlbGVjdCgnLm52LXkxLm52LWF4aXMnKSkKKyAgICAgICAgICAuc3R5bGUoJ29wYWNpdHknLCBkYXRhQmFycy5sZW5ndGggPyAxIDogMCkKKyAgICAgICAgICAuY2FsbCh5MUF4aXMpOworCisKKyAgICAgIHkyQXhpcworICAgICAgICAuc2NhbGUoeTIpCisgICAgICAgIC50aWNrcyggYXZhaWxhYmxlSGVpZ2h0IC8gMzYgKQorICAgICAgICAudGlja1NpemUoZGF0YUJhcnMubGVuZ3RoID8gMCA6IC1hdmFpbGFibGVXaWR0aCwgMCk7IC8vIFNob3cgdGhlIHkyIHJ1bGVzIG9ubHkgaWYgeTEgaGFzIG5vbmUKKworICAgICAgZy5zZWxlY3QoJy5udi15Mi5udi1heGlzJykKKyAgICAgICAgICAuc3R5bGUoJ29wYWNpdHknLCBkYXRhTGluZXMubGVuZ3RoID8gMSA6IDApCisgICAgICAgICAgLmF0dHIoJ3RyYW5zZm9ybScsICd0cmFuc2xhdGUoJyArIGF2YWlsYWJsZVdpZHRoICsgJywwKScpOworICAgICAgICAgIC8vLmF0dHIoJ3RyYW5zZm9ybScsICd0cmFuc2xhdGUoJyArIHgucmFuZ2UoKVsxXSArICcsMCknKTsKKworICAgICAgZDMudHJhbnNpdGlvbihnLnNlbGVjdCgnLm52LXkyLm52LWF4aXMnKSkKKyAgICAgICAgICAuY2FsbCh5MkF4aXMpOworCisgICAgICAvLy0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLQorCisKKyAgICAgIC8vPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisgICAgICAvLyBFdmVudCBIYW5kbGluZy9EaXNwYXRjaGluZyAoaW4gY2hhcnQncyBzY29wZSkKKyAgICAgIC8vLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tCisKKyAgICAgIGxlZ2VuZC5kaXNwYXRjaC5vbignbGVnZW5kQ2xpY2snLCBmdW5jdGlvbihkLGkpIHsgCisgICAgICAgIGQuZGlzYWJsZWQgPSAhZC5kaXNhYmxlZDsKKworICAgICAgICBpZiAoIWRhdGEuZmlsdGVyKGZ1bmN0aW9uKGQpIHsgcmV0dXJuICFkLmRpc2FibGVkIH0pLmxlbmd0aCkgeworICAgICAgICAgIGRhdGEubWFwKGZ1bmN0aW9uKGQpIHsKKyAgICAgICAgICAgIGQuZGlzYWJsZWQgPSBmYWxzZTsKKyAgICAgICAgICAgIHdyYXAuc2VsZWN0QWxsKCcubnYtc2V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mRsZXIKKyAgICAgIGRpc3BhdGNoLm9uKCdjaGFuZ2VTdGF0ZScsIGZ1bmN0aW9uKGUpIHsKKworICAgICAgICBpZiAodHlwZW9mIGUuZGlzYWJsZWQgIT09ICd1bmRlZmluZWQnKSB7CisgICAgICAgICAgZGF0YS5mb3JFYWNoKGZ1bmN0aW9uKHNlcmllcyxpKSB7CisgICAgICAgICAgICBzZXJpZXMuZGlzYWJsZWQgPSBlLmRpc2FibGVkW2ldOworICAgICAgICAgIH0pOworCisgICAgICAgICAgc3RhdGUuZGlzYWJsZWQgPSBlLmRpc2FibGVkOworICAgICAgICB9CisKKyAgICAgICAgY2hhcnQudXBkYXRlKCk7CisgICAgICB9KTsKKworICAgICAgLy89PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKworCisgICAgfSk7CisKKyAgICByZXR1cm4gY2hhcnQ7CisgIH0KKworCisgIC8vPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisgIC8vIEV2ZW50IEhhbmRsaW5nL0Rpc3BhdGNoaW5nIChvdXQgb2YgY2hhcnQncyBzY29wZSkKKyAgLy8tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0KKworICBsaW5lcy5kaXNwYXRjaC5vbignZWxlbWVudE1vdXNlb3Zlci50b29sdGlwJywgZnVuY3Rpb24oZSkgeworICAgIGUucG9zID0gW2UucG9zWzBdICsgIG1hcmdpbi5sZWZ0LCBlLnBvc1sxXSArIG1hcmdpbi50b3BdOworICAgIGRpc3BhdGNoLnRvb2x0aXBTaG93KGUpOworICB9KTsKKworICBsaW5lcy5kaXNwYXRjaC5vbignZWxlbWVudE1vdXNlb3V0LnRvb2x0aXAnLCBmdW5jdGlvbihlKSB7CisgICAgZGlzcGF0Y2gudG9vbHRpcEhpZGUoZSk7CisgIH0pOworCisgIGJhcnMuZGlzcGF0Y2gub24oJ2VsZW1lbnRNb3VzZW92ZXIudG9vbHRpcCcsIGZ1bmN0aW9uKGUpIHsKKyAgICBlLnBvcyA9IFtlLnBvc1swXSArICBtYXJnaW4ubGVmdCwgZS5wb3NbMV0gKyBtYXJnaW4udG9wXTsKKyAgICBkaXNwYXRjaC50b29sdGlwU2hvdyhlKTsKKyAgfSk7CisKKyAgYmFycy5kaXNwYXRjaC5vbignZWxlbWVudE1vdXNlb3V0LnRvb2x0aXAnLCBmdW5jdGlvbihlKSB7CisgICAgZGlzcGF0Y2gudG9vbHRpcEhpZGUoZSk7CisgIH0pOworCisgIGRpc3BhdGNoLm9uKCd0b29sdGlwSGlkZScsIGZ1bmN0aW9uKCkgeworICAgIGlmICh0b29sdGlwcykgbnYudG9vbHRpcC5jbGVhbnVwKCk7CisgIH0pOworCisgIC8vPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisKKworICAvLz09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorICAvLyBFeHBvc2UgUHVibGljIFZhcmlhYmxlcworICAvLy0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLQorCisgIC8vIGV4cG9zZSBjaGFydCdzIHN1Yi1jb21wb25lbnRzCisgIGNoYXJ0LmRpc3BhdGNoID0gZGlzcGF0Y2g7CisgIGNoYXJ0LmxlZ2VuZCA9IGxlZ2VuZDsKKyAgY2hhcnQubGluZXMgPSBsaW5lczsKKyAgY2hhcnQuYmFycyA9IGJhcnM7CisgIGNoYXJ0LnhBeGlzID0geEF4aXM7CisgIGNoYXJ0LnkxQXhpcyA9IHkxQXhpczsKKyAgY2hhcnQueTJBeGlzID0geTJBeGlzOworCisgIGQzLnJlYmluZChjaGFydCwgbGluZXMsICdkZWZpbmV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uKF8pIHsKKyAgICBpZiAoIWFyZ3VtZW50cy5sZW5ndGgpIHJldHVybiB0b29sdGlwOworICAgIHRvb2x0aXAgPSBfOworICAgIHJldHVybiBjaGFydDsKKyAgfTsKKworICBjaGFydC5zdGF0ZSA9IGZ1bmN0aW9uKF8pIHsKKyAgICBpZiAoIWFyZ3VtZW50cy5sZW5ndGgpIHJldHVybiBzdGF0ZTsKKyAgICBzdGF0ZSA9IF87CisgICAgcmV0dXJuIGNoYXJ0OworICB9OworCisgIGNoYXJ0LmRlZmF1bHRTdGF0ZSA9IGZ1bmN0aW9uKF8pIHsKKyAgICBpZiAoIWFyZ3VtZW50cy5sZW5ndGgpIHJldHVybiBkZWZhdWx0U3RhdGU7CisgICAgZGVmYXVsdFN0YXRlID0gXzsKKyAgICByZXR1cm4gY2hhcnQ7CisgIH07CisKKyAgY2hhcnQubm9EYXRhID0gZnVuY3Rpb24oXykgeworICAgIGlmICghYXJndW1lbnRzLmxlbmd0aCkgcmV0dXJuIG5vRGF0YTsKKyAgICBub0RhdGEgPSBfOworICAgIHJldHVybiBjaGFydDsKKyAgfTsKKworICAvLz09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorCisKKyAgcmV0dXJuIGNoYXJ0OworfQorCitudi5tb2RlbHMubGluZVdpdGhGb2N1c0NoYXJ0ID0gZnVuY3Rpb24oKSB7CisKKyAgLy89PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKyAgLy8gUHVibGljIFZhcmlhYmxlcyB3aXRoIERlZmF1bHQgU2V0dGluZ3MKKyAgLy8tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0KKworICB2YXIgbGluZXMgPSBudi5tb2RlbHMubGluZSgpCisgICAgLCBsaW5lczIgPSBudi5tb2RlbHMubGluZSgpCisgICAgLCB4QXhpcyA9IG52Lm1vZGVscy5heGlzKCkKKyAgICAsIHlBeGlzID0gbnYubW9kZWxzLmF4aXMoKQorICAgICwgeDJBeGlzID0gbnYubW9kZWxzLmF4aXMoKQorICAgICwgeTJBeGlzID0gbnYubW9kZWxzLmF4aXMoKQorICAgICwgbGVnZW5kID0gbnYubW9kZWxzLmxlZ2VuZCgpCisgICAgLCBicnVzaCA9IGQzLnN2Zy5icnVzaCgpCisgICAgOworCisgIHZhciBtYXJnaW4gPSB7dG9wOiAzMCwgcmlnaHQ6IDMwLCBib3R0b206IDMwLCBsZWZ0OiA2MH0KKyAgICAsIG1hcmdpbjIgPSB7dG9wOiAwLCByaWdodDogMzAsIGJvdHRvbTogMjAsIGxlZnQ6IDYwfQorICAgICwgY29sb3IgPSBudi51dGlscy5kZWZhdWx0Q29sb3IoKQorICAgICwgd2lkdGggPSBudWxsCisgICAgLCBoZWlnaHQgPSBudWxsCisgICAgLCBoZWlnaHQyID0gMTAwCisgICAgLCB4CisgICAgLCB5CisgICAgLCB4MgorICAgICwgeTIKKyAgICAsIHNob3dMZWdlbmQgPSB0cnVlCisgICAgLCBicnVzaEV4dGVudCA9IG51bGwKKyAgICAsIHRvb2x0aXBzID0gdHJ1ZQorICAgICwgdG9vbHRpcCA9IGZ1bmN0aW9uKGtleSwgeCwgeSwgZSwgZ3JhcGgpIHsKKyAgICAgICAgcmV0dXJuICc8aDM+JyArIGtleSArICc8L2gzPicgKworICAgICAgICAgICAgICAgJzxwPicgKyAgeSArICcgYXQgJyArIHggKyAnPC9wPicKKyAgICAgIH0KKyAgICAsIG5vRGF0YSA9ICJObyBEYXRhIEF2YWlsYWJsZS4iCisgICAgLCBkaXNwYXRjaCA9IGQzLmRpc3BhdGNoKCd0b29sdGlwU2hvdycsICd0b29sdGlwSGlkZScsICdicnVzaCcpCisgICAgOworCisgIGxpbmVzCisgICAgLmNsaXBFZGdlKHRydWUpCisgICAgOworICBsaW5lczIKKyAgICAuaW50ZXJhY3RpdmUoZmFsc2UpCisgICAgOworICB4QXhpcworICAgIC5vcmllbnQoJ2JvdHRvbScpCisgICAgLnRpY2tQYWRkaW5nKDUpCisgICAgOworICB5QXhpcworICAgIC5vcmllbnQoJ2xlZnQnKQorICAgIDsKKyAgeDJBeGlzCisgICAgLm9yaWVudCgnYm90dG9tJykKKyAgICAudGlja1BhZGRpbmcoNSkKKyAgICA7CisgIHkyQXhpcworICAgIC5vcmllbnQoJ2xlZnQnKQorICAgIDsKKyAgLy89PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKworCisgIC8vPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisgIC8vIFByaXZhdGUgVmFyaWFibGVzCisgIC8vLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tCisKKyAgdmFyIHNob3dUb29sdGlwID0gZnVuY3Rpb24oZSwgb2Zmc2V0RWxlbWVudCkgeworICAgIHZhciBsZWZ0ID0gZS5wb3NbMF0gKyAoIG9mZnNldEVsZW1lbnQub2Zmc2V0TGVmdCB8fCAwICksCisgICAgICAgIHRvcCA9IGUucG9zWzFdICsgKCBvZmZzZXRFbGVtZW50Lm9mZnNldFRvcCB8fCAwKSwKKyAgICAgICAgeCA9IHhBeGlzLnRpY2tGb3JtYXQoKShsaW5lcy54KCkoZS5wb2ludCwgZS5wb2ludEluZGV4KSksCisgICAgICAgIHkgPSB5QXhpcy50aWNrRm9ybWF0KCkobGluZXMueSgpKGUucG9pbnQsIGUucG9pbnRJbmRleCkpLAorICAgICAgICBjb250ZW50ID0gdG9vbHRpcChlLnNlcmllcy5rZXksIHgsIHksIGUsIGNoYXJ0KTsKKworICAgIG52LnRvb2x0aXAuc2hvdyhbbGVmdCwgdG9wXSwgY29udGVudCwgbnVsbCwgbnVsbCwgb2Zmc2V0RWxlbWVudCk7CisgIH07CisKKyAgLy89PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKworCisgIGZ1bmN0aW9uIGNoYXJ0KHNlbGVjdGlvbikgeworICAgIHNlbGVjdGlvbi5lYWNoKGZ1bmN0aW9uKGRhdGEpIHsKKyAgICAgIHZhciBjb250YWluZXIgPSBkMy5zZWxlY3QodGhpcyksCisgICAgICAgICAgdGhhdCA9IHRoaXM7CisKKyAgICAgIHZhciBhdmFpbGFibGVXaWR0aCA9ICh3aWR0aCAgfHwgcGFyc2VJbnQoY29udGFpbmVyLnN0eWxlKCd3aWR0aCcpKSB8fCA5NjApCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC0gbWFyZ2luLmxlZnQgLSBtYXJnaW4ucmlnaHQsCisgICAgICAgICAgYXZhaWxhYmxlSGVpZ2h0MSA9IChoZWlnaHQgfHwgcGFyc2VJbnQoY29udGFpbmVyLnN0eWxlKCdoZWlnaHQnKSkgfHwgNDAwKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAtIG1hcmdpbi50b3AgLSBtYXJnaW4uYm90dG9tIC0gaGVpZ2h0MiwKKyAgICAgICAgICBhdmFpbGFibGVIZWlnaHQyID0gaGVpZ2h0MiAtIG1hcmdpbjIudG9wIC0gbWFyZ2luMi5ib3R0b207CisKKyAgICAgIGNoYXJ0LnVwZGF0ZSA9IGZ1bmN0aW9uKCkgeyBjb250YWluZXIudHJhbnNpdGlvbigpLmNhbGwoY2hhcnQpIH07CisgICAgICBjaGFydC5jb250YWluZXIgPSB0aGlzOworCisKKyAgICAgIC8vLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tCisgICAgICAvLyBEaXNwbGF5IE5vIERhdGEgbWVzc2FnZSBpZiB0aGVyZSdzIG5vdGhpbmcgdG8gc2hvdy4KKworICAgICAgaWYgKCFkYXR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ZWlnaHQnKSkgfHwgNDAwKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAtIG1hcmdpbi50b3AgLSBtYXJnaW4uYm90dG9tIC0gaGVpZ2h0MjsKKyAgICAgICAgfQorCisgICAgICAgIGcuc2VsZWN0KCcubnYtbGVnZW5kV3JhcCcpCisgICAgICAgICAgICAuYXR0cigndHJhbnNmb3JtJywgJ3RyYW5zbGF0ZSgwLCcgKyAoLW1hcmdpbi50b3ApICsnKScpCisgICAgICB9CisKKyAgICAgIC8vLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tCisKKworICAgICAgd3JhcC5hdHRyKCd0cmFuc2Zvcm0nLCAndHJhbnNsYXRlKCcgKyBtYXJnaW4ubGVmdCArICcsJyArIG1hcmdpbi50b3AgKyAnKScpOworCisKKyAgICAgIC8vLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tCisgICAgICAvLyBNYWluIENoYXJ0IENvbXBvbmVudChzKQorCisgICAgICBsaW5lcworICAgICAgICAud2lkdGgoYXZhaWxhYmxlV2lkdGgpCisgICAgICAgIC5oZWlnaHQoYXZhaWxhYmxlSGVpZ2h0MSkKKyAgICAgICAgLmNvbG9yKAorICAgICAgICAgIGRhdGEKKyAgICAgICAgICAgIC5tYXAoZnVuY3Rpb24oZCxpKSB7CisgICAgICAgICAgICAgIHJldHVybiBkLmNvbG9yIHx8IGNvbG9yKGQsIGkpOworICAgICAgICAgICAgfSkKKyAgICAgICAgICAgIC5maWx0ZXIoZnVuY3Rpb24oZCxpKSB7CisgICAgICAgICAgICAgIHJldHVybiAhZGF0YVtpXS5kaXNhYmxlZDsKKyAgICAgICAgICB9KQorICAgICAgICApOworCisgICAgICBsaW5lczIKKyAgICAgICAgLmRlZmluZWQobGluZXMuZGVmaW5lZCgpKQorICAgICAgICAud2lkdGgoYXZhaWxhYmxlV2lkdGgpCisgICAgICAgIC5oZWlnaHQoYXZhaWxhYmxlSGVpZ2h0MikKKyAgICAgICAgLmNvbG9yKAorICAgICAgICAgIGRhdGEKKyAgICAgICAgICAgIC5tYXAoZnVuY3Rpb24oZCxpKSB7CisgICAgICAgICAgICAgIHJldHVybiBkLmNvbG9yIHx8IGNvbG9yKGQsIGkpOworICAgICAgICAgICAgfSkKKyAgICAgICAgICAgIC5maWx0ZXIoZnVuY3Rpb24oZCxpKSB7CisgICAgICAgICAgICAgIHJldHVybiAhZGF0YVtpXS5kaXNhYmxlZDsKKyAgICAgICAgICB9KQorICAgICAgICApOworCisgICAgICBnLnNlbGVjdCgnLm52LWNvbnRleHQnKQorICAgICAgICAgIC5hdHRyKCd0cmFuc2Zvcm0nLCAndHJhbnNsYXRlKDAsJyArICggYXZhaWxhYmxlSGVpZ2h0MSArIG1hcmdpbi5ib3R0b20gKyBtYXJnaW4yLnRvcCkgKyAnKScpCisKKyAgICAgIHZhciBjb250ZXh0TGluZXNXcmFwID0gZy5zZWxlY3QoJy5udi1jb250ZXh0IC5udi1saW5lc1dyYXAnKQorICAgICAgICAgIC5kYXR1bShkYXRhLmZpbHRlcihmdW5jdGlvbihkKSB7IHJldHVybiAhZC5kaXNhYmxlZCB9KSkKKworICAgICAgZDMudHJhbnNpdGlvbihjb250ZXh0TGluZXNXcmFwKS5jYWxsKGxpbmVzMik7CisKKyAgICAgIC8vLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tCisKKworICAgICAgLyoKKyAgICAgIHZhciBmb2N1c0xpbmVzV3JhcCA9IGcuc2VsZWN0KCcubnYtZm9jdXMgLm52LWxpbmVzV3JhcCcpCisgICAgICAgICAgLmRhdHVtKGRhdGEuZmlsdGVyKGZ1bmN0aW9uKGQpIHsgcmV0dXJuICFkLmRpc2FibGVkIH0pKQorCisgICAgICBkMy50cmFuc2l0aW9uKGZvY3VzTGluZXNXcmFwKS5jYWxsKGxpbmVzKTsKKyAgICAgKi8KKworCisgICAgICAvLy0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLQorICAgICAgLy8gU2V0dXAgTWFpbiAoRm9jdXMpIEF4ZXMKKworICAgICAgeEF4aXMKKyAgICAgICAgLnNjYWxlKHgpCisgICAgICAgIC50aWNrcyggYXZhaWxhYmxlV2lkdGggLyAxMDAgKQorICAgICAgICAudGlja1NpemUoLWF2YWlsYWJsZUhlaWdodDEsIDApOworCisgICAgICB5QXhpcworICAgICAgICAuc2NhbGUoeSkKKyAgICAgICAgLnRpY2tzKCBhdmFpbGFibGVIZWlnaHQxIC8gMzYgKQorICAgICAgICAudGlja1NpemUoIC1hdmFpbGFibGVXaWR0aCwgMCk7CisKKyAgICAgIGcuc2VsZWN0KCcubnYtZm9jdXMgLm52LXgubnYtYXhpcycpCisgICAgICAgICAgLmF0dHIoJ3RyYW5zZm9ybScsICd0cmFuc2xhdGUoMCwnICsgYXZhaWxhYmxlSGVpZ2h0MSArICcpJyk7CisKKyAgICAgIC8vLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tCisKKworICAgICAgLy8tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0KKyAgICAgIC8vIFNldHVwIEJydXNoCisKKyAgICAgIGJydXNoCisgICAgICAgIC54KHgyKQorICAgICAgICAub24oJ2JydXNoJywgb25CcnVzaCk7CisKKyAgICAgIGlmIChicnVzaEV4dGVudCkgYnJ1c2guZXh0ZW50KGJydXNoRXh0ZW50KTsKKworICAgICAgdmFyIGJydXNoQkcgPSBnLnNlbGVjdCgnLm52LWJydXNoQmFja2dyb3VuZCcpLnNlbGVjdEFsbCgnZycpCisgICAgICAgICAgLmRhdGEoW2JydXNoRXh0ZW50IHx8IGJydXNoLmV4dGVudCgpXSkKKworICAgICAgdmFyIGJydXNoQkdlbnRlciA9IGJydXNoQkcuZW50ZXIoKQorICAgICAgICAgIC5hcHBlbmQoJ2cnKTsKKworICAgICAgYnJ1c2hCR2VudGVyLmFwcGVuZCgncmVjdCcpCisgICAgICAgICAgLmF0dHIoJ2NsYXNzJywgJ2xlZnQnKQorICAgICAgICAgIC5hdHRyKCd4JywgMCkKKyAgICAgICAgICAuYXR0cigneScsIDApCisgICAgICAgICAgLmF0dHIoJ2hlaWdodCcsIGF2YWlsYWJsZUhlaWdodDIpOworCisgICAgICBicnVzaEJHZW50ZXIuYXBwZW5kKCdyZWN0JykKKyAgICAgICAgICAuYXR0cignY2xhc3MnLCAncmlnaHQnKQorICAgICAgICAgIC5hdHRyKCd4JywgMCkKKyAgICAgICAgICAuYXR0cigneScsIDApCisgICAgICAgICAgLmF0dHIoJ2hlaWdodCcsIGF2YWlsYWJsZUhlaWdodDIpOworCisgICAgICBnQnJ1c2ggPSBnLnNlbGVjdCgnLm52LXgubnYtYnJ1c2gnKQorICAgICAgICAgIC5jYWxsKGJydXNoKTsKKyAgICAgIGdCcnVzaC5zZWxlY3RBbGwoJ3JlY3QnKQorICAgICAgICAgIC8vLmF0dHIoJ3knLCAtNSkKKyAgICAgICAgICAuYXR0cignaGVpZ2h0JywgYXZhaWxhYmxlSGVpZ2h0Mik7CisgICAgICBnQnJ1c2guc2VsZWN0QWxsKCcucmVzaXplJykuYXBwZW5kKCdwYXRoJykuYXR0cignZCcsIHJlc2l6ZVBhdGgpOworCisgICAgICBvbkJydXNoKCk7CisKKyAgICAgIC8vLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tCisKKworICAgICAgLy8tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0KKyAgICAgIC8vIFNldHVwIFNlY29uZGFyeSAoQ29udGV4dCkgQXhlcworCisgICAgICB4MkF4aXMKKyAgICAgICAgLnNjYWxlKHgyKQorICAgICAgICAudGlja3MoIGF2YWlsYWJsZVdpZHRoIC8gMTAwICkKKyAgICAgICAgLnRpY2tTaXplKC1hdmFpbGFibGVIZWlnaHQyLCAwKTsKKworICAgICAgZy5zZWxlY3QoJy5udi1jb250ZXh0IC5udi14Lm52LWF4aXMnKQorICAgICAgICAgIC5hdHRyKCd0cmFuc2Zvcm0nLCAndHJhbnNsYXRlKDAsJyArIHkyLnJhbmdlKClbMF0gKyAnKScpOworICAgICAgZDMudHJhbnNpdGlvbihnLnNlbGVjdCgnLm52LWNvbnRleHQgLm52LXgubnYtYXhpcycpKQorICAgICAgICAgIC5jYWxsKHgyQXhpcyk7CisKKworICAgICAgeTJBeGlzCisgICAgICAgIC5zY2FsZSh5MikKKyAgICAgICAgLnRpY2tzKCBhdmFpbGFibGVIZWlnaHQyIC8gMzYgKQorICAgICAgICAudGlja1NpemUoIC1hdmFpbGFibGVXaWR0aCwgMCk7CisKKyAgICAgIGQzLnRyYW5zaXRpb24oZy5zZWxlY3QoJy5udi1jb250ZXh0IC5udi15Lm52LWF4aXMnKSkKKyAgICAgICAgICAuY2FsbCh5MkF4aXMpOworCisgICAgICBnLnNlbGVjdCgnLm52LWNvbnRleHQgLm52LXgubnYtYXhpcycpCisgICAgICAgICAgLmF0dHIoJ3RyYW5zZm9ybScsICd0cmFuc2xhdGUoMCwnICsgeTIucmFuZ2UoKVswXSArICcpJyk7CisKKyAgICAgIC8vLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tCisKKworICAgICAgLy89PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKyAgICAgIC8vIEV2ZW50IEhhbmRsaW5nL0Rpc3BhdGNoaW5nIChpbiBjaGFydCdzIHNjb3BlKQorICAgICAgLy8tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0KKworICAgICAgbGVnZW5kLmRpc3BhdGNoLm9uKCdsZWdlbmRDbGljaycsIGZ1bmN0aW9uKGQsaSkgeworICAgICAgICBkLmRpc2FibGVkID0gIWQuZGlzYWJsZWQ7CisKKyAgICAgICAgaWYgKCFkYXRhLmZpbHRlcihmdW5jdGlvbihkKSB7IHJldHVybiAhZC5kaXNhYmxlZCB9KS5sZW5ndGgpIHsKKyAgICAgICAgICBkYXRhLm1hcChmdW5jdGlvbihkKSB7CisgICAgICAgICAgICBkLmRpc2FibGVkID0gZmFsc2U7CisgICAgICAgICAgICB3cmFwLnNlbGVjdEFsbCgnLm52LXNlcmllcycpLmNsYXNzZWQoJ2Rpc2FibGVkJywgZmFsc2UpOworICAgICAgICAgICAgcmV0dXJuIGQ7CisgICAgICAgICAgfSk7CisgICAgICAgIH0KKworICAgICAgICBjb250YWluZXIudHJhbnNpdGlvbigpLmNhbGwoY2hhcnQpOworICAgICAgfSk7CisKKyAgICAgIGRpc3BhdGNoLm9uKCd0b29sdGlwU2hvdycsIGZ1bmN0aW9uKGUpIHsKKyAgICAgICAgaWYgKHRvb2x0aXBzKSBzaG93VG9vbHRpcChlLCB0aGF0LnBhcmVudE5vZGUpOworICAgICAgfSk7CisKKyAgICAgIC8vPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisKKworICAgICAgLy89PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKyAgICAgIC8vIEZ1bmN0aW9ucworICAgICAgLy8tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0KKworICAgICAgLy8gVGFrZW4gZnJvbSBjcm9zc2ZpbHRlciAoaHR0cDovL3NxdWFyZS5naXRodWIuY29tL2Nyb3NzZmlsdGVyLykKKyAgICAgIGZ1bmN0aW9uIHJlc2l6ZVBhdGgoZCkgeworICAgICAgICB2YXIgZSA9ICsoZCA9PSAnZScpLAorICAgICAgICAgICAgeCA9IGUgPyAxIDogLTEsCisgICAgICAgICAgICB5ID0gYXZhaWxhYmxlSGVpZ2h0MiAvIDM7CisgICAgICAgIHJldHVybiAnTScgKyAoLjUgKiB4KSArICcsJyArIHkKKyAgICAgICAgICAgICsgJ0E2LDYgMCAwICcgKyBlICsgJyAnICsgKDYuNSAqIHgpICsgJywnICsgKHkgKyA2KQorICAgICAgICAgICAgKyAnVicgKyAoMiAqIHkgLSA2KQorICAgICAgICAgICAgKyAnQTYsNiAwIDAgJyArIGUgKyAnICcgKyAoLjUgKiB4KSArICcsJyArICgyICogeSkKKyAgICAgICAgICAgICsgJ1onCisgICAgICAgICAgICArICdNJyArICgyLjUgKiB4KSArICcsJyArICh5ICsgOCkKKyAgICAgICAgICAgICsgJ1YnICsgKDIgKiB5IC0gOCkKKyAgICAgICAgICAgICsgJ00nICsgKDQuNSAqIHgpICsgJywnICsgKHkgKyA4KQorICAgICAgICAgICAgKyAnVicgKyAoMiAqIHkgLSA4KTsKKyAgICAgIH0KKworCisgICAgICBmdW5jdGlvbiB1cGRhdGVCcnVzaEJHKCkgeworICAgICAgICBpZiAoIWJydXNoLmVtcHR5KCkpIGJydXNoLmV4dGVudChicnVzaEV4dGVudCk7CisgICAgICAgIGJydXNoQkcKKyAgICAgICAgICAgIC5kYXRhKFticnVzaC5lbXB0eSgpID8geDIuZG9tYWluKCkgOiBicnVzaEV4dGVudF0pCisgICAgICAgICAgICAuZWFjaChmdW5jdGlvbihkLGkpIHsKKyAgICAgICAgICAgICAgdmFyIGxlZnRXaWR0aCA9IHgyKGRbMF0pIC0geC5yYW5nZSgpWzBdLAorICAgICAgICAgICAgICAgICAgcmlnaHRXaWR0aCA9IHgucmFuZ2UoKVsxXSAtIHgyKGRbMV0pOworICAgICAgICAgICAgICBkMy5zZWxlY3QodGhpcykuc2VsZWN0KCcubGVmdCcpCisgICAgICAgICAgICAgICAgLmF0dHIoJ3dpZHRoJywgIGxlZnRXaWR0aCA8IDAgPyAwIDogbGVmdFdpZHRoKTsKKworICAgICAgICAgICAgICBkMy5zZWxlY3QodGhpcykuc2VsZWN0KCcucmlnaHQnKQorICAgICAgICAgICAgICAgIC5hdHRyKCd4JywgeDIoZFsxXSkpCisgICAgICAgICAgICAgICAgLmF0dHIoJ3dpZHRoJywgcmlnaHRXaWR0aCA8IDAgPyAwIDogcmlnaHRXaWR0aCk7CisgICAgICAgICAgICB9KTsKKyAgICAgIH0KKworCisgICAgICBmdW5jdGlvbiBvbkJydXNoKCkgeworICAgICAgICBicnVzaEV4dGVudCA9IGJydXNoLmVtcHR5KCkgPyBudWxsIDogYnJ1c2guZXh0ZW50KCk7CisgICAgICAgIGV4dGVudCA9IGJydXNoLmVtcHR5KCkgPyB4Mi5kb21haW4oKSA6IGJydXNoLmV4dGVudCgpOworCisKKyAgICAgICAgZGlzcGF0Y2guYnJ1c2goe2V4dGVudDogZXh0ZW50LCBicnVzaDogYnJ1c2h9KTsKKworCisgICAgICAgIHVwZGF0ZUJydXNoQkcoKTsKKworICAgICAgICAvLyBVcGRhdGUgTWFpbiAoRm9jdXMpCisgICAgICAgIHZhciBmb2N1c0xpbmVzV3JhcCA9IGcuc2VsZWN0KCcubnYtZm9jdXMgLm52LWxpbmVzV3JhcCcpCisgICAgICAgICAgICAuZGF0dW0oCisgICAgICAgICAgICAgIGRhdGEKKyAgICAgICAgICAgICAgICAuZmlsdGVyKGZ1bmN0aW9uKGQpIHsgcmV0dXJuICFkLmRpc2FibGVkIH0pCisgICAgICAgICAgICAgICAgLm1hcChmdW5jdGlvbihkLGkpIHsKKyAgICAgICAgICAgICAgICAgIHJldHVybiB7CisgICAgICAgICAgICAgICAgICAgIGtleTogZC5rZXksCisgICAgICAgICAgICAgICAgICAgIHZhbHVlczogZC52YWx1ZXMuZmlsdGVyKGZ1bmN0aW9uKGQsaSkgeworICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBsaW5lcy54KCkoZCxpKSA+PSBleHRlbnRbMF0gJiYgbGluZXMueCgpKGQsaSkgPD0gZXh0ZW50WzFdOworICAgICAgICAgICAgICAgICAgICB9KQorICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIH0pCisgICAgICAgICAgICApOworICAgICAgICBkMy50cmFuc2l0aW9uKGZvY3VzTGluZXNXcmFwKS5jYWxsKGxpbmVzKTsKKworCisgICAgICAgIC8vIFVwZGF0ZSBNYWluIChGb2N1cykgQXhlcworICAgICAgICBkMy50cmFuc2l0aW9uKGcuc2VsZWN0KCcubnYtZm9jdXMgLm52LXgubnYtYXhpcycpKQorICAgICAgICAgICAgLmNhbGwoeEF4aXMpOworICAgICAgICBkMy50cmFuc2l0aW9uKGcuc2VsZWN0KCcubnYtZm9jdXMgLm52LXkubnYtYXhpcycpKQorICAgICAgICAgICAgLmNhbGwoeUF4aXMpOworICAgICAgfQorCisgICAgICAvLz09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorCisKKyAgICB9KTsKKworICAgIHJldHVybiBjaGFydDsKKyAgfQorCisKKyAgLy89PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKyAgLy8gRXZlbnQgSGFuZGxpbmcvRGlzcGF0Y2hpbmcgKG91dCBvZiBjaGFydCdzIHNjb3BlKQorICAvLy0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLQorCisgIGxpbmVzLmRpc3BhdGNoLm9uKCdlbGVtZW50TW91c2VvdmVyLnRvb2x0aXAnLCBmdW5jdGlvbihlKSB7CisgICAgZS5wb3MgPSBbZS5wb3NbMF0gKyAgbWFyZ2luLmxlZnQsIGUucG9zWzFdICsgbWFyZ2luLnRvcF07CisgICAgZGlzcGF0Y2gudG9vbHRpcFNob3coZSk7CisgIH0pOworCisgIGxpbmVzLmRpc3BhdGNoLm9uKCdlbGVtZW50TW91c2VvdXQudG9vbHRpcCcsIGZ1bmN0aW9uKGUpIHsKKyAgICBkaXNwYXRjaC50b29sdGlwSGlkZShlKTsKKyAgfSk7CisKKyAgZGlzcGF0Y2gub24oJ3Rvb2x0aXBIaWRlJywgZnVuY3Rpb24oKSB7CisgICAgaWYgKHRvb2x0aXBzKSBudi50b29sdGlwLmNsZWFudXAoKTsKKyAgfSk7CisKKyAgLy89PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKworCisgIC8vPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisgIC8vIEV4cG9zZSBQdWJsaWMgVmFyaWFibGVzCisgIC8vLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tCisKKyAgLy8gZXhwb3NlIGNoYXJ0J3Mgc3ViLWNvbXBvbmVudHMKKyAgY2hhcnQuZGlzcGF0Y2ggPSBkaXNwYXRjaDsKKyAgY2hhcnQubGVnZW5kID0gbGVnZW5kOworICBjaGFydC5saW5lcyA9IGxpbmVzOworICBjaGFydC5saW5lczIgPSBsaW5lczI7CisgIGNoYXJ0LnhBeGlzID0geEF4aXM7CisgIGNoYXJ0LnlBeGlzID0geUF4aXM7CisgIGNoYXJ0LngyQXhpcyA9IHgyQXhpczsKKyAgY2hhcnQueTJBeGlzID0geTJBeGlzOworCisgIGQzLnJlYmluZChjaGFydCwgbGluZXMsICdkZWZpbmVkJywgJ2lzQXJlYScsICdza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udHMubGVuZ3RoKSByZXR1cm4gbWFyZ2luMjsKKyAgICBtYXJnaW4yID0gXzsKKyAgICByZXR1cm4gY2hhcnQ7CisgIH07CisKKyAgY2hhcnQud2lkdGggPSBmdW5jdGlvbihfKSB7CisgICAgaWYgKCFhcmd1bWVudHMubGVuZ3RoKSByZXR1cm4gd2lkdGg7CisgICAgd2lkdGggPSBfOworICAgIHJldHVybiBjaGFydDsKKyAgfTsKKworICBjaGFydC5oZWlnaHQgPSBmdW5jdGlvbihfKSB7CisgICAgaWYgKCFhcmd1bWVudHMubGVuZ3RoKSByZXR1cm4gaGVpZ2h0OworICAgIGhlaWdodCA9IF87CisgICAgcmV0dXJuIGNoYXJ0OworICB9OworCisgIGNoYXJ0LmhlaWdodDIgPSBmdW5jdGlvbihfKSB7CisgICAgaWYgKCFhcmd1bWVudHMubGVuZ3RoKSByZXR1cm4gaGVpZ2h0MjsKKyAgICBoZWlnaHQyID0gXzsKKyAgICByZXR1cm4gY2hhcnQ7CisgIH07CisKKyAgY2hhcnQuY29sb3IgPSBmdW5jdGlvbihfKSB7CisgICAgaWYgKCFhcmd1bWVudHMubGVuZ3RoKSByZXR1cm4gY29sb3I7CisgICAgY29sb3IgPW52LnV0aWxzLmdldENvbG9yKF8pOworICAgIGxlZ2VuZC5jb2xvcihjb2xvcik7CisgICAgcmV0dXJuIGNoYXJ0OworICB9OworCisgIGNoYXJ0LnNob3dMZWdlbmQgPSBmdW5jdGlvbihfKSB7CisgICAgaWYgKCFhcmd1bWVudHMubGVuZ3RoKSByZXR1cm4gc2hvd0xlZ2VuZDsKKyAgICBzaG93TGVnZW5kID0gXzsKKyAgICByZXR1cm4gY2hhcnQ7CisgIH07CisKKyAgY2hhcnQudG9vbHRpcHMgPSBmdW5jdGlvbihfKSB7CisgICAgaWYgKCFhcmd1bWVudHMubGVuZ3RoKSByZXR1cm4gdG9vbHRpcHM7CisgICAgdG9vbHRpcHMgPSBfOworICAgIHJldHVybiBjaGFydDsKKyAgfTsKKwor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k7CisgICAgeTJBeGlzLnRpY2tGb3JtYXQoXyk7CisgICAgcmV0dXJuIGNoYXJ0OworICB9OworCisgIC8vPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisKKworICByZXR1cm4gY2hhcnQ7Cit9CisKK252Lm1vZGVscy5saW5lUGx1c0JhcldpdGhGb2N1c0NoYXJ0ID0gZnVuY3Rpb24oKSB7CisKKyAgLy89PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKyAgLy8gUHVibGljIFZhcmlhYmxlcyB3aXRoIERlZmF1bHQgU2V0dGluZ3MKKyAgLy8tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0KKworICB2YXIgbGluZXMgPSBudi5tb2RlbHMubGluZSgpCisgICAgLCBsaW5lczIgPSBudi5tb2RlbHMubGluZSgpCisgICAgLCBiYXJzID0gbnYubW9kZWxzLmhpc3RvcmljYWxCYXIoKQorICAgICwgYmFyczIgPSBudi5tb2RlbHMuaGlzdG9yaWNhbEJhcigpCisgICAgLCB4QXhpcyA9IG52Lm1vZGVscy5heGlzKCkKKyAgICAsIHgyQXhpcyA9IG52Lm1vZGVscy5heGlzKCkKKyAgICAsIHkxQXhpcyA9IG52Lm1vZGVscy5heGlzKCkKKyAgICAsIHkyQXhpcyA9IG52Lm1vZGVscy5heGlzKCkKKyAgICAsIHkzQXhpcyA9IG52Lm1vZGVscy5heGlzKCkKKyAgICAsIHk0QXhpcyA9IG52Lm1vZGVscy5heGlzKCkKKyAgICAsIGxlZ2VuZCA9IG52Lm1vZGVscy5sZWdlbmQoKQorICAgICwgYnJ1c2ggPSBkMy5zdmcuYnJ1c2goKQorICAgIDsKKworICB2YXIgbWFyZ2luID0ge3RvcDogMzAsIHJpZ2h0OiAzMCwgYm90dG9tOiAzMCwgbGVmdDogN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zCisgICAgLm9yaWVudCgncmlnaHQnKQorICAgIDsKKyAgeDJBeGlzCisgICAgLm9yaWVudCgnYm90dG9tJykKKyAgICAudGlja1BhZGRpbmcoNSkKKyAgICA7CisgIHkzQXhpcworICAgIC5vcmllbnQoJ2xlZnQnKQorICAgIDsKKyAgeTRBeGlzCisgICAgLm9yaWVudCgncmlnaHQnKQorICAgIDsKKworICAvLz09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorCisKKyAgLy89PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKyAgLy8gUHJpdmF0ZSBWYXJpYWJsZXMKKyAgLy8tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0KKworICB2YXIgc2hvd1Rvb2x0aXAgPSBmdW5jdGlvbihlLCBvZmZzZXRFbGVtZW50KSB7CisgICAgaWYgKGV4dGVudCkgeworICAgICAgICBlLnBvaW50SW5kZXggKz0gTWF0aC5jZWlsKGV4dGVudFswXSk7CisgICAgfQorICAgIHZhciBsZWZ0ID0gZS5wb3NbMF0gKyAoIG9mZnNldEVsZW1lbnQub2Zmc2V0TGVmdCB8fCAwICksCisgICAgICAgIHRvcCA9IGUucG9zWzFdICsgKCBvZmZzZXRFbGVtZW50Lm9mZnNldFRvcCB8fCAwKSwKKyAgICAgICAgeCA9IHhBeGlzLnRpY2tGb3JtYXQoKShsaW5lcy54KCkoZS5wb2ludCwgZS5wb2ludEluZGV4KSksCisgICAgICAgIHkgPSAoZS5zZXJpZXMuYmFyID8geTFBeGlzIDogeTJBeGlzKS50aWNrRm9ybWF0KCkobGluZXMueSgpKGUucG9pbnQsIGUucG9pbnRJbmRleCkpLAorICAgICAgICBjb250ZW50ID0gdG9vbHRpcChlLnNlcmllcy5rZXksIHgsIHksIGUsIGNoYXJ0KTsKKworICAg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0tLS0tLS0KKyAgICAgIC8vIFNldHVwIFNjYWxlcworCisgICAgICB2YXIgZGF0YUJhcnMgPSBkYXRhLmZpbHRlcihmdW5jdGlvbihkKSB7IHJldHVybiAhZC5kaXNhYmxlZCAmJiBkLmJhciB9KTsKKyAgICAgIHZhciBkYXRhTGluZXMgPSBkYXRhLmZpbHRlcihmdW5jdGlvbihkKSB7IHJldHVybiAhZC5iYXIgfSk7IC8vIHJlbW92ZWQgdGhlICFkLmRpc2FibGVkIGNsYXVzZSBoZXJlIHRvIGZpeCBJc3N1ZSAjMjQwCisKKyAgICAgIHggPSBiYXJzLnhTY2FsZSgpOworICAgICAgeDIgPSB4MkF4aXMuc2NhbGUoKTsKKyAgICAgIHkxID0gYmFycy55U2NhbGUoKTsKKyAgICAgIHkyID0gbGluZXMueVNjYWxlKCk7CisgICAgICB5MyA9IGJhcnMyLnlTY2FsZSgpOworICAgICAgeTQgPSBsaW5lczIueVNjYWxlKCk7CisKKyAgICAgIHZhciBzZXJpZXMxID0gZGF0YQorICAgICAgICAuZmlsdGVyKGZ1bmN0aW9uKGQpIHsgcmV0dXJuICFkLmRpc2FibGVkICYmIGQuYmFyIH0pCisgICAgICAgIC5tYXAoZnVuY3Rpb24oZCkgeworICAgICAgICAgIHJldHVybiBkLnZhbHVlcy5tYXAoZnVuY3Rpb24oZCxpKSB7CisgICAgICAgICAgICByZXR1cm4geyB4OiBnZXRYKGQsaSksIHk6IGdldFkoZCxpKSB9CisgICAgICAgICAgfSkKKyAgICAgICAgfSk7CisKKyAgICAgIHZhciBzZXJpZXMyID0gZGF0YQorICAgICAgICAuZmlsdGVyKGZ1bmN0aW9uKGQpIHsgcmV0dXJuICFkLmRpc2FibGVkICYmICFkLmJhciB9KQorICAgICAgICAubWFwKGZ1bmN0aW9uKGQpIHsKKyAgICAgICAgICByZXR1cm4gZC52YWx1ZXMubWFwKGZ1bmN0aW9uKGQsaSkgeworICAgICAgICAgICAgcmV0dXJuIHsgeDogZ2V0WChkLGkp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tLS0tLS0KKworCisgICAgICAvLy0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLQorICAgICAgLy8gTGVnZW5kCisKKyAgICAgIGlmIChzaG93TGVnZW5kKSB7CisgICAgICAgIGxlZ2VuZC53aWR0aCggYXZhaWxhYmxlV2lkdGggLyAyICk7CisKKyAgICAgICAgZy5zZWxlY3QoJy5udi1sZWdlbmRXcmFwJykKKyAgICAgICAgICAgIC5kYXR1bShkYXRhLm1hcChmdW5jdGlvbihzZXJpZXMpIHsKKyAgICAgICAgICAgICAgc2VyaWVzLm9yaWdpbmFsS2V5ID0gc2VyaWVzLm9yaWdpbmFsS2V5ID09PSB1bmRlZmluZWQgPyBzZXJpZXMua2V5IDogc2VyaWVzLm9yaWdpbmFsS2V5OworICAgICAgICAgICAgICBzZXJpZXMua2V5ID0gc2VyaWVzLm9yaWdpbmFsS2V5ICsgKHNlcmllcy5iYXIgPyAnIChsZWZ0IGF4aXMpJyA6ICcgKHJpZ2h0IGF4aXMpJyk7CisgICAgICAgICAgICAgIHJldHVybiBzZXJpZXM7CisgICAgICAgICAgICB9KSkKKyAgICAgICAgICAuY2FsbChsZWdlbmQpOworCisgICAgICAgIGlmICggbWFyZ2luLnRvcCAhPSBsZWdlbmQuaGVpZ2h0KCkpIHsKKyAgICAgICAgICBtYXJnaW4udG9wID0gbGVnZW5kLmhlaWdodCgpOworICAgICAgICAgIGF2YWlsYWJsZUhlaWdodDEgPSAoaGVpZ2h0IHx8IHBhcnNlSW50KGNvbnRhaW5lci5zdHlsZSgnaGVpZ2h0JykpIHx8IDQwMCkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLSBtYXJnaW4udG9wIC0gbWFyZ2luLmJvdHRvbSAtIGhlaWdodDI7CisgICAgICAgIH0KKworICAgICAgICBnLnNlbGVjdCgnLm52LWxlZ2VuZFdyYXAnKQorICAgICAgICAgICAgLmF0dHIoJ3RyYW5zZm9ybScsICd0cmFuc2xhdGUoJyArICggYXZhaWxhYmxlV2lkdGggLyAyICkgKyAnLCcgKyAoLW1hcmdpbi50b3ApICsnKScpOworICAgICAgfQorCisgICAgICAvLy0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLQorCisKKyAgICAgIHdyYXAuYXR0cigndHJhbnNmb3JtJywgJ3RyYW5zbGF0ZSgnICsgbWFyZ2luLmxlZnQgKyAnLCcgKyBtYXJnaW4udG9wICsgJyknKTsKKworCisgICAgICAvLy0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLQorICAgICAgLy8gQ29udGV4dCBDb21wb25lbnRzCisKKyAgICAgIGJhcnMyCisgICAgICAgIC53aWR0aChhdmFpbGFibGVXaWR0aCkKKyAgICAgICAgLmhlaWdodChhdmFpbGFibGVIZWlnaHQyKQorICAgICAgICAuY29sb3IoZGF0YS5tYXAoZnVuY3Rpb24oZCxpKSB7CisgICAgICAgICAgcmV0dXJuIGQuY29sb3IgfHwgY29sb3IoZCwgaSk7CisgICAgICAgIH0pLmZpbHRlcihmdW5jdGlvbihkLGkpIHsgcmV0dXJuICFkYXRhW2ldLmRpc2FibGVkICYmIGRhdGFbaV0uYmFyIH0pKTsKKworICAgICAgbGluZXMyCisgICAgICAgIC53aWR0aChhdmFpbGFibGVXaWR0aCkKKyAgICAgICAgLmhlaWdodChhdmFpbGFibGVIZWlnaHQyKQorICAgICAgICAuY29sb3IoZGF0YS5tYXAoZnVuY3Rpb24oZCxpKSB7CisgICAgICAgICAgcmV0dXJuIGQuY29sb3IgfHwgY29sb3IoZCwgaSk7CisgICAgICAgIH0pLmZpbHRlcihmdW5jdGlvbihkLGkpIHsgcmV0dXJuICFkYXRhW2ldLmRpc2FibGVkICYmICFkYXRhW2ldLmJhciB9KSk7CisgICAgICAgIAorICAgICAgdmFyIGJhcnMyV3JhcCA9IGcuc2VsZWN0KCcubnYtY29udGV4dCAubnYtYmFyc1dyYXAnKQorICAgICAgICAgIC5kYXR1bShkYXRhQmFycy5sZW5ndGggPyBkYXRhQmFycyA6IFt7dmFsdWVzOltdfV0pOworCisgICAgICB2YXIgbGluZXMyV3JhcCA9IGcuc2VsZWN0KCcubnYtY29udGV4dCAubnYtbGluZXNXcmFwJykKKyAgICAgICAgICAuZGF0dW0oIWRhdGFMaW5lc1swXS5kaXNhYmxlZCA/IGRhdGFMaW5lcyA6IFt7dmFsdWVzOltdfV0pOworICAgICAgICAgIAorICAgICAgZy5zZWxlY3QoJy5udi1jb250ZXh0JykKKyAgICAgICAgICAuYXR0cigndHJhbnNmb3JtJywgJ3RyYW5zbGF0ZSgwLCcgKyAoIGF2YWlsYWJsZUhlaWdodDEgKyBtYXJnaW4uYm90dG9tICsgbWFyZ2luMi50b3ApICsgJyknKQorCisgICAgICBkMy50cmFuc2l0aW9uKGJhcnMyV3JhcCkuY2FsbChiYXJzMik7CisgICAgICBkMy50cmFuc2l0aW9uKGxpbmVzMldyYXApLmNhbGwobGluZXMyKTsKKworICAgICAgLy8tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0KKworCisKKyAgICAgIC8vLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tCisgICAgICAvLyBTZXR1cCBCcnVzaAorCisgICAgICBicnVzaAorICAgICAgICAueCh4MikKKyAgICAgICAgLm9uKCdicnVzaCcsIG9uQnJ1c2gpOworCisgICAgICBpZiAoYnJ1c2hFeHRlbnQpIGJydXNoLmV4dGVudChicnVzaEV4dGVudCk7CisKKyAgICAgIHZhciBicnVzaEJHID0gZy5zZWxlY3QoJy5udi1icnVzaEJhY2tncm91bmQnKS5zZWxlY3RBbG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0tLS0tLS0tLS0tLS0tCisgICAgICAvLyBTZXR1cCBTZWNvbmRhcnkgKENvbnRleHQpIEF4ZXMKKworICAgICAgeDJBeGlzCisgICAgICAgIC50aWNrcyggYXZhaWxhYmxlV2lkdGggLyAxMDAgKQorICAgICAgICAudGlja1NpemUoLWF2YWlsYWJsZUhlaWdodDIsIDApOworCisgICAgICBnLnNlbGVjdCgnLm52LWNvbnRleHQgLm52LXgubnYtYXhpcycpCisgICAgICAgICAgLmF0dHIoJ3RyYW5zZm9ybScsICd0cmFuc2xhdGUoMCwnICsgeTMucmFuZ2UoKVswXSArICcpJyk7CisgICAgICBkMy50cmFuc2l0aW9uKGcuc2VsZWN0KCcubnYtY29udGV4dCAubnYteC5udi1heGlzJykpCisgICAgICAgICAgLmNhbGwoeDJBeGlzKTsKKworCisgICAgICB5M0F4aXMKKyAgICAgICAgLnNjYWxlKHkzKQorICAgICAgICAudGlja3MoIGF2YWlsYWJsZUhlaWdodDIgLyAzNiApCisgICAgICAgIC50aWNrU2l6ZSggLWF2YWlsYWJsZVdpZHRoLCAwKTsKKworICAgICAgZy5zZWxlY3QoJy5udi1jb250ZXh0IC5udi15MS5udi1heGlzJykKKyAgICAgICAgICAuc3R5bGUoJ29wYWNpdHknLCBkYXRhQmFycy5sZW5ndGggPyAxIDogMCkKKyAgICAgICAgICAuYXR0cigndHJhbnNmb3JtJywgJ3RyYW5zbGF0ZSgwLCcgKyB4Mi5yYW5nZSgpWzBdICsgJyknKTsKKyAgICAgICAgICAKKyAgICAgIGQzLnRyYW5zaXRpb24oZy5zZWxlY3QoJy5udi1jb250ZXh0IC5udi15MS5udi1heGlzJykpCisgICAgICAgICAgLmNhbGwoeTNBeGlzKTsKKyAgICAgICAgICAKKworICAgICAgeTRBeGlzCisgICAgICAgIC5zY2FsZSh5NCkKKyAgICAgICAgLnRpY2tzKCBhdmFpbGFibGVIZWlnaHQyIC8gMzYgKQorICAgICAgICAudGlja1NpemUoZGF0YUJhcnMubGVuZ3RoID8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xzZTsKKyAgICAgICAgICAgIHdyYXAuc2VsZWN0QWxsKCcubnYtc2VyaWVzJykuY2xhc3NlZCgnZGlzYWJsZWQnLCBmYWxzZSk7CisgICAgICAgICAgICByZXR1cm4gZDsKKyAgICAgICAgICB9KTsKKyAgICAgICAgfQorCisgICAgICAgIGNoYXJ0LnVwZGF0ZSgpOworICAgICAgfSk7CisKKyAgICAgIGRpc3BhdGNoLm9uKCd0b29sdGlwU2hvdycsIGZ1bmN0aW9uKGUpIHsKKyAgICAgICAgaWYgKHRvb2x0aXBzKSBzaG93VG9vbHRpcChlLCB0aGF0LnBhcmVudE5vZGUpOworICAgICAgfSk7CisKKyAgICAgIC8vPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisKKworICAgICAgLy89PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKyAgICAgIC8vIEZ1bmN0aW9ucworICAgICAgLy8tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0KKworICAgICAgLy8gVGFrZW4gZnJvbSBjcm9zc2ZpbHRlciAoaHR0cDovL3NxdWFyZS5naXRodWIuY29tL2Nyb3NzZmlsdGVyLykKKyAgICAgIGZ1bmN0aW9uIHJlc2l6ZVBhdGgoZCkgeworICAgICAgICB2YXIgZSA9ICsoZCA9PSAnZScpLAorICAgICAgICAgICAgeCA9IGUgPyAxIDogLTEsCisgICAgICAgICAgICB5ID0gYXZhaWxhYmxlSGVpZ2h0MiAvIDM7CisgICAgICAgIHJldHVybiAnTScgKyAoLjUgKiB4KSArICcsJyArIHkKKyAgICAgICAgICAgICsgJ0E2LDYgMCAwICcgKyBlICsgJyAnICsgKDYuNSAqIHgpICsgJywnICsgKHkgKyA2KQorICAgICAgICAgICAgKyAnVicgKyAoMiAqIHkgLSA2KQorICAgICAgICAgICAgKyAnQTYsNiAwIDAgJyArIGUgKyAnICcgKyAoLjUgKiB4KSArICcsJyArICgyICogeSkKKyAgICAgICAgICAgICsgJ1onCisgICAgICAgICAgICArICdNJyArICgyLjUgKiB4KSArICcsJyArICh5ICsgOCkKKyAgICAgICAgICAgICsgJ1YnICsgKDIgKiB5IC0gOCkKKyAgICAgICAgICAgICsgJ00nICsgKDQuNSAqIHgpICsgJywnICsgKHkgKyA4KQorICAgICAgICAgICAgKyAnVicgKyAoMiAqIHkgLSA4KTsKKyAgICAgIH0KKworCisgICAgICBmdW5jdGlvbiB1cGRhdGVCcnVzaEJHKCkgeworICAgICAgICBpZiAoIWJydXNoLmVtcHR5KCkpIGJydXNoLmV4dGVudChicnVzaEV4dGVudCk7CisgICAgICAgIGJydXNoQkcKKyAgICAgICAgICAgIC5kYXRhKFticnVzaC5lbXB0eSgpID8geDIuZG9tYWluKCkgOiBicnVzaEV4dGVudF0pCisgICAgICAgICAgICAuZWFjaChmdW5jdGlvbihkLGkpIHsKKyAgICAgICAgICAgICAgdmFyIGxlZnRXaWR0aCA9IHgyKGRbMF0pIC0geDIucmFuZ2UoKVswXSwKKyAgICAgICAgICAgICAgICAgIHJpZ2h0V2lkdGggPSB4Mi5yYW5nZSgpWzFdIC0geDIoZFsxXSk7CisgICAgICAgICAgICAgIGQzLnNlbGVjdCh0aGlzKS5zZWxlY3QoJy5sZWZ0JykKKyAgICAgICAgICAgICAgICAuYXR0cignd2lkdGgnLCAgbGVmdFdpZHRoIDwgMCA/IDAgOiBsZWZ0V2lkdGgpOworCisgICAgICAgICAgICAgIGQzLnNlbGVjdCh0aGlzKS5zZWxlY3QoJy5yaWdodCcpCisgICAgICAgICAgICAgICAgLmF0dHIoJ3gnLCB4MihkWzFdKSkKKyAgICAgICAgICAgICAgICAuYXR0cignd2lkdGgnLCByaWdodFdpZHRoIDwgMCA/IDAgOiByaWdodFdpZHRoKTsKKyAgICAgICAgICAgIH0pOworICAgICAgfQorCisKKyAgICAgIGZ1bmN0aW9uIG9uQnJ1c2goKSB7CisgICAgICAgIGJydXNoRXh0ZW50ID0gYnJ1c2guZW1wdHkoKSA/IG51bGwgOiBicnVzaC5leHRlbnQoKTsKKyAgICAgICAgZXh0ZW50ID0gYnJ1c2guZW1wdHkoKSA/IHgyLmRvbWFpbigpIDogYnJ1c2guZXh0ZW50KCk7CisKKworICAgICAgICBkaXNwYXRjaC5icnVzaCh7ZXh0ZW50OiBleHRlbnQsIGJydXNoOiBicnVzaH0pOworCisgICAgICAgIHVwZGF0ZUJydXNoQkcoKTsKKworCisgICAgICAgIC8vLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tCisgICAgICAgIC8vIFByZXBhcmUgTWFpbiAoRm9jdXMpIEJhcnMgYW5kIExpbmVzCisgICAgICAgIAorICAgICAgICBiYXJzCisgICAgICAgIC53aWR0aChhdmFpbGFibGVXaWR0aCkKKyAgICAgICAgLmhlaWdodChhdmFpbGFibGVIZWlnaHQxKQorICAgICAgICAuY29sb3IoZGF0YS5tYXAoZnVuY3Rpb24oZCxpKSB7CisgICAgICAgICAgcmV0dXJuIGQuY29sb3IgfHwgY29sb3IoZCwgaSk7CisgICAgICAgIH0pLmZpbHRlcihmdW5jdGlvbihkLGkpIHsgcmV0dXJuICFkYXRhW2ldLmRpc2FibGVkICYmIGRhdGFbaV0uYmFyIH0pKTsKKworCisgICAgICAgIGxpbmVzCisgICAgICAgIC53aWR0aChhdmFpbGFibGVXaWR0aCkKKyAgICAgICAgLmhlaWdodChhdmFpbGFibGVIZWlnaHQxKQorICAgICAgICAuY29sb3IoZGF0YS5tYXAoZnVuY3Rpb24oZCxpKSB7CisgICAgICAgICAgcmV0dXJuIGQuY29sb3IgfHwgY29sb3IoZCwgaSk7CisgICAgICAgIH0pLmZpbHRlcihmdW5jdGlvbihkLGkpIHsgcmV0dXJuICFkYXRhW2ldLmRpc2FibGVkICYmICFkYXRhW2ldLmJhciB9KSk7CisKKyAgICAgICAgdmFyIGZvY3VzQmFyc1dyYXAgPSBnLnNlbGVjdCgnLm52LWZvY3VzIC5udi1iYXJzV3JhcCcpCisgICAgICAgICAgICAuZGF0dW0oIWRhdGFCYXJzLmxlbmd0aCA/IFt7dmFsdWVzOltdfV0gOgorICAgICAgICAgICAgICBkYXRhQmFycworICAgICAgICAgICAgICAgIC5tYXAoZnVuY3Rpb24oZCxpKSB7CisgICAgICAgICAgICAgICAgICByZXR1cm4geworICAgICAgICAgICAgICAgICAgICBrZXk6IGQua2V5LAorICAgICAgICAgICAgICAgICAgICB2YWx1ZXM6IGQudmFsdWVzLmZpbHRlcihmdW5jdGlvbihkLGkpIHsKKyAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gYmFycy54KCkoZCxpKSA+PSBleHRlbnRbMF0gJiYgYmFycy54KCkoZCxpKSA8PSBleHRlbnRbMV07CisgICAgICAgICAgICAgICAgICAgIH0pCisgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgfSkKKyAgICAgICAgICAgICk7CisgICAgICAgIAorICAgICAgICB2YXIgZm9jdXNMaW5lc1dyYXAgPSBnLnNlbGVjdCgnLm52LWZvY3VzIC5udi1saW5lc1dyYXAnKQorICAgICAgICAgICAgLmRhdHVtKGRhdGFMaW5lc1swXS5kaXNhYmxlZCA/IFt7dmFsdWVzOltdfV0gOgorICAgICAgICAgICAgICBkYXRhTGluZXMKKyAgICAgICAgICAgICAgICAubWFwKGZ1bmN0aW9uKGQsaSkgeworICAgICAgICAgICAgICAgICAgcmV0dXJuIHsKKyAgICAgICAgICAgICAgICAgICAga2V5OiBkLmtleSwKKyAgICAgICAgICAgICAgICAgICAgdmFsdWVzOiBkLnZhbHVlcy5maWx0ZXIoZnVuY3Rpb24oZCxpKSB7CisgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGxpbmVzLngoKShkLGkpID49IGV4dGVudFswXSAmJiBsaW5lcy54KCkoZCxpKSA8PSBleHRlbnRbMV07CisgICAgICAgICAgICAgICAgICAgIH0pCisgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgfSkKKyAgICAgICAgICAgICApOworICAgICAgICAgICAgICAgICAKKyAgICAgICAgLy8tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0KKyAgICAgICAgCisgICAgICAgIAorICAgICAgICAvLy0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLQorICAgICAgICAvLyBVcGRhdGUgTWFpbiAoRm9jdXMpIFggQXhpcworCisgICAgICAgIGlmIChkYXRhQmFycy5sZW5ndGgpIHsKKyAgICAgICAgICAgIHggPSBiYXJzLnhTY2FsZSgpOworICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgeCA9IGxpbmVzLnhTY2FsZSgpOworICAgICAgICB9CisgICAgICAgIAorICAgICAgICB4QXhpcworICAgICAgICAuc2NhbGUoeCkKKyAgICAgICAgLnRpY2tzKCBhdmFpbGFibGVXaWR0aCAvIDEwMCApCisgICAgICAgIC50aWNrU2l6ZSgtYXZhaWxhYmxlSGVpZ2h0MSwgMCk7CisKKyAgICAgICAgeEF4aXMuZG9tYWluKFtNYXRoLmNlaWwoZXh0ZW50WzBdKSwgTWF0aC5mbG9vcihleHRlbnRbMV0pXSk7CisgICAgICAgIAorICAgICAgICBkMy50cmFuc2l0aW9uKGcuc2VsZWN0KCcubnYteC5udi1heGlzJykpCisgICAgICAgICAgLmNhbGwoeEF4aXMpOworICAgICAgICAvLy0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLQorICAgICAgICAKKyAgICAgICAgCisgICAgICAgIC8vLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tCisgICAgICAgIC8vIFVwZGF0ZSBNYWluIChGb2N1cykgQmFycyBhbmQgTGluZXMKKworICAgICAgICBkMy50cmFuc2l0aW9uKGZvY3VzQmFyc1dyYXApLmNhbGwoYmFycyk7CisgICAgICAgIGQzLnRyYW5zaXRpb24oZm9jdXNMaW5lc1dyYXApLmNhbGwobGluZXMpOworICAgICAgICAKKyAgICAgICAgLy8tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0KKyAgICAgICAgCisgICAgICAgICAgCisgICAgICAgIC8vLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tCisgICAgICAgIC8vIFNldHVwIGFuZCBVcGRhdGUgTWFpbiAoRm9jdXMpIFkgQXhlcworICAgICAgICAKKyAgICAgICAgZy5zZWxlY3QoJy5udi1mb2N1cyAubnYteC5udi1heGlzJykKKyAgICAgICAgICAuYXR0cigndHJhbnNmb3JtJywgJ3RyYW5zbGF0ZSgwLCcgKyB5MS5yYW5nZSgpWzBdICsgJyknKTsKKworCisgICAgICAgIHkxQXhpcworICAgICAgICAuc2NhbGUoeTEpCisgICAgICAgIC50aWNrcyggYXZhaWxhYmxlSGVpZ2h0MSAvIDM2ICkKKyAgICAgICAgLnRpY2tTaXplKC1hdmFpbGFibGVXaWR0aCwgMCk7CisKKyAgICAgICAgZy5zZWxlY3QoJy5udi1mb2N1cyAubnYteTEubnYtYXhpcycpCisgICAgICAgICAgLnN0eWxlKCdvcGFjaXR5JywgZGF0YUJhcnMubGVuZ3RoID8gMSA6IDApOworCisKKyAgICAgICAgeTJBeGlzCisgICAgICAgIC5zY2FsZSh5MikKKyAgICAgICAgLnRpY2tzKCBhdmFpbGFibGVIZWlnaHQxIC8gMzYgKQorICAgICAgICAudGlja1NpemUoZGF0YUJhcnMubGVuZ3RoID8gMCA6IC1hdmFpbGFibGVXaWR0aCwgMCk7IC8vIFNob3cgdGhlIHkyIHJ1bGVzIG9ubHkgaWYgeTEgaGFzIG5vbmUKKworICAgICAgICBnLnNlbGVjdCgnLm52LWZvY3VzIC5udi15Mi5udi1heGlzJykKKyAgICAgICAgICAuc3R5bGUoJ29wYWNpdHknLCBkYXRhTGluZXMubGVuZ3RoID8gMSA6IDApCisgICAgICAgICAgLmF0dHIoJ3RyYW5zZm9ybScsICd0cmFuc2xhdGUoJyArIHgucmFuZ2UoKVsxXSArICcsMCknKTsKKworICAgICAgICBkMy50cmFuc2l0aW9uKGcuc2VsZWN0KCcubnYtZm9jdXMgLm52LXkxLm52LWF4aXMnKSkKKyAgICAgICAgICAgIC5jYWxsKHkxQXhpcyk7CisgICAgICAgIGQzLnRyYW5zaXRpb24oZy5zZWxlY3QoJy5udi1mb2N1cyAubnYteTIubnYtYXhpcycpKQorICAgICAgICAgICAgLmNhbGwoeTJBeGlzKTsKKyAgICAgIH0KKworICAgICAgLy89PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKworICAgICAgb25CcnVzaCgpOworCisgICAgfSk7CisKKyAgICByZXR1cm4gY2hhcnQ7CisgIH0KKworCisgIC8vPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisgIC8vIEV2ZW50IEhhbmRsaW5nL0Rpc3BhdGNoaW5nIChvdXQgb2YgY2hhcnQncyBzY29wZSkKKyAgLy8tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0KKworICBsaW5lcy5kaXNwYXRjaC5vbignZWxlbWVudE1vdXNlb3Zlci50b29sdGlwJywgZnVuY3Rpb24oZSkgeworICAgIGUucG9zID0gW2UucG9zWzBdICsgIG1hcmdpbi5sZWZ0LCBlLnBvc1sxXSArIG1hcmdpbi50b3BdOworICAgIGRpc3BhdGNoLnRvb2x0aXBTaG93KGUpOworICB9KTsKKworICBsaW5lcy5kaXNwYXRjaC5vbignZWxlbWVudE1vdXNlb3V0LnRvb2x0aXAnLCBmdW5jdGlvbihlKSB7CisgICAgZGlzcGF0Y2gudG9vbHRpcEhpZGUoZSk7CisgIH0pOworCisgIGJhcnMuZGlzcGF0Y2gub24oJ2VsZW1lbnRNb3VzZW92ZXIudG9vbHRpcCcsIGZ1bmN0aW9uKGUpIHsKKyAgICBlLnBvcyA9IFtlLnBvc1swXSArICBtYXJnaW4ubGVmdCwgZS5wb3NbMV0gKyBtYXJnaW4udG9wXTsKKyAgICBkaXNwYXRjaC50b29sdGlwU2hvdyhlKTsKKyAgfSk7CisKKyAgYmFycy5kaXNwYXRjaC5vbignZWxlbWVudE1vdXNlb3V0LnRvb2x0aXAnLCBmdW5jdGlvbihlKSB7CisgICAgZGlzcGF0Y2gudG9vbHRpcEhpZGUoZSk7CisgIH0pOworCisgIGRpc3BhdGNoLm9uKCd0b29sdGlwSGlkZScsIGZ1bmN0aW9uKCkgeworICAgIGlmICh0b29sdGlwcykgbnYudG9vbHRpcC5jbGVhbnVwKCk7CisgIH0pOworCisgIC8vPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisKKworICAvLz09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorICAvLyBFeHBvc2UgUHVibGljIFZhcmlhYmxlcworICAvLy0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLQorCisgIC8vIGV4cG9zZSBjaGFydCdzIHN1Yi1jb21wb25lbnRzCisgIGNoYXJ0LmRpc3BhdGNoID0gZGlzcGF0Y2g7CisgIGNoYXJ0LmxlZ2VuZCA9IGxlZ2VuZDsKKyAgY2hhcnQubGluZXMgPSBsaW5lczsKKyAgY2hhcnQubGluZXMyID0gbGluZXMyOworICBjaGFydC5iYXJzID0gYmFyczsKKyAgY2hhcnQuYmFyczIgPSBiYXJzMjsKKyAgY2hhcnQueEF4aXMgPSB4QXhpczsKKyAgY2hhcnQueDJBeGlzID0geDJBeGlzOworICBjaGFydC55MUF4aXMgPSB5MUF4aXM7CisgIGNoYXJ0LnkyQXhpcyA9IHkyQXhpczsKKyAgY2hhcnQueTNBeGlzID0geTNBeGlzOworICBjaGFydC55NEF4aXMgPSB5NEF4aXM7CisKKyAgZDMucmViaW5kKGNoYXJ0LCBsaW5lcywgJ2RlZmluZWQnLCAnc2l6ZScsICdjbGlwVm9yb25vaScsICdpbnRlcnBvbGF0ZScpOworICAvL1RPRE86IGNvbnNpZGVyIHJlYmluZGluZyB4LCB5IGFuZCBzb21lIG90aGVyIHN0dWZmLCBhbmQgc2ltcGx5IGRvIHNvZW10aGlnbiBsaWxlIGJhcnMueChsaW5lcy54KCkpLCBldGMuCisgIC8vZDMucmViaW5kKGNoYXJ0LCBsaW5lcywgJ3gnLCAneScsICdzaXplJywgJ3hEb21haW4nLCAneURvbWFpbicsICdmb3JjZVgnLCAnZm9yY2VZJywgJ2ludGVyYWN0aXZlJywgJ2NsaXBFZGdlJywgJ2NsaXBWb3Jvbm9pJywgJ2lkJyk7CisKKyAgY2hhcnQueCA9IGZ1bmN0aW9uKF8pIHsKKyAgICBpZiAoIWFyZ3VtZW50cy5sZW5ndGgpIHJldHVybiBnZXRYOworICAgIGdldFggPSBfOworICAgIGxpbmVzLngoXyk7CisgICAgYmFycy54KF8pOworICAgIHJldHVybiBjaGFydDsKKyAgfTsKKworICBjaGFydC55ID0gZnVuY3Rpb24oXykgeworICAgIGlmICghYXJndW1lbnRzLmxlbmd0aCkgcmV0dXJuIGdldFk7CisgICAgZ2V0WSA9IF87CisgICAgbGluZXMueShfKTsKKyAgICBiYXJzLnkoXyk7CisgICAgcmV0dXJuIGNoYXJ0OworIC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0xlZ2VuZCA9IGZ1bmN0aW9uKF8pIHsKKyAgICBpZiAoIWFyZ3VtZW50cy5sZW5ndGgpIHJldHVybiBzaG93TGVnZW5kOworICAgIHNob3dMZWdlbmQgPSBfOworICAgIHJldHVybiBjaGFydDsKKyAgfTsKKworICBjaGFydC50b29sdGlwcyA9IGZ1bmN0aW9uKF8pIHsKKyAgICBpZiAoIWFyZ3VtZW50cy5sZW5ndGgpIHJldHVybiB0b29sdGlwczsKKyAgICB0b29sdGlwcyA9IF87CisgICAgcmV0dXJuIGNoYXJ0OworICB9OworCisgIGNoYXJ0LnRvb2x0aXBDb250ZW50ID0gZnVuY3Rpb24oXykgeworICAgIGlmICghYXJndW1lbnRzLmxlbmd0aCkgcmV0dXJuIHRvb2x0aXA7CisgICAgdG9vbHRpcCA9IF87CisgICAgcmV0dXJuIGNoYXJ0OworICB9OworCisgIGNoYXJ0Lm5vRGF0YSA9IGZ1bmN0aW9uKF8pIHsKKyAgICBpZiAoIWFyZ3VtZW50cy5sZW5ndGgpIHJldHVybiBub0RhdGE7CisgICAgbm9EYXRhID0gXzsKKyAgICByZXR1cm4gY2hhcnQ7CisgIH07CisKKyAgY2hhcnQuYnJ1c2hFeHRlbnQgPSBmdW5jdGlvbihfKSB7CisgICAgaWYgKCFhcmd1bWVudHMubGVuZ3RoKSByZXR1cm4gYnJ1c2hFeHRlbnQ7CisgICAgYnJ1c2hFeHRlbnQgPSBfOworICAgIHJldHVybiBjaGFydDsKKyAgfTsKKworCisgIC8vPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisKKworICByZXR1cm4gY2hhcnQ7Cit9CisKK252Lm1vZGVscy5tdWx0aUJhciA9IGZ1bmN0aW9uKCkgeworCisgIC8vPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisgIC8vIFB1YmxpYyBWYXJpYWJsZXMgd2l0aCBEZWZhdWx0IF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BiYXJDb2xvciB0byBjb21tdW5pY2F0ZSBmcm9tIG11bHRpQmFySG9yaXpvbnRhbENoYXJ0IHdoYXQgc2VyaWVzIGFyZSBkaXNhYmxlZAorICAgICwgZGVsYXkgPSAxMjAwCisgICAgLCBkcmF3VGltZSA9IDUwMAorICAgICwgeERvbWFpbgorICAgICwgeURvbWFpbgorICAgICwgZGlzcGF0Y2ggPSBkMy5kaXNwYXRjaCgnY2hhcnRDbGljaycsICdlbGVtZW50Q2xpY2snLCAnZWxlbWVudERibENsaWNrJywgJ2VsZW1lbnRNb3VzZW92ZXInLCAnZWxlbWVudE1vdXNlb3V0JykKKyAgICA7CisKKyAgLy89PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKworCisgIC8vPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisgIC8vIFByaXZhdGUgVmFyaWFibGVzCisgIC8vLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tCisKKyAgdmFyIHgwLCB5MCAvL3VzZWQgdG8gc3RvcmUgcHJldmlvdXMgc2NhbGVzCisgICAgICA7CisKKyAgLy89PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKworCisgIGZ1bmN0aW9uIGNoYXJ0KHNlbGVjdGlvbikgeworICAgIHNlbGVjdGlvbi5lYWNoKGZ1bmN0aW9uKGRhdGEpIHsKKyAgICAgIHZhciBhdmFpbGFibGVXaWR0aCA9IHdpZHRoIC0gbWFyZ2luLmxlZnQgLSBtYXJnaW4ucmlnaHQsCisgICAgICAgICAgYXZhaWxhYmxlSGVpZ2h0ID0gaGVpZ2h0IC0gbWFyZ2luLnRvcCAtIG1hcmdpbi5ib3R0b20sCisgICAgICAgICAgY29udGFpbmVyID0gZDMuc2VsZWN0KHRoaXMpOworCisgICAgICBpZihoaWRlYWJsZSAmJiBkYXRhLmxlbmd0aCkgaGlkZWFibGUgPSBbeworICAgICAgICB2YWx1ZXM6IGRhdGFbMF0udmFsdWVzLm1hcChmdW5jdGlvbihkKSB7CisgICAgICAgIHJldHVybiB7CisgICAgICAgICAgeDogZC54LAorICAgICAgICAgIHk6IDAsCisgICAgICAgICAgc2VyaWVzOiBkLnNlcmllcywKKyAgICAgICAgICBzaXplOiAwLjAxCisgICAgICAgIH07fQorICAgICAgKX1dOworCisgICAgICBpZiAoc3RhY2tlZCkKKyAgICAgICAgZGF0YSA9IGQzLmxheW91dC5zdGFjaygpCisgICAgICAgICAgICAgICAgIC5vZmZzZXQoJ3plcm8nKQorICAgICAgICAgICAgICAgICAudmFsdWVzKGZ1bmN0aW9uKGQpeyByZXR1cm4gZC52YWx1ZXMgfSkKKyAgICAgICAgICAgICAgICAgLnkoZ2V0WSkKKyAgICAgICAgICAgICAgICAgKCFkYXRhLmxlbmd0aCAmJiBoaWRlYWJsZSA/IGhpZGVhYmxlIDogZGF0YSk7CisKKworICAgICAgLy9hZGQgc2VyaWVzIGluZGV4IHRvIGVhY2ggZGF0YSBwb2ludCBmb3IgcmVmZXJlbmNlCisgICAgICBkYXRhID0gZGF0YS5tYXAoZnVuY3Rpb24oc2VyaWVzLCBpKSB7CisgICAgICAgIHNlcmllcy52YWx1ZXMgPSBzZXJpZXMudmFsdWVzLm1hcChmdW5jdGlvbihwb2ludCkgeworICAgICAgICAgIHBvaW50LnNlcmllcyA9IGk7CisgICAgICAgICAgcmV0dXJuIHBvaW50OworICAgICAgICB9KTsKKyAgICAgICAgcmV0dXJuIHNlcmllczsKKyAgICAgIH0pOworCisKKyAgICAgIC8vLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tCisgICAgICAvLyBIQUNLIGZvciBuZWdhdGl2ZSB2YWx1ZSBzdGFja2luZworICAgICAgaWYgKHN0YWNrZWQpCisgICAgICAgIGRhdGFbMF0udmFsdWVzLm1hcChmdW5jdGlvbihkLGkpIHsKKyAgICAgICAgICB2YXIgcG9zQmFzZSA9IDAsIG5lZ0Jhc2UgPSAwOworICAgICAgICAgIGRhdGEubWFwKGZ1bmN0aW9uKGQpIHsKKyAgICAgICAgICAgIHZhciBmID0gZC52YWx1ZXNbaV0KKyAgICAgICAgICAgIGYuc2l6ZSA9IE1hdGguYWJzKGYueSk7CisgICAgICAgICAgICBpZiAoZi55PDApICB7CisgICAgICAgICAgICAgIGYueTEgPSBuZWdCYXNlOworICAgICAgICAgICAgICBuZWdCYXNlID0gbmVnQmFzZSAtIGYuc2l6ZTsKKyAgICAgICAgICAgIH0gZWxzZQorICAgICAgICAgICAgeyAKKyAgICAgICAgICAgICAgZi55MSA9IGYuc2l6ZSArIHBvc0Jhc2U7CisgICAgICAgICAgICAgIHBvc0Jhc2UgPSBwb3NCYXNlICsgZi5zaXplOworICAgICAgICAgICAgfQorICAgICAgICAgIH0pOworICAgICAgICB9KTsKKworICAgICAgLy8tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0KKyAgICAgIC8vIFNldHVwIFNjYWxlcworCisgICAgICAvLyByZW1hcCBhbmQgZmxhdHRlbiB0aGUgZGF0YSBmb3IgdXNlIGluIGNhbGN1bGF0aW5nIHRoZSBzY2FsZXMnIGRvbWFpbnMKKyAgICAgIHZhciBzZXJpZXNEYXRhID0gKHhEb21haW4gJiYgeURvbWFpbikgPyBbXSA6IC8vIGlmIHdlIGtub3cgeERvbWFpbiBhbmQgeURvbWFpbiwgbm8gbmVlZCB0byBjYWxjdWxhdGUKKyAgICAgICAgICAgIGRhdGEubWFwKGZ1bmN0aW9uKGQpIHsKKyAgICAgICAgICAgICAgcmV0dXJuIGQudmFsdWVzLm1hcChmdW5jdGlvbihkLGkpIHsKKyAgICAg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bMF0gPworICAgICAgICAgICAgeC5kb21haW4oW3guZG9tYWluKClbMF0gLSB4LmRvbWFpbigpWzBdICogMC4wMSwgeC5kb21haW4oKVsxXSArIHguZG9tYWluKClbMV0gKiAwLjAxXSkKKyAgICAgICAgICA6IHguZG9tYWluKFstMSwxXSk7CisKKyAgICAgIGlmICh5LmRvbWFpbigpWzBdID09PSB5LmRvbWFpbigpWzFdKQorICAgICAgICB5LmRvbWFpbigpWzBdID8KKyAgICAgICAgICAgIHkuZG9tYWluKFt5LmRvbWFpbigpWzBdICsgeS5kb21haW4oKVswXSAqIDAuMDEsIHkuZG9tYWluKClbMV0gLSB5LmRvbWFpbigpWzFdICogMC4wMV0pCisgICAgICAgICAgOiB5LmRvbWFpbihbLTEsMV0pOworCisKKyAgICAgIHgwID0geDAgfHwgeDsKKyAgICAgIHkwID0geTAgfHwgeTsKKworICAgICAgLy8tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0KKworCisgICAgICAvLy0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLQorICAgICAgLy8gU2V0dXAgY29udGFpbmVycyBhbmQgc2tlbGV0b24gb2YgY2hhcnQKKworICAgICAgdmFyIHdyYXAgPSBjb250YWluZXIuc2VsZWN0QWxsKCdnLm52LXdyYXAubnYtbXVsdGliYXInKS5kYXRhKFtkYXRhXSk7CisgICAgICB2YXIgd3JhcEVudGVyID0gd3JhcC5lbnRlcigpLmFwcGVuZCgnZycpLmF0dHIoJ2NsYXNzJywgJ252ZDMgbnYtd3JhcCBudi1tdWx0aWJhcicpOworICAgICAgdmFyIGRlZnNFbnRlciA9IHdyYXBFbnRlci5hcHBlbmQoJ2RlZnMnKTsKKyAgICAgIHZhciBnRW50ZXIgPSB3cmFwRW50ZXIuYXBwZW5kKCdnJyk7CisgICAgICB2YXIg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mFsdWU6IGdldFkoZCxpKSwKKyAgICAgICAgICAgICAgcG9pbnQ6IGQsCisgICAgICAgICAgICAgIHNlcmllczogZGF0YVtkLnNlcmllc10sCisgICAgICAgICAgICAgIHBvczogW3goZ2V0WChkLGkpKSArICh4LnJhbmdlQmFuZCgpICogKHN0YWNrZWQgPyBkYXRhLmxlbmd0aCAvIDIgOiBkLnNlcmllcyArIC41KSAvIGRhdGEubGVuZ3RoKSwgeShnZXRZKGQsaSkgKyAoc3RhY2tlZCA/IGQueTAgOiAwKSldLCAgLy8gVE9ETzogRmlndXJlIG91dCB3aHkgdGhlIHZhbHVlIGFwcGVhcnMgdG8gYmUgc2hpZnRlZAorICAgICAgICAgICAgICBwb2ludEluZGV4OiBpLAorICAgICAgICAgICAgICBzZXJpZXNJbmRleDogZC5zZXJpZXMsCisgICAgICAgICAgICAgIGU6IGQzLmV2ZW50CisgICAgICAgICAgICB9KTsKKyAgICAgICAgICB9KQorICAgICAgICAgIC5vbignbW91c2VvdXQnLCBmdW5jdGlvbihkLGkpIHsKKyAgICAgICAgICAgIGQzLnNlbGVjdCh0aGlzKS5jbGFzc2VkKCdob3ZlcicsIGZhbHNlKTsKKyAgICAgICAgICAgIGRpc3BhdGNoLmVsZW1lbnRNb3VzZW91dCh7CisgICAgICAgICAgICAgIHZhbHVlOiBnZXRZKGQsaSksCisgICAgICAgICAgICAgIHBvaW50OiBkLAorICAgICAgICAgICAgICBzZXJpZXM6IGRhdGFbZC5zZXJpZXNdLAorICAgICAgICAgICAgICBwb2ludEluZGV4OiBpLAorICAgICAgICAgICAgICBzZXJpZXNJbmRleDogZC5zZXJpZXMsCisgICAgICAgICAgICAgIGU6IGQzLmV2ZW50CisgICAgICAgICAgICB9KTsKKyAgICAgICAgICB9KQorICAgICAgICAgIC5vbignY2xpY2snLCBmdW5jdGlvbihkLGkpIHsKKyAgICAgICAgICAgIGRpc3BhdGNoLmVsZW1lbnRDbGljayh7CisgICAgICAgICAgICAgIHZhbHVlOiBnZXRZKGQsaSksCisgICAgICAgICAgICAgIHBvaW50OiBkLAorICAgICAgICAgICAgICBzZXJpZXM6IGRhdGFbZC5zZXJpZXNdLAorICAgICAgICAgICAgICBwb3M6IFt4KGdldFgoZCxpKSkgKyAoeC5yYW5nZUJhbmQoKSAqIChzdGFja2VkID8gZGF0YS5sZW5ndGggLyAyIDogZC5zZXJpZXMgKyAuNSkgLyBkYXRhLmxlbmd0aCksIHkoZ2V0WShkLGkpICsgKHN0YWNrZWQgPyBkLnkwIDogMCkpXSwgIC8vIFRPRE86IEZpZ3VyZSBvdXQgd2h5IHRoZSB2YWx1ZSBhcHBlYXJzIHRvIGJlIHNoaWZ0ZWQKKyAgICAgICAgICAgICAgcG9pbnRJbmRleDogaSwKKyAgICAgICAgICAgICAgc2VyaWVzSW5kZXg6IGQuc2VyaWVzLAorICAgICAgICAgICAgICBlOiBkMy5ldmVudAorICAgICAgICAgICAgfSk7CisgICAgICAgICAgICBkMy5ldmVudC5zdG9wUHJvcGFnYXRpb24oKTsKKyAgICAgICAgICB9KQorICAgICAgICAgIC5vbignZGJsY2xpY2snLCBmdW5jdGlvbihkLGkpIHsKKyAgICAgICAgICAgIGRpc3BhdGNoLmVsZW1lbnREYmxDbGljayh7CisgICAgICAgICAgICAgIHZhbHVlOiBnZXRZKGQsaSksCisgICAgICAgICAgICAgIHBvaW50OiBkLAorICAgICAgICAgICAgICBzZXJpZXM6IGRhdGFbZC5zZXJpZXNdLAorICAgICAgICAgICAgICBwb3M6IFt4KGdldFgoZCxpKSkgKyAoeC5yYW5nZUJhbmQoKSAqIChzdGFja2VkID8gZGF0YS5sZW5ndGggLyAyIDogZC5zZXJpZXMgKyAuNSkgLyBkYXRhLmxlbmd0aCksIHkoZ2V0WShkLGkpICsgKHN0YWNrZWQgPyBkLnkwIDogMCkpXSwgIC8vIFRPRE86IEZpZ3VyZSBvdXQgd2h5IHRoZSB2YWx1ZSBhcHBlYXJzIHRvIGJlIHNoaWZ0ZWQKKyAgICAgICAgICAgICAgcG9pbnRJbmRleDogaSwKKyAgICAgICAgICAgICAgc2VyaWVzSW5kZXg6IGQuc2VyaWVzLAorICAgICAgICAgICAgICBlOiBkMy5ldmVudAorICAgICAgICAgICAgfSk7CisgICAgICAgICAgICBkMy5ldmVudC5zdG9wUHJvcGFnYXRpb24oKTsKKyAgICAgICAgICB9KTsKKyAgICAgIGJhcnMKKyAgICAgICAgICAuYXR0cignY2xhc3MnLCBmdW5jdGlvbihkLGkpIHsgcmV0dXJuIGdldFkoZCxpKSA8IDAgPyAnbnYtYmFyIG5lZ2F0aXZlJyA6ICdudi1iYXIgcG9zaXRpdmUnfSkKKyAgICAgICAgICAuYXR0cigndHJhbnNmb3JtJywgZnVuY3Rpb24oZCxpKSB7IHJldHVybiAndHJhbnNsYXRlKCcgKyB4KGdldFgoZCxpKSkgKyAnLDApJzsgfSkKKworICAgICAgaWYgKGJhckNvbG9yKSB7CisgICAgICAgIGlmICghZGlzYWJsZWQpIGRpc2FibGVkID0gZGF0YS5tYXAoZnVuY3Rpb24oKSB7IHJldHVybiB0cnVlIH0pOworICAgICAgICBiYXJzCisgICAgICAgICAgLy8uc3R5bGUoJ2ZpbGwnLCBiYXJDb2xvcikKKyAgICAgICAgICAvLy5zdHlsZSgnc3Ryb2tlJywgYmFyQ29sb3IpCisgICAgICAgICAgLy8uc3R5bGUoJ2ZpbGwnLCBmdW5jdGlvbihkLGksaikgeyByZXR1cm4gZDMucmdiKGJhckNvbG9yKGQsaSkpLmRhcmtlcihqKS50b1N0cmluZygpOyB9KQorICAgICAgICAgIC8vLnN0eWxlKCdzdHJva2UnLCBmdW5jdGlvbihkLGksaikgeyByZXR1cm4gZDMucmdiKGJhckNvbG9yKGQsaSkpLmRhcmtlcihqKS50b1N0cmluZygpOyB9KQorICAgICAgICAgIC5zdHlsZSgnZmlsbCcsIGZ1bmN0aW9uKGQsaSxqKSB7IHJldHVybiBkMy5yZ2IoYmFyQ29sb3IoZCxpKSkuZGFya2VyKCAgZGlzYWJ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bihkcmF3VGltZSkKKyAgICAgICAgICAgICAgICAuYXR0cigneCcsIGZ1bmN0aW9uKGQsaSkgeworICAgICAgICAgICAgICAgICAgcmV0dXJuIHN0YWNrZWQgPyAwIDogKGQuc2VyaWVzICogeC5yYW5nZUJhbmQoKSAvIGRhdGEubGVuZ3RoICkKKyAgICAgICAgICAgICAgICB9KQorICAgICAgICAgICAgICAgIC5hdHRyKCd3aWR0aCcsIHgucmFuZ2VCYW5kKCkgLyAoc3RhY2tlZCA/IDEgOiBkYXRhLmxlbmd0aCkgKTsKKyAgICAgICAgICAgIH0pCisgICAgICBlbHNlCisgICAgICAgIGQzLnRyYW5zaXRpb24oYmFycykuZHVyYXRpb24oZHJhd1RpbWUpCisgICAgICAgICAgLmRlbGF5KGZ1bmN0aW9uKGQsaSkgeyByZXR1cm4gaSAqIGRlbGF5LyBkYXRhWzBdLnZhbHVlcy5sZW5ndGggfSkKKyAgICAgICAgICAgIC5hdHRyKCd4JywgZnVuY3Rpb24oZCxpKSB7CisgICAgICAgICAgICAgIHJldHVybiBkLnNlcmllcyAqIHgucmFuZ2VCYW5kKCkgLyBkYXRhLmxlbmd0aAorICAgICAgICAgICAgfSkKKyAgICAgICAgICAgIC5hdHRyKCd3aWR0aCcsIHgucmFuZ2VCYW5kKCkgLyBkYXRhLmxlbmd0aCkKKyAgICAgICAgICAgIC5lYWNoKCdlbmQnLCBmdW5jdGlvbigpIHsKKyAgICAgICAgICAgICAgZDMuc2VsZWN0KHRoaXMpLnRyYW5zaXRpb24oKS5kdXJhdGlvbihkcmF3VGltZSkKKyAgICAgICAgICAgICAgICAuYXR0cigneScsIGZ1bmN0aW9uKGQsaSkgeworICAgICAgICAgICAgICAgICAgcmV0dXJuIGdldFkoZCxpKSA8IDAgPworICAgICAgICAgICAgICAgICAgICAgICAgICB5KDApIDoKKyAgICAgICAgICAgICAgICAgICAgICAgICAgeSgwKSAtIHkoZ2V0WShkLGkpKSA8IDEgPworICAgICAgICAgICAgICAgICAgICAgICAgICAgIHkoMCkgLSAxIDoKKyAgICAgICAgICAgICAgICAgICAgICAgICAgeShnZXRZKGQsaSkpIHx8IDA7CisgICAgICAgICAgICAgIH0pCisgICAgICAgICAgICAgIC5hdHRyKCdoZWlnaHQnLCBmdW5jdGlvbihkLGkpIHsKKwkJCSAgICAgIGlmKGQueSA9PSBudWxsKSByZXR1cm4gMDsKKyAgICAgICAgICAgICAgICAgIHJldHVybiBNYXRoLm1heChNYXRoLmFicyh5KGdldFkoZCxpKSkgLSB5KDApKSwxKSB8fCAwOworICAgICAgICAgICAgICAgIH0pOworICAgICAgICAgICAgfSkKKworCisgICAgICAvL3N0b3JlIG9sZCBzY2FsZXMgZm9yIHVzZSBpbiB0cmFuc2l0aW9ucyBvbiB1cGRhdGUKKyAgICAgIHgwID0geC5jb3B5KCk7CisgICAgICB5MCA9IHkuY29weSgpOworCisgICAgfSk7CisKKyAgICByZXR1cm4gY2hhcnQ7CisgIH0KKworCisgIC8vPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisgIC8vIEV4cG9zZSBQdWJsaWMgVmFyaWFibGVzCisgIC8vLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tCisKKyAgY2hhcnQuZGlzcGF0Y2ggPSBkaXNwYXRjaDsKKworICBjaGFydC54ID0gZnVuY3Rpb24oXykgeworICAgIGlmICghYXJndW1lbnRzLmxlbmd0aCkgcmV0dXJuIGdldFg7CisgICAgZ2V0WCA9IF87CisgICAgcmV0dXJuIGNoYXJ0OworICB9OworCisgIGNoYXJ0LnkgPSBmdW5jdGlvbihfKSB7CisgICAgaWYgKCFhcmd1bWVudHMubGVuZ3RoKSByZXR1cm4gZ2V0WTsKKyAgICBnZXRZID0gXzsKKyAgICByZXR1cm4gY2hhcnQ7CisgIH07CisKKyAgY2hhcnQubWFyZ2luID0gZnVuY3Rpb24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KyAgfTsKKworICBjaGFydC54RG9tYWluID0gZnVuY3Rpb24oXykgeworICAgIGlmICghYXJndW1lbnRzLmxlbmd0aCkgcmV0dXJuIHhEb21haW47CisgICAgeERvbWFpbiA9IF87CisgICAgcmV0dXJuIGNoYXJ0OworICB9OworCisgIGNoYXJ0LnlEb21haW4gPSBmdW5jdGlvbihfKSB7CisgICAgaWYgKCFhcmd1bWVudHMubGVuZ3RoKSByZXR1cm4geURvbWFpbjsKKyAgICB5RG9tYWluID0gXzsKKyAgICByZXR1cm4gY2hhcnQ7CisgIH07CisKKyAgY2hhcnQuZm9yY2VZID0gZnVuY3Rpb24oXykgeworICAgIGlmICghYXJndW1lbnRzLmxlbmd0aCkgcmV0dXJuIGZvcmNlWTsKKyAgICBmb3JjZVkgPSBfOworICAgIHJldHVybiBjaGFydDsKKyAgfTsKKworICBjaGFydC5zdGFja2VkID0gZnVuY3Rpb24oXykgeworICAgIGlmICghYXJndW1lbnRzLmxlbmd0aCkgcmV0dXJuIHN0YWNrZWQ7CisgICAgc3RhY2tlZCA9IF87CisgICAgcmV0dXJuIGNoYXJ0OworICB9OworCisgIGNoYXJ0LmNsaXBFZGdlID0gZnVuY3Rpb24oXykgeworICAgIGlmICghYXJndW1lbnRzLmxlbmd0aCkgcmV0dXJuIGNsaXBFZGdlOworICAgIGNsaXBFZGdlID0gXzsKKyAgICByZXR1cm4gY2hhcnQ7CisgIH07CisKKyAgY2hhcnQuY29sb3IgPSBmdW5jdGlvbihfKSB7CisgICAgaWYgKCFhcmd1bWVudHMubGVuZ3RoKSByZXR1cm4gY29sb3I7CisgICAgY29sb3IgPSBudi51dGlscy5nZXRDb2xvcihfKTsKKyAgICByZXR1cm4gY2hhcnQ7CisgIH07CisKKyAgY2hhcnQuYmFyQ29sb3IgPSBmdW5jdGlvbihfKSB7CisgICAgaWYgKCFhcmd1bWVudHMubGVuZ3RoKSByZXR1cm4gYmFyQ29sb3I7CisgICAgYmFyQ29sb3IgPSBudi51dGlscy5nZXRDb2xvcihfKTsKKyAgICByZXR1cm4gY2hhcnQ7CisgIH07CisKKyAgY2hhcnQuZGlzYWJsZWQgPSBmdW5jdGlvbihfKSB7CisgICAgaWYgKCFhcmd1bWVudHMubGVuZ3RoKSByZXR1cm4gZGlzYWJsZWQ7CisgICAgZGlzYWJsZWQgPSBfOworICAgIHJldHVybiBjaGFydDsKKyAgfTsKKworICBjaGFydC5pZCA9IGZ1bmN0aW9uKF8pIHsKKyAgICBpZiAoIWFyZ3VtZW50cy5sZW5ndGgpIHJldHVybiBpZDsKKyAgICBpZCA9IF87CisgICAgcmV0dXJuIGNoYXJ0OworICB9OworCisgIGNoYXJ0LmhpZGVhYmxlID0gZnVuY3Rpb24oXykgeworICAgIGlmICghYXJndW1lbnRzLmxlbmd0aCkgcmV0dXJuIGhpZGVhYmxlOworICAgIGhpZGVhYmxlID0gXzsKKyAgICByZXR1cm4gY2hhcnQ7CisgIH07CisKKyAgY2hhcnQuZGVsYXkgPSBmdW5jdGlvbihfKSB7CisgICAgaWYgKCFhcmd1bWVudHMubGVuZ3RoKSByZXR1cm4gZGVsYXk7CisgICAgZGVsYXkgPSBfOworICAgIHJldHVybiBjaGFydDsKKyAgfTsKKworICBjaGFydC5kcmF3VGltZSA9IGZ1bmN0aW9uKF8pIHsKKyAgICBpZiAoIWFyZ3VtZW50cy5sZW5ndGgpIHJldHVybiBkcmF3VGltZTsKKyAgICBkcmF3VGltZSA9IF87CisgICAgcmV0dXJuIGNoYXJ0OworICB9OworCisgIC8vPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisKKworICByZXR1cm4gY2hhcnQ7Cit9CisKK252Lm1vZGVscy5tdWx0aUJhckNoYXJ0ID0gZnVuY3Rpb24oKSB7CisKKyAgLy89PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKyAgLy8gUHVibGljIFZhcmlhYmxlcyB3aXRoIERl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ICAgICAgICAgICAgICAnPHA+JyArICBmbXQoTWF0aC5wb3coMTAseSkpICsgJyBvbiAnICsgeCArICc8L3A+JworCSAgICB9IGVsc2UgeworICAgICAgICByZXR1cm4gJzxoMz4nICsga2V5ICsgJzwvaDM+JyArCisgICAgICAgICAgICAgICAnPHA+JyArICB5ICsgJyBvbiAnICsgeCArICc8L3A+JworICAgICAgfQorCisgICAgICB9CisgICAgLCB4IC8vY2FuIGJlIGFjY2Vzc2VkIHZpYSBjaGFydC54U2NhbGUoKQorICAgICwgeSAvL2NhbiBiZSBhY2Nlc3NlZCB2aWEgY2hhcnQueVNjYWxlKCkKKyAgICAsIHN0YXRlID0geyBzdGFja2VkOiBmYWxzZSB9CisgICAgLCBkZWZhdWx0U3RhdGUgPSBudWxsCisgICAgLCBub0RhdGEgPSAiTm8gRGF0YSBBdmFpbGFibGUuIgorICAgICwgZGlzcGF0Y2ggPSBkMy5kaXNwYXRjaCgndG9vbHRpcFNob3cnLCAndG9vbHRpcEhpZGUnLCAnc3RhdGVDaGFuZ2UnLCAnY2hhbmdlU3RhdGUnKQorICAgICwgY29udHJvbFdpZHRoID0gZnVuY3Rpb24oKSB7IHJldHVybiBzaG93Q29udHJvbHMgPyAxODAgOiAwIH0KKyAgICA7CisgIG11bHRpYmFyCisgICAgLnN0YWNrZWQoZmFsc2UpCisgICAgOworICB4QXhpcworICAgIC5vcmllbnQoJ2JvdHRvbScpCisgICAgLnRpY2tQYWRkaW5nKDcpCisgICAgLmhpZ2hsaWdodFplcm8odHJ1ZSkKKyAgICAuc2hvd01heE1pbihmYWxzZSkKKyAgICAudGlja0Zvcm1hdChmdW5jdGlvbihkKSB7IHJldHVybiBkIH0pCisgICAgOworICB5QXhpcworICAgIC5vcmllbnQoJ2xlZnQnKQorICAgIC50aWNrRm9ybWF0KGQzLmZvcm1hdCgnLC4xZicpKQorICAgIDsKKworICAvLz09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorCisKKyAgLy89PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKyAgLy8gUHJpdmF0ZSBWYXJpYWJsZXMKKyAgLy8tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0KKworICB2YXIgc2hvd1Rvb2x0aXAgPSBmdW5jdGlvbihlLCBvZmZzZXRFbGVtZW50KSB7CisgICAgdmFyIGxlZnQgPSBlLnBvc1swXSArICggb2Zmc2V0RWxlbWVudC5vZmZzZXRMZWZ0IHx8IDAgKSwKKyAgICAgICAgdG9wID0gZS5wb3NbMV0gKyAoIG9mZnNldEVsZW1lbnQub2Zmc2V0VG9wIHx8IDApLAorICAgICAgICB4ID0geEF4aXMudGlja0Zvcm1hdCgpKG11bHRpYmFyLngoKShlLnBvaW50LCBlLnBvaW50SW5kZXgpKSwKKyAgICAgICAgeSA9IHlBeGlzLnRpY2tGb3JtYXQoKShtdWx0aWJhci55KCkoZS5wb2ludCwgZS5wb2ludEluZGV4KSksCisgICAgICAgIGNvbnRlbnQgPSB0b29sdGlwKGUuc2VyaWVzLmtleSwgeCwgeSwgZSwgY2hhcnQsIGxvZ1NjYWxlKTsKKworICAgIG52LnRvb2x0aXAuc2hvdyhbbGVmdCwgdG9wXSwgY29udGVudCwgZS52YWx1ZSA8IDAgPyAnbicgOiAncycsIG51bGwsIG9mZnNldEVsZW1lbnQpOworICB9OworCisgIC8vPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisKKworICBmdW5jdGlvbiBjaGFydChzZWxlY3Rpb24pIHsKKyAgICBzZWxlY3Rpb24uZWFjaChmdW5jdGlvbihkYXRhKSB7CisgICAgICB2YXIgY29udGFpbmVyID0gZDMuc2VsZWN0KHRoaXMpLAorICAgICAgICAgIHRoYXQgPSB0aGlzOworCisgICAgICB2YXIgYXZhaWxhYmxlV2lkdGggPSAod2lkdGggIHx8IHBhcnNlSW50KGNvbnRhaW5lci5zdHlsZSgnd2lkdGgnKSkgfHwgOTYwKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAtIG1hcmdpbi5sZWZ0IC0gbWFyZ2luLnJpZ2h0LAorICAgICAgICAgIGF2YWlsYWJsZUhlaWdodCA9IChoZWlnaHQgfHwgcGFyc2VJbnQoY29udGFpbmVyLnN0eWxlKCdoZWlnaHQnKSkgfHwgNDAwKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAtIG1hcmdpbi50b3AgLSBtYXJnaW4uYm90dG9tOworCisgICAgICBjaGFydC51cGRhdGUgPSBmdW5jdGlvbigpIHsgY29udGFpbmVyLnRyYW5zaXRpb24oKS5jYWxsKGNoYXJ0KSB9OworICAgICAgY2hhcnQuY29udGFpbmVyID0gdGhpczsKKworICAgICAgLy9zZXQgc3RhdGUuZGlzYWJsZWQKKyAgICAgIHN0YXRlLmRpc2FibGVkID0gZGF0YS5tYXAoZnVuY3Rpb24oZCkgeyByZXR1cm4gISFkLmRpc2FibGVkIH0pOworCisgICAgICBpZiAoIWRlZmF1bHRTdGF0ZSkgeworICAgICAgICB2YXIga2V5OworICAgICAgICBkZWZhdWx0U3RhdGUgPSB7fTsKKyAgICAgICAgZm9yIChrZXkgaW4gc3RhdGUpIHsKKyAgICAgICAgICBpZiAoc3RhdGVba2V5XSBpbnN0YW5jZW9mIEFycmF5KQorICAgICAgICAgICAgZGVmYXVsdFN0YXRlW2tleV0gPSBzdGF0ZVtrZXldLnNsaWNlKDApOworICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgIGRlZmF1bHRTdGF0ZVtrZXldID0gc3RhdGVba2V5XTsKKyAgICAgICAgfQorICAgICAgfQorICAgICAgLy8tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0KKyAgICAgIC8vIERpc3B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tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0KKworCisgICAgICAvLy0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLQorICAgICAgLy8gTGVnZW5kCisKKyAgICAgIGlmIChzaG93TGVnZW5kKSB7CisgICAgICAgIGxlZ2VuZC53aWR0aChhdmFpbGFibGVXaWR0aCAtIGNvbnRyb2xXaWR0aCgpKTsKKworICAgICAgICBpZiAobXVsdGliYXIuYmFyQ29sb3IoKSkKKyAgICAgICAgICBkYXRhLmZvckVhY2goZnVuY3Rpb24oc2VyaWVzLGkpIHsKKyAgICAgICAgICAgIHNlcmllcy5jb2xvciA9IGQzLnJnYignI2NjYycpLmRhcmtlcihpICogMS41KS50b1N0cmluZygpOworICAgICAgICAgIH0pCisKKyAgICAgICAgZy5zZWxlY3QoJy5udi1sZWdlbmRXcmFwJykKKyAgICAgICAgICAgIC5kYXR1bShkYXRhKQorICAgICAgICAgICAgLmNhbGwobGVnZW5kKTsKKworICAgICAgICBpZiAoIG1hcmdpbi50b3AgIT0gbGVnZW5kLmhlaWdodCgpKSB7CisgICAgICAgICAgbWFyZ2luLnRvcCA9IGxlZ2VuZC5oZWlnaHQoKTsKKyAgICAgICAgICBhdmFpbGFibGVIZWlnaHQgPSAoaGVpZ2h0IHx8IHBhcnNlSW50KGNvbnRhaW5lci5zdHlsZSgnaGVpZ2h0JykpIHx8IDQwMCkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLSBtYXJnaW4udG9wIC0gbWFyZ2luLmJvdHRvbTsKKyAgICAgICAgfQorCisgICAgICAgIGcuc2VsZWN0KCcubnYtbGVnZW5kV3JhcCcpCisgICAgICAgICAgICAuYXR0cigndHJhbnNmb3JtJywgJ3RyYW5zbGF0ZSgnICsgY29udHJvbFdpZHRoKCkgKyAnLCcgKyAoLW1hcmdpbi50b3ApICsnKScpOworICAgICAgfQorCisgICAgICAvLy0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dHIoJ3RyYW5zZm9ybScsICd0cmFuc2xhdGUoMCwnICsgeS5yYW5nZSgpWzBdICsgJyknKTsKKyAgICAgIGQzLnRyYW5zaXRpb24oZy5zZWxlY3QoJy5udi14Lm52LWF4aXMnKSkKKyAgICAgICAgICAuY2FsbCh4QXhpcyk7CisKKyAgICAgIHZhciB4VGlja3MgPSBnLnNlbGVjdCgnLm52LXgubnYtYXhpcyA+IGcnKS5zZWxlY3RBbGwoJ2cnKTsKKworICAgICAgeFRpY2tzCisgICAgICAgICAgLnNlbGVjdEFsbCgnbGluZSwgdGV4dCcpCisgICAgICAgICAgLnN0eWxlKCdvcGFjaXR5JywgMSkKKworICAgICAgaWYgKHN0YWdnZXJMYWJlbHMpIHsKKyAgICAgICAgICB2YXIgZ2V0VHJhbnNsYXRlID0gZnVuY3Rpb24oeCx5KSB7CisgICAgICAgICAgICAgIHJldHVybiAidHJhbnNsYXRlKCIgKyB4ICsgIiwiICsgeSArICIpIjsKKyAgICAgICAgICB9OworCisgICAgICAgICAgdmFyIHN0YWdnZXJVcCA9IDUsIHN0YWdnZXJEb3duID0gMTc7ICAvL3BpeGVscyB0byBzdGFnZ2VyIGJ5CisgICAgICAgICAgLy8gSXNzdWUgIzE0MAorICAgICAgICAgIHhUaWNrcworICAgICAgICAgICAgLnNlbGVjdEFsbCgidGV4dCIpCisgICAgICAgICAgICAuYXR0cigndHJhbnNmb3JtJywgZnVuY3Rpb24oZCxpLGopIHsgCisgICAgICAgICAgICAgICAgcmV0dXJuICBnZXRUcmFuc2xhdGUoMCwgKGogJSAyID09IDAgPyBzdGFnZ2VyVXAgOiBzdGFnZ2VyRG93bikpOworICAgICAgICAgICAgICB9KTsKKworICAgICAgICAgIHZhciB0b3RhbEluQmV0d2VlblRpY2tzID0gZDMuc2VsZWN0QWxsKCIubnYteC5udi1heGlzIC5udi13cmFwIGcgZyB0ZXh0IilbMF0ubGVuZ3RoOworICAgICAgICAgIGcuc2VsZWN0QWxsKCIubnYteC5udi1heGlzIC5udi1heGlzTWF4TWluIHRleHQiKQorICAgICAgICAgICAgLmF0dHIoInRyYW5zZm9ybSIsIGZ1bmN0aW9uKGQsaSkgeworICAgICAgICAgICAgICAgIHJldHVybiBnZXRUcmFuc2xhdGUoMCwgKGkgPT09IDAgfHwgdG90YWxJbkJldHdlZW5UaWNrcyAlIDIgIT09IDApID8gc3RhZ2dlckRvd24gOiBzdGFnZ2VyVXApOworICAgICAgICAgICAgfSk7CisgICAgICB9CisKKworICAgICAgaWYgKHJlZHVjZVhUaWNrcykKKyAgICAgICAgeFRpY2tzCisgICAgICAgICAgLmZpbHRlcihmdW5jdGlvbihkLGkpIHsKKyAgICAgICAgICAgICAgcmV0dXJuIGkgJSBNYXRoLmNlaWwoZGF0YVswXS52YWx1ZXMubGVuZ3RoIC8gKGF2YWlsYWJsZVdpZHRoIC8gMTAwKSkgIT09IDA7CisgICAgICAgICAgICB9KQorICAgICAgICAgIC5zZWxlY3RBbGwoJ3RleHQsIGxpbmUnKQorICAgICAgICAgIC5zdHlsZSgnb3BhY2l0eScsIDApOworCisgICAgICBpZihyb3RhdGVMYWJlbHMpCisgICAgICAgIHhUaWNrcworICAgICAgICAgIC5zZWxlY3RBbGwoJ3RleHQnKQorICAgICAgICAgIC5hdHRyKCd0cmFuc2Zvcm0nLCAncm90YXRlKCcgKyByb3RhdGVMYWJlbHMgKyAnIDAsMCknKQorICAgICAgICAgIC5hdHRyKCd0ZXh0LWFuY2hvcicsIHJvdGF0ZUxhYmVscyA+IDAgPyAnc3RhcnQnIDogJ2VuZCcpOworICAgICAgCisgICAgICBnLnNlbGVjdCgnLm52LXgubnYtYXhpcycpLnNlbGVjdEFsbCgnZy5udi1heGlzTWF4TWluIHRleHQnKQorICAgICAgICAgIC5zdHlsZSgnb3BhY2l0eScsIDEpOworCisgICAgICB5QXhpcworICAgICAgICAuc2NhbGUoeSkKKyAgICAgICAgLnRpY2tzKCBhdmFpbGFibGVIZWlnaHQgLyAzNiApCisgICAgICAgIC50aWNrU2l6ZSggLWF2YWlsYWJsZVdpZHRoLCAwKTsKKworICAgICAgZDMudHJhbnNpdGlvbihnLnNlbGVjdCgnLm52LXkubnYtYXhpcycpKQorICAgICAgICAgIC5jYWxsKHlBeGlzKTsKKworICAgICAgLy8tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0KKworCisKKyAgICAgIC8vPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisgICAgICAvLyBFdmVudCBIYW5kbGluZy9EaXNwYXRjaGluZyAoaW4gY2hhcnQncyBzY29wZSkKKyAgICAgIC8vLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tCisKKyAgICAgIGxlZ2VuZC5kaXNwYXRjaC5vbignbGVnZW5kQ2xpY2snLCBmdW5jdGlvbihkLGkpIHsKKyAgICAgICAgZC5kaXNhYmxlZCA9ICFkLmRpc2FibGVkOworCisgICAgICAgIGlmICghZGF0YS5maWx0ZXIoZnVuY3Rpb24oZCkgeyByZXR1cm4gIWQuZGlzYWJsZWQgfSkubGVuZ3RoKSB7CisgICAgICAgICAgZGF0YS5tYXAoZnVuY3Rpb24oZCkgeworICAgICAgICAgICAgZC5kaXNhYmxlZCA9IGZhbHNlOworICAgICAgICAgICAgd3JhcC5zZWxlY3RBbGwoJy5udi1zZXJpZXMnKS5jbGFzc2VkKCdkaXNhYmxlZCcsIGZhbHNlKTsKKyAgICAgICAgICAgIHJldHVybiBkOworICAgICAgICAgIH0pOworICAgICAgICB9CisKKyAgICAgICAgc3RhdGUuZGlzYWJsZWQgPSBkYXRhLm1hcChmdW5jdGlvbihkKSB7IHJldHVybiAhIWQuZGlzYWJsZWQgfSk7CisgICAgICAgIGRpc3BhdGNoLnN0YXRlQ2hhbmdlKHN0YXRlKTsKKworICAgICAgICBjaGFydC51cGRhdGUoKTsKKyAgICAgIH0pOworCisgICAgICBsZWdlbmQuZGlzcGF0Y2gub24oJ2xlZ2VuZERibGNsaWNrJywgZnVuY3Rpb24oZCkgeworICAgICAgICAgIC8vRG91YmxlIGNsaWNraW5nIHNob3VsZCBhbHdheXMgZW5hYmxlIGN1cnJlbnQgc2VyaWVzLCBhbmQgZGlzYWJsZWQgYWxsIG90aGVycy4KKyAgICAgICAgICBkYXRhLmZvckVhY2goZnVuY3Rpb24oZCkgeworICAgICAgICAgICAgIGQuZGlzYWJsZWQgPSB0cnVlOworICAgICAgICAgIH0pOworICAgICAgICAgIGQuZGlzYWJsZWQgPSBmYWxzZTsgIAorCisgICAgICAgICAgc3RhdGUuZGlzYWJsZWQgPSBkYXRhLm1hcChmdW5jdGlvbihkKSB7IHJldHVybiAhIWQuZGlzYWJsZWQgfSk7CisgICAgICAgICAgZGlzcGF0Y2guc3RhdGVDaGFuZ2Uoc3RhdGUpOworICAgICAgICAgIGNoYXJ0LnVwZGF0ZSgpOworICAgICAgfSk7CisKKworICAgICAgY29udHJvbHMuZGlzcGF0Y2gub24oJ2xlZ2VuZENsaWNrJywgZnVuY3Rpb24oZCxpKSB7CisgICAgICAgIGlmICghZC5kaXNhYmxlZCkgcmV0dXJuOworICAgICAgICBjb250cm9sc0RhdGEgPSBjb250cm9sc0RhdGEubWFwKGZ1bmN0aW9uKHMpIHsKKyAgICAgICAgICBzLmRpc2FibGVkID0gdHJ1ZTsKKyAgICAgICAgICByZXR1cm4gczsKKyAgICAgICAgfSk7CisgICAgICAgIGQuZGlzYWJsZWQgPSBmYWxzZTsKKworICAgICAgICBzd2l0Y2ggKGQua2V5KSB7CisgICAgICAgICAgY2FzZSAnR3JvdXBlZCc6CisgICAgICAgICAgICBtdWx0aWJhci5zdGFja2VkKGZhbHNlKTsKKyAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgIGNhc2UgJ1N0YWNrZWQnOgorICAgICAgICAgICAgbXVsdGliYXIuc3RhY2tlZCh0cnVlKTsKKyAgICAgICAgICAgIGJyZWFrOworICAgICAgICB9CisKKyAgICAgICAgc3RhdGUuc3RhY2tlZCA9IG11bHRpYmFyLnN0YWNrZWQoKTsKKyAgICAgICAgZGlzcGF0Y2guc3RhdGVDaGFuZ2Uoc3RhdGUpOworCisgICAgICAgIGNoYXJ0LnVwZGF0ZSgpOworICAgICAgfSk7CisKKyAgICAgIGRpc3BhdGNoLm9uKCd0b29sdGlwU2hvdycsIGZ1bmN0aW9uKGUpIHsKKyAgICAgICAgaWYgKHRvb2x0aXBzKSBzaG93VG9vbHRpcChlLCB0aGF0LnBhcmVudE5vZGUpCisgICAgICB9KTsKKworICAgICAgLy8gVXBkYXRlIGNoYXJ0IGZyb20gYSBzdGF0ZSBvYmplY3QgcGFzc2VkIHRvIGV2ZW50IGhhbmRsZXIKKyAgICAgIGRpc3BhdGNoLm9uKCdjaGFuZ2VTdGF0ZScsIGZ1bmN0aW9uKGUpIHsKKworICAgICAgICBpZiAodHlwZW9mIGUuZGlzYWJsZWQgIT09ICd1bmRlZmluZWQnKSB7CisgICAgICAgICAgZGF0YS5mb3JFYWNoKGZ1bmN0aW9uKHNlcmllcyxpKSB7CisgICAgICAgICAgICBzZXJpZXMuZGlzYWJsZWQgPSBlLmRpc2FibGVkW2ldOworICAgICAgICAgIH0pOworCisgICAgICAgICAgc3RhdGUuZGlzYWJsZWQgPSBlLmRpc2FibGVkOworICAgICAgICB9CisKKyAgICAgICAgaWYgKHR5cGVvZiBlLnN0YWNrZWQgIT09ICd1bmRlZmluZWQnKSB7CisgICAgICAgICAgbXVsdGliYXIuc3RhY2tlZChlLnN0YWNrZWQpOworICAgICAgICAgIHN0YXRlLnN0YWNrZWQgPSBlLnN0YWNrZWQ7CisgICAgICAgIH0KKworICAgICAgICBjaGFydC51cGRhdGUoKTsKKyAgICAgIH0pOworCisgICAgICAvLz09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorCisKKyAgICB9KTsKKworICAgIHJldHVybiBjaGFydDsKKyAgfQorCisKKyAgLy89PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKyAgLy8gRXZlbnQgSGFuZGxpbmcvRGlzcGF0Y2hpbmcgKG91dCBvZiBjaGFydCdzIHNjb3BlKQorICAvLy0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLQorCisgIG11bHRpYmFyLmRpc3BhdGNoLm9uKCdlbGVtZW50TW91c2VvdmVyLnRvb2x0aXAnLCBmdW5jdGlvbihlKSB7CisgICAgZS5wb3MgPSBbZS5wb3NbMF0gKyAgbWFyZ2luLmxlZnQsIGUucG9zWzFdICsgbWFyZ2luLnRvcF07CisgICAgZGlzcGF0Y2gudG9vbHRpcFNob3coZSk7CisgIH0pOworCisgIG11bHRpYmFyLmRpc3BhdGNoLm9uKCdlbGVtZW50TW91c2VvdXQudG9vbHRpcCcsIGZ1bmN0aW9uKGUpIHsKKyAgICBkaXNwYXRjaC50b29sdGlwSGlkZShlKTsKKyAgfSk7CisgIGRpc3BhdGNoLm9uKCd0b29sdGlwSGlkZScsIGZ1bmN0aW9uKCkgeworICAgIGlmICh0b29sdGlwcykgbnYudG9vbHRpcC5jbGVhbnVwKCk7CisgIH0pOworCisgIC8vPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisKKworICAvLz09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorICAvLyBFeHBvc2UgUHVibGljIFZhcmlhYmxlcworICAvLy0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLQorCisgIC8vIGV4cG9zZSBjaGFydCdzIHN1Yi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AgaWYgKCFhcmd1bWVudHMubGVuZ3RoKSByZXR1cm4gcm90YXRlTGFiZWxzOworICAgIHJvdGF0ZUxhYmVscyA9IF87CisgICAgcmV0dXJuIGNoYXJ0OworICB9CisKKyAgY2hhcnQuc3RhZ2dlckxhYmVscyA9IGZ1bmN0aW9uKF8pIHsKKyAgICBpZiAoIWFyZ3VtZW50cy5sZW5ndGgpIHJldHVybiBzdGFnZ2VyTGFiZWxzOworICAgIHN0YWdnZXJMYWJlbHMgPSBfOworICAgIHJldHVybiBjaGFydDsKKyAgfTsKKworICBjaGFydC50b29sdGlwID0gZnVuY3Rpb24oXykgeworICAgIGlmICghYXJndW1lbnRzLmxlbmd0aCkgcmV0dXJuIHRvb2x0aXA7CisgICAgdG9vbHRpcCA9IF87CisgICAgcmV0dXJuIGNoYXJ0OworICB9OworCisgIGNoYXJ0LnRvb2x0aXBzID0gZnVuY3Rpb24oXykgeworICAgIGlmICghYXJndW1lbnRzLmxlbmd0aCkgcmV0dXJuIHRvb2x0aXBzOworICAgIHRvb2x0aXBzID0gXzsKKyAgICByZXR1cm4gY2hhcnQ7CisgIH07CisKKyAgY2hhcnQudG9vbHRpcENvbnRlbnQgPSBmdW5jdGlvbihfKSB7CisgICAgaWYgKCFhcmd1bWVudHMubGVuZ3RoKSByZXR1cm4gdG9vbHRpcDsKKyAgICB0b29sdGlwID0gXzsKKyAgICByZXR1cm4gY2hhcnQ7CisgIH07CisKKyAgY2hhcnQuc3RhdGUgPSBmdW5jdGlvbihfKSB7CisgICAgaWYgKCFhcmd1bWVudHMubGVuZ3RoKSByZXR1cm4gc3RhdGU7CisgICAgc3RhdGUgPSBfOworICAgIHJldHVybiBjaGFydDsKKyAgfTsKKworICBjaGFydC5kZWZhdWx0U3RhdGUgPSBmdW5jdGlvbihfKSB7CisgICAgaWYgKCFhcmd1bWVudHMubGVuZ3RoKSByZXR1cm4gZGVmYXVsdFN0YXRlOworICAgIGRlZmF1bHRTdGF0ZSA9IF87CisgICAgcmV0dXJuIGNoYXJ0OworICB9OworICAKKyAgY2hhcnQubm9EYXRhID0gZnVuY3Rpb24oXykgeworICAgIGlmICghYXJndW1lbnRzLmxlbmd0aCkgcmV0dXJuIG5vRGF0YTsKKyAgICBub0RhdGEgPSBfOworICAgIHJldHVybiBjaGFydDsKKyAgfTsKKworICAvLz09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorCisKKyAgcmV0dXJuIGNoYXJ0OworfQorCitudi5tb2RlbHMubXVsdGlCYXJIb3Jpem9udGFsID0gZnVuY3Rpb24oKSB7CisKKyAgLy89PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKyAgLy8gUHVibGljIFZhcmlhYmxlcyB3aXRoIERlZmF1bHQgU2V0dGluZ3MKKyAgLy8tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0KKworICB2YXIgbWFyZ2luID0ge3RvcDogMCwgcmlnaHQ6IDAsIGJvdHRvbTogMCwgbGVmdDogMH0KKyAgICAsIHdpZHRoID0gOTYwCisgICAgLCBoZWlnaHQgPSA1MDAKKyAgICAsIGlkID0gTWF0aC5mbG9vcihNYXRoLnJhbmRvbSgpICogMTAwMDApIC8vQ3JlYXRlIHNlbWktdW5pcXVlIElEIGluIGNhc2UgdXNlciBkb2Vzbid0IHNlbGVjdCBvbmUKKyAgICAsIHggPSBkMy5zY2FsZS5vcmRpbmFsKCkKKyAgICAsIHkgPSBkMy5zY2FsZS5saW5lYXIoKQorICAgICwgZ2V0WCA9IGZ1bmN0aW9uKGQpIHsgcmV0dXJuIGQueCB9CisgICAgLCBnZXRZID0gZnVuY3Rpb24oZCkgeyByZXR1cm4gZC55IH0KKyAgICAsIGZvcmNlWSA9IFswXSAvLyAwIGlzIGZvcmNlZCBieSBkZWZhdWx0Li4gdGhpcyBtYWtl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S0tLS0tLS0tLS0tLS0tLS0tLS0KKworICB2YXIgeDAsIHkwIC8vdXNlZCB0byBzdG9yZSBwcmV2aW91cyBzY2FsZXMKKyAgICAgIDsKKworICAvLz09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorCisKKyAgZnVuY3Rpb24gY2hhcnQoc2VsZWN0aW9uKSB7CisgICAgc2VsZWN0aW9uLmVhY2goZnVuY3Rpb24oZGF0YSkgeworICAgICAgdmFyIGF2YWlsYWJsZVdpZHRoID0gd2lkdGggLSBtYXJnaW4ubGVmdCAtIG1hcmdpbi5yaWdodCwKKyAgICAgICAgICBhdmFpbGFibGVIZWlnaHQgPSBoZWlnaHQgLSBtYXJnaW4udG9wIC0gbWFyZ2luLmJvdHRvbSwKKyAgICAgICAgICBjb250YWluZXIgPSBkMy5zZWxlY3QodGhpcyk7CisKKworICAgICAgaWYgKHN0YWNrZWQpCisgICAgICAgIGRhdGEgPSBkMy5sYXlvdXQuc3RhY2soKQorICAgICAgICAgICAgICAgICAub2Zmc2V0KCd6ZXJvJykKKyAgICAgICAgICAgICAgICAgLnZhbHVlcyhmdW5jdGlvbihkKXsgcmV0dXJuIGQudmFsdWVzIH0pCisgICAgICAgICAgICAgICAgIC55KGdldFkpCisgICAgICAgICAgICAgICAgIChkYXRhKTsKKworCisgICAgICAvL2FkZCBzZXJpZXMgaW5kZXggdG8gZWFjaCBkYXRhIHBvaW50IGZvciByZWZlcmVuY2UKKyAgICAgIGRhdGEgPSBkYXRhLm1hcChmdW5jdGlvbihzZXJpZXMsIGkpIHsKKyAgICAgICAgc2VyaWVzLnZhbHVlcyA9IHNlcmllcy52YWx1ZXMubWFwKGZ1bmN0aW9uKHBvaW50KSB7CisgICAgICAgICAgcG9pbnQuc2VyaWVzID0gaTsKKyAgICAgICAgICByZXR1cm4gcG9pbnQ7CisgICAgICAgIH0pOworICAgICAgICByZXR1cm4gc2VyaWVzOworICAgICAgfSk7CisKKworCisgICAgICAvLy0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLQorICAgICAgLy8gSEFDSyBmb3IgbmVnYXRpdmUgdmFsdWUgc3RhY2tpbmcKKyAgICAgIGlmIChzdGFja2VkKQorICAgICAgICBkYXRhWzBdLnZhbHVlcy5tYXAoZnVuY3Rpb24oZCxpKSB7CisgICAgICAgICAgdmFyIHBvc0Jhc2UgPSAwLCBuZWdCYXNlID0gMDsKKyAgICAgICAgICBkYXRhLm1hcChmdW5jdGlvbihkKSB7CisgICAgICAgICAgICB2YXIgZiA9IGQudmFsdWVzW2ldCisgICAgICAgICAgICBmLnNpemUgPSBNYXRoLmFicyhmLnkpOworICAgICAgICAgICAgaWYgKGYueTwwKSAgeworICAgICAgICAgICAgICBmLnkxID0gbmVnQmFzZSAtIGYuc2l6ZTsKKyAgICAgICAgICAgICAgbmVnQmFzZSA9IG5lZ0Jhc2UgLSBmLnNpemU7CisgICAgICAgICAgICB9IGVsc2UKKyAgICAgICAgICAgIHsgCisgICAgICAgICAgICAgIGYueTEgPSBwb3NCYXNlOworICAgICAgICAgICAgICBwb3NCYXNlID0gcG9zQmFzZSArIGYuc2l6ZTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICB9KTsKKyAgICAgICAgfSk7CisKKworCisgICAgICAvLy0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLQorICAgICAgLy8gU2V0dXAgU2NhbGVzCisKKyAgICAgIC8vIHJlbWFwIGFuZCBmbGF0dGVuIHRoZSBkYXRhIGZvciB1c2UgaW4gY2FsY3VsYXRpbmcgdGhlIHNjYWxlcycgZG9tYWlucworICAgICAgdmFyIHNlcmllc0RhdGEgPSAoeERvbWFpbiAmJiB5RG9tYWluKSA/IFtdIDogLy8gaWYgd2Uga25vdyB4RG9tYWluIGFuZCB5RG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S0tLS0tLS0tLS0KKworCisKKyAgICAgIHZhciBncm91cHMgPSB3cmFwLnNlbGVjdCgnLm52LWdyb3VwcycpLnNlbGVjdEFsbCgnLm52LWdyb3VwJykKKyAgICAgICAgICAuZGF0YShmdW5jdGlvbihkKSB7IHJldHVybiBkIH0sIGZ1bmN0aW9uKGQpIHsgcmV0dXJuIGQua2V5IH0pOworICAgICAgZ3JvdXBzLmVudGVyKCkuYXBwZW5kKCdnJykKKyAgICAgICAgICAuc3R5bGUoJ3N0cm9rZS1vcGFjaXR5JywgMWUtNikKKyAgICAgICAgICAuc3R5bGUoJ2ZpbGwtb3BhY2l0eScsIDFlLTYpOworICAgICAgZDMudHJhbnNpdGlvbihncm91cHMuZXhpdCgpKQorICAgICAgICAgIC5zdHlsZSgnc3Ryb2tlLW9wYWNpdHknLCAxZS02KQorICAgICAgICAgIC5zdHlsZSgnZmlsbC1vcGFjaXR5JywgMWUtNikKKyAgICAgICAgICAucmVtb3ZlKCk7CisgICAgICBncm91cHMKKyAgICAgICAgICAuYXR0cignY2xhc3MnLCBmdW5jdGlvbihkLGkpIHsgcmV0dXJuICdudi1ncm91cCBudi1zZXJpZXMtJyArIGkgfSkKKyAgICAgICAgICAuY2xhc3NlZCgnaG92ZXInLCBmdW5jdGlvbihkKSB7IHJldHVybiBkLmhvdmVyIH0pCisgICAgICAgICAgLnN0eWxlKCdmaWxsJywgZnVuY3Rpb24oZCxpKXsgcmV0dXJuIGNvbG9yKGQsIGkpIH0pCisgICAgICAgICAgLnN0eWxlKCdzdHJva2UnLCBmdW5jdGlvbihkLGkpeyByZXR1cm4gY29sb3IoZCwgaSkgfSk7CisgICAgICBkMy50cmFuc2l0aW9uKGdyb3VwcykKKyAgICAgICAgICAuc3R5bGUoJ3N0cm9rZS1vcGFjaXR5JywgMSkKKyAgICAgICAgICAuc3R5bGUoJ2ZpbGwtb3BhY2l0eScsIC43NSk7CisKKworICAgICAgdmFyIGJhcnMgPSBncm91cHMuc2VsZWN0QWxsKCdnLm52LWJhcicpCisgICAgICAgICAgLmRhdGEoZnVuY3Rpb24oZCkgeyByZXR1cm4gZC52YWx1ZXMgfSk7CisKKyAgICAgIGJhcnMuZXhpdCgpLnJlbW92ZSgpOworCisKKyAgICAgIHZhciBiYXJzRW50ZXIgPSBiYXJzLmVudGVyKCkuYXBwZW5kKCdnJykKKyAgICAgICAgICAuYXR0cigndHJhbnNmb3JtJywgZnVuY3Rpb24oZCxpLGopIHsKKyAgICAgICAgICAgICAgcmV0dXJuICd0cmFuc2xhdGUoJyArIHkwKHN0YWNrZWQgPyBkLnkwIDogMCkgKyAnLCcgKyAoc3RhY2tlZCA/IDAgOiAoaiAqIHgucmFuZ2VCYW5kKCkgLyBkYXRhLmxlbmd0aCApICsgeChnZXRYKGQsaSkpKSArICcpJworICAgICAgICAgIH0pOworCisgICAgICBiYXJzRW50ZXIuYXBwZW5kKCdyZWN0JykKKyAgICAgICAgICAuYXR0cignd2lkdGgnLCAwKQorICAgICAgICAgIC5hdHRyKCdoZWlnaHQnLCB4LnJhbmdlQmFuZCgpIC8gKHN0YWNrZWQgPyAxIDogZGF0YS5sZW5ndGgpICkKKworICAgICAgYmFycworICAgICAgICAgIC5vbignbW91c2VvdmVyJywgZnVuY3Rpb24oZCxpKSB7IC8vVE9ETzogZmlndXJlIG91dCB3aHkgaiB3b3JrcyBhYm92ZSwgYnV0IG5vdCBoZXJlCisgICAgICAgICAgICBkMy5zZWxlY3QodGhpcykuY2xhc3NlZCgnaG92ZXInLCB0cnVlKTsKKyAgICAgICAgICAgIGRpc3BhdGNoLmVsZW1lbnRNb3VzZW92ZXIoeworICAgICAgICAgICAgICB2YWx1ZTogZ2V0WShkLGkpLAorICAgICAgICAgICAgICBwb2ludDogZCwKKyAgICAgICAgICAgICAgc2VyaWVzOiBkYXRhW2Quc2VyaWVzXSwKKyAgICAgICAgICAgICAgcG9zOiBbIHkoZ2V0WShkLGkpICsgKHN0YWNrZWQgPyBkLnkwIDogMCkpLCB4KGdldFgoZCxpKSkgKyAoeC5yYW5nZUJhbmQoKSAqIChzdGFja2VkID8gZGF0YS5sZW5ndGggLyAyIDogZC5zZXJpZXMgKyAuNSkgLyBkYXRhLmxlbmd0aCkgXSwKKyAgICAgICAgICAgICAgcG9pbnRJbmRleDogaSwKKyAgICAgICAgICAgICAgc2VyaWVzSW5kZXg6IGQuc2VyaWVzLAorICAgICAgICAgICAgICBlOiBkMy5ldmVudAorICAgICAgICAgICAgfSk7CisgICAgICAgICAgfSkKKyAgICAgICAgICAub24oJ21vdXNlb3V0JywgZnVuY3Rpb24oZCxpKSB7CisgICAgICAgICAgICBkMy5zZWxlY3QodGhpcykuY2xhc3NlZCgnaG92ZXInLCBmYWxzZSk7CisgICAgICAgICAgICBkaXNwYXRjaC5lbGVtZW50TW91c2VvdXQoeworICAgICAgICAgICAgICB2YWx1ZTogZ2V0WShkLGkpLAorICAgICAgICAgICAgICBwb2ludDogZCwKKyAgICAgICAgICAgICAgc2VyaWVzOiBkYXRhW2Quc2VyaWVzXSwKKyAgICAgICAgICAgICAgcG9pbnRJbmRleDogaSwKKyAgICAgICAgICAgICAgc2VyaWVzSW5kZXg6IGQuc2VyaWVzLAorICAgICAgICAgICAgICBlOiBkMy5ldmVudAorICAgICAgICAgICAgfSk7CisgICAgICAgICAgfSkKKyAgICAgICAgICAub24oJ2NsaWNrJywgZnVuY3Rpb24oZCxpKSB7CisgICAgICAgICAgICBkaXNwYXRjaC5lbGVtZW50Q2xpY2soeworICAgICAgICAgICAgICB2YWx1ZTogZ2V0WShkLGkpLAorICAgICAgICAgICAgICBwb2ludDogZCwKKyAgICAgICAgICAgICAgc2VyaWVzOiBkYXRhW2Quc2VyaWVzXSwKKyAgICAgICAgICAgICAgcG9zOiBbeChnZXRYKGQsaSkpICsgKHgucmFuZ2VCYW5kKCkgKiAoc3RhY2tlZCA/IGRhdGEubGVuZ3RoIC8gMiA6IGQuc2VyaWVzICsgLjUpIC8gZGF0YS5sZW5ndGgpLCB5KGdldFkoZCxpKSArIChzdGFja2VkID8gZC55MCA6IDApKV0sICAvLyBUT0RPOiBGaWd1cmUgb3V0IHdoeSB0aGUgdmFsdWUgYXBwZWFycyB0byBiZSBzaGlmdGVkCisgICAgICAgICAgICAgIHBvaW50SW5kZXg6IGksCisgICAgICAgICAgICAgIHNlcmllc0luZGV4OiBkLnNlcmllcywKKyAgICAgICAgICAgICAgZTogZDMuZXZlbnQKKyAgICAgICAgICAgIH0pOworICAgICAgICAgICAgZDMuZXZlbnQuc3RvcFByb3BhZ2F0aW9uKCk7CisgICAgICAgICAgfSkKKyAgICAgICAgICAub24oJ2RibGNsaWNrJywgZnVuY3Rpb24oZCxpKSB7CisgICAgICAgICAgICBkaXNwYXRjaC5lbGVtZW50RGJsQ2xpY2soeworICAgICAgICAgICAgICB2YWx1ZTogZ2V0WShkLGkpLAorICAgICAgICAgICAgICBwb2ludDogZCwKKyAgICAgICAgICAgICAgc2VyaWVzOiBkYXRhW2Quc2VyaWVzXSwKKyAgICAgICAgICAgICAgcG9zOiBbeChnZXRYKGQsaSkpICsgKHgucmFuZ2VCYW5kKCkgKiAoc3RhY2tlZCA/IGRhdGEubGVuZ3RoIC8gMiA6IGQuc2VyaWVzICsgLjUpIC8gZGF0YS5sZW5ndGgpLCB5KGdldFkoZCxpKSArIChzdGFja2VkID8gZC55MCA6IDApKV0sICAvLyBUT0RPOiBGaWd1cmUgb3V0IHdoeSB0aGUgdmFsdWUgYXBwZWFycyB0byBiZSBzaGlmdGVkCisgICAgICAgICAgICAgIHBvaW50SW5kZXg6IGksCisgICAgICAgICAgICAgIHNlcmllc0luZGV4OiBkLnNlcmllcywKKyAgICAgICAgICAgICAgZTogZDMuZXZlbnQKKyAgICAgICAgICAgIH0pOworICAgICAgICAgICAgZDMuZXZlbnQuc3RvcFByb3BhZ2F0aW9uKCk7CisgICAgICAgICAgfSk7CisKKworICAgICAgYmFyc0VudGVyLmFwcGVuZCgndGV4dCcpOworCisgICAgICBpZiAoc2hvd1ZhbHVlcyAm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Z3RoIH0pCisgICAgICAgICAgICAuYXR0cigndHJhbnNmb3JtJywgZnVuY3Rpb24oZCxpKSB7CisgICAgICAgICAgICAgIC8vcmV0dXJuICd0cmFuc2xhdGUoJyArIHkoZC55MCkgKyAnLDApJworICAgICAgICAgICAgICAvL3JldHVybiAndHJhbnNsYXRlKCcgKyB5KGQueTApICsgJywnICsgeChnZXRYKGQsaSkpICsgJyknCisgICAgICAgICAgICAgIHJldHVybiAndHJhbnNsYXRlKCcgKyB5KGQueTEpICsgJywnICsgeChnZXRYKGQsaSkpICsgJyknCisgICAgICAgICAgICB9KQorICAgICAgICAgIC5zZWxlY3QoJ3JlY3QnKQorICAgICAgICAgICAgLmF0dHIoJ3dpZHRoJywgZnVuY3Rpb24oZCxpKSB7CisgICAgICAgICAgICAgIHJldHVybiBNYXRoLmFicyh5KGdldFkoZCxpKSArIGQueTApIC0geShkLnkwKSkKKyAgICAgICAgICAgIH0pCisgICAgICAgICAgICAuYXR0cignaGVpZ2h0JywgeC5yYW5nZUJhbmQoKSApOworICAgICAgZWxzZQorICAgICAgICBkMy50cmFuc2l0aW9uKGJhcnMpCisgICAgICAgICAgLy8uZGVsYXkoZnVuY3Rpb24oZCxpKSB7IHJldHVybiBpICogZGVsYXkgLyBkYXRhWzBdLnZhbHVlcy5sZW5ndGggfSkKKyAgICAgICAgICAgIC5hdHRyKCd0cmFuc2Zvcm0nLCBmdW5jdGlvbihkLGkpIHsKKyAgICAgICAgICAgICAgLy9UT0RPOiBzdGFja2VkIG11c3QgYmUgYWxsIHBvc2l0aXZlIG9yIGFsbCBuZWdhdGl2ZSwgbm90IGJvdGg/CisgICAgICAgICAgICAgIHJldHVybiAndHJhbnNsYXRlKCcgKyAKKyAgICAgICAgICAgICAgKGdldFkoZCxpKSA8IDAgPyB5KGdldFkoZCxpKSkgOiB5KDApKQorICAgICAgICAgICAgICArICcsJyArCisgICAgICAgICAgICAgIChkLnNlcmllcyAqIHgucmFuZ2VCYW5kKCkgLyBkYXRhLmxlbmd0aAorICAgICAgICAgICAgICArCisgICAgICAgICAgICAgIHgoZ2V0WChkLGkpKSApCisgICAgICAgICAgICAgICsgJyknCisgICAgICAgICAgICB9KQorICAgICAgICAgIC5zZWxlY3QoJ3JlY3QnKQorICAgICAgICAgICAgLmF0dHIoJ2hlaWdodCcsIHgucmFuZ2VCYW5kKCkgLyBkYXRhLmxlbmd0aCApCisgICAgICAgICAgICAuYXR0cignd2lkdGgnLCBmdW5jdGlvbihkLGkpIHsKKyAgICAgICAgICAgICAgcmV0dXJuIE1hdGgubWF4KE1hdGguYWJzKHkoZ2V0WShkLGkpKSAtIHkoMCkpLDEpCisgICAgICAgICAgICB9KTsKKworCisgICAgICAvL3N0b3JlIG9sZCBzY2FsZXMgZm9yIHVzZSBpbiB0cmFuc2l0aW9ucyBvbiB1cGRhdGUKKyAgICAgIHgwID0geC5jb3B5KCk7CisgICAgICB5MCA9IHkuY29weSgpOworCisgICAgfSk7CisKKyAgICByZXR1cm4gY2hhcnQ7CisgIH0KKworCisgIC8vPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisgIC8vIEV4cG9zZSBQdWJsaWMgVmFyaWFibGVzCisgIC8vLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tCisKKyAgY2hhcnQuZGlzcGF0Y2ggPSBkaXNwYXRjaDsKKworICBjaGFydC54ID0gZnVuY3Rpb24oXykgeworICAgIGlmICghYXJndW1lbnRzLmxlbmd0aCkgcmV0dXJuIGdldFg7CisgICAgZ2V0WCA9IF87CisgICAgcmV0dXJuIGNoYXJ0OworICB9OworCisgIGNoYXJ0LnkgPSBmdW5jdGlvbihfKSB7CisgICAgaWYgKCFhcmd1bWVudHMubGVuZ3RoKSByZXR1cm4gZ2V0WTsKKyAgICBnZXRZID0gXzsKKyAgICByZXR1cm4gY2hhcnQ7CisgIH07Cis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worICAgIHkgPSBfOworICAgIHJldHVybiBjaGFydDsKKyAgfTsKKworICBjaGFydC54RG9tYWluID0gZnVuY3Rpb24oXykgeworICAgIGlmICghYXJndW1lbnRzLmxlbmd0aCkgcmV0dXJuIHhEb21haW47CisgICAgeERvbWFpbiA9IF87CisgICAgcmV0dXJuIGNoYXJ0OworICB9OworCisgIGNoYXJ0LnlEb21haW4gPSBmdW5jdGlvbihfKSB7CisgICAgaWYgKCFhcmd1bWVudHMubGVuZ3RoKSByZXR1cm4geURvbWFpbjsKKyAgICB5RG9tYWluID0gXzsKKyAgICByZXR1cm4gY2hhcnQ7CisgIH07CisKKyAgY2hhcnQuZm9yY2VZID0gZnVuY3Rpb24oXykgeworICAgIGlmICghYXJndW1lbnRzLmxlbmd0aCkgcmV0dXJuIGZvcmNlWTsKKyAgICBmb3JjZVkgPSBfOworICAgIHJldHVybiBjaGFydDsKKyAgfTsKKworICBjaGFydC5zdGFja2VkID0gZnVuY3Rpb24oXykgeworICAgIGlmICghYXJndW1lbnRzLmxlbmd0aCkgcmV0dXJuIHN0YWNrZWQ7CisgICAgc3RhY2tlZCA9IF87CisgICAgcmV0dXJuIGNoYXJ0OworICB9OworCisgIGNoYXJ0LmNvbG9yID0gZnVuY3Rpb24oXykgeworICAgIGlmICghYXJndW1lbnRzLmxlbmd0aCkgcmV0dXJuIGNvbG9yOworICAgIGNvbG9yID0gbnYudXRpbHMuZ2V0Q29sb3IoXyk7CisgICAgcmV0dXJuIGNoYXJ0OworICB9OworCisgIGNoYXJ0LmJhckNvbG9yID0gZnVuY3Rpb24oXykgeworICAgIGlmICghYXJndW1lbnRzLmxlbmd0aCkgcmV0dXJuIGJhckNvbG9yOworICAgIGJhckNvbG9yID0gbnYudXRpbHMuZ2V0Q29sb3IoXyk7CisgICAgcmV0dXJuIGNoYXJ0OworICB9OworCisgIGNoYXJ0LmRpc2FibGVkID0gZnVuY3Rpb24oXykgeworICAgIGlmICghYXJndW1lbnRzLmxlbmd0aCkgcmV0dXJuIGRpc2FibGVkOworICAgIGRpc2FibGVkID0gXzsKKyAgICByZXR1cm4gY2hhcnQ7CisgIH07CisKKyAgY2hhcnQuaWQgPSBmdW5jdGlvbihfKSB7CisgICAgaWYgKCFhcmd1bWVudHMubGVuZ3RoKSByZXR1cm4gaWQ7CisgICAgaWQgPSBfOworICAgIHJldHVybiBjaGFydDsKKyAgfTsKKworICBjaGFydC5kZWxheSA9IGZ1bmN0aW9uKF8pIHsKKyAgICBpZiAoIWFyZ3VtZW50cy5sZW5ndGgpIHJldHVybiBkZWxheTsKKyAgICBkZWxheSA9IF87CisgICAgcmV0dXJuIGNoYXJ0OworICB9OworCisgIGNoYXJ0LnNob3dWYWx1ZXMgPSBmdW5jdGlvbihfKSB7CisgICAgaWYgKCFhcmd1bWVudHMubGVuZ3RoKSByZXR1cm4gc2hvd1ZhbHVlczsKKyAgICBzaG93VmFsdWVzID0gXzsKKyAgICByZXR1cm4gY2hhcnQ7CisgIH07CisKKyAgY2hhcnQudmFsdWVGb3JtYXQ9IGZ1bmN0aW9uKF8pIHsKKyAgICBpZiAoIWFyZ3VtZW50cy5sZW5ndGgpIHJldHVybiB2YWx1ZUZvcm1hdDsKKyAgICB2YWx1ZUZvcm1hdCA9IF87CisgICAgcmV0dXJuIGNoYXJ0OworICB9OworCisgIGNoYXJ0LnZhbHVlUGFkZGluZyA9IGZ1bmN0aW9uKF8pIHsKKyAgICBpZiAoIWFyZ3VtZW50cy5sZW5ndGgpIHJldHVybiB2YWx1ZVBhZGRpbmc7CisgICAgdmFsdWVQYWRkaW5nID0gXzsKKyAgICByZXR1cm4gY2hhcnQ7CisgIH07CisKKyAgLy89PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKworCisgIHJldHVybiBjaGFydDsKK30KKworbnYubW9kZWxzLm11bHRpQmFySG9yaXpvbnRhbENoYXJ0ID0gZnVuY3Rpb24oKSB7CisKKyAgLy89PT09PT09PT09PT09PT09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cm1hdCgnLC4yZicpOworCQkJcmV0dXJuICc8aDM+JyArIGtleSArICcgLSAnICsgeCArICc8L2gzPicgKworICAgICAgICAgICAgICAgJzxwPicgKyAgeUF4aXMudGlja0Zvcm1hdCgpKE1hdGgucG93KDEwLHkpKSArICc8L3A+JworCSAgICB9IGVsc2UgeworICAgICAgICByZXR1cm4gJzxoMz4nICsga2V5ICsgJyAtICcgKyB4ICsgJzwvaDM+JyArCisgICAgICAgICAgICAgICAnPHA+JyArICB5ICsgJzwvcD4nCisgICAgICB9CisKKyAgICAgIH0KKyAgICAsIHggLy9jYW4gYmUgYWNjZXNzZWQgdmlhIGNoYXJ0LnhTY2FsZSgpCisgICAgLCB5IC8vY2FuIGJlIGFjY2Vzc2VkIHZpYSBjaGFydC55U2NhbGUoKQorICAgICwgc3RhdGUgPSB7IHN0YWNrZWQ6IHN0YWNrZWQgfQorICAgICwgZGVmYXVsdFN0YXRlID0gbnVsbAorICAgICwgbm9EYXRhID0gJ05vIERhdGEgQXZhaWxhYmxlLicKKyAgICAsIGRpc3BhdGNoID0gZDMuZGlzcGF0Y2goJ3Rvb2x0aXBTaG93JywgJ3Rvb2x0aXBIaWRlJywgJ3N0YXRlQ2hhbmdlJywgJ2NoYW5nZVN0YXRlJykKKyAgICAsIGNvbnRyb2xXaWR0aCA9IGZ1bmN0aW9uKCkgeyByZXR1cm4gc2hvd0NvbnRyb2xzID8gMTgwIDogMCB9CisgICAgOworCisgIG11bHRpYmFyCisgICAgLnN0YWNrZWQoc3RhY2tlZCkKKyAgICA7CisgIHhBeGlzCisgICAgLm9yaWVudCgnbGVmdCcpCisgICAgLnRpY2tQYWRkaW5nKDUpCisgICAgLmhpZ2hsaWdodFplcm8oZmFsc2UpCisgICAgLnNob3dNYXhNaW4oZmFsc2UpCisgICAgLnRpY2tGb3JtYXQoZnVuY3Rpb24oZCkgeyByZXR1cm4gZCB9KQorICAgIDsKKyAgeUF4aXMKKyAgICAub3JpZW50KCdib3R0b20nKQorICAgIC50aWNrRm9ybWF0KGQzLmZvcm1hdCgnLC4xZicpKQorICAgIDsKKworICAvLz09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorCisKKyAgLy89PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKyAgLy8gUHJpdmF0ZSBWYXJpYWJsZXMKKyAgLy8tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0KKworICB2YXIgc2hvd1Rvb2x0aXAgPSBmdW5jdGlvbihlLCBvZmZzZXRFbGVtZW50KSB7CisgICAgLy92YXIgbGVmdCA9IGUucG9zWzBdICsgKCBvZmZzZXRFbGVtZW50Lm9mZnNldExlZnQgfHwgMCApLAorCS8vYWxlcnQob2Zmc2V0RWxlbWVudC5vZmZzZXRMZWZ0ICsgIiAiICsgZS5wb3NbMF0pOworCXZhciBsZWZ0UG9zID0gMDsKKwlpZihlLnBvc1swXSA+PTIwMCkgbGVmdFBvcyA9IDIwMDsKKwllbHNlIGxlZnRQb3MgPSBlLnBvc1swXTsKKwlpZihsb2dTY2FsZSkgCisJCXkgPSBtdWx0aWJhci55KCkoZS5wb2ludCwgZS5wb2ludEluZGV4KTsKKwllbHNlCisJCXkgPSB5QXhpcy50aWNrRm9ybWF0KCkobXVsdGliYXIueSgpKGUucG9pbnQsIGUucG9pbnRJbmRleCkpCQorCXZhciBsZWZ0ID0gbGVmdFBvcyArICggb2Zmc2V0RWxlbWVudC5vZmZzZXRMZWZ0IHx8IDAgKSwKKyAgICAgICAgdG9wID0gZS5wb3NbMV0gKyAoIG9mZnNldEVsZW1lbnQub2Zmc2V0VG9wIHx8IDApLAorICAgICAgICB4ID0geEF4aXMudGlja0Zvcm1hdCgpKG11bHRpYmFyLngoKShlLnBvaW50LCBlLnBvaW50SW5kZXgpKSwKKyAgICAgICAgY29udGVudCA9IHRvb2x0aXAoZS5zZXJpZXMua2V5LCB4LCB5LCBlLCBjaGFydCwgbG9nU2NhbGUpOworCQkvL2FsZXJ0KCJmcm9tIHRvb2x0aXAgIiArIG11bHRpYmFyLnkoKShlLnBvaW50LCBlLnBvaW50SW5kZXgpKTsKKworICAgIG52LnRvb2x0aXAuc2hvdyhbbGVmdCwgdG9wXSwgY29udGVudCwgZS52YWx1ZSA8IDAgPyAnZScgOiAndycsIG51bGwsIG9mZnNldEVsZW1lbnQpOworICB9OworCisgIC8vPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisKKworICBmdW5jdGlvbiBjaGFydChzZWxlY3Rpb24pIHsKKyAgICBzZWxlY3Rpb24uZWFjaChmdW5jdGlvbihkYXRhKSB7CisgICAgICB2YXIgY29udGFpbmVyID0gZDMuc2VsZWN0KHRoaXMpLAorICAgICAgICAgIHRoYXQgPSB0aGlzOworCisgICAgICB2YXIgYXZhaWxhYmxlV2lkdGggPSAod2lkdGggIHx8IHBhcnNlSW50KGNvbnRhaW5lci5zdHlsZSgnd2lkdGgnKSkgfHwgOTYwKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAtIG1hcmdpbi5sZWZ0IC0gbWFyZ2luLnJpZ2h0LAorICAgICAgICAgIGF2YWlsYWJsZUhlaWdodCA9IChoZWlnaHQgfHwgcGFyc2VJbnQoY29udGFpbmVyLnN0eWxlKCdoZWlnaHQnKSkgfHwgNDAwKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAtIG1hcmdpbi50b3AgLSBtYXJnaW4uYm90dG9tOworCisgICAgICBjaGFydC51cGRhdGUgPSBmdW5jdGlvbigpIHsgY29udGFpbmVyLnRyYW5zaXRpb24oKS5jYWxsKGNoYXJ0KSB9OworICAgICAgY2hhcnQuY29udGFpbmVyID0gdGhpczsKKworICAgICAgLy9zZXQgc3RhdGUuZGlzYWJsZWQKKyAgICAgIHN0YXRlLmRpc2FibGVkID0gZGF0YS5tYXAoZnVuY3Rpb24oZCkgeyByZXR1cm4gISFkLmRpc2FibGVkIH0pOworCisgICAgICBpZiAoIWRlZmF1bHRTdGF0ZSkgeworICAgICAgICB2YXIga2V5OworICAgICAgICBkZWZhdWx0U3RhdGUgPSB7fTsKKyAgICAgICAgZm9yIChrZXkgaW4gc3RhdGUpIHsKKyAgICAgICAgICBpZiAoc3RhdGVba2V5XSBpbnN0YW5jZW9mIEFycmF5KQorICAgICAgICAgICAgZGVmYXVsdFN0YXRlW2tleV0gPSBzdGF0ZVtrZXldLnNsaWNlKDApOworICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgIGRlZmF1bHRTdGF0ZVtrZXldID0gc3RhdGVba2V5XTsKKyAgICAgICAgfQorICAgICAgfQorCisgICAgICAvLy0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLQorICAgICAgLy8gRGlzcGxheSBObyBEYXRhIG1lc3NhZ2UgaWYgdGhlcmUncyBub3RoaW5nIHRvIHNob3cuCisKKyAgICAgIGlmICghZGF0YSB8fCAhZGF0YS5sZW5ndGggfHwgIWRhdGEuZmlsdGVyKGZ1bmN0aW9uKGQpIHsgcmV0dXJuIGQudmFsdWVzLmxlbmd0aCB9KS5sZW5ndGgpIHsKKyAgICAgICAgdmFyIG5vRGF0YVRleHQgPSBjb250YWluZXIuc2VsZWN0QWxsKCcubnYtbm9EYXRhJykuZGF0YShbbm9EYXRhXSk7CisKKyAgICAgICAgbm9EYXRhVGV4dC5lbnRlcigpLmFwcGVuZCgndGV4dCcpCisgICAgICAgICAgLmF0dHIoJ2NsYXNzJywgJ252ZDMgbnYtbm9EYXRhJykKKyAgICAgICAgICAuYXR0cignZHknLCAnLS43ZW0nKQorICAgICAgICAgIC5zdHlsZSgndGV4dC1hbmNob3InLCAnbWlkZGxlJyk7CisKKyAgICAgICAgbm9EYXRhVGV4dAorICAgICAgICAgI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GF0dW0oZGF0YSkKKyAgICAgICAgICAgIC5jYWxsKGxlZ2VuZCk7CisKKyAgICAgICAgaWYgKCBtYXJnaW4udG9wICE9IGxlZ2VuZC5oZWlnaHQoKSkgeworICAgICAgICAgIG1hcmdpbi50b3AgPSBsZWdlbmQuaGVpZ2h0KCk7CisgICAgICAgICAgYXZhaWxhYmxlSGVpZ2h0ID0gKGhlaWdodCB8fCBwYXJzZUludChjb250YWluZXIuc3R5bGUoJ2hlaWdodCcpKSB8fCA0MDApCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC0gbWFyZ2luLnRvcCAtIG1hcmdpbi5ib3R0b207CisgICAgICAgIH0KKworICAgICAgICBnLnNlbGVjdCgnLm52LWxlZ2VuZFdyYXAnKQorICAgICAgICAgICAgLmF0dHIoJ3RyYW5zZm9ybScsICd0cmFuc2xhdGUoJyArIGNvbnRyb2xXaWR0aCgpICsgJywnICsgKC1tYXJnaW4udG9wKSArJyknKTsKKyAgICAgIH0KKworICAgICAgLy8tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0KKworCisgICAgICAvLy0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLQorICAgICAgLy8gQ29udHJvbHMKKworICAgICAgaWYgKHNob3dDb250cm9scykgeworICAgICAgICB2YXIgY29udHJvbHNEYXRhID0gWworICAgICAgICAgIHsga2V5OiAnR3JvdXBlZCcsIGRpc2FibGVkOiBtdWx0aWJhci5zdGFja2VkKCkgfSwKKyAgICAgICAgICB7IGtleTogJ1N0YWNrZWQnLCBkaXNhYmxlZDogIW11bHRpYmFyLnN0YWNrZWQoKSB9CisgICAgICAgIF07CisKKyAgICAgICAgY29udHJvbHMud2lkdGgoY29udHJvbFdpZHRoKCkpLmNvbG9yKFsnIzQ0NCcsICcjNDQ0JywgJyM0NDQnXS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KGQpIHsgcmV0dXJuICFkLmRpc2FibGVkIH0pKQorCisgICAgICBkMy50cmFuc2l0aW9uKGJhcnNXcmFwKS5jYWxsKG11bHRpYmFyKTsKKworICAgICAgLy8tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0KKworCisgICAgICAvLy0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLQorICAgICAgLy8gU2V0dXAgQXhlcworCisgICAgICB4QXhpcworICAgICAgICAuc2NhbGUoeCkKKyAgICAgICAgLnRpY2tzKCBhdmFpbGFibGVIZWlnaHQgLyAyNCApCisgICAgICAgIC50aWNrU2l6ZSgtYXZhaWxhYmxlV2lkdGgsIDApOworCisgICAgICBkMy50cmFuc2l0aW9uKGcuc2VsZWN0KCcubnYteC5udi1heGlzJykpCisgICAgICAgICAgLmNhbGwoeEF4aXMpOworCisgICAgICB2YXIgeFRpY2tzID0gZy5zZWxlY3QoJy5udi14Lm52LWF4aXMnKS5zZWxlY3RBbGwoJ2cnKTsKKworICAgICAgeFRpY2tzCisgICAgICAgICAgLnNlbGVjdEFsbCgnbGluZSwgdGV4dCcpCisgICAgICAgICAgLnN0eWxlKCdvcGFjaXR5JywgMSkKKworCisgICAgICB5QXhpcworICAgICAgICAuc2NhbGUoeSkKKyAgICAgICAgLnRpY2tzKCBhdmFpbGFibGVXaWR0aCAvIDEwMCApCisgICAgICAgIC50aWNrU2l6ZSggLWF2YWlsYWJsZUhlaWdodCwgMCk7CisKKyAgICAgIGcuc2VsZWN0KCcubnYteS5udi1heGlzJykKKyAgICAgICAgICAuYXR0cigndHJhbnNmb3JtJywgJ3RyYW5zbGF0ZSgwLCcgKyBhdmFpbGFibGVIZWlnaHQgKyAnKScpOworICAgICAgZDMudHJhbnNpdGlvbihnLnNlbGVjdCgnLm52LXkubnYtYXhpcycpKQorICAgICAgICAgIC5jYWxsKHlBeGlzKTsKKworICAgICAgLy8tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0KKworCisKKyAgICAgIC8vPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisgICAgICAvLyBFdmVudCBIYW5kbGluZy9EaXNwYXRjaGluZyAoaW4gY2hhcnQncyBzY29wZSkKKyAgICAgIC8vLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tCisKKyAgICAgIGxlZ2VuZC5kaXNwYXRjaC5vbignbGVnZW5kQ2xpY2snLCBmdW5jdGlvbihkLGkpIHsKKyAgICAgICAgZC5kaXNhYmxlZCA9ICFkLmRpc2FibGVkOworCisgICAgICAgIGlmICghZGF0YS5maWx0ZXIoZnVuY3Rpb24oZCkgeyByZXR1cm4gIWQuZGlzYWJsZWQgfSkubGVuZ3RoKSB7CisgICAgICAgICAgZGF0YS5tYXAoZnVuY3Rpb24oZCkgeworICAgICAgICAgICAgZC5kaXNhYmxlZCA9IGZhbHNlOworICAgICAgICAgICAgd3JhcC5zZWxlY3RBbGwoJy5udi1zZXJpZXMnKS5jbGFzc2VkKCdkaXNhYmxlZCcsIGZhbHNlKTsKKyAgICAgICAgICAgIHJldHVybiBkOworICAgICAgICAgIH0pOworICAgICAgICB9CisKKyAgICAgICAgc3RhdGUuZGlzYWJsZWQgPSBkYXRhLm1hcChmdW5jdGlvbihkKSB7IHJldHVybiAhIWQuZGlzYWJsZWQgfSk7CisgICAgICAgIGRpc3BhdGNoLnN0YXRlQ2hhbmdlKHN0YXRlKTsKKworICAgICAgICBjaGFydC51cGRhdGUoKTsKKyAgICAgIH0pOworCisgICAgICBsZWdlbmQuZGlzcGF0Y2gub24oJ2xlZ2VuZERibGNsaWNrJywgZnVuY3Rpb24oZCkgeworICAgICAgICAgIC8vRG91YmxlIGNsaWNraW5nIHNob3VsZCBhbHdheXMgZW5hYmxlIGN1cnJlbnQgc2VyaWVzLCBhbmQgZGlzYWJsZWQgYWxsIG90aGVycy4KKyAgICAgICAgICBkYXRhLmZvckVhY2goZnVuY3Rpb24oZCkgeworICAgICAgICAgICAgIGQuZGlzYWJsZWQgPSB0cnVlOworICAgICAgICAgIH0pOworICAgICAgICAgIGQuZGlzYWJsZWQgPSBmYWxzZTsgIAorCisgICAgICAgICAgc3RhdGUuZGlzYWJsZWQgPSBkYXRhLm1hcChmdW5jdGlvbihkKSB7IHJldHVybiAhIWQuZGlzYWJsZWQgfSk7CisgICAgICAgICAgZGlzcGF0Y2guc3RhdGVDaGFuZ2Uoc3RhdGUpOworICAgICAgICAgIGNoYXJ0LnVwZGF0ZSgpOworICAgICAgfSk7CisKKyAgICAgIGNvbnRyb2xzLmRpc3BhdGNoLm9uKCdsZWdlbmRDbGljaycsIGZ1bmN0aW9uKGQsaSkgeworICAgICAgICBpZiAoIWQuZGlzYWJsZWQpIHJldHVybjsKKyAgICAgICAgY29udHJvbHNEYXRhID0gY29udHJvbHNEYXRhLm1hcChmdW5jdGlvbihzKSB7CisgICAgICAgICAgcy5kaXNhYmxlZCA9IHRydWU7CisgICAgICAgICAgcmV0dXJuIHM7CisgICAgICAgIH0pOworICAgICAgICBkLmRpc2FibGVkID0gZmFsc2U7CisKKyAgICAgICAgc3dpdGNoIChkLmtleSkgeworICAgICAgICAgIGNhc2UgJ0dyb3VwZWQnOgorICAgICAgICAgICAgbXVsdGliYXIuc3RhY2tlZChmYWxzZSk7CisgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICBjYXNlICdTdGFja2VkJzoKKyAgICAgICAgICAgIG11bHRpYmFyLnN0YWNrZWQodHJ1ZSk7CisgICAgICAgICAgICBicmVhazsKKyAgICAgICAgfQorCisgICAgICAgIHN0YXRlLnN0YWNrZWQgPSBtdWx0aWJhci5zdGFja2VkKCk7CisgICAgICAgIGRpc3BhdGNoLnN0YXRlQ2hhbmdlKHN0YXRlKTsKKworICAgICAgICBjaGFydC51cGRhdGUoKTsKKyAgICAgIH0pOworCisgICAgICBkaXNwYXRjaC5vbigndG9vbHRpcFNob3cnLCBmdW5jdGlvbihlKSB7CisgICAgICAgIGlmICh0b29sdGlwcykgc2hvd1Rvb2x0aXAoZSwgdGhhdC5wYXJlbnROb2RlKTsKKyAgICAgIH0pOworCisgICAgICAvLyBVcGRhdGUgY2hhcnQgZnJvbSBhIHN0YXRlIG9iamVjdCBwYXNzZWQgdG8gZXZlbnQgaGFuZGxlcgorICAgICAgZGlzcGF0Y2gub24oJ2NoYW5nZVN0YXRlJywgZnVuY3Rpb24oZSkgeworCisgICAgICAgIGlmICh0eXBlb2YgZS5kaXNhYmxlZCAhPT0gJ3VuZGVmaW5lZCcpIHsKKyAgICAgICAgICBkYXRhLmZvckVhY2goZnVuY3Rpb24oc2VyaWVzLGkpIHsKKyAgICAgICAgICAgIHNlcmllcy5kaXNhYmxlZCA9IGUuZGlzYWJsZWRbaV07CisgICAgICAgICAgfSk7CisKKyAgICAgICAgICBzdGF0ZS5kaXNhYmxlZCA9IGUuZGlzYWJsZWQ7CisgICAgICAgIH0KKworICAgICAgICBpZiAodHlwZW9mIGUuc3RhY2tlZCAhPT0gJ3VuZGVmaW5lZCcpIHsKKyAgICAgICAgICBtdWx0aWJhci5zdGFja2VkKGUuc3RhY2tlZCk7CisgICAgICAgICAgc3RhdGUuc3RhY2tlZCA9IGUuc3RhY2tlZDsKKyAgICAgICAgfQorCisgICAgICAgIHNlbGVjdGlvbi5jYWxsKGNoYXJ0KTsKKyAgICAgIH0pOworICAgICAgLy89PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKworCisgICAgfSk7CisKKyAgICByZXR1cm4gY2hhcnQ7CisgIH0KKworCisgIC8vPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisgIC8vIEV2ZW50IEhhbmRsaW5nL0Rpc3BhdGNoaW5nIChvdXQgb2YgY2hhcnQncyBzY29wZSkKKyAgLy8tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0KKworICBtdWx0aWJhci5kaXNwYXRjaC5vbignZWxlbWVudE1vdXNlb3Zlci50b29sdGlwJywgZnVuY3Rpb24oZSkgeworICAgIGUucG9zID0gW2UucG9zWzBdICsgIG1hcmdpbi5sZWZ0LCBlLnBvc1sxXSArIG1hcmdpbi50b3BdOworICAgIGRpc3BhdGNoLnRvb2x0aXBTaG93KGUpOworICB9KTsKKworICBtdWx0aWJhci5kaXNwYXRjaC5vbignZWxlbWVudE1vdXNlb3V0LnRvb2x0aXAnLCBmdW5jdGlvbihlKSB7CisgICAgZGlzcGF0Y2gudG9vbHRpcEhpZGUoZSk7CisgIH0pOworICBkaXNwYXRjaC5vbigndG9vbHRpcEhpZGUnLCBmdW5jdGlvbigpIHsKKyAgICBpZiAodG9vbHRpcHMpIG52LnRvb2x0aXAuY2xlYW51cCgpOworICB9KTsKKworICAvLz09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorCisKKyAgLy89PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKyAgLy8gRXhwb3NlIFB1YmxpYyBWYXJpYWJsZXMKKyAgLy8tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0KKworICAvLyBleHBvc2UgY2hhcnQncyBzdWItY29tcG9uZW50cworICBjaGFydC5kaXNwYXRjaCA9IGRpc3BhdGNoOworICBjaGFydC5tdWx0aWJhciA9IG11bHRpYmFyOworICBjaGFydC5sZWdlbmQgPS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KyAgfTsKKworICBjaGFydC50b29sdGlwQ29udGVudCA9IGZ1bmN0aW9uKF8pIHsKKyAgICBpZiAoIWFyZ3VtZW50cy5sZW5ndGgpIHJldHVybiB0b29sdGlwOworICAgIHRvb2x0aXAgPSBfOworICAgIHJldHVybiBjaGFydDsKKyAgfTsKKworICBjaGFydC5zdGF0ZSA9IGZ1bmN0aW9uKF8pIHsKKyAgICBpZiAoIWFyZ3VtZW50cy5sZW5ndGgpIHJldHVybiBzdGF0ZTsKKyAgICBzdGF0ZSA9IF87CisgICAgcmV0dXJuIGNoYXJ0OworICB9OworCisgIGNoYXJ0LmRlZmF1bHRTdGF0ZSA9IGZ1bmN0aW9uKF8pIHsKKyAgICBpZiAoIWFyZ3VtZW50cy5sZW5ndGgpIHJldHVybiBkZWZhdWx0U3RhdGU7CisgICAgZGVmYXVsdFN0YXRlID0gXzsKKyAgICByZXR1cm4gY2hhcnQ7CisgIH07CisKKyAgY2hhcnQubm9EYXRhID0gZnVuY3Rpb24oXykgeworICAgIGlmICghYXJndW1lbnRzLmxlbmd0aCkgcmV0dXJuIG5vRGF0YTsKKyAgICBub0RhdGEgPSBfOworICAgIHJldHVybiBjaGFydDsKKyAgfTsKKworICAvLz09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorCisKKyAgcmV0dXJuIGNoYXJ0OworfQorbnYubW9kZWxzLm11bHRpQ2hhcnQgPSBmdW5jdGlvbigpIHsKKworICAvLz09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorICAvLyBQdWJsaWMgVmFyaWFibGVzIHdpdGggRGVmYXVsdCBTZXR0aW5ncworICAvLy0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLQorCisgIHZhciBtYXJnaW4gPSB7dG9wOiAzMCwgcmlnaHQ6IDIwLCBib3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ZWQoZmFsc2UpLnlTY2FsZSh5U2NhbGUyKSwKKworICAgICAgc3RhY2sxID0gbnYubW9kZWxzLnN0YWNrZWRBcmVhKCkueVNjYWxlKHlTY2FsZTEpLAorICAgICAgc3RhY2syID0gbnYubW9kZWxzLnN0YWNrZWRBcmVhKCkueVNjYWxlKHlTY2FsZTIpLAorCisgICAgICB4QXhpcyA9IG52Lm1vZGVscy5heGlzKCkuc2NhbGUoeCkub3JpZW50KCdib3R0b20nKS50aWNrUGFkZGluZyg1KSwKKyAgICAgIHlBeGlzMSA9IG52Lm1vZGVscy5heGlzKCkuc2NhbGUoeVNjYWxlMSkub3JpZW50KCdsZWZ0JyksCisgICAgICB5QXhpczIgPSBudi5tb2RlbHMuYXhpcygpLnNjYWxlKHlTY2FsZTIpLm9yaWVudCgncmlnaHQnKSwKKworICAgICAgbGVnZW5kID0gbnYubW9kZWxzLmxlZ2VuZCgpLmhlaWdodCgzMCksCisgICAgICBkaXNwYXRjaCA9IGQzLmRpc3BhdGNoKCd0b29sdGlwU2hvdycsICd0b29sdGlwSGlkZScpOworCisgIHZhciBzaG93VG9vbHRpcCA9IGZ1bmN0aW9uKGUsIG9mZnNldEVsZW1lbnQpIHsKKyAgICB2YXIgbGVmdCA9IGUucG9zWzBdICsgKCBvZmZzZXRFbGVtZW50Lm9mZnNldExlZnQgfHwgMCApLAorICAgICAgICB0b3AgPSBlLnBvc1sxXSArICggb2Zmc2V0RWxlbWVudC5vZmZzZXRUb3AgfHwgMCksCisgICAgICAgIHggPSB4QXhpcy50aWNrRm9ybWF0KCkobGluZXMxLngoKShlLnBvaW50LCBlLnBvaW50SW5kZXgpKSwKKyAgICAgICAgeSA9ICgoZS5zZXJpZXMueUF4aXMgPT0gMikgPyB5QXhpczIgOiB5QXhpczEpLnRpY2tGb3JtYXQoKShsaW5lczEueSgpKGUucG9pbnQsIGUucG9pbnRJbmRleCkpLAorICAgICAgICBjb250ZW50ID0gdG9vbHRpcChlLnNlcmllcy5rZXksIHgsI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AgICAgZ0VudGVyLmFwcGVuZCgnZycpLmF0dHIoJ2NsYXNzJywgJ3N0YWNrMldyYXAnKTsKKyAgICAgIGdFbnRlci5hcHBlbmQoJ2cnKS5hdHRyKCdjbGFzcycsICdsZWdlbmRXcmFwJyk7CisKKyAgICAgIHZhciBnID0gd3JhcC5zZWxlY3QoJ2cnKTsKKworICAgICAgaWYgKHNob3dMZWdlbmQpIHsKKyAgICAgICAgbGVnZW5kLndpZHRoKCBhdmFpbGFibGVXaWR0aCAvIDIgKTsKKworICAgICAgICBnLnNlbGVjdCgnLmxlZ2VuZFdyYXAnKQorICAgICAgICAgICAgLmRhdHVtKGRhdGEubWFwKGZ1bmN0aW9uKHNlcmllcykgeyAKKyAgICAgICAgICAgICAgc2VyaWVzLm9yaWdpbmFsS2V5ID0gc2VyaWVzLm9yaWdpbmFsS2V5ID09PSB1bmRlZmluZWQgPyBzZXJpZXMua2V5IDogc2VyaWVzLm9yaWdpbmFsS2V5OworICAgICAgICAgICAgICBzZXJpZXMua2V5ID0gc2VyaWVzLm9yaWdpbmFsS2V5ICsgKHNlcmllcy55QXhpcyA9PSAxID8gJycgOiAnIChyaWdodCBheGlzKScpOworICAgICAgICAgICAgICByZXR1cm4gc2VyaWVzOworICAgICAgICAgICAgfSkpCisgICAgICAgICAgLmNhbGwobGVnZW5kKTsKKworICAgICAgICBpZiAoIG1hcmdpbi50b3AgIT0gbGVnZW5kLmhlaWdodCgpKSB7CisgICAgICAgICAgbWFyZ2luLnRvcCA9IGxlZ2VuZC5oZWlnaHQoKTsKKyAgICAgICAgICBhdmFpbGFibGVIZWlnaHQgPSAoaGVpZ2h0IHx8IHBhcnNlSW50KGNvbnRhaW5lci5zdHlsZSgnaGVpZ2h0JykpIHx8IDQwMCkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLSBtYXJnaW4udG9wIC0gbWFyZ2luLmJvdHRvbTsKKyAgICAgICAgfQorCisgICAgICAgIGcuc2VsZWN0KCcubGVnZW5kV3JhcCcpCisgICAgICAgICAgICAuYXR0cigndHJhbnNmb3JtJywgJ3RyYW5zbGF0ZSgnICsgKCBhdmFpbGFibGVXaWR0aCAvIDIgKSArICcsJyArICgtbWFyZ2luLnRvcCkgKycpJyk7CisgICAgICB9CisKKworICAgICAgbGluZXMxCisgICAgICAgIC53aWR0aChhdmFpbGFibGVXaWR0aCkKKyAgICAgICAgLmhlaWdodChhdmFpbGFibGVIZWlnaHQpCisgICAgICAgIC5pbnRlcnBvbGF0ZSgibW9ub3RvbmUiKQorICAgICAgICAuY29sb3IoZGF0YS5tYXAoZnVuY3Rpb24oZCxpKSB7CisgICAgICAgICAgcmV0dXJuIGQuY29sb3IgfHwgY29sb3JbaSAlIGNvbG9yLmxlbmd0aF07CisgICAgICAgIH0pLmZpbHRlcihmdW5jdGlvbihkLGkpIHsgcmV0dXJuICFkYXRhW2ldLmRpc2FibGVkICYmIGRhdGFbaV0ueUF4aXMgPT0gMSAmJiBkYXRhW2ldLnR5cGUgPT0gJ2xpbmUnfSkpOworCisgICAgICBsaW5lczIKKyAgICAgICAgLndpZHRoKGF2YWlsYWJsZVdpZHRoKQorICAgICAgICAuaGVpZ2h0KGF2YWlsYWJsZUhlaWdodCkKKyAgICAgICAgLmludGVycG9sYXRlKCJtb25vdG9uZSIpCisgICAgICAgIC5jb2xvcihkYXRhLm1hcChmdW5jdGlvbihkLGkpIHsKKyAgICAgICAgICByZXR1cm4gZC5jb2xvciB8fCBjb2xvcltpICUgY29sb3IubGVuZ3RoXTsKKyAgICAgICAgfSkuZmlsdGVyKGZ1bmN0aW9uKGQsaSkgeyByZXR1cm4gIWRhdGFbaV0uZGlzYWJsZWQgJiYgZGF0YVtpXS55QXhpcyA9PSAyICYmIGRhdGFbaV0udHlwZSA9PSAnbGluZSd9KSk7CisKKyAgICAgIGJhcnMxCisgICAgICAgIC53aWR0aChhdmFpbGFibGVXaWR0aCkKKyAgICAgICAgLmhlaWdodChhdmFpbGFibGVIZWlnaHQpCisgICAgICAgIC5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vbWFpbigpKQorICAgICAgYmFyczIueURvbWFpbih5U2NhbGUyLmRvbWFpbigpKQorICAgICAgc3RhY2syLnlEb21haW4oeVNjYWxlMi5kb21haW4oKSkKKworICAgICAgaWYoZGF0YVN0YWNrMS5sZW5ndGgpe2QzLnRyYW5zaXRpb24oc3RhY2sxV3JhcCkuY2FsbChzdGFjazEpO30KKyAgICAgIGlmKGRhdGFTdGFjazIubGVuZ3RoKXtkMy50cmFuc2l0aW9uKHN0YWNrMldyYXApLmNhbGwoc3RhY2syKTt9CisKKyAgICAgIGlmKGRhdGFCYXJzMS5sZW5ndGgpe2QzLnRyYW5zaXRpb24oYmFyczFXcmFwKS5jYWxsKGJhcnMxKTt9CisgICAgICBpZihkYXRhQmFyczIubGVuZ3RoKXtkMy50cmFuc2l0aW9uKGJhcnMyV3JhcCkuY2FsbChiYXJzMik7fQorCisgICAgICBpZihkYXRhTGluZXMxLmxlbmd0aCl7ZDMudHJhbnNpdGlvbihsaW5lczFXcmFwKS5jYWxsKGxpbmVzMSk7fQorICAgICAgaWYoZGF0YUxpbmVzMi5sZW5ndGgpe2QzLnRyYW5zaXRpb24obGluZXMyV3JhcCkuY2FsbChsaW5lczIpO30KKyAgICAgIAorCisKKyAgICAgIHhBeGlzCisgICAgICAgIC50aWNrcyggYXZhaWxhYmxlV2lkdGggLyAxMDAgKQorICAgICAgICAudGlja1NpemUoLWF2YWlsYWJsZUhlaWdodCwgMCk7CisKKyAgICAgIGcuc2VsZWN0KCcueC5heGlzJykKKyAgICAgICAgICAuYXR0cigndHJhbnNmb3JtJywgJ3RyYW5zbGF0ZSgwLCcgKyBhdmFpbGFibGVIZWlnaHQgKyAnKScpOworICAgICAgZDMudHJhbnNpdGlvbihnLnNlbGVjdCgnLnguYXhpcycpKQorICAgICAgICAgIC5jYWxsKHhBeGlzKTsKKworICAgICAgeUF4aXMxCisgICAgICAgIC50aWNrcyggYXZhaWxhYmxlSGVpZ2h0IC8gMzYgKQorICAgICAgICAudGlja1NpemUoIC1hdmFpbGFibGVXaWR0aCwgMCk7CisKKworICAgICAgZDMudHJhbnNpdGlvbihnLnNlbGVjdCgnLnkxLmF4aXMnKSkKKyAgICAgICAgICAuY2FsbCh5QXhpczEpOworCisgICAgICB5QXhpczIKKyAgICAgICAgLnRpY2tzKCBhdmFpbGFibGVIZWlnaHQgLyAzNiApCisgICAgICAgIC50aWNrU2l6ZSggLWF2YWlsYWJsZVdpZHRoLCAwKTsKKworICAgICAgZDMudHJhbnNpdGlvbihnLnNlbGVjdCgnLnkyLmF4aXMnKSkKKyAgICAgICAgICAuY2FsbCh5QXhpczIpOworCisgICAgICBnLnNlbGVjdCgnLnkyLmF4aXMnKQorICAgICAgICAgIC5zdHlsZSgnb3BhY2l0eScsIHNlcmllczIubGVuZ3RoID8gMSA6IDApCisgICAgICAgICAgLmF0dHIoJ3RyYW5zZm9ybScsICd0cmFuc2xhdGUoJyArIHgucmFuZ2UoKVsxXSArICcsMCknKTsKKworICAgICAgbGVnZW5kLmRpc3BhdGNoLm9uKCdsZWdlbmRDbGljaycsIGZ1bmN0aW9uKGQsaSkgeyAKKyAgICAgICAgZC5kaXNhYmxlZCA9ICFkLmRpc2FibGVkOworCQlpZiAoc2VyaWVzMi5sZW5ndGggPD0gMCkgeworICAgICAgICBpZiAoIWRhdGEuZmlsdGVyKGZ1bmN0aW9uKGQpIHsgcmV0dXJuICFkLmRpc2FibGVkIH0pLmxlbmd0aCkgeworICAgICAgICAgIGRhdGEubWFwKGZ1bmN0aW9uKGQpIHsKKyAgICAgICAgICAgIGQuZGlzYWJsZWQgPSBmYWxzZTsKKyAgICAgICAgICAgIHdyYXAuc2VsZWN0QWxsKCcuc2VyaWVzJykuY2xhc3NlZCgnZGlzYWJsZWQnLCBmYWxzZSk7CisgICAgICAgICAgICByZXR1cm4gZDsKKyAgICAgICAgICB9KTsKKyAgICAgICAgfQorICAgICAgICBjaGFydC51cGRhdGUoKTsKKwkJfQorICAgICAgfSk7CisKKyAgICAgIGRpc3Bhd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NzZWQoJ2hvdmVyJywgZmFsc2UpIH0sIDApOworICAgICAgcmV0dXJuIGZhbHNlOworICAgIH0KKworICAgIGUucG9zID0gW2UucG9zWzBdICsgbWFyZ2luLmxlZnQsIGUucG9zWzFdICsgbWFyZ2luLnRvcF0sCisgICAgZGlzcGF0Y2gudG9vbHRpcFNob3coZSk7CisgIH0pOworCisgIHN0YWNrMi5kaXNwYXRjaC5vbigndG9vbHRpcEhpZGUnLCBmdW5jdGlvbihlKSB7CisgICAgZGlzcGF0Y2gudG9vbHRpcEhpZGUoZSk7CisgIH0pOworCisgICAgbGluZXMxLmRpc3BhdGNoLm9uKCdlbGVtZW50TW91c2VvdmVyLnRvb2x0aXAnLCBmdW5jdGlvbihlKSB7CisgICAgZS5wb3MgPSBbZS5wb3NbMF0gKyAgbWFyZ2luLmxlZnQsIGUucG9zWzFdICsgbWFyZ2luLnRvcF07CisgICAgZGlzcGF0Y2gudG9vbHRpcFNob3coZSk7CisgIH0pOworCisgIGxpbmVzMS5kaXNwYXRjaC5vbignZWxlbWVudE1vdXNlb3V0LnRvb2x0aXAnLCBmdW5jdGlvbihlKSB7CisgICAgZGlzcGF0Y2gudG9vbHRpcEhpZGUoZSk7CisgIH0pOworCisgIGxpbmVzMi5kaXNwYXRjaC5vbignZWxlbWVudE1vdXNlb3Zlci50b29sdGlwJywgZnVuY3Rpb24oZSkgeworICAgIGUucG9zID0gW2UucG9zWzBdICsgIG1hcmdpbi5sZWZ0LCBlLnBvc1sxXSArIG1hcmdpbi50b3BdOworICAgIGRpc3BhdGNoLnRvb2x0aXBTaG93KGUpOworICB9KTsKKworICBsaW5lczIuZGlzcGF0Y2gub24oJ2VsZW1lbnRNb3VzZW91dC50b29sdGlwJywgZnVuY3Rpb24oZSkgeworICAgIGRpc3BhdGNoLnRvb2x0aXBIaWRlKGUpOworICB9KTsKKworICBkaXNwYXRjaC5vbigndG9vbHRpcEhpZGUnLCBmdW5jdGlvbigpIHsKKyAgICBpZiAodG9vbHRpcHMpIG52LnRvb2x0aXAuY2xlYW51cCgpOworICB9KTsKKworCisKKyAgLy89PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKyAgLy8gR2xvYmFsIGdldHRlcnMgYW5kIHNldHRlcnMKKyAgLy8tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0KKworICBjaGFydC5kaXNwYXRjaCA9IGRpc3BhdGNoOworICBjaGFydC5saW5lczEgPSBsaW5lczE7CisgIGNoYXJ0LmxpbmVzMiA9IGxpbmVzMjsKKyAgY2hhcnQuYmFyczEgPSBiYXJzMTsKKyAgY2hhcnQuYmFyczIgPSBiYXJzMjsKKyAgY2hhcnQuc3RhY2sxID0gc3RhY2sxOworICBjaGFydC5zdGFjazIgPSBzdGFjazI7CisgIGNoYXJ0LnhBeGlzID0geEF4aXM7CisgIGNoYXJ0LnlBeGlzMSA9IHlBeGlzMTsKKyAgY2hhcnQueUF4aXMyID0geUF4aXMyOworCisgIGNoYXJ0LnggPSBmdW5jdGlvbihfKSB7CisgICAgaWYgKCFhcmd1bWVudHMubGVuZ3RoKSByZXR1cm4gZ2V0WDsKKyAgICBnZXRYID0gXzsKKyAgICBsaW5lczEueChfKTsKKyAgICBiYXJzMS54KF8pOworICAgIHJldHVybiBjaGFydDsKKyAgfTsKKworICBjaGFydC55ID0gZnVuY3Rpb24oXykgeworICAgIGlmICghYXJndW1lbnRzLmxlbmd0aCkgcmV0dXJuIGdldFk7CisgICAgZ2V0WSA9IF87CisgICAgbGluZXMxLnkoXyk7CisgICAgYmFyczEueShfKTsKKyAgICByZXR1cm4gY2hhcnQ7CisgIH07CisKKyAgY2hhcnQubWFyZ2luID0gZnVuY3Rpb24oXykgeworICAgIGlmICghYXJndW1lbnRzLmxlbmd0aCkgcmV0dXJuIG1hcmdpbjsKKyAgICBtYXJnaW4gPSBfOworICAgIHJldHVybiBjaGFydDsKKyAgfTsKKworICBjaGFydC53aWR0aCA9IGZ1bmN0aW9uKF8pIHsKKyAgICBpZiAoIWFyZ3VtZW50cy5sZW5ndGgpIHJldHVybiB3aWR0aDsKKyAgICB3aWR0aCA9IF87CisgICAgcmV0dXJuIGNoYXJ0OworICB9OworCisgIGNoYXJ0LmhlaWdodCA9IGZ1bmN0aW9uKF8pIHsKKyAgICBpZiAoIWFyZ3VtZW50cy5sZW5ndGgpIHJldHVybiBoZWlnaHQ7CisgICAgaGVpZ2h0ID0gXzsKKyAgICByZXR1cm4gY2hhcnQ7CisgIH07CisKKyAgY2hhcnQuY29sb3IgPSBmdW5jdGlvbihfKSB7CisgICAgaWYgKCFhcmd1bWVudHMubGVuZ3RoKSByZXR1cm4gY29sb3I7CisgICAgY29sb3IgPSBfOworICAgIGxlZ2VuZC5jb2xvcihfKTsKKyAgICByZXR1cm4gY2hhcnQ7CisgIH07CisKKyAgY2hhcnQuc2hvd0xlZ2VuZCA9IGZ1bmN0aW9uKF8pIHsKKyAgICBpZiAoIWFyZ3VtZW50cy5sZW5ndGgpIHJldHVybiBzaG93TGVnZW5kOworICAgIHNob3dMZWdlbmQgPSBfOworICAgIHJldHVybiBjaGFydDsKKyAgfTsKKworICBjaGFydC50b29sdGlwcyA9IGZ1bmN0aW9uKF8pIHsKKyAgICBpZiAoIWFyZ3VtZW50cy5sZW5ndGgpIHJldHVybiB0b29sdGlwczsKKyAgICB0b29sdGlwcyA9IF87CisgICAgcmV0dXJuIGNoYXJ0OworICB9OworCisgIGNoYXJ0LnRvb2x0aXBDb250ZW50ID0gZnVuY3Rpb24oXykgeworICAgIGlmICghYXJndW1lbnRzLmxlbmd0aCkgcmV0dXJuIHRvb2x0aXA7CisgICAgdG9vbHRpcCA9IF87CisgICAgcmV0dXJuIGNoYXJ0OworICB9OworCisgIHJldHVybiBjaGFydDsKK30KKworCitudi5tb2RlbHMub2hsY0JhciA9IGZ1bmN0aW9uKCkgeworCisgIC8vPT09PT09P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aW5nIHVwIGEgbGluZSBjaGFydCB3aXRoIGEgYmFyIGNoYXJ0CisgICAgLCBjbGlwRWRnZSA9IHRydWUKKyAgICAsIGNvbG9yID0gbnYudXRpbHMuZGVmYXVsdENvbG9yKCkKKyAgICAsIHhEb21haW4KKyAgICAsIHlEb21haW4KKyAgICAsIGRpc3BhdGNoID0gZDMuZGlzcGF0Y2goJ2NoYXJ0Q2xpY2snLCAnZWxlbWVudENsaWNrJywgJ2VsZW1lbnREYmxDbGljaycsICdlbGVtZW50TW91c2VvdmVyJywgJ2VsZW1lbnRNb3VzZW91dCcpCisgICAgOworCisgIC8vPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisKKyAgLy89PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKyAgLy8gUHJpdmF0ZSBWYXJpYWJsZXMKKyAgLy8tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0KKworICAvL1RPRE86IHN0b3JlIG9sZCBzY2FsZXMgZm9yIHRyYW5zaXRpb25zCisKKyAgLy89PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKworCisgIGZ1bmN0aW9uIGNoYXJ0KHNlbGVjdGlvbikgeworICAgIHNlbGVjdGlvbi5lYWNoKGZ1bmN0aW9uKGRhdGEpIHsKKyAgICAgIHZhciBhdmFpbGFibGVXaWR0aCA9IHdpZHRoIC0gbWFyZ2luLmxlZnQgLSBtYXJnaW4ucmlnaHQsCisgICAgICAgICAgYXZhaWxhYmxlSGVpZ2h0ID0gaGVpZ2h0IC0gbWFyZ2luLnRvcCAtIG1hcmdpbi5ib3R0b20sCisgICAgICAgICAgY29udGFpbmVyID0gZDMuc2VsZWN0KHRoaXMpOworCisKKyAgICAgIC8vLS0tLS0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ZG9tYWluKClbMV0pCisgICAgICAgIHguZG9tYWluKClbMF0gPworICAgICAgICAgICAgeC5kb21haW4oW3guZG9tYWluKClbMF0gLSB4LmRvbWFpbigpWzBdICogMC4wMSwgeC5kb21haW4oKVsxXSArIHguZG9tYWluKClbMV0gKiAwLjAxXSkKKyAgICAgICAgICA6IHguZG9tYWluKFstMSwxXSk7CisKKyAgICAgIGlmICh5LmRvbWFpbigpWzBdID09PSB5LmRvbWFpbigpWzFdKQorICAgICAgICB5LmRvbWFpbigpWzBdID8KKyAgICAgICAgICAgIHkuZG9tYWluKFt5LmRvbWFpbigpWzBdICsgeS5kb21haW4oKVswXSAqIDAuMDEsIHkuZG9tYWluKClbMV0gLSB5LmRvbWFpbigpWzFdICogMC4wMV0pCisgICAgICAgICAgOiB5LmRvbWFpbihbLTEsMV0pOworCisgICAgICAvLy0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLQorCisKKyAgICAgIC8vLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tCisgICAgICAvLyBTZXR1cCBjb250YWluZXJzIGFuZCBza2VsZXRvbiBvZiBjaGFydAorCisgICAgICB2YXIgd3JhcCA9IGQzLnNlbGVjdCh0aGlzKS5zZWxlY3RBbGwoJ2cubnYtd3JhcC5udi1vaGxjQmFyJykuZGF0YShbZGF0YVswXS52YWx1ZXNdKTsKKyAgICAgIHZhciB3cmFwRW50ZXIgPSB3cmFwLmVudGVyKCkuYXBwZW5kKCdnJykuYXR0cignY2xhc3MnLCAnbnZkMyBudi13cmFwIG52LW9obGNCYXInKTsKKyAgICAgIHZhciBkZWZzRW50ZXIgPSB3cmFwRW50ZXIuYXBwZW5kKCdkZWZzJyk7CisgICAgICB2YXIgZ0VudGVyID0gd3JhcEVudGVyLmFwcGVuZCgnZycpOworICAgICAgdmFyIGcgPSB3cmFwLnNlbGVjdCgnZycpOworCisgICAgICBnRW50ZXIuYXBwZW5kKCdnJykuYXR0cignY2xhc3MnLCAnbnYtdGlja3MnKTsKKworICAgICAgd3JhcC5hdHRyKCd0cmFuc2Zvcm0nLCAndHJhbnNsYXRlKCcgKyBtYXJnaW4ubGVmdCArICcsJyArIG1hcmdpbi50b3AgKyAnKScpOworCisgICAgICAvLy0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLQorCisKKyAgICAgIGNvbnRhaW5lcgorICAgICAgICAgIC5vbignY2xpY2snLCBmdW5jdGlvbihkLGkpIHsKKyAgICAgICAgICAgIGRpc3BhdGNoLmNoYXJ0Q2xpY2soeworICAgICAgICAgICAgICAgIGRhdGE6IGQsCisgICAgICAgICAgICAgICAgaW5kZXg6IGksCisgICAgICAgICAgICAgICAgcG9zOiBkMy5ldmVudCwKKyAgICAgICAgICAgICAgICBpZDogaWQKKyAgICAgICAgICAgIH0pOworICAgICAgICAgIH0pOworCisKKyAgICAgIGRlZnNFbnRlci5hcHBlbmQoJ2NsaXBQYXRoJykKKyAgICAgICAgICAuYXR0cignaWQnLCAnbnYtY2hhcnQtY2xpcC1wYXRoLScgKyBpZCkKKyAgICAgICAgLmFwcGVuZCgncmVjdCcpOworCisgICAgICB3cmFwLnNlbGVjdCgnI252LWNoYXJ0LWNsaXAtcGF0aC0nICsgaWQgKyAnIHJlY3QnKQorICAgICAgICAgIC5hdHRyKCd3aWR0aCcsIGF2YWlsYWJsZVdpZHRoKQorICAgICAgICAgIC5hdHRyKCdoZWlnaHQnLCBhdmFpbGFibGVIZWlnaHQpOworCisgICAgICBnICAgLmF0dHIoJ2NsaXAtcGF0aCcsIGNsaXBFZGdlID8gJ3VybCgjbnYtY2hhcnQtY2xpcC1wYXRoLScgKyBpZCArICcpJyA6ICcnKTsKKworCisKKyAgICAgIHZhciB0aWNrcyA9IHdyYXAuc2VsZWN0KCcubnYtdGlja3MnKS5zZWxlY3RBbGwoJy5udi10aWNrJykKKyAgICAgICAgICAuZGF0YShmdW5jdGlvbihkKSB7IHJldHVybiBkIH0pOworCisgICAgICB0aWNrcy5leGl0KCkucmVtb3ZlKCk7CisKKworICAgICAgdmFyIHRpY2tzRW50ZXIgPSB0aWNrcy5lbnRlcigpLmFwcGVuZCgncGF0aCcpCisgICAgICAgICAgLmF0dHIoJ2NsYXNzJywgZnVuY3Rpb24oZCxpLGopIHsgcmV0dXJuIChnZXRPcGVuKGQsaSkgPiBnZXRDbG9zZShkLGkpID8gJ252LXRpY2sgbmVnYXRpdmUnIDogJ252LXRpY2sgcG9zaXRpdmUnKSArICcgbnYtdGljay0nICsgaiArICctJyArIGkgfSkKKyAgICAgICAgICAuYXR0cignZCcsIGZ1bmN0aW9uKGQsaSkgeworICAgICAgICAgICAgdmFyIHcgPSAoYXZhaWxhYmxlV2lkdGggLyBkYXRhWzBdLnZhbHVlcy5sZW5ndGgpICogLjk7CisgICAgICAgICAgICByZXR1cm4gJ20wLDBsMCwnCisgICAgICAgICAgICAgICAgICsgKHkoZ2V0T3BlbihkLGkpKQorICAgICAgICAgICAgICAgICAtIHkoZ2V0SGlnaChkLGkpKSkKKyAgICAgICAgICAgICAgICAgKyAnbCcKKyAgICAgICAgICAgICAgICAgKyAoLXcvMikKKyAgICAgICAgICAgICAgICAgKyAnLDBsJworICAgICAgICAgICAgICAgICArICh3LzIpCisgICAgICAgICAgICAgICAgICsgJywwbDAsJworICAgICAgICAgICAgICAgICArICh5KGdldExvdyhkLGkpKSAtIHkoZ2V0T3BlbihkLGkpKSkKKyAgICAgICAgICAgICAgICAgKyAnbDAsJworICAgICAgICAgICAgICAgICArICh5KGdldENsb3NlKGQsaSkpCisgICAgICAgICAgICAgICAgIC0geShnZXRMb3coZCxpKSkpCisgICAgICAgICAgICAgICAgICsgJ2wnCisgICAgICAgICAgICAgICAgICsgKHcvMikKKyAgICAgICAgICAgICAgICAgKyAnLDBsJworICAgICAgICAgICAgICAgICArICgtdy8yKQorICAgICAgICAgICAgICAgICArICcsMHonOworICAgICAgICAgIH0pCisgICAgICAgICAgLmF0dHIoJ3RyYW5zZm9ybScsIGZ1bmN0aW9uKGQsaSkgeyByZXR1cm4gJ3RyYW5zbGF0ZSgnICsgeChnZXRYKGQsaSkpICsgJywnICsgeShnZXRIaWdoKGQsaSkpICsgJyknOyB9KQorICAgICAgICAgIC8vLmF0dHIoJ2ZpbGwnLCBmdW5jdGlvbihkLGkpIHsgcmV0dXJuIGNvbG9yWzBdOyB9KQorICAgICAgICAgIC8vLmF0dHIoJ3N0cm9rZScsIGZ1bmN0aW9uKGQsaSkgeyByZXR1cm4gY29sb3JbMF07IH0pCisgICAgICAgICAgLy8uYXR0cigneCcsIDAgKQorICAgICAgICAgIC8vLmF0dHIoJ3knLCBmdW5jdGlvbihkLGkpIHsgIHJldHVybiB5KE1hdGgubWF4KDAsIGdldFkoZCxpKSkpIH0pCisgICAgICAgICAgLy8uYXR0cignaGVpZ2h0JywgZnVuY3Rpb24oZCxpKSB7IHJldHVybiBNYXRoLmFicyh5KGdldFkoZCxpKSkgLSB5KDApKSB9KQorICAgICAgICAgIC5vbignbW91c2VvdmVyJywgZnVuY3Rpb24oZCxpKSB7CisgICAgICAgICAgICBkMy5zZWxlY3QodGhpcykuY2xhc3NlZCgnaG92ZXInLCB0cnVlKTsKKyAgICAgICAgICAgIGRpc3BhdGNoLmVsZW1lbnRNb3VzZW92ZXIoeworICAgICAgICAgICAgICAgIHBvaW50OiBkLAorICAgICAgICAgICAgICAgIHNlcmllczogZGF0YVswXSwKKyAgICAgICAgICAgICAgICBwb3M6IFt4KGdldFgoZCxpKSksIHkoZ2V0WShkLGkpKV0sICAvLyBUT0RPOiBGaWd1cmUgb3V0IHdoeSB0aGUgdmFsdWUgYXBwZWFycyB0byBiZSBzaGlmdGVkCisgICAgICAgICAgICAgICAgcG9pbnRJbmRleDogaSwKKyAgICAgICAgICAgICAgICBzZXJpZXNJbmRleDogMCwKKyAgICAgICAgICAgICAgICBlOiBkMy5ldmVudAorICAgICAgICAgICAgfSk7CisKKyAgICAgICAgICB9KQorICAgICAgICAgIC5vbignbW91c2VvdXQnLCBmdW5jdGlvbihkLGkpIHsKKyAgICAgICAgICAgICAgICBkMy5zZWxlY3QodGhpcykuY2xhc3NlZCgnaG92ZXInLCBmYWxzZSk7CisgICAgICAgICAgICAgICAgZGlzcGF0Y2guZWxlbWVudE1vdXNlb3V0KHsKKyAgICAgICAgICAgICAgICAgICAgcG9pbnQ6IGQsCisgICAgICAgICAgICAgICAgICAgIHNlcmllczogZGF0YVswXSwKKyAgICAgICAgICAgICAgICAgICAgcG9pbnRJbmRleDogaSwKKyAgICAgICAgICAgICAgICAgICAgc2VyaWVzSW5kZXg6IDAsCisgICAgICAgICAgICAgICAgICAgIGU6IGQzLmV2ZW50CisgICAgICAgICAgICAgICAgfSk7CisgICAgICAgICAgfSkKKyAgICAgICAgICAub24oJ2NsaWNrJywgZnVuY3Rpb24oZCxpKSB7CisgICAgICAgICAgICAgICAgZGlzcGF0Y2guZWxlbWVudENsaWNrKHsKKyAgICAgICAgICAgICAgICAgICAgLy9sYWJlbDogZFtsYWJlbF0sCisgICAgICAgICAgICAgICAgICAgIHZhbHVlOiBnZXRZKGQsaSksCisgICAgICAgICAgICAgICAgICAgIGRhdGE6IGQsCisgICAgICAgICAgICAgICAgICAgIGluZGV4OiBpLAorICAgICAgICAgICAgICAgICAgICBwb3M6IFt4KGdldFgoZCxpKSksIHkoZ2V0WShkLGkpKV0sCisgICAgICAgICAgICAgICAgICAgIGU6IGQzLmV2ZW50LAorICAgICAgICAgICAgICAgICAgICBpZDogaWQKKyAgICAgICAgICAgICAgICB9KTsKKyAgICAgICAgICAgICAgZDMuZXZlbnQuc3RvcFByb3BhZ2F0aW9uKCk7CisgICAgICAgICAgfSkKKyAgICAgICAgICAub24oJ2RibGNsaWNrJywgZnVuY3Rpb24oZCxpKSB7CisgICAgICAgICAgICAgIGRpc3BhdGNoLmVsZW1lbnREYmxDbGljayh7CisgICAgICAgICAgICAgICAgICAvL2xhYmVsOiBkW2xhYmVsXSwKKyAgICAgICAgICAgICAgICAgIHZhbHVlOiBnZXRZKGQsaSksCisgICAgICAgICAgICAgICAgICBkYXRhOiBkLAorICAgICAgICAgICAgICAgICAgaW5kZXg6IGksCisgICAgICAgICAgICAgICAgICBwb3M6IFt4KGdldFgoZCxpKSksIHkoZ2V0WShkLGkpKV0sCisgICAgICAgICAgICAgICAgICBlOiBkMy5ldmVudCwKKyAgICAgICAgICAgICAgICAgIGlkOiBpZAorICAgICAgICAgICAgICB9KTsKKyAgICAgICAgICAgICAgZDMuZXZlbnQuc3RvcFByb3BhZ2F0aW9uKCk7CisgICAgICAgICAgfSk7CisKKyAgICAgIHRpY2tzCisgICAgICAgICAgLmF0dHIoJ2NsYXNzJywgZnVuY3Rpb24oZCxpLGopIHsgcmV0dXJuIChnZXRPcGVuKGQsaSkgPiBnZXRDbG9zZShkLGkpID8gJ252LXRpY2sgbmVnYXRpdmUnIDogJ252LXRpY2sgcG9zaXRpdmUnKSArICcgbnYtdGljay0nICsgaiArICctJyArIGkgfSkKKyAgICAgIGQzLnRyYW5zaXRpb24odGlja3MpCisgICAgICAgICAgLmF0dHIoJ3RyYW5zZm9ybScsIGZ1bmN0aW9uKGQsaSkgeyByZXR1cm4gJ3RyYW5zbGF0ZSgnICsgeChnZXRYKGQsaSkpICsgJywnICsgeShnZXRIaWdoKGQsaSkpICsgJyknOyB9KQorICAgICAgICAgIC5hdHRyKCdkJywgZnVuY3Rpb24oZCxpKSB7CisgICAgICAgICAgICB2YXIgdyA9IChhdmFpbGFibGVXaWR0aCAvIGRhdGFbMF0udmFsdWVzLmxlbmd0aCkgKiAuOTsKKyAgICAgICAgICAgIHJldHVybiAnbTAsMGwwLCcKKyAgICAgICAgICAgICAgICAgKyAoeShnZXRPcGVuKGQsaSkpCisgICAgICAgICAgICAgICAgIC0geShnZXRIaWdoKGQsaSkpKQorICAgICAgICAgICAgICAgICArICdsJworICAgICAgICAgICAgICAgICArICgtdy8yKQorICAgICAgICAgICAgICAgICArICcsMGwnCisgICAgICAgICAgICAgICAgICsgKHcvMikKKyAgICAgICAgICAgICAgICAgKyAnLDBsMCwnCisgICAgICAgICAgICAgICAgICsgKHkoZ2V0TG93KGQsaSkpCisgICAgICAgICAgICAgICAgIC0geShnZXRPcGVuKGQsaSkpKQorICAgICAgICAgICAgICAgICArICdsMCwnCisgICAgICAgICAgICAgICAgICsgKHkoZ2V0Q2xvc2UoZCxpKSkKKyAgICAgICAgICAgICAgICAgLSB5KGdldExvdyhkLGkpKSkKKyAgICAgICAgICAgICAgICAgKyAnbCcKKyAgICAgICAgICAgICAgICAgKyAody8yKQorICAgICAgICAgICAgICAgICArICcsMGwnCisgICAgICAgICAgICAgICAgICsgKC13LzIpCisgICAgICAgICAgICAgICAgICsgJywweic7CisgICAgICAgICAgfSkKKyAgICAgICAgICAvLy5hdHRyKCd3aWR0aCcsIChhdmFpbGFibGVXaWR0aCAvIGRhdGFbMF0udmFsdWVzLmxlbmd0aCkgKiAuOSApCisKKworICAgICAgLy9kMy50cmFuc2l0aW9uKHRpY2tzKQorICAgICAgICAgIC8vLmF0dHIoJ3knLCBmdW5jdGlvbihkLGkpIHsgIHJldHVybiB5KE1hdGgubWF4KDAsIGdldFkoZCxpKSkpIH0pCisgICAgICAgICAgLy8uYXR0cignaGVpZ2h0JywgZnVuY3Rpb24oZCxpKSB7IHJldHVybiBNYXRoLmFicyh5KGdldFkoZCxpKSkgLSB5KDApKSB9KTsKKyAgICAgICAgICAvLy5vcmRlcigpOyAgLy8gbm90IHN1cmUgaWYgdGhpcyBtYWtlcyBhbnkgc2Vuc2UgZm9yIHRoaXMgbW9kZWwKKworICAgIH0pOworCisgICAgcmV0dXJuIGNoYXJ0OworICB9CisKKworICAvLz09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorICA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gIHJldHVybiBjaGFydDsKKyAgfTsKKworICBjaGFydC54RG9tYWluID0gZnVuY3Rpb24oXykgeworICAgIGlmICghYXJndW1lbnRzLmxlbmd0aCkgcmV0dXJuIHhEb21haW47CisgICAgeERvbWFpbiA9IF87CisgICAgcmV0dXJuIGNoYXJ0OworICB9OworCisgIGNoYXJ0LnlEb21haW4gPSBmdW5jdGlvbihfKSB7CisgICAgaWYgKCFhcmd1bWVudHMubGVuZ3RoKSByZXR1cm4geURvbWFpbjsKKyAgICB5RG9tYWluID0gXzsKKyAgICByZXR1cm4gY2hhcnQ7CisgIH07CisKKyAgY2hhcnQuZm9yY2VYID0gZnVuY3Rpb24oXykgeworICAgIGlmICghYXJndW1lbnRzLmxlbmd0aCkgcmV0dXJuIGZvcmNlWDsKKyAgICBmb3JjZVggPSBfOworICAgIHJldHVybiBjaGFydDsKKyAgfTsKKworICBjaGFydC5mb3JjZVkgPSBmdW5jdGlvbihfKSB7CisgICAgaWYgKCFhcmd1bWVudHMubGVuZ3RoKSByZXR1cm4gZm9yY2VZOworICAgIGZvcmNlWSA9IF87CisgICAgcmV0dXJuIGNoYXJ0OworICB9OworCisgIGNoYXJ0LnBhZERhdGEgPSBmdW5jdGlvbihfKSB7CisgICAgaWYgKCFhcmd1bWVudHMubGVuZ3RoKSByZXR1cm4gcGFkRGF0YTsKKyAgICBwYWREYXRhID0gXzsKKyAgICByZXR1cm4gY2hhcnQ7CisgIH07CisKKyAgY2hhcnQuY2xpcEVkZ2UgPSBmdW5jdGlvbihfKSB7CisgICAgaWYgKCFhcmd1bWVudHMubGVuZ3RoKSByZXR1cm4gY2xpcEVkZ2U7CisgICAgY2xpcEVkZ2UgPSBfOworICAgIHJldHVybiBjaGFydDsKKyAgfTsKKworICBjaGFydC5jb2xvciA9IGZ1bmN0aW9uKF8pIHsKKyAgICBpZiAoIWFyZ3VtZW50cy5sZW5ndGgpIHJldHVybiBjb2xvcjsKKyAgICBjb2xvciA9IG52LnV0aWxzLmdldENvbG9yKF8pOworICAgIHJldHVybiBjaGFydDsKKyAgfTsKKworICBjaGFydC5pZCA9IGZ1bmN0aW9uKF8pIHsKKyAgICBpZiAoIWFyZ3VtZW50cy5sZW5ndGgpIHJldHVybiBpZDsKKyAgICBpZCA9IF87CisgICAgcmV0dXJuIGNoYXJ0OworICB9OworCisgIC8vPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisKKworICByZXR1cm4gY2hhcnQ7Cit9Citudi5tb2RlbHMucGllID0gZnVuY3Rpb24oKSB7CisKKyAgLy89PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKyAgLy8gUHVibGljIFZhcmlhYmxlcyB3aXRoIERlZmF1bHQgU2V0dGluZ3MKKyAgLy8tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0KKworICB2YXIgbWFyZ2luID0ge3RvcDogMCwgcmlnaHQ6IDAsIGJvdHRvbTogMCwgbGVmdDogMH0KKyAgICAsIHdpZHRoID0gNTAwCisgICAgLCBoZWlnaHQgPSA1MDAKKyAgICAsIGdldFZhbHVlcyA9IGZ1bmN0aW9uKGQpIHsgcmV0dXJuIGQudmFsdWVzIH0KKyAgICAsIGdldFggPSBmdW5jdGlvbihkKSB7IHJldHVybiBkLnggfQorICAgICwgZ2V0WSA9IGZ1bmN0aW9uKGQpIHsgcmV0dXJuIGQueSB9CisgICAgLCBnZXREZXNjcmlwdGlvbiA9IGZ1bmN0aW9uKGQpIHsgcmV0dXJuIGQuZGVzY3JpcHRpb24gfQorICAgICwgaWQgPSBNYXRoLmZsb29yKE1hdGgucmFuZG9tKCkgKiAxMDAwMCkgLy9DcmVhdGUgc2VtaS11bmlxdWUgSUQgaW4gY2FzZSB1c2VyIGRvZXNuJ3Qgc2VsZWN0IG9uZQorICAgICwgY29sb3IgPSBudi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S0tLS0tLS0tLS0tLQorCisKKyAgICAgIGNvbnRhaW5lcgorICAgICAgICAgIC5vbignY2xpY2snLCBmdW5jdGlvbihkLGkpIHsKKyAgICAgICAgICAgICAgZGlzcGF0Y2guY2hhcnRDbGljayh7CisgICAgICAgICAgICAgICAgICBkYXRhOiBkLAorICAgICAgICAgICAgICAgICAgaW5kZXg6IGksCisgICAgICAgICAgICAgICAgICBwb3M6IGQzLmV2ZW50LAorICAgICAgICAgICAgICAgICAgaWQ6IGlkCisgICAgICAgICAgICAgIH0pOworICAgICAgICAgIH0pOworCisKKyAgICAgIHZhciBhcmMgPSBkMy5zdmcuYXJjKCkKKyAgICAgICAgICAgICAgICAgIC5vdXRlclJhZGl1cyhhcmNSYWRpdXMpOworCisgICAgICBpZiAoc3RhcnRBbmdsZSkgYXJjLnN0YXJ0QW5nbGUoc3RhcnRBbmdsZSkKKyAgICAgIGlmIChlbmRBbmdsZSkgYXJjLmVuZEFuZ2xlKGVuZEFuZ2xlKTsKKyAgICAgIGlmIChkb251dCkgYXJjLmlubmVyUmFkaXVzKHJhZGl1cyAqIGRvbnV0UmF0aW8pOworCisgICAgICAvLyBTZXR1cCB0aGUgUGllIGNoYXJ0IGFuZCBjaG9vc2UgdGhlIGRhdGEgZWxlbWVudAorICAgICAgdmFyIHBpZSA9IGQzLmxheW91dC5waWUoKQorICAgICAgICAgIC5zb3J0KG51bGwpCisgICAgICAgICAgLnZhbHVlKGZ1bmN0aW9uKGQpIHsgcmV0dXJuIGQuZGlzYWJsZWQgPyAwIDogZ2V0WShkKSB9KTsKKworICAgICAgdmFyIHNsaWNlcyA9IHdyYXAuc2VsZWN0KCcubnYtcGllJykuc2VsZWN0QWxsKCcubnYtc2xpY2UnKQorICAgICAgICAgIC5kYXRhKHBpZSk7CisKKyAgICAgIHNsaWNlcy5leGl0KCkucmVtb3ZlKCk7CisKKyAgICAgIHZhciBhZSA9IHNsaWNlcy5lbnRlcigpLmFwcGVuZCgnZycpCisgICAgICAgICAgICAgIC5hdHRyKCdjbGFzcycsICdudi1zbGljZScpCisgICAgICAgICAgICAgIC5vbignbW91c2VvdmVyJywgZnVuY3Rpb24oZCxpKXsKKyAgICAgICAgICAgICAgICBkMy5zZWxlY3QodGhpcykuY2xhc3NlZCgnaG92ZXInLCB0cnVlKTsKKyAgICAgICAgICAgICAgICBkaXNwYXRjaC5lbGVtZW50TW91c2VvdmVyKHsKKyAgICAgICAgICAgICAgICAgICAgbGFiZWw6IGdldFgoZC5kYXRhKSwKKyAgICAgICAgICAgICAgICAgICAgdmFsdWU6IGdldFkoZC5kYXRhKSwKKyAgICAgICAgICAgICAgICAgICAgcG9pbnQ6IGQuZGF0YSwKKyAgICAgICAgICAgICAgICAgICAgcG9pbnRJbmRleDogaSwKKyAgICAgICAgICAgICAgICAgICAgcG9zOiBbZDMuZXZlbnQucGFnZVgsIGQzLmV2ZW50LnBhZ2VZXSwKKyAgICAgICAgICAgICAgICAgICAgaWQ6IGlkCisgICAgICAgICAgICAgICAgfSk7CisgICAgICAgICAgICAgIH0pCisgICAgICAgICAgICAgIC5vbignbW91c2VvdXQnLCBmdW5jdGlvbihkLGkpeworICAgICAgICAgICAgICAgIGQzLnNlbGVjdCh0aGlzKS5jbGFzc2VkKCdob3ZlcicsIGZhbHNlKTsKKyAgICAgICAgICAgICAgICBkaXNwYXRjaC5lbGVtZW50TW91c2VvdXQoeworICAgICAgICAgICAgICAgICAgICBsYWJlbDogZ2V0WChkLmRhdGEpLAorICAgICAgICAgICAgICAgICAgICB2YWx1ZTogZ2V0WShkLmRhdGEpLAorICAgICAgICAgICAgICAgICAgICBwb2ludDogZC5kYXRhLAorICAgICAgICAgICAgICAgICAgICBpbmRleDogaSwKKyAgICAgICAgICAgICAgICAgICAgaWQ6IGlkCisgICAgICAgICAgICAgICAgfSk7CisgICAgICAgICAgICAgIH0pCisgICAgICAgICAgICAgIC5vbignY2xpY2snLCBmdW5jdGlvbihkLGkpIHsKKyAgICAgICAgICAgICAgICBkaXNwYXRjaC5lbGVtZW50Q2xpY2soeworICAgICAgICAgICAgICAgICAgICBsYWJlbDogZ2V0WChkLmRhdGEpLAorICAgICAgICAgICAgICAgICAgICB2YWx1ZTogZ2V0WShkLmRhdGEpLAorICAgICAgICAgICAgICAgICAgICBwb2ludDogZC5kYXRhLAorICAgICAgICAgICAgICAgICAgICBpbmRleDogaSwKKyAgICAgICAgICAgICAgICAgICAgcG9zOiBkMy5ldmVudCwKKyAgICAgICAgICAgICAgICAgICAgaWQ6IGlkCisgICAgICAgICAgICAgICAgfSk7CisgICAgICAgICAgICAgICAgZDMuZXZlbnQuc3RvcFByb3BhZ2F0aW9uKCk7CisgICAgICAgICAgICAgIH0pCisgICAgICAgICAgICAgIC5vbignZGJsY2xpY2snLCBmdW5jdGlvbihkLGkpIHsKKyAgICAgICAgICAgICAgICBkaXNwYXRjaC5lbGVtZW50RGJsQ2xpY2soeworICAgICAgICAgICAgICAgICAgICBsYWJlbDogZ2V0WChkLmRhdGEpLAorICAgICAgICAgICAgICAgICAgICB2YWx1ZTogZ2V0WShkLmRhdGEpLAorICAgICAgICAgICAgICAgICAgICBwb2ludDogZC5kYXRhLAorICAgICAgICAgICAgICAgICAgICBpbmRleDogaSwKKyAgICAgICAgICAgICAgICAgICAgcG9zOiBkMy5ldmVudCwKKyAgICAgICAgICAgICAgICAgICAgaWQ6IGlkCisgICAgICAgICAgICAgICAgfSk7CisgICAgICAgICAgICAgICAgZDMuZXZlbnQuc3RvcFByb3BhZ2F0aW9uKCk7CisgICAgICAgICAgICAgIH0pOworCisgICAgICAgIHNsaWNlcworICAgICAgICAgICAgLmF0dHIoJ2ZpbGwnLCBmdW5jdGlvbihkLGkpIHsgcmV0dXJuIGNvbG9yKGQsIGkpOyB9KQorICAgICAgICAgICAgLmF0dHIoJ3N0cm9rZScsIGZ1bmN0aW9uKGQsaSkgeyByZXR1cm4gY29sb3IoZCwgaSk7IH0pOworCisgICAgICAgIHZhciBwYXRocyA9IGFlLmFwcGVuZCgncGF0aC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ICAgICAgICAgICBkLmlubmVyUmFkaXVzID0gYXJjUmFkaXVzICsgMTU7IC8vIFNldCBJbm5lciBDb29yZGluYXRlCisgICAgICAgICAgICAgICAgICAgICAgIHZhciByb3RhdGVBbmdsZSA9IChkLnN0YXJ0QW5nbGUgKyBkLmVuZEFuZ2xlKSAvIDIgKiAoMTgwIC8gTWF0aC5QSSk7CisgICAgICAgICAgICAgICAgICAgICAgIGlmICgoZC5zdGFydEFuZ2xlK2QuZW5kQW5nbGUpLzIgPCBNYXRoLlBJKSB7CisgICAgICAgICAgICAgICAgICAgICAgIAkgcm90YXRlQW5nbGUgLT0gOTA7CisgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICAgICAgICAgICAgIAkgcm90YXRlQW5nbGUgKz0gOTA7CisgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuICd0cmFuc2xhdGUoJyArIGxhYmVsc0FyYy5jZW50cm9pZChkKSArICcpIHJvdGF0ZSgnICsgcm90YXRlQW5nbGUgKyAnKSc7CisgICAgICAgICAgICAgICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgICAgICAgICAgICBkLm91dGVyUmFkaXVzID0gcmFkaXVzICsgMTA7IC8vIFNldCBPdXRlciBDb29yZGluYXRlCisgICAgICAgICAgICAgICAgICAgICAgIGQuaW5uZXJSYWRpdXMgPSByYWRpdXMgKyAxNTsgLy8gU2V0IElubmVyIENvb3JkaW5hdGUKKyAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuICd0cmFuc2xhdGUoJyArIGxhYmVsc0FyYy5jZW50cm9pZChkKSArICcpJworICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIH0pOworCisgICAgICAgICAgICAgIGdyb3VwLmFwcGVuZCgncmVjdCcpCisgICAgICAgICAgICAgICAgICAuc3R5bGUoJ3N0cm9rZScsICcjZmZmJykKKyAgICAgICAgICAgICAgICAgIC5zdHlsZSgnZmlsbCcsICcjZmZmJykKKyAgICAgICAgICAgICAgICAgIC5hdHRyKCJyeCIsIDMpCisgICAgICAgICAgICAgICAgICAuYXR0cigicnkiLCAzKTsKKworICAgICAgICAgICAgICBncm91cC5hcHBlbmQoJ3RleHQnKQorICAgICAgICAgICAgICAgICAgLnN0eWxlKCd0ZXh0LWFuY2hvcicsIGxhYmVsU3VuYmVhbUxheW91dCA/ICgoZC5zdGFydEFuZ2xlICsgZC5lbmRBbmdsZSkgLyAyIDwgTWF0aC5QSSA/ICdzdGFydCcgOiAnZW5kJykgOiAnbWlkZGxlJykgLy9jZW50ZXIgdGhlIHRleHQgb24gaXQncyBvcmlnaW4gb3IgYmVnaW4vZW5kIGlmIG9ydGhvZ29uYWwgYWxpZ25lZAorICAgICAgICAgICAgICAgICAgLnN0eWxlKCdmaWxsJywgJyMwMDAnKQorCisKKyAgICAgICAgICB9KTsKKworICAgICAgICAgIHNsaWNlcy5zZWxlY3QoIi5udi1sYWJlbCIpLnRyYW5zaXRpb24oKQorICAgICAgICAgICAgLmF0dHIoJ3RyYW5zZm9ybScsIGZ1bmN0aW9uKGQpIHsKKyAgICAgICAgICAgIAlpZiAobGFiZWxTdW5iZWFtTGF5b3V0KSB7CisgICAgICAgICAgICAgICAgICBkLm91dGVyUmFkaXVzID0gYXJjUmFkaXVzICsgMTA7IC8vIFNldCBPdXRlciBDb29yZGluYXRlCisgICAgICAgICAgICAgICAgICBkLmlubmVyUmFkaXVzID0gYXJjUmFkaXVzICsgMTU7IC8vIFNldCBJbm5lciBDb29yZGluYXRlCisgICAgICAgICAgICAgICAgICB2YXIgcm90YXRlQW5nbGUgPSAoZC5zdGFydEFuZ2xlICsgZC5lbmRBbmdsZSkgLyAyICogKDE4MCAvIE1hdGguUEkpOworICAgICAgICAgICAgICAgICAgaWYgKChkLnN0YXJ0QW5nbGUrZC5lbmRBbmdsZSkvMiA8IE1hdGguUEkpIHsKKyAgICAgICAgICAgICAgICAgICAgcm90YXRlQW5nbGUgLT0gOTA7CisgICAgICAgICAgICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgICAgICAgICByb3RhdGVBbmdsZSArPSA5MDsKKyAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgIHJldHVybiAndHJhbnNsYXRlKCcgKyBsYWJlbHNBcmMuY2VudHJvaWQoZCkgKyAnKSByb3RhdGUoJyArIHJvdGF0ZUFuZ2xlICsgJyknOworICAgICAgICAgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICAgICAgICBkLm91dGVyUmFkaXVzID0gcmFkaXVzICsgMTA7IC8vIFNldCBPdXRlciBDb29yZGluYXRlCisgICAgICAgICAgICAgICAgICBkLmlubmVyUmFkaXVzID0gcmFkaXVzICsgMTU7IC8vIFNldCBJbm5lciBDb29yZGluYXRlCisgICAgICAgICAgICAgICAgICByZXR1cm4gJ3RyYW5zbGF0ZSgnICsgbGFiZWxzQXJjLmNlbnRyb2lkKGQpICsgJyknCisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfSk7CisKKyAgICAgICAgICBzbGljZXMuZWFjaChmdW5jdGlvbihkLCBpKSB7CisgICAgICAgICAgICB2YXIgc2xpY2UgPSBkMy5zZWxlY3QodGhpcyk7CisKKyAgICAgICAgICAgIHNsaWNlCisgICAgICAgICAgICAgIC5zZWxlY3QoIi5udi1sYWJlbCB0ZXh0IikKKyAgICAgICAgICAgICAgICAuc3R5bGUoJ3RleHQtYW5jaG9yJywgbGFiZWxTdW5iZWFtTGF5b3V0ID8gKChkLnN0YXJ0QW5nbGUgKyBkLmVuZEFuZ2xlKSAvIDIgPCBNYXRoLlBJID8gJ3N0YXJ0JyA6ICdlbmQnKSA6ICdtaWRkbGUnKSAvL2NlbnRlciB0aGUgdGV4dCBvbiBpdCdzIG9yaWdpbiBvciBiZWdpbi9lbmQgaWYgb3J0aG9nb25hbCBhbGlnbmVkCisgICAgICAgICAgICAgICAgLnRleHQoZnVuY3Rpb24oZCwgaSkgeworICAgICAgICAgICAgICAgICAgdmFyIHBlcmNlbnQgPSAoZC5lbmRBbmdsZSAtIGQuc3RhcnRBbmdsZSkgLyAoMiAqIE1hdGguUEkpOworICAgICAgICAgICAgICAgICAgcmV0dXJuIChkLnZhbHVlICYmIHBlcmNlbnQgPiBsYWJlbFRocmVzaG9sZCkgPyBnZXRYKGQuZGF0YSkgOiAnJzsKKyAgICAgICAgICAgICAgICB9KTsKKworICAgICAgICAgICAgdmFyIHRleHRCb3ggPSBzbGljZS5zZWxlY3QoJ3RleHQnKS5ub2RlKCkuZ2V0QkJveCgpOworICAgICAgICAgICAgc2xpY2Uuc2VsZWN0KCIubnYtbGFiZWwgcmVjdCIpCisgICAgICAgICAgICAgIC5hdHRyKCJ3aWR0aCIsIHRleHRCb3gud2lkdGggKyAxMCkKKyAgICAgICAgICAgICAgLmF0dHIoImhlaWdodCIsIHRleHRCb3guaGVpZ2h0ICsgMTApCisgICAgICAgICAgICAgIC5hdHRyKCJ0cmFuc2Zvcm0iLCBmdW5jdGlvbigpIHsKKyAgICAgICAgICAgICAgICByZXR1cm4gInRyYW5zbGF0ZSgiICsgW3RleHRCb3gueCAtIDUsIHRleHRCb3gueSAtIDVdICsgIikiOworICAgICAgICAgICAgICB9KTsKKyAgICAgICAgICB9KTsKKyAgICAgICAgfQorCisKKyAgICAgICAgLy8gQ29tcHV0ZXMgdGhlIGFuZ2xlIG9mIGFuIGFyYywgY29udmVydGluZyBmcm9tIHJhZGlhbnMgdG8gZGVncmVlcy4KKyAgICAgICAgZnVuY3Rpb24gYW5nbGUoZCkgeworICAgICAgICAgIHZhciBhID0gKGQuc3RhcnRBbmdsZSArIGQuZW5kQW5nbGUpICogOTAgLyBNYXRoLlBJIC0gOTA7CisgICAgICAgICAgcmV0dXJuIGEgPiA5MCA/IGEgLSAxODAgOiBhOworICAgICAgICB9CisKKyAgICAgICAgZnVuY3Rpb24gYXJjVHdlZW4oYSkgeworICAgICAgICAgIGEuZW5kQW5nbGUgPSBpc05hTihhLmVuZEFuZ2xlKSA/IDAgOiBhLmVuZEFuZ2xlOworICAgICAgICAgIGEuc3RhcnRBbmdsZSA9IGlzTmFOKGEuc3RhcnRBbmdsZSkgPyAwIDogYS5zdGFydEFuZ2xlOworICAgICAgICAgIGlmICghZG9udXQpIGEuaW5uZXJSYWRpdXMgPSAwOworICAgICAgICAgIHZhciBpID0gZDMuaW50ZXJwb2xhdGUodGhpcy5fY3VycmVudCwgYSk7CisgICAgICAgICAgdGhpcy5fY3VycmVudCA9IGkoMCk7CisgICAgICAgICAgcmV0dXJuIGZ1bmN0aW9uKHQpIHsKKyAgICAgICAgICAgIHJldHVybiBhcmMoaSh0KSk7CisgICAgICAgICAgfTsKKyAgICAgICAgfQorCisgICAgICAgIGZ1bmN0aW9uIHR3ZWVuUGllKGIpIHsKKyAgICAgICAgICBiLmlubmVyUmFkaXVzID0gMDsKKyAgICAgICAgICB2YXIgaSA9IGQzLmludGVycG9sYXRlKHtzdGFydEFuZ2xlOiAwLCBlbmRBbmdsZTogMH0sIGIpOworICAgICAgICAgIHJldHVybiBmdW5jdGlvbih0KSB7CisgICAgICAgICAgICAgIHJldHVybiBhcmMoaSh0KSk7CisgICAgICAgICAgfTsKKyAgICAgICAgfQorCisgICAgfSk7CisKKyAgICByZXR1cm4gY2hhcnQ7CisgIH0KKworCisgIC8vPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisgIC8vIEV4cG9zZSBQdWJsaWMgVmFyaWFibGVzCisgIC8vLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tCisKKyAgY2hhcnQuZGlzcGF0Y2ggPSBkaXNwYXRjaDsKKworICBjaGFydC5tYXJnaW4gPSBmdW5jdGlvbihfKSB7CisgICAgaWYgKCFhcmd1bWVudHMubGVuZ3RoKSByZXR1cm4gbWFyZ2luOworICAgIG1hcmdpbi50b3AgIC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worICAgIHJldHVybiBjaGFydDsKKyAgfTsKKworICBjaGFydC5sYWJlbFRocmVzaG9sZCA9IGZ1bmN0aW9uKF8pIHsKKyAgICBpZiAoIWFyZ3VtZW50cy5sZW5ndGgpIHJldHVybiBsYWJlbFRocmVzaG9sZDsKKyAgICBsYWJlbFRocmVzaG9sZCA9IF87CisgICAgcmV0dXJuIGNoYXJ0OworICB9OworICAvLz09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorCisKKyAgcmV0dXJuIGNoYXJ0OworfQorbnYubW9kZWxzLnBpZUNoYXJ0ID0gZnVuY3Rpb24oKSB7CisKKyAgLy89PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKyAgLy8gUHVibGljIFZhcmlhYmxlcyB3aXRoIERlZmF1bHQgU2V0dGluZ3MKKyAgLy8tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0KKworICB2YXIgcGllID0gbnYubW9kZWxzLnBpZSgpCisgICAgLCBsZWdlbmQgPSBudi5tb2RlbHMubGVnZW5kKCkKKyAgICA7CisKKyAgdmFyIG1hcmdpbiA9IHt0b3A6IDMwLCByaWdodDogMjAsIGJvdHRvbTogMjAsIGxlZnQ6IDIwfQorICAgICwgd2lkdGggPSBudWxsCisgICAgLCBoZWlnaHQgPSBudWxsCisgICAgLCBzaG93TGVnZW5kID0gdHJ1ZQorICAgICwgY29sb3IgPSBudi51dGlscy5kZWZhdWx0Q29sb3IoKQorICAgICwgdG9vbHRpcHMgPSB0cnVlCisgICAgLCB0b29sdGlwID0gZnVuY3Rpb24oa2V5LCB5LCBlLCBncmFwaCkgeworICAgICAgICByZXR1cm4gJzxoMz4nICsga2V5ICsgJzwvaDM+JyArCisgICAgICAgICAgICAgICAnPHA+JyArICB5ICsgJzwvcD4nCisgICAgICB9C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YWx1ZSA8IDAgPyAnbicgOiAncycsIG51bGwsIG9mZnNldEVsZW1lbnQpOworICB9OworCisgIC8vPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisKKworICBmdW5jdGlvbiBjaGFydChzZWxlY3Rpb24pIHsKKyAgICBzZWxlY3Rpb24uZWFjaChmdW5jdGlvbihkYXRhKSB7CisgICAgICB2YXIgY29udGFpbmVyID0gZDMuc2VsZWN0KHRoaXMpLAorICAgICAgICAgIHRoYXQgPSB0aGlzOworCisgICAgICB2YXIgYXZhaWxhYmxlV2lkdGggPSAod2lkdGggfHwgcGFyc2VJbnQoY29udGFpbmVyLnN0eWxlKCd3aWR0aCcpKSB8fCA5NjApCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC0gbWFyZ2luLmxlZnQgLSBtYXJnaW4ucmlnaHQsCisgICAgICAgICAgYXZhaWxhYmxlSGVpZ2h0ID0gKGhlaWdodCB8fCBwYXJzZUludChjb250YWluZXIuc3R5bGUoJ2hlaWdodCcpKSB8fCA0MDApCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC0gbWFyZ2luLnRvcCAtIG1hcmdpbi5ib3R0b207CisKKyAgICAgIGNoYXJ0LnVwZGF0ZSA9IGZ1bmN0aW9uKCkgeyBjb250YWluZXIudHJhbnNpdGlvbigpLmNhbGwoY2hhcnQpOyB9OworICAgICAgY2hhcnQuY29udGFpbmVyID0gdGhpczsKKworICAgICAgLy9zZXQgc3RhdGUuZGlzYWJsZWQKKyAgICAgIHN0YXRlLmRpc2FibGVkID0gZGF0YVswXS5tYXAoZnVuY3Rpb24oZCkgeyByZXR1cm4gISFkLmRpc2FibGVkIH0pOworCisgICAgICBpZiAoIWRlZmF1bHRTdGF0ZSkgeworICAgICAgICB2YXIga2V5OworICAgICAgICBkZWZhdWx0U3RhdGUgPSB7fTsKKyAgICAgICAgZm9yIChrZXkgaW4gc3RhdGUpIHsKKyAgICAgICAgICBpZiAoc3RhdGVba2V5XSBpbnN0YW5jZW9mIEFycmF5KQorICAgICAgICAgICAgZGVmYXVsdFN0YXRlW2tleV0gPSBzdGF0ZVtrZXldLnNsaWNlKDApOworICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgIGRlZmF1bHRTdGF0ZVtrZXldID0gc3RhdGVba2V5XTsKKyAgICAgICAgfQorICAgICAgfQorCisgICAgICAvLy0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLQorICAgICAgLy8gRGlzcGxheSBObyBEYXRhIG1lc3NhZ2UgaWYgdGhlcmUncyBub3RoaW5nIHRvIHNob3cuCisKKyAgICAgIGlmICghZGF0YVswXSB8fCAhZGF0YVswXS5sZW5ndGgpIHsKKyAgICAgICAgdmFyIG5vRGF0YVRleHQgPSBjb250YWluZXIuc2VsZWN0QWxsKCcubnYtbm9EYXRhJykuZGF0YShbbm9EYXRhXSk7CisKKyAgICAgICAgbm9EYXRhVGV4dC5lbnRlcigpLmFwcGVuZCgndGV4dCcpCisgICAgICAgICAgLmF0dHIoJ2NsYXNzJywgJ252ZDMgbnYtbm9EYXRhJykKKyAgICAgICAgICAuYXR0cignZHknLCAnLS43ZW0nKQorICAgICAgICAgIC5zdHlsZSgndGV4dC1hbmNob3InLCAnbWlkZGxlJyk7CisKKyAgICAgICAgbm9EYXRhVGV4dAorICAgICAgICAgIC5hdHRyKCd4JywgbWFyZ2luLmxlZnQgKyBhdmFpbGFibGVXaWR0aCAvIDIpCisgICAgICAgICAgLmF0dHIoJ3knLCBtYXJnaW4udG9wICsgYXZhaWxhYmxlSGVpZ2h0IC8gMikKKyAgICAgICAgICAudGV4dChmdW5jdGlvbihkKSB7IHJldHVybiBkIH0pOworCisgICAgICAgIHJldHVybiBjaGFydDsKKyAgICAgIH0gZWxzZSB7CisgICAgICAgIGNvbnRhaW5lci5zZWxlY3RBbGwoJy5udi1ub0RhdGEnKS5yZW1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dlbmRXcmFwJykKKyAgICAgICAgICAgIC5kYXR1bShwaWUudmFsdWVzKCkoZGF0YVswXSkpCisgICAgICAgICAgICAuY2FsbChsZWdlbmQpOworCisgICAgICAgIGlmICggbWFyZ2luLnRvcCAhPSBsZWdlbmQuaGVpZ2h0KCkpIHsKKyAgICAgICAgICBtYXJnaW4udG9wID0gbGVnZW5kLmhlaWdodCgpOworICAgICAgICAgIGF2YWlsYWJsZUhlaWdodCA9IChoZWlnaHQgfHwgcGFyc2VJbnQoY29udGFpbmVyLnN0eWxlKCdoZWlnaHQnKSkgfHwgNDAwKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAtIG1hcmdpbi50b3AgLSBtYXJnaW4uYm90dG9tOworICAgICAgICB9CisKKyAgICAgICAgd3JhcC5zZWxlY3QoJy5udi1sZWdlbmRXcmFwJykKKyAgICAgICAgICAgIC5hdHRyKCd0cmFuc2Zvcm0nLCAndHJhbnNsYXRlKDAsJyArICgtbWFyZ2luLnRvcCkgKycpJyk7CisgICAgICB9CisKKyAgICAgIC8vLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tCisKKworICAgICAgd3JhcC5hdHRyKCd0cmFuc2Zvcm0nLCAndHJhbnNsYXRlKCcgKyBtYXJnaW4ubGVmdCArICcsJyArIG1hcmdpbi50b3AgKyAnKScpOworCisKKyAgICAgIC8vLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tCisgICAgICAvLyBNYWluIENoYXJ0IENvbXBvbmVudChzKQorCisgICAgICBwaWUKKyAgICAgICAgLndpZHRoKGF2YWlsYWJsZVdpZHRoKQorICAgICAgICAuaGVpZ2h0KGF2YWlsYWJsZUhlaWdodCk7CisKKworICAgICAgdmFyIHBpZVdyYXAgPSBnLnNlbGVjdCgnLm52LXBpZVdyYXAnKQorICAgICA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KKworICAgICAgICBjaGFydC51cGRhdGUoKTsKKyAgICAgIH0pOworCisgICAgICBwaWUuZGlzcGF0Y2gub24oJ2VsZW1lbnRNb3VzZW91dC50b29sdGlwJywgZnVuY3Rpb24oZSkgeworICAgICAgICBkaXNwYXRjaC50b29sdGlwSGlkZShlKTsKKyAgICAgIH0pOworCisgICAgICAvLyBVcGRhdGUgY2hhcnQgZnJvbSBhIHN0YXRlIG9iamVjdCBwYXNzZWQgdG8gZXZlbnQgaGFuZGxlcgorICAgICAgZGlzcGF0Y2gub24oJ2NoYW5nZVN0YXRlJywgZnVuY3Rpb24oZSkgeworCisgICAgICAgIGlmICh0eXBlb2YgZS5kaXNhYmxlZCAhPT0gJ3VuZGVmaW5lZCcpIHsKKyAgICAgICAgICBkYXRhWzBdLmZvckVhY2goZnVuY3Rpb24oc2VyaWVzLGkpIHsKKyAgICAgICAgICAgIHNlcmllcy5kaXNhYmxlZCA9IGUuZGlzYWJsZWRbaV07CisgICAgICAgICAgfSk7CisKKyAgICAgICAgICBzdGF0ZS5kaXNhYmxlZCA9IGUuZGlzYWJsZWQ7CisgICAgICAgIH0KKworICAgICAgICBjaGFydC51cGRhdGUoKTsKKyAgICAgIH0pOworCisgICAgICAvLz09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorCisKKyAgICB9KTsKKworICAgIHJldHVybiBjaGFydDsKKyAgfQorCisgIC8vPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisgIC8vIEV2ZW50IEhhbmRsaW5nL0Rpc3BhdGNoaW5nIChvdXQgb2YgY2hhcnQncyBzY29wZSkKKyAgLy8tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0KKworICBwaWUuZGlzcGF0Y2gub24oJ2VsZW1lbnRNb3VzZW92ZXIudG9vbHRpcCcsIGZ1bmN0aW9uKGUpIHsKKyAgICBlLnBvcyA9IFtlLnBvc1swXSArICBtYXJnaW4ubGVmdCwgZS5wb3NbMV0gKyBtYXJnaW4udG9wXTsKKyAgICBkaXNwYXRjaC50b29sdGlwU2hvdyhlKTsKKyAgfSk7CisKKyAgZGlzcGF0Y2gub24oJ3Rvb2x0aXBTaG93JywgZnVuY3Rpb24oZSkgeworICAgIGlmICh0b29sdGlwcykgc2hvd1Rvb2x0aXAoZSk7CisgIH0pOworCisgIGRpc3BhdGNoLm9uKCd0b29sdGlwSGlkZScsIGZ1bmN0aW9uKCkgeworICAgIGlmICh0b29sdGlwcykgbnYudG9vbHRpcC5jbGVhbnVwKCk7CisgIH0pOworCisgIC8vPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisKKworICAvLz09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorICAvLyBFeHBvc2UgUHVibGljIFZhcmlhYmxlcworICAvLy0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLQorCisgIC8vIGV4cG9zZSBjaGFydCdzIHN1Yi1jb21wb25lbnRzCisgIGNoYXJ0LmxlZ2VuZCA9IGxlZ2VuZDsKKyAgY2hhcnQuZGlzcGF0Y2ggPSBkaXNwYXRjaDsKKyAgY2hhcnQucGllID0gcGllOworCisgIGQzLnJlYmluZChjaGFydCwgcGllLCAndmFsdWVGb3JtYXQnLCAndmFsdWVzJywgJ3gnLCAneScsICdkZXNjcmlwdGlvbicsICdpZCcsICdzaG93TGFiZWxzJywgJ2RvbnV0TGFiZWxzT3V0c2lkZScsICdwaWVMYWJlbHNPdXRzaWRlJywgJ2RvbnV0JywgJ2RvbnV0UmF0aW8nLCAnbGFiZWxUaHJlc2hvbGQnKTsKKworICBjaGFydC5tYXJnaW4gPSBmdW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VuZCA9IGZ1bmN0aW9uKF8pIHsKKyAgICBpZiAoIWFyZ3VtZW50cy5sZW5ndGgpIHJldHVybiBzaG93TGVnZW5kOworICAgIHNob3dMZWdlbmQgPSBfOworICAgIHJldHVybiBjaGFydDsKKyAgfTsKKworICBjaGFydC50b29sdGlwcyA9IGZ1bmN0aW9uKF8pIHsKKyAgICBpZiAoIWFyZ3VtZW50cy5sZW5ndGgpIHJldHVybiB0b29sdGlwczsKKyAgICB0b29sdGlwcyA9IF87CisgICAgcmV0dXJuIGNoYXJ0OworICB9OworCisgIGNoYXJ0LnRvb2x0aXBDb250ZW50ID0gZnVuY3Rpb24oXykgeworICAgIGlmICghYXJndW1lbnRzLmxlbmd0aCkgcmV0dXJuIHRvb2x0aXA7CisgICAgdG9vbHRpcCA9IF87CisgICAgcmV0dXJuIGNoYXJ0OworICB9OworCisgIGNoYXJ0LnN0YXRlID0gZnVuY3Rpb24oXykgeworICAgIGlmICghYXJndW1lbnRzLmxlbmd0aCkgcmV0dXJuIHN0YXRlOworICAgIHN0YXRlID0gXzsKKyAgICByZXR1cm4gY2hhcnQ7CisgIH07CisKKyAgY2hhcnQuZGVmYXVsdFN0YXRlID0gZnVuY3Rpb24oXykgeworICAgIGlmICghYXJndW1lbnRzLmxlbmd0aCkgcmV0dXJuIGRlZmF1bHRTdGF0ZTsKKyAgICBkZWZhdWx0U3RhdGUgPSBfOworICAgIHJldHVybiBjaGFydDsKKyAgfTsKKworICBjaGFydC5ub0RhdGEgPSBmdW5jdGlvbihfKSB7CisgICAgaWYgKCFhcmd1bWVudHMubGVuZ3RoKSByZXR1cm4gbm9EYXRhOworICAgIG5vRGF0YSA9IF87CisgICAgcmV0dXJuIGNoYXJ0OworICB9OworCisgIC8vPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisKKworICByZXR1cm4gY2hhcnQ7Cit9CisKK252Lm1vZGVscy5zY2F0dGVyID0gZnVuY3Rpb24oKS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Gk7CisgICAgICAgICAgcmV0dXJuIHBvaW50OworICAgICAgICB9KTsKKyAgICAgICAgcmV0dXJuIHNlcmllczsKKyAgICAgIH0pOworCisgICAgICAvLy0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLQorICAgICAgLy8gU2V0dXAgU2NhbGVzCisKKyAgICAgIC8vIHJlbWFwIGFuZCBmbGF0dGVuIHRoZSBkYXRhIGZvciB1c2UgaW4gY2FsY3VsYXRpbmcgdGhlIHNjYWxlcycgZG9tYWlucworICAgICAgdmFyIHNlcmllc0RhdGEgPSAoeERvbWFpbiAmJiB5RG9tYWluICYmIHNpemVEb21haW4pID8gW10gOiAvLyBpZiB3ZSBrbm93IHhEb21haW4gYW5kIHlEb21haW4gYW5kIHNpemVEb21haW4sIG5vIG5lZWQgdG8gY2FsY3VsYXRlLi4uLiBpZiBTaXplIGlzIGNvbnN0YW50IHJlbWVtYmVyIHRvIHNldCBzaXplRG9tYWluIHRvIHNwZWVkIHVwIHBlcmZvcm1hbmNlCisgICAgICAgICAgICBkMy5tZXJnZSgKKyAgICAgICAgICAgICAgZGF0YS5tYXAoZnVuY3Rpb24oZCkgeworICAgICAgICAgICAgICAgIHJldHVybiBkLnZhbHVlcy5tYXAoZnVuY3Rpb24oZCxpKSB7CisgICAgICAgICAgICAgICAgICByZXR1cm4geyB4OiBnZXRYKGQsaSksIHk6IGdldFkoZCxpKSwgc2l6ZTogZ2V0U2l6ZShkLGkpIH0KKyAgICAgICAgICAgICAgICB9KQorICAgICAgICAgICAgICB9KQorICAgICAgICAgICAgKTsKKworICAgICAgeCAgIC5kb21haW4oeERvbWFpbiB8fCBkMy5leHRlbnQoc2VyaWVzRGF0YS5tYXAoZnVuY3Rpb24oZCkgeyByZXR1cm4gZC54OyB9KS5jb25jYXQoZm9yY2VYKSkpCisKKyAgICAgIGlmIChwYWREYXRhICYmIGRhdGFbMF0pCisgICAgICAgI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CB5LmRvbWFpbigpWzBdID09PSB5LmRvbWFpbigpWzFdKSBzaW5nbGVQb2ludCA9IHRydWU7CisgICAgICBpZiAoeC5kb21haW4oKVswXSA9PT0geC5kb21haW4oKVsxXSkKKyAgICAgICAgeC5kb21haW4oKVswXSA/CisgICAgICAgICAgICB4LmRvbWFpbihbeC5kb21haW4oKVswXSAtIHguZG9tYWluKClbMF0gKiAwLjAxLCB4LmRvbWFpbigpWzFdICsgeC5kb21haW4oKVsxXSAqIDAuMDFdKQorICAgICAgICAgIDogeC5kb21haW4oWy0xLDFdKTsKKworICAgICAgaWYgKHkuZG9tYWluKClbMF0gPT09IHkuZG9tYWluKClbMV0pCisgICAgICAgIHkuZG9tYWluKClbMF0gPworICAgICAgICAgICAgeS5kb21haW4oW3kuZG9tYWluKClbMF0gKyB5LmRvbWFpbigpWzBdICogMC4wMSwgeS5kb21haW4oKVsxXSAtIHkuZG9tYWluKClbMV0gKiAwLjAxXSkKKyAgICAgICAgICA6IHkuZG9tYWluKFstMSwxXSk7CisKKyAgICAgIGlmICggaXNOYU4oeC5kb21haW4oKVswXSkpIHsKKyAgICAgICAgICB4LmRvbWFpbihbLTEsMV0pOworICAgICAgfQorCisgICAgICBpZiAoIGlzTmFOKHkuZG9tYWluKClbMF0pKSB7CisgICAgICAgICAgeS5kb21haW4oWy0xLDFdKTsKKyAgICAgIH0KKworCisgICAgICB4MCA9IHgwIHx8IHg7CisgICAgICB5MCA9IHkwIHx8IHk7CisgICAgICB6MCA9IHowIHx8IHo7CisKKyAgICAgIC8vLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tCisKKworICAgICAgLy8tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0KKyAgICAgIC8vIFNldHVwIGNvbnRhaW5lcnMgYW5kIHNrZWxldG9uIG9mIG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CkKKyAgICAgICAgICAuYXR0cignaGVpZ2h0JywgYXZhaWxhYmxlSGVpZ2h0KTsKKworICAgICAgZyAgIC5hdHRyKCdjbGlwLXBhdGgnLCBjbGlwRWRnZSA/ICd1cmwoI252LWVkZ2UtY2xpcC0nICsgaWQgKyAnKScgOiAnJyk7CisKKworICAgICAgZnVuY3Rpb24gdXBkYXRlSW50ZXJhY3RpdmVMYXllcigpIHsKKworICAgICAgICBpZiAoIWludGVyYWN0aXZlKSByZXR1cm4gZmFsc2U7CisKKyAgICAgICAgdmFyIGV2ZW50RWxlbWVudHM7CisKKyAgICAgICAgdmFyIHZlcnRpY2VzID0gZDMubWVyZ2UoZGF0YS5tYXAoZnVuY3Rpb24oZ3JvdXAsIGdyb3VwSW5kZXgpIHsKKyAgICAgICAgICAgIHJldHVybiBncm91cC52YWx1ZXMKKyAgICAgICAgICAgICAgLm1hcChmdW5jdGlvbihwb2ludCwgcG9pbnRJbmRleCkgeworICAgICAgICAgICAgICAgIC8vICpBZGRpbmcgbm9pc2UgdG8gbWFrZSBkdXBsaWNhdGVzIHZlcnkgdW5saWtlbHkKKyAgICAgICAgICAgICAgICAvLyAqSW5qZWN0aW5nIHNlcmllcyBhbmQgcG9pbnQgaW5kZXggZm9yIHJlZmVyZW5jZQorICAgICAgICAgICAgICAgIC8qICpBZGRpbmcgYSAnaml0dGVyJyB0byB0aGUgcG9pbnRzLCBiZWNhdXNlIHRoZXJlJ3MgYW4gaXNzdWUgaW4gZDMuZ2VvbS52b3Jvbm9pLgorICAgICAgICAgICAgICAgICovCisgICAgICAgICAgICAgICAgdmFyIHBYID0gZ2V0WChwb2ludCxwb2ludEluZGV4KSArIE1hdGgucmFuZG9tKCkgKiAxZS03OworICAgICAgICAgICAgICAgIHZhciBwWSA9IGdldFkocG9pbnQscG9pbnRJbmRleCkgKyBNYXRoLnJhbmRvbSgpICogMWUtNzsKKworICAgICAgICAgICAgICAgIHJldHVybiBbeChwWCksIAorICAgICAgICAgICAgICAgICAgICAgICAgeShwWSksIAorICAgICAgICAgICAgICAgICAgICAgICAgZ3JvdXBJbmRleCwgCisgICAgICAgICAgICAgICAgICAgICAgICBwb2ludEluZGV4LCBwb2ludF07IC8vdGVtcCBoYWNrIHRvIGFkZCBub2lzZSB1bnRpbGwgSSB0aGluayBvZiBhIGJldHRlciB3YXkgc28gdGhlcmUgYXJlIG5vIGR1cGxpY2F0ZXMKKyAgICAgICAgICAgICAgfSkKKyAgICAgICAgICAgICAgLmZpbHRlcihmdW5jdGlvbihwb2ludEFycmF5LCBwb2ludEluZGV4KSB7CisgICAgICAgICAgICAgICAgcmV0dXJuIHBvaW50QWN0aXZlKHBvaW50QXJyYXlbNF0sIHBvaW50SW5kZXgpOyAvLyBJc3N1ZSAjMjM3Li4gbW92ZSBmaWx0ZXIgdG8gYWZ0ZXIgbWFwLCBzbyBwb2ludEluZGV4IGlzIGNvcnJlY3QhCisgICAgICAgICAgICAgIH0pCisgICAgICAgICAgfSkKKyAgICAgICAgKTsKKworCisKKyAgICAgICAgLy9pbmplY3Qgc2VyaWVzIGFuZCBwb2ludCBpbmRleCBmb3IgcmVmZXJlbmNlIGludG8gdm9yb25vaQorICAgICAgICBpZiAodXNlVm9yb25vaSA9PT0gdHJ1ZSkgeworCisgICAgICAgICAgaWYgKGNsaXBWb3Jvbm9pKSB7CisgICAgICAgICAgICB2YXIgcG9pbnRDbGlwc0VudGVyID0gd3JhcC5zZWxlY3QoJ2RlZnMnKS5zZWxlY3RBbGwoJy5udi1wb2ludC1jbGlwcycpCisgICAgICAgICAgICAgICAgLmRhdGEoW2lkXSkKKyAgICAgICAgICAgICAgLmVudGVyKCk7CisKKyAgICAgICAgICAgIHBvaW50Q2xpcHNFbnRlci5hcHBlbmQoJ2NsaXBQYXRoJykKKyAgICAgICAgICAgICAgICAgIC5hdHRyKCdjbGFzcycsICdudi1wb2ludC1jbGlwcycpCisgICAgICAgICAgICAgICAgICAuYXR0cignaWQnLCAnbnYtcG9pbnRzLWNsaXAtJyArIGlkKTsKKworICAgICAgICAgICAgdmFyIHBvaW50Q2xpcHMgPSB3cmFwLnNlbGVjdCgnI252LXBvaW50cy1jbGlwLScgKyBpZCkuc2VsZWN0QWxsKCdjaXJjbGUnKQorICAgICAgICAgICAgICAgIC5kYXRhKHZlcnRpY2VzKTsKKyAgICAgICAgICAgIHBvaW50Q2xpcHMuZW50ZXIoKS5hcHBlbmQoJ2NpcmNsZScpCisgICAgICAgICAgICAgICAgLmF0dHIoJ3InLCBjbGlwUmFkaXVzKTsKKyAgICAgICAgICAgIHBvaW50Q2xpcHMuZXhpdCgpLnJlbW92ZSgpOworICAgICAgICAgICAgcG9pbnRDbGlwcworICAgICAgICAgICAgICAgIC5hdHRyKCdjeCcsIGZ1bmN0aW9uKGQpIHsgcmV0dXJuIGRbMF0gfSkKKyAgICAgICAgICAgICAgICAuYXR0cignY3knLCBmdW5jdGlvbihkKSB7IHJldHVybiBkWzFdIH0pOworCisgICAgICAgICAgICB3cmFwLnNlbGVjdCgnLm52LXBvaW50LXBhdGhzJykKKyAgICAgICAgICAgICAgICAuYXR0cignY2xpcC1wYXRoJywgJ3VybCgjbnYtcG9pbnRzLWNsaXAtJyArIGlkICsgJyknKTsKKyAgICAgICAgICB9CisKKworICAgICAgICAgIGlmKHZlcnRpY2VzLmxlbmd0aCkgeworICAgICAgICAgICAgLy8gSXNzdWUgIzI4MyAtIEFkZGluZyAyIGR1bW15IHBvaW50cyB0byB0aGUgdm9yb25vaSBiL2Mgdm9yb25vaSByZXF1aXJlcyBtaW4gMyBwb2ludHMgdG8gd29yaworICAgICAgICAgICAgdmVydGljZXMucHVzaChbeC5yYW5nZSgpWzBdIC0gMjAsIHkucmFuZ2UoKVswXSAtIDIwLCBudWxsLCBudWxsXSk7CisgICAgICAgICAgICB2ZXJ0aWNlcy5wdXNoKFt4LnJhbmdlKClbMV0gKyAyMCwgeS5yYW5nZSgpWzFdICsgMjAsIG51bGwsIG51bGxdKTsKKyAgICAgICAgICAgIHZlcnRpY2VzLnB1c2goW3gucmFuZ2UoKVswXSAtIDIwLCB5LnJhbmdlKClbMF0gKyAyMCwgbnVsbCwgbnVsbF0pOworICAgICAgICAgICAgdmVydGljZXMucHVzaChbeC5yYW5nZSgpWzFdICsgMjAsIHkucmFuZ2UoKVsxXSAtIDIwLCBudWxsLCBudWxsXSk7CisgICAgICAgICAgfQorCisgICAgICAgICAgdmFyIGJvdW5kcyA9IGQzLmdlb20ucG9seWdvbihbCisgICAgICAgICAgICAgIFstMTAsLTEwXSwKKyAgICAgICAgICAgICAgWy0xMCxoZWlnaHQgKyAxMF0sCisgICAgICAgICAgICAgIFt3aWR0aCArIDEwLGhlaWdodCArIDEwXSwKKyAgICAgICAgICAgICAgW3dpZHRoICsgMTAsLTEwXQorICAgICAgICAgIF0pOworCisgICAgICAgICAgdmFyIHZvcm9ub2kgPSBkMy5nZW9tLnZvcm9ub2kodmVydGljZXMpLm1hcChmdW5jdGlvbihkLCBpKSB7CisgICAgICAgICAgICAgIHJldHVybiB7CisgICAgICAgICAgICAgICAgJ2RhdGEnOiBib3VuZHMuY2xpcChkKSwKKyAgICAgICAgICAgICAgICAnc2VyaWVzJzogdmVydGljZXNbaV1bMl0sCisgICAgICAgICAgICAgICAgJ3BvaW50JzogdmVydGljZXNbaV1bM10KKyAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfSk7CisKKworICAgICAgICAgIHZhciBwb2ludFBhdGhzID0gd3JhcC5zZWxlY3QoJy5udi1wb2ludC1wYXRocycpLnNlbGVjdEFsbCgncGF0aCcpCisgICAgICAgICAgICAgIC5kYXRhKHZvcm9ub2kpOworICAgICAgICAgIHBvaW50UGF0aHMuZW50ZXIoKS5hcHBlbmQoJ3BhdGgnKQorICAgICAgICAgICAgICAuYXR0cignY2xhc3MnLCBmdW5jdGlvbihkLGkpIHsgcmV0dXJuICdudi1wYXRoLScraTsgfSk7CisgICAgICAgICAgcG9pbnRQYXRocy5leGl0KCkucmVtb3ZlKCk7CisgICAgICAgICAgcG9pbnRQYXRocworICAgICAgICAgICAgICAuYXR0cignZCcsIGZ1bmN0aW9uKGQpIHsKKyAgICAgICAgICAgICAgICBpZiAoZC5kYXRhLmxlbmd0aCA9PT0gMCkgCisgICAgICAgICAgICAgICAgICAgIHJldHVybiAnTSAwIDAnCisgICAgICAgICAgICAgICAgZWxzZSAKKyAgICAgICAgICAgICAgICAgICAgcmV0dXJuICdNJyArIGQuZGF0YS5qb2luKCdMJykgKyAnWic7IAorICAgICAgICAgICAgICB9KTsKKworICAgICAgICAgIHBvaW50UGF0aHMKKyAgICAgICAgICAgICAgLm9uKCdjbGljaycsIGZ1bmN0aW9uKGQpIHsKKyAgICAgICAgICAgICAgICBpZiAobmVlZHNVcGRhdGUpIHJldHVybiAwOworICAgICAgICAgICAgICAgIHZhciBzZXJpZXMgPSBkYXRhW2Quc2VyaWVzXSwKKyAgICAgICAgICAgICAgICAgICAgcG9pbnQgID0gc2VyaWVzLnZhbHVlc1tkLnBvaW50XTsKKworICAgICAgICAgICAgICAgIGRpc3BhdGNoLmVsZW1lbnRDbGljayh7CisgICAgICAgICAgICAgICAgICBwb2ludDogcG9pbnQsCisgICAgICAgICAgICAgICAgICBzZXJpZXM6IHNlcmllcywKKyAgICAgICAgICAgICAgICAgIHBvczogW3goZ2V0WChwb2ludCwgZC5wb2ludCkpICsgbWFyZ2luLmxlZnQsIHkoZ2V0WShwb2ludCwgZC5wb2ludCkpICsgbWFyZ2luLnRvcF0sCisgICAgICAgICAgICAgICAgICBzZXJpZXNJbmRleDogZC5zZXJpZXMsCisgICAgICAgICAgICAgICAgICBwb2ludEluZGV4OiBkLnBvaW50CisgICAgICAgICAgICAgICAgfSk7CisgICAgICAgICAgICAgIH0pCisgICAgICAgICAgICAgIC5vbignbW91c2VvdmVyJywgZnVuY3Rpb24oZCkgeworICAgICAgICAgICAgICAgIGlmIChuZWVkc1VwZGF0ZSkgcmV0dXJuIDA7CisgICAgICAgICAgICAgICAgdmFyIHNlcmllcyA9IGRhdGFbZC5zZXJpZXNdLAorICAgICAgICAgICAgICAgICAgICBwb2ludCAgPSBzZXJpZXMudmFsdWVzW2QucG9pbnRdOworCisgICAgICAgICAgICAgICAgZGlzcGF0Y2guZWxlbWVudE1vdXNlb3Zlcih7CisgICAgICAgICAgICAgICAgICBwb2ludDogcG9pbnQsCisgICAgICAgICAgICAgICAgICBzZXJpZXM6IHNlcmllcywKKyAgICAgICAgICAgICAgICAgIHBvczogW3goZ2V0WChwb2ludCwgZC5wb2ludCkpICsgbWFyZ2luLmxlZnQsIHkoZ2V0WShwb2ludCwgZC5wb2ludCkpICsgbWFyZ2luLnRvcF0sCisgICAgICAgICAgICAgICAgICBzZXJpZXNJbmRleDogZC5zZXJpZXMsCisgICAgICAgICAgICAgICAgICBwb2ludEluZGV4OiBkLnBvaW50CisgICAgICAgICAgICAgICAgfSk7CisgICAgICAgICAgICAgIH0pCisgICAgICAgICAgICAgIC5vbignbW91c2VvdXQnLCBmdW5jdGlvbihkLCBpKSB7CisgICAgICAgICAgICAgICAgaWYgKG5lZWRzVXBkYXRlKSByZXR1cm4gMDsKKyAgICAgICAgICAgICAgICB2YXIgc2VyaWVzID0gZGF0YVtkLnNlcmllc10sCisgICAgICAgICAgICAgICAgICAgIHBvaW50ICA9IHNlcmllcy52YWx1ZXNbZC5wb2ludF07CisKKyAgICAgICAgICAgICAgICBkaXNwYXRjaC5lbGVtZW50TW91c2VvdXQoeworICAgICAgICAgICAgICAgICAgcG9pbnQ6IHBvaW50LAorICAgICAgICAgICAgICAgICAgc2VyaWVzOiBzZXJpZXMsCisgICAgICAgICAgICAgICAgICBzZXJpZXNJbmRleDogZC5zZXJpZXMsCisgICAgICAgICAgICAgICAgICBwb2ludEluZGV4OiBkLnBvaW50CisgICAgICAgICAgICAgICAgfSk7CisgICAgICAgICAgICAgIH0pOworCisKKyAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAvKgorICAgICAgICAgIC8vIGJyaW5nIGRhdGEgaW4gZm9ybSBuZWVkZWQgZm9yIGNsaWNrIGhhbmRsZXJzCisgICAgICAgICAgdmFyIGRhdGFXaXRoUG9pbnRzID0gdmVydGljZXMubWFwKGZ1bmN0aW9uKGQsIGkpIHsKKyAgICAgICAgICAgICAgcmV0dXJuIHsKKyAgICAgICAgICAgICAgICAnZGF0YSc6IGQsCisgICAgICAgICAgICAgICAgJ3Nlcmllcyc6IHZlcnRpY2VzW2ldWzJdLAorICAgICAgICAgICAgICAgICdwb2ludCc6IHZlcnRpY2VzW2ldWzNdCisgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0pOworICAgICAgICAgICAqLworCisgICAgICAgICAgLy8gYWRkIGV2ZW50IGhhbmRsZXJzIHRvIHBvaW50cyBpbnN0ZWFkIHZvcm9ub2kgcGF0aHMKKyAgICAgICAgICB3cmFwLnNlbGVjdCgnLm52LWdyb3VwcycpLnNlbGVjdEFsbCgnLm52LWdyb3VwJykKKyAgICAgICAgICAgIC5zZWxlY3RBbGwoJy5udi1wb2ludCcpCisgICAgICAgICAgICAgIC8vLmRhdGEoZGF0YVdpdGhQb2ludHMpCisgICAgICAgICAgICAgIC8vLnN0eWxlKCdwb2ludGVyLWV2ZW50cycsICdhdXRvJykgLy8gcmVjYXRpdmF0ZSBldmVudHMsIGRpc2FibGVkIGJ5IGNzcworICAgICAgICAgICAgICAub24oJ2NsaWNrJywgZnVuY3Rpb24oZCxpKSB7IAorICAgICAgICAgICAgICAgIC8vbnYubG9nKCd0ZXN0JywgZCwgaSk7CisgICAgICAgICAgICAgICAgaWYgKG5lZWRzVXBkYXRlIHx8ICFkYXRhW2Quc2VyaWVzXSkgcmV0dXJuIDA7IC8vY2hlY2sgaWYgdGhpcyBpcyBhIGR1bW15IHBvaW50CisgICAgICAgICAgICAgICAgdmFyIHNlcmllcyA9IGRhdGFbZC5zZXJpZXNdLAorICAgICAgICAgICAgICAgICAgICBwb2ludCAgPSBzZXJpZXMudmFsdWVzW2ldOworCisgICAgICAgICAgICAgICAgZGlzcGF0Y2guZWxlbWVudENsaWNrKHsKKyAgICAgICAgICAgICAgICAgIHBvaW50OiBwb2ludCwKKyAgICAgICAgICAgICAgICAgIHNlcmllczogc2VyaWVzLAorICAgICAgICAgICAgICAgICAgcG9zOiBbeChnZXRYKHBvaW50LCBpKSkgKyBtYXJnaW4ubGVmdCwgeShnZXRZKHBvaW50LCBpKSkgKyBtYXJnaW4udG9wXSwKKyAgICAgICAgICAgICAgICAgIHNlcmllc0luZGV4OiBkLnNlcmllcywKKyAgICAgICAgICAgICAgICAgIHBvaW50SW5kZXg6IGkKKyAgICAgICAgICAgICAgICB9KTsKKyAgICAgICAgICAgICAgfSkKKyAgICAgICAgICAgICAgLm9uKCdtb3VzZW92ZXInLCBmdW5jdGlvbihkLGkpIHsKKyAgICAgICAgICAgICAgICBpZiAobmVlZHNVcGRhdGUgfHwgIWRhdGFbZC5zZXJpZXNdKSByZXR1cm4gMDsgLy9jaGVjayBpZiB0aGlzIGlzIGEgZHVtbXkgcG9pbnQKKyAgICAgICAgICAgICAgICB2YXIgc2VyaWVzID0gZGF0YVtkLnNlcmllc10sCisgICAgICAgICAgICAgICAgICAgIHBvaW50ICA9IHNlcmllcy52YWx1ZXNbaV07CisKKyAgICAgICAgICAgICAgICBkaXNwYXRjaC5lbGVtZW50TW91c2VvdmVyKHsKKyAgICAgICAgICAgICAgICAgIHBvaW50OiBwb2ludCwKKyAgICAgICAgICAgICAgICAgIHNlcmllczogc2VyaWVzLAorICAgICAgICAgICAgICAgICAgcG9zOiBbeChnZXRYKHBvaW50LCBpKSkgKyBtYXJnaW4ubGVmdCwgeShnZXRZKHBvaW50LCBpKSkgKyBtYXJnaW4udG9wXSwKKyAgICAgICAgICAgICAgICAgIHNlcmllc0luZGV4OiBkLnNlcmllcywKKyAgICAgICAgICAgICAgICAgIHBvaW50SW5kZXg6IGkKKyAgICAgICAgICAgICAgICB9KTsKKyAgICAgICAgICAgICAgfSkKKyAgICAgICAgICAgICAgLm9uKCdtb3VzZW91dCcsIGZ1bmN0aW9uKGQsaSkgeworICAgICAgICAgICAgICAgIGlmIChuZWVkc1VwZGF0ZSB8fCAhZGF0YVtkLnNlcmllc10pIHJldHVybiAwOyAvL2NoZWNrIGlmIHRoaXMgaXMgYSBkdW1teSBwb2ludAorICAgICAgICAgICAgICAgIHZhciBzZXJpZXMgPSBkYXRhW2Quc2VyaWVzXSwKKyAgICAgICAgICAgICAgICAgICAgcG9pbnQgID0gc2VyaWVzLnZhbHVlc1tpXTsKKworICAgICAgICAgICAgICAgIGRpc3BhdGNoLmVsZW1lbnRNb3VzZW91dCh7CisgICAgICAgICAgICAgICAgICBwb2ludDogcG9pbnQsCisgICAgICAgICAgICAgICAgICBzZXJpZXM6IHNlcmllcywKKyAgICAgICAgICAgICAgICAgIHNlcmllc0luZGV4OiBkLnNlcmllcywKKyAgICAgICAgICAgICAgICAgIHBvaW50SW5kZXg6IGkKKyAgICAgICAgICAgICAgICB9KTsKKyAgICAgICAgICAgICAgfSk7CisgICAgICAgICAgfQorCisgICAgICAgICAgbmVlZHNVcGRhdGUgPSBmYWxzZTsKKyAgICAgIH0KKworICAgICAgbmVlZHNVcGRhdGUgPSB0cnVlOworCisgICAgICB2YXIgZ3JvdXBzID0gd3JhcC5zZWxlY3QoJy5udi1ncm91cHMnKS5zZWxlY3RBbGwoJy5udi1ncm91cCcpCisgICAgICAgICAgLmRhdGEoZnVuY3Rpb24oZCkgeyByZXR1cm4gZCB9LCBmdW5jdGlvbihkKSB7IHJldHVybiBkLmtleSB9KTsKKyAgICAgIGdyb3Vwcy5lbnRlcigpLmFwcGVuZCgnZycpCisgICAgICAgICAgLnN0eWxlKCdzdHJva2Utb3BhY2l0eScsIDFlLTYpCisgICAgICAgICAgLnN0eWxlKCdmaWxsLW9wYWNpdHknLCAxZS02KTsKKyAgICAgIGQzLnRyYW5zaXRpb24oZ3JvdXBzLmV4aXQoKSkKKyAgICAgICAgICAuc3R5bGUoJ3N0cm9rZS1vcGFjaXR5JywgMWUtNikKKyAgICAgICAgIC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TaXplKGQsaSkpL01hdGguUEkpIH0pOworICAgICAgICBwb2ludHMuZXhpdCgpLnJlbW92ZSgpOworICAgICAgICBncm91cHMuZXhpdCgpLnNlbGVjdEFsbCgncGF0aC5udi1wb2ludCcpLnRyYW5zaXRpb24oKQorICAgICAgICAgICAgLmF0dHIoJ2N4JywgZnVuY3Rpb24oZCxpKSB7IHJldHVybiB4KGdldFgoZCxpKSkgfSkKKyAgICAgICAgICAgIC5hdHRyKCdjeScsIGZ1bmN0aW9uKGQsaSkgeyByZXR1cm4geShnZXRZKGQsaSkpIH0pCisgICAgICAgICAgICAucmVtb3ZlKCk7CisgICAgICAgIHBvaW50cy5lYWNoKGZ1bmN0aW9uKGQsaSkgeworICAgICAgICAgIGQzLnNlbGVjdCh0aGlzKQorICAgICAgICAgICAgLmNsYXNzZWQoJ252LXBvaW50JywgdHJ1ZSkKKyAgICAgICAgICAgIC5jbGFzc2VkKCdudi1wb2ludC0nICsgaSwgdHJ1ZSk7CisgICAgICAgIH0pOworICAgICAgICBwb2ludHMudHJhbnNpdGlvbigpCisgICAgICAgICAgICAuYXR0cignY3gnLCBmdW5jdGlvbihkLGkpIHsgcmV0dXJuIHgoZ2V0WChkLGkpKSB9KQorICAgICAgICAgICAgLmF0dHIoJ2N5JywgZnVuY3Rpb24oZCxpKSB7IHJldHVybiB5KGdldFkoZCxpKSkgfSkKKyAgICAgICAgICAgIC5hdHRyKCdyJywgZnVuY3Rpb24oZCxpKSB7IHJldHVybiBNYXRoLnNxcnQoeihnZXRTaXplKGQsaSkpL01hdGguUEkpIH0pOworCisgICAgICB9IGVsc2UgeworCisgICAgICAgIHZhciBwb2ludHMgPSBncm91cHMuc2VsZWN0QWxsKCdwYXRoLm52LXBvaW50JykKKyAgICAgICAgICAgIC5kYXRhKGZ1bmN0aW9uKGQpIHsgcmV0dXJuIGQudmFsdWVzIH0pOworICAgICAgICBwb2ludHMuZW50ZXIoKS5hcHBlbmQoJ3BhdGgnKQorICAgICAgICAgICAgLmF0dHIoJ3RyYW5zZm9ybScsIGZ1bmN0aW9uKGQsaSkgeworICAgICAgICAgICAgICByZXR1cm4gJ3RyYW5zbGF0ZSgnICsgeDAoZ2V0WChkLGkpKSArICcsJyArIHkwKGdldFkoZCxpKSkgKyAnKScKKyAgICAgICAgICAgIH0pCisgICAgICAgICAgICAuYXR0cignZCcsCisgICAgICAgICAgICAgIGQzLnN2Zy5zeW1ib2woKQorICAgICAgICAgICAgICAgIC50eXBlKGdldFNoYXBlKQorICAgICAgICAgICAgICAgIC5zaXplKGZ1bmN0aW9uKGQsaSkgeyByZXR1cm4geihnZXRTaXplKGQsaSkpIH0pCisgICAgICAgICAgICApOworICAgICAgICBwb2ludHMuZXhpdCgpLnJlbW92ZSgpOworICAgICAgICBkMy50cmFuc2l0aW9uKGdyb3Vwcy5leGl0KCkuc2VsZWN0QWxsKCdwYXRoLm52LXBvaW50JykpCisgICAgICAgICAgICAuYXR0cigndHJhbnNmb3JtJywgZnVuY3Rpb24oZCxpKSB7CisgICAgICAgICAgICAgIHJldHVybiAndHJhbnNsYXRlKCcgKyB4KGdldFgoZCxpKSkgKyAnLCcgKyB5KGdldFkoZCxpKSkgKyAnKScKKyAgICAgICAgICAgIH0pCisgICAgICAgICAgICAucmVtb3ZlKCk7CisgICAgICAgIHBvaW50cy5lYWNoKGZ1bmN0aW9uKGQsaSkgeworICAgICAgICAgIGQzLnNlbGVjdCh0aGlzKQorICAgICAgICAgICAgLmNsYXNzZWQoJ252LXBvaW50JywgdHJ1ZSkKKyAgICAgICAgICAgIC5jbGFzc2VkKCdudi1wb2ludC0nICsgaSwgdHJ1ZSk7CisgICAgICAgIH0pOworICAgICAgICBwb2ludHMudHJhbnNpdGlvbigpCisgICAgICAgICAgICAuYXR0cigndHJhbnNmb3JtJywgZnVuY3Rpb24oZCxpKSB7CisgICAgICAgICAgICAgIC8vbnYubG9nKGQsaSxnZXRYKGQsaSksIHgoZ2V0WChkLGkpKSk7CisgICAgICAgICAgICAgIHJldHVybiAndHJhbnNsYXRlKCcgKyB4KGdldFgoZCxpKSkgKyAnLCcgKyB5KGdldFkoZCxpKSkgKyAnKScKKyAgICAgICAgICAgIH0pCisgICAgICAgICAgICAuYXR0cignZCcsCisgICAgICAgICAgICAgIGQzLnN2Zy5zeW1ib2woKQorICAgICAgICAgICAgICAgIC50eXBlKGdldFNoYXBlKQorICAgICAgICAgICAgICAgIC5zaXplKGZ1bmN0aW9uKGQsaSkgeyByZXR1cm4geihnZXRTaXplKGQsaSkpIH0pCisgICAgICAgICAgICApOworICAgICAgfQorCisKKyAgICAgIC8vIERlbGF5IHVwZGF0aW5nIHRoZSBpbnZpc2libGUgaW50ZXJhY3RpdmUgbGF5ZXIgZm9yIHNtb290aGVyIGFuaW1hdGlvbgorICAgICAgY2xlYXJUaW1lb3V0KHRpbWVvdXRJRCk7IC8vIHN0b3AgcmVwZWF0IGNhbGxzIHRvIHVwZGF0ZUludGVyYWN0aXZlTGF5ZXIKKyAgICAgIHRpbWVvdXRJRCA9IHNldFRpbWVvdXQodXBkYXRlSW50ZXJhY3RpdmVMYXllciwgMzAwKTsKKyAgICAgIC8vdXBkYXRlSW50ZXJhY3RpdmVMYXllcigpOworCisgICAgICAvL3N0b3JlIG9sZCBzY2FsZXMgZm9yIHVzZSBpbiB0cmFuc2l0aW9ucyBvbiB1cGRhdGUKKyAgICAgIHgwID0geC5jb3B5KCk7CisgICAgICB5MCA9IHkuY29weSgpOworICAgICAgejAgPSB6LmNvcHkoKTsKKworICAgIH0pOworCisgICAgcmV0dXJuIGNoYXJ0OworICB9CisKKworICAvLz09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorICAvLyBFdmVudCBIYW5kbGluZy9EaXNwYXRjaGluZyAob3V0IG9mIGNoYXJ0J3Mgc2NvcGUpCisgIC8vLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tCisKKyAgZGlzcGF0Y2gub24oJ2VsZW1lbnRNb3VzZW92ZXIucG9pbnQnLCBmdW5jdGlvbihkKSB7CisgICAgaWYgKGludGVyYWN0aXZlKQorICAgICAgZDMuc2VsZWN0KCcubnYtY2hhcnQtJyArIGlkICsgJyAubnYtc2VyaWVzLScgKyBkLnNlcmllc0luZGV4ICsgJyAubnYtcG9pbnQtJyArIGQucG9pbnRJbmRleCkKKyAgICAgICAgICAuY2xhc3NlZCgnaG92ZXInLCB0cnVlKTsKKyAgfSk7CisKKyAgZGlzcGF0Y2gub24oJ2VsZW1lbnRNb3VzZW91dC5wb2ludCcsIGZ1bmN0aW9uKGQpIHsKKyAgICBpZiAoaW50ZXJhY3RpdmUpCisgICAgICBkMy5zZWxlY3QoJy5udi1jaGFydC0nICsgaWQgKyAnIC5udi1zZXJpZXMtJyArIGQuc2VyaWVzSW5kZXggKyAnIC5udi1wb2ludC0nICsgZC5wb2ludEluZGV4KQorICAgICAgICAgIC5jbGFzc2VkKCdob3ZlcicsIGZhbHNlKTsKKyAgfSk7CisKKyAgLy89PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKworCisgIC8vPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisgIC8vIEV4cG9zZSBQdWJsaWMgVmFyaWFibGVzCisgIC8vLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tCisKKyAgY2hhcnQuZGlzcGF0Y2ggPSBkaXNwYXRjaDsKKworICBjaGFydC54ID0gZnVuY3Rpb24oXykgeworICAgIGlmICghYXJndW1lbnRzLmxlbmd0aCkgcmV0dXJuIGdldFg7CisgICAgZ2V0WCA9IGQzLmZ1bmN0b3IoXyk7CisgICAgcmV0dXJuIGNoYXJ0OworICB9OworCisgIGNoYXJ0LnkgPSBm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kgcmV0dXJuIGhlaWdodDsKKyAgICBoZWlnaHQgPSBfOworICAgIHJldHVybiBjaGFydDsKKyAgfTsKKworICBjaGFydC54U2NhbGUgPSBmdW5jdGlvbihfKSB7CisgICAgaWYgKCFhcmd1bWVudHMubGVuZ3RoKSByZXR1cm4geDsKKyAgICB4ID0gXzsKKyAgICByZXR1cm4gY2hhcnQ7CisgIH07CisKKyAgY2hhcnQueVNjYWxlID0gZnVuY3Rpb24oXykgeworICAgIGlmICghYXJndW1lbnRzLmxlbmd0aCkgcmV0dXJuIHk7CisgICAgeSA9IF87CisgICAgcmV0dXJuIGNoYXJ0OworICB9OworCisgIGNoYXJ0LnpTY2FsZSA9IGZ1bmN0aW9uKF8pIHsKKyAgICBpZiAoIWFyZ3VtZW50cy5sZW5ndGgpIHJldHVybiB6OworICAgIHogPSBfOworICAgIHJldHVybiBjaGFydDsKKyAgfTsKKworICBjaGFydC54RG9tYWluID0gZnVuY3Rpb24oXykgeworICAgIGlmICghYXJndW1lbnRzLmxlbmd0aCkgcmV0dXJuIHhEb21haW47CisgICAgeERvbWFpbiA9IF87CisgICAgcmV0dXJuIGNoYXJ0OworICB9OworCisgIGNoYXJ0LnlEb21haW4gPSBmdW5jdGlvbihfKSB7CisgICAgaWYgKCFhcmd1bWVudHMubGVuZ3RoKSByZXR1cm4geURvbWFpbjsKKyAgICB5RG9tYWluID0gXzsKKyAgICByZXR1cm4gY2hhcnQ7CisgIH07CisKKyAgY2hhcnQuc2l6ZURvbWFpbiA9IGZ1bmN0aW9uKF8pIHsKKyAgICBpZiAoIWFyZ3VtZW50cy5sZW5ndGgpIHJldHVybiBzaXplRG9tYWluOworICAgIHNpemVEb21haW4gPSBfOworICAgIHJldHVybiBjaGFydDsKKyAgfTsKKworICBjaGFydC5zaXplUmFuZ2UgPSBmdW5jdGlvbihfKSB7CisgICAgaWYgKCFhcmd1bWVudHMubGVuZ3RoKSByZXR1cm4gc2l6ZVJhbmdlOworICAgIHNpemVSYW5nZSA9IF87CisgICAgcmV0dXJuIGNoYXJ0OworICB9OworCisgIGNoYXJ0LmZvcmNlWCA9IGZ1bmN0aW9uKF8pIHsKKyAgICBpZiAoIWFyZ3VtZW50cy5sZW5ndGgpIHJldHVybiBmb3JjZVg7CisgICAgZm9yY2VYID0gXzsKKyAgICByZXR1cm4gY2hhcnQ7CisgIH07CisKKyAgY2hhcnQuZm9yY2VZID0gZnVuY3Rpb24oXykgeworICAgIGlmICghYXJndW1lbnRzLmxlbmd0aCkgcmV0dXJuIGZvcmNlWTsKKyAgICBmb3JjZVkgPSBfOworICAgIHJldHVybiBjaGFydDsKKyAgfTsKKworICBjaGFydC5mb3JjZVNpemUgPSBmdW5jdGlvbihfKSB7CisgICAgaWYgKCFhcmd1bWVudHMubGVuZ3RoKSByZXR1cm4gZm9yY2VTaXplOworICAgIGZvcmNlU2l6ZSA9IF87CisgICAgcmV0dXJuIGNoYXJ0OworICB9OworCisgIGNoYXJ0LmludGVyYWN0aXZlID0gZnVuY3Rpb24oXykgeworICAgIGlmICghYXJndW1lbnRzLmxlbmd0aCkgcmV0dXJuIGludGVyYWN0aXZlOworICAgIGludGVyYWN0aXZlID0gXzsKKyAgICByZXR1cm4gY2hhcnQ7CisgIH07CisKKyAgY2hhcnQucG9pbnRLZXkgPSBmdW5jdGlvbihfKSB7CisgICAgaWYgKCFhcmd1bWVudHMubGVuZ3RoKSByZXR1cm4gcG9pbnRLZXk7CisgICAgcG9pbnRLZXkgPSBfOworICAgIHJldHVybiBjaGFydDsKKyAgfTsKKworICBjaGFydC5wb2ludEFjdGl2ZSA9IGZ1bmN0aW9uKF8pIHsKKyAgICBpZiAoIWFyZ3VtZW50cy5sZW5ndGgpIHJldHVybiBwb2ludEFjdGl2ZTsKKyAgICBwb2ludEFjdGl2ZSA9IF87CisgICAgcmV0dXJuIGNoYXJ0OworICB9OworCisgIGNoYXJ0LnBhZERhdGEgPSBmdW5jdGlvbihfKSB7CisgICAgaWYgKCFhcmd1bWVudHMubGVuZ3RoK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HMubGVuZ3RoKSByZXR1cm4gY29sb3I7CisgICAgY29sb3IgPSBudi51dGlscy5nZXRDb2xvcihfKTsKKyAgICByZXR1cm4gY2hhcnQ7CisgIH07CisKKyAgY2hhcnQuc2hhcGUgPSBmdW5jdGlvbihfKSB7CisgICAgaWYgKCFhcmd1bWVudHMubGVuZ3RoKSByZXR1cm4gZ2V0U2hhcGU7CisgICAgZ2V0U2hhcGUgPSBfOworICAgIHJldHVybiBjaGFydDsKKyAgfTsKKworICBjaGFydC5vbmx5Q2lyY2xlcyA9IGZ1bmN0aW9uKF8pIHsKKyAgICBpZiAoIWFyZ3VtZW50cy5sZW5ndGgpIHJldHVybiBvbmx5Q2lyY2xlczsKKyAgICBvbmx5Q2lyY2xlcyA9IF87CisgICAgcmV0dXJuIGNoYXJ0OworICB9OworCisgIGNoYXJ0LmlkID0gZnVuY3Rpb24oXykgeworICAgIGlmICghYXJndW1lbnRzLmxlbmd0aCkgcmV0dXJuIGlkOworICAgIGlkID0gXzsKKyAgICByZXR1cm4gY2hhcnQ7CisgIH07CisKKyAgY2hhcnQuc2luZ2xlUG9pbnQgPSBmdW5jdGlvbihfKSB7CisgICAgaWYgKCFhcmd1bWVudHMubGVuZ3RoKSByZXR1cm4gc2luZ2xlUG9pbnQ7CisgICAgc2luZ2xlUG9pbnQgPSBfOworICAgIHJldHVybiBjaGFydDsKKyAgfTsKKworICAvLz09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorCisKKyAgcmV0dXJuIGNoYXJ0OworfQorCitudi5tb2RlbHMuc2NhdHRlckNoYXJ0ID0gZnVuY3Rpb24oKSB7CisKKyAgLy89PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKyAgLy8gUHVibGljIFZhcmlhYmxlcyB3aXRoIERlZmF1bHQgU2V0dGluZ3MKKyAgLy8tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0KKworICB2YXIgc2NhdHRlciAgICAgID0gbnYubW9kZWxzLnNjYXR0ZXIoKQorICAgICwgeEF4aXMgICAgICAgID0gbnYubW9kZWxzLmF4aXMoKQorICAgICwgeUF4aXMgICAgICAgID0gbnYubW9kZWxzLmF4aXMoKQorICAgICwgbGVnZW5kICAgICAgID0gbnYubW9kZWxzLmxlZ2VuZCgpCisgICAgLCBjb250cm9scyAgICAgPSBudi5tb2RlbHMubGVnZW5kKCkKKyAgICAsIGRpc3RYICAgICAgICA9IG52Lm1vZGVscy5kaXN0cmlidXRpb24oKQorICAgICwgZGlzdFkgICAgICAgID0gbnYubW9kZWxzLmRpc3RyaWJ1dGlvbigpCisgICAgOworCisgIHZhciBtYXJnaW4gICAgICAgPSB7dG9wOiAzMCwgcmlnaHQ6IDIwLCBib3R0b206IDUwLCBsZWZ0OiA3NX0KKyAgICAsIHdpZHRoICAgICAgICA9IG51bGwKKyAgICAsIGhlaWdodCAgICAgICA9IG51bGwKKyAgICAsIGNvbG9yICAgICAgICA9IG52LnV0aWxzLmRlZmF1bHRDb2xvcigpCisgICAgLCB4ICAgICAgICAgICAgPSBkMy5maXNoZXllID8gZDMuZmlzaGV5ZS5zY2FsZShkMy5zY2FsZS5saW5lYXIpLmRpc3RvcnRpb24oMCkgOiBzY2F0dGVyLnhTY2FsZSgpCisgICAgLCB5ICAgICAgICAgICAgPSBkMy5maXNoZXllID8gZDMuZmlzaGV5ZS5zY2FsZShkMy5zY2FsZS5saW5lYXIpLmRpc3RvcnRpb24oMCkgOiBzY2F0dGVyLnlTY2FsZSgpCisgICAgLCB4UGFkZGluZyAgICAgPSAwCisgICAgLCB5UGFkZGluZyAgICAgPSAwCisgICAgLCBzaG93RGlzdFggICAgPSBmYWxzZQorICAgICwgc2hvd0Rpc3RZICAgID0gZmFsc2UKKyAgICAsIHNob3dMZWdlbmQgICA9IHRydWUKKyAgICAsIHNob3dDb250cm9scyA9ICEhZDMuZmlzaGV5ZQorICAgICwgZmlzaGV5ZSAgICAgID0gMAorICAgICwgcGF1c2VGaXNoZXllID0gZmFsc2UKKyAgICAsIHRvb2x0aXBzICAgICA9IHRydWUKKyAgICAsIHRvb2x0aXBYICAgICA9IGZ1bmN0aW9uKGtleSwgeCwgeSkgeyByZXR1cm4gJzxzdHJvbmc+JyArIHggKyAnPC9zdHJvbmc+JyB9CisgICAgLCB0b29sdGlwWSAgICAgPSBmdW5jdGlvbihrZXksIHgsIHkpIHsgcmV0dXJuICc8c3Ryb25nPicgKyB5ICsgJzwvc3Ryb25nPicgfQorICAgIC8vLCB0b29sdGlwICAgICAgPSBmdW5jdGlvbihrZXksIHgsIHkpIHsgcmV0dXJuICc8aDM+JyArIGtleSArICc8L2gzPicgfQorICAgICwgdG9vbHRpcCAgICAgID0gbnVsbAorICAgICwgc3RhdGUgPSB7fQorICAgICwgZGVmYXVsdFN0YXRlID0gbnVsbAorICAgICwgZGlzcGF0Y2ggICAgID0gZDMuZGlzcGF0Y2goJ3Rvb2x0aXBTaG93JywgJ3Rvb2x0aXBIaWRlJywgJ3N0YXRlQ2hhbmdlJywgJ2NoYW5nZVN0YXRlJykKKyAgICAsIG5vRGF0YSAgICAgICA9ICJObyBEYXRhIEF2YWlsYWJsZS4iCisgICAgOworCisgIHNjYXR0ZXIKKyAgICAueFNjYWxlKHgpCisgICAgLnlTY2FsZSh5KQorICAgIDsKKyAgeEF4aXMKKyAgICAub3JpZW50KCdib3R0b20nKQorICAgIC50aWNrUGFkZGluZygxMCkKKyAgICA7CisgIHlBeGlzCisgICAgLm9yaWVudCgnbGVmdCcpCisgICAgLnRpY2tQYWRkaW5nKDEwKQorICAgIDsKKyAgZGlzdFgKKyAgICAuYXhpcygneCcpCisgICAgOworICBkaXN0WQorICAgIC5heGlzKCd5JykKKyAgICA7CisKKyAgLy89PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09P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AgfHwgcGFyc2VJbnQoY29udGFpbmVyLnN0eWxlKCd3aWR0aCcpKSB8fCA5NjApCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC0gbWFyZ2luLmxlZnQgLSBtYXJnaW4ucmlnaHQsCisgICAgICAgICAgYXZhaWxhYmxlSGVpZ2h0ID0gKGhlaWdodCB8fCBwYXJzZUludChjb250YWluZXIuc3R5bGUoJ2hlaWdodCcpKSB8fCA0MDApCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC0gbWFyZ2luLnRvcCAtIG1hcmdpbi5ib3R0b207CisKKyAgICAgIGNoYXJ0LnVwZGF0ZSA9IGZ1bmN0aW9uKCkgeyBjb250YWluZXIudHJhbnNpdGlvbigpLmNhbGwoY2hhcnQpOyB9OworICAgICAgLy8gY2hhcnQuY29udGFpbmVyID0gdGhpczsKKworICAgICAgLy9zZXQgc3RhdGUuZGlzYWJsZWQKKyAgICAgIHN0YXRlLmRpc2FibGVkID0gZGF0YS5tYXAoZnVuY3Rpb24oZCkgeyByZXR1cm4gISFkLmRpc2FibGVkIH0pOworCisgICAgICBpZiAoIWRlZmF1bHRTdGF0ZSkgeworICAgICAgICB2YXIga2V5OworICAgICAgICBkZWZhdWx0U3RhdGUgPSB7fTsKKyAgICAgICAgZm9yIChrZXkgaW4gc3RhdGUpIHsKKyAgICAgICAgICBpZiAoc3RhdGVba2V5XSBpbnN0YW5jZW9mIEFycmF5KQorICAgICAgICAgICAgZGVmYXVsdFN0YXRlW2tleV0gPSBzdGF0ZVtrZXldLnNsaWNlKDApOworICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgIGRlZmF1bHRTdGF0ZVtrZXldID0gc3RhdGVba2V5XTsKKyAgICAgICAgfQorICAgICAgfQorCisgICAgICAvLy0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLQorICAgICAgLy8gRGlzcGxheSBub0RhdGEgbWVzc2FnZS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ScpOworICAgICAgfQorCisgICAgICAvLy0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLQorCisKKyAgICAgIC8vLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tCisgICAgICAvLyBDb250cm9scworCisgICAgICBpZiAoc2hvd0NvbnRyb2xzKSB7CisgICAgICAgIGNvbnRyb2xzLndpZHRoKDE4MCkuY29sb3IoWycjNDQ0J10pOworICAgICAgICBnLnNlbGVjdCgnLm52LWNvbnRyb2xzV3JhcCcpCisgICAgICAgICAgICAuZGF0dW0oY29udHJvbHNEYXRhKQorICAgICAgICAgICAgLmF0dHIoJ3RyYW5zZm9ybScsICd0cmFuc2xhdGUoMCwnICsgKC1tYXJnaW4udG9wKSArJyknKQorICAgICAgICAgICAgLmNhbGwoY29udHJvbHMpOworICAgICAgfQorCisgICAgICAvLy0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLQorCisKKyAgICAgIHdyYXAuYXR0cigndHJhbnNmb3JtJywgJ3RyYW5zbGF0ZSgnICsgbWFyZ2luLmxlZnQgKyAnLCcgKyBtYXJnaW4udG9wICsgJyknKTsKKworCisgICAgICAvLy0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLQorICAgICAgLy8gTWFpbiBDaGFydCBDb21wb25lbnQocykKKworICAgICAgc2NhdHRlcgorICAgICAgICAgIC53aWR0aChhdmFpbGFibGVXaWR0aCkKKyAgICAgICAgICAuaGVpZ2h0KGF2YWlsYWJsZUhlaWdodCkKKyAgICAgICAgICAuY29sb3IoZGF0YS5tYXAoZnVuY3Rpb24oZCxpKSB7CisgICAgICAgICAgICByZXR1cm4gZC5jb2xvciB8fCBjb2xvcihkLCBpKTsKKyAgICAgICAgICB9KS5maWx0ZXIoZnVuY3Rpb24oZCxpKSB7IHJldHVybiAhZGF0YVtpXS5kaXNhYmxlZCB9KSkKKyAgICAgICAgICAueERvbWFpbihudWxsKQorICAgICAgICAgIC55RG9tYWluKG51bGwpCisKKyAgICAgIHdyYXAuc2VsZWN0KCcubnYtc2NhdHRlcldyYXAnKQorICAgICAgICAgIC5kYXR1bShkYXRhLmZpbHRlcihmdW5jdGlvbihkKSB7IHJldHVybiAhZC5kaXNhYmxlZCB9KSkKKyAgICAgICAgICAuY2FsbChzY2F0dGVyKTsKKworCisgICAgICAvL0FkanVzdCBmb3IgeCBhbmQgeSBwYWRkaW5nCisgICAgICBpZiAoeFBhZGRpbmcpIHsKKyAgICAgICAgdmFyIHhSYW5nZSA9IHguZG9tYWluKClbMV0gLSB4LmRvbWFpbigpWzBdOworICAgICAgICBzY2F0dGVyLnhEb21haW4oW3guZG9tYWluKClbMF0gLSAoeFBhZGRpbmcgKiB4UmFuZ2UpLCB4LmRvbWFpbigpWzFdICsgKHhQYWRkaW5nICogeFJhbmdlKV0pOworICAgICAgfQorCisgICAgICBpZiAoeVBhZGRpbmcpIHsKKyAgICAgICAgdmFyIHlSYW5nZSA9IHkuZG9tYWluKClbMV0gLSB5LmRvbWFpbigpWzBdOworICAgICAgICBzY2F0dGVyLnlEb21haW4oW3kuZG9tYWluKClbMF0gLSAoeVBhZGRpbmcgKiB5UmFuZ2UpLCB5LmRvbWFpbigpWzFdICsgKHlQYWRkaW5nICogeVJhbmdlKV0pOworICAgICAgfQorCisgICAgICB3cmFwLnNlbGVjdCgnLm52LXNjYXR0ZXJXcmFwJykKKyAgICAgICAgICAuZGF0dW0oZGF0YS5maWx0ZXIoZnVuY3Rpb24oZCkgeyByZXR1cm4gIWQuZGlzYWJsZWQgfSkpCisgICAgICAgICAgLmNhbGwoc2NhdHRlcik7CisKKyAgICAgIC8vLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tCisKKworICAgICAgLy8tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0KKyAgICAgIC8vIFNldHVwIEF4ZXMKKworICAgICAgeEF4aXMKKyAgICAgICAgICAuc2NhbGUoeCkKKyAgICAgICAgICAudGlja3MoIHhBeGlzLnRpY2tzKCkgJiYgeEF4aXMudGlja3MoKS5sZW5ndGggPyB4QXhpcy50aWNrcygpIDogYXZhaWxhYmxlV2lkdGggLyAxMDAgKQorICAgICAgICAgIC50aWNrU2l6ZSggLWF2YWlsYWJsZUhlaWdodCAsIDApOworCisgICAgICBnLnNlbGVjdCgnLm52LXgubnYtYXhpcycpCisgICAgICAgICAgLmF0dHIoJ3RyYW5zZm9ybScsICd0cmFuc2xhdGUoMCwnICsgeS5yYW5nZSgpWzBdICsgJyknKQorICAgICAgICAgIC5jYWxsKHhBeGlzKTsKKworCisgICAgICB5QXhpcworICAgICAgICAgIC5zY2FsZSh5KQorICAgICAgICAgIC50aWNrcyggeUF4aXMudGlja3MoKSAmJiB5QXhpcy50aWNrcygpLmxlbmd0aCA/IHlBeGlzLnRpY2tzKCkgOiBhdmFpbGFibGVIZWlnaHQgLyAzNiApCisgICAgICAgICAgLnRpY2tTaXplKCAtYXZhaWxhYmxlV2lkdGgsIDApOworCisgICAgICBnLnNlbGVjdCgnLm52LXkubnYtYXhpcycpCisgICAgICAgICAgLmNhbGwoeUF4aXMpOworCisKKyAgICAgIGlmIChzaG93RGlzdFgpIHsKKyAgICAgICAgZGlzdFgKKyAgICAgICAgICAgIC5nZXREYXRhKHNjYXR0ZXIueCgpKQorICAgICAgICAgICAgLnNjYWxlKHgpCisgICAgICAgICAgICAud2lkdGgoYXZhaWxhYmxlV2lkdGgpCisgICAgICAgICAgICAuY29sb3IoZGF0YS5tYXAoZnVuY3Rpb24oZCxpKSB7CisgICAgICAgICAgICAgIHJldHVybiBkLmNvbG9yIHx8IGNvbG9yKGQsIGkpOworICAgICAgICAgICAgfSkuZmlsdGVyKGZ1bmN0aW9uKGQsaSkgeyByZXR1cm4gIWRhdGFbaV0uZGlzYWJsZWQgfSkpOworICAgICAgICBnRW50ZXIuc2VsZWN0KCcubnYtZGlzdFdyYXAnKS5hcHBlbmQoJ2cnKQorICAgICAgICAgICAgLmF0dHIoJ2NsYXNzJywgJ252LWRpc3RyaWJ1dGlvblgnKTsKKyAgICAgICAgZy5zZWxlY3QoJy5udi1kaXN0cmlidXRpb25YJykKKyAgICAgICAgICAgIC5hdHRyKCd0cmFuc2Zvcm0nLCAndHJhbnNsYXRlKDAsJyArIHkucmFuZ2UoKVswXSArICcpJykKKyAgICAgICAgICAgIC5kYXR1bShkYXRhLmZpbHRlcihmdW5jdGlvbihkKSB7IHJldHVybiAhZC5kaXNhYmxlZCB9KSkKKyAgICAgICAgICAgIC5jYWxsKGRpc3RYKTsKKyAgICAgIH0KKworICAgICAgaWYgKHNob3dEaXN0WSkgeworICAgICAgICBkaXN0WQorICAgICAgICAgICAgLmdldERhdGEoc2NhdHRlci55KCkpCisgICAgICAgICAgICAuc2NhbGUoeSkKKyAgICAgICAgICAgIC53aWR0aChhdmFpbGFibGVIZWlnaHQpCisgICAgICAgICAgICAuY29sb3IoZGF0YS5tYXAoZnVuY3Rpb24oZCxpKSB7CisgICAgICAgICAgICAgIHJldHVybiBkLmNvbG9yIHx8IGNvbG9yKGQsIGkpOworICAgICAgICAgICAgfSkuZmlsdGVyKGZ1bmN0aW9uKGQsaSkgeyByZXR1cm4gIWRhdGFbaV0uZGlzYWJsZWQgfSkpOworICAgICAgICBnRW50ZXIuc2VsZWN0KCcubnYtZGlzdFdyYXAnKS5hcHBlbmQoJ2cnKQorICAgICAgICAgICAgLmF0dHIoJ2NsYXNzJywgJ252LWRpc3RyaWJ1dGlvblknKTsKKyAgICAgICAgZy5zZWxlY3QoJy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gncG9pbnRlci1ldmVudHMnLCAnYWxsJyk7CisgICAgICAgICAgcmV0dXJuIGZhbHNlOworICAgICAgICB9CisKKyAgICAgICAgZy5zZWxlY3QoJy5udi1wb2ludC1wYXRocycpLnN0eWxlKCdwb2ludGVyLWV2ZW50cycsICdub25lJyApOworCisgICAgICAgIHZhciBtb3VzZSA9IGQzLm1vdXNlKHRoaXMpOworICAgICAgICB4LmRpc3RvcnRpb24oZmlzaGV5ZSkuZm9jdXMobW91c2VbMF0pOworICAgICAgICB5LmRpc3RvcnRpb24oZmlzaGV5ZSkuZm9jdXMobW91c2VbMV0pOworCisgICAgICAgIGcuc2VsZWN0KCcubnYtc2NhdHRlcldyYXAnKQorICAgICAgICAgICAgLmNhbGwoc2NhdHRlcik7CisKKyAgICAgICAgZy5zZWxlY3QoJy5udi14Lm52LWF4aXMnKS5jYWxsKHhBeGlzKTsKKyAgICAgICAgZy5zZWxlY3QoJy5udi15Lm52LWF4aXMnKS5jYWxsKHlBeGlzKTsKKyAgICAgICAgZy5zZWxlY3QoJy5udi1kaXN0cmlidXRpb25YJykKKyAgICAgICAgICAgIC5kYXR1bShkYXRhLmZpbHRlcihmdW5jdGlvbihkKSB7IHJldHVybiAhZC5kaXNhYmxlZCB9KSkKKyAgICAgICAgICAgIC5jYWxsKGRpc3RYKTsKKyAgICAgICAgZy5zZWxlY3QoJy5udi1kaXN0cmlidXRpb25ZJykKKyAgICAgICAgICAgIC5kYXR1bShkYXRhLmZpbHRlcihmdW5jdGlvbihkKSB7IHJldHVybiAhZC5kaXNhYmxlZCB9KSkKKyAgICAgICAgICAgIC5jYWxsKGRpc3RZKTsKKyAgICAgIH0KKworCisKKyAgICAgIC8vPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisgICAgICAvLyBFdmVudCBIYW5kbGluZy9EaXNwYXRjaGluZyAoaW4gY2hhcnQncyBzY29wZSkKKyAgICAgIC8vLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tCisKKyAgICAgIGNvbnRyb2xzLmRpc3BhdGNoLm9uKCdsZWdlbmRDbGljaycsIGZ1bmN0aW9uKGQsaSkgeworICAgICAgICBkLmRpc2FibGVkID0gIWQuZGlzYWJsZWQ7CisKKyAgICAgICAgZmlzaGV5ZSA9IGQuZGlzYWJsZWQgPyAwIDogMi41OworICAgICAgICBnLnNlbGVjdCgnLm52LWJhY2tncm91bmQnKSAuc3R5bGUoJ3BvaW50ZXItZXZlbnRzJywgZC5kaXNhYmxlZCA/ICdub25lJyA6ICdhbGwnKTsKKyAgICAgICAgZy5zZWxlY3QoJy5udi1wb2ludC1wYXRocycpLnN0eWxlKCdwb2ludGVyLWV2ZW50cycsIGQuZGlzYWJsZWQgPyAnYWxsJyA6ICdub25lJyApOworCisgICAgICAgIGlmIChkLmRpc2FibGVkKSB7CisgICAgICAgICAgeC5kaXN0b3J0aW9uKGZpc2hleWUpLmZvY3VzKDApOworICAgICAgICAgIHkuZGlzdG9ydGlvbihmaXNoZXllKS5mb2N1cygwKTsKKworICAgICAgICAgIGcuc2VsZWN0KCcubnYtc2NhdHRlcldyYXAnKS5jYWxsKHNjYXR0ZXIpOworICAgICAgICAgIGcuc2VsZWN0KCcubnYteC5udi1heGlzJykuY2FsbCh4QXhpcyk7CisgICAgICAgICAgZy5zZWxlY3QoJy5udi15Lm52LWF4aXMnKS5jYWxsKHlBeGlzKTsKKyAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICBwYXVzZUZpc2hleWUgPSBmYWxzZTsKKyAgICAgICAgfQorCisgICAgICAgIGNoYXJ0LnVwZGF0ZSgpOworICAgICAgfSk7CisKKyAgICAgIGxlZ2VuZC5kaXNwYXRjaC5vbignbGVnZW5kQ2xpY2snLCBmdW5jdGlvbihkLGksIHRoYXQpIHsKKyAgICAgICAgZC5kaXNhYmxlZCA9ICFkLmRpc2FibGVkOworCisgICAgICAgIGlmICghZGF0YS5maWx0ZXIoZnVuY3Rpb24oZCkgeyByZXR1cm4gIWQuZGlzYWJsZWQgfSkubGVuZ3RoKSB7CisgICAgICAgICAgZGF0YS5tYXAoZnVuY3Rpb24oZCkgeworICAgICAgICAgICAgZC5kaXNhYmxlZCA9IGZhbHNlOworICAgICAgICAgICAgd3JhcC5zZWxlY3RBbGwoJy5udi1zZXJpZXMnKS5jbGFzc2VkKCdkaXNhYmxlZCcsIGZhbHNlKTsKKyAgICAgICAgICAgIHJldHVybiBkOworICAgICAgICAgIH0pOworICAgICAgICB9CisKKyAgICAgICAgc3RhdGUuZGlzYWJsZWQgPSBkYXRhLm1hcChmdW5jdGlvbihkKSB7IHJldHVybiAhIWQuZGlzYWJsZWQgfSk7CisgICAgICAgIGRpc3BhdGNoLnN0YXRlQ2hhbmdlKHN0YXRlKTsKKworICAgICAgICBjaGFydC51cGRhdGUoKTsKKyAgICAgIH0pOworCisgICAgICBsZWdlbmQuZGlzcGF0Y2gub24oJ2xlZ2VuZERibGNsaWNrJywgZnVuY3Rpb24oZCkgeworICAgICAgICAgIC8vRG91YmxlIGNsaWNraW5nIHNob3VsZCBhbHdheXMgZW5hYmxlIGN1cnJlbnQgc2VyaWVzLCBhbmQgZGlzYWJsZWQgYWxsIG90aGVycy4KKyAgICAgICAgICBkYXRhLmZvckVhY2goZnVuY3Rpb24oZCkgeworICAgICAgICAgICAgIGQuZGlzYWJsZWQgPSB0cnVlOworICAgICAgICAgIH0pOworICAgICAgICAgIGQuZGlzYWJsZWQgPSBmYWxzZTsgIAorCisgICAgICAgICAgc3RhdGUuZGlzYWJsZWQgPSBkYXRhLm1hcChmdW5jdGlvbihkKSB7IHJldHVybiAhIWQuZGlzYWJsZWQgfSk7CisgICAgICAgICAgZGlzcGF0Y2guc3RhdGVDaGFuZ2Uoc3RhdGUpOworICAgICAgICAgIGNoYXJ0LnVwZGF0ZSgpOworICAgICAgfSk7CisKKworICAgICAgLyoKKyAgICAgIGxlZ2VuZC5kaXNwYXRjaC5vbignbGVnZW5kTW91c2VvdmVyJywgZnVuY3Rpb24oZCwgaSkgeworICAgICAgICBkLmhvdmVyID0gdHJ1ZTsKKyAgICAgICAgY2hhcnQoc2VsZWN0aW9uKTsKKyAgICAgIH0pOworCisgICAgICBsZWdlbmQuZGlzcGF0Y2gub24oJ2xlZ2VuZE1vdXNlb3V0JywgZnVuY3Rpb24oZCwgaSkgeworICAgICAgICBkLmhvdmVyID0gZmFsc2U7CisgICAgICAgIGNoYXJ0KHNlbGVjdGlvbik7CisgICAgICB9KTsKKyAgICAgICovCisKKyAgICAgIHNjYXR0ZXIuZGlzcGF0Y2gub24oJ2VsZW1lbnRNb3VzZW92ZXIudG9vbHRpcCcsIGZ1bmN0aW9uKGUpIHsKKyAgICAgICAgZDMuc2VsZWN0KCcubnYtY2hhcnQtJyArIHNjYXR0ZXIuaWQoKSArICcgLm52LXNlcmllcy0nICsgZS5zZXJpZXNJbmRleCArICcgLm52LWRpc3R4LScgKyBlLnBvaW50SW5kZXgpCisgICAgICAgICAgICAuYXR0cigneTEnLCBmdW5jdGlvbihkLGkpIHsgcmV0dXJuIGUucG9zWzFdIC0gYXZhaWxhYmxlSGVpZ2h0O30pOworICAgICAgICBkMy5zZWxlY3QoJy5udi1jaGFydC0nICsgc2NhdHRlci5pZCgpICsgJyAubnYtc2VyaWVzLScgKyBlLnNlcmllc0luZGV4ICsgJyAubnYtZGlzdHktJyArIGUucG9pbnRJbmRleCkKKyAgICAgICAgICAgIC5hdHRyKCd4MicsIGUucG9zWzBdICsgZGlzdFguc2l6ZSgpKTsKKworICAgICAgICBlLnBvcyA9IFtlLnBvc1swXSArIG1hcmdpbi5sZWZ0LCBlLnBvc1sxXSArIG1hcmdpbi50b3BdOworICAgICAgICBkaXNwYXRjaC50b29sdGlwU2hvdyhlKTsKKyAgICAgIH0pOworCisgICAgICBkaXNwYXRjaC5vbigndG9vbHRpcFNob3cnLCBmdW5jdGlvbihlKSB7CisgICAgICAgIGlmICh0b29sdGlwcykgc2hvd1Rvb2x0aXAoZSwgdGhhdC5wYXJlbnROb2RlKTsKKyAgICAgIH0pOworCisgICAgICAvLyBVcGRhdGUgY2hhcnQgZnJvbSBhIHN0YXRlIG9iamVjdCBwYXNzZWQgdG8gZXZlbnQgaGFuZGxlcgorICAgICAgZGlzcGF0Y2gub24oJ2NoYW5nZVN0YXRlJywgZnVuY3Rpb24oZSkgeworCisgICAgICAgIGlmICh0eXBlb2YgZS5kaXNhYmxlZCAhPT0gJ3VuZGVmaW5lZCcpIHsKKyAgICAgICAgICBkYXRhLmZvckVhY2goZnVuY3Rpb24oc2VyaWVzLGkpIHsKKyAgICAgICAgICAgIHNlcmllcy5kaXNhYmxlZCA9IGUuZGlzYWJsZWRbaV07CisgICAgICAgICAgfSk7CisKKyAgICAgICAgICBzdGF0ZS5kaXNhYmxlZCA9IGUuZGlzYWJsZWQ7CisgICAgICAgIH0KKworICAgICAgICBjaGFydC51cGRhdGUoKTsKKyAgICAgIH0pOworCisgICAgICAvLz09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorCisKKyAgICAgIC8vc3RvcmUgb2xkIHNjYWxlcyBmb3IgdXNlIGluIHRyYW5zaXRpb25zIG9uIHVwZGF0ZQorICAgICAgeDAgPSB4LmNvcHkoKTsKKyAgICAgIHkwID0geS5jb3B5KCk7CisKKworICAgIH0pOworCisgICAgcmV0dXJuIGNoYXJ0OworICB9CisKKworICAvLz09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorICAvLyBFdmVudCBIYW5kbGluZy9EaXNwYXRjaGluZyAob3V0IG9mIGNoYXJ0J3Mgc2NvcGUpCisgIC8vLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tCisKKyAgc2NhdHRlci5kaXNwYXRjaC5vbignZWxlbWVudE1vdXNlb3V0LnRvb2x0aXAnLCBmdW5jdGlvbihlKSB7CisgICAgZGlzcGF0Y2gudG9vbHRpcEhpZGUoZSk7CisKKyAgICBkMy5zZWxlY3QoJy5udi1jaGFydC0nICsgc2NhdHRlci5pZCgpICsgJyAubnYtc2VyaWVzLScgKyBlLnNlcmllc0luZGV4ICsgJyAubnYtZGlzdHgtJyArIGUucG9pbnRJbmRleCkKKyAgICAgICAgLmF0dHIoJ3kxJywgMCk7CisgICAgZDMuc2VsZWN0KCcubnYtY2hhcnQtJyArIHNjYXR0ZXIuaWQoKSArICcgLm52LXNlcmllcy0nICsgZS5zZXJpZXNJbmRleCArICcgLm52LWRpc3R5LScgKyBlLnBvaW50SW5kZXgpCisgICAgICAgIC5hdHRyKCd4MicsIGRpc3RZLnNpemUoKSk7CisgIH0pOworICBkaXNwYXRjaC5vbigndG9vbHRpcEhpZGUnLCBmdW5jdGlvbigpIHsKKyAgICBpZiAodG9vbHRpcHMpIG52LnRvb2x0aXAuY2xlYW51cCgpOworICB9KTsKKworICAvLz09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorCisKKyAgLy89PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKyAgLy8gRXhwb3NlIFB1YmxpYyBWYXJpYWJsZXMKKyAgLy8tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0KKworICAvLyBleHBvc2UgY2hhcnQncyBzdWItY29tcG9uZW50cworICBjaGFydC5kaXNwYXRjaCA9IGRpc3BhdGNoOworICBjaGFydC5zY2F0dGVyID0gc2NhdHRlcjsKKyAgY2hhcnQubGVnZW5kID0gbGVnZW5kOworICBjaGFydC5jb250cm9scyA9IGNvbnRyb2xzOworICBjaGFydC54QXhpcyA9IHhBeGlzOworICBjaGFydC55QX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7CisgIH07CisKKyAgY2hhcnQuaGVpZ2h0ID0gZnVuY3Rpb24oXykgeworICAgIGlmICghYXJndW1lbnRzLmxlbmd0aCkgcmV0dXJuIGhlaWdodDsKKyAgICBoZWlnaHQgPSBfOworICAgIHJldHVybiBjaGFydDsKKyAgfTsKKworICBjaGFydC5jb2xvciA9IGZ1bmN0aW9uKF8pIHsKKyAgICBpZiAoIWFyZ3VtZW50cy5sZW5ndGgpIHJldHVybiBjb2xvcjsKKyAgICBjb2xvciA9IG52LnV0aWxzLmdldENvbG9yKF8pOworICAgIGxlZ2VuZC5jb2xvcihjb2xvcik7CisgICAgZGlzdFguY29sb3IoY29sb3IpOworICAgIGRpc3RZLmNvbG9yKGNvbG9yKTsKKyAgICByZXR1cm4gY2hhcnQ7CisgIH07CisKKyAgY2hhcnQuc2hvd0Rpc3RYID0gZnVuY3Rpb24oXykgeworICAgIGlmICghYXJndW1lbnRzLmxlbmd0aCkgcmV0dXJuIHNob3dEaXN0WDsKKyAgICBzaG93RGlzdFggPSBfOworICAgIHJldHVybiBjaGFydDsKKyAgfTsKKworICBjaGFydC5zaG93RGlzdFkgPSBmdW5jdGlvbihfKSB7CisgICAgaWYgKCFhcmd1bWVudHMubGVuZ3RoKSByZXR1cm4gc2hvd0Rpc3RZOworICAgIHNob3dEaXN0WSA9IF87CisgICAgcmV0dXJuIGNoYXJ0OworICB9OworCisgIGNoYXJ0LnNob3dDb250cm9scyA9IGZ1bmN0aW9uKF8pIHsKKyAgICBpZiAoIWFyZ3VtZW50cy5sZW5ndGgpIHJldHVybiBzaG93Q29udHJvbHM7CisgICAgc2hvd0NvbnRyb2xzID0gXzsKKyAgICByZXR1cm4gY2hhcnQ7CisgIH07CisKKyAgY2hhcnQuc2hvd0xlZ2VuZCA9IGZ1bmN0aW9uKF8pIHsKKyAgICBpZiAoIWFyZ3VtZW50cy5sZW5ndGgpIHJldHVybiBzaG93TGVnZW5kOworICAgIHNob3dMZWdlbmQgPSBfOworICAgIHJldHVybiBjaGFydDsKKyAgfTsKKworICBjaGFydC5maXNoZXllID0gZnVuY3Rpb24oXykgeworICAgIGlmICghYXJndW1lbnRzLmxlbmd0aCkgcmV0dXJuIGZpc2hleWU7CisgICAgZmlzaGV5ZSA9IF87CisgICAgcmV0dXJuIGNoYXJ0OworICB9OworCisgIGNoYXJ0LnhQYWRkaW5nID0gZnVuY3Rpb24oXykgeworICAgIGlmICghYXJndW1lbnRzLmxlbmd0aCkgcmV0dXJuIHhQYWRkaW5nOworICAgIHhQYWRkaW5nID0gXzsKKyAgICByZXR1cm4gY2hhcnQ7CisgIH07CisKKyAgY2hhcnQueVBhZGRpbmcgPSBmdW5jdGlvbihfKSB7CisgICAgaWYgKCFhcmd1bWVudHMubGVuZ3RoKSByZXR1cm4geVBhZGRpbmc7CisgICAgeVBhZGRpbmcgPSBfOworICAgIHJldHVybiBjaGFydDsKKyAgfTsKKworICBjaGFydC50b29sdGlwcyA9IGZ1bmN0aW9uKF8pIHsKKyAgICBpZiAoIWFyZ3VtZW50cy5sZW5ndGgpIHJldHVybiB0b29sdGlwczsKKyAgICB0b29sdGlwcyA9IF87CisgICAgcmV0dXJuIGNoYXJ0OworICB9OworCisgIGNoYXJ0LnRvb2x0aXBDb250ZW50ID0gZnVuY3Rpb24oXykgeworICAgIGlmICghYXJndW1lbnRzLmxlbmd0aCkgcmV0dXJuIHRvb2x0aXA7CisgICAgdG9vbHRpcCA9IF87CisgICAgcmV0dXJuIGNoYXJ0OworICB9OworCisgIGNoYXJ0LnRvb2x0aXBYQ29udGVudCA9IGZ1bmN0aW9uKF8pIHsKKyAgICBpZiAoIWFyZ3VtZW50cy5sZW5ndGgpIHJldHVybiB0b29sdGlwWDsKKyAgICB0b29sdGlwWCA9IF87CisgICAgcmV0dXJuIGNoYXJ0OworICB9OworCisgIGNoYXJ0LnRvb2x0aXBZQ29udGVudCA9IGZ1bmN0aW9uKF8pIHsKKyAgICBpZiAoIWFyZ3VtZW50cy5sZW5ndGgpIHJldHVybiB0b29sdGlwWTsKKyAgICB0b29sdGlwWSA9IF87CisgICAgcmV0dXJuIGNoYXJ0OworICB9OworCisgIGNoYXJ0LnN0YXRlID0gZnVuY3Rpb24oXykgeworICAgIGlmICghYXJndW1lbnRzLmxlbmd0aCkgcmV0dXJuIHN0YXRlOworICAgIHN0YXRlID0gXzsKKyAgICByZXR1cm4gY2hhcnQ7CisgIH07CisKKyAgY2hhcnQuZGVmYXVsdFN0YXRlID0gZnVuY3Rpb24oXykgeworICAgIGlmICghYXJndW1lbnRzLmxlbmd0aCkgcmV0dXJuIGRlZmF1bHRTdGF0ZTsKKyAgICBkZWZhdWx0U3RhdGUgPSBfOworICAgIHJldHVybiBjaGFydDsKKyAgfTsKKyAgCisgIGNoYXJ0Lm5vRGF0YSA9IGZ1bmN0aW9uKF8pIHsKKyAgICBpZiAoIWFyZ3VtZW50cy5sZW5ndGgpIHJldHVybiBub0RhdGE7CisgICAgbm9EYXRhID0gXzsKKyAgICByZXR1cm4gY2hhcnQ7CisgIH07CisKKyAgLy89PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKworCisgIHJldHVybiBjaGFydDsKK30KKworbnYubW9kZWxzLnNjYXR0ZXJQbHVzTGluZUNoYXJ0ID0gZnVuY3Rpb24oKSB7CisKKyAgLy89PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKyAgLy8gUHVibGljIFZhcmlhYmxlcyB3aXRoIERlZmF1bHQgU2V0dGluZ3MKKyAgLy8tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0KKworICB2YXIgc2NhdHRlciAgICAgID0gbnYubW9kZWxzLnNjYXR0ZXIoKQorICAgICwgeEF4aXMgICAgICAgID0gbnYubW9kZWxzLmF4aXMoKQorICAgICwgeUF4aXMgICAgICAgID0gbnYubW9kZWxzLmF4aXMoKQorICAgICwgbGVnZW5kICAgICAgID0gbnYubW9kZWxzLmxlZ2VuZCgpCisgICAgLCBjb250cm9scyAgICAgPSBudi5tb2RlbHMubGVnZW5kKCkKKyAgICAsIGRpc3RYICAgICAgICA9IG52Lm1vZGVscy5kaXN0cmlidXRpb24oKQorICAgICwgZGlzdFkgICAgICAgID0gbnYubW9kZWxzLmRpc3RyaWJ1dGlvbigpCisgICAgOworCisgIHZhciBtYXJnaW4gICAgICAgPSB7dG9wOiAzMCwgcmlnaHQ6IDIwLCBib3R0b206IDUwLCBsZWZ0OiA3NX0KKyAgICAsIHdpZHRoICAgICAgICA9IG51bGwKKyAgICAsIGhlaWdodCAgICAgICA9IG51bGwKKyAgICAsIGNvbG9yICAgICAgICA9IG52LnV0aWxzLmRlZmF1bHRDb2xvcigpCisgICAgLCB4ICAgICAgICAgICAgPSBkMy5maXNoZXllID8gZDMuZmlzaGV5ZS5zY2FsZShkMy5zY2FsZS5saW5lYXIpLmRpc3RvcnRpb24oMCkgOiBzY2F0dGVyLnhTY2FsZSgpCisgICAgLCB5ICAgICAgICAgICAgPSBkMy5maXNoZXllID8gZDMuZmlzaGV5ZS5zY2FsZShkMy5zY2FsZS5saW5lYXIpLmRpc3RvcnRpb24oMCkgOiBzY2F0dGVyLnlTY2FsZSgpCisgICAgLCBzaG93RGlzdFggICAgPSBmYWxzZQorICAgICwgc2hvd0Rpc3RZICAgID0gZmFsc2UKKyAgICAsIHNob3dMZWdlbmQgICA9IHRydWUKKyAgICAsIHNob3dDb250cm9scyA9ICEhZDMuZmlzaGV5ZQorICAgICwgZmlzaGV5ZSAgICAgID0gMAorICAgICwgcGF1c2VGaXNoZXllID0gZmFsc2UKKyAgICAsIHRvb2x0aXBzICAgICA9IHRydWUKKyAgICAsIHRvb2x0aXBYICAgICA9IGZ1bmN0aW9uKGtleSwgeCwgeSkgeyByZXR1cm4gJzxzdHJvbmc+JyArIHggKyAnPC9zdHJvbmc+JyB9CisgICAgLCB0b29sdGlwWSAgICAgPSBmdW5jdGlvbihrZXksIHgsIHkpIHsgcmV0dXJuICc8c3Ryb25nPicgKyB5ICsgJzwvc3Ryb25nPicgfQorICAgICwgdG9vbHRpcCAgICAgID0gZnVuY3Rpb24oa2V5LCB4LCB5LCBkYXRlKSB7IHJldHVybiAnPGgzPicgKyBrZXkgKyAnPC9oMz4nIAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKyAnPHA+JyArIGRhdGUgKyAnPC9wPicgfQorICAgIC8vLCB0b29sdGlwICAgICAgPSBudWxsCisgICAgLCBzdGF0ZSA9IHt9CisgICAgLCBkZWZhdWx0U3RhdGUgPSBudWxsCisgICAgLCBkaXNwYXRjaCA9IGQzLmRpc3BhdGNoKCd0b29sdGlwU2hvdycsICd0b29sdGlwSGlkZScsICdzdGF0ZUNoYW5nZScsICdjaGFuZ2VTdGF0ZScpCisgICAgLCBub0RhdGEgICAgICAgPSAiTm8gRGF0YSBBdmFpbGFibGUuIgorICAgIDsKKworICBzY2F0dGVyCisgICAgLnhTY2FsZSh4KQorICAgIC55U2NhbGUoeSkKKyAgICA7CisgIHhBeGlzCisgICAgLm9yaWVudCgnYm90dG9tJykKKyAgICAudGlja1BhZGRpbmcoMTApCisgICAgOworICB5QXhpcworICAgIC5vcmllbnQoJ2xlZnQnKQorICAgIC50aWNrUGFkZGluZygxMCkKKyAgICA7CisgIGRpc3RYCisgICAgLmF4aXMoJ3gnKQorICAgIDsKKyAgZGlzdFkKKyAgICAuYXhpcygneScpCisgICAgOworCisgIC8vPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisKKworICAvLz09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorICAvLyBQcml2YXRlIFZhcmlhYmxlcworICAvLy0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t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uc2VyaWVzLmtleSwgeFZhbCwgeVZhbCwgZSwgY2hhcnQpLCAnbicsIDEsIG9mZnNldEVsZW1lbnQsICd4LW52dG9vbHRpcCcpOworICAgICAgaWYoIHRvb2x0aXBZICE9IG51bGwgKQorICAgICAgICAgIG52LnRvb2x0aXAuc2hvdyhbbGVmdFksIHRvcFldLCB0b29sdGlwWShlLnNlcmllcy5rZXksIHhWYWwsIHlWYWwsIGUsIGNoYXJ0KSwgJ2UnLCAxLCBvZmZzZXRFbGVtZW50LCAneS1udnRvb2x0aXAnKTsKKyAgICAgIGlmKCB0b29sdGlwICE9IG51bGwgKQorICAgICAgICAgIG52LnRvb2x0aXAuc2hvdyhbbGVmdCwgdG9wXSwgdG9vbHRpcChlLnNlcmllcy5rZXksIHhWYWwsIHlWYWwsIGUucG9pbnQudG9vbHRpcCwgZSwgY2hhcnQpLCBlLnZhbHVlIDwgMCA/ICduJyA6ICdzJywgbnVsbCwgb2Zmc2V0RWxlbWVudCk7CisgIH07CisKKyAgdmFyIGNvbnRyb2xzRGF0YSA9IFsKKyAgICB7IGtleTogJ01hZ25pZnknLCBkaXNhYmxlZDogdHJ1ZSB9CisgIF07CisKKyAgLy89PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKworCisgIGZ1bmN0aW9uIGNoYXJ0KHNlbGVjdGlvbikgeworICAgIHNlbGVjdGlvbi5lYWNoKGZ1bmN0aW9uKGRhdGEpIHsKKyAgICAgIHZhciBjb250YWluZXIgPSBkMy5zZWxlY3QodGhpcyksCisgICAgICAgICAgdGhhdCA9IHRoaXM7CisKKyAgICAgIHZhciBhdmFpbGFibGVXaWR0aCA9ICh3aWR0aCAgfHwgcGFyc2VJbnQoY29udGFpbmVyLnN0eWxlKCd3aWR0aCcpKSB8fCA5NjApCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC0gbWFyZ2luLmxlZnQgLSBtYXJnaW4ucmlnaHQsCisgICAgICAgICA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Z3RoIH0pLmxlbmd0aCkgeworICAgICAgICB2YXIgbm9EYXRhVGV4dCA9IGNvbnRhaW5lci5zZWxlY3RBbGwoJy5udi1ub0RhdGEnKS5kYXRhKFtub0RhdGFdKTsKKworICAgICAgICBub0RhdGFUZXh0LmVudGVyKCkuYXBwZW5kKCd0ZXh0JykKKyAgICAgICAgICAuYXR0cignY2xhc3MnLCAnbnZkMyBudi1ub0RhdGEnKQorICAgICAgICAgIC5hdHRyKCdkeScsICctLjdlbScpCisgICAgICAgICAgLnN0eWxlKCd0ZXh0LWFuY2hvcicsICdtaWRkbGUnKTsKKworICAgICAgICBub0RhdGFUZXh0CisgICAgICAgICAgLmF0dHIoJ3gnLCBtYXJnaW4ubGVmdCArIGF2YWlsYWJsZVdpZHRoIC8gMikKKyAgICAgICAgICAuYXR0cigneScsIG1hcmdpbi50b3AgKyBhdmFpbGFibGVIZWlnaHQgLyAyKQorICAgICAgICAgIC50ZXh0KGZ1bmN0aW9uKGQpIHsgcmV0dXJuIGQgfSk7CisKKyAgICAgICAgcmV0dXJuIGNoYXJ0OworICAgICAgfSBlbHNlIHsKKyAgICAgICAgY29udGFpbmVyLnNlbGVjdEFsbCgnLm52LW5vRGF0YScpLnJlbW92ZSgpOworICAgICAgfQorCisgICAgICAvLy0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLQorCisKKyAgICAgIC8vLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tCisgICAgICAvLyBTZXR1cCBTY2FsZXMKKworICAgICAgeCA9IHNjYXR0ZXIueFNjYWxlKCk7CisgICAgICB5ID0gc2NhdHRlci55U2NhbGUoKTsKKworICAgICAgeDAgPSB4MCB8fCB4OworICAgICAgeTAgPSB5MCB8fCB5OworCisgICAgICAvLy0tLS0tLS0tLS0tLS0tLS0tLS0tLS0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orICAgICAgICAgICAgLmF0dHIoJ3RyYW5zZm9ybScsICd0cmFuc2xhdGUoJyArIChhdmFpbGFibGVXaWR0aCAvIDIpICsgJywnICsgKC1tYXJnaW4udG9wKSArJyknKTsKKyAgICAgIH0KKworICAgICAgLy8tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0KKworCisgICAgICAvLy0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLQorICAgICAgLy8gQ29udHJvbHMKKworICAgICAgaWYgKHNob3dDb250cm9scykgeworICAgICAgICBjb250cm9scy53aWR0aCgxODApLmNvbG9yKFsnIzQ0NCddKTsKKyAgICAgICAgZy5zZWxlY3QoJy5udi1jb250cm9sc1dyYXAnKQorICAgICAgICAgICAgLmRhdHVtKGNvbnRyb2xzRGF0YSkKKyAgICAgICAgICAgIC5hdHRyKCd0cmFuc2Zvcm0nLCAndHJhbnNsYXRlKDAsJyArICgtbWFyZ2luLnRvcCkgKycpJykKKyAgICAgICAgICAgIC5jYWxsKGNvbnRyb2xzKTsKKyAgICAgIH0KKworICAgICAgLy8tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0KKworCisgICAgICAvLy0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLQorICAgICAgLy8gTWFpbiBDaGFydCBDb21wb25lbnQocykKKworICAgICAgc2NhdHRlcgorICAgICAgICAgIC53aWR0aChhdmFpbGFibGVXaWR0aCkKKyAgICAgICAgICAuaGVpZ2h0KGF2YWlsYWJsZUhlaWdodCkKKyAgICAgICAgICAuY29sb3IoZGF0YS5tYXAoZnVuY3Rpb24oZCxpKSB7CisgICAgICAgICAgICByZ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14Lm52LWF4aXMnKQorICAgICAgICAgIC5hdHRyKCd0cmFuc2Zvcm0nLCAndHJhbnNsYXRlKDAsJyArIHkucmFuZ2UoKVswXSArICcpJykKKyAgICAgICAgICAuY2FsbCh4QXhpcyk7CisKKworICAgICAgeUF4aXMKKyAgICAgICAgICAuc2NhbGUoeSkKKyAgICAgICAgICAudGlja3MoIHlBeGlzLnRpY2tzKCkgPyB5QXhpcy50aWNrcygpIDogYXZhaWxhYmxlSGVpZ2h0IC8gMzYgKQorICAgICAgICAgIC50aWNrU2l6ZSggLWF2YWlsYWJsZVdpZHRoLCAwKTsKKworICAgICAgZy5zZWxlY3QoJy5udi15Lm52LWF4aXMnKQorICAgICAgICAgIC5jYWxsKHlBeGlzKTsKKworCisgICAgICBpZiAoc2hvd0Rpc3RYKSB7CisgICAgICAgIGRpc3RYCisgICAgICAgICAgICAuZ2V0RGF0YShzY2F0dGVyLngoKSkKKyAgICAgICAgICAgIC5zY2FsZSh4KQorICAgICAgICAgICAgLndpZHRoKGF2YWlsYWJsZVdpZHRoKQorICAgICAgICAgICAgLmNvbG9yKGRhdGEubWFwKGZ1bmN0aW9uKGQsaSkgeworICAgICAgICAgICAgICByZXR1cm4gZC5jb2xvciB8fCBjb2xvcihkLCBpKTsKKyAgICAgICAgICAgIH0pLmZpbHRlcihmdW5jdGlvbihkLGkpIHsgcmV0dXJuICFkYXRhW2ldLmRpc2FibGVkIH0pKTsKKyAgICAgICAgZ0VudGVyLnNlbGVjdCgnLm52LWRpc3RXcmFwJykuYXBwZW5kKCdnJykKKyAgICAgICAgICAgIC5hdHRyKCdjbGFzcycsICdudi1kaXN0cmlidXRpb25YJyk7CisgICAgICAgIGcuc2VsZWN0KCcubnYtZGlzdHJpYnV0aW9uWCcpCisgICAgICAgICAgICAuYXR0cigndHJhbnNmb3JtJywgJ3RyYW5zbGF0ZSgwLCcgKyB5LnJhbmdlKClbMF0gKyAnKScpCisgICAgICAgICAgICAuZGF0dW0oZGF0YS5maWx0ZXIoZnVuY3Rpb24oZCkgeyByZXR1cm4gIWQuZGlzYWJsZWQgfSkpCisgICAgICAgICAgICAuY2FsbChkaXN0WCk7CisgICAgICB9CisKKyAgICAgIGlmIChzaG93RGlzdFkpIHsKKyAgICAgICAgZGlzdFkKKyAgICAgICAgICAgIC5nZXREYXRhKHNjYXR0ZXIueSgpKQorICAgICAgICAgICAgLnNjYWxlKHkpCisgICAgICAgICAgICAud2lkdGgoYXZhaWxhYmxlSGVpZ2h0KQorICAgICAgICAgICAgLmNvbG9yKGRhdGEubWFwKGZ1bmN0aW9uKGQsaSkgeworICAgICAgICAgICAgICByZXR1cm4gZC5jb2xvciB8fCBjb2xvcihkLCBpKTsKKyAgICAgICAgICAgIH0pLmZpbHRlcihmdW5jdGlvbihkLGkpIHsgcmV0dXJuICFkYXRhW2ldLmRpc2FibGVkIH0pKTsKKyAgICAgICAgZ0VudGVyLnNlbGVjdCgnLm52LWRpc3RXcmFwJykuYXBwZW5kKCdnJykKKyAgICAgICAgICAgIC5hdHRyKCdjbGFzcycsICdudi1kaXN0cmlidXRpb25ZJyk7CisgICAgICAgIGcuc2VsZWN0KCcubnYtZGlzdHJpYnV0aW9uWScpCisgICAgICAgICAgICAuYXR0cigndHJhbnNmb3JtJywgJ3RyYW5zbGF0ZSgtJyArIGRpc3RZLnNpemUoKSArICcsMCknKQorICAgICAgICAgICAgLmRhdHVtKGRhdGEuZmlsdGVyKGZ1bmN0aW9uKGQpIHsgcmV0dXJuICFkLmRpc2FibGVkIH0pKQorICAgICAgICAgICAgLmNhbGwoZGlzdFkpOworICAgICAgfQorCisgICAgICAvLy0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLQorCisKKworCisgICAgICBpZiAoZDMuZmlzaGV5ZSkgeworICAgICAgICBnLnNlbGVjdCgnLm52LWJhY2tncm91bmQnKQorICAgICAgICAgICAgLmF0dHIoJ3dpZHRoJywgYXZha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ZCB9KSkKKyAgICAgICAgICAgIC5jYWxsKHNjYXR0ZXIpOworICAgICAgICBnLnNlbGVjdCgnLm52LXgubnYtYXhpcycpLmNhbGwoeEF4aXMpOworICAgICAgICBnLnNlbGVjdCgnLm52LXkubnYtYXhpcycpLmNhbGwoeUF4aXMpOworICAgICAgICBnLnNlbGVjdCgnLm52LWRpc3RyaWJ1dGlvblgnKQorICAgICAgICAgICAgLmRhdHVtKGRhdGEuZmlsdGVyKGZ1bmN0aW9uKGQpIHsgcmV0dXJuICFkLmRpc2FibGVkIH0pKQorICAgICAgICAgICAgLmNhbGwoZGlzdFgpOworICAgICAgICBnLnNlbGVjdCgnLm52LWRpc3RyaWJ1dGlvblknKQorICAgICAgICAgICAgLmRhdHVtKGRhdGEuZmlsdGVyKGZ1bmN0aW9uKGQpIHsgcmV0dXJuICFkLmRpc2FibGVkIH0pKQorICAgICAgICAgICAgLmNhbGwoZGlzdFkpOworICAgICAgfQorCisKKworICAgICAgLy89PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKyAgICAgIC8vIEV2ZW50IEhhbmRsaW5nL0Rpc3BhdGNoaW5nIChpbiBjaGFydCdzIHNjb3BlKQorICAgICAgLy8tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0KKworICAgICAgY29udHJvbHMuZGlzcGF0Y2gub24oJ2xlZ2VuZENsaWNrJywgZnVuY3Rpb24oZCxpKSB7CisgICAgICAgIGQuZGlzYWJsZWQgPSAhZC5kaXNhYmxlZDsKKworICAgICAgICBmaXNoZXllID0gZC5kaXNhYmxlZCA/IDAgOiAyLjU7CisgICAgICAgIGcuc2VsZWN0KCcubnYtYmFja2dyb3VuZCcpIC5zdHlsZSgncG9pbnRlci1ldmVudHMnLCBkLmRpc2FibGVkID8gJ25vbmUnIDogJ2FsbCcpOworICAgICAgICBnLnNlbGVjdCgnLm52LXBvaW50LXBhdGhzJykuc3R5bGUoJ3BvaW50ZXItZXZlbnRzJywgZC5kaXNhYmxlZCA/ICdhbGwnIDogJ25vbmUnICk7CisKKyAgICAgICAgaWYgKGQuZGlzYWJsZWQpIHsKKyAgICAgICAgICB4LmRpc3RvcnRpb24oZmlzaGV5ZSkuZm9jdXMoMCk7CisgICAgICAgICAgeS5kaXN0b3J0aW9uKGZpc2hleWUpLmZvY3VzKDApOworCisgICAgICAgICAgZy5zZWxlY3QoJy5udi1zY2F0dGVyV3JhcCcpLmNhbGwoc2NhdHRlcik7CisgICAgICAgICAgZy5zZWxlY3QoJy5udi14Lm52LWF4aXMnKS5jYWxsKHhBeGlzKTsKKyAgICAgICAgICBnLnNlbGVjdCgnLm52LXkubnYtYXhpcycpLmNhbGwoeUF4aXMpOworICAgICAgICB9IGVsc2UgeworICAgICAgICAgIHBhdXNlRmlzaGV5ZSA9IGZhbHNlOworICAgICAgICB9CisKKyAgICAgICAgY2hhcnQudXBkYXRlKCk7CisgICAgICB9KTsKKworICAgICAgbGVnZW5kLmRpc3BhdGNoLm9uKCdsZWdlbmRDbGljaycsIGZ1bmN0aW9uKGQsaSwgdGhhdCkgeworICAgICAgICBkLmRpc2FibGVkID0gIWQuZGlzYWJsZWQ7CisKKyAgICAgICAgaWYgKCFkYXRhLmZpbHRlcihmdW5jdGlvbihkKSB7IHJldHVybiAhZC5kaXNhYmxlZCB9KS5sZW5ndGgpIHsKKyAgICAgICAgICBkYXRhLm1hcChmdW5jdGlvbihkKSB7CisgICAgICAgICAgICBkLmRpc2FibGVkID0gZmFsc2U7CisgICAgICAgICAgICB3cmFwLnNlbGVjdEFsbCgnLm52LXNlcmllcycpLmNsYXNzZWQoJ2Rpc2FibGVkJywgZmFsc2UpOworICAgICAgICAgICAgcmV0dXJuIGQ7CisgICAgICAgICAgfSk7CisgICAgICAgIH0KKworICAgICAgICBzdGF0ZS5kaXNhYmxlZCA9IGRhdGEubWFwKGZ1bmN0aW9uK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c2FibGVkW2ldOworICAgICAgICAgIH0pOworCisgICAgICAgICAgc3RhdGUuZGlzYWJsZWQgPSBlLmRpc2FibGVkOworICAgICAgICB9CisKKyAgICAgICAgY2hhcnQudXBkYXRlKCk7CisgICAgICB9KTsKKworICAgICAgLy89PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKworCisgICAgICAvL3N0b3JlIG9sZCBzY2FsZXMgZm9yIHVzZSBpbiB0cmFuc2l0aW9ucyBvbiB1cGRhdGUKKyAgICAgIHgwID0geC5jb3B5KCk7CisgICAgICB5MCA9IHkuY29weSgpOworCisKKyAgICB9KTsKKworICAgIHJldHVybiBjaGFydDsKKyAgfQorCisKKyAgLy89PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKyAgLy8gRXZlbnQgSGFuZGxpbmcvRGlzcGF0Y2hpbmcgKG91dCBvZiBjaGFydCdzIHNjb3BlKQorICAvLy0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLQorCisgIHNjYXR0ZXIuZGlzcGF0Y2gub24oJ2VsZW1lbnRNb3VzZW91dC50b29sdGlwJywgZnVuY3Rpb24oZSkgeworICAgIGRpc3BhdGNoLnRvb2x0aXBIaWRlKGUpOworCisgICAgZDMuc2VsZWN0KCcubnYtY2hhcnQtJyArIHNjYXR0ZXIuaWQoKSArICcgLm52LXNlcmllcy0nICsgZS5zZXJpZXNJbmRleCArICcgLm52LWRpc3R4LScgKyBlLnBvaW50SW5kZXgpCisgICAgICAgIC5hdHRyKCd5MScsIDApOworICAgIGQzLnNlbGVjdCgnLm52LWNoYXJ0LScgKyBzY2F0dGVyLmlkKCkgKyAnIC5udi1zZXJpZXMtJyArIGUuc2VyaWVzSW5kZXggKyAnIC5udi1kaXN0eS0nICsgZS5wb2ludEluZGV4KQorICAgICAg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bG9yKTsKKyAgICBkaXN0WS5jb2xvcihjb2xvcik7CisgICAgcmV0dXJuIGNoYXJ0OworICB9OworCisgIGNoYXJ0LnNob3dEaXN0WCA9IGZ1bmN0aW9uKF8pIHsKKyAgICBpZiAoIWFyZ3VtZW50cy5sZW5ndGgpIHJldHVybiBzaG93RGlzdFg7CisgICAgc2hvd0Rpc3RYID0gXzsKKyAgICByZXR1cm4gY2hhcnQ7CisgIH07CisKKyAgY2hhcnQuc2hvd0Rpc3RZID0gZnVuY3Rpb24oXykgeworICAgIGlmICghYXJndW1lbnRzLmxlbmd0aCkgcmV0dXJuIHNob3dEaXN0WTsKKyAgICBzaG93RGlzdFkgPSBfOworICAgIHJldHVybiBjaGFydDsKKyAgfTsKKworICBjaGFydC5zaG93Q29udHJvbHMgPSBmdW5jdGlvbihfKSB7CisgICAgaWYgKCFhcmd1bWVudHMubGVuZ3RoKSByZXR1cm4gc2hvd0NvbnRyb2xzOworICAgIHNob3dDb250cm9scyA9IF87CisgICAgcmV0dXJuIGNoYXJ0OworICB9OworCisgIGNoYXJ0LnNob3dMZWdlbmQgPSBmdW5jdGlvbihfKSB7CisgICAgaWYgKCFhcmd1bWVudHMubGVuZ3RoKSByZXR1cm4gc2hvd0xlZ2VuZDsKKyAgICBzaG93TGVnZW5kID0gXzsKKyAgICByZXR1cm4gY2hhcnQ7CisgIH07CisKKyAgY2hhcnQuZmlzaGV5ZSA9IGZ1bmN0aW9uKF8pIHsKKyAgICBpZiAoIWFyZ3VtZW50cy5sZW5ndGgpIHJldHVybiBmaXNoZXllOworICAgIGZpc2hleWUgPSBfOworICAgIHJldHVybiBjaGFydDsKKyAgfTsKKworICBjaGFydC50b29sdGlwcyA9IGZ1bmN0aW9uKF8pIHsKKyAgICBpZiAoIWFyZ3VtZW50cy5sZW5ndGgpIHJldHVybiB0b29sdGlwczsKKyAgICB0b29sdGlwcyA9IF87CisgICAgcmV0dXJuIGNoYXJ0OworICB9OworCisgIGNoYXJ0LnRvb2x0aXBDb250ZW50ID0gZnVuY3Rpb24oXykgeworICAgIGlmICghYXJndW1lbnRzLmxlbmd0aCkgcmV0dXJuIHRvb2x0aXA7CisgICAgdG9vbHRpcCA9IF87CisgICAgcmV0dXJuIGNoYXJ0OworICB9OworCisgIGNoYXJ0LnRvb2x0aXBYQ29udGVudCA9IGZ1bmN0aW9uKF8pIHsKKyAgICBpZiAoIWFyZ3VtZW50cy5sZW5ndGgpIHJldHVybiB0b29sdGlwWDsKKyAgICB0b29sdGlwWCA9IF87CisgICAgcmV0dXJuIGNoYXJ0OworICB9OworCisgIGNoYXJ0LnRvb2x0aXBZQ29udGVudCA9IGZ1bmN0aW9uKF8pIHsKKyAgICBpZiAoIWFyZ3VtZW50cy5sZW5ndGgpIHJldHVybiB0b29sdGlwWTsKKyAgICB0b29sdGlwWSA9IF87CisgICAgcmV0dXJuIGNoYXJ0OworICB9OworCisgIGNoYXJ0LnN0YXRlID0gZnVuY3Rpb24oXykgeworICAgIGlmICghYXJndW1lbnRzLmxlbmd0aCkgcmV0dXJuIHN0YXRlOworICAgIHN0YXRlID0gXzsKKyAgICByZXR1cm4gY2hhcnQ7CisgIH07CisKKyAgY2hhcnQuZGVmYXVsdFN0YXRlID0gZnVuY3Rpb24oXykgeworICAgIGlmICghYXJndW1lbnRzLmxlbmd0aCkgcmV0dXJuIGRlZmF1bHRTdGF0ZTsKKyAgICBkZWZhdWx0U3RhdGUgPSBfOworICAgIHJldHVybiBjaGFydDsKKyAgfTsKKworICBjaGFydC5ub0RhdGEgPSBmdW5jdGlvbihfKSB7CisgICAgaWYgKCFhcmd1bWVudHMubGVuZ3RoKSByZXR1cm4gbm9EYXRhOworICAgIG5vRGF0YSA9IF87CisgICAgcmV0dXJuIGNoYXJ0OworICB9OworCisgIC8vPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisKKworICByZXR1cm4gY2hhcnQ7Cit9CisKK252Lm1vZGVscy5zcGFya2xpbmUgPSBmdW5jdGlvbigpIHsKKworICAvLz09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorICAvLyBQdWJsaWMgVmFyaWFibGVzIHdpdGggRGVmYXVsdCBTZXR0aW5ncworICAvLy0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLQorCisgIHZhciBtYXJnaW4gPSB7dG9wOiAyLCByaWdodDogMCwgYm90dG9tOiAyLCBsZWZ0OiAwfQorICAgICwgd2lkdGggPSA0MDAKKyAgICAsIGhlaWdodCA9IDMyCisgICAgLCBhbmltYXRlID0gdHJ1ZQorICAgICwgeCA9IGQzLnNjYWxlLmxpbmVhcigpCisgICAgLCB5ID0gZDMuc2NhbGUubGluZWFyKCkKKyAgICAsIGdldFggPSBmdW5jdGlvbihkKSB7IHJldHVybiBkLnggfQorICAgICwgZ2V0WSA9IGZ1bmN0aW9uKGQpIHsgcmV0dXJuIGQueSB9CisgICAgLCBjb2xvciA9IG52LnV0aWxzLmdldENvbG9yKFsnIzAwMCddKQorICAgICwgeERvbWFpbgorICAgICwgeURvbWFpbgorICAgIDsKKworICAvLz09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorCisKKyAgZnVuY3Rpb24gY2hhcnQoc2VsZWN0aW9uKSB7CisgICAgc2VsZWN0aW9uLmVhY2goZnVuY3Rpb24oZGF0YSkgeworICAgICAgdmFyIGF2YWlsYWJsZVdpZHRoID0gd2lkdGggLSBtYXJnaW4ubGVmdCAtIG1hcmdpbi5yaWdodCwKKyAgICAgICAgICBhdmFpbGFibGVIZWlnaHQgPSBoZWlnaHQgLSBtYXJnaW4udG9wIC0gbWFyZ2luLmJvdHRvbSwKKyAgICAgICAgICBjb250YWluZXIgPSBkMy5zZWxlY3QodGhpcyk7CisKKworICAgICAgLy8tLS0tLS0tLS0tLS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S0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0KKworCisgICAgICB2YXIgcGF0aHMgPSB3cmFwLnNlbGVjdEFsbCgncGF0aCcpCisgICAgICAgICAgLmRhdGEoZnVuY3Rpb24oZCkgeyByZXR1cm4gW2RdIH0pOworICAgICAgcGF0aHMuZW50ZXIoKS5hcHBlbmQoJ3BhdGgnKTsKKyAgICAgIHBhdGhzLmV4aXQoKS5yZW1vdmUoKTsKKyAgICAgIHBhdGhzCisgICAgICAgICAgLnN0eWxlKCdzdHJva2UnLCBmdW5jdGlvbihkLGkpIHsgcmV0dXJuIGQuY29sb3IgfHwgY29sb3IoZCwgaSkgfSkKKyAgICAgICAgICAuYXR0cignZCcsIGQzLnN2Zy5saW5lKCkKKyAgICAgICAgICAgIC54KGZ1bmN0aW9uKGQsaSkgeyByZXR1cm4geChnZXRYKGQsaSkpIH0pCisgICAgICAgICAgICAueShmdW5jdGlvbihkLGkpIHsgcmV0dXJuIHkoZ2V0WShkLGkpKSB9KQorICAgICAgICAgICk7CisKKworICAgICAgLy8gVE9ETzogQWRkIENVUlJFTlQgZGF0YSBwb2ludCAoTmVlZCBNaW4sIE1hYywgQ3VycmVudCAvIE1vc3QgcmVjZW50KQorICAgICAgdmFyIHBvaW50cyA9IHdyYXAuc2VsZWN0QWxsKCdjaXJjbGUubnYtcG9pbnQnKQorICAgICAgICAgIC5kYXRhKGZ1bmN0aW9uKGRhdGEpIHsKKyAgICAgICAgICAgICAgdmFyIHlWYWx1ZXMgPSBkYXRhLm1hcChmdW5jdGlvbihkLCBpKSB7IHJldHVybiBnZXRZKGQsaSk7IH0pOworICAgICAgICAgICAgICBmdW5jdGlvbiBwb2ludEluZGV4KGluZGV4KSB7CisgICAgICAgICAgICAgICAgICBpZiAoaW5kZXggIT0gLTEpIHsKKwkgICAgICAgICAgICAgIHZhciByZXN1bHQgPSBkYXRhW2luZGV4XTsKKyAgICAgICAgICAgICAgICAgICAgICByZXN1bHQucG9pbnRJbmRleCA9IGluZGV4OworICAgICAgICAgICAgICAgICAgICAgIHJldHVybiByZXN1bHQ7CisgICAgICAgICAgICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBudWxsOworICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgIHZhciBtYXhQb2ludCA9IHBvaW50SW5kZXgoeVZhbHVlcy5sYXN0SW5kZXhPZih5LmRvbWFpbigpWzFdKSksCisgICAgICAgICAgICAgICAgICBtaW5Qb2ludCA9IHBvaW50SW5kZXgoeVZhbHVlcy5pbmRleE9mKHkuZG9tYWluKClbMF0pKSwKKyAgICAgICAgICAgICAgICAgIGN1cnJlbnRQb2ludCA9IHBvaW50SW5kZXgoeVZhbHVlcy5sZW5ndGggLSAxKTsKKyAgICAgICAgICAgICAgcmV0dXJuIFttaW5Qb2ludCwgbWF4UG9pbnQsIGN1cnJlbnRQb2ludF0uZmlsdGVyKGZ1bmN0aW9uIChkKSB7cmV0dXJuIGQgIT0gbnVsbDt9KTsKKyAgICAgICAgICB9KTsKKyAgICAgIHBvaW50cy5lbnRlcigpLmFwcGVuZCgnY2lyY2xlJyk7CisgICAgICBwb2ludHMuZXhpdCgpLnJlbW92ZSgpOworICAgICAgcG9pbnRzCisgICAgICAgICAgLmF0dHIoJ2N4JywgZnVuY3Rpb24oZCxpKSB7IHJldHVybiB4KGdldFgoZCxkLnBvaW50SW5kZXgpKSB9KQorICAgICAgICAgIC5hdHRyKCdjeScsIGZ1bmN0aW9uKGQsaSkgeyByZXR1cm4geShnZXRZKGQsZC5wb2ludEluZGV4KSkgfSkKKyAgICAgICAgICAuYXR0cigncicsIDIpCisgICAgICAgICAgLmF0dHIoJ2NsYXNzJywgZnVuY3Rpb24oZCxpKSB7CisgICAgICAgICAgICByZXR1cm4gZ2V0WChkLCBkLnBvaW50SW5kZXgpID09IHguZG9tYWluKClbMV0gPyAnbnYtcG9pbnQgbnYtY3VycmVudFZhbHVlJyA6CisgICAgICAgICAgICAgICAgICAgZ2V0WShkLCBkLnBvaW50SW5kZXgpID09IHkuZG9tYWluKClbMF0gPyAnbnYtcG9pbnQgbnYtbWluVmFsdWUnIDogJ252LXBvaW50IG52LW1heFZhbHVlJworICAgICAgICAgIH0pOworICAgIH0pOworCisgICAgcmV0dXJuIGNoYXJ0OworICB9CisKKworICAvLz09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorICAvLyBFeHBvc2UgUHVibGljIFZhcmlhYmxlcworICAvLy0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLQorCisgIGNoYXJ0Lm1hcmdpbiA9IGZ1bmN0aW9uKF8pIHsKKyAgICBpZiAoIWFyZ3VtZW50cy5sZW5ndGgpIHJldHVybiBtYXJnaW47CisgICAgbWFyZ2luLnRvcCAgICA9IHR5cGVvZiBfLnRvcCAgICAhPSAndW5kZWZpbmVkJyA/IF8udG9wICAgIDogbWFyZ2luLnRvcDsKKyAgICBtYXJnaW4ucmlnaHQgID0gdHlwZW9mIF8ucmlnaHQgICE9ICd1bmRlZmluZWQnID8gXy5yaWdodCAgOiBtYXJnaW4ucmlnaHQ7CisgICAgbWFyZ2luLmJvdHRvbSA9IHR5cGVvZiBfLmJvdHRvbSAhPSAndW5kZWZpbmVkJyA/IF8uYm90dG9tIDogbWFyZ2luLmJvdHRvbTsKKyAgICBtYXJnaW4ubGVmdCAgID0gdHlwZW9mIF8ubGVmdCAgICE9ICd1bmRlZmluZWQnID8gXy5sZWZ0ICAgOiBtYXJnaW4ubGVmdDsKKyAgICByZXR1cm4gY2hhcnQ7CisgIH07CisKKyAgY2hhcnQud2lkdGggPSBmdW5jdGlvbihfKSB7CisgICAgaWYgKCFhcmd1bWVudHMubGVuZ3RoKSByZXR1cm4gd2lkdGg7CisgICAgd2lkdGggPSBfOworICAgIHJldHVybiBjaGFydDsKKyAgfTsKKworICBjaGFydC5oZWlnaHQgPSBmdW5jdGlvbihfKSB7CisgICAgaWYgKCFhcmd1bWVudHMubGVuZ3RoKSByZXR1cm4gaGVpZ2h0OworICAgIGhlaWdodCA9IF87CisgICAgcmV0dXJuIGNoYXJ0OworICB9OworCisgIGNoYXJ0LnggPSBmdW5jdGlvbihfKSB7CisgICAgaWYgKCFhcmd1bWVudHMubGVuZ3RoKSByZXR1cm4gZ2V0WDsKKyAgICBnZXRYID0gZDMuZnVuY3RvcihfKTsKKyAgICByZXR1cm4gY2hhcnQ7CisgIH07CisKKyAgY2hhcnQueSA9IGZ1bmN0aW9uKF8pIHsKKyAgICBpZiAoIWFyZ3VtZW50cy5sZW5ndGgpIHJldHVybiBnZXRZOworICAgIGdldFkgPSBkMy5mdW5jdG9yKF8pOworICAgIHJldHVybiBjaGFydDsKKyAgfTsKKworICBjaGFydC54U2NhbGUgPSBmdW5jdGlvbihfKSB7CisgICAgaWYgKCFhcmd1bWVudHMubGVuZ3RoKSByZXR1cm4geDsKKyAgICB4ID0gXzsKKyAgICByZXR1cm4gY2hhcnQ7CisgIH07CisKKyAgY2hhcnQueVNjYWxlID0gZnVuY3Rpb24oXykgeworICAgIGlmICghYXJndW1lbnRzLmxlbmd0aCkgcmV0dXJuIHk7CisgICAgeSA9IF87CisgICAgcmV0dXJuIGNoYXJ0OworICB9OworCisgIGNoYXJ0LnhEb21haW4gPSBmdW5jdGlvbihfKSB7CisgICAgaWYgKCFhcmd1bWVudHMubGVuZ3RoKSByZXR1cm4geERvbWFpbjsKKyAgICB4RG9tYWluID0gXzsKKyAgICByZXR1cm4gY2hhcnQ7CisgIH07CisKKyAgY2hhcnQueURvbWFpbiA9IGZ1bmN0aW9uKF8pIHsKKyAgICBpZiAoIWFyZ3VtZW50cy5sZW5ndGgpIHJldHVybiB5RG9tYWluOworICAgIHlEb21haW4gPSBfOworICAgIHJldHVybiBjaGFydDsKKyAgfTsKKworICBjaGFydC5hbmltYXRlID0gZnVuY3Rpb24oXykgeworICAgIGlmICghYXJndW1lbnRzLmxlbmd0aCkgcmV0dXJuIGFuaW1hdGU7CisgICAgYW5pbWF0ZSA9IF87CisgICAgcmV0dXJuIGNoYXJ0OworICB9OworCisgIGNoYXJ0LmNvbG9yID0gZnVuY3Rpb24oXykgeworICAgIGlmICghYXJndW1lbnRzLmxlbmd0aCkgcmV0dXJuIGNvbG9yOworICAgIGNvbG9yID0gbnYudXRpbHMuZ2V0Q29sb3IoXyk7CisgICAgcmV0dXJuIGNoYXJ0OworICB9OworCisgIC8vPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisKKworICByZXR1cm4gY2hhcnQ7Cit9CisKK252Lm1vZGVscy5zcGFya2xpbmVQbHVzID0gZnVuY3Rpb24oKSB7CisKKyAgLy89PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKyAgLy8gUHVibGljIFZhcmlhYmxlcyB3aXRoIERlZmF1bHQgU2V0dGluZ3MKKyAgLy8tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0KKworICB2YXIgc3BhcmtsaW5lID0gbnYubW9kZWxzLnNwYXJrbGluZSgpOworCisgIHZhciBtYXJnaW4gPSB7dG9wOiAxNSwgcmlnaHQ6IDEwMCwgYm90dG9tOiAxMCwgbGVmdDogNTB9CisgICAgLCB3aWR0aCA9IG51bGwKKyAgICAsIGhlaWdodCA9IG51bGwKKyAgICAsIHgKKyAgICAsIHkKKyAgICAsIGluZGV4ID0gW10KKyAgICAsIHBhdXNlZCA9IGZhbHNlCisgICAgLCB4VGlja0Zvcm1hdCA9IGQzLmZvcm1hdCgnLHInKQorICAgICwgeVRpY2tGb3JtYXQgPSBkMy5mb3JtYXQoJywuMmYnKQorICAgICwgc2hvd1ZhbHVlID0gdHJ1ZQorICAgICwgYWxpZ25WYWx1ZSA9IHRydWUKKyAgICAsIHJpZ2h0QWxpZ25WYWx1ZSA9IGZhbHNlCisgICAgLCBub0RhdGEgPSAiTm8gRGF0YSBBdmFpbGFibGUuIgorICAgIDsKKworICAvLz09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorCisKKyAgZnVuY3Rpb24gY2hhcnQoc2VsZWN0aW9uKSB7CisgICAgc2VsZWN0aW9uLmVhY2goZnVuY3Rpb24oZGF0YSkgeworICAgICAgdmFyIGNvbnRhaW5lciA9IGQzLnNlbGVjdCh0aGlzKTsKKworICAgICAgdmFyIGF2YWlsYWJsZVdpZHRoID0gKHdpZHRoICB8fCBwYXJzZUludChjb250YWluZXIuc3R5bGUoJ3dpZHRoJykpIHx8IDk2MCkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLSBtYXJnaW4ubGVmdCAtIG1hcmdpbi5yaWdodCwKKyAgICAgICAgICBhdmFpbGFibGVIZWlnaHQgPSAoaGVpZ2h0IHx8IHBhcnNlSW50KGNvbnRhaW5lci5zdHlsZSgnaGVpZ2h0JykpIHx8IDQwMCkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLSBtYXJnaW4udG9wIC0gbWFyZ2luLmJvdHRvbTsKKworICAgICAgCisKKyAgICAgIGNoYXJ0LnVwZGF0ZSA9IGZ1bmN0aW9uKCkgeyBjaGFydChzZWxlY3Rpb24pIH07CisgICAgICBjaGFydC5jb250YWluZXIgPSB0aGlzOworCisKKyAgICAgIC8vLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tCisgICAgICAvLyBEaXNwbGF5IE5vIERhdGEgbWVzc2FnZSBpZiB0aGVyZSdzIG5vdGhpbmcgdG8gc2hvdy4KKworICAgICAgaWYgKCFkYXRhIHx8ICFkYXRhLmxlbmd0aCkgeworICAgICAgICB2YXIgbm9E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ICAgICAgIC5hdHRyKCd5MScsIC1tYXJnaW4udG9wKQorICAgICAgICAgICAgLmF0dHIoJ3gyJywgMCkKKyAgICAgICAgICAgIC5hdHRyKCd5MicsIGF2YWlsYWJsZUhlaWdodCk7CisKKworICAgICAgICBob3ZlckVudGVyLmFwcGVuZCgndGV4dCcpLmF0dHIoJ2NsYXNzJywgJ252LXhWYWx1ZScpCisgICAgICAgICAgICAuYXR0cigneCcsIC02KQorICAgICAgICAgICAgLmF0dHIoJ3knLCAtbWFyZ2luLnRvcCkKKyAgICAgICAgICAgIC5hdHRyKCd0ZXh0LWFuY2hvcicsICdlbmQnKQorICAgICAgICAgICAgLmF0dHIoJ2R5JywgJy45ZW0nKQorCisKKyAgICAgICAgZy5zZWxlY3QoJy5udi1ob3ZlclZhbHVlIC5udi14VmFsdWUnKQorICAgICAgICAgICAgLnRleHQoeFRpY2tGb3JtYXQoc3BhcmtsaW5lLngoKShkYXRhW2luZGV4WzBdXSwgaW5kZXhbMF0pKSk7CisKKyAgICAgICAgaG92ZXJFbnRlci5hcHBlbmQoJ3RleHQnKS5hdHRyKCdjbGFzcycsICdudi15VmFsdWUnKQorICAgICAgICAgICAgLmF0dHIoJ3gnLCA2KQorICAgICAgICAgICAgLmF0dHIoJ3knLCAtbWFyZ2luLnRvcCkKKyAgICAgICAgICAgIC5hdHRyKCd0ZXh0LWFuY2hvcicsICdzdGFydCcpCisgICAgICAgICAgICAuYXR0cignZHknLCAnLjllbScpCisKKyAgICAgICAgZy5zZWxlY3QoJy5udi1ob3ZlclZhbHVlIC5udi15VmFsdWUnKQorICAgICAgICAgICAgLnRleHQoeVRpY2tGb3JtYXQoc3BhcmtsaW5lLnkoKShkYXRhW2luZGV4WzBdXSwgaW5kZXhbMF0pKSk7CisKKyAgICAgIH0KKworCisgICAgICBmdW5jdGlvbiBzcGFya2xpbmVIb3ZlcigpIHsKKyAgICAgICAgaWYgKHBhdXNlZCkgcmV0dXJuOworCisgICAgICAgIHZhciBwb3MgPSBkMy5tb3VzZSh0aGlzKVswXSAtIG1hcmdpbi5sZWZ0OworCisgICAgICAgIGZ1bmN0aW9uIGdldENsb3Nlc3RJbmRleChkYXRhLCB4KSB7CisgICAgICAgICAgdmFyIGRpc3RhbmNlID0gTWF0aC5hYnMoc3BhcmtsaW5lLngoKShkYXRhWzBdLCAwKSAtIHgpOworICAgICAgICAgIHZhciBjbG9zZXN0SW5kZXggPSAwOworICAgICAgICAgIGZvciAodmFyIGkgPSAwOyBpIDwgZGF0YS5sZW5ndGg7IGkrKyl7CisgICAgICAgICAgICBpZiAoTWF0aC5hYnMoc3BhcmtsaW5lLngoKShkYXRhW2ldLCBpKSAtIHgpIDwgZGlzdGFuY2UpIHsKKyAgICAgICAgICAgICAgZGlzdGFuY2UgPSBNYXRoLmFicyhzcGFya2xpbmUueCgpKGRhdGFbaV0sIGkpIC0geCk7CisgICAgICAgICAgICAgIGNsb3Nlc3RJbmRleCA9IGk7CisgICAgICAgICAgICB9CisgICAgICAgICAgfQorICAgICAgICAgIHJldHVybiBjbG9zZXN0SW5kZXg7CisgICAgICAgIH0KKworICAgICAgICBpbmRleCA9IFtnZXRDbG9zZXN0SW5kZXgoZGF0YSwgTWF0aC5yb3VuZCh4LmludmVydChwb3MpKSldOworCisgICAgICAgIHVwZGF0ZVZhbHVlTGluZSgpOworICAgICAgfQorCisgICAgfSk7CisKKyAgICByZXR1cm4gY2hhcnQ7CisgIH0KKworCisgIC8vPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisgIC8vIEV4cG9zZSBQdWJsaWMgVmFyaWFibGVzCisgIC8vLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tCisKKyAgLy8gZXhwb3NlIGNoYXJ0J3Mgc3ViLWNvbXBvbmVudHMKKyAgY2hhcnQuc3BhcmtsaW5lID0gc3BhcmtsaW5lOworCisgIG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cmV0dXJuIGNoYXJ0OworICB9OworCisgIGNoYXJ0LnlUaWNrRm9ybWF0ID0gZnVuY3Rpb24oXykgeworICAgIGlmICghYXJndW1lbnRzLmxlbmd0aCkgcmV0dXJuIHlUaWNrRm9ybWF0OworICAgIHlUaWNrRm9ybWF0ID0gXzsKKyAgICByZXR1cm4gY2hhcnQ7CisgIH07CisKKyAgY2hhcnQuc2hvd1ZhbHVlID0gZnVuY3Rpb24oXykgeworICAgIGlmICghYXJndW1lbnRzLmxlbmd0aCkgcmV0dXJuIHNob3dWYWx1ZTsKKyAgICBzaG93VmFsdWUgPSBfOworICAgIHJldHVybiBjaGFydDsKKyAgfTsKKworICBjaGFydC5hbGlnblZhbHVlID0gZnVuY3Rpb24oXykgeworICAgIGlmICghYXJndW1lbnRzLmxlbmd0aCkgcmV0dXJuIGFsaWduVmFsdWU7CisgICAgYWxpZ25WYWx1ZSA9IF87CisgICAgcmV0dXJuIGNoYXJ0OworICB9OworCisgIGNoYXJ0LnJpZ2h0QWxpZ25WYWx1ZSA9IGZ1bmN0aW9uKF8pIHsKKyAgICBpZiAoIWFyZ3VtZW50cy5sZW5ndGgpIHJldHVybiByaWdodEFsaWduVmFsdWU7CisgICAgcmlnaHRBbGlnblZhbHVlID0gXzsKKyAgICByZXR1cm4gY2hhcnQ7CisgIH07CisKKyAgY2hhcnQubm9EYXRhID0gZnVuY3Rpb24oXykgeworICAgIGlmICghYXJndW1lbnRzLmxlbmd0aCkgcmV0dXJuIG5vRGF0YTsKKyAgICBub0RhdGEgPSBfOworICAgIHJldHVybiBjaGFydDsKKyAgfTsKKworICAvLz09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorCisKKyAgcmV0dXJuIGNoYXJ0OworfQorCitudi5tb2RlbHMuc3RhY2tlZEFyZWEgPSBmdW5jdGlvbigpIHsKKworICAvLz09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09P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jYWxlKCkKKyAgICAsIHkgLy9jYW4gYmUgYWNjZXNzZWQgdmlhIGNoYXJ0LnlTY2FsZSgpCisJLCB5QXhpc1Rvb2x0aXBGb3JtYXQgPSBkMy5mb3JtYXQoJywuM2YnKQorICAgICwgc2NhdHRlciA9IG52Lm1vZGVscy5zY2F0dGVyKCkKKyAgICAsIGRpc3BhdGNoID0gIGQzLmRpc3BhdGNoKCd0b29sdGlwU2hvdycsICd0b29sdGlwSGlkZScsICdhcmVhQ2xpY2snLCAnYXJlYU1vdXNlb3ZlcicsICdhcmVhTW91c2VvdXQnKQorICAgIDsKKworICBzY2F0dGVyCisgICAgLnNpemUoMi4yKSAvLyBkZWZhdWx0IHNpemUKKyAgICAuc2l6ZURvbWFpbihbMi4yLDIuMl0pIC8vIGFsbCB0aGUgc2FtZSBzaXplIGJ5IGRlZmF1bHQKKyAgICA7CisKKyAgLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgorICAgKiBvZmZzZXQ6CisgICAqICAgJ3dpZ2dsZScgKHN0cmVhbSkKKyAgICogICAnemVybycgKHN0YWNrZWQpCisgICAqICAgJ2V4cGFuZCcgKG5vcm1hbGl6ZSB0byAxMDAlKQorICAgKiAgICdzaWxob3VldHRlJyAoc2ltcGxlIGNlbnRlcmVkKQorICAgKgorICAgKiBvcmRlcjoKKyAgICogICAnaW5zaWRlLW91dCcgKHN0cmVhbSkKKyAgICogICAnZGVmYXVsdCcgKGlucHV0IG9yZGVyKQorICAgKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLworCisgIC8vPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisKKworICBmdW5jdGlvbiBjaGFydChzZWxlY3Rpb24pIHsKKyAgICBzZWxlY3Rpb24uZWFjaChmdW5jdGlvbihkYXRhKSB7CisgICAgICB2YXIgYXZhaWxhYmxlV2lkdGggPSB3aWR0aCAtIG1hcmdpbi5sZWZ0IC0g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AgICAgIH0pOworCisKKyAgICAgIGRhdGEgPSBkMy5sYXlvdXQuc3RhY2soKQorICAgICAgICAgICAgICAgLm9yZGVyKG9yZGVyKQorICAgICAgICAgICAgICAgLm9mZnNldChvZmZzZXQpCisgICAgICAgICAgICAgICAudmFsdWVzKGZ1bmN0aW9uKGQpIHsgcmV0dXJuIGQudmFsdWVzIH0pICAvL1RPRE86IG1ha2UgdmFsdWVzIGN1c3RvbWl6ZWFibGUgaW4gRVZFUlkgbW9kZWwgaW4gdGhpcyBmYXNoaW9uCisgICAgICAgICAgICAgICAueChnZXRYKQorICAgICAgICAgICAgICAgLnkoZnVuY3Rpb24oZCkgeyByZXR1cm4gZC5zdGFja2VkWSB9KQorICAgICAgICAgICAgICAgLm91dChmdW5jdGlvbihkLCB5MCwgeSkgeworICAgICAgICAgICAgICAgICAgZC5kaXNwbGF5ID0geworICAgICAgICAgICAgICAgICAgICB5OiB5LAorICAgICAgICAgICAgICAgICAgIHkwOiB5MAorICAgICAgICAgICAgICAgICAgfTsKKyAgICAgICAgICAgICAgICB9KQorICAgICAgICAgICAgICAoZGF0YSk7CisKKworICAgICAgLy8tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0KKyAgICAgIC8vIFNldHVwIGNvbnRhaW5lcnMgYW5kIHNrZWxldG9uIG9mIGNoYXJ0CisKKyAgICAgIHZhciB3cmFwID0gY29udGFpbmVyLnNlbGVjdEFsbCgnZy5udi13cmFwLm52LXN0YWNrZWRhcmVhJykuZGF0YShbZGF0YV0pOworICAgICAgdmFyIHdyYXBFbnRlciA9IHdyYXAuZW50ZXIoKS5hcHBlbmQoJ2cnKS5hdHRyKCdjbGFzcycsICdudmQzIG52LXdyYXAgbnYtc3RhY2tlZGFyZWEnKTsKKyAgICAgIHZhciBkZWZzRW50ZXIgPSB3cmFwRW50ZXIuYXBwZW5kKCdkZWZzJyk7CisgICAgICB2YXIgZ0VudGVyID0gd3JhcEVudGVyLmFwcGVuZCgnZycpOworICAgICAgdmFyIGcgPSB3cmFwLnNlbGVjdCgnZycpOworCisgICAgICBnRW50ZXIuYXBwZW5kKCdnJykuYXR0cignY2xhc3MnLCAnbnYtYXJlYVdyYXAnKTsKKyAgICAgIGdFbnRlci5hcHBlbmQoJ2cnKS5hdHRyKCdjbGFzcycsICdudi1zY2F0dGVyV3JhcCcpOworCisgICAgICB3cmFwLmF0dHIoJ3RyYW5zZm9ybScsICd0cmFuc2xhdGUoJyArIG1hcmdpbi5sZWZ0ICsgJywnICsgbWFyZ2luLnRvcCArICcpJyk7CisKKyAgICAgIC8vLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tCisKKworICAgICAgc2NhdHRlcgorICAgICAgICAud2lkdGgoYXZhaWxhYmxlV2lkdGgpCisgICAgICAgIC5oZWlnaHQoYXZhaWxhYmxlSGVpZ2h0KQorICAgICAgICAueChnZXRYKQorICAgICAgICAueShmdW5jdGlvbihkKSB7IHJldHVybiBkLmRpc3BsYXkueSArIGQuZGlzcGxheS55MCB9KQorICAgICAgICAuZm9yY2VZKFswXSkKKyAgICAgICAgLmNvbG9yKGRhdGEubWFwKGZ1bmN0aW9uKGQsaSkgeworICAgICAgICAgIHJldHVybiBkLmNvbG9yIHx8IGNvbG9yKGQsIGkpOworICAgICAgICB9KS5maWx0ZXIoZnVuY3Rpb24oZCxpKSB7IHJldHVybiAhZGF0YVtpXS5kaXNhYmxlZCB9KSk7CisKKworICAgICAgdmFyIHNjYXR0ZXJXcmFwID0gZy5zZWxlY3QoJy5udi1zY2F0dGVyV3JhcCcpCisgICAgICAgICAgLmRhdHVtKGRhdGEuZmlsdGVyKGZ1bmN0aW9uKGQpIHsgcmV0dXJuICFkLmRpc2FibGVkIH0pKQorCisgICAgICAvL2QzLnRyYW5zaXRpb24oc2NhdHRlcldyYXApLmNhbGwoc2NhdHRlcik7CisgICAgICBzY2F0dGVyV3JhcC5jYWxsKHNjYXR0ZXIpOworCisKKworCisKKyAgICAgIGRlZnNFbnRlci5hcHBlbmQoJ2NsaXBQYXRoJykKKyAgICAgICAgICAuYXR0cignaWQnLCAnbnYtZWRnZS1jbGlwLScgKyBpZCkKKyAgICAgICAgLmFwcGVuZCgncmVjdCcpOworCisgICAgICB3cmFwLnNlbGVjdCgnI252LWVkZ2UtY2xpcC0nICsgaWQgKyAnIHJlY3QnKQorICAgICAgICAgIC5hdHRyKCd3aWR0aCcsIGF2YWlsYWJsZVdpZHRoKQorICAgICAgICAgIC5hdHRyKCdoZWlnaHQnLCBhdmFpbGFibGVIZWlnaHQpOworCisgICAgICBnICAgLmF0dHIoJ2NsaXAtcGF0aCcsIGNsaXBFZGdlID8gJ3VybCgjbnYtZWRnZS1jbGlwLScgKyBpZCArICcpJyA6ICcnKTsKKworCisKKworICAgICAgdmFyIGFyZWEgPSBkMy5zdmcuYXJlYSgpCisgICAgICAgICAgLngoZnVuY3Rpb24oZCxpKSAgeyByZXR1cm4geChnZXRYKGQsaSkpIH0pCisgICAgICAgICAgLnkwKGZ1bmN0aW9uKGQpIHsgcmV0dXJuIHkoZC5kaXNwbGF5LnkwKSB9KQorICAgICAgICAgIC55MShmdW5jdGlvbihkKSB7IHJldHVybiB5KGQuZGlzcGxheS55ICsgZC5kaXNwbGF5LnkwKSB9KQorICAgICAgICAgIC5pbnRlcnBvbGF0ZShpbnRlcnBvbGF0ZSk7CisKKyAgICAgIHZhciB6ZXJvQXJlYSA9IGQzLnN2Zy5hcmVhKCkKKyAgICAgICAgICAueChmdW5jdGlvbihkLGkpICB7IHJldHVybiB4KGdldFgoZCxpKSkgfSkKKyAgICAgICAgICAueTAoZnVuY3Rpb24oZCkgeyByZXR1cm4geShkLmRpc3BsYXkueTApIH0pCisgICAgICAgICAgLnkxKGZ1bmN0aW9uKGQpIHsgcmV0dXJuIHkoZC5kaXNwbGF5LnkwKSB9KTsKKworCisgICAgICB2YXIgcGF0aCA9IGcuc2VsZWN0KCcubnYtYXJlYVdyYXAnKS5zZWxlY3RBbGwoJ3BhdGgubnYtYXJlYScpCisgICAgICAgICAgLmRhdGEoZnVuY3Rpb24oZCkgeyByZXR1cm4gZCB9KTsKKyAgICAgICAgICAvLy5kYXRhKGZ1bmN0aW9uKGQpIHsgcmV0dXJuIGQgfSwgZnVuY3Rpb24oZCkgeyByZXR1cm4gZC5rZXkgfSk7CisgICAgICBwYXRoLmVudGVyKCkuYXBwZW5kKCdwYXRoJykuYXR0cignY2xhc3MnLCBmdW5jdGlvbihkLGkpIHsgcmV0dXJuICdudi1hcmVhIG52LWFyZWEtJyArIGkgfSkKKyAgICAgICAgICAub24oJ21vdXNlb3ZlcicsIGZ1bmN0aW9uKGQsaSkgeworICAgICAgICAgICAgZDMuc2VsZWN0KHRoaXMpLmNsYXNzZWQoJ2hvdmVyJywgdHJ1ZSk7CisgICAgICAgICAgICBkaXNwYXRjaC5hcmVhTW91c2VvdmVyKHsKKyAgICAgICAgICAgICAgcG9pbnQ6IGQsCisgICAgICAgICAgICAgIHNlcmllczogZC5rZXksCisgICAgICAgICAgICAgIHBvczogW2QzLmV2ZW50LnBhZ2VYLCBkMy5ldmVudC5wYWdlWV0sCisgICAgICAgICAgICAgIHNlcmllc0luZGV4OiBpCisgICAgICAgICAgICB9KTsKKyAgICAgICAgICB9KQorICAgICAgICAgIC5vbignbW91c2VvdXQnLCBmdW5jdGlvbihkLGkpIHsKKyAgICAgICAgICAgIGQzLnNlbGVjdCh0aGlzKS5jbGFzc2VkKCdob3ZlcicsIGZhbHNlKTsKKyAgICAgICAgICAgIGRpc3BhdGNoLmFyZWFNb3VzZW91dCh7CisgICAgICAgICAgICAgIHBvaW50OiBkLAorICAgICAgICAgICAgICBzZXJpZXM6IGQua2V5LAorICAgICAgICAgICAgICBwb3M6IFtkMy5ldmVudC5wYWdlWCwgZDMuZXZlbnQucGFnZVldLAorICAgICAgICAgICAgICBzZXJpZXNJbmRleDogaQorICAgICAgICAgICAgfSk7CisgICAgICAgICAgfSkKKyAgICAgICAgICAub24oJ2NsaWNrJywgZnVuY3Rpb24oZCxpKSB7CisgICAgICAgICAgICBkMy5zZWxlY3QodGhpcykuY2xhc3NlZCgnaG92ZXInLCBmYWxzZSk7CisgICAgICAgICAgICBkaXNwYXRjaC5hcmVhQ2xpY2soeworICAgICAgICAgICAgICBwb2ludDogZCwKKyAgICAgICAgICAgICAgc2VyaWVzOiBkLmtleSwKKyAgICAgICAgICAgICAgcG9zOiBbZDMuZXZlbnQucGFnZVgsIGQzLmV2ZW50LnBhZ2VZXSwKKyAgICAgICAgICAgICAgc2VyaWVzSW5kZXg6IGkKKyAgICAgICAgICAgIH0pOworICAgICAgICAgIH0pCisgICAgICAvL2QzLnRyYW5zaXRpb24ocGF0aC5leGl0KCkpCisgICAgICBwYXRoLmV4aXQoKQorICAgICAgICAgIC5hdHRyKCdkJywgZnVuY3Rpb24oZCxpKSB7IHJldHVybiB6ZXJvQXJlYShkLnZhbHVlcyxpKSB9KQorICAgICAgICAgIC5yZW1vdmUoKTsKKyAgICAgIHBhdGgKKyAgICAgICAgICAuc3R5bGUoJ2ZpbGwnLCBmdW5jdGlvbihkLGkpeyByZXR1cm4gZC5jb2xvciB8fCBjb2xvcihkLCBpKSB9KQorICAgICAgICAgIC5zdHlsZSgnc3Ryb2tlJywgZnVuY3Rpb24oZCxpKXsgcmV0dXJuIGQuY29sb3IgfHwgY29sb3IoZCwgaSkgfSk7CisgICAgICAvL2QzLnRyYW5zaXRpb24ocGF0aCkKKyAgICAgIHBhdGgKKyAgICAgICAgICAuYXR0cignZCcsIGZ1bmN0aW9uKGQsaSkgeyByZXR1cm4gYXJlYShkLnZhbHVlcyxpKSB9KQorCisKKyAgICAgIC8vPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisgICAgICAvLyBFdmVudCBIYW5kbGluZy9EaXNwYXRjaGluZyAoaW4gY2hhcnQncyBzY29wZSkKKyAgICAgIC8vLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tCisKKyAgICAgIHNjYXR0ZXIuZGlzcGF0Y2gub24oJ2VsZW1lbnRNb3VzZW92ZXIuYXJlYScsIGZ1bmN0aW9uKGUpIHsKKyAgICAgICAgZy5zZWxlY3QoJy5udi1jaGFydC0nICsgaWQgKyAnIC5udi1hcmVhLScgKyBlLnNlcmllc0luZGV4KS5jbGFzc2VkKCdob3ZlcicsIHRydWUpOworICAgICAgfSk7CisgICAgICBzY2F0dGVyLmRpc3BhdGNoLm9uKCdlbGVtZW50TW91c2VvdXQuYXJlYScsIGZ1bmN0aW9uKGUpIHsKKyAgICAgICAgZy5zZWxlY3QoJy5udi1jaGFydC0nICsgaWQgKyAnIC5udi1hcmVhLScgKyBlLnNlcmllc0luZGV4KS5jbGFzc2VkKCdob3ZlcicsIGZhbHNlKTsKKyAgICAgIH0pOworCisgICAgICAvLz09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorCisgICAgfSk7CisKKworICAgIHJldHVybiBjaGFydDsKKyAgfQorCisKKyAgLy89PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKyAgLy8gRXZlbnQgSGFuZGxpbmcvRGlzcGF0Y2hpbmcgKG91dCBvZiBjaGFydCdzIHNjb3BlKQorICAvLy0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLQorCisgIHNjYXR0ZXIuZGlzcGF0Y2gub24oJ2VsZW1lbnRDbGljay5hcmVhJywgZnVuY3Rpb24oZSkgeworICAgIGRpc3BhdGNoLmFyZWFDbGljayhlKTsKKyAgfSkKKyAgc2NhdHRlci5kaXNwYXRjaC5vbign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md1bWVudHMubGVuZ3RoKSByZXR1cm4gY2xpcEVkZ2U7CisgICAgY2xpcEVkZ2UgPSBfOworICAgIHJldHVybiBjaGFydDsKKyAgfTsKKworICBjaGFydC5jb2xvciA9IGZ1bmN0aW9uKF8pIHsKKyAgICBpZiAoIWFyZ3VtZW50cy5sZW5ndGgpIHJldHVybiBjb2xvcjsKKyAgICBjb2xvciA9IG52LnV0aWxzLmdldENvbG9yKF8pOworICAgIHJldHVybiBjaGFydDsKKyAgfTsKKworICBjaGFydC5vZmZzZXQgPSBmdW5jdGlvbihfKSB7CisgICAgaWYgKCFhcmd1bWVudHMubGVuZ3RoKSByZXR1cm4gb2Zmc2V0OworICAgIG9mZnNldCA9IF87CisgICAgcmV0dXJuIGNoYXJ0OworICB9OworCisgIGNoYXJ0Lm9yZGVyID0gZnVuY3Rpb24oXykgeworICAgIGlmICghYXJndW1lbnRzLmxlbmd0aCkgcmV0dXJuIG9yZGVyOworICAgIG9yZGVyID0gXzsKKyAgICByZXR1cm4gY2hhcnQ7CisgIH07CisKKyAgLy9zaG9ydGN1dCBmb3Igb2Zmc2V0ICsgb3JkZXIKKyAgY2hhcnQuc3R5bGUgPSBmdW5jdGlvbihfKSB7CisgICAgaWYgKCFhcmd1bWVudHMubGVuZ3RoKSByZXR1cm4gc3R5bGU7CisgICAgc3R5bGUgPSBfOworCisgICAgc3dpdGNoIChzdHlsZSkgeworICAgICAgY2FzZSAnc3RhY2snOgorICAgICAgICBjaGFydC5vZmZzZXQoJ3plcm8nKTsKKyAgICAgICAgY2hhcnQub3JkZXIoJ2RlZmF1bHQnKTsKKyAgICAgICAgYnJlYWs7CisgICAgICBjYXNlICdzdHJlYW0nOgorICAgICAgICBjaGFydC5vZmZzZXQoJ3dpZ2dsZScpOworICAgICAgICBjaGFydC5vcmRlcignaW5zaWRlLW91dCcpOworICAgICAgICBicmVhazsKKyAgICAgIGNhc2UgJ3N0cmVhbS1jZW50ZXInOgorICAgICAgICAgIGNoYXJ0Lm9mZnNldCgnc2lsaG91ZXR0ZScpOworICAgICAgICAgIGNoYXJ0Lm9yZGVyKCdpbnNpZGUtb3V0Jyk7CisgICAgICAgICAgYnJlYWs7CisgICAgICBjYXNlICdleHBhbmQnOgorICAgICAgICBjaGFydC5vZmZzZXQoJ2V4cGFuZCcpOworICAgICAgICBjaGFydC5vcmRlcignZGVmYXVsdCcpOworICAgICAgICBicmVhazsKKyAgICB9CisKKyAgICByZXR1cm4gY2hhcnQ7CisgIH07CisKKyAgY2hhcnQuaW50ZXJwb2xhdGUgPSBmdW5jdGlvbihfKSB7CisJICAgIGlmICghYXJndW1lbnRzLmxlbmd0aCkgcmV0dXJuIGludGVycG9sYXRlOworCSAgICBpbnRlcnBvbGF0ZSA9IF87CisJICAgIHJldHVybiBpbnRlcnBvbGF0ZTsKKyAgCisgIH07CisgIAorICAvLz09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorCisKKyAgcmV0dXJuIGNoYXJ0OworfQorCitudi5tb2RlbHMuc3RhY2tlZEFyZWFDaGFydCA9IGZ1bmN0aW9uKCkgeworCisgIC8vPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisgIC8vIFB1YmxpYyBWYXJpYWJsZXMgd2l0aCBEZWZhdWx0IFNldHRpbmdzCisgIC8vLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tCisKKyAgdmFyIHN0YWNrZWQgPSBudi5tb2RlbHMuc3RhY2tlZEFyZWEoKQorICAgICwgeEF4aXMgPSBudi5tb2RlbHMuYXhpcygpCisgICAgLCB5QXhpcyA9IG52Lm1vZGVscy5heGlzKCkKKyAgICAsIGxlZ2VuZCA9IG52Lm1vZGVscy5sZWdlbmQoKQorICAgICwgY29udHJvbHMgPSBudi5tb2RlbHMubGVnZW5kKCkKKyAgICA7Cis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yAgICAub3JpZW50KCdib3R0b20nKQorICAgIC50aWNrUGFkZGluZyg3KQorICAgIDsKKyAgeUF4aXMKKyAgICAub3JpZW50KCdsZWZ0JykKKyAgICA7CisgIHN0YWNrZWQuc2NhdHRlcgorICAgIC5wb2ludEFjdGl2ZShmdW5jdGlvbihkKSB7CisgICAgICAvL2NvbnNvbGUubG9nKHN0YWNrZWQueSgpKGQpLCAhIU1hdGgucm91bmQoc3RhY2tlZC55KCkoZCkgKiAxMDApKTsKKyAgICAgIHJldHVybiAhIU1hdGgucm91bmQoc3RhY2tlZC55KCkoZCkgKiAxMDApOworICAgIH0pCisgICAgOworCisgIC8vPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisKKworICAvLz09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorICAvLyBQcml2YXRlIFZhcmlhYmxlcworICAvLy0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLQorCisgIHZhciBzaG93VG9vbHRpcCA9IGZ1bmN0aW9uKGUsIG9mZnNldEVsZW1lbnQpIHsKKyAgICB2YXIgbGVmdCA9IGUucG9zWzBdICsgKCBvZmZzZXRFbGVtZW50Lm9mZnNldExlZnQgfHwgMCApLAorICAgICAgICB0b3AgPSBlLnBvc1sxXSArICggb2Zmc2V0RWxlbWVudC5vZmZzZXRUb3AgfHwgMCksCisgICAgICAgIHggPSB4QXhpcy50aWNrRm9ybWF0KCkoc3RhY2tlZC54KCkoZS5wb2ludCwgZS5wb2ludEluZGV4KSksCisgICAgICAgIC8veSA9IHlBeGlzLnRpY2tGb3JtYXQoKShzdGFja2VkLnkoKShlLnBvaW50LCBlLnBvaW50SW5kZXgpKSwKKwkJIHkgPSB5QXhpc1Rvb2x0aXBGb3JtYXQoc3RhY2tlZC55KCkoZS5wb2ludCwgZS5wb2ludEluZGV4KSksCisgICAgICAgIGNvbnRlbnQgPSB0b29sdGlwKGUuc2VyaWVzLmtleSwgeCwgeSwgZSwgY2hhcnQpOworCisgICAgbnYudG9vbHRpcC5zaG93KFtsZWZ0LCB0b3BdLCBjb250ZW50LCBlLnZhbHVlIDwgMCA/ICduJyA6ICdzJywgbnVsbCwgb2Zmc2V0RWxlbWVudCk7CisgIH07CisKKyAgLy89PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKworCisgIGZ1bmN0aW9uIGNoYXJ0KHNlbGVjdGlvbikgeworICAgIHNlbGVjdGlvbi5lYWNoKGZ1bmN0aW9uKGRhdGEpIHsKKyAgICAgIHZhciBjb250YWluZXIgPSBkMy5zZWxlY3QodGhpcyksCisgICAgICAgICAgdGhhdCA9IHRoaXM7CisKKyAgICAgIHZhciBhdmFpbGFibGVXaWR0aCA9ICh3aWR0aCAgfHwgcGFyc2VJbnQoY29udGFpbmVyLnN0eWxlKCd3aWR0aCcpKSB8fCA5NjApCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC0gbWFyZ2luLmxlZnQgLSBtYXJnaW4ucmlnaHQsCisgICAgICAgICAgYXZhaWxhYmxlSGVpZ2h0ID0gKGhlaWdodCB8fCBwYXJzZUludChjb250YWluZXIuc3R5bGUoJ2hlaWdodCcpKSB8fCA0MDApCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC0gbWFyZ2luLnRvcCAtIG1hcmdpbi5ib3R0b207CisKKyAgICAgIGNoYXJ0LnVwZGF0ZSA9IGZ1bmN0aW9uKCkgeyBjb250YWluZXIudHJhbnNpdGlvbigpLmNhbGwoY2hhcnQpOyB9OworICAgICAgY2hhcnQuY29udGFpbmVyID0gdGhpczsKKworICAgICAgLy9zZXQgc3RhdGUuZGlzYWJsZWQKKyAgICAgIHN0YXRlLmRpc2FibGVkID0gZGF0YS5tYXAoZnVuY3Rpb24oZCkgeyByZXR1cm4gISFkLmRpc2FibGVkIH0pOworCisgICAgICBpZiAoIWRlZmF1bHRTdGF0ZSkgeworICAgICAgICB2YXIga2V5OworICAgICAgICBkZWZhdWx0U3RhdGUgPSB7fTsKKyAgICAgICAgZm9yIChrZXkgaW4gc3RhdGUpIHsKKyAgICAgICAgICBpZiAoc3RhdGVba2V5XSBpbnN0YW5jZW9mIEFycmF5KQorICAgICAgICAgICAgZGVmYXVsdFN0YXRlW2tleV0gPSBzdGF0ZVtrZXldLnNsaWNlKDApOworICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgIGRlZmF1bHRTdGF0ZVtrZXldID0gc3RhdGVba2V5XTsKKyAgICAgICAgfQorICAgICAgfQorCisgICAgICAvLy0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLQorICAgICAgLy8gRGlzcGxheSBObyBEYXRhIG1lc3NhZ2UgaWYgdGhlcmUncyBub3RoaW5nIHRvIHNob3cuCisKKyAgICAgIGlmICghZGF0YSB8fCAhZGF0YS5sZW5ndGggfHwgIWRhdGEuZmlsdGVyKGZ1bmN0aW9uKGQpIHsgcmV0dXJuIGQudmFsdWVzLmxlbmd0aCB9KS5sZW5ndGgpIHsKKyAgICAgICAgdmFyIG5vRGF0YVRleHQgPSBjb250YWluZXIuc2VsZWN0QWxsKCcubnYtbm9EYXRhJykuZGF0YShbbm9EYXRhXSk7CisKKyAgICAgICAgbm9EYXRhVGV4dC5lbnRlcigpLmFwcGVuZCgndGV4dCcpCisgICAgICAgICAgLmF0dHIoJ2NsYXNzJywgJ252ZDMgbnYtbm9EYXRhJykKKyAgICAgICAgICAuYXR0cignZHknLCAnLS43ZW0nKQorICAgICAgICAgIC5zdHlsZSgndGV4dC1hbmNob3InLCAnbWlkZGxlJyk7CisKKyAgICAgICAgbm9EYXRhVGV4dAorICAgICAgICAgIC5hdHRyKCd4JywgbWFyZ2luLmxlZnQgKyBhdmFpbGFibGVX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ZWlnaHQnKSkgfHwgNDAwKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAtIG1hcmdpbi50b3AgLSBtYXJnaW4uYm90dG9tOworICAgICAgICB9CisKKyAgICAgICAgZy5zZWxlY3QoJy5udi1sZWdlbmRXcmFwJykKKyAgICAgICAgICAgIC5hdHRyKCd0cmFuc2Zvcm0nLCAndHJhbnNsYXRlKCcgKyBjb250cm9sV2lkdGggKyAnLCcgKyAoLW1hcmdpbi50b3ApICsnKScpOworICAgICAgfQorCisgICAgICAvLy0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLQorCisKKyAgICAgIC8vLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tCisgICAgICAvLyBDb250cm9scworCisgICAgICBpZiAoc2hvd0NvbnRyb2xzKSB7CisgICAgICAgIHZhciBjb250cm9sc0RhdGEgPSBbCisgICAgICAgICAgeyBrZXk6ICdTdGFja2VkJywgZGlzYWJsZWQ6IHN0YWNrZWQub2Zmc2V0KCkgIT0gJ3plcm8nIH0sCisgICAgICAgICAgeyBrZXk6ICdTdHJlYW0nLCBkaXNhYmxlZDogc3RhY2tlZC5vZmZzZXQoKSAhPSAnd2lnZ2xlJyB9LAorICAgICAgICAgIHsga2V5OiAnRXhwYW5kZWQnLCBkaXNhYmxlZDogc3RhY2tlZC5vZmZzZXQoKSAhPSAnZXhwYW5kJyB9CisgICAgICAgIF07CisKKyAgICAgICAgY29udHJvbHMKKyAgICAgICAgICAud2lkdGgoIGNvbnRyb2xXaWR0aCApCisgICAgICAgICAgLmNvbG9yKFsnIzQ0NCcsICcjNDQ0JywgJyM0NDQnXSk7CisKKyAgICAgICAgZy5zZWxlY3QoJy5udi1jb250cm9sc1dyYXAnKQorICAgICAgICAgICAgLmRhdHVtKGNvbnRyb2xzRGF0YSkKKyAgICAgICAgICAgIC5jYWxsKGNvbnRyb2xzKTsKKworCisgICAgICAgIGlmICggbWFyZ2luLnRvcCAhPSBNYXRoLm1heChjb250cm9scy5oZWlnaHQoKSwgbGVnZW5kLmhlaWdodCgpKSApIHsKKyAgICAgICAgICBtYXJnaW4udG9wID0gTWF0aC5tYXgoY29udHJvbHMuaGVpZ2h0KCksIGxlZ2VuZC5oZWlnaHQoKSk7CisgICAgICAgICAgYXZhaWxhYmxlSGVpZ2h0ID0gKGhlaWdodCB8fCBwYXJzZUludChjb250YWluZXIuc3R5bGUoJ2hlaWdodCcpKSB8fCA0MDApCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC0gbWFyZ2luLnRvcCAtIG1hcmdpbi5ib3R0b207CisgICAgICAgIH0KKworCisgICAgICAgIGcuc2VsZWN0KCcubnYtY29udHJvbHNXcmFwJykKKyAgICAgICAgICAgIC5hdHRyKCd0cmFuc2Zvcm0nLCAndHJhbnNsYXRlKDAsJyArICgtbWFyZ2luLnRvcCkgKycpJyk7CisgICAgICB9CisKKyAgICAgIC8vLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tCisKKworICAgICAgd3JhcC5hdHRyKCd0cmFuc2Zvcm0nLCAndHJhbnNsYXRlKCcgKyBtYXJnaW4ubGVmdCArICcsJyArIG1hcmdpbi50b3AgKyAnKScpOworCisKKyAgICAgIC8vLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tCisgICAgICAvLyBNYWluIENoYXJ0IENvbXBvbmVudChzKQorCisgICAgICBzdGFja2VkCisgICAgICAgIC53aWR0aChhdmFpbGFibGVXaWR0aCkKKyAgICAgICAgLmhlaWdodChhdmFpbGFibGVIZWlnaHQpCisKKyAgICAgIHZhciBzdGFja2VkV3JhcCA9IGcuc2VsZWN0KCcubnYtc3RhY2t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0gJ2V4cGFuZCcgPyBkMy5mb3JtYXQoJyUnKSA6IHlBeGlzVGlja0Zvcm1hdCk7CisKKyAgICAgIC8vZDMudHJhbnNpdGlvbihnLnNlbGVjdCgnLm52LXkubnYtYXhpcycpKQorICAgICAgZy5zZWxlY3QoJy5udi15Lm52LWF4aXMnKQorICAgICAgICAudHJhbnNpdGlvbigpLmR1cmF0aW9uKDApCisgICAgICAgICAgLmNhbGwoeUF4aXMpOworCisgICAgICAvLy0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLQorCisKKyAgICAgIC8vPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisgICAgICAvLyBFdmVudCBIYW5kbGluZy9EaXNwYXRjaGluZyAoaW4gY2hhcnQncyBzY29wZSkKKyAgICAgIC8vLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tCisKKyAgICAgIHN0YWNrZWQuZGlzcGF0Y2gub24oJ2FyZWFDbGljay50b2dnbGUnLCBmdW5jdGlvbihlKSB7CisgICAgICAgIGlmIChkYXRhLmZpbHRlcihmdW5jdGlvbihkKSB7IHJldHVybiAhZC5kaXNhYmxlZCB9KS5sZW5ndGggPT09IDEpCisgICAgICAgICAgZGF0YSA9IGRhdGEubWFwKGZ1bmN0aW9uKGQpIHsKKyAgICAgICAgICAgIGQuZGlzYWJsZWQgPSBmYWxzZTsKKyAgICAgICAgICAgIHJldHVybiBkCisgICAgICAgICAgfSk7CisgICAgICAgIGVsc2UKKyAgICAgICAgICBkYXRhID0gZGF0YS5tYXAoZnVuY3Rpb24oZCxpKSB7CisgICAgICAgICAgICBkLmRpc2FibGVkID0gKGkgIT0gZS5zZXJpZXNJbmRleCk7CisgICAgICAgICAgICByZXR1cm4gZAorICAgICAgICAgIH0pOwor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GEuZm9yRWFjaChmdW5jdGlvbihkKSB7CisgICAgICAgICAgICAgZC5kaXNhYmxlZCA9IHRydWU7CisgICAgICAgICAgfSk7CisgICAgICAgICAgZC5kaXNhYmxlZCA9IGZhbHNlOyAgCisKKyAgICAgICAgICBzdGF0ZS5kaXNhYmxlZCA9IGRhdGEubWFwKGZ1bmN0aW9uKGQpIHsgcmV0dXJuICEhZC5kaXNhYmxlZCB9KTsKKyAgICAgICAgICBkaXNwYXRjaC5zdGF0ZUNoYW5nZShzdGF0ZSk7CisgICAgICAgICAgY2hhcnQudXBkYXRlKCk7CisgICAgICB9KTsKKworICAgICAgY29udHJvbHMuZGlzcGF0Y2gub24oJ2xlZ2VuZENsaWNrJywgZnVuY3Rpb24oZCxpKSB7CisgICAgICAgIGlmICghZC5kaXNhYmxlZCkgcmV0dXJuOworCisgICAgICAgIGNvbnRyb2xzRGF0YSA9IGNvbnRyb2xzRGF0YS5tYXAoZnVuY3Rpb24ocykgeworICAgICAgICAgIHMuZGlzYWJsZWQgPSB0cnVlOworICAgICAgICAgIHJldHVybiBzOworICAgICAgICB9KTsKKyAgICAgICAgZC5kaXNhYmxlZCA9IGZhbHNlOworCisgICAgICAgIHN3aXRjaCAoZC5rZXkpIHsKKyAgICAgICAgICBjYXNlICdTdGFja2VkJzoKKyAgICAgICAgICAgIHN0YWNrZWQuc3R5bGUoJ3N0YWNrJyk7CisgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICBjYXNlICdTdHJlYW0nOgorICAgICAgICAgICAgc3RhY2tlZC5zdHlsZSgnc3RyZWFtJyk7CisgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICBjYXNlICdFeHBhbmRlZCc6CisgICAgICAgICAgICBzdGFja2VkLnN0eWxlKCdleHBhbmQnKTsKKyAgICAgICAgICAgIGJyZWFrOworICAgICAgICB9CisKKyAgICAgICAgc3RhdGUuc3R5bGUgPSBzdGFja2VkLnN0eWxlKCk7CisgICAgICAgIGRpc3BhdGNoLnN0YXRlQ2hhbmdlKHN0YXRlKTsKKworICAgICAgICAvL3NlbGVjdGlvbi50cmFuc2l0aW9uKCkuY2FsbChjaGFydCk7CisgICAgICAgIGNoYXJ0LnVwZGF0ZSgpOworICAgICAgfSk7CisKKyAgICAgIGRpc3BhdGNoLm9uKCd0b29sdGlwU2hvdycsIGZ1bmN0aW9uKGUpIHsKKyAgICAgICAgaWYgKHRvb2x0aXBzKSBzaG93VG9vbHRpcChlLCB0aGF0LnBhcmVudE5vZGUpOworICAgICAgfSk7CisKKyAgICAgIC8vIFVwZGF0ZSBjaGFydCBmcm9tIGEgc3RhdGUgb2JqZWN0IHBhc3NlZCB0byBldmVudCBoYW5kbGVyCisgICAgICBkaXNwYXRjaC5vbignY2hhbmdlU3RhdGUnLCBmdW5jdGlvbihlKSB7CisKKyAgICAgICAgaWYgKHR5cGVvZiBlLmRpc2FibGVkICE9PSAndW5kZWZpbmVkJykgeworICAgICAgICAgIGRhdGEuZm9yRWFjaChmdW5jdGlvbihzZXJpZXMsaSkgeworICAgICAgICAgICAgc2VyaWVzLmRpc2FibGVkID0gZS5kaXNhYmxlZFtpXTsKKyAgICAgICAgICB9KTsKKworICAgICAgICAgIHN0YXRlLmRpc2FibGVkID0gZS5kaXNhYmxlZDsKKyAgICAgICAgfQorCisgICAgICAgIGlmICh0eXBlb2YgZS5zdHlsZSAhPT0gJ3VuZGVmaW5lZCcpIHsKKyAgICAgICAgICBzdGFja2VkLnN0eWxlKGUuc3R5bGUpOworICAgICAgICB9CisKKyAgICAgICAgY2hhcnQudXBkYXRlKCk7CisgICAgICB9KTsKKworICAgIH0pOworCisKKyAgICByZXR1cm4gY2hhcnQ7CisgIH0KKworCisgIC8vPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisgIC8vIEV2ZW50IEhhbmRsaW5nL0Rpc3BhdGNoaW5nIChvdXQgb2YgY2hhcnQncyBzY29wZSkKKyAgLy8tLS0tLS0tLS0tLS0t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worICB9KTsKKworICAvLz09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorCisKKyAgLy89PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKyAgLy8gRXhwb3NlIFB1YmxpYyBWYXJpYWJsZXMKKyAgLy8tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0KKworICAvLyBleHBvc2UgY2hhcnQncyBzdWItY29tcG9uZW50cworICBjaGFydC5kaXNwYXRjaCA9IGRpc3BhdGNoOworICBjaGFydC5zdGFja2VkID0gc3RhY2tlZDsKKyAgY2hhcnQubGVnZW5kID0gbGVnZW5kOworICBjaGFydC5jb250cm9scyA9IGNvbnRyb2xzOworICBjaGFydC54QXhpcyA9IHhBeGlzOworICBjaGFydC55QXhpcyA9IHlBeGlzOworCisgIGQzLnJlYmluZChjaGFydCwgc3RhY2tlZCwgJ3gnLCAneScsICdzaXplJywgJ3hTY2FsZScsICd5U2NhbGUnLCAneERvbWFpbicsICd5RG9tYWluJywgJ3NpemVEb21haW4nLCAnaW50ZXJhY3RpdmUnLCAnb2Zmc2V0JywgJ29yZGVyJywgJ3N0eWxlJywgJ2NsaXBFZGdlJywgJ2ZvcmNlWCcsICdmb3JjZVknLCAnZm9yY2VTaXplJywgJ2ludGVycG9sYXRlJyk7CisKKyAgY2hhcnQubWFyZ2luID0gZnVuY3Rpb24oXykgeworICAgIGlmICghYXJndW1lbnRzLmxlbmd0aCkgcmV0dXJuIG1hcmdpbjsKKyAgICBtYXJnaW4udG9wICAgID0gdHlwZW9mIF8udG9wICAgICE9ICd1bmRlZmluZWQnID8gXy50b3AgICAgOiBtYXJnaW4udG9wOworICAgIG1hcmdpbi5yaWdodCAgPSB0eXBlb2YgXy5yaWdodCAgIT0gJ3VuZGVmaW5lZCcgPyBfLnJpZ2h0IC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vd0xlZ2VuZDsKKyAgICBzaG93TGVnZW5kID0gXzsKKyAgICByZXR1cm4gY2hhcnQ7CisgIH07CisKKyAgY2hhcnQudG9vbHRpcCA9IGZ1bmN0aW9uKF8pIHsKKyAgICBpZiAoIWFyZ3VtZW50cy5sZW5ndGgpIHJldHVybiB0b29sdGlwOworICAgIHRvb2x0aXAgPSBfOworICAgIHJldHVybiBjaGFydDsKKyAgfTsKKworICBjaGFydC50b29sdGlwcyA9IGZ1bmN0aW9uKF8pIHsKKyAgICBpZiAoIWFyZ3VtZW50cy5sZW5ndGgpIHJldHVybiB0b29sdGlwczsKKyAgICB0b29sdGlwcyA9IF87CisgICAgcmV0dXJuIGNoYXJ0OworICB9OworCisgIGNoYXJ0LnRvb2x0aXBDb250ZW50ID0gZnVuY3Rpb24oXykgeworICAgIGlmICghYXJndW1lbnRzLmxlbmd0aCkgcmV0dXJuIHRvb2x0aXA7CisgICAgdG9vbHRpcCA9IF87CisgICAgcmV0dXJuIGNoYXJ0OworICB9OworICAKKyAgY2hhcnQueUF4aXNUb29sdGlwRm9ybWF0ID0gZnVuY3Rpb24oXykgeworICAgIGlmICghYXJndW1lbnRzLmxlbmd0aCkgcmV0dXJuIHlBeGlzVG9vbHRpcEZvcm1hdDsKKyAgICB5QXhpc1Rvb2x0aXBGb3JtYXQgPSBfOworICAgIHJldHVybiBjaGFydDsKKyAgfTsKKyAgY2hhcnQuc3RhdGUgPSBmdW5jdGlvbihfKSB7CisgICAgaWYgKCFhcmd1bWVudHMubGVuZ3RoKSByZXR1cm4gc3RhdGU7CisgICAgc3RhdGUgPSBfOworICAgIHJldHVybiBjaGFydDsKKyAgfTsKKworICBjaGFydC5kZWZhdWx0U3RhdGUgPSBmdW5jdGlvbihfKSB7CisgICAgaWYgKCFhcmd1bWVudHMubGVuZ3RoKSByZXR1cm4gZGVmYXVsdFN0YXRlOworICAgIGRlZmF1bHRTdGF0ZSA9IF87CisgICAgcmV0dXJuIGNoYXJ0OworICB9OworCisgIGN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dGggPSAyNCwKKyAgICAgIG5vZGVQYWRkaW5nID0gOCwKKyAgICAgIHNpemUgPSBbMSwgMV0sCisgICAgICBub2RlcyA9IFtdLAorICAgICAgbGlua3MgPSBbXTsKKworICBzYW5rZXkubm9kZVdpZHRoID0gZnVuY3Rpb24oXykgeworICAgIGlmICghYXJndW1lbnRzLmxlbmd0aCkgcmV0dXJuIG5vZGVXaWR0aDsKKyAgICBub2RlV2lkdGggPSArXzsKKyAgICByZXR1cm4gc2Fua2V5OworICB9OworCisgIHNhbmtleS5ub2RlUGFkZGluZyA9IGZ1bmN0aW9uKF8pIHsKKyAgICBpZiAoIWFyZ3VtZW50cy5sZW5ndGgpIHJldHVybiBub2RlUGFkZGluZzsKKyAgICBub2RlUGFkZGluZyA9ICtfOworICAgIHJldHVybiBzYW5rZXk7CisgIH07CisKKyAgc2Fua2V5Lm5vZGVzID0gZnVuY3Rpb24oXykgeworICAgIGlmICghYXJndW1lbnRzLmxlbmd0aCkgcmV0dXJuIG5vZGVzOworICAgIG5vZGVzID0gXzsKKyAgICByZXR1cm4gc2Fua2V5OworICB9OworCisgIHNhbmtleS5saW5rcyA9IGZ1bmN0aW9uKF8pIHsKKyAgICBpZiAoIWFyZ3VtZW50cy5sZW5ndGgpIHJldHVybiBsaW5rczsKKyAgICBsaW5rcyA9IF87CisgICAgcmV0dXJuIHNhbmtleTsKKyAgfTsKKworICBzYW5rZXkuc2l6ZSA9IGZ1bmN0aW9uKF8pIHsKKyAgICBpZiAoIWFyZ3VtZW50cy5sZW5ndGgpIHJldHVybiBzaXplOworICAgIHNpemUgPSBfOworICAgIHJldHVybiBzYW5rZXk7CisgIH07CisKKyAgc2Fua2V5LmxheW91dCA9IGZ1bmN0aW9uKGl0ZXJhdGlvbnMpIHsKKyAgICBjb21wdXRlTm9kZUxpbmtzKCk7CisgICAgY29tcHV0ZU5vZGVWYWx1ZXMoKTsKKyAgICBjb21wdXRlTm9kZUJyZWFkdGhzKCk7CisgICAgY29tcHV0ZU5vZGVEZXB0aHMoaXRlcmF0aW9ucyk7CisgICAgY29tcHV0ZUxpbmtEZXB0aHMoKTsKKyAgICByZXR1cm4gc2Fua2V5OworICB9OworCisgIHNhbmtleS5yZWxheW91dCA9IGZ1bmN0aW9uKCkgeworICAgIGNvbXB1dGVMaW5rRGVwdGhzKCk7CisgICAgcmV0dXJuIHNhbmtleTsKKyAgfTsKKworICBzYW5rZXkubGluayA9IGZ1bmN0aW9uKCkgeworICAgIHZhciBjdXJ2YXR1cmUgPSAuNTsKKworICAgIGZ1bmN0aW9uIGxpbmsoZCkgeworICAgICAgdmFyIHgwID0gZC5zb3VyY2UueCArIGQuc291cmNlLmR4LAorICAgICAgICAgIHgxID0gZC50YXJnZXQueCwKKyAgICAgICAgICB4aSA9IGQzLmludGVycG9sYXRlTnVtYmVyKHgwLCB4MSksCisgICAgICAgICAgeDIgPSB4aShjdXJ2YXR1cmUpLAorICAgICAgICAgIHgzID0geGkoMSAtIGN1cnZhdHVyZSksCisgICAgICAgICAgeTAgPSBkLnNvdXJjZS55ICsgZC5zeSArIGQuZHkgLyAyLAorICAgICAgICAgIHkxID0gZC50YXJnZXQueSArIGQudHkgKyBkLmR5IC8gMjsKKyAgICAgIHJldHVybiAiTSIgKyB4MCArICIsIiArIHkwCisgICAgICAgICAgICsgIkMiICsgeDIgKyAiLCIgKyB5MAorICAgICAgICAgICArICIgIiArIHgzICsgIiwiICsgeTEKKyAgICAgICAgICAgKyAiICIgKyB4MSArICIsIiArIHkxOworICAgIH0KKworICAgIGxpbmsuY3VydmF0dXJlID0gZnVuY3Rpb24oXykgeworICAgICAgaWYgKCFhcmd1bWVudHMubGVuZ3RoKSByZXR1cm4gY3VydmF0dXJlOworICAgICAgY3VydmF0dXJlID0gK187CisgICAgICByZXR1cm4gbGluazsKKyAgICB9OworCisgICAgcmV0dXJuIGxpbms7CisgIH07CisKKyAgLy8gUG9wdWxhdGUgdGhlIHNvdXJjZUxpbmtzIGFuZCB0YXJnZXRMaW5rcyBm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JhdGlvbnMpIHsKKyAgICAgIHJlbGF4UmlnaHRUb0xlZnQoYWxwaGEgKj0gLjk5KTsKKyAgICAgIHJlc29sdmVDb2xsaXNpb25zKCk7CisgICAgICByZWxheExlZnRUb1JpZ2h0KGFscGhhKTsKKyAgICAgIHJlc29sdmVDb2xsaXNpb25zKCk7CisgICAgfQorCisgICAgZnVuY3Rpb24gaW5pdGlhbGl6ZU5vZGVEZXB0aCgpIHsKKyAgICAgIHZhciBreSA9IGQzLm1pbihub2Rlc0J5QnJlYWR0aCwgZnVuY3Rpb24obm9kZXMpIHsKKyAgICAgICAgcmV0dXJuIChzaXplWzFdIC0gKG5vZGVzLmxlbmd0aCAtIDEpICogbm9kZVBhZGRpbmcpIC8gZDMuc3VtKG5vZGVzLCB2YWx1ZSk7CisgICAgICB9KTsKKworICAgICAgbm9kZXNCeUJyZWFkdGguZm9yRWFjaChmdW5jdGlvbihub2RlcykgeworICAgICAgICBub2Rlcy5mb3JFYWNoKGZ1bmN0aW9uKG5vZGUsIGkpIHsKKyAgICAgICAgICBub2RlLnkgPSBpOworICAgICAgICAgIG5vZGUuZHkgPSBub2RlLnZhbHVlICoga3k7CisgICAgICAgIH0pOworICAgICAgfSk7CisKKyAgICAgIGxpbmtzLmZvckVhY2goZnVuY3Rpb24obGluaykgeworICAgICAgICBsaW5rLmR5ID0gbGluay52YWx1ZSAqIGt5OworICAgICAgfSk7CisgICAgfQorCisgICAgZnVuY3Rpb24gcmVsYXhMZWZ0VG9SaWdodChhbHBoYSkgeworICAgICAgbm9kZXNCeUJyZWFkdGguZm9yRWFjaChmdW5jdGlvbihub2RlcywgYnJlYWR0aCkgeworICAgICAgICBub2Rlcy5mb3JFYWNoKGZ1bmN0aW9uKG5vZGUpIHsKKyAgICAgICAgICBpZiAobm9kZS50YXJnZXRMaW5rcy5sZW5ndGgpIHsKKyAgICAgICAgICAgIHZhciB5ID0gZDMuc3VtKG5vZGUudGFyZ2V0TGlua3MsIHdlaWdodGVkU291cmNlKSAvIGQzLnN1bShub2RlLnRhcmdldExpbmtzLCB2YWx1ZSk7CisgICAgICAgICAgICBub2RlLnkgKz0gKHkgLSBjZW50ZXIobm9kZSkpICogYWxwaGE7CisgICAgICAgICAgfQorICAgICAgICB9KTsKKyAgICAgIH0pOworCisgICAgICBmdW5jdGlvbiB3ZWlnaHRlZFNvdXJjZShsaW5rKSB7CisgICAgICAgIHJldHVybiBjZW50ZXIobGluay5zb3VyY2UpICogbGluay52YWx1ZTsKKyAgICAgIH0KKyAgICB9CisKKyAgICBmdW5jdGlvbiByZWxheFJpZ2h0VG9MZWZ0KGFscGhhKSB7CisgICAgICBub2Rlc0J5QnJlYWR0aC5zbGljZSgpLnJldmVyc2UoKS5mb3JFYWNoKGZ1bmN0aW9uKG5vZGVzKSB7CisgICAgICAgIG5vZGVzLmZvckVhY2goZnVuY3Rpb24obm9kZSkgeworICAgICAgICAgIGlmIChub2RlLnNvdXJjZUxpbmtzLmxlbmd0aCkgeworICAgICAgICAgICAgdmFyIHkgPSBkMy5zdW0obm9kZS5zb3VyY2VMaW5rcywgd2VpZ2h0ZWRUYXJnZXQpIC8gZDMuc3VtKG5vZGUuc291cmNlTGlua3MsIHZhbHVlKTsKKyAgICAgICAgICAgIG5vZGUueSArPSAoeSAtIGNlbnRlcihub2RlKSkgKiBhbHBoYTsKKyAgICAgICAgICB9CisgICAgICAgIH0pOworICAgICAgfSk7CisKKyAgICAgIGZ1bmN0aW9uIHdlaWdodGVkVGFyZ2V0KGxpbmspIHsKKyAgICAgICAgcmV0dXJuIGNlbnRlcihsaW5rLnRhcmdldCkgKiBsaW5rLnZhbHVlOworICAgICAgfQorICAgIH0KKworICAgIGZ1bmN0aW9uIHJlc29sdmVDb2xsaXNpb25zKCkgeworICAgICAgbm9kZXNCeUJyZWFkdGguZm9yRWFjaChmdW5jdGlvbihub2RlcykgeworICAgICAgICB2YXIgbm9kZSwKKyAgICAgICAgICAgIGR5LAorICAgICAgICAgICAgeTAgPSAwLAorICAgICAgICAgICAgbiA9IG5vZGVzLmxlbmd0aCwKKyAgICAgICAgICAgIGk7CisKKyAgICAgICAgLy8gUHVzaCBhbnkgb3ZlcmxhcHBpbmcgbm9kZXMgZG93bi4KKyAgICAgICAgbm9kZXMuc29ydChhc2NlbmRpbmdEZXB0aCk7CisgICAgICAgIGZvciAoaSA9IDA7IGkgPCBuOyArK2kpIHsKKyAgICAgICAgICBub2RlID0gbm9kZXNbaV07CisgICAgICAgICAgZHkgPSB5MCAtIG5vZGUueTsKKyAgICAgICAgICBpZiAoZHkgPiAwKSBub2RlLnkgKz0gZHk7CisgICAgICAgICAgeTAgPSBub2RlLnkgKyBub2RlLmR5ICsgbm9kZVBhZGRpbmc7CisgICAgICAgIH0KKworICAgICAgICAvLyBJZiB0aGUgYm90dG9tbW9zdCBub2RlIGdvZXMgb3V0c2lkZSB0aGUgYm91bmRzLCBwdXNoIGl0IGJhY2sgdXAuCisgICAgICAgIGR5ID0geTAgLSBub2RlUGFkZGluZyAtIHNpemVbMV07CisgICAgICAgIGlmIChkeSA+IDApIHsKKyAgICAgICAgICB5MCA9IG5vZGUueSAtPSBkeTsKKworICAgICAgICAgIC8vIFB1c2ggYW55IG92ZXJsYXBwaW5nIG5vZGVzIGJhY2sgdXAuCisgICAgICAgICAgZm9yIChpID0gbiAtIDI7IGkgPj0gMDsgLS1pKSB7CisgICAgICAgICAgICBub2RlID0gbm9kZXNbaV07CisgICAgICAgICAgICBkeSA9IG5vZGUueSArIG5vZGUuZHkgKyBub2RlUGFkZGluZyAtIHkwOworICAgICAgICAgICAgaWYgKGR5ID4gMCkgbm9kZS55IC09IGR5OworICAgICAgICAgICAgeTAgPSBub2RlLnk7CisgICAgICAgICAgfQorICAgICAgICB9CisgICAgICB9KTsKKyAgICB9CisKKyAgICBmdW5jdGlvbiBhc2NlbmRpbmdEZXB0aChhLCBiKSB7CisgICAgICByZXR1cm4gYS55IC0gYi55OworICAgIH0KKyAgfQorCisgIGZ1bmN0aW9uIGNvbXB1dGVMaW5rRGVwdGhzKCkgeworICAgIG5vZGVzLmZvckVhY2goZnVuY3Rpb24obm9kZSkgeworICAgICAgbm9kZS5zb3VyY2VMaW5rcy5zb3J0KGFzY2VuZGluZ1RhcmdldERlcHRoKTsKKyAgICAgIG5vZGUudGFyZ2V0TGlua3Muc29ydChhc2NlbmRpbmdTb3VyY2VEZXB0aCk7CisgICAgfSk7CisgICAgbm9kZXMuZm9yRWFjaChmdW5jdGlvbihub2RlKSB7CisgICAgICB2YXIgc3kgPSAwLCB0eSA9IDA7CisgICAgICBub2RlLnNvdXJjZUxpbmtzLmZvckVhY2goZnVuY3Rpb24obGluaykgeworICAgICAgICBsaW5rLnN5ID0gc3k7CisgICAgICAgIHN5ICs9IGxpbmsuZHk7CisgICAgICB9KTsKKyAgICAgIG5vZGUudGFyZ2V0TGlua3MuZm9yRWFjaChmdW5jdGlvbihsaW5rKSB7CisgICAgICAgIGxpbmsudHkgPSB0eTsKKyAgICAgICAgdHkgKz0gbGluay5keTsKKyAgICAgIH0pOworICAgIH0pOworCisgICAgZnVuY3Rpb24gYXNjZW5kaW5nU291cmNlRGVwdGgoYSwgYikgeworICAgICAgcmV0dXJuIGEuc291cmNlLnkgLSBiLnNvdXJjZS55OworICAgIH0KKworICAgIGZ1bmN0aW9uIGFzY2VuZGluZ1RhcmdldERlcHRoKGEsIGIpIHsKKyAgICAgIHJldHVybiBhLnRhcmdldC55IC0gYi50YXJnZXQueTsKKyAgICB9CisgIH0KKworICBmdW5jdGlvbiBjZW50ZXIobm9kZSkgeworICAgIHJldHVybiBub2RlLnkgKyBub2RlLmR5IC8gMjsKKyAgfQorCisgIGZ1bmN0aW9uIHZhbHVlKGxpbmspIHsKKyAgICByZXR1cm4gbGluay52YWx1ZTsKKyAgfQorCisgIHJldHVybiBzYW5rZXk7Cit9OwpkaWZmIC0tZ2l0IGEvZWNvbXAtcG9ydGFsLUJFL3dhci9zdGF0aWMvZnVzaW9uL2QzL2pzL3Rvb2x0aXAuanMgYi9lY29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zIG9mIHRoZSB0b29sdGlwLiAgSWYgbnVsbCwgdGhlIGNvbnRlbnQgaXMgZ2VuZXJhdGVkIHZpYSB0aGUgZGF0YSB2YXJpYWJsZS4KKyAgICAgICAgLCAgIGRhdGEgPSBudWxsICAgICAvKiBUb29sdGlwIGRhdGEuIElmIGRhdGEgaXMgZ2l2ZW4gaW4gdGhlIHByb3BlciBmb3JtYXQsIGEgY29uc2lzdGVudCB0b29sdGlwIGlzIGdlbmVyYXRlZC4KKyAgICAgICAgRm9ybWF0IG9mIGRhdGE6CisgICAgICAgIHsKKyAgICAgICAgICAgIGtleTogIkRhdGUiLAorICAgICAgICAgICAgdmFsdWU6ICJBdWd1c3QgMjAwOSIsIAorICAgICAgICAgICAgc2VyaWVzOiBbCisgICAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIGtleTogIlNlcmllcyAxIiwKKyAgICAgICAgICAgICAgICAgICAgICAgIHZhbHVlOiAiVmFsdWUgMSIsCisgICAgICAgICAgICAgICAgICAgICAgICBjb2xvcjogIiMwMDAiCisgICAgICAgICAgICAgICAgICAgIH0sCisgICAgICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIGtleTogIlNlcmllcyAyIiwKKyAgICAgICAgICAgICAgICAgICAgICAgIHZhbHVlOiAiVmFsdWUgMiIsCisgICAgICAgICAgICAgICAgICAgICAgICBjb2xvcjogIiMwMGYiCisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIF0KKworICAgICAgICB9CisKKyAgICAgICAgKi8KKyAgICAgICAgLCAgIGdyYXZpdHkgPSAndycgICAvL0NhbiBiZSAnbicsJ3MnLCdlJywndycuIERldGVybWluZXMgaG93IHRvb2x0aXAgaXMgcG9zaXRpb25lZC4KKyAgICAgICAgLCAgIGRpc3RhbmNlID0gNTAgICAvL0Rpc3RhbmNlIHRvIG9mZnNldCB0b29sdGlwIGZyb20gdGhlIG1vdXNlIGxvY2F0aW9uLg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B0YWJsZS5zZWxlY3RBbGwoInRoZWFkIikKKyAgICAgICAgICAgICAgICAuZGF0YShbZF0pCisgICAgICAgICAgICAgICAgLmVudGVyKCkuYXBwZW5kKCJ0aGVhZCIpOworICAgICAgICAgICAgdGhlYWRFbnRlci5hcHBlbmQoInRyIikKKyAgICAgICAgICAgICAgICAuYXBwZW5kKCJ0ZCIpCisgICAgICAgICAgICAgICAgLmF0dHIoImNvbHNwYW4iLDMpCisgICAgICAgICAgICAgICAgLmFwcGVuZCgic3Ryb25nIikKKyAgICAgICAgICAgICAgICAgICAgLmNsYXNzZWQoIngtdmFsdWUiLHRydWUpCisgICAgICAgICAgICAgICAgICAgIC5odG1sKGhlYWRlckZvcm1hdHRlcihkLnZhbHVlKSk7CisKKyAgICAgICAgICAgIHZhciB0Ym9keUVudGVyID0gdGFibGUuc2VsZWN0QWxsKCJ0Ym9keSIpCisgICAgICAgICAgICAgICAgLmRhdGEoW2RdKQorICAgICAgICAgICAgICAgIC5lbnRlcigpLmFwcGVuZCgidGJvZHkiKTsKKyAgICAgICAgICAgIHZhciB0cm93RW50ZXIgPSB0Ym9keUVudGVyLnNlbGVjdEFsbCgidHIiKQorICAgICAgICAgICAgICAgIC5kYXRhKGZ1bmN0aW9uKHApIHsgcmV0dXJuIHAuc2VyaWVzfSkKKyAgICAgICAgICAgICAgICAuZW50ZXIoKQorICAgICAgICAgICAgICAgIC5hcHBlbmQoInRyIikKKyAgICAgICAgICAgICAgICAuY2xhc3NlZCgiaGlnaGxpZ2h0IiwgZnVuY3Rpb24ocCkgeyByZXR1cm4gcC5oaWdobGlnaHR9KQorICAgICAgICAgICAgICAgIDsKKworICAgICAgICAgICAgdHJvd0VudGVyLmFwcGVuZCgidGQiKQorICAgICAgICAgICAgICAgIC5jbGFzc2VkKCJsZWdlbmQtY29sb3ItZ3VpZGUiLHRydWUpCisgICAgICAgICAgICAgICAgLmFwcGVuZCgiZGl2IikKKyAgICAgICAgICAgICAgICAgICAgLnN0eWxlKCJiYWNrZ3JvdW5kLWNvbG9yIiwgZnVuY3Rpb24ocCkgeyByZXR1cm4gcC5jb2xvcn0pOworICAgICAgICAgICAgdHJvd0VudGVyLmFwcGVuZCgidGQiKQorICAgICAgICAgICAgICAgIC5jbGFzc2VkKCJrZXkiLHRydWUpCisgICAgICAgICAgICAgICAgLmh0bWwoZnVuY3Rpb24ocCkge3JldHVybiBwLmtleX0pOworICAgICAgICAgICAgdHJvd0VudGVyLmFwcGVuZCgidGQiKQorICAgICAgICAgICAgICAgIC5jbGFzc2VkKCJ2YWx1ZSIsdHJ1ZSkKKyAgICAgICAgICAgICAgICAuaHRtbChmdW5jdGlvbihwLGkpIHsgcmV0dXJuIHZhbHVlRm9ybWF0dGVyKHAudmFsdWUsaSkgfSk7CisKKworICAgICAgICAgICAgdHJvd0VudGVyLnNlbGVjdEFsbCgidGQiKS5lYWNoKGZ1bmN0aW9uKHApIHsKKyAgICAgICAgICAgICAgICBpZiAocC5oaWdobGlnaHQpIHsKKyAgICAgICAgICAgICAgICAgICAgdmFyIG9wYWNpdHlTY2FsZSA9IGQzLnNjYWxlLmxpbmVhcigpLmRvbWFpbihbMCwxXSkucmFuZ2UoWyIjZmZmIixwLmNvbG9yXSk7CisgICAgICAgICAgICAgICAgICAgIHZhciBvcGFjaXR5ID0gMC42OworICAgICAgICAgICAgICAgICAgICBkMy5zZWxlY3QodGhpcykKKyAgICAgICAgICAgICAgICAgICAgICAgIC5zdHlsZSgiYm9yZGVyLWJvdHRvbS1jb2xvciIsIG9wYWNpdHlTY2FsZShvcGFjaXR5KSkKKyAgICAgICAgICAgICAgICAgICAgICAgIC5zdHlsZSgiYm9yZGVyLXRvcC1jb2xvciIsIG9wYWNpdHlTY2FsZShvcGFjaXR5KSkKKyAgICAgICAgICAgICAgICAgICAgICAgIDsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9KTsKKworICAgICAgICAgICAgdmFyIGh0bWwgPSB0YWJsZS5ub2RlKCkub3V0ZXJIVE1MOworICAgICAgICAgICAgaWYgKGQuZm9vdGVyICE9PSB1bmRlZmluZWQpCisgICAgICAgICAgICAgICAgaHRtbCArPSAiPGRpdiBjbGFzcz0nZm9vdGVyJz4iICsgZC5mb290ZXIgKyAiPC9kaXY+IjsKKyAgICAgICAgICAgIHJldHVybiBodG1sOworCisgICAgICAgIH07CisKKyAgICAgICAgdmFyIGRhdGFTZXJpZXNFeGlzdHMgPSBmdW5jdGlvbihkKSB7CisgICAgICAgICAgICBpZiAoZCAmJiBkLnNlcmllcyAmJiBkLnNlcmllcy5sZW5ndGggPiAwKSByZXR1cm4gdHJ1ZTsKKworICAgICAgICAgICAgcmV0dXJuIGZhbHNlOworICAgICAgICB9OworCisgICAgICAgIC8vSW4gc2l0dWF0aW9ucyB3aGVyZSB0aGUgY2hhcnQgaXMgaW4gYSAndmlld0JveCcsIHJlLXBvc2l0aW9uIHRoZSB0b29sdGlwIGJhc2VkIG9uIGhvdyBmYXIgY2hhcnQgaXMgem9vbWVkLgorICAgICAgICBmdW5jdGlvbiBjb252ZXJ0Vmlld0JveFJhdGlvKCkgeworICAgICAgICAgICAgaWYgKGNoYXJ0Q29udGFpbmVyKSB7CisgICAgICAgICAgICAgIHZhciBzdmcgPSBkMy5zZWxlY3QoY2hhcnRDb250YWluZXIpOworICAgICAgICAgICAgICBpZiAoc3ZnLm5vZGUoKS50YWdOYW1lICE9PSAic3ZnIikgeworICAgICAgICAgICAgICAgICBzdmcgPSBzdmcuc2VsZWN0KCJzdmciKTsKKyAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICB2YXIgdmlld0JveCA9IChzdmcubm9kZSgpKSA/IHN2Zy5hdHRyKCd2aWV3Qm94JykgOiBudWxsOworICAgICAgICAgICAgICBpZiAodmlld0JveCkgeworICAgICAgICAgICAgICAgIHZpZXdCb3ggPSB2aWV3Qm94LnNwbGl0KCcgJyk7CisgICAgICAgICAgICAgICAgdmFyIHJhdGlvID0gcGFyc2VJbnQoc3ZnLnN0eWxlKCd3aWR0aCcpKSAvIHZpZXdCb3hbMl07CisgICAgICAgICAgICAgICAgCisgICAgICAgICAgICAgICAgcG9zaXRpb24ubGVmdCA9IHBvc2l0aW9uLmxlZnQgKiByYXRpbzsKKyAgICAgICAgICAgICAgICBwb3NpdGlvbi50b3AgID0gcG9zaXRpb24udG9wICogcmF0aW87CisgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorCisgICAgICAgIC8vQ3JlYXRlcyBuZXcgdG9vbHRpcCBjb250YWluZXIsIG9yIHVzZXMgZXhpc3Rpbmcgb25lIG9uIERPTS4KKyAgICAgICAgZnVuY3Rpb24gZ2V0VG9vbHRpcENvbnRhaW5lcihuZXdDb250ZW50KSB7CisgICAgICAgICAgICB2YXIgYm9keTsKKyAgICAgICAgICAgIGlmIChjaGFydENvbnRhaW5lcikKKyAgICAgICAgICAgICAgICBib2R5ID0gZDMuc2VsZWN0KGNoYXJ0Q29udGFpbmVyKTsKKyAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgICAgICBib2R5ID0gZDMuc2VsZWN0KCJib2R5Iik7CisKKyAgICAgICAgICAgIHZhciBjb250YWluZXIgPSBib2R5LnNlbGVjdCgiLm52dG9vbHRpcCIpOworICAgICAgICAgICAgaWYgKGNvbnRhaW5lci5ub2RlKCkgPT09IG51bGwpIHsKKyAgICAgICAgICAgICAgICAvL0NyZWF0ZSBuZXcgdG9vbHRpcCBkaXYgaWYgaXQgZG9lc24ndCBleGlzdCBvbiBET00uCisgICAgICAgICAgICAgICAgY29udGFpbmVyID0gYm9keS5hcHBlbmQoImRpdiIpCisgICAgICAgICAgICAgICAgICAgIC5hdHRyKCJjbGFzcyIsICJudnRvb2x0aXAgIiArIChjbGFzc2VzPyBjbGFzc2VzOiAieHktdG9vbHRpcCIpKQorICAgICAgICAgICAgICAgICAgICAuYXR0cigiaWQiLGlkKQorICAgICAgICAgICAgICAgICAgICA7CisgICAgICAgICAgICB9CisgICAgICAgIAorCisgICAgICAgICAgICBjb250YWluZXIubm9kZSgpLmlubmVySFRNTCA9IG5ld0NvbnRlbnQ7CisgICAgICAgICAgICBjb250YWluZXIuc3R5bGUoInRvcCIsMCkuc3R5bGUoImxlZnQiLDApLnN0eWxlKCJvcGFjaXR5IiwwKTsKKyAgICAgICAgICAgIGNvbnRhaW5lci5zZWxlY3RBbGwoImRpdiwgdGFibGUsIHRkLCB0ciIpLmNsYXNzZWQobnZQb2ludGVyRXZlbnRzQ2xhc3MsdHJ1ZSkKKyAgICAgICAgICAgIGNvbnRhaW5lci5jbGFzc2VkKG52UG9pbnRlckV2ZW50c0NsYXNzLHRydWUpOworICAgICAgICAgICAgcmV0dXJuIGNvbnRhaW5lci5ub2RlKCk7CisgICAgICAgIH0KKworICAgICAgICAKKworICAgICAgICAvL0RyYXcgdGhlIHRvb2x0aXAgb250byB0aGUgRE9NLgorICAgICAgICBmdW5jdGlvbiBudnRvb2x0aXAoKSB7CisgICAgICAgICAgICBpZiAoIWVuYWJsZWQpIHJldHVybjsKKyAgICAgICAgICAgIGlmICghZGF0YVNlcmllc0V4aXN0cyhkYXRhKSkgcmV0dXJuOworCisgICAgICAgICAgICBjb252ZXJ0Vmlld0JveFJhdGlvKCk7CisKKyAgICAgICAgICAgIHZhciBsZWZ0ID0gcG9zaXRpb24ubGVmdDsKKyAgICAgICAgICAgIHZhciB0b3AgPSAoZml4ZWRUb3AgIT0gbnVsbCkgPyBmaXhlZFRvcCA6IHBvc2l0aW9uLnRvcDsKKyAgICAgICAgICAgIHZhciBjb250YWluZXIgPSBnZXRUb29sdGlwQ29udGFpbmVyKGNvbnRlbnRHZW5lcmF0b3IoZGF0YSkpOworICAgICAgICAgICAgdG9vbHRpcEVsZW0gPSBjb250YWluZXI7CisgICAgICAgICAgICBpZiAoY2hhcnRDb250YWluZXIpIHsKKyAgICAgICAgICAgICAgICB2YXIgc3ZnQ29tcCA9IGNoYXJ0Q29udGFpbmVyLmdldEVsZW1lbnRzQnlUYWdOYW1lKCJzdmciKVswXTsKKyAgICAgICAgICAgICAgICB2YXIgYm91bmRSZWN0ID0gKHN2Z0NvbXApID8gc3ZnQ29tcC5nZXRCb3VuZGluZ0NsaWVudFJlY3QoKSA6IGNoYXJ0Q29udGFpbmVyLmdldEJvdW5kaW5nQ2xpZW50UmVjdCgpOworICAgICAgICAgICAgICAgIHZhciBzdmdPZmZzZXQgPSB7bGVmdDowLHRvcDowfTsKKyAgICAgICAgICAgICAgICBpZiAoc3ZnQ29tcCkgeworICAgICAgICAgICAgICAgICAgICB2YXIgc3ZnQm91bmQgPSBzdmdDb21wLmdldEJvdW5kaW5nQ2xpZW50UmVjdCgpOworICAgICAgICAgICAgICAgICAgICB2YXIgY2hhcnRCb3VuZCA9IGNoYXJ0Q29udGFpbmVyLmdldEJvdW5kaW5nQ2xpZW50UmVjdCgpOworICAgICAgICAgICAgICAgICAgICB2YXIgc3ZnQm91bmRUb3AgPSBzdmdCb3VuZC50b3A7CisgICAgICAgICAgICAgICAgICAgIAorICAgICAgICAgICAgICAgICAgICAvL0RlZmVuc2l2ZSBjb2RlLiBTb21ldGltZXMsIHN2Z0JvdW5kVG9wIGNhbiBiZSBhIHJlYWxseSBuZWdhdGl2ZQorICAgICAgICAgICAgICAgICAgICAvLyAgbnVtYmVyLCBsaWtlIC0xMzQyNTQuIFRoYXQncyBhIGJ1Zy4gCisgICAgICAgICAgICAgICAgICAgIC8vICBJZiBzdWNoIGEgbnVtYmVyIGlzIGZvdW5kLCB1c2UgemVybyBpbnN0ZWFkLiBGaXJlRm94IGJ1ZyBvbmx5CisgICAgICAgICAgICAgICAgICAgIGlmIChzdmdCb3VuZFRvcCA8IDApIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIHZhciBjb250YWluZXJCb3VuZCA9IGNoYXJ0Q29udGFpbmVyLmdldEJvdW5kaW5nQ2xpZW50UmVjdCgpOworICAgICAgICAgICAgICAgICAgICAgICAgc3ZnQm91bmRUb3AgPSAoTWF0aC5hYnMoc3ZnQm91bmRUb3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cih0b3Avc25hcERpc3RhbmNlKSAqIHNuYXBEaXN0YW5jZTsKKyAgICAgICAgICAgIH0KKworICAgICAgICAgICAgbnYudG9vbHRpcC5jYWxjVG9vbHRpcFBvc2l0aW9uKFtsZWZ0LHRvcF0sIGdyYXZpdHksIGRpc3RhbmNlLCBjb250YWluZXIpOworICAgICAgICAgICAgcmV0dXJuIG52dG9vbHRpcDsKKyAgICAgICAgfTsKKworICAgICAgICBudnRvb2x0aXAubnZQb2ludGVyRXZlbnRzQ2xhc3MgPSBudlBvaW50ZXJFdmVudHNDbGFzczsKKyAgICAgICAgCisgICAgICAgIG52dG9vbHRpcC5jb250ZW50ID0gZnVuY3Rpb24oXykgeworICAgICAgICAgICAgaWYgKCFhcmd1bWVudHMubGVuZ3RoKSByZXR1cm4gY29udGVudDsKKyAgICAgICAgICAgIGNvbnRlbnQgPSBfOworICAgICAgICAgICAgcmV0dXJuIG52dG9vbHRpcDsKKyAgICAgICAgfTsKKworICAgICAgICAvL1JldHVybnMgdG9vbHRpcEVsZW0uLi5ub3QgYWJsZSB0byBzZXQgaXQuCisgICAgICAgIG52dG9vbHRpcC50b29sdGlwRWxlbSA9IGZ1bmN0aW9uKCkgeworICAgICAgICAgICAgcmV0dXJuIHRvb2x0aXBFbGVtOworICAgICAgICB9OworCisgICAgICAgIG52dG9vbHRpcC5jb250ZW50R2VuZXJhdG9yID0gZnVuY3Rpb24oXykgeworICAgICAgICAgICAgaWYgKCFhcmd1bWVudHMubGVuZ3RoKSByZXR1cm4gY29udGVudEdlbmVyYXRvcjsKKyAgICAgICAgICAgIGlmICh0eXBlb2YgXyA9PT0gJ2Z1bmN0aW9uJykgeworICAgICAgICAgICAgICAgIGNvbnRlbnRHZW5lcmF0b3IgPSBfOworICAgICAgICAgICAgfQorICAgICAgICAgICAgcmV0dXJuIG52dG9vbHRpcDsKKyAgICAgICAgfTsKKworICAgICAgICBudnRvb2x0aXAuZGF0YSA9IGZ1bmN0aW9uKF8pIHsKKyAgICAgICAgICAgIGlmICghYXJndW1lbnRzLmxlbmd0aCkgcmV0dXJuIGRhdGE7CisgICAgICAgICAgICBkYXRhID0gXzsKKyAgICAgICAgICAgIHJldHVybiBudnRvb2x0aXA7CisgICAgICAgIH07CisKKyAgICAgICAgbnZ0b29sdGlwLmdyYXZpdHkgPSBmdW5jdGlvbihfKSB7CisgICAgICAgICAgICBpZiAoIWFyZ3VtZW50cy5sZW5ndGgpIHJldHVybiBncmF2aXR5OworICAgICAgICAgICAgZ3Jhdml0eSA9IF87CisgICAgICAgICAgICByZXR1cm4gbnZ0b29sdGlwOworICAgICAgICB9OworCisgICAgICAgIG52dG9vbHRpcC5kaXN0YW5jZSA9IGZ1bmN0aW9uKF8pIHsKKyAgICAgICAgICAgIGlmICghYXJndW1lbnRzLmxlbmd0aCkgcmV0dXJuIGRpc3RhbmNlOworICAgICAgICAgICAgZGlzdGFuY2UgPSBfOworICAgICAgICAgICAgcmV0dXJuIG52dG9vbHRpcDsKKyAgICAgICAgfTsKKworICAgICAgICBudnRvb2x0aXAuc25hcERpc3RhbmNlID0gZnVuY3Rpb24oXykgeworICAgICAgICAgICAgaWYgKCFhcmd1bWVudHMubGVuZ3RoKSByZXR1cm4gc25hcERpc3RhbmNlOworICAgICAgICAgICAgc25hcERpc3RhbmNlID0gXzsKKyAgICAgICAgICAgIHJldHVybiBudnRvb2x0aXA7CisgICAgICAgIH07CisKKyAgICAgICAgbnZ0b29sdGlwLmNsYXNzZXMgPSBmdW5jdGlvbihfKSB7CisgICAgICAgICAgICBpZiAoIWFyZ3VtZW50cy5sZW5ndGgpIHJldHVybiBjbGFzc2VzOworICAgICAgICAgICAgY2xhc3NlcyA9IF87CisgICAgICAgICAgICByZXR1cm4gbnZ0b29sdGlwOworICAgICAgICB9OworCisgICAgICAgIG52dG9vbHRpcC5jaGFydENvbnRhaW5lciA9IGZ1bmN0aW9uKF8pIHsKKyAgICAgICAgICAgIGlmICghYXJndW1lbnRzLmxlbmd0aCkgcmV0dXJuIGNoYXJ0Q29udGFpbmVyOworICAgICAgICAgICAgY2hhcnRDb250YWluZXIgPSBfOworICAgICAgICAgICAgcmV0dXJuIG52dG9vbHRpcDsKKyAgICAgICAgfTsKKworICAgICAgICBudnRvb2x0aXAucG9zaXRpb24gPSBmdW5jdGlvbihfKSB7CisgICAgICAgICAgICBpZiAoIWFyZ3VtZW50cy5sZW5ndGgpIHJldHVybiBwb3NpdGlvbjsKKyAgICAgICAgICAgIHBvc2l0aW9uLmxlZnQgPSAodHlwZW9mIF8ubGVmdCAhPT0gJ3VuZGVmaW5lZCcpID8gXy5sZWZ0IDogcG9zaXRpb24ubGVmdDsKKyAgICAgICAgICAgIHBvc2l0aW9uLnRvcCA9ICh0eXBlb2YgXy50b3AgIT09ICd1bmRlZmluZWQnKSA/IF8udG9wIDogcG9zaXRpb24udG9wOworICAgICAgICAgICAgcmV0dXJuIG52dG9vbHRpcDsKKyAgICAgICAgfTsKKworICAgICAgICBudnRvb2x0aXAuZml4ZWRUb3AgPSBmdW5jdGlvbihfKSB7CisgICAgICAgICAgICBpZiAoIWFyZ3VtZW50cy5sZW5ndGgpIHJldHVybiBmaXhlZFRvcDsKKyAgICAgICAgICAgIGZpeGVkVG9wID0gXzsKKyAgICAgICAgICAgIHJldHVybiBudnRvb2x0aXA7CisgICAgICAgIH07CisKKyAgICAgICAgbnZ0b29sdGlwLmVuYWJsZWQgPSBmdW5jdGlvbihfKSB7CisgICAgICAgICAgICBpZiAoIWFyZ3VtZW50cy5sZW5ndGgpIHJldHVybiBlbmFibGVkOworICAgICAgICAgICAgZW5hYmxlZCA9IF87CisgICAgICAgICAgICByZXR1cm4gbnZ0b29sdGlwOworICAgICAgICB9OworCisgICAgICAgIG52dG9vbHRpcC52YWx1ZUZvcm1hdHRlciA9IGZ1bmN0aW9uKF8pIHsKKyAgICAgICAgICAgIGlmICghYXJndW1lbnRzLmxlbmd0aCkgcmV0dXJuIHZhbHVlRm9ybWF0dGVyOworICAgICAgICAgICAgaWYgKHR5cGVvZiBfID09PSAnZnVuY3Rpb24nKSB7CisgICAgICAgICAgICAgICAgdmFsdWVGb3JtYXR0ZXIgPSBfOworICAgICAgICAgICAgfQorICAgICAgICAgICAgcmV0dXJuIG52dG9vbHRpcDsKKyAgICAgICAgfTsKKworICAgICAgICBudnRvb2x0aXAuaGVhZGVyRm9ybWF0dGVyID0gZnVuY3Rpb24oXykgeworICAgICAgICAgICAgaWYgKCFhcmd1bWVudHMubGVuZ3RoKSByZXR1cm4gaGVhZGVyRm9ybWF0dGVyOworICAgICAgICAgICAgaWYgKHR5cGVvZiBfID09PSAnZnVuY3Rpb24nKSB7CisgICAgICAgICAgICAgICAgaGVhZGVyRm9ybWF0dGVyID0gXzsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIHJldHVybiBudnRvb2x0aXA7CisgICAgICAgIH07CisKKyAgICAgICAgLy9pZCgpIGlzIGEgcmVhZC1vbmx5IGZ1bmN0aW9uLiBZb3UgY2FuJ3QgdXNlIGl0IHRvIHNldCB0aGUgaWQuCisgICAgICAgIG52dG9vbHRpcC5pZCA9IGZ1bmN0aW9uKCkgeworICAgICAgICAgICAgcmV0dXJuIGlkOworICAgICAgICB9OworCisKKyAgICAgICAgcmV0dXJuIG52dG9vbHRpcDsKKyAgfTsKKworCisgIC8vT3JpZ2luYWwgdG9vbHRpcC5zaG93IGZ1bmN0aW9uLiBLZXB0IGZvciBiYWNrd2FyZCBjb21wYXRpYmlsaXR5LgorICAvLyBwb3MgPSBbbGVmdCx0b3BdCisgIG52LnRvb2x0aXAuc2hvdyA9IGZ1bmN0aW9uKHBvcywgY29udGVudCwgZ3Jhdml0eSwgZGlzdCwgcGFyZW50Q29udGFpbmVyLCBjbGFzc2VzKSB7CisgICAgICAKKyAgICAgICAgLy9DcmVhdGUgbmV3IHRvb2x0aXAgZGl2IGlmIGl0IGRvZXNuJ3QgZXhpc3Qgb24gRE9NLgorICAgICAgICB2YXIgICBjb250YWluZXIgPSBkb2N1bWVudC5jcmVhdGVFbGVtZW50KCdkaXYnKTsKKyAgICAgICAgY29udGFpbmVyLmNsYXNzTmFtZSA9ICdudnRvb2x0aXAgJyArIChjbGFzc2VzID8gY2xhc3NlcyA6ICd4eS10b29sdGlwJyk7CisKKyAgICAgICAgdmFyIGJvZHkgPSBwYXJlbnRDb250YWluZXI7CisgICAgICAgIGlmICggIXBhcmVudENvbnRhaW5lciB8fCBwYXJlbnRDb250YWluZXIudGFnTmFtZS5tYXRjaCgvZ3xzdmcvaSkpIHsKKyAgICAgICAgICAgIC8vSWYgdGhlIHBhcmVudCBlbGVtZW50IGlzIGFuIFNWRyBlbGVtZW50LCBwbGFjZSB0b29sdGlwIGluIHRoZSA8Ym9keT4gZWxlbWVudC4KKyAgICAgICAgICAgIGJvZHkgPSBkb2N1bWVudC5nZXRFbGVtZW50c0J5VGFnTmFtZSgnYm9keScpWzBdOworICAgICAgICB9CisgICAKKyAgICAgICAgY29udGFpbmVyLnN0eWxlLmxlZnQgPSAwOworICAgICAgICBjb250YWluZXIuc3R5bGUudG9wID0gMDsKKyAgICAgICAgY29udGFpbmVyLnN0eWxlLm9wYWNpdHkgPSAwOworICAgICAgICBjb250YWluZXIuaW5uZXJIVE1MID0gY29udGVudDsKKyAgICAgICAgYm9keS5hcHBlbmRDaGlsZChjb250YWluZXIpOworICAgICAgICAKKyAgICAgICAgLy9JZiB0aGUgcGFyZW50IGNvbnRhaW5lciBpcyBhbiBvdmVyZmxvdyA8ZGl2PiB3aXRoIHNjcm9sbGJhcnMsIHN1YnRyYWN0IHRoZSBzY3JvbGwgb2Zmc2V0cy4KKyAgICAgICAgaWYgKHBhcmVudENvbnRhaW5lcikgeworICAgICAgICAgICBwb3NbMF0gPSBwb3NbMF0gLSBwYXJlbnRDb250YWluZXIuc2Nyb2xsTGVmdDsKKyAgICAgICAgICAgcG9zWzFdID0gcG9zWzFdIC0gcGFyZW50Q29udGFpbmVyLnNjcm9sbFRvcDsKKyAgICAgICAgfQorICAgICAgICBudi50b29sdGlwLmNhbGNUb29sdGlwUG9zaXRpb24ocG9zLCBncmF2aXR5LCBkaXN0LCBjb250YWluZXIpOworICB9OworCisgIC8vTG9va3MgdXAgdGhlIGFuY2VzdHJ5IG9mIGEgRE9NIGVsZW1lbnQsIGFuZCByZXR1cm5zIHRoZSBmaXJzdCBOT04tc3ZnIG5vZGUuCisgIG52LnRvb2x0aXAuZmluZEZpcnN0Tm9uU1ZHUGFyZW50ID0gZnVuY3Rpb24oRWxlbSkgeworICAgICAgICAgICAgd2hpbGUoRWxlbS50YWdOYW1lLm1hdGNoKC9eZ3xzdmckL2kpICE9PSBudWxsKSB7CisgICAgICAgICAgICAgICAgRWxlbSA9IEVsZW0ucGFyZW50Tm9kZTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIHJldHVybiBFbGVtOworICB9OworCisgIC8vRmluZHMgdGhlIHRvdGFsIG9mZnNldFRvcCBvZiBhIGdpdmVuIERPTSBlbGVtZW50LgorICAvL0xvb2tzIHVwIHRoZSBlbnRpcmUgYW5jZXN0cnkgb2YgYW4gZWxlbWVudCwgdXAgdG8gdGhlIGZpcnN0IHJlbGF0aXZlbHkgcG9zaXRpb25lZCBlbGVtZW50LgorICBudi50b29sdGlwLmZpbmRUb3RhbE9mZnNldFRvcCA9IGZ1bmN0aW9uICggRWxlbSwgaW5pdGlhbFRvcCApIHsKKyAgICAgICAgICAgICAgICB2YXIgb2Zmc2V0VG9wID0gaW5pdGlhbFRvcDsKKyAgICAgICAgICAgICAgICAKKyAgICAgICAgICAgICAgICBkbyB7CisgICAgICAgICAgICAgICAgICAgIGlmKCAhaXNOYU4oIEVsZW0ub2Zmc2V0VG9wICkgKSB7CisgICAgICAgICAgICAgICAgICAgICAgICBvZmZzZXRUb3AgKz0gKEVsZW0ub2Zmc2V0VG9wKTsKKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIH0gd2hpbGUoIEVsZW0gPSBFbGVtLm9mZnNldFBhcmVudCApOworICAgICAgICAgICAgICA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mVyID0gdG9vbHRpcCBESVYKKyAgbnYudG9vbHRpcC5jYWxjVG9vbHRpcFBvc2l0aW9uID0gZnVuY3Rpb24ocG9zLCBncmF2aXR5LCBkaXN0LCBjb250YWluZXIpIHsKKworICAgICAgICAgICAgdmFyIGhlaWdodCA9IHBhcnNlSW50KGNvbnRhaW5lci5vZmZzZXRIZWlnaHQpLAorICAgICAgICAgICAgICAgIHdpZHRoID0gcGFyc2VJbnQoY29udGFpbmVyLm9mZnNldFdpZHRoKSwKKyAgICAgICAgICAgICAgICB3aW5kb3dXaWR0aCA9IG52LnV0aWxzLndpbmRvd1NpemUoKS53aWR0aCwKKyAgICAgICAgICAgICAgICB3aW5kb3dIZWlnaHQgPSBudi51dGlscy53aW5kb3dTaXplKCkuaGVpZ2h0LAorICAgICAgICAgICAgICAgIHNjcm9sbFRvcCA9IHdpbmRvdy5wYWdlWU9mZnNldCwKKyAgICAgICAgICAgICAgICBzY3JvbGxMZWZ0ID0gd2luZG93LnBhZ2VYT2Zmc2V0LAorICAgICAgICAgICAgICAgIGxlZnQsIHRvcDsKKworICAgICAgICAgICAgd2luZG93SGVpZ2h0ID0gd2luZG93LmlubmVyV2lkdGggPj0gZG9jdW1lbnQuYm9keS5zY3JvbGxXaWR0aCA/IHdpbmRvd0hlaWdodCA6IHdpbmRvd0hlaWdodCAtIDE2OworICAgICAgICAgICAgd2luZG93V2lkdGggPSB3aW5kb3cuaW5uZXJIZWlnaHQgPj0gZG9jdW1lbnQuYm9keS5zY3JvbGxIZWlnaHQgPyB3aW5kb3dXaWR0aCA6IHdpbmRvd1dpZHRoIC0gMTY7CisKKyAgICAgICAgICAgIGdyYXZpdHkgPSBncmF2aXR5IHx8ICdzJzsKKyAgICAgICAgICAgIGRpc3QgPSBkaXN0IHx8IDIwOworCisgICAgICAgICAgICB2YXIgdG9vbHRpcFRvcCA9IGZ1bmN0aW9uICggRWxlbSApIHsKKyAgICAgICAgICAgICAgICByZXR1cm4gbnYudG9vbHRpcC5maW5kVG90YWxPZmZzZXRUb3AoRWxlbSwgdG9wKTsKKyAgICAgICAgICAgIH07CisKKyAgICAgICAgICAgIHZhciB0b29sdGlwTGVmdCA9IGZ1bmN0aW9uICggRWxlbSApIHsKKyAgICAgICAgICAgICAgICByZXR1cm4gbnYudG9vbHRpcC5maW5kVG90YWxPZmZzZXRMZWZ0KEVsZW0sbGVmdCk7CisgICAgICAgICAgICB9OworCisgICAgICAgICAgICBzd2l0Y2ggKGdyYXZpdHkpIHsKKyAgICAgICAgICAgICAgY2FzZSAnZSc6CisgICAgICAgICAgICAgICAgbGVmdCA9IHBvc1swXSAtIHdpZHRoIC0gZGlzdDsKKyAgICAgICAgICAgICAgICB0b3AgPSBwb3NbMV0gLSAoaGVpZ2h0IC8gMik7CisgICAgICAgICAgICAgICAgdmFyIHRMZWZ0ID0gdG9vbHRpcExlZnQoY29udGFpbmVyKTsKKyAgICAgICAgICAgICAgICB2YXIgdFRvcCA9IHRvb2x0aXBUb3AoY29udGFpbmVyKTsKKyAgICAgICAgICAgICAgICBpZiAodExlZnQgPCBzY3JvbGxMZWZ0KSBsZWZ0ID0gcG9zWzBdICsgZGlzdCA+IHNjcm9sbExlZnQgPyBwb3NbMF0gKyBkaXN0IDogc2Nyb2xsTGVmdCAtIHRMZWZ0ICsgbGVmdDsKKyAgICAgICAgICAgICAgICBpZiAodFRvcCA8IHNjcm9sbFRvcCkgdG9wID0gc2Nyb2xsVG9wIC0gdFRvcCArIHRvcDsKKyAgICAgICAgICAgICAgICBpZiAodFRvcCArIGhlaWdodCA+IHNjcm9sbFRvcCArIHdpbmRvd0hlaWdodCkgdG9wID0gc2Nyb2xsVG9wICsgd2luZG93SGVpZ2h0IC0gdFRvcCArIHRvcCAtIGhlaWdodDsKKyAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgY2FzZSAndyc6CisgICAgICAgICAgICAgICAgbGVmdCA9IHBvc1swXSArIGRpc3Q7CisgICAgICAgICAgICAgICAgdG9wID0gcG9zWzFdIC0gKGhlaWdodCAvIDIpOworICAgICAgICAgICAgICAgIHZhciB0TGVmdCA9IHRvb2x0aXBMZWZ0KGNvbnRhaW5lcik7CisgICAgICAgICAgICAgICAgdmFyIHRUb3AgPSB0b29sdGlwVG9wKGNvbnRhaW5lcik7CisgICAgICAgICAgICAgICAgaWYgKHRMZWZ0ICsgd2lkdGggPiB3aW5kb3dXaWR0aCkgbGVmdCA9IHBvc1swXSAtIHdpZHRoIC0gZGlzdDsKKyAgICAgICAgICAgICAgICBpZiAodFRvcCA8IHNjcm9sbFRvcCkgdG9wID0gc2Nyb2xsVG9wICsgNTsKKyAgICAgICAgICAgICAgICBpZiAodFRvcCArIGhlaWdodCA+IHNjcm9sbFRvcCArIHdpbmRvd0hlaWdodCkgdG9wID0gc2Nyb2xsVG9wICsgd2luZG93SGVpZ2h0IC0gdFRvcCArIHRvcCAtIGhlaWdodDsKKyAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgY2FzZSAnbic6CisgICAgICAgICAgICAgICAgbGVmdCA9IHBvc1swXSAtICh3aWR0aCAvIDIpIC0gNTsKKyAgICAgICAgICAgICAgICB0b3AgPSBwb3NbMV0gKyBkaXN0OworICAgICAgICAgICAgICAgIHZhciB0TGVmdCA9IHRvb2x0aXBMZWZ0KGNvbnRhaW5lcik7CisgICAgICAgICAgICAgICAgdmFyIHRUb3AgPSB0b29sdGlwVG9wKGNvbnRhaW5lcik7CisgICAgICAgICAgICAgICAgaWYgKHRMZWZ0IDwgc2Nyb2xsTGVmdCkgbGVmdCA9IHNjcm9sbExlZnQgKyA1OworICAgICAgICAgICAgICAgIGlmICh0TGVmdCArIHdpZHRoID4gd2luZG93V2lkdGgpIGxlZnQgPSBsZWZ0IC0gd2lkdGgvMiArIDU7CisgICAgICAgICAgICAgICAgaWYgKHRUb3AgKyBoZWlnaHQgPiBzY3JvbGxUb3AgKyB3aW5kb3dIZWlnaHQpIHRvcCA9IHNjcm9sbFRvcCArIHdpbmRvd0hlaWdodCAtIHRUb3AgKyB0b3AgLSBoZWlnaHQ7CisgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgIGNhc2UgJ3MnOgorICAgICAgICAgICAgICAgIGxlZnQgPSBwb3NbMF0gLSAod2lkdGggLyAyKTsKKyAgICAgICAgICAgICAgICB0b3AgPSBwb3NbMV0gLSBoZWlnaHQgLSBkaXN0OworICAgICAgICAgICAgICAgIHZhciB0TGVmdCA9IHRvb2x0aXBMZWZ0KGNvbnRhaW5lcik7CisgICAgICAgICAgICAgICAgdmFyIHRUb3AgPSB0b29sdGlwVG9wKGNvbnRhaW5lcik7CisgICAgICAgICAgICAgICAgaWYgKHRMZWZ0IDwgc2Nyb2xsTGVmdCkgbGVmdCA9IHNjcm9sbExlZnQgKyA1OworICAgICAgICAgICAgICAgIGlmICh0TGVmdCArIHdpZHRoID4gd2luZG93V2lkdGgpIGxlZnQgPSBsZWZ0IC0gd2lkdGgvMiArIDU7CisgICAgICAgICAgICAgICAgaWYgKHNjcm9sbFRvcCA+IHRUb3ApIHRvcCA9IHNjcm9sbFRvcDsKKyAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgY2FzZSAnbm9uZSc6CisgICAgICAgICAgICAgICAgbGVmdCA9IHBvc1swXTsKKyAgICAgICAgICAgICAgICB0b3AgPSBwb3NbMV0gLSBkaXN0OworICAgICAgICAgICAgICAgIHZhciB0TGVmdCA9IHRvb2x0aXBMZWZ0KGNvbnRhaW5lcik7CisgICAgICAgICAgICAgICAgdmFyIHRUb3AgPSB0b29sdGlwVG9wKGNvbnRhaW5lcik7CisgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICB9CisKKworICAgICAgICAgICAgY29udGFpbmVyLnN0eWxlLmxlZnQgPSBsZWZ0KydweCc7CisgICAgICAgICAgICBjb250YWluZXIuc3R5bGUudG9wID0gdG9wKydweCc7CisgICAgICAgICAgICBjb250YWluZXIuc3R5bGUub3BhY2l0eSA9IDE7CisgICAgICAgICAgICBjb250YWluZXIuc3R5bGUucG9zaXRpb24gPSAnYWJzb2x1dGUnOyAKKworICAgICAgICAgICAgcmV0dXJuIGNvbnRhaW5lcjsKKyAgICB9OworCisgICAgLy9HbG9iYWwgdXRpbGl0eSBmdW5jdGlvbiB0byByZW1vdmUgdG9vbHRpcHMgZnJvbSB0aGUgRE9NLgorICAgIG52LnRvb2x0aXAuY2xlYW51cCA9IGZ1bmN0aW9uKCkgeworCisgICAgICAgICAgICAgIC8vIEZpbmQgdGhlIHRvb2x0aXBzLCBtYXJrIHRoZW0gZm9yIHJlbW92YWwgYnkgdGhpcyBjbGFzcyAoc28gb3RoZXJzIGNsZWFudXBzIHdvbid0IGZpbmQgaXQpCisgICAgICAgICAgICAgIHZhciB0b29sdGlwcyA9IGRvY3VtZW50LmdldEVsZW1lbnRzQnlDbGFzc05hbWUoJ252dG9vbHRpcCcpOworICAgICAgICAgICAgICB2YXIgcHVyZ2luZyA9IFtdOworICAgICAgICAgICAgICB3aGlsZSh0b29sdGlwcy5sZW5ndGgpIHsKKyAgICAgICAgICAgICAgICBwdXJnaW5nLnB1c2godG9vbHRpcHNbMF0pOworICAgICAgICAgICAgICAgIHRvb2x0aXBzWzBdLnN0eWxlLnRyYW5zaXRpb25EZWxheSA9ICcwICFpbXBvcnRhbnQnOworICAgICAgICAgICAgICAgIHRvb2x0aXBzWzBdLnN0eWxlLm9wYWNpdHkgPSAwOworICAgICAgICAgICAgICAgIHRvb2x0aXBzWzBdLmNsYXNzTmFtZSA9ICdudnRvb2x0aXAtcGVuZGluZy1yZW1vdmFsJzsKKyAgICAgICAgICAgICAgfQorCisgICAgICAgICAgICAgIHNldFRpbWVvdXQoZnVuY3Rpb24oKSB7CisKKyAgICAgICAgICAgICAgICAgIHdoaWxlIChwdXJnaW5nLmxlbmd0aCkgeworICAgICAgICAgICAgICAgICAgICAgdmFyIHJlbW92ZU1lID0gcHVyZ2luZy5wb3AoKTsKKyAgICAgICAgICAgICAgICAgICA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iBvZiBJbnRlcm5ldCBFeHBsb3JlciA+NCBvcgorICAgICAgICAvLyB1bmRlZmluZWQoaW5kaWNhdGluZyB0aGUgdXNlIG9mIGFub3RoZXIgYnJvd3NlcikuCisgICAgICAgIHsKKyAgICAgICAgICAgIHZhciBpc0lFMTAgPSAoZXZhbCgiLypAY2Nfb24hQCovZmFsc2UiKSAmJiBkb2N1bWVudC5kb2N1bWVudE1vZGUgPT09IDEwKTsKKyAgICAgICAgICAgIGlmIChpc0lFMTApIHsKKyAgICAgICAgICAgICAgICByZXR1cm4gMTA7CisgICAgICAgICAgICB9CisgICAgICAgICAgICB2YXIgdiA9IDMsCisgICAgICAgICAgICAgICAgZGl2ID0gZG9jdW1lbnQuY3JlYXRlRWxlbWVudCgnZGl2JyksCisgICAgICAgICAgICAgICAgYWxsID0gZGl2LmdldEVsZW1lbnRzQnlUYWdOYW1lKCdpJyk7CisgICAgICAgICAgICBkbyB7CisgICAgICAgICAgICAgICAgZGl2LmlubmVySFRNTCA9ICc8IS0tW2lmIGd0IElFICcgKyAoKyt2KSArICddPjxpPjwvaT48IVtlbmRpZl0tLT4nOworICAgICAgICAgICAgfSB3aGlsZSAoYWxsWzBdKTsKKyAgICAgICAgICAgIHJldHVybiB2ID4gNCA/IHYgOiB1bmRlZmluZWQ7CisgICAgICAgIH07CisKKyAgICB2YXIgYnJvd3NlclZlcnNpb24gPSBnZXRJbnRlcm5ldEV4cGxvcmVyVmVyc2lvbigpOworCisgICAgaWYgKGJyb3dzZXJWZXJzaW9uICYmIGJyb3dzZXJWZXJzaW9uIDwgOSkgeworICAgICAgICBpZTggPSB0cnVlOworICAgIH0KKyAgICAgICAgCisJLy8gVGhpcyByZXR1cm5lZCBhbmd1bGFyIG1vZHVsZSAnZ3JpZHN0ZXInIGlzIHdoYXQgaXMgZXhwb3J0ZWQuCisJcmV0dXJuIGFuZ3VsYXIubW9kdWxlKCdhdHRHcmlkc3RlckxpYicsIFtdKQorCisJLmNvbnN0YW50KCdncmlkc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PSBwb2ludGVyTGlzdFtpXTsKKwkJCQkJdmFyIHBvaW50ZXJJZCA9ICh0eXBlb2YgcG9pbnRlck9iai5pZGVudGlmaWVyICE9PSAndW5kZWZpbmVkJykgPyBwb2ludGVyT2JqLmlkZW50aWZpZXIgOiAodHlwZW9mIHBvaW50ZXJPYmoucG9pbnRlcklkICE9PSAndW5kZWZpbmVkJykgPyBwb2ludGVyT2JqLnBvaW50ZXJJZCA6IDE7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gIHVzZSB0aGUgcGFnZVgvWSBjb29yZGluYXRlcyB0byBjb21wdXRlIHRhcmdldC1yZWxhdGl2ZSBjb29yZGluYXRlcyB3aGVuIHdlIGhhdmUgdGhlbSAoaW4gaWUgPCA5LCB3ZSBuZWVkIHRvIGRvIGEgbGl0dGxlIHdvcmsgdG8gcHV0IHRoZW0gdGhlcmUpCisJCQkJCWlmICh0eXBlb2YgcG9pbnRlck9iai5wYWdlWCA9PT0gJ3VuZGVmaW5lZCcpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gIGluaXRpYWxpemUgYXNzdW1pbmcgb3VyIHNvdXJjZSBlbGVtZW50IGlzIG91ciB0YXJnZXQKKwkJCQkJCWlmKCFpZTgpeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBvaW50ZXJPYmoucGFnZVggPSBwb2ludGVyT2JqLm9mZnNldFggKyBkb2N1bWVudFRvVGFyZ2V0RGVsdGEueDsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwb2ludGVyT2JqLnBhZ2VZID0gcG9pbnRlck9iai5vZmZzZXRZICsgZG9jdW1lbnRUb1RhcmdldERlbHRhLnk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBlbHNleworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBvaW50ZXJPYmoucGFnZVggPSBwb2ludGVyT2JqLmNsaWVudFg7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcG9pbnRlck9iai5wYWdlWSA9IHBvaW50ZXJPYmouY2xpZW50WTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KKworCQkJCQkJaWYgKHBvaW50ZXJPYmouc3JjRWxlbWVudC5vZmZzZXRQYXJlbnQgPT09IHRhcmdldCAmJiBkb2N1bWVudC5kb2N1bWVudE1vZGUgJiYgZG9jdW1lbnQuZG9jdW1lbnRNb2RlID09PSA4ICYmIHBvaW50ZXJPYmoudHlwZSA9PT0gJ21vdXNlZG93bicpIHsKKwkJCQkJCQkvLyAgc291cmNlIGVsZW1lbnQgaXMgYSBjaGlsZCBwaWVjZSBvZiBWTUwsIHdlJ3JlIGluIElFOCwgYW5kIHdlJ3ZlIG5vdCBjYWxsZWQgc2V0Q2FwdHVyZSB5ZXQgLSBhZGQgdGhlIG9yaWdpbiBvZiB0aGUgc291cmNlIGVsZW1lbnQKKwkJCQkJCQlwb2ludGVyT2JqLnBhZ2VYICs9IHBvaW50ZXJPYmouc3JjRWxlbWVudC5vZmZzZXRMZWZ0OworCQkJCQkJCXBvaW50ZXJPYmoucGFnZVkgKz0gcG9pbnRlck9iai5zcmNFbGVtZW50Lm9mZnNldFRvcDsKKwkJCQkJCX0gZWxzZSBpZiAocG9pbnRlck9iai5zcmNFbGVtZW50ICE9PSB0YXJnZXQgJiYgIWRvY3VtZW50LmRvY3VtZW50TW9kZSB8fCBkb2N1bWVudC5kb2N1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gICAgICAgICAgICAgICAgICAgICAgdmFyIGlzRHJhZ2dhYmxlQXJlYURlZmluZWQgPSBncmlkc3Rlckl0ZW1EcmFnRWxlbWVudD90cnVlOmZhbHNlOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vY29uc29sZS5sb2coaXNEcmFnZ2FibGVBcmVhRGVmaW5lZCk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAorCQkJCWZ1bmN0aW9uIG1vdXNlRG93bihlKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmKGllOCl7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZS50YXJnZXQgPSB3aW5kb3cuZXZlbnQuc3JjRWxlbWVudDsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBlLndoaWNoID0gd2luZG93LmV2ZW50LmJ1dHRvbjsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYoaXNEcmFnZ2FibGVBcmVhRGVmaW5lZCAmJiAoIWdyaWRzdGVySXRlbURyYWdFbGVtZW50LmNvbnRhaW5zKGUudGFyZ2V0KSkpeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBmYWxzZTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChpbnB1dFRhZ3MuaW5kZXhPZihlLnRhcmdldC5ub2RlTmFtZS50b0xvd2VyQ2FzZSgpKSAhPT0gLTEpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC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IGl0ZW1JblRoZVdheS5jb2wgKyBjb2xPZmZzZXQpOworCQkJCQkJCQl9CisJCQkJCQkJfQorCQkJCQkJfQorCQkJCQl9CisKKwkJCQkJaWYgKGdyaWRzdGVyLnB1c2hpbmcgIT09IGZhbHNlIHx8ICFoYXNJdGVtc0luVGhlV2F5KSB7CisJCQkJCQlpdGVtLnJvdyA9IHJvdzsKKwkJCQkJCWl0ZW0uY29sID0gY29sOworCQkJCQl9CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYoKCR3aW5kb3cubmF2aWdhdG9yLmFwcE5hbWUgPT09ICdNaWNyb3NvZnQgSW50ZXJuZXQgRXhwbG9yZXInICYmICFpZTgpIHx8ICR3aW5kb3cubmF2aWdhdG9yLnVzZXJBZ2VudC5pbmRleE9mKCJGaXJlZm94IikhPT0tMSl7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChldmVudC5wYWdlWSAtIHJlYWxkb2N1bWVudC5kb2N1bWVudEVsZW1lbnQuc2Nyb2xsVG9wIDwgc2Nyb2xsU2Vuc2l0aXZpdHkpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZWFsZG9jdW1lbnQuZG9jdW1lbnRFbGVtZW50LnNjcm9sbFRvcCA9IHJlYWxkb2N1bWVudC5kb2N1bWVudEVsZW1lbnQuc2Nyb2xsVG9wIC0gc2Nyb2xsU3BlZWQ7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAoJHdpbmRvdy5pbm5lckhlaWdodCAtIChldmVudC5wYWdlWSAtIHJlYWxkb2N1bWVudC5kb2N1bWVudEVsZW1lbnQuc2Nyb2xsVG9wKSA8IHNjcm9sbFNlbnNpdGl2aXR5KSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmVhbGRvY3VtZW50LmRvY3VtZW50RWxlbWVudC5zY3JvbGxUb3AgPSByZWFsZG9jdW1lbnQuZG9jdW1lbnRFbGVtZW50LnNjcm9sbFRvcCArIHNjcm9sbFNwZWVkOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGVsc2V7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChldmVudC5wYWdlWSAtIHJlYWxkb2N1bWVudC5ib2R5LnNjcm9sbFRvcCA8IHNjcm9sbFNlbnNpdGl2aXR5KSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmVhbGRvY3VtZW50LmJvZHkuc2Nyb2xsVG9wID0gcmVhbGRvY3VtZW50LmJvZHkuc2Nyb2xsVG9wIC0gc2Nyb2xsU3BlZWQ7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAoJHdpbmRvdy5pbm5lckhlaWdodCAtIChldmVudC5wYWdlWSAtIHJlYWxkb2N1bWVudC5ib2R5LnNjcm9sbFRvcCkgPCBzY3JvbGxTZW5zaXRpdml0eSkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJlYWxkb2N1bWVudC5ib2R5LnNjcm9sbFRvcCA9IHJlYWxkb2N1bWVudC5ib2R5LnNjcm9sbFRvcCArIHNjcm9sbFNwZWVkOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAorICAgICAg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vYmogIT09IGRzdCkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGFuZ3VsYXIuZm9yRWFjaChvYmosIGZ1bmN0aW9uKHZhbHVlLCBrZXkpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGRzdFtrZXldICYmIGRzdFtrZXldLmNvbnN0cnVjdG9yICYmIGRzdFtrZXldLmNvbnN0cnVjdG9yID09PSBPYmplY3QpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIF9leHRlbmREZWVwKGRzdFtrZXldLCB2YWx1ZSk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBkc3Rba2V5XSA9IHZhbHVlOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSk7CisgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgIH0pOworICAgICAgICAgICAgICAgICAgICByZXR1cm4gZHN0OworICAgICAgICAgICAgICAgIH07CisgICAgICAgICAgICAgICAgcmV0dXJuIHsKKyAgICAgICAgICAgICAgICAgICAgZXh0ZW5kRGVlcDogX2V4dGVuZERlZXAKKyAgICAgICAgICAgICAgICB9OworICAgICAgICAgICAgfV0pOworCithbmd1bGFyLm1vZHVsZSgnYXR0LmdyaWRzdGVyLmdyaWRzdGVyJywgWydhdHRHcmlkc3RlckxpYicsICdhdHQuZ3JpZHN0ZXIudXRpbGl0aWVzJ10pCisgICAgICAgIC5jb25maWcoWyckY29tcGlsZVByb3ZpZGVyJywgZnVuY3Rpb24oJGNvbXBpbGVQcm92aWRlcikgeworICAgICAgICAgICAgICAgICRjb21waWxlUHJvdmlkZXIuYUhyZWZTYW5pdGl6YXRpb25XaGl0ZWxpc3QoL15ccyooaHR0cHM/fGphdmFzY3JpcHQpOi8pOworICAgICAgICAgICAgfV0pCisgICAgICAgIC5jb25zdGFudCgnYXR0R3JpZHN0ZXJDb25maWcnLAorICAgICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgICAgICAgY29sdW1uczogMywKKyAgICAgICAgICAgICAgICAgICAgbWFyZ2luczogWzEwLCAxMF0sCisgICAgICAgICAgICAgICAgICAgIG91dGVyTWFyZ2luOiB0cnVlLAorICAgICAgICAgICAgICAgICAgICBwdXNoaW5nOiB0cnVlLAorICAgICAgICAgICAgICAgICAgICBmbG9hdGluZzogdHJ1ZSwKKyAgICAgICAgICAgICAgICAgICAgc3dhcHBpbmc6IHRydWUsCisgICAgICAgICAgICAgICAgICAgIGRyYWdnYWJsZTogeworICAgICAgICAgICAgICAgICAgICAgICAgZW5hYmxlZDogdHJ1ZQorICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgfSkKKyAgICAgICAgLmRpcmVjdGl2ZSgnYXR0R3JpZHN0ZXInLCBbJ2F0dEdyaWRzdGVyQ29uZmlnJywgJyRleHRlbmRPYmonLCBmdW5jdGlvbihhdHRHcmlkc3RlckNvbmZpZywgJGV4dGVuZE9iaikgeworICAgICAgICAgICAgICAgIHJldHVybiB7CisgICAgICAgICAgICAgICAgICAgIHJlc3RyaWN0OiAnRUEnLAorICAgICAgICAgICAgICAgICAgICBzY29wZTogeworICAgICAgICAgICAgICAgICAgICAgICAgYXR0R3JpZHN0ZXJPcHRpb25zOiAnPT8nCisgICAgICAgICAgICAgICAgICAgIH0sCisgICAgICAgICAgICAgICAgICAgIHRlbXBsYXRlVXJsOiAndGVtcGxhdGUvZ3JpZHN0ZXIvZ3JpZHN0ZXIuaHRtbCcsCisgICAgICAgICAgICAgICAgICAgIHJlcGxhY2U6IGZhbHNlLAorICAgICAgICAgICAgICAgICAgICB0cmFuc2NsdWRlOiB0cnVlLAorICAgICAgICAgICAgICAgICAgICBjb250cm9sbGVyOiBbZnVuY3Rpb24oKSB7fV0sCisgICAgICAgICAgICAgICAgICAgIGxpbms6IGZ1bmN0aW9uKHNjb3BlKSB7CisgICAgICAgICAgICAgICAgICAgICAgICBpZiAoYW5ndWxhci5pc0RlZmluZWQoc2NvcGUuYXR0R3JpZHN0ZXJPcHRpb25zKSkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGF0dEdyaWRzdGVyQ29uZmlnID0gJGV4dGVuZE9iai5leHRlbmREZWVwKGF0dEdyaWRzdGVyQ29uZmlnLCBzY29wZS5hdHRHcmlkc3Rlck9wdGlvbnMpOworICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgc2NvcGUuYXR0R3JpZHN0ZXJDb25maWcgPSBhdHRHcmlkc3RlckNvbmZpZzsKKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIH07CisgICAgICAgICAgICB9XSkKKyAgICAgICAgLmRpcmVjdGl2ZSgnYXR0R3JpZHN0ZXJJdGVtJywgWyckdGltZW91dCcsIGZ1bmN0aW9uKCR0aW1lb3V0KSB7CisgICAgICAgICAgICAgICAgcmV0dXJuIHsKKyAgICAgICAgICAgICAgICAgICAgcmVzdHJpY3Q6ICdFQScsCisgICAgICAgICAgICAgICAgICAgIHJlcXVpcmU6IFsnXmF0dEdyaWRzdGVyJ10sCisgICAgICAgICAgICAgICAgICAgIHNjb3BlOiB7CisgICAgICAgICAgICAgICAgICAgICAgICBhdHRHcmlkc3Rlckl0ZW06ICc9JworICAgICAgICAgICAgICAgICAgICB9LAorICAgICAgICAgICAgICAgICAgICB0ZW1wbGF0ZVVybDogJ3RlbXBsYXRlL2dyaWRzdGVyL2dyaWRzdGVySXRlbS5odG1sJywKKyAgICAgICAgICAgICAgICAgICAgcmVwbGFjZTogZmFsc2UsCisgICAgICAgICAgICAgICAgICAgIHRyYW5zY2x1ZGU6IHRydWUsCisgICAgICAgICAgICAgICAgICAgIGNvbnRyb2xsZXI6IFtmdW5jdGlvbigpIHt9XQorICAgICAgICAgICAgICAgIH07CisgICAgICAgICAgICB9XSkKKyAgICAgICAgLmRpcmVjdGl2ZSgnYXR0R3JpZHN0ZXJJdGVtSGVhZGVyJywgW2Z1bmN0aW9uKCkgeworICAgICAgICAgICAgICAgIHJldHVybiB7CisgICAgICAgICAgICAgICAgICAgIHJlc3RyaWN0OiAnRUEnLAorICAgICAgICAgICAgICAgICAgICByZXF1aXJlOiBbJ15hdHRHcmlkc3Rlckl0ZW0nXSwKKyAgICAgICAgICAgICAgICAgICAgc2NvcGU6IHsKKyAgICAgICAgICAgICAgICAgICAgICAgIGhlYWRlclRleHQ6ICdAJywKKyAgICAgICAgICAgICAgICAgICAgICAgIHN1YkhlYWRlclRleHQ6ICdAPycKKyAgICAgICAgICAgICAgICAgICAgfSwKKyAgICAgICAgICAgICAgICAgICAgdGVtcGxhdGVVcmw6ICd0ZW1wbGF0ZS9ncmlkc3Rlci9ncmlkc3Rlckl0ZW1IZWFkZXIuaHRtbCcsCisgICAgICAgICAgICAgICAgICAgIHJlcGxhY2U6IHRydWUsCisgICAgICAgICAgICAgICAgICAgIHRyYW5zY2x1ZGU6IHRydWUsCisgICAgICAgICAgICAgICAgICAgIGxpbms6IGZ1bmN0aW9uKHNjb3BlLCBlbGVtZW50KSB7CisgICAgICAgICAgICAgICAgICAgICAgICBpZiAoYW5ndWxhci5pc0RlZmluZWQoc2NvcGUuc3ViSGVhZGVyVGV4dCkgJiYgc2NvcGUuc3ViSGVhZGVyVGV4dCkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGFuZ3VsYXIuZWxlbWVudChlbGVtZW50WzBdLnF1ZXJ5U2VsZWN0b3IoJ3NwYW4uZ3JpZHN0ZXItaXRlbS1zdWItaGVhZGVyLWNvbnRlbnQnKSkuYXR0cigidGFiaW5kZXgiLCAiMCIpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGFuZ3VsYXIuZWxlbWVudChlbGVtZW50WzBdLnF1ZXJ5U2VsZWN0b3IoJ3NwYW4uZ3JpZHN0ZXItaXRlbS1zdWItaGVhZGVyLWNvbnRlbnQnKSkuYXR0cigiYXJpYS1sYWJlbCIsIHNjb3BlLnN1YkhlYWRlclRleHQpOworICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgfTsKKyAgICAgICAgICAgIH1dKQorICAgICAgICAuZGlyZWN0aXZlKCdhdHRHcmlkc3Rlckl0ZW1Cb2R5JywgW2Z1bmN0aW9uKCkgeworICAgICAgICAgICAgICAgIHJldHVybiB7CisgICAgICAgICAgICAgICAgICAgIHJlc3RyaWN0OiAnRUEnLAorICAgICAgICAgICAgICAgICAgICByZXF1aXJlOiBbJ15hdHRHcmlkc3Rlckl0ZW0nXSwKKyAgICAgICAgICAgICAgICAgICAgc2NvcGU6IHt9LAorICAgICAgICAgICAgICAgICAgICB0ZW1wbGF0ZVVybDogJ3RlbXBsYXRlL2dyaWRzdGVyL2dyaWRzdGVySXRlbUJvZHkuaHRtbCcsCisgICAgICAgICAgICAgICAgICAgIHJlcGxhY2U6IHRydWUsCisgICAgICAgICAgICAgICAgICAgIHRyYW5zY2x1ZGU6IHRydWUKKyAgICAgICAgICAgICAgICB9OworICAgICAgICAgICAgfV0pCisgICAgICAgIC5kaXJlY3RpdmUoJ2F0dEdyaWRzdGVySXRlbUZvb3RlcicsIFsnJGxvY2F0aW9uJywgZnVuY3Rpb24oJGxvY2F0aW9uKSB7CisgICAgICAgICAgICAgICAgcmV0dXJuIHsKKyAgICAgICAgICAgICAgICAgICAgcmVzdHJpY3Q6ICdFQScsCisgICAgICAgICAgICAgICAgICAgIHJlcXVpcmU6IFsnXmF0dEdyaWRzdGVySXRlbSddLAorICAgICAgICAgICAgICAgICAgICBzY29wZTogeworICAgICAgICAgICAgICAgICAgICAgICAgYXR0R3JpZHN0ZXJJdGVtRm9vdGVyTGluazogJ0A/JworICAgICAgICAgICAgICAgICAgICB9LAorICAgICAgICAgICAgICAgICAgICB0ZW1wbGF0ZVVybDogJ3RlbXBsYXRlL2dyaWRzdGVyL2dyaWRzdGVySXRlbUZvb3Rlci5odG1sJywKKyAgICAgICAgICAgICAgICAgICAgcmVwbGFjZTogdHJ1ZSwKKyAgICAgICAgICAgICAgICAgICAgdHJhbnNjbHVkZTogdHJ1ZSwKKyAgICAgICAgICAgICAgICAgICAgY29udHJvbGxlcjogWyckc2NvcGUnLCBmdW5jdGlvbigkc2NvcGUpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAkc2NvcGUuY2xpY2tPbkZvb3RlckxpbmsgPSBmdW5jdGlvbihldnQpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZXZ0LnByZXZlbnREZWZhdWx0KCk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGV2dC5zdG9wUHJvcGFnYXRpb24oKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKCRzY29wZS5hdHRHcmlkc3Rlckl0ZW1Gb290ZXJMaW5rKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAkbG9jYXRpb24udXJsKCRzY29wZS5hdHRHcmlkc3Rlckl0ZW1Gb290ZXJMaW5rKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgICAgIH07CisgICAgICAgICAgICAgICAgICAgICAgICB9XSwKKyAgICAgICAgICAgICAgICAgICAgbGluazogZnVuY3Rpb24oc2NvcGUsIGVsZW1lbnQpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIGlmIChhbmd1bGFyLmlzRGVmaW5lZChzY29wZS5hdHRHcmlkc3Rlckl0ZW1Gb290ZXJMaW5rKSAmJiBzY29wZS5hdHRHcmlkc3Rlckl0ZW1Gb290ZXJMaW5rKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgZWxlbWVudC5hdHRyKCJyb2xlIiwgImxpbmsiKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgfQorICA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vbnMgPyBvcHRpb25zLmNhbmNlbGFibGUgOiB0cnVlKTsKKyAgICAgICAgZm9yKHZhciB6IGluIGRhdGEpIGV2ZW50W3pdID0gZGF0YVt6XTsKKyAgICAgICAgZWxlbWVudC5kaXNwYXRjaEV2ZW50KGV2ZW50KTsKKyAgICB9OworCisgICAgJC5ldmVudC5zcGVjaWFsLnJlc2l6ZSA9IHsKKyAgICAgICAgc2V0dXA6IGZ1bmN0aW9uKCkgeworICAgICAgICAgICAgdmFyIGVsZW1lbnQgPSB0aGlzOworICAgICAgICAgICAgdmFyIHJlc2l6ZSA9ICdvbnJlc2l6ZScgaW4gZWxlbWVudDsKKyAgICAgICAgICAgIGlmKCFyZXNpemUgJiYgIWVsZW1lbnQuX3Jlc2l6ZVNlbnNvcikgeworICAgICAgICAgICAgICAgIHZhciBzZW5zb3IgPSBlbGVtZW50Ll9yZXNpemVTZW5zb3IgPSBkb2N1bWVudC5jcmVhdGVFbGVtZW50KCdkaXYnKTsKKyAgICAgICAgICAgICAgICBzZW5zb3IuY2xhc3NOYW1lID0gJ3Jlc2l6ZS1zZW5zb3InOworICAgICAgICAgICAgICAgIHNlbnNvci5pbm5lckhUTUwgPSAnPGRpdiBjbGFzcz0icmVzaXplLW92ZXJmbG93Ij48ZGl2PjwvZGl2PjwvZGl2PjxkaXYgY2xhc3M9InJlc2l6ZS11bmRlcmZsb3ciPjxkaXY+PC9kaXY+PC9kaXY+JzsKKworICAgICAgICAgICAgICAgIHZhciB4ID0gMCwKKyAgICAgICAgICAgICAgICAgICAgeSA9IDAsCisgICAgICAgICAgICAgICAgICAgIGZpcnN0ID0gc2Vuc29yLmZpcnN0RWxlbWVudENoaWxkLmZpcnN0Q2hpbGQsCisgICAgICAgICAgICAgICAgICAgIGxhc3QgPSBzZW5zb3IubGFzdEVsZW1lbnRDaGlsZC5maXJzdENoaWxkLAorICAgICAgICAgICAgICAgICAgICBtYXRjaEZsb3cgPSBmdW5jdGlvbihldmVudCkgeworICAgICAgICAgICAgICAgICAgICAgICAgdmFyIGNoYW5nZSA9IGZhbHNlLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIHdpZHRoID0gZWxlbWVudC5vZmZzZXRXaWR0aDsKKyAgICAgICAgICAgICAgICAgICAgICAgIGlmKHggIT0gd2lkdGgpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBmaXJzdC5zdHlsZS53aWR0aCA9IHdpZHRoIC0gMSArICdweCc7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgbGFzdC5zdHlsZS53aWR0aCA9IHdpZHRoICsgMSArICdweCc7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgY2hhbmdlID0gdHJ1ZTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB4ID0gd2lkdGg7CisgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICB2YXIgaGVpZ2h0ID0gZWxlbWVudC5vZmZzZXRIZWlnaHQ7CisgICAgICAgICAgICAgICAgICAgICAgICBpZih5ICE9IGhlaWdodCkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZpcnN0LnN0eWxlLmhlaWdodCA9IGhlaWdodCAtIDEgKyAncHgnOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxhc3Quc3R5bGUuaGVpZ2h0ID0gaGVpZ2h0ICsgMSArICdweCc7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgY2hhbmdlID0gdHJ1ZTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB5ID0gaGVpZ2h0OworICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgaWYoY2hhbmdlICYmIGV2ZW50LmN1cnJlbnRUYXJnZXQgIT0gZWxlbWVudCkgZmlyZUV2ZW50KGVsZW1lbnQsICdyZXNpemUnKTsKKyAgICAgICAgICAgICAgICAgICAgfTsKKworICAgICAgICAgICAgICAgIGlmKGdldENvbXB1dGVkU3R5bGUoZWxlbWVudCkucG9zaXRpb24gPT0gJ3N0YXRpYycpIHsKKyAgICAgICAgICAgICAgICAgICAgZWxlbWVudC5zdHlsZS5wb3NpdGlvbiA9ICdyZWxhdGl2ZSc7CisgICAgICAgICAgICAgICAgICAgIGVsZW1lbnQuX3Jlc2l6ZVNlbnNvci5fcmVzZXRQb3NpdGlvbiA9IHRydWU7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIGFkZEZsb3dMaXN0ZW5lcihzZW5zb3IsICdvdmVyJywgbWF0Y2hGbG93KTsKKyAgICAgICAgICAgICAgICBhZGRGbG93TGlzdGVuZXIoc2Vuc29yLCAndW5kZXInLCBtYXRjaEZsb3cpOworICAgICAgICAgICAgICAgIGFkZEZsb3dMaXN0ZW5lcihzZW5zb3IuZmlyc3RFbGVtZW50Q2hpbGQsICdvdmVyJywgbWF0Y2hGbG93KTsKKyAgICAgICAgICAgICAgICBhZGRGbG93TGlzdGVuZXIoc2Vuc29yLmxhc3RFbGVtZW50Q2hpbGQsICd1bmRlcicsIG1hdGNoRmxvdyk7CisgICAgICAgICAgICAgICAgZWxlbWVudC5hcHBlbmRDaGlsZChzZW5zb3IpOworICAgICAgICAgICAgICAgIG1hdGNoRmxvdyh7fSk7CisgICAgICAgICAgICB9CisgICAgICAgICAgICB2YXIgZXZlbnRzID0gZWxlbWVudC5fZmxvd0V2ZW50cyB8fCAoZWxlbWVudC5fZmxvd0V2ZW50cyA9IFtdKTsKKyAgICAgICAgICAgIGlmKGV2ZW50cy5pbmRleE9mKGhhbmRsZXIpID09IC0xKSBldmVudHMucHVzaChoYW5kbGVyKTsKKyAgICAgICAgICAgIGlmKCFyZXNpemUpIGVsZW1lbnQuYWRkRXZlbnRMaXN0ZW5lcigncmVzaXplJywgaGFuZGxlciwgZmFsc2UpOworICAgICAgICAgICAgZWxlbWVudC5vbnJlc2l6ZSA9IGZ1bmN0aW9uKGUpIHsKKyAgICAgICAgICAgICAgICBldmVudHMuZm9yRWFjaChmdW5jdGlvbihmbikgeworICAgICAgICAgICAgICAgICAgICBmbi5jYWxsKGVsZW1lbnQsIGUpOworICAgICAgICAgICAgICAgIH0pOworICAgICAgICAgICAgfTsKKyAgICAgICAgfSwKKworICAgICAgICB0ZWFyZG93bjogZnVuY3Rpb24oKSB7CisgICAgICAgICAgICB2YXIgZWxlbWVudCA9IHRoaXM7CisgICAgICAgICAgICB2YXIgaW5kZXggPSBlbGVtZW50Ll9mbG93RXZlbnRzLmluZGV4T2YoaGFuZGxlcik7CisgICAgICAgICAgICBpZihpbmRleCA+IC0xKSBlbGVtZW50Ll9mbG93RXZlbnRzLnNwbGljZShpbmRleCwgMSk7CisgICAgICAgICAgICBpZighZWxlbWVudC5fZmxvd0V2ZW50cy5sZW5ndGgpIHsKKyAgICAgICAgICAgICAgICB2YXIgc2Vuc29yID0gZWxlbWVudC5fcmVzaXplU2Vuc29yOworICAgICAgICAgICAgICAgIGlmKHNlbnNvcikgeworICAgICAgICAgICAgICAgICAgICBlbGVtZW50LnJlbW92ZUNoaWxkKHNlbnNvcik7CisgICAgICAgICAgICAgICAgICAgIGlmKHNlbnNvci5fcmVzZXRQb3NpdGlvbikgZWxlbWVudC5zdHlsZS5wb3NpdGlvbiA9ICdzdGF0aWMnOworICAgICAgICAgICAgICAgICAgICBkZWxldGUgZWxlbWVudC5fcmVzaXplU2Vuc29yOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICBpZignb25yZXNpemUnIGluIGVsZW1lbnQpIGVsZW1lbnQub25yZXNpemUgPSBudWxsOworICAgICAgICAgICAgICAgIGRlbGV0ZSBlbGVtZW50Ll9mbG93RXZlbnRzOworICAgICAgICAgICAgfQorICAgICAgICAgICAgZWxlbWVudC5yZW1vdmVFdmVudExpc3RlbmVyKCdyZXNpemUnLCBoYW5kbGVyKTsKKyAgICAgICAgfQorICAgIH07CisKKyAgICAkLmZuLmV4dGVuZCh7CisgICAgICAgIHJlc2l6ZTogZnVuY3Rpb24oZm4pIHsKKyAgICAgICAgICAgIH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ZXN1bHRzOworCQkJCQkJfQorCQkJCQl9IGVsc2UgeworCQkJCQkJcmV0dXJuIHJlc3VsdHM7CisJCQkJCX0KKwkJCQl9IGVsc2UgeworCQkJCQkvLyBDb250ZXh0IGlzIG5vdCBhIGRvY3VtZW50CisJCQkJCWlmICggY29udGV4dC5vd25lckRvY3VtZW50ICYmIChlbGVtID0gY29udGV4dC5vd25lckRvY3VtZW50LmdldEVsZW1lbnRCeUlkKCBtICkpICYmCisJCQkJCQljb250YWlucyggY29udGV4dCwgZWxlbSApICYmIGVsZW0uaWQgPT09IG0gKSB7CisJCQkJCQlyZXN1bHRzLnB1c2goIGVsZW0gKTsKKwkJCQkJCXJldHVybiByZXN1bHRzOworCQkJCQl9CisJCQkJfQorCisJCQkvLyBTcGVlZC11cDogU2l6emxlKCJUQUciKQorCQkJfSBlbHNlIGlmICggbWF0Y2hbMl0gKSB7CisJCQkJcHVzaC5hcHBseSggcmVzdWx0cywgc2xpY2UuY2FsbChjb250ZXh0LmdldEVsZW1lbnRzQnlUYWdOYW1lKCBzZWxlY3RvciApLCAwKSApOworCQkJCXJldHVybiByZXN1bHRzOworCisJCQkvLyBTcGVlZC11cDogU2l6emxlKCIuQ0xBU1MiKQorCQkJfSBlbHNlIGlmICggKG0gPSBtYXRjaFszXSkgJiYgc3VwcG9ydC5nZXRCeUNsYXNzTmFtZSAmJiBjb250ZXh0LmdldEVsZW1lbnRzQnlDbGFzc05hbWUgKSB7CisJCQkJcHVzaC5hcHBseSggcmVzdWx0cywgc2xpY2UuY2FsbChjb250ZXh0LmdldEVsZW1lbnRzQnlDbGFzc05hbWUoIG0gKSwgMCkgKTsKKwkJCQlyZXR1cm4gcmVzdWx0czsKKwkJCX0KKwkJfQorCisJCS8vIFFTQSBwYXRoCisJCWlmICggc3VwcG9ydC5xc2EgJiYgIXJidWdneVFTQS50ZXN0KHNlbGVjdG9yKSApIHsKKwkJCW9sZCA9IHRydWU7CisJCQluaWQgPSBleHBhbmRvOworCQkJbmV3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nLCBjYWxsYmFjaykgeworCQlyZXR1cm4gJC5lZmZlY3RzLmFuaW1hdGVDbGFzcy5jYWxsKCB0aGlzLCB7CisJCQlhZGQ6IGFkZCwKKwkJCXJlbW92ZTogcmVtb3ZlCisJCX0sIHNwZWVkLCBlYXNpbmcsIGNhbGxiYWNrICk7CisJfQorfSk7CisKK30pKCk7CisKKy8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCisvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogRUZGRUNUUyAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLworLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KKworKGZ1bmN0aW9uKCkgeworCiskLmV4dGVuZCggJC5lZmZlY3RzLCB7CisJdmVyc2lvbjogIjEuOS4yIiwKKworCS8vIFNhdmVzIGEgc2V0IG9mIHByb3BlcnRpZXMgaW4gYSBkYXRhIHN0b3JhZ2UKKwlzYXZlOiBmdW5jdGlvbiggZWxlbWVudCwgc2V0ICkgeworCQlmb3IoIHZhciBpPTA7IGkgPCBzZXQubGVuZ3RoOyBpKysgKSB7CisJCQlpZiAoIHNldFsgaSBdICE9PSBudWxsICkgeworCQkJCWVsZW1lbnQuZGF0YSggZGF0YVNwYWNlICsgc2V0WyBpIF0sIGVsZW1lbnRbIDAgXS5zdHlsZVsgc2V0WyBpIF0gXSApOworCQkJfQorCQl9CisJfSwKKworCS8vIFJlc3RvcmVzIGEgc2V0IG9mIHByZXZpb3VzbHkgc2F2ZWQgcHJvcGVydGllcyBmcm9tIGEgZGF0YSBzdG9yYWdlCisJcmVzdG9yZTogZnVuY3Rpb24oIGVsZW1lbnQsIHNldCApIHsKKwkJdmFyIHZhbCwgaTsKKwkJZm9yKCBpPTA7IGkgPCBzZXQubGVuZ3RoOyB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worCQl2YXIgc3R5bGUgPSB0aGlzLmNzcygga2V5ICksCisJCQl2YWwgPSBbXTsKKworCQkkLmVhY2goIFsgImVtIiwgInB4IiwgIiUiLCAicHQiIF0sIGZ1bmN0aW9uKCBpLCB1bml0ICkgeworCQkJaWYgKCBzdHlsZS5pbmRleE9mKCB1bml0ICkgPiAwICkgeworCQkJCXZhbCA9IFsgcGFyc2VGbG9hdCggc3R5bGUgKSwgdW5pdCBdOworCQkJfQorCQl9KTsKKwkJcmV0dXJuIHZhbDsKKwl9Cit9KTsKKworfSkoKTsKKworLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KKy8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiBFQVNJTkcgKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCisvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLworCisoZnVuY3Rpb24oKSB7CisKKy8vIGJhc2VkIG9uIGVhc2luZyBlcXVhdGlvbnMgZnJvbSBSb2JlcnQgUGVubmVyIChodHRwOi8vd3d3LnJvYmVydHBlbm5lci5jb20vZWFzaW5nKQorCit2YXIgYmFzZUVhc2luZ3MgPSB7fTsKKworJC5lYWNoKCBbICJRdWFkIiwgIkN1YmljIiwgIlF1YXJ0IiwgIlF1aW50IiwgIkV4cG8iIF0sIGZ1bmN0aW9uKCBpLCBuYW1lICkgeworCWJhc2VFYXNpbmdzWyBuYW1lIF0gPSBmdW5jdGlvbiggcCApIHsKKwkJcmV0dXJuIE1hdGgucG93KCBwLCBpICsgMiApOworCX07Cit9KTsKKworJC5leHRlbmQoIGJhc2VFYXNpbmdzLCB7CisJU2luZTogZnVuY3Rpb24gKCBwICkgeworCQlyZXR1cm4gMSAtIE1hdGguY29zKCBwICogTWF0aC5QSSAvIDIgKTsKKwl9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ApIHx8ICIiKS5zcGxpdCggL1xzKy8gKSwKKwkJaW5kZXggPSAkLmluQXJyYXkoIGlkLCBkZXNjcmliZWRieSApOworCWlmICggaW5kZXggIT09IC0xICkgeworCQlkZXNjcmliZWRieS5zcGxpY2UoIGluZGV4LCAxICk7CisJfQorCisJZWxlbS5yZW1vdmVEYXRhKCAidWktdG9vbHRpcC1pZCIgKTsKKwlkZXNjcmliZWRieSA9ICQudHJpbSggZGVzY3JpYmVkYnkuam9pbiggIiAiICkgKTsKKwlpZiAoIGRlc2NyaWJlZGJ5ICkgeworCQllbGVtLmF0dHIoICJhcmlhLWRlc2NyaWJlZGJ5IiwgZGVzY3JpYmVkYnkgKTsKKwl9IGVsc2UgeworCQllbGVtLnJlbW92ZUF0dHIoICJhcmlhLWRlc2NyaWJlZGJ5IiApOworCX0KK30KKworJC53aWRnZXQoICJ1aS50b29sdGlwIiwgeworCXZlcnNpb246ICIxLjkuMiIsCisJb3B0aW9uczogeworCQljb250ZW50OiBmdW5jdGlvbigpIHsKKwkJCXJldHVybiAkKCB0aGlzICkuYXR0ciggInRpdGxlIiApOworCQl9LAorCQloaWRlOiB0cnVlLAorCQkvLyBEaXNhYmxlZCBlbGVtZW50cyBoYXZlIGluY29uc2lzdGVudCBiZWhhdmlvciBhY3Jvc3MgYnJvd3NlcnMgKCM4NjYxKQorCQlpdGVtczogIlt0aXRsZV06bm90KFtkaXNhYmxlZF0pIiwKKwkJcG9zaXRpb246IHsKKwkJCW15OiAibGVmdCB0b3ArMTUiLAorCQkJYXQ6ICJsZWZ0IGJvdHRvbSIsCisJCQljb2xsaXNpb246ICJmbGlwZml0IGZsaXAiCisJCX0sCisJCXNob3c6IHRydWUsCisJCXRvb2x0aXBDbGFzczogbnVsbCwKKwkJdHJhY2s6IGZhbHNlLAorCisJCS8vIGNhbGxiYWNrcworCQljbG9zZTogbnVsbCwKKwkJb3BlbjogbnVsbAorCX0sCisKKwlfY3JlYXRlOiBmdW5jdGlvbigpIHsKKwkJdG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T09PT09PT09PT09PT09PT09PT09PT09PQorICoJQkVHSU4gV0lER0VUOiAkKCBzZWxlY3RvciApLmxheW91dCgge29wdGlvbnN9ICk7CisgKgk9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKyAqLworJC5mbi5sYXlvdXQgPSBmdW5jdGlvbiAob3B0cykgeworCXZhcgorCisJLy8gbG9jYWwgYWxpYXNlcyB0byBnbG9iYWwgZGF0YQorCWJyb3dzZXIJPSAkLmxheW91dC5icm93c2VyCissCV9jCQk9ICQubGF5b3V0LmNvbmZpZworCisJLy8gbG9jYWwgYWxpYXNlcyB0byB1dGxpdHkgbWV0aG9kcworLAljc3NXCT0gJC5sYXlvdXQuY3NzV2lkdGgKKywJY3NzSAk9ICQubGF5b3V0LmNzc0hlaWdodAorLAllbERpbXMJPSAkLmxheW91dC5nZXRFbGVtZW50RGltZW5zaW9ucworLAlzdHlsZXMJPSAkLmxheW91dC5nZXRFbGVtZW50U3R5bGVzCissCWV2dE9iagk9ICQubGF5b3V0LmdldEV2ZW50T2JqZWN0CissCWV2dFBhbmUJPSAkLmxheW91dC5wYXJzZVBhbmVOYW1lCisKKy8qKgorICogb3B0aW9ucyAtIHBvcHVsYXRlZCBieSBpbml0T3B0aW9ucygpCisgKi8KKywJb3B0aW9ucyA9ICQuZXh0ZW5kKHRydWUsIHt9LCAkLmxheW91dC5kZWZhdWx0cykKKywJZWZmZWN0cwk9IG9wdGlvbnMuZWZmZWN0cyA9ICQuZXh0ZW5kKHRydWUsIHt9LCAkLmxheW91dC5lZmZlY3RzKQorCisvKioKKyAqIGxheW91dC1zdGF0ZSBvYmplY3QKKyAqLworLAlzdGF0ZSA9IHsKKwkJLy8gZ2VuZXJhdGUgdW5pcXVlIElEIHRvIHVzZSBmb3IgZXZlbnQubmFtZXNwYWNlIHNvIGNhbiB1bmJpbmQgb25seSBldmVudHMgYWRkZWQgYnkgJ3RoaXMgbGF5b3V0JworCQlpZ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dfY2hhcnQvY3NzL2pxdWVyeS5qT3JnQ2hhcnQuY3NzIGIvZWNvbXAtcG9ydGFsLUJFL3dhci9zdGF0aWMvZnVzaW9uL3NhbXBsZS9vcmdfY2hhcnQvY3NzL2pxdWVyeS5qT3JnQ2hhcnQuY3NzCm5ldyBmaWxlIG1vZGUgMTAwNjQ0CmluZGV4IDAwMDAwMDAuLmZmYWJlMjcKLS0tIC9kZXYvbnVsbAorKysgYi9lY29tcC1wb3J0YWwtQkUvd2FyL3N0YXRpYy9mdXNpb24vc2FtcGxlL29yZ19jaGFydC9jc3MvanF1ZXJ5LmpPcmdDaGFydC5jc3MKQEAgLTAsMCArMSw1MSBAQAorLyogQmFzaWMgc3R5bGluZyAqLworLyogRHJhdyB0aGUgbGluZXMgKi8KKy5qT3JnQ2hhcnQgLmxpbmUgeworICBoZWlnaHQgICAgICAgICAgICAgICAgOiAyMHB4OworICB3aWR0aCAgICAgICAgICAgICAgICAgOiA0cHg7Cit9CisKKy5qT3JnQ2hhcnQgLmRvd24geworICBiYWNrZ3JvdW5kLWNvbG9yIAkJOiBibGFjazsJCisgIG1hcmdpbiAJCQkJOiAwcHggYXV0bzsKK30KKworLmpPcmdDaGFydCAudG9wIHsKKyAgYm9yZGVyLXRvcCAgICAgICAgICA6IDNweCBzb2xpZCBibGFjazsKK30KKworLmpPcmdDaGFydCAubGVmdCB7CisgIGJvcmRlci1yaWdodCAgICAgICAgICA6IDJweCBzb2xpZCBibGFjazsKK30KKworLmpPcmdDaGFydCAucmlnaHQgeworICBib3JkZXItbGVmdCAgICAgICAgICAgOiAycHggc29saWQgYmxhY2s7Cit9CisKKy8qIG5vZGUgY2VsbCAqLworLmpPcmdDaGFydCB0ZCB7CisgIHRleHQtYWxpZ24gICAgICAgICAgICA6IGNlbnRlcjsKKyAgdmVydGljYWwtYWxpZ24gICAgICAgIDogdG9wOworICBwYWRkaW5nICAgICAgICAgICAgICAgOiAwOworfQorCisvKiBUaGUgbm9kZSAqLworLmpPcmdD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yaXB0PgorICAgIAorICAgIDxzY3JpcHQgc3JjPSJqcXVlcnkuak9yZ0NoYXJ0LmpzIj48L3NjcmlwdD4KKworICAgIDxzY3JpcHQ+CisgICAgalF1ZXJ5KGRvY3VtZW50KS5yZWFkeShmdW5jdGlvbigpIHsKKyAgICAgICAgJCgiI29yZyIpLmpPcmdDaGFydCh7CisgICAgICAgICAgICBjaGFydEVsZW1lbnQgOiAnI2NoYXJ0JywKKyAgICAgICAgICAgIGRyYWdBbmREcm9wICA6IHRydWUKKyAgICAgICAgfSk7CisgICAgfSk7CisgICAgPC9zY3JpcHQ+CisgIDwvaGVhZD4KKworICA8Ym9keSBvbmxvYWQ9InByZXR0eVByaW50KCk7Ij4KKyAgICA8dWwgaWQ9Im9yZyIgc3R5bGU9ImRpc3BsYXk6bm9uZSI+CisgICAgICA8bGk+UHJvZHVjdCAxPGJyLz4KKyAgICAgICAgPHVsPgorICAgICAgICAgIDxsaT5TZXJ2aWNlIDE8YnIvPgorICAgICAgICAgICAgPHVsPgorCQkJICA8bGk+UmVzb3VyY2UgMTxici8+PC9saT4KKwkJCSAgPGxpPlJlc291cmNlIDI8YnIvPjwvbGk+CisJCQkgIDxsaT5SZXNvdXJjZSAzPGJyLz48L2xpPgorCQkJICA8bGk+UmVzb3VyY2UgNDxici8+PC9saT4KKwkJCSAgPGxpPlJlc291cmNlIDU8YnIvPjwvbGk+CisgICAgICAgICAgICA8L3VsPgorICAgICAgICAgIDwvbGk+CisgICAgICAgICAgPGxpPlNlcnZpY2UgNjxici8+PC9saT4KKyAgICAgICAgICA8bGk+U2VydmljZSA3PGJyLz4KKyAgICAgICAgICAgIDx1bD4KKwkJCSAgPGxpPlJlc291cmNlIDg8YnIvPjwvbGk+CisJCQkgIDxsaT5SZXNvdXJjZSA5PGJyLz48L2xpPgorCQkJICA8bGk+UmVzb3VyY2UgMTA8YnIvPjwvbGk+CisJCQkgIDxsaT5SZXNvdXJjZSAxMTxici8+PC9saT4KKyAgICAgICAgICAgIDwvdWw+CisgICAgICAgICAgPC9saT4KKyAgICAgICAgPC91bD4KKyAgICAgIDwvbGk+CisgICA8L3VsPiAgICAgICAgICAgIAorICAgIAorICAgIDxkaXYgaWQ9ImNoYXJ0IiBjbGFzcz0ib3JnQ2hhcnQiPjwvZGl2PgorICAgIAorICAgIDxzY3JpcHQ+CisgICAgICAgIGpRdWVyeShkb2N1bWVudCkucmVhZHkoZnVuY3Rpb24oKSB7CisgICAgICAgICAgICAKKyAgICAgICAgICAgIC8qIEN1c3RvbSBqUXVlcnkgZm9yIHRoZSBleGFtcGxlICovCisgICAgICAgICAgICAkKCIjc2hvdy1saXN0IikuY2xpY2soZnVuY3Rpb24oZSl7CisgICAgICAgICAgICAgICAgZS5wcmV2ZW50RGVmYXVsdCgpOworICAgICAgICAgICAgICAgIAorICAgICAgICAgICAgICAgICQoJyNsaXN0LWh0bWwnKS50b2dnbGUoJ2Zhc3QnLCBmdW5jdGlvbigpeworICAgICAgICAgICAgICAgICAgICBpZigkKHRoaXMpLmlzKCc6dmlzaWJsZScpKXsKKyAgICAgICAgICAgICAgICAgICAgICAgICQoJyNzaG93LWxpc3QnKS50ZXh0KCdIaWRlIHVuZGVybHlpbmcgbGlzdC4nKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICQoIi50b3BiYXIiKS5mYWRlVG8oJ2Zhc3QnLDAuOSk7CisgICAgICAgICAgICAgICAgICAgIH1lbHNleworICAgICAgICAgICAgICAgICAgICAgICAgJCgnI3Nob3ctbGlzdCcpLnRleHQoJ1Nob3cgdW5kZXJseWluZyBsaXN0LicpOworICAgICAgICAgICAgICAgICAgICAgICAgJCgiLnRvcGJhciIpLmZhZGVUbygnZmFzdCcsMSk7ICAgICAgICAgICAgICAgICAgCisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICB9KTsKKyAgICAgICAgICAgIH0pOworICAgICAgICAgICAgCisgICAgICAgICAgICAkKCcjbGlzdC1odG1sJykudGV4dCgkKCcjb3JnJykua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CisKKyAgPGJvZHkgb25sb2FkPSJwcmV0dHlQcmludCgpOyI+CisgICAgPHVsIGlkPSJvcmciIHN0eWxlPSJkaXNwbGF5Om5vbmUiPgorICAgICAgPGxpPlRyaW5pdHk8YnIvPgorICAgICAgICA8dWw+CisgICAgICAgICAgPGxpPkNhbGwgRm9yd2FyZGluZzxici8+CisgICAgICAgICAgICA8dWw+CisJCQkgIDxsaT5DYWxsIEZvcndhcmRpbmcgQnVzeTxici8+PC9saT4KKwkJCSAgPGxpPkNhbGwgRm9yd2FyZGluZyBBbHdheXM8YnIvPjwvbGk+CisJCQkgIDxsaT5DYWxsIEZvcndhcmRpbmcgTm90IFJlYWNoYWJsZTxici8+PC9saT4KKyAgICAgICAgICAgIDwvdWw+CisgICAgICAgICAgPC9saT4KKyAgICAgICAgICA8bGk+RGlhbCBSZXN0cmljdGlvbnM8YnIvPgorICAgICAgICAgICAgPHVsPgorCQkJICA8bGk+T3V0Z29pbmcgQ2FsbHM8YnIvPjwvbGk+CisJCQkgIDxsaT5SZWRpcmVjdGluZyBDYWxsczxici8+PC9saT4KKwkJCSAgPGxpPkluY29taW5nIENhbGxzPGJyLz48L2xpPgorICAgICAgICAgICAgPC91bD4KKyAgICAgICAgICA8L2xpPgorICAgICAgICAgIDxsaT5NZXNzYWdpbmc8YnIvPgorICAgICAgICAgICAgPHVsPgorCQkJICA8bGk+Vm9pY2UgTWFuYWdlbWVudDxici8+PC9saT4KKwkJCSAgPGxpPkdyZWV0aW5nczxici8+PC9saT4KKwkJCSAgPGxpPkZheCBNZXNzYWdpbmc8YnIvPjwvbGk+CisgICAgICAgICAgICA8L3VsPgorICAgICAgICAgIDwvbGk+CisgICAgICAgIDwvdWw+CisgICAgICA8L2xpPgorICAgPC91bD4gICAgICAgICAgICAKKyAgICAKKyAgICA8ZGl2IGlkPSJjaGFydCIgY2xhc3M9Im9yZ0NoYXJ0Ij48L2Rpdj4KKyAgICAKKyAgICA8c2NyaXB0PgorICAgICAgICBqUXVlcnkoZG9jdW1lbnQpLnJlYWR5KGZ1bmN0aW9uKCkgeworICAgICAgICAgICAgCisgICAgICAgICAgICAvKiBDdXN0b20galF1ZXJ5IGZvciB0aGUgZXhhbXBsZSAqLworICAgICAgICAgICAgJCgiI3Nob3ctbGlzdCIpLmNsaWNrKGZ1bmN0aW9uKGUpeworICAgICAgICAgICAgICAgIGUucHJldmVudERlZmF1bHQoKTsKKyAgICAgICAgICAgICAgICAKKyAgICAgICAgICAgICAgICAkKCcjbGlzdC1odG1sJykudG9nZ2xlKCdmYXN0JywgZnVuY3Rpb24oKXsKKyAgICAgICAgICAgICAgICAgICAgaWYoJCh0aGlzKS5pcygnOnZpc2libGUnKSl7CisgICAgICAgICAgICAgICAgICAgICAgICAkKCcjc2hvdy1saXN0JykudGV4dCgnSGlkZSB1bmRlcmx5aW5nIGxpc3QuJyk7CisgICAgICAgICAgICAgICAgICAgICAgICAkKCIudG9wYmFyIikuZmFkZVRvKCdmYXN0JywwLjkpOworICAgICAgICAgICAgICAgICAgICB9ZWxzZXsKKyAgICAgICAgICAgICAgICAgICAgICAgICQoJyNzaG93LWxpc3QnKS50ZXh0KCdTaG93IHVuZGVybHlpbmcgbGlzdC4nKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICQoIi50b3BiYXIiKS5mYWRlVG8oJ2Zhc3QnLDEpOyAgICAgICAgICAgICAgICAgIAorICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgfSk7CisgICAgICAgICAgICB9KTsKKyAgICAgICAgICAgIAorICAgICAgICAgICAgJCgnI2xpc3QtaHRtbCcpLnRleHQoJCgnI29yZycpLmh0bWwoKSk7CisgICAgICAgICAgICAKKyAgICAgICAgICAgICQoIiNvcmciKS5iaW5kKCJET01TdWJ0cmVlTW9kaWZpZWQiLCBmdW5jdGlvbigpIHsKKyAgICAgICAgICAgICAgICAkKCcjbGlzdC1odG1sJykudGV4dCgnJyk7CisgICAgICAgICAgICAgICAgCisgICAgICAgICAgICAgICAgJC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W9ucykgeworICAgIHZhciBvcHRzID0gJC5leHRlbmQoe30sICQuZm4uak9yZ0NoYXJ0LmRlZmF1bHRzLCBvcHRpb25zKTsKKyAgICB2YXIgJGFwcGVuZFRvID0gJChvcHRzLmNoYXJ0RWxlbWVudCk7CisKKyAgICAvLyBidWlsZCB0aGUgdHJlZQorICAgICR0aGlzID0gJCh0aGlzKTsKKyAgICB2YXIgJGNvbnRhaW5lciA9ICQoIjxkaXYgY2xhc3M9JyIgKyBvcHRzLmNoYXJ0Q2xhc3MgKyAiJy8+Iik7CisgICAgaWYoJHRoaXMuaXMoInVsIikpIHsKKyAgICAgIGJ1aWxkTm9kZSgkdGhpcy5maW5kKCJsaTpmaXJzdCIpLCAkY29udGFpbmVyLCAwLCBvcHRzKTsKKyAgICB9CisgICAgZWxzZSBpZigkdGhpcy5pcygibGkiKSkgeworICAgICAgYnVpbGROb2RlKCR0aGlzLCAkY29udGFpbmVyLCAwLCBvcHRzKTsKKyAgICB9CisgICAgJGFwcGVuZFRvLmFwcGVuZCgkY29udGFpbmVyKTsKKworICAgIC8vIGFkZCBkcmFnIGFuZCBkcm9wIGlmIGVuYWJsZWQKKyAgICBpZihvcHRzLmRyYWdBbmREcm9wKXsKKyAgICAgICAgJCgnZGl2Lm5vZGUnKS5kcmFnZ2FibGUoeworICAgICAgICAgICAgY3Vyc29yICAgICAgOiAnbW92ZScsCisgICAgICAgICAgICBkaXN0YW5jZSAgICA6IDQwLAorICAgICAgICAgICAgaGVscGVyICAgICAgOiAnY2xvbmUnLAorICAgICAgICAgICAgb3BhY2l0eSAgICAgOiAwLjgsCisgICAgICAgICAgICByZXZlcnQgICAgICA6IHRydWUsCisgICAgICAgICAgICByZXZlcnREdXJhdGlvbiA6IDEwMCwKKyAgICAgICAgICAgIHNuYXAgICAgICAgIDogJ2Rpdi5ub2RlLmV4cGFuZGVkJywKKyAgICAgICAgICAgIHNuYXBNb2RlICAgIDogJ2lubmVyJywKKyAgICAgICAgICAgIHN0YWNrICAgICAgIDogJ2Rpdi5ub2RlJworICAgICAgICB9KTsKKyAgICAgICAgCisgICAgICAgICQoJ2Rpdi5ub2RlJykuZHJvcHBhYmxlKHsKKyAgICAgICAgICAgIGFjY2VwdCAgICAgIDogJy5ub2RlJywgICAgICAgICAgCisgICAgICAgICAgICBhY3RpdmVDbGFzcyA6ICdkcmFnLWFjdGl2ZScsCisgICAgICAgICAgICBob3ZlckNsYXNzICA6ICdkcm9wLWhvdmVyJworICAgICAgICB9KTsKKyAgICAgICAgCisgICAgICAvLyBEcmFnIHN0YXJ0IGV2ZW50IGhhbmRsZXIgZm9yIG5vZGVzCisgICAgICAkKCdkaXYubm9kZScpLmJpbmQoImRyYWdzdGFydCIsIGZ1bmN0aW9uIGhhbmRsZURyYWdTdGFydCggZXZlbnQsIHVpICl7CisgICAgICAgIAorICAgICAgICB2YXIgc291cmNlTm9kZSA9ICQodGhpcyk7CisgICAgICAgIHNvdXJjZU5vZGUucGFyZW50c1VudGlsKCcubm9kZS1jb250YWluZXInKQorICAgICAgICAgICAgICAgICAgIC5maW5kKCcqJykKKyAgICAgICAgICAgICAgICAgICAuZmlsdGVyKCcubm9kZScpCisgICAgICAgICAgICAgICAgICAgLmRyb3BwYWJsZSgnZGlzYWJsZScpOworICAgICAgfSk7CisKKyAgICAgIC8vIERyYWcgc3RvcCBldmVudCBoYW5kbGVyIGZvciBub2RlcworICAgICAgJCgnZGl2Lm5vZGUnKS5iaW5kKCJkcmFnc3RvcCIsIGZ1bmN0aW9uIGhhbmRsZURyYWdTdG9wKCBldmVudCwgdWkgKXsKKworICAgICAgICAvKiByZWxvYWQgdGhlIHBsdWdpbiAqLworICAgICAgICAkKG9wdHMuY2hhcnRFbGVtZW50KS5jaGlsZHJlbigpLnJlbW92ZSgpOworICAgICAgICAkdGhpcy5qT3JnQ2hhcnQob3B0cyk7ICAgICAgCisgICAgICB9KTsKKyAgICAKKyAgICAgIC8vIERyb3AgZXZlbnQgaGFuZGxlciBmb3Igbm9kZXMKKyAgICAgICQoJ2Rpdi5ub2RlJykuYmluZCgiZHJvcCIsIGZ1bmN0aW9uIGhhbmRsZURyb3BFdmVudCggZXZlbnQsIHVpICkgeyAgICAKKyAgICAgICAgdmFyIHNvdXJjZU5vZGUgPSB1aS5kcmFnZ2FibGU7CisgICAgICAgIHZhciB0YXJnZXROb2RlID0gJCh0aGlzKTsKKyAgICAgICAgCisgICAgICAgIC8vIGZpbmRpbmcgbm9kZXMgYmFzZWQgb24gcGxhaW50ZXh0IGFuZCBodG1sCisgICAgICAgIC8vIGNvbnRlbnQgaXMgaGFyZCEKKyAgICAgICAgdmFyIHRhcmdldExpID0gJCgnbGknKS5maWx0ZXIoZnVuY3Rpb24oKXsKKyAgICAgICAgICAgIAorICAgICAgICAgICAgbGkgPSAkKHRoaXMpLmNsb25lKCkKKyAgICAgICAgICAgICAgICAgICAgICAgIC5jaGlsZHJlbigidWwsbGkiKQorICAgICAgICAgICAgICAgICAgICAgICAgLnJlbW92ZSgpCisgICAgICAgICAgICAgICAgICAgIC5lbmQoKTsKKyAgICAgICAgICAgICAgICAgICAgdmFyIGF0dHIgPSBsaS5hdHRyKCdpZCcpOworICAgICAgICAgICAgICAgICAgICBpZiAodHlwZW9mIGF0dHIgIT09ICd1bmRlZmluZWQnICYmIGF0dHIgIT09IGZhbHNlKSB7CisgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gbGkuYXR0cigiaWQiKSA9PSB0YXJnZXROb2RlLmF0dHIoImlkIik7CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgZWxzZSB7CisgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gbGkuaHRtbCgpID09IHRhcmdldE5vZGUuaHRtbCgpOworICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAKKyAgICAgICAgfSk7ICAgICAKKyAgICAgICAgCisgICAgICAgIHZhciBzb3VyY2VMaSA9ICQoJ2xpJykuZmlsdGVyKGZ1bmN0aW9uKCl7CisgICAgICAgICAgICAKKyAgICAgICAgICAgIGxpID0gJCh0aGlzKS5jbG9uZSgpCisgICAgICAgICAgICAgICAgICAgICAgICAuY2hpbGRyZW4oInVsLGxpIikKKyAgICAgICAgICAgICAgICAgICAgICAgIC5yZW1vdmUoKQorICAgICAgICAgICAgICAgICAgICAuZW5kKCk7CisgICAgICAgICAgICAgICAgICAgIHZhciBhdHRyID0gbGkuYXR0cignaWQnKTsKKyAgICAgICAgICAgICAgICAgICAgaWYgKHR5cGVvZiBhdHRyICE9PSAndW5kZWZpbmVkJyAmJiBhdHRyICE9PSBmYWxzZSkgeworICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGxpLmF0dHIoImlkIikgPT0gc291cmNlTm9kZS5hdHRyKCJpZCIpOworICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgIGVsc2UgeworICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGxpLmh0bWwoKSA9PSBzb3VyY2VOb2RlLmh0bWwoKTsKKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgCisgICAgICAgIH0pOworICAgICAgICAKKyAgICAgICAgdmFyIHNvdXJjZWxpQ2xvbmUgPSBzb3VyY2VMaS5jbG9uZSgpOworICAgICAgICB2YXIgc291cmNlVWwgPSBzb3VyY2VMaS5wYXJlbnQoJ3VsJyk7CisgICAgICAgIAorICAgICAgICBpZihzb3VyY2VVbC5jaGlsZHJlbignbGknKS5zaXplKCkgPiAxKXsKKyAgICAgICAgICAgIHNvdXJjZUxpLnJlbW92ZSgpOyAgICAgICAgICAKKyAgICAgICAgfWVsc2V7CisgICAgICAgICAgICBzb3VyY2VVbC5yZW1vdmUoKTsKKyAgICAgICAgfQorICAgICAgICAKKyAgICAgICAgdmFyIGlkID0gc291cmNlTGkuYXR0cigiaWQiKTsKKworICAgICAgICBpZih0YXJnZXRMaS5jaGlsZHJlbigndWwnKS5zaXplKCkgPjApeworICAgICAgICAgICAgaWYgKHR5cGVvZiBpZCAhPT0gJ3VuZGVmaW5lZCcgJiYgaWQgIT09IGZhbHNlKSB7CisgICAgICAgICAgICAgICAgdGFyZ2V0TGkuY2hpbGRyZW4oJ3VsJykuYXBwZW5kKCc8bGkgaWQ9IicraWQrJyI+Jytzb3VyY2VsaUNsb25lLmh0bWwoKSsnPC9saT4nKTsKKyAgICAgICAgICAgIH1lbHNleworICAgICAgICAgICAgICAgIHRhcmdldExpLmNoaWxkcmVuKCd1bCcpLmFwcGVuZCgnPGxpPicrc291cmNlbGlDbG9uZS5odG1sKCkrJzwvbGk+Jyk7ICAgICAgICAKKyAgICAgICAgICAgIH0KKyAgICAgICAgfWVsc2V7CisgICAgICAgICAgICBpZiAodHlwZW9mIGlkICE9PSAndW5kZWZpbmVkJyAmJiBpZCAhPT0gZmFsc2UpIHsKKyAgICAgICAgICAgICAgICB0YXJnZXRMaS5hcHBlbmQoJzx1bD48bGkgaWQ9IicraWQrJyI+Jytzb3VyY2VsaUNsb25lLmh0bWwoKSsnPC9saT48L3VsPicpOworICAgICAgICAgICAgfWVsc2V7CisgICAgICAgICAgICAgICAgdGFyZ2V0TGkuYXBwZW5kKCc8dWw+PGxpPicrc291cmNlbGlDbG9uZS5odG1sKCkrJzwvbGk+PC91bD4nKTsgICAgICAgICAgICAgICAgICAKKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgICAgICAKKyAgICAgIH0pOyAvLyBoYW5kbGVEcm9wRXZlbnQKKyAgICAgICAgCisgICAgfSAvLyBEcmFnIGFuZCBkcm9wCisgIH07CisKKyAgLy8gT3B0aW9uIGRlZmF1bHRzCisgICQuZm4uak9yZ0NoYXJ0LmRlZmF1bHRzID0geworICAgIGNoYXJ0RWxlbWVudCA6ICdib2R5JywKKyAgICBkZXB0aCAgICAgIDogLTEsCisgICAgY2hhcnRDbGFzcyA6ICJqT3JnQ2hhcnQiLAorICAgIGRyYWdBbmREcm9wOiBmYWxzZQorICB9OworCisgIC8vIE1ldGhvZCB0aGF0IHJlY3Vyc2l2ZWx5IGJ1aWxkcyB0aGUgdHJlZQorICBmdW5jdGlvbiBidWlsZE5vZGUoJG5vZGUsICRhcHBlbmRUbywgbGV2ZWwsIG9wdHMpIHsKKyAgICB2YXIgJHRhYmxlID0gJCgiPHRhYmxlIGNlbGxwYWRkaW5nPScwJyBjZWxsc3BhY2luZz0nMCcgYm9yZGVyPScwJy8+Iik7CisgICAgdmFyICR0Ym9keSA9ICQoIjx0Ym9keS8+Iik7CisKKyAgICAvLyBDb25zdHJ1Y3QgdGhlIG5vZGUgY29udGFpbmVyKHMpCisgICAgdmFyICRub2RlUm93ID0gJCgiPHRyLz4iKS5hZGRDbGFzcygibm9kZS1jZWxscyIpOworICAgIHZhciAkbm9kZUNlbGwgPSAkKCI8dGQvPiIpLmFkZENsYXNzKCJub2RlLWNlbGwiKS5hdHRyKCJjb2xzcGFuIiwgMik7CisgICAgdmFyICRjaGlsZE5vZGVzID0gJG5vZGUuY2hpbGRyZW4oInVsOmZpcnN0IikuY2hpbGRyZW4oImxpIik7CisgICAgdmFyICRub2RlRGl2OworICAgIAorICAgIGlmKCRjaGlsZE5vZGVzLmxlbmd0aCA+IDEpIHsKKyAgICAgICRub2RlQ2VsbC5hdHRyKCJjb2xzcGFuIiwgJGNoaWxkTm9kZXMubGVuZ3RoICogMik7CisgICAgfQorICAgIC8vIERyYXcgdGhlIG5vZGUKKyAgICAvLyBHZXQgdGhlIGNvbnRlbnRzIC0gYW55IG1hcmt1cCBleGNlcHQgbGkgYW5kIHVsIGFsbG93ZWQKKyAgICB2YXIgJG5vZGVDb250ZW50ID0gJG5vZGUuY2xvbmUoKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgIC5jaGlsZHJlbigidWwsbGkiKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgIC5yZW1vdmUoKQorICAgICAgICAgICAgICAgICAgICAgICAgLmVuZCgpCisgICAgICAgICAgICAgICAgICAgICAgICAuaHRtbCgpOworICAgICAgICAgICAgICAgICAgICAgICAgC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kKCRkb3duTGluZVJvdyk7CisKKyAgICAgICAgLy8gRHJhdyB0aGUgaG9yaXpvbnRhbCBsaW5lcworICAgICAgICB2YXIgJGxpbmVzUm93ID0gJCgiPHRyLz4iKTsKKyAgICAgICAgJGNoaWxkTm9kZXMuZWFjaChmdW5jdGlvbigpIHsKKyAgICAgICAgICB2YXIgJGxlZnQgPSAkKCI8dGQ+Jm5ic3A7PC90ZD4iKS5hZGRDbGFzcygibGluZSBsZWZ0IHRvcCIpOworICAgICAgICAgIHZhciAkcmlnaHQgPSAkKCI8dGQ+Jm5ic3A7PC90ZD4iKS5hZGRDbGFzcygibGluZSByaWdodCB0b3AiKTsKKyAgICAgICAgICAkbGluZXNSb3cuYXBwZW5kKCRsZWZ0KS5hcHBlbmQoJHJpZ2h0KTsKKyAgICAgICAgfSk7CisKKyAgICAgICAgLy8gaG9yaXpvbnRhbCBsaW5lIHNob3VsZG4ndCBleHRlbmQgYmV5b25kIHRoZSBmaXJzdCBhbmQgbGFzdCBjaGlsZCBicmFuY2hlcworICAgICAgICAkbGluZXNSb3cuZmluZCgidGQ6Zmlyc3QiKQorICAgICAgICAgICAgICAgICAgICAucmVtb3ZlQ2xhc3MoInRvcCIpCisgICAgICAgICAgICAgICAgIC5lbmQoKQorICAgICAgICAgICAgICAgICAuZmluZCgidGQ6bGFzdCIpCisgICAgICAgICAgICAgICAgICAgIC5yZW1vdmVDbGFzcygidG9wIik7CisKKyAgICAgICAgJHRib2R5LmFwcGVuZCgkbGluZXNSb3cpOworICAgICAgICB2YXIgJGNoaWxkTm9kZXNSb3cgPSAkKCI8dHIvPiIpOworICAgICAgICAkY2hpbGROb2Rlcy5lYWNoKGZ1bmN0aW9uKCkgeworICAgICAgICAgICB2YXIgJHRkID0gJCgiPHRkIGNsYXNzPSdub2RlLWNvbnRhaW5lcicvPiIpOworICAgICAgICAgICAkdGQuYXR0cigiY29sc3BhbiIsIDIpOworICAgICAgICAgICAvLyByZWN1cnNlIHRocm91Z2ggY2hpbG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W5DYWxsYmFjaykgc2NyZWVuQ2FsbGJhY2soRGV0ZWN0UlRDLnNjcmVlbi5zb3VyY2VJZCk7CisgICAgICAgIH0KKyAgICB9LAorICAgIGdldENocm9tZUV4dGVuc2lvblN0YXR1czogZnVuY3Rpb24gKGNhbGxiYWNrKSB7CisgICAgICAgIC8vIGh0dHBzOi8vY2hyb21lLmdvb2dsZS5jb20vd2Vic3RvcmUvZGV0YWlsL3NjcmVlbi1jYXB0dXJpbmctcHJpdmF0ZS9pY2dtbG9nZmVhamJmZGZmYWpob2ViY2ZiaWJmaGFlbgorICAgICAgICB2YXIgZXh0ZW5zaW9uaWQgPSAnaWNnbWxvZ2ZlYWpiZmRmZmFqaG9lYmNmYmliZmhhZW4nOworCisgICAgICAgIHZhciBpbWFnZSA9IGRvY3VtZW50LmNyZWF0ZUVsZW1lbnQoJ2ltZycpOworICAgICAgICBpbWFnZS5zcmMgPSAnY2hyb21lLWV4dGVuc2lvbjovLycgKyBleHRlbnNpb25pZCArICcvaWNvbi5wbmcnOworICAgICAgICBpbWFnZS5vbmxvYWQgPSBmdW5jdGlvbiAoKSB7CisgICAgICAgICAgICBEZXRlY3RSVEMuc2NyZWVuLmNocm9tZU1lZGlhU291cmNlID0gJ3NjcmVlbic7CisgICAgICAgICAgICB3aW5kb3cucG9zdE1lc3NhZ2UoJ2FyZS15b3UtdGhlcmUnLCAnKicpOworICAgICAgICAgICAgc2V0VGltZW91dChmdW5jdGlvbiAoKSB7CisgICAgICAgICAgICAgICAgaWYgKERldGVjdFJUQy5zY3JlZW4uY2hyb21lTWVkaWFTb3VyY2UgPT0gJ3NjcmVlbicpIHsKKyAgICAgICAgICAgICAgICAgICAgY2FsbGJhY2soJ2luc3RhbGxlZC1kaXNhYmxlZCcpOworICAgICAgICAgICAgICAgIH0gZWxzZSBjYWxsYmFjaygnaW5zdGFsbGVkLWVuYWJsZWQnKTsKKyAgICAgICAgICAgIH0sIDIwMDApOworICAgICAgICB9OworICAgICAgICBpbWFnZS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KyAgICAgICAgICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgICAgICAgICBpZiAoIWlzTnVsbChhcmdzLnRyYW5zbWl0Um9vbU9uY2UpKSB7CisgICAgICAgICAgICAgICAgICAgICAgICBjb25uZWN0aW9uLnRyYW5zbWl0Um9vbU9uY2UgPSBhcmdzLnRyYW5zbWl0Um9vbU9uY2U7CisgICAgICAgICAgICAgICAgICAgIH0KKworICAgICAgICAgICAgICAgICAgICBpZiAoIWlzTnVsbChhcmdzLmRvbnRUcmFuc21pdCkpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIGRvbnRUcmFuc21pdCA9IGFyZ3MuZG9udFRyYW5zbWl0OworICAgICAgICAgICAgICAgICAgICB9CisKKyAgICAgICAgICAgICAgICAgICAgaWYgKCFpc051bGwoYXJncy5zZXNzaW9uaWQpKSB7CisgICAgICAgICAgICAgICAgICAgICAgICBjb25uZWN0aW9uLnNlc3Npb25pZCA9IGFyZ3Muc2Vzc2lvbmlkOworICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfQorCisgICAgICAgICAgICAvLyBpZiBmaXJlYmFzZSAmJiBpZiBzZXNzaW9uIGluaXRpYXRvcgorICAgICAgICAgICAgaWYgKGNvbm5lY3Rpb24uc29ja2V0ICYmIGNvbm5lY3Rpb24uc29ja2V0LnJlbW92ZSkgeworICAgICAgICAgICAgICAgIGNvbm5lY3Rpb24uc29ja2V0LnJlbW92ZSgpOworICAgICAgICAgICAgfQorCisgICAgICAgICAgICBpZiAoIWNvbm5lY3Rpb24uc2Vzc2lvbmlkKSBjb25uZWN0aW9uLnNlc3Npb25pZCA9IGNvbm5lY3Rpb24uY2hhbm5lbDsKKyAgICAgICAgICAgIGNvbm5lY3Rpb24uc2Vzc2lvbkRlc2NyaXB0aW9uID0geworICAgICAgICAgICAgICAgIHNlc3Npb25pZDogY29ubmVjdGlvbi5zZXNzaW9uaWQsCisgICAgICAgICAgICAgICAgdXNlcm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5vbk1lZGlhQ2FwdHVyZWQgPSBhcmdzLm9uTWVkaWFDYXB0dXJlZDsKKyAgICAgICAgICAgICAgICB9CisKKyAgICAgICAgICAgICAgICAvLyBmb3Igc2Vzc2lvbi1pbml0aWF0b3IsIHVzZXItbWVkaWEgaXMgY2FwdHVyZWQgYXMgc29vbiBhcyAib3BlbiIgaXMgaW52b2tlZC4KKyAgICAgICAgICAgICAgICBpZiAoIXJ0Y011bHRpU2Vzc2lvbi5jYXB0dXJlVXNlck1lZGlhT25EZW1hbmQpIGNhcHR1cmVVc2VyTWVkaWEoZnVuY3Rpb24oKSB7CisgICAgICAgICAgICAgICAgICAgIHJ0Y011bHRpU2Vzc2lvbi5pbml0U2Vzc2lvbih7CisgICAgICAgICAgICAgICAgICAgICAgICBzZXNzaW9uRGVzY3JpcHRpb246IGNvbm5lY3Rpb24uc2Vzc2lvbkRlc2NyaXB0aW9uLAorICAgICAgICAgICAgICAgICAgICAgICAgZG9udFRyYW5zbWl0OiBkb250VHJhbnNtaXQKKyAgICAgICAgICAgICAgICAgICAgfSk7CisKKyAgICAgICAgICAgICAgICAgICAgaW52b2tlTWVkaWFDYXB0dXJlZChjb25uZWN0aW9uKTsKKyAgICAgICAgICAgICAgICB9KTsKKworICAgICAgICAgICAgICAgIGlmIChydGNNdWx0aVNlc3Npb24uY2FwdHVyZVVzZXJNZWRpYU9uRGVtYW5kKSB7CisgICAgICAgICAgICAgICAgICAgIHJ0Y011bHRpU2Vzc2lvbi5pbml0U2Vzc2lvbih7CisgICAgICAgICAgICAgICAgICAgICAgICBzZXNzaW9uRGVzY3JpcHRpb246IGNvbm5lY3Rpb24uc2Vzc2lvbkRlc2NyaXB0aW9uLAorICAgICAgICAgICAgICAgICAgICAgICAgZG9udFRyYW5zbWl0OiBkb250VHJhbnNtaXQKKyAgICAgICAgICAgICAgICAgICAgfSk7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfSk7CisgICAgICAgICAgICByZXR1cm4gY29ubmVjdGlvbi5zZXNzaW9uRGVzY3JpcHRpb247CisgICAgICAgIH07CisKKyAgICAgICAgLy8gd3d3LlJUQ011bHRpQ29ubmVjdGlvbi5vcmcvZG9jcy9jb25uZWN0LworICAgICAgICBjb25uZWN0aW9uLmNvbm5lY3QgPSBmdW5jdGlvbihzZXNzaW9uaWQpIHsKKyAgICAgICAgICAgIC8vIGEgY2hhbm5lbCBjYW4gY29udGFpbiBtdWx0aXBsZSByb29tcyBpLmUuIHNlc3Npb25zCisgICAgICAgICAgICBpZiAoc2Vzc2lvbmlkKSB7CisgICAgICAgICAgICAgICAgY29ubmVjdGlvbi5zZXNzaW9uaWQgPSBzZXNzaW9uaWQ7CisgICAgICAgICAgICB9CisKKyAgICAgICAgICAgIC8vIGNvbm5lY3Qgd2l0aCBzaWduYWxpbmcgY2hhbm5lbAorICAgICAgICAgICAgaW5pdFJUQ011bHRpU2Vzc2lvbihmdW5jdGlvbigpIHsKKyAgICAgICAgICAgICAgICBsb2coJ1NpZ25hbGluZyBjaGFubmVsIGlzIHJlYWR5LicpOworICAgICAgICAgICAgfSk7CisKKyAgICAgICAgICAgIHJldHVybiB0aGlzOworICAgICAgICB9OworCisgICAgICAgIC8vIHd3dy5SVENNdWx0aUNvbm5lY3Rpb24ub3JnL2RvY3Mvam9pbi8KKyAgICAgICAgY29ubmVjdGlvbi5qb2luID0gam9pblNlc3Npb247CisKKyAgICAgICAgLy8gd3d3LlJUQ011bHRpQ29ubmVjdGlvbi5vcmcvZG9jcy9zZW5kLworICAgICAgICBjb25uZWN0aW9uLnNlbmQgPSBmdW5jdGlvbihkYXRhLCBfY2hhbm5lbCkgeworICAgICAgICAgICAgaWYgKGNvbm5lY3Rpb24ubnVtYmVyT2ZDb25uZWN0ZWRVc2VycyA8PSAwKSB7CisgICAgICAgICAgICAgICAgLy8gbm8gY29ubmVjdGlvbnMKKyAgICAgICAgICAgICAgICBzZXRUaW1lb3V0KGZ1bmN0aW9uKCkgeworICAgICAgICAgICAgICAgICAgICAv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wgX2NoYW5uZWwpOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICByZXR1cm47CisgICAgICAgICAgICB9CisKKyAgICAgICAgICAgIC8vIEZpbGUgb3IgQmxvYiBvYmplY3QgTVVTVCBoYXZlICJ0eXBlIiBhbmQgInNpemUiIHByb3BlcnRpZXMKKyAgICAgICAgICAgIGlmICghaXNOdWxsKGRhdGEuc2l6ZSkgJiYgIWlzTnVsbChkYXRhLnR5cGUpKSB7CisgICAgICAgICAgICAgICAgaWYgKCFjb25uZWN0aW9uLmVuYWJsZUZpbGVTaGFyaW5nKSB7CisgICAgICAgICAgICAgICAgICAgIHRocm93ICciZW5hYmxlRmlsZVNoYXJpbmciIGJvb2xlYW4gTVVTVCBiZSAidHJ1ZSIgdG8gc3VwcG9ydCBmaWxlIHNoYXJpbmcuJzsKKyAgICAgICAgICAgICAgICB9CisKKyAgICAgICAgICAgICAgICBpZiAoIXJ0Y011bHRpU2Vzc2lvbi5maWxlQnVmZmVyUmVhZGVyKSB7CisgICAgICAgICAgICAgICAgICAgIGluaXRGaWxlQnVmZmVyUmVhZGVyKGNvbm5lY3Rpb24sIGZ1bmN0aW9uKGZicikgeworICAgICAgICAgICAgICAgICAgICAgICAgcnRjTXVsdGlTZXNzaW9uLmZpbGVCdWZmZXJSZWFkZXIgPSBmYnI7CisgICAgICAgICAgICAgICAgICAgICAgICBjb25uZWN0aW9uLnNlbmQoZGF0YSwgX2NoYW5uZWwpOworICAgICAgICAgICAgICAgICAgICB9KTsKKyAgICAgICAgICAgICAgICAgICAgcmV0dXJuOworICAgICAgICAgICAgICAgIH0KKworICAgICAgICAgICAgICAgIHZhciBleHRyYSA9IG1lcmdlKHsKKyAgICAgICAgICAgICAgICAgICAgdXNlcmlkOiBjb25uZWN0aW9uLnVzZXJpZAorICAgICAgICAgICAgICAgIH0sIGRhdGEuZXh0cmEgfHwgY29ubmVjdGlvbi5leHRyYSk7CisKKyAgICAgICAgICAgICAgICBydGNNdWx0aVNlc3Npb24uZmlsZUJ1ZmZlclJlYWRlci5yZWFkQXNBcnJheUJ1ZmZlcihkYXRhLCBmdW5jdGlvbih1dWlkKSB7CisgICAgICAgICAgICAgICAgICAgIHJ0Y011bHRpU2Vzc2lvbi5maWxlQnVmZmVyUmVhZGVyLmdldE5leHRDaHVuayh1dWlkLCBmdW5jdGlvbihuZXh0Q2h1bmssIGlzTGFzdENodW5rLCBleHRyYSkgeworICAgICAgICAgICAgICAgICAgICAgICAgaWYgKF9jaGFubmVsKSBfY2hhbm5lbC5zZW5kKG5leHRDaHVuayk7CisgICAgICAgICAgICAgICAgICAgICAgICBlbHNlIHJ0Y011bHRpU2Vzc2lvbi5zZW5kKG5leHRDaHVuayk7CisgICAgICAgICAgICAgICAgICAgIH0pOworICAgICAgICAgICAgICAgIH0sIGV4dHJhKTsKKyAgICAgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICAgICAgLy8gdG8gYWxsb3cgbG9uZ2VzdCBzdHJpbmcgbWVzc2FnZXMKKyAgICAgICAgICAgICAgICAvLyBhbmQgbGFyZ2VzdCBkYXRhIG9iamVjdHMKKyAgICAgICAgICAgICAgICAvLyBvciBhbnl0aGluZyBvZiBhbnkgc2l6ZSEKKyAgICAgICAgICAgICAgICAvLyB0byBzZW5kIG11bHRpcGxlIGRhdGEgb2JqZWN0cyBjb25jdXJyZW50bHkhCisKKyAgICAgICAgICAgICAgICBUZXh0U2VuZGVyLnNlbmQoeworICAgICAgICAgICAgICAgICAgICB0ZXh0OiBkYXRhLAorICAgICAgICAgICAgICAgICAgICBjaGFubmVsOiBydGNNdWx0aVNlc3Npb24sCisgICAgICAgICAgICAgICAgICAgIF9jaGFubmVsOiBfY2hhbm5lbCwKKyAgICAgICAgICAgICAgICAgICAgY29ubmVjdGlvbjogY29ubmVjdGlvbgorICAgICAgICAgICAgICAgIH0pOworICAgICAgICAgICAgfQorICAgICAgICB9OworCisgICAgICAgIGZ1bmN0aW9uIGluaXRSVENNdWx0aVNlc3Npb24ob25TaWduYWxpbmdSZWFkeSkgeworICAgICAgICAgICAgaWYgKHNjcmVlbkZyYW1lKSB7CisgICAgICAgICAgICAgICAgbG9hZFNjcmVlbkZyYW1lKCk7CisgICAgICAgICAgICB9CisKKyAgICAgICAgICAgIC8vIFJUQ011bHRpU2Vzc2lvbiBpcyB0aGUgYmFja2JvbmUgb2JqZWN0OworICAgICAgICAgICAgLy8gdGhpcyBvYmplY3QgTVVTVCBiZSBpbml0aWFsaXplZCBvbmNlIQorICAgICAgICAgICAgaWYgKHJ0Y011bHRpU2Vzc2lvbikgcmV0dXJuIG9uU2lnbmFsaW5nUmVhZHkoKTsKKworICAgICAgICAgICAgLy8geW91ciBldmVyeXRoaW5nIGlzIHBhc3NlZCBvdmVyIFJUQ011bHRpU2Vzc2lvbiBjb25zdHJ1Y3RvciEKKyAgICAgICAgICAgIHJ0Y011bHRpU2Vzc2lvbiA9IG5ldyBSVENNdWx0aVNlc3Npb24oY29ubmVjdGlvbiwgb25TaWduYWxpbmdSZWFkeSk7CisgICAgICAgIH0KKworICAgICAgICBjb25uZWN0aW9uLmRpc2Nvbm5lY3QgPSBmdW5jdGlvbigpIHsKKyAgICAgICAgICAgIGlmIChydGNNdWx0aVNlc3Npb24pIHJ0Y011bHRpU2Vzc2lvbi5kaXNjb25uZWN0KCk7CisgICAgICAgICAgICBydGNNdWx0aVNlc3Npb24gPSBudWxsOworICAgICAgICB9OworCisgICAgICAgIGZ1bmN0aW9uIGpvaW5TZXNzaW9uKHNlc3Npb24sIGpvaW5BcykgeworICAgICAgICAgICAgaWYgKGlzU3RyaW5nKHNlc3Npb24pKSB7CisgICAgICAgICAgICAgICAgY29ubmVjdGlvbi5za2lwT25OZXdTZXNzaW9uID0gdHJ1ZTsKKyAgICAgICAgICAgIH0KKworICAgICAgICAgICAgaWYgKCFydGNNdWx0aVNlc3Npb24pIHsKKyAgICAgICAgICAgICAgICBsb2coJ1NpZ25hbGluZyBjaGFubmVsIGlzIG5vdCByZWFkeS4gQ29ubmVjdGluZy4uLicpOworICAgICAgICAgICAgICAgIC8vIGNvbm5lY3Qgd2l0aCBzaWduYWxpbmcgY2hhbm5lbAorICAgICAgICAgICAgICAgIGluaXRSVENNdWx0aVNlc3Npb24oZnVuY3Rpb24oKSB7CisgICAgICAgICAgICAgICAgICAgIGxvZygnU2lnbmFsaW5nIGNoYW5uZWwgaXMgY29ubmVjdGVkLiBKb2luaW5nIHRoZSBzZXNzaW9uIGFnYWluLi4uJyk7CisgICAgICAgICAgICAgICAgICAgIHNldFRpbWVvdXQoZnVuY3Rpb24oKSB7CisgICAgICAgICAgICAgICAgICAgICAgICBqb2luU2Vzc2lvbihzZXNzaW9uLCBqb2luQXMpOworICAgICAgICAgICAgICAgICAgICB9LCAxMDAwKTsKKyAgICAgICAgICAgICAgICB9KTsKKyAgICAgICAgICAgICAgICByZXR1cm47CisgICAgICAgICAgICB9CisKKyAgICAgICAgICAgIC8vIGNvbm5lY3Rpb24uam9pbignc2Vzc2lvbmlkJyk7CisgICAgICAgICAgICBpZiAoaXNTdHJpbmcoc2Vzc2lvbikpIHsKKyAgICAgICAgICAgICAgICBpZiAoY29ubmVjdGlvbi5zZXNzaW9uRGVzY3JpcHRpb25zW3Nlc3Npb25dKSB7CisgICAgICAgICAgICAgICAgICAgIHNlc3Npb24gPSBjb25uZWN0aW9uLnNlc3Npb25EZXNjcmlwdGlvbnNbc2Vzc2lvbl07CisgICAgICAgICAgICAgICAgfSBlbHNlCisgICAgICAgICAgICAgICAgICAgIHJldHVybiBzZXRUaW1lb3V0KGZ1bmN0aW9uKCkgeworICAgICAgICAgICAgICAgICAgICAgICAgbG9nKCdTZXNzaW9uLURlc2NyaXB0aW9ucyBub3QgZm91bmQuIFJlY2hlY2tpbmcuLicpOworICAgICAgICAgICAgICAgICAgICAgICAgam9pblNlc3Npb24oc2Vzc2lvbiwgam9pbkFzKTsKKyAgICAgICAgICAgICAgICAgICAgfSwgMTAwMCk7CisgICAgICAgICAgICB9CisKKyAgICAgICAgICAgIC8vIGNvbm5lY3Rpb24uam9pbignc2Vzc2lvbmlkJywgeyBhdWRpbzogdHJ1ZSB9KTsKKyAgICAgICAgICAgIGlmIChqb2luQXMpIHsKKyAgICAgICAgICAgICAgICByZXR1cm4gY2FwdHVyZVVzZXJNZWRpYShmdW5jdGlvbigpIHsKKyAgICAgICAgICAgICAgICAgICAgc2Vzc2lvbi5vbmV3YXkgPSB0cnVlOworICAgICAgICAgICAgICAgICAgICBqb2luU2Vzc2lvbihzZXNzaW9uKTsKKyAgICAgICAgICAgICAgICB9LCBqb2luQXMpOworICAgICAgICAgICAgfQorCisgICAgICAgICAgICBpZiAoIXNlc3Npb24gfHwgIXNlc3Npb24udXNlcmlkIHx8ICFzZXNzaW9uLnNlc3Npb25pZCkgeworICAgICAgICAgICAgICAgIGVycm9yKCdtaXNzaW5nIGFyZ3VtZW50cycsIGFyZ3VtZW50cyk7CisKKyAgICAgICAgICAgICAgICB2YXIgZXJyb3IgPSAnSW52YWxpZCBkYXRhIHBhc3NlZCBvdmVyICJjb25uZWN0aW9uLmpvaW4iIG1ldGhvZC4nOworICAgICAgICAgICAgICAgIGNvbm5lY3Rpb24ub25zdGF0ZWNoYW5nZSh7CisgICAgICAgICAgICAgICAgICAgIHVzZXJpZDogJ2Jyb3dzZXInLAorICAgICAgICAgICAgICAgICAgICBleHRyYToge30sCisgICAgICAgICAgICAgICAgICAgIG5hbWU6ICdVbmV4cGVjdGVkIGRhdGEgZGV0ZWN0ZWQuJywKKyAgICAgICAgICAgICAgICAgICAgcmVhc29uOiBlcnJvcgorICAgICAgICAgICAgICAgIH0pOworCisgICAgICAgICAgICAgICAgdGhyb3cgZXJyb3I7CisgICAgICAgICAgICB9CisKKyAgICAgICAgICAgIGlmICghY29ubmVjdGlvbi5kb250T3ZlcnJpZGVTZXNzaW9uKSB7CisgICAgICAgICAgICAgICAgY29ubmVjdGlvbi5zZXNzaW9uID0gc2Vzc2lvbi5zZXNzaW9uOworICAgICAgICAgICAgfQor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EgcmVzb3VyY2VzCisgICAgICAgICAgICB2YXIgc2Vzc2lvbiA9IF9zZXNzaW9uIHx8IGNvbm5lY3Rpb24uc2Vzc2lvbjsKKworICAgICAgICAgICAgaWYgKGlzRW1wdHkoc2Vzc2lvbikpIHsKKyAgICAgICAgICAgICAgICBpZiAoY2FsbGJhY2spIGNhbGxiYWNrKCk7CisgICAgICAgICAgICAgICAgcmV0dXJuOworICAgICAgICAgICAgfQorCisgICAgICAgICAgICAvLyB5b3UgY2FuIGZvcmNlIHRvIHNraXAgbWVkaWEgY2FwdHVyaW5nIQorICAgICAgICAgICAgaWYgKGNvbm5lY3Rpb24uZG9udENhcHR1cmVVc2VyTWVkaWEpIHsKKyAgICAgICAgICAgICAgICByZXR1cm4gY2FsbGJhY2soKTsKKyAgICAgICAgICAgIH0KKworICAgICAgICAgICAgLy8gaWYgaXQgaXMgZGF0YS1vbmx5IGNvbm5lY3Rpb24KKyAgICAgICAgICAgIC8vIGlmIGl0IGlzIG9uZS13YXkgY29ubmVjdGlvbiBhbmQgY3VycmVudCB1c2VyIGlzIHBhcnRpY2lwYW50CisgICAgICAgICAgICBpZiAoaXNEYXRhKHNlc3Npb24pIHx8ICghY29ubmVjdGlvbi5pc0luaXRpYXRvciAmJiBzZXNzaW9uLm9uZXdheSkpIHsKKyAgICAgICAgICAgICAgICAvLyB3d3cuUlRDTXVsdGlDb25uZWN0aW9uLm9yZy9kb2NzL2F0dGFjaFN0cmVhbXMvCisgICAgICAgICAgICAgICAgY29ubmVjdGlvbi5hdHRhY2hTdHJlYW1zID0gW107CisgICAgICAgICAgICAgICAgcmV0dXJuIGNhbGxiYWNrKCk7CisgICAgICAgICAgICB9CisKKyAgICAgICAgICAgIHZhciBjb25zdHJhaW50cyA9IHsKKyAgICAgICAgICAgICAgICBhdWRpbzogISFzZXNzaW9uLmF1ZGlvID8geworICAgICAgICAgICAgICAgICAgICBtYW5kYXRvcnk6IHt9LAorICAgICAgICAgICAgICAgICAgICBvcHRpb25hbDogW3sKKyAgICAgICAgICAgICAgICAgICAgICAgIGNocm9tZVJlbmRlclRvQXNzb2NpYXRlZFNpbms6IHRydWUKKyAgICAgICAgICAgICAgICAgICAgfV0KKyAgICAgICAgICAgICAgICB9IDogZmFsc2UsCisgICAgICAgICAgICAgICAgdmlkZW86ICEhc2Vzc2lvbi52aWRlbworICAgICAgICAgICAgfTsKKworICAgICAgICAgICAgLy8gaWYgY3VzdG9tIGF1ZGlvIGRldmljZSBpcyBzZWxlY3RlZAorICAgICAgICAgICAgaWYgKGNvbm5lY3Rpb24uX21lZGlhU291cmNlcy5hdWRpbykgeworICAgICAgICAgICAgICAgIGNvbnN0cmFpbnRzLmF1ZGlvLm9wdGlvbmFsLnB1c2goeworICAgICAgICAgICAgICAgICAgICBzb3VyY2VJZDogY29ubmVjdGlvbi5fbWVkaWFTb3VyY2VzLmF1ZGlvCisgICAgICAgICAgICAgICAgfSk7CisgICAgICAgICAgICB9CisKKyAgICAgICAgICAgIC8vIGlmIGN1c3RvbSB2aWRlbyBkZXZpY2UgaXMgc2VsZWN0ZWQKKyAgICAgICAgICAgIGlmIChjb25uZWN0aW9uLl9tZWRpYVNvdXJjZXMudmlkZW8pIHsKKyAgICAgICAgICAgICAgICBjb25zdHJhaW50cy52aWRlbyA9IHsKKyAgICAgICAgICAgICAgICAgICAgb3B0aW9uYWw6IFt7CisgICAgICAgICAgICAgICAgICAgICAgICBzb3VyY2VJZDogY29ubmVjdGlvbi5fbWVkaWFTb3VyY2VzLnZpZGVvCisgICAgICAgICAgICAgICAgICAgIH1dCisgICAgICAgICAgICAgICAgfTsKKyAgICAgICAgICAgIH0KKworICAgICAgICAgICAgLy8gZm9yIGNvbm5lY3Rpb24uc2Vzc2lvbiA9IHt9OworICAgICAgICAgICAgaWYgKCFzZXNzaW9uLnNjcmVlbiAmJiAhY29uc3RyYWludHMuYXVkaW8gJiYgIWNvbnN0cmFpbnRzLnZpZGVvKSB7CisgICAgICAgICAgICAgICAgcmV0dXJuIGNhbGxiYWNrKCk7CisgICAgICAgICAgICB9CisKKyAgICAgICAgICAgIHZhciBzY3JlZW5fY29uc3RyYWludHMgPSB7CisgICAgICAgICAgICAgICAgYXVkaW86IGZhbHNlLAorICAgICAgICAgICAgICAgIHZpZGVvOiB7CisgICAgICAgICAgICAgICAgICAgIG1hbmRhdG9yeTogeworICAgICAgICAgICAgICAgICAgICAgICAgY2hyb21lTWVkaWFTb3VyY2U6IERldGVjdFJUQy5zY3JlZW4uY2hyb21lTWVkaWFTb3VyY2UsCisgICAgICAgICAgICAgICAgICAgICAgICBtYXhXaWR0aDogc2NyZWVuLndpZHRoID4gMTkyMCA/IHNjcmVlbi53aWR0aCA6IDE5MjAsCisgICAgICAgICAgICAgICAgICAgICAgICBtYXhIZWlnaHQ6IHNjcmVlbi5oZWlnaHQgPiAxMDgwID8gc2NyZWVuLmhlaWdodCA6IDEwODAKKyAgICAgICAgICAgICAgICAgICAgfSwKKyAgICAgICAgICAgICAgICAgICAgb3B0aW9uYWw6IFtdCisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfTsKKworICAgICAgICAgICAgaWYgKGlzRmlyZWZveCAmJiBzZXNzaW9uLnNjcmVlbikgeworICAgICAgICAgICAgICAgIGlmIChsb2NhdGlvbi5wcm90b2NvbCAhPT0gJ2h0dHBzOicpIHsKKyAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGVycm9yKFNDUkVFTl9DT01NT05fRkFJTFVSRSk7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIHdhcm4oRmlyZWZveF9TY3JlZW5fQ2FwdHVyaW5nX1dhcm5pbmcpOworCisgICAgICAgICAgICAgICAgc2NyZWVuX2NvbnN0cmFpbnRzLnZpZGVvID0gbWVyZ2Uoc2NyZWVuX2NvbnN0cmFpbnRzLnZpZGVvLm1hbmRhdG9yeSwgeworICAgICAgICAgICAgICAgICAgICBtb3pNZWRpYVNvdXJjZTogJ3dpbmRvdycsIC8vIG1vek1lZGlhU291cmNlIGlzIHJlZHVuZGFudCBoZXJlCisgICAgICAgICAgICAgICAgICAgIG1lZGlhU291cmNlOiAnd2luZG93JyAvLyAnc2NyZWVuJyB8fCAnd2luZG93JworICAgICAgICAgICAgICAgIH0pOworCisgICAgICAgICAgICAgICAgLy8gRmlyZWZveCBpcyBzdXBwb3J0aW5nIGF1ZGlvK3NjcmVlbiBmcm9tIHNpbmdsZSBnZXRVc2VyTWVkaWEgcmVxdWVzdAorICAgICAgICAgICAgICAgIC8vIGF1ZGlvK3ZpZGVvK3NjcmVlbiB3aWxsIGJlY29tZSBhdWRpbytzY3JlZW4gZm9yIEZpcmVmb3gKKyAgICAgICAgICAgICAgICAvLyBiZWNhdXNlIEZpcmVmb3ggaXNuJ3Qgc3VwcG9ydGluZyBtdWx0aS1zdHJlYW1zIGZlYXR1cmUgdmVyc2lvbiA8IDM4CisgICAgICAgICAgICAgICAgLy8gdmVyc2lvbiA+Mzggc3VwcG9ydHMgbXVsdGktc3RyZWFtIHNoYXJpbmcuCisgICAgICAgICAgICAgICAgLy8gd2UgY2FuIHVzZTogIGZpcmVmb3hWZXJzaW9uIDwgMzgKKyAgICAgICAgICAgICAgICAvLyBob3dldmVyIGNhcHR1cmluZyBhdWRpbyBhbmQgc2NyZWVuIHVzaW5nIHNpbmdsZSBnZXRVc2VyTWVkaWEgaXMgYSBiZXR0ZXIgb3B0aW9uCisgICAgICAgICAgICAgICAgaWYgKGNvbnN0cmFpbnRzLmF1ZGlvIC8qICYmICFzZXNzaW9uLnZpZGVvICovICkgeworICAgICAgICAgICAgICAgICAgICBzY3JlZW5fY29uc3RyYWludHMuYXVkaW8gPSB0cnVlOworICAgICAgICAgICAgICAgICAgICBjb25zdHJhaW50cyA9IHt9OworICAgICAgICAgICAgICAgIH0KKworICAgICAgICAgICAgICAgIGRlbGV0ZSBzY3JlZW5fY29uc3RyYWludHMudmlkZW8uY2hyb21lTWVkaWFTb3VyY2U7CisgICAgICAgICAgICB9CisKKyAgICAgICAgICAgIC8vIGlmIHNjcmVlbiBpcyBwcm9tcHRlZAorICAgICAgICAgICAgaWYgKHNlc3Npb24uc2NyZWVuKSB7CisgICAgICAgICAgICAgICAgaWYgKGlzQ2hyb21lICYmIERldGVjdFJUQy5zY3JlZW4uZXh0ZW5zaW9uaWQgIT0gUmVzZXJ2ZWRFeHRlbnNpb25JRCkgeworICAgICAgICAgICAgICAgICAgICB1c2VDdXN0b21DaHJvbWVFeHRlbnNpb25Gb3JTY3JlZW5DYXB0dXJpbmcgPSB0cnVlOworICAgICAgICAgICAgICAgIH0KKworICAgICAgICAgICAgICAgIGlmIChpc0Nocm9tZSAmJiAhdXNlQ3VzdG9tQ2hyb21lRXh0ZW5zaW9uRm9yU2NyZWVuQ2FwdHVyaW5nICYmICFkb250Q2hlY2tDaHJvbUV4dGVuc2lvbiAmJiAhRGV0ZWN0UlRDLnNjcmVlbi5zb3VyY2VJZCkgeworICAgICAgICAgICAgICAgICAgICBsaXN0ZW5FdmVudEhhbmRsZXIoJ21lc3NhZ2UnLCBvbklGcmFtZUNhbGxiYWNrKTsKKworICAgICAgICAgICAgICAgICAgICBmdW5jdGlvbiBvbklGcmFtZUNhbGxiYWNrKGV2ZW50KSB7CisgICAgICAgICAgICAgICAgICAgICAgICBpZiAoZXZlbnQuZGF0YSAmJiBldmVudC5kYXRhLmNocm9tZU1lZGlhU291cmNlSWQpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyB0aGlzIGV2ZW50IGxpc3RlbmVyIGlzIG5vIG1vcmUgbmVlZGVkCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgd2luZG93LnJlbW92ZUV2ZW50TGlzdGVuZXIoJ21lc3NhZ2UnLCBvbklGcmFtZUNhbGxiYWNrKTsKKworICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhciBzb3VyY2VJZCA9IGV2ZW50LmRhdGEuY2hyb21lTWVkaWFTb3VyY2VJZDsKKworICAgICAgICAgICAgICAgICAgICAgICAgICAgIERldGVjdFJUQy5zY3JlZW4uc291cmNlSWQgPSBzb3VyY2VJZDsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBEZXRlY3RSVEMuc2NyZWVuLmNocm9tZU1lZGlhU291cmNlID0gJ2Rlc2t0b3AnOworCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHNvdXJjZUlkID09ICdQZXJtaXNzaW9uRGVuaWVkRXJyb3InKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhciBtZWRpYVN0cmVhbUVycm9yID0geworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbWVzc2FnZTogbG9jYXRpb24ucHJvdG9jb2wgPT0gJ2h0dHBzOicgPyAnVXNlciBkZW5pZWQgdG8gc2hhcmUgY29udGVudCBvZiBoaXMgc2NyZWVuLicgOiBTQ1JFRU5fQ09NTU9OX0ZBSUxVUkUsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBuYW1lOiAnUGVybWlzc2lvbkRlbmllZEVycm9yJywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbnN0cmFpbnROYW1lOiBzY3JlZW5fY29uc3RyYWludHMsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzZXNzaW9uOiBzZXNzaW9uCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH07CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGN1cnJlbnRVc2VyTWVkaWFSZXF1ZXN0Lm11dGV4ID0gZmFsc2U7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIERldGVjdFJUQy5zY3JlZW4uc291cmNlSWQgPSBudWxsOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gY29ubmVjdGlvbi5vbk1lZGlhRXJyb3IobWVkaWFTdHJlYW1FcnJvcik7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQorCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgY2FwdHVyZVVzZXJNZWRpYShjYWxsYmFjaywgX3Nlc3Npb24pOworICAgICAgICAgICAgICAgICAgICAgICAgfQorCisgICAgICAgICAgICAgICAgICAgICAgICBpZiAoZXZlbnQuZGF0YSAmJiBldmVudC5kYXRhLmNocm9tZUV4dGVuc2lvblN0YXR1cykgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgIHdhcm4oJ1NjcmVlbiBjYXB0dXJpbmcgZXh0ZW5zaW9uIHN0YXR1cyBpczonLCBldmVudC5kYXRhLmNocm9tZUV4dGVuc2lvblN0YXR1cyk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgRGV0ZWN0UlRDLnNjcmVlbi5jaHJvbWVNZWRpYVNvdXJjZSA9ICdzY3JlZW4nOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNhcHR1cmVVc2VyTWVkaWEoY2FsbGJhY2ssIF9zZXNzaW9uLCB0cnVlKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgfQorCisgICAgICAgICAgICAgICAgICAgIGlmICghc2NyZWVuRnJhbWUpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIGxvYWRTY3JlZW5GcmFtZSgpOworICAgICAgICAgICAgICAgICAgICB9CisKKyAgICAgICAgICAgICAgICAgICAgc2NyZWVuRnJhbWUucG9zdE1lc3NhZ2UoKTsKKyAgICAgICAgICAgICAgICAgICAgcmV0dXJuOworICAgICAgICAgICAgICAgIH0KKworICAgICAgICAgICAgICAgIC8vIGNoZWNrIGlmIHNjcmVlbiBjYXB0dXJpbmcgZXh0ZW5zaW9uIGlzIGluc3RhbGxlZC4KKyAgICAgICAgICAgICAgICBpZiAoaXNDaHJvbWUgJiYgdXNlQ3VzdG9tQ2hyb21lRXh0ZW5zaW9uRm9yU2NyZWVuQ2FwdHVyaW5nICYmICFkb250Q2hlY2tDaHJvbUV4dGVuc2lvbiAmJiBEZXRlY3RSVEMuc2NyZWVuLmNocm9tZU1lZGlhU291cmNlID09ICdzY3JlZW4nICYmIERldGVjdFJUQy5zY3JlZW4uZXh0ZW5zaW9uaWQpIHsKKyAgICAgICAgICAgICAgICAgICAgaWYgKERldGVjdFJUQy5zY3JlZW4uZXh0ZW5zaW9uaWQgPT0gUmVzZXJ2ZWRFeHRlbnNpb25JRCAmJiBkb2N1bWVudC5kb21haW4uaW5kZXhPZignd2VicnRjLWV4cGVyaW1lbnQuY29tJykgPT0gLTEpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBjYXB0dXJlVXNlck1lZGlhKGNhbGxiYWNrLCBfc2Vzc2lvbiwgdHJ1ZSk7CisgICAgICAgICAgICAgICAgICAgIH0KKworICAgICAgICAgICAgICAgICAgICBsb2coJ2NoZWNraW5nIGlmIGNocm9tZSBleHRlbnNpb24gaXMgaW5zdGFsbGVkLicpOworICAgICAgICAgICAgICAgICAgICBEZXRlY3RSVEMuc2NyZWVuLmdldENocm9tZUV4dGVuc2lvblN0YXR1cyhmdW5jdGlvbihzdGF0dXMpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIGlmIChzdGF0dXMgPT0gJ2luc3RhbGxlZC1lbmFibGVkJykgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgIERldGVjdFJUQy5zY3JlZW4uY2hyb21lTWVkaWFTb3VyY2UgPSAnZGVza3RvcCc7CisgICAgICAgICAgICAgICAgICAgICAgICB9CisKKyAgICAgICAgICAgICAgICAgICAgICAgIGNhcHR1cmVVc2VyTWVkaWEoY2FsbGJhY2ssIF9zZXNzaW9uLCB0cnVlKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIGxvZygnY2hyb21lIGV4dGVuc2lvbiBpcyBpbnN0YWxsZWQ/JywgRGV0ZWN0UlRDLnNjcmVlbi5jaHJvbWVNZWRpYVNvdXJjZSA9PSAnZGVza3RvcCcpOworICAgICAgICAgICAgICAgICAgICB9KTsKKyAgICAgICAgICAgICAgICAgICAgcmV0dXJuOworICAgICAgICAgICAgICAgIH0KKworICAgICAgICAgICAgICAgIGlmIChpc0Nocm9tZSAmJiB1c2VDdXN0b21DaHJvbWVFeHRlbnNpb25Gb3JTY3JlZW5DYXB0dXJpbmcgJiYgRGV0ZWN0UlRDLnNjcmVlbi5jaHJvbWVNZWRpYVNvdXJjZSA9PSAnZGVza3RvcCcgJiYgIURldGVjdFJUQy5zY3JlZW4uc291cmNlSWQpIHsKKyAgICAgICAgICAgICAgICAgICAgRGV0ZWN0UlRDLnNjcmVlbi5nZXRTb3VyY2VJZChmdW5jdGlvbihzb3VyY2VJZCkgeworICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHNvdXJjZUlkID09ICdQZXJtaXNzaW9uRGVuaWVkRXJyb3InKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFyIG1lZGlhU3RyZWFtRXJyb3IgPSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1lc3NhZ2U6ICdVc2VyIGRlbmllZCB0byBzaGFyZSBjb250ZW50IG9mIGhpcyBzY3JlZW4uJywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbmFtZTogJ1Blcm1pc3Npb25EZW5pZWRFcnJvcicsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbnN0cmFpbnROYW1lOiBzY3JlZW5fY29uc3RyYWludHMsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNlc3Npb246IHNlc3Npb24KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB9OworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGN1cnJlbnRVc2VyTWVkaWFSZXF1ZXN0Lm11dGV4ID0gZmFsc2U7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgRGV0ZWN0UlRDLnNjcmVlbi5jaHJvbWVNZWRpYVNvdXJjZSA9ICdkZXNrdG9wJzsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gY29ubmVjdGlvbi5vbk1lZGlhRXJyb3IobWVkaWFTdHJlYW1FcnJvcik7CisgICAgICAgICAgICAgICAgICAgICAgICB9CisKKyAgICAgICAgICAgICAgICAgICAgICAgIGlmIChzb3VyY2VJZCA9PSAnTm8tUmVzcG9uc2UnKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgZXJyb3IoJ0Nocm9tZSBleHRlbnNpb24gc2VlbXMgbm90IGF2YWlsYWJsZS4gTWFrZSBzdXJlIHRoYXQgbWFuaWZlc3QuanNvbiNMMTYgaGFzIHZhbGlkIGNvbnRlbnQtc2NyaXB0IG1hdGNoZXMgcG9pbnRpbmcgdG8geW91ciBVUkwuJyk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgRGV0ZWN0UlRDLnNjcmVlbi5jaHJvbWVNZWRpYVNvdXJjZSA9ICdzY3JlZW4nOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBjYXB0dXJlVXNlck1lZGlhKGNhbGxiYWNrLCBfc2Vzc2lvbiwgdHJ1ZSk7CisgICAgICAgICAgICAgICAgICAgICAgICB9CisKKyAgICAgICAgICAgICAgICAgICAgICAgIGNhcHR1cmVVc2VyTWVkaWEoY2FsbGJhY2ssIF9zZXNzaW9uLCB0cnVlKTsKKyAgICAgICAgICAgICAgICAgICAgfSk7CisgICAgICAgICAgICAgICAgICAgIHJldHVybjsKKyAgICAgICAgICAgICAgICB9CisKKyAgICAgICAgICAgICAgICBpZiAoaXNDaHJvbWUgJiYgRGV0ZWN0UlRDLnNjcmVlbi5jaHJvbWVNZWRpYVNvdXJjZSA9PSAnZGVza3RvcCcpIHsKKyAgICAgICAgICAgICAgICAgICAgc2NyZWVuX2NvbnN0cmFpbnRzLnZpZGVvLm1hbmRhdG9yeS5jaHJvbWVNZWRpYVNvdXJjZUlkID0gRGV0ZWN0UlRDLnNjcmVlbi5zb3VyY2VJZDsKKyAgICAgICAgICAgICAgICB9CisKKyAgICAgICAgICAgICAgICB2YXIgX2lzRmlyc3RTZXNzaW9uID0gaXNGaXJzdFNlc3Npb247CisKKyAgICAgICAgICAgICAgICBfY2FwdHVyZVVzZXJNZWRpYShzY3JlZW5fY29uc3RyYWludHMsIGNvbnN0cmFpbnRzLmF1ZGlvIHx8IGNvbnN0cmFpbnRzLnZpZGVvID8gZnVuY3Rpb24oKSB7CisKKyAgICAgICAgICAgICAgICAgICAgaWYgKF9pc0ZpcnN0U2Vzc2lvbikgaXNGaXJzdFNlc3Npb24gPSB0cnVlOworCisgICAgICAgICAgICAgICAgICAgIF9jYXB0dXJlVXNlck1lZGlhKGNvbnN0cmFpbnRzLCBjYWxsYmFjayk7CisgICAgICAgICAgICAgICAgfSA6IGNhbGxiYWNrKTsKKyAgICAgICAgICAgIH0gZWxzZSBfY2FwdHVyZVVzZXJNZWRpYShjb25zdHJhaW50cywgY2FsbGJhY2ssIHNlc3Npb24uYXVkaW8gJiYgIXNlc3Npb24udmlkZW8pOworCisgICAgICAgICAgICBmdW5jdGlvbiBfY2FwdHVyZVVzZXJNZWRpYShmb3JjZWRDb25zdHJhaW50cywgZm9yY2VkQ2FsbGJhY2ssIGlzUmVtb3ZlVmlkZW9UcmFja3MsIGRvbnRQcmV2ZW50U1NMQXV0b0FsbG93ZWQpIHsKKyAgICAgICAgICAgICAgICBjb25uZWN0aW9uLm9uc3RhdGVjaGFuZ2UoeworICAgICAgICAgICAgICAgICAgICB1c2VyaWQ6ICdicm93c2VyJywKKyAgICAgICAgICAgICAgICAgICAgZXh0cmE6IHt9LAorICAgICAgICAgICAgICAgICAgICBuYW1lOiAnZmV0Y2hpbmctdXNlcm1lZGlhJywKKyAgICAgICAgICAgICAgICAgICAgcmVhc29uOiAnQWJvdXQgdG8gY2FwdHVyZSB1c2VyLW1lZGlhIHdpdGggY29uc3RyYWludHM6ICcgKyB0b1N0cihmb3JjZWRDb25zdHJhaW50cykKKyAgICAgICAgICAgICAgICB9KTsKKworCisgICAgICAgICAgICAgICAgaWYgKGNvbm5lY3Rpb24ucHJldmVudFNTTEF1dG9BbGxvd2VkICYmICFkb250UHJldmVudFNTTEF1dG9BbGxvd2VkICYmIGlzQ2hyb21lKSB7CisgICAgICAgICAgICAgICAgICAgIC8vIGlmIG5hdmlnYXRvci5jdXN0b21HZXRVc2VyTWVkaWFCYXIuanMgaXMgbWlzc2luZworICAgICAgICAgICAgICAgICAgICBpZiAoIW5hdmlnYXRvci5jdXN0b21HZXRVc2VyTWVkaWFCYXIpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIGxvYWRTY3JpcHQoY29ubmVjdGlvbi5yZXNvdXJjZXMuY3VzdG9tR2V0VXNlck1lZGlhQmFyLCBmdW5jdGlvbigpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBfY2FwdHVyZVVzZXJNZWRpYShmb3JjZWRDb25zdHJhaW50cywgZm9yY2VkQ2FsbGJhY2ssIGlzUmVtb3ZlVmlkZW9UcmFja3MsIGRvbnRQcmV2ZW50U1NMQXV0b0FsbG93ZWQpOworICAgICAgICAgICAgICAgICAgICAgICAgfSk7CisgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm47CisgICAgICAgICAgICAgICAgICAgIH0KKworICAgICAgICAgICAgICAgICAgICBuYXZpZ2F0b3IuY3VzdG9tR2V0VXNlck1lZGlhQmFyKGZvcmNlZENvbnN0cmFpbnRzLCBmdW5jdGlvbigpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIF9jYXB0dXJlVXNlck1lZGlhKGZvcmNlZENvbnN0cmFpbnRzLCBmb3JjZWRDYWxsYmFjaywgaXNSZW1vdmVWaWRlb1RyYWNrcywgdHJ1ZSk7CisgICAgICAgICAgICAgICAgICAgIH0sIGZ1bmN0aW9uKCkgeworICAgICAgICAgICAgICAgICAgICAgICAgY29ubmVjdGlvbi5vbk1lZGlhRXJyb3IoeworICAgICAgICAgICAgICAgICAgICAgICAgICAgIG5hbWU6ICdQZXJtaXNzaW9uRGVuaWVkRXJyb3InLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1lc3NhZ2U6ICdVc2VyIGRlbmllZCBwZXJtaXNzaW9uLicsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgY29uc3RyYWludE5hbWU6IGZvcmNlZENvbnN0cmFpbnRzLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNlc3Npb246IHNlc3Npb24KKyAgICAgICAgICAgICAgICAgICAgICAgIH0pOworICAgICAgICAgICAgICAgICAgICB9KTsKKyAgICAgICAgICAgICAgICAgICAgcmV0dXJuOworICAgICAgICAgICAgICAgIH0KKworICAgICAgICAgICAgICAgIHZhciBtZWRpYUNvbmZpZyA9IHsKKyAgICAgICAgICAgICAgICAgICAgb25zdWNjZXNzOiBmdW5jdGlvbihzdHJlYW0sIHJldHVybkJhY2ssIGlkSW5zdGFuY2UsIHN0cmVhbWlkKSB7CisgICAgICAgICAgICAgICAgICAgICAgICBvblN0cmVhbVN1Y2Nlc3NDYWxsYmFjayhzdHJlYW0sIHJldHVybkJhY2ssIGlkSW5zdGFuY2UsIHN0cmVhbWlkLCBmb3JjZWRDb25zdHJhaW50cywgZm9yY2VkQ2FsbGJhY2ssIGlzUmVtb3ZlVmlkZW9UcmFja3MsIHNjcmVlbl9jb25zdHJhaW50cywgY29uc3RyYWludHMsIHNlc3Npb24pOworICAgICAgICAgICAgICAgICAgICB9LAorICAgICAgICAgICAgICAgICAgICBvbmVycm9yOiBmdW5jdGlvbihlLCBjb25zdHJhaW50VXNlZCkgeworICAgICAgICAgICAgICAgICAgICAgICAgLy8gaHR0cDovL2dvby5nbC9ocndGMWEKKyAgICAgICAgICAgICAgICAgICAgICAgIGlmIChpc0ZpcmVmb3gpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoZSA9PSAnUEVSTUlTU0lPTl9ERU5JRUQnKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGUgPSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBtZXNzYWdlOiAnJywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG5hbWU6ICdQZXJtaXNzaW9uRGVuaWVkRXJyb3InLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY29uc3RyYWludE5hbWU6IGNvbnN0cmFpbnRVc2VkLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2Vzc2lvbjogc2Vzc2lvbgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9OworICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgIH0KKworICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGlzRmlyZWZveCAmJiBjb25zdHJhaW50VXNlZC52aWRlbyAmJiBjb25zdHJhaW50VXNlZC52aWRlby5tb3pNZWRpYVNvdXJjZSkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1lZGlhU3RyZWFtRXJyb3IgPSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1lc3NhZ2U6IEZpcmVmb3hfU2NyZWVuX0NhcHR1cmluZ19XYXJuaW5nLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBuYW1lOiBlLm5hbWUgfHwgJ1Blcm1pc3Npb25EZW5pZWRFcnJvcicsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbnN0cmFpbnROYW1lOiBjb25zdHJhaW50VXNlZCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2Vzc2lvbjogc2Vzc2lvbgorICAgICAgICAgICAgICAgICAgICAgICAgICAgIH07CisKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb25uZWN0aW9uLm9uTWVkaWFFcnJvcihtZWRpYVN0cmVhbUVycm9yKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm47CisgICAgICAgICAgICAgICAgICAgICAgICB9CisKKyAgICAgICAgICAgICAgICAgICAgICAgIGlmIChpc1N0cmluZyhlKSkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBjb25uZWN0aW9uLm9uTWVkaWFFcnJvcih7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1lc3NhZ2U6ICdVbmtub3duIEVycm9yJywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbmFtZTogZSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY29uc3RyYWludE5hbWU6IGNvbnN0cmFpbnRVc2VkLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzZXNzaW9uOiBzZXNzaW9uCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSk7CisgICAgICAgICAgICAgICAgICAgICAgICB9CisKKyAgICAgICAgICAgICAgICAgICAgICAgIC8vIGl0IHNlZW1zIHRoYXQgY2hyb21lIDM1KyB0aHJvd3MgIkRldmljZXNOb3RGb3VuZEVycm9yIiBleGNlcHRpb24gCisgICAgICAgICAgICAgICAgICAgICAgICAvLyB3aGVuIGFueSBvZiB0aGUgcmVxdWVzdGVkIG1lZGlhIGlzIGVpdGhlciBkZW5pZWQgb3IgYWJzZW50CisgICAgICAgICAgICAgICAgICAgICAgICBpZiAoZS5uYW1lICYmIChlLm5hbWUgPT0gJ1Blcm1pc3Npb25EZW5pZWRFcnJvcicgfHwgZS5uYW1lID09ICdEZXZpY2VzTm90Rm91bmRFcnJvcicpKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFyIG1lZGlhU3RyZWFtRXJyb3IgPSAnRWl0aGVyOiAnOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1lZGlhU3RyZWFtRXJyb3IgKz0gJ1xuIE1lZGlhIHJlc29sdXRpb25zIGFyZSBub3QgcGVybWl0dGVkLic7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgbWVkaWFTdHJlYW1FcnJvciArPSAnXG4gQW5vdGhlciBhcHBsaWNhdGlvbiBpcyB1c2luZyBzYW1lIG1lZGlhIGRldmljZS4nOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1lZGlhU3RyZWFtRXJyb3IgKz0gJ1xuIE1lZGlhIGRldmljZSBpcyBub3QgYXR0YWNoZWQgb3IgZHJpdmVycyBub3QgaW5zdGFsbGVkLic7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgbWVkaWFTdHJlYW1FcnJvciArPSAnXG4gWW91IGRlbmllZCBhY2Nlc3Mgb25jZSBhbmQgaXQgaXMgc3RpbGwgZGVuaWVkLic7CisKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoZS5tZXNzYWdlICYmIGUubWVzc2FnZS5sZW5ndGgpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbWVkaWFTdHJlYW1FcnJvciArPSAnXG4gJyArIGUubWVzc2FnZTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CisKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBtZWRpYVN0cmVhbUVycm9yID0geworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBtZXNzYWdlOiBtZWRpYVN0cmVhbUVycm9yLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBuYW1lOiBlLm5hbWUsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbnN0cmFpbnROYW1lOiBjb25zdHJhaW50VXNlZCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2Vzc2lvbjogc2Vzc2lvbgorICAgICAgICAgICAgICAgICAgICAgICAgICAgIH07CisKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb25uZWN0aW9uLm9uTWVkaWFFcnJvcihtZWRpYVN0cmVhbUVycm9yKTsKKworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChpc0Nocm9tZSAmJiAoc2Vzc2lvbi5hdWRpbyB8fCBzZXNzaW9uLnZpZGVvKSkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyB0b2RvOiB0aGlzIHNuaXBwZXQgZmFpbHMgaWYgdXNlciBoYXMgdHdvIG9yIG1vcmUgCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vIG1pY3JvcGhvbmUvd2ViY2FtIGF0dGFjaGVkLgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBEZXRlY3RSVEMubG9hZChmdW5jdGlvbigpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vIGl0IGlzIHBvc3NpYmxlIHRvIGNoZWNrIHByZXNlbmNlIG9mIHRoZSBtaWNyb3Bob25lIGJlZm9yZSB1c2luZyBpdCEKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChzZXNzaW9uLmF1ZGlvICYmICFEZXRlY3RSVEMuaGFzTWljcm9waG9uZSkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHdhcm4oJ0l0IHNlZW1zIHRoYXQgeW91IGhhdmUgbm8gbWljcm9waG9uZSBhdHRhY2hlZCB0byB5b3VyIGRldmljZS9zeXN0ZW0uJyk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2Vzc2lvbi5hdWRpbyA9IHNlc3Npb24uYXVkaW8gPSBmYWxzZTsKKworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICghc2Vzc2lvbi52aWRlbykgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBhbGVydCgnSXQgc2VlbXMgdGhhdCB5b3UgYXJlIGNhcHR1cmluZyBtaWNyb3Bob25lIGFuZCB0aGVyZSBpcyBubyBkZXZpY2UgYXZhaWxhYmxlIG9yIGFjY2VzcyBpcyBkZW5pZWQuIFJlbG9hZGluZy4uLicpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBsb2NhdGlvbi5yZWxvYWQoKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CisKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vIGl0IGlzIHBvc3NpYmxlIHRvIGNoZWNrIHByZXNlbmNlIG9mIHRoZSB3ZWJjYW0gYmVmb3JlIHVzaW5nIGl0IQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHNlc3Npb24udmlkZW8gJiYgIURldGVjdFJUQy5oYXNXZWJjYW0pIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB3YXJuKCdJdCBzZWVtcyB0aGF0IHlvdSBoYXZlIG5vIHdlYmNhbSBhdHRhY2hlZCB0byB5b3VyIGRldmljZS9zeXN0ZW0uJyk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2Vzc2lvbi52aWRlbyA9IHNlc3Npb24udmlkZW8gPSBmYWxzZTsKKworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICghc2Vzc2lvbi5hdWRpbykgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBhbGVydCgnSXQgc2VlbXMgdGhhdCB5b3UgYXJlIGNhcHR1cmluZyB3ZWJjYW0gYW5kIHRoZXJlIGlzIG5vIGRldmljZSBhdmFpbGFibGUgb3IgYWNjZXNzIGlzIGRlbmllZC4gUmVsb2FkaW5nLi4uJyk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxvY2F0aW9uLnJlbG9hZCgpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KKworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKCFEZXRlY3RSVEMuaGFzTWljcm9waG9uZSAmJiAhRGV0ZWN0UlRDLmhhc1dlYmNhbSkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGFsZXJ0KCdJdCBzZWVtcyB0aGF0IGVpdGhlciBib3RoIG1pY3JvcGhvbmUvd2ViY2FtIGFyZSBub3QgYXZhaWxhYmxlIG9yIGFjY2VzcyBpcyBkZW5pZWQuIFJlbG9hZGluZy4uLicpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxvY2F0aW9uLnJlbG9hZCgpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIGlmICghY29ubmVjdGlvbi5nZXRVc2VyTWVkaWFQcm9tcHRlZE9uY2UpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyBtYWtlIG1heGltdW0gdHdvIHRyaWVzIQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbm5lY3Rpb24uZ2V0VXNlck1lZGlhUHJvbXB0ZWRPbmNlID0gdHJ1ZTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjYXB0dXJlVXNlck1lZGlhKGNhbGxiYWNrLCBzZXNzaW9uKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgfQorCisgICAgICAgICAgICAgICAgICAgICAgICBpZiAoZS5uYW1lICYmIGUubmFtZSA9PSAnQ29uc3RyYWludE5vdFNhdGlzZmllZEVycm9yJykgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhciBtZWRpYVN0cmVhbUVycm9yID0gJ0VpdGhlcjogJzsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBtZWRpYVN0cmVhbUVycm9yICs9ICdcbiBZb3UgYXJlIHByb21wdGluZyB1bmtub3duIG1lZGlhIHJlc29sdXRpb25zLic7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgbWVkaWFTdHJlYW1FcnJvciArPSAnXG4gWW91IGFyZSB1c2luZyBpbnZhbGlkIG1lZGlhIGNvbnN0cmFpbnRzLic7CisKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoZS5tZXNzYWdlICYmIGUubWVzc2FnZS5sZW5ndGgpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbWVkaWFTdHJlYW1FcnJvciArPSAnXG4gJyArIGUubWVzc2FnZTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CisKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBtZWRpYVN0cmVhbUVycm9yID0geworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBtZXNzYWdlOiBtZWRpYVN0cmVhbUVycm9yLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBuYW1lOiBlLm5hbWUsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbnN0cmFpbnROYW1lOiBjb25zdHJhaW50VXNlZCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2Vzc2lvbjogc2Vzc2lvbgorICAgICAgICAgICAgICAgICAgICAgICAgICAgIH07CisKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb25uZWN0aW9uLm9uTWVkaWFFcnJvcihtZWRpYVN0cmVhbUVycm9yKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIH0KKworICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHNlc3Npb24uc2NyZWVuKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGlzRmlyZWZveCkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBlcnJvcihGaXJlZm94X1NjcmVlbl9DYXB0dXJpbmdfV2FybmluZyk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIGlmIChsb2NhdGlvbi5wcm90b2NvbCAhPT0gJ2h0dHBzOicpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKCFpc05vZGVXZWJraXQgJiYgKGxvY2F0aW9uLnByb3RvY29sID09ICdmaWxlOicgfHwgbG9jYXRpb24ucHJvdG9jb2wgPT0gJ2h0dHA6JykpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGVycm9yKCdZb3UgY2Fubm90IHVzZSBIVFRQIG9yIGZpbGUgcHJvdG9jb2wgZm9yIHNjcmVlbiBjYXB0dXJpbmcuIFlvdSBtdXN0IGVpdGhlciB1c2UgSFRUUHMgb3IgY2hyb21lIGV4dGVuc2lvbiBwYWdlIG9yIE5vZGUtV2Via2l0IHBhZ2UuJyk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBlcnJvcignVW5hYmxlIHRvIGRldGVjdCBhY3R1YWwgaXNzdWUuIE1heWJlICJkZXByZWNhdGVkIiBzY3JlZW4gY2FwdHVyaW5nIGZsYWcgd2FzIG5vdCBzZXQgdXNpbmcgY29tbWFuZCBsaW5lIG9yIG1heWJlIHlvdSBjbGlja2VkICJObyIgYnV0dG9uIG9yIG1heWJlIGNocm9tZSBleHRlbnNpb24gcmV0dXJuZWQgaW52YWxpZCAic291cmNlSWQiLiBQbGVhc2UgaW5zdGFsbCBjaHJvbWUtZXh0ZW5zaW9uOiBodHRwOi8vYml0Lmx5L3dlYnJ0Yy1zY3JlZW4tZXh0ZW5zaW9uJyk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgfQorCisgICAgICAgICAgICAgICAgICAgICAgICBjdXJyZW50VXNlck1lZGlhUmVxdWVzdC5tdXRleCA9IGZhbHNlOworCisgICAgICAgICAgICAgICAgICAgICAgICAvLyB0byBtYWtlIHN1cmUgc2FtZSBzdHJlYW0gY2FuIGJlIGNhcHR1cmVkIGFnYWluIQorICAgICAgICAgICAgICAgICAgICAgICAgdmFyIGlkSW5zdGFuY2UgPSBKU09OLnN0cmluZ2lmeShjb25zdHJhaW50VXNlZCk7CisgICAgICAgICAgICAgICAgICAgICAgICBpZiAoY3VycmVudFVzZXJNZWRpYVJlcXVlc3Quc3RyZWFtc1tpZEluc3RhbmNlXSkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRlbGV0ZSBjdXJyZW50VXNlck1lZGlhUmVxdWVzdC5zdHJlYW1zW2lkSW5zdGFuY2VdOworICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICB9LAorICAgICAgICAgICAgICAgICAgICBtZWRpYUNvbnN0cmFpbnRzOiBjb25uZWN0aW9uLm1lZGlhQ29uc3RyYWludHMgfHwge30KKyAgICAgICAgICAgICAgICB9OworCisgICAgICAgICAgICAgICAgbWVkaWFDb25maWcuY29uc3RyYWludHMgPSBmb3JjZWRDb25zdHJhaW50cyB8fCBjb25zdHJhaW50czsKKyAgICAgICAgICAgICAgICBtZWRpYUNvbmZpZy5jb25uZWN0aW9uID0gY29ubmVjdGlvbjsKKyAgICAgICAgICAgICAgICBnZXRVc2VyTWVkaWEobWVkaWFDb25maWcpOworICAgICAgICAgICAgfQorICAgICAgICB9CisKKyAgICAgICAgZnVuY3Rpb24gb25TdHJlYW1TdWNjZXNzQ2FsbGJhY2soc3RyZWFtLCByZXR1cm5CYWNrLCBpZEluc3RhbmNlLCBzdHJlYW1pZCwgZm9yY2VkQ29uc3RyYWludHMsIGZvcmNlZENhbGxiYWNrLCBpc1JlbW92ZVZpZGVvVHJhY2tzLCBzY3JlZW5fY29uc3RyYWludHMsIGNvbnN0cmFpbnRzLCBzZXNzaW9uKSB7CisgICAgICAgICAgICBpZiAoIXN0cmVhbWlkKSBzdHJlYW1pZCA9IGdldFJhbmRvbVN0cmluZygpOworCisgICAgICAgICAgICBjb25uZWN0aW9uLm9uc3RhdGVjaGFuZ2UoeworICAgICAgICAgICAgICAgIHVzZXJpZDogJ2Jyb3dzZXInLAorICAgICAgICAgICAgICAgIGV4dHJhOiB7fSwKKyAgICAgICAgICAgICAgICBuYW1lOiAndXNlcm1lZGlhLWZldGNoZWQnLAorICAgICAgICAgICAgICAgIHJlYXNvbjogJ0NhcHR1cmVkIHVzZXIgbWVkaWEgdXNpbmcgY29uc3RyYWludHM6ICcgKyB0b1N0cihmb3JjZWRDb25zdHJhaW50cykKKyAgICAgICAgICAgIH0pOworCisgICAgICAgICAgICBpZiAoaXNSZW1vdmVWaWRlb1RyYWNrcykgeworICAgICAgICAgICAgICAgIHN0cmVhbSA9IGNvbnZlcnRUb0F1ZGlvU3RyZWFtKHN0cmVhbSk7CisgICAgICAgICAgICB9CisKKyAgICAgICAgICAgIGNvbm5lY3Rpb24ubG9jYWxTdHJlYW1pZHMucHVzaChzdHJlYW1pZCk7CisgICAgICAgICAgICBzdHJlYW0ub25lbmRlZCA9IGZ1bmN0aW9uKCkgeworICAgICAgICAgICAgICAgIGlmIChzdHJlYW1lZE9iamVjdC5tZWRpYUVsZW1lbnQgJiYgIXN0cmVhbWVkT2JqZWN0Lm1lZGlhRWxlbWVudC5wYXJlbnROb2RlICYmIGRvY3VtZW50LmdldEVsZW1lbnRCeUlkKHN0cmVhbS5zdHJlYW1pZCkpIHsKKyAgICAgICAgICAgICAgICAgICAgc3RyZWFtZWRPYmplY3QubWVkaWFFbGVtZW50ID0gZG9jdW1lbnQuZ2V0RWxlbWVudEJ5SWQoc3RyZWFtLnN0cmVhbWlkKTsKKyAgICAgICAgICAgICAgICB9CisKKyAgICAgICAgICAgICAgICAvLyB3aGVuIGEgc3RyZWFtIGlzIHN0b3BwZWQ7IGl0IG11c3QgYmUgcmVtb3ZlZCBmcm9tICJhdHRhY2hTdHJlYW1zIiBhcnJheQorICAgICAgICAgICAgICAgIGNvbm5lY3Rpb24uYXR0YWNoU3RyZWFtcy5mb3JFYWNoKGZ1bmN0aW9uKF9zdHJlYW0sIGluZGV4KSB7CisgICAgICAgICAgICAgICAgICAgIGlmIChfc3RyZWFtID09IHN0cmVhbSkgeworICAgICAgICAgICAgICAgICAgICAgICAgZGVsZXRlIGNvbm5lY3Rpb24uYXR0YWNoU3RyZWFtc1tpbmRleF07CisgICAgICAgICAgICAgICAgICAgICAgICBjb25uZWN0aW9uLmF0dGFjaFN0cmVhbXMgPSBzd2FwKGNvbm5lY3Rpb24uYXR0YWNoU3RyZWFtcyk7CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICB9KTsKKworICAgICAgICAgICAgICAgIG9uU3RyZWFtRW5kZWRIYW5kbGVyKHN0cmVhbWVkT2JqZWN0LCBjb25uZWN0aW9uKTsKKworICAgICAgICAgICAgICAgIGlmIChjb25uZWN0aW9uLnN0cmVhbXNbc3RyZWFtaWRdKSB7CisgICAgICAgICAgICAgICAgICAgIGNvbm5lY3Rpb24ucmVtb3ZlU3RyZWFtKHN0cmVhbWlkKTsKKyAgICAgICAgICAgICAgICB9CisKKyAgICAgICAgICAgICAgICAvLyBpZiB1c2VyIGNsaWNrcyAic3RvcCIgYnV0dG9uIHRvIGNsb3NlIHNjcmVlbiBzaGFyaW5nCisgICAgICAgICAgICAgICAgdmFyIF9zdHJlYW0gPSBjb25uZWN0aW9uLnN0cmVhbXNbc3RyZWFtaWRdOworICAgICAgICAgICAgICAgIGlmIChfc3RyZWFtICYmIF9zdHJlYW0uc29ja2V0cy5sZW5ndGgpIHsKKyAgICAgICAgICAgICAgICAgICAgX3N0cmVhbS5zb2NrZXRzLmZvckVhY2goZnVuY3Rpb24oc29ja2V0KSB7CisgICAgICAgICAgICAgICAgICAgICAgICBzb2NrZXQuc2VuZCh7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgc3RyZWFtaWQ6IF9zdHJlYW0uc3RyZWFtaWQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgc3RvcHBlZDogdHJ1ZQorICAgICAgICAgICAgICAgICAgICAgICAgfSk7CisgICAgICAgICAgICAgICAgICAgIH0pOworICAgICAgICAgICAgICAgIH0KKworICAgICAgICAgICAgICAgIGN1cnJlbnRVc2VyTWVkaWFSZXF1ZXN0Lm11dGV4ID0gZmFsc2U7CisgICAgICAgICAgICAgICAgLy8gdG8gbWFrZSBzdXJlIHNhbWUgc3RyZWFtIGNhbiBiZSBjYXB0dXJlZCBhZ2FpbiEKKyAgICAgICAgICAgICAgICBpZiAoY3VycmVudFVzZXJNZWRpYVJlcXVlc3Quc3RyZWFtc1tpZEluc3RhbmNlXSkgeworICAgICAgICAgICAgICAgICAgICBkZWxldGUgY3VycmVudFVzZXJNZWRpYVJlcXVlc3Quc3RyZWFtc1tpZEluc3RhbmNlXTsKKyAgICAgICAgICAgICAgICB9CisKKyAgICAgICAgICAgICAgICAvLyB0byBhbGxvdyByZS1jYXB0dXJpbmcgb2YgdGhlIHNjcmVlbgorICAgICAgICAgICAgICAgIERldGVjdFJUQy5zY3JlZW4uc291cmNlSWQgPSBudWxsOworICAgICAgICAgICAgfTsKKworICAgICAgICAgICAgaWYgKCFpc0lFKSB7CisgICAgICAgICAgICAgICAgc3RyZWFtLnN0cmVhbWlkID0gc3RyZWFtaWQ7CisgICAgICAgICAgICAgICAgc3RyZWFtLmlzU2NyZWVuID0gZm9yY2VkQ29uc3RyYWludHMgPT0gc2NyZWVuX2NvbnN0cmFpbnRzOworICAgICAgICAgICAgICAgIHN0cmVhbS5pc1ZpZGVvID0gZm9yY2VkQ29uc3RyYWludHMgPT0gY29uc3RyYWludHMgJiYgISFjb25zdHJhaW50cy52aWRlbzsKKyAgICAgICAgICAgICAgICBzdHJlYW0uaXNBdWRpbyA9IGZvcmNlZENvbnN0cmFpbnRzID09IGNvbnN0cmFpbnRzICYmICEhY29uc3RyYWludHMuYXVkaW8gJiYgIWNvbnN0cmFpbnRzLnZpZGVvOworCisgICAgICAgICAgICAgICAgLy8gaWYgbXV0ZWQgc3RyZWFtIGlzIG5lZ290aWF0ZWQKKyAgICAgICAgICAgICAgICBzdHJlYW0ucHJlTXV0ZWQgPSB7CisgICAgICAgICAgICAgICAgICAgIGF1ZGlvOiBzdHJlYW0uZ2V0QXVkaW9UcmFja3MoKS5sZW5ndGggJiYgIXN0cmVhbS5nZXRBdWRpb1RyYWNrcygpWzBdLmVuYWJsZWQsCisgICAgICAgICAgICAgICAgICAgIHZpZGVvOiBzdHJlYW0uZ2V0VmlkZW9UcmFja3MoKS5sZW5ndGggJiYgIXN0cmVhbS5nZXRWaWRlb1RyYWNrcygpWzBdLmVuYWJsZWQKKyAgICAgICAgICAgICAgICB9OworICAgICAgICAgICAgfQorCisgICAgICAgICAgICB2YXIgbWVkaWFFbGVtZW50ID0gY3JlYXRlTWVkaWFFbGVtZW50KHN0cmVhbSwgc2Vzc2lvbik7CisgICAgICAgICAgICBtZWRpYUVsZW1lbnQubXV0ZWQgPSB0cnVlOworCisgICAgICAgICAgICB2YXIgc3RyZWFtZWRPYmplY3QgPSB7CisgICAgICAgICAgICAgICAgc3RyZWFtOiBzdHJlYW0sCisgICAgICAgICAgICAgICAgc3RyZWFtaWQ6IHN0cmVhbWlkLAorICAgICAgICAgICAgICAgIG1lZGlhRWxlbWVudDogbWVkaWFFbGVtZW50LAorICAgICAgICAgICAgICAgIGJsb2JVUkw6IG1lZGlhRWxlbWVudC5tb3pTcmNPYmplY3QgPyBVUkwuY3JlYXRlT2JqZWN0VVJMKHN0cmVhbSkgOiBtZWRpYUVsZW1lbnQuc3JjLAorICAgICAgICAgICAgICAgIHR5cGU6ICdsb2NhbCcsCisgICAgICAgICAgICAgICAgdXNlcmlkOiBjb25uZWN0aW9uLnVzZXJpZCwKKyAgICAgICAgICAgICAgICBleHRyYTogY29ubmVjdGlvbi5leHRyYSwKKyAgICAgICAgICAgICAgICBzZXNzaW9uOiBzZXNzaW9uLAorICAgICAgICAgICAgICAgIGlzVmlkZW86ICEhc3RyZWFtLmlzVmlkZW8sCisgICAgICAgICAgICAgICAgaXNBdWRpbzogISFzdHJlYW0uaXNBdWRpbywKKyAgICAgICAgICAgICAgICBpc1NjcmVlbjogISFzdHJlYW0uaXNTY3JlZW4sCisgICAgICAgICAgICAgICAgaXNJbml0aWF0b3I6ICEhY29ubmVjdGlvbi5pc0luaXRpYXRvciwKKyAgICAgICAgICAgICAgICBydGNNdWx0aUNvbm5lY3Rpb246IGNvbm5lY3Rpb24KKyAgICAgICAgICAgIH07CisKKyAgICAgICAgICAgIGlmIChpc0ZpcnN0U2Vzc2lvbikgeworICAgICAgICAgICAgICAgIGNvbm5lY3Rpb24uYXR0YWNoU3RyZWFtcy5wdXNoKHN0cmVhbSk7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBpc0ZpcnN0U2Vzc2lvbiA9IGZhbHNlOworCisgICAgICAgICAgICBjb25uZWN0aW9uLnN0cmVhbXNbc3RyZWFtaWRdID0gY29ubmVjdGlvbi5fZ2V0U3RyZWFtKHN0cmVhbWVkT2JqZWN0KTsKKworICAgICAgICAgICAgaWYgKCFyZXR1cm5CYWNrKSB7CisgICAgICAgICAgICAgICAgY29ubmVjdGlvbi5vbnN0cmVhbShzdHJlYW1lZE9iamVjdCk7CisgICAgICAgICAgICB9CisKKyAgICAgICAgICAgIGlmIChjb25uZWN0aW9uLnNldERlZmF1bHRFdmVudHNGb3JNZWRpYUVsZW1lbnQpIHsKKyAgICAgICAgICAgICAgICBjb25uZWN0aW9uLnNldERlZmF1bHRFdmVudHNGb3JNZWRpYUVsZW1lbnQobWVkaWFFbGVtZW50LCBzdHJlYW1pZCk7CisgICAgICAgICAgICB9CisKKyAgICAgICAgICAgIGlmIChmb3JjZWRDYWxsYmFjaykgZm9yY2VkQ2FsbGJhY2soc3RyZWFtLCBzdHJlYW1lZE9iamVjdCk7CisKKyAgICAgICAgICAgIGlmIChjb25uZWN0aW9uLm9uc3BlYWtpbmcpIHsKKyAgICAgICAgICAgICAgICBpbml0SGFyayh7CisgICAgICAgICAgICAgICAgICAgIHN0cmVhbTogc3RyZWFtLAorICAgICAgICAgICAgICAgICAgICBzdHJlYW1lZE9iamVjdDogc3RyZWFtZWRPYmplY3QsCisgICAgICAgICAgICAgICAgICAgIGNvbm5lY3Rpb246IGNvbm5lY3Rpb24KKyAgICAgICAgICAgICAgICB9KTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorCisgICAgICAgIC8vIHd3dy5SVENNdWx0aUNvbm5lY3Rpb24ub3JnL2RvY3MvY2FwdHVyZVVzZXJNZWRpYS8KKyAgICAgICAgY29ubmVjdGlvbi5jYXB0dXJlVXNlck1lZGlhID0gY2FwdHVyZVVzZXJNZWRpYTsKKworICAgICAgICAvLyB3d3cuUlRDTXVsdGlDb25uZWN0aW9uLm9yZy9kb2NzL2xlYXZlLworICAgICAgICBjb25uZWN0aW9uLmxlYXZlID0gZnVuY3Rpb24odXNlcmlkKSB7CisgICAgICAgICAgICBpZiAoIXJ0Y011bHRpU2Vzc2lvbikgcmV0dXJuOworCisgICAgICAgICAgICBpc0ZpcnN0U2Vzc2lvbiA9IHRydWU7CisKKyAgICAgICAgICAgIGlmICh1c2VyaWQpIHsKKyAgICAgICAgICAgICAgICBjb25uZWN0aW9uLmVqZWN0KHVzZXJpZCk7CisgICAgICAgICAgICAgICAgcmV0dXJuOworICAgICAgICAgICAgfQorCisgICAgICAgICAgICBydGNNdWx0aVNlc3Npb24ubGVhdmUoKTsKKyAgICAgICAgfTsKKworICAgICAgICAvLyB3d3cuUlRDTXVsdGlDb25uZWN0aW9uLm9yZy9kb2NzL2VqZWN0LworICAgICAgICBjb25uZWN0aW9uLmVqZWN0ID0gZnVuY3Rpb24odXNlcmlkKSB7CisgICAgICAgICAgICBpZiAoIWNvbm5lY3Rpb24uaXNJbml0aWF0b3IpIHRocm93ICdPbmx5IHNlc3Npb24taW5pdGlhdG9yIGNhbiBlamVjdCBhIHVzZXIuJzsKKyAgICAgICAgICAgIGlmICghY29ubmVjdGlvbi5wZWVyc1t1c2VyaWRdKSB0aHJvdyAnWW91IGVqZWN0ZWQgaW52YWxpZCB1c2VyLic7CisgICAgICAgICAgICBjb25uZWN0aW9uLnBlZXJzW3VzZXJpZF0uc2VuZEN1c3RvbU1lc3NhZ2UoeworICAgICAgICAgICAgICAgIGVqZWN0ZWQ6IHRydWUKKyAgICAgICAgICAgIH0pOworICAgICAgICB9OworCisgICAgICAgIC8vIHd3dy5SVENNdWx0aUNvbm5lY3Rpb24ub3JnL2RvY3MvY2xvc2UvCisgICAgICAgIGNvbm5lY3Rpb24uY2xvc2UgPSBmdW5jdGlvbigpIHsKKyAgICAgICAgICAgIC8vIGNsb3NlIGVudGlyZSBzZXNzaW9uCisgICAgICAgICAgICBjb25uZWN0aW9uLmF1dG9DbG9zZUVudGlyZVNlc3Npb24gPSB0cnVlOworICAgICAgICAgICAgY29ubmVjdGlvbi5sZWF2ZSgpOworICAgICAgICB9OworCisgICAgICAgIC8vIHd3dy5SVENNdWx0aUNvbm5lY3Rpb24ub3JnL2RvY3MvcmVuZWdvdGlhdGUvCisgICAgICAgIGNvbm5lY3Rpb24ucmVuZWdvdGlhdGUgPSBmdW5jdGlvbihzdHJlYW0sIHNlc3Npb24pIHsKKyAgICAgICAgICAgIGlmIChjb25uZWN0aW9uLm51bWJlck9mQ29ubmVjdGVkVXNlcnMgPD0gMCkgeworICAgICAgICAgICAgICAgIC8vIG5vIGNvbm5lY3Rpb25zCisgICAgICAgICAgICAgICAgc2V0VGltZW91dChmdW5jdGlvbigpIHsKKyAgICAgICAgICAgICAgICAgICAgLy8gdHJ5IGFnYWluCisgICAgICAgICAgICAgICAgICAgIGNvbm5lY3Rpb24ucmVuZWdvdGlhdGUoc3RyZWFtLCBzZXNzaW9uKTsKKyAgICAgICAgICAgICAgICB9LCAxMDAwKTsKKyAgICAgICAgICAgICAgICByZXR1cm47CisgICAgICAgICAgICB9CisKKyAgICAgICAgICAgIHJ0Y011bHRpU2Vzc2lvbi5hZGRTdHJlYW0oeworICAgICAgICAgICAgICAgIHJlbmVnb3RpYXRlOiBzZXNzaW9uIHx8IG1lcmdlKHsKKyAgICAgICAgICAgICAgICAgICAgb25ld2F5OiB0cnVlCisgICAgICAgICAgICAgICAgfSwgY29ubmVjdGlvbi5zZXNzaW9uKSwKKyAgICAgICAgICAgICAgICBzdHJlYW06IHN0cmVhbQorICAgICAgICAgICAgfSk7CisgICAgICAgIH07CisKKyAgICAgICAgY29ubmVjdGlvbi5hdHRhY2hFeHRlcm5hbFN0cmVhbSA9IGZ1bmN0aW9uKHN0cmVhbSwgaXNTY3JlZW4pIHsKKyAgICAgICAgICAgIHZhciBjb25zdHJhaW50cyA9IHt9OworICAgICAgICAgICAgaWYgKHN0cmVhbS5nZXRBdWRpb1RyYWNrcyAmJiBzdHJlYW0uZ2V0QXVkaW9UcmFja3MoKS5sZW5ndGgpIHsKKyAgICAgICAgICAgICAgICBjb25zdHJhaW50cy5hdWRpbyA9IHRydWU7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBpZiAoc3RyZWFtLmdldFZpZGVvVHJhY2tzICYmIHN0cmVhbS5nZXRWaWRlb1RyYWNrcygpLmxlbmd0aCkgeworICAgICAgICAgICAgICAgIGNvbnN0cmFpbnRzLnZpZGVvID0gdHJ1ZTsKKyAgICAgICAgICAgIH0KKworICAgICAgICAgICAgdmFyIHNjcmVlbl9jb25zdHJhaW50cyA9IHsKKyAgICAgICAgICAgICAgICB2aWRlbzogeworICAgICAgICAgICAgICAgICAgICBjaHJvbWVNZWRpYVNvdXJjZTogJ2Zha2UnCisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfTsKKyAgICAgICAgICAgIHZhciBmb3JjZWRDb25zdHJhaW50cyA9IGlzU2NyZWVuID8gc2NyZWVuX2NvbnN0cmFpbnRzIDogY29uc3RyYWludHM7CisgICAgICAgICAgICBvblN0cmVhbVN1Y2Nlc3NDYWxsYmFjayhzdHJlYW0sIGZhbHNlLCAnJywgbnVsbCwgZm9yY2VkQ29uc3RyYWludHMsIGZhbHNlLCBmYWxzZSwgc2NyZWVuX2NvbnN0cmFpbnRzLCBjb25zdHJhaW50cywgY29uc3RyYWludHMpOworICAgICAgICB9OworCisgICAgICAgIC8vIHd3dy5SVENNdWx0aUNvbm5lY3Rpb24ub3JnL2RvY3MvYWRkU3RyZWFtLworICAgICAgICBjb25uZWN0aW9uLmFkZFN0cmVhbSA9IGZ1bmN0aW9uKHNlc3Npb24sIHNvY2tldCkgeworICAgICAgICAgICAgLy8gd3d3LlJUQ011bHRpQ29ubmVjdGlvbi5vcmcvZG9jcy9yZW5lZ290aWF0aW9uLworCisgICAgICAgICAgICBpZiAoY29ubmVjdGlvbi5udW1iZXJPZkNvbm5lY3RlZFVzZXJzIDw9IDApIHsKKyAgICAgICAgICAgICAgICAvLyBubyBjb25uZWN0aW9ucworICAgICAgICAgICAgICAgIHNldFRpbWVvdXQoZnVuY3Rpb24oKSB7CisgICAgICAgICAgICAgICAgICAgIC8vIHRyeSBhZ2FpbgorICAgICAgICAgICAgICAgICAgICBjb25uZWN0aW9uLmFkZFN0cmVhbShzZXNzaW9uLCBzb2NrZXQpOworICAgICAgICAgICAgICAgIH0sIDEwMDApOworICAgICAgICAgICAgICAgIHJldHVybjsKKyAgICAgICAgICAgIH0KKworICAgICAgICAgICAgLy8gcmVuZWdvdGlhdGUgbmV3IG1lZGlhIHN0cmVhbQorICAgICAgICAgICAgaWYgKHNlc3Npb24pIHsKKyAgICAgICAgICAgICAgICB2YXIgaXNPbmVXYXlTdHJlYW1Gcm9tUGFydGljaXBhbnQ7CisgICAgICAgICAgICAgICAgaWYgKCFjb25uZWN0aW9uLmlzSW5pdGlhdG9yICYmIHNlc3Npb24ub25ld2F5KSB7CisgICAgICAgICAgICAgICAgICAgIHNlc3Npb24ub25ld2F5ID0gZmFsc2U7CisgICAgICAgICAgICAgICAgICAgIGlzT25lV2F5U3RyZWFtRnJvbVBhcnRpY2lwYW50ID0gdHJ1ZTsKKyAgICAgICAgICAgICAgICB9CisKKyAgICAgICAgICAgICAgICBjYXB0dXJlVXNlck1lZGlhKGZ1bmN0aW9uKHN0cmVhbSkgeworICAgICAgICAgICAgICAgICAgICBpZiAoaXNPbmVXYXlTdHJlYW1Gcm9tUGFydGljaXBhbnQpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIHNlc3Npb24ub25ld2F5ID0gdHJ1ZTsKKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICBhZGRTdHJlYW0oc3RyZWFtKTsKKyAgICAgICAgICAgICAgICB9LCBzZXNzaW9uKTsKKyAgICAgICAgICAgIH0gZWxzZSBhZGRTdHJlYW0oKTsKKworICAgICAgICAgICAgZnVuY3Rpb24gYWRkU3RyZWFtKHN0cmVhbSkgeworICAgICAgICAgICAgICAgIHJ0Y011bHRpU2Vzc2lvbi5hZGRTdHJlYW0oeworICAgICAgICAgICAgICAgICAgICBzdHJlYW06IHN0cmVhbSwKKyAgICAgICAgICAgICAgICAgICAgcmVuZWdvdGlhdGU6IHNlc3Npb24gfHwgY29ubmVjdGlvbi5zZXNzaW9uLAorICAgICAgICAgICAgICAgICAgICBzb2NrZXQ6IHNvY2tldAorICAgICAgICAgICAgICAgIH0pOworICAgICAgICAgICAgfQorICAgICAgICB9OworCisgICAgICAgIC8vIHd3dy5SVENNdWx0aUNvbm5lY3Rpb24ub3JnL2RvY3MvcmVtb3ZlU3RyZWFtLworICAgICAgICBjb25uZWN0aW9uLnJlbW92ZVN0cmVhbSA9IGZ1bmN0aW9uKHN0cmVhbWlkLCBkb250UmVuZWdvdGlhdGUpIHsKKyAgICAgICAgICAgIGlmIChjb25uZWN0aW9uLm51bWJlck9mQ29ubmVjdGVkVXNlcnMgPD0gMCkgeworICAgICAgICAgICAgICAgIC8vIG5vIGNvbm5lY3Rpb25zCisgICAgICAgICAgICAgICAgc2V0VGltZW91dChmdW5jdGlvbigpIHsKKyAgICAgICAgICAgICAgICAgICAgLy8gdHJ5IGFnYWluCisgICAgICAgICAgICAgICAgICAgIGNvbm5lY3Rpb24ucmVtb3ZlU3RyZWFtKHN0cmVhbWlkLCBkb250UmVuZWdvdGlhdGUpOworICAgICAgICAgICAgICAgIH0sIDEwMDApOworICAgICAgICAgICAgICAgIHJldHVybjsKKyAgICAgICAgICAgIH0KKworICAgICAgICAgICAgaWYgKCFzdHJlYW1pZCkgc3RyZWFtaWQgPSAnYWxsJzsKKyAgICAgICAgICAgIGlmICghaXNTdHJpbmcoc3RyZWFtaWQpIHx8IHN0cmVhbWlkLnNlYXJjaCgvYWxsfGF1ZGlvfHZpZGVvfHNjcmVlbi9naSkgIT0gLTEpIHsKKyAgICAgICAgICAgICAgICBmdW5jdGlvbiBfZGV0YWNoU3RyZWFtKF9zdHJlYW0sIGNvbmZpZykgeworICAgICAgICAgICAgICAgICAgICBpZiAoY29uZmlnLmxvY2FsICYmIF9zdHJlYW0udHlwZSAhPSAnbG9jYWwnKSByZXR1cm47CisgICAgICAgICAgICAgICAgICAgIGlmIChjb25maWcucmVtb3RlICYmIF9zdHJlYW0udHlwZSAhPSAncmVtb3RlJykgcmV0dXJuOworCisgICAgICAgICAgICAgICAgICAgIC8vIGNvbm5lY3Rpb24ucmVtb3ZlU3RyZWFtKHtzY3JlZW46dHJ1ZX0pOworICAgICAgICAgICAgICAgICAgICBpZiAoY29uZmlnLnNjcmVlbiAmJiAhIV9zdHJlYW0uaXNTY3JlZW4pIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIGNvbm5lY3Rpb24uZGV0YWNoU3RyZWFtcy5wdXNoKF9zdHJlYW0uc3RyZWFtaWQpOworICAgICAgICAgICAgICAgICAgICB9CisKKyAgICAgICAgICAgICAgICAgICAgLy8gY29ubmVjdGlvbi5yZW1vdmVTdHJlYW0oe2F1ZGlvOnRydWV9KTsKKyAgICAgICAgICAgICAgICAgICAgaWYgKGNvbmZpZy5hdWRpbyAmJiAhIV9zdHJlYW0uaXNBdWRpbykgeworICAgICAgICAgICAgICAgICAgICAgICAgY29ubmVjdGlvbi5kZXRhY2hTdHJlYW1zLnB1c2goX3N0cmVhbS5zdHJlYW1pZCk7CisgICAgICAgICAgICAgICAgICAgIH0KKworICAgICAgICAgICAgICAgICAgICAvLyBjb25uZWN0aW9uLnJlbW92ZVN0cmVhbSh7dmlkZW86dHJ1ZX0pOworICAgICAgICAgICAgICAgICAgICBpZiAoY29uZmlnLnZpZGVvICYmICEhX3N0cmVhbS5pc1ZpZGVvKSB7CisgICAgICAgICAgICAgICAgICAgICAgICBjb25uZWN0aW9uLmRldGFjaFN0cmVhbXMucHVzaChfc3RyZWFtLnN0cmVhbWlkKTsKKyAgICAgICAgICAgICAgICAgICAgfQorCisgICAgICAgICAgICAgICAgICAgIC8vIGNvbm5lY3Rpb24ucmVtb3ZlU3RyZWFtKHt9KTsKKyAgICAgICAgICAgICAgICAgICAgaWYgKCFjb25maWcuYXVkaW8gJiYgIWNvbmZpZy52aWRlbyAmJiAhY29uZmlnLnNjcmVlbikgeworICAgICAgICAgICAgICAgICAgICAgICAgY29ubmVjdGlvbi5kZXRhY2hTdHJlYW1zLnB1c2goX3N0cmVhbS5zdHJlYW1pZCk7CisgICAgICAgICAgICAgICAgICAgIH0KKworICAgICAgICAgICAgICAgICAgICBpZiAoY29ubmVjdGlvbi5kZXRhY2hTdHJlYW1zLmluZGV4T2YoX3N0cmVhbS5zdHJlYW1pZCkgIT0gLTEpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIGxvZygncmVtb3Zpbmcgc3RyZWFtJywgX3N0cmVhbS5zdHJlYW1pZCk7CisgICAgICAgICAgICAgICAgICAgICAgICBvblN0cmVhbUVuZGVkSGFuZGxlcihfc3RyZWFtLCBjb25uZWN0aW9uKTsKKworICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGNvbmZpZy5zdG9wKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgY29ubmVjdGlvbi5zdG9wTWVkaWFTdHJlYW0oX3N0cmVhbS5zdHJlYW0pOworICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgfQorCisgICAgICAgICAgICAgICAgZm9yICh2YXIgc3RyZWFtIGluIGNvbm5lY3Rpb24uc3RyZWFtcykgeworICAgICAgICAgICAgICAgICAgICBpZiAoY29ubmVjdGlvbi5fc2tpcC5pbmRleE9mKHN0cmVhbSkgPT0gLTEpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIF9zdHJlYW0gPSBjb25uZWN0aW9uLnN0cmVhbXNbc3RyZWFtXTsKKworICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHN0cmVhbWlkID09ICdhbGwnKSBfZGV0YWNoU3RyZWFtKF9zdHJlYW0sIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBhdWRpbzogdHJ1ZSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB2aWRlbzogdHJ1ZSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBzY3JlZW46IHRydWUKKyAgICAgICAgICAgICAgICAgICAgICAgIH0pOworCisgICAgICAgICAgICAgICAgICAgICAgICBlbHNlIGlmIChpc1N0cmluZyhzdHJlYW1pZCkpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyBjb25uZWN0aW9uLnJlbW92ZVN0cmVhbSgnc2NyZWVuJyk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFyIGNvbmZpZyA9IHt9OworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbmZpZ1tzdHJlYW1pZF0gPSB0cnVlOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIF9kZXRhY2hTdHJlYW0oX3N0cmVhbSwgY29uZmlnKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSBfZGV0YWNoU3RyZWFtKF9zdHJlYW0sIHN0cmVhbWlkKTsKKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIH0KKworICAgICAgICAgICAgICAgIGlmICghZG9udFJlbmVnb3RpYXRlICYmIGNvbm5lY3Rpb24uZGV0YWNoU3RyZWFtcy5sZW5ndGgpIHsKKyAgICAgICAgICAgICAgICAgICAgY29ubmVjdGlvbi5yZW5lZ290aWF0ZSgpOworICAgICAgICAgICAgICAgIH0KKworICAgICAgICAgICAgICAgIHJldHVybjsKKyAgICAgICAgICAgIH0KKworICAgICAgICAgICAgdmFyIHN0cmVhbSA9IGNvbm5lY3Rpb24uc3RyZWFtc1tzdHJlYW1pZF07CisKKyAgICAgICAgICAgIC8vIGRldGFjaCBwcmUtYXR0YWNoZWQgc3RyZWFtcworICAgICAgICAgICAgaWYgKCFzdHJlYW0pIHJldHVybiB3YXJuKCdObyBzdWNoIHN0cmVhbSBleGlzdHMuIFN0cmVhbS1pZDonLCBzdHJlYW1pZCk7CisKKyAgICAgICAgICAgIC8vIHd3dy5SVENNdWx0aUNvbm5lY3Rpb24ub3JnL2RvY3MvZGV0YWNoU3RyZWFtcy8KKyAgICAgICAgICAgIGNvbm5lY3Rpb24uZGV0YWNoU3RyZWFtcy5wdXNoKHN0cmVhbS5zdHJlYW1pZCk7CisKKyAgICAgICAgICAgIGxvZygncmVtb3Zpbmcgc3RyZWFtJywgc3RyZWFtLnN0cmVhbWlkKTsKKyAgICAgICAgICAgIG9uU3RyZWFtRW5kZWRIYW5kbGVyKHN0cmVhbSwgY29ubmVjdGlvbik7CisKKyAgICAgICAgICAgIC8vIHRvZG86IGhvdyB0byBhbGxvdyAic3RvcCIgZnVuY3Rpb24/CisgICAgICAgICAgICAvLyBjb25uZWN0aW9uLnN0b3BNZWRpYVN0cmVhbShzdHJlYW0uc3RyZWFtKQorCisgICAgICAgICAgICBpZiAoIWRvbnRSZW5lZ290aWF0ZSkgeworICAgICAgICAgICAgICAgIGNvbm5lY3Rpb24ucmVuZWdvdGlhdGUoKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfTsKKworICAgICAgICBjb25uZWN0aW9uLnN3aXRjaFN0cmVhbSA9IGZ1bmN0aW9uKHNlc3Npb24pIHsKKyAgICAgICAgICAgIGlmIChjb25uZWN0aW9uLm51bWJlck9mQ29ubmVjdGVkVXNlcnMgPD0gMCkgeworICAgICAgICAgICAgICAgIC8vIG5vIGNvbm5lY3Rpb25zCisgICAgICAgICAgICAgICAgc2V0VGltZW91dChmdW5jdGlvbigpIHsKKyAgICAgICAgICAgICAgICAgICAgLy8gdHJ5IGFnYWluCisgICAgICAgICAgICAgICAgICAgIGNvbm5lY3Rpb24uc3dpdGNoU3RyZWFtKHNlc3Npb24pOworICAgICAgICAgICAgICAgIH0sIDEwMDApOworICAgICAgICAgICAgICAgIHJldHVybjsKKyAgICAgICAgICAgIH0KKworICAgICAgICAgICAgY29ubmVjdGlvbi5yZW1vdmVTdHJlYW0oJ2FsbCcsIHRydWUpOworICAgICAgICAgICAgY29ubmVjdGlvbi5hZGRTdHJlYW0oc2Vzc2lvbik7CisgICAgICAgIH07CisKKyAgICAgICAgLy8gd3d3LlJUQ011bHRpQ29ubmVjdGlvbi5vcmcvZG9jcy9zZW5kQ3VzdG9tTWVzc2FnZS8KKyAgICAgICAgY29ubmVjdGlvbi5zZW5kQ3VzdG9tTWVzc2FnZSA9IGZ1bmN0aW9uKG1lc3NhZ2UpIHsKKyAgICAgICAgICAgIGlmICghcnRjTXVsdGlTZXNzaW9uIHx8ICFydGNNdWx0aVNlc3Npb24uZGVmYXVsdFNvY2tldCkgeworICAgICAgICAgICAgICAgIHJldHVybiBzZXRUaW1lb3V0KGZ1bmN0aW9uKCkgeworICAgICAgICAgICAgICAgICAgICBjb25uZWN0aW9uLnNlbmRDdXN0b21NZXNzYWdlKG1lc3NhZ2UpOworICAgICAgICAgICAgICAgIH0sIDEwMDApOworICAgICAgICAgICAgfQorCisgICAgICAgICAgICBydGNNdWx0aVNlc3Npb24uZGVmYXVsdFNvY2tldC5zZW5kKHsKKyAgICAgICAgICAgICAgICBjdXN0b21NZXNzYWdlOiB0cnVlLAorICAgICAgICAgICAgICAgIG1lc3NhZ2U6IG1lc3NhZ2UKKyAgICAgICAgICAgIH0pOworICAgICAgICB9OworCisgICAgICAgIC8vIHNldCBSVENNdWx0aUNvbm5lY3Rpb24gZGVmY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gICAgICAgIHJldHVybjsKKyAgICAgICAgICAgIH0KKworICAgICAgICAgICAgaWYgKGUuZGF0YS5wcmVzZW5jZURldGVjdGVkICYmIGNvbm5lY3Rpb24ucGVlcnNbZS51c2VyaWRdKSB7CisgICAgICAgICAgICAgICAgY29ubmVjdGlvbi5wZWVyc1tlLnVzZXJpZF0uY29ubmVjdGVkID0gdHJ1ZTsKKyAgICAgICAgICAgICAgICByZXR1cm47CisgICAgICAgICAgICB9CisKKyAgICAgICAgICAgIGlmIChlLmRhdGEudHlwZSA9PT0gJ3RleHQnKSB7CisgICAgICAgICAgICAgICAgdGV4dFJlY2VpdmVyLnJlY2VpdmUoZS5kYXRhLCBlLnVzZXJpZCwgZS5leHRyYSk7CisgICAgICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgICAgIGlmIChjb25uZWN0aW9uLmF1dG9UcmFuc2xhdGVUZXh0KSB7CisgICAgICAgICAgICAgICAgICAgIGUub3JpZ2luYWwgPSBlLmRhdGE7CisgICAgICAgICAgICAgICAgICAgIGNvbm5lY3Rpb24uVHJhbnNsYXRvci5UcmFuc2xhdGVUZXh0KGUuZGF0YSwgZnVuY3Rpb24odHJhbnNsYXRlZFRleHQpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIGUuZGF0YSA9IHRyYW5zbGF0ZWRUZXh0OworICAgICAgICAgICAgICAgICAgICAgICAgY29ubmVjdGlvbi5vbm1lc3NhZ2UoZSk7CisgICAgICAgICAgICAgICAgICAgIH0pOworICAgICAgICAgICAgICAgIH0gZWxzZSBjb25uZWN0aW9uLm9ubWVzc2FnZShlKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorCisgICAgICAgIGZ1bmN0aW9uIG9uTmV3U2Vzc2lvbihzZXNzaW9uKSB7CisgICAgICAgICAgICBpZiAoY29ubmVjdGlvbi5za2lwT25OZXdTZXNzaW9uKSByZXR1cm47CisKKyAgICAgICAgICAgIGlmICghc2Vzc2lvbi5zZXNzaW9uKSBzZXNzaW9uLnNlc3Npb24gPSB7fTsKKyAgICAgICAgICAgIGlmICghc2Vzc2lvbi5leHRyYSkgc2Vzc2lvbi5leHRyYSA9IHt9OworCisgICAgICAgICAgICAvLyB0b2RvOiBtYWtlIHN1cmUgdGhpcyB3b3JrcyBhcyBleHBlY3RlZC4KKyAgICAgICAgICAgIC8vIGkuZS4gIm9uTmV3U2Vzc2lvbiIgc2hvdWxkIGJlIGZpcmVkIG9ubHkgZm9yIAorICAgICAgICAgICAgLy8gc2Vzc2lvbmlkIHRoYXQgaXMgcGFzc2VkIG92ZXIgImNvbm5lY3QiIG1ldGhvZC4KKyAgICAgICAgICAgIGlmIChjb25uZWN0aW9uLnNlc3Npb25pZCAmJiBzZXNzaW9uLnNlc3Npb25pZCAhPSBjb25uZWN0aW9uLnNlc3Npb25pZCkgcmV0dXJuOworCisgICAgICAgICAgICBpZiAoY29ubmVjdGlvbi5vbk5ld1Nlc3Npb24pIHsKKyAgICAgICAgICAgICAgICBzZXNzaW9uLmpvaW4gPSBmdW5jdGlvbihmb3JjZVNlc3Npb24pIHsKKyAgICAgICAgICAgICAgICAgICAgaWYgKCFmb3JjZVNlc3Npb24pIHJldHVybiBjb25uZWN0aW9uLmpvaW4oc2Vzc2lvbik7CisKKyAgICAgICAgICAgICAgICAgICAgZm9yICh2YXIgZiBpbiBmb3JjZVNlc3Npb24pIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIHNlc3Npb24uc2Vzc2lvbltmXSA9IGZvcmNlU2Vzc2lvbltmXTsKKyAgICAgICAgICAgICAgICAgICAgfQorCisgICAgICAgICAgICAgICAgICAgIC8vIGtlZXBpbmcgcHJldmlvdXMgc3RhdGUKKyAgICAgICAgICAgICAgICAgICAgdmFyIGlzRG9udENhcHR1cmVVc2VyTWVkaWEgPSBjb25uZWN0aW9uLmRvbnRDYXB0dXJlVXNlck1lZGlhOworCisgICAgICAgICAgICAgICAgICAgIGNvbm5lY3Rpb24uZG9udENhcHR1cmVVc2VyTWVkaWEgPSBmYWxzZTsKKyAgICAgICAgICAgICAgICAgICAgY29ubmVjdGlvbi5jYXB0dXJlVXNlck1lZGlhKGZ1bmN0aW9uKCkgeworICAgICAgICAgICAgICAgICAgICAgICAgY29ubmVjdGlvbi5kb250Q2FwdHVyZVVzZXJNZWRpYSA9IHRydWU7CisgICAgICAgICAgICAgICAgICAgICAgICBjb25uZWN0aW9uLmpvaW4oc2Vzc2lvbik7CisKKyAgICAgICAgICAgICAgICAgICAgICAgIC8vIHJldHVybmluZyBiYWNrIHByZXZpb3VzIHN0YXRlCisgICAgICAgICAgICAgICAgICAgICAgICBjb25uZWN0aW9uLmRvbnRDYXB0dXJlVXNlck1lZGlhID0gaXNEb250Q2FwdHVyZVVzZXJNZWRpYTsKKyAgICAgICAgICAgICAgICAgICAgfSwgZm9yY2VTZXNzaW9uKTsKKyAgICAgICAgICAgICAgICB9OworICAgICAgICAgICAgICAgIGlmICghc2Vzc2lvbi5leHRyYSkgc2Vzc2lvbi5leHRyYSA9IHt9OworCisgICAgICAgICAgICAgICAgcmV0dXJuIGNvbm5lY3Rpb24ub25OZXdTZXNzaW9uKHNlc3Npb24pOworICAgICAgICAgICAgfQorCisgICAgICAgICAgICBjb25uZWN0aW9uLmpvaW4oc2Vzc2lvbik7CisgICAgICAgIH0KKworICAgICAgICBmdW5jdGlvbiB1cGRhdGVTb2NrZXRGb3JMb2NhbFN0cmVhbXMoc29ja2V0KSB7CisgICAgICAgICAgICBmb3IgKHZhciBpID0gMDsgaSA8IGNvbm5lY3Rpb24ubG9jYWxTdHJlYW1pZHMubGVuZ3RoOyBpKyspIHsKKyAgICAgICAgICAgICAgICB2YXIgc3RyZWFtaWQgPSBjb25uZWN0aW9uLmxvY2FsU3RyZWFtaWRzW2ldOworICAgICAgICAgICAgICAgIGlmIChjb25uZWN0aW9uLnN0cmVhbXNbc3RyZWFtaWRdKSB7CisgICAgICAgICAgICAgICAgICAgIC8vIHVzaW5nICJzb2NrZXRzIiBhcnJheSB0byBrZWVwIHJlZmVyZW5jZXMgb2YgYWxsIHNvY2tldHMgdXNpbmcgCisgICAgICAgICAgICAgICAgICAgIC8vIHRoaXMgbWVkaWEgc3RyZWFtOyBzbyB3ZSBjYW4gZmlyZSAib25TdHJlYW1FbmRlZEhhbmRsZXIiIGFtb25nIGFsbCB1c2Vycy4KKyAgICAgICAgICAgICAgICAgICAgY29ubmVjdGlvbi5zdHJlYW1zW3N0cmVhbWlkXS5zb2NrZXRzLnB1c2goc29ja2V0KTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9CisgICAgICAgIH0KKworICAgICAgICBmdW5jdGlvbiBuZXdQcml2YXRlU29ja2V0KF9jb25maWcpIHsKKyAgICAgICAgICAgIHZhciBzb2NrZXRDb25maWcgPSB7CisgICAgICAgICAgICAgICAgY2hhbm5lbDogX2NvbmZpZy5jaGFubmVsLAorICAgICAgICAgICAgICAgIG9ubWVzc2FnZTogc29ja2V0UmVzcG9uc2UsCisgICAgICAgICAgICAgICAgb25vcGVuOiBmdW5jdGlvbihfc29ja2V0KSB7CisgICAgICAgICAgICAgICAgICAgIGlmIChfc29ja2V0KSBzb2NrZXQgPSBfc29ja2V0OworCisgICAgICAgICAgICAgICAgICAgIGlmIChpc29mZmVyZXIgJiYgIXBlZXIpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIHBlZXJDb25maWcuc2Vzc2lvbiA9IGNvbm5lY3Rpb24uc2Vzc2lvbjsKKyAgICAgICAgICAgICAgICAgICAgICAgIGlmICghcGVlcikgcGVlciA9IG5ldyBQZWVyQ29ubmVjdGlvbigpOworICAgICAgICAgICAgICAgICAgICAgICAgcGVlci5jcmVhdGUoJ29mZmVyJywgcGVlckNvbmZpZyk7CisgICAgICAgICAgICAgICAgICAgIH0KKworICAgICAgICAgICAgICAgICAgICBfY29uZmlnLnNvY2tldEluZGV4ID0gc29ja2V0LmluZGV4ID0gc29ja2V0cy5sZW5ndGg7CisgICAgICAgICAgICAgICAgICAgIHNvY2tldE9iamVjdHNbc29ja2V0Q29uZmlnLmNoYW5uZWxdID0gc29ja2V0OworICAgICAgICAgICAgICAgICAgICBzb2NrZXRzW19jb25maWcuc29ja2V0SW5kZXhdID0gc29ja2V0OworCisgICAgICAgICAgICAgICAgICAgIHVwZGF0ZVNvY2tldEZvckxvY2FsU3RyZWFtcyhzb2NrZXQpOworCisgICAgICAgICAgICAgICAgICAgIGlmICghc29ja2V0Ll9fcHVzaCkgeworICAgICAgICAgICAgICAgICAgICAgICAgc29ja2V0Ll9fcHVzaCA9IHNvY2tldC5zZW5kOworICAgICAgICAgICAgICAgICAgICAgICAgc29ja2V0LnNlbmQgPSBmdW5jdGlvbihtZXNzYWdlKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgbWVzc2FnZS51c2VyaWQgPSBtZXNzYWdlLnVzZXJpZCB8fCBjb25uZWN0aW9uLnVzZXJpZDsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBtZXNzYWdlLmV4dHJhID0gbWVzc2FnZS5leHRyYSB8fCBjb25uZWN0aW9uLmV4dHJhIHx8IHt9OworCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgc29ja2V0Ll9fcHVzaChtZXNzYWdlKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIH07CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9OworCisgICAgICAgICAgICBzb2NrZXRDb25maWcuY2FsbGJhY2sgPSBmdW5jdGlvbihfc29ja2V0KSB7CisgICAgICAgICAgICAgICAgc29ja2V0ID0gX3NvY2tldDsKKyAgICAgICAgICAgICAgICBzb2NrZXRDb25maWcub25vcGVuKCk7CisgICAgICAgICAgICB9OworCisgICAgICAgICAgICB2YXIgc29ja2V0ID0gY29ubmVjdGlvbi5vcGVuU2lnbmFsaW5nQ2hhbm5lbChzb2NrZXRDb25maWcpOworICAgICAgICAgICAgaWYgKHNvY2tldCkgc29ja2V0Q29uZmlnLm9ub3Blbihzb2NrZXQpOworCisgICAgICAgICAgICB2YXIgaXNvZmZlcmVyID0gX2NvbmZpZy5pc29mZmVyZXIsCisgICAgICAgICAgICAgICAgcGVlcjsKKworICAgICAgICAgICAgdmFyIHBlZXJDb25maWcgPSB7CisgICAgICAgICAgICAgICAgb25vcGVuOiBvbkNoYW5uZWxPcGVuZWQsCisgICAgICAgICAgICAgICAgb25pY2VjYW5kaWRhdGU6IGZ1bmN0aW9uKGNhbmRpZGF0ZSkgeworICAgICAgICAgICAgICAgICAgICBpZiAoIWNvbm5lY3Rpb24uY2FuZGlkYXRlcykgdGhyb3cgJ0lDRSBjYW5kaWRhdGVzIGFyZSBtYW5kYXRvcnkuJzsKKyAgICAgICAgICAgICAgICAgICAgaWYgKCFjb25uZWN0aW9uLmljZVByb3RvY29scykgdGhyb3cgJ0F0IGxlYXN0IG9uZSBtdXN0IGJlIHRydWU7IFVEUCBvciBUQ1AuJzsKKworICAgICAgICAgICAgICAgICAgICB2YXIgaWNlQ2FuZGlkYXRlcyA9IGNvbm5lY3Rpb24uY2FuZGlkYXRlczsKKworICAgICAgICAgICAgICAgICAgICB2YXIgc3R1biA9IGljZUNhbmRpZGF0ZXMuc3R1bjsKKyAgICAgICAgICAgICAgICAgICAgdmFyIHR1cm4gPSBpY2VDYW5kaWRhdGVzLnR1cm47CisKKyAgICAgICAgICAgICAgICAgICAgaWYgKCFpc051bGwoaWNlQ2FuZGlkYXRlcy5yZWZsZXhpdmUpKSBzdHVuID0gaWNlQ2FuZGlkYXRlcy5yZWZsZXhpdmU7CisgICAgICAgICAgICAgICAgICAgIGlmICghaXNOdWxsKGljZUNhbmRpZGF0ZXMucmVsYXkpKSB0dXJuID0gaWNlQ2FuZGlkYXRlcy5yZWxheTsKKworICAgICAgICAgICAgICAgICAgICBpZiAoIWljZUNhbmRpZGF0ZXMuaG9zdCAmJiAhIWNhbmRpZGF0ZS5jYW5kaWRhdGUubWF0Y2goL2E9Y2FuZGlkYXRlLip0eXAgaG9zdC9nKSkgcmV0dXJuOworICAgICAgICAgICAgICAgICAgICBpZiAoIXR1cm4gJiYgISFjYW5kaWRhdGUuY2FuZGlkYXRlLm1hdGNoKC9hPWNhbmRpZGF0ZS4qdHlwIHJlbGF5L2cpKSByZXR1cm47CisgICAgICAgICAgICAgICAgICAgIGlmICghc3R1biAmJiAhIWNhbmRpZGF0ZS5jYW5kaWRhdGUubWF0Y2goL2E9Y2FuZGlkYXRlLip0eXAgc3JmbHgvZykpIHJldHVybjsKKworICAgICAgICAgICAgICAgICAgICB2YXIgcHJvdG9jb2wgPSBjb25uZWN0aW9uLmljZVByb3RvY29sczsKKworICAgICAgICAgICAgICAgICAgICBpZiAoIXByb3RvY29sLnVkcCAmJiAhIWNhbmRpZGF0ZS5jYW5kaWRhdGUubWF0Y2goL2E9Y2FuZGlkYXRlLiogdWRwL2cpKSByZXR1cm47CisgICAgICAgICAgICAgICAgICAgIGlmICghcHJvdG9jb2wudGNwICYmICEhY2FuZGlkYXRlLmNhbmRpZGF0ZS5tYXRjaCgvYT1jYW5kaWRhdGUuKiB0Y3AvZykpIHJldHVybjsKKworICAgICAgICAgICAgICAgICAgICBpZiAoIXdpbmRvdy5zZWxmTlBPYmplY3QpIHdpbmRvdy5zZWxmTlBPYmplY3QgPSBjYW5kaWRhdGU7CisKKyAgICAgICAgICAgICAgICAgICAgc29ja2V0ICYmIHNvY2tldC5zZW5kKHsKKyAgICAgICAgICAgICAgICAgICAgICAgIGNhbmRpZGF0ZTogSlNPTi5zdHJpbmdpZnkoeworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNhbmRpZGF0ZTogY2FuZGlkYXRlLmNhbmRpZGF0ZSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBzZHBNaWQ6IGNhbmRpZGF0ZS5zZHBNaWQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2RwTUxpbmVJbmRleDogY2FuZGlkYXRlLnNkcE1MaW5lSW5kZXgKKyAgICAgICAgICAgICAgICAgICAgICAgIH0pCisgICAgICAgICAgICAgICAgICAgIH0pOworICAgICAgICAgICAgICAgIH0sCisgICAgICAgICAgICAgICAgb25tZXNzYWdlOiBmdW5jdGlvbihkYXRhKSB7CisgICAgICAgICAgICAgICAgICAgIGlmICghZGF0YSkgcmV0dXJuOworCisgICAgICAgICAgICAgICAgICAgIHZhciBhYlRvU3RyID0gYWIyc3RyKGRhdGEpOworICAgICAgICAgICAgICAgICAgICBpZiAoYWJUb1N0ci5pbmRleE9mKCcidXNlcmlkIjonKSAhPSAtMSkgeworICAgICAgICAgICAgICAgICAgICAgICAgYWJUb1N0ciA9IEpTT04ucGFyc2UoYWJUb1N0cik7CisgICAgICAgICAgICAgICAgICAgICAgICBvbkRhdGFDaGFubmVsTWVzc2FnZShhYlRvU3RyKTsKKyAgICAgICAgICAgICAgICAgICAgfSBlbHNlIGlmIChkYXRhIGluc3RhbmNlb2YgQXJyYXlCdWZmZXIgfHwgZGF0YSBpbnN0YW5jZW9mIERhdGFWaWV3KSB7CisgICAgICAgICAgICAgICAgICAgICAgICBpZiAoIWNvbm5lY3Rpb24uZW5hYmxlRmlsZVNoYXJpbmcpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB0aHJvdyAnSXQgc2VlbXMgdGhhdCByZWNlaXZpbmcgZGF0YSBpcyBlaXRoZXIgIkJsb2IiIG9yICJGaWxlIiBidXQgZmlsZSBzaGFyaW5nIGlzIGRpc2FibGVkLic7CisgICAgICAgICAgICAgICAgICAgICAgICB9CisKKyAgICAgICAgICAgICAgICAgICAgICAgIGlmICghcnRjTXVsdGlTZXNzaW9uLmZpbGVCdWZmZXJSZWFkZXIpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YXIgdGhhdCA9IHRoaXM7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgaW5pdEZpbGVCdWZmZXJSZWFkZXIoY29ubmVjdGlvbiwgZnVuY3Rpb24oZmJyKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJ0Y011bHRpU2Vzc2lvbi5maWxlQnVmZmVyUmVhZGVyID0gZmJyOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0aGF0Lm9ubWVzc2FnZShkYXRhKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB9KTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm47CisgICAgICAgICAgICAgICAgICAgICAgICB9CisKKyAgICAgICAgICAgICAgICAgICAgICAgIHZhciBmaWxlQnVmZmVyUmVhZGVyID0gcnRjTXVsdGlTZXNzaW9uLmZpbGVCdWZmZXJSZWFkZXI7CisKKyAgICAgICAgICAgICAgICAgICAgICAgIGZpbGVCdWZmZXJSZWFkZXIuY29udmVydFRvT2JqZWN0KGRhdGEsIGZ1bmN0aW9uKGNodW5rKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGNodW5rLm1heENodW5rcyB8fCBjaHVuay5yZWFkeUZvck5leHRDaHVuaykgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyBpZiB0YXJnZXQgcGVlciByZXF1ZXN0ZWQgbmV4dCBjaHVuaworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoY2h1bmsucmVhZHlGb3JOZXh0Q2h1bmspIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZpbGVCdWZmZXJSZWFkZXIuZ2V0TmV4dENodW5rKGNodW5rLnV1aWQsIGZ1bmN0aW9uKG5leHRDaHVuaywgaXNMYXN0Q2h1bmssIGV4dHJhKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcnRjTXVsdGlTZXNzaW9uLnNlbmQobmV4dENodW5rKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0pOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CisKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gaWYgY2h1bmsgaXMgcmVjZWl2ZWQKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZmlsZUJ1ZmZlclJlYWRlci5hZGRDaHVuayhjaHVuaywgZnVuY3Rpb24ocHJvbXB0TmV4dENodW5rKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyByZXF1ZXN0IG5leHQgY2h1bmsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJ0Y011bHRpU2Vzc2lvbi5zZW5kKHByb21wdE5leHRDaHVuayk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0pOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm47CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQorCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgY29ubmVjdGlvbi5vbm1lc3NhZ2UoeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBkYXRhOiBjaHVuaywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdXNlcmlkOiBfY29uZmlnLnVzZXJpZCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZXh0cmE6IF9jb25maWcuZXh0cmEKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB9KTsKKyAgICAgICAgICAgICAgICAgICAgICAgIH0pOworICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuOworICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgfSwKKyAgICAgICAgICAgICAgICBvbmFkZHN0cmVhbTogZnVuY3Rpb24oc3RyZWFtLCBzZXNzaW9uKSB7CisgICAgICAgICAgICAgICAgICAgIHNlc3Npb24gPSBzZXNzaW9uIHx8IF9jb25maWcucmVuZWdvdGlhdGUgfHwgY29ubmVjdGlvbi5zZXNzaW9uOworCisgICAgICAgICAgICAgICAgICAgIC8vIGlmIGl0IGlzIGRhdGEtb25seSBjb25uZWN0aW9uOyB0aGVuIHJldHVybi4KKyAgICAgICAgICAgICAgICAgICAgaWYgKGlzRGF0YShzZXNzaW9uKSkgcmV0dXJuOworCisgICAgICAgICAgICAgICAgICAgIGlmIChzZXNzaW9uLnNjcmVlbiAmJiAoc2Vzc2lvbi5hdWRpbyB8fCBzZXNzaW9uLnZpZGVvKSkgeworICAgICAgICAgICAgICAgICAgICAgICAgaWYgKCFfY29uZmlnLmdvdEF1ZGlvT3JWaWRlbykgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vIGF1ZGlvL3ZpZGVvIGFyZSBmaXJlZCBlYXJsaWVyIHRoYW4gc2NyZWVuCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgX2NvbmZpZy5nb3RBdWRpb09yVmlkZW8gPSB0cnVlOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNlc3Npb24uc2NyZWVuID0gZmFsc2U7CisgICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vIHNjcmVlbiBzdHJlYW0gaXMgYWx3YXlzIGZpcmVkIGxhdGVyCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2Vzc2lvbi5hdWRpbyA9IGZhbHNlOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNlc3Npb24udmlkZW8gPSBmYWxzZTsKKyAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgfQorCisgICAgICAgICAgICAgICAgICAgIHZhciBwcmVNdXRlZCA9IHt9OworCisgICAgICAgICAgICAgICAgICAgIGlmIChfY29uZmlnLnN0cmVhbWluZm8pIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIHZhciBzdHJlYW1pbmZvID0gX2NvbmZpZy5zdHJlYW1pbmZvLnNwbGl0KCctLS0tJyk7CisgICAgICAgICAgICAgICAgICAgICAgICB2YXIgc3RySW5mbyA9IEpTT04ucGFyc2Uoc3RyZWFtaW5mb1tzdHJlYW1pbmZvLmxlbmd0aCAtIDFdKTsKKworICAgICAgICAgICAgICAgICAgICAgICAgaWYgKCFpc0lFKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgc3RyZWFtLnN0cmVhbWlkID0gc3RySW5mby5zdHJlYW1pZDsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBzdHJlYW0uaXNTY3JlZW4gPSAhIXN0ckluZm8uaXNTY3JlZW47CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgc3RyZWFtLmlzVmlkZW8gPSAhIXN0ckluZm8uaXNWaWRlbzsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBzdHJlYW0uaXNBdWRpbyA9ICEhc3RySW5mby5pc0F1ZGlvOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIHByZU11dGVkID0gc3RySW5mby5wcmVNdXRlZDsKKyAgICAgICAgICAgICAgICAgICAgICAgIH0KKworICAgICAgICAgICAgICAgICAgICAgICAgc3RyZWFtaW5mby5wb3AoKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIF9jb25maWcuc3RyZWFtaW5mbyA9IHN0cmVhbWluZm8uam9pbignLS0tLScpOworICAgICAgICAgICAgICAgICAgICB9CisKKyAgICAgICAgICAgICAgICAgICAgdmFyIG1lZGlhRWxlbWVudCA9IGNyZWF0ZU1lZGlhRWxlbWVudChzdHJlYW0sIG1lcmdlKHsKKyAgICAgICAgICAgICAgICAgICAgICAgIHJlbW90ZTogdHJ1ZQorICAgICAgICAgICAgICAgICAgICB9LCBzZXNzaW9uKSk7CisKKyAgICAgICAgICAgICAgICAgICAgaWYgKGNvbm5lY3Rpb24uc2V0RGVmYXVsdEV2ZW50c0Zvck1lZGlhRWxlbWVudCkgeworICAgICAgICAgICAgICAgICAgICAgICAgY29ubmVjdGlvbi5zZXREZWZhdWx0RXZlbnRzRm9yTWVkaWFFbGVtZW50KG1lZGlhRWxlbWVudCwgc3RyZWFtLnN0cmVhbWlkKTsKKyAgICAgICAgICAgICAgICAgICAgfQorCisgICAgICAgICAgICAgICAgICAgIGlmICghaXNQbHVnaW5SVEMgJiYgIXN0cmVhbS5nZXRWaWRlb1RyYWNrcygpLmxlbmd0aCkgeworICAgICAgICAgICAgICAgICAgICAgICAgZnVuY3Rpb24gZXZlbnRMaXN0ZW5lcigpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBzZXRUaW1lb3V0KGZ1bmN0aW9uKCkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBtZWRpYUVsZW1lbnQubXV0ZWQgPSBmYWxzZTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYWZ0ZXJSZW1vdGVTdHJlYW1TdGFydGVkRmxvd2luZyh7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBtZWRpYUVsZW1lbnQ6IG1lZGlhRWxlbWVudCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNlc3Npb246IHNlc3Npb24sCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzdHJlYW06IHN0cmVhbSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHByZU11dGVkOiBwcmVNdXRlZAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9KTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB9LCAzMDAwKTsKKworICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1lZGlhRWxlbWVudC5yZW1vdmVFdmVudExpc3RlbmVyKCdwbGF5JywgZXZlbnRMaXN0ZW5lcik7CisgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gbWVkaWFFbGVtZW50LmFkZEV2ZW50TGlzdGVuZXIoJ3BsYXknLCBldmVudExpc3RlbmVyLCBmYWxzZSk7CisgICAgICAgICAgICAgICAgICAgIH0KKworICAgICAgICAgICAgICAgICAgICB3YWl0VW50aWxSZW1vdGVTdHJlYW1TdGFydHNGbG93aW5nKHsKKyAgICAgICAgICAgICAgICAgICAgICAgIG1lZGlhRWxlbWVudDogbWVkaWFFbGVtZW50LAorICAgICAgICAgICAgICAgICAgICAgICAgc2Vzc2lvbjogc2Vzc2lvbiwKKyAgICAgICAgICAgICAgICAgICAgICAgIHN0cmVhbTogc3RyZWFtLAorICAgICAgICAgICAgICAgICAgICAgICAgcHJlTXV0ZWQ6IHByZU11dGVkCisgICAgICAgICAgICAgICAgICAgIH0pOworICAgICAgICAgICAgICAgIH0sCisKKyAgICAgICAgICAgICAgICBvbnJlbW92ZXN0cmVhbTogZnVuY3Rpb24oc3RyZWFtKSB7CisgICAgICAgICAgICAgICAgICAgIGlmIChzdHJlYW0gJiYgc3RyZWFtLnN0cmVhbWlkKSB7CisgICAgICAgICAgICAgICAgICAgICAgICBzdHJlYW0gPSBjb25uZWN0aW9uLnN0cmVhbXNbc3RyZWFtLnN0cmVhbWlkXTsKKyAgICAgICAgICAgICAgICAgICAgICAgIGlmIChzdHJlYW0pIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBsb2coJ29uOnN0cmVhbTplbmRlZCB2aWEgb246cmVtb3ZlOnN0cmVhbScsIHN0cmVhbSk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgb25TdHJlYW1FbmRlZEhhbmRsZXIoc3RyZWFtLCBjb25uZWN0aW9uKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgfSBlbHNlIGxvZygnb246cmVtb3ZlOnN0cmVhbScsIHN0cmVhbSk7CisgICAgICAgICAgICAgICAgfSwKKworICAgICAgICAgICAgICAgIG9uY2xvc2U6IGZ1bmN0aW9uKGUpIHsKKyAgICAgICAgICAgICAgICAgICAgZS5leHRyYSA9IF9jb25maWcuZXh0cmE7CisgICAgICAgICAgICAgICAgICAgIGUudXNlcmlkID0gX2NvbmZpZy51c2VyaWQ7CisgICAgICAgICAgICAgICAgICAgIGNvbm5lY3Rpb24ub25jbG9zZShlKTsKKworICAgICAgICAgICAgICAgICAgICAvLyBzdWdnZXN0ZWQgaW4gIzcxIGJ5ICJlZmFqIgorICAgICAgICAgICAgICAgICAgICBpZiAoY29ubmVjdGlvbi5jaGFubmVsc1tlLnVzZXJpZF0pIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIGRlbGV0ZSBjb25uZWN0aW9uLmNoYW5uZWxzW2UudXNlcmlkXTsKKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIH0sCisgICAgICAgICAgICAgICAgb25lcnJvcjogZnVuY3Rpb24oZSkgeworICAgICAgICAgICAgICAgICAgICBlLmV4dHJhID0gX2NvbmZpZy5leHRyYTsKKyAgICAgICAgICAgICAgICAgICAgZS51c2VyaWQgPSBfY29uZmlnLnVzZXJpZDsKKyAgICAgICAgICAgICAgICAgICAgY29ubmVjdGlvbi5vbmVycm9yKGUpOworICAgICAgICAgICAgICAgIH0sCisKKyAgICAgICAgICAgICAgICBvbmljZWNvbm5lY3Rpb25zdGF0ZWNoYW5nZTogZnVuY3Rpb24oZXZlbnQpIHsKKyAgICAgICAgICAgICAgICAgICAgbG9nKCdvbmljZWNvbm5lY3Rpb25zdGF0ZWNoYW5nZScsIHRvU3RyKGV2ZW50KSk7CisKKyAgICAgICAgICAgICAgICAgICAgaWYgKHBlZXIuY29ubmVjdGlvbiAmJiBwZWVyLmNvbm5lY3Rpb24uaWNlQ29ubmVjdGlvblN0YXRlID09ICdjb25uZWN0ZWQnICYmIHBlZXIuY29ubmVjdGlvbi5pY2VHYXRoZXJpbmdTdGF0ZSA9PSAnY29tcGxldGUnICYmIHBlZXIuY29ubmVjdGlvbi5zaWduYWxpbmdTdGF0ZSA9PSAnc3RhYmxlJyAmJiBjb25uZWN0aW9uLm51bWJlck9mQ29ubmVjdGVkVXNlcnMgPT0gMSkgeworICAgICAgICAgICAgICAgICAgICAgICAgY29ubmVjdGlvbi5vbmNvbm5lY3RlZCh7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgdXNlcmlkOiBfY29uZmlnLnVzZXJpZCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBleHRyYTogX2NvbmZpZy5leHRyYSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBwZWVyOiBjb25uZWN0aW9uLnBlZXJzW19jb25maWcudXNlcmlkXSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB0YXJnZXR1c2VyOiBfY29uZmlnLnVzZXJpbmZvCisgICAgICAgICAgICAgICAgICAgICAgICB9KTsKKyAgICAgICAgICAgICAgICAgICAgfQorCisgICAgICAgICAgICAgICAgICAgIGlmICghY29ubmVjdGlvbi5pc0luaXRpYXRvciAmJiBwZWVyLmNvbm5lY3Rpb24gJiYgcGVlci5jb25uZWN0aW9uLmljZUNvbm5lY3Rpb25TdGF0ZSA9PSAnY29ubmVjdGVkJyAmJiBwZWVyLmNvbm5lY3Rpb24uaWNlR2F0aGVyaW5nU3RhdGUgPT0gJ2NvbXBsZXRlJyAmJiBwZWVyLmNvbm5lY3Rpb24uc2lnbmFsaW5nU3RhdGUgPT0gJ3N0YWJsZScgJiYgY29ubmVjdGlvbi5udW1iZXJPZkNvbm5lY3RlZFVzZXJzID09IDEpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIGNvbm5lY3Rpb24ub25zdGF0ZWNoYW5nZSh7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgdXNlcmlkOiBfY29uZmlnLnVzZXJpZCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBleHRyYTogX2NvbmZpZy5leHRyYSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBuYW1lOiAnY29ubmVjdGVkLXdpdGgtaW5pdGlhdG9yJywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICByZWFzb246ICdJQ0UgY29ubmVjdGlvbiBzdGF0ZSBzZWVtcyBjb25uZWN0ZWQ7IGdhdGhlcmluZyBzdGF0ZSBpcyBjb21wbGV0ZWQ7IGFuZCBzaWduYWxpbmcgc3RhdGUgaXMgc3RhYmxlLicKKyAgICAgICAgICAgICAgICAgICAgICAgIH0pOworICAgICAgICAgICAgICAgICAgICB9CisKKyAgICAgICAgICAgICAgICAgICAgaWYgKGNvbm5lY3Rpb24ucGVlcnNbX2NvbmZpZy51c2VyaWRdICYmIGNvbm5lY3Rpb24ucGVlcnNbX2NvbmZpZy51c2VyaWRdLm9uaWNlY29ubmVjdGlvbnN0YXRlY2hhbmdlKSB7CisgICAgICAgICAgICAgICAgICAgICAgICBjb25uZWN0aW9uLnBlZXJzW19jb25maWcudXNlcmlkXS5vbmljZWNvbm5lY3Rpb25zdGF0ZWNoYW5nZShldmVudCk7CisgICAgICAgICAgICAgICAgICAgIH0KKworICAgICAgICAgICAgICAgICAgICAvLyBpZiBJQ0UgY29ubmVjdGl2aXR5IGNoZWNrIGlzIGZhaWxlZDsgcmVuZWdvdGlhdGUgb3IgcmVkaWFsCisgICAgICAgICAgICAgICAgICAgIGlmIChjb25uZWN0aW9uLnBlZXJzW19jb25maWcudXNlcmlkXSAmJiBjb25uZWN0aW9uLnBlZXJzW19jb25maWcudXNlcmlkXS5wZWVyLmNvbm5lY3Rpb24uaWNlQ29ubmVjdGlvblN0YXRlID09ICdmYWlsZWQnKSB7CisgICAgICAgICAgICAgICAgICAgICAgICBjb25uZWN0aW9uLm9uZmFpbGVkKHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB1c2VyaWQ6IF9jb25maWcudXNlcmlkLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIGV4dHJhOiBfY29uZmlnLmV4dHJhLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBlZXI6IGNvbm5lY3Rpb24ucGVlcnNbX2NvbmZpZy51c2VyaWRdLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRhcmdldHVzZXI6IF9jb25maWcudXNlcmluZm8KKyAgICAgICAgICAgICAgICAgICAgICAgIH0pOworICAgICAgICAgICAgICAgICAgICB9CisKKyAgICAgICAgICAgICAgICAgICAgaWYgKGNvbm5lY3Rpb24ucGVlcnNbX2NvbmZpZy51c2VyaWRdICYmIGNvbm5lY3Rpb24ucGVlcnNbX2NvbmZpZy51c2VyaWRdLnBlZXIuY29ubmVjdGlvbi5pY2VDb25uZWN0aW9uU3RhdGUgPT0gJ2Rpc2Nvbm5lY3RlZCcpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICFwZWVyLmNvbm5lY3Rpb24ucmVuZWdvdGlhdGUgJiYgY29ubmVjdGlvbi5vbmRpc2Nvbm5lY3RlZCh7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgdXNlcmlkOiBfY29uZmlnLnVzZXJpZCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBleHRyYTogX2NvbmZpZy5leHRyYSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBwZWVyOiBjb25uZWN0aW9uLnBlZXJzW19jb25maWcudXNlcmlkXSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB0YXJnZXR1c2VyOiBfY29uZmlnLnVzZXJpbmZvCisgICAgICAgICAgICAgICAgICAgICAgICB9KTsKKyAgICAgICAgICAgICAgICAgICAgICAgIHBlZXIuY29ubmVjdGlvbi5yZW5lZ290aWF0ZSA9IGZhbHNlOworICAgICAgICAgICAgICAgICAgICB9CisKKyAgICAgICAgICAgICAgICAgICAgaWYgKCFjb25uZWN0aW9uLmF1dG9SZURpYWxPbkZhaWx1cmUpIHJldHVybjsKKworICAgICAgICAgICAgICAgICAgICBpZiAoY29ubmVjdGlvbi5wZWVyc1tfY29uZmlnLnVzZXJpZF0pIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIGlmIChjb25uZWN0aW9uLnBlZXJzW19jb25maWcudXNlcmlkXS5wZWVyLmNvbm5lY3Rpb24uaWNlQ29ubmVjdGlvblN0YXRlICE9ICdkaXNjb25uZWN0ZWQnKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgX2NvbmZpZy5yZWRpYWxpbmcgPSBmYWxzZTsKKyAgICAgICAgICAgICAgICAgICAgICAgIH0KKworICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGNvbm5lY3Rpb24ucGVlcnNbX2NvbmZpZy51c2VyaWRdLnBlZXIuY29ubmVjdGlvbi5pY2VDb25uZWN0aW9uU3RhdGUgPT0gJ2Rpc2Nvbm5lY3RlZCcgJiYgIV9jb25maWcucmVkaWFsaW5nKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgX2NvbmZpZy5yZWRpYWxpbmcgPSB0cnVlOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIHdhcm4oJ1BlZXIgY29ubmVjdGlvbiBpcyBjbG9zZWQuJywgdG9TdHIoY29ubmVjdGlvbi5wZWVyc1tfY29uZmlnLnVzZXJpZF0ucGVlci5jb25uZWN0aW9uKSwgJ1JlRGlhbGluZy4uJyk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgY29ubmVjdGlvbi5wZWVyc1tfY29uZmlnLnVzZXJpZF0uc29ja2V0LnNlbmQoeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZWRpYWw6IHRydWUKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB9KTsKKworICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vIHRvIG1ha2Ugc3VyZSBhbGwgb2xkICJyZW1vdGUiIHN0cmVhbXMgYXJlIGFsc28gcmVtb3ZlZCEKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb25uZWN0aW9uLnN0cmVhbXMucmVtb3ZlKHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmVtb3RlOiB0cnVlLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB1c2VyaWQ6IF9jb25maWcudXNlcmlkCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSk7CisgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICB9LAorCisgICAgICAgICAgICAgICAgb25zaWduYWxpbmdzdGF0ZWNoYW5nZTogZnVuY3Rpb24oZXZlbnQpIHsKKyAgICAgICAgICAgICAgICAgICAgbG9nKCdvbnNpZ25hbGluZ3N0YXRlY2hhbmdlJywgdG9TdHIoZXZlbnQpKTsKKyAgICAgICAgICAgICAgICB9LAorCisgICAgICAgICAgICAgICAgYXR0YWNoU3RyZWFtczogY29ubmVjdGlvbi5kb250QXR0YWNoU3RyZWFtID8gW10gOiBjb25uZWN0aW9uLmF0dGFjaFN0cmVhbXMsCisgICAgICAgICAgICAgICAgaWNlU2VydmVyczogY29ubmVjdGlvbi5pY2VTZXJ2ZXJzLAorICAgICAgICAgICAgICAgIHJ0Y0NvbmZpZ3VyYXRpb246IGNvbm5lY3Rpb24ucnRjQ29uZmlndXJhdGlvbiwKKyAgICAgICAgICAgICAgICBiYW5kd2lkdGg6IGNvbm5lY3Rpb24uYmFuZHdpZHRoLAorICAgICAgICAgICAgICAgIHNkcENvbnN0cmFpbnRzOiBjb25uZWN0aW9uLnNkcENvbnN0cmFpbnRzLAorICAgICAgICAgICAgICAgIG9wdGlvbmFsQXJndW1lbnQ6IGNvbm5lY3Rpb24ub3B0aW9uYWxBcmd1bWVudCwKKyAgICAgICAgICAgICAgICBkaXNhYmxlRHRsc1NydHA6IGNvbm5lY3Rpb24uZGlzYWJsZUR0bHNTcnRwLAorICAgICAgICAgICAgICAgIGRhdGFDaGFubmVsRGljdDogY29ubmVjdGlvbi5kYXRhQ2hhbm5lbERpY3QsCisgICAgICAgICAgICAgICAgcHJlZmVyU0NUUDogY29ubmVjdGlvbi5wcmVmZXJTQ1RQLAorCisgICAgICAgICAgICAgICAgb25TZXNzaW9uRGVzY3JpcHRpb246IGZ1bmN0aW9uKHNlc3Npb25EZXNjcmlwdGlvbiwgc3RyZWFtaW5mbykgeworICAgICAgICAgICAgICAgICAgICBzZW5kc2RwKHsKKyAgICAgICAgICAgICAgICAgICAgICAgIHNkcDogc2Vzc2lvbkRlc2NyaXB0aW9uLAorICAgICAgICAgICAgICAgICAgICAgICAgc29ja2V0OiBzb2NrZXQsCisgICAgICAgICAgICAgICAgICAgICAgICBzdHJlYW1pbmZvOiBzdHJlYW1pbmZvCisgICAgICAgICAgICAgICAgICAgIH0pOworICAgICAgICAgICAgICAgIH0sCisgICAgICAgICAgICAgICAgdHJpY2tsZUljZTogY29ubmVjdGlvbi50cmlja2xlSWNlLAorICAgICAgICAgICAgICAgIHByb2Nlc3NTZHA6IGNvbm5lY3Rpb24ucHJvY2Vzc1NkcCwKKyAgICAgICAgICAgICAgICBzZW5kU3RyZWFtSWQ6IGZ1bmN0aW9uKHN0cmVhbSkgeworICAgICAgICAgICAgICAgICAgICBzb2NrZXQgJiYgc29ja2V0LnNlbmQoeworICAgICAgICAgICAgICAgICAgICAgICAgc3RyZWFtaWQ6IHN0cmVhbS5zdHJlYW1pZCwKKyAgICAgICAgICAgICAgICAgICAgICAgIGlzU2NyZWVuOiAhIXN0cmVhbS5pc1NjcmVlbiwKKyAgICAgICAgICAgICAgICAgICAgICAgIGlzQXVkaW86ICEhc3RyZWFtLmlzQXVkaW8sCisgICAgICAgICAgICAgICAgICAgICAgICBpc1ZpZGVvOiAhIXN0cmVhbS5pc1ZpZGVvCisgICAgICAgICAgICAgICAgICAgIH0pOworICAgICAgICAgICAgICAgIH0sCisgICAgICAgICAgICAgICAgcnRjTXVsdGlDb25uZWN0aW9uOiBjb25uZWN0aW9uCisgICAgICAgICAgICB9OworCisgICAgICAgICAgICBmdW5jdGlvbiB3YWl0VW50aWxSZW1vdGVTdHJlYW1TdGFydHNGbG93aW5nKGFyZ3MpIHsKKyAgICAgICAgICAgICAgICAvLyBjaHJvbWUgZm9yIGFuZHJvaWQgbWF5IGhhdmUgc29tZSBmZWF0dXJlcyBtaXNzaW5nCisgICAgICAgICAgICAgICAgaWYgKGlzTW9iaWxlRGV2aWNlIHx8IGlzUGx1Z2luUlRDIHx8IChpc051bGwoY29ubmVjdGlvbi53YWl0VW50aWxSZW1vdGVTdHJlYW1TdGFydHNGbG93aW5nKSB8fCAhY29ubmVjdGlvbi53YWl0VW50aWxSZW1vdGVTdHJlYW1TdGFydHNGbG93aW5nKSkgeworICAgICAgICAgICAgICAgICAgICByZXR1cm4gYWZ0ZXJSZW1vdGVTdHJlYW1TdGFydGVkRmxvd2luZyhhcmdzKTsKKyAgICAgICAgICAgICAgICB9CisKKyAgICAgICAgICAgICAgICBpZiAoIWFyZ3MubnVtYmVyT2ZUaW1lcykgYXJncy5udW1iZXJPZlRpbWVzID0gMDsKKyAgICAgICAgICAgICAgICBhcmdzLm51bWJlck9mVGltZXMrKzsKKworICAgICAgICAgICAgICAgIGlmICghKGFyZ3MubWVkaWFFbGVtZW50LnJlYWR5U3RhdGUgPD0gSFRNTE1lZGlhRWxlbWVudC5IQVZFX0NVUlJFTlRfREFUQSB8fCBhcmdzLm1lZGlhRWxlbWVudC5wYXVzZWQgfHwgYXJncy5tZWRpYUVsZW1lbnQuY3VycmVudFRpbWUgPD0gMCkpIHsKKyAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGFmdGVyUmVtb3RlU3RyZWFtU3RhcnRlZEZsb3dpbmcoYXJncyk7CisgICAgICAgICAgICAgICAgfQorCisgICAgICAgICAgICAgICAgaWYgKGFyZ3MubnVtYmVyT2ZUaW1lcyA+PSA2MCkgeyAvLyB3YWl0IDYwIHNlY29uZHMgd2hpbGUgdmlkZW8gaXMgZGVsaXZlcmVkIQorICAgICAgICAgICAgICAgICAgICByZXR1cm4gc29ja2V0LnNlbmQoeworICAgICAgICAgICAgICAgICAgICAgICAgZmFpbGVkVG9SZWNlaXZlUmVtb3RlVmlkZW86IHRydWUsCisgICAgICAgICAgICAgICAgICAgICAgICBzdHJlYW1pZDogYXJncy5zdHJlYW0uc3RyZWFtaWQKKyAgICAgICAgICAgICAgICAgICAgfSk7CisgICAgICAgICAgICAgICAgfQorCisgICAgICAgICAgICAgICAgc2V0VGltZW91dChmdW5jdGlvbigpIHsKKyAgICAgICAgICAgICAgICAgICAgbG9nKCdXYWl0aW5nIGZvciBpbmNvbWluZyByZW1vdGUgc3RyZWFtIHRvIGJlIHN0YXJ0ZWQgZmxvd2luZzogJyArIGFyZ3MubnVtYmVyT2ZUaW1lcyArICcgc2Vjb25kcy4nKTsKKyAgICAgICAgICAgICAgICAgICAgd2FpdFVudGlsUmVtb3RlU3RyZWFtU3RhcnRzRmxvd2luZyhhcmdzKTsKKyAgICAgICAgICAgICAgICB9LCA5MDApOworICAgICAgICAgICAgfQorCisgICAgICAgICAgICBmdW5jdGlvbiBpbml0RmFrZUNoYW5uZWwoKSB7CisgICAgICAgICAgICAgICAgaWYgKCFjb25uZWN0aW9uLmZha2VEYXRhQ2hhbm5lbHMgfHwgY29ubmVjdGlvbi5jaGFubmVsc1tfY29uZmlnLnVzZXJpZF0pIHJldHVybjsKKworICAgICAgICAgICAgICAgIC8vIGZvciBub24tZGF0YSBjb25uZWN0aW9uczsgYWxsb3cgZmFrZSBkYXRhIHNlbmRlciEKKyAgICAgICAgICAgICAgICBpZiAoIWNvbm5lY3Rpb24uc2Vzc2lvbi5kYXRhKSB7CisgICAgICAgICAgICAgICAgICAgIHZhciBmYWtlQ2hhbm5lbCA9IHsKKyAgICAgICAgICAgICAgICAgICAgICAgIHNlbmQ6IGZ1bmN0aW9uKGRhdGEpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBzb2NrZXQuc2VuZCh7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZha2VEYXRhOiBkYXRhCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSk7CisgICAgICAgICAgICAgICAgICAgICAgICB9LAorICAgICAgICAgICAgICAgICAgICAgICAgcmVhZHlTdGF0ZTogJ29wZW4nCisgICAgICAgICAgICAgICAgICAgIH07CisgICAgICAgICAgICAgICAgICAgIC8vIGNvbm5lY3Rpb24uY2hhbm5lbHNbJ3VzZXItaWQnXS5zZW5kKGRhdGEpOworICAgICAgICAgICAgICAgICAgICBjb25uZWN0aW9uLmNoYW5uZWxzW19jb25maWcudXNlcmlkXSA9IHsKKyAgICAgICAgICAgICAgICAgICAgICAgIGNoYW5uZWw6IGZha2VDaGFubmVsLAorICAgICAgICAgICAgICAgICAgICAgICAgc2VuZDogZnVuY3Rpb24oZGF0YSkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRoaXMuY2hhbm5lbC5zZW5kKGRhdGEpOworICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICB9OworICAgICAgICAgICAgICAgICAgICBwZWVyQ29uZmlnLm9ub3BlbihmYWtlQ2hhbm5lbCk7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfQorCisgICAgICAgICAgICBmdW5jdGlvbiBhZnRlclJlbW90ZVN0cmVhbVN0YXJ0ZWRGbG93aW5nKGFyZ3MpIHsKKyAgICAgICAgICAgICAgICB2YXIgbWVkaWFFbGVtZW50ID0gYXJncy5tZWRpYUVsZW1lbnQ7CisgICAgICAgICAgICAgICAgdmFyIHNlc3Npb24gPSBhcmdzLnNlc3Npb247CisgICAgICAgICAgICAgICAgdmFyIHN0cmVhbSA9IGFyZ3Muc3RyZWFtOworCisgICAgICAgICAgICAgICAgc3RyZWFtLm9uZW5kZWQgPSBmdW5jdGlvbigpIHsKKyAgICAgICAgICAgICAgICAgICAgaWYgKHN0cmVhbWVkT2JqZWN0Lm1lZGlhRWxlbWVudCAmJiAhc3RyZWFtZWRPYmplY3QubWVkaWFFbGVtZW50LnBhcmVudE5vZGUgJiYgZG9jdW1lbnQuZ2V0RWxlbWVudEJ5SWQoc3RyZWFtLnN0cmVhbWlkKSkgeworICAgICAgICAgICAgICAgICAgICAgICAgc3RyZWFtZWRPYmplY3QubWVkaWFFbGVtZW50ID0gZG9jdW1lbnQuZ2V0RWxlbWVudEJ5SWQoc3RyZWFtLnN0cmVhbWlkKTsKKyAgICAgICAgICAgICAgICAgICAgfQorCisgICAgICAgICAgICAgICAgICAgIG9uU3RyZWFtRW5kZWRIYW5kbGVyKHN0cmVhbWVkT2JqZWN0LCBjb25uZWN0aW9uKTsKKyAgICAgICAgICAgICAgICB9OworCisgICAgICAgICAgICAgICAgdmFyIHN0cmVhbWVkT2JqZWN0ID0geworICAgICAgICAgICAgICAgICAgICBtZWRpYUVsZW1lbnQ6IG1lZGlhRWxlbWVudCwKKworICAgICAgICAgICAgICAgICAgICBzdHJlYW06IHN0cmVhbSwKKyAgICAgICAgICAgICAgICAgICAgc3RyZWFtaWQ6IHN0cmVhbS5zdHJlYW1pZCwKKyAgICAgICAgICAgICAgICAgICAgc2Vzc2lvbjogc2Vzc2lvbiB8fCBjb25uZWN0aW9uLnNlc3Npb24sCisKKyAgICAgICAgICAgICAgICAgICAgYmxvYlVSTDogaXNQbHVnaW5SVEMgPyAnJyA6IG1lZGlhRWxlbWVudC5tb3pTcmNPYmplY3QgPyBVUkwuY3JlYXRlT2JqZWN0VVJMKHN0cmVhbSkgOiBtZWRpYUVsZW1lbnQuc3JjLAorICAgICAgICAgICAgICAgICAgICB0eXBlOiAncmVtb3RlJywKKworICAgICAgICAgICAgICAgICAgICBleHRyYTogX2NvbmZpZy5leHRyYSwKKyAgICAgICAgICAgICAgICAgICAgdXNlcmlkOiBfY29uZmlnLnVzZXJpZCwKKworICAgICAgICAgICAgICAgICAgICBpc1ZpZGVvOiBpc1BsdWdpblJUQyA/ICEhc2Vzc2lvbi52aWRlbyA6ICEhc3RyZWFtLmlzVmlkZW8sCisgICAgICAgICAgICAgICAgICAgIGlzQXVkaW86IGlzUGx1Z2luUlRDID8gISFzZXNzaW9uLmF1ZGlvICYmICFzZXNzaW9uLnZpZGVvIDogISFzdHJlYW0uaXNBdWRpbywKKyAgICAgICAgICAgICAgICAgICAgaXNTY3JlZW46ICEhc3RyZWFtLmlzU2NyZWVuLAorICAgICAgICAgICAgICAgICAgICBpc0luaXRpYXRvcjogISFfY29uZmlnLmlzSW5pdGlhdG9yLAorCisgICAgICAgICAgICAgICAgICAgIHJ0Y011bHRpQ29ubmVjdGlvbjogY29ubmVjdGlvbiwKKyAgICAgICAgICAgICAgICAgICAgc29ja2V0OiBzb2NrZXQKKyAgICAgICAgICAgICAgICB9OworCisgICAgICAgICAgICAgICAgLy8gY29ubmVjdGlvbi5zdHJlYW1zWydzdHJlYW0taWQnXS5tdXRlKHthdWRpbzp0cnVlfSkKKyAgICAgICAgICAgICAgICBjb25uZWN0aW9uLnN0cmVhbXNbc3RyZWFtLnN0cmVhbWlkXSA9IGNvbm5lY3Rpb24uX2dldFN0cmVhbShzdHJlYW1lZE9iamVjdCk7CisgICAgICAgICAgICAgICAgY29ubmVjdGlvbi5vbnN0cmVhbShzdHJlYW1lZE9iamVjdCk7CisKKyAgICAgICAgICAgICAgICBpZiAoIWlzRW1wdHkoYXJncy5wcmVNdXRlZCkgJiYgKGFyZ3MucHJlTXV0ZWQuYXVkaW8gfHwgYXJncy5wcmVNdXRlZC52aWRlbykpIHsKKyAgICAgICAgICAgICAgICAgICAgdmFyIGZha2VPYmplY3QgPSBtZXJnZSh7fSwgc3RyZWFtZWRPYmplY3QpOworICAgICAgICAgICAgICAgICAgICBmYWtlT2JqZWN0LnNlc3Npb24gPSBtZXJnZShmYWtlT2JqZWN0LnNlc3Npb24sIGFyZ3MucHJlTXV0ZWQpOworCisgICAgICAgICAgICAgICAgICAgIGZha2VPYmplY3QuaXNBdWRpbyA9ICEhZmFrZU9iamVjdC5zZXNzaW9uLmF1ZGlvICYmICFmYWtlT2JqZWN0LnNlc3Npb24udmlkZW87CisgICAgICAgICAgICAgICAgICAgIGZha2VPYmplY3QuaXNWaWRlbyA9ICEhZmFrZU9iamVjdC5zZXNzaW9uLnZpZGVvOworICAgICAgICAgICAgICAgICAgICBmYWtlT2JqZWN0LmlzU2NyZWVuID0gZmFsc2U7CisKKyAgICAgICAgICAgICAgICAgICAgY29ubmVjdGlvbi5vbm11dGUoZmFrZU9iamVjdCk7CisgICAgICAgICAgICAgICAgfQorCisgICAgICAgICAgICAgICAgbG9nKCdvbjphZGQ6c3RyZWFtJywgc3RyZWFtZWRPYmplY3QpOworCisgICAgICAgICAgICAgICAgb25TZXNzaW9uT3BlbmVkKCk7CisKKyAgICAgICAgICAgICAgICBpZiAoY29ubmVjdGlvbi5vbnNwZWFraW5nKSB7CisgICAgICAgICAgICAgICAgICAgIGluaXRIYXJrKHsKKyAgICAgICAgICAgICAgICAgICAgICAgIHN0cmVhbTogc3RyZWFtLAorICAgICAgICAgICAgICAgICAgICAgICAgc3RyZWFtZWRPYmplY3Q6IHN0cmVhbWVkT2JqZWN0LAorICAgICAgICAgICAgICAgICAgICAgICAgY29ubmVjdGlvbjogY29ubmVjdGlvbgorICAgICAgICAgICAgICAgICAgICB9KTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9CisKKyAgICAgICAgICAgIGZ1bmN0aW9uIG9uQ2hhbm5lbE9wZW5lZChjaGFubmVsKSB7CisgICAgICAgICAgICAgICAgX2NvbmZpZy5jaGFubmVsID0gY2hhbm5lbDsKKworICAgICAgICAgICAgICAgIC8vIGNvbm5lY3Rpb24uY2hhbm5lbHNbJ3VzZXItaWQnXS5zZW5kKGRhdGEpOworICAgICAgICAgICAgICAgIGNvbm5lY3Rpb24uY2hhbm5lbHNbX2NvbmZpZy51c2VyaWRdID0geworICAgICAgICAgICAgICAgICAgICBjaGFubmVsOiBfY29uZmlnLmNoYW5uZWwsCisgICAgICAgICAgICAgICAgICAgIHNlbmQ6IGZ1bmN0aW9uKGRhdGEpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIGNvbm5lY3Rpb24uc2VuZChkYXRhLCB0aGlzLmNoYW5uZWwpOworICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgfTsKKworICAgICAgICAgICAgICAgIGNvbm5lY3Rpb24ub25vcGVuKHsKKyAgICAgICAgICAgICAgICAgICAgZXh0cmE6IF9jb25maWcuZXh0cmEsCisgICAgICAgICAgICAgICAgICAgIHVzZXJpZDogX2NvbmZpZy51c2VyaWQsCisgICAgICAgICAgICAgICAgICAgIGNoYW5uZWw6IGNoYW5uZWwKKyAgICAgICAgICAgICAgICB9KTsKKworICAgICAgICAgICAgICAgIC8vIGZldGNoIGZpbGVzIGZyb20gZmlsZS1xdWV1ZQorICAgICAgICAgICAgICAgIGZvciAodmFyIHEgaW4gY29ubmVjdGlvbi5maWxlUXVldWUpIHsKKyAgICAgICAgICAgICAgICAgICAgY29ubmVjdGlvbi5zZW5kKGNvbm5lY3Rpb24uZmlsZVF1ZXVlW3FdLCBjaGFubmVsKTsKKyAgICAgICAgICAgICAgICB9CisKKyAgICAgICAgICAgICAgICBpZiAoaXNEYXRhKGNvbm5lY3Rpb24uc2Vzc2lvbikpIG9uU2Vzc2lvbk9wZW5lZCgpOworCisgICAgICAgICAgICAgICAgaWYgKGNvbm5lY3Rpb24ucGFydE9mU2NyZWVuICYmIGNvbm5lY3Rpb24ucGFydE9mU2NyZWVuLnNoYXJpbmcpIHsKKyAgICAgICAgICAgICAgICAgICAgY29ubmVjdGlvbi5wZWVyc1tfY29uZmlnLnVzZXJpZF0uc2hhcmVQYXJ0T2ZTY3JlZW4oY29ubmVjdGlvbi5wYXJ0T2ZTY3JlZW4pOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0KKworICAgICAgICAgICAgZnVuY3Rpb24gdXBkYXRlU29ja2V0KCkgeworICAgICAgICAgICAgICAgIC8vIHRvZG86IG5lZWQgdG8gY2hlY2sgZm9sbG93aW5nIHtpZi1ibG9ja30gTVVTVCBub3QgYWZmZWN0ICJyZWRpYWwiIHByb2Nlc3MKKyAgICAgICAgICAgICAgICBpZiAoc29ja2V0LnVzZXJpZCA9PSBfY29uZmlnLnVzZXJpZCkKKyAgICAgICAgICAgICAgICAgICAgcmV0dXJuOworCisgICAgICAgICAgICAgICAgc29ja2V0LnVzZXJpZCA9IF9jb25maWcudXNlcmlkOworICAgICAgICAgICAgICAgIHNvY2tldHNbX2NvbmZpZy5zb2NrZXRJbmRleF0gPSBzb2NrZXQ7CisKKyAgICAgICAgICAgICAgICBjb25uZWN0aW9uLm51bWJlck9mQ29ubmVjdGVkVXNlcnMrKzsKKyAgICAgICAgICAgICAgICAvLyBjb25uZWN0aW9uLnBlZXJzWyd1c2VyLWlkJ10uYWRkU3RyZWFtKHthdWRpbzp0cnVlfSkKKyAgICAgICAgICAgICAgICBjb25uZWN0aW9uLnBlZXJzW19jb25maWcudXNlcmlkXSA9IHsKKyAgICAgICAgICAgICAgICAgICAgc29ja2V0OiBzb2NrZXQsCisgICAgICAgICAgICAgICAgICAgIHBlZXI6IHBlZXIsCisgICAgICAgICAgICAgICAgICAgIHVzZXJpZDogX2NvbmZpZy51c2VyaWQsCisgICAgICAgICAgICAgICAgICAgIGV4dHJhOiBfY29uZmlnLmV4dHJhLAorICAgICAgICAgICAgICAgICAgICB1c2VyaW5mbzogX2NvbmZpZy51c2VyaW5mbywKKyAgICAgICAgICAgICAgICAgICAgYWRkU3RyZWFtOiBmdW5jdGlvbihzZXNzaW9uMDApIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIC8vIGNvbm5lY3Rpb24ucGVlcnNbJ3VzZXItaWQnXS5hZGRTdHJlYW0oe2F1ZGlvOiB0cnVlLCB2aWRlbzogdHJ1ZSk7CisKKyAgICAgICAgICAgICAgICAgICAgICAgIGNvbm5lY3Rpb24uYWRkU3RyZWFtKHNlc3Npb24wMCwgdGhpcy5zb2NrZXQpOworICAgICAgICAgICAgICAgICAgICB9LAorICAgICAgICAgICAgICAgICAgICByZW1vdmVTdHJlYW06IGZ1bmN0aW9uKHN0cmVhbWlkKSB7CisgICAgICAgICAgICAgICAgICAgICAgICBpZiAoIWNvbm5lY3Rpb24uc3RyZWFtc1tzdHJlYW1pZF0pCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHdhcm4oJ05vIHN1Y2ggc3RyZWFtIGV4aXN0cy4gU3RyZWFtLWlkOicsIHN0cmVhbWlkKTsKKworICAgICAgICAgICAgICAgICAgICAgICAgdGhpcy5wZWVyLmNvbm5lY3Rpb24ucmVtb3ZlU3RyZWFtKGNvbm5lY3Rpb24uc3RyZWFtc1tzdHJlYW1pZF0uc3RyZWFtKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIHRoaXMucmVuZWdvdGlhdGUoKTsKKyAgICAgICAgICAgICAgICAgICAgfSwKKyAgICAgICAgICAgICAgICAgICAgcmVuZWdvdGlhdGU6IGZ1bmN0aW9uKHN0cmVhbSwgc2Vzc2lvbikgeworICAgICAgICAgICAgICAgICAgICAgICAgLy8gY29ubmVjdGlvbi5wZWVyc1sndXNlci1pZCddLnJlbmVnb3RpYXRlKCk7CisKKyAgICAgICAgICAgICAgICAgICAgICAgIGNvbm5lY3Rpb24ucmVuZWdvdGlhdGUoc3RyZWFtLCBzZXNzaW9uKTsKKyAgICAgICAgICAgICAgICAgICAgfSwKKyAgICAgICAgICAgICAgICAgICAgY2hhbmdlQmFuZHdpZHRoOiBmdW5jdGlvbihiYW5kd2lkdGgpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIC8vIGNvbm5lY3Rpb24ucGVlcnNbJ3VzZXItaWQnXS5jaGFuZ2VCYW5kd2lkdGgoKTsKKworICAgICAgICAgICAgICAgICAgICAgICAgaWYgKCFiYW5kd2lkdGgpIHRocm93ICdZb3UgTVVTVCBwYXNzIGJhbmR3aWR0aCBvYmplY3QuJzsKKyAgICAgICAgICAgICAgICAgICAgICAgIGlmIChpc1N0cmluZyhiYW5kd2lkdGgpKSB0aHJvdyAnUGFzcyBvYmplY3QgZm9yIGJhbmR3aWR0aCBpbnN0ZWFkIG9mIHN0cmluZzsgZS5nLiB7YXVkaW86MTAsIHZpZGVvOjIwfSc7CisKKyAgICAgICAgICAgICAgICAgICAgICAgIC8vIHNldCBiYW5kd2lkdGggZm9yIHNlbGYKKyAgICAgICAgICAgICAgICAgICAgICAgIHRoaXMucGVlci5iYW5kd2lkdGggPSBiYW5kd2lkdGg7CisKKyAgICAgICAgICAgICAgICAgICAgICAgIC8vIGFzayByZW1vdGUgdXNlciB0byBzeW5jaHJvbml6ZSBiYW5kd2lkdGgKKyAgICAgICAgICAgICAgICAgICAgICAgIHRoaXMuc29ja2V0LnNlbmQoeworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNoYW5nZUJhbmR3aWR0aDogdHJ1ZSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBiYW5kd2lkdGg6IGJhbmR3aWR0aAorICAgICAgICAgICAgICAgICAgICAgICAgfSk7CisgICAgICAgICAgICAgICAgICAgIH0sCisgICAgICAgICAgICAgICAgICAgIHNlbmRDdXN0b21NZXNzYWdlOiBmdW5jdGlvbihtZXNzYWdlKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAvLyBjb25uZWN0aW9uLnBlZXJzWyd1c2VyLWlkJ10uc2VuZEN1c3RvbU1lc3NhZ2UoKTsKKworICAgICAgICAgICAgICAgICAgICAgICAgdGhpcy5zb2NrZXQuc2VuZCh7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgY3VzdG9tTWVzc2FnZTogdHJ1ZSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBtZXNzYWdlOiBtZXNzYWdlCisgICAgICAgICAgICAgICAgICAgICAgICB9KTsKKyAgICAgICAgICAgICAgICAgICAgfSwKKyAgICAgICAgICAgICAgICAgICAgb25DdXN0b21NZXNzYWdlOiBmdW5jdGlvbihtZXNzYWdlKSB7CisgICAgICAgICAgICAgICAgICAgICAgICBsb2coJ1JlY2VpdmVkICJwcml2YXRlIiBtZXNzYWdlIGZyb20nLCB0aGlzLnVzZXJpZCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBpc1N0cmluZyhtZXNzYWdlKSA/IG1lc3NhZ2UgOiB0b1N0cihtZXNzYWdlKSk7CisgICAgICAgICAgICAgICAgICAgIH0sCisgICAgICAgICAgICAgICAgICAgIGRyb3A6IGZ1bmN0aW9uKGRvbnRTZW5kTWVzc2FnZSkgeworICAgICAgICAgICAgICAgICAgICAgICAgLy8gY29ubmVjdGlvbi5wZWVyc1sndXNlci1pZCddLmRyb3AoKTsKKworICAgICAgICAgICAgICAgICAgICAgICAgZm9yICh2YXIgc3RyZWFtIGluIGNvbm5lY3Rpb24uc3RyZWFtcykgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChjb25uZWN0aW9uLl9za2lwLmluZGV4T2Yoc3RyZWFtKSA9PSAtMSkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzdHJlYW0gPSBjb25uZWN0aW9uLnN0cmVhbXNbc3RyZWFtXTsKKworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoc3RyZWFtLnVzZXJpZCA9PSBjb25uZWN0aW9uLnVzZXJpZCAmJiBzdHJlYW0udHlwZSA9PSAnbG9jYWwnKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0aGlzLnBlZXIuY29ubmVjdGlvbi5yZW1vdmVTdHJlYW0oc3RyZWFtLnN0cmVhbSk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBvblN0cmVhbUVuZGVkSGFuZGxlcihzdHJlYW0sIGNvbm5lY3Rpb24pOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CisKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHN0cmVhbS50eXBlID09ICdyZW1vdGUnICYmIHN0cmVhbS51c2VyaWQgPT0gdGhpcy51c2VyaWQpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG9uU3RyZWFtRW5kZWRIYW5kbGVyKHN0cmVhbSwgY29ubmVjdGlvbik7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICB9CisKKyAgICAgICAgICAgICAgICAgICAgICAgICFkb250U2VuZE1lc3NhZ2UgJiYgdGhpcy5zb2NrZXQuc2VuZCh7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgZHJvcDogdHJ1ZQorICAgICAgICAgICAgICAgICAgICAgICAgfSk7CisgICAgICAgICAgICAgICAgICAgIH0sCisgICAgICAgICAgICAgICAgICAgIGhvbGQ6IGZ1bmN0aW9uKGhvbGRNTGluZSkgeworICAgICAgICAgICAgICAgICAgICAgICAgLy8gY29ubmVjdGlvbi5wZWVyc1sndXNlci1pZCddLmhvbGQoKTsKKworICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHBlZXIucHJldkNyZWF0ZVR5cGUgPT0gJ2Fuc3dlcicpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB0aGlzLnNvY2tldC5zZW5kKHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdW5ob2xkOiB0cnVlLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBob2xkTUxpbmU6IGhvbGRNTGluZSB8fCAnYm90aCcsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRha2VBY3Rpb246IHRydWUKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB9KTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm47CisgICAgICAgICAgICAgICAgICAgICAgICB9CisKKyAgICAgICAgICAgICAgICAgICAgICAgIHRoaXMuc29ja2V0LnNlbmQoeworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGhvbGQ6IHRydWUsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgaG9sZE1MaW5lOiBob2xkTUxpbmUgfHwgJ2JvdGgnCisgICAgICAgICAgICAgICAgICAgICAgICB9KTsKKworICAgICAgICAgICAgICAgICAgICAgICAgdGhpcy5wZWVyLmhvbGQgPSB0cnVlOworICAgICAgICAgICAgICAgICAgICAgICAgdGhpcy5maXJlSG9sZFVuSG9sZEV2ZW50cyh7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAga2luZDogaG9sZE1MaW5lLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlzSG9sZDogdHJ1ZSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB1c2VyaWQ6IGNvbm5lY3Rpb24udXNlcmlkLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJlbW90ZVVzZXI6IHRoaXMudXNlcmlkCisgICAgICAgICAgICAgICAgICAgICAgICB9KTsKKyAgICAgICAgICAgICAgICAgICAgfSwKKyAgICAgICAgICAgICAgICAgICAgdW5ob2xkOiBmdW5jdGlvbihob2xkTUxpbmUpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIC8vIGNvbm5lY3Rpb24ucGVlcnNbJ3VzZXItaWQnXS51bmhvbGQoKTsKKworICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHBlZXIucHJldkNyZWF0ZVR5cGUgPT0gJ2Fuc3dlcicpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB0aGlzLnNvY2tldC5zZW5kKHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdW5ob2xkOiB0cnVlLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBob2xkTUxpbmU6IGhvbGRNTGluZSB8fCAnYm90aCcsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRha2VBY3Rpb246IHRydWUKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB9KTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm47CisgICAgICAgICAgICAgICAgICAgICAgICB9CisKKyAgICAgICAgICAgICAgICAgICAgICAgIHRoaXMuc29ja2V0LnNlbmQoeworICAgICAgICAgICAgICAgICAgICAgICAgICAgIHVuaG9sZDogdHJ1ZSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBob2xkTUxpbmU6IGhvbGRNTGluZSB8fCAnYm90aCcKKyAgICAgICAgICAgICAgICAgICAgICAgIH0pOworCisgICAgICAgICAgICAgICAgICAgICAgICB0aGlzLnBlZXIuaG9sZCA9IGZhbHNlOworICAgICAgICAgICAgICAgICAgICAgICAgdGhpcy5maXJlSG9sZFVuSG9sZEV2ZW50cyh7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAga2luZDogaG9sZE1MaW5lLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlzSG9sZDogZmFsc2UsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgdXNlcmlkOiBjb25uZWN0aW9uLnVzZXJpZCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICByZW1vdGVVc2VyOiB0aGlzLnVzZXJpZAorICAgICAgICAgICAgICAgICAgICAgICAgfSk7CisgICAgICAgICAgICAgICAgICAgIH0sCisgICAgICAgICAgICAgICAgICAgIGZpcmVIb2xkVW5Ib2xkRXZlbnRzOiBmdW5jdGlvbihlKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAvLyB0aGlzIG1ldGhvZCBpcyBmb3IgaW5uZXIgdXNhZ2VzIG9ubHkhCisKKyAgICAgICAgICAgICAgICAgICAgICAgIHZhciBpc0hvbGQgPSBlLmlzSG9sZDsKKyAgICAgICAgICAgICAgICAgICAgICAgIHZhciBraW5kID0gZS5raW5kOworICAgICAgICAgICAgICAgICAgICAgICAgdmFyIHVzZXJpZCA9IGUucmVtb3RlVXNlciB8fCBlLnVzZXJpZDsKKworICAgICAgICAgICAgICAgICAgICAgICAgLy8gaG9sZCBtZWFucyBpbmFjdGl2ZSBhIHNwZWNpZmljIG1lZGlhIGxpbmUhCisgICAgICAgICAgICAgICAgICAgICAgICAvLyBhIG1lZGlhIGxpbmUgY2FuIGNvbnRhaW4gbXVsdGlwbGUgc3luY2VkIHNvdXJjZXMgKHNzcmMpCisgICAgICAgICAgICAgICAgICAgICAgICAvLyBpLmUuIGEgbWVkaWEgbGluZSBjYW4gcmVmZXJlbmNlIG11bHRpcGxlIHRyYWNrcyEKKyAgICAgICAgICAgICAgICAgICAgICAgIC8vIHRoYXQncyB3aHkgaG9sZCB3aWxsIGFmZmVjdCBhbGwgcmVsZXZhbnQgdHJhY2tzIGluIGEgc3BlY2lmaWMgbWVkaWEgbGluZSEKKyAgICAgICAgICAgICAgICAgICAgICAgIGZvciAodmFyIHN0cmVhbSBpbiBjb25uZWN0aW9uLnN0cmVhbXMpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoY29ubmVjdGlvbi5fc2tpcC5pbmRleE9mKHN0cmVhbSkgPT0gLTEpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc3RyZWFtID0gY29ubmVjdGlvbi5zdHJlYW1zW3N0cmVhbV07CisKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHN0cmVhbS51c2VyaWQgPT0gdXNlcmlkKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyB3d3cuUlRDTXVsdGlDb25uZWN0aW9uLm9yZy9kb2NzL29uaG9sZC8KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChpc0hvbGQpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY29ubmVjdGlvbi5vbmhvbGQobWVyZ2UoeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBraW5kOiBraW5kCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSwgc3RyZWFtKSk7CisKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vIHd3dy5SVENNdWx0aUNvbm5lY3Rpb24ub3JnL2RvY3Mvb251bmhvbGQvCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoIWlzSG9sZCkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb25uZWN0aW9uLm9udW5ob2xkKG1lcmdlKHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAga2luZDoga2luZAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0sIHN0cmVhbSkpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICB9LAorICAgICAgICAgICAgICAgICAgICByZWRpYWw6IGZ1bmN0aW9uKCkgeworICAgICAgICAgICAgICAgICAgICAgICAgLy8gY29ubmVjdGlvbi5wZWVyc1sndXNlci1pZCddLnJlZGlhbCgpOworCisgICAgICAgICAgICAgICAgICAgICAgICAvLyAxc3Qgb2YgYWxsOyByZW1vdmUgYWxsIHJlbGV2YW50IHJlbW90ZSBtZWRpYSBzdHJlYW1zCisgICAgICAgICAgICAgICAgICAgICAgICBmb3IgKHZhciBzdHJlYW0gaW4gY29ubmVjdGlvbi5zdHJlYW1zKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGNvbm5lY3Rpb24uX3NraXAuaW5kZXhPZihzdHJlYW0pID09IC0xKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHN0cmVhbSA9IGNvbm5lY3Rpb24uc3RyZWFtc1tzdHJlYW1dOworCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChzdHJlYW0udXNlcmlkID09IHRoaXMudXNlcmlkICYmIHN0cmVhbS50eXBlID09ICdyZW1vdGUnKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBvblN0cmVhbUVuZGVkSGFuZGxlcihzdHJlYW0sIGNvbm5lY3Rpb24pOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgfQorCisgICAgICAgICAgICAgICAgICAgICAgICBsb2coJ1JlRGlhbGluZy4uLicpOworCisgICAgICAgICAgICAgICAgICAgICAgICBzb2NrZXQuc2VuZCh7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmVjcmVhdGVQZWVyOiB0cnVlCisgICAgICAgICAgICAgICAgICAgICAgICB9KTsKKworICAgICAgICAgICAgICAgICAgICAgICAgcGVlciA9IG5ldyBQZWVyQ29ubmVjdGlvbigpOworICAgICAgICAgICAgICAgICAgICAgICAgcGVlci5jcmVhdGUoJ29mZmVyJywgcGVlckNvbmZpZyk7CisgICAgICAgICAgICAgICAgICAgIH0sCisgICAgICAgICAgICAgICAgICAgIHNoYXJlUGFydE9mU2NyZWVuOiBmdW5jdGlvbihhcmdzKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAvLyB3d3cuUlRDTXVsdGlDb25uZWN0aW9uLm9yZy9kb2NzL29ucGFydG9mc2NyZWVuLworICAgICAgICAgICAgICAgICAgICAgICAgdmFyIHRoYXQgPSB0aGlzOworICAgICAgICAgICAgICAgICAgICAgICAgdmFyIGxhc3RTY3JlZW5zaG90ID0gJyc7CisKKyAgICAgICAgICAgICAgICAgICAgICAgIGZ1bmN0aW9uIHBhcnRPZlNjcmVlbkNhcHR1cmVyKCkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vIGlmIHN0b3BwZWQKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAodGhhdC5zdG9wUGFydE9mU2NyZWVuU2hhcmluZykgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0aGF0LnN0b3BQYXJ0T2ZTY3JlZW5TaGFyaW5nID0gZmFsc2U7CisKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGNvbm5lY3Rpb24ub25wYXJ0b2ZzY3JlZW5zdG9wcGVkKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb25uZWN0aW9uLm9ucGFydG9mc2NyZWVuc3RvcHBlZCgpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybjsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CisKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyBpZiBwYXVzZWQKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAodGhhdC5wYXVzZVBhcnRPZlNjcmVlblNoYXJpbmcpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGNvbm5lY3Rpb24ub25wYXJ0b2ZzY3JlZW5wYXVzZWQpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbm5lY3Rpb24ub25wYXJ0b2ZzY3JlZW5wYXVzZWQoKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQorCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBzZXRUaW1lb3V0KHBhcnRPZlNjcmVlbkNhcHR1cmVyLCBhcmdzLmludGVydmFsIHx8IDIwMCk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQorCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgY2FwdHVyZVBhcnRPZlNjcmVlbih7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGVsZW1lbnQ6IGFyZ3MuZWxlbWVudCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY29ubmVjdGlvbjogY29ubmVjdGlvbiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY2FsbGJhY2s6IGZ1bmN0aW9uKHNjcmVlbnNob3QpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICghY29ubmVjdGlvbi5jaGFubmVsc1t0aGF0LnVzZXJpZF0pIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0aHJvdyAnTm8gc3VjaCBkYXRhIGNoYW5uZWwgZXhpc3RzLic7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CisKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vIGRvbid0IHNoYXJlIHJlcGVhdGVkIGNvbnRlbnQKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChzY3JlZW5zaG90ICE9IGxhc3RTY3JlZW5zaG90KSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbGFzdFNjcmVlbnNob3QgPSBzY3JlZW5zaG90OworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbm5lY3Rpb24uY2hhbm5lbHNbdGhhdC51c2VyaWRdLnNlbmQoeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzY3JlZW5zaG90OiBzY3JlZW5zaG90LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpc1BhcnRPZlNjcmVlbjogdHJ1ZQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0pOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQorCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyAib25jZSIgY2FuIGJlIHVzZWQgdG8gc2hhcmUgc2luZ2xlIHNjcmVlbnNob3QKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICFhcmdzLm9uY2UgJiYgc2V0VGltZW91dChwYXJ0T2ZTY3JlZW5DYXB0dXJlciwgYXJncy5pbnRlcnZhbCB8fCAyMDApOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSk7CisgICAgICAgICAgICAgICAgICAgICAgICB9CisKKyAgICAgICAgICAgICAgICAgICAgICAgIHBhcnRPZlNjcmVlbkNhcHR1cmVyKCk7CisgICAgICAgICAgICAgICAgICAgIH0sCisgICAgICAgICAgICAgICAgICAgIGdldENvbm5lY3Rpb25TdGF0czogZnVuY3Rpb24oY2FsbGJhY2ssIGludGVydmFsKSB7CisgICAgICAgICAgICAgICAgICAgICAgICBpZiAoIWNhbGxiYWNrKSB0aHJvdyAnY2FsbGJhY2sgaXMgbWFuZGF0b3J5Lic7CisKKyAgICAgICAgICAgICAgICAgICAgICAgIGlmICghd2luZG93LmdldENvbm5lY3Rpb25TdGF0cykgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxvYWRTY3JpcHQoY29ubmVjdGlvbi5yZXNvdXJjZXMuZ2V0Q29ubmVjdGlvblN0YXRzLCBpbnZva2VyKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSBpbnZva2VyKCk7CisKKyAgICAgICAgICAgICAgICAgICAgICAgIGZ1bmN0aW9uIGludm9rZXIoKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgUlRDUGVlckNvbm5lY3Rpb24ucHJvdG90eXBlLmdldENvbm5lY3Rpb25TdGF0cyA9IHdpbmRvdy5nZXRDb25uZWN0aW9uU3RhdHM7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgcGVlci5jb25uZWN0aW9uICYmIHBlZXIuY29ubmVjdGlvbi5nZXRDb25uZWN0aW9uU3RhdHMoY2FsbGJhY2ssIGludGVydmFsKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgfSwKKyAgICAgICAgICAgICAgICAgICAgdGFrZVNuYXBzaG90OiBmdW5jdGlvbihjYWxsYmFjaykgeworICAgICAgICAgICAgICAgICAgICAgICAgdGFrZVNuYXBzaG90KHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB1c2VyaWQ6IHRoaXMudXNlcmlkLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbm5lY3Rpb246IGNvbm5lY3Rpb24sCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgY2FsbGJhY2s6IGNhbGxiYWNrCisgICAgICAgICAgICAgICAgICAgICAgICB9KTsKKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIH07CisgICAgICAgICAgICB9CisKKyAgICAgICAgICAgIGZ1bmN0aW9uIG9uU2Vzc2lvbk9wZW5lZCgpIHsKKyAgICAgICAgICAgICAgICAvLyBvcmlnaW5hbCBjb25mZXJlbmNpbmcgaW5mcmFzdHJ1Y3R1cmUhCisgICAgICAgICAgICAgICAgaWYgKGNvbm5lY3Rpb24uaXNJbml0aWF0b3IgJiYgZ2V0TGVuZ3RoKHBhcnRpY2lwYW50cykgJiYgZ2V0TGVuZ3RoKHBhcnRpY2lwYW50cykgPD0gY29ubmVjdGlvbi5tYXhQYXJ0aWNpcGFudHNBbGxvd2VkKSB7CisgICAgICAgICAgICAgICAgICAgIGlmICghY29ubmVjdGlvbi5zZXNzaW9uLm9uZXdheSAmJiAhY29ubmVjdGlvbi5zZXNzaW9uLmJyb2FkY2FzdCkgeworICAgICAgICAgICAgICAgICAgICAgICAgZGVmYXVsdFNvY2tldC5zZW5kKHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBzZXNzaW9uaWQ6IGNvbm5lY3Rpb24uc2Vzc2lvbmlkLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIG5ld1BhcnRpY2lwYW50OiBfY29uZmlnLnVzZXJpZCB8fCBzb2NrZXQuY2hhbm5lbCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB1c2VyRGF0YTogeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB1c2VyaWQ6IF9jb25maWcudXNlcmlkIHx8IHNvY2tldC5jaGFubmVsLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBleHRyYTogX2NvbmZpZy5leHRyYQorICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgIH0pOworICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgfQorCisgICAgICAgICAgICAgICAgLy8gMXN0OiByZW5lZ290aWF0aW9uIGlzIHN1cHBvcnRlZCBvbmx5IG9uIGNocm9tZQorICAgICAgICAgICAgICAgIC8vIDJuZDogbXVzdCBub3QgcmVuZWdvdGlhdGUgc2FtZSBtZWRpYSBtdWx0aXBsZ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ICAgIH0KKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9CisKKyAgICAgICAgICAgIGZ1bmN0aW9uIHNvY2tldFJlc3BvbnNlKHJlc3BvbnNlKSB7CisgICAgICAgICAgICAgICAgaWYgKGlzUk1TRGVsZXRlZCkgcmV0dXJuOworCisgICAgICAgICAgICAgICAgaWYgKHJlc3BvbnNlLnVzZXJpZCA9PSBjb25uZWN0aW9uLnVzZXJpZCkKKyAgICAgICAgICAgICAgICAgICAgcmV0dXJuOworCisgICAgICAgICAgICAgICAgaWYgKHJlc3BvbnNlLnNkcCkgeworICAgICAgICAgICAgICAgICAgICBfY29uZmlnLnVzZXJpZCA9IHJlc3BvbnNlLnVzZXJpZDsKKyAgICAgICAgICAgICAgICAgICAgX2NvbmZpZy5leHRyYSA9IHJlc3BvbnNlLmV4dHJhIHx8IHt9OworICAgICAgICAgICAgICAgICAgICBfY29uZmlnLnJlbmVnb3RpYXRlID0gcmVzcG9uc2UucmVuZWdvdGlhdGU7CisgICAgICAgICAgICAgICAgICAgIF9jb25maWcuc3RyZWFtaW5mbyA9IHJlc3BvbnNlLnN0cmVhbWluZm87CisgICAgICAgICAgICAgICAgICAgIF9jb25maWcuaXNJbml0aWF0b3IgPSByZXNwb25zZS5pc0luaXRpYXRvcjsKKyAgICAgICAgICAgICAgICAgICAgX2NvbmZpZy51c2VyaW5mbyA9IHJlc3BvbnNlLnVzZXJpbmZvOworCisgICAgICAgICAgICAgICAgICAgIHZhciBzZHAgPSBKU09OLnBhcnNlKHJlc3BvbnNlLnNkcCk7CisKKyAgICAgICAgICAgICAgICAgICAgaWYgKHNkcC50eXBlID09ICdvZmZlcicpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIC8vIHRvIHN5bmNocm9uaXplIFNDVFAgb3IgUlRQCisgICAgICAgICAgICAgICAgICAgICAgICBwZWVyQ29uZmlnLnByZWZlclNDVFAgPSAhIXJlc3BvbnNlLnByZWZlclNDVFA7CisgICAgICAgICAgICAgICAgICAgICAgICBjb25uZWN0aW9uLmZha2VEYXRhQ2hhbm5lbHMgPSAhIXJlc3BvbnNlLmZha2VEYXRhQ2hhbm5lbHM7CisgICAgICAgICAgICAgICAgICAgIH0KKworICAgICAgICAgICAgICAgICAgICAvLyBpbml0aWFsaXppbmcgZmFrZSBjaGFubmVsCisgICAgICAgICAgICAgICAgICAgIGluaXRGYWtlQ2hhbm5lbCgpOworCisgICAgICAgICAgICAgICAgICAgIHNkcEludm9rZXIoc2RwLCByZXNwb25zZS5sYWJlbHMpOworICAgICAgICAgICAgICAgIH0KKworICAgICAgICAgICAgICAgIGlmIChyZXNwb25zZS5jYW5kaWRhdGUpIHsKKyAgICAgICAgICAgICAgICAgICAgcGVlciAmJiBwZWVyLmFkZEljZUNhbmRpZGF0ZShKU09OLnBhcnNlKHJlc3BvbnNlLmNhbmRpZGF0ZSkpOworICAgICAgICAgICAgICAgIH0KKworICAgICAgICAgICAgICAgIGlmIChyZXNwb25zZS5zdHJlYW1pZCkgeworICAgICAgICAgICAgICAgICAgICBpZiAoIXJ0Y011bHRpU2Vzc2lvbi5zdHJlYW1pZHMpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIHJ0Y011bHRpU2Vzc2lvbi5zdHJlYW1pZHMgPSB7fTsKKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICBpZiAoIXJ0Y011bHRpU2Vzc2lvbi5zdHJlYW1pZHNbcmVzcG9uc2Uuc3RyZWFtaWRdKSB7CisgICAgICAgICAgICAgICAgICAgICAgICBydGNNdWx0aVNlc3Npb24uc3RyZWFtaWRzW3Jlc3BvbnNlLnN0cmVhbWlkXSA9IHJlc3BvbnNlLnN0cmVhbWlkOworICAgICAgICAgICAgICAgICAgICAgICAgY29ubmVjdGlvbi5vbnN0cmVhbWlkKHJlc3BvbnNlKTsKKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIH0KKworICAgICAgICAgICAgICAgIGlmIChyZXNwb25zZS5tdXRlIHx8IHJlc3BvbnNlLnVubXV0ZSkgeworICAgICAgICAgICAgICAgICAgICBpZiAocmVzcG9uc2UucHJvbXB0TXV0ZVVubXV0ZSkgeworICAgICAgICAgICAgICAgICAgICAgICAgaWYgKCFjb25uZWN0aW9uLnByaXZpbGVnZXMuY2FuTXV0ZVJlbW90ZVN0cmVhbSkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbm5lY3Rpb24ub25zdGF0ZWNoYW5nZSh7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHVzZXJpZDogcmVzcG9uc2UudXNlcmlkLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBleHRyYTogcmVzcG9uc2UuZXh0cmEsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG5hbWU6ICdtdXRlLXJlcXVlc3QtZGVuaWVkJywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmVhc29uOiByZXNwb25zZS51c2VyaWQgKyAnIHRyaWVkIHRvIG11dGUgeW91ciBzdHJlYW07IGhvd2V2ZXIgInByaXZpbGVnZXMuY2FuTXV0ZVJlbW90ZVN0cmVhbSIgaXMgImZhbHNlIi4nCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuOworICAgICAgICAgICAgICAgICAgICAgICAgfQorCisgICAgICAgICAgICAgICAgICAgICAgICBpZiAoY29ubmVjdGlvbi5zdHJlYW1zW3Jlc3BvbnNlLnN0cmVhbWlkXSkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChyZXNwb25zZS5tdXRlICYmICFjb25uZWN0aW9uLnN0cmVhbXNbcmVzcG9uc2Uuc3RyZWFtaWRdLm11dGVkKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbm5lY3Rpb24uc3RyZWFtc1tyZXNwb25zZS5zdHJlYW1pZF0ubXV0ZShyZXNwb25zZS5zZXNzaW9uKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHJlc3BvbnNlLnVubXV0ZSAmJiBjb25uZWN0aW9uLnN0cmVhbXNbcmVzcG9uc2Uuc3RyZWFtaWRdLm11dGVkKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbm5lY3Rpb24uc3RyZWFtc1tyZXNwb25zZS5zdHJlYW1pZF0udW5tdXRlKHJlc3BvbnNlLnNlc3Npb24pOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIHZhciBzdHJlYW1PYmplY3QgPSB7fTsKKyAgICAgICAgICAgICAgICAgICAgICAgIGlmIChjb25uZWN0aW9uLnN0cmVhbXNbcmVzcG9uc2Uuc3RyZWFtaWRdKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgc3RyZWFtT2JqZWN0ID0gY29ubmVjdGlvbi5zdHJlYW1zW3Jlc3BvbnNlLnN0cmVhbWlkXTsKKyAgICAgICAgICAgICAgICAgICAgICAgIH0KKworICAgICAgICAgICAgICAgICAgICAgICAgdmFyIHNlc3Npb24gPSByZXNwb25zZS5zZXNzaW9uOworICAgICAgICAgICAgICAgICAgICAgICAgdmFyIGZha2VPYmplY3QgPSBtZXJnZSh7fSwgc3RyZWFtT2JqZWN0KTsKKyAgICAgICAgICAgICAgICAgICAgICAgIGZha2VPYmplY3Quc2Vzc2lvbiA9IHNlc3Npb247CisKKyAgICAgICAgICAgICAgICAgICAgICAgIGZha2VPYmplY3QuaXNBdWRpbyA9ICEhZmFrZU9iamVjdC5zZXNzaW9uLmF1ZGlvICYmICFmYWtlT2JqZWN0LnNlc3Npb24udmlkZW87CisgICAgICAgICAgICAgICAgICAgICAgICBmYWtlT2JqZWN0LmlzVmlkZW8gPSAhIWZha2VPYmplY3Quc2Vzc2lvbi52aWRlbzsKKyAgICAgICAgICAgICAgICAgICAgICAgIGZha2VPYmplY3QuaXNTY3JlZW4gPSAhIWZha2VPYmplY3Quc2Vzc2lvbi5zY3JlZW47CisKKyAgICAgICAgICAgICAgICAgICAgICAgIGlmIChyZXNwb25zZS5tdXRlKSBjb25uZWN0aW9uLm9ubXV0ZShmYWtlT2JqZWN0IHx8IHJlc3BvbnNlKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIGlmIChyZXNwb25zZS51bm11dGUpIGNvbm5lY3Rpb24ub251bm11dGUoZmFrZU9iamVjdCB8fCByZXNwb25zZSk7CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICB9CisKKyAgICAgICAgICAgICAgICBpZiAocmVzcG9uc2UuaXNWb2x1bWVDaGFuZ2VkKSB7CisgICAgICAgICAgICAgICAgICAgIGxvZygnVm9sdW1lIG9mIHN0cmVhbTogJyArIHJlc3BvbnNlLnN0cmVhbWlkICsgJyBoYXMgY2hhbmdlZCB0bzogJyArIHJlc3BvbnNlLnZvbHVtZSk7CisgICAgICAgICAgICAgICAgICAgIGlmIChjb25uZWN0aW9uLnN0cmVhbXNbcmVzcG9uc2Uuc3RyZWFtaWRdKSB7CisgICAgICAgICAgICAgICAgICAgICAgICB2YXIgbWVkaWFFbGVtZW50ID0gY29ubmVjdGlvbi5zdHJlYW1zW3Jlc3BvbnNlLnN0cmVhbWlkXS5tZWRpYUVsZW1lbnQ7CisgICAgICAgICAgICAgICAgICAgICAgICBpZiAobWVkaWFFbGVtZW50KSBtZWRpYUVsZW1lbnQudm9sdW1lID0gcmVzcG9uc2Uudm9sdW1lOworICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgfQorCisgICAgICAgICAgICAgICAgLy8gdG8gc3RvcCBsb2NhbCBzdHJlYW0KKyAgICAgICAgICAgICAgICBpZiAocmVzcG9uc2Uuc3RvcHBlZCkgeworICAgICAgICAgICAgICAgICAgICBpZiAoY29ubmVjdGlvbi5zdHJlYW1zW3Jlc3BvbnNlLnN0cmVhbWlkXSkgeworICAgICAgICAgICAgICAgICAgICAgICAgb25TdHJlYW1FbmRlZEhhbmRsZXIoY29ubmVjdGlvbi5zdHJlYW1zW3Jlc3BvbnNlLnN0cmVhbWlkXSwgY29ubmVjdGlvbik7CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICB9CisKKyAgICAgICAgICAgICAgICAvLyB0byBzdG9wIHJlbW90ZSBzdHJlYW0KKyAgICAgICAgICAgICAgICBpZiAocmVzcG9uc2UucHJvbXB0U3RyZWFtU3RvcCAvKiAmJiAhY29ubmVjdGlvbi5pc0luaXRpYXRvciAqLyApIHsKKyAgICAgICAgICAgICAgICAgICAgaWYgKCFjb25uZWN0aW9uLnByaXZpbGVnZXMuY2FuU3RvcFJlbW90ZVN0cmVhbSkgeworICAgICAgICAgICAgICAgICAgICAgICAgY29ubmVjdGlvbi5vbnN0YXRlY2hhbmdlKHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB1c2VyaWQ6IHJlc3BvbnNlLnVzZXJpZCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBleHRyYTogcmVzcG9uc2UuZXh0cmEsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgbmFtZTogJ3N0b3AtcmVxdWVzdC1kZW5pZWQnLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJlYXNvbjogcmVzcG9uc2UudXNlcmlkICsgJyB0cmllZCB0byBzdG9wIHlvdXIgc3RyZWFtOyBob3dldmVyICJwcml2aWxlZ2VzLmNhblN0b3BSZW1vdGVTdHJlYW0iIGlzICJmYWxzZSIuJworICAgICAgICAgICAgICAgICAgICAgICAgfSk7CisgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm47CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgd2FybignUmVtb3RlIHN0cmVhbSBoYXMgYmVlbiBtYW51YWxseSBzdG9wcGVkIScpOworICAgICAgICAgICAgICAgICAgICBpZiAoY29ubmVjdGlvbi5zdHJlYW1zW3Jlc3BvbnNlLnN0cmVhbWlkXSkgeworICAgICAgICAgICAgICAgICAgICAgICAgY29ubmVjdGlvbi5zdHJlYW1zW3Jlc3BvbnNlLnN0cmVhbWlkXS5zdG9wKCk7CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICB9CisKKyAgICAgICAgICAgICAgICBpZiAocmVzcG9uc2UubGVmdCkgeworICAgICAgICAgICAgICAgICAgICAvLyBmaXJlZm94IGlzIHVuYWJsZSB0byBzdG9wIHJlbW90ZSBzdHJlYW1zCisgICAgICAgICAgICAgICAgICAgIC8vIGZpcmVmb3ggZG9lc24ndCBhdXRvIHN0b3Agc3RyZWFtcyB3aGVuIHBlZXIuY2xvc2UoKSBpcyBjYWxsZWQuCisgICAgICAgICAgICAgICAgICAgIGlmIChpc0ZpcmVmb3gpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIHZhciB1c2VyTGVmdCA9IHJlc3BvbnNlLnVzZXJpZDsKKyAgICAgICAgICAgICAgICAgICAgICAgIGZvciAodmFyIHN0cmVhbSBpbiBjb25uZWN0aW9uLnN0cmVhbXMpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBzdHJlYW0gPSBjb25uZWN0aW9uLnN0cmVhbXNbc3RyZWFtXTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoc3RyZWFtLnVzZXJpZCA9PSB1c2VyTGVmdCkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb25uZWN0aW9uLnN0b3BNZWRpYVN0cmVhbShzdHJlYW0pOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBvblN0cmVhbUVuZGVkSGFuZGxlcihzdHJlYW0sIGNvbm5lY3Rpb24pOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgfQorCisgICAgICAgICAgICAgICAgICAgIGlmIChwZWVyICYmIHBlZXIuY29ubmVjdGlvbikgeworICAgICAgICAgICAgICAgICAgICAgICAgLy8gdG9kbzogdmVyaWZ5IGlmLWJsb2NrJ3MgMm5kIGNvbmRpdGlvbgorICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHBlZXIuY29ubmVjdGlvbi5zaWduYWxpbmdTdGF0ZSAhPSAnY2xvc2VkJyAmJiBwZWVyLmNvbm5lY3Rpb24uaWNlQ29ubmVjdGlvblN0YXRlLnNlYXJjaCgvZGlzY29ubmVjdGVkfGZhaWxlZC9naSkgPT0gLTEpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBwZWVyLmNvbm5lY3Rpb24uY2xvc2UoKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgIHBlZXIuY29ubmVjdGlvbiA9IG51bGw7CisgICAgICAgICAgICAgICAgICAgIH0KKworICAgICAgICAgICAgICAgICAgICBpZiAocGFydGljaXBhbnRzW3Jlc3BvbnNlLnVzZXJpZF0pIGRlbGV0ZSBwYXJ0aWNpcGFudHNbcmVzcG9uc2UudXNlcmlkXTsKKworICAgICAgICAgICAgICAgICAgICBpZiAocmVzcG9uc2UuY2xvc2VFbnRpcmVTZXNzaW9uKSB7CisgICAgICAgICAgICAgICAgICAgICAgICBjb25uZWN0aW9uLm9uU2Vzc2lvbkNsb3NlZChyZXNwb25zZSk7CisgICAgICAgICAgICAgICAgICAgICAgICBjb25uZWN0aW9uLmxlYXZlKCk7CisgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm47CisgICAgICAgICAgICAgICAgICAgIH0KKworICAgICAgICAgICAgICAgICAgICBjb25uZWN0aW9uLnJlbW92ZShyZXNwb25zZS51c2VyaWQpOworCisgICAgICAgICAgICAgICAgICAgIG9uTGVhdmVIYW5kbGVyKHsKKyAgICAgICAgICAgICAgICAgICAgICAgIHVzZXJpZDogcmVzcG9uc2UudXNlcmlkLAorICAgICAgICAgICAgICAgICAgICAgICAgZXh0cmE6IHJlc3BvbnNlLmV4dHJhIHx8IHt9LAorICAgICAgICAgICAgICAgICAgICAgICAgZW50aXJlU2Vzc2lvbkNsb3NlZDogISFyZXNwb25zZS5jbG9zZUVudGlyZVNlc3Npb24KKyAgICAgICAgICAgICAgICAgICAgfSwgY29ubmVjdGlvbik7CisgICAgICAgICAgICAgICAgfQorCisgICAgICAgICAgICAgICAgLy8ga2VlcGluZyBzZXNzaW9uIGFjdGl2ZSBldmVuIGlmIGluaXRpYXRvciBsZWF2ZXMKKyAgICAgICAgICAgICAgICBpZiAocmVzcG9uc2UucGxheVJvbGVPZkJyb2FkY2FzdGVyKSB7CisgICAgICAgICAgICAgICAgICAgIGlmIChyZXNwb25zZS5leHRyYSkgeworICAgICAgICAgICAgICAgICAgICAgICAgLy8gY2xvbmUgZXh0cmEtZGF0YSBmcm9tIGluaXRpYWwgbW9kZXJhdG9yCisgICAgICAgICAgICAgICAgICAgICAgICBjb25uZWN0aW9uLmV4dHJhID0gbWVyZ2UoY29ubmVjdGlvbi5leHRyYSwgcmVzcG9uc2UuZXh0cmEpOworICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgIGlmIChyZXNwb25zZS5wYXJ0aWNpcGFudHMpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIHBhcnRpY2lwYW50cyA9IHJlc3BvbnNlLnBhcnRpY2lwYW50czsKKworICAgICAgICAgICAgICAgICAgICAgICAgLy8gbWFrZSBzdXJlIHRoYXQgaWYgMm5kIGluaXRpYXRvciBsZWF2ZXM7IGNvbnRyb2wgaXMgc2hpZnRlZCB0byAzcmQgcGVyc29uLgorICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHBhcnRpY2lwYW50c1tjb25uZWN0aW9uLnVzZXJpZF0pIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBkZWxldGUgcGFydGljaXBhbnRzW2Nvbm5lY3Rpb24udXNlcmlkXTsKKyAgICAgICAgICAgICAgICAgICAgICAgIH0KKworICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHNvY2tldHNbMF0gJiYgc29ja2V0c1swXS51c2VyaWQgPT0gcmVzcG9uc2UudXNlcmlkKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgZGVsZXRlIHNvY2tldHNbMF07CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgc29ja2V0cyA9IHN3YXAoc29ja2V0cyk7CisgICAgICAgICAgICAgICAgICAgICAgICB9CisKKyAgICAgICAgICAgICAgICAgICAgICAgIGlmIChzb2NrZXRPYmplY3RzW3Jlc3BvbnNlLnVzZXJpZF0pIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBkZWxldGUgc29ja2V0T2JqZWN0c1tyZXNwb25zZS51c2VyaWRdOworICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICB9CisKKyAgICAgICAgICAgICAgICAgICAgc2V0VGltZW91dChjb25uZWN0aW9uLnBsYXlSb2xlT2ZJbml0aWF0b3IsIDIwMDApOworICAgICAgICAgICAgICAgIH0KKworICAgICAgICAgICAgICAgIGlmIChyZXNwb25zZS5jaGFuZ2VCYW5kd2lkdGgpIHsKKyAgICAgICAgICAgICAgICAgICAgaWYgKCFjb25uZWN0aW9uLnBlZXJzW3Jlc3BvbnNlLnVzZXJpZF0pIHRocm93ICdObyBzdWNoIHBlZXIgZXhpc3RzLic7CisKKyAgICAgICAgICAgICAgICAgICAgLy8gc3luY2hyb25pemUgYmFuZHdpZHRoCisgICAgICAgICAgICAgICAgICAgIGNvbm5lY3Rpb24ucGVlcnNbcmVzcG9uc2UudXNlcmlkXS5wZWVyLmJhbmR3aWR0aCA9IHJlc3BvbnNlLmJhbmR3aWR0aDsKKworICAgICAgICAgICAgICAgICAgICAvLyByZW5lZ290aWF0ZSB0byBhcHBseSBiYW5kd2lkdGgKKyAgICAgICAgICAgICAgICAgICAgY29ubmVjdGlvbi5wZWVyc1tyZXNwb25zZS51c2VyaWRdLnJlbmVnb3RpYXRlKCk7CisgICAgICAgICAgICAgICAgfQorCisgICAgICAgICAgICAgICAgaWYgKHJlc3BvbnNlLmN1c3RvbU1lc3NhZ2UpIHsKKyAgICAgICAgICAgICAgICAgICAgaWYgKCFjb25uZWN0aW9uLnBlZXJzW3Jlc3BvbnNlLnVzZXJpZF0pIHRocm93ICdObyBzdWNoIHBlZXIgZXhpc3RzLic7CisgICAgICAgICAgICAgICAgICAgIGlmIChyZXNwb25zZS5tZXNzYWdlLmVqZWN0ZWQpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIGlmIChjb25uZWN0aW9uLnNlc3Npb25EZXNjcmlwdGlvbnNbY29ubmVjdGlvbi5zZXNzaW9uaWRdLnVzZXJpZCAhPSByZXNwb25zZS51c2VyaWQpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB0aHJvdyAnb25seSBpbml0aWF0b3IgY2FuIGVqZWN0IGEgdXNlci4nOworICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgLy8gaW5pdGlhdG9yIGVqZWN0ZWQgdGhpcyB1c2VyCisgICAgICAgICAgICAgICAgICAgICAgICBjb25uZWN0aW9uLmxlYXZlKCk7CisKKyAgICAgICAgICAgICAgICAgICAgICAgIGNvbm5lY3Rpb24ub25TZXNzaW9uQ2xvc2VkKHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB1c2VyaWQ6IHJlc3BvbnNlLnVzZXJpZCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBleHRyYTogcmVzcG9uc2UuZXh0cmEgfHwgX2NvbmZpZy5leHRyYSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBpc0VqZWN0ZWQ6IHRydWUKKyAgICAgICAgICAgICAgICAgICAgICAgIH0pOworICAgICAgICAgICAgICAgICAgICB9IGVsc2UgY29ubmVjdGlvbi5wZWVyc1tyZXNwb25zZS51c2VyaWRdLm9uQ3VzdG9tTWVzc2FnZShyZXNwb25zZS5tZXNzYWdlKTsKKyAgICAgICAgICAgICAgICB9CisKKyAgICAgICAgICAgICAgICBpZiAocmVzcG9uc2UuZHJvcCkgeworICAgICAgICAgICAgICAgICAgICBpZiAoIWNvbm5lY3Rpb24ucGVlcnNbcmVzcG9uc2UudXNlcmlkXSkgdGhyb3cgJ05vIHN1Y2ggcGVlciBleGlzdHMuJzsKKyAgICAgICAgICAgICAgICAgICAgY29ubmVjdGlvbi5wZWVyc1tyZXNwb25zZS51c2VyaWRdLmRyb3AodHJ1ZSk7CisgICAgICAgICAgICAgICAgICAgIGNvbm5lY3Rpb24ucGVlcnNbcmVzcG9uc2UudXNlcmlkXS5yZW5lZ290aWF0ZSgpOworCisgICAgICAgICAgICAgICAgICAgIGNvbm5lY3Rpb24ub25kcm9wKHJlc3BvbnNlLnVzZXJpZCk7CisgICAgICAgICAgICAgICAgfQorCisgICAgICAgICAgICAgICAgaWYgKHJlc3BvbnNlLmhvbGQgfHwgcmVzcG9uc2UudW5ob2xkKSB7CisgICAgICAgICAgICAgICAgICAgIGlmICghY29ubmVjdGlvbi5wZWVyc1tyZXNwb25zZS51c2VyaWRdKSB0aHJvdyAnTm8gc3VjaCBwZWVyIGV4aXN0cy4nOworCisgICAgICAgICAgICAgICAgICAgIGlmIChyZXNwb25zZS50YWtlQWN0aW9uKSB7CisgICAgICAgICAgICAgICAgICAgICAgICBjb25uZWN0aW9uLnBlZXJzW3Jlc3BvbnNlLnVzZXJpZF1bISFyZXNwb25zZS5ob2xkID8gJ2hvbGQnIDogJ3VuaG9sZCddKHJlc3BvbnNlLmhvbGRNTGluZSk7CisgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm47CisgICAgICAgICAgICAgICAgICAgIH0KKworICAgICAgICAgICAgICAgICAgICBjb25uZWN0aW9uLnBlZXJzW3Jlc3BvbnNlLnVzZXJpZF0ucGVlci5ob2xkID0gISFyZXNwb25zZS5ob2xkOworICAgICAgICAgICAgICAgICAgICBjb25uZWN0aW9uLnBlZXJzW3Jlc3BvbnNlLnVzZXJpZF0ucGVlci5ob2xkTUxpbmUgPSByZXNwb25zZS5ob2xkTUxpbmU7CisKKyAgICAgICAgICAgICAgICAgICAgc29ja2V0LnNlbmQoeworICAgICAgICAgICAgICAgICAgICAgICAgaXNSZW5lZ290aWF0ZTogdHJ1ZQorICAgICAgICAgICAgICAgICAgICB9KTsKKworICAgICAgICAgICAgICAgICAgICBjb25uZWN0aW9uLnBlZXJzW3Jlc3BvbnNlLnVzZXJpZF0uZmlyZUhvbGRVbkhvbGRFdmVudHMoeworICAgICAgICAgICAgICAgICAgICAgICAga2luZDogcmVzcG9uc2UuaG9sZE1MaW5lLAorICAgICAgICAgICAgICAgICAgICAgICAgaXNIb2xkOiAhIXJlc3BvbnNlLmhvbGQsCisgICAgICAgICAgICAgICAgICAgICAgICB1c2VyaWQ6IHJlc3BvbnNlLnVzZXJpZAorICAgICAgICAgICAgICAgICAgICB9KTsKKyAgICAgICAgICAgICAgICB9CisKKyAgICAgICAgICAgICAgICBpZiAocmVzcG9uc2UuaXNSZW5lZ290aWF0ZSkgeworICAgICAgICAgICAgICAgICAgICBjb25uZWN0aW9uLnBlZXJzW3Jlc3BvbnNlLnVzZXJpZF0ucmVuZWdvdGlhdGUobnVsbCwgY29ubmVjdGlvbi5wZWVyc1tyZXNwb25zZS51c2VyaWRdLnBlZXIuc2Vzc2lvbik7CisgICAgICAgICAgICAgICAgfQorCisgICAgICAgICAgICAgICAgLy8gZmFrZSBkYXRhIGNoYW5uZWxzIQorICAgICAgICAgICAgICAgIGlmIChyZXNwb25zZS5mYWtlRGF0YSkgeworICAgICAgICAgICAgICAgICAgICBwZWVyQ29uZmlnLm9ubWVzc2FnZShyZXNwb25zZS5mYWtlRGF0YSk7CisgICAgICAgICAgICAgICAgfQorCisgICAgICAgICAgICAgICAgLy8gc29tZXRpbWVzIHdlIGRvbid0IG5lZWQgdG8gcmVuZWdvdGlhdGUgZS5nLiB3aGVuIHBlZXJzIGFyZSBkaXNjb25uZWN0ZWQKKyAgICAgICAgICAgICAgICAvLyBvciBpZiBpdCBpcyBmaXJlZm94CisgICAgICAgICAgICAgICAgaWYgKHJlc3BvbnNlLnJlY3JlYXRlUGVlcikgeworICAgICAgICAgICAgICAgICAgICBwZWVyID0gbmV3IFBlZXJDb25uZWN0aW9uKCk7CisgICAgICAgICAgICAgICAgfQorCisgICAgICAgICAgICAgICAgLy8gcmVtb3RlIHZpZGVvIGZhaWxlZCBlaXRoZXIgb3V0IG9mIElDRSBnYXRoZXJpbmcgcHJvY2VzcyBvciBJQ0UgY29ubmVjdGl2aXR5IGNoZWNrLXVwCisgICAgICAgICAgICAgICAgLy8gb3IgSWNlQWdlbnQgd2FzIHVuYWJsZSB0byBsb2NhdGUgdmFsaWQgY2FuZGlkYXRlcy9wb3J0cy4KKyAgICAgICAgICAgICAgICBpZiAocmVzcG9uc2UuZmFpbGVkVG9SZWNlaXZlUmVtb3RlVmlkZW8pIHsKKyAgICAgICAgICAgICAgICAgICAgbG9nKCdSZW1vdGUgcGVlciBoYXNuXCd0IHJlY2VpdmVkIHN0cmVhbTogJyArIHJlc3BvbnNlLnN0cmVhbWlkICsgJy4gUmVuZWdvdGlhdGluZy4uLicpOworICAgICAgICAgICAgICAgICAgICBpZiAoY29ubmVjdGlvbi5wZWVyc1tyZXNwb25zZS51c2VyaWRdKSB7CisgICAgICAgICAgICAgICAgICAgICAgICBjb25uZWN0aW9uLnBlZXJzW3Jlc3BvbnNlLnVzZXJpZF0ucmVuZWdvdGlhdGUoKTsKKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIH0KKworICAgICAgICAgICAgICAgIGlmIChyZXNwb25zZS5yZWRpYWwpIHsKKyAgICAgICAgICAgICAgICAgICAgaWYgKGNvbm5lY3Rpb24ucGVlcnNbcmVzcG9uc2UudXNlcmlkXSkgeworICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGNvbm5lY3Rpb24ucGVlcnNbcmVzcG9uc2UudXNlcmlkXS5wZWVyLmNvbm5lY3Rpb24uaWNlQ29ubmVjdGlvblN0YXRlICE9ICdkaXNjb25uZWN0ZWQnKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgX2NvbmZpZy5yZWRpYWxpbmcgPSBmYWxzZTsKKyAgICAgICAgICAgICAgICAgICAgICAgIH0KKworICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGNvbm5lY3Rpb24ucGVlcnNbcmVzcG9uc2UudXNlcmlkXS5wZWVyLmNvbm5lY3Rpb24uaWNlQ29ubmVjdGlvblN0YXRlID09ICdkaXNjb25uZWN0ZWQnICYmICFfY29uZmlnLnJlZGlhbGluZykgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgIF9jb25maWcucmVkaWFsaW5nID0gdHJ1ZTsKKworICAgICAgICAgICAgICAgICAgICAgICAgICAgIHdhcm4oJ1BlZXIgY29ubmVjdGlvbiBpcyBjbG9zZWQuJywgdG9TdHIoY29ubmVjdGlvbi5wZWVyc1tyZXNwb25zZS51c2VyaWRdLnBlZXIuY29ubmVjdGlvbiksICdSZURpYWxpbmcuLicpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbm5lY3Rpb24ucGVlcnNbcmVzcG9uc2UudXNlcmlkXS5yZWRpYWwoKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0KKworICAgICAgICAgICAgY29ubmVjdGlvbi5wbGF5Um9sZU9mSW5pdGlhdG9yID0gZnVuY3Rpb24oKSB7CisgICAgICAgICAgICAgICAgY29ubmVjdGlvbi5kb250Q2FwdHVyZVVzZXJNZWRpYSA9IHRydWU7CisgICAgICAgICAgICAgICAgY29ubmVjdGlvbi5vcGVuKCk7CisgICAgICAgICAgICAgICAgc29ja2V0cyA9IHN3YXAoc29ja2V0cyk7CisgICAgICAgICAgICAgICAgY29ubmVjdGlvbi5kb250Q2FwdHVyZVVzZXJNZWRpYSA9IGZhbHNlOworICAgICAgICAgICAgfTsKKworICAgICAgICAgICAgY29ubmVjdGlvbi5hc2tUb1NoYXJlUGFydGljaXBhbnRzID0gZnVuY3Rpb24oKSB7CisgICAgICAgICAgICAgICAgZGVmYXVsdFNvY2tldCAmJiBkZWZhdWx0U29ja2V0LnNlbmQoeworICAgICAgICAgICAgICAgICAgICBhc2tUb1NoYXJlUGFydGljaXBhbnRzOiB0cnVlCisgICAgICAgICAgICAgICAgfSk7CisgICAgICAgICAgICB9OworCisgICAgICAgICAgICBjb25uZWN0aW9uLnNoYXJlUGFydGljaXBhbnRzID0gZnVuY3Rpb24oYXJncykgeworICAgICAgICAgICAgICAgIHZhciBtZXNzYWdlID0geworICAgICAgICAgICAgICAgICAgICBqb2luVXNlcnM6IHBhcnRpY2lwYW50cywKKyAgICAgICAgICAgICAgICAgICAgdXNlcmlkOiBjb25uZWN0aW9uLnVzZXJpZCwKKyAgICAgICAgICAgICAgICAgICAgZXh0cmE6IGNvbm5lY3Rpb24uZXh0cmEKKyAgICAgICAgICAgICAgICB9OworCisgICAgICAgICAgICAgICAgaWYgKGFyZ3MpIHsKKyAgICAgICAgICAgICAgICAgICAgaWYgKGFyZ3MuZG9udFNoYXJlV2l0aCkgbWVzc2FnZS5kb250U2hhcmVXaXRoID0gYXJncy5kb250U2hhcmVXaXRoOworICAgICAgICAgICAgICAgICAgICBpZiAoYXJncy5zaGFyZVdpdGgpIG1lc3NhZ2Uuc2hhcmVXaXRoID0gYXJncy5zaGFyZVdpdGg7CisgICAgICAgICAgICAgICAgfQorCisgICAgICAgICAgICAgICAgZGVmYXVsdFNvY2tldC5zZW5kKG1lc3NhZ2UpOworICAgICAgICAgICAgfTsKKworICAgICAgICAgICAgZnVuY3Rpb24gc2RwSW52b2tlcihzZHAsIGxhYmVscykgeworICAgICAgICAgICAgICAgIGlmIChzZHAudHlwZSA9PSAnYW5zd2VyJykgeworICAgICAgICAgICAgICAgICAgICBwZWVyLnNldFJlbW90ZURlc2NyaXB0aW9uKHNkcCk7CisgICAgICAgICAgICAgICAgICAgIHVwZGF0ZVNvY2tldCgpOworICAgICAgICAgICAgICAgICAgICByZXR1cm47CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIGlmICghX2NvbmZpZy5yZW5lZ290aWF0ZSAmJiBzZHAudHlwZSA9PSAnb2ZmZXInKSB7CisgICAgICAgICAgICAgICAgICAgIHBlZXJDb25maWcub2ZmZXJEZXNjcmlwdGlvbiA9IHNkcDsKKworICAgICAgICAgICAgICAgICAgICBwZWVyQ29uZmlnLnNlc3Npb24gPSBjb25uZWN0aW9uLnNlc3Npb247CisgICAgICAgICAgICAgICAgICAgIGlmICghcGVlcikgcGVlciA9IG5ldyBQZWVyQ29ubmVjdGlvbigpOworICAgICAgICAgICAgICAgICAgICBwZWVyLmNyZWF0ZSgnYW5zd2VyJywgcGVlckNvbmZpZyk7CisKKyAgICAgICAgICAgICAgICAgICAgdXBkYXRlU29ja2V0KCk7CisgICAgICAgICAgICAgICAgICAgIHJldHVybjsKKyAgICAgICAgICAgICAgICB9CisKKyAgICAgICAgICAgICAgICB2YXIgc2Vzc2lvbiA9IF9jb25maWcucmVuZWdvdGlhdGU7CisgICAgICAgICAgICAgICAgLy8gZGV0YWNoIHN0cmVhbXMKKyAgICAgICAgICAgICAgICBkZXRhY2hNZWRpYVN0cmVhbShsYWJlbHMsIHBlZXIuY29ubmVjdGlvbik7CisKKyAgICAgICAgICAgICAgICBpZiAoc2Vzc2lvbi5vbmV3YXkgfHwgaXNEYXRhKHNlc3Npb24pKSB7CisgICAgICAgICAgICAgICAgICAgIGNyZWF0ZUFuc3dlcigpOworICAgICAgICAgICAgICAgICAgICBkZWxldGUgX2NvbmZpZy5yZW5lZ290aWF0ZTsKKyAgICAgICAgICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgICAgICAgICBpZiAoX2NvbmZpZy5jYXB0dXJpbmcpCisgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm47CisKKyAgICAgICAgICAgICAgICAgICAgX2NvbmZpZy5jYXB0dXJpbmcgPSB0cnVlOworCisgICAgICAgICAgICAgICAgICAgIGNvbm5lY3Rpb24uY2FwdHVyZVVzZXJNZWRpYShmdW5jdGlvbihzdHJlYW0pIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIF9jb25maWcuY2FwdHVyaW5nID0gZmFsc2U7CisKKyAgICAgICAgICAgICAgICAgICAgICAgIHBlZXIuYWRkU3RyZWFtKHN0cmVhbSk7CisKKyAgICAgICAgICAgICAgICAgICAgICAgIGNvbm5lY3Rpb24ucmVuZWdvdGlhdGVkU2Vzc2lvbnNbSlNPTi5zdHJpbmdpZnkoX2NvbmZpZy5yZW5lZ290aWF0ZSldID0geworICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNlc3Npb246IF9jb25maWcucmVuZWdvdGlhdGUsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgc3RyZWFtOiBzdHJlYW0KKyAgICAgICAgICAgICAgICAgICAgICAgIH07CisKKyAgICAgICAgICAgICAgICAgICAgICAgIGRlbGV0ZSBfY29uZmlnLnJlbmVnb3RpYXRlOworCisgICAgICAgICAgICAgICAgICAgICAgICBjcmVhdGVBbnN3ZXIoKTsKKyAgICAgICAgICAgICAgICAgICAgfSwgX2NvbmZpZy5yZW5lZ290aWF0ZSk7CisgICAgICAgICAgICAgICAgfQorCisgICAgICAgICAgICAgICAgZnVuY3Rpb24gY3JlYXRlQW5zd2VyKCkgeworICAgICAgICAgICAgICAgICAgICBwZWVyLnJlY3JlYXRlQW5zd2VyKHNkcCwgc2Vzc2lvbiwgZnVuY3Rpb24oX3NkcCwgc3RyZWFtaW5mbykgeworICAgICAgICAgICAgICAgICAgICAgICAgc2VuZHNkcCh7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2RwOiBfc2RwLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNvY2tldDogc29ja2V0LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIHN0cmVhbWluZm86IHN0cmVhbWluZm8KKyAgICAgICAgICAgICAgICAgICAgICAgIH0pOworICAgICAgICAgICAgICAgICAgICAgICAgY29ubmVjdGlvbi5kZXRhY2hTdHJlYW1zID0gW107CisgICAgICAgICAgICAgICAgICAgIH0pOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorCisgICAgICAgIGZ1bmN0aW9uIGRldGFjaE1lZGlhU3RyZWFtKGxhYmVscywgcGVlcikgeworICAgICAgICAgICAgaWYgKCFsYWJlbHMpIHJldHVybjsKKyAgICAgICAgICAgIGZvciAodmFyIGkgPSAwOyBpIDwgbGFiZWxzLmxlbmd0aDsgaSsrKSB7CisgICAgICAgICAgICAgICAgdmFyIGxhYmVsID0gbGFiZWxzW2ldOworICAgICAgICAgICAgICAgIGlmIChjb25uZWN0aW9uLnN0cmVhbXNbbGFiZWxdKSB7CisgICAgICAgICAgICAgICAgICAgIHBlZXIucmVtb3ZlU3RyZWFtKGNvbm5lY3Rpb24uc3RyZWFtc1tsYWJlbF0uc3RyZWFtKTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9CisgICAgICAgIH0KKworICAgICAgICBmdW5jdGlvbiBzZW5kc2RwKGUpIHsKKyAgICAgICAgICAgIGUuc29ja2V0LnNlbmQoeworICAgICAgICAgICAgICAgIHNkcDogSlNPTi5zdHJpbmdpZnkoeworICAgICAgICAgICAgICAgICAgICBzZHA6IGUuc2RwLnNkcCwKKyAgICAgICAgICAgICAgICAgICAgdHlwZTogZS5zZHAudHlwZQorICAgICAgICAgICAgICAgIH0pLAorICAgICAgICAgICAgICAgIHJlbmVnb3RpYXRlOiAhIWUucmVuZWdvdGlhdGUgPyBlLnJlbmVnb3RpYXRlIDogZmFsc2UsCisgICAgICAgICAgICAgICAgc3RyZWFtaW5mbzogZS5zdHJlYW1pbmZvIHx8ICcnLAorICAgICAgICAgICAgICAgIGxhYmVsczogZS5sYWJlbHMgfHwgW10sCisgICAgICAgICAgICAgICAgcHJlZmVyU0NUUDogISFjb25uZWN0aW9uLnByZWZlclNDVFAsCisgICAgICAgICAgICAgICAgZmFrZURhdGFDaGFubmVsczogISFjb25uZWN0aW9uLmZha2VEYXRhQ2hhbm5lbHMsCisgICAgICAgICAgICAgICAgaXNJbml0aWF0b3I6ICEhY29ubmVjdGlvbi5pc0luaXRpYXRvciwKKyAgICAgICAgICAgICAgICB1c2VyaW5mbzogeworICAgICAgICAgICAgICAgICAgICBicm93c2VyOiBpc0ZpcmVmb3ggPyAnZmlyZWZveCcgOiAnY2hyb21lJworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0pOworICAgICAgICB9CisKKyAgICAgICAgLy8gc2hhcmluZyBuZXcgdXNlciB3aXRoIGV4aXN0aW5nIHBhcnRpY2lwYW50cworCisgICAgICAgIGZ1bmN0aW9uIG9uTmV3UGFydGljaXBhbnQocmVzcG9uc2UpIHsKKyAgICAgICAgICAgIHZhciBjaGFubmVsID0gcmVzcG9uc2UubmV3UGFydGljaXBhbnQ7CisKKyAgICAgICAgICAgIGlmICghY2hhbm5lbCB8fCAhIXBhcnRpY2lwYW50c1tjaGFubmVsXSB8fCBjaGFubmVsID09IGNvbm5lY3Rpb24udXNlcmlkKQorICAgICAgICAgICAgICAgIHJldHVybjsKKworICAgICAgICAgICAgdmFyIG5ld19jaGFubmVsID0gY29ubmVjdGlvbi50b2tlbigpOworICAgICAgICAgICAgbmV3UHJpdmF0ZVNvY2tldCh7CisgICAgICAgICAgICAgICAgY2hhbm5lbDogbmV3X2NoYW5uZWwsCisgICAgICAgICAgICAgICAgZXh0cmE6IHJlc3BvbnNlLnVzZXJEYXRhID8gcmVzcG9uc2UudXNlckRhdGEuZXh0cmEgOiByZXNwb25zZS5leHRyYSwKKyAgICAgICAgICAgICAgICB1c2VyaWQ6IHJlc3BvbnNlLnVzZXJEYXRhID8gcmVzcG9uc2UudXNlckRhdGEudXNlcmlkIDogcmVzcG9uc2UudXNlcmlkCisgICAgICAgICAgICB9KTsKKworICAgICAgICAgICAgZGVmYXVsdFNvY2tldC5zZW5kKHsKKyAgICAgICAgICAgICAgICBwYXJ0aWNpcGFudDogdHJ1ZSwKKyAgICAgICAgICAgICAgICB0YXJnZXRVc2VyOiBjaGFubmVsLAorICAgICAgICAgICAgICAgIGNoYW5uZWw6IG5ld19jaGFubmVsCisgICAgICAgICAgICB9KTsKKyAgICAgICAgfQorCisgICAgICAgIC8vIGlmIGEgdXNlciBsZWF2ZXMKKworICAgICAgICBmdW5jdGlvbiBjbGVhclNlc3Npb24oKSB7CisgICAgICAgICAgICBjb25uZWN0aW9uLm51bWJlck9mQ29ubmVjdGVkVXNlcnMtLTsKKworICAgICAgICAgICAgdmFyIGFsZXJ0TWVzc2FnZSA9IHsKKyAgICAgICAgICAgICAgICBsZWZ0OiB0cnVlLAorICAgICAgICAgICAgICAgIGV4dHJhOiBjb25uZWN0aW9uLmV4dHJhIHx8IHt9LAorICAgICAgICAgICAgICAgIHVzZXJpZDogY29ubmVjdGlvbi51c2VyaWQsCisgICAgICAgICAgICAgICAgc2Vzc2lvbmlkOiBjb25uZWN0aW9uLnNlc3Npb25pZAorICAgICAgICAgICAgfTsKKworICAgICAgICAgICAgaWYgKGNvbm5lY3Rpb24uaXNJbml0aWF0b3IpIHsKKyAgICAgICAgICAgICAgICAvLyBpZiBpbml0aWF0b3Igd2FudHMgdG8gY2xvc2UgZW50aXJlIHNlc3Npb24KKyAgICAgICAgICAgICAgICBpZiAoY29ubmVjdGlvbi5hdXRvQ2xvc2VFbnRpcmVTZXNzaW9uKSB7CisgICAgICAgICAgICAgICAgICAgIGFsZXJ0TWVzc2FnZS5jbG9zZUVudGlyZVNlc3Npb24gPSB0cnVlOworICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAoc29ja2V0c1swXSkgeworICAgICAgICAgICAgICAgICAgICAvLyBzaGlmdCBpbml0aWF0aW9uIGNvbnRyb2wgdG8gYW5vdGhlciB1c2VyCisgICAgICAgICAgICAgICAgICAgIHNvY2tldHNbMF0uc2VuZCh7CisgICAgICAgICAgICAgICAgICAgICAgICBwbGF5Um9sZU9mQnJvYWRjYXN0ZXI6IHRydWUsCisgICAgICAgICAgICAgICAgICAgICAgICB1c2VyaWQ6IGNvbm5lY3Rpb24udXNlcmlkLAorICAgICAgICAgICAgICAgICAgICAgICAgZXh0cmE6IGNvbm5lY3Rpb24uZXh0cmEsCisgICAgICAgICAgICAgICAgICAgICAgICBwYXJ0aWNpcGFudHM6IHBhcnRpY2lwYW50cworICAgICAgICAgICAgICAgICAgICB9KTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9CisKKyAgICAgICAgICAgIHNvY2tldHMuZm9yRWFjaChmdW5jdGlvbihzb2NrZXQsIGkpIHsKKyAgICAgICAgICAgICAgICBzb2NrZXQuc2VuZChhbGVydE1lc3NhZ2UpOworCisgICAgICAgICAgICAgICAgaWYgKHNvY2tldE9iamVjdHNbc29ja2V0LmNoYW5uZWxdKSB7CisgICAgICAgICAgICAgICAgICAgIGRlbGV0ZSBzb2NrZXRPYmplY3RzW3NvY2tldC5jaGFubmVsXTsKKyAgICAgICAgICAgICAgICB9CisKKyAgICAgICAgICAgICAgICBkZWxldGUgc29ja2V0c1tpXTsKKyAgICAgICAgICAgIH0pOworCisgICAgICAgICAgICBzb2NrZXRzID0gc3dhcChzb2NrZXRzKTsKKworICAgICAgICAgICAgY29ubmVjdGlvbi5yZWZyZXNoKCk7CisKKyAgICAgICAgICAgIHdlYkF1ZGlvTWVkaWFTdHJlYW1Tb3VyY2VzLmZvckVhY2goZnVuY3Rpb24obWVkaWFTdHJlYW1Tb3VyY2UpIHsKKyAgICAgICAgICAgICAgICAvLyBpZiBzb3VyY2UgaXMgY29ubmVjdGVkOyB0aGVuIGNocm9tZSB3aWxsIGNyYXNoIG9uIHVubG9hZC4KKyAgICAgICAgICAgICAgICBtZWRpYVN0cmVhbVNvdX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mIChwYXJ0aWNpcGFudHNbdXNlcmlkXSkgeworICAgICAgICAgICAgICAgIGRlbGV0ZSBwYXJ0aWNpcGFudHNbdXNlcmlkXTsKKyAgICAgICAgICAgIH0KKworICAgICAgICAgICAgZm9yICh2YXIgc3RyZWFtIGluIGNvbm5lY3Rpb24uc3RyZWFtcykgeworICAgICAgICAgICAgICAgIHN0cmVhbSA9IGNvbm5lY3Rpb24uc3RyZWFtc1tzdHJlYW1dOworICAgICAgICAgICAgICAgIGlmIChzdHJlYW0udXNlcmlkID09IHVzZXJpZCkgeworICAgICAgICAgICAgICAgICAgICBvblN0cmVhbUVuZGVkSGFuZGxlcihzdHJlYW0sIGNvbm5lY3Rpb24pOworICAgICAgICAgICAgICAgICAgICBkZWxldGUgY29ubmVjdGlvbi5zdHJlYW1zW3N0cmVhbV07CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfQorCisgICAgICAgICAgICBpZiAoc29ja2V0T2JqZWN0c1t1c2VyaWRdKSB7CisgICAgICAgICAgICAgICAgZGVsZXRlIHNvY2tldE9iamVjdHNbdXNlcmlkXTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfTsKKworICAgICAgICAvLyB3d3cuUlRDTXVsdGlDb25uZWN0aW9uLm9yZy9kb2NzL3JlZnJlc2gvCisgICAgICAgIGNvbm5lY3Rpb24ucmVmcmVzaCA9IGZ1bmN0aW9uKCkgeworICAgICAgICAgICAgLy8gaWYgZmlyZWJhc2U7IHJlbW92ZSBkYXRhIGZyb20gZmlyZWJhc2Ugc2VydmVycworICAgICAgICAgICAgaWYgKGNvbm5lY3Rpb24uaXNJbml0aWF0b3IgJiYgISFjb25uZWN0aW9uLnNvY2tldCAmJiAhIWNvbm5lY3Rpb24uc29ja2V0LnJlbW92ZSkgeworICAgICAgICAgICAgICAgIGNvbm5lY3Rpb24uc29ja2V0LnJlbW92ZSgpOworICAgICAgICAgICAgfQorCisgICAgICAgICAgICBwYXJ0aWNpcGFudHMgPSB7fTsKKworICAgICAgICAgICAgLy8gdG8gc3RvcC9yZW1vdmUgc2VsZiBzdHJlYW1zCisgICAgICAgICAgICBmb3IgKHZhciBpID0gMDsgaSA8IGNvbm5lY3Rpb24uYXR0YWNoU3RyZWFtcy5sZW5ndGg7IGkrKykgeworICAgICAgICAgICAgICAgIGNvbm5lY3Rpb24uc3RvcE1lZGlhU3RyZWFtKGNvbm5lY3Rpb24uYXR0YWNoU3RyZWFtc1tpXSk7CisgICAgICAgICAgICB9CisKKyAgICAgICAgICAgIC8vIHRvIGFsbG93IGNhcHR1cmluZyBvZiBpZGVudGljYWwgc3RyZWFtcworICAgICAgICAgICAgY3VycmVudFVzZXJNZWRpYVJlcXVlc3QgPSB7CisgICAgICAgICAgICAgICAgc3RyZWFtczogW10sCisgICAgICAgICAgICAgICAgbXV0ZXg6IGZhbHNlLAorICAgICAgICAgICAgICAgIHF1ZXVlUmVxdWVzdHM6IFtdCisgICAgICAgICAgICB9OworCisgICAgICAgICAgICBydGNNdWx0aVNlc3Npb24uaXNPd25lckxlYXZpbmcgPSB0cnVlOworCisgICAgICAgICAgICBjb25uZWN0aW9uLmlzSW5pdGlhdG9yID0gZmFsc2U7CisgICAgICAgICAgICBjb25uZWN0aW9uLmlzQWNjZXB0TmV3U2Vzc2lvbiA9IHRydWU7CisgICAgICAgICAgICBjb25uZWN0aW9uLmF0dGFjaE1lZGlhU3RyZWFtcyA9IFtdOworICAgICAgICAgICAgY29ubmVjdGlvbi5zZXNzaW9uRGVzY3JpcHRpb24gPSBudWxsOworICAgICAgICAgICAgY29ubmVjdGlvbi5zZXNzaW9uRGVzY3JpcHRpb25zID0ge307CisgICAgICAgICAgICBjb25uZWN0aW9uLmxvY2FsU3RyZWFtaWRzID0gW107CisgICAgICAgICAgICBjb25uZWN0aW9uLnByZVJlY29yZGVkTWVkaWFzID0ge307CisgICAgICAgICAgICBjb25uZWN0aW9uLnNuYXBzaG90cyA9IHt9OworCisgICAgICAgICAgICBjb25uZWN0aW9uLm51bWJlck9mQ29ubmVjdGVkVXNlcnMgPSAwOworICAgICAgICAgICAgY29ubmVjdGlvbi5udW1iZXJPZlNlc3Npb25zID0gMDsKKworICAgICAgICAgICAgY29ubmVjdGlvbi5hdHRhY2hTdHJlYW1zID0gW107CisgICAgICAgICAgICBjb25uZWN0aW9uLmRldGFjaFN0cmVhbXMgPSBbXTsKKyAgICAgICAgICAgIGNvbm5lY3Rpb24uZmlsZVF1ZXVlID0ge307CisgICAgICAgICAgICBjb25uZWN0aW9uLmNoYW5uZWxzID0ge307CisgICAgICAgICAgICBjb25uZWN0aW9uLnJlbmVnb3RpYXRlZFNlc3Npb25zID0ge307CisKKyAgICAgICAgICAgIGZvciAodmFyIHBlZXIgaW4gY29ubmVjdGlvbi5wZWVycykgeworICAgICAgICAgICAgICAgIGlmIChwZWVyICE9IGNvbm5lY3Rpb24udXNlcmlkKSB7CisgICAgICAgICAgICAgICAgICAgIGRlbGV0ZSBjb25uZWN0aW9uLnBlZXJzW3BlZXJdOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0KKworICAgICAgICAgICAgLy8gdG8gbWFrZSBzdXJlIHJlbW90ZSBzdHJlYW1zIGFyZSBhbHNvIHJlbW92ZWQhCisgICAgICAgICAgICBmb3IgKHZhciBzdHJlYW0gaW4gY29ubmVjdGlvbi5zdHJlYW1zKSB7CisgICAgICAgICAgICAgICAgaWYgKGNvbm5lY3Rpb24uX3NraXAuaW5kZXhPZihzdHJlYW0pID09IC0xKSB7CisgICAgICAgICAgICAgICAgICAgIG9uU3RyZWFtRW5kZWRIYW5kbGVyKGNvbm5lY3Rpb24uc3RyZWFtc1tzdHJlYW1dLCBjb25uZWN0aW9uKTsKKyAgICAgICAgICAgICAgICAgICAgZGVsZXRlIGNvbm5lY3Rpb24uc3RyZWFtc1tzdHJlYW1dOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0KKworICAgICAgICAgICAgc29ja2V0T2JqZWN0cyA9IHt9OworICAgICAgICAgICAgc29ja2V0cyA9IFtdOworICAgICAgICAgICAgcGFydGljaXBhbnRzID0ge307CisgICAgICAgIH07CisKKyAgICAgICAgLy8gd3d3LlJUQ011bHRpQ29ubmVjdGlvbi5vcmcvZG9jcy9yZWplY3QvCisgICAgICAgIGNvbm5lY3Rpb24ucmVqZWN0ID0gZnVuY3Rpb24odXNlcmlkKSB7CisgICAgICAgICAgICBpZiAoIWlzU3RyaW5nKHVzZXJpZCkpIHVzZXJpZCA9IHVzZXJpZC51c2VyaWQ7CisgICAgICAgICAgICBkZWZhdWx0U29ja2V0LnNlbmQoeworICAgICAgICAgICAgICAgIHJlamVjdGVkUmVxdWVzdE9mOiB1c2VyaWQKKyAgICAgICAgICAgIH0pOworCisgICAgICAgICAgICAvLyByZW1vdmUgcmVsZXZhbnQgZGF0YSB0byBhbGxvdyBoaW0gam9pbiBhZ2FpbgorICAgICAgICAgICAgY29ubmVjdGlvbi5yZW1vdmUodXNlcmlkKTsKKyAgICAgICAgfTsKKworICAgICAgICBydGNNdWx0aVNlc3Npb24ubGVhdmVIYW5kbGVyID0gZnVuY3Rpb24oZSkgeworICAgICAgICAgICAgaWYgKCFjb25uZWN0aW9uLmxlYXZlT25QYWdlVW5sb2FkKSByZXR1cm47CisKKyAgICAgICAgICAgIGlmIChpc051bGwoZS5rZXlDb2RlKSkgeworICAgICAgICAgICAgICAgIHJldHVybiBjbGVhclNlc3Npb24oKTsKKyAgICAgICAgICAgIH0KKworICAgICAgICAgICAgaWYgKGUua2V5Q29kZSA9PSAxMTYpIHsKKyAgICAgICAgICAgICAgICBjbGVhclNlc3Npb24oKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfTsKKworICAgICAgICBsaXN0ZW5FdmVudEhhbmRsZXIoJ2JlZm9yZXVubG9hZCcsIHJ0Y011bHRpU2Vzc2lvbi5sZWF2ZUhhbmRsZXIpOworICAgICAgICBsaXN0ZW5FdmVudEhhbmRsZXIoJ2tleXVwJywgcnRjTXVsdGlTZXNzaW9uLmxlYXZ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ZHkpIHJldHVybjsKKyAgICAgICAgICAgIHJ0Y011bHRpU2Vzc2lvbi5zaWduYWxpbmdSZWFkeSA9IHRydWU7CisKKyAgICAgICAgICAgIHNldFRpbWVvdXQoY2FsbGJhY2tGb3JTaWduYWxpbmdSZWFkeSwgMTAwMCk7CisKKyAgICAgICAgICAgIGlmICghY29ubmVjdGlvbi5pc0luaXRpYXRvcikgeworICAgICAgICAgICAgICAgIC8vIGFzIHNvb24gYXMgc2lnbmFsaW5nIGdhdGV3YXkgaXMgY29ubmVjdGVkOworICAgICAgICAgICAgICAgIC8vIHVzZXIgc2hvdWxkIGNoZWNrIGV4aXN0aW5nIHJvb21zIQorICAgICAgICAgICAgICAgIGRlZmF1bHRTb2NrZXQgJiYgZGVmYXVsdFNvY2tldC5zZW5kKHsKKyAgICAgICAgICAgICAgICAgICAgc2VhcmNoaW5nRm9yUm9vbXM6IHRydWUKKyAgICAgICAgICAgICAgICB9KTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorCisgICAgICAgIGZ1bmN0aW9uIGpvaW5QYXJ0aWNpcGFudHMoam9pblVzZXJzKSB7CisgICAgICAgICAgICBmb3IgKHZhciB1c2VyIGluIGpvaW5Vc2VycykgeworICAgICAgICAgICAgICAgIGlmICghcGFydGljaXBhbnRzW2pvaW5Vc2Vyc1t1c2VyXV0pIHsKKyAgICAgICAgICAgICAgICAgICAgb25OZXdQYXJ0aWNpcGFudCh7CisgICAgICAgICAgICAgICAgICAgICAgICBzZXNzaW9uaWQ6IGNvbm5lY3Rpb24uc2Vzc2lvbmlkLAorICAgICAgICAgICAgICAgICAgICAgICAgbmV3UGFydGljaXBhbnQ6IGpvaW5Vc2Vyc1t1c2VyXSwKKyAgICAgICAgICAgICAgICAgICAgICAgIHVzZXJpZDogY29ubmVjdGlvbi51c2VyaWQsCisgICAgICAgICAgICAgICAgICAgICAgICBleHRyYTogY29ubmVjdGlvbi5leHRyYQorICAgICAgICAgICAgICAgICAgICB9KTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9CisgICAgICAgIH0KKworICAgICAgICBmdW5jdGlvbiBnZXREZWZhdWx0U29ja2V0UmVmKCkgeworICAgICAgICAgICAgcmV0dXJuIGNvbm5lY3Rpb24ub3BlblNpZ25hbGluZ0NoYW5uZWwoeworICAgICAgICAgICAgICAgIG9ubWVzc2FnZTogZnVuY3Rpb24ocmVzcG9uc2UpIHsKKyAgICAgICAgICAgICAgICAgICAgLy8gUk1TID09IFJUQ011bHRpU2Vzc2lvbgorICAgICAgICAgICAgICAgICAgICBpZiAoaXNSTVNEZWxldGVkKSByZXR1cm47CisKKyAgICAgICAgICAgICAgICAgICAgLy8gaWYgbWVzc2FnZSBpcyBzZW50IGJ5IHNhbWUgdXNlcgorICAgICAgICAgICAgICAgICAgICBpZiAocmVzcG9uc2UudXNlcmlkID09IGNvbm5lY3Rpb24udXNlcmlkKSByZXR1cm47CisKKyAgICAgICAgICAgICAgICAgICAgaWYgKHJlc3BvbnNlLnNlc3Npb25pZCAmJiByZXNwb25zZS51c2VyaWQpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIGlmICghY29ubmVjdGlvbi5zZXNzaW9uRGVzY3JpcHRpb25zW3Jlc3BvbnNlLnNlc3Npb25pZF0pIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb25uZWN0aW9uLm51bWJlck9mU2Vzc2lvbnMrKzsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb25uZWN0aW9uLnNlc3Npb25EZXNjcmlwdGlvbnNbcmVzcG9uc2Uuc2Vzc2lvbmlkXSA9IHJlc3BvbnNlOworCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gZmlyZSAib25OZXdTZXNzaW9uIiBvbmx5IGlmOgorICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vIDEpICJpc0FjY2VwdE5ld1Nlc3Npb24iIGJvb2xlYW4gaXMgdHJ1ZQorICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vIDIpICJzZXNzaW9uRGVzY3JpcHRpb25zIiBvYmplY3QgaXNuJ3QgaGF2aW5nIHNhbWUgc2Vzc2lvbiBpLmUuIHRvIHByZXZlbnQgZHVwbGljYXRlIGludm9jYXRpb25zCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGNvbm5lY3Rpb24uaXNBY2NlcHROZXdTZXNzaW9uKSB7CisKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKCFjb25uZWN0aW9uLmRvbnRPdmVycmlkZVNlc3Npb24pIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbm5lY3Rpb24uc2Vzc2lvbiA9IHJlc3BvbnNlLnNlc3Npb247CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KKworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBvbk5ld1Nlc3Npb24ocmVzcG9uc2UpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgfQorCisgICAgICAgICAgICAgICAgICAgIGlmIChyZXNwb25zZS5uZXdQYXJ0aWNpcGFudCAmJiAhY29ubmVjdGlvbi5pc0FjY2VwdE5ld1Nlc3Npb24gJiYgcnRjTXVsdGlTZXNzaW9uLmJyb2FkY2FzdGVyaWQgPT09IHJlc3BvbnNlLnVzZXJpZCkgeworICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHJlc3BvbnNlLm5ld1BhcnRpY2lwYW50ICE9IGNvbm5lY3Rpb24udXNlcmlkKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgb25OZXdQYXJ0aWNpcGFudChyZXNwb25zZSk7CisgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgIH0KKworICAgICAgICAgICAgICAgICAgICBpZiAoZ2V0TGVuZ3RoKHBhcnRpY2lwYW50cykgPCBjb25uZWN0aW9uLm1heFBhcnRpY2lwYW50c0FsbG93ZWQgJiYgcmVzcG9uc2UudGFyZ2V0VXNlciA9PSBjb25uZWN0aW9uLnVzZXJpZCAmJiByZXNwb25zZS5wYXJ0aWNpcGFudCkgeworICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGNvbm5lY3Rpb24ucGVlcnNbcmVzcG9uc2UudXNlcmlkXSAmJiAhY29ubmVjdGlvbi5wZWVyc1tyZXNwb25zZS51c2VyaWRdLnBlZXIpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBkZWxldGUgcGFydGljaXBhbnRzW3Jlc3BvbnNlLnVzZXJpZF07CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgZGVsZXRlIGNvbm5lY3Rpb24ucGVlcnNbcmVzcG9uc2UudXNlcmlkXTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb25uZWN0aW9uLmlzQWNjZXB0TmV3U2Vzc2lvbiA9IHRydWU7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGFjY2VwdFJlcXVlc3QocmVzcG9uc2UpOworICAgICAgICAgICAgICAgICAgICAgICAgfQorCisgICAgICAgICAgICAgICAgICAgICAgICBpZiAoIXBhcnRpY2lwYW50c1tyZXNwb25zZS51c2VyaWRdKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgYWNjZXB0UmVxdWVzdChyZXNwb25zZSk7CisgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgIH0KKworICAgICAgICAgICAgICAgICAgICBpZiAocmVzcG9uc2UuYWNjZXB0ZWRSZXF1ZXN0T2YgPT0gY29ubmVjdGlvbi51c2VyaWQpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIGNvbm5lY3Rpb24ub25zdGF0ZWNoYW5nZSh7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgdXNlcmlkOiByZXNwb25zZS51c2VyaWQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgZXh0cmE6IHJlc3BvbnNlLmV4dHJhLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIG5hbWU6ICdyZXF1ZXN0LWFjY2VwdGVkJywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICByZWFzb246IHJlc3BvbnNlLnVzZXJpZCArICcgYWNjZXB0ZWQgeW91ciBwYXJ0aWNpcGF0aW9uIHJlcXVlc3QuJworICAgICAgICAgICAgICAgICAgICAgICAgfSk7CisgICAgICAgICAgICAgICAgICAgIH0KKworICAgICAgICAgICAgICAgICAgICBpZiAocmVzcG9uc2UucmVqZWN0ZWRSZXF1ZXN0T2YgPT0gY29ubmVjdGlvbi51c2VyaWQpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIGNvbm5lY3Rpb24ub25zdGF0ZWNoYW5nZSh7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgdXNlcmlkOiByZXNwb25zZS51c2VyaWQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgZXh0cmE6IHJlc3BvbnNlLmV4dHJhLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIG5hbWU6ICdyZXF1ZXN0LXJlamVjdGVkJywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICByZWFzb246IHJlc3BvbnNlLnVzZXJpZCArICcgcmVqZWN0ZWQgeW91ciBwYXJ0aWNpcGF0aW9uIHJlcXVlc3QuJworICAgICAgICAgICAgICAgICAgICAgICAgfSk7CisgICAgICAgICAgICAgICAgICAgIH0KKworICAgICAgICAgICAgICAgICAgICBpZiAocmVzcG9uc2UuY3VzdG9tTWVzc2FnZSkgeworICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHJlc3BvbnNlLm1lc3NhZ2UuZHJvcCkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbm5lY3Rpb24ub25kcm9wKHJlc3BvbnNlLnVzZXJpZCk7CisKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb25uZWN0aW9uLmF0dGFjaFN0cmVhbXMgPSBbXTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyAiZHJvcCIgc2hvdWxkIGRldGFjaCBhbGwgbG9jYWwgc3RyZWFtcworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZvciAodmFyIHN0cmVhbSBpbiBjb25uZWN0aW9uLnN0cmVhbXMpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGNvbm5lY3Rpb24uX3NraXAuaW5kZXhPZihzdHJlYW0pID09IC0xKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzdHJlYW0gPSBjb25uZWN0aW9uLnN0cmVhbXNbc3RyZWFtXTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChzdHJlYW0udHlwZSA9PSAnbG9jYWwnKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY29ubmVjdGlvbi5kZXRhY2hTdHJlYW1zLnB1c2goc3RyZWFtLnN0cmVhbWlkKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBvblN0cmVhbUVuZGVkSGFuZGxlcihzdHJlYW0sIGNvbm5lY3Rpb24pOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIG9uU3RyZWFtRW5kZWRIYW5kbGVyKHN0cmVhbSwgY29ubmVjdGlvbik7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CisKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAocmVzcG9uc2UubWVzc2FnZS5yZW5lZ290aWF0ZSkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyByZW5lZ290aWF0ZTsgc28gInBlZXIucmVtb3ZlU3RyZWFtIiBoYXBwZW5zLgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb25uZWN0aW9uLnJlbmVnb3RpYXRlKCk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIGlmIChjb25uZWN0aW9uLm9uQ3VzdG9tTWVzc2FnZSkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbm5lY3Rpb24ub25DdXN0b21NZXNzYWdlKHJlc3BvbnNlLm1lc3NhZ2UpOworICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICB9CisKKyAgICAgICAgICAgICAgICAgICAgaWYgKGNvbm5lY3Rpb24uaXNJbml0aWF0b3IgJiYgcmVzcG9uc2Uuc2VhcmNoaW5nRm9yUm9vbXMpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIGRlZmF1bHRTb2NrZXQgJiYgZGVmYXVsdFNvY2tldC5zZW5kKHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBzZXNzaW9uRGVzY3JpcHRpb246IGNvbm5lY3Rpb24uc2Vzc2lvbkRlc2NyaXB0aW9uLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJlc3BvbnNlRm9yOiByZXNwb25zZS51c2VyaWQKKyAgICAgICAgICAgICAgICAgICAgICAgIH0pOworICAgICAgICAgICAgICAgICAgICB9CisKKyAgICAgICAgICAgICAgICAgICAgaWYgKHJlc3BvbnNlLnNlc3Npb25EZXNjcmlwdGlvbiAmJiByZXNwb25zZS5yZXNwb25zZUZvciA9PSBjb25uZWN0aW9uLnVzZXJpZCkgeworICAgICAgICAgICAgICAgICAgICAgICAgdmFyIHNlc3Npb25EZXNjcmlwdGlvbiA9IHJlc3BvbnNlLnNlc3Npb25EZXNjcmlwdGlvbjsKKyAgICAgICAgICAgICAgICAgICAgICAgIGlmICghY29ubmVjdGlvbi5zZXNzaW9uRGVzY3JpcHRpb25zW3Nlc3Npb25EZXNjcmlwdGlvbi5zZXNzaW9uaWRdKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgY29ubmVjdGlvbi5udW1iZXJPZlNlc3Npb25zKys7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgY29ubmVjdGlvbi5zZXNzaW9uRGVzY3JpcHRpb25zW3Nlc3Npb25EZXNjcmlwdGlvbi5zZXNzaW9uaWRdID0gc2Vzc2lvbkRlc2NyaXB0aW9uOworICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICB9CisKKyAgICAgICAgICAgICAgICAgICAgaWYgKGNvbm5lY3Rpb24uaXNJbml0aWF0b3IgJiYgcmVzcG9uc2UuYXNrVG9TaGFyZVBhcnRpY2lwYW50cyAmJiBkZWZhdWx0U29ja2V0KSB7CisgICAgICAgICAgICAgICAgICAgICAgICBjb25uZWN0aW9uLnNoYXJlUGFydGljaXBhbnRzKHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBzaGFyZVdpdGg6IHJlc3BvbnNlLnVzZXJpZAorICAgICAgICAgICAgICAgICAgICAgICAgfSk7CisgICAgICAgICAgICAgICAgICAgIH0KKworICAgICAgICAgICAgICAgICAgICAvLyBwYXJ0aWNpcGFudHMgYXJlIHNoYXJlZCB3aXRoIHNpbmdsZSB1c2VyCisgICAgICAgICAgICAgICAgICAgIGlmIChyZXNwb25zZS5zaGFyZVdpdGggPT0gY29ubmVjdGlvbi51c2VyaWQgJiYgcmVzcG9uc2UuZG9udFNoYXJlV2l0aCAhPSBjb25uZWN0aW9uLnVzZXJpZCAmJiByZXNwb25zZS5qb2luVXNlcnMpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIGpvaW5QYXJ0aWNpcGFudHMocmVzcG9uc2Uuam9pblVzZXJzKTsKKyAgICAgICAgICAgICAgICAgICAgfQorCisgICAgICAgICAgICAgICAgICAgIC8vIHBhcnRpY2lwYW50cyBhcmUgc2hhcmVkIHdpdGggYWxsIHVzZXJzCisgICAgICAgICAgICAgICAgICAgIGlmICghcmVzcG9uc2Uuc2hhcmVXaXRoICYmIHJlc3BvbnNlLmpvaW5Vc2VycykgeworICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHJlc3BvbnNlLmRvbnRTaGFyZVdpdGgpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoY29ubmVjdGlvbi51c2VyaWQgIT0gcmVzcG9uc2UuZG9udFNoYXJlV2l0aCkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBqb2luUGFydGljaXBhbnRzKHJlc3BvbnNlLmpvaW5Vc2Vycyk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIGpvaW5QYXJ0aWNpcGFudHMocmVzcG9uc2Uuam9pblVzZXJzKTsKKyAgICAgICAgICAgICAgICAgICAgfQorCisgICAgICAgICAgICAgICAgICAgIGlmIChyZXNwb25zZS5tZXNzYWdlRm9yID09IGNvbm5lY3Rpb24udXNlcmlkICYmIHJlc3BvbnNlLnByZXNlbmNlU3RhdGUpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIGlmIChyZXNwb25zZS5wcmVzZW5jZVN0YXRlID09ICdjaGVja2luZycpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBkZWZhdWx0U29ja2V0LnNlbmQoeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBtZXNzYWdlRm9yOiByZXNwb25zZS51c2VyaWQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHByZXNlbmNlU3RhdGU6ICdhdmFpbGFibGUnLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBfY29uZmlnOiByZXNwb25zZS5fY29uZmlnCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgbG9nKCdwYXJ0aWNpcGFudCBhc2tlZCBmb3IgYXZhaWxhYmlsaXR5Jyk7CisgICAgICAgICAgICAgICAgICAgICAgICB9CisKKyAgICAgICAgICAgICAgICAgICAgICAgIGlmIChyZXNwb25zZS5wcmVzZW5jZVN0YXRlID09ICdhdmFpbGFibGUnKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgcnRjTXVsdGlTZXNzaW9uLnByZXNlbmNlU3RhdGUgPSAnYXZhaWxhYmxlJzsKKworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbm5lY3Rpb24ub25zdGF0ZWNoYW5nZSh7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHVzZXJpZDogJ2Jyb3dzZXInLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBleHRyYToge30sCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG5hbWU6ICdyb29tLWF2YWlsYWJsZScsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJlYXNvbjogJ0luaXRpYXRvciBpcyBhdmFpbGFibGUgYW5kIHJvb20gaXMgYWN0aXZlLicKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB9KTsKKworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGpvaW5TZXNzaW9uKHJlc3BvbnNlLl9jb25maWcpOworICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICB9CisKKyAgICAgICAgICAgICAgICAgICAgaWYgKHJlc3BvbnNlLmRvbm90Sm9pbiAmJiByZXNwb25zZS5tZXNzYWdlRm9yID09IGNvbm5lY3Rpb24udXNlcmlkKSB7CisgICAgICAgICAgICAgICAgICAgICAgICBsb2cocmVzcG9uc2UudXNlcmlkLCAnaXMgbm90IGpvaW5pbmcgeW91ciByb29tLicpOworICAgICAgICAgICAgICAgICAgICB9CisKKyAgICAgICAgICAgICAgICAgICAgLy8gaWYgaW5pdGlhdG9yIGRpc2Nvbm5lY3RzIHNvY2tldHMsIHBhcnRpY2lwYW50cyBzaG91bGQgYWxzbyBkaXNjb25uZWN0CisgICAgICAgICAgICAgICAgICAgIGlmIChyZXNwb25zZS5pc0Rpc2Nvbm5lY3RTb2NrZXRzKSB7CisgICAgICAgICAgICAgICAgICAgICAgICBsb2coJ0Rpc2Nvbm5lY3RpbmcgeW91ciBzb2NrZXRzIGJlY2F1c2UgaW5pdGlhdG9yIGFsc28gZGlzY29ubmVjdGVkIGhpcyBzb2NrZXRzLicpOworICAgICAgICAgICAgICAgICAgICAgICAgY29ubmVjdGlvbi5kaXNjb25uZWN0KCk7CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICB9LAorICAgICAgICAgICAgICAgIGNhbGxiYWNrOiBmdW5jdGlvbihzb2NrZXQpIHsKKyAgICAgICAgICAgICAgICAgICAgc29ja2V0ICYmIHRoaXMub25vcGVuKHNvY2tldCk7CisgICAgICAgICAgICAgICAgfSwKKyAgICAgICAgICAgICAgICBvbm9wZW46IGZ1bmN0aW9uKHNvY2tldCkgeworICAgICAgICAgICAgICAgICAgICBpZiAoc29ja2V0KSBkZWZhdWx0U29ja2V0ID0gc29ja2V0OworICAgICAgICAgICAgICAgICAgICBpZiAob25TaWduYWxpbmdSZWFkeSkgb25TaWduYWxpbmdSZWFkeSgpOworCisgICAgICAgICAgICAgICAgICAgIHJ0Y011bHRpU2Vzc2lvbi5kZWZhdWx0U29ja2V0ID0gZGVmYXVsdFNvY2tldDsKKworICAgICAgICAgICAgICAgICAgICBpZiAoIWRlZmF1bHRTb2NrZXQuX19wdXNoKSB7CisgICAgICAgICAgICAgICAgICAgICAgICBkZWZhdWx0U29ja2V0Ll9fcHVzaCA9IGRlZmF1bHRTb2NrZXQuc2VuZDsKKyAgICAgICAgICAgICAgICAgICAgICAgIGRlZmF1bHRTb2NrZXQuc2VuZCA9IGZ1bmN0aW9uKG1lc3NhZ2UpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBtZXNzYWdlLnVzZXJpZCA9IG1lc3NhZ2UudXNlcmlkIHx8IGNvbm5lY3Rpb24udXNlcmlkOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1lc3NhZ2UuZXh0cmEgPSBtZXNzYWdlLmV4dHJhIHx8IGNvbm5lY3Rpb24uZXh0cmEgfHwge307CisKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBkZWZhdWx0U29ja2V0Ll9fcHVzaChtZXNzYWdlKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIH07CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9KTsKKyAgICAgICAgfQorCisgICAgICAgIC8vIGRlZmF1bHQtc29ja2V0IGlzIGEgY29tbW9uIHNvY2tldCBzaGFyZWQgYW1vbmcgYWxsIHVzZXJzIGluIGEgc3BlY2lmaWMgY2hhbm5lbDsKKyAgICAgICAgLy8gdG8gc2hhcmUgcGFydGljaXBhdGlvbiByZXF1ZXN0czsgcm9vbSBkZXNjcmlwdGlvbnM7IGFuZCBvdGhlciBzdHVmZi4KKyAgICAgICAgdmFyIGRlZmF1bHRTb2NrZXQgPSBnZXREZWZhdWx0U29ja2V0UmVmKCk7CisKKyAgICAgICAgcnRjTXVsdGlTZXNzaW9uLmRlZmF1bHRTb2NrZXQgPSBkZWZhdWx0U29ja2V0OworCisgICAgICAgIGlmIChkZWZhdWx0U29ja2V0ICYmIG9uU2lnbmFsaW5nUmVhZHkpIHNldFRpbWVvdXQob25TaWduYWxpbmdSZWFkeSwgMjAwMCk7CisKKyAgICAgICAgaWYgKGNvbm5lY3Rpb24uc2Vzc2lvbi5zY3JlZW4pIHsKKyAgICAgICAgICAgIGxvYWRTY3JlZW5GcmFtZSgpOworICAgICAgICB9CisgICAgICAgIC8vIENVU1RPTSBDT0RFIC8vCisgICAgICAgIAorICAgICAgICAvKiBDb21tZW50aW5nIHRoaXMKKyAgICAgICAgY29ubmVjdGlvbi5nZXRFeHRlcm5hbEljZVNlcnZlcnMgICYmIGxvYWRJY2VGcmFtZShmdW5jdGlvbihpY2VTZXJ2ZXJzKQorICAgICAgICAJCXsKKyAgICAgICAgICAgIGNvbm5lY3Rpb24uaWNlU2VydmVycyA9IGNvbm5lY3Rpb24uaWNlU2VydmVycy5jb25jYXQoaWNlU2VydmVycyk7CisgICAgICAgIH0pOworICAgICAgICAqLworICAgICAgICAKKyAgICAgICAvLyBDVVNUT00gQ09ERSAvLworCisgICAgICAgIGlmIChjb25uZWN0aW9uLmxvZyA9PSBmYWxzZSkgY29ubmVjdGlvbi5za2lwTG9ncygpOworICAgICAgICBpZiAoY29ubmVjdGlvbi5vbmxvZykgeworICAgICAgICAgICAgbG9nID0gd2FybiA9IGVycm9yID0gZnVuY3Rpb24oKSB7CisgICAgICAgICAgICAgICAgdmFyIGxvZyA9IHt9OworICAgICAgICAgICAgICAgIHZhciBpbmRleCA9IDA7CisgICAgICAgICAgICAgICAgQXJyYXkucHJvdG90eXBlLnNsaWNlLmNhbGwoYXJndW1lbnRzKS5mb3JFYWNoKGZ1bmN0aW9uKGFyZ3VtZW50KSB7CisgICAgICAgICAgICAgICAgICAgIGxvZ1tpbmRleCsrXSA9IHRvU3RyKGFyZ3VtZW50KTsKKyAgICAgICAgICAgICAgICB9KTsKKyAgICAgICAgICAgICAgICB0b1N0ciA9IGZ1bmN0aW9uKHN0cikgeworICAgICAgICAgICAgICAgICAgICByZXR1cm4gc3RyOworICAgICAgICAgICAgICAgIH07CisgICAgICAgICAgICAgICAgY29ubmVjdGlvbi5vbmxvZyhsb2cpOworICAgICAgICAgICAgfTsKKyAgICAgICAgfQorCisgICAgICAgIGZ1bmN0aW9uIHNldERpcmVjdGlvbnMoKSB7CisgICAgICAgICAgICB2YXIgdXNlck1heFBhcnRpY2lwYW50c0FsbG93ZWQgPSAwOworCisgICAgICAgICAgICAvLyBpZiB1c2VyIGhhcyBzZXQgYSBjdXN0b20gbWF4IHBhcnRpY2lwYW50IHNldHRpbmcsIHJlbWVtYmVyIGl0CisgICAgICAgICAgICBpZiAoY29ubmVjdGlvbi5tYXhQYXJ0aWNpcGFudHNBbGxvd2VkICE9IDI1NikgeworICAgICAgICAgICAgICAgIHVzZXJNYXhQYXJ0aWNpcGFudHNBbGxvd2VkID0gY29ubmVjdGlvbi5tYXhQYXJ0aWNpcGFudHNBbGxvd2VkOworICAgICAgICAgICAgfQorCisgICAgICAgICAgICBpZiAoY29ubmVjdGlvbi5kaXJlY3Rpb24gPT0gJ29uZS13YXknKSBjb25uZWN0aW9uLnNlc3Npb24ub25ld2F5ID0gdHJ1ZTsKKyAgICAgICAgICAgIGlmIChjb25uZWN0aW9uLmRpcmVjdGlvbiA9PSAnb25lLXRvLW9uZScpIGNvbm5lY3Rpb24ubWF4UGFydGljaXBhbnRzQWxsb3dlZCA9IDE7CisgICAgICAgICAgICBpZiAoY29ubmVjdGlvbi5kaXJlY3Rpb24gPT0gJ29uZS10by1tYW55JykgY29ubmVjdGlvbi5zZXNzaW9uLmJyb2FkY2FzdCA9IHRydWU7CisgICAgICAgICAgICBpZiAoY29ubmVjdGlvbi5kaXJlY3Rpb24gPT0gJ21hbnktdG8tbWFueScpIHsKKyAgICAgICAgICAgICAgICBpZiAoIWNvbm5lY3Rpb24ubWF4UGFydGljaXBhbnRzQWxsb3dlZCB8fCBjb25uZWN0aW9uLm1heFBhcnRpY2lwYW50c0FsbG93ZWQgPT0gMSkgeworICAgICAgICAgICAgICAgICAgICBjb25uZWN0aW9uLm1heFBhcnRpY2lwYW50c0FsbG93ZWQgPSAyNTY7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfQorCisgICAgICAgICAgICAvLyBpZiB1c2VyIGhhcyBzZXQgYSBjdXN0b20gbWF4IHBhcnRpY2lwYW50IHNldHRpbmcsIHNldCBpdCBiYWNrCisgICAgICAgICAgICBpZiAodXNlck1heFBhcnRpY2lwYW50c0FsbG93ZWQgJiYgY29ubmVjdGlvbi5tYXhQYXJ0aWNpcGFudHNBbGxvd2VkICE9IDEpIHsKKyAgICAgICAgICAgICAgICBjb25uZWN0aW9uLm1heFBhcnRpY2lwYW50c0FsbG93ZWQgPSB1c2VyTWF4UGFydGljaXBhbnRzQWxsb3dlZDsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorCisgICAgICAgIC8vIG9wZW4gbmV3IHNlc3Npb24KKyAgICAgICAgdGhpcy5pbml0U2Vzc2lvbiA9IGZ1bmN0aW9uKGFyZ3MpIHsKKyAgICAgICAgICAgIHJ0Y011bHRpU2Vzc2lvbi5pc093bmVyTGVhdmluZyA9IGZhbHNlOworCisgICAgICAgICAgICBzZXREaXJlY3Rpb25zKCk7CisgICAgICAgICAgICBwYXJ0aWNpcGFudHMgPSB7fTsKKworICAgICAgICAgICAgcnRjTXVsdGlTZXNzaW9uLmlzT3duZXJMZWF2aW5nID0gZmFsc2U7CisKKyAgICAgICAgICAgIGlmICghaXNOdWxsKGFyZ3MudHJhbnNtaXRSb29tT25jZSkpIHsKKyAgICAgICAgICAgICAgICBjb25uZWN0aW9uLnRyYW5zbWl0Um9vbU9uY2UgPSBhcmdzLnRyYW5zbWl0Um9vbU9uY2U7CisgICAgICAgICAgICB9CisKKyAgICAgICAgICAgIGZ1bmN0aW9uIHRyYW5zbWl0KCkgeworICAgICAgICAgICAgICAgIGlmIChkZWZhdWx0U29ja2V0ICYmIGdldExlbmd0aChwYXJ0aWNpcGFudHMpIDwgY29ubmVjdGlvbi5tYXhQYXJ0aWNpcGFudHNBbGxvd2VkICYmICFydGNNdWx0aVNlc3Npb24uaXNPd25lckxlYXZpbmcpIHsKKyAgICAgICAgICAgICAgICAgICAgZGVmYXVsdFNvY2tldC5zZW5kKGNvbm5lY3Rpb24uc2Vzc2lvbkRlc2NyaXB0aW9uKTsKKyAgICAgICAgICAgICAgICB9CisKKyAgICAgICAgICAgICAgICBpZiAoIWNvbm5lY3Rpb24udHJhbnNtaXRSb29tT25jZSAmJiAhcnRjTXVsdGlTZXNzaW9uLmlzT3duZXJMZWF2aW5nKQorICAgICAgICAgICAgICAgICAgICBzZXRUaW1lb3V0KHRyYW5zbWl0LCBjb25uZWN0aW9uLmludGVydmFsIHx8IDMwMDApOworICAgICAgICAgICAgfQorCisgICAgICAgICAgICAvLyB0b2RvOiB0ZXN0IGFuZCBmaXggbmV4dCBsaW5lLgorICAgICAgICAgICAgaWYgKCFhcmdzLmRvbnRUcmFuc21pdCAvKiB8fCBjb25uZWN0aW9uLnRyYW5zbWl0Um9vbU9uY2UgKi8gKSB0cmFuc21pdCgpOworICAgICAgICB9OworCisgICAgICAgIGZ1bmN0aW9uIGpvaW5TZXNzaW9uKF9jb25maWcsIHNraXBPblN0YXRlQ2hhbmdlKSB7CisgICAgICAgICAgICBpZiAocnRjTXVsdGlTZXNzaW9uLmRvbm90Sm9pbiAmJiBydGNNdWx0aVNlc3Npb24uZG9ub3RKb2luID09IF9jb25maWcuc2Vzc2lvbmlkKSB7CisgICAgICAgICAgICAgICAgcmV0dXJuOworICAgICAgICAgICAgfQorCisgICAgICAgICAgICAvLyBkb250T3ZlcnJpZGVTZXNzaW9uIGFsbG93cyB5b3UgZm9yY2UgUlRDTXVsdGlDb25uZWN0aW9uCisgICAgICAgICAgICAvLyB0byBub3Qgb3ZlcnJpZGUgZGVmYXVsdCBzZXNzaW9uIGZvciBwYXJ0aWNpcGFudHM7CisgICAgICAgICAgICAvLyBieSBkZWZhdWx0LCBzZXNzaW9uIGlzIGFsd2F5cyBvdmVycmlkZGVuIGFuZCBzZXQgdG8gdGhlIHNlc3Npb24gY29taW5nIGZyb20gaW5pdGlhdG9yIQorICAgICAgICAgICAgaWYgKCFjb25uZWN0aW9uLmRvbnRPdmVycmlkZVNlc3Npb24pIHsKKyAgICAgICAgICAgICAgICBjb25uZWN0aW9uLnNlc3Npb24gPSBfY29uZmlnLnNlc3Npb24gfHwge307CisgICAgICAgICAgICB9CisKKyAgICAgICAgICAgIC8vIG1ha2Ugc3VyZSB0aGF0IGluYXBwcm9wcmlhdGUgdXNlcnMgc2hvdWxkbid0IHJlY2VpdmUgb25OZXdTZXNzaW9uIGV2ZW50CisgICAgICAgICAgICBydGNNdWx0aVNlc3Npb24uYnJvYWRjYXN0ZXJpZCA9IF9jb25maWcudXNlcmlkOworCisgICAgICAgICAgICBpZiAoX2NvbmZpZy5zZXNzaW9uaWQpIHsKKyAgICAgICAgICAgICAgICAvLyB1c2VkIGxhdGVyIHRvIHByZXZlbnQgZXh0ZXJuYWwgcm9vbXMgbWVzc2FnZXMgdG8gYmUgdXNlZCBieSB0aGlzIHVzZXIhCisgICAgICAgICAgICAgICAgY29ubmVjdGlvbi5zZXNzaW9uaWQgPSBfY29uZmlnLnNlc3Npb25pZDsKKyAgICAgICAgICAgIH0KKworICAgICAgICAgICAgY29ubmVjdGlvbi5pc0FjY2VwdE5ld1Nlc3Npb24gPSBmYWxzZTsKKworICAgICAgICAgICAgdmFyIGNoYW5uZWwgPSBnZXRSYW5kb21TdHJpbmcoKTsKKyAgICAgICAgICAgIG5ld1ByaXZhdGVTb2NrZXQoeworICAgICAgICAgICAgICAgIGNoYW5uZWw6IGNoYW5uZWwsCisgICAgICAgICAgICAgICAgZXh0cmE6IF9jb25maWcuZXh0cmEgfHwge30sCisgICAgICAgICAgICAgICAgdXNlcmlkOiBfY29uZmlnLnVzZXJpZAorICAgICAgICAgICAgfSk7CisKKyAgICAgICAgICAgIHZhciBvZmZlcnMgPSB7fTsKKyAgICAgICAgICAgIGlmIChjb25uZWN0aW9uLmF0dGFjaFN0cmVhbXMubGVuZ3RoKSB7CisgICAgICAgICAgICAgICAgdmFyIHN0cmVhbSA9IGNvbm5lY3Rpb24uYXR0YWNoU3RyZWFtc1tjb25uZWN0aW9uLmF0dGFjaFN0cmVhbXMubGVuZ3RoIC0gMV07CisgICAgICAgICAgICAgICAgaWYgKCEhc3RyZWFtLmdldEF1ZGlvVHJhY2tzICYmIHN0cmVhbS5nZXRBdWRpb1RyYWNrcygpLmxlbmd0aCkgeworICAgICAgICAgICAgICAgICAgICBvZmZlcnMuYXVkaW8gPSB0cnVlOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICBpZiAoc3RyZWFtLmdldFZpZGVvVHJhY2tzKCkubGVuZ3RoKSB7CisgICAgICAgICAgICAgICAgICAgIG9mZmVycy52aWRlbyA9IHRydWU7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfQorCisgICAgICAgICAgICBpZiAoIWlzRW1wdHkob2ZmZXJzKSkgeworICAgICAgICAgICAgICAgIGxvZyh0b1N0cihvZmZlcnMpKTsKKyAgICAgICAgICAgIH0gZWxzZSBsb2coJ1NlZW1zIGRhdGEtb25seSBjb25uZWN0aW9uLicpOworCisgICAgICAgICAgICBjb25uZWN0aW9uLm9uc3RhdGVjaGFuZ2UoeworICAgICAgICAgICAgICAgIHVzZXJpZDogX2NvbmZpZy51c2VyaWQsCisgICAgICAgICAgICAgICAgZXh0cmE6IHt9LAorICAgICAgICAgICAgICAgIG5hbWU6ICdjb25uZWN0aW5nLXdpdGgtaW5pdGlhdG9yJywKKyAgICAgICAgICAgICAgICByZWFzb246ICdDaGVja2luZyBwcmVzZW5jZSBvZiB0aGUgaW5pdGlhdG9yOyBhbmQgdGhlIHJvb20uJworICAgICAgICAgICAgfSk7CisKKyAgICAgICAgICAgIGRlZmF1bHRTb2NrZXQuc2VuZCh7CisgICAgICAgICAgICAgICAgcGFydGljaXBhbnQ6IHRydWUsCisgICAgICAgICAgICAgICAgY2hhbm5lbDogY2hhbm5lbCwKKyAgICAgICAgICAgICAgICB0YXJnZXRVc2VyOiBfY29uZmlnLnVzZXJpZCwKKyAgICAgICAgICAgICAgICBzZXNzaW9uOiBjb25uZWN0aW9uLnNlc3Npb24sCisgICAgICAgICAgICAgICAgb2ZmZXJzOiB7CisgICAgICAgICAgICAgICAgICAgIGF1ZGlvOiAhIW9mZmVycy5hdWRpbywKKyAgICAgICAgICAgICAgICAgICAgdmlkZW86ICEhb2ZmZXJzLnZpZGVvCisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfSk7CisKKyAgICAgICAgICAgIGNvbm5lY3Rpb24uc2tpcE9uTmV3U2Vzc2lvbiA9IGZhbHNlOworICAgICAgICAgICAgaW52b2tlTWVkaWFDYXB0dXJlZChjb25uZWN0aW9uKTsKKyAgICAgICAgfQorCisgICAgICAgIC8vIGpvaW4gZXhpc3Rpbmcgc2Vzc2lvbgorICAgICAgICB0aGlzLmpvaW5TZXNzaW9uID0gZnVuY3Rpb24oX2NvbmZpZykgeworICAgICAgICAgICAgaWYgKCFkZWZhdWx0U29ja2V0KQorICAgICAgICAgICAgICAgIHJldHVybiBzZXRUaW1lb3V0KGZ1bmN0aW9uKCkgeworICAgICAgICAgICAgICAgICAgICB3YXJuKCdEZWZhdWx0LVNvY2tldCBpcyBub3QgeWV0IGluaXRpYWxpemVkLicpOworICAgICAgICAgICAgICAgICAgICBydGNNdWx0aVNlc3Npb24uam9pblNlc3Npb24oX2NvbmZpZyk7CisgICAgICAgICAgICAgICAgfSwgMTAwMCk7CisKKyAgICAgICAgICAgIF9jb25maWcgPSBfY29uZmlnIHx8IHt9OworICAgICAgICAgICAgcGFydGljaXBhbnRzID0ge307CisKKyAgICAgICAgICAgIHJ0Y011bHRpU2Vzc2lvbi5wcmVzZW5jZVN0YXRlID0gJ2NoZWNraW5nJzsKKworICAgICAgICAgICAgY29ubmVjdGlvbi5vbnN0YXRlY2hhbmdlKHsKKyAgICAgICAgICAgICAgICB1c2VyaWQ6IF9jb25maWcudXNlcmlkLAorICAgICAgICAgICAgICAgIGV4dHJhOiBfY29uZmlnLmV4dHJhIHx8IHt9LAorICAgICAgICAgICAgICAgIG5hbWU6ICdkZXRlY3Rpbmctcm9vbS1wcmVzZW5jZScsCisgICAgICAgICAgICAgICAgcmVhc29uOiAnQ2hlY2tpbmcgcHJlc2VuY2Ugb2YgdGhlIHJvb20uJworICAgICAgICAgICAgfSk7CisKKyAgICAgICAgICAgIGZ1bmN0aW9uIGNvbnRhY3RJbml0aWF0b3IoKSB7CisgICAgICAgICAgICAgICAgZGVmYXVsdFNvY2tldC5zZW5kKHsKKyAgICAgICAgICAgICAgICAgICAgbWVzc2FnZUZvcjogX2NvbmZpZy51c2VyaWQsCisgICAgICAgICAgICAgICAgICAgIHByZXNlbmNlU3RhdGU6IHJ0Y011bHRpU2Vzc2lvbi5wcmVzZW5jZVN0YXRlLAorICAgICAgICAgICAgICAgICAgICBfY29uZmlnOiB7CisgICAgICAgICAgICAgICAgICAgICAgICB1c2VyaWQ6IF9jb25maWcudXNlcmlkLAorICAgICAgICAgICAgICAgICAgICAgICAgZXh0cmE6IF9jb25maWcuZXh0cmEgfHwge30sCisgICAgICAgICAgICAgICAgICAgICAgICBzZXNzaW9uaWQ6IF9jb25maWcuc2Vzc2lvbmlkLAorICAgICAgICAgICAgICAgICAgICAgICAgc2Vzc2lvbjogX2NvbmZpZy5zZXNzaW9uIHx8IGZhbHNlCisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICB9KTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGNvbnRhY3RJbml0aWF0b3IoKTsKKworICAgICAgICAgICAgZnVuY3Rpb24gY2hlY2tlcigpIHsKKyAgICAgICAgICAgICAgICBpZiAocnRjTXVsdGlTZXNzaW9uLnByZXNlbmNlU3RhdGUgPT0gJ2NoZWNraW5nJykgeworICAgICAgICAgICAgICAgICAgICB3YXJuKCdVbmFibGUgdG8gcmVhY2ggaW5pdGlhdG9yLiBUcnlpbmcgYWdhaW4uLi4nKTsKKyAgICAgICAgICAgICAgICAgICAgY29udGFjdEluaXRpYXRvcigpOworICAgICAgICAgICAgICAgICAgICBzZXRUaW1lb3V0KGZ1bmN0aW9uKCkgeworICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHJ0Y011bHRpU2Vzc2lvbi5wcmVzZW5jZVN0YXRlID09ICdjaGVja2luZycpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb25uZWN0aW9uLm9uc3RhdGVjaGFuZ2UoeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB1c2VyaWQ6IF9jb25maWcudXNlcmlkLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBleHRyYTogX2NvbmZpZy5leHRyYSB8fCB7fSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbmFtZTogJ3Jvb20tbm90LWF2YWlsYWJsZScsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJlYXNvbjogJ0luaXRpYXRvciBzZWVtcyBhYnNlbnQuIFdhaXRpbmcgZm9yIHNvbWVvbmUgdG8gb3BlbiB0aGUgcm9vbS4nCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSk7CisKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb25uZWN0aW9uLmlzQWNjZXB0TmV3U2Vzc2lvbiA9IHRydWU7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2V0VGltZW91dChjaGVja2VyLCAyMDAwKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgfSwgMjAwMCk7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfQorCisgICAgICAgICAgICBzZXRUaW1lb3V0KGNoZWNrZXIsIDMwMDApOworICAgICAgICB9OworCisgICAgICAgIGNvbm5lY3Rpb24uZG9ub3RKb2luID0gZnVuY3Rpb24oc2Vzc2lvbmlkKSB7CisgICAgICAgICAgICBydGNNdWx0aVNlc3Npb24uZG9ub3RKb2luID0gc2Vzc2lvbmlkOworCisgICAgICAgICAgICB2YXIgc2Vzc2lvbiA9IGNvbm5lY3Rpb24uc2Vzc2lvbkRlc2NyaXB0aW9uc1tzZXNzaW9uaWRdOworICAgICAgICAgICAgaWYgKCFzZXNzaW9uKSByZXR1cm47CisKKyAgICAgICAgICAgIGRlZmF1bHRTb2NrZXQuc2VuZCh7CisgICAgICAgICAgICAgICAgZG9ub3RKb2luOiB0cnVlLAorICAgICAgICAgICAgICAgIG1lc3NhZ2VGb3I6IHNlc3Npb24udXNlcmlkLAorICAgICAgICAgICAgICAgIHNlc3Npb25pZDogc2Vzc2lvbmlkCisgICAgICAgICAgICB9KTsKKworICAgICAgICAgICAgcGFydGljaXBhbnRzID0ge307CisgICAgICAgICAgICBjb25uZWN0aW9uLmlzQWNjZXB0TmV3U2Vzc2lvbiA9IHRydWU7CisgICAgICAgICAgICBjb25uZWN0aW9uLnNlc3Npb25pZCA9IG51bGw7CisgICAgICAgIH07CisKKyAgICAgICAgLy8gc2VuZCBmaWxlL2RhdGEgb3IgdGV4dCBtZXNzYWdlCisgICAgICAgIHRoaXMuc2VuZCA9IGZ1bmN0aW9uKG1lc3NhZ2UsIF9jaGFubmVsKSB7CisgICAgICAgICAgICBpZiAoIShtZXNzYWdlIGluc3RhbmNlb2YgQXJyYXlCdWZmZXIgfHwgbWVzc2FnZSBpbnN0YW5jZW9mIERhdGFWaWV3KSkgeworICAgICAgICAgICAgICAgIG1lc3NhZ2UgPSBzdHIyYWIoeworICAgICAgICAgICAgICAgICAgICBleHRyYTogY29ubmVjdGlvbi5leHRyYSwKKyAgICAgICAgICAgICAgICAgICAgdXNlcmlkOiBjb25uZWN0aW9uLnVzZXJpZCwKKyAgICAgICAgICAgICAgICAgICAgZGF0YTogbWVzc2FnZQorICAgICAgICAgICAgICAgIH0pOworICAgICAgICAgICAgfQorCisgICAgICAgICAgICBpZiAoX2NoYW5uZWwpIHsKKyAgICAgICAgICAgICAgICBpZiAoX2NoYW5uZWwucmVhZHlTdGF0ZSA9PSAnb3BlbicpIHsKKyAgICAgICAgICAgICAgICAgICAgX2NoYW5uZWwuc2VuZChtZXNzYWdlKTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgcmV0dXJuOworICAgICAgICAgICAgfQorCisgICAgICAgICAgICBmb3IgKHZhciBkYXRhQ2hhbm5lbCBpbiBjb25uZWN0aW9uLmNoYW5uZWxzKSB7CisgICAgICAgICAgICAgICAgdmFyIGNoYW5uZWwgPSBjb25uZWN0aW9uLmNoYW5uZWxzW2RhdGFDaGFubmVsXS5jaGFubmVsOworICAgICAgICAgICAgICAgIGlmIChjaGFubmVsLnJlYWR5U3RhdGUgPT0gJ29wZW4nKSB7CisgICAgICAgICAgICAgICAgICAgIGNoYW5uZWwuc2VuZChtZXNzYWdlKTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9CisgICAgICAgIH07CisKKyAgICAgICAgLy8gbGVhdmUgc2Vzc2lvbgorICAgICAgICB0aGlzLmxlYXZlID0gZnVuY3Rpb24oKSB7CisgICAgICAgICAgICBjbGVhclNlc3Npb24oKTsKKyAgICAgICAgfTsKKworICAgICAgICAvLyByZW5lZ290aWF0ZSBuZXcgc3RyZWFtCisgICAgICAgIHRoaXMuYWRkU3RyZWFtID0gZnVuY3Rpb24oZSkgeworICAgICAgICAgICAgdmFyIHNlc3Npb24gPSBlLnJlbmVnb3RpYXRlOworCisgICAgICAgICAgICBpZiAoIWNvbm5lY3Rpb24ucmVuZWdvdGlhdGVkU2Vzc2lvbnNbSlNPTi5zdHJpbmdpZnkoZS5yZW5lZ290aWF0ZSldKSB7CisgICAgICAgICAgICAgICAgY29ubmVjdGlvbi5yZW5lZ290aWF0ZWRTZXNzaW9uc1tKU09OLnN0cmluZ2lmeShlLnJlbmVnb3RpYXRlKV0gPSB7CisgICAgICAgICAgICAgICAgICAgIHNlc3Npb246IGUucmVuZWdvdGlhdGUsCisgICAgICAgICAgICAgICAgICAgIHN0cmVhbTogZS5zdHJlYW0KKyAgICAgICAgICAgICAgICB9OworICAgICAgICAgICAgfQorCisgICAgICAgICAgICBpZiAoZS5zb2NrZXQpIHsKKyAgICAgICAgICAgICAgICBpZiAoZS5zb2NrZXQudXNlcmlkICE9IGNvbm5lY3Rpb24udXNlcmlkKSB7CisgICAgICAgICAgICAgICAgICAgIGFkZFN0cmVhbShjb25uZWN0aW9uLnBlZXJzW2Uuc29ja2V0LnVzZXJpZF0pOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICAgICAgZm9yICh2YXIgcGVlciBpbiBjb25uZWN0aW9uLnBlZXJzKSB7CisgICAgICAgICAgICAgICAgICAgIGlmIChwZWVyICE9IGNvbm5lY3Rpb24udXNlcmlkKSB7CisgICAgICAgICAgICAgICAgICAgICAgICBhZGRTdHJlYW0oY29ubmVjdGlvbi5wZWVyc1twZWVyXSk7CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9CisKKyAgICAgICAgICAgIGZ1bmN0aW9uIGFkZFN0cmVhbShfcGVlcikgeworICAgICAgICAgICAgICAgIHZhciBzb2NrZXQgPSBfcGVlci5zb2NrZXQ7CisKKyAgICAgICAgICAgICAgICBpZiAoIXNvY2tldCkgeworICAgICAgICAgICAgICAgICAgICB3YXJuKF9wZWVyLCAnZG9lc25cJ3QgaGFzIHNvY2tldC4nKTsKKyAgICAgICAgICAgICAgICAgICAgcmV0dXJuOworICAgICAgICAgICAgICAgIH0KKworICAgICAgICAgICAgICAgIHVwZGF0ZVNvY2tldEZvckxvY2FsU3RyZWFtcyhzb2NrZXQpOworCisgICAgICAgICAgICAgICAgaWYgKCFfcGVlciB8fCAhX3BlZXIucGVlcikgeworICAgICAgICAgICAgICAgICAgICB0aHJvdyAnTm8gcGVlciB0byByZW5lZ290aWF0ZS4nOworICAgICAgICAgICAgICAgIH0KKworICAgICAgICAgICAgICAgIHZhciBwZWVyID0gX3BlZXIucGVlcjsKKworICAgICAgICAgICAgICAgIGlmIChlLnN0cmVhbSkgeworICAgICAgICAgICAgICAgICAgICBpZiAoIXBlZXIuYXR0YWNoU3RyZWFtcykgeworICAgICAgICAgICAgICAgICAgICAgICAgcGVlci5hdHRhY2hTdHJlYW1zID0gW107CisgICAgICAgICAgICAgICAgICAgIH0KKworICAgICAgICAgICAgICAgICAgICBwZWVyLmF0dGFjaFN0cmVhbXMucHVzaChlLnN0cmVhbSk7CisgICAgICAgICAgICAgICAgfQorCisgICAgICAgICAgICAgICAgLy8gZGV0YWNoaW5nIG9sZCBzdHJlYW1zCisgICAgICAgICAgICAgICAgZGV0YWNoTWVkaWFTdHJlYW0oY29ubmVjdGlvbi5kZXRhY2hTdHJlYW1zLCBwZWVyLmNvbm5lY3Rpb24pOworCisgICAgICAgICAgICAgICAgaWYgKGUuc3RyZWFtICYmIChzZXNzaW9uLmF1ZGlvIHx8IHNlc3Npb24udmlkZW8gfHwgc2Vzc2lvbi5zY3JlZW4pKSB7CisgICAgICAgICAgICAgICAgICAgIHBlZXIuYWRkU3RyZWFtKGUuc3RyZWFtKTsKKyAgICAgICAgICAgICAgICB9CisKKyAgICAgICAgICAgICAgICBwZWVyLnJlY3JlYXRlT2ZmZXIoc2Vzc2lvbiwgZnVuY3Rpb24oc2RwLCBzdHJlYW1pbmZvKSB7CisgICAgICAgICAgICAgICAgICAgIHNlbmRzZHAoeworICAgICAgICAgICAgICAgICAgICAgICAgc2RwOiBzZHAsCisgICAgICAgICAgICAgICAgICAgICAgICBzb2NrZXQ6IHNvY2tldCwKKyAgICAgICAgICAgICAgICAgICAgICAgIHJlbmVnb3RpYXRlOiBzZXNzaW9uLAorICAgICAgICAgICAgICAgICAgICAgICAgbGFiZWxzOiBjb25uZWN0aW9uLmRldGFjaFN0cmVhbXMsCisgICAgICAgICAgICAgICAgICAgICAgICBzdHJlYW1pbmZvOiBzdHJlYW1pbmZvCisgICAgICAgICAgICAgICAgICAgIH0pOworICAgICAgICAgICAgICAgICAgICBjb25uZWN0aW9uLmRldGFjaFN0cmVhbXMgPSBbXTsKKyAgICAgICAgICAgICAgICB9KTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfTsKKworICAgICAgICAvLyB3d3cuUlRDTXVsdGlDb25uZWN0aW9uLm9yZy9kb2NzL3JlcXVlc3QvCisgICAgICAgIGNvbm5lY3Rpb24ucmVxdWVzdCA9IGZ1bmN0aW9uKHVzZXJpZCwgZXh0cmEpIHsKKyAgICAgICAgICAgIGNvbm5lY3Rpb24uY2FwdHVyZVVzZXJNZWRpYShmdW5jdGlvbigpIHsKKyAgICAgICAgICAgICAgICAvLyBvcGVuIHByaXZhdGUgc29ja2V0IHRoYXQgd2lsbCBiZSB1c2VkIHRvIHJlY2VpdmUgb2ZmZXItc2RwCisgICAgICAgICAgICAgICAgbmV3UHJpdmF0ZVNvY2tldCh7CisgICAgICAgICAgICAgICAgICAgIGNoYW5uZWw6IGNvbm5lY3Rpb24udXNlcmlkLAorICAgICAgICAgICAgICAgICAgICBleHRyYTogZXh0cmEgfHwge30sCisgICAgICAgICAgICAgICAgICAgIHVzZXJpZDogdXNlcmlkCisgICAgICAgICAgICAgICAgfSk7CisKKyAgICAgICAgICAgICAgICAvLyBhc2sgb3RoZXIgdXNlciB0byBjcmVhdGUgb2ZmZXItc2RwCisgICAgICAgICAgICAgICAgZGVmYXVsdFNvY2tldC5zZW5kKHsKKyAgICAgICAgICAgICAgICAgICAgcGFydGljaXBhbnQ6IHRydWUsCisgICAgICAgICAgICAgICAgICAgIHRhcmdldFVzZXI6IHVzZXJpZAorICAgICAgICAgICAgICAgIH0pOworICAgICAgICAgICAgfSk7CisgICAgICAgIH07CisKKyAgICAgICAgZnVuY3Rpb24gYWNjZXB0UmVxdWVzdChyZXNwb25zZSkgeworICAgICAgICAgICAgaWYgKCFydGNNdWx0aVNlc3Npb24ucmVxdWVzdHNGcm9tKSBydGNNdWx0aVNlc3Npb24ucmVxdWVzdHNGcm9tID0ge307CisgICAgICAgICAgICBpZiAocnRjTXVsdGlTZXNzaW9uLnJlcXVlc3RzRnJvbVtyZXNwb25zZS51c2VyaWRdKSByZXR1cm47CisKKyAgICAgICAgICAgIHZhciBvYmogPSB7CisgICAgICAgICAgICAgICAgdXNlcmlkOiByZXNwb25zZS51c2VyaWQsCisgICAgICAgICAgICAgICAgZXh0cmE6IHJlc3BvbnNlLmV4dHJhLAorICAgICAgICAgICAgICAgIGNoYW5uZWw6IHJlc3BvbnNlLmNoYW5uZWwgfHwgcmVzcG9uc2UudXNlcmlkLAorICAgICAgICAgICAgICAgIHNlc3Npb246IHJlc3BvbnNlLnNlc3Npb24gfHwgY29ubmVjdGlvbi5zZXNzaW9uCisgICAgICAgICAgICB9OworCisgICAgICAgICAgICAvLyBjaGVjayBob3cgcGFydGljaXBhbnQgaXMgd2lsbGluZyB0byBqb2luCisgICAgICAgICAgICBpZiAocmVzcG9uc2Uub2ZmZXJzKSB7CisgICAgICAgICAgICAgICAgaWYgKHJlc3BvbnNlLm9mZmVycy5hdWRpbyAmJiByZXNwb25zZS5vZmZlcnMudmlkZW8pIHsKKyAgICAgICAgICAgICAgICAgICAgbG9nKCd0YXJnZXQgdXNlciBoYXMgYm90aCBhdWRpby92aWRlbyBzdHJlYW1zLicpOworICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAocmVzcG9uc2Uub2ZmZXJzLmF1ZGlvICYmICFyZXNwb25zZS5vZmZlcnMudmlkZW8pIHsKKyAgICAgICAgICAgICAgICAgICAgbG9nKCd0YXJnZXQgdXNlciBoYXMgb25seSBhdWRpbyBzdHJlYW0uJyk7CisgICAgICAgICAgICAgICAgfSBlbHNlIGlmICghcmVzcG9uc2Uub2ZmZXJzLmF1ZGlvICYmIHJlc3BvbnNlLm9mZmVycy52aWRlbykgeworICAgICAgICAgICAgICAgICAgICBsb2coJ3RhcmdldCB1c2VyIGhhcyBvbmx5IHZpZGVvIHN0cmVhbS4nKTsKKyAgICAgICAgICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgICAgICAgICBsb2coJ3RhcmdldCB1c2VyIGhhcyBubyBzdHJlYW07IGl0IHNlZW1zIG9uZS13YXkgc3RyZWFtaW5nIG9yIGRhdGEtb25seSBjb25uZWN0aW9uLicpOworICAgICAgICAgICAgICAgIH0KKworICAgICAgICAgICAgICAgIHZhciBtYW5kYXRvcnkgPSBjb25uZWN0aW9uLnNkcENvbnN0cmFpbnRzLm1hbmRhdG9yeTsKKyAgICAgICAgICAgICAgICBpZiAoaXNOdWxsKG1hbmRhdG9yeS5PZmZlclRvUmVjZWl2ZUF1ZGlvKSkgeworICAgICAgICAgICAgICAgICAgICBjb25uZWN0aW9uLnNkcENvbnN0cmFpbnRzLm1hbmRhdG9yeS5PZmZlclRvUmVjZWl2ZUF1ZGlvID0gISFyZXNwb25zZS5vZmZlcnMuYXVkaW87CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIGlmIChpc051bGwobWFuZGF0b3J5Lk9mZmVyVG9SZWNlaXZlVmlkZW8pKSB7CisgICAgICAgICAgICAgICAgICAgIGNvbm5lY3Rpb24uc2RwQ29uc3RyYWludHMubWFuZGF0b3J5Lk9mZmVyVG9SZWNlaXZlVmlkZW8gPSAhIXJlc3BvbnNlLm9mZmVycy52aWRlbzsKKyAgICAgICAgICAgICAgICB9CisKKyAgICAgICAgICAgICAgICBsb2coJ3RhcmdldCB1c2VyXCdzIFNEUCBoYXM/JywgdG9TdHIoY29ubmVjdGlvbi5zZHBDb25zdHJhaW50cy5tYW5kYXRvcnkpKTsKKyAgICAgICAgICAgIH0KKworICAgICAgICAgICAgcnRjTXVsdGlTZXNzaW9uLnJlcXVlc3RzRnJvbVtyZXNwb25zZS51c2VyaWRdID0gb2JqOworCisgICAgICAgICAgICAvLyB3d3cuUlRDTXVsdGlDb25uZWN0aW9uLm9yZy9kb2NzL29uUmVxdWVzdC8KKyAgICAgICAgICAgIGlmIChjb25uZWN0aW9uLm9uUmVxdWVzdCAmJiBjb25uZWN0aW9uLmlzSW5pdGlhdG9yKSB7CisgICAgICAgICAgICAgICAgY29ubmVjdGlvbi5vblJlcXVlc3Qob2JqKTsKKyAgICAgICAgICAgIH0gZWxzZSBfYWNjZXB0KG9iaik7CisgICAgICAgIH0KKworICAgICAgICBmdW5jdGlvbiBfYWNjZXB0KGUpIHsKKyAgICAgICAgICAgIGlmIChydGNNdWx0aVNlc3Npb24uY2FwdHVyZVVzZXJNZWRpYU9uRGVtYW5kKSB7CisgICAgICAgICAgICAgICAgcnRjTXVsdGlTZXNzaW9uLmNhcHR1cmVVc2VyTWVkaWFPbkRlbWFuZCA9IGZhbHNlOworICAgICAgICAgICAgICAgIGNvbm5lY3Rpb24uY2FwdHVyZVVzZXJNZWRpYShmdW5jdGlvbigpIHsKKyAgICAgICAgICAgICAgICAgICAgX2FjY2VwdChlKTsKKworICAgICAgICAgICAgICAgICAgICBpbnZva2VNZWRpYUNhcHR1cmVkKGNvbm5lY3Rpb24pOworICAgICAgICAgICAgICAgIH0pOworICAgICAgICAgICAgICAgIHJldHVybjsKKyAgICAgICAgICAgIH0KKworICAgICAgICAgICAgbG9nKCdhY2NlcHRpbmcgcmVxdWVzdCBmcm9tJywgZS51c2VyaWQpOworICAgICAgICAgICAgcGFydGljaXBhbnRzW2UudXNlcmlkXSA9IGUudXNlcmlkOworICAgICAgICAgICAgbmV3UHJpdmF0ZVNvY2tldCh7CisgICAgICAgICAgICAgICAgaXNvZmZlcmVyOiB0cnVlLAorICAgICAgICAgICAgICAgIHVzZXJpZDogZS51c2VyaWQsCisgICAgICAgICAgICAgICAgY2hhbm5lbDogZS5jaGFubmVsLAorICAgICAgICAgICAgICAgIGV4dHJhOiBlLmV4dHJhIHx8IHt9LAorICAgICAgICAgICAgICAgIHNlc3Npb246IGUuc2Vzc2lvbiB8fCBjb25uZWN0aW9uLnNlc3Npb24KKyAgICAgICAgICAgIH0pOworICAgICAgICB9CisKKyAgICAgICAgLy8gd3d3LlJUQ011bHRpQ29ubmVjdGlvbi5vcmcvZG9jcy9hY2NlcHQvCisgICAgICAgIGNvbm5lY3Rpb24uYWNjZXB0ID0gZnVuY3Rpb24oZSkgeworICAgICAgICAgICAgLy8gZm9yIGJhY2t3YXJkIGNvbXBhdGliaWxpdHkKKyAgICAgICAgICAgIGlmIChhcmd1bWVudHMubGVuZ3RoID4gMSAmJiBpc1N0cmluZyhhcmd1bWVudHNbMF0pKSB7CisgICAgICAgICAgICAgICAgZSA9IHt9OworICAgICAgICAgICAgICAgIGlmIChhcmd1bWVudHNbMF0pIGUudXNlcmlkID0gYXJndW1lbnRzWzBdOworICAgICAgICAgICAgICAgIGlmIChhcmd1bWVudHNbMV0pIGUuZXh0cmEgPSBhcmd1bWVudHNbMV07CisgICAgICAgICAgICAgICAgaWYgKGFyZ3VtZW50c1syXSkgZS5jaGFubmVsID0gYXJndW1lbnRzWzJdOworICAgICAgICAgICAgfQorCisgICAgICAgICAgICBjb25uZWN0aW9uLmNhcHR1cmVVc2VyTWVkaWEoZnVuY3Rpb24oKSB7CisgICAgICAgICAgICAgICAgX2FjY2VwdChlKTsKKyAgICAgICAgICAgIH0pOworICAgICAgICB9OworCisgICAgICAgIHZhciBpc1JNU0RlbGV0ZWQgPSBmYWxzZTsKKyAgICAgICAgdGhpcy5kaXNjb25uZWN0ID0gZnVuY3Rpb24oKSB7CisgICAgICAgICAgICB0aGlzLmlzT3duZXJMZWF2aW5nID0gdHJ1ZTsKKworICAgICAgICAgICAgaWYgKCFjb25uZWN0aW9uLmtlZXBTdHJlYW1zT3BlbmVkKSB7CisgICAgICAgICAgICAgICAgZm9yICh2YXIgc3RyZWFtaWQgaW4gY29ubmVjdGlvbi5sb2NhbFN0cmVhbXMpIHsKKyAgICAgICAgICAgICAgICAgICAgY29ubmVjdGlvbi5sb2NhbFN0cmVhbXNbc3RyZWFtaWRdLnN0b3AoKTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgY29ubmVjdGlvbi5sb2NhbFN0cmVhbXMgPSB7fTsKKworICAgICAgICAgICAgICAgIGN1cnJlbnRVc2VyTWVkaWFSZXF1ZXN0ID0geworICAgICAgICAgICAgICAgICAgICBzdHJlYW1zOiBbXSwKKyAgICAgICAgICAgICAgICAgICAgbXV0ZXg6IGZhbHNlLAorICAgICAgICAgICAgICAgICAgICBxdWV1ZVJlcXVlc3RzOiBbXQorICAgICAgICAgICAgICAgIH07CisgICAgICAgICAgICB9CisKKyAgICAgICAgICAgIGlmIChjb25uZWN0aW9uLmlzSW5pdGlhdG9yKSB7CisgICAgICAgICAgICAgICAgZGVmYXVsdFNvY2tldC5zZW5kKHsKKyAgICAgICAgICAgICAgICAgICAgaXNEaXNjb25uZWN0U29ja2V0czogdHJ1ZQorICAgICAgICAgICAgICAgIH0pOworICAgICAgICAgICAgfQorCisgICAgICAgICAgICBjb25uZWN0aW9uLnJlZnJlc2goKTsKKworICAgICAgICAgICAgcnRjTXVsdGlTZXNzaW9uLmRlZmF1bHRTb2NrZXQgPSBkZWZhdWx0U29ja2V0ID0gbnVsbDsKKyAgICAgICAgICAgIGlzUk1TRGVsZXRlZCA9IHRydWU7CisKKyAgICAgICAgICAgIGNvbm5lY3Rpb24ub25kaXNjb25uZWN0ZWQoeworICAgICAgICAgICAgICAgIHVzZXJpZDogY29ubmVjdGlvbi51c2VyaWQsCisgICAgICAgICAgICAgICAgZXh0cmE6IGNvbm5lY3Rpb24uZXh0cmEsCisgICAgICAgICAgICAgICAgcGVlcjogY29ubmVjdGlvbi5wZWVyc1tjb25uZWN0aW9uLnVzZXJpZF0sCisgICAgICAgICAgICAgICAgaXNTb2NrZXRzRGlzY29ubmVjdGVkOiB0cnVlCisgICAgICAgICAgICB9KTsKKworICAgICAgICAgICAgLy8gaWYgdGhlcmUgaXMgYW55IHBlZXIgc3RpbGwgb3BlbmVkOyBjbG9zZSBpdC4KKyAgICAgICAgICAgIGNvbm5lY3Rpb24uY2xvc2UoKTsKKworICAgICAgICAgICAgd2luZG93LnJlbW92ZUV2ZW50TGlzdGVuZXIoJ2JlZm9yZXVubG9hZCcsIHJ0Y011bHRpU2Vzc2lvbi5sZWF2ZUhhbmRsZXIpOworICAgICAgICAgICAgd2luZG93LnJlbW92ZUV2ZW50TGlzdGVuZXIoJ2tleXVwJywgcnRjTXVsdGlTZXNzaW9uLmxlYXZlSGFuZGxlcik7CisKKyAgICAgICAgICAgIC8vIGl0IHdpbGwgbm90IHdvcmssIHRob3VnaCA6KQorICAgICAgICAgICAgZGVsZXRlIHRoaXM7CisKKyAgICAgICAgICAgIGxvZygnRGlzY29ubmVjdGVkIHlvdXIgc29ja2V0cywgcGVlcnMsIHN0cmVhbXMgYW5kIGV2ZXJ5dGhpbmcgZXhjZXB0IFJUQ011bHRpQ29ubmVjdGlvbiBvYmplY3QuJyk7CisgICAgICAgIH07CisgICAgfQorC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AmJiAhc2Vzc2lvbi52aWRlbyAmJiAhc2Vzc2lvbi5zY3JlZW4gJiYgc2Vzc2lvbi5kYXRhOworICAgIH0KKworICAgIGZ1bmN0aW9uIGlzTnVsbChvYmopIHsKKyAgICAgICAgcmV0dXJuIHR5cGVvZiBvYmogPT0gJ3VuZGVmaW5lZCc7CisgICAgfQorCisgICAgZnVuY3Rpb24gaXNTdHJpbmcob2JqKSB7CisgICAgICAgIHJldHVybiB0eXBlb2Ygb2JqID09ICdzdHJpbmcnOworICAgIH0KKworICAgIGZ1bmN0aW9uIGlzRW1wdHkoc2Vzc2lvbikgeworICAgICAgICB2YXIgbGVuZ3RoID0gMDsKKyAgICAgICAgZm9yICh2YXIgcyBpbiBzZXNzaW9uKSB7CisgICAgICAgICAgICBsZW5ndGgrKzsKKyAgICAgICAgfQorICAgICAgICByZXR1cm4gbGVuZ3RoID09IDA7CisgICAgfQorCisgICAgLy8gdGhpcyBtZXRob2QgY29udmVydHMgYXJyYXktYnVmZmVyIGludG8gc3RyaW5nCisgICAgZnVuY3Rpb24gYWIyc3RyKGJ1ZikgeworICAgICAgICB2YXIgcmVzdWx0ID0gJyc7CisgICAgICAgIHRyeSB7CisgICAgICAgICAgICByZXN1bHQgPSBTdHJpbmcuZnJvbUNoYXJDb2RlLmFwcGx5KG51bGwsIG5ldyBVaW50MTZBcnJheShidWYpKTsKKyAgICAgICAgfSBjYXRjaCAoZSkge30KKyAgICAgICAgcmV0dXJuIHJlc3VsdDsKKyAgICB9CisKKyAgICAvLyB0aGlzIG1ldGhvZCBjb252ZXJ0cyBzdHJpbmcgaW50byBhcnJheS1idWZmZXIKKyAgICBmdW5jdGlvbiBzdHIyYWIoc3RyKSB7CisgICAgICAgIGlmICghaXNTdHJpbmcoc3RyKSkgc3RyID0gSlNPTi5zdHJpbmdpZnkoc3RyKTsKKworICAgICAgICB2YXIgYnVmID0gbmV3IEFycmF5QnVmZmVyKHN0ci5sZW5ndGggKiAyKTsgLy8gMiBieXRlcyBmb3IgZWFjaCBjaGFyCisgICAgICAgIHZhciBidWZWaWV3ID0gbmV3IFVpbnQxNkFycmF5KGJ1Zik7CisgICAgICAgIGZvciAodmFyIGkgPSAwLCBzdHJMZW4gPSBzdHIubGVuZ3RoOyBpIDwgc3RyTGVuOyBpKyspIHsKKyAgICAgICAgICAgIGJ1ZlZpZXdbaV0gPSBzdHIuY2hhckNvZGVBdChpKTsKKyAgICAgICAgfQorICAgICAgICByZXR1cm4gYnVmOworICAgIH0KKworICAgIGZ1bmN0aW9uIHN3YXAoYXJyKSB7CisgICAgICAgIHZhciBzd2FwcGVkID0gW10sCisgICAgICAgICAgICBsZW5ndGggPSBhcnIubGVuZ3RoOworICAgICAgICBmb3IgKHZhciBpID0gMDsgaSA8IGxlbmd0aDsgaSsrKQorICAgICAgICAgICAgaWYgKGFycltpXSAmJiBhcnJbaV0gIT09IHRydWUpCisgICAgICAgICAgICAgICAgc3dhcHBlZC5wdXNoKGFycltpXSk7CisgICAgICAgIHJldHVybiBzd2FwcGVkOworICAgIH0KKworICAgIGZ1bmN0aW9uIGZvckVhY2gob2JqLCBjYWxsYmFjaykgeworICAgICAgICBmb3IgKHZhciBpdGVtIGluIG9iaikgeworICAgICAgICAgICAgY2FsbGJhY2sob2JqW2l0ZW1dLCBpdGVtKTsKKyAgICAgICAgfQorICAgIH0KKworICAgIHZhciBjb25zb2xlID0gd2luZG93LmNvbnNvbGUgfHwgeworICAgICAgICBsb2c6IGZ1bmN0aW9uKCkge30sCisgICAgICAgIGVycm9yOiBmdW5jdGlvbigpIHt9LAorICAgICAgICB3YXJuOiBmdW5jdGlvbigpIHt9CisgICAgfTsKKworICAgIGZ1bmN0aW9uIGxvZygpIHsKKyAgICAgICAgY29uc29sZS5sb2coYXJndW1lbnRzKTsKKyAgICB9CisKKyAgICBmdW5jdGlvbiBlcnJvcigpIHsKKyAgICAgICAgY29uc29sZS5lcnJvcihhcmd1bWVudHMpOworICAgIH0KKworICAgIGZ1bmN0aW9uIHdhcm4oKSB7CisgICAgICAgIGNvbnNvbGUud2Fybihhcmd1bWVudHMpOworICAgIH0KKworICAgIGlmIChpc0Nocm9tZSB8fCBpc0ZpcmVmb3ggfHwgaXNTYWZhcmkpIHsKKyAgICAgICAgdmFyIGxvZyA9IGNvbnNvbGUubG9nLmJpbmQoY29uc29sZSk7CisgICAgICAgIHZhciBlcnJvciA9IGNvbnNvbGUuZXJyb3IuYmluZChjb25zb2xlKTsKKyAgICAgICAgdmFyIHdhcm4gPSBjb25zb2xlLndhcm4uYmluZChjb25zb2xlKTsKKyAgICB9CisKKyAgICBmdW5jdGlvbiB0b1N0cihvYmopIHsKKyAgICAgICAgcmV0dXJuIEpTT04uc3RyaW5naWZ5KG9iaiwgZnVuY3Rpb24oa2V5LCB2YWx1ZSkgeworICAgICAgICAgICAgaWYgKHZhbHVlICYmIHZhbHVlLnNkcCkgeworICAgICAgICAgICAgICAgIGxvZyh2YWx1ZS5zZHAudHlwZSwgJ1x0JywgdmFsdWUuc2RwLnNkcCk7CisgICAgICAgICAgICAgICAgcmV0dXJuICcnOworICAgICAgICAgICAgfSBlbHNlIHJldHVybiB2YWx1ZTsKKyAgICAgICAgfSwgJ1x0Jyk7CisgICAgfQorCisgICAgZnVuY3Rpb24gZ2V0TGVuZ3RoKG9iaikgeworICAgICAgICB2YXIgbGVuZ3RoID0gMDsKKyAgICAgICAgZm9yICh2YXIgbyBpbiBvYmopCisgICAgICAgICAgICBpZiAobykgbGVuZ3RoKys7CisgICAgICAgIHJldHVybiBsZW5ndGg7CisgICAgfQorCisgICAgLy8gR2V0IEhUTUxBdWRpb0VsZW1lbnQvSFRNTFZpZGVvRWxlbWVudCBhY2NvcmRpbmdseQorCisgICAgZnVuY3Rpb24gY3JlYXRlTWVkaWFFbGVtZW50KHN0cmVhbSwgc2Vzc2lvbikgeworICAgICAgICB2YXIgbWVkaWFFbGVtZW50ID0gZG9jdW1lbnQuY3JlYXRlRWxlbWVudChzdHJlYW0uaXNBdWRpbyA/ICdhdW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geWV0IHN1cHBvcnQgb25lbmRlZCBmb3IgYW55IHN0cmVhbSAocmVtb3RlL2xvY2FsKQorICAgICAgICBpc0ZpcmVmb3ggJiYgbWVkaWFFbGVtZW50LmFkZEV2ZW50TGlzdGVuZXIoJ2VuZGVkJywgZnVuY3Rpb24oKSB7CisgICAgICAgICAgICBzdHJlYW0ub25lbmRlZCgpOworICAgICAgICB9LCBmYWxzZSk7CisKKyAgICAgICAgbWVkaWFFbGVtZW50LnBsYXkoKTsKKworICAgICAgICByZXR1cm4gbWVkaWFFbGVtZW50OworICAgIH0KKworICAgIHZhciBvblN0cmVhbUVuZGVkSGFuZGxlckZpcmVkRm9yID0ge307CisKKyAgICBmdW5jdGlvbiBvblN0cmVhbUVuZGVkSGFuZGxlcihzdHJlYW1lZE9iamVjdCwgY29ubmVjdGlvbikgeworICAgICAgICBpZiAoc3RyZWFtZWRPYmplY3QubWVkaWFFbGVtZW50ICYmICFzdHJlYW1lZE9iamVjdC5tZWRpYUVsZW1lbnQucGFyZW50Tm9kZSkgcmV0dXJuOworCisgICAgICAgIGlmIChvblN0cmVhbUVuZGVkSGFuZGxlckZpcmVkRm9yW3N0cmVhbWVkT2JqZWN0LnN0cmVhbWlkXSkgcmV0dXJuOworICAgICAgICBvblN0cmVhbUVuZGVkSGFuZGxlckZpcmVkRm9yW3N0cmVhbWVkT2JqZWN0LnN0cmVhbWlkXSA9IHN0cmVhbWVkT2JqZWN0OworICAgICAgICBjb25uZWN0aW9uLm9uc3RyZWFtZW5kZWQoc3RyZWFtZWRPYmplY3QpOworICAgIH0KKworICAgIHZhciBvbkxlYXZlSGFuZGxlckZpcmVkRm9yID0ge307CisKKyAgICBmdW5jdGlvbiBvbkxlYXZlSGFuZGxlcihldmVudCwgY29ubmVjdGlvbikgeworICAgICAgICBpZiAob25MZWF2ZUhhbmRsZXJGaXJlZEZvcltldmVudC51c2VyaWRdKSByZXR1cm47CisgICAgICAgIG9uTGVhdmVIYW5kbGVyRmlyZWRGb3JbZXZlbnQudXNlcmlkXSA9IGV2ZW50OworICAgICAgICBjb25uZWN0aW9uLm9ubGVhdmUoZXZlbnQpOworICAgIH0KKworICAgIGZ1bmN0aW9uIHRha2VTbmFwc2hvdChhcmdzKSB7CisgICAgICAgIHZhciB1c2VyaWQgPSBhcmdzLnVzZXJpZDsKKyAgICAgICAgdmFyIGNvbm5lY3Rpb24gPSBhcmdzLmNvbm5lY3Rpb247CisKKyAgICAgICAgZnVuY3Rpb24gX3Rha2VTbmFwc2hvdCh2aWRlbykgeworICAgICAgICAgICAgdmFyIGNhbnZhcyA9IGRvY3VtZW50LmNyZWF0ZUVsZW1lbnQoJ2NhbnZhcycpOworICAgICAgICAgICAgY2FudmFzLndpZHRoID0gdmlkZW8udmlkZW9XaWR0aCB8fCB2aWRlby5jbGllbnRXaWR0aDsKKyAgICAgICAgICAgIGNhbnZhcy5oZWlnaHQgPSB2aWRlby52aWRlb0hlaWdodCB8fCB2aWRlby5jbGllbnRIZWlnaHQ7CisKKyAgICAgICAgICAgIHZhciBjb250ZXh0ID0gY2FudmFzLmdldENvbnRleHQoJzJkJyk7CisgICAgICAgICAgICBjb250ZXh0LmRyYXdJbWFnZSh2aWRlbywgMCwgMCwgY2FudmFzLndpZHRoLCBjYW52YXMuaGVpZ2h0KTsKKworICAgICAgICAgICAgY29ubmVjdGlvbi5zbmFwc2hvdHNbdXNlcmlkXSA9IGNhbnZhcy50b0RhdGFVUkwoJ2ltYWdlL3BuZycpOworICAgICAgICAgICAgYXJncy5jYWxsYmFjayAmJiBhcmdzLmNhbGxiYWNrKGNvbm5lY3Rpb24uc25hcHNob3RzW3VzZXJpZF0pOworICAgICAgICB9CisKKyAgICAgICAgaWYgKGFyZ3MubWVkaWFFbGVtZW50KSByZXR1cm4gX3Rha2VTbmFwc2hvdChhcmdzLm1lZGlhRWxlbWVudCk7CisKKyAgICAgICAgZm9yICh2YXIgc3RyZWFtIGluIGNvbm5lY3Rpb24uc3RyZWFtcykgeworICAgICAgICAgICAgc3RyZWFtID0gY29ubmVjdGlvbi5zdHJlYW1zW3N0cmVhbV07CisgICAgICAgICAgICBpZiAoc3RyZWFtLnVzZXJpZCA9PSB1c2VyaWQgJiYgc3RyZWFtLnN0cmVhbSAmJiBzdHJlYW0uc3RyZWFtLmdldFZpZGVvVHJhY2tzICYmIHN0cmVhbS5zdHJlYW0uZ2V0VmlkZW9UcmFja3MoKS5sZW5ndGgpIHsKKyAgICAgICAgICAgICAgICBfdGFrZVNuYXBzaG90KHN0cmVhbS5tZWRpYUVsZW1lbnQpOworICAgICAgICAgICAgICAgIGNvbnRpbnVlOworICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgfQorCisgICAgZnVuY3Rpb24gaW52b2tlTWVkaWFDYXB0dXJlZChjb25uZWN0aW9uKSB7CisgICAgICAgIC8vIHRvIGxldCB1c2VyIGtub3cgdGhhdCBtZWRpYSByZXNvdXJjZSBoYXMgYmVlbiBjYXB0dXJlZAorICAgICAgICAvLyBub3csIGhlIGNhbiBzaGFyZSAic2Vzc2lvbkRlc2NyaXB0aW9uIiB1c2luZyBzb2NrZXRzCisgICAgICAgIGlmIChjb25uZWN0aW9uLm9uTWVkaWFDYXB0dXJlZCkgeworICAgICAgICAgICAgY29ubmVjdGlvbi5vbk1lZGlhQ2FwdHVyZWQoKTsKKyAgICAgICAgICAgIGRlbGV0ZSBjb25uZWN0aW9uLm9uTWVkaWFDYXB0dXJlZDsKKyAgICAgICAgfQorICAgIH0KKworICAgIGZ1bmN0aW9uIG1lcmdlKG1lcmdlaW4sIG1lcmdldG8pIHsKKyAgICAgICAgaWYgKCFtZXJnZWluKSBtZXJnZWluID0ge307CisgICAgICAgIGlmICghbWVyZ2V0bykgcmV0dXJuIG1lcmdlaW47CisKKyAgICAgICAgZm9yICh2YXIgaXRlbSBpbiBtZXJnZXRvKSB7CisgICAgICAgICAgICBtZXJnZWluW2l0ZW1dID0gbWVyZ2V0b1tpdGVtXTsKKyAgICAgICAgfQorICAgICAgICByZXR1cm4gbWVyZ2VpbjsKKyAgICB9CisKKyAgICBmdW5jdGlvbiBsb2FkU2NyaXB0KHNyYywgb25sb2FkKSB7CisgICAgICAgIHZhciBzY3JpcHQgPSBkb2N1bWVudC5jcmVhdGVFbGVtZW50KCdzY3JpcHQnKTsKKyAgICAgICAgc2NyaXB0LnNyYyA9IHNyYzsKKyAgICAgICAgc2NyaXB0Lm9ubG9hZCA9IGZ1bmN0aW9uKCkgeworICAgICAgICAgICAgbG9nKCdsb2FkZWQgcmVzb3VyY2U6Jywgc3JjKTsKKyAgICAgICAgICAgIGlmIChvbmxvYWQpIG9ubG9hZCgpOworICAgICAgICB9OworICAgICAgICBkb2N1bWVudC5kb2N1bWVudEVsZW1lbnQuYXBwZW5kQ2hpbGQoc2NyaXB0KTsKKyAgICB9CisKKyAgICBmdW5jdGlvbiBjYXB0dXJlUGFydE9mU2NyZWVuKGFyZ3MpIHsKKyAgICAgICAgdmFyIGNvbm5lY3Rpb24gPSBhcmdzLmNvbm5lY3Rpb247CisgICAgICAgIHZhciBlbGVtZW50ID0gYXJncy5lbGVtZW50OworCisgICAgICAgIGlmICghd2luZG93Lmh0bWwyY2FudmFzKSB7CisgICAgICAgICAgICByZXR1cm4gbG9hZFNjcmlwdChjb25uZWN0aW9uLnJlc291cmNlcy5odG1sMmNhbnZhcywgZnVuY3Rpb24oKSB7CisgICAgICAgICAgICAgICAgY2FwdHVyZVBhcnRPZlNjcmVlbihhcmdzKTsKKyAgICAgICAgICAgIH0pOworICAgICAgICB9CisKKyAgICAgICAgaWYgKGlzU3RyaW5nKGVsZW1lbnQpKSB7CisgICAgICAgICAgICBlbGVtZW50ID0gZG9jdW1lbnQucXVlcnlTZWxlY3RvcihlbGVtZW50KTsKKyAgICAgICAgICAgIGlmICghZWxlbWVudCkgZWxlbWVudCA9IGRvY3VtZW50LmdldEVsZW1lbnRCeUlkKGVsZW1lbnQpOworICAgICAgICB9CisgICAgICAgIGlmICghZWxlbWVudCkgdGhyb3cgJ0hUTUwgRE9NIEVsZW1lbnQgaXMgbm90IGFjY2Vzc2libGUhJzsKKworICAgICAgICAvLyB0b2RvOiBzdG9yZSBET00gZWxlbWVudCBzb21ld2hlcmUgdG8gbWluaW1pemUgRE9NIHF1ZXJ5aW5nIGlzc3VlcworCisgICAgICAgIC8vIGh0bWwyY2FudmFzLmpzIGlzIHVzZWQgdG8gdGFrZSBzY3JlZW5zaG90cworICAgICAgICBodG1sMmNhbnZhcyhlbGVtZW50LCB7CisgICAgICAgICAgICBvbnJlbmRlcmVkOiBmdW5jdGlvbihjYW52YXMpIHsKKyAgICAgICAgICAgICAgICBhcmdzLmNhbGxiYWNrKGNhbnZhcy50b0RhdGFVUkwoKSk7CisgICAgICAgICAgICB9CisgICAgICAgIH0pOworICAgIH0KKworICAgIGZ1bmN0aW9uIGluaXRGaWxlQnVmZmVyUmVhZGVyKGNvbm5lY3Rpb24sIGNhbGxiYWNrKSB7CisgICAgICAgIGlmICghd2luZG93LkZpbGVCdWZmZXJSZWFkZXIpIHsKKyAgICAgICAgICAgIGxvYWRTY3JpcHQoY29ubmVjdGlvbi5yZXNvdXJjZXMuRmlsZUJ1ZmZlclJlYWRlciwgZnVuY3Rpb24oKSB7CisgICAgICAgICAgICAgICAgaW5pdEZpbGVCdWZmZXJSZWFkZXIoY29ubmVjdGlvbiwgY2FsbGJhY2spOworICAgICAgICAgICAgfSk7CisgICAgICAgICAgICByZXR1cm47CisgICAgICAgIH0KKworICAgICAgICBmdW5jdGlvbiBfcHJpdmF0ZShjaHVuaykgeworICAgICAgICAgICAgY2h1bmsudXNlcmlkID0gY2h1bmsuZXh0cmEudXNlcmlkOworICAgICAgICAgICAgcmV0dXJuIGNodW5rOworICAgICAgICB9CisKKyAgICAgICAgdmFyIGZpbGVCdWZmZXJSZWFkZXIgPSBuZXcgRmlsZUJ1ZmZlclJlYWRlcigpOworICAgICAgICBmaWxlQnVmZmVyUmVhZGVyLm9uUHJvZ3Jlc3MgPSBmdW5jdGlvbihjaHVuaykgeworICAgICAgICAgICAgY29ubmVjdGlvbi5vbkZpbGVQcm9ncmVzcyhfcHJpdmF0ZShjaHVuayksIGNodW5rLnV1aWQpOworICAgICAgICB9OworCisgICAgICAgIGZpbGVCdWZmZXJSZWFkZXIub25CZWdpbiA9IGZ1bmN0aW9uKGZpbGUpIHsKKyAgICAgICAgICAgIGNvbm5lY3Rpb24ub25GaWxlU3RhcnQoX3ByaXZhdGUoZmlsZSkpOworICAgICAgICB9OworCisgICAgICAgIGZpbGVCdWZmZXJSZWFkZXIub25FbmQgPSBmdW5jdGlvbihmaWxlKSB7CisgICAgICAgICAgICBjb25uZWN0aW9uLm9uRmlsZUVuZChfcHJpdmF0ZShmaWxlKSk7CisgICAgICAgIH07CisKKyAgICAgICAgY2FsbGJhY2soZmlsZUJ1ZmZlclJlYWRlcik7CisgICAgfQorCisgICAgdmFyIHNjcmVlbkZyYW1lLCBsb2FkZWRTY3JlZW5GcmFtZTsKKworICAgIGZ1bmN0aW9uIGxvYWRTY3JlZW5GcmFtZShza2lwKSB7CisgICAgICAgIGlmIChEZXRlY3RSVEMuc2NyZWVuLmV4dGVuc2lvbmlkICE9IFJlc2VydmVkRXh0ZW5zaW9uSUQpIHsKKyAgICAgICAgICAgIHJldHVybjsKKyAgICAgICAgfQorCisgICAgICAgIGlmIChsb2FkZWRTY3JlZW5GcmFtZSkgcmV0dXJuOworICAgICAgICBpZiAoIXNraXApIHJldHVybiBsb2FkU2NyZWVuRnJhbWUodHJ1ZSk7CisKKyAgICAgICAgbG9hZGVkU2NyZWVuRnJhbWUgPSB0cnVlOworCisgICAgICAgIHZhciBpZnJhbWUgPSBkb2N1bWVudC5jcmVhdGVFbGVtZW50KCdpZnJhbWUnKTsKKyAgICAgICAgaWZyYW1lLm9ubG9hZCA9IGZ1bmN0aW9uKCkgeworICAgICAgICAgICAgaWZyYW1lLmlzTG9hZGVkID0gdHJ1ZTsKKyAgICAgICAgICAgIGxvZygnU2NyZWVuIENhcHR1cmluZyBmcmFtZSBpcyBsb2FkZWQuJyk7CisgICAgICAgIH07CisgICAgICAgIC8vaWZyYW1lLnNyYyA9ICdodHRwczovL3d3dy53ZWJydGMtZXhwZXJpbWVudC5jb20vZ2V0U291cmNlSWQvJzsKKyAgICAgICAgLy8gQ1VTVE9NIENPREUgLy8KKyAgICAgICAgaWZyYW1lLnNyYyA9ICdzdGF0aWMvZnVzaW9uL3dlYnJ0Yy9nZXRTb3VyY2VJZC5odG1sJzsKKyAgICAgICAgLy8gIENVU1RPTSBDT0RFIC8vCisgICAgICAgIGlmcmFtZS5zdHlsZS5kaXNwbGF5ID0gJ25vbmUnOworICAgICAgICAoZG9jdW1lbnQuYm9keSB8fCBkb2N1bWVudC5kb2N1bWVudEVsZW1lbnQpLmFwcGVuZENoaWxkKGlmcmFtZSk7CisKKyAgICAgICAgc2NyZWVuRnJhbWUgPSB7CisgICAgICAgICAgICBwb3N0TWVzc2FnZTogZnVuY3Rpb24oKSB7CisgICAgICAgICAgICAgICAgaWYgKCFpZnJhbWUuaXNMb2FkZWQpIHsKKyAgICAgICAgICAgICAgICAgICAgc2V0VGltZW91dChzY3JlZW5GcmFtZS5wb3N0TWVzc2FnZSwgMTAwKTsKKyAgICAgICAgICAgICAgICAgICAgcmV0dXJuOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICBpZnJhbWUuY29udGVudFdpbmRvdy5wb3N0TWVzc2FnZSh7CisgICAgICAgICAgICAgICAgICAgIGNhcHR1cmVTb3VyY2VJZDogdHJ1ZQorICAgICAgICAgICAgICAgIH0sICcqJyk7CisgICAgICAgICAgICB9CisgICAgICAgIH07CisgICAgfQorCisgICAgdmFyIGljZUZyYW1lLCBsb2FkZWRJY2VGcmFtZTsKKworICAgIGZ1bmN0aW9uIGxvYWRJY2VGcmFtZShjYWxsYmFjaywgc2tpcCkgeworICAgICAgICBpZiAobG9hZGVkSWNlRnJhbWUpIHJldHVybjsKKyAgICAgICAgaWYgKCFza2lwKSByZXR1cm4gbG9hZEljZUZyYW1lKGNhbGxiYWNrLCB0cnVlKTsKKworICAgICAgICBsb2FkZWRJY2VGcmFtZSA9IHRydWU7CisKKyAgICAgICAgdmFyIGlmcmFtZSA9IGRvY3VtZW50LmNyZWF0ZUVsZW1lbnQoJ2lmcmFtZScpOworICAgICAgICBpZnJhbWUub25sb2FkID0gZnVuY3Rpb24oKSB7CisgICAgICAgICAgICBpZnJhbWUuaXNMb2FkZWQgPSB0cnVlOworCisgICAgICAgICAgICBsaXN0ZW5FdmVudEhhbmRsZXIoJ21lc3NhZ2UnLCBpRnJhbWVMb2FkZXJDYWxsYmFjayk7CisKKyAgICAgICAgICAgIGZ1bmN0aW9uIGlGcmFtZUxvYWRlckNhbGxiYWNrKGV2ZW50KSB7CisgICAgICAgICAgICAgICAgaWYgKCFldmVudC5kYXRhIHx8ICFldmVudC5kYXRhLmljZVNlcnZlcnMpIHJldHVybjsKKyAgICAgICAgICAgICAgICBjYWxsYmFjayhldmVudC5kYXRhLmljZVNlcnZlcnMpOworCisgICAgICAgICAgICAgICAgLy8gdGhpcyBldmVudCBsaXN0ZW5lciBpcyBubyBtb3JlIG5lZWRlZAorICAgICAgICAgICAgICAgIHdpbmRvdy5yZW1vdmVFdmVudExpc3RlbmVyKCdtZXNzYWdlJywgaUZyYW1lTG9hZGVyQ2FsbGJhY2spOworICAgICAgICAgICAgfQorCisgICAgICAgICAgICBpZnJhbWUuY29udGVudFdpbmRvdy5wb3N0TWVzc2FnZSgnZ2V0LWljZS1zZXJ2ZXJzJywgJyonKTsKKyAgICAgICAgfTsKKyAgICAgICAgaWZyYW1lLnNyYyA9ICdodHRwczovL2Nkbi53ZWJydGMtZXhwZXJpbWVudC5jb20vZ2V0SWNlU2VydmVycy8nOworICAgICAgICBpZnJhbWUuc3R5bGUuZGlzcGxheSA9ICdub25lJzsKKyAgICAgICAgKGRvY3VtZW50LmJvZHkgfHwgZG9jdW1lbnQuZG9jdW1lbnRFbGVtZW50KS5hcHBlbmRDaGlsZChpZnJhbWUpOworICAgIH0KKworICAgIGZ1bmN0aW9uIG11dGVPclVubXV0ZShlKSB7CisgICAgICAgIHZhciBzdHJlYW0gPSBlLnN0cmVhbSwKKyAgICAgICAgICAgIHJvb3QgPSBlLnJvb3QsCisgICAgICAgICAgICBzZXNzaW9uID0gZS5zZXNzaW9uIHx8IHt9LAorICAgICAgICAgICAgZW5hYmxlZCA9IGUuZW5hYmxlZDsKKworICAgICAgICBpZiAoIXNlc3Npb24uYXVkaW8gJiYgIXNlc3Npb24udmlkZW8pIHsKKyAgICAgICAgICAgIGlmICghaXNTdHJpbmcoc2Vzc2lvbikpIHsKKyAgICAgICAgICAgICAgICBzZXNzaW9uID0gbWVyZ2Uoc2Vzc2lvbiwgeworICAgICAgICAgICAgICAgICAgICBhdWRpbzogdHJ1ZSwKKyAgICAgICAgICAgICAgICAgICAgdmlkZW86IHRydWUKKyAgICAgICAgICAgICAgICB9KTsKKyAgICAgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICAgICAgc2Vzc2lvbiA9IHsKKyAgICAgICAgICAgICAgICAgICAgYXVkaW86IHRydWUsCisgICAgICAgICAgICAgICAgICAgIHZpZGVvOiB0cnVlCisgICAgICAgICAgICAgICAgfTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorCisgICAgICAgIC8vIGltcGxlbWVudGF0aW9uIGZyb20gIzY4CisgICAgICAgIGlmIChzZXNzaW9uLnR5cGUpIHsKKyAgICAgICAgICAgIGlmIChzZXNzaW9uLnR5cGUgPT0gJ3JlbW90ZScgJiYgcm9vdC50eXBlICE9ICdyZW1vdGUnKSByZXR1cm47CisgICAgICAgICAgICBpZiAoc2Vzc2lvbi50eXBlID09ICdsb2NhbCcgJiYgcm9vdC50eXBlICE9ICdsb2NhbCcpIHJldHVybjsKKyAgICAgICAgfQorCisgICAgICAgIGxvZyhlbmFibGVkID8gJ011dGluZycgOiAnVW5NdXRpbmcnLCAnc2Vzc2lvbicsIHRvU3RyKHNlc3Npb24pKTsKKworICAgICAgICAvLyBlbmFibGUvZGlzYWJsZSBhdWRpby92aWRlbyB0cmFja3MKKworICAgICAgICBpZiAocm9vdC50eXBlID09ICdsb2NhbCcgJiYgc2Vzc2lvbi5hdWRpbyAmJiAhIXN0cmVhbS5nZXRBdWRpb1RyYWNrcykgeworICAgICAgICAgICAgdmFyIGF1ZGlvVHJhY2tzID0gc3RyZWFtLmdldEF1ZGlvVHJhY2tzKClbMF07CisgICAgICAgICAgICBpZiAoYXVkaW9UcmFja3MpCisgICAgICAgICAgICAgICAgYXVkaW9UcmFja3MuZW5hYmxlZCA9ICFlbmFibGVkOworICAgICAgICB9CisKKyAgICAgICAgaWYgKHJvb3QudHlwZSA9PSAnbG9jYWwnICYmIChzZXNzaW9uLnZpZGVvIHx8IHNlc3Npb24uc2NyZWVuKSAmJiAhIXN0cmVhbS5nZXRWaWRlb1RyYWNrcykgeworICAgICAgICAgICAgdmFyIHZpZGVvVHJhY2tzID0gc3RyZWFtLmdldFZpZGVvVHJhY2tzKClbMF07CisgICAgICAgICAgICBpZiAodmlkZW9UcmFja3MpCisgICAgICAgICAgICAgICAgdmlkZW9UcmFja3MuZW5hYmxlZCA9ICFlbmFibGVkOworICAgICAgICB9CisKKyAgICAgICAgcm9vdC5zb2NrZXRzLmZvckVhY2goZnVuY3Rpb24oc29ja2V0KSB7CisgICAgICAgICAgICBpZiAocm9vdC50eXBlID09ICdsb2NhbCcpIHsKKyAgICAgICAgICAgICAgICBzb2NrZXQuc2VuZCh7CisgICAgICAgICAgICAgICAgICAgIHN0cmVhbWlkOiByb290LnN0cmVhbWlkLAorICAgICAgICAgICAgICAgICAgICBtdXRlOiAhIWVuYWJsZWQsCisgICAgICAgICAgICAgICAgICAgIHVubXV0ZTogIWVuYWJsZWQsCisgICAgICAgICAgICAgICAgICAgIHNlc3Npb246IHNlc3Npb24KKyAgICAgICAgICAgICAgICB9KTsKKyAgICAgICAgICAgIH0KKworICAgICAgICAgICAgaWYgKHJvb3QudHlwZSA9PSAncmVtb3RlJykgeworICAgICAgICAgICAgICAgIHNvY2tldC5zZW5kKHsKKyAgICAgICAgICAgICAgICAgICAgcHJvbXB0TXV0ZVVubXV0ZTogdHJ1ZSwKKyAgICAgICAgICAgICAgICAgICAgc3RyZWFtaWQ6IHJvb3Quc3RyZWFtaWQsCisgICAgICAgICAgICAgICAgICAgIG11dGU6ICEhZW5hYmxlZCwKKyAgICAgICAgICAgICAgICAgICAgdW5tdXRlOiAhZW5hYmxlZCwKKyAgICAgICAgICAgICAgICAgICAgc2Vzc2lvbjogc2Vzc2lvbgorICAgICAgICAgICAgICAgIH0pOworICAgICAgICAgICAgfQorICAgICAgICB9KTsKKworICAgICAgICBpZiAocm9vdC50eXBlID09ICdyZW1vdGUnKSByZXR1cm47CisKKyAgICAgICAgLy8gQWNjb3JkaW5nIHRvIGlzc3VlICMxMzUsIG9ubXV0ZS9vbnVtdXRlIG11c3QgYmUgZmlyZWQgZm9yIHNlbGYKKyAgICAgICAgLy8gImZha2VPYmplY3QiIGlzIHVzZWQgYmVjYXVzZSB3ZSBuZWVkIHRvIGtlZXAgc2Vzc2lvbiBmb3IgcmVuZWdvdGlhdGVkIHN0cmVhbXM7IAorICAgICAgICAvLyBhbmQgTVVTVCBwYXNzIGV4YWN0IHNlc3Npb24gb3ZlciBvblN0cmVhbUVuZGVkSGFuZGxlci9vbm11dGUvb25ob2xkL2V0Yy4gZXZlbnRzLgorICAgICAgICB2YXIgZmFrZU9iamVjdCA9IG1lcmdlKHt9LCByb290KTsKKyAgICAgICAgZmFrZU9iamVjdC5zZXNzaW9uID0gc2Vzc2lvbjsKKworICAgICAgICBmYWtlT2JqZWN0LmlzQXVkaW8gPSAhIWZha2VPYmplY3Quc2Vzc2lvbi5hdWRpbyAmJiAhZmFrZU9iamVjdC5zZXNzaW9uLnZpZGVvOworICAgICAgICBmYWtlT2JqZWN0LmlzVmlkZW8gPSAhIWZha2VPYmplY3Quc2Vzc2lvbi52aWRlbzsKKyAgICAgICAgZmFrZU9iamVjdC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QorCisgICAgICAgIHZhciBjb25uZWN0aW9uID0gYXJncy5jb25uZWN0aW9uOworICAgICAgICB2YXIgc3RyZWFtZWRPYmplY3QgPSBhcmdzLnN0cmVhbWVkT2JqZWN0OworICAgICAgICB2YXIgc3RyZWFtID0gYXJncy5zdHJlYW07CisKKyAgICAgICAgdmFyIG9wdGlvbnMgPSB7fTsKKyAgICAgICAgdmFyIHNwZWVjaEV2ZW50cyA9IGhhcmsoc3RyZWFtLCBvcHRpb25zKTsKKworICAgICAgICBzcGVlY2hFdmVudHMub24oJ3NwZWFraW5nJywgZnVuY3Rpb24oKSB7CisgICAgICAgICAgICBpZiAoY29ubmVjdGlvbi5vbnNwZWFraW5nKSB7CisgICAgICAgICAgICAgICAgY29ubmVjdGlvbi5vbnNwZWFraW5nKHN0cmVhbWVkT2JqZWN0KTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfSk7CisKKyAgICAgICAgc3BlZWNoRXZlbnRzLm9uKCdzdG9wcGVkX3NwZWFraW5nJywgZnVuY3Rpb24oKSB7CisgICAgICAgICAgICBpZiAoY29ubmVjdGlvbi5vbnNpbGVuY2UpIHsKKyAgICAgICAgICAgICAgICBjb25uZWN0aW9uLm9uc2lsZW5jZShzdHJlYW1lZE9iamVjdCk7CisgICAgICAgICAgICB9CisgICAgICAgIH0pOworCisgICAgICAgIHNwZWVjaEV2ZW50cy5vbigndm9sdW1lX2NoYW5nZScsIGZ1bmN0aW9uKHZvbHVtZSwgdGhyZXNob2xkKSB7CisgICAgICAgICAgICBpZiAoY29ubmVjdGlvbi5vbnZvbHVtZWNoYW5nZSkgeworICAgICAgICAgICAgICAgIGNvbm5lY3Rpb24ub252b2x1bWVjaGFuZ2UobWVyZ2UoeworICAgICAgICAgICAgICAgICAgICB2b2x1bWU6IHZvbHVtZSwKKyAgICAgICAgICAgICAgICAgICAgdGhyZXNob2xkOiB0aHJlc2hvbGQKKyAgICAgICAgICAgICAgICB9LCBzdHJlYW1lZE9iamVjdCkpOworICAgIC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gICAgICAgLy8gbG9hZFNjcmlwdCgnaHR0cHM6Ly9jZG4ud2VicnRjLWV4cGVyaW1lbnQuY29tL1BsdWdpbi5UZW1hc3lzLmpzJyk7CisgICAgfQorCisgICAgdmFyIE1lZGlhU3RyZWFtID0gd2luZG93Lk1lZGlhU3RyZWFtOworCisgICAgaWYgKHR5cGVvZiBNZWRpYVN0cmVhbSA9PT0gJ3VuZGVmaW5lZCcgJiYgdHlwZW9mIHdlYmtpdE1lZGlhU3RyZWFtICE9PSAndW5kZWZpbmVkJykgeworICAgICAgICBNZWRpYVN0cmVhbSA9IHdlYmtpdE1lZGlhU3RyZWFtOworICAgIH0KKworICAgIC8qZ2xvYmFsIE1lZGlhU3RyZWFtOnRydWUgKi8KKyAgICBpZiAodHlwZW9mIE1lZGlhU3RyZWFtICE9PSAndW5kZWZpbmVkJyAmJiAhKCdzdG9wJyBpbiBNZWRpYVN0cmVhbS5wcm90b3R5cGUpKSB7CisgICAgICAgIE1lZGlhU3RyZWFtLnByb3RvdHlwZS5zdG9wID0gZnVuY3Rpb24oKSB7CisgICAgICAgICAgICB0aGlzLmdldEF1ZGlvVHJhY2tzKCkuZm9yRWFjaChmdW5jdGlvbih0cmFjaykgeworICAgICAgICAgICAgICAgIHRyYWNrLnN0b3AoKTsKKyAgICAgICAgICAgIH0pOworCisgICAgICAgICAgICB0aGlzLmdldFZpZGVvVHJhY2tzKCkuZm9yRWFjaChmdW5jdGlvbih0cmFjaykgeworICAgICAgICAgICAgICAgIHRyYWNrLnN0b3AoKTsKKyAgICAgICAgICAgIH0pOworICAgICAgICB9OworICAgIH0KKworICAgIHZhciBkZWZhdWx0Q29uc3RyYWludHMgPSB7CisgICAgICAgIG1hbmRhdG9yeToge30sCisgICAgICAgIG9wdGlvbmFsOiBbXQorICAgIH07CisKKyAgICAvKiBieSBARnJlQ2FwIHB1bGwgcmVxdWVzdCAjNDEgKi8KKyAgICB2YXIgY3VycmVudFVzZXJNZWRpYVJlcXVlc3QgPSB7CisgICAgICAgIHN0cmVhbXM6IFtdLAorICAgICAgICBtdXRleDogZmFsc2UsCisgICAgICAgIHF1ZXVlUmVxdWVzdHM6IFtdCisgICAgfTsKKworICAgIGZ1bmN0aW9uIGdldFVzZXJNZWRpYShvcHRpb25zKSB7CisgICAgICAgIGlmIChpc1BsdWdpblJUQykgeworICAgICAgICAgICAgaWYgKCFQbHVnaW4uZ2V0VXNlck1lZGlhKSB7CisgICAgICAgICAgICAgICAgc2V0VGltZW91dChmdW5jdGlvbigpIHsKKyAgICAgICAgICAgICAgICAgICAgZ2V0VXNlck1lZGlhKG9wdGlvbnMpOworICAgICAgICAgICAgICAgIH0sIDEwMDApOworICAgICAgICAgICAgICAgIHJldHVybjsKKyAgICAgICAgICAgIH0KKworICAgICAgICAgICAgcmV0dXJuIFBsdWdpbi5nZXRVc2VyTWVkaWEob3B0aW9ucy5jb25zdHJhaW50cyB8fCB7CisgICAgICAgICAgICAgICAgYXVkaW86IHRydWUsCisgICAgICAgICAgICAgICAgdmlkZW86IHRydWUKKyAgICAgICAgICAgIH0sIG9wdGlvbnMub25zdWNjZXNzLCBvcHRpb25zLm9uZXJyb3IpOworICAgICAgICB9CisKKyAgICAgICAgaWYgKGN1cnJlbnRVc2VyTWVkaWFSZXF1ZXN0Lm11dGV4ID09PSB0cnVlKSB7CisgICAgICAgICAgICBjdXJyZW50VXNlck1lZGlhUmVxdWVzdC5xdWV1ZVJlcXVlc3RzLnB1c2gob3B0aW9ucyk7CisgICAgICAgICAgICByZXR1cm47CisgICAgICAgIH0KKyAgICAgICAgY3VycmVudFVzZXJNZWRpYVJlcXVlc3QubXV0ZXggPSB0cnVlOworCisgICAgICAgIHZhciBjb25uZWN0aW9uID0gb3B0aW9ucy5jb25uZWN0aW9uOworCisgICAgICAgIC8vIHRvb2xzLmlldGYub3JnL2h0bWwvZHJhZnQtYWx2ZXN0cmFuZC1jb25zdHJhaW50cy1yZXNvbHV0aW9uLTAwCisgICAgICAgIHZhciBtZWRpYUNvbnN0cmFpbnRzID0gb3B0aW9ucy5tZWRpYUNvbnN0cmFpbnRzIHx8IHt9OworICAgICAgICB2YXIgdmlkZW9Db25zdHJhaW50cyA9IHR5cGVvZiBtZWRpYUNvbnN0cmFpbnRzLnZpZGVvID09ICdib29sZWFuJyA/IG1lZGlhQ29uc3RyYWludHMudmlkZW8gOiBtZWRpYUNvbnN0cmFpbnRzLnZpZGVvIHx8IG1lZGlhQ29uc3RyYWludHM7CisgICAgICAgIHZhciBhdWRpb0NvbnN0cmFpbnRzID0gdHlwZW9mIG1lZGlhQ29uc3RyYWludHMuYXVkaW8gPT0gJ2Jvb2xlYW4nID8gbWVkaWFDb25zdHJhaW50cy5hdWRpbyA6IG1lZGlhQ29uc3RyYWludHMuYXVkaW8gfHwgZGVmYXVsdENvbnN0cmFpbnRzOworCisgICAgICAgIHZhciBuID0gbmF2aWdhdG9yOworICAgICAgICB2YXIgaGludHMgPSBvcHRpb25zLmNvbnN0cmFpbnRzIHx8IHsKKyAgICAgICAgICAgIGF1ZGlvOiBkZWZhdWx0Q29uc3RyYWludHMsCisgICAgICAgICAgICB2aWRlbzogZGVmYXVsdENvbnN0cmFpbnRzCisgICAgICAgIH07CisKKyAgICAgICAgaWYgKGhpbnRzLnZpZGVvICYmIGhpbnRzLnZpZGVvLm1vek1lZGlhU291cmNlKSB7CisgICAgICAgICAgICAvLyAibW96TWVkaWFTb3VyY2UiIGlzIHJlZHVuZGFudAorICAgICAgICAgICAgLy8gbmVlZCB0byBjaGVjayAibWVkaWFTb3VyY2UiIGluc3RlYWQuCisgICAgICAgICAgICB2aWRlb0NvbnN0cmFpbnRzID0ge307CisgICAgICAgIH0KKworICAgICAgICBpZiAoaGludHMudmlkZW8gPT0gdHJ1ZSkgaGludHMudmlkZW8gPSBkZWZhdWx0Q29uc3RyYWludHM7CisgICAgICAgIGlmIChoaW50cy5hdWRpbyA9PSB0cnVlKSBoaW50cy5hdWRpbyA9IGRlZmF1bHRDb25zdHJhaW50czsKKworICAgICAg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mFpbnRzKSB7CisgICAgICAgICAgICB2YXIgbWFuZGF0b3J5ID0ge307CisKKyAgICAgICAgICAgIGlmICh2aWRlb01hbmRhdG9yeUNvbnN0cmFpbnRzLm1pbldpZHRoKSB7CisgICAgICAgICAgICAgICAgbWFuZGF0b3J5Lm1pbldpZHRoID0gdmlkZW9NYW5kYXRvcnlDb25zdHJhaW50cy5taW5XaWR0aDsKKyAgICAgICAgICAgIH0KKworICAgICAgICAgICAgaWYgKHZpZGVvTWFuZGF0b3J5Q29uc3RyYWludHMubWluSGVpZ2h0KSB7CisgICAgICAgICAgICAgICAgbWFuZGF0b3J5Lm1pbkhlaWdodCA9IHZpZGVvTWFuZGF0b3J5Q29uc3RyYWludHMubWluSGVpZ2h0OworICAgICAgICAgICAgfQorCisgICAgICAgICAgICBpZiAodmlkZW9NYW5kYXRvcnlDb25zdHJhaW50cy5tYXhXaWR0aCkgeworICAgICAgICAgICAgICAgIG1hbmRhdG9yeS5tYXhXaWR0aCA9IHZpZGVvTWFuZGF0b3J5Q29uc3RyYWludHMubWF4V2lkdGg7CisgICAgICAgICAgICB9CisKKyAgICAgICAgICAgIGlmICh2aWRlb01hbmRhdG9yeUNvbnN0cmFpbnRzLm1heEhlaWdodCkgeworICAgICAgICAgICAgICAgIG1hbmRhdG9yeS5tYXhIZWlnaHQgPSB2aWRlb01hbmRhdG9yeUNvbnN0cmFpbnRzLm1heEhlaWdodDsKKyAgICAgICAgICAgIH0KKworICAgICAgICAgICAgaWYgKHZpZGVvTWFuZGF0b3J5Q29uc3RyYWludHMubWluQXNwZWN0UmF0aW8pIHsKKyAgICAgICAgICAgICAgICBtYW5kYXRvcnkubWluQXNwZWN0UmF0aW8gPSB2aWRlb01hbmRhdG9yeUNvbnN0cmFpbnRzLm1pbkFzcGVjdFJhdGlvOworICAgICAgICAgICAgfQorCisgICAgICAgICAgICBpZiAodmlkZW9NYW5kYXRvcnlDb25zdHJhaW50cy5tYXhGcmFtZVJhdGUpIHsKKyAgICAgICAgICAgICAgICBtYW5kYXRvcnkubWF4RnJhbWVSYXRlID0gdmlkZW9NYW5kYXRvcnlDb25zdHJhaW50cy5tYXhGcmFtZVJhdGU7CisgICAgICAgICAgICB9CisKKyAgICAgICAgICAgIGlmICh2aWRlb01hbmRhdG9yeUNvbnN0cmFpbnRzLm1pbkZyYW1lUmF0ZSkgeworICAgICAgICAgICAgICAgIG1hbmRhdG9yeS5taW5GcmFtZVJhdGUgPSB2aWRlb01hbmRhdG9yeUNvbnN0cmFpbnRzLm1pbkZyYW1lUmF0ZTsKKyAgICAgICAgICAgIH0KKworICAgICAgICAgICAgaWYgKG1hbmRhdG9yeS5taW5XaWR0aCAmJiBtYW5kYXRvcnkubWluSGVpZ2h0KSB7CisgICAgICAgICAgICAgICAgLy8gaHR0cDovL2dvby5nbC9JWlZZc2oKKyAgICAgICAgICAgICAgICB2YXIgYWxsb3dlZCA9IFsnMTkyMDoxMDgwJywgJzEyODA6NzIwJywgJzk2MDo3MjAnLCAnNjQwOjM2MCcsICc2NDA6NDgwJywgJzMyMDoyNDAnLCAnMzIwOjE4MCddOworCisgICAgICAgICAgICAgICAgaWYgKGFsbG93ZWQuaW5kZXhPZihtYW5kYXRvcnkubWluV2lkdGggKyAnOicgKyBtYW5kYXRvcnkubWluSGVpZ2h0KSA9PSAtMSB8fAorICAgICAgICAgICAgICAgICAgICBhbGxvd2VkLmluZGV4T2YobWFuZGF0b3J5Lm1heFdpZHRoICsgJzonICsgbWFuZGF0b3J5Lm1heEhlaWdodCkgPT0gLTEpIHsKKyAgICAgICAgICAgICAgICAgICAgZXJyb3IoJ1RoZSBtaW4vbWF4IHdpZHRoL2hlaWdodCBjb25zdHJhaW50cyB5b3UgcGFzc2VkICJzZWVtcyIgTk9UIHN1cHBvcnRlZC4nLCB0b1N0cihtYW5kYXRvcnkpKTsKKyAgICAgICAgICAgICAgICB9CisKKyAgICAgICAgICAgICAgICBpZiAobWFuZGF0b3J5Lm1pbldpZHRoID4gbWFuZGF0b3J5Lm1heFdpZHRoIHx8IG1hbmRhdG9yeS5taW5IZWlnaHQgPiBtYW5kYXRvcnkubWF4SGVpZ2h0KSB7CisgICAgICAgICAgICAgICAgICAgIGVycm9yKCdNaW5pbXVtIHZhbHVlIG11c3Qgbm90IGV4Y2VlZCBtYXhpbXVtIHZhbHVlLicsIHRvU3RyKG1hbmRhdG9yeSkpOworICAgICAgICAgICAgICAgIH0KKworICAgICAgICAgICAgICAgIGlmIChtYW5kYXRvcnkubWluV2lkdGggPj0gMTI4MCAmJiBtYW5kYXRvcnkubWluSGVpZ2h0ID49IDcyMCkgeworICAgICAgICAgICAgICAgICAgICB3YXJuKCdFbmpveSBIRCB2aWRlbyEgbWluLycgKyBtYW5kYXRvcnkubWluV2lkdGggKyAnOicgKyBtYW5kYXRvcnkubWluSGVpZ2h0ICsgJywgbWF4LycgKyBtYW5kYXRvcnkubWF4V2lkdGggKyAnOicgKyBtYW5kYXRvcnkubWF4SGVpZ2h0KTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9CisKKyAgICAgICAgICAgIGhpbnRzLnZpZGVvLm1hbmRhdG9yeSA9IG1lcmdlKGhpbnRzLnZpZGVvLm1hbmRhdG9yeSwgbWFuZGF0b3J5KTsKKyAgICAgICAgfQorCisgICAgICAgIGlmICh2aWRlb01hbmRhdG9yeUNvbnN0cmFpbnRzKSB7CisgICAgICAgICAgICBoaW50cy52aWRlby5tYW5kYXRvcnkgPSBtZXJnZShoaW50cy52aWRlby5tYW5kYXRvcnksIHZpZGVvTWFuZGF0b3J5Q29uc3RyYWludHMpOworICAgICAgICB9CisKKyAgICAgICAgLy8gdmlkZW9Db25zdHJhaW50cy5vcHRpb25hbCA9IFt7cHJvcDp0cnVlfV07CisgICAgICAgIGlmICh2aWRlb0NvbnN0cmFpbnRzLm9wdGlvbmFsICYmIHZpZGVvQ29uc3RyYWludHMub3B0aW9uYWwgaW5zdGFuY2VvZiBBcnJheSAmJiB2aWRlb0NvbnN0cmFpbnRzLm9wdGlvbmFsLmxlbmd0aCkgeworICAgICAgICAgICAgaGludHMudmlkZW8ub3B0aW9uYWwgPSBoaW50cy52aWRlby5vcHRpb25hbCA/IGhpbnRzLnZpZGVvLm9wdGlvbmFsLmNvbmNhdCh2aWRlb0NvbnN0cmFpbnRzLm9wdGlvbmFsKSA6IHZpZGVvQ29uc3RyYWludHMub3B0aW9uYWw7CisgICAgICAgIH0KKworICAgICAgICAvLyBhdWRpb0NvbnN0cmFpbnRzLm9wdGlvbmFsID0gW3twcm9wOnRydWV9XTsKKyAgICAgICAgaWYgKGF1ZGlvQ29uc3RyYWludHMub3B0aW9uYWwgJiYgYXVkaW9Db25zdHJhaW50cy5vcHRpb25hbCBpbnN0YW5jZW9mIEFycmF5ICYmIGF1ZGlvQ29uc3RyYWludHMub3B0aW9uYWwubGVuZ3RoKSB7CisgICAgICAgICAgICBoaW50cy5hdWRpby5vcHRpb25hbCA9IGhpbnRzLmF1ZGlvLm9wdGlvbmFsID8gaGludHMuYXVkaW8ub3B0aW9uYWwuY29uY2F0KGF1ZGlvQ29uc3RyYWludHMub3B0aW9uYWwpIDogYXVkaW9Db25zdHJhaW50cy5vcHRpb25hbDsKKyAgICAgICAgfQorCisgICAgICAgIGlmIChoaW50cy52aWRlby5tYW5kYXRvcnkgJiYgIWlzRW1wdHkoaGludHMudmlkZW8ubWFuZGF0b3J5KSAmJiBjb25uZWN0aW9uLl9tZWRpYVNvdXJjZXMudmlkZW8pIHsKKyAgICAgICAgICAgIGhpbnRzLnZpZGVvLm9wdGlvbmFsLmZvckVhY2goZnVuY3Rpb24odmlkZW8sIGluZGV4KSB7CisgICAgICAgICAgICAgICAgaWYgKHZpZGVvLnNvdXJjZUlkID09IGNvbm5lY3Rpb24uX21lZGlhU291cmNlcy52aWRlbykgeworICAgICAgICAgICAgICAgICAgICBkZWxldGUgaGludHMudmlkZW8ub3B0aW9uYWxbaW5kZXhdOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0pOworCisgICAgICAgICAgICBoaW50cy52aWRlby5vcHRpb25hbCA9IHN3YXAoaGludHMudmlkZW8ub3B0aW9uYWwpOworCisgICAgICAgICAgICBoaW50cy52aWRlby5vcHRpb25hbC5wdXNoKHsKKyAgICAgICAgICAgICAgICBzb3VyY2VJZDogY29ubmVjdGlvbi5fbWVkaWFTb3VyY2VzLnZpZGVvCisgICAgICAgICAgICB9KTsKKyAgICAgICAgfQorCisgICAgICAgIGlmIChoaW50cy5hdWRpby5tYW5kYXRvcnkgJiYgIWlzRW1wdHkoaGludHMuYXVkaW8ubWFuZGF0b3J5KSAmJiBjb25uZWN0aW9uLl9tZWRpYVNvdXJjZXMuYXVkaW8pIHsKKyAgICAgICAgICAgIGhpbnRzLmF1ZGlvLm9wdGlvbmFsLmZvckVhY2goZnVuY3Rpb24oYXVkaW8sIGluZGV4KSB7CisgICAgICAgICAgICAgICAgaWYgKGF1ZGlvLnNvdXJjZUlkID09IGNvbm5lY3Rpb24uX21lZGlhU291cmNlcy5hdWRpbykgeworICAgICAgICAgICAgICAgICAgICBkZWxldGUgaGludHMuYXVkaW8ub3B0aW9uYWxbaW5kZXhdOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0pOworCisgICAgICAgICAgICBoaW50cy5hdWRpby5vcHRpb25hbCA9IHN3YXAoaGludHMuYXVkaW8ub3B0aW9uYWwpOworCisgICAgICAgICAgICBoaW50cy5hdWRpby5vcHRpb25hbC5wdXNoKHsKKyAgICAgICAgICAgICAgICBzb3VyY2VJZDogY29ubmVjdGlvbi5fbWVkaWFTb3VyY2VzLmF1ZGlvCisgICAgICAgICAgICB9KTsKKyAgICAgICAgfQorCisgICAgICAgIGlmIChoaW50cy52aWRlbyAmJiAhaGludHMudmlkZW8ubW96TWVkaWFTb3VyY2UgJiYgaGludHMudmlkZW8ub3B0aW9uYWwgJiYgaGludHMudmlkZW8ubWFuZGF0b3J5KSB7CisgICAgICAgICAgICBpZiAoIWhpbnRzLnZpZGVvLm9wdGlvbmFsLmxlbmd0aCAmJiBpc0VtcHR5KGhpbnRzLnZpZGVvLm1hbmRhdG9yeSkpIHsKKyAgICAgICAgICAgICAgICBoaW50cy52aWRlbyA9IHRydWU7CisgICAgICAgICAgICB9CisgICAgICAgIH0KKworICAgICAgICBpZiAoaXNNb2JpbGVEZXZpY2UpIHsKKyAgICAgICAgICAgIC8vIEFuZHJvaWQgZmFpbHMgZm9yIHNvbWUgY29uc3RyYWludHMKKyAgICAgICAgICAgIC8vIHNvIG5lZWQgdG8gZm9yY2Uge2F1ZGlvOnRydWUsdmlkZW86dHJ1ZX0KKyAgICAgICAgICAgIGhpbnRzID0geworICAgICAgICAgICAgICAgIGF1ZGlvOiAhIWhpbnRzLmF1ZGlvLAorICAgICAgICAgICAgICAgIHZpZGVvOiAhIWhpbnRzLnZpZGVvCisgICAgICAgICAgICB9OworICAgICAgICB9CisKKyAgICAgICAgLy8gY29ubmVjdGlvbi5tZWRpYUNvbnN0cmFpbnRzIGFsd2F5cyBvdmVycmlkZXMgY29uc3RyYWludHMKKyAgICAgICAgLy8gcGFzc2VkIGZyb20gImNhcHR1cmVVc2VyTWVkaWEiIGZ1bmN0aW9uLgorICAgICAgICAvLyB0b2RvOiBuZWVkIHRvIHZlcmlmeSBhbGwgcG9zc2libGUgc2l0dWF0aW9ucworICAgICAgICBsb2coJ2ludm9rZWQgZ2V0VXNlck1lZGlhIHdpdGggY29uc3RyYWludHM6JywgdG9TdHIoaGludHMpKTsKKworICAgICAgICAvLyBlYXN5IHdheSB0byBtYXRjaCAKKyAgICAgICAgdmFyIGlkSW5zdGFuY2UgPSBKU09OLnN0cmluZ2lmeShoaW50cyk7CisKKyAgICAgICAgZnVuY3Rpb24gc3RyZWFtaW5nKHN0cmVhbSwgcmV0dXJuQmFjaywgc3RyZWFtaWQpIHsKKyAgICAgICAgICAgIGlmICghc3RyZWFtaWQpIHN0cmVhbWlkID0gZ2V0UmFuZG9tU3RyaW5nKCk7CisKKyAgICAgICAgICAgIC8vIGxvY2FsU3RyZWFtcyBvYmplY3Qgd2lsbCBzdG9yZSBzdHJlYW0KKyAgICAgICAgICAgIC8vIHVudGlsIGl0IGlzIHJlbW92ZWQgdXNpbmcgbmF0aXZlLXN0b3AgbWV0aG9kLgorICAgICAgICAgICAgY29ubmVjdGlvbi5sb2NhbFN0cmVhbXNbc3RyZWFtaWRdID0gc3RyZWFtOworCisgICAgICAgICAgICB2YXIgdmlkZW8gPSBvcHRpb25zLnZpZGVvOworICAgICAgICAgICAgaWYgKHZpZGVvKSB7CisgICAgICAgICAgICAgICAgdmlkZW9baXNGaXJlZm94ID8gJ21velNyY09iamVjdCcgOiAnc3JjJ10gPSBpc0ZpcmVmb3ggPyBzdHJlYW0gOiAod2luZG93LlVSTCB8fCB3aW5kb3cud2Via2l0VVJMKS5jcmVhdGVPYmplY3RVUkwoc3RyZWFtKTsKKyAgICAgICAgICAgICAgICB2aWRlby5wbGF5KCk7CisgICAgICAgICAgICB9CisKKyAgICAgICAgICAgIG9wdGlvbnMub25zdWNjZXNzKHN0cmVhbSwgcmV0dXJuQmFjaywgaWRJbnN0YW5jZSwgc3RyZWFtaWQpOworICAgICAgICAgICAgY3VycmVudFVzZXJNZWRpYVJlcXVlc3Quc3RyZWFtc1tpZEluc3RhbmNlXSA9IHsKKyAgICAgICAgICAgICAgICBzdHJlYW06IHN0cmVhbSwKKyAgICAgICAgICAgICAgICBzdHJlYW1pZDogc3RyZWFtaWQKKyAgICAgICAgICAgIH07CisgICAgICAgICAgICBjdXJyZW50VXNlck1lZGlhUmVxdWVzdC5tdXRleCA9IGZhbHNlOworICAgICAgICAgICAgaWYgKGN1cnJlbnRVc2VyTWVkaWFSZXF1ZXN0LnF1ZXVlUmVxdWVzdHMubGVuZ3RoKQorICAgICAgICAgICAgICAgIGdldFVzZXJNZWRpYShjdXJyZW50VXNlck1lZGlhUmVxdWVzdC5xdWV1ZVJlcXVlc3RzLnNoaWZ0KCkpOworICAgICAgICB9CisKKyAgICAgICAgaWYgKGN1cnJ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eworICAgICAgICBSVENQZWVyQ29ubmVjdGlvbiA9IHdlYmtpdFJUQ1BlZXJDb25uZWN0aW9uOworICAgIH0gZWxzZSBpZiAodHlwZW9mIHdpbmRvdy5SVENQZWVyQ29ubmVjdGlvbiAhPT0gJ3VuZGVmaW5lZCcpIHsKKyAgICAgICAgUlRDUGVlckNvbm5lY3Rpb24gPSB3aW5kb3cuUlRDUGVlckNvbm5lY3Rpb247CisgICAgfSBlbHNlIHsKKyAgICAgICAgY29uc29sZS5lcnJvcignV2ViUlRDIDEuMCAoUlRDUGVlckNvbm5lY3Rpb24pIEFQSSBzZWVtcyBOT1QgYXZhaWxhYmxlIGluIHRoaXMgYnJvd3Nlci4nKTsKKyAgICB9CisKKyAgICBmdW5jdGlvbiBzZXRTZHBDb25zdHJhaW50cyhjb25maWcpIHsKKyAgICAgICAgdmFyIHNkcENvbnN0cmFpbnRzOworCisgICAgICAgIHZhciBzZHBDb25zdHJhaW50c19tYW5kYXRvcnkgPSB7CisgICAgICAgICAgICBPZmZlclRvUmVjZWl2ZUF1ZGlvOiAhIWNvbmZpZy5PZmZlclRvUmVjZWl2ZUF1ZGlvLAorICAgICAgICAgICAgT2ZmZXJUb1JlY2VpdmVWaWRlbzogISFjb25maWcuT2ZmZXJUb1JlY2VpdmVWaWRlbworICAgICAgICB9OworCisgICAgICAgIHNkcENvbnN0cmFpbnRzID0geworICAgICAgICAgICAgbWFuZGF0b3J5OiBzZHBDb25zdHJhaW50c19tYW5kYXRvcnksCisgICAgICAgICAgICBvcHRpb25hbDogW3sKKyAgICAgICAgICAgICAgICBWb2ljZUFjdGl2aXR5RGV0ZWN0aW9uOiBmYWxzZQorICAgICAgICAgICAgfV0KKyAgICAgICAgfTsKKworICAgICAgICBpZiAoISFuYXZpZ2F0b3IubW96R2V0VXNlck1lZGlhICYmIGZpcmVmb3hWZXJzaW9uID4gMzQpIHsKKyAgICAgICAgICAgIHNkcENvbnN0cmFpbnRzID0geworICAgICAgICAgICAgICAgIE9mZmVyVG9SZWNlaXZlQXVkaW86ICEhY29uZmlnLk9mZmVyVG9SZWNlaXZlQXVkaW8sCisgICAgICAgICAgICAgICAgT2ZmZXJUb1JlY2VpdmVWaWRlbzogISFjb25maWcuT2ZmZXJUb1JlY2VpdmVWaWRlbworICAgICAgICAgICAgfTsKKyAgICAgICAgfQorCisgICAgICAgIHJldHVybiBzZHBDb25zdHJhaW50czsKKyAgICB9CisKKyAgICBmdW5jdGlvbiBQZWVyQ29ubmVjdGlvbigpIHsKKyAgICAgICAgcmV0dXJuIHsKKyAgICAgICAgICAgIGNyZWF0ZTogZnVuY3Rpb24odHlwZSwgb3B0aW9ucykgeworICAgICAgICAgICAgICAgIG1lcmdlKHRoaXMsIG9wdGlvbnMpOworCisgICAgICAgICAgICAgICAgdmFyIHNlbGYgPSB0aGlzOworCisgICAgICAgICAgICAgICAgdGhpcy50eXBlID0gdHlwZTsKKyAgICAgICAgICAgICAgICB0aGlzLmluaXQoKTsKKyAgICAgICAgICAgICAgICB0aGlzLmF0dGFjaE1lZGlhU3RyZWFtcygpOworCisgICAgICAgICAgICAgICAgaWYgKGlzRmlyZWZveCAmJiB0aGlzLnNlc3Npb24uZGF0YSkgeworICAgICAgICAgICAgICAgICAgICBpZiAodGhpcy5zZXNzaW9uLmRhdGEgJiYgdHlwZSA9PSAnb2ZmZXInKSB7CisgICAgICAgICAgICAgICAgICAgICAgICB0aGlzLmNyZWF0ZURhdGFDaGFubmVsKCk7CisgICAgICAgICAgICAgICAgICAgIH0KKworICAgICAgICAgICAgICAgICAgICB0aGlzLmdldExvY2FsRGVzY3JpcHRpb24odHlwZSk7CisKKyAgICAgICAgICAgICAgICAgICAgaWYgKHRoaXMuc2Vzc2lvbi5kYXRhICYmIHR5cGUgPT0gJ2Fuc3dlcicpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIHRoaXMuY3JlYXRlRGF0YUNoYW5uZWwoKTsKKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIH0gZWxzZSBzZWxmLmdldExvY2FsRGVzY3JpcHRpb24odHlwZSk7CisKKyAgICAgICAgICAgICAgICByZXR1cm4gdGhpczsKKyAgICAgICAgICAgIH0sCisgICAgICAgICAgICBnZXRMb2NhbERlc2NyaXB0aW9uOiBmdW5jdGlvbihjcmVhdGVUeXBlKSB7CisgICAgICAgICAgICAgICAgbG9nKCcoZ2V0TG9jYWxEZXNjcmlwdGlvbikgcGVlciBjcmVhdGVUeXBlIGlzJywgY3JlYXRlVHlwZSk7CisKKyAgICAgICAgICAgICAgICBpZiAodGhpcy5zZXNzaW9uLmluYWN0aXZlICYmIGlzTnVsbCh0aGlzLnJ0Y011bHRpQ29ubmVjdGlvbi53YWl0VW50aWxSZW1vdGVTdHJlYW1TdGFydHNGbG93aW5nKSkgeworICAgICAgICAgICAgICAgICAgICAvLyBpbmFjdGl2ZSBzZXNzaW9uIHJldHVybnMgYmxhbmstc3RyZWFtCisgICAgICAgICAgICAgICAgICAgIHRoaXMucnRjTXVsdGlDb25uZWN0aW9uLndhaXRVbnRpbFJlbW90ZVN0cmVhbVN0YXJ0c0Zsb3dpbmcgPSBmYWxzZTsKKyAgICAgICAgICAgICAgICB9CisKKyAgICAgICAgICAgICAgICB2YXIgc2VsZiA9IHRoaXM7CisKKyAgICAgICAgICAgICAgICBpZiAoY3JlYXRlVHlwZSA9PSAnYW5zd2VyJykgeworICAgICAgICAgICAgICAgICAgICB0aGlzLnNldFJlbW90ZURlc2NyaXB0aW9uKHRoaXMub2ZmZXJEZXNjcmlwdGlvbiwgY3JlYXRlRGVzY3JpcHRpb24pOworICAgICAgICAgICAgICAgIH0gZWxzZSBjcmVhdGVEZXNjcmlwdGlvbigpOworCisgICAgICAgICAgICAgICAgZnVuY3Rpb24gY3JlYXRlRGVzY3JpcHRpb24oKSB7CisgICAgICAgICAgICAgICAgICAgIHNlbGYuY29ubmVjdGlvbltjcmVhdGVUeXBlID09ICdvZmZlcicgPyAnY3JlYXRlT2ZmZXInIDogJ2NyZWF0ZUFuc3dlciddKGZ1bmN0aW9uKHNlc3Npb25EZXNjcmlwdGlvbikgeworICAgICAgICAgICAgICAgICAgICAgICAgc2Vzc2lvbkRlc2NyaXB0aW9uLnNkcCA9IHNlbGYuc2VyaWFsaXplU2RwKHNlc3Npb25EZXNjcmlwdGlvbi5zZHAsIGNyZWF0ZVR5cGUpOworICAgICAgICAgICAgICAgICAgICAgICAgc2VsZi5jb25uZWN0aW9uLnNldExvY2FsRGVzY3JpcHRpb24oc2Vzc2lvbkRlc2NyaXB0aW9uKTsKKworICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHNlbGYudHJpY2tsZUljZSkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNlbGYub25TZXNzaW9uRGVzY3JpcHRpb24oc2Vzc2lvbkRlc2NyaXB0aW9uLCBzZWxmLnN0cmVhbWluZm8pOworICAgICAgICAgICAgICAgICAgICAgICAgfQorCisgICAgICAgICAgICAgICAgICAgICAgICBpZiAoc2Vzc2lvbkRlc2NyaXB0aW9uLnR5cGUgPT0gJ29mZmVyJykgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxvZygnb2ZmZXIgc2RwJywgc2Vzc2lvbkRlc2NyaXB0aW9uLnNkcCk7CisgICAgICAgICAgICAgICAgICAgICAgICB9CisKKyAgICAgICAgICAgICAgICAgICAgICAgIHNlbGYucHJldkNyZWF0ZVR5cGUgPSBjcmVhdGVUeXBlOworICAgICAgICAgICAgICAgICAgICB9LCBzZWxmLm9uU2RwRXJyb3IsIHNlbGYuY29uc3RyYWludHMpOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0sCisgICAgICAgICAgICBzZXJpYWxpemVTZHA6IGZ1bmN0aW9uKHNkcCwgY3JlYXRlVHlwZSkgeworICAgICAgICAgICAgICAgIC8vIGl0IGlzICJjb25uZWN0aW9uLnByb2Nlc3NTZHA9ZnVuY3Rpb24oc2RwKXtyZXR1cm4gc2RwO30iCisgICAgICAgICAgICAgICAgc2RwID0gdGhpcy5wcm9jZXNzU2RwKHNkcCk7CisKKyAgICAgICAgICAgICAgICBpZiAoaXNGaXJlZm94KSByZXR1cm4gc2RwOworCisgICAgICAgICAgICAgICAgaWYgKHRoaXMuc2Vzc2lvbi5pbmFjdGl2ZSAmJiAhdGhpcy5ob2xkTUxpbmUpIHsKKyAgICAgICAgICAgICAgICAgICAgdGhpcy5ob2xkID0gdHJ1ZTsKKyAgICAgICAgICAgICAgICAgICAgaWYgKCh0aGlzLnNlc3Npb24uc2NyZWVuIHx8IHRoaXMuc2Vzc2lvbi52aWRlbykgJiYgdGhpcy5zZXNzaW9uLmF1ZGlvKSB7CisgICAgICAgICAgICAgICAgICAgICAgICB0aGlzLmhvbGRNTGluZSA9ICdib3RoJzsKKyAgICAgICAgICAgICAgICAgICAgfSBlbHNlIGlmICh0aGlzLnNlc3Npb24uc2NyZWVuIHx8IHRoaXMuc2Vzc2lvbi52aWRlbykgeworICAgICAgICAgICAgICAgICAgICAgICAgdGhpcy5ob2xkTUxpbmUgPSAndmlkZW8nOworICAgICAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKHRoaXMuc2Vzc2lvbi5hdWRpbykgeworICAgICAgICAgICAgICAgICAgICAgICAgdGhpcy5ob2xkTUxpbmUgPSAnYXVkaW8nOworICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgfQorCisgICAgICAgICAgICAgICAgc2RwID0gdGhpcy5zZXRCYW5kd2lkdGgoc2RwKTsKKyAgICAgICAgICAgICAgICBpZiAodGhpcy5ob2xkTUxpbmUgPT0gJ2JvdGgnKSB7CisgICAgICAgICAgICAgICAgICAgIGlmICh0aGlzLmhvbGQpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIHRoaXMucHJldlNEUCA9IHNkcDsKKyAgICAgICAgICAgICAgICAgICAgICAgIHNkcCA9IHNkcC5yZXBsYWNlKC9hPXNlbmRvbmx5fGE9cmVjdm9ubHl8YT1zZW5kcmVjdi9nLCAnYT1pbmFjdGl2ZScpOworICAgICAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKHRoaXMucHJldlNEUCkgeworICAgICAgICAgICAgICAgICAgICAgICAgaWYgKCF0aGlzLnNlc3Npb24uaW5hY3RpdmUpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyBpdCBtZWFucyB0aGF0IERUU0wga2V5IGV4Y2hhbmdlIGFscmVhZHkgaGFwcGVuZWQgZm9yIHNpbmdsZSBvciBtdWx0aXBsZSBtZWRpYSBsaW5lcy4KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyB0aGlzIGJsb2NrIGNoZWNrcywga2V5LWV4Y2hhbmdlIG11c3QgYmUgaGFwcGVuZWQgZm9yIGFsbCBtZWRpYSBsaW5lcy4KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBzZHAgPSB0aGlzLnByZXZTRFA7CisKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyB0b2RvOiB0ZXN0IGl0OiBtYWtlcyBzZW5zZT8KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoY2hyb21lVmVyc2lvbiA8PSAzNSkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gc2RwOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAodGhpcy5ob2xkTUxpbmUgPT0gJ2F1ZGlvJyB8fCB0aGlzLmhvbGRNTGluZSA9PSAndmlkZW8nKSB7CisgICAgICAgICAgICAgICAgICAgIHNkcCA9IHNkcC5zcGxpdCgnbT0nKTsKKworICAgICAgICAgICAgICAgICAgICB2YXIgYXVkaW8gPSAnJzsKKyAgICAgICAgICAgICAgICAgICAgdmFyIHZpZGVvID0gJyc7CisKKyAgICAgICAgICAgICAgICAgICAgaWYgKHNkcFsxXSAmJiBzZHBbMV0uaW5kZXhPZignYXVkaW8nKSA9PSAwKSB7CisgICAgICAgICAgICAgICAgICAgICAgICBhdWRpbyA9ICdtPScgKyBzZHBbMV07CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgaWYgKHNkcFsyXSAmJiBzZHBbMl0uaW5kZXhPZignYXVkaW8nKSA9PSAwKSB7CisgICAgICAgICAgICAgICAgICAgICAgICBhdWRpbyA9ICdtPScgKyBzZHBbMl07CisgICAgICAgICAgICAgICAgICAgIH0KKworICAgICAgICAgICAgICAgICAgICBpZiAoc2RwWzFdICYmIHNkcFsxXS5pbmRleE9mKCd2aWRlbycpID09IDApIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIHZpZGVvID0gJ209JyArIHNkcFsxXTsKKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICBpZiAoc2RwWzJdICYmIHNkcFsyXS5pbmRleE9mKCd2aWRlbycpID09IDApIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIHZpZGVvID0gJ209JyArIHNkcFsyXTsKKyAgICAgICAgICAgICAgICAgICAgfQorCisgICAgICAgICAgICAgICAgICAgIGlmICh0aGlzLmhvbGRNTGluZSA9PSAnYXVkaW8nKSB7CisgICAgICAgICAgICAgICAgICAgICAgICBpZiAodGhpcy5ob2xkKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgdGhpcy5wcmV2U0RQID0gc2RwWzBdICsgYXVkaW8gKyB2aWRlbzsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBzZHAgPSBzZHBbMF0gKyBhdWRpby5yZXBsYWNlKC9hPXNlbmRvbmx5fGE9cmVjdm9ubHl8YT1zZW5kcmVjdi9nLCAnYT1pbmFjdGl2ZScpICsgdmlkZW87CisgICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKHRoaXMucHJldlNEUCkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNkcCA9IHRoaXMucHJldlNEUDsKKyAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgfQorCisgICAgICAgICAgICAgICAgICAgIGlmICh0aGlzLmhvbGRNTGluZSA9PSAndmlkZW8nKSB7CisgICAgICAgICAgICAgICAgICAgICAgICBpZiAodGhpcy5ob2xkKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgdGhpcy5wcmV2U0RQID0gc2RwWzBdICsgYXVkaW8gKyB2aWRlbzsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBzZHAgPSBzZHBbMF0gKyBhdWRpbyArIHZpZGVvLnJlcGxhY2UoL2E9c2VuZG9ubHl8YT1yZWN2b25seXxhPXNlbmRyZWN2L2csICdhPWluYWN0aXZlJyk7CisgICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKHRoaXMucHJldlNEUCkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNkcCA9IHRoaXMucHJldlNEUDsKKyAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIH0KKworICAgICAgICAgICAgICAgIGlmICghdGhpcy5ob2xkICYmIHRoaXMuc2Vzc2lvbi5pbmFjdGl2ZSkgeworICAgICAgICAgICAgICAgICAgICAvLyB0cmFuc3BvcnQuY2MmbD04NTIgLSBodHRwOi8vZ29vLmdsLzBGeHhxRworICAgICAgICAgICAgICAgICAgICAvLyBkdGxzdHJhbnNwb3J0LmgmbD0yMzQgLSBodHRwOi8vZ29vLmdsLzdFNHNZRgorICAgICAgICAgICAgICAgICAgICAvLyBodHRwOi8vdG9vbHMuaWV0Zi5vcmcvaHRtbC9yZmM0MzQwCisKKyAgICAgICAgICAgICAgICAgICAgLy8gRnJvbSBSRkMgNDE0NSwgU0RQIHNldHVwIGF0dHJpYnV0ZSB2YWx1ZXMuCisgICAgICAgICAgICAgICAgICAgIC8vIGh0dHA6Ly9nb28uZ2wveEVUSkVwICYmIGh0dHA6Ly9nb28uZ2wvM1dnY2F1CisgICAgICAgICAgICAgICAgICAgIGlmIChjcmVhdGVUeXBlID09ICdvZmZlcicpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIHNkcCA9IHNkcC5yZXBsYWNlKC9hPXNldHVwOnBhc3NpdmV8YT1zZXR1cDphY3RpdmV8YT1zZXR1cDpob2xkY29ubi9nLCAnYT1zZXR1cDphY3RwYXNzJyk7CisgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICAgICAgICAgICAgICBzZHAgPSBzZHAucmVwbGFjZSgvYT1zZXR1cDphY3RwYXNzfGE9c2V0dXA6cGFzc2l2ZXxhPXNldHVwOmhvbGRjb25uL2csICdhPXNldHVwOmFjdGl2ZScpOworICAgICAgICAgICAgICAgICAgICB9CisKKyAgICAgICAgICAgICAgICAgICAgLy8gd2hpbHN0IGRvaW5nIGhhbmRzaGFrZSwgZWl0aGVyIG1lZGlhIGxpbmVzIHdlcmUgImluYWN0aXZlIgorICAgICAgICAgICAgICAgICAgICAvLyBvciBubyBtZWRpYSBsaW5lcyB3ZXJlIHByZXNlbnQKKyAgICAgICAgICAgICAgICAgICAgc2RwID0gc2RwLnJlcGxhY2UoL2E9aW5hY3RpdmUvZywgJ2E9c2VuZHJlY3YnKTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgLy8gdGhpcy5zZXNzaW9uLmluYWN0aXZlID0gZmFsc2U7CisgICAgICAgICAgICAgICAgcmV0dXJuIHNkcDsKKyAgICAgICAgICAgIH0sCisgICAgICAgICAgICBpbml0OiBmdW5jdGlvbigpIHsKKyAgICAgICAgICAgICAgICB0aGlzLnNldENvbnN0cmFpbnRzKCk7CisgICAgICAgICAgICAgICAgdGhpcy5jb25uZWN0aW9uID0gbmV3IFJUQ1BlZXJDb25uZWN0aW9uKHRoaXMuaWNlU2VydmVycywgdGhpcy5vcHRpb25hbEFyZ3VtZW50KTsKKworICAgICAgICAgICAgICAgIGlmICh0aGlzLnNlc3Npb24uZGF0YSkgeworICAgICAgICAgICAgICAgICAgICBsb2coJ2ludm9rZWQ6IGNyZWF0ZURhdGFDaGFubmVsJyk7CisgICAgICAgICAgICAgICAgICAgIHRoaXMuY3JlYXRlRGF0YUNoYW5uZWwoKTsKKyAgICAgICAgICAgICAgICB9CisKKyAgICAgICAgICAgICAgICB0aGlzLmNvbm5lY3Rpb24ub25pY2VjYW5kaWRhdGUgPSBmdW5jdGlvbihldmVudCkgeworICAgICAgICAgICAgICAgICAgICBpZiAoIWV2ZW50LmNhbmRpZGF0ZSkgeworICAgICAgICAgICAgICAgICAgICAgICAgaWYgKCFzZWxmLnRyaWNrbGVJY2UpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm5TRFAoKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIH0KKworICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuOworICAgICAgICAgICAgICAgICAgICB9CisKKyAgICAgICAgICAgICAgICAgICAgaWYgKCFzZWxmLnRyaWNrbGVJY2UpIHJldHVybjsKKworICAgICAgICAgICAgICAgICAgICBzZWxmLm9uaWNlY2FuZGlkYXRlKGV2ZW50LmNhbmRpZGF0ZSk7CisgICAgICAgICAgICAgICAgfTsKKworICAgICAgICAgICAgICAgIGZ1bmN0aW9uIHJldHVyblNEUCgpIHsKKyAgICAgICAgICAgICAgICAgICAgaWYgKHNlbGYucmV0dXJuZWRTRFApIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIHNlbGYucmV0dXJuZWRTRFAgPSBmYWxzZTsKKyAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybjsKKyAgICAgICAgICAgICAgICAgICAgfTsKKyAgICAgICAgICAgICAgICAgICAgc2VsZi5yZXR1cm5lZFNEUCA9IHRydWU7CisKKyAgICAgICAgICAgICAgICAgICAgc2VsZi5vblNlc3Npb25EZXNjcmlwdGlvbihzZWxmLmNvbm5lY3Rpb24ubG9jYWxEZXNjcmlwdGlvbiwgc2VsZi5zdHJlYW1pbmZvKTsKKyAgICAgICAgICAgICAgICB9CisKKyAgICAgICAgICAgICAgICB0aGlzLmNvbm5lY3Rpb24ub25hZGRzdHJlYW0gPSBmdW5jdGlvbihlKSB7CisgICAgICAgICAgICAgICAgICAgIGxvZygnb25hZGRzdHJlYW0nLCBpc1BsdWdpblJUQyA/IGUuc3RyZWFtIDogdG9TdHIoZS5zdHJlYW0pKTsKKworICAgICAgICAgICAgICAgICAgICBzZWxmLm9uYWRkc3RyZWFtKGUuc3RyZWFtLCBzZWxmLnNlc3Npb24pOworICAgICAgICAgICAgICAgIH07CisKKyAgICAgICAgICAgICAgICB0aGlzLmNvbm5lY3Rpb24ub25yZW1vdmVzdHJlYW0gPSBmdW5jdGlvbihlKSB7CisgICAgICAgICAgICAgICAgICAgIHNlbGYub25yZW1vdmVzdHJlYW0oZS5zdHJlYW0pOworICAgICAgICAgICAgICAgIH07CisKKyAgICAgICAgICAgICAgICB0aGlzLmNvbm5lY3Rpb24ub25zaWduYWxpbmdzdGF0ZWNoYW5nZSA9IGZ1bmN0aW9uKCkgeworICAgICAgICAgICAgICAgICAgICBzZWxmLmNvbm5lY3Rpb24gJiYgc2VsZi5vbmljZWNvbm5lY3Rpb25zdGF0ZWNoYW5nZSh7CisgICAgICAgICAgICAgICAgICAgICAgICBpY2VDb25uZWN0aW9uU3RhdGU6IHNlbGYuY29ubmVjdGlvbi5pY2VDb25uZWN0aW9uU3RhdGUsCisgICAgICAgICAgICAgICAgICAgICAgICBpY2VHYXRoZXJpbmdTdGF0ZTogc2VsZi5jb25uZWN0aW9uLmljZUdhdGhlcmluZ1N0YXRlLAorICAgICAgICAgICAgICAgICAgICAgICAgc2lnbmFsaW5nU3RhdGU6IHNlbGYuY29ubmVjdGlvbi5zaWduYWxpbmdTdGF0ZQorICAgICAgICAgICAgICAgICAgICB9KTsKKyAgICAgICAgICAgICAgICB9OworCisgICAgICAgICAgICAgICAgdGhpcy5jb25uZWN0aW9uLm9uaWNlY29ubmVjdGlvbnN0YXRlY2hhbmdlID0gZnVuY3Rpb24oKSB7CisgICAgICAgICAgICAgICAgICAgIGlmICghc2VsZi5jb25uZWN0aW9uKSByZXR1cm47CisKKyAgICAgICAgICAgICAgICAgICAgc2VsZi5vbmljZWNvbm5lY3Rpb25zdGF0ZWNoYW5nZSh7CisgICAgICAgICAgICAgICAgICAgICAgICBpY2VDb25uZWN0aW9uU3RhdGU6IHNlbGYuY29ubmVjdGlvbi5pY2VDb25uZWN0aW9uU3RhdGUsCisgICAgICAgICAgICAgICAgICAgICAgICBpY2VHYXRoZXJpbmdTdGF0ZTogc2VsZi5jb25uZWN0aW9uLmljZUdhdGhlcmluZ1N0YXRlLAorICAgICAgICAgICAgICAgICAgICAgICAgc2lnbmFsaW5nU3RhdGU6IHNlbGYuY29ubmVjdGlvbi5zaWduYWxpbmdTdGF0ZQorICAgICAgICAgICAgICAgICAgICB9KTsKKworICAgICAgICAgICAgICAgICAgICBpZiAoc2VsZi50cmlja2xlSWNlKSByZXR1cm47CisKKyAgICAgICAgICAgICAgICAgICAgaWYgKHNlbGYuY29ubmVjdGlvbi5pY2VHYXRoZXJpbmdTdGF0ZSA9PSAnY29tcGxldGUnKSB7CisgICAgICAgICAgICAgICAgICAgICAgICBsb2coJ2ljZUdhdGhlcmluZ1N0YXRlJywgc2VsZi5jb25uZWN0aW9uLmljZUdhdGhlcmluZ1N0YXRlKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIHJldHVyblNEUCgpOworICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgfTsKKworICAgICAgICAgICAgICAgIHZhciBzZWxmID0gdGhpczsKKyAgICAgICAgICAgIH0sCisgICAgICAgICAgICBzZXRCYW5kd2lkdGg6IGZ1bmN0aW9uKHNkcCkgeworICAgICAgICAgICAgICAgIGlmIChpc01vYmlsZURldmljZSB8fCBpc0ZpcmVmb3ggfHwgIXRoaXMuYmFuZHdpZHRoKSByZXR1cm4gc2RwOworCisgICAgICAgICAgICAgICAgdmFyIGJhbmR3aWR0aCA9IHRoaXMuYmFuZHdpZHRoOworCisgICAgICAgICAgICAgICAgaWYgKHRoaXMuc2Vzc2lvbi5zY3JlZW4pIHsKKyAgICAgICAgICAgICAgICAgICAgaWYgKCFiYW5kd2lkdGguc2NyZWVuKSB7CisgICAgICAgICAgICAgICAgICAgICAgICB3YXJuKCdJdCBzZWVtcyB0aGF0IHlvdSBhcmUgbm90IHVzaW5nIGJhbmR3aWR0aCBmb3Igc2NyZWVuLiBTY3JlZW4gc2hhcmluZyBpcyBleHBlY3RlZCB0byBmYWlsLicpOworICAgICAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKGJhbmR3aWR0aC5zY3JlZW4gPCAzMDApIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIHdhcm4oJ0l0IHNlZW1zIHRoYXQgeW91IGFyZSB1c2luZyB3cm9uZyBiYW5kd2lkdGggdmFsdWUgZm9yIHNjcmVlbi4gU2NyZWVuIHNoYXJpbmcgaXMgZXhwZWN0ZWQgdG8gZmFpbC4nKTsKKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIH0KKworICAgICAgICAgICAgICAgIC8vIGlmIHNjcmVlbjsgbXVzdCB1c2UgYXQgbGVhc3QgMzAwa2JzCisgICAgICAgICAgICAgICAgaWYgKGJhbmR3aWR0aC5zY3JlZW4gJiYgdGhpcy5zZXNzaW9uLnNjcmVlbikgeworICAgICAgICAgICAgICAgICAgICBzZHAgPSBzZHAucmVwbGFjZSgvYj1BUyhbXlxyXG5dK1xyXG4pL2csICcnKTsKKyAgICAgICAgICAgICAgICAgICAgc2RwID0gc2RwLnJlcGxhY2UoL2E9bWlkOnZpZGVvXHJcbi9nLCAnYT1taWQ6dmlkZW9cclxuYj1BUzonICsgYmFuZHdpZHRoLnNjcmVlbiArICdcclxuJyk7CisgICAgICAgICAgICAgICAgfQorCisgICAgICAgICAgICAgICAgLy8gcmVtb3ZlIGV4aXN0aW5nIGJhbmR3aWR0aCBsaW5lcworICAgICAgICAgICAgICAgIGlmIChiYW5kd2lkdGguYXVkaW8gfHwgYmFuZHdpZHRoLnZpZGVvIHx8IGJhbmR3aWR0aC5kYXRhKSB7CisgICAgICAgICAgICAgICAgICAgIHNkcCA9IHNkcC5yZXBsYWNlKC9iPUFTKFteXHJcbl0rXHJcbikvZywgJycpOworICAgICAgICAgICAgICAgIH0KKworICAgICAgICAgICAgICAgIGlmIChiYW5kd2lkdGguYXVkaW8pIHsKKyAgICAgICAgICAgICAgICAgICAgc2RwID0gc2RwLnJlcGxhY2UoL2E9bWlkOmF1ZGlvXHJcbi9nLCAnYT1taWQ6YXVkaW9cclxuYj1BUzonICsgYmFuZHdpZHRoLmF1ZGlvICsgJ1xyXG4nKTsKKyAgICAgICAgICAgICAgICB9CisKKyAgICAgICAgICAgICAgICBpZiAoYmFuZHdpZHRoLnZpZGVvKSB7CisgICAgICAgICAgICAgICAgICAgIHNkcCA9IHNkcC5yZXBsYWNlKC9hPW1pZDp2aWRlb1xyXG4vZywgJ2E9bWlkOnZpZGVvXHJcbmI9QVM6JyArICh0aGlzLnNlc3Npb24uc2NyZWVuID8gYmFuZHdpZHRoLnNjcmVlbiA6IGJhbmR3aWR0aC52aWRlbykgKyAnXHJcbicpOworICAgICAgICAgICAgICAgIH0KKworICAgICAgICAgICAgICAgIGlmIChiYW5kd2lkdGguZGF0YSAmJiAhdGhpcy5wcmVmZXJTQ1RQKSB7CisgICAgICAgICAgICAgICAgICAgIHNkcCA9IHNkcC5yZXBsYWNlKC9hPW1pZDpkYXRhXHJcbi9nLCAnYT1taWQ6ZGF0YVxyXG5iPUFTOicgKyBiYW5kd2lkdGguZGF0YSArICdcclxuJyk7CisgICAgICAgICAgICAgICAgfQorCisgICAgICAgICAgICAgICAgcmV0dXJuIHNkcDsKKyAgICAgICAgICAgIH0sCisgICAgICAgICAgICBzZXRDb25zdHJhaW50czogZnVuY3Rpb24oKSB7CisgICAgICAgICAgICAgICAgdmFyIHNkcENvbnN0cmFpbnRzID0gc2V0U2RwQ29uc3RyYWludHMoeworICAgICAgICAgICAgICAgICAgICBPZmZlclRvUmVjZWl2ZUF1ZGlvOiAhIXRoaXMuc2Vzc2lvbi5hdWRpbywKKyAgICAgICAgICAgICAgICAgICAgT2ZmZXJUb1JlY2VpdmVWaWRlbzogISF0aGlzLnNlc3Npb24udmlkZW8gfHwgISF0aGlzLnNlc3Npb24uc2NyZWVuCisgICAgICAgICAgICAgICAgfSk7CisKKyAgICAgICAgICAgICAgICBpZiAodGhpcy5zZHBDb25zdHJhaW50cy5tYW5kYXRvcnkpIHsKKyAgICAgICAgICAgICAgICAgICAgc2RwQ29uc3RyYWludHMgPSBzZXRTZHBDb25zdHJhaW50cyh0aGlzLnNkcENvbnN0cmFpbnRzLm1hbmRhdG9yeSk7CisgICAgICAgICAgICAgICAgfQorCisgICAgICAgICAgICAgICAgdGhpcy5jb25zdHJhaW50cyA9IHNkcENvbnN0cmFpbnRzOworCisgICAgICAgICAgICAgICAgaWYgKHRoaXMuY29uc3RyYWludHMpIHsKKyAgICAgICAgICAgICAgICAgICAgbG9nKCdzZHAtY29uc3RyYWludHMnLCB0b1N0cih0aGlzLmNvbnN0cmFpbnRzKSk7CisgICAgICAgICAgICAgICAgfQorCisgICAgICAgICAgICAgICAgdGhpcy5vcHRpb25hbEFyZ3VtZW50ID0geworICAgICAgICAgICAgICAgICAgICBvcHRpb25hbDogdGhpcy5vcHRpb25hbEFyZ3VtZW50Lm9wdGlvbmFsIHx8IFtdLAorICAgICAgICAgICAgICAgICAgICBtYW5kYXRvcnk6IHRoaXMub3B0aW9uYWxBcmd1bWVudC5tYW5kYXRvcnkgfHwge30KKyAgICAgICAgICAgICAgICB9OworCisgICAgICAgICAgICAgICAgaWYgKCF0aGlzLnByZWZlclNDVFApIHsKKyAgICAgICAgICAgICAgICAgICAgdGhpcy5vcHRpb25hbEFyZ3VtZW50Lm9wdGlvbmFsLnB1c2goeworICAgICAgICAgICAgICAgICAgICAgICAgUnRwRGF0YUNoYW5uZWxzOiB0cnVlCisgICAgICAgICAgICAgICAgICAgIH0pOworICAgICAgICAgICAgICAgIH0KKworICAgICAgICAgICAgICAgIGxvZygnb3B0aW9uYWwtYXJndW1lbnQnLCB0b1N0cih0aGlzLm9wdGlvbmFsQXJndW1lbnQpKTsKKworICAgICAgICAgICAgICAgIGlmICghaXNOdWxsKHRoaXMuaWNlU2VydmVycykpIHsKKyAgICAgICAgICAgICAgICAgICAgdmFyIGljZUNhbmRpZGF0ZXMgPSB0aGlzLnJ0Y011bHRpQ29ubmVjdGlvbi5jYW5kaWRhdGVzOworCisgICAgICAgICAgICAgICAgICAgIHZhciBzdHVuID0gaWNlQ2FuZGlkYXRlcy5zdHVuOworICAgICAgICAgICAgICAgICAgICB2YXIgdHVybiA9IGljZUNhbmRpZGF0ZXMudHVybjsKKyAgICAgICAgICAgICAgICAgICAgdmFyIGhvc3QgPSBpY2VDYW5kaWRhdGVzLmhvc3Q7CisKKyAgICAgICAgICAgICAgICAgICAgaWYgKCFpc051bGwoaWNlQ2FuZGlkYXRlcy5yZWZsZXhpdmUpKSBzdHVuID0gaWNlQ2FuZGlkYXRlcy5yZWZsZXhpdmU7CisgICAgICAgICAgICAgICAgICAgIGlmICghaXNOdWxsKGljZUNhbmRpZGF0ZXMucmVsYXkpKSB0dXJuID0gaWNlQ2FuZGlkYXRlcy5yZWxheTsKKworICAgICAgICAgICAgICAgICAgICBpZiAoIWhvc3QgJiYgIXN0dW4gJiYgdHVybikgeworICAgICAgICAgICAgICAgICAgICAgICAgdGhpcy5ydGNDb25maWd1cmF0aW9uLmljZVRyYW5zcG9ydHMgPSAncmVsYXknOworICAgICAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKCFob3N0ICYmICFzdHVuICYmICF0dXJuKSB7CisgICAgICAgICAgICAgICAgICAgICAgICB0aGlzLnJ0Y0NvbmZpZ3VyYXRpb24uaWNlVHJhbnNwb3J0cyA9ICdub25lJzsKKyAgICAgICAgICAgICAgICAgICAgfQorCisgICAgICAgICAgICAgICAgICAgIHRoaXMuaWNlU2VydmVycyA9IHsKKyAgICAgICAgICAgICAgICAgICAgICAgIGljZVNlcnZlcnM6IHRoaXMuaWNlU2VydmVycywKKyAgICAgICAgICAgICAgICAgICAgICAgIGljZVRyYW5zcG9ydHM6IHRoaXMucnRjQ29uZmlndXJhdGlvbi5pY2VUcmFuc3BvcnRzCisgICAgICAgICAgICAgICAgICAgIH07CisgICAgICAgICAgICAgICAgfSBlbHNlIHRoaXMuaWNlU2VydmVycyA9IG51bGw7CisKKyAgICAgICAgICAgICAgICBsb2coJ3J0Yy1jb25maWd1cmF0aW9uJywgdG9TdHIodGhpcy5pY2VTZXJ2ZXJzKSk7CisgICAgICAgICAgICB9LAorICAgICAgICAgICAgb25TZHBFcnJvcjogZnVuY3Rpb24oZSkgeworICAgICAgICAgICAgICAgIHZhciBtZXNzYWdlID0gdG9TdHIoZSk7CisKKyAgICAgICAgICAgICAgICBpZiAobWVzc2FnZSAmJiBtZXNzYWdlLmluZGV4T2YoJ1JUUC9TQVZQRiBFeHBlY3RzIGF0IGxlYXN0IDQgZmllbGRzJykgIT0gLTEpIHsKKyAgICAgICAgICAgICAgICAgICAgbWVzc2FnZSA9ICdJdCBzZWVtcyB0aGF0IHlvdSBhcmUgdHJ5aW5nIHRvIGludGVyb3AgUlRQLWRhdGFjaGFubmVscyB3aXRoIFNDVFAuIEl0IGlzIG5vdCBzdXBwb3J0ZWQhJzsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgZXJyb3IoJ29uU2RwRXJyb3I6JywgbWVzc2FnZSk7CisgICAgICAgICAgICB9LAorICAgICAgICAgICAgb25TZHBTdWNjZXNzOiBmdW5jdGlvbigpIHsKKyAgICAgICAgICAgICAgICBsb2coJ3NkcCBzdWNjZXNzJyk7CisgICAgICAgICAgICB9LAorICAgICAgICAgICAgb25NZWRpYUVycm9yOiBmdW5jdGlvbihlcnIpIHsKKyAgICAgICAgICAgICAgICBlcnJvcih0b1N0cihlcnIpKTsKKyAgICAgICAgICAgIH0sCisgICAgICAgICAgICBzZXRSZW1vdGVEZXNjcmlwdGlvbjogZnVuY3Rpb24oc2Vzc2lvbkRlc2NyaXB0aW9uLCBvblNkcFN1Y2Nlc3MpIHsKKyAgICAgICAgICAgICAgICBpZiAoIXNlc3Npb25EZXNjcmlwdGlvbikgdGhyb3cgJ1JlbW90ZSBzZXNzaW9uIGRlc2NyaXB0aW9uIHNob3VsZCBOT1QgYmUgTlVMTC4nOworCisgICAgICAgICAgICAgICAgaWYgKCF0aGlzLmNvbm5lY3Rpb24pIHJldHVybjsKKworICAgICAgICAgICAgICAgIGxvZygnc2V0dGluZyByZW1vdGUgZGVzY3JpcHRpb24nLCBzZXNzaW9uRGVzY3JpcHRpb24udHlwZSwgc2Vzc2lvbkRlc2NyaXB0aW9uLnNkcCk7CisKKyAgICAgICAgICAgICAgICB2YXIgc2VsZiA9IHRoaXM7CisgICAgICAgICAgICAgICAgdGhpcy5jb25uZWN0aW9uLnNldFJlbW90ZURlc2NyaXB0aW9uKAorICAgICAgICAgICAgICAgICAgICBuZXcgUlRDU2Vzc2lvbkRlc2NyaXB0aW9uKHNlc3Npb25EZXNjcmlwdGlvbiksCisgICAgICAgICAgICAgICAgICAgIG9uU2RwU3VjY2VzcyB8fCB0aGlzLm9uU2RwU3VjY2VzcywKKyAgICAgICAgICAgICAgICAgICAgZnVuY3Rpb24oZXJyb3IpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIGlmIChlcnJvci5zZWFyY2goL1NUQVRFX1NFTlRJTklUSUFURXxTVEFURV9JTlBST0dSRVNTL2dpKSA9PSAtMSkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNlbGYub25TZHBFcnJvcihlcnJvcik7CisgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICApOworICAgICAgICAgICAgfSwKKyAgICAgICAgICAgIGFkZEljZUNhbmRpZGF0ZTogZnVuY3Rpb24oY2FuZGlkYXRlKSB7CisgICAgICAgICAgICAgICAgdmFyIHNlbGYgPSB0aGlzOworICAgICAgICAgICAgICAgIGlmIChpc1BsdWdpblJUQykgeworICAgICAgICAgICAgICAgICAgICBSVENJY2VDYW5kaWRhdGUoY2FuZGlkYXRlLCBmdW5jdGlvbihpY2VDYW5kaWRhdGUpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIG9uQWRkSWNlQ2FuZGlkYXRlKGljZUNhbmRpZGF0ZSk7CisgICAgICAgICAgICAgICAgICAgIH0pOworICAgICAgICAgICAgICAgIH0gZWxzZSBvbkFkZEljZUNhbmRpZGF0ZShuZXcgUlRDSWNlQ2FuZGlkYXRlKGNhbmRpZGF0ZSkpOworCisgICAgICAgICAgICAgICAgZnVuY3Rpb24gb25BZGRJY2VDYW5kaWRhdGUoaWNlQ2FuZGlkYXRlKSB7CisgICAgICAgICAgICAgICAgICAgIHNlbGYuY29ubmVjdGlvbi5hZGRJY2VDYW5kaWRhdGUoaWNlQ2FuZGlkYXRlLCBmdW5jdGlvbigpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIGxvZygnYWRkZWQ6JywgY2FuZGlkYXRlLnNkcE1pZCwgY2FuZGlkYXRlLmNhbmRpZGF0ZSk7CisgICAgICAgICAgICAgICAgICAgIH0sIGZ1bmN0aW9uKCkgeworICAgICAgICAgICAgICAgICAgICAgICAgZXJyb3IoJ29uSWNlRmFpbHVyZScsIGFyZ3VtZW50cywgY2FuZGlkYXRlLmNhbmRpZGF0ZSk7CisgICAgICAgICAgICAgICAgICAgIH0pOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0sCisgICAgICAgICAgICBjcmVhdGVEYXRhQ2hhbm5lbDogZnVuY3Rpb24oY2hhbm5lbElkZW50aWZpZXIpIHsKKyAgICAgICAgICAgICAgICAvLyBza2lwIDJuZCBpbnZvY2F0aW9uIG9mIGNyZWF0ZURhdGFDaGFubmVsCisgICAgICAgICAgICAgICAgaWYgKHRoaXMuY2hhbm5lbHMgJiYgdGhpcy5jaGFubmVscy5sZW5ndGgpIHJldHVybjsKKworICAgICAgICAgICAgICAgIHZhciBzZWxmID0gdGhpczsKKworICAgICAgICAgICAgICAgIGlmICghdGhpcy5jaGFubmVscykgdGhpcy5jaGFubmVscyA9IFtdOworCisgICAgICAgICAgICAgICAgLy8gcHJvdG9jb2w6ICd0ZXh0L2NoYXQnLCBwcmVzZXQ6IHRydWUsIHN0cmVhbTogMTYKKyAgICAgICAgICAgICAgICAvLyBtYXhSZXRyYW5zbWl0czowICYmIG9yZGVyZWQ6ZmFsc2UgJiYgb3V0T2ZPcmRlckFsbG93ZWQ6IGZhbHNlCisgICAgICAgICAgICAgICAgdmFyIGRhdGFDaGFubmVsRGljdCA9IHt9OworCisgICAgICAgICAgICAgICAgaWYgKHRoaXMuZGF0YUNoYW5uZWxEaWN0KSBkYXRhQ2hhbm5lbERpY3QgPSB0aGlzLmRhdGFDaGFubmVsRGljdDsKKworICAgICAgICAgICAgICAgIGlmIChpc0Nocm9tZSAmJiAhdGhpcy5wcmVmZXJTQ1RQKSB7CisgICAgICAgICAgICAgICAgICAgIGRhdGFDaGFubmVsRGljdC5yZWxpYWJsZSA9IGZhbHNlOyAvLyBEZXByZWNhdGVkIQorICAgICAgICAgICAgICAgIH0KKworICAgICAgICAgICAgICAgIGxvZygnZGF0YUNoYW5uZWxEaWN0JywgdG9TdHIoZGF0YUNoYW5uZWxEaWN0KSk7CisKKyAgICAgICAgICAgICAgICBpZiAodGhpcy50eXBlID09ICdhbnN3ZXInIHx8IGlzRmlyZWZveCkgeworICAgICAgICAgICAgICAgICAgICB0aGlzLmNvbm5lY3Rpb24ub25kYXRhY2hhbm5lbCA9IGZ1bmN0aW9uKGV2ZW50KSB7CisgICAgICAgICAgICAgICAgICAgICAgICBzZWxmLnNldENoYW5uZWxFdmVudHMoZXZlbnQuY2hhbm5lbCk7CisgICAgICAgICAgICAgICAgICAgIH07CisgICAgICAgICAgICAgICAgfQorCisgICAgICAgICAgICAgICAgaWYgKChpc0Nocm9tZSAmJiB0aGlzLnR5cGUgPT0gJ29mZmVyJykgfHwgaXNGaXJlZm94KSB7CisgICAgICAgICAgICAgICAgICAgIHRoaXMuc2V0Q2hhbm5lbEV2ZW50cygKKyAgICAgICAgICAgICAgICAgICAgICAgIHRoaXMuY29ubmVjdGlvbi5jcmVhdGVEYXRhQ2hhbm5lbChjaGFubmVsSWRlbnRpZmllciB8fCAnY2hhbm5lbCcsIGRhdGFDaGFubmVsRGljdCkKKyAgICAgICAgICAgICAgICAgICAgKTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9LAorICAgICAgICAgICAgc2V0Q2hhbm5lbEV2ZW50czogZnVuY3Rpb24oY2hhbm5lbCkgeworICAgICAgICAgICAgICAgIHZhciBzZWxmID0gdGhpczsKKworICAgICAgICAgICAgICAgIGNoYW5uZWwuYmluYXJ5VHlwZSA9ICdhcnJheWJ1ZmZlcic7CisKKyAgICAgICAgICAgICAgICBpZiAodGhpcy5kYXRhQ2hhbm5lbERpY3QuYmluYXJ5VHlwZSkgeworICAgICAgICAgICAgICAgICAgICBjaGFubmVsLmJpbmFyeVR5cGUgPSB0aGlzLmRhdGFDaGFubmVsRGljdC5iaW5hcnlUeXBlOworICAgICAgICAgICAgICAgIH0KKworICAgICAgICAgICAgICAgIGNoYW5uZWwub25tZXNzYWdlID0gZnVuY3Rpb24oZXZlbnQpIHsKKyAgICAgICAgICAgICAgICAgICAgc2VsZi5vbm1lc3NhZ2UoZXZlbnQuZGF0YSk7CisgICAgICAgICAgICAgICAgfTsKKworICAgICAgICAgICAgICAgIHZhciBudW1iZXJPZlRpbWVzID0gMDsKKyAgICAgICAgICAgICAgICBjaGFubmVsLm9ub3BlbiA9IGZ1bmN0aW9uKCkgeworICAgICAgICAgICAgICAgICAgICBjaGFubmVsLnB1c2ggPSBjaGFubmVsLnNlbmQ7CisgICAgICAgICAgICAgICAgICAgIGNoYW5uZWwuc2VuZCA9IGZ1bmN0aW9uKGRhdGEpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIGlmIChzZWxmLmNvbm5lY3Rpb24uaWNlQ29ubmVjdGlvblN0YXRlID09ICdkaXNjb25uZWN0ZWQnKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuOworICAgICAgICAgICAgICAgICAgICAgICAgfQorCisgICAgICAgICAgICAgICAgICAgICAgICBpZiAoY2hhbm5lbC5yZWFkeVN0YXRlLnNlYXJjaCgvY2xvc2luZ3xjbG9zZWQvZykgIT0gLTEpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm47CisgICAgICAgICAgICAgICAgICAgICAgICB9CisKKyAgICAgICAgICAgICAgICAgICAgICAgIGlmIChjaGFubmVsLnJlYWR5U3RhdGUuc2VhcmNoKC9jb25uZWN0aW5nfG9wZW4vZykgPT0gLTEpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm47CisgICAgICAgICAgICAgICAgICAgICAgICB9CisKKyAgICAgICAgICAgICAgICAgICAgICAgIGlmIChjaGFubmVsLnJlYWR5U3RhdGUgPT0gJ2Nvbm5lY3RpbmcnKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgbnVtYmVyT2ZUaW1lcysrOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBzZXRUaW1lb3V0KGZ1bmN0aW9uKCkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAobnVtYmVyT2ZUaW1lcyA8IDIwKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjaGFubmVsLnNlbmQoZGF0YSk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB0aHJvdyAnTnVtYmVyIG9mIHRpbWVzIGV4Y2VlZGVkIHRvIHdhaXQgZm9yIFdlYlJUQyBkYXRhIGNvbm5lY3Rpb24gdG8gYmUgb3BlbmVkLic7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSwgMTAwMCk7CisgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICB0cnkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNoYW5uZWwucHVzaChkYXRhKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIH0gY2F0Y2ggKGUpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBudW1iZXJPZlRpbWVzKys7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgd2FybignRGF0YSB0cmFuc21pc3Npb24gZmFpbGVkLiBSZS10cmFuc21pdHRpbmcuLicsIG51bWJlck9mVGltZXMsIHRvU3RyKGUpKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAobnVtYmVyT2ZUaW1lcyA+PSAyMCkgdGhyb3cgJ051bWJlciBvZiB0aW1lcyBleGNlZWRlZCB0byByZXNlbmQgZGF0YSBwYWNrZXRzIG92ZXIgV2ViUlRDIGRhdGEgY2hhbm5lbHMuJzsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBzZXRUaW1lb3V0KGZ1bmN0aW9uKCkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjaGFubmVsLnNlbmQoZGF0YSk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSwgMTAwKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgfTsKKyAgICAgICAgICAgICAgICAgICAgc2VsZi5vbm9wZW4oY2hhbm5lbCk7CisgICAgICAgICAgICAgICAgfTsKKworICAgICAgICAgICAgICAgIGNoYW5uZWwub25lcnJvciA9IGZ1bmN0aW9uKGV2ZW50KSB7CisgICAgICAgICAgICAgICAgICAgIHNlbGYub25lcnJvcihldmVudCk7CisgICAgICAgICAgICAgICAgfTsKKworICAgICAgICAgICAgICAgIGNoYW5uZWwub25jbG9zZSA9IGZ1bmN0aW9uKGV2ZW50KSB7CisgICAgICAgICAgICAgICAgICAgIHNlbGYub25jbG9zZShldmVudCk7CisgICAgICAgICAgICAgICAgfTsKKworICAgICAgICAgICAgICAgIHRoaXMuY2hhbm5lbHMucHVzaChjaGFubmVsKTsKKyAgICAgICAgICAgIH0sCisgICAgICAgICAgICBhZGRTdHJlYW06IGZ1bmN0aW9uKHN0cmVhbSkgeworICAgICAgICAgICAgICAgIGlmICghc3RyZWFtLnN0cmVhbWlkICYmICFpc0lFKSB7CisgICAgICAgICAgICAgICAgICAgIHN0cmVhbS5zdHJlYW1pZCA9IGdldFJhbmRvbVN0cmluZygpOworICAgICAgICAgICAgICAgIH0KKworICAgICAgICAgICAgICAgIC8vIHRvZG86IG1heWJlIG5lZWQgdG8gYWRkIGlzQXVkaW8vaXNWaWRlby9pc1NjcmVlbiBpZiBtaXNzaW5nPworCisgICAgICAgICAgICAgICAgbG9nKCdhdHRhY2hpbmcgc3RyZWFtOicsIHN0cmVhbS5zdHJlYW1pZCwgaXNQbHVnaW5SVEMgPyBzdHJlYW0gOiB0b1N0cihzdHJlYW0pKTsKKworICAgICAgICAgICAgICAgIHRoaXMuY29ubmVjdGlvbi5hZGRTdHJlYW0oc3RyZWFtKTsKKworICAgICAgICAgICAgICAgIHRoaXMuc2VuZFN0cmVhbUlkKHN0cmVhbSk7CisgICAgICAgICAgICAgICAgdGhpcy5nZXRTdHJlYW1JbmZvKCk7CisgICAgICAgICAgICB9LAorICAgICAgICAgICAgYXR0YWNoTWVkaWFTdHJlYW1zOiBmdW5jdGlvbigpIHsKKyAgICAgICAgICAgICAgICB2YXIgc3RyZWFtcyA9IHRoaXMuYXR0YWNoU3RyZWFtczsKKyAgICAgICAgICAgICAgICBmb3IgKHZhciBpID0gMDsgaSA8IHN0cmVhbXMubGVuZ3RoOyBpKyspIHsKKyAgICAgICAgICAgICAgICAgICAgdGhpcy5hZGRTdHJlYW0oc3RyZWFtc1tpXSk7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfSwKKyAgICAgICAgICAgIGdldFN0cmVhbUluZm86IGZ1bmN0aW9uKCkgeworICAgICAgICAgICAgICAgIHRoaXMuc3RyZWFtaW5mbyA9ICcnOworICAgICAgICAgICAgICAgIHZhciBzdHJlYW1zID0gdGhpcy5jb25uZWN0aW9uLmdldExvY2FsU3RyZWFtcygpOworICAgICAgICAgICAgICAgIGZvciAodmFyIGkgPSAwOyBpIDwgc3RyZWFtcy5sZW5ndGg7IGkrKykgeworICAgICAgICAgICAgICAgICAgICBpZiAoaSA9PSAwKSB7CisgICAgICAgICAgICAgICAgICAgICAgICB0aGlzLnN0cmVhbWluZm8gPSBKU09OLnN0cmluZ2lmeSh7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgc3RyZWFtaWQ6IHN0cmVhbXNbaV0uc3RyZWFtaWQgfHwgJycsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgaXNTY3JlZW46ICEhc3RyZWFtc1tpXS5pc1NjcmVlbiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBpc0F1ZGlvOiAhIXN0cmVhbXNbaV0uaXNBdWRpbywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBpc1ZpZGVvOiAhIXN0cmVhbXNbaV0uaXNWaWRlbywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBwcmVNdXRlZDogc3RyZWFtc1tpXS5wcmVNdXRlZCB8fCB7fQorICAgICAgICAgICAgICAgICAgICAgICAgfSk7CisgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICAgICAgICAgICAgICB0aGlzLnN0cmVhbWluZm8gKz0gJy0tLS0nICsgSlNPTi5zdHJpbmdpZnkoeworICAgICAgICAgICAgICAgICAgICAgICAgICAgIHN0cmVhbWlkOiBzdHJlYW1zW2ldLnN0cmVhbWlkIHx8ICcnLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlzU2NyZWVuOiAhIXN0cmVhbXNbaV0uaXNTY3JlZW4sCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgaXNBdWRpbzogISFzdHJlYW1zW2ldLmlzQXVkaW8sCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgaXNWaWRlbzogISFzdHJlYW1zW2ldLmlzVmlkZW8sCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgcHJlTXV0ZWQ6IHN0cmVhbXNbaV0ucHJlTXV0ZWQgfHwge30KKyAgICAgICAgICAgICAgICAgICAgICAgIH0pOworICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfSwKKyAgICAgICAgICAgIHJlY3JlYXRlT2ZmZXI6IGZ1bmN0aW9uKHJlbmVnb3RpYXRlLCBjYWxsYmFjaykgeworICAgICAgICAgICAgICAgIGxvZygncmVjcmVhdGluZyBvZmZlcicpOworCisgICAgICAgICAgICAgICAgdGhpcy50eXBlID0gJ29mZmVyJzsKKyAgICAgICAgICAgICAgICB0aGlzLnNlc3Npb24gPSByZW5lZ290aWF0ZTsKKworICAgICAgICAgICAgICAgIC8vIHRvZG86IG1ha2Ugc3VyZSB0aGlzIGRvZXNuJ3QgYWZmZWN0IHJlbmVnb3RpYXRpb24gc2NlbmFyaW9zCisgICAgICAgICAgICAgICAgLy8gdGhpcy5zZXRDb25zdHJhaW50cygpOworCisgICAgICAgICAgICAgICAgdGhpcy5vblNlc3Npb25EZXNjcmlwdGlvbiA9IGNhbGxiYWNrOworICAgICAgICAgICAgICAgIHRoaXMuZ2V0U3RyZWFtSW5mbygpOworCisgICAgICAgICAgICAgICAgLy8gb25lIGNhbiByZW5lZ290aWF0ZSBkYXRhIGNvbm5lY3Rpb24gaW4gZXhpc3RpbmcgYXVkaW8vdmlkZW8vc2NyZWVuIGNvbm5lY3Rpb24hCisgICAgICAgICAgICAgICAgaWYgKHRoaXMuc2Vzc2lvbi5kYXRhKSB7CisgICAgICAgICAgICAgICAgICAgIHRoaXMuY3JlYXRlRGF0YUNoYW5uZWwoKTsKKyAgICAgICAgICAgICAgICB9CisKKyAgICAgICAgICAgICAgICB0aGlzLmdldExvY2FsRGVzY3JpcHRpb24oJ29mZmVyJyk7CisgICAgICAgICAgICB9LAorICAgICAgICAgICAgcmVjcmVhdGVBbnN3ZXI6IGZ1bmN0aW9uKHNkcCwgc2Vzc2lvbiwgY2FsbGJhY2spIHsKKyAgICAgICAgICAgICAgICAvLyBpZihpc0ZpcmVmb3gpIHRoaXMuY3JlYXRlKHRoaXMudHlwZSwgdGhpcyk7CisKKyAgICAgICAgICAgICAgICBsb2coJ3JlY3JlYXRpbmcgYW5zd2VyJyk7CisKKyAgICAgICAgICAgICAgICB0aGlzLnR5cGUgPSAnYW5zd2VyJzsKKyAgICAgICAgICAgICAgICB0aGlzLnNlc3Npb24gPSBzZXNzaW9uOworCisgICAgICAgICAgICAgICAgLy8gdG9kbzogbWFrZSBzdXJlIHRoaXMgZG9lc24ndCBhZmZlY3QgcmVuZWdvdGlhdGlvbiBzY2VuYXJpb3MKKyAgICAgICAgICAgICAgICAvLyB0aGlzLnNldENvbnN0cmFpbnRzKCk7CisKKyAgICAgICAgICAgICAgICB0aGlzLm9uU2Vzc2lvbkRlc2NyaXB0aW9uID0gY2FsbGJhY2s7CisgICAgICAgICAgICAgICAgdGhpcy5vZmZlckRlc2NyaXB0aW9uID0gc2RwOworICAgICAgICAgICAgICAgIHRoaXMuZ2V0U3RyZWFtSW5mbygpOworCisgICAgICAgICAgICAgICAgLy8gb25lIGNhbiByZW5lZ290aWF0ZSBkYXRhIGNvbm5lY3Rpb24gaW4gZXhpc3RpbmcgYXVkaW8vdmlkZW8vc2NyZWVuIGNvbm5lY3Rpb24hCisgICAgICAgICAgICAgICAgaWYgKHRoaXMuc2Vzc2lvbi5kYXRhKSB7CisgICAgICAgICAgICAgICAgICAgIHRoaXMuY3JlYXRlRGF0YUNoYW5uZWwoKTsKKyAgICAgICAgICAgICAgICB9CisKKyAgICAgICAgICAgICAgICB0aGlzLmdldExvY2FsRGVzY3JpcHRpb24oJ2Fuc3dlcicpOworICAgICAgICAgICAgfQorICAgICAgICB9OworICAgIH0KKworICAgIHZhciBGaWxlU2F2ZXIgPSB7CisgICAgICAgIFNhdmVUb0Rpc2s6IGludm9rZVNhdmVBc0RpYWxvZworICAgIH07CisKKworICAgIGZ1bmN0aW9uIGludm9rZVNhdmVBc0RpYWxvZyhmaWxlVXJsLCBmaWxlTmFtZSkgeworICAgICAgICAvKgorICAgICAgICBpZiAodHlwZW9mIG5hdmlnYXRvci5tc1NhdmVPck9wZW5CbG9iICE9PSAndW5kZWZpbmVkJykgeworICAgICAgICAgICAgcmV0dXJuIG5hdmlnYXRvci5tc1NhdmVPck9wZW5CbG9iKGZpbGUsIGZpbGVGdWxsTmFtZSk7CisgICAgICAgIH0gZWxzZSBpZiAodHlwZW9mIG5hdmlnYXRvci5tc1NhdmVCbG9iICE9PSAndW5kZWZpbmVkJykgeworICAgICAgICAgICAgcmV0dXJuIG5hdmlnYXRvci5tc1NhdmVCbG9iKGZpbGUsIGZpbGVGdWxsTmFtZSk7CisgICAgICAgIH0KKyAgICAgICAgKi8KKworICAgICAgICB2YXIgaHlwZXJsaW5rID0gZG9jdW1lbnQuY3JlYXRlRWxlbWVudCgnYScpOworICAgICAgICBoeXBlcmxpbmsuaHJlZiA9IGZpbGVVcmw7CisgICAgICAgIGh5cGVybGluay50YXJnZXQgPSAnX2JsYW5rJzsKKyAgICAgICAgaHlwZXJsaW5rLmRvd25sb2FkID0gZmlsZU5hbWUgfHwgZmlsZVVybDsKKworICAgICAgICBpZiAoISFuYXZpZ2F0b3IubW96R2V0VXNlck1lZGlhKSB7CisgICAgICAgICAgICBoeXBlcmxpbmsub25jbGljayA9IGZ1bmN0aW9uKCkgeworICAgICAgICAgICAgICAgIChkb2N1bWVudC5ib2R5IHx8IGRvY3VtZW50LmRvY3VtZW50RWxlbWVudCkucmVtb3ZlQ2hpbGQoaHlwZXJsaW5rKTsKKyAgICAgICAgICAgIH07CisgICAgICAgICAgICAoZG9jdW1lbnQuYm9keSB8fCBkb2N1bWVudC5kb2N1bWVudEVsZW1lbnQpLmFwcGVuZENoaWxkKGh5cGVybGluayk7CisgICAgICAgIH0KKworICAgICAgICB2YXIgZXZ0ID0gbmV3IE1vdXNlRXZlbnQoJ2NsaWNrJywgeworICAgICAgICAgICAgdmlldzogd2luZG93LAorICAgICAgICAgICAgYnViYmxlczogdHJ1ZSwKKyAgICAgICAgICAgIGNhbmNlbGFibGU6IHRydWUKKyAgICAgICAgfSk7CisKKyAgICAgICAgaHlwZXJsaW5rLmRpc3BhdGNoRXZlbnQoZXZ0KTsKKworICAgICAgICBpZiAoIW5hdmlnYXRvci5tb3pHZXRVc2VyTWVkaWEpIHsKKyAgICAgICAgICAgIFVSTC5yZXZva2VPYmplY3RVUkwoaHlwZXJsaW5rLmhyZWYpOworICAgICAgICB9CisgICAgfQorCisgICAgdmFyIFRleHRTZW5kZXIgPSB7CisgICAgICAgIHNlbmQ6IGZ1bmN0aW9uKGNvbmZpZykgeworICAgICAgICAgICAgdmFyIGNvbm5lY3Rpb24gPSBjb25maWcuY29ubmVjdGlvbjsKKworICAgICAgICAgICAgaWYgKGNvbmZpZy50ZXh0IGluc3RhbmNlb2YgQXJyYXlCdWZmZXIgfHwgY29uZmlnLnRleHQgaW5zdGFuY2VvZiBEYXRhVmlldykgeworICAgICAgICAgICAgICAgIHJldHVybiBjb25maWcuY2hhbm5lbC5zZW5kKGNvbmZpZy50ZXh0LCBjb25maWcuX2NoYW5uZWwpOworICAgICAgICAgICAgfQorCisgICAgICAgICAgICB2YXIgY2hhbm5lbCA9IGNvbmZpZy5jaGFubmVsLAorICAgICAgICAgICAgICAgIF9jaGFubmVsID0gY29uZmlnLl9jaGFubmVsLAorICAgICAgICAgICAgICAgIGluaXRpYWxUZXh0ID0gY29uZmlnLnRleHQsCisgICAgICAgICAgICAgICAgcGFja2V0U2l6ZSA9IGNvbm5lY3Rpb24uY2h1bmtTaXplIHx8IDEwMDAsCisgICAgICAgICAgICAgICAgdGV4dFRvVHJhbnNmZXIgPSAnJywKKyAgICAgICAgICAgICAgICBpc29iamVjdCA9IGZhbHNlOworCisgICAgICAgICAgICBpZiAoIWlzU3RyaW5nKGluaXRpYWxUZXh0KSkgeworICAgICAgICAgICAgICAgIGlzb2JqZWN0ID0gdHJ1ZTsKKyAgICAgICAgICAgICAgICBpbml0aWFsVGV4dCA9IEpTT04uc3RyaW5naWZ5KGluaXRpYWxUZXh0KTsKKyAgICAgICAgICAgIH0KKworICAgICAgICAgICAgLy8gdXVpZCBpcyB1c2VkIHRvIHVuaXF1ZWx5IGlkZW50aWZ5IHNlbmRpbmcgaW5zdGFuY2UKKyAgICAgICAgICAgIHZhciB1dWlkID0gZ2V0UmFuZG9tU3RyaW5nKCk7CisgICAgICAgICAgICB2YXIgc2VuZGluZ1RpbWUgPSBuZXcgRGF0ZSgpLmdldFRpbWUoKTsKKworICAgICAgICAgICAgc2VuZFRleHQoaW5pdGlhbFRleHQpOworCisgICAgICAgICAgICBmdW5jdGlvbiBzZW5kVGV4dCh0ZXh0TWVzc2FnZSwgdGV4dCkgeworICAgICAgICAgICAgICAgIHZhciBkYXRhID0geworICAgICAgICAgICAgICAgICAgICB0eXBlOiAndGV4dCcsCisgICAgICAgICAgICAgICAgICAgIHV1aWQ6IHV1aWQsCisgICAgICAgICAgICAgICAgICAgIHNlbmRpbmdUaW1lOiBzZW5kaW5nVGltZQorICAgICAgICAgICAgICAgIH07CisKKyAgICAgICAgICAgICAgICBpZiAodGV4dE1lc3NhZ2UpIHsKKyAgICAgICAgICAgICAgICAgICAgdGV4dCA9IHRleHRNZXNzYWdlOworICAgICAgICAgICAgICAgICAgICBkYXRhLnBhY2tldHMgPSBwYXJzZUludCh0ZXh0Lmxlbmd0aCAvIHBhY2tldFNpemUpOworICAgICAgICAgICAgICAgIH0KKworICAgICAgICAgICAgICAgIGlmICh0ZXh0Lmxlbmd0aCA+IHBhY2tldFNpemUpCisgICAgICAgICAgICAgICAgICAgIGRhdGEubWVzc2FnZSA9IHRleHQuc2xpY2UoMCwgcGFja2V0U2l6ZSk7CisgICAgICAgICAgICAgICAgZWxzZSB7CisgICAgICAgICAgICAgICAgICAgIGRhdGEubWVzc2FnZSA9IHRleHQ7CisgICAgICAgICAgICAgICAgICAgIGRhdGEubGFzdCA9IHRydWU7CisgICAgICAgICAgICAgICAgICAgIGRhdGEuaXNvYmplY3QgPSBpc29iamVjdDsKKyAgICAgICAgICAgICAgICB9CisKKyAgICAgICAgICAgICAgICBjaGFubmVsLnNlbmQoZGF0YSwgX2NoYW5uZWwpOworCisgICAgICAgICAgICAgICAgdGV4dFRvVHJhbnNmZXIgPSB0ZXh0LnNsaWNlKGRhdGEubWVzc2FnZS5sZW5ndGgpOworCisgICAgICAgICAgICAgICAgaWYgKHRleHRUb1RyYW5zZmVyLmxlbmd0aCkgeworICAgICAgICAgICAgICAgICAgICBzZXRUaW1lb3V0KGZ1bmN0aW9uKCkgeworICAgICAgICAgICAgICAgICAgICAgICAgc2VuZFRleHQobnVsbCwgdGV4dFRvVHJhbnNmZXIpOworICAgICAgICAgICAgICAgICAgICB9LCBjb25uZWN0aW9uLmNodW5rSW50ZXJ2YWwgfHwgMTAwKTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9CisgICAgICAgIH0KKyAgICB9OworCisgICAgZnVuY3Rpb24gVGV4dFJlY2VpdmVyKGNvbm5lY3Rpb24pIHsKKyAgICAgICAgdmFyIGNvbnRlbnQgPSB7fTsKKworICAgICAgICBmdW5jdGlvbiByZWNlaXZlKGRhdGEsIHVzZXJpZCwgZXh0cmEpIHsKKyAgICAgICAgICAgIC8vIHV1aWQgaXMgdXNlZCB0byB1bmlxdWVseSBpZGVudGlmeSBzZW5kaW5nIGluc3RhbmNlCisgICAgICAgICAgICB2YXIgdXVpZCA9IGRhdGEudXVpZDsKKyAgICAgICAgICAgIGlmICghY29udGVudFt1dWlkXSkgY29udGVudFt1dWlkXSA9IFtdOworCisgICAgICAgICAgICBjb250ZW50W3V1aWRdLnB1c2goZGF0YS5tZXNzYWdlKTsKKyAgICAgICAgICAgIGlmIChkYXRhLmxhc3QpIHsKKyAgICAgICAgICAgICAgICB2YXIgbWVzc2FnZSA9IGNvbnRlbnRbdXVpZF0uam9pbignJyk7CisgICAgICAgICAgICAgICAgaWYgKGRhdGEuaXNvYmplY3QpIG1lc3NhZ2UgPSBKU09OLnBhcnNlKG1lc3NhZ2UpOworCisgICAgICAgICAgICAgICAgLy8gbGF0ZW5jeSBkZXRlY3Rpb24KKyAgICAgICAgICAgICAgICB2YXIgcmVjZWl2aW5nVGltZSA9IG5ldyBEYXRlKCkuZ2V0VGltZSgpOworICAgICAgICAgICAgICAgIHZhciBsYXRlbmN5ID0gcmVjZWl2aW5nVGltZSAtIGRhdGEuc2VuZGluZ1RpbWU7CisKKyAgICAgICAgICAgICAgICB2YXIgZSA9IHsKKyAgICAgICAgICAgICAgICAgICAgZGF0YTogbWVzc2FnZSwKKyAgICAgICAgICAgICAgICAgICAgdXNlcmlkOiB1c2VyaWQsCisgICAgICAgICAgICAgICAgICAgIGV4dHJhOiBleHRyYSwKKyAgICAgICAgICAgICAgICAgICAgbGF0ZW5jeTogbGF0ZW5jeQorICAgICAgICAgICAgICAgIH07CisKKyAgICAgICAgICAgICAgICBpZiAobWVzc2FnZS5wcmVSZWNvcmRlZE1lZGlhQ2h1bmspIHsKKyAgICAgICAgICAgICAgICAgICAgaWYgKCFjb25uZWN0aW9uLnByZVJlY29yZGVkTWVkaWFzW21lc3NhZ2Uuc3RyZWFtZXJpZF0pIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIGNvbm5lY3Rpb24uc2hhcmVNZWRpYUZpbGUobnVsbCwgbnVsbCwgbWVzc2FnZS5zdHJlYW1lcmlkKTsKKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICBjb25uZWN0aW9uLnByZVJlY29yZGVkTWVkaWFzW21lc3NhZ2Uuc3RyZWFtZXJpZF0ub25EYXRhKG1lc3NhZ2UuY2h1bmspOworICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAoY29ubmVjdGlvbi5hdXRvVHJhbnNsYXRlVGV4dCkgeworICAgICAgICAgICAgICAgICAgICBlLm9yaWdpbmFsID0gZS5kYXRhOworICAgICAgICAgICAgICAgICAgICBjb25uZWN0aW9uLlRyYW5zbGF0b3IuVHJhbnNsYXRlVGV4dChlLmRhdGEsIGZ1bmN0aW9uKHRyYW5zbGF0ZWRUZXh0KSB7CisgICAgICAgICAgICAgICAgICAgICAgICBlLmRhdGEgPSB0cmFuc2xhdGVkVGV4dDsKKyAgICAgICAgICAgICAgICAgICAgICAgIGNvbm5lY3Rpb24ub25tZXNzYWdlKGUpOworICAgICAgICAgICAgICAgICAgICB9KTsKKyAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKG1lc3NhZ2UuaXNQYXJ0T2ZTY3JlZW4pIHsKKyAgICAgICAgICAgICAgICAgICAgY29ubmVjdGlvbi5vbnBhcnRvZnNjcmVlbihtZXNzYWdlKTsKKyAgICAgICAgICAgICAgICB9IGVsc2UgY29ubmVjdGlvbi5vbm1lc3NhZ2UoZSk7CisKKyAgICAgICAgICAgICAgICBkZWxldGUgY29udGVudFt1dWlkXTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorCisgICAgICAgIHJldHVybiB7CisgICAgICAgICAgICByZWNlaXZlOiByZWNlaXZlCisgICAgICAgIH07CisgICAgfQorCisgICAgLy8gTGFzdCB0aW1lIHVwZGF0ZWQgYXQgU2VwIDI1LCAyMDE1LCAwODozMjoyMworCisgICAgLy8gTGF0ZXN0IGZpbGUgY2FuIGJlIGZvdW5kIGhlcmU6IGh0dHBzOi8vY2RuLndlYnJ0Yy1leHBlcmltZW50LmNvbS9EZXRlY3RSVEMuanMKKworICAgIC8vIE11YXogS2hhbiAgICAgLSB3d3cuTXVhektoYW4uY29tCisgICAgLy8gTUlUIExpY2Vuc2UgICAtIHd3dy5XZWJSVEMtRXhwZXJpbWVudC5jb20vbGljZW5jZQorICAgIC8vIERvY3VtZW50YXRpb24gLSBnaXRodWIuY29tL211YXota2hhbi9EZXRlY3RSVEMKKyAgICAvLyBfX19fX19fX19fX18KKyAgICAvLyBEZXRlY3RSVEMuanMKKworICAgIC8vIERldGVjdFJUQy5oYXNXZWJjYW0gKGhhcyB3ZWJjYW0gZGV2aWNlISkKKyAgICAvLyBEZXRlY3RSVEMuaGFzTWljcm9waG9uZSAoaGFzIG1pY3JvcGhvbmUgZGV2aWNlISkKKyAgICAvLyBEZXRlY3RSVEMuaGFzU3BlYWtlcnMgKGhhcyBzcGVha2VycyEpCisKKyAgICAoZnVuY3Rpb24oKSB7CisKKyAgICAgICAgJ3VzZSBzdHJpY3QnOworCisgICAgICAgIHZhciBuYXZpZ2F0b3IgPSB3aW5kb3cubmF2aWdhdG9yOworCisgICAgICAgIGlmIChuYXZpZ2F0b3IubWVkaWFEZXZpY2VzICYmIG5hdmlnYXRvci5tZWRpYURldmljZXMuZW51bWVyYXRlRGV2aWNlcykgeworICAgICAgICAgICAgLy8gRmlyZWZveCAzOCsgc2VlbXMgaGF2aW5nIHN1cHBvcnQgb2YgZW51bWVyYXRlRGV2aWNlcworICAgICAgICAgICAgLy8gVGhhbmtzIEB4ZHVtYWluZS9lbnVtZXJhdGVEZXZpY2VzCisgICAgICAgICAgICBuYXZpZ2F0b3IuZW51bWVyYXRlRGV2aWNlcyA9IGZ1bmN0aW9uKGNhbGxiYWNrKSB7CisgICAgICAgICAgICAgICAgbmF2aWdhdG9yLm1lZGlhRGV2aWNlcy5lbnVtZXJhdGVEZXZpY2VzKCkudGhlbihjYWxsYmFjayk7CisgICAgICAgICAgICB9OworICAgICAgICB9CisKKyAgICAgICAgaWYgKHR5cGVvZiBuYXZpZ2F0b3IgIT09ICd1bmRlZmluZWQnKSB7CisgICAgICAgICAgICBpZiAodHlwZW9mIG5hdmlnYXRvci53ZWJraXRHZXRVc2VyTWVkaWEgIT09ICd1bmRlZmluZWQnKSB7CisgICAgICAgICAgICAgICAgbmF2aWdhdG9yLmdldFVzZXJNZWRpYSA9IG5hdmlnYXRvci53ZWJraXRHZXRVc2VyTWVkaWE7CisgICAgICAgICAgICB9CisKKyAgICAgICAgICAgIGlmICh0eXBlb2YgbmF2aWdhdG9yLm1vekdldFVzZXJNZWRpYSAhPT0gJ3VuZGVmaW5lZCcpIHsKKyAgICAgICAgICAgICAgICBuYXZpZ2F0b3IuZ2V0VXNlck1lZGlhID0gbmF2aWdhdG9yLm1vekdldFVzZXJNZWRpYTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgIG5hdmlnYXRvciA9IHsKKyAgICAgICAgICAgICAgICBnZXRVc2VyTWVkaWE6IGZ1bmN0aW9uKCkge30KKyAgICAgICAgICAgIH07CisgICAgICAgIH0KKworICAgICAgICB2YXIgaXNNb2JpbGVEZXZpY2UgPSAhIW5hdmlnYXRvci51c2VyQWdlbnQubWF0Y2goL0FuZHJvaWR8aVBob25lfGlQYWR8aVBvZHxCbGFja0JlcnJ5fElFTW9iaWxlL2kpOworICAgICAgICB2YXIgaXNFZGdlID0gbmF2aWdhdG9yLnVzZXJBZ2VudC5pbmRleE9mKCdFZGdlJykgIT09IC0xICYmICghIW5hdmlnYXRvci5tc1NhdmVPck9wZW5CbG9iIHx8ICEhbmF2aWdhdG9yLm1zU2F2ZUJsb2IpOworCisgICAgICAgIC8vIHRoaXMgb25lIGNhbiBhbHNvIGJlIHVzZWQ6CisgICAgICAgIC8vIGh0dHBzOi8vd3d3LndlYnNvY2tldC5vcmcvanMvc3R1ZmYuanMgKERldGVjdEJyb3dzZXIuanMpCisKKyAgICAgICAgZnVuY3Rpb24gZ2V0QnJvd3NlckluZm8oKSB7CisgICAgICAgICAgICB2YXIgblZlciA9IG5hdmlnYXRvci5hcHBWZXJzaW9uOworICAgICAgICAgICAgdmFyIG5BZ3QgPSBuYXZpZ2F0b3IudXNlckFnZW50OworICAgICAgICAgICAgdmFyIGJyb3dzZXJOYW1lID0gbmF2aWdhdG9yLmFwcE5hbWU7CisgICAgICAgICAgICB2YXIgZnVsbFZlcnNpb24gPSAnJyArIHBhcnNlRmxvYXQobmF2aWdhdG9yLmFwcFZlcnNpb24pOworICAgICAgICAgICAgdmFyIG1ham9yVmVyc2lvbiA9IHBhcnNlSW50KG5hdmlnYXRvci5hcHBWZXJzaW9uLCAxMCk7CisgICAgICAgICAgICB2YXIgbmFtZU9mZnNldCwgdmVyT2Zmc2V0LCBpeDsKKworICAgICAgICAgICAgLy8gSW4gT3BlcmEsIHRoZSB0cnVlIHZlcnNpb24gaXMgYWZ0ZXIgJ09wZXJhJyBvciBhZnRlciAnVmVyc2lvbicKKyAgICAgICAgICAgIGlmICgodmVyT2Zmc2V0ID0gbkFndC5pbmRleE9mKCdPcGVyYScpKSAhPT0gLTEpIHsKKyAgICAgICAgICAgICAgICBicm93c2VyTmFtZSA9ICdPcGVyYSc7CisgICAgICAgICAgICAgICAgZnVsbFZlcnNpb24gPSBuQWd0LnN1YnN0cmluZyh2ZXJPZmZzZXQgKyA2KTsKKworICAgICAgICAgICAgICAgIGlmICgodmVyT2Zmc2V0ID0gbkFndC5pbmRleE9mKCdWZXJzaW9uJykpICE9PSAtMSkgeworICAgICAgICAgICAgICAgICAgICBmdWxsVmVyc2lvbiA9IG5BZ3Quc3Vic3RyaW5nKHZlck9mZnNldCArIDgpOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIC8vIEluIE1TSUUsIHRoZSB0cnVlIHZlcnNpb24gaXMgYWZ0ZXIgJ01TSUUnIGluIHVzZXJBZ2VudAorICAgICAgICAgICAgZWxzZSBpZiAoKHZlck9mZnNldCA9IG5BZ3QuaW5kZXhPZignTVNJRScpKSAhPT0gLTEpIHsKKyAgICAgICAgICAgICAgICBicm93c2VyTmFtZSA9ICdJRSc7CisgICAgICAgICAgICAgICAgZnVsbFZlcnNpb24gPSBuQWd0LnN1YnN0cmluZyh2ZXJPZmZzZXQgKyA1KTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIC8vIEluIENocm9tZSwgdGhlIHRydWUgdmVyc2lvbiBpcyBhZnRlciAnQ2hyb21lJyAKKyAgICAgICAgICAgIGVsc2UgaWYgKCh2ZXJPZmZzZXQgPSBuQWd0LmluZGV4T2YoJ0Nocm9tZScpKSAhPT0gLTEpIHsKKyAgICAgICAgICAgICAgICBicm93c2VyTmFtZSA9ICdDaHJvbWUnOworICAgICAgICAgICAgICAgIGZ1bGxWZXJzaW9uID0gbkFndC5zdWJzdHJpbmcodmVyT2Zmc2V0ICsgNyk7CisgICAgICAgICAgICB9CisgICAgICAgICAgICAvLyBJbiBTYWZhcmksIHRoZSB0cnVlIHZlcnNpb24gaXMgYWZ0ZXIgJ1NhZmFyaScgb3IgYWZ0ZXIgJ1ZlcnNpb24nIAorICAgICAgICAgICAgZWxzZSBpZiAoKHZlck9mZnNldCA9IG5BZ3QuaW5kZXhPZignU2FmYXJpJykpICE9PSAtMSkgeworICAgICAgICAgICAgICAgIGJyb3dzZXJOYW1lID0gJ1NhZmFyaSc7CisgICAgICAgICAgICAgICAgZnVsbFZlcnNpb24gPSBuQWd0LnN1YnN0cmluZyh2ZXJPZmZzZXQgKyA3KTsKKworICAgICAgICAgICAgICAgIGlmICgodmVyT2Zmc2V0ID0gbkFndC5pbmRleE9mKCdWZXJzaW9uJykpICE9PSAtMSkgeworICAgICAgICAgICAgICAgICAgICBmdWxsVmVyc2lvbiA9IG5BZ3Quc3Vic3RyaW5nKHZlck9mZnNldCArIDgpOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIC8vIEluIEZpcmVmb3gsIHRoZSB0cnVlIHZlcnNpb24gaXMgYWZ0ZXIgJ0ZpcmVmb3gnIAorICAgICAgICAgICAgZWxzZSBpZiAoKHZlck9mZnNldCA9IG5BZ3QuaW5kZXhPZignRmlyZWZveCcpKSAhPT0gLTEpIHsKKyAgICAgICAgICAgICAgICBicm93c2VyTmFtZSA9ICdGaXJlZm94JzsKKyAgICAgICAgICAgICAgICBmdWxsVmVyc2lvbiA9IG5BZ3Quc3Vic3RyaW5nKHZlck9mZnNldCArIDgpOworICAgICAgICAgICAgfQorCisgICAgICAgICAgICAvLyBJbiBtb3N0IG90aGVyIGJyb3dzZXJzLCAnbmFtZS92ZXJzaW9uJyBpcyBhdCB0aGUgZW5kIG9mIHVzZXJBZ2VudCAKKyAgICAgICAgICAgIGVsc2UgaWYgKChuYW1lT2Zmc2V0ID0gbkFndC5sYXN0SW5kZXhPZignICcpICsgMSkgPCAodmVyT2Zmc2V0ID0gbkFndC5sYXN0SW5kZXhPZignLycpKSkgeworICAgICAgICAgICAgICAgIGJyb3dzZXJOYW1lID0gbkFndC5zdWJzdHJpbmcobmFtZU9mZnNldCwgdmVyT2Zmc2V0KTsKKyAgICAgICAgICAgICAgICBmdWxsVmVyc2lvbiA9IG5BZ3Quc3Vic3RyaW5nKHZlck9mZnNldCArIDEpOworCisgICAgICAgICAgICAgICAgaWYgKGJyb3dzZXJOYW1lLnRvTG93ZXJDYXNlKCkgPT09IGJyb3dzZXJOYW1lLnRvVXBwZXJDYXNlKCkpIHsKKyAgICAgICAgICAgICAgICAgICAgYnJvd3Nlck5hbWUgPSBuYXZpZ2F0b3IuYXBwTmFtZTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9CisKKyAgICAgICAgICAgIGlmIChpc0VkZ2UpIHsKKyAgICAgICAgICAgICAgICBicm93c2VyTmFtZSA9ICdFZGdlJzsKKyAgICAgICAgICAgICAgICAvLyBmdWxsVmVyc2lvbiA9IG5hdmlnYXRvci51c2VyQWdlbnQuc3BsaXQoJ0VkZ2UvJylbMV07CisgICAgICAgICAgICAgICAgZnVsbFZlcnNpb24gPSBwYXJzZUludChuYXZpZ2F0b3IudXNlckFnZW50Lm1hdGNoKC9FZGdlXC8oXGQrKS4oXGQrKSQvKVsyXSwgMTApOworICAgICAgICAgICAgfQorCisgICAgICAgICAgICAvLyB0cmltIHRoZSBmdWxsVmVyc2lvbiBzdHJpbmcgYXQgc2VtaWNvbG9uL3NwYWNlIGlmIHByZXNlbnQKKyAgICAgICAgICAgIGlmICgoaXggPSBmdWxsVmVyc2lvbi5pbmRleE9mKCc7JykpICE9PSAtMSkgeworICAgICAgICAgICAgICAgIGZ1bGxWZXJzaW9uID0gZnVsbFZlcnNpb24uc3Vic3RyaW5nKDAsIGl4KTsKKyAgICAgICAgICAgIH0KKworICAgICAgICAgICAgaWYgKChpeCA9IGZ1bGxWZXJzaW9uLmluZGV4T2YoJyAnKSkgIT09IC0xKSB7CisgICAgICAgICAgICAgICAgZnVsbFZlcnNpb24gPSBmdWxsVmVyc2lvbi5zdWJzdHJpbmcoMCwgaXgpOworICAgICAgICAgICAgfQorCisgICAgICAgICAgICBtYWpvclZlcnNpb24gPSBwYXJzZUludCgnJyArIGZ1bGxWZXJzaW9uLCAxMCk7CisKKyAgICAgICAgICAgIGlmIChpc05hTihtYWpvclZlcnNpb24pKSB7CisgICAgICAgICAgICAgICAgZnVsbFZlcnNpb24gPSAnJyArIHBhcnNlRmxvYXQobmF2aWdhdG9yLmFwcFZlcnNpb24pOworICAgICAgICAgICAgICAgIG1ham9yVmVyc2lvbiA9IHBhcnNlSW50KG5hdmlnYXRvci5hcHBWZXJzaW9uLCAxMCk7CisgICAgICAgICAgICB9CisKKyAgICAgICAgICAgIHJldHVybiB7CisgICAgICAgICAgICAgICAgZnVsbFZlcnNpb246IGZ1bGxWZXJzaW9uLAorICAgICAgICAgICAgICAgIHZlcnNpb246IG1ham9yVmVyc2lvbiwKKyAgICAgICAgICAgICAgICBuYW1lOiBicm93c2VyTmFtZQorICAgICAgICAgICAgfTsKKyAgICAgICAgfQorCisgICAgICAgIHZhciBpc01vYmlsZSA9IHsKKyAgICAgICAgICAgIEFuZHJvaWQ6IGZ1bmN0aW9uKCkgeworICAgICAgICAgICAgICAgIHJldHVybiBuYXZpZ2F0b3IudXNlckFnZW50Lm1hdGNoKC9BbmRyb2lkL2kpOworICAgICAgICAgICAgfSwKKyAgICAgICAgICAgIEJsYWNrQmVycnk6IGZ1bmN0aW9uKCkgeworICAgICAgICAgICAgICAgIHJldHVybiBuYXZpZ2F0b3IudXNlckFnZW50Lm1hdGNoKC9CbGFja0JlcnJ5L2kpOworICAgICAgICAgICAgfSwKKyAgICAgICAgICAgIGlPUzogZnVuY3Rpb24oKSB7CisgICAgICAgICAgICAgICAgcmV0dXJuIG5hdmlnYXRvci51c2VyQWdlbnQubWF0Y2goL2lQaG9uZXxpUGFkfGlQb2QvaSk7CisgICAgICAgICAgICB9LAorICAgICAgICAgICAgT3BlcmE6IGZ1bmN0aW9uKCkgeworICAgICAgICAgICAgICAgIHJldHVybiBuYXZpZ2F0b3IudXNlckFnZW50Lm1hdGNoKC9PcGVyYSBNaW5pL2kpOworICAgICAgICAgICAgfSwKKyAgICAgICAgICAgIFdpbmRvd3M6IGZ1bmN0aW9uKCkgeworICAgICAgICAgICAgICAgIHJldHVybiBuYXZpZ2F0b3IudXNlckFnZW50Lm1hdGNoKC9JRU1vYmlsZS9pKTsKKyAgICAgICAgICAgIH0sCisgICAgICAgICAgICBhbnk6IGZ1bmN0aW9uKCkgeworICAgICAgICAgICAgICAgIHJldHVybiAoaXNNb2JpbGUuQW5kcm9pZCgpIHx8IGlzTW9iaWxlLkJsYWNrQmVycnkoKSB8fCBpc01vYmlsZS5pT1MoKSB8fCBpc01vYmlsZS5PcGVyYSgpIHx8IGlzTW9iaWxlLldpbmRvd3MoKSk7CisgICAgICAgICAgICB9LAorICAgICAgICAgICAgZ2V0T3NOYW1lOiBmdW5jdGlvbigpIHsKKyAgICAgICAgICAgICAgICB2YXIgb3NOYW1lID0gJ1Vua25vd24gT1MnOworICAgICAgICAgICAgICAgIGlmIChpc01vYmlsZS5BbmRyb2lkKCkpIHsKKyAgICAgICAgICAgICAgICAgICAgb3NOYW1lID0gJ0FuZHJvaWQnOworICAgICAgICAgICAgICAgIH0KKworICAgICAgICAgICAgICAgIGlmIChpc01vYmlsZS5CbGFja0JlcnJ5KCkpIHsKKyAgICAgICAgICAgICAgICAgICAgb3NOYW1lID0gJ0JsYWNrQmVycnknOworICAgICAgICAgICAgICAgIH0KKworICAgICAgICAgICAgICAgIGlmIChpc01vYmlsZS5pT1MoKSkgeworICAgICAgICAgICAgICAgICAgICBvc05hbWUgPSAnaU9TJzsKKyAgICAgICAgICAgICAgICB9CisKKyAgICAgICAgICAgICAgICBpZiAoaXNNb2JpbGUuT3BlcmEoKSkgeworICAgICAgICAgICAgICAgICAgICBvc05hbWUgPSAnT3BlcmEgTWluaSc7CisgICAgICAgICAgICAgICAgfQorCisgICAgICAgICAgICAgICAgaWYgKGlzTW9iaWxlLldpbmRvd3MoKSkgeworICAgICAgICAgICAgICAgICAgICBvc05hbWUgPSAnV2luZG93cyc7CisgICAgICAgICAgICAgICAgfQorCisgICAgICAgICAgICAgICAgcmV0dXJuIG9zTmFtZTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfTsKKworICAgICAgICB2YXIgb3NOYW1lID0gJ1Vua25vd24gT1MnOworCisgICAgICAgIGlmIChpc01vYmlsZS5hbnkoKSkgeworICAgICAgICAgICAgb3NOYW1lID0gaXNNb2JpbGUuZ2V0T3NOYW1lKCk7CisgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICBpZiAobmF2aWdhdG9yLmFwcFZlcnNpb24uaW5kZXhPZignV2luJykgIT09IC0xKSB7CisgICAgICAgICAgICAgICAgb3NOYW1lID0gJ1dpbmRvd3MnOworICAgICAgICAgICAgfQorCisgICAgICAgICAgICBpZiAobmF2aWdhdG9yLmFwcFZlcnNpb24uaW5kZXhPZignTWFjJykgIT09IC0xKSB7CisgICAgICAgICAgICAgICAgb3NOYW1lID0gJ01hY09TJzsKKyAgICAgICAgICAgIH0KKworICAgICAgICAgICAgaWYgKG5hdmlnYXRvci5hcHBWZXJzaW9uLmluZGV4T2YoJ1gxMScpICE9PSAtMSkgeworICAgICAgICAgICAgICAgIG9zTmFtZSA9ICdVTklYJzsKKyAgICAgICAgICAgIH0KKworICAgICAgICAgICAgaWYgKG5hdmlnYXRvci5hcHBWZXJzaW9uLmluZGV4T2YoJ0xpbnV4JykgIT09IC0xKSB7CisgICAgICAgICAgICAgICAgb3NOYW1lID0gJ0xpbnV4JzsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorCisKKyAgICAgICAgdmFyIGlzQ2FudmFzU3VwcG9ydHNTdHJlYW1DYXB0dXJpbmcgPSBmYWxzZTsKKyAgICAgICAgdmFyIGlzVmlkZW9TdXBwb3J0c1N0cmVhbUNhcHR1cmluZyA9IGZhbHNlOworICAgICAgICBbJ2NhcHR1cmVTdHJlYW0nLCAnbW96Q2FwdHVyZVN0cmVhbScsICd3ZWJraXRDYXB0dXJlU3RyZWFtJ10uZm9yRWFjaChmdW5jdGlvbihpdGVtKSB7CisgICAgICAgICAgICAvLyBhc2RmCisgICAgICAgICAgICBpZiAoaXRlbSBpbiBkb2N1bWVudC5jcmVhdGVFbGVtZW50KCdjYW52YXMnKSkgeworICAgICAgICAgICAgICAgIGlzQ2FudmFzU3VwcG9ydHNTdHJlYW1DYXB0dXJpbmcgPSB0cnVlOworICAgICAgICAgICAgfQorCisgICAgICAgICAgICBpZiAoaXRlbSBpbiBkb2N1bWVudC5jcmVhdGVFbGVtZW50KCd2aWRlbycpKSB7CisgICAgICAgICAgICAgICAgaXNWaWRlb1N1cHBvcnRzU3RyZWFtQ2FwdHVyaW5nID0gdHJ1ZTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfSk7CisKKyAgICAgICAgLy8gdmlhOiBodHRwczovL2dpdGh1Yi5jb20vZGlhZnlnaS93ZWJydGMtaXBzCisgICAgICAgIGZ1bmN0aW9uIERldGVjdExvY2FsSVBBZGRyZXNzKGNhbGxiYWNrKSB7CisgICAgICAgICAgICBnZXRJUHMoZnVuY3Rpb24oaXApIHsKKyAgICAgICAgICAgICAgICAvL2xvY2FsIElQcworICAgICAgICAgICAgICAgIGlmIChpcC5tYXRjaCgvXigxOTJcLjE2OFwufDE2OVwuMjU0XC58MTBcLnwxNzJcLigxWzYtOV18MlxkfDNbMDFdKSkvKSkgeworICAgICAgICAgICAgICAgICAgICBjYWxsYmFjaygnTG9jYWw6ICcgKyBpcCk7CisgICAgICAgICAgICAgICAgfQorCisgICAgICAgICAgICAgICAgLy9hc3N1bWUgdGhlIHJlc3QgYXJlIHB1YmxpYyBJUHMKKyAgICAgICAgICAgICAgICBlbHNlIHsKKyAgICAgICAgICAgICAgICAgICAgY2FsbGJhY2soJ1B1YmxpYzogJyArIGlwKTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9KTsKKyAgICAgICAgfQorCisgICAgICAgIC8vZ2V0IHRoZSBJUCBhZGRyZXNzZXMgYXNzb2NpYXRlZCB3aXRoIGFuIGFjY291bnQKKyAgICAgICAgZnVuY3Rpb24gZ2V0SVBzKGNhbGxiYWNrKSB7CisgICAgICAgICAgICB2YXIgaXBEdXBsaWNhdGVzID0ge307CisKKyAgICAgICAgICAgIC8vY29tcGF0aWJpbGl0eSBmb3IgZmlyZWZveCBhbmQgY2hyb21lCisgICAgICAgICAgICB2YXIgUlRDUGVlckNvbm5lY3Rpb24gPSB3aW5kb3cuUlRDUGVlckNvbm5lY3Rpb24gfHwgd2luZG93Lm1velJUQ1BlZXJDb25uZWN0aW9uIHx8IHdpbmRvdy53ZWJraXRSVENQZWVyQ29ubmVjdGlvbjsKKyAgICAgICAgICAgIHZhciB1c2VXZWJLaXQgPSAhIXdpbmRvdy53ZWJraXRSVENQZWVyQ29ubmVjdGlvbjsKKworICAgICAgICAgICAgLy8gYnlwYXNzIG5haXZlIHdlYnJ0YyBibG9ja2luZyB1c2luZyBhbiBpZnJhbWUKKyAgICAgICAgICAgIGlmICghUlRDUGVlckNvbm5lY3Rpb24pIHsKKyAgICAgICAgICAgICAgICB2YXIgaWZyYW1lID0gZG9jdW1lbnQuZ2V0RWxlbWVudEJ5SWQoJ2lmcmFtZScpOworICAgICAgICAgICAgICAgIGlmICghaWZyYW1lKSB7CisgICAgICAgICAgICAgICAgICAgIC8vPGlmcmFtZSBpZD0iaWZyYW1lIiBzYW5kYm94PSJhbGxvdy1zYW1lLW9yaWdpbiIgc3R5bGU9ImRpc3BsYXk6IG5vbmUiPjwvaWZyYW1lPgorICAgICAgICAgICAgICAgICAgICB0aHJvdyAnTk9URTogeW91IG5lZWQgdG8gaGF2ZSBhbiBpZnJhbWUgaW4gdGhlIHBhZ2UgcmlnaHQgYWJvdmUgdGhlIHNjcmlwdCB0YWcuJzsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgdmFyIHdpbiA9IGlmcmFtZS5jb250ZW50V2luZG93OworICAgICAgICAgICAgICAgIFJUQ1BlZXJDb25uZWN0aW9uID0gd2luLlJUQ1BlZXJDb25uZWN0aW9uIHx8IHdpbi5tb3pSVENQZWVyQ29ubmVjdGlvbiB8fCB3aW4ud2Via2l0UlRDUGVlckNvbm5lY3Rpb247CisgICAgICAgICAgICAgICAgdXNlV2ViS2l0ID0gISF3aW4ud2Via2l0UlRDUGVlckNvbm5lY3Rpb247CisgICAgICAgICAgICB9CisKKyAgICAgICAgICAgIC8vbWluaW1hbCByZXF1aXJlbWVudHMgZm9yIGRhdGEgY29ubmVjdGlvbgorICAgICAgICAgICAgdmFyIG1lZGlhQ29uc3RyYWludHMgPSB7CisgICAgICAgICAgICAgICAgb3B0aW9uYWw6IFt7CisgICAgICAgICAgICAgICAgICAgIFJ0cERhdGFDaGFubmVsczogdHJ1ZQorICAgICAgICAgICAgICAgIH1dCisgICAgICAgICAgICB9OworCisgICAgICAgICAgICAvL2ZpcmVmb3ggYWxyZWFkeSBoYXMgYSBkZWZhdWx0IHN0dW4gc2VydmVyIGluIGFib3V0OmNvbmZpZworICAgICAgICAgICAgLy8gICAgbWVkaWEucGVlcmNvbm5lY3Rpb24uZGVmYXVsdF9pY2VzZXJ2ZXJzID0KKyAgICAgICAgICAgIC8vICAgIFt7InVybCI6ICJzdHVuOnN0dW4uc2VydmljZXMubW96aWxsYS5jb20ifV0KKyAgICAgICAgICAgIHZhciBzZXJ2ZXJzOworCisgICAgICAgICAgICAvL2FkZCBzYW1lIHN0dW4gc2VydmVyIGZvciBjaHJvbWUKKyAgICAgICAgICAgIGlmICh1c2VXZWJLaXQpIHsKKyAgICAgICAgICAgICAgICBzZXJ2ZXJzID0geworICAgICAgICAgICAgICAgICAgICBpY2VTZXJ2ZXJzOiBbeworICAgICAgICAgICAgICAgICAgICAgICAgdXJsczogJ3N0dW46c3R1bi5zZXJ2aWNlcy5tb3ppbGxhLmNvbScKKyAgICAgICAgICAgICAgICAgICAgfV0KKyAgICAgICAgICAgICAgICB9OworCisgICAgICAgICAgICAgICAgaWYgKHR5cGVvZiBEZXRlY3RSVEMgIT09ICd1bmRlZmluZWQnICYmIERldGVjdFJUQy5icm93c2VyLmlzRmlyZWZveCAmJiBEZXRlY3RSVEMuYnJvd3Nlci52ZXJzaW9uIDw9IDM4KSB7CisgICAgICAgICAgICAgICAgICAgIHNlcnZlcnNbMF0gPSB7CisgICAgICAgICAgICAgICAgICAgICAgICB1cmw6IHNlcnZlcnNbMF0udXJscworICAgICAgICAgICAgICAgICAgICB9OworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0KKworICAgICAgICAgICAgLy9jb25zdHJ1Y3QgYSBuZXcgUlRDUGVlckNvbm5lY3Rpb24KKyAgICAgICAgICAgIHZhciBwYyA9IG5ldyBSVENQZWVyQ29ubmVjdGlvbihzZXJ2ZXJzLCBtZWRpYUNvbnN0cmFpbnRzKTsKKworICAgICAgICAgICAgZnVuY3Rpb24gaGFuZGxlQ2FuZGlkYXRlKGNhbmRpZGF0ZSkgeworICAgICAgICAgICAgICAgIC8vbWF0Y2gganVzdCB0aGUgSVAgYWRkcmVzcworICAgICAgICAgICAgICAgIHZhciBpcFJlZ2V4ID0gLyhbMC05XXsxLDN9KFwuWzAtOV17MSwzfSl7M30pLzsKKyAgICAgICAgICAgICAgICB2YXIgaXBBZGRyZXNzID0gaXBSZWdleC5leGVjKGNhbmRpZGF0ZSlbMV07CisKKyAgICAgICAgICAgICAgICAvL3JlbW92ZSBkdXBsaWNhdGVzCisgICAgICAgICAgICAgICAgaWYgKGlwRHVwbGljYXRlc1tpcEFkZHJlc3NdID09PSB1bmRlZmluZWQpIHsKKyAgICAgICAgICAgICAgICAgICAgY2FsbGJhY2soaXBBZGRyZXNzKTsKKyAgICAgICAgICAgICAgICB9CisKKyAgICAgICAgICAgICAgICBpcER1cGxpY2F0ZXNbaXBBZGRyZXNzXSA9IHRydWU7CisgICAgICAgICAgICB9CisKKyAgICAgICAgICAgIC8vbGlzdGVuIGZvciBjYW5kaWRhdGUgZXZlbnRzCisgICAgICAgICAgICBwYy5vbmljZWNhbmRpZGF0ZSA9IGZ1bmN0aW9uKGljZSkgeworICAgICAgICAgICAgICAgIC8vc2tpcCBub24tY2FuZGlkYXRlIGV2ZW50cworICAgICAgICAgICAgICAgIGlmIChpY2UuY2FuZGlkYXRlKSB7CisgICAgICAgICAgICAgICAgICAgIGhhbmRsZUNhbmRpZGF0ZShpY2UuY2FuZGlkYXRlLmNhbmRpZGF0ZSk7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfTsKKworICAgICAgICAgICAgLy9jcmVhdGUgYSBib2d1cyBkYXRhIGNoYW5uZWwKKyAgICAgICAgICAgIHBjLmNyZWF0ZURhdGFDaGFubmVsKCcnKTsKKworICAgICAgICAgICAgLy9jcmVhdGUgYW4gb2ZmZXIgc2RwCisgICAgICAgICAgICBwYy5jcmVhdGVPZmZlcihmdW5jdGlvbihyZXN1bHQpIHsKKworICAgICAgICAgICAgICAgIC8vdHJpZ2dlciB0aGUgc3R1biBzZXJ2ZXIgcmVxdWVzdAorICAgICAgICAgICAgICAgIHBjLnNldExvY2FsRGVzY3JpcHRpb24ocmVzdWx0LCBmdW5jdGlvbigpIHt9LCBmdW5jdGlvbigpIHt9KTsKKworICAgICAgICAgICAgfSwgZnVuY3Rpb24oKSB7fSk7CisKKyAgICAgICAgICAgIC8vd2FpdCBmb3IgYSB3aGlsZSB0byBsZXQgZXZlcnl0aGluZyBkb25lCisgICAgICAgICAgICBzZXRUaW1lb3V0KGZ1bmN0aW9uKCkgeworICAgICAgICAgICAgICAgIC8vcmVhZCBjYW5kaWRhdGUgaW5mbyBmcm9tIGxvY2FsIGRlc2NyaXB0aW9uCisgICAgICAgICAgICAgICAgdmFyIGxpbmVzID0gcGMubG9jYWxEZXNjcmlwdGlvbi5zZHAuc3BsaXQoJ1xuJyk7CisKKyAgICAgICAgICAgICAgICBsaW5lcy5mb3JFYWNoKGZ1bmN0aW9uKGxpbmUpIHsKKyAgICAgICAgICAgICAgICAgICAgaWYgKGxpbmUuaW5kZXhPZignYT1jYW5kaWRhdGU6JykgPT09IDApIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIGhhbmRsZUNhbmRpZGF0ZShsaW5lKTsKKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIH0pOworICAgICAgICAgICAgfSwgMTAwMCk7CisgICAgICAgIH0KKworICAgICAgICB2YXIgTWVkaWFEZXZpY2VzID0gW107CisKKyAgICAgICAgLy8gLS0tLS0tLS0tLSBNZWRpYSBEZXZpY2VzIGRldGVjdGlvbgorICAgICAgICB2YXIgY2FuRW51bWVyYXRlID0gZmFsc2U7CisKKyAgICAgICAgLypnbG9iYWwgTWVkaWFTdHJlYW1UcmFjazp0cnVlICovCisgICAgICAgIGlmICh0eXBlb2YgTWVkaWFTdHJlYW1UcmFjayAhPT0gJ3VuZGVmaW5lZCcgJiYgJ2dldFNvdXJjZXMnIGluIE1lZGlhU3RyZWFtVHJhY2spIHsKKyAgICAgICAgICAgIGNhbkVudW1lcmF0ZSA9IHRydWU7CisgICAgICAgIH0gZWxzZSBpZiAobmF2aWdhdG9yLm1lZGlhRGV2aWNlcyAmJiAhIW5hdmlnYXRvci5tZWRpYURldmljZXMuZW51bWVyYXRlRGV2aWNlcykgeworICAgICA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9CisKKyAgICAgICAgICAgIGlmICghbmF2aWdhdG9yLmVudW1lcmF0ZURldmljZXMpIHsKKyAgICAgICAgICAgICAgICBpZiAoY2FsbGJhY2spIHsKKyAgICAgICAgICAgICAgICAgICAgY2FsbGJhY2soKTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgcmV0dXJuOworICAgICAgICAgICAgfQorCisgICAgICAgICAgICBNZWRpYURldmljZXMgPSBbXTsKKyAgICAgICAgICAgIG5hdmlnYXRvci5lbnVtZXJhdGVEZXZpY2VzKGZ1bmN0aW9uKGRldmljZXMpIHsKKyAgICAgICAgICAgICAgICBkZXZpY2VzLmZvckVhY2goZnVuY3Rpb24oX2RldmljZSkgeworICAgICAgICAgICAgICAgICAgICB2YXIgZGV2aWNlID0ge307CisgICAgICAgICAgICAgICAgICAgIGZvciAodmFyIGQgaW4gX2RldmljZSkgeworICAgICAgICAgICAgICAgICAgICAgICAgZGV2aWNlW2RdID0gX2RldmljZVtkXTsKKyAgICAgICAgICAgICAgICAgICAgfQorCisgICAgICAgICAgICAgICAgICAgIHZhciBza2lwOworICAgICAgICAgICAgICAgICAgICBNZWRpYURldmljZXMuZm9yRWFjaChmdW5jdGlvbihkKSB7CisgICAgICAgICAgICAgICAgICAgICAgICBpZiAoZC5pZCA9PT0gZGV2aWNlLmlkKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2tpcCA9IHRydWU7CisgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgIH0pOworCisgICAgICAgICAgICAgICAgICAgIGlmIChza2lwKSB7CisgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm47CisgICAgICAgICAgICAgICAgICAgIH0KKworICAgICAgICAgICAgICAgICAgICAvLyBpZiBpdCBpcyBNZWRpYVN0cmVhbVRyYWNrLmdldFNvdXJjZXMKKyAgICAgICAgICAgICAgICAgICAgaWYgKGRldmljZS5raW5kID09PSAnYXVkaW8nKSB7CisgICAgICAgICAgICAgICAgICAgICAgICBkZXZpY2Uua2luZCA9ICdhdWRpb2lucHV0JzsKKyAgICAgICAgICAgICAgICAgICAgfQorCisgICAgICAgICAgICAgICAgICAgIGlmIChkZXZpY2Uua2luZCA9PT0gJ3ZpZGVvJykgeworICAgICAgICAgICAgICAgICAgICAgICAgZGV2aWNlLmtpbmQgPSAndmlkZW9pbnB1dCc7CisgICAgICAgICAgICAgICAgICAgIH0KKworICAgICAgICAgICAgICAgICAgICBpZiAoIWRldmljZS5kZXZpY2VJZCkgeworICAgICAgICAgICAgICAgICAgICAgICAgZGV2aWNlLmRldmljZUlkID0gZGV2aWNlLmlkOworICAgICAgICAgICAgICAgICAgICB9CisKKyAgICAgICAgICAgICAgICAgICAgaWYgKCFkZXZpY2UuaWQpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIGRldmljZS5pZCA9IGRldmljZS5kZXZpY2VJZDsKKyAgICAgICAgICAgICAgICAgICAgfQorCisgICAgICAgICAgICAgICAgICAgIGlmICghZGV2aWNlLmxhYmVsKSB7CisgICAgICAgICAgICAgICAgICAgICAgICBkZXZpY2UubGFiZWwgPSAnUGxlYXNlIGludm9rZSBnZXRVc2VyTWVkaWEgb25jZS4nOworICAgICAgICAgICAgICAgICAgICAgICAgaWYgKCFpc0hUVFBzKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgZGV2aWNlLmxhYmVsID0gJ0hUVFBzIGlzIHJlcXVpcmVkIHRvIGdldCBsYWJlbCBvZiB0aGlzICcgKyBkZXZpY2Uua2luZCArICcgZGV2aWNlLic7CisgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgIH0KKworICAgICAgICAgICAgICAgICAgICBpZiAoZGV2aWNlLmtpbmQgPT09ICdhdWRpb2lucHV0JyB8fCBkZXZpY2Uua2luZCA9PT0gJ2F1ZGlvJykgeworICAgICAgICAgICAgICAgICAgICAgICAgaGFzTWljcm9waG9uZSA9IHRydWU7CisgICAgICAgICAgICAgICAgICAgIH0KKworICAgICAgICAgICAgICAgICAgICBpZiAoZGV2aWNlLmtpbmQgPT09ICdhdWRpb291dHB1dCcpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIGhhc1NwZWFrZXJzID0gdHJ1ZTsKKyAgICAgICAgICAgICAgICAgICAgfQorCisgICAgICAgICAgICAgICAgICAgIGlmIChkZXZpY2Uua2luZCA9PT0gJ3ZpZGVvaW5wdXQnIHx8IGRldmljZS5raW5kID09PSAndmlkZW8nKSB7CisgICAgICAgICAgICAgICAgICAgICAgICBoYXNXZWJjYW0gPSB0cnVlOworICAgICAgICAgICAgICAgICAgICB9CisKKyAgICAgICAgICAgICAgICAgICAgLy8gdGhlcmUgaXMgbm8gJ3ZpZGVvb3VwdXQnIGluIHRoZSBzcGVjLgorCisgICAgICAgICAgICAgICAgICAgIE1lZGlhRGV2aWNlcy5wdXNoKGRldmljZSk7CisgICAgICAgICAgICAgICAgfSk7CisKKyAgICAgICAgICAgICAgICBpZiAodHlwZW9mIERldGVjdFJUQyAhPT0gJ3VuZGVmaW5lZCcpIHsKKyAgICAgICAgICAgICAgICAgICAgRGV0ZWN0UlRDLk1lZGlhRGV2aWNlcyA9IE1lZGlhRGV2aWNlczsKKyAgICAgICAgICAgICAgICAgICAgRGV0ZWN0UlRDLmhhc01pY3JvcGhvbmUgPSBoYXNNaWNyb3Bob25lOworICAgICAgICAgICAgICAgICAgICBEZXRlY3RSVEMuaGFzU3BlYWtlcnMgPSBoYXNTcGVha2VyczsKKyAgICAgICAgICAgICAgICAgICAgRGV0ZWN0UlRDLmhhc1dlYmNhbSA9IGhhc1dlYmNhbTsKKyAgICAgICAgICAgICAgICB9CisKKyAgICAgICAgICAgICAgICBpZiAoY2FsbGJhY2spIHsKKyAgICAgICAgICAgICAgICAgICAgY2FsbGJhY2soKTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9KTsKKyAgICAgICAgfQorCisgICAgICAgIC8vIGNoZWNrIGZvciBtaWNyb3Bob25lL2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Jvb2xlYW4gaXMgZGVmaW5lZCBpbiAiZ2V0QnJvd3NlckluZm8uanMiCisKKyAgICAgICAgLy8gLS0tLS0tCisKKyAgICAgICAgRGV0ZWN0UlRDLmlzV2ViU29ja2V0c1N1cHBvcnRlZCA9ICdXZWJTb2NrZXQnIGluIHdpbmRvdyAmJiAyID09PSB3aW5kb3cuV2ViU29ja2V0LkNMT1NJTkc7CisgICAgICAgIERldGVjdFJUQy5pc1dlYlNvY2tldHNCbG9ja2VkID0gJ0NoZWNraW5nJzsKKworICAgICAgICBpZiAoRGV0ZWN0UlRDLmlzV2ViU29ja2V0c1N1cHBvcnRlZCkgeworICAgICAgICAJLyogQ1VTVE9NIENPREUgKi8KKyAgICAgICAgCXZhciBocmVmID0gd2luZG93LmxvY2F0aW9uLmhyZWY7CisgICAgICAgICAgICB2YXIgaG9zdFBhdHQgPSBuZXcgUmVnRXhwKHdpbmRvdy5sb2NhdGlvbi5ob3N0ICsiL1teL10qIik7CisgICAgICAgICAgICB2YXIgcmVzID0gaG9zdFBhdHQuZXhlYyhocmVmKTsKKyAgICAgICAgICAgIHZhciBwcm90b2NvbCA9IHdpbmRvdy5sb2NhdGlvbi5wcm90b2NvbC5yZXBsYWNlKCJodHRwIiwid3MiKTsKKyAgICAgICAgICAgIAorICAgICAgICAgICAgdmFyIHNpZ25hbGluZ1NlcnZlclBhdGggPSBwcm90b2NvbCArICIvLyIgKyByZXMgKyAiL2NvbnRhY3QiOyAKKyAgICAgICAgICAgIHZhciB3ZWJzb2NrZXQgPSBuZXcgV2ViU29ja2V0KHNpZ25hbGluZ1NlcnZlclBhdGgpCisgICAgICAgIAkvLyB2YXIgd2Vic29ja2V0ID0gbmV3IFdlYlNvY2tldCgnd3NzOi8vZWNoby53ZWJzb2NrZXQub3JnOjQ0My8nKTsKKyAgICAgICAgICAgIC8qIENVU1RPTSBDT0RFICovCisgICAgICAgICAgICB3ZWJzb2NrZXQub25vcGVuID0gZnVuY3Rpb24oKSB7CisgICAgICAgICAgICAgICAgRGV0ZWN0UlRDLmlzV2ViU29ja2V0c0Jsb2NrZWQgPSBmYWxzZTsKKworICAgICAgICAgICAgICAgIGlmIChEZXRlY3RSVEMubG9hZENhbGxiYWNrKSB7CisgICAgICAgICAgICAgICAgICAgIERldGVjdFJUQy5sb2FkQ2FsbGJhY2soKTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9OworICAgICAgICAgICAgd2Vic29ja2V0Lm9uZXJyb3IgPSBmdW5jdGlvbigpIHsKKyAgICAgICAgICAgICAgICBEZXRlY3RSVEMuaXNXZWJTb2NrZXRzQmxvY2tlZCA9IHRydWU7CisKKyAgICAgICAgICAgICAgICBpZiAoRGV0ZWN0UlRDLmxvYWRDYWxsYmFjaykgeworICAgICAgICAgICAgICAgICAgICBEZXRlY3RSVEMubG9hZENhbGxiYWNrKCk7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfTsKKyAgICAgICAgfQorCisgICAgICAgIC8vIC0tLS0tLQorICAgICAgICB2YXIgaXNHZXRVc2VyTWVkaWFTdXBwb3J0ZWQgPSBmYWxzZTsKKyAgICAgICAgaWYgKG5hdmlnYXRvci5nZXRVc2VyTWVkaWEpIHsKKyAgICAgICAgICAgIGlzR2V0VXNlck1lZGlhU3VwcG9ydGVkID0gdHJ1ZTsKKyAgICAgICAgfSBlbHNlIGlmIChuYXZpZ2F0b3IubWVkaWFEZXZpY2VzICYmIG5hdmlnYXRvci5tZWRpYURldmljZXMuZ2V0VXNlck1lZGlhKSB7CisgICAgICAgICAgICBpc0dldFVzZXJNZWRpYVN1cHBvcnRlZCA9IHRydWU7CisgICAgICAgIH0KKyAgICAgICAgaWYgKERldGVjdFJUQy5icm93c2VyLmlzQ2hyb21lICYmIERldGVjdFJUQy5icm93c2VyLnZlcnNpb24gPj0gNDcgJiYgIWlzSFRUUHMpIHsKKyAgICAgICAgICAgIERldGVjdFJUQy5pc0dldFVzZXJNZWRpYVN1cHBvcnRlZCA9ICdSZXF1aXJl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WFuZGF0b3J5Lic7CisKKyAgICAgICAgICAgIC8vIG1ha2Ugc3VyZSB0aGF0IGNocm9tZSBleHRlbnNpb24gaXMgaW5zdGFsbGVkLgorICAgICAgICAgICAgaWYgKCEhRGV0ZWN0UlRDLnNjcmVlbi5zdGF0dXMpIHsKKyAgICAgICAgICAgICAgICBvbnN0YXR1cyhEZXRlY3RSVEMuc2NyZWVuLnN0YXR1cyk7CisgICAgICAgICAgICB9IGVsc2UgRGV0ZWN0UlRDLnNjcmVlbi5nZXRDaHJvbWVFeHRlbnNpb25TdGF0dXMob25zdGF0dXMpOworCisgICAgICAgICAgICBmdW5jdGlvbiBvbnN0YXR1cyhzdGF0dXMpIHsKKyAgICAgICAgICAgICAgICBpZiAoc3RhdHVzID09ICdpbnN0YWxsZWQtZW5hYmxlZCcpIHsKKyAgICAgICAgICAgICAgICAgICAgc2NyZWVuQ2FsbGJhY2sgPSBjYWxsYmFjazsKKyAgICAgICAgICAgICAgICAgICAgd2luZG93LnBvc3RNZXNzYWdlKCdnZXQtc291cmNlSWQnLCAnKicpOworICAgICAgICAgICAgICAgICAgICByZXR1cm47CisgICAgICAgICAgICAgICAgfQorCisgICAgICAgICAgICAgICAgRGV0ZWN0UlRDLnNjcmVlbi5jaHJvbWVNZWRpYVNvdXJjZSA9ICdzY3JlZW4nOworICAgICAgICAgICAgICAgIGNhbGxiYWNrKCdOby1SZXNwb25zZScpOyAvLyBjaHJvbWUgZXh0ZW5zaW9uIGlzbid0IGF2YWlsYWJsZQorICAgICAgICAgICAgfQorICAgICAgICB9LAorICAgICAgICBvbk1lc3NhZ2VDYWxsYmFjazogZnVuY3Rpb24oZGF0YSkgeworICAgICAgICAgICAgaWYgKCEoaXNTdHJpbmcoZGF0YSkgfHwgISFkYXRhLnNvdXJjZUlkKSkgcmV0dXJuOworCisgICAgICAgICAgICBsb2coJ2Nocm9tZSBtZXNzYWdlJywgZGF0YSk7CisKKyAgICAgICAgICAgIC8vICJjYW5jZWwiIGJ1dHRvbiBpcyBjbGlja2VkCisgICAgICAgICAgICBpZiAoZGF0YSA9PSAnUGVybWlzc2lvbkRlbmllZEVycm9yJykgeworICAgICAgICAgICAgICAgIERldGVjdFJUQy5zY3JlZW4uY2hyb21lTWVkaWFTb3VyY2UgPSAnUGVybWlzc2lvbkRlbmllZEVycm9yJzsKKyAgICAgICAgICAgICAgICBpZiAoc2NyZWVuQ2FsbGJhY2spIHJldHVybiBzY3JlZW5DYWxsYmFjaygnUGVybWlzc2lvbkRlbmllZEVycm9yJyk7CisgICAgICAgICAgICAgICAgZWxzZSB0aHJvdyBuZXcgRXJyb3IoJ1Blcm1pc3Npb25EZW5pZWRFcnJvcicpOworICAgICAgICAgICAgfQorCisgICAgICAgICAgICAvLyBleHRlbnNpb24gbm90aWZpZWQgaGlzIHByZXNlbmNlCisgICAgICAgICAgICBpZiAoZGF0YSA9PSAncnRjbXVsdGljb25uZWN0aW9uLWV4dGVuc2lvbi1sb2FkZWQnKSB7CisgICAgICAgICAgICAgICAgRGV0ZWN0UlRDLnNjcmVlbi5jaHJvbWVNZWRpYVNvdXJjZSA9ICdkZXNrdG9wJzsKKyAgICAgICAgICAgICAgICBpZiAoRGV0ZWN0UlRDLnNjcmVlbi5vblNjcmVlbkNhcHR1cmluZ0V4dGVuc2lvbkF2YWlsYWJsZSkgeworICAgICAgICAgICAgICAgICAgICBEZXRlY3RSVEMuc2NyZWVuLm9uU2NyZWVuQ2FwdHVyaW5nRXh0ZW5zaW9uQXZhaWxhYmxlKCk7CisKKyAgICAgICAgICAgICAgICAgICAgLy8gbWFrZSBzdXJlIHRoYXQgdGhpcyBldmVudCBpc24ndCBmaXJlZCBtdWx0aXBsZSB0aW1lcworICAgICAgICAgICAgICAgICAgICBEZXRlY3RSVEMuc2NyZWVuLm9uU2NyZWVuQ2FwdHVyaW5nRXh0ZW5zaW9uQXZhaWxhYmxlID0gbnVsbDsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9CisKKyAgICAgICAgICAgIC8vIGV4dGVuc2lvbiBzaGFyZWQgdGVtcCBzb3VyY2VJZAorICAgICAgICAgICAgaWYgKGRhdGEuc291cmNlSWQpIHsKKyAgICAgICAgICAgICAgICBEZXRlY3RSVEMuc2NyZWVuLnNvdXJjZUlkID0gZGF0YS5zb3VyY2VJZDsKKyAgICAgICAgICAgICAgICBpZiAoc2NyZWVuQ2FsbGJhY2spIHNjcmVlbkNhbGxiYWNrKERldGVjdFJUQy5zY3JlZW4uc291cmNlSWQpOworICAgICAgICAgICAgfQorICAgICAgICB9LAorICAgICAgICBnZXRDaHJvbWVFeHRlbnNpb25TdGF0dXM6IGZ1bmN0aW9uKGV4dGVuc2lvbmlkLCBjYWxsYmFjaykgeworICAgICAgICAgICAgZnVuY3Rpb24gX2NhbGxiYWNrKHN0YXR1cykgeworICAgICAgICAgICAgICAgIERldGVjdFJUQy5zY3JlZW4uc3RhdHVzID0gc3RhdHVzOworICAgICAgICAgICAgICAgIGNhbGxiYWNrKHN0YXR1cyk7CisgICAgICAgICAgICB9CisKKyAgICAgICAgICAgIGlmIChpc0ZpcmVmb3gpIHJldHVybiBfY2FsbGJhY2soJ25vdC1jaHJvbWUnKTsKKworICAgICAgICAgICAgaWYgKGFyZ3VtZW50cy5sZW5ndGggIT0gMikgeworICAgICAgICAgICAgICAgIGNhbGxiYWNrID0gZXh0ZW5zaW9uaWQ7CisgICAgICAgICAgICAgICAgZXh0ZW5zaW9uaWQgPSB0aGlzLmV4dGVuc2lvbmlkOworICAgICAgICAgICAgfQorCisgICAgICAgICAgICB2YXIgaW1hZ2UgPSBkb2N1bWVudC5jcmVhdGVFbGVtZW50KCdpbWcnKTsKKyAgICAgICAgICAgIGltYWdlLnNyYyA9ICdjaHJvbWUtZXh0ZW5zaW9uOi8vJyArIGV4dGVuc2lvbmlkICsgJy9pY29uLnBuZyc7CisgICAgICAgICAgICBpbWFnZS5vbmxvYWQgPSBmdW5jdGlvbigpIHsKKyAgICAgICAgICAgICAgICBEZXRlY3RSVEMuc2NyZWVuLmNocm9tZU1lZGlhU291cmNlID0gJ3NjcmVlbic7CisgICAgICAgICAgICAgICAgd2luZG93LnBvc3RNZXNzYWdlKCdhcmUteW91LXRoZXJlJywgJyonKTsKKyAgICAgICAgICAgICAgICBzZXRUaW1lb3V0KGZ1bmN0aW9uKCkgeworICAgICAgICAgICAgICAgICAgICBpZiAoRGV0ZWN0UlRDLnNjcmVlbi5jaHJvbWVNZWRpYVNvdXJjZSA9PSAnc2NyZWVuJykgeworICAgICAgICAgICAgICAgICAgICAgICAgX2NhbGxiYWNrKAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIERldGVjdFJUQy5zY3JlZW4uY2hyb21lTWVkaWFTb3VyY2UgPT0gJ2Rlc2t0b3AnID8gJ2luc3RhbGxlZC1lbmFibGVkJyA6ICdpbnN0YWxsZWQtZGlzYWJsZWQnIC8qIGlmIGNocm9tZSBleHRlbnNpb24gaXNuJ3QgcGVybWl0dGVkIGZvciBjdXJyZW50IGRvbWFpbiwgdGhlbiBpdCB3aWxsIGJlIGluc3RhbGxlZC1kaXNhYmxlZCBhbGwgdGhlIHRpbWUgZXZlbiBpZiBleHRlbnNpb24gaXMgZW5hYmxlZC4gKi8KKyAgICAgICAgICAgICAgICAgICAgICAgICk7CisgICAgICAgICAgICAgICAgICAgIH0gZWxzZSBfY2FsbGJhY2soJ2luc3RhbGxlZC1lbmFibGVkJyk7CisgICAgICAgICAgICAgICAgfSwgMjAwMCk7CisgICAgICAgICAgICB9OworICAgICAgICAgICAgaW1hZ2Uub25lcnJvciA9IGZ1bmN0aW9uKCkgeworICAgICAgICAgICAgICAgIF9jYWxsYmFjaygnbm90LWluc3RhbGxlZCcpOworICAgICAgICAgICAgfTsKKyAgICAgICAgfQorICAgIH07CisKKyAgICAvLyBpZiBJRQorICAgIGlmICghd2luZG93LmFkZEV2ZW50TGlzdGVuZXIpIHsKKyAgICAgICAgd2luZG93LmFkZEV2ZW50TGlzdGVuZXIgPSBmdW5jdGlvbihlbCwg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gICAgICAgICAgICBhdWRpbzogdHJ1ZSwKKyAgICAgICAgICAgIHZpZGVvOiB0cnVlCisgICAgICAgIH07CisKKyAgICAgICAgLy8gd3d3LlJUQ011bHRpQ29ubmVjdGlvbi5vcmcvZG9jcy9tYXhQYXJ0aWNpcGFudHNBbGxvd2VkLworICAgICAgICBjb25uZWN0aW9uLm1heFBhcnRpY2lwYW50c0FsbG93ZWQgPSAyNTY7CisKKyAgICAgICAgLy8gd3d3LlJUQ011bHRpQ29ubmVjdGlvbi5vcmcvZG9jcy9kaXJlY3Rpb24vCisgICAgICAgIC8vICdtYW55LXRvLW1hbnknIC8gJ29uZS10by1tYW55JyAvICdvbmUtdG8tb25lJyAvICdvbmUtd2F5JworICAgICAgICBjb25uZWN0aW9uLmRpcmVjdGlvbiA9ICdtYW55LXRvLW1hbnknOworCisgICAgICAgIC8vIHd3dy5SVENNdWx0aUNvbm5lY3Rpb24ub3JnL2RvY3MvbWVkaWFDb25zdHJhaW50cy8KKyAgICAgICAgY29ubmVjdGlvbi5tZWRpYUNvbnN0cmFpbnRzID0geworICAgICAgICAgICAgbWFuZGF0b3J5OiB7fSwgLy8ga2VwdCBmb3IgYmFja3dhcmQgY29tcGF0aWJpbGl0eQorICAgICAgICAgICAgb3B0aW9uYWw6IFtdLCAvLyBrZXB0IGZvciBiYWNrd2FyZCBjb21wYXRpYmlsaXR5CisgICAgICAgICAgICBhdWRpbzogeworICAgICAgICAgICAgICAgIG1hbmRhdG9yeToge30sCisgICAgICAgICAgICAgICAgb3B0aW9uYWw6IFtdCisgICAgICAgICAgICB9LAorICAgICAgICAgICAgdmlkZW86IHsKKyAgICAgICAgICAgICAgICBtYW5kYXRvcnk6IHt9LAorICAgICAgICAgICAgICAgIG9wdGlvbmFsOiBbXQorICAgICAgICAgICAgfQorICAgICAgICB9OworCisgICAgICAgIC8vIHd3dy5SVENNdWx0aUNvbm5lY3Rpb24ub3JnL2RvY3MvY2FuZGlkYXRlcy8KKyAgICAgICAgY29ubmVjdGlvbi5jYW5kaWRhdGVzID0geworICAgICAgICAgICAgaG9zdDogdHJ1ZSwKKyAgICAgICAgICAgIHN0dW46IHRydWUsCisgICAgICAgICAgICB0dXJuOiB0cnVlCisgICAgICAgIH07CisKKyAgICAgICAgY29ubmVjdGlvbi5zZHBDb25zdHJhaW50cyA9IHt9OworCisgICAgICAgIC8vIGFzIEBzZXJoYW50ZXJzIHByb3Bvc2VkIGluICMyMjUKKyAgICAgICAgLy8gaXQgd2lsbCBhdXRvIGZpeCAiYWxsIiByZW5lZ290aWF0aW9uIHNjZW5hcmlvcworICAgICAgICBjb25uZWN0aW9uLnNkcENvbnN0cmFpbnRzLm1hbmRhdG9yeSA9IHsKKyAgICAgICAgICAgIE9mZmVyVG9SZWNlaXZlQXVkaW86IHRydWUsCisgICAgICAgICAgICBPZmZlclRvUmVjZWl2ZVZpZGVvOiB0cnVlCisgICAgICAgIH07CisKKyAgICAgICAgY29ubmVjdGlvbi5wcml2aWxlZ2VzID0geworICAgICAgICAgICAgY2FuU3RvcFJlbW90ZVN0cmVhbTogZmFsc2UsIC8vIHVzZXIgY2FuIHN0b3AgcmVtb3RlIHN0cmVhbXMKKyAgICAgICAgICAgIGNhbk11dGVSZW1vdGVTdHJlYW06IGZhbHNlIC8vIHVzZXIgY2FuIG11dGUgcmVtb3RlIHN0cmVhbXMKKyAgICAgICAgfTsKKworICAgICAgICBjb25uZWN0aW9uLmljZVByb3RvY29scyA9IHsKKyAgICAgICAgICAgIHRjcDogdHJ1ZSwKKyAgICAgICAgICAgIHVkcDogdHJ1ZQorICAgICAgICB9OworCisgICAgICAgIC8vIHd3dy5SVENNdWx0aUNvbm5lY3Rpb24ub3JnL2RvY3MvcHJlZmVyU0NUUC8KKyAgICAgICAgY29ubmVjdGlvbi5wcmVmZXJTQ1RQID0gaXNGaXJlZm94IHx8IGNocm9tZVZlcnNpb24gPj0gMzIgPyB0cnVlIDogZmFsc2U7CisgICAgICAgIGNvbm5lY3Rpb24uY2h1bmtJb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lY3Rpb24uYXR0YWNoU3RyZWFtcyA9IFtdOworCisgICAgICAgIC8vIHd3dy5SVENNdWx0aUNvbm5lY3Rpb24ub3JnL2RvY3MvZGV0YWNoU3RyZWFtcy8KKyAgICAgICAgY29ubmVjdGlvbi5kZXRhY2hTdHJlYW1zID0gW107CisKKyAgICAgICAgY29ubmVjdGlvbi5vcHRpb25hbEFyZ3VtZW50ID0geworICAgICAgICAgICAgb3B0aW9uYWw6IFt7CisgICAgICAgICAgICAgICAgRHRsc1NydHBLZXlBZ3JlZW1lbnQ6IHRydWUKKyAgICAgICAgICAgIH0sIHsKKyAgICAgICAgICAgICAgICBnb29nSW1wcm92ZWRXaWZpQndlOiB0cnVlCisgICAgICAgICAgICB9LCB7CisgICAgICAgICAgICAgICAgZ29vZ1NjcmVlbmNhc3RNaW5CaXRyYXRlOiAzMDAKKyAgICAgICAgICAgIH1dLAorICAgICAgICAgICAgbWFuZGF0b3J5OiB7fQorICAgICAgICB9OworCisgICAgICAgIGNvbm5lY3Rpb24uZGF0YUNoYW5uZWxEaWN0ID0ge307CisKKyAgICAgICAgLy8gd3d3LlJUQ011bHRpQ29ubmVjdGlvbi5vcmcvZG9jcy9kb250QXR0YWNoU3RyZWFtLworICAgICAgICBjb25uZWN0aW9uLmRvbnRBdHRhY2hTdHJlYW0gPSBmYWxzZTsKKworICAgICAgICAvLyB3d3cuUlRDTXVsdGlDb25uZWN0aW9uLm9yZy9kb2NzL2RvbnRDYXB0dXJlVXNlck1lZGlhLworICAgICAgICBjb25uZWN0aW9uLmRvbnRDYXB0dXJlVXNlck1lZGlhID0gZmFsc2U7CisKKyAgICAgICAgLy8gdGhpcyBmZWF0dXJlIGFkZGVkIHRvIGtlZXAgdXNlcnMgcHJpdmFjeSBhbmQgCisgICAgICAgIC8vIG1ha2Ugc3VyZSBIVFRQcyBwYWdlcyBORVZFUiBhdXRvIGNhcHR1cmUgdXNlcnMgbWVkaWEKKyAgICAgICAgLy8gaXNDaHJvbWUgJiYgbG9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WN0aW9uLnNlc3Npb25EZXNjcmlwdGlvbiA9IG51bGw7CisKKyAgICAgICAgLy8gcmVzb3VyY2VzIHVzZWQgaW4gUlRDTXVsdGlDb25uZWN0aW9uCisgICAgICAgIGNvbm5lY3Rpb24ucmVzb3VyY2VzID0geworICAgICAgICAgICAgLy8gQ1VTVE9NIENPREUgLy8JCisgICAgICAgIAkvKglDb21tZW50aW5nIHRoaXMgYmxvY2sgYXMgd2UgZG8gbm90IHdhc250IGV4dGVybmFsIGRlcGVuZGVuY2llcworICAgICAgICAJICogCisgICAgICAgICAgICBSZWNvcmRSVEM6ICdodHRwczovL2Nkbi53ZWJydGMtZXhwZXJpbWVudC5jb20vUmVjb3JkUlRDLmpzJywKKyAgICAgICAgICAgIFByZVJlY29yZGVkTWVkaWFTdHJlYW1lcjogJ2h0dHBzOi8vY2RuLndlYnJ0Yy1leHBlcmltZW50LmNvbS9QcmVSZWNvcmRlZE1lZGlhU3RyZWFtZXIuanMnLAorICAgICAgICAgICAgY3VzdG9tR2V0VXNlck1lZGlhQmFyOiAnaHR0cHM6Ly9jZG4ud2VicnRjLWV4cGVyaW1lbnQuY29tL25hdmlnYXRvci5jdXN0b21HZXRVc2VyTWVkaWFCYXIuanMnLAorICAgICAgICAgICAgaHRtbDJjYW52YXM6ICdodHRwczovL2Nkbi53ZWJydGMtZXhwZXJpbWVudC5jb20vc2NyZWVuc2hvdC5qcycsCisgICAgICAgICAgICBoYXJrOiAnaHR0cHM6Ly9jZG4ud2VicnRjLWV4cGVyaW1lbnQuY29tL2hhcmsuanMnLAorICAgICAgICAgICAgZmlyZWJhc2U6ICdodHRwczovL2Nkbi53ZWJydGMtZXhwZXJpbWVudC5jb20vZmlyZWJhc2UuanMnLAorICAgICAgICAgICAgZmlyZWJhc2VpbzogJ2h0dHBzOi8vd2VicnRjLXNpZ25hbGluZy5maXJlYmFzZWlvLmNvbS8nLAorICAgICAgICAgICAgCisgICAgICAgICAgICBtdXRlZDogJ3N0YXRpYy9mdXN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Db25uZWN0aW9uLm9yZy9kb2NzL29uZXJyb3IvCisgICAgICAgIGNvbm5lY3Rpb24ub25lcnJvciA9IGZ1bmN0aW9uKGUpIHsKKyAgICAgICAgICAgIGVycm9yKG9uZXJyb3IsIHRvU3RyKGUpKTsKKyAgICAgICAgfTsKKworICAgICAgICAvLyB3d3cuUlRDTXVsdGlDb25uZWN0aW9uLm9yZy9kb2NzL29uY2xvc2UvCisgICAgICAgIGNvbm5lY3Rpb24ub25jbG9zZSA9IGZ1bmN0aW9uKGUpIHsKKyAgICAgICAgICAgIHdhcm4oJ29uY2xvc2UnLCB0b1N0cihlKSk7CisKKyAgICAgICAgICAgIC8vIHRvZG86IHNob3VsZCB3ZSB1c2UgInN0b3AiIG9yICJyZW1vdmUiPworICAgICAgICAgICAgLy8gQlRXLCBpdCBpcyByZW1vdGUgdXNlciEKKyAgICAgICAgICAgIGNvbm5lY3Rpb24uc3RyZWFtcy5yZW1vdmUoeworICAgICAgICAgICAgICAgIHVzZXJpZDogZS51c2VyaWQKKyAgICAgICAgICAgIH0pOworICAgICAgICB9OworCisgICAgICAgIHZhciBwcm9ncmVzc0hlbHBlciA9IHt9OworCisgICAgICAgIC8vIHd3dy5SVENNdWx0aUNvbm5lY3Rpb24ub3JnL2RvY3Mvb25GaWxlU3RhcnQvCisgICAgICAgIGNvbm5lY3Rpb24ub25GaWxlU3RhcnQgPSBmdW5jdGlvbihmaWxlKSB7CisgICAgICAgICAgICB2YXIgZGl2ID0gZG9jdW1lbnQuY3JlYXRlRWxlbWVudCgnZGl2Jyk7CisgICAgICAgICAgICBkaXYudGl0bGUgPSBmaWxlLm5hbWU7CisgICAgICAgICAgICBkaXYuaW5uZXJIVE1MID0gJzxsYWJlbD4wJTwvbGFiZWw+IDxwcm9ncmVzcz48L3Byb2dyZXNzPic7CisgICAgICAgICAgICBjb25uZWN0aW9uLmJvZHkuaW5zZXJ0QmVmb3JlKGRpdiwgY29ubmVjdGlvbi5ib2R5LmZpcnN0Q2hpbGQpOworICAgICAgICAgICAgcHJvZ3Jlc3NIZWxwZXJbZmlsZS51dWlkXSA9IHsKKyAgICAgICAgICAgICAgICBkaXY6IGRpdiwKKyAgICAgICAgICAgICAgICBwcm9ncmVzczogZGl2LnF1ZXJ5U2VsZWN0b3IoJ3Byb2dyZXNzJyksCisgICAgICAgICAgICAgICAgbGFiZWw6IGRpdi5xdWVyeVNlbGVjdG9yKCdsYWJlbCcpCisgICAgICAgICAgICB9OworICAgICAgICAgICAgcHJvZ3Jlc3NIZWxwZXJbZmlsZS51dWlkXS5wcm9ncmVzcy5tYXggPSBmaWxlLm1heENodW5rczsKKyAgICAgICAgfTsKKworICAgICAgICAvLyB3d3cuUlRDTXVsdGlDb25uZWN0aW9uLm9yZy9kb2NzL29uRmlsZVByb2dyZXNzLworICAgICAgICBjb25uZWN0aW9uLm9uRmlsZVByb2dyZXNzID0gZnVuY3Rpb24oY2h1bmspIHsKKyAgICAgICAgICAgIHZhciBoZWxwZXIgPSBwcm9ncmVzc0hlbHBlcltjaHVuay51dWlkXTsKKyAgICAgICAgICAgIGlmICghaGVscGVyKSByZXR1cm47CisgICAgICAgICAgICBoZWxwZXIucHJvZ3Jlc3MudmFsdWUgPSBjaHVuay5jdXJyZW50UG9zaXRpb24gfHwgY2h1bmsubWF4Q2h1bmtzIHx8IGhlbHBlci5wcm9ncmVzcy5tYXg7CisgICAgICAgICAgICB1cGRhdGVMYWJlbChoZWxwZXIucHJvZ3Jlc3MsIGhlbHBlci5sYWJlbCk7CisgICAgICAgIH07CisKKyAgICAgICAgLy8gd3d3LlJUQ011bHRpQ29ubmVjdGlvbi5vcmcvZG9jcy9vbkZpbGVFbmQvCisgICAgICAgIGNvbm5lY3Rpb24ub25GaWxlRW5kID0gZnVuY3Rpb24oZmlsZSkgeworICAgICAgICAgICAgaWYgKHByb2dyZXNzSGVscGVyW2ZpbGUudXVpZF0pIHByb2dyZXNzSGVscGVyW2ZpbGUudXVpZF0uZGl2LmlubmVySFRNTCA9ICc8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AgICAgICAJCXsKKyAgICAgICAgCQkgICAgdmFyIHZpZGVvVGFnID0gZS5tZWRpYUVsZW1lbnQ7CisgICAgICAgIAkJICAgIHZhciB2aWRlb1R5cGUgPSBlLnR5cGU7CisgICAgICAgIAkJICAgIHZhciBwYXJlbnREaXYgPSBjb25uZWN0aW9uLnZpZGVvYm9keTsKKyAgICAgICAgCQkgICAgCisgICAgICAgIAkJICAgIGlmKHZpZGVvVHlwZSA9PSAibG9jYWwiKQorICAgICAgICAJCSAgICAJeworICAgICAgICAJCSAgICAJCXZpZGVvVGFnLnN0eWxlLnRvcCA9ICJhdXRvIjsKKyAgICAgICAgCQkgICAgCQl2aWRlb1RhZy5zdHlsZS5wb3NpdGlvbiA9ICJhYnNvbHV0ZSI7CisgICAgICAgIAkJICAgIAkJLy92aWRlb1RhZy5zdHlsZS5sZWZ0ID0gKHBhcmVudERpdi5vZmZzZXRXaWR0aCAtIDE2MCkgKyAicHgiOworICAgICAgICAJCSAgICAJCXZpZGVvVGFnLnN0eWxlLmhlaWdodCA9ICIxNTBweCI7CisgICAgICAgIAkJICAgIAkJdmlkZW9UYWcuc3R5bGUud2lkdGggPSAiMTUwcHgiOworICAgICAgICAJCSAgICAJCXZpZGVvVGFnLnN0eWxlLnpJbmRleCA9IDE7CisgICAgICAgIAkJICAgIAkJCisgICAgICAgIAkJICAgIAl9CisgICAgICAgIAkJICAgIGVsc2UgaWYodmlkZW9UeXBlID09ICJyZW1vdGUiKQorICAgICAgICAJCSAgICAJeworCSAgICAgICAgCQkgICAgCXZpZGVvVGFnLnN0eWxlLnRvcCA9ICJhdXRvIjsKKwkgICAgCQkgICAgCQl2aWRlb1RhZy5zdHlsZS5wb3NpdGlvbiA9ICJhYnNvbHV0ZSI7CisJICAgIAkJICAgIAkJdmlkZW9UYWcuc3R5bGUuekluZGV4ID0gLTE7CisgICAgICAgIAkJICAgIAl9CisgICAgICAgIAkJICAgIAkJCisgICAgICAgIAkJICAgIHBhcmVudERpdi5hcHBlbmRDaGlsZCh2aWRlb1RhZyk7CisgICAgICAgIAkJfQorICAgICAgICAJZWxzZSBpZihlLmlzU2NyZWVuKQorICAgICAgICAgICAgICAgeworCSAgICAgICAgCQl2YXIgc2NyZWVuVGFnID0gZS5tZWRpYUVsZW1lbnQ7CisJICAgIAkJICAgIHZhciBzY3JlZW5UeXBlID0gZS50eXBlOworCSAgICAJCSAgICB2YXIgcGFyZW50RGl2ID0gY29ubmVjdGlvbi5zY3JlZW5ib2R5OworCSAgICAJCSAgICAKKwkgICAgCQkgICAgaWYoc2NyZWVuVHlwZSA9PSAibG9jYWwiKQorICAgIAkJICAgIAkJeworICAgIAkJICAgIAkJCS8vIG5vIG5lZWQgdG8gZGlzcGxheSB0aGlzIGJlY2F1c2UgdGhlIHBlcnNvbiBzaGFyaW5nIGhpcy9oZXIgc2NyZWVuIGRvZXNuJ3QgaGF2ZSB0byBzZWUgd2hhdHMgYmVpbmcgc2hhcmVkIAorICAgIAkJICAgIAkJCS8vIGVuYWJsZWQgZm9yIGRlbW8gcHVycG9zZXMKKwkgICAgCQkgICAgCQlwYXJlbnREaXYuYXBwZW5kQ2hpbGQoc2NyZWVuVGFnKTsKKwkJCQl9CisJICAgIAkJICAgIGVsc2UgaWYoc2NyZWVuVHlwZSA9PSAicmVtb3RlIikKKyAgICAJCSAgICAJCXsKKyAgICAJCSAgICAJCQlwYXJlbnREaXYuYXBwZW5kQ2hpbGQoc2NyZWVuVGFnKTsKKyAgICAJCSAgICAJCX0KKwkgICAgCQkgICAgCisgICAgICAgIAkJCQorICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgCisgICAgICAgICAgICBlbHNlICAgICAgICAgICAgCisgICAgICAgICAgICAgIGNvbm5lY3Rpb24uYm9keS5pbnNlcnRCZWZvcmUoZS5tZWRpYUVsZW1lbnQsIGNvbm5lY3Rpb24uYm9keS5maXJzdENoaWxkKTsKKyAgICAgICAgICAgICAgCisgICAgICAgICAgICAvLyAgQ1VTVE9NIENPREUgIC8vICAgIAorICAgICAgICB9OworCisgICAgICAgIC8vIHd3dy5SVENNdWx0aUNvbm5lY3Rpb24ub3JnL2RvY3Mvb25TdHJlYW1FbmRlZEhhbmRsZXIvCisgICAgICAgIGNvbm5lY3Rpb24ub25zdHJlYW1lbmRlZCA9IGZ1bmN0aW9uKGUpIHsKKyAgICAgICAgICAgIGxvZygnb25TdHJlYW1FbmRlZEhhbmRsZXI6JywgZSk7CisKKyAgICAgICAgICAgIGlmICghZS5tZWRpYUVsZW1lbnQpIHsKKyAgICAgICAgICAgICAgICByZXR1cm4gd2FybignRXZlbnQubWVkaWFFbGVtZW50IGlzIHVuZGVmaW5lZCcsIGUpOworICAgICAgICAgICAgfQorICAgICAgICAgICAgaWYgKCFlLm1lZGlhRWxlbWVudC5wYXJlbnROb2RlKSB7CisgICAgICAgICAgICAgICAgZS5tZWRpYUVsZW1lbnQgPSBkb2N1bWVudC5nZXRFbGVtZW50QnlJZChlLnN0cmVhbWlkKTsKKworICAgICAgICAgICAgICAgIGlmICghZS5tZWRpYUVsZW1lbnQpIHsKKyAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHdhcm4oJ0V2ZW50Lm1lZGlhRWxlbWVudCBpcyB1bmRlZmluZWQnLCBlKTsKKyAgICAgICAgICAgICAgICB9CisKKyAgICAgICAgICAgICAgICBpZiAoIWUubWVkaWFFbGVtZW50LnBhcmVudE5vZGUpIHsKKyAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHdhcm4oJ0V2ZW50Lm1lZGlFbGVtZW50LnBhcmVudE5vZGUgaXMgbnVsbC4nLCBlKTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9CisKKyAgICAgICAgICAgIGUubWVkaWFFbGVtZW50LnBhcmVudE5vZGUucmVtb3ZlQ2hpbGQoZS5tZWRpYUVsZW1lbnQpOworICAgICAgICB9OworCisgICAgICAgIC8vIHRvZG86IG5lZWQgdG8gd3JpdGUgZG9jdW1lbnRhdGlvbiBsaW5rCisgICAgICAgIGNvbm5lY3Rpb24ub25TZXNzaW9uQ2xvc2VkID0gZnVuY3Rpb24oc2Vzc2lvbikgeworICAgICAgICAgICAgaWYgKHNlc3Npb24uaXNFamVjdGVkKSB7CisgICAgICAgICAgICAgICAgd2FybihzZXNzaW9uLnVzZXJpZCwgJ2VqZWN0ZWQgeW91LicpOworICAgICAgICAgICAgfSBlbHNlIHdhcm4oJ1Nlc3Npb24gaGFzIGJlZW4gY2xvc2VkLicsIHNlc3Npb24pOworICAgICAgICB9OworCisgICAgICAgIC8vIHd3dy5SVENNdWx0aUNvbm5lY3Rpb24ub3JnL2RvY3Mvb25tdXRlLworICAgICAgICBjb25uZWN0aW9uLm9ubXV0ZSA9IGZ1bmN0aW9uKGUpIHsKKyAgICAgICAgICAgIGlmIChlLmlzVmlkZW8gJiYgZS5tZWRpYUVsZW1lbnQpIHsKKyAgICAgICAgICAgICAgICBlLm1lZGlhRWxlbWVudC5wYXVzZSgpOworICAgICAgICAgICAgICAgIGUubWVkaWFFbGVtZW50LnNldEF0dHJpYnV0ZSgncG9zdGVyJywgZS5zbmFwc2hvdCB8fCBjb25uZWN0aW9uLnJlc291cmNlcy5tdXRlZCk7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBpZiAoZS5pc0F1ZGlvICYmIGUubWVkaWFFbGVtZW50KSB7CisgICAgICAgICAgICAgICAgZS5tZWRpYUVsZW1lbnQubXV0ZWQgPSB0cnVlOworICAgICAgICAgICAgfQorICAgICAgICB9OworCisgICAgICAgIC8vIHd3dy5SVENNdWx0aUNvbm5lY3Rpb24ub3JnL2RvY3Mvb251bm11dGUvCisgICAgICAgIGNvbm5lY3Rpb24ub251bm11dGUgPSBmdW5jdGlvbihlKSB7CisgICAgICAgICAgICBpZiAoZS5pc1ZpZGVvICYmIGUubWVkaWFFbGVtZW50KSB7CisgICAgICAgICAgICAgICAgZS5tZWRpYUVsZW1lbnQucGxheSgpOworICAgICAgICAgICAgICAgIGUubWVkaWFFbGVtZW50LnJlbW92ZUF0dHJpYnV0ZSgncG9zdGVyJyk7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBpZiAoZS5pc0F1ZGlvICYmIGUubWVkaWFFbGVtZW50KSB7CisgICAgICAgICAgICAgICAgZS5tZWRpYUVsZW1lbnQubXV0ZWQgPSBmYWxzZTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfTsKKworICAgICAgICAvLyB3d3cuUlRDTXVsdGlDb25uZWN0aW9uLm9yZy9kb2NzL29ubGVhdmUvCisgICAgICAgIGNvbm5lY3Rpb24ub25sZWF2ZSA9IGZ1bmN0aW9uKGUpIHsKKyAgICAgICAgICAgIGxvZygnb25sZWF2ZScsIHRvU3RyKGUpKTsKKyAgICAgICAgfTsKKworICAgICAgICBjb25uZWN0aW9uLnRva2VuID0gZ2V0UmFuZG9tU3RyaW5nOworCisgICAgICAgIGNvbm5lY3Rpb24ucGVlcnNbY29ubmVjdGlvbi51c2VyaWRdID0geworICAgICAgICAgICAgZHJvcDogZnVuY3Rpb24oKSB7CisgICAgICAgICAgICAgICAgY29ubmVjdGlvbi5kcm9wKCk7CisgICAgICAgICAgICB9LAorICAgICAgICAgICAgcmVuZWdvdGlhdGU6IGZ1bmN0aW9uKCkge30sCisgICAgICAgICAgICBhZGRTdHJlYW06IGZ1bmN0aW9uKCkge30sCisgICAgICAgICAgICBob2xkOiBmdW5jdGlvbigpIHt9LAorICAgICAgICAgICAgdW5ob2xkOiBmdW5jdGlvbigpIHt9LAorICAgICAgICAgICAgY2hhbmdlQmFuZHdpZHRoOiBmdW5jdGlvbigpIHt9LAorICAgICAgICAgICAgc2hhcmVQYXJ0T2ZTY3JlZW46IGZ1bmN0aW9uKCkge30KKyAgICAgICAgfTsKKworICAgICAgICBjb25uZWN0aW9uLl9za2lwID0gWydzdG9wJywgJ211dGUnLCAndW5tdXRlJywgJ19wcml2YXRlJywgJ19zZWxlY3RTdHJlYW1zJywgJ3NlbGVjdEZpcnN0JywgJ3NlbGVjdEFsbCcsICdyZW1vdmUnXTsKKworICAgICAgICAvLyB3d3cuUlRDTXVsdGlDb25uZWN0aW9uLm9yZy9kb2NzL3N0cmVhbXMvCisgICAgICAgIGNvbm5lY3Rpb24uc3RyZWFtcyA9IHsKKyAgICAgICAgICAgIG11dGU6IGZ1bmN0aW9uKHNlc3Npb24pIHsKKyAgICAgICAgICAgICAgICB0aGlzLl9wcml2YXRlKHNlc3Npb24sIHRydWUpOworICAgICAgICAgICAgfSwKKyAgICAgICAgICAgIHVubXV0ZTogZnVuY3Rpb24oc2Vzc2lvbikgeworICAgICAgICAgICAgICAgIHRoaXMuX3ByaXZhdGUoc2Vzc2lvbiwgZmFsc2UpOworICAgICAgICAgICAgfSwKKyAgICAgICAgICAgIF9wcml2YXRlOiBmdW5jdGlvbihzZXNzaW9uLCBlbmFibGVkKSB7CisgICAgICAgICAgICAgICAgaWYgKHNlc3Npb24gJiYgIWlzU3RyaW5nKHNlc3Npb24pKSB7CisgICAgICAgICAgICAgICAgICAgIGZvciAodmFyIHN0cmVhbSBpbiB0aGlzKSB7CisgICAgICAgICAgICAgICAgICAgICAgICBpZiAoY29ubmVjdGlvbi5fc2tpcC5pbmRleE9mKHN0cmVhbSkgPT0gLTEpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBfbXV0ZU9yVW5NdXRlKHRoaXNbc3RyZWFtXSwgc2Vzc2lvbiwgZW5hYmxlZCk7CisgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgIH0KKworICAgICAgICAgICAgICAgICAgICBmdW5jdGlvbiBfbXV0ZU9yVW5NdXRlKHN0cmVhbSwgc2Vzc2lvbiwgaXNNdXRlKSB7CisgICAgICAgICAgICAgICAgICAgICAgICBpZiAoc2Vzc2lvbi5sb2NhbCAmJiBzdHJlYW0udHlwZSAhPSAnbG9jYWwnKSByZXR1cm47CisgICAgICAgICAgICAgICAgICAgICAgICBpZiAoc2Vzc2lvbi5yZW1vdGUgJiYgc3RyZWFtLnR5cGUgIT0gJ3JlbW90ZScpIHJldHVybjsKKworICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHNlc3Npb24uaXNTY3JlZW4gJiYgIXN0cmVhbS5pc1NjcmVlbikgcmV0dXJuOworICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHNlc3Npb24uaXNBdWRpbyAmJiAhc3RyZWFtLmlzQXVkaW8pIHJldHVybjsKKyAgICAgICAgICAgICAgICAgICAgICAgIGlmIChzZXNzaW9uLmlzVmlkZW8gJiYgIXN0cmVhbS5pc1ZpZGVvKSByZXR1cm47CisKKyAgICAgICAgICAgICAgICAgICAgICAgIGlmIChpc011dGUpIHN0cmVhbS5tdXRlKHNlc3Npb24pOworICAgICAgICAgICAgICAgICAgICAgICAgZWxzZSBzdHJlYW0udW5tdXRlKHNlc3Npb24pOworICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgIHJldHVybjsKKyAgICAgICAgICAgICAgICB9CisKKyAgICAgICAgICAgICAgICAvLyBpbXBsZW1lbnRhdGlvbiBmcm9tICM2OAorICAgICAgICAgICAgICAgIGZvciAodmFyIHN0cmVhbSBpbiB0aGlzKSB7CisgICAgICAgICAgICAgICAgICAgIGlmIChjb25uZWN0aW9uLl9za2lwLmluZGV4T2Yoc3RyZWFtKSA9PSAtMSkgeworICAgICAgICAgICAgICAgICAgICAgICAgdGhpc1tzdHJlYW1dLl9wcml2YXRlKHNlc3Npb24sIGVuYWJsZWQpOworICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfSwKKyAgICAgICAgICAgIHN0b3A6IGZ1bmN0aW9uKHR5cGUpIHsKKyAgICAgICAgICAgICAgICB2YXIgX3N0cmVhbTsKKyAgICAgICAgICAgICAgICBmb3IgKHZhciBzdHJlYW0gaW4gdGhpcykgeworICAgICAgICAgICAgICAgICAgICBpZiAoY29ubmVjdGlvbi5fc2tpcC5pbmRleE9mKHN0cmVhbSkgPT0gLTEpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIF9zdHJlYW0gPSB0aGlzW3N0cmVhbV07CisKKyAgICAgICAgICAgICAgICAgICAgICAgIGlmICghdHlwZSkgX3N0cmVhbS5zdG9wKCk7CisKKyAgICAgICAgICAgICAgICAgICAgICAgIGVsc2UgaWYgKGlzU3RyaW5nKHR5cGUpKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gY29ubmVjdGlvbi5zdHJlYW1zLnN0b3AoJ3NjcmVlbicpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhciBjb25maWcgPSB7fTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb25maWdbdHlwZV0gPSB0cnVlOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIF9zdG9wU3RyZWFtKF9zdHJlYW0sIGNvbmZpZyk7CisgICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2UgX3N0b3BTdHJlYW0oX3N0cmVhbSwgdHlwZSk7CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICB9CisKKyAgICAgICAgICAgICAgICBmdW5jdGlvbiBfc3RvcFN0cmVhbShfc3RyZWFtLCBjb25maWcpIHsKKyAgICAgICAgICAgICAgICAgICAgLy8gY29ubmVjdGlvbi5zdHJlYW1zLnN0b3AoeyByZW1vdGU6IHRydWUsIHVzZXJpZDogJ3JlbW90ZS11c2VyaWQnIH0pOworICAgICAgICAgICAgICAgICAgICBpZiAoY29uZmlnLnVzZXJpZCAmJiBfc3RyZWFtLnVzZXJpZCAhPSBjb25maWcudXNlcmlkKSByZXR1cm47CisKKyAgICAgICAgICAgICAgICAgICAgaWYgKGNvbmZpZy5sb2NhbCAmJiBfc3RyZWFtLnR5cGUgIT0gJ2xvY2FsJykgcmV0dXJuOworICAgICAgICAgICAgICAgICAgICBpZiAoY29uZmlnLnJlbW90ZSAmJiBfc3RyZWFtLnR5cGUgIT0gJ3JlbW90ZScpIHJldHVybjsKKworICAgICAgICAgICAgICAgICAgICBpZiAoY29uZmlnLnNjcmVlbiAmJiAhIV9zdHJlYW0uaXNTY3JlZW4pIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIF9zdHJlYW0uc3RvcCgpOworICAgICAgICAgICAgICAgICAgICB9CisKKyAgICAgICAgICAgICAgICAgICAgaWYgKGNvbmZpZy5hdWRpbyAmJiAhIV9zdHJlYW0uaXNBdWRpbykgeworICAgICAgICAgICAgICAgICAgICAgICAgX3N0cmVhbS5zdG9wKCk7CisgICAgICAgICAgICAgICAgICAgIH0KKworICAgICAgICAgICAgICAgICAgICBpZiAoY29uZmlnLnZpZGVvICYmICEhX3N0cmVhbS5pc1ZpZGVvKSB7CisgICAgICAgICAgICAgICAgICAgICAgICBfc3RyZWFtLnN0b3AoKTsKKyAgICAgICAgICAgICAgICAgICAgfQorCisgICAgICAgICAgICAgICAgICAgIC8vIGNvbm5lY3Rpb24uc3RyZWFtcy5zdG9wKCdsb2NhbCcpOworICAgICAgICAgICAgICAgICAgICBpZiAoIWNvbmZpZy5hdWRpbyAmJiAhY29uZmlnLnZpZGVvICYmICFjb25maWcuc2NyZWVuKSB7CisgICAgICAgICAgICAgICAgICAgICAgICBfc3RyZWFtLnN0b3AoKTsKKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0sCisgICAgICAgICAgICByZW1vdmU6IGZ1bmN0aW9uKHR5cGUpIHsKKyAgICAgICAgICAgICAgICB2YXIgX3N0cmVhbTsKKyAgICAgICAgICAgICAgICBmb3IgKHZhciBzdHJlYW0gaW4gdGhpcykgeworICAgICAgICAgICAgICAgICAgICBpZiAoY29ubmVjdGlvbi5fc2tpcC5pbmRleE9mKHN0cmVhbSkgPT0gLTEpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIF9zdHJlYW0gPSB0aGlzW3N0cmVhbV07CisKKyAgICAgICAgICAgICAgICAgICAgICAgIGlmICghdHlwZSkgX3N0b3BBbmRSZW1vdmVTdHJlYW0oX3N0cmVhbSwgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxvY2FsOiB0cnVlLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJlbW90ZTogdHJ1ZQorICAgICAgICAgICAgICAgICAgICAgICAgfSk7CisKKyAgICAgICAgICAgICAgICAgICAgICAgIGVsc2UgaWYgKGlzU3RyaW5nKHR5cGUpKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gY29ubmVjdGlvbi5zdHJlYW1zLnN0b3AoJ3NjcmVlbicpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhciBjb25maWcgPSB7fTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb25maWdbdHlwZV0gPSB0cnVlOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIF9zdG9wQW5kUmVtb3ZlU3RyZWFtKF9zdHJlYW0sIGNvbmZpZyk7CisgICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2UgX3N0b3BBbmRSZW1vdmVTdHJlYW0oX3N0cmVhbSwgdHlwZSk7CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICB9CisKKyAgICAgICAgICAgICAgICBmdW5jdGlvbiBfc3RvcEFuZFJlbW92ZVN0cmVhbShfc3RyZWFtLCBjb25maWcpIHsKKyAgICAgICAgICAgICAgICAgICAgLy8gY29ubmVjdGlvbi5zdHJlYW1zLnJlbW92ZSh7IHJlbW90ZTogdHJ1ZSwgdXNlcmlkOiAncmVtb3RlLXVzZXJpZCcgfSk7CisgICAgICAgICAgICAgICAgICAgIGlmIChjb25maWcudXNlcmlkICYmIF9zdHJlYW0udXNlcmlkICE9IGNvbmZpZy51c2VyaWQpIHJldHVybjsKKworICAgICAgICAgICAgICAgICAgICBpZiAoY29uZmlnLmxvY2FsICYmIF9zdHJlYW0udHlwZSAhPSAnbG9jYWwnKSByZXR1cm47CisgICAgICAgICAgICAgICAgICAgIGlmIChjb25maWcucmVtb3RlICYmIF9zdHJlYW0udHlwZSAhPSAncmVtb3RlJykgcmV0dXJuOworCisgICAgICAgICAgICAgICAgICAgIGlmIChjb25maWcuc2NyZWVuICYmICEhX3N0cmVhbS5pc1NjcmVlbikgeworICAgICAgICAgICAgICAgICAgICAgICAgZW5kU3RyZWFtKF9zdHJlYW0pOworICAgICAgICAgICAgICAgICAgICB9CisKKyAgICAgICAgICAgICAgICAgICAgaWYgKGNvbmZpZy5hdWRpbyAmJiAhIV9zdHJlYW0uaXNBdWRpbykgeworICAgICAgICAgICAgICAgICAgICAgICAgZW5kU3RyZWFtKF9zdHJlYW0pOworICAgICAgICAgICAgICAgICAgICB9CisKKyAgICAgICAgICAgICAgICAgICAgaWYgKGNvbmZpZy52aWRlbyAmJiAhIV9zdHJlYW0uaXNWaWRlbykgeworICAgICAgICAgICAgICAgICAgICAgICAgZW5kU3RyZWFtKF9zdHJlYW0pOworICAgICAgICAgICAgICAgICAgICB9CisKKyAgICAgICAgICAgICAgICAgICAgLy8gY29ubmVjdGlvbi5zdHJlYW1zLnJlbW92ZSgnbG9jYWwnKTsKKyAgICAgICAgICAgICAgICAgICAgaWYgKCFjb25maWcuYXVkaW8gJiYgIWNvbmZpZy52aWRlbyAmJiAhY29uZmlnLnNjcmVlbikgeworICAgICAgICAgICAgICAgICAgICAgICAgZW5kU3RyZWFtKF9zdHJlYW0pOworICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgfQorCisgICAgICAgICAgICAgICAgZnVuY3Rpb24gZW5kU3RyZWFtKF9zdHJlYW0pIHsKKyAgICAgICAgICAgICAgICAgICAgb25TdHJlYW1FbmRlZEhhbmRsZXIoX3N0cmVhbSwgY29ubmVjdGlvbik7CisgICAgICAgICAgICAgICAgICAgIGRlbGV0ZSBjb25uZWN0aW9uLnN0cmVhbXNbX3N0cmVhbS5zdHJlYW1pZF07CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfSwKKyAgICAgICAgICAgIHNlbGVjdEZpcnN0OiBmdW5jdGlvbihhcmdzKSB7CisgICAgICAgICAgICAgICAgcmV0dXJuIHRoaXMuX3NlbGVjdFN0cmVhbXMoYXJncywgZmFsc2UpOworICAgICAgICAgICAgfSwKKyAgICAgICAgICAgIHNlbGVjdEFsbDogZnVuY3Rpb24oYXJncykgeworICAgICAgICAgICAgICAgIHJldHVybiB0aGlzLl9zZWxlY3RTdHJlYW1zKGFyZ3MsIHRydWUpOworICAgICAgICAgICAgfSwKKyAgICAgICAgICAgIF9zZWxlY3RTdHJlYW1zOiBmdW5jdGlvbihhcmdzLCBhbGwpIHsKKyAgICAgICAgICAgICAgICBpZiAoIWFyZ3MgfHwgaXNTdHJpbmcoYXJncykgfHwgaXNFbXB0eShhcmdzKSkgdGhyb3cgJ0ludmFsaWQgYXJndW1lbnRzLic7CisKKyAgICAgICAgICAgICAgICAvLyBpZiB1c2VyaWQgaXMgdXNlZCB0aGVuIGJvdGggbG9jYWwvcmVtb3RlIHNob3VsZG4ndCBiZSBhdXRvLXNldAorICAgICAgICAgICAgICAgIGlmIChpc051bGwoYXJncy5sb2NhbCkgJiYgaXNOdWxsKGFyZ3MucmVtb3RlKSAmJiBpc051bGwoYXJncy51c2VyaWQpKSB7CisgICAgICAgICAgICAgICAgICAgIGFyZ3MubG9jYWwgPSBhcmdzLnJlbW90ZSA9IHRydWU7CisgICAgICAgICAgICAgICAgfQorCisgICAgICAgICAgICAgICAgaWYgKCFhcmdzLmlzQXVkaW8gJiYgIWFyZ3MuaXNWaWRlbyAmJiAhYXJncy5pc1NjcmVlbikgeworICAgICAgICAgICAgICAgICAgICBhcmdzLmlzQXVkaW8gPSBhcmdzLmlzVmlkZW8gPSBhcmdzLmlzU2NyZWVuID0gdHJ1ZTsKKyAgICAgICAgICAgICAgICB9CisKKyAgICAgICAgICAgICAgICB2YXIgc2VsZWN0ZWRTdHJlYW1zID0gW107CisgICAgICAgICAgICAgICAgZm9yICh2YXIgc3RyZWFtIGluIHRoaXMpIHsKKyAgICAgICAgICAgICAgICAgICAgaWYgKGNvbm5lY3Rpb24uX3NraXAuaW5kZXhPZihzdHJlYW0pID09IC0xICYmIChzdHJlYW0gPSB0aGlzW3N0cmVhbV0pICYmICgoYXJncy5sb2NhbCAmJiBzdHJlYW0udHlwZSA9PSAnbG9jYWwnKSB8fCAoYXJncy5yZW1vdGUgJiYgc3RyZWFtLnR5cGUgPT0gJ3JlbW90ZScpIHx8IChhcmdzLnVzZXJpZCAmJiBzdHJlYW0udXNlcmlkID09IGFyZ3MudXNlcmlkKSkpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIGlmIChhcmdzLmlzVmlkZW8gJiYgc3RyZWFtLmlzVmlkZW8pIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBzZWxlY3RlZFN0cmVhbXMucHVzaChzdHJlYW0pOworICAgICAgICAgICAgICAgICAgICAgICAgfQorCisgICAgICAgICAgICAgICAgICAgICAgICBpZiAoYXJncy5pc0F1ZGlvICYmIHN0cmVhbS5pc0F1ZGlvKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2VsZWN0ZWRTdHJlYW1zLnB1c2goc3RyZWFtKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIH0KKworICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGFyZ3MuaXNTY3JlZW4gJiYgc3RyZWFtLmlzU2NyZWVuKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2VsZWN0ZWRTdHJlYW1zLnB1c2goc3RyZWFtKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIH0KKworICAgICAgICAgICAgICAgIHJldHVybiAhIWFsbCA/IHNlbGVjdGVkU3RyZWFtcyA6IHNlbGVjdGVkU3RyZWFtc1swXTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfTsKKworICAgICAgICB2YXIgaWNlU2VydmVycyA9IFtdOworCisgICAgICAgIC8vICBDVVNUT00gQ09ERSAgLy8gCisgICAgICAgIC8vIHRoZXNlIHNlcnZlcnMgc2hvdWxkIGJlIHByb3ZpZGVkIGJ5IHRlYW0gaW1wbG1lbnRpbmcgdGhlIHNvbHV0aW9uCisgICAgICAgIGljZVNlcnZlcnMucHVzaCh7CisgICAgICAgICAgICB1cmw6ICdzdHVuOnRvZG9fdXJsOjEzNDc4JworICAgICAgICB9KTsKKworICAgICAgICAKKyAgICAgICAgLyogQ0hBTkdFRDogRnVzaW9uOiBUaGVzZSBhcmUganVzdCBmb3IgdGVzdGluZyBwdXJwb3NlcworCisJCSBpY2VTZXJ2ZXJzLnB1c2goeworICAgICAgICAgICAgdXJsOiAnc3R1bjpzdHVuLmwuZ29vZ2xlLmNvbToxOTMwMicKKyAgICAgICAgfSk7CisKKyAgICAgICAgaWNlU2VydmVycy5wdXNoKHsKKyAgICAgICAgICAgIHVybDogJ3N0dW46c3R1bi5hbnlmaXJld2FsbC5jb206MzQ3OCcKKyAgICAgICAgfSk7CisKKyAgICAgICAgaWNlU2VydmVycy5wdXNoKHsKKyAgICAgICAgICAgIHVybDogJ3R1cm46dHVybi5iaXN0cmkuY29tOjgwJywKKyAgICAgICAgICAgIGNyZWRlbnRpYWw6ICdob21lbycsCisgICAgICAgICAgICB1c2VybmFtZTogJ2hvbWVvJworICAgICAgICB9KTsKKworICAgICAgICBpY2VTZXJ2ZXJzLnB1c2goeworICAgICAgICAgICAgdXJsOiAndHVybjp0dXJuLmFueWZpcmV3YWxsLmNvbTo0NDM/dHJhbnNwb3J0PXRjcCcsCisgICAgICAgICAgICBjcmVkZW50aWFsOiAnd2VicnRjJywKKyAgICAgICAgICAgIHVzZXJuYW1lOiAnd2VicnRjJworICAgICAgICB9KTsKKworCQkqLworICAgICAgICAgLy8gIENVU1RPTSBDT0RFICAvLyAKKyAgICAgICAgY29ubmVjdGlvbi5pY2VTZXJ2ZXJzID0gaWNlU2VydmVyczsKKworICAgICAgICBjb25uZWN0aW9uLnJ0Y0NvbmZpZ3VyYXRpb24gPSB7CisgICAgICAgICAgICBpY2VTZXJ2ZXJzOiBudWxsLAorICAgICAgICAgICAgaWNlVHJhbnNwb3J0czogJ2FsbCcsIC8vIG5vbmUgfHwgcmVsYXkgfHwgYWxsIC0gcmVmOiBodHRwOi8vZ29vLmdsLzQwSTM5SworICAgICAgICAgICAgcGVlcklkZW50aXR5OiBmYWxzZQorICAgICAgICB9OworCisgICAgICAgIC8vIHd3dy5SVENNdWx0aUNvbm5lY3Rpb24ub3JnL2RvY3MvbWVkaWEvCisgICAgICAgIGNvbm5lY3Rpb24ubWVkaWEgPSB7CisgICAgICAgICAgICBtaW46IGZ1bmN0aW9uKHdpZHRoLCBoZWlnaHQpIHsKKyAgICAgICAgICAgICAgICBpZiAoIWNvbm5lY3Rpb24ubWVkaWFDb25zdHJhaW50cy52aWRlbykgcmV0dXJuOworCisgICAgICAgICAgICAgICAgaWYgKCFjb25uZWN0aW9uLm1lZGlhQ29uc3RyYWludHMudmlkZW8ubWFuZGF0b3J5KSB7CisgICAgICAgICAgICAgICAgICAgIGNvbm5lY3Rpb24ubWVkaWFDb25zdHJhaW50cy52aWRlby5tYW5kYXRvcnkgPSB7fTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgY29ubmVjdGlvbi5tZWRpYUNvbnN0cmFpbnRzLnZpZGVvLm1hbmRhdG9yeS5taW5XaWR0aCA9IHdpZHRoOworICAgICAgICAgICAgICAgIGNvbm5lY3Rpb24ubWVkaWFDb25zdHJhaW50cy52aWRlby5tYW5kYXRvcnkubWluSGVpZ2h0ID0gaGVpZ2h0OworICAgICAgICAgICAgfSwKKyAgICAgICAgICAgIG1heDogZnVuY3Rpb24od2lkdGgsIGhlaWdodCkgeworICAgICAgICAgICAgICAgIGlmICghY29ubmVjdGlvbi5tZWRpYUNvbnN0cmFpbnRzLnZpZGVvKSByZXR1cm47CisKKyAgICAgICAgICAgICAgICBpZiAoIWNvbm5lY3Rpb24ubWVkaWFDb25zdHJhaW50cy52aWRlby5tYW5kYXRvcnkpIHsKKyAgICAgICAgICAgICAgICAgICAgY29ubmVjdGlvbi5tZWRpYUNvbnN0cmFpbnRzLnZpZGVvLm1hbmRhdG9yeSA9IHt9OworICAgICAgICAgICAgICAgIH0KKworICAgICAgICAgICAgICAgIGNvbm5lY3Rpb24ubWVkaWFDb25zdHJhaW50cy52aWRlby5tYW5kYXRvcnkubWF4V2lkdGggPSB3aWR0aDsKKyAgICAgICAgICAgICAgICBjb25uZWN0aW9uLm1lZGlhQ29uc3RyYWludHMudmlkZW8ubWFuZGF0b3J5Lm1heEhlaWdodCA9IGhlaWdodDsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfTsKKworICAgICAgICBjb25uZWN0aW9uLl9nZXRTdHJlYW0gPSBmdW5jdGlvbihldmVudCkgeworICAgICAgICAgICAgdmFyIHJlc3VsdGluZ09iamVjdCA9IG1lcmdlKHsKKyAgICAgICAgICAgICAgICBzb2NrZXRzOiBldmVudC5zb2NrZXQgPyBbZXZlbnQuc29ja2V0XSA6IFtdCisgICAgICAgICAgICB9LCBldmVudCk7CisKKyAgICAgICAgICAgIHJlc3VsdGluZ09iamVjdC5zdG9wID0gZnVuY3Rpb24oKSB7CisgICAgICAgICAgICAgICAgdmFyIHNlbGYgPSB0aGlzOworCisgICAgICAgICAgICAgICAgc2VsZi5zb2NrZXRzLmZvckVhY2goZnVuY3Rpb24oc29ja2V0KSB7CisgICAgICAgICAgICAgICAgICAgIGlmIChzZWxmLnR5cGUgPT0gJ2xvY2FsJykgeworICAgICAgICAgICAgICAgICAgICAgICAgc29ja2V0LnNlbmQoeworICAgICAgICAgICAgICAgICAgICAgICAgICAgIHN0cmVhbWlkOiBzZWxmLnN0cmVhbWlkLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIHN0b3BwZWQ6IHRydWUKKyAgICAgICAgICAgICAgICAgICAgICAgIH0pOworICAgICAgICAgICAgICAgICAgICB9CisKKyAgICAgICAgICAgICAgICAgICAgaWYgKHNlbGYudHlwZSA9PSAncmVtb3RlJykgeworICAgICAgICAgICAgICAgICAgICAgICAgc29ja2V0LnNlbmQoeworICAgICAgICAgICAgICAgICAgICAgICAgICAgIHByb21wdFN0cmVhbVN0b3A6IHRydWUsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgc3RyZWFtaWQ6IHNlbGYuc3RyZWFtaWQKKyAgICAgICAgICAgICAgICAgICAgICAgIH0pOworICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgfSk7CisKKyAgICAgICAgICAgICAgICBpZiAoc2VsZi50eXBlID09ICdyZW1vdGUnKSByZXR1cm47CisKKyAgICAgICAgICAgICAgICB2YXIgc3RyZWFtID0gc2VsZi5zdHJlYW07CisgICAgICAgICAgICAgICAgaWYgKHN0cmVhbSkgc2VsZi5ydGNNdWx0aUNvbm5lY3Rpb24uc3RvcE1lZGlhU3RyZWFtKHN0cmVhbSk7CisgICAgICAgICAgICB9OworCisgICAgICAgICAgICByZXN1bHRpbmdPYmplY3QubXV0ZSA9IGZ1bmN0aW9uKHNlc3Npb24pIHsKKyAgICAgICAgICAgICAgICB0aGlzLm11dGVkID0gdHJ1ZTsKKyAgICAgICAgICAgICAgICB0aGlzLl9wcml2YXRlKHNlc3Npb24sIHRydWUpOworICAgICAgICAgICAgfTsKKworICAgICAgICAgICAgcmVzdWx0aW5nT2JqZWN0LnVubXV0ZSA9IGZ1bmN0aW9uKHNlc3Npb24pIHsKKyAgICAgICAgICAgICAgICB0aGlzLm11dGVkID0gZmFsc2U7CisgICAgICAgICAgICAgICAgdGhpcy5fcHJpdmF0ZShzZXNzaW9uLCBmYWxzZSk7CisgICAgICAgICAgICB9OworCisgICAgICAgICAgICBmdW5jdGlvbiBtdXRlT3JVbm11dGVMb2NhbGx5KHNlc3Npb24sIGlzUGF1c2UsIG1lZGlhRWxlbWVudCkgeworICAgICAgICAgICAgICAgIGlmICghbWVkaWFFbGVtZW50KSByZXR1cm47CisgICAgICAgICAgICAgICAgdmFyIGxhc3RQYXVzZVN0YXRlID0gbWVkaWFFbGVtZW50Lm9ucGF1c2U7CisgICAgICAgICAgICAgICAgdmFyIGxhc3RQbGF5U3RhdGUgPSBtZWRpYUVsZW1lbnQub25wbGF5OworICAgICAgICAgICAgICAgIG1lZGlhRWxlbWVudC5vbnBhdXNlID0gbWVkaWFFbGVtZW50Lm9ucGxheSA9IGZ1bmN0aW9uKCkge307CisKKyAgICAgICAgICAgICAgICBpZiAoaXNQYXVzZSkgbWVkaWFFbGVtZW50LnBhdXNlKCk7CisgICAgICAgICAgICAgICAgZWxzZSBtZWRpYUVsZW1lbnQucGxheSgpOworCisgICAgICAgICAgICAgICAgbWVkaWFFbGVtZW50Lm9ucGF1c2UgPSBsYXN0UGF1c2VTdGF0ZTsKKyAgICAgICAgICAgICAgICBtZWRpYUVsZW1lbnQub25wbGF5ID0gbGFzdFBsYXlTdGF0ZTsKKyAgICAgICAgICAgIH0KKworICAgICAgICAgICAgcmVzdWx0aW5nT2JqZWN0Ll9wcml2YXRlID0gZnVuY3Rpb24oc2Vzc2lvbiwgZW5hYmxlZCkgeworICAgICAgICAgICAgICAgIGlmIChzZXNzaW9uICYmICFpc051bGwoc2Vzc2lvbi5zeW5jKSAmJiBzZXNzaW9uLnN5bmMgPT0gZmFsc2UpIHsKKyAgICAgICAgICAgICAgICAgICAgbXV0ZU9yVW5tdXRlTG9jYWxseShzZXNzaW9uLCBlbmFibGVkLCB0aGlzLm1lZGlhRWxlbWVudCk7CisgICAgICAgICAgICAgICAgICAgIHJldHVybjsKKyAgICAgICAgICAgICAgICB9CisKKyAgICAgICAgICAgICAgICBtdXRlT3JVbm11dGUoeworICAgICAgICAgICAgICAgICAgICByb290OiB0aGlzLAorICAgICAgICAgICAgICAgICAgICBzZXNzaW9uOiBzZXNzaW9uLAorICAgICAgICAgICAgICAgICAgICBlbmFibGVkOiBlbmFibGVkLAorICAgICAgICAgICAgICAgICAgICBzdHJlYW06IHRoaXMuc3RyZWFtCisgICAgICAgICAgICAgICAgfSk7CisgICAgICAgICAgICB9OworCisgICAgICAgICAgICByZXN1bHRpbmdPYmplY3Quc3RhcnRSZWNvcmRpbmcgPSBmdW5jdGlvbihzZXNzaW9uKSB7CisgICAgICAgICAgICAgICAgdmFyIHNlbGYgPSB0aGlzOworCisgICAgICAgICAgICAgICAgaWYgKCFzZXNzaW9uKSB7CisgICAgICAgICAgICAgICAgICAgIHNlc3Npb24gPSB7CisgICAgICAgICAgICAgICAgICAgICAgICBhdWRpbzogdHJ1ZSwKKyAgICAgICAgICAgICAgICAgICAgICAgIHZpZGVvOiB0cnVlCisgICAgICAgICAgICAgICAgICAgIH07CisgICAgICAgICAgICAgICAgfQorCisgICAgICAgICAgICAgICAgaWYgKGlzU3RyaW5nKHNlc3Npb24pKSB7CisgICAgICAgICAgICAgICAgICAgIHNlc3Npb24gPSB7CisgICAgICAgICAgICAgICAgICAgICAgICBhdWRpbzogc2Vzc2lvbiA9PSAnYXVkaW8nLAorICAgICAgICAgICAgICAgICAgICAgICAgdmlkZW86IHNlc3Npb24gPT0gJ3ZpZGVvJworICAgICAgICAgICAgICAgICAgICB9OworICAgICAgICAgICAgICAgIH0KKworICAgICAgICAgICAgICAgIGlmICghd2luZG93LlJlY29yZFJUQykgeworICAgICAgICAgICAgICAgICAgICByZXR1cm4gbG9hZFNjcmlwdChzZWxmLnJ0Y011bHRpQ29ubmVjdGlvbi5yZXNvdXJjZXMuUmVjb3JkUlRDLCBmdW5jdGlvbigpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIHNlbGYuc3RhcnRSZWNvcmRpbmcoc2Vzc2lvbik7CisgICAgICAgICAgICAgICAgICAgIH0pOworICAgICAgICAgICAgICAgIH0KKworICAgICAgICAgICAgICAgIGxvZygnc3RhcnRlZCByZWNvcmRpbmcgc2Vzc2lvbicsIHNlc3Npb24pOworCisgICAgICAgICAgICAgICAgc2VsZi52aWRlb1JlY29yZGVyID0gc2VsZi5hdWRpb1JlY29yZGVyID0gbnVsbDsKKworICAgICAgICAgICAgICAgIGlmIChpc0ZpcmVmb3gpIHsKKyAgICAgICAgICAgICAgICAgICAgLy8gZmlyZWZveCBzdXBwb3J0cyBib3RoIGF1ZGlvL3ZpZGVvIHJlY29yZGluZyBpbiBzaW5nbGUgd2VibSBmaWxlCisgICAgICAgICAgICAgICAgICAgIGlmIChzZXNzaW9uLnZpZGVvKSB7CisgICAgICAgICAgICAgICAgICAgICAgICBzZWxmLnZpZGVvUmVjb3JkZXIgPSBSZWNvcmRSVEMoc2VsZi5zdHJlYW0sIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB0eXBlOiAndmlkZW8nCisgICAgICAgICAgICAgICAgICAgICAgICB9KTsKKyAgICAgICAgICAgICAgICAgICAgfSBlbHNlIGlmIChzZXNzaW9uLmF1ZGlvKSB7CisgICAgICAgICAgICAgICAgICAgICAgICBzZWxmLmF1ZGlvUmVjb3JkZXIgPSBSZWNvcmRSVEMoc2VsZi5zdHJlYW0sIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB0eXBlOiAnYXVkaW8nCisgICAgICAgICAgICAgICAgICAgICAgICB9KTsKKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAoaXNDaHJvbWUpIHsKKyAgICAgICAgICAgICAgICAgICAgLy8gY2hyb21lIHN1cHBvcnRzIHJlY29yZGluZyBpbiB0d28gc2VwYXJhdGUgZmlsZXM6IFdBViBhbmQgV2ViTQorICAgICAgICAgICAgICAgICAgICBpZiAoc2Vzc2lvbi52aWRlbykgeworICAgICAgICAgICAgICAgICAgICAgICAgc2VsZi52aWRlb1JlY29yZGVyID0gUmVjb3JkUlRDKHNlbGYuc3RyZWFtLCB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgdHlwZTogJ3ZpZGVvJworICAgICAgICAgICAgICAgICAgICAgICAgfSk7CisgICAgICAgICAgICAgICAgICAgIH0KKworICAgICAgICAgICAgICAgICAgICBpZiAoc2Vzc2lvbi5hdWRpbykgeworICAgICAgICAgICAgICAgICAgICAgICAgc2VsZi5hdWRpb1JlY29yZGVyID0gUmVjb3JkUlRDKHNlbGYuc3RyZWFtLCB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgdHlwZTogJ2F1ZGlvJworICAgICAgICAgICAgICAgICAgICAgICAgfSk7CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICB9CisKKyAgICAgICAgICAgICAgICBpZiAoc2VsZi5hdWRpb1JlY29yZGVyKSB7CisgICAgICAgICAgICAgICAgICAgIHNlbGYuYXVkaW9SZWNvcmRlci5zdGFydFJlY29yZGluZygpOworICAgICAgICAgICAgICAgIH0KKworICAgICAgICAgICAgICAgIGlmIChzZWxmLnZpZGVvUmVjb3JkZXIpIHNlbGYudmlkZW9SZWNvcmRlci5zdGFydFJlY29yZGluZygpOworICAgICAgICAgICAgfTsKKworICAgICAgICAgICAgcmVzdWx0aW5nT2JqZWN0LnN0b3BSZWNvcmRpbmcgPSBmdW5jdGlvbihjYWxsYmFjaywgc2Vzc2lvbikgeworICAgICAgICAgICAgICAgIGlmICghc2Vzc2lvbikgeworICAgICAgICAgICAgICAgICAgICBzZXNzaW9uID0geworICAgICAgICAgICAgICAgICAgICAgICAgYXVkaW86IHRydWUsCisgICAgICAgICAgICAgICAgICAgICAgICB2aWRlbzogdHJ1ZQorICAgICAgICAgICAgICAgICAgICB9OworICAgICAgICAgICAgICAgIH0KKworICAgICAgICAgICAgICAgIGlmIChpc1N0cmluZyhzZXNzaW9uKSkgeworICAgICAgICAgICAgICAgICAgICBzZXNzaW9uID0geworICAgICAgICAgICAgICAgICAgICAgICAgYXVkaW86IHNlc3Npb24gPT0gJ2F1ZGlvJywKKyAgICAgICAgICAgICAgICAgICAgICAgIHZpZGVvOiBzZXNzaW9uID09ICd2aWRlbycKKyAgICAgICAgICAgICAgICAgICAgfTsKKyAgICAgICAgICAgICAgICB9CisKKyAgICAgICAgICAgICAgICBsb2coJ3N0b3BwZWQgcmVjb3JkaW5nIHNlc3Npb24nLCBzZXNzaW9uKTsKKworICAgICAgICAgICAgICAgIHZhciBzZWxmID0gdGhpczsKKworICAgICAgICAgICAgICAgIGlmIChzZXNzaW9uLmF1ZGlvICYmIHNlbGYuYXVkaW9SZWNvcmRlcikgeworICAgICAgICAgICAgICAgICAgICBzZWxmLmF1ZGlvUmVjb3JkZXIuc3RvcFJlY29yZGluZyhmdW5jdGlvbigpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIGlmIChzZXNzaW9uLnZpZGVvICYmIHNlbGYudmlkZW9SZWNvcmRlcikgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNlbGYudmlkZW9SZWNvcmRlci5zdG9wUmVjb3JkaW5nKGZ1bmN0aW9uKCkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjYWxsYmFjayh7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBhdWRpbzogc2VsZi5hdWRpb1JlY29yZGVyLmdldEJsb2IoKSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZpZGVvOiBzZWxmLnZpZGVvUmVjb3JkZXIuZ2V0QmxvYigpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0pOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0pOworICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIGNhbGxiYWNrKHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBhdWRpbzogc2VsZi5hdWRpb1JlY29yZGVyLmdldEJsb2IoKQorICAgICAgICAgICAgICAgICAgICAgICAgfSk7CisgICAgICAgICAgICAgICAgICAgIH0pOworICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAoc2Vzc2lvbi52aWRlbyAmJiBzZWxmLnZpZGVvUmVjb3JkZXIpIHsKKyAgICAgICAgICAgICAgICAgICAgc2VsZi52aWRlb1JlY29yZGVyLnN0b3BSZWNvcmRpbmcoZnVuY3Rpb24oKSB7CisgICAgICAgICAgICAgICAgICAgICAgICBjYWxsYmFjayh7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgdmlkZW86IHNlbGYudmlkZW9SZWNvcmRlci5nZXRCbG9iKCkKKyAgICAgICAgICAgICAgICAgICAgICAgIH0pOworICAgICAgICAgICAgICAgICAgICB9KTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9OworCisgICAgICAgICAgICByZXN1bHRpbmdPYmplY3QudGFrZVNuYXBzaG90ID0gZnVuY3Rpb24oY2FsbGJhY2spIHsKKyAgICAgICAgICAgICAgICB0YWtlU25hcHNob3QoeworICAgICAgICAgICAgICAgICAgICBtZWRpYUVsZW1lbnQ6IHRoaXMubWVkaWFFbGVtZW50LAorICAgICAgICAgICAgICAgICAgICB1c2VyaWQ6IHRoaXMudXNlcmlkLAorICAgICAgICAgICAgICAgICAgICBjb25uZWN0aW9uOiBjb25uZWN0aW9uLAorICAgICAgICAgICAgICAgICAgICBjYWxsYmFjazogY2FsbGJhY2sKKyAgICAgICAgICAgICAgICB9KTsKKyAgICAgICAgICAgIH07CisKKyAgICAgICAgICAgIC8vIHJlZHVuZGFudDoga2VwdCBvbmx5IGZvciBiYWNrd2FyZCBjb21wYXRpYmlsaXR5CisgICAgICAgICAgICByZXN1bHRpbmdPYmplY3Quc3RyZWFtT2JqZWN0ID0gcmVzdWx0aW5nT2JqZWN0OworCisgICAgICAgICAgICByZXR1cm4gcmVzdWx0aW5nT2JqZWN0OworICAgICAgICB9OworCisgICAgICAgIC8vIG5ldyBSVENNdWx0aUNvbm5lY3Rpb24oKS5zZXQoe3Byb3BlcnRpZXN9KS5jb25uZWN0KCkKKyAgICAgICAgY29ubmVjdGlvbi5zZXQgPSBmdW5jdGlvbihwcm9wZXJ0aWVzKSB7CisgICAgICAgICAgICBmb3IgKHZhciBwcm9wZXJ0eSBpbiBwcm9wZXJ0aWVzKSB7CisgICAgICAgICAgICAgICAgdGhpc1twcm9wZXJ0eV0gPSBwcm9wZXJ0aWVzW3Byb3BlcnR5XTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIHJldHVybiB0aGlzOworICAgICAgICB9OworCisgICAgICAgIC8vIHd3dy5SVENNdWx0aUNvbm5lY3Rpb24ub3JnL2RvY3Mvb25NZWRpYUVycm9yLworICAgICAgICBjb25uZWN0aW9uLm9uTWVkaWFFcnJvciA9IGZ1bmN0aW9uKGV2ZW50KSB7CisgICAgICAgICAgICBlcnJvcignbmFtZScsIGV2ZW50Lm5hbWUpOworICAgICAgICAgICAgZXJyb3IoJ2NvbnN0cmFpbnROYW1lJywgdG9TdHIoZXZlbnQuY29uc3RyYWludE5hbWUpKTsKKyAgICAgICAgICAgIGVycm9yKCdtZXNzYWdlJywgZXZlbnQubWVzc2FnZSk7CisgICAgICAgICAgICBlcnJvcignb3JpZ2luYWwgc2Vzc2lvbicsIGV2ZW50LnNlc3Npb24pOworICAgICAgICB9OworCisgICAgICAgIC8vIHd3dy5SVENNdWx0aUNvbm5lY3Rpb24ub3JnL2RvY3MvdGFrZVNuYXBzaG90LworICAgICAgICBjb25uZWN0aW9uLnRha2VTbmFwc2hvdCA9IGZ1bmN0aW9uKHVzZXJpZCwgY2FsbGJhY2spIHsKKyAgICAgICAgICAgIHRha2VTbmFwc2hvdCh7CisgICAgICAgICAgICAgICAgdXNlcmlkOiB1c2VyaWQsCisgICAgICAgICAgICAgICAgY29ubmVjdGlvbjogY29ubmVjdGlvbiwKKyAgICAgICAgICAgICAgICBjYWxsYmFjazogY2FsbGJhY2sKKyAgICAgICAgICAgIH0pOworICAgICAgICB9OworCisgICAgICAgIGNvbm5lY3Rpb24uc2F2ZVRvRGlzayA9IGZ1bmN0aW9uKGJsb2IsIGZpbGVOYW1lKSB7CisgICAgICAgICAgICBpZiAoYmxvYi5zaXplICYmIGJsb2IudHlwZSkgRmlsZVNhdmVyLlNhdmVUb0Rpc2soVVJMLmNyZWF0ZU9iamVjdFVSTChibG9iKSwgZmlsZU5hbWUgfHwgYmxvYi5uYW1lIHx8IGJsb2IudHlwZS5yZXBsYWNlKCcvJywgJy0nKSArIGJsb2IudHlwZS5zcGxpdCgnLycpWzFdKTsKKyAgICAgICAgICAgIGVsc2UgRmlsZVNhdmVyLlNhdmVUb0Rpc2soYmxvYiwgZmlsZU5hbWUpOworICAgICAgICB9OworCisgICAgICAgIC8vIHd3dy5SVENNdWx0aUNvbm5lY3Rpb24ub3JnL2RvY3Mvc2VsZWN0RGV2aWNlcy8KKyAgICAgICAgY29ubmVjdGlvbi5zZWxlY3REZXZpY2VzID0gZnVuY3Rpb24oZGV2aWNlMSwgZGV2aWNlMikgeworICAgICAgICAgICAgaWYgKGRldmljZTEpIHNlbGVjdCh0aGlzLmRldmljZXNbZGV2aWNlMV0pOworICAgICAgICAgICAgaWYgKGRldmljZTIpIHNlbGVjdCh0aGlzLmRldmljZXNbZGV2aWNlMl0pOworCisgICAgICAgICAgICBmdW5jdGlvbiBzZWxlY3QoZGV2aWNlKSB7CisgICAgICAgICAgICAgICAgaWYgKCFkZXZpY2UpIHJldHVybjsKKyAgICAgICAgICAgICAgICBjb25uZWN0aW9uLl9tZWRpYVNvdXJjZXNbZGV2aWNlLmtpbmRdID0gZGV2aWNlLmlkOworICAgICAgICAgICAgfQorICAgICAgICB9OworCisgICAgICAgIC8vIHd3dy5SVENNdWx0aUNvbm5lY3Rpb24ub3JnL2RvY3MvZ2V0RGV2aWNlcy8KKyAgICAgICAgY29ubmVjdGlvbi5nZXREZXZpY2VzID0gZnVuY3Rpb24oY2FsbGJhY2spIHsKKyAgICAgICAgICAgIC8vIGlmLCBub3QgeWV0IGZldGNoZWQuCisgICAgICAgICAgICBpZiAoIURldGVjdFJUQy5NZWRpYURldmljZXMubGVuZ3RoKSB7CisgICAgICAgICAgICAgICAgcmV0dXJuIHNldFRpbWVvdXQoZnVuY3Rpb24oKSB7CisgICAgICAgICAgICAgICAgICAgIGNvbm5lY3Rpb24uZ2V0RGV2aWNlcyhjYWxsYmFjayk7CisgICAgICAgICAgICAgICAgfSwgMTAwMCk7CisgICAgICAgICAgICB9CisKKyAgICAgICAgICAgIC8vIGxvb3Agb3ZlciBhbGwgYXVkaW8vdmlkZW8gaW5wdXQvb3V0cHV0IGRldmljZXMKKyAgICAgICAgICAgIERldGVjdFJUQy5NZWRpYURldmljZXMuZm9yRWFjaChmdW5jdGlvbihkZXZpY2UpIHsKKyAgICAgICAgICAgICAgICBjb25uZWN0aW9uLmRldmljZXNbZGV2aWNlLmRldmljZUlkXSA9IGRldmljZTsKKyAgICAgICAgICAgIH0pOworCisgICAgICAgICAgICBpZiAoY2FsbGJhY2spIGNhbGxiYWNrKGNvbm5lY3Rpb24uZGV2aWNlcyk7CisgICAgICAgIH07CisKKyAgICAgICAgY29ubmVjdGlvbi5nZXRNZWRpYURldmljZXMgPSBjb25uZWN0aW9uLmVudW1lcmF0ZURldmljZXMgPSBmdW5jdGlvbihjYWxsYmFjaykgeworICAgICAgICAgICAgaWYgKCFjYWxsYmFjaykgdGhyb3cgJ2NhbGxiYWNrIGlzIG1hbmRhdG9yeS4nOworICAgICAgICAgICAgY29ubmVjdGlvbi5nZXREZXZpY2VzKGZ1bmN0aW9uKCkgeworICAgICAgICAgICAgICAgIGNhbGxiYWNrKGNvbm5lY3Rpb24uRGV0ZWN0UlRDLk1lZGlhRGV2aWNlcyk7CisgICAgICAgICAgICB9KTsKKyAgICAgICAgfTsKKworICAgICAgICAvLyB3d3cuUlRDTXVsdGlDb25uZWN0aW9uLm9yZy9kb2NzL29uQ3VzdG9tTWVzc2FnZS8KKyAgICAgICAgY29ubmVjdGlvbi5vbkN1c3RvbU1lc3NhZ2UgPSBmdW5jdGlvbihtZXNzYWdlKSB7CisgICAgICAgICAgICBsb2coJ0N1c3RvbSBtZXNzYWdlJywgbWVzc2FnZSk7CisgICAgICAgIH07CisKKyAgICAgICAgLy8gd3d3LlJUQ011bHRpQ29ubmVjdGlvbi5vcmcvZG9jcy9vbmRyb3AvCisgICAgICAgIGNvbm5lY3Rpb24ub25kcm9wID0gZnVuY3Rpb24oZHJvcHBlZEJ5KSB7CisgICAgICAgICAgICBsb2coJ01lZGlhIGNvbm5lY3Rpb24gaXMgZHJvcHBlZCBieSAnICsgZHJvcHBlZEJ5KTsKKyAgICAgICAgfTsKKworICAgICAgICAvLyB3d3cuUlRDTXVsdGlDb25uZWN0aW9uLm9yZy9kb2NzL2Ryb3AvCisgICAgICAgIGNvbm5lY3Rpb24uZHJvcCA9IGZ1bmN0aW9uKGNvbmZpZykgeworICAgICAgICAgICAgY29uZmlnID0gY29uZmlnIHx8IHt9OworICAgICAgICAgICAgY29ubmVjdGlvbi5hdHRhY2hTdHJlYW1zID0gW107CisKKyAgICAgICAgICAgIC8vICJkcm9wIiBzaG91bGQgZGV0YWNoIGFsbCBsb2NhbCBzdHJlYW1zCisgICAgICAgICAgICBmb3IgKHZhciBzdHJlYW0gaW4gY29ubmVjdGlvbi5zdHJlYW1zKSB7CisgICAgICAgICAgICAgICAgaWYgKGNvbm5lY3Rpb24uX3NraXAuaW5kZXhPZihzdHJlYW0pID09IC0xKSB7CisgICAgICAgICAgICAgICAgICAgIHN0cmVhbSA9IGNvbm5lY3Rpb24uc3RyZWFtc1tzdHJlYW1dOworICAgICAgICAgICAgICAgICAgICBpZiAoc3RyZWFtLnR5cGUgPT0gJ2xvY2FsJykgeworICAgICAgICAgICAgICAgICAgICAgICAgY29ubmVjdGlvbi5kZXRhY2hTdHJlYW1zLnB1c2goc3RyZWFtLnN0cmVhbWlkKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIG9uU3RyZWFtRW5kZWRIYW5kbGVyKHN0cmVhbSwgY29ubmVjdGlvbik7CisgICAgICAgICAgICAgICAgICAgIH0gZWxzZSBvblN0cmVhbUVuZGVkSGFuZGxlcihzdHJlYW0sIGNvbm5lY3Rpb24pOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0KKworICAgICAgICAgICAgLy8gd3d3LlJUQ011bHRpQ29ubmVjdGlvbi5vcmcvZG9jcy9zZW5kQ3VzdG9tTWVzc2FnZS8KKyAgICAgICAgICAgIGNvbm5lY3Rpb24uc2VuZEN1c3RvbU1lc3NhZ2UoeworICAgICAgICAgICAgICAgIGRyb3A6IHRydWUsCisgICAgICAgICAgICAgICAgZG9udFJlbmVnb3RpYXRlOiBpc051bGwoY29uZmlnLnJlbmVnb3RpYXRlKSA/IHRydWUgOiBjb25maWcucmVuZWdvdGlhdGUKKyAgICAgICAgICAgIH0pOworICAgICAgICB9OworCisgICAgICAgIC8vIHd3dy5SVENNdWx0aUNvbm5lY3Rpb24ub3JnL2RvY3MvVHJhbnNsYXRvci8KKyAgICAgICAgY29ubmVjdGlvbi5UcmFuc2xhdG9yID0geworICAgICAgICAgICAgVHJhbnNsYXRlVGV4dDogZnVuY3Rpb24odGV4dCwgY2FsbGJhY2spIHsKKyAgICAgICAgICAgICAgICAvLyBpZihsb2NhdGlvbi5wcm90b2NvbCA9PT0gJ2h0dHBzOicpIHJldHVybiBjYWxsYmFjayh0ZXh0KTsKKworICAgICAgICAgICAgICAgIHZhciBuZXdTY3JpcHQgPSBkb2N1bWVudC5jcmVhdGVFbGVtZW50KCdzY3JpcHQnKTsKKyAgICAgICAgICAgICAgICBuZXdTY3JpcHQudHlwZSA9ICd0ZXh0L2phdmFzY3JpcHQnOworCisgICAgICAgICAgICAgICAgdmFyIHNvdXJjZVRleHQgPSBlbmNvZGVVUklDb21wb25lbnQodGV4dCk7IC8vIGVzY2FwZQorCisgICAgICAgICAgICAgICAgdmFyIHJhbmRvbU51bWJlciA9ICdtZXRob2QnICsgY29ubmVjdGlvbi50b2tlbigpOworICAgICAgICAgICAgICAgIHdpbmRvd1tyYW5kb21OdW1iZXJdID0gZnVuY3Rpb24ocmVzcG9uc2UpIHsKKyAgICAgICAgICAgICAgICAgICAgaWYgKHJlc3BvbnNlLmRhdGEgJiYgcmVzcG9uc2UuZGF0YS50cmFuc2xhdGlvbnNbMF0gJiYgY2FsbGJhY2spIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIGNhbGxiYWNrKHJlc3BvbnNlLmRhdGEudHJhbnNsYXRpb25zWzBdLnRyYW5zbGF0ZWRUZXh0KTsKKyAgICAgICAgICAgICAgICAgICAgfQorCisgICAgICAgICAgICAgICAgICAgIGlmIChyZXNwb25zZS5lcnJvciAmJiByZXNwb25zZS5lcnJvci5tZXNzYWdlID09ICdEYWlseSBMaW1pdCBFeGNlZWRlZCcpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIHdhcm4oJ1RleHQgdHJhbnNsYXRpb24gZmFpbGVkLiBFcnJvciBtZXNzYWdlOiAiRGFpbHkgTGltaXQgRXhjZWVkZWQuIicpOworCisgICAgICAgICAgICAgICAgICAgICAgICAvLyByZXR1cm5pbmcgb3JpZ2luYWwgdGV4dAorICAgICAgICAgICAgICAgICAgICAgICAgY2FsbGJhY2sodGV4dCk7CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICB9OworCisgICAgICAgICAgICAgICAgdmFyIHNvdXJjZSA9ICdodHRwczovL3d3dy5nb29nbGVhcGlzLmNvbS9sYW5ndWFnZS90cmFuc2xhdGUvdjI/a2V5PScgKyBjb25uZWN0aW9uLmdvb2dLZXkgKyAnJnRhcmdldD0nICsgKGNvbm5lY3Rpb24ubGFuZ3VhZ2UgfHwgJ2VuLVVTJykgKyAnJmNhbGxiYWNrPXdpbmRvdy4nICsgcmFuZG9tTnVtYmVyICsgJyZxPScgKyBzb3VyY2VUZXh0OworICAgICAgICAgICAgICAgIG5ld1NjcmlwdC5zcmMgPSBzb3VyY2U7CisgICAgICAgICAgICAgICAgZG9jdW1lbnQuZ2V0RWxlbWVudHNCeVRhZ05hbWUoJ2hlYWQnKVswXS5hcHBlbmRDaGlsZChuZXdTY3JpcHQpOworICAgICAgICAgICAgfQorICAgICAgICB9OworCisgICAgICAgIC8vIHlvdSBjYW4gZWFzaWx5IG92ZXJyaWRlIGl0IGJ5IHNldHRpbmcgaXQgTlVMTCEKKyAgICAgICAgY29ubmVjdGlvbi5zZXREZWZhdWx0RXZlbnRzRm9yTWVkaWFFbGVtZW50ID0gZnVuY3Rpb24obWVkaWFFbGVtZW50LCBzdHJlYW1pZCkgeworICAgICAgICAgICAgbWVkaWFFbGVtZW50Lm9ucGF1c2UgPSBmdW5jdGlvbigpIHsKKyAgICAgICAgICAgICAgICBpZiAoY29ubmVjdGlvbi5zdHJlYW1zW3N0cmVhbWlkXSAmJiAhY29ubmVjdGlvbi5zdHJlYW1zW3N0cmVhbWlkXS5tdXRlZCkgeworICAgICAgICAgICAgICAgICAgICBjb25uZWN0aW9uLnN0cmVhbXNbc3RyZWFtaWRdLm11dGUoKTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9OworCisgICAgICAgICAgICAvLyB0b2RvOiBuZWVkIHRvIG1ha2Ugc3VyZSB0aGF0ICJvbnBsYXkiIEVWRU5UIGRvZXNuJ3QgcGxheSBzZWxmLXZvaWNlIQorICAgICAgICAgICAgbWVkaWFFbGVtZW50Lm9ucGxheSA9IGZ1bmN0aW9uKCkgeworICAgICAgICAgICAgICAgIGlmIChjb25uZWN0aW9uLnN0cmVhbXNbc3RyZWFtaWRdICYmIGNvbm5lY3Rpb24uc3RyZWFtc1tzdHJlYW1pZF0ubXV0ZWQpIHsKKyAgICAgICAgICAgICAgICAgICAgY29ubmVjdGlvbi5zdHJlYW1zW3N0cmVhbWlkXS51bm11dGUoKTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9OworCisgICAgICAgICAgICB2YXIgdm9sdW1lQ2hhbmdlRXZlbnRGaXJlZCA9IGZhbHNlOworICAgICAgICAgICAgbWVkaWFFbGVtZW50Lm9udm9sdW1lY2hhbmdlID0gZnVuY3Rpb24oKSB7CisgICAgICAgICAgICAgICAgaWYgKCF2b2x1bWVDaGFuZ2VFdmVudEZpcmVkKSB7CisgICAgICAgICAgICAgICAgICAgIHZvbHVtZUNoYW5nZUV2ZW50RmlyZWQgPSB0cnVlOworICAgICAgICAgICAgICAgICAgICBjb25uZWN0aW9uLnN0cmVhbXNbc3RyZWFtaWRdICYmIHNldFRpbWVvdXQoZnVuY3Rpb24oKSB7CisgICAgICAgICAgICAgICAgICAgICAgICB2YXIgcm9vdCA9IGNvbm5lY3Rpb24uc3RyZWFtc1tzdHJlYW1pZF07CisgICAgICAgICAgICAgICAgICAgICAgICBjb25uZWN0aW9uLnN0cmVhbXNbc3RyZWFtaWRdLnNvY2tldHMuZm9yRWFjaChmdW5jdGlvbihzb2NrZXQpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBzb2NrZXQuc2VuZCh7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHN0cmVhbWlkOiByb290LnN0cmVhbWlkLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpc1ZvbHVtZUNoYW5nZWQ6IHRydWUsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZvbHVtZTogbWVkaWFFbGVtZW50LnZvbHVtZQorICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0pOworICAgICAgICAgICAgICAgICAgICAgICAgfSk7CisgICAgICAgICAgICAgICAgICAgICAgICB2b2x1bWVDaGFuZ2VFdmVudEZpcmVkID0gZmFsc2U7CisgICAgICAgICAgICAgICAgICAgIH0sIDIwMDApOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH07CisgICAgICAgIH07CisKKyAgICAgICAgLy8gd3d3LlJUQ011bHRpQ29ubmVjdGlvbi5vcmcvZG9jcy9vbk1lZGlhRmlsZS8KKyAgICAgICAgY29ubmVjdGlvbi5vbk1lZGlhRmlsZSA9IGZ1bmN0aW9uKGUpIHsKKyAgICAgICAgICAgIGxvZygnb25NZWRpYUZpbGUnLCBlKTsKKyAgICAgICAgICAgIGNvbm5lY3Rpb24uYm9keS5hcHBlbmRDaGlsZChlLm1lZGlhRWxlbWVudCk7CisgICAgICAgIH07CisKKyAgICAgICAgLy8gd3d3LlJUQ011bHRpQ29ubmVjdGlvbi5vcmcvZG9jcy9zaGFyZU1lZGlhRmlsZS8KKyAgICAgICAgLy8gdGhpcyBtZXRob2QgaGFuZGxlcyBwcmUtcmVjb3JkZWQgbWVkaWEgc3RyZWFtaW5nCisgICAgICAgIGNvbm5lY3Rpb24uc2hhcmVNZWRpYUZpbGUgPSBmdW5jdGlvbihmaWxlLCB2aWRlbywgc3RyZWFtZXJpZCkgeworICAgICAgICAgICAgc3RyZWFtZXJpZCA9IHN0cmVhbWVyaWQgfHwgY29ubmVjdGlvbi50b2tlbigpOworCisgICAgICAgICAgICBpZiAoIVByZVJlY29yZGVkTWVkaWFTdHJlYW1lcikgeworICAgICAgICAgICAgICAgIGxvYWRTY3JpcHQoY29ubmVjdGlvbi5yZXNvdXJjZXMuUHJlUmVjb3JkZWRNZWRpYVN0cmVhbWVyLCBmdW5jdGlvbigpIHsKKyAgICAgICAgICAgICAgICAgICAgY29ubmVjdGlvbi5zaGFyZU1lZGlhRmlsZShmaWxlLCB2aWRlbywgc3RyZWFtZXJpZCk7CisgICAgICAgICAgICAgICAgfSk7CisgICAgICAgICAgICAgICAgcmV0dXJuIHN0cmVhbWVyaWQ7CisgICAgICAgICAgICB9CisKKyAgICAgICAgICAgIHJldHVybiBQcmVSZWNvcmRlZE1lZGlhU3RyZWFtZXIuc2hhcmVNZWRpYUZpbGUoeworICAgICAgICAgICAgICAgIGZpbGU6IGZpbGUsCisgICAgICAgICAgICAgICAgdmlkZW86IHZpZGVvLAorICAgICAgICAgICAgICAgIHN0cmVhbWVyaWQ6IHN0cmVhbWVyaWQsCisgICAgICAgICAgICAgICAgY29ubmVjdGlvbjogY29ubmVjdGlvbgorICAgICAgICAgICAgfSk7CisgICAgICAgIH07CisKKyAgICAgICAgLy8gd3d3LlJUQ011bHRpQ29ubmVjdGlvbi5vcmcvZG9jcy9vbnBhcnRvZnNjcmVlbi8KKyAgICAgICAgY29ubmVjdGlvbi5vbnBhcnRvZnNjcmVlbiA9IGZ1bmN0aW9uKGUpIHsKKyAgICAgICAgICAgIHZhciBpbWFnZSA9IGRvY3VtZW50LmNyZWF0ZUVsZW1lbnQoJ2ltZycpOworICAgICAgICAgICAgaW1hZ2Uuc3JjID0gZS5zY3JlZW5zaG90OworICAgICAgICAgICAgY29ubmVjdGlvbi5ib2R5LmFwcGVuZENoaWxkKGltYWdlKTsKKyAgICAgICAgfTsKKworICAgICAgICBjb25uZWN0aW9uLnNraXBMb2dzID0gZnVuY3Rpb24oKSB7CisgICAgICAgICAgICBsb2cgPSBlcnJvciA9IHdhcm4gPSBmdW5jdGlvbigpIHt9OworICAgICAgICB9OworCisgICAgICAgIC8vIHd3dy5SVENNdWx0aUNvbm5lY3Rpb24ub3JnL2RvY3MvaG9sZC8KKyAgICAgICAgY29ubmVjdGlvbi5ob2xkID0gZnVuY3Rpb24obUxpbmUpIHsKKyAgICAgICAgICAgIGZvciAodmFyIHBlZXIgaW4gY29ubmVjdGlvbi5wZWVycykgeworICAgICAgICAgICAgICAgIGNvbm5lY3Rpb24ucGVlcnNbcGVlcl0uaG9sZChtTGluZSk7CisgICAgICAgICAgICB9CisgICAgICAgIH07CisKKyAgICAgICAgLy8gd3d3LlJUQ011bHRpQ29ubmVjdGlvbi5vcmcvZG9jcy9vbmhvbGQvCisgICAgICAgIGNvbm5lY3Rpb24ub25ob2xkID0gZnVuY3Rpb24odHJhY2spIHsKKyAgICAgICAgICAgIGxvZygnb25ob2xkJywgdHJhY2spOworCisgICAgICAgICAgICBpZiAodHJhY2sua2luZCAhPSAnYXVkaW8nKSB7CisgICAgICAgICAgICAgICAgdHJhY2subWVkaWFFbGVtZW50LnBhdXNlKCk7CisgICAgICAgICAgICAgICAgdHJhY2subWVkaWFFbGVtZW50LnNldEF0dHJpYnV0ZSgncG9zdGVyJywgdHJhY2suc2NyZWVuc2hvdCB8fCBjb25uZWN0aW9uLnJlc291cmNlcy5tdXRlZCk7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBpZiAodHJhY2sua2luZCA9PSAnYXVkaW8nKSB7CisgICAgICAgICAgICAgICAgdHJhY2subWVkaWFFbGVtZW50Lm11dGVkID0gdHJ1ZTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfTsKKworICAgICAgICAvLyB3d3cuUlRDTXVsdGlDb25uZWN0aW9uLm9yZy9kb2NzL3VuaG9sZC8KKyAgICAgICAgY29ubmVjdGlvbi51bmhvbGQgPSBmdW5jdGlvbihtTGluZSkgeworICAgICAgICAgICAgZm9yICh2YXIgcGVlciBpbiBjb25uZWN0aW9uLnBlZXJzKSB7CisgICAgICAgICAgICAgICAgY29ubmVjdGlvbi5wZWVyc1twZWVyXS51bmhvbGQobUxpbmUpOworICAgICAgICAgICAgfQorICAgICAgICB9OworCisgICAgICAgIC8vIHd3dy5SVENNdWx0aUNvbm5lY3Rpb24ub3JnL2RvY3Mvb251bmhvbGQvCisgICAgICAgIGNvbm5lY3Rpb24ub251bmhvbGQgPSBmdW5jdGlvbih0cmFjaykgeworICAgICAgICAgICAgbG9nKCdvbnVuaG9sZCcsIHRyYWNrKTsKKworICAgICAgICAgICAgaWYgKHRyYWNrLmtpbmQgIT0gJ2F1ZGlvJykgeworICAgICAgICAgICAgICAgIHRyYWNrLm1lZGlhRWxlbWVudC5wbGF5KCk7CisgICAgICAgICAgICAgICAgdHJhY2subWVkaWFFbGVtZW50LnJlbW92ZUF0dHJpYnV0ZSgncG9zdGVyJyk7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBpZiAodHJhY2sua2luZCAhPSAnYXVkaW8nKSB7CisgICAgICAgICAgICAgICAgdHJhY2subWVkaWFFbGVtZW50Lm11dGVkID0gZmFsc2U7CisgICAgICAgICAgICB9CisgICAgICAgIH07CisKKyAgICAgICAgY29ubmVjdGlvbi5zaGFyZVBhcnRPZlNjcmVlbiA9IGZ1bmN0aW9uKGFyZ3MpIHsKKyAgICAgICAgICAgIHZhciBsYXN0U2NyZWVuc2hvdCA9ICcnOworCisgICAgICAgICAgICBmdW5jdGlvbiBwYXJ0T2ZTY3JlZW5DYXB0dXJlcigpIHsKKyAgICAgICAgICAgICAgICAvLyBpZiBzdG9wcGVkCisgICAgICAgICAgICAgICAgaWYgKGNvbm5lY3Rpb24ucGFydE9mU2NyZWVuICYmICFjb25uZWN0aW9uLnBhcnRPZlNjcmVlbi5zaGFyaW5nKSB7CisgICAgICAgICAgICAgICAgICAgIHJldHVybjsKKyAgICAgICAgICAgICAgICB9CisKKyAgICAgICAgICAgICAgICBjYXB0dXJlUGFydE9mU2NyZWVuKHsKKyAgICAgICAgICAgICAgICAgICAgZWxlbWVudDogYXJncy5lbGVtZW50LAorICAgICAgICAgICAgICAgICAgICBjb25uZWN0aW9uOiBjb25uZWN0aW9uLAorICAgICAgICAgICAgICAgICAgICBjYWxsYmFjazogZnVuY3Rpb24oc2NyZWVuc2hvdCkgeworICAgICAgICAgICAgICAgICAgICAgICAgLy8gZG9uJ3Qgc2hhcmUgcmVwZWF0ZWQgY29udGVudAorICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHNjcmVlbnNob3QgIT0gbGFzdFNjcmVlbnNob3QpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBsYXN0U2NyZWVuc2hvdCA9IHNjcmVlbnNob3Q7CisKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBmb3IgKHZhciBjaGFubmVsIGluIGNvbm5lY3Rpb24uY2hhbm5lbHMpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY29ubmVjdGlvbi5jaGFubmVsc1tjaGFubmVsXS5zZW5kKHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNjcmVlbnNob3Q6IHNjcmVlbnNob3QsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpc1BhcnRPZlNjcmVlbjogdHJ1ZQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9KTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICB9CisKKyAgICAgICAgICAgICAgICAgICAgICAgIC8vICJvbmNlIiBjYW4gYmUgdXNlZCB0byBzaGFyZSBzaW5nbGUgc2NyZWVuc2hvdAorICAgICAgICAgICAgICAgICAgICAgICAgIWFyZ3Mub25jZSAmJiBzZXRUaW1lb3V0KHBhcnRPZlNjcmVlbkNhcHR1cmVyLCBhcmdzLmludGVydmFsIHx8IDIwMCk7CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICB9KTsKKyAgICAgICAgICAgIH0KKworICAgICAgICAgICAgcGFydE9mU2NyZWVuQ2FwdHVyZXIoKTsKKworICAgICAgICAgICAgY29ubmVjdGlvbi5wYXJ0T2ZTY3JlZW4gPSBtZXJnZSh7CisgICAgICAgICAgICAgICAgc2hhcmluZzogdHJ1ZQorICAgICAgICAgICAgfSwgYXJncyk7CisgICAgICAgIH07CisKKyAgICAgICAgY29ubmVjdGlvbi5wYXVzZVBhcnRPZlNjcmVlblNoYXJpbmcgPSBmdW5jdGlvbigpIHsKKyAgICAgICAgICAgIGZvciAodmFyIHBlZXIgaW4gY29ubmVjdGlvbi5wZWVycykgeworICAgICAgICAgICAgICAgIGNvbm5lY3Rpb24ucGVlcnNbcGVlcl0ucGF1c2VQYXJ0T2ZTY3JlZW5TaGFyaW5nID0gdHJ1ZTsKKyAgICAgICAgICAgIH0KKworICAgICAgICAgICAgaWYgKGNvbm5lY3Rpb24ucGFydE9mU2NyZWVuKSB7CisgICAgICAgICAgICAgICAgY29ubmVjdGlvbi5wYXJ0T2ZTY3JlZW4uc2hhcmluZyA9IGZhbHNlOworICAgICAgICAgICAgfQorICAgICAgICB9OworCisgICAgICAgIGNvbm5lY3Rpb24ucmVzdW1lUGFydE9mU2NyZWVuU2hhcmluZyA9IGZ1bmN0aW9uKCkgeworICAgICAgICAgICAgZm9yICh2YXIgcGVlciBpbiBjb25uZWN0aW9uLnBlZXJzKSB7CisgICAgICAgICAgICAgICAgY29ubmVjdGlvbi5wZWVyc1twZWVyXS5wYXVzZVBhcnRPZlNjcmVlblNoYXJpbmcgPSBmYWxzZTsKKyAgICAgICAgICAgIH0KKworICAgICAgICAgICAgaWYgKGNvbm5lY3Rpb24ucGFydE9mU2NyZWVuKSB7CisgICAgICAgICAgICAgICAgY29ubmVjdGlvbi5wYXJ0T2ZTY3JlZW4uc2hhcmluZyA9IHRydWU7CisgICAgICAgICAgICB9CisgICAgICAgIH07CisKKyAgICAgICAgY29ubmVjdGlvbi5zdG9wUGFydE9mU2NyZWVuU2hhcmluZyA9IGZ1bmN0aW9uKCkgeworICAgICAgICAgICAgZm9yICh2YXIgcGVlciBpbiBjb25uZWN0aW9uLnBlZXJzKSB7CisgICAgICAgICAgICAgICAgY29ubmVjdGlvbi5wZWVyc1twZWVyXS5zdG9wUGFydE9mU2NyZWVuU2hhcmluZyA9IHRydWU7CisgICAgICAgICAgICB9CisKKyAgICAgICAgICAgIGlmIChjb25uZWN0aW9uLnBhcnRPZlNjcmVlbikgeworICAgICAgICAgICAgICAgIGNvbm5lY3Rpb24ucGFydE9mU2NyZWVuLnNoYXJpbmcgPSBmYWxzZTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfTsKKworICAgICAgICBjb25uZWN0aW9uLnRha2VTY3JlZW5zaG90ID0gZnVuY3Rpb24oZWxlbWVudCwgY2FsbGJhY2spIHsKKyAgICAgICAgICAgIGlmICghZWxlbWVudCB8fCAhY2FsbGJhY2spIHRocm93ICdJbnZhbGlkIG51bWJlciBvZiBhcmd1bWVudHMuJzsKKworICAgICAgICAgICAgaWYgKCF3aW5kb3cuaHRtbDJjYW52YXMpIHsKKyAgICAgICAgICAgICAgICByZXR1cm4gbG9hZFNjcmlwdChjb25uZWN0aW9uLnJlc291cmNlcy5odG1sMmNhbnZhcywgZnVuY3Rpb24oKSB7CisgICAgICAgICAgICAgICAgICAgIGNvbm5lY3Rpb24udGFrZVNjcmVlbnNob3QoZWxlbWVudCk7CisgICAgICAgICAgICAgICAgfSk7CisgICAgICAgICAgICB9CisKKyAgICAgICAgICAgIGlmIChpc1N0cmluZyhlbGVtZW50KSkgeworICAgICAgICAgICAgICAgIGVsZW1lbnQgPSBkb2N1bWVudC5xdWVyeVNlbGVjdG9yKGVsZW1lbnQpOworICAgICAgICAgICAgICAgIGlmICghZWxlbWVudCkgZWxlbWVudCA9IGRvY3VtZW50LmdldEVsZW1lbnRCeUlkKGVsZW1lbnQpOworICAgICAgICAgICAgfQorICAgICAgICAgICAgaWYgKCFlbGVtZW50KSB0aHJvdyAnSFRNTCBFbGVtZW50IGlzIGluYWNjZXNzaWJsZSEnOworCisgICAgICAgICAgICAvLyBodG1sMmNhbnZhcy5qcyBpcyB1c2VkIHRvIHRha2Ugc2NyZWVuc2hvdHMKKyAgICAgICAgICAgIGh0bWwyY2FudmFzKGVsZW1lbnQsIHsKKyAgICAgICAgICAgICAgICBvbnJlbmRlcmVkOiBmdW5jdGlvbihjYW52YXMpIHsKKyAgICAgICAgICAgICAgICAgICAgY2FsbGJhY2soY2FudmFzLnRvRGF0YVVSTCgpKTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9KTsKKyAgICAgICAgfTsKKworICAgICAgICAvLyB0aGlzIGV2ZW50IGlzIGZpcmVkIHdoZW4gUlRDTXVsdGlDb25uZWN0aW9uIGRldGVjdHMgdGhhdCBjaHJvbWUgZXh0ZW5zaW9uCisgICAgICAgIC8vIGZvciBzY3JlZW4gY2FwdHVyaW5nIGlzIGluc3RhbGxlZCBhbmQgYXZhaWxhYmxlCisgICAgICAgIGNvbm5lY3Rpb24ub25TY3JlZW5DYXB0dXJpbmdFeHRlbnNpb25BdmFpbGFibGUgPSBmdW5jdGlvbigpIHsKKyAgICAgICAgICAgIGxvZygnSXQgc2VlbXMgdGhhdCBzY3JlZW4gY2FwdHVyaW5nIGV4dGVuc2lvbiBpcyBpbnN0YWxsZWQgYW5kIGF2YWlsYWJsZSBvbiB5b3VyIHN5c3RlbSEnKTsKKyAgICAgICAgfTsKKworICAgICAgICBpZiAoIWlzUGx1Z2luUlRDICYmIERldGVjdFJUQy5zY3JlZW4ub25TY3JlZW5DYXB0dXJpbmdFeHRlbnNpb25BdmFpbGFibGUpIHsKKyAgICAgICAgICAgIERldGVjdFJUQy5zY3JlZW4ub25TY3JlZW5DYXB0dXJpbmdFeHRlbnNpb25BdmFpbGFibGUgPSBmdW5jdGlvbigpIHsKKyAgICAgICAgICAgICAgICBjb25uZWN0aW9uLm9uU2NyZWVuQ2FwdHVyaW5nRXh0ZW5zaW9uQXZhaWxhYmxlKCk7CisgICAgICAgICAgICB9OworICAgICAgICB9CisKKyAgICAgICAgY29ubmVjdGlvbi5jaGFuZ2VCYW5kd2lkdGggPSBmdW5jdGlvbihiYW5kd2lkdGgpIHsKKyAgICAgICAgICAgIGZvciAodmFyIHBlZXIgaW4gY29ubmVjdGlvbi5wZWVycykgeworICAgICAgICAgICAgICAgIGNvbm5lY3Rpb24ucGVlcnNbcGVlcl0uY2hhbmdlQmFuZHdpZHRoKGJhbmR3aWR0aCk7CisgICAgICAgICAgICB9CisgICAgICAgIH07CisKKyAgICAgICAgY29ubmVjdGlvbi5jb252ZXJ0VG9BdWRpb1N0cmVhbSA9IGZ1bmN0aW9uKG1lZGlhU3RyZWFtKSB7CisgICAgICAgICAgICBjb252ZXJ0VG9BdWRpb1N0cmVhbShtZWRpYVN0cmVhbSk7CisgICAgICAgIH07CisKKyAgICAgICAgY29ubmVjdGlvbi5vbnN0YXRlY2hhbmdlID0gZnVuY3Rpb24oc3RhdGUpIHsKKyAgICAgICAgICAgIGxvZygnb246c3RhdGU6Y2hhbmdlICgnICsgc3RhdGUudXNlcmlkICsgJyk6Jywgc3RhdGUubmFtZSArICc6Jywgc3RhdGUucmVhc29uIHx8ICcnKTsKKyAgICAgICAgfTsKKworICAgICAgICBjb25uZWN0aW9uLm9uZmFpbGVkID0gZnVuY3Rpb24oZXZlbnQpIHsKKyAgICAgICAgICAgIGlmICghZXZlbnQucGVlci5udW1PZlJldHJpZXMpIGV2ZW50LnBlZXIubnVtT2ZSZXRyaWVzID0gMDsKKyAgICAgICAgICAgIGV2ZW50LnBlZXIubnVtT2ZSZXRyaWVzKys7CisKKyAgICAgICAgICAgIGVycm9yKCdJQ0UgY29ubmVjdGl2aXR5IGNoZWNrIGlzIGZhaWxlZC4gUmVuZWdvdGlhdGluZyBwZWVyIGNvbm5lY3Rpb24uJyk7CisgICAgICAgICAgICBldmVudC5wZWVyLm51bU9mUmV0cmllcyA8IDIgJiYgZXZlbnQucGVlci5yZW5lZ290aWF0ZSgpOworCisgICAgICAgICAgICBpZiAoZXZlbnQucGVlci5udW1PZlJldHJpZXMgPj0gMikgZXZlbnQucGVlci5udW1PZlJldHJpZXMgPSAwOworICAgICAgICB9OworCisgICAgICAgIGNvbm5lY3Rpb24ub25jb25uZWN0ZWQgPSBmdW5jdGlvbihldmVudCkgeworICAgICAgICAgICAgLy8gZXZlbnQucGVlci5hZGRTdHJlYW0gfHwgZXZlbnQucGVlci5nZXRDb25uZWN0aW9uU3RhdHMKKyAgICAgICAgICAgIGxvZygnUGVlciBjb25uZWN0aW9uIGhhcyBiZWVuIGVzdGFibGlzaGVkIGJldHdlZW4geW91IGFuZCcsIGV2ZW50LnVzZXJpZCk7CisgICAgICAgIH07CisKKyAgICAgICAgY29ubmVjdGlvbi5vbmRpc2Nvbm5lY3RlZCA9IGZ1bmN0aW9uKGV2ZW50KSB7CisgICAgICAgICAgICBlcnJvcignUGVlciBjb25uZWN0aW9uIHNlZW1zIGhhcyBiZWVuIGRpc2Nvbm5lY3RlZCBiZXR3ZWVuIHlvdSBhbmQnLCBldmVudC51c2VyaWQpOworCisgICAgICAgICAgICBpZiAoaXNFbXB0eShjb25uZWN0aW9uLmNoYW5uZWxzKSkgcmV0dXJuOworICAgICAgICAgICAgaWYgKCFjb25uZWN0aW9uLmNoYW5uZWxzW2V2ZW50LnVzZXJpZF0pIHJldHVybjsKKworICAgICAgICAgICAgLy8gdXNlIFdlYlJUQyBkYXRhIGNoYW5uZWxzIHRvIGRldGVjdCB1c2VyJ3MgcHJlc2VuY2UKKyAgICAgICAgICAgIGNvbm5lY3Rpb24uY2hhbm5lbHNbZXZlbnQudXNlcmlkXS5zZW5kKHsKKyAgICAgICAgICAgICAgICBjaGVja2luZ1ByZXNlbmNlOiB0cnVlCisgICAgICAgICAgICB9KTsKKworICAgICAgICAgICAgLy8gd2FpdCA1IHNlY29uZHMsIGlmIHRhcmdldCBwZWVyIGRpZG4ndCByZXNwb25zZSwgc2ltcGx5IGRpc2Nvbm5lY3QKKyAgICAgICAgICAgIHNldFRpbWVvdXQoZnVuY3Rpb24oKSB7CisgICAgICAgICAgICAgICAgLy8gaWNlQ29ubmVjdGlvblN0YXRlID09ICdkaXNjb25uZWN0ZWQnIG9jY3VycmVkIG91dCBvZiBsb3ctYmFuZHdpZHRoCisgICAgICAgICAgICAgICAgLy8gb3IgaW50ZXJuZXQgY29ubmVjdGl2aXR5IGlzc3VlcworICAgICAgICAgICAgICAgIGlmIChjb25uZWN0aW9uLnBlZXJzW2V2ZW50LnVzZXJpZF0uY29ubmVjdGVkKSB7CisgICAgICAgICAgICAgICAgICAgIGRlbGV0ZSBjb25uZWN0aW9uLnBlZXJzW2V2ZW50LnVzZXJpZF0uY29ubmVjdGVkOworICAgICAgICAgICAgICAgICAgICByZXR1cm47CisgICAgICAgICAgICAgICAgfQorCisgICAgICAgICAgICAgICAgLy8gdG8gbWFrZSBzdXJlIHRoaXMgdXNlcidzIGFsbCByZW1vdGUgc3RyZWFtcyBhcmUgcmVtb3ZlZC4KKyAgICAgICAgICAgICAgICBjb25uZWN0aW9uLnN0cmVhbXMucmVtb3ZlKHsKKyAgICAgICAgICAgICAgICAgICAgcmVtb3RlOiB0cnVlLAorICAgICAgICAgICAgICAgICAgICB1c2VyaWQ6IGV2ZW50LnVzZXJpZAorICAgICAgICAgICAgICAgIH0pOworCisgICAgICAgICAgICAgICAgY29ubmVjdGlvbi5yZW1vdmUoZXZlbnQudXNlcmlkKTsKKyAgICAgICAgICAgIH0sIDMwMDApOworICAgICAgICB9OworCisgICAgICAgIGNvbm5lY3Rpb24ub25zdHJlYW1pZCA9IGZ1bmN0aW9uKGV2ZW50KSB7CisgICAgICAgICAgICAvLyBldmVudC5pc1NjcmVlbiB8fCBldmVudC5pc1ZpZGVvIHx8IGV2ZW50LmlzQXVkaW8KKyAgICAgICAgICAgIGxvZygnZ290IHJlbW90ZSBzdHJlYW1pZCcsIGV2ZW50LnN0cmVhbWlkLCAnZnJvbScsIGV2ZW50LnVzZXJpZCk7CisgICAgICAgIH07CisKKyAgICAgICAgY29ubmVjdGlvbi5zdG9wTWVkaWFTdHJlYW0gPSBmdW5jdGlvbihtZWRpYVN0cmVhbSkgeworICAgICAgICAgICAgaWYgKCFtZWRpYVN0cmVhbSkgdGhyb3cgJ01lZGlhU3RyZWFtIGFyZ3VtZW50IGlzIG1hbmRhdG9yeS4nOworCisgICAgICAgICAgICBpZiAoY29ubmVjdGlvbi5rZWVwU3RyZWFtc09wZW5lZCkgeworICAgICAgICAgICAgICAgIGlmIChtZWRpYVN0cmVhbS5vbmVuZGVkKSBtZWRpYVN0cmVhbS5vbmVuZGVkKCk7CisgICAgICAgICAgICAgICAgcmV0dXJuOworICAgICAgICAgICAgfQorCisgICAgICAgICAgICAvLyByZW1vdmUgc3RyZWFtIGZyb20gImxvY2FsU3RyZWFtcyIgb2JqZWN0CisgICAgICAgICAgICAvLyB3aGVuIG5hdGl2ZS1zdG9wIG1ldGhvZCBpbnZva2VkLgorICAgICAgICAgICAgaWYgKGNvbm5lY3Rpb24ubG9jYWxTdHJlYW1zW21lZGlhU3RyZWFtLnN0cmVhbWlkXSkgeworICAgICAgICAgICAgICAgIGRlbGV0ZSBjb25uZWN0aW9uLmxvY2FsU3RyZWFtc1ttZWRpYVN0cmVhbS5zdHJlYW1pZF07CisgICAgICAgICAgICB9CisKKyAgICAgICAgICAgIGlmIChpc0ZpcmVmb3gpIHsKKyAgICAgICAgICAgICAgICAvLyBGaXJlZm94IGRvbid0IHlldCBzdXBwb3J0IG9uZW5kZWQgZm9yIGFueSBzdHJlYW0gKHJlbW90ZS9sb2NhbCkKKyAgICAgICAgICAgICAgICBpZiAobWVkaWFTdHJlYW0ub25lbmRlZCkgbWVkaWFTdHJlYW0ub25lbmRlZCgpOworICAgICAgICAgICAgfQorCisgICAgICAgICAgICAvLyBMYXRlc3QgZmlyZWZveCBkb2VzIHN1cHBvcnQgbWVkaWFTdHJlYW0uZ2V0QXVkaW9UcmFjayBidXQgZG9lc24ndCBzdXBwb3J0IHN0b3Agb24gTWVkaWFTdHJlYW1UcmFjaworICAgICAgICAgICAgdmFyIGNoZWNrRm9yTWVkaWFTdHJlYW1UcmFja1N0b3AgPSBCb29sZWFuKAorICAgICAgICAgICAgICAgIChtZWRpYVN0cmVhbS5nZXRBdWRpb1RyYWNrcyB8fCBtZWRpYVN0cmVhbS5nZXRWaWRlb1RyYWNrcykgJiYgKAorICAgICAgICAgICAgICAgICAgICAobWVkaWFTdHJlYW0uZ2V0QXVkaW9UcmFja3MoKVswXSAmJiAhbWVkaWFTdHJlYW0uZ2V0QXVkaW9UcmFja3MoKVswXS5zdG9wKSB8fAorICAgICAgICAgICAgICAgICAgICAobWVkaWFTdHJlYW0uZ2V0VmlkZW9UcmFja3MoKVswXSAmJiAhbWVkaWFTdHJlYW0uZ2V0VmlkZW9UcmFja3MoKVswXS5zdG9wKQorICAgICAgICAgICAgICAgICkKKyAgICAgICAgICAgICk7CisKKyAgICAgICAgICAgIGlmICghbWVkaWFTdHJlYW0uZ2V0QXVkaW9UcmFja3MgfHwgY2hlY2tGb3JNZWRpYVN0cmVhbVRyYWNrU3RvcCkgeworICAgICAgICAgICAgICAgIGlmIChtZWRpYVN0cmVhbS5zdG9wKSB7CisgICAgICAgICAgICAgICAgICAgIG1lZGlhU3RyZWFtLnN0b3AoKTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgcmV0dXJuOworICAgICAgICAgICAgfQorCisgICAgICAgICAgICBpZiAobWVkaWFTdHJlYW0uZ2V0QXVkaW9UcmFja3MoKS5sZW5ndGggJiYgbWVkaWFTdHJlYW0uZ2V0QXVkaW9UcmFja3MoKVswXS5zdG9wKSB7CisgICAgICAgICAgICAgICAgbWVkaWFTdHJlYW0uZ2V0QXVkaW9UcmFja3MoKS5mb3JFYWNoKGZ1bmN0aW9uKHRyYWNrKSB7CisgICAgICAgICAgICAgICAgICAgIHRyYWNrLnN0b3AoKTsKKyAgICAgICAgICAgICAgICB9KTsKKyAgICAgICAgICAgIH0KKworICAgICAgICAgICAgaWYgKG1lZGlhU3RyZWFtLmdldFZpZGVvVHJhY2tzKCkubGVuZ3RoICYmIG1lZGlhU3RyZWFtLmdldFZpZGVvVHJhY2tzKClbMF0uc3RvcCkgeworICAgICAgICAgICAgICAgIG1lZGlhU3RyZWFtLmdldFZpZGVvVHJhY2tzKCkuZm9yRWFjaChmdW5jdGlvbih0cmFjaykgeworICAgICAgICAgICAgICAgICAgICB0cmFjay5zdG9wKCk7CisgICAgICAgICAgICAgICAgfSk7CisgICAgICAgICAgICB9CisgICAgICAgIH07CisKKyAgICAgICAgY29ubmVjdGlvbi5jaGFuZ2VCYW5kd2lkdGggPSBmdW5jdGlvbihiYW5kd2lkdGgpIHsKKyAgICAgICAgICAgIGlmICghYmFuZHdpZHRoIHx8IGlzU3RyaW5nKGJhbmR3aWR0aCkgfHwgaXNFbXB0eShiYW5kd2lkdGgpKSB7CisgICAgICAgICAgICAgICAgdGhyb3cgJ0ludmFsaWQgImJhbmR3aWR0aCIgYXJndW1lbnRzLic7CisgICAgICAgICAgICB9CisKKyAgICAgICAgICAgIGZvckVhY2goY29ubmVjdGlvbi5wZWVycywgZnVuY3Rpb24ocGVlcikgeworICAgICAgICAgICAgICAgIHBlZXIucGVlci5iYW5kd2lkdGggPSBiYW5kd2lkdGg7CisgICAgICAgICAgICB9KTsKKworICAgICAgICAgICAgY29ubmVjdGlvbi5yZW5lZ290aWF0ZSgpOworICAgICAgICB9OworCisgICAgICAgIC8vIHd3dy5SVENNdW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ICAgICAgICAgIHdlYnNvY2tldC5vbm9wZW4gPSBmdW5jdGlvbigpIHsKKyAgICAgICAgICAgICAgICB3ZWJzb2NrZXQucHVzaChKU09OLnN0cmluZ2lmeSh7CisgICAgICAgICAgICAgICAgICAgIG9wZW46IHRydWUsCisgICAgICAgICAgICAgICAgICAgIGNoYW5uZWw6IGNvbmZpZy5jaGFubmVsCisgICAgICAgICAgICAgICAgfSkpOworICAgICAgICAgICAgICAgIGlmIChjb25maWcuY2FsbGJhY2spCisgICAgICAgICAgICAgICAgICAgIGNvbmZpZy5jYWxsYmFjayh3ZWJzb2NrZXQpOworICAgICAgICAgICAgfTsKKyAgICAgICAgICAgIHdlYnNvY2tldC5vbm1lc3NhZ2UgPSBmdW5jdGlvbihldmVudCkgeworICAgICAgICAgICAgICAgIGNvbmZpZy5vbm1lc3NhZ2UoSlNPTi5wYXJzZShldmVudC5kYXRhKSk7CisgICAgICAgICAgICB9OworICAgICAgICAgICAgd2Vic29ja2V0LnB1c2ggPSB3ZWJzb2NrZXQuc2VuZDsKKyAgICAgICAgICAgIHdlYnNvY2tldC5zZW5kID0gZnVuY3Rpb24oZGF0YSkgeworICAgICAgICAgICAgICAgIHdlYnNvY2tldC5wdXNoKEpTT04uc3RyaW5naWZ5KHsKKyAgICAgICAgICAgICAgICAgICAgZGF0YTogZGF0YSwKKyAgICAgICAgICAgICAgICAgICAgY2hhbm5lbDogY29uZmlnLmNoYW5uZWwKKyAgICAgICAgICAgICAgICB9KSk7CisgICAgICAgICAgICB9OworICAgICAgICAgICAgCisgICAgICAgICAgICAvKgorICAgICAgICAgICAgLy8gbWFrZSBzdXJlIGZpcmViYXNlLmpzIGlzIGxvYWRlZAorICAgICAgICAgICAgaWYgKCF3aW5kb3cuRmlyZWJhc2UpIHsKKyAgICAgICAgICAgICAgICByZXR1cm4gbG9hZFNjcmlwdChjb25uZWN0aW9uLnJlc291cmNlcy5maXJlYmFzZSwgZnVuY3Rpb24oKSB7CisgICAgICAgICAgICAgICAgICAgIGNvbm5lY3Rpb24ub3BlblNpZ25hbGluZ0NoYW5uZWwoY29uZmlnKTsKKyAgICAgICAgICAgICAgICB9KTsKKyAgICAgICAgICAgIH0KKworICAgICAgICAgICAgdmFyIGNoYW5uZWwgPSBjb25maWcuY2hhbm5lbCB8fCBjb25uZWN0aW9uLmNoYW5uZWw7CisKKyAgICAgICAgICAgIGlmIChjb25uZWN0aW9uLmZpcmViYXNlKSB7CisgICAgICAgICAgICAgICAgLy8gZm9yIGN1c3RvbSBmaXJlYmFzZSBpbnN0YW5jZXMKKyAgICAgICAgICAgICAgICBjb25uZWN0aW9uLnJlc291cmNlcy5maXJlYmFzZWlvID0gY29ubmVjdGlvbi5yZXNvdXJjZXMuZmlyZWJhc2Vpby5yZXBsYWNlKCcvL2NoYXQuJywgJy8vJyArIGNvbm5lY3Rpb24uZmlyZWJhc2UgKyAnLicpOworICAgICAgICAgICAgfQorCisgICAgICAgICAgICB2YXIgZmlyZWJhc2UgPSBuZXcgRmlyZWJhc2UoY29ubmVjdGlvbi5yZXNvdXJjZXMuZmlyZWJhc2VpbyArIGNoYW5uZWwpOworICAgICAgICAgICAgZmlyZWJhc2UuY2hhbm5lbCA9IGNoYW5uZWw7CisgICAgICAgICAgICBmaXJlYmFzZS5vbignY2hpbGRfYWRkZWQnLCBmdW5jdGlvbihkYXRhKSB7CisgICAgICAgICAgICAgICAgY29uZmlnLm9ubWVzc2FnZShkYXRhLnZhbCgpKTsKKyAgICAgICAgICAgIH0pOworCisgICAgICAgICAgICBmaXJlYmFzZS5zZW5kID0gZnVuY3Rpb24oZGF0YSkgeworICAgICAgICAgICAgICAgIC8vIGEgcXVpY2sgZGlydHkgd29ya2Fyb3VuZCB0byBtYWtlIHN1cmUgZmlyZWJhc2UKKyAgICAgICAgICAgICAgICAvLyBzaG91bGRuJ3QgZmFpbCBmb3IgTlVMTCB2YWx1ZXMuCisgICAgICAgICAgICAgICAgZm9yICh2YXIgcHJvcCBpbiBkYXRhKSB7CisgICAgICAgICAgICAgICAgICAgIGlmIChpc051bGwoZGF0YVtwcm9wXSkgfHwgdHlwZW9mIGRhdGFbcHJvcF0gPT0gJ2Z1bmN0aW9uJykgeworICAgICAgICAgICAgICAgICAgICAgICAgZGF0YVtwcm9wXSA9IGZhbHNlOworICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgfQorCisgICAgICAgICAgICAgICAgdGhpcy5wdXNoKGRhdGEpOworICAgICAgICAgICAgfTsKKworICAgICAgICAgICAgaWYgKCFjb25uZWN0aW9uLnNvY2tldCkKKyAgICAgICAgICAgICAgICBjb25uZWN0aW9uLnNvY2tldCA9IGZpcmViYXNlOworCisgICAgICAgICAgICBmaXJlYmFzZS5vbkRpc2Nvbm5lY3QoKS5yZW1vdmUoKTsKKworICAgICAgICAgICAgc2V0VGltZW91dChmdW5jdGlvbigpIHsKKyAgICAgICAgICAgICAgICBjb25maWcuY2FsbGJhY2soZmlyZWJhc2UpOworICAgICAgICAgICAgfSwgMSk7CisgICAgICAgICAgICAKKyAgICAgICAgICAgICovCisgICAgICAgICAgICAvLyBDVVNUT00gQ09ERSAvLworICAgICAgICAgICAgCisgICAgICAgIH07CisKKyAgICAgICAgY29ubmVjdGlvbi5QbHVnaW4gPSBQbHVnaW47CisgICAgfQorCit9KSgpOwpcIE5vIG5ld2xpbmUgYXQgZW5kIG9mIGZpbGUKZGlmZiAtLWdpdCBhL2Vjb21wLXBvcnRhbC1CRS93YXIvc3RhdGljL2Z1c2lvbi93ZWJydGMvanMvcGVlckJyb2FkY2FzdC5qcyBiL2Vjb21wLXBvcnRhbC1CRS93YXIvc3RhdGljL2Z1c2lvbi93ZWJydGMvanMvcGVlckJyb2FkY2FzdC5qcwpuZXcgZmlsZSBtb2RlIDEwMDY0NAppbmRleCAwMDAwMDAwLi42NWRhOGVmCi0tLSAvZGV2L251bGwKKysrIGIvZWNvbXAtcG9ydGFsLUJFL3dhci9zdGF0aWMvZnVzaW9uL3dlYnJ0Yy9qcy9wZWVyQnJvYWRjYXN0LmpzCkBAIC0wLDAgKzEsMTEzIEBACisvKi0KKyAqID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisgKiBlQ09NUCBQb3J0YWwKKyAqID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisgKiBDb3B5cmlnaHQgKEMpIDIwMTcgQVQmVCBJbnRlbGxlY3R1YWwgUHJvcGVydHkKKyAqID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisgKiBMaWNlbnNlZCB1bmRlciB0aGUgQXBhY2hlIExpY2Vuc2UsIFZlcnNpb24gMi4wICh0aGUgIkxpY2Vuc2UiKTsKKyAqIHlvdSBtYXkgbm90IHVzZSB0aGlzIGZpbGUgZXhjZXB0IGluIGNvbXBsaWFuY2Ugd2l0aCB0aGUgTGljZW5zZS4KKyAqIFlvdSBtYXkgb2J0YWluIGEgY29weSBvZiB0aGUgTGljZW5zZSBhdAorICogCisgKiAgICAgIGh0dHA6Ly93d3cuYXBhY2hlLm9yZy9saWNlbnNlcy9MSUNFTlNFLTIuMAorICogCisgKiBVbmxlc3MgcmVxdWlyZWQgYnkgYXBwbGljYWJsZSBsYXcgb3IgYWdyZWVkIHRvIGluIHdyaXRpbmcsIHNvZnR3YXJlCisgKiBkaXN0cmlidXRlZCB1bmRlciB0aGUgTGljZW5zZSBpcyBkaXN0cmlidXRlZCBvbiBhbiAiQVMgSVMiIEJBU0lTLAorICogV0lUSE9VVCBXQVJSQU5USUVTIE9SIENPTkRJVElPTlMgT0YgQU5ZIEtJTkQsIGVpdGhlciBleHByZXNzIG9yIGltcGxpZWQuCisgKiBTZWUgdGhlIExpY2Vuc2UgZm9yIHRoZSBzcGVjaWZpYyBsYW5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XJuIHRoaXMuY2xvc2UoIGV2ZW50ICk7CisJCX0KKworCQlpZiAoIHRoaXMuX3RyaWdnZXIoICJzZWFyY2giLCBldmVudCApID09PSBmYWxzZSApIHsKKwkJCXJldHVybjsKKwkJfQorCisJCXJldHVybiB0aGlzLl9zZWFyY2goIHZhbHVlICk7CisJfSwKKworCV9zZWFyY2g6IGZ1bmN0aW9uKCB2YWx1ZSApIHsKKwkJdGhpcy5wZW5kaW5nKys7CisJCXRoaXMuZWxlbWVudC5hZGRDbGFzcyggInVpLWF1dG9jb21wbGV0ZS1sb2FkaW5nIiApOworCQl0aGlzLmNhbmNlbFNlYXJjaCA9IGZhbHNlOworCisJCXRoaXMuc291cmNlKCB7IHRlcm06IHZhbHVlIH0sIHRoaXMuX3Jlc3BvbnNlKCkgKTsKKwl9LAorCisJX3Jlc3BvbnNlOiBmdW5jdGlvbigpIHsKKwkJdmFyIGluZGV4ID0gKyt0aGlzLnJlcXVlc3RJbmRleDsKKworCQlyZXR1cm4gJC5wcm94eShmdW5jdGlvbiggY29udGVudCApIHsKKwkJCWlmICggaW5kZXggPT09IHRoaXMucmVxdWVzdEluZGV4ICkgeworCQkJCXRoaXMuX19yZXNwb25zZSggY29udGVudCApOworCQkJfQorCisJCQl0aGlzLnBlbmRpbmctLTsKKwkJCWlmICggIXRoaXMucGVuZGluZyApIHsKKwkJCQl0aGlzLmVsZW1lbnQucmVtb3ZlQ2xhc3MoICJ1aS1hdXRvY29tcGxldGUtbG9hZGluZyIgKTsKKwkJCX0KKwkJfSwgdGhpcyApOworCX0sCisKKwlfX3Jlc3BvbnNlOiBmdW5jdGlvbiggY29udGVudCApIHsKKwkJaWYgKCBjb250ZW50ICkgeworCQkJY29udGVudCA9IHRoaXMuX25vcm1hbGl6ZSggY29udGVudCApOworCQl9CisJCXRoaXMuX3RyaWdnZXIoICJyZXNwb25zZSIsIG51bGwsIHsgY29udGVudDogY29udGVudCB9ICk7CisJCWlmICggIXRoaXMub3B0aW9ucy5kaXNh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qKioqKioqKioqKioqKioqKioqKioqKioqKi8KKy8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogQ0xBU1MgQU5JTUFUSU9OUyAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCisvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLworKGZ1bmN0aW9uKCkgeworCit2YXIgY2xhc3NBbmltYXRpb25BY3Rpb25zID0gWyAiYWRkIiwgInJlbW92ZSIsICJ0b2dnbGUiIF0sCisJc2hvcnRoYW5kU3R5bGVzID0geworCQlib3JkZXI6IDEsCisJCWJvcmRlckJvdHRvbTogMSwKKwkJYm9yZGVyQ29sb3I6IDEsCisJCWJvcmRlckxlZnQ6IDEsCisJCWJvcmRlclJpZ2h0OiAxLAorCQlib3JkZXJUb3A6IDEsCisJCWJvcmRlcldpZHRoOiAxLAorCQltYXJnaW46IDEsCisJCXBhZGRpbmc6IDEKKwl9OworCiskLmVhY2goWyAiYm9yZGVyTGVmdFN0eWxlIiwgImJvcmRlclJpZ2h0U3R5bGUiLCAiYm9yZGVyQm90dG9tU3R5bGUiLCAiYm9yZGVyVG9wU3R5bGUiIF0sIGZ1bmN0aW9uKCBfLCBwcm9wICkgeworCSQuZnguc3RlcFsgcHJvcCBdID0gZnVuY3Rpb24oIGZ4ICkgeworCQlpZiAoIGZ4LmVuZCAhPT0gIm5vbmUiICYmICFmeC5zZXRBdHRyIHx8IGZ4LnBvcyA9PT0gMSAmJiAhZnguc2V0QXR0ciApIHsKKwkJCWpRdWVyeS5zdHlsZSggZnguZWxlbSwgcHJvcCwgZnguZW5kICk7CisJCQlmeC5zZXRBdHRyID0gdHJ1ZTsKKwkJfQorCX07Cit9KTsKKworZnVuY3Rpb24gZ2V0RWxlbWVudFN0eWxlcyggZWxlbSApIHsKKwl2YXIga2V5LCBsZW4sCisJCXN0eWxlID0gZWxlbS5vd25lckRvY3VtZW50LmRlZmF1b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YWRkOiBjbGFzc05hbWVzIH0gOiB7IHJlbW92ZTogY2xhc3NOYW1lcyB9KSwKKwkJCQkJCXNwZWVkLCBlYXNpbmcsIGNhbGxiYWNrICk7CisJCQkJfQorCQkJfSBlbHNlIHsKKwkJCQkvLyB3aXRob3V0IGZvcmNlIHBhcmFtZXRlcgorCQkJCXJldHVybiAkLmVmZmVjdHMuYW5pbWF0ZUNsYXNzLmNhbGwoIHRoaXMsCisJCQkJCXsgdG9nZ2xlOiBjbGFzc05hbWVzIH0sIGZvcmNlLCBzcGVlZCwgZWFzaW5nICk7CisJCQl9CisJCX07CisJfSkoICQuZm4udG9nZ2xlQ2xhc3MgKSwKKworCXN3aXRjaENsYXNzOiBmdW5jdGlvbiggcmVtb3ZlLCBhZGQsIHNwZWVkLCBlYXNpbmcsIGNhbGxiYWNrKSB7CisJCXJldHVybiAkLmVmZmVjdHMuYW5pbWF0ZUNsYXNzLmNhbGwoIHRoaXMsIHsKKwkJCWFkZDogYWRkLAorCQkJcmVtb3ZlOiByZW1vdmUKKwkJfSwgc3BlZWQsIGVhc2luZywgY2FsbGJhY2sgKTsKKwl9Cit9KTsKKworfSkoKTsKKworLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KKy8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiBFRkZFQ1RTICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCisvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLworCisoZnVuY3Rpb24oKSB7CisKKyQuZXh0ZW5kKCAkLmVmZmVjdHMsIHsKKwl2ZXJzaW9uOiAiMS4xMS40IiwKKworCS8vIFNhdmVzIGEgc2V0IG9mIHByb3BlcnRpZXMgaW4gYSBkYXRhIHN0b3JhZ2UKKwlzYXZlOiBmdW5jdGlvbi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SAidG9nZ2xlIjsKKwkJCQlyZXR1cm4gdGhpcy5lZmZlY3QuY2FsbCggdGhpcywgYXJncyApOworCQkJfQorCQl9OworCX0pKCAkLmZuLnRvZ2dsZSApLAorCisJLy8gaGVscGVyIGZ1bmN0aW9ucworCWNzc1VuaXQ6IGZ1bmN0aW9uKGtleSkgeworCQl2YXIgc3R5bGUgPSB0aGlzLmNzcygga2V5ICksCisJCQl2YWwgPSBbXTsKKworCQkkLmVhY2goIFsgImVtIiwgInB4IiwgIiUiLCAicHQiIF0sIGZ1bmN0aW9uKCBpLCB1bml0ICkgeworCQkJaWYgKCBzdHlsZS5pbmRleE9mKCB1bml0ICkgPiAwICkgeworCQkJCXZhbCA9IFsgcGFyc2VGbG9hdCggc3R5bGUgKSwgdW5pdCBdOworCQkJfQorCQl9KTsKKwkJcmV0dXJuIHZhbDsKKwl9Cit9KTsKKworfSkoKTsKKworLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KKy8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiBFQVNJTkcgKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCisvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLworCisoZnVuY3Rpb24oKSB7CisKKy8vIGJhc2VkIG9uIGVhc2luZyBlcXVhdGlvbnMgZnJvbSBSb2JlcnQgUGVubmVyIChodHRwOi8vd3d3LnJvYmVydHBlbm5lci5jb20vZWFzaW5nKQorCit2YXIgYmFzZUVhc2luZ3MgPSB7fTsKKworJC5lYWNoKCBbICJRdWFkIiwgIkN1YmljIiwgIlF1YXJ0IiwgIlF1aW50IiwgIkV4cG8iIF0sIGZ1bmN0aW9uKCBpLCBuYW1lICkgeworCWJhc2VFYXNpbmdzWyBuYW1lIF0gPSBmdW5jdGlvbiggcCAp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ZXh0OiAgICAgbWVzc2FnZUJvZHkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAl9OworICAgICAJCQkgICAgICAgICAgcmV0dXJuIG1lc3NhZ2U7CisgICAJCQkgICAgICAgIAl9CisgICAgICAgIAkgICAgICAgIH0KKyAgICAgICAgCSAgICAgIH0pOyAKKyAgICAgICAgCX07CisgICAgICAgIAl0aGlzLnNob3dGYWlsdXJlID0gZnVuY3Rpb24oaGVhZGluZywgbWVzc2FnZUJvZHkpeworICAgICAgICAJdmFyIG1vZGFsSW5zdGFuY2UgPSAkbW9kYWwub3Blbih7CisgICAgICAgIAkgICAgICAgIHRlbXBsYXRlVXJsOiAnbW9kYWxfd2FybmluZy5odG1sJywKKyAgICAgICAgCSAgICAgICAgY29udHJvbGxlcjogJ21vZGFscG9wdXBDb250cm9sbGVyJywKKyAgICAgICAgCSAgICAgICAgcmVzb2x2ZTogeworICAgICAgICAgCSAgICAgICAgICAgbWVzc2FnZTogZnVuY3Rpb24gKCkgeworICAgICAgICAgCSAgICAgICAgCSAgdmFyIG1lc3NhZ2UgPSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCSB0aXRsZTogICAgaGVhZGluZywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAJIHRleHQ6ICAgICBtZXNzYWdlQm9keQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAl9OworICAgICAgCQkJICAgICAgICAgIHJldHVybiBtZXNzYWdlOworICAgIAkJCSAgICAgICAgCX0KKyAgICAgICAgIAkgICAgICAgIH0KKyAgICAgICAgCSAgICAgIH0pOyAKKyAgICAgICAgCX07CisgICAgICAgIAkKKyAgICAgICAgCXRoaXMuc2hvd1dhcm5pbmcgPSBmdW5jdGlvbihoZWFkaW5nLCBtZXNzYWdlQm9keSl7CisgICAgICAgICAgICAJdmFyIG1vZGFsSW5zdGFuY2UgPSAkbW9kYWwub3Blbih7CisgICAgICAgICAgICAJICAgICAgICB0ZW1wbGF0ZVVybDogJ21vZGFsX3dhcm5pbmdfbWVzc2FnZS5odG1sJywKKyAgICAgICAgICAgIAkgICAgICAgIGNvbnRyb2xsZXI6ICdtb2RhbHBvcHVwQ29udHJvbGxlcicsCisgICAgICAgICAgICAJICAgICAgICByZXNvbHZlOiB7CisgICAgICAgICAgICAgCSAgICAgICAgICAgbWVzc2FnZTogZnVuY3Rpb24gKCkgeworICAgICAgICAgICAgIAkgICAgICAgIAkgIHZhciBtZXNzYWdlID0geworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAJIHRpdGxlOiAgICBoZWFkaW5nLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAJIHRleHQ6ICAgICBtZXNzYWdlQm9keQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAJfTsKKyAgICAgICAgICAJCQkgICAgICAgICAgcmV0dXJuIG1lc3NhZ2U7CisgICAgICAgIAkJCSAgICAgICAgCX0KKyAgICAgICAgICAgICAJICAgICAgICB9CisgICAgICAgICAgICAJICAgICAgfSk7IAorICAgICAgICAgICAgCX07CisgICAgICAgIAkKKyAgICAgICAgCXRoaXMucG9wdXBDb25maXJtV2luID0gZnVuY3Rpb24odGl0bGUsIG1zZ0JvZHksIGNhbGxiYWNrKXsKKyAgIAkJCSB2YXIgbW9kYWxJbnN0YW5jZSA9ICRtb2RhbC5vcGVuKHsKKyAgIAkgCSAgICAgICAgdGVtcGxhdGVVcmw6ICdjb25maXJtYXRpb25faW5mb3JtYXRpdmUuaHRtbCcsCisgICAJIAkgICAgICAgIGNvbnRyb2xsZXI6ICdtb2RhbHBvcHVwQ29udHJvbGxlcicsCisgICAJIAkgICAgICAgIHJlc29sdmU6IHsKKyAgIAkgCSAgICAgICAgICAgbWVzc2FnZTogZnVuY3Rpb24gKCkgeworICAgCSAJICAgICAgICAJICAgdmFyIG1lc3NhZ2UgPSB7CisgICAJIAkgICAgICAgIAkJCSAgIHRpdGxlOiAgICB0aXRsZSwKKyAgIAkgICAgICAgICAgICAgICAgICAgICAgIAkJdGV4dDogICAgbXNnQm9keQorICAgCSAgICAgICAgICAgICAgICAgICAgICAgCX07CisgICAJCQkJICAgICAgICAgIHJldHVybiBtZXNzYWdlOworICAgCQkJICAgICAgICAJfQorICAgCSAJICAgICAgICB9CisgICAJIAkgICAgICB9KTsgCisgICAJCQkgdmFyIGFyZ3MgPSBBcnJheS5wcm90b3R5cGUuc2xpY2UuY2FsbCggYXJndW1lbnRzLCAwICk7CisgICAJCSAgICAgYXJncy5zcGxpY2UoIDAsIDMpOyAKKyAgIAkgCQltb2RhbEluc3RhbmNlLnJlc3VsdC50aGVuKGZ1bmN0aW9uKCl7CisgICAJCSAJCQljYWxsYmFjay5hcHBseShudWxsLCBhcmdzKTsKKyAgIAkgCQkJfSwgZnVuY3Rpb24oKSB7CisgICAJIAkJICB9KVsnZmluYWxseSddKGZ1bmN0aW9uKCl7CisgICAJIAkJICAgbW9kYWxJbnN0YW5jZSA9IHVuZGVmaW5lZDsKKyAgIAkgCQkgIH0pOworICAgCQkJCisgICAJCX07CisgICAgICAgIHRoaXMucG9wdXBEZWxldGVDb25maXJtV2luID0gZnVuY3Rpb24odGl0bGUsIG1zZ0JvZHksIGNhbGxiYWNrLCBhcmdGb3JDYWxsQmFjayl7CisgICAJCQkgdmFyIG1vZGFsSW5zdGFuY2UgPSAkbW9kYWwub3Blbih7CisgICAJIAkgICAgICAgIHRlbXBsYXRlVXJsOiAnY29uZmlybWF0aW9uX2Zvcl9kZWxldGUuaHRtbCcsCisgICAJIAkgICAgICAgIGNvbnRyb2xsZXI6ICdtb2RhbHBvcHVwQ29udHJvbGxlcicsCisgICAJIAkgICAgICAgIHJlc29sdmU6IHsKKyAgIAkgCSAgICAgICAgICAgbWVzc2FnZTogZnVuY3Rpb24gKCkgeworICAgCSAJICAgICAgICAJICAgdmFyIG1lc3NhZ2UgPSB7CisgICAJIAkgICAgICAgIAkJCSAgIHRpdGxlOiAgICB0aXRsZSwKKyAgIAkgICAgICAgICAgICAgICAgICAgICAgIAkJdGV4dDogICAgbXNnQm9keQorICAgCSAgICAgICAgICAgICAgICAgICAgICAgCX07CisgICAJCQkJICAgICAgICAgIHJldHVybiBtZXNzYWdlOworICAgCQkJICAgICAgICAJfQorICAgCSAJICAgICAgICB9CisgICAJIAkgICAgICB9KTsgCisgICAJCQkgCisgICAJIAkJbW9kYWxJbnN0YW5jZS5yZXN1bHQudGhlbihmdW5jdGlvbigpeworICAgCQkgCQkJY2FsbGJhY2soYXJnRm9yQ2FsbEJhY2spOworICAgCSAJCQl9LCBmdW5jdGlvbigpIHsKKyAgIAkgCQkgIH0pWydmaW5hbGx5J10oZnVuY3Rpb24oKXsKKyAgIAkgCQkgICBtb2RhbEluc3RhbmNlID0gdW5kZWZpbmVkOworICAgCSAJCSAgfSk7CisgICAJCQkKKyAgIAkJfTsJCQorICAgCQkKKyAgIAkgdGhpcy5wb3B1cFN1Y2Nlc3NSZWRpcmVjdFdpbiA9IGZ1bmN0aW9uKHRpdGxlLCBtc2dCb2R5LCByZWRpcmVjdFVybCl7CisgICAJCXZhciBtb2RhbEluc3RhbmNlID0gJG1vZGFsLm9wZW4oeworCSAgICAgICAgdGVtcGxhdGVVcmw6ICdtb2RhbF9pbmZvcm1hdGl2ZS5odG1sJywKKwkgICAgICAgIGNvbnRyb2xsZXI6ICdtb2RhbHBvcHVwQ29udHJvbGxlcicsCisJICAgICAgICByZXNvbHZlOiB7CisJICAgICAgICAgICBtZXNzYWdlOiBmdW5jdGlvbiAoKSB7CisJICAgICAgICAJICAgdmFyIG1lc3NhZ2UgPSB7CisJICAgICAgICAJCQkgICB0aXRsZTogICAgdGl0bGUsCisJICAgICAgICAgICAgICAgICAgICAgICB0ZXh0OiAgICBtc2dCb2R5CisgICAgICAgICAgICAgICAgICAgICAgCX07CisJCQkgICAgICAgICAgcmV0dXJuIG1lc3NhZ2U7CisJCSAgICAgICAgCX0KKwkgICAgICAgIH0KKwkgICAgICB9KTsgCisJCW1vZGFsSW5zdGFuY2UucmVzdWx0LnRoZW4oZnVuY3Rpb24oKSB7CisJCSAgfSwgZnVuY3Rpb24oKSB7CisJCQkgIHdpbmRvdy5sb2NhdGlvbi5ocmVmPXJlZGlyZWN0VXJsOworCQkgIH0pWydmaW5hbGx5J10oZnVuY3Rpb24oKXsKKwkJICAgbW9kYWxJbnN0YW5jZSA9IHVuZGVmaW5lZDsKKwkJICB9KTsJCisgICAJfTsJCisgICAJCisgICAJdGhpcy5wb3B1cFdhcm5pbmdSZWRpcmVjdFdpbiA9IGZ1bmN0aW9uKHRpdGxlLCBtc2dCb2R5LCByZWRpcmVjdFVybCl7CisgICAJCXZhciBtb2RhbEluc3RhbmNlID0gJG1vZGFsLm9wZW4oeworICAgCQkJdGVtcGxhdGVVcmw6ICdtb2RhbF93YXJuaW5nX21lc3NhZ2UuaHRtbCcsCisJICAgICAgICBjb250cm9sbGVyOiAnbW9kYWxwb3B1cENvbnRyb2xsZXInLAorCSAgICAgICAgcmVzb2x2ZTogeworCSAgICAgICAgICAgbWVzc2FnZTogZnVuY3Rpb24gKCkgeworCSAgICAgICAgCSAgIHZhciBtZXNzYWdlID0geworCSAgICAgICAgCQkJICAgdGl0bGU6ICAgIHRpdGxlLAorCSAgICAgICAgICAgICAgICAgICAgICAgdGV4dDogICAgbXNnQm9keQorICAgICAgICAgICAgICAgICAgICAgIAl9OworCQkJICAgICAgICAgIHJldHVybiBtZXNzYWdlOworCQkgICAgICAgIAl9CisJICAgICAgICB9CisJICAgICAgfSk7IAorCQltb2RhbEluc3RhbmNlLnJlc3VsdC50aGVuKGZ1bmN0aW9uKCkgeworCQkgIH0sIGZ1bmN0aW9uKCkgeworCQkJICB3aW5kb3cubG9jYXRpb24uaHJlZj1yZWRpcmVjdFVybDsKKwkJICB9KVsnZmluYWxseSddKGZ1bmN0aW9uKCl7CisJCSAgIG1vZGFsSW5zdGFuY2UgPSB1bmRlZmluZWQ7CisJCSAgfSk7CQorICAgCX07CQorIH1dKTsKXCBObyBuZXd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B0ZXh0LXNoYWRvdzogbm9uZTsKKyAgYmFja2dyb3VuZC1jb2xvcjogdHJhbnNwYXJlbnQ7CisgIGJvcmRlcjogMDsKK30KKworLmlucHV0LWJsb2NrLWxldmVsIHsKKyAgZGlzcGxheTogYmxvY2s7CisgIHdpZHRoOiAxMDAlOworICBtaW4taGVpZ2h0OiAzMHB4OworICAtd2Via2l0LWJveC1zaXppbmc6IGJvcmRlci1ib3g7CisgICAgIC1tb3otYm94LXNpemluZzogYm9yZGVyLWJveDsKKyAgICAgICAgICBib3gtc2l6aW5nOiBib3JkZXItYm94OworfQorCitALW1zLXZpZXdwb3J0IHsKKyAgd2lkdGg6IGRldmljZS13aWR0aDsKK30KKworLmhpZGRlbiB7CisgIGRpc3BsYXk6IG5vbmU7CisgIHZpc2liaWxpdHk6IGhpZGRlbjsKK30KKworLnZpc2libGUtcGhvbmUgeworICBkaXNwbGF5OiBub25lICFpbXBvcnRhbnQ7Cit9CisKKy52aXNpYmxlLXRhYmxldCB7CisgIGRpc3BsYXk6IG5vbmUgIWltcG9ydGFudDsKK30KKworLmhpZGRlbi1kZXNrdG9wIHsKKyAgZGlzcGxheTogbm9uZSAhaW1wb3J0YW50OworfQorCisudmlzaWJsZS1kZXNrdG9wIHsKKyAgZGlzcGxheTogaW5oZXJpdCAhaW1wb3J0YW50OworfQorCitAbWVkaWEgKG1pbi13aWR0aDogNzY4cHgpIGFuZCAobWF4LXdpZHRoOiA5NzlweCkgeworICAuaGlkZGVuLWRlc2t0b3AgeworICAgIGRpc3BsYXk6IGluaGVyaXQgIWltcG9ydGFudDsKKyAgfQorICAudmlzaWJsZS1kZXNrdG9wIHsKKyAgICBkaXNwbGF5OiBub25lICFpbXBvcnRhbnQgOworICB9CisgIC52aXNpYmxlLXRhYmxldCB7CisgICAgZGlzcGxheTogaW5oZXJpdCAhaW1wb3J0YW50OworICB9CisgIC5oaWRkZW4tdGFibGV0IHsKKyAgICBkaXNwbGF5OiBub25lICFpbXBvcnRhbnQ7CisgIH0KK30KKworQG1lZGlhIChtYXgtd2lkdGg6IDc2N3B4KSB7CisgIC5oaWRkZW4tZGVza3RvcCB7CisgICAgZGlzcGxheTogaW5oZXJpdCAhaW1wb3J0YW50OworICB9CisgIC52aXNpYmxlLWRlc2t0b3AgeworICAgIGRpc3BsYXk6IG5vbmUgIWltcG9ydGFudDsKKyAgfQorICAudmlzaWJsZS1waG9uZSB7CisgICAgZGlzcGxheTogaW5oZXJpdCAhaW1wb3J0YW50OworICB9CisgIC5oaWRkZW4tcGhvbmUgeworICAgIGRpc3BsYXk6IG5vbmUgIWltcG9ydGFudDsKKyAgfQorfQorCisudmlzaWJsZS1wcmludCB7CisgIGRpc3BsYXk6IG5vbmUgIWltcG9ydGFudDsKK30KKworQG1lZGlhIHByaW50IHsKKyAgLnZpc2libGUtcHJpbnQgeworICAgIGRpc3BsYXk6IGluaGVyaXQgIWltcG9ydGFudDsKKyAgfQorICAuaGlkZGVuLXByaW50IHsKKyAgICBkaXNwbGF5OiBub25lICFpbXBvcnRhbnQ7CisgIH0KK30KKworQG1lZGlhIChtaW4td2lkdGg6IDEyMDBweCkgeworICAucm93IHsKKyAgICBtYXJnaW4tbGVmdDogLTMwcHg7CisgICAgKnpvb206IDE7CisgIH0KKyAgLnJvdzpiZWZvcmUsCisgIC5yb3c6YWZ0ZXIgeworICAgIGRpc3BsYXk6IHRhYmxlOworICAgIGxpbmUtaGVpZ2h0OiAwOworICAgIGNvbnRlbnQ6ICIiOworICB9CisgIC5yb3c6YWZ0ZXIgeworICAgIGNsZWFyOiBib3RoOworICB9CisgIFtjbGFzcyo9InNwYW4iXSB7CisgICAgZmxvYXQ6IGxlZnQ7CisgICAgbWluLWhlaWdodDogMXB4OworICAgIG1hcmdpbi1sZWZ0OiAzMHB4OworICB9CisgIC5jb250YWluZXIsCisgIC5uYXZiYXItc3RhdGljLXRvcCAuY29udGFpbmVyLAorICAubmF2YmFyLWZpeGVkLXRvcCAuY29udGFpbmVyLAorICAubmF2YmFyL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lLWlucHV0LnNwYW4zIHsKKyAgICB3aWR0aDogMjU2cHg7CisgIH0KKyAgaW5wdXQuc3BhbjIsCisgIHRleHRhcmVhLnNwYW4yLAorICAudW5lZGl0YWJsZS1pbnB1dC5zcGFuMiB7CisgICAgd2lkdGg6IDE1NnB4OworICB9CisgIGlucHV0LnNwYW4xLAorICB0ZXh0YXJlYS5zcGFuMSwKKyAgLnVuZWRpdGFibGUtaW5wdXQuc3BhbjEgeworICAgIHdpZHRoOiA1NnB4OworICB9CisgIC50aHVtYm5haWxzIHsKKyAgICBtYXJnaW4tbGVmdDogLTMwcHg7CisgIH0KKyAgLnRodW1ibmFpbHMgPiBsaSB7CisgICAgbWFyZ2luLWxlZnQ6IDMwcHg7CisgIH0KKyAgLnJvdy1mbHVpZCAudGh1bWJuYWlscyB7CisgICAgbWFyZ2luLWxlZnQ6IDA7CisgIH0KK30KKworQG1lZGlhIChtaW4td2lkdGg6IDc2OHB4KSBhbmQgKG1heC13aWR0aDogOTc5cHgpIHsKKyAgLnJvdyB7CisgICAgbWFyZ2luLWxlZnQ6IC0yMHB4OworICAgICp6b29tOiAxOworICB9CisgIC5yb3c6YmVmb3JlLAorICAucm93OmFmdGVyIHsKKyAgICBkaXNwbGF5OiB0YWJsZTsKKyAgICBsaW5lLWhlaWdodDogMDsKKyAgICBjb250ZW50OiAiIjsKKyAgfQorICAucm93OmFmdGVyIHsKKyAgICBjbGVhcjogYm90aDsKKyAgfQorICBbY2xhc3MqPSJzcGFuIl0geworICAgIGZsb2F0OiBsZWZ0OworICAgIG1pbi1oZWlnaHQ6IDFweDsKKyAgICBtYXJnaW4tbGVmdDogMjBweDsKKyAgfQorICAuY29udGFpbmVyLAorICAubmF2YmFyLXN0YXRpYy10b3AgLmNvbnRhaW5lciwKKyAgLm5hdmJhci1maXhlZC10b3AgLmNvbnRhaW5lciwKKyAgLm5hdmJhci1maXhlZC1ib3R0b20gLmNvbnRhaW5lciB7CisgICAgd2lkdGg6IDcyNHB4OworICB9CisgIC5zcGFuMTIgeworICAgIHdpZHRoOiA3MjRweDsKKyAgfQorICAuc3BhbjExIHsKKyAgICB3aWR0aDogNjYycHg7CisgIH0KKyAgLnNwYW4xMCB7CisgICAgd2lkdGg6IDYwMHB4OworICB9CisgIC5zcGFuOSB7CisgICAgd2lkdGg6IDUzOHB4OworICB9CisgIC5zcGFuOCB7CisgICAgd2lkdGg6IDQ3NnB4OworICB9CisgIC5zcGFuNyB7CisgICAgd2lkdGg6IDQxNHB4OworICB9CisgIC5zcGFuNiB7CisgICAgd2lkdGg6IDM1MnB4OworICB9CisgIC5zcGFuNSB7CisgICAgd2lkdGg6IDI5MHB4OworICB9CisgIC5zcGFuNCB7CisgICAgd2lkdGg6IDIyOHB4OworICB9CisgIC5zcGFuMyB7CisgICAgd2lkdGg6IDE2NnB4OworICB9CisgIC5zcGFuMiB7CisgICAgd2lkdGg6IDEwNHB4OworICB9CisgIC5zcGFuMSB7CisgICAgd2lkdGg6IDQycHg7CisgIH0KKyAgLm9mZnNldDEyIHsKKyAgICBtYXJnaW4tbGVmdDogNzY0cHg7CisgIH0KKyAgLm9mZnNldDExIHsKKyAgICBtYXJnaW4tbGVmdDogNzAycHg7CisgIH0KKyAgLm9mZnNldDEwIHsKKyAgICBtYXJnaW4tbGVmdDogNjQwcHg7CisgIH0KKyAgLm9mZnNldDkgeworICAgIG1hcmdpbi1sZWZ0OiA1NzhweDsKKyAgfQorICAub2Zmc2V0OCB7CisgICAgbWFyZ2luLWxlZnQ6IDUxNnB4OworICB9CisgIC5vZmZzZXQ3IHsKKyAgICBtYXJnaW4tbGVmdDogNDU0cHg7CisgIH0KKyAgLm9mZnNldDYgeworICAgIG1hcmdpbi1sZWZ0OiAzOTJweDsKKyAgfQorICAub2Zmc2V0NSB7CisgICAgbWFyZ2luLWxlZnQ6IDMzMHB4OworICB9CisgIC5vZmZzZXQ0IHsKKyAgICBtYXJnaW4tbGVmdDogMjY4cHg7CisgIH0KKyAgLm9mZnNldDMgeworICAgIG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VkaXRhYmxlLWlucHV0LnNwYW4yIHsKKyAgICB3aWR0aDogOTBweDsKKyAgfQorICBpbnB1dC5zcGFuMSwKKyAgdGV4dGFyZWEuc3BhbjEsCisgIC51bmVkaXRhYmxlLWlucHV0LnNwYW4xIHsKKyAgICB3aWR0aDogMjhweDsKKyAgfQorfQorCitAbWVkaWEgKG1heC13aWR0aDogNzY3cHgpIHsKKyAgYm9keSB7CisgICAgcGFkZGluZy1yaWdodDogMjBweDsKKyAgICBwYWRkaW5nLWxlZnQ6IDIwcHg7CisgIH0KKyAgLm5hdmJhci1maXhlZC10b3AsCisgIC5uYXZiYXItZml4ZWQtYm90dG9tLAorICAubmF2YmFyLXN0YXRpYy10b3AgeworICAgIG1hcmdpbi1yaWdodDogLTIwcHg7CisgICAgbWFyZ2luLWxlZnQ6IC0yMHB4OworICB9CisgIC5jb250YWluZXItZmx1aWQgeworICAgIHBhZGRpbmc6IDA7CisgIH0KKyAgLmRsLWhvcml6b250YWwgZHQgeworICAgIGZsb2F0OiBub25lOworICAgIHdpZHRoOiBhdXRvOworICAgIGNsZWFyOiBub25lOworICAgIHRleHQtYWxpZ246IGxlZnQ7CisgIH0KKyAgLmRsLWhvcml6b250YWwgZGQgeworICAgIG1hcmdpbi1sZWZ0OiAwOworICB9CisgIC5jb250YWluZXIgeworICAgIHdpZHRoOiBhdXRvOworICB9CisgIC5yb3ctZmx1aWQgeworICAgIHdpZHRoOiAxMDAlOworICB9CisgIC5yb3csCisgIC50aHVtYm5haWxzIHsKKyAgICBtYXJnaW4tbGVmdDogMDsKKyAgfQorICAudGh1bWJuYWlscyA+IGxpIHsKKyAgICBmbG9hdDogbm9uZTsKKyAgICBtYXJnaW4tbGVmdDogMDsKKyAgfQorICBbY2xhc3MqPSJzcGFuIl0sCisgIC51bmVkaXRhYmxlLWlucHV0W2NsYXNzKj0ic3BhbiJdLAorICAucm93LWZsdWlkIFtjbGFzcyo9InNwYW4iXSB7CisgICAgZGlzcGxheTogYmxvY2s7CisgICAgZmxvYXQ6IG5vbmU7CisgICAgd2lkdGg6IDEwMCU7CisgICAgbWFyZ2luLWxlZnQ6IDA7CisgICAgLXdlYmtpdC1ib3gtc2l6aW5nOiBib3JkZXItYm94OworICAgICAgIC1tb3otYm94LXNpemluZzogYm9yZGVyLWJveDsKKyAgICAgICAgICAgIGJveC1zaXppbmc6IGJvcmRlci1ib3g7CisgIH0KKyAgLnNwYW4xMiwKKyAgLnJvdy1mbHVpZCAuc3BhbjEyIHsKKyAgICB3aWR0aDogMTAwJTsKKyAgICAtd2Via2l0LWJveC1zaXppbmc6IGJvcmRlci1ib3g7CisgICAgICAgLW1vei1ib3gtc2l6aW5nOiBib3JkZXItYm94OworICAgICAgICAgICAgYm94LXNpemluZzogYm9yZGVyLWJveDsKKyAgfQorICAucm93LWZsdWlkIFtjbGFzcyo9Im9mZnNldCJdOmZpcnN0LWNoaWxkIHsKKyAgICBtYXJnaW4tbGVmdDogMDsKKyAgfQorICAuaW5wdXQtbGFyZ2UsCisgIC5pbnB1dC14bGFyZ2UsCisgIC5pbnB1dC14eGxhcmdlLAorICBpbnB1dFtjbGFzcyo9InNwYW4iXSwKKyAgc2VsZWN0W2NsYXNzKj0ic3BhbiJdLAorICB0ZXh0YXJlYVtjbGFzcyo9InNwYW4iXSwKKyAgLnVuZWRpdGFibGUtaW5wdXQgeworICAgIGRpc3BsYXk6IGJsb2NrOworICAgIHdpZHRoOiAxMDAlOworICAgIG1pbi1oZWlnaHQ6IDMwcHg7CisgICAgLXdlYmtpdC1ib3gtc2l6aW5nOiBib3JkZXItYm94OworICAgICAgIC1tb3otYm94LXNpemluZzogYm9yZGVyLWJveDsKKyAgICAgICAgICAgIGJveC1zaXppbmc6IGJvcmRlci1ib3g7CisgIH0KKyAgLmlucHV0LXByZXBlbmQgaW5wdXQsCisgIC5pbnB1dC1hcHBlbmQgaW5wdXQsCisgIC5pbnB1dC1wcmVwZW5kIGlucHV0W2NsYXNzKj0ic3BhbiJdLAorICAuaW5wdXQt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c3QgeworICAgIHBhZGRpbmctdG9wOiAwOworICB9CisgIC5mb3JtLWhvcml6b250YWwgLmZvcm0tYWN0aW9ucyB7CisgICAgcGFkZGluZy1yaWdodDogMTBweDsKKyAgICBwYWRkaW5nLWxlZnQ6IDEwcHg7CisgIH0KKyAgLm1lZGlhIC5wdWxsLWxlZnQsCisgIC5tZWRpYSAucHVsbC1yaWdodCB7CisgICAgZGlzcGxheTogYmxvY2s7CisgICAgZmxvYXQ6IG5vbmU7CisgICAgbWFyZ2luLWJvdHRvbTogMTBweDsKKyAgfQorICAubWVkaWEtb2JqZWN0IHsKKyAgICBtYXJnaW4tcmlnaHQ6IDA7CisgICAgbWFyZ2luLWxlZnQ6IDA7CisgIH0KKyAgLm1vZGFsIHsKKyAgICB0b3A6IDEwcHg7CisgICAgcmlnaHQ6IDEwcHg7CisgICAgbGVmdDogMTBweDsKKyAgfQorICAubW9kYWwtaGVhZGVyIC5jbG9zZSB7CisgICAgcGFkZGluZzogMTBweDsKKyAgICBtYXJnaW46IC0xMHB4OworICB9CisgIC5jYXJvdXNlbC1jYXB0aW9uIHsKKyAgICBwb3NpdGlvbjogc3RhdGljOworICB9Cit9CisKK0BtZWRpYSAobWF4LXdpZHRoOiA5NzlweCkgeworICBib2R5IHsKKyAgICBwYWRkaW5nLXRvcDogMDsKKyAgfQorICAubmF2YmFyLWZpeGVkLXRvcCwKKyAgLm5hdmJhci1maXhlZC1ib3R0b20geworICAgIHBvc2l0aW9uOiBzdGF0aWM7CisgIH0KKyAgLm5hdmJhci1maXhlZC10b3AgeworICAgIG1hcmdpbi1ib3R0b206IDIwcHg7CisgIH0KKyAgLm5hdmJhci1maXhlZC1ib3R0b20geworICAgIG1hcmdpbi10b3A6IDIwcHg7CisgIH0KKyAgLm5hdmJhci1maXhlZC10b3AgLm5hdmJhci1pbm5lciwKKyAgLm5hdmJhci1maXhlZC1ib3R0b20gLm5hdmJhci1pbm5lciB7CisgICAgcGFkZGluZzogNXB4OworICB9CisgIC5uY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tYXJnaW4tdG9wOiA1cHg7CisgIH0KKyAgLm5hdi1jb2xsYXBzZSAuZHJvcGRvd24tbWVudSB7CisgICAgcG9zaXRpb246IHN0YXRpYzsKKyAgICB0b3A6IGF1dG87CisgICAgbGVmdDogYXV0bzsKKyAgICBkaXNwbGF5OiBub25lOworICAgIGZsb2F0OiBub25lOworICAgIG1heC13aWR0aDogbm9uZTsKKyAgICBwYWRkaW5nOiAwOworICAgIG1hcmdpbjogMCAxNXB4OworICAgIGJhY2tncm91bmQtY29sb3I6IHRyYW5zcGFyZW50OworICAgIGJvcmRlcjogbm9uZTsKKyAgICAtd2Via2l0LWJvcmRlci1yYWRpdXM6IDA7CisgICAgICAgLW1vei1ib3JkZXItcmFkaXVzOiAwOworICAgICAgICAgICAgYm9yZGVyLXJhZGl1czogMDsKKyAgICAtd2Via2l0LWJveC1zaGFkb3c6IG5vbmU7CisgICAgICAgLW1vei1ib3gtc2hhZG93OiBub25lOworICAgICAgICAgICAgYm94LXNoYWRvdzogbm9uZTsKKyAgfQorICAubmF2LWNvbGxhcHNlIC5vcGVuID4gLmRyb3Bkb3duLW1lbnUgeworICAgIGRpc3BsYXk6IGJsb2NrOworICB9CisgIC5uYXYtY29sbGFwc2UgLmRyb3Bkb3duLW1lbnU6YmVmb3JlLAorICAubmF2LWNvbGxhcHNlIC5kcm9wZG93bi1tZW51OmFmdGVyIHsKKyAgICBkaXNwbGF5OiBub25lOworICB9CisgIC5uYXYtY29sbGFwc2UgLmRyb3Bkb3duLW1lbnUgLmRpdmlkZXIgeworICAgIGRpc3BsYXk6IG5vbmU7CisgIH0KKyAgLm5hdi1jb2xsYXBzZSAubmF2ID4gbGkgPiAuZHJvcGRvd24tbWVudTpiZWZvcmUsCisgIC5uYXYtY29sbGFwc2UgLm5hdiA+IGxpID4gLmRyb3Bkb3duLW1lbnU6YWZ0ZXIgeworICAgIGRpc3BsYXk6IG5vbmU7CisgIH0KKyAgLm5hdi1jb2xsYXBzZSAubmF2YmFyLWZvc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5zcGFyZW50OworICB0ZXh0LXNoYWRvdzogbm9uZTsKKyAgYmFja2dyb3VuZC1jb2xvcjogdHJhbnNwYXJlbnQ7CisgIGJvcmRlcjogMDsKK30KKworLmlucHV0LWJsb2NrLWxldmVsIHsKKyAgZGlzcGxheTogYmxvY2s7CisgIHdpZHRoOiAxMDAlOworICBtaW4taGVpZ2h0OiAzMHB4OworICAtd2Via2l0LWJveC1zaXppbmc6IGJvcmRlci1ib3g7CisgICAgIC1tb3otYm94LXNpemluZzogYm9yZGVyLWJveDsKKyAgICAgICAgICBib3gtc2l6aW5nOiBib3JkZXItYm94OworfQorCithcnRpY2xlLAorYXNpZGUsCitkZXRhaWxzLAorZmlnY2FwdGlvbiwKK2ZpZ3VyZSwKK2Zvb3RlciwKK2hlYWRlciwKK2hncm91cCwKK25hdiwKK3NlY3Rpb24geworICBkaXNwbGF5OiBibG9jazsKK30KKworYXVkaW8sCitjYW52YXMsCit2aWRlbyB7CisgIGRpc3BsYXk6IGlubGluZS1ibG9jazsKKyAgKmRpc3BsYXk6IGlubGluZTsKKyAgKnpvb206IDE7Cit9CisKK2F1ZGlvOm5vdChbY29udHJvbHNdKSB7CisgIGRpc3BsYXk6IG5vbmU7Cit9CisKK2h0bWwgeworICBmb250LXNpemU6IDEwMCU7CisgIC13ZWJraXQtdGV4dC1zaXplLWFkanVzdDogMTAwJTsKKyAgICAgIC1tcy10ZXh0LXNpemUtYWRqdXN0OiAxMDAlOworfQorCithOmZvY3VzIHsKKyAgb3V0bGluZTogdGhpbiBkb3R0ZWQgIzMzMzsKKyAgb3V0bGluZTogNXB4IGF1dG8gLXdlYmtpdC1mb2N1cy1yaW5nLWNvbG9yOworICBvdXRsaW5lLW9mZnNldDogLTJweDsKK30KKworYTpob3ZlciwKK2E6YWN0aXZlIHsKKyAgb3V0bGluZTogMDsKK30KKworc3ViLAorc3VwIHsKKyAgcG9zaXRpb246IHJlbGF0aXZlOworICBmb250LXNpemU6IDc1JTsKKyAgbGluZS1oZWl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vbnRlbnQ6ICIiOworICB9CisgIHByZSwKKyAgYmxvY2txdW90ZSB7CisgICAgYm9yZGVyOiAxcHggc29saWQgIzk5OTsKKyAgICBwYWdlLWJyZWFrLWluc2lkZTogYXZvaWQ7CisgIH0KKyAgdGhlYWQgeworICAgIGRpc3BsYXk6IHRhYmxlLWhlYWRlci1ncm91cDsKKyAgfQorICB0ciwKKyAgaW1nIHsKKyAgICBwYWdlLWJyZWFrLWluc2lkZTogYXZvaWQ7CisgIH0KKyAgaW1nIHsKKyAgICBtYXgtd2lkdGg6IDEwMCUgIWltcG9ydGFudDsKKyAgfQorICBAcGFnZSAgeworICAgIG1hcmdpbjogMC41Y207CisgIH0KKyAgcCwKKyAgaDIsCisgIGgzIHsKKyAgICBvcnBoYW5zOiAzOworICAgIHdpZG93czogMzsKKyAgfQorICBoMiwKKyAgaDMgeworICAgIHBhZ2UtYnJlYWstYWZ0ZXI6IGF2b2lkOworICB9Cit9CisKK2JvZHkgeworICBtYXJnaW46IDA7CisgIGZvbnQtZmFtaWx5OiAiSGVsdmV0aWNhIE5ldWUiLCBIZWx2ZXRpY2EsIEFyaWFsLCBzYW5zLXNlcmlmOworICBmb250LXNpemU6IDE0cHg7CisgIGxpbmUtaGVpZ2h0OiAyMHB4OworICBjb2xvcjogIzMzMzMzMzsKKyAgYmFja2dyb3VuZC1jb2xvcjogI2ZmZmZmZjsKK30KKworYSB7CisgIGNvbG9yOiAjMDA4OGNjOworICB0ZXh0LWRlY29yYXRpb246IG5vbmU7Cit9CisKK2E6aG92ZXIsCithOmZvY3VzIHsKKyAgY29sb3I6ICMwMDU1ODA7CisgIHRleHQtZGVjb3JhdGlvbjogdW5kZXJsaW5lOworfQorCisuaW1nLXJvdW5kZWQgeworICAtd2Via2l0LWJvcmRlci1yYWRpdXM6IDZweDsKKyAgICAgLW1vei1ib3JkZXItcmFkaXVzOiA2cHg7CisgICAgICAgICAgYm9yZGVyLXJhZGl1czogNnB4OworfQorCisuaW1nLXBvbGFyb2l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2MHB4OworfQorCisuc3BhbjEwIHsKKyAgd2lkdGg6IDc4MHB4OworfQorCisuc3BhbjkgeworICB3aWR0aDogNzAwcHg7Cit9CisKKy5zcGFuOCB7CisgIHdpZHRoOiA2MjBweDsKK30KKworLnNwYW43IHsKKyAgd2lkdGg6IDU0MHB4OworfQorCisuc3BhbjYgeworICB3aWR0aDogNDYwcHg7Cit9CisKKy5zcGFuNSB7CisgIHdpZHRoOiAzODBweDsKK30KKworLnNwYW40IHsKKyAgd2lkdGg6IDMwMHB4OworfQorCisuc3BhbjMgeworICB3aWR0aDogMjIwcHg7Cit9CisKKy5zcGFuMiB7CisgIHdpZHRoOiAxNDBweDsKK30KKworLnNwYW4xIHsKKyAgd2lkdGg6IDYwcHg7Cit9CisKKy5vZmZzZXQxMiB7CisgIG1hcmdpbi1sZWZ0OiA5ODBweDsKK30KKworLm9mZnNldDExIHsKKyAgbWFyZ2luLWxlZnQ6IDkwMHB4OworfQorCisub2Zmc2V0MTAgeworICBtYXJnaW4tbGVmdDogODIwcHg7Cit9CisKKy5vZmZzZXQ5IHsKKyAgbWFyZ2luLWxlZnQ6IDc0MHB4OworfQorCisub2Zmc2V0OCB7CisgIG1hcmdpbi1sZWZ0OiA2NjBweDsKK30KKworLm9mZnNldDcgeworICBtYXJnaW4tbGVmdDogNTgwcHg7Cit9CisKKy5vZmZzZXQ2IHsKKyAgbWFyZ2luLWxlZnQ6IDUwMHB4OworfQorCisub2Zmc2V0NSB7CisgIG1hcmdpbi1sZWZ0OiA0MjBweDsKK30KKworLm9mZnNldDQgeworICBtYXJnaW4tbGVmdDogMzQwcHg7Cit9CisKKy5vZmZzZXQzIHsKKyAgbWFyZ2luLWxlZnQ6IDI2MHB4OworfQorCisub2Zmc2V0MiB7CisgIG1hcmdpbi1sZWZ0OiAxODBweDsKK30KKworLm9mZnNldDEgeworICBtYXJnaW4tbGVmdDogMTAwcHg7Cit9CisKKy5yb3ctZmx1aWQgeworICB3aWR0aDogMTAwJTsKKyAgKn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OiAxMC41MzE5MTQ4OTM2MTcwMiU7Cit9CisKKy5yb3ctZmx1aWQgLm9mZnNldDE6Zmlyc3QtY2hpbGQgeworICBtYXJnaW4tbGVmdDogOC41MTA2MzgyOTc4NzIzNCU7CisgICptYXJnaW4tbGVmdDogOC40MDQyNTUzMTkxNDg5MzglOworfQorCitbY2xhc3MqPSJzcGFuIl0uaGlkZSwKKy5yb3ctZmx1aWQgW2NsYXNzKj0ic3BhbiJdLmhpZGUgeworICBkaXNwbGF5OiBub25lOworfQorCitbY2xhc3MqPSJzcGFuIl0ucHVsbC1yaWdodCwKKy5yb3ctZmx1aWQgW2NsYXNzKj0ic3BhbiJdLnB1bGwtcmlnaHQgeworICBmbG9hdDogcmlnaHQ7Cit9CisKKy5jb250YWluZXIgeworICBtYXJnaW4tcmlnaHQ6IGF1dG87CisgIG1hcmdpbi1sZWZ0OiBhdXRvOworICAqem9vbTogMTsKK30KKworLmNvbnRhaW5lcjpiZWZvcmUsCisuY29udGFpbmVyOmFmdGVyIHsKKyAgZGlzcGxheTogdGFibGU7CisgIGxpbmUtaGVpZ2h0OiAwOworICBjb250ZW50OiAiIjsKK30KKworLmNvbnRhaW5lcjphZnRlciB7CisgIGNsZWFyOiBib3RoOworfQorCisuY29udGFpbmVyLWZsdWlkIHsKKyAgcGFkZGluZy1yaWdodDogMjBweDsKKyAgcGFkZGluZy1sZWZ0OiAyMHB4OworICAqem9vbTogMTsKK30KKworLmNvbnRhaW5lci1mbHVpZDpiZWZvcmUsCisuY29udGFpbmVyLWZsdWlkOmFmdGVyIHsKKyAgZGlzcGxheTogdGFibGU7CisgIGxpbmUtaGVpZ2h0OiAwOworICBjb250ZW50OiAiIjsKK30KKworLmNvbnRhaW5lci1mbHVpZDphZnRlciB7CisgIGNsZWFyOiBib3RoOworfQorCitwIHsKKyAgbWFyZ2luOiAwIDAgMTBweDsKK30KKworLmxlYWQgeworICBtYXJnaW4tYm90dG9tOiAyMHB4OworICBmb250LXNpemU6IDIxcHg7CisgIGZvbnQtd2VpZ2h0OiAyMDA7CisgIGxpbmUtaGVpZ2h0OiAzMHB4OworfQorCitzbWFsbCB7CisgIGZvbnQtc2l6ZTogODUlOworfQorCitzdHJvbmcgeworICBmb250LXdlaWdodDogYm9sZDsKK30KKworZW0geworICBmb250LXN0eWxlOiBpdGFsaWM7Cit9CisKK2NpdGUgeworICBmb250LXN0eWxlOiBub3JtYWw7Cit9CisKKy5tdXRlZCB7CisgIGNvbG9yOiAjOTk5OTk5OworfQorCithLm11dGVkOmhvdmVyLAorYS5tdXRlZDpmb2N1cyB7CisgIGNvbG9yOiAjODA4MDgwOworfQorCisudGV4dC13YXJuaW5nIHsKKyAgY29sb3I6ICNjMDk4NTM7Cit9CisKK2EudGV4dC13YXJuaW5nOmhvdmVyLAorYS50ZXh0LXdhcm5pbmc6Zm9jdXMgeworICBjb2xvcjogI2E0N2UzYzsKK30KKworLnRleHQtZXJyb3IgeworICBjb2xvcjogI2I5NGE0ODsKK30KKworYS50ZXh0LWVycm9yOmhvdmVyLAorYS50ZXh0LWVycm9yOmZvY3VzIHsKKyAgY29sb3I6ICM5NTNiMzk7Cit9CisKKy50ZXh0LWluZm8geworICBjb2xvcjogIzNhODdhZDsKK30KKworYS50ZXh0LWluZm86aG92ZXIsCithLnRleHQtaW5mbzpmb2N1cyB7CisgIGNvbG9yOiAjMmQ2OTg3OworfQorCisudGV4dC1zdWNjZXNzIHsKKyAgY29sb3I6ICM0Njg4NDc7Cit9CisKK2EudGV4dC1zdWNjZXNzOmhvdmVyLAorYS50ZXh0LXN1Y2Nlc3M6Zm9jdXMgeworICBjb2xvcjogIzM1NjYzNTsKK30KKworLnRleHQtbGVmdCB7CisgIHRleHQtYWxpZ246IGxlZnQ7Cit9CisKKy50ZXh0LXJpZ2h0IHsKKyAgdGV4dC1hbGlnbjogcmlnaHQ7Cit9CisKKy50ZXh0LWNlbnRlciB7CisgIHRleHQtYWxpZ246IGNlbnRlcjsKK30KKworaDEsCitoMiwKK2gzLAoraDQsCitoNSwKK2g2IHsKKyAgbWFyZ2luOiAxMHB4IDA7CisgIGZvbnQtZmFtaWx5OiBpbmhlcml0OworICBmb250LXdlaWdodDogYm9sZDsKKyAgbGluZS1oZWlnaHQ6IDIwcHg7CisgIGNvbG9yOiBpbmhlcml0OworICB0ZXh0LXJlbmRlcmluZzogb3B0aW1pemVsZWdpYmlsaXR5OworfQorCitoMSBzbWFsbCwKK2gyIHNtYWxsLAoraDMgc21hbGwsCitoNCBzbWFsbCwKK2g1IHNtYWxsLAoraDYgc21hbGwgeworICBmb250LXdlaWdodDogbm9ybWFsOworICBsaW5lLWhlaWdodDogMTsKKyAgY29sb3I6ICM5OTk5OTk7Cit9CisKK2gxLAoraDIsCitoMyB7CisgIGxpbmUtaGVpZ2h0OiA0MHB4OworfQorCitoMSB7CisgIGZvbnQtc2l6ZTogMzguNXB4OworfQorCitoMiB7CisgIGZvbnQtc2l6ZTogMzEuNXB4OworfQorCitoMyB7CisgIGZvbnQtc2l6ZTogMjQuNXB4OworfQorCitoNCB7CisgIGZvbnQtc2l6ZTogMTcuNXB4OworfQorCitoNSB7CisgIGZvbnQtc2l6ZTogMTRweDsKK30KKworaDYgeworICBmb250LXNpemU6IDExLjlweDsKK30KKworaDEgc21hbGwgeworICBmb250LXNpemU6IDI0LjVweDsKK30KKworaDIgc21hbGwgeworICBmb250LXNpemU6IDE3LjVweDsKK30KKworaDMgc21hbGwgeworICBmb250LXNpemU6IDE0cHg7Cit9CisKK2g0IHNtYWxsIHsKKyAgZm9udC1zaXplOiAxNHB4OworfQorCisucGFnZS1oZWFkZXIgeworICBwYWRkaW5nLWJvdHRvbTogOXB4OworICBtYXJnaW46IDIwcHggMCAzMHB4OworICBib3JkZXItYm90dG9tOiAxcHggc29saWQgI2VlZWVlZTsKK30KKwordWwsCitvbCB7CisgIHBhZGRpbmc6IDA7CisgIG1hcmdpbjogMCAwIDEwcHggMjVweDsKK30KKwordWwgdWwsCit1bCBvbCwKK29sIG9sLAorb2wgdWwgeworICBtYXJnaW4tYm90dG9tOiAwOworfQorCitsaSB7CisgIGxpbmUtaGVpZ2h0OiAyMHB4OworfQorCit1bC51bnN0eWxlZCwKK29sLnVuc3R5bGVkIHsKKyAgbWFyZ2luLWxlZnQ6IDA7CisgIGxpc3Qtc3R5bGU6IG5vbmU7Cit9CisKK3VsLmlubGluZSwKK29sLmlubGluZSB7CisgIG1hcmdpbi1sZWZ0OiAwOworICBsaXN0LXN0eWxlOiBub25lOworfQorCit1bC5pbmxpbmUgPiBsaSwKK29sLmlubGluZSA+IGxpIHsKKyAgZGlzcGxheTogaW5saW5lLWJsb2NrOworICAqZGlzcGxheTogaW5saW5lOworICBwYWRkaW5nLXJpZ2h0OiA1cHg7CisgIHBhZGRpbmctbGVmdDogNXB4OworICAqem9vbTogMTsKK30KKworZGwgeworICBtYXJnaW4tYm90dG9tOiAyMHB4OworfQorCitkdCwKK2RkIHsKKyAgbGluZS1oZWlnaHQ6IDIwcHg7Cit9CisKK2R0IHsKKyAgZm9udC13ZWlnaHQ6IGJvbGQ7Cit9CisKK2RkIHsKKyAgbWFyZ2luLWxlZnQ6IDEwcHg7Cit9CisKKy5kbC1ob3Jpem9udGFsIHsKKyAgKnpvb206IDE7Cit9CisKKy5kbC1ob3Jpem9udGFsOmJlZm9yZSwKKy5kbC1ob3Jpem9udGFsOmFmdGVyIHsKKyAgZGlzcGxheTogdGFibGU7CisgIGxpbmUtaGVpZ2h0OiAwOworICBjb250ZW50OiAiIjsKK30KKworLmRsLWhvcml6b250YWw6YWZ0ZXIgeworICBjbGVhcjogYm90aDsKK30KKworLmRsLWhvcml6b250YWwgZHQgeworICBmbG9hdDogbGVmdDsKKyAgd2lkdGg6IDE2MHB4OworICBvdmVyZmxvdzogaGlkZGVuOworICBjbGVhcjogbGVmdDsKKyAgdGV4dC1hbGlnbjogcmlnaHQ7CisgIHRleHQtb3ZlcmZsb3c6IGVsbGlwc2lzOworICB3aGl0ZS1zcGFjZTogbm93cmFwOworfQorCisuZG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XVvdGUucHVsbC1yaWdodCBwLAorYmxvY2txdW90ZS5wdWxsLXJpZ2h0IHNtYWxsIHsKKyAgdGV4dC1hbGlnbjogcmlnaHQ7Cit9CisKK2Jsb2NrcXVvdGUucHVsbC1yaWdodCBzbWFsbDpiZWZvcmUgeworICBjb250ZW50OiAnJzsKK30KKworYmxvY2txdW90ZS5wdWxsLXJpZ2h0IHNtYWxsOmFmdGVyIHsKKyAgY29udGVudDogJ1wwMEEwIFwyMDE0JzsKK30KKworcTpiZWZvcmUsCitxOmFmdGVyLAorYmxvY2txdW90ZTpiZWZvcmUsCitibG9ja3F1b3RlOmFmdGVyIHsKKyAgY29udGVudDogIiI7Cit9CisKK2FkZHJlc3MgeworICBkaXNwbGF5OiBibG9jazsKKyAgbWFyZ2luLWJvdHRvbTogMjBweDsKKyAgZm9udC1zdHlsZTogbm9ybWFsOworICBsaW5lLWhlaWdodDogMjBweDsKK30KKworY29kZSwKK3ByZSB7CisgIHBhZGRpbmc6IDAgM3B4IDJweDsKKyAgZm9udC1mYW1pbHk6IE1vbmFjbywgTWVubG8sIENvbnNvbGFzLCAiQ291cmllciBOZXciLCBtb25vc3BhY2U7CisgIGZvbnQtc2l6ZTogMTJweDsKKyAgY29sb3I6ICMzMzMzMzM7CisgIC13ZWJraXQtYm9yZGVyLXJhZGl1czogM3B4OworICAgICAtbW96LWJvcmRlci1yYWRpdXM6IDNweDsKKyAgICAgICAgICBib3JkZXItcmFkaXVzOiAzcHg7Cit9CisKK2NvZGUgeworICBwYWRkaW5nOiAycHggNHB4OworICBjb2xvcjogI2QxNDsKKyAgd2hpdGUtc3BhY2U6IG5vd3JhcDsKKyAgYmFja2dyb3VuZC1jb2xvcjogI2Y3ZjdmOTsKKyAgYm9yZGVyOiAxcHggc29saWQgI2UxZTFlODsKK30KKworcHJlIHsKKyAgZGlzcGxheTogYmxvY2s7CisgIHBhZGRpbmc6IDkuNXB4OworICBtYXJnaW46IDAgMCAxMHB4OworICBmb250LXNpemU6IDEzcHg7CisgIGxpbmUtaGVpZ2h0OiAyMHB4OworICB3b3JkLWJyZWFrOiBicmVhay1hbGw7CisgIHdvcmQtd3JhcDogYnJlYWstd29yZDsKKyAgd2hpdGUtc3BhY2U6IHByZTsKKyAgd2hpdGUtc3BhY2U6IHByZS13cmFwOworICBiYWNrZ3JvdW5kLWNvbG9yOiAjZjVmNWY1OworICBib3JkZXI6IDFweCBzb2xpZCAjY2NjOworICBib3JkZXI6IDFweCBzb2xpZCByZ2JhKDAsIDAsIDAsIDAuMTUpOworICAtd2Via2l0LWJvcmRlci1yYWRpdXM6IDRweDsKKyAgICAgLW1vei1ib3JkZXItcmFkaXVzOiA0cHg7CisgICAgICAgICAgYm9yZGVyLXJhZGl1czogNHB4OworfQorCitwcmUucHJldHR5cHJpbnQgeworICBtYXJnaW4tYm90dG9tOiAyMHB4OworfQorCitwcmUgY29kZSB7CisgIHBhZGRpbmc6IDA7CisgIGNvbG9yOiBpbmhlcml0OworICB3aGl0ZS1zcGFjZTogcHJlOworICB3aGl0ZS1zcGFjZTogcHJlLXdyYXA7CisgIGJhY2tncm91bmQtY29sb3I6IHRyYW5zcGFyZW50OworICBib3JkZXI6IDA7Cit9CisKKy5wcmUtc2Nyb2xsYWJsZSB7CisgIG1heC1oZWlnaHQ6IDM0MHB4OworICBvdmVyZmxvdy15OiBzY3JvbGw7Cit9CisKK2Zvcm0geworICBtYXJnaW46IDAgMCAyMHB4OworfQorCitmaWVsZHNldCB7CisgIHBhZGRpbmc6IDA7CisgIG1hcmdpbjogMDsKKyAgYm9yZGVyOiAwOworfQorCitsZWdlbmQgeworICBkaXNwbGF5OiBibG9jazsKKyAgd2lkdGg6IDEwMCU7CisgIHBhZGRpbmc6IDA7CisgIG1hcmdpbi1ib3R0b206IDIwcHg7CisgIGZvbnQtc2l6ZTogMjFweDsKKyAgbGluZS1oZWlnaHQ6IDQwcHg7CisgIGNvbG9yOiAjMzMzMzMzOworICBib3JkZXI6IDA7CisgIGJvcmRlci1ib3R0b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9ybS1ob3Jpem9udGFsIC5jb250cm9sczpmaXJzdC1jaGlsZCB7CisgICpwYWRkaW5nLWxlZnQ6IDE4MHB4OworfQorCisuZm9ybS1ob3Jpem9udGFsIC5oZWxwLWJsb2NrIHsKKyAgbWFyZ2luLWJvdHRvbTogMDsKK30KKworLmZvcm0taG9yaXpvbnRhbCBpbnB1dCArIC5oZWxwLWJsb2NrLAorLmZvcm0taG9yaXpvbnRhbCBzZWxlY3QgKyAuaGVscC1ibG9jaywKKy5mb3JtLWhvcml6b250YWwgdGV4dGFyZWEgKyAuaGVscC1ibG9jaywKKy5mb3JtLWhvcml6b250YWwgLnVuZWRpdGFibGUtaW5wdXQgKyAuaGVscC1ibG9jaywKKy5mb3JtLWhvcml6b250YWwgLmlucHV0LXByZXBlbmQgKyAuaGVscC1ibG9jaywKKy5mb3JtLWhvcml6b250YWwgLmlucHV0LWFwcGVuZCArIC5oZWxwLWJsb2NrIHsKKyAgbWFyZ2luLXRvcDogMTBweDsKK30KKworLmZvcm0taG9yaXpvbnRhbCAuZm9ybS1hY3Rpb25zIHsKKyAgcGFkZGluZy1sZWZ0OiAxODBweDsKK30KKwordGFibGUgeworICBtYXgtd2lkdGg6IDEwMCU7CisgIGJhY2tncm91bmQtY29sb3I6IHRyYW5zcGFyZW50OworICBib3JkZXItY29sbGFwc2U6IGNvbGxhcHNlOworICBib3JkZXItc3BhY2luZzogMDsKK30KKworLnRhYmxlIHsKKyAgd2lkdGg6IDEwMCU7CisgIG1hcmdpbi1ib3R0b206IDIwcHg7Cit9CisKKy50YWJsZSB0aCwKKy50YWJsZSB0ZCB7CisgIHBhZGRpbmc6IDhweDsKKyAgbGluZS1oZWlnaHQ6IDIwcHg7CisgIHRleHQtYWxpZ246IGxlZnQ7CisgIHZlcnRpY2FsLWFsaWduOiB0b3A7CisgIGJvcmRlci10b3A6IDFweCBzb2xpZCAjZGRkZGRkOworfQorCisudGFibGUgdGggeworICBmb250LXdlaWdodDogYm9sZDsKK30KKworLnRhY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cGFuNSwKKy50YWJsZSB0aC5zcGFuNSB7CisgIGZsb2F0OiBub25lOworICB3aWR0aDogMzY0cHg7CisgIG1hcmdpbi1sZWZ0OiAwOworfQorCisudGFibGUgdGQuc3BhbjYsCisudGFibGUgdGguc3BhbjYgeworICBmbG9hdDogbm9uZTsKKyAgd2lkdGg6IDQ0NHB4OworICBtYXJnaW4tbGVmdDogMDsKK30KKworLnRhYmxlIHRkLnNwYW43LAorLnRhYmxlIHRoLnNwYW43IHsKKyAgZmxvYXQ6IG5vbmU7CisgIHdpZHRoOiA1MjRweDsKKyAgbWFyZ2luLWxlZnQ6IDA7Cit9CisKKy50YWJsZSB0ZC5zcGFuOCwKKy50YWJsZSB0aC5zcGFuOCB7CisgIGZsb2F0OiBub25lOworICB3aWR0aDogNjA0cHg7CisgIG1hcmdpbi1sZWZ0OiAwOworfQorCisudGFibGUgdGQuc3BhbjksCisudGFibGUgdGguc3BhbjkgeworICBmbG9hdDogbm9uZTsKKyAgd2lkdGg6IDY4NHB4OworICBtYXJnaW4tbGVmdDogMDsKK30KKworLnRhYmxlIHRkLnNwYW4xMCwKKy50YWJsZSB0aC5zcGFuMTAgeworICBmbG9hdDogbm9uZTsKKyAgd2lkdGg6IDc2NHB4OworICBtYXJnaW4tbGVmdDogMDsKK30KKworLnRhYmxlIHRkLnNwYW4xMSwKKy50YWJsZSB0aC5zcGFuMTEgeworICBmbG9hdDogbm9uZTsKKyAgd2lkdGg6IDg0NHB4OworICBtYXJnaW4tbGVmdDogMDsKK30KKworLnRhYmxlIHRkLnNwYW4xMiwKKy50YWJsZSB0aC5zcGFuMTIgeworICBmbG9hdDogbm9uZTsKKyAgd2lkdGg6IDkyNHB4OworICBtYXJnaW4tbGVmdDogMDsKK30KKworLnRhYmxlIHRib2R5IHRyLnN1Y2Nlc3MgPiB0ZCB7CisgIGJhY2tncm91bmQtY29sb3I6ICNkZmYwZDg7Cit9CisKKy50YWJsZSB0Ym9keSB0ci5lcnJvciA+IHRkIHsKKyA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bi1zdWJtZW51OmZvY3VzID4gYSA+IFtjbGFzcyo9IiBpY29uLSJdIHsKKyAgYmFja2dyb3VuZC1pbWFnZTogdXJsKCIuLi9pbWcvZ2x5cGhpY29ucy1oYWxmbGluZ3Mtd2hpdGUucG5nIik7Cit9CisKKy5pY29uLWdsYXNzIHsKKyAgYmFja2dyb3VuZC1wb3NpdGlvbjogMCAgICAgIDA7Cit9CisKKy5pY29uLW11c2ljIHsKKyAgYmFja2dyb3VuZC1wb3NpdGlvbjogLTI0cHggMDsKK30KKworLmljb24tc2VhcmNoIHsKKyAgYmFja2dyb3VuZC1wb3NpdGlvbjogLTQ4cHggMDsKK30KKworLmljb24tZW52ZWxvcGUgeworICBiYWNrZ3JvdW5kLXBvc2l0aW9uOiAtNzJweCAwOworfQorCisuaWNvbi1oZWFydCB7CisgIGJhY2tncm91bmQtcG9zaXRpb246IC05NnB4IDA7Cit9CisKKy5pY29uLXN0YXIgeworICBiYWNrZ3JvdW5kLXBvc2l0aW9uOiAtMTIwcHggMDsKK30KKworLmljb24tc3Rhci1lbXB0eSB7CisgIGJhY2tncm91bmQtcG9zaXRpb246IC0xNDRweCAwOworfQorCisuaWNvbi11c2VyIHsKKyAgYmFja2dyb3VuZC1wb3NpdGlvbjogLTE2OHB4IDA7Cit9CisKKy5pY29uLWZpbG0geworICBiYWNrZ3JvdW5kLXBvc2l0aW9uOiAtMTkycHggMDsKK30KKworLmljb24tdGgtbGFyZ2UgeworICBiYWNrZ3JvdW5kLXBvc2l0aW9uOiAtMjE2cHggMDsKK30KKworLmljb24tdGggeworICBiYWNrZ3JvdW5kLXBvc2l0aW9uOiAtMjQwcHggMDsKK30KKworLmljb24tdGgtbGlzdCB7CisgIGJhY2tncm91bmQtcG9zaXRpb246IC0yNjRweCAwOworfQorCisuaWNvbi1vayB7CisgIGJhY2tncm91bmQtcG9zaXRpb246IC0yODhweCAwOworfQorCisuaWNvbi1yZW1vdmUgeworICBiYWNrZ3JvdW5kLXBvc2l0aW9uOiAtMzEycHggMDsKK30KKworLmljb24tem9vbS1pbiB7CisgIGJhY2tncm91bmQtcG9zaXRpb246IC0zMzZweCAwOworfQorCisuaWNvbi16b29tLW91dCB7CisgIGJhY2tncm91bmQtcG9zaXRpb246IC0zNjBweCAwOworfQorCisuaWNvbi1vZmYgeworICBiYWNrZ3JvdW5kLXBvc2l0aW9uOiAtMzg0cHggMDsKK30KKworLmljb24tc2lnbmFsIHsKKyAgYmFja2dyb3VuZC1wb3NpdGlvbjogLTQwOHB4IDA7Cit9CisKKy5pY29uLWNvZyB7CisgIGJhY2tncm91bmQtcG9zaXRpb246IC00MzJweCAwOworfQorCisuaWNvbi10cmFzaCB7CisgIGJhY2tncm91bmQtcG9zaXRpb246IC00NTZweCAwOworfQorCisuaWNvbi1ob21lIHsKKyAgYmFja2dyb3VuZC1wb3NpdGlvbjogMCAtMjRweDsKK30KKworLmljb24tZmlsZSB7CisgIGJhY2tncm91bmQtcG9zaXRpb246IC0yNHB4IC0yNHB4OworfQorCisuaWNvbi10aW1lIHsKKyAgYmFja2dyb3VuZC1wb3NpdGlvbjogLTQ4cHggLTI0cHg7Cit9CisKKy5pY29uLXJvYWQgeworICBiYWNrZ3JvdW5kLXBvc2l0aW9uOiAtNzJweCAtMjRweDsKK30KKworLmljb24tZG93bmxvYWQtYWx0IHsKKyAgYmFja2dyb3VuZC1wb3NpdGlvbjogLTk2cHggLTI0cHg7Cit9CisKKy5pY29uLWRvd25sb2FkIHsKKyAgYmFja2dyb3VuZC1wb3NpdGlvbjogLTEyMHB4IC0yNHB4OworfQorCisuaWNvbi11cGxvYWQgeworICBiYWNrZ3JvdW5kLXBvc2l0aW9uOiAtMTQ0cHggLTI0cHg7Cit9CisKKy5pY29uLWluYm94IHsKKyAgYmFja2dyb3VuZC1wb3NpdGlvbjogLTE2OHB4IC0yNHB4OworfQorCisuaWNvbi1wbGF5LWNpcmNsZSB7CisgIGJhY2tncm91bmQtcG9zaXRpb246IC0xOTJweCAtMjRweDsKK30KKworLmljb24tcmVwZWF0IHsKKyAgYmFja2dyb3VuZC1wb3NpdGlvbjogLTIxNnB4IC0yNHB4OworfQorCisuaWNvbi1yZWZyZXNoIHsKKyAgYmFja2dyb3VuZC1wb3NpdGlvbjogLTI0MHB4IC0yNHB4OworfQorCisuaWNvbi1saXN0LWFsdCB7CisgIGJhY2tncm91bmQtcG9zaXRpb246IC0yNjRweCAtMjRweDsKK30KKworLmljb24tbG9jayB7CisgIGJhY2tncm91bmQtcG9zaXRpb246IC0yODdweCAtMjRweDsKK30KKworLmljb24tZmxhZyB7CisgIGJhY2tncm91bmQtcG9zaXRpb246IC0zMTJweCAtMjRweDsKK30KKworLmljb24taGVhZHBob25lcyB7CisgIGJhY2tncm91bmQtcG9zaXRpb246IC0zMzZweCAtMjRweDsKK30KKworLmljb24tdm9sdW1lLW9mZiB7CisgIGJhY2tncm91bmQtcG9zaXRpb246IC0zNjBweCAtMjRweDsKK30KKworLmljb24tdm9sdW1lLWRvd24geworICBiYWNrZ3JvdW5kLXBvc2l0aW9uOiAtMzg0cHggLTI0cHg7Cit9CisKKy5pY29uLXZvbHVtZS11cCB7CisgIGJhY2tncm91bmQtcG9zaXRpb246IC00MDhweCAtMjRweDsKK30KKworLmljb24tcXJjb2RlIHsKKyAgYmFja2dyb3VuZC1wb3NpdGlvbjogLTQzMnB4IC0yNHB4OworfQorCisuaWNvbi1iYXJjb2RlIHsKKyAgYmFja2dyb3VuZC1wb3NpdGlvbjogLTQ1NnB4IC0yNHB4OworfQorCisuaWNvbi10YWcgeworICBiYWNrZ3JvdW5kLXBvc2l0aW9uOiAwIC00OHB4OworfQorCisuaWNvbi10YWdzIHsKKyAgYmFja2dyb3VuZC1wb3NpdGlvbjogLTI1cHggLTQ4cHg7Cit9CisKKy5pY29uLWJvb2sgeworICBiYWNrZ3JvdW5kLXBvc2l0aW9uOiAtNDhweCAtNDhweDsKK30KKworLmljb24tYm9va21hcmsgeworICBiYWNrZ3JvdW5kLXBvc2l0aW9uOiAtNzJweCAtNDhweDsKK30KKworLmljb24tcHJpbnQgeworICBiYWNrZ3JvdW5kLXBvc2l0aW9uOiAtOTZweCAtNDhweDsKK30KKworLmljb24tY2FtZXJhIHsKKyAgYmFja2dyb3VuZC1wb3NpdGlvbjogLTEyMHB4IC00OHB4OworfQorCisuaWNvbi1mb250IHsKKyAgYmFja2dyb3VuZC1wb3NpdGlvbjogLTE0NHB4IC00OHB4OworfQorCisuaWNvbi1ib2xkIHsKKyAgYmFja2dyb3VuZC1wb3NpdGlvbjogLTE2N3B4IC00OHB4OworfQorCisuaWNvbi1pdGFsaWMgeworICBiYWNrZ3JvdW5kLXBvc2l0aW9uOiAtMTkycHggLTQ4cHg7Cit9CisKKy5pY29uLXRleHQtaGVpZ2h0IHsKKyAgYmFja2dyb3VuZC1wb3NpdGlvbjogLTIxNnB4IC00OHB4OworfQorCisuaWNvbi10ZXh0LXdpZHRoIHsKKyAgYmFja2dyb3VuZC1wb3NpdGlvbjogLTI0MHB4IC00OHB4OworfQorCisuaWNvbi1hbGlnbi1sZWZ0IHsKKyAgYmFja2dyb3VuZC1wb3NpdGlvbjogLTI2NHB4IC00OHB4OworfQorCisuaWNvbi1hbGlnbi1jZW50ZXIgeworICBiYWNrZ3JvdW5kLXBvc2l0aW9uOiAtMjg4cHggLTQ4cHg7Cit9CisKKy5pY29uLWFsaWduLXJpZ2h0IHsKKyAgYmFja2dyb3VuZC1wb3NpdGlvbjogLTMxMnB4IC00OHB4OworfQorCisuaWNvbi1hbGlnbi1qdXN0aWZ5IHsKKyAgYmFja2dyb3VuZC1wb3NpdGlvbjogLTMzNnB4IC00OHB4OworfQorCisuaWNvbi1saXN0IHsKKyAgYmFja2dyb3VuZC1wb3NpdGlvbjogLTM2MHB4IC00OHB4OworfQorCisuaWNvbi1pbmRlbnQtbGVmdCB7CisgIGJhY2tncm91bmQtcG9zaXRpb246IC0zODRweCAtNDhweDsKK30KKworLmljb24taW5kZW50LXJpZ2h0IHsKKyAgYmFja2dyb3VuZC1wb3NpdGlvbjogLTQwOHB4IC00OHB4OworfQorCisuaWNvbi1mYWNldGltZS12aWRlbyB7CisgIGJhY2tncm91bmQtcG9zaXRpb246IC00MzJweCAtNDhweDsKK30KKworLmljb24tcGljdHVyZSB7CisgIGJhY2tncm91bmQtcG9zaXRpb246IC00NTZweCAtNDhweDsKK30KKworLmljb24tcGVuY2lsIHsKKyAgYmFja2dyb3VuZC1wb3NpdGlvbjogMCAtNzJweDsKK30KKworLmljb24tbWFwLW1hcmtlciB7CisgIGJhY2tncm91bmQtcG9zaXRpb246IC0yNHB4IC03MnB4OworfQorCisuaWNvbi1hZGp1c3QgeworICBiYWNrZ3JvdW5kLXBvc2l0aW9uOiAtNDhweCAtNzJweDsKK30KKworLmljb24tdGludCB7CisgIGJhY2tncm91bmQtcG9zaXRpb246IC03MnB4IC03MnB4OworfQorCisuaWNvbi1lZGl0IHsKKyAgYmFja2dyb3VuZC1wb3NpdGlvbjogLTk2cHggLTcycHg7Cit9CisKKy5pY29uLXNoYXJlIHsKKyAgYmFja2dyb3VuZC1wb3NpdGlvbjogLTEyMHB4IC03MnB4OworfQorCisuaWNvbi1jaGVjayB7CisgIGJhY2tncm91bmQtcG9zaXRpb246IC0xNDRweCAtNzJweDsKK30KKworLmljb24tbW92ZSB7CisgIGJhY2tncm91bmQtcG9zaXRpb246IC0xNjhweCAtNzJweDsKK30KKworLmljb24tc3RlcC1iYWNrd2FyZCB7CisgIGJhY2tncm91bmQtcG9zaXRpb246IC0xOTJweCAtNzJweDsKK30KKworLmljb24tZmFzdC1iYWNrd2FyZCB7CisgIGJhY2tncm91bmQtcG9zaXRpb246IC0yMTZweCAtNzJweDsKK30KKworLmljb24tYmFja3dhcmQgeworICBiYWNrZ3JvdW5kLXBvc2l0aW9uOiAtMjQwcHggLTcycHg7Cit9CisKKy5pY29uLXBsYXkgeworICBiYWNrZ3JvdW5kLXBvc2l0aW9uOiAtMjY0cHggLTcycHg7Cit9CisKKy5pY29uLXBhdXNlIHsKKyAgYmFja2dyb3VuZC1wb3NpdGlvbjogLTI4OHB4IC03MnB4OworfQorCisuaWNvbi1zdG9wIHsKKyAgYmFja2dyb3VuZC1wb3NpdGlvbjogLTMxMnB4IC03MnB4OworfQorCisuaWNvbi1mb3J3YXJkIHsKKyAgYmFja2dyb3VuZC1wb3NpdGlvbjogLTMzNnB4IC03MnB4OworfQorCisuaWNvbi1mYXN0LWZvcndhcmQgeworICBiYWNrZ3JvdW5kLXBvc2l0aW9uOiAtMzYwcHggLTcycHg7Cit9CisKKy5pY29uLXN0ZXAtZm9yd2FyZCB7CisgIGJhY2tncm91bmQtcG9zaXRpb246IC0zODRweCAtNzJweDsKK30KKworLmljb24tZWplY3QgeworICBiYWNrZ3JvdW5kLXBvc2l0aW9uOiAtNDA4cHggLTcycHg7Cit9CisKKy5pY29uLWNoZXZyb24tbGVmdCB7CisgIGJhY2tncm91bmQtcG9zaXRpb246IC00MzJweCAtNzJweDsKK30KKworLmljb24tY2hldnJvbi1yaWdodCB7CisgIGJhY2tncm91bmQtcG9zaXRpb246IC00NTZweCAtNzJweDsKK30KKworLmljb24tcGx1cy1zaWduIHsKKyAgYmFja2dyb3VuZC1wb3NpdGlvbjogMCAtOTZweDsKK30KKworLmljb24tbWludXMtc2lnbiB7CisgIGJhY2tncm91bmQtcG9zaXRpb246IC0yNHB4IC05NnB4OworfQorCisuaWNvbi1yZW1vdmUtc2lnbiB7CisgIGJhY2tncm91bmQtcG9zaXRpb246IC00OHB4IC05NnB4OworfQorCisuaWNvbi1vay1zaWduIHsKKyAgYmFja2dyb3VuZC1wb3NpdGlvbjogLTcycHggLTk2cHg7Cit9CisKKy5pY29uLXF1ZXN0aW9uLXNpZ24geworICBiYWNrZ3JvdW5kLXBvc2l0aW9uOiAtOTZweCAtOTZweDsKK30KKworLmljb24taW5mby1zaWduIHsKKyAgYmFja2dyb3VuZC1wb3NpdGlvbjogLTEyMHB4IC05NnB4OworfQorCisuaWNvbi1zY3JlZW5zaG90IHsKKyAgYmFja2dyb3VuZC1wb3NpdGlvbjogLTE0NHB4IC05NnB4OworfQorCisuaWNvbi1yZW1vdmUtY2lyY2xlIHsKKyAgYmFja2dyb3VuZC1wb3NpdGlvbjogLTE2OHB4IC05NnB4OworfQorCisuaWNvbi1vay1jaXJjbGUgeworICBiYWNrZ3JvdW5kLXBvc2l0aW9uOiAtMTkycHggLTk2cHg7Cit9CisKKy5pY29uLWJhbi1jaXJjbGUgeworICBiYWNrZ3JvdW5kLXBvc2l0aW9uOiAtMjE2cHggLTk2cHg7Cit9CisKKy5pY29uLWFycm93LWxlZnQgeworICBiYWNrZ3JvdW5kLXBvc2l0aW9uOiAtMjQwcHggLTk2cHg7Cit9CisKKy5pY29uLWFycm93LXJpZ2h0IHsKKyAgYmFja2dyb3VuZC1wb3NpdGlvbjogLTI2NHB4IC05NnB4OworfQorCisuaWNvbi1hcnJvdy11cCB7CisgIGJhY2tncm91bmQtcG9zaXRpb246IC0yODlweCAtOTZweDsKK30KKworLmljb24tYXJyb3ctZG93biB7CisgIGJhY2tncm91bmQtcG9zaXRpb246IC0zMTJweCAtOTZweDsKK30KKworLmljb24tc2hhcmUtYWx0IHsKKyAgYmFja2dyb3VuZC1wb3NpdGlvbjogLTMzNnB4IC05NnB4OworfQorCisuaWNvbi1yZXNpemUtZnVsbCB7CisgIGJhY2tncm91bmQtcG9zaXRpb246IC0zNjBweCAtOTZweDsKK30KKworLmljb24tcmVzaXplLXNtYWxsIHsKKyAgYmFja2dyb3VuZC1wb3NpdGlvbjogLTM4NHB4IC05NnB4OworfQorCisuaWNvbi1wbHVzIHsKKyAgYmFja2dyb3VuZC1wb3NpdGlvbjogLTQwOHB4IC05NnB4OworfQorCisuaWNvbi1taW51cyB7CisgIGJhY2tncm91bmQtcG9zaXRpb246IC00MzNweCAtOTZweDsKK30KKworLmljb24tYXN0ZXJpc2sgeworICBiYWNrZ3JvdW5kLXBvc2l0aW9uOiAtNDU2cHggLTk2cHg7Cit9CisKKy5pY29uLWV4Y2xhbWF0aW9uLXNpZ24geworICBiYWNrZ3JvdW5kLXBvc2l0aW9uOiAwIC0xMjBweDsKK30KKworLmljb24tZ2lmdCB7CisgIGJhY2tncm91bmQtcG9zaXRpb246IC0yNHB4IC0xMjBweDsKK30KKworLmljb24tbGVhZiB7CisgIGJhY2tncm91bmQtcG9zaXRpb246IC00OHB4IC0xMjBweDsKK30KKworLmljb24tZmlyZSB7CisgIGJhY2tncm91bmQtcG9zaXRpb246IC03MnB4IC0xMjBweDsKK30KKworLmljb24tZXllLW9wZW4geworICBiYWNrZ3JvdW5kLXBvc2l0aW9uOiAtOTZweCAtMTIwcHg7Cit9CisKKy5pY29uLWV5ZS1jbG9zZSB7CisgIGJhY2tncm91bmQtcG9zaXRpb246IC0xMjBweCAtMTIwcHg7Cit9CisKKy5pY29uLXdhcm5pbmctc2lnbiB7CisgIGJhY2tncm91bmQtcG9zaXRpb246IC0xNDRweCAtMTIwcHg7Cit9CisKKy5pY29uLXBsYW5lIHsKKyAgYmFja2dyb3VuZC1wb3NpdGlvbjogLTE2OHB4IC0xMjBweDsKK30KKworLmljb24tY2FsZW5kYXIgeworICBiYWNrZ3JvdW5kLXBvc2l0aW9uOiAtMTkycHggLTEyMHB4OworfQorCisuaWNvbi1yYW5kb20geworICB3aWR0aDogMTZweDsKKyAgYmFja2dyb3VuZC1wb3NpdGlvbjogLTIxNnB4IC0xMjBweDsKK30KKworLmljb24tY29tbWVudCB7CisgIGJhY2tncm91bmQtcG9zaXRpb246IC0yNDBweCAtMTIwcHg7Cit9CisKKy5pY29uLW1hZ25ldCB7CisgIGJhY2tncm91bmQtcG9zaXRpb246IC0yNjRweCAtMTIwcHg7Cit9CisKKy5pY29uLWNoZXZyb24tdXAgeworICBiYWNrZ3JvdW5kLXBvc2l0aW9uOiAtMjg4cHggLTEyMHB4OworfQorCisuaWNvbi1jaGV2cm9uLWRvd24geworICBiYWNrZ3JvdW5kLXBvc2l0aW9uOiAtMzEzcHggLTExOXB4OworfQorCisuaWNvbi1yZXR3ZWV0IHsKKyAgYmFja2dyb3VuZC1wb3NpdGlvbjogLTMzNnB4IC0xMjBweDsKK30KKworLmljb24tc2hvcHBpbmctY2FydCB7CisgIGJhY2tncm91bmQtcG9zaXRpb246IC0zNjBweCAtMTIwcHg7Cit9CisKKy5pY29uLWZvbGRlci1jbG9zZSB7CisgIHdpZHRoOiAxNnB4OworICBiYWNrZ3JvdW5kLXBvc2l0aW9uOiAtMzg0cHggLTEyMHB4OworfQorCisuaWNvbi1mb2xkZXItb3BlbiB7CisgIHdpZHRoOiAxNnB4OworICBiYWNrZ3JvdW5kLXBvc2l0aW9uOiAtNDA4cHggLTEyMHB4OworfQorCisuaWNvbi1yZXNpemUtdmVydGljYWwgeworICBiYWNrZ3JvdW5kLXBvc2l0aW9uOiAtNDMycHggLTExOXB4OworfQorCisuaWNvbi1yZXNpemUtaG9yaXpvbnRhbCB7CisgIGJhY2tncm91bmQtcG9zaXRpb246IC00NTZweCAtMTE4cHg7Cit9CisKKy5pY29uLWhkZCB7CisgIGJhY2tncm91bmQtcG9zaXRpb246IDAgLTE0NHB4OworfQorCisuaWNvbi1idWxsaG9ybiB7CisgIGJhY2tncm91bmQtcG9zaXRpb246IC0yNHB4IC0xNDRweDsKK30KKworLmljb24tYmVsbCB7CisgIGJhY2tncm91bmQtcG9zaXRpb246IC00OHB4IC0xNDRweDsKK30KKworLmljb24tY2VydGlmaWNhdGUgeworICBiYWNrZ3JvdW5kLXBvc2l0aW9uOiAtNzJweCAtMTQ0cHg7Cit9CisKKy5pY29uLXRodW1icy11cCB7CisgIGJhY2tncm91bmQtcG9zaXRpb246IC05NnB4IC0xNDRweDsKK30KKworLmljb24tdGh1bWJzLWRvd24geworICBiYWNrZ3JvdW5kLXBvc2l0aW9uOiAtMTIwcHggLTE0NHB4OworfQorCisuaWNvbi1oYW5kLXJpZ2h0IHsKKyAgYmFja2dyb3VuZC1wb3NpdGlvbjogLTE0NHB4IC0xNDRweDsKK30KKworLmljb24taGFuZC1sZWZ0IHsKKyAgYmFja2dyb3VuZC1wb3NpdGlvbjogLTE2OHB4IC0xNDRweDsKK30KKworLmljb24taGFuZC11cCB7CisgIGJhY2tncm91bmQtcG9zaXRpb246IC0xOTJweCAtMTQ0cHg7Cit9CisKKy5pY29uLWhhbmQtZG93biB7CisgIGJhY2tncm91bmQtcG9zaXRpb246IC0yMTZweCAtMTQ0cHg7Cit9CisKKy5pY29uLWNpcmNsZS1hcnJvdy1yaWdodCB7CisgIGJhY2tncm91bmQtcG9zaXRpb246IC0yNDBweCAtMTQ0cHg7Cit9CisKKy5pY29uLWNpcmNsZS1hcnJvdy1sZWZ0IHsKKyAgYmFja2dyb3VuZC1wb3NpdGlvbjogLTI2NHB4IC0xNDRweDsKK30KKworLmljb24tY2lyY2xlLWFycm93LXVwIHsKKyAgYmFja2dyb3VuZC1wb3NpdGlvbjogLTI4OHB4IC0xNDRweDsKK30KKworLmljb24tY2lyY2xlLWFycm93LWRvd24geworICBiYWNrZ3JvdW5kLXBvc2l0aW9uOiAtMzEycHggLTE0NHB4OworfQorCisuaWNvbi1nbG9iZSB7CisgIGJhY2tncm91bmQtcG9zaXRpb246IC0zMzZweCAtMTQ0cHg7Cit9CisKKy5pY29uLXdyZW5jaCB7CisgIGJhY2tncm91bmQtcG9zaXRpb246IC0zNjBweCAtMTQ0cHg7Cit9CisKKy5pY29uLXRhc2tzIHsKKyAgYmFja2dyb3VuZC1wb3NpdGlvbjogLTM4NHB4IC0xNDRweDsKK30KKworLmljb24tZmlsdGVyIHsKKyAgYmFja2dyb3VuZC1wb3NpdGlvbjogLTQwOHB4IC0xNDRweDsKK30KKworLmljb24tYnJpZWZjYXNlIHsKKyAgYmFja2dyb3VuZC1wb3NpdGlvbjogLTQzMnB4IC0xNDRweDsKK30KKworLmljb24tZnVsbHNjcmVlbiB7CisgIGJhY2tncm91bmQtcG9zaXRpb246IC00NTZweCAtMTQ0cHg7Cit9CisKKy5kcm9wdXAsCisuZHJvcGRvd24geworICBwb3NpdGlvbjogcmVsYXRpdmU7Cit9CisKKy5kcm9wZG93bi10b2dnbGUgeworICAqbWFyZ2luLWJvdHRvbTogLTNweDsKK30KKworLmRyb3Bkb3duLXRvZ2dsZTphY3RpdmUsCisub3BlbiAuZHJvcGRvd24tdG9nZ2xlIHsKKyAgb3V0bGluZTogMDsKK30KKworLmNhcmV0IHsKKyAgZGlzcGxheTogaW5saW5lLWJsb2NrOworICB3aWR0aDogMDsKKyAgaGVpZ2h0OiAwOworICB2ZXJ0aWNhbC1hbGlnbjogdG9wOworICBib3JkZXItdG9wOiA0cHggc29saWQgIzAwMDAwMDsKKyAgYm9yZGVyLXJpZ2h0OiA0cHggc29saWQgdHJhbnNwYXJlbnQ7CisgIGJvcmRlci1sZWZ0OiA0cHggc29saWQgdHJhbnNwYXJlbnQ7CisgIGNvbnRlbnQ6ICIiOworfQorCisuZHJvcGRvd24gLmNhcmV0IHsKKyAgbWFyZ2luLXRvcDogOHB4OworICBtYXJnaW4tbGVmdDogMnB4OworfQorCisuZHJvcGRvd24tbWVudSB7CisgIHBvc2l0aW9uOiBhYnNvbHV0ZTsKKyAgdG9wOiAxMDAlOworICBsZWZ0OiAwOworICB6LWluZGV4OiAxMDAwOworICBkaXNwbGF5OiBub25lOworICBmbG9hdDogbGVmdDsKKyAgbWluLXdpZHRoOiAxNjBweDsKKyAgcGFkZGluZzogNXB4IDA7CisgIG1hcmdpbjogMnB4IDAgMDsKKyAgbGlzdC1zdHlsZTogbm9uZTsKKyAgYmFja2dyb3VuZC1jb2xvcjogI2ZmZmZmZjsKKyAgYm9yZGVyOiAxcHggc29saWQgI2NjYzsKKyAgYm9yZGVyOiAxcHggc29saWQgcmdiYSgwLCAwLCAwLCAwLjIpOworICAqYm9yZGVyLXJpZ2h0LXdpZHRoOiAycHg7CisgICpib3JkZXItYm90dG9tLXdpZHRoOiAycHg7CisgIC13ZWJraXQtYm9yZGVyLXJhZGl1czogNnB4OworICAgICAtbW96LWJvcmRlci1yYWRpdXM6IDZwe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otYm9yZGVyLXJhZGl1czogMCA2cHggNnB4IDZweDsKKyAgICAgICAgICBib3JkZXItcmFkaXVzOiAwIDZweCA2cHggNnB4OworfQorCisuZHJvcGRvd24tc3VibWVudTpob3ZlciA+IC5kcm9wZG93bi1tZW51IHsKKyAgZGlzcGxheTogYmxvY2s7Cit9CisKKy5kcm9wdXAgLmRyb3Bkb3duLXN1Ym1lbnUgPiAuZHJvcGRvd24tbWVudSB7CisgIHRvcDogYXV0bzsKKyAgYm90dG9tOiAwOworICBtYXJnaW4tdG9wOiAwOworICBtYXJnaW4tYm90dG9tOiAtMnB4OworICAtd2Via2l0LWJvcmRlci1yYWRpdXM6IDVweCA1cHggNXB4IDA7CisgICAgIC1tb3otYm9yZGVyLXJhZGl1czogNXB4IDVweCA1cHggMDsKKyAgICAgICAgICBib3JkZXItcmFkaXVzOiA1cHggNXB4IDVweCAwOworfQorCisuZHJvcGRvd24tc3VibWVudSA+IGE6YWZ0ZXIgeworICBkaXNwbGF5OiBibG9jazsKKyAgZmxvYXQ6IHJpZ2h0OworICB3aWR0aDogMDsKKyAgaGVpZ2h0OiAwOworICBtYXJnaW4tdG9wOiA1cHg7CisgIG1hcmdpbi1yaWdodDogLTEwcHg7CisgIGJvcmRlci1jb2xvcjogdHJhbnNwYXJlbnQ7CisgIGJvcmRlci1sZWZ0LWNvbG9yOiAjY2NjY2NjOworICBib3JkZXItc3R5bGU6IHNvbGlkOworICBib3JkZXItd2lkdGg6IDVweCAwIDVweCA1cHg7CisgIGNvbnRlbnQ6ICIgIjsKK30KKworLmRyb3Bkb3duLXN1Ym1lbnU6aG92ZXIgPiBhOmFmdGVyIHsKKyAgYm9yZGVyLWxlZnQtY29sb3I6ICNmZmZmZmY7Cit9CisKKy5kcm9wZG93bi1zdWJtZW51LnB1bGwtbGVmdCB7CisgIGZsb2F0OiBub25lOworfQorCisuZHJvcGRvd24tc3VibWVudS5wdWxsLWxlZnQgPiAuZHJvcGRvd24tbWVudSB7CisgIGxlZnQ6IC0xMDAlOworICBtYXJnaW4tbGVmdDogMTBweDsKKyAgLXdlYmtpdC1ib3JkZXItcmFkaXVzOiA2cHggMCA2cHggNnB4OworICAgICAtbW96LWJvcmRlci1yYWRpdXM6IDZweCAwIDZweCA2cHg7CisgICAgICAgICAgYm9yZGVyLXJhZGl1czogNnB4IDAgNnB4IDZweDsKK30KKworLmRyb3Bkb3duIC5kcm9wZG93bi1tZW51IC5uYXYtaGVhZGVyIHsKKyAgcGFkZGluZy1yaWdodDogMjBweDsKKyAgcGFkZGluZy1sZWZ0OiAyMHB4OworfQorCisudHlwZWFoZWFkIHsKKyAgei1pbmRleDogMTA1MTsKKyAgbWFyZ2luLXRvcDogMnB4OworICAtd2Via2l0LWJvcmRlci1yYWRpdXM6IDRweDsKKyAgICAgLW1vei1ib3JkZXItcmFkaXVzOiA0cHg7CisgICAgICAgICAgYm9yZGVyLXJhZGl1czogNHB4OworfQorCisud2VsbCB7CisgIG1pbi1oZWlnaHQ6IDIwcHg7CisgIHBhZGRpbmc6IDE5cHg7CisgIG1hcmdpbi1ib3R0b206IDIwcHg7CisgIGJhY2tncm91bmQtY29sb3I6ICNmNWY1ZjU7CisgIGJvcmRlcjogMXB4IHNvbGlkICNlM2UzZTM7CisgIC13ZWJraXQtYm9yZGVyLXJhZGl1czogNHB4OworICAgICAtbW96LWJvcmRlci1yYWRpdXM6IDRweDsKKyAgICAgICAgICBib3JkZXItcmFkaXVzOiA0cHg7CisgIC13ZWJraXQtYm94LXNoYWRvdzogaW5zZXQgMCAxcHggMXB4IHJnYmEoMCwgMCwgMCwgMC4wNSk7CisgICAgIC1tb3otYm94LXNoYWRvdzogaW5zZXQgMCAxcHggMXB4IHJnYmEoMCwgMCwgMCwgMC4wNSk7CisgICAgICAgICAgYm94LXNoYWRvdzogaW5zZXQgMCAxcHggMXB4IHJnYmEoMCwgMCwgMCwgMC4wNSk7Cit9CisKKy53ZWxsIGJsb2NrcXVvdGUgeworICBib3JkZXItY29sb3I6ICNkZGQ7CisgIGJvcmRlci1jb2xvcjogcmdiYSgwLCAwLCAwLCAwLjE1KTsKK30KKworLndlbGwtbGFyZ2UgeworICBwYWRkaW5nOiAyNHB4OworICAtd2Via2l0LWJvcmRlci1yYWRpdXM6IDZweDsKKyAgICAgLW1vei1ib3JkZXItcmFkaXVzOiA2cHg7CisgICAgICAgICAgYm9yZGVyLXJhZGl1czogNnB4OworfQorCisud2VsbC1zbWFsbCB7CisgIHBhZGRpbmc6IDlweDsKKyAgLXdlYmtpdC1ib3JkZXItcmFkaXVzOiAzcHg7CisgICAgIC1tb3otYm9yZGVyLXJhZGl1czogM3B4OworICAgICAgICAgIGJvcmRlci1yYWRpdXM6IDNweDsKK30KKworLmZhZGUgeworICBvcGFjaXR5OiAwOworICAtd2Via2l0LXRyYW5zaXRpb246IG9wYWNpdHkgMC4xNXMgbGluZWFyOworICAgICAtbW96LXRyYW5zaXRpb246IG9wYWNpdHkgMC4xNXMgbGluZWFyOworICAgICAgIC1vLXRyYW5zaXRpb246IG9wYWNpdHkgMC4xNXMgbGluZWFyOworICAgICAgICAgIHRyYW5zaXRpb246IG9wYWNpdHkgMC4xNXMgbGluZWFyOworfQorCisuZmFkZS5pbiB7CisgIG9wYWNpdHk6IDE7Cit9CisKKy5jb2xsYXBzZSB7CisgIHBvc2l0aW9uOiByZWxhdGl2ZTsKKyAgaGVpZ2h0OiAwOworICBvdmVyZmxvdzogaGlkZGVuOworICAtd2Via2l0LXRyYW5zaXRpb246IGhlaWdodCAwLjM1cyBlYXNlOworICAgICAtbW96LXRyYW5zaXRpb246IGhlaWdodCAwLjM1cyBlYXNlOworICAgICAgIC1vLXRyYW5zaXRpb246IGhlaWdodCAwLjM1cyBlYXNlOworICAgICAgICAgIHRyYW5zaXRpb246IGhlaWdodCAwLjM1cyBlYXNlOworfQorCisuY29sbGFwc2UuaW4geworICBoZWlnaHQ6IGF1dG87Cit9CisKKy5jbG9zZSB7CisgIGZsb2F0OiByaWdodDsKKyAgZm9udC1zaXplOiAyMHB4OworICBmb250LXdlaWdodDogYm9sZDsKKyAgbGluZS1oZWlnaHQ6IDIwcHg7CisgIGNvbG9yOiAjMDAwMDAwOworICB0ZXh0LXNoYWRvdzogMCAxcHggMCAjZmZmZmZmOworICBvcGFjaXR5OiAwLjI7CisgIGZpbHRlcjogYWxwaGEob3BhY2l0eT0yMCk7Cit9CisKKy5jbG9zZTpob3ZlciwKKy5jbG9zZTpmb2N1cyB7CisgIGNvbG9yOiAjMDAwMDAwOworICB0ZXh0LWRlY29yYXRpb246IG5vbmU7CisgIGN1cnNvcjogcG9pbnRlcjsKKyAgb3BhY2l0eTogMC40OworICBmaWx0ZXI6IGFscGhhKG9wYWNpdHk9NDApOworfQorCitidXR0b24uY2xvc2UgeworICBwYWRkaW5nOiAwOworICBjdXJzb3I6IHBvaW50ZXI7CisgIGJhY2tncm91bmQ6IHRyYW5zcGFyZW50OworICBib3JkZXI6IDA7CisgIC13ZWJraXQtYXBwZWFyYW5jZTogbm9uZTsKK30KKworLmJ0biB7CisgIGRpc3BsYXk6IGlubGluZS1ibG9jazsKKyAgKmRpc3BsYXk6IGlubGluZTsKKyAgcGFkZGluZzogNHB4IDEycHg7CisgIG1hcmdpbi1ib3R0b206IDA7CisgICptYXJnaW4tbGVmdDogLjNlbTsKKyAgZm9udC1zaXplOiAxNHB4OworICBsaW5lLWhlaWdodDogMjBweDsKKyAgY29sb3I6ICMzMzMzMzM7CisgIHRleHQtYWxpZ246IGNlbnRlcjsKKyAgdGV4dC1zaGFkb3c6IDAgMXB4IDFweCByZ2JhKDI1NSwgMjU1LCAyNTUsIDAuNzUpOworICB2ZXJ0aWNhbC1hbGlnbjogbWlkZGxlOworICBjdXJzb3I6IHBvaW50ZXI7CisgIGJhY2tncm91bmQtY29sb3I6ICNmNWY1ZjU7CisgICpiYWNrZ3JvdW5kLWNvbG9yOiAjZTZlNmU2OworICBiYWNrZ3JvdW5kLWltYWdlOiAtbW96LWxpbmVhci1ncmFkaWVudCh0b3AsICNmZmZ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cHg7CisgIC13ZWJraXQtYm9yZGVyLXJhZGl1czogNnB4OworICAgICAtbW96LWJvcmRlci1yYWRpdXM6IDZweDsKKyAgICAgICAgICBib3JkZXItcmFkaXVzOiA2cHg7Cit9CisKKy5idG4tbGFyZ2UgW2NsYXNzXj0iaWNvbi0iXSwKKy5idG4tbGFyZ2UgW2NsYXNzKj0iIGljb24tIl0geworICBtYXJnaW4tdG9wOiA0cHg7Cit9CisKKy5idG4tc21hbGwgeworICBwYWRkaW5nOiAycHggMTBweDsKKyAgZm9udC1zaXplOiAxMS45cHg7CisgIC13ZWJraXQtYm9yZGVyLXJhZGl1czogM3B4OworICAgICAtbW96LWJvcmRlci1yYWRpdXM6IDNweDsKKyAgICAgICAgICBib3JkZXItcmFkaXVzOiAzcHg7Cit9CisKKy5idG4tc21hbGwgW2NsYXNzXj0iaWNvbi0iXSwKKy5idG4tc21hbGwgW2NsYXNzKj0iIGljb24tIl0geworICBtYXJnaW4tdG9wOiAwOworfQorCisuYnRuLW1pbmkgW2NsYXNzXj0iaWNvbi0iXSwKKy5idG4tbWluaSBbY2xhc3MqPSIgaWNvbi0iXSB7CisgIG1hcmdpbi10b3A6IC0xcHg7Cit9CisKKy5idG4tbWluaSB7CisgIHBhZGRpbmc6IDAgNnB4OworICBmb250LXNpemU6IDEwLjVweDsKKyAgLXdlYmtpdC1ib3JkZXItcmFkaXVzOiAzcHg7CisgICAgIC1tb3otYm9yZGVyLXJhZGl1czogM3B4OworICAgICAgICAgIGJvcmRlci1yYWRpdXM6IDNweDsKK30KKworLmJ0bi1ibG9jayB7CisgIGRpc3BsYXk6IGJsb2NrOworICB3aWR0aDogMTAwJTsKKyAgcGFkZGluZy1yaWdodDogMDsKKyAgcGFkZGluZy1sZWZ0OiAwOworICAtd2Via2l0LWJveC1zaXppbmc6IGJvcmRlci1ib3g7CisgICAgIC1tb3otYm94LXNpemluZzogYm9yZGVyLWJveDsKKyAgICAgICAgICBib3gtc2l6aW5nOiBib3JkZXItYm94Oworf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Rlci1ib3R0b20tY29sb3I6ICNmZmZmZmY7Cit9CisKKy5idG4tZ3JvdXAtdmVydGljYWwgeworICBkaXNwbGF5OiBpbmxpbmUtYmxvY2s7CisgICpkaXNwbGF5OiBpbmxpbmU7CisgIC8qIElFNyBpbmxpbmUtYmxvY2sgaGFjayAqLworCisgICp6b29tOiAxOworfQorCisuYnRuLWdyb3VwLXZlcnRpY2FsID4gLmJ0biB7CisgIGRpc3BsYXk6IGJsb2NrOworICBmbG9hdDogbm9uZTsKKyAgbWF4LXdpZHRoOiAxMDAlOworICAtd2Via2l0LWJvcmRlci1yYWRpdXM6IDA7CisgICAgIC1tb3otYm9yZGVyLXJhZGl1czogMDsKKyAgICAgICAgICBib3JkZXItcmFkaXVzOiAwOworfQorCisuYnRuLWdyb3VwLXZlcnRpY2FsID4gLmJ0biArIC5idG4geworICBtYXJnaW4tdG9wOiAtMXB4OworICBtYXJnaW4tbGVmdDogMDsKK30KKworLmJ0bi1ncm91cC12ZXJ0aWNhbCA+IC5idG46Zmlyc3QtY2hpbGQgeworICAtd2Via2l0LWJvcmRlci1yYWRpdXM6IDRweCA0cHggMCAwOworICAgICAtbW96LWJvcmRlci1yYWRpdXM6IDRweCA0cHggMCAwOworICAgICAgICAgIGJvcmRlci1yYWRpdXM6IDRweCA0cHggMCAwOworfQorCisuYnRuLWdyb3VwLXZlcnRpY2FsID4gLmJ0bjpsYXN0LWNoaWxkIHsKKyAgLXdlYmtpdC1ib3JkZXItcmFkaXVzOiAwIDAgNHB4IDRweDsKKyAgICAgLW1vei1ib3JkZXItcmFkaXVzOiAwIDAgNHB4IDRweDsKKyAgICAgICAgICBib3JkZXItcmFkaXVzOiAwIDAgNHB4IDRweDsKK30KKworLmJ0bi1ncm91cC12ZXJ0aWNhbCA+IC5idG4tbGFyZ2U6Zmlyc3QtY2hpbGQgeworICAtd2Via2l0LWJvcmRlci1yYWRpdXM6IDZweCA2cHggMCAwOworICAgICAtbW96LWJvcmRlci1yYWRpdXM6IDZweC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bW96LWJvcmRlci1yYWRpdXM6IDRweCA0cHggMCAwOworICAgICAgICAgIGJvcmRlci1yYWRpdXM6IDRweCA0cHggMCAwOworfQorCisubmF2LXRhYnMgPiBsaSA+IGE6aG92ZXIsCisubmF2LXRhYnMgPiBsaSA+IGE6Zm9jdXMgeworICBib3JkZXItY29sb3I6ICNlZWVlZWUgI2VlZWVlZSAjZGRkZGRkOworfQorCisubmF2LXRhYnMgPiAuYWN0aXZlID4gYSwKKy5uYXYtdGFicyA+IC5hY3RpdmUgPiBhOmhvdmVyLAorLm5hdi10YWJzID4gLmFjdGl2ZSA+IGE6Zm9jdXMgeworICBjb2xvcjogIzU1NTU1NTsKKyAgY3Vyc29yOiBkZWZhdWx0OworICBiYWNrZ3JvdW5kLWNvbG9yOiAjZmZmZmZmOworICBib3JkZXI6IDFweCBzb2xpZCAjZGRkOworICBib3JkZXItYm90dG9tLWNvbG9yOiB0cmFuc3BhcmVudDsKK30KKworLm5hdi1waWxscyA+IGxpID4gYSB7CisgIHBhZGRpbmctdG9wOiA4cHg7CisgIHBhZGRpbmctYm90dG9tOiA4cHg7CisgIG1hcmdpbi10b3A6IDJweDsKKyAgbWFyZ2luLWJvdHRvbTogMnB4OworICAtd2Via2l0LWJvcmRlci1yYWRpdXM6IDVweDsKKyAgICAgLW1vei1ib3JkZXItcmFkaXVzOiA1cHg7CisgICAgICAgICAgYm9yZGVyLXJhZGl1czogNXB4OworfQorCisubmF2LXBpbGxzID4gLmFjdGl2ZSA+IGEsCisubmF2LXBpbGxzID4gLmFjdGl2ZSA+IGE6aG92ZXIsCisubmF2LXBpbGxzID4gLmFjdGl2ZSA+IGE6Zm9jdXMgeworICBjb2xvcjogI2ZmZmZmZjsKKyAgYmFja2dyb3VuZC1jb2xvcjogIzAwODhjYzsKK30KKworLm5hdi1zdGFja2VkID4gbGkgeworICBmbG9hdDogbm9uZTsKK30KKworLm5hdi1zdGFja2VkID4gbGkgPiBhIHsKKyAgbWFyZ2luLXJpZ2h0OiAwOworfQorCisubmF2LXRhYnMubmF2LXN0YWNrZWQgeworICBib3JkZXItYm90dG9tOiAwOworfQorCisubmF2LXRhYnMubmF2LXN0YWNrZWQgPiBsaSA+IGEgeworICBib3JkZXI6IDFweCBzb2xpZCAjZGRkOworICAtd2Via2l0LWJvcmRlci1yYWRpdXM6IDA7CisgICAgIC1tb3otYm9yZGVyLXJhZGl1czogMDsKKyAgICAgICAgICBib3JkZXItcmFkaXVzOiAwOworfQorCisubmF2LXRhYnMubmF2LXN0YWNrZWQgPiBsaTpmaXJzdC1jaGlsZCA+IGEgeworICAtd2Via2l0LWJvcmRlci10b3AtcmlnaHQtcmFkaXVzOiA0cHg7CisgICAgICAgICAgYm9yZGVyLXRvcC1yaWdodC1yYWRpdXM6IDRweDsKKyAgLXdlYmtpdC1ib3JkZXItdG9wLWxlZnQtcmFkaXVzOiA0cHg7CisgICAgICAgICAgYm9yZGVyLXRvcC1sZWZ0LXJhZGl1czogNHB4OworICAtbW96LWJvcmRlci1yYWRpdXMtdG9wcmlnaHQ6IDRweDsKKyAgLW1vei1ib3JkZXItcmFkaXVzLXRvcGxlZnQ6IDRweDsKK30KKworLm5hdi10YWJzLm5hdi1zdGFja2VkID4gbGk6bGFzdC1jaGlsZCA+IGEgeworICAtd2Via2l0LWJvcmRlci1ib3R0b20tcmlnaHQtcmFkaXVzOiA0cHg7CisgICAgICAgICAgYm9yZGVyLWJvdHRvbS1yaWdodC1yYWRpdXM6IDRweDsKKyAgLXdlYmtpdC1ib3JkZXItYm90dG9tLWxlZnQtcmFkaXVzOiA0cHg7CisgICAgICAgICAgYm9yZGVyLWJvdHRvbS1sZWZ0LXJhZGl1czogNHB4OworICAtbW96LWJvcmRlci1yYWRpdXMtYm90dG9tcmlnaHQ6IDRweDsKKyAgLW1vei1ib3JkZXItcmFkaXVzLWJvdHRvbWxlZnQ6IDRweDsKK30KKworLm5hdi10YWJzLm5hdi1zdGFja2VkID4gbGkgPiBhOmhvdmVyLAorLm5hdi10YWJzLm5hdi1zdGFja2VkID4gbGkgPiBhOmZvY3VzIHsKKyAgei1pbmRleDogMjsKKyAgYm9yZGVyLWNvbG9yOiAjZGRkOworfQorCisubmF2LXBpbGxzLm5hdi1zdGFja2VkID4gbGkgPiBhIHsKKyAgbWFyZ2luLWJvdHRvbTogM3B4OworfQorCisubmF2LXBpbGxzLm5hdi1zdGFja2VkID4gbGk6bGFzdC1jaGlsZCA+IGEgeworICBtYXJnaW4tYm90dG9tOiAxcHg7Cit9CisKKy5uYXYtdGFicyAuZHJvcGRvd24tbWVudSB7CisgIC13ZWJraXQtYm9yZGVyLXJhZGl1czogMCAwIDZweCA2cHg7CisgICAgIC1tb3otYm9yZGVyLXJhZGl1czogMCAwIDZweCA2cHg7CisgICAgICAgICAgYm9yZGVyLXJhZGl1czogMCAwIDZweCA2cHg7Cit9CisKKy5uYXYtcGlsbHMgLmRyb3Bkb3duLW1lbnUgeworICAtd2Via2l0LWJvcmRlci1yYWRpdXM6IDZweDsKKyAgICAgLW1vei1ib3JkZXItcmFkaXVzOiA2cHg7CisgICAgICAgICAgYm9yZGVyLXJhZGl1czogNnB4OworfQorCisubmF2IC5kcm9wZG93bi10b2dnbGUgLmNhcmV0IHsKKyAgbWFyZ2luLXRvcDogNnB4OworICBib3JkZXItdG9wLWNvbG9yOiAjMDA4OGNjOworICBib3JkZXItYm90dG9tLWNvbG9yOiAjMDA4OGNjOworfQorCisubmF2IC5kcm9wZG93bi10b2dnbGU6aG92ZXIgLmNhcmV0LAorLm5hdiAuZHJvcGRvd24tdG9nZ2xlOmZvY3VzIC5jYXJldCB7CisgIGJvcmRlci10b3AtY29sb3I6ICMwMDU1ODA7CisgIGJvcmRlci1ib3R0b20tY29sb3I6ICMwMDU1ODA7Cit9CisKKy8qIG1vdmUgZG93biBjYXJldHMgZm9yIHRhYnMgKi8KKworLm5hdi10YWJzIC5kcm9wZG93bi10b2dnbGUgLmNhcmV0IHsKKyAgbWFyZ2luLXRvcDogOHB4OworfQorCisubmF2IC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ob3ZlciwKKy50YWJzLXN0YWNrZWQgLm9wZW4gPiBhOmZvY3VzIHsKKyAgYm9yZGVyLWNvbG9yOiAjOTk5OTk5OworfQorCisudGFiYmFibGUgeworICAqem9vbTogMTsKK30KKworLnRhYmJhYmxlOmJlZm9yZSwKKy50YWJiYWJsZTphZnRlciB7CisgIGRpc3BsYXk6IHRhYmxlOworICBsaW5lLWhlaWdodDogMDsKKyAgY29udGVudDogIiI7Cit9CisKKy50YWJiYWJsZTphZnRlciB7CisgIGNsZWFyOiBib3RoOworfQorCisudGFiLWNvbnRlbnQgeworICBvdmVyZmxvdzogYXV0bzsKK30KKworLnRhYnMtYmVsb3cgPiAubmF2LXRhYnMsCisudGFicy1yaWdodCA+IC5uYXYtdGFicywKKy50YWJzLWxlZnQgPiAubmF2LXRhYnMgeworICBib3JkZXItYm90dG9tOiAwOworfQorCisudGFiLWNvbnRlbnQgPiAudGFiLXBhbmUsCisucGlsbC1jb250ZW50ID4gLnBpbGwtcGFuZSB7CisgIGRpc3BsYXk6IG5vbmU7Cit9CisKKy50YWItY29udGVudCA+IC5hY3RpdmUsCisucGlsbC1jb250ZW50ID4gLmFjdGl2ZSB7CisgIGRpc3BsYXk6IGJsb2NrOworfQorCisudGFicy1iZWxvdyA+IC5uYXYtdGFicyB7CisgIGJvcmRlci10b3A6IDFweCBzb2xpZCAjZGRkOworfQorCisudGFicy1iZWxvdyA+IC5uYXYtdGFicyA+IGxpIHsKKyAgbWFyZ2luLXRvcDogLTFweDsKKyAgbWFyZ2luLWJvdHRvbTogMDsKK30KKworLnRhYnMtYmVsb3cgPiAubmF2LXRhYnMgPiBsaSA+IGEgeworICAtd2Via2l0LWJvcmRlci1yYWRpdXM6IDAgMCA0cHggNHB4OworICAgICAtbW96LWJvcmRlci1yYWRpdXM6IDAgMCA0cHggNHB4OworICAgICAgICAgIGJvcmRlci1yYWRpdXM6IDAgMCA0cHggNHB4OworfQorCisudGFicy1iZWxvdyA+IC5uYXYtdGFicyA+IGxpID4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pbm5lciwKKy5uYXZiYXItZml4ZWQtYm90dG9tIC5uYXZiYXItaW5uZXIgeworICBwYWRkaW5nLXJpZ2h0OiAwOworICBwYWRkaW5nLWxlZnQ6IDA7CisgIC13ZWJraXQtYm9yZGVyLXJhZGl1czogMDsKKyAgICAgLW1vei1ib3JkZXItcmFkaXVzOiAwOworICAgICAgICAgIGJvcmRlci1yYWRpdXM6IDA7Cit9CisKKy5uYXZiYXItc3RhdGljLXRvcCAuY29udGFpbmVyLAorLm5hdmJhci1maXhlZC10b3AgLmNvbnRhaW5lciwKKy5uYXZiYXItZml4ZWQtYm90dG9tIC5jb250YWluZXIgeworICB3aWR0aDogOTQwcHg7Cit9CisKKy5uYXZiYXItZml4ZWQtdG9wIHsKKyAgdG9wOiAwOworfQorCisubmF2YmFyLWZpeGVkLXRvcCAubmF2YmFyLWlubmVyLAorLm5hdmJhci1zdGF0aWMtdG9wIC5uYXZiYXItaW5uZXIgeworICAtd2Via2l0LWJveC1zaGFkb3c6IDAgMXB4IDEwcHggcmdiYSgwLCAwLCAwLCAwLjEpOworICAgICAtbW96LWJveC1zaGFkb3c6IDAgMXB4IDEwcHggcmdiYSgwLCAwLCAwLCAwLjEpOworICAgICAgICAgIGJveC1zaGFkb3c6IDAgMXB4IDEwcHggcmdiYSgwLCAwLCAwLCAwLjEpOworfQorCisubmF2YmFyLWZpeGVkLWJvdHRvbSB7CisgIGJvdHRvbTogMDsKK30KKworLm5hdmJhci1maXhlZC1ib3R0b20gLm5hdmJhci1pbm5lciB7CisgIC13ZWJraXQtYm94LXNoYWRvdzogMCAtMXB4IDEwcHggcmdiYSgwLCAwLCAwLCAwLjEpOworICAgICAtbW96LWJveC1zaGFkb3c6IDAgLTFweCAxMHB4IHJnYmEoMCwgMCwgMCwgMC4xKTsKKyAgICAgICAgICBib3gtc2hhZG93OiAwIC0xcHggMTBweCByZ2JhKDAsIDAsIDAsIDAuMSk7Cit9CisKKy5uYXZiYXIgLm5hdiB7CisgIHBvc2l0aW9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jb2xvcjogI2ZmZmZmZjsKKyAgYmFja2dyb3VuZC1jb2xvcjogIzExMTExMTsKK30KKworLm5hdmJhci1pbnZlcnNlIC5uYXZiYXItbGluayB7CisgIGNvbG9yOiAjOTk5OTk5OworfQorCisubmF2YmFyLWludmVyc2UgLm5hdmJhci1saW5rOmhvdmVyLAorLm5hdmJhci1pbnZlcnNlIC5uYXZiYXItbGluazpmb2N1cyB7CisgIGNvbG9yOiAjZmZmZmZmOworfQorCisubmF2YmFyLWludmVyc2UgLmRpdmlkZXItdmVydGljYWwgeworICBib3JkZXItcmlnaHQtY29sb3I6ICMyMjIyMjI7CisgIGJvcmRlci1sZWZ0LWNvbG9yOiAjMTExMTExOworfQorCisubmF2YmFyLWludmVyc2UgLm5hdiBsaS5kcm9wZG93bi5vcGVuID4gLmRyb3Bkb3duLXRvZ2dsZSwKKy5uYXZiYXItaW52ZXJzZSAubmF2IGxpLmRyb3Bkb3duLmFjdGl2ZSA+IC5kcm9wZG93bi10b2dnbGUsCisubmF2YmFyLWludmVyc2UgLm5hdiBsaS5kcm9wZG93bi5vcGVuLmFjdGl2ZSA+IC5kcm9wZG93bi10b2dnbGUgeworICBjb2xvcjogI2ZmZmZmZjsKKyAgYmFja2dyb3VuZC1jb2xvcjogIzExMTExMTsKK30KKworLm5hdmJhci1pbnZlcnNlIC5uYXYgbGkuZHJvcGRvd24gPiBhOmhvdmVyIC5jYXJldCwKKy5uYXZiYXItaW52ZXJzZSAubmF2IGxpLmRyb3Bkb3duID4gYTpmb2N1cyAuY2FyZXQgeworICBib3JkZXItdG9wLWNvbG9yOiAjZmZmZmZmOworICBib3JkZXItYm90dG9tLWNvbG9yOiAjZmZmZmZmOworfQorCisubmF2YmFyLWludmVyc2UgLm5hdiBsaS5kcm9wZG93biA+IC5kcm9wZG93bi10b2dnbGUgLmNhcmV0IHsKKyAgYm9yZGVyLXRvcC1jb2xvcjogIzk5OTk5OTsKKyAgYm9yZGVyLWJvdHRvbS1jb2xvcjogIzk5OT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JkZXItdG9wLXJpZ2h0LXJhZGl1czogM3B4OworICAgICAgICAgIGJvcmRlci10b3AtcmlnaHQtcmFkaXVzOiAzcHg7CisgIC13ZWJraXQtYm9yZGVyLWJvdHRvbS1yaWdodC1yYWRpdXM6IDNweDsKKyAgICAgICAgICBib3JkZXItYm90dG9tLXJpZ2h0LXJhZGl1czogM3B4OworICAtbW96LWJvcmRlci1yYWRpdXMtdG9wcmlnaHQ6IDNweDsKKyAgLW1vei1ib3JkZXItcmFkaXVzLWJvdHRvbXJpZ2h0OiAzcHg7Cit9CisKKy5wYWdpbmF0aW9uLXNtYWxsIHVsID4gbGkgPiBhLAorLnBhZ2luYXRpb24tc21hbGwgdWwgPiBsaSA+IHNwYW4geworICBwYWRkaW5nOiAycHggMTBweDsKKyAgZm9udC1zaXplOiAxMS45cHg7Cit9CisKKy5wYWdpbmF0aW9uLW1pbmkgdWwgPiBsaSA+IGEsCisucGFnaW5hdGlvbi1taW5pIHVsID4gbGkgPiBzcGFuIHsKKyAgcGFkZGluZzogMCA2cHg7CisgIGZvbnQtc2l6ZTogMTAuNXB4OworfQorCisucGFnZXIgeworICBtYXJnaW46IDIwcHggMDsKKyAgdGV4dC1hbGlnbjogY2VudGVyOworICBsaXN0LXN0eWxlOiBub25lOworICAqem9vbTogMTsKK30KKworLnBhZ2VyOmJlZm9yZSwKKy5wYWdlcjphZnRlciB7CisgIGRpc3BsYXk6IHRhYmxlOworICBsaW5lLWhlaWdodDogMDsKKyAgY29udGVudDogIiI7Cit9CisKKy5wYWdlcjphZnRlciB7CisgIGNsZWFyOiBib3RoOworfQorCisucGFnZXIgbGkgeworICBkaXNwbGF5OiBpbmxpbmU7Cit9CisKKy5wYWdlciBsaSA+IGEsCisucGFnZXIgbGkgPiBzcGFuIHsKKyAgZGlzcGxheTogaW5saW5lLWJsb2NrOworICBwYWRkaW5nOiA1cHggMTRweDsKKyAgYmFja2dyb3VuZC1jb2xvcjogI2ZmZjsKKyAgYm9yZGVyOiAxcHggc29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gICAgICB0cmFuc2l0aW9uOiBvcGFjaXR5IDAuM3MgbGluZWFyLCB0b3AgMC4zcyBlYXNlLW91dDsKK30KKworLm1vZGFsLmZhZGUuaW4geworICB0b3A6IDEwJTsKK30KKworLm1vZGFsLWhlYWRlciB7CisgIHBhZGRpbmc6IDlweCAxNXB4OworICBib3JkZXItYm90dG9tOiAxcHggc29saWQgI2VlZTsKK30KKworLm1vZGFsLWhlYWRlciAuY2xvc2UgeworICBtYXJnaW4tdG9wOiAycHg7Cit9CisKKy5tb2RhbC1oZWFkZXIgaDMgeworICBtYXJnaW46IDA7CisgIGxpbmUtaGVpZ2h0OiAzMHB4OworfQorCisubW9kYWwtYm9keSB7CisgIHBvc2l0aW9uOiByZWxhdGl2ZTsKKyAgbWF4LWhlaWdodDogNDAwcHg7CisgIHBhZGRpbmc6IDE1cHg7CisgIG92ZXJmbG93LXk6IGF1dG87Cit9CisKKy5tb2RhbC1mb3JtIHsKKyAgbWFyZ2luLWJvdHRvbTogMDsKK30KKworLm1vZGFsLWZvb3RlciB7CisgIHBhZGRpbmc6IDE0cHggMTVweCAxNXB4OworICBtYXJnaW4tYm90dG9tOiAwOworICB0ZXh0LWFsaWduOiByaWdodDsKKyAgYmFja2dyb3VuZC1jb2xvcjogI2Y1ZjVmNTsKKyAgYm9yZGVyLXRvcDogMXB4IHNvbGlkICNkZGQ7CisgIC13ZWJraXQtYm9yZGVyLXJhZGl1czogMCAwIDZweCA2cHg7CisgICAgIC1tb3otYm9yZGVyLXJhZGl1czogMCAwIDZweCA2cHg7CisgICAgICAgICAgYm9yZGVyLXJhZGl1czogMCAwIDZweCA2cHg7CisgICp6b29tOiAxOworICAtd2Via2l0LWJveC1zaGFkb3c6IGluc2V0IDAgMXB4IDAgI2ZmZmZmZjsKKyAgICAgLW1vei1ib3gtc2hhZG93OiBpbnNldCAwIDFweCAwICNmZmZmZmY7CisgICAgICAgICAgYm94LXNoYWRvdzogaW5zZXQgMCAxcHggMCAjZmZmZmZmOworfQor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WFyZ2luLWxlZnQ6IC0zcHg7Cit9CisKKy50b29sdGlwLWlubmVyIHsKKyAgbWF4LXdpZHRoOiAyMDBweDsKKyAgcGFkZGluZzogOHB4OworICBjb2xvcjogI2ZmZmZmZjsKKyAgdGV4dC1hbGlnbjogY2VudGVyOworICB0ZXh0LWRlY29yYXRpb246IG5vbmU7CisgIGJhY2tncm91bmQtY29sb3I6ICMwMDAwMDA7CisgIC13ZWJraXQtYm9yZGVyLXJhZGl1czogNHB4OworICAgICAtbW96LWJvcmRlci1yYWRpdXM6IDRweDsKKyAgICAgICAgICBib3JkZXItcmFkaXVzOiA0cHg7Cit9CisKKy50b29sdGlwLWFycm93IHsKKyAgcG9zaXRpb246IGFic29sdXRlOworICB3aWR0aDogMDsKKyAgaGVpZ2h0OiAwOworICBib3JkZXItY29sb3I6IHRyYW5zcGFyZW50OworICBib3JkZXItc3R5bGU6IHNvbGlkOworfQorCisudG9vbHRpcC50b3AgLnRvb2x0aXAtYXJyb3cgeworICBib3R0b206IDA7CisgIGxlZnQ6IDUwJTsKKyAgbWFyZ2luLWxlZnQ6IC01cHg7CisgIGJvcmRlci10b3AtY29sb3I6ICMwMDAwMDA7CisgIGJvcmRlci13aWR0aDogNXB4IDVweCAwOworfQorCisudG9vbHRpcC5yaWdodCAudG9vbHRpcC1hcnJvdyB7CisgIHRvcDogNTAlOworICBsZWZ0OiAwOworICBtYXJnaW4tdG9wOiAtNXB4OworICBib3JkZXItcmlnaHQtY29sb3I6ICMwMDAwMDA7CisgIGJvcmRlci13aWR0aDogNXB4IDVweCA1cHggMDsKK30KKworLnRvb2x0aXAubGVmdCAudG9vbHRpcC1hcnJvdyB7CisgIHRvcDogNTAlOworICByaWdodDogMDsKKyAgbWFyZ2luLXRvcDogLTVweDsKKyAgYm9yZGVyLWxlZnQtY29sb3I6ICMwMDAwMDA7CisgIGJvcmRlci13aWR0aDogNXB4IDAgNXB4IDVweDsKK30KKworLnRvb2x0aXAuYm90dG9tIC50b29sdGlwLWFycm93IHsKKyAgdG9wOiAwOworICBsZWZ0OiA1MCU7CisgIG1hcmdpbi1sZWZ0OiAtNXB4OworICBib3JkZXItYm90dG9tLWNvbG9yOiAjMDAwMDAwOworICBib3JkZXItd2lkdGg6IDAgNXB4IDVweDsKK30KKworLnBvcG92ZXIgeworICBwb3NpdGlvbjogYWJzb2x1dGU7CisgIHRvcDogMDsKKyAgbGVmdDogMDsKKyAgei1pbmRleDogMTAxMDsKKyAgZGlzcGxheTogbm9uZTsKKyAgbWF4LXdpZHRoOiAyNzZweDsKKyAgcGFkZGluZzogMXB4OworICB0ZXh0LWFsaWduOiBsZWZ0OworICB3aGl0ZS1zcGFjZTogbm9ybWFsOworICBiYWNrZ3JvdW5kLWNvbG9yOiAjZmZmZmZmOworICBib3JkZXI6IDFweCBzb2xpZCAjY2NjOworICBib3JkZXI6IDFweCBzb2xpZCByZ2JhKDAsIDAsIDAsIDAuMik7CisgIC13ZWJraXQtYm9yZGVyLXJhZGl1czogNnB4OworICAgICAtbW96LWJvcmRlci1yYWRpdXM6IDZweDsKKyAgICAgICAgICBib3JkZXItcmFkaXVzOiA2cHg7CisgIC13ZWJraXQtYm94LXNoYWRvdzogMCA1cHggMTBweCByZ2JhKDAsIDAsIDAsIDAuMik7CisgICAgIC1tb3otYm94LXNoYWRvdzogMCA1cHggMTBweCByZ2JhKDAsIDAsIDAsIDAuMik7CisgICAgICAgICAgYm94LXNoYWRvdzogMCA1cHggMTBweCByZ2JhKDAsIDAsIDAsIDAuMik7CisgIC13ZWJraXQtYmFja2dyb3VuZC1jbGlwOiBwYWRkaW5nLWJveDsKKyAgICAgLW1vei1iYWNrZ3JvdW5kLWNsaXA6IHBhZGRpbmc7CisgICAgICAgICAgYmFja2dyb3VuZC1jbGlwOiBwYWRkaW5nLWJveDsKK30KKworLnBvcG92ZXIudG9wIHsKKyAgbWFyZ2luLXRvcDogLTEwcHg7Cit9CisKKy5wb3BvdmVyLnJpZ2h0IHsKKyAgbWFyZ2luLWxlZnQ6IDEwcHg7Cit9CisKKy5wb3BvdmVyLmJvdHRvbSB7CisgIG1hcmdpbi10b3A6IDEwcHg7Cit9CisKKy5wb3BvdmVyLmxlZnQgeworICBtYXJnaW4tbGVmdDogLTEwcHg7Cit9CisKKy5wb3BvdmVyLXRpdGxlIHsKKyAgcGFkZGluZzogOHB4IDE0cHg7CisgIG1hcmdpbjogMDsKKyAgZm9udC1zaXplOiAxNHB4OworICBmb250LXdlaWdodDogbm9ybWFsOworICBsaW5lLWhlaWdodDogMThweDsKKyAgYmFja2dyb3VuZC1jb2xvcjogI2Y3ZjdmNzsKKyAgYm9yZGVyLWJvdHRvbTogMXB4IHNvbGlkICNlYmViZWI7CisgIC13ZWJraXQtYm9yZGVyLXJhZGl1czogNXB4IDVweCAwIDA7CisgICAgIC1tb3otYm9yZGVyLXJhZGl1czogNXB4IDVweCAwIDA7CisgICAgICAgICAgYm9yZGVyLXJhZGl1czogNXB4IDVweCAwIDA7Cit9CisKKy5wb3BvdmVyLXRpdGxlOmVtcHR5IHsKKyAgZGlzcGxheTogbm9uZTsKK30KKworLnBvcG92ZXItY29udGVudCB7CisgIHBhZGRpbmc6IDlweCAxNHB4OworfQorCisucG9wb3ZlciAuYXJyb3csCisucG9wb3ZlciAuYXJyb3c6YWZ0ZXIgeworICBwb3NpdGlvbjogYWJzb2x1dGU7CisgIGRpc3BsYXk6IGJsb2NrOworICB3aWR0aDogMDsKKyAgaGVpZ2h0OiAwOworICBib3JkZXItY29sb3I6IHRyYW5zcGFyZW50OworICBib3JkZXItc3R5bGU6IHNvbGlkOworfQorCisucG9wb3ZlciAuYXJyb3cgeworICBib3JkZXItd2lkdGg6IDExcHg7Cit9CisKKy5wb3BvdmVyIC5hcnJvdzphZnRlciB7CisgIGJvcmRlci13aWR0aDogMTBweDsKKyAgY29udGVudDogIiI7Cit9CisKKy5wb3BvdmVyLnRvcCAuYXJyb3cgeworICBib3R0b206IC0xMXB4OworICBsZWZ0OiA1MCU7CisgIG1hcmdpbi1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ItdG9wLXdpZHRoOiAwOworfQorCisucG9wb3Zlci5sZWZ0IC5hcnJvdyB7CisgIHRvcDogNTAlOworICByaWdodDogLTExcHg7CisgIG1hcmdpbi10b3A6IC0xMXB4OworICBib3JkZXItbGVmdC1jb2xvcjogIzk5OTsKKyAgYm9yZGVyLWxlZnQtY29sb3I6IHJnYmEoMCwgMCwgMCwgMC4yNSk7CisgIGJvcmRlci1yaWdodC13aWR0aDogMDsKK30KKworLnBvcG92ZXIubGVmdCAuYXJyb3c6YWZ0ZXIgeworICByaWdodDogMXB4OworICBib3R0b206IC0xMHB4OworICBib3JkZXItbGVmdC1jb2xvcjogI2ZmZmZmZjsKKyAgYm9yZGVyLXJpZ2h0LXdpZHRoOiAwOworfQorCisudGh1bWJuYWlscyB7CisgIG1hcmdpbi1sZWZ0OiAtMjBweDsKKyAgbGlzdC1zdHlsZTogbm9uZTsKKyAgKnpvb206IDE7Cit9CisKKy50aHVtYm5haWxzOmJlZm9yZSwKKy50aHVtYm5haWxzOmFmdGVyIHsKKyAgZGlzcGxheTogdGFibGU7CisgIGxpbmUtaGVpZ2h0OiAwOworICBjb250ZW50OiAiIjsKK30KKworLnRodW1ibmFpbHM6YWZ0ZXIgeworICBjbGVhcjogYm90aDsKK30KKworLnJvdy1mbHVpZCAudGh1bWJuYWlscyB7CisgIG1hcmdpbi1sZWZ0OiAwOworfQorCisudGh1bWJuYWlscyA+IGxpIHsKKyAgZmxvYXQ6IGxlZnQ7CisgIG1hcmdpbi1ib3R0b206IDIwcHg7CisgIG1hcmdpbi1sZWZ0OiAyMHB4OworfQorCisudGh1bWJuYWlsIHsKKyAgZGlzcGxheTogYmxvY2s7CisgIHBhZGRpbmc6IDRweDsKKyAgbGluZS1oZWlnaHQ6IDIwcHg7CisgIGJvcmRlcjogMXB4IHNvbGlkICNkZGQ7CisgIC13ZWJraXQtYm9yZGVyLXJhZGl1czogNHB4OworICAgICAtbW96LWJvcmRlci1yYWRpdXM6IDRweDsKKyAgICAgICAgICB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LWluZm9baHJlZl0geworICBiYWNrZ3JvdW5kLWNvbG9yOiAjMmQ2OTg3OworfQorCisubGFiZWwtaW52ZXJzZSwKKy5iYWRnZS1pbnZlcnNlIHsKKyAgYmFja2dyb3VuZC1jb2xvcjogIzMzMzMzMzsKK30KKworLmxhYmVsLWludmVyc2VbaHJlZl0sCisuYmFkZ2UtaW52ZXJzZVtocmVmXSB7CisgIGJhY2tncm91bmQtY29sb3I6ICMxYTFhMWE7Cit9CisKKy5idG4gLmxhYmVsLAorLmJ0biAuYmFkZ2UgeworICBwb3NpdGlvbjogcmVsYXRpdmU7CisgIHRvcDogLTFweDsKK30KKworLmJ0bi1taW5pIC5sYWJlbCwKKy5idG4tbWluaSAuYmFkZ2UgeworICB0b3A6IDA7Cit9CisKK0Atd2Via2l0LWtleWZyYW1lcyBwcm9ncmVzcy1iYXItc3RyaXBlcyB7CisgIGZyb20geworICAgIGJhY2tncm91bmQtcG9zaXRpb246IDQwcHggMDsKKyAgfQorICB0byB7CisgICAgYmFja2dyb3VuZC1wb3NpdGlvbjogMCAwOworICB9Cit9CisKK0AtbW96LWtleWZyYW1lcyBwcm9ncmVzcy1iYXItc3RyaXBlcyB7CisgIGZyb20geworICAgIGJhY2tncm91bmQtcG9zaXRpb246IDQwcHggMDsKKyAgfQorICB0byB7CisgICAgYmFja2dyb3VuZC1wb3NpdGlvbjogMCAwOworICB9Cit9CisKK0AtbXMta2V5ZnJhbWVzIHByb2dyZXNzLWJhci1zdHJpcGVzIHsKKyAgZnJvbSB7CisgICAgYmFja2dyb3VuZC1wb3NpdGlvbjogNDBweCAwOworICB9CisgIHRvIHsKKyAgICBiYWNrZ3JvdW5kLXBvc2l0aW9uOiAwIDA7CisgIH0KK30KKworQC1vLWtleWZyYW1lcyBwcm9ncmVzcy1iYXItc3RyaXBlcyB7CisgIGZyb20geworICAgIGJhY2tncm91bmQtcG9zaXRpb246IDAgMDsKKyAgfQorICB0byB7CisgICAgYmFja2dyb3VuZC1wb3NpdGlvb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HJlbGF0aXZlOworICB3aWR0aDogMTAwJTsKKyAgb3ZlcmZsb3c6IGhpZGRlbjsKK30KKworLmNhcm91c2VsLWlubmVyID4gLml0ZW0geworICBwb3NpdGlvbjogcmVsYXRpdmU7CisgIGRpc3BsYXk6IG5vbmU7CisgIC13ZWJraXQtdHJhbnNpdGlvbjogMC42cyBlYXNlLWluLW91dCBsZWZ0OworICAgICAtbW96LXRyYW5zaXRpb246IDAuNnMgZWFzZS1pbi1vdXQgbGVmdDsKKyAgICAgICAtby10cmFuc2l0aW9uOiAwLjZzIGVhc2UtaW4tb3V0IGxlZnQ7CisgICAgICAgICAgdHJhbnNpdGlvbjogMC42cyBlYXNlLWluLW91dCBsZWZ0OworfQorCisuY2Fyb3VzZWwtaW5uZXIgPiAuaXRlbSA+IGltZywKKy5jYXJvdXNlbC1pbm5lciA+IC5pdGVtID4gYSA+IGltZyB7CisgIGRpc3BsYXk6IGJsb2NrOworICBsaW5lLWhlaWdodDogMTsKK30KKworLmNhcm91c2VsLWlubmVyID4gLmFjdGl2ZSwKKy5jYXJvdXNlbC1pbm5lciA+IC5uZXh0LAorLmNhcm91c2VsLWlubmVyID4gLnByZXYgeworICBkaXNwbGF5OiBibG9jazsKK30KKworLmNhcm91c2VsLWlubmVyID4gLmFjdGl2ZSB7CisgIGxlZnQ6IDA7Cit9CisKKy5jYXJvdXNlbC1pbm5lciA+IC5uZXh0LAorLmNhcm91c2VsLWlubmVyID4gLnByZXYgeworICBwb3NpdGlvbjogYWJzb2x1dGU7CisgIHRvcDogMDsKKyAgd2lkdGg6IDEwMCU7Cit9CisKKy5jYXJvdXNlbC1pbm5lciA+IC5uZXh0IHsKKyAgbGVmdDogMTAwJTsKK30KKworLmNhcm91c2VsLWlubmVyID4gLnByZXYgeworICBsZWZ0OiAtMTAwJTsKK30KKworLmNhcm91c2VsLWlubmVyID4gLm5leHQubGVmdCwKKy5jYXJvdXNlbC1pbm5lciA+IC5wcmV2LnJpZ2h0IHsKKyAgbGVmdD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9ucyB1bmRlciB0aGUgTGljZW5zZS4KKyAqID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0gKi8KKworCishZnVuY3Rpb24gKCQpIHsKKworICAidXNlIHN0cmljdCI7IC8vIGpzaGludCA7XzsKKworCisgIC8qIENTUyBUUkFOU0lUSU9OIFNVUFBPUlQgKGh0dHA6Ly93d3cubW9kZXJuaXpyLmNvbS8pCisgICAqID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0gKi8KKworICAkKGZ1bmN0aW9uICgpIHsKKworICAgICQuc3VwcG9ydC50cmFuc2l0aW9uID0gKGZ1bmN0aW9uICgpIHsKKworICAgICAgdmFyIHRyYW5zaXRpb25FbmQgPSAoZnVuY3Rpb24gKCkgeworCisgICAgICAgIHZhciBlbCA9IGRvY3VtZW50LmNyZWF0ZUVsZW1lbnQoJ2Jvb3RzdHJhcCcpCisgICAgICAgICAgLCB0cmFuc0VuZEV2ZW50TmFtZXMgPSB7CisgICAgICAgICAgICAgICAnV2Via2l0VHJhbnNpdGlvbicgOiAnd2Via2l0VHJhbnNpdGlvbkVuZCcKKyAgICAgICAgICAgICwgICdNb3pUcmFuc2l0aW9uJyAgICA6ICd0cmFuc2l0aW9uZW5kJworICAgICAgICAgICAgLCAgJ09UcmFuc2l0aW9uJyAgICAgIDogJ29UcmFuc2l0aW9uRW5kIG90cmFuc2l0aW9uZW5kJworICAgICAgICAgICAgLCAgJ3RyYW5zaXRpb24nICAgICAgIDogJ3RyYW5zaXRpb25lbmQnCisgICAgICAgICAgICB9CisgICAgICAgICAgLCBuYW1lCisKKyAgICAgICAgZm9yIChuYW1lIGluIHRyYW5zRW5kRXZlbnROYW1lcyl7CisgICAgICAgICAgaWYgKGVsLnN0eWxlW25hbWVdICE9PSB1bmRlZmluZWQpIHsKKyAgICAgICAgICAgIHJldHVybiB0cmFuc0VuZEV2ZW50TmFtZXNbbmFtZV0KKyAgICAgICAgICB9CisgICAgICAgIH0KKworICAgICAgfSgpKQorCisgICAgICByZXR1cm4gdHJhbnNpdGlvbkVuZCAmJiB7CisgICAgICAgIGVuZDogdHJhbnNpdGlvbkVuZAorICAgICAgfQorCisgICAgfSkoKQorCisgIH0pCisKK30od2luZG93LmpRdWVyeSk7LyogPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorICogYm9vdHN0cmFwLWFsZXJ0LmpzIHYyLjMuMgorICogaHR0cDovL2dldGJvb3RzdHJhcC5jb20vMi4zLjIvamF2YXNjcmlwdC5odG1sI2FsZXJ0cworICogPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorICogQ29weXJpZ2h0IDIwMTMgVHdpdHRlciwgSW5jLgorICoKKyAqIExpY2Vuc2VkIHVuZGVyIHRoZSBBcGFjaGUgTGljZW5zZSwgVmVyc2lvbiAyLjAgKHRoZSAiTGljZW5zZSIpOworICogeW91IG1heSBub3QgdXNlIHRoaXMgZmlsZSBleGNlcHQgaW4gY29tcGxpYW5jZSB3aXRoIHRoZSBMaWNlbnNlLgorICogWW91IG1heSBvYnRhaW4gYSBjb3B5IG9mIHRoZSBMaWNlbnNlIGF0CisgKgorICogaHR0cDovL3d3dy5hcGFjaGUub3JnL2xpY2Vuc2VzL0xJQ0VOU0UtMi4wCisgKgorICogVW5sZXNzIHJlcXVpcmVkIGJ5IGFwcGxpY2FibGUgbGF3IG9yIGFncmVlZCB0byBpbiB3cml0aW5nLCBzb2Z0d2FyZQorICogZGlzdHJpYnV0ZWQgdW5kZXIgdGhlIExpY2Vuc2UgaXMgZGlzdHJpYnV0ZWQgb24gYW4gIkFTIElTIiBCQVNJUywKKyAqIFdJVEhPVVQgV0FSUkFOVElFUyBPUiBDT05ESVRJT05TIE9GIEFOWSBLSU5ELCBlaXRoZXIgZXhwcmVzcyBvciBpbXBsaWVkLgorICogU2VlIHRoZSBMaWNlbnNlIGZvciB0aGUgc3BlY2lmaWMgbGFuZ3VhZ2UgZ292ZXJuaW5nIHBlcm1pc3Npb25zIGFuZAorICogbGltaXRhdGlvbnMgdW5kZXIgdGhlIExpY2Vuc2UuCisgKiA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09ICovCisKKworIWZ1bmN0aW9uICgkKSB7CisKKyAgInVzZSBzdHJpY3QiOyAvLyBqc2hpbnQgO187CisKKworIC8qIEFMRVJUIENMQVNTIERFRklOSVRJT04KKyAgKiA9PT09PT09PT09PT09PT09PT09PT09ICovCisKKyAgdmFyIGRpc21pc3MgPSAnW2RhdGEtZGlzbWlzcz0iYWxlcnQiXScKKyAgICAsIEFsZXJ0ID0gZnVuY3Rpb24gKGVsKSB7CisgICAgICAgICQoZWwpLm9uKCdjbGljaycsIGRpc21pc3MsIHRoaXMuY2xvc2UpCisgICAgICB9CisKKyAgQWxlcnQucHJvdG90eXBlLmNsb3NlID0gZnVuY3Rpb24gKGUpIHsKKyAgICB2YXIgJHRoaXMgPSAkKHRoaXMpCisgICAgICAsIHNlbGVjdG9yID0gJHRoaXMuYXR0cignZGF0YS10YXJnZXQnKQorICAgICAgLCAkcGFyZW50CisKKyAgICBpZiAoIXNlbGVjdG9yKSB7CisgICAgICBzZWxlY3RvciA9ICR0aGlzLmF0dHIoJ2hyZWYnKQorICAgICAgc2VsZWN0b3IgPSBzZWxlY3RvciAmJiBzZWxlY3Rvci5yZXBsYWNlKC8uKig/PSNbXlxzXSokKS8sICcnKSAvL3N0cmlwIGZvciBpZTcKKyAgICB9CisKKyAgICAkcGFyZW50ID0gJChzZWxlY3RvcikKKworICAgIGUgJiYgZS5wcmV2ZW50RGVmYXVsdCgpCisKKyAgICAkcGFyZW50Lmxlbmd0aCB8fCAoJHBhcmVudCA9ICR0aGlzLmhhc0NsYXNzKCdhbGVydCcpID8gJHRoaXMgOiAkdGhpcy5wYXJlbnQoKSkKKworICAgICRwYXJlbnQudHJpZ2dlcihlID0gJC5FdmVudCgnY2xvc2UnKSkKKworICAgIGlmIChlLmlzRGVmYXVsdFByZXZlbnRlZCgpKSByZXR1cm4KKworICAgICRwYXJlbnQucmVtb3ZlQ2xhc3MoJ2luJykKKworICAgIGZ1bmN0aW9uIHJlbW92ZUVsZW1lbnQoKSB7CisgICAgICAkcGFyZW50CisgICAgICAgIC50cmlnZ2VyKCdjbG9zZWQnKQorICAgICAgICAucmVtb3ZlKCkKKyAgICB9CisKKyAgICAkLnN1cHBvcnQudHJhbnNpdGlvbiAmJiAkcGFyZW50Lmhhc0NsYXNzKCdmYWRlJykgPworICAgICAgJHBhcmVudC5vbigkLnN1cHBvcnQudHJhbnNpdGlvbi5lbmQsIHJlbW92ZUVsZW1lbnQpIDoKKyAgICAgIHJlbW92ZUVsZW1lbnQoKQorICB9CisKKworIC8qIEFMRVJUIFBMVUdJTiBERUZJTklUSU9OCisgICogPT09PT09PT09PT09PT09PT09PT09PT0gKi8KKworICB2YXIgb2xkID0gJC5mbi5hbGVydAorCisgICQuZm4uYWxlcnQgPSBmdW5jdGlvbiAob3B0aW9uKSB7CisgICAgcmV0dXJuIHRoaXMuZWFjaChmdW5jdGlvbiAoKSB7CisgICAgICB2YXIgJHRoaXMgPSAkKHRoaXMpCisgICAgICAgICwgZGF0YSA9ICR0aGlzLmRhdGEoJ2FsZXJ0JykKKyAgICAgIGlmICghZGF0YSkgJHRoaXMuZGF0YSgnYWxlcnQnLCAoZGF0YSA9IG5ldyBBbGVydCh0aGlzKSkpCisgICAgICBpZiAodHlwZW9mIG9wdGlvbiA9PSAnc3RyaW5nJykgZGF0YVtvcHRpb25dLmNhbGwoJHRoaXMpCisgICAgfSkKKyAgfQorCisgICQuZm4uYWxlcnQuQ29uc3RydWN0b3IgPSBBbGVydAorCisKKyAvKiBBTEVSVCBOTyBDT05GTElDVAorICAqID09PT09PT09PT09PT09PT09ICovCisKKyAgJC5mbi5hbGVydC5ub0NvbmZsaWN0ID0gZnVuY3Rpb24gKCkgeworICAgICQuZm4uYWxlcnQgPSBvbGQKKyAgICByZXR1cm4gdGhpcworICB9CisKKworIC8qIEFMRVJUIERBVEEtQVBJCisgICogPT09PT09PT09PT09PT0gKi8KKworICAkKGRvY3VtZW50KS5vbignY2xpY2suYWxlcnQuZGF0YS1hcGknLCBkaXNtaXNzLCBBbGVydC5wcm90b3R5cGUuY2xvc2UpCisKK30od2luZG93LmpRdWVyeSk7LyogPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisgKiBib290c3RyYXAtYnV0dG9uLmpzIHYyLjMuMgorICogaHR0cDovL2dldGJvb3RzdHJhcC5jb20vMi4zLjIvamF2YXNjcmlwdC5odG1sI2J1dHRvbnMKKyAqID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorICogQ29weXJpZ2h0IDIwMTMgVHdpdHRlciwgSW5jLgorICoKKyAqIExpY2Vuc2VkIHVuZGVyIHRoZSBBcGFjaGUgTGljZW5zZSwgVmVyc2lvbiAyLjAgKHRoZSAiTGljZW5zZSIpOworICogeW91IG1heSBub3QgdXNlIHRoaXMgZmlsZSBleGNlcHQgaW4gY29tcGxpYW5jZSB3aXRoIHRoZSBMaWNlbnNlLgorICogWW91IG1heSBvYnRhaW4gYSBjb3B5IG9mIHRoZSBMaWNlbnNlIGF0CisgKgorICogaHR0cDovL3d3dy5hcGFjaGUub3JnL2xpY2Vuc2VzL0xJQ0VOU0UtMi4wCisgKgorICogVW5sZXNzIHJlcXVpcmVkIGJ5IGFwcGxpY2FibGUgbGF3IG9yIGFncmVlZCB0byBpbiB3cml0aW5nLCBzb2Z0d2FyZQorICogZGlzdHJpYnV0ZWQgdW5kZXIgdGhlIExpY2Vuc2UgaXMgZGlzdHJpYnV0ZWQgb24gYW4gIkFTIElTIiBCQVNJUywKKyAqIFdJVEhPVVQgV0FSUkFOVElFUy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NoIHRvIGV2ZW50IGxvb3AgdG8gYWxsb3cgZm9ybXMgdG8gc3VibWl0CisgICAgc2V0VGltZW91dChmdW5jdGlvbiAoKSB7CisgICAgICBzdGF0ZSA9PSAnbG9hZGluZ1RleHQnID8KKyAgICAgICAgJGVsLmFkZENsYXNzKGQpLmF0dHIoZCwgZCkgOgorICAgICAgICAkZWwucmVtb3ZlQ2xhc3MoZCkucmVtb3ZlQXR0cihkKQorICAgIH0sIDApCisgIH0KKworICBCdXR0b24ucHJvdG90eXBlLnRvZ2dsZSA9IGZ1bmN0aW9uICgpIHsKKyAgICB2YXIgJHBhcmVudCA9IHRoaXMuJGVsZW1lbnQuY2xvc2VzdCgnW2RhdGEtdG9nZ2xlPSJidXR0b25zLXJhZGlvIl0nKQorCisgICAgJHBhcmVudCAmJiAkcGFyZW50CisgICAgICAuZmluZCgnLmFjdGl2ZScpCisgICAgICAucmVtb3ZlQ2xhc3MoJ2FjdGl2ZScpCisKKyAgICB0aGlzLiRlbGVtZW50LnRvZ2dsZUNsYXNzKCdhY3RpdmUnKQorICB9CisKKworIC8qIEJVVFRPTiBQTFVHSU4gREVGSU5JVElPTgorICAqID09PT09PT09PT09PT09PT09PT09PT09PSAqLworCisgIHZhciBvbGQgPSAkLmZuLmJ1dHRvbgorCisgICQuZm4uYnV0dG9uID0gZnVuY3Rpb24gKG9wdGlvbikgeworICAgIHJldHVybiB0aGlzLmVhY2goZnVuY3Rpb24gKCkgeworICAgICAgdmFyICR0aGlzID0gJCh0aGlzKQorICAgICAgICAsIGRhdGEgPSAkdGhpcy5kYXRhKCdidXR0b24nKQorICAgICAgICAsIG9wdGlvbnMgPSB0eXBlb2Ygb3B0aW9uID09ICdvYmplY3QnICYmIG9wdGlvbgorICAgICAgaWYgKCFkYXRhKSAkdGhpcy5kYXRhKCdidXR0b24nLCAoZGF0YSA9IG5ldyBCdXR0b24odGhpcywgb3B0aW9ucykpKQorICAgICAgaWYgKG9wdGlvbiA9PSAndG9nZ2xlJykgZGF0YS50b2dnbGUoKQorICAgICAgZWxzZSBpZiAob3B0aW9uKSBkYXRhLnNldFN0YXRlKG9wdGlvbikKKyAgICB9KQorICB9CisKKyAgJC5mbi5idXR0b24uZGVmYXVsdHMgPSB7CisgICAgbG9hZGluZ1RleHQ6ICdsb2FkaW5nLi4uJworICB9CisKKyAgJC5mbi5idXR0b24uQ29uc3RydWN0b3IgPSBCdXR0b24KKworCisgLyogQlVUVE9OIE5PIENPTkZMSUNUCisgICogPT09PT09PT09PT09PT09PT09ICovCisKKyAgJC5mbi5idXR0b24ubm9Db25mbGljdCA9IGZ1bmN0aW9uICgpIHsKKyAgICAkLmZuLmJ1dHRvbiA9IG9sZAorICAgIHJldHVybiB0aGlzCisgIH0KKworCisgLyogQlVUVE9OIERBVEEtQVBJCisgICogPT09PT09PT09PT09PT09ICovCisKKyAgJChkb2N1bWVudCkub24oJ2NsaWNrLmJ1dHRvbi5kYXRhLWFwaScsICdbZGF0YS10b2dnbGVePWJ1dHRvbl0nLCBmdW5jdGlvbiAoZSkgeworICAgIHZhciAkYnRuID0gJChlLnRhcmdldCkKKyAgICBpZiAoISRidG4uaGFzQ2xhc3MoJ2J0bicpKSAkYnRuID0gJGJ0bi5jbG9zZXN0KCcuYnRuJykKKyAgICAkYnRuLmJ1dHRvbigndG9nZ2xlJykKKyAgfSkKKworfSh3aW5kb3cualF1ZXJ5KTsvKiA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisgKiBib290c3RyYXAtY2Fyb3VzZWwuanMgdjIuMy4yCisgKiBodHRwOi8vZ2V0Ym9vdHN0cmFwLmNvbS8yLjMuMi9qYXZhc2NyaXB0Lmh0bWwjY2Fyb3VzZWwKKyAqID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKyAqIENvcHlyaWdodCAyMDEzIFR3aXR0ZXIsIEluYy4KKyAqCisgKiBMaWNlbnNlZCB1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RpbmRpY2F0b3JzID0gdGhpcy4kZWxlbWVudC5maW5kKCcuY2Fyb3VzZWwtaW5kaWNhdG9ycycpCisgICAgdGhpcy5vcHRpb25zID0gb3B0aW9ucworICAgIHRoaXMub3B0aW9ucy5wYXVzZSA9PSAnaG92ZXInICYmIHRoaXMuJGVsZW1lbnQKKyAgICAgIC5vbignbW91c2VlbnRlcicsICQucHJveHkodGhpcy5wYXVzZSwgdGhpcykpCisgICAgICAub24oJ21vdXNlbGVhdmUnLCAkLnByb3h5KHRoaXMuY3ljbGUsIHRoaXMpKQorICB9CisKKyAgQ2Fyb3VzZWwucHJvdG90eXBlID0geworCisgICAgY3ljbGU6IGZ1bmN0aW9uIChlKSB7CisgICAgICBpZiAoIWUpIHRoaXMucGF1c2VkID0gZmFsc2UKKyAgICAgIGlmICh0aGlzLmludGVydmFsKSBjbGVhckludGVydmFsKHRoaXMuaW50ZXJ2YWwpOworICAgICAgdGhpcy5vcHRpb25zLmludGVydmFsCisgICAgICAgICYmICF0aGlzLnBhdXNlZAorICAgICAgICAmJiAodGhpcy5pbnRlcnZhbCA9IHNldEludGVydmFsKCQucHJveHkodGhpcy5uZXh0LCB0aGlzKSwgdGhpcy5vcHRpb25zLmludGVydmFsKSkKKyAgICAgIHJldHVybiB0aGlzCisgICAgfQorCisgICwgZ2V0QWN0aXZlSW5kZXg6IGZ1bmN0aW9uICgpIHsKKyAgICAgIHRoaXMuJGFjdGl2ZSA9IHRoaXMuJGVsZW1lbnQuZmluZCgnLml0ZW0uYWN0aXZlJykKKyAgICAgIHRoaXMuJGl0ZW1zID0gdGhpcy4kYWN0aXZlLnBhcmVudCgpLmNoaWxkcmVuKCkKKyAgICAgIHJldHVybiB0aGlzLiRpdGVtcy5pbmRleCh0aGlzLiRhY3RpdmUpCisgICAgfQorCisgICwgdG86IGZ1bmN0aW9uIChwb3MpIHsKKyAgICAgIHZhciBhY3RpdmVJbmRleCA9IHRoaXMuZ2V0QWN0aXZlSW5kZXgoKQorICAgICAg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nZXIoZSkKKyAgICAgICAgaWYgKGUuaXNEZWZhdWx0UHJldmVudGVkKCkpIHJldHVybgorICAgICAgICAkYWN0aXZlLnJlbW92ZUNsYXNzKCdhY3RpdmUnKQorICAgICAgICAkbmV4dC5hZGRDbGFzcygnYWN0aXZlJykKKyAgICAgICAgdGhpcy5zbGlkaW5nID0gZmFsc2UKKyAgICAgICAgdGhpcy4kZWxlbWVudC50cmlnZ2VyKCdzbGlkJykKKyAgICAgIH0KKworICAgICAgaXNDeWNsaW5nICYmIHRoaXMuY3ljbGUoKQorCisgICAgICByZXR1cm4gdGhpcworICAgIH0KKworICB9CisKKworIC8qIENBUk9VU0VMIFBMVUdJTiBERUZJTklUSU9OCisgICogPT09PT09PT09PT09PT09PT09PT09PT09PT0gKi8KKworICB2YXIgb2xkID0gJC5mbi5jYXJvdXNlbAorCisgICQuZm4uY2Fyb3VzZWwgPSBmdW5jdGlvbiAob3B0aW9uKSB7CisgICAgcmV0dXJuIHRoaXMuZWFjaChmdW5jdGlvbiAoKSB7CisgICAgICB2YXIgJHRoaXMgPSAkKHRoaXMpCisgICAgICAgICwgZGF0YSA9ICR0aGlzLmRhdGEoJ2Nhcm91c2VsJykKKyAgICAgICAgLCBvcHRpb25zID0gJC5leHRlbmQoe30sICQuZm4uY2Fyb3VzZWwuZGVmYXVsdHMsIHR5cGVvZiBvcHRpb24gPT0gJ29iamVjdCcgJiYgb3B0aW9uKQorICAgICAgICAsIGFjdGlvbiA9IHR5cGVvZiBvcHRpb24gPT0gJ3N0cmluZycgPyBvcHRpb24gOiBvcHRpb25zLnNsaWRlCisgICAgICBpZiAoIWRhdGEpICR0aGlzLmRhdGEoJ2Nhcm91c2VsJywgKGRhdGEgPSBuZXcgQ2Fyb3VzZWwodGhpcywgb3B0aW9ucykpKQorICAgICAgaWYgKHR5cGVvZiBvcHRpb24gPT0gJ251bWJlcicpIGRhdGEudG8ob3B0aW9uKQorICAgICAgZWxzZSBpZiAoYWN0aW9uKSBkYXRhW2Fj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ICAgJHRhcmdldC5kYXRhKCdjYXJvdXNlbCcpLnBhdXNlKCkudG8oc2xpZGVJbmRleCkuY3ljbGUoKQorICAgIH0KKworICAgIGUucHJldmVudERlZmF1bHQoKQorICB9KQorCit9KHdpbmRvdy5qUXVlcnkpOy8qID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKyAqIGJvb3RzdHJhcC1jb2xsYXBzZS5qcyB2Mi4zLjIKKyAqIGh0dHA6Ly9nZXRib290c3RyYXAuY29tLzIuMy4yL2phdmFzY3JpcHQuaHRtbCNjb2xsYXBzZQorICogPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorICogQ29weXJpZ2h0IDIwMTMgVHdpdHRlciwgSW5jLgorICoKKyAqIExpY2Vuc2VkIHVuZGVyIHRoZSBBcGFjaGUgTGljZW5zZSwgVmVyc2lvbiAyLjAgKHRoZSAiTGljZW5zZSIpOworICogeW91IG1heSBub3QgdXNlIHRoaXMgZmlsZSBleGNlcHQgaW4gY29tcGxpYW5jZSB3aXRoIHRoZSBMaWNlbnNlLgorICogWW91IG1heSBvYnRhaW4gYSBjb3B5IG9mIHRoZSBMaWNlbnNlIGF0CisgKgorICogaHR0cDovL3d3dy5hcGFjaGUub3JnL2xpY2Vuc2VzL0xJQ0VOU0UtMi4wCisgKgorICogVW5sZXNzIHJlcXVpcmVkIGJ5IGFwcGxpY2FibGUgbGF3IG9yIGFncmVlZCB0byBpbiB3cml0aW5nLCBzb2Z0d2FyZQorICogZGlzdHJpYnV0ZWQgdW5kZXIgdGhlIExpY2Vuc2UgaXMgZGlzdHJpYnV0ZWQgb24gYW4gIkFTIElTIiBCQVNJUywKKyAqIFdJVEhPVVQgV0FSUkFOVElFUyBPUiBDT05ESVRJT05TIE9GIEFOWSBLSU5ELCBlaXRoZXIgZXhwcmVzcyBvciBpbXBsaWVkLgorICogU2VlIHRoZSBMaWNlbnNlIGZvciB0aGUgc3BlY2lmaWMgbGFuZ3VhZ2UgZ292ZXJuaW5nIHBlcm1pc3Npb25zIGFuZAorICogbGltaXRhdGlvbnMgdW5kZXIgdGhlIExpY2Vuc2UuCisgKiA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0gKi8KKworCishZnVuY3Rpb24gKCQpIHsKKworICAidXNlIHN0cmljdCI7IC8vIGpzaGludCA7XzsKKworCisgLyogQ09MTEFQU0UgUFVCTElDIENMQVNTIERFRklOSVRJT04KKyAgKiA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PSAqLworCisgIHZhciBDb2xsYXBzZSA9IGZ1bmN0aW9uIChlbGVtZW50LCBvcHRpb25zKSB7CisgICAgdGhpcy4kZWxlbWVudCA9ICQoZWxlbWVudCkKKyAgICB0aGlzLm9wdGlvbnMgPSAkLmV4dGVuZCh7fSwgJC5mbi5jb2xsYXBzZS5kZWZhdWx0cywgb3B0aW9ucykKKworICAgIGlmICh0aGlzLm9wdGlvbnMucGFyZW50KSB7CisgICAgICB0aGlzLiRwYXJlbnQgPSAkKHRoaXMub3B0aW9ucy5wYXJlbnQpCisgICAgfQorCisgICAgdGhpcy5vcHRpb25zLnRvZ2dsZSAmJiB0aGlzLnRvZ2dsZSgpCisgIH0KKworICBDb2xsYXBzZS5wcm90b3R5cGUgPSB7CisKKyAgICBjb25zdHJ1Y3RvcjogQ29sbGFwc2UKKworICAsIGRpbWVuc2lvbjogZnVuY3Rpb24gKCkgeworICAgICAgdmFyIGhhc1dpZHRoID0gdGhpcy4kZWxlbWVudC5oYXNDbGFzcygnd2lkdGgnKQorICAgICAgcmV0dXJuIGhhc1dpZHRoID8gJ3dpZHRoJyA6ICdoZWlnaHQnCisgICAgfQorCisgICwgc2hvdzogZnVuY3Rpb24gKCkgeworICAgICAgdmFyIGRpbWVuc2lvbgorICAgICAgICAsIHNjcm9sbAorICAgICAgICAsIGFjdGl2ZX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W1lbnNpb24oKQorICAgICAgdGhpcy5yZXNldCh0aGlzLiRlbGVtZW50W2RpbWVuc2lvbl0oKSkKKyAgICAgIHRoaXMudHJhbnNpdGlvbigncmVtb3ZlQ2xhc3MnLCAkLkV2ZW50KCdoaWRlJyksICdoaWRkZW4nKQorICAgICAgdGhpcy4kZWxlbWVudFtkaW1lbnNpb25dKDApCisgICAgfQorCisgICwgcmVzZXQ6IGZ1bmN0aW9uIChzaXplKSB7CisgICAgICB2YXIgZGltZW5zaW9uID0gdGhpcy5kaW1lbnNpb24oKQorCisgICAgICB0aGlzLiRlbGVtZW50CisgICAgICAgIC5yZW1vdmVDbGFzcygnY29sbGFwc2UnKQorICAgICAgICBbZGltZW5zaW9uXShzaXplIHx8ICdhdXRvJykKKyAgICAgICAgWzBdLm9mZnNldFdpZHRoCisKKyAgICAgIHRoaXMuJGVsZW1lbnRbc2l6ZSAhPT0gbnVsbCA/ICdhZGRDbGFzcycgOiAncmVtb3ZlQ2xhc3MnXSgnY29sbGFwc2UnKQorCisgICAgICByZXR1cm4gdGhpcworICAgIH0KKworICAsIHRyYW5zaXRpb246IGZ1bmN0aW9uIChtZXRob2QsIHN0YXJ0RXZlbnQsIGNvbXBsZXRlRXZlbnQpIHsKKyAgICAgIHZhciB0aGF0ID0gdGhpcworICAgICAgICAsIGNvbXBsZXRlID0gZnVuY3Rpb24gKCkgeworICAgICAgICAgICAgaWYgKHN0YXJ0RXZlbnQudHlwZSA9PSAnc2hvdycpIHRoYXQucmVzZXQoKQorICAgICAgICAgICAgdGhhdC50cmFuc2l0aW9uaW5nID0gMAorICAgICAgICAgICAgdGhhdC4kZWxlbWVudC50cmlnZ2VyKGNvbXBsZXRlRXZlbnQpCisgICAgICAgICAgfQorCisgICAgICB0aGlzLiRlbGVtZW50LnRyaWdnZXIoc3RhcnRFdmVudCkKKworICAgICAgaWYgKHN0YXJ0RXZlbnQuaXNEZWZhdWx0UHJldmVudGVkKCkpIHJldHVybgorCisgICAgICB0aGlzLn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lLmRlZmF1bHRzID0geworICAgIHRvZ2dsZTogdHJ1ZQorICB9CisKKyAgJC5mbi5jb2xsYXBzZS5Db25zdHJ1Y3RvciA9IENvbGxhcHNlCisKKworIC8qIENPTExBUFNFIE5PIENPTkZMSUNUCisgICogPT09PT09PT09PT09PT09PT09PT0gKi8KKworICAkLmZuLmNvbGxhcHNlLm5vQ29uZmxpY3QgPSBmdW5jdGlvbiAoKSB7CisgICAgJC5mbi5jb2xsYXBzZSA9IG9sZAorICAgIHJldHVybiB0aGlzCisgIH0KKworCisgLyogQ09MTEFQU0UgREFUQS1BUEkKKyAgKiA9PT09PT09PT09PT09PT09PSAqLworCisgICQoZG9jdW1lbnQpLm9uKCdjbGljay5jb2xsYXBzZS5kYXRhLWFwaScsICdbZGF0YS10b2dnbGU9Y29sbGFwc2VdJywgZnVuY3Rpb24gKGUpIHsKKyAgICB2YXIgJHRoaXMgPSAkKHRoaXMpLCBocmVmCisgICAgICAsIHRhcmdldCA9ICR0aGlzLmF0dHIoJ2RhdGEtdGFyZ2V0JykKKyAgICAgICAgfHwgZS5wcmV2ZW50RGVmYXVsdCgpCisgICAgICAgIHx8IChocmVmID0gJHRoaXMuYXR0cignaHJlZicpKSAmJiBocmVmLnJlcGxhY2UoLy4qKD89I1teXHNdKyQpLywgJycpIC8vc3RyaXAgZm9yIGllNworICAgICAgLCBvcHRpb24gPSAkKHRhcmdldCkuZGF0YSgnY29sbGFwc2UnKSA/ICd0b2dnbGUnIDogJHRoaXMuZGF0YSgpCisgICAgJHRoaXNbJCh0YXJnZXQpLmhhc0NsYXNzKCdpbicpID8gJ2FkZENsYXNzJyA6ICdyZW1vdmVDbGFzcyddKCdjb2xsYXBzZWQnKQorICAgICQodGFyZ2V0KS5jb2xsYXBzZShvcHRpb24pCisgIH0pCisKK30od2luZG93LmpRdWVyeSk7LyogPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisgKiBib290c3RyYXAtZH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KSB7CisKKyAgInVzZSBzdHJpY3QiOyAvLyBqc2hpbnQgO187CisKKworIC8qIERST1BET1dOIENMQVNTIERFRklOSVRJT04KKyAgKiA9PT09PT09PT09PT09PT09PT09PT09PT09ICovCisKKyAgdmFyIHRvZ2dsZSA9ICdbZGF0YS10b2dnbGU9ZHJvcGRvd25dJworICAgICwgRHJvcGRvd24gPSBmdW5jdGlvbiAoZWxlbWVudCkgeworICAgICAgICB2YXIgJGVsID0gJChlbGVtZW50KS5vbignY2xpY2suZHJvcGRvd24uZGF0YS1hcGknLCB0aGlzLnRvZ2dsZSkKKyAgICAgICAgJCgnaHRtbCcpLm9uKCdjbGljay5kcm9wZG93bi5kYXRhLWFwaScsIGZ1bmN0aW9uICgpIHsKKyAgICAgICAgICAkZWwucGFyZW50KCkucmVtb3ZlQ2xhc3MoJ29wZW4nKQorICAgICAgICB9KQorICAgICAgfQorCisgIERyb3Bkb3duLnByb3RvdHlwZSA9IHsKKworICAgIGNvbnN0cnVjdG9yOiBEcm9wZG93bgorCisgICwgdG9nZ2xlOiBmdW5jdGlvbiAoZSkgeworICAgICAgdmFyICR0aGlzID0gJCh0aGlzKQorICAgICAgICAsICRwYXJlbnQKKyAgICAgICAgLCBpc0FjdGl2ZQorCisgICAgICBpZiAoJHRoaXMuaXMoJy5kaXNhYmxlZCwgOmRpc2FibGVkJykpIHJldHVybgorCisgICAgICAkcGFyZW50ID0gZ2V0UGFyZW50KCR0aGlzKQorCisgICAgICBpc0FjdGl2ZSA9ICRwYXJlbnQuaGFzQ2xhc3MoJ29wZW4nKQorCisgICAgICBjbGVhck1lbnVzKCkKKworICAgICAgaWYgKCFpc0FjdGl2ZSkgeworICAgICAgICBpZiAoJ29udG91Y2hzdGFydCcgaW4gZG9jdW1lbnQuZG9jdW1lbnRFbGVtZW50KSB7CisgICAgICAgICAgLy8gaWYgbW9iaWxlIHdlIHdlIHVzZSBhIGJhY2tkcm9wIGJlY2F1c2UgY2xpY2sgZXZlbnRzIGRvbid0IGRlbGVnYXRlCisgICAgICAgICAgJCgnPGRpdiBjbGFzcz0iZHJvcGRvd24tYmFja2Ryb3AiLz4nKS5pbnNlcnRCZWZvcmUoJCh0aGlzKSkub24oJ2NsaWNrJywgY2xlYXJNZW51cykKKyAgICAgICAgfQorICAgICAgICAkcGFyZW50LnRvZ2dsZUNsYXNzKCdvcGVuJykKKyAgICAgIH0KKworICAgICAgJHRoaXMuZm9jdXMoKQorCisgICAgICByZXR1cm4gZmFsc2UKKyAgICB9CisKKyAgLCBrZXlkb3duOiBmdW5jdGlvbiAoZSkgeworICAgICAgdmFyICR0aGlzCisgICAgICAgICwgJGl0ZW1zCisgICAgICAgICwgJGFjdGl2ZQorICAgICAgICAsICRwYXJlbnQKKyAgICAgICAgLCBpc0FjdGl2ZQorICAgICAgICAsIGluZGV4CisKKyAgICAgIGlmICghLygzOHw0MHwyNykvLnRlc3QoZS5rZXlDb2RlKSkgcmV0dXJuCisKKyAgICAgICR0aGlzID0gJCh0aGlzKQorCisgICAgICBlLnByZXZlbnREZWZhdWx0KCkKKyAgICAgIGUuc3RvcFByb3BhZ2F0aW9uKCkKKworICAgICAgaWYgKCR0aGlzLmlzKCcuZGlzYWJsZWQsIDpkaXNhYmxlZCcpKSByZXR1cm4KKworICAgICAgJHBhcmVudCA9IGdldFBhcmVudCgkdGhpcykKKworICAgICAgaXNBY3RpdmUgPSAkcGFyZW50Lmhhc0NsYXNzKCdvcGVuJykKKworICAgICAgaWYgKCFpc0FjdGl2ZSB8fCAoaXNBY3RpdmUgJiYgZS5rZXlDb2RlID09IDI3KSkgeworICAgICAgICBpZiAoZS53aGljaCA9PSAyNykgJHBhcmVudC5maW5kKHRvZ2dsZSkuZm9jdXMoKQorICAgICAgICByZXR1cm4gJHRoaXMuY2xpY2soKQorICAgICAgfQorCisgICAgICAkaXRlbXMgPSAkKCdbcm9sZT1tZW51XSBsaTpub3QoLmRpdmlkZXIpOnZpc2libGUgYScsICRwYXJlbnQpCisKKyAgICAgIGlmICghJGl0ZW1zLmxlbmd0aCkgcmV0dXJuCisKKyAgICAgIGluZGV4ID0gJGl0ZW1zLmluZGV4KCRpdGVtcy5maWx0ZXIoJzpmb2N1cycpKQorCisgICAgICBpZiAoZS5rZXlDb2RlID09IDM4ICYmIGluZGV4ID4gMCkgaW5kZXgtLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyB1cAorICAgICAgaWYgKGUua2V5Q29kZSA9PSA0MCAmJiBpbmRleCA8ICRpdGVtcy5sZW5ndGggLSAxKSBpbmRleCsrICAgICAgICAgICAgICAgICAgICAgICAgLy8gZG93bgorICAgICAgaWYgKCF+aW5kZXgpIGluZGV4ID0gMAorCisgICAgICAkaXRlbXMKKyAgICAgICAgLmVxKGluZGV4KQorICAgICAgICAuZm9jdXMoKQorICAgIH0KKworICB9CisKKyAgZnVuY3Rpb24gY2xlYXJNZW51cygpIHsKKyAgICAkKCcuZHJvcGRvd24tYmFja2Ryb3AnKS5yZW1vdmUoKQorICAgICQodG9nZ2xlKS5lYWNoKGZ1bmN0aW9uICgpIHsKKyAgICAgIGdldFBhcmVudCgkKHRoaXMpKS5yZW1vdmVDbGFzcygnb3BlbicpCisgICAgfSkKKyAgfQorCisgIGZ1bmN0aW9uIGdldFBhcmVudCgkdGhpcykgeworICAgIHZhciBzZWxlY3RvciA9ICR0aGlzLmF0dHIoJ2RhdGEtdGFyZ2V0JykKKyAgICAgICwgJHBhcmVudAorCisgICAgaWYgKCFzZWxlY3RvcikgeworICAgICAgc2VsZWN0b3IgPSAkdGhpcy5hdHRyKCdocmVmJykKKyAgICAgIHNlbGVjdG9yID0gc2VsZWN0b3IgJiYgLyMvLnRlc3Qoc2VsZWN0b3IpICYmIHNlbGVjdG9yLnJlcGxhY2UoLy4qKD89I1teXHNdKiQpLywgJycpIC8vc3RyaXAgZm9yIGllNworICAgIH0KKworICAgICRwYXJlbnQgPSBzZWxlY3RvciAmJiAkKHNlbGVjdG9yKQorCisgICAgaWYgKCEkcGFyZW50IHx8ICEkcGFyZW50Lmxlbmd0aCkgJHBhcmVudCA9ICR0aGlzLnBhcmVudCgpCisKKyAgICByZXR1cm4gJHBhcmVudAorICB9CisKKworICAvKiBEUk9QRE9XTiBQTFVHSU4gREVGSU5JVElPTgorICAgKiA9PT09PT09PT09PT09PT09PT09PT09PT09PSAqLworCisgIHZhciBvbGQgPSAkLmZuLmRyb3Bkb3duCisKKyAgJC5mbi5kcm9wZG93biA9IGZ1bmN0aW9uIChvcHRpb24pIHsKKyAgICByZXR1cm4gdGhpcy5lYWNoKGZ1bmN0aW9uICgpIHsKKyAgICAgIHZhciAkdGhpcyA9ICQodGhpcykKKyAgICAgICAgLCBkYXRhID0gJHRoaXMuZGF0YSgnZHJvcGRvd24nKQorICAgICAgaWYgKCFkYXRhKSAkdGhpcy5kYXRhKCdkcm9wZG93bicsIChkYXRhID0gbmV3IERyb3Bkb3duKHRoaXMpKSkKKyAgICAgIGlmICh0eXBlb2Ygb3B0aW9uID09ICdzdHJpbmcnKSBkYXRhW29wdGlvbl0uY2FsbCgkdGhpcykKKyAgICB9KQorICB9CisKKyAgJC5mbi5kcm9wZG93bi5Db25zdHJ1Y3RvciA9IERyb3Bkb3duCisKKworIC8qIERST1BET1dOIE5PIENPTkZMSUNUCisgICogPT09PT09PT09PT09PT09PT09PT0gKi8KKworICAkLmZuLmRyb3Bkb3duLm5vQ29uZmxpY3QgPSBmdW5jdGlvbiAoKSB7CisgICAgJC5mbi5kcm9wZG93biA9IG9sZAorICAgIHJldHVybiB0aGlzCisgIH0KKworCisgIC8qIEFQUExZIFRPIFNUQU5EQVJEIERST1BET1dOIEVMRU1FTlRTCisgICAqID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09ICovCisKKyAgJChkb2N1bWVudCkKKyAgICAub24oJ2NsaWNrLmRyb3Bkb3duLmRhdGEtYXBpJywgY2xlYXJNZW51cykKKyAgICAub24oJ2NsaWNrLmRyb3Bkb3duLmRhdGEtYXBpJywgJy5kcm9wZG93biBmb3JtJywgZnVuY3Rpb24gKGUpIHsgZS5zdG9wUHJvcGFnYXRpb24oKSB9KQorICAgIC5vbignY2xpY2suZHJvcGRvd24uZGF0YS1hcGknICAsIHRvZ2dsZSwgRHJvcGRvd24ucHJvdG90eXBlLnRvZ2dsZSkKKyAgICAub24oJ2tleWRvd24uZHJvcGRvd24uZGF0YS1hcGknLCB0b2dnbGUgKyAnLCBbcm9sZT1tZW51XScgLCBEcm9wZG93bi5wcm90b3R5cGUua2V5ZG93bikKKworfSh3aW5kb3cualF1ZXJ5KTsKKy8qID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorICogYm9vdHN0cmFwLW1vZGFsLmpzIHYyLjMuMgorICogaHR0cDovL2dldGJvb3RzdHJhcC5jb20vMi4zLjIvamF2YXNjcmlwdC5odG1sI21vZGFscworICogPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisgKiBDb3B5cmlnaHQgMjAxMyBUd2l0dGVyLCBJbmMuCisgKgorICogTGljZW5zZWQgdW5kZXIgdGhlIEFwYWNoZSBMaWNlbnNlLCBWZXJzaW9uIDIuMCAodGhlICJMaWNlbnNlIik7CisgKiB5b3UgbWF5IG5vdCB1c2UgdGhpcyBmaWxlIGV4Y2VwdCBpbiBjb21wbGlhbmNlIHdpdGggdGhlIExpY2Vuc2UuCisgKiBZb3UgbWF5IG9idGFpbiBhIGNvcHkgb2YgdGhlIExpY2Vuc2UgYXQKKyAqCisgKiBodHRwOi8vd3d3LmFwYWNoZS5vcmcvbGljZW5zZXMvTElDRU5TRS0yLjAKKyAqCisgKiBVbmxlc3MgcmVxdWlyZWQgYnkgYXBwbGljYWJsZSBsYXcgb3IgYWdyZWVkIHRvIGluIHdyaXRpbmcsIHNvZnR3YXJlCisgKiBkaXN0cmlidXRlZCB1bmRlciB0aGUgTGljZW5zZSBpcyBkaXN0cmlidXRlZCBvbiBhbiAiQVMgSVMiIEJBU0lTLAorICogV0lUSE9VVCBXQVJSQU5USUVTIE9SIENPTkRJVElPTlMgT0YgQU5ZIEtJTkQsIGVpdGhlciBleHByZXNzIG9yIGltcGxpZWQuCisgKiBTZWUgdGhlIExpY2Vuc2UgZm9yIHRoZSBzcGVjaWZpYyBsYW5ndWFnZSBnb3Zlcm5pbmcgcGVybWlzc2lvbnMgYW5kCisgKiBsaW1pdGF0aW9ucyB1bmRlciB0aGUgTGljZW5zZS4KKyAqID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PSAqLworCisKKyFmdW5jdGlvbiAoJCkgeworCisgICJ1c2Ugc3RyaWN0IjsgLy8ganNoaW50IDtfOworCisKKyAvKiBNT0RBTCBDTEFTUyBERUZJTklUSU9OCisgICogPT09PT09PT09PT09PT09PT09PT09PSAqLworCisgIHZhciBNb2RhbCA9IGZ1bmN0aW9uIChlbGVtZW50LCBvcHRpb25zKSB7CisgICAgdGhpcy5vcHRpb25zID0gb3B0aW9ucworICAgIHRoaXMuJGVsZW1lbnQgPSAkKGVsZW1lbnQpCisgICAgICAuZGVsZWdhdGUoJ1tkYXRhLWRpc21pc3M9Im1vZGFsIl0nLCAnY2xpY2suZGlzbWlzcy5tb2RhbCcsICQucHJveHkodGhpcy5oaWRlLCB0aGlzKSkKKyAgICB0aGlzLm9wdGlvbnMucmVtb3RlICYmIHRoaXMuJGVsZW1lbnQuZmluZCgnLm1vZGFsLWJvZHknKS5sb2FkKHRoaXMub3B0aW9ucy5yZW1vdGUpCisgIH0KKworICBNb2RhbC5wcm90b3R5cGUgPSB7CisKKyAgICAgIGNvbnN0cnVjdG9yOiBNb2RhbAorCisgICAgLCB0b2dnbGU6IGZ1bmN0aW9uICgpIHsKKyAgICAgICAgcmV0dXJuIHRoaXNbIXRoaXMuaXNTaG93biA/ICdzaG93JyA6ICdoaWRlJ10oKQorICAgICAgfQorCisgICAgLCBzaG93OiBmdW5jdGlvbiAoKSB7CisgICAgICAgIHZhciB0aGF0ID0gdGhpcworICAgICAgICAgICwgZSA9ICQuRXZlbnQoJ3Nob3cnKQorCisgICAgICAgIHRoaXMuJGVsZW1lbnQudHJpZ2dlcihlKQorCisgICAgICAgIGlmICh0aGlzLmlzU2hvd24gfHwgZS5pc0RlZmF1bHRQcmV2ZW50ZWQoKSkgcmV0dXJuCisKKyAgICAgICAgdGhpcy5pc1Nob3duID0gdHJ1ZQorCisgICAgICAgIHRoaXMuZXNjYXBlKCkKKworICAgICAgICB0aGlzLmJhY2tkcm9wKGZ1bmN0aW9uICgpIHsKKyAgICAgICAgICB2YXIgdHJhbnNpdGlvbiA9ICQuc3VwcG9ydC50cmFuc2l0aW9uICYmIHRoYXQuJGVsZW1lbnQuaGFzQ2xhc3MoJ2ZhZGUnKQorCisgICAgICAgICAgaWYgKCF0aGF0LiRlbGVtZW50LnBhcmVudCgpLmxlbmd0aCkgeworICAgICAgICAgICAgdGhhdC4kZWxlbWVudC5hcHBlbmRUbyhkb2N1bWVudC5ib2R5KSAvL2Rvbid0IG1vdmUgbW9kYWxzIGRvbSBwb3NpdGlvbgorICAgICAgICAgIH0KKworICAgICAgICAgIHRoYXQuJGVsZW1lbnQuc2hvdygpCisKKyAgICAgICAgICBpZiAodHJhbnNpdGlvbikgeworICAgICAgICAgICAgdGhhdC4kZWxlbWVudFswXS5vZmZzZXRXaWR0aCAvLyBmb3JjZSByZWZsb3cKKyAgICAgICAgICB9CisKKyAgICAgICAgICB0aGF0LiRlbGVtZW50CisgICAgICAgICAgICAuYWRkQ2xhc3MoJ2luJykKKyAgICAgICAgICAgIC5hdHRyKCdhcmlhLWhpZGRlbicsIGZhbHNlKQorCisgICAgICAgICAgdGhhdC5lbmZvcmNlRm9jdXMoKQorCisgICAgICAgICAgdHJhbnNpdGlvbiA/CisgICAgICAgICAgICB0aGF0LiRlbGVtZW50Lm9uZSgkLnN1cHBvcnQudHJhbnNpdGlvbi5lbmQsIGZ1bmN0aW9uICgpIHsgdGhhdC4kZWxlbWVudC5mb2N1cygpLnRyaWdnZXIoJ3Nob3duJykgfSkgOgorICAgICAgICAgICAgdGhhdC4kZWxlbWVudC5mb2N1cygpLnRyaWdnZXIoJ3Nob3duJykKKworICAgICAgICB9KQorICAgICAgfQorCisgICAgLCBoaWRlOiBmdW5jdGlvbiAoZSkgeworICAgICAgICBlICYmIGUucHJldmVudERlZmF1bHQoKQorCisgICAgICAgIHZhciB0aGF0ID0gdGhpcworCisgICAgICAgIGUgPSAkLkV2ZW50KCdoaWRlJykKKworICAgICAgICB0aGlzLiRlbGVtZW50LnRyaWdnZXIoZSkKKworICAgICAgICBpZiAoIXRoaXMuaXNTaG93biB8fCBlLmlzRGVmYXVsdFByZXZlbnRlZCgpKSByZXR1cm4KKworICAgICAgICB0aGlzLmlzU2hvd24gPSBmYWxzZQorCisgICAgICAgIHRoaXMuZXNjYXBlKCkKKworICAgICAgICAkKGRvY3VtZW50KS5vZmYoJ2ZvY3VzaW4ubW9kYWwnKQorCisgICAgICAgIHRoaXMuJGVsZW1lbnQKKyAgICAgICAgICAucmVtb3ZlQ2xhc3MoJ2luJykKKyAgICAgICAgICAuYXR0cignYXJpYS1oaWRkZW4nLCB0cnVlKQorCisgICAgICAgICQuc3VwcG9ydC50cmFuc2l0aW9uICYmIHRoaXMuJGVsZW1lbnQuaGFzQ2xhc3MoJ2ZhZGUnKSA/CisgICAgICAgICAgdGhpcy5oaWRlV2l0aFRyYW5zaXRpb24oKSA6CisgICAgICAgICAgdGhpcy5oaWRlTW9kYWwoKQorICAgICAgfQorCisgICAgLCBlbmZvcmNlRm9jdXM6IGZ1bmN0aW9uICgpIHsKKyAgICAgICAgdmFyIHRoYXQgPSB0aGlzCisgICAgICAgICQoZG9jdW1lbnQpLm9uKCdmb2N1c2luLm1vZGFsJywgZnVuY3Rpb24gKGUpIHsKKyAgICAgICAgICBpZiAodGhhdC4kZWxlbWVudFswXSAhPT0gZS50YXJnZXQgJiYgIXRoYXQuJGVsZW1lbnQuaGFzKGUudGFyZ2V0KS5sZW5ndGgpIHsKKyAgICAgICAgICAgIHRoYXQuJGVsZW1lbnQuZm9jdXMoKQorICAgICAgICAgIH0KKyAgICAgICAgfSkKKyAgICAgIH0KKworICAgICwgZXNjYXBlOiBmdW5jdGlvbiAoKSB7CisgICAgICAgIHZhciB0aGF0ID0gdGhpcworICAgICAgICBpZiAodGhpcy5pc1Nob3duICYmIHRoaXMub3B0aW9ucy5rZXlib2FyZCkgeworICAgICAgICAgIHRoaXMuJGVsZW1lbnQub24oJ2tleXVwLmRpc21pc3MubW9kYWwnLCBmdW5jdGlvbiAoIGUgKSB7CisgICAgICAgICAgICBlLndoaWNoID09IDI3ICYmIHRoYXQuaGlkZSgpCisgICAgICAgICAgfSkKKyAgICAgICAgfSBlbHNlIGlmICghdGhpcy5pc1Nob3duKSB7CisgICAgICAgICAgdGhpcy4kZWxlbWVudC5vZmYoJ2tleXVwLmRpc21pc3MubW9kYWwnKQorICAgICAgICB9CisgICAgICB9CisKKyAgICAsIGhpZGVXaXRoVHJhbnNpdGlvbjogZnVuY3Rpb24gKCkgeworICAgICAgICB2YXIgdGhhdCA9IHRoaXMKKyAgICAgICAgICAsIHRpbWVvdXQgPSBzZXRUaW1lb3V0KGZ1bmN0aW9uICgpIHsKKyAgICAgICAgICAgICAgdGhhdC4kZWxlbWVudC5vZmYoJC5zdXBwb3J0LnRyYW5zaXRpb24uZW5kKQorICAgICAgICAgICAgICB0aGF0LmhpZGVNb2RhbCgpCisgICAgICAgICAgICB9LCA1MDApCisKKyAgICAgICAgdGhpcy4kZWxlbWVudC5vbmUoJC5zdXBwb3J0LnRyYW5zaXRpb24uZW5kLCBmdW5jdGlvbiAoKSB7CisgICAgICAgICAgY2xlYXJUaW1lb3V0KHRpbWVvdXQpCisgICAgICAgICAgdGhhdC5oaWRlTW9kYWwoKQorICAgICAgICB9KQorICAgICAgfQorCisgICAgLCBoaWRlTW9kYWw6IGZ1bmN0aW9uICgpIHsKKyAgICAgICAgdmFyIHRoYXQgPSB0aGlzCisgICAgICAgIHRoaXMuJGVsZW1lbnQuaGlkZSgpCisgICAgICAgIHRoaXMuYmFja2Ryb3AoZnVuY3Rpb24gKCkgeworICAgICAgICAgIHRoYXQucmVtb3ZlQmFja2Ryb3AoKQorICAgICAgICAgIHRoYXQuJGVsZW1lbnQudHJpZ2dlcignaGlkZGVuJykKKyAgICAgICAgfSkKKyAgICAgIH0KKworICAgICwgcmVtb3ZlQmFja2Ryb3A6IGZ1bmN0aW9uICgpIHsKKyAgICAgICAgdGhpcy4kYmFja2Ryb3AgJiYgdGhpcy4kYmFja2Ryb3AucmVtb3ZlKCkKKyAgICAgICAgdGhpcy4kYmFja2Ryb3AgPSBudWxsCisgICAgICB9CisKKyAgICAsIGJhY2tkcm9wOiBmdW5jdGlvbiAoY2FsbGJhY2spIHsKKyAgICAgICAgdmFyIHRoYXQgPSB0aGlzCisgICAgICAgICAgLCBhbmltYXRlID0gdGhpcy4kZWxlbWVudC5oYXNDbGFzcygnZmFkZScpID8gJ2ZhZGUnIDogJycKKworICAgICAgICBpZiAodGhpcy5pc1Nob3duICYmIHRoaXMub3B0aW9ucy5iYWNrZHJvcCkgeworICAgICAgICAgIHZhciBkb0FuaW1hdGUgPSAkLnN1cHBvcnQudHJhbnNpdGlvbiAmJiBhbmltYXRlCisKKyAgICAgICAgICB0aGlzLiRiYWNrZHJvcCA9ICQoJzxkaXYgY2xhc3M9Im1vZGFsLWJhY2tkcm9wICcgKyBhbmltYXRlICsgJyIgLz4nKQorICAgICAgICAgICAgLmFwcGVuZFRvKGRvY3VtZW50LmJvZHkpCisKKyAgICAgICAgICB0aGlzLiRiYWNrZHJvcC5jbGljaygKKyAgICAgICAgICAgIHRoaXMub3B0aW9ucy5iYWNrZHJvcCA9PSAnc3RhdGljJyA/CisgICAgICAgICAgICAgICQucHJveHkodGhpcy4kZWxlbWVudFswXS5mb2N1cywgdGhpcy4kZWxlbWVudFswXSkKKyAgICAgICAgICAgIDogJC5wcm94eSh0aGlzLmhpZGUsIHRoaXMpCisgICAgICAgICAgKQorCisgICAgICAgICAgaWYgKGRvQW5pbWF0ZSkgdGhpcy4kYmFja2Ryb3BbMF0ub2Zmc2V0V2lkdGggLy8gZm9yY2UgcmVmbG93CisKKyAgICAgICAgICB0aGlzLiRiYWNrZHJvcC5hZGRDbGFzcygnaW4nKQorCisgICAgICAgICAgaWYgKCFjYWxsYmFjaykgcmV0dXJuCisKKyAgICAgICAgICBkb0FuaW1hdGUgPworICAgICAgICAgICAgdGhpcy4kYmFja2Ryb3Aub25lKCQuc3VwcG9ydC50cmFuc2l0aW9uLmVuZCwgY2FsbGJhY2spIDoKKyAgICAgICAgICAgIGNhbGxiYWNrKCkKKworICAgICAgICB9IGVsc2UgaWYgKCF0aGlzLmlzU2hvd24gJiYgdGhpcy4kYmFja2Ryb3ApIHsKKyAgICAgICAgICB0aGlzLiRiYWNrZHJvcC5yZW1vdmVDbGFzcygnaW4nKQorCisgICAgICAgICAgJC5zdXBwb3J0LnRyYW5zaXRpb24gJiYgdGhpcy4kZWxlbWVudC5oYXNDbGFzcygnZmFkZScpPworICAgICAgICAgICAgdGhpcy4kYmFja2Ryb3Aub25lKCQuc3VwcG9ydC50cmFuc2l0aW9uLmVuZCwgY2FsbGJhY2spIDoKKyAgICAgICAgICAgIGNhbGxiYWNrKCkKKworICAgICAgICB9IGVsc2UgaWYgKGNhbGxiYWNrKSB7CisgICAgICAgICAgY2FsbGJhY2soKQorICAgICAgICB9CisgICAgICB9CisgIH0KKworCisgLyogTU9EQUwgUExVR0lOIERFRklOSVRJT04KKyAgKiA9PT09PT09PT09PT09PT09PT09PT09PSAqLworCisgIHZhciBvbGQgPSAkLmZuLm1vZGFsCisKKyAgJC5mbi5tb2RhbCA9IGZ1bmN0aW9uIChvcHRpb24pIHsKKyAgICByZXR1cm4gdGhpcy5lYWNoKGZ1bmN0aW9uICgpIHsKKyAgICAgIHZhciAkdGhpcyA9ICQodGhpcykKKyAgICAgICA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y5kZWxheSB8fCAhc2VsZi5vcHRpb25zLmRlbGF5LnNob3cpIHJldHVybiBzZWxmLnNob3coKQorCisgICAgICBjbGVhclRpbWVvdXQodGhpcy50aW1lb3V0KQorICAgICAgc2VsZi5ob3ZlclN0YXRlID0gJ2luJworICAgICAgdGhpcy50aW1lb3V0ID0gc2V0VGltZW91dChmdW5jdGlvbigpIHsKKyAgICAgICAgaWYgKHNlbGYuaG92ZXJTdGF0ZSA9PSAnaW4nKSBzZWxmLnNob3coKQorICAgICAgfSwgc2VsZi5vcHRpb25zLmRlbGF5LnNob3cpCisgICAgfQorCisgICwgbGVhdmU6IGZ1bmN0aW9uIChlKSB7CisgICAgICB2YXIgc2VsZiA9ICQoZS5jdXJyZW50VGFyZ2V0KVt0aGlzLnR5cGVdKHRoaXMuX29wdGlvbnMpLmRhdGEodGhpcy50eXBlKQorCisgICAgICBpZiAodGhpcy50aW1lb3V0KSBjbGVhclRpbWVvdXQodGhpcy50aW1lb3V0KQorICAgICAgaWYgKCFzZWxmLm9wdGlvbnMuZGVsYXkgfHwgIXNlbGYub3B0aW9ucy5kZWxheS5oaWRlKSByZXR1cm4gc2VsZi5oaWRlKCkKKworICAgICAgc2VsZi5ob3ZlclN0YXRlID0gJ291dCcKKyAgICAgIHRoaXMudGltZW91dCA9IHNldFRpbWVvdXQoZnVuY3Rpb24oKSB7CisgICAgICAgIGlmIChzZWxmLmhvdmVyU3RhdGUgPT0gJ291dCcpIHNlbGYuaGlkZSgpCisgICAgICB9LCBzZWxmLm9wdGlvbnMuZGVsYXkuaGlkZSkKKyAgICB9CisKKyAgLCBzaG93OiBmdW5jdGlvbiAoKSB7CisgICAgICB2YXIgJHRpcAorICAgICAgICAsIHBvcworICAgICAgICAsIGFjdHVhbFdpZHRoCisgICAgICAgICwgYWN0dWFsSGVpZ2h0CisgICAgICAgICwgcGxhY2VtZW50CisgICAgICAgICwgdHAKKyAgICAgICAgLCBlID0gJC5FdmVudCgnc2hvdycpCisKKyAgICAgIGl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nRvb2x0aXAuQ29uc3RydWN0b3IgPSBUb29sdGlwCisKKyAgJC5mbi50b29sdGlwLmRlZmF1bHRzID0geworICAgIGFuaW1hdGlvbjogdHJ1ZQorICAsIHBsYWNlbWVudDogJ3RvcCcKKyAgLCBzZWxlY3RvcjogZmFsc2UKKyAgLCB0ZW1wbGF0ZTogJzxkaXYgY2xhc3M9InRvb2x0aXAiPjxkaXYgY2xhc3M9InRvb2x0aXAtYXJyb3ciPjwvZGl2PjxkaXYgY2xhc3M9InRvb2x0aXAtaW5uZXIiPjwvZGl2PjwvZGl2PicKKyAgLCB0cmlnZ2VyOiAnaG92ZXIgZm9jdXMnCisgICwgdGl0bGU6ICcnCisgICwgZGVsYXk6IDAKKyAgLCBodG1sOiBmYWxzZQorICAsIGNvbnRhaW5lcjogZmFsc2UKKyAgfQorCisKKyAvKiBUT09MVElQIE5PIENPTkZMSUNUCisgICogPT09PT09PT09PT09PT09PT09PSAqLworCisgICQuZm4udG9vbHRpcC5ub0NvbmZsaWN0ID0gZnVuY3Rpb24gKCkgeworICAgICQuZm4udG9vbHRpcCA9IG9sZAorICAgIHJldHVybiB0aGlzCisgIH0KKworfSh3aW5kb3cualF1ZXJ5KTsKKy8qID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisgKiBib290c3RyYXAtcG9wb3Zlci5qcyB2Mi4zLjIKKyAqIGh0dHA6Ly9nZXRib290c3RyYXAuY29tLzIuMy4yL2phdmFzY3JpcHQuaHRtbCNwb3BvdmVycworICogPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KKyAqIENvcHlyaWdodCAyMDEzIFR3aXR0ZXIsIEluYy4KKyAqCisgKiBMaWNlbnNlZCB1bmRlciB0aGUgQXBhY2hlIExpY2Vuc2UsIFZlcnNpb24gMi4wICh0aGUgIkxpY2Vuc2UiKTsKKyAqIHlvdSBtYXkgbm90IHVzZSB0a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T09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PSAqLworCisgIFBvcG92ZXIucHJvdG90eXBlID0gJC5leHRlbmQoe30sICQuZm4udG9vbHRpcC5Db25zdHJ1Y3Rvci5wcm90b3R5cGUsIHsKKworICAgIGNvbnN0cnVjdG9yOiBQb3BvdmVyCisKKyAgLCBzZXRDb250ZW50OiBmdW5jdGlvbiAoKSB7CisgICAgICB2YXIgJHRpcCA9IHRoaXMudGlwKCkKKyAgICAgICAgLCB0aXRsZSA9IHRoaXMuZ2V0VGl0bGUoKQorICAgICAgICAsIGNvbnRlbnQgPSB0aGlzLmdldENvbnRlbnQoKQorCisgICAgICAkdGlwLmZpbmQoJy5wb3BvdmVyLXRpdGxlJylbdGhpcy5vcHRpb25zLmh0bWwgPyAnaHRtbCcgOiAndGV4dCddKHRpdGxlKQorICAgICAgJHRpcC5maW5kKCcucG9wb3Zlci1jb250ZW50JylbdGhpcy5vcHRpb25zLmh0bWwgPyAnaHRtbCcgOiAndGV4dCddKGNvbnRlbnQpCisKKyAgICAgICR0aXAucmVtb3ZlQ2xhc3MoJ2ZhZGUgdG9wIGJvdHRvbSBsZWZ0IHJpZ2h0IGluJykKKyAgICB9CisKKyAgLCBoYXNDb250ZW50OiBmdW5jdGlvbiAoKSB7CisgICAgICByZXR1cm4gdGhpcy5nZXRUaXRsZSgpIHx8IHRoaXMuZ2V0Q29udGVudCgpCisgICAgfQorCisgICwgZ2V0Q29udGVudDogZnVuY3Rpb24gKCkgeworICAgICAgdmFyIGNvbnRlbnQKKyAgICAgICAgLCAkZSA9IHRoaXMuJGVsZW1lbnQKKyAgICAgICAgLCBvID0gdGhpcy5vcHRpb25zCisKKyAgICAgIGNvbnRlbnQgPSAodHlwZW9mIG8uY29udGVudCA9PSAnZnVuY3Rpb24nID8gby5jb250ZW50LmNhbGwoJGVbMF0pIDogIG8uY29udGVudCkKKyAgICAgICAgfHwgJGUuYXR0cignZGF0YS1jb250ZW50JykKKworICAgICAgcmV0dXJuIGNvbnRlbnQKKyAgICB9CisKKyAgLCB0aXA6IGZ1bmN0aW9uICgpIHsKKyAgICAgIGlmICghdGhpcy4kdGlwKSB7CisgICAgICAgIHRoaXMuJHRpcCA9ICQodGhpcy5vcHRpb25zLnRlbXBsYXRlKQorICAgICAgfQorICAgICAgcmV0dXJuIHRoaXMuJHRpcAorICAgIH0KKworICAsIGRlc3Ryb3k6IGZ1bmN0aW9uICgpIHsKKyAgICAgIHRoaXMuaGlkZSgpLiRlbGVtZW50Lm9mZignLicgKyB0aGlzLnR5cGUpLnJlbW92ZURhdGEodGhpcy50eXBlKQorICAgIH0KKworICB9KQorCisKKyAvKiBQT1BPVkVSIFBMVUdJTiBERUZJTklUSU9OCisgICogPT09PT09PT09PT09PT09PT09PT09PT0gKi8KKworICB2YXIgb2xkID0gJC5mbi5wb3BvdmVyCisKKyAgJC5mbi5wb3BvdmVyID0gZnVuY3Rpb24gKG9wdGlvbikgeworICAgIHJldHVybiB0aGlzLmVhY2goZnVuY3Rpb24gKCkgeworICAgICAgdmFyICR0aGlzID0gJCh0aGlzKQorICAgICAgICAsIGRhdGEgPSAkdGhpcy5kYXRhKCdwb3BvdmVyJykKKyAgICAgICAgLCBvcHRpb25zID0gdHlwZW9mIG9wdGlvbiA9PSAnb2JqZWN0JyAmJiBvcHRpb24KKyAgICAgIGlmICghZGF0YSkgJHRoaXMuZGF0YSgncG9wb3ZlcicsIChkYXRhID0gbmV3IFBvcG92ZXIodGhpcywgb3B0aW9ucykpKQorICAgICAgaWYgKHR5cGVvZiBvcHRpb24gPT0gJ3N0cmluZycpIGRhdGFbb3B0aW9uXSgpCisgICAgfSkKKyAgfQorCisgICQuZm4ucG9wb3Zlci5Db25zdHJ1Y3RvciA9IFBvcG92ZXIKKworICAkLmZuLnBvcG92ZXIuZGVmYXVsdHMgPSAkLmV4dGVuZCh7fSAsICQuZm4udG9vbHRpcC5kZWZhdWx0cywgeworICAgIHBsYWNlbWVudDogJ3JpZ2h0JworICAsIHRyaWdnZXI6ICdjbGljaycKKyAgLCBjb250ZW50OiAnJworICAsIHRlbXBsYXRlOiAnPGRpdiBjbGFzcz0icG9wb3ZlciI+PGRpdiBjbGFzcz0iYXJyb3ciPjwvZGl2PjxoMyBjbGFzcz0icG9wb3Zlci10aXRsZSI+PC9oMz48ZGl2IGNsYXNzPSJwb3BvdmVyLWNvbnRlbnQiPjwvZGl2PjwvZGl2PicKKyAgfSkKKworCisgLyogUE9QT1ZFUiBOTyBDT05GTElDVAorICAqID09PT09PT09PT09PT09PT09PT0gKi8KKworICAkLmZuLnBvcG92ZXIubm9Db25mbGljdCA9IGZ1bmN0aW9uICgpIHsKKyAgICAkLmZuLnBvcG92ZXIgPSBvbGQKKyAgICByZXR1cm4gdGhpcworICB9CisKK30od2luZG93LmpRdWVyeSk7CisvKiA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisgKiBib290c3RyYXAtc2Nyb2xsc3B5LmpzIHYyLjMuMgorICogaHR0cDovL2dldGJvb3RzdHJhcC5jb20vMi4zLjIvamF2YXNjcmlwdC5odG1sI3Njcm9sbHNweQorICogPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorICogQ29weXJpZ2h0IDIwMTMgVHdpdHRlciwgSW5jLgorICoKKyAqIExpY2Vuc2VkIHVuZGVyIHRoZSBBcGFjaGUgTGljZW5zZSwgVmVyc2lvbiAyLjAgKHRoZSAiTGljZW5zZSIpOworICogeW91IG1heSBub3QgdXNlIHRoaXMgZmlsZSBleGNlcHQgaW4gY29tcGxpYW5jZSB3aXRoIHRoZSBMaWNlbnNlLgorICogWW91IG1heSBvYnRhaW4gYSBjb3B5IG9mIHRoZSBMaWNlbnNlIGF0CisgKgorICogaHR0cDovL3d3dy5hcGFjaGUub3JnL2xpY2Vuc2VzL0xJQ0VOU0UtMi4wCisgKgorICogVW5sZXNzIHJlcXVpcmVkIGJ5IG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KHRoaXMub3B0aW9ucy50YXJnZXQKKyAgICAgIHx8ICgoaHJlZiA9ICQoZWxlbWVudCkuYXR0cignaHJlZicpKSAmJiBocmVmLnJlcGxhY2UoLy4qKD89I1teXHNdKyQpLywgJycpKSAvL3N0cmlwIGZvciBpZTcKKyAgICAgIHx8ICcnKSArICcgLm5hdiBsaSA+IGEnCisgICAgdGhpcy4kYm9keSA9ICQoJ2JvZHknKQorICAgIHRoaXMucmVmcmVzaCgpCisgICAgdGhpcy5wcm9jZXNzKCkKKyAgfQorCisgIFNjcm9sbFNweS5wcm90b3R5cGUgPSB7CisKKyAgICAgIGNvbnN0cnVjdG9yOiBTY3JvbGxTcHkKKworICAgICwgcmVmcmVzaDogZnVuY3Rpb24gKCkgeworICAgICAgICB2YXIgc2VsZiA9IHRoaXMKKyAgICAgICAgICAsICR0YXJnZXRzCisKKyAgICAgICAgdGhpcy5vZmZzZXRzID0gJChbXSkKKyAgICAgICAgdGhpcy50YXJnZXRzID0gJChbXSkKKworICAgICAgICAkdGFyZ2V0cyA9IHRoaXMuJGJvZHkKKyAgICAgICAgICAuZmluZCh0aGlzLnNlbGVjdG9yKQorICAgICAgICAgIC5tYXAoZnVuY3Rpb24gKCkgeworICAgICAgICAgICAgdmFyICRlbCA9ICQodGhpcykKKyAgICAgICAgICAgICAgLCBocmVmID0gJGVsLmRhdGEoJ3RhcmdldCcpIHx8ICRlbC5hdHRyKCdocmVmJykKKyAgICAgICAgICAgICAgLCAkaHJlZiA9IC9eI1x3Ly50ZXN0KGhyZWYpICYmICQoaHJlZikKKyAgICAgICAgICAgIHJldHVybiAoICRocmVmCisgICAgICAgICAgICAgICYmICRocmVmLmxlbmd0aAorICAgICAgICAgICAgICAmJiBbWyAkaHJlZi5wb3NpdGlvbigpLnRvcCArICghJC5pc1dpbmRvdyhzZWxmLiRzY3JvbGxFbGVtZW50LmdldCgwKSkgJiYgc2VsZi4kc2Nyb2xsRWxlbWVudC5zY3JvbGxUb3AoKSksIGhyZWYgXV0gKSB8fCBudWxsCisgICAgICAgICAgfSkKKyAgICAgICAgICAuc29ydChmdW5jdGlvbiAoYSwgYikgeyByZXR1cm4gYVswXSAtIGJbMF0gfSkKKyAgICAgICAgICAuZWFjaChmdW5jdGlvbiAoKSB7CisgICAgICAgICAgICBzZWxmLm9mZnNldHMucHVzaCh0aGlzWzBdKQorICAgICAgICAgICAgc2VsZi50YXJnZXRzLnB1c2godGhpc1sxXSkKKyAgICAgICAgICB9KQorICAgICAgfQorCisgICAgLCBwcm9jZXNzOiBmdW5jdGlvbiAoKSB7CisgICAgICAgIHZhciBzY3JvbGxUb3AgPSB0aGlzLiRzY3JvbGxFbGVtZW50LnNjcm9sbFRvcCgpICsgdGhpcy5vcHRpb25zLm9mZnNldAorICAgICAgICAgICwgc2Nyb2xsSGVpZ2h0ID0gdGhpcy4kc2Nyb2xsRWxlbWVudFswXS5zY3JvbGxIZWlnaHQgfHwgdGhpcy4kYm9keVswXS5zY3JvbGxIZWlnaHQKKyAgICAgICAgICAsIG1heFNjcm9sbCA9IHNjcm9sbEhlaWdodCAtIHRoaXMuJHNjcm9sbEVsZW1lbnQuaGVpZ2h0KCkKKyAgICAgICAgICAsIG9mZnNldHMgPSB0aGlzLm9mZnNldHMKKyAgICAgICAgICAsIHRhcmdldHMgPSB0aGlzLnRhcmdldHMKKyAgICAgICAgICAsIGFjdGl2ZVRhcmdldCA9IHRoaXMuYWN0aXZlVGFyZ2V0CisgICAgICAgICAgLCBpCisKKyAgICAgICAgaWYgKHNjcm9sbFRvcCA+PSBtYXhTY3JvbGwpIHsKKyAgICAgICAgICByZXR1cm4gYWN0aXZlVGFyZ2V0ICE9IChpID0gdGFyZ2V0cy5sYXN0KClbMF0pCisgICAgICAgICAgICAmJiB0aGlzLmFjdGl2YXRlICggaSApCisgICAgICAgIH0KKworICAgICAgICBmb3IgKGkgPSBvZmZzZXRzLmxlbmd0aDsgaS0tOykgeworICAgICAgICAgIGFjdGl2ZVRhcmdldCAhPSB0YXJnZXRzW2ldCisgICAgICAgICAgICAmJiBzY3JvbGxUb3AgPj0gb2Zmc2V0c1tpXQorICAgICAgICAgICAgJiYgKCFvZmZzZXRzW2kgKyAxXSB8fCBzY3JvbGxUb3AgPD0gb2Zmc2V0c1tpICsgMV0pCisgICAgICAgICAgICAmJiB0aGlzLmFjdGl2YXRlKCB0YXJnZXRzW2ldICkKKyAgICAgICAgfQorICAgICAgfQorCisgICAgLCBhY3RpdmF0ZTogZnVuY3Rpb24gKHRhcmdldCkgeworICAgICAgICB2YXIgYWN0aXZlCisgICAgICAgICAgLCBzZWxlY3RvcgorCisgICAgICAgIHRoaXMuYWN0aXZlVGFyZ2V0ID0gdGFyZ2V0CisKKyAgICAgICAgJCh0aGlzLnNlbGVjdG9yKQorICAgICAgICAgIC5wYXJlbnQoJy5hY3RpdmUnKQorICAgICAgICAgIC5yZW1vdmVDbGFzcygnYWN0aXZlJykKKworICAgICAgICBzZWxlY3RvciA9IHRoaXMuc2VsZWN0b3IKKyAgICAgICAgICArICdbZGF0YS10YXJnZXQ9IicgKyB0YXJnZXQgKyAnIl0sJworICAgICAgICAgICsgdGhpcy5zZWxlY3RvciArICdbaHJlZj0iJyArIHRhcmdldCArICciXScKKworICAgICAgICBhY3RpdmUgPSAkKHNlbGVjdG9yKQorICAgICAgICAgIC5wYXJlbnQoJ2xpJykKKyAgICAgICAgICAuYWRkQ2xhc3MoJ2FjdGl2ZScpCisKKyAgICAgICAgaWYgKGFjdGl2ZS5wYXJlbnQoJy5kcm9wZG93bi1tZW51JykubGVuZ3RoKSAgeworICAgICAgICAgIGFjdGl2ZSA9IGFjdGl2ZS5jbG9zZXN0KCdsaS5kcm9wZG93bicpLmFkZENsYXNzKCdhY3RpdmUnKQorICAgICAgICB9CisKKyAgICAgICAgYWN0aXZlLnRyaWdnZXIoJ2FjdGl2YXRlJykKKyAgICAgIH0KKworICB9CisKKworIC8qIFNDUk9MTFNQWSBQTFVHSU4gREVGSU5JVElPTgorICAqID09PT09PT09PT09PT09PT09PT09PT09PT09PSAqLworCisgIHZhciBvbGQgPSAkLmZuLnNjcm9sbHNweQorCisgICQuZm4uc2Nyb2xsc3B5ID0gZnVuY3Rpb24gKG9wdGlvbikgeworICAgIHJldHVybiB0aGlzLmVhY2goZnVuY3Rpb24gKCkgeworICAgICAgdmFyICR0aGlzID0gJCh0aGlzKQorICAgICAgICAsIGRhdGEgPSAkdGhpcy5kYXRhKCdzY3JvbGxzcHknKQorICAgICAgICAsIG9wdGlvbnMgPSB0eXBlb2Ygb3B0aW9uID09ICdvYmplY3QnICYmIG9wdGlvbgorICAgICAgaWYgKCFkYXRhKSAkdGhpcy5kYXRhKCdzY3JvbGxzcHknLCAoZGF0YSA9IG5ldyBTY3JvbGxTcHkodGhpcywgb3B0aW9ucykpKQorICAgICAgaWYgKHR5cGVvZiBvcHRpb24gPT0gJ3N0cmluZycpIGRhdGFbb3B0aW9uXSgpCisgICAgfSkKKyAgfQorCisgICQuZm4uc2Nyb2xsc3B5LkNvbnN0cnVjdG9yID0gU2Nyb2xsU3B5CisKKyAgJC5mbi5zY3JvbGxzcHkuZGVmYXVsdHMgPSB7CisgICAgb2Zmc2V0OiAxMAorICB9CisKKworIC8qIFNDUk9MTFNQWSBOTyBDT05GTElDVAorICAqID09PT09PT09PT09PT09PT09PT09PSAqLworCisgICQuZm4uc2Nyb2xsc3B5Lm5vQ29uZmxpY3QgPSBmdW5jdGlvbiAoKSB7CisgICAgJC5mbi5zY3JvbGxzcHkgPSBvbGQKKyAgICByZXR1cm4gdGhpcworICB9CisKKworIC8qIFNDUk9MTFNQWSBEQVRBLUFQSQorICAqID09PT09PT09PT09PT09PT09PSAqLworCisgICQod2luZG93KS5vbignbG9hZCcsIGZ1bmN0aW9uICgpIHsKKyAgICAkKCdbZGF0YS1zcHk9InNjcm9sbCJdJykuZWFjaChmdW5jdGlvbiAoKSB7CisgICAgICB2YXIgJHNweSA9ICQodGhpcykKKyAgICAgICRzcHkuc2Nyb2xsc3B5KCRzcHkuZG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VyIHRoZSBMaWNlbnNlLgorICogPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0gKi8KKworCishZnVuY3Rpb24gKCQpIHsKKworICAidXNlIHN0cmljdCI7IC8vIGpzaGludCA7XzsKKworCisgLyogVEFCIENMQVNTIERFRklOSVRJT04KKyAgKiA9PT09PT09PT09PT09PT09PT09PSAqLworCisgIHZhciBUYWIgPSBmdW5jdGlvbiAoZWxlbWVudCkgeworICAgIHRoaXMuZWxlbWVudCA9ICQoZWxlbWVudCkKKyAgfQorCisgIFRhYi5wcm90b3R5cGUgPSB7CisKKyAgICBjb25zdHJ1Y3RvcjogVGFiCisKKyAgLCBzaG93OiBmdW5jdGlvbiAoKSB7CisgICAgICB2YXIgJHRoaXMgPSB0aGlzLmVsZW1lbnQKKyAgICAgICAgLCAkdWwgPSAkdGhpcy5jbG9zZXN0KCd1bDpub3QoLmRyb3Bkb3duLW1lbnUpJykKKyAgICAgICAgLCBzZWxlY3RvciA9ICR0aGlzLmF0dHIoJ2RhdGEtdGFyZ2V0JykKKyAgICAgICAgLCBwcmV2aW91cworICAgICAgICAsICR0YXJnZXQKKyAgICAgICAgLCBlCisKKyAgICAgIGlmICghc2VsZWN0b3IpIHsKKyAgICAgICAgc2VsZWN0b3IgPSAkdGhpcy5hdHRyKCdocmVmJykKKyAgICAgICAgc2VsZWN0b3IgPSBzZWxlY3RvciAmJiBzZWxlY3Rvci5yZXBsYWNlKC8uKig/PSNbXlxzXSokKS8sICcnKSAvL3N0cmlwIGZvciBpZTcKKyAgICAgIH0KKworICAgICAgaWYgKCAkdGhpcy5wYXJlbnQoJ2xpJykuaGFzQ2xhc3MoJ2FjdGl2ZScpICkgcmV0dXJuCisKKyAgICAgIHByZXZpb3VzID0gJHVsLmZpbmQoJy5hY3RpdmU6bGFzdCBhJylbMF0KKworICAgICAgZSA9ICQuRXZlbnQoJ3Nob3cnLCB7CisgICAgICAgIHJlbGF0ZWRUYXJnZXQ6IHByZXZpb3VzCisgICAgICB9KQorCisgICAgICAkdGhpcy50cmlnZ2VyKGUpCisKKyAgICAgIGlmIChlLmlzRGVmYXVsdFByZXZlbnRlZCgpKSByZXR1cm4KKworICAgICAgJHRhcmdldCA9ICQoc2VsZWN0b3IpCisKKyAgICAgIHRoaXMuYWN0aXZhdGUoJHRoaXMucGFyZW50KCdsaScpLCAkdWwpCisgICAgICB0aGlzLmFjdGl2YXRlKCR0YXJnZXQsICR0YXJnZXQucGFyZW50KCksIGZ1bmN0aW9uICgpIHsKKyAgICAgICAgJHRoaXMudHJpZ2dlcih7CisgICAgICAgICAgdHlwZTogJ3Nob3duJworICAgICAgICAsIHJlbGF0ZWRUYXJnZXQ6IHByZXZpb3VzCisgICAgICAgIH0pCisgICAgICB9KQorICAgIH0KKworICAsIGFjdGl2YXRlOiBmdW5jdGlvbiAoIGVsZW1lbnQsIGNvbnRhaW5lciwgY2FsbGJhY2spIHsKKyAgICAgIHZhciAkYWN0aXZlID0gY29udGFpbmVyLmZpbmQoJz4gLmFjdGl2ZScpCisgICAgICAgICwgdHJhbnNpdGlvbiA9IGNhbGxiYWNrCisgICAgICAgICAgICAmJiAkLnN1cHBvcnQudHJhbnNpdGlvbgorICAgICAgICAgICAgJiYgJGFjdGl2ZS5oYXNDbGFzcygnZmFkZScpCisKKyAgICAgIGZ1bmN0aW9uIG5leHQoKSB7CisgICAgICAgICRhY3RpdmUKKyAgICAgICAgICAucmVtb3ZlQ2xhc3MoJ2FjdGl2ZScpCisgICAgICAgICAgLmZpbmQoJz4gLmRyb3Bkb3duLW1lbnUgPiAuYWN0aXZlJykKKyAgICAgICAgICAucmVtb3ZlQ2xhc3MoJ2FjdGl2ZScpCisKKyAgICAgICAgZWxlbWVudC5hZGRDbGFzcygnYWN0aXZlJykKKworICAgICAgICBpZiAodHJhbnNpdGlvbikgeworICAgICAgICAgIGVsZW1lbnRbMF0ub2Zmc2V0V2lkdGggLy8gcmVmbG93IGZvciB0cmFuc2l0aW9uCisgICAgICAgICAgZWxlbWVudC5hZGRDbGFzcygnaW4nKQorICAgICAgICB9IGVsc2UgeworICAgICAgICAgIGVsZW1lbnQucmVtb3ZlQ2xhc3MoJ2ZhZGUnKQorICAgICAgICB9CisKKyAgICAgICAgaWYgKCBlbGVtZW50LnBhcmVudCgnLmRyb3Bkb3duLW1lbnUnKSApIHsKKyAgICAgICAgICBlbGVtZW50LmNsb3Nlc3QoJ2xpLmRyb3Bkb3duJykuYWRkQ2xhc3MoJ2FjdGl2ZScpCisgICAgICAgIH0KKworICAgICAgICBjYWxsYmFjayAmJiBjYWxsYmFjaygpCisgICAgICB9CisKKyAgICAgIHRyYW5zaXRpb24gPworICAgICAgICAkYWN0aXZlLm9uZSgkLnN1cHBvcnQudHJhbnNpdGlvbi5lbmQsIG5leHQpIDoKKyAgICAgICAgbmV4dCgpCisKKyAgICAgICRhY3RpdmUucmVtb3ZlQ2xhc3MoJ2luJykKKyAgICB9CisgIH0KKworCisgLyogVEFCIFBMVUdJTiBERUZJTklUSU9OCisgICogPT09PT09PT09PT09PT09PT09PT09ICovCisKKyAgdmFyIG9sZCA9ICQuZm4udGFiCisKKyAgJC5mbi50YWIgPSBmdW5jdGlvbiAoIG9wdGlvbiApIHsKKyAgICByZXR1cm4gdGhpcy5lYWNoKGZ1bmN0aW9uICgpIHsKKyAgICAgIHZhciAkdGhpcyA9ICQodGhpcykKKyAgICAgICAgLCBkYXRhID0gJHRoaXMuZGF0YSgndGFiJykKKyAgICAgIGlmICghZGF0YSkgJHRoaXMuZGF0YSgndGFiJywgKGRhdGEgPSBuZXcgVGFiKHRoaXMpKSkKKyAgICAgIGlmICh0eXBlb2Ygb3B0aW9uID09ICdzdHJpbmcnKSBkYXRhW29wdGlvbl0oKQorICAgIH0pCisgIH0KKworICAkLmZuLnRhYi5Db25zdHJ1Y3RvciA9IFRhYgorCisKKyAvKiBUQUIgTk8gQ09ORkxJQ1QKKyAgKiA9PT09PT09PT09PT09PT0gKi8KKworICAkLmZ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ZXIgPSB0aGlzLm9wdGlvbnMudXBkYXRlciB8fCB0aGlzLnVwZGF0ZXIKKyAgICB0aGlzLnNvdXJjZSA9IHRoaXMub3B0aW9ucy5zb3VyY2UKKyAgICB0aGlzLiRtZW51ID0gJCh0aGlzLm9wdGlvbnMubWVudSkKKyAgICB0aGlzLnNob3duID0gZmFsc2UKKyAgICB0aGlzLmxpc3RlbigpCisgIH0KKworICBUeXBlYWhlYWQucHJvdG90eXBlID0geworCisgICAgY29uc3RydWN0b3I6IFR5cGVhaGVhZAorCisgICwgc2VsZWN0OiBmdW5jdGlvbiAoKSB7CisgICAgICB2YXIgdmFsID0gdGhpcy4kbWVudS5maW5kKCcuYWN0aXZlJykuYXR0cignZGF0YS12YWx1ZScpCisgICAgICB0aGlzLiRlbGVtZW50CisgICAgICAgIC52YWwodGhpcy51cGRhdGVyKHZhbCkpCisgICAgICAgIC5jaGFuZ2UoKQorICAgICAgcmV0dXJuIHRoaXMuaGlkZSgpCisgICAgfQorCisgICwgdXBkYXRlcjogZnVuY3Rpb24gKGl0ZW0pIHsKKyAgICAgIHJldHVybiBpdGVtCisgICAgfQorCisgICwgc2hvdzogZnVuY3Rpb24gKCkgeworICAgICAgdmFyIHBvcyA9ICQuZXh0ZW5kKHt9LCB0aGlzLiRlbGVtZW50LnBvc2l0aW9uKCksIHsKKyAgICAgICAgaGVpZ2h0OiB0aGlzLiRlbGVtZW50WzBdLm9mZnNldEhlaWdodAorICAgICAgfSkKKworICAgICAgdGhpcy4kbWVudQorICAgICAgICAuaW5zZXJ0QWZ0ZXIodGhpcy4kZWxlbWVudCkKKyAgICAgICAgLmNzcyh7CisgICAgICAgICAgdG9wOiBwb3MudG9wICsgcG9zLmhlaWdodAorICAgICAgICAsIGxlZnQ6IHBvcy5sZWZ0CisgICAgICAgIH0pCisgICAgICAgIC5zaG93KCkKKworICAgICAgdGhpcy5zaG93biA9IHRydWUKKyAgICAgIHJldHVybiB0aGlzCisgICAgfQorCisgICwgaGlkZTogZn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B9CisKKyAgICAgIHByZXYuYWRkQ2xhc3MoJ2FjdGl2ZScpCisgICAgfQorCisgICwgbGlzdGVuOiBmdW5jdGlvbiAoKSB7CisgICAgICB0aGlzLiRlbGVtZW50CisgICAgICAgIC5vbignZm9jdXMnLCAgICAkLnByb3h5KHRoaXMuZm9jdXMsIHRoaXMpKQorICAgICAgICAub24oJ2JsdXInLCAgICAgJC5wcm94eSh0aGlzLmJsdXIsIHRoaXMpKQorICAgICAgICAub24oJ2tleXByZXNzJywgJC5wcm94eSh0aGlzLmtleXByZXNzLCB0aGlzKSkKKyAgICAgICAgLm9uKCdrZXl1cCcsICAgICQucHJveHkodGhpcy5rZXl1cCwgdGhpcykpCisKKyAgICAgIGlmICh0aGlzLmV2ZW50U3VwcG9ydGVkKCdrZXlkb3duJykpIHsKKyAgICAgICAgdGhpcy4kZWxlbWVudC5vbigna2V5ZG93bicsICQucHJveHkodGhpcy5rZXlkb3duLCB0aGlzKSkKKyAgICAgIH0KKworICAgICAgdGhpcy4kbWVudQorICAgICAgICAub24oJ2NsaWNrJywgJC5wcm94eSh0aGlzLmNsaWNrLCB0aGlzKSkKKyAgICAgICAgLm9uKCdtb3VzZWVudGVyJywgJ2xpJywgJC5wcm94eSh0aGlzLm1vdXNlZW50ZXIsIHRoaXMpKQorICAgICAgICAub24oJ21vdXNlbGVhdmUnLCAnbGknLCAkLnByb3h5KHRoaXMubW91c2VsZWF2ZSwgdGhpcykpCisgICAgfQorCisgICwgZXZlbnRTdXBwb3J0ZWQ6IGZ1bmN0aW9uKGV2ZW50TmFtZSkgeworICAgICAgdmFyIGlzU3VwcG9ydGVkID0gZXZlbnROYW1lIGluIHRoaXMuJGVsZW1lbnQKKyAgICAgIGlmICghaXNTdXBwb3J0ZWQpIHsKKyAgICAgICAgdGhpcy4kZWxlbWVudC5zZXRBdHRyaWJ1dGUoZXZlbnROYW1lLCAncmV0dXJuOycpCisgICAgICAgIGlzU3VwcG9ydGVkID0gdHlwZW9mIHRoaXMuJGVsZW1lbnRbZXZlbnROYW1lXSA9PT0gJ2Z1bmN0aW9uJworICAgICAgfQorICAgICAgcmV0dXJuIGlzU3VwcG9ydGVkCisgICAgfQorCisgICwgbW92ZTogZnVuY3Rpb24gKGUpIHsKKyAgICAgIGlmICghdGhpcy5zaG93bikgcmV0dXJuCisKKyAgICAgIHN3aXRjaChlLmtleUNvZGUpIHsKKyAgICAgICAgY2FzZSA5OiAvLyB0YWIKKyAgICAgICAgY2FzZSAxMzogLy8gZW50ZXIKKyAgICAgICAgY2FzZSAyNzogLy8gZXNjYXBlCisgICAgICAgICAgZS5wcmV2ZW50RGVmYXVsdCgpCisgICAgICAgICAgYnJlYWsKKworICAgICAgICBjYXNlIDM4OiAvLyB1cCBhcnJvdworICAgICAgICAgIGUucHJldmVudERlZmF1bHQoKQorICAgICAgICAgIHRoaXMucHJldigpCisgICAgICAgICAgYnJlYWsKKworICAgICAgICBjYXNlIDQwOiAvLyBkb3duIGFycm93CisgICAgICAgICAgZS5wcmV2ZW50RGVmYXVsdCgpCisgICAgICAgICAgdGhpcy5uZXh0KCkKKyAgICAgICAgICBicmVhaworICAgICAgfQorCisgICAgICBlLnN0b3BQcm9wYWdhdGlvbigpCisgICAgfQorCisgICwga2V5ZG93bjogZnVuY3Rpb24gKGUpIHsKKyAgICAgIHRoaXMuc3VwcHJlc3NLZXlQcmVzc1JlcGVhdCA9IH4kLmluQXJyYXkoZS5rZXlDb2RlLCBbNDAsMzgsOSwxMywyN10pCisgICAgICB0aGlzLm1vdmUoZSkKKyAgICB9CisKKyAgLCBrZXlwcmVzczogZnVuY3Rpb24gKGUpIHsKKyAgICAgIGlmICh0aGlzLnN1cHByZXNzS2V5UHJlc3NSZXBlYXQpIHJldHVybgorICAgICAgdGhpcy5tb3ZlKGUpCisgICAgfQorCisgICwga2V5dXA6IGZ1bmN0aW9uIChlKSB7CisgICAgICBzd2l0Y2goZS5rZXlDb2RlKSB7CisgICAgICAgIGNhc2UgNDA6IC8vIGRvd24gYXJyb3cKKyAgICAgICAgY2FzZSAzODogLy8gdXAgYXJyb3cKKyAgICAgICAgY2FzZSAxNjogLy8gc2hpZnQKKyAgICAgICAgY2FzZSAxNzogLy8gY3RybAorICAgICAgICBjYXNlIDE4OiAvLyBhbHQKKyAgICAgICAgICBicmVhaworCisgICAgICAgIGNhc2UgOTogLy8gdGFiCisgICAgICAgIGNhc2UgMTM6IC8vIGVudGVyCisgICAgICAgICAgaWYgKCF0aGlzLnNob3duKSByZXR1cm4KKyAgICAgICAgICB0aGlzLnNlbGVjdCgpCisgICAgICAgICAgYnJlYWsKKworICAgICAgICBjYXNlIDI3OiAvLyBlc2NhcGUKKyAgICAgICAgICBpZiAoIXRoaXMuc2hvd24pIHJldHVybgorICAgICAgICAgIHRoaXMuaGlkZSgpCisgICAgICAgICAgYnJlYWsKKworICAgICAgICBkZWZhdWx0OgorICAgICAgICAgIHRoaXMubG9va3VwKCkKKyAgICAgIH0KKworICAgICAgZS5zdG9wUHJvcGFnYXRpb24oKQorICAgICAgZS5wcmV2ZW50RGVmYXVsdCgpCisgIH0KKworICAsIGZvY3VzOiBmdW5jdGlvbiAoZSkgeworICAgICAgdGhpcy5mb2N1c2VkID0gdHJ1ZQorICAgIH0KKworICAsIGJsdXI6IGZ1bmN0aW9uIChlKSB7CisgICAgICB0aGlzLmZvY3VzZWQgPSBmYWxzZQorICAgICAgaWYgKCF0aGlzLm1vdXNlZG92ZXIgJiYgdGhpcy5zaG93bikgdGhpcy5oaWRlKCkKKyAgICB9CisKKyAgLCBjbGljazogZnVuY3Rpb24gKGUpIHsKKyAgICAgIGUuc3RvcFByb3BhZ2F0aW9uKCkKKyAgICAgIGUucHJldmVudERlZmF1bHQoKQorICAgICAgdGhpcy5zZWxlY3QoKQorICAgICAgdGhpcy4kZWxlbWVudC5mb2N1cygpCisgICAgfQorCisgICwgbW91c2VlbnRlcjogZnVuY3Rpb24gKGUpIHsKKyAgICAgIHRoaXMubW91c2Vkb3ZlciA9IHRydWUKKyAgICAgIHRoaXMuJG1lbnUuZmluZCgnLmFjdGl2ZScpLnJlbW92ZUNsYXNzKCdhY3RpdmUnKQorICAgICAgJChlLmN1cnJlbnRUYXJnZXQpLmFkZENsYXNzKCdhY3RpdmUnKQorICAgIH0KKworICAsIG1vdXNlbGVhdmU6IGZ1bmN0aW9uIChlKSB7CisgICAgICB0aGlzLm1vdXNlZG92ZXIgPSBmYWxzZQorICAgICAgaWYgKCF0aGlzLmZvY3VzZWQgJiYgdGhpcy5zaG93bikgdGhpcy5oaWRlKCkKKyAgICB9CisKKyAgfQorCisKKyAgLyogVFlQRUFIRUFEIFBMVUdJTiBERUZJTklUSU9OCisgICAqID09PT09PT09PT09PT09PT09PT09PT09PT09PSAqLworCisgIHZhciBvbGQgPSAkLmZuLnR5cGVhaGVhZAorCisgICQuZm4udHlwZWFoZWFkID0gZnVuY3Rpb24gKG9wdGlvbikgeworICAgIHJldHVybiB0aGlzLmVhY2goZnVuY3Rpb24gKCkgeworICAgICAgdmFyICR0aGlzID0gJCh0aGlzKQorICAgICAgICAsIGRhdGEgPSAkdGhpcy5kYXRhKCd0eXBlYWhlYWQnKQorICAgICAgICAsIG9wdGlvbnMgPSB0eXBlb2Ygb3B0aW9uID09ICdvYmplY3QnICYmIG9wdGlvbgorICAgICAgaWYgKCFkYXRhKSAkdGhpcy5kYXRhKCd0eXBlYWhlYWQnLCAoZGF0YSA9IG5ldyBUeXBlYWhlYWQodGhpcywgb3B0aW9ucykpKQorICAgICAgaWYgKHR5cGVvZiBvcHRpb24gPT0gJ3N0cmluZycpIGRhdGFbb3B0aW9uXSgpCisgICAgfSkKKyAgfQorCisgICQuZm4udHlwZWFoZWFkLmRlZmF1bHRzID0geworICAgIHNvdXJjZTogW10KKyAgLCBpdGVtczogOAorICAsIG1lbnU6ICc8dWwgY2xhc3M9InR5cGVhaGVhZCBkcm9wZG93bi1tZW51Ij48L3VsPicKKyAgLCBpdGVtOiAnPGxpPjxhIGhyZWY9IiMiPjwvYT48L2xpPicKKyAgLCBtaW5MZW5ndGg6IDEKKyAgfQorCisgICQuZm4udHlwZWFoZWFkLkNvbnN0cnVjdG9yID0gVHlwZWFoZWFkCisKKworIC8qIFRZUEVBSEVBRCBOTyBDT05GTElDVAorICAqID09PT09PT09PT09PT09PT09PT0gKi8KKworICAkLmZuLnR5cGVhaGVhZC5ub0NvbmZsaWN0ID0gZnVuY3Rpb24gKCkgeworICAgICQuZm4udHlwZWFoZWFkID0gb2xkCisgICAgcmV0dXJuIHRoaXMKKyAgfQorCisKKyAvKiBUWVBFQUhFQUQgREFUQS1BUEkKKyAgKiA9PT09PT09PT09PT09PT09PT0gKi8KKworICAkKGRvY3VtZW50KS5vbignZm9jdXMudHlwZWFoZWFkLmRhdGEtYXBpJywgJ1tkYXRhLXByb3ZpZGU9InR5cGVhaGVhZCJdJywgZnVuY3Rpb24gKGUpIHsKKyAgICB2YXIgJHRoaXMgPSAkKHRoaXMpCisgICAgaWYgKCR0aGlzLmRhdGEoJ3R5cGVhaGVhZCcpKSByZXR1cm4KKyAgICAkdGhpcy50eXBlYWhlYWQoJHRoaXMuZGF0YSgpKQorICB9KQorCit9KHdpbmRvdy5qUXVlcnkpOworLyogPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQorICogYm9vdHN0cmFwLWFmZml4LmpzIHYyLjMuMgorICogaHR0cDovL2dldGJvb3RzdHJhcC5jb20vMi4zLjIvamF2YXNjcmlwdC5odG1sI2FmZml4CisgKiA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CisgKiBDb3B5cmlnaHQgMjAxMyBUd2l0dGVyLCBJbmMuCisgKgorICogTGljZW5zZWQgdW5kZXIgdGhlIEFwYWNoZSBMaWNlbnNlLCBWZXJzaW9uIDIuMCAodGhlICJMaWNlbnNlIik7CisgKiB5b3UgbWF5IG5vdCB1c2UgdGhpcyBmaWxlIGV4Y2VwdCBpbiBjb21wb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IEFmZml4KHRoaXMsIG9wdGlvbnMpKSkKKyAgICAgIGlmICh0eXBlb2Ygb3B0aW9uID09ICdzdHJpbmcnKSBkYXRhW29wdGlvbl0oKQorICAgIH0pCisgIH0KKworICAkLmZuLmFmZml4LkNvbnN0cnVjdG9yID0gQWZmaXgKKworICAkLmZuLmFmZml4LmRlZmF1bHRzID0geworICAgIG9mZnNldDogMAorICB9CisKKworIC8qIEFGRklYIE5PIENPTkZMSUNUCisgICogPT09PT09PT09PT09PT09PT0gKi8KKworICAkLmZuLmFmZml4Lm5vQ29uZmxpY3QgPSBmdW5jdGlvbiAoKSB7CisgICAgJC5mbi5hZmZpeCA9IG9sZAorICAgIHJldHVybiB0aGlzCisgIH0KKworCisgLyogQUZGSVggREFUQS1BUEkKKyAgKiA9PT09PT09PT09PT09PSAqLworCisgICQod2luZG93KS5vbignbG9hZCcsIGZ1bmN0aW9uICgpIHsKKyAgICAkKCdbZGF0YS1zcHk9ImFmZml4Il0nKS5lYWNoKGZ1bmN0aW9uICgpIHsKKyAgICAgIHZhciAkc3B5ID0gJCh0aGlzKQorICAgICAgICAsIGRhdGEgPSAkc3B5LmRhdGEoKQorCisgICAgICBkYXRhLm9mZnNldCA9IGRhdGEub2Zmc2V0IHx8IHt9CisKKyAgICAgIGRhdGEub2Zmc2V0Qm90dG9tICYmIChkYXRhLm9mZnNldC5ib3R0b20gPSBkYXRhLm9mZnNldEJvdHRvbSkKKyAgICAgIGRhdGEub2Zmc2V0VG9wICYmIChkYXRhLm9mZnNldC50b3AgPSBkYXRhLm9mZnNldFRvcCkKKworICAgICAgJHNweS5hZmZpeChkYXRhKQorICAgIH0pCisgIH0pCisKKworfSh3aW5kb3cualF1ZXJ5KTsKXCBObyBuZXdsaW5lIGF0IGVuZCBvZiBmaWxlCmRpZmYgLS1naXQgYS9lY29tcC1wb3J0YWwtQkUvd2FyL3N0YXRpYy9vaWQtY29ubmVjdC9ib290c3RyYXAyL2pzL2Jvb3RzdHJhcC5taW4uanMgY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VHlwZSAhPT0gMTEgPyBwYXJlbnQgOiBudWxsOworCX0sCisJcGFyZW50czogZnVuY3Rpb24oIGVsZW0gKSB7CisJCXJldHVybiBqUXVlcnkuZGlyKCBlbGVtLCAicGFyZW50Tm9kZSIgKTsKKwl9LAorCXBhcmVudHNVbnRpbDogZnVuY3Rpb24oIGVsZW0sIGksIHVudGlsICkgeworCQlyZXR1cm4galF1ZXJ5LmRpciggZWxlbSwgInBhcmVudE5vZGUiLCB1bnRpbCApOworCX0sCisJbmV4dDogZnVuY3Rpb24oIGVsZW0gKSB7CisJCXJldHVybiBqUXVlcnkubnRoKCBlbGVtLCAyLCAibmV4dFNpYmxpbmciICk7CisJfSwKKwlwcmV2OiBmdW5jdGlvbiggZWxlbSApIHsKKwkJcmV0dXJuIGpRdWVyeS5udGgoIGVsZW0sIDIsICJwcmV2aW91c1NpYmxpbmciICk7CisJfSwKKwluZXh0QWxsOiBmdW5jdGlvbiggZWxlbSApIHsKKwkJcmV0dXJuIGpRdWVyeS5kaXIoIGVsZW0sICJuZXh0U2libGluZyIgKTsKKwl9LAorCXByZXZBbGw6IGZ1bmN0aW9uKCBlbGVtICkgeworCQlyZXR1cm4galF1ZXJ5LmRpciggZWxlbSwgInByZXZpb3VzU2libGluZyIgKTsKKwl9LAorCW5leHRVbnRpbDogZnVuY3Rpb24oIGVsZW0sIGksIHVudGlsICkgeworCQlyZXR1cm4galF1ZXJ5LmRpciggZWxlbSwgIm5leHRTaWJsaW5nIiwgdW50aWwgKTsKKwl9LAorCXByZXZVbnRpbDogZnVuY3Rpb24oIGVsZW0sIGksIHVudGlsICkgeworCQlyZXR1cm4galF1ZXJ5LmRpciggZWxlbSwgInByZXZpb3VzU2libGluZyIsIHVudGlsICk7CisJfSwKKwlzaWJsaW5nczogZnVuY3Rpb24oIGVsZW0gKSB7CisJCXJldHVybiBqUXVlcnkuc2libGluZyggKCBlbGVtLnBhcmVudE5vZGUgfHwge30gKS5maXJzdENoaWxkLCBlbGVtICk7CisJ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GluIHMuY29udmVydGVycyApIHsKKwkJCQlpZiAoIHR5cGVvZiBrZXkgPT09ICJzdHJpbmciICkgeworCQkJCQljb252ZXJ0ZXJzWyBrZXkudG9Mb3dlckNhc2UoKSBdID0gcy5jb252ZXJ0ZXJzWyBrZXkgXTsKKwkJCQl9CisJCQl9CisJCX0KKworCQkvLyBHZXQgdGhlIGRhdGFUeXBlcworCQlwcmV2ID0gY3VycmVudDsKKwkJY3VycmVudCA9IGRhdGFUeXBlc1sgaSBdOworCisJCS8vIElmIGN1cnJlbnQgaXMgYXV0byBkYXRhVHlwZSwgdXBkYXRlIGl0IHRvIHByZXYKKwkJaWYgKCBjdXJyZW50ID09PSAiKiIgKSB7CisJCQljdXJyZW50ID0gcHJldjsKKwkJLy8gSWYgbm8gYXV0byBhbmQgZGF0YVR5cGVzIGFyZSBhY3R1YWxseSBkaWZmZXJlbnQKKwkJfSBlbHNlIGlmICggcHJldiAhPT0gIioiICYmIHByZXYgIT09IGN1cnJlbnQgKSB7CisKKwkJCS8vIEdldCB0aGUgY29udmVydGVyCisJCQljb252ZXJzaW9uID0gcHJldiArICIgIiArIGN1cnJlbnQ7CisJCQljb252ID0gY29udmVydGVyc1sgY29udmVyc2lvbiBdIHx8IGNvbnZlcnRlcnNbICIqICIgKyBjdXJyZW50IF07CisKKwkJCS8vIElmIHRoZXJlIGlzIG5vIGRpcmVjdCBjb252ZXJ0ZXIsIHNlYXJjaCB0cmFuc2l0aXZlbHkKKwkJCWlmICggIWNvbnYgKSB7CisJCQkJY29udjIgPSB1bmRlZmluZWQ7CisJCQkJZm9yICggY29udjEgaW4gY29udmVydGVycyApIHsKKwkJCQkJdG1wID0gY29udjEuc3BsaXQoICIgIiApOworCQkJCQlpZiAoIHRtcFsgMCBdID09PSBwcmV2IHx8IHRtcFsgMCBdID09PSAiKiIgKSB7CisJCQkJCQljb252MiA9IGNvbnZlcnRlcnNbIHRtcFsxXSArICIgIiArIGN1cnJlbnQgXTsKKwkJCQkJCWlmICggY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yKTsKKyAgICAgICAgc2xvcCA9IHYgJiAzOworICAgICAgICBrID0gMTsKKyAgICAgIH0KKyAgICAgIGVsc2UgaWYoayA9PSAxKSB7CisgICAgICAgIHJldCArPSBpbnQyY2hhcigoc2xvcCA8PCAyKSB8ICh2ID4+IDQpKTsKKyAgICAgICAgc2xvcCA9IHYgJiAweGY7CisgICAgICAgIGsgPSAyOworICAgICAgfQorICAgICAgZWxzZSBpZihrID09IDIpIHsKKyAgICAgICAgcmV0ICs9IGludDJjaGFyKHNsb3ApOworICAgICAgICByZXQgKz0gaW50MmNoYXIodiA+PiAyKTsKKyAgICAgICAgc2xvcCA9IHYgJiAzOworICAgICAgICBrID0gMzsKKyAgICAgIH0KKyAgICAgIGVsc2UgeworICAgICAgICByZXQgKz0gaW50MmNoYXIoKHNsb3AgPDwgMikgfCAodiA+PiA0KSk7CisgICAgICAgIHJldCArPSBpbnQyY2hhcih2ICYgMHhmKTsKKyAgICAgICAgayA9IDA7CisgICAgICB9CisgICAgfQorICAgIGlmKGsgPT0gMSkKKyAgICAgIHJldCArPSBpbnQyY2hhcihzbG9wIDw8IDIpOworICAgIHJldHVybiByZXQ7CisgIH0KKworCisKKyAgZnVuY3Rpb24gYmFzZTY0dXJsZW5jb2RlKGFyZykKKyAgeworICAgIHZhciBzID0gd2luZG93LmJ0b2EoYXJnKTsgLy8gU3RhbmRhcmQgYmFzZTY0IGVuY29kZXIKKyAgICBzID0gcy5zcGxpdCgnPScpWzBdOyAvLyBSZW1vdmUgYW55IHRyYWlsaW5nICc9J3MKKyAgICBzID0gcy5yZXBsYWNlKC9cKy9nLCAnLScpOyAvLyA2Mm5kIGNoYXIgb2YgZW5jb2RpbmcKKyAgICBzID0gcy5yZXBsYWNlKC9cLy9nLCAnXycpOyAvLyA2M3JkIGNoYXIgb2YgZW5jb2RpbmcKKyAgICAvLyBUT0RPIG9wdGltaXplIHRoaXM7IHdlIGNhbiBkbyBtdWNoIGJldHRlcgorICAgIHJldHVybiBzOworICB9C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CisgICAgdmFyIHZhbHVlID0gaXRlcmF0b3IuY2FsbChjb250ZXh0LCBvYmopOworICAgIHZhciBsb3cgPSAwLCBoaWdoID0gYXJyYXkubGVuZ3RoOworICAgIHdoaWxlIChsb3cgPCBoaWdoKSB7CisgICAgICB2YXIgbWlkID0gKGxvdyArIGhpZ2gpID4+PiAxOworICAgICAgaXRlcmF0b3IuY2FsbChjb250ZXh0LCBhcnJheVttaWRdKSA8IHZhbHVlID8gbG93ID0gbWlkICsgMSA6IGhpZ2ggPSBtaWQ7CisgICAgfQorICAgIHJldHVybiBsb3c7CisgIH07CisKKyAgLy8gU2FmZWx5IGNvbnZlcnQgYW55dGhpbmcgaXRlcmFibGUgaW50byBhIHJlYWwsIGxpdmUgYXJyYXkuCisgIF8udG9BcnJheSA9IGZ1bmN0aW9uKG9iaikgeworICAgIGlmICghb2JqKSByZXR1cm4gW107CisgICAgaWYgKF8uaXNBcnJheShvYmopKSByZXR1cm4gc2xpY2UuY2FsbChvYmopOworICAgIGlmIChvYmoubGVuZ3RoID09PSArb2JqLmxlbmd0aCkgcmV0dXJuIF8ubWFwKG9iaiwgXy5pZGVudGl0eSk7CisgICAgcmV0dXJuIF8udmFsdWVzKG9iaik7CisgIH07CisKKyAgLy8gUmV0dXJuIHRoZSBudW1iZXIgb2YgZWxlbWVudHMgaW4gYW4gb2JqZWN0LgorICBfLnNpemUgPSBmdW5jdGlvbihvYmopIHsKKyAgICBpZiAob2JqID09IG51bGwpIHJldHVybiAwOworICAgIHJldHVybiAob2JqLmxlbmd0aCA9PT0gK29iai5sZW5ndGgpID8gb2JqLmxlbmd0aCA6IF8ua2V5cyhvYmopLmxlbmd0aDsKKyAgfTsKKworICAvLyBBcnJheSBGdW5jdGlvbnMKKyAgLy8gLS0tLS0tLS0tLS0tLS0tCisKKyAgLy8gR2V0IHRoZSBmaXJzdCBlbGVtZW50IG9mIGFuIGFycmF5LiBQYXNzaW5nICoqbioqIHdpbGwgcmV0dXJuIHRoZSBmaXJzd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lLmNhbGwoYXJndW1lbnRzLCAxKSkpOworICB9OworCisgIC8vIFJldHVybnMgYSBmdW5jdGlvbiwgdGhhdCwgd2hlbiBpbnZva2VkLCB3aWxsIG9ubHkgYmUgdHJpZ2dlcmVkIGF0IG1vc3Qgb25jZQorICAvLyBkdXJpbmcgYSBnaXZlbiB3aW5kb3cgb2YgdGltZS4KKyAgXy50aHJvdHRsZSA9IGZ1bmN0aW9uKGZ1bmMsIHdhaXQpIHsKKyAgICB2YXIgY29udGV4dCwgYXJncywgdGltZW91dCwgcmVzdWx0OworICAgIHZhciBwcmV2aW91cyA9IDA7CisgICAgdmFyIGxhdGVyID0gZnVuY3Rpb24oKSB7CisgICAgICBwcmV2aW91cyA9IG5ldyBEYXRlOworICAgICAgdGltZW91dCA9IG51bGw7CisgICAgICByZXN1bHQgPSBmdW5jLmFwcGx5KGNvbnRleHQsIGFyZ3MpOworICAgIH07CisgICAgcmV0dXJuIGZ1bmN0aW9uKCkgeworICAgICAgdmFyIG5vdyA9IG5ldyBEYXRlOworICAgICAgdmFyIHJlbWFpbmluZyA9IHdhaXQgLSAobm93IC0gcHJldmlvdXMpOworICAgICAgY29udGV4dCA9IHRoaXM7CisgICAgICBhcmdzID0gYXJndW1lbnRzOworICAgICAgaWYgKHJlbWFpbmluZyA8PSAwKSB7CisgICAgICAgIGNsZWFyVGltZW91dCh0aW1lb3V0KTsKKyAgICAgICAgdGltZW91dCA9IG51bGw7CisgICAgICAgIHByZXZpb3VzID0gbm93OworICAgICAgICByZXN1bHQgPSBmdW5jLmFwcGx5KGNvbnRleHQsIGFyZ3MpOworICAgICAgfSBlbHNlIGlmICghdGltZW91dCkgeworICAgICAgICB0aW1lb3V0ID0gc2V0VGltZW91dChsYXRlciwgcmVtYWluaW5nKTsKKyAgICAgIH0KKyAgICAgIHJldHVybiByZXN1bHQ7CisgICAgfTsKKyAgfTsKKworICAvLyBSZXR1cm5zIGEgZnVuY3Rpb24sIHRoYXQsIGFzIGxvbmcgYXMgaX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BbXTsKKyAgICBmb3IgKHZhciBrZXkgaW4gb2JqKSB7CisgICAgICBpZiAoXy5pc0Z1bmN0aW9uKG9ialtrZXldKSkgbmFtZXMucHVzaChrZXkpOworICAgIH0KKyAgICByZXR1cm4gbmFtZXMuc29ydCgpOworICB9OworCisgIC8vIEV4dGVuZCBhIGdpdmVuIG9iamVjdCB3aXRoIGFsbCB0aGUgcHJvcGVydGllcyBpbiBwYXNzZWQtaW4gb2JqZWN0KHMpLgorICBfLmV4dGVuZCA9IGZ1bmN0aW9uKG9iaikgeworICAgIGVhY2goc2xpY2UuY2FsbChhcmd1bWVudHMsIDEpLCBmdW5jdGlvbihzb3VyY2UpIHsKKyAgICAgIGlmIChzb3VyY2UpIHsKKyAgICAgICAgZm9yICh2YXIgcHJvcCBpbiBzb3VyY2UpIHsKKyAgICAgICAgICBvYmpbcHJvcF0gPSBzb3VyY2VbcHJvcF07CisgICAgICAgIH0KKyAgICAgIH0KKyAgICB9KTsKKyAgICByZXR1cm4gb2JqOworICB9OworCisgIC8vIFJldHVybiBhIGNvcHkgb2YgdGhlIG9iamVjdCBvbmx5IGNvbnRhaW5pbmcgdGhlIHdoaXRlbGlzdGVkIHByb3BlcnRpZXMuCisgIF8ucGljayA9IGZ1bmN0aW9uKG9iaikgeworICAgIHZhciBjb3B5ID0ge307CisgICAgdmFyIGtleXMgPSBjb25jYXQuYXBwbHkoQXJyYXlQcm90bywgc2xpY2UuY2FsbChhcmd1bWVudHMsIDEpKTsKKyAgICBlYWNoKGtleXMsIGZ1bmN0aW9uKGtleSkgeworICAgICAgaWYgKGtleSBpbiBvYmopIGNvcHlba2V5XSA9IG9ialtrZXldOworICAgIH0pOworICAgIHJldHVybiBjb3B5OworICB9OworCisgICAvLyBSZXR1cm4gYSBjb3B5IG9mIHRoZSBvYmplY3Qgd2l0aG91dCB0aGUgYmxhY2tsaXN0ZWQgcHJvcGVydGllcy4KKyAgXy5vbWl0ID0gZnVuY3Rpb24ob2JqKSB7CisgICAgdmF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jZW9mIGFDdG9yKSAmJgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIF8uaXNGdW5jdGlvbihiQ3RvcikgJiYgKGJDdG9yIGluc3RhbmNlb2YgYkN0b3IpKSkgeworICAgICAgICByZXR1cm4gZmFsc2U7CisgICAgICB9CisgICAgICAvLyBEZWVwIGNvbXBhcmUgb2JqZWN0cy4KKyAgICAgIGZvciAodmFyIGtleSBpbiBhKSB7CisgICAgICAgIGlmIChfLmhhcyhhLCBrZXkpKSB7CisgICAgICAgICAgLy8gQ291bnQgdGhlIGV4cGVjdGVkIG51bWJlciBvZiBwcm9wZXJ0aWVzLgorICAgICAgICAgIHNpemUrKzsKKyAgICAgICAgICAvLyBEZWVwIGNvbXBhcmUgZWFjaCBtZW1iZXIuCisgICAgICAgICAgaWYgKCEocmVzdWx0ID0gXy5oYXMoYiwga2V5KSAmJiBlcShhW2tleV0sIGJba2V5XSwgYVN0YWNrLCBiU3RhY2spKSkgYnJlYWs7CisgICAgICAgIH0KKyAgICAgIH0KKyAgICAgIC8vIEVuc3VyZSB0aGF0IGJvdGggb2JqZWN0cyBjb250YWluIHRoZSBzYW1lIG51bWJlciBvZiBwcm9wZXJ0aWVzLgorICAgICAgaWYgKHJlc3VsdCkgeworICAgICAgICBmb3IgKGtleSBpbiBiKSB7CisgICAgICAgICAgaWYgKF8uaGFzKGIsIGtleSkgJiYgIShzaXplLS0pKSBicmVhazsKKyAgICAgICAgfQorICAgICAgICByZXN1bHQgPSAhc2l6ZTsKKyAgICAgIH0KKyAgICB9CisgICAgLy8gUmVtb3ZlIHRoZSBmaXJzdCBvYmplY3QgZnJvbSB0aGUgc3RhY2sgb2YgdHJhdmVyc2VkIG9iamVjdHMuCisgICAgYVN0YWNrLnBvcCgpOworICAgIGJTdGFjay5wb3AoKTsKKyAgICByZXR1cm4gcmVzdWx0OworICB9OworCisgIC8vIFBlcmZvcm0gYSBkZWVwIGNvbXBhcmlzb24gdG8gY2hlY2sgaWYgdHdvIG9iamV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XMgZm9yIGVzY2FwaW5nLgorICB2YXIgZW50aXR5TWFwID0geworICAgIGVzY2FwZTogeworICAgICAgJyYnOiAnJmFtcDsnLAorICAgICAgJzwnOiAnJmx0OycsCisgICAgICAnPic6ICcmZ3Q7JywKKyAgICAgICciJzogJyZxdW90OycsCisgICAgICAiJyI6ICcmI3gyNzsnLAorICAgICAgJy8nOiAnJiN4MkY7JworICAgIH0KKyAgfTsKKyAgZW50aXR5TWFwLnVuZXNjYXBlID0gXy5pbnZlcnQoZW50aXR5TWFwLmVzY2FwZSk7CisKKyAgLy8gUmVnZXhlcyBjb250YWluaW5nIHRoZSBrZXlzIGFuZCB2YWx1ZXMgbGlzdGVkIGltbWVkaWF0ZWx5IGFib3ZlLgorICB2YXIgZW50aXR5UmVnZXhlcyA9IHsKKyAgICBlc2NhcGU6ICAgbmV3IFJlZ0V4cCgnWycgKyBfLmtleXMoZW50aXR5TWFwLmVzY2FwZSkuam9pbignJykgKyAnXScsICdnJyksCisgICAgdW5lc2NhcGU6IG5ldyBSZWdFeHAoJygnICsgXy5rZXlzKGVudGl0eU1hcC51bmVzY2FwZSkuam9pbignfCcpICsgJyknLCAnZycpCisgIH07CisKKyAgLy8gRnVuY3Rpb25zIGZvciBlc2NhcGluZyBhbmQgdW5lc2NhcGluZyBzdHJpbmdzIHRvL2Zyb20gSFRNTCBpbnRlcnBvbGF0aW9uLgorICBfLmVhY2goWydlc2NhcGUnLCAndW5lc2NhcGUnXSwgZnVuY3Rpb24obWV0aG9kKSB7CisgICAgX1ttZXRob2RdID0gZnVuY3Rpb24oc3RyaW5nKSB7CisgICAgICBpZiAoc3RyaW5nID09IG51bGwpIHJldHVybiAnJzsKKyAgICAgIHJldHVybiAoJycgKyBzdHJpbmcpLnJlcGxhY2UoZW50aXR5UmVnZXhlc1ttZXRob2RdLCBmdW5jdGlvbihtYXRjaCkgeworICAgICAgICByZXR1cm4gZW50aXR5TWFwW21ldGhvZF1bbWF0Y2hdOworICAgICAgfSk7CisgICA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IGZ1bmN0aW9uKG1hdGNoLCBlc2NhcGUsIGludGVycG9sYXRlLCBldmFsdWF0ZSwgb2Zmc2V0KSB7CisgICAgICBzb3VyY2UgKz0gdGV4dC5zbGljZShpbmRleCwgb2Zmc2V0KQorICAgICAgICAucmVwbGFjZShlc2NhcGVyLCBmdW5jdGlvbihtYXRjaCkgeyByZXR1cm4gJ1xcJyArIGVzY2FwZXNbbWF0Y2hdOyB9KTsKKworICAgICAgaWYgKGVzY2FwZSkgeworICAgICAgICBzb3VyY2UgKz0gIicrXG4oKF9fdD0oIiArIGVzY2FwZSArICIpKT09bnVsbD8nJzpfLmVzY2FwZShfX3QpKStcbiciOworICAgICAgfQorICAgICAgaWYgKGludGVycG9sYXRlKSB7CisgICAgICAgIHNvdXJjZSArPSAiJytcbigoX190PSgiICsgaW50ZXJwb2xhdGUgKyAiKSk9PW51bGw/Jyc6X190KStcbiciOworICAgICAgfQorICAgICAgaWYgKGV2YWx1YXRlKSB7CisgICAgICAgIHNvdXJjZSArPSAiJztcbiIgKyBldmFsdWF0ZSArICJcbl9fcCs9JyI7CisgICAgICB9CisgICAgICBpbmRleCA9IG9mZnNldCArIG1hdGNoLmxlbmd0aDsKKyAgICAgIHJldHVybiBtYXRjaDsKKyAgICB9KTsKKyAgICBzb3VyY2UgKz0gIic7XG4iOworCisgICAgLy8gSWYgYSB2YXJpYWJsZSBpcyBub3Qgc3BlY2lmaWVkLCBwbGFjZSBkYXRhIHZhbHVlcyBpbiBsb2NhbCBzY29wZS4KKyAgICBpZiAoIXNldHRpbmdzLnZhcmlhYmxlKSBzb3VyY2UgPSAnd2l0aChvYmp8fHt9KXtcbicgKyBzb3VyY2UgKyAnfVxuJzsKKworICAgIHNvdXJjZSA9ICJ2YXIgX190LF9fcD0nJyxfX2o9QXJyYXkucHJvdG90eXBlLmpvaW4sIiArCisgICAgICAicHJpbnQ9ZnVuY3Rpb24oKXtfX3ArPV9fai5jYWxsKGFyZ3VtZW50cywnJyk7fTtcbiIgKwor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FtZSkgeworICAgIHZhciBtZXRob2QgPSBBcnJheVByb3RvW25hbWVdOworICAgIF8ucHJvdG90eXBlW25hbWVdID0gZnVuY3Rpb24oKSB7CisgICAgICByZXR1cm4gcmVzdWx0LmNhbGwodGhpcywgbWV0aG9kLmFwcGx5KHRoaXMuX3dyYXBwZWQsIGFyZ3VtZW50cykpOworICAgIH07CisgIH0pOworCisgIF8uZXh0ZW5kKF8ucHJvdG90eXBlLCB7CisKKyAgICAvLyBTdGFydCBjaGFpbmluZyBhIHdyYXBwZWQgVW5kZXJzY29yZSBvYmplY3QuCisgICAgY2hhaW46IGZ1bmN0aW9uKCkgeworICAgICAgdGhpcy5fY2hhaW4gPSB0cnVlOworICAgICAgcmV0dXJuIHRoaXM7CisgICAgfSwKKworICAgIC8vIEV4dHJhY3RzIHRoZSByZXN1bHQgZnJvbSBhIHdyYXBwZWQgYW5kIGNoYWluZWQgb2JqZWN0LgorICAgIHZhbHVlOiBmdW5jdGlvbigpIHsKKyAgICAgIHJldHVybiB0aGlzLl93cmFwcGVkOworICAgIH0KKworICB9KTsKKworfSkuY2FsbCh0aGlzKTsK