source: trip-planner-front/node_modules/primeng/esm2020/contextmenu/contextmenu.mjs@ 59329aa

Last change on this file since 59329aa was 59329aa, checked in by Ema <ema_spirova@…>, 3 years ago

adding photos

  • Property mode set to 100644
File size: 86.7 KB
Line 
1import { NgModule, Component, Input, Output, Inject, forwardRef, ViewChild, EventEmitter, ChangeDetectionStrategy, ViewEncapsulation } from '@angular/core';
2import { CommonModule } from '@angular/common';
3import { DomHandler } from 'primeng/dom';
4import { ContextMenuService } from 'primeng/api';
5import { RippleModule } from 'primeng/ripple';
6import { ZIndexUtils } from 'primeng/utils';
7import { RouterModule } from '@angular/router';
8import { Subject } from 'rxjs';
9import { takeUntil } from 'rxjs/operators';
10import { TooltipModule } from 'primeng/tooltip';
11import * as i0 from "@angular/core";
12import * as i1 from "@angular/common";
13import * as i2 from "primeng/tooltip";
14import * as i3 from "primeng/ripple";
15import * as i4 from "@angular/router";
16import * as i5 from "primeng/api";
17export class ContextMenuSub {
18 constructor(contextMenu) {
19 this.leafClick = new EventEmitter();
20 this.contextMenu = contextMenu;
21 }
22 ngOnInit() {
23 this.activeItemKeyChangeSubscription = this.contextMenu.contextMenuService.activeItemKeyChange$.pipe(takeUntil(this.contextMenu.ngDestroy$)).subscribe((activeItemKey) => {
24 this.activeItemKey = activeItemKey;
25 if (this.isActive(this.parentItemKey) && DomHandler.hasClass(this.sublistViewChild.nativeElement, 'p-submenu-list-active')) {
26 this.contextMenu.positionSubmenu(this.sublistViewChild.nativeElement);
27 }
28 this.contextMenu.cd.markForCheck();
29 });
30 }
31 onItemMouseEnter(event, item, key) {
32 if (this.hideTimeout) {
33 clearTimeout(this.hideTimeout);
34 this.hideTimeout = null;
35 }
36 if (item.disabled) {
37 return;
38 }
39 if (item.items) {
40 let childSublist = DomHandler.findSingle(event.currentTarget, '.p-submenu-list');
41 DomHandler.addClass(childSublist, 'p-submenu-list-active');
42 }
43 this.contextMenu.contextMenuService.changeKey(key);
44 }
45 onItemMouseLeave(event, item) {
46 if (item.disabled) {
47 return;
48 }
49 if (this.contextMenu.el.nativeElement.contains(event.toElement)) {
50 if (item.items) {
51 this.contextMenu.removeActiveFromSubLists(event.currentTarget);
52 }
53 if (!this.root) {
54 this.contextMenu.contextMenuService.changeKey(this.parentItemKey);
55 }
56 }
57 }
58 onItemClick(event, item, menuitem, key) {
59 if (item.disabled) {
60 event.preventDefault();
61 return;
62 }
63 if (!item.url && !item.routerLink) {
64 event.preventDefault();
65 }
66 if (item.command) {
67 item.command({
68 originalEvent: event,
69 item: item
70 });
71 }
72 if (item.items) {
73 let childSublist = DomHandler.findSingle(menuitem, '.p-submenu-list');
74 if (childSublist) {
75 if (this.isActive(key) && DomHandler.hasClass(childSublist, 'p-submenu-list-active')) {
76 this.contextMenu.removeActiveFromSubLists(menuitem);
77 }
78 else {
79 DomHandler.addClass(childSublist, 'p-submenu-list-active');
80 }
81 this.contextMenu.contextMenuService.changeKey(key);
82 }
83 }
84 if (!item.items) {
85 this.onLeafClick();
86 }
87 }
88 onLeafClick() {
89 if (this.root) {
90 this.contextMenu.hide();
91 }
92 this.leafClick.emit();
93 }
94 getKey(index) {
95 return this.root ? String(index) : this.parentItemKey + '_' + index;
96 }
97 isActive(key) {
98 return (this.activeItemKey && (this.activeItemKey.startsWith(key + '_') || this.activeItemKey === key));
99 }
100}
101ContextMenuSub.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.0.0", ngImport: i0, type: ContextMenuSub, deps: [{ token: forwardRef(() => ContextMenu) }], target: i0.ɵɵFactoryTarget.Component });
102ContextMenuSub.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.0.0", type: ContextMenuSub, selector: "p-contextMenuSub", inputs: { item: "item", root: "root", parentItemKey: "parentItemKey" }, outputs: { leafClick: "leafClick" }, host: { classAttribute: "p-element" }, viewQueries: [{ propertyName: "sublistViewChild", first: true, predicate: ["sublist"], descendants: true }, { propertyName: "menuitemViewChild", first: true, predicate: ["menuitem"], descendants: true }], ngImport: i0, template: `
103 <ul #sublist [ngClass]="{'p-submenu-list':!root}">
104 <ng-template ngFor let-child let-index="index" [ngForOf]="(root ? item : item.items)">
105 <li *ngIf="child.separator" #menuitem class="p-menu-separator" [ngClass]="{'p-hidden': child.visible === false}" role="separator">
106 <li *ngIf="!child.separator" #menuitem [ngClass]="{'p-menuitem':true,'p-menuitem-active': isActive(getKey(index)),'p-hidden': child.visible === false}" [ngStyle]="child.style" [class]="child.styleClass" pTooltip [tooltipOptions]="child.tooltipOptions"
107 (mouseenter)="onItemMouseEnter($event,child,getKey(index))" (mouseleave)="onItemMouseLeave($event,child)" role="none" [attr.data-ik]="getKey(index)">
108 <a *ngIf="!child.routerLink" [attr.href]="child.url ? child.url : null" [attr.target]="child.target" [attr.title]="child.title" [attr.id]="child.id"
109 [attr.tabindex]="child.disabled ? null : '0'" (click)="onItemClick($event, child, menuitem, getKey(index))" [ngClass]="{'p-menuitem-link':true,'p-disabled':child.disabled}" pRipple
110 [attr.aria-haspopup]="item.items != null" [attr.aria-expanded]="isActive(getKey(index))">
111 <span class="p-menuitem-icon" *ngIf="child.icon" [ngClass]="child.icon"></span>
112 <span class="p-menuitem-text" *ngIf="child.escape !== false; else htmlLabel">{{child.label}}</span>
113 <ng-template #htmlLabel><span class="p-menuitem-text" [innerHTML]="child.label"></span></ng-template>
114 <span class="p-submenu-icon pi pi-angle-right" *ngIf="child.items"></span>
115 </a>
116 <a *ngIf="child.routerLink" [routerLink]="child.routerLink" [queryParams]="child.queryParams" [routerLinkActive]="'p-menuitem-link-active'" role="menuitem"
117 [routerLinkActiveOptions]="child.routerLinkActiveOptions||{exact:false}" [attr.target]="child.target" [attr.title]="child.title" [attr.id]="child.id" [attr.tabindex]="child.disabled ? null : '0'"
118 (click)="onItemClick($event, child, menuitem, getKey(index))" [ngClass]="{'p-menuitem-link':true,'p-disabled':child.disabled}"
119 pRipple [fragment]="child.fragment" [queryParamsHandling]="child.queryParamsHandling" [preserveFragment]="child.preserveFragment" [skipLocationChange]="child.skipLocationChange" [replaceUrl]="child.replaceUrl" [state]="child.state">
120 <span class="p-menuitem-icon" *ngIf="child.icon" [ngClass]="child.icon"></span>
121 <span class="p-menuitem-text" *ngIf="child.escape !== false; else htmlRouteLabel">{{child.label}}</span>
122 <ng-template #htmlRouteLabel><span class="p-menuitem-text" [innerHTML]="child.label"></span></ng-template>
123 <span class="p-submenu-icon pi pi-angle-right" *ngIf="child.items"></span>
124 </a>
125 <p-contextMenuSub [parentItemKey]="getKey(index)" [item]="child" *ngIf="child.items" (leafClick)="onLeafClick()"></p-contextMenuSub>
126 </li>
127 </ng-template>
128 </ul>
129 `, isInline: true, components: [{ type: ContextMenuSub, selector: "p-contextMenuSub", inputs: ["item", "root", "parentItemKey"], outputs: ["leafClick"] }], directives: [{ type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i2.Tooltip, selector: "[pTooltip]", inputs: ["tooltipPosition", "tooltipEvent", "appendTo", "positionStyle", "tooltipStyleClass", "tooltipZIndex", "escape", "showDelay", "hideDelay", "life", "positionTop", "positionLeft", "pTooltip", "tooltipDisabled", "tooltipOptions"] }, { type: i1.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { type: i3.Ripple, selector: "[pRipple]" }, { type: i4.RouterLinkWithHref, selector: "a[routerLink],area[routerLink]", inputs: ["target", "queryParams", "fragment", "queryParamsHandling", "preserveFragment", "skipLocationChange", "replaceUrl", "state", "relativeTo", "routerLink"] }, { type: i4.RouterLinkActive, selector: "[routerLinkActive]", inputs: ["routerLinkActiveOptions", "routerLinkActive"], outputs: ["isActiveChange"], exportAs: ["routerLinkActive"] }], encapsulation: i0.ViewEncapsulation.None });
130i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.0.0", ngImport: i0, type: ContextMenuSub, decorators: [{
131 type: Component,
132 args: [{
133 selector: 'p-contextMenuSub',
134 template: `
135 <ul #sublist [ngClass]="{'p-submenu-list':!root}">
136 <ng-template ngFor let-child let-index="index" [ngForOf]="(root ? item : item.items)">
137 <li *ngIf="child.separator" #menuitem class="p-menu-separator" [ngClass]="{'p-hidden': child.visible === false}" role="separator">
138 <li *ngIf="!child.separator" #menuitem [ngClass]="{'p-menuitem':true,'p-menuitem-active': isActive(getKey(index)),'p-hidden': child.visible === false}" [ngStyle]="child.style" [class]="child.styleClass" pTooltip [tooltipOptions]="child.tooltipOptions"
139 (mouseenter)="onItemMouseEnter($event,child,getKey(index))" (mouseleave)="onItemMouseLeave($event,child)" role="none" [attr.data-ik]="getKey(index)">
140 <a *ngIf="!child.routerLink" [attr.href]="child.url ? child.url : null" [attr.target]="child.target" [attr.title]="child.title" [attr.id]="child.id"
141 [attr.tabindex]="child.disabled ? null : '0'" (click)="onItemClick($event, child, menuitem, getKey(index))" [ngClass]="{'p-menuitem-link':true,'p-disabled':child.disabled}" pRipple
142 [attr.aria-haspopup]="item.items != null" [attr.aria-expanded]="isActive(getKey(index))">
143 <span class="p-menuitem-icon" *ngIf="child.icon" [ngClass]="child.icon"></span>
144 <span class="p-menuitem-text" *ngIf="child.escape !== false; else htmlLabel">{{child.label}}</span>
145 <ng-template #htmlLabel><span class="p-menuitem-text" [innerHTML]="child.label"></span></ng-template>
146 <span class="p-submenu-icon pi pi-angle-right" *ngIf="child.items"></span>
147 </a>
148 <a *ngIf="child.routerLink" [routerLink]="child.routerLink" [queryParams]="child.queryParams" [routerLinkActive]="'p-menuitem-link-active'" role="menuitem"
149 [routerLinkActiveOptions]="child.routerLinkActiveOptions||{exact:false}" [attr.target]="child.target" [attr.title]="child.title" [attr.id]="child.id" [attr.tabindex]="child.disabled ? null : '0'"
150 (click)="onItemClick($event, child, menuitem, getKey(index))" [ngClass]="{'p-menuitem-link':true,'p-disabled':child.disabled}"
151 pRipple [fragment]="child.fragment" [queryParamsHandling]="child.queryParamsHandling" [preserveFragment]="child.preserveFragment" [skipLocationChange]="child.skipLocationChange" [replaceUrl]="child.replaceUrl" [state]="child.state">
152 <span class="p-menuitem-icon" *ngIf="child.icon" [ngClass]="child.icon"></span>
153 <span class="p-menuitem-text" *ngIf="child.escape !== false; else htmlRouteLabel">{{child.label}}</span>
154 <ng-template #htmlRouteLabel><span class="p-menuitem-text" [innerHTML]="child.label"></span></ng-template>
155 <span class="p-submenu-icon pi pi-angle-right" *ngIf="child.items"></span>
156 </a>
157 <p-contextMenuSub [parentItemKey]="getKey(index)" [item]="child" *ngIf="child.items" (leafClick)="onLeafClick()"></p-contextMenuSub>
158 </li>
159 </ng-template>
160 </ul>
161 `,
162 encapsulation: ViewEncapsulation.None,
163 host: {
164 'class': 'p-element'
165 }
166 }]
167 }], ctorParameters: function () { return [{ type: undefined, decorators: [{
168 type: Inject,
169 args: [forwardRef(() => ContextMenu)]
170 }] }]; }, propDecorators: { item: [{
171 type: Input
172 }], root: [{
173 type: Input
174 }], parentItemKey: [{
175 type: Input
176 }], leafClick: [{
177 type: Output
178 }], sublistViewChild: [{
179 type: ViewChild,
180 args: ['sublist']
181 }], menuitemViewChild: [{
182 type: ViewChild,
183 args: ['menuitem']
184 }] } });
185export class ContextMenu {
186 constructor(el, renderer, cd, zone, contextMenuService, config) {
187 this.el = el;
188 this.renderer = renderer;
189 this.cd = cd;
190 this.zone = zone;
191 this.contextMenuService = contextMenuService;
192 this.config = config;
193 this.autoZIndex = true;
194 this.baseZIndex = 0;
195 this.triggerEvent = 'contextmenu';
196 this.onShow = new EventEmitter();
197 this.onHide = new EventEmitter();
198 this.ngDestroy$ = new Subject();
199 }
200 ngAfterViewInit() {
201 if (this.global) {
202 const documentTarget = this.el ? this.el.nativeElement.ownerDocument : 'document';
203 this.triggerEventListener = this.renderer.listen(documentTarget, this.triggerEvent, (event) => {
204 this.show(event);
205 event.preventDefault();
206 });
207 }
208 else if (this.target) {
209 this.triggerEventListener = this.renderer.listen(this.target, this.triggerEvent, (event) => {
210 this.show(event);
211 event.preventDefault();
212 event.stopPropagation();
213 });
214 }
215 if (this.appendTo) {
216 if (this.appendTo === 'body')
217 document.body.appendChild(this.containerViewChild.nativeElement);
218 else
219 DomHandler.appendChild(this.containerViewChild.nativeElement, this.appendTo);
220 }
221 }
222 show(event) {
223 this.clearActiveItem();
224 this.position(event);
225 this.moveOnTop();
226 this.containerViewChild.nativeElement.style.display = 'block';
227 DomHandler.fadeIn(this.containerViewChild.nativeElement, 250);
228 this.bindGlobalListeners();
229 if (event) {
230 event.preventDefault();
231 }
232 this.onShow.emit();
233 }
234 hide() {
235 this.containerViewChild.nativeElement.style.display = 'none';
236 if (this.autoZIndex) {
237 ZIndexUtils.clear(this.containerViewChild.nativeElement);
238 }
239 this.unbindGlobalListeners();
240 this.onHide.emit();
241 }
242 moveOnTop() {
243 if (this.autoZIndex && this.containerViewChild && this.containerViewChild.nativeElement.style.display !== 'block') {
244 ZIndexUtils.set('menu', this.containerViewChild.nativeElement, this.baseZIndex + this.config.zIndex.menu);
245 }
246 }
247 toggle(event) {
248 if (this.containerViewChild.nativeElement.offsetParent)
249 this.hide();
250 else
251 this.show(event);
252 }
253 position(event) {
254 if (event) {
255 let left = event.pageX + 1;
256 let top = event.pageY + 1;
257 let width = this.containerViewChild.nativeElement.offsetParent ? this.containerViewChild.nativeElement.offsetWidth : DomHandler.getHiddenElementOuterWidth(this.containerViewChild.nativeElement);
258 let height = this.containerViewChild.nativeElement.offsetParent ? this.containerViewChild.nativeElement.offsetHeight : DomHandler.getHiddenElementOuterHeight(this.containerViewChild.nativeElement);
259 let viewport = DomHandler.getViewport();
260 //flip
261 if (left + width - document.body.scrollLeft > viewport.width) {
262 left -= width;
263 }
264 //flip
265 if (top + height - document.body.scrollTop > viewport.height) {
266 top -= height;
267 }
268 //fit
269 if (left < document.body.scrollLeft) {
270 left = document.body.scrollLeft;
271 }
272 //fit
273 if (top < document.body.scrollTop) {
274 top = document.body.scrollTop;
275 }
276 this.containerViewChild.nativeElement.style.left = left + 'px';
277 this.containerViewChild.nativeElement.style.top = top + 'px';
278 }
279 }
280 positionSubmenu(sublist) {
281 let parentMenuItem = sublist.parentElement.parentElement;
282 let viewport = DomHandler.getViewport();
283 let sublistWidth = sublist.offsetParent ? sublist.offsetWidth : DomHandler.getHiddenElementOuterWidth(sublist);
284 let sublistHeight = sublist.offsetHeight ? sublist.offsetHeight : DomHandler.getHiddenElementOuterHeight(sublist);
285 let itemOuterWidth = DomHandler.getOuterWidth(parentMenuItem.children[0]);
286 let itemOuterHeight = DomHandler.getOuterHeight(parentMenuItem.children[0]);
287 let containerOffset = DomHandler.getOffset(parentMenuItem.parentElement);
288 sublist.style.zIndex = ++DomHandler.zindex;
289 if ((parseInt(containerOffset.top) + itemOuterHeight + sublistHeight) > (viewport.height - DomHandler.calculateScrollbarHeight())) {
290 sublist.style.removeProperty('top');
291 sublist.style.bottom = '0px';
292 }
293 else {
294 sublist.style.removeProperty('bottom');
295 sublist.style.top = '0px';
296 }
297 if ((parseInt(containerOffset.left) + itemOuterWidth + sublistWidth) > (viewport.width - DomHandler.calculateScrollbarWidth())) {
298 sublist.style.left = -sublistWidth + 'px';
299 }
300 else {
301 sublist.style.left = itemOuterWidth + 'px';
302 }
303 }
304 isItemMatched(menuitem) {
305 return DomHandler.hasClass(menuitem, 'p-menuitem') && !DomHandler.hasClass(menuitem.children[0], 'p-disabled');
306 }
307 findNextItem(menuitem, isRepeated) {
308 let nextMenuitem = menuitem.nextElementSibling;
309 if (nextMenuitem) {
310 return this.isItemMatched(nextMenuitem) ? nextMenuitem : this.findNextItem(nextMenuitem, isRepeated);
311 }
312 else {
313 let firstItem = menuitem.parentElement.children[0];
314 return this.isItemMatched(firstItem) ? firstItem : (!isRepeated ? this.findNextItem(firstItem, true) : null);
315 }
316 }
317 findPrevItem(menuitem, isRepeated) {
318 let prevMenuitem = menuitem.previousElementSibling;
319 if (prevMenuitem) {
320 return this.isItemMatched(prevMenuitem) ? prevMenuitem : this.findPrevItem(prevMenuitem, isRepeated);
321 }
322 else {
323 let lastItem = menuitem.parentElement.children[menuitem.parentElement.children.length - 1];
324 return this.isItemMatched(lastItem) ? lastItem : (!isRepeated ? this.findPrevItem(lastItem, true) : null);
325 }
326 }
327 getActiveItem() {
328 let activeItemKey = this.contextMenuService.activeItemKey;
329 return activeItemKey == null ? null : DomHandler.findSingle(this.containerViewChild.nativeElement, '.p-menuitem[data-ik="' + activeItemKey + '"]');
330 }
331 clearActiveItem() {
332 if (this.contextMenuService.activeItemKey) {
333 this.removeActiveFromSubLists(this.containerViewChild.nativeElement);
334 this.contextMenuService.reset();
335 }
336 }
337 removeActiveFromSubLists(el) {
338 let sublists = DomHandler.find(el, '.p-submenu-list-active');
339 for (let sublist of sublists) {
340 DomHandler.removeClass(sublist, 'p-submenu-list-active');
341 }
342 }
343 removeActiveFromSublist(menuitem) {
344 if (menuitem) {
345 let sublist = DomHandler.findSingle(menuitem, '.p-submenu-list');
346 if (sublist && DomHandler.hasClass(menuitem, 'p-submenu-list-active')) {
347 DomHandler.removeClass(menuitem, 'p-submenu-list-active');
348 }
349 }
350 }
351 bindGlobalListeners() {
352 if (!this.documentClickListener) {
353 const documentTarget = this.el ? this.el.nativeElement.ownerDocument : 'document';
354 this.documentClickListener = this.renderer.listen(documentTarget, 'click', (event) => {
355 if (this.containerViewChild.nativeElement.offsetParent && this.isOutsideClicked(event) && !event.ctrlKey && event.button !== 2) {
356 this.hide();
357 }
358 });
359 }
360 this.zone.runOutsideAngular(() => {
361 if (!this.windowResizeListener) {
362 this.windowResizeListener = this.onWindowResize.bind(this);
363 window.addEventListener('resize', this.windowResizeListener);
364 }
365 });
366 if (!this.documentKeydownListener) {
367 const documentTarget = this.el ? this.el.nativeElement.ownerDocument : 'document';
368 this.documentKeydownListener = this.renderer.listen(documentTarget, 'keydown', (event) => {
369 let activeItem = this.getActiveItem();
370 switch (event.key) {
371 case 'ArrowDown':
372 if (activeItem) {
373 this.removeActiveFromSublist(activeItem);
374 activeItem = this.findNextItem(activeItem);
375 }
376 else {
377 let firstItem = DomHandler.findSingle(this.containerViewChild.nativeElement, '.p-menuitem-link').parentElement;
378 activeItem = this.isItemMatched(firstItem) ? firstItem : this.findNextItem(firstItem);
379 }
380 if (activeItem) {
381 this.contextMenuService.changeKey(activeItem.getAttribute('data-ik'));
382 }
383 event.preventDefault();
384 break;
385 case 'ArrowUp':
386 if (activeItem) {
387 this.removeActiveFromSublist(activeItem);
388 activeItem = this.findPrevItem(activeItem);
389 }
390 else {
391 let sublist = DomHandler.findSingle(this.containerViewChild.nativeElement, 'ul');
392 let lastItem = sublist.children[sublist.children.length - 1];
393 activeItem = this.isItemMatched(lastItem) ? lastItem : this.findPrevItem(lastItem);
394 }
395 if (activeItem) {
396 this.contextMenuService.changeKey(activeItem.getAttribute('data-ik'));
397 }
398 event.preventDefault();
399 break;
400 case 'ArrowRight':
401 if (activeItem) {
402 let sublist = DomHandler.findSingle(activeItem, '.p-submenu-list');
403 if (sublist) {
404 DomHandler.addClass(sublist, 'p-submenu-list-active');
405 activeItem = DomHandler.findSingle(sublist, '.p-menuitem-link:not(.p-disabled)').parentElement;
406 if (activeItem) {
407 this.contextMenuService.changeKey(activeItem.getAttribute('data-ik'));
408 }
409 }
410 }
411 event.preventDefault();
412 break;
413 case 'ArrowLeft':
414 if (activeItem) {
415 let sublist = activeItem.parentElement;
416 if (sublist && DomHandler.hasClass(sublist, 'p-submenu-list-active')) {
417 DomHandler.removeClass(sublist, 'p-submenu-list-active');
418 activeItem = sublist.parentElement.parentElement;
419 if (activeItem) {
420 this.contextMenuService.changeKey(activeItem.getAttribute('data-ik'));
421 }
422 }
423 }
424 event.preventDefault();
425 break;
426 case 'Escape':
427 this.hide();
428 event.preventDefault();
429 break;
430 case 'Enter':
431 if (activeItem) {
432 this.handleItemClick(event, this.findModelItemFromKey(this.contextMenuService.activeItemKey), activeItem);
433 }
434 event.preventDefault();
435 break;
436 default:
437 break;
438 }
439 });
440 }
441 }
442 findModelItemFromKey(key) {
443 if (key == null || !this.model) {
444 return null;
445 }
446 let indexes = key.split('_');
447 return indexes.reduce((item, currentIndex) => {
448 return item ? item.items[currentIndex] : this.model[currentIndex];
449 }, null);
450 }
451 handleItemClick(event, item, menuitem) {
452 if (!item || item.disabled) {
453 return;
454 }
455 if (item.command) {
456 item.command({
457 originalEvent: event,
458 item: item
459 });
460 }
461 if (item.items) {
462 let childSublist = DomHandler.findSingle(menuitem, '.p-submenu-list');
463 if (childSublist) {
464 if (DomHandler.hasClass(childSublist, 'p-submenu-list-active')) {
465 this.removeActiveFromSubLists(menuitem);
466 }
467 else {
468 DomHandler.addClass(childSublist, 'p-submenu-list-active');
469 this.positionSubmenu(childSublist);
470 }
471 }
472 }
473 if (!item.items) {
474 this.hide();
475 }
476 }
477 unbindGlobalListeners() {
478 if (this.documentClickListener) {
479 this.documentClickListener();
480 this.documentClickListener = null;
481 }
482 if (this.windowResizeListener) {
483 window.removeEventListener('resize', this.windowResizeListener);
484 this.windowResizeListener = null;
485 }
486 if (this.documentKeydownListener) {
487 this.documentKeydownListener();
488 this.documentKeydownListener = null;
489 }
490 }
491 onWindowResize(event) {
492 if (this.containerViewChild.nativeElement.offsetParent) {
493 this.hide();
494 }
495 }
496 isOutsideClicked(event) {
497 return !(this.containerViewChild.nativeElement.isSameNode(event.target) || this.containerViewChild.nativeElement.contains(event.target));
498 }
499 ngOnDestroy() {
500 this.unbindGlobalListeners();
501 if (this.triggerEventListener) {
502 this.triggerEventListener();
503 }
504 if (this.containerViewChild && this.autoZIndex) {
505 ZIndexUtils.clear(this.containerViewChild.nativeElement);
506 }
507 if (this.appendTo) {
508 this.el.nativeElement.appendChild(this.containerViewChild.nativeElement);
509 }
510 this.ngDestroy$.next(true);
511 this.ngDestroy$.complete();
512 }
513}
514ContextMenu.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.0.0", ngImport: i0, type: ContextMenu, deps: [{ token: i0.ElementRef }, { token: i0.Renderer2 }, { token: i0.ChangeDetectorRef }, { token: i0.NgZone }, { token: i5.ContextMenuService }, { token: i5.PrimeNGConfig }], target: i0.ɵɵFactoryTarget.Component });
515ContextMenu.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.0.0", type: ContextMenu, selector: "p-contextMenu", inputs: { model: "model", global: "global", target: "target", style: "style", styleClass: "styleClass", appendTo: "appendTo", autoZIndex: "autoZIndex", baseZIndex: "baseZIndex", triggerEvent: "triggerEvent" }, outputs: { onShow: "onShow", onHide: "onHide" }, host: { classAttribute: "p-element" }, viewQueries: [{ propertyName: "containerViewChild", first: true, predicate: ["container"], descendants: true }], ngImport: i0, template: `
516 <div #container [ngClass]="'p-contextmenu p-component'" [class]="styleClass" [ngStyle]="style">
517 <p-contextMenuSub [item]="model" [root]="true"></p-contextMenuSub>
518 </div>
519 `, isInline: true, styles: [".p-contextmenu{position:absolute;display:none}.p-contextmenu ul{margin:0;padding:0;list-style:none}.p-contextmenu .p-submenu-list{position:absolute;min-width:100%;z-index:1;display:none}.p-contextmenu .p-menuitem-link{cursor:pointer;display:flex;align-items:center;text-decoration:none;overflow:hidden;position:relative}.p-contextmenu .p-menuitem-text{line-height:1}.p-contextmenu .p-menuitem{position:relative}.p-contextmenu .p-menuitem-link .p-submenu-icon{margin-left:auto}.p-contextmenu .p-menuitem-active>p-contextmenusub>.p-submenu-list.p-submenu-list-active{display:block!important}\n"], components: [{ type: ContextMenuSub, selector: "p-contextMenuSub", inputs: ["item", "root", "parentItemKey"], outputs: ["leafClick"] }], directives: [{ type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { type: i1.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
520i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.0.0", ngImport: i0, type: ContextMenu, decorators: [{
521 type: Component,
522 args: [{ selector: 'p-contextMenu', template: `
523 <div #container [ngClass]="'p-contextmenu p-component'" [class]="styleClass" [ngStyle]="style">
524 <p-contextMenuSub [item]="model" [root]="true"></p-contextMenuSub>
525 </div>
526 `, changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, host: {
527 'class': 'p-element'
528 }, styles: [".p-contextmenu{position:absolute;display:none}.p-contextmenu ul{margin:0;padding:0;list-style:none}.p-contextmenu .p-submenu-list{position:absolute;min-width:100%;z-index:1;display:none}.p-contextmenu .p-menuitem-link{cursor:pointer;display:flex;align-items:center;text-decoration:none;overflow:hidden;position:relative}.p-contextmenu .p-menuitem-text{line-height:1}.p-contextmenu .p-menuitem{position:relative}.p-contextmenu .p-menuitem-link .p-submenu-icon{margin-left:auto}.p-contextmenu .p-menuitem-active>p-contextmenusub>.p-submenu-list.p-submenu-list-active{display:block!important}\n"] }]
529 }], ctorParameters: function () { return [{ type: i0.ElementRef }, { type: i0.Renderer2 }, { type: i0.ChangeDetectorRef }, { type: i0.NgZone }, { type: i5.ContextMenuService }, { type: i5.PrimeNGConfig }]; }, propDecorators: { model: [{
530 type: Input
531 }], global: [{
532 type: Input
533 }], target: [{
534 type: Input
535 }], style: [{
536 type: Input
537 }], styleClass: [{
538 type: Input
539 }], appendTo: [{
540 type: Input
541 }], autoZIndex: [{
542 type: Input
543 }], baseZIndex: [{
544 type: Input
545 }], triggerEvent: [{
546 type: Input
547 }], onShow: [{
548 type: Output
549 }], onHide: [{
550 type: Output
551 }], containerViewChild: [{
552 type: ViewChild,
553 args: ['container']
554 }] } });
555export class ContextMenuModule {
556}
557ContextMenuModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.0.0", ngImport: i0, type: ContextMenuModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
558ContextMenuModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.0.0", ngImport: i0, type: ContextMenuModule, declarations: [ContextMenu, ContextMenuSub], imports: [CommonModule, RouterModule, RippleModule, TooltipModule], exports: [ContextMenu, RouterModule, TooltipModule] });
559ContextMenuModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.0.0", ngImport: i0, type: ContextMenuModule, providers: [ContextMenuService], imports: [[CommonModule, RouterModule, RippleModule, TooltipModule], RouterModule, TooltipModule] });
560i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.0.0", ngImport: i0, type: ContextMenuModule, decorators: [{
561 type: NgModule,
562 args: [{
563 imports: [CommonModule, RouterModule, RippleModule, TooltipModule],
564 exports: [ContextMenu, RouterModule, TooltipModule],
565 declarations: [ContextMenu, ContextMenuSub],
566 providers: [ContextMenuService]
567 }]
568 }] });
569//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiY29udGV4dG1lbnUuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi9zcmMvYXBwL2NvbXBvbmVudHMvY29udGV4dG1lbnUvY29udGV4dG1lbnUudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsT0FBTyxFQUFFLFFBQVEsRUFBQyxTQUFTLEVBQW9DLEtBQUssRUFBQyxNQUFNLEVBQVcsTUFBTSxFQUFDLFVBQVUsRUFBQyxTQUFTLEVBQVEsWUFBWSxFQUFDLHVCQUF1QixFQUFFLGlCQUFpQixFQUFxQixNQUFNLGVBQWUsQ0FBQztBQUMzTixPQUFPLEVBQUUsWUFBWSxFQUFFLE1BQU0saUJBQWlCLENBQUM7QUFDL0MsT0FBTyxFQUFFLFVBQVUsRUFBRSxNQUFNLGFBQWEsQ0FBQztBQUN6QyxPQUFPLEVBQVksa0JBQWtCLEVBQWlCLE1BQU0sYUFBYSxDQUFDO0FBQzFFLE9BQU8sRUFBRSxZQUFZLEVBQUUsTUFBTSxnQkFBZ0IsQ0FBQztBQUM5QyxPQUFPLEVBQUUsV0FBVyxFQUFFLE1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b25JdGVtTW91c2VFbnRlcihldmVudCwgaXRlbSwga2V5KSB7XG4gICAgICAgIGlmICh0aGlzLmhpZGVUaW1lb3V0KSB7XG4gICAgICAgICAgICBjbGVhclRpbWVvdXQodGhpcy5oaWRlVGltZW91dCk7XG4gICAgICAgICAgICB0aGlzLmhpZGVUaW1lb3V0ID0gbnVsbDtcbiAgICAgICAgfVxuXG4gICAgICAgIGlmIChpdGVtLmRpc2FibGVkKSB7XG4gICAgICAgICAgICByZXR1cm47XG4gICAgICAgIH1cblxuICAgICAgICBpZiAoaXRlbS5pdGVtcykge1xuICAgICAgICAgICAgbGV0IGNoaWxkU3VibGlzdCA9IERvbUhhbmRsZXIuZmluZFNpbmdsZShldmVudC5jdXJyZW50VGFyZ2V0LCAnLnAtc3VibWVudS1saXN0Jyk7XG4gICAgICAgICAgICBEb21IYW5kbGVyLmFkZENsYXNzKGNoaWxkU3VibGlzdCwgJ3Atc3VibWVudS1saXN0LWFjdGl2ZScpO1xuICAgICAgICB9XG5cbiAgICAgICAgdGhpcy5jb250ZXh0TWVudS5jb250ZXh0TWVudVNlcnZpY2UuY2hhbmdlS2V5KGtleSk7XG4gICAgfVxuXG4gICAgb25JdGVtTW91c2VMZWF2ZShldmVudCwgaXRlbSkge1xuICAgICAgICBpZiAoaXRlbS5kaXNhYmxlZCkge1xuICAgICAgICAgICAgcmV0dXJuO1xuICAgICAgICB9XG5cbiAgICAgICAgaWYgKHRoaXMuY29udGV4dE1lbnUuZWwubmF0aXZlRWxlbWVudC5jb250YWlucyg8Tm9kZT4gZXZlbnQudG9FbGVtZW50KSkge1xuICAgICAgICAgICAgaWYgKGl0ZW0uaXRlbXMpIHtcbiAgICAgICAgICAgICAgICB0aGlzLmNvbnRleHRNZW51LnJlbW92ZUFjdGl2ZUZyb21TdWJMaXN0cyhldmVudC5jdXJyZW50VGFyZ2V0KTtcbiAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgaWYgKCF0aGlzLnJvb3QpIHtcbiAgICAgICAgICAgICAgICB0aGlzLmNvbnRleHRNZW51LmNvbnRleHRNZW51U2VydmljZS5jaGFuZ2VLZXkodGhpcy5wYXJlbnRJdGVtS2V5KTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgIH1cblxuICAgIG9uSXRlbUNsaWNrKGV2ZW50LCBpdGVtLCBtZW51aXRlbSwga2V5KSB7XG4gICAgICAgIGlmIChpdGVtLmRpc2FibGVkKSB7XG4gICAgICAgICAgICBldmVudC5wcmV2ZW50RGVmYXVsdCgpO1xuICAgICAgICAgICAgcmV0dXJuO1xuICAgICAgICB9XG5cbiAgICAgICAgaWYgKCFpdGVtLnVybCAmJiAhaXRlbS5yb3V0ZXJMaW5rKSB7XG4gICAgICAgICAgICBldmVudC5wcmV2ZW50RGVmYXVsdCgpO1xuICAgICAgICB9XG5cbiAgICAgICAgaWYgKGl0ZW0uY29tbWFuZCkge1xuICAgICAgICAgICAgaXRlbS5jb21tYW5kKHtcbiAgICAgICAgICAgICAgICBvcmlnaW5hbEV2ZW50OiBldmVudCxcbiAgICAgICAgICAgICAgICBpdGVtOiBpdGVtXG4gICAgICAgICAgICB9KTtcbiAgICAgICAgfVxuXG4gICAgICAgIGlmIChpdGVtLml0ZW1zKSB7XG4gICAgICAgICAgICBsZXQgY2hpbGRTdWJsaXN0ID0gRG9tSGFuZGxlci5maW5kU2luZ2xlKG1lbnVpdGVtLCAnLnAtc3VibWVudS1saXN0Jyk7XG5cbiAgICAgICAgICAgIGlmIChjaGlsZFN1Ymxpc3QpIHtcbiAgICAgICAgICAgICAgICBpZiAodGhpcy5pc0FjdGl2ZShrZXkpICYmIERvbUhhbmRsZXIuaGFzQ2xhc3MoY2hpbGRTdWJsaXN0LCAncC1zdWJtZW51LWxpc3QtYWN0aXZlJykpIHtcbiAgICAgICAgICAgICAgICAgICAgdGhpcy5jb250ZXh0TWVudS5yZW1vdmVBY3RpdmVGcm9tU3ViTGlzdHMobWVudWl0ZW0pO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgRG9tSGFuZGxlci5hZGRDbGFzcyhjaGlsZFN1Ymxpc3QsICdwLXN1Ym1lbnUtbGlzdC1hY3RpdmUnKTtcbiAgICAgICAgICAgICAgICB9XG5cbiAgICAgICAgICAgICAgICB0aGlzLmNvbnRleHRNZW51LmNvbnRleHRNZW51U2VydmljZS5jaGFuZ2VLZXkoa2V5KTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuXG4gICAgICAgIGlmICghaXRlbS5pdGVtcykge1xuICAgICAgICAgICAgdGhpcy5vbkxlYWZDbGljaygpO1xuICAgICAgICB9XG4gICAgfVxuXG4gICAgb25MZWFmQ2xpY2soKSB7XG4gICAgICAgIGlmICh0aGlzLnJvb3QpIHtcbiAgICAgICAgICAgIHRoaXMuY29udGV4dE1lbnUuaGlkZSgpO1xuICAgICAgICB9XG5cbiAgICAgICAgdGhpcy5sZWFmQ2xpY2suZW1pdCgpO1xuICAgIH1cblxuICAgIGdldEtleShpbmRleCkge1xuICAgICAgICByZXR1cm4gdGhpcy5yb290ID8gU3RyaW5nKGluZGV4KSA6IHRoaXMucGFyZW50SXRlbUtleSArICdfJyArIGluZGV4O1xuICAgIH1cblxuICAgIGlzQWN0aXZlKGtleSkge1xuICAgICAgICByZXR1cm4gKHRoaXMuYWN0aXZlSXRlbUtleSAmJih0aGlzLmFjdGl2ZUl0ZW1LZXkuc3RhcnRzV2l0aChrZXkgKyAnXycpIHx8IHRoaXMuYWN0aXZlSXRlbUtleSA9PT0ga2V5KSk7XG4gICAgfVxufVxuXG5AQ29tcG9uZW50KHtcbiAgICBzZWxlY3RvcjogJ3AtY29udGV4dE1lbnUnLFxuICAgIHRlbXBsYXRlOiBgXG4gICAgICAgIDxkaXYgI2NvbnRhaW5lciBbbmdDbGFzc109XCIncC1jb250ZXh0bWVudSBwLWNvbXBvbmVudCdcIiBbY2xhc3NdPVwic3R5bGVDbGFzc1wiIFt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VxuICAgICAgICBlbHNlIGlmICh0aGlzLnRhcmdldCkge1xuICAgICAgICAgICAgdGhpcy50cmlnZ2VyRXZlbnRMaXN0ZW5lciA9IHRoaXMucmVuZGVyZXIubGlzdGVuKHRoaXMudGFyZ2V0LCB0aGlzLnRyaWdnZXJFdmVudCwgKGV2ZW50KSA9PiB7XG4gICAgICAgICAgICAgICAgdGhpcy5zaG93KGV2ZW50KTtcbiAgICAgICAgICAgICAgICBldmVudC5wcmV2ZW50RGVmYXVsdCgpO1xuICAgICAgICAgICAgICAgIGV2ZW50LnN0b3BQcm9wYWdhdGlvbigpO1xuICAgICAgICAgICAgfSk7XG4gICAgICAgIH1cblxuICAgICAgICBpZiAodGhpcy5hcHBlbmRUbykge1xuICAgICAgICAgICAgaWYgKHRoaXMuYXBwZW5kVG8gPT09ICdib2R5JylcbiAgICAgICAgICAgICAgICBkb2N1bWVudC5ib2R5LmFwcGVuZENoaWxkKHRoaXMuY29udGFpbmVyVmlld0NoaWxkLm5hdGl2ZUVsZW1lbnQpO1xuICAgICAgICAgICAgZWxzZVxuICAgICAgICAgICAgICAgIERvbUhhbmRsZXIuYXBwZW5kQ2hpbGQodGhpcy5jb250YWluZXJWaWV3Q2hpbGQubmF0aXZlRWxlbWVudCwgdGhpcy5hcHBlbmRUbyk7XG4gICAgICAgIH1cbiAgICB9XG5cbiAgICBzaG93KGV2ZW50PzogTW91c2VFdmVudCkge1xuICAgICAgICB0aGlzLmNsZWFyQWN0aXZlSXRlbSgpO1xuICAgICAgICB0aGlzLnBvc2l0aW9uKGV2ZW50KTtcbiAgICAgICAgdGhpcy5tb3ZlT25Ub3AoKTtcbiAgICAgICAgdGhpcy5jb250YWluZXJWaWV3Q2hpbGQubmF0aXZlRWxlbWVudC5zdHlsZS5kaXNwbGF5ID0gJ2Jsb2NrJztcbiAgICAgICAgRG9tSGFuZGxlci5mYWRlSW4odGhpcy5jb250YWluZXJWaWV3Q2hpbGQubmF0aXZlRWxlbWVudCwgMjUwKTtcb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Wxpc3QtYWN0aXZlJyk7XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICB9XG5cbiAgICBiaW5kR2xvYmFsTGlzdGVuZXJzKCkge1xuICAgICAgICBpZiAoIXRoaXMuZG9jdW1lbnRDbGlja0xpc3RlbmVyKSB7XG4gICAgICAgICAgICBjb25zdCBkb2N1bWVudFRhcmdldDogYW55ID0gdGhpcy5lbCA/IHRoaXMuZWwubmF0aXZlRWxlbWVudC5vd25lckRvY3VtZW50IDogJ2RvY3VtZW50JztcblxuICAgICAgICAgICAgdGhpcy5kb2N1bWVudENsaWNrTGlzdGVuZXIgPSB0aGlzLnJlbmRlcmVyLmxpc3Rlbihkb2N1bWVudFRhcmdldCwgJ2NsaWNrJywgKGV2ZW50KSA9PiB7XG4gICAgICAgICAgICAgICAgaWYgKHRoaXMuY29udGFpbmVyVmlld0NoaWxkLm5hdGl2ZUVsZW1lbnQub2Zmc2V0UGFyZW50ICYmIHRoaXMuaXNPdXRzaWRlQ2xpY2tlZChldmVudCkgJiYgIWV2ZW50LmN0cmxLZXkgJiYgZXZlbnQuYnV0dG9uICE9PSAyKSB7XG4gICAgICAgICAgICAgICAgICAgIHRoaXMuaGlkZSgpO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH0pO1xuICAgICAgICB9XG5cbiAgICAgICAgdGhpcy56b25lLnJ1bk91dHNpZGVBbmd1bGFyKCgpID0+IHtcbiAgICAgICAgICAgIGlmICghdGhpcy53aW5kb3dSZXNpemVMaXN0ZW5lcikge1xuICAgICAgICAgICAgdGhpcy53aW5kb3dSZXNpemVMaXN0ZW5lciA9IHRoaXMub25XaW5kb3dSZXNpemUuYmluZCh0aGlzKTtcbiAgICAgICAgICAgICAgICB3aW5kb3cuYWRkRXZlbnRMaXN0ZW5lcigncmVzaXplJywgdGhpcy53aW5kb3dSZXNpemVMaXN0ZW5lcik7XG4gICAgICAgICAgICB9XG4gICAgICAgIH0pO1xuXG4gICAgICAgIGlmICghdGhpcy5kb2N1bWVudEtleWRvd25MaXN0ZW5lcikge1xuICAgICAgICAgICAgY29uc3QgZG9jdW1lbnRUYXJnZXQ6IGFueSA9IHRoaXMuZWwgPyB0aGlzLmVsLm5hdGl2ZUVsZW1lbnQub3duZXJEb2N1bWVudCA6ICdkb2N1bWVudCc7XG5cbiAgICAgICAgICAgIHRoaXMuZG9jdW1lbnRLZXlkb3duTGlzdGVuZXIgPSB0aGlzLnJlbmRlcmVyLmxpc3Rlbihkb2N1bWVudFRhcmdldCwgJ2tleWRvd24nLCAoZXZlbnQpID0+IHtcbiAgICAgICAgICAgICAgICBsZXQgYWN0aXZlSXRlbSA9IHRoaXMuZ2V0QWN0aXZlSXRlbSgpO1xuXG4gICAgICAgICAgICAgICAgc3dpdGNoIChldmVudC5rZXkpIHtcbiAgICAgICAgICAgICAgICAgICAgY2FzZSAnQXJyb3dEb3duJzpcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmIChhY3RpdmVJdGVtKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdGhpcy5yZW1vdmVBY3RpdmVGcm9tU3VibGlzdChhY3RpdmVJdGVtKTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBhY3RpdmVJdGVtID0gdGhpcy5maW5kTmV4dEl0ZW0oYWN0aXZlSXRlbSk7XG4gICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBsZXQgZmlyc3RJdGVtID0gRG9tSGFuZGxlci5maW5kU2luZ2xlKHRoaXMuY29udGFpbmVyVmlld0NoaWxkLm5hdGl2ZUVsZW1lbnQsICcucC1tZW51aXRlbS1saW5rJykucGFyZW50RWxlbWVudDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBhY3RpdmVJdGVtID0gdGhpcy5pc0l0ZW1NYXRjaGVkKGZpcnN0SXRlbSkgPyBmaXJzdEl0ZW0gOiB0aGlzLmZpbmROZXh0SXRlbShmaXJzdEl0ZW0pO1xuICAgICAgICAgICAgICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAoYWN0aXZlSXRlbSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRoaXMuY29udGV4dE1lbnVTZXJ2aWNlLmNoYW5nZUtleShhY3RpdmVJdGVtLmdldEF0dHJpYnV0ZSgnZGF0YS1paycpKTtcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgICAgICAgICAgICAgZXZlbnQucHJldmVudERlZmF1bHQoKTtcbiAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrO1xuXG4gICAgICAgICAgICAgICAgICAgIGNhc2UgJ0Fycm93VXAnOlxuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGFjdGl2ZUl0ZW0pIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB0aGlzLnJlbW92ZUFjdGl2ZUZyb21TdWJsaXN0KGFjdGl2ZUl0ZW0pO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGFjdGl2ZUl0ZW0gPSB0aGlzLmZpbmRQcmV2SXRlbShhY3RpdmVJdGVtKTtcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgIGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxldCBzdWJsaXN0ID0gRG9tSGFuZGxlci5maW5kU2luZ2xlKHRoaXMuY29udGFpbmVyVmlld0NoaWxkLm5hdGl2ZUVsZW1lbnQsICd1bCcpO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxldCBsYXN0SXRlbSA9IHN1Ymxpc3QuY2hpbGRyZW5bc3VibGlzdC5jaGlsZHJlbi5sZW5ndGggLSAxXTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBhY3RpdmVJdGVtID0gdGhpcy5pc0l0ZW1NYXRjaGVkKGxhc3RJdGVtKSA/IGxhc3RJdGVtIDogdGhpcy5maW5kUHJldkl0ZW0obGFzdEl0ZW0pO1xuICAgICAgICAgICAgICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAoYWN0aXZlSXRlbSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRoaXMuY29udGV4dE1lbnVTZXJ2aWNlLmNoYW5nZUtleShhY3RpdmVJdGVtLmdldEF0dHJpYnV0ZSgnZGF0YS1paycpKTtcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgICAgICAgICAgICAgZXZlbnQucHJldmVudERlZmF1bHQoKTtcbiAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrO1xuXG4gICAgICAgICAgICAgICAgICAgIGNhc2UgJ0Fycm93UmlnaHQnOlxuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGFjdGl2ZUl0ZW0pIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBsZXQgc3VibGlzdCA9IERvbUhhbmRsZXIuZmluZFNpbmdsZShhY3RpdmVJdGVtLCAnLnAtc3VibWVudS1saXN0Jyk7XG5cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoc3VibGlzdCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBEb21IYW5kbGVyLmFkZENsYXNzKHN1Ymxpc3QsICdwLXN1Ym1lbnUtbGlzdC1hY3RpdmUnKTtcblxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBhY3RpdmVJdGVtID0gRG9tSGFuZGxlci5maW5kU2luZ2xlKHN1Ymxpc3QsICcucC1tZW51aXRlbS1saW5rOm5vdCgucC1kaXNhYmxlZCknKS5wYXJlbnRFbGVtZW50O1xuXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChhY3RpdmVJdGVtKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0aGlzLmNvbnRleHRNZW51U2VydmljZS5jaGFuZ2VLZXkoYWN0aXZlSXRlbS5nZXRBdHRyaWJ1dGUoJ2RhdGEtaWsnKSk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICB9XG5cbiAgICAgICAgICAgICAgICAgICAgICAgIGV2ZW50LnByZXZlbnREZWZhdWx0KCk7XG4gICAgICAgICAgICAgICAgICAgICAgICBicmVhaztcblxuICAgICAgICAgICAgICAgICAgICBjYXNlICdBcnJvd0xlZnQnOlxuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGFjdGl2ZUl0ZW0pIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBsZXQgc3VibGlzdCA9IGFjdGl2ZUl0ZW0ucGFyZW50RWxlbWVudDtcblxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChzdWJsaXN0ICYmIERvbUhhbmRsZXIuaGFzQ2xhc3Moc3VibGlzdCwgJ3Atc3VibWVudS1saXN0LWFjdGl2ZScpKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIERvbUhhbmRsZXIucmVtb3ZlQ2xhc3Moc3VibGlzdCwgJ3Atc3VibWVudS1saXN0LWFjdGl2ZScpO1xuXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGFjdGl2ZUl0ZW0gPSBzdWJsaXN0LnBhcmVudEVsZW1lbnQucGFyZW50RWxlbWVudDtcblxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoYWN0aXZlSXRlbSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdGhpcy5jb250ZXh0TWVudVNlcnZpY2UuY2hhbmdlS2V5KGFjdGl2ZUl0ZW0uZ2V0QXR0cmlidXRlKCdkYXRhLWlrJykpO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAgICAgICAgICAgICBldmVudC5wcmV2ZW50RGVmYXVsdCgpO1xuICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7XG5cbiAgICAgICAgICAgICAgICAgICAgY2FzZSAnRXNjYXBlJzpcbiAgICAgICAgICAgICAgICAgICAgICAgIHRoaXMuaGlkZSgpO1xuICAgICAgICAgICAgICAgICAgICAgICAgZXZlbnQucHJldmVudERlZmF1bHQoKTtcblxuICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7XG5cbiAgICAgICAgICAgICAgICAgICAgY2FzZSAnRW50ZXInOlxuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGFjdGl2ZUl0ZW0pIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB0aGlzLmhhbmRsZUl0ZW1DbGljayhldmVudCwgdGhpcy5maW5kTW9kZWxJdGVtRnJvbUtleSh0aGlzLmNvbnRleHRNZW51U2VydmljZS5hY3RpdmVJdGVtS2V5KSwgYWN0aXZlSXRlbSk7XG4gICAgICAgICAgICAgICAgICAgICAgICB9XG5cbiAgICAgICAgICAgICAgICAgICAgICAgIGV2ZW50LnByZXZlbnREZWZhdWx0KCk7XG4gICAgICAgICAgICAgICAgICAgICAgICBicmVhaztcblxuICAgICAgICAgICAgICAgICAgICBkZWZhdWx0OlxuICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfSk7XG4gICAgICAgIH1cbiAgICB9XG5cbiAgICBmaW5kTW9kZWxJdGVtRnJvbUtleShrZXkpIHtcbiAgICAgICAgaWYgKGtleSA9PSBudWxsIHx8ICF0aGlzLm1vZGVsKSB7XG4gICAgICAgICAgICByZXR1cm4gbnVsbDtcbiAgICAgICAgfVxuXG4gICAgICAgIGxldCBpbmRleGVzID0ga2V5LnNwbGl0KCdfJyk7XG4gICAgICAgIHJldHVybiBpbmRleGVzLnJlZHVjZSgoaXRlbSwgY3VycmVudEluZGV4KSA9PiB7XG4gICAgICAgICAgICByZXR1cm4gaXRlbSA/IGl0ZW0uaXRlbXNbY3VycmVudEluZGV4XSA6IHRoaXMubW9kZWxbY3VycmVudEluZGV4XTtcbiAgICAgICAgfSwgbnVsbCk7XG4gICAgfVxuXG4gICAgaGFuZGxlSXRlbUNsaWNrKGV2ZW50LCBpdGVtLCBtZW51aXRlbSkge1xuICAgICAgICBpZiAoIWl0ZW0gfHwgaXRlbS5kaXNhYmxlZCkge1xuICAgICAgICAgICAgcmV0dXJuO1xuICAgICAgICB9XG5cbiAgICAgICAgaWYgKGl0ZW0uY29tbWFuZCkge1xuICAgICAgICAgICAgaXRlbS5jb21tYW5kKHtcbiAgICAgICAgICAgICAgICBvcmlnaW5hbEV2ZW50OiBldmVudCxcbiAgICAgICAgICAgICAgICBpdGVtOiBpdGVtXG4gICAgICAgICAgICB9KTtcbiAgICAgICAgfVxuXG4gICAgICAgIGlmIChpdGVtLml0ZW1zKSB7XG4gICAgICAgICAgICBsZXQgY2hpbGRTdWJsaXN0ID0gRG9tSGFuZGxlci5maW5kU2luZ2xlKG1lbnVpdGVtLCAnLnAtc3VibWVudS1saXN0Jyk7XG5cbiAgICAgICAgICAgIGlmIChjaGlsZFN1Ymxpc3QpIHtcbiAgICAgICAgICAgICAgICBpZiAoRG9tSGFuZGxlci5oYXNDbGFzcyhjaGlsZFN1Ymxpc3QsICdwLXN1Ym1lbnUtbGlzdC1hY3RpdmUnKSkge1xuICAgICAgICAgICAgICAgICAgICB0aGlzLnJlbW92ZUFjdGl2ZUZyb21TdWJMaXN0cyhtZW51aXRlbSk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICBEb21IYW5kbGVyLmFkZENsYXNzKGNoaWxkU3VibGlzdCwgJ3Atc3VibWVudS1saXN0LWFjdGl2ZScpO1xuICAgICAgICAgICAgICAgICAgICB0aGlzLnBvc2l0aW9uU3VibWVudShjaGlsZFN1Ymxpc3QpO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuXG4gICAgICAgIGlmICghaXRlbS5pdGVtcykge1xuICAgICAgICAgICAgdGhpcy5oaWRlKCk7XG4gICAgICAgIH1cbiAgICB9XG5cbiAgICB1bmJpbmRHbG9iYWxMaXN0ZW5lcnMoKSB7XG4gICAgICAgIGlmICh0aGlzLmRvY3VtZW50Q2xpY2tMaXN0ZW5lcikge1xuICAgICAgICAgICAgdGhpcy5kb2N1bWVudENsaWNrTGlzdGVuZXIoKTtcbiAgICAgICAgICAgIHRoaXMuZG9jdW1lbnRDbGlja0xpc3RlbmVyID0gbnVsbDtcbiAgICAgICAgfVxuXG4gICAgICAgIGlmICh0aGlzLndpbmRvd1Jlc2l6ZUxpc3RlbmVyKSB7XG4gICAgICAgICAgICB3aW5kb3cucmVtb3ZlRXZlbnRMaXN0ZW5lcigncmVzaXplJywgdGhpcy53aW5kb3dSZXNpemVMaXN0ZW5lcik7XG4gICAgICAgICAgICB0aGlzLndpbmRvd1Jlc2l6ZUxpc3RlbmVyID0gbnVsbDtcbiAgICAgICAgfVxuXG4gICAgICAgIGlmICh0aGlzLmRvY3VtZW50S2V5ZG93bkxpc3RlbmVyKSB7XG4gICAgICAgICAgICB0aGlzLmRvY3VtZW50S2V5ZG93bkxpc3RlbmVyKCk7XG4gICAgICAgICAgICB0aGlzLmRvY3VtZW50S2V5ZG93bkxpc3RlbmVyID0gbnVsbDtcbiAgICAgICAgfVxuICAgIH1cblxuICAgIG9uV2luZG93UmVzaXplKGV2ZW50KSB7XG4gICAgICAgIGlmICh0aGlzLmNvbnRhaW5lclZpZXdDaGlsZC5uYXRpdmVFbGVtZW50Lm9mZnNldFBhcmVudCkge1xuICAgICAgICAgICAgdGhpcy5oaWRlKCk7XG4gICAgICAgIH1cbiAgICB9XG5cbiAgICBpc091dHNpZGVDbGlja2VkKGV2ZW50OiBFdmVudCkge1xuICAgICAgIC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BbQ29udGV4dE1lbnUsQ29udGV4dE1lbnVTdWJdLFxuICAgIHByb3ZpZGVyczogW0NvbnRleHRNZW51U2VydmljZV1cbn0pXG5leHBvcnQgY2xhc3MgQ29udGV4dE1lbnVNb2R1bGUgeyB9XG4iXX0=
Note: See TracBrowser for help on using the repository browser.