import { CommonModule, DOCUMENT, isPlatformBrowser } from '@angular/common';
import { ChangeDetectionStrategy, Component, ContentChildren, EventEmitter, Inject, Input, NgModule, Output, PLATFORM_ID, ViewChild, ViewEncapsulation, numberAttribute } from '@angular/core';
import { PrimeTemplate, SharedModule } from 'primeng/api';
import { DomHandler } from 'primeng/dom';
import * as i0 from "@angular/core";
import * as i1 from "@angular/common";
/**
* Splitter is utilized to separate and resize panels.
* @group Components
*/
export class Splitter {
document;
platformId;
renderer;
cd;
el;
/**
* Style class of the component.
* @group Props
*/
styleClass;
/**
* Style class of the panel.
* @group Props
*/
panelStyleClass;
/**
* Inline style of the component.
* @group Props
*/
style;
/**
* Inline style of the panel.
* @group Props
*/
panelStyle;
/**
* Defines where a stateful splitter keeps its state, valid values are 'session' for sessionStorage and 'local' for localStorage.
* @group Props
*/
stateStorage = 'session';
/**
* Storage identifier of a stateful Splitter.
* @group Props
*/
stateKey = null;
/**
* Orientation of the panels. Valid values are 'horizontal' and 'vertical'.
* @group Props
*/
layout = 'horizontal';
/**
* Size of the divider in pixels.
* @group Props
*/
gutterSize = 4;
/**
* Step factor to increment/decrement the size of the panels while pressing the arrow keys.
* @group Props
*/
step = 5;
/**
* Minimum size of the elements relative to 100%.
* @group Props
*/
minSizes = [];
/**
* Size of the elements relative to 100%.
* @group Props
*/
get panelSizes() {
return this._panelSizes;
}
set panelSizes(val) {
this._panelSizes = val;
if (this.el && this.el.nativeElement && this.panels.length > 0) {
let children = [...this.el.nativeElement.children[0].children].filter((child) => DomHandler.hasClass(child, 'p-splitter-panel'));
let _panelSizes = [];
this.panels.map((panel, i) => {
let panelInitialSize = this.panelSizes.length - 1 >= i ? this.panelSizes[i] : null;
let panelSize = panelInitialSize || 100 / this.panels.length;
_panelSizes[i] = panelSize;
children[i].style.flexBasis = 'calc(' + panelSize + '% - ' + (this.panels.length - 1) * this.gutterSize + 'px)';
});
}
}
/**
* Callback to invoke when resize ends.
* @param {SplitterResizeEndEvent} event - Custom panel resize end event
* @group Emits
*/
onResizeEnd = new EventEmitter();
/**
* Callback to invoke when resize starts.
* @param {SplitterResizeStartEvent} event - Custom panel resize start event
* @group Emits
*/
onResizeStart = new EventEmitter();
templates;
containerViewChild;
nested = false;
panels = [];
dragging = false;
mouseMoveListener;
mouseUpListener;
touchMoveListener;
touchEndListener;
size;
gutterElement;
startPos;
prevPanelElement;
nextPanelElement;
nextPanelSize;
prevPanelSize;
_panelSizes = [];
prevPanelIndex;
timer;
prevSize;
window;
constructor(document, platformId, renderer, cd, el) {
this.document = document;
this.platformId = platformId;
this.renderer = renderer;
this.cd = cd;
this.el = el;
this.window = this.document.defaultView;
}
ngOnInit() {
this.nested = this.isNested();
}
ngAfterContentInit() {
this.templates.forEach((item) => {
switch (item.getType()) {
case 'panel':
this.panels.push(item.template);
break;
default:
this.panels.push(item.template);
break;
}
});
}
ngAfterViewInit() {
if (isPlatformBrowser(this.platformId)) {
if (this.panels && this.panels.length) {
let initialized = false;
if (this.isStateful()) {
initialized = this.restoreState();
}
if (!initialized) {
let children = [...this.el.nativeElement.children[0].children].filter((child) => DomHandler.hasClass(child, 'p-splitter-panel'));
let _panelSizes = [];
this.panels.map((panel, i) => {
let panelInitialSize = this.panelSizes.length - 1 >= i ? this.panelSizes[i] : null;
let panelSize = panelInitialSize || 100 / this.panels.length;
_panelSizes[i] = panelSize;
children[i].style.flexBasis = 'calc(' + panelSize + '% - ' + (this.panels.length - 1) * this.gutterSize + 'px)';
});
this._panelSizes = _panelSizes;
this.prevSize = parseFloat(_panelSizes[0]).toFixed(4);
}
}
}
}
resizeStart(event, index, isKeyDown) {
this.gutterElement = event.currentTarget || event.target.parentElement;
this.size = this.horizontal() ? DomHandler.getWidth(this.containerViewChild.nativeElement) : DomHandler.getHeight(this.containerViewChild.nativeElement);
if (!isKeyDown) {
this.dragging = true;
this.startPos = this.horizontal() ? (event instanceof MouseEvent ? event.pageX : event.changedTouches[0].pageX) : event instanceof MouseEvent ? event.pageY : event.changedTouches[0].pageY;
}
this.prevPanelElement = this.gutterElement.previousElementSibling;
this.nextPanelElement = this.gutterElement.nextElementSibling;
if (isKeyDown) {
this.prevPanelSize = this.horizontal() ? DomHandler.getOuterWidth(this.prevPanelElement, true) : DomHandler.getOuterHeight(this.prevPanelElement, true);
this.nextPanelSize = this.horizontal() ? DomHandler.getOuterWidth(this.nextPanelElement, true) : DomHandler.getOuterHeight(this.nextPanelElement, true);
}
else {
this.prevPanelSize = (100 * (this.horizontal() ? DomHandler.getOuterWidth(this.prevPanelElement, true) : DomHandler.getOuterHeight(this.prevPanelElement, true))) / this.size;
this.nextPanelSize = (100 * (this.horizontal() ? DomHandler.getOuterWidth(this.nextPanelElement, true) : DomHandler.getOuterHeight(this.nextPanelElement, true))) / this.size;
}
this.prevPanelIndex = index;
DomHandler.addClass(this.gutterElement, 'p-splitter-gutter-resizing');
this.gutterElement.setAttribute('data-p-gutter-resizing', 'true');
DomHandler.addClass(this.containerViewChild.nativeElement, 'p-splitter-resizing');
this.containerViewChild.nativeElement.setAttribute('data-p-resizing', 'true');
this.onResizeStart.emit({ originalEvent: event, sizes: this._panelSizes });
}
onResize(event, step, isKeyDown) {
let newPos, newPrevPanelSize, newNextPanelSize;
if (isKeyDown) {
if (this.horizontal()) {
newPrevPanelSize = (100 * (this.prevPanelSize + step)) / this.size;
newNextPanelSize = (100 * (this.nextPanelSize - step)) / this.size;
}
else {
newPrevPanelSize = (100 * (this.prevPanelSize - step)) / this.size;
newNextPanelSize = (100 * (this.nextPanelSize + step)) / this.size;
}
}
else {
if (this.horizontal())
newPos = (event.pageX * 100) / this.size - (this.startPos * 100) / this.size;
else
newPos = (event.pageY * 100) / this.size - (this.startPos * 100) / this.size;
newPrevPanelSize = this.prevPanelSize + newPos;
newNextPanelSize = this.nextPanelSize - newPos;
}
this.prevSize = parseFloat(newPrevPanelSize).toFixed(4);
if (this.validateResize(newPrevPanelSize, newNextPanelSize)) {
this.prevPanelElement.style.flexBasis = 'calc(' + newPrevPanelSize + '% - ' + (this.panels.length - 1) * this.gutterSize + 'px)';
this.nextPanelElement.style.flexBasis = 'calc(' + newNextPanelSize + '% - ' + (this.panels.length - 1) * this.gutterSize + 'px)';
this._panelSizes[this.prevPanelIndex] = newPrevPanelSize;
this._panelSizes[this.prevPanelIndex + 1] = newNextPanelSize;
}
}
resizeEnd(event) {
if (this.isStateful()) {
this.saveState();
}
this.onResizeEnd.emit({ originalEvent: event, sizes: this._panelSizes });
DomHandler.removeClass(this.gutterElement, 'p-splitter-gutter-resizing');
DomHandler.removeClass(this.containerViewChild.nativeElement, 'p-splitter-resizing');
this.clear();
}
onGutterMouseDown(event, index) {
this.resizeStart(event, index);
this.bindMouseListeners();
}
onGutterTouchStart(event, index) {
if (event.cancelable) {
this.resizeStart(event, index);
this.bindTouchListeners();
event.preventDefault();
}
}
onGutterTouchMove(event) {
this.onResize(event);
event.preventDefault();
}
onGutterTouchEnd(event) {
this.resizeEnd(event);
this.unbindTouchListeners();
if (event.cancelable)
event.preventDefault();
}
repeat(event, index, step) {
this.resizeStart(event, index, true);
this.onResize(event, step, true);
}
setTimer(event, index, step) {
this.clearTimer();
this.timer = setTimeout(() => {
this.repeat(event, index, step);
}, 40);
}
clearTimer() {
if (this.timer) {
clearTimeout(this.timer);
}
}
onGutterKeyUp(event) {
this.clearTimer();
this.resizeEnd(event);
}
onGutterKeyDown(event, index) {
switch (event.code) {
case 'ArrowLeft': {
if (this.layout === 'horizontal') {
this.setTimer(event, index, this.step * -1);
}
event.preventDefault();
break;
}
case 'ArrowRight': {
if (this.layout === 'horizontal') {
this.setTimer(event, index, this.step);
}
event.preventDefault();
break;
}
case 'ArrowDown': {
if (this.layout === 'vertical') {
this.setTimer(event, index, this.step * -1);
}
event.preventDefault();
break;
}
case 'ArrowUp': {
if (this.layout === 'vertical') {
this.setTimer(event, index, this.step);
}
event.preventDefault();
break;
}
default:
//no op
break;
}
}
validateResize(newPrevPanelSize, newNextPanelSize) {
if (this.minSizes.length >= 1 && this.minSizes[0] && this.minSizes[0] > newPrevPanelSize) {
return false;
}
if (this.minSizes.length > 1 && this.minSizes[1] && this.minSizes[1] > newNextPanelSize) {
return false;
}
return true;
}
bindMouseListeners() {
if (!this.mouseMoveListener) {
this.mouseMoveListener = this.renderer.listen(this.document, 'mousemove', (event) => {
this.onResize(event);
});
}
if (!this.mouseUpListener) {
this.mouseUpListener = this.renderer.listen(this.document, 'mouseup', (event) => {
this.resizeEnd(event);
this.unbindMouseListeners();
});
}
}
bindTouchListeners() {
if (!this.touchMoveListener) {
this.touchMoveListener = this.renderer.listen(this.document, 'touchmove', (event) => {
this.onResize(event.changedTouches[0]);
});
}
if (!this.touchEndListener) {
this.touchEndListener = this.renderer.listen(this.document, 'touchend', (event) => {
this.resizeEnd(event);
this.unbindTouchListeners();
});
}
}
unbindMouseListeners() {
if (this.mouseMoveListener) {
this.mouseMoveListener();
this.mouseMoveListener = null;
}
if (this.mouseUpListener) {
this.mouseUpListener();
this.mouseUpListener = null;
}
}
unbindTouchListeners() {
if (this.touchMoveListener) {
this.touchMoveListener();
this.touchMoveListener = null;
}
if (this.touchEndListener) {
this.touchEndListener();
this.touchEndListener = null;
}
}
clear() {
this.dragging = false;
this.size = null;
this.startPos = null;
this.prevPanelElement = null;
this.nextPanelElement = null;
this.prevPanelSize = null;
this.nextPanelSize = null;
this.gutterElement = null;
this.prevPanelIndex = null;
}
isNested() {
if (this.el.nativeElement) {
let parent = this.el.nativeElement.parentElement;
while (parent && !DomHandler.hasClass(parent, 'p-splitter')) {
parent = parent.parentElement;
}
return parent !== null;
}
else {
return false;
}
}
isStateful() {
return this.stateKey != null;
}
getStorage() {
if (isPlatformBrowser(this.platformId)) {
switch (this.stateStorage) {
case 'local':
return this.window.localStorage;
case 'session':
return this.window.sessionStorage;
default:
throw new Error(this.stateStorage + ' is not a valid value for the state storage, supported values are "local" and "session".');
}
}
else {
throw new Error('Storage is not a available by default on the server.');
}
}
saveState() {
this.getStorage().setItem(this.stateKey, JSON.stringify(this._panelSizes));
}
restoreState() {
const storage = this.getStorage();
const stateString = storage.getItem(this.stateKey);
if (stateString) {
this._panelSizes = JSON.parse(stateString);
let children = [...this.containerViewChild.nativeElement.children].filter((child) => DomHandler.hasClass(child, 'p-splitter-panel'));
children.forEach((child, i) => {
child.style.flexBasis = 'calc(' + this._panelSizes[i] + '% - ' + (this.panels.length - 1) * this.gutterSize + 'px)';
});
return true;
}
return false;
}
containerClass() {
return {
'p-splitter p-component': true,
'p-splitter-horizontal': this.layout === 'horizontal',
'p-splitter-vertical': this.layout === 'vertical'
};
}
panelContainerClass() {
return {
'p-splitter-panel': true,
'p-splitter-panel-nested': true
};
}
gutterStyle() {
if (this.horizontal())
return { width: this.gutterSize + 'px' };
else
return { height: this.gutterSize + 'px' };
}
horizontal() {
return this.layout === 'horizontal';
}
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.7", ngImport: i0, type: Splitter, deps: [{ token: DOCUMENT }, { token: PLATFORM_ID }, { token: i0.Renderer2 }, { token: i0.ChangeDetectorRef }, { token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Component });
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "16.1.0", version: "17.3.7", type: Splitter, selector: "p-splitter", inputs: { styleClass: "styleClass", panelStyleClass: "panelStyleClass", style: "style", panelStyle: "panelStyle", stateStorage: "stateStorage", stateKey: "stateKey", layout: "layout", gutterSize: ["gutterSize", "gutterSize", numberAttribute], step: ["step", "step", numberAttribute], minSizes: ["minSizes", "minSizes", numberAttribute], panelSizes: "panelSizes" }, outputs: { onResizeEnd: "onResizeEnd", onResizeStart: "onResizeStart" }, host: { properties: { "class.p-splitter-panel-nested": "nested" }, classAttribute: "p-element" }, queries: [{ propertyName: "templates", predicate: PrimeTemplate }], viewQueries: [{ propertyName: "containerViewChild", first: true, predicate: ["container"], descendants: true }], ngImport: i0, template: `
`, isInline: true, styles: ["@layer primeng{.p-splitter{display:flex;flex-wrap:nowrap}.p-splitter-vertical{flex-direction:column}.p-splitter-panel{flex-grow:1}.p-splitter-panel-nested{display:flex;min-width:0}.p-splitter-panel p-splitter{flex-grow:1}.p-splitter-panel .p-splitter{flex-grow:1;border:0 none}.p-splitter-gutter{flex-grow:0;flex-shrink:0;display:flex;align-items:center;justify-content:center;cursor:col-resize}.p-splitter-horizontal.p-splitter-resizing{cursor:col-resize;-webkit-user-select:none;user-select:none}.p-splitter-horizontal>.p-splitter-gutter>.p-splitter-gutter-handle{height:24px;width:100%}.p-splitter-horizontal>.p-splitter-gutter{cursor:col-resize}.p-splitter-vertical.p-splitter-resizing{cursor:row-resize;-webkit-user-select:none;user-select:none}.p-splitter-vertical>.p-splitter-gutter{cursor:row-resize}.p-splitter-vertical>.p-splitter-gutter>.p-splitter-gutter-handle{width:24px;height:100%}}\n"], dependencies: [{ kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "directive", type: i1.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.7", ngImport: i0, type: Splitter, decorators: [{
type: Component,
args: [{ selector: 'p-splitter', template: `
`, encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, host: {
class: 'p-element',
'[class.p-splitter-panel-nested]': 'nested'
}, styles: ["@layer primeng{.p-splitter{display:flex;flex-wrap:nowrap}.p-splitter-vertical{flex-direction:column}.p-splitter-panel{flex-grow:1}.p-splitter-panel-nested{display:flex;min-width:0}.p-splitter-panel p-splitter{flex-grow:1}.p-splitter-panel .p-splitter{flex-grow:1;border:0 none}.p-splitter-gutter{flex-grow:0;flex-shrink:0;display:flex;align-items:center;justify-content:center;cursor:col-resize}.p-splitter-horizontal.p-splitter-resizing{cursor:col-resize;-webkit-user-select:none;user-select:none}.p-splitter-horizontal>.p-splitter-gutter>.p-splitter-gutter-handle{height:24px;width:100%}.p-splitter-horizontal>.p-splitter-gutter{cursor:col-resize}.p-splitter-vertical.p-splitter-resizing{cursor:row-resize;-webkit-user-select:none;user-select:none}.p-splitter-vertical>.p-splitter-gutter{cursor:row-resize}.p-splitter-vertical>.p-splitter-gutter>.p-splitter-gutter-handle{width:24px;height:100%}}\n"] }]
}], ctorParameters: () => [{ type: Document, decorators: [{
type: Inject,
args: [DOCUMENT]
}] }, { type: undefined, decorators: [{
type: Inject,
args: [PLATFORM_ID]
}] }, { type: i0.Renderer2 }, { type: i0.ChangeDetectorRef }, { type: i0.ElementRef }], propDecorators: { styleClass: [{
type: Input
}], panelStyleClass: [{
type: Input
}], style: [{
type: Input
}], panelStyle: [{
type: Input
}], stateStorage: [{
type: Input
}], stateKey: [{
type: Input
}], layout: [{
type: Input
}], gutterSize: [{
type: Input,
args: [{ transform: numberAttribute }]
}], step: [{
type: Input,
args: [{ transform: numberAttribute }]
}], minSizes: [{
type: Input,
args: [{ transform: numberAttribute }]
}], panelSizes: [{
type: Input
}], onResizeEnd: [{
type: Output
}], onResizeStart: [{
type: Output
}], templates: [{
type: ContentChildren,
args: [PrimeTemplate]
}], containerViewChild: [{
type: ViewChild,
args: ['container', { static: false }]
}] } });
export class SplitterModule {
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.7", ngImport: i0, type: SplitterModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "17.3.7", ngImport: i0, type: SplitterModule, declarations: [Splitter], imports: [CommonModule], exports: [Splitter, SharedModule] });
static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "17.3.7", ngImport: i0, type: SplitterModule, imports: [CommonModule, SharedModule] });
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.7", ngImport: i0, type: SplitterModule, decorators: [{
type: NgModule,
args: [{
imports: [CommonModule],
exports: [Splitter, SharedModule],
declarations: [Splitter]
}]
}] });
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic3BsaXR0ZXIuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi9zcmMvYXBwL2NvbXBvbmVudHMvc3BsaXR0ZXIvc3BsaXR0ZXIudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsT0FBTyxFQUFFLFlBQVksRUFBRSxRQUFRLEVBQUUsaUJBQWlCLEVBQUUsTUFBTSxpQkFBaUIsQ0FBQztBQUM1RSxPQUFPLEVBQUUsdUJBQXVCLEVBQXFCLFNBQVMsRUFBRSxlQUFlLEVBQWMsWUFBWSxFQUFFLE1BQU0sRUFBRSxLQUFLLEVBQUUsUUFBUSxFQUFFLE1BQU0sRUFBRSxXQUFXLEVBQXdCLFNBQVMsRUFBRSxpQkFBaUIsRUFBRSxlQUFlLEVBQUUsTUFBTSxlQUFlLENBQUM7QUFDcFAsT0FBTyxFQUFFLGFBQWEsRUFBRSxZQUFZLEVBQUUsTUFBTSxhQUFhLENBQUM7QUFDMUQsT0FBTyxFQUFFLFVBQVUsRUFBRSxNQUFNLGFBQWEsQ0FBQzs7O0FBR3pDOzs7R0FHRztBQTJDSCxNQUFNLE9BQU8sUUFBUTtJQWdJcUI7SUFBaUQ7SUFBeUI7SUFBNEI7SUFBK0I7SUEvSDNLOzs7T0FHRztJQUNNLFVBQVUsQ0FBcUI7SUFDeEM7OztPQUdHO0lBQ00sZUFBZSxDQUFxQjtJQUM3Qzs7O09BR0c7SU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ICAgICAgICAgICAgICAgICAobW91c2Vkb3duKT1cIm9uR3V0dGVyTW91c2VEb3duKCRldmVudCwgaSlcIlxuICAgICAgICAgICAgICAgICAgICAodG91Y2hzdGFydCk9XCJvbkd1dHRlclRvdWNoU3RhcnQoJGV2ZW50LCBpKVwiXG4gICAgICAgICAgICAgICAgICAgICh0b3VjaG1vdmUpPVwib25HdXR0ZXJUb3VjaE1vdmUoJGV2ZW50KVwiXG4gICAgICAgICAgICAgICAgICAgICh0b3VjaGVuZCk9XCJvbkd1dHRlclRvdWNoRW5kKCRldmVudCwgaSlcIlxuICAgICAgICAgICAgICAgICAgICBbYXR0ci5kYXRhLXAtZ3V0dGVyLXJlc2l6aW5nXT1cImZhbHNlXCJcbiAgICAgICAgICAgICAgICAgICAgW2F0dHIuZGF0YS1wYy1zZWN0aW9uXT1cIidndXR0ZXInXCJcbiAgICAgICAgICAgICAgICA+XG4gICAgICAgICAgICAgICAgICAgIDxkaXZcbiAgICAgICAgICAgICAgICAgICAgICAgIGNsYXNzPVwicC1zcGxpdHRlci1ndXR0ZXItaGFuZGxlXCJcbiAgICAgICAgICAgICAgICAgICAgICAgIHRhYmluZGV4PVwiMFwiXG4gICAgICAgICAgICAgICAgICAgICAgICBbbmdTdHlsZV09XCJndXR0ZXJTdHlsZSgpXCJcbiAgICAgICAgICAgICAgICAgICAgICAgIFthdHRyLmFyaWEtb3JpZW50YXRpb25dPVwibGF5b3V0XCJcbiAgICAgICAgICAgICAgICAgICAgICAgIFthdHRyLmFyaWEtdmFsdWVub3ddPVwicHJldlNpemVcIlxuICAgICAgICAgICAgICAgICAgICAgICAgW2F0dHIuZGF0YS1wYy1zZWN0aW9uXT1cIidndXR0ZXJoYW5kbGUnXCJcbiAgICAgICAgICAgICAgICAgICAgICAgIChrZXl1cCk9XCJvbkd1dHRlcktleVVwKCRldmVudClcIlxuICAgICAgICAgICAgICAgICAgICAgICAgKGtleWRvd24pPVwib25HdXR0ZXJLZXlEb3duKCRldmVudCwgaSl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HQ6XG4gICAgICAgICAgICAgICAgICAgIHRoaXMucGFuZWxzLnB1c2goaXRlbS50ZW1wbGF0ZSk7XG4gICAgICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgfVxuICAgICAgICB9KTtcbiAgICB9XG5cbiAgICBuZ0FmdGVyVmlld0luaXQoKSB7XG4gICAgICAgIGlmIChpc1BsYXRmb3JtQnJvd3Nlcih0aGlzLnBsYXRmb3JtSWQpKSB7XG4gICAgICAgICAgICBpZiAodGhpcy5wYW5lbHMgJiYgdGhpcy5wYW5lbHMubGVuZ3RoKSB7XG4gICAgICAgICAgICAgICAgbGV0IGluaXRpYWxpemVkID0gZmFsc2U7XG4gICAgICAgICAgICAgICAgaWYgKHRoaXMuaXNTdGF0ZWZ1bCgpKSB7XG4gICAgICAgICAgICAgICAgICAgIGluaXRpYWxpemVkID0gdGhpcy5yZXN0b3JlU3RhdGUoKTtcbiAgICAgICAgICAgICAgICB9XG5cbiAgICAgICAgICAgICAgICBpZiAoIWluaXRpYWxpemVkKSB7XG4gICAgICAgICAgICAgICAgICAgIGxldCBjaGlsZHJlbiA9IFsuLi50aGlzLmVsLm5hdGl2ZUVsZW1lbnQuY2hpbGRyZW5bMF0uY2hpbGRyZW5dLmZpbHRlcigoY2hpbGQpID0+IERvbUhhbmRsZXIuaGFzQ2xhc3MoY2hpbGQsICdwLXNwbGl0dGVyLXBhbmVsJykpO1xuICAgICAgICAgICAgICAgICAgICBsZXQgX3BhbmVsU2l6ZXMgPSBbXTtcblxuICAgICAgICAgICAgICAgICAgICB0aGlzLnBhbmVscy5tYXAoKHBhbmVsLCBpKSA9PiB7XG4gICAgICAgICAgICAgICAgICAgICAgICBsZXQgcGFuZWxJbml0aWFsU2l6ZSA9IHRoaXMucGFuZWxTaXplcy5sZW5ndGggLSAxID49IGkgPyB0aGlzLnBhbmVsU2l6ZXNbaV0gOiBudWxsO1xuICAgICAgICAgICAgICAgICAgICAgICAgbGV0IHBhbmVsU2l6ZSA9IHBhbmVsSW5pdGlhbFNpemUgfHwgMTAwIC8gdGhpcy5wYW5lbHMubGVuZ3RoO1xuICAgICAgICAgICAgICAgICAgICAgICAgX3BhbmVsU2l6ZXNbaV0gPSBwYW5lbFNpemU7XG4gICAgICAgICAgICAgICAgICAgICAgICBjaGlsZHJlbltpXS5zdHlsZS5mbGV4QmFzaXMgPSAnY2FsYygnICsgcGFuZWxTaXplICsgJyUgLSAnICsgKHRoaXMucGFuZWxzLmxlbmd0aCAtIDEpICogKHRoaXMuZ3V0dGVyU2l6ZSBhcyBudW1iZXIpICsgJ3B4KSc7XG4gICAgICAgICAgICAgICAgICAgIH0pO1xuXG4gICAgICAgICAgICAgICAgICAgIHRoaXMuX3BhbmVsU2l6ZXMgPSBfcGFuZWxTaXplcztcblxuICAgICAgICAgICAgICAgICAgICB0aGlzLnByZXZTaXplID0gcGFyc2VGbG9hdChfcGFuZWxTaXplc1swXSkudG9GaXhlZCg0KTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICB9XG5cbiAgICByZXNpemVTdGFydChldmVudDogVG91Y2hFdmVudCB8IE1vdXNlRXZlbnQsIGluZGV4OiBudW1iZXIsIGlzS2V5RG93bj86IGJvb2xlYW4pIHtcbiAgICAgICAgdGhpcy5ndXR0ZXJFbGVtZW50ID0gKGV2ZW50LmN1cnJlbnRUYXJnZXQgYXMgSFRNTEVsZW1lbnQpIHx8IChldmVudC50YXJnZXQgYXMgSFRNTEVsZW1lbnQpLnBhcmVudEVsZW1lbnQ7XG4gICAgICAgIHRoaXMuc2l6ZSA9IHRoaXMuaG9yaXpvbnRhbCgpID8gRG9tSGFuZGxlci5nZXRXaWR0aCgodGhpcy5jb250YWluZXJWaWV3Q2hpbGQgYXMgRWxlbWVudFJlZikubmF0aXZlRWxlbWVudCkgOiBEb21IYW5kbGVyLmdldEhlaWdodCgodGhpcy5jb250YWluZXJWaWV3Q2hpbGQgYXMgRWxlbWVudFJlZikubmF0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luZGV4KSB7XG4gICAgICAgIHN3aXRjaCAoZXZlbnQuY29kZSkge1xuICAgICAgICAgICAgY2FzZSAnQXJyb3dMZWZ0Jzoge1xuICAgICAgICAgICAgICAgIGlmICh0aGlzLmxheW91dCA9PT0gJ2hvcml6b250YWwnKSB7XG4gICAgICAgICAgICAgICAgICAgIHRoaXMuc2V0VGltZXIoZXZlbnQsIGluZGV4LCB0aGlzLnN0ZXAgKiAtMSk7XG4gICAgICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAgICAgZXZlbnQucHJldmVudERlZmF1bHQoKTtcbiAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgY2FzZSAnQXJyb3dSaWdodCc6IHtcbiAgICAgICAgICAgICAgICBpZiAodGhpcy5sYXlvdXQgPT09ICdob3Jpem9udGFsJykge1xuICAgICAgICAgICAgICAgICAgICB0aGlzLnNldFRpbWVyKGV2ZW50LCBpbmRleCwgdGhpcy5zdGVwKTtcbiAgICAgICAgICAgICAgICB9XG5cbiAgICAgICAgICAgICAgICBldmVudC5wcmV2ZW50RGVmYXVsdCgpO1xuICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICBjYXNlICdBcnJvd0Rvd24nOiB7XG4gICAgICAgICAgICAgICAgaWYgKHRoaXMubGF5b3V0ID09PSAndmVydGljYWwnKSB7XG4gICAgICAgICAgICAgICAgICAgIHRoaXMuc2V0VGltZXIoZXZlbnQsIGluZGV4LCB0aGlzLnN0ZXAgKiAtMSk7XG4gICAgICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAgICAgZXZlbnQucHJldmVudERlZmF1bHQoKTtcbiAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgY2FzZSAnQXJyb3dVcCc6IHtcbiAgICAgICAgICAgICAgICBpZiAodGhpcy5sYXlvdXQgPT09ICd2ZXJ0aWNhbCcpIHtcbiAgICAgICAgICAgICAgICAgICAgdGhpcy5zZXRUaW1lcihldmVudCwgaW5kZXgsIHRoaXMuc3RlcCk7XG4gICAgICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAgICAgZXZlbnQucHJldmVudERlZmF1bHQoKTtcbiAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgZGVmYXVsdDpcbiAgICAgICAgICAgICAgICAvL25vIG9wXG4gICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgIH1cbiAgICB9XG5cbiAgICB2YWxpZGF0ZVJlc2l6ZShuZXdQcmV2UGFuZWxTaXplOiBudW1iZXIsIG5ld05leHRQYW5lbFNpemU6IG51bWJlcikge1xuICAgICAgICBpZiAodGhpcy5taW5TaXplcy5sZW5ndGggPj0gMSAmJiB0aGlzLm1pblNpemVzWzBdICYmIHRoaXMubWluU2l6ZXNbMF0gPiBuZXdQcmV2UGFuZWxTaXplKSB7XG4gICAgICAgICAgICByZXR1cm4gZmFsc2U7XG4gICAgICAgIH1cblxuICAgICAgICBpZiAodGhpcy5taW5TaXplcy5sZW5ndGggPiAxICYmIHRoaXMubWluU2l6ZXNbMV0gJiYgdGhpcy5taW5TaXplc1sxXSA+IG5ld05leHRQYW5lbFNpemUpIHtcbiAgICAgICAgICAgIHJldHVybiBmYWxzZTtcbiAgICAgICAgfVxuXG4gICAgICAgIHJldHVybiB0cnVlO1xuICAgIH1cblxuICAgIGJpbmRNb3VzZUxpc3RlbmVycygpIHtcbiAgICAgICAgaWYgKCF0aGlzLm1vdXNlTW92ZUxpc3RlbmVyKSB7XG4gICAgICAgICAgICB0aGlzLm1vdXNlTW92ZUxpc3RlbmVyID0gdGhpcy5yZW5kZXJlci5saXN0ZW4odGhpcy5kb2N1bWVudCwgJ21vdXNlbW92ZScsIChldmVudCkgPT4ge1xuICAgICAgICAgICAgICAgIHRoaXMub25SZXNpemUoZXZlbnQpO1xuICAgICAgICAgICAgfSk7XG4gICAgICAg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tcbiAgICAgICAgICAgIHRoaXMubW91c2VNb3ZlTGlzdGVuZXIoKTtcbiAgICAgICAgICAgIHRoaXMubW91c2VNb3ZlTGlzdGVuZXIgPSBudWxsO1xuICAgICAgICB9XG5cbiAgICAgICAgaWYgKHRoaXMubW91c2VVcExpc3RlbmVyKSB7XG4gICAgICAgICAgICB0aGlzLm1vdXNlVXBMaXN0ZW5lcigpO1xuICAgICAgICAgICAgdGhpcy5tb3VzZVVwTGlzdGVuZXIgPSBudWxsO1xuICAgICAgICB9XG4gICAgfVxuXG4gICAgdW5iaW5kVG91Y2hMaXN0ZW5lcnMoKSB7XG4gICAgICAgIGlmICh0aGlzLnRvdWNoTW92ZUxpc3RlbmVyKSB7XG4gICAgICAgICAgICB0aGlzLnRvdWNoTW92ZUxpc3RlbmVyKCk7XG4gICAgICAgICAgICB0aGlzLnRvdWNoTW92ZUxpc3RlbmVyID0gbnVsbDtcbiAgICAgICAgfVxuXG4gICAgICAgIGlmICh0aGlzLnRvdWNoRW5kTGlzdGVuZXIpIHtcbiAgICAgICAgICAgIHRoaXMudG91Y2hFbmRMaXN0ZW5lcigpO1xuICAgICAgICAgICAgdGhpcy50b3VjaEVuZExpc3RlbmVyID0gbnVsbDtcbiAgICAgICAgfVxuICAgIH1cblxuICAgIGNsZWFyKCkge1xuICAgICAgICB0aGlzLmRyYWdnaW5nID0gZmFsc2U7XG4gICAgICAgIHRoaXMuc2l6ZSA9IG51bGw7XG4gICAgICAgIHRoaXMuc3RhcnRQb3MgPSBudWxsO1xuICAgICAgICB0aGlzLnByZXZQYW5lbEVsZW1lbnQgPSBudWxsO1xuICAgICAgICB0aGlzLm5leHRQYW5lbEVsZW1lbnQgPSBudWxsO1xuICAgICAgICB0aGlzLnByZXZQYW5lbFNpemUgPSBudWxsO1xuICAgICAgICB0aGlzLm5leHRQYW5lbFNpemUgPSBudWxsO1xuICAgICAgICB0aGlzLmd1dHRlckVsZW1lbnQgPSBudWxsO1xuICAgICAgICB0aGlzLnByZXZQYW5lbEluZGV4ID0gbnVsbDtcbiAgICB9XG5cbiAgICBpc05lc3RlZCgpIHtcbiAgICAgICAgaWYgKHRoaXMuZWwubmF0aXZlRWxlbWVudCkge1xuICAgICAgICAgICAgbGV0IHBhcmVudCA9IHRoaXMuZWwubmF0aXZlRWxlbWVudC5wYXJlbnRFbGVtZW50O1xuICAgICAgICAgICAgd2hpbGUgKHBhcmVudCAmJiAhRG9tSGFuZGxlci5oYXNDbGFzcyhwYXJlbnQsICdwLXNwbGl0dGVyJykpIHtcbiAgICAgICAgICAgICAgICBwYXJlbnQgPSBwYXJlbnQucGFyZW50RWxlbWVudDtcbiAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgcmV0dXJuIHBhcmVudCAhPT0gbnVsbDtcbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgIHJldHVybiBmYWxzZTtcbiAgICAgICAgfVxuICAgIH1cblxuICAgIGlzU3RhdGVmdWwoKSB7XG4gICAgICAgIHJldHVybiB0aGlzLnN0YXRlS2V5ICE9IG51bGw7XG4gICAgfVxuXG4gICAgZ2V0U3RvcmFnZSgpIHtcbiAgICAgICAgaWYgKGlzUGxhdGZvcm1Ccm93c2VyKHRoaXMucGxhdGZvcm1JZCkpIHtcbiAgICAgICAgICAgIHN3aXRjaCAodGhpcy5zdGF0ZVN0b3JhZ2UpIHtcbiAgICAgICAgICAgICAgICBjYXNlICdsb2NhbCc6XG4gICAgICAgICAgICAgICAgICAgIHJldHVybiB0aGlzLndpbmRvdy5sb2NhbFN0b3JhZ2U7XG5cbiAgICAgICAgICAgICAgICBjYXNlICdzZXNzaW9uJzpcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHRoaXMud2luZG93LnNlc3Npb25TdG9yYWdlO1xuXG4gICAgICAgICAgICAgICAgZGVmYXVsdDpcbiAgICAgICAgICAgICAgICAgICAgdGhyb3cgbmV3IEVycm9yKHRoaXMuc3RhdGVTdG9yYWdlICsgJyBpcyBub3QgYSB2YWxpZCB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mFzaXMgPSAnY2FsYygnICsgdGhpcy5fcGFuZWxTaXplc1tpXSArICclIC0gJyArICh0aGlzLnBhbmVscy5sZW5ndGggLSAxKSAqIHRoaXMuZ3V0dGVyU2l6ZSArICdweCknO1xuICAgICAgICAgICAgfSk7XG5cbiAgICAgICAgICAgIHJldHVybiB0cnVlO1xuICAgICAgICB9XG5cbiAgICAgICAgcmV0dXJuIGZhbHNlO1xuICAgIH1cblxuICAgIGNvbnRhaW5lckNsYXNzKCkge1xuICAgICAgICByZXR1cm4ge1xuICAgICAgICAgICAgJ3Atc3BsaXR0ZXIgcC1jb21wb25lbnQnOiB0cnVlLFxuICAgICAgICAgICAgJ3Atc3BsaXR0ZXItaG9yaXpvbnRhbCc6IHRoaXMubGF5b3V0ID09PSAnaG9yaXpvbnRhbCcsXG4gICAgICAgICAgICAncC1zcGxpdHRlci12ZXJ0aWNhbCc6IHRoaXMubGF5b3V0ID09PSAndmVydGljYWwnXG4gICAgICAgIH07XG4gICAgfVxuXG4gICAgcGFuZWxDb250YWluZXJDbGFzcygpIHtcbiAgICAgICAgcmV0dXJuIHtcbiAgICAgICAgICAgICdwLXNwbGl0dGVyLXBhbmVsJzogdHJ1ZSxcbiAgICAgICAgICAgICdwLXNwbGl0dGVyLXBhbmVsLW5lc3RlZCc6IHRydWVcbiAgICAgICAgfTtcbiAgICB9XG5cbiAgICBndXR0ZXJTdHlsZSgpIHtcbiAgICAgICAgaWYgKHRoaXMuaG9yaXpvbnRhbCgpKSByZXR1cm4geyB3aWR0aDogdGhpcy5ndXR0ZXJTaXplICsgJ3B4JyB9O1xuICAgICAgICBlbHNlIHJldHVybiB7IGhlaWdodDogdGhpcy5ndXR0ZXJTaXplICsgJ3B4JyB9O1xuICAgIH1cblxuICAgIGhvcml6b250YWwoKSB7XG4gICAgICAgIHJldHVybiB0aGlzLmxheW91dCA9PT0gJ2hvcml6b250YWwnO1xuICAgIH1cbn1cblxuQE5nTW9kdWxlKHtcbiAgICBpbXBvcnRzOiB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