{
"version": 3,
"sources": ["../../../../../node_modules/ng-zorro-antd/fesm2022/ng-zorro-antd-menu.mjs"],
"sourcesContent": ["import { __decorate } from 'tslib';\nimport * as i0 from '@angular/core';\nimport { InjectionToken, Injectable, SkipSelf, Optional, Inject, Component, ChangeDetectionStrategy, ViewEncapsulation, Input, ContentChildren, EventEmitter, Output, ElementRef, Host, ViewChild, forwardRef, inject, Directive, NgModule } from '@angular/core';\nimport { Subject, BehaviorSubject, merge, combineLatest } from 'rxjs';\nimport { map, mergeMap, filter, mapTo, auditTime, distinctUntilChanged, takeUntil, startWith, switchMap } from 'rxjs/operators';\nimport { InputBoolean } from 'ng-zorro-antd/core/util';\nimport * as i4 from '@angular/router';\nimport { NavigationEnd, RouterLink } from '@angular/router';\nimport * as i1 from '@angular/cdk/bidi';\nimport * as i6 from '@angular/cdk/overlay';\nimport { CdkOverlayOrigin, OverlayModule } from '@angular/cdk/overlay';\nimport { NgTemplateOutlet, NgClass, NgIf, NgSwitch, NgSwitchCase, NgSwitchDefault } from '@angular/common';\nimport * as i5 from 'ng-zorro-antd/core/no-animation';\nimport { NzNoAnimationDirective } from 'ng-zorro-antd/core/no-animation';\nimport { POSITION_MAP, getPlacementName } from 'ng-zorro-antd/core/overlay';\nimport { collapseMotion, zoomBigMotion, slideMotion } from 'ng-zorro-antd/core/animation';\nimport * as i3 from 'ng-zorro-antd/core/outlet';\nimport { NzOutletModule } from 'ng-zorro-antd/core/outlet';\nimport * as i2 from 'ng-zorro-antd/icon';\nimport { NzIconModule } from 'ng-zorro-antd/icon';\nimport * as i3$1 from '@angular/cdk/platform';\n\n/**\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/NG-ZORRO/ng-zorro-antd/blob/master/LICENSE\n */\nconst _c0 = [\"nz-menu-item\", \"\"];\nconst _c1 = [\"*\"];\nconst _c2 = [\"nz-submenu-inline-child\", \"\"];\nfunction NzSubmenuInlineChildComponent_ng_template_0_Template(rf, ctx) {}\nconst _c3 = [\"nz-submenu-none-inline-child\", \"\"];\nfunction NzSubmenuNoneInlineChildComponent_ng_template_1_Template(rf, ctx) {}\nconst _c4 = [\"nz-submenu-title\", \"\"];\nfunction NzSubMenuTitleComponent_span_0_Template(rf, ctx) {\n if (rf & 1) {\n i0.ɵɵelement(0, \"span\", 4);\n }\n if (rf & 2) {\n const ctx_r0 = i0.ɵɵnextContext();\n i0.ɵɵproperty(\"nzType\", ctx_r0.nzIcon);\n }\n}\nfunction NzSubMenuTitleComponent_ng_container_1_Template(rf, ctx) {\n if (rf & 1) {\n i0.ɵɵelementContainerStart(0);\n i0.ɵɵelementStart(1, \"span\", 5);\n i0.ɵɵtext(2);\n i0.ɵɵelementEnd();\n i0.ɵɵelementContainerEnd();\n }\n if (rf & 2) {\n const ctx_r1 = i0.ɵɵnextContext();\n i0.ɵɵadvance(2);\n i0.ɵɵtextInterpolate(ctx_r1.nzTitle);\n }\n}\nfunction NzSubMenuTitleComponent_span_3_span_1_Template(rf, ctx) {\n if (rf & 1) {\n i0.ɵɵelement(0, \"span\", 9);\n }\n}\nfunction NzSubMenuTitleComponent_span_3_span_2_Template(rf, ctx) {\n if (rf & 1) {\n i0.ɵɵelement(0, \"span\", 10);\n }\n}\nfunction NzSubMenuTitleComponent_span_3_Template(rf, ctx) {\n if (rf & 1) {\n i0.ɵɵelementStart(0, \"span\", 6);\n i0.ɵɵtemplate(1, NzSubMenuTitleComponent_span_3_span_1_Template, 1, 0, \"span\", 7)(2, NzSubMenuTitleComponent_span_3_span_2_Template, 1, 0, \"span\", 8);\n i0.ɵɵelementEnd();\n }\n if (rf & 2) {\n const ctx_r2 = i0.ɵɵnextContext();\n i0.ɵɵproperty(\"ngSwitch\", ctx_r2.dir);\n i0.ɵɵadvance(1);\n i0.ɵɵproperty(\"ngSwitchCase\", \"rtl\");\n }\n}\nfunction NzSubMenuTitleComponent_ng_template_4_Template(rf, ctx) {\n if (rf & 1) {\n i0.ɵɵelement(0, \"span\", 11);\n }\n}\nconst _c5 = [\"nz-submenu\", \"\"];\nfunction NzSubMenuComponent_ng_content_2_Template(rf, ctx) {\n if (rf & 1) {\n i0.ɵɵprojection(0, 0, [\"*ngIf\", \"!nzTitle\"]);\n }\n}\nfunction NzSubMenuComponent_div_3_Template(rf, ctx) {\n if (rf & 1) {\n i0.ɵɵelement(0, \"div\", 6);\n }\n if (rf & 2) {\n const ctx_r2 = i0.ɵɵnextContext();\n const _r6 = i0.ɵɵreference(7);\n i0.ɵɵproperty(\"mode\", ctx_r2.mode)(\"nzOpen\", ctx_r2.nzOpen)(\"@.disabled\", !!(ctx_r2.noAnimation == null ? null : ctx_r2.noAnimation.nzNoAnimation))(\"nzNoAnimation\", ctx_r2.noAnimation == null ? null : ctx_r2.noAnimation.nzNoAnimation)(\"menuClass\", ctx_r2.nzMenuClassName)(\"templateOutlet\", _r6);\n }\n}\nfunction NzSubMenuComponent_ng_template_4_ng_template_0_Template(rf, ctx) {\n if (rf & 1) {\n const _r9 = i0.ɵɵgetCurrentView();\n i0.ɵɵelementStart(0, \"div\", 8);\n i0.ɵɵlistener(\"subMenuMouseState\", function NzSubMenuComponent_ng_template_4_ng_template_0_Template_div_subMenuMouseState_0_listener($event) {\n i0.ɵɵrestoreView(_r9);\n const ctx_r8 = i0.ɵɵnextContext(2);\n return i0.ɵɵresetView(ctx_r8.setMouseEnterState($event));\n });\n i0.ɵɵelementEnd();\n }\n if (rf & 2) {\n const ctx_r7 = i0.ɵɵnextContext(2);\n const _r6 = i0.ɵɵreference(7);\n i0.ɵɵproperty(\"theme\", ctx_r7.theme)(\"mode\", ctx_r7.mode)(\"nzOpen\", ctx_r7.nzOpen)(\"position\", ctx_r7.position)(\"nzDisabled\", ctx_r7.nzDisabled)(\"isMenuInsideDropDown\", ctx_r7.isMenuInsideDropDown)(\"templateOutlet\", _r6)(\"menuClass\", ctx_r7.nzMenuClassName)(\"@.disabled\", !!(ctx_r7.noAnimation == null ? null : ctx_r7.noAnimation.nzNoAnimation))(\"nzNoAnimation\", ctx_r7.noAnimation == null ? null : ctx_r7.noAnimation.nzNoAnimation);\n }\n}\nfunction NzSubMenuComponent_ng_template_4_Template(rf, ctx) {\n if (rf & 1) {\n const _r11 = i0.ɵɵgetCurrentView();\n i0.ɵɵtemplate(0, NzSubMenuComponent_ng_template_4_ng_template_0_Template, 1, 10, \"ng-template\", 7);\n i0.ɵɵlistener(\"positionChange\", function NzSubMenuComponent_ng_template_4_Template_ng_template_positionChange_0_listener($event) {\n i0.ɵɵrestoreView(_r11);\n const ctx_r10 = i0.ɵɵnextContext();\n return i0.ɵɵresetView(ctx_r10.onPositionChange($event));\n });\n }\n if (rf & 2) {\n const ctx_r3 = i0.ɵɵnextContext();\n const _r0 = i0.ɵɵreference(1);\n i0.ɵɵproperty(\"cdkConnectedOverlayPositions\", ctx_r3.overlayPositions)(\"cdkConnectedOverlayOrigin\", _r0)(\"cdkConnectedOverlayWidth\", ctx_r3.triggerWidth)(\"cdkConnectedOverlayOpen\", ctx_r3.nzOpen)(\"cdkConnectedOverlayTransformOriginOn\", \".ant-menu-submenu\");\n }\n}\nfunction NzSubMenuComponent_ng_template_6_Template(rf, ctx) {\n if (rf & 1) {\n i0.ɵɵprojection(0, 1);\n }\n}\nconst _c6 = [[[\"\", \"title\", \"\"]], \"*\"];\nconst _c7 = [\"[title]\", \"*\"];\nconst _c8 = [\"titleElement\"];\nconst _c9 = [\"nz-menu-group\", \"\"];\nfunction NzMenuGroupComponent_ng_container_2_Template(rf, ctx) {\n if (rf & 1) {\n i0.ɵɵelementContainerStart(0);\n i0.ɵɵtext(1);\n i0.ɵɵelementContainerEnd();\n }\n if (rf & 2) {\n const ctx_r1 = i0.ɵɵnextContext();\n i0.ɵɵadvance(1);\n i0.ɵɵtextInterpolate(ctx_r1.nzTitle);\n }\n}\nfunction NzMenuGroupComponent_ng_content_3_Template(rf, ctx) {\n if (rf & 1) {\n i0.ɵɵprojection(0, 1, [\"*ngIf\", \"!nzTitle\"]);\n }\n}\nconst _c10 = [\"*\", [[\"\", \"title\", \"\"]]];\nconst _c11 = [\"*\", \"[title]\"];\nconst NzIsMenuInsideDropDownToken = new InjectionToken('NzIsInDropDownMenuToken');\nconst NzMenuServiceLocalToken = new InjectionToken('NzMenuServiceLocalToken');\n\n/**\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/NG-ZORRO/ng-zorro-antd/blob/master/LICENSE\n */\nclass MenuService {\n constructor() {\n /** all descendant menu click **/\n this.descendantMenuItemClick$ = new Subject();\n /** child menu item click **/\n this.childMenuItemClick$ = new Subject();\n this.theme$ = new BehaviorSubject('light');\n this.mode$ = new BehaviorSubject('vertical');\n this.inlineIndent$ = new BehaviorSubject(24);\n this.isChildSubMenuOpen$ = new BehaviorSubject(false);\n }\n onDescendantMenuItemClick(menu) {\n this.descendantMenuItemClick$.next(menu);\n }\n onChildMenuItemClick(menu) {\n this.childMenuItemClick$.next(menu);\n }\n setMode(mode) {\n this.mode$.next(mode);\n }\n setTheme(theme) {\n this.theme$.next(theme);\n }\n setInlineIndent(indent) {\n this.inlineIndent$.next(indent);\n }\n static {\n this.ɵfac = function MenuService_Factory(t) {\n return new (t || MenuService)();\n };\n }\n static {\n this.ɵprov = /* @__PURE__ */i0.ɵɵdefineInjectable({\n token: MenuService,\n factory: MenuService.ɵfac\n });\n }\n}\n(() => {\n (typeof ngDevMode === \"undefined\" || ngDevMode) && i0.ɵsetClassMetadata(MenuService, [{\n type: Injectable\n }], null, null);\n})();\n\n/**\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/NG-ZORRO/ng-zorro-antd/blob/master/LICENSE\n */\nclass NzSubmenuService {\n /**\n * menu item inside submenu clicked\n *\n * @param menu\n */\n onChildMenuItemClick(menu) {\n this.childMenuItemClick$.next(menu);\n }\n setOpenStateWithoutDebounce(value) {\n this.isCurrentSubMenuOpen$.next(value);\n }\n setMouseEnterTitleOrOverlayState(value) {\n this.isMouseEnterTitleOrOverlay$.next(value);\n }\n constructor(nzHostSubmenuService, nzMenuService, isMenuInsideDropDown) {\n this.nzHostSubmenuService = nzHostSubmenuService;\n this.nzMenuService = nzMenuService;\n this.isMenuInsideDropDown = isMenuInsideDropDown;\n this.mode$ = this.nzMenuService.mode$.pipe(map(mode => {\n if (mode === 'inline') {\n return 'inline';\n /** if inside another submenu, set the mode to vertical **/\n } else if (mode === 'vertical' || this.nzHostSubmenuService) {\n return 'vertical';\n } else {\n return 'horizontal';\n }\n }));\n this.level = 1;\n this.isCurrentSubMenuOpen$ = new BehaviorSubject(false);\n this.isChildSubMenuOpen$ = new BehaviorSubject(false);\n /** submenu title & overlay mouse enter status **/\n this.isMouseEnterTitleOrOverlay$ = new Subject();\n this.childMenuItemClick$ = new Subject();\n this.destroy$ = new Subject();\n if (this.nzHostSubmenuService) {\n this.level = this.nzHostSubmenuService.level + 1;\n }\n /** close if menu item clicked **/\n const isClosedByMenuItemClick = this.childMenuItemClick$.pipe(mergeMap(() => this.mode$), filter(mode => mode !== 'inline' || this.isMenuInsideDropDown), mapTo(false));\n const isCurrentSubmenuOpen$ = merge(this.isMouseEnterTitleOrOverlay$, isClosedByMenuItemClick);\n /** combine the child submenu status with current submenu status to calculate host submenu open **/\n const isSubMenuOpenWithDebounce$ = combineLatest([this.isChildSubMenuOpen$, isCurrentSubmenuOpen$]).pipe(map(([isChildSubMenuOpen, isCurrentSubmenuOpen]) => isChildSubMenuOpen || isCurrentSubmenuOpen), auditTime(150), distinctUntilChanged(), takeUntil(this.destroy$));\n isSubMenuOpenWithDebounce$.pipe(distinctUntilChanged()).subscribe(data => {\n this.setOpenStateWithoutDebounce(data);\n if (this.nzHostSubmenuService) {\n /** set parent submenu's child submenu open status **/\n this.nzHostSubmenuService.isChildSubMenuOpen$.next(data);\n } else {\n this.nzMenuService.isChildSubMenuOpen$.next(data);\n }\n });\n }\n ngOnDestroy() {\n this.destroy$.next();\n this.destroy$.complete();\n }\n static {\n this.ɵfac = function NzSubmenuService_Factory(t) {\n return new (t || NzSubmenuService)(i0.ɵɵinject(NzSubmenuService, 12), i0.ɵɵinject(MenuService), i0.ɵɵinject(NzIsMenuInsideDropDownToken));\n };\n }\n static {\n this.ɵprov = /* @__PURE__ */i0.ɵɵdefineInjectable({\n token: NzSubmenuService,\n factory: NzSubmenuService.ɵfac\n });\n }\n}\n(() => {\n (typeof ngDevMode === \"undefined\" || ngDevMode) && i0.ɵsetClassMetadata(NzSubmenuService, [{\n type: Injectable\n }], () => [{\n type: NzSubmenuService,\n decorators: [{\n type: SkipSelf\n }, {\n type: Optional\n }]\n }, {\n type: MenuService\n }, {\n type: undefined,\n decorators: [{\n type: Inject,\n args: [NzIsMenuInsideDropDownToken]\n }]\n }], null);\n})();\nclass NzMenuItemComponent {\n /** clear all item selected status except this */\n clickMenuItem(e) {\n if (this.nzDisabled) {\n e.preventDefault();\n e.stopPropagation();\n } else {\n this.nzMenuService.onDescendantMenuItemClick(this);\n if (this.nzSubmenuService) {\n /** menu item inside the submenu **/\n this.nzSubmenuService.onChildMenuItemClick(this);\n } else {\n /** menu item inside the root menu **/\n this.nzMenuService.onChildMenuItemClick(this);\n }\n }\n }\n setSelectedState(value) {\n this.nzSelected = value;\n this.selected$.next(value);\n }\n updateRouterActive() {\n if (!this.listOfRouterLink || !this.router || !this.router.navigated || !this.nzMatchRouter) {\n return;\n }\n Promise.resolve().then(() => {\n const hasActiveLinks = this.hasActiveLinks();\n if (this.nzSelected !== hasActiveLinks) {\n this.nzSelected = hasActiveLinks;\n this.setSelectedState(this.nzSelected);\n this.cdr.markForCheck();\n }\n });\n }\n hasActiveLinks() {\n const isActiveCheckFn = this.isLinkActive(this.router);\n return this.routerLink && isActiveCheckFn(this.routerLink) || this.listOfRouterLink.some(isActiveCheckFn);\n }\n isLinkActive(router) {\n return link => router.isActive(link.urlTree || '', {\n paths: this.nzMatchRouterExact ? 'exact' : 'subset',\n queryParams: this.nzMatchRouterExact ? 'exact' : 'subset',\n fragment: 'ignored',\n matrixParams: 'ignored'\n });\n }\n constructor(nzMenuService, cdr, nzSubmenuService, isMenuInsideDropDown, directionality, routerLink, router) {\n this.nzMenuService = nzMenuService;\n this.cdr = cdr;\n this.nzSubmenuService = nzSubmenuService;\n this.isMenuInsideDropDown = isMenuInsideDropDown;\n this.directionality = directionality;\n this.routerLink = routerLink;\n this.router = router;\n this.destroy$ = new Subject();\n this.level = this.nzSubmenuService ? this.nzSubmenuService.level + 1 : 1;\n this.selected$ = new Subject();\n this.inlinePaddingLeft = null;\n this.dir = 'ltr';\n this.nzDisabled = false;\n this.nzSelected = false;\n this.nzDanger = false;\n this.nzMatchRouterExact = false;\n this.nzMatchRouter = false;\n if (router) {\n this.router.events.pipe(takeUntil(this.destroy$), filter(e => e instanceof NavigationEnd)).subscribe(() => {\n this.updateRouterActive();\n });\n }\n }\n ngOnInit() {\n /** store origin padding in padding */\n combineLatest([this.nzMenuService.mode$, this.nzMenuService.inlineIndent$]).pipe(takeUntil(this.destroy$)).subscribe(([mode, inlineIndent]) => {\n this.inlinePaddingLeft = mode === 'inline' ? this.level * inlineIndent : null;\n });\n this.dir = this.directionality.value;\n this.directionality.change?.pipe(takeUntil(this.destroy$)).subscribe(direction => {\n this.dir = direction;\n });\n }\n ngAfterContentInit() {\n this.listOfRouterLink.changes.pipe(takeUntil(this.destroy$)).subscribe(() => this.updateRouterActive());\n this.updateRouterActive();\n }\n ngOnChanges(changes) {\n if (changes.nzSelected) {\n this.setSelectedState(this.nzSelected);\n }\n }\n ngOnDestroy() {\n this.destroy$.next(true);\n this.destroy$.complete();\n }\n static {\n this.ɵfac = function NzMenuItemComponent_Factory(t) {\n return new (t || NzMenuItemComponent)(i0.ɵɵdirectiveInject(MenuService), i0.ɵɵdirectiveInject(i0.ChangeDetectorRef), i0.ɵɵdirectiveInject(NzSubmenuService, 8), i0.ɵɵdirectiveInject(NzIsMenuInsideDropDownToken), i0.ɵɵdirectiveInject(i1.Directionality, 8), i0.ɵɵdirectiveInject(i4.RouterLink, 8), i0.ɵɵdirectiveInject(i4.Router, 8));\n };\n }\n static {\n this.ɵcmp = /* @__PURE__ */i0.ɵɵdefineComponent({\n type: NzMenuItemComponent,\n selectors: [[\"\", \"nz-menu-item\", \"\"]],\n contentQueries: function NzMenuItemComponent_ContentQueries(rf, ctx, dirIndex) {\n if (rf & 1) {\n i0.ɵɵcontentQuery(dirIndex, RouterLink, 5);\n }\n if (rf & 2) {\n let _t;\n i0.ɵɵqueryRefresh(_t = i0.ɵɵloadQuery()) && (ctx.listOfRouterLink = _t);\n }\n },\n hostVars: 20,\n hostBindings: function NzMenuItemComponent_HostBindings(rf, ctx) {\n if (rf & 1) {\n i0.ɵɵlistener(\"click\", function NzMenuItemComponent_click_HostBindingHandler($event) {\n return ctx.clickMenuItem($event);\n });\n }\n if (rf & 2) {\n i0.ɵɵstyleProp(\"padding-left\", ctx.dir === \"rtl\" ? null : ctx.nzPaddingLeft || ctx.inlinePaddingLeft, \"px\")(\"padding-right\", ctx.dir === \"rtl\" ? ctx.nzPaddingLeft || ctx.inlinePaddingLeft : null, \"px\");\n i0.ɵɵclassProp(\"ant-dropdown-menu-item\", ctx.isMenuInsideDropDown)(\"ant-dropdown-menu-item-selected\", ctx.isMenuInsideDropDown && ctx.nzSelected)(\"ant-dropdown-menu-item-danger\", ctx.isMenuInsideDropDown && ctx.nzDanger)(\"ant-dropdown-menu-item-disabled\", ctx.isMenuInsideDropDown && ctx.nzDisabled)(\"ant-menu-item\", !ctx.isMenuInsideDropDown)(\"ant-menu-item-selected\", !ctx.isMenuInsideDropDown && ctx.nzSelected)(\"ant-menu-item-danger\", !ctx.isMenuInsideDropDown && ctx.nzDanger)(\"ant-menu-item-disabled\", !ctx.isMenuInsideDropDown && ctx.nzDisabled);\n }\n },\n inputs: {\n nzPaddingLeft: \"nzPaddingLeft\",\n nzDisabled: \"nzDisabled\",\n nzSelected: \"nzSelected\",\n nzDanger: \"nzDanger\",\n nzMatchRouterExact: \"nzMatchRouterExact\",\n nzMatchRouter: \"nzMatchRouter\"\n },\n exportAs: [\"nzMenuItem\"],\n standalone: true,\n features: [i0.ɵɵNgOnChangesFeature, i0.ɵɵStandaloneFeature],\n attrs: _c0,\n ngContentSelectors: _c1,\n decls: 2,\n vars: 0,\n consts: [[1, \"ant-menu-title-content\"]],\n template: function NzMenuItemComponent_Template(rf, ctx) {\n if (rf & 1) {\n i0.ɵɵprojectionDef();\n i0.ɵɵelementStart(0, \"span\", 0);\n i0.ɵɵprojection(1);\n i0.ɵɵelementEnd();\n }\n },\n encapsulation: 2,\n changeDetection: 0\n });\n }\n}\n__decorate([InputBoolean()], NzMenuItemComponent.prototype, \"nzDisabled\", void 0);\n__decorate([InputBoolean()], NzMenuItemComponent.prototype, \"nzSelected\", void 0);\n__decorate([InputBoolean()], NzMenuItemComponent.prototype, \"nzDanger\", void 0);\n__decorate([InputBoolean()], NzMenuItemComponent.prototype, \"nzMatchRouterExact\", void 0);\n__decorate([InputBoolean()], NzMenuItemComponent.prototype, \"nzMatchRouter\", void 0);\n(() => {\n (typeof ngDevMode === \"undefined\" || ngDevMode) && i0.ɵsetClassMetadata(NzMenuItemComponent, [{\n type: Component,\n args: [{\n selector: '[nz-menu-item]',\n exportAs: 'nzMenuItem',\n changeDetection: ChangeDetectionStrategy.OnPush,\n encapsulation: ViewEncapsulation.None,\n preserveWhitespaces: false,\n template: `\n