D3
OG
Old school D3 from simpler times
All examples
By author
By category
About
timelyportfolio
Full window
Github gist
R leaflet htmlwidget with vuejs
See
vueR issue
<!DOCTYPE html> <html> <head> <meta charset="utf-8" /> <script src="data:application/x-javascript;base64,KGZ1bmN0aW9uKCkgew0KICAvLyBJZiB3aW5kb3cuSFRNTFdpZGdldHMgaXMgYWxyZWFkeSBkZWZpbmVkLCB0aGVuIHVzZSBpdDsgb3RoZXJ3aXNlIGNyZWF0ZSBhDQogIC8vIG5ldyBvYmplY3QuIFRoaXMgYWxsb3dzIHByZWNlZGluZyBjb2RlIHRvIHNldCBvcHRpb25zIHRoYXQgYWZmZWN0IHRoZQ0KICAvLyBpbml0aWFsaXphdGlvbiBwcm9jZXNzICh0aG91Z2ggbm9uZSBjdXJyZW50bHkgZXhpc3QpLg0KICB3aW5kb3cuSFRNTFdpZGdldHMgPSB3aW5kb3cuSFRNTFdpZGdldHMgfHwge307DQoNCiAgLy8gU2VlIGlmIHdlJ3JlIHJ1bm5pbmcgaW4gYSB2aWV3ZXIgcGFuZS4gSWYgbm90LCB3ZSdyZSBpbiBhIHdlYiBicm93c2VyLg0KICB2YXIgdmlld2VyTW9kZSA9IHdpbmRvdy5IVE1MV2lkZ2V0cy52aWV3ZXJNb2RlID0NCiAgICAgIC9cYnZpZXdlcl9wYW5lPTFcYi8udGVzdCh3aW5kb3cubG9jYXRpb24pOw0KDQogIC8vIFNlZSBpZiB3ZSdyZSBydW5uaW5nIGluIFNoaW55IG1vZGUuIElmIG5vdCwgaXQncyBhIHN0YXRpYyBkb2N1bWVudC4NCiAgLy8gTm90ZSB0aGF0IHN0YXRpYyB3aWRnZXRzIGNhbiBhcHBlYXIgaW4gYm90aCBTaGlueSBhbmQgc3RhdGljIG1vZGVzLCBidXQNCiAgLy8gb2J2aW91c2x5LCBTaGlueSB3aWRnZXRzIGNhbiBvbmx5IGFwcGVhciBpbiBTaGlueSBhcHBzL2RvY3VtZW50cy4NCiAgdmFyIHNoaW55TW9kZSA9IH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cykgew0KICAgICAgZm9yRWFjaCh0YXNrcywgZnVuY3Rpb24odGFzaykgew0KICAgICAgICB2YXIgdGhlc2VBcmdzID0gYXJnczsNCiAgICAgICAgaWYgKHR5cGVvZih0YXNrKSA9PT0gIm9iamVjdCIpIHsNCiAgICAgICAgICB0aGVzZUFyZ3MgPSB0aGVzZUFyZ3MuY29uY2F0KFt0YXNrLmRhdGFdKTsNCiAgICAgICAgICB0YXNrID0gdGFzay5jb2RlOw0KICAgICAgICB9DQogICAgICAgIHZhciB0YXNrRnVuYyA9IGV2YWwoIigiICsgdGFzayArICIpIik7DQogICAgICAgIGlmICh0eXBlb2YodGFza0Z1bmMpICE9PSAiZnVuY3Rpb24iKSB7DQogICAgICAgICAgdGhyb3cgbmV3IEVycm9yKCJUYXNrIG11c3QgYmUgYSBmdW5jdGlvbiEgU291cmNlOlxuIiArIHRhc2spOw0KICAgICAgICB9DQogICAgICAgIHRhc2tGdW5jLmFwcGx5KHRhcmdldCwgdGhlc2VBcmdzKTsNCiAgICAgIH0pOw0KICAgIH0NCiAgfQ0KDQogIGZ1bmN0aW9uIGluaXRTaXppbmcoZWwpIHsNCiAgICB2YXIgc2l6aW5nID0gc2l6aW5nUG9saWN5KGVsKTsNCiAgICBpZiAoIXNpemluZykNCiAgICAgIHJldHVybjsNCg0KICAgIHZhciBjZWwgPSBkb2N1bWVudC5nZXRFbGVtZW50QnlJZCgiaHRtbHdpZGdldF9jb250YWluZXIiKTsNCiAgICBpZiAoIWNlbCkNCiAgICAgIHJldHVybjsNCg0KICAgIGlmICh0eXBlb2Yoc2l6aW5nLnBhZGRpbmcpICE9PSAidW5kZWZpbmVkIikgew0KICAgICAgZG9jdW1lbnQuYm9keS5zdHlsZS5tYXJnaW4gPSAiMCI7DQogICAgICBkb2N1bWVudC5ib2R5LnN0eWxlLnBhZGRpbmcgPSBwYWRkaW5nVG9Dc3ModW5wYWNrUGFkZGluZyhzaXppbmcucGFkZGluZykpOw0KICAgIH0NCg0KICAgIGlm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bChpbnRJZCk7DQogICAgICAgICAgICAgIHJldHVybjsNCiAgICAgICAgICAgIH0NCiAgICAgICAgICAgIGVycm9yRGl2DQogICAgICAgICAgICAgIC5jc3MoInRvcCIsIGVsLm9mZnNldFRvcCkNCiAgICAgICAgICAgICAgLmNzcygibGVmdCIsIGVsLm9mZnNldExlZnQpDQogICAgICAgICAgICAgIC5jc3MoIm1heFdpZHRoIiwgZWwub2Zmc2V0V2lkdGgpDQogICAgICAgICAgICAgIC5jc3MoImhlaWdodCIsIGVsLm9mZnNldEhlaWdodCk7DQogICAgICAgICAgfSwgNTAwKTsNCiAgICAgICAgfQ0KICAgICAgfQ0KICAgIH0sDQogICAgY2xlYXJFcnJvcjogZnVuY3Rpb24oZWwpIHsNCiAgICAgIHZhciAkZWwgPSAkKGVsKTsNCiAgICAgIHZhciBkaXNwbGF5ID0gJGVsLmRhdGEoInJlc3RvcmUtZGlzcGxheS1tb2RlIik7DQogICAgICAkZWwuZGF0YSgicmVzdG9yZS1kaXNwbGF5LW1vZGUiLCBudWxsKTsNCg0KICAgICAgaWYgKGRpc3BsYXkgPT09ICJpbmxpbmUiIHx8IGRpc3BsYXkgPT09ICJpbmxpbmUtYmxvY2siKSB7DQogICAgICAgIGlmIChkaXNwbGF5KQ0KICAgICAgICAgICRlbC5jc3MoImRpc3BsYXkiLCBkaXNwbGF5KTsNCiAgICAgICAgJChlbC5uZXh0U2libGluZykuZmlsdGVyKCIuaHRtbHdpZGdldHMtZXJyb3IiKS5yZW1vdmUoKTsNCiAgICAgIH0gZWxzZSBpZiAoZGlzcGxheSA9PT0gImJsb2NrIil7DQogICAgICAgICRlbC5jc3MoInZpc2liaWxpdHkiLCAiaW5oZXJpdCIpOw0KICAgICAgICAkKGVsLm5leHRTaWJsaW5nKS5maWx0ZXIoIi5odG1sd2lkZ2V0cy1lcnJvciIpLnJlbW92ZSgpOw0KICAgICAgfQ0KICAgIH0sDQogICAgc2l6aW5nOiB7fQ0KICB9Ow0KDQogIC8vIENh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lIHsNCiAgICAgICAgICAgIGVsLnN0eWxlLnZpc2liaWxpdHkgPSAiaW5oZXJpdCI7DQogICAgICAgICAgfQ0KICAgICAgICB9DQogICAgICAgIGlmICghZWxlbWVudERhdGEoZWwsICJpbml0aWFsaXplZCIpKSB7DQogICAgICAgICAgaW5pdFNpemluZyhlbCk7DQoNCiAgICAgICAgICBlbGVtZW50RGF0YShlbCwgImluaXRpYWxpemVkIiwgdHJ1ZSk7DQogICAgICAgICAgaWYgKGJpbmRpbmdEZWYuaW5pdGlhbGl6ZSkgew0KICAgICAgICAgICAgdmFyIHJlc3VsdCA9IGJpbmRpbmdEZWYuaW5pdGlhbGl6ZShlbCwgZWwub2Zmc2V0V2lkdGgsDQogICAgICAgICAgICAgIGVsLm9mZnNldEhlaWdodCk7DQogICAgICAgICAgICBlbGVtZW50RGF0YShlbCwgImluaXRfcmVzdWx0IiwgcmVzdWx0KTsNCiAgICAgICAgICB9DQogICAgICAgIH0NCiAgICAgICAgU2hpbnkucmVuZGVyRGVwZW5kZW5jaWVzKGRhdGEuZGVwcyk7DQogICAgICAgIGJpbmRpbmdEZWYucmVuZGVyVmFsdWUoZWwsIGRhdGEueCwgZWxlbWVudERhdGEoZWwsICJpbml0X3Jlc3VsdCIpKTsNCiAgICAgICAgZXZhbEFuZFJ1bihkYXRhLmpzSG9va3MucmVuZGVyLCBlbGVtZW50RGF0YShlbCwgImluaXRfcmVzdWx0IiksIFtlbCwgZGF0YS54XSk7DQogICAgICB9Ow0KDQogICAgICAvLyBPbmx5IG92ZXJyaWRlIHJlc2l6ZSBpZiBiaW5kaW5nRGVmIGltcGxlbWVudHMgaXQNCiAgICAgIGlmIChiaW5kaW5nRGVmLnJlc2l6ZSkgew0KICAgICAgICBzaGlueUJpbmRpbmcucmVzaXplID0gZnVuY3Rpb24oZWwsIHdpZHRoLCBoZWlnaHQpIHsNCiAgICAgICAgICAvLyBTaGlueSBjYW4gY2FsbCByZXNpemUgYmVmb3JlIGluaXRpYWxpemUvc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gICB2YXIgYmluZGluZ3MgPSB3aW5kb3cuSFRNTFdpZGdldHMud2lkZ2V0cyB8fCBbXTsNCiAgICBmb3JFYWNoKGJpbmRpbmdzLCBmdW5jdGlvbihiaW5kaW5nKSB7DQogICAgICB2YXIgbWF0Y2hlcyA9IGJpbmRpbmcuZmluZChkb2N1bWVudC5kb2N1bWVudEVsZW1lbnQpOw0KICAgICAgZm9yRWFjaChtYXRjaGVzLCBmdW5jdGlvbihlbCkgew0KICAgICAgICB2YXIgc2l6ZU9iaiA9IGluaXRTaXppbmcoZWwsIGJpbmRpbmcpOw0KDQogICAgICAgIGlmIChoYXNDbGFzcyhlbCwgImh0bWwtd2lkZ2V0LXN0YXRpYy1ib3VuZCIpKQ0KICAgICAgICAgIHJldHVybjsNCiAgICAgICAgZWwuY2xhc3NOYW1lID0gZWwuY2xhc3NOYW1lICsgIiBodG1sLXdpZGdldC1zdGF0aWMtYm91bmQiOw0KDQogICAgICAgIHZhciBpbml0UmVzdWx0Ow0KICAgICAgICBpZiAoYmluZGluZy5pbml0aWFsaXplKSB7DQogICAgICAgICAgaW5pdFJlc3VsdCA9IGJpbmRpbmcuaW5pdGlhbGl6ZShlbCwNCiAgICAgICAgICAgIHNpemVPYmogPyBzaXplT2JqLmdldFdpZHRoKCkgOiBlbC5vZmZzZXRXaWR0aCwNCiAgICAgICAgICAgIHNpemVPYmogPyBzaXplT2JqLmdldEhlaWdodCgpIDogZWwub2Zmc2V0SGVpZ2h0DQogICAgICAgICAgKTsNCiAgICAgICAgICBlbGVtZW50RGF0YShlbCwgImluaXRfcmVzdWx0IiwgaW5pdFJlc3VsdCk7DQogICAgICAgIH0NCg0KICAgICAgICBpZiAoYmluZGluZy5yZXNpemUpIHsNCiAgICAgICAgICB2YXIgbGFzdFNpemUgPSB7fTsNCiAgICAgICAgICB2YXIgcmVzaXplSGFuZGxlciA9IGZ1bmN0aW9uKGUpIHsNCiAgICAgICAgICAgIHZhciBzaXplID0gew0KICAgICAgICAgICAgICB3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9IHsNCiAgICAgIG5hbWU6IGRlZm4ubmFtZSwNCiAgICAgIHR5cGU6IGRlZm4udHlwZSwNCiAgICAgIGluaXRpYWxpemU6IGZ1bmN0aW9uKGVsLCB3aWR0aCwgaGVpZ2h0KSB7DQogICAgICAgIHJldHVybiBkZWZuLmZhY3RvcnkoZWwsIHdpZHRoLCBoZWlnaHQpOw0KICAgICAgfSwNCiAgICAgIHJlbmRlclZhbHVlOiBmdW5jdGlvbihlbCwgeCwgaW5zdGFuY2UpIHsNCiAgICAgICAgcmV0dXJuIGluc3RhbmNlLnJlbmRlclZhbHVlKHgpOw0KICAgICAgfSwNCiAgICAgIHJlc2l6ZTogZnVuY3Rpb24oZWwsIHdpZHRoLCBoZWlnaHQsIGluc3RhbmNlKSB7DQogICAgICAgIHJldHVybiBpbnN0YW5jZS5yZXNpemUod2lkdGgsIGhlaWdodCk7DQogICAgICB9DQogICAgfTsNCg0KICAgIGlmIChkZWZuLmZpbmQpDQogICAgICByZXN1bHQuZmluZCA9IGRlZm4uZmluZDsNCiAgICBpZiAoZGVmbi5yZW5kZXJFcnJvcikNCiAgICAgIHJlc3VsdC5yZW5kZXJFcnJvciA9IGRlZm4ucmVuZGVyRXJyb3I7DQogICAgaWYgKGRlZm4uY2xlYXJFcnJvcikNCiAgICAgIHJlc3VsdC5jbGVhckVycm9yID0gZGVmbi5jbGVhckVycm9yOw0KDQogICAgcmV0dXJuIHJlc3VsdDsNCiAgfQ0KfSkoKTsNCg0K"></script> <script src="data:application/x-javascript;base64,LyohIGpRdWVyeSB2MS4xMi40IHwgKGMpIGpRdWVyeSBGb3VuZGF0aW9uIHwganF1ZXJ5Lm9yZy9saWNlbnNlICovDQohZnVuY3Rpb24oYSxiKXsib2JqZWN0Ij09dHlwZW9mIG1vZHVsZSYmIm9iamVjdCI9PXR5cGVvZiBtb2R1bGUuZXhwb3J0cz9tb2R1bGUuZXhwb3J0cz1hLmRvY3VtZW50P2IoYSwhMCk6ZnVuY3Rpb24oYSl7aW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Zj1uLmZuLmFkZEJhY2ssImZ1bmN0aW9uIj09dHlwZW9mIGRlZmluZSYmZGVmaW5lLmFtZCYmZGVmaW5lKCJqcXVlcnkiLFtdLGZ1bmN0aW9uKCl7cmV0dXJuIG59KTt2YXIgbmM9YS5qUXVlcnksb2M9YS4kO3JldHVybiBuLm5vQ29uZmxpY3Q9ZnVuY3Rpb24oYil7cmV0dXJuIGEuJD09PW4mJihhLiQ9b2MpLGImJmEualF1ZXJ5PT09biYmKGEualF1ZXJ5PW5jKSxufSxifHwoYS5qUXVlcnk9YS4kPW4pLG59KTsNCg=="></script> <link href="data:text/css;charset=utf-8,%0A%2Eleaflet%2Dpane%2C%0A%2Eleaflet%2Dtile%2C%0A%2Eleaflet%2Dmarker%2Dicon%2C%0A%2Eleaflet%2Dmarker%2Dshadow%2C%0A%2Eleaflet%2Dtile%2Dcontainer%2C%0A%2Eleaflet%2Dpane%20%3E%20svg%2C%0A%2Eleaflet%2Dpane%20%3E%20canvas%2C%0A%2Eleaflet%2Dzoom%2Dbox%2C%0A%2Eleaflet%2Dimage%2Dlayer%2C%0A%2Eleaflet%2Dlayer%20%7B%0Aposition%3A%20absolute%3B%0Aleft%3A%200%3B%0Atop%3A%200%3B%0A%7D%0A%2Eleaflet%2Dcontainer%20%7B%0Aoverflow%3A%20hidden%3B%0A%7D%0A%2Eleaflet%2Dtile%2C%0A%2Eleaflet%2Dmarker%2Dicon%2C%0A%2Eleaflet%2Dmarker%2Dshadow%20%7B%0A%2Dwebkit%2Duser%2Dselect%3A%20none%3B%0A%2Dmoz%2Duser%2Dselect%3A%20none%3B%0Auser%2Dselect%3A%20none%3B%0A%2Dwebkit%2Duser%2Ddrag%3A%20none%3B%0A%7D%0A%0A%2Eleaflet%2Dsafari%20%2Eleaflet%2Dtile%20%7B%0Aimage%2Drendering%3A%20%2Dwebkit%2Doptimize%2Dcontrast%3B%0A%7D%0A%0A%2Eleaflet%2Dsafari%20%2Eleaflet%2Dtile%2Dcontainer%20%7B%0Awidth%3A%201600px%3B%0Aheight%3A%201600px%3B%0A%2Dwebkit%2Dtransform%2Dorigin%3A%200%200%3B%0A%7D%0A%2Eleaflet%2Dmarker%2Dicon%2C%0A%2Eleaflet%2Dmarker%2Dshadow%20%7B%0Adisplay%3A%20block%3B%0A%7D%0A%0A%0A%2Eleaflet%2Dcontainer%20%2Eleaflet%2Doverlay%2Dpane%20svg%2C%0A%2Eleaflet%2Dcontainer%20%2Eleaflet%2Dmarker%2Dpane%20img%2C%0A%2Eleaflet%2Dcontainer%20%2Eleaflet%2Dshadow%2Dpane%20img%2C%0A%2Eleaflet%2Dcontainer%20%2Eleaflet%2Dtile%2Dpane%20img%2C%0A%2Eleaflet%2Dcontainer%20img%2Eleaflet%2Dimage%2Dlayer%20%7B%0Amax%2Dwidth%3A%20none%20%21important%3B%0A%7D%0A%2Eleaflet%2Dcontainer%2Eleaflet%2Dtouch%2Dzoom%20%7B%0A%2Dms%2Dtouch%2Daction%3A%20pan%2Dx%20pan%2Dy%3B%0Atouch%2Daction%3A%20pan%2Dx%20pan%2Dy%3B%0A%7D%0A%2Eleaflet%2Dcontainer%2Eleaflet%2Dtouch%2Ddrag%20%7B%0A%2Dms%2Dtouch%2Daction%3A%20pinch%2Dzoom%3B%0A%7D%0A%2Eleaflet%2Dcontainer%2Eleaflet%2Dtouch%2Ddrag%2Eleaflet%2Dtouch%2Dzoom%20%7B%0A%2Dms%2Dtouch%2Daction%3A%20none%3B%0Atouch%2Daction%3A%20none%3B%0A%7D%0A%2Eleaflet%2Dtile%20%7B%0Afilter%3A%20inherit%3B%0Avisibility%3A%20hidden%3B%0A%7D%0A%2Eleaflet%2Dtile%2Dloaded%20%7B%0Avisibility%3A%20inherit%3B%0A%7D%0A%2Eleaflet%2Dzoom%2Dbox%20%7B%0Awidth%3A%200%3B%0Aheight%3A%200%3B%0A%2Dmoz%2Dbox%2Dsizing%3A%20border%2Dbox%3B%0Abox%2Dsizing%3A%20border%2Dbox%3B%0Az%2Dindex%3A%20800%3B%0A%7D%0A%0A%2Eleaflet%2Doverlay%2Dpane%20svg%20%7B%0A%2Dmoz%2Duser%2Dselect%3A%20none%3B%0A%7D%0A%2Eleaflet%2Dpane%20%7B%20z%2Dindex%3A%20400%3B%20%7D%0A%2Eleaflet%2Dtile%2Dpane%20%7B%20z%2Dindex%3A%20200%3B%20%7D%0A%2Eleaflet%2Doverlay%2Dpane%20%7B%20z%2Dindex%3A%20400%3B%20%7D%0A%2Eleaflet%2Dshadow%2Dpane%20%7B%20z%2Dindex%3A%20500%3B%20%7D%0A%2Eleaflet%2Dmarker%2Dpane%20%7B%20z%2Dindex%3A%20600%3B%20%7D%0A%2Eleaflet%2Dtooltip%2Dpane%20%7B%20z%2Dindex%3A%20650%3B%20%7D%0A%2Eleaflet%2Dpopup%2Dpane%20%7B%20z%2Dindex%3A%20700%3B%20%7D%0A%2Eleaflet%2Dmap%2Dpane%20canvas%20%7B%20z%2Dindex%3A%20100%3B%20%7D%0A%2Eleaflet%2Dmap%2Dpane%20svg%20%7B%20z%2Dindex%3A%20200%3B%20%7D%0A%2Eleaflet%2Dvml%2Dshape%20%7B%0Awidth%3A%201px%3B%0Aheight%3A%201px%3B%0A%7D%0A%2Elvml%20%7B%0Abehavior%3A%20url%28%23default%23VML%29%3B%0Adisplay%3A%20inline%2Dblock%3B%0Aposition%3A%20absolute%3B%0A%7D%0A%0A%2Eleaflet%2Dcontrol%20%7B%0Aposition%3A%20relative%3B%0Az%2Dindex%3A%20800%3B%0Apointer%2Devents%3A%20visiblePainted%3B%20%0Apointer%2Devents%3A%20auto%3B%0A%7D%0A%2Eleaflet%2Dtop%2C%0A%2Eleaflet%2Dbottom%20%7B%0Aposition%3A%20absolute%3B%0Az%2Dindex%3A%201000%3B%0Apointer%2Devents%3A%20none%3B%0A%7D%0A%2Eleaflet%2Dtop%20%7B%0Atop%3A%200%3B%0A%7D%0A%2Eleaflet%2Dright%20%7B%0Aright%3A%200%3B%0A%7D%0A%2Eleaflet%2Dbottom%20%7B%0Abottom%3A%200%3B%0A%7D%0A%2Eleaflet%2Dleft%20%7B%0Aleft%3A%200%3B%0A%7D%0A%2Eleaflet%2Dcontrol%20%7B%0Afloat%3A%20left%3B%0Aclear%3A%20both%3B%0A%7D%0A%2Eleaflet%2Dright%20%2Eleaflet%2Dcontrol%20%7B%0Afloat%3A%20right%3B%0A%7D%0A%2Eleaflet%2Dtop%20%2Eleaflet%2Dcontrol%20%7B%0Amargin%2Dtop%3A%2010px%3B%0A%7D%0A%2Eleaflet%2Dbottom%20%2Eleaflet%2Dcontrol%20%7B%0Amargin%2Dbottom%3A%2010px%3B%0A%7D%0A%2Eleaflet%2Dleft%20%2Eleaflet%2Dcontrol%20%7B%0Amargin%2Dleft%3A%2010px%3B%0A%7D%0A%2Eleaflet%2Dright%20%2Eleaflet%2Dcontrol%20%7B%0Amargin%2Dright%3A%2010px%3B%0A%7D%0A%0A%2Eleaflet%2Dfade%2Danim%20%2Eleaflet%2Dtile%20%7B%0Awill%2Dchange%3A%20opacity%3B%0A%7D%0A%2Eleaflet%2Dfade%2Danim%20%2Eleaflet%2Dpopup%20%7B%0Aopacity%3A%200%3B%0A%2Dwebkit%2Dtransition%3A%20opacity%200%2E2s%20linear%3B%0A%2Dmoz%2Dtransition%3A%20opacity%200%2E2s%20linear%3B%0A%2Do%2Dtransition%3A%20opacity%200%2E2s%20linear%3B%0Atransition%3A%20opacity%200%2E2s%20linear%3B%0A%7D%0A%2Eleaflet%2Dfade%2Danim%20%2Eleaflet%2Dmap%2Dpane%20%2Eleaflet%2Dpopup%20%7B%0Aopacity%3A%201%3B%0A%7D%0A%2Eleaflet%2Dzoom%2Danimated%20%7B%0A%2Dwebkit%2Dtransform%2Dorigin%3A%200%200%3B%0A%2Dms%2Dtransform%2Dorigin%3A%200%200%3B%0Atransform%2Dorigin%3A%200%200%3B%0A%7D%0A%2Eleaflet%2Dzoom%2Danim%20%2Eleaflet%2Dzoom%2Danimated%20%7B%0Awill%2Dchange%3A%20transform%3B%0A%7D%0A%2Eleaflet%2Dzoom%2Danim%20%2Eleaflet%2Dzoom%2Danimated%20%7B%0A%2Dwebkit%2Dtransition%3A%20%2Dwebkit%2Dtransform%200%2E25s%20cubic%2Dbezier%280%2C0%2C0%2E25%2C1%29%3B%0A%2Dmoz%2Dtransition%3A%20%2Dmoz%2Dtransform%200%2E25s%20cubic%2Dbezier%280%2C0%2C0%2E25%2C1%29%3B%0A%2Do%2Dtransition%3A%20%2Do%2Dtransform%200%2E25s%20cubic%2Dbezier%280%2C0%2C0%2E25%2C1%29%3B%0Atransition%3A%20transform%200%2E25s%20cubic%2Dbezier%280%2C0%2C0%2E25%2C1%29%3B%0A%7D%0A%2Eleaflet%2Dzoom%2Danim%20%2Eleaflet%2Dtile%2C%0A%2Eleaflet%2Dpan%2Danim%20%2Eleaflet%2Dtile%20%7B%0A%2Dwebkit%2Dtransition%3A%20none%3B%0A%2Dmoz%2Dtransition%3A%20none%3B%0A%2Do%2Dtransition%3A%20none%3B%0Atransition%3A%20none%3B%0A%7D%0A%2Eleaflet%2Dzoom%2Danim%20%2Eleaflet%2Dzoom%2Dhide%20%7B%0Avisibility%3A%20hidden%3B%0A%7D%0A%0A%2Eleaflet%2Dinteractive%20%7B%0Acursor%3A%20pointer%3B%0A%7D%0A%2Eleaflet%2Dgrab%20%7B%0Acursor%3A%20%2Dwebkit%2Dgrab%3B%0Acursor%3A%20%2Dmoz%2Dgrab%3B%0A%7D%0A%2Eleaflet%2Dcrosshair%2C%0A%2Eleaflet%2Dcrosshair%20%2Eleaflet%2Dinteractive%20%7B%0Acursor%3A%20crosshair%3B%0A%7D%0A%2Eleaflet%2Dpopup%2Dpane%2C%0A%2Eleaflet%2Dcontrol%20%7B%0Acursor%3A%20auto%3B%0A%7D%0A%2Eleaflet%2Ddragging%20%2Eleaflet%2Dgrab%2C%0A%2Eleaflet%2Ddragging%20%2Eleaflet%2Dgrab%20%2Eleaflet%2Dinteractive%2C%0A%2Eleaflet%2Ddragging%20%2Eleaflet%2Dmarker%2Ddraggable%20%7B%0Acursor%3A%20move%3B%0Acursor%3A%20%2Dwebkit%2Dgrabbing%3B%0Acursor%3A%20%2Dmoz%2Dgrabbing%3B%0A%7D%0A%0A%2Eleaflet%2Dmarker%2Dicon%2C%0A%2Eleaflet%2Dmarker%2Dshadow%2C%0A%2Eleaflet%2Dimage%2Dlayer%2C%0A%2Eleaflet%2Dpane%20%3E%20svg%20path%2C%0A%2Eleaflet%2Dtile%2Dcontainer%20%7B%0Apointer%2Devents%3A%20none%3B%0A%7D%0A%2Eleaflet%2Dmarker%2Dicon%2Eleaflet%2Dinteractive%2C%0A%2Eleaflet%2Dimage%2Dlayer%2Eleaflet%2Dinteractive%2C%0A%2Eleaflet%2Dpane%20%3E%20svg%20path%2Eleaflet%2Dinteractive%20%7B%0Apointer%2Devents%3A%20visiblePainted%3B%20%0Apointer%2Devents%3A%20auto%3B%0A%7D%0A%0A%2Eleaflet%2Dcontainer%20%7B%0Abackground%3A%20%23ddd%3B%0Aoutline%3A%200%3B%0A%7D%0A%2Eleaflet%2Dcontainer%20a%20%7B%0Acolor%3A%20%230078A8%3B%0A%7D%0A%2Eleaflet%2Dcontainer%20a%2Eleaflet%2Dactive%20%7B%0Aoutline%3A%202px%20solid%20orange%3B%0A%7D%0A%2Eleaflet%2Dzoom%2Dbox%20%7B%0Aborder%3A%202px%20dotted%20%2338f%3B%0Abackground%3A%20rgba%28255%2C255%2C255%2C0%2E5%29%3B%0A%7D%0A%0A%2Eleaflet%2Dcontainer%20%7B%0Afont%3A%2012px%2F1%2E5%20%22Helvetica%20Neue%22%2C%20Arial%2C%20Helvetica%2C%20sans%2Dserif%3B%0A%7D%0A%0A%2Eleaflet%2Dbar%20%7B%0Abox%2Dshadow%3A%200%201px%205px%20rgba%280%2C0%2C0%2C0%2E65%29%3B%0Aborder%2Dradius%3A%204px%3B%0A%7D%0A%2Eleaflet%2Dbar%20a%2C%0A%2Eleaflet%2Dbar%20a%3Ahover%20%7B%0Abackground%2Dcolor%3A%20%23fff%3B%0Aborder%2Dbottom%3A%201px%20solid%20%23ccc%3B%0Awidth%3A%2026px%3B%0Aheight%3A%2026px%3B%0Aline%2Dheight%3A%2026px%3B%0Adisplay%3A%20block%3B%0Atext%2Dalign%3A%20center%3B%0Atext%2Ddecoration%3A%20none%3B%0Acolor%3A%20black%3B%0A%7D%0A%2Eleaflet%2Dbar%20a%2C%0A%2Eleaflet%2Dcontrol%2Dlayers%2Dtoggle%20%7B%0Abackground%2Dposition%3A%2050%25%2050%25%3B%0Abackground%2Drepeat%3A%20no%2Drepeat%3B%0Adisplay%3A%20block%3B%0A%7D%0A%2Eleaflet%2Dbar%20a%3Ahover%20%7B%0Abackground%2Dcolor%3A%20%23f4f4f4%3B%0A%7D%0A%2Eleaflet%2Dbar%20a%3Afirst%2Dchild%20%7B%0Aborder%2Dtop%2Dleft%2Dradius%3A%204px%3B%0Aborder%2Dtop%2Dright%2Dradius%3A%204px%3B%0A%7D%0A%2Eleaflet%2Dbar%20a%3Alast%2Dchild%20%7B%0Aborder%2Dbottom%2Dleft%2Dradius%3A%204px%3B%0Aborder%2Dbottom%2Dright%2Dradius%3A%204px%3B%0Aborder%2Dbottom%3A%20none%3B%0A%7D%0A%2Eleaflet%2Dbar%20a%2Eleaflet%2Ddisabled%20%7B%0Acursor%3A%20default%3B%0Abackground%2Dcolor%3A%20%23f4f4f4%3B%0Acolor%3A%20%23bbb%3B%0A%7D%0A%2Eleaflet%2Dtouch%20%2Eleaflet%2Dbar%20a%20%7B%0Awidth%3A%2030px%3B%0Aheight%3A%2030px%3B%0Aline%2Dheight%3A%2030px%3B%0A%7D%0A%0A%2Eleaflet%2Dcontrol%2Dzoom%2Din%2C%0A%2Eleaflet%2Dcontrol%2Dzoom%2Dout%20%7B%0Afont%3A%20bold%2018px%20%27Lucida%20Console%27%2C%20Monaco%2C%20monospace%3B%0Atext%2Dindent%3A%201px%3B%0A%7D%0A%2Eleaflet%2Dcontrol%2Dzoom%2Dout%20%7B%0Afont%2Dsize%3A%2020px%3B%0A%7D%0A%2Eleaflet%2Dtouch%20%2Eleaflet%2Dcontrol%2Dzoom%2Din%20%7B%0Afont%2Dsize%3A%2022px%3B%0A%7D%0A%2Eleaflet%2Dtouch%20%2Eleaflet%2Dcontrol%2Dzoom%2Dout%20%7B%0Afont%2Dsize%3A%2024px%3B%0A%7D%0A%0A%2Eleaflet%2Dcontrol%2Dlayers%20%7B%0Abox%2Dshadow%3A%200%201px%205px%20rgba%280%2C0%2C0%2C0%2E4%29%3B%0Abackground%3A%20%23fff%3B%0Aborder%2Dradius%3A%205px%3B%0A%7D%0A%2Eleaflet%2Dcontrol%2Dlayers%2Dtoggle%20%7B%0Abackground%2Dimage%3A%20url%28data%3Aimage%2Fpng%3Bbase64%2CiVBORw0KGgoAAAANSUhEUgAAABoAAAAaCAQAAAADQ4RFAAACf0lEQVR4AY1UM3gkARTePdvdoTxXKc%2BqTl3aU5U6b2Kbkz3Gtq3Zw6ziLGNPzrYx7946Tr6%2Fee%2FXeCQ4D3ykPtL5tHno4n0d%2Fh3%2BxfuWHGLX81cn7r0iTNzjr7LrlxCqPtkbTQEHeqOrTy4Yyt3VCi%2FIOB0v7rVC7q45Q3Gr5K6jt%2B3Gl5nCoDD4MtO%2Bj96Wu8atmhGqcNGHObuf8OM%2Fx3AMx38%2B4Z2sPqzCxRFK2aF2e5Jol56XTLyggAMTL56XOMoS1W4pOyjUcGGQdZxU6qRh7B9Zp%2BPfpOFlqt0zyDZckPi1ttmIp03jX8gyJ8a%2FPG2yutpS%2FVol7peZIbZcKBAEEheEIAgFbDkz5H6Zrkm2hVWGiXKiF4Ycw0RWKdtC16Q7qe3X4iOMxruonzegJzWaXFrU9utOSsLUmrc0YjeWYjCW4PDMADElpJSSQ0vQvA1Tm6%2FJlKnqFs1EGyZiFCqnRZTEJJJiKRYzVYzJck2Rm6P4iH%2BcmSY0YzimYa8l0EtTODFWhcMIMVqdsI2uiTvKmTisIDHJ3od5GILVhBCarCfVRmo4uT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PiQnTEpLUIZEwkRagjYkEibQErwhkTAKCLQEbUgkzJQWc%2F0PstHHcfEdQ%2BUAAAAASUVORK5CYII%3D%29%3B%0Abackground%2Dsize%3A%2026px%2026px%3B%0A%7D%0A%2Eleaflet%2Dtouch%20%2Eleaflet%2Dcontrol%2Dlayers%2Dtoggle%20%7B%0Awidth%3A%2044px%3B%0Aheight%3A%2044px%3B%0A%7D%0A%2Eleaflet%2Dcontrol%2Dlayers%20%2Eleaflet%2Dcontrol%2Dlayers%2Dlist%2C%0A%2Eleaflet%2Dcontrol%2Dlayers%2Dexpanded%20%2Eleaflet%2Dcontrol%2Dlayers%2Dtoggle%20%7B%0Adisplay%3A%20none%3B%0A%7D%0A%2Eleaflet%2Dcontrol%2Dlayers%2Dexpanded%20%2Eleaflet%2Dcontrol%2Dlayers%2Dlist%20%7B%0Adisplay%3A%20block%3B%0Aposition%3A%20relative%3B%0A%7D%0A%2Eleaflet%2Dcontrol%2Dlayers%2Dexpanded%20%7B%0Apadding%3A%206px%2010px%206px%206px%3B%0Acolor%3A%20%23333%3B%0Abackground%3A%20%23fff%3B%0A%7D%0A%2Eleaflet%2Dcontrol%2Dlayers%2Dscrollbar%20%7B%0Aoverflow%2Dy%3A%20scroll%3B%0Apadding%2Dright%3A%205px%3B%0A%7D%0A%2Eleaflet%2Dcontrol%2Dlayers%2Dselector%20%7B%0Amargin%2Dtop%3A%202px%3B%0Aposition%3A%20relative%3B%0Atop%3A%201px%3B%0A%7D%0A%2Eleaflet%2Dcontrol%2Dlayers%20label%20%7B%0Adisplay%3A%20block%3B%0A%7D%0A%2Eleaflet%2Dcontrol%2Dlayers%2Dseparator%20%7B%0Aheight%3A%200%3B%0Aborder%2Dtop%3A%201px%20solid%20%23ddd%3B%0Amargin%3A%205px%20%2D10px%205px%20%2D6px%3B%0A%7D%0A%0A%2Eleaflet%2Ddefault%2Dicon%2Dpath%20%7B%0Abackground%2Dimage%3A%20url%28data%3Aimage%2Fpng%3Bbase64%2CiVBORw0K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abackground%3A%20rgba%28255%2C%20255%2C%20255%2C%200%2E7%29%3B%0Amargin%3A%200%3B%0A%7D%0A%2Eleaflet%2Dcontrol%2Dattribution%2C%0A%2Eleaflet%2Dcontrol%2Dscale%2Dline%20%7B%0Apadding%3A%200%205px%3B%0Acolor%3A%20%23333%3B%0A%7D%0A%2Eleaflet%2Dcontrol%2Dattribution%20a%20%7B%0Atext%2Ddecoration%3A%20none%3B%0A%7D%0A%2Eleaflet%2Dcontrol%2Dattribution%20a%3Ahover%20%7B%0Atext%2Ddecoration%3A%20underline%3B%0A%7D%0A%2Eleaflet%2Dcontainer%20%2Eleaflet%2Dcontrol%2Dattribution%2C%0A%2Eleaflet%2Dcontainer%20%2Eleaflet%2Dcontrol%2Dscale%20%7B%0Afont%2Dsize%3A%2011px%3B%0A%7D%0A%2Eleaflet%2Dleft%20%2Eleaflet%2Dcontrol%2Dscale%20%7B%0Amargin%2Dleft%3A%205px%3B%0A%7D%0A%2Eleaflet%2Dbottom%20%2Eleaflet%2Dcontrol%2Dscale%20%7B%0Amargin%2Dbottom%3A%205px%3B%0A%7D%0A%2Eleaflet%2Dcontrol%2Dscale%2Dline%20%7B%0Aborder%3A%202px%20solid%20%23777%3B%0Aborder%2Dtop%3A%20none%3B%0Aline%2Dheight%3A%201%2E1%3B%0Apadding%3A%202px%205px%201px%3B%0Afont%2Dsize%3A%2011px%3B%0Awhite%2Dspace%3A%20nowrap%3B%0Aoverflow%3A%20hidden%3B%0A%2Dmoz%2Dbox%2Dsizing%3A%20border%2Dbox%3B%0Abox%2Dsizing%3A%20border%2Dbox%3B%0Abackground%3A%20%23fff%3B%0Abackground%3A%20rgba%28255%2C%20255%2C%20255%2C%200%2E5%29%3B%0A%7D%0A%2Eleaflet%2Dcontrol%2Dscale%2Dline%3Anot%28%3Afirst%2Dchild%29%20%7B%0Aborder%2Dtop%3A%202px%20solid%20%23777%3B%0Aborder%2Dbottom%3A%20none%3B%0Amargin%2Dtop%3A%20%2D2px%3B%0A%7D%0A%2Eleaflet%2Dcontrol%2Dscale%2Dline%3Anot%28%3Afirst%2Dchild%29%3Anot%28%3Alast%2Dchild%29%20%7B%0Aborder%2Dbottom%3A%202px%20solid%20%23777%3B%0A%7D%0A%2Eleaflet%2Dtouch%20%2Eleaflet%2Dcontrol%2Dattribution%2C%0A%2Eleaflet%2Dtouch%20%2Eleaflet%2Dcontrol%2Dlayers%2C%0A%2Eleaflet%2Dtouch%20%2Eleaflet%2Dbar%20%7B%0Abox%2Dshadow%3A%20none%3B%0A%7D%0A%2Eleaflet%2Dtouch%20%2Eleaflet%2Dcontrol%2Dlayers%2C%0A%2Eleaflet%2Dtouch%20%2Eleaflet%2Dbar%20%7B%0Aborder%3A%202px%20solid%20rgba%280%2C0%2C0%2C0%2E2%29%3B%0Abackground%2Dclip%3A%20padding%2Dbox%3B%0A%7D%0A%0A%2Eleaflet%2Dpopup%20%7B%0Aposition%3A%20absolute%3B%0Atext%2Dalign%3A%20center%3B%0Amargin%2Dbottom%3A%2020px%3B%0A%7D%0A%2Eleaflet%2Dpopup%2Dcontent%2Dwrapper%20%7B%0Apadding%3A%201px%3B%0Atext%2Dalign%3A%20left%3B%0Aborder%2Dradius%3A%2012px%3B%0A%7D%0A%2Eleaflet%2Dpopup%2Dcontent%20%7B%0Amargin%3A%2013px%2019px%3B%0Aline%2Dheight%3A%201%2E4%3B%0A%7D%0A%2Eleaflet%2Dpopup%2Dcontent%20p%20%7B%0Amargin%3A%2018px%200%3B%0A%7D%0A%2Eleaflet%2Dpopup%2Dtip%2Dcontainer%20%7B%0Awidth%3A%2040px%3B%0Aheight%3A%2020px%3B%0Aposition%3A%20absolute%3B%0Aleft%3A%2050%25%3B%0Amargin%2Dleft%3A%20%2D20px%3B%0Aoverflow%3A%20hidden%3B%0Apointer%2Devents%3A%20none%3B%0A%7D%0A%2Eleaflet%2Dpopup%2Dtip%20%7B%0Awidth%3A%2017px%3B%0Aheight%3A%2017px%3B%0Apadding%3A%201px%3B%0Amargin%3A%20%2D10px%20auto%200%3B%0A%2Dwebkit%2Dtransform%3A%20rotate%2845deg%29%3B%0A%2Dmoz%2Dtransform%3A%20rotate%2845deg%29%3B%0A%2Dms%2Dtransform%3A%20rotate%2845deg%29%3B%0A%2Do%2Dtransform%3A%20rotate%2845deg%29%3B%0Atransform%3A%20rotate%2845deg%29%3B%0A%7D%0A%2Eleaflet%2Dpopup%2Dcontent%2Dwrapper%2C%0A%2Eleaflet%2Dpopup%2Dtip%20%7B%0Abackground%3A%20white%3B%0Acolor%3A%20%23333%3B%0Abox%2Dshadow%3A%200%203px%2014px%20rgba%280%2C0%2C0%2C0%2E4%29%3B%0A%7D%0A%2Eleaflet%2Dcontainer%20a%2Eleaflet%2Dpopup%2Dclose%2Dbutton%20%7B%0Aposition%3A%20absolute%3B%0Atop%3A%200%3B%0Aright%3A%200%3B%0Apadding%3A%204px%204px%200%200%3B%0Aborder%3A%20none%3B%0Atext%2Dalign%3A%20center%3B%0Awidth%3A%2018px%3B%0Aheight%3A%2014px%3B%0Afont%3A%2016px%2F14px%20Tahoma%2C%20Verdana%2C%20sans%2Dserif%3B%0Acolor%3A%20%23c3c3c3%3B%0Atext%2Ddecoration%3A%20none%3B%0Afont%2Dweight%3A%20bold%3B%0Abackground%3A%20transparent%3B%0A%7D%0A%2Eleaflet%2Dcontainer%20a%2Eleaflet%2Dpopup%2Dclose%2Dbutton%3Ahover%20%7B%0Acolor%3A%20%23999%3B%0A%7D%0A%2Eleaflet%2Dpopup%2Dscrolled%20%7B%0Aoverflow%3A%20auto%3B%0Aborder%2Dbottom%3A%201px%20solid%20%23ddd%3B%0Aborder%2Dtop%3A%201px%20solid%20%23ddd%3B%0A%7D%0A%2Eleaflet%2Doldie%20%2Eleaflet%2Dpopup%2Dcontent%2Dwrapper%20%7B%0Azoom%3A%201%3B%0A%7D%0A%2Eleaflet%2Doldie%20%2Eleaflet%2Dpopup%2Dtip%20%7B%0Awidth%3A%2024px%3B%0Amargin%3A%200%20auto%3B%0A%2Dms%2Dfilter%3A%20%22progid%3ADXImageTransform%2EMicrosoft%2EMatrix%28M11%3D0%2E70710678%2C%20M12%3D0%2E70710678%2C%20M21%3D%2D0%2E70710678%2C%20M22%3D0%2E70710678%29%22%3B%0Afilter%3A%20progid%3ADXImageTransform%2EMicrosoft%2EMatrix%28M11%3D0%2E70710678%2C%20M12%3D0%2E70710678%2C%20M21%3D%2D0%2E70710678%2C%20M22%3D0%2E70710678%29%3B%0A%7D%0A%2Eleaflet%2Doldie%20%2Eleaflet%2Dpopup%2Dtip%2Dcontainer%20%7B%0Amargin%2Dtop%3A%20%2D1px%3B%0A%7D%0A%2Eleaflet%2Doldie%20%2Eleaflet%2Dcontrol%2Dzoom%2C%0A%2Eleaflet%2Doldie%20%2Eleaflet%2Dcontrol%2Dlayers%2C%0A%2Eleaflet%2Doldie%20%2Eleaflet%2Dpopup%2Dcontent%2Dwrapper%2C%0A%2Eleaflet%2Doldie%20%2Eleaflet%2Dpopup%2Dtip%20%7B%0Aborder%3A%201px%20solid%20%23999%3B%0A%7D%0A%0A%2Eleaflet%2Ddiv%2Dicon%20%7B%0Abackground%3A%20%23fff%3B%0Aborder%3A%201px%20solid%20%23666%3B%0A%7D%0A%0A%0A%2Eleaflet%2Dtooltip%20%7B%0Aposition%3A%20absolute%3B%0Apadding%3A%206px%3B%0Abackground%2Dcolor%3A%20%23fff%3B%0Aborder%3A%201px%20solid%20%23fff%3B%0Aborder%2Dradius%3A%203px%3B%0Acolor%3A%20%23222%3B%0Awhite%2Dspace%3A%20nowrap%3B%0A%2Dwebkit%2Duser%2Dselect%3A%20none%3B%0A%2Dmoz%2Duser%2Dselect%3A%20none%3B%0A%2Dms%2Duser%2Dselect%3A%20none%3B%0Auser%2Dselect%3A%20none%3B%0Apointer%2Devents%3A%20none%3B%0Abox%2Dshadow%3A%200%201px%203px%20rgba%280%2C0%2C0%2C0%2E4%29%3B%0A%7D%0A%2Eleaflet%2Dtooltip%2Eleaflet%2Dclickable%20%7B%0Acursor%3A%20pointer%3B%0Apointer%2Devents%3A%20auto%3B%0A%7D%0A%2Eleaflet%2Dtooltip%2Dtop%3Abefore%2C%0A%2Eleaflet%2Dtooltip%2Dbottom%3Abefore%2C%0A%2Eleaflet%2Dtooltip%2Dleft%3Abefore%2C%0A%2Eleaflet%2Dtooltip%2Dright%3Abefore%20%7B%0Aposition%3A%20absolute%3B%0Apointer%2Devents%3A%20none%3B%0Aborder%3A%206px%20solid%20transparent%3B%0Abackground%3A%20transparent%3B%0Acontent%3A%20%22%22%3B%0A%7D%0A%0A%2Eleaflet%2Dtooltip%2Dbottom%20%7B%0Amargin%2Dtop%3A%206px%3B%0A%7D%0A%2Eleaflet%2Dtooltip%2Dtop%20%7B%0Amargin%2Dtop%3A%20%2D6px%3B%0A%7D%0A%2Eleaflet%2Dtooltip%2Dbottom%3Abefore%2C%0A%2Eleaflet%2Dtooltip%2Dtop%3Abefore%20%7B%0Aleft%3A%2050%25%3B%0Amargin%2Dleft%3A%20%2D6px%3B%0A%7D%0A%2Eleaflet%2Dtooltip%2Dtop%3Abefore%20%7B%0Abottom%3A%200%3B%0Amargin%2Dbottom%3A%20%2D12px%3B%0Aborder%2Dtop%2Dcolor%3A%20%23fff%3B%0A%7D%0A%2Eleaflet%2Dtooltip%2Dbottom%3Abefore%20%7B%0Atop%3A%200%3B%0Amargin%2Dtop%3A%20%2D12px%3B%0Amargin%2Dleft%3A%20%2D6px%3B%0Aborder%2Dbottom%2Dcolor%3A%20%23fff%3B%0A%7D%0A%2Eleaflet%2Dtooltip%2Dleft%20%7B%0Amargin%2Dleft%3A%20%2D6px%3B%0A%7D%0A%2Eleaflet%2Dtooltip%2Dright%20%7B%0Amargin%2Dleft%3A%206px%3B%0A%7D%0A%2Eleaflet%2Dtooltip%2Dleft%3Abefore%2C%0A%2Eleaflet%2Dtooltip%2Dright%3Abefore%20%7B%0Atop%3A%2050%25%3B%0Amargin%2Dtop%3A%20%2D6px%3B%0A%7D%0A%2Eleaflet%2Dtooltip%2Dleft%3Abefore%20%7B%0Aright%3A%200%3B%0Amargin%2Dright%3A%20%2D12px%3B%0Aborder%2Dleft%2Dcolor%3A%20%23fff%3B%0A%7D%0A%2Eleaflet%2Dtooltip%2Dright%3Abefore%20%7B%0Aleft%3A%200%3B%0Amargin%2Dleft%3A%20%2D12px%3B%0Aborder%2Dright%2Dcolor%3A%20%23fff%3B%0A%7D%0A" rel="stylesheet" /> <script src="data:application/x-javascript;base64,LyoKIExlYWZsZXQgMS4wLjMsIGEgSlMgbGlicmFyeSBmb3IgaW50ZXJhY3RpdmUgbWFwcy4gaHR0cDovL2xlYWZsZXRqcy5jb20KIChjKSAyMDEwLTIwMTYgVmxhZGltaXIgQWdhZm9ua2luLCAoYykgMjAxMC0yMDExIENsb3VkTWFkZQoqLwohZnVuY3Rpb24odCxlLGkpe2Z1bmN0aW9uIG4oKXt2YXIgZT10Lkw7by5ub0NvbmZsaWN0PWZ1bmN0aW9uKCl7cmV0dXJuIHQuTD1lLHRoaXN9LHQuTD1vfXZhciBvPXt2ZXJzaW9uOiIxLjAuMyJ9OyJvYmplY3QiPT10eXBlb2YgbW9kdWxlJiYib2JqZWN0Ij09dHlwZW9mIG1vZHVsZS5leHBvcnRzP21vZHVsZS5leHBvcnRzPW86ImZ1bmN0aW9uIj09dHlwZW9mIGRlZmluZSYmZGVmaW5lLmFtZCYmZGVmaW5lKG8pLCJ1bmRlZmluZWQiIT10eXBlb2YgdCYmbigpLG8uVXRpbD17ZXh0ZW5kOmZ1bmN0aW9uKHQpe3ZhciBlLGksbixvO2ZvcihpPTEsbj1hcmd1bWVudHMubGVuZ3RoO2k8bjtpKyspe289YXJndW1lbnRzW2ldO2ZvcihlIGluIG8pdFtlXT1vW2VdfXJldHVybiB0fSxjcmVhdGU6T2JqZWN0LmNyZWF0ZXx8ZnVuY3Rpb24oKXtmdW5jdGlvbiB0KCl7fXJldHVybiBmdW5jdGlvbihlKXtyZXR1cm4gdC5wcm90b3R5cGU9ZSxuZXcgdH19KCksYmluZ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V4cGFuZDpmdW5jdGlvbigpe3JldHVybiB0aGlzLmV4cGFuZCgpfSxfY29sbGFwc2U6ZnVuY3Rpb24oKXtyZXR1cm4gdGhpcy5jb2xsYXBzZSgpfX0pLG8uY29udHJvbC5sYXllcnM9ZnVuY3Rpb24odCxlLGkpe3JldHVybiBuZXcgby5Db250cm9sLkxheWVycyh0LGUsaSl9fSh3aW5kb3csZG9jdW1lbnQpOw=="></script> <link href="data:text/css;charset=utf-8,%0Aimg%2Eleaflet%2Dtile%20%7B%0Apadding%3A%200%3B%0Amargin%3A%200%3B%0Aborder%2Dradius%3A%200%3B%0Aborder%3A%20none%3B%0A%7D%0A%2Einfo%20%7B%0Apadding%3A%206px%208px%3B%0Afont%3A%2014px%2F16px%20Arial%2C%20Helvetica%2C%20sans%2Dserif%3B%0Abackground%3A%20white%3B%0Abackground%3A%20rgba%28255%2C255%2C255%2C0%2E8%29%3B%0Abox%2Dshadow%3A%200%200%2015px%20rgba%280%2C0%2C0%2C0%2E2%29%3B%0Aborder%2Dradius%3A%205px%3B%0A%7D%0A%2Elegend%20%7B%0Aline%2Dheight%3A%2018px%3B%0Acolor%3A%20%23555%3B%0A%7D%0A%2Elegend%20svg%20text%20%7B%0Afill%3A%20%23555%3B%0A%7D%0A%2Elegend%20svg%20line%20%7B%0Astroke%3A%20%23555%3B%0A%7D%0A%2Elegend%20i%20%7B%0Awidth%3A%2018px%3B%0Aheight%3A%2018px%3B%0Afloat%3A%20left%3B%0Amargin%2Dright%3A%208px%3B%0Aopacity%3A%200%2E7%3B%0A%7D%0A" rel="stylesheet" /> <script src="data:application/x-javascript;base64,IWZ1bmN0aW9uKGEpe2lmKCJvYmplY3QiPT10eXBlb2YgZXhwb3J0cyltb2R1bGUuZXhwb3J0cz1hKCk7ZWxzZSBpZigiZnVuY3Rpb24iPT10eXBlb2YgZGVmaW5lJiZkZWZpbmUuYW1kKWRlZmluZShhKTtlbHNle3ZhciBiOyJ1bmRlZmluZWQiIT10eXBlb2Ygd2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ICAgX3RoaXMyLmNvbChuYW1lLCBjb2xkYXRhKTsKICAgICAgfSk7CiAgICAgIHJldHVybiB0aGlzOwogICAgfQogIH0sIHsKICAgIGtleTogImdldCIsCiAgICB2YWx1ZTogZnVuY3Rpb24gZ2V0KHJvdywgY29sLCBtaXNzaW5nT0spIHsKICAgICAgdmFyIF90aGlzMyA9IHRoaXM7CgogICAgICBpZiAocm93ID4gdGhpcy5lZmZlY3RpdmVMZW5ndGgpIHRocm93IG5ldyBFcnJvcigiUm93IGFyZ3VtZW50IHdhcyBvdXQgb2YgYm91bmRzOiAiICsgcm93ICsgIiA+ICIgKyB0aGlzLmVmZmVjdGl2ZUxlbmd0aCk7CgogICAgICB2YXIgY29sSW5kZXggPSAtMTsKICAgICAgaWYgKHR5cGVvZiBjb2wgPT09ICJ1bmRlZmluZWQiKSB7CiAgICAgICAgdmFyIF9yZXQgPSBmdW5jdGlvbiAoKSB7CiAgICAgICAgICB2YXIgcm93RGF0YSA9IHt9OwogICAgICAgICAgX3RoaXMzLmNvbG5hbWVzLmZvckVhY2goZnVuY3Rpb24gKG5hbWUsIGkpIHsKICAgICAgICAgICAgcm93RGF0YVtuYW1lXSA9IF90aGlzMy5jb2x1bW5zW2ldW3JvdyAlIF90aGlzMy5jb2x1bW5zW2ldLmxlbmd0aF07CiAgICAgICAgICB9KTsKICAgICAgICAgIHJldHVybiB7CiAgICAgICAgICAgIHY6IHJvd0RhdGEKICAgICAgICAgIH07CiAgICAgICAgfSgpOwoKICAgICAgICBpZiAoKHR5cGVvZiBfcmV0ID09PSAidW5kZWZpbmVkIiA/ICJ1bmRlZmluZWQiIDogX3R5cGVvZihfcmV0KSkgPT09ICJvYmplY3QiKSByZXR1cm4gX3JldC52OwogICAgICB9IGVsc2UgaWYgKHR5cGVvZiBjb2wgPT09ICJzdHJpbmciKSB7CiAgICAgICAgY29sSW5kZXggPSB0aGlzLl9jb2xJbmRleChjb2wpOwogICAgICB9IGVsc2UgaWYgKHR5cGVvZiBjb2w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FwLmlkID0gZWwuaWQ7CgogICAgICAgICAgICAvLyBTdG9yZSB0aGUgbWFwIG9uIHRoZSBlbGVtZW50IHNvIHdlIGNhbiBmaW5kIGl0IGxhdGVyIGJ5IElECiAgICAgICAgICAgICgwLCBfanF1ZXJ5Mi5kZWZhdWx0KShlbCkuZGF0YSgibGVhZmxldC1tYXAiLCBtYXApOwoKICAgICAgICAgICAgLy8gV2hlbiB0aGUgbWFwIGlzIGNsaWNrZWQsIHNlbmQgdGhlIGNvb3JkaW5hdGVzIGJhY2sgdG8gdGhlIGFwcAogICAgICAgICAgICBtYXAub24oImNsaWNrIiwgZnVuY3Rpb24gKGUpIHsKICAgICAgICAgICAgICBfc2hpbnkyLmRlZmF1bHQub25JbnB1dENoYW5nZShtYXAuaWQgKyAiX2NsaWNrIiwgewogICAgICAgICAgICAgICAgbGF0OiBlLmxhdGxuZy5sYXQsCiAgICAgICAgICAgICAgICBsbmc6IGUubGF0bG5nLmxuZywKICAgICAgICAgICAgICAgICIubm9uY2UiOiBNYXRoLnJhbmRvbSgpIC8vIEZvcmNlIHJlYWN0aXZpdHkgaWYgbGF0L2xuZyBoYXNuJ3QgY2hhbmdlZAogICAgICAgICAgICAgIH0pOwogICAgICAgICAgICB9KTsKCiAgICAgICAgICAgIHZhciBncm91cFRpbWVySWQgPSBudWxsOwoKICAgICAgICAgICAgbWFwLm9uKCJtb3ZlZW5kIiwgZnVuY3Rpb24gKGUpIHsKICAgICAgICAgICAgICB1cGRhdGVCb3VuZHMoZS50YXJnZXQpOwogICAgICAgICAgICB9KS5vbigibGF5ZXJhZGQgbGF5ZXJyZW1vdmUiLCBmdW5jdGlvbiAoZSkgewogICAgICAgICAgICAgIC8vIElmIHRoZSBsYXllciB0aGF0J3MgY29taW5nIG9yIGdvaW5nIGlzIGEgZ3JvdXAgd2UgY3JlYXRlZCwgdGVsbAogICAgICAgICAgICAgIC8vIHRoZSBzZXJ2ZXIuCiAgICAgICAgICAgICAgaWYgKG1hcC5sYXllck1hbmFnZXIuZ2V0R3JvdXBOYW1lRnJvbUxheWVyR3JvdXAoZS5sYXllcikpIHsKICAgICAgICAgICAgICAgIC8vIEJ1dCB0byBhdm9pZCBjaGF0dGluZXNzLCBjb2FsZXNjZSBldmVudHMKICAgICAgICAgICAgICAgIGlmIChncm91cFRpbWVySWQpIHsKICAgICAgICAgICAgICAgICAgY2xlYXJUaW1lb3V0KGdyb3VwVGltZXJJZCk7CiAgICAgICAgICAgICAgICAgIGdyb3VwVGltZXJJZCA9IG51bGw7CiAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICBncm91cFRpbWVySWQgPSBzZXRUaW1lb3V0KGZ1bmN0aW9uICgpIHsKICAgICAgICAgICAgICAgICAgZ3JvdXBUaW1lcklkID0gbnVsbDsKICAgICAgICAgICAgICAgICAgX3NoaW55Mi5kZWZhdWx0Lm9uSW5wdXRDaGFuZ2UobWFwLmlkICsgIl9ncm91cHMiLCBtYXAubGF5ZXJNYW5hZ2VyLmdldFZpc2libGVHcm91cHMoKSk7CiAgICAgICAgICAgICAgICB9LCAxMDApOwogICAgICAgICAgICAgIH0KICAgICAgICAgICAgfSk7CiAgICAgICAgICB9KSgpOwogICAgICAgIH0KICAgICAgICB0aGlzLmRvUmVuZGVyVmFsdWUoZGF0YSwgbWFwKTsKICAgICAgfSwKICAgICAgZG9SZW5kZXJWYWx1ZTogZnVuY3Rpb24gZG9SZW5kZXJWYWx1ZShkYXRhLCBtYXApIHsKICAgICAgICAvLyBMZWFmbGV0IGRvZXMgbm90IGJlaGF2ZSB3ZWxsIHdoZW4geW91IHNldCB1cCBhIGJ1bmNoIG9mIGxheWVycyB3aGVuCiAgICAgICAgLy8gdGhlIG1hcCBpcyBub3QgdmlzaWJsZSAod2lkdGgvaGVpZ2h0ID09IDApLiBQb3B1cHMgZ2V0IG1pc2FsaWduZWQKICAgICAgICAvLyByZWxhdGl2ZSB0byB0aGVpciBvd25pbmcgbWFya2VycywgYW5kIHRoZSBmaXRCb3VuZHM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yAmJiAhX2pxdWVyeTIuZGVmYXVsdC5pc0VtcHR5T2JqZWN0KGRhdGEubGltaXRzKSkgewogICAgICAgICAgICAvLyBVc2UgdGhlIG5hdHVyYWwgbGltaXRzIG9mIHdoYXQncyBiZWluZyBkcmF3biBvbiB0aGUgbWFwCiAgICAgICAgICAgIC8vIElmIHRoZSBzaXplIG9mIHRoZSBib3VuZGluZyBib3ggaXMgMCwgbGVhZmxldCBnZXRzIGFsbCB3ZWlyZAogICAgICAgICAgICB2YXIgcGFkID0gMC4wMDY7CiAgICAgICAgICAgIGlmIChkYXRhLmxpbWl0cy5sYXRbMF0gPT09IGRhdGEubGltaXRzLmxhdFsxXSkgewogICAgICAgICAgICAgIGRhdGEubGltaXRzLmxhdFswXSA9IGRhdGEubGltaXRzLmxhdFswXSAtIHBhZDsKICAgICAgICAgICAgICBkYXRhLmxpbWl0cy5sYXRbMV0gPSBkYXRhLmxpbWl0cy5sYXRbMV0gKyBwYWQ7CiAgICAgICAgICAgIH0KICAgICAgICAgICAgaWYgKGRhdGEubGltaXRzLmxuZ1swXSA9PT0gZGF0YS5saW1pdHMubG5nWzFdKSB7CiAgICAgICAgICAgICAgZGF0YS5saW1pdHMubG5nWzBdID0gZGF0YS5saW1pdHMubG5nWzBdIC0gcGFkOwogICAgICAgICAgICAgIGRhdGEubGltaXRzLmxuZ1sxXSA9IGRhdGEubGltaXRzLmxuZ1sxXSArIHBhZDsKICAgICAgICAgICAgfQogICAgICAgICAgICBtYXAuZml0Qm91bmRzKFtbZGF0YS5saW1pdHMubGF0WzBdLCBkYXRhLmxpbWl0cy5sbmdbMF1dLCBbZGF0YS5saW1pdHMubGF0WzFdLCBkYXRhLmxpbWl0cy5sbmdbMV1dXSk7CiAgICAgICAgICB9IGVsc2UgewogICAgICAgICAgICBtYXAuZml0V29ybGQoKTsKICAgICAgICAgIH0KICAgICAgICB9CgogICAgICAgIGZvciAodmFyIGkgPSAwOyBkYXRhLmNhbGxzICYmIGkgPCBkYXRhLmN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wXSA9IGxheWVyOwoKICAgICAgICAvLyBTaW5jZSBhIGdyb3VwIGlzIGFzc2lnbmVkLCBkb24ndCBhZGQgdGhlIGxheWVyIHRvIHRoZSBjYXRlZ29yeSdzIGxheWVyCiAgICAgICAgLy8gZ3JvdXA7IGluc3RlYWQsIHVzZSB0aGUgZ3JvdXAncyBsYXllciBncm91cC4KICAgICAgICAvLyBUaGlzIG9uZSBsaW5lciBjcmVhdGVzIHRoZSBfZ3JvdXBDb250YWluZXJzW2dyb3VwXSBlbnRyeSBpZiBpdCBkb2Vzbid0CiAgICAgICAgLy8gYWxyZWFkeSBleGlzdC4KICAgICAgICBjb250YWluZXIgPSB0aGlzLmdldExheWVyR3JvdXAoZ3JvdXAsIHRydWUpOwogICAgICB9CgogICAgICAvLyBVcGRhdGUgY2F0ZWdvcnkgaW5kZXgKICAgICAgdGhpcy5fYnlDYXRlZ29yeVtjYXRlZ29yeV0gPSB0aGlzLl9ieUNhdGVnb3J5W2NhdGVnb3J5XSB8fCB7fTsKICAgICAgdGhpcy5fYnlDYXRlZ29yeVtjYXRlZ29yeV1bc3RhbXBdID0gbGF5ZXI7CgogICAgICAvLyBVcGRhdGUgc3RhbXAgaW5kZXgKICAgICAgdmFyIGxheWVySW5mbyA9IHRoaXMuX2J5U3RhbXBbc3RhbXBdID0gewogICAgICAgIGxheWVyOiBsYXllciwKICAgICAgICBncm91cDogZ3JvdXAsCiAgICAgICAgY3RHcm91cDogY3RHcm91cCwKICAgICAgICBjdEtleTogY3RLZXksCiAgICAgICAgbGF5ZXJJZDogbGF5ZXJJZCwKICAgICAgICBjYXRlZ29yeTogY2F0ZWdvcnksCiAgICAgICAgY29udGFpbmVyOiBjb250YWluZXIsCiAgICAgICAgaGlkZGVuOiBmYWxzZQogICAgICB9OwoKICAgICAgLy8gVXBkYXRlIGNyb3NzdGFsayBncm91cCBpbmRleAogICAgICBpZiAoY3RHcm91cCkgewogICAgICAgIChmdW5jdGlvbiAoKSB7CiAgICAgICAgICBpZ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5ZXJJbmZvID0gX3RoaXMuX2J5U3RhbXBbY3RnW2tleV1dOwogICAgICAgICAgICAgICAgICAgIF90aGlzLl9zZXRWaXNpYmlsaXR5KF9sYXllckluZm8sIHRydWUpOwogICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICB9IGVsc2UgewogICAgICAgICAgICAgICAgICB2YXIgc2VsZWN0ZWRLZXlzID0ge307CiAgICAgICAgICAgICAgICAgIGZvciAodmFyIF9pID0gMDsgX2kgPCBlLnZhbHVlLmxlbmd0aDsgX2krKykgewogICAgICAgICAgICAgICAgICAgIHNlbGVjdGVkS2V5c1tlLnZhbHVlW19pXV0gPSB0cnVlOwogICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgIHZhciBfZ3JvdXBLZXlzID0gT2JqZWN0LmtleXMoY3RnKTsKICAgICAgICAgICAgICAgICAgZm9yICh2YXIgX2kyID0gMDsgX2kyIDwgX2dyb3VwS2V5cy5sZW5ndGg7IF9pMisrKSB7CiAgICAgICAgICAgICAgICAgICAgdmFyIF9rZXkgPSBfZ3JvdXBLZXlzW19pMl07CiAgICAgICAgICAgICAgICAgICAgdmFyIF9sYXllckluZm8yID0gX3RoaXMuX2J5U3RhbXBbY3RnW19rZXldXTsKICAgICAgICAgICAgICAgICAgICBfdGhpcy5fc2V0VmlzaWJpbGl0eShfbGF5ZXJJbmZvMiwgc2VsZWN0ZWRLZXlzW19ncm91cEtleXNbX2kyXV0pOwogICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgfTsKICAgICAgICAgICAgICB2YXIgZmlsdGVySGFuZGxlID0gbmV3IGNyb3NzdGFsay5GaWx0ZXJIYW5kbGUoY3RHcm91cCk7CiAgICAgICAgICAgICAgZmlsdGVySGFuZGxlLm9uKCJjaGFuZ2UiLCBoYW5kbGVGaWx0ZXIpOwoKICAgICAgICAgICAgICB2YXIgaGFuZGxlU2VsZWN0aW9uID0gZnVuY3Rpb24gaGFuZGxlU2VsZWN0aW9uKGUpIHsKICAgICAgICAgICAgICAgIGlmICghZS52YWx1ZSB8fCAhZS52YWx1ZS5sZW5ndGgpIHsKICAgICAgICAgICAgICAgICAgdmFyIGdyb3VwS2V5cyA9IE9iamVjdC5rZXlzKGN0Zyk7CiAgICAgICAgICAgICAgICAgIGZvciAodmFyIGkgPSAwOyBpIDwgZ3JvdXBLZXlzLmxlbmd0aDsgaSsrKSB7CiAgICAgICAgICAgICAgICAgICAgdmFyIGtleSA9IGdyb3VwS2V5c1tpXTsKICAgICAgICAgICAgICAgICAgICB2YXIgX2xheWVySW5mbzMgPSBfdGhpcy5fYnlTdGFtcFtjdGdba2V5XV07CiAgICAgICAgICAgICAgICAgICAgX3RoaXMuX3NldE9wYWNpdHkoX2xheWVySW5mbzMsIDEuMCk7CiAgICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgIH0gZWxzZSB7CiAgICAgICAgICAgICAgICAgIHZhciBzZWxlY3RlZEtleXMgPSB7fTsKICAgICAgICAgICAgICAgICAgZm9yICh2YXIgX2kzID0gMDsgX2kzIDwgZS52YWx1ZS5sZW5ndGg7IF9pMysrKSB7CiAgICAgICAgICAgICAgICAgICAgc2VsZWN0ZWRLZXlzW2UudmFsdWVbX2kzXV0gPSB0cnVlOwogICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgIHZhciBfZ3JvdXBLZXlzMiA9IE9iamVjdC5rZXlzKGN0Zyk7CiAgICAgICAgICAgICAgICAgIGZvciAodmFyIF9pNCA9IDA7IF9pNCA8IF9ncm91cEtleXMyLmxlbmd0aDsgX2k0KyspIHsKICAgICAgICAgICAgICAgICAgICB2YXIgX2tleTIgPSBfZ3JvdXBLZXlzMltfaTRdOwogICAgICAgICAgICAgICAgICAgIHZhciBfbGF5ZXJJbmZvNCA9IF90aGlzLl9ieVN0YW1wW2N0Z1tfa2V5Ml1dOwogICAgICAgICAgICAgICAgICAgIF90aGlzLl9zZXRPcGFjaXR5KF9sYXllckluZm80LCBzZWxlY3RlZEtleXNbX2dyb3VwS2V5czJbX2k0XV0gPyAxLjAgOiAwLjIpOwogICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgfTsKICAgICAgICAgICAgICB2YXIgc2VsSGFuZGxlID0gbmV3IGNyb3NzdGFsay5TZWxlY3Rpb25IYW5kbGUoY3RHcm91cCk7CiAgICAgICAgICAgICAgc2VsSGFuZGxlLm9uKCJjaGFuZ2UiLCBoYW5kbGVTZWxlY3Rpb24pOwoKICAgICAgICAgICAgICBzZXRUaW1lb3V0KGZ1bmN0aW9uICgpIHsKICAgICAgICAgICAgICAgIGhhbmRsZUZpbHRlcih7IHZhbHVlOiBmaWx0ZXJIYW5kbGUuZmlsdGVyZWRLZXlzIH0pOwogICAgICAgICAgICAgICAgaGFuZGxlU2VsZWN0aW9uKHsgdmFsdWU6IHNlbEhhbmRsZS52YWx1ZSB9KTsKICAgICAgICAgICAgICB9LCAxMDApOwogICAgICAgICAgICB9KSgpOwogICAgICAgICAgfQoKICAgICAgICAgIGlmICghY3RnW2N0S2V5XSkgY3RnW2N0S2V5XSA9IFtdOwogICAgICAgICAgY3RnW2N0S2V5XS5wdXNoKHN0YW1wKTsKICAgICAgICB9KSgpOwogICAgICB9CgogICAgICAvLyBBZGQgdG8gY29udGFpbmVyCiAgICAgIGlmICghbGF5ZXJJbmZvLmhpZGRlbikgY29udGFpbmVyLmFkZExheWVyKGxheWVyKTsKCiAgICAgIHJldHVybiBvbGRMYXllcjsKICAgIH0KICB9LCB7CiAgICBrZXk6ICJicnVzaCIsCiAgICB2YWx1ZTogZnVuY3Rpb24gYnJ1c2goYm91bmRzLCBleHRyYUluZm8pIHsKICAgICAgdmFyIF90aGlzMiA9IHRoaXM7CgogICAgICAvKiBlc2xpbnQtZGlzYWJsZSBuby1jb25zb2xlICovCgogICAgICAvLyBGb3IgZWFjaCBDcm9zc3RhbGsgZ3JvdXAuLi4KICAgICAgT2JqZWN0L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gICAgICAgfQogICAgICAgICAgfSk7CiAgICAgICAgfSk7CiAgICAgICAgbmV3IGdsb2JhbC5jcm9zc3RhbGsuU2VsZWN0aW9uSGFuZGxlKGN0R3JvdXBOYW1lKS5zZXQoc2VsZWN0aW9uLCBleHRyYUluZm8pOwogICAgICB9KTsKICAgIH0KICB9LCB7CiAgICBrZXk6ICJ1bmJydXNoIiwKICAgIHZhbHVlOiBmdW5jdGlvbiB1bmJydXNoKGV4dHJhSW5mbykgewogICAgICBPYmplY3Qua2V5cyh0aGlzLl9ieUNyb3NzdGFsa0dyb3VwKS5mb3JFYWNoKGZ1bmN0aW9uIChjdEdyb3VwTmFtZSkgewogICAgICAgIG5ldyBnbG9iYWwuY3Jvc3N0YWxrLlNlbGVjdGlvbkhhbmRsZShjdEdyb3VwTmFtZSkuY2xlYXIoZXh0cmFJbmZvKTsKICAgICAgfSk7CiAgICB9CiAgfSwgewogICAga2V5OiAiX3NldFZpc2liaWxpdHkiLAogICAgdmFsdWU6IGZ1bmN0aW9uIF9zZXRWaXNpYmlsaXR5KGxheWVySW5mbywgdmlzaWJsZSkgewogICAgICBpZiAobGF5ZXJJbmZvLmhpZGRlbiBeIHZpc2libGUpIHsKICAgICAgICByZXR1cm47CiAgICAgIH0gZWxzZSBpZiAodmlzaWJsZSkgewogICAgICAgIGxheWVySW5mby5jb250YWluZXIuYWRkTGF5ZXIobGF5ZXJJbmZvLmxheWVyKTsKICAgICAgICBsYXllckluZm8uaGlkZGVuID0gZmFsc2U7CiAgICAgIH0gZWxzZSB7CiAgICAgICAgbGF5ZXJJbmZvLmNvbnRhaW5lci5yZW1vdmVMYXllcihsYXllckluZm8ubGF5ZXIpOwogICAgICAgIGxheWVySW5mby5oaWRkZW4gPSB0cnVlOwogICAgICB9CiAgICB9CiAgfSwgewogICAga2V5OiAiX3NldE9wYWNpdHkiLAogICAgdmFsdWU6IGZ1bmN0aW9uIF9zZXRPcGFjaXR5KGxheWVySW5mbywgb3BhY2l0eSkgewogICAgICBpZiAobGF5ZXJJbmZvLmxheWVyLnNldE9wYWNpdHkpIHsKICAgICAgICBsYXllckluZm8ubGF5ZXIuc2V0T3BhY2l0eShvcGFjaXR5KTsKICAgICAgfSBlbHNlIGlmIChsYXllckluZm8ubGF5ZXIuc2V0U3R5bGUpIHsKICAgICAgICBsYXllckluZm8ubGF5ZXIuc2V0U3R5bGUoewogICAgICAgICAgb3BhY2l0eTogb3BhY2l0eSAqIGxheWVySW5mby5sYXllci5vcHRpb25zLm9yaWdPcGFjaXR5LAogICAgICAgICAgZmlsbE9wYWNpdHk6IG9wYWNpdHkgKiBsYXllckluZm8ubGF5ZXIub3B0aW9ucy5vcmlnRmlsbE9wYWNpdHkKICAgICAgICB9KTsKICAgICAgfQogICAgfQogIH0sIHsKICAgIGtleTogImdldExheWVyIiwKICAgIHZhbHVlOiBmdW5jdGlvbiBnZXRMYXllcihjYXRlZ29yeSwgbGF5ZXJJZCkgewogICAgICByZXR1cm4gdGhpcy5fYnlMYXllcklkW3RoaXMuX2xheWVySWRLZXkoY2F0ZWdvcnksIGxheWVySWQpXTsKICAgIH0KICB9LCB7CiAgICBrZXk6ICJyZW1vdmVMYXllciIsCiAgICB2YWx1ZTogZnVuY3Rpb24gcmVtb3ZlTGF5ZXIoY2F0ZWdvcnksIGxheWVySWRzKSB7CiAgICAgIHZhciBfdGhpczMgPSB0aGlzOwoKICAgICAgLy8gRmluZCBsYXllciBpbmZvCiAgICAgIF9qcXVlcnkyLmRlZmF1bHQuZWFjaCgoMCwgX3V0aWwuYXNBcnJheSkobGF5ZXJJZHMpLCBmdW5jdGlvbiAoaSwgbGF5ZXJJZCkgewogICAgICAgIHZhciBsYXllciA9IF90aGlzMy5fYnlMYXllcklkW190aGlzMy5fbGF5ZXJJZEtleShjYXRlZ29yeSwgbGF5ZXJJZCldOwogICAgICAgIGlmIChsYXllcikgewogICAgICAgICAgX3RoaXMzLl9yZW1vdmVMYXllcihsYXllcik7CiAgICAgICAgfQogICAgICB9KTsKICAg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ewogICAgICAgICAgICB0aGlzLmxheWVyTWFuYWdlci5hZGRMYXllcihtYXJrZXIsICJtYXJrZXIiLCB0aGlzSWQsIHRoaXNHcm91cCwgZGYuZ2V0KGksICJjdEdyb3VwIiwgdHJ1ZSksIGRmLmdldChpLCAiY3RLZXkiLCB0cnVlKSk7CiAgICAgICAgICB9CiAgICAgICAgICB2YXIgcG9wdXAgPSBkZi5nZXQoaSwgInBvcHVwIik7CiAgICAgICAgICB2YXIgcG9wdXBPcHRpb25zID0gZGYuZ2V0KGksICJwb3B1cE9wdGlvbnMiKTsKICAgICAgICAgIGlmIChwb3B1cCAhPT0gbnVsbCkgewogICAgICAgICAgICBpZiAocG9wdXBPcHRpb25zICE9PSBudWxsKSB7CiAgICAgICAgICAgICAgbWFya2VyLmJpbmRQb3B1cChwb3B1cCwgcG9wdXBPcHRpb25zKTsKICAgICAgICAgICAgfSBlbHNlIHsKICAgICAgICAgICAgICBtYXJrZXIuYmluZFBvcHVwKHBvcHVwKTsKICAgICAgICAgICAgfQogICAgICAgICAgfQogICAgICAgICAgdmFyIGxhYmVsID0gZGYuZ2V0KGksICJsYWJlbCIpOwogICAgICAgICAgdmFyIGxhYmVsT3B0aW9ucyA9IGRmLmdldChpLCAibGFiZWxPcHRpb25zIik7CiAgICAgICAgICBpZiAobGFiZWwgIT09IG51bGwpIHsKICAgICAgICAgICAgaWYgKGxhYmVsT3B0aW9ucyAhPT0gbnVsbCkgewogICAgICAgICAgICAgIGlmIChsYWJlbE9wdGlvbnMucGVybWFuZW50KSB7CiAgICAgICAgICAgICAgICBtYXJrZXIuYmluZFRvb2x0aXAobGFiZWwsIGxhYmVsT3B0aW9ucykub3BlblRvb2x0aXAoKTsKICAgICAgICAgICAgICB9IGVsc2UgewogICAgICAgICAgICAgICAgbWFya2VyLmJpbmRUb29sdGlwKGxhYmVsLCBsYWJlbE9wdGlvbnMpOwogICAgICAgICAgICAgIH0KICAgICAgICAgICAgfSBlbHNlIHsKICAgICAgICAgICAgICBt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HRydWUpKTsKICAgICAgICAgIGlmIChsYXllci5iaW5kUG9wdXApIHsKICAgICAgICAgICAgdmFyIHBvcHVwID0gZGYuZ2V0KGksICJwb3B1cCIpOwogICAgICAgICAgICB2YXIgcG9wdXBPcHRpb25zID0gZGYuZ2V0KGksICJwb3B1cE9wdGlvbnMiKTsKICAgICAgICAgICAgaWYgKHBvcHVwICE9PSBudWxsKSB7CiAgICAgICAgICAgICAgaWYgKHBvcHVwT3B0aW9ucyAhPT0gbnVsbCkgewogICAgICAgICAgICAgICAgbGF5ZXIuYmluZFBvcHVwKHBvcHVwLCBwb3B1cE9wdGlvbnMpOwogICAgICAgICAgICAgIH0gZWxzZSB7CiAgICAgICAgICAgICAgICBsYXllci5iaW5kUG9wdXAocG9wdXApOwogICAgICAgICAgICAgIH0KICAgICAgICAgICAgfQogICAgICAgICAgfQogICAgICAgICAgaWYgKGxheWVyLmJpbmRUb29sdGlwKSB7CiAgICAgICAgICAgIHZhciBsYWJlbCA9IGRmLmdldChpLCAibGFiZWwiKTsKICAgICAgICAgICAgdmFyIGxhYmVsT3B0aW9ucyA9IGRmLmdldChpLCAibGFiZWxPcHRpb25zIik7CiAgICAgICAgICAgIGlmIChsYWJlbCAhPT0gbnVsbCkgewogICAgICAgICAgICAgIGlmIChsYWJlbE9wdGlvbnMgIT09IG51bGwpIHsKICAgICAgICAgICAgICAgIGxheWVyLmJpbmRUb29sdGlwKGxhYmVsLCBsYWJlbE9wdGlvbnMpOwogICAgICAgICAgICAgIH0gZWxzZSB7CiAgICAgICAgICAgICAgICBsYXllci5iaW5kVG9vbHRpcChsYWJlbCk7CiAgICAgICAgICAgICAgfQogICAgICAgICAgICB9CiAgICAgICAgICB9CiAgICAgICAgICBsYXllci5vbigiY2xpY2siLCBtb3VzZUhhbmRsZXIoX3RoaXM0LmlkLCB0aGlzSWQsIHRoaXNHcm91cCwgY2F0ZWdvcnkgKyAiX2NsaWNrIiksIF90aGlzNCk7CiAgICAgICAgICBsYXllci5vbigibW91c2VvdmVyIiwgbW91c2VIYW5kbGVyKF90aGlzNC5pZCwgdGhpc0lkLCB0aGlzR3JvdXAsIGNhdGVnb3J5ICsgIl9tb3VzZW92ZXIiKSwgX3RoaXM0KTsKICAgICAgICAgIGxheWVyLm9uKCJtb3VzZW91dCIsIG1vdXNlSGFuZGxlcihfdGhpczQuaWQsIHRoaXNJZCwgdGhpc0dyb3VwLCBjYXRlZ29yeSArICJfbW91c2VvdXQiKSwgX3RoaXM0KTsKICAgICAgICAgIHZhciBoaWdobGlnaHRTdHlsZSA9IGRmLmdldChpLCAiaGlnaGxpZ2h0T3B0aW9ucyIpOwoKICAgICAgICAgIGlmICghX2pxdWVyeTIuZGVmYXVsdC5pc0VtcHR5T2JqZWN0KGhpZ2hsaWdodFN0eWxlKSkgewogICAgICAgICAgICAoZnVuY3Rpb24gKCkgewoKICAgICAgICAgICAgICB2YXIgZGVmYXVsdFN0eWxlID0ge307CiAgICAgICAgICAgICAgX2pxdWVyeTIuZGVmYXVsdC5lYWNoKGhpZ2hsaWdodFN0eWxlLCBmdW5jdGlvbiAoaywgdikgewogICAgICAgICAgICAgICAgaWYgKGsgIT0gImJyaW5nVG9Gcm9udCIgJiYgayAhPSAic2VuZFRvQmFjayIpIHsKICAgICAgICAgICAgICAgICAgaWYgKGRmLmdldChpLCBrKSkgewogICAgICAgICAgICAgICAgICAgIGRlZmF1bHRTdHlsZVtrXSA9IGRmLmdldChpLCBrKTsKICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgIH0pOwoKICAgICAgICAgICAgICBsYXllci5vbigibW91c2VvdmVyIiwgZnVuY3Rpb24gKGUpIHsKICAgICAgICAgICAgICAgIHRoaXMuc2V0U3R5bGUoaGlnaGxpZ2h0U3R5bGUpOwogICAgICAgICAgICAgICAgaWYgKGhpZ2hsaWdodFN0eWxlLmJyaW5nVG9Gcm9udCkgewogICAgICAgICAgICAgICAgICB0aGlzLmJyaW5nVG9Gcm9udCgpO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eSB0aGlzIG1hdHRlcnMpLgogICAgICAgICAgICBtaXBtYXBwZXIuZ2V0QnlTaXplKGV4dGVudC54ICogMjU2LCBleHRlbnQueSAqIDI1NiwgZnVuY3Rpb24gKG1pcCkgewogICAgICAgICAgICAgIC8vIEl0J3MgcG9zc2libGUgdGhhdCB0aGUgaW1hZ2Ugd2lsbCBnbyBvZmYgdGhlIGVkZ2Ugb2YgdGhlIGNhbnZhcy0tCiAgICAgICAgICAgICAgLy8gdGhhdCdzIE9LLCB0aGUgY2FudmFzIHNob3VsZCBjbGlwIGFwcHJvcHJpYXRlbHkuCiAgICAgICAgICAgICAgY3R4LmRyYXdJbWFnZShtaXAsCiAgICAgICAgICAgICAgLy8gQ29udmVydCBhYnMgdGlsZSBjb29yZHMgdG8gcmVsIHRpbGUgY29vcmRzLCB0aGVuICoyNTYgdG8gY29udmVydAogICAgICAgICAgICAgIC8vIHRvIHJlbCBwaXhlbCBjb29yZHMKICAgICAgICAgICAgICAodG9wTGVmdC54IC0gdGlsZVBvaW50LngpICogMjU2LCAodG9wTGVmdC55IC0gdGlsZVBvaW50LnkpICogMjU2LAogICAgICAgICAgICAgIC8vIEFsd2F5cyBkcmF3IHRoZSB3aG9sZSB0aGluZyBhbmQgbGV0IGNhbnZhcyBjbGlwOyBzbyB3ZSBjYW4ganVzdAogICAgICAgICAgICAgIC8vIGNvbnZlcnQgZnJvbSBzaXplIGluIHRpbGUgY29vcmRzIHN0cmFpZ2h0IHRvIHBpeGVscwogICAgICAgICAgICAgIGV4dGVudC54ICogMjU2LCBleHRlbnQueSAqIDI1Nik7CiAgICAgICAgICAgIH0pOwogICAgICAgICAgfSBlbHNlIHsKICAgICAgICAgICAgLy8gVXNlIG1hbnVhbCBuZWFyZXN0LW5laWdoYm9yIGludGVycG9sYXRpb24KCiAgICAgICAgICAgIC8vIENhbGN1bGF0ZSB0aGUgc291cmNlIGltYWdlIHBpeGVsIGNvb3JkaW5hdGVzIHRoYXQgY29ycmVzcG9uZCB3aXRoCiAgICAgICAgICAgIC8vIHRoZSB0b3AtbGVmdCBhbmQgYm90dG9tLXJpZ2h0IG9mIHRoaXMgdGlsZS4gKElmIHRoZSBzb3VyY2UgaW1hZ2UKICAgICAgICAgICAgLy8gb25seSBwYXJ0aWFsbHkgb3ZlcmxhcHMgdGhlIHRpbGUsIHdlIHVzZSBtYXgvbWluIHRvIGxpbWl0IHRoZQogICAgICAgICAgICAvLyBzb3VyY2VTdGFydC9FbmQgdG8gb25seSByZWZsZWN0IHRoZSBvdmVybGFwcGluZyBwb3J0aW9uLikKICAgICAgICAgICAgdmFyIHNvdXJjZVN0YXJ0ID0gewogICAgICAgICAgICAgIHg6IE1hdGgubWF4KDAsIE1hdGguZmxvb3IoKHRpbGVQb2ludC54IC0gdG9wTGVmdC54KSAqIGltZ1Jlcy54KSksCiAgICAgICAgICAgICAgeTogTWF0aC5tYXgoMCwgTWF0aC5mbG9vcigodGlsZVBvaW50LnkgLSB0b3BMZWZ0LnkpICogaW1nUmVzLnkpKQogICAgICAgICAgICB9OwogICAgICAgICAgICB2YXIgc291cmNlRW5kID0gewogICAgICAgICAgICAgIHg6IE1hdGgubWluKHcsIE1hdGguY2VpbCgodGlsZVBvaW50LnggKyAxIC0gdG9wTGVmdC54KSAqIGltZ1Jlcy54KSksCiAgICAgICAgICAgICAgeTogTWF0aC5taW4oaCwgTWF0aC5jZWlsKCh0aWxlUG9pbnQueSArIDEgLSB0b3BMZWZ0LnkpICogaW1nUmVzLnkpKQogICAgICAgICAgICB9OwoKICAgICAgICAgICAgLy8gVGhlIHNpemUsIGluIGRlc3QgcGl4ZWxzLCB0aGF0IGVhY2ggc291cmNlIHBpeGVsIHNob3VsZCBvY2N1cHkuCiAgICAgICAgICAgIC8vIFRoaXMgbWlnaHQgYmUgZ3JlYXRlciBvciBsZXNzIHRoYW4gMSAoZS5nLiBpZiB4IGFuZCB5IHJlc29sdXRpb24KICAgICAgICAgICAgLy8gYXJlIHZlcnkgZGlmZmVyZW50KS4KICAgICAgICAgICAgdmFyIHBpeGVsU2l6ZSA9IHsKICAgICAgICAgICAgICB4OiAyNTYgLyBpbWdSZXMueCwKICAgICAgICAgICAgICB5OiAyNTYgLyBpbWdSZXMueQogICAgICAgICAgICB9OwoKICAgICAgICAgICAgLy8gRm9yIGVhY2ggcGl4ZWwgaW4gdGhlIHNvdXJjZSBpbWFnZSB0aGF0IG92ZXJsYXBzIHRoZSB0aWxlLi4uCiAgICAgICAgICAgIGZvciAodmFyIHJvdyA9IHNvdXJjZVN0YXJ0Lnk7IHJvdyA8IHNvdXJjZUVuZC55OyByb3crKykgewogICAgICAgICAgICAgIGZvciAodmFyIGNvbCA9IHNvdXJjZVN0YXJ0Lng7IGNvbCA8IHNvdXJjZUVuZC54OyBjb2wrKykgewogICAgICAgICAgICAgICAgLy8gLi4uZXh0cmFjdCB0aGUgcGl4ZWwgZGF0YS4uLgogICAgICAgICAgICAgICAgdmFyIGkgPSAocm93ICogdyArIGNvbCkgKiA0OwogICAgICAgICAgICAgICAgdmFyIHIgPSBpbWdEYXRhW2ldOwogICAgICAgICAgICAgICAgdmFyIGcgPSBpbWdEYXRhW2kgKyAxXTsKICAgICAgICAgICAgICAgIHZhciBiID0gaW1nRGF0YVtpICsgMl07CiAgICAgICAgICAgICAgICB2YXIgYSA9IGltZ0RhdGFbaSArIDNdOwogICAgICAgICAgICAgICAgY3R4LmZpbGxTdHlsZSA9ICJyZ2JhKCIgKyBbciwgZywgYiwgYSAvIDI1NV0uam9pbigiLCIpICsgIikiOwoKICAgICAgICAgICAgICAgIC8vIC4uLmNhbGN1bGF0ZSB0aGUgY29ycmVzcG9uZGluZyBwaXhlbCBjb29yZCBpbiB0aGUgZGVzdCBpbWFnZQogICAgICAgICAgICAgICAgLy8gd2hlcmUgaXQgc2hvdWxkIGJlIGRyYXduLi4uCiAgICAgICAgICAgICAgICB2YXIgcGl4ZWxQb3MgPSB7CiAgICAgICAgICAgICAgICAgIHg6IChjb2wgLyBpbWdSZXMueCArIHRvc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zYWJsZSgpOwogICAgICAgICAgICAgICAgICBidG4uc3RhdGUoInNlbGVjdC1pbmFjdGl2ZSIpOwogICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgIH0KICAgICAgICAgICAgfSk7CiAgICAgICAgICAgIHZhciBoYW5kbGVyID0gZnVuY3Rpb24gaGFuZGxlcihlKSB7CiAgICAgICAgICAgICAgX3RoaXM5LmxheWVyTWFuYWdlci5icnVzaChfdGhpczkuX2xvY2F0aW9uRmlsdGVyLmdldEJvdW5kcygpLCB7IHNlbmRlcjogc2VsZWN0aW9uSGFuZGxlIH0pOwogICAgICAgICAgICB9OwogICAgICAgICAgICBfdGhpczkuX2xvY2F0aW9uRmlsdGVyLm9uKCJlbmFibGVkIiwgaGFuZGxlcik7CiAgICAgICAgICAgIF90aGlzOS5fbG9jYXRpb25GaWx0ZXIub24oImNoYW5nZSIsIGhhbmRsZXIpOwogICAgICAgICAgICBfdGhpczkuX2xvY2F0aW9uRmlsdGVyLm9uKCJkaXNhYmxlZCIsIGZ1bmN0aW9uICgpIHsKICAgICAgICAgICAgICBzZWxlY3Rpb25IYW5kbGUuY2xvc2UoKTsKICAgICAgICAgICAgICBfdGhpczkuX2xvY2F0aW9uRmlsdGVyID0gbnVsbDsKICAgICAgICAgICAgfSk7CiAgICAgICAgICB9KSgpOwogICAgICAgIH0KCiAgICAgICAgX3RoaXM5Ll9sb2NhdGlvbkZpbHRlci5hZGRUbyhtYXApOwogICAgICB9CiAgICB9LCB7CiAgICAgIHN0YXRlTmFtZTogInNlbGVjdC1hY3RpdmUiLAogICAgICBpY29uOiAiaW9uLWNsb3NlLXJvdW5kIiwKICAgICAgdGl0bGU6ICJEaXNtaXNzIHNlbGVjdGlvbiIsCiAgICAgIG9uQ2xpY2s6IGZ1bmN0aW9uIG9uQ2xpY2soYnRuLCBtYXApIHsKICAgICAgICBidG4uc3RhdGUoInNlbGVjdC1pbmFjdGl2ZSIpOwogICAgICAgIF90aGlzOS5fbG9jYXRpb25GaWx0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cnNbMF07CiAgICAgIHZhciB0ZXN0TmV4dCA9IGZ1bmN0aW9uIHRlc3ROZXh0KCkgewogICAgICAgIF90aGlzLmdldEJ5SW5kZXgoaSwgZnVuY3Rpb24gKGltZykgewogICAgICAgICAgLy8gSWYgY3VycmVudCBpbWFnZSBpcyBpbnZhbGlkIChpLmUuIHRvbyBzbWFsbCB0byBiZSByZW5kZXJlZCkgb3IKICAgICAgICAgIC8vIGl0J3Mgc21hbGxlciB0aGFuIHdoYXQgd2Ugd2FudGVkLCByZXR1cm4gdGhlIGxhc3Qga25vd24gZ29vZCBpbWFnZS4KICAgICAgICAgIGlmICghaW1nIHx8IGltZy53aWR0aCA8IGRlc2lyZWRXaWR0aCB8fCBpbWcuaGVpZ2h0IDwgZGVzaXJlZEhlaWdodCkgewogICAgICAgICAgICBjYWxsYmFjayhsYXN0SW1nKTsKICAgICAgICAgICAgcmV0dXJuOwogICAgICAgICAgfSBlbHNlIHsKICAgICAgICAgICAgbGFzdEltZyA9IGltZzsKICAgICAgICAgICAgaSsrOwogICAgICAgICAgICB0ZXN0TmV4dCgpOwogICAgICAgICAgICByZXR1cm47CiAgICAgICAgICB9CiAgICAgICAgfSk7CiAgICAgIH07CiAgICAgIHRlc3ROZXh0KCk7CiAgICB9CiAgfSwgewogICAga2V5OiAiZ2V0QnlJbmRleCIsCiAgICB2YWx1ZTogZnVuY3Rpb24gZ2V0QnlJbmRleChpLCBjYWxsYmFjaykgewogICAgICB2YXIgX3RoaXMyID0gdGhpczsKCiAgICAgIGlmICh0aGlzLl9sYXllcnNbaV0pIHsKICAgICAgICBjYWxsYmFjayh0aGlzLl9sYXllcnNbaV0pOwogICAgICAgIHJldHVybjsKICAgICAgfQoKICAgICAgdGhpcy5nZXRCeUluZGV4KGkgLSAxLCBmdW5jdGlvbiAocHJldkltZykgewogICAgICAgIGlmICghcHJldkltZykgewogICAgICAgICAgLy8gcHJldkltZyBjb3VsZCBub3QgYmUgY2FsY3VsYXRlZCAodG9vIHNtYWxsLCBwb3NzaWJseSkKICAgICAgICAgIGNhbGxiYWNrKG51bGwpOwogICAgICAgICAgcmV0dXJuOwogICAgICAgIH0KICAgICAgICBpZiAocHJldkltZy53aWR0aCA8IDIgfHwgcHJldkltZy5oZWlnaHQgPCAyKSB7CiAgICAgICAgICAvLyBDYW4ndCByZWR1Y2UgdGhpcyBpbWFnZSBhbnkgZnVydGhlcgogICAgICAgICAgY2FsbGJhY2sobnVsbCk7CiAgICAgICAgICByZXR1cm47CiAgICAgICAgfQogICAgICAgIC8vIElmIHJlZHVjZSBldmVyIGJlY29tZXMgdHJ1bHkgYXN5bmNocm9ub3VzLCB3ZSBzaG91bGQgc3R1ZmYgYSBwcm9taXNlIG9yCiAgICAgICAgLy8gc29tZXRoaW5nIGludG8gdGhpcy5fbGF5ZXJzW2ldIGJlZm9yZSBjYWxsaW5nIHRoaXMucmVkdWNlKCksIHRvIHByZXZlbnQKICAgICAgICAvLyByZWR1bmRhbnQgcmVkdWNlIG9wZXJhdGlvbnMgZnJvbSBoYXBwZW5pbmcuCiAgICAgICAgX3RoaXMyLnJlZHVjZShwcmV2SW1nLCBmdW5jdGlvbiAocmVkdWNlZEltZykgewogICAgICAgICAgX3RoaXMyLl9sYXllcnNbaV0gPSByZWR1Y2VkSW1nOwogICAgICAgICAgY2FsbGJhY2socmVkdWNlZEltZyk7CiAgICAgICAgICByZXR1cm47CiAgICAgICAgfSk7CiAgICAgIH0pOwogICAgfQogIH0sIHsKICAgIGtleTogInJlZHVjZSIsCiAgICB2YWx1ZTogZnVuY3Rpb24gcmVkdWNlKGltZywgY2FsbGJhY2spIHsKICAgICAgdmFyIGltZ0RhdGFDYW52YXMgPSBkb2N1bWVudC5jcmVhdGVFbGVtZW50KCJjYW52YXMiKTsKICAgICAgaW1nRGF0YUNhbnZhcy53aWR0aCA9IE1hdGguY2VpbChpbWcud2lkdGggLyAyKTsKICAgICAgaW1nRGF0YUNhbnZhcy5oZWlnaHQgPSBNYXRoLmNlaWwoaW1nL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KDE6NjMzNjApCgkJCXVybDogJy8vbmxzLXtzfS50aWxlc2VydmVyLmNvbS9ubHMve3p9L3t4fS97eX0uanBnJywKCQkJb3B0aW9uczogewoJCQkJYXR0cmlidXRpb246ICc8YSBocmVmPSJodHRwOi8vZ2VvLm5scy51ay9tYXBzLyI+TmF0aW9uYWwgTGlicmFyeSBvZiBTY290bGFuZCBIaXN0b3JpYyBNYXBzPC9hPicsCgkJCQlib3VuZHM6IFtbNDkuNiwgLTEyXSwgWzYxLjcsIDNdXSwKCQkJCW1pblpvb206IDEsCgkJCQltYXhab29tOiAxOCwKCQkJCXN1YmRvbWFpbnM6ICcwMTIzJywKCQkJfQoJCX0KCX07CgoJTC50aWxlTGF5ZXIucHJvdmlkZXIgPSBmdW5jdGlvbiAocHJvdmlkZXIsIG9wdGlvbnMpIHsKCQlyZXR1cm4gbmV3IEwuVGlsZUxheWVyLlByb3ZpZGVyKHByb3ZpZGVyLCBvcHRpb25zKTsKCX07CgoJcmV0dXJuIEw7Cn0pKTsK"></script> <script src="data:application/x-javascript;base64,TGVhZmxldFdpZGdldC5tZXRob2RzLmFkZFByb3ZpZGVyVGlsZXMgPSBmdW5jdGlvbihwcm92aWRlciwgbGF5ZXJJZCwgZ3JvdXAsIG9wdGlvbnMpIHsNCiAgdGhpcy5sYXllck1hbmFnZXIuYWRkTGF5ZXIoTC50aWxlTGF5ZXIucHJvdmlkZXIocHJvdmlkZXIsIG9wdGlvbnMpLCAidGlsZSIsIGxheWVySWQsIGdyb3VwKTsNCn07DQo="></script> <script src="data:application/x-javascript;base64,KGZ1bmN0aW9uIGUodCxuLHIpe2Z1bmN0aW9uIHMobyx1KXtpZighbltvXSl7aWYoIXRbb10pe3ZhciBhPXR5cGVvZiByZXF1aXJlPT0iZnVuY3Rpb24iJiZyZXF1aXJlO2lmKCF1JiZhKXJldHVybiBhKG8sITApO2lmKGkpcmV0dXJuIGkobywhMCk7dmFyIGY9bmV3IEVycm9yKCJDYW5ub3QgZmluZCBtb2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AgIHdoaWxlIChwb2ludHMubGVuZ3RoIDwgNCkgcG9pbnRzLnB1c2gocG9pbnRzWzBdLnNsaWNlKCkpOwogICAgICByZXR1cm4gcG9pbnRzOwogICAgfQoKICAgIGZ1bmN0aW9uIHBvbHlnb24oYXJjcykgewogICAgICByZXR1cm4gYXJjcy5tYXAocmluZyk7CiAgICB9CgogICAgZnVuY3Rpb24gZ2VvbWV0cnkobykgewogICAgICB2YXIgdCA9IG8udHlwZTsKICAgICAgcmV0dXJuIHQgPT09ICJHZW9tZXRyeUNvbGxlY3Rpb24iID8ge3R5cGU6IHQsIGdlb21ldHJpZXM6IG8uZ2VvbWV0cmllcy5tYXAoZ2VvbWV0cnkpfQogICAgICAgICAgOiB0IGluIGdlb21ldHJ5VHlwZSA/IHt0eXBlOiB0LCBjb29yZGluYXRlczogZ2VvbWV0cnlUeXBlW3RdKG8pfQogICAgICAgICAgOiBudWxsOwogICAgfQoKICAgIHZhciBnZW9tZXRyeVR5cGUgPSB7CiAgICAgIFBvaW50OiBmdW5jdGlvbihvKSB7IHJldHVybiBwb2ludChvLmNvb3JkaW5hdGVzKTsgfSwKICAgICAgTXVsdGlQb2ludDogZnVuY3Rpb24obykgeyByZXR1cm4gby5jb29yZGluYXRlcy5tYXAocG9pbnQpOyB9LAogICAgICBMaW5lU3RyaW5nOiBmdW5jdGlvbihvKSB7IHJldHVybiBsaW5lKG8uYXJjcyk7IH0sCiAgICAgIE11bHRpTGluZVN0cmluZzogZnVuY3Rpb24obykgeyByZXR1cm4gby5hcmNzLm1hcChsaW5lKTsgfSwKICAgICAgUG9seWdvbjogZnVuY3Rpb24obykgeyByZXR1cm4gcG9seWdvbihvLmFyY3MpOyB9LAogICAgICBNdWx0aVBvbHlnb246IGZ1bmN0aW9uKG8pIHsgcmV0dXJuIG8uYXJjcy5tYXAocG9seWdvbik7IH0KICAgIH07CgogICAgcmV0dXJuIGdlb21ldHJ5KG8pOwogIH0KCiAgZnVuY3Rpb24gc3RpdGNoQXJjc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5Z29uLl8gPSAxOwogICAgICAgIGNvbXBvbmVudHMucHVzaChjb21wb25lbnQpOwogICAgICAgIHdoaWxlIChwb2x5Z29uID0gbmVpZ2hib3JzLnBvcCgpKSB7CiAgICAgICAgICBjb21wb25lbnQucHVzaChwb2x5Z29uKTsKICAgICAgICAgIHBvbHlnb24uZm9yRWFjaChmdW5jdGlvbihyaW5nJCQpIHsKICAgICAgICAgICAgcmluZyQkLmZvckVhY2goZnVuY3Rpb24oYXJjKSB7CiAgICAgICAgICAgICAgcG9seWdvbnNCeUFyY1thcmMgPCAwID8gfmFyYyA6IGFyY10uZm9yRWFjaChmdW5jdGlvbihwb2x5Z29uKSB7CiAgICAgICAgICAgICAgICBpZiAoIXBvbHlnb24uXykgewogICAgICAgICAgICAgICAgICBwb2x5Z29uLl8gPSAxOwogICAgICAgICAgICAgICAgICBuZWlnaGJvcnMucHVzaChwb2x5Z29uKTsKICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICB9KTsKICAgICAgICAgICAgfSk7CiAgICAgICAgICB9KTsKICAgICAgICB9CiAgICAgIH0KICAgIH0pOwoKICAgIHBvbHlnb25zLmZvckVhY2goZnVuY3Rpb24ocG9seWdvbikgewogICAgICBkZWxldGUgcG9seWdvbi5fOwogICAgfSk7CgogICAgcmV0dXJuIHsKICAgICAgdHlwZTogIk11bHRpUG9seWdvbiIsCiAgICAgIGFyY3M6IGNvbXBvbmVudHMubWFwKGZ1bmN0aW9uKHBvbHlnb25zKSB7CiAgICAgICAgdmFyIGFyY3MgPSBbXSwgbjsKCiAgICAgICAgLy8gRXh0cmFjdCB0aGUgZXh0ZXJpb3IgKHVuaXF1ZSkgYXJjcy4KICAgICAgICBwb2x5Z29ucy5mb3JFYWNoKGZ1bmN0aW9uKHBvbHlnb24pIHsKICAgICAgICAgIHBvbHlnb24uZm9yRWFjaChmdW5jdGlvbihyaW5nJCQpIHsKICAgICAgICAgICAgcmluZyQkLmZvckVhY2goZnVuY3Rpb24oYXJjKSB7Ci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ZnVuY3Rpb24ocmVtb3ZlZCkgewogICAgICB2YXIgaSA9IHJlbW92ZWQuXywgb2JqZWN0OwogICAgICBpZiAoYXJyYXlbaV0gIT09IHJlbW92ZWQpIHJldHVybjsgLy8gaW52YWxpZCByZXF1ZXN0CiAgICAgIGlmIChpICE9PSAtLXNpemUpIG9iamVjdCA9IGFycmF5W3NpemVdLCAoY29tcGFyZUFyZWEob2JqZWN0LCByZW1vdmVkKSA8IDAgPyB1cCA6IGRvd24pKGFycmF5W29iamVjdC5fID0gaV0gPSBvYmplY3QsIGkpOwogICAgICByZXR1cm4gaTsKICAgIH07CgogICAgZnVuY3Rpb24gdXAob2JqZWN0LCBpKSB7CiAgICAgIHdoaWxlIChpID4gMCkgewogICAgICAgIHZhciBqID0gKChpICsgMSkgPj4gMSkgLSAxLAogICAgICAgICAgICBwYXJlbnQgPSBhcnJheVtqXTsKICAgICAgICBpZiAoY29tcGFyZUFyZWEob2JqZWN0LCBwYXJlbnQpID49IDApIGJyZWFrOwogICAgICAgIGFycmF5W3BhcmVudC5fID0gaV0gPSBwYXJlbnQ7CiAgICAgICAgYXJyYXlbb2JqZWN0Ll8gPSBpID0gal0gPSBvYmplY3Q7CiAgICAgIH0KICAgIH0KCiAgICBmdW5jdGlvbiBkb3duKG9iamVjdCwgaSkgewogICAgICB3aGlsZSAodHJ1ZSkgewogICAgICAgIHZhciByID0gKGkgKyAxKSA8PCAxLAogICAgICAgICAgICBsID0gciAtIDEsCiAgICAgICAgICAgIGogPSBpLAogICAgICAgICAgICBjaGlsZCA9IGFycmF5W2pdOwogICAgICAgIGlmIChsIDwgc2l6ZSAmJiBjb21wYXJlQXJlYShhcnJheVtsXSwgY2hpbGQpIDwgMCkgY2hpbGQgPSBhcnJheVtqID0gbF07CiAgICAgICAgaWYgKHIgPCBzaXplICYmIGNvbXBhcmVBcmVhKGFycmF5W3JdLCBjaGlsZCkgPCAwKSBjaGlsZCA9IGFycmF5W2ogPSByXTsKICAgICAgICBpZiAoaiA9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VwbGFjZSh0cmltU3BhY2UsICcnKS5zcGxpdChzcGxpdFNwYWNlKSwKICAgICAgICAgICAgbyA9IFtdOwogICAgICAgIGZvciAodmFyIGkgPSAwOyBpIDwgY29vcmRzLmxlbmd0aDsgaSsrKSB7CiAgICAgICAgICAgIG8ucHVzaChjb29yZDEoY29vcmRzW2ldKSk7CiAgICAgICAgfQogICAgICAgIHJldHVybiBvOwogICAgfQogICAgZnVuY3Rpb24gY29vcmRQYWlyKHgpIHsKICAgICAgICB2YXIgbGwgPSBbYXR0cmYoeCwgJ2xvbicpLCBhdHRyZih4LCAnbGF0JyldLAogICAgICAgICAgICBlbGUgPSBnZXQxKHgsICdlbGUnKSwKICAgICAgICAgICAgLy8gaGFuZGxlIG5hbWVzcGFjZWQgYXR0cmlidXRlIGluIGJyb3dzZXIKICAgICAgICAgICAgaGVhcnRSYXRlID0gZ2V0MSh4LCAnZ3B4dHB4OmhyJykgfHwgZ2V0MSh4LCAnaHInKSwKICAgICAgICAgICAgdGltZSA9IGdldDEoeCwgJ3RpbWUnKSwKICAgICAgICAgICAgZTsKICAgICAgICBpZiAoZWxlKSB7CiAgICAgICAgICAgIGUgPSBwYXJzZUZsb2F0KG5vZGVWYWwoZWxlKSk7CiAgICAgICAgICAgIGlmICghaXNOYU4oZSkpIHsKICAgICAgICAgICAgICAgIGxsLnB1c2goZSk7CiAgICAgICAgICAgIH0KICAgICAgICB9CiAgICAgICAgcmV0dXJuIHsKICAgICAgICAgICAgY29vcmRpbmF0ZXM6IGxsLAogICAgICAgICAgICB0aW1lOiB0aW1lID8gbm9kZVZhbCh0aW1lKSA6IG51bGwsCiAgICAgICAgICAgIGhlYXJ0UmF0ZTogaGVhcnRSYXRlID8gcGFyc2VGbG9hdChub2RlVmFsKGhlYXJ0UmF0ZSkpIDogbnVsbAogICAgICAgIH07CiAgICB9CgogICAgLy8gY3JlYXRlIGEgbmV3IGZlYXR1cmUgY29sbGVjdGlvbiBwYXJlbnQgb2JqZWN0CiAgICBmdW5jdGlvbiBmYygpIHsKICAgICAgICByZXR1cm4gewogICAgICAgICAgICB0eXBlOiAnRmVhdHVyZUNvbGxlY3Rpb24nLAogICAgICAgICAgICBmZWF0dXJlczogW10KICAgICAgICB9OwogICAgfQoKICAgIHZhciBzZXJpYWxpemVyOwogICAgaWYgKHR5cGVvZiBYTUxTZXJpYWxpemVyICE9PSAndW5kZWZpbmVkJykgewogICAgICAgIC8qIGlzdGFuYnVsIGlnbm9yZSBuZXh0ICovCiAgICAgICAgc2VyaWFsaXplciA9IG5ldyBYTUxTZXJpYWxpemVyKCk7CiAgICAvLyBvbmx5IHJlcXVpcmUgeG1sZG9tIGluIGEgbm9kZSBlbnZpcm9ubWVudAogICAgfSBlbHNlIGlmICh0eXBlb2YgZXhwb3J0cyA9PT0gJ29iamVjdCcgJiYgdHlwZW9mIHByb2Nlc3MgPT09ICdvYmplY3QnICYmICFwcm9jZXNzLmJyb3dzZXIpIHsKICAgICAgICBzZXJpYWxpemVyID0gbmV3IChyZXF1aXJlKCd4bWxkb20nKS5YTUxTZXJpYWxpemVyKSgpOwogICAgfQogICAgZnVuY3Rpb24geG1sMnN0cihzdHIpIHsKICAgICAgICAvLyBJRTkgd2lsbCBjcmVhdGUgYSBuZXcgWE1MU2VyaWFsaXplciBidXQgaXQnbGwgY3Jhc2ggaW1tZWRpYXRlbHkuCiAgICAgICAgLy8gVGhpcyBsaW5lIGlzIGlnbm9yZWQgYmVjYXVzZSB3ZSBkb24ndCBydW4gY292ZXJhZ2UgdGVzdHMgaW4gSUU5CiAgICAgICAgLyogaXN0YW5idWwgaWdub3JlIG5leHQgKi8KICAgICAgICBpZiAoc3RyLnhtbCAhPT0gdW5kZWZpbmVkKSByZXR1cm4gc3RyLnhtbDsKICAgICAgICByZXR1cm4gc2VyaWFsaXplci5zZXJpYWxpemVUb1N0cmluZyhzdHIpOwogICAgfQoKICAgIHZhciB0ID0gewogICAgICAgIGttbDogZnVuY3Rpb24oZG9jKSB7CgogICAgICAgICAg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1tsXSkpLnRvU3RyaW5nKDE2KTsKICAgICAgICAgICAgfQogICAgICAgICAgICBmb3IgKHZhciBqID0gMDsgaiA8IHBsYWNlbWFya3MubGVuZ3RoOyBqKyspIHsKICAgICAgICAgICAgICAgIGdqLmZlYXR1cmVzID0gZ2ouZmVhdHVyZXMuY29uY2F0KGdldFBsYWNlbWFyayhwbGFjZW1hcmtzW2pdKSk7CiAgICAgICAgICAgIH0KICAgICAgICAgICAgZnVuY3Rpb24ga21sQ29sb3IodikgewogICAgICAgICAgICAgICAgdmFyIGNvbG9yLCBvcGFjaXR5OwogICAgICAgICAgICAgICAgdiA9IHYgfHwgJyc7CiAgICAgICAgICAgICAgICBpZiAodi5zdWJzdHIoMCwgMSkgPT09ICcjJykgeyB2ID0gdi5zdWJzdHIoMSk7IH0KICAgICAgICAgICAgICAgIGlmICh2Lmxlbmd0aCA9PT0gNiB8fCB2Lmxlbmd0aCA9PT0gMykgeyBjb2xvciA9IHY7IH0KICAgICAgICAgICAgICAgIGlmICh2Lmxlbmd0aCA9PT0gOCkgewogICAgICAgICAgICAgICAgICAgIG9wYWNpdHkgPSBwYXJzZUludCh2LnN1YnN0cigwLCAyKSwgMTYpIC8gMjU1OwogICAgICAgICAgICAgICAgICAgIGNvbG9yID0gJyMnK3Yuc3Vic3RyKDIpOwogICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgcmV0dXJuIFtjb2xvciwgaXNOYU4ob3BhY2l0eSkgPyB1bmRlZmluZWQgOiBvcGFjaXR5XTsKICAgICAgICAgICAgfQogICAgICAgICAgICBmdW5jdGlvbiBneENvb3JkKHYpIHsgcmV0dXJuIG51bWFycmF5KHYuc3BsaXQoJyAnKSk7IH0KICAgICAgICAgICAgZnVuY3Rpb24gZ3hDb29yZHMocm9vdCkgewogICAgICAgICAgICAgICAgdmFyIGVsZW1zID0gZ2V0KHJvb3QsICdjb29yZCcsICdneCcpLCBjb29yZHMgPSBbXSwgdGltZXMgPSBbXTsKICAgICAgICAgICAgICAgIGlmIChlbGVtcy5sZW5ndGggPT09IDApIGVsZW1zID0gZ2V0KHJvb3QsICdneDpjb29yZCcpOwogICAgICAgICAgICAgICAgZm9yICh2YXIgaSA9IDA7IGkgPCBlbGVtcy5sZW5ndGg7IGkrKykgY29vcmRzLnB1c2goZ3hDb29yZChub2RlVmFsKGVsZW1zW2ldKSkpOwogICAgICAgICAgICAgICAgdmFyIHRpbWVFbGVtcyA9IGdldChyb290LCAnd2hlbicpOwogICAgICAgICAgICAgICAgZm9yICh2YXIgaiA9IDA7IGogPCB0aW1lRWxlbXMubGVuZ3RoOyBqKyspIHRpbWVzLnB1c2gobm9kZVZhbCh0aW1lRWxlbXNbal0pKTsKICAgICAgICAgICAgICAgIHJldHVybiB7CiAgICAgICAgICAgICAgICAgICAgY29vcmRzOiBjb29yZHMsCiAgICAgICAgICAgICAgICAgICAgdGltZXM6IHRpbWVzCiAgICAgICAgICAgICAgICB9OwogICAgICAgICAgICB9CiAgICAgICAgICAgIGZ1bmN0aW9uIGdldEdlb21ldHJ5KHJvb3QpIHsKICAgICAgICAgICAgICAgIHZhciBnZW9tTm9kZSwgZ2VvbU5vZGVzLCBpLCBqLCBrLCBnZW9tcyA9IFtdLCBjb29yZFRpbWVzID0gW107CiAgICAgICAgICAgICAgICBpZiAoZ2V0MShyb290LCAnTXVsdGlHZW9tZXRyeScpKSB7IHJldHVybiBnZXRHZW9tZXRyeShnZXQxKHJvb3QsICdNdWx0aUdlb21ldHJ5JykpOyB9CiAgICAgICAgICAgICAgICBpZiAoZ2V0MShyb290LCAnTXVsdGlUcmFjaycpKSB7IHJldHVybiBnZXRHZW9tZXRyeShnZXQxKHJvb3QsICdNdWx0aVRyYWNrJykpOyB9CiAgICAgICAgICAgICAgICBpZiAoZ2V0MShyb290LCAnZ3g6TXVsdGlUcmFjaycpKSB7IHJldHVybiBnZXRHZW9tZXRyeShnZXQxKHJvb3QsICdneDpNdWx0aVRyYWNrJykpOyB9CiAgICAgICAgICAgICAgICBmb3IgKGkgPSAwOyBpIDwgZ2VvdHlwZXMubGVuZ3RoOyBpKyspIHsKICAgICAgICAgICAgICAgICAgICBnZW9tTm9kZXMgPSBnZXQocm9vdCwgZ2VvdHlwZXNbaV0pOwogICAgICAgICAgICAgICAgICAgIGlmIChnZW9tTm9kZXMpIHsKICAgICAgICAgICAgICAgICAgICAgICAgZm9yIChqID0gMDsgaiA8IGdlb21Ob2Rlcy5sZW5ndGg7IGorKykgewogICAgICAgICAgICAgICAgICAgICAgICAgICAgZ2VvbU5vZGUgPSBnZW9tTm9kZXNbal07CiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoZ2VvdHlwZXNbaV0gPT09ICdQb2ludCcpIHsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBnZW9tcy5wdXNoKHsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdHlwZTogJ1BvaW50JywKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY29vcmRpbmF0ZXM6IGNvb3JkMShub2RlVmFsKGdldDEoZ2VvbU5vZGUsICdjb29yZGluYXRlcycpKSkKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9KTsKICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAoZ2VvdHlwZXNbaV0gPT09ICdMaW5lU3RyaW5nJykgewogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGdlb21zLnB1c2goewogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0eXBlOiAnTGluZVN0cmluZycsCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvb3JkaW5hdGVzOiBjb29yZChub2RlVmFsKGdldDEoZ2VvbU5vZGUsICdjb29yZGluYXRlcycpKSkKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9KTsKICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAoZ2VvdHlwZXNbaV0gPT09ICdQb2x5Z29uJykgewogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhciByaW5ncyA9IGdldChnZW9tTm9kZSwgJ0xpbmVhclJpbmcnKSwKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY29vcmRzID0gW107CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZm9yIChrID0gMDsgayA8IHJpbmdzLmxlbmd0aDsgaysrKSB7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvb3Jkcy5wdXNoKGNvb3JkKG5vZGVWYWwoZ2V0MShyaW5nc1trXSwgJ2Nvb3JkaW5hdGVzJykpKSk7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGdlb21zLnB1c2goewogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0eXBlOiAnUG9seWdvbicsCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvb3JkaW5hdGVzOiBjb29yZHMKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9KTsKICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAoZ2VvdHlwZXNbaV0gPT09ICdUcmFjaycgfHwKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBnZW90eXBlc1tpXSA9PT0gJ2d4OlRyYWNrJykgewogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhciB0cmFjayA9IGd4Q29vcmRzKGdlb21Ob2RlKTsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBnZW9tcy5wdXNoKHsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdHlwZTogJ0xpbmVTdHJpbmcnLAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb29yZGluYXRlczogdHJhY2suY29vcmRzCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSk7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHRyYWNrLnRpbWVzLmxlbmd0aCkgY29vcmRUaW1lcy5wdXNoKHRyYWNrLnRpbWVzKTsKICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgIHJldHVybiB7CiAgICAgICAgICAgICAgICAgICAgZ2VvbXM6IGdlb21zLAogICAgICAgICAgICAgICAgICAgIGNvb3JkVGltZXM6IGNvb3JkVGltZXMKICAgICAgICAgICAgICAgIH07CiAgICAgICAgICAgIH0KICAgICAgICAgICAgZnVuY3Rpb24gZ2V0UGxhY2VtYXJrKHJvb3QpIHsKICAgICAgICAgICAgICAgIHZhciBnZW9tc0FuZFRpbWVzID0gZ2V0R2VvbWV0cnkocm9vdCksIGksIHByb3BlcnRpZXMgPSB7fSwKICAgICAgICAgICAgICAgICAgICBuYW1lID0gbm9kZVZhbChnZXQxKHJvb3QsICduYW1lJykpLAogICAgICAgICAgICAgICAgICAgIHN0eWxlVXJsID0gbm9kZVZhbChnZXQxKHJvb3QsICdzdHlsZVVybCcpKSwKICAgICAgICAgICAgICAgICAgICBkZXNjcmlwdGlvbiA9IG5vZGVWYWwoZ2V0MShyb290LCAnZGVzY3JpcHRpb24nKSksCiAgICAgICAgICAgICAgICAgICAgdGltZVNwYW4gPSBnZXQxKHJvb3QsICdUaW1lU3BhbicpLAogICAgICAgICAgICAgICAgICAgIGV4dGVuZGVkRGF0YSA9IGdldDEocm9vdCwgJ0V4dGVuZGVkRGF0YScpLAogICAgICAgICAgICAgICAgICAgIGxpbmVTdHlsZSA9IGdldDEocm9vdCwgJ0xpbmVTdHlsZScpLAogICAgICAgICAgICAgICAgICAgIHBvbHlTdHlsZSA9IGdldDEocm9vdCwgJ1BvbHlTdHlsZScpOwoKICAgICAgICAgICAgICAgIGlmICghZ2VvbXNBbmRUaW1lcy5nZW9tcy5sZW5ndGgpIHJldHVybiBbXTsKICAgICAgICAgICAgICAgIGlmIChuYW1lKSBwcm9wZXJ0aWVzLm5hbWUgPSBuYW1lOwogICAgICAgICAgICAgICAgaWYgKHN0eWxlVXJsWzBdICE9PSAnIycpIHsKICAgICAgICAgICAgICAgICAgICBzdHlsZVVybCA9ICcjJyArIHN0eWxlVXJsOwogICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgaWYgKHN0eWxlVXJsICYmIHN0eWxlSW5kZXhbc3R5bGVVcmxdKSB7CiAgICAgICAgICAgICAgICAgICAgcHJvcGVydGllcy5zdHlsZVVybCA9IHN0eWxlVXJsOwogICAgICAgICAgICAgICAgICAgIHByb3BlcnRpZXMuc3R5bGVIYXNoID0gc3R5bGVJbmRleFtzdHlsZVVybF07CiAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICBpZiAoZGVzY3JpcHRpb24pIHByb3BlcnRpZXMuZGVzY3JpcHRpb24gPSBkZXNjcmlwdGlvbjsKICAgICAgICAgICAgICAgIGlmICh0aW1lU3BhbikgewogICAgICAgICAgICAgICAgICAgIHZhciBiZWdpbiA9IG5vZGVWYWwoZ2V0MSh0aW1lU3BhbiwgJ2JlZ2luJykpOwogICAgICAgICAgICAgICAgICAgIHZhciBlbmQgPSBub2RlVmFsKGdldDEodGltZVNwYW4sICdlbmQnKSk7CiAgICAgICAgICAgICAgICAgICAgcHJvcGVydGllcy50aW1lc3BhbiA9IHsgYmVnaW46IGJlZ2luLCBlbmQ6IGVuZCB9OwogICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgaWYgKGxpbmVTdHlsZSkgewogICAgICAgICAgICAgICAgICAgIHZhciBsaW5lc3R5bGVzID0ga21sQ29sb3Iobm9kZVZhbChnZXQxKGxpbmVTdHlsZSwgJ2NvbG9yJykpKSwKICAgICAgICAgICAgICAgICAgICAgICAgY29sb3IgPSBsaW5lc3R5bGVzWzBdLAogICAgICAgICAgICAgICAgICAgICAgICBvcGFjaXR5ID0gbGluZXN0eWxlc1sxXSwKICAgICAgICAgICAgICAgICAgICAgICAgd2lkdGggPSBwYXJzZUZsb2F0KG5vZGVWYWwoZ2V0MShsaW5lU3R5bGUsICd3aWR0aCcpKSk7CiAgICAgICAgICAgICAgICAgICAgaWYgKGNvbG9yKSBwcm9wZXJ0aWVzLnN0cm9rZSA9IGNvbG9yOwogICAgICAgICAgICAgICAgICAgIGlmICghaXNOYU4ob3BhY2l0eSkpIHByb3BlcnRpZXNbJ3N0cm9rZS1vcGFjaXR5J10gPSBvcGFjaXR5OwogICAgICAgICAgICAgICAgICAgIGlmICghaXNOYU4od2lkdGgpKSBwcm9wZXJ0aWVzWydzdHJva2Utd2lkdGgnXSA9IHdpZHRoOwogICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgaWYgKHBvbHlTdHlsZSkgewogICAgICAgICAgICAgICAgICAgIHZhciBwb2x5c3R5bGVzID0ga21sQ29sb3Iobm9kZVZhbChnZXQxKHBvbHlTdHlsZSwgJ2NvbG9yJykpKSwKICAgICAgICAgICAgICAgICAgICAgICAgcGNvbG9yID0gcG9seXN0eWxlc1swXSwKICAgICAgICAgICAgICAgICAgICAgICAgcG9wYWNpdHkgPSBwb2x5c3R5bGVzWzFdLAogICAgICAgICAgICAgICAgICAgICAgICBmaWxsID0gbm9kZVZhbChnZXQxKHBvbHlTdHlsZSwgJ2ZpbGwnKSksCiAgICAgICAgICAgICAgICAgICAgICAgIG91dGxpbmUgPSBub2RlVmFsKGdldDEocG9seVN0eWxlLCAnb3V0bGluZScpKTsKICAgICAgICAgICAgICAgICAgICBpZiAocGNvbG9yKSBwcm9wZXJ0aWVzLmZpbGwgPSBwY29sb3I7CiAgICAgICAgICAgICAgICAgICAgaWYgKCFpc05hTihwb3BhY2l0eSkpIHByb3BlcnRpZXNbJ2ZpbGwtb3BhY2l0eSddID0gcG9wYWNpdHk7CiAgICAgICAgICAgICAgICAgICAgaWYgKGZpbGwpIHByb3BlcnRpZXNbJ2ZpbGwtb3BhY2l0eSddID0gZmlsbCA9PT0gJzEnID8gMSA6IDA7CiAgICAgICAgICAgICAgICAgICAgaWYgKG91dGxpbmUpIHByb3BlcnRpZXNbJ3N0cm9rZS1vcGFjaXR5J10gPSBvdXRsaW5lID09PSAnMScgPyAxIDogMDsKICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgIGlmIChleHRlbmRlZERhdGEpIHsKICAgICAgICAgICAgICAgICAgICB2YXIgZGF0YXMgPSBnZXQoZXh0ZW5kZWREYXRhLCAnRGF0YScpLAogICAgICAgICAgICAgICAgICAgICAgICBzaW1wbGVEYXRhcyA9IGdldChleHRlbmRlZERhdGEsICdTaW1wbGVEYXRhJyk7CgogICAgICAgICAgICAgICAgICAgIGZvciAoaSA9IDA7IGkgPCBkYXRhcy5sZW5ndGg7IGkrKykgewogICAgICAgICAgICAgICAgICAgICAgICBwcm9wZXJ0aWVzW2RhdGFzW2ldLmdldEF0dHJpYnV0ZSgnbmFtZScpXSA9IG5vZGVWYWwoZ2V0MShkYXRhc1tpXSwgJ3ZhbHVlJykpOwogICAgICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICAgICBmb3IgKGkgPSAwOyBpIDwgc2ltcGxlRGF0YXMubGVuZ3RoOyBpKyspIHsKICAgICAgICAgICAgICAgICAgICAgICAgcHJvcGVydGllc1tzaW1wbGVEYXRhc1tpXS5nZXRBdHRyaWJ1dGUoJ25hbWUnKV0gPSBub2RlVmFsKHNpbXBsZURhdGFzW2ldKTsKICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICBpZiAoZ2VvbXNBbmRUaW1lcy5jb29yZFRpbWVzLmxlbmd0aCkgewogICAgICAgICAgICAgICAgICAgIHByb3BlcnRpZXMuY29vcmRUaW1lcyA9IChnZW9tc0FuZFRpbWVzLmNvb3JkVGltZXMubGVuZ3RoID09PSAxKSA/CiAgICAgICAgICAgICAgICAgICAgICAgIGdlb21zQW5kVGltZXMuY29vcmRUaW1lc1swXSA6IGdlb21zQW5kVGltZXMuY29vcmRUaW1lczsKICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgIHZhciBmZWF0dXJlID0gewogICAgICAgICAgICAgICAgICAgIHR5cGU6ICdGZWF0dXJlJywKICAgICAgICAgICAgICAgICAgICBnZW9tZXRyeTogKGdlb21zQW5kVGltZXMuZ2VvbXMubGVuZ3RoID09PSAxKSA/IGdlb21zQW5kVGltZXMuZ2VvbXNbMF0gOiB7CiAgICAgICAgICAgICAgICAgICAgICAgIHR5cGU6ICdHZW9tZXRyeUNvbGxlY3Rpb24nLAogICAgICAgICAgICAgICAgICAgICAgICBnZW9tZXRyaWVzOiBnZW9tc0FuZFRpbWVzLmdlb21zCiAgICAgICAgICAgICAgICAgICAgfSwKICAgICAgICAgICAgICAgICAgICBwcm9wZXJ0aWVzOiBwcm9wZXJ0aWVzCiAgICAgICAgICAgICAgICB9OwogICAgICAgICAgICAgICAgaWYgKGF0dHIocm9vdCwgJ2lkJykpIGZlYXR1cmUuaWQgPSBhdHRyKHJvb3QsICdpZCcpOwogICAgICAgICAgICAgICAgcmV0dXJuIFtmZWF0dXJlXTsKICAgICAgICAgICAgfQogICAgICAgICAgICByZXR1cm4gZ2o7CiAgICAgICAgfSwKICAgICAgICBncHg6IGZ1bmN0aW9uKGRvYykgewogICAgICAgICAgICB2YXIgaSwKICAgICAgICAgICAgICAgIHRyYWNrcyA9IGdldChkb2MsICd0cmsnKSwKICAgICAgICAgICAgICAgIHJvdXRlcyA9IGdldChkb2MsICdydGUnKSwKICAgICAgICAgICAgICAgIHdheXBvaW50cyA9IGdldChkb2MsICd3cHQnKSwKICAgICAgICAgICAgICAgIC8vIGEgZmVhdHVyZSBjb2xsZWN0aW9uCiAgICAgICAgICAgICAgICBnaiA9IGZjKCksCiAgICAgICAgICAgICAgICBmZWF0dXJlOwogICAgICAgICAgICBmb3IgKGkgPSAwOyBpIDwgdHJhY2tzLmxlbmd0aDsgaSsrKSB7CiAgICAgICAgICAgICAgICBmZWF0dXJlID0gZ2V0VHJhY2sodHJhY2tzW2ldKTsKICAgICAgICAgICAgICAgIGlmIChmZWF0dXJlKSBnai5mZWF0dXJlcy5wdXNoKGZlYXR1cmUpOwogICAgICAgICAgICB9CiAgICAgICAgICAgIGZvciAoaSA9IDA7IGkgPCByb3V0ZXMubGVuZ3RoOyBpKyspIHsKICAgICAgICAgICAgICAgIGZlYXR1cmUgPSBnZXRSb3V0ZShyb3V0ZXNbaV0pOwogICAgICAgICAgICAgICAgaWYgKGZlYXR1cmUpIGdqLmZlYXR1cmVzLnB1c2goZmVhdHVyZSk7CiAgICAgICAgICAgIH0KICAgICAgICAgICAgZm9yIChpID0gMDsgaSA8IHdheXBvaW50cy5sZW5ndGg7IGkrKykgewogICAgICAgICAgICAgICAgZ2ouZmVhdHVyZXMucHVzaChnZXRQb2ludCh3YXlwb2ludHNbaV0pKTsKICAgICAgICAgICAgfQogICAgICAgICAgICBmdW5jdGlvbiBnZXRQb2ludHMobm9kZSwgcG9pbnRuYW1lKSB7CiAgICAgICAgICAgICAgICB2YXIgcHRzID0gZ2V0KG5vZGUsIHBvaW50bmFtZSksCiAgICAgICAgICAgICAgICAgICAgbGluZSA9IFtdLAogICAgICAgICAgICAgICAgICAgIHRpbWVzID0gW10sCiAgICAgICAgICAgICAgICAgICAgaGVhcnRSYXRlcyA9IFtdLAogICAgICAgICAgICAgICAgICAgIGwgPSBwdHMubGVuZ3RoOwogICAgICAgICAgICAgICAgaWYgKGwgPCAyKSByZXR1cm4ge307ICAvLyBJbnZhbGlkIGxpbmUgaW4gR2VvSlNPTgogICAgICAgICAgICAgICAgZm9yICh2YXIgaSA9IDA7IGkgPCBsOyBpKyspIHsKICAgICAgICAgICAgICAgICAgICB2YXIgYyA9IGNvb3JkUGFpcihwdHNbaV0pOwogICAgICAgICAgICAgICAgICAgIGxpbmUucHVzaChjLmNvb3JkaW5hdGVzKTsKICAgICAgICAgICAgICAgICAgICBpZiAoYy50aW1lKSB0aW1lcy5wdXNoKGMudGltZSk7CiAgICAgICAgICAgICAgICAgICAgaWYgKGMuaGVhcnRSYXRlKSBoZWFydFJhdGVzLnB1c2goYy5oZWFydFJhdGUpOwogICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgcmV0dXJuIHsKICAgICAgICAgICAgICAgICAgICBsaW5lOiBsaW5lLAogICAgICAgICAgICAgICAgICAgIHRpbWVzOiB0aW1lcywKICAgICAgICAgICAgICAgICAgICBoZWFydFJhdGVzOiBoZWFydFJhdGVzCiAgICAgICAgICAgICAgICB9OwogICAgICAgICAgICB9CiAgICAgICAgICAgIGZ1bmN0aW9uIGdldFRyYWNrKG5vZGUpIHsKICAgICAgICAgICAgICAgIHZhciBzZWdtZW50cyA9IGdldChub2RlLCAndHJrc2VnJyksCiAgICAgICAgICAgICAgICAgICAgdHJhY2sgPSBbXSwKICAgICAgICAgICAgICAgICAgICB0aW1lcyA9IFtdLAogICAgICAgICAgICAgICAgICAgIGhlYXJ0UmF0ZXMgPSBbXSwKICAgICAgICAgICAgICAgICAgICBsaW5lOwogICAgICAgICAgICAgICAgZm9yICh2YXIgaSA9IDA7IGkgPCBzZWdtZW50cy5sZW5ndGg7IGkrKykgewogICAgICAgICAgICAgICAgICAgIGxpbmUgPSBnZXRQb2ludHMoc2VnbWVudHNbaV0sICd0cmtwdCcpOwogICAgICAgICAgICAgICAgICAgIGlmIChsaW5lLmxpbmUpIHRyYWNrLnB1c2gobGluZS5saW5lKTsKICAgICAgICAgICAgICAgICAgICBpZiAobGluZS50aW1lcyAmJiBsaW5lLnRpbWVzLmxlbmd0aCkgdGltZXMucHVzaChsaW5lLnRpbWVzKTsKICAgICAgICAgICAgICAgICAgICBpZiAobGluZS5oZWFydFJhdGVzICYmIGxpbmUuaGVhcnRSYXRlcy5sZW5ndGgpIGhlYXJ0UmF0ZXMucHVzaChsaW5lLmhlYXJ0UmF0ZXMpOwogICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgaWYgKHRyYWNrLmxlbmd0aCA9PT0gMCkgcmV0dXJuOwogICAgICAgICAgICAgICAgdmFyIHByb3BlcnRpZXMgPSBnZXRQcm9wZXJ0aWVzKG5vZGUpOwogICAgICAgICAgICAgICAgaWYgKHRpbWVzLmxlbmd0aCkgcHJvcGVydGllcy5jb29yZFRpbWVzID0gdHJhY2subGVuZ3RoID09PSAxID8gdGltZXNbMF0gOiB0aW1lczsKICAgICAgICAgICAgICAgIGlmIChoZWFydFJhdGVzLmxlbmd0aCkgcHJvcGVydGllcy5oZWFydFJhdGVzID0gdHJhY2subGVuZ3RoID09PSAxID8gaGVhcnRSYXRlc1swXSA6IGhlYXJ0UmF0ZXM7CiAgICAgICAgICAgICAgICByZXR1cm4gewogICAgICAgICAgICAgICAgICAgIHR5cGU6ICdGZWF0dXJlJywKICAgICAgICAgICAgICAgICAgICBwcm9wZXJ0aWVzOiBwcm9wZXJ0aWVzLAogICAgICAgICAgICAgICAgICAgIGdlb21ldHJ5OiB7CiAgICAgICAgICAgICAgICAgICAgICAgIHR5cGU6IHRyYWNrLmxlbmd0aCA9PT0gMSA/ICdMaW5lU3RyaW5nJyA6ICdNdWx0aUxpbmVTdHJpbmcnLAogICAgICAgICAgICAgICAgICAgICAgICBjb29yZGluYXRlczogdHJhY2subGVuZ3RoID09PSAxID8gdHJhY2tbMF0gOiB0cmFjawogICAgICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgIH07CiAgICAgICAgICAgIH0KICAgICAgICAgICAgZnVuY3Rpb24gZ2V0Um91dGUobm9kZSkgewogICAgICAgICAgICAgICAgdmFyIGxpbmUgPSBnZXRQb2ludHMobm9kZSwgJ3J0ZXB0Jyk7CiAgICAgICAgICAgICAgICBpZiAoIWxpbmUubGluZSkgcmV0dXJuOwogICAgICAgICAgICAgICAgdmFyIHJvdXRlT2JqID0gewogICAgICAgICAgICAgICAgICAgIHR5cGU6ICdGZWF0dXJlJywKICAgICAgICAgICAgICAgICAgICBwcm9wZXJ0aWVzOiBnZXRQcm9wZXJ0aWVzKG5vZGUpLAogICAgICAgICAgICAgICAgICAgIGdlb21ldHJ5OiB7CiAgICAgICAgICAgICAgICAgICAgICAgIHR5cGU6ICdMaW5lU3RyaW5nJywKICAgICAgICAgICAgICAgICAgICAgICAgY29vcmRpbmF0ZXM6IGxpbmUubGluZQogICAgICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgIH07CiAgICAgICAgICAgICAgICByZXR1cm4gcm91dGVPYmo7CiAgICAgICAgICAgIH0KICAgICAgICAgICAgZnVuY3Rpb24gZ2V0UG9pbnQobm9kZSkgewogICAgICAgICAgICAgICAgdmFyIHByb3AgPSBnZXRQcm9wZXJ0aWVzKG5vZGUpOwogICAgICAgICAgICAgICAgcHJvcC5zeW0gPSBub2RlVmFsKGdldDEobm9kZSwgJ3N5bScpKTsKICAgICAgICAgICAgICAgIHJldHVybiB7CiAgICAgICAgICAgICAgICAgICAgdHlwZTogJ0ZlYXR1cmUnLAogICAgICAgICAgICAgICAgICAgIHByb3BlcnRpZXM6IHByb3AsCiAgICAgICAgICAgICAgICAgICAgZ2VvbWV0cnk6IHsKICAgICAgICAgICAgICAgICAgICAgICAgdHlwZTogJ1BvaW50JywKICAgICAgICAgICAgICAgICAgICAgICAgY29vcmRpbmF0ZXM6IGNvb3JkUGFpcihub2RlKS5jb29yZGluYXRlcwogICAgICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgIH07CiAgICAgICAgICAgIH0KICAgICAgICAgICAgZnVuY3Rpb24gZ2V0UHJvcGVydGllcyhub2RlKSB7CiAgICAgICAgICAgICAgICB2YXIgbWV0YSA9IFsnbmFtZScsICdkZXNjJywgJ2F1dGhvcicsICdjb3B5cmlnaHQnLCAnbGluaycsCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAndGltZScsICdrZXl3b3JkcyddLAogICAgICAgICAgICAgICAgICAgIHByb3AgPSB7fSwKICAgICAgICAgICAgICAgICAgICBrOwogICAgICAgICAgICAgICAgZm9yIChrID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iB7CiAgICAgICAgICBuYW1lOiAndXJuOm9nYzpkZWY6Y3JzOkVQU0c6OicgKyBzcmlkCiAgICAgICAgfQogICAgICB9OwogICAgfQoKICAgIHJldHVybiBvYmo7CiAgfQoKICBmdW5jdGlvbiB3aGl0ZSAoKSB7ICQoL15ccyovKTsgfQoKICBmdW5jdGlvbiBtdWx0aWNvb3JkcyAoKSB7CiAgICB3aGl0ZSgpOwogICAgdmFyIGRlcHRoID0gMDsKICAgIHZhciByaW5ncyA9IFtdOwogICAgdmFyIHN0YWNrID0gW3JpbmdzXTsKICAgIHZhciBwb2ludGVyID0gcmluZ3M7CiAgICB2YXIgZWxlbTsKCiAgICB3aGlsZSAoZWxlbSA9CiAgICAgICAgICAgJCgvXihcKCkvKSB8fAogICAgICAgICAgICAgJCgvXihcKSkvKSB8fAogICAgICAgICAgICAgICAkKC9eKFwsKS8pIHx8CiAgICAgICAgICAgICAgICAgJCh0dXBsZXMpKSB7CiAgICAgIGlmIChlbGVtID09PSAnKCcpIHsKICAgICAgICBzdGFjay5wdXNoKHBvaW50ZXIpOwogICAgICAgIHBvaW50ZXIgPSBbXTsKICAgICAgICBzdGFja1tzdGFjay5sZW5ndGggLSAxXS5wdXNoKHBvaW50ZXIpOwogICAgICAgIGRlcHRoKys7CiAgICAgIH0gZWxzZSBpZiAoZWxlbSA9PT0gJyknKSB7CiAgICAgICAgLy8gRm9yIHRoZSBjYXNlOiBQb2x5Z29uKCksIC4uLgogICAgICAgIGlmIChwb2ludGVyLmxlbmd0aCA9PT0gMCkgcmV0dXJuIG51bGw7CgogICAgICAgIHBvaW50ZXIgPSBzdGFjay5wb3AoKTsKICAgICAgICAvLyB0aGUgc3RhY2sgd2FzIGVtcHR5LCBpbnB1dCB3YXMgbWFsZm9ybWVkCiAgICAgICAgaWYgKCFwb2ludGVyKSByZXR1cm4gbnVsbDsKICAgICAgICBkZXB0aC0tOwogICAgICAgIGlmIChkZXB0aCA9PT0gMCkgYnJlYWs7CiAgICAgIH0gZ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Z1bmN0aW9uIHBvaW50ICgpIHsKICAgIGlmICghJCgvXihwb2ludCkvaSkpIHJldHVybiBudWxsOwogICAgd2hpdGUoKTsKICAgIGlmICghJCgvXihcKCkvKSkgcmV0dXJuIG51bGw7CiAgICB2YXIgYyA9IGNvb3JkcygpOwogICAgaWYgKCFjKSByZXR1cm4gbnVsbDsKICAgIHdoaXRlKCk7CiAgICBpZiAoISQoL14oXCkpLykpIHJldHVybiBudWxsOwogICAgcmV0dXJuIHsKICAgICAgdHlwZTogJ1BvaW50JywKICAgICAgY29vcmRpbmF0ZXM6IGNbMF0KICAgIH07CiAgfQoKICBmdW5jdGlvbiBtdWx0aXBvaW50ICgpIHsKICAgIGlmICghJCgvXihtdWx0aXBvaW50KS9pKSkgcmV0dXJuIG51bGw7CiAgICB3aGl0ZSgpOwogICAgdmFyIG5ld0Nvb3Jkc0Zvcm1hdCA9IF8KICAgICAgLnN1YnN0cmluZyhfLmluZGV4T2YoJygnKSArIDEsIF8ubGVuZ3RoIC0gMSkKICAgICAgLnJlcGxhY2UoL1woL2csICcnKQogICAgICAucmVwbGFjZSgvXCkvZywgJycpOwogICAgXyA9ICdNVUxUSVBPSU5UICgnICsgbmV3Q29vcmRzRm9ybWF0ICsgJyknOwogICAgdmFyIGMgPSBtdWx0aWNvb3JkcygpOwogICAgaWYgKCFjKSByZXR1cm4gbnVsbDsKICAgIHdoaXRlKCk7CiAgICByZXR1cm4gewogICAgICB0eXBlOiAnTXVsdGlQb2ludCcsCiAgICAgIGNvb3JkaW5hdGVzOiBjCiAgICB9OwogIH0KCiAgZnVuY3Rpb24gbXVsdGlsaW5lc3RyaW5nICgpIHsKICAgIGlmICghJCgvXihtdWx0aWxpbmVzdHJpbmcpL2kpKSByZXR1cm4gbnVsbDsKICAgIHdoaXRlKCk7CiAgICB2YXIgYyA9IG11bHRpY29vcmRzKCk7CiAgICBpZiAoIWMpIHJldHVybiBudWxsOwogICAgd2hpdGUoKTsKICAgIHJldHVybiB7CiAgICAgIHR5cGU6ICdNdWx0aUxpbmVTdHJpbmcnLAogICAgICBjb29yZGluYXRlczogYwogICAgfTsKICB9CgogIGZ1bmN0aW9uIGxpbmVzdHJpbmcgKCkgewogICAgaWYgKCEkKC9eKGxpbmVzdHJpbmcpL2kpKSByZXR1cm4gbnVsbDsKICAgIHdoaXRlKCk7CiAgICBpZiAoISQoL14oXCgpLykpIHJldHVybiBudWxsOwogICAgdmFyIGMgPSBjb29yZHMoKTsKICAgIGlmICghYykgcmV0dXJuIG51bGw7CiAgICBpZiAoISQoL14oXCkpLykpIHJldHVybiBudWxsOwogICAgcmV0dXJuIHsKICAgICAgdHlwZTogJ0xpbmVTdHJpbmcnLAogICAgICBjb29yZGluYXRlczogYwogICAgfTsKICB9CgogIGZ1bmN0aW9uIHBvbHlnb24gKCkgewogICAgaWYgKCEkKC9eKHBvbHlnb24pL2kpKSByZXR1cm4gbnVsbDsKICAgIHdoaXRlKCk7CiAgICB2YXIgYyA9IG11bHRpY29vcmRzKCk7CiAgICBpZiAoIWMpIHJldHVybiBudWxsOwogICAgcmV0dXJuIHsKICAgICAgdHlwZTogJ1BvbHlnb24nLAogICAgICBjb29yZGluYXRlczogYwogICAgfTsKICB9CgogIGZ1bmN0aW9uIG11bHRpcG9seWdvbiAoKSB7CiAgICBpZiAoISQoL14obXVsdGlwb2x5Z29uKS9pKSkgcmV0dXJuIG51bGw7CiAgICB3aGl0ZSgpOwogICAgdmFyIGMgPSBtdWx0aWNvb3JkcygpOwogICAgaWYgKCFjKSByZXR1cm4gbnVsbDsKICAgIHJldHVybiB7CiAgICAgIHR5cGU6ICdNdWx0aVBvbHlnb24nLAogICAgICBjb29yZGluYXRlczogYwogICAgfTsKICB9CgogIGZ1bmN0aW9uIGdlb21ldHJ5Y29sbGVjdGlvbiAoKSB7CiAgICB2YXIgZ2VvbWV0cmllcyA9IFtdOwogICAgdmFyIGdlb21ldHJ5OwoKICAgIGlmICghJCgvXihnZW9tZXRyeWNvbGxlY3Rpb24pL2kp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1aXJlKCdzZXhhZ2VzaW1hbCcpOwoKZnVuY3Rpb24gaXNMYXQoZikgeyByZXR1cm4gISFmLm1hdGNoKC8oTGF0KShpdHVkZSk/L2dpKTsgfQpmdW5jdGlvbiBpc0xvbihmKSB7IHJldHVybiAhIWYubWF0Y2goLyhMKShvbnxuZykoZ2l0dWRlKT8vaSk7IH0KCmZ1bmN0aW9uIGtleUNvdW50KG8pIHsKICAgIHJldHVybiAodHlwZW9mIG8gPT0gJ29iamVjdCcpID8gT2JqZWN0LmtleXMobykubGVuZ3RoIDogMDsKfQoKZnVuY3Rpb24gYXV0b0RlbGltaXRlcih4KSB7CiAgICB2YXIgZGVsaW1pdGVycyA9IFsnLCcsICc7JywgJ1x0JywgJ3wnXTsKICAgIHZhciByZXN1bHRzID0gW107CgogICAgZGVsaW1pdGVycy5mb3JFYWNoKGZ1bmN0aW9uKGRlbGltaXRlcikgewogICAgICAgIHZhciByZXMgPSBkc3YuZHN2KGRlbGltaXRlcikucGFyc2UoeCk7CiAgICAgICAgaWYgKHJlcy5sZW5ndGggPj0gMSkgewogICAgICAgICAgICB2YXIgY291bnQgPSBrZXlDb3VudChyZXNbMF0pOwogICAgICAgICAgICBmb3IgKHZhciBpID0gMDsgaSA8IHJlcy5sZW5ndGg7IGkrKykgewogICAgICAgICAgICAgICAgaWYgKGtleUNvdW50KHJlc1tpXSkgIT09IGNvdW50KSByZXR1cm47CiAgICAgICAgICAgIH0KICAgICAgICAgICAgcmVzdWx0cy5wdXNoKHsKICAgICAgICAgICAgICAgIGRlbGltaXRlcjogZGVsaW1pdGVyLAogICAgICAgICAgICAgICAgYXJpdHk6IE9iamVjdC5rZXlzKHJlc1swXSkubGVuZ3RoLAogICAgICAgICAgICB9KTsKICAgICAgICB9CiAgICB9KTsKCiAgICBpZiAocmVzdWx0cy5sZW5ndGgpIHsKICAgICAgICByZXR1cm4gcmVzdWx0cy5zb3J0KGZ1bmN0aW9uKGEsIGIpIHsKICAgICAgICAgICAgcmV0dXJu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CiAgICAgICAgICAgIHJldHVybiBjYWxsYmFjayh7CiAgICAgICAgICAgICAgICB0eXBlOiAnRXJyb3InLAogICAgICAgICAgICAgICAgbWVzc2FnZTogJ0xhdGl0dWRlIGFuZCBsb25naXR1ZGUgZmllbGRzIG5vdCBwcmVzZW50JywKICAgICAgICAgICAgICAgIGRhdGE6IGRlbGV0ZUNvbHVtbnMocGFyc2VkKSwKICAgICAgICAgICAgICAgIGZpZWxkczogZmllbGRzCiAgICAgICAgICAgIH0pOwogICAgICAgIH0KICAgIH0KCiAgICB2YXIgZXJyb3JzID0gW107CgogICAgZm9yICh2YXIgaSA9IDA7IGkgPCBwYXJzZWQubGVuZ3RoOyBpKyspIHsKICAgICAgICBpZiAocGFyc2VkW2ldW2xvbmZpZWxkXSAhPT0gdW5kZWZpbmVkICYmCiAgICAgICAgICAgIHBhcnNlZFtpXVtsb25maWVsZF0gIT09IHVuZGVmaW5lZCkgewoKICAgICAgICAgICAgdmFyIGxvbmsgPSBwYXJzZWRbaV1bbG9uZmllbGRdLAogICAgICAgICAgICAgICAgbGF0ayA9IHBhcnNlZFtpXVtsYXRmaWVsZF0sCiAgICAgICAgICAgICAgICBsb25mLCBsYXRmLAogICAgICAgICAgICAgICAgYTsKCiAgICAgICAgICAgIGEgPSBzZXhhZ2VzaW1hbChsb25rLCAnRVcnKTsKICAgICAgICAgICAgaWYgKGEpIGxvbmsgPSBhOwogICAgICAgICAgICBhID0gc2V4YWdlc2ltYWwobGF0aywgJ05TJyk7CiAgICAgICAgICAgIGlmIChhKSBsYXRrID0gYTsKCiAgICAgICAgICAgIGxvbmYgPSBwYXJzZUZsb2F0KGxvbmspOwogICAgICAgICAgICBsYXRmID0gcGFyc2VGbG9hdChsYXRrKTsKCiAgICAgICAgICAgIGlmIChpc05hTihsb25mKSB8fAogICAgICAgICAgICAgICAgaXNOYU4obGF0ZikpIHsKICAgICAgICAgICAgICAgIGVycm9ycy5wdXNoKHsKICAgICAgICAgICAgICAgICAgICBtZXNzYWdlOiAnQSByb3cgY29udGFpbmVkIGFuIGludmFsaWQgdmFsdWUgZm9yIGxhdGl0dWRlIG9yIGxvbmdpdHVkZScsCiAgICAgICAgICAgICAgICAgICAgcm93OiBwYXJzZWRbaV0KICAgICAgICAgICAgICAgIH0pOwogICAgICAgICAgICB9IGVsc2UgewogICAgICAgICAgICAgICAgaWYgKCFvcHRpb25zLmluY2x1ZGVMYXRMb24pIHsKICAgICAgICAgICAgICAgICAgICBkZWxldGUgcGFyc2VkW2ldW2xvbmZpZWxkXTsKICAgICAgICAgICAgICAgICAgICBkZWxldGUgcGFyc2VkW2ldW2xhdGZpZWxkXTsKICAgICAgICAgICAgICAgIH0KCiAgICAgICAgICAgICAgICBmZWF0dXJlcy5wdXNoKHsKICAgICAgICAgICAgICAgICAgICB0eXBlOiAnRmVhdHVyZScsCiAgICAgICAgICAgICAgICAgICAgcHJvcGVydGllczogcGFyc2VkW2ldLAogICAgICAgICAgICAgICAgICAgIGdlb21ldHJ5OiB7CiAgICAgICAgICAgICAgICAgICAgICAgIHR5cGU6ICdQb2ludCcsCiAgICAgICAgICAgICAgICAgICAgICAgIGNvb3JkaW5hdGVzOiBbCiAgICAgICAgICAgICAgICAgICAgICAgICAgICBwYXJzZUZsb2F0KGxvbmYpLAogICAgICAgICAgICAgICAgICAgICAgICAgICAgcGFyc2VGbG9hdChsYXRmKQogICAgICAgICAgICAgICAgICAgICAgICBdCiAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgfSk7CiAgICAgICAgICAgIH0KICAgICAgICB9CiAgICB9CgogICAgY2FsbGJhY2soZXJyb3JzLmxlbmd0aCA/IGVycm9yczogbnVsbCwgZmVhdHVyZWNvbGxlY3Rpb24pOwp9CgpmdW5jdGlvbiB0b0xpbmUoZ2opIHsKICAgIHZhciBmZWF0dXJlcyA9IGdqLmZlYXR1cmVzOwogICAgdmFyIGxpbmUgPSB7CiAgICAgICAgdHlwZTogJ0ZlYXR1cmUnLAogICAgICAgIGdl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CiAgICByb3dzLmZvckVhY2goZnVuY3Rpb24ocm93KSB7CiAgICAgIGZvciAodmFyIGNvbHVtbiBpbiByb3cpIHsKICAgICAgICBpZiAoIShjb2x1bW4gaW4gY29sdW1uU2V0KSkgewogICAgICAgICAgY29sdW1ucy5wdXNoKGNvbHVtblNldFtjb2x1bW5dID0gY29sdW1uKTsKICAgICAgICB9CiAgICAgIH0KICAgIH0pOwoKICAgIHJldHVybiBjb2x1bW5zOwogIH0KCiAgZnVuY3Rpb24gZHN2KGRlbGltaXRlcikgewogICAgdmFyIHJlRm9ybWF0ID0gbmV3IFJlZ0V4cCgiW1wiIiArIGRlbGltaXRlciArICJcbl0iKSwKICAgICAgICBkZWxpbWl0ZXJDb2RlID0gZGVsaW1pdGVyLmNoYXJDb2RlQXQoMCk7CgogICAgZnVuY3Rpb24gcGFyc2UodGV4dCwgZikgewogICAgICB2YXIgY29udmVydCwgY29sdW1ucywgcm93cyA9IHBhcnNlUm93cyh0ZXh0LCBmdW5jdGlvbihyb3csIGkpIHsKICAgICAgICBpZiAoY29udmVydCkgcmV0dXJuIGNvbnZlcnQocm93LCBpIC0gMSk7CiAgICAgICAgY29sdW1ucyA9IHJvdywgY29udmVydCA9IGYgPyBjdXN0b21Db252ZXJ0ZXIocm93LCBmKSA6IG9iamVjdENvbnZlcnRlcihyb3cpOwogICAgICB9KTsKICAgICAgcm93cy5jb2x1bW5zID0gY29sdW1uczsKICAgICAgcmV0dXJuIHJvd3M7CiAgICB9CgogICAgZnVuY3Rpb24gcGFyc2VSb3dzKHRleHQsIGYpIHsKICAgICAgdmFyIEVPTCA9IHt9LCAvLyBzZW50aW5lbCB2YWx1ZSBmb3IgZW5kLW9mLWxpbmUKICAgICAgICAgIEVPRiA9IHt9LCAvLyBzZW50aW5lbCB2YWx1ZSBmb3IgZW5kLW9mLWZpbGUKICAgICAgICAgIHJvd3MgPSBbXSwgLy8gb3V0cHV0IHJvd3MKICAgICAgICAgIE4gPSB0ZXh0Lmxlbmd0aCwKICAgICAgICAgIEkgPSAwLCAvLyBjdXJyZW50IGNoYXJhY3RlciBpbmRleAogICAgICAgICAgbiA9IDAsIC8vIHRoZSBjdXJyZW50IGxpbmUgbnVtYmVyCiAgICAgICAgICB0LCAvLyB0aGUgY3VycmVudCB0b2tlbgogICAgICAgICAgZW9sOyAvLyBpcyB0aGUgY3VycmVudCB0b2tlbiBmb2xsb3dlZCBieSBFT0w/CgogICAgICBmdW5jdGlvbiB0b2tlbigpIHsKICAgICAgICBpZiAoSSA+PSBOKSByZXR1cm4gRU9GOyAvLyBzcGVjaWFsIGNhc2U6IGVuZCBvZiBmaWxlCiAgICAgICAgaWYgKGVvbCkgcmV0dXJuIGVvbCA9IGZhbHNlLCBFT0w7IC8vIHNwZWNpYWwgY2FzZTogZW5kIG9mIGxpbmUKCiAgICAgICAgLy8gc3BlY2lhbCBjYXNlOiBxdW90ZXMKICAgICAgICB2YXIgaiA9IEksIGM7CiAgICAgICAgaWYgKHRleHQuY2hhckNvZGVBdChqKSA9PT0gMzQpIHsKICAgICAgICAgIHZhciBpID0gajsKICAgICAgICAgIHdoaWxlIChpKysgPCBOKSB7CiAgICAgICAgICAgIGlmICh0ZXh0LmNoYXJDb2RlQXQoaSkgPT09IDM0KSB7CiAgICAgICAgICAgICAgaWYgKHRleHQuY2hhckNvZGVBdChpICsgMSkgIT09IDM0KSBicmVhazsKICAgICAgICAgICAgICArK2k7CiAgICAgICAgICAgIH0KICAgICAgICAgIH0KICAgICAgICAgIEkgPSBpICsgMjsKICAgICAgICAgIGMgPSB0ZXh0LmNoYXJDb2RlQXQoaSArIDEpOwogICAgICAgICAgaWYgKGMgPT09IDEzKSB7CiAgICAgICAgICAgIGVvbCA9IHRydWU7CiAgICAgICAgICAgIGlmICh0ZXh0LmNoYXJDb2RlQXQoaSArIDIpID09PSAxMCkgKytJOwogICAgICAgICAgfSBlbHNlIGlmIChjID09PSAxMCkgewogICAgICAgICAgICBlb2wgPSB0cnVlOwogICAgICAgICAgfQogICAgICAgICAgcmV0dXJuIHRleHQuc2xpY2UoaiArIDEsIGkpLnJlcGxhY2UoLyIiL2csICJcIiIpOwogICAgICAgIH0KCiAgICAgICAgLy8gY29tbW9uIGNhc2U6IGZpbmQgbmV4dCBkZWxpbWl0ZXIgb3IgbmV3bGluZQogICAgICAgIHdoaWxlIChJIDwgTikgewogICAgICAgICAgdmFyIGsgPSAxOwogICAgICAgICAgYyA9IHRleHQuY2hhckNvZGVBdChJKyspOwogICAgICAgICAgaWYgKGMgPT09IDEwKSBlb2wgPSB0cnVlOyAvLyBcbgogICAgICAgICAgZWxzZSBpZiAoYyA9PT0gMTMpIHsgZW9sID0gdHJ1ZTsgaWYgKHRleHQuY2hhckNvZGVBdChJKSA9PT0gMTApICsrSSwgKytrOyB9IC8vIFxyfFxyXG4KICAgICAgICAgIGVsc2UgaWYgKGMgIT09IGRlbGltaXRlckNvZGUpIGNvbnRpbnVlOwogICAgICAgICAgcmV0dXJuIHRleHQuc2xpY2UoaiwgSSAtIGspOwogICAgICAgIH0KCiAgICAgICAgLy8gc3BlY2lhbCBjYXNlOiBsYXN0IHRva2VuIGJlZm9yZSBFT0YKICAgICAgICByZXR1cm4gdGV4dC5zbGljZShqKTsKICAgICAgfQoKICAgICAgd2hpbGUgKCh0ID0gdG9rZW4oKSkgIT09IEVPRikgewogICAgICAgIHZhciBhID0gW107CiAgICAgICAgd2hpbGUgKHQgIT09IEVPTCAmJiB0ICE9PSBFT0YpIHsKICAgICAgICAgIGEucHVzaCh0KTsKICAgICAgICAgIHQgPSB0b2tlbigpOwogICAgICAgIH0KICAgICAgICBpZiAoZiAmJiAoYSA9IGYoYSwgbisrKSkgPT0gbnVsbCkgY29udGludWU7CiAgICAgICAgcm93cy5wdXNoKGEpOwogICAgICB9CgogICAgICByZXR1cm4gcm93czsKICAgIH0KCiAgICBmdW5jdGlvbiBmb3JtYXQocm93cywgY29sdW1ucykgewogICAgICBpZiAoY29sdW1ucyA9PSBudWxsKSBjb2x1bW5zID0g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Zvcm1hdCh4LmxhdCwgJ2xhdCcpICsgJyAnICsgZm9ybWF0KHgubG9uLCAnbG9uJyk7Cn0KCi8vIElzIDAgTm9ydGggb3IgU291dGg/CmZ1bmN0aW9uIGZvcm1hdCh4LCBkaW0pIHsKICAgIHZhciBkaXJzID0gewogICAgICAgICAgICBsYXQ6IFsnTicsICdTJ10sCiAgICAgICAgICAgIGxvbjogWydFJywgJ1cnXQogICAgICAgIH1bZGltXSB8fCAnJywKICAgICAgICBkaXIgPSBkaXJzW3ggPj0gMCA/IDAgOiAxXSwKICAgICAgICBhYnMgPSBNYXRoLmFicyh4KSwKICAgICAgICB3aG9sZSA9IE1hdGguZmxvb3IoYWJzKSwKICAgICAgICBmcmFjdGlvbiA9IGFicyAtIHdob2xlLAogICAgICAgIGZyYWN0aW9uTWludXRlcyA9IGZyYWN0aW9uICogNjAsCiAgICAgICAgbWludXRlcyA9IE1hdGguZmxvb3IoZnJhY3Rpb25NaW51dGVzKSwKICAgICAgICBzZWNvbmRzID0gTWF0aC5mbG9vcigoZnJhY3Rpb25NaW51dGVzIC0gbWludXRlcykgKiA2MCk7CgogICAgcmV0dXJuIHdob2xlICsgJ8KwICcgKwogICAgICAgIChtaW51dGVzID8gbWludXRlcyArICInICIgOiAnJykgKwogICAgICAgIChzZWNvbmRzID8gc2Vjb25kcyArICciICcgOiAnJykgKyBkaXI7Cn0KCmZ1bmN0aW9uIHNlYXJjaCh4LCBkaW1zLCByKSB7CiAgICBpZiAoIWRpbXMpIGRpbXMgPSAnTlNFVyc7CiAgICBpZiAodHlwZW9mIHggIT09ICdzdHJpbmcnKSByZXR1cm4geyB2YWw6IG51bGwsIHJlZ2V4OiByIH07CiAgICByID0gciB8fCAvW1xzXCxdKihbXC18XOKAlHxc4oCVXT9bMC05Ll0rKcKwPyAqKD86KFswLTkuXSspWyfigJnigLLigJhdICopPyg/OihbMC05Ll0rKSg/OicnfCJ84oCdfOKAsykgKik/KFtOU0VXXSk/L2dpOwogICAgdmFyIG0gPSByLmV4ZWMoeCk7CiAgICBpZiAoIW0pIHJldHVybiB7IHZhbDogbnVsbCwgcmVnZXg6IHIgfTsKICAgIGVsc2UgaWYgKG1bNF0gJiYgZGltcy5pbmRleE9mKG1bNF0pID09PSAtMSkgcmV0dXJuIHsgdmFsOiBudWxsLCByZWdleDogciB9OwogICAgZWxzZSByZXR1cm4gewogICAgICAgIHZhbDogKCgobVsxXSkgPyBwYXJzZUZsb2F0KG1bMV0pIDogMCkgKwogICAgICAgICAgICAoKG1bMl0gPyBwYXJzZUZsb2F0KG1bMl0pIC8gNjAgOiAwKSkgKwogICAgICAgICAgICAoKG1bM10gPyBwYXJzZUZsb2F0KG1bM10pIC8gMzYwMCA6IDApKSkgKgogICAgICAgICAgICAoKG1bNF0gJiYgbVs0XSA9PT0gJ1MnIHx8IG1bNF0gPT09ICdXJykgPyAtMSA6IDEpLAogICAgICAgIHJlZ2V4OiByLAogICAgICAgIHJhdzogbVswXSwKICAgICAgICBkaW06IG1bNF0KICAgIH07Cn0KCmZ1bmN0aW9uIHBhaXIoeCwgZGltcykgewogICAgeCA9IHgudHJpbSgpOwogICAgdmFyIG9uZSA9IHNlYXJjaCh4LCBkaW1zKTsKICAgIGlmIChvbmUudmFsID09PSBudWxsKSByZXR1cm4gbnVsbDsKICAgIHZhciB0d28gPSBzZWFyY2goeCwgZGltcywgb25lLnJlZ2V4KTsKICAgIGlmICh0d28udmFsID09PSBudWxsKSByZXR1cm4gbnVsbDsKICAgIC8vIG51bGwgaWYgb25lL3R3byBhcmUgbm90IGNvbnRpZ3VvdXMuCiAgICBpZiAob25lLnJhdyArIHR3by5yYXcgIT09IHgpIHJldHVybiBudWxsOwogICAgaWYgKG9uZS5kaW0pIHJldHVybiBzd2FwZGltKG9uZS52YWwsIHR3by52YWwsIG9uZS5kaW0pOwogICAgZWxzZSByZXR1cm4gW29uZS52YWwsIHR3by52YWxdOwp9CgpmdW5jdGlvbiBzd2FwZGltKGEsIGIsIGRpbSkgewogICAgaWYgKGRpbSA9PSAnTicgfHwgZGltID09ICdTJykgcmV0dXJuIFthLCBiXTsKICAgIGlmIChkaW0gPT0gJ1cnIHx8IGRpbSA9PSAnRScpIHJldHVybiBbYiwgYV07Cn0KCn0se31dfSx7fSxbMV0pOwo="></script> <script src="data:application/x-javascript;base64,LyogZ2xvYmFsIExlYWZsZXRXaWRnZXQsICQsIEwsIHRvcG9qc29uLCBjc3YyZ2VvanNvbiwgdG9HZW9KU09OICovCi8vIHBhcnNlIGFuIFhNTApMZWFmbGV0V2lkZ2V0LnV0aWxzLnBhcnNlWE1MID0gZnVuY3Rpb24oc3RyKSB7CiAgaWYgKHR5cGVvZiBzdHIgPT09ICdzdHJpbmcnKSB7CiAgICByZXR1cm4gKG5ldyBET01QYXJzZXIoKSkucGFyc2VGcm9tU3RyaW5nKHN0ciwgJ3RleHQveG1sJyk7CiAgfSBlbHNlIHsKICAgIHJldHVybiBzdHI7CiAgfQp9OwoKLy8gcGFyc2UgYW4gR2VvSlNPTi9Ub3BvSlNPTgpMZWFmbGV0V2lkZ2V0LnV0aWxzLmdldFBhcnNlZEdlb0pTT04gPSBmdW5jdGlvbihkYXRhKSB7CiAgdmFyIGdlb2pzb247CgogIGlmKHR5cGVvZiBkYXRhID09PSd1bmRlZmluZWQnIHx8IGRhdGEgPT09IG51bGwgfHwKICAgICh0eXBlb2YgZGF0YSA9PT0gJ3N0cmluZycgJiYgZGF0YS50cmltKCkgPT09ICcnKSkgewogICAgcmV0dXJuIGdlb2pzb247CiAgfQoKICBpZih0eXBlb2YgZGF0YSA9PT0gJ3N0cmluZycpIHsKICAgIGdlb2pzb24gPSBKU09OLnBhcnNlKGRhdGEpOwogIH0gZWxzZSB7CiAgICBnZW9qc29uID0gZGF0YTsKICB9CgogIC8vIGlmIGlucHV0IGlzIGEgVG9wb0pTT04KICAvLyBpdGVyYXRlIG92ZXIgZWFjaCBvZiBpdHMgb2JqZWN0cyBhbmQgYWRkIHRoZWlyIGNvb3JkcwogIGlmIChnZ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lsZSAmJiBzdHlsZVtrXSkgewogICAgICAgICAgcmVzZXRTdHlsZVtrXSA9IHN0eWxlW2tdOwogICAgICAgIH0KICAgICAgfQogICAgfSk7CiAgfQogIHJldHVybiByZXNldFN0eWxlOwp9CgovLyBpcyBhIGdpdmVuIHN0cmluZyBhIFVSTApMZWFmbGV0V2lkZ2V0LnV0aWxzLmlzVVJMID0gZnVuY3Rpb24odXJsKSB7CiAgaWYgKHR5cGVvZiB1cmwgIT09ICdzdHJpbmcnIHx8IHVybC50cmltKCkgPT09ICcnICkgewogICAgcmV0dXJuIGZhbHNlOwogIH0KICB2YXIgc3RyUmVnZXggPSAnXigoaHR0cHN8aHR0cHxmdHB8cnRzcHxtbXMpPzovLyknCiAgICArICI/KChbMC05YS16XyF+KicoKS4mPSskJS1dKzogKT9bMC05YS16XyF+KicoKS4mPSskJS1dK0ApPyIgLy9mdHAgdXNlckAKICAgICsgJygoWzAtOV17MSwzfVwuKXszfVswLTldezEsM30nIC8vIElQL1VSTC0gMTk5LjE5NC41Mi4xODQKICAgICsgJ3wnIC8vIElQL0RPTUFJTgogICAgKyAiKFswLTlhLXpfIX4qJygpLV0rXC4pKiIgLy8gIHd3dy4KICAgICsgJyhbMC05YS16XVswLTlhLXotXXswLDYxfSk/WzAtOWEtel1cLicgLy8KICAgICsgJ1thLXpdezIsNn0pJyAvLyBmaXJzdCBsZXZlbCBkb21haW4tIC5jb20gb3IgLm11c2V1bQogICAgKyAnKDpbMC05XXsxLDR9KT8nIC8vIFBvcnQgLSA6ODAKICAgICsgJygoLz8pfCcgLy8gYSBzbGFzaCBpc24ndCByZXF1aXJlZCBpZiB0aGVyZSBpcyBubyBmaWxlIG5hbWUKICAgICsgIigvWzAtOUEtWmEtel8hfionKCkuOz86QCY9KyQsJSMtXSspKy8/KSQiOwogIHZhciByZT1uZXcgUmVnRXhwKHN0clJlZ2V4KTsKICByZXR1cm4gcmUudGVzdCh1cmwpOwp9OwoKZnVuY3Rpb24gYWRkR2VvSlNP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bGVNYXJrZXInKSB7CiAgICAgIGxheWVyID0gTC5jaXJjbGVNYXJrZXIobGF0bG5nLCBtYXJrZXJPcHRpb25zIHx8IHt9KTsKICAgIH0gZWxzZSB7CiAgICAgIGlmICh0eXBlb2YgbWFya2VySWNvblByb3BlcnR5ICE9PSAndW5kZWZpbmVkJyAmJiBtYXJrZXJJY29uUHJvcGVydHkgIT09IG51bGwpIHsKICAgICAgICBpZih0eXBlb2YgbWFya2VySWNvblByb3BlcnR5ID09ICdzdHJpbmcnKSB7CiAgICAgICAgICBsYXllciA9IEwubWFya2VyKGxhdGxuZywgJC5leHRlbmQoewogICAgICAgICAgICBpY29uOiBtYXJrZXJJY29uRnVuY3Rpb24obWFya2VySWNvbnNbZmVhdHVyZS5wcm9wZXJ0aWVzW21hcmtlckljb25Qcm9wZXJ0eV1dKQogICAgICAgICAgfSwgbWFya2VyT3B0aW9ucyB8fCB7fSkpOwogICAgICAgIH0gZWxzZSBpZih0eXBlb2YgbWFya2VySWNvblByb3BlcnR5ID09ICdmdW5jdGlvbicpIHsKICAgICAgICAgIGxheWVyID0gTC5tYXJrZXIobGF0bG5nLCAkLmV4dGVuZCh7CiAgICAgICAgICAgIGljb246IG1hcmtlckljb25GdW5jdGlvbihtYXJrZXJJY29uc1ttYXJrZXJJY29uUHJvcGVydHkoZmVhdHVyZSldKQogICAgICAgICAgfSwgbWFya2VyT3B0aW9ucyB8fCB7fSkpOwogICAgICAgIH0KICAgICAgfSBlbHNlIHsKICAgICAgICBsYXllciA9IEwubWFya2VyKGxhdGxuZywgJC5leHRlbmQoewogICAgICAgICAgaWNvbjogbWFya2VySWNvbkZ1bmN0aW9uKG1hcmtlckljb25zKQogICAgICAgIH0sIG1hcmtlck9wdGlvbnMgfHwge30pKTsKICAgICAgfQogICAgfQoKICAgIGlmKGNsdXN0ZXIpIHsKICAgICAgY2x1c3Rlckdyb3VwLmNsdXN0ZXJMYXllclN0b3JlLmFkZChsYXllcik7CiAgICB9CiAgICByZXR1cm4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tYXJrZXJUeXBlLCBtYXJrZXJJY29ucywKICAgICAgICAgICAgbWFya2VySWNvblByb3BlcnR5LCBtYXJrZXJPcHRpb25zLCBtYXJrZXJJY29uRnVuY3Rpb24sCiAgICAgICAgICAgIGNsdXN0ZXJPcHRpb25zLCBjbHVzdGVySWQsCiAgICAgICAgICAgIGxhYmVsUHJvcGVydHksIGxhYmVsT3B0aW9ucywgcG9wdXBQcm9wZXJ0eSwgcG9wdXBPcHRpb25zLAogICAgICAgICAgICBwYXRoT3B0aW9ucywgaGlnaGxpZ2h0T3B0aW9ucwogICAgICAgICAgKTsKICAgICAgICB9CiAgICAgICk7CiAgICB9KTsKICB9IGVsc2UgewogICAgY3N2Mmdlb2pzb24uY3N2Mmdlb2pzb24oCiAgICAgIGNzdiwgY3N2UGFyc2VyT3B0aW9ucyB8fCB7fSwKICAgICAgZnVuY3Rpb24oZXJyLCBnZW9qc29uZGF0YSkgewogICAgICAgIGFkZEdlb0pTT05MYXllcigKICAgICAgICAgIHNlbGYsCiAgICAgICAgICBmdW5jdGlvbiBnZXRHZW9KU09OTGF5ZXIoZ2VvSlNPTk9wdGlvbnMpewogICAgICAgICAgICByZXR1cm4gTC5nZW9Kc29uKAogICAgICAgICAgICAgIExlYWZsZXRXaWRnZXQudXRpbHMuZ2V0UGFyc2VkR2VvSlNPTihnZW9qc29uZGF0YSksIGdlb0pTT05PcHRpb25zKTsKICAgICAgICAgIH0sCiAgICAgICAgICBsYXllcklkLCBncm91cCwKICAgICAgICAgIHRydWUsCiAgICAgICAgICBtYXJrZXJUeXBlLCBtYXJrZXJJY29ucywKICAgICAgICAgIG1hcmtlckljb25Qcm9wZXJ0eSwgbWFya2VyT3B0aW9ucywgbWFya2VySWNvbkZ1bmN0aW9uLAogICAgICAgICAgY2x1c3Rlck9wdGlvbnMsIGNsdXN0ZXJJZCwKICAgICAgICAgIGxhYmVsUHJvcGVydHksIGxhYmVsT3B0aW9ucywgcG9wdXBQcm9wZXJ0eSwgcG9wdXBP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ucywgaGlnaGxpZ2h0T3B0aW9ucwogICAgICApOwogICAgfSk7CiAgfSBlbHNlIHsKICAgIHZhciBnZW9qc29uZGF0YSA9IHRvR2VvSlNPTi5rbWwoTGVhZmxldFdpZGdldC51dGlscy5wYXJzZVhNTChrbWwpKTsKICAgIGFkZEdlb0pTT05MYXllcigKICAgICAgc2VsZiwKICAgICAgZnVuY3Rpb24gZ2V0R2VvSlNPTkxheWVyKGdlb0pTT05PcHRpb25zKXsKICAgICAgICByZXR1cm4gTC5jaG9yb3BsZXRoKAogICAgICAgICAgTGVhZmxldFdpZGdldC51dGlscy5nZXRQYXJzZWRHZW9KU09OKGdlb2pzb25kYXRhKSwKICAgICAgICAgICQuZXh0ZW5kKHBhdGhPcHRpb25zLCBnZW9KU09OT3B0aW9ucyksIGxlZ2VuZE9wdGlvbnMpOwogICAgICB9LAogICAgICBsYXllcklkLCBncm91cCwKICAgICAgZmFsc2UsCiAgICAgIG51bGwsIG51bGwsCiAgICAgIG51bGwsIG51bGwsIG51bGwsCiAgICAgIG51bGwsIG51bGwsCiAgICAgIGxhYmVsUHJvcGVydHksIGxhYmVsT3B0aW9ucywgcG9wdXBQcm9wZXJ0eSwgcG9wdXBPcHRpb25zLAogICAgICBwYXRoT3B0aW9ucywgaGlnaGxpZ2h0T3B0aW9ucwogICAgKTsKICB9Cn07Cgo="></script> <script src="data:application/x-javascript;base64,IWZ1bmN0aW9uKGUpe2Z1bmN0aW9uIG4ocil7aWYodFtyXSlyZXR1cm4gdFtyXS5leHBvcnRzO3ZhciBvPXRbcl09e2V4cG9ydHM6e30saWQ6cixsb2FkZWQ6ITF9O3JldHVybiBlW3JdLmNhbGwoby5leHBvcnRzLG8sby5leHBvcnRzLG4pLG8ubG9hZGVkPSEwLG8uZXhwb3J0c312YXIgdD17fTtyZXR1cm4gbi5tPWUsbi5jPXQsbi5wPSIiLG4oMCl9KFtmdW5jdGlvbihlLG4sdCl7ZnVuY3Rpb24gcihlLG4pe3JldHVybiJmdW5jd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