xiaomianao666

小程序:道长仓库Pro

Nov 5th, 2024
109
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. 海阔视界规则分享,当前分享的是:小程序¥home_rule_v2¥base64://@道长仓库Pro@eyJmaXJzdEhlYWRlciI6InNvcnQiLCJsYXN0X2NoYXB0ZXJfcnVsZSI6IiIsInRpdGxlIjoi6YGT6ZW/5LuT5bqTUHJvIiwiYXV0aG9yIjoiQExveURnSWsiLCJ1cmwiOiJoaWtlcjovL2VtcHR5IiwidmVyc2lvbiI6MTU3LCJjb2xfdHlwZSI6Imljb25fMl9yb3VuZCIsImNsYXNzX25hbWUiOiIiLCJ0eXBlIjoidG9vbCIsImNsYXNzX3VybCI6IiIsImFyZWFfbmFtZSI6IiIsImFyZWFfdXJsIjoiIiwic29ydF9uYW1lIjoiIiwieWVhcl9uYW1lIjoiIiwic29ydF91cmwiOiIiLCJ5ZWFyX3VybCI6IiIsImZpbmRfcnVsZSI6ImpzOlxuICAgIGNvbnN0IHtcbiAgICAgICAgZ2V0QXBpLFxuICAgICAgICBjb2xvcixcbiAgICAgICAgc21hbGwsXG4gICAgICAgIGdldEZpbGUsXG4gICAgICAgIGh0bWxUYWcsXG4gICAgICAgIGFwaSxcbiAgICAgICAgbWRcbiAgICB9ID0gJC5yZXF1aXJlKFwiaGlrZXI6Ly9wYWdlL3V0aWxpeVwiKTtcblxuY29uc3QgbHNnPSQucmVxdWlyZShcImhpa2VyOi8vcGFnZS9sb2NhbFN0b3JhZ2U/cnVsZT3pgZPplb/ku5PlupNQcm9cIik7XG5sZXQgY2xhc3NBID0gZ2V0VmFyKFwiV2FyZWhvdXNlLmNsYXNzXCIsIFwiMFwiKTtcbmxldCBsaXN0VXJsID0gZ2V0QXBpKFwidXNlcnNVcmxcIikgKyBjbGFzc0EsXG4gICAgbXlVcmwgPSBnZXRBcGkoXCJkZXZTZWxmXCIpO1xuLy8gbXlVcmwgPSBnZXRBcGkoXCJydWxlc0FsbFVybFwiKTtcbnB1dFZhcihcIldhcmVob3VzZS5maWx0ZXJcIiwgXCJcIik7XG52YXIgbm9XYWl0PXRydWU7Ly/ml6DpnIDph43or5VcbnZhciB0aW1lb3V0PTUwMDtcbnZhciB0bXBfaGVhZGVycz17XG4gICAgdGltZW91dDp0aW1lb3V0XG59O1xudHJ5e1xuICAgIHZhciB1c2VyTGlzdCA9IEpTT04ucGFyc2UocmVxdWVzdChsaXN0VXJsLHRtcF9oZWFkZXJzKSkucmVzdWx0LFxuICAgICAgICBub3dDb24gPSAwLFxuICAgICAgICBydWxlQ291bnQgPSBKU09OLnBhcnNlKHJlcXVlc3QoZ2V0QXBpKFwicnVsZUNvdW50VXJsXCIpLHRtcF9oZWFkZXJzKSkucmVzdWx0O1xufWNhdGNoKGUpe1xuICAgIG5vV2FpdD1mYWxzZTtcbiAgICBzZXRSZXN1bHQoW3tcbiAgICAgICAgdGl0bGU6J+S7k+W6k+WQjOaXtuiuv+mXrumHj+i/h+Wkp+aIlue9kee7nOW3ru+8jOe5geW/meS4rS4uLlxcbuivt+iAkOW/g+etieW+heeojeWQjuWGjeivlScsXG4gICAgICAgIGRlc2M6J+eCueWHu+WwneivlemHjeaWsOiuv+mXricsXG4gICAgICAgIGNvbF90eXBlOid0ZXh0XzEnLFxuICAgICAgICB1cmw6JCgnI25vTG9hZGluZyMnKS5sYXp5UnVsZSgoKT0+e1xuICAgICAgICAgICAgcmVmcmVzaFBhZ2UoZmFsc2UpO1xuICAgICAgICAgICAgcmV0dXJuICd0b2FzdDovL+W3suWIt+aWsCdcbiAgICAgICAgfSlcbiAgICB9XSk7XG59XG5pZihub1dhaXQpe1xuICAgIGxldCBkYXRhID0gW107XG4gICAgbGV0IGNsYXNzVGFiID0gW1xuICAgICAgICBbXCLkuIrmrKHmtLvot4NcIiwgXCIwXCJdLFxuICAgICAgICBbXCLop4TliJnmlbBcIiwgXCIxXCJdLFxuICAgICAgICBbXCLms6jlhozml7bpl7RcIiwgXCItMVwiXVxuICAgIF1cbiAgICBmb3IgKGxldCBpdGVtIG9mIGNsYXNzVGFiKSB7XG4gICAgICAgIGRhdGEucHVzaCh7XG4gICAgICAgICAgICB0aXRsZTogaXRlbVsxXSA9PT0gY2xhc3NBID8gXCLigJzigJxcIiArIGl0ZW1bMF0gKyBcIuKAneKAnVwiIDogaXRlbVswXSxcbiAgICAgICAgICAgIHVybDogJChcIiNub0xvYWRpbmcjXCIpLmxhenlSdWxlKChrZXkpID0+IHtcbiAgICAgICAgICAgICAgICBwdXRWYXIoXCJXYXJlaG91c2UuY2xhc3NcIiwga2V5KTtcbiAgICAgICAgICAgICAgICByZWZyZXNoUGFnZShmYWxzZSk7XG4gICAgICAgICAgICAgICAgcmV0dXJuIFwiaGlrZXI6Ly9lbXB0eVwiO1xuICAgICAgICAgICAgfSwgaXRlbVsxXSksXG4gICAgICAgICAgICBjb2xfdHlwZTogXCJzY3JvbGxfYnV0dG9uXCJcbiAgICAgICAgfSk7XG4gICAgfVxuICAgIGRhdGEucHVzaCh7XG4gICAgICAgIHRpdGxlOiBcIuWFqOmDqOinhOWImVwiLFxuICAgICAgICB1cmw6IFwiaGlrZXI6Ly9wYWdlL0FsbFB1YmxpY1J1bGU/dXJsPWhpa2VyOi8vZW1wdHkjZnlwYWdlI25vSGlzdG9yeSMjbm9SZWNvcmRIaXN0b3J5I1wiLFxuICAgICAgICBjb2xfdHlwZTogXCJzY3JvbGxfYnV0dG9uXCJcbiAgICB9KTtcbiAgICBkYXRhLnB1c2goe1xuICAgICAgICB0aXRsZTogXCLliLfmlrDkvp3otZZcIixcbiAgICAgICAgdXJsOiAkKCcjbm9Mb2FkaW5nIycpLmxhenlSdWxlKChqc29uVXJsKT0+e1xuICAgICAgICAgICAganNvblVybCA9IGpzb25VcmwrJzI1MDUnO1xuICAgICAgICAgICAgLy8gbG9nKGpzb25VcmwpO1xuICAgICAgICAgICAgbGV0IHRleHQgPSByZXF1ZXN0KGpzb25VcmwpO1xuICAgICAgICAgICAgaWYoIS92ZXJzaW9uLy50Z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5o6S5bqP5qih5byP5Li6OlwiK25leHQ7XG4gICAgICAgIH0sY29sb3IpLFxuICAgICAgICBleHRyYTp7XG4gICAgICAgICAgICBpZDonc29ydCdcbiAgICAgICAgfVxuICAgIH0pO1xuICAgIGRhdGEucHVzaCh7XG4gICAgICAgIHRpdGxlOmNvbG9yKFwi5LuT5bqT5YWs5ZGKXCIsXCIjZmY3MDAwXCIpLFxuICAgICAgICBjb2xfdHlwZTpcInNjcm9sbF9idXR0b25cIixcbiAgICAgICAgdXJsOiQoJ2hpa2VyOi8vZW1wdHkjbm9IaXN0b3J5IyNub1JlY29yZEhpc3RvcnkjJykucnVsZSgobWQpPT57XG4gICAgICAgICAgICByZXF1aXJlKG1kKTtcbiAgICAgICAgICAgIGxldCBkID0gW107XG4gICAgICAgICAgICBsZXQg5LuT5bqT5YWs5ZGKPVwi5pqC5peg5YWs5ZGKXCI7XG4gICAgICAgICAgICB0cnl7XG4gICAgICAgICAgICAgICAg5LuT5bqT5YWs5ZGKPWZldGNoKCdodHRwczovL2dpdGNvZGUubmV0L3FxXzMyMzk0MzUxL2RyLy0vcmF3L21hc3Rlci9qcy/ku5PlupPlhazlkYoubWQnKTtcbiAgICAgICAgICAgIH1jYXRjaChlKXt9XG4gICAgICAgICAgICBpZijku5PlupPlhazlkYopIHtcbiAgICAgICAgICAgICAgICBkLnB1c2goe1xuICAgICAgICAgICAgICAgICAgICB0aXRsZTogbWFya2VkLnBhcnNlKOS7k+W6k+WFrOWRiiksXG4gICAgICAgICAgICAgICAgICAgIGNvbF90eXBlOiAncmljaF90ZXh0JyxcbiAgICAgICAgICAgICAgICAgICAgdXJsOiAnaGlrZXI6Ly9lbXB0eSdcbiAgICAgICAgICAgICAgICB9KTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIHNldFJlc3VsdChkKTtcbiAgICAgICAgfSxtZClcbiAgICB9KTtcblxuICAgIGRhdGEucHVzaCh7XG4gICAgICAgIHRpdGxlOmNvbG9yKFwi5Y2H57qn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iqz6ZiB6KeE5YiZ44CCXCIpLFxuICAgICAgICAgICAgdXJsOiBcImhpa2VyOi8vcGFnZS9kZXZMb2dpblwiXG4gICAgICAgIH0pO1xuICAgIH1cbiAgICBpZiAoQXJyYXkuaXNBcnJheSh1c2VyKSAmJiB1c2VyLmxlbmd0aCA9PT0gMikge1xuICAgICAgICBsZXQgdXNlcmxvZ2luID0gcmVxdWVzdChhcGkuZGlzX2xvZ2luLCB7XG4gICAgICAgICAgICBoZWFkZXJzOiB7XG4gICAgICAgICAgICAgICAgJ2NvbnRlbnQtdHlwZSc6ICdhcHBsaWNhdGlvbi9qc29uJ1xuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIGJvZHk6IEpTT04uc3RyaW5naWZ5KHtcbiAgICAgICAgICAgICAgICBcInBhcmFtc1wiOiB7XG4gICAgICAgICAgICAgICAgICAgIFwicXFcIjogdXNlclswXSxcbiAgICAgICAgICAgICAgICAgICAgXCJhdXRoX2NvZGVcIjogdXNlclsxXVxuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH0pLFxuICAgICAgICAgICAgbWV0aG9kOiAnUE9TVCcsXG4gICAgICAgICAgICB0aW1lb3V0OnRpbWVvdXRcbiAgICAgICAgfSk7XG4gICAgICAgIHVzZXJsb2dpbiA9IEpTT04ucGFyc2UodXNlcmxvZ2luKS5yZXN1bHQ7XG4gICAgICAgIGlmICh1c2VybG9naW4uc3RhdHVzID09PSAwKSB7XG4gICAgICAgICAgICB1c2VybG9naW4gPSB1c2VybG9naW4ucmVzdWx0XG4gICAgICAgICAgICBkYXRhLnB1c2goe1xuICAgICAgICAgICAgICAgIHRpdGxlOiB1c2VybG9naW4ubmFtZSArIFwiJm5ic3A7Jm5ic3A7XCIgKyB1c2VybG9naW4ucXEgKyBcIiZuYnNwOyZuYnNwOyZuYnNwOyZuYnNwOzxzbWFsbD48dT7mm7TmjaLotKblj7cgPjwvdT48L3NtYWxsPlwiLFxuICAgICAgICAgICAgICAgIGNvbF90eXBlOiAnYXZhdGFyJyxcbiAgICAgICAgICAgICAgICBwaWNfdXJsOiB1c2VybG9naW4uYXZhdGFyX3VybCxcbiAgICAgICAgICAgICAgICB1cmw6IFwiaGlrZXI6Ly9wYWdlL1VzZXJyZWdpc3RyYXRpb25cIlxuICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICBkYXRhLnNwbGljZSgzLDAse1xuICAgICAgICAgICAgICAgIHRpdGxlOiB1c2VybG9naW4uaGFzX3JlcGx5P1wi8J+GleWbnuWkjVwiOlwi8J+UlOWbnuWkjVwiLFxuICAgICAgICAgICAgICAgIHVybDogXCJoaWtlcjovL3BhZ2UvTXlSZXBseT91cmw9aGlrZXI6Ly9lbXB0eSNmeXBhZ2Ujbm9IaXN0b3J5IyNub1JlY29yZEhpc3RvcnkjXCIsXG4gICAgICAgICAgICAgICAgY29sX3R5cGU6IFwic2Nyb2xsX2J1dHRvblwiLFxuICAgICAgICAgICAgICAgIGV4dHJhOntcbiAgICAgICAgICAgICAgICAgICAgYXV0aF9jb2RlOnVzZXJbMV0sXG4gICAgICAgICAgICAgICAgICAgIHFxOnVzZXJbMF1cbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9KTtcbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgIGRhdGEucHVzaCh7XG4gICAgICAgICAgICAgICAgdGl0bGU6IHVzZXJsb2dpbi5kZXRhaWwsXG4gICAgICAgICAgICAgICAgY29sX3R5cGU6ICd0ZXh0X2NlbnRlcl8xJyxcbiAgICAgICAgICAgICAgICBkZXNjOiBcIuKAnOKAnOKAneKAnTxzbWFsbD48dT7ph43mlrDojrflj5bpqozor4HnoIEgPjwvdT48L3NtYWxsPlwiLFxuICAgICAgICAgICAgICAgIHVybDogXCJoaWtlcjovL3BhZ2UvVXNlcnJlZ2lzdHJhdGlvblwiXG4gICAgICAgICAgICB9KTtcbiAgICAgICAgfVxuICAgIH0gZWxzZSB7XG4gICAgICAgIGRhdGEucHVzaCh7XG4gICAgICAgICAgICB0aXRsZTogXCLor4TorrrnmbvlvZUv5rOo5YaMXCIsXG4gICAgICAgICAgICBjb2xfdHlwZTogJ3RleHRfY2VudGVyXzEnLFxuICAgICAgICAgICAgZGVzYzogXCJcIixcbiAgICAgICAgICAgIHVybDogXCJoaWtlcjovL3BhZ2UvVXNlcnJlZ2lzdHJhdGlvblwiXG4gICAgICAgIH0pO1xuICAgIH1cbiAgICBmb3IgKHZhciBpdGVtIG9mIHVzZXJMaXN0KSB7XG4gICAgICAgIGRhdGEucHVzaCh7XG4gICAgICAgICAgICB0aXRsZTogaXRlbS5uYW1lICsgXCIoXCIgKyBpdGVtLnJ1bGVfbnVtICsgXCIpXCIsXG4gICAgICAgICAgICBkZXNjOiBpdGVtLmlkICsgJzonICsgaXRlbS5uaWNrX25hbWUsXG4gICAgICAgICAgICBwaWNfdXJsOiBpdGVtLmF2YXRhcixcbiAgICAgICAgICAgIHVybDogXCJoaWtlcjovL3BhZ2UvcnVsZXMjbm9IaXN0b3J5I1wiLFxuICAgICAgICAgICAgZXh0cmE6IHtcbiAgICAgICAgICAgICAgICBhdmF0YXJVcmw6IGl0ZW0uYXZhdGFyLFxuICAgICAgICAgICAgICAgIHFxOiBpdGVtLnFxLFxuICAgICAgICAgICAgICAgIGlkOml0ZW0uaWQsXG4gICAgICAgICAgICAgICAgY2FuX3VwbG9hZDppdGVtLmNhbl91cGxvYWRcbiAgICAgICAgICAgIH1cbiAgICAgICAgfSk7XG4gICAgfVxuXG4gICAgZGF0YS5wdXNoKHtcbiAgICAgICAgY29sX3R5cGU6ICdsb25nX3RleHQnXG4gICAgfSk7XG4gICAgc2V0UmVzdWx0KGRhdGEpO1xuICAgIGxldCBpbWcgPSBbXG4gICAgICAgIFtcbiAgICAgICAgICAgIFwiaGlrZXI6Ly9maWxlcy9pY29uL+i1ni5zdmdcIiwgXCJodHRwczovL2JhZnliZWlhZWV0d2JjM3Rob3kyMnk1emQ3YWw2cm5kZXFicmJ3aHN6cWI2b2l0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oUGFnZShmYWxzZSk7XFxuICAgICAgICAgICAgcmV0dXJuIFxcXCJ0b2FzdDovL+W3suiuvuS4uuWFrOW8gFxcXCI7XFxuICAgICAgICB9KSxcXG4gICAgICAgIGNvbF90eXBlOiBteV9jb2xfdHlwZVxcbiAgICB9LCB7XFxuICAgICAgICB0aXRsZTogXFxcIumaj+acuuWvhumSpVxcXCIsXFxuICAgICAgICBjb2xfdHlwZTogbXlfY29sX3R5cGUsXFxuICAgICAgICB1cmw6ICQoZ2V0QXBpKFxcXCJnZW5BdXRoXFxcIikgKyByZXFCeUdldCArIFxcXCIjbm9Mb2FkaW5nI1xcXCIpLmxhenlSdWxlKCgpID0+IHtcXG4gICAgICAgICAgICBsZXQgYmFjayA9IHJlcXVlc3QoaW5wdXQpO1xcbiAgICAgICAgICAgIGxldCByZXQgPSBKU09OLnBhcnNlKGJhY2spO1xcbiAgICAgICAgICAgIGlmIChyZXQuc3RhdHVzID09IDApIHtcXG4gICAgICAgICAgICAgICAgcmVmcmVzaFBhZ2UoZmFsc2UpO1xcbiAgICAgICAgICAgICAgICByZXR1cm4gXFxcInRvYXN0Oi8v5bey55Sf5oiQ6ZqP5py65a+G56CBXFxcXG5cXFwiICsgcmV0LnJlc3VsdFxcbiAgICAgICAgICAgIH0gZWxzZSB7XFxuICAgICAgICAgICAgICAgIHJlZnJlc2hQYWdlKHRydWUpO1xcbiAgICAgICAgICAgICAgICByZXR1cm4gXFxcInRvYXN0Oi8v6ZqP5py65a+G56CB55Sf5oiQ5aSx6LSlXFxcIlxcbiAgICAgICAgICAgIH1cXG4gICAgICAgIH0pXFxuICAgIH0pO1xcbiAgICBsZXQgdGltZU92ZXIgPSB7XFxuICAgICAgICBjb2xfdHlwZTogbXlfY29sX3R5cGVcXG4gICAgfTtcXG4gICAgaWYgKGRhdGFJdGVtLnRpbWVfb3Zlcikge1xcbiAgICAgICAgdGltZU92ZXIudGl0bGUgPSBzbWFsbChjb2xvcihcXFwi55+t5pe25a+G6ZKlXFx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JZDppdGVtLmlkXFxuICAgICAgICAgICAgfSxcXG4gICAgICAgICAgICBwaWNfdXJsOiBpdGVtLmF2YXRhcl91cmxcXG4gICAgICAgIH0pO1xcbiAgICAgICAgZGF0YS5wdXNoKHtcXG4gICAgICAgICAgICB0aXRsZTogaXRlbS5kaXNjdXNzX3RleHQsXFxuICAgICAgICAgICAgZGVzYzogUmVwbHkraXRlbS5jcmVhdGVfZGF0ZSArIFxcXCLCt1xcXCIgKyBpY29uW2l0ZW0uZGlzY3Vzc190eXBlXSxcXG4gICAgICAgICAgICBjb2xfdHlwZTogXFxcInRleHRfMVxcXCIsXFxuICAgICAgICAgICAgdXJsOiBcXFwiaGlrZXI6Ly9wYWdlL2luZm9cXFwiLFxcbiAgICAgICAgICAgIGV4dHJhOiB7XFxuICAgICAgICAgICAgICAgIG5hbWU6IGl0ZW0ubmFtZSxcXG4gICAgICAgICAgICAgICAgdHlwZTogXFxcImxvbmdfdGV4dFxcXCIsXFxuICAgICAgICAgICAgICAgIHRleHQ6IGl0ZW0uZGlzY3Vzc190ZXh0XFxuICAgICAgICAgICAgfSxcXG4gICAgICAgICAgICBwaWNfdXJsOiBpdGVtLmF2YXRhcl91cmxcXG4gICAgICAgIH0pO1xcbiAgICB9XFxufVxcbmRhdGEucHVzaCh7XFxuICAgIGNvbF90eXBlOiBcXFwibGluZV9ibGFua1xcXCJcXG59KTtcXG5zZXRSZXN1bHQoZGF0YSk7XCJ9LHtcImNvbF90eXBlXCI6XCJpY29uXzJfcm91bmRcIixcIm5hbWVcIjpcIuinhOWImeWIl+ihqFwiLFwicGF0aFwiOlwicnVsZXNcIixcInJ1bGVcIjpcImpzOlxcbiAgICBhZGRMaXN0ZW5lcignb25DbG9zZScsJC50b1N0cmluZygoKT0+e1xcbiAgICAgICAgY2xlYXJWYXIoXFxcIldhcmVob3VzZS5iYWNrXFxcIik7XFxuICAgICAgICBjbGVhclZhcihcXFwiV2FyZWhvdXNlLmZpbHRlclxcXCIpO1xcbiAgICAg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vbF90eXBlOiAndGV4dF8yJ1xcbn0pO1xcbmxldCBjYW5fdXBsb2FkX2FwaSA9IGdldEFwaShcXFwibWFuQ2FuVXBsb2FkXFxcIikraWQ7XFxuaWYoZ2V0VmFyKCdob3VzZS5pc19tYW5hZ2VyJykpe1xcbiAgICBsZXQgdGlwcyA9IGNhbl91cGxvYWQ/J+iDvSc6J+WQpic7XFxuICAgIC8vIGxvZygndGlwczonK3RpcHMpO1xcbiAgICAvLyBsb2coJ2Nhbl91cGxvYWQ6JytjYW5fdXBsb2FkKTtcXG4gICAgZGF0YS5wdXNoKHtcXG4gICAgICAgIHRpdGxlOifimqDog73lkKbkuIrkvKA6JysoZ2V0VmFyKCdXYXJlaG91c2UuY2FuX3VwbG9hZCcpfHx0aXBzKSxcXG4gICAgICAgIGNvbF90eXBlOidzY3JvbGxfYnV0dG9uJyxcXG4gICAgICAgIHVybDonaGlrZXI6Ly9lbXB0eSdcXG4gICAgfSk7XFxuICAgIGZ1bmN0aW9uIHNldFVwbG9hZChmbGFnLGNhbl91cGxvYWRfYXBpKSB7XFxuICAgICAgICBmbGFnID0gZmxhZyB8fCAnJztcXG4gICAgICAgIHRyeSB7XFxuICAgICAgICAgICAgbGV0IGNvZGUgPSBmZXRjaChjYW5fdXBsb2FkX2FwaSwge1xcbiAgICAgICAgICAgICAgICBoZWFkZXJzOiB7XFxcIlVzZXItQWdlbnRcXFwiOiBNT0JJTEVfVUF9LFxcbiAgICAgICAgICAgICAgICBib2R5OiB7XFxuICAgICAgICAgICAgICAgICAgICBcXFwicGFyYW1zXFxcIjpcXG4gICAgICAgICAgICAgICAgICAgICAgICB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIFxcXCJ1c2VybmFtZVxcXCI6IGdldFZhcignaG91c2UudXNlcm5hbWUnKSxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgXFxcInBhc3N3b3JkXFxcIjogZ2V0VmFyKCdob3VzZS5wYXNzd29yZCcpLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBcXFwiY2FuX3VwbG9hZFxcXCI6ICEhZmxhZ1xcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIH0pO1xcbiAgICAgICAgICAgIGNvZGUgPSBKU09OLnBhcnNlKGNvZGUpLnJlc3VsdDtcXG4gICAgICAgICAgICBpZiAoY29kZS5zdGF0dXMgPT09IDApIHtcXG4gICAgICAgICAgICAgICAgcmV0dXJuIGNvZGUuZGV0YWlsXFxuICAgICAgICAgICAgfSBlbHNlIHtcXG4gICAgICAgICAgICAgICAgcmV0dXJuICfmk43kvZzlpLHotKU6JyArIGNvZGUuZGV0YWlsXFxuICAgICAgICAgICAgfVxcbiAgICAgICAgfSBjYXRjaCAoZSkge1xcbiAgICAgICAgICAgIHJldHVybiAn5pON5L2c5aSx6LSlOicgKyBlLm1lc3NhZ2VcXG4gICAgICAgIH1cXG4gICAgfVxcbiAgICBkYXRhLnB1c2goe1xcbiAgICAgICAgdGl0bGU6J/CfmqvnpoHmraLkuIrkvKAnLFxcbiAgICAgICAgY29sX3R5cGU6J3Njcm9sbF9idXR0b24nLFxcbiAgICAgICAgdXJsOiQoJ+emgeatouivpeW8gOWPkeiAheS4iuS8oOinhOWImT/kvaDnmoTmk43kvZzlsIbooqvns7vnu5/orrDlvZUnKS5jb25maXJtKChpZCxjYW5fdXBsb2FkX2FwaSxzZXRVcGxvYWQpPT57XFxuICAgICAgICAgICAgbGV0IHJldCA9IHNldFVwbG9hZChmYWxzZSxjYW5fdXBsb2FkX2FwaSk7XFxuICAgICAgICAgICAgaWYoIS/mk43kvZzlpLHotKUvLnRlc3QocmV0KSl7XFxuICAgICAgICAgICAgICAgIHB1dFZhcignV2FyZWhvdXNlLmNhbl91cGxvYWQnLCflkKYnKTtcXG4gICAgICAgICAgICAgICAgcmVmcmVzaFBhZ2UoZmFsc2UpO1xcbiAgICAgICAgICAgIH1cXG4gICAgICAgICAgICByZXR1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CIrZGF0YUl0ZW0uYXV0aG9yLHN1YlVybCk7XFxuICAgICAgICAgICAgICAgIC8vY29weShpbXBvcnRfcnVsZSk7XFxuICAgICAgICAgICAgICAgIGxldCBydWxlQ29kZT1wYXJzZVBhc3RlKGltcG9ydF9ydWxlLnNwbGl0KFxcXCJcXFxcblxcXCIpWzBdKTtcXG4gICAgICAgICAgICAgICAgLy9yZXR1cm4gXFxcImhpa2VyOi8vZW1wdHlcXFwiXFxuICAgICAgICAgICAgICAgIGltcG9ydFVybCA9ICdydWxlOi8vJyArIGJhc2U2NEVuY29kZShydWxlQ29kZSk7XFxuICAgICAgICAgICAgICAgIHJldHVybiBpbXBvcnRVcmxcXG4gICAgICAgICAgICB9LGRhdGFJdGVtLHJ1bGVMaXN0SnNvbiArIGRhdGFJdGVtLmlkKSxcXG4gICAgICAgICAgICBjb2xfdHlwZTogbXlfY29sX3R5cGUyXFxuICAgICAgICB9KTtcXG4gICAgICAgIGRhdGEucHVzaCh7XFxuICAgICAgICAgICAgdGl0bGU6ICfigJzigJzigJ3igJ08c3BhbiBzdHlsZT1cXFwiY29sb3I6ICNmZjcwMDBcXFwiPuWvvOWFpemBk+W+t+e7jzwvc3Bhbj4nLFxcbiAgICAgICAgICAgIHVybDogJCgpLmxhenlSdWxlKChkYXRhSXRlbSxzdWJVcmwpPT57XFxuICAgICAgICAgICAgICAgIC8vIGxldCB0aXRsZSA9IFxcXCJILVxcXCIrZGF0YUl0ZW0ubmFtZStcXFwiLlxcXCIrZGF0YUl0ZW0uYXV0aG9yO1xcbiAgICAgICAgICAgICAgICBsZXQgdGl0bGUgPSBcXFwiSi1cXFwiK2RhdGFJdGVtLm5hbWUuc3BsaXQoJy4nKVswXTtcXG4gICAgICAgICAgICAgICAgbGV0IHN1Yk9iaiA9IHtcXG4gICAgICAgICAgICAgICAgICAgIHRpdGxlOiB0aXRsZSxcXG4gICAgICAgICAgICAgICAgICAgIHVybDogc3ViVXJsLFxcbiAgICAgICAgICAgICAgICAgICAgZGVzYzogXFxcImhpa2VyOi8vZmlsZXMvcnVsZXMvZHpIb3VzZS9ydWxlQ2FjaGUvXFxcIit0aXRsZStcXFwiLmpzb25cXFwiLFxcbiAgICAgICAgICAgICAgICAgICAgY29kZTogXFxcIlxcXCIsXFxuICAgICAgICAgICAgICAgICAgICBhY3RpdmU6IGZhbHNlLC8v56aB55So5bm25Y+R5pu05pawXFxuICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgbGV0IHNoYXJlVGV4dCA9IGJhc2U2NEVuY29kZShKU09OLnN0cmluZ2lmeShzdWJPYmopKTtcXG4gICAgICAgICAgICAgICAgdmFyIHBhc3RlcyA9IGdldFBhc3RlcygpO1xcbiAgICAgICAgICAgICAgICB2YXIgdXJsID0gc2hhcmVQYXN0ZShzaGFyZVRleHQscGFzdGVzLnNsaWNlKC0xKVswXSk7XFxuICAgICAgICAgICAgICAgIGxldCBpbXBvcnRfcnVsZT0gXFxcIui9u+WQiOmbhuiuoumYhe+8mlxcXCIrdGl0bGUrJ1xcXFxuJyt1cmw7XFxuICAgICAgICAgICAgICAgIGNvcHkoaW1wb3J0X3J1bGUpO1xcbiAgICAgICAgICAgICAgICBjb25zdCBwYXRoID0gJ2hpa2VyOi8vZmlsZXMvcnVsZXMvZHpIb3VzZS9ydWxlQ2FjaGUvc3ViLmpzb24nO1xcbiAgICAgICAgICAgICAgICAkLnJjKGNvbmZpZy5saWIuc3ViKTtcXG4gICAgICAgICAgICAgICAgcmV0dXJuIOiuoumYheWvvOWFpShwYXRoKVxcbiAgICAgICAgICAgIH0sZGF0YUl0ZW0scnVsZUxpc3RKc29uICsgZGF0YUl0ZW0uaWQpLFxcbiAgICAgICAgICAgIGNvbF90eXBlOiBteV9jb2xfdHlwZTJcXG4gICAgICAgIH0pO1xcbiAgICAgICAgZGF0YS5wdXNoKHtcXG4gICAgICAgICAgICB0aXRsZTogXFxcIjxzbWFsbD7mj5DnpLrvvJrlvIDlj5HogIXljZXni6zliIbkuqvn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gICAgICAgICAgIFxcXCJwYXJhbXNcXFwiOlxcbiAgICAgICAgICAgICAgICAgICAgICAgIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgXFxcInVzZXJuYW1lXFxcIjogZ2V0VmFyKCdob3VzZS51c2VybmFtZScpLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBcXFwicGFzc3dvcmRcXFwiOiBnZXRWYXIoJ2hvdXNlLnBhc3N3b3JkJyksXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIFxcXCJpc19zYWZlXFxcIjogISFmbGFnXFxuICAgICAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgfSk7XFxuICAgICAgICAgICAgY29kZSA9IEpTT04ucGFyc2UoY29kZSkucmVzdWx0O1xcbiAgICAgICAgICAgIGlmIChjb2RlLnN0YXR1cyA9PT0gMCkge1xcbiAgICAgICAgICAgICAgICByZXR1cm4gY29kZS5kZXRhaWxcXG4gICAgICAgICAgICB9IGVsc2Uge1xcbiAgICAgICAgICAgICAgICByZXR1cm4gJ+aTjeS9nOWksei0pTonICsgY29kZS5kZXRhaWxcXG4gICAgICAgICAgICB9XFxuICAgICAgICB9IGNhdGNoIChlKSB7XFxuICAgICAgICAgICAgcmV0dXJuICfmk43kvZzlpLHotKU6JyArIGUubWVzc2FnZVxcbiAgICAgICAgfVxcbiAgICB9XFxuICAgIGZ1bmN0aW9uIHNldElzR29vZChmbGFnLG1hbl9ydWxlX2dvb2QpIHtcXG4gICAgICAgIGZsYWcgPSBmbGFnIHx8ICcnO1xcbiAgICAgICAgdHJ5IHtcXG4gICAgICAgICAgICBsZXQgY29kZSA9IGZldGNoKG1hbl9ydWxlX2dvb2QsIHtcXG4gICAgICAgICAgICAgICAgaGVhZGVyczoge1xcXCJVc2VyLUFnZW50XFxcIjogTU9CSUxFX1VBfSxcXG4gICAgICAgICAgICAgICAgYm9keToge1xcbiAgICAgICAgICAgICAgICAgICAgXFxcInBhcmFtc1xcXCI6XFxuICAgICAgICAgICAgICAgICAgICAgICAge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBcXFwidXNlcm5hbWVcXFwiOiBnZXRWYXIoJ2hvdXNlLnVzZXJuYW1lJyksXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIFxcXCJwYXNzd29yZFxcXCI6IGdldFZhcignaG91c2UucGFzc3dvcmQnKSxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgXFxcImlzX2dvb2RcXFwiOiAhIWZsYWdcXG4gICAgICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICB9KTtcXG4gICAgICAgICAgICBjb2RlID0gSlNPTi5wYXJzZShjb2RlKS5yZXN1bHQ7XFxuICAgICAgICAgICAgaWYgKGNvZGUuc3RhdHVzID09PSAwKSB7XFxuICAgICAgICAgICAgICAgIHJldHVybiBjb2RlLmRldGFpbFxcbiAgICAgICAgICAgIH0gZWxzZSB7XFxuICAgICAgICAgICAgICAgIHJldHVybiAn5pON5L2c5aSx6LSlOicgKyBjb2RlLmRldGFpbFxcbiAgICAgICAgICAgIH1cXG4gICAgICAgIH0gY2F0Y2ggKGUpIHtcXG4gICAgICAgICAgICByZXR1cm4gJ+aTjeS9nOWksei0pTonICsgZS5tZXNzYWdlXFxuICAgICAgICB9XFxuICAgIH1cXG4gICAgZGF0YS5wdXNoKHtcXG4gICAgICAgIHRpdGxlOifwn5qr6aOO6ZmpJyxcXG4gICAgICAgIGNvbF90eXBlOidzY3JvbGxfYnV0dG9uJyxcXG4gICAgICAgIHVybDokKCfmoIforrDor6Xop4TliJnkuLrpo47pmak/6aOO6Zmp6KeE5YiZ5peg5rOV6KKr5a+85YWlJykuY29uZmlybSgoaWQsbWFuX3J1bGVfc2FmZSxzZXRJc1NhZmUpPT57XFxuICAgICAgICAgICAgbGV0IHJldCA9IHNldElzU2FmZShmYWxzZSxtYW5fcnVsZV9zYWZlKTtcXG4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bGVfZ29vZCk7XFxuICAgICAgICAgICAgaWYoIS/mk43kvZzlpLHotKUvLnRlc3QocmV0KSl7XFxuICAgICAgICAgICAgICAgIHJlZnJlc2hQYWdlKGZhbHNlKTtcXG4gICAgICAgICAgICB9XFxuICAgICAgICAgICAgcmV0dXJuICd0b2FzdDovLycrcmV0XFxuICAgICAgICB9LGRhdGFJdGVtLmlkLG1hbl9ydWxlX2dvb2Qsc2V0SXNHb29kKVxcbiAgICB9KTtcXG4gICAgZGF0YS5wdXNoKHtcXG4gICAgICAgIHRpdGxlOifwn5KW5LyY6LSoJyxcXG4gICAgICAgIGNvbF90eXBlOidzY3JvbGxfYnV0dG9uJyxcXG4gICAgICAgIHVybDokKCfmoIforrDor6Xop4TliJnkuLrkvJjotKg/JykuY29uZmlybSgoaWQsbWFuX3J1bGVfZ29vZCxzZXRJc0dvb2QpPT57XFxuICAgICAgICAgICAgbGV0IHJldCA9IHNldElzR29vZCh0cnVlLG1hbl9ydWxlX2dvb2QpO1xcbiAgICAgICAgICAgIGlmKCEv5pON5L2c5aSx6LSlLy50ZXN0KHJldCkpe1xcbiAgICAgICAgICAgICAgICByZWZyZXNoUGFnZShmYWxzZSk7XFxuICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIHJldHVybiAndG9hc3Q6Ly8nK3JldFxcbiAgICAgICAgfSxkYXRhSXRlbS5pZCxtYW5fcnVsZV9nb29kLHNldElzR29vZClcXG4gICAgfSk7XFxufVxcblxcbmRhdGEucHVzaCh7XFxuICAgIGNvbF90eXBlOiBcXFwibGluZV9ibGFua1xcXCJcXG59KTtcXG5kYXRhLnB1c2goe1xcbiAgICB0aXRsZTogZGF0YUl0ZW0uZ29vZF9udW0sXFxuICAgIHBpY191cmw6IFxcXCJoaWtlcjovL2ZpbGVzL2ljb24v6LWeLnN2Z1xcXCIsXFxuICAgIGNvbF90eXBlOiBcXFwiaWNvbl9zbWFsbF8zXFxcIixcXG4gICAgdXJsOiBcXFwiaGlrZXI6Ly9wYWd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RpdGxlOiBodG1sVGFnKFxcXCJiXFxcIiwgXFxcIuazqOWGjFxcXCIpLFxcbiAgICB1cmw6ICQoZ2V0QXBpKFxcXCJuZXdfZGV2XFxcIikrXFxcIiNub0xvYWRpbmcjXFxcIikubGF6eVJ1bGUoKGdldElkLCBjb25maXJtKSA9PiB7XFxuICAgICAgICBsZXQgdXNlcm5hbWUgPSBnZXRWYXIoJ1dhcmVob3VzZS5Vc2VybmFtZScsIFxcXCJcXFwiKSxcXG4gICAgICAgICAgICBwYXNzd29yZCA9IGdldFZhcignV2FyZWhvdXNlLlBhc3N3b3JkJywgXFxcIlxcXCIpLFxcbiAgICAgICAgICAgIGRlc2NyaXB0aW9uID0gZ2V0VmFyKCdXYXJlaG91c2UuRGVzY3JpcHRpb24nLCBcXFwiXFxcIiksXFxuICAgICAgICAgICAgbmFtZSA9IGdldFZhcihcXFwiV2FyZWhvdXNlLlVzZXJBZGRyZXNzXFxcIiwgXFxcIlxcXCIpO1xcbiAgICAgICAgaWYgKFt1c2VybmFtZSwgcGFzc3dvcmQsIG5hbWVdLmluY2x1ZGVzKFxcXCJcXFwiKSkge1xcbiAgICAgICAgICAgIHJldHVybiBcXFwidG9hc3Q6Ly/otKblj7cs5a+G56CB5ZKM5pi156ew5LiN6IO95Li656m6XFxcIjtcXG4gICAgICAgIH1cXG4gICAgICAgIHNob3dMb2FkaW5nKFxcXCLmraPlnKjmj5DkuqTnlLPor7fooahcXFwiKTtcXG4gICAgICAgIGxldCByZXN1bHQgPSByZXF1ZXN0KGlucHV0LCB7XFxuICAgICAgICAgICAgaGVhZGVyczoge1xcbiAgICAgICAgICAgICAgICAnY29udGVudC10eXBlJzogJ2FwcGxpY2F0aW9uL2pzb24nXFxuICAgICAgICAgICAgfSxcXG4gICAgICAgICAgICBib2R5OiBKU09OLnN0cmluZ2lmeSh7XFxuICAgICAgICAgICAgICAgIFxcXCJwYXJhbXNcXFwiOiB7XFxuICAgICAgICAgICAgICAgICAgICBcXFwicmVhc29uXFxcIjogZGVzY3JpcHRpb24sXFxuICAgICAgICAgICAgICAgICAgICBcXFwibmFtZVxcXCI6IG5hbWUsXFxuICAgICAgICAgICAgICAgICAgICBcXFwicGFzc3dvcmRcXFwiOiBwYXNzd29yZCxcXG4gICAgICAgICAgICAgICAgICAgIFxcXCJxcVxcXCI6IHVzZXJuYW1lXFxuICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICB9KSxcXG4gICAgICAgICAgICBtZXRob2Q6ICdwb3N0J1xcbiAgICAgICAgfSk7XFxuICAgICAgICByZXN1bHQgPSBKU09OLnBhcnNlKHJlc3VsdCkucmVzdWx0O1xcbiAgICAgICAgaGlkZUxvYWRpbmcoKTtcXG4gICAgICAgIGlmIChyZXN1bHQuc3RhdHVzICE9PSAwKSB7XFxuICAgICAgICAgICAgcmV0dXJuIFxcXCJ0b2FzdDovL1xcXCIgKyByZXN1bHQuZGV0YWlsO1xcbiAgICAgICAgfVxcbiAgICAgICAgbGV0IGlkcmVzdWx0ID0gSlNPTi5wYXJzZShyZXF1ZXN0KGdldElkICsgXFxcIj9xcT1cXFwiICsgdXNlcm5hbWUpKTtcXG4gICAgICAgIGlmIChpZHJlc3VsdC5zdGF0dXMgIT09IDApIHtcXG4gICAgICAgICAgICByZXR1cm4gXFxcInRvYXN0Oi8vXFxcIiArIGlkcmVzdWx0LmRldGFpbDtcXG4gICAgICAgIH1cXG4gICAgICAgIFxcbiAgICAgICAgcmV0dXJuICQoXFxcIlxcXCIsIFxcXCLovpPlhaXpgq7nrrHpqozor4HnoIFcXFxcblxcXCIgKyByZXN1bHQuZGV0YWlsKS5pbnB1dCgoY29uZmlybSwgaWQsIGFjY291bnQpID0+IHtcXG4gICAgICAgICAgICBzaG93TG9hZGluZyhcXFwi6K+36ICQ5b+D562J5b6FXFxcIik7XFxuICAgICAgICAgICAgdHJ5IHtcXG4gICAgICAgICAgICAgICAgbGV0IHJlc3VsdCA9IHJlcXVlc3QoY29uZmlybSwge1xcbiAgICAgICAgICAgICAgICAgICAgaGVhZGVyczoge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICdjb250ZW50LXR5cGUnOiAnYXBwbGljYXRpb24vanNvbidcXG4gICAgICAgICAgICAgICAgICAgIH0sXFxuICAgICAgICAgICAgICAgICAgICBib2R5OiBKU09OLnN0cmluZ2lmeSh7XFxuICAgICAgICAgICAgICAgICAgICAgICAgXFxcInBhcmFtc1xcXCI6IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgXFxcInJlZ2lzdF9pZFxcXCI6IGlkLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBcXFwieXptXFxcIjogaW5wdXRcXG4gICAgICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICB9KSxcXG4gICAgICAgICAgICAgICAgICAgIG1ldGhvZDogJ1BPU1QnXFxuICAgICAgICAgICAgICAgIH0pO1xcbiAgICAgICAgICAgICAgICByZXN1bHQgPSBKU09OLnBhcnNlKHJlc3VsdCkucmVzdWx0O1xcbiAgICAgICAgICAgICAgICBpZiAocmVzdWx0LnN0YXR1cyAhPT0gMCkge1xcbiAgICAgICAgICAgICAgICAgICAgaGlkZUxvYWRpbmcoKTtcXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBcXFwidG9hc3Q6Ly9cXFwiICsgcmVzdWx0LmRldGFpbDtcXG4gICAgICAgICAgICAgICAgfSBlbHNlIHtcXG4gICAgICAgICAgICAgICAgICAgIHB1dFZhcihcXFwiV2FyZWhvdXNlVXNlcm5hbWVcXFwiLCBhY2NvdW50WzBdKTtcXG4gICAgICAgICAgICAgICAgICAgIHB1dFZhcihcXFwiV2FyZWhvdXNlUGFzc3dvcmRcXFwiLCBhY2NvdW50WzFdKTtcXG4gICAgICAgICAgICAgICAgICAgIGhpZGVMb2FkaW5nKCk7XFxuICAgICAgICAgICAgICAgICAgICBiYWNrKCk7XFxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gXFxcInRvYXN0Oi8v5oiQ5Y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gICAgfSk7XFxuICAgIGRhdGEucHVzaCh7XFxuICAgICAgICBjb2xfdHlwZTogJ2lucHV0JyxcXG4gICAgICAgIGRlc2M6IFxcXCLor7fovpPlhaXmlrDmmLXnp7BcXFwiLFxcbiAgICAgICAgZXh0cmE6IHtcXG4gICAgICAgICAgICB0aXRsZVZpc2libGU6IGZhbHNlLFxcbiAgICAgICAgICAgIGRlZmF1bHRWYWx1ZTogZ2V0VmFyKCdXYXJlaG91c2UubS5wZXROYW1lJywgJycpfHxkZXYubmFtZSxcXG4gICAgICAgICAgICBvbkNoYW5nZTogJ3B1dFZhcihcXFwiV2FyZWhvdXNlLm0ucGV0TmFtZVxcXCIsaW5wdXQpJ1xcbiAgICAgICAgfVxcbiAgICB9KTtcXG4gICAgZGF0YS5wdXNoKHtcXG4gICAgICAgIGNvbF90eXBlOiBcXFwibGluZV9ibGFua1xcXCJcXG4gICAgfSk7XFxuICAgIGRhdGEucHVzaCh7XFxuICAgICAgICB0aXRsZTogXFxcIuS/neWtmFxcXCIsXFxuICAgICAgICB1cmw6ICQoZ2V0QXBpKFxcXCJtb2RpZnlfbmFtZVxcXCIpICsgcGF0aCkubGF6eVJ1bGUoKCkgPT4ge1xcbiAgICAgICAgICAgIGxldCBuZXdQZXROYW1lID0gZ2V0VmFyKCdXYXJlaG91c2UubS5wZXROYW1lJywgJycpO1xcbiAgICAgICAgICAgIGlmIChuZXdQZXROYW1lID09IFxcXCJcXFwiKSB7XFxuICAgICAgICAgICAgICAgIHJldHVybiBcXFwidG9hc3Q6Ly/kvaDov5jku4DkuYjpg73msqHloavllYohXFxcIjtcXG4gICAgICAgICAgICB9XFxuICAgICAgICAgICAgbGV0IHJlc3VsdCA9IHJlcXVlc3QoaW5wdXQgKyBcXFwiJm5hbWU9XFxcIiArIGVuY29kZVVSSUNvbXBvbmVudChuZXdQZXROYW1lKSk7XFxuICAgICAgICAgICAgcmVzdWx0ID0gSlNPTi5wYXJzZShyZXN1bHQpO1xcbiAgICAgICAgICA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XFwiXFxuICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIGxldCByZXN1bHQgPSByZXF1ZXN0KGlucHV0ICsgXFxcIiZuZXdfcGFzc3dvcmQ9XFxcIiArIG5ld19wYXNzd29yZCtcXFwiJm5ld19wYXNzd29yZF9yZT1cXFwiK25ld19wYXNzd29yZF9hZ2Fpbik7XFxuICAgICAgICAgICAgcmVzdWx0ID0gSlNPTi5wYXJzZShyZXN1bHQpO1xcbiAgICAgICAgICAgIGlmIChyZXN1bHQuc3RhdHVzID09PSAwKSB7XFxuICAgICAgICAgICAgICAgIHdyaXRlRmlsZShcXFwiaGlrZXI6Ly9maWxlcy9XYXJlaG91c2VVU0VSLmpzb25cXFwiLEpTT04uc3RyaW5naWZ5KHtcXG4gICAgICAgICAgICAgICAgICAgIHVzZXJuYW1lOnVzZXJuYW1lLFxcbiAgICAgICAgICAgICAgICAgICAgcGFzc3dvcmQ6bmV3X3Bhc3N3b3JkXFxuICAgICAgICAgICAgICAgIH0pKTtcXG4gICAgICAgICAgICAgICAgYmFjaygpO1xcbiAgICAgICAgICAgICAgICByZXR1cm4gXFxcInRvYXN0Oi8v5L+u5pS55oiQ5YqfXFxcIjtcXG4gICAgICAgICAgICB9IGVsc2Uge1xcbiAgICAgICAgICAgICAgICByZXR1cm4gXFxcInRvYXN0Oi8vXFxcIiArIHJlc3VsdC5kZXRhaWw7XFxuICAgICAgICAgICAgfVxcbiAgICAgICAgfSxwYXNzd29yZCx1c2VybmFtZSksXFxuICAgICAgICBjb2xfdHlwZTogJ3RleHRfY2VudGVyXzEnXFxuICAgIH0pO1xcbn1cXG5cXG5zd2l0Y2ggKFBhdHRlcm4pIHtcXG4gICAgY2FzZSAwOlxcbiAgICAgICAgc2V0UGFnZVRpdGxlKFxcXCLkv67mlLnlpLTlg49cXFwiKTtcXG4gICAgICAgIG1fYXZhdGFyKCk7XFxuICAgICAgICBicmVhaztcXG4gICAgY2FzZSAxOlxcbiAgICAgICAgc2V0UGFnZVRpdGx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oJ1dhcmVob3VzZS5ydWxlLm5vdGVzJywgJycpfHxub3Rlc3x8XFxcIlxcXCIsXFxuICAgICAgICB0eXBlOiBcXFwidGV4dGFyZWFcXFwiLFxcbiAgICAgICAgaGVpZ2h0Oi0xLFxcbiAgICAgICAgb25DaGFuZ2U6ICdwdXRWYXIoXFxcIldhcmVob3VzZS5ydWxlLm5vdGVzXFxcIixpbnB1dCknXFxuICAgIH1cXG59KTtcXG5cXG5kYXRhLnB1c2goe1xcbiAgICB0aXRsZTogXFxcIuS/neWtmFxcXCIsXFxuICAgIGNvbF90eXBlOiBcXFwidGV4dF9jZW50ZXJfMVxcXCIsXFxuICAgIHVybDogJChnZXRBcGkoXFxcInNldF9ydWxlX25vdGVcXFwiKSArIGlkKS5sYXp5UnVsZSgodXNlcm5hbWUsIHBhc3N3b3JkKSA9PiB7XFxuICAgICAgICBsZXQgbm90ZXMgPSBnZXRWYXIoJ1dhcmVob3VzZS5ydWxlLm5vdGVzJywgJycpO1xcbiAgICAgICAgbGV0IHJlc3VsdCA9IHJlcXVlc3QoaW5wdXQsIHtcXG4gICAgICAgICAgICBoZWFkZXJzOiB7XFxuICAgICAgICAgICAgICAgICdjb250ZW50LXR5cGUnOiAnYXBwbGljYXRpb24vanNvbidcXG4gICAgICAgICAgICB9LFxcbiAgICAgICAgICAgIGJvZHk6IEpTT04uc3RyaW5naWZ5KHtcXG4gICAgICAgICAgICAgICAgXFxcInBhcmFtc1xcXCI6IHtcXG4gICAgICAgICAgICAgICAgICAgIFxcXCJxcVxcXCI6IHVzZXJuYW1lLFxcbiAgICAgICAgICAgICAgICAgICAgXFxcInBhc3N3b3JkXFxcIjogcGFzc3dvcmQsXFxuICAgICAgICAgICAgICAgICAgICBcXFwibm90ZVxcXCI6bm90ZXNcXG4gICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIH0pLFxcbiAgICAgICAgICAgIG1ldGhvZDogJ1BPU1QnXFxuICAgICAgICB9KTtcXG4gICAgICAgIHJlc3Vs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cXFwicmVwbHlcXFwiOlxcXCLlvIDlj5HogIXwn5ejXFxcIlxcbn1cXG5sZXQgY29udHJvbD0ocGlkLGFjdGl2ZSk9PnZvaWQgMDtcXG5pZihub19hY3RpdmUpe1xcbiAgICBjb250cm9sPWZ1bmN0aW9uKHBpZCxhY3RpdmUpe1xcbiAgICAgICAgZGF0YS5wdXNoKHtcXG4gICAgICAgICAgICB0aXRsZTphY3RpdmU/XFxcIumakOiXj+ivhOiuulxcXCI6XFxcIuWxleekuuivhOiuulxcXCIsXFxuICAgICAgICAgICAgdXJsOiQoYXBpLmRpc19kZXZfY29udHJvbCtwaWQrXFxcIj9xcT1cXFwiICsgdXNlcm5hbWUgKyBcXFwiJnBhc3N3b3JkPVxcXCIgKyBwYXNzd29yZCtcXFwiI25vTG9hZGluZyNcXFwiKS5sYXp5UnVsZSgoKT0+e1xcbiAgICAgICAgICAgICAgICBsZXQgcmVzdWx0PUpTT04ucGFyc2UocmVxdWVzdChpbnB1dCkpO1xcbiAgICAgICAgICAgICAgICByZWZyZXNoUGFnZShmYWxzZSlcXG4gICAgICAgICAgICAgICAgcmV0dXJuIFxcXCJ0b2FzdDovL1xcXCIrcmVzdWx0LmRldGFpbDtcXG4gICAgICAgICAgICB9KSxcXG4gICAgICAgICAgICBjb2xfdHlwZTpcXFwidGV4dF8yXFxcIlxcbiAgICAgICAgfSk7XFxuICAgICAgICBkYXRhLnB1c2goe1xcbiAgICAgICAgICAgIHRpdGxlOlxcXCLliKDpmaTor4TorrpcXFwiLFxcbiAgICAgICAgICAgIHVybDokKFxcXCLnoa7orqTliKDpmaTor6Xor4Torro/XFxcIikuY29uZmlybSgoaW5wdXQpPT57XFxuICAgICAgICAgICAgICAgIGxldCByZXN1bHQ9SlNPTi5wYXJzZShyZXF1ZXN0KGlucHV0KSk7XFxuICAgICAgICAgICAgICAgIHJlZnJlc2hQYWdlKGZhbHNlKVxcbiAgICAgICAgICAgICAgICByZXR1cm4gXFxcInRvYXN0Oi8vXFxcIity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eXBlOiBcXFwidGV4dF9jZW50ZXJfMVxcXCIsXFxuICAgIHVybDogJChhcGkuZGlzX25ldyArIGlkKS5sYXp5UnVsZSgoQWNjb3VudCkgPT4ge1xcbiAgICAgICAgbGV0IHRleHQgPSBnZXRWYXIoJ1dhcmVob3VzZS5jb21tZW50LnRleHQnLCAnJyk7XFxuICAgICAgICBsZXQgW3FxLGF1dGhfY29kZV0gPSBBY2NvdW50O1xcbiAgICAgICAgbGV0IHR5cGUgPSBnZXRWYXIoJ1dhcmVob3VzZS5jb21tZW50LnR5cGUnKSB8fCAnZ29vZCc7XFxuICAgICAgICBxcT1xcXx8XFxcIlxcXCI7XFxuICAgICAgICBhdXRoX2NvZGU9YXV0aF9jb2RlfHxcXFwiXFxcIjtcXG4gICAgICAgIGlmKHFxPT1cXFwiXFxcInx8YXV0aF9jb2RlPT1cXFwiXFxcIil7XFxuICAgICAgICAgICAgcmV0dXJuIFxcXCJ0b2FzdDovL+acqueZu+W9lei0puWPt1xcXCI7XFxuICAgICAgICB9XFxuICAgICAgICBpZih0ZXh0PT1cXFwiXFxcIil7XFxuICAgICAgICAgICAgcmV0dXJuIFxcXCJ0b2FzdDovL+S9oOi/mOS7gOS5iOmDveayoeWGmeWVilxcXCI7XFxuICAgICAgICB9XFxuICAgICAgICBmdW5jdGlvbiByKHApIHtcXG4gICAgICAgICAgICBsZXQgcmVzdWx0ID0gcmVxdWVzdChpbnB1dCwge1xcbiAgICAgICAgICAgICAgICBoZWFkZXJzOiB7XFxuICAgICAgICAgICAgICAgICAgICAnY29udGVudC10eXBlJzogJ2FwcGxpY2F0aW9uL2pzb24nXFxuICAgICAgICAgICAgICAgIH0sXFxuICAgICAgICAgICAgICAgIGJvZHk6IEpTT04uc3RyaW5naWZ5KHApLFxcbiAgICAgICAgICAgICAgICBtZXRob2Q6ICdQT1NUJ1xcbiAgICAgICAgICAgIH0pO1xcbiAgICAgICAgICAgIHJldHVybiBKU09OLnBhcnNlKHJlc3VsdCkucmVzdWx0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G4gICAgICAgICAgICAgICAgfSxcXG4gICAgICAgICAgICAgICAgYm9keTogSlNPTi5zdHJpbmdpZnkoe1xcbiAgICAgICAgICAgICAgICAgICAgXFxcInBhcmFtc1xcXCI6IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICBcXFwicXFcXFwiOiBxcVxcbiAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICB9KSxcXG4gICAgICAgICAgICAgICAgbWV0aG9kOiAnUE9TVCdcXG4gICAgICAgICAgICB9KTtcXG4gICAgICAgICAgICByZXN1bHQgPSBKU09OLnBhcnNlKHJlc3VsdCkucmVzdWx0O1xcbiAgICAgICAgICAgIGlmIChyZXN1bHQuc3RhdHVzID09PSAwKSB7XFxuICAgICAgICAgICAgICAgIGhpZGVMb2FkaW5nKCk7XFxuICAgICAgICAgICAgICAgIHJldHVybiBcXFwidG9hc3Q6Ly9cXFwiICsgcmVzdWx0LmRldGFpbDtcXG4gICAgICAgICAgICB9IGVsc2Uge1xcbiAgICAgICAgICAgICAgICBsZXQgcmVzdWx0MiA9IEpTT04ucGFyc2UocmVxdWVzdChiICsgXFxcIj9xcT1cXFwiICsgcXEpKTtcXG4gICAgICAgICAgICAgICAgaGlkZUxvYWRpbmcoKTtcXG4gICAgICAgICAgICAgICAgcmV0dXJuIFxcXCJ0b2FzdDovL1xcXCIgKyByZXN1bHQyLmRldGFpbDtcXG4gICAgICAgICAgICB9XFxuICAgICAgICB9IGNhdGNoIChlKSB7XFxuICAgICAgICAgICAgaGlkZUxvYWRpbmcoKTtcXG4gICAgICAgICAgICB0aHJvdyBlO1xcbiAgICAgICAgfVxcbiAgICAgICAgfSwgcXEsIGEsIGIpO1xcblxcbiAgICB9LCBhcGkuZGlzX25ld191c2VyLCBhcGkuZGlzX3ZlcmlmeSksXFxuICAgIGV4dHJhOiB7XFxuICAgICAgICB0eXBlOiBcXFwibnVtYmVyXFxcIixcXG4gICAgICAgIGRlZmF1bHRWYWx1ZTogZ2V0VmFyK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ZcXFwiKS5jb25maXJtKChmLCBsLCBsb2dpbikgPT4ge1xcbiAgICAgICAgbGV0IHFxID0gZ2V0VmFyKCdXYXJlaG91c2UubS5xcScsICcnKTtcXG4gICAgICAgIGxldCB5em0gPSBnZXRWYXIoJ1dhcmVob3VzZS5tLnl6bScsICcnKTtcXG4gICAgICAgIGlmIChxcSA9PSBcXFwiXFxcIiB8fCB5em0gPT0gXFxcIlxcXCIpIHtcXG4gICAgICAgICAgICByZXR1cm4gXFxcInRvYXN0Oi8vcXHmiJbpqozor4HnoIHkuLrnqbpcXFwiO1xcbiAgICAgICAgfVxcbiAgICAgICAgbGV0IHJlc3VsdCA9IHJlcXVlc3QobG9naW4sIHtcXG4gICAgICAgICAgICBoZWFkZXJzOiB7XFxuICAgICAgICAgICAgICAgICdjb250ZW50LXR5cGUnOiAnYXBwbGljYXRpb24vanNvbidcXG4gICAgICAgICAgICB9LFxcbiAgICAgICAgICAgIGJvZHk6IEpTT04uc3RyaW5naWZ5KHtcXG4gICAgICAgICAgICAgICAgXFxcInBhcmFtc1xcXCI6IHtcXG4gICAgICAgICAgICAgICAgICAgIFxcXCJxcVxcXCI6IHFxLFxcbiAgICAgICAgICAgICAgICAgICAgXFxcImF1dGhfY29kZVxcXCI6IHl6bVxcbiAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgfSksXFxuICAgICAgICAgICAgbWV0aG9kOiAnUE9TVCdcXG4gICAgICAgIH0pO1xcbiAgICAgICAgcmVzdWx0ID0gSlNPTi5wYXJzZShyZXN1bHQpLnJlc3VsdDtcXG4gICAgICAgIGlmIChyZXN1bHQuc3RhdHVzID09PSAwKSB7XFxuICAgICAgICAgICAgZi51c2VyID0gW3FxLCB5em1dO1xcbiAgICAgICAgICAgIHdyaXRlRmlsZShcXFwiaGlrZXI6Ly9maWxlcy9XYXJlaG91c2VVU0VSLmpzb25cXFwiLCBKU09OLnN0cmluZ2lmeShmKSk7XFxuICAgICAgICAgICAgbGV0IGluZGV4ID0gbC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ICAgICAgIH1cXG4gICAgICAgIGlmICh0ZXh0ID09IFxcXCJcXFwiKSB7XFxuICAgICAgICAgICAgcmV0dXJuIFxcXCJ0b2FzdDovL+S9oOi/mOS7gOS5iOmDveayoeWGmeWVilxcXCI7XFxuICAgICAgICB9XFxuICAgICAgICBsZXQgcmVzdWx0ID0gcmVxdWVzdChpbnB1dCwge1xcbiAgICAgICAgICAgIGhlYWRlcnM6IHtcXG4gICAgICAgICAgICAgICAgJ2NvbnRlbnQtdHlwZSc6ICdhcHBsaWNhdGlvbi9qc29uJ1xcbiAgICAgICAgICAgIH0sXFxuICAgICAgICAgICAgYm9keTogSlNPTi5zdHJpbmdpZnkoe1xcbiAgICAgICAgICAgICAgICBcXFwicGFyYW1zXFxcIjoge1xcbiAgICAgICAgICAgICAgICAgICAgXFxcImRpc2N1c3NfdGV4dFxcXCI6IHRleHQsXFxuICAgICAgICAgICAgICAgICAgICBcXFwicXFcXFwiOiB1c2VybmFtZSxcXG4gICAgICAgICAgICAgICAgICAgIFxcXCJwYXNzd29yZFxcXCI6IHBhc3N3b3JkLFxcbiAgICAgICAgICAgICAgICAgICAgXFxcImRpc2N1c3NfaWRcXFwiOiBydWxlSWRcXG4gICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIH0pLFxcbiAgICAgICAgICAgIG1ldGhvZDogJ1BPU1QnXFxuICAgICAgICB9KTtcXG4gICAgICAgIHJlc3VsdCA9IEpTT04ucGFyc2UocmVzdWx0KS5yZXN1bHQ7XFxuICAgICAgICBpZiAocmVzdWx0LnN0YXR1cyA9PT0gMCkge1xcbiAgICAgICAgICAgIGJhY2soZmFsc2UpO1xcbiAgICAgICAgfVxcbiAgICAgICAgcmV0dXJuIFxcXCJ0b2FzdDovL1xcXCIgKyByZXN1bHQuZGV0YWlsO1xcblxcbiAgICB9LCBwYXNzd29yZCwgdXNlcm5hbWUsIHJlcGx5SWQpXFxufSk7XFxuXFxuc2V0UmVzdWx0KGRhdGEpO1wifSx7XCJjb2x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OiBcXFwiYXZhdGFyXFxcIixcXG4gICAgICAgICAgICB1cmw6IFxcXCJoaWtlcjovL3BhZ2UvcnVsZURldGFpbCNub0hpc3RvcnkjI25vUmVjb3JkSGlzdG9yeSNcXFwiLFxcbiAgICAgICAgICAgIGV4dHJhOiB7XFxuICAgICAgICAgICAgICAgIGx2ZXI6IFxcXCLlm57lpI3ov5vlhaXkuI3mlK/mjIHmn6XnnItcXFwiLFxcbiAgICAgICAgICAgICAgICBpZDogaXRlbS5ydWxlX2lkWzBdXFxuICAgICAgICAgICAgfSxcXG4gICAgICAgICAgICBwaWNfdXJsOiBpdGVtLmF2YXRhcl91cmxcXG4gICAgICAgIH0pO1xcbiAgICAgICAgZGF0YS5wdXNoKHtcXG4gICAgICAgICAgICB0aXRsZTogaXRlbS5kaXNjdXNzX3RleHQsXFxuICAgICAgICAgICAgZGVzYzogaXRlbS5jcmVhdGVfZGF0ZSArIFxcXCLCt1xcXCIraXRlbS5ydWxlX2lkWzFdK1xcXCLCt1xcXCIrXFxcIuW8gOWPkeiAhfCfl6NcXFwiLFxcbiAgICAgICAgICAgIGNvbF90eXBlOiBcXFwidGV4dF8xXFxcIixcXG4gICAgICAgICAgICB1cmw6IFxcXCJoaWtlcjovL3BhZ2UvaW5mb1xcXCIsXFxuICAgICAgICAgICAgZXh0cmE6e1xcbiAgICAgICAgICAgICAgICBuYW1lOml0ZW0ubmFtZSxcXG4gICAgICAgICAgICAgICAgdHlwZTpcXFwibG9uZ190ZXh0XFxcIixcXG4gICAgICAgICAgICAgICAgdGV4dDppdGVtLmRpc2N1c3NfdGV4dFxcbiAgICAgICAgICAgIH0sXFxuICAgICAgICAgICAgcGljX3VybDogaXRlbS5hdmF0YXJfdXJsXFxuICAgICAgICB9KTtcXG4gICAgfVxcbiAgICBcXG59XFxuc2V0UmVzdWx0KGRhdGEpO1xcblwifSx7XCJjb2xfdHlwZVwiOlwibW92aWVfM1wiLFwibmFtZVwiOlwi5pu05aSa5YiG5LqrXCIsXCJ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IubGVuZ3RoPj0yJiZ3ZWJfdXJsX2FyclsxXS5sZW5ndGg+Mil7IC8vIOiuvue9ruivt+axguaWueazlVxcbiAgICAgICAgICAgICAgICBwYXJhbXNbJ21ldGhvZCddID0gd2ViX3VybF9hcnJbMV0udG9VcHBlckNhc2UoKTtcXG4gICAgICAgICAgICB9XFxuICAgICAgICAgICAgbG9nKCflvIDlp4vojrflj5bmupDnoIEnKTtcXG4gICAgICAgICAgICB0cnkge1xcbiAgICAgICAgICAgICAgICAvKlxcbiAgICAgICAgICAgICAgICByZXF1ZXN0QXN5bmMod2ViX3VybCxwYXJhbXMsZnVuY3Rpb24gKGtleSxjb2RlKSB7XFxuICAgICAgICAgICAgICAgICAgICBsZXQgYmFja19jb2RlID0gY29kZTtcXG4gICAgICAgICAgICAgICAgICAgIGlmKGJhY2tfY29kZS5sZW5ndGg+MjApe1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHB1dFZhcignaG91c2UudXBsb2FkX2NvZGUnLGJhY2tfY29kZSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgcmVmcmVzaFBhZ2UodHJ1ZSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuICd0b2FzdDovL+a6kOeggeW3suiOt+WPlizlubbpg6jliIbmj5LlhaXliLDmlofmnKzljLrln58nXFxuICAgICAgICAgICAgICAgICAgICB9ZWxzZXtcXG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gJ3RvYXN0Oi8v6ZSZ6K+v77yM5pys5qyh6I635Y+W5Yiw56m65paH5pys77yM55aR5Ly85L2g5rKh5pyJ5q2k5paH5Lu2ISc7XFxuICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgIH0pO1xcbiAgICAgICAgICAgICAgICAqL1xcbiAgICAgICAgICAgICAgICBsZXQgYmFja19jb2RlID0gZ2V0SXRlbSgnaG91c2UuZmlsZV91YScpPT09J+eUteiEkSc/ZmV0Y2god2ViX3VybCxwYXJhbXMpOnJlcXVlc3Qod2ViX3VybCxwYXJhbXMpO1xcbiAgICAgICAgICAgICAgICBpZihiYWNrX2NvZGUubGVuZ3RoPjIwKXtcXG4gICAgICAgICAgICAgICAgICAgIHB1dFZhcignaG91c2UudXBsb2FkX2NvZGUnLGJhY2tfY29kZSk7XFxuICAgICAgICAgICAgICAgICAgICByZWZyZXNoUGFnZSh0cnVlKTtcXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiAndG9hc3Q6Ly/mupDnoIHlt7Lojrflj5Ys5bm26YOo5YiG5o+S5YWl5Yiw5paH5pys5Yy65Z+fJ1xcbiAgICAgICAgICAgICAgICB9ZWxzZXtcXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiAndG9hc3Q6Ly/plJnor6/vvIzmnKzmrKHojrflj5bliLDnqbrmlofmnKzvvIznlpHkvLzkvaDmsqHmnInmraTmlofku7YhJztcXG4gICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIH1jYXRjaCAoZSkge1xcbiAgICAgICAgICAgICAgICBsb2coZS5tZXNzYWdlKTtcXG4gICAgICAgICAgICAgICAgcmV0dXJuICd0b2FzdDovL+WPkeeUn+S6humUmeivrzpcXFxcbicrZS5tZXNzYWdlO1xcbiAgICAgICAgICAgIH1cXG4gICAgICAgIH1lbHNlIGlmKC/kuLvpopjvv6V85YWD57Sg77+lLy50ZXN0KGlucHV0KSl7XFxuICAgICAgICAgICAgbG9nKCfkuLvpopjpk77mjqUnKTtcXG4gICAgICAgICAgICBsZXQgd2ViX3VybF9hcnIgPSBpbnB1dC5zcGxpdCgn77+lJyk7XFxuICAgICAgICAgICAgbGV0IHdlYl91cmwgPSB3ZWJfdXJsX2Fyclt3ZWJfdXJsX2Fyci5sZW5ndGgtMV07XFxuICAgICAgICAgICAgbGV0IGJhY2tfY29kZSA9IHBhcnNlUGFzdGUod2ViX3VybCk7XFxuICAgICAgICAgICAgaWYoYmFja19jb2RlLmxlbmd0aD4yMCkge1xcbiAgICAgICAgICAgICAgICBwdXRWYXIoJ2hvdXNlLnVwbG9hZF9jb2RlJyxiYWNrX2NvZGUpO1xcbiAgICAgICAgICAgICAgICByZWZyZXNoUGFnZSh0cnVlKTtcXG4gICAgICAgICAgICAgICAgcmV0dXJuICd0b2FzdDovL+a6kOeggeW3suiOt+WPlizlubbpg6jliIbmj5LlhaXliLDmlofmnKzljLrln58nXFxuICAgICAgICAgICAgfWVsc2V7XFxuICAgICAgICAgICAgICAgIHJldHVybiAndG9hc3Q6Ly/plJnor6/vvIzmnKzmrKHojrflj5bov5Tlm57kuLo6XFxcXG4nK2JhY2tfY29kZTtcXG4gICAgICAgICAgICB9XFxuICAgICAgICB9ZWxzZXtcXG4gICAgICAgICAgICByZXR1cm4gJ3RvYXN0Oi8v6Z2e5rOV6ZO+5o6lOlxcXFxuJytnZXRWYXIoJ2hvdXNlLndlYl91cmwnKTtcXG4gICAgICAgIH1cXG4gICAgfSksXFxuICAgIGNvbF90eXBlOiBcXFwiaW5wdXRcXFwiXFxufSk7XFxuZC5wdXNoKHtcXG4gICAgdGl0bGU6IFxcXCLpgInmi6nmlofku7bot6/lvoRcXFwiLFxcbiAgICB1cmw6JCgnI25vTG9hZGluZyMnKS5sYXp5UnVsZSgoKT0+e1xcbiAgICAgICAgLypcXG4gICAgICAgIGxldCBmcCA9ICdodHRwczovL2dpdGNvZGUubmV0L3FxXzMyMzk0MzUxL2RyLy0vcmF3L21hc3Rlci9qcy9maWxlU2VsZWN0LmpzJztcXG4gICAgICAgIGxldCBmID0gcmVxdWlyZShmcCk7XFxuICAgICAgICAqL1xcbiAgICAgICAgbGV0IGZwPWNvbmZpZy5saWIuZmlsZVNlbGVjdDtcXG4gICAgICAgIGxldCBmPSQucmMoZnApO1xcbiAgICAgICAgcmV0dXJuIGYuZmlsZVNlbGVjdGlvblVyaSh7XFxuICAgICAgICAgICAgY2FsbGJhY2s6ICQudG9TdHJpbmcoKCkgPT4ge1xcbiAgICAgICAgICAgICAgICBsZXQgdGFyZ2V0ID0gZmluZEl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ZpbGU6fF5odHRwOnxeaHR0cHM6fF5cXFxcL3N0b3JhZ2VcXFxcL3xeXFxcXC9zZGNhcmRcXFxcLy8udGVzdCh3ZWJfdXJsKSl7XFxuICAgICAgICAgICAgZmlsZU5hbWUgPSB3ZWJfdXJsLnNwbGl0KCcvJylbd2ViX3VybC5zcGxpdCgnLycpLmxlbmd0aC0xXTtcXG4gICAgICAgIH1lbHNlIGlmKC/kuLvpopjvv6V85YWD57Sg77+lLy50ZXN0KGlucHV0KSl7XFxuICAgICAgICAgICAgbGV0IGJrYXJyID0gdXBfY29kZS5zcGxpdCgn77+lJyk7XFxuICAgICAgICAgICAgaWYoYmthcnIubGVuZ3RoPDMpe1xcbiAgICAgICAgICAgICAgICByZXR1cm4gJ3RvYXN0Oi8v5LqR5Ymq6LS05p2/5YaF5a655pyJ6K+vJ1xcbiAgICAgICAgICAgIH1cXG4gICAgICAgICAgICBzd2l0Y2ggKGJrYXJyWzFdKSB7XFxuICAgICAgICAgICAgICAgIGNhc2UgJ215X2hvbWVfdGhlbWUnOlxcbiAgICAgICAgICAgICAgICAgICAgZmlsZU5hbWUgPSB1cF9jb2RlLnNwbGl0KCfjgIwnKVsxXS5zcGxpdCgn44CNJylbMF07XFxuICAgICAgICAgICAgICAgICAgICBicmVhaztcXG4gICAgICAgICAgICAgICAgY2FzZSAnbXlfaG9tZV9zaW5nbGUnOlxcbiAgICAgICAgICAgICAgICAgICAgZmlsZU5hbWUgPSB1cF9jb2RlLnNwbGl0KCfjgIwnKVsxXS5zcGxpdCgn44CNJylbMF07XFxuICAgICAgICAgICAgICAgICAgICBicmVhaztcXG4gICAgICAgICAgICAgICAgY2FzZSAnanNfdXJsJzpcXG4gICAgICAgICAgICAgICAgICAgIGZpbGVOYW1lID0gdXBfY29kZS5zcGxpdCgn77+lJylbMl0uc3BsaXQoJ0AnKVswXTtcXG4gICAgICAgICAgICAgICAgICAgIGJyZWFrO1xcbiAgICAgICAgICAgIH1cXG4gICAgICAgIH1lbHNle1x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v5pyJ5LqM57qnXFxuICAgIG9ubHliYWNrPW9ubHliYWNrfHxmYWxzZTsvL+WPqui/lOWbnuaVsOaNrlxcbiAgICBodG1sID0gaHRtbHx8Z2V0UmVzQ29kZSgpO1xcbiAgICBodG1sID0gdHlwZW9mKGh0bWwpPT09J3N0cmluZyc/aHRtbDpodG1sLmh0bWw7XFxuICAgIHJldHVybiAkLnRvU3RyaW5nKChwYXJTdHIsZWosb25seWJhY2ssaHRtbCxpc1BpYyk9PntcXG4gICAgICAgIGxldCB0PXBhclN0ci5zcGxpdChcXFwiO1xcXCIpO1xcbiAgICAgICAgbGV0IGQ9W107XFxuICAgICAgICAvLyBsZXQgbGlzdD1wZGZhKGdldFJlc0NvZGUoKSx0WzBdKTtcXG4gICAgICAgIGxldCBsaXN0PXBkZmEoaHRtbCx0WzBdKTtcXG4gICAgICAgIGxldCBsYXp5ID0gJCgnJykubGF6eVJ1bGUoKCk9PntcXG4gICAgICAgICAgICBjb25zdCB7bGF6eVBhcnNlfSA9ICQucmVxdWlyZSgnaGlrZXI6Ly9wYWdlL2dsb2JhbFBhcnNlP3J1bGU96YGT6ZW/5LuT5bqTUHJvJyk7XFxuICAgICAgICAgICAgcmV0dXJuIGxhenlQYXJzZShpbnB1dClcXG4gICAgICAgIH0pO1xcbiAgICAgICAgZm9yKGxldCBpIGluIGxpc3Qpe1xcbiAgICAgICAgICAgIGxldCBfcGljID0gdFsyXT9wZChsaXN0W2ldLHRbMl0pOicnO1xcbiAgICAgICAgICAgIGlmKGlzUGljKF9waWMpJiYhL0BSZWZlcmVyPS8udGVzdChfcGljKSl7XFxuICAgICAgICAgICAgICAgIF9waWMrPSdAUmVmZXJlcj0nXFxuICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIGxldCBpdD17XFxuICAgICAgICAgICAgICAgIHRpdGxlOnBkZmgobGlzdFtpXSx0WzFdKSxcXG4gICAgICAgICAgICAgICAgcGljX3VybDpfcGljLFxcbiAgICAgICAgICAgICAgICBkZXNjOn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ICAgICAgICByZXR1cm4gZmFsc2VcXG4gICAgICAgIH1cXG4gICAgICAgIGZ1bmN0aW9uIHByaW50KHN0cil7XFxuICAgICAgICAgICAgaWYodHlwZW9mKGxvZykhPT0ndW5kZWZpbmVkJyl7XFxuICAgICAgICAgICAgICAgIGxvZyhzdHIpO1xcbiAgICAgICAgICAgIH1lbHNle1xcbiAgICAgICAgICAgICAgICBmYmEubG9nKHN0cik7XFxuICAgICAgICAgICAgfVxcbiAgICAgICAgfVxcbiAgICAgICAgZm9yIChsZXQgZG1Vcmwgb2YgZG1VcmxzKSB7XFxuICAgICAgICAgICAgaWYgKChuZXcgUmVnRXhwKGRtVXJsKSkudGVzdCh2aWRlb1VybCkpIHsvL+aSreaUvuWcsOWdgOWMheWQq+WQiuavm+agh+W/l+eahOWcsOWdgFxcbiAgICAgICAgICAgICAgICBwcmludCgn5ZCK5q+b6KeG6aKRLOiHquWKqOi/h+a7pDonK3ZpZGVvVXJsKTtcXG4gICAgICAgICAgICAgICAgcmV0dXJuIHRydWVcXG4gICAgICAgICAgICB9XFxuICAgICAgICB9XFxuICAgICAgICBwcmludCgn6Z2e5ZCK5q+b6KeG6aKRLOWPr+aSreaUvjonK3ZpZGVvVXJsKTtcXG4gICAgICAgIHJldHVybiBmYWxzZVxcbiAgICB9XFxuXFxuICAgIGZ1bmN0aW9uIGlzRG0ocmV0KSB7XFxuICAgICAgICBpZiAoIXJldCkge1xcbiAgICAgICAgICAgIHJldHVybiB0cnVlXFxuICAgICAgICB9XFxuICAgICAgICByZXR1cm4gaGFzRG0ocmV0LnNwbGl0KCcjJylbMF0uc3BsaXQoJzsnKVswXSwgZG1VcmxzKVxcbiAgICB9XFxuICAgIHJldHVybiBpc0RtKHZpZGVvVXJsKVxcbn1cXG5cXG5mdW5jdGlvbiBsYXp5UGFyc2UocGxheVVybCxtcyx0bSxyZWNoYW5nZSl7XFxuICAgIC8vIGxvZygn6LCD55So5LuT5bqT5YWN5ZeF5o6i5Lyg5Y+C6LaF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c3Qpe1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGV2YWwoZmJhLmdldEludGVybmFsSnMoKSk7XFxuICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgIH1jYXRjaCAoZSkge1xcbiAgICAgICAgICAgICAgICAgICAgZmJhLmxvZyhlLm1lc3NhZ2UpO1xcbiAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgIGZiYS5wdXRWYXIoXFxcIl94NWp4VXJsXFxcIixwbGF5VXJsKTtcXG4gICAgICAgICAgICAgICAgaWYod2luZG93LmNvdW50ID09IG51bGwpe1xcbiAgICAgICAgICAgICAgICAgICAgd2luZG93LmNvdW50PTE7XFxuICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgbGV0IHRleHQ9Jyc7XFxuICAgICAgICAgICAgICAgIHRyeSB7XFxuICAgICAgICAgICAgICAgICAgICB0ZXh0PWRvY3VtZW50LnF1ZXJ5U2VsZWN0b3IoXFxcImJvZHlcXFwiKS5pbm5lclRleHQ7XFxuICAgICAgICAgICAgICAgIH1jYXRjaCAoZSkge2ZiYS5sb2coZS5tZXNzYWdlKX1cXG4gICAgICAgICAgICAgICAgaWYoL+inpuWPkeS6humYsuebl+mTvnzmnKrmjojmnYN85o6l5Y+j6Ziy55uXLy50ZXN0KHRleHQpJiZ3aW5kb3cuY291bnQ9PT0xKXtcXG4gICAgICAgICAgICAgICAgICAgIGZiYS5sb2coXFxcIuajgOa1i+WIsOacieaOiOadg++8jOW8gOWni+i/h+aOiOadg1xcXCIpO1xcbiAgICAgICAgICAgICAgICAgICAgLy9sb2NhdGlvbi5yZWxvYWQoKTtcXG4gICAgICAgICAgICAgICAgICAgIGxvY2F0aW9uLmhyZWY9ZmJhLmdldFZhcihcXFwiX3g1anhVcmxcXFwiKTtcXG4gICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICB3aW5kb3cuY291bnQrKztcXG4gICAgICAgICAgICAgICAgLy8gZmJhLmxvZygnY291bnQ6Jyt3aW5kb3cuY291bnQrJyxtYXhfY291bnQ6JyttYXhfY291bnQpO1xcbiAgICAgICAgICAgICAgICBpZiggd2luZG93LmNvdW50ID49IG1heF9jb3VudCl7XFxuICAgICAgICAgICAgICAgICAgICBmYmEubG9nKFxcXCLotoXov4dcXFwiK21heF9jb3VudCoyNTArXFxcIuavq+enkuacquiOt+WPluWIsOi1hOa6kOWcsOWdgO+8jOi3s+WIsOa6kOe9kemhtSzku6XkuIvmmK/liqDovb3ov4fnmoTlnLDlnYBcXFwiKTtcXG4gICAgICAgICAgICAgICAgICAgIHRyeSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgbGV0IHRleHQ9ZG9jdW1lbnQucXVlcnlTZWxlY3RvcihcXFwiYm9keVxcXCIpLmlubmVyVGV4dDtcXG4gICAgICAgICAgICAgICAgICAgICAgICAvLyBmYmEubG9nKHRleHQpO1xcbiAgICAgICAgICAgICAgICAgICAgfWNhdGNoIChlKSB7ZmJhLmxvZyhlLm1lc3NhZ2UpfVxcbiAgICAgICAgICAgICAgICAgICAgZmJhLmxvZyhKU09OLnN0cmluZ2lmeShfZ2V0VXJscygpKSk7XFxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gZmJhLmdldFZhcihcXFwiX3g1anhVcmxcXFwiKTtcXG4gICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICBmdW5jdGlvbiBtdXRlTWUoZWxlbSkge1xcbiAgICAgICAgICAgICAgICAgICAgdHJ5IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICBlbGVtLnBhdXNlKCk7XFxuICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICBjYXRjaCAoZSkge1xcbiAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgIHZhciB2aWRlb3MgPSBkb2N1bWVudC5xdWVyeVNlbGVjdG9yQWxsKFxcXCJ2aWRlb1xcXCIpLCBhdWRpb3MgPSBkb2N1bWVudC5xdWVyeVNlbGVjdG9yQWxsKFxcXCJhdWRpb1xcXCIpLCB2MiA9IGRvY3VtZW50LnF1ZXJ5U2VsZWN0b3JBbGwoXFxcImVtYmVkXFxcIiksIHYzID0gZG9jdW1lbnQucXVlcnlTZWxlY3RvckFsbChcXFwiI3BsYXllclxcXCIpO1xcbiAgICAgICAgICAgICAgICB0cnkge1xcbiAgICAgICAgICAgICAgICAgICAgW10uZm9yRWFjaC5jYWxsKHZpZGVvcywgZnVuY3Rpb24gKHZpZGVvKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgbXV0ZU1lKHZpZGVvKTtcXG4gICAgICAgICAgICAgICAgICAgIH0pO1xcbiAgICAgICAgICAgICAgICB9IGNhdGNoIChlKSB7fVxcbiAgICAgICAgICAgICAgICB0cnkge1xcbiAgICAgICAgICAgICAgICAgICAgW10uZm9yRWFjaC5jYWxsKGF1ZGlvcywgZnVuY3Rpb24gKGF1ZGlvKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgbXV0ZU1lKGF1ZGlvKTtcXG4gICAgICAgICAgICAgICAgICAgIH0pO1xcbiAgICAgICAgICAgICAgICB9IGNhdGNoIChlKSB7fVxcbiAgICAgICAgICAgICAgICB0cnkge1xcbiAgICAgICAgICAgICAgICAgICAgW10uZm9yRWFjaC5jYWxsKHYyLCBmdW5jdGlvbiAodikge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIG11dGVNZSh2KTtcXG4gICAgICAgICAgICAgICAgICAgIH0pO1xcbiAgICAgICAgICAgICAgICB9IGNhdGNoIChlKSB7fVxcbiAgICAgICAgICAgICAgICB0cnkge1xcbiAgICAgICAgICAgICAgICAgICAgW10uZm9yRWFjaC5jYWxsKHYzLCBmdW5jdGlvbiAodikge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIG11dGVNZSh2KTtcXG4gICAgICAgICAgICAgICAgICAgIH0pO1xcbiAgICAgICAgICAgICAgICB9IGNhdGNoIChlKSB7fVxcbiAgICAgICAgICAgICAgICB2YXIgdXJscyA9IF9nZXRVcmxzKCk7XFxuICAgICAgICAgICAgICAgIC8vIGZiYS5sb2coSlNPTi5zdHJpbmdpZnkodXJscykpO1xcbiAgICAgICAgICAgICAgICB0cnkge1xcbiAgICAgICAgICAgICAgICAgICAgZm9yKGxldCBpIGluIHVybHMpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICBsZXQgdT11cmxzW2ldO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHRyeXt1PWRlY29kZVVSSUNvbXBvbmVudCh1KTt9Y2F0Y2goZSl7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHU9dW5lc2NhcGUodSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgICAgIC8vXFxuICAgICAgICAgICAgICAgICAgICAgICAgaWYoL3VybD1odHRwLy50ZXN0KHUpKXtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdSA9IHUuc3BsaXQoXFxcInVybD1cXFwiKS5zbGljZSgtMSlbMF07XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vIGZiYS5sb2coXFxcInVybOWIhuWJsjpcXFwiK3UpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIH1lbHNlIGlmKC91cmw9XFxcXC8vLnRlc3QodSkmJi9cXFxcLm0zdTgvLnRlc3QodSkpe1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBsZXQgaG9zdCA9IHUubWF0Y2goLyguKilcXFxcL1xcXFwvKC4qPylcXFxcLy8pWzBdO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB1ID0gaG9zdCt1LnNwbGl0KFxcXCJ1cmw9XFxcIikuc2xpY2UoLTEpWzBdO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyBmYmEubG9nKFxcXCJ1cmzliIblibI6XFxcIit1KTtcXG4gICAgICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICAgICAgZWxzZSBpZigvdmlkPWh0dHAvLnRlc3QodSkpe1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB1ID0gdS5zcGxpdChcXFwidmlkPVxcXCIpLnNsaWNlKC0xKVswXTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgZmJhLmxvZyhcXFwidmlk5YiG5YmyOlxcXCIrdSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgfWVsc2UgaWYoL3ZpZD1cXFxcLy8udGVzdCh1KSYmL1xcXFwubTN1OC8udGVzdCh1KSl7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxldCBob3N0ID0gdS5tYXRjaCgvKC4qKVxcXFwvXFxcXC8oLio/KVxcXFwvLylbMF07XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHUgPSBob3N0K3Uuc3BsaXQoXFxcInZpZD1cXFwiKS5zbGljZSgtMSlbMF07XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZiYS5sb2coXFxcInZpZOWIhuWJsjpcXFwiK3UpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgICAgICBlbHNlIGlmKC9cXFxcPyguKik9aHR0cC8udGVzdCh1KSYmL1xcXFwubTN1OC8udGVzdCh1KSl7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHUgPSBcXFwiaHR0cFxcXCIrdS5zcGxpdCgvXFxcXD8oLiopPWh0dHAvKS5zbGljZSgtMSlbMF07XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZiYS5sb2coXFxcIuWFtuS7luWIhuWJsjpcXFwiK3UpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgICAgICAvL3xpbmRleFxcXFwubTN1OCRcXG4gICAgICAgICAgICAgICAgICAgICAgICBlbHNlIGlmKC9cXFxcLzFcXFxcLm0zdTgvLnRlc3QodSkpe1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb250aW51ZTtcXG4gICAgICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICAgICAgdT11LnJlcGxhY2UoLyZmcm9tPS4qfCZuZXh0PS4qfCZqdW1wPS4qLywnJyk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgbGV0IHJlYWxVcmwgPSBpc1ZpZGVvKHUscmVjaGFuZ2UpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmKHR5cGVvZihyZWFsVXJsKT09J3N0cmluZycmJiFpc0JhZFZpZGVvKHUpKXsvL+i/h+a7pOWQiuavm+inhumikVxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAvL2Z5X2JyaWRnZV9hcHAuc2V0V2ViVWEoUENfVUEpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZih0eXBlb2YoZmJhLmdldEhlYWRlclVybCkhPT0ndW5kZWZpbmVkJyYmdHlwZW9mKHJlY2hhbmdlKSE9PSdmdW5jdGlvbicpe1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gbGV0IGJhY2tVcmwgPSBmYmEuZ2V0SGVhZGVyVXJsKHUucmVwbGFjZShcXFwiO3tcXFwiLFxcXCIjaXNWaWRlbz10cnVlIzt7XFxcIikpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbGV0IGJhY2tVcmwgPSBmYmEuZ2V0SGVhZGVyVXJsKHVybHNbaV0pLnJlcGxhY2UoJzt7JywnI2lnbm9yZUltZz10cnVlIyNpc1ZpZGVvPXRydWUjO3snKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxldCB1MSA9IGJhY2tVcmwuc3BsaXQoJyNpZ25vcmVJbWcnKVswXTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxldCB1MiA9ICcjaWdub3JlSW1nJytiYWNrVXJsLnNwbGl0KCcjaWdub3JlSW1nJylbMV07XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB1MSA9IHUxLnJlcGxhY2UoLyZmcm9tPS4qfCZuZXh0PS4qfCZqdW1wPS4qLywnJyk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZigvdXJsPWh0dHAvLnRlc3QodTEpKXtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB1MSA9IHUxLnNwbGl0KFxcXCJ1cmw9XFxcIikuc2xpY2UoLTEpWzBdO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfWVsc2UgaWYoL3VybD1cXFxcLy8udGVzdCh1MSkmJi9cXFxcLm0zdTgvLnRlc3QodTEpKXtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBsZXQgaG9zdDEgPSB1MS5tYXRjaCgvKC4qKVxcXFwvXFxcXC8oLio/KVxcXFwvLylbMF07XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdTEgPSBob3N0MSt1MS5zcGxpdChcXFwidXJsPVxcXCIpLnNsaWNlKC0xKVswXTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyBmYmEubG9nKFxcXCJ1cmzliIblibI6XFxcIit1KTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGVsc2UgaWYoL3ZpZD1odHRwLy50ZXN0KHUxKSl7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdTEgPSB1MS5zcGxpdChcXFwidmlkPVxcXCIpLnNsaWNlKC0xKVswXTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1lbHNlIGlmKC92aWQ9XFxcXC8vLnRlc3QodTEpJiYvXFxcXC5tM3U4Ly50ZXN0KHUxKSl7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbGV0IGhvc3QxID0gdTEubWF0Y2goLyguKilcXFxcL1xcXFwvKC4qPylcXFxcLy8pWzBdO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHUxID0gaG9zdDErdTEuc3BsaXQoXFxcInZpZD1cXFwiKS5zbGljZSgtMSlbMF07XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBlbHNlIGlmKC9cXFxcPyguKik9aHR0cC8udGVzdCh1MSkmJi9cXFxcLm0zdTgvLnRlc3QodTEpKXtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB1MSA9IFxcXCJodHRwXFxcIit1MS5zcGxpdCgvXFxcXD8oLiopPWh0dHAvKS5zbGljZSgtMSlbMF07XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBiYWNrVXJsID0gdTEgKyB1MjtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vIGZiYS5sb2coJ+i/lOWbnuiHquWKqOWKoGNvb2tpZemTvuaOpTonK2JhY2tVcmwpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZmJhLmxvZygn6L+U5Zue6ZO+5o6lOicrdSsn5bm26Ieq5Yqo5Yqg5LqGY29va2llLOWFt+S9k2Nvb2tpZeWcqOinhumikeaSreaUvuWkhOafpeeciycpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGJhY2tVcmw7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgZWxzZXtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZiYS5sb2coXFxcIui/lOWbnuS7k+W6k3g15YWN5ZeF57uT5p6cOlxcXCIrcmVhbFVybCk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gcmVhbFVybFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICB9Y2F0Y2ggKGUpIHtcXG4gICAgICAgICAgICAgICAgICAgIGZiYS5sb2coZS5tZXNzYWdlKVxcbiAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgfWNhdGNoIChlKSB7XFxuICAgICAgICAgICAgICAgIC8vIGZ5X2JyaWRnZV9hcHAubG9nKCd4NeWkp+iMg+WbtOmUmeivrzonK2UubWVzc2FnZSk7XFxuICAgICAgICAgICAgICAgIGFsZXJ0KCd4NeWkp+iMg+WbtOmUmeivrzonK2UubWVzc2FnZSk7XFxuICAgICAgICAgICAgICAgIHJldHVybiAndG9hc3Q6Ly/miqXplJnnu5PmnZ94NSdcXG4gICAgICAgICAgICB9XFxuICAgICAgICB9LGlzVmlkZW8scmVjaGFuZ2UscGxheVVybCxtYXhfY291bnQsUENfVUEsaXNCYWRWaWRlbyk7XFxuICAgICAgICBsZXQgdXNlV2ViPWxzZy5nZXRJdGVtKFxcXCLpgJrlhY1cXFwiLFxcXCJYNVxcXCIpPT09XFxcIldFQlxcXCI7XFxuICAgICAgICAvL2xvZyhcXFwi5LuT5bqT5L2/55Sod2Vi6YCa5YWN5pu/5LujeDU6XFxcIit1c2VXZWIpO1xcbiAgICAgICAgbGV0IHJ1bGVIZWFkPXVzZVdlYiYmcGFyc2VJbnQoZ2V0QXBwVmVyc2lvbigpKT49MjMzOT9cXFwid2ViUnVsZTovL1xcXCI6XFxcIng1UnVsZTovL1xcXCI7XFxuICAgICAgICBsZXQgeDVVcmwgPSBydWxlSGVhZCtwbGF5VXJsKyAnQCcgK194NTtcXG4gICAgICAgIHJldHVybiB4NVVybFxcbiAgICB9XFxufVxcblxcbmZ1bmN0aW9uIHg1UGFyc2VQcm8oeDVsaXN0LHg1VGltZW91dCxpc1ZpZGVvKXtcXG4gICAgbGV0IGJwYXRoID0g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ZXQgX3g1ID0gJC50b1N0cmluZygoaXNWaWRlbywgbWF4X2NvdW50LHg1VGltZW91dCxpc0JhZFZpZGVvKSA9PiB7XFxuICAgICAgICAvL+WIneWni+WMlmZiYeWSjHJlcXVzdFxcbiAgICAgICAgaWYgKHR5cGVvZiAoZmJhKSA9PSAndW5kZWZpbmVkJyB8fCAhZmJhKSB7XFxuICAgICAgICAgICAgdmFyIGZiYSA9IGZ5X2JyaWRnZV9hcHA7XFxuICAgICAgICB9XFxuICAgICAgICB0cnkge1xcbiAgICAgICAgICAgIGlmICh0eXBlb2YgKHJlcXVlc3QpID09ICd1bmRlZmluZWQnIHx8ICFyZXF1ZXN0KSB7XFxuICAgICAgICAgICAgICAgIGV2YWwoZmJhLmdldEludGVybmFsSnMoKSk7XFxuICAgICAgICAgICAgfVxcbiAgICAgICAgfSBjYXRjaCAoZSkge1xcbiAgICAgICAgICAgIGZiYS5sb2coZS5tZXNzYWdlKTtcXG4gICAgICAgIH1cXG4gICAgICAgIC8vLS0tLS0tLS0tLS0tLS0tLS0tXFxuICAgICAgICB0cnkge1xcbiAgICAgICAgICAgIGlmICh3aW5kb3cuY291bnQgPT0gbnVsbCkge1xcbiAgICAgICAgICAgICAgICB3aW5kb3cuY291bnQgPSAxO1xcbiAgICAgICAgICAgIH1cXG4gICAgICAgICAgICBsZXQgdGV4dD0nJztcXG4gICAgICAgICAgICB0cnkge1xcbiAgICAgICAgICAgICAgICB0ZXh0PWRvY3VtZW50LnF1ZXJ5U2VsZWN0b3IoXFxcImJvZHlcXFwiKS5pbm5lclRleHQ7XFxuICAgICAgICAgICAgfWNhdGNoIChlKSB7ZmJhLmxvZyhlLm1lc3NhZ2UpfVxcbiAgICAgICAgICAgIGlmKC/op6blj5HkuobpmLLnm5fpk7585pyq5o6I5p2DfOaOpeWPo+mYsuebly8udGVzdCh0ZXh0KSYmd2luZG93LmNvdW50PT0xKXtcXG4gICAgICAgICAgICAgICAgbG9jYXRpb24ucmVsb2FkKCk7XFxuICAgICAgICAgICAgICAgIGZiYS5sb2coXFxcIuajgOa1i+WIsOacieaOiOadg++8jOW8gOWni+i/h+aOiOadg1xcXCIpO1xcbiAgICAgICAgICAgIH1cXG4gICAgICAgICAgICB3aW5kb3cuY291bnQrKztcXG4gICAgICAgICAgICAvLyBmYmEubG9nKCdjb3VudDonICsgd2luZG93LmNvdW50ICsgJyxtYXhfY291bnQ6JyArIG1heF9jb3VudCk7XFxuICAgICAgICAgICAgaWYgKHdpbmRvdy5jb3VudCA+PSBtYXhfY291bnQpIHtcXG4gICAgICAgICAgICAgICAgZmJhLmNsZWFyVmFyKCd4NUxpc3QnKTtcXG4gICAgICAgICAgICAgICAgZmJhLmhpZGVMb2FkaW5nKCk7XFxuICAgICAgICAgICAgICAgIGxldCBmbXNnID0gJ+mBk+mVv+S7k+W6k+mAmuWFjeino+aekOWksei0pSzljp/lm6A66LaF5pe2Jyt4NVRpbWVvdXQrJ+avq+enkic7XFxuICAgICAgICAgICAgICAgIGZiYS5sb2coZm1zZyk7XFxuICAgICAgICAgICAgICAgIHJldHVybiAndG9hc3Q6Ly8nK2Ztc2c7XFxuICAgICAgICAgICAgfVxcbiAgICAgICAgfWNhdGNoIChlKSB7XFxuICAgICAgICAgICAgZmJhLmxvZyhlLm1lc3NhZ2UpO1xcbiAgICAgICAgfVxcblxcbiAgICAgICAgZnVuY3Rpb24gbXV0ZU1lKGVsZW0pIHtcXG4gICAgICAgICAgICB0cnkge1xcbiAgICAgICAgICAgICAgICBlbGVtLnBhdXNlKCk7XFxuICAgICAgICAgICAgfSBjYXRjaCAoZSkge1xcbiAgICAgICAgICAgIH1cXG4gICAgICAgIH1cXG5cXG4gICAgICAgIHZhciB2aWRlb3MgPSBkb2N1bWVudC5xdWVyeVNlbGVjdG9yQWxsKFxcXCJ2aWRlb1xcXCIpLCBhdWRpb3MgPSBkb2N1bWVudC5xdWVyeVNlbGVjdG9yQWxsKFxcXCJhdWRpb1xcXCIpLFxcbiAgICAgICAgICAgIHYyID0gZG9jdW1lbnQucXVlcnlTZWxlY3RvckFsbChcXFwiZW1iZWRcXFwiKSwgdjMgPSBkb2N1bWVudC5xdWVyeVNlbGVjdG9yQWxsKFxcXCIjcGxheWVyXFxcIik7XFxuICAgICAgICB0cnkge1xcbiAgICAgICAgICAgIFtdLmZvckVhY2guY2FsbCh2aWRlb3MsIGZ1bmN0aW9uICh2aWRlbykge1xcbiAgICAgICAgICAgICAgICBtdXRlTWUodmlkZW8pO1xcbiAgICAgICAgICAgIH0pO1xcbiAgICAgICAgfSBjYXRjaCAoZSkge1xcbiAgICAgICAgfVxcbiAgICAgICAgdHJ5IHtcXG4gICAgICAgICAgICBbXS5mb3JFYWNoLmNhbGwoYXVkaW9zLCBmdW5jdGlvbiAoYXVkaW8pIHtcXG4gICAgICAgICAgICAgICAgbXV0ZU1lKGF1ZGlvKTtcXG4gICAgICAgICAgICB9KTtcXG4gICAgICAgIH0gY2F0Y2ggKGUpIHtcXG4gICAgICAgIH1cXG4gICAgICAgIHRyeSB7XFxuICAgICAgICAgICAgW10uZm9yRWFjaC5jYWxsKHYyLCBmdW5jdGlvbiAodikge1xcbiAgICAgICAgICAgICAgICBtdXRlTWUodik7XFxuICAgICAgICAgICAgfSk7XFxuICAgICAgICB9IGNhdGNoIChlKSB7XFxuICAgICAgICB9XFxuICAgICAgICB0cnkge1xcbiAgICAgICAgICAgIFtdLmZvckVhY2guY2FsbCh2MywgZnVuY3Rpb24gKHYpIHtcXG4gICAgICAgICAgICAgICAgbXV0ZU1lKHYpO1xcbiAgICAgICAgICAgIH0pO1xcbiAgICAgICAgfSBjYXRjaCAoZSkge1xcbiAgICAgICAgfVxcbiAgICAgICAgdmFyIHVybHMgPSBfZ2V0VXJscygpO1xcbiAgICAgICAgdHJ5IHtcXG4gICAgICAgICAgICBmb3IgKGxldCBpIGluIHVybHMpIHtcXG4gICAgICAgICAgICAgICAgbGV0IHU9dXJsc1tpXTtcXG4gICAgICAgICAgICAgICAgLy91PWRlY29kZVVSSUNvbXBvbmVudCh1KTtcXG4gICAgICAgICAgICAgICAgdHJ5e3U9ZGVjb2RlVVJJQ29tcG9uZW50KHUpO31jYXRjaChlKXtcXG4gICAgICAgICAgICAgICAgICAgIHU9dW5lc2NhcGUodSk7XFxuICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgaWYoL3VybD1odHRwLy50ZXN0KHUpKXtcXG4gICAgICAgICAgICAgICAgICAgIHUgPSB1LnNwbGl0KFxcXCJ1cmw9XFxcIikuc2xpY2UoLTEpWzBdO1xcbiAgICAgICAgICAgICAgICB9ZWxzZSBpZigvdmlkPWh0dHAvLnRlc3QodSkpe1xcbiAgICAgICAgICAgICAgICAgICAgdSA9IHUuc3BsaXQoXFxcInZpZD1cXFwiKS5zbGljZSgtMSlbMF07XFxuICAgICAgICAgICAgICAgIH1lbHNlIGlmKC9cXFxcPyguKik9aHR0cC8udGVzdCh1KSl7XFxuICAgICAgICAgICAgICAgICAgICB1ID0gXFxcImh0dHBcXFwiK3Uuc3BsaXQoL1xcXFw/KC4qKT1odHRwLykuc2xpY2UoLTEpWzBdO1xcbiAgICAgICAgICAgICAgICAgICAgLy9mYmEubG9nKFxcXCLlhbbku5bliIblibI6XFxcIit1KTtcXG4gICAgICAgICAgICAgICAgfWVsc2UgaWYoL1xcXFwvMVxcXFwubTN1OCQvLnRlc3QodSkpe1xcbiAgICAgICAgICAgICAgICAgICAgY29udGludWU7XFxuICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgdT11LnJlcGxhY2UoLyZmcm9tPS4qfCZuZXh0PS4qfCZqdW1wPS4qLywnJyk7XFxuICAgICAgICAgICAgICAgIGxldCByZWFsVXJsID0gaXNWaWRlbyh1KTtcXG4gICAgICAgICAgICAgICAgaWYgKHJlYWxVcmwmJiFpc0JhZFZpZGVvKHUpKSB7Ly/ov4fmu6TlkIrmr5tcXG4gICAgICAgICAgICAgICAgICAgIGZiYS5sb2coXFxcIuS7k+W6k3g15YWN5ZeF57uT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bmd0aCsn5Liq5Zyw5Z2A55qE5om56YeP5ZeF5o6iOicrcGxheVVybExpc3QpO1xcbiAgICBsb2coJ+W8gOWni+aJp+ihjCcrcGxheVVybExpc3QubGVuZ3RoKyfkuKrlnLDlnYDnmoTmibnph4/ll4XmjqInKTtcXG4gICAgbGV0IHBsYXlVcmxzID0gcGxheVVybExpc3QubWFwKChpdCk9PntcXG4gICAgICAgIHJldHVybiB7XFxuICAgICAgICAgICAgdXJsOml0LnNwbGl0KFxcXCI7XFxcIilbMF0sXFxuICAgICAgICAgICAgb3B0aW9uczoge1xcbiAgICAgICAgICAgICAgICBoZWFkZXJzOiB7XFxuICAgICAgICAgICAgICAgICAgICAvL1xcXCJVc2VyLUFnZW50XFxcIjogXFxcIkRhcnQvMi4xMyAoZGFydDppbylcXFwiLFxcbiAgICAgICAgICAgICAgICAgICAgXFxcIlVzZXItQWdlbnRcXFwiOlxcXCJNb3ppbGxhLzUuMFxcXCJcXG4gICAgICAgICAgICAgICAgfSxcXG4gICAgICAgICAgICAgICAgdGltZW91dDogZ2V0VGltZW91dFxcbiAgICAgICAgICAgIH1cXG4gICAgICAgIH1cXG4gICAgfSk7XFxuICAgIGxldCBiaHRtbCA9IGJhdGNoRmV0Y2gocGxheVVybHMpO1xcbiAgICBsZXQgdmlkZW9zID0gW107XFxuICAgIGxldCB4NWxpc3QgPSBbXTtcXG4gICAgZm9yKGxldCBpIGluIGJodG1sKXtcXG4gICAgICAgIGxldCBvcmRlciA9IHBhcnNlSW50KGkpKzE7XFxuICAgICAgICBsZXQgdG5hbWU9b3JkZXIrJ+WPt+ino+aekOe9keWdgDonO1xcbiAgICAgICAgLy9sb2codG5hbWUpO1xcbiAgICAgICAgbGV0IHR1cmw9cGxheVVybExpc3RbaV0uc3BsaXQoXFxcIjtcXFwiKVswXTtcXG4gICAgICAgIGxldCBqbmFtZT1wbGF5VXJsTGlzdFtpXS5zcGxpdChcXFwiO1xcXCIpLmxlbmd0aD4xP3BsYXlVcmxMaXN0W2ldLnNwbGl0KFxcXCI7XFxcIilbMV06XFxcIlxcXCI7XFxuICAgICAgICB0bmFtZSs9am5hbWU7XFxuICAgICAgICBsZXQgYmFja2NvZGUgPSBiaHRtbFtpXTtcXG4gICAgICAgIGlmKCghL3VybHxodHRwLy50ZXN0KGJhY2tjb2RlKSkmJighLyNFWFRJTkYvLnRlc3QoYmFja2NvZGUpKSl7XFxuICAgICAgICAgICAgbG9nKHRuYW1lK3R1cmwrJ+aciemXrumimCzlj6/og73liqDlr4bmiJbogIXmjILkuoYnKTtcXG4gICAgICAgICAgICBjb250aW51ZTtcXG4gICAgICAgIH1lbHNlIGlmKC8jRVhUSU5GLy50ZXN0KGJhY2tjb2RlKSl7XFxuICAgICAgICAgICAgLy9sZXQgbGNhY2hlPVxcXCIvc3RvcmFnZS9lbXVsYXRlZC8wL0FuZHJvaWQvZGF0YS9jb20uZXhhbXBsZS5oaWtlcnZpZXcvZmlsZXMvRG9jdW1lbnRzL2NhY2hlL3ZpZGVvX1xcXCIrdG5hbWUrXFxcIi5tM3U4XFxcIjtcXG4gICAgICAgICAgICAvL3dyaXRlRmlsZShsY2FjaGUsYmFja2NvZGUpO1xcbiAgICAgICAgICAgIC8vdmlkZW9zLnB1c2gobGNhY2hlKTtcXG4gICAgICAgICAgICBsZXQgcFVybD1jYWNoZU0zdTgodHVybCk7XFxuICAgICAgICAgICAgdmlkZW9zLnB1c2gocFVybCk7XFxuICAgICAgICAgICAgY29udGludWU7XFxuICAgICAgICB9XFxuICAgICAgICB0cnkge1xcbiAgICAgICAgICAgIGxldCB1cmwgPSBKU09OLnBhcnNlKGJhY2tjb2RlKS51cmw7XFxuICAgICAgICAgICAgaWYoL15odHRwLy50ZXN0KHVybCkpe1xcbiAgICAgICAgICAgICAgICBsZXQgcmVhbFZpZGVvID0gaXNWaWRlbyh1cmwpO1xcbiAgICAgICAgICAgICAgICBpZih0eXBlb2YocmVhbFZpZGVvKT09J3N0cmluZycpe1xcbiAgICAgICAgICAgICAgICAgICAgbG9nKHRuYW1lKyflt7Lop6PmnpDlh7rop4bpopE6JytyZWFsVmlkZW8pO1xcbiAgICAgICAgICAgICAgICAgICAgaWYoam5hbWUpe1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHJlYWxWaWRlbys9XFxcIuKYhVxcXCIram5hbWVcXG4gICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgIHZpZGVvcy5wdXNoKHJlYWxWaWRlbyk7XFxuICAgICAgICAgICAgICAgIH1lbHNle1xcbiAgICAgICAgICAgICAgICAgICAgbG9nKHRuYW1lKyfop6PmnpDlh7rkuI3nn6XpgZPku4DkuYjkuJzopb86Jyt1cmwpO1xcbiAgICAgICAgICAgICAgICAgICAgdXJsKz1cXFwiI2lzVmlkZW89dHJ1ZSNcXFwiO1xcbiAgICAgICAgICAgICAgICAgICAgaWYoam5hbWUpe1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHVybCs9XFxcIuKYhVxcXCIram5hbWVcXG4gICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgIHZpZGVvcy5wdXNoKHVybCk7XFxuICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICB9ZWxzZXtcXG4gICAgICAgICAgICAgICAgbG9nKHRuYW1lKyfkuLpqc29u5o6l5Y+j5LiU5peg6L+U5Zue6KeG6aKR5Zyw5Z2A5pWw5o2uOicrcGxheVVybExpc3RbaV0rJ1xcXFxuJytiYWNrY29kZSk7XFxuICAgICAgICAgICAgfVxcbiAgICAgICAgfWNhdGNoIChlKSB7XFxuICAgICAgICAgICAgbG9nKHRuYW1lKyfkuLp4NeaOpeWPoyzliqDlhaV4NeWXheaOouWIl+ihqCcpO1xcbiAgICAgICAgICAgIHg1bGlzdC5wdXNoKHBsYXlVcmxMaXN0W2ldKTtcXG4gICAgICAgIH1cXG4gICAgfVxcbiAgICAvLyBsb2codmlkZW9zKTtcXG4gICAgaWYodmlkZW9zLmxlbmd0aD4wKXtcXG4gICAgICAgIGlmKGdldFZhcignZHAuY2FjaGVWaWRlbycsJ3RydWUnKT09PSd0cnVlJyYmcGFyc2VJbnQoZ2V0QXBwVmVyc2lvbigpKT49MjI1NSlcXG4gICAgICAgIHtcXG4gICAgICAgICAgICBsb2coXFxcIuWwiuaVrOeahOmtlOaWreeUqOaIt++8jOinhumikee8k+WtmOW3suWQr+eUqO+8jOivt+WwveaDheS6q+WPl+eci+WJp+aXtuWFiVxcXCIpO1xcbiAgICAgICAgICAgIGxldCB2aWRlb3NDYWNoZT12aWRlb3MubWFwKChpdCk9PntcXG4gICAgICAgICAgICAgICAgbGV0IGhlYWRlcnM9e307XFxuICAgICAgICAgICAgICAgIGlmKGl0LnNwbGl0KFxcXCI7XFxcIikubGVuZ3RoPjEpe1xcbiAgICAgICAgICAgICAgICAgICAgbGV0IGhlYWQgPSBpdC5zcGxpdCgnOycpWzFdO1xcbiAgICAgICAgICAgICAgICAgICAgaWYoL0AvLnRlc3QoaGVhZCkmJi97fH0vLnRlc3QoaGVhZCkpe1xcbi8vaGVhZCA9IGhlYWQucmVwbGFjZSgve3x9L2csJycpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGhlYWQgPSBoZWFkLnNwbGl0KFxcXCJ7XFxcIilbMV0uc3BsaXQoXFxcIn1cXFwiKVswXTtcXG4gICAgICAgICAgICAgICAgICAgICAgICBoZWFkID0gaGVhZC5zcGxpdCgnJiYnKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICBmb3IobGV0IGkgaW4gaGVhZCl7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxldCBrZXkgPSBoZWFkW2ldLnNwbGl0KCdAJylbMF07XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxldCB2YWx1ZSA9aGVhZFtpXS5zcGxpdCgnQCcpWzFdLnJlcGxhY2UoLzsvLCfvvJvvvJsnKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaGVhZGVyc1trZXldID0gdmFsdWU7XFxuICAgICAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgIHJldHVybiB7XFxuICAgICAgICAgICAgICAgICAgICB1cmw6aXQuc3BsaXQoXFxcIjtcXFwiKVswXS5zcGxpdChcXFwi4piFXFxcIilbMF0sXFxuICAgICAgICAgICAgICAgICAgICBvcHRpb25zOntcXG4gICAgICAgICAgICAgICAgICAgICAgICBoZWFkZXJzOmhlYWRlcnNcXG4gICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIH0pO1xcbiAgICAgICAgICAgIHZhciBkYXRhPWJhdGNoQ2FjaGVNM3U4KHZpZGVvc0NhY2hlKTtcXG4gICAgICAgICAgICBkYXRhPWRhdGEubWFwKChpdCxpZCk9PntcXG4gICAgICAgICAgICAgICAgbGV0IGV4dHJhPVxcXCJcXFwiO1xcbiAgICAgICAgICAgICAgICBpZih2aWRlb3NbaWRdLnNwbGl0KFxcXCI7XFxcIikubGVuZ3RoPjEpe1xcbiAgICAgICAgICAgICAgICAgICAgZXh0cmE9XFxcIjtcXFwiK3ZpZGVvc1tpZF0uc3BsaXQoXFxcIjtcXFwiKVsxXTtcXG4gICAgICAgICAgICAgICAgfWVsc2UgaWYodmlkZW9zW2lkXS5zcGxpdChcXFwi4piFXFxcIikubGVuZ3RoPjEpe1xcbiAgICAgICAgICAgICAgICAgICAgZXh0cmE9XFxcIuKYhVxcXCIrdmlkZW9zW2lkXS5zcGxpdChcXFwi4piFXFxcIilbMV07XFxuICAgICAgICAgICAgICAgIH1cXG5cXG4gICAgICAgICAgICAgICAgaWYoaXQrXFxcIlxcXCIhPVxcXCJudWxsXFxcIil7XFxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gaXQrZXh0cmFcXG4gICAgICAgICAgICAgICAgfWVsc2V7XFxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gdmlkZW9zW2lkXVxcbiAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgfSk7XFxuICAgICAgICAgICAgLy9sb2coZGF0YSk7XFxuICAgICAgICAgICAgcmV0dXJuIGRhdGFcXG4gICAgICAgICAgICAvL3JldHVybiB2aWRlb3NcXG4gICAgICAgIH1lbHNle1xcbiAgICAgICAgICAgIHJldHVybiB2aWRlb3NcXG4gICAgICAgIH1cXG4gICAgfVxcbiAgICBsb2coJ+WFseaciScreDVsaXN0Lmxlbmd0aCsn5LiqeDXlnLDlnYDov5vooYzova7mtYHll4XmjqInKTtcXG4gICAgLy/msqHmnInnmoTor53lsLHlvIDlp4vkvp3mrKF4NeWXheaOolxcbiAgICBzaG93TG9hZGluZygn5ZeF5o6i5Lit77yM6Iul5aSx6LSl5bCx5YiH5o2id2Vi5ZeF5o6iLi4uJyk7XFxuICAgIHJldHVybiB4NVBhcnNlUHJvKHg1bGlzdCx4NVRpbWVvdXQsaXNWaWRlbyk7XFxufVxcbnZhciBsYXp5PSQoJycpLmxhenlSdWxlKCgpPT57XFxuICAgIHRyeXtcXG4gICAgICAgIHJlYWxVcmw9aW5wdXQ7XFxuICAgICAgICBldmFsKFxcXCJ2YXIgY29uZmlnX2RwID1cXFwiICsgZmV0Y2goXFxcImhpa2VyOi8vZmlsZXMvY2FjaGUvTXlQYXJzZVNldC5qc29uXFxcIikpO1xcbiAgICAgICAgZXZhbChmZXRjaChjb25maWdfZHAuY2opKTtcXG4gICAgICAgIGxvZyhpbnB1dCsnLT7mraPlnKjmlq3mj5LprZTmlLnniYjop6PmnpAuLi4nKTtcXG4gICAgICAgIC8vIOWKoOWFpei2heaXtuiuvue9ru+8jOW7uuiuruWcqOmmlumhteiuvue9rlxcbiAgICAgICAgcmV0dXJuIGF5dG1QYXJzZShyZWFsVXJsKVxcbiAgICB9Y2F0Y2goZSl7XFxuICAgICAgICByZXR1cm4gaW5wdXRcXG4gICAgfVxcbn0pO1xcbiQuZXhwb3J0cy5pc1BpYz1pc1Bp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ZhbHNlO1xcbiAgICBpZighaG91c2VGaWxlKXtcXG4gICAgICAgIHNldEl0ZW0oJ2lzX2hvdXNlX3ZpcCcsICdmYWxzZScpO1xcbiAgICB9XFxuICAgIGxldCBhcGlfdXJsID0gYXBpLmhvc3QrJy9oaWtlcnVsZS90YXNrL2FkZCc7XFxuICAgIGxldCBob3VzZV9kYXRhID0gaG91c2VGaWxlKCk7XFxuICAgIGxldCByZXN1bHQgPSByZXF1ZXN0KGFwaV91cmwsIHtcXG4gICAgICAgIGhlYWRlcnM6IHtcXG4gICAgICAgICAgICAnY29udGVudC10eXBlJzogJ2FwcGxpY2F0aW9uL2pzb24nXFxuICAgICAgICB9LFxcbiAgICAgICAgYm9keTogSlNPTi5zdHJpbmdpZnkoe1xcbiAgICAgICAgICAgIFxcXCJwYXJhbXNcXFwiOiB7XFxuICAgICAgICAgICAgICAgIFxcXCJkYXRhXFxcIjoge1xcbiAgICAgICAgICAgICAgICAgICAgXFxcIm5hbWVcXFwiOiB0YXNrLm5hbWUsXFxuICAgICAgICAgICAgICAgICAgICBcXFwicHljb2RlXFxcIjogdGFzay5weWNvZGUsXFxuICAgICAgICAgICAgICAgICAgICBcXFwibm90ZVxcXCI6IHRhc2subm90ZSxcXG4gICAgICAgICAgICAgICAgICAgIFxcXCJ0ZXN0X2NvZGVcXFwiOiB0YXNrLnRlc3RfY29kZSxcXG4gICAgICAgICAgICAgICAgfSxcXG4gICAgICAgICAgICAgICAgXFxcImF1dGhcXFwiOiB7XFxuICAgICAgICAgICAgICAgICAgICBcXFwibmFtZVxcXCI6IGhvdXNlX2RhdGEudXNlcm5hbWV8fFxcXCJcXFwiLFxcbiAgICAgICAgICAgICAgICAgICAgXFxcInBhc3N3b3JkXFxcIjogaG91c2VfZGF0YS5wYXNzd29yZHx8XFxcIlxcXCJcXG4gICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIH1cXG4gICAgICAgIH0pLFxcbiAgICAgICAgbWV0aG9kOiAnUE9TVCdcXG4g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FxcImRhdGFcXFwiOiB7XFxcImluZm9cXFwiOiBpbnB1dF90ZXh0fSxcXG4gICAgICAgICAgICAgICAgICAgICAgICBcXFwibmFtZVxcXCI6IGRldl9zZXRfaW5mb1swXSxcXG4gICAgICAgICAgICAgICAgICAgICAgICBcXFwicGFzc3dvcmRcXFwiOiBkZXZfc2V0X2luZm9bMV19XFxuICAgICAgICAgICAgfTtcXG4gICAgICAgICAgICAvLyBsb2coc2VuZF9kYXRhKTtcXG4gICAgICAgICAgICBsZXQgcGFyMiA9IHtoZWFkZXJzOnsnY29udGVudC10eXBlJzonYXBwbGljYXRpb24vanNvbjtjaGFyc2V0PVVURi04JywnVXNlci1BZ2VudCc6ZGV2X3NldF9pbmZvWzNdfSxib2R5OkpTT04uc3RyaW5naWZ5KHNlbmRfZGF0YSksbWV0aG9kOidQT1NUJ307XFxuICAgICAgICAgICAgLy8gcGFyMiA9IEpTT04uc3RyaW5naWZ5KHBhcjIpOyAvL3g16YeM6Z2i6K+35rGC5omN6ZyA6KaB57yW56CBXFxuICAgICAgICAgICAgdHJ5IHtcXG4gICAgICAgICAgICAgICAgbGV0IGJhY2tfcmV0ID0gcmVxdWVzdChpbmZvX3NldF91cmwsIHBhcjIpO1xcbiAgICAgICAgICAgICAgICBiYWNrX3JldCA9IEpTT04ucGFyc2UoYmFja19yZXQpLnJlc3VsdDtcXG4gICAgICAgICAgICAgICAgaWYoYmFja19yZXQuc3RhdHVzPT09MCl7XFxuICAgICAgICAgICAgICAgICAgICAvLyByZWZyZXNoUGFnZSgpO1xcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuICd0b2FzdDovL+S/neWtmOaIkOWKn1xcXFxuJytiYWNrX3JldC5kZXRhaWw7XFxuICAgICAgICAgICAgICAgIH1lbHNle1xcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuICd0b2FzdDovL+S/neWtmOWksei0pVxcXFxuJytiYWNrX3JldC5kZXRhaWw7XFxuICAgICAgICAgICAgICAgIH1cXG4gICAg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cXG4gICAgICAgICAgICBoaWtlckxpYnM6IFxcXCJoaWtlckxpYnMuanNcXFwiLCAvL+a1t+mYlOWFqOiDveS+nei1llxcbiAgICAgICAgfSk7XFxuICAgIH1jYXRjaChlKXtcXG4gICAgICAgIC8vdG9hc3QoJ+ivt+WwneivleeCueWHu+S7k+W6k+S4u+mhteeahOWNh+e6p+S7k+W6k+aXgei+ueeahOaMiemSruWNh+e6pyTmianlsZXvvIzlkKbliJnmn5Dkupvlip/og73kuI3og73mraPluLjkvb/nlKgnKTtcXG4gICAgICAgIGNvbmZpcm0oe1xcbiAgICAgICAgICAgIHRpdGxlOiAn5o+Q56S6LeeCueWHu+ehruWumuWPr+S7peWvvOWFpScsXFxuICAgICAgICAgICAgY29udGVudDogJ+ivt+WwneivleeCueWHu+S7k+W6k+S4u+mhteeahOWNh+e6p+S7k+W6k+aXgei+ueeahOaMiemSruWNh+e6pyTmianlsZXvvIzlkKbliJnmn5Dkupvlip/og73kuI3og73mraPluLjkvb/nlKgnLFxcbiAgICAgICAgICAgIGNvbmZpcm06ICQudG9TdHJpbmcoKCk9PntcXG4gICAgICAgICAgICAgICAgY29uc3Qge2dldEFwaX0gPSAkLnJlcXVpcmUoXFxcImhpa2VyOi8vcGFnZS91dGlsaXk/cnVsZT3pgZPplb/ku5PlupNQcm9cXFwiKTtcXG4gICAgICAgICAgICAgICAgbGV0IHJ1bGVIZWFkID0gJ+a1t+mYlOinhueVjO+8jOe9kemhteaPkuS7tu+/pWpzX3VybO+/pSRoaWtlckAnO1xcbiAgICAgICAgICAgICAgICBsZXQgdXJsID0gZ2V0QXBpKCdpbXBvcnRVcmwnKStcXFwiNTExMVxcXCI7XFxuICAgICAgICAgICAgICAgIGxldCBpbXBvcnRVcmwgPSAncnVsZTovLycrYmFzZTY0RW5jb2RlKHJ1bGVIZWFkK3VybCk7XFxuICAgICAgICAgICAgICAgIHJldHVybiBpbXBvcnRVcmxcXG4gICAgICAgICAgICB9KSxcXG4gICAgICAgICAgICBjYW5jZWw6ICQudG9TdHJpbmcoKCk9PntcXG5cXG4gICAgICAgICAgICB9KSxcXG4gICAgICAgIH0pXFxuICAgIH1cXG59XCJ9LHtcImNvbF90eXBlXCI6XCJtb3ZpZV8zXCIsXCJuYW1lXCI6XCJJbXBvcnTor6bnu4ZcIixcInBhdGhcIjpcInJ1bGVEZXRhaWxJbXBvcnRcIixcInJ1bGVcIjpcImpzOlxcbiQuZXhwb3J0cyA9IFxcXCJoaWtlcjovL3BhZ2UvcnVsZURldGFpbD9ydWxlPemBk+mVv+S7k+W6k1BybyZpZD1cXFwiICsgJC5pbXBvcnRQYXJhbTtcXG5cIn1dIiwiaWNvbiI6Imh0dHBzOi8vbGFubWVpZ3VvamlhbmcuY29tL3R1Ymlhby9vdGhlci8zMC5zdmciLCJwcm94eSI6IiJ9
Add Comment
Please, Sign In to add comment