!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("@angular/core"),require("@angular/common"),require("primeng/api"),require("@angular/router"),require("primeng/ripple")):"function"==typeof define&&define.amd?define("primeng/megamenu",["exports","@angular/core","@angular/common","primeng/api","@angular/router","primeng/ripple"],t):t(((e="undefined"!=typeof globalThis?globalThis:e||self).primeng=e.primeng||{},e.primeng.megamenu={}),e.ng.core,e.ng.common,e.primeng.api,e.ng.router,e.primeng.ripple)}(this,(function(e,t,n,a,i,l){"use strict";var r=function(){function e(e,t,n){this.el=e,this.renderer=t,this.cd=n,this.orientation="horizontal",this.autoZIndex=!0,this.baseZIndex=0}return e.prototype.ngAfterContentInit=function(){var e=this;this.templates.forEach((function(t){switch(t.getType()){case"start":e.startTemplate=t.template;break;case"end":e.endTemplate=t.template}}))},e.prototype.onCategoryMouseEnter=function(e,t){t.disabled?e.preventDefault():this.activeItem&&(this.activeItem=t)},e.prototype.onCategoryClick=function(e,t){t.disabled?e.preventDefault():(t.url||e.preventDefault(),t.command&&t.command({originalEvent:e,item:t}),t.items&&(this.activeItem&&this.activeItem===t?(this.activeItem=null,this.unbindDocumentClickListener()):(this.activeItem=t,this.bindDocumentClickListener())))},e.prototype.itemClick=function(e,t){t.disabled?e.preventDefault():(t.url||e.preventDefault(),t.command&&t.command({originalEvent:e,item:t}),this.activeItem=null)},e.prototype.getColumnClass=function(e){var t;switch(e.items?e.items.length:0){case 2:t="p-megamenu-col-6";break;case 3:t="p-megamenu-col-4";break;case 4:t="p-megamenu-col-3";break;case 6:t="p-megamenu-col-2";break;default:t="p-megamenu-col-12"}return t},e.prototype.bindDocumentClickListener=function(){var e=this;this.documentClickListener||(this.documentClickListener=function(t){e.el&&!e.el.nativeElement.contains(t.target)&&(e.activeItem=null,e.unbindDocumentClickListener(),e.cd.markForCheck())},document.addEventListener("click",this.documentClickListener))},e.prototype.unbindDocumentClickListener=function(){this.documentClickListener&&(document.removeEventListener("click",this.documentClickListener),this.documentClickListener=null)},e}();r.decorators=[{type:t.Component,args:[{selector:"p-megaMenu",template:'\n