define("tools", ["moneyApi"],
    function(moneyApi) {
        "use strict";

        function $iterator(o) {
            if (o instanceof Array) return function() {
                return {
                    cur: 0,
                    arr: o,
                    hasNext: function() {
                        return this.cur < this.arr.length;
                    },
                    next: function() {
                        return this.arr[this.cur++];
                    }
                };
            };
            return typeof(o.iterator) == 'function' ? $bind(o, o.iterator) : o.iterator;
        };;
        var $fid = 0;

        function $bind(o, m) {
            if (m == null) return null;
            if (m.__id__ == null) m.__id__ = $fid++;
            var f;
            if (o.hx__closures__ == null) o.hx__closures__ = {};
            else f = o.hx__closures__[m.__id__];
            if (f == null) {
                f = function() {
                    return f.method.apply(f.scope, arguments);
                };
                f.scope = o;
                f.method = m;
                o.hx__closures__[m.__id__] = f;
            }
            return f;
        };
        var $_;
        var $estr = function() {
            return _hcmn_.js_Boot.__string_rec(this, '');
        };
        if (typeof haxe == 'undefined') {
            var haxe = {};
        };

        haxe.IMap = function() {}
        haxe.IMap.prototype = {

            get: function(k) {
                return {
                    arguments: ["*"],
                    returns: "null"
                };
            },
            set: function(k, v) {
                return {
                    arguments: ["*", "*"],
                    returns: "void"
                };
            },
            exists: function(k) {
                return {
                    arguments: ["*"],
                    returns: "boolean"
                };
            },
            remove: function(k) {
                return {
                    arguments: ["*"],
                    returns: "boolean"
                };
            },
            keys: function() {
                return {
                    arguments: [],
                    returns: "null"
                };
            },
            iterator: function() {
                return {
                    arguments: [],
                    returns: "null"
                };
            },
            toString: function() {
                return {
                    arguments: [],
                    returns: "string"
                };
            }
        };
        if (!haxe.ds) {
            haxe.ds = {};
        };
        if (!haxe.ds._StringMap) {
            haxe.ds._StringMap = {};
        };
        haxe.ds._StringMap.StringMapIterator = function(map, keys) {
            this.map = map;
            this.keys = keys;
            this.index = 0;
            this.count = keys.length;
        };
        haxe.ds._StringMap.StringMapIterator.__name__ = ["haxe", "ds", "_StringMap", "StringMapIterator"];
        haxe.ds._StringMap.StringMapIterator.prototype.map = null;
        haxe.ds._StringMap.StringMapIterator.prototype.keys = null;
        haxe.ds._StringMap.StringMapIterator.prototype.index = null;
        haxe.ds._StringMap.StringMapIterator.prototype.count = null;
        haxe.ds._StringMap.StringMapIterator.prototype.hasNext = function() {
            return this.index < this.count;
        };
        haxe.ds._StringMap.StringMapIterator.prototype.next = function() {
            return this.map.get(this.keys[this.index++]);
        };
        haxe.ds._StringMap.StringMapIterator.prototype.__class__ = haxe.ds._StringMap.StringMapIterator;
        if (typeof tools == 'undefined') {
            var tools = {};
        };
        tools.ArrayUtil = function() {};
        tools.ArrayUtil.__name__ = ["tools", "ArrayUtil"];
        tools.ArrayUtil.getMostFrequent = function(arr) {
            arr.sort(function(a, b) {
                return a - b;
            });
            var maxCount = 1;
            var ressult = arr[0];
            var currentCount = 1;
            var _g1 = 1;
            var _g = arr.length;
            while (_g1 < _g) {
                var i = _g1++;
                if (arr[i] == arr[i - 1]) currentCount++;
                else {
                    if (currentCount > maxCount) {
                        maxCount = currentCount;
                        ressult = arr[i - 1];
                    }
                    currentCount = 1;
                }
            }
            if (currentCount > maxCount) {
                maxCount = currentCount;
                ressult = arr[arr.length - 1];
            }
            return ressult;
        };
        tools.ArrayUtil.prototype.__class__ = tools.ArrayUtil;
        tools.Await = function() {};
        tools.Await.__name__ = ["tools", "Await"];
        tools.Await.await = function(booleanSupplier, calback, scriptTimeout) {
            if (scriptTimeout == null) scriptTimeout = 100;
            var intervalId = 0;
            intervalId = window.setInterval(function() {
                if (booleanSupplier()) {
                    window.clearInterval(intervalId);
                    calback();
                }
            }, scriptTimeout);
        };
        tools.Await.prototype.__class__ = tools.Await;
        tools.HotKeyPanel = function(actions) {
            this.groupLimit = 3;
            this.groupStatuses = new tools.CustomMap();
            this.actions = actions;
        };
        tools.HotKeyPanel.__name__ = ["tools", "HotKeyPanel"];
        tools.HotKeyPanel.prototype.actions = null;
        tools.HotKeyPanel.prototype.bg = null;
        tools.HotKeyPanel.prototype.bgHeader = null;
        tools.HotKeyPanel.prototype.bgContent = null;
        tools.HotKeyPanel.prototype.closePanelCheckBox = null;
        tools.HotKeyPanel.prototype.groupStatuses = null;
        tools.HotKeyPanel.prototype.groupLimit = null;
        tools.HotKeyPanel.prototype.activateTouchScreen = function() {
            var _g = this;
            this.bg = window.document.createElement("div");
            this.bgHeader = window.document.createElement("div");
            this.bgHeader.style.padding = "5px";
            this.bgContent = window.document.createElement("div");
            this.bgContent.style.padding = "5px";
            this.bg.appendChild(this.bgHeader);
            this.bg.appendChild(this.bgContent);
            this.bg.style.backgroundColor = "#0000008c";
            this.bg.style.width = "80%";
            this.bg.style.height = "80%";
            this.bg.style.top = "10%";
            this.bg.style.left = "10%";
            this.bg.style.zIndex = "100500";
            this.bg.style.position = "absolute";
            this.bg.style.display = "none";
            this.bg.id = "devPopup";
            var _this = window.document;
            this.closePanelCheckBox = _this.createElement("input");
            this.closePanelCheckBox.type = "checkbox";
            this.closePanelCheckBox.id = "isNeedToCloseDevTool";
            this.closePanelCheckBox.checked = !new _hcmn_.EReg("(.*DevTool.closeAfterCall=0.*)(\\w+)", "g").match(window.document.cookie);
            this.closePanelCheckBox.onclick = function() {
                window.document.cookie = "DevTool.closeAfterCall=" + (_g.closePanelCheckBox.checked ? 1 : 0);
            };
            var label;
            var _this1 = window.document;
            label = _this1.createElement("label");
            label.textContent = "Close after call";
            label.htmlFor = this.closePanelCheckBox.id;
            label.style.color = "#ffffff";
            label.style.fontWeight = "bold";
            this.makeElementUnselectable(label);
            this.makeElementUnselectable(this.closePanelCheckBox);
            this.bgHeader.appendChild(this.closePanelCheckBox);
            this.bgHeader.appendChild(label);
            var btn;
            var _this2 = window.document;
            btn = _this2.createElement("button");
            btn.style.position = "absolute";
            btn.style.zIndex = "100500";
            btn.style.top = "50px";
            btn.style.left = "7px";
            btn.textContent = "Debug";
            btn.onclick = function(event) {
                if (_g.bg.style.display == "block") _g.bg.style.display = "none";
                else _g.bg.style.display = "block";
                _g.redrawPanel();
            };
            var game = window.document.getElementById("game");
            window.document.body.appendChild(this.bg);
            window.document.body.appendChild(btn);
        };
        tools.HotKeyPanel.prototype.redrawPanel = function() {
            var _g = this;
            this.bgContent.innerHTML = "";
            var groups = this.getCheatGroups();
            var groupsElement;
            var _this = window.document;
            groupsElement = _this.createElement("div");
            groupsElement.id = "groupsElement";
            var reset;
            var _this1 = window.document;
            reset = _this1.createElement("label");
            reset.style.color = "#CECECE";
            reset.style.fontWeight = "bold";
            reset.style.textDecoration = "underline";
            reset.textContent = "Reset: ";
            reset.onclick = function() {
                _g.groupLimit = 3;
                _g.groupStatuses.setAll(false);
                _g.redrawPanel();
            };
            this.useHandCursour(reset);
            groupsElement.appendChild(reset);
            var _g1 = 0;
            while (_g1 < groups.length) {
                var group = [groups[_g1]];
                ++_g1;
                this.groupStatuses.set(group[0], this.groupStatuses.getOrDefault(group[0], false));
                var groupCheckBox = [(function($this) {
                    var $r;
                    var _this2 = window.document;
                    $r = _this2.createElement("input");
                    return $r;
                }(this))];
                groupCheckBox[0].type = "checkbox";
                groupCheckBox[0].id = group[0];
                groupCheckBox[0].value = group[0];
                groupCheckBox[0].checked = this.groupStatuses.get(group[0]);
                groupCheckBox[0].onchange = (function(groupCheckBox, group) {
                    return function() {
                        _g.groupStatuses.set(group[0], groupCheckBox[0].checked);
                        _g.redrawPanel();
                    };
                })(groupCheckBox, group);
                var label;
                var _this3 = window.document;
                label = _this3.createElement("label");
                label.textContent = group[0];
                label.htmlFor = groupCheckBox[0].id;
                label.style.color = "#ffffff";
                label.style.fontWeight = "bold";
                groupsElement.appendChild(groupCheckBox[0]);
                groupsElement.appendChild(label);
                this.makeElementUnselectable(label);
                this.makeElementUnselectable(groupCheckBox[0]);
            }
            var showMore;
            var _this4 = window.document;
            showMore = _this4.createElement("label");
            showMore.style.color = "#CECECE";
            showMore.style.textDecoration = "underline";
            showMore.style.fontWeight = "bold";
            showMore.textContent = " ... ";
            showMore.onclick = function() {
                _g.groupLimit = _hcmn_.Math.round(_hcmn_.Math.max(1, _g.groupLimit - 1));
                _g.redrawPanel();
            };
            this.useHandCursour(showMore);
            groupsElement.appendChild(showMore);
            var previousGroupsElement = window.document.getElementById(groupsElement.id);
            if (previousGroupsElement != null) this.bgHeader.removeChild(previousGroupsElement);
            this.bgHeader.appendChild(groupsElement);
            this.redrawHotKeyButtons();
        };
        tools.HotKeyPanel.prototype.redrawHotKeyButtons = function() {
            var _g1 = this;
            var checkGroups = this.groupStatuses.containsValue(true);
            var $it0 = this.actions.iterator();
            while ($it0.hasNext()) {
                var actions = $it0.next();
                var _g = 0;
                while (_g < actions.length) {
                    var action = [actions[_g]];
                    ++_g;
                    var isInGroups = action[0].description.toUpperCase().split(" ").filter((function() {
                        return function(v) {
                            return _g1.groupStatuses.get(v);
                        };
                    })()).length > 0;
                    if (checkGroups && !isInGroups) continue;
                    var actionBtn;
                    var _this = window.document;
                    actionBtn = _this.createElement("button");
                    actionBtn.textContent = action[0].description;
                    actionBtn.disabled = action[0].action == null;
                    actionBtn.onclick = (function(action) {
                        return function() {
                            var isNeedToClose = _g1.closePanelCheckBox.checked;
                            if (isNeedToClose) _g1.bg.style.display = "none";
                            action[0].action();
                            if (!isNeedToClose) _g1.redrawPanel();
                        };
                    })(action);
                    this.makeElementUnselectable(actionBtn);
                    this.bgContent.appendChild(actionBtn);
                }
            }
        };
        tools.HotKeyPanel.prototype.getCheatGroups = function() {
            var tmpResult = [];
            var result = [];
            var $it0 = this.actions.iterator();
            while ($it0.hasNext()) {
                var actions = $it0.next();
                var _g = 0;
                while (_g < actions.length) {
                    var action = actions[_g];
                    ++_g;
                    tmpResult = tmpResult.concat(action.description.split(" "));
                }
            }
            var cache = new tools.CustomMap();
            var collectCache = function(a) {
                cache.set(a, cache.getOrDefault(a, 0) + 1);
            };
            tmpResult = tmpResult.map(function(a1) {
                return a1.toUpperCase();
            });
            _hcmn_.Lambda.iter(tmpResult, collectCache);
            tmpResult.sort(function(a2, b) {
                return cache.get(b) - cache.get(a2);
            });
            var _g1 = 0;
            while (_g1 < tmpResult.length) {
                var tag = tmpResult[_g1];
                ++_g1;
                if (_hcmn_.HxOverrides.indexOf(result, tag, 0) == -1 && cache.get(tag) >= this.groupLimit) result.push(tag);
            }
            return result;
        };
        tools.HotKeyPanel.prototype.useHandCursour = function(element) {
            this.makeElementUnselectable(element);
            var style = element.style;
            style.cursor = "pointer";
        };
        tools.HotKeyPanel.prototype.makeElementUnselectable = function(element) {
            var style = element.style;
            style.setProperty("ser-select", "none");
            style.setProperty("-moz-user-select", "none");
            style.setProperty("-khtml-user-select", "none");
            style.setProperty("-webkit-user-select", "none");
            style.setProperty("-o-user-select", "none");
        };
        tools.HotKeyPanel.prototype.__class__ = tools.HotKeyPanel;
        tools.HotKeyTool = function() {
            this.actions = new _hcmn_.haxe_ds_StringMap();
        };
        tools.HotKeyTool.__name__ = ["tools", "HotKeyTool"];
        tools.HotKeyTool.prototype.actions = null;
        tools.HotKeyTool.prototype.isDevice = null;
        tools.HotKeyTool.prototype.activateHotKeys = function() {
            var _g = this;
            var documentOnkeypressF = window.document.body.onkeypress;
            window.document.onkeypress = function(e) {
                if (documentOnkeypressF != null) documentOnkeypressF(e);
                _g.onkeypress(e);
            };
        };
        tools.HotKeyTool.prototype.initSystemHotkeys = function() {
            var _g1 = this;
            var unRegisterFunctionalKeys = function() {
                var _g = 0;
                while (_g < 10) {
                    var i = _g++;
                    _g1.unRegisterOnKey("" + i);
                }
                _g1.unRegisterOnKey(" ");
            };
            if (this.isDevice) this.registerOnKey("`", function() {
                _g1.dispatchKBEvent(192);
                _g1.unRegisterOnKey("`");
                _g1.registerOnKey("`", null, "Show FPS metter");
            }, "Show FPS metter");
            else this.registerOnKey("`", function() {
                new tools.HotKeyPanel(_g1.actions).activateTouchScreen();
                _g1.unRegisterOnKey("`");
                _g1.registerOnKey("`", null, "Show FPS metter");
            }, "activate touch screen");
            this.registerOnKey("e", (function(f, a1) {
                return function() {
                    f(a1);
                };
            })($bind(this, this.dispatchKBEvent), 69), "Show EMY simulator");
            this.registerOnKey("F9", (function(f1, a11) {
                return function() {
                    f1(a11);
                };
            })($bind(this, this.dispatchKBEvent), 120), "Show GAFF tool(Cheat panel)");
            this.registerOnKey("F10", (function(f2, a12) {
                return function() {
                    f2(a12);
                };
            })($bind(this, this.dispatchKBEvent), 121), "Show Fps graph tool");
            this.registerOnKey("F8", (function(f3, a13) {
                return function() {
                    f3(a13);
                };
            })($bind(this, this.dispatchKBEvent), 119), "Show SOUNDS test tool");
            this.registerOnKey("Alt + i", (function(f4, a14, a2, a3) {
                return function() {
                    f4(a14, a2, a3);
                };
            })($bind(this, this.dispatchKBEvent), 73, false, true), "Show elements inspector");
            this.registerOnKey("d", unRegisterFunctionalKeys, "UNREGISTER SYSTEM KEYS");
            this.registerOnKey("~", $bind(this, this.showAllPopupWithHotKeysDescriptions), "Show popup with hot keys descriptions");
        };
        tools.HotKeyTool.prototype.dispatchKBEvent = function(keyCode, ctrlKey, altKey, shiftKey) {
            if (shiftKey == null) shiftKey = false;
            if (altKey == null) altKey = false;
            if (ctrlKey == null) ctrlKey = false;
            var e = new Event("keydown");
            e.keyCode = keyCode;
            e.which = e.keyCode;
            e.altKey = altKey;
            e.ctrlKey = ctrlKey;
            e.shiftKey = shiftKey;
            window.document.body.dispatchEvent(e);
            window.dispatchEvent(e);
        };
        tools.HotKeyTool.prototype.showAllPopupWithHotKeysDescriptions = function() {
            var allActions = [];
            var $it0 = this.actions.iterator();
            while ($it0.hasNext()) {
                var actions = $it0.next();
                var _g = 0;
                while (_g < actions.length) {
                    var action = actions[_g];
                    ++_g;
                    allActions.push(action);
                }
            }
            while (allActions.length > 0) {
                var actions1 = allActions.splice(0, 23);
                if (!this.showPopupWithActionsDescription(actions1)) return;
            }
        };
        tools.HotKeyTool.prototype.showPopupWithActionsDescription = function(actions) {
            var message = "Actual reserved hot keys:\n";
            var _g = 0;
            while (_g < actions.length) {
                var action = actions[_g];
                ++_g;
                var action1 = action;
                message += "• " + action1.key + " : " + action1.description + "\n";
            }
            return window.confirm(message);
        };
        tools.HotKeyTool.prototype.unRegisterOnKey = function(key) {
            if (this.actions.exists(key)) this.actions.remove(key);
        };
        tools.HotKeyTool.prototype.registerOnKey = function(key, action, description, overrideAction) {
            if (overrideAction == null) overrideAction = false;
            if (description == null) description = "Empty description";
            if (!this.actions.exists(key) || overrideAction) this.actions.set(key, []);
            this.actions.get(key).push(new tools.hokeys.Action(action, description, key));
        };
        tools.HotKeyTool.prototype.onkeypress = function(e) {
            console.log("GC::HotKeyTool:\r\n            \te.ctrlKey: " + (e.ctrlKey == null ? "null" : "" + e.ctrlKey) + "\r\n            \te.altKey: " + (e.altKey == null ? "null" : "" + e.altKey) + "\r\n            \te.shiftKey: " + (e.shiftKey == null ? "null" : "" + e.shiftKey) + "\r\n            \te.charCode: " + e.charCode + "\r\n            \te.keyCode: " + e.keyCode + "\r\n            \te.key: " + e.key + "\r\n            \te.repeat: " + (e.repeat == null ? "null" : "" + e.repeat) + "\r\n                        ");
            this.call(e.key);
        };
        tools.HotKeyTool.prototype.unRegisterFunctionalKeys = function() {
            this.call("e");
        };
        tools.HotKeyTool.prototype.call = function(key) {
            if (this.actions.exists(key)) {
                var _g = 0;
                var _g1 = this.actions.get(key);
                while (_g < _g1.length) {
                    var action = _g1[_g];
                    ++_g;
                    if (action.action != null) action.action();
                }
            }
        };
        tools.HotKeyTool.prototype.__class__ = tools.HotKeyTool;
        if (!tools.hokeys) {
            tools.hokeys = {};
        };
        tools.hokeys.Action = function(action, description, key) {
            this.action = action;
            this.description = description;
            this.key = key;
        };
        tools.hokeys.Action.__name__ = ["tools", "hokeys", "Action"];
        tools.hokeys.Action.prototype.action = null;
        tools.hokeys.Action.prototype.description = null;
        tools.hokeys.Action.prototype.key = null;
        tools.hokeys.Action.prototype.__class__ = tools.hokeys.Action;
        tools.CustomMap = function(map) {
            this.map = map;
            if (map == null) this.map = new _hcmn_.haxe_ds_StringMap();
        };
        tools.CustomMap.__interfaces__ = [haxe.IMap];
        tools.CustomMap.__name__ = ["tools", "CustomMap"];
        tools.CustomMap.prototype.map = null;
        tools.CustomMap.prototype.getOrDefault = function(k, defaultValue) {
            if (this.exists(k)) return this.get(k);
            else return defaultValue;
        };
        tools.CustomMap.prototype.get = function(k) {
            return this.map.get(k);
        };
        tools.CustomMap.prototype.setAll = function(v) {
            var $it0 = this.keys();
            while ($it0.hasNext()) {
                var key = $it0.next();
                this.set(key, v);
            }
        };
        tools.CustomMap.prototype.setIfNotExist = function(k, v) {
            this.set(k, this.getOrDefault(k, v));
        };
        tools.CustomMap.prototype.set = function(k, v) {
            this.map.set(k, v);
        };
        tools.CustomMap.prototype.exists = function(k) {
            return this.map.exists(k);
        };
        tools.CustomMap.prototype.remove = function(k) {
            return this.map.remove(k);
        };
        tools.CustomMap.prototype.keys = function() {
            return this.map.keys();
        };
        tools.CustomMap.prototype.iterator = function() {
            return this.map.iterator();
        };
        tools.CustomMap.prototype.toString = function() {
            return this.map.toString();
        };
        tools.CustomMap.prototype.containsValue = function(value) {
            var $it0 = this.map.iterator();
            while ($it0.hasNext()) {
                var mapValue = $it0.next();
                if (mapValue == value) return true;
            }
            return false;
        };
        tools.CustomMap.prototype.__class__ = tools.CustomMap;
        tools.DecimalValue = function(decimalValue) {
            this.decimalValue = decimalValue;
        };
        tools.DecimalValue.__name__ = ["tools", "DecimalValue"];
        tools.DecimalValue.prototype.decimalValue = null;
        tools.DecimalValue.prototype.asString = function() {
            return this.decimalValue;
        };
        tools.DecimalValue.prototype.asFloat = function() {
            return parseFloat(this.decimalValue);
        };
        tools.DecimalValue.prototype.asFixedFloat = function(precision) {
            if (precision == null) precision = 0;
            return tools.FloatUtil.fixedFloat(this.asFloat(), precision);
        };
        tools.DecimalValue.prototype.asInt = function() {
            return _hcmn_.Std.parseInt(this.decimalValue);
        };
        tools.DecimalValue.prototype.__class__ = tools.DecimalValue;
        tools.MoneyValue = function(moneyFromater, moneyValue) {
            tools.DecimalValue.call(this, moneyValue);
            this.moneyFromater = moneyFromater;
        };
        tools.MoneyValue.__name__ = ["tools", "MoneyValue"];
        tools.MoneyValue.__super__ = tools.DecimalValue;
        for (var k in tools.DecimalValue.prototype) tools.MoneyValue.prototype[k] = tools.DecimalValue.prototype[k];
        tools.MoneyValue.prototype.moneyFromater = null;
        tools.MoneyValue.prototype.format = function() {
            return this.moneyFromater.format(this.decimalValue);
        };
        tools.MoneyValue.prototype.isZero = function() {
            return this.moneyFromater.isZero(this.decimalValue);
        };
        tools.MoneyValue.prototype.isNotZero = function() {
            return !this.isZero();
        };
        tools.MoneyValue.prototype.__class__ = tools.MoneyValue;
        tools.MoneyValueProvider = function(moneyFormatter) {
            this.moneyFormatter = moneyFormatter;
        };
        tools.MoneyValueProvider.__name__ = ["tools", "MoneyValueProvider"];
        tools.MoneyValueProvider.prototype.moneyFormatter = null;
        tools.MoneyValueProvider.prototype.provide = function(moneyValue) {
            return new tools.MoneyValue(this.moneyFormatter, moneyValue);
        };
        tools.MoneyValueProvider.prototype.__class__ = tools.MoneyValueProvider;
        tools.FloatUtil = function() {};
        tools.FloatUtil.__name__ = ["tools", "FloatUtil"];
        tools.FloatUtil.fixedFloat = function(v, precision) {
            if (precision == null) precision = 2;
            var pow = _hcmn_.Math.pow(10, precision);
            return _hcmn_.Math.round(v * pow) / pow;
        };
        tools.FloatUtil.correctDivision = function(dividend, divisor, floatPointOffset) {
            if (floatPointOffset == null) floatPointOffset = 100;
            return dividend * floatPointOffset / (divisor * floatPointOffset);
        };
        tools.FloatUtil.correctMultiplication = function(factor, multiplier, floatPointOffset) {
            if (floatPointOffset == null) floatPointOffset = 100;
            return factor * floatPointOffset * (multiplier * floatPointOffset) / (floatPointOffset * floatPointOffset);
        };
        tools.FloatUtil.prototype.__class__ = tools.FloatUtil;
        tools.PromizesWaiter = function() {
            this.promizes = [];
        };
        tools.PromizesWaiter.__name__ = ["tools", "PromizesWaiter"];
        tools.PromizesWaiter.prototype.promizes = null;
        tools.PromizesWaiter.prototype.awaitPromise = function(promize) {
            this.promizes.push(promize);
            return this;
        };
        tools.PromizesWaiter.prototype.await = function(calback) {
            var _g = this;
            var amountOfCompletion = 0;
            var awaitChecker = function(data) {
                amountOfCompletion++;
                if (amountOfCompletion == _g.promizes.length) calback();
            };
            var _g1 = 0;
            var _g11 = this.promizes;
            while (_g1 < _g11.length) {
                var promise = _g11[_g1];
                ++_g1;
                promise.then(awaitChecker);
            }
        };
        tools.PromizesWaiter.prototype.__class__ = tools.PromizesWaiter;
        tools.TimeoutInvoker = function() {};
        tools.TimeoutInvoker.__name__ = ["tools", "TimeoutInvoker"];
        tools.TimeoutInvoker.clearTimeoutsWithForceInvoke = function(groupName) {
            tools.TimeoutInvoker.clearTimeouts(groupName, true);
        };
        tools.TimeoutInvoker.clearTimeoutsWithoutForceInvoke = function(groupName) {
            tools.TimeoutInvoker.clearTimeouts(groupName, false);
        };
        tools.TimeoutInvoker.clearTimeouts = function(groupName, isNeedInvokeBeforeClear) {
            if (isNeedInvokeBeforeClear == null) isNeedInvokeBeforeClear = false;
            var list;
            var _this = tools.TimeoutInvoker.getTimeoutsGroup(groupName);
            list = _this.slice();
            var _g = 0;
            while (_g < list.length) {
                var instance = list[_g];
                ++_g;
                window.clearTimeout(instance.timeOutId);
                var _this1 = tools.TimeoutInvoker.getTimeoutsGroup(groupName);
                _hcmn_.HxOverrides.remove(_this1, instance);
                if (isNeedInvokeBeforeClear) {
                    instance.isCalled = true;
                    instance.handler();
                }
            }
            tools.TimeoutInvoker.TIMEOUT_GROUPS.remove(groupName);
        };
        tools.TimeoutInvoker.setTimeout = function(groupName, handler, timeout) {
            if (timeout == null) timeout = 0;
            var invokeInstance = new tools.timeouts.InvokeInstance();
            var id = window.setTimeout(tools.TimeoutInvoker.getInvokeHandler(invokeInstance), timeout);
            invokeInstance.groupName = groupName;
            invokeInstance.timeOutId = id;
            invokeInstance.handler = handler;
            tools.TimeoutInvoker.getTimeoutsGroup(groupName).push(invokeInstance);
        };
        tools.TimeoutInvoker.getInvokeHandler = function(instance) {
            return function() {
                if (!instance.isCalled) {
                    instance.isCalled = true;
                    var _this = tools.TimeoutInvoker.getTimeoutsGroup(instance.groupName);
                    _hcmn_.HxOverrides.remove(_this, instance);
                    instance.handler();
                }
            };
        };
        tools.TimeoutInvoker.getTimeoutsGroup = function(groupName) {
            if (!tools.TimeoutInvoker.TIMEOUT_GROUPS.exists(groupName)) {
                var value = [];
                tools.TimeoutInvoker.TIMEOUT_GROUPS.set(groupName, value);
            }
            return tools.TimeoutInvoker.TIMEOUT_GROUPS.get(groupName);
        };
        tools.TimeoutInvoker.prototype.__class__ = tools.TimeoutInvoker;
        if (!tools.timeouts) {
            tools.timeouts = {};
        };
        tools.timeouts.InvokeInstance = function() {
            this.isCalled = false;
        };
        tools.timeouts.InvokeInstance.__name__ = ["tools", "timeouts", "InvokeInstance"];
        tools.timeouts.InvokeInstance.prototype.isCalled = null;
        tools.timeouts.InvokeInstance.prototype.groupName = null;
        tools.timeouts.InvokeInstance.prototype.handler = null;
        tools.timeouts.InvokeInstance.prototype.timeOutId = null;
        tools.timeouts.InvokeInstance.prototype.__class__ = tools.timeouts.InvokeInstance;
        tools.HotKeyTool.instance = new tools.HotKeyTool();;
        tools.TimeoutInvoker.TIMEOUT_GROUPS = new _hcmn_.haxe_ds_StringMap();;
        return {
            exports: tools
        };
    });
//# sourceURL=wildFuryTools.js