var t = require; var e = module; var i = exports; Object.defineProperty(i, "__esModule", {value: !0}); const s = t("constants"), o = t("Decorator"); i.default = class extends o.default { constructor({maxTime: t, child: e = null} = {}) { if ((super({child: e, name: "MaxTime", title: "Max ms", properties: {maxTime: 0}}), !t)) throw "maxTime parameter in MaxTime decorator is an obligatory parameter"; this.maxTime = t; } open(t) { var e = new Date().getTime(); t.blackboard.set("startTime", e, t.tree.id, this.id); } tick(t) { if (!this.child) return s.ERROR; var e = new Date().getTime(), i = t.blackboard.get("startTime", t.tree.id, this.id), t = this.child._execute(t); return e - i > this.maxTime ? s.FAILURE : t; } };