blob: 783c80b523d71c0844145af540ad1fe9f56d3b3f [file] [log] [blame]
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("@angular/cdk/a11y"),require("@angular/cdk/coercion"),require("@angular/cdk/keycodes"),require("@angular/core"),require("rxjs"),require("rxjs/operators"),require("@angular/animations"),require("@angular/cdk/portal"),require("@angular/common"),require("@angular/material/core"),require("@angular/cdk/bidi"),require("@angular/cdk/overlay"),require("@angular/cdk/platform"),require("@angular/cdk/scrolling")):"function"==typeof define&&define.amd?define("@angular/material/menu",["exports","@angular/cdk/a11y","@angular/cdk/coercion","@angular/cdk/keycodes","@angular/core","rxjs","rxjs/operators","@angular/animations","@angular/cdk/portal","@angular/common","@angular/material/core","@angular/cdk/bidi","@angular/cdk/overlay","@angular/cdk/platform","@angular/cdk/scrolling"],t):t(((e=e||self).ng=e.ng||{},e.ng.material=e.ng.material||{},e.ng.material.menu={}),e.ng.cdk.a11y,e.ng.cdk.coercion,e.ng.cdk.keycodes,e.ng.core,e.rxjs,e.rxjs.operators,e.ng.animations,e.ng.cdk.portal,e.ng.common,e.ng.material.core,e.ng.cdk.bidi,e.ng.cdk.overlay,e.ng.cdk.platform,e.ng.cdk.scrolling)}(this,(function(e,t,n,i,o,r,s,a,u,l,c,p,m,h,d){"use strict";
/*! *****************************************************************************
Copyright (c) Microsoft Corporation.
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
PERFORMANCE OF THIS SOFTWARE.
***************************************************************************** */var f=function(e,t){return(f=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])})(e,t)};function g(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}f(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}function _(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var i,o,r=n.call(e),s=[];try{for(;(void 0===t||t-- >0)&&!(i=r.next()).done;)s.push(i.value)}catch(e){o={error:e}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(o)throw o.error}}return s}function y(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(_(arguments[t]));return e}
/**
* @license
* Copyright Google LLC All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.io/license
*/
var b={transformMenu:a.trigger("transformMenu",[a.state("void",a.style({opacity:0,transform:"scale(0.8)"})),a.transition("void => enter",a.animate("120ms cubic-bezier(0, 0, 0.2, 1)",a.style({opacity:1,transform:"scale(1)"}))),a.transition("* => void",a.animate("100ms 25ms linear",a.style({opacity:0})))]),fadeInItems:a.trigger("fadeInItems",[a.state("showing",a.style({opacity:1})),a.transition("void => *",[a.style({opacity:0}),a.animate("400ms 100ms cubic-bezier(0.55, 0, 0.55, 0.2)")])])},v=b.fadeInItems,M=b.transformMenu,k=new o.InjectionToken("MatMenuContent"),I=function(){function e(e,t,n,i,o,s,a){this._template=e,this._componentFactoryResolver=t,this._appRef=n,this._injector=i,this._viewContainerRef=o,this._document=s,this._changeDetectorRef=a,this._attached=new r.Subject}return e.prototype.attach=function(e){void 0===e&&(e={}),this._portal||(this._portal=new u.TemplatePortal(this._template,this._viewContainerRef)),this.detach(),this._outlet||(this._outlet=new u.DomPortalOutlet(this._document.createElement("div"),this._componentFactoryResolver,this._appRef,this._injector));var t=this._template.elementRef.nativeElement;t.parentNode.insertBefore(this._outlet.outletElement,t),this._changeDetectorRef&&this._changeDetectorRef.markForCheck(),this._portal.attach(this._outlet,e),this._attached.next()},e.prototype.detach=function(){this._portal.isAttached&&this._portal.detach()},e.prototype.ngOnDestroy=function(){this._outlet&&this._outlet.dispose()},e}();I.decorators=[{type:o.Directive,args:[{selector:"ng-template[matMenuContent]",providers:[{provide:k,useExisting:I}]}]}],I.ctorParameters=function(){return[{type:o.TemplateRef},{type:o.ComponentFactoryResolver},{type:o.ApplicationRef},{type:o.Injector},{type:o.ViewContainerRef},{type:void 0,decorators:[{type:o.Inject,args:[l.DOCUMENT]}]},{type:o.ChangeDetectorRef}]};
/**
* @license
* Copyright Google LLC All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.io/license
*/
var C=new o.InjectionToken("MAT_MENU_PANEL"),O=function(e){function t(t,n,i,o){var s=e.call(this)||this;return s._elementRef=t,s._focusMonitor=i,s._parentMenu=o,s.role="menuitem",s._hovered=new r.Subject,s._focused=new r.Subject,s._highlighted=!1,s._triggersSubmenu=!1,o&&o.addItem&&o.addItem(s),s}return g(t,e),t.prototype.focus=function(e,t){this._focusMonitor&&e?this._focusMonitor.focusVia(this._getHostElement(),e,t):this._getHostElement().focus(t),this._focused.next(this)},t.prototype.ngAfterViewInit=function(){this._focusMonitor&&this._focusMonitor.monitor(this._elementRef,!1)},t.prototype.ngOnDestroy=function(){this._focusMonitor&&this._focusMonitor.stopMonitoring(this._elementRef),this._parentMenu&&this._parentMenu.removeItem&&this._parentMenu.removeItem(this),this._hovered.complete(),this._focused.complete()},t.prototype._getTabIndex=function(){return this.disabled?"-1":"0"},t.prototype._getHostElement=function(){return this._elementRef.nativeElement},t.prototype._checkDisabled=function(e){this.disabled&&(e.preventDefault(),e.stopPropagation())},t.prototype._handleMouseEnter=function(){this._hovered.next(this)},t.prototype.getLabel=function(){for(var e,t,n=this._elementRef.nativeElement.cloneNode(!0),i=n.querySelectorAll("mat-icon, .material-icons"),o=0;o<i.length;o++){var r=i[o];null===(e=r.parentNode)||void 0===e||e.removeChild(r)}return(null===(t=n.textContent)||void 0===t?void 0:t.trim())||""},t}(c.mixinDisableRipple(c.mixinDisabled((function w(){}))));O.decorators=[{type:o.Component,args:[{selector:"[mat-menu-item]",exportAs:"matMenuItem",inputs:["disabled","disableRipple"],host:{"[attr.role]":"role","[class.mat-menu-item]":"true","[class.mat-menu-item-highlighted]":"_highlighted","[class.mat-menu-item-submenu-trigger]":"_triggersSubmenu","[attr.tabindex]":"_getTabIndex()","[attr.aria-disabled]":"disabled.toString()","[attr.disabled]":"disabled || null",class:"mat-focus-indicator"},changeDetection:o.ChangeDetectionStrategy.OnPush,encapsulation:o.ViewEncapsulation.None,template:'<ng-content></ng-content>\n<div class="mat-menu-ripple" matRipple\n [matRippleDisabled]="disableRipple || disabled"\n [matRippleTrigger]="_getHostElement()">\n</div>\n'}]}],O.ctorParameters=function(){return[{type:o.ElementRef},{type:void 0,decorators:[{type:o.Inject,args:[l.DOCUMENT]}]},{type:t.FocusMonitor},{type:void 0,decorators:[{type:o.Inject,args:[C]},{type:o.Optional}]}]},O.propDecorators={role:[{type:o.Input}],_checkDisabled:[{type:o.HostListener,args:["click",["$event"]]}],_handleMouseEnter:[{type:o.HostListener,args:["mouseenter"]}]};var P=new o.InjectionToken("mat-menu-default-options",{providedIn:"root",factory:x});function x(){return{overlapTrigger:!1,xPosition:"after",yPosition:"below",backdropClass:"cdk-overlay-transparent-backdrop"}}var R=0,S=function(){function e(e,t,n){this._elementRef=e,this._ngZone=t,this._defaultOptions=n,this._xPosition=this._defaultOptions.xPosition,this._yPosition=this._defaultOptions.yPosition,this._directDescendantItems=new o.QueryList,this._tabSubscription=r.Subscription.EMPTY,this._classList={},this._panelAnimationState="void",this._animationDone=new r.Subject,this.overlayPanelClass=this._defaultOptions.overlayPanelClass||"",this.backdropClass=this._defaultOptions.backdropClass,this._overlapTrigger=this._defaultOptions.overlapTrigger,this._hasBackdrop=this._defaultOptions.hasBackdrop,this.closed=new o.EventEmitter,this.close=this.closed,this.panelId="mat-menu-panel-"+R++}return Object.defineProperty(e.prototype,"xPosition",{get:function(){return this._xPosition},set:function(e){this._xPosition=e,this.setPositionClasses()},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"yPosition",{get:function(){return this._yPosition},set:function(e){this._yPosition=e,this.setPositionClasses()},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"overlapTrigger",{get:function(){return this._overlapTrigger},set:function(e){this._overlapTrigger=n.coerceBooleanProperty(e)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"hasBackdrop",{get:function(){return this._hasBackdrop},set:function(e){this._hasBackdrop=n.coerceBooleanProperty(e)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"panelClass",{set:function(e){var t=this,n=this._previousPanelClass;n&&n.length&&n.split(" ").forEach((function(e){t._classList[e]=!1})),this._previousPanelClass=e,e&&e.length&&(e.split(" ").forEach((function(e){t._classList[e]=!0})),this._elementRef.nativeElement.className="")},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"classList",{get:function(){return this.panelClass},set:function(e){this.panelClass=e},enumerable:!1,configurable:!0}),e.prototype.ngOnInit=function(){this.setPositionClasses()},e.prototype.ngAfterContentInit=function(){var e=this;this._updateDirectDescendants(),this._keyManager=new t.FocusKeyManager(this._directDescendantItems).withWrap().withTypeAhead().withHomeAndEnd(),this._tabSubscription=this._keyManager.tabOut.subscribe((function(){return e.closed.emit("tab")})),this._directDescendantItems.changes.pipe(s.startWith(this._directDescendantItems),s.switchMap((function(e){return r.merge.apply(void 0,y(e.map((function(e){return e._focused}))))}))).subscribe((function(t){return e._keyManager.updateActiveItem(t)}))},e.prototype.ngOnDestroy=function(){this._directDescendantItems.destroy(),this._tabSubscription.unsubscribe(),this.closed.complete()},e.prototype._hovered=function(){return this._directDescendantItems.changes.pipe(s.startWith(this._directDescendantItems),s.switchMap((function(e){return r.merge.apply(void 0,y(e.map((function(e){return e._hovered}))))})))},e.prototype.addItem=function(e){},e.prototype.removeItem=function(e){},e.prototype._handleKeydown=function(e){var t=e.keyCode,n=this._keyManager;switch(t){case i.ESCAPE:i.hasModifierKey(e)||(e.preventDefault(),this.closed.emit("keydown"));break;case i.LEFT_ARROW:this.parentMenu&&"ltr"===this.direction&&this.closed.emit("keydown");break;case i.RIGHT_ARROW:this.parentMenu&&"rtl"===this.direction&&this.closed.emit("keydown");break;default:t!==i.UP_ARROW&&t!==i.DOWN_ARROW||n.setFocusOrigin("keyboard"),n.onKeydown(e)}},e.prototype.focusFirstItem=function(e){var t=this;void 0===e&&(e="program"),this.lazyContent?this._ngZone.onStable.pipe(s.take(1)).subscribe((function(){return t._focusFirstItem(e)})):this._focusFirstItem(e)},e.prototype._focusFirstItem=function(e){var t=this._keyManager;if(t.setFocusOrigin(e).setFirstItemActive(),!t.activeItem&&this._directDescendantItems.length)for(var n=this._directDescendantItems.first._getHostElement().parentElement;n;){if("menu"===n.getAttribute("role")){n.focus();break}n=n.parentElement}},e.prototype.resetActiveItem=function(){this._keyManager.setActiveItem(-1)},e.prototype.setElevation=function(e){var t="mat-elevation-z"+Math.min(4+e,24),n=Object.keys(this._classList).find((function(e){return e.startsWith("mat-elevation-z")}));n&&n!==this._previousElevation||(this._previousElevation&&(this._classList[this._previousElevation]=!1),this._classList[t]=!0,this._previousElevation=t)},e.prototype.setPositionClasses=function(e,t){void 0===e&&(e=this.xPosition),void 0===t&&(t=this.yPosition);var n=this._classList;n["mat-menu-before"]="before"===e,n["mat-menu-after"]="after"===e,n["mat-menu-above"]="above"===t,n["mat-menu-below"]="below"===t},e.prototype._startAnimation=function(){this._panelAnimationState="enter"},e.prototype._resetAnimation=function(){this._panelAnimationState="void"},e.prototype._onAnimationDone=function(e){this._animationDone.next(e),this._isAnimating=!1},e.prototype._onAnimationStart=function(e){this._isAnimating=!0,"enter"===e.toState&&0===this._keyManager.activeItemIndex&&(e.element.scrollTop=0)},e.prototype._updateDirectDescendants=function(){var e=this;this._allItems.changes.pipe(s.startWith(this._allItems)).subscribe((function(t){e._directDescendantItems.reset(t.filter((function(t){return t._parentMenu===e}))),e._directDescendantItems.notifyOnChanges()}))},e}();S.decorators=[{type:o.Directive}],S.ctorParameters=function(){return[{type:o.ElementRef},{type:o.NgZone},{type:void 0,decorators:[{type:o.Inject,args:[P]}]}]},S.propDecorators={_allItems:[{type:o.ContentChildren,args:[O,{descendants:!0}]}],backdropClass:[{type:o.Input}],ariaLabel:[{type:o.Input,args:["aria-label"]}],ariaLabelledby:[{type:o.Input,args:["aria-labelledby"]}],ariaDescribedby:[{type:o.Input,args:["aria-describedby"]}],xPosition:[{type:o.Input}],yPosition:[{type:o.Input}],templateRef:[{type:o.ViewChild,args:[o.TemplateRef]}],items:[{type:o.ContentChildren,args:[O,{descendants:!1}]}],lazyContent:[{type:o.ContentChild,args:[k]}],overlapTrigger:[{type:o.Input}],hasBackdrop:[{type:o.Input}],panelClass:[{type:o.Input,args:["class"]}],classList:[{type:o.Input}],closed:[{type:o.Output}],close:[{type:o.Output}]};var E=function(e){function t(t,n,i){return e.call(this,t,n,i)||this}return g(t,e),t}(S);E.decorators=[{type:o.Component,args:[{selector:"mat-menu",template:'<ng-template>\n <div\n class="mat-menu-panel"\n [id]="panelId"\n [ngClass]="_classList"\n (keydown)="_handleKeydown($event)"\n (click)="closed.emit(\'click\')"\n [@transformMenu]="_panelAnimationState"\n (@transformMenu.start)="_onAnimationStart($event)"\n (@transformMenu.done)="_onAnimationDone($event)"\n tabindex="-1"\n role="menu"\n [attr.aria-label]="ariaLabel || null"\n [attr.aria-labelledby]="ariaLabelledby || null"\n [attr.aria-describedby]="ariaDescribedby || null">\n <div class="mat-menu-content">\n <ng-content></ng-content>\n </div>\n </div>\n</ng-template>\n',changeDetection:o.ChangeDetectionStrategy.OnPush,encapsulation:o.ViewEncapsulation.None,exportAs:"matMenu",host:{"[attr.aria-label]":"null","[attr.aria-labelledby]":"null","[attr.aria-describedby]":"null"},animations:[b.transformMenu,b.fadeInItems],providers:[{provide:C,useExisting:E}],styles:['mat-menu{display:none}.mat-menu-panel{min-width:112px;max-width:280px;overflow:auto;-webkit-overflow-scrolling:touch;max-height:calc(100vh - 48px);border-radius:4px;outline:0;min-height:64px}.mat-menu-panel.ng-animating{pointer-events:none}.cdk-high-contrast-active .mat-menu-panel{outline:solid 1px}.mat-menu-content:not(:empty){padding-top:8px;padding-bottom:8px}.mat-menu-item{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;cursor:pointer;outline:none;border:none;-webkit-tap-highlight-color:transparent;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;display:block;line-height:48px;height:48px;padding:0 16px;text-align:left;text-decoration:none;max-width:100%;position:relative}.mat-menu-item::-moz-focus-inner{border:0}.mat-menu-item[disabled]{cursor:default}[dir=rtl] .mat-menu-item{text-align:right}.mat-menu-item .mat-icon{margin-right:16px;vertical-align:middle}.mat-menu-item .mat-icon svg{vertical-align:top}[dir=rtl] .mat-menu-item .mat-icon{margin-left:16px;margin-right:0}.mat-menu-item[disabled]{pointer-events:none}.cdk-high-contrast-active .mat-menu-item{margin-top:1px}.cdk-high-contrast-active .mat-menu-item.cdk-program-focused,.cdk-high-contrast-active .mat-menu-item.cdk-keyboard-focused,.cdk-high-contrast-active .mat-menu-item-highlighted{outline:dotted 1px}.mat-menu-item-submenu-trigger{padding-right:32px}.mat-menu-item-submenu-trigger::after{width:0;height:0;border-style:solid;border-width:5px 0 5px 5px;border-color:transparent transparent transparent currentColor;content:"";display:inline-block;position:absolute;top:50%;right:16px;transform:translateY(-50%)}[dir=rtl] .mat-menu-item-submenu-trigger{padding-right:16px;padding-left:32px}[dir=rtl] .mat-menu-item-submenu-trigger::after{right:auto;left:16px;transform:rotateY(180deg) translateY(-50%)}button.mat-menu-item{width:100%}.mat-menu-item .mat-menu-ripple{top:0;left:0;right:0;bottom:0;position:absolute;pointer-events:none}\n']}]}],E.ctorParameters=function(){return[{type:o.ElementRef},{type:o.NgZone},{type:void 0,decorators:[{type:o.Inject,args:[P]}]}]};var T=new o.InjectionToken("mat-menu-scroll-strategy");function D(e){return function(){return e.scrollStrategies.reposition()}}var A,j,F={provide:T,deps:[m.Overlay],useFactory:D},L=h.normalizePassiveListenerOptions({passive:!0}),N=function(){function e(e,n,i,s,a,u,l,c){var p=this;this._overlay=e,this._element=n,this._viewContainerRef=i,this._menuItemInstance=u,this._dir=l,this._focusMonitor=c,this._overlayRef=null,this._menuOpen=!1,this._closingActionsSubscription=r.Subscription.EMPTY,this._hoverSubscription=r.Subscription.EMPTY,this._menuCloseSubscription=r.Subscription.EMPTY,this._handleTouchStart=function(e){t.isFakeTouchstartFromScreenReader(e)||(p._openedBy="touch")},this._openedBy=void 0,this.restoreFocus=!0,this.menuOpened=new o.EventEmitter,this.onMenuOpen=this.menuOpened,this.menuClosed=new o.EventEmitter,this.onMenuClose=this.menuClosed,this._scrollStrategy=s,this._parentMaterialMenu=a instanceof S?a:void 0,n.nativeElement.addEventListener("touchstart",this._handleTouchStart,L),u&&(u._triggersSubmenu=this.triggersSubmenu())}return Object.defineProperty(e.prototype,"_deprecatedMatMenuTriggerFor",{get:function(){return this.menu},set:function(e){this.menu=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"menu",{get:function(){return this._menu},set:function(e){var t=this;e!==this._menu&&(this._menu=e,this._menuCloseSubscription.unsubscribe(),e&&(this._menuCloseSubscription=e.close.subscribe((function(e){t._destroyMenu(e),"click"!==e&&"tab"!==e||!t._parentMaterialMenu||t._parentMaterialMenu.closed.emit(e)}))))},enumerable:!1,configurable:!0}),e.prototype.ngAfterContentInit=function(){this._checkMenu(),this._handleHover()},e.prototype.ngOnDestroy=function(){this._overlayRef&&(this._overlayRef.dispose(),this._overlayRef=null),this._element.nativeElement.removeEventListener("touchstart",this._handleTouchStart,L),this._menuCloseSubscription.unsubscribe(),this._closingActionsSubscription.unsubscribe(),this._hoverSubscription.unsubscribe()},Object.defineProperty(e.prototype,"menuOpen",{get:function(){return this._menuOpen},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"dir",{get:function(){return this._dir&&"rtl"===this._dir.value?"rtl":"ltr"},enumerable:!1,configurable:!0}),e.prototype.triggersSubmenu=function(){return!(!this._menuItemInstance||!this._parentMaterialMenu)},e.prototype.toggleMenu=function(){return this._menuOpen?this.closeMenu():this.openMenu()},e.prototype.openMenu=function(){var e=this;if(!this._menuOpen){this._checkMenu();var t=this._createOverlay(),n=t.getConfig();this._setPosition(n.positionStrategy),n.hasBackdrop=null==this.menu.hasBackdrop?!this.triggersSubmenu():this.menu.hasBackdrop,t.attach(this._getPortal()),this.menu.lazyContent&&this.menu.lazyContent.attach(this.menuData),this._closingActionsSubscription=this._menuClosingActions().subscribe((function(){return e.closeMenu()})),this._initMenu(),this.menu instanceof S&&this.menu._startAnimation()}},e.prototype.closeMenu=function(){this.menu.close.emit()},e.prototype.focus=function(e,t){this._focusMonitor&&e?this._focusMonitor.focusVia(this._element,e,t):this._element.nativeElement.focus(t)},e.prototype._destroyMenu=function(e){var t=this;if(this._overlayRef&&this.menuOpen){var n=this.menu;this._closingActionsSubscription.unsubscribe(),this._overlayRef.detach(),!this.restoreFocus||"keydown"!==e&&this._openedBy&&this.triggersSubmenu()||this.focus(this._openedBy),this._openedBy=void 0,n instanceof S?(n._resetAnimation(),n.lazyContent?n._animationDone.pipe(s.filter((function(e){return"void"===e.toState})),s.take(1),s.takeUntil(n.lazyContent._attached)).subscribe({next:function(){return n.lazyContent.detach()},complete:function(){return t._setIsMenuOpen(!1)}}):this._setIsMenuOpen(!1)):(this._setIsMenuOpen(!1),n.lazyContent&&n.lazyContent.detach())}},e.prototype._initMenu=function(){this.menu.parentMenu=this.triggersSubmenu()?this._parentMaterialMenu:void 0,this.menu.direction=this.dir,this._setMenuElevation(),this.menu.focusFirstItem(this._openedBy||"program"),this._setIsMenuOpen(!0)},e.prototype._setMenuElevation=function(){if(this.menu.setElevation){for(var e=0,t=this.menu.parentMenu;t;)e++,t=t.parentMenu;this.menu.setElevation(e)}},e.prototype._setIsMenuOpen=function(e){this._menuOpen=e,this._menuOpen?this.menuOpened.emit():this.menuClosed.emit(),this.triggersSubmenu()&&(this._menuItemInstance._highlighted=e)},e.prototype._checkMenu=function(){},e.prototype._createOverlay=function(){if(!this._overlayRef){var e=this._getOverlayConfig();this._subscribeToPositions(e.positionStrategy),this._overlayRef=this._overlay.create(e),this._overlayRef.keydownEvents().subscribe()}return this._overlayRef},e.prototype._getOverlayConfig=function(){return new m.OverlayConfig({positionStrategy:this._overlay.position().flexibleConnectedTo(this._element).withLockedPosition().withGrowAfterOpen().withTransformOriginOn(".mat-menu-panel, .mat-mdc-menu-panel"),backdropClass:this.menu.backdropClass||"cdk-overlay-transparent-backdrop",panelClass:this.menu.overlayPanelClass,scrollStrategy:this._scrollStrategy(),direction:this._dir})},e.prototype._subscribeToPositions=function(e){var t=this;this.menu.setPositionClasses&&e.positionChanges.subscribe((function(e){t.menu.setPositionClasses("start"===e.connectionPair.overlayX?"after":"before","top"===e.connectionPair.overlayY?"below":"above")}))},e.prototype._setPosition=function(e){var t=_("before"===this.menu.xPosition?["end","start"]:["start","end"],2),n=t[0],i=t[1],o=_("above"===this.menu.yPosition?["bottom","top"]:["top","bottom"],2),r=o[0],s=o[1],a=_([r,s],2),u=a[0],l=a[1],c=_([n,i],2),p=c[0],m=c[1],h=0;this.triggersSubmenu()?(m=n="before"===this.menu.xPosition?"start":"end",i=p="end"===n?"start":"end",h="bottom"===r?8:-8):this.menu.overlapTrigger||(u="top"===r?"bottom":"top",l="top"===s?"bottom":"top"),e.withPositions([{originX:n,originY:u,overlayX:p,overlayY:r,offsetY:h},{originX:i,originY:u,overlayX:m,overlayY:r,offsetY:h},{originX:n,originY:l,overlayX:p,overlayY:s,offsetY:-h},{originX:i,originY:l,overlayX:m,overlayY:s,offsetY:-h}])},e.prototype._menuClosingActions=function(){var e=this,t=this._overlayRef.backdropClick(),n=this._overlayRef.detachments(),i=this._parentMaterialMenu?this._parentMaterialMenu.closed:r.of(),o=this._parentMaterialMenu?this._parentMaterialMenu._hovered().pipe(s.filter((function(t){return t!==e._menuItemInstance})),s.filter((function(){return e._menuOpen}))):r.of();return r.merge(t,i,o,n)},e.prototype._handleMousedown=function(e){t.isFakeMousedownFromScreenReader(e)||(this._openedBy=0===e.button?"mouse":void 0,this.triggersSubmenu()&&e.preventDefault())},e.prototype._handleKeydown=function(e){var t=e.keyCode;t!==i.ENTER&&t!==i.SPACE||(this._openedBy="keyboard"),this.triggersSubmenu()&&(t===i.RIGHT_ARROW&&"ltr"===this.dir||t===i.LEFT_ARROW&&"rtl"===this.dir)&&(this._openedBy="keyboard",this.openMenu())},e.prototype._handleClick=function(e){this.triggersSubmenu()?(e.stopPropagation(),this.openMenu()):this.toggleMenu()},e.prototype._handleHover=function(){var e=this;this.triggersSubmenu()&&this._parentMaterialMenu&&(this._hoverSubscription=this._parentMaterialMenu._hovered().pipe(s.filter((function(t){return t===e._menuItemInstance&&!t.disabled})),s.delay(0,r.asapScheduler)).subscribe((function(){e._openedBy="mouse",e.menu instanceof S&&e.menu._isAnimating?e.menu._animationDone.pipe(s.take(1),s.delay(0,r.asapScheduler),s.takeUntil(e._parentMaterialMenu._hovered())).subscribe((function(){return e.openMenu()})):e.openMenu()})))},e.prototype._getPortal=function(){return this._portal&&this._portal.templateRef===this.menu.templateRef||(this._portal=new u.TemplatePortal(this.menu.templateRef,this._viewContainerRef)),this._portal},e}();N.decorators=[{type:o.Directive,args:[{selector:"[mat-menu-trigger-for], [matMenuTriggerFor]",host:{class:"mat-menu-trigger","aria-haspopup":"true","[attr.aria-expanded]":"menuOpen || null","[attr.aria-controls]":"menuOpen ? menu.panelId : null","(mousedown)":"_handleMousedown($event)","(keydown)":"_handleKeydown($event)","(click)":"_handleClick($event)"},exportAs:"matMenuTrigger"}]}],N.ctorParameters=function(){return[{type:m.Overlay},{type:o.ElementRef},{type:o.ViewContainerRef},{type:void 0,decorators:[{type:o.Inject,args:[T]}]},{type:void 0,decorators:[{type:o.Inject,args:[C]},{type:o.Optional}]},{type:O,decorators:[{type:o.Optional},{type:o.Self}]},{type:p.Directionality,decorators:[{type:o.Optional}]},{type:t.FocusMonitor}]},N.propDecorators={_deprecatedMatMenuTriggerFor:[{type:o.Input,args:["mat-menu-trigger-for"]}],menu:[{type:o.Input,args:["matMenuTriggerFor"]}],menuData:[{type:o.Input,args:["matMenuTriggerData"]}],restoreFocus:[{type:o.Input,args:["matMenuTriggerRestoreFocus"]}],menuOpened:[{type:o.Output}],onMenuOpen:[{type:o.Output}],menuClosed:[{type:o.Output}],onMenuClose:[{type:o.Output}]},(A=function A(){}).decorators=[{type:o.NgModule,args:[{exports:[N,I,c.MatCommonModule],declarations:[N,I],providers:[F]}]}],(j=function j(){}).decorators=[{type:o.NgModule,args:[{imports:[l.CommonModule,c.MatCommonModule,c.MatRippleModule,m.OverlayModule,A],exports:[d.CdkScrollableModule,c.MatCommonModule,E,O,A],declarations:[E,O],providers:[F]}]}],
/**
* @license
* Copyright Google LLC All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.io/license
*/
e.MAT_MENU_CONTENT=k,e.MAT_MENU_DEFAULT_OPTIONS=P,e.MAT_MENU_PANEL=C,e.MAT_MENU_SCROLL_STRATEGY=T,e.MatMenu=E,e.MatMenuContent=I,e.MatMenuItem=O,e.MatMenuModule=j,e.MatMenuTrigger=N,e._MatMenuBase=S,e._MatMenuDirectivesModule=A,e.fadeInItems=v,e.matMenuAnimations=b,e.transformMenu=M,eangular_material_src_material_menu_menu_a=x,eangular_material_src_material_menu_menu_b=D,eangular_material_src_material_menu_menu_c=F,Object.defineProperty(e,"__esModule",{value:!0})}));