Icard/angular-clarity-master(work.../node_modules/primeng/esm2022/inputmask/inputmask.mjs

915 lines
99 KiB
JavaScript

/*
Port of jQuery MaskedInput by DigitalBush as a Native Angular2 Component in Typescript without jQuery
https://github.com/digitalBush/jquery.maskedinput/
Copyright (c) 2007-2014 Josh Bush (digitalbush.com)
Permission is hereby granted, free of charge, to any person
obtaining a copy of this software and associated documentation
files (the "Software"), to deal in the Software without
restriction, including without limitation the rights to use,
copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the
Software is furnished to do so, subject to the following
conditions:
The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
OTHER DEALINGS IN THE SOFTWARE.
*/
import { CommonModule, DOCUMENT, isPlatformBrowser } from '@angular/common';
import { ChangeDetectionStrategy, Component, ContentChildren, EventEmitter, Inject, Input, NgModule, Output, PLATFORM_ID, ViewChild, ViewEncapsulation, booleanAttribute, forwardRef, numberAttribute } from '@angular/core';
import { NG_VALUE_ACCESSOR } from '@angular/forms';
import { PrimeTemplate, SharedModule } from 'primeng/api';
import { AutoFocusModule } from 'primeng/autofocus';
import { DomHandler } from 'primeng/dom';
import { TimesIcon } from 'primeng/icons/times';
import { InputTextModule } from 'primeng/inputtext';
import * as i0 from "@angular/core";
import * as i1 from "primeng/api";
import * as i2 from "@angular/common";
import * as i3 from "primeng/inputtext";
import * as i4 from "primeng/autofocus";
export const INPUTMASK_VALUE_ACCESSOR = {
provide: NG_VALUE_ACCESSOR,
useExisting: forwardRef(() => InputMask),
multi: true
};
/**
* InputMask component is used to enter input in a certain format such as numeric, date, currency, email and phone.
* @group Components
*/
export class InputMask {
document;
platformId;
el;
cd;
config;
/**
* HTML5 input type.
* @group Props
*/
type = 'text';
/**
* Placeholder character in mask, default is underscore.
* @group Props
*/
slotChar = '_';
/**
* Clears the incomplete value on blur.
* @group Props
*/
autoClear = true;
/**
* When enabled, a clear icon is displayed to clear the value.
* @group Props
*/
showClear = false;
/**
* Inline style of the input field.
* @group Props
*/
style;
/**
* Identifier of the focus input to match a label defined for the component.
* @group Props
*/
inputId;
/**
* Style class of the input field.
* @group Props
*/
styleClass;
/**
* Advisory information to display on input.
* @group Props
*/
placeholder;
/**
* Size of the input field.
* @group Props
*/
size;
/**
* Maximum number of character allows in the input field.
* @group Props
*/
maxlength;
/**
* Specifies tab order of the element.
* @group Props
*/
tabindex;
/**
* Title text of the input text.
* @group Props
*/
title;
/**
* Specifies the input variant of the component.
* @group Props
*/
variant = 'outlined';
/**
* Used to define a string that labels the input element.
* @group Props
*/
ariaLabel;
/**
* Establishes relationships between the component and label(s) where its value should be one or more element IDs.
* @group Props
*/
ariaLabelledBy;
/**
* Used to indicate that user input is required on an element before a form can be submitted.
* @group Props
*/
ariaRequired;
/**
* When present, it specifies that the element value cannot be altered.
* @group Props
*/
disabled;
/**
* When present, it specifies that an input field is read-only.
* @group Props
*/
readonly;
/**
* Defines if ngModel sets the raw unmasked value to bound value or the formatted mask value.
* @group Props
*/
unmask;
/**
* Name of the input field.
* @group Props
*/
name;
/**
* When present, it specifies that an input field must be filled out before submitting the form.
* @group Props
*/
required;
/**
* Regex pattern for alpha characters
* @group Props
*/
characterPattern = '[A-Za-z]';
/**
* When present, the input gets a focus automatically on load.
* @group Props
*/
autofocus;
/**
* When present, the input gets a focus automatically on load.
* @group Props
* @deprecated Use autofocus property instead.
*/
set autoFocus(value) {
this.autofocus = value;
console.warn('autoFocus is deprecated. Use autofocus property instead.');
}
/**
* Used to define a string that autocomplete attribute the current element.
* @group Props
*/
autocomplete;
/**
* When present, it specifies that whether to clean buffer value from model.
* @group Props
*/
keepBuffer = false;
/**
* Mask pattern.
* @group Props
*/
get mask() {
return this._mask;
}
set mask(val) {
this._mask = val;
this.initMask();
this.writeValue('');
this.onModelChange(this.value);
}
/**
* Callback to invoke when the mask is completed.
* @group Emits
*/
onComplete = new EventEmitter();
/**
* Callback to invoke when the component receives focus.
* @param {Event} event - Browser event.
* @group Emits
*/
onFocus = new EventEmitter();
/**
* Callback to invoke when the component loses focus.
* @param {Event} event - Browser event.
* @group Emits
*/
onBlur = new EventEmitter();
/**
* Callback to invoke on input.
* @param {Event} event - Browser event.
* @group Emits
*/
onInput = new EventEmitter();
/**
* Callback to invoke on input key press.
* @param {Event} event - Browser event.
* @group Emits
*/
onKeydown = new EventEmitter();
/**
* Callback to invoke when input field is cleared.
* @group Emits
*/
onClear = new EventEmitter();
inputViewChild;
templates;
clearIconTemplate;
value;
_mask;
onModelChange = () => { };
onModelTouched = () => { };
input;
filled;
defs;
tests;
partialPosition;
firstNonMaskPos;
lastRequiredNonMaskPos;
len;
oldVal;
buffer;
defaultBuffer;
focusText;
caretTimeoutId;
androidChrome = true;
focused;
_variant = 'outlined';
get inputClass() {
return {
'p-inputmask': true
};
}
constructor(document, platformId, el, cd, config) {
this.document = document;
this.platformId = platformId;
this.el = el;
this.cd = cd;
this.config = config;
}
ngOnInit() {
if (isPlatformBrowser(this.platformId)) {
let ua = navigator.userAgent;
this.androidChrome = /chrome/i.test(ua) && /android/i.test(ua);
}
this.initMask();
}
ngAfterContentInit() {
this.templates.forEach((item) => {
switch (item.getType()) {
case 'clearicon':
this.clearIconTemplate = item.template;
break;
}
});
}
initMask() {
this.tests = [];
this.partialPosition = this.mask.length;
this.len = this.mask.length;
this.firstNonMaskPos = null;
this.defs = {
'9': '[0-9]',
a: this.characterPattern,
'*': `${this.characterPattern}|[0-9]`
};
let maskTokens = this.mask.split('');
for (let i = 0; i < maskTokens.length; i++) {
let c = maskTokens[i];
if (c == '?') {
this.len--;
this.partialPosition = i;
}
else if (this.defs[c]) {
this.tests.push(new RegExp(this.defs[c]));
if (this.firstNonMaskPos === null) {
this.firstNonMaskPos = this.tests.length - 1;
}
if (i < this.partialPosition) {
this.lastRequiredNonMaskPos = this.tests.length - 1;
}
}
else {
this.tests.push(null);
}
}
this.buffer = [];
for (let i = 0; i < maskTokens.length; i++) {
let c = maskTokens[i];
if (c != '?') {
if (this.defs[c])
this.buffer.push(this.getPlaceholder(i));
else
this.buffer.push(c);
}
}
this.defaultBuffer = this.buffer.join('');
}
writeValue(value) {
this.value = value;
if (this.inputViewChild && this.inputViewChild.nativeElement) {
if (this.value == undefined || this.value == null)
this.inputViewChild.nativeElement.value = '';
else
this.inputViewChild.nativeElement.value = this.value;
this.checkVal();
this.focusText = this.inputViewChild.nativeElement.value;
this.updateFilledState();
}
}
registerOnChange(fn) {
this.onModelChange = fn;
}
registerOnTouched(fn) {
this.onModelTouched = fn;
}
setDisabledState(val) {
this.disabled = val;
this.cd.markForCheck();
}
caret(first, last) {
let range, begin, end;
if (!this.inputViewChild?.nativeElement.offsetParent || this.inputViewChild.nativeElement !== this.inputViewChild.nativeElement.ownerDocument.activeElement) {
return;
}
if (typeof first == 'number') {
begin = first;
end = typeof last === 'number' ? last : begin;
if (this.inputViewChild.nativeElement.setSelectionRange) {
this.inputViewChild.nativeElement.setSelectionRange(begin, end);
}
else if (this.inputViewChild.nativeElement['createTextRange']) {
range = this.inputViewChild.nativeElement['createTextRange']();
range.collapse(true);
range.moveEnd('character', end);
range.moveStart('character', begin);
range.select();
}
}
else {
if (this.inputViewChild.nativeElement.setSelectionRange) {
begin = this.inputViewChild.nativeElement.selectionStart;
end = this.inputViewChild.nativeElement.selectionEnd;
}
else if (this.document && this.document['selection'].createRange) {
range = this.document.createRange();
begin = 0 - range.duplicate().moveStart('character', -100000);
end = begin + range.text.length;
}
return { begin: begin, end: end };
}
}
isCompleted() {
let completed;
for (let i = this.firstNonMaskPos; i <= this.lastRequiredNonMaskPos; i++) {
if (this.tests[i] && this.buffer[i] === this.getPlaceholder(i)) {
return false;
}
}
return true;
}
getPlaceholder(i) {
if (i < this.slotChar.length) {
return this.slotChar.charAt(i);
}
return this.slotChar.charAt(0);
}
seekNext(pos) {
while (++pos < this.len && !this.tests[pos])
;
return pos;
}
seekPrev(pos) {
while (--pos >= 0 && !this.tests[pos])
;
return pos;
}
shiftL(begin, end) {
let i, j;
if (begin < 0) {
return;
}
for (i = begin, j = this.seekNext(end); i < this.len; i++) {
if (this.tests[i]) {
if (j < this.len && this.tests[i].test(this.buffer[j])) {
this.buffer[i] = this.buffer[j];
this.buffer[j] = this.getPlaceholder(j);
}
else {
break;
}
j = this.seekNext(j);
}
}
this.writeBuffer();
this.caret(Math.max(this.firstNonMaskPos, begin));
}
shiftR(pos) {
let i, c, j, t;
for (i = pos, c = this.getPlaceholder(pos); i < this.len; i++) {
if (this.tests[i]) {
j = this.seekNext(i);
t = this.buffer[i];
this.buffer[i] = c;
if (j < this.len && this.tests[j].test(t)) {
c = t;
}
else {
break;
}
}
}
}
handleAndroidInput(e) {
var curVal = this.inputViewChild?.nativeElement.value;
var pos = this.caret();
if (this.oldVal && this.oldVal.length && this.oldVal.length > curVal.length) {
// a deletion or backspace happened
this.checkVal(true);
while (pos.begin > 0 && !this.tests[pos.begin - 1])
pos.begin--;
if (pos.begin === 0) {
while (pos.begin < this.firstNonMaskPos && !this.tests[pos.begin])
pos.begin++;
}
setTimeout(() => {
this.caret(pos.begin, pos.begin);
this.updateModel(e);
if (this.isCompleted()) {
this.onComplete.emit();
}
}, 0);
}
else {
this.checkVal(true);
while (pos.begin < this.len && !this.tests[pos.begin])
pos.begin++;
setTimeout(() => {
this.caret(pos.begin, pos.begin);
this.updateModel(e);
if (this.isCompleted()) {
this.onComplete.emit();
}
}, 0);
}
}
onInputBlur(e) {
this.focused = false;
this.onModelTouched();
if (!this.keepBuffer) {
this.checkVal();
}
this.updateFilledState();
this.onBlur.emit(e);
if (this.inputViewChild?.nativeElement.value != this.focusText || this.inputViewChild?.nativeElement.value != this.value) {
this.updateModel(e);
let event = this.document.createEvent('HTMLEvents');
event.initEvent('change', true, false);
this.inputViewChild?.nativeElement.dispatchEvent(event);
}
}
onInputKeydown(e) {
if (this.readonly) {
return;
}
let k = e.which || e.keyCode, pos, begin, end;
let iPhone;
if (isPlatformBrowser(this.platformId)) {
iPhone = /iphone/i.test(DomHandler.getUserAgent());
}
this.oldVal = this.inputViewChild?.nativeElement.value;
this.onKeydown.emit(e);
//backspace, delete, and escape get special treatment
if (k === 8 || k === 46 || (iPhone && k === 127)) {
pos = this.caret();
begin = pos.begin;
end = pos.end;
if (end - begin === 0) {
begin = k !== 46 ? this.seekPrev(begin) : (end = this.seekNext(begin - 1));
end = k === 46 ? this.seekNext(end) : end;
}
this.clearBuffer(begin, end);
if (this.keepBuffer) {
this.shiftL(begin, end - 2);
}
else {
this.shiftL(begin, end - 1);
}
this.updateModel(e);
this.onInput.emit(e);
e.preventDefault();
}
else if (k === 13) {
// enter
this.onInputBlur(e);
this.updateModel(e);
}
else if (k === 27) {
// escape
this.inputViewChild.nativeElement.value = this.focusText;
this.caret(0, this.checkVal());
this.updateModel(e);
e.preventDefault();
}
}
onKeyPress(e) {
if (this.readonly) {
return;
}
var k = e.which || e.keyCode, pos = this.caret(), p, c, next, completed;
if (e.ctrlKey || e.altKey || e.metaKey || k < 32 || (k > 34 && k < 41)) {
//Ignore
return;
}
else if (k && k !== 13) {
if (pos.end - pos.begin !== 0) {
this.clearBuffer(pos.begin, pos.end);
this.shiftL(pos.begin, pos.end - 1);
}
p = this.seekNext(pos.begin - 1);
if (p < this.len) {
c = String.fromCharCode(k);
if (this.tests[p].test(c)) {
this.shiftR(p);
this.buffer[p] = c;
this.writeBuffer();
next = this.seekNext(p);
if (DomHandler.isClient() && /android/i.test(DomHandler.getUserAgent())) {
let proxy = () => {
this.caret(next);
};
setTimeout(proxy, 0);
}
else {
this.caret(next);
}
if (pos.begin <= this.lastRequiredNonMaskPos) {
completed = this.isCompleted();
}
this.onInput.emit(e);
}
}
e.preventDefault();
}
this.updateModel(e);
this.updateFilledState();
if (completed) {
this.onComplete.emit();
}
}
clearBuffer(start, end) {
if (!this.keepBuffer) {
let i;
for (i = start; i < end && i < this.len; i++) {
if (this.tests[i]) {
this.buffer[i] = this.getPlaceholder(i);
}
}
}
}
writeBuffer() {
this.inputViewChild.nativeElement.value = this.buffer.join('');
}
checkVal(allow) {
//try to place characters where they belong
let test = this.inputViewChild?.nativeElement.value, lastMatch = -1, i, c, pos;
for (i = 0, pos = 0; i < this.len; i++) {
if (this.tests[i]) {
this.buffer[i] = this.getPlaceholder(i);
while (pos++ < test.length) {
c = test.charAt(pos - 1);
if (this.tests[i].test(c)) {
if (!this.keepBuffer) {
this.buffer[i] = c;
}
lastMatch = i;
break;
}
}
if (pos > test.length) {
this.clearBuffer(i + 1, this.len);
break;
}
}
else {
if (this.buffer[i] === test.charAt(pos)) {
pos++;
}
if (i < this.partialPosition) {
lastMatch = i;
}
}
}
if (allow) {
this.writeBuffer();
}
else if (lastMatch + 1 < this.partialPosition) {
if (this.autoClear || this.buffer.join('') === this.defaultBuffer) {
// Invalid value. Remove it and replace it with the
// mask, which is the default behavior.
if (this.inputViewChild?.nativeElement.value)
this.inputViewChild.nativeElement.value = '';
this.clearBuffer(0, this.len);
}
else {
// Invalid value, but we opt to show the value to the
// user and allow them to correct their mistake.
this.writeBuffer();
}
}
else {
this.writeBuffer();
this.inputViewChild.nativeElement.value = this.inputViewChild?.nativeElement.value.substring(0, lastMatch + 1);
}
return (this.partialPosition ? i : this.firstNonMaskPos);
}
onInputFocus(event) {
if (this.readonly) {
return;
}
this.focused = true;
clearTimeout(this.caretTimeoutId);
let pos;
this.focusText = this.inputViewChild?.nativeElement.value;
pos = this.keepBuffer ? this.inputViewChild?.nativeElement.value.length : this.checkVal();
this.caretTimeoutId = setTimeout(() => {
if (this.inputViewChild?.nativeElement !== this.inputViewChild?.nativeElement.ownerDocument.activeElement) {
return;
}
this.writeBuffer();
if (pos == this.mask?.replace('?', '').length) {
this.caret(0, pos);
}
else {
this.caret(pos);
}
}, 10);
this.onFocus.emit(event);
}
onInputChange(event) {
if (this.androidChrome)
this.handleAndroidInput(event);
else
this.handleInputChange(event);
this.onInput.emit(event);
}
handleInputChange(event) {
if (this.readonly) {
return;
}
setTimeout(() => {
var pos = this.checkVal(true);
this.caret(pos);
this.updateModel(event);
if (this.isCompleted()) {
this.onComplete.emit();
}
}, 0);
}
getUnmaskedValue() {
let unmaskedBuffer = [];
for (let i = 0; i < this.buffer.length; i++) {
let c = this.buffer[i];
if (this.tests[i] && c != this.getPlaceholder(i)) {
unmaskedBuffer.push(c);
}
}
return unmaskedBuffer.join('');
}
updateModel(e) {
const updatedValue = this.unmask ? this.getUnmaskedValue() : e.target.value;
if (updatedValue !== null || updatedValue !== undefined) {
this.value = updatedValue;
this.onModelChange(this.value);
}
}
updateFilledState() {
this.filled = this.inputViewChild?.nativeElement && this.inputViewChild.nativeElement.value != '';
}
focus() {
this.inputViewChild?.nativeElement.focus();
}
clear() {
this.inputViewChild.nativeElement.value = '';
this.value = null;
this.onModelChange(this.value);
this.onClear.emit();
}
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.7", ngImport: i0, type: InputMask, deps: [{ token: DOCUMENT }, { token: PLATFORM_ID }, { token: i0.ElementRef }, { token: i0.ChangeDetectorRef }, { token: i1.PrimeNGConfig }], target: i0.ɵɵFactoryTarget.Component });
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "16.1.0", version: "17.3.7", type: InputMask, selector: "p-inputMask", inputs: { type: "type", slotChar: "slotChar", autoClear: ["autoClear", "autoClear", booleanAttribute], showClear: ["showClear", "showClear", booleanAttribute], style: "style", inputId: "inputId", styleClass: "styleClass", placeholder: "placeholder", size: ["size", "size", numberAttribute], maxlength: ["maxlength", "maxlength", numberAttribute], tabindex: "tabindex", title: "title", variant: "variant", ariaLabel: "ariaLabel", ariaLabelledBy: "ariaLabelledBy", ariaRequired: ["ariaRequired", "ariaRequired", booleanAttribute], disabled: ["disabled", "disabled", booleanAttribute], readonly: ["readonly", "readonly", booleanAttribute], unmask: ["unmask", "unmask", booleanAttribute], name: "name", required: ["required", "required", booleanAttribute], characterPattern: "characterPattern", autofocus: ["autofocus", "autofocus", booleanAttribute], autoFocus: ["autoFocus", "autoFocus", booleanAttribute], autocomplete: "autocomplete", keepBuffer: ["keepBuffer", "keepBuffer", booleanAttribute], mask: "mask" }, outputs: { onComplete: "onComplete", onFocus: "onFocus", onBlur: "onBlur", onInput: "onInput", onKeydown: "onKeydown", onClear: "onClear" }, host: { properties: { "class.p-inputwrapper-filled": "filled", "class.p-inputwrapper-focus": "focused", "class.p-inputmask-clearable": "showClear && !disabled" }, classAttribute: "p-element" }, providers: [INPUTMASK_VALUE_ACCESSOR], queries: [{ propertyName: "templates", predicate: PrimeTemplate }], viewQueries: [{ propertyName: "inputViewChild", first: true, predicate: ["input"], descendants: true, static: true }], ngImport: i0, template: `
<input
#input
pInputText
[class]="styleClass"
[ngClass]="inputClass"
[attr.id]="inputId"
[attr.type]="type"
[attr.name]="name"
[ngStyle]="style"
[attr.placeholder]="placeholder"
[attr.title]="title"
[attr.size]="size"
[attr.autocomplete]="autocomplete"
[attr.maxlength]="maxlength"
[attr.tabindex]="tabindex"
[attr.aria-label]="ariaLabel"
[attr.aria-labelledBy]="ariaLabelledBy"
[attr.aria-required]="ariaRequired"
[disabled]="disabled"
[readonly]="readonly"
[attr.required]="required"
(focus)="onInputFocus($event)"
(blur)="onInputBlur($event)"
(keydown)="onInputKeydown($event)"
(keypress)="onKeyPress($event)"
pAutoFocus
[variant]="variant"
[autofocus]="autofocus"
(input)="onInputChange($event)"
(paste)="handleInputChange($event)"
[attr.data-pc-name]="'inputmask'"
[attr.data-pc-section]="'root'"
/>
<ng-container *ngIf="value != null && filled && showClear && !disabled">
<TimesIcon *ngIf="!clearIconTemplate" [styleClass]="'p-inputmask-clear-icon'" (click)="clear()" [attr.data-pc-section]="'clearIcon'" />
<span *ngIf="clearIconTemplate" class="p-inputmask-clear-icon" (click)="clear()" [attr.data-pc-section]="'clearIcon'">
<ng-template *ngTemplateOutlet="clearIconTemplate"></ng-template>
</span>
</ng-container>
`, isInline: true, styles: ["@layer primeng{.p-inputmask-clear-icon{position:absolute;top:50%;margin-top:-.5rem;cursor:pointer}.p-inputmask-clearable{position:relative}}\n"], dependencies: [{ kind: "directive", type: i0.forwardRef(() => i2.NgClass), selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i0.forwardRef(() => i2.NgIf), selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i0.forwardRef(() => i2.NgTemplateOutlet), selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "directive", type: i0.forwardRef(() => i2.NgStyle), selector: "[ngStyle]", inputs: ["ngStyle"] }, { kind: "directive", type: i0.forwardRef(() => i3.InputText), selector: "[pInputText]", inputs: ["variant"] }, { kind: "directive", type: i0.forwardRef(() => i4.AutoFocus), selector: "[pAutoFocus]", inputs: ["autofocus"] }, { kind: "component", type: i0.forwardRef(() => TimesIcon), selector: "TimesIcon" }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.7", ngImport: i0, type: InputMask, decorators: [{
type: Component,
args: [{ selector: 'p-inputMask', template: `
<input
#input
pInputText
[class]="styleClass"
[ngClass]="inputClass"
[attr.id]="inputId"
[attr.type]="type"
[attr.name]="name"
[ngStyle]="style"
[attr.placeholder]="placeholder"
[attr.title]="title"
[attr.size]="size"
[attr.autocomplete]="autocomplete"
[attr.maxlength]="maxlength"
[attr.tabindex]="tabindex"
[attr.aria-label]="ariaLabel"
[attr.aria-labelledBy]="ariaLabelledBy"
[attr.aria-required]="ariaRequired"
[disabled]="disabled"
[readonly]="readonly"
[attr.required]="required"
(focus)="onInputFocus($event)"
(blur)="onInputBlur($event)"
(keydown)="onInputKeydown($event)"
(keypress)="onKeyPress($event)"
pAutoFocus
[variant]="variant"
[autofocus]="autofocus"
(input)="onInputChange($event)"
(paste)="handleInputChange($event)"
[attr.data-pc-name]="'inputmask'"
[attr.data-pc-section]="'root'"
/>
<ng-container *ngIf="value != null && filled && showClear && !disabled">
<TimesIcon *ngIf="!clearIconTemplate" [styleClass]="'p-inputmask-clear-icon'" (click)="clear()" [attr.data-pc-section]="'clearIcon'" />
<span *ngIf="clearIconTemplate" class="p-inputmask-clear-icon" (click)="clear()" [attr.data-pc-section]="'clearIcon'">
<ng-template *ngTemplateOutlet="clearIconTemplate"></ng-template>
</span>
</ng-container>
`, host: {
class: 'p-element',
'[class.p-inputwrapper-filled]': 'filled',
'[class.p-inputwrapper-focus]': 'focused',
'[class.p-inputmask-clearable]': 'showClear && !disabled'
}, providers: [INPUTMASK_VALUE_ACCESSOR], changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, styles: ["@layer primeng{.p-inputmask-clear-icon{position:absolute;top:50%;margin-top:-.5rem;cursor:pointer}.p-inputmask-clearable{position:relative}}\n"] }]
}], ctorParameters: () => [{ type: Document, decorators: [{
type: Inject,
args: [DOCUMENT]
}] }, { type: undefined, decorators: [{
type: Inject,
args: [PLATFORM_ID]
}] }, { type: i0.ElementRef }, { type: i0.ChangeDetectorRef }, { type: i1.PrimeNGConfig }], propDecorators: { type: [{
type: Input
}], slotChar: [{
type: Input
}], autoClear: [{
type: Input,
args: [{ transform: booleanAttribute }]
}], showClear: [{
type: Input,
args: [{ transform: booleanAttribute }]
}], style: [{
type: Input
}], inputId: [{
type: Input
}], styleClass: [{
type: Input
}], placeholder: [{
type: Input
}], size: [{
type: Input,
args: [{ transform: numberAttribute }]
}], maxlength: [{
type: Input,
args: [{ transform: numberAttribute }]
}], tabindex: [{
type: Input
}], title: [{
type: Input
}], variant: [{
type: Input
}], ariaLabel: [{
type: Input
}], ariaLabelledBy: [{
type: Input
}], ariaRequired: [{
type: Input,
args: [{ transform: booleanAttribute }]
}], disabled: [{
type: Input,
args: [{ transform: booleanAttribute }]
}], readonly: [{
type: Input,
args: [{ transform: booleanAttribute }]
}], unmask: [{
type: Input,
args: [{ transform: booleanAttribute }]
}], name: [{
type: Input
}], required: [{
type: Input,
args: [{ transform: booleanAttribute }]
}], characterPattern: [{
type: Input
}], autofocus: [{
type: Input,
args: [{ transform: booleanAttribute }]
}], autoFocus: [{
type: Input,
args: [{ transform: booleanAttribute }]
}], autocomplete: [{
type: Input
}], keepBuffer: [{
type: Input,
args: [{ transform: booleanAttribute }]
}], mask: [{
type: Input
}], onComplete: [{
type: Output
}], onFocus: [{
type: Output
}], onBlur: [{
type: Output
}], onInput: [{
type: Output
}], onKeydown: [{
type: Output
}], onClear: [{
type: Output
}], inputViewChild: [{
type: ViewChild,
args: ['input', { static: true }]
}], templates: [{
type: ContentChildren,
args: [PrimeTemplate]
}] } });
export class InputMaskModule {
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.7", ngImport: i0, type: InputMaskModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "17.3.7", ngImport: i0, type: InputMaskModule, declarations: [InputMask], imports: [CommonModule, InputTextModule, AutoFocusModule, TimesIcon], exports: [InputMask, SharedModule] });
static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "17.3.7", ngImport: i0, type: InputMaskModule, imports: [CommonModule, InputTextModule, AutoFocusModule, TimesIcon, SharedModule] });
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.7", ngImport: i0, type: InputMaskModule, decorators: [{
type: NgModule,
args: [{
imports: [CommonModule, InputTextModule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AgICBbbmdTdHlsZV09XCJzdHlsZVwiXG4gICAgICAgICAgICBbYXR0ci5wbGFjZWhvbGRlcl09XCJwbGFjZWhvbGRlclwiXG4gICAgICAgICAgICBbYXR0ci50aXRsZV09XCJ0aXRsZVwiXG4gICAgICAgICAgICBbYXR0ci5zaXplXT1cInNpemVcIlxuICAgICAgICAgICAgW2F0dHIuYXV0b2NvbXBsZXRlXT1cImF1dG9jb21wbGV0ZVwiXG4gICAgICAgICAgICBbYXR0ci5tYXhsZW5ndGhdPVwibWF4bGVuZ3RoXCJcbiAgICAgICAgICAgIFthdHRyLnRhYmluZGV4XT1cInRhYmluZGV4XCJcbiAgICAgICAgICAgIFthdHRyLmFyaWEtbGFiZWxdPVwiYXJpYUxhYmVsXCJcbiAgICAgICAgICAgIFthdHRyLmFyaWEtbGFiZWxsZWRCeV09XCJhcmlhTGFiZWxsZWRCeVwiXG4gICAgICAgICAgICBbYXR0ci5hcmlhLXJlcXVpcmVkXT1cImFyaWFSZXF1aXJlZFwiXG4gICAgICAgICAgICBbZGlzYWJsZWRdPVwiZGlzYWJsZWRcIlxuICAgICAgICAgICAgW3JlYWRvbmx5XT1cInJlYWRvbmx5XCJcbiAgICAgICAgICAgIFthdHRyLnJlcXVpcmVkXT1cInJlcXVpcmVkXCJcbiAgICAgICAgICAgIChmb2N1cyk9XCJvbklucHV0Rm9jdXMoJGV2ZW50KVwiXG4gICAgICAgICAgICAoYmx1cik9XCJvbklucHV0Qmx1cigkZXZlbnQpXCJcbiAgICAgICAgICAgIChrZXlkb3duKT1cIm9uSW5wdXRLZXlkb3duKCRldmVudClcIlxuICAgICAgICAgICAgKGtleXByZXNzKT1cIm9uS2V5UHJlc3MoJGV2ZW50KVwiXG4gICAgICAgICAgICBwQXV0b0ZvY3VzXG4gICAgICAgICAgICBbdmFyaWFudF09XCJ2YXJpYW50XCJcbiAgICAgICAgICAgIFthdXRvZm9jdXNdPVwiYXV0b2ZvY3VzXCJcbiAgICAgICAgICAgIChpbnB1d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B0aGlzLmRlZnMgPSB7XG4gICAgICAgICAgICAnOSc6ICdbMC05XScsXG4gICAgICAgICAgICBhOiB0aGlzLmNoYXJhY3RlclBhdHRlcm4sXG4gICAgICAgICAgICAnKic6IGAke3RoaXMuY2hhcmFjdGVyUGF0dGVybn18WzAtOV1gXG4gICAgICAgIH07XG5cbiAgICAgICAgbGV0IG1hc2tUb2tlbnMgPSAodGhpcy5tYXNrIGFzIHN0cmluZykuc3BsaXQoJycpO1xuICAgICAgICBmb3IgKGxldCBpID0gMDsgaSA8IG1hc2tUb2tlbnMubGVuZ3RoOyBpKyspIHtcbiAgICAgICAgICAgIGxldCBjID0gbWFza1Rva2Vuc1tpXTtcbiAgICAgICAgICAgIGlmIChjID09ICc/Jykge1xuICAgICAgICAgICAgICAgIHRoaXMubGVuLS07XG4gICAgICAgICAgICAgICAgdGhpcy5wYXJ0aWFsUG9zaXRpb24gPSBpO1xuICAgICAgICAgICAgfSBlbHNlIGlmICh0aGlzLmRlZnNbY10pIHtcbiAgICAgICAgICAgICAgICB0aGlzLnRlc3RzLnB1c2gobmV3IFJlZ0V4cCh0aGlzLmRlZnNbY10pKTtcbiAgICAgICAgICAgICAgICBpZiAodGhpcy5maXJzdE5vbk1hc2tQb3MgPT09IG51bGwpIHtcbiAgICAgICAgICAgICAgICAgICAgdGhpcy5maXJzdE5vbk1hc2tQb3MgPSB0aGlzLnRlc3RzLmxlbmd0aCAtIDE7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIGlmIChpIDwgdGhpcy5wYXJ0aWFsUG9zaXRpb24pIHtcbiAgICAgICAgICAgICAgICAgICAgdGhpcy5sYXN0UmVxdWlyZWROb25NYXNrUG9zID0gdGhpcy50ZXN0cy5sZW5ndGggLSAxO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgdGhpcy50ZXN0cy5wdXNoKG51bGwpO1xuICAgICAgICAgICAgfVxuICAgICAgIC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lcikgJiYgIXRoaXMudGVzdHNbcG9zXSk7XG4gICAgICAgIHJldHVybiBwb3M7XG4gICAgfVxuXG4gICAgc2Vla1ByZXYocG9zOiBudW1iZXIpIHtcbiAgICAgICAgd2hpbGUgKC0tcG9zID49IDAgJiYgIXRoaXMudGVzdHNbcG9zXSk7XG4gICAgICAgIHJldHVybiBwb3M7XG4gICAgfVxuXG4gICAgc2hpZnRMKGJlZ2luOiBudW1iZXIsIGVuZDogbnVtYmVyKSB7XG4gICAgICAgIGxldCBpLCBqO1xuXG4gICAgICAgIGlmIChiZWdpbiA8IDApIHtcbiAgICAgICAgICAgIHJldHVybjtcbiAgICAgICAgfVxuXG4gICAgICAgIGZvciAoaSA9IGJlZ2luLCBqID0gdGhpcy5zZWVrTmV4dChlbmQpOyBpIDwgKHRoaXMubGVuIGFzIG51bWJlcik7IGkrKykge1xuICAgICAgICAgICAgaWYgKHRoaXMudGVzdHNbaV0pIHtcbiAgICAgICAgICAgICAgICBpZiAoaiA8ICh0aGlzLmxlbiBhcyBudW1iZXIpICYmIHRoaXMudGVzdHNbaV0udGVzdCh0aGlzLmJ1ZmZlcltqXSkpIHtcbiAgICAgICAgICAgICAgICAgICAgdGhpcy5idWZmZXJbaV0gPSB0aGlzLmJ1ZmZlcltqXTtcbiAgICAgICAgICAgICAgICAgICAgdGhpcy5idWZmZXJbal0gPSB0aGlzLmdldFBsYWNlaG9sZGVyKGopO1xuICAgICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgICAgIGogPSB0aGlzLnNlZWtOZXh0KGopO1xuICAgICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICAgIHRoaXMud3JpdGVCdWZmZXIoKTtcbiAgICAgICAgdGhpcy5jYXJldChNYXRoLm1heCh0aGlzLmZpcnN0Tm9uTWFza1BvcyBhcyBudW1iZXIsIGJlZ2luKSk7XG4gICAgfVxuXG4gICAgc2hpZnRSKHBvczogbnVtYmVyKSB7XG4gICAgICAgIGxldCBpLCBjLCBqLCB0O1xuXG4gICAgICAgIGZvciAoaSA9IHBvcywgYyA9IHRoaXMuZ2V0UGxhY2Vob2xkZXIocG9zKTsgaSA8ICh0aGlzLmxlbiBhcyBudW1iZXIpOyBpKyspIHtcbiAgICAgICAgICAgIGlmICh0aGlzLnRlc3RzW2ldKSB7XG4gICAgICAgICAgICAgICAgaiA9IHRoaXMuc2Vla05leHQoaSk7XG4gICAgICAgICAgICAgICAgdCA9IHRoaXMuYnVmZmVyW2ldO1xuICAgICAgICAgICAgICAgIHRoaXMuYnVmZmVyW2ldID0gYztcbiAgICAgICAgICAgICAgICBpZiAoaiA8ICh0aGlzLmxlbiBhcyBudW1iZXIpICYmIHRoaXMudGVzdHNbal0udGVzdCh0KSkge1xuICAgICAgICAgICAgICAgICAgICBjID0gdDtcbiAgICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICB9XG5cbiAgICBoYW5kbGVBbmRyb2lkSW5wdXQoZTogRXZlbnQpIHtcbiAgICAgICAgdmFyIGN1clZhbCA9IHRoaXMuaW5wdXRWaWV3Q2hpbGQ/Lm5hdGl2ZUVsZW1lbnQudmFsdWU7XG4gICAgICAgIHZhciBwb3MgPSB0aGlzLmNhcmV0KCkgYXMgQ2FyZXQ7XG4gICAgICAgIGlmICh0aGlzLm9sZFZhbCAmJiB0aGlzLm9sZFZhbC5sZW5ndGggJiYgdGhpcy5vbGRWYWwubGVuZ3RoID4gY3VyVmFsLmxlbmd0aCkge1xuICAgICAgICAgICAgLy8gYSBkZWxldGlvbiBvciBiYWNrc3BhY2UgaGFwcGVuZWRcbiAgICAgICAgICAgIHRoaXMuY2hlY2tWYWwodHJ1ZSk7XG4gICAgICAgICAgICB3aGlsZSAocG9zLmJlZ2luID4gMCAmJiAhdGhpcy50ZXN0c1twb3MuYmVnaW4gLSAxXSkgcG9zLmJlZ2luLS07XG4gICAgICAgICAgICBpZiAocG9zLmJlZ2luID09PSAwKSB7XG4gICAgICAgICAgICAgICAgd2hpbGUgKHBvcy5iZWdpbiA8ICh0aGlzLmZpcnN0Tm9uTWFza1BvcyBhcyBudW1iZXIpICYmICF0aGlzLnRlc3RzW3Bvcy5iZWdpbl0pIHBvcy5iZWdpbisrO1xuICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICBzZXRUaW1lb3V0KCgpID0+IHtcbiAgICAgICAgICAgICAgICB0aGlzLmNhcmV0KHBvcy5iZWdpbiwgcG9zLmJlZ2luKTtcbiAgICAgICAgICAgICAgICB0aGlzLnVwZGF0ZU1vZGVsKGUpO1xuICAgICAgICAgICAgICAgIGlmICh0aGlzLmlzQ29tcGxldGVkKCkpIHtcbiAgICAgICAgICAgICAgICAgICAgdGhpcy5vbkNvbXBsZXRlLmVtaXQoKTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9LCAwKTtcbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgIHRoaXMuY2hlY2tWYWwodHJ1ZSk7XG4gICAgICAgICAgICB3aGlsZSAocG9zLmJlZ2luIDwgKHRoaXMubGVuIGFzIG51bWJlcikgJiYgIXRoaXMudGVzdHNbcG9zLmJlZ2luXSkgcG9zLmJlZ2luKys7XG5cbiAgICAgICAgICAgIHNldFRpbWVvdXQoKCkgPT4ge1xuICAgICAgICAgICAgICAgIHRoaXMuY2FyZXQocG9zLmJlZ2luLCBwb3MuYmVnaW4pO1xuICAgICAgICAgICAgICAgIHRoaXMudXBkYXRlTW9kZWwoZSk7XG4gICAgICAgICAgICAgICAgaWYgKHRoaXMuaXNDb21wbGV0ZWQoKSkge1xuICAgICAgICAgICAgICAgICAgICB0aGlzLm9uQ29tcGxldGUuZW1pdCgpO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH0sIDApO1xuICAgICA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gICAgICAgICAgdGhpcy5zaGlmdEwoYmVnaW4sIGVuZCAtIDEpO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgdGhpcy51cGRhdGVNb2RlbChlKTtcbiAgICAgICAgICAgIHRoaXMub25JbnB1dC5lbWl0KGUpO1xuXG4gICAgICAgICAgICBlLnByZXZlbnREZWZhdWx0KCk7XG4gICAgICAgIH0gZWxzZSBpZiAoayA9PT0gMTMpIHtcbiAgICAgICAgICAgIC8vIGVudGVyXG4gICAgICAgICAgICB0aGlzLm9uSW5wdXRCbHVyKGUpO1xuICAgICAgICAgICAgdGhpcy51cGRhdGVNb2RlbChlKTtcbiAgICAgICAgfSBlbHNlIGlmIChrID09PSAyNykge1xuICAgICAgICAgICAgLy8gZXNjYXBlXG4gICAgICAgICAgICAodGhpcy5pbnB1dFZpZXdDaGlsZCBhcyBFbGVtZW50UmVmKS5uYXRpdmVFbGVtZW50LnZhbHVlID0gdGhpcy5mb2N1c1RleHQ7XG4gICAgICAgICAgICB0aGlzLmNhcmV0KDAsIHRoaXMuY2hlY2tWYWwoKSk7XG4gICAgICAgICAgICB0aGlzLnVwZGF0ZU1vZGVsKGUpO1xuXG4gICAgICAgICAgICBlLnByZXZlbnREZWZhdWx0KCk7XG4gICAgICAgIH1cbiAgICB9XG5cbiAgICBvbktleVByZXNzKGU6IEtleWJvYXJkRXZlbnQpIHtcbiAgICAgICAgaWYgKHRoaXMucmVhZG9ubHkpIHtcbiAgICAgICAgICAgIHJldHVybjtcbiAgICAgICAgfVxuXG4gICAgICAgIHZhciBrID0gZS53aGljaCB8fCBlLmtleUNvZGUsXG4gICAgICAgICAgICBwb3MgPSB0aGlzLmNhcmV0KCkgYXMgQ2FyZXQsXG4gICAgICAgICAgICBwOiBudW1iZXIsXG4gICAgICAgICAgICBjOiBzdHJpbmcsXG4gICAgICAgICAgICBuZXh0OiBudW1iZXIsXG4gICAgICAgICAgICBjb21wbGV0ZWQhOiBib29sZWFuO1xuXG4gICAgICAgIGlmIChlLmN0cmxLZXkgfHwgZS5hbHRLZXkgfHwgZS5tZXRhS2V5IHx8IGsgPCAzMiB8fCAoayA+IDM0ICYmIGsgPCA0MSkpIHtcbiAgICAgICAgICAgIC8vSWdub3JlXG4gICAgICAgICAgICByZXR1cm47XG4gICAgICAgIH0gZWxzZSBpZiAoayAmJiBrICE9PSAxMykge1xuICAgICAgICAgICAgaWYgKHBvcy5lbmQgLSBwb3MuYmVnaW4gIT09IDApIHtcbiAgICAgICAgICAgICAgICB0aGlzLmNsZWFyQnVmZmVyKHBvcy5iZWdpbiwgcG9zLmVuZCk7XG4gICAgICAgICAgICAgICAgdGhpcy5zaGlmdEwocG9zLmJlZ2luLCBwb3MuZW5kIC0gMSk7XG4gICAgICAgICAgICB9XG5cbiAgICAgICAgICAgIHAgPSB0aGlzLnNlZWtOZXh0KHBvcy5iZWdpbiAtIDEpO1xuICAgICAgICAgICAgaWYgKHAgPCAodGhpcy5sZW4gYXMgbnVtYmVyKSkge1xuICAgICAgICAgICAgICAgIGMgPSBTdHJpbmcuZnJvbUNoYXJDb2RlKGspO1xuICAgICAgICAgICAgICAgIGlmICh0aGlzLnRlc3RzW3BdLnRlc3QoYykpIHtcbiAgICAgICAgICAgICAgICAgICAgdGhpcy5zaGlmdFIocCk7XG5cbiAgICAgICAgICAgICAgICAgICAgdGhpcy5idWZmZXJbcF0gPSBjO1xuICAgICAgICAgICAgICAgICAgICB0aGlzLndyaXRlQnVmZmVyKCk7XG4gICAgICAgICAgICAgICAgICAgIG5leHQgPSB0aGlzLnNlZWtOZXh0KHApO1xuXG4gICAgICAgICAgICAgICAgICAgIGlmIChEb21IYW5kbGVyLmlzQ2xpZW50KCkgJiYgL2FuZHJvaWQvaS50ZXN0KERvbUhhbmRsZXIuZ2V0VXNlckFnZW50KCkpKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBsZXQgcHJveHkgPSAoKSA9PiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdGhpcy5jYXJldChuZXh0KTtcbiAgICAgICAgICAgICAgICAgICAgICAgIH07XG5cbiAgICAgICAgICAgICAgICAgICAgICAgIHNldFRpbWVvdXQocHJveHksIDApO1xuICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICAgICAgdGhpcy5jYXJldChuZXh0KTtcbiAgICAgICAgICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAgICAgICAgIGlmIChwb3MuYmVnaW4gPD0gKHRoaXMubGFzdFJlcXVpcmVkTm9uTWFza1BvcyBhcyBudW1iZXIpKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBjb21wbGV0ZWQgPSB0aGlzLmlzQ29tcGxldGVkKCk7XG4gICAgICAgICAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgICAgICAgICB0aGlzLm9uSW5wdXQuZW1pdChlKTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBlLnByZXZlbnREZWZhdWx0KCk7XG4gICAgICAgIH1cblxuICAgICAgICB0aGlzLnVwZGF0ZU1vZGVsKGUpO1xuXG4gICAgICAgIHRoaXMudXBkYXRlRmlsbGVkU3RhdGUoKTtcblxuICAgICAgICBpZiAoY29tcGxldGVkKSB7XG4gICAgICAgICAgICB0aGlzLm9uQ29tcGxldGUuZW1pdCgpO1xuICAgICAgICB9XG4gICAgfVxuXG4gICAgY2xlYXJCdWZmZXIoc3RhcnQ6IG51bWJlciwgZW5kOiBudW1iZXIpIHtcbiAgICAgICAgaWYgKCF0aGlzLmtlZXBCdWZmZXIpIHtcbiAgICAgICAgICAgIGxldCBpO1xuICAgICAgICAgICAgZm9yIChpID0gc3RhcnQ7IGkgPCBlbmQgJiYgaSA8ICh0aGlzLmxlbiBhcyBudW1iZXIpOyBpKyspIHtcbiAgICAgICAgICAgICAgICBpZiAodGhpcy50ZXN0c1tpXSkge1xuICAgICAgICAgICAgICAgICAgICB0aGlzLmJ1ZmZlcltpXSA9IHRoaXMuZ2V0UGxhY2Vob2xkZXIoaSk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuICAgICAgICB9XG4gICAgfVxuXG4gICAgd3JpdGVCdWZmZXIoKSB7XG4gICAgICAgICh0aGlzLmlucHV0Vmlld0NoaWxkIGFzIEVsZW1lbnRSZWYpLm5hdGl2ZUVsZW1lbnQudmFsdWUgPSB0aGlzLmJ1ZmZlci5qb2luKCcnKTtcbiAgICB9XG5cbiAgICBjaGVja1ZhbChhbGxvdz86IGJvb2xlYW4pOiBudW1iZXIge1xuICAgICAgICAvL3RyeSB0byBwbGFjZSBjaGFyYWN0ZXJzIHdoZXJlIHRoZXkgYmVsb25nXG4gICAgICAgIGxldCB0ZXN0ID0gdGhpcy5pbnB1dFZpZXdDaGlsZD8ubmF0aXZlRWxlbWVudC52YWx1ZSxcbiAgICAgICAgICAgIGxhc3RNYXRjaCA9IC0xLFxuICAgICAgICAgICAgaSxcbiAgICAgICAgICAgIGMsXG4gICAgICAgICAgICBwb3M7XG5cbiAgICAgICAgZm9yIChpID0gMCwgcG9zID0gMDsgaSA8ICh0aGlzLmxlbiBhcyBudW1iZXIpOyBpKyspIHtcbiAgICAgICAgICAgIGlmICh0aGlzLnRlc3RzW2ldKSB7XG4gICAgICAgICAgICAgICAgdGhpcy5idWZmZXJbaV0gPSB0aGlzLmdldFBsYWNlaG9sZGVyKGkpO1xuICAgICAgICAgICAgICAgIHdoaWxlIChwb3MrKyA8IHRlc3QubGVuZ3RoKSB7XG4gICAgICAgICAgICAgICAgICAgIGMgPSB0ZXN0LmNoYXJBdChwb3MgLSAxKTtcbiAgICAgICAgICAgICAgICAgICAgaWYgKHRoaXMudGVzdHNbaV0udGVzdChjKSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKCF0aGlzLmtlZXBCdWZmZXIpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB0aGlzLmJ1ZmZlcltpXSA9IGM7XG4gICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICBsYXN0TWF0Y2ggPSBpO1xuICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgaWYgKHBvcyA+IHRlc3QubGVuZ3RoKSB7XG4gICAgICAgICAgICAgICAgICAgIHRoaXMuY2xlYXJCdWZmZXIoaSArIDEsIHRoaXMubGVuIGFzIG51bWJlcik7XG4gICAgICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgaWYgKHRoaXMuYnVmZmVyW2ldID09PSB0ZXN0LmNoYXJBdChwb3MpKSB7XG4gICAgICAgICAgICAgICAgICAgIHBvcysrO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICBpZiAoaSA8ICh0aGlzLnBhcnRpYWxQb3NpdGlvbiBhcyBudW1iZXIpKSB7XG4gICAgICAgICAgICAgICAgICAgIGxhc3RNYXRjaCA9IGk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICAgIGlmIChhbGxvdykge1xuICAgICAgICAgICAgdGhpcy53cml0ZUJ1ZmZlcigpO1xuICAgICAgICB9IGVsc2UgaWYgKGxhc3RNYXRjaCArIDEgPCAodGhpcy5wYXJ0aWFsUG9zaXRpb24gYXMgbnVtYmVyKSkge1xuICAgICAgICAgICAgaWYgKHRoaXMuYXV0b0NsZWFyIHx8IHRoaXMuYnVmZmVyLmpvaW4oJycpID09PSB0aGlzLmRlZmF1bHRCdWZmZXIpIHtcbiAgICAgICAgICAgICAgICAvLyBJbnZhbGlkIHZhbHVlLiBSZW1vdmUgaXQgYW5kIHJlcGxhY2UgaXQgd2l0aCB0aGVcbiAgICAgICAgICAgICAgICAvLyBtYXNrLCB3aGljaCBpcyB0aGUgZGVmYXVsdCBiZW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XZlbnQpO1xuXG4gICAgICAgIHRoaXMub25JbnB1dC5lbWl0KGV2ZW50KTtcbiAgICB9XG5cbiAgICBoYW5kbGVJbnB1dENoYW5nZShldmVudDogRXZlbnQpIHtcbiAgICAgICAgaWYgKHRoaXMucmVhZG9ubHkpIHtcbiAgICAgICAgICAgIHJldHVybjtcbiAgICAgICAgfVxuXG4gICAgICAgIHNldFRpbWVvdXQoKCkgPT4ge1xuICAgICAgICAgICAgdmFyIHBvcyA9IHRoaXMuY2hlY2tWYWwodHJ1ZSk7XG4gICAgICAgICAgICB0aGlzLmNhcmV0KHBvcyk7XG4gICAgICAgICAgICB0aGlzLnVwZGF0ZU1vZGVsKGV2ZW50KTtcbiAgICAgICAgICAgIGlmICh0aGlzLmlzQ29tcGxldGVkKCkpIHtcbiAgICAgICAgICAgICAgICB0aGlzLm9uQ29tcGxldGUuZW1pdCgpO1xuICAgICAgICAgICAgfVxuICAgICAgICB9LCAwKTtcbiAgICB9XG5cbiAgICBnZXRVbm1hc2tlZFZhbHVlKCkge1xuICAgICAgICBsZXQgdW5tYXNrZWRCdWZmZXIgPSBbXTtcbiAgICAgICAgZm9yIChsZXQgaSA9IDA7IGkgPCB0aGlzLmJ1ZmZlci5sZW5ndGg7IGkrKykge1xuICAgICAgICAgICAgbGV0IGMgPSB0aGlzLmJ1ZmZlcltpXTtcbiAgICAgICAgICAgIGlmICh0aGlzLnRlc3RzW2ldICYmIGMgIT0gdGhpcy5nZXRQbGFjZWhvbGRlcihpKSkge1xuICAgICAgICAgICAgICAgIHVubWFza2VkQnVmZmVyLnB1c2goYyk7XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cblxuICAgICAgICByZXR1cm4gdW5tYXNrZWRCdWZmZXIuam9pbignJyk7XG4gICAgfVxuXG4gICAgdXBkYXRlTW9kZWwoZTogRXZlbnQpIHtcbiAgICAgICAgY29uc3QgdXBkYXRlZFZhbHVlID0gdGhpcy51bm1hc2sgPyB0aGlzLmdldFVubWFza2VkVmFsdW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