-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path_angular_material_menu.1-SYKbnD3o.js
More file actions
295 lines (295 loc) · 35.3 KB
/
_angular_material_menu.1-SYKbnD3o.js
File metadata and controls
295 lines (295 loc) · 35.3 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
import { a as Y } from "@nf-internal/chunk-4UKDDKDA";
import { f as N } from "@nf-internal/chunk-U56RZWEM";
import { a as H } from "@nf-internal/chunk-4MZRILT7";
import { e as P } from "@nf-internal/chunk-5KSFOI5Q";
import { b as R } from "@nf-internal/chunk-RXMLTE5A";
import { g } from "@nf-internal/chunk-C2A5IV4Z";
import { b as _, i as c, w as D } from "@nf-internal/chunk-IR6MR6UK";
import { a as I, b as L } from "@nf-internal/chunk-6MDQTQU3";
import * as n from "@angular/core";
import { InjectionToken as y, inject as a, ElementRef as E, DOCUMENT as A, ChangeDetectorRef as M, booleanAttribute as d, TemplateRef as j, ApplicationRef as $, Injector as h, ViewContainerRef as z, QueryList as ee, signal as te, EventEmitter as p, afterNextRender as ie, NgZone as ne, Renderer2 as oe } from "@angular/core";
import { FocusMonitor as X, _IdGenerator as se, FocusKeyManager as ae, isFakeTouchstartFromScreenReader as re, isFakeMousedownFromScreenReader as le } from "@angular/cdk/a11y";
import { UP_ARROW as me, DOWN_ARROW as ue, RIGHT_ARROW as U, LEFT_ARROW as Q, ESCAPE as ce, hasModifierKey as de, ENTER as pe, SPACE as he } from "@angular/cdk/keycodes";
import { startWith as T, switchMap as V, takeUntil as _e, take as ge, filter as fe, skipWhile as be } from "rxjs/operators";
import { _CdkPrivateStyleLoader as ye } from "@angular/cdk/private";
import { TemplatePortal as W, DomPortalOutlet as Me } from "@angular/cdk/portal";
import { Directionality as ve } from "@angular/cdk/bidi";
import { createRepositionScrollStrategy as G, createOverlayRef as Ce, OverlayConfig as xe, createFlexibleConnectedPositionStrategy as we, ViewportRuler as ke, ScrollDispatcher as Ie, OverlayModule as De } from "@angular/cdk/overlay";
import { _getEventTarget as Pe, _getShadowRoot as Re } from "@angular/cdk/platform";
import { CdkScrollableModule as Te } from "@angular/cdk/scrolling";
import "@angular/cdk/coercion";
import "@angular/cdk/layout";
var Se = ["mat-menu-item", ""], Oe = [[["mat-icon"], ["", "matMenuItemIcon", ""]], "*"], Ee = ["mat-icon, [matMenuItemIcon]", "*"];
function Ae(s, v) { s & 1 && (n.\u0275\u0275namespaceSVG(), n.\u0275\u0275elementStart(0, "svg", 2), n.\u0275\u0275element(1, "polygon", 3), n.\u0275\u0275elementEnd()); }
var Fe = ["*"];
function Be(s, v) { if (s & 1) {
let e = n.\u0275\u0275getCurrentView();
n.\u0275\u0275domElementStart(0, "div", 0), n.\u0275\u0275domListener("click", function () { n.\u0275\u0275restoreView(e); let i = n.\u0275\u0275nextContext(); return n.\u0275\u0275resetView(i.closed.emit("click")); })("animationstart", function (i) { n.\u0275\u0275restoreView(e); let o = n.\u0275\u0275nextContext(); return n.\u0275\u0275resetView(o._onAnimationStart(i.animationName)); })("animationend", function (i) { n.\u0275\u0275restoreView(e); let o = n.\u0275\u0275nextContext(); return n.\u0275\u0275resetView(o._onAnimationDone(i.animationName)); })("animationcancel", function (i) { n.\u0275\u0275restoreView(e); let o = n.\u0275\u0275nextContext(); return n.\u0275\u0275resetView(o._onAnimationDone(i.animationName)); }), n.\u0275\u0275domElementStart(1, "div", 1), n.\u0275\u0275projection(2), n.\u0275\u0275domElementEnd()();
} if (s & 2) {
let e = n.\u0275\u0275nextContext();
n.\u0275\u0275classMap(e._classList), n.\u0275\u0275classProp("mat-menu-panel-animations-disabled", e._animationsDisabled)("mat-menu-panel-exit-animation", e._panelAnimationState === "void")("mat-menu-panel-animating", e._isAnimating()), n.\u0275\u0275domProperty("id", e.panelId), n.\u0275\u0275attribute("aria-label", e.ariaLabel || null)("aria-labelledby", e.ariaLabelledby || null)("aria-describedby", e.ariaDescribedby || null);
} }
var F = new y("MAT_MENU_PANEL"), O = (() => { class s {
_elementRef = a(E);
_document = a(A);
_focusMonitor = a(X);
_parentMenu = a(F, { optional: !0 });
_changeDetectorRef = a(M);
role = "menuitem";
disabled = !1;
disableRipple = !1;
_hovered = new c;
_focused = new c;
_highlighted = !1;
_triggersSubmenu = !1;
constructor() { a(ye).load(H), this._parentMenu?.addItem?.(this); }
focus(e, t) { this._focusMonitor && e ? this._focusMonitor.focusVia(this._getHostElement(), e, t) : this._getHostElement().focus(t), this._focused.next(this); }
ngAfterViewInit() { this._focusMonitor && this._focusMonitor.monitor(this._elementRef, !1); }
ngOnDestroy() { this._focusMonitor && this._focusMonitor.stopMonitoring(this._elementRef), this._parentMenu && this._parentMenu.removeItem && this._parentMenu.removeItem(this), this._hovered.complete(), this._focused.complete(); }
_getTabIndex() { return this.disabled ? "-1" : "0"; }
_getHostElement() { return this._elementRef.nativeElement; }
_checkDisabled(e) { this.disabled && (e.preventDefault(), e.stopPropagation()); }
_handleMouseEnter() { this._hovered.next(this); }
getLabel() { let e = this._elementRef.nativeElement.cloneNode(!0), t = e.querySelectorAll("mat-icon, .material-icons"); for (let i = 0; i < t.length; i++)
t[i].remove(); return e.textContent?.trim() || ""; }
_setHighlighted(e) { this._highlighted = e, this._changeDetectorRef.markForCheck(); }
_setTriggersSubmenu(e) { this._triggersSubmenu = e, this._changeDetectorRef.markForCheck(); }
_hasFocus() { return this._document && this._document.activeElement === this._getHostElement(); }
static \u0275fac = function (t) { return new (t || s); };
static \u0275cmp = n.\u0275\u0275defineComponent({ type: s, selectors: [["", "mat-menu-item", ""]], hostAttrs: [1, "mat-mdc-menu-item", "mat-focus-indicator"], hostVars: 8, hostBindings: function (t, i) { t & 1 && n.\u0275\u0275listener("click", function (r) { return i._checkDisabled(r); })("mouseenter", function () { return i._handleMouseEnter(); }), t & 2 && (n.\u0275\u0275attribute("role", i.role)("tabindex", i._getTabIndex())("aria-disabled", i.disabled)("disabled", i.disabled || null), n.\u0275\u0275classProp("mat-mdc-menu-item-highlighted", i._highlighted)("mat-mdc-menu-item-submenu-trigger", i._triggersSubmenu)); }, inputs: { role: "role", disabled: [2, "disabled", "disabled", d], disableRipple: [2, "disableRipple", "disableRipple", d] }, exportAs: ["matMenuItem"], attrs: Se, ngContentSelectors: Ee, decls: 5, vars: 3, consts: [[1, "mat-mdc-menu-item-text"], ["matRipple", "", 1, "mat-mdc-menu-ripple", 3, "matRippleDisabled", "matRippleTrigger"], ["viewBox", "0 0 5 10", "focusable", "false", "aria-hidden", "true", 1, "mat-mdc-menu-submenu-icon"], ["points", "0,0 5,5 0,10"]], template: function (t, i) { t & 1 && (n.\u0275\u0275projectionDef(Oe), n.\u0275\u0275projection(0), n.\u0275\u0275elementStart(1, "span", 0), n.\u0275\u0275projection(2, 1), n.\u0275\u0275elementEnd(), n.\u0275\u0275element(3, "div", 1), n.\u0275\u0275conditionalCreate(4, Ae, 2, 0, ":svg:svg", 2)), t & 2 && (n.\u0275\u0275advance(3), n.\u0275\u0275property("matRippleDisabled", i.disableRipple || i.disabled)("matRippleTrigger", i._getHostElement()), n.\u0275\u0275advance(), n.\u0275\u0275conditional(i._triggersSubmenu ? 4 : -1)); }, dependencies: [N], encapsulation: 2, changeDetection: 0 });
} return s; })();
var K = new y("MatMenuContent"), _t = (() => { class s {
_template = a(j);
_appRef = a($);
_injector = a(h);
_viewContainerRef = a(z);
_document = a(A);
_changeDetectorRef = a(M);
_portal;
_outlet;
_attached = new c;
constructor() { }
attach(e = {}) { this._portal || (this._portal = new W(this._template, this._viewContainerRef)), this.detach(), this._outlet || (this._outlet = new Me(this._document.createElement("div"), this._appRef, this._injector)); let t = this._template.elementRef.nativeElement; t.parentNode.insertBefore(this._outlet.outletElement, t), this._changeDetectorRef.markForCheck(), this._portal.attach(this._outlet, e), this._attached.next(); }
detach() { this._portal?.isAttached && this._portal.detach(); }
ngOnDestroy() { this.detach(), this._outlet?.dispose(); }
static \u0275fac = function (t) { return new (t || s); };
static \u0275dir = n.\u0275\u0275defineDirective({ type: s, selectors: [["ng-template", "matMenuContent", ""]], features: [n.\u0275\u0275ProvidersFeature([{ provide: K, useExisting: s }])] });
} return s; })(), Le = new y("mat-menu-default-options", { providedIn: "root", factory: Ne });
function Ne() { return { overlapTrigger: !1, xPosition: "after", yPosition: "below", backdropClass: "cdk-overlay-transparent-backdrop" }; }
var S = "_mat-menu-enter", f = "_mat-menu-exit", b = (() => {
class s {
_elementRef = a(E);
_changeDetectorRef = a(M);
_injector = a(h);
_keyManager;
_xPosition;
_yPosition;
_firstItemFocusRef;
_exitFallbackTimeout;
_animationsDisabled = P();
_allItems;
_directDescendantItems = new ee;
_classList = {};
_panelAnimationState = "void";
_animationDone = new c;
_isAnimating = te(!1);
parentMenu;
direction;
overlayPanelClass;
backdropClass;
ariaLabel;
ariaLabelledby;
ariaDescribedby;
get xPosition() { return this._xPosition; }
set xPosition(e) { this._xPosition = e, this.setPositionClasses(); }
get yPosition() { return this._yPosition; }
set yPosition(e) { this._yPosition = e, this.setPositionClasses(); }
templateRef;
items;
lazyContent;
overlapTrigger;
hasBackdrop;
set panelClass(e) { let t = this._previousPanelClass, i = I({}, this._classList); t && t.length && t.split(" ").forEach(o => { i[o] = !1; }), this._previousPanelClass = e, e && e.length && (e.split(" ").forEach(o => { i[o] = !0; }), this._elementRef.nativeElement.className = ""), this._classList = i; }
_previousPanelClass;
get classList() { return this.panelClass; }
set classList(e) { this.panelClass = e; }
closed = new p;
close = this.closed;
panelId = a(se).getId("mat-menu-panel-");
constructor() { let e = a(Le); this.overlayPanelClass = e.overlayPanelClass || "", this._xPosition = e.xPosition, this._yPosition = e.yPosition, this.backdropClass = e.backdropClass, this.overlapTrigger = e.overlapTrigger, this.hasBackdrop = e.hasBackdrop; }
ngOnInit() { this.setPositionClasses(); }
ngAfterContentInit() { this._updateDirectDescendants(), this._keyManager = new ae(this._directDescendantItems).withWrap().withTypeAhead().withHomeAndEnd(), this._keyManager.tabOut.subscribe(() => this.closed.emit("tab")), this._directDescendantItems.changes.pipe(T(this._directDescendantItems), V(e => g(...e.map(t => t._focused)))).subscribe(e => this._keyManager.updateActiveItem(e)), this._directDescendantItems.changes.subscribe(e => { let t = this._keyManager; if (this._panelAnimationState === "enter" && t.activeItem?._hasFocus()) {
let i = e.toArray(), o = Math.max(0, Math.min(i.length - 1, t.activeItemIndex || 0));
i[o] && !i[o].disabled ? t.setActiveItem(o) : t.setNextItemActive();
} }); }
ngOnDestroy() { this._keyManager?.destroy(), this._directDescendantItems.destroy(), this.closed.complete(), this._firstItemFocusRef?.destroy(), clearTimeout(this._exitFallbackTimeout); }
_hovered() { return this._directDescendantItems.changes.pipe(T(this._directDescendantItems), V(t => g(...t.map(i => i._hovered)))); }
addItem(e) { }
removeItem(e) { }
_handleKeydown(e) { let t = e.keyCode, i = this._keyManager; switch (t) {
case ce:
de(e) || (e.preventDefault(), this.closed.emit("keydown"));
break;
case Q:
this.parentMenu && this.direction === "ltr" && this.closed.emit("keydown");
break;
case U:
this.parentMenu && this.direction === "rtl" && this.closed.emit("keydown");
break;
default:
(t === me || t === ue) && i.setFocusOrigin("keyboard"), i.onKeydown(e);
return;
} }
focusFirstItem(e = "program") { this._firstItemFocusRef?.destroy(), this._firstItemFocusRef = ie(() => { let t = this._resolvePanel(); if (!t || !t.contains(document.activeElement)) {
let i = this._keyManager;
i.setFocusOrigin(e).setFirstItemActive(), !i.activeItem && t && t.focus();
} }, { injector: this._injector }); }
resetActiveItem() { this._keyManager.setActiveItem(-1); }
setElevation(e) { }
setPositionClasses(e = this.xPosition, t = this.yPosition) { this._classList = L(I({}, this._classList), { "mat-menu-before": e === "before", "mat-menu-after": e === "after", "mat-menu-above": t === "above", "mat-menu-below": t === "below" }), this._changeDetectorRef.markForCheck(); }
_onAnimationDone(e) { let t = e === f; (t || e === S) && (t && (clearTimeout(this._exitFallbackTimeout), this._exitFallbackTimeout = void 0), this._animationDone.next(t ? "void" : "enter"), this._isAnimating.set(!1)); }
_onAnimationStart(e) { (e === S || e === f) && this._isAnimating.set(!0); }
_setIsOpen(e) { if (this._panelAnimationState = e ? "enter" : "void", e) {
if (this._keyManager.activeItemIndex === 0) {
let t = this._resolvePanel();
t && (t.scrollTop = 0);
}
}
else
this._animationsDisabled || (this._exitFallbackTimeout = setTimeout(() => this._onAnimationDone(f), 200)); this._animationsDisabled && setTimeout(() => { this._onAnimationDone(e ? S : f); }), this._changeDetectorRef.markForCheck(); }
_updateDirectDescendants() { this._allItems.changes.pipe(T(this._allItems)).subscribe(e => { this._directDescendantItems.reset(e.filter(t => t._parentMenu === this)), this._directDescendantItems.notifyOnChanges(); }); }
_resolvePanel() { let e = null; return this._directDescendantItems.length && (e = this._directDescendantItems.first._getHostElement().closest('[role="menu"]')), e; }
static \u0275fac = function (t) { return new (t || s); };
static \u0275cmp = n.\u0275\u0275defineComponent({ type: s, selectors: [["mat-menu"]], contentQueries: function (t, i, o) { if (t & 1 && (n.\u0275\u0275contentQuery(o, K, 5), n.\u0275\u0275contentQuery(o, O, 5), n.\u0275\u0275contentQuery(o, O, 4)), t & 2) {
let r;
n.\u0275\u0275queryRefresh(r = n.\u0275\u0275loadQuery()) && (i.lazyContent = r.first), n.\u0275\u0275queryRefresh(r = n.\u0275\u0275loadQuery()) && (i._allItems = r), n.\u0275\u0275queryRefresh(r = n.\u0275\u0275loadQuery()) && (i.items = r);
} }, viewQuery: function (t, i) { if (t & 1 && n.\u0275\u0275viewQuery(j, 5), t & 2) {
let o;
n.\u0275\u0275queryRefresh(o = n.\u0275\u0275loadQuery()) && (i.templateRef = o.first);
} }, hostVars: 3, hostBindings: function (t, i) { t & 2 && n.\u0275\u0275attribute("aria-label", null)("aria-labelledby", null)("aria-describedby", null); }, inputs: { backdropClass: "backdropClass", ariaLabel: [0, "aria-label", "ariaLabel"], ariaLabelledby: [0, "aria-labelledby", "ariaLabelledby"], ariaDescribedby: [0, "aria-describedby", "ariaDescribedby"], xPosition: "xPosition", yPosition: "yPosition", overlapTrigger: [2, "overlapTrigger", "overlapTrigger", d], hasBackdrop: [2, "hasBackdrop", "hasBackdrop", e => e == null ? null : d(e)], panelClass: [0, "class", "panelClass"], classList: "classList" }, outputs: { closed: "closed", close: "close" }, exportAs: ["matMenu"], features: [n.\u0275\u0275ProvidersFeature([{ provide: F, useExisting: s }])], ngContentSelectors: Fe, decls: 1, vars: 0, consts: [["tabindex", "-1", "role", "menu", 1, "mat-mdc-menu-panel", 3, "click", "animationstart", "animationend", "animationcancel", "id"], [1, "mat-mdc-menu-content"]], template: function (t, i) { t & 1 && (n.\u0275\u0275projectionDef(), n.\u0275\u0275domTemplate(0, Be, 3, 12, "ng-template")); }, styles: [`mat-menu{display:none}.mat-mdc-menu-content{margin:0;padding:8px 0;outline:0}.mat-mdc-menu-content,.mat-mdc-menu-content .mat-mdc-menu-item .mat-mdc-menu-item-text{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;flex:1;white-space:normal;font-family:var(--mat-menu-item-label-text-font, var(--mat-sys-label-large-font));line-height:var(--mat-menu-item-label-text-line-height, var(--mat-sys-label-large-line-height));font-size:var(--mat-menu-item-label-text-size, var(--mat-sys-label-large-size));letter-spacing:var(--mat-menu-item-label-text-tracking, var(--mat-sys-label-large-tracking));font-weight:var(--mat-menu-item-label-text-weight, var(--mat-sys-label-large-weight))}@keyframes _mat-menu-enter{from{opacity:0;transform:scale(0.8)}to{opacity:1;transform:none}}@keyframes _mat-menu-exit{from{opacity:1}to{opacity:0}}.mat-mdc-menu-panel{min-width:112px;max-width:280px;overflow:auto;box-sizing:border-box;outline:0;animation:_mat-menu-enter 120ms cubic-bezier(0, 0, 0.2, 1);border-radius:var(--mat-menu-container-shape, var(--mat-sys-corner-extra-small));background-color:var(--mat-menu-container-color, var(--mat-sys-surface-container));box-shadow:var(--mat-menu-container-elevation-shadow, 0px 3px 1px -2px rgba(0, 0, 0, 0.2), 0px 2px 2px 0px rgba(0, 0, 0, 0.14), 0px 1px 5px 0px rgba(0, 0, 0, 0.12));will-change:transform,opacity}.mat-mdc-menu-panel.mat-menu-panel-exit-animation{animation:_mat-menu-exit 100ms 25ms linear forwards}.mat-mdc-menu-panel.mat-menu-panel-animations-disabled{animation:none}.mat-mdc-menu-panel.mat-menu-panel-animating{pointer-events:none}.mat-mdc-menu-panel.mat-menu-panel-animating:has(.mat-mdc-menu-content:empty){display:none}@media(forced-colors: active){.mat-mdc-menu-panel{outline:solid 1px}}.mat-mdc-menu-panel .mat-divider{color:var(--mat-menu-divider-color, var(--mat-sys-surface-variant));margin-bottom:var(--mat-menu-divider-bottom-spacing, 8px);margin-top:var(--mat-menu-divider-top-spacing, 8px)}.mat-mdc-menu-item{display:flex;position:relative;align-items:center;justify-content:flex-start;overflow:hidden;padding:0;cursor:pointer;width:100%;text-align:left;box-sizing:border-box;color:inherit;font-size:inherit;background:none;text-decoration:none;margin:0;min-height:48px;padding-left:var(--mat-menu-item-leading-spacing, 12px);padding-right:var(--mat-menu-item-trailing-spacing, 12px);-webkit-user-select:none;user-select:none;cursor:pointer;outline:none;border:none;-webkit-tap-highlight-color:rgba(0,0,0,0)}.mat-mdc-menu-item::-moz-focus-inner{border:0}[dir=rtl] .mat-mdc-menu-item{padding-left:var(--mat-menu-item-trailing-spacing, 12px);padding-right:var(--mat-menu-item-leading-spacing, 12px)}.mat-mdc-menu-item:has(.material-icons,mat-icon,[matButtonIcon]){padding-left:var(--mat-menu-item-with-icon-leading-spacing, 12px);padding-right:var(--mat-menu-item-with-icon-trailing-spacing, 12px)}[dir=rtl] .mat-mdc-menu-item:has(.material-icons,mat-icon,[matButtonIcon]){padding-left:var(--mat-menu-item-with-icon-trailing-spacing, 12px);padding-right:var(--mat-menu-item-with-icon-leading-spacing, 12px)}.mat-mdc-menu-item,.mat-mdc-menu-item:visited,.mat-mdc-menu-item:link{color:var(--mat-menu-item-label-text-color, var(--mat-sys-on-surface))}.mat-mdc-menu-item .mat-icon-no-color,.mat-mdc-menu-item .mat-mdc-menu-submenu-icon{color:var(--mat-menu-item-icon-color, var(--mat-sys-on-surface-variant))}.mat-mdc-menu-item[disabled]{cursor:default;opacity:.38}.mat-mdc-menu-item[disabled]::after{display:block;position:absolute;content:"";top:0;left:0;bottom:0;right:0}.mat-mdc-menu-item:focus{outline:0}.mat-mdc-menu-item .mat-icon{flex-shrink:0;margin-right:var(--mat-menu-item-spacing, 12px);height:var(--mat-menu-item-icon-size, 24px);width:var(--mat-menu-item-icon-size, 24px)}[dir=rtl] .mat-mdc-menu-item{text-align:right}[dir=rtl] .mat-mdc-menu-item .mat-icon{margin-right:0;margin-left:var(--mat-menu-item-spacing, 12px)}.mat-mdc-menu-item:not([disabled]):hover{background-color:var(--mat-menu-item-hover-state-layer-color, color-mix(in srgb, var(--mat-sys-on-surface) calc(var(--mat-sys-hover-state-layer-opacity) * 100%), transparent))}.mat-mdc-menu-item:not([disabled]).cdk-program-focused,.mat-mdc-menu-item:not([disabled]).cdk-keyboard-focused,.mat-mdc-menu-item:not([disabled]).mat-mdc-menu-item-highlighted{background-color:var(--mat-menu-item-focus-state-layer-color, color-mix(in srgb, var(--mat-sys-on-surface) calc(var(--mat-sys-focus-state-layer-opacity) * 100%), transparent))}@media(forced-colors: active){.mat-mdc-menu-item{margin-top:1px}}.mat-mdc-menu-submenu-icon{width:var(--mat-menu-item-icon-size, 24px);height:10px;fill:currentColor;padding-left:var(--mat-menu-item-spacing, 12px)}[dir=rtl] .mat-mdc-menu-submenu-icon{padding-right:var(--mat-menu-item-spacing, 12px);padding-left:0}[dir=rtl] .mat-mdc-menu-submenu-icon polygon{transform:scaleX(-1);transform-origin:center}@media(forced-colors: active){.mat-mdc-menu-submenu-icon{fill:CanvasText}}.mat-mdc-menu-item .mat-mdc-menu-ripple{top:0;left:0;right:0;bottom:0;position:absolute;pointer-events:none}
`], encapsulation: 2, changeDetection: 0 });
}
return s;
})(), q = new y("mat-menu-scroll-strategy", { providedIn: "root", factory: () => { let s = a(h); return () => G(s); } });
function He(s) { let v = a(h); return () => G(v); }
var Ye = { provide: q, deps: [], useFactory: He }, gt = 8, m = new WeakMap, Z = (() => { class s {
_canHaveBackdrop;
_element = a(E);
_viewContainerRef = a(z);
_menuItemInstance = a(O, { optional: !0, self: !0 });
_dir = a(ve, { optional: !0 });
_focusMonitor = a(X);
_ngZone = a(ne);
_injector = a(h);
_scrollStrategy = a(q);
_changeDetectorRef = a(M);
_animationsDisabled = P();
_portal;
_overlayRef = null;
_menuOpen = !1;
_closingActionsSubscription = _.EMPTY;
_menuCloseSubscription = _.EMPTY;
_pendingRemoval;
_parentMaterialMenu;
_parentInnerPadding;
_openedBy = void 0;
get _menu() { return this._menuInternal; }
set _menu(e) { e !== this._menuInternal && (this._menuInternal = e, this._menuCloseSubscription.unsubscribe(), e && (this._parentMaterialMenu, this._menuCloseSubscription = e.close.subscribe(t => { this._destroyMenu(t), (t === "click" || t === "tab") && this._parentMaterialMenu && this._parentMaterialMenu.closed.emit(t); })), this._menuItemInstance?._setTriggersSubmenu(this._triggersSubmenu())); }
_menuInternal;
constructor(e) { this._canHaveBackdrop = e; let t = a(F, { optional: !0 }); this._parentMaterialMenu = t instanceof b ? t : void 0; }
ngOnDestroy() { this._menu && this._ownsMenu(this._menu) && m.delete(this._menu), this._pendingRemoval?.unsubscribe(), this._menuCloseSubscription.unsubscribe(), this._closingActionsSubscription.unsubscribe(), this._overlayRef && (this._overlayRef.dispose(), this._overlayRef = null); }
get menuOpen() { return this._menuOpen; }
get dir() { return this._dir && this._dir.value === "rtl" ? "rtl" : "ltr"; }
_triggersSubmenu() { return !!(this._menuItemInstance && this._parentMaterialMenu && this._menu); }
_closeMenu() { this._menu?.close.emit(); }
_openMenu(e) { let t = this._menu; if (this._menuOpen || !t)
return; this._pendingRemoval?.unsubscribe(); let i = m.get(t); m.set(t, this), i && i !== this && i._closeMenu(); let o = this._createOverlay(t), r = o.getConfig(), l = r.positionStrategy; this._setPosition(t, l), this._canHaveBackdrop ? r.hasBackdrop = t.hasBackdrop == null ? !this._triggersSubmenu() : t.hasBackdrop : r.hasBackdrop = !1, o.hasAttached() || (o.attach(this._getPortal(t)), t.lazyContent?.attach(this.menuData)), this._closingActionsSubscription = this._menuClosingActions().subscribe(() => this._closeMenu()), t.parentMenu = this._triggersSubmenu() ? this._parentMaterialMenu : void 0, t.direction = this.dir, e && t.focusFirstItem(this._openedBy || "program"), this._setIsMenuOpen(!0), t instanceof b && (t._setIsOpen(!0), t._directDescendantItems.changes.pipe(_e(t.close)).subscribe(() => { l.withLockedPosition(!1).reapplyLastPosition(), l.withLockedPosition(!0); })); }
focus(e, t) { this._focusMonitor && e ? this._focusMonitor.focusVia(this._element, e, t) : this._element.nativeElement.focus(t); }
_destroyMenu(e) { let t = this._overlayRef, i = this._menu; !t || !this.menuOpen || (this._closingActionsSubscription.unsubscribe(), this._pendingRemoval?.unsubscribe(), i instanceof b && this._ownsMenu(i) ? (this._pendingRemoval = i._animationDone.pipe(ge(1)).subscribe(() => { t.detach(), m.has(i) || i.lazyContent?.detach(); }), i._setIsOpen(!1)) : (t.detach(), i?.lazyContent?.detach()), i && this._ownsMenu(i) && m.delete(i), this.restoreFocus && (e === "keydown" || !this._openedBy || !this._triggersSubmenu()) && this.focus(this._openedBy), this._openedBy = void 0, this._setIsMenuOpen(!1)); }
_setIsMenuOpen(e) { e !== this._menuOpen && (this._menuOpen = e, this._menuOpen ? this.menuOpened.emit() : this.menuClosed.emit(), this._triggersSubmenu() && this._menuItemInstance._setHighlighted(e), this._changeDetectorRef.markForCheck()); }
_createOverlay(e) { if (!this._overlayRef) {
let t = this._getOverlayConfig(e);
this._subscribeToPositions(e, t.positionStrategy), this._overlayRef = Ce(this._injector, t), this._overlayRef.keydownEvents().subscribe(i => { this._menu instanceof b && this._menu._handleKeydown(i); });
} return this._overlayRef; }
_getOverlayConfig(e) { return new xe({ positionStrategy: we(this._injector, this._getOverlayOrigin()).withLockedPosition().withGrowAfterOpen().withTransformOriginOn(".mat-menu-panel, .mat-mdc-menu-panel"), backdropClass: e.backdropClass || "cdk-overlay-transparent-backdrop", panelClass: e.overlayPanelClass, scrollStrategy: this._scrollStrategy(), direction: this._dir || "ltr", disableAnimations: this._animationsDisabled }); }
_subscribeToPositions(e, t) { e.setPositionClasses && t.positionChanges.subscribe(i => { this._ngZone.run(() => { let o = i.connectionPair.overlayX === "start" ? "after" : "before", r = i.connectionPair.overlayY === "top" ? "below" : "above"; e.setPositionClasses(o, r); }); }); }
_setPosition(e, t) { let [i, o] = e.xPosition === "before" ? ["end", "start"] : ["start", "end"], [r, l] = e.yPosition === "above" ? ["bottom", "top"] : ["top", "bottom"], [C, x] = [r, l], [w, k] = [i, o], u = 0; if (this._triggersSubmenu()) {
if (k = i = e.xPosition === "before" ? "start" : "end", o = w = i === "end" ? "start" : "end", this._parentMaterialMenu) {
if (this._parentInnerPadding == null) {
let B = this._parentMaterialMenu.items.first;
this._parentInnerPadding = B ? B._getHostElement().offsetTop : 0;
}
u = r === "bottom" ? this._parentInnerPadding : -this._parentInnerPadding;
}
}
else
e.overlapTrigger || (C = r === "top" ? "bottom" : "top", x = l === "top" ? "bottom" : "top"); t.withPositions([{ originX: i, originY: C, overlayX: w, overlayY: r, offsetY: u }, { originX: o, originY: C, overlayX: k, overlayY: r, offsetY: u }, { originX: i, originY: x, overlayX: w, overlayY: l, offsetY: -u }, { originX: o, originY: x, overlayX: k, overlayY: l, offsetY: -u }]); }
_menuClosingActions() { let e = this._getOutsideClickStream(this._overlayRef), t = this._overlayRef.detachments(), i = this._parentMaterialMenu ? this._parentMaterialMenu.closed : D(), o = this._parentMaterialMenu ? this._parentMaterialMenu._hovered().pipe(fe(r => this._menuOpen && r !== this._menuItemInstance)) : D(); return g(e, i, o, t); }
_getPortal(e) { return (!this._portal || this._portal.templateRef !== e.templateRef) && (this._portal = new W(e.templateRef, this._viewContainerRef)), this._portal; }
_ownsMenu(e) { return m.get(e) === this; }
static \u0275fac = function (t) { n.\u0275\u0275invalidFactory(); };
static \u0275dir = n.\u0275\u0275defineDirective({ type: s });
} return s; })(), ft = (() => { class s extends Z {
_cleanupTouchstart;
_hoverSubscription = _.EMPTY;
get _deprecatedMatMenuTriggerFor() { return this.menu; }
set _deprecatedMatMenuTriggerFor(e) { this.menu = e; }
get menu() { return this._menu; }
set menu(e) { this._menu = e; }
menuData;
restoreFocus = !0;
menuOpened = new p;
onMenuOpen = this.menuOpened;
menuClosed = new p;
onMenuClose = this.menuClosed;
constructor() { super(!0); let e = a(oe); this._cleanupTouchstart = e.listen(this._element.nativeElement, "touchstart", t => { re(t) || (this._openedBy = "touch"); }, { passive: !0 }); }
triggersSubmenu() { return super._triggersSubmenu(); }
toggleMenu() { return this.menuOpen ? this.closeMenu() : this.openMenu(); }
openMenu() { this._openMenu(!0); }
closeMenu() { this._closeMenu(); }
updatePosition() { this._overlayRef?.updatePosition(); }
ngAfterContentInit() { this._handleHover(); }
ngOnDestroy() { super.ngOnDestroy(), this._cleanupTouchstart(), this._hoverSubscription.unsubscribe(); }
_getOverlayOrigin() { return this._element; }
_getOutsideClickStream(e) { return e.backdropClick(); }
_handleMousedown(e) { le(e) || (this._openedBy = e.button === 0 ? "mouse" : void 0, this.triggersSubmenu() && e.preventDefault()); }
_handleKeydown(e) { let t = e.keyCode; (t === pe || t === he) && (this._openedBy = "keyboard"), this.triggersSubmenu() && (t === U && this.dir === "ltr" || t === Q && this.dir === "rtl") && (this._openedBy = "keyboard", this.openMenu()); }
_handleClick(e) { this.triggersSubmenu() ? (e.stopPropagation(), this.openMenu()) : this.toggleMenu(); }
_handleHover() { this.triggersSubmenu() && this._parentMaterialMenu && (this._hoverSubscription = this._parentMaterialMenu._hovered().subscribe(e => { e === this._menuItemInstance && !e.disabled && this._parentMaterialMenu?._panelAnimationState !== "void" && (this._openedBy = "mouse", this._openMenu(!1)); })); }
static \u0275fac = function (t) { return new (t || s); };
static \u0275dir = n.\u0275\u0275defineDirective({ type: s, selectors: [["", "mat-menu-trigger-for", ""], ["", "matMenuTriggerFor", ""]], hostAttrs: [1, "mat-mdc-menu-trigger"], hostVars: 3, hostBindings: function (t, i) { t & 1 && n.\u0275\u0275listener("click", function (r) { return i._handleClick(r); })("mousedown", function (r) { return i._handleMousedown(r); })("keydown", function (r) { return i._handleKeydown(r); }), t & 2 && n.\u0275\u0275attribute("aria-haspopup", i.menu ? "menu" : null)("aria-expanded", i.menuOpen)("aria-controls", i.menuOpen ? i.menu == null ? null : i.menu.panelId : null); }, inputs: { _deprecatedMatMenuTriggerFor: [0, "mat-menu-trigger-for", "_deprecatedMatMenuTriggerFor"], menu: [0, "matMenuTriggerFor", "menu"], menuData: [0, "matMenuTriggerData", "menuData"], restoreFocus: [0, "matMenuTriggerRestoreFocus", "restoreFocus"] }, outputs: { menuOpened: "menuOpened", onMenuOpen: "onMenuOpen", menuClosed: "menuClosed", onMenuClose: "onMenuClose" }, exportAs: ["matMenuTrigger"], features: [n.\u0275\u0275InheritDefinitionFeature] });
} return s; })(), bt = (() => { class s extends Z {
_point = { x: 0, y: 0, initialX: 0, initialY: 0, initialScrollX: 0, initialScrollY: 0 };
_triggerPressedControl = !1;
_rootNode;
_document = a(A);
_viewportRuler = a(ke);
_scrollDispatcher = a(Ie);
_scrollSubscription;
get menu() { return this._menu; }
set menu(e) { this._menu = e; }
menuData;
restoreFocus = !0;
disabled = !1;
menuOpened = new p;
menuClosed = new p;
constructor() { super(!1); }
ngOnDestroy() { super.ngOnDestroy(), this._scrollSubscription?.unsubscribe(); }
_handleContextMenuEvent(e) { this.disabled || (e.preventDefault(), this.menuOpen ? (this._initializePoint(e.clientX, e.clientY), this._updatePosition()) : this._openContextMenu(e)); }
_destroyMenu(e) { super._destroyMenu(e), this._scrollSubscription?.unsubscribe(); }
_getOverlayOrigin() { return this._point; }
_getOutsideClickStream(e) { return e.outsidePointerEvents().pipe(be((t, i) => t.type === "contextmenu" ? this._isWithinMenuOrTrigger(Pe(t)) : t.type === "auxclick" ? i === 0 ? !0 : (this._rootNode ??= Re(this._element.nativeElement) || this._document, this._isWithinMenuOrTrigger(this._rootNode.elementFromPoint(t.clientX, t.clientY))) : this._triggerPressedControl && i === 0 && t.ctrlKey)); }
_isWithinMenuOrTrigger(e) { if (!e)
return !1; let t = this._element.nativeElement; if (e === t || t.contains(e))
return !0; let i = this._overlayRef?.hostElement; return i === e || !!i?.contains(e); }
_openContextMenu(e) { e.button === 2 ? this._openedBy = "mouse" : this._openedBy = e.button === 0 ? "keyboard" : void 0, this._initializePoint(e.clientX, e.clientY), this._triggerPressedControl = e.ctrlKey, super._openMenu(!0), this._scrollSubscription?.unsubscribe(), this._scrollSubscription = this._scrollDispatcher.scrolled(0).subscribe(() => { let t = this._viewportRuler.getViewportScrollPosition(), i = this._point; i.y = i.initialY + (i.initialScrollY - t.top), i.x = i.initialX + (i.initialScrollX - t.left), this._updatePosition(); }); }
_initializePoint(e, t) { let i = this._viewportRuler.getViewportScrollPosition(), o = this._point; o.x = o.initialX = e, o.y = o.initialY = t, o.initialScrollX = i.left, o.initialScrollY = i.top; }
_updatePosition() { let e = this._overlayRef; e && (e.getConfig().positionStrategy.setOrigin(this._point), e.updatePosition()); }
static \u0275fac = function (t) { return new (t || s); };
static \u0275dir = n.\u0275\u0275defineDirective({ type: s, selectors: [["", "matContextMenuTriggerFor", ""]], hostAttrs: [1, "mat-context-menu-trigger"], hostVars: 3, hostBindings: function (t, i) { t & 1 && n.\u0275\u0275listener("contextmenu", function (r) { return i._handleContextMenuEvent(r); }), t & 2 && (n.\u0275\u0275attribute("aria-controls", i.menuOpen ? i.menu == null ? null : i.menu.panelId : null), n.\u0275\u0275classProp("mat-context-menu-trigger-disabled", i.disabled)); }, inputs: { menu: [0, "matContextMenuTriggerFor", "menu"], menuData: [0, "matContextMenuTriggerData", "menuData"], restoreFocus: [0, "matContextMenuTriggerRestoreFocus", "restoreFocus"], disabled: [2, "matContextMenuTriggerDisabled", "disabled", d] }, outputs: { menuOpened: "menuOpened", menuClosed: "menuClosed" }, exportAs: ["matContextMenuTrigger"], features: [n.\u0275\u0275InheritDefinitionFeature] });
} return s; })(), yt = (() => { class s {
static \u0275fac = function (t) { return new (t || s); };
static \u0275mod = n.\u0275\u0275defineNgModule({ type: s });
static \u0275inj = n.\u0275\u0275defineInjector({ providers: [Ye], imports: [Y, R, De, Te, R] });
} return s; })(), J = { transformMenu: { type: 7, name: "transformMenu", definitions: [{ type: 0, name: "void", styles: { type: 6, styles: { opacity: 0, transform: "scale(0.8)" }, offset: null } }, { type: 1, expr: "void => enter", animation: { type: 4, styles: { type: 6, styles: { opacity: 1, transform: "scale(1)" }, offset: null }, timings: "120ms cubic-bezier(0, 0, 0.2, 1)" }, options: null }, { type: 1, expr: "* => void", animation: { type: 4, styles: { type: 6, styles: { opacity: 0 }, offset: null }, timings: "100ms 25ms linear" }, options: null }], options: {} }, fadeInItems: { type: 7, name: "fadeInItems", definitions: [{ type: 0, name: "showing", styles: { type: 6, styles: { opacity: 1 }, offset: null } }, { type: 1, expr: "void => *", animation: [{ type: 6, styles: { opacity: 0 }, offset: null }, { type: 4, styles: null, timings: "400ms 100ms cubic-bezier(0.55, 0, 0.55, 0.2)" }], options: null }], options: {} } }, Mt = J.fadeInItems, vt = J.transformMenu;
export { K as MAT_MENU_CONTENT, Le as MAT_MENU_DEFAULT_OPTIONS, F as MAT_MENU_PANEL, q as MAT_MENU_SCROLL_STRATEGY, Ye as MAT_MENU_SCROLL_STRATEGY_FACTORY_PROVIDER, gt as MENU_PANEL_TOP_PADDING, bt as MatContextMenuTrigger, b as MatMenu, _t as MatMenuContent, O as MatMenuItem, yt as MatMenuModule, ft as MatMenuTrigger, Mt as fadeInItems, J as matMenuAnimations, vt as transformMenu };