
({
	init: function (cmp, event, helper) {
		helper.init(cmp, event);
	},

    show: function (cmp, event, helper) {
        var callback = event.getParam && event.getParam('arguments').callback;
        helper.show(cmp, callback);
    },

    hide: function (cmp, event, helper) {
        var callback = event.getParam && event.getParam('arguments').callback;
        helper.hide(cmp, callback);
    },

    close: function (cmp, event, helper) {
        var callback = event.getParam && event.getParam('arguments').callback;
        var shouldReturnFocus = event.getParam && $A.util.getBooleanValue(event.getParam('arguments').shouldReturnFocus);
        helper.close(cmp, callback, shouldReturnFocus);
    },

    update: function(cmp, event, helper) {
        var args = event.getParam && event.getParam('arguments');
        helper.lib.panelLibCore.updatePanel(cmp, args.facets, args.callback);
    },

    setActive: function(cmp, event, helper) {
        helper.lib.panelLibCore.setActive(cmp, event.getParam('arguments').active);
    },

    onRefChange: function(cmp, event, helper) {
        helper.reposition(cmp);
    },

    onNotify: function(cmp, event, helper) {
        helper.lib.panelLibCore.handleNotify(cmp, event, helper);
    },

    onCloseBtnPressed: function(cmp, event, helper) {
        var closeAction = cmp.get('v.closeAction');
        
        if ($A.util.isFunction(closeAction)) {
            closeAction(cmp, "closeOnButtonClick");
        } else {
            helper.close(cmp, null, true);
        }
    }
})// eslint-disable-line semi
