define("smashThePigGameController", ["smashthepigComponentsTensionPort", "smashThePigWinAnimatorPort", "componentmodelComponentApi", "translationmanagerApi", "clientkernelLoaderApi", "slotModelApi", "winMeterApi", "reelsApi", "smashthepigComponentsLuckMeterPort", "soundManagerApi", "gameLayoutApi", "smashthepigComponentsReelPickerPort", "smashThePigComponentsGameControllerDeclaration", "clientkernelEventbusApi", "infoBarApi", "smashthepigComponentsBackgroundPort", "stateMachineEngine", "clientkernelModulesApi", "smashthepigComponentsBannerPort", "smashthepigComponentsPickerPort", "paytableApi", "betPanelApi", "clientkernelLoggerApi", "moneyApi", "smashThePigComponentsAnimationPort"],
    function(smashthepigComponentsTensionPort, smashThePigWinAnimatorPort, componentmodelComponentApi, translationmanagerApi, clientkernelLoaderApi, slotModelApi, winMeterApi, reelsApi, smashthepigComponentsLuckMeterPort, soundManagerApi, gameLayoutApi, smashthepigComponentsReelPickerPort, smashThePigComponentsGameControllerDeclaration, clientkernelEventbusApi, infoBarApi, smashthepigComponentsBackgroundPort, stateMachineEngine, clientkernelModulesApi, smashthepigComponentsBannerPort, smashthepigComponentsPickerPort, paytableApi, betPanelApi, clientkernelLoggerApi, moneyApi, smashThePigComponentsAnimationPort) {
        "use strict";

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

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

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

            get: function(k) {
                return {
                    arguments: ["*"],
                    returns: "null"
                };
            },
            set: function(k, v) {
                return {
                    arguments: ["*", "*"],
                    returns: "void"
                };
            }
        };
        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 (typeof smashThePigGameController == 'undefined') {
            var smashThePigGameController = {};
        };
        smashThePigGameController.Activator = function() {};
        smashThePigGameController.Activator = ck_implements(smashThePigGameController.Activator, clientkernelModulesApi.IModuleActivator);
        smashThePigGameController.Activator.__interfaces__ = [clientkernelModulesApi.IModuleActivator];
        smashThePigGameController.Activator.__name__ = ["smashThePigGameController", "Activator"];
        smashThePigGameController.Activator.prototype.start = function(context) {
            context.getServiceTracker([clientkernelEventbusApi.IEventBus, clientkernelLoaderApi.IAssetRegistry, translationmanagerApi.ITranslationManager]).then(function(context1) {
                smashThePigGameController.ExternalService.initialize(context1);
                context1.registerService(new smashThePigGameController.Factory(context1), smashThePigComponentsGameControllerDeclaration.GameControllerDeclaration, null);
            });
        };
        smashThePigGameController.Activator.prototype.stop = function(context) {};
        smashThePigGameController.Activator.main = function() {};
        smashThePigGameController.Activator.prototype.__class__ = smashThePigGameController.Activator;
        smashThePigGameController.ExternalService = function() {};
        smashThePigGameController.ExternalService.__name__ = ["smashThePigGameController", "ExternalService"];
        smashThePigGameController.ExternalService.bus = null;
        smashThePigGameController.ExternalService.assetRegistry = null;
        smashThePigGameController.ExternalService.moneyFormatter = null;
        smashThePigGameController.ExternalService.variableRegistry = null;
        smashThePigGameController.ExternalService.logger = null;
        smashThePigGameController.ExternalService._moduleContext = null;
        smashThePigGameController.ExternalService.initialize = function(context) {
            smashThePigGameController.ExternalService._moduleContext = context;
            smashThePigGameController.ExternalService.bus = context.getAnyService(clientkernelEventbusApi.IEventBus, null);
            smashThePigGameController.ExternalService.assetRegistry = context.getAnyService(clientkernelLoaderApi.IAssetRegistry, null);
            smashThePigGameController.ExternalService.moneyFormatter = context.getAnyService(moneyApi.IMoneyFormatter, null);
            smashThePigGameController.ExternalService.variableRegistry = context.getAnyService(clientkernelLoaderApi.IVariableRegistry, null);
            var loggerFactory = context.getAnyService(clientkernelLoggerApi.ILoggerFactory, null);
            smashThePigGameController.ExternalService.logger = loggerFactory.getDefaultLogger();
        };
        smashThePigGameController.ExternalService.getTranslationService = function() {
            return smashThePigGameController.ExternalService._moduleContext.getAnyService(translationmanagerApi.ITranslationManager);
        };
        smashThePigGameController.ExternalService.isMobile = function() {
            return smashThePigGameController.ExternalService.variableRegistry.get("skin") == "mobile" || smashThePigGameController.ExternalService.variableRegistry.get("assetPack") == "mobile" || smashThePigGameController.ExternalService.variableRegistry.get("skin") == "tablet" || smashThePigGameController.ExternalService.variableRegistry.get("assetPack") == "tablet";
        };
        smashThePigGameController.ExternalService.prototype.__class__ = smashThePigGameController.ExternalService;
        smashThePigGameController.Factory = function(moduleContext) {
            this.moduleContext = moduleContext;
        };
        smashThePigGameController.Factory = ck_implements(smashThePigGameController.Factory, clientkernelModulesApi.IService);
        smashThePigGameController.Factory = ck_implements(smashThePigGameController.Factory, componentmodelComponentApi.IComponentFactory);
        smashThePigGameController.Factory.__interfaces__ = [clientkernelModulesApi.IService, componentmodelComponentApi.IComponentFactory];
        smashThePigGameController.Factory.__name__ = ["smashThePigGameController", "Factory"];
        smashThePigGameController.Factory.prototype.moduleContext = null;
        smashThePigGameController.Factory.prototype.createComponent = function(context) {
            new smashThePigGameController.GameController(context, this.moduleContext);
        };
        smashThePigGameController.Factory.prototype.getComponentDeclaration = function() {
            return smashThePigComponentsGameControllerDeclaration.GameControllerDeclaration;
        };
        smashThePigGameController.Factory.prototype.__class__ = smashThePigGameController.Factory;
        smashThePigGameController.GameController = function(context, moduleContext) {
            this.progressMeterFinishCount = 0;
            this.progressMeterCountUp = 0;
            this.progressMeterBonusFill = 0;
            this.resultPresented = false;
            this.pickerSmashThePigTriggered = false;
            this.pickAPigTriggered = false;
            this.bigWinCountUpInc = 0;
            this.helpOpened = false;
            this.paytableOpened = false;
            this.promotionalSpinsActive = false;
            var _g = this;
            haxe.Log.trace("[LN] GameController.init", {
                fileName: "GameController.hx",
                lineNumber: 156,
                className: "smashthepig.components.gamecontroller.impl.GameController",
                methodName: "new"
            });
            this.moduleContext = moduleContext;
            this.model = new smashThePigGameController.GameModel();
            this.soundController = new smashThePigGameController.SoundController(context, this.model);
            this.slotModelPort = context.getUsedPort(slotModelApi.ISlotModelPort);
            this.betPanelPort = context.getUsedPort(betPanelApi.IBetPanelPort);
            this.reelsPort = context.getUsedPort(reelsApi.IReelsPort);
            this.winAnimatorPort = context.getUsedPort(smashThePigWinAnimatorPort.IWinAnimatorPort);
            this.gameLayoutPort = context.getUsedPort(gameLayoutApi.IGameLayoutPort);
            this.reelPickerPort = context.getUsedPort(smashthepigComponentsReelPickerPort.IReelPickerPort);
            this.pickerPort = context.getUsedPort(smashthepigComponentsPickerPort.IPickerPort);
            this.tensionPort = context.getUsedPort(smashthepigComponentsTensionPort.ITensionPort);
            this.paytablePort = context.getUsedPort(paytableApi.IPaytablePort);
            this.infoBarPort = context.getUsedPort(infoBarApi.IInfoBarPort);
            this.winMeterPort = context.getUsedPort(winMeterApi.IWinMeterPort);
            this.animationPort = context.getUsedPort(smashThePigComponentsAnimationPort.IAnimationPort);
            this.luckMeterPort = context.getUsedPort(smashthepigComponentsLuckMeterPort.ILuckMeterPort);
            this.bannerPort = context.getUsedPort(smashthepigComponentsBannerPort.IBannerPort);
            this.backgroundPort = context.getUsedPort(smashthepigComponentsBackgroundPort.IBackgroundPort);
            this.setupStateMachine();
            context.getStarted().then(function(a) {
                _g.assemblyStarted = true;
                _g.checkGameLoaded();
            });
            ((function($this) {
                var $r;
                var this1 = context.getReferredComponents("animation");
                $r = this1.get("reelbackground");
                return $r;
            }(this))).then(function(reelbackground) {
                _g.reelbackground = reelbackground;
            });
            ((function($this) {
                var $r;
                var this2 = context.getReferredComponents("animation");
                $r = this2.get("reelforeground");
                return $r;
            }(this))).then(function(reelforeground) {
                _g.reelforeground = reelforeground;
            });
            ((function($this) {
                var $r;
                var this3 = context.getReferredComponents("animation");
                $r = this3.get("wincappopup");
                return $r;
            }(this))).then(function(wincappopup) {
                _g.wincappopup = wincappopup;
            });
            smashThePigGameController.ExternalService.assetRegistry.getAsset("game-config_json").getContent().then(function(data) {
                _g.config = data.gameControllerConfig;
                _g.checkGameLoaded();
            });
            this.translationManager = smashThePigGameController.ExternalService.getTranslationService();
            this.moneyFormatter = smashThePigGameController.ExternalService.moneyFormatter;
        };
        smashThePigGameController.GameController.__name__ = ["smashThePigGameController", "GameController"];
        smashThePigGameController.GameController.prototype.stateMachine = null;
        smashThePigGameController.GameController.prototype.smDispatcher = null;
        smashThePigGameController.GameController.prototype.smContext = null;
        smashThePigGameController.GameController.prototype.moduleContext = null;
        smashThePigGameController.GameController.prototype.model = null;
        smashThePigGameController.GameController.prototype.soundController = null;
        smashThePigGameController.GameController.prototype.config = null;
        smashThePigGameController.GameController.prototype.translationManager = null;
        smashThePigGameController.GameController.prototype.moneyFormatter = null;
        smashThePigGameController.GameController.prototype.assemblyStarted = null;
        smashThePigGameController.GameController.prototype.layoutUpdated = null;
        smashThePigGameController.GameController.prototype.stopSpinRecieved = null;
        smashThePigGameController.GameController.prototype.abortSpinPayload = null;
        smashThePigGameController.GameController.prototype.reelbackground = null;
        smashThePigGameController.GameController.prototype.reelforeground = null;
        smashThePigGameController.GameController.prototype.wincappopup = null;
        smashThePigGameController.GameController.prototype.betPanelPort = null;
        smashThePigGameController.GameController.prototype.reelsPort = null;
        smashThePigGameController.GameController.prototype.winAnimatorPort = null;
        smashThePigGameController.GameController.prototype.tensionPort = null;
        smashThePigGameController.GameController.prototype.slotModelPort = null;
        smashThePigGameController.GameController.prototype.paytablePort = null;
        smashThePigGameController.GameController.prototype.luckMeterPort = null;
        smashThePigGameController.GameController.prototype.gameLayoutPort = null;
        smashThePigGameController.GameController.prototype.bannerPort = null;
        smashThePigGameController.GameController.prototype.infoBarPort = null;
        smashThePigGameController.GameController.prototype.winMeterPort = null;
        smashThePigGameController.GameController.prototype.resultPayload = null;
        smashThePigGameController.GameController.prototype.backgroundPort = null;
        smashThePigGameController.GameController.prototype.promotionalSpinsActive = null;
        smashThePigGameController.GameController.prototype.promotionalSpinsCount = null;
        smashThePigGameController.GameController.prototype.paytableOpened = null;
        smashThePigGameController.GameController.prototype.helpOpened = null;
        smashThePigGameController.GameController.prototype.animationPort = null;
        smashThePigGameController.GameController.prototype.reelPickerPort = null;
        smashThePigGameController.GameController.prototype.pickerPort = null;
        smashThePigGameController.GameController.prototype.bigWinCountUpInc = null;
        smashThePigGameController.GameController.prototype.pickAPigTriggered = null;
        smashThePigGameController.GameController.prototype.pickerSmashThePigTriggered = null;
        smashThePigGameController.GameController.prototype.resultPresented = null;
        smashThePigGameController.GameController.prototype.progressMeterFillSound = null;
        smashThePigGameController.GameController.prototype.isProgressMeterFull = null;
        smashThePigGameController.GameController.prototype.progressMeterBonusFill = null;
        smashThePigGameController.GameController.prototype.progressMeterCountUp = null;
        smashThePigGameController.GameController.prototype.progressMeterFinishCount = null;
        smashThePigGameController.GameController.prototype.progressMeterValue = null;
        smashThePigGameController.GameController.prototype.bigWinLength = null;
        smashThePigGameController.GameController.prototype.AVAILABLE_PICKS_TEMP = null;
        smashThePigGameController.GameController.prototype.infoBarTimer = null;
        smashThePigGameController.GameController.prototype.setupStateMachine = function() {
            haxe.Log.trace("[LN] GameController.setupStateMachine", {
                fileName: "GameController.hx",
                lineNumber: 207,
                className: "smashthepig.components.gamecontroller.impl.GameController",
                methodName: "setupStateMachine"
            });
            this.smDispatcher = new stateMachineEngine.EventDispatcher();
            this.smContext = new smashThePigGameController.StateMachineContext(this.smDispatcher);
            this.smContext.setupContextData(this);
            this.stateMachine = new stateMachineEngine.StateMachine(this.smDispatcher, smashThePigGameController.StateMachineDef.ID);
            this.stateMachine.setContext(this.smContext);
            this.stateMachine.logLevel = 3;
            this.stateMachine.logPrefix = "[GAME_CONTROLLER]";
            stateMachineEngine.StateMachine.logger = smashThePigGameController.ExternalService.logger;
            this.stateMachine.dispatchGlobalStateChange = false;
            stateMachineEngine.FSMInjector.registerSM(this.stateMachine, smashThePigGameController.StateMachineDef.FSM);
        };
        smashThePigGameController.GameController.prototype.dispatchEvent = function(action) {
            haxe.Log.trace("[LN] GameController.dispatchEvent:currentState ", {
                fileName: "GameController.hx",
                lineNumber: 222,
                className: "smashthepig.components.gamecontroller.impl.GameController",
                methodName: "dispatchEvent",
                customParams: [this.stateMachine.currentState]
            });
            haxe.Log.trace("[LN] GameController.dispatchEvent:action ", {
                fileName: "GameController.hx",
                lineNumber: 223,
                className: "smashthepig.components.gamecontroller.impl.GameController",
                methodName: "dispatchEvent",
                customParams: [action]
            });
            this.smDispatcher.dispatchEvent(new stateMachineEngine.StateEvent(smashThePigGameController.StateMachineDef.ID + stateMachineEngine.StateEvent.ACTION, action));
        };
        smashThePigGameController.GameController.prototype.checkGameLoaded = function() {
            haxe.Log.trace("[LN] GameController.checkGameLoaded", {
                fileName: "GameController.hx",
                lineNumber: 228,
                className: "smashthepig.components.gamecontroller.impl.GameController",
                methodName: "checkGameLoaded"
            });
            if (!this.assemblyStarted) return;
            if (!this.layoutUpdated) return;
            if (this.config == null) return;
            this.slotModelPort.getStages().getInitStage().getGameLoaded().publish(null);
        };
        smashThePigGameController.GameController.prototype.attachComponents = function() {
            haxe.Log.trace("[LN] GameController.attachComponents", {
                fileName: "GameController.hx",
                lineNumber: 243,
                className: "smashthepig.components.gamecontroller.impl.GameController",
                methodName: "attachComponents"
            });
            this.slotModelPort.getGameContext().getBalance().subscribe($bind(this, this.handleBalanceUpdate));
            this.slotModelPort.getGameContext().getGameOptionChangedFromPf().subscribe($bind(this, this.handleGameOptionChanged));
            this.slotModelPort.getStages().getInitStage().getInitializeGamePhase().getInitializeGame().subscribe($bind(this, this.handleSlotModelInitGame));
            this.slotModelPort.getStages().getResumeStage().getPrepareResume().subscribe($bind(this, this.handlePrepareResume));
            this.slotModelPort.getStages().getIdleStage().getConfirmSelectedStake().subscribe($bind(this, this.handleConfirmSelectedStake));
            this.slotModelPort.getStages().getIdleStage().getOpenPaytable().subscribe($bind(this, this.handleOpenPaytable));
            this.slotModelPort.getStages().getIdleStage().getOpenHelp().subscribe($bind(this, this.handleOpenHelp));
            this.slotModelPort.getStages().getSpinStage().getStartReelSpin().subscribe($bind(this, this.handleModelSpinStart));
            this.slotModelPort.getStages().getSpinStage().getOutcomePhase().getSpinOutcome().subscribe($bind(this, this.handleSpinOutcome));
            this.slotModelPort.getStages().getSpinStage().getStopReelSpin().subscribe($bind(this, this.handleModelSpinStop));
            this.slotModelPort.getStages().getSpinStage().getOutcomePhase().getPresentSpinOutcome().subscribe($bind(this, this.handleSpinOutcomePresent));
            this.slotModelPort.getStages().getAbortStage().getAbortSpin().subscribe($bind(this, this.handleAbortSpin));
            this.slotModelPort.getStages().getResultStage().getPresentResult().subscribe($bind(this, this.handlePresentResult));
            this.slotModelPort.getStages().getPickerBonusStage().getSelectPickerBonus().subscribe($bind(this, this.handleSelectBonusStage));
            this.slotModelPort.getStages().getPickerBonusStage().getSetPickerIdle().subscribe($bind(this, this.handleSetPickerIdle));
            this.slotModelPort.getGameCommands().getSpinCommandAvailable().subscribe($bind(this, this.handleSpinCommandAvailable));
            this.slotModelPort.getGameCommands().getContinueCommandAvailable().subscribe($bind(this, this.handleContinueCommandAvailable));
            this.slotModelPort.getGameCommands().getPaytableCommandAvailable().subscribe($bind(this, this.handlePaytableCommandAvailable));
            this.slotModelPort.getGameCommands().getStakeCommandAvailable().subscribe($bind(this, this.handleStakeCommandAvailable));
            this.betPanelPort.onButtonPressed().subscribe($bind(this, this.onBetPanelButtonPressed));
            this.betPanelPort.onStakeChanged().subscribe($bind(this, this.onBetPanelStakeChanged));
            this.reelsPort.onReelStopped().subscribe($bind(this, this.onReelStopped));
            this.reelsPort.onSpinStopped().subscribe($bind(this, this.onSpinStopped));
            this.reelsPort.onStoppingStarted().subscribe($bind(this, this.onReelStoppingStarted));
            this.reelsPort.onStartSpinReelPictureExit().subscribe($bind(this, this.onReelOutcomeExit));
            this.winAnimatorPort.getCurrentWin().subscribe($bind(this, this.onWinLineAnimated));
            this.winAnimatorPort.getWinLineCycleAnimated().subscribe($bind(this, this.onWinLineCycleAnimated));
            this.winAnimatorPort.getWinSymbolsCreated().subscribe($bind(this, this.onWinLinesReady));
            this.winMeterPort.onCountUpFinished().subscribe($bind(this, this.finishedBigWinSound));
            this.gameLayoutPort.getGameLayoutUpdated().subscribe($bind(this, this.onGameLayoutUpdated));
            this.paytablePort.onCloseButtonPressed().subscribe($bind(this, this.onPaytableClose));
            this.paytablePort.onPageChanged().subscribe($bind(this, this.onPaytablePageChanged));
            this.winMeterPort.onDisplayWinFinished().subscribe($bind(this, this.onDisplayWinMeterFinished));
            this.reelPickerPort.getChoice().subscribe($bind(this, this.handleReelPickerChoice));
            this.pickerPort.getChoice().subscribe($bind(this, this.handlePickerChoice));
            this.luckMeterPort.getOnFinish().subscribe($bind(this, this.onLuckMeterFinished));
            this.luckMeterPort.getOnStart().subscribe($bind(this, this.onLuckMeterStart));
            window.addEventListener("closePaytable", $bind(this, this.onHTMLPaytableClose));
            window.addEventListener("closeHelp", $bind(this, this.onHelpClose));
            this.pickerPort.getAvailablePicks().subscribe($bind(this, this.handleAvailablePicks));
            this.reelPickerPort.getAvailablePicks().subscribe($bind(this, this.handleAvailableReelPicks));
            this.attachTestToEventBus();
        };
        smashThePigGameController.GameController.prototype.handleAvailablePicks = function(e) {
            haxe.Log.trace("[LN] GameController.handleAvailablePicks: ", {
                fileName: "GameController.hx",
                lineNumber: 304,
                className: "smashthepig.components.gamecontroller.impl.GameController",
                methodName: "handleAvailablePicks",
                customParams: [e.getPayload()]
            });
            var bus = this.moduleContext.getAnyService(clientkernelEventbusApi.IEventBus, null);
            bus.getChannel("GFBus").publish("picker:availablePicks", e.getPayload());
        };
        smashThePigGameController.GameController.prototype.handleAvailableReelPicks = function(e) {
            this.AVAILABLE_PICKS_TEMP = e.getPayload();
        };
        smashThePigGameController.GameController.prototype.handleSetPickerIdle = function(e) {
            this.dispatchEvent(smashThePigGameController.StateMachineDef.SET_PICKER_IDLE);
        };
        smashThePigGameController.GameController.prototype.initGame = function() {
            haxe.Log.trace("[LN] GameController.initGame: ", {
                fileName: "GameController.hx",
                lineNumber: 324,
                className: "smashthepig.components.gamecontroller.impl.GameController",
                methodName: "initGame",
                customParams: [this.model.isResume]
            });
            this.betPanelPort.hideButton().publish(betPanelApi.EButton.SKIP);
            this.bannerPort.startPlayingGroup().publish("idleGroup");
            this.winMeterPort.showMessage().publish("");
            this.soundController.play("startup");
            this.slotModelPort.getStages().getInitStage().getGameInitialized().publish(null);
            this.model.isResume = false;
            haxe.Log.trace("model.isResume: ", {
                fileName: "GameController.hx",
                lineNumber: 334,
                className: "smashthepig.components.gamecontroller.impl.GameController",
                methodName: "initGame",
                customParams: [this.model.isResume]
            });
        };
        smashThePigGameController.GameController.prototype.showScatterWins = function() {
            var outcome = new slotModelApi.Outcome(this.model.outcome.reelStop, null, null, this.model.outcome.scatterWins, this.model.outcome.bonusWins, this.model.outcome.pickerWins, null, this.model.outcome.bigWin, null);
            var showOutcomeOptions = new smashThePigWinAnimatorPort.ShowOutcomeOptions(this.config.winlineInterval, outcome, false, null);
            haxe.Log.trace("[LN] GameController.showScatterWins:outcome: ", {
                fileName: "GameController.hx",
                lineNumber: 342,
                className: "smashthepig.components.gamecontroller.impl.GameController",
                methodName: "showScatterWins",
                customParams: [outcome]
            });
            this.winAnimatorPort.getShowOutcome().publish(showOutcomeOptions);
            this.model.lastAccumulatedPayout = this.model.spinOutcome.acumulatedPayout;
            this.winMeterPort.showMessage().publish("");
            if (!this.moneyFormatter.isZero(this.model.spinOutcome.acumulatedPayout)) this.winMeterPort.displayWin().publish(new winMeterApi.WinMeterPayload(this.model.spinOutcome.acumulatedPayout, this.model.outcome.bigWin.winSegments, true));
            var tempStateName;
            var this1 = this.smContext.get_contextValues();
            tempStateName = this1.get("NextStage");
            if (tempStateName.indexOf("PickerSmashThePig") > -1) {
                this.infoBarPort.showLabel().publish(new infoBarApi.LabelContentPayload(infoBarApi.InfoBarLabelEnum.LEFT, this.translationManager.stringLookup("SmashThePigBonusEnter", [this.moneyFormatter.format(this.model.spinOutcome.pickerBonus.outcome.totalPayout)])));
                this.infoBarPort.showLabel().publish(new infoBarApi.LabelContentPayload(infoBarApi.InfoBarLabelEnum.CENTRAL, this.translationManager.stringLookup("SmashThePigBonusEnter", [this.moneyFormatter.format(this.model.spinOutcome.pickerBonus.outcome.totalPayout)])));
            }
            if (tempStateName.indexOf("PickerPickAPig") > -1) {
                this.infoBarPort.showLabel().publish(new infoBarApi.LabelContentPayload(infoBarApi.InfoBarLabelEnum.LEFT, this.translationManager.stringLookup("PickAPigBonusEnter", [this.moneyFormatter.format(this.model.spinOutcome.pickerBonus.outcome.totalPayout)])));
                this.infoBarPort.showLabel().publish(new infoBarApi.LabelContentPayload(infoBarApi.InfoBarLabelEnum.CENTRAL, this.translationManager.stringLookup("PickAPigBonusEnter", [this.moneyFormatter.format(this.model.spinOutcome.pickerBonus.outcome.totalPayout)])));
            }
        };
        smashThePigGameController.GameController.prototype.onWinLineCycleAnimated = function(e) {
            haxe.Log.trace("[LN] GameController.onWinLineCycleAnimated: ", {
                fileName: "GameController.hx",
                lineNumber: 372,
                className: "smashthepig.components.gamecontroller.impl.GameController",
                methodName: "onWinLineCycleAnimated",
                customParams: [$bind(e, e.getPayload), " currentState: ", this.stateMachine.get_currentStateName()]
            });
            var _g = this.stateMachine.get_currentStateName();
            switch (_g) {
                case "SHOW_SCATTER_WIN":
                    this.dispatchEvent(smashThePigGameController.StateMachineDef.SCATTER_WIN_SHOWN);
                    break;
            }
        };
        smashThePigGameController.GameController.prototype.startPickerBonusIntro = function() {
            haxe.Log.trace("[LN] GameController.startPickerBonusIntro: Stage: ", {
                fileName: "GameController.hx",
                lineNumber: 379,
                className: "smashthepig.components.gamecontroller.impl.GameController",
                methodName: "startPickerBonusIntro",
                customParams: [(function($this) {
                    var $r;
                    var this1 = $this.smContext.get_contextValues();
                    $r = this1.get("Stage");
                    return $r;
                }(this))]
            });
            haxe.Log.trace("[LN] GameController.startPickerBonusIntro: NextStage: ", {
                fileName: "GameController.hx",
                lineNumber: 380,
                className: "smashthepig.components.gamecontroller.impl.GameController",
                methodName: "startPickerBonusIntro",
                customParams: [(function($this) {
                    var $r;
                    var this2 = $this.smContext.get_contextValues();
                    $r = this2.get("NextStage");
                    return $r;
                }(this))]
            });
            var nextStage;
            var this3 = this.smContext.get_contextValues();
            nextStage = this3.get("NextStage");
            if (smashThePigGameController.InternalStageType.PICKER_SMASH_THE_PIG.equals(nextStage)) {
                this.pickerSmashThePigTriggered = true;
                this.initPickerBonus();
            } else if (smashThePigGameController.InternalStageType.PICKER_PIG_A_PIG.equals(nextStage)) {
                this.pickAPigTriggered = true;
                this.initReelPickerBonus();
            }
            this.betPanelPort.disableButton().publish(betPanelApi.EButton.SPIN);
            this.betPanelPort.disableButton().publish(betPanelApi.EButton.PAYTABLE);
            this.betPanelPort.disableButton().publish(betPanelApi.EButton.TOTAL_BET);
        };
        smashThePigGameController.GameController.prototype.initPickerBonus = function() {
            var _g = this;
            haxe.Log.trace("[LN] GameController.initPickerBonus: ", {
                fileName: "GameController.hx",
                lineNumber: 400,
                className: "smashthepig.components.gamecontroller.impl.GameController",
                methodName: "initPickerBonus",
                customParams: [this.model.outcome]
            });
            this.soundController.stopAllSounds().play("STP_bonusIntro");
            this.backgroundPort.prepareBackground().publish(new smashthepigComponentsBackgroundPort.ChangeBackgroundPayload(1));
            this.backgroundPort.getChange().publish(new smashthepigComponentsBackgroundPort.ChangeBackgroundPayload(1));
            var symbols = new _hcmn_.haxe_ds_StringMap();
            var picks = new _hcmn_.haxe_ds_StringMap();
            var _g1 = 0;
            while (_g1 < 7) {
                var i = _g1++;
                var symbolId = _hcmn_.Std.string(i + 1);
                if (_hcmn_.__map_reserved[symbolId] != null) picks.setReserved(symbolId, false);
                else picks.h[symbolId] = false;
                var value = _hcmn_.Std.string(smashThePigGameController.GameController.randomInt(0, 4));
                if (_hcmn_.__map_reserved[symbolId] != null) symbols.setReserved(symbolId, value);
                else symbols.h[symbolId] = value;
            }
            this.pickerPort.getShow().publish(new smashthepigComponentsPickerPort.ShowPickerPayload(symbols));
            this.pickerPort.getState().publish(smashthepigComponentsPickerPort.PickerStateEnum.INTRO);
            this.reelsPort.hide().publish(null);
            this.winAnimatorPort.setVisible().publish(false);
            if (!smashThePigGameController.ExternalService.isMobile()) this.bannerPort.stopPlayingGroup().publish(null);
            this.animationPort.getHide().publishForComponentInstance(this.reelforeground, null);
            this.animationPort.getHide().publishForComponentInstance(this.reelbackground, null);
            _hcmn_.haxe_Timer.delay(function() {
                _g.dispatchEvent(smashThePigGameController.StateMachineDef.PICKER_INTRO_ENDED);
            }, this.config.pb_EntryDuration);
        };
        smashThePigGameController.GameController.prototype.initReelPickerBonus = function() {
            var _g = this;
            haxe.Log.trace("[dex] GameController.initReelPickerBonus.INTRO ", {
                fileName: "GameController.hx",
                lineNumber: 441,
                className: "smashthepig.components.gamecontroller.impl.GameController",
                methodName: "initReelPickerBonus",
                customParams: [this.model.outcome]
            });
            haxe.Log.trace("[dex] GameController.initReelPickerBonus.PICKS OUTCOME: ", {
                fileName: "GameController.hx",
                lineNumber: 442,
                className: "smashthepig.components.gamecontroller.impl.GameController",
                methodName: "initReelPickerBonus",
                customParams: [this.model.spinOutcome.pickerBonus.outcome.pickerWins[0].picks]
            });
            var reelPic = this.model.outcome.reelStopAdditional.reels;
            this.reelPickerPort.getShow().publish(new smashthepigComponentsReelPickerPort.ShowReelPickerPayload(reelPic));
            this.reelPickerPort.getState().publish(smashthepigComponentsReelPickerPort.ReelPickerStateEnum.DISABLE);
            this.reelPickerPort.getState().publish(smashthepigComponentsReelPickerPort.ReelPickerStateEnum.INTRO);
            this.winAnimatorPort.setVisible().publish(false);
            _hcmn_.haxe_Timer.delay(function() {
                _g.dispatchEvent(smashThePigGameController.StateMachineDef.PICKER_INTRO_ENDED);
                _g.reelsPort.hide().publish(null);
                if (!smashThePigGameController.ExternalService.isMobile()) _g.bannerPort.stopPlayingGroup().publish(null);
                _g.soundController.play("STP_scatter_loop");
            }, this.config.rpb_IntroDuration);
        };
        smashThePigGameController.GameController.prototype.handleSelectBonusStage = function(e) {
            haxe.Log.trace("[LN] GameContoller.handleSelectBonusStage: ", {
                fileName: "GameController.hx",
                lineNumber: 471,
                className: "smashthepig.components.gamecontroller.impl.GameController",
                methodName: "handleSelectBonusStage",
                customParams: [e.getPayload()]
            });
            this.dispatchEvent(smashThePigGameController.StateMachineDef.ENTER_PICKER_BONUS);
        };
        smashThePigGameController.GameController.prototype.handleEnterBonus = function() {
            var _g = this;
            haxe.Log.trace("[LN] GameController.handleEnterBonus, stage ", {
                fileName: "GameController.hx",
                lineNumber: 476,
                className: "smashthepig.components.gamecontroller.impl.GameController",
                methodName: "handleEnterBonus",
                customParams: [(function($this) {
                    var $r;
                    var this1 = $this.smContext.get_contextValues();
                    $r = this1.get("Stage");
                    return $r;
                }(this)), " ,nextStage: ", (function($this) {
                    var $r;
                    var this2 = $this.smContext.get_contextValues();
                    $r = this2.get("NextStage");
                    return $r;
                }(this)), " picker: ", this.model.pickerWins, " isResume: ", this.model.isResume]
            });
            if (this.model.retryChoice) {
                _hcmn_.haxe_Timer.delay(function() {
                    var symbolId = _g.model.playerChoice;
                    _g.slotModelPort.getStages().getPickerBonusStage().getPickerBonusSelected().publish(new slotModelApi.Pair(symbolId, symbolId));
                    _g.model.retryChoice = false;
                }, 2000);
                return;
            }
            var nextStage;
            var this3 = this.smContext.get_contextValues();
            nextStage = this3.get("NextStage");
            if (smashThePigGameController.InternalStageType.PICKER_SMASH_THE_PIG.equals(nextStage)) {
                if (this.model.isResume) {
                    this.pickerPort.getState().publish(smashthepigComponentsPickerPort.PickerStateEnum.IDLE);
                    this.displayResumedPickerWin();
                    this.model.isResume = false;
                    if (this.model.pickerWins == null) {
                        var availablePicks = new _hcmn_.haxe_ds_StringMap();
                        var _g1 = 1;
                        while (_g1 < 8) {
                            var i = _g1++;
                            availablePicks.set(i == null ? "null" : "" + i, true);
                        }
                        var bus = this.moduleContext.getAnyService(clientkernelEventbusApi.IEventBus, null);
                        bus.getChannel("GFBus").publish("picker:availablePicks", availablePicks);
                        haxe.Log.trace("[LN] GameController.handleAvailablePicks: ", {
                            fileName: "GameController.hx",
                            lineNumber: 507,
                            className: "smashthepig.components.gamecontroller.impl.GameController",
                            methodName: "handleEnterBonus",
                            customParams: [availablePicks]
                        });
                    }
                } else if (this.model.pickerWins == null) {
                    this.pickerPort.getState().publish(smashthepigComponentsPickerPort.PickerStateEnum.IDLE);
                    var availablePicks1 = new _hcmn_.haxe_ds_StringMap();
                    var _g2 = 1;
                    while (_g2 < 8) {
                        var i1 = _g2++;
                        availablePicks1.set(i1 == null ? "null" : "" + i1, true);
                    }
                    var bus1 = this.moduleContext.getAnyService(clientkernelEventbusApi.IEventBus, null);
                    bus1.getChannel("GFBus").publish("picker:availablePicks", availablePicks1);
                    haxe.Log.trace("[LN] GameController.handleAvailablePicks: ", {
                        fileName: "GameController.hx",
                        lineNumber: 522,
                        className: "smashthepig.components.gamecontroller.impl.GameController",
                        methodName: "handleEnterBonus",
                        customParams: [availablePicks1]
                    });
                }
            } else if (smashThePigGameController.InternalStageType.PICKER_PIG_A_PIG.equals(nextStage)) {
                if (this.model.isResume) {
                    this.reelPickerPort.getState().publish(smashthepigComponentsReelPickerPort.ReelPickerStateEnum.DISABLE);
                    this.reelPickerPort.getState().publish(smashthepigComponentsReelPickerPort.ReelPickerStateEnum.IDLE);
                    this.model.isResume = false;
                    _hcmn_.haxe_Timer.delay(function() {
                        _g.reelPickerPort.getState().publish(smashthepigComponentsReelPickerPort.ReelPickerStateEnum.ENABLE);
                        _g.displayResumedReelPickerWin();
                        var bus2 = _g.moduleContext.getAnyService(clientkernelEventbusApi.IEventBus, null);
                        bus2.getChannel("GFBus").publish("reelPicker:availablePicks", _g.AVAILABLE_PICKS_TEMP);
                        haxe.Log.trace("[LN] GameController.handleAvailablePicks: ", {
                            fileName: "GameController.hx",
                            lineNumber: 543,
                            className: "smashthepig.components.gamecontroller.impl.GameController",
                            methodName: "handleEnterBonus",
                            customParams: [_g.AVAILABLE_PICKS_TEMP]
                        });
                    }, this.config.rpb_ResumeDuration);
                } else if (this.model.pickerWins == null) {
                    this.reelPickerPort.getState().publish(smashthepigComponentsReelPickerPort.ReelPickerStateEnum.IDLE);
                    this.reelPickerPort.getState().publish(smashthepigComponentsReelPickerPort.ReelPickerStateEnum.DISABLE);
                    _hcmn_.haxe_Timer.delay(function() {
                        _g.reelPickerPort.getState().publish(smashthepigComponentsReelPickerPort.ReelPickerStateEnum.ENABLE);
                        var bus3 = _g.moduleContext.getAnyService(clientkernelEventbusApi.IEventBus, null);
                        bus3.getChannel("GFBus").publish("reelPicker:availablePicks", _g.AVAILABLE_PICKS_TEMP);
                        haxe.Log.trace("[LN] GameController.handleAvailablePicks: ", {
                            fileName: "GameController.hx",
                            lineNumber: 556,
                            className: "smashthepig.components.gamecontroller.impl.GameController",
                            methodName: "handleEnterBonus",
                            customParams: [_g.AVAILABLE_PICKS_TEMP]
                        });
                    }, this.config.rpb_ReelUpdateDuration);
                } else {
                    var bus4 = this.moduleContext.getAnyService(clientkernelEventbusApi.IEventBus, null);
                    bus4.getChannel("GFBus").publish("reelPicker:availablePicks", this.AVAILABLE_PICKS_TEMP);
                    haxe.Log.trace("[LN] GameController.handleAvailablePicks: ", {
                        fileName: "GameController.hx",
                        lineNumber: 562,
                        className: "smashthepig.components.gamecontroller.impl.GameController",
                        methodName: "handleEnterBonus",
                        customParams: [this.AVAILABLE_PICKS_TEMP]
                    });
                }
            }
        };
        smashThePigGameController.GameController.prototype.preparePickerBonus = function() {
            var _g2 = this;
            this.reelsPort.hide().publish(null);
            this.infoBarPort.hideLabel().publish(infoBarApi.InfoBarLabelEnum.LEFT);
            var nextStage;
            var this1 = this.smContext.get_contextValues();
            nextStage = this1.get("NextStage");
            haxe.Log.trace("[LN] GameController.prepareReelPicker: bonusType ", {
                fileName: "GameController.hx",
                lineNumber: 575,
                className: "smashthepig.components.gamecontroller.impl.GameController",
                methodName: "preparePickerBonus",
                customParams: [nextStage]
            });
            if (smashThePigGameController.InternalStageType.PICKER_SMASH_THE_PIG.equals(nextStage)) this.pickerPort.getState().publish(smashthepigComponentsPickerPort.PickerStateEnum.ENTRY);
            else if (smashThePigGameController.InternalStageType.PICKER_PIG_A_PIG.equals(nextStage)) {
                this.reelPickerPort.getState().publish(smashthepigComponentsReelPickerPort.ReelPickerStateEnum.DISABLE);
                this.reelPickerPort.getState().publish(smashthepigComponentsReelPickerPort.ReelPickerStateEnum.ENTRY);
                this.reelPickerPort.getUpdateReels().publish(new smashthepigComponentsReelPickerPort.UpdateReelsPickerPayload(1, this.config.rpb_ReelUpdateDuration));
                var reelPickerSymbolsOffset = this.getOffsets(this.model.outcome.reelStopAdditional.reels);
                var _g1 = 0;
                var _g = reelPickerSymbolsOffset.length;
                while (_g1 < _g) {
                    var i = _g1++;
                    if (reelPickerSymbolsOffset[i] != 0) {
                        _hcmn_.haxe_Timer.delay(function() {
                            _g2.soundController.play("reel_stop");
                        }, this.config.rpb_ReelUpdateDuration);
                        break;
                    }
                }
            }
            this.model.setOutcome(this.model.spinOutcome.pickerBonus.outcome);
        };
        smashThePigGameController.GameController.prototype.handleReelPickerChoice = function(e) {
            haxe.Log.trace("[LN] GameController.handleReelPickerChoice: ", {
                fileName: "GameController.hx",
                lineNumber: 604,
                className: "smashthepig.components.gamecontroller.impl.GameController",
                methodName: "handleReelPickerChoice",
                customParams: [e.getPayload()]
            });
            this.model.playerChoice = e.getPayload().playerChoice;
            var symbolId = e.getPayload().playerChoice;
            this.soundController.play("STP_bonuspigsmash" + smashThePigGameController.GameController.randomInt(1, 7));
            this.slotModelPort.getStages().getPickerBonusStage().getPickerBonusSelected().publish(new slotModelApi.Pair(symbolId, symbolId));
            this.soundController.play("med_applause_short");
        };
        smashThePigGameController.GameController.prototype.displayResumedReelPickerWin = function() {
            haxe.Log.trace("[LN] GameController.displayResumedReelPickerWin ", {
                fileName: "GameController.hx",
                lineNumber: 616,
                className: "smashthepig.components.gamecontroller.impl.GameController",
                methodName: "displayResumedReelPickerWin"
            });
            var picks = new _hcmn_.haxe_ds_StringMap();
            if (this.model.pickerWins != null) {
                var _g1 = 0;
                var _g = this.model.pickerWins[0].picks.length;
                while (_g1 < _g) {
                    var j = _g1++;
                    var picked = this.model.pickerWins[0].picks[j].picked;
                    var pickName = this.model.pickerWins[0].picks[j].name;
                    var currentPick = _hcmn_.Std.parseInt(this.model.pickerWins[0].picks[j].name);
                    var state = "OUTCOME_0_END";
                    var payout = smashThePigGameController.ExternalService.moneyFormatter.format(_hcmn_.Std.string(this.model.pickerWins[0].lastPicked.values[0].value));
                    if (this.model.pickerWins[0].picks[j].payout != null) payout = smashThePigGameController.ExternalService.moneyFormatter.format(_hcmn_.Std.string(this.model.pickerWins[0].picks[j].payout.value));
                    var currentPickKey = this.model.pickerWins[0].picks[j].values[0].key;
                    if (currentPickKey == "credits") state = "OUTCOME_0";
                    else if (currentPickKey == "extraPick") state = "OUTCOME_1";
                    else if (currentPickKey == "collectLevel") {
                        state = "OUTCOME_2";
                        payout = this.translationManager.stringLookup("PickerWinAllOutcomeLabel");
                    } else if (currentPickKey == "trigger") {
                        state = "OUTCOME_2";
                        payout = this.translationManager.stringLookup("PickerBonusOutcomeLabel");
                    }
                    var reelPickerSummary = new smashthepigComponentsReelPickerPort.ReelPickerSummaryPayload(currentPick, payout, state, false);
                    this.reelPickerPort.getSummary().publish(reelPickerSummary);
                    if (_hcmn_.__map_reserved[pickName] != null) picks.setReserved(pickName, false);
                    else picks.h[pickName] = false;
                }
            }
            this.reelPickerPort.getPicks().publish(picks);
        };
        smashThePigGameController.GameController.prototype.displayResumedPickerWin = function() {
            haxe.Log.trace("[LN] GameController.displayResumedPickerWin", {
                fileName: "GameController.hx",
                lineNumber: 656,
                className: "smashthepig.components.gamecontroller.impl.GameController",
                methodName: "displayResumedPickerWin"
            });
            var state = "1";
            if (this.model.pickerWins != null) {
                var _g1 = 0;
                var _g = this.model.pickerWins[0].picks.length;
                while (_g1 < _g) {
                    var j = _g1++;
                    var picked = this.model.pickerWins[0].picks[j].picked;
                    var pickName = this.model.pickerWins[0].picks[j].name;
                    var pickedKey = this.model.pickerWins[0].picks[j].values[0].key;
                    if (pickedKey == "credits") state = "1";
                    else if (pickedKey == "extraPick") state = "1";
                    else if (pickedKey == "collectLevel") state = "2";
                    var payout = smashThePigGameController.ExternalService.moneyFormatter.format(this.model.pickerWins[0].picks[j].payout.value);
                    var pickerSummary = new smashthepigComponentsPickerPort.PickerSummaryPayload(pickName, payout, "OUTCOME_" + state);
                    this.pickerPort.getSummary().publish(pickerSummary);
                }
                var picks = new _hcmn_.haxe_ds_StringMap();
                var _g11 = 0;
                var _g2 = this.model.pickerWins[0].picks.length;
                while (_g11 < _g2) {
                    var j1 = _g11++;
                    var pickName1 = this.model.pickerWins[0].picks[j1].name;
                    picks.set(pickName1, this.model.pickerWins[0].picks[j1].picked);
                }
                this.pickerPort.getPicks().publish(picks);
            }
        };
        smashThePigGameController.GameController.prototype.handlePickerChoice = function(e) {
            var _g = this;
            haxe.Log.trace("[LN] GameController.handlePickerChoice: ", {
                fileName: "GameController.hx",
                lineNumber: 685,
                className: "smashthepig.components.gamecontroller.impl.GameController",
                methodName: "handlePickerChoice",
                customParams: [e.getPayload()]
            });
            this.model.playerChoice = e.getPayload().playerChoice;
            if (this.model.playerChoice == -1) _hcmn_.haxe_Timer.delay(function() {
                _g.soundController.play("STP_bonuspigsmash" + smashThePigGameController.GameController.randomInt(1, 7));
            }, 200);
            else {
                this.slotModelPort.getStages().getPickerBonusStage().getPickerBonusSelected().publish(new slotModelApi.Pair(this.model.playerChoice, this.model.playerChoice));
                this.soundController.play("med_applause_short");
            }
        };
        smashThePigGameController.GameController.prototype.showBonusOutcome = function() {
            var currentStage;
            var this1 = this.smContext.get_contextValues();
            currentStage = this1.get("Stage");
            var awardCap;
            var this2 = this.smContext.get_contextValues();
            awardCap = this2.get("awardCapExceeded");
            haxe.Log.trace("[LN] GameController.showBonusOutcome.currentStage: ", {
                fileName: "GameController.hx",
                lineNumber: 705,
                className: "smashthepig.components.gamecontroller.impl.GameController",
                methodName: "showBonusOutcome",
                customParams: [currentStage, " nextStage: ", (function($this) {
                    var $r;
                    var this3 = $this.smContext.get_contextValues();
                    $r = this3.get("NextStage");
                    return $r;
                }(this)), " awardCap: ", (function($this) {
                    var $r;
                    var this4 = $this.smContext.get_contextValues();
                    $r = this4.get("awardCapExceeded");
                    return $r;
                }(this))]
            });
            if (!awardCap) {
                if (smashThePigGameController.InternalStageType.PICKER_SMASH_THE_PIG.equals(currentStage)) this.displayPickerWin();
                else if (smashThePigGameController.InternalStageType.PICKER_PIG_A_PIG.equals(currentStage)) {
                    if ((function($this) {
                            var $r;
                            var this5 = $this.smContext.get_contextValues();
                            $r = this5.get("NextStage");
                            return $r;
                        }(this)) == "PickerSmashThePig") this.displayExtraBonusWin();
                    else this.displayReelPickerWin();
                }
                this.handleSelected(_hcmn_.Std.parseInt(this.model.pickerWins[0].lastPicked.name));
            } else haxe.Log.trace("[LN] GameController.showBonusOutcome.awardCapExceeded", {
                fileName: "GameController.hx",
                lineNumber: 724,
                className: "smashthepig.components.gamecontroller.impl.GameController",
                methodName: "showBonusOutcome"
            });
        };
        smashThePigGameController.GameController.prototype.displayExtraBonusWin = function() {
            var _g = this;
            this.handleReelPickerStateChange();
            _hcmn_.haxe_Timer.delay(function() {
                _g.initPickerBonus();
                _g.reelPickerPort.getVisible().publish(false);
                _hcmn_.haxe_Timer.delay(function() {
                    _g.pickerPort.getState().publish(smashthepigComponentsPickerPort.PickerStateEnum.IDLE);
                    var availablePicks = new _hcmn_.haxe_ds_StringMap();
                    var _g1 = 1;
                    while (_g1 < 8) {
                        var i = _g1++;
                        availablePicks.set(i == null ? "null" : "" + i, true);
                    }
                    var bus = _g.moduleContext.getAnyService(clientkernelEventbusApi.IEventBus, null);
                    bus.getChannel("GFBus").publish("picker:availablePicks", availablePicks);
                    haxe.Log.trace("[LN] GameController.handleAvailablePicks: ", {
                        fileName: "GameController.hx",
                        lineNumber: 754,
                        className: "smashthepig.components.gamecontroller.impl.GameController",
                        methodName: "displayExtraBonusWin",
                        customParams: [availablePicks]
                    });
                }, _g.config.pb_MorePicksDuration);
            }, this.config.pb_EndDuration);
        };
        smashThePigGameController.GameController.prototype.displayReelPickerWin = function() {
            var _g = this;
            haxe.Log.trace("[LN] GameController.displayReelPickerWin:lastPicked ", {
                fileName: "GameController.hx",
                lineNumber: 762,
                className: "smashthepig.components.gamecontroller.impl.GameController",
                methodName: "displayReelPickerWin",
                customParams: [this.model.pickerWins[0].lastPicked]
            });
            haxe.Log.trace("[LN] GameController.displayReelPickerWin:picks      ", {
                fileName: "GameController.hx",
                lineNumber: 763,
                className: "smashthepig.components.gamecontroller.impl.GameController",
                methodName: "displayReelPickerWin",
                customParams: [this.model.pickerWins[0].picks]
            });
            var picks = new _hcmn_.haxe_ds_StringMap();
            var _g1 = 0;
            var _g2 = this.model.pickerWins[0].picks.length;
            while (_g1 < _g2) {
                var j = _g1++;
                var pickName = this.model.pickerWins[0].picks[j].name;
                picks.set(pickName, this.model.pickerWins[0].picks[j].picked);
            }
            var lastPick = _hcmn_.Std.parseInt(this.model.pickerWins[0].lastPicked.name);
            var currentState = "OUTCOME_0";
            var pickedKey = this.model.pickerWins[0].lastPicked.values[0].key;
            var payout = this.translationManager.stringLookup("PickerWinAllOutcomeLabel");
            if (this.model.pickerWins[0].lastPicked.payout != null) payout = smashThePigGameController.ExternalService.moneyFormatter.format(this.model.pickerWins[0].lastPicked.payout.value);
            if (pickedKey == "credits") {
                currentState = "OUTCOME_2";
                _hcmn_.haxe_Timer.delay(function() {
                    _g.winMeterPort.displayWin().publish(new winMeterApi.WinMeterPayload(_g.model.spinOutcome.acumulatedPayout, null, true));
                }, this.config.rpb_ReelUpdateDuration);
            } else if (pickedKey == "extraPick") {
                currentState = "OUTCOME_1";
                _hcmn_.haxe_Timer.delay(function() {
                    _g.winMeterPort.displayWin().publish(new winMeterApi.WinMeterPayload(_g.model.spinOutcome.acumulatedPayout, null, true));
                }, this.config.rpb_ReelUpdateDuration);
            } else if (pickedKey == "collectLevel") {
                currentState = "OUTCOME_2";
                payout = this.translationManager.stringLookup("PickerWinAllOutcomeLabel");
            } else if (pickedKey == "trigger") {
                currentState = "OUTCOME_2";
                payout = this.translationManager.stringLookup("PickerBonusOutcomeLabel");
            }
            picks.set(lastPick == null ? "null" : "" + lastPick, false);
            var reelPickerSummary = new smashthepigComponentsReelPickerPort.ReelPickerSummaryPayload(lastPick, payout, currentState, false);
            this.reelPickerPort.getSummary().publish(reelPickerSummary);
            this.luckMeterPort.getStartMeasure().publish(new smashthepigComponentsLuckMeterPort.LuckMeterPayload(this.progressMeterValue | 0));
            this.reelPickerPort.getPicks().publish(picks);
            if (this.model.pickerWins[0].lastPicked.values[0].key == "collectLevel") {
                var _g11 = 0;
                var _g3 = this.model.pickerWins[0].picks.length;
                while (_g11 < _g3) {
                    var j1 = _g11++;
                    var pickName1 = this.model.pickerWins[0].picks[j1].name;
                    var currentPick = _hcmn_.Std.parseInt(this.model.pickerWins[0].picks[j1].name);
                    var payout1 = this.translationManager.stringLookup("PickerWinAllOutcomeLabel");
                    if (this.model.pickerWins[0].picks[j1].payout != null) payout1 = smashThePigGameController.ExternalService.moneyFormatter.format(_hcmn_.Std.string(this.model.pickerWins[0].picks[j1].payout.value));
                    var endState = "OUTCOME_2_END";
                    if (pickedKey == "credits") endState = "OUTCOME_0";
                    else if (pickedKey == "extraPick") endState = "OUTCOME_1";
                    else if (pickedKey == "collectLevel") endState = "OUTCOME_2";
                    else if (pickedKey == "bonus") endState = "OUTCOME_2";
                    var reelPickerSummary1 = new smashthepigComponentsReelPickerPort.ReelPickerSummaryPayload(currentPick, payout1, endState, false);
                    this.reelPickerPort.getSummary().publish(reelPickerSummary1);
                }
            }
            var _g12 = 0;
            var _g4 = this.model.pickerWins[0].picks.length;
            while (_g12 < _g4) {
                var j2 = _g12++;
                var pickName2 = this.model.pickerWins[0].picks[j2].name;
                if (_hcmn_.__map_reserved[pickName2] != null) picks.setReserved(pickName2, false);
                else picks.h[pickName2] = false;
            }
            this.reelPickerPort.getPicks().publish(picks);
        };
        smashThePigGameController.GameController.prototype.displayPickerWin = function() {
            var _g = this;
            haxe.Log.trace("[LN] GameController.displayPickerWin: stage: ", {
                fileName: "GameController.hx",
                lineNumber: 846,
                className: "smashthepig.components.gamecontroller.impl.GameController",
                methodName: "displayPickerWin",
                customParams: [(function($this) {
                    var $r;
                    var this1 = $this.smContext.get_contextValues();
                    $r = this1.get("Stage");
                    return $r;
                }(this)), " nextStage: ", (function($this) {
                    var $r;
                    var this2 = $this.smContext.get_contextValues();
                    $r = this2.get("NextStage");
                    return $r;
                }(this))]
            });
            haxe.Log.trace("[LN] GameController.displayPickerWin: picks ", {
                fileName: "GameController.hx",
                lineNumber: 847,
                className: "smashthepig.components.gamecontroller.impl.GameController",
                methodName: "displayPickerWin",
                customParams: [this.model.pickerWins[0].picks]
            });
            haxe.Log.trace("[LN] GameController.displayPickerWin: lastPicked ", {
                fileName: "GameController.hx",
                lineNumber: 848,
                className: "smashthepig.components.gamecontroller.impl.GameController",
                methodName: "displayPickerWin",
                customParams: [this.model.pickerWins[0].lastPicked]
            });
            var payout = "";
            if (this.model.pickerWins[0].lastPicked.payout != null) payout = smashThePigGameController.ExternalService.moneyFormatter.format(this.model.pickerWins[0].lastPicked.payout.value);
            else payout = this.translationManager.stringLookup("PickerWinAllOutcomeLabel");
            if (this.model.pickerWins[0].lastPicked.picked) {
                var lastPick = this.model.pickerWins[0].lastPicked.name;
                var pickerSummary = new smashthepigComponentsPickerPort.PickerSummaryPayload(lastPick, payout, this.getLastPickState());
                this.pickerPort.getSummary().publish(pickerSummary);
            }
            if ((function($this) {
                    var $r;
                    var this3 = $this.smContext.get_contextValues();
                    $r = this3.get("Stage");
                    return $r;
                }(this)) == "PickerSmashThePig" && (function($this) {
                    var $r;
                    var this4 = $this.smContext.get_contextValues();
                    $r = this4.get("NextStage");
                    return $r;
                }(this)) == "PickerSmashThePig2") this.displayMorePicks();
            else if ((function($this) {
                    var $r;
                    var this5 = $this.smContext.get_contextValues();
                    $r = this5.get("Stage");
                    return $r;
                }(this)) == "PickerSmashThePig2" && (function($this) {
                    var $r;
                    var this6 = $this.smContext.get_contextValues();
                    $r = this6.get("NextStage");
                    return $r;
                }(this)) == "PickerSmashThePig3") this.displayMorePicks();
            else if ((function($this) {
                    var $r;
                    var this7 = $this.smContext.get_contextValues();
                    $r = this7.get("Stage");
                    return $r;
                }(this)) == "PickerSmashThePig3" && (function($this) {
                    var $r;
                    var this8 = $this.smContext.get_contextValues();
                    $r = this8.get("NextStage");
                    return $r;
                }(this)) == "PickerSmashThePig4") this.displayMorePicks();
            else if ((function($this) {
                    var $r;
                    var this9 = $this.smContext.get_contextValues();
                    $r = this9.get("Stage");
                    return $r;
                }(this)) == "PickerSmashThePig4" && (function($this) {
                    var $r;
                    var this10 = $this.smContext.get_contextValues();
                    $r = this10.get("NextStage");
                    return $r;
                }(this)) == "PickerSmashThePig5") this.displayMorePicks();
            else if ((function($this) {
                    var $r;
                    var this11 = $this.smContext.get_contextValues();
                    $r = this11.get("Stage");
                    return $r;
                }(this)) == "PickerSmashThePig5" && (function($this) {
                    var $r;
                    var this12 = $this.smContext.get_contextValues();
                    $r = this12.get("NextStage");
                    return $r;
                }(this)) == "PickerSmashThePig4") this.displayMorePicks();
            else if ((function($this) {
                    var $r;
                    var this13 = $this.smContext.get_contextValues();
                    $r = this13.get("Stage");
                    return $r;
                }(this)) == "PickerSmashThePig4" && (function($this) {
                    var $r;
                    var this14 = $this.smContext.get_contextValues();
                    $r = this14.get("NextStage");
                    return $r;
                }(this)) == "PickerSmashThePig3") this.displayMorePicks();
            else if ((function($this) {
                    var $r;
                    var this15 = $this.smContext.get_contextValues();
                    $r = this15.get("Stage");
                    return $r;
                }(this)) == "PickerSmashThePig3" && (function($this) {
                    var $r;
                    var this16 = $this.smContext.get_contextValues();
                    $r = this16.get("NextStage");
                    return $r;
                }(this)) == "PickerSmashThePig2") this.displayMorePicks();
            else if ((function($this) {
                    var $r;
                    var this17 = $this.smContext.get_contextValues();
                    $r = this17.get("Stage");
                    return $r;
                }(this)) == "PickerSmashThePig2" && (function($this) {
                    var $r;
                    var this18 = $this.smContext.get_contextValues();
                    $r = this18.get("NextStage");
                    return $r;
                }(this)) == "PickerSmashThePig1") this.displayMorePicks();
            this.luckMeterPort.getStartMeasure().publish(new smashthepigComponentsLuckMeterPort.LuckMeterPayload(this.progressMeterValue | 0));
            _hcmn_.haxe_Timer.delay(function() {
                haxe.Log.trace("[LN] GameController.displayPickerWin: publishPicks [500ms TIMER AFTER PICKER WIN RESPONSE]", {
                    fileName: "GameController.hx",
                    lineNumber: 890,
                    className: "smashthepig.components.gamecontroller.impl.GameController",
                    methodName: "displayPickerWin"
                });
                var picks = new _hcmn_.haxe_ds_StringMap();
                var _g2 = 0;
                var _g1 = _g.model.pickerWins[0].picks.length;
                while (_g2 < _g1) {
                    var j = _g2++;
                    var pickName = _g.model.pickerWins[0].picks[j].name;
                    picks.set(pickName, _g.model.pickerWins[0].picks[j].picked);
                }
                _g.pickerPort.getPicks().publish(picks);
            }, 200);
            _hcmn_.haxe_Timer.delay(function() {
                _g.winMeterPort.displayWin().publish(new winMeterApi.WinMeterPayload(_g.model.spinOutcome.acumulatedPayout, null, true));
            }, 500);
        };
        smashThePigGameController.GameController.prototype.displayMorePicks = function() {
            var _g = this;
            haxe.Log.trace("[LN] GameController.displayMorePicks ", {
                fileName: "GameController.hx",
                lineNumber: 908,
                className: "smashthepig.components.gamecontroller.impl.GameController",
                methodName: "displayMorePicks"
            });
            var state = "1";
            var _g1 = 0;
            var _g2 = this.model.pickerWins[0].picks.length;
            while (_g1 < _g2) {
                var j = _g1++;
                var picked = this.model.pickerWins[0].picks[j].picked;
                var pickName = this.model.pickerWins[0].picks[j].name;
                if (!picked) {
                    var pickName1 = this.model.pickerWins[0].picks[j].name;
                    var pickedKey = this.model.pickerWins[0].picks[j].values[0].key;
                    if (pickedKey == "credits") state = "0";
                    else if (pickedKey == "extraPick") state = "1";
                    else if (pickedKey == "collectLevel") state = "2";
                    var payout = smashThePigGameController.ExternalService.moneyFormatter.format(this.model.pickerWins[0].picks[j].payout.value);
                    var pickerSummary = new smashthepigComponentsPickerPort.PickerSummaryPayload(pickName1, payout, "OUTCOME_" + state);
                    this.pickerPort.getSummary().publish(pickerSummary);
                }
            }
            _hcmn_.haxe_Timer.delay(function() {
                _g.pickerPort.getState().publish(smashthepigComponentsPickerPort.PickerStateEnum.CONTINUE);
                _hcmn_.haxe_Timer.delay(function() {
                    _g.pickerPort.getState().publish(smashthepigComponentsPickerPort.PickerStateEnum.EXTENDED_ENTRY);
                    _hcmn_.haxe_Timer.delay(function() {
                        _g.pickerPort.getState().publish(smashthepigComponentsPickerPort.PickerStateEnum.IDLE);
                        var availablePicks = new _hcmn_.haxe_ds_StringMap();
                        var _g11 = 1;
                        while (_g11 < 8) {
                            var i = _g11++;
                            availablePicks.set(i == null ? "null" : "" + i, true);
                        }
                        var bus = _g.moduleContext.getAnyService(clientkernelEventbusApi.IEventBus, null);
                        bus.getChannel("GFBus").publish("picker:availablePicks", availablePicks);
                        haxe.Log.trace("[LN] GameController.handleAvailablePicks: ", {
                            fileName: "GameController.hx",
                            lineNumber: 948,
                            className: "smashthepig.components.gamecontroller.impl.GameController",
                            methodName: "displayMorePicks",
                            customParams: [availablePicks]
                        });
                    }, _g.config.pb_IdleDuration);
                }, _g.config.pb_EntryDuration);
            }, this.config.pb_MorePicksDuration);
        };
        smashThePigGameController.GameController.prototype.publishSpinOutcomePresented = function() {
            haxe.Log.trace("[LN] GameController.publishSpinOutcomePresented", {
                fileName: "GameController.hx",
                lineNumber: 957,
                className: "smashthepig.components.gamecontroller.impl.GameController",
                methodName: "publishSpinOutcomePresented"
            });
            this.slotModelPort.getStages().getSpinStage().getOutcomePhase().getSpinOutcomePresented().publish(null);
        };
        smashThePigGameController.GameController.prototype.startBonusOutroAnim = function() {
            haxe.Log.trace("[LN] GameController.startBonusOutroAnim : stage: ", {
                fileName: "GameController.hx",
                lineNumber: 962,
                className: "smashthepig.components.gamecontroller.impl.GameController",
                methodName: "startBonusOutroAnim",
                customParams: [(function($this) {
                    var $r;
                    var this1 = $this.smContext.get_contextValues();
                    $r = this1.get("Stage");
                    return $r;
                }(this)), " nextStage: ", (function($this) {
                    var $r;
                    var this2 = $this.smContext.get_contextValues();
                    $r = this2.get("NextStage");
                    return $r;
                }(this))]
            });
            var bonusType;
            var this3 = this.smContext.get_contextValues();
            bonusType = this3.get("Stage");
            if (smashThePigGameController.InternalStageType.PICKER_SMASH_THE_PIG.equals(bonusType)) this.startPickerOutroAnim();
            else if (smashThePigGameController.InternalStageType.PICKER_PIG_A_PIG.equals(bonusType)) this.startReelPickerOutroAnim();
            this.luckMeterPort.getStartMeasure().publish(new smashthepigComponentsLuckMeterPort.LuckMeterPayload(0));
        };
        smashThePigGameController.GameController.prototype.startReelPickerOutroAnim = function() {
            var _g = this;
            haxe.Log.trace("[LN] GameController.startReelPickerOutroAnim:picks      ", {
                fileName: "GameController.hx",
                lineNumber: 974,
                className: "smashthepig.components.gamecontroller.impl.GameController",
                methodName: "startReelPickerOutroAnim",
                customParams: [this.model.pickerWins[0].picks]
            });
            haxe.Log.trace("[LN] GameController.startReelPickerOutroAnim:pickerWins ", {
                fileName: "GameController.hx",
                lineNumber: 975,
                className: "smashthepig.components.gamecontroller.impl.GameController",
                methodName: "startReelPickerOutroAnim",
                customParams: [this.model.pickerWins[0]]
            });
            haxe.Log.trace("[LN] GameController.startReelPickerOutroAnim:lastPicked ", {
                fileName: "GameController.hx",
                lineNumber: 976,
                className: "smashthepig.components.gamecontroller.impl.GameController",
                methodName: "startReelPickerOutroAnim",
                customParams: [this.model.pickerWins[0].lastPicked]
            });
            _hcmn_.haxe_Timer.delay(function() {
                var picks = new _hcmn_.haxe_ds_StringMap();
                var _g2 = 0;
                var _g1 = _g.model.pickerWins[0].picks.length;
                while (_g2 < _g1) {
                    var j = _g2++;
                    var pickName = _g.model.pickerWins[0].picks[j].name;
                    if (_hcmn_.__map_reserved[pickName] != null) picks.setReserved(pickName, false);
                    else picks.h[pickName] = false;
                }
                var lastPickKey = _g.model.pickerWins[0].lastPicked.values[0].key;
                if (lastPickKey != "collectLevel") {
                    var _g21 = 0;
                    var _g11 = _g.model.pickerWins[0].picks.length;
                    while (_g21 < _g11) {
                        var j1 = _g21++;
                        var picked = _g.model.pickerWins[0].picks[j1].picked;
                        var pickName1 = _g.model.pickerWins[0].picks[j1].name;
                        if (!picked) {
                            var currentPick = _hcmn_.Std.parseInt(_g.model.pickerWins[0].picks[j1].name);
                            var state = "OUTCOME_0_END";
                            var payout = smashThePigGameController.ExternalService.moneyFormatter.format(_hcmn_.Std.string(_g.model.pickerWins[0].lastPicked.values[0].value));
                            if (_g.model.pickerWins[0].picks[j1].payout != null) payout = smashThePigGameController.ExternalService.moneyFormatter.format(_hcmn_.Std.string(_g.model.pickerWins[0].picks[j1].payout.value));
                            var currentPickKey = _g.model.pickerWins[0].picks[j1].values[0].key;
                            if (currentPickKey == "credits") state = "OUTCOME_0_END";
                            else if (currentPickKey == "extraPick") state = "OUTCOME_1_END";
                            else if (currentPickKey == "collectLevel") {
                                state = "OUTCOME_2_END";
                                payout = _g.translationManager.stringLookup("PickerWinAllOutcomeLabel");
                            } else if (currentPickKey == "trigger") {
                                state = "OUTCOME_2_END";
                                payout = _g.translationManager.stringLookup("PickerBonusOutcomeLabel");
                            }
                            var reelPickerSummary = new smashthepigComponentsReelPickerPort.ReelPickerSummaryPayload(currentPick, payout, state, false);
                            _g.reelPickerPort.getSummary().publish(reelPickerSummary);
                            _g.reelPickerPort.getPicks().publish(picks);
                        }
                    }
                }
                _g.reelPickerPort.getState().publish(smashthepigComponentsReelPickerPort.ReelPickerStateEnum.DISABLE);
                _g.soundController.stopAllSounds().play("STP_scatter_ender");
                _hcmn_.haxe_Timer.delay(function() {
                    _g.reelPickerPort.getUpdateReels().publish(new smashthepigComponentsReelPickerPort.UpdateReelsPickerPayload(0, _g.config.rpb_ReelUpdateOutroDuration));
                    _hcmn_.haxe_Timer.delay(function() {
                        _g.infoBarPort.hideWinLineSummary().publish(null);
                        _g.infoBarPort.hideLabel().publish(infoBarApi.InfoBarLabelEnum.RIGHT);
                        _g.infoBarPort.hideLabel().publish(infoBarApi.InfoBarLabelEnum.LEFT);
                        _g.reelsPort.show().publish(null);
                        _g.reelsPort.setReelCellsVisibility().publish(_g.model.getVisibilityForScatterWins());
                        _g.winAnimatorPort.setVisible().publish(true);
                        _g.reelPickerPort.getHide().publish(new smashthepigComponentsReelPickerPort.HideReelPickerPayload(true));
                        _g.dispatchEvent(smashThePigGameController.StateMachineDef.PICKER_OUTRO_END);
                        _g.soundController.fadeOut("STP_scatter_ender", 1000);
                        _g.progressMeterValue = 0;
                        _g.luckMeterPort.getStartMeasure().publish(new smashthepigComponentsLuckMeterPort.LuckMeterPayload(_g.progressMeterValue | 0));
                        _g.bannerPort.startPlayingGroup().publish("idleGroup");
                        _g.model.resetPickerWins();
                    }, _g.config.rpb_ReelUpdateDuration);
                }, _g.config.rpb_EndDuration);
            }, this.config.rpb_SummaryDuration);
        };
        smashThePigGameController.GameController.prototype.handleReelPickerStateChange = function() {
            var _g2 = this;
            haxe.Log.trace("[LN] GameController.handleReelPickerStateChange:lastPicked   ", {
                fileName: "GameController.hx",
                lineNumber: 1061,
                className: "smashthepig.components.gamecontroller.impl.GameController",
                methodName: "handleReelPickerStateChange",
                customParams: [this.model.pickerWins[0].lastPicked]
            });
            haxe.Log.trace("[LN] GameController.handleReelPickerStateChange:picks  ", {
                fileName: "GameController.hx",
                lineNumber: 1062,
                className: "smashthepig.components.gamecontroller.impl.GameController",
                methodName: "handleReelPickerStateChange",
                customParams: [this.model.pickerWins[0].picks]
            });
            var picks = new _hcmn_.haxe_ds_StringMap();
            var pickedSymbol = 0;
            var _g1 = 0;
            var _g = this.model.pickerWins[0].picks.length;
            while (_g1 < _g) {
                var j = _g1++;
                var pickName = this.model.pickerWins[0].picks[j].name;
                if (_hcmn_.__map_reserved[pickName] != null) picks.setReserved(pickName, false);
                else picks.h[pickName] = false;
            }
            this.reelPickerPort.getPicks().publish(picks);
            if (this.model.pickerWins[0].lastPicked.values[0].key == "trigger") {
                var lastPickName = _hcmn_.Std.parseInt(this.model.pickerWins[0].lastPicked.name);
                var payout = this.translationManager.stringLookup("PickerBonusOutcomeLabel");
                var state = "OUTCOME_2";
                var triggerPickSummary = new smashthepigComponentsReelPickerPort.ReelPickerSummaryPayload(lastPickName, payout, state, false);
                this.reelPickerPort.getSummary().publish(triggerPickSummary);
                this.reelPickerPort.getPicks().publish(picks);
                var _g11 = 0;
                var _g3 = this.model.pickerWins[0].picks.length;
                while (_g11 < _g3) {
                    var j1 = [_g11++];
                    var picked = this.model.pickerWins[0].picks[j1[0]].picked;
                    var pickName1 = this.model.pickerWins[0].picks[j1[0]].name;
                    if (!picked) _hcmn_.haxe_Timer.delay((function(j1) {
                        return function() {
                            var currentPickName = _hcmn_.Std.parseInt(_g2.model.pickerWins[0].picks[j1[0]].name);
                            var endState = "OUTCOME_0_END";
                            var endPayout = _g2.translationManager.stringLookup("PickerWinAllOutcomeLabel");
                            if (_g2.model.pickerWins[0].picks[j1[0]].payout != null) endPayout = smashThePigGameController.ExternalService.moneyFormatter.format(_hcmn_.Std.string(_g2.model.pickerWins[0].picks[j1[0]].payout.value));
                            var currentPickKey = _g2.model.pickerWins[0].picks[j1[0]].values[0].key;
                            if (currentPickKey == "credits") endState = "OUTCOME_0_END";
                            else if (currentPickKey == "extraPick") endState = "OUTCOME_1_END";
                            else if (currentPickKey == "collectLevel") {
                                endState = "OUTCOME_2_END";
                                endPayout = _g2.translationManager.stringLookup("PickerWinAllOutcomeLabel");
                            } else if (currentPickKey == "trigger") {
                                endState = "OUTCOME_2_END";
                                endPayout = _g2.translationManager.stringLookup("PickerBonusOutcomeLabel");
                            }
                            var reelPickerSummary = new smashthepigComponentsReelPickerPort.ReelPickerSummaryPayload(currentPickName, endPayout, endState, false);
                            _g2.reelPickerPort.getSummary().publish(reelPickerSummary);
                            _g2.reelPickerPort.getPicks().publish(picks);
                        };
                    })(j1), this.config.rpb_SummaryDuration);
                }
            } else {
                var _g12 = 0;
                var _g4 = this.model.pickerWins[0].picks.length;
                while (_g12 < _g4) {
                    var j2 = _g12++;
                    pickedSymbol = _hcmn_.Std.parseInt(this.model.pickerWins[0].picks[j2].name);
                    var pickedKey = this.model.pickerWins[0].picks[j2].values[0].key;
                    var payout1 = "";
                    if (this.model.pickerWins[0].picks[j2].payout != null) payout1 = smashThePigGameController.ExternalService.moneyFormatter.format(this.model.pickerWins[0].picks[j2].payout.value);
                    var state1 = "OUTCOME_2";
                    if (pickedKey == "extraPick") state1 = "OUTCOME_1";
                    else if (pickedKey == "collectLevel") {
                        state1 = "OUTCOME_2";
                        payout1 = this.translationManager.stringLookup("PickerWinAllOutcomeLabel");
                    } else if (pickedKey == "trigger") {
                        state1 = "OUTCOME_2";
                        payout1 = this.translationManager.stringLookup("PickerBonusOutcomeLabel");
                    }
                    var reelPickerSummary1 = new smashthepigComponentsReelPickerPort.ReelPickerSummaryPayload(pickedSymbol, payout1, state1, false);
                    this.reelPickerPort.getSummary().publish(reelPickerSummary1);
                }
            }
            _hcmn_.haxe_Timer.delay(function() {
                haxe.Log.trace("[LN] GameController.HideReelPickerPayload", {
                    fileName: "GameController.hx",
                    lineNumber: 1145,
                    className: "smashthepig.components.gamecontroller.impl.GameController",
                    methodName: "handleReelPickerStateChange"
                });
                _g2.animationPort.getHide().publishForComponentInstance(_g2.reelforeground, null);
                _g2.animationPort.getHide().publishForComponentInstance(_g2.reelbackground, null);
                _g2.reelPickerPort.getHide().publish(new smashthepigComponentsReelPickerPort.HideReelPickerPayload(true));
                _g2.infoBarPort.showLabel().publish(new infoBarApi.LabelContentPayload(infoBarApi.InfoBarLabelEnum.CENTRAL, _g2.translationManager.stringLookup("SmashThePigBonusEnter")));
            }, this.config.rpb_OutroDuration);
        };
        smashThePigGameController.GameController.prototype.startPickerOutroAnim = function() {
            var _g = this;
            haxe.Log.trace("[LN] GameController.startPickerOutroAnim:picks ", {
                fileName: "GameController.hx",
                lineNumber: 1156,
                className: "smashthepig.components.gamecontroller.impl.GameController",
                methodName: "startPickerOutroAnim",
                customParams: [this.model.pickerWins[0].picks]
            });
            _hcmn_.haxe_Timer.delay(function() {
                var picks = new _hcmn_.haxe_ds_StringMap();
                var _g2 = 0;
                var _g1 = _g.model.pickerWins[0].picks.length;
                while (_g2 < _g1) {
                    var j = _g2++;
                    var pickName = _g.model.pickerWins[0].picks[j].name;
                    if (_hcmn_.__map_reserved[pickName] != null) picks.setReserved(pickName, false);
                    else picks.h[pickName] = false;
                }
                var state = "1";
                var _g21 = 0;
                var _g11 = _g.model.pickerWins[0].picks.length;
                while (_g21 < _g11) {
                    var j1 = _g21++;
                    var picked = _g.model.pickerWins[0].picks[j1].picked;
                    var pickName1 = _g.model.pickerWins[0].picks[j1].name;
                    var payout = smashThePigGameController.ExternalService.moneyFormatter.format(_g.model.pickerWins[0].picks[j1].payout.value);
                    if (!picked) {
                        var pickName2 = _g.model.pickerWins[0].picks[j1].name;
                        var pickedKey = _g.model.pickerWins[0].picks[j1].values[0].key;
                        if (pickedKey == "credits") state = "0";
                        else if (pickedKey == "extraPick") state = "1";
                        else if (pickedKey == "collectLevel") state = "2";
                        var pickerSummary = new smashthepigComponentsPickerPort.PickerSummaryPayload(pickName2, payout, "OUTCOME_" + state);
                        _g.pickerPort.getSummary().publish(pickerSummary);
                    }
                    _g.pickerPort.getPicks().publish(picks);
                }
                _g.soundController.stopAllSounds().play("STP_ender");
                _hcmn_.haxe_Timer.delay(function() {
                    _g.pickerPort.getState().publish(smashthepigComponentsPickerPort.PickerStateEnum.OUTRO);
                    var totalPickerWin = _g.moneyFormatter.format(_g.model.spinOutcome.pickerBonus.outcome.totalPayout);
                    var totalPicks = "";
                    if (_g.model.spinOutcome.pickerBonus.outcome.customField != null) totalPicks = _g.model.spinOutcome.pickerBonus.outcome.customField;
                    _g.pickerPort.getTotal().publish(new smashthepigComponentsPickerPort.PickerTotalPayload(totalPickerWin, totalPicks));
                    _hcmn_.haxe_Timer.delay(function() {
                        _g.pickerPort.getState().publish(smashthepigComponentsPickerPort.PickerStateEnum.END);
                        _g.pickerPort.getHide().publish(new smashthepigComponentsPickerPort.HidePickerPayload());
                        _g.backgroundPort.prepareBackground().publish(new smashthepigComponentsBackgroundPort.ChangeBackgroundPayload(0));
                        _g.backgroundPort.getChange().publish(new smashthepigComponentsBackgroundPort.ChangeBackgroundPayload(0));
                        _g.reelsPort.show().publish(null);
                        _g.winAnimatorPort.setVisible().publish(true);
                        _g.bannerPort.startPlayingGroup().publish("idleGroup");
                        _g.animationPort.getShow().publishForComponentInstance(_g.reelforeground, null);
                        _g.animationPort.getShow().publishForComponentInstance(_g.reelbackground, null);
                        _g.dispatchEvent(smashThePigGameController.StateMachineDef.PICKER_OUTRO_END);
                        _g.soundController.fadeOut("STP_ender", 1000);
                        _g.model.resetPickerWins();
                    }, _g.config.pb_EndDuration);
                }, _g.config.pb_OutroDuration);
            }, this.config.pb_SummaryDuration);
        };
        smashThePigGameController.GameController.prototype.showSkipButton = function() {
            haxe.Log.trace("[LN] GameController.showSkipButton", {
                fileName: "GameController.hx",
                lineNumber: 1232,
                className: "smashthepig.components.gamecontroller.impl.GameController",
                methodName: "showSkipButton"
            });
            this.betPanelPort.showButton().publish(betPanelApi.EButton.SKIP);
            this.betPanelPort.enableButton().publish(betPanelApi.EButton.SKIP);
        };
        smashThePigGameController.GameController.prototype.showSpinButton = function() {
            haxe.Log.trace("[LN] GameController.showSpinButton", {
                fileName: "GameController.hx",
                lineNumber: 1239,
                className: "smashthepig.components.gamecontroller.impl.GameController",
                methodName: "showSpinButton"
            });
            this.betPanelPort.showButton().publish(betPanelApi.EButton.SPIN);
        };
        smashThePigGameController.GameController.prototype.setBaseGameOutcome = function() {
            var _g = this;
            haxe.Log.trace("[LN] GameController.setBaseGameOutcome: ", {
                fileName: "GameController.hx",
                lineNumber: 1247,
                className: "smashthepig.components.gamecontroller.impl.GameController",
                methodName: "setBaseGameOutcome",
                customParams: [this.model.outcome]
            });
            if ((function($this) {
                    var $r;
                    var this1 = $this.smContext.get_contextValues();
                    $r = this1.get("awardCapExceeded");
                    return $r;
                }(this)) == true) _hcmn_.haxe_Timer.delay(function() {
                haxe.Log.trace("[LN] GameController.setBaseGameOutcomemodel.spinOutcome.baseGame.outcome: DELAYED CALL ", {
                    fileName: "GameController.hx",
                    lineNumber: 1250,
                    className: "smashthepig.components.gamecontroller.impl.GameController",
                    methodName: "setBaseGameOutcome",
                    customParams: [_g.model.spinOutcome.baseGame.outcome]
                });
                _g.model.setOutcome(_g.model.spinOutcome.baseGame.outcome);
                _g.reelsPort.setReelPicture().publish(_g.model.outcome.reelStop.reels);
            }, 300);
            else {
                this.model.setOutcome(this.model.spinOutcome.baseGame.outcome);
                this.reelsPort.setReelPicture().publish(this.model.outcome.reelStop.reels);
            }
        };
        smashThePigGameController.GameController.prototype.showIntro = function() {
            haxe.Log.trace("[LN] GameController.showIntro", {
                fileName: "GameController.hx",
                lineNumber: 1263,
                className: "smashthepig.components.gamecontroller.impl.GameController",
                methodName: "showIntro"
            });
            this.dispatchEvent(smashThePigGameController.StateMachineDef.INTRO_FINISHED_ACTION);
            var skgl = window.document.getElementById("skgl_0");
            var oldWidth = skgl.width;
            skgl.width -= 1;
            skgl.width = oldWidth;
        };
        smashThePigGameController.GameController.prototype.prepareResume = function() {
            haxe.Log.trace("[LN] GameController.prepareResume", {
                fileName: "GameController.hx",
                lineNumber: 1275,
                className: "smashthepig.components.gamecontroller.impl.GameController",
                methodName: "prepareResume"
            });
            this.betPanelPort.showButton().publish(betPanelApi.EButton.SPIN);
            this.betPanelPort.disableButton().publish(betPanelApi.EButton.SPIN);
            this.betPanelPort.disableButton().publish(betPanelApi.EButton.TOTAL_BET);
            this.betPanelPort.disableButton().publish(betPanelApi.EButton.PAYTABLE);
            this.model.isResume = true;
            haxe.Log.trace("model.isResume: ", {
                fileName: "GameController.hx",
                lineNumber: 1284,
                className: "smashthepig.components.gamecontroller.impl.GameController",
                methodName: "prepareResume",
                customParams: [this.model.isResume]
            });
        };
        smashThePigGameController.GameController.prototype.publishResumePrepared = function() {
            this.slotModelPort.getStages().getResumeStage().getResumePrepared().publish(null);
        };
        smashThePigGameController.GameController.prototype.onBaseGameIdle = function() {
            haxe.Log.trace("[LN] GameController.onBaseGameIdle", {
                fileName: "GameController.hx",
                lineNumber: 1293,
                className: "smashthepig.components.gamecontroller.impl.GameController",
                methodName: "onBaseGameIdle"
            });
            this.showSpinInfoLabel();
        };
        smashThePigGameController.GameController.prototype.updateBetPanel = function() {
            var _g = this;
            haxe.Log.trace("[LN] GameController.updateBetPanel", {
                fileName: "GameController.hx",
                lineNumber: 1298,
                className: "smashthepig.components.gamecontroller.impl.GameController",
                methodName: "updateBetPanel"
            });
            this.infoBarPort.hideLabel().publish(infoBarApi.InfoBarLabelEnum.RIGHT);
            this.infoBarPort.hideLabel().publish(infoBarApi.InfoBarLabelEnum.LEFT);
            this.infoBarPort.hideLabel().publish(infoBarApi.InfoBarLabelEnum.CENTRAL);
            this.infoBarTimer = _hcmn_.haxe_Timer.delay(function() {
                _g.infoBarPort.showLabel().publish(new infoBarApi.LabelContentPayload(infoBarApi.InfoBarLabelEnum.CENTRAL, _g.translationManager.stringLookup("PlayingLinesAtBet", [_g.model.stakeState.stakeItems.lineCount, _g.moneyFormatter.format(_g.model.stakeState.stakeItems.betPerLine)])));
            }, this.config.playingLinesAtBetMessageDelay);
        };
        smashThePigGameController.GameController.prototype.clearAllWins = function() {
            haxe.Log.trace("[LN] GameController.clearAllWins", {
                fileName: "GameController.hx",
                lineNumber: 1312,
                className: "smashthepig.components.gamecontroller.impl.GameController",
                methodName: "clearAllWins"
            });
            this.abortSpinPayload = null;
            this.stopSpinRecieved = false;
            this.resultPresented = false;
            this.pickAPigTriggered = false;
            this.pickerSmashThePigTriggered = false;
            this.bigWinCountUpInc = 0;
            this.progressMeterCountUp = 0;
            this.progressMeterBonusFill = null;
            this.progressMeterFinishCount = 0;
            this.winAnimatorPort.getHideOutcome().publish(null);
            this.infoBarPort.hideWinLineSummary().publish(null);
            this.reelPickerPort.getHide().publish(new smashthepigComponentsReelPickerPort.HideReelPickerPayload(true));
            this.AVAILABLE_PICKS_TEMP = null;
            this.hideAwardCap();
        };
        smashThePigGameController.GameController.prototype.hideAwardCap = function() {
            if ((function($this) {
                    var $r;
                    var this1 = $this.smContext.get_contextValues();
                    $r = this1.get("awardCapExceeded");
                    return $r;
                }(this)) == true) {
                this.animationPort.getShow().publishForComponentInstance(this.reelbackground, null);
                this.animationPort.getShow().publishForComponentInstance(this.reelforeground, null);
                this.animationPort.getHide().publishForComponentInstance(this.wincappopup, null);
                this.reelsPort.show().publish(null);
                this.luckMeterPort.getStartMeasure().publish(new smashthepigComponentsLuckMeterPort.LuckMeterPayload(_hcmn_.Std["int"](this.progressMeterValue = 0)));
                this.winAnimatorPort.setVisible().publish(true);
            }
        };
        smashThePigGameController.GameController.prototype.startSpin = function() {
            haxe.Log.trace("[LN] GameController.startSpin ", {
                fileName: "GameController.hx",
                lineNumber: 1347,
                className: "smashthepig.components.gamecontroller.impl.GameController",
                methodName: "startSpin",
                customParams: [this.model.startSpinPayload]
            });
            this.forcePaytableClose();
            this.reelsPort.startSpin().publish(new reelsApi.StartSpinPayload(this.model.startSpinPayload));
            if (this.model.isResume) this.winMeterPort.showMessage().publish(this.translationManager.stringLookup(""));
            else this.winMeterPort.showMessage().publish(this.translationManager.stringLookup("GoodLuck"));
            this.soundController.stopAllSounds().play("reelspin");
        };
        smashThePigGameController.GameController.prototype.checkForStopOrAbort = function() {
            haxe.Log.trace("[LN] GameController.checkForStopOrAbort", {
                fileName: "GameController.hx",
                lineNumber: 1360,
                className: "smashthepig.components.gamecontroller.impl.GameController",
                methodName: "checkForStopOrAbort"
            });
            if (this.abortSpinPayload != null) this.dispatchEvent(smashThePigGameController.StateMachineDef.ABORT_SPIN);
            else if (this.stopSpinRecieved) this.dispatchEvent(smashThePigGameController.StateMachineDef.STOP_REEL_SPIN);
        };
        smashThePigGameController.GameController.prototype.applyAbortData = function() {
            haxe.Log.trace("[LN] GameController.applyAbortData", {
                fileName: "GameController.hx",
                lineNumber: 1369,
                className: "smashthepig.components.gamecontroller.impl.GameController",
                methodName: "applyAbortData"
            });
            this.reelsPort.setReelPicture().publish(this.abortSpinPayload.stake.outcome.reelStop.reels);
            this.winMeterPort.showMessage().publish("");
            this.winAnimatorPort.getHideOutcome().publish(null);
            this.infoBarPort.hideLabel().publish(infoBarApi.InfoBarLabelEnum.RIGHT);
            this.infoBarPort.hideLabel().publish(infoBarApi.InfoBarLabelEnum.LEFT);
            this.infoBarPort.hideLabel().publish(infoBarApi.InfoBarLabelEnum.CENTRAL);
            this.infoBarPort.hideWinLineSummary().publish(null);
            if (this.infoBarTimer != null) this.infoBarTimer.stop();
            this.hideAwardCap();
            this.slotModelPort.getStages().getAbortStage().getSpinAborted().publish(null);
        };
        smashThePigGameController.GameController.prototype.stopReels = function() {
            haxe.Log.trace("[LN] GameController.stopReels: ", {
                fileName: "GameController.hx",
                lineNumber: 1389,
                className: "smashthepig.components.gamecontroller.impl.GameController",
                methodName: "stopReels",
                customParams: [this.model.outcome]
            });
            if (!this.stateMachine.isInState(smashThePigGameController.StateMachineDef.ABORT_SPIN_STATE)) {
                this.model.calculateTensions();
                this.tensionPort.getShow().publish(new smashthepigComponentsTensionPort.ShowTensionPayload(this.model.getTensionReels(), null, true));
            }
            this.reelsPort.stopSpin().publish(new reelsApi.StopSpinPayload(this.model.outcome.reelStop.reels, this.model.getTensionReels()));
        };
        smashThePigGameController.GameController.prototype.showBaseGameWins = function() {
            var showOutcomeOptions = new smashThePigWinAnimatorPort.ShowOutcomeOptions(this.config.winlineInterval, this.model.outcome, true, null);
            haxe.Log.trace("[LN] GameController.showBaseGameWins:showOutcomeOptions: ", {
                fileName: "GameController.hx",
                lineNumber: 1403,
                className: "smashthepig.components.gamecontroller.impl.GameController",
                methodName: "showBaseGameWins",
                customParams: [showOutcomeOptions]
            });
            this.winAnimatorPort.getShowOutcome().publish(showOutcomeOptions);
            if (((function($this) {
                    var $r;
                    var this1 = $this.smContext.get_contextValues();
                    $r = this1.get("Stage");
                    return $r;
                }(this))).indexOf("PickerSmashThePig") > -1 && !this.pickAPigTriggered) this.infoBarPort.showLabel().publish(new infoBarApi.LabelContentPayload(infoBarApi.InfoBarLabelEnum.CENTRAL, this.translationManager.stringLookup("SmashThePigBonusEnter")));
            if (((function($this) {
                    var $r;
                    var this2 = $this.smContext.get_contextValues();
                    $r = this2.get("Stage");
                    return $r;
                }(this))).indexOf("PickerPickAPig") > -1 || this.pickAPigTriggered) this.infoBarPort.showLabel().publish(new infoBarApi.LabelContentPayload(infoBarApi.InfoBarLabelEnum.CENTRAL, this.translationManager.stringLookup("PickAPigBonusEnter")));
        };
        smashThePigGameController.GameController.prototype.displayBaseGameWin = function() {
            this.showWins(this.model.spinOutcome.baseGame.outcome.totalPayout, this.model.spinOutcome.baseGame.outcome.bigWin);
        };
        smashThePigGameController.GameController.prototype.displayTotalWin = function() {
            haxe.Log.trace("[LN] GameController.displayTotalWin", {
                fileName: "GameController.hx",
                lineNumber: 1420,
                className: "smashthepig.components.gamecontroller.impl.GameController",
                methodName: "displayTotalWin"
            });
            this.showWins(this.resultPayload.totalWin, this.resultPayload.bigWin);
        };
        smashThePigGameController.GameController.prototype.showWins = function(payout, bigWin, instantShow, startAmmount) {
            if (instantShow == null) instantShow = false;
            var _g = this;
            haxe.Log.trace("[LN] GameController.showWins " + _hcmn_.Std.string(bigWin.winSegments), {
                fileName: "GameController.hx",
                lineNumber: 1425,
                className: "smashthepig.components.gamecontroller.impl.GameController",
                methodName: "showWins"
            });
            this.winMeterPort.showMessage().publish("");
            if (this.moneyFormatter.isZero(payout)) return;
            if (this.model.isAWin() || this.model.isKWin() || this.model.isQWin() || this.model.isJWin()) _hcmn_.haxe_Timer.delay(function() {
                _g.soundController.play("glassbreak");
            }, 500);
            this.bigWinLength = bigWin.winSegments.length;
            if (this.bigWinLength >= 3) this.soundController.play("countup_0");
            else if (this.bigWinLength == 2) this.soundController.play("mediumWin");
            else this.soundController.play("creditender");
            this.winMeterPort.displayWin().publish(new winMeterApi.WinMeterPayload(payout, bigWin.winSegments, instantShow, startAmmount));
            this.infoBarPort.showLabel().publish(new infoBarApi.LabelContentPayload(infoBarApi.InfoBarLabelEnum.RIGHT, this.translationManager.stringLookup("InfoTextRight", [this.moneyFormatter.format(payout)])));
            this.showSkipButton();
        };
        smashThePigGameController.GameController.prototype.finishedBigWinSound = function(e) {
            var _g = this;
            if (this.bigWinLength <= 2) {
                this.bigWinLength = null;
                return;
            }
            this.bigWinCountUpInc++;
            if (this.bigWinCountUpInc < 3) {
                this.soundController.fadeOut("countup_" + (this.bigWinCountUpInc - 1), 0);
                this.soundController.play("countup_" + this.bigWinCountUpInc);
            }
            if (this.bigWinCountUpInc == _hcmn_.Math.ceil(this.bigWinLength / 2)) _hcmn_.haxe_Timer.delay(function() {
                _g.soundController.stopAllSounds();
                if (_g.bigWinLength == 3) _g.soundController.play("smallWin");
                else if (_g.bigWinLength == 4) _g.soundController.play("mediumWin");
                else _g.soundController.play("largeWin");
                _g.bigWinLength = null;
                _g.bigWinCountUpInc = 0;
            }, 0);
        };
        smashThePigGameController.GameController.prototype.publishScatterChoice = function() {
            haxe.Log.trace("[LN] GameController.publishScatterChoice", {
                fileName: "GameController.hx",
                lineNumber: 1485,
                className: "smashthepig.components.gamecontroller.impl.GameController",
                methodName: "publishScatterChoice"
            });
            this.slotModelPort.getStages().getSpinStage().getOutcomePhase().getSpinOutcomePresented().publish(null);
        };
        smashThePigGameController.GameController.prototype.executeContinueCommand = function() {
            var _g = this;
            haxe.Log.trace("[LN] GameController.executeContinueCommand: model.spinOutcome: ", {
                fileName: "GameController.hx",
                lineNumber: 1491,
                className: "smashthepig.components.gamecontroller.impl.GameController",
                methodName: "executeContinueCommand",
                customParams: [this.model.spinOutcome]
            });
            if (this.model.spinOutcome.stage == "PickerPickAPig") {
                var payout = this.model.spinOutcome.freeSpin.outcome.totalPayout;
                if (this.moneyFormatter.isZero(payout)) _hcmn_.haxe_Timer.delay(function() {
                    haxe.Log.trace("[LN] GameController.executeContinueCommand delay 1", {
                        fileName: "GameController.hx",
                        lineNumber: 1498,
                        className: "smashthepig.components.gamecontroller.impl.GameController",
                        methodName: "executeContinueCommand"
                    });
                    _g.slotModelPort.getGameCommands().getContinueCommandExecuted().publish(null);
                }, this.config.rpb_EndDuration);
                else {
                    haxe.Log.trace("[LN] GameController.executeContinueCommand delay 2", {
                        fileName: "GameController.hx",
                        lineNumber: 1503,
                        className: "smashthepig.components.gamecontroller.impl.GameController",
                        methodName: "executeContinueCommand"
                    });
                    this.slotModelPort.getGameCommands().getContinueCommandExecuted().publish(null);
                }
            } else _hcmn_.haxe_Timer.delay(function() {
                haxe.Log.trace("[LN] GameController.executeContinueCommand delay 3", {
                    fileName: "GameController.hx",
                    lineNumber: 1508,
                    className: "smashthepig.components.gamecontroller.impl.GameController",
                    methodName: "executeContinueCommand"
                });
                _g.slotModelPort.getGameCommands().getContinueCommandExecuted().publish(null);
            }, this.config.rpb_EndDuration);
        };
        smashThePigGameController.GameController.prototype.publishResultPresented = function() {
            haxe.Log.trace("[LN] GameController.publishResultPresented ", {
                fileName: "GameController.hx",
                lineNumber: 1515,
                className: "smashthepig.components.gamecontroller.impl.GameController",
                methodName: "publishResultPresented"
            });
            if ((function($this) {
                    var $r;
                    var this1 = $this.smContext.get_contextValues();
                    $r = this1.get("awardCapExceeded");
                    return $r;
                }(this)) == true || this.moneyFormatter.isZero(this.resultPayload.totalWin)) this.slotModelPort.getStages().getResultStage().getResultPresented().publish(null);
        };
        smashThePigGameController.GameController.prototype.showAwardCapScreen = function() {
            var _g = this;
            haxe.Log.trace("[LN] GameController.showAwardCapScreen:pickAPigTriggered ", {
                fileName: "GameController.hx",
                lineNumber: 1524,
                className: "smashthepig.components.gamecontroller.impl.GameController",
                methodName: "showAwardCapScreen",
                customParams: [this.pickAPigTriggered, " pickerSmashThePigTriggered ", this.pickerSmashThePigTriggered]
            });
            this.soundController.stopAllSounds();
            this.animationPort.getHide().publishForComponentInstance(this.reelbackground, null);
            this.animationPort.getHide().publishForComponentInstance(this.reelforeground, null);
            if (this.pickAPigTriggered || this.pickerSmashThePigTriggered) {
                this.pickerPort.getHide().publish(new smashthepigComponentsPickerPort.HidePickerPayload());
                this.reelPickerPort.getHide().publish(new smashthepigComponentsReelPickerPort.HideReelPickerPayload(true));
                this.backgroundPort.getChange().publish(new smashthepigComponentsBackgroundPort.ChangeBackgroundPayload(0));
            }
            this.reelsPort.hide().publish(null);
            var awardCapScreenData = this.moneyFormatter.format(this.resultPayload.totalWin);
            this.animationPort.getShow().publishForComponentInstance(this.wincappopup, new smashThePigComponentsAnimationPort.ShowAnimationPayload(awardCapScreenData));
            this.winMeterPort.displayWin().publish(new winMeterApi.WinMeterPayload(this.resultPayload.totalWin, this.resultPayload.bigWin.winSegments, true));
            this.winAnimatorPort.getHideOutcome().publish(null);
            _hcmn_.haxe_Timer.delay(function() {
                haxe.Log.trace("[LN] GameController.showAwardCapScreen DELAYED CALL 1", {
                    fileName: "GameController.hx",
                    lineNumber: 1548,
                    className: "smashthepig.components.gamecontroller.impl.GameController",
                    methodName: "showAwardCapScreen"
                });
                _g.model.resetPickerWins();
                _g.dispatchEvent(smashThePigGameController.StateMachineDef.CONTINUE);
            }, this.config.maxAwardSpinEnabledDelay);
        };
        smashThePigGameController.GameController.prototype.handleBalanceUpdate = function(e) {
            haxe.Log.trace("[LN] GameController.handleBalanceUpdate", {
                fileName: "GameController.hx",
                lineNumber: 1556,
                className: "smashthepig.components.gamecontroller.impl.GameController",
                methodName: "handleBalanceUpdate"
            });
            var payload = e.getPayload();
            if (payload.freespin != null) {
                this.promotionalSpinsActive = true;
                this.promotionalSpinsCount = payload.freespin;
                this.betPanelPort.setBalance().publish(this.translationManager.stringLookup("BalanceValueNotAvailable"));
                this.betPanelPort.disableButton().publish(betPanelApi.EButton.TOTAL_BET);
            } else this.betPanelPort.setBalance().publish(payload.balance);
        };
        smashThePigGameController.GameController.prototype.handleGameOptionChanged = function(e) {
            haxe.Log.trace("[LN] GameController.handleGameOptionChanged", {
                fileName: "GameController.hx",
                lineNumber: 1569,
                className: "smashthepig.components.gamecontroller.impl.GameController",
                methodName: "handleGameOptionChanged"
            });
            var type = e.getPayload().key;
            var value = _hcmn_.Std.parseInt(e.getPayload().value);
            if (type == "sound") {
                if (value == 0) {
                    this.betPanelPort.enableButton().publish(betPanelApi.EButton.SOUND_ON);
                    this.soundController.unmuteSound();
                } else {
                    this.betPanelPort.disableButton().publish(betPanelApi.EButton.SOUND_OFF);
                    this.soundController.muteSound();
                }
            }
        };
        smashThePigGameController.GameController.prototype.handleSlotModelInitGame = function(e) {
            this.applyPresentationInitialization(e.getPayload());
            this.betPanelPort.hideButton().publish(betPanelApi.EButton.SKIP);
            var minRTP;
            var maxRTP;
            var singleRTP = e.getPayload().slotDefinition.rtp.singleRTP;
            if (singleRTP != null && singleRTP == true) {
                minRTP = e.getPayload().slotDefinition.rtp.minSingleRTP;
                maxRTP = e.getPayload().slotDefinition.rtp.maxSingleRTP;
            } else {
                minRTP = e.getPayload().slotDefinition.rtp.minRTP;
                maxRTP = e.getPayload().slotDefinition.rtp.maxRTP;
            }
            this.dispatchEvent(smashThePigGameController.StateMachineDef.INIT_ACTION);
        };
        smashThePigGameController.GameController.prototype.handlePrepareResume = function(e) {
            var resumePayload = e.getPayload();
            this.applyPresentationInitialization(resumePayload.initializationProperties);
            this.applyStakeItemsWithTotalBet(resumePayload.stake);
            this.smContext.setContextValue("Stage", resumePayload.spinOutcome.stage);
            this.smContext.setContextValue("NextStage", resumePayload.spinOutcome.nextStage);
            this.smContext.setContextValue("awardCapExceeded", resumePayload.spinOutcome.awardCapExceeded);
            var stage;
            var this1 = this.smContext.get_contextValues();
            stage = this1.get("Stage");
            var nextStage;
            var this2 = this.smContext.get_contextValues();
            nextStage = this2.get("NextStage");
            haxe.Log.trace("[LN] GameController.handlePrepareResume.stage     ", {
                fileName: "GameController.hx",
                lineNumber: 1622,
                className: "smashthepig.components.gamecontroller.impl.GameController",
                methodName: "handlePrepareResume",
                customParams: [stage]
            });
            haxe.Log.trace("[LN] GameController.handlePrepareResume.nextStage     ", {
                fileName: "GameController.hx",
                lineNumber: 1623,
                className: "smashthepig.components.gamecontroller.impl.GameController",
                methodName: "handlePrepareResume",
                customParams: [nextStage]
            });
            this.model.setSpinOutcome(resumePayload.spinOutcome);
            if (nextStage.indexOf("PickerSmashThePig") > -1) this.infoBarPort.showLabel().publish(new infoBarApi.LabelContentPayload(infoBarApi.InfoBarLabelEnum.CENTRAL, this.translationManager.stringLookup("SmashThePigBonusEnter")));
            if (nextStage.indexOf("PickerPickAPig") > -1) this.infoBarPort.showLabel().publish(new infoBarApi.LabelContentPayload(infoBarApi.InfoBarLabelEnum.CENTRAL, this.translationManager.stringLookup("PickAPigBonusEnter")));
            if (stage.indexOf("PickerPickAPig") > -1) this.pickAPigTriggered = true;
            this.bannerPort.startPlayingGroup().publish("idleGroup");
            if (smashThePigGameController.InternalStageType.PICKER_PIG_A_PIG.equals(stage) && smashThePigGameController.InternalStageType.PICKER_SMASH_THE_PIG.equals(nextStage)) this.model.resetPickerWins();
            if ((function($this) {
                    var $r;
                    var this3 = $this.smContext.get_contextValues();
                    $r = this3.get("Stage");
                    return $r;
                }(this)) == "PickerSmashThePig" && (function($this) {
                    var $r;
                    var this4 = $this.smContext.get_contextValues();
                    $r = this4.get("NextStage");
                    return $r;
                }(this)) == "PickerSmashThePig2") this.model.resetPickerWins();
            else if ((function($this) {
                    var $r;
                    var this5 = $this.smContext.get_contextValues();
                    $r = this5.get("Stage");
                    return $r;
                }(this)) == "PickerSmashThePig2" && (function($this) {
                    var $r;
                    var this6 = $this.smContext.get_contextValues();
                    $r = this6.get("NextStage");
                    return $r;
                }(this)) == "PickerSmashThePig3") this.model.resetPickerWins();
            else if ((function($this) {
                    var $r;
                    var this7 = $this.smContext.get_contextValues();
                    $r = this7.get("Stage");
                    return $r;
                }(this)) == "PickerSmashThePig3" && (function($this) {
                    var $r;
                    var this8 = $this.smContext.get_contextValues();
                    $r = this8.get("NextStage");
                    return $r;
                }(this)) == "PickerSmashThePig4") this.model.resetPickerWins();
            else if ((function($this) {
                    var $r;
                    var this9 = $this.smContext.get_contextValues();
                    $r = this9.get("Stage");
                    return $r;
                }(this)) == "PickerSmashThePig4" && (function($this) {
                    var $r;
                    var this10 = $this.smContext.get_contextValues();
                    $r = this10.get("NextStage");
                    return $r;
                }(this)) == "PickerSmashThePig5") this.model.resetPickerWins();
            else if ((function($this) {
                    var $r;
                    var this11 = $this.smContext.get_contextValues();
                    $r = this11.get("Stage");
                    return $r;
                }(this)) == "PickerSmashThePig5" && (function($this) {
                    var $r;
                    var this12 = $this.smContext.get_contextValues();
                    $r = this12.get("NextStage");
                    return $r;
                }(this)) == "PickerSmashThePig4") this.model.resetPickerWins();
            else if ((function($this) {
                    var $r;
                    var this13 = $this.smContext.get_contextValues();
                    $r = this13.get("Stage");
                    return $r;
                }(this)) == "PickerSmashThePig4" && (function($this) {
                    var $r;
                    var this14 = $this.smContext.get_contextValues();
                    $r = this14.get("NextStage");
                    return $r;
                }(this)) == "PickerSmashThePig3") this.model.resetPickerWins();
            else if ((function($this) {
                    var $r;
                    var this15 = $this.smContext.get_contextValues();
                    $r = this15.get("Stage");
                    return $r;
                }(this)) == "PickerSmashThePig3" && (function($this) {
                    var $r;
                    var this16 = $this.smContext.get_contextValues();
                    $r = this16.get("NextStage");
                    return $r;
                }(this)) == "PickerSmashThePig2") this.model.resetPickerWins();
            else if ((function($this) {
                    var $r;
                    var this17 = $this.smContext.get_contextValues();
                    $r = this17.get("Stage");
                    return $r;
                }(this)) == "PickerSmashThePig2" && (function($this) {
                    var $r;
                    var this18 = $this.smContext.get_contextValues();
                    $r = this18.get("NextStage");
                    return $r;
                }(this)) == "PickerSmashThePig1") this.model.resetPickerWins();
            this.winMeterPort.showMessage().publish("");
            if (!this.moneyFormatter.isZero(this.model.spinOutcome.acumulatedPayout)) this.winMeterPort.displayWin().publish(new winMeterApi.WinMeterPayload(this.model.spinOutcome.acumulatedPayout, null, true));
            this.luckMeterPort.getStartMeasure().publish(new smashthepigComponentsLuckMeterPort.LuckMeterPayload(_hcmn_.Std["int"](this.calculateLuckMeter(this.model.spinOutcome.pickerBonus.outcome.pickerWins[0].progressMeter))));
            this.dispatchEvent(smashThePigGameController.StateMachineDef.PREPARE_RESUME);
        };
        smashThePigGameController.GameController.prototype.applyPresentationInitialization = function(payload) {
            haxe.Log.trace("[LN] GameController.applyPresentationInitialization:payload", {
                fileName: "GameController.hx",
                lineNumber: 1682,
                className: "smashthepig.components.gamecontroller.impl.GameController",
                methodName: "applyPresentationInitialization",
                customParams: [payload]
            });
            this.applyStakeItemsWithTotalBet(payload.defaultStake);
            if (this.model.spinOutcome != null) this.reelsPort.setReelPicture().publish(this.model.spinOutcome.baseGame.outcome.reelStop.reels);
            else this.reelsPort.setReelPicture().publish(this.model.outcome.reelStop.reels);
        };
        smashThePigGameController.GameController.prototype.handleConfirmSelectedStake = function(e) {
            haxe.Log.trace("[LN]applyStakeItemsWithTotalBet ", {
                fileName: "GameController.hx",
                lineNumber: 1694,
                className: "smashthepig.components.gamecontroller.impl.GameController",
                methodName: "handleConfirmSelectedStake",
                customParams: [e.getPayload()]
            });
            this.soundController.stopAllSounds();
            this.winMeterPort.showMessage().publish("");
            if (this.model.spinOutcome != null) this.reelsPort.setReelPicture().publish(this.model.spinOutcome.baseGame.outcome.reelStop.reels);
            this.applyStakeItemsWithTotalBet(e.getPayload());
        };
        smashThePigGameController.GameController.prototype.applyStakeItemsWithTotalBet = function(stakeState) {
            haxe.Log.trace("[LN] GameController.applyStakeItemsWithTotalBet:stakeState: ", {
                fileName: "GameController.hx",
                lineNumber: 1709,
                className: "smashthepig.components.gamecontroller.impl.GameController",
                methodName: "applyStakeItemsWithTotalBet",
                customParams: [stakeState]
            });
            var stage;
            var this1 = this.smContext.get_contextValues();
            stage = this1.get("Stage");
            var nextStage;
            var this2 = this.smContext.get_contextValues();
            nextStage = this2.get("NextStage");
            this.winAnimatorPort.getHideOutcome().publish(null);
            this.model.setOutcome(stakeState.outcome);
            this.model.setCurrentStake(stakeState);
            this.betPanelPort.setStake().publish(stakeState);
            if (stage.indexOf("PickerPickAPig") > -1 && nextStage == "BaseGame") this.reelPickerPort.getVisible().publish(false);
            this.resultPayload = null;
            this.infoBarPort.hideLabel().publish(infoBarApi.InfoBarLabelEnum.RIGHT);
            this.infoBarPort.hideLabel().publish(infoBarApi.InfoBarLabelEnum.LEFT);
            this.infoBarPort.hideWinLineSummary().publish(null);
            this.hideAwardCap();
        };
        smashThePigGameController.GameController.prototype.handleSpinCommandAvailable = function(e) {
            haxe.Log.trace("[LN] GameController.handleSpinCommandAvailable: ", {
                fileName: "GameController.hx",
                lineNumber: 1734,
                className: "smashthepig.components.gamecontroller.impl.GameController",
                methodName: "handleSpinCommandAvailable",
                customParams: [e.getPayload()]
            });
            if (e.getPayload()) {
                this.dispatchEvent(smashThePigGameController.StateMachineDef.SPIN_ENABLED);
                this.betPanelPort.enableButton().publish(betPanelApi.EButton.SPIN);
            } else this.betPanelPort.disableButton().publish(betPanelApi.EButton.SPIN);
        };
        smashThePigGameController.GameController.prototype.handleStakeCommandAvailable = function(e) {
            haxe.Log.trace("[LN] GameController.handleStakeCommandAvailable: ", {
                fileName: "GameController.hx",
                lineNumber: 1744,
                className: "smashthepig.components.gamecontroller.impl.GameController",
                methodName: "handleStakeCommandAvailable",
                customParams: [$bind(e, e.getPayload)]
            });
            if (e.getPayload()) {
                if (!this.promotionalSpinsActive) this.betPanelPort.enableButton().publish(betPanelApi.EButton.TOTAL_BET);
            } else this.betPanelPort.disableButton().publish(betPanelApi.EButton.TOTAL_BET);
        };
        smashThePigGameController.GameController.prototype.handleModelSpinStart = function(e) {
            haxe.Log.trace("[LN] GameController.handleModelSpinStart: ", {
                fileName: "GameController.hx",
                lineNumber: 1753,
                className: "smashthepig.components.gamecontroller.impl.GameController",
                methodName: "handleModelSpinStart",
                customParams: [e.getPayload()]
            });
            this.model.startSpinPayload = e.getPayload();
            this.dispatchEvent(smashThePigGameController.StateMachineDef.START_REEL_SPIN);
        };
        smashThePigGameController.GameController.prototype.handleSpinOutcome = function(e) {
            haxe.Log.trace("[LN] GameController.handleSpinOutcome:e:", {
                fileName: "GameController.hx",
                lineNumber: 1760,
                className: "smashthepig.components.gamecontroller.impl.GameController",
                methodName: "handleSpinOutcome",
                customParams: [e.getPayload(), this.stateMachine.get_currentStateName()]
            });
            this.model.setSpinOutcome(e.getPayload());
            this.smContext.setContextValue("Stage", e.getPayload().stage);
            this.smContext.setContextValue("NextStage", e.getPayload().nextStage);
            this.smContext.setContextValue("awardCapExceeded", e.getPayload().awardCapExceeded);
            haxe.Log.trace("[LN] GameController.handleSpinOutcome:contextValues.awardCapExceeded: ", {
                fileName: "GameController.hx",
                lineNumber: 1767,
                className: "smashthepig.components.gamecontroller.impl.GameController",
                methodName: "handleSpinOutcome",
                customParams: [(function($this) {
                    var $r;
                    var this1 = $this.smContext.get_contextValues();
                    $r = this1.get("awardCapExceeded");
                    return $r;
                }(this))]
            });
            haxe.Log.trace("[LN] GameController.handleSpinOutcome:contextValues.Stage: ", {
                fileName: "GameController.hx",
                lineNumber: 1768,
                className: "smashthepig.components.gamecontroller.impl.GameController",
                methodName: "handleSpinOutcome",
                customParams: [(function($this) {
                    var $r;
                    var this2 = $this.smContext.get_contextValues();
                    $r = this2.get("Stage");
                    return $r;
                }(this))]
            });
            haxe.Log.trace("[LN] GameController.handleSpinOutcome:contextValues.NextStage: ", {
                fileName: "GameController.hx",
                lineNumber: 1769,
                className: "smashthepig.components.gamecontroller.impl.GameController",
                methodName: "handleSpinOutcome",
                customParams: [(function($this) {
                    var $r;
                    var this3 = $this.smContext.get_contextValues();
                    $r = this3.get("NextStage");
                    return $r;
                }(this))]
            });
            if (e.getPayload().pickerBonus != null) {
                if (e.getPayload().pickerBonus.outcome.pickerWins[0].progressMeter != null) {
                    this.progressMeterValue = e.getPayload().pickerBonus.outcome.pickerWins[0].progressMeter / this.config.progressMeterMaxValue * 100;
                    if (this.progressMeterValue > 100) this.progressMeterValue = 100;
                } else this.progressMeterValue = 0;
            }
            haxe.Log.trace("[LN] GameController.handleSpinOutcome:contextValues.progressMeterValue: " + this.progressMeterValue, {
                fileName: "GameController.hx",
                lineNumber: 1780,
                className: "smashthepig.components.gamecontroller.impl.GameController",
                methodName: "handleSpinOutcome"
            });
        };
        smashThePigGameController.GameController.prototype.handleModelSpinStop = function(e) {
            haxe.Log.trace("[LN] GameController.handleModelSpinStop: ", {
                fileName: "GameController.hx",
                lineNumber: 1784,
                className: "smashthepig.components.gamecontroller.impl.GameController",
                methodName: "handleModelSpinStop",
                customParams: [$bind(e, e.getPayload), this.stateMachine.get_currentStateName()]
            });
            if (this.stateMachine.isInState(smashThePigGameController.StateMachineDef.SPINNING_STATE)) this.dispatchEvent(smashThePigGameController.StateMachineDef.STOP_REEL_SPIN);
            else this.stopSpinRecieved = true;
        };
        smashThePigGameController.GameController.prototype.handleAbortSpin = function(e) {
            haxe.Log.trace("[LN] GameController.handleAbortSpin, ", {
                fileName: "GameController.hx",
                lineNumber: 1794,
                className: "smashthepig.components.gamecontroller.impl.GameController",
                methodName: "handleAbortSpin",
                customParams: [e.getPayload()]
            });
            this.model.resetSpinOutcome();
            this.abortSpinPayload = e.getPayload();
            this.winMeterPort.showMessage().publish("");
            if (this.stateMachine.isInState(smashThePigGameController.StateMachineDef.SPINNING_STATE) || this.stateMachine.isInState(smashThePigGameController.StateMachineDef.PICKER_PICKING_STATE)) this.dispatchEvent(smashThePigGameController.StateMachineDef.ABORT_SPIN);
        };
        smashThePigGameController.GameController.prototype.handleSpinOutcomePresent = function(e) {
            haxe.Log.trace("[LN] GameController.handleSpinOutcomePresent: ", {
                fileName: "GameController.hx",
                lineNumber: 1804,
                className: "smashthepig.components.gamecontroller.impl.GameController",
                methodName: "handleSpinOutcomePresent",
                customParams: [$bind(e, e.getPayload)]
            });
            this.dispatchEvent(smashThePigGameController.StateMachineDef.PRESENT_SPIN_OUTCOME);
        };
        smashThePigGameController.GameController.prototype.handlePresentResult = function(e) {
            haxe.Log.trace("[LN] GameController.handlePresentResult: ", {
                fileName: "GameController.hx",
                lineNumber: 1809,
                className: "smashthepig.components.gamecontroller.impl.GameController",
                methodName: "handlePresentResult",
                customParams: [$bind(e, e.getPayload)]
            });
            this.resultPayload = e.getPayload();
            this.dispatchEvent(smashThePigGameController.StateMachineDef.PRESENT_RESULT);
        };
        smashThePigGameController.GameController.prototype.handleContinueCommandAvailable = function(e) {
            haxe.Log.trace("[LN] GameController.handleContinueCommandAvailable", {
                fileName: "GameController.hx",
                lineNumber: 1815,
                className: "smashthepig.components.gamecontroller.impl.GameController",
                methodName: "handleContinueCommandAvailable"
            });
            if (e.getPayload()) this.dispatchEvent(smashThePigGameController.StateMachineDef.CONTINUE_ENABLED);
        };
        smashThePigGameController.GameController.prototype.handlePaytableCommandAvailable = function(e) {
            haxe.Log.trace("[LN] GameController.handlePaytableCommandAvailable ", {
                fileName: "GameController.hx",
                lineNumber: 1823,
                className: "smashthepig.components.gamecontroller.impl.GameController",
                methodName: "handlePaytableCommandAvailable"
            });
            if (!e.getPayload()) this.betPanelPort.disableButton().publish(betPanelApi.EButton.PAYTABLE);
            else this.betPanelPort.enableButton().publish(betPanelApi.EButton.PAYTABLE);
        };
        smashThePigGameController.GameController.prototype.handleOpenPaytable = function(e) {
            haxe.Log.trace("[LN] GameController.handleOpenPaytable ", {
                fileName: "GameController.hx",
                lineNumber: 1832,
                className: "smashthepig.components.gamecontroller.impl.GameController",
                methodName: "handleOpenPaytable",
                customParams: [this.paytableOpened]
            });
            this.soundController.play("creditender");
            if (this.paytableOpened) {
                this.onPaytableClose();
                return;
            }
            this.paytableOpened = true;
            this.reelPickerPort.getHide().publish(new smashthepigComponentsReelPickerPort.HideReelPickerPayload(true));
            this.reelPickerPort.getVisible().publish(false);
            this.paytablePort.show().publish(null);
            this.reelsPort.hide().publish(null);
            this.winAnimatorPort.setVisible().publish(false);
            if (this.resultPayload != null && !this.moneyFormatter.isZero(this.resultPayload.totalWin)) {}
            this.infoBarPort.hideLabel().publish(infoBarApi.InfoBarLabelEnum.LEFT);
        };
        smashThePigGameController.GameController.prototype.handleOpenHelp = function(e) {
            this.soundController.play("creditender");
            if (this.helpOpened) this.helpOpened = false;
            else this.helpOpened = true;
        };
        smashThePigGameController.GameController.prototype.onHelpClose = function() {
            this.soundController.play("creditender");
        };
        smashThePigGameController.GameController.prototype.onGameLayoutUpdated = function(event) {
            haxe.Log.trace("[LN] GameController.onGameLayoutUpdated", {
                fileName: "GameController.hx",
                lineNumber: 1875,
                className: "smashthepig.components.gamecontroller.impl.GameController",
                methodName: "onGameLayoutUpdated"
            });
            if (this.layoutUpdated) return;
            this.layoutUpdated = true;
            this.checkGameLoaded();
        };
        smashThePigGameController.GameController.prototype.onBetPanelButtonPressed = function(e) {
            haxe.Log.trace("[LN] GameController.onBetPanelButtonPressed " + _hcmn_.Std.string(e.getPayload()), {
                fileName: "GameController.hx",
                lineNumber: 1883,
                className: "smashthepig.components.gamecontroller.impl.GameController",
                methodName: "onBetPanelButtonPressed",
                customParams: [this.stateMachine.get_currentStateName()]
            });
            var button = e.getPayload();
            switch (button[1]) {
                case 1:
                    this.slotModelPort.getGameCommands().getSpinCommandExecuted().publish(null);
                    break;
                case 5:
                    this.slotModelPort.getGameCommands().getPaytableCommandExecuted().publish(null);
                    this.infoBarPort.hideWinLineSummary().publish(null);
                    break;
                case 6:
                    this.paytablePort.setNextPage().publish(null);
                    break;
                case 7:
                    this.paytablePort.setPreviousPage().publish(null);
                    break;
                case 8:
                    this.onPaytableClose(null);
                    break;
                case 9:
                    this.slotModelPort.getGameContext().getGameOptionChangedFromGf().publish(new slotModelApi.Pair("sound", "1"));
                    this.soundController.muteSound();
                    break;
                case 3:
                    if (this.stateMachine.get_currentStateName() == smashThePigGameController.StateMachineDef.BET_CONFIRM) {
                        this.winMeterPort.showMessage().publish("");
                        this.resultPresentedPublish();
                        this.soundController.stopAllSounds();
                    }
                    break;
                case 10:
                    this.slotModelPort.getGameContext().getGameOptionChangedFromGf().publish(new slotModelApi.Pair("sound", "0"));
                    this.soundController.unmuteSound();
                    break;
                default:
                    haxe.Log.trace("Not Implemented", {
                        fileName: "GameController.hx",
                        lineNumber: 1913,
                        className: "smashthepig.components.gamecontroller.impl.GameController",
                        methodName: "onBetPanelButtonPressed"
                    });
            }
        };
        smashThePigGameController.GameController.prototype.resultPresentedPublish = function() {
            var _g = this;
            if (this.resultPresented) return;
            this.slotModelPort.getStages().getResultStage().getResultPresented().publish(null);
            _hcmn_.haxe_Timer.delay(function() {
                _g.winMeterPort.displayWin().publish(new winMeterApi.WinMeterPayload(_g.resultPayload.totalWin, _g.resultPayload.bigWin.winSegments, true));
            }, 0);
            this.betPanelPort.hideButton().publish(betPanelApi.EButton.SKIP);
            this.betPanelPort.showButton().publish(betPanelApi.EButton.SPIN);
            this.betPanelPort.enableButton().publish(betPanelApi.EButton.PAYTABLE);
            this.resultPresented = true;
        };
        smashThePigGameController.GameController.prototype.onPaytableClose = function(e) {
            haxe.Log.trace("[LN] GameController.onPaytableClose", {
                fileName: "GameController.hx",
                lineNumber: 1935,
                className: "smashthepig.components.gamecontroller.impl.GameController",
                methodName: "onPaytableClose"
            });
            this.paytableOpened = false;
            this.paytablePort.hide().publish(null);
            this.betPanelPort.hidePaytableControl().publish(null);
            this.reelsPort.show().publish(null);
            this.reelPickerPort.getVisible().publish(true);
            this.winAnimatorPort.setVisible().publish(true);
            this.showSpinInfoLabel();
            this.luckMeterPort.getShow().publish(null);
            this.hideAwardCap();
            this.soundController.play("creditender");
        };
        smashThePigGameController.GameController.prototype.onHTMLPaytableClose = function(e) {
            this.onPaytableClose(null);
        };
        smashThePigGameController.GameController.prototype.forcePaytableClose = function() {
            haxe.Log.trace("[LN] GameController.forcePaytableClose", {
                fileName: "GameController.hx",
                lineNumber: 1956,
                className: "smashthepig.components.gamecontroller.impl.GameController",
                methodName: "forcePaytableClose"
            });
            this.paytableOpened = false;
            this.paytablePort.hide().publish(null);
            this.betPanelPort.hidePaytableControl().publish(null);
            this.reelsPort.show().publish(null);
        };
        smashThePigGameController.GameController.prototype.onPaytablePageChanged = function(e) {
            haxe.Log.trace("[LN] GameController.onPaytablePageChanged", {
                fileName: "GameController.hx",
                lineNumber: 1964,
                className: "smashthepig.components.gamecontroller.impl.GameController",
                methodName: "onPaytablePageChanged"
            });
            this.betPanelPort.showPaytableControl().publish(e.getPayload());
        };
        smashThePigGameController.GameController.prototype.onDisplayWinMeterFinished = function(e) {
            haxe.Log.trace("[LN] GameController.onDisplayWinMeterFinished", {
                fileName: "GameController.hx",
                lineNumber: 1970,
                className: "smashthepig.components.gamecontroller.impl.GameController",
                methodName: "onDisplayWinMeterFinished"
            });
            if (this.stateMachine.get_currentStateName() == smashThePigGameController.StateMachineDef.BET_CONFIRM) this.resultPresentedPublish();
        };
        smashThePigGameController.GameController.prototype.onBetPanelStakeChanged = function(e) {
            haxe.Log.trace("[LN] GameController.onBetPanelStakeChanged", {
                fileName: "GameController.hx",
                lineNumber: 1980,
                className: "smashthepig.components.gamecontroller.impl.GameController",
                methodName: "onBetPanelStakeChanged"
            });
            this.slotModelPort.getGameCommands().getStakeCommandExecuted().publish(e.getPayload());
            if (this.resultPayload != null && !this.moneyFormatter.isZero(this.resultPayload.totalWin)) this.winMeterPort.displayWin().publish(new winMeterApi.WinMeterPayload(this.resultPayload.totalWin, this.resultPayload.bigWin.winSegments, true));
        };
        smashThePigGameController.GameController.prototype.onReelOutcomeExit = function(e) {
            haxe.Log.trace("[LN] GameController.onReelOutcomeExit: ", {
                fileName: "GameController.hx",
                lineNumber: 1988,
                className: "smashthepig.components.gamecontroller.impl.GameController",
                methodName: "onReelOutcomeExit",
                customParams: [$bind(e, e.getPayload)]
            });
            if (e.getPayload() == 0) this.dispatchEvent(smashThePigGameController.StateMachineDef.SPIN_STARTING_ENDED);
        };
        smashThePigGameController.GameController.prototype.onReelStoppingStarted = function(e) {
            haxe.Log.trace("[LN] GameController.onReelStoppingStarted: ", {
                fileName: "GameController.hx",
                lineNumber: 1995,
                className: "smashthepig.components.gamecontroller.impl.GameController",
                methodName: "onReelStoppingStarted",
                customParams: [$bind(e, e.getPayload)]
            });
        };
        smashThePigGameController.GameController.prototype.onReelStopped = function(e) {
            haxe.Log.trace("[LN] GameController.onReelStopped ", {
                fileName: "GameController.hx",
                lineNumber: 2000,
                className: "smashthepig.components.gamecontroller.impl.GameController",
                methodName: "onReelStopped",
                customParams: [e.getPayload()]
            });
            var reelId = e.getPayload();
            if (!this.stateMachine.isInState(smashThePigGameController.StateMachineDef.ABORT_SPIN_STATE)) {
                this.soundController.reelStopped(reelId);
                this.tensionPort.getShowTensionFrame().publish(new smashthepigComponentsTensionPort.ShowTensionPayload(this.model.getScatterPositions(reelId), reelId));
                this.tensionPort.getShow().publish(new smashthepigComponentsTensionPort.ShowTensionPayload(this.model.getTensionReels(), reelId));
            }
            var showOutcomeOptions = new smashThePigWinAnimatorPort.ShowOutcomeOptions(1000, this.model.outcome, false, this.model.landingSymbols);
            showOutcomeOptions.reelStopped = reelId;
            if (this.model.hasTension) {}
            if (this.model.spinOutcome != null && this.model.spinOutcome.stage == "BaseGame" && reelId == 0) this.winMeterPort.showMessage().publish("");
            var reelOutcome = this.model.outcome.reelStop.reels[reelId];
            if (this.model.outcome.scatterWins == null) {
                if (_hcmn_.HxOverrides.indexOf(reelOutcome, "" + this.model.BONUS_SCATTER_SYMBOL, 0) != -1 || _hcmn_.HxOverrides.indexOf(reelOutcome, "" + this.model.PIG_SCATTER_SYMBOL, 0) != -1) {
                    this.progressMeterValue += (_hcmn_.Math.random() * (this.config.maxScatterLuckValue - this.config.minScatterLuckValue) + this.config.minScatterLuckValue) / this.config.progressMeterMaxValue * 100;
                    if (this.progressMeterValue > 100) this.progressMeterValue = 100;
                    this.luckMeterPort.getStartMeasure().publish(new smashthepigComponentsLuckMeterPort.LuckMeterPayload(this.progressMeterValue | 0));
                    this.progressMeterFillSound = "luck_meter_" + ++this.progressMeterCountUp;
                    this.soundController.play(this.progressMeterFillSound);
                }
            } else if (_hcmn_.HxOverrides.indexOf(reelOutcome, "" + this.model.BONUS_SCATTER_SYMBOL, 0) != -1 || _hcmn_.HxOverrides.indexOf(reelOutcome, "" + this.model.PIG_SCATTER_SYMBOL, 0) != -1) {
                var scatterLength = this.model.getScatterPositions().filter(function(value) {
                    return value > -1;
                }).length;
                this.progressMeterFillSound = "luck_meter_" + ++this.progressMeterCountUp;
                this.soundController.play(this.progressMeterFillSound);
                this.progressMeterBonusFill += this.progressMeterValue / scatterLength;
                this.luckMeterPort.getStartMeasure().publish(new smashthepigComponentsLuckMeterPort.LuckMeterPayload(this.progressMeterBonusFill | 0));
            }
        };
        smashThePigGameController.GameController.prototype.onLuckMeterFinished = function(e) {
            haxe.Log.trace("Luck meter finished", {
                fileName: "GameController.hx",
                lineNumber: 2054,
                className: "smashthepig.components.gamecontroller.impl.GameController",
                methodName: "onLuckMeterFinished"
            });
            if (this.progressMeterFillSound != null && this.progressMeterFillSound.split("_").pop() == ++this.progressMeterFinishCount) this.soundController.fadeOut(this.progressMeterFillSound, 0);
            if (this.progressMeterValue == this.progressMeterBonusFill && this.progressMeterValue >= 100 && this.progressMeterFillSound != null) {
                this.soundController.fadeOut(this.progressMeterFillSound, 0);
                this.soundController.play("luck_meter_end");
            }
            this.progressMeterFillSound = null;
        };
        smashThePigGameController.GameController.prototype.onLuckMeterStart = function(e) {
            haxe.Log.trace("Luck meter start ", {
                fileName: "GameController.hx",
                lineNumber: 2067,
                className: "smashthepig.components.gamecontroller.impl.GameController",
                methodName: "onLuckMeterStart",
                customParams: [e.getPayload()]
            });
            if (e.getPayload() == 1) this.soundController.play("luckMeter_down");
        };
        smashThePigGameController.GameController.prototype.hasTension = function() {
            if ((function($this) {
                    var $r;
                    var _this = $this.model.getTensionReels();
                    $r = _hcmn_.HxOverrides.indexOf(_this, 1, 0);
                    return $r;
                }(this)) == -1) return false;
            return true;
        };
        smashThePigGameController.GameController.prototype.onSpinStopped = function(e) {
            var _g = this;
            haxe.Log.trace("[LN] GameController.onSpinStopped: " + _hcmn_.Std.string(e.getPayload()), {
                fileName: "GameController.hx",
                lineNumber: 2084,
                className: "smashthepig.components.gamecontroller.impl.GameController",
                methodName: "onSpinStopped",
                customParams: [this.stateMachine.getCurrentStateName()]
            });
            if (this.stateMachine.isInState(smashThePigGameController.StateMachineDef.STOPPING_STATE)) {
                this.tensionPort.getHideTensionFrame().publish(null);
                this.tensionPort.getShow().publish(new smashthepigComponentsTensionPort.ShowTensionPayload(this.model.getTensionReels(), null, null, true));
                this.soundController.spinStopped();
                this.slotModelPort.getStages().getSpinStage().getReelSpinFinished().publish(null);
            } else this.slotModelPort.getStages().getAbortStage().getSpinAborted().publish(null);
            if (this.model.outcome.scatterWins == null) _hcmn_.haxe_Timer.delay(function() {
                _g.luckMeterPort.getStartMeasure().publish(new smashthepigComponentsLuckMeterPort.LuckMeterPayload(_hcmn_.Std["int"](_g.progressMeterValue = 0)));
            }, 800);
            var tempStateName;
            var this1 = this.smContext.get_contextValues();
            tempStateName = this1.get("NextStage");
            if (tempStateName.indexOf("PickerSmashThePig") > -1) this.soundController.play("pigfix");
            haxe.Log.trace("", {
                fileName: "GameController.hx",
                lineNumber: 2105,
                className: "smashthepig.components.gamecontroller.impl.GameController",
                methodName: "onSpinStopped"
            });
        };
        smashThePigGameController.GameController.prototype.onWinLineAnimated = function(e) {
            haxe.Log.trace("[LN] GameController.onWinLineAnimated: ", {
                fileName: "GameController.hx",
                lineNumber: 2109,
                className: "smashthepig.components.gamecontroller.impl.GameController",
                methodName: "onWinLineAnimated",
                customParams: [e.getPayload()]
            });
            var win = e.getPayload();
            if (win.type == "Scatter" && this.paytableOpened == false) {
                this.infoBarPort.hideWinLineSummary().publish(null);
                var acumulatedFreeSpinsPayout = this.model.spinOutcome.acumulatedFreeSpinPayout;
                if ((function($this) {
                        var $r;
                        var this1 = $this.smContext.get_contextValues();
                        $r = this1.get("retrigger");
                        return $r;
                    }(this)) == false) {
                    if (!this.moneyFormatter.isZero(acumulatedFreeSpinsPayout)) this.infoBarPort.showLabel().publish(new infoBarApi.LabelContentPayload(infoBarApi.InfoBarLabelEnum.LEFT, this.translationManager.stringLookup("FreeSpinsWin", [this.moneyFormatter.format(acumulatedFreeSpinsPayout)])));
                } else {
                    var tempStateName;
                    var this2 = this.smContext.get_contextValues();
                    tempStateName = this2.get("Stage");
                    if (tempStateName.indexOf("PickerSmashThePig") > -1 && !this.pickAPigTriggered) this.infoBarPort.showLabel().publish(new infoBarApi.LabelContentPayload(infoBarApi.InfoBarLabelEnum.LEFT, this.translationManager.stringLookup("SmashThePigBonus", [this.moneyFormatter.format(this.model.spinOutcome.pickerBonus.outcome.totalPayout)])));
                    if (tempStateName.indexOf("PickerPickAPig") > -1 || this.pickAPigTriggered) this.infoBarPort.showLabel().publish(new infoBarApi.LabelContentPayload(infoBarApi.InfoBarLabelEnum.LEFT, this.translationManager.stringLookup("PickAPigBonus", [this.moneyFormatter.format(this.model.spinOutcome.pickerBonus.outcome.totalPayout)])));
                }
                return;
            }
            this.infoBarPort.hideLabel().publish(infoBarApi.InfoBarLabelEnum.LEFT);
            var linePicture;
            var _g = [];
            var _g1 = 0;
            while (_g1 < 5) {
                var i = _g1++;
                _g.push("-");
            }
            linePicture = _g;
            var _g2 = 0;
            var _g11 = win.symbolCount;
            while (_g2 < _g11) {
                var k = _g2++;
                linePicture[win.position + k] = win.winningSymbol;
            }
            if (win.type == "LineRight") linePicture.reverse();
            if (this.paytableOpened) this.infoBarPort.hideWinLineSummary().publish(null);
            else this.infoBarPort.showWinLineSummary().publish(new infoBarApi.WinLineSummaryPayload(linePicture, win.lineId == null ? "null" : "" + win.lineId, this.moneyFormatter.format(win.payout)));
        };
        smashThePigGameController.GameController.prototype.onWinLinesReady = function(e) {
            haxe.Log.trace("[LN] GameController.onWinLinesReady: ", {
                fileName: "GameController.hx",
                lineNumber: 2152,
                className: "smashthepig.components.gamecontroller.impl.GameController",
                methodName: "onWinLinesReady",
                customParams: [this.model.getVisibilityForAllWins(), this.stateMachine.get_currentStateName()]
            });
            if (this.stateMachine.get_currentStateName() == "STOPPING_STATE") return;
            if (this.stateMachine.get_currentStateName() == smashThePigGameController.StateMachineDef.SHOW_SCATTER_WIN) this.reelsPort.setReelCellsVisibility().publish(this.model.getVisibilityForScatterWins());
            else if (this.stateMachine.get_currentStateName() != smashThePigGameController.StateMachineDef.PICKER_SUMMARY) this.reelsPort.setReelCellsVisibility().publish(this.model.getVisibilityForAllWins());
        };
        smashThePigGameController.GameController.prototype.showSpinInfoLabel = function() {
            haxe.Log.trace("[LN] GameController.showSpinInfoLabel", {
                fileName: "GameController.hx",
                lineNumber: 2163,
                className: "smashthepig.components.gamecontroller.impl.GameController",
                methodName: "showSpinInfoLabel"
            });
            if (this.promotionalSpinsActive) this.infoBarPort.showLabel().publish(new infoBarApi.LabelContentPayload(infoBarApi.InfoBarLabelEnum.CENTRAL, this.translationManager.stringLookup("PromotionalSpinsLeft") + " " + this.promotionalSpinsCount));
            else this.infoBarPort.showLabel().publish(new infoBarApi.LabelContentPayload(infoBarApi.InfoBarLabelEnum.CENTRAL, this.translationManager.stringLookup("SpinInfoLabel")));
        };
        smashThePigGameController.GameController.prototype.abortPickerBonus = function() {
            haxe.Log.trace("[dex] apply abort data !!!!!!!!!!!!!!!!", {
                fileName: "GameController.hx",
                lineNumber: 2177,
                className: "smashthepig.components.gamecontroller.impl.GameController",
                methodName: "abortPickerBonus"
            });
            this.model.retryChoice = true;
            this.slotModelPort.getStages().getAbortStage().getSpinAborted().publish(null);
        };
        smashThePigGameController.GameController.prototype.getLastPickState = function() {
            var pickedKey = this.model.pickerWins[0].lastPicked.values[0].key;
            var state = "0";
            if (pickedKey == "credits") state = "OUTCOME_2";
            else if (pickedKey == "extraPick") state = "OUTCOME_1";
            else if (pickedKey == "collectLevel") state = "OUTCOME_0";
            else if (pickedKey == "bonus") state = "OUTCOME_2";
            haxe.Log.trace("[LN] GameController.getLastPickedState: ", {
                fileName: "GameController.hx",
                lineNumber: 2194,
                className: "smashthepig.components.gamecontroller.impl.GameController",
                methodName: "getLastPickState",
                customParams: [state]
            });
            return state;
        };
        smashThePigGameController.GameController.prototype.attachTestToEventBus = function() {
            var bus = this.moduleContext.getAnyService(clientkernelEventbusApi.IEventBus, null);
            bus.getChannel("GFBus").subscribe("testable:selectId", $bind(this, this.handleSelection));
        };
        smashThePigGameController.GameController.prototype.handleSelection = function(payload) {
            haxe.Log.trace("[LN] GameController.handlePickerSelect: ", {
                fileName: "GameController.hx",
                lineNumber: 2206,
                className: "smashthepig.components.gamecontroller.impl.GameController",
                methodName: "handleSelection",
                customParams: [payload]
            });
            var symbolId = payload;
            this.soundController.play("STP_bonuspigsmash" + smashThePigGameController.GameController.randomInt(1, 7));
            this.slotModelPort.getStages().getPickerBonusStage().getPickerBonusSelected().publish(new slotModelApi.Pair(symbolId, symbolId));
        };
        smashThePigGameController.GameController.prototype.handleSelected = function(selection) {
            var bus = this.moduleContext.getAnyService(clientkernelEventbusApi.IEventBus, null);
            bus.getChannel("GFBus").publish("pickerSelect", "selection:" + selection);
        };
        smashThePigGameController.GameController.prototype.calculateLuckMeter = function(luck) {
            this.progressMeterValue = luck / this.config.progressMeterMaxValue * 100;
            if (this.progressMeterValue > 100) this.progressMeterValue = 100;
            return this.progressMeterValue;
        };
        smashThePigGameController.GameController.prototype.getOffsets = function(reelPic) {
            var fixedOffsets = [];
            var pickerPosition = 2;
            var symbolId = "9";
            var _g1 = 0;
            var _g = reelPic.length;
            while (_g1 < _g) {
                var i = _g1++;
                fixedOffsets[i] = 0;
                var _g3 = 1;
                var _g2 = reelPic[i].length - 1;
                while (_g3 < _g2) {
                    var j = _g3++;
                    if (reelPic[i][j] == symbolId) {
                        if (j > pickerPosition) fixedOffsets[i] = -1;
                        else if (j < pickerPosition) fixedOffsets[i] = 1;
                        else fixedOffsets[i] = 0;
                    }
                }
            }
            return fixedOffsets;
        };
        smashThePigGameController.GameController.randomInt = function(from, to) {
            return from + _hcmn_.Math.floor((to - from + 1) * _hcmn_.Math.random());
        };
        smashThePigGameController.GameController.prototype.__class__ = smashThePigGameController.GameController;
        smashThePigGameController.GameControllerConfig = function() {};
        smashThePigGameController.GameControllerConfig.__name__ = ["smashThePigGameController", "GameControllerConfig"];
        smashThePigGameController.GameControllerConfig.prototype.progressMeterMaxValue = null;
        smashThePigGameController.GameControllerConfig.prototype.winlineInterval = null;
        smashThePigGameController.GameControllerConfig.prototype.playingLinesAtBetMessageDelay = null;
        smashThePigGameController.GameControllerConfig.prototype.rpb_ReelUpdateDuration = null;
        smashThePigGameController.GameControllerConfig.prototype.rpb_ReelUpdateOutroDuration = null;
        smashThePigGameController.GameControllerConfig.prototype.rpb_IntroDuration = null;
        smashThePigGameController.GameControllerConfig.prototype.rpb_EntryDuration = null;
        smashThePigGameController.GameControllerConfig.prototype.rpb_ResumeDuration = null;
        smashThePigGameController.GameControllerConfig.prototype.rpb_IdleDuration = null;
        smashThePigGameController.GameControllerConfig.prototype.rpb_SummaryDuration = null;
        smashThePigGameController.GameControllerConfig.prototype.rpb_OutroDuration = null;
        smashThePigGameController.GameControllerConfig.prototype.rpb_EndDuration = null;
        smashThePigGameController.GameControllerConfig.prototype.pb_IntroDuration = null;
        smashThePigGameController.GameControllerConfig.prototype.pb_EntryDuration = null;
        smashThePigGameController.GameControllerConfig.prototype.pb_IdleDuration = null;
        smashThePigGameController.GameControllerConfig.prototype.pb_OutroDuration = null;
        smashThePigGameController.GameControllerConfig.prototype.pb_SummaryDuration = null;
        smashThePigGameController.GameControllerConfig.prototype.pb_EndDuration = null;
        smashThePigGameController.GameControllerConfig.prototype.pb_MorePicksDuration = null;
        smashThePigGameController.GameControllerConfig.prototype.minScatterLuckValue = null;
        smashThePigGameController.GameControllerConfig.prototype.maxScatterLuckValue = null;
        smashThePigGameController.GameControllerConfig.prototype.maxAwardSpinEnabledDelay = null;
        smashThePigGameController.GameControllerConfig.prototype.__class__ = smashThePigGameController.GameControllerConfig;
        smashThePigGameController.GameModel = function() {
            this.retryChoice = false;
            this.isResume = false;
            this.reelsNum = 5;
            this.cellsNum = 3;
            this.JWin = false;
            this.QWin = false;
            this.KWin = false;
            this.AWin = false;
            this.scatterWin = false;
            this.moneyWin = false;
            this.logoWin = false;
            this.coinWin = false;
            this.hammerWin = false;
            this.bonusTriggReel = null;
            this.bonusScatterCount = 0;
            this.pigScatterCount = 0;
            this.scatterSymbols = [];
            this.scatterPositions = [];
            this.scatterCountForBonus = 3;
            this.J_SYMBOL = 8;
            this.Q_SYMBOL = 7;
            this.K_SYMBOL = 6;
            this.A_SYMBOL = 5;
            this.BONUS_SCATTER_SYMBOL = 10;
            this.PIG_SCATTER_SYMBOL = 9;
            this.LOGO_SYMBOL = 1;
            this.MONEY_SYMBOL = 2;
            this.COIN_SYMBOL = 3;
            this.HAMMER_SYMBOL = 4;
        };
        smashThePigGameController.GameModel.__name__ = ["smashThePigGameController", "GameModel"];
        smashThePigGameController.GameModel.prototype.HAMMER_SYMBOL = null;
        smashThePigGameController.GameModel.prototype.COIN_SYMBOL = null;
        smashThePigGameController.GameModel.prototype.MONEY_SYMBOL = null;
        smashThePigGameController.GameModel.prototype.LOGO_SYMBOL = null;
        smashThePigGameController.GameModel.prototype.PIG_SCATTER_SYMBOL = null;
        smashThePigGameController.GameModel.prototype.BONUS_SCATTER_SYMBOL = null;
        smashThePigGameController.GameModel.prototype.A_SYMBOL = null;
        smashThePigGameController.GameModel.prototype.K_SYMBOL = null;
        smashThePigGameController.GameModel.prototype.Q_SYMBOL = null;
        smashThePigGameController.GameModel.prototype.J_SYMBOL = null;
        smashThePigGameController.GameModel.prototype.scatterCountForBonus = null;
        smashThePigGameController.GameModel.prototype.scatterPositions = null;
        smashThePigGameController.GameModel.prototype.scatterSymbols = null;
        smashThePigGameController.GameModel.prototype.pigScatterCount = null;
        smashThePigGameController.GameModel.prototype.bonusScatterCount = null;
        smashThePigGameController.GameModel.prototype.bonusTriggReel = null;
        smashThePigGameController.GameModel.prototype.tensionReels = null;
        smashThePigGameController.GameModel.prototype.hammerWin = null;
        smashThePigGameController.GameModel.prototype.coinWin = null;
        smashThePigGameController.GameModel.prototype.logoWin = null;
        smashThePigGameController.GameModel.prototype.moneyWin = null;
        smashThePigGameController.GameModel.prototype.scatterWin = null;
        smashThePigGameController.GameModel.prototype.AWin = null;
        smashThePigGameController.GameModel.prototype.KWin = null;
        smashThePigGameController.GameModel.prototype.QWin = null;
        smashThePigGameController.GameModel.prototype.JWin = null;
        smashThePigGameController.GameModel.prototype.spinOutcome = null;
        smashThePigGameController.GameModel.prototype.outcome = null;
        smashThePigGameController.GameModel.prototype.startSpinPayload = null;
        smashThePigGameController.GameModel.prototype.landingSymbols = null;
        smashThePigGameController.GameModel.prototype.scatterWinMatrix = null;
        smashThePigGameController.GameModel.prototype.lineWinMatrix = null;
        smashThePigGameController.GameModel.prototype.bonusWinMatrix = null;
        smashThePigGameController.GameModel.prototype.hasTension = null;
        smashThePigGameController.GameModel.prototype.cellsNum = null;
        smashThePigGameController.GameModel.prototype.reelsNum = null;
        smashThePigGameController.GameModel.prototype.stakeState = null;
        smashThePigGameController.GameModel.prototype.lastAccumulatedPayout = null;
        smashThePigGameController.GameModel.prototype.pickerWins = null;
        smashThePigGameController.GameModel.prototype.playerChoice = null;
        smashThePigGameController.GameModel.prototype.isResume = null;
        smashThePigGameController.GameModel.prototype.retryChoice = null;
        smashThePigGameController.GameModel.prototype.resetSpinOutcome = function() {
            this.spinOutcome = null;
        };
        smashThePigGameController.GameModel.prototype.setSpinOutcome = function(spinOutcome) {
            this.spinOutcome = spinOutcome;
            this.setOutcome(this.spinOutcome.baseGame.outcome);
            haxe.Log.trace("GameController.setSpinOutcome.stage  ", {
                fileName: "GameModel.hx",
                lineNumber: 90,
                className: "smashthepig.components.gamecontroller.impl.GameModel",
                methodName: "setSpinOutcome",
                customParams: [this.spinOutcome.stage, " nextStage ", this.spinOutcome.nextStage]
            });
            haxe.Log.trace("GameController.setSpinOutcome.PICKER_PIG_A_PIG  ", {
                fileName: "GameModel.hx",
                lineNumber: 91,
                className: "smashthepig.components.gamecontroller.impl.GameModel",
                methodName: "setSpinOutcome",
                customParams: [smashThePigGameController.InternalStageType.PICKER_PIG_A_PIG.equals(this.spinOutcome.stage)]
            });
            haxe.Log.trace("GameController.setSpinOutcome.PICKER_SMASH_THE_PIG  ", {
                fileName: "GameModel.hx",
                lineNumber: 92,
                className: "smashthepig.components.gamecontroller.impl.GameModel",
                methodName: "setSpinOutcome",
                customParams: [smashThePigGameController.InternalStageType.PICKER_SMASH_THE_PIG.equals(this.spinOutcome.stage)]
            });
            if (smashThePigGameController.InternalStageType.PICKER_PIG_A_PIG.equals(this.spinOutcome.stage)) {
                if (this.spinOutcome.pickerBonus != null) {
                    if (this.spinOutcome.pickerBonus.outcome != null) {
                        this.pickerWins = this.spinOutcome.pickerBonus.outcome.pickerWins;
                        this.pickerWins[0].picks.sort(function(a, b) {
                            if (a.name < b.name) return -1;
                            if (a.name > b.name) return 1;
                            return 0;
                        });
                    }
                }
            } else if (smashThePigGameController.InternalStageType.PICKER_SMASH_THE_PIG.equals(this.spinOutcome.stage)) {
                if (this.spinOutcome.pickerBonus != null) {
                    if (this.spinOutcome.pickerBonus.outcome != null) {
                        this.pickerWins = this.spinOutcome.pickerBonus.outcome.pickerWins;
                        this.pickerWins[0].picks.sort(function(a1, b1) {
                            if (a1.name < b1.name) return -1;
                            if (a1.name > b1.name) return 1;
                            return 0;
                        });
                    }
                }
            }
        };
        smashThePigGameController.GameModel.prototype.resetPickerWins = function() {
            this.pickerWins = null;
        };
        smashThePigGameController.GameModel.prototype.setOutcome = function(outcome) {
            this.outcome = outcome;
            this.hammerWin = false;
            this.coinWin = false;
            this.logoWin = false;
            this.moneyWin = false;
            this.AWin = false;
            this.KWin = false;
            this.QWin = false;
            this.JWin = false;
            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(0);
                        }
                    }
                    $r = _g3;
                    return $r;
                }(this)));
            }
            this.landingSymbols = _g;
            var _g11 = [];
            var _g31 = 0;
            var _g21 = this.reelsNum;
            while (_g31 < _g21) {
                var i1 = _g31++;
                _g11.push((function($this) {
                    var $r;
                    var _g41 = []; {
                        var _g6 = 0;
                        var _g51 = $this.cellsNum;
                        while (_g6 < _g51) {
                            var j1 = _g6++;
                            _g41.push(0);
                        }
                    }
                    $r = _g41;
                    return $r;
                }(this)));
            }
            this.lineWinMatrix = _g11;
            if (outcome.lineWins != null) {
                var _g22 = 0;
                var _g32 = outcome.lineWins;
                while (_g22 < _g32.length) {
                    var lw = _g32[_g22];
                    ++_g22;
                    if (this.HAMMER_SYMBOL == lw.winningSymbol) this.hammerWin = true;
                    if (this.COIN_SYMBOL == lw.winningSymbol) this.coinWin = true;
                    if (this.LOGO_SYMBOL == lw.winningSymbol) this.logoWin = true;
                    if (this.MONEY_SYMBOL == lw.winningSymbol) this.moneyWin = true;
                    if (this.A_SYMBOL == lw.winningSymbol) this.AWin = true;
                    if (this.K_SYMBOL == lw.winningSymbol) this.KWin = true;
                    if (this.Q_SYMBOL == lw.winningSymbol) this.QWin = true;
                    if (this.J_SYMBOL == lw.winningSymbol) this.JWin = true;
                    var _g52 = 0;
                    var _g42 = this.reelsNum;
                    while (_g52 < _g42) {
                        var i2 = _g52++;
                        var _g7 = 0;
                        var _g61 = this.cellsNum;
                        while (_g7 < _g61) {
                            var j2 = _g7++;
                            if (lw.winPath.reelsInfo[i2][j2] == 1) this.lineWinMatrix[i2][j2] = 1;
                        }
                    }
                }
            }
            var _g23 = [];
            var _g43 = 0;
            var _g33 = this.reelsNum;
            while (_g43 < _g33) {
                var i3 = _g43++;
                _g23.push((function($this) {
                    var $r;
                    var _g53 = []; {
                        var _g71 = 0;
                        var _g62 = $this.cellsNum;
                        while (_g71 < _g62) {
                            var j3 = _g71++;
                            _g53.push(0);
                        }
                    }
                    $r = _g53;
                    return $r;
                }(this)));
            }
            this.bonusWinMatrix = _g23;
            if (outcome.bonusWins != null) {
                var _g34 = 0;
                var _g44 = outcome.bonusWins;
                while (_g34 < _g44.length) {
                    var bw = _g44[_g34];
                    ++_g34;
                    if (bw.type != "Princess") continue;
                    var _g63 = 0;
                    var _g54 = this.reelsNum;
                    while (_g63 < _g54) {
                        var i4 = _g63++;
                        var _g8 = 0;
                        var _g72 = this.cellsNum;
                        while (_g8 < _g72) {
                            var j4 = _g8++;
                            if (bw.winPath.reelsInfo[i4][j4] == 1) this.bonusWinMatrix[i4][j4] = 1;
                        }
                    }
                }
            }
            var _g35 = [];
            var _g55 = 0;
            var _g45 = this.reelsNum;
            while (_g55 < _g45) {
                var i5 = _g55++;
                _g35.push((function($this) {
                    var $r;
                    var _g64 = []; {
                        var _g81 = 0;
                        var _g73 = $this.cellsNum;
                        while (_g81 < _g73) {
                            var j5 = _g81++;
                            _g64.push(0);
                        }
                    }
                    $r = _g64;
                    return $r;
                }(this)));
            }
            this.scatterWinMatrix = _g35;
            if (outcome.scatterWins != null) {
                var _g46 = 0;
                var _g56 = outcome.scatterWins;
                while (_g46 < _g56.length) {
                    var sw = _g56[_g46];
                    ++_g46;
                    var _g74 = 0;
                    var _g65 = this.reelsNum;
                    while (_g74 < _g65) {
                        var i6 = _g74++;
                        var _g9 = 0;
                        var _g82 = this.cellsNum;
                        while (_g9 < _g82) {
                            var j6 = _g9++;
                            if (sw.winPath.reelsInfo[i6][j6] == 1) this.lineWinMatrix[i6][j6] = 1;
                        }
                    }
                }
            }
            var _g47 = [];
            var _g66 = 0;
            var _g57 = this.reelsNum;
            while (_g66 < _g57) {
                var i7 = _g66++;
                _g47.push(0);
            }
            this.tensionReels = _g47;
            var scatterCount = 0;
            if (this.outcome.scatterWins != null) {
                var scatterWinInfo = this.outcome.scatterWins[0].winPath.reelsInfo;
                var _g67 = 0;
                var _g58 = scatterWinInfo.length;
                while (_g67 < _g58) {
                    var i8 = _g67++;
                    if (_hcmn_.HxOverrides.indexOf(scatterWinInfo[i8], 1, 0) >= 0 || _hcmn_.HxOverrides.indexOf(scatterWinInfo[i8], 2, 0) >= 0) scatterCount++;
                }
            }
            if (_hcmn_.HxOverrides.indexOf(this.tensionReels, 1, 0) >= 0) this.hasTension = true;
            else this.hasTension = false;
        };
        smashThePigGameController.GameModel.prototype.calculateScatterPositions = function(scatterSymbolId) {
            var reels = this.outcome.reelStop.reels;
            var scatters = [];
            var firstScatterPos = null;
            var _g1 = 0;
            var _g = reels.length;
            while (_g1 < _g) {
                var i = _g1++;
                var _g3 = 0;
                var _g2 = reels[i].length;
                while (_g3 < _g2) {
                    var j = _g3++;
                    if (reels[i][j] == scatterSymbolId) {
                        if (firstScatterPos == null) firstScatterPos = i;
                        if (scatterSymbolId == this.PIG_SCATTER_SYMBOL) {
                            this.pigScatterCount++;
                            if (this.pigScatterCount == this.scatterCountForBonus) this.bonusTriggReel = i;
                        }
                        if (scatterSymbolId == this.BONUS_SCATTER_SYMBOL) {
                            this.bonusScatterCount++;
                            if (this.bonusScatterCount == this.scatterCountForBonus) this.bonusTriggReel = i;
                        }
                        scatters.push(j);
                        break;
                    }
                    if (j == reels[i].length - 1) scatters.push(-1);
                }
            }
            if (firstScatterPos >= 3) scatters = [-1, -1, -1, -1, -1];
            return scatters;
        };
        smashThePigGameController.GameModel.prototype.calculateTensionFrames = function() {
            this.pigScatterCount = 0;
            this.bonusScatterCount = 0;
            var bonusScatter = this.calculateScatterPositions(this.BONUS_SCATTER_SYMBOL);
            var pigScatter = this.calculateScatterPositions(this.PIG_SCATTER_SYMBOL);
            var allScatterPositions = [];
            this.scatterSymbols = [];
            var _g1 = 0;
            var _g = bonusScatter.length;
            while (_g1 < _g) {
                var i = _g1++;
                if (bonusScatter[i] > -1) this.scatterSymbols.push(this.BONUS_SCATTER_SYMBOL);
                else if (pigScatter[i] > -1) this.scatterSymbols.push(this.PIG_SCATTER_SYMBOL);
                else this.scatterSymbols.push(null);
                allScatterPositions.push(_hcmn_.Math.max(bonusScatter[i], pigScatter[i]));
            }
            this.scatterPositions = allScatterPositions;
            this.tensionReels = allScatterPositions;
        };
        smashThePigGameController.GameModel.prototype.getScatterPositions = function(reelId) {
            if (reelId == null) reelId = 0;
            var reels = this.outcome.reelStop.reels;
            if (reelId == this.bonusTriggReel) {
                this.scatterWin = true;
                this.bonusTriggReel = null;
            } else this.scatterWin = false;
            if (reelId == 0) return this.scatterPositions;
            var restSpiningReels = reels.length - reelId - 1;
            if (this.scatterCountForBonus - this.pigScatterCount > restSpiningReels) {
                var _g1 = 0;
                var _g = this.scatterSymbols.length;
                while (_g1 < _g) {
                    var i = _g1++;
                    if (this.scatterSymbols[i] == this.PIG_SCATTER_SYMBOL) this.scatterPositions[i] = -1;
                }
            }
            if (this.scatterCountForBonus - this.bonusScatterCount > restSpiningReels) {
                var _g11 = 0;
                var _g2 = this.scatterSymbols.length;
                while (_g11 < _g2) {
                    var i1 = _g11++;
                    if (this.scatterSymbols[i1] == this.BONUS_SCATTER_SYMBOL) this.scatterPositions[i1] = -1;
                }
            }
            return this.scatterPositions;
        };
        smashThePigGameController.GameModel.prototype.calcuateTensionReels = function() {
            var tension = [1, 1, 1, 1, 1];
            var pigCount = 0;
            var bonusCount = 0;
            var _g1 = 0;
            var _g = this.tensionReels.length;
            while (_g1 < _g) {
                var i = _g1++;
                tension[i] = 0;
                if (this.tensionReels[i] > -1) {
                    if (this.scatterSymbols[i] == this.PIG_SCATTER_SYMBOL) pigCount++;
                    if (this.scatterSymbols[i] == this.BONUS_SCATTER_SYMBOL) bonusCount++;
                    if (pigCount == 2 || bonusCount == 2) break;
                }
            }
            this.tensionReels = tension;
        };
        smashThePigGameController.GameModel.prototype.calculateTensions = function() {
            this.calculateTensionFrames();
            this.calcuateTensionReels();
        };
        smashThePigGameController.GameModel.prototype.getTensionReels = function() {
            return this.tensionReels;
        };
        smashThePigGameController.GameModel.prototype.getVisibilityForAllWins = function() {
            var visibility;
            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(0);
                        }
                    }
                    $r = _g3;
                    return $r;
                }(this)));
            }
            visibility = _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 (this.lineWinMatrix[i1][j1] == 1) {
                        visibility[i1][j1] = 1;
                        continue;
                    }
                    if (this.bonusWinMatrix[i1][j1] == 1) {
                        visibility[i1][j1] = 1;
                        continue;
                    }
                    if (this.scatterWinMatrix[i1][j1] == 1) {
                        visibility[i1][j1] = 1;
                        continue;
                    }
                }
            }
            return visibility;
        };
        smashThePigGameController.GameModel.prototype.getVisibilityForScatterWins = function() {
            return this.scatterWinMatrix;
        };
        smashThePigGameController.GameModel.prototype.setCurrentStake = function(stakeState) {
            this.stakeState = stakeState;
        };
        smashThePigGameController.GameModel.prototype.isHammerWin = function() {
            return this.hammerWin;
        };
        smashThePigGameController.GameModel.prototype.isCoinWin = function() {
            return this.coinWin;
        };
        smashThePigGameController.GameModel.prototype.isLogoWin = function() {
            return this.logoWin;
        };
        smashThePigGameController.GameModel.prototype.isAWin = function() {
            return this.AWin;
        };
        smashThePigGameController.GameModel.prototype.isKWin = function() {
            return this.KWin;
        };
        smashThePigGameController.GameModel.prototype.isQWin = function() {
            return this.QWin;
        };
        smashThePigGameController.GameModel.prototype.isJWin = function() {
            return this.JWin;
        };
        smashThePigGameController.GameModel.prototype.isMoneyWin = function() {
            return this.moneyWin;
        };
        smashThePigGameController.GameModel.prototype.getScatterSymbols = function() {
            return this.scatterSymbols;
        };
        smashThePigGameController.GameModel.prototype.__class__ = smashThePigGameController.GameModel;
        smashThePigGameController.SoundController = function(context, model) {
            this.playShortApplause = false;
            this.playLongApplause = false;
            this.startupEnded = false;
            this.pigsCount = 0;
            this.bonusCount = 0;
            this.model = model;
            this.soundPort = context.getUsedPort(soundManagerApi.ISoundManagerPort);
        };
        smashThePigGameController.SoundController.__name__ = ["smashThePigGameController", "SoundController"];
        smashThePigGameController.SoundController.prototype.soundPort = null;
        smashThePigGameController.SoundController.prototype.model = null;
        smashThePigGameController.SoundController.prototype.bonusCount = null;
        smashThePigGameController.SoundController.prototype.pigsCount = null;
        smashThePigGameController.SoundController.prototype.startupEnded = null;
        smashThePigGameController.SoundController.prototype.playLongApplause = null;
        smashThePigGameController.SoundController.prototype.playShortApplause = null;
        smashThePigGameController.SoundController.prototype.play = function(soundId) {
            if (!this.startupEnded && soundId != "startup") {
                this.soundPort.stop().publish("startup");
                this.startupEnded = true;
            }
            this.soundPort.play().publish(soundId);
            this.soundPort.onFinish().subscribe($bind(this, this.onFinish));
        };
        smashThePigGameController.SoundController.prototype.onFinish = function(e) {
            var id = e.getPayload();
            if (id == "STP_bonusIntro") this.soundPort.play().publish("STP_bonusloop");
        };
        smashThePigGameController.SoundController.prototype.reelStopped = function(reelId) {
            this.soundPort.play().publish("reel_stop");
            var scatterPositions = this.model.getScatterSymbols();
            var tensionReels = this.model.getTensionReels();
            if (_hcmn_.HxOverrides.indexOf(this.model.outcome.reelStop.reels[reelId], "" + this.model.BONUS_SCATTER_SYMBOL, 0) != -1) {
                this.soundPort.play().publish("triggerHitAnti_" + _hcmn_.Math.round(_hcmn_.Math.random() * 4 + 1));
                this.bonusCount++;
            }
            if (_hcmn_.HxOverrides.indexOf(this.model.outcome.reelStop.reels[reelId], "" + this.model.PIG_SCATTER_SYMBOL, 0) != -1) {
                this.soundPort.play().publish("scatter_hit_" + _hcmn_.Math.round(_hcmn_.Math.random() * 4 + 1));
                this.pigsCount++;
            }
            if (this.bonusCount >= 3 && !this.playLongApplause) {
                this.soundPort.play().publish("applause_and_cheering_5_sec");
                this.playLongApplause = true;
            }
            if (this.pigsCount >= 3 && !this.playShortApplause) {
                this.soundPort.play().publish("applause_and_cheering_5_sec");
                this.playShortApplause = true;
            }
            if (tensionReels[reelId + 1] == 1) this.soundPort.play().publish("L" + (reelId + 1));
        };
        smashThePigGameController.SoundController.prototype.spinStopped = function() {
            this.bonusCount = 0;
            this.pigsCount = 0;
            this.playShortApplause = false;
            this.playLongApplause = false;
            if (this.model.isHammerWin()) this.soundPort.play().publish("STP_hammer");
            if (this.model.isCoinWin()) this.soundPort.play().publish("STP_coin");
            if (this.model.isLogoWin()) this.soundPort.play().publish("STP_logo");
            if (this.model.isMoneyWin()) this.soundPort.play().publish("STP_money");
        };
        smashThePigGameController.SoundController.prototype.stopAllSounds = function() {
            this.soundPort.stop().publish(null);
            return this;
        };
        smashThePigGameController.SoundController.prototype.fadeOut = function(sound, length) {
            this.soundPort.fadeOut().publish(new soundManagerApi.SoundActionProperties(sound, length));
            return this;
        };
        smashThePigGameController.SoundController.prototype.muteSound = function() {
            this.soundPort.muteAll().publish(null);
        };
        smashThePigGameController.SoundController.prototype.unmuteSound = function() {
            this.soundPort.unmuteAll().publish(null);
        };
        smashThePigGameController.SoundController.prototype.__class__ = smashThePigGameController.SoundController;
        smashThePigGameController.StateMachineContext = function(dispatcher) {
            stateMachineEngine.SMContext.call(this, dispatcher);
        };
        smashThePigGameController.StateMachineContext.__name__ = ["smashThePigGameController", "StateMachineContext"];
        smashThePigGameController.StateMachineContext.__super__ = stateMachineEngine.SMContext;
        for (var k in stateMachineEngine.SMContext.prototype) smashThePigGameController.StateMachineContext.prototype[k] = stateMachineEngine.SMContext.prototype[k];
        smashThePigGameController.StateMachineContext.prototype.setupContextData = function(game) {
            this.set_contextValues(new _hcmn_.haxe_ds_StringMap());
            var this1 = this.get_contextValues();
            this1.set("awardCapExceeded", false);
            var this2 = this.get_contextValues();
            this2.set("Stage", "BaseGame");
            var this3 = this.get_contextValues();
            this3.set("NextStage", "PickerPickAPig");
            this.set_contextMethods(new _hcmn_.haxe_ds_StringMap());
            var this4 = this.get_contextMethods();
            this4.set("displayTotalWin", $bind(game, game.displayTotalWin));
            var this5 = this.get_contextMethods();
            this5.set("publishSpinOutcomePresented", $bind(game, game.publishSpinOutcomePresented));
            var this6 = this.get_contextMethods();
            this6.set("initGame", $bind(game, game.initGame));
            var this7 = this.get_contextMethods();
            this7.set("startBonusOutroAnim", $bind(game, game.startBonusOutroAnim));
            var this8 = this.get_contextMethods();
            this8.set("showScatterWins", $bind(game, game.showScatterWins));
            var this9 = this.get_contextMethods();
            this9.set("showIntro", $bind(game, game.showIntro));
            var this10 = this.get_contextMethods();
            this10.set("onBaseGameIdle", $bind(game, game.onBaseGameIdle));
            var this11 = this.get_contextMethods();
            this11.set("prepareResume", $bind(game, game.prepareResume));
            var this12 = this.get_contextMethods();
            this12.set("stopReels", $bind(game, game.stopReels));
            var this13 = this.get_contextMethods();
            this13.set("displayBaseGameWin", $bind(game, game.displayBaseGameWin));
            var this14 = this.get_contextMethods();
            this14.set("attachComponents", $bind(game, game.attachComponents));
            var this15 = this.get_contextMethods();
            this15.set("updateBetPanel", $bind(game, game.updateBetPanel));
            var this16 = this.get_contextMethods();
            this16.set("checkForStopOrAbort", $bind(game, game.checkForStopOrAbort));
            var this17 = this.get_contextMethods();
            this17.set("handleEnterBonus", $bind(game, game.handleEnterBonus));
            var this18 = this.get_contextMethods();
            this18.set("showAwardCapScreen", $bind(game, game.showAwardCapScreen));
            var this19 = this.get_contextMethods();
            this19.set("setBaseGameOutcome", $bind(game, game.setBaseGameOutcome));
            var this20 = this.get_contextMethods();
            this20.set("startPickerBonusIntro", $bind(game, game.startPickerBonusIntro));
            var this21 = this.get_contextMethods();
            this21.set("clearAllWins", $bind(game, game.clearAllWins));
            var this22 = this.get_contextMethods();
            this22.set("startSpin", $bind(game, game.startSpin));
            var this23 = this.get_contextMethods();
            this23.set("preparePickerBonus", $bind(game, game.preparePickerBonus));
            var this24 = this.get_contextMethods();
            this24.set("showBaseGameWins", $bind(game, game.showBaseGameWins));
            var this25 = this.get_contextMethods();
            this25.set("executeContinueCommand", $bind(game, game.executeContinueCommand));
            var this26 = this.get_contextMethods();
            this26.set("publishResultPresented", $bind(game, game.publishResultPresented));
            var this27 = this.get_contextMethods();
            this27.set("applyAbortData", $bind(game, game.applyAbortData));
            var this28 = this.get_contextMethods();
            this28.set("showBonusOutcome", $bind(game, game.showBonusOutcome));
            var this29 = this.get_contextMethods();
            this29.set("publishResumePrepared", $bind(game, game.publishResumePrepared));
            var this30 = this.get_contextMethods();
            this30.set("abortPickerBonus", $bind(game, game.abortPickerBonus));
        };
        smashThePigGameController.StateMachineContext.prototype.__class__ = smashThePigGameController.StateMachineContext;
        smashThePigGameController.StateMachineDef = function() {};
        smashThePigGameController.StateMachineDef.__name__ = ["smashThePigGameController", "StateMachineDef"];
        smashThePigGameController.StateMachineDef.prototype.__class__ = smashThePigGameController.StateMachineDef;
        smashThePigGameController.InternalStageType = function(value) {
            this.value = "";
            this.value = value;
        };
        smashThePigGameController.InternalStageType.__name__ = ["smashThePigGameController", "InternalStageType"];
        smashThePigGameController.InternalStageType.prototype.value = null;
        smashThePigGameController.InternalStageType.prototype.equals = function(that) {
            if (that != null && that.lastIndexOf(this.value) != -1) return true;
            return false;
        };
        smashThePigGameController.InternalStageType.prototype.__class__ = smashThePigGameController.InternalStageType;
        smashThePigGameController.StateMachineDef.ID = "GAMECONTROLLERSM_";;
        smashThePigGameController.StateMachineDef.PRESENT_RESULT = "PRESENT_RESULT";;
        smashThePigGameController.StateMachineDef.SPIN_STARTING_ENDED = "SPIN_STARTING_ENDED";;
        smashThePigGameController.StateMachineDef.RETRIGGER_SHOWN = "RETRIGGER_SHOWN";;
        smashThePigGameController.StateMachineDef.PREPARE_RESUME = "PREPARE_RESUME";;
        smashThePigGameController.StateMachineDef.PICKER_INTRO_SHOWN = "PICKER_INTRO_SHOWN";;
        smashThePigGameController.StateMachineDef.INIT_ACTION = "INIT_ACTION";;
        smashThePigGameController.StateMachineDef.STOP_REEL_SPIN = "STOP_REEL_SPIN";;
        smashThePigGameController.StateMachineDef.SPIN_ENABLED = "SPIN_ENABLED";;
        smashThePigGameController.StateMachineDef.PRESENT_SPIN_OUTCOME = "PRESENT_SPIN_OUTCOME";;
        smashThePigGameController.StateMachineDef.PICKER_INTRO_ENDED = "PICKER_INTRO_ENDED";;
        smashThePigGameController.StateMachineDef.ENTER_PICKER_BONUS = "ENTER_PICKER_BONUS";;
        smashThePigGameController.StateMachineDef.ABORT_SPIN = "ABORT_SPIN";;
        smashThePigGameController.StateMachineDef.CONTINUE = "CONTINUE";;
        smashThePigGameController.StateMachineDef.SCATTER_WIN_SHOWN = "SCATTER_WIN_SHOWN";;
        smashThePigGameController.StateMachineDef.CONTINUE_ENABLED = "CONTINUE_ENABLED";;
        smashThePigGameController.StateMachineDef.PICKER_OUTRO_END = "PICKER_OUTRO_END";;
        smashThePigGameController.StateMachineDef.INTRO_FINISHED_ACTION = "INTRO_FINISHED_ACTION";;
        smashThePigGameController.StateMachineDef.START_REEL_SPIN = "START_REEL_SPIN";;
        smashThePigGameController.StateMachineDef.WIN_STATE_SHOWN = "WIN_STATE_SHOWN";;
        smashThePigGameController.StateMachineDef.START_PICKER_WIN_INTRO = "START_PICKER_WIN_INTRO";;
        smashThePigGameController.StateMachineDef.SET_PICKER_IDLE = "SET_PICKER_IDLE";;
        smashThePigGameController.StateMachineDef.LOADING_STATE = "LOADING_STATE";;
        smashThePigGameController.StateMachineDef.PREPARE_RESUME_STATE = "PREPARE_RESUME_STATE";;
        smashThePigGameController.StateMachineDef.INIT_STATE = "INIT_STATE";;
        smashThePigGameController.StateMachineDef.INTRO_STATE = "INTRO_STATE";;
        smashThePigGameController.StateMachineDef.IDLE_STATE = "IDLE_STATE";;
        smashThePigGameController.StateMachineDef.FS_IDLE_STATE = "FS_IDLE_STATE";;
        smashThePigGameController.StateMachineDef.SPIN_STARTING_STATE = "SPIN_STARTING_STATE";;
        smashThePigGameController.StateMachineDef.ABORT_SPIN_STATE = "ABORT_SPIN_STATE";;
        smashThePigGameController.StateMachineDef.SPINNING_STATE = "SPINNING_STATE";;
        smashThePigGameController.StateMachineDef.STOPPING_STATE = "STOPPING_STATE";;
        smashThePigGameController.StateMachineDef.AWARD_CAP_PREPARE = "AWARD_CAP_PREPARE";;
        smashThePigGameController.StateMachineDef.SHOW_SCATTER_WIN = "SHOW_SCATTER_WIN";;
        smashThePigGameController.StateMachineDef.PICKER_OUTCOME = "PICKER_OUTCOME";;
        smashThePigGameController.StateMachineDef.PICKER_INTRO = "PICKER_INTRO";;
        smashThePigGameController.StateMachineDef.BASEGAME_OUTCOME = "BASEGAME_OUTCOME";;
        smashThePigGameController.StateMachineDef.PICKER_PICKING_STATE = "PICKER_PICKING_STATE";;
        smashThePigGameController.StateMachineDef.PICKER_OUTCOME_PRESENTED = "PICKER_OUTCOME_PRESENTED";;
        smashThePigGameController.StateMachineDef.PB_IDLE_STATE = "PB_IDLE_STATE";;
        smashThePigGameController.StateMachineDef.AWARD_CAP_STATE = "AWARD_CAP_STATE";;
        smashThePigGameController.StateMachineDef.PICKER_SUMMARY = "PICKER_SUMMARY";;
        smashThePigGameController.StateMachineDef.BET_CONFIRM = "BET_CONFIRM";;
        smashThePigGameController.StateMachineDef.RESUME_PREPARED_STATE = "RESUME_PREPARED_STATE";;
        smashThePigGameController.StateMachineDef.ABORT_PB_STATE = "ABORT_PB_STATE";;
        smashThePigGameController.StateMachineDef.FSM = "<fsm initial='LOADING_STATE'>\r\n  <state name='LOADING_STATE'>\r\n    <transition target='PREPARE_RESUME_STATE' action='PREPARE_RESUME'/>\r\n    <transition target='INIT_STATE' action='INIT_ACTION'/>\r\n    <operation type='do' method='attachComponents'/>\r\n  </state>\r\n  <state name='PREPARE_RESUME_STATE'>\r\n    <transition target='RESUME_PREPARED_STATE' action='PICKER_INTRO_ENDED'/>\t\r\n    <operation type='entry' method='prepareResume'/>\r\n\t<operation type='do' method='startPickerBonusIntro'/> \r\n    <operation type='exit' method='preparePickerBonus'/>\r\n\t\r\n  </state>\r\n  <state name='RESUME_PREPARED_STATE'>\r\n    <transition target='PB_IDLE_STATE' action='SET_PICKER_IDLE'/>\r\n    <operation type='do' method='publishResumePrepared'/>\r\n  </state>\r\n  <state name='INIT_STATE'>\r\n    <transition target='INTRO_STATE' action='SPIN_ENABLED'/>\r\n    <operation type='do' method='initGame'/>\r\n  </state>\r\n  <state name='INTRO_STATE'>\r\n    <transition target='IDLE_STATE' action='INTRO_FINISHED_ACTION'/>\r\n    <operation type='do' method='showIntro'/>\r\n  </state>\r\n  <state name='IDLE_STATE'>\r\n    <transition target='SPIN_STARTING_STATE' action='START_REEL_SPIN'/>\r\n    <operation type='do' method='onBaseGameIdle'/>\r\n    <operation type='exit' method='updateBetPanel'/>\r\n  </state>\r\n  <state name='FS_IDLE_STATE'>\r\n    <transition target='SPIN_STARTING_STATE' action='START_REEL_SPIN'/>\r\n    <operation type='do' method='executeContinueCommand'/>\r\n    <operation type='exit' method='updateBetPanel'/>\r\n  </state>\r\n  <state name='SPIN_STARTING_STATE'>\r\n    <transition target='SPINNING_STATE' action='SPIN_STARTING_ENDED'/>\r\n    <operation type='do' method='clearAllWins'/>\r\n    <operation type='do' method='startSpin'/>\r\n  </state>\r\n  <state name='ABORT_SPIN_STATE'>\r\n    <transition target='IDLE_STATE' action='SPIN_ENABLED'/>\r\n    <operation type='entry' method='applyAbortData'/>\r\n    //<operation type='do' method='stopReels'/>\r\n  </state>\r\n   <state name='ABORT_PB_STATE'>\r\n   <transition target='PB_IDLE_STATE' action='SET_PICKER_IDLE'/>\r\n    <operation type='entry' method='abortPickerBonus'/>\r\n  </state>\r\n  <state name='SPINNING_STATE'>\r\n    <transition target='STOPPING_STATE' action='STOP_REEL_SPIN'/>\r\n    <transition target='ABORT_SPIN_STATE' action='ABORT_SPIN'/>\r\n    <operation type='do' method='checkForStopOrAbort'/>\r\n  </state>\r\n  <state name='STOPPING_STATE'>\r\n    <transition target='BASEGAME_OUTCOME' condition='!awardCapExceeded,Stage==BaseGame,NextStage==BaseGame' action='PRESENT_SPIN_OUTCOME'/>\r\n    <transition target='SHOW_SCATTER_WIN' condition='!awardCapExceeded,Stage==BaseGame,NextStage!=BaseGame' action='PRESENT_SPIN_OUTCOME'/>\r\n    <transition target='AWARD_CAP_PREPARE' condition='awardCapExceeded' action='PRESENT_SPIN_OUTCOME'/>\r\n    <operation type='entry' method='stopReels'/>\r\n  </state>\r\n  <state name='AWARD_CAP_PREPARE'>\r\n    <transition target='AWARD_CAP_STATE' action='PRESENT_RESULT'/>\r\n    <operation type='do' method='setBaseGameOutcome'/>\r\n    <operation type='do' method='publishSpinOutcomePresented'/>\r\n  </state>\r\n  <state name='SHOW_SCATTER_WIN'>\r\n    <transition target='PICKER_INTRO' action='SCATTER_WIN_SHOWN'/>\r\n    <operation type='do' method='showScatterWins'/>\r\n  </state>\r\n  <state name='PICKER_OUTCOME'>\r\n    <transition target='PB_IDLE_STATE' action='SET_PICKER_IDLE'/>\r\n\t <transition target='PICKER_SUMMARY' action='PRESENT_RESULT'/>\r\n    <operation type='exit' method='showBonusOutcome'/>\r\n\t<operation type='do' method='publishSpinOutcomePresented'/>\r\n  </state>\r\n   <state name='PICKER_OUTCOME_PRESENTED'>\r\n    <transition target='PB_IDLE_STATE' action='SET_PICKER_IDLE'/>\r\n     <operation type='do' method='publishSpinOutcomePresented'/>\r\n  </state>\r\n  <state name='PICKER_INTRO'>\r\n    <transition target='PICKER_OUTCOME_PRESENTED' action='PICKER_INTRO_ENDED'/>\r\n    <operation type='entry' method='startPickerBonusIntro'/>\r\n    <operation type='exit' method='preparePickerBonus'/>\r\n  </state>\r\n  <state name='BASEGAME_OUTCOME'>\r\n    <transition target='BET_CONFIRM' action='PRESENT_RESULT'/>\r\n    <operation type='entry' method='showBaseGameWins'/>\r\n    <operation type='entry' method='displayBaseGameWin'/>\r\n    <operation type='do' method='publishSpinOutcomePresented'/>\r\n  </state>\r\n  <state name='PICKER_PICKING_STATE'>\r\n    <transition target='PICKER_OUTCOME' condition='!awardCapExceeded' action='PRESENT_SPIN_OUTCOME'/>\r\n    <transition target='AWARD_CAP_PREPARE' condition='awardCapExceeded' action='PRESENT_SPIN_OUTCOME'/>\r\n\t<transition target='ABORT_PB_STATE' condition='!awardCapExceeded' action='ABORT_SPIN'/>\r\n    <operation type='do' method='handleEnterBonus'/>\r\n  </state>\r\n  <state name='PB_IDLE_STATE'>\r\n    <transition target='PICKER_PICKING_STATE' action='ENTER_PICKER_BONUS'/>\r\n    <transition target='FS_IDLE_STATE' action='CONTINUE_ENABLED'/>\r\n  </state>\r\n  <state name='AWARD_CAP_STATE'>\r\n    <transition target='BET_CONFIRM' action='CONTINUE'/>\r\n    <operation type='do' method='showAwardCapScreen'/>\r\n  </state>\r\n  <state name='PICKER_SUMMARY'>\r\n    <transition target='BET_CONFIRM' action='PICKER_OUTRO_END'/>\r\n    <operation type='do' method='startBonusOutroAnim'/>\r\n    <operation type='do' method='setBaseGameOutcome'/>\r\n    <operation type='exit' method='showBaseGameWins'/>\r\n    <operation type='exit' method='displayTotalWin'/>\r\n  </state>\r\n  <state name='BET_CONFIRM'>\r\n    <transition target='IDLE_STATE' action='SPIN_ENABLED'/>\r\n    <operation type='do' method='publishResultPresented'/>\r\n  </state>\r\n</fsm>";;
        smashThePigGameController.InternalStageType.PICKER_SMASH_THE_PIG = new smashThePigGameController.InternalStageType("PickerSmashThePig");;
        smashThePigGameController.InternalStageType.PICKER_PIG_A_PIG = new smashThePigGameController.InternalStageType("PickerPickAPig");;
        smashThePigGameController.InternalStageType.BASE_GAME = "BaseGame";;
        return {
            exports: smashThePigGameController,
            activator: smashThePigGameController.Activator
        };
    });
//# sourceURL=smashThePigGameController.js