var __awaiter=this&&this.__awaiter||function(r,t,e,n){function i(r){return r instanceof e?r:new e((function(t){t(r)}))}return new(e||(e=Promise))((function(e,o){function u(r){try{l(n.next(r))}catch(r){o(r)}}function a(r){try{l(n["throw"](r))}catch(r){o(r)}}function l(r){r.done?e(r.value):i(r.value).then(u,a)}l((n=n.apply(r,t||[])).next())}))};var __generator=this&&this.__generator||function(r,t){var e={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},n,i,o,u;return u={next:a(0),throw:a(1),return:a(2)},typeof Symbol==="function"&&(u[Symbol.iterator]=function(){return this}),u;function a(r){return function(t){return l([r,t])}}function l(u){if(n)throw new TypeError("Generator is already executing.");while(e)try{if(n=1,i&&(o=u[0]&2?i["return"]:u[0]?i["throw"]||((o=i["return"])&&o.call(i),0):i.next)&&!(o=o.call(i,u[1])).done)return o;if(i=0,o)u=[u[0]&2,o.value];switch(u[0]){case 0:case 1:o=u;break;case 4:e.label++;return{value:u[1],done:false};case 5:e.label++;i=u[1];u=[0];continue;case 7:u=e.ops.pop();e.trys.pop();continue;default:if(!(o=e.trys,o=o.length>0&&o[o.length-1])&&(u[0]===6||u[0]===2)){e=0;continue}if(u[0]===3&&(!o||u[1]>o[0]&&u[1]r.right||t.rightr.bottom||t.bottom