(()=>{function n(e,n,t,i){var o,r,s=this,a=[],l={};function u(){return o}function d(n){o=n}function c(n){return r&&r.stepId===n}function f(n){return _.findIndex(o,{stepId:n})<_.findIndex(o,{stepId:r.stepId})}function p(n){return!c(n)&&!f(n)}function m(n){g(_.find(a,{stepId:n}))}function g(n){var t=n.element.find(".c8y-wizard-panel");jQuery(t).wizardSlide(),r=n}_.assign(s,{data:l,$onInit:function(){n(function(){var n=_.cloneDeep(a);d(n=s.initialFlow?_.map(s.initialFlow,function(n){return _.find(a,{stepId:n})}):n),_.assign(l,s.initialData),m(_.first(o).stepId)},200),s.getController({controller:s})},registerStep:function(n){var t=e.find("c8y-wizard-step");a.push(n),a=_.sortBy(a,function(n){return t.index(n.element)})},unregisterStep:function(t){_.remove(a,function(n){return n.stepId===t})},addStep:function(n){var t=o;t.push(_.find(a,{stepId:n})),d(t)},getFlow:u,setFlow:d,setFlowFromStepIds:function(n){var t=[];_.each(n,function(n){t.push(_.find(a,{stepId:n}))}),d(t)},getCurrentStep:function(){return r},getStepClasses:function(n){return{active:c(n),completed:f(n),disabled:p(n)}},isStepActive:c,isStepDisabled:p,isStepCompleted:f,getModalHeaderClass:function(){return _.get(r,"modalHeaderClass","bg-primary")},goTo:m,goToIndex:function(n){g(a[n])},close:function(n){s.onClose(_.assign(n,{data:l}))},dismiss:function(){s.onDismiss()},hasTransclusionContents:function(n){return t.isSlotFilled(n)},setAllowUserInteraction:function(n){s.requestInProgress=!n},forceResize:function(){n(function(){i.emitWindowResize()},500)}})}n.$inject=["$element","$timeout","$transclude","c8yUiUtil"],angular.module("c8y.ui").component("c8yWizard",{bindings:{initialFlow:"<?",initialData:"<?",onClose:"&",onDismiss:"&",getController:"&"},transclude:{header:"?header",steps:"?steps",footer:"?footer"},templateUrl:":::PLUGIN_PATH:::/ui/containers/wizard.html",controller:n,controllerAs:"wizardCtrl"})})();