define("ballooniesComponentsWinlines", ["viewBuilderApi", "componentmodelComponentApi", "clientkernelLoaderApi", "slotModelApi", "displayEngineApi", "ballooniesIxfWinlinesDeclaration", "ballooniesIxfComponentsWinlinesPort", "clientkernelTestableApi", "gameLayoutApi", "BABYLON", "ballooniesIxfTumbleReelsApi", "clientkernelEventbusApi", "clientkernelModulesApi"],
    function(viewBuilderApi, componentmodelComponentApi, clientkernelLoaderApi, slotModelApi, displayEngineApi, ballooniesIxfWinlinesDeclaration, ballooniesIxfComponentsWinlinesPort, clientkernelTestableApi, gameLayoutApi, BABYLON, ballooniesIxfTumbleReelsApi, clientkernelEventbusApi, 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, '');
        };
        var Type = function() {};
        Type.__name__ = ["Type"];
        Type.createInstance = function(cl, args) {
            var _g = args.length;
            switch (_g) {
                case 0:
                    return new cl();
                case 1:
                    return new cl(args[0]);
                case 2:
                    return new cl(args[0], args[1]);
                case 3:
                    return new cl(args[0], args[1], args[2]);
                case 4:
                    return new cl(args[0], args[1], args[2], args[3]);
                case 5:
                    return new cl(args[0], args[1], args[2], args[3], args[4]);
                case 6:
                    return new cl(args[0], args[1], args[2], args[3], args[4], args[5]);
                case 7:
                    return new cl(args[0], args[1], args[2], args[3], args[4], args[5], args[6]);
                case 8:
                    return new cl(args[0], args[1], args[2], args[3], args[4], args[5], args[6], args[7]);
                default:
                    throw new js._Boot.HaxeError("Too many arguments");
            }
            return null;
        };
        Type.createEnum = function(e, constr, params) {
            var f = _hcmn_.Reflect.field(e, constr);
            if (f == null) throw new js._Boot.HaxeError("No such constructor " + constr);
            if (_hcmn_.Reflect.isFunction(f)) {
                if (params == null) throw new js._Boot.HaxeError("Constructor " + constr + " need parameters");
                return _hcmn_.Reflect.callMethod(e, f, params);
            }
            if (params != null && params.length != 0) throw new js._Boot.HaxeError("Constructor " + constr + " does not need parameters");
            return f;
        };
        Type.getEnumConstructs = function(e) {
            var a = e.__constructs__;
            return a.slice();
        };
        Type.prototype.__class__ = Type;
        if (typeof ballooniesComponentsWinlines == 'undefined') {
            var ballooniesComponentsWinlines = {};
        };
        ballooniesComponentsWinlines.Activator = function(context) {};
        ballooniesComponentsWinlines.Activator = ck_implements(ballooniesComponentsWinlines.Activator, clientkernelModulesApi.IModuleActivator);
        ballooniesComponentsWinlines.Activator.__interfaces__ = [clientkernelModulesApi.IModuleActivator];
        ballooniesComponentsWinlines.Activator.__name__ = ["ballooniesComponentsWinlines", "Activator"];
        ballooniesComponentsWinlines.Activator.prototype.start = function(context) {
            context.getServiceTracker([displayEngineApi.IDisplayProvider, clientkernelTestableApi.ITestable, viewBuilderApi.IViewBuilderFactory]).then(function(context1) {
                ballooniesComponentsWinlines.ExternalService.initialize(context1);
                var factory = context1.getAnyService(viewBuilderApi.IViewBuilderFactory, null);
                ballooniesComponentsWinlines.ExternalService.viewBuilderFactory = factory;
                context1.registerService(new ballooniesComponentsWinlines.WinLinesFactory(factory), ballooniesIxfWinlinesDeclaration.WinLinesDeclaration, null);
            });
        };
        ballooniesComponentsWinlines.Activator.prototype.stop = function(context) {};
        ballooniesComponentsWinlines.Activator.main = function() {};
        ballooniesComponentsWinlines.Activator.prototype.__class__ = ballooniesComponentsWinlines.Activator;
        ballooniesComponentsWinlines.Component = {
            __ename__: ["ballooniesComponentsWinlines", "Component"],
            __constructs__: ["WIN_SYMBOLS", "IDLE_SYMBOLS", "SHAKE_SYMBOLS", "WIN_FRAMES", "MULTIPLIER_SYMBOLS"]
        };
        ballooniesComponentsWinlines.Component.MULTIPLIER_SYMBOLS = ["MULTIPLIER_SYMBOLS", 4];
        ballooniesComponentsWinlines.Component.MULTIPLIER_SYMBOLS.toString = $estr;
        ballooniesComponentsWinlines.Component.MULTIPLIER_SYMBOLS.__enum__ = ballooniesComponentsWinlines.Component;
        ballooniesComponentsWinlines.Component.WIN_FRAMES = ["WIN_FRAMES", 3];
        ballooniesComponentsWinlines.Component.WIN_FRAMES.toString = $estr;
        ballooniesComponentsWinlines.Component.WIN_FRAMES.__enum__ = ballooniesComponentsWinlines.Component;
        ballooniesComponentsWinlines.Component.WIN_SYMBOLS = ["WIN_SYMBOLS", 0];
        ballooniesComponentsWinlines.Component.WIN_SYMBOLS.toString = $estr;
        ballooniesComponentsWinlines.Component.WIN_SYMBOLS.__enum__ = ballooniesComponentsWinlines.Component;
        ballooniesComponentsWinlines.Component.IDLE_SYMBOLS = ["IDLE_SYMBOLS", 1];
        ballooniesComponentsWinlines.Component.IDLE_SYMBOLS.toString = $estr;
        ballooniesComponentsWinlines.Component.IDLE_SYMBOLS.__enum__ = ballooniesComponentsWinlines.Component;
        ballooniesComponentsWinlines.Component.SHAKE_SYMBOLS = ["SHAKE_SYMBOLS", 2];
        ballooniesComponentsWinlines.Component.SHAKE_SYMBOLS.toString = $estr;
        ballooniesComponentsWinlines.Component.SHAKE_SYMBOLS.__enum__ = ballooniesComponentsWinlines.Component;
        ballooniesComponentsWinlines.ExternalService = function() {};
        ballooniesComponentsWinlines.ExternalService.__name__ = ["ballooniesComponentsWinlines", "ExternalService"];
        ballooniesComponentsWinlines.ExternalService.componentContext = null;
        ballooniesComponentsWinlines.ExternalService.displayProvider = null;
        ballooniesComponentsWinlines.ExternalService.assetRegistry = null;
        ballooniesComponentsWinlines.ExternalService.testableLogger = null;
        ballooniesComponentsWinlines.ExternalService.viewBuilderFactory = null;
        ballooniesComponentsWinlines.ExternalService.bus = null;
        ballooniesComponentsWinlines.ExternalService.loadedCallback = null;
        ballooniesComponentsWinlines.ExternalService.initialize = function(context) {
            ballooniesComponentsWinlines.ExternalService.displayProvider = context.getAnyService(displayEngineApi.IDisplayProvider, null);
            ballooniesComponentsWinlines.ExternalService.assetRegistry = context.getAnyService(clientkernelLoaderApi.IAssetRegistry, null);
            var testable = context.getAnyService(clientkernelTestableApi.ITestable, null);
            ballooniesComponentsWinlines.ExternalService.testableLogger = testable.getLogger(context);
            ballooniesComponentsWinlines.ExternalService.bus = context.getAnyService(clientkernelEventbusApi.IEventBus, null);
        };
        ballooniesComponentsWinlines.ExternalService.loadConfig = function(config_id, configCallback) {
            ballooniesComponentsWinlines.ExternalService.assetRegistry.getAsset(config_id).getContent().then(function(data) {
                configCallback(data);
            });
        };
        ballooniesComponentsWinlines.ExternalService.loadVBAssetsInGroup = function(groupId) {
            if (!ballooniesComponentsWinlines.ExternalService.loadedCallbacks.exists(groupId)) {
                var value = new balloonies.components.winlines.Loader(groupId, ballooniesComponentsWinlines.ExternalService.assetRegistry, ballooniesComponentsWinlines.ExternalService.loadedAssets);
                ballooniesComponentsWinlines.ExternalService.loadedCallbacks.set(groupId, value);
            }
            return ballooniesComponentsWinlines.ExternalService.loadedCallbacks.get(groupId);
        };
        ballooniesComponentsWinlines.ExternalService.ceheckLoaded = function(id) {
            ballooniesComponentsWinlines.ExternalService.totalLoaded++;
            if (ballooniesComponentsWinlines.ExternalService.totalLoaded == ballooniesComponentsWinlines.ExternalService.loading) ballooniesComponentsWinlines.ExternalService.loadedCallback();
        };
        ballooniesComponentsWinlines.ExternalService.setLoadedCallback = function(callback) {
            ballooniesComponentsWinlines.ExternalService.loadedCallback = callback;
        };
        ballooniesComponentsWinlines.ExternalService.prototype.__class__ = ballooniesComponentsWinlines.ExternalService;
        if (typeof balloonies == 'undefined') {
            var balloonies = {};
        };
        if (!balloonies.components) {
            balloonies.components = {};
        };
        if (!balloonies.components.winlines) {
            balloonies.components.winlines = {};
        };
        balloonies.components.winlines.Loader = function(groupId, assetRegistry, assetsList) {
            this.assetsToBeLoaded = [];
            this.expectedMaxTimeToLoadResources = 60000;
            this.errorThrowerTimerId = 0;
            this.maxNumberOfLoaders = 0;
            this.currentNumberOfLoaders = 0;
            this.assetIds = [];
            this.groupId = groupId;
            this.assetRegistry = assetRegistry;
            this.assetsList = assetsList;
        };
        balloonies.components.winlines.Loader.__name__ = ["balloonies", "components", "winlines", "Loader"];
        balloonies.components.winlines.Loader.prototype.groupId = null;
        balloonies.components.winlines.Loader.prototype.assetRegistry = null;
        balloonies.components.winlines.Loader.prototype.loadedCallback = null;
        balloonies.components.winlines.Loader.prototype.assetIds = null;
        balloonies.components.winlines.Loader.prototype.assetsList = null;
        balloonies.components.winlines.Loader.prototype.currentNumberOfLoaders = null;
        balloonies.components.winlines.Loader.prototype.maxNumberOfLoaders = null;
        balloonies.components.winlines.Loader.prototype.errorThrowerTimerId = null;
        balloonies.components.winlines.Loader.prototype.expectedMaxTimeToLoadResources = null;
        balloonies.components.winlines.Loader.prototype.assetsToBeLoaded = null;
        balloonies.components.winlines.Loader.prototype.loadVBAsset = function(id) {
            this.assetIds.push(id);
            return this;
        };
        balloonies.components.winlines.Loader.prototype.mapToLoadVBAsset = function(list, mapF) {
            var _g = 0;
            while (_g < list.length) {
                var item = list[_g];
                ++_g;
                this.loadVBAsset(mapF(item));
            }
            return this;
        };
        balloonies.components.winlines.Loader.prototype.setMaxTimeToLoad = function(value) {
            this.expectedMaxTimeToLoadResources = value;
            return this;
        };
        balloonies.components.winlines.Loader.prototype.load = function() {
            var _g2 = this;
            this.assetsToBeLoaded = this.assetIds.slice();
            var _g = 0;
            var _g1 = this.assetIds;
            while (_g < _g1.length) {
                var assetId = [_g1[_g]];
                ++_g;
                this.assetRegistry.getAsset(assetId[0]).getContent().then((function(assetId) {
                    return function(vba) {
                        _g2.assetsList.set(assetId[0], vba);
                        _g2.checkLoaded(assetId[0]);
                    };
                })(assetId));
            }
            this.maxNumberOfLoaders = this.assetIds.length;
            if (this.expectedMaxTimeToLoadResources > 0) this.errorThrowerTimerId = window.setTimeout($bind(this, this.throwTimedError), this.expectedMaxTimeToLoadResources);
            return this;
        };
        balloonies.components.winlines.Loader.prototype.throwTimedError = function() {
            var error = "Assets: [" + this.groupId + "] would not loaded during: " + this.expectedMaxTimeToLoadResources + " ms.\n";
            error += "Loaded: " + this.currentNumberOfLoaders + " from: " + this.maxNumberOfLoaders + "\n";
            error += "List of awaiting resourse: " + _hcmn_.Std.string(this.assetsToBeLoaded) + "\n";
            window.console.error(error);
        };
        balloonies.components.winlines.Loader.prototype.checkLoaded = function(id) {
            this.currentNumberOfLoaders++;
            _hcmn_.HxOverrides.remove(this.assetsToBeLoaded, id);
            if (this.maxNumberOfLoaders == this.currentNumberOfLoaders) {
                if (this.loadedCallback != null) {
                    window.clearTimeout(this.errorThrowerTimerId);
                    this.loadedCallback();
                }
            }
        };
        balloonies.components.winlines.Loader.prototype.handleOfComplete = function(loadedCallback) {
            this.loadedCallback = loadedCallback;
            return this;
        };
        balloonies.components.winlines.Loader.prototype.__class__ = balloonies.components.winlines.Loader;
        ballooniesComponentsWinlines.WinLines = function(context, factory) {
            this.initialized = false;
            this.assetsLoaded = false;
            this.vba = null;
            this.context = context;
            this.layoutPort = context.getUsedPort(gameLayoutApi.IGameLayoutPort);
            this.factory = factory;
            this.port = context.getImplementedPort(ballooniesIxfComponentsWinlinesPort.IWinLinesImplementationPort);
            this.baseEvents = new ballooniesComponentsWinlines.BaseEvents();
            this.components = new haxe.ds.EnumValueMap();
            this.layoutPort.getUpdateComponentLayout().subscribe($bind(this, this.updateLayout));
            this.controller = new ballooniesComponentsWinlines.WinLinesController(this);
            this.loadConfig();
        };
        ballooniesComponentsWinlines.WinLines.__name__ = ["ballooniesComponentsWinlines", "WinLines"];
        ballooniesComponentsWinlines.WinLines.prototype.winAnimationAssets = null;
        ballooniesComponentsWinlines.WinLines.prototype.layerContainers = null;
        ballooniesComponentsWinlines.WinLines.prototype.port = null;
        ballooniesComponentsWinlines.WinLines.prototype.view = null;
        ballooniesComponentsWinlines.WinLines.prototype.components = null;
        ballooniesComponentsWinlines.WinLines.prototype.factory = null;
        ballooniesComponentsWinlines.WinLines.prototype.controller = null;
        ballooniesComponentsWinlines.WinLines.prototype.vba = null;
        ballooniesComponentsWinlines.WinLines.prototype.assetsLoaded = null;
        ballooniesComponentsWinlines.WinLines.prototype.initialized = null;
        ballooniesComponentsWinlines.WinLines.prototype.context = null;
        ballooniesComponentsWinlines.WinLines.prototype.baseEvents = null;
        ballooniesComponentsWinlines.WinLines.prototype.layoutPayload = null;
        ballooniesComponentsWinlines.WinLines.prototype.layoutPort = null;
        ballooniesComponentsWinlines.WinLines.prototype.winLinesConfig = null;
        ballooniesComponentsWinlines.WinLines.prototype.loadConfig = function() {
            var _g = this;
            ballooniesComponentsWinlines.ExternalService.loadConfig("win_definitions_config", function(config) {
                _g.winLinesConfig = config;
                _g.loadWinLinesResources();
            });
        };
        ballooniesComponentsWinlines.WinLines.prototype.loadWinLinesResources = function() {
            ballooniesComponentsWinlines.ExternalService.loadVBAssetsInGroup("WinLinesResources").loadVBAsset("WIN_FRAME").mapToLoadVBAsset(this.winLinesConfig.symbols, function(symbol) {
                return "IDLE_" + symbol.value.name + "_VB";
            }).mapToLoadVBAsset(this.winLinesConfig.symbols, function(symbol1) {
                return "SHAKE_" + symbol1.value.name + "_VB";
            }).mapToLoadVBAsset(this.winLinesConfig.symbols, function(symbol2) {
                return "WIN_" + symbol2.value.name + "_VB";
            }).handleOfComplete($bind(this, this.onMainAssetsLoaded)).load();
        };
        ballooniesComponentsWinlines.WinLines.prototype.onMainAssetsLoaded = function() {
            var _g = this;
            ballooniesComponentsWinlines.ExternalService.assetRegistry.getAsset("animations").getContent().then(function(vba) {
                _g.vba = vba;
                _g.assetsLoaded = true;
                _g.initialize();
            });
        };
        ballooniesComponentsWinlines.WinLines.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());
            }
        };
        ballooniesComponentsWinlines.WinLines.prototype.initialize = function() {
            if (this.assetsLoaded && this.layoutPayload != null) {
                this.view = this.factory.createView(this.vba);
                this.registerAllComponents();
                this.controller.init(this.winLinesConfig);
                this.controller.updateLayout(this.layoutPayload);
                this.layoutPort.getComponentLayoutUpdated().publish(this.context.getInstance());
                this.initialized = true;
            }
        };
        ballooniesComponentsWinlines.WinLines.prototype.registerAllComponents = function() {
            this.layerContainers = this.view.getChildComponents();
            var $it0 = this.layerContainers.keys();
            while ($it0.hasNext()) {
                var layerId = $it0.next();
                var constructorIndex;
                var _this = Type.getEnumConstructs(ballooniesComponentsWinlines.Component);
                constructorIndex = _hcmn_.HxOverrides.indexOf(_this, layerId, 0);
                if (constructorIndex < 0) throw new js._Boot.HaxeError("WinLines::undefined component to register: [" + layerId + "]");
                var componentEnum = Type.createEnum(ballooniesComponentsWinlines.Component, layerId, null);
                this.registerComponent(componentEnum, layerId);
            }
        };
        ballooniesComponentsWinlines.WinLines.prototype.registerComponent = function(componentEnum, layerId) {
            switch (componentEnum[1]) {
                case 0:
                    this.registerContainerComponent(ballooniesComponentsWinlines.Component.WIN_SYMBOLS, layerId, ballooniesComponentsWinlines.WinSymbols);
                    break;
                case 4:
                    this.registerContainerComponent(ballooniesComponentsWinlines.Component.MULTIPLIER_SYMBOLS, layerId, ballooniesComponentsWinlines.MultiplierSymbols);
                    break;
                case 1:
                    this.registerContainerComponent(ballooniesComponentsWinlines.Component.IDLE_SYMBOLS, layerId, ballooniesComponentsWinlines.IdleSymbols);
                    break;
                case 2:
                    this.registerContainerComponent(ballooniesComponentsWinlines.Component.SHAKE_SYMBOLS, layerId, ballooniesComponentsWinlines.ShakeSymbols);
                    break;
                case 3:
                    this.registerContainerComponent(ballooniesComponentsWinlines.Component.WIN_FRAMES, layerId, ballooniesComponentsWinlines.WinFrames);
                    break;
            }
        };
        ballooniesComponentsWinlines.WinLines.prototype.registerContainerComponent = function(component, layerId, componentClass) {
            var container = this.view.getComponentById(component[0]);
            if (container == null) throw new js._Boot.HaxeError("WinLines::undefined component to register: [" + layerId + "]");
            if (componentClass != null) {
                var specificComponent = Type.createInstance(componentClass, [container, this.baseEvents, this.winLinesConfig]);
                this.components.set(component, specificComponent);
            } else this.components.set(component, container);
        };
        ballooniesComponentsWinlines.WinLines.prototype.setVisible = function(visible) {
            this.view.getDisplayObject().setVisible(visible);
            this.getWinSymbols().setVisible(visible);
            this.getIdleSymbols().setVisible(visible);
            this.getMultiplierSymbols().setVisible(visible);
        };
        ballooniesComponentsWinlines.WinLines.prototype.getDisplayObject = function() {
            return this.view.getDisplayObject();
        };
        ballooniesComponentsWinlines.WinLines.prototype.getWinSymbols = function() {
            return this.components.get(ballooniesComponentsWinlines.Component.WIN_SYMBOLS);
        };
        ballooniesComponentsWinlines.WinLines.prototype.getWinsSymbols = function() {
            return this.components.get(ballooniesComponentsWinlines.Component.WIN_SYMBOLS);
        };
        ballooniesComponentsWinlines.WinLines.prototype.getMultiplierSymbols = function() {
            return this.components.get(ballooniesComponentsWinlines.Component.MULTIPLIER_SYMBOLS);
        };
        ballooniesComponentsWinlines.WinLines.prototype.getIdleSymbols = function() {
            return this.components.get(ballooniesComponentsWinlines.Component.IDLE_SYMBOLS);
        };
        ballooniesComponentsWinlines.WinLines.prototype.getShakeSymbols = function() {
            return this.components.get(ballooniesComponentsWinlines.Component.SHAKE_SYMBOLS);
        };
        ballooniesComponentsWinlines.WinLines.prototype.getShakesSymbols = function() {
            return this.components.get(ballooniesComponentsWinlines.Component.SHAKE_SYMBOLS);
        };
        ballooniesComponentsWinlines.WinLines.prototype.getWinFrames = function() {
            return this.components.get(ballooniesComponentsWinlines.Component.WIN_FRAMES);
        };
        ballooniesComponentsWinlines.WinLines.prototype.getContainerComponent = function(component) {
            return this.components.get(component);
        };
        ballooniesComponentsWinlines.WinLines.prototype.getBaseEvent = function(id) {
            return this.baseEvents.getEvent(id);
        };
        ballooniesComponentsWinlines.WinLines.prototype.__class__ = ballooniesComponentsWinlines.WinLines;
        ballooniesComponentsWinlines.WinLinesConfig = function() {};
        ballooniesComponentsWinlines.WinLinesConfig.__name__ = ["ballooniesComponentsWinlines", "WinLinesConfig"];
        ballooniesComponentsWinlines.WinLinesConfig.prototype.cellsNum = null;
        ballooniesComponentsWinlines.WinLinesConfig.prototype.reelsNum = null;
        ballooniesComponentsWinlines.WinLinesConfig.prototype.cellWidth = null;
        ballooniesComponentsWinlines.WinLinesConfig.prototype.cellHeight = null;
        ballooniesComponentsWinlines.WinLinesConfig.prototype.cellHorizontalSpacing = null;
        ballooniesComponentsWinlines.WinLinesConfig.prototype.cellVerticalSpacing = null;
        ballooniesComponentsWinlines.WinLinesConfig.prototype.lineTime = null;
        ballooniesComponentsWinlines.WinLinesConfig.prototype.idleTimeToAnimateNextSymbols = null;
        ballooniesComponentsWinlines.WinLinesConfig.prototype.fps = null;
        ballooniesComponentsWinlines.WinLinesConfig.prototype.symbols = null;
        ballooniesComponentsWinlines.WinLinesConfig.prototype.scatters = null;
        ballooniesComponentsWinlines.WinLinesConfig.prototype.__class__ = ballooniesComponentsWinlines.WinLinesConfig;
        ballooniesComponentsWinlines.WinLinesController = function(winLines) {
            this.isLowWin = false;
            this._i = 0;
            this.scatterPayout = "";
            this.multiplierCell = null;
            this.multipliersList = null;
            this.currentMultiplierIndex = 0;
            this.winLines = winLines;
        };
        ballooniesComponentsWinlines.WinLinesController.__name__ = ["ballooniesComponentsWinlines", "WinLinesController"];
        ballooniesComponentsWinlines.WinLinesController.prototype.winLines = null;
        ballooniesComponentsWinlines.WinLinesController.prototype.cellsNum = null;
        ballooniesComponentsWinlines.WinLinesController.prototype.reelsNum = null;
        ballooniesComponentsWinlines.WinLinesController.prototype.outcome = null;
        ballooniesComponentsWinlines.WinLinesController.prototype.config = null;
        ballooniesComponentsWinlines.WinLinesController.prototype.currentMultiplierIndex = null;
        ballooniesComponentsWinlines.WinLinesController.prototype.multipliersList = null;
        ballooniesComponentsWinlines.WinLinesController.prototype.multiplierCell = null;
        ballooniesComponentsWinlines.WinLinesController.prototype.scatterPayout = null;
        ballooniesComponentsWinlines.WinLinesController.prototype.winPayload = null;
        ballooniesComponentsWinlines.WinLinesController.prototype.multiplierData = null;
        ballooniesComponentsWinlines.WinLinesController.prototype.multiplierCellData = null;
        ballooniesComponentsWinlines.WinLinesController.prototype._i = null;
        ballooniesComponentsWinlines.WinLinesController.prototype.isLowWin = null;
        ballooniesComponentsWinlines.WinLinesController.prototype.init = function(config) {
            this.config = config;
            this.reelsNum = config.reelsNum;
            this.cellsNum = config.cellsNum;
            this.winLines.port.getShowOutcome().subscribe($bind(this, this.handleShowOutcome));
            this.winLines.port.getShowWinOutcome().subscribe($bind(this, this.handleShowWinOutcome));
            this.winLines.port.getHideOutcome().subscribe($bind(this, this.handleHideOutcome));
            this.winLines.port.setVisible().subscribe($bind(this, this.handleSetVisible));
            this.winLines.port.getMultiplierOutcome().subscribe($bind(this, this.onMultiplierOutcome));
            this.winLines.port.getStartIdleAnimation().subscribe($bind(this, this.onStartIdleAnimation));
            this.winLines.port.getStopIdleAnimation().subscribe($bind(this, this.onStopIdleAnimation));
            this.winLines.getBaseEvent(ballooniesComponentsWinlines.BaseEventsEnum.IDLE_SYMBOL_ANIMATION_START).add($bind(this, this.onIdlePlay));
            this.winLines.getBaseEvent(ballooniesComponentsWinlines.BaseEventsEnum.WIN_SYMBOL_ANIMATIONS_COMPLETE).add($bind(this, this.winLinesCycleEnded));
            this.winLines.getBaseEvent(ballooniesComponentsWinlines.BaseEventsEnum.MULTIPLIER_SPAWNED).add($bind(this, this.onMultiplierSpawned));
            ballooniesComponentsWinlines.ExternalService.bus.getChannel("GFBus").subscribe("MULTIPLIER_SHOWN", $bind(this, this.onMultiplierShown));
            ballooniesComponentsWinlines.ExternalService.bus.getChannel("GFBus").subscribe("RAINBOW_COMPLETED", $bind(this, this.onNextMultiplier));
        };
        ballooniesComponentsWinlines.WinLinesController.prototype.handleSetVisible = function(e) {
            this.winLines.setVisible(e.getPayload());
        };
        ballooniesComponentsWinlines.WinLinesController.prototype.onStartIdleAnimation = function(e) {
            this.winLines.getIdleSymbols().startAnimation(e.getPayload());
        };
        ballooniesComponentsWinlines.WinLinesController.prototype.onStopIdleAnimation = function(e) {
            this.winLines.getIdleSymbols().hide();
        };
        ballooniesComponentsWinlines.WinLinesController.prototype.updateLayout = function(layoutPayload) {
            var $it0 = this.winLines.layerContainers.keys();
            while ($it0.hasNext()) {
                var layerId = $it0.next();
                var layerPayload = layoutPayload.containers.get(layerId);
                if (layerPayload == null) continue;
                var stage;
                var this1 = ballooniesComponentsWinlines.ExternalService.displayProvider.getStages();
                stage = this1.get(layerPayload.stage);
                var container = this.winLines.layerContainers.get(layerId).getDisplayObject();
                stage.removeChild(container);
                stage.addChild(container);
                container.setX(layerPayload.left);
                container.setY(layerPayload.top);
                container.setScaleX(layerPayload.width / container.getUserData().viewBuilderW);
                container.setScaleY(layerPayload.height / container.getUserData().viewBuilderH);
                container.setZIndex(layerPayload.zIndex);
            }
            window.clearTimeout(this._i);
            this._i = window.setTimeout($bind(this, this.updateMultiplierPosition), 0);
        };
        ballooniesComponentsWinlines.WinLinesController.prototype.updateMultiplierPosition = function() {
            if (this.multiplierData != null && this.multiplierCellData != null) {
                var data = this.winLines.getMultiplierSymbols().getDataToPublishStarMultiplier(this.multiplierData, this.multiplierCellData);
                ballooniesComponentsWinlines.ExternalService.bus.getChannel("GFBus").publish("UPDATE_MULTIPLIER", data);
            }
        };
        ballooniesComponentsWinlines.WinLinesController.prototype.handleHideOutcome = function(e) {
            this.hideAll();
        };
        ballooniesComponentsWinlines.WinLinesController.prototype.handleShowWinOutcome = function(e) {
            this.outcome = e.getPayload();
            var allWinningSymbols;
            var _g = [];
            var _g2 = 0;
            var _g1 = this.reelsNum;
            while (_g2 < _g1) {
                var i = _g2++;
                _g.push((function($this) {
                    var $r;
                    var _g3 = []; {
                        var _g5 = 0;
                        var _g4 = $this.cellsNum;
                        while (_g5 < _g4) {
                            var j = _g5++;
                            _g3.push(false);
                        }
                    }
                    $r = _g3;
                    return $r;
                }(this)));
            }
            allWinningSymbols = _g;
            this.collectWinningSybols(allWinningSymbols, this.outcome.bonusWins);
            this.collectWinningSybols(allWinningSymbols, this.outcome.scatterWins);
            this.collectWinningSybols(allWinningSymbols, this.outcome.lineWins);
            this.handleWinSymbols(allWinningSymbols);
        };
        ballooniesComponentsWinlines.WinLinesController.prototype.onMultiplierOutcome = function(e) {
            this.currentMultiplierIndex = 0;
            this.outcome = e.getPayload();
            this.showMultipliersOnReels(this.outcome.scatterWins);
        };
        ballooniesComponentsWinlines.WinLinesController.prototype.handleShowOutcome = function(e) {
            this.outcome = e.getPayload().outcome;
            this.winPayload = e.getPayload();
            this.isLowWin = e.getPayload().isLowWin;
            this.winLines.getWinsSymbols().setLowWin(this.isLowWin);
            this.winLines.getShakesSymbols().setLowWin(this.isLowWin);
            var winList = [];
            this.collectWinLines(winList, this.outcome.lineWins);
            this.collectWinLines(winList, this.outcome.bonusWins);
            this.collectWinLines(winList, this.outcome.scatterWins);
            this.showAnimations(winList);
        };
        ballooniesComponentsWinlines.WinLinesController.prototype.showMultipliersOnReels = function(outcome) {
            this.multipliersList = this.collectMultiplierWinList(outcome);
            this.currentMultiplierIndex = 0;
            this.startMultiplierOnReels(this.multipliersList[this.currentMultiplierIndex]);
        };
        ballooniesComponentsWinlines.WinLinesController.prototype.startMultiplierOnReels = function(winList) {
            var mlt = this.outcome.customField.multipliers[this.currentMultiplierIndex];
            var winsymbols = this.getMatrixWithWinSymbol(winList, this.currentMultiplierIndex + 1);
            this.showWin(winList, winsymbols, 0, mlt, true);
        };
        ballooniesComponentsWinlines.WinLinesController.prototype.collectMultiplierWinList = function(outcome) {
            var result = [];
            var _g = 0;
            while (_g < outcome.length) {
                var win = outcome[_g];
                ++_g;
                var _g2 = 0;
                var _g1 = win.symbolCount;
                while (_g2 < _g1) {
                    var j = _g2++;
                    result.push(win);
                }
            }
            if (result.length > 0) return result;
            else return null;
        };
        ballooniesComponentsWinlines.WinLinesController.prototype.showAnimations = function(winList) {
            if (winList.length > 0) this.showWinLinesSet(winList, false);
        };
        ballooniesComponentsWinlines.WinLinesController.prototype.collectWinLines = function(winList, wins) {
            if (wins == null) wins = [];
            else wins = wins;
            var _g = 0;
            while (_g < wins.length) {
                var win = wins[_g];
                ++_g;
                winList.push(win);
            }
        };
        ballooniesComponentsWinlines.WinLinesController.prototype.collectWinningSybols = function(allWinningSymbols, wins) {
            if (wins == null) wins = [];
            else wins = wins;
            var _g = 0;
            while (_g < wins.length) {
                var win = wins[_g];
                ++_g;
                var _g2 = 0;
                var _g1 = this.reelsNum;
                while (_g2 < _g1) {
                    var i = _g2++;
                    var _g4 = 0;
                    var _g3 = this.cellsNum;
                    while (_g4 < _g3) {
                        var j = _g4++;
                        allWinningSymbols[i][j] = allWinningSymbols[i][j] || win.winPath.reelsInfo[i][j] == 1;
                    }
                }
            }
        };
        ballooniesComponentsWinlines.WinLinesController.prototype.showWinsymbols = function(winList, isMultiplier) {
            var i = 0;
            var _g = 0;
            while (_g < winList.length) {
                var win = winList[_g];
                ++_g;
                var winsymbols = this.getWinSymbols(win);
                this.showWin(win, winsymbols, this.config.lineTime * i, 0, isMultiplier);
                i++;
            }
            return i;
        };
        ballooniesComponentsWinlines.WinLinesController.prototype.showWinLinesSet = function(winList, isMultiplier) {
            var _g = this;
            var i = this.showWinsymbols(winList, isMultiplier);
            ballooniesComponentsWinlines.TimeoutInvoker.setTimeout("handleWinSymbols", function() {
                _g.winLines.port.getExplosionReadyToSpawn().publish(null);
            }, this.config.lineTime * i);
        };
        ballooniesComponentsWinlines.WinLinesController.prototype.getWinSymbols = function(win) {
            var reelsInfo = win.winPath.reelsInfo;
            var _g = [];
            var _g2 = 0;
            var _g1 = this.reelsNum;
            while (_g2 < _g1) {
                var i = _g2++;
                _g.push((function($this) {
                    var $r;
                    var _g3 = []; {
                        var _g5 = 0;
                        var _g4 = $this.cellsNum;
                        while (_g5 < _g4) {
                            var j = _g5++;
                            _g3.push(reelsInfo[i][j] == 1);
                        }
                    }
                    $r = _g3;
                    return $r;
                }(this)));
            }
            return _g;
        };
        ballooniesComponentsWinlines.WinLinesController.prototype.getMatrixWithWinSymbol = function(win, index) {
            var winsymbols;
            var _g = [];
            var _g2 = 0;
            var _g1 = this.reelsNum;
            while (_g2 < _g1) {
                var i = _g2++;
                _g.push((function($this) {
                    var $r;
                    var _g3 = []; {
                        var _g5 = 0;
                        var _g4 = $this.cellsNum;
                        while (_g5 < _g4) {
                            var j = _g5++;
                            _g3.push(false);
                        }
                    }
                    $r = _g3;
                    return $r;
                }(this)));
            }
            winsymbols = _g;
            var _g21 = 0;
            var _g11 = this.reelsNum;
            while (_g21 < _g11) {
                var i1 = _g21++;
                var _g41 = 0;
                var _g31 = this.cellsNum;
                while (_g41 < _g31) {
                    var j1 = _g41++;
                    if (win.winPath.reelsInfo[i1][j1] == 1) index -= 1;
                    if (index == 0) {
                        winsymbols[i1][j1] = true;
                        this.multiplierCell = new slotModelApi.Pair(i1, j1);
                        return winsymbols;
                    }
                }
            }
            return winsymbols;
        };
        ballooniesComponentsWinlines.WinLinesController.prototype.showWin = function(win, winsymbols, timeout, multiplier, isMultiplier) {
            var _g = this;
            ballooniesComponentsWinlines.TimeoutInvoker.setTimeout("showWinFrames", function() {
                var showFrames = win.winningSymbol != "b01" && !isMultiplier;
                if (isMultiplier) {
                    _g.multiplierData = multiplier;
                    _g.multiplierCellData = _g.multiplierCell;
                    _g.winLines.getMultiplierSymbols().publishSymbolPosition(_g.multiplierData, _g.multiplierCellData);
                } else {
                    _g.winLines.port.getShowLineAnimations().publish(win);
                    _g.showShakeAndFrames(winsymbols, showFrames, multiplier);
                }
            }, timeout);
        };
        ballooniesComponentsWinlines.WinLinesController.prototype.onMultiplierSpawned = function(data) {
            this.publishShowMuliplier(data);
        };
        ballooniesComponentsWinlines.WinLinesController.prototype.publishCollectOfMuliplier = function(data) {
            ballooniesComponentsWinlines.ExternalService.bus.getChannel("GFBus").publish("COLLECT_MULTIPLIER", data);
        };
        ballooniesComponentsWinlines.WinLinesController.prototype.onMultiplierShown = function(e) {
            var data = this.winLines.getMultiplierSymbols().getDataToPublishStarMultiplier(this.multiplierData, this.multiplierCellData);
            ballooniesComponentsWinlines.ExternalService.bus.getChannel("GFBus").publish("COLLECT_MULTIPLIER", data);
        };
        ballooniesComponentsWinlines.WinLinesController.prototype.onNextMultiplier = function(e) {
            this.currentMultiplierIndex++;
            if (this.currentMultiplierIndex == this.outcome.scatterWins[0].symbolCount) {
                this.currentMultiplierIndex = 0;
                this.winLines.port.getMultipliersAnimated().publish(null);
            } else this.startMultiplierOnReels(this.multipliersList[this.currentMultiplierIndex]);
        };
        ballooniesComponentsWinlines.WinLinesController.prototype.publishShowMuliplier = function(data) {
            ballooniesComponentsWinlines.ExternalService.bus.getChannel("GFBus").publish("SHOW_MULTIPLIER", data);
        };
        ballooniesComponentsWinlines.WinLinesController.prototype.onIdlePlay = function(data) {
            this.winLines.port.getIdleSymbolsPlay().publish(null);
        };
        ballooniesComponentsWinlines.WinLinesController.prototype.winLinesCycleEnded = function(data) {
            this.hideWinLines();
            this.winLines.port.getWinLineCycleAnimated().publish(null);
        };
        ballooniesComponentsWinlines.WinLinesController.prototype.handleWinSymbols = function(winsymbols) {
            this.hideWinLines();
            if (!this.isLowWin) this.winLines.port.getStartExplosionSpawn().publish(null);
            this.winLines.getWinSymbols().show(winsymbols, this.outcome, this.scatterPayout);
        };
        ballooniesComponentsWinlines.WinLinesController.prototype.showShakeAndFrames = function(winsymbols, showFrames, multiplier) {
            if (multiplier == null) multiplier = 0;
            this.hideWinLines();
            if (showFrames) this.winLines.getWinFrames().show(winsymbols);
            this.winLines.getShakeSymbols().show(winsymbols, this.outcome, this.winPayload.winPerScatter, multiplier);
        };
        ballooniesComponentsWinlines.WinLinesController.prototype.hideAll = function() {
            this.hideWinLines();
            ballooniesComponentsWinlines.TimeoutInvoker.clearTimeouts("showWinFrames");
            ballooniesComponentsWinlines.TimeoutInvoker.clearTimeouts("handleWinSymbols", true);
        };
        ballooniesComponentsWinlines.WinLinesController.prototype.hideWinLines = function() {
            this.winLines.getWinSymbols().hide();
            this.winLines.getShakeSymbols().hide();
            this.winLines.getWinFrames().hide();
            this.winLines.getMultiplierSymbols().hide();
        };
        ballooniesComponentsWinlines.WinLinesController.prototype.__class__ = ballooniesComponentsWinlines.WinLinesController;
        ballooniesComponentsWinlines.WinLinesFactory = function(vbf) {
            this.vbf = vbf;
        };
        ballooniesComponentsWinlines.WinLinesFactory = ck_implements(ballooniesComponentsWinlines.WinLinesFactory, clientkernelModulesApi.IService);
        ballooniesComponentsWinlines.WinLinesFactory = ck_implements(ballooniesComponentsWinlines.WinLinesFactory, componentmodelComponentApi.IComponentFactory);
        ballooniesComponentsWinlines.WinLinesFactory.__interfaces__ = [clientkernelModulesApi.IService, componentmodelComponentApi.IComponentFactory];
        ballooniesComponentsWinlines.WinLinesFactory.__name__ = ["ballooniesComponentsWinlines", "WinLinesFactory"];
        ballooniesComponentsWinlines.WinLinesFactory.prototype.vbf = null;
        ballooniesComponentsWinlines.WinLinesFactory.prototype.getComponentDeclaration = function() {
            return ballooniesIxfWinlinesDeclaration.WinLinesDeclaration;
        };
        ballooniesComponentsWinlines.WinLinesFactory.prototype.createComponent = function(context) {
            ballooniesComponentsWinlines.ExternalService.componentContext = context;
            new ballooniesComponentsWinlines.WinLines(context, this.vbf);
        };
        ballooniesComponentsWinlines.WinLinesFactory.prototype.__class__ = ballooniesComponentsWinlines.WinLinesFactory;

        ballooniesComponentsWinlines.IWinFrames = function() {}
        ballooniesComponentsWinlines.IWinFrames.prototype = {

            show: function(winSymbols) {
                return {
                    arguments: ["array"],
                    returns: "void"
                };
            },
            hide: function() {
                return {
                    arguments: [],
                    returns: "void"
                };
            }
        };
        ballooniesComponentsWinlines.BaseEvents = function() {
            this.events = new haxe.ds.EnumValueMap();
            this.registerEvents();
        };
        ballooniesComponentsWinlines.BaseEvents.__name__ = ["ballooniesComponentsWinlines", "BaseEvents"];
        ballooniesComponentsWinlines.BaseEvents.prototype.events = null;
        ballooniesComponentsWinlines.BaseEvents.prototype.registerEvents = function() {
            var value = new _hcmn_.msignal_Signal1();
            this.events.set(ballooniesComponentsWinlines.BaseEventsEnum.WIN_SYMBOL_ANIMATIONS_COMPLETE, value);
            var value1 = new _hcmn_.msignal_Signal1();
            this.events.set(ballooniesComponentsWinlines.BaseEventsEnum.MULTIPLIER_SPAWNED, value1);
            var value2 = new _hcmn_.msignal_Signal1();
            this.events.set(ballooniesComponentsWinlines.BaseEventsEnum.IDLE_SYMBOL_ANIMATION_START, value2);
        };
        ballooniesComponentsWinlines.BaseEvents.prototype.getEvent = function(id) {
            return this.events.get(id);
        };
        ballooniesComponentsWinlines.BaseEvents.prototype.__class__ = ballooniesComponentsWinlines.BaseEvents;
        ballooniesComponentsWinlines.BaseEventsEnum = {
            __ename__: ["ballooniesComponentsWinlines", "BaseEventsEnum"],
            __constructs__: ["WIN_SYMBOL_ANIMATIONS_COMPLETE", "MULTIPLIER_SPAWNED", "IDLE_SYMBOL_ANIMATION_START", "SHAKE_SYMBOL_ANIMATION_START"]
        };
        ballooniesComponentsWinlines.BaseEventsEnum.MULTIPLIER_SPAWNED = ["MULTIPLIER_SPAWNED", 1];
        ballooniesComponentsWinlines.BaseEventsEnum.MULTIPLIER_SPAWNED.toString = $estr;
        ballooniesComponentsWinlines.BaseEventsEnum.MULTIPLIER_SPAWNED.__enum__ = ballooniesComponentsWinlines.BaseEventsEnum;
        ballooniesComponentsWinlines.BaseEventsEnum.IDLE_SYMBOL_ANIMATION_START = ["IDLE_SYMBOL_ANIMATION_START", 2];
        ballooniesComponentsWinlines.BaseEventsEnum.IDLE_SYMBOL_ANIMATION_START.toString = $estr;
        ballooniesComponentsWinlines.BaseEventsEnum.IDLE_SYMBOL_ANIMATION_START.__enum__ = ballooniesComponentsWinlines.BaseEventsEnum;
        ballooniesComponentsWinlines.BaseEventsEnum.WIN_SYMBOL_ANIMATIONS_COMPLETE = ["WIN_SYMBOL_ANIMATIONS_COMPLETE", 0];
        ballooniesComponentsWinlines.BaseEventsEnum.WIN_SYMBOL_ANIMATIONS_COMPLETE.toString = $estr;
        ballooniesComponentsWinlines.BaseEventsEnum.WIN_SYMBOL_ANIMATIONS_COMPLETE.__enum__ = ballooniesComponentsWinlines.BaseEventsEnum;
        ballooniesComponentsWinlines.BaseEventsEnum.SHAKE_SYMBOL_ANIMATION_START = ["SHAKE_SYMBOL_ANIMATION_START", 3];
        ballooniesComponentsWinlines.BaseEventsEnum.SHAKE_SYMBOL_ANIMATION_START.toString = $estr;
        ballooniesComponentsWinlines.BaseEventsEnum.SHAKE_SYMBOL_ANIMATION_START.__enum__ = ballooniesComponentsWinlines.BaseEventsEnum;

        ballooniesComponentsWinlines.ISymbols = function() {}
        ballooniesComponentsWinlines.ISymbols.prototype = {

            show: function(winsymbols, outcome, win, multiplier) {
                return {
                    arguments: ["array", "*", "string", {
                        type: "number",
                        opt: true
                    }],
                    returns: "void"
                };
            },
            hide: function() {
                return {
                    arguments: [],
                    returns: "void"
                };
            },
            setVisible: function(visible) {
                return {
                    arguments: ["boolean"],
                    returns: "void"
                };
            },
            publishSymbolPosition: function(multiplier, cell) {
                return {
                    arguments: ["number", "*"],
                    returns: "void"
                };
            },
            getDataToPublishStarMultiplier: function(multiplier, cell) {
                return {
                    arguments: ["number", "*"],
                    returns: "*"
                };
            }
        };
        ballooniesComponentsWinlines.BaseSymbols = function(symbolType, container, baseEvents, winLinesConfig) {
            this.isVisible = false;
            this.totalCreatedSymbols = 0;
            this.symbolContainers = new _hcmn_.haxe_ds_StringMap();
            this.originalSymbols = new _hcmn_.haxe_ds_StringMap();
            this.symbolsList = new _hcmn_.haxe_ds_StringMap();
            this.container = container;
            this.symbolType = symbolType;
            this.baseEvents = baseEvents;
            this.winLinesConfig = winLinesConfig;
            this.cellsNum = winLinesConfig.cellsNum;
            this.reelsNum = winLinesConfig.reelsNum;
            this.horisontalGap = winLinesConfig.cellHorizontalSpacing;
            this.verticalGap = winLinesConfig.cellVerticalSpacing;
            this.registerSymbols();
        };
        ballooniesComponentsWinlines.BaseSymbols = ck_implements(ballooniesComponentsWinlines.BaseSymbols, ballooniesComponentsWinlines.ISymbols);
        ballooniesComponentsWinlines.BaseSymbols.__interfaces__ = [ballooniesComponentsWinlines.ISymbols];
        ballooniesComponentsWinlines.BaseSymbols.__name__ = ["ballooniesComponentsWinlines", "BaseSymbols"];
        ballooniesComponentsWinlines.BaseSymbols.prototype.horisontalGap = null;
        ballooniesComponentsWinlines.BaseSymbols.prototype.verticalGap = null;
        ballooniesComponentsWinlines.BaseSymbols.prototype.symbolType = null;
        ballooniesComponentsWinlines.BaseSymbols.prototype.winLinesConfig = null;
        ballooniesComponentsWinlines.BaseSymbols.prototype.baseEvents = null;
        ballooniesComponentsWinlines.BaseSymbols.prototype.cellsNum = null;
        ballooniesComponentsWinlines.BaseSymbols.prototype.reelsNum = null;
        ballooniesComponentsWinlines.BaseSymbols.prototype.container = null;
        ballooniesComponentsWinlines.BaseSymbols.prototype.symbolsList = null;
        ballooniesComponentsWinlines.BaseSymbols.prototype.originalSymbols = null;
        ballooniesComponentsWinlines.BaseSymbols.prototype.maskedContainer = null;
        ballooniesComponentsWinlines.BaseSymbols.prototype.winSymbolsAssets = null;
        ballooniesComponentsWinlines.BaseSymbols.prototype.symbolContainers = null;
        ballooniesComponentsWinlines.BaseSymbols.prototype.reelsPort = null;
        ballooniesComponentsWinlines.BaseSymbols.prototype.totalCreatedSymbols = null;
        ballooniesComponentsWinlines.BaseSymbols.prototype.isVisible = null;
        ballooniesComponentsWinlines.BaseSymbols.prototype.registerSymbols = function() {
            var _g = 0;
            var _g1 = this.winLinesConfig.symbols;
            while (_g < _g1.length) {
                var entry = _g1[_g];
                ++_g;
                this.symbolsList.set(entry.key, entry.value);
            }
        };
        ballooniesComponentsWinlines.BaseSymbols.prototype.setPosition = function(symbolContainer, col, row) {
            var position = this.getPointPosition(col, row);
            symbolContainer.setX(position.x);
            symbolContainer.setY(position.y);
        };
        ballooniesComponentsWinlines.BaseSymbols.prototype.getPointPosition = function(col, row) {
            return new displayEngineApi.Point((this.winLinesConfig.cellWidth + this.horisontalGap) * col, (this.winLinesConfig.cellHeight + this.verticalGap) * row);
        };
        ballooniesComponentsWinlines.BaseSymbols.prototype.show = function(winsymbols, outcome, win, multiplier) {
            if (multiplier == null) multiplier = 0;
            this.isVisible = true;
        };
        ballooniesComponentsWinlines.BaseSymbols.prototype.hide = function() {
            var $it0 = (function($this) {
                var $r;
                var this1 = $this.maskedContainer.getChildComponents();
                $r = this1.keys();
                return $r;
            }(this));
            while ($it0.hasNext()) {
                var key = $it0.next();
                this.maskedContainer.disposeChildComponent(key);
            }
            var $it1 = this.originalSymbols.keys();
            while ($it1.hasNext()) {
                var key1 = $it1.next();
                this.originalSymbols.get(key1).dispose();
                this.originalSymbols.remove(key1);
            }
            var $it2 = this.symbolContainers.keys();
            while ($it2.hasNext()) {
                var key2 = $it2.next();
                this.symbolContainers.get(key2).dispose();
                this.symbolContainers.remove(key2);
            }
            this.symbolContainers = new _hcmn_.haxe_ds_StringMap();
            this.container.hide();
            this.originalSymbols = new _hcmn_.haxe_ds_StringMap();
            this.isVisible = false;
        };
        ballooniesComponentsWinlines.BaseSymbols.prototype.setVisible = function(visible) {
            this.isVisible = visible;
            if (visible) {
                this.maskedContainer.show();
                this.container.show();
            } else {
                this.container.hide();
                this.maskedContainer.hide();
            }
        };
        ballooniesComponentsWinlines.BaseSymbols.prototype.createAnimationSymbol = function(symbolName, col, row) {
            var symbolContainer = null;
            var winSymbolsAssets = ballooniesComponentsWinlines.ExternalService.loadedAssets;
            var symbolKey = symbolName + "_" + col + "_" + row;
            if (this.symbolContainers.get(symbolKey) == null) {
                symbolContainer = this.container.createContainerFromStoredConfig(symbolName);
                this.symbolContainers.set(symbolKey, symbolContainer);
            } else {
                symbolContainer = this.symbolContainers.get(symbolKey);
                symbolContainer.show();
                return symbolContainer;
            }
            symbolContainer.show();
            var assets = winSymbolsAssets.get("" + this.symbolType + "_" + symbolName + "_VB");
            var vbAnimView = ballooniesComponentsWinlines.ExternalService.viewBuilderFactory.createView(assets);
            var vbAniamtionHolder = vbAnimView.createContainerFromStoredConfig(ballooniesComponentsWinlines.BaseSymbols.ANIMATION_HOLDER);
            var vbAniamtionComponent = vbAniamtionHolder.getVBAnimationById(ballooniesComponentsWinlines.BaseSymbols.ANIMATION_CONTENT);
            vbAniamtionComponent.show();
            symbolContainer.addChildComponent(vbAniamtionHolder, symbolName);
            this.maskedContainer.addChildComponent(symbolContainer, symbolKey);
            var newSymbol = vbAniamtionComponent.getDisplayObject();
            this.maskedContainer.getDisplayObject().addChild(newSymbol);
            this.setPosition(newSymbol, col, row);
            this.originalSymbols.set(symbolKey + "_VB", vbAniamtionComponent);
            return symbolContainer;
        };
        ballooniesComponentsWinlines.BaseSymbols.prototype.lookOnThis = function(position) {
            var gfBus = ballooniesComponentsWinlines.ExternalService.bus.getChannel("GFBus");
            gfBus.publish("HEADER::EYES::lookOnThis", position);
        };
        ballooniesComponentsWinlines.BaseSymbols.prototype.getPosition = function(key) {
            var r = new _hcmn_.EReg("_(\\d)_(\\d)_VB", "");
            r.match(key);
            return new slotModelApi.Pair(_hcmn_.Std.parseInt(r.matched(1)), _hcmn_.Std.parseInt(r.matched(2)));
        };
        ballooniesComponentsWinlines.BaseSymbols.prototype.publishSymbolPosition = function(multiplier, cell) {};
        ballooniesComponentsWinlines.BaseSymbols.prototype.getDataToPublishStarMultiplier = function(multiplier, cell) {
            return null;
        };
        ballooniesComponentsWinlines.BaseSymbols.prototype.__class__ = ballooniesComponentsWinlines.BaseSymbols;
        ballooniesComponentsWinlines.IdleSymbols = function(container, baseEvents, winLinesConfig) {
            this.animationsWouldBeHide = [];
            ballooniesComponentsWinlines.BaseSymbols.call(this, "IDLE", container, baseEvents, winLinesConfig);
            this.reelsPort = ballooniesComponentsWinlines.ExternalService.componentContext.getUsedPort(ballooniesIxfTumbleReelsApi.ITumbleReelsPort);
            this.maskedContainer = _hcmn_.js_Boot.__cast(container.getComponentById("maskedContainer"), viewBuilderApi.IViewBuilderContainer);
            container.hide();
            this.winSymbolsAssets = ballooniesComponentsWinlines.ExternalService.loadedAssets;
        };
        ballooniesComponentsWinlines.IdleSymbols = ck_implements(ballooniesComponentsWinlines.IdleSymbols, ballooniesComponentsWinlines.ISymbols);
        ballooniesComponentsWinlines.IdleSymbols.__interfaces__ = [ballooniesComponentsWinlines.ISymbols];
        ballooniesComponentsWinlines.IdleSymbols.__name__ = ["ballooniesComponentsWinlines", "IdleSymbols"];
        ballooniesComponentsWinlines.IdleSymbols.__super__ = ballooniesComponentsWinlines.BaseSymbols;
        for (var k in ballooniesComponentsWinlines.BaseSymbols.prototype) ballooniesComponentsWinlines.IdleSymbols.prototype[k] = ballooniesComponentsWinlines.BaseSymbols.prototype[k];
        ballooniesComponentsWinlines.IdleSymbols.prototype.reelCellsVisibility = null;
        ballooniesComponentsWinlines.IdleSymbols.prototype.initialReelCellsVisibility = null;
        ballooniesComponentsWinlines.IdleSymbols.prototype.timerForPlayAny = null;
        ballooniesComponentsWinlines.IdleSymbols.prototype.numberOfPlayedAnimation = null;
        ballooniesComponentsWinlines.IdleSymbols.prototype.animationsWouldBeHide = null;
        ballooniesComponentsWinlines.IdleSymbols.prototype.startAnimation = function(reelPicture) {
            ballooniesComponentsWinlines.BaseSymbols.prototype.show.call(this, null, null, null, 0);
            this.container.show();
            this.maskedContainer.show();
            this.createSymbols(reelPicture);
            this.numberOfPlayedAnimation = 0;
            var _g = [];
            var _g2 = 0;
            var _g1 = this.reelsNum;
            while (_g2 < _g1) {
                var i = _g2++;
                _g.push((function($this) {
                    var $r;
                    var _g3 = []; {
                        var _g5 = 0;
                        var _g4 = $this.cellsNum;
                        while (_g5 < _g4) {
                            var j = _g5++;
                            _g3.push(true);
                        }
                    }
                    $r = _g3;
                    return $r;
                }(this)));
            }
            this.initialReelCellsVisibility = _g;
            this.timerForPlayAny = window.setInterval($bind(this, this.playAny), this.winLinesConfig.idleTimeToAnimateNextSymbols);
            this.playAny();
        };
        ballooniesComponentsWinlines.IdleSymbols.prototype.createSymbols = function(reelPicture) {
            var _g1 = 0;
            var _g = this.reelsNum;
            while (_g1 < _g) {
                var col = _g1++;
                var _g3 = 0;
                var _g2 = this.cellsNum;
                while (_g3 < _g2) {
                    var row = _g3++;
                    var symbolId = reelPicture[col][row];
                    var symbolName;
                    symbolName = ((function($this) {
                        var $r;
                        var key = symbolId;
                        $r = $this.symbolsList.get(key);
                        return $r;
                    }(this))).name;
                    this.createSymbol(symbolName, col, row);
                }
            }
        };
        ballooniesComponentsWinlines.IdleSymbols.prototype.getRandomSymbols = function(count) {
            var symbols = [];
            var $it0 = this.originalSymbols.keys();
            while ($it0.hasNext()) {
                var key = $it0.next();
                symbols.push(key);
            }
            var indices = this.getDifferentRandomIndices(count, symbols.length);
            return _hcmn_.Lambda.map(indices, function(i) {
                return symbols[i];
            });
        };
        ballooniesComponentsWinlines.IdleSymbols.prototype.getDifferentRandomIndices = function(count, arraySize) {
            var numbers;
            var _g = [];
            var _g1 = 0;
            while (_g1 < arraySize) {
                var i = _g1++;
                _g.push(i);
            }
            numbers = _g;
            var result = [];
            var _g11 = 0;
            while (_g11 < count) {
                var n = _g11++;
                var nextIndex = _hcmn_.Std.random(arraySize - n);
                result.push(numbers[nextIndex]);
                numbers[nextIndex] = numbers[arraySize - 1 - n];
            }
            return result;
        };
        ballooniesComponentsWinlines.IdleSymbols.prototype.playAny = function() {
            if (this.numberOfPlayedAnimation == 0 && !_hcmn_.Lambda.empty(this.originalSymbols)) {
                var _g = [];
                var _g2 = 0;
                var _g1 = this.reelsNum;
                while (_g2 < _g1) {
                    var i = _g2++;
                    _g.push((function($this) {
                        var $r;
                        var _g3 = []; {
                            var _g5 = 0;
                            var _g4 = $this.cellsNum;
                            while (_g5 < _g4) {
                                var j = _g5++;
                                _g3.push($this.initialReelCellsVisibility[i][j]);
                            }
                        }
                        $r = _g3;
                        return $r;
                    }(this)));
                }
                this.reelCellsVisibility = _g;
                var randomSymbols = this.getRandomSymbols(ballooniesComponentsWinlines.IdleSymbols.NUM_SYMBOLS_ANIMATING);
                var _g1_head = randomSymbols.h;
                var _g1_val = null;
                while (_g1_head != null) {
                    var symbol;
                    symbol = (function($this) {
                        var $r;
                        _g1_val = _g1_head[0];
                        _g1_head = _g1_head[1];
                        $r = _g1_val;
                        return $r;
                    }(this));
                    this.play(symbol);
                }
                this.baseEvents.getEvent(ballooniesComponentsWinlines.BaseEventsEnum.IDLE_SYMBOL_ANIMATION_START).dispatch(null);
                this.reelsPort.getUpdateCellsVisibility().publish(this.reelCellsVisibility);
            }
        };
        ballooniesComponentsWinlines.IdleSymbols.prototype.play = function(key) {
            var position = this.getPosition(key);
            this.reelCellsVisibility[position.key][position.value] = false;
            var animation = this.originalSymbols.get(key);
            animation.show();
            animation.play(false);
            this.numberOfPlayedAnimation++;
            var position1 = animation.getDisplayObject().localToGlobal(0, 0);
            this.lookOnThis(position1);
        };
        ballooniesComponentsWinlines.IdleSymbols.prototype.createSymbol = function(symbolName, col, row) {
            var _g = this;
            var symbol = this.createAnimationSymbol(symbolName, col, row);
            var animation = symbol.getContainerById(symbolName).getVBAnimationById(ballooniesComponentsWinlines.BaseSymbols.ANIMATION_CONTENT);
            animation.gotoAndStop(false, "loop");
            animation.addEventListener(ballooniesComponentsWinlines.BaseSymbols.SYMBOL_ANIMATION_END, function() {
                animation.stop();
                animation.gotoAndStop(false, "loop");
                _g.animationsWouldBeHide.push(animation);
                _g.numberOfPlayedAnimation--;
                _g.updateVisibility();
            });
            animation.hide();
            return symbol;
        };
        ballooniesComponentsWinlines.IdleSymbols.prototype.updateVisibility = function() {
            if (this.numberOfPlayedAnimation == 0) {
                this.reelsPort.getUpdateCellsVisibility().publish(this.initialReelCellsVisibility);
                var _g = 0;
                var _g1 = this.animationsWouldBeHide;
                while (_g < _g1.length) {
                    var c = _g1[_g];
                    ++_g;
                    c.hide();
                }
                this.animationsWouldBeHide = [];
            }
        };
        ballooniesComponentsWinlines.IdleSymbols.prototype.hide = function() {
            if (this.isVisible) {
                this.numberOfPlayedAnimation = 0;
                window.clearInterval(this.timerForPlayAny);
                this.isVisible = false;
                ballooniesComponentsWinlines.BaseSymbols.prototype.hide.call(this);
                this.reelsPort.getUpdateCellsVisibility().publish(this.initialReelCellsVisibility);
            }
        };
        ballooniesComponentsWinlines.IdleSymbols.prototype.__class__ = ballooniesComponentsWinlines.IdleSymbols;
        ballooniesComponentsWinlines.MultiplierSymbols = function(container, baseEvents, winLinesConfig) {
            ballooniesComponentsWinlines.BaseSymbols.call(this, "MULT", container, baseEvents, winLinesConfig);
        };
        ballooniesComponentsWinlines.MultiplierSymbols.__name__ = ["ballooniesComponentsWinlines", "MultiplierSymbols"];
        ballooniesComponentsWinlines.MultiplierSymbols.__super__ = ballooniesComponentsWinlines.BaseSymbols;
        for (var k in ballooniesComponentsWinlines.BaseSymbols.prototype) ballooniesComponentsWinlines.MultiplierSymbols.prototype[k] = ballooniesComponentsWinlines.BaseSymbols.prototype[k];
        ballooniesComponentsWinlines.MultiplierSymbols.prototype.hide = function() {};
        ballooniesComponentsWinlines.MultiplierSymbols.prototype.publishSymbolPosition = function(multiplier, cell) {
            if (multiplier > 0) {
                var data = this.getDataToPublishStarMultiplier(multiplier, cell);
                this.baseEvents.getEvent(ballooniesComponentsWinlines.BaseEventsEnum.MULTIPLIER_SPAWNED).dispatch(data);
                multiplier = 0;
            }
        };
        ballooniesComponentsWinlines.MultiplierSymbols.prototype.getDataToPublishStarMultiplier = function(multiplier, cell) {
            var data = {};
            var pos = this.getPointPosition(cell.key, cell.value);
            data.position = this.getInitialMultiplierPosition(pos);
            data.amount = multiplier;
            return data;
        };
        ballooniesComponentsWinlines.MultiplierSymbols.prototype.getInitialMultiplierPosition = function(pos) {
            var result = new displayEngineApi.Point();
            result.x = pos.x + this.winLinesConfig.cellWidth * .5;
            result.y = pos.y + this.winLinesConfig.cellHeight * .5;
            return this.container.getDisplayObject().localToGlobal(result.x, result.y);
        };
        ballooniesComponentsWinlines.MultiplierSymbols.prototype.__class__ = ballooniesComponentsWinlines.MultiplierSymbols;
        ballooniesComponentsWinlines.ShakeSymbols = function(container, baseEvents, winLinesConfig) {
            this.isLowWin = false;
            this.multiplier = 0;
            this.initialCenterPosition = new displayEngineApi.Point();
            ballooniesComponentsWinlines.BaseSymbols.call(this, "SHAKE", container, baseEvents, winLinesConfig);
            this.reelsPort = ballooniesComponentsWinlines.ExternalService.componentContext.getUsedPort(ballooniesIxfTumbleReelsApi.ITumbleReelsPort);
            this.maskedContainer = _hcmn_.js_Boot.__cast(container.getComponentById("maskedContainer"), viewBuilderApi.IViewBuilderContainer);
            container.hide();
            var _g = [];
            var _g2 = 0;
            var _g1 = this.reelsNum;
            while (_g2 < _g1) {
                var i = _g2++;
                _g.push((function($this) {
                    var $r;
                    var _g3 = []; {
                        var _g5 = 0;
                        var _g4 = $this.cellsNum;
                        while (_g5 < _g4) {
                            var j = _g5++;
                            _g3.push(true);
                        }
                    }
                    $r = _g3;
                    return $r;
                }(this)));
            }
            this.initialReelCellsVisibility = _g;
        };
        ballooniesComponentsWinlines.ShakeSymbols = ck_implements(ballooniesComponentsWinlines.ShakeSymbols, ballooniesComponentsWinlines.ISymbols);
        ballooniesComponentsWinlines.ShakeSymbols.__interfaces__ = [ballooniesComponentsWinlines.ISymbols];
        ballooniesComponentsWinlines.ShakeSymbols.__name__ = ["ballooniesComponentsWinlines", "ShakeSymbols"];
        ballooniesComponentsWinlines.ShakeSymbols.__super__ = ballooniesComponentsWinlines.BaseSymbols;
        for (var k in ballooniesComponentsWinlines.BaseSymbols.prototype) ballooniesComponentsWinlines.ShakeSymbols.prototype[k] = ballooniesComponentsWinlines.BaseSymbols.prototype[k];
        ballooniesComponentsWinlines.ShakeSymbols.prototype.initialCenterPosition = null;
        ballooniesComponentsWinlines.ShakeSymbols.prototype.initialReelCellsVisibility = null;
        ballooniesComponentsWinlines.ShakeSymbols.prototype.multiplier = null;
        ballooniesComponentsWinlines.ShakeSymbols.prototype.isLowWin = null;
        ballooniesComponentsWinlines.ShakeSymbols.prototype.show = function(winsymbols, outcome, win, multiplier) {
            if (multiplier == null) multiplier = 0;
            ballooniesComponentsWinlines.BaseSymbols.prototype.show.call(this, winsymbols, outcome, win, multiplier);
            this.multiplier = multiplier;
            this.container.show();
            this.maskedContainer.show();
            var _g1 = 0;
            var _g = this.reelsNum;
            while (_g1 < _g) {
                var col = _g1++;
                var _g3 = 0;
                var _g2 = this.cellsNum;
                while (_g3 < _g2) {
                    var row = _g3++;
                    var symbolNum = outcome.reelStop.reels[col][row];
                    var symbolVisible = winsymbols[col][row];
                    var symbolName;
                    symbolName = ((function($this) {
                        var $r;
                        var key = symbolNum;
                        $r = $this.symbolsList.get(key);
                        return $r;
                    }(this))).name;
                    if (!symbolVisible) continue;
                    this.createSymbol(symbolName, col, row, win);
                }
            }
            this.updateReelVisibility(winsymbols);
        };
        ballooniesComponentsWinlines.ShakeSymbols.prototype.updateReelVisibility = function(winsymbols) {
            var reelCellsVisibility;
            var _g = [];
            var _g2 = 0;
            var _g1 = this.reelsNum;
            while (_g2 < _g1) {
                var i = _g2++;
                _g.push((function($this) {
                    var $r;
                    var _g3 = []; {
                        var _g5 = 0;
                        var _g4 = $this.cellsNum;
                        while (_g5 < _g4) {
                            var j = _g5++;
                            _g3.push(!winsymbols[i][j]);
                        }
                    }
                    $r = _g3;
                    return $r;
                }(this)));
            }
            reelCellsVisibility = _g;
            this.reelsPort.getUpdateCellsVisibility().publish(reelCellsVisibility);
        };
        ballooniesComponentsWinlines.ShakeSymbols.prototype.createSymbol = function(symbolName, col, row, text) {
            if (text == null) text = "";
            var symbol = this.createAnimationSymbol(symbolName, col, row);
            var animation = symbol.getContainerById(symbolName).getVBAnimationById(ballooniesComponentsWinlines.BaseSymbols.ANIMATION_CONTENT);
            this.setInitialCenterPosition(animation.getDisplayObject());
            var frameLabel = this.createTextlabel(animation, text);
            if (!this.isLowWin) animation.gotoAndPlay(false, frameLabel);
            return symbol;
        };
        ballooniesComponentsWinlines.ShakeSymbols.prototype.setTextLabel = function(animation, text) {
            var mc = animation.getContainerById("mc");
            var label = mc.getLabelById("reelScatterValue");
            label.setText(text);
        };
        ballooniesComponentsWinlines.ShakeSymbols.prototype.createTextlabel = function(animation, text) {
            var frameLabel = "loop";
            if ((function($this) {
                    var $r;
                    var this1 = animation.getChildComponents();
                    $r = this1.exists("mc");
                    return $r;
                }(this))) this.setTextLabel(animation, "");
            return frameLabel;
        };
        ballooniesComponentsWinlines.ShakeSymbols.prototype.setInitialCenterPosition = function(displayObject) {
            this.initialCenterPosition.x = displayObject.getX() + displayObject.getWidth() * .5;
            this.initialCenterPosition.y = displayObject.getY() + displayObject.getHeight() * .5;
            this.initialCenterPosition = displayObject.getParent().localToGlobal(this.initialCenterPosition.x, this.initialCenterPosition.y);
        };
        ballooniesComponentsWinlines.ShakeSymbols.prototype.hide = function() {
            if (this.isVisible) {
                this.multiplier = 0;
                this.reelsPort.getUpdateCellsVisibility().publish(this.initialReelCellsVisibility);
                ballooniesComponentsWinlines.BaseSymbols.prototype.hide.call(this);
            }
        };
        ballooniesComponentsWinlines.ShakeSymbols.prototype.setLowWin = function(isLowWin) {
            this.isLowWin = isLowWin;
        };
        ballooniesComponentsWinlines.ShakeSymbols.prototype.__class__ = ballooniesComponentsWinlines.ShakeSymbols;
        ballooniesComponentsWinlines.WinFrames = function(container, baseEvents, config) {
            this.container = container;
            this.config = config;
            container.hide();
        };
        ballooniesComponentsWinlines.WinFrames = ck_implements(ballooniesComponentsWinlines.WinFrames, ballooniesComponentsWinlines.IWinFrames);
        ballooniesComponentsWinlines.WinFrames.__interfaces__ = [ballooniesComponentsWinlines.IWinFrames];
        ballooniesComponentsWinlines.WinFrames.__name__ = ["ballooniesComponentsWinlines", "WinFrames"];
        ballooniesComponentsWinlines.WinFrames.prototype.container = null;
        ballooniesComponentsWinlines.WinFrames.prototype.config = null;
        ballooniesComponentsWinlines.WinFrames.prototype.show = function(winSymbols) {
            var _g1 = 0;
            var _g = winSymbols.length;
            while (_g1 < _g) {
                var i = _g1++;
                var _g3 = 0;
                var _g2 = winSymbols[i].length;
                while (_g3 < _g2) {
                    var j = _g3++;
                    this.updateFrame(i, j, winSymbols[i][j]);
                }
            }
            this.container.show();
        };
        ballooniesComponentsWinlines.WinFrames.prototype.hide = function() {
            this.container.hide();
            var $it0 = (function($this) {
                var $r;
                var this1 = $this.container.getChildComponents();
                $r = this1.keys();
                return $r;
            }(this));
            while ($it0.hasNext()) {
                var key = $it0.next();
                this.container.getComponentById(key).hide();
            }
        };
        ballooniesComponentsWinlines.WinFrames.prototype.updateFrame = function(i, j, isVisible) {
            var id;
            id = "FRAME_" + (i == null ? "null" : "" + i) + (j == null ? "null" : "" + j);
            var winFrame = this.container.getComponentById(id);
            if (winFrame == null) winFrame = this.addFrame(i, j, id);
            if (isVisible) winFrame.show();
            else winFrame.hide();
        };
        ballooniesComponentsWinlines.WinFrames.prototype.addFrame = function(i, j, id) {
            var winFrame;
            var assets = ballooniesComponentsWinlines.ExternalService.loadedAssets.get(ballooniesComponentsWinlines.WinFrames.WIN_FRAME);
            winFrame = ballooniesComponentsWinlines.ExternalService.viewBuilderFactory.createView(assets);
            this.container.addChildComponent(winFrame, id);
            winFrame.getDisplayObject().setX((this.config.cellWidth + this.config.cellHorizontalSpacing) * i);
            winFrame.getDisplayObject().setY((this.config.cellHeight + this.config.cellVerticalSpacing) * j);
            return winFrame;
        };
        ballooniesComponentsWinlines.WinFrames.prototype.__class__ = ballooniesComponentsWinlines.WinFrames;
        ballooniesComponentsWinlines.WinSymbols = function(container, baseEvents, winLinesConfig) {
            this.isLowWin = false;
            ballooniesComponentsWinlines.BaseSymbols.call(this, "WIN", container, baseEvents, winLinesConfig);
            this.reelsPort = ballooniesComponentsWinlines.ExternalService.componentContext.getUsedPort(ballooniesIxfTumbleReelsApi.ITumbleReelsPort);
            this.maskedContainer = _hcmn_.js_Boot.__cast(container.getComponentById("maskedContainer"), viewBuilderApi.IViewBuilderContainer);
            container.hide();
            this.winSymbolsAssets = ballooniesComponentsWinlines.ExternalService.loadedAssets;
        };
        ballooniesComponentsWinlines.WinSymbols = ck_implements(ballooniesComponentsWinlines.WinSymbols, ballooniesComponentsWinlines.ISymbols);
        ballooniesComponentsWinlines.WinSymbols.__interfaces__ = [ballooniesComponentsWinlines.ISymbols];
        ballooniesComponentsWinlines.WinSymbols.__name__ = ["ballooniesComponentsWinlines", "WinSymbols"];
        ballooniesComponentsWinlines.WinSymbols.__super__ = ballooniesComponentsWinlines.BaseSymbols;
        for (var k in ballooniesComponentsWinlines.BaseSymbols.prototype) ballooniesComponentsWinlines.WinSymbols.prototype[k] = ballooniesComponentsWinlines.BaseSymbols.prototype[k];
        ballooniesComponentsWinlines.WinSymbols.prototype.isLowWin = null;
        ballooniesComponentsWinlines.WinSymbols.prototype.show = function(winsymbols, outcome, win, multiplier) {
            if (multiplier == null) multiplier = 0;
            ballooniesComponentsWinlines.BaseSymbols.prototype.show.call(this, winsymbols, outcome, win, multiplier);
            this.container.show();
            this.maskedContainer.show();
            var symbols;
            var _g = [];
            var _g2 = 0;
            var _g1 = this.reelsNum;
            while (_g2 < _g1) {
                var i = _g2++;
                _g.push((function($this) {
                    var $r;
                    var _g3 = []; {
                        var _g5 = 0;
                        var _g4 = $this.cellsNum;
                        while (_g5 < _g4) {
                            var j = _g5++;
                            _g3.push(!winsymbols[i][j]);
                        }
                    }
                    $r = _g3;
                    return $r;
                }(this)));
            }
            symbols = _g;
            this.reelsPort.getUpdateCellsVisibility().publish(symbols);
            var _g21 = 0;
            var _g11 = this.reelsNum;
            while (_g21 < _g11) {
                var col = _g21++;
                var _g41 = 0;
                var _g31 = this.cellsNum;
                while (_g41 < _g31) {
                    var row = _g41++;
                    var symbolNum = outcome.reelStop.reels[col][row];
                    var symbolVisible = winsymbols[col][row];
                    if (!symbolVisible) continue;
                    this.createSymbol((function($this) {
                        var $r;
                        var key = symbolNum;
                        $r = $this.symbolsList.get(key);
                        return $r;
                    }(this)), col, row);
                }
            }
            if (!this.isLowWin) this.playAnimations();
        };
        ballooniesComponentsWinlines.WinSymbols.prototype.playAnimations = function() {
            var $it0 = this.originalSymbols.iterator();
            while ($it0.hasNext()) {
                var symbol = $it0.next();
                symbol.play(false);
            }
        };
        ballooniesComponentsWinlines.WinSymbols.prototype.createSymbol = function(entryValue, col, row) {
            var _g = this;
            var symbolName = entryValue.name;
            this.totalCreatedSymbols++;
            var symbol = this.createAnimationSymbol(symbolName, col, row);
            if (!this.isLowWin) {
                var animation = symbol.getContainerById(symbolName).getVBAnimationById(ballooniesComponentsWinlines.BaseSymbols.ANIMATION_CONTENT);
                animation.addEventListener(ballooniesComponentsWinlines.BaseSymbols.SYMBOL_ANIMATION_END, function() {
                    animation.gotoAndStop(false, "loop");
                    animation.hide();
                    _g.totalCreatedSymbols -= 1;
                    _g.spawnExplosion(col, row, entryValue);
                });
                animation.gotoAndPlay(false, "loop");
            } else {
                this.totalCreatedSymbols -= 1;
                this.checkAnimationsComplete();
            }
            return symbol;
        };
        ballooniesComponentsWinlines.WinSymbols.prototype.spawnExplosion = function(col, row, entryValue) {
            var _g = this;
            this.totalCreatedSymbols++;
            var symbol = this.createAnimationSymbol("EXPLOSION", col, row);
            var animation = symbol.getContainerById("EXPLOSION").getVBAnimationById(ballooniesComponentsWinlines.BaseSymbols.ANIMATION_CONTENT);
            animation.addEventListener(ballooniesComponentsWinlines.BaseSymbols.SYMBOL_ANIMATION_END, function() {
                _g.totalCreatedSymbols -= 1;
                animation.gotoAndStop(false, "loop");
                animation.hide();
                _g.checkAnimationsComplete();
            });
            animation.gotoAndPlay(false, "loop");
            var position = this.getPointPosition(col, row);
            position.x += this.winLinesConfig.cellWidth * .5;
            position.y += this.winLinesConfig.cellHeight * .5;
            new ballooniesComponentsWinlines.ExplosionParticle().playParticle(symbol, position, entryValue);
        };
        ballooniesComponentsWinlines.WinSymbols.prototype.checkAnimationsComplete = function() {
            var _g = this;
            if (this.totalCreatedSymbols <= 0) window.setTimeout(function() {
                _g.baseEvents.getEvent(ballooniesComponentsWinlines.BaseEventsEnum.WIN_SYMBOL_ANIMATIONS_COMPLETE).dispatch(null);
            }, 10);
        };
        ballooniesComponentsWinlines.WinSymbols.prototype.hide = function() {
            this.reelsPort.getShow().publish(null);
            ballooniesComponentsWinlines.BaseSymbols.prototype.hide.call(this);
        };
        ballooniesComponentsWinlines.WinSymbols.prototype.setLowWin = function(isLowWin) {
            this.isLowWin = isLowWin;
        };
        ballooniesComponentsWinlines.WinSymbols.prototype.__class__ = ballooniesComponentsWinlines.WinSymbols;
        ballooniesComponentsWinlines.ExplosionParticle = function() {
            this.isInit = false;
            var _g = this;
            console.log("BL::ExplosionParticle::new");
            ballooniesComponentsWinlines.ExternalService.loadConfig("particles_animation", function(data) {
                _g.animDef = data;
                _g.checkIsInit();
                console.log("BL::ExplosionParticle::particles_animation:loaded " + (_g.isInit == null ? "null" : "" + _g.isInit));
            });
            ballooniesComponentsWinlines.ExternalService.loadConfig("particles_particle", function(data1) {
                _g.config = data1;
                _g.checkIsInit();
                console.log("BL::ExplosionParticle::particles_particle:loaded " + (_g.isInit == null ? "null" : "" + _g.isInit));
            });
            ballooniesComponentsWinlines.ExternalService.loadConfig("particles_particle_png", function(data2) {
                _g.imgData = data2;
                _g.checkIsInit();
                console.log("BL::ExplosionParticle::particles_particle_png:loaded " + (_g.isInit == null ? "null" : "" + _g.isInit));
            });
        };
        ballooniesComponentsWinlines.ExplosionParticle.__name__ = ["ballooniesComponentsWinlines", "ExplosionParticle"];
        ballooniesComponentsWinlines.ExplosionParticle.prototype.animDef = null;
        ballooniesComponentsWinlines.ExplosionParticle.prototype.config = null;
        ballooniesComponentsWinlines.ExplosionParticle.prototype.imgData = null;
        ballooniesComponentsWinlines.ExplosionParticle.prototype.isInit = null;
        ballooniesComponentsWinlines.ExplosionParticle.prototype.callbackF = null;
        ballooniesComponentsWinlines.ExplosionParticle.prototype.checkIsInit = function() {
            this.isInit = this.config != null && this.imgData != null && this.animDef != null;
            if (this.isInit && this.callbackF != null) this.callbackF();
        };
        ballooniesComponentsWinlines.ExplosionParticle.prototype.playParticle = function(container, position, entryValue) {
            var _g = this;
            if (!this.isInit) {
                this.callbackF = function() {
                    _g.playParticle(container, position, entryValue);
                };
                return;
            }
            var particleBitmaps = [ballooniesComponentsWinlines.ExternalService.displayProvider.getFactory().createBitmap(this.imgData), ballooniesComponentsWinlines.ExternalService.displayProvider.getFactory().createBitmap(this.imgData), ballooniesComponentsWinlines.ExternalService.displayProvider.getFactory().createBitmap(this.imgData)];
            this.config.color.start = entryValue.colorStart;
            this.config.color.end = entryValue.colorEnd;
            var particles = ballooniesComponentsWinlines.ExternalService.displayProvider.getFactory().createParticleSystem(particleBitmaps, "", this.config);
            container.getDisplayObject().addChild(particles);
            particles.start(ballooniesComponentsWinlines.ExternalService.displayProvider.getDefaultStage());
            this.animDef.anims[0].val = position.x;
            this.animDef.anims[1].val = position.y;
            var anim = ballooniesComponentsWinlines.ExternalService.displayProvider.getFactory().createAnimation("particles", particles, this.animDef);
            anim.start();
        };
        ballooniesComponentsWinlines.ExplosionParticle.prototype.__class__ = ballooniesComponentsWinlines.ExplosionParticle;
        if (typeof haxe == 'undefined') {
            var haxe = {};
        };

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

            get: function(k) {
                return {
                    arguments: ["*"],
                    returns: "null"
                };
            },
            exists: function(k) {
                return {
                    arguments: ["*"],
                    returns: "boolean"
                };
            },
            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.exists = function(key) {
            var node = this.root;
            while (node != null) {
                var c = this.compare(key, node.key);
                if (c == 0) return true;
                else if (c < 0) node = node.left;
                else node = node.right;
            }
            return false;
        };
        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.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 (!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 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;
        ballooniesComponentsWinlines.TimeoutInvoker = function() {};
        ballooniesComponentsWinlines.TimeoutInvoker.__name__ = ["ballooniesComponentsWinlines", "TimeoutInvoker"];
        ballooniesComponentsWinlines.TimeoutInvoker.clearTimeouts = function(groupName, isNeedInvokeBeforeClear) {
            if (isNeedInvokeBeforeClear == null) isNeedInvokeBeforeClear = false;
            var list;
            var _this = ballooniesComponentsWinlines.TimeoutInvoker.getTimeoutsGroup(groupName);
            list = _this.slice();
            var _g = 0;
            while (_g < list.length) {
                var instance = list[_g];
                ++_g;
                window.clearTimeout(instance.timeOutId);
                var _this1 = ballooniesComponentsWinlines.TimeoutInvoker.getTimeoutsGroup(groupName);
                _hcmn_.HxOverrides.remove(_this1, instance);
                if (isNeedInvokeBeforeClear) {
                    instance.isCalled = true;
                    instance.handler();
                }
            }
            ballooniesComponentsWinlines.TimeoutInvoker.TIMEOUTS_GROUPS.remove(groupName);
        };
        ballooniesComponentsWinlines.TimeoutInvoker.setTimeout = function(groupName, handler, timeout) {
            if (timeout == null) timeout = 0;
            var invokeInstance = new js.timeouts.InvokeInstance();
            var id = window.setTimeout(ballooniesComponentsWinlines.TimeoutInvoker.getInvokeHandler(invokeInstance), timeout);
            invokeInstance.groupName = groupName;
            invokeInstance.timeOutId = id;
            invokeInstance.handler = handler;
            ballooniesComponentsWinlines.TimeoutInvoker.getTimeoutsGroup(groupName).push(invokeInstance);
        };
        ballooniesComponentsWinlines.TimeoutInvoker.getInvokeHandler = function(instance) {
            return function() {
                if (!instance.isCalled) {
                    instance.isCalled = true;
                    var _this = ballooniesComponentsWinlines.TimeoutInvoker.getTimeoutsGroup(instance.groupName);
                    _hcmn_.HxOverrides.remove(_this, instance);
                    instance.handler();
                }
            };
        };
        ballooniesComponentsWinlines.TimeoutInvoker.getTimeoutsGroup = function(groupName) {
            if (!ballooniesComponentsWinlines.TimeoutInvoker.TIMEOUTS_GROUPS.exists(groupName)) {
                var value = [];
                ballooniesComponentsWinlines.TimeoutInvoker.TIMEOUTS_GROUPS.set(groupName, value);
            }
            return ballooniesComponentsWinlines.TimeoutInvoker.TIMEOUTS_GROUPS.get(groupName);
        };
        ballooniesComponentsWinlines.TimeoutInvoker.prototype.__class__ = ballooniesComponentsWinlines.TimeoutInvoker;
        if (!js.timeouts) {
            js.timeouts = {};
        };
        js.timeouts.InvokeInstance = function() {
            this.isCalled = false;
        };
        js.timeouts.InvokeInstance.__name__ = ["js", "timeouts", "InvokeInstance"];
        js.timeouts.InvokeInstance.prototype.isCalled = null;
        js.timeouts.InvokeInstance.prototype.groupName = null;
        js.timeouts.InvokeInstance.prototype.handler = null;
        js.timeouts.InvokeInstance.prototype.timeOutId = null;
        js.timeouts.InvokeInstance.prototype.__class__ = js.timeouts.InvokeInstance;
        ballooniesComponentsWinlines.ExternalService.loadedAssets = new _hcmn_.haxe_ds_StringMap();;
        ballooniesComponentsWinlines.ExternalService.loading = 0;;
        ballooniesComponentsWinlines.ExternalService.totalLoaded = 0;;
        ballooniesComponentsWinlines.ExternalService.loadedCallbacks = new _hcmn_.haxe_ds_StringMap();;
        ballooniesComponentsWinlines.BaseSymbols.CONTAINER_PREFIX = "_VB_CONTAINER";;
        ballooniesComponentsWinlines.BaseSymbols.ANIMATION_HOLDER = "ANIMATION_HOLDER";;
        ballooniesComponentsWinlines.BaseSymbols.ANIMATION_CONTENT = "ANIMATION_CONTENT";;
        ballooniesComponentsWinlines.BaseSymbols.SYMBOL_ANIMATION_END = "SYMBOL::ANIMATION::END";;
        ballooniesComponentsWinlines.IdleSymbols.NUM_SYMBOLS_ANIMATING = 2;;
        ballooniesComponentsWinlines.WinFrames.WIN_FRAME = "WIN_FRAME";;
        ballooniesComponentsWinlines.TimeoutInvoker.TIMEOUTS_GROUPS = new _hcmn_.haxe_ds_StringMap();;
        return {
            exports: ballooniesComponentsWinlines,
            activator: ballooniesComponentsWinlines.Activator
        };
    });
//# sourceURL=winLinesImpl.js