define("icyWildsExpandingWilds", ["viewBuilderApi", "componentmodelComponentApi", "clientkernelLoaderApi", "displayEngineApi", "icyWildsComponentsExpandingWildsPort", "displayEngineUtils", "gameLayoutApi", "clientkernelEventbusApi", "clientkernelModulesApi"],
    function(viewBuilderApi, componentmodelComponentApi, clientkernelLoaderApi, displayEngineApi, icyWildsComponentsExpandingWildsPort, displayEngineUtils, gameLayoutApi, 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, '');
        };
        if (typeof haxe == 'undefined') {
            var haxe = {};
        };

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

            get: function(k) {
                return {
                    arguments: ["*"],
                    returns: "null"
                };
            }
        };
        haxe.Log = function() {};
        haxe.Log.__name__ = ["haxe", "Log"];
        haxe.Log.trace = function(v, infos) {
            _hcmn_.js_Boot.__trace(v, infos);
        };
        haxe.Log.prototype.__class__ = haxe.Log;
        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.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.balance = function(l, k, v, r) {
            var hl;
            if (l == null) hl = 0;
            else hl = l._height;
            var hr;
            if (r == null) hr = 0;
            else hr = r._height;
            if (hl > hr + 2) {
                if ((function($this) {
                        var $r;
                        var _this = l.left;
                        $r = _this == null ? 0 : _this._height;
                        return $r;
                    }(this)) >= (function($this) {
                        var $r;
                        var _this1 = l.right;
                        $r = _this1 == null ? 0 : _this1._height;
                        return $r;
                    }(this))) return new haxe.ds.TreeNode(l.left, l.key, l.value, new haxe.ds.TreeNode(l.right, k, v, r));
                else return new haxe.ds.TreeNode(new haxe.ds.TreeNode(l.left, l.key, l.value, l.right.left), l.right.key, l.right.value, new haxe.ds.TreeNode(l.right.right, k, v, r));
            } else if (hr > hl + 2) {
                if ((function($this) {
                        var $r;
                        var _this2 = r.right;
                        $r = _this2 == null ? 0 : _this2._height;
                        return $r;
                    }(this)) > (function($this) {
                        var $r;
                        var _this3 = r.left;
                        $r = _this3 == null ? 0 : _this3._height;
                        return $r;
                    }(this))) return new haxe.ds.TreeNode(new haxe.ds.TreeNode(l, k, v, r.left), r.key, r.value, r.right);
                else return new haxe.ds.TreeNode(new haxe.ds.TreeNode(l, k, v, r.left.left), r.left.key, r.left.value, new haxe.ds.TreeNode(r.left.right, r.key, r.value, r.right));
            } else return new haxe.ds.TreeNode(l, k, v, r, (hl > hr ? hl : hr) + 1);
        };
        haxe.ds.BalancedTree.prototype.compare = function(k1, k2) {
            return _hcmn_.Reflect.compare(k1, k2);
        };
        haxe.ds.BalancedTree.prototype.__class__ = haxe.ds.BalancedTree;
        haxe.ds.TreeNode = function(l, k, v, r, h) {
            if (h == null) h = -1;
            this.left = l;
            this.key = k;
            this.value = v;
            this.right = r;
            if (h == -1) this._height = ((function($this) {
                var $r;
                var _this = $this.left;
                $r = _this == null ? 0 : _this._height;
                return $r;
            }(this)) > (function($this) {
                var $r;
                var _this1 = $this.right;
                $r = _this1 == null ? 0 : _this1._height;
                return $r;
            }(this)) ? (function($this) {
                var $r;
                var _this2 = $this.left;
                $r = _this2 == null ? 0 : _this2._height;
                return $r;
            }(this)) : (function($this) {
                var $r;
                var _this3 = $this.right;
                $r = _this3 == null ? 0 : _this3._height;
                return $r;
            }(this))) + 1;
            else this._height = h;
        };
        haxe.ds.TreeNode.__name__ = ["haxe", "ds", "TreeNode"];
        haxe.ds.TreeNode.prototype.left = null;
        haxe.ds.TreeNode.prototype.right = null;
        haxe.ds.TreeNode.prototype.key = null;
        haxe.ds.TreeNode.prototype.value = null;
        haxe.ds.TreeNode.prototype._height = null;
        haxe.ds.TreeNode.prototype.__class__ = haxe.ds.TreeNode;
        haxe.ds.EnumValueMap = function() {
            haxe.ds.BalancedTree.call(this);
        };
        haxe.ds.EnumValueMap.__interfaces__ = [haxe.IMap];
        haxe.ds.EnumValueMap.__name__ = ["haxe", "ds", "EnumValueMap"];
        haxe.ds.EnumValueMap.__super__ = haxe.ds.BalancedTree;
        for (var k in haxe.ds.BalancedTree.prototype) haxe.ds.EnumValueMap.prototype[k] = haxe.ds.BalancedTree.prototype[k];
        haxe.ds.EnumValueMap.prototype.compare = function(k1, k2) {
            var d = k1[1] - k2[1];
            if (d != 0) return d;
            var p1 = k1.slice(2);
            var p2 = k2.slice(2);
            if (p1.length == 0 && p2.length == 0) return 0;
            return this.compareArgs(p1, p2);
        };
        haxe.ds.EnumValueMap.prototype.compareArgs = function(a1, a2) {
            var ld = a1.length - a2.length;
            if (ld != 0) return ld;
            var _g1 = 0;
            var _g = a1.length;
            while (_g1 < _g) {
                var i = _g1++;
                var d = this.compareArg(a1[i], a2[i]);
                if (d != 0) return d;
            }
            return 0;
        };
        haxe.ds.EnumValueMap.prototype.compareArg = function(v1, v2) {
            if (_hcmn_.Reflect.isEnumValue(v1) && _hcmn_.Reflect.isEnumValue(v2)) return this.compare(v1, v2);
            else if ((v1 instanceof Array) && v1.__enum__ == null && ((v2 instanceof Array) && v2.__enum__ == null)) return this.compareArgs(v1, v2);
            else return _hcmn_.Reflect.compare(v1, v2);
        };
        haxe.ds.EnumValueMap.prototype.__class__ = haxe.ds.EnumValueMap;
        if (typeof icyWildsExpandingWilds == 'undefined') {
            var icyWildsExpandingWilds = {};
        };
        icyWildsExpandingWilds.Activator = function(context) {};
        icyWildsExpandingWilds.Activator = ck_implements(icyWildsExpandingWilds.Activator, clientkernelModulesApi.IModuleActivator);
        icyWildsExpandingWilds.Activator.__interfaces__ = [clientkernelModulesApi.IModuleActivator];
        icyWildsExpandingWilds.Activator.__name__ = ["icyWildsExpandingWilds", "Activator"];
        icyWildsExpandingWilds.Activator.prototype.start = function(context) {
            context.getServiceTracker([viewBuilderApi.IViewBuilderFactory, clientkernelLoaderApi.IAssetRegistry, displayEngineApi.IDisplayProvider]).then(function(context1) {
                icyWildsExpandingWilds.ExternalService.initialize(context1);
                var vbf = context1.getAnyService(viewBuilderApi.IViewBuilderFactory, null);
                icyWildsExpandingWilds.ExternalService.viewBuilderFactory = vbf;
                context1.registerService(new icyWildsExpandingWilds.ExpandingWildsFactory(vbf, context1), icyWildsComponentsExpandingWildsPort.ExpandingWildsDeclaration, null);
            });
        };
        icyWildsExpandingWilds.Activator.prototype.stop = function(context) {};
        icyWildsExpandingWilds.Activator.main = function() {};
        icyWildsExpandingWilds.Activator.prototype.__class__ = icyWildsExpandingWilds.Activator;
        icyWildsExpandingWilds.ExpandingWilds = function(context, vbf, cfgId) {
            this.MAIN_CONFIG_ID = "expanding_wilds_config_json";
            this.initialized = false;
            this.layoutPayload = null;
            this.assetsLoaded = false;
            this.vbf = vbf;
            this.cfgId = cfgId;
            this.context = context;
            this.components = new haxe.ds.EnumValueMap();
            this.port = context.getImplementedPort(icyWildsComponentsExpandingWildsPort.IExpandingWildsImplementationPort);
            this.layoutPort = context.getUsedPort(gameLayoutApi.IGameLayoutPort);
            this.layoutPort.getUpdateComponentLayout().subscribe($bind(this, this.updateLayout));
            this.loadVBAssets();
        };
        icyWildsExpandingWilds.ExpandingWilds.__name__ = ["icyWildsExpandingWilds", "ExpandingWilds"];
        icyWildsExpandingWilds.ExpandingWilds.prototype.view = null;
        icyWildsExpandingWilds.ExpandingWilds.prototype.components = null;
        icyWildsExpandingWilds.ExpandingWilds.prototype.layoutPort = null;
        icyWildsExpandingWilds.ExpandingWilds.prototype.context = null;
        icyWildsExpandingWilds.ExpandingWilds.prototype.cfgId = null;
        icyWildsExpandingWilds.ExpandingWilds.prototype.vba = null;
        icyWildsExpandingWilds.ExpandingWilds.prototype.expandingWildAnimAssets = null;
        icyWildsExpandingWilds.ExpandingWilds.prototype.assetsLoaded = null;
        icyWildsExpandingWilds.ExpandingWilds.prototype.vbf = null;
        icyWildsExpandingWilds.ExpandingWilds.prototype.layoutPayload = null;
        icyWildsExpandingWilds.ExpandingWilds.prototype.initialized = null;
        icyWildsExpandingWilds.ExpandingWilds.prototype.layerContainers = null;
        icyWildsExpandingWilds.ExpandingWilds.prototype.port = null;
        icyWildsExpandingWilds.ExpandingWilds.prototype.MAIN_CONFIG_ID = null;
        icyWildsExpandingWilds.ExpandingWilds.prototype.loadVBAssets = function() {
            var _g = this;
            var vb_assets = ["expanding_wilds-assets/EXPANDING_WILDS_REGULAR_VB", "expanding_wilds-assets/EXPANDING_WILDS_ANNOUNCEMENT_VB"];
            icyWildsExpandingWilds.ExternalService.assetRegistry.getAssetsContent(vb_assets).then(function(data) {
                icyWildsExpandingWilds.ExternalService.loadedAssets = data;
                _g.loadMainAssets();
            });
        };
        icyWildsExpandingWilds.ExpandingWilds.prototype.loadMainAssets = function() {
            var _g = this;
            icyWildsExpandingWilds.ExternalService.assetRegistry.getAsset(this.MAIN_CONFIG_ID).getContent().then(function(vba) {
                _g.vba = vba;
                _g.assetsLoaded = true;
                _g.initialize();
            });
        };
        icyWildsExpandingWilds.ExpandingWilds.prototype.updateLayout = function(e) {
            this.layoutPayload = e.getPayload();
            if (!this.initialized) this.initialize();
            else {
                this.handleUpdateLayout(this.layoutPayload);
                this.layoutPort.getComponentLayoutUpdated().publish(this.context.getInstance());
            }
        };
        icyWildsExpandingWilds.ExpandingWilds.prototype.initialize = function() {
            if (!this.initialized && this.vba != null && this.layoutPayload != null) {
                this.view = this.vbf.createView(this.vba);
                this.registerAllComponents();
                this.handleUpdateLayout(this.layoutPayload);
                this.port.getShow().subscribe($bind(this, this.handleShow));
                this.initialized = true;
            }
        };
        icyWildsExpandingWilds.ExpandingWilds.prototype.handleUpdateLayout = function(layoutPayload) {
            var $it0 = this.layerContainers.keys();
            while ($it0.hasNext()) {
                var layerId = $it0.next();
                var layerPayload = layoutPayload.containers.get(layerId);
                var stage;
                var this1 = icyWildsExpandingWilds.ExternalService.displayProvider.getStages();
                stage = this1.get(layerPayload.stage);
                var container = this.layerContainers.get(layerId).getDisplayObject();
                try {
                    stage.removeChild(container);
                } catch (e) {
                    if (e instanceof js._Boot.HaxeError) e = e.val;
                    if (_hcmn_.js_Boot.__instanceof(e, Error)) {} else throw (e);
                }
                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);
            }
            this.layoutPort.getComponentLayoutUpdated().publish(this.context.getInstance());
        };
        icyWildsExpandingWilds.ExpandingWilds.prototype.registerAllComponents = function() {
            this.layerContainers = this.view.getChildComponents();
            var $it0 = this.layerContainers.keys();
            while ($it0.hasNext()) {
                var layerId = $it0.next();
                var constructorIndex;
                var _this = _hcmn_.Type.getEnumConstructs(icyWildsExpandingWilds.ComponentsEnum);
                constructorIndex = _hcmn_.HxOverrides.indexOf(_this, layerId, 0);
                if (constructorIndex < 0) continue;
                var componentEnum = _hcmn_.Type.createEnum(icyWildsExpandingWilds.ComponentsEnum, layerId, null);
                if (!this.registerComponent(componentEnum)) continue;
            }
        };
        icyWildsExpandingWilds.ExpandingWilds.prototype.registerComponent = function(componentEnum) {
            this.registerContainerComponent(icyWildsExpandingWilds.ComponentsEnum.EXPANDING_WILDS, icyWildsExpandingWilds.ExpandingWildsFreeze);
            return true;
        };
        icyWildsExpandingWilds.ExpandingWilds.prototype.handleShow = function(e) {
            this.getExpandingWildsFreeze().show(e.getPayload());
        };
        icyWildsExpandingWilds.ExpandingWilds.prototype.registerContainerComponent = function(component, componentClass) {
            var container = this.view.getComponentById(component[0]);
            if (container == null) return;
            if (componentClass != null) {
                var specificComponent = _hcmn_.Type.createInstance(componentClass, [container]);
                this.components.set(component, specificComponent);
            } else this.components.set(component, container);
        };
        icyWildsExpandingWilds.ExpandingWilds.prototype.getExpandingWildsFreeze = function() {
            return this.components.get(icyWildsExpandingWilds.ComponentsEnum.EXPANDING_WILDS);
        };
        icyWildsExpandingWilds.ExpandingWilds.prototype.__class__ = icyWildsExpandingWilds.ExpandingWilds;
        icyWildsExpandingWilds.ExpandingWildsFactory = function(vbf, context) {
            this.context = context;
            this.vbf = vbf;
        };
        icyWildsExpandingWilds.ExpandingWildsFactory = ck_implements(icyWildsExpandingWilds.ExpandingWildsFactory, clientkernelModulesApi.IService);
        icyWildsExpandingWilds.ExpandingWildsFactory = ck_implements(icyWildsExpandingWilds.ExpandingWildsFactory, componentmodelComponentApi.IComponentFactory);
        icyWildsExpandingWilds.ExpandingWildsFactory.__interfaces__ = [clientkernelModulesApi.IService, componentmodelComponentApi.IComponentFactory];
        icyWildsExpandingWilds.ExpandingWildsFactory.__name__ = ["icyWildsExpandingWilds", "ExpandingWildsFactory"];
        icyWildsExpandingWilds.ExpandingWildsFactory.prototype.vbf = null;
        icyWildsExpandingWilds.ExpandingWildsFactory.prototype.context = null;
        icyWildsExpandingWilds.ExpandingWildsFactory.prototype.getComponentDeclaration = function() {
            return icyWildsComponentsExpandingWildsPort.ExpandingWildsDeclaration;
        };
        icyWildsExpandingWilds.ExpandingWildsFactory.prototype.createComponent = function(context) {
            var cfgId = context.getConfiguration();
            new icyWildsExpandingWilds.ExpandingWilds(context, this.vbf, cfgId);
        };
        icyWildsExpandingWilds.ExpandingWildsFactory.prototype.__class__ = icyWildsExpandingWilds.ExpandingWildsFactory;
        icyWildsExpandingWilds.ExternalService = function() {};
        icyWildsExpandingWilds.ExternalService.__name__ = ["icyWildsExpandingWilds", "ExternalService"];
        icyWildsExpandingWilds.ExternalService.displayProvider = null;
        icyWildsExpandingWilds.ExternalService.assetRegistry = null;
        icyWildsExpandingWilds.ExternalService.viewBuilderFactory = null;
        icyWildsExpandingWilds.ExternalService.loadedCallback = null;
        icyWildsExpandingWilds.ExternalService.initialize = function(context) {
            icyWildsExpandingWilds.ExternalService.displayProvider = context.getAnyService(displayEngineApi.IDisplayProvider, null);
            icyWildsExpandingWilds.ExternalService.assetRegistry = context.getAnyService(clientkernelLoaderApi.IAssetRegistry, null);
        };
        icyWildsExpandingWilds.ExternalService.loadVBAssets = function(id, loadedCallback) {
            haxe.Log.trace("ew loadVBAssets(" + id + ")", {
                fileName: "ExternalService.hx",
                lineNumber: 33,
                className: "icywilds.components.expandingwilds.ExternalService",
                methodName: "loadVBAssets"
            });
            if (loadedCallback) icyWildsExpandingWilds.ExternalService.loadedCallback = loadedCallback;
            icyWildsExpandingWilds.ExternalService.loading++;
            icyWildsExpandingWilds.ExternalService.assetRegistry.getAsset(id).getContent().then(function(vba) {
                icyWildsExpandingWilds.ExternalService.loadedAssets.set(id, vba);
                icyWildsExpandingWilds.ExternalService.ceheckLoaded(id);
            });
        };
        icyWildsExpandingWilds.ExternalService.ceheckLoaded = function(id) {
            icyWildsExpandingWilds.ExternalService.totalLoaded++;
            haxe.Log.trace("ew loaded(" + icyWildsExpandingWilds.ExternalService.totalLoaded + "/" + icyWildsExpandingWilds.ExternalService.loading + "):" + id, {
                fileName: "ExternalService.hx",
                lineNumber: 44,
                className: "icywilds.components.expandingwilds.ExternalService",
                methodName: "ceheckLoaded"
            });
            if (icyWildsExpandingWilds.ExternalService.totalLoaded == icyWildsExpandingWilds.ExternalService.loading) icyWildsExpandingWilds.ExternalService.loadedCallback();
        };
        icyWildsExpandingWilds.ExternalService.setLoadedCallback = function(callback) {
            icyWildsExpandingWilds.ExternalService.loadedCallback = callback;
        };
        icyWildsExpandingWilds.ExternalService.prototype.__class__ = icyWildsExpandingWilds.ExternalService;

        icyWildsExpandingWilds.IExpandingWildsFreeze = function() {}
        icyWildsExpandingWilds.IExpandingWildsFreeze.prototype = {

            show: function(payload) {
                return {
                    arguments: ["*"],
                    returns: "void"
                };
            },
            hide: function() {
                return {
                    arguments: [],
                    returns: "void"
                };
            },
            init: function() {
                return {
                    arguments: [],
                    returns: "void"
                };
            }
        };
        icyWildsExpandingWilds.ExpandingWildsFreeze = function(container) {
            this.wildsAnimOffScreeen = true;
            this.previousAnimState = [0, 0, 0, 0, 0];
            this.reelsNum = 5;
            this.cellsNum = 4;
            this.symbolWidth = 282;
            this.verticalGap = 4;
            this.horizontalGap = 9;
            this.container = container;
            container.show();
            this.originalSymbols = new _hcmn_.haxe_ds_StringMap();
            this.init();
        };
        icyWildsExpandingWilds.ExpandingWildsFreeze = ck_implements(icyWildsExpandingWilds.ExpandingWildsFreeze, icyWildsExpandingWilds.IExpandingWildsFreeze);
        icyWildsExpandingWilds.ExpandingWildsFreeze.__interfaces__ = [icyWildsExpandingWilds.IExpandingWildsFreeze];
        icyWildsExpandingWilds.ExpandingWildsFreeze.__name__ = ["icyWildsExpandingWilds", "ExpandingWildsFreeze"];
        icyWildsExpandingWilds.ExpandingWildsFreeze.prototype.container = null;
        icyWildsExpandingWilds.ExpandingWildsFreeze.prototype.horizontalGap = null;
        icyWildsExpandingWilds.ExpandingWildsFreeze.prototype.verticalGap = null;
        icyWildsExpandingWilds.ExpandingWildsFreeze.prototype.symbolWidth = null;
        icyWildsExpandingWilds.ExpandingWildsFreeze.prototype.cellsNum = null;
        icyWildsExpandingWilds.ExpandingWildsFreeze.prototype.reelsNum = null;
        icyWildsExpandingWilds.ExpandingWildsFreeze.prototype.originalSymbols = null;
        icyWildsExpandingWilds.ExpandingWildsFreeze.prototype.previousAnimState = null;
        icyWildsExpandingWilds.ExpandingWildsFreeze.prototype.wildsAnimOffScreeen = null;
        icyWildsExpandingWilds.ExpandingWildsFreeze.prototype.instantShow = null;
        icyWildsExpandingWilds.ExpandingWildsFreeze.prototype.init = function() {
            this.createSymbols("EXPANDING_WILDS_REGULAR");
            this.createSymbols("EXPANDING_WILDS_ANNOUNCEMENT");
        };
        icyWildsExpandingWilds.ExpandingWildsFreeze.prototype.createSymbols = function(id) {
            var _g1 = 0;
            var _g = this.reelsNum;
            while (_g1 < _g) {
                var col = _g1++;
                var vbAsset = icyWildsExpandingWilds.ExternalService.loadedAssets.get(id + "_VB");
                if (vbAsset != null) {
                    var vbAnimView = icyWildsExpandingWilds.ExternalService.viewBuilderFactory.createView(vbAsset);
                    var symbolContainer = this.container.createContainerFromStoredConfig(id);
                    this.container.addChildComponent(symbolContainer, id + "_VB_" + col);
                    symbolContainer.setX((this.symbolWidth + this.horizontalGap) * col);
                    symbolContainer.setY(this.verticalGap);
                    var vbAnimationHolder = vbAnimView.createContainerFromStoredConfig("ANIMATION_HOLDER");
                    var vbAnimationComponent;
                    vbAnimationComponent = _hcmn_.js_Boot.__cast(vbAnimationHolder.getComponentById("ANIMATION_CONTENT"), viewBuilderApi.IVBAnimationComponent);
                    symbolContainer.addChildComponent(vbAnimationHolder, id + "VB_" + col);
                    this.originalSymbols.set(id + "_VB_" + col, vbAnimationComponent);
                }
            }
        };
        icyWildsExpandingWilds.ExpandingWildsFreeze.prototype.show = function(outcome) {
            this.instantShow = outcome.instantShow;
            var _g1 = 0;
            var _g = this.reelsNum;
            while (_g1 < _g) {
                var i = _g1++;
                if (outcome.reelId == null) this.handleRegularAnimation(i, outcome.data[i]);
            }
            if (outcome.reelId != null) {
                if (outcome.isSpinning == true) this.handleAnnouncement(outcome.reelId, outcome.data[outcome.reelId]);
            }
            if (outcome.instantShow) {
                if (outcome.reelId == null) {
                    if (outcome.isSpinning == null) {
                        var _g11 = 0;
                        var _g2 = this.reelsNum;
                        while (_g11 < _g2) {
                            var i1 = _g11++;
                            this.handleAnnouncement(i1, outcome.data[i1]);
                        }
                    }
                }
            }
            if (outcome.reelId == null) {
                if (outcome.isSpinning != null) {
                    if (outcome.isSpinning == false) this.onReelsSpinStopped(outcome.data);
                }
            }
        };
        icyWildsExpandingWilds.ExpandingWildsFreeze.prototype.handleRegularAnimation = function(symbolPosition, animState) {
            if (this.previousAnimState[symbolPosition] == animState) return;
            this.previousAnimState[symbolPosition] = animState;
            if (animState != 1) {
                var vbAnimationComponent = this.originalSymbols.get("EXPANDING_WILDS_REGULAR_VB_" + symbolPosition);
                var visible = animState > 0;
                if (visible) {
                    this.removeAnnouncement(symbolPosition);
                    vbAnimationComponent.addEventListener("evIntroComplete", $bind(this, this.introCompleted), [symbolPosition, animState]);
                    if (this.instantShow) vbAnimationComponent.gotoAndPlay(true, animState == null ? "null" : "" + animState);
                    else vbAnimationComponent.gotoAndPlay(true, "intro");
                    vbAnimationComponent.show();
                } else {
                    vbAnimationComponent.hide();
                    vbAnimationComponent.stop();
                    vbAnimationComponent.removeEventListener("evIntroComplete");
                }
            } else {}
        };
        icyWildsExpandingWilds.ExpandingWildsFreeze.prototype.handleAnnouncement = function(symbolPosition, outcome) {
            var visible = outcome > 0;
            if (visible) {
                if (outcome == 1) {
                    var vbAnimationComponent = this.originalSymbols.get("EXPANDING_WILDS_ANNOUNCEMENT_VB_" + symbolPosition);
                    vbAnimationComponent.show();
                    vbAnimationComponent.gotoAndStop(true, "Static");
                    vbAnimationComponent.getOffScreenBitmap().setAlpha(0);
                    displayEngineUtils.TweenX.to(vbAnimationComponent.getOffScreenBitmap(), {
                        alpha: 1
                    }, 200, null, null, null, null, null, null, null, {
                        fileName: "ExpandingWildsFreeze.hx",
                        lineNumber: 172,
                        className: "icywilds.components.expandingwilds.components.ExpandingWildsFreeze",
                        methodName: "handleAnnouncement"
                    }).onFinish(function() {
                        vbAnimationComponent.getOffScreenBitmap().setAlpha(1);
                    });
                } else {
                    var vbAnimationComponent1 = this.originalSymbols.get("EXPANDING_WILDS_ANNOUNCEMENT_VB_" + symbolPosition);
                    displayEngineUtils.TweenX.to(vbAnimationComponent1.getOffScreenBitmap(), {
                        alpha: 0
                    }, 200, null, null, null, null, null, null, null, {
                        fileName: "ExpandingWildsFreeze.hx",
                        lineNumber: 178,
                        className: "icywilds.components.expandingwilds.components.ExpandingWildsFreeze",
                        methodName: "handleAnnouncement"
                    }).onFinish(function() {
                        vbAnimationComponent1.getOffScreenBitmap().setAlpha(0);
                    });
                }
            } else {
                var vbAnimationComponent2 = this.originalSymbols.get("EXPANDING_WILDS_ANNOUNCEMENT_VB_" + symbolPosition);
                vbAnimationComponent2.hide();
            }
        };
        icyWildsExpandingWilds.ExpandingWildsFreeze.prototype.onReelsSpinStopped = function(outcome) {
            var _g1 = 0;
            var _g = this.reelsNum;
            while (_g1 < _g) {
                var i = _g1++;
                var vbAnimationComponent = this.originalSymbols.get("EXPANDING_WILDS_ANNOUNCEMENT_VB_" + i);
                if (outcome[i] == 1) vbAnimationComponent.gotoAndPlay(true, "flash");
            }
        };
        icyWildsExpandingWilds.ExpandingWildsFreeze.prototype.removeAnnouncement = function(id) {
            var vbAnimationComponent = this.originalSymbols.get("EXPANDING_WILDS_ANNOUNCEMENT_VB_" + id);
            vbAnimationComponent.gotoAndStop(true, "Static");
            displayEngineUtils.TweenX.to(vbAnimationComponent.getOffScreenBitmap(), {
                alpha: 0
            }, 200, null, null, null, null, null, null, null, {
                fileName: "ExpandingWildsFreeze.hx",
                lineNumber: 204,
                className: "icywilds.components.expandingwilds.components.ExpandingWildsFreeze",
                methodName: "removeAnnouncement"
            }).onFinish(function() {
                vbAnimationComponent.getOffScreenBitmap().setAlpha(0);
            });
        };
        icyWildsExpandingWilds.ExpandingWildsFreeze.prototype.introCompleted = function(data) {
            haxe.Log.trace("::im EW introCompleted ", {
                fileName: "ExpandingWildsFreeze.hx",
                lineNumber: 213,
                className: "icywilds.components.expandingwilds.components.ExpandingWildsFreeze",
                methodName: "introCompleted",
                customParams: [data]
            });
            var vbAnimationComponent = this.originalSymbols.get("EXPANDING_WILDS_REGULAR_VB_" + data[0]);
            vbAnimationComponent.gotoAndPlay(true, _hcmn_.Std.string(data[1]));
            vbAnimationComponent.removeEventListener("evIntroComplete");
        };
        icyWildsExpandingWilds.ExpandingWildsFreeze.prototype.hide = function() {};
        icyWildsExpandingWilds.ExpandingWildsFreeze.prototype.__class__ = icyWildsExpandingWilds.ExpandingWildsFreeze;
        icyWildsExpandingWilds.ComponentsEnum = {
            __ename__: ["icyWildsExpandingWilds", "ComponentsEnum"],
            __constructs__: ["EXPANDING_WILDS"]
        };
        icyWildsExpandingWilds.ComponentsEnum.EXPANDING_WILDS = ["EXPANDING_WILDS", 0];
        icyWildsExpandingWilds.ComponentsEnum.EXPANDING_WILDS.toString = $estr;
        icyWildsExpandingWilds.ComponentsEnum.EXPANDING_WILDS.__enum__ = icyWildsExpandingWilds.ComponentsEnum;
        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;
        icyWildsExpandingWilds.ExternalService.loadedAssets = new _hcmn_.haxe_ds_StringMap();;
        icyWildsExpandingWilds.ExternalService.loading = 0;;
        icyWildsExpandingWilds.ExternalService.totalLoaded = 0;;
        return {
            exports: icyWildsExpandingWilds,
            activator: icyWildsExpandingWilds.Activator
        };
    });
//# sourceURL=icyWildsExpandingWilds.js