"use strict"; "object" != typeof window.cp && (window.cp = {}), window.cp.pentimer = { programnolongerbeingmonitored: !1, timeoffirstcalltoshouldstoploop: 0, _loopexits: {}, _looptimers: {}, start_monitoring_after: 2e3, stop_all_monitoring_timeout: 5e3, max_time_in_loop_wo_exit: 2200, exitedloop: function (o) { this._loopexits[o] = !0 }, shouldstoploop: function (o) { if (this.programkilledsostopmonitoring) return !0; if (this.programnolongerbeingmonitored) return !1; if (this._loopexits[o]) return !1; var t = this._gettime(); if (0 === this.timeoffirstcalltoshouldstoploop) return this.timeoffirstcalltoshouldstoploop = t, !1; var i = t - this.timeoffirstcalltoshouldstoploop; if (i < this.start_monitoring_after) return !1; if (i > this.stop_all_monitoring_timeout) return this.programnolongerbeingmonitored = !0, !1; try { this._checkoninfiniteloop(o, t) } catch (o) { return this._senderrormessagetoeditor(), this.programkilledsostopmonitoring = !0, !0 } return !1 }, _senderrormessagetoeditor: function () { try { if (this._shouldpostmessage()) { var o = { action: "infinite-loop", line: this._findaroundlinenumber() }; parent.postmessage(json.stringify(o), "*") } else this._throwanerrortostoppen() } catch (o) { this._throwanerrortostoppen() } }, _shouldpostmessage: function () { return document.location.href.match(/boomerang/) }, _throwanerrortostoppen: function () { throw "error" }, _findaroundlinenumber: function () { var o = new error , t = 0; if (o.stack) { var i = o.stack.match(/boomerang\s+:(\d+):\d+/); i && (t = i[1]) } return t }, _checkoninfiniteloop: function (o, t) { if (!this._looptimers[o]) return this._looptimers[o] = t, !1; var i = t - this._looptimers[o]; if (i > this.max_time_in_loop_wo_exit) throw "infinite loop found on loop: " + o }, _gettime: function () { return +new date } }, window.cp.shouldstopexecution = function (o) { var t = window.cp.pentimer.shouldstoploop(o); return t === !0 && console.warn("sorry!"), t } , window.cp.exitedloop = function (o) { window.cp.pentimer.exitedloop(o) } ;