define("infoBar", ["viewBuilderApi", "componentmodelComponentApi", "clientkernelLoaderApi", "displayEngineApi", "displayEngineUtils", "gameLayoutApi", "clientkernelEventbusApi", "infoBarApi", "clientkernelModulesApi"],
    function(viewBuilderApi, componentmodelComponentApi, clientkernelLoaderApi, displayEngineApi, displayEngineUtils, gameLayoutApi, clientkernelEventbusApi, infoBarApi, clientkernelModulesApi) {
        "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"
                };
            },
            keys: function() {
                return {
                    arguments: [],
                    returns: "null"
                };
            }
        };
        if (!haxe.ds) {
            haxe.ds = {};
        };
        haxe.ds.BalancedTree = function() {};
        haxe.ds.BalancedTree.__name__ = ["haxe", "ds", "BalancedTree"];
        haxe.ds.BalancedTree.prototype.root = null;
        haxe.ds.BalancedTree.prototype.set = function(key, value) {
            this.root = this.setLoop(key, value, this.root);
        };
        haxe.ds.BalancedTree.prototype.get = function(key) {
            var node = this.root;
            while (node != null) {
                var c = this.compare(key, node.key);
                if (c == 0) return node.value;
                if (c < 0) node = node.left;
                else node = node.right;
            }
            return null;
        };
        haxe.ds.BalancedTree.prototype.iterator = function() {
            var ret = [];
            this.iteratorLoop(this.root, ret);
            return _hcmn_.HxOverrides.iter(ret);
        };
        haxe.ds.BalancedTree.prototype.keys = function() {
            var ret = [];
            this.keysLoop(this.root, ret);
            return _hcmn_.HxOverrides.iter(ret);
        };
        haxe.ds.BalancedTree.prototype.setLoop = function(k, v, node) {
            if (node == null) return new haxe.ds.TreeNode(null, k, v, null);
            var c = this.compare(k, node.key);
            if (c == 0) return new haxe.ds.TreeNode(node.left, k, v, node.right, node == null ? 0 : node._height);
            else if (c < 0) {
                var nl = this.setLoop(k, v, node.left);
                return this.balance(nl, node.key, node.value, node.right);
            } else {
                var nr = this.setLoop(k, v, node.right);
                return this.balance(node.left, node.key, node.value, nr);
            }
        };
        haxe.ds.BalancedTree.prototype.iteratorLoop = function(node, acc) {
            if (node != null) {
                this.iteratorLoop(node.left, acc);
                acc.push(node.value);
                this.iteratorLoop(node.right, acc);
            }
        };
        haxe.ds.BalancedTree.prototype.keysLoop = function(node, acc) {
            if (node != null) {
                this.keysLoop(node.left, acc);
                acc.push(node.key);
                this.keysLoop(node.right, acc);
            }
        };
        haxe.ds.BalancedTree.prototype.balance = function(l, k, v, r) {
            var hl;
            if (l == null) hl = 0;
            else hl = l._height;
            var hr;
            if (r == null) hr = 0;
            else hr = r._height;
            if (hl > hr + 2) {
                if ((function($this) {
                        var $r;
                        var _this = l.left;
                        $r = _this == null ? 0 : _this._height;
                        return $r;
                    }(this)) >= (function($this) {
                        var $r;
                        var _this1 = l.right;
                        $r = _this1 == null ? 0 : _this1._height;
                        return $r;
                    }(this))) return new haxe.ds.TreeNode(l.left, l.key, l.value, new haxe.ds.TreeNode(l.right, k, v, r));
                else return new haxe.ds.TreeNode(new haxe.ds.TreeNode(l.left, l.key, l.value, l.right.left), l.right.key, l.right.value, new haxe.ds.TreeNode(l.right.right, k, v, r));
            } else if (hr > hl + 2) {
                if ((function($this) {
                        var $r;
                        var _this2 = r.right;
                        $r = _this2 == null ? 0 : _this2._height;
                        return $r;
                    }(this)) > (function($this) {
                        var $r;
                        var _this3 = r.left;
                        $r = _this3 == null ? 0 : _this3._height;
                        return $r;
                    }(this))) return new haxe.ds.TreeNode(new haxe.ds.TreeNode(l, k, v, r.left), r.key, r.value, r.right);
                else return new haxe.ds.TreeNode(new haxe.ds.TreeNode(l, k, v, r.left.left), r.left.key, r.left.value, new haxe.ds.TreeNode(r.left.right, r.key, r.value, r.right));
            } else return new haxe.ds.TreeNode(l, k, v, r, (hl > hr ? hl : hr) + 1);
        };
        haxe.ds.BalancedTree.prototype.compare = function(k1, k2) {
            return _hcmn_.Reflect.compare(k1, k2);
        };
        haxe.ds.BalancedTree.prototype.__class__ = haxe.ds.BalancedTree;
        haxe.ds.TreeNode = function(l, k, v, r, h) {
            if (h == null) h = -1;
            this.left = l;
            this.key = k;
            this.value = v;
            this.right = r;
            if (h == -1) this._height = ((function($this) {
                var $r;
                var _this = $this.left;
                $r = _this == null ? 0 : _this._height;
                return $r;
            }(this)) > (function($this) {
                var $r;
                var _this1 = $this.right;
                $r = _this1 == null ? 0 : _this1._height;
                return $r;
            }(this)) ? (function($this) {
                var $r;
                var _this2 = $this.left;
                $r = _this2 == null ? 0 : _this2._height;
                return $r;
            }(this)) : (function($this) {
                var $r;
                var _this3 = $this.right;
                $r = _this3 == null ? 0 : _this3._height;
                return $r;
            }(this))) + 1;
            else this._height = h;
        };
        haxe.ds.TreeNode.__name__ = ["haxe", "ds", "TreeNode"];
        haxe.ds.TreeNode.prototype.left = null;
        haxe.ds.TreeNode.prototype.right = null;
        haxe.ds.TreeNode.prototype.key = null;
        haxe.ds.TreeNode.prototype.value = null;
        haxe.ds.TreeNode.prototype._height = null;
        haxe.ds.TreeNode.prototype.__class__ = haxe.ds.TreeNode;
        haxe.ds.EnumValueMap = function() {
            haxe.ds.BalancedTree.call(this);
        };
        haxe.ds.EnumValueMap.__interfaces__ = [haxe.IMap];
        haxe.ds.EnumValueMap.__name__ = ["haxe", "ds", "EnumValueMap"];
        haxe.ds.EnumValueMap.__super__ = haxe.ds.BalancedTree;
        for (var k in haxe.ds.BalancedTree.prototype) haxe.ds.EnumValueMap.prototype[k] = haxe.ds.BalancedTree.prototype[k];
        haxe.ds.EnumValueMap.prototype.compare = function(k1, k2) {
            var d = k1[1] - k2[1];
            if (d != 0) return d;
            var p1 = k1.slice(2);
            var p2 = k2.slice(2);
            if (p1.length == 0 && p2.length == 0) return 0;
            return this.compareArgs(p1, p2);
        };
        haxe.ds.EnumValueMap.prototype.compareArgs = function(a1, a2) {
            var ld = a1.length - a2.length;
            if (ld != 0) return ld;
            var _g1 = 0;
            var _g = a1.length;
            while (_g1 < _g) {
                var i = _g1++;
                var d = this.compareArg(a1[i], a2[i]);
                if (d != 0) return d;
            }
            return 0;
        };
        haxe.ds.EnumValueMap.prototype.compareArg = function(v1, v2) {
            if (_hcmn_.Reflect.isEnumValue(v1) && _hcmn_.Reflect.isEnumValue(v2)) return this.compare(v1, v2);
            else if ((v1 instanceof Array) && v1.__enum__ == null && ((v2 instanceof Array) && v2.__enum__ == null)) return this.compareArgs(v1, v2);
            else return _hcmn_.Reflect.compare(v1, v2);
        };
        haxe.ds.EnumValueMap.prototype.__class__ = haxe.ds.EnumValueMap;
        if (typeof infoBar == 'undefined') {
            var infoBar = {};
        };
        infoBar.Activator = function(context) {};
        infoBar.Activator = ck_implements(infoBar.Activator, clientkernelModulesApi.IModuleActivator);
        infoBar.Activator.__interfaces__ = [clientkernelModulesApi.IModuleActivator];
        infoBar.Activator.__name__ = ["infoBar", "Activator"];
        infoBar.Activator.prototype.start = function(context) {
            context.getServiceTracker([viewBuilderApi.IViewBuilderFactory, clientkernelLoaderApi.IAssetRegistry, displayEngineApi.IDisplayProvider]).then(function(context1) {
                var vbf = context1.getAnyService(viewBuilderApi.IViewBuilderFactory, null);
                infoBar.ExternalService.initialize(context1, vbf);
                context1.registerService(new infoBar.InfoBarFactory(context1), infoBarApi.InfoBarDeclaration, null);
            });
        };
        infoBar.Activator.prototype.stop = function(context) {};
        infoBar.Activator.main = function() {};
        infoBar.Activator.prototype.__class__ = infoBar.Activator;
        infoBar.ExternalService = function() {};
        infoBar.ExternalService.__name__ = ["infoBar", "ExternalService"];
        infoBar.ExternalService.displayProvider = null;
        infoBar.ExternalService.assetRegistry = null;
        infoBar.ExternalService.viewBuilderFactory = null;
        infoBar.ExternalService.loadedAssets = null;
        infoBar.ExternalService.loadedDefinitionConfig = null;
        infoBar.ExternalService.initialize = function(context, vbf) {
            infoBar.ExternalService.displayProvider = context.getAnyService(displayEngineApi.IDisplayProvider, null);
            infoBar.ExternalService.assetRegistry = context.getAnyService(clientkernelLoaderApi.IAssetRegistry, null);
            infoBar.ExternalService.viewBuilderFactory = vbf;
        };
        infoBar.ExternalService.prototype.__class__ = infoBar.ExternalService;
        infoBar.InfoBar = function(context) {
            this.assetsLoaded = false;
            this.initialized = false;
            this.layoutPayload = null;
            this.DEFINITION_CONFIG_ID = "infobar-assets/infobar_definition_config.json";
            this.MAIN_CONFIG_ID = "infobar-assets/infobar_layout.viewbuilder.json";
            this.COMPONENT_ID = "INFO_BAR";
            var _g = this;
            this.context = context;
            this.port = context.getImplementedPort(infoBarApi.IInfoBarImplementationPort);
            this.layoutPort = context.getUsedPort(gameLayoutApi.IGameLayoutPort);
            this.layoutPort.getUpdateComponentLayout().subscribe($bind(this, this.updateLayout));
            this.controller = new infoBar.InfoBarController(this);
            infoBar.ExternalService.assetRegistry.getAsset(this.MAIN_CONFIG_ID).getContent().then(function(vb) {
                infoBar.ExternalService.loadedAssets = vb;
                infoBar.ExternalService.assetRegistry.getAsset(_g.DEFINITION_CONFIG_ID).getContent().then(function(config) {
                    _g.assetsLoaded = true;
                    infoBar.ExternalService.loadedDefinitionConfig = config;
                    _g.initialize();
                });
            });
        };
        infoBar.InfoBar.__name__ = ["infoBar", "InfoBar"];
        infoBar.InfoBar.prototype.COMPONENT_ID = null;
        infoBar.InfoBar.prototype.MAIN_CONFIG_ID = null;
        infoBar.InfoBar.prototype.DEFINITION_CONFIG_ID = null;
        infoBar.InfoBar.prototype.view = null;
        infoBar.InfoBar.prototype.infoBarComponent = null;
        infoBar.InfoBar.prototype.port = null;
        infoBar.InfoBar.prototype.layoutPort = null;
        infoBar.InfoBar.prototype.controller = null;
        infoBar.InfoBar.prototype.context = null;
        infoBar.InfoBar.prototype.layoutPayload = null;
        infoBar.InfoBar.prototype.initialized = null;
        infoBar.InfoBar.prototype.assetsLoaded = null;
        infoBar.InfoBar.prototype.updateLayout = function(e) {
            this.layoutPayload = e.getPayload();
            if (!this.initialized) this.initialize();
            else {
                this.controller.updateLayout(this.layoutPayload);
                this.layoutPort.getComponentLayoutUpdated().publish(this.context.getInstance());
            }
        };
        infoBar.InfoBar.prototype.initialize = function() {
            if (this.assetsLoaded && this.layoutPayload != null) {
                infoBar.InfoBarDefinition.initialize(infoBar.ExternalService.loadedDefinitionConfig);
                this.view = infoBar.ExternalService.viewBuilderFactory.createView(infoBar.ExternalService.loadedAssets);
                var container = this.view.getComponentById(this.COMPONENT_ID);
                if (container == null) throw new Error("InfoBar container (with INFO_BAR id) not found in assets!");
                this.infoBarComponent = new infoBar.InfoBarComponent(container);
                this.controller.init();
                this.controller.updateLayout(this.layoutPayload);
                this.layoutPort.getComponentLayoutUpdated().publish(this.context.getInstance());
                this.initialized = true;
            }
        };
        infoBar.InfoBar.prototype.getInfoBarComponent = function() {
            return this.infoBarComponent;
        };
        infoBar.InfoBar.prototype.__class__ = infoBar.InfoBar;
        infoBar.InfoBarController = function(infoBar) {
            this.flag_addedToStage = false;
            this.infoBar = infoBar;
        };
        infoBar.InfoBarController.__name__ = ["infoBar", "InfoBarController"];
        infoBar.InfoBarController.prototype.infoBar = null;
        infoBar.InfoBarController.prototype.flag_addedToStage = null;
        infoBar.InfoBarController.prototype.updateLayout = function(layoutPayload) {
            var $it0 = layoutPayload.containers.keys();
            while ($it0.hasNext()) {
                var layerId = $it0.next();
                var layerPayload = layoutPayload.containers.get(layerId);
                var cfg = layerPayload.configuration;
                var stage;
                var this1 = infoBar.ExternalService.displayProvider.getStages();
                stage = this1.get(layerPayload.stage);
                var container = this.infoBar.view.getComponentById(layerId);
                var containerDO = container.getDisplayObject();
                containerDO.setCacheAsBitmap(false);
                if (!this.flag_addedToStage) stage.addChild(containerDO);
                containerDO.setX(layerPayload.left);
                containerDO.setY(layerPayload.top);
                containerDO.setScaleX(layerPayload.width / containerDO.getUserData().viewBuilderW);
                containerDO.setScaleY(layerPayload.height / containerDO.getUserData().viewBuilderH);
                containerDO.setZIndex(layerPayload.zIndex);
                if (cfg == null) continue;
                this.infoBar.getInfoBarComponent().configure(cfg);
            }
            if (!this.flag_addedToStage) {
                this.flag_addedToStage = true;
                null;
            }
        };
        infoBar.InfoBarController.prototype.init = function() {
            this.infoBar.port.showLabel().subscribe($bind(this, this.onShowLabel));
            this.infoBar.port.hideLabel().subscribe($bind(this, this.onHideLabel));
            this.infoBar.port.showWinLineSummary().subscribe($bind(this, this.onShowWinLineSummary));
            this.infoBar.port.hideWinLineSummary().subscribe($bind(this, this.onHideWinLineSummary));
        };
        infoBar.InfoBarController.prototype.test1 = function() {
            var _g = this;
            _hcmn_.haxe_Timer.delay(function() {
                _g.infoBar.getInfoBarComponent().showLabel(infoBarApi.InfoBarLabelEnum.CENTRAL, "TEST 1 !");
            }, 4000);
            _hcmn_.haxe_Timer.delay(function() {
                _g.infoBar.getInfoBarComponent().showLabel(infoBarApi.InfoBarLabelEnum.LEFT, "TEST 1 !");
            }, 8000);
            _hcmn_.haxe_Timer.delay(function() {
                _g.infoBar.getInfoBarComponent().showLabel(infoBarApi.InfoBarLabelEnum.RIGHT, "TEST 2 !");
            }, 12000);
            _hcmn_.haxe_Timer.delay(function() {
                _g.infoBar.getInfoBarComponent().hideLabel(infoBarApi.InfoBarLabelEnum.LEFT);
            }, 16000);
            _hcmn_.haxe_Timer.delay(function() {
                _g.infoBar.getInfoBarComponent().hideLabel(infoBarApi.InfoBarLabelEnum.RIGHT);
            }, 18000);
        };
        infoBar.InfoBarController.prototype.test2 = function() {
            var _g = this;
            _hcmn_.haxe_Timer.delay(function() {
                _g.infoBar.getInfoBarComponent().showWinSummary(new infoBarApi.WinLineSummaryPayload(["8", "8", "9", "10", "-"], "1", "40.00$"));
            }, 5000);
            _hcmn_.haxe_Timer.delay(function() {
                _g.infoBar.getInfoBarComponent().showWinSummary(new infoBarApi.WinLineSummaryPayload(["8", "8", "9", "10", "-"], "2", "45.00$"));
            }, 8000);
            _hcmn_.haxe_Timer.delay(function() {
                _g.infoBar.getInfoBarComponent().showWinSummary(new infoBarApi.WinLineSummaryPayload(["8", "12", "9", "10", "-"], "3", "47.90$"));
            }, 10000);
            _hcmn_.haxe_Timer.delay(function() {
                _g.infoBar.getInfoBarComponent().showWinSummary(new infoBarApi.WinLineSummaryPayload(["28", "15", "9", "10", "-"], "4", "33.99$"));
            }, 11500);
            _hcmn_.haxe_Timer.delay(function() {
                _g.infoBar.getInfoBarComponent().showWinSummary(new infoBarApi.WinLineSummaryPayload(["18", "1", "9", "10", "-"], "5", "40000.00$"));
            }, 14000);
            _hcmn_.haxe_Timer.delay(function() {
                _g.infoBar.getInfoBarComponent().showWinSummary(new infoBarApi.WinLineSummaryPayload(["15", "8", "9", "10", "-"], "6", "4033.15$"));
            }, 15500);
            _hcmn_.haxe_Timer.delay(function() {
                _g.infoBar.getInfoBarComponent().hideWinSummary();
            }, 10000);
        };
        infoBar.InfoBarController.prototype.onHideWinLineSummary = function(e) {
            this.infoBar.getInfoBarComponent().hideWinSummary();
        };
        infoBar.InfoBarController.prototype.onShowWinLineSummary = function(e) {
            var payload = e.getPayload();
            this.infoBar.getInfoBarComponent().showWinSummary(payload);
        };
        infoBar.InfoBarController.prototype.onShowLabel = function(e) {
            var payload = e.getPayload();
            this.infoBar.getInfoBarComponent().showLabel(payload.labelId, payload.labelText);
        };
        infoBar.InfoBarController.prototype.onHideLabel = function(e) {
            this.infoBar.getInfoBarComponent().hideLabel(e.getPayload());
        };
        infoBar.InfoBarController.prototype.__class__ = infoBar.InfoBarController;
        infoBar.InfoBarDefinition = function() {};
        infoBar.InfoBarDefinition.__name__ = ["infoBar", "InfoBarDefinition"];
        infoBar.InfoBarDefinition.SYMBOLS_MAP = null;
        infoBar.InfoBarDefinition.HIDDEN_PROPERTIES = null;
        infoBar.InfoBarDefinition.SHOWN_PROPERTIES = null;
        infoBar.InfoBarDefinition.initialize = function(loadedDefinitionConfig) {
            infoBar.InfoBarDefinition.SYMBOLS_MAP = new _hcmn_.haxe_ds_StringMap();
            var _g = 0;
            var _g1 = _hcmn_.Reflect.fields(loadedDefinitionConfig.symbolmapping);
            while (_g < _g1.length) {
                var symbolKey = _g1[_g];
                ++_g;
                var value = _hcmn_.Reflect.field(loadedDefinitionConfig.symbolmapping, symbolKey);
                infoBar.InfoBarDefinition.SYMBOLS_MAP.set(symbolKey, value);
            }
            if (loadedDefinitionConfig.secondarypanel.hidden_properties != null) infoBar.InfoBarDefinition.HIDDEN_PROPERTIES = loadedDefinitionConfig.secondarypanel.hidden_properties;
            if (loadedDefinitionConfig.secondarypanel.shown_properties != null) infoBar.InfoBarDefinition.SHOWN_PROPERTIES = loadedDefinitionConfig.secondarypanel.shown_properties;
            if (loadedDefinitionConfig.secondarypanel.animation_time != null) infoBar.InfoBarDefinition.ANIMATION_TIME = loadedDefinitionConfig.secondarypanel.animation_time;
            if (loadedDefinitionConfig.secondarypanel.autohide != null) infoBar.InfoBarDefinition.AUTOHIDE = loadedDefinitionConfig.secondarypanel.autohide;
            if (loadedDefinitionConfig.secondarypanel.row_placement != null) infoBar.InfoBarDefinition.ROW_PLACEMENT = loadedDefinitionConfig.secondarypanel.row_placement;
            var easeMethod = (_hcmn_.js_Boot.__cast(loadedDefinitionConfig.secondarypanel.easing, String)).split(".")[1];
            infoBar.InfoBarDefinition.EASE = _hcmn_.Reflect.field(displayEngineUtils.EaseX, easeMethod);
            if (infoBar.InfoBarDefinition.EASE == null) infoBar.InfoBarDefinition.EASE = displayEngineUtils.EaseX.linear;
            if (infoBar.InfoBarDefinition.ANIMATION_TIME == null) infoBar.InfoBarDefinition.ANIMATION_TIME = 500;
            null;
        };
        infoBar.InfoBarDefinition.prototype.__class__ = infoBar.InfoBarDefinition;
        infoBar.InfoBarFactory = function(context) {
            this.context = context;
        };
        infoBar.InfoBarFactory = ck_implements(infoBar.InfoBarFactory, clientkernelModulesApi.IService);
        infoBar.InfoBarFactory = ck_implements(infoBar.InfoBarFactory, componentmodelComponentApi.IComponentFactory);
        infoBar.InfoBarFactory.__interfaces__ = [clientkernelModulesApi.IService, componentmodelComponentApi.IComponentFactory];
        infoBar.InfoBarFactory.__name__ = ["infoBar", "InfoBarFactory"];
        infoBar.InfoBarFactory.prototype.vbf = null;
        infoBar.InfoBarFactory.prototype.context = null;
        infoBar.InfoBarFactory.prototype.getComponentDeclaration = function() {
            return infoBarApi.InfoBarDeclaration;
        };
        infoBar.InfoBarFactory.prototype.createComponent = function(context) {
            new infoBar.InfoBar(context);
        };
        infoBar.InfoBarFactory.prototype.__class__ = infoBar.InfoBarFactory;

        infoBar.IInfoBarComponent = function() {}
        infoBar.IInfoBarComponent.prototype = {

            showLabel: function(label, text) {
                return {
                    arguments: ["*", {
                        type: "*",
                        opt: true
                    }],
                    returns: "void"
                };
            },
            showWinSummary: function(wls) {
                return {
                    arguments: ["*"],
                    returns: "void"
                };
            },
            hideWinSummary: function() {
                return {
                    arguments: [],
                    returns: "void"
                };
            },
            hideLabel: function(label) {
                return {
                    arguments: ["*"],
                    returns: "void"
                };
            },
            configure: function(cfg) {
                return {
                    arguments: ["*"],
                    returns: "void"
                };
            }
        };
        infoBar.InfoBarComponent = function(container) {
            this.lineHeight = 0;
            this.sideLabelsContainerShown = false;
            this.container = container;
            this.sideLabelsContainer = container.getComponentById("secundaryPanel");
            this.wlSummary = this.sideLabelsContainer.getComponentById("winSummary");
            this.wlSummaryContent = this.wlSummary.getComponentById("content");
            this.wlSummaryContent.setX(0);
            this.wlSummaryContent.setY(0);
            this.wlSummaryIdContainer = _hcmn_.js_Boot.__cast(this.wlSummary.getComponentById("wlId"), viewBuilderApi.IViewBuilderContainer);
            this.wlSummaryIdLabel = this.wlSummaryIdContainer.getComponentById("wlSummaryLabelID");
            this.wlSummaryIdLabel.setText("");
            this.wlSummaryIdLabel.forceRenderText();
            this.wlSummaryIdLabel.updateTo(null, "wlSummaryLabelID");
            this.wlSummarySumContainer = _hcmn_.js_Boot.__cast(this.wlSummary.getComponentById("wlSum"), viewBuilderApi.IViewBuilderContainer);
            this.wlSummarySumLabel = this.wlSummarySumContainer.getComponentById("wlSummaryLabelSum");
            this.wlSummarySumLabel.setText("");
            this.wlSummarySumLabel.forceRenderText();
            this.wlSummarySumLabel.updateTo(null, "wlSummaryLabelSum");
            this.centralBkg = this.container.getComponentById("bkg");
            this.secondaryPanelBkg = this.sideLabelsContainer.getComponentById("bkg");
            this.labels = new haxe.ds.EnumValueMap();
            var value = this.container.getComponentById("SpinInfoLabel");
            this.labels.set(infoBarApi.InfoBarLabelEnum.CENTRAL, value);
            var value1 = this.sideLabelsContainer.getComponentById("InfoTextLeft");
            this.labels.set(infoBarApi.InfoBarLabelEnum.LEFT, value1);
            var value2 = this.sideLabelsContainer.getComponentById("InfoTextRight");
            this.labels.set(infoBarApi.InfoBarLabelEnum.RIGHT, value2);
            this.originalLineHeight = this.labels.get(infoBarApi.InfoBarLabelEnum.CENTRAL).getStyle().getHeight();
            this.lineHeight = this.originalLineHeight;
            this.winSummaryYPadding = _hcmn_.Math.ceil((this.lineHeight - this.labels.get(infoBarApi.InfoBarLabelEnum.CENTRAL).getStyle().getFontSize()) / 4);
            this.secondaryPanelShownPosProps = infoBar.InfoBarDefinition.SHOWN_PROPERTIES;
            this.secondaryPanelHiddenPosProps = infoBar.InfoBarDefinition.HIDDEN_PROPERTIES;
            var $it0 = this.labels.iterator();
            while ($it0.hasNext()) {
                var l = $it0.next();
                l.hide();
            }
            this.wlSummary.hide();
            this.configure({
                lineHeight: this.lineHeight
            });
            this.hideSideLabelsContainer();
        };
        infoBar.InfoBarComponent = ck_implements(infoBar.InfoBarComponent, infoBar.IInfoBarComponent);
        infoBar.InfoBarComponent.__interfaces__ = [infoBar.IInfoBarComponent];
        infoBar.InfoBarComponent.__name__ = ["infoBar", "InfoBarComponent"];
        infoBar.InfoBarComponent.prototype.container = null;
        infoBar.InfoBarComponent.prototype.sideLabelsContainer = null;
        infoBar.InfoBarComponent.prototype.sideLabelsContainerShown = null;
        infoBar.InfoBarComponent.prototype.labels = null;
        infoBar.InfoBarComponent.prototype.centralBkg = null;
        infoBar.InfoBarComponent.prototype.secondaryPanelBkg = null;
        infoBar.InfoBarComponent.prototype.wlSummary = null;
        infoBar.InfoBarComponent.prototype.wlSummaryContent = null;
        infoBar.InfoBarComponent.prototype.wlSummaryIdContainer = null;
        infoBar.InfoBarComponent.prototype.wlSummaryIdLabel = null;
        infoBar.InfoBarComponent.prototype.wlSummarySumContainer = null;
        infoBar.InfoBarComponent.prototype.wlSummarySumLabel = null;
        infoBar.InfoBarComponent.prototype.lineHeight = null;
        infoBar.InfoBarComponent.prototype.originalLineHeight = null;
        infoBar.InfoBarComponent.prototype.secondaryPanelHiddenPosProps = null;
        infoBar.InfoBarComponent.prototype.secondaryPanelShownPosProps = null;
        infoBar.InfoBarComponent.prototype.winSummaryYPadding = null;
        infoBar.InfoBarComponent.prototype.currentWinLineSummaryPayload = null;
        infoBar.InfoBarComponent.prototype.showLabel = function(labelID, text) {
            if (text == null) text = "";
            this.labels.get(labelID).setText(text);
            this.labels.get(labelID).show();
            if (labelID == infoBarApi.InfoBarLabelEnum.LEFT) this.hideWinSummary();
            if (labelID != infoBarApi.InfoBarLabelEnum.CENTRAL) this.checkSideLabelsContainerVisibility();
        };
        infoBar.InfoBarComponent.prototype.hideLabel = function(labelID) {
            this.labels.get(labelID).hide();
            if (labelID != infoBarApi.InfoBarLabelEnum.CENTRAL) this.checkSideLabelsContainerVisibility();
        };
        infoBar.InfoBarComponent.prototype.showWinSummary = function(wls) {
            this.disposeWinSummary();
            this.hideLabel(infoBarApi.InfoBarLabelEnum.LEFT);
            this.currentWinLineSummaryPayload = wls;
            this.wlSummary.getDisplayObject().setVisible(true);
            var count = 0;
            var xOffset = _hcmn_.Math.floor(this.wlSummaryIdLabel.getDisplayObject().getX() + this.wlSummaryIdLabel.getStyle().getWidth() + this.winSummaryYPadding);
            if (wls != null) {
                var _g = 0;
                var _g1 = wls.line;
                while (_g < _g1.length) {
                    var numId = _g1[_g];
                    ++_g;
                    var bmpHolder = this.wlSummary.createContainerFromStoredConfig(infoBar.InfoBarDefinition.SYMBOLS_MAP.get(numId));
                    this.wlSummaryContent.addChildComponent(bmpHolder, "winSummary_" + count);
                    bmpHolder.getDisplayObject().setHeight(this.lineHeight - 2 * this.winSummaryYPadding);
                    bmpHolder.getDisplayObject().setScaleX(bmpHolder.getDisplayObject().getScaleY());
                    bmpHolder.setX(xOffset);
                    xOffset += _hcmn_.Math.round(bmpHolder.getDisplayObject().getWidth() + this.winSummaryYPadding / 2);
                    count++;
                }
            }
            this.wlSummaryContent.getDisplayObject().setY(this.winSummaryYPadding);
            this.wlSummaryIdLabel.setText("" + " " + wls.winId + " :");
            this.wlSummarySumLabel.setText("" + "= " + " " + wls.winSum);
            this.wlSummaryIdContainer.getDisplayObject().setX(this.winSummaryYPadding);
            this.wlSummarySumContainer.getDisplayObject().setX(xOffset + this.winSummaryYPadding);
            this.checkSideLabelsContainerVisibility();
        };
        infoBar.InfoBarComponent.prototype.hideWinSummary = function() {
            this.wlSummary.getDisplayObject().setVisible(false);
            this.disposeWinSummary();
            this.currentWinLineSummaryPayload = null;
            this.checkSideLabelsContainerVisibility();
        };
        infoBar.InfoBarComponent.prototype.disposeWinSummary = function() {
            var $it0 = (function($this) {
                var $r;
                var this1 = $this.wlSummaryContent.getChildComponents();
                $r = this1.keys();
                return $r;
            }(this));
            while ($it0.hasNext()) {
                var child = $it0.next();
                this.wlSummaryContent.disposeChildComponent(child);
            }
        };
        infoBar.InfoBarComponent.prototype.checkSideLabelsContainerVisibility = function() {
            if (!this.labels.get(infoBarApi.InfoBarLabelEnum.LEFT).getDisplayObject().getVisible() && !this.labels.get(infoBarApi.InfoBarLabelEnum.RIGHT).getDisplayObject().getVisible() && !this.wlSummary.getDisplayObject().getVisible()) {
                if (this.sideLabelsContainerShown) this.hideSideLabelsContainer();
            } else if (!this.sideLabelsContainerShown) this.showSideLabelsContainer();
        };
        infoBar.InfoBarComponent.prototype.hideSideLabelsContainer = function(immediate) {
            if (immediate == null) immediate = false;
            this.sideLabelsContainerShown = false;
            if (immediate) {
                displayEngineUtils.TweenX.to(this.sideLabelsContainer.getDisplayObject(), this.secondaryPanelHiddenPosProps, 0, null, null, null, null, null, null, null, {
                    fileName: "InfoBarComponent.hx",
                    lineNumber: 210,
                    className: "infobar.component.components.InfoBarComponent",
                    methodName: "hideSideLabelsContainer"
                });
                return;
            }
            displayEngineUtils.TweenX.to(this.sideLabelsContainer.getDisplayObject(), this.secondaryPanelHiddenPosProps, infoBar.InfoBarDefinition.ANIMATION_TIME, null, null, null, null, null, null, null, {
                fileName: "InfoBarComponent.hx",
                lineNumber: 216,
                className: "infobar.component.components.InfoBarComponent",
                methodName: "hideSideLabelsContainer"
            }).ease(infoBar.InfoBarDefinition.EASE);
        };
        infoBar.InfoBarComponent.prototype.showSideLabelsContainer = function(immediate) {
            if (immediate == null) immediate = false;
            this.sideLabelsContainerShown = true;
            if (immediate) {
                displayEngineUtils.TweenX.to(this.sideLabelsContainer.getDisplayObject(), this.secondaryPanelShownPosProps, 0, null, null, null, null, null, null, null, {
                    fileName: "InfoBarComponent.hx",
                    lineNumber: 227,
                    className: "infobar.component.components.InfoBarComponent",
                    methodName: "showSideLabelsContainer"
                });
                return;
            }
            displayEngineUtils.TweenX.to(this.sideLabelsContainer.getDisplayObject(), this.secondaryPanelShownPosProps, infoBar.InfoBarDefinition.ANIMATION_TIME, null, null, null, null, null, null, null, {
                fileName: "InfoBarComponent.hx",
                lineNumber: 231,
                className: "infobar.component.components.InfoBarComponent",
                methodName: "showSideLabelsContainer"
            }).ease(infoBar.InfoBarDefinition.EASE);
        };
        infoBar.InfoBarComponent.prototype.configure = function(cfg) {
            if (cfg.lineHeight == null) this.lineHeight = this.originalLineHeight;
            var newLineHeight = _hcmn_.Std.parseFloat(cfg.lineHeight);
            var scale = newLineHeight / this.lineHeight;
            this.lineHeight = cfg.lineHeight;
            var centralLabelPosition = this.originalLineHeight + (this.originalLineHeight - this.lineHeight);
            this.centralBkg.getDisplayObject().setY(centralLabelPosition);
            this.labels.get(infoBarApi.InfoBarLabelEnum.CENTRAL).getDisplayObject().setY(centralLabelPosition);
            if (infoBar.InfoBarDefinition.AUTOHIDE) {
                this.secondaryPanelHiddenPosProps.y = centralLabelPosition;
                if (infoBar.InfoBarDefinition.ROW_PLACEMENT >= 2) {
                    this.secondaryPanelShownPosProps.y = this.secondaryPanelHiddenPosProps.y - this.lineHeight;
                    this.centralBkg.getDisplayObject().setVisible(true);
                } else {
                    this.secondaryPanelShownPosProps.y = this.secondaryPanelHiddenPosProps.y;
                    this.centralBkg.getDisplayObject().setVisible(false);
                }
            } else if (infoBar.InfoBarDefinition.ROW_PLACEMENT >= 2) {
                this.secondaryPanelHiddenPosProps.y = this.secondaryPanelShownPosProps.y = centralLabelPosition - this.lineHeight;
                this.centralBkg.getDisplayObject().setVisible(true);
            } else {
                this.secondaryPanelHiddenPosProps.y = centralLabelPosition;
                this.secondaryPanelShownPosProps.y = this.secondaryPanelHiddenPosProps.y;
                this.centralBkg.getDisplayObject().setVisible(false);
            }
            var fontSizeCentral = _hcmn_.Math.round(this.labels.get(infoBarApi.InfoBarLabelEnum.CENTRAL).getStyle().getFontSize() * scale);
            var fontSizeLeft = _hcmn_.Math.round(this.labels.get(infoBarApi.InfoBarLabelEnum.LEFT).getStyle().getFontSize() * scale);
            var fontSizeRight = _hcmn_.Math.round(this.labels.get(infoBarApi.InfoBarLabelEnum.RIGHT).getStyle().getFontSize() * scale);
            var $it0 = this.labels.iterator();
            while ($it0.hasNext()) {
                var l = $it0.next();
                var styleLS = l.getStyle();
                styleLS.setForceSingleLine(true);
                styleLS.setHeight(this.lineHeight);
                styleLS.setFontSize(fontSizeCentral);
                l.updateTo(null, styleLS);
            }
            var wlSummaryIdLabelStyle = this.wlSummaryIdLabel.getStyle();
            wlSummaryIdLabelStyle.setForceSingleLine(true);
            wlSummaryIdLabelStyle.setHeight(this.lineHeight);
            wlSummaryIdLabelStyle.setWidth(this.wlSummaryIdLabel.getStyle().getWidth() * scale);
            wlSummaryIdLabelStyle.setFontSize(_hcmn_.Math.round(this.wlSummaryIdLabel.getStyle().getFontSize() * scale));
            this.wlSummaryIdLabel.updateTo(null, wlSummaryIdLabelStyle);
            var wlSummarySumLabelStyle = this.wlSummarySumLabel.getStyle();
            wlSummarySumLabelStyle.setForceSingleLine(true);
            wlSummarySumLabelStyle.setHeight(this.lineHeight);
            wlSummarySumLabelStyle.setWidth(this.wlSummarySumLabel.getStyle().getWidth() * scale);
            wlSummarySumLabelStyle.setFontSize(_hcmn_.Math.round(this.wlSummarySumLabel.getStyle().getFontSize() * scale));
            this.wlSummarySumLabel.updateTo(null, wlSummarySumLabelStyle);
            if (this.currentWinLineSummaryPayload != null) this.showWinSummary(this.currentWinLineSummaryPayload);
            if (this.sideLabelsContainerShown) this.showSideLabelsContainer(true);
            else this.hideSideLabelsContainer(true);
        };
        infoBar.InfoBarComponent.prototype.__class__ = infoBar.InfoBarComponent;
        if (typeof js == 'undefined') {
            var js = {};
        };
        if (!js._Boot) {
            js._Boot = {};
        };
        js._Boot.HaxeError = function(val) {
            Error.call(this);
            this.val = val;
            this.message = String(val);
            if (Error.captureStackTrace) Error.captureStackTrace(this, js._Boot.HaxeError);
        };
        js._Boot.HaxeError.__name__ = ["js", "_Boot", "HaxeError"];
        js._Boot.HaxeError.__super__ = Error;
        for (var k in Error.prototype) js._Boot.HaxeError.prototype[k] = Error.prototype[k];
        js._Boot.HaxeError.prototype.val = null;
        js._Boot.HaxeError.prototype.__class__ = js._Boot.HaxeError;
        infoBar.InfoBarDefinition.WINID_PREFIX = " ";;
        infoBar.InfoBarDefinition.WINID_SUFIX = " :";;
        infoBar.InfoBarDefinition.WINSUM_PREFIX = "= ";;
        infoBar.InfoBarDefinition.ANIMATION_TIME = 500;;
        infoBar.InfoBarDefinition.EASE = displayEngineUtils.EaseX.cubicInOut;;
        infoBar.InfoBarDefinition.AUTOHIDE = true;;
        infoBar.InfoBarDefinition.ROW_PLACEMENT = 2;;
        return {
            exports: infoBar,
            activator: infoBar.Activator
        };
    });
//# sourceURL=slotInfoBar.js