TimeTrex/interface/html5/dist/dynamic-editview-primevue-dropdown.bundle.js

1 line
178 KiB
JavaScript

"use strict";(self.webpackChunktimetrex=self.webpackChunktimetrex||[]).push([["dynamic-editview-primevue-dropdown"],{6635:(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{eval('__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)\n/* harmony export */ });\n/* harmony import */ var primevue_utils__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(6954);\n/* harmony import */ var primevue_overlayeventbus__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(590);\n/* harmony import */ var primevue_api__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(6358);\n/* harmony import */ var primevue_ripple__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(4019);\n/* harmony import */ var primevue_virtualscroller__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(921);\n/* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(5166);\n\n\n\n\n\n\n\nvar script = {\n name: \'Dropdown\',\n emits: [\'update:modelValue\', \'before-show\', \'before-hide\', \'show\', \'hide\', \'change\', \'filter\', \'focus\', \'blur\'],\n props: {\n modelValue: null,\n options: Array,\n optionLabel: null,\n optionValue: null,\n optionDisabled: null,\n optionGroupLabel: null,\n optionGroupChildren: null,\n\t\tscrollHeight: {\n\t\t\ttype: String,\n\t\t\tdefault: \'200px\'\n\t\t},\n\t\tfilter: Boolean,\n filterPlaceholder: String,\n filterLocale: String,\n filterMatchMode: {\n type: String,\n default: \'contains\'\n },\n filterFields: {\n type: Array,\n default: null\n },\n\t\teditable: Boolean,\n\t\tplaceholder: String,\n\t\tdisabled: Boolean,\n dataKey: null,\n showClear: Boolean,\n inputId: String,\n tabindex: String,\n ariaLabelledBy: null,\n appendTo: {\n type: String,\n default: \'body\'\n },\n emptyFilterMessage: {\n type: String,\n default: null\n },\n emptyMessage: {\n type: String,\n default: null\n },\n panelClass: null,\n loading: {\n type: Boolean,\n default: false\n },\n loadingIcon: {\n type: String,\n default: \'pi pi-spinner pi-spin\'\n },\n virtualScrollerOptions: {\n type: Object,\n default: null\n }\n },\n data() {\n return {\n focused: false,\n filterValue: null,\n overlayVisible: false\n };\n },\n watch: {\n modelValue() {\n this.isModelValueChanged = true;\n }\n },\n outsideClickListener: null,\n scrollHandler: null,\n resizeListener: null,\n searchTimeout: null,\n currentSearchChar: null,\n previousSearchChar: null,\n searchValue: null,\n overlay: null,\n itemsWrapper: null,\n virtualScroller: null,\n isModelValueChanged: false,\n updated() {\n if (this.overlayVisible && this.isModelValueChanged) {\n this.scrollValueInView();\n }\n\n this.isModelValueChanged = false;\n },\n beforeUnmount() {\n this.unbindOutsideClickListener();\n this.unbindResizeListener();\n\n if (this.scrollHandler) {\n this.scrollHandler.destroy();\n this.scrollHandler = null;\n }\n\n this.itemsWrapper = null;\n\n if (this.overlay) {\n primevue_utils__WEBPACK_IMPORTED_MODULE_0__/* .ZIndexUtils.clear */ .P9.clear(this.overlay);\n this.overlay = null;\n }\n },\n methods: {\n getOptionIndex(index, fn) {\n return this.virtualScrollerDisabled ? index : (fn && fn(index)[\'index\']);\n },\n getOptionLabel(option) {\n return this.optionLabel ? primevue_utils__WEBPACK_IMPORTED_MODULE_0__/* .ObjectUtils.resolveFieldData */ .gb.resolveFieldData(option, this.optionLabel) : option;\n },\n getOptionValue(option) {\n return this.optionValue ? primevue_utils__WEBPACK_IMPORTED_MODULE_0__/* .ObjectUtils.resolveFieldData */ .gb.resolveFieldData(option, this.optionValue) : option;\n },\n getOptionRenderKey(option) {\n return this.dataKey ? primevue_utils__WEBPACK_IMPORTED_MODULE_0__/* .ObjectUtils.resolveFieldData */ .gb.resolveFieldData(option, this.dataKey) : this.getOptionLabel(option);\n },\n isOptionDisabled(option) {\n return this.optionDisabled ? primevue_utils__WEBPACK_IMPORTED_MODULE_0__/* .ObjectUtils.resolveFieldData */ .gb.resolveFieldData(option, this.optionDisabled) : false;\n },\n getOptionGroupRenderKey(optionGroup) {\n return primevue_utils__WEBPACK_IMPORTED_MODULE_0__/* .ObjectUtils.resolveFieldData */ .gb.resolveFieldData(optionGroup, this.optionGroupLabel);\n },\n getOptionGroupLabel(optionGroup) {\n return primevue_utils__WEBPACK_IMPORTED_MODULE_0__/* .ObjectUtils.resolveFieldData */ .gb.resolveFieldData(optionGroup, this.optionGroupLabel);\n },\n getOptionGroupChildren(optionGroup) {\n return primevue_utils__WEBPACK_IMPORTED_MODULE_0__/* .ObjectUtils.resolveFieldData */ .gb.resolveFieldData(optionGroup, this.optionGroupChildren);\n },\n getSelectedOption() {\n let index = this.getSelectedOptionIndex();\n return index !== -1 ? (this.optionGroupLabel ? this.getOptionGroupChildren(this.visibleOptions[index.group])[index.option]: this.visibleOptions[index]) : null;\n },\n getSelectedOptionIndex() {\n if (this.modelValue != null && this.visibleOptions) {\n if (this.optionGroupLabel) {\n for (let i = 0; i < this.visibleOptions.length; i++) {\n let selectedOptionIndex = this.findOptionIndexInList(this.modelValue, this.getOptionGroupChildren(this.visibleOptions[i]));\n if (selectedOptionIndex !== -1) {\n return {group: i, option: selectedOptionIndex};\n }\n }\n }\n else {\n return this.findOptionIndexInList(this.modelValue, this.visibleOptions);\n }\n }\n\n return -1;\n },\n findOptionIndexInList(value, list) {\n for (let i = 0; i < list.length; i++) {\n if ((primevue_utils__WEBPACK_IMPORTED_MODULE_0__/* .ObjectUtils.equals */ .gb.equals(value, this.getOptionValue(list[i]), this.equalityKey))) {\n return i;\n }\n }\n\n return -1;\n },\n isSelected(option) {\n return primevue_utils__WEBPACK_IMPORTED_MODULE_0__/* .ObjectUtils.equals */ .gb.equals(this.modelValue, this.getOptionValue(option), this.equalityKey);\n },\n show() {\n this.$emit(\'before-show\');\n this.overlayVisible = true;\n },\n hide() {\n this.$emit(\'before-hide\');\n this.overlayVisible = false;\n },\n onFocus(event) {\n this.focused = true;\n this.$emit(\'focus\', event);\n },\n onBlur(event) {\n this.focused = false;\n this.$emit(\'blur\', event);\n },\n onKeyDown(event) {\n switch(event.which) {\n //down\n case 40:\n this.onDownKey(event);\n break;\n\n //up\n case 38:\n this.onUpKey(event);\n break;\n\n //space\n case 32:\n if (!this.overlayVisible) {\n this.show();\n event.preventDefault();\n }\n break;\n\n //enter and escape\n case 13:\n case 27:\n if (this.overlayVisible) {\n this.hide();\n event.preventDefault();\n }\n break;\n\n //tab\n case 9:\n this.hide();\n break;\n\n default:\n this.search(event);\n break;\n }\n },\n onFilterKeyDown(event) {\n switch (event.which) {\n //down\n case 40:\n this.onDownKey(event);\n break;\n\n //up\n case 38:\n this.onUpKey(event);\n break;\n\n //enter and escape\n case 13:\n case 27:\n this.overlayVisible = false;\n event.preventDefault();\n break;\n }\n },\n onDownKey(event) {\n if (this.visibleOptions) {\n if (!this.overlayVisible && event.altKey) {\n this.show();\n }\n else {\n let nextOption = this.visibleOptions && this.visibleOptions.length > 0 ? this.findNextOption(this.getSelectedOptionIndex()) : null;\n if (nextOption) {\n this.updateModel(event, this.getOptionValue(nextOption));\n }\n }\n }\n\n event.preventDefault();\n },\n onUpKey(event) {\n if (this.visibleOptions) {\n let prevOption = this.findPrevOption(this.getSelectedOptionIndex());\n if (prevOption) {\n this.updateModel(event, this.getOptionValue(prevOption));\n }\n }\n\n event.preventDefault();\n },\n findNextOption(index) {\n if (this.optionGroupLabel) {\n let groupIndex = index === -1 ? 0 : index.group;\n let optionIndex = index === -1 ? -1 : index.option;\n let option = this.findNextOptionInList(this.getOptionGroupChildren(this.visibleOptions[groupIndex]), optionIndex);\n\n if (option)\n return option;\n else if ((groupIndex + 1) !== this.visibleOptions.length)\n return this.findNextOption({group: (groupIndex + 1), option: -1});\n else\n return null;\n }\n else {\n return this.findNextOptionInList(this.visibleOptions, index);\n }\n },\n findNextOptionInList(list, index) {\n let i = index + 1;\n if (i === list.length) {\n return null;\n }\n\n let option = list[i];\n if (this.isOptionDisabled(option))\n return this.findNextOptionInList(i);\n else\n return option;\n },\n findPrevOption(index) {\n if (index === -1) {\n return null;\n }\n\n if (this.optionGroupLabel) {\n let groupIndex = index.group;\n let optionIndex = index.option;\n let option = this.findPrevOptionInList(this.getOptionGroupChildren(this.visibleOptions[groupIndex]), optionIndex);\n\n if (option)\n return option;\n else if (groupIndex > 0)\n return this.findPrevOption({group: (groupIndex - 1), option: this.getOptionGroupChildren(this.visibleOptions[groupIndex - 1]).length});\n else\n return null;\n }\n else {\n return this.findPrevOptionInList(this.visibleOptions, index);\n }\n },\n findPrevOptionInList(list, index) {\n let i = index - 1;\n if (i < 0) {\n return null;\n }\n\n let option = list[i];\n if (this.isOptionDisabled(option))\n return this.findPrevOption(i);\n else\n return option;\n },\n onClearClick(event) {\n this.updateModel(event, null);\n },\n onClick(event) {\n if (this.disabled || this.loading) {\n return;\n }\n\n if (primevue_utils__WEBPACK_IMPORTED_MODULE_0__/* .DomHandler.hasClass */ .p7.hasClass(event.target, \'p-dropdown-clear-icon\') || event.target.tagName === \'INPUT\') {\n return;\n }\n else if (!this.overlay || !this.overlay.contains(event.target)) {\n if (this.overlayVisible)\n this.hide();\n else\n this.show();\n\n this.$refs.focusInput.focus();\n }\n },\n onOptionSelect(event, option) {\n let value = this.getOptionValue(option);\n this.updateModel(event, value);\n this.$refs.focusInput.focus();\n\n setTimeout(() => {\n this.hide();\n }, 200);\n },\n onEditableInput(event) {\n this.$emit(\'update:modelValue\', event.target.value);\n },\n onOverlayEnter(el) {\n primevue_utils__WEBPACK_IMPORTED_MODULE_0__/* .ZIndexUtils.set */ .P9.set(\'overlay\', el, this.$primevue.config.zIndex.overlay);\n this.alignOverlay();\n this.bindOutsideClickListener();\n this.bindScrollListener();\n this.bindResizeListener();\n this.scrollValueInView();\n\n if (this.filter) {\n this.$refs.filterInput.focus();\n }\n\n if (!this.virtualScrollerDisabled) {\n const selectedIndex = this.getSelectedOptionIndex();\n if (selectedIndex !== -1) {\n this.virtualScroller.scrollToIndex(selectedIndex);\n }\n }\n\n this.$emit(\'show\');\n },\n onOverlayLeave() {\n this.unbindOutsideClickListener();\n this.unbindScrollListener();\n this.unbindResizeListener();\n this.$emit(\'hide\');\n this.itemsWrapper = null;\n this.overlay = null;\n },\n onOverlayAfterLeave(el) {\n primevue_utils__WEBPACK_IMPORTED_MODULE_0__/* .ZIndexUtils.clear */ .P9.clear(el);\n },\n alignOverlay() {\n if (this.appendDisabled) {\n primevue_utils__WEBPACK_IMPORTED_MODULE_0__/* .DomHandler.relativePosition */ .p7.relativePosition(this.overlay, this.$el);\n }\n else {\n this.overlay.style.minWidth = primevue_utils__WEBPACK_IMPORTED_MODULE_0__/* .DomHandler.getOuterWidth */ .p7.getOuterWidth(this.$el) + \'px\';\n primevue_utils__WEBPACK_IMPORTED_MODULE_0__/* .DomHandler.absolutePosition */ .p7.absolutePosition(this.overlay, this.$el);\n }\n },\n updateModel(event, value) {\n this.$emit(\'update:modelValue\', value);\n this.$emit(\'change\', {originalEvent: event, value: value});\n },\n bindOutsideClickListener() {\n if (!this.outsideClickListener) {\n this.outsideClickListener = (event) => {\n if (this.overlayVisible && this.overlay && !this.$el.contains(event.target) && !this.overlay.contains(event.target)) {\n this.hide();\n }\n };\n document.addEventListener(\'click\', this.outsideClickListener);\n }\n },\n unbindOutsideClickListener() {\n if (this.outsideClickListener) {\n document.removeEventListener(\'click\', this.outsideClickListener);\n this.outsideClickListener = null;\n }\n },\n bindScrollListener() {\n if (!this.scrollHandler) {\n this.scrollHandler = new primevue_utils__WEBPACK_IMPORTED_MODULE_0__/* .ConnectedOverlayScrollHandler */ .Vr(this.$refs.container, () => {\n if (this.overlayVisible) {\n this.hide();\n }\n });\n }\n\n this.scrollHandler.bindScrollListener();\n },\n unbindScrollListener() {\n if (this.scrollHandler) {\n this.scrollHandler.unbindScrollListener();\n }\n },\n bindResizeListener() {\n if (!this.resizeListener) {\n this.resizeListener = () => {\n if (this.overlayVisible && !primevue_utils__WEBPACK_IMPORTED_MODULE_0__/* .DomHandler.isTouchDevice */ .p7.isTouchDevice()) {\n this.hide();\n }\n };\n window.addEventListener(\'resize\', this.resizeListener);\n }\n },\n unbindResizeListener() {\n if (this.resizeListener) {\n window.removeEventListener(\'resize\', this.resizeListener);\n this.resizeListener = null;\n }\n },\n search(event) {\n if (!this.visibleOptions) {\n return;\n }\n\n if (this.searchTimeout) {\n clearTimeout(this.searchTimeout);\n }\n\n const char = event.key;\n this.previousSearchChar = this.currentSearchChar;\n this.currentSearchChar = char;\n\n if (this.previousSearchChar === this.currentSearchChar)\n this.searchValue = this.currentSearchChar;\n else\n this.searchValue = this.searchValue ? this.searchValue + char : char;\n\n if (this.searchValue) {\n let searchIndex = this.getSelectedOptionIndex();\n let newOption = this.optionGroupLabel ? this.searchOptionInGroup(searchIndex) : this.searchOption(++searchIndex);\n if (newOption) {\n this.updateModel(event, this.getOptionValue(newOption));\n }\n }\n\n this.searchTimeout = setTimeout(() => {\n this.searchValue = null;\n }, 250);\n },\n searchOption(index) {\n let option;\n\n if (this.searchValue) {\n option = this.searchOptionInRange(index, this.visibleOptions.length);\n\n if (!option) {\n option = this.searchOptionInRange(0, index);\n }\n }\n\n return option;\n },\n searchOptionInRange(start, end) {\n for (let i = start; i < end; i++) {\n let opt = this.visibleOptions[i];\n if (this.matchesSearchValue(opt)) {\n return opt;\n }\n }\n\n return null;\n },\n searchOptionInGroup(index) {\n let searchIndex = index === -1 ? {group: 0, option: -1} : index;\n\n for (let i = searchIndex.group; i < this.visibleOptions.length; i++) {\n let groupOptions = this.getOptionGroupChildren(this.visibleOptions[i]);\n for (let j = (searchIndex.group === i ? searchIndex.option + 1 : 0); j < groupOptions.length; j++) {\n if (this.matchesSearchValue(groupOptions[j])) {\n return groupOptions[j];\n }\n }\n }\n\n for (let i = 0; i <= searchIndex.group; i++) {\n let groupOptions = this.getOptionGroupChildren(this.visibleOptions[i]);\n for (let j = 0; j < (searchIndex.group === i ? searchIndex.option: groupOptions.length); j++) {\n if (this.matchesSearchValue(groupOptions[j])) {\n return groupOptions[j];\n }\n }\n }\n\n return null;\n },\n matchesSearchValue(option) {\n let label = this.getOptionLabel(option).toLocaleLowerCase(this.filterLocale);\n return label.startsWith(this.searchValue.toLocaleLowerCase(this.filterLocale));\n },\n onFilterChange(event) {\n this.$emit(\'filter\', {originalEvent: event, value: event.target.value});\n },\n onFilterUpdated() {\n if (this.overlayVisible) {\n this.alignOverlay();\n }\n },\n overlayRef(el) {\n this.overlay = el;\n },\n itemsWrapperRef(el) {\n this.itemsWrapper = el;\n },\n virtualScrollerRef(el) {\n this.virtualScroller = el;\n },\n scrollValueInView() {\n if (this.overlay) {\n let selectedItem = primevue_utils__WEBPACK_IMPORTED_MODULE_0__/* .DomHandler.findSingle */ .p7.findSingle(this.overlay, \'li.p-highlight\');\n if (selectedItem) {\n selectedItem.scrollIntoView({ block: \'nearest\', inline: \'start\' });\n }\n }\n },\n onOverlayClick(event) {\n primevue_overlayeventbus__WEBPACK_IMPORTED_MODULE_1__/* ["default"].emit */ .Z.emit(\'overlay-click\', {\n originalEvent: event,\n target: this.$el\n });\n }\n },\n computed: {\n visibleOptions() {\n if (this.filterValue) {\n if (this.optionGroupLabel) {\n let filteredGroups = [];\n for (let optgroup of this.options) {\n let filteredSubOptions = primevue_api__WEBPACK_IMPORTED_MODULE_2__/* .FilterService.filter */ .iZ.filter(this.getOptionGroupChildren(optgroup), this.searchFields, this.filterValue, this.filterMatchMode, this.filterLocale);\n if (filteredSubOptions && filteredSubOptions.length) {\n let filteredGroup = {...optgroup};\n filteredGroup[this.optionGroupChildren] = filteredSubOptions;\n filteredGroups.push(filteredGroup);\n }\n }\n return filteredGroups\n }\n else {\n return primevue_api__WEBPACK_IMPORTED_MODULE_2__/* .FilterService.filter */ .iZ.filter(this.options, this.searchFields, this.filterValue, this.filterMatchMode, this.filterLocale);\n }\n }\n else {\n return this.options;\n }\n },\n containerClass() {\n return [\n \'p-dropdown p-component p-inputwrapper\',\n {\n \'p-disabled\': this.disabled,\n \'p-dropdown-clearable\': this.showClear && !this.disabled,\n \'p-focus\': this.focused,\n \'p-inputwrapper-filled\': this.modelValue,\n \'p-inputwrapper-focus\': this.focused || this.overlayVisible\n }\n ];\n },\n labelClass() {\n return [\n \'p-dropdown-label p-inputtext\',\n {\n \'p-placeholder\': this.label === this.placeholder,\n \'p-dropdown-label-empty\': !this.$slots[\'value\'] && (this.label === \'p-emptylabel\' || this.label.length === 0)\n }\n ];\n },\n panelStyleClass() {\n return [\'p-dropdown-panel p-component\', this.panelClass, {\n \'p-input-filled\': this.$primevue.config.inputStyle === \'filled\',\n \'p-ripple-disabled\': this.$primevue.config.ripple === false\n }];\n },\n label() {\n let selectedOption = this.getSelectedOption();\n if (selectedOption)\n return this.getOptionLabel(selectedOption);\n else\n return this.placeholder||\'p-emptylabel\';\n },\n editableInputValue() {\n let selectedOption = this.getSelectedOption();\n if (selectedOption)\n return this.getOptionLabel(selectedOption);\n else\n return this.modelValue;\n },\n equalityKey() {\n return this.optionValue ? null : this.dataKey;\n },\n searchFields() {\n return this.filterFields || [this.optionLabel];\n },\n emptyFilterMessageText() {\n return this.emptyFilterMessage || this.$primevue.config.locale.emptyFilterMessage;\n },\n emptyMessageText() {\n return this.emptyMessage || this.$primevue.config.locale.emptyMessage;\n },\n appendDisabled() {\n return this.appendTo === \'self\';\n },\n virtualScrollerDisabled() {\n return !this.virtualScrollerOptions;\n },\n appendTarget() {\n return this.appendDisabled ? null : this.appendTo;\n },\n dropdownIconClass() {\n return [\'p-dropdown-trigger-icon\', this.loading ? this.loadingIcon : \'pi pi-chevron-down\'];\n }\n },\n directives: {\n \'ripple\': primevue_ripple__WEBPACK_IMPORTED_MODULE_3__/* ["default"] */ .Z\n },\n components: {\n \'VirtualScroller\': primevue_virtualscroller__WEBPACK_IMPORTED_MODULE_4__/* ["default"] */ .Z\n }\n};\n\nconst _hoisted_1 = { class: "p-hidden-accessible" };\nconst _hoisted_2 = {\n key: 0,\n class: "p-dropdown-header"\n};\nconst _hoisted_3 = { class: "p-dropdown-filter-container" };\nconst _hoisted_4 = /*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_5__/* .createVNode */ .Wm)("span", { class: "p-dropdown-filter-icon pi pi-search" }, null, -1);\nconst _hoisted_5 = { class: "p-dropdown-item-group" };\nconst _hoisted_6 = {\n key: 2,\n class: "p-dropdown-empty-message"\n};\nconst _hoisted_7 = {\n key: 3,\n class: "p-dropdown-empty-message"\n};\n\nfunction render(_ctx, _cache, $props, $setup, $data, $options) {\n const _component_VirtualScroller = (0,vue__WEBPACK_IMPORTED_MODULE_5__/* .resolveComponent */ .up)("VirtualScroller");\n const _directive_ripple = (0,vue__WEBPACK_IMPORTED_MODULE_5__/* .resolveDirective */ .Q2)("ripple");\n\n return ((0,vue__WEBPACK_IMPORTED_MODULE_5__/* .openBlock */ .wg)(), (0,vue__WEBPACK_IMPORTED_MODULE_5__/* .createBlock */ .j4)("div", {\n ref: "container",\n class: $options.containerClass,\n onClick: _cache[13] || (_cache[13] = $event => ($options.onClick($event)))\n }, [\n (0,vue__WEBPACK_IMPORTED_MODULE_5__/* .createVNode */ .Wm)("div", _hoisted_1, [\n (0,vue__WEBPACK_IMPORTED_MODULE_5__/* .createVNode */ .Wm)("input", {\n ref: "focusInput",\n type: "text",\n id: $props.inputId,\n readonly: "",\n disabled: $props.disabled,\n onFocus: _cache[1] || (_cache[1] = (...args) => ($options.onFocus && $options.onFocus(...args))),\n onBlur: _cache[2] || (_cache[2] = (...args) => ($options.onBlur && $options.onBlur(...args))),\n onKeydown: _cache[3] || (_cache[3] = (...args) => ($options.onKeyDown && $options.onKeyDown(...args))),\n tabindex: $props.tabindex,\n "aria-haspopup": "true",\n "aria-expanded": $data.overlayVisible,\n "aria-labelledby": $props.ariaLabelledBy\n }, null, 40, ["id", "disabled", "tabindex", "aria-expanded", "aria-labelledby"])\n ]),\n ($props.editable)\n ? ((0,vue__WEBPACK_IMPORTED_MODULE_5__/* .openBlock */ .wg)(), (0,vue__WEBPACK_IMPORTED_MODULE_5__/* .createBlock */ .j4)("input", {\n key: 0,\n type: "text",\n class: "p-dropdown-label p-inputtext",\n disabled: $props.disabled,\n onFocus: _cache[4] || (_cache[4] = (...args) => ($options.onFocus && $options.onFocus(...args))),\n onBlur: _cache[5] || (_cache[5] = (...args) => ($options.onBlur && $options.onBlur(...args))),\n placeholder: $props.placeholder,\n value: $options.editableInputValue,\n onInput: _cache[6] || (_cache[6] = (...args) => ($options.onEditableInput && $options.onEditableInput(...args))),\n "aria-haspopup": "listbox",\n "aria-expanded": $data.overlayVisible\n }, null, 40, ["disabled", "placeholder", "value", "aria-expanded"]))\n : (0,vue__WEBPACK_IMPORTED_MODULE_5__/* .createCommentVNode */ .kq)("", true),\n (!$props.editable)\n ? ((0,vue__WEBPACK_IMPORTED_MODULE_5__/* .openBlock */ .wg)(), (0,vue__WEBPACK_IMPORTED_MODULE_5__/* .createBlock */ .j4)("span", {\n key: 1,\n class: $options.labelClass\n }, [\n (0,vue__WEBPACK_IMPORTED_MODULE_5__/* .renderSlot */ .WI)(_ctx.$slots, "value", {\n value: $props.modelValue,\n placeholder: $props.placeholder\n }, () => [\n (0,vue__WEBPACK_IMPORTED_MODULE_5__/* .createTextVNode */ .Uk)((0,vue__WEBPACK_IMPORTED_MODULE_5__/* .toDisplayString */ .zw)($options.label||\'empty\'), 1)\n ])\n ], 2))\n : (0,vue__WEBPACK_IMPORTED_MODULE_5__/* .createCommentVNode */ .kq)("", true),\n ($props.showClear && $props.modelValue != null)\n ? ((0,vue__WEBPACK_IMPORTED_MODULE_5__/* .openBlock */ .wg)(), (0,vue__WEBPACK_IMPORTED_MODULE_5__/* .createBlock */ .j4)("i", {\n key: 2,\n class: "p-dropdown-clear-icon pi pi-times",\n onClick: _cache[7] || (_cache[7] = $event => ($options.onClearClick($event)))\n }))\n : (0,vue__WEBPACK_IMPORTED_MODULE_5__/* .createCommentVNode */ .kq)("", true),\n (0,vue__WEBPACK_IMPORTED_MODULE_5__/* .createVNode */ .Wm)("div", {\n class: "p-dropdown-trigger",\n role: "button",\n "aria-haspopup": "listbox",\n "aria-expanded": $data.overlayVisible\n }, [\n (0,vue__WEBPACK_IMPORTED_MODULE_5__/* .renderSlot */ .WI)(_ctx.$slots, "indicator", {}, () => [\n (0,vue__WEBPACK_IMPORTED_MODULE_5__/* .createVNode */ .Wm)("span", { class: $options.dropdownIconClass }, null, 2)\n ])\n ], 8, ["aria-expanded"]),\n ((0,vue__WEBPACK_IMPORTED_MODULE_5__/* .openBlock */ .wg)(), (0,vue__WEBPACK_IMPORTED_MODULE_5__/* .createBlock */ .j4)(vue__WEBPACK_IMPORTED_MODULE_5__/* .Teleport */ .lR, {\n to: $options.appendTarget,\n disabled: $options.appendDisabled\n }, [\n (0,vue__WEBPACK_IMPORTED_MODULE_5__/* .createVNode */ .Wm)(vue__WEBPACK_IMPORTED_MODULE_5__/* .Transition */ .uT, {\n name: "p-connected-overlay",\n onEnter: $options.onOverlayEnter,\n onLeave: $options.onOverlayLeave,\n onAfterLeave: $options.onOverlayAfterLeave\n }, {\n default: (0,vue__WEBPACK_IMPORTED_MODULE_5__/* .withCtx */ .w5)(() => [\n ($data.overlayVisible)\n ? ((0,vue__WEBPACK_IMPORTED_MODULE_5__/* .openBlock */ .wg)(), (0,vue__WEBPACK_IMPORTED_MODULE_5__/* .createBlock */ .j4)("div", {\n key: 0,\n ref: $options.overlayRef,\n class: $options.panelStyleClass,\n onClick: _cache[12] || (_cache[12] = (...args) => ($options.onOverlayClick && $options.onOverlayClick(...args)))\n }, [\n (0,vue__WEBPACK_IMPORTED_MODULE_5__/* .renderSlot */ .WI)(_ctx.$slots, "header", {\n value: $props.modelValue,\n options: $options.visibleOptions\n }),\n ($props.filter)\n ? ((0,vue__WEBPACK_IMPORTED_MODULE_5__/* .openBlock */ .wg)(), (0,vue__WEBPACK_IMPORTED_MODULE_5__/* .createBlock */ .j4)("div", _hoisted_2, [\n (0,vue__WEBPACK_IMPORTED_MODULE_5__/* .createVNode */ .Wm)("div", _hoisted_3, [\n (0,vue__WEBPACK_IMPORTED_MODULE_5__/* .withDirectives */ .wy)((0,vue__WEBPACK_IMPORTED_MODULE_5__/* .createVNode */ .Wm)("input", {\n type: "text",\n ref: "filterInput",\n "onUpdate:modelValue": _cache[8] || (_cache[8] = $event => ($data.filterValue = $event)),\n onVnodeUpdated: _cache[9] || (_cache[9] = (...args) => ($options.onFilterUpdated && $options.onFilterUpdated(...args))),\n autoComplete: "off",\n class: "p-dropdown-filter p-inputtext p-component",\n placeholder: $props.filterPlaceholder,\n onKeydown: _cache[10] || (_cache[10] = (...args) => ($options.onFilterKeyDown && $options.onFilterKeyDown(...args))),\n onInput: _cache[11] || (_cache[11] = (...args) => ($options.onFilterChange && $options.onFilterChange(...args)))\n }, null, 40, ["placeholder"]), [\n [vue__WEBPACK_IMPORTED_MODULE_5__/* .vModelText */ .nr, $data.filterValue]\n ]),\n _hoisted_4\n ])\n ]))\n : (0,vue__WEBPACK_IMPORTED_MODULE_5__/* .createCommentVNode */ .kq)("", true),\n (0,vue__WEBPACK_IMPORTED_MODULE_5__/* .createVNode */ .Wm)("div", {\n ref: $options.itemsWrapperRef,\n class: "p-dropdown-items-wrapper",\n style: {\'max-height\': $options.virtualScrollerDisabled ? $props.scrollHeight : \'\'}\n }, [\n (0,vue__WEBPACK_IMPORTED_MODULE_5__/* .createVNode */ .Wm)(_component_VirtualScroller, (0,vue__WEBPACK_IMPORTED_MODULE_5__/* .mergeProps */ .dG)({ ref: $options.virtualScrollerRef }, $props.virtualScrollerOptions, {\n items: $options.visibleOptions,\n style: {\'height\': $props.scrollHeight},\n disabled: $options.virtualScrollerDisabled\n }), (0,vue__WEBPACK_IMPORTED_MODULE_5__/* .createSlots */ .Nv)({\n content: (0,vue__WEBPACK_IMPORTED_MODULE_5__/* .withCtx */ .w5)(({ styleClass, contentRef, items, getItemOptions }) => [\n (0,vue__WEBPACK_IMPORTED_MODULE_5__/* .createVNode */ .Wm)("ul", {\n ref: contentRef,\n class: [\'p-dropdown-items\', styleClass],\n role: "listbox"\n }, [\n (!$props.optionGroupLabel)\n ? ((0,vue__WEBPACK_IMPORTED_MODULE_5__/* .openBlock */ .wg)(true), (0,vue__WEBPACK_IMPORTED_MODULE_5__/* .createBlock */ .j4)(vue__WEBPACK_IMPORTED_MODULE_5__/* .Fragment */ .HY, { key: 0 }, (0,vue__WEBPACK_IMPORTED_MODULE_5__/* .renderList */ .Ko)(items, (option, i) => {\n return (0,vue__WEBPACK_IMPORTED_MODULE_5__/* .withDirectives */ .wy)(((0,vue__WEBPACK_IMPORTED_MODULE_5__/* .openBlock */ .wg)(), (0,vue__WEBPACK_IMPORTED_MODULE_5__/* .createBlock */ .j4)("li", {\n class: [\'p-dropdown-item\', {\'p-highlight\': $options.isSelected(option), \'p-disabled\': $options.isOptionDisabled(option)}],\n key: $options.getOptionRenderKey(option),\n onClick: $event => ($options.onOptionSelect($event, option)),\n role: "option",\n "aria-label": $options.getOptionLabel(option),\n "aria-selected": $options.isSelected(option)\n }, [\n (0,vue__WEBPACK_IMPORTED_MODULE_5__/* .renderSlot */ .WI)(_ctx.$slots, "option", {\n option: option,\n index: $options.getOptionIndex(i, getItemOptions)\n }, () => [\n (0,vue__WEBPACK_IMPORTED_MODULE_5__/* .createTextVNode */ .Uk)((0,vue__WEBPACK_IMPORTED_MODULE_5__/* .toDisplayString */ .zw)($options.getOptionLabel(option)), 1)\n ])\n ], 10, ["onClick", "aria-label", "aria-selected"])), [\n [_directive_ripple]\n ])\n }), 128))\n : ((0,vue__WEBPACK_IMPORTED_MODULE_5__/* .openBlock */ .wg)(true), (0,vue__WEBPACK_IMPORTED_MODULE_5__/* .createBlock */ .j4)(vue__WEBPACK_IMPORTED_MODULE_5__/* .Fragment */ .HY, { key: 1 }, (0,vue__WEBPACK_IMPORTED_MODULE_5__/* .renderList */ .Ko)(items, (optionGroup, i) => {\n return ((0,vue__WEBPACK_IMPORTED_MODULE_5__/* .openBlock */ .wg)(), (0,vue__WEBPACK_IMPORTED_MODULE_5__/* .createBlock */ .j4)(vue__WEBPACK_IMPORTED_MODULE_5__/* .Fragment */ .HY, {\n key: $options.getOptionGroupRenderKey(optionGroup)\n }, [\n (0,vue__WEBPACK_IMPORTED_MODULE_5__/* .createVNode */ .Wm)("li", _hoisted_5, [\n (0,vue__WEBPACK_IMPORTED_MODULE_5__/* .renderSlot */ .WI)(_ctx.$slots, "optiongroup", {\n option: optionGroup,\n index: $options.getOptionIndex(i, getItemOptions)\n }, () => [\n (0,vue__WEBPACK_IMPORTED_MODULE_5__/* .createTextVNode */ .Uk)((0,vue__WEBPACK_IMPORTED_MODULE_5__/* .toDisplayString */ .zw)($options.getOptionGroupLabel(optionGroup)), 1)\n ])\n ]),\n ((0,vue__WEBPACK_IMPORTED_MODULE_5__/* .openBlock */ .wg)(true), (0,vue__WEBPACK_IMPORTED_MODULE_5__/* .createBlock */ .j4)(vue__WEBPACK_IMPORTED_MODULE_5__/* .Fragment */ .HY, null, (0,vue__WEBPACK_IMPORTED_MODULE_5__/* .renderList */ .Ko)($options.getOptionGroupChildren(optionGroup), (option, i) => {\n return (0,vue__WEBPACK_IMPORTED_MODULE_5__/* .withDirectives */ .wy)(((0,vue__WEBPACK_IMPORTED_MODULE_5__/* .openBlock */ .wg)(), (0,vue__WEBPACK_IMPORTED_MODULE_5__/* .createBlock */ .j4)("li", {\n class: [\'p-dropdown-item\', {\'p-highlight\': $options.isSelected(option), \'p-disabled\': $options.isOptionDisabled(option)}],\n key: $options.getOptionRenderKey(option),\n onClick: $event => ($options.onOptionSelect($event, option)),\n role: "option",\n "aria-label": $options.getOptionLabel(option),\n "aria-selected": $options.isSelected(option)\n }, [\n (0,vue__WEBPACK_IMPORTED_MODULE_5__/* .renderSlot */ .WI)(_ctx.$slots, "option", {\n option: option,\n index: $options.getOptionIndex(i, getItemOptions)\n }, () => [\n (0,vue__WEBPACK_IMPORTED_MODULE_5__/* .createTextVNode */ .Uk)((0,vue__WEBPACK_IMPORTED_MODULE_5__/* .toDisplayString */ .zw)($options.getOptionLabel(option)), 1)\n ])\n ], 10, ["onClick", "aria-label", "aria-selected"])), [\n [_directive_ripple]\n ])\n }), 128))\n ], 64))\n }), 128)),\n ($data.filterValue && (!items || (items && items.length === 0)))\n ? ((0,vue__WEBPACK_IMPORTED_MODULE_5__/* .openBlock */ .wg)(), (0,vue__WEBPACK_IMPORTED_MODULE_5__/* .createBlock */ .j4)("li", _hoisted_6, [\n (0,vue__WEBPACK_IMPORTED_MODULE_5__/* .renderSlot */ .WI)(_ctx.$slots, "emptyfilter", {}, () => [\n (0,vue__WEBPACK_IMPORTED_MODULE_5__/* .createTextVNode */ .Uk)((0,vue__WEBPACK_IMPORTED_MODULE_5__/* .toDisplayString */ .zw)($options.emptyFilterMessageText), 1)\n ])\n ]))\n : ((!$props.options || ($props.options && $props.options.length === 0)))\n ? ((0,vue__WEBPACK_IMPORTED_MODULE_5__/* .openBlock */ .wg)(), (0,vue__WEBPACK_IMPORTED_MODULE_5__/* .createBlock */ .j4)("li", _hoisted_7, [\n (0,vue__WEBPACK_IMPORTED_MODULE_5__/* .renderSlot */ .WI)(_ctx.$slots, "empty", {}, () => [\n (0,vue__WEBPACK_IMPORTED_MODULE_5__/* .createTextVNode */ .Uk)((0,vue__WEBPACK_IMPORTED_MODULE_5__/* .toDisplayString */ .zw)($options.emptyMessageText), 1)\n ])\n ]))\n : (0,vue__WEBPACK_IMPORTED_MODULE_5__/* .createCommentVNode */ .kq)("", true)\n ], 2)\n ]),\n _: 2\n }, [\n (_ctx.$slots.loader)\n ? {\n name: "loader",\n fn: (0,vue__WEBPACK_IMPORTED_MODULE_5__/* .withCtx */ .w5)(({ options }) => [\n (0,vue__WEBPACK_IMPORTED_MODULE_5__/* .renderSlot */ .WI)(_ctx.$slots, "loader", { options: options })\n ])\n }\n : undefined\n ]), 1040, ["items", "style", "disabled"])\n ], 4),\n (0,vue__WEBPACK_IMPORTED_MODULE_5__/* .renderSlot */ .WI)(_ctx.$slots, "footer", {\n value: $props.modelValue,\n options: $options.visibleOptions\n })\n ], 2))\n : (0,vue__WEBPACK_IMPORTED_MODULE_5__/* .createCommentVNode */ .kq)("", true)\n ]),\n _: 3\n }, 8, ["onEnter", "onLeave", "onAfterLeave"])\n ], 8, ["to", "disabled"]))\n ], 2))\n}\n\nfunction styleInject(css, ref) {\n if ( ref === void 0 ) ref = {};\n var insertAt = ref.insertAt;\n\n if (!css || typeof document === \'undefined\') { return; }\n\n var head = document.head || document.getElementsByTagName(\'head\')[0];\n var style = document.createElement(\'style\');\n style.type = \'text/css\';\n\n if (insertAt === \'top\') {\n if (head.firstChild) {\n head.insertBefore(style, head.firstChild);\n } else {\n head.appendChild(style);\n }\n } else {\n head.appendChild(style);\n }\n\n if (style.styleSheet) {\n style.styleSheet.cssText = css;\n } else {\n style.appendChild(document.createTextNode(css));\n }\n}\n\nvar css_248z = "\\n.p-dropdown {\\n display: -webkit-inline-box;\\n display: -ms-inline-flexbox;\\n display: inline-flex;\\n cursor: pointer;\\n position: relative;\\n -webkit-user-select: none;\\n -moz-user-select: none;\\n -ms-user-select: none;\\n user-select: none;\\n}\\n.p-dropdown-clear-icon {\\n position: absolute;\\n top: 50%;\\n margin-top: -.5rem;\\n}\\n.p-dropdown-trigger {\\n display: -webkit-box;\\n display: -ms-flexbox;\\n display: flex;\\n -webkit-box-align: center;\\n -ms-flex-align: center;\\n align-items: center;\\n -webkit-box-pack: center;\\n -ms-flex-pack: center;\\n justify-content: center;\\n -ms-flex-negative: 0;\\n flex-shrink: 0;\\n}\\n.p-dropdown-label {\\n display: block;\\n white-space: nowrap;\\n overflow: hidden;\\n -webkit-box-flex: 1;\\n -ms-flex: 1 1 auto;\\n flex: 1 1 auto;\\n width: 1%;\\n text-overflow: ellipsis;\\n cursor: pointer;\\n}\\n.p-dropdown-label-empty {\\n overflow: hidden;\\n visibility: hidden;\\n}\\ninput.p-dropdown-label {\\n cursor: default;\\n}\\n.p-dropdown .p-dropdown-panel {\\n min-width: 100%;\\n}\\n.p-dropdown-panel {\\n position: absolute;\\n top: 0;\\n left: 0;\\n}\\n.p-dropdown-items-wrapper {\\n overflow: auto;\\n}\\n.p-dropdown-item {\\n cursor: pointer;\\n font-weight: normal;\\n white-space: nowrap;\\n position: relative;\\n overflow: hidden;\\n}\\n.p-dropdown-item-group {\\n cursor: auto;\\n}\\n.p-dropdown-items {\\n margin: 0;\\n padding: 0;\\n list-style-type: none;\\n}\\n.p-dropdown-filter {\\n width: 100%;\\n}\\n.p-dropdown-filter-container {\\n position: relative;\\n}\\n.p-dropdown-filter-icon {\\n position: absolute;\\n top: 50%;\\n margin-top: -.5rem;\\n}\\n.p-fluid .p-dropdown {\\n display: -webkit-box;\\n display: -ms-flexbox;\\n display: flex;\\n}\\n.p-fluid .p-dropdown .p-dropdown-label {\\n width: 1%;\\n}\\n";\nstyleInject(css_248z);\n\nscript.render = render;\n\n/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (script);\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNjYzNS5qcyIsIm1hcHBpbmdzIjoiOzs7Ozs7Ozs7O0FBQXFHO0FBQzlDO0FBQ1Y7QUFDUjtBQUNrQjtBQUNtTjs7QUFFMVE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBLEdBQUc7QUFDSDtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQSxTQUFTO0FBQ1Q7QUFDQTtBQUNBO0FBQ0EsU0FBUztBQUNUO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQSxTQUFTO0FBQ1Q7QUFDQTtBQUNBO0FBQ0EsU0FBUztBQUNUO0FBQ0E7QUFDQTtBQUNBLFNBQVM7QUFDVDtBQUNBO0FBQ0E7QU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0sXG5cdFx0ZmlsdGVyOiBCb29sZWFuLFxuICAgICAgICBmaWx0ZXJQbGFjZWhvbGRlcjogU3RyaW5nLFxuICAgICAgICBmaWx0ZXJMb2NhbGU6IFN0cmluZyxcbiAgICAgICAgZmlsdGVyTWF0Y2hNb2RlOiB7XG4gICAgICAgICAgICB0eXBlOiBTdHJpbmcsXG4gICAgICAgICAgICBkZWZhdWx0OiAnY29udGFpbnMnXG4gICAgICAgIH0sXG4gICAgICAgIGZpbHRlckZpZWxkczoge1xuICAgICAgICAgICAgdHlwZTogQXJyYXksXG4gICAgICAgICAgICBkZWZhdWx0OiBudWxsXG4gICAgICAgIH0sXG5cdFx0ZWRpdGFibGU6IEJvb2xlYW4sXG5cdFx0cGxhY2Vob2xkZXI6IFN0cmluZyxcblx0XHRkaXNhYmxlZDogQm9vbGVhbixcbiAgICAgICAgZGF0YUtleTogbnVsbCxcbiAgICAgICAgc2hvd0NsZWFyOiBCb29sZWFuLFxuICAgICAgICBpbnB1dElkOiBTdHJpbmcsXG4gICAgICAgIHRhYmluZGV4OiBTdHJpbmcsXG4gICAgICAgIGFyaWFMYWJlbGxlZEJ5OiBudWxsLFxuICAgICAgICBhcHBlbmRUbzoge1xuICAgICAgICAgICAgdHlwZTogU3RyaW5nLFxuICAgICAgICAgICAgZGVmYXVsdDogJ2JvZHknXG4gICAgICAgIH0sXG4gICAgICAgIGVtcHR5RmlsdGVyTWVzc2FnZToge1xuICAgICAgICAgICAgdHlwZTogU3RyaW5nLFxuICAgICAgICAgICAgZGVmYXVsdDogbnVsbFxuICAgICAgICB9LFxuICAgICAgICBlbXB0eU1lc3NhZ2U6IHtcbiAgICAgICAgICAgIHR5cGU6IFN0cmluZyxcbiAgICAgICAgICAgIGRlZmF1bHQ6IG51bGxcbiAgICAgICAgfSxcbiAgICAgICAgcGFuZWxDbGFzczogbnVsbCxcbiAgICAgICAgbG9hZGluZzoge1xuICAgICAgICAgICAgdHlwZTogQm9vbGVhbixcbiAgICAgICAgICAg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uICAgICAgICB9LFxuICAgICAgICBnZXRPcHRpb25WYWx1ZShvcHRpb24pIHtcbiAgICAgICAgICAgIHJldHVybiB0aGlzLm9wdGlvblZhbHVlID8gT2JqZWN0VXRpbHMucmVzb2x2ZUZpZWxkRGF0YShvcHRpb24sIHRoaXMub3B0aW9uVmFsdWUpIDogb3B0aW9uO1xuICAgICAgICB9LFxuICAgICAgICBnZXRPcHRpb25SZW5kZXJLZXkob3B0aW9uKSB7XG4gICAgICAgICAgICByZXR1cm4gdGhpcy5kYXRhS2V5ID8gT2JqZWN0VXRpbHMucmVzb2x2ZUZpZWxkRGF0YShvcHRpb24sIHRoaXMuZGF0YUtleSkgOiB0aGlzLmdldE9wdGlvbkxhYmVsKG9wdGlvbik7XG4gICAgICAgIH0sXG4gICAgICAgIGlzT3B0aW9uRGlzYWJsZWQob3B0aW9uKSB7XG4gICAgICAgICAgICByZXR1cm4gdGhpcy5vcHRpb25EaXNhYmxlZCA/IE9iamVjdFV0aWxzLnJlc29sdmVGaWVsZERhdGEob3B0aW9uLCB0aGlzLm9wdGlvbkRpc2FibGVkKSA6IGZhbHNlO1xuICAgICAgICB9LFxuICAgICAgICBnZXRPcHRpb25Hcm91cFJlbmRlcktleShvcHRpb25Hcm91cCkge1xuICAgICAgICAgICAgcmV0dXJuIE9iamVjdFV0aWxzLnJlc29sdmVGaWVsZERhdGEob3B0aW9uR3JvdXAsIHRoaXMub3B0aW9uR3JvdXBMYWJlbCk7XG4gICAgICAgIH0sXG4gICAgICAgIGdldE9wdGlvbkdyb3VwTGFiZWwob3B0aW9uR3JvdXApIHtcbiAgICAgICAgICAgIHJldHVybiBPYmplY3RVdGlscy5yZXNvbHZlRmllbGREYXRhKG9wdGlvbkdyb3VwLCB0aGlzLm9wdGlvbkdyb3VwTGFiZWwpO1xuICAgICAgICB9LFxuICAgICAgICBnZXRPcHRpb25Hcm91cENoaWxkcmVuKG9wdGlvbkdyb3VwKSB7XG4gICAgICAgICAgICByZXR1cm4gT2JqZWN0VXRpbHMucmVzb2x2ZUZpZWxkRGF0YShvcHRpb25Hcm91cCwgdGhpcy5vcHRpb25Hcm91cENoaWxkcmVuKTtcbiAgICAgICAgfSxcbiAgICAgICAgZ2V0U2VsZWN0ZWRPcHRpb24oKSB7XG4gICAgICAgICAgICBsZXQgaW5kZXggPSB0aGlzLmdldFNlbGVjdGVkT3B0aW9uSW5kZXgoKTtcbiAgICAgICAgICAgIHJldHVybiBpbmRleCAhPT0gLTEgPyAodGhpcy5vcHRpb25Hcm91cExhYmVsID8gdGhpcy5nZXRPcHRpb25Hcm91cENoaWxkcmVuKHRoaXMudmlzaWJsZU9wdGlvbnNbaW5kZXguZ3JvdXBdKVtpbmRleC5vcHRpb25dOiB0aGlzLnZpc2libGVPcHRpb25zW2luZGV4XSkgOiBudWxsO1xuICAgICAgICB9LFxuICAgICAgICBnZXRTZWxlY3RlZE9wdGlvbkluZGV4KCkge1xuICAgICAgICAgICAgaWYgKHRoaXMubW9kZWxWYWx1ZSAhPSBudWxsICYmIHRoaXMudmlzaWJsZU9wdGlvbnMpIHtcbiAgICAgICAgICAgICAgICBpZiAodGhpcy5vcHRpb25Hcm91cExhYmVsKSB7XG4gICAgICAgICAgICAgICAgICAgIGZvciAobGV0IGkgPSAwOyBpIDwgdGhpcy52aXNpYmxlT3B0aW9ucy5sZW5ndGg7IGkrKykge1xuICAgICAgICAgICAgICAgICAgICAgICAgbGV0IHNlbGVjdGVkT3B0aW9uSW5kZXggPSB0aGlzLmZpbmRPcHRpb25JbmRleEluTGlzdCh0aGlzLm1vZGVsVmFsdWUsIHRoaXMuZ2V0T3B0aW9uR3JvdXBDaGlsZHJlbih0aGlzLnZpc2libGVPcHRpb25zW2ldKSk7XG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAoc2VsZWN0ZWRPcHRpb25JbmRleCAhPT0gLTEpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4ge2dyb3VwOiBpLCBvcHRpb246IHNlbGVjdGVkT3B0aW9uSW5kZXh9O1xuICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICByZXR1cm4gdGhpcy5maW5kT3B0aW9uSW5kZXhJbkxpc3QodGhpcy5tb2RlbFZhbHVlLCB0aGlzLnZpc2libGVPcHRpb25zKTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG5cbiAgICAgICAgICAgIHJldHVybiAtMTtcbiAgICAgICAgfSxcbiAgICAgICAgZmluZE9wdGlvbkluZGV4SW5MaXN0KHZhbHVlLCBsaXN0KSB7XG4gICAgICAgICAgICBmb3IgKGxldCBpID0gMDsgaSA8IGxpc3QubGVuZ3RoOyBpKyspIHtcbiAgICAgICAgICAgICAgICBpZiAoKE9iamVjdFV0aWxzLmVxdWFscyh2YWx1ZSwgdGhpcy5nZXRPcHRpb25WYWx1ZShsaXN0W2ldKSwgdGhpcy5lcXVhbGl0eUtleSkpKSB7XG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBpO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgcmV0dXJuIC0xO1xuICAgICAgICB9LFxuICAgICAgICBpc1NlbGVjdGVkKG9wdGlvbikge1xuICAgICAgICAgICAgcmV0dXJuIE9iamVjdFV0aWxzLmVxdWFscyh0aGlzLm1vZGVsVmFsdWUsIHRoaXMuZ2V0T3B0aW9uVmFsdWUob3B0aW9uKSwgdGhpcy5lcXVhbGl0eUtleSk7XG4gICAgICAgIH0sXG4gICAgICAgIHNob3coKSB7XG4gICAgICAgICAgICB0aGlzLiRlbWl0KCdiZWZvcmUtc2hvdycpO1xuICAgICAgICAgICAgdGhpcy5vdmVybGF5VmlzaWJsZSA9IHRydWU7XG4gICAgICAgIH0sXG4gICAgICAgIGhpZGUoKSB7XG4gICAgICAgICAgICB0aGlzLiRlbWl0KCdiZWZvcmUtaGlkZScpO1xuICAgICAgICAgICAgdGhpcy5vdmVybGF5VmlzaWJsZSA9IGZhbHNlO1xuICAgICAgICB9LFxuICAgICAgICBvbkZvY3VzKGV2ZW50KSB7XG4gICAgICAgICAgICB0aGlzLmZvY3VzZWQgPSB0cnVlO1xuICAgICAgICAgICAgdGhpcy4kZW1pdCgnZm9jdXMnLCBldmVudCk7XG4gICAgICAgIH0sXG4gICAgICAgIG9uQmx1cihldmVudCkge1xuICAgICAgICAgICAgdGhpcy5mb2N1c2VkID0gZmFsc2U7XG4gICAgICAgICAgICB0aGlzLiRlbWl0KCdibHVyJywgZXZlbnQpO1xuICAgICAgICB9LFxuICAgICAgICBvbktleURvd24oZXZlbnQpIHtcbiAgICAgICAgICAgIHN3aXRjaChldmVudC53aGljaCkge1xuICAgICAgICAgICAgICAgIC8vZG93blxuICAgICAgICAgICAgICAgIGNhc2UgNDA6XG4gICAgICAgICAgICAgICAgICAgIHRoaXMub25Eb3duS2V5KGV2ZW50KTtcbiAgICAgICAgICAgICAgICBicmVhaztcblxuICAgICAgICAgICAgICAgIC8vdXBcbiAgICAgICAgICAgICAgICBjYXNlIDM4OlxuICAgICAgICAgICAgICAgICAgICB0aGlzLm9uVXBLZXkoZXZlbnQpO1xuICAgICAgICAgICAgICAgIGJyZWFrO1xuXG4gICAgICAgICAgICAgICAgLy9zcGFjZVxuICAgICAgICAgICAgICAgIGNhc2UgMzI6XG4gICAgICAgICAgICAgICAgICAgIGlmICghdGhpcy5vdmVybGF5VmlzaWJsZSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgdGhpcy5zaG93KCk7XG4gICAgICAgICAgICAgICAgICAgICAgICBldmVudC5wcmV2ZW50RGVmYXVsdCgpO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgYnJlYWs7XG5cbiAgICAgICAgICAgICAgICAvL2VudGVyIGFuZCBlc2NhcGVcbiAgICAgICAgICAgICAgICBjYXNlIDEzOlxuICAgICAgICAgICAgICAgIGNhc2UgMjc6XG4gICAgICAgICAgICAgICAgICAgIGlmICh0aGlzLm92ZXJsYXlWaXNpYmxlKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICB0aGlzLmhpZGUoKTtcbiAgICAgICAgICAgICAgICAgICAgICAgIGV2ZW50LnByZXZlbnREZWZhdWx0KCk7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICBicmVhaztcblxuICAgICAgICAgICAgICAgIC8vdGFiXG4gICAgICAgICAgICAgICAgY2FzZSA5OlxuICAgICAgICAgICAgICAgICAgICB0aGlzLmhpZGUoKTtcbiAgICAgICAgICAgICAgICBicmVhaztcblxuICAgICAgICAgICAgICAgIGRlZmF1bHQ6XG4gICAgICAgICAgICAgICAgICAgIHRoaXMuc2VhcmNoKGV2ZW50KTtcbiAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgIH1cbiAgICAgICAgfSxcbiAgICAgICAgb25GaWx0ZXJLZXlEb3duKGV2ZW50KSB7XG4gICAgICAgICAgICBzd2l0Y2ggKGV2ZW50LndoaWNoKSB7XG4gICAgICAgICAgICAgICAgLy9kb3duXG4gICAgICAgICAgICAgICAgY2FzZSA0MDpcbiAgICAgICAgICAgICAgICAgICAgdGhpcy5vbkRvd25LZXkoZXZlbnQpO1xuICAgICAgICAgICAgICAgICAgICBicmVhaztcblxuICAgICAgICAgICAgICAgIC8vdXBcbiAgICAgICAgICAgICAgICBjYXNlIDM4OlxuICAgICAgICAgICAgICAgICAgICB0aGlzLm9uVXBLZXkoZXZlbnQpO1xuICAgICAgICAgICAgICAgICAgICBicmVhaztcblxuICAgICAgICAgICAgICAgIC8vZW50ZXIgYW5kIGVzY2FwZVxuICAgICAgICAgICAgICAgIGNhc2UgMTM6XG4gICAgICAgICAgICAgICAgY2FzZSAyNzpcbiAgICAgICAgICAgICAgICAgICAgdGhpcy5vdmVybGF5VmlzaWJsZSA9IGZhbHNlO1xuICAgICAgICAgICAgICAgICAgICBldmVudC5wcmV2ZW50RGVmYXVsdCgpO1xuICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgfVxuICAgICAgICB9LFxuICAgICAgICBvbkRvd25LZXkoZXZlbnQpIHtcbiAgICAgICAgICAgIGlmICh0aGlzLnZpc2libGVPcHRpb25zKSB7XG4gICAgICAgICAgICAgICAgaWYgKCF0aGlzLm92ZXJsYXlWaXNpYmxlICYmIGV2ZW50LmFsdEtleSkge1xuICAgICAgICAgICAgICAgICAgICB0aGlzLnNob3coKTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgIGxldCBuZXh0T3B0aW9uID0gdGhpcy52aXNpYmxlT3B0aW9ucyAmJiB0aGlzLnZpc2libGVPcHRpb25zLmxlbmd0aCA+IDAgPyB0aGlzLmZpbmROZXh0T3B0aW9uKHRoaXMuZ2V0U2VsZWN0ZWRPcHRpb25JbmRleCgpKSA6IG51bGw7XG4gICAgICAgICAgICAgICAgICAgIGlmIChuZXh0T3B0aW9uKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICB0aGlzLnVwZGF0ZU1vZGVsKGV2ZW50LCB0aGlzLmdldE9wdGlvblZhbHVlKG5leHRPcHRpb24pKTtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgZXZlbnQucHJldmVudERlZmF1bHQoKTtcbiAgICAgICAgfSxcbiAgICAgICAgb25VcEtleShldmVudCkge1xuICAgICAgICAgICAgaWYgKHRoaXMudmlzaWJsZU9wdGlvbnMpIHtcbiAgICAgICAgICAgICAgICBsZXQgcHJldk9wdGlvbiA9IHRoaXMuZmluZFByZXZPcHRpb24odGhpcy5nZXRTZWxlY3RlZE9wdGlvbkluZGV4KCkpO1xuICAgICAgICAgICAgICAgIGlmIChwcmV2T3B0aW9uKSB7XG4gICAgICAgICAgICAgICAgICAgIHRoaXMudXBkYXRlTW9kZWwoZXZlbnQsIHRoaXMuZ2V0T3B0aW9uVmFsdWUocHJldk9wdGlvbikpO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgZXZlbnQucHJldmVudERlZmF1bHQoKTtcbiAgICAgICAgfSxcbiAgICAgICAgZmluZE5leHRPcHRpb24oaW5kZXgpIHtcbiAgICAgICAgICAgIGlmICh0aGlzLm9wdGlvbkdyb3VwTGFiZWwpIHtcbiAgICAgICAgICAgICAgICBsZXQgZ3JvdXBJbmRleCA9IGluZGV4ID09PSAtMSA/IDAgOiBpbmRleC5ncm91cDtcbiAgICAgICAgICAgICAgICBsZXQgb3B0aW9uSW5kZXggPSBpbmRleCA9PT0gLTEgPyAtMSA6IGluZGV4Lm9wdGlvbjtcbiAgICAgICAgICAgICAgICBsZXQgb3B0aW9uID0gdGhpcy5maW5kTmV4dE9wdGlvbkluTGlzdCh0aGlzLmdldE9wdGlvbkdyb3VwQ2hpbGRyZW4odGhpcy52aXNpYmxlT3B0aW9uc1tncm91cEluZGV4XSksIG9wdGlvbkluZGV4KTtcblxuICAgICAgICAgICAgICAgIGlmIChvcHRpb24pXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBvcHRpb247XG4gICAgICAgICAgICAgICAgZWxzZSBpZiAoKGdyb3VwSW5kZXggKyAxKSAhPT0gdGhpcy52aXNpYmxlT3B0aW9ucy5sZW5ndGgpXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiB0aGlzLmZpbmROZXh0T3B0aW9uKHtncm91cDogKGdyb3VwSW5kZXggKyAxKSwgb3B0aW9uOiAtMX0pO1xuICAgICAgICAgICAgICAgIGVsc2VcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIG51bGw7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBlbHNlIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gdGhpcy5maW5kTmV4dE9wdGlvbkluTGlzdCh0aGlzLnZpc2libGVPcHRpb25zLCBpbmRleCk7XG4gICAgICAgICAgICB9XG4gICAgICAgIH0sXG4gICAgICAgIGZpbmROZXh0T3B0aW9uSW5MaXN0KGxpc3QsIGluZGV4KSB7XG4gICAgICAgICAgICAgICAgbGV0IGkgPSBpbmRleCArIDE7XG4gICAgICAgICAgICAgICAgaWYgKGkgPT09IGxpc3QubGVuZ3RoKSB7XG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBudWxsO1xuICAgICAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgICAgIGxldCBvcHRpb24gPSBsaXN0W2ldO1xuICAgICAgICAgICAgICAgIGlmICh0aGlzLmlzT3B0aW9uRGlzYWJsZWQob3B0aW9uKSlcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHRoaXMuZmluZE5leHRPcHRpb25Jbkxpc3QoaSk7XG4gICAgICAgICAgICAgICAgZWxzZVxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gb3B0aW9uO1xuICAgICAgICB9LFxuICAgICAgICBmaW5kUHJldk9wdGlvbihpbmRleCkge1xuICAgICAgICAgICAgaWYgKGluZGV4ID09PSAtMSkge1xuICAgICAgICAgICAgICAgIHJldHVybiBudWxsO1xuICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICBpZiAodGhpcy5vcHRpb25Hcm91cExhYmVsKSB7XG4gICAgICAgICAgICAgICAgbGV0IGdyb3VwSW5kZXggPSBpbmRleC5ncm91cDtcbiAgICAgICAgICAgICAgICBsZXQgb3B0aW9uSW5kZXggPSBpbmRleC5vcHRpb247XG4gICAgICAgICAgICAgICAgbGV0IG9wdGlvbiA9IHRoaXMuZmluZFByZXZPcHRpb25Jbkxpc3QodGhpcy5nZXRPcHRpb25Hcm91cENoaWxkcmVuKHRoaXMudmlzaWJsZU9wdGlvbnNbZ3JvdXBJbmRleF0pLCBvcHRpb25JbmRleCk7XG5cbiAgICAgICAgICAgICAgICBpZiAob3B0aW9uKVxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gb3B0aW9uO1xuICAgICAgICAgICAgICAgIGVsc2UgaWYgKGdyb3VwSW5kZXggPiAwKVxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gdGhpcy5maW5kUHJldk9wdGlvbih7Z3JvdXA6IChncm91cEluZGV4IC0gMSksIG9wdGlvbjogdGhpcy5nZXRPcHRpb25Hcm91cENoaWxkcmVuKHRoaXMudmlzaWJsZU9wdGlvbnNbZ3JvdXBJbmRleCAtIDFdKS5sZW5ndGh9KTtcbiAgICAgICAgICAgICAgICBlbHNlXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBudWxsO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgZWxzZSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuIHRoaXMuZmluZFByZXZPcHRpb25Jbkxpc3QodGhpcy52aXNpYmxlT3B0aW9ucywgaW5kZXgpO1xuICAgICAgICAgICAgfVxuICAgICAgICB9LFxuICAgICAgICBmaW5kUHJldk9wdGlvbkluTGlzdChsaXN0LCBpbmRleCkge1xuICAgICAgICAgICAgbGV0IGkgPSBpbmRleCAtIDE7XG4gICAgICAgICAgICBpZiAoaSA8IDApIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gbnVsbDtcbiAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgbGV0IG9wdGlvbiA9IGxpc3RbaV07XG4gICAgICAgICAgICBpZiAodGhpcy5pc09wdGlvbkRpc2FibGVkKG9wdGlvbikpXG4gICAgICAgICAgICAgICAgcmV0dXJuIHRoaXMuZmluZFByZXZPcHRpb24oaSk7XG4gICAgICAgICAgICBlbHNlXG4gICAgICAgICAgICAgICAgcmV0dXJuIG9wdGlvbjtcbiAgICAgICAgfSxcbiAgICAgICAgb25DbGVhckNsaWNrKGV2ZW50KSB7XG4gICAgICAgICAgICB0aGlzLnVwZGF0ZU1vZGVsKGV2ZW50LCBudWxsKTtcbiAgICAgICAgfSxcbiAgICAgICAgb25DbGljayhldmVudCkge1xuICAgICAgICAgICAgaWYgKHRoaXMuZGlzYWJsZWQgfHwgdGhpcy5sb2FkaW5nKSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuO1xuICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICBpZiAoRG9tSGFuZGxlci5oYXNDbGFzcyhldmVudC50YXJnZXQsICdwLWRyb3Bkb3duLWNsZWFyLWljb24nKSB8fCBldmVudC50YXJnZXQudGFnTmFtZSA9PT0gJ0lOUFVUJykge1xuICAgICAgICAgICAgICAgIHJldHVybjtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGVsc2UgaWYgKCF0aGlzLm92ZXJsYXkgfHwgIXRoaXMub3ZlcmxheS5jb250YWlucyhldmVudC50YXJnZXQpKSB7XG4gICAgICAgICAgICAgICAgaWYgKHRoaXMub3ZlcmxheVZpc2libGUpXG4gICAgICAgICAgICAgICAgICAgIHRoaXMuaGlkZSgpO1xuICAgICAgICAgICAgICAgIGVsc2VcbiAgICAgICAgICAgICAgICAgICAgdGhpcy5zaG93KCk7XG5cbiAgICAgICAgICAgICAgICB0aGlzLiRyZWZzLmZvY3VzSW5wdXQuZm9jdXMoKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfSxcbiAgICAgICAgb25PcHRpb25TZWxlY3QoZXZlbnQsIG9wdGlvbikge1xuICAgICAgICAgICAgbGV0IHZhbHVlID0gdGhpcy5nZXRPcHRpb25WYWx1ZShvcHRpb24pO1xuICAgICAgICAgICAgdGhpcy51cGRhdGVNb2RlbChldmVudCwgdmFsdWUpO1xuICAgICAgICAgICAgdGhpcy4kcmVmcy5mb2N1c0lucHV0LmZvY3VzKCk7XG5cbiAgICAgICAgICAgIHNldFRpbWVvdXQoKCkgPT4ge1xuICAgICAgICAgICAgICAgIHRoaXMuaGlkZSgpO1xuICAgICAgICAgICAgfSwgMjAwKTtcbiAgICAgICAgfSxcbiAgICAgICAgb25FZGl0YWJsZUlucHV0KGV2ZW50KSB7XG4gICAgICAgICAgICB0aGlzLiRlbWl0KCd1cGRhdG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T3V0c2lkZUNsaWNrTGlzdGVuZXIoKSB7XG4gICAgICAgICAgICBpZiAoIXRoaXMub3V0c2lkZUNsaWNrTGlzdGVuZXIpIHtcbiAgICAgICAgICAgICAgICB0aGlzLm91dHNpZGVDbGlja0xpc3RlbmVyID0gKGV2ZW50KSA9PiB7XG4gICAgICAgICAgICAgICAgICAgIGlmICh0aGlzLm92ZXJsYXlWaXNpYmxlICYmIHRoaXMub3ZlcmxheSAmJiAhdGhpcy4kZWwuY29udGFpbnMoZXZlbnQudGFyZ2V0KSAmJiAhdGhpcy5vdmVybGF5LmNvbnRhaW5zKGV2ZW50LnRhcmdldCkpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIHRoaXMuaGlkZSgpO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgfTtcbiAgICAgICAgICAgICAgICBkb2N1bWVudC5hZGRFdmVudExpc3RlbmVyKCdjbGljaycsIHRoaXMub3V0c2lkZUNsaWNrTGlzdGVuZXIpO1xuICAgICAgICAgICAgfVxuICAgICAgICB9LFxuICAgICAgICB1bmJpbmRPdXRzaWRlQ2xpY2tMaXN0ZW5lcigpIHtcbiAgICAgICAgICAgIGlmICh0aGlzLm91dHNpZGVDbGlja0xpc3RlbmVyKSB7XG4gICAgICAgICAgICAgICAgZG9jdW1lbnQucmVtb3ZlRXZlbnRMaXN0ZW5lcignY2xpY2snLCB0aGlzLm91dHNpZGVDbGlja0xpc3RlbmVyKTtcbiAgICAgICAgICAgICAgICB0aGlzLm91dHNpZGVDbGlja0xpc3RlbmVyID0gbnVsbDtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfSxcbiAgICAgICAgYmluZFNjcm9sbExpc3RlbmVyKCkge1xuICAgICAgICAgICAgaWYgKCF0aGlzLnNjcm9sbEhhbmRsZXIpIHtcbiAgICAgICAgICAgICAgICB0aGlzLnNjcm9sbEhhbmRsZXIgPSBuZXcgQ29ubmVjdGVkT3ZlcmxheVNjcm9sbEhhbmRsZXIodGhpcy4kcmVmcy5jb250YWluZXIsICgpID0+IHtcbiAgICAgICAgICAgICAgICAgICAgaWYgKHRoaXMub3ZlcmxheVZpc2libGUpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIHRoaXMuaGlkZSgpO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICB9XG5cbiAgICAgICAgICAgIHRoaXMuc2Nyb2xsSGFuZGxlci5iaW5kU2Nyb2xsTGlzdGVuZXIoKTtcbiAgICAgICAgfSxcbiAgICAgICAgdW5iaW5kU2Nyb2xsTGlzdGVuZXIoKSB7XG4gICAgICAgICAgICBpZiAodGhpcy5zY3JvbGxIYW5kbGVyKSB7XG4gICAgICAgICAgICAgICAgdGhpcy5zY3JvbGxIYW5kbGVyLnVuYmluZFNjcm9sbExpc3RlbmVyKCk7XG4gICAgICAgICAgICB9XG4gICAgICAgIH0sXG4gICAgICAgIGJpbmRSZXNpemVMaXN0ZW5lcigpIHtcbiAgICAgICAgICAgIGlmICghdGhpcy5yZXNpemVMaXN0ZW5lcikge1xuICAgICAgICAgICAgICAgIHRoaXMucmVzaXplTGlzdGVuZXIgPSAoKSA9PiB7XG4gICAgICAgICAgICAgICAgICAgIGlmICh0aGlzLm92ZXJsYXlWaXNpYmxlICYmICFEb21IYW5kbGVyLmlzVG91Y2hEZXZpY2UoKSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgdGhpcy5oaWRlKCk7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICB9O1xuICAgICAgICAgICAgICAgIHdpbmRvdy5hZGRFdmVudExpc3RlbmVyKCdyZXNpemUnLCB0aGlzLnJlc2l6ZUxpc3RlbmVyKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfSxcbiAgICAgICAgdW5iaW5kUmVzaXplTGlzdGVuZXIoKSB7XG4gICAgICAgICAgICBpZiAodGhpcy5yZXNpemVMaXN0ZW5lcikge1xuICAgICAgICAgICAgICAgIHdpbmRvdy5yZW1vdmVFdmVudExpc3RlbmVyKCdyZXNpemUnLCB0aGlzLnJlc2l6ZUxpc3RlbmVyKTtcbiAgICAgICAgICAgICAgICB0aGlzLnJlc2l6ZUxpc3RlbmVyID0gbnVsbDtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfSxcbiAgICAgICAgc2VhcmNoKGV2ZW50KSB7XG4gICAgICAgICAgICBpZiAoIXRoaXMudmlzaWJsZU9wdGlvbnMpIHtcbiAgICAgICAgICAgICAgICByZXR1cm47XG4gICAgICAgICAgICB9XG5cbiAgICAgICAgICAgIGlmICh0aGlzLnNlYXJjaFRpbWVvdXQpIHtcbiAgICAgICAgICAgICAgICBjbGVhclRpbWVvdXQodGhpcy5zZWFyY2hUaW1lb3V0KTtcbiAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgY29uc3QgY2hhciA9IGV2ZW50LmtleTtcbiAgICAgICAgICAgIHRoaXMucHJldmlvdXNTZWFyY2hDaGFyID0gdGhpcy5jdXJyZW50U2VhcmNoQ2hhcjtcbiAgICAgICAgICAgIHRoaXMuY3VycmVudFNlYXJjaENoYXIgPSBjaGFyO1xuXG4gICAgICAgICAgICBpZiAodGhpcy5wcmV2aW91c1NlYXJjaENoYXIgPT09IHRoaXMuY3VycmVudFNlYXJjaENoYXIpXG4gICAgICAgICAgICAgICAgdGhpcy5zZWFyY2hWYWx1ZSA9IHRoaXMuY3VycmVudFNlYXJjaENoYXI7XG4gICAgICAgICAgICBlbHNlXG4gICAgICAgICAgICAgICAgdGhpcy5zZWFyY2hWYWx1ZSA9IHRoaXMuc2VhcmNoVmFsdWUgPyB0aGlzLnNlYXJjaFZhbHVlICsgY2hhciA6IGNoYXI7XG5cbiAgICAgICAgICAgIGlmICh0aGlzLnNlYXJjaFZhbHVlKSB7XG4gICAgICAgICAgICAgICAgbGV0IHNlYXJjaEluZGV4ID0gdGhpcy5nZXRTZWxlY3RlZE9wdGlvbkluZGV4KCk7XG4gICAgICAgICAgICAgICAgbGV0IG5ld09wdGlvbiA9IHRoaXMub3B0aW9uR3JvdXBMYWJlbCA/IHRoaXMuc2VhcmNoT3B0aW9uSW5Hcm91cChzZWFyY2hJbmRleCkgOiB0aGlzLnNlYXJjaE9wdGlvbigrK3NlYXJjaEluZGV4KTtcbiAgICAgICAgICAgICAgICBpZiAobmV3T3B0aW9uKSB7XG4gICAgICAgICAgICAgICAgICAgIHRoaXMudXBkYXRlTW9kZWwoZXZlbnQsIHRoaXMuZ2V0T3B0aW9uVmFsdWUobmV3T3B0aW9uKSk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICB0aGlzLnNlYXJjaFRpbWVvdXQgPSBzZXRUaW1lb3V0KCgpID0+IHtcbiAgICAgICAgICAgICAgICB0aGlzLnNlYXJjaFZhbHVlID0gbnVsbDtcbiAgICAgICAgICAgIH0sIDI1MCk7XG4gICAgICAgIH0sXG4gICAgICAgIHNlYXJjaE9wdGlvbihpbmRleCkge1xuICAgICAgICAgICAgbGV0IG9wdGlvbjtcblxuICAgICAgICAgICAgaWYgKHRoaXMuc2VhcmNoVmFsdWUpIHtcbiAgICAgICAgICAgICAgICBvcHRpb24gPSB0aGlzLnNlYXJjaE9wdGlvbkluUmFuZ2UoaW5kZXgsIHRoaXMudmlzaWJsZU9wdGlvbnMubGVuZ3RoKTtcblxuICAgICAgICAgICAgICAgIGlmICghb3B0aW9uKSB7XG4gICAgICAgICAgICAgICAgICAgIG9wdGlvbiA9IHRoaXMuc2VhcmNoT3B0aW9uSW5SYW5nZSgwLCBpbmRleCk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICByZXR1cm4gb3B0aW9uO1xuICAgICAgICB9LFxuICAgICAgICBzZWFyY2hPcHRpb25JblJhbmdlKHN0YXJ0LCBlbmQpIHtcbiAgICAgICAgICAgIGZvciAobGV0IGkgPSBzdGFydDsgaSA8IGVuZDsgaSsrKSB7XG4gICAgICAgICAgICAgICAgbGV0IG9wdCA9IHRoaXMudmlzaWJsZU9wdGlvbnNbaV07XG4gICAgICAgICAgICAgICAgaWYgKHRoaXMubWF0Y2hlc1NlYXJjaFZhbHVlKG9wdCkpIHtcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIG9wdDtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG5cbiAgICAgICAgICAgIHJldHVybiBudWxsO1xuICAgICAgICB9LFxuICAgICAgICBzZWFyY2hPcHRpb25Jbkdyb3VwKGluZGV4KSB7XG4gICAgICAgICAgICBsZXQgc2VhcmNoSW5kZXggPSBpbmRleCA9PT0gLTEgPyB7Z3JvdXA6IDAsIG9wdGlvbjogLTF9IDogaW5kZXg7XG5cbiAgICAgICAgICAgIGZvciAobGV0IGkgPSBzZWFyY2hJbmRleC5ncm91cDsgaSA8IHRoaXMudmlzaWJsZU9wdGlvbnMubGVuZ3RoOyBpKyspIHtcbiAgICAgICAgICAgICAgICBsZXQgZ3JvdXBPcHRpb25zID0gdGhpcy5nZXRPcHRpb25Hcm91cENoaWxkcmVuKHRoaXMudmlzaWJsZU9wdGlvbnNbaV0pO1xuICAgICAgICAgICAgICAgIGZvciAobGV0IGogPSAoc2VhcmNoSW5kZXguZ3JvdXAgPT09IGkgPyBzZWFyY2hJbmRleC5vcHRpb24gKyAxIDogMCk7IGogPCBncm91cE9wdGlvbnMubGVuZ3RoOyBqKyspIHtcbiAgICAgICAgICAgICAgICAgICAgaWYgKHRoaXMubWF0Y2hlc1NlYXJjaFZhbHVlKGdyb3VwT3B0aW9uc1tqXSkpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBncm91cE9wdGlvbnNbal07XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG5cbiAgICAgICAgICAgIGZvciAobGV0IGkgPSAwOyBpIDw9IHNlYXJjaEluZGV4Lmdyb3VwOyBpKyspIHtcbiAgICAgICAgICAgICAgICBsZXQgZ3JvdXBPcHRpb25zID0gdGhpcy5nZXRPcHRpb25Hcm91cENoaWxkcmVuKHRoaXMudmlzaWJsZU9wdGlvbnNbaV0pO1xuICAgICAgICAgICAgICAgIGZvciAobGV0IGogPSAwOyBqIDwgKHNlYXJjaEluZGV4Lmdyb3VwID09PSBpID8gc2VhcmNoSW5kZXgub3B0aW9uOiBncm91cE9wdGlvbnMubGVuZ3RoKTsgaisrKSB7XG4gICAgICAgICAgICAgICAgICAgIGlmICh0aGlzLm1hdGNoZXNTZWFyY2hWYWx1ZShncm91cE9wdGlvbnNbal0pKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gZ3JvdXBPcHRpb25zW2pdO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICByZXR1cm4gbnVsbDtcbiAgICAgICAgfSxcbiAgICAgICAgbWF0Y2hlc1NlYXJjaFZhbHVlKG9wdGlvbikge1xuICAgICAgICAgICAgbGV0IGxhYmVsID0gdGhpcy5nZXRPcHRpb25MYWJlbChvcHRpb24pLnRvTG9jYWxlTG93ZXJDYXNlKHRoaXMuZmlsdGVyTG9jYWxlKTtcbiAgICAgICAgICAgIHJldHVybiBsYWJlbC5zdGFydHNXaXRoKHRoaXMuc2VhcmNoVmFsdWUudG9Mb2NhbGVMb3dlckNhc2UodGhpcy5maWx0ZXJMb2NhbGUpKTtcbiAgICAgICAgfSxcbiAgICAgICAgb25GaWx0ZXJDaGFuZ2UoZXZlbnQpIHtcbiAgICAgICAgICAgIHRoaXMuJGVtaXQoJ2ZpbHRlcicsIHtvcmlnaW5hbEV2ZW50OiBldmVudCwgdmFsdWU6IGV2ZW50LnRhcmdldC52YWx1ZX0pO1xuICAgICAgICB9LFxuICAgICAgICBvbkZpbHRlclVwZGF0ZWQoKSB7XG4gICAgICAgICAgICBpZiAodGhpcy5vdmVybGF5VmlzaWJsZSkge1xuICAgICAgICAgICAgICAgIHRoaXMuYWxpZ25PdmVybGF5KCk7XG4gICAgICAgICAgICB9XG4gICAgICAgIH0sXG4gICAgICAgIG92ZXJsYXlSZWYoZWwpIHtcbiAgICAgICAgICAgIHRoaXMub3ZlcmxheSA9IGVsO1xuICAgICAgICB9LFxuICAgICAgICBpdGVtc1dyYXBwZXJSZWYoZWwpIHtcbiAgICAgICAgICAgIHRoaXMuaXRlbXNXcmFwcGVyID0gZWw7XG4gICAgICAgIH0sXG4gICAgICAgIHZpcnR1YWxTY3JvbGxlclJlZihlbCkge1xuICAgICAgICAgICAgdGhpcy52aXJ0dWFsU2Nyb2xsZXIgPSBlbDtcbiAgICAgICAgfSxcbiAgICAgICAgc2Nyb2xsVmFsdWVJblZpZXcoKSB7XG4gICAgICAgICAgICBpZiAodGhpcy5vdmVybGF5KSB7XG4gICAgICAgICAgICAgICAgbGV0IHNlbGVjdGVkSXRlbSA9IERvbUhhbmRsZXIuZmluZFNpbmdsZSh0aGlzLm92ZXJsYXksICdsaS5wLWhpZ2hsaWdodCcpO1xuICAgICAgICAgICAgICAgIGlmIChzZWxlY3RlZEl0ZW0pIHtcbiAgICAgICAgICAgICAgICAgICAgc2VsZWN0ZWRJdGVtLnNjcm9sbEludG9WaWV3KHsgYmxvY2s6ICduZWFyZXN0JywgaW5saW5lOiAnc3RhcnQnIH0pO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cbiAgICAgICAgfSxcbiAgICAgICAgb25PdmVybGF5Q2xpY2soZXZlbnQpIHtcbiAgICAgICAgICAgIE92ZXJsYXlFdmVudEJ1cy5lbWl0KCdvdmVybGF5LWNsaWNrJywge1xuICAgICAgICAgICAgICAgIG9yaWdpbmFsRXZlbnQ6IGV2ZW50LFxuICAgICAgICAgICAgICAgIHRhcmdldDogdGhpcy4kZWxcbiAgICAgICAgICAgIH0pO1xuICAgICAgICB9XG4gICAgfSxcbiAgICBjb21wdXRlZDoge1xuICAgICAgICB2aXNpYmxlT3B0aW9ucygpIHtcbiAgICAgICAgICAgIGlmICh0aGlzLmZpbHRlclZhbHVlKSB7XG4gICAgICAgICAgICAgICAgaWYgKHRoaXMub3B0aW9uR3JvdXBMYWJlbCkge1xuICAgICAgICAgICAgICAgICAgICBsZXQgZmlsdGVyZWRHcm91cHMgPSBbXTtcbiAgICAgICAgICAgICAgICAgICAgZm9yIChsZXQgb3B0Z3JvdXAgb2YgdGhpcy5vcHRpb25zKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBsZXQgZmlsdGVyZWRTdWJPcHRpb25zID0gRmlsdGVyU2VydmljZS5maWx0ZXIodGhpcy5nZXRPcHRpb25Hcm91cENoaWxkcmVuKG9wdGdyb3VwKSwgdGhpcy5zZWFyY2hGaWVsZHMsIHRoaXMuZmlsdGVyVmFsdWUsIHRoaXMuZmlsdGVyTWF0Y2hNb2RlLCB0aGlzLmZpbHRlckxvY2FsZSk7XG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAoZmlsdGVyZWRTdWJPcHRpb25zICYmIGZpbHRlcmVkU3ViT3B0aW9ucy5sZW5ndGgpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBsZXQgZmlsdGVyZWRHcm91cCA9IHsuLi5vcHRncm91cH07XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgZmlsdGVyZWRHcm91cFt0aGlzLm9wdGlvbkdyb3VwQ2hpbGRyZW5dID0gZmlsdGVyZWRTdWJPcHRpb25zO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZpbHRlcmVkR3JvdXBzLnB1c2goZmlsdGVyZWRHcm91cCk7XG4gICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGZpbHRlcmVkR3JvdXBzXG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICByZXR1cm4gRmlsdGVyU2VydmljZS5maWx0ZXIodGhpcy5vcHRpb25zLCB0aGlzLnNlYXJjaEZpZWxkcywgdGhpcy5maWx0ZXJWYWx1ZSwgdGhpcy5maWx0ZXJNYXRjaE1vZGUsIHRoaXMuZmlsdGVyTG9jYWxlKTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBlbHNlIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gdGhpcy5vcHRpb25zO1xuICAgICAgICAgICAgfVxuICAgICAgICB9LFxuICAgICAgICBjb250YWluZXJDbGFzcygpIHtcbiAgICAgICAgICAgIHJldHVybiBbXG4gICAgICAgICAgICAgICAgJ3AtZHJvcGRvd24gcC1jb21wb25lbnQgcC1pbnB1dHdyYXBwZXInLFxuICAgICAgICAgICAgICAgIHtcbiAgICAgICAgICAgICAgICAgICAgJ3AtZGlzYWJsZWQnOiB0aGlzLmRpc2FibGVkLFxuICAgICAgICAgICAgICAgICAgICAncC1kcm9wZG93bi1jbGVhcmFibGUnOiB0aGlzLnNob3dDbGVhciAmJiAhdGhpcy5kaXNhYmxlZCxcbiAgICAgICAgICAgICAgICAgICAgJ3AtZm9jdXMnOiB0aGlzLmZvY3VzZWQsXG4gICAgICAgICAgICAgICAgICAgICdwLWlucHV0d3JhcHBlci1maWxsZWQnOiB0aGlzLm1vZGVsVmFsdWUsXG4gICAgICAgICAgICAgICAgICAgICdwLWlucHV0d3JhcHBlci1mb2N1cyc6IHRoaXMuZm9jdXNlZCB8fCB0aGlzLm92ZXJsYXlWaXNpYmxlXG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgXTtcbiAgICAgICAgfSxcbiAgICAgICAgbGFiZWxDbGFzcygpIHtcbiAgICAgICAgICAgIHJldHVybiBbXG4gICAgICAgICAgICAgICAgJ3AtZHJvcGRvd24tbGFiZWwgcC1pbnB1dHRleHQnLFxuICAgICAgICAgICAgICAgIHtcbiAgICAgICAgICAgICAgICAgICAgJ3AtcGxhY2Vob2xkZXInOiB0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4gICAgICB0bzogJG9wdGlvbnMuYXBwZW5kVGFyZ2V0LFxuICAgICAgZGlzYWJsZWQ6ICRvcHRpb25zLmFwcGVuZERpc2FibGVkXG4gICAgfSwgW1xuICAgICAgY3JlYXRlVk5vZGUoVHJhbnNpdGlvbiwge1xuICAgICAgICBuYW1lOiBcInAtY29ubmVjdGVkLW92ZXJsYXlcIixcbiAgICAgICAgb25FbnRlcjogJG9wdGlvbnMub25PdmVybGF5RW50ZXIsXG4gICAgICAgIG9uTGVhdmU6ICRvcHRpb25zLm9uT3ZlcmxheUxlYXZlLFxuICAgICAgICBvbkFmdGVyTGVhdmU6ICRvcHRpb25zLm9uT3ZlcmxheUFmdGVyTGVhdmVcbiAgICAgIH0sIHtcbiAgICAgICAgZGVmYXVsdDogd2l0aEN0eCgoKSA9PiBbXG4gICAgICAgICAgKCRkYXRhLm92ZXJsYXlWaXNpYmxlKVxuICAgICAgICAgICAgPyAob3BlbkJsb2NrKCksIGNyZWF0ZUJsb2NrKFwiZGl2XCIsIHtcbiAgICAgICAgICAgICAgICBrZXk6IDAsXG4gICAgICAgICAgICAgICAgcmVmOiAkb3B0aW9ucy5vdmVybGF5UmVmLFxuICAgICAgICAgICAgICAgIGNsYXNzOiAkb3B0aW9ucy5wYW5lbFN0eWxlQ2xhc3MsXG4gICAgICAgICAgICAgICAgb25DbGljazogX2NhY2hlWzEyXSB8fCAoX2NhY2hlWzEyXSA9ICguLi5hcmdzKSA9PiAoJG9wdGlvbnMub25PdmVybGF5Q2xpY2sgJiYgJG9wdGlvbnMub25PdmVybGF5Q2xpY2soLi4uYXJncykpKVxuICAgICAgICAgICAgICB9LCBbXG4gICAgICAgICAgICAgICAgcmVuZGVyU2xvdChfY3R4LiRzbG90cywgXCJoZWFkZXJcIiwge1xuICAgICAgICAgICAgICAgICAgdmFsdWU6ICRwcm9wcy5tb2RlbFZhbHVlLFxuICAgICAgICAgICAgICAgICAgb3B0aW9uczogJG9wdGlvbnMudmlzaWJsZU9wdGlvbnNcbiAgICAgICAgICAgICAgICB9KSxcbiAgICAgICAgICAgICAgICAoJHByb3BzLmZpbHRlcilcbiAgICAgICAgICAgICAgICAgID8gKG9wZW5CbG9jaygpLCBjcmVhdGVCbG9jayhcImRpdlwiLCBfaG9pc3RlZF8yLCBbXG4gICAgICAgICAgICAgICAgICAgICAgY3JlYXRlVk5vZGUoXCJkaXZcIiwgX2hvaXN0ZWRfMywgW1xuICAgICAgICAgICAgICAgICAgICAgICAgd2l0aERpcmVjdGl2ZXMoY3JlYXRlVk5vZGUoXCJpbnB1dFwiLCB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgIHR5cGU6IFwidGV4dFwiLFxuICAgICAgICAgICAgICAgICAgICAgICAgICByZWY6IFwiZmlsdGVySW5wdXRcIixcbiAgICAgICAgICAgICAgICAgICAgICAgICAgXCJvblVwZGF0ZTptb2RlbFZhbHVlXCI6IF9jYWNoZVs4XSB8fCAoX2NhY2hlWzhdID0gJGV2ZW50ID0+ICgkZGF0YS5maWx0ZXJWYWx1ZSA9ICRldmVudCkpLFxuICAgICAgICAgICAgICAgICAgICAgICAgICBvblZub2RlVXBkYXRlZDogX2NhY2hlWzldIHx8IChfY2FjaGVbOV0gPSAoLi4uYXJncykgPT4gKCRvcHRpb25zLm9uRmlsdGVyVXBkYXRlZCAmJiAkb3B0aW9ucy5vbkZpbHRlclVwZGF0ZWQoLi4uYXJncykpKSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgYXV0b0NvbXBsZXRlOiBcIm9mZlwiLFxuICAgICAgICAgICAgICAgICAgICAgICAgICBjbGFzczogXCJwLWRyb3Bkb3duLWZpbHRlciBwLWlucHV0dGV4dCBwLWNvbXBvbmVudFwiLFxuICAgICAgICAgICAgICAgICAgICAgICAgICBwbGFjZWhvbGRlcjogJHByb3BzLmZpbHRlclBsYWNlaG9sZGVyLFxuICAgICAgICAgICAgICAgICAgICAgICAgICBvbktleWRvd246IF9jYWNoZVsxMF0gfHwgKF9jYWNoZVsxMF0gPSAoLi4uYXJncykgPT4gKCRvcHRpb25zLm9uRmlsdGVyS2V5RG93biAmJiAkb3B0aW9ucy5vbkZpbHRlcktleURvd24oLi4uYXJncykpKSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgb25JbnB1dDogX2NhY2hlWzExXSB8fCAoX2NhY2hlWzExXSA9ICguLi5hcmdzKSA9PiAoJG9wdGlvbnMub25GaWx0ZXJDaGFuZ2UgJiYgJG9wdGlvbnMub25GaWx0ZXJDaGFuZ2UoLi4uYXJncykpKVxuICAgICAgICAgICAgICAgICAgICAgICAgfSwgbnVsbCwgNDAsIFtcInBsYWNlaG9sZGVyXCJdKSwgW1xuICAgICAgICAgICAgICAgICAgICAgICAgICBbdk1vZGVsVGV4dCwgJGRhdGEuZmlsdGVyVmFsdWVdXG4gICAgICAgICAgICAgICAgICAgICAgICBdKSxcbiAgICAgICAgICAgICAgICAgICAgICAgIF9ob2lzdGVkXzRcbiAgICAgICAgICAgICAgICAgICAgICBdKVxuICAgICAgICAgICAgICAgICAgICBdKSlcbiAgICAgICAgICAgICAgICAgIDogY3JlYXRlQ29tbWVudFZOb2RlKFwiXCIsIHRydWUpLFxuICAgICAgICAgICAgICAgIGNyZWF0ZVZOb2RlKFwiZGl2XCIsIHtcbiAgICAgICAgICAgICAgICAgIHJlZjogJG9wdGlvbnMuaXRlbXNXcmFwcGVyUmVmLFxuICAgICAgICAgICAgICAgICAgY2xhc3M6IFwicC1kcm9wZG93bi1pdGVtcy13cmFwcGVyXCIsXG4gICAgICAgICAgICAgICAgICBzdHlsZTogeydtYXgtaGVpZ2h0JzogJG9wdGlvbnMudmlydHVhbFNjcm9sbGVyRGlzYWJsZWQgPyAkcHJvcHMuc2Nyb2xsSGVpZ2h0IDogJyd9XG4gICAgICAgICAgICAgICAgfSwgW1xuICAgICAgICAgICAgICAgICAgY3JlYXRlVk5vZGUoX2NvbXBvbmVudF9WaXJ0dWFsU2Nyb2xsZXIsIG1lcmdlUHJvcHMoeyByZWY6ICRvcHRpb25zLnZpcnR1YWxTY3JvbGxlclJlZiB9LCAkcHJvcHMudmlydHVhbFNjcm9sbGVyT3B0aW9ucywge1xuICAgICAgICAgICAgICAgICAgICBpdGVtczogJG9wdGlvbnMudmlzaWJsZU9wdGlvbnMsXG4gICAgICAgICAgICAgICAgICAgIHN0eWxlOiB7J2hlaWdodCc6ICRwcm9wcy5zY3JvbGxIZWlnaHR9LFxuICAgICAgICAgICAgICAgICAgICBkaXNhYmxlZDogJG9wdGlvbnMudmlydHVhbFNjcm9sbGVyRGlzYWJsZWRcbiAgICAgICAgICAgICAgICAgIH0pLCBjcmVhdGVTbG90cyh7XG4gICAgICAgICAgICAgICAgICAgIGNvbnRlbnQ6IHdpdGhDdHgoKHsgc3R5bGVDbGFzcywgY29udGVudFJlZiwgaXRlbXMsIGdldEl0ZW1PcHRpb25zIH0pID0+IFtcbiAgICAgICAgICAgICAgICAgICAgICBjcmVhdGVWTm9kZShcInVsXCIsIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIHJlZjogY29udGVudFJlZixcbiAgICAgICAgICAgICAgICAgICAgICAgIGNsYXNzOiBbJ3AtZHJvcGRvd24taXRlbXMnLCBzdHlsZUNsYXNzXSxcbiAgICAgICAgICAgICAgICAgICAgICAgIHJvbGU6IFwibGlzdGJveFwiXG4gICAgICAgICAgICAgICAgICAgICAgfSwgW1xuICAgICAgICAgICAgICAgICAgICAgICAgKCEkcHJvcHMub3B0aW9uR3JvdXBMYWJlbClcbiAgICAgICAgICAgICAgICAgICAgICAgICAgPyAob3BlbkJsb2NrKHRydWUpLCBjcmVhdGVCbG9jayhGcmFnbWVudCwgeyBrZXk6IDAgfSwgcmVuZGVyTGlzdChpdGVtcywgKG9wdGlvbiwgaSkgPT4ge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHdpdGhEaXJlY3RpdmVzKChvcGVuQmxvY2soKSwgY3JlYXRlQmxvY2soXCJsaVwiLCB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNsYXNzOiBbJ3AtZHJvcGRvd24taXRlbScsIHsncC1oaWdobGlnaHQnOiAkb3B0aW9ucy5pc1NlbGVjdGVkKG9wdGlvbiksICdwLWRpc2FibGVkJzogJG9wdGlvbnMuaXNPcHRpb25EaXNhYmxlZChvcHRpb24pfV0sXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGtleTogJG9wdGlvbnMuZ2V0T3B0aW9uUmVuZGVyS2V5KG9wdGlvbiksXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG9uQ2xpY2s6ICRldmVudCA9PiAoJG9wdGlvbnMub25PcHRpb25TZWxlY3QoJGV2ZW50LCBvcHRpb24pKSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcm9sZTogXCJvcHRpb25cIixcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXCJhcmlhLWxhYmVsXCI6ICRvcHRpb25zLmdldE9wdGlvbkxhYmVsKG9wdGlvbiksXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFwiYXJpYS1zZWxlY3RlZFwiOiAkb3B0aW9ucy5pc1NlbGVjdGVkKG9wdGlvbilcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0sIFtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmVuZGVyU2xvdChfY3R4LiRzbG90cywgXCJvcHRpb25cIiwge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG9wdGlvbjogb3B0aW9uLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGluZGV4OiAkb3B0aW9ucy5nZXRPcHRpb25JbmRleChpLCBnZXRJdGVtT3B0aW9ucylcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSwgKCkgPT4gW1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNyZWF0ZVRleHRWTm9kZSh0b0Rpc3BsYXlTdHJpbmcoJG9wdGlvbnMuZ2V0T3B0aW9uTGFiZWwob3B0aW9uKSksIDEpXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIF0pXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICBdLCAxMCwgW1wib25DbGlja1wiLCBcImFyaWEtbGFiZWxcIiwgXCJhcmlhLXNlbGVjdGVkXCJdKSksIFtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgW19kaXJlY3RpdmVfcmlwcGxlXVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXSlcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9KSwgMTI4KSlcbiAgICAgICAgICAgICAgICAgICAgICAgICAgOiAob3BlbkJsb2NrKHRydWUpLCBjcmVhdGVCbG9jayhGcmFnbWVudCwgeyBrZXk6IDEgfSwgcmVuZGVyTGlzdChpdGVtcywgKG9wdGlvbkdyb3VwLCBpKSA9PiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gKG9wZW5CbG9jaygpLCBjcmVhdGVCbG9jayhGcmFnbWVudCwge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBrZXk6ICRvcHRpb25zLmdldE9wdGlvbkdyb3VwUmVuZGVyS2V5KG9wdGlvbkdyb3VwKVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSwgW1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjcmVhdGVWTm9kZShcImxpXCIsIF9ob2lzdGVkXzUsIFtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZW5kZXJTbG90KF9jdHguJHNsb3RzLCBcIm9wdGlvbmdyb3VwXCIsIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG9wdGlvbjogb3B0aW9uR3JvdXAsXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpbmRleDogJG9wdGlvbnMuZ2V0T3B0aW9uSW5kZXgoaSwgZ2V0SXRlbU9wdGlvbnMpXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSwgKCkgPT4gW1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY3JlYXRlVGV4dFZOb2RlKHRvRGlzcGxheVN0cmluZygkb3B0aW9ucy5nZXRPcHRpb25Hcm91cExhYmVsKG9wdGlvbkdyb3VwKSksIDEpXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXSlcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXSksXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChvcGVuQmxvY2sodHJ1ZSksIGNyZWF0ZUJsb2NrKEZyYWdtZW50LCBudWxsLCByZW5kZXJMaXN0KCRvcHRpb25zLmdldE9wdGlvbkdyb3VwQ2hpbGRyZW4ob3B0aW9uR3JvdXApLCAob3B0aW9uLCBpKSA9PiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHdpdGhEaXJlY3RpdmVzKChvcGVuQmxvY2soKSwgY3JlYXRlQmxvY2soXCJsaVwiLCB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjbGFzczogWydwLWRyb3Bkb3duLWl0ZW0nLCB7J3AtaGlnaGxpZ2h0JzogJG9wdGlvbnMuaXNTZWxlY3RlZChvcHRpb24pLCAncC1kaXNhYmxlZCc6ICRvcHRpb25zLmlzT3B0aW9uRGlzYWJsZWQob3B0aW9uKX1dLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAga2V5OiAkb3B0aW9ucy5nZXRPcHRpb25SZW5kZXJLZXkob3B0aW9uKSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG9uQ2xpY2s6ICRldmVudCA9PiAoJG9wdGlvbnMub25PcHRpb25TZWxlY3QoJGV2ZW50LCBvcHRpb24pKSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJvbGU6IFwib3B0aW9uXCIsXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBcImFyaWEtbGFiZWxcIjogJG9wdGlvbnMuZ2V0T3B0aW9uTGFiZWwob3B0aW9uKSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFwiYXJpYS1zZWxlY3RlZFwiOiAkb3B0aW9ucy5pc1NlbGVjdGVkKG9wdGlvbilcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9LCBbXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZW5kZXJTbG90KF9jdHguJHNsb3RzLCBcIm9wdGlvblwiLCB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG9wdGlvbjogb3B0aW9uLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpbmRleDogJG9wdGlvbnMuZ2V0T3B0aW9uSW5kZXgoaSwgZ2V0SXRlbU9wdGlvbnMpXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9LCAoKSA9PiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNyZWF0ZVRleHRWTm9kZSh0b0Rpc3BsYXlTdHJpbmcoJG9wdGlvbnMuZ2V0T3B0aW9uTGFiZWwob3B0aW9uKSksIDEpXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBdKVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIF0sIDEwLCBbXCJvbkNsaWNrXCIsIFwiYXJpYS1sYWJlbFwiLCBcImFyaWEtc2VsZWN0ZWRcIl0pKSwgW1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgW19kaXJlY3RpdmVfcmlwcGxlXVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIF0pXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0pLCAxMjgpKVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXSwgNjQpKVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0pLCAxMjgpKSxcbiAgICAgICAgICAgICAgICAgICAgICAgICgkZGF0YS5maWx0ZXJWYWx1ZSAmJiAoIWl0ZW1zIHx8IChpdGVtcyAmJiBpdGVtcy5sZW5ndGggPT09IDApKSlcbiAgICAgICAgICAgICAgICAgICAgICAgICAgPyAob3BlbkJsb2NrKCksIGNyZWF0ZUJsb2NrKFwibGlcIiwgX2hvaXN0ZWRfNiwgW1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmVuZGVyU2xvdChfY3R4LiRzbG90cywgXCJlbXB0eWZpbHRlclwiLCB7fSwgKCkgPT4gW1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjcmVhdGVUZXh0Vk5vZGUodG9EaXNwbGF5U3RyaW5nKCRvcHRpb25zLmVtcHR5RmlsdGVyTWVzc2FnZVRleHQpLCAxKVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXSlcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBdKSlcbiAgICAgICAgICAgICAgICAgICAgICAgICAgOiAoKCEkcHJvcHMub3B0aW9ucyB8fCAoJHByb3BzLm9wdGlvbnMgJiYgJHByb3BzLm9wdGlvbnMubGVuZ3RoID09PSAwKSkpXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgPyAob3BlbkJsb2NrKCksIGNyZWF0ZUJsb2NrKFwibGlcIiwgX2hvaXN0ZWRfNywgW1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZW5kZXJTbG90KF9jdHguJHNsb3RzLCBcImVtcHR5XCIsIHt9LCAoKSA9PiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY3JlYXRlVGV4dFZOb2RlKHRvRGlzcGxheVN0cmluZygkb3B0aW9ucy5lbXB0eU1lc3NhZ2VUZXh0KSwgMSlcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXSlcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIF0pKVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIDogY3JlYXRlQ29tbWVudFZOb2RlKFwiXCIsIHRydWUpXG4gICAgICAgICAgICAgICAgICAgICAgXSwgMilcbiAgICAgICAgICAgICAgICAgICAgXSksXG4gICAgICAgICAgICAgICAgICAgIF86IDJcbiAgICAgICAgICAgICAgICAgIH0sIFtcbiAgICAgICAgICAgICAgICAgICAgKF9jdHguJHNsb3RzLmxvYWRlcilcbiAgICAgICAgICAgICAgICAgICAgICA/IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgbmFtZTogXCJsb2FkZXJcIixcbiAgICAgICAgICAgICAgICAgICAgICAgICAgZm46IHdpdGhDdHgoKHsgb3B0aW9ucyB9KSA9PiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcmVuZGVyU2xvdChfY3R4LiRzbG90cywgXCJsb2FkZXJcIiwgeyBvcHRpb25zOiBvcHRpb25zIH0pXG4gICAgICAgICAgICAgICAgICAgICAgICAgIF0pXG4gICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgOiB1bmRlZmluZWRcbiAgICAgICAgICAgICAgICAgIF0pLCAxMDQwLCBbXCJpdGVtc1wiLCBcInN0eWxlXCIsIFwiZGlzYWJsZWRcIl0pXG4gICAgICAgICAgICAgICAgXSwgNCksXG4gICAgICAgICAgICAgICAgcmVuZGVyU2xvdChfY3R4LiRzbG90cywgXCJmb290ZXJcIiwge1xuICAgICAgICAgICAgICAgICAgdmFsdWU6ICRwcm9wcy5tb2RlbFZhbHVlLFxuICAgICAgICAgICAgICAgICAgb3B0aW9uczogJG9wdGlvbnMudmlzaWJsZU9wdGlvbnNcbiAgICAgICAgICAgICAgICB9KVxuICAgICAgICAgICAgICBdLCAyKSlcbiAgICAgICAgICAgIDogY3JlYXRlQ29tbWVudFZOb2RlKFwiXCIsIHRydWUpXG4gICAgICAgIF0pLFxuICAgICAgICBfOiAzXG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FxuLnAtZHJvcGRvd24tZmlsdGVyIHtcXG4gICAgd2lkdGg6IDEwMCU7XFxufVxcbi5wLWRyb3Bkb3duLWZpbHRlci1jb250YWluZXIge1xcbiAgICBwb3NpdGlvbjogcmVsYXRpdmU7XFxufVxcbi5wLWRyb3Bkb3duLWZpbHRlci1pY29uIHtcXG4gICAgcG9zaXRpb246IGFic29sdXRlO1xcbiAgICB0b3A6IDUwJTtcXG4gICAgbWFyZ2luLXRvcDogLS41cmVtO1xcbn1cXG4ucC1mbHVpZCAucC1kcm9wZG93biB7XFxuICAgIGRpc3BsYXk6IC13ZWJraXQtYm94O1xcbiAgICBkaXNwbGF5OiAtbXMtZmxleGJveDtcXG4gICAgZGlzcGxheTogZmxleDtcXG59XFxuLnAtZmx1aWQgLnAtZHJvcGRvd24gLnAtZHJvcGRvd24tbGFiZWwge1xcbiAgICB3aWR0aDogMSU7XFxufVxcblwiO1xuc3R5bGVJbmplY3QoY3NzXzI0OHopO1xuXG5zY3JpcHQucmVuZGVyID0gcmVuZGVyO1xuXG5leHBvcnQgZGVmYXVsdCBzY3JpcHQ7XG4iXSwibmFtZXMiOltdLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///6635\n')},4019:(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{eval("/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"Z\": () => (__WEBPACK_DEFAULT_EXPORT__)\n/* harmony export */ });\n/* harmony import */ var primevue_utils__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(6954);\n\n\nfunction bindEvents(el) {\n el.addEventListener('mousedown', onMouseDown);\n}\n\nfunction unbindEvents(el) {\n el.removeEventListener('mousedown', onMouseDown);\n}\n\nfunction create(el) {\n let ink = document.createElement('span');\n ink.className = 'p-ink';\n el.appendChild(ink);\n\n ink.addEventListener('animationend', onAnimationEnd);\n}\n\nfunction remove(el) {\n let ink = getInk(el);\n if (ink) {\n unbindEvents(el);\n ink.removeEventListener('animationend', onAnimationEnd);\n ink.remove();\n }\n}\n\nfunction onMouseDown(event) {\n let target = event.currentTarget;\n let ink = getInk(target);\n if (!ink || getComputedStyle(ink, null).display === 'none') {\n return;\n }\n\n primevue_utils__WEBPACK_IMPORTED_MODULE_0__/* .DomHandler.removeClass */ .p7.removeClass(ink, 'p-ink-active');\n if (!primevue_utils__WEBPACK_IMPORTED_MODULE_0__/* .DomHandler.getHeight */ .p7.getHeight(ink) && !primevue_utils__WEBPACK_IMPORTED_MODULE_0__/* .DomHandler.getWidth */ .p7.getWidth(ink)) {\n let d = Math.max(primevue_utils__WEBPACK_IMPORTED_MODULE_0__/* .DomHandler.getOuterWidth */ .p7.getOuterWidth(target), primevue_utils__WEBPACK_IMPORTED_MODULE_0__/* .DomHandler.getOuterHeight */ .p7.getOuterHeight(target));\n ink.style.height = d + 'px';\n ink.style.width = d + 'px';\n }\n\n let offset = primevue_utils__WEBPACK_IMPORTED_MODULE_0__/* .DomHandler.getOffset */ .p7.getOffset(target);\n let x = event.pageX - offset.left + document.body.scrollTop - primevue_utils__WEBPACK_IMPORTED_MODULE_0__/* .DomHandler.getWidth */ .p7.getWidth(ink) / 2;\n let y = event.pageY - offset.top + document.body.scrollLeft - primevue_utils__WEBPACK_IMPORTED_MODULE_0__/* .DomHandler.getHeight */ .p7.getHeight(ink) / 2;\n\n ink.style.top = y + 'px';\n ink.style.left = x + 'px';\n primevue_utils__WEBPACK_IMPORTED_MODULE_0__/* .DomHandler.addClass */ .p7.addClass(ink, 'p-ink-active');\n}\n\nfunction onAnimationEnd(event) {\n primevue_utils__WEBPACK_IMPORTED_MODULE_0__/* .DomHandler.removeClass */ .p7.removeClass(event.currentTarget, 'p-ink-active');\n}\n\nfunction getInk(el) {\n for (let i = 0; i < el.children.length; i++) {\n if (typeof el.children[i].className === 'string' && el.children[i].className.indexOf('p-ink') !== -1) {\n return el.children[i];\n }\n }\n return null;\n}\n\nconst Ripple = {\n mounted(el, binding) {\n if (binding.instance.$primevue && binding.instance.$primevue.config && binding.instance.$primevue.config.ripple) {\n create(el);\n bindEvents(el);\n }\n },\n unmounted(el) {\n remove(el);\n }\n};\n\n/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (Ripple);\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNDAxOS5qcyIsIm1hcHBpbmdzIjoiOzs7O0FBQTRDOztBQUU1QztBQUNBO0FBQ0E7O0FBRUE7QUFDQTtBQUNBOztBQUVBO0FBQ0E7QUFDQTtBQUNBOztBQUVBO0FBQ0E7O0FBRUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTs7QUFFQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7O0FBRUEsSUFBSSx3RkFBc0I7QUFDMUIsU0FBUyxvRkFBb0IsVUFBVSxrRkFBbUI7QUFDMUQseUJBQXlCLDRGQUF3QixVQUFVLDhGQUF5QjtBQUNwRjtBQUNBO0FBQ0E7O0FBRUEsaUJBQWlCLG9GQUFvQjtBQUNyQyxrRUFBa0Usa0ZBQW1CO0FBQ3JGLGtFQUFrRSxvRkFBb0I7O0FBRXRGO0FBQ0E7QUFDQSxJQUFJLGtGQUFtQjtBQUN2Qjs7QUFFQTtBQUNBLElBQUksd0ZBQXNCO0FBQzFCOztBQUVBO0FBQ0Esb0JBQW9CLHdCQUF3QjtBQUM1QztBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7O0FBRUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0EsS0FBSztBQUNMO0FBQ0E7QUFDQTtBQUNBOztBQUVBLGlFQUFlLE1BQU0sRUFBQyIsInNvdXJjZXMiOlsid2VicGFjazovLy8uL25vZGVfbW9kdWxlcy9wcmltZXZ1ZS9yaXBwbGUvcmlwcGxlLmVzbS5qcz8yMTZkIl0sInNvdXJjZXNDb250ZW50IjpbImltcG9ydCB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lb2YgZWwuY2hpbGRyZW5baV0uY2xhc3NOYW1lID09PSAnc3RyaW5nJyAmJiBlbC5jaGlsZHJlbltpXS5jbGFzc05hbWUuaW5kZXhPZigncC1pbmsnKSAhPT0gLTEpIHtcbiAgICAgICAgICAgIHJldHVybiBlbC5jaGlsZHJlbltpXTtcbiAgICAgICAgfVxuICAgIH1cbiAgICByZXR1cm4gbnVsbDtcbn1cblxuY29uc3QgUmlwcGxlID0ge1xuICAgIG1vdW50ZWQoZWwsIGJpbmRpbmcpIHtcbiAgICAgICAgaWYgKGJpbmRpbmcuaW5zdGFuY2UuJHByaW1ldnVlICYmIGJpbmRpbmcuaW5zdGFuY2UuJHByaW1ldnVlLmNvbmZpZyAmJiBiaW5kaW5nLmluc3RhbmNlLiRwcmltZXZ1ZS5jb25maWcucmlwcGxlKSB7XG4gICAgICAgICAgICBjcmVhdGUoZWwpO1xuICAgICAgICAgICAgYmluZEV2ZW50cyhlbCk7XG4gICAgICAgIH1cbiAgICB9LFxuICAgIHVubW91bnRlZChlbCkge1xuICAgICAgICByZW1vdmUoZWwpO1xuICAgIH1cbn07XG5cbmV4cG9ydCBkZWZhdWx0IFJpcHBsZTtcbiJdLCJuYW1lcyI6W10sInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///4019\n")},921:(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{eval("/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"Z\": () => (__WEBPACK_DEFAULT_EXPORT__)\n/* harmony export */ });\n/* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(5166);\n\n\nvar script = {\n name: 'VirtualScroller',\n emits: ['update:numToleratedItems', 'scroll-index-change', 'lazy-load'],\n props: {\n items: {\n type: Array,\n default: null\n },\n itemSize: {\n type: [Number,Array],\n default: null\n },\n scrollHeight: null,\n scrollWidth: null,\n orientation: {\n type: String,\n default: 'vertical'\n },\n numToleratedItems: {\n type: Number,\n default: null\n },\n delay: {\n type: Number,\n default: 0\n },\n lazy: {\n type: Boolean,\n default: false\n },\n showLoader: {\n type: Boolean,\n default: false\n },\n loading: {\n type: Boolean,\n default: false\n },\n style: null,\n class: null,\n disabled: {\n type: Boolean,\n default: false\n }\n },\n data() {\n return {\n first: this.isBoth() ? { rows: 0, cols: 0 } : 0,\n last: this.isBoth() ? { rows: 0, cols: 0 } : 0,\n numItemsInViewport: this.isBoth() ? { rows: 0, cols: 0 } : 0,\n lastScrollPos: this.isBoth() ? { top: 0, left: 0 } : 0,\n d_numToleratedItems: this.numToleratedItems,\n d_loading: this.loading,\n loaderArr: null\n }\n },\n element: null,\n content: null,\n spacer: null,\n scrollTimeout: null,\n mounted() {\n this.init();\n },\n watch: {\n numToleratedItems(newValue) {\n this.d_numToleratedItems = newValue;\n },\n loading(newValue) {\n this.d_loading = newValue;\n },\n items(newValue, oldVal) {\n if (!oldVal || oldVal.length !== (newValue || []).length) {\n this.init();\n }\n }\n },\n methods: {\n init() {\n if (!this.disabled) {\n this.setSize();\n this.calculateOptions();\n this.setSpacerSize();\n }\n },\n getLast(last, isCols) {\n return this.items ? Math.min((isCols ? this.items[0].length : this.items.length), last) : 0;\n },\n calculateOptions() {\n const isBoth = this.isBoth();\n const isHorizontal = this.isHorizontal();\n const first = this.first;\n const itemSize = this.itemSize;\n const contentPadding = this.getContentPadding();\n const contentWidth = this.element ? this.element.offsetWidth - contentPadding.left : 0;\n const contentHeight = this.element ? this.element.offsetHeight - contentPadding.top : 0;\n const calculateNumItemsInViewport = (_contentSize, _itemSize) => Math.ceil(_contentSize / (_itemSize || _contentSize));\n const numItemsInViewport = isBoth ?\n { rows: calculateNumItemsInViewport(contentHeight, itemSize[0]), cols: calculateNumItemsInViewport(contentWidth, itemSize[1]) } :\n calculateNumItemsInViewport((isHorizontal ? contentWidth : contentHeight), itemSize);\n\n let numToleratedItems = this.d_numToleratedItems || Math.ceil((isBoth ? numItemsInViewport.rows : numItemsInViewport) / 2);\n const calculateLast = (_first, _num, _isCols) => this.getLast(_first + _num + ((_first < numToleratedItems ? 2 : 3) * numToleratedItems), _isCols);\n const last = isBoth ?\n { rows: calculateLast(first.rows, numItemsInViewport.rows), cols: calculateLast(first.cols, numItemsInViewport.cols, true) } :\n calculateLast(first, numItemsInViewport);\n\n this.d_numToleratedItems = numToleratedItems;\n this.$emit('update:numToleratedItems', this.d_numToleratedItems);\n this.last = last;\n this.numItemsInViewport = numItemsInViewport;\n\n if (this.showLoader) {\n if (this.$slots && this.$slots.loader) {\n this.loaderArr = Array.from({ length: (isBoth ? numItemsInViewport.rows : numItemsInViewport) });\n }\n else {\n this.loaderArr = Array.from({ length: 1});\n }\n }\n\n if (this.lazy) {\n this.$emit('lazy-load', { first, last });\n }\n },\n getContentPadding() {\n if (this.content) {\n const style = getComputedStyle(this.content);\n const left = parseInt(parseFloat(style.paddingLeft.slice(0, -2)), 10);\n const right = parseInt(parseFloat(style.paddingRight.slice(0, -2)), 10);\n const top = parseInt(parseFloat(style.paddingTop.slice(0, -2)), 10);\n const bottom = parseInt(parseFloat(style.paddingBottom.slice(0, -2)), 10);\n\n return { left, right, top, bottom, x: left + right, y: top + bottom };\n }\n\n return { left: 0, right: 0, top: 0, bottom: 0, x: 0, y: 0 };\n },\n setSize() {\n if (this.element) {\n const isBoth = this.isBoth();\n const isHorizontal = this.isHorizontal();\n const parentElement = this.element.parentElement;\n const width = this.scrollWidth || `${(this.element.offsetWidth || parentElement.offsetWidth)}px`;\n const height = this.scrollHeight || `${(this.element.offsetHeight || parentElement.offsetHeight)}px`;\n const setProp = (_name, _value) => this.element.style[_name] = _value;\n\n if (isBoth) {\n setProp('height', height);\n setProp('width', width);\n }\n else {\n isHorizontal ? setProp('width', width) : setProp('height', height);\n }\n }\n },\n setSpacerSize() {\n const items = this.items;\n\n if (this.spacer && items) {\n const isBoth = this.isBoth();\n const isHorizontal = this.isHorizontal();\n const itemSize = this.itemSize;\n const contentPadding = this.getContentPadding();\n const setProp = (_name, _value, _size, _padding = 0) => this.spacer.style[_name] = (((_value || []).length * _size) + _padding) + 'px';\n\n if (isBoth) {\n setProp('height', items[0], itemSize[0], contentPadding.y);\n setProp('width', items[1], itemSize[1], contentPadding.x);\n }\n else {\n isHorizontal ? setProp('width', items, itemSize, contentPadding.x) : setProp('height', items, itemSize, contentPadding.y);\n }\n }\n },\n setContentPosition(pos) {\n if (this.content) {\n const isBoth = this.isBoth();\n const isHorizontal = this.isHorizontal();\n const content = this.content;\n const first = pos ? pos.first : this.first;\n const itemSize = this.itemSize;\n const calculateTranslateVal = (_first, _size) => (_first * _size);\n const setTransform = (_x = 0, _y = 0) => content.style.transform = `translate3d(${_x}px, ${_y}px, 0)`;\n\n if (isBoth) {\n setTransform(calculateTranslateVal(first.cols, itemSize[1]), calculateTranslateVal(first.rows, itemSize[0]));\n }\n else {\n const translateVal = calculateTranslateVal(first, itemSize);\n isHorizontal ? setTransform(translateVal, 0) : setTransform(0, translateVal);\n }\n }\n },\n onScrollPositionChange(event) {\n const target = event.target;\n const isBoth = this.isBoth();\n const isHorizontal = this.isHorizontal();\n const itemSize = this.itemSize;\n const contentPadding = this.getContentPadding();\n const calculateScrollPos = (_pos, _padding) => _pos ? (_pos > _padding ? _pos - _padding : _pos) : 0;\n const calculateCurrentIndex = (_pos, _size) => Math.floor(_pos / (_size || _pos));\n const calculateTriggerIndex = (_currentIndex, _first, _last, _num, _isScrollDownOrRight) => {\n return (_currentIndex <= this.d_numToleratedItems ? this.d_numToleratedItems : (_isScrollDownOrRight ? (_last - _num - this.d_numToleratedItems) : (_first + this.d_numToleratedItems - 1)))\n };\n const calculateFirst = (_currentIndex, _triggerIndex, _first, _last, _num, _isScrollDownOrRight) => {\n if (_currentIndex <= this.d_numToleratedItems)\n return 0;\n else\n return _isScrollDownOrRight ?\n (_currentIndex < _triggerIndex ? _first : _currentIndex - this.d_numToleratedItems) :\n (_currentIndex > _triggerIndex ? _first : _currentIndex - (2 * this.d_numToleratedItems));\n };\n const calculateLast = (_currentIndex, _first, _last, _num, _isCols) => {\n let lastValue = _first + _num + (2 * this.d_numToleratedItems);\n\n if (_currentIndex >= this.d_numToleratedItems) {\n lastValue += (this.d_numToleratedItems + 1);\n }\n\n return this.getLast(lastValue, _isCols);\n };\n\n const scrollTop = calculateScrollPos(target.scrollTop, contentPadding.top);\n const scrollLeft = calculateScrollPos(target.scrollLeft, contentPadding.left);\n\n let newFirst = 0;\n let newLast = this.last;\n let isRangeChanged = false;\n\n if (isBoth) {\n const isScrollDown = this.lastScrollPos.top <= scrollTop;\n const isScrollRight = this.lastScrollPos.left <= scrollLeft;\n const currentIndex = { rows: calculateCurrentIndex(scrollTop, itemSize[0]), cols: calculateCurrentIndex(scrollLeft, itemSize[1]) };\n const triggerIndex = {\n rows: calculateTriggerIndex(currentIndex.rows, this.first.rows, this.last.rows, this.numItemsInViewport.rows, isScrollDown),\n cols: calculateTriggerIndex(currentIndex.cols, this.first.cols, this.last.cols, this.numItemsInViewport.cols, isScrollRight)\n };\n\n newFirst = {\n rows: calculateFirst(currentIndex.rows, triggerIndex.rows, this.first.rows, this.last.rows, this.numItemsInViewport.rows, isScrollDown),\n cols: calculateFirst(currentIndex.cols, triggerIndex.cols, this.first.cols, this.last.cols, this.numItemsInViewport.cols, isScrollRight)\n };\n newLast = {\n rows: calculateLast(currentIndex.rows, newFirst.rows, this.last.rows, this.numItemsInViewport.rows),\n cols: calculateLast(currentIndex.cols, newFirst.cols, this.last.cols, this.numItemsInViewport.cols, true)\n };\n isRangeChanged = (newFirst.rows !== this.first.rows || newFirst.cols !== this.first.cols) || (newLast.rows !== this.last.rows || newLast.cols !== this.last.cols);\n\n this.lastScrollPos = { top: scrollTop, left: scrollLeft };\n }\n else {\n const scrollPos = isHorizontal ? scrollLeft : scrollTop;\n const isScrollDownOrRight = this.lastScrollPos <= scrollPos;\n const currentIndex = calculateCurrentIndex(scrollPos, itemSize);\n const triggerIndex = calculateTriggerIndex(currentIndex, this.first, this.last, this.numItemsInViewport, isScrollDownOrRight);\n\n newFirst = calculateFirst(currentIndex, triggerIndex, this.first, this.last, this.numItemsInViewport, isScrollDownOrRight);\n newLast = calculateLast(currentIndex, newFirst, this.last, this.numItemsInViewport);\n isRangeChanged = newFirst !== this.first || newLast !== this.last;\n\n this.lastScrollPos = scrollPos;\n }\n\n return {\n first: newFirst,\n last: newLast,\n isRangeChanged\n }\n },\n onScrollChange(event) {\n const { first, last, isRangeChanged } = this.onScrollPositionChange(event);\n\n if (isRangeChanged) {\n const newState = { first, last };\n\n this.setContentPosition(newState);\n\n if (this.lazy) {\n this.$emit('lazy-load', { first, last });\n }\n this.first = first;\n this.last = last;\n\n this.$emit('scroll-index-change', { first, last });\n }\n },\n onScroll(event) {\n if (this.delay && !this.lazy) {\n if (this.scrollTimeout) {\n clearTimeout(this.scrollTimeout);\n }\n\n if (!this.d_loading && this.showLoader) {\n const { isRangeChanged: changed } = this.onScrollPositionChange(event);\n\n if (changed) {\n this.d_loading = true;\n }\n }\n\n this.scrollTimeout = setTimeout(() => {\n this.onScrollChange(event);\n\n if (this.d_loading && this.showLoader && !this.lazy) {\n this.d_loading = false;\n }\n }, this.delay);\n }\n else {\n this.onScrollChange(event);\n }\n },\n getOptions(renderedIndex) {\n let count = this.items.length;\n let index = this.isBoth() ? this.first.rows + renderedIndex : this.first + renderedIndex;\n return {\n index,\n count,\n first: index === 0,\n last: index === (count - 1),\n even: index % 2 === 0,\n odd: index % 2 !== 0\n };\n },\n getLoaderOptions(index) {\n let count = this.loaderArr.length;\n return {\n loading: this.d_loading,\n first: index === 0,\n last: index === (count - 1),\n even: index % 2 === 0,\n odd: index % 2 !== 0\n }\n },\n isHorizontal() {\n return this.orientation === 'horizontal';\n },\n isBoth() {\n return this.orientation === 'both';\n },\n scrollTo(options) {\n if (this.element) {\n this.element.scrollTo(options);\n }\n },\n scrollToIndex(index, behavior = 'auto') {\n const isBoth = this.isBoth();\n const isHorizontal = this.isHorizontal();\n const itemSize = this.itemSize;\n const contentPadding = this.getContentPadding();\n const calculateFirst = (_index = 0) => (_index <= this.d_numToleratedItems ? 0 : _index);\n const calculateCoord = (_first, _size, _padding) => (_first * _size) + _padding;\n const scrollTo = (left = 0, top = 0) => this.scrollTo({ left, top, behavior });\n\n if (isBoth) {\n const newFirst = { rows: calculateFirst(index[0]), cols: calculateFirst(index[1]) };\n if (newFirst.rows !== this.first.rows || newFirst.cols !== this.first.cols)\n scrollTo(calculateCoord(newFirst.cols, itemSize[1], contentPadding.left),calculateCoord(newFirst.rows, itemSize[0], contentPadding.top));\n }\n else {\n const newFirst = calculateFirst(index);\n\n if (newFirst !== this.first) {\n isHorizontal ? scrollTo(calculateCoord(newFirst, itemSize, contentPadding.left), 0) : scrollTo(0, calculateCoord(newFirst, itemSize, contentPadding.top));\n }\n\n this.first = newFirst;\n }\n },\n scrollInView(index, to, behavior = 'auto') {\n if (to) {\n const isBoth = this.isBoth();\n const isHorizontal = this.isHorizontal();\n const { first, viewport } = this.getRenderedRange();\n const itemSize = this.itemSize;\n const scrollTo = (left = 0, top = 0) => this.scrollTo({ left, top, behavior });\n const isToStart = to === 'to-start';\n const isToEnd = to === 'to-end';\n\n if (isToStart) {\n if (isBoth) {\n if (viewport.first.rows - first.rows > index[0]) {\n scrollTo(viewport.first.cols * itemSize[1], (viewport.first.rows - 1) * itemSize[0]);\n }\n else if (viewport.first.cols - first.cols > index[1]) {\n scrollTo((viewport.first.cols - 1) * itemSize[1], viewport.first.rows * itemSize[0]);\n }\n }\n else {\n if (viewport.first - first > index) {\n const pos = (viewport.first - 1) * itemSize;\n isHorizontal ? scrollTo(pos, 0) : scrollTo(0, pos);\n }\n }\n }\n else if (isToEnd) {\n if (isBoth) {\n if (viewport.last.rows - first.rows <= index[0] + 1) {\n scrollTo(viewport.first.cols * itemSize[1], (viewport.first.rows + 1) * itemSize[0]);\n }\n else if (viewport.last.cols - first.cols <= index[1] + 1) {\n scrollTo((viewport.first.cols + 1) * itemSize[1], viewport.first.rows * itemSize[0]);\n }\n }\n else {\n if (viewport.last - first <= index + 1) {\n const pos = (viewport.first + 1) * itemSize;\n isHorizontal ? scrollTo(pos, 0) : scrollTo(0, pos);\n }\n }\n }\n }\n else {\n this.scrollToIndex(index, behavior);\n }\n },\n getRenderedRange() {\n const isBoth = this.isBoth();\n const isHorizontal = this.isHorizontal();\n const itemSize = this.itemSize;\n const calculateFirstInViewport = (_pos, _size) => Math.floor(_pos / (_size || _pos));\n\n let firstInViewport = this.first;\n let lastInViewport = 0;\n\n if (this.element) {\n const scrollTop = this.element.scrollTop;\n const scrollLeft = this.element.scrollLeft;\n\n if (isBoth) {\n firstInViewport = { rows: calculateFirstInViewport(scrollTop, itemSize[0]), cols: calculateFirstInViewport(scrollLeft, itemSize[1]) };\n lastInViewport = { rows: firstInViewport.rows + this.numItemsInViewport.rows, cols: firstInViewport.cols + this.numItemsInViewport.cols };\n }\n else {\n const scrollPos = isHorizontal ? scrollLeft : scrollTop;\n firstInViewport = calculateFirstInViewport(scrollPos, itemSize);\n lastInViewport = firstInViewport + this.numItemsInViewport;\n }\n }\n\n return {\n first: this.first,\n last: this.last,\n viewport: {\n first: firstInViewport,\n last: lastInViewport\n }\n };\n },\n elementRef(el) {\n this.element = el;\n },\n contentRef(el) {\n this.content = el;\n },\n spacerRef(el) {\n this.spacer = el;\n }\n },\n computed: {\n containerClass() {\n return ['p-virtualscroller', {\n 'p-both-scroll': this.isBoth(),\n 'p-horizontal-scroll': this.isHorizontal()\n }, this.class];\n },\n loaderClass() {\n return ['p-virtualscroller-loader', {\n 'p-component-overlay': !this.$slots.loader\n }];\n },\n loadedItems() {\n const items = this.items;\n if (items && !this.d_loading) {\n const isBoth = this.isBoth();\n\n if (isBoth) {\n return items.slice(this.first.rows, this.last.rows).map((item) => {\n const items = item.slice(this.first.cols, this.last.cols);\n return items;\n });\n }\n else {\n return items.slice(this.first, this.last).map((item) => {\n return item;\n });\n }\n }\n\n return [];\n }\n }\n};\n\nconst _hoisted_1 = /*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__/* .createVNode */ .Wm)(\"i\", { class: \"p-virtualscroller-loading-icon pi pi-spinner pi-spin\" }, null, -1);\n\nfunction render(_ctx, _cache, $props, $setup, $data, $options) {\n return (!$props.disabled)\n ? ((0,vue__WEBPACK_IMPORTED_MODULE_0__/* .openBlock */ .wg)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__/* .createBlock */ .j4)(\"div\", {\n key: 0,\n ref: $options.elementRef,\n class: $options.containerClass,\n style: $props.style,\n onScroll: _cache[1] || (_cache[1] = (...args) => ($options.onScroll && $options.onScroll(...args)))\n }, [\n (0,vue__WEBPACK_IMPORTED_MODULE_0__/* .renderSlot */ .WI)(_ctx.$slots, \"content\", {\n styleClass: \"p-virtualscroller-content\",\n contentRef: $options.contentRef,\n items: $options.loadedItems,\n getItemOptions: $options.getOptions\n }, () => [\n (0,vue__WEBPACK_IMPORTED_MODULE_0__/* .createVNode */ .Wm)(\"div\", {\n ref: $options.contentRef,\n class: \"p-virtualscroller-content\"\n }, [\n ((0,vue__WEBPACK_IMPORTED_MODULE_0__/* .openBlock */ .wg)(true), (0,vue__WEBPACK_IMPORTED_MODULE_0__/* .createBlock */ .j4)(vue__WEBPACK_IMPORTED_MODULE_0__/* .Fragment */ .HY, null, (0,vue__WEBPACK_IMPORTED_MODULE_0__/* .renderList */ .Ko)($options.loadedItems, (item, index) => {\n return (0,vue__WEBPACK_IMPORTED_MODULE_0__/* .renderSlot */ .WI)(_ctx.$slots, \"item\", {\n key: index,\n item: item,\n options: $options.getOptions(index)\n })\n }), 128))\n ], 512)\n ]),\n (0,vue__WEBPACK_IMPORTED_MODULE_0__/* .createVNode */ .Wm)(\"div\", {\n ref: $options.spacerRef,\n class: \"p-virtualscroller-spacer\"\n }, null, 512),\n ($data.d_loading)\n ? ((0,vue__WEBPACK_IMPORTED_MODULE_0__/* .openBlock */ .wg)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__/* .createBlock */ .j4)(\"div\", {\n key: 0,\n class: $options.loaderClass\n }, [\n ((0,vue__WEBPACK_IMPORTED_MODULE_0__/* .openBlock */ .wg)(true), (0,vue__WEBPACK_IMPORTED_MODULE_0__/* .createBlock */ .j4)(vue__WEBPACK_IMPORTED_MODULE_0__/* .Fragment */ .HY, null, (0,vue__WEBPACK_IMPORTED_MODULE_0__/* .renderList */ .Ko)($data.loaderArr, (loadItem, index) => {\n return (0,vue__WEBPACK_IMPORTED_MODULE_0__/* .renderSlot */ .WI)(_ctx.$slots, \"loader\", {\n key: index,\n options: $options.getLoaderOptions(index)\n }, () => [\n _hoisted_1\n ])\n }), 128))\n ], 2))\n : (0,vue__WEBPACK_IMPORTED_MODULE_0__/* .createCommentVNode */ .kq)(\"\", true)\n ], 38))\n : ((0,vue__WEBPACK_IMPORTED_MODULE_0__/* .openBlock */ .wg)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__/* .createBlock */ .j4)(vue__WEBPACK_IMPORTED_MODULE_0__/* .Fragment */ .HY, { key: 1 }, [\n (0,vue__WEBPACK_IMPORTED_MODULE_0__/* .renderSlot */ .WI)(_ctx.$slots, \"default\"),\n (0,vue__WEBPACK_IMPORTED_MODULE_0__/* .renderSlot */ .WI)(_ctx.$slots, \"content\", { items: $props.items })\n ], 64))\n}\n\nfunction styleInject(css, ref) {\n if ( ref === void 0 ) ref = {};\n var insertAt = ref.insertAt;\n\n if (!css || typeof document === 'undefined') { return; }\n\n var head = document.head || document.getElementsByTagName('head')[0];\n var style = document.createElement('style');\n style.type = 'text/css';\n\n if (insertAt === 'top') {\n if (head.firstChild) {\n head.insertBefore(style, head.firstChild);\n } else {\n head.appendChild(style);\n }\n } else {\n head.appendChild(style);\n }\n\n if (style.styleSheet) {\n style.styleSheet.cssText = css;\n } else {\n style.appendChild(document.createTextNode(css));\n }\n}\n\nvar css_248z = \"\\n.p-virtualscroller {\\n position: relative;\\n overflow: auto;\\n contain: strict;\\n -webkit-transform: translateZ(0);\\n transform: translateZ(0);\\n will-change: scroll-position;\\n}\\n.p-virtualscroller-content {\\n position: absolute;\\n top: 0;\\n left: 0;\\n contain: content;\\n min-height: 100%;\\n min-width: 100%;\\n will-change: transform;\\n}\\n.p-virtualscroller-spacer {\\n position: absolute;\\n top: 0;\\n left: 0;\\n height: 1px;\\n width: 1px;\\n -webkit-transform-origin: 0 0;\\n transform-origin: 0 0;\\n pointer-events: none;\\n}\\n.p-virtualscroller .p-virtualscroller-loader {\\n position: sticky;\\n top: 0;\\n left: 0;\\n width: 100%;\\n height: 100%;\\n}\\n.p-virtualscroller-loader.p-component-overlay {\\n display: -webkit-box;\\n display: -ms-flexbox;\\n display: flex;\\n -webkit-box-align: center;\\n -ms-flex-align: center;\\n align-items: center;\\n -webkit-box-pack: center;\\n -ms-flex-pack: center;\\n justify-content: center;\\n}\\n\";\nstyleInject(css_248z);\n\nscript.render = render;\n\n/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (script);\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiOTIxLmpzIiwibWFwcGluZ3MiOiI7Ozs7QUFBZ0g7O0FBRWhIO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0EsU0FBUztBQUNUO0FBQ0E7QUFDQTtBQUNBLFNBQVM7QUFDVDtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0EsU0FBUztBQUNUO0FBQ0E7QUFDQTtBQUNBLFNBQVM7QUFDVDtBQUNBO0FBQ0E7QUFDQSxTQUFTO0FBQ1Q7QUFDQTtBQUNBO0FBQ0EsU0FBUztBQUNUO0FBQ0E7QUFDQTtBQUNBLFNBQVM7QUFDVDtBQUNBO0FBQ0E7QUFDQSxTQUFTO0FBQ1Q7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0EsS0FBSztBQUNMO0FBQ0E7QUFDQSxxQ0FBcUMsbUJBQW1CO0FBQ3hELG9DQUFvQyxtQkFBbUI7QUFDdkQsa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gICAgICB9LFxuICAgICAgICBzaG93TG9hZGVyOiB7XG4gICAgICAgICAgICB0eXBlOiBCb29sZWFuLFxuICAgICAgICAgICAgZGVmYXVsdDogZmFsc2VcbiAgICAgICAgfSxcbiAgICAgICAgbG9hZGluZzoge1xuICAgICAgICAgICAgdHlwZTogQm9vbGVhbixcbiAgICAgICAgICAgIGRlZmF1bHQ6IGZhbHNlXG4gICAgICAgIH0sXG4gICAgICAgIHN0eWxlOiBudWxsLFxuICAgICAgICBjbGFzczogbnVsbCxcbiAgICAgICAgZGlzYWJsZWQ6IHtcbiAgICAgICAgICAgIHR5cGU6IEJvb2xlYW4sXG4gICAgICAgICAgICBkZWZhdWx0OiBmYWxzZVxuICAgICAgICB9XG4gICAgfSxcbiAgICBkYXRhKCkge1xuICAgICAgICByZXR1cm4ge1xuICAgICAgICAgICAgZmlyc3Q6IHRoaXMuaXNCb3RoKCkgPyB7IHJvd3M6IDAsIGNvbHM6IDAgfSA6IDAsXG4gICAgICAgICAgICBsYXN0OiB0aGlzLmlzQm90aCgpID8geyByb3dzOiAwLCBjb2xzOiAwIH0gOiAwLFxuICAgICAgICAgICAgbnVtSXRlbXNJblZpZXdwb3J0OiB0aGlzLmlzQm90aCgpID8geyByb3dzOiAwLCBjb2xzOiAwIH0gOiAwLFxuICAgICAgICAgICAgbGFzdFNjcm9sbFBvczogdGhpcy5pc0JvdGgoKSA/IHsgdG9wOiAwLCBsZWZ0OiAwIH0gOiAwLFxuICAgICAgICAgICAgZF9udW1Ub2xlcmF0ZWRJdGVtczogdGhpcy5udW1Ub2xlcmF0ZWRJdGVtcyxcbiAgICAgICAgICAgIGRfbG9hZGluZzogdGhpcy5sb2FkaW5nLFxuICAgICAgICAgICAgbG9hZGVyQXJyOiBudWxsXG4gICAgICAgIH1cbiAgICB9LFxuICAgIGVsZW1lbnQ6IG51bGwsXG4gICAgY29udGVudDogbnVsbCxcbiAgICBzcGFjZXI6IG51bGwsXG4gICAgc2Nyb2xsVGltZW91dDogbnVsbCxcbiAgICBtb3VudGVkKCkge1xuICAgICAgICB0aGlzLmluaXQoKTtcbiAgICB9LFxuICAgIHdhdGNoOiB7XG4gICAgICAgIG51bVRvbGVyYXRlZEl0ZW1zKG5ld1ZhbHVlKSB7XG4gICAgICAgICAgICB0aGlzLmRfbnVtVG9sZXJhdGVkSXRlbXMgPSBuZXdWYWx1ZTtcbiAgICAgICAgfSxcbiAgICAgICAgbG9hZGluZyhuZXdWYWx1ZSkge1xuICAgICAgICAgICAgdGhpcy5kX2xvYWRpbmcgPSBuZXdWYWx1ZTtcbiAgICAgICAgfSxcbiAgICAgICAgaXRlbXMobmV3VmFsdWUsIG9sZFZhbCkge1xuICAgICAgICAgICAgaWYgKCFvbGRWYWwgfHwgb2xkVmFsLmxlbmd0aCAhPT0gKG5ld1ZhbHVlIHx8IFtdKS5sZW5ndGgpIHtcbiAgICAgICAgICAgICAgICB0aGlzLmluaXQoKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgIH0sXG4gICAgbWV0aG9kczoge1xuICAgICAgICBpbml0KCkge1xuICAgICAgICAgICAgaWYgKCF0aGlzLmRpc2FibGVkKSB7XG4gICAgICAgICAgICAgICAgdGhpcy5zZXRTaXplKCk7XG4gICAgICAgICAgICAgICAgdGhpcy5jYWxjdWxhdGVPcHRpb25zKCk7XG4gICAgICAgICAgICAgICAgdGhpcy5zZXRTcGFjZXJTaXplKCk7XG4gICAgICAgICAgICB9XG4gICAgICAgIH0sXG4gICAgICAgIGdldExhc3QobGFzdCwgaXNDb2xzKSB7XG4gICAgICAgICAgICByZXR1cm4gdGhpcy5pdGVtcyA/IE1hdGgubWluKChpc0NvbHMgPyB0aGlzLml0ZW1zWzBdLmxlbmd0aCA6IHRoaXMuaXRlbXMubGVuZ3RoKSwgbGFzdCkgOiAwO1xuICAgICAgICB9LFxuICAgICAgICBjYWxjdWxhdGVPcHRpb25zKCkge1xuICAgICAgICAgICAgY29uc3QgaXNCb3RoID0gdGhpcy5pc0Jv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ICAgICAgaWYgKHRoaXMuJHNsb3RzICYmIHRoaXMuJHNsb3RzLmxvYWRlcikge1xuICAgICAgICAgICAgICAgICAgICB0aGlzLmxvYWRlckFyciA9IEFycmF5LmZyb20oeyBsZW5ndGg6IChpc0JvdGggPyBudW1JdGVtc0luVmlld3BvcnQucm93cyA6IG51bUl0ZW1zSW5WaWV3cG9ydCkgfSk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICB0aGlzLmxvYWRlckFyciA9IEFycmF5LmZyb20oeyBsZW5ndGg6IDF9KTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG5cbiAgICAgICAgICAgIGlmICh0aGlzLmxhenkpIHtcbiAgICAgICAgICAgICAgICB0aGlzLiRlbWl0KCdsYXp5LWxvYWQnLCB7IGZpcnN0LCBsYXN0IH0pO1xuICAgICAgICAgICAgfVxuICAgICAgICB9LFxuICAgICAgICBnZXRDb250ZW50UGFkZGluZygpIHtcbiAgICAgICAgICAgIGlmICh0aGlzLmNvbnRlbnQpIHtcbiAgICAgICAgICAgICAgICBjb25zdCBzdHlsZSA9IGdldENvbXB1dGVkU3R5bGUodGhpcy5jb250ZW50KTtcbiAgICAgICAgICAgICAgICBjb25zdCBsZWZ0ID0gcGFyc2VJbnQocGFyc2VGbG9hdChzdHlsZS5wYWRkaW5nTGVmdC5zbGljZSgwLCAtMikpLCAxMCk7XG4gICAgICAgICAgICAgICAgY29uc3QgcmlnaHQgPSBwYXJzZUludChwYXJzZUZsb2F0KHN0eWxlLnBhZGRpbmdSaWdodC5zbGljZSgwLCAtMikpLCAxMCk7XG4gICAgICAgICAgICAgICAgY29uc3QgdG9wID0gcGFyc2VJbnQocGFyc2VGbG9hdChzdHlsZS5wYWRkaW5nVG9wLnNsaWNlKDAsIC0yKSksIDEwKTtcbiAgICAgICAgICAgICAgICBjb25zdCBib3R0b20gPSBwYXJzZUludChwYXJzZUZsb2F0KH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cCgnaGVpZ2h0JywgaGVpZ2h0KTtcbiAgICAgICAgICAgICAgICAgICAgc2V0UHJvcCgnd2lkdGgnLCB3aWR0aCk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICBpc0hvcml6b250YWwgPyBzZXRQcm9wKCd3aWR0aCcsIHdpZHRoKSA6IHNldFByb3AoJ2hlaWdodCcsIGhlaWdodCk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuICAgICAgICB9LFxuICAgICAgICBzZXRTcGFjZXJTaXplKCkge1xuICAgICAgICAgICAgY29uc3QgaXRlbXMgPSB0aGlzLml0ZW1zO1xuXG4gICAgICAgICAgICBpZiAodGhpcy5zcGFjZXIgJiYgaXRlbXMpIHtcbiAgICAgICAgICAgICAgICBjb25zdCBpc0JvdGggPSB0aGlzLmlzQm90aCgpO1xuICAgICAgICAgICAgICAgIGNvbnN0IGlzSG9yaXpvbnRhbCA9IHRoaXMuaXNIb3Jpem9udGFsKCk7XG4gICAgICAgICAgICAgICAgY29uc3QgaXRlbVNpemUgPSB0aGlzLml0ZW1TaXplO1xuICAgICAgICAgICAgICAgIGNvbnN0IGNvbnRlbnRQYWRkaW5nID0gdGhpcy5nZXRDb250ZW50UGFkZGluZygpO1xuICAgICAgICAgICAgICAgIGNvbnN0IHNldFByb3AgPSAoX25hbWUsIF92YWx1ZSwgX3NpemUsIF9wYWRkaW5nID0gMCkgPT4gdGhpcy5zcGFjZXIuc3R5bGVbX25hbWVdID0gKCgoX3ZhbHVlIHx8IFtdKS5sZW5ndGggKiBfc2l6ZSkgKyBfcGFkZGluZykgKyAncHgnO1xuXG4gICAgICAgICAgICAgICAgaWYgKGlzQm90aCkge1xuICAgICAgICAgICAgICAgICAgICBzZXRQcm9wKCdoZWlnaHQnLCBpdGVtc1swXSwgaXRlbVNpemVbMF0sIGNvbnRlbnRQYWRkaW5nLnkpO1xuICAgICAgICAgICAgICAgICAgICBzZXRQcm9wKCd3aWR0aCcsIGl0ZW1zWzFdLCBpdGVtU2l6ZVsxXSwgY29udGVudFBhZGRpbmcueCk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICBpc0hvcml6b250YWwgPyBzZXRQcm9wKCd3aWR0aCcsIGl0ZW1zLCBpdGVtU2l6ZSwgY29udGVudFBhZGRpbmcueCkgOiBzZXRQcm9wKCdoZWlnaHQnLCBpdGVtcywgaXRlbVNpemUsIGNvbnRlbnRQYWRkaW5nLnkpO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cbiAgICAgICAgfSxcbiAgICAgICAgc2V0Q29udGVudFBvc2l0aW9uKHBvcykge1xuICAgICAgICAgICAgaWYgKHRoaXMuY29udGVudCkge1xuICAgICAgICAgICAgICAgIGNvbnN0IGlzQm90aCA9IHRoaXMuaXNCb3RoKCk7XG4gICAgICAgICAgICAgICAgY29uc3QgaXNIb3Jpem9udGFsID0gdGhpcy5pc0hvcml6b250YWwoKTtcbiAgICAgICAgICAgICAgICBjb25zdCBjb250ZW50ID0gdGhpcy5jb250ZW50O1xuICAgICAgICAgICAgICAgIGNvbnN0IGZpcnN0ID0gcG9zID8gcG9zLmZpcnN0IDogdGhpcy5maXJzdDtcbiAgICAgICAgICAgICAgICBjb25zdCBpdGVtU2l6ZSA9IHRoaXMuaXRlbVNpemU7XG4gICAgICAgICAgICAgICAgY29uc3QgY2FsY3VsYXRlVHJhbnNsYXRlVmFsID0gKF9maXJzdCwgX3NpemUpID0+IChfZmlyc3QgKiBfc2l6ZSk7XG4gICAgICAgICAgICAgICAgY29uc3Qgc2V0VHJhbnNmb3JtID0gKF94ID0gMCwgX3kgPSAwKSA9PiBjb250ZW50LnN0eWxlLnRyYW5zZm9ybSA9IGB0cmFuc2xhdGUzZCgke194fXB4LCAke195fXB4LCAwKWA7XG5cbiAgICAgICAgICAgICAgICBpZiAoaXNCb3RoK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PSB0aGlzLm9uU2Nyb2xsUG9zaXRpb25DaGFuZ2UoZXZlbnQpO1xuXG4gICAgICAgICAgICAgICAgICAgIGlmIChjaGFuZ2VkKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICB0aGlzLmRfbG9hZGluZyA9IHRydWU7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICB9XG5cbiAgICAgICAgICAgICAgICB0aGlzLnNjcm9sbFRpbWVvdXQgPSBzZXRUaW1lb3V0KCgpID0+IHtcbiAgICAgICAgICAgICAgICAgICAgdGhpcy5vblNjcm9sbENoYW5nZShldmVudCk7XG5cbiAgICAgICAgICAgICAgICAgICAgaWYgKHRoaXMuZF9sb2FkaW5nICYmIHRoaXMuc2hvd0xvYWRlciAmJiAhdGhpcy5sYXp5KSB7XG4gICAgICAgICAgICAgICAgICAgICAgICB0aGlzLmRfbG9hZGluZyA9IGZhbHNlO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgfSwgdGhpcy5kZWxheSk7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBlbHNlIHtcbiAgICAgICAgICAgICAgICB0aGlzLm9uU2Nyb2xsQ2hhbmdlKGV2ZW50KTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfSxcbiAgICAgICAgZ2V0T3B0aW9ucyhyZW5kZXJlZEluZGV4KSB7XG4gICAgICAgICAgICBsZXQgY291bnQgPSB0aGlzLml0ZW1zLmxlbmd0aDtcbiAgICAgICAgICAgIGxldCBpbmRleCA9IHRoaXMuaXNCb3RoKCkgPyB0aGlzLmZpcnN0LnJvd3MgKyByZW5kZXJlZEluZGV4IDogdGhpcy5maXJzdCArIHJlbmRlcmVkSW5kZXg7XG4gICAgICAgICAgICByZXR1cm4ge1xuICAgICAgICAgICAgICAgIGluZGV4LFxuICAgICAgICAgICAgICAgIGNvdW50LFxuICAgICAgICAgICAgICAgIGZpcnN0OiBpbmRleCA9PT0gMCxcbiAgICAgICAgICAgICAgICBsYXN0OiBpbmRleCA9PT0gKGNvdW50IC0gMSksXG4gICAgICAgICAgICAgICAgZXZlbjogaW5kZXggJSAyID09PSAwLFxuICAgICAgICAgICAgICAgIG9kZDogaW5kZXggJSAyICE9PSAwXG4gICAgICAgICAgICB9O1xuICAgICAgICB9LFxuICAgICAgICBnZXRMb2FkZXJPcHRpb25zKGluZGV4KSB7XG4gICAgICAgICAgICBsZXQgY291bnQgPSB0aGlzLmxvYWRlckFyci5sZW5ndGg7XG4gICAgICAgICAgICByZXR1cm4ge1xuICAgICAgICAgICAgICAgIGxvYWRpbmc6IHRoaXMuZF9sb2FkaW5nLFxuICAgICAgICAgICAgICAgIGZpcnN0OiBpbmRleCA9PT0gMCxcbiAgICAgICAgICAgICAgICBsYXN0OiBpbmRleCA9PT0gKGNvdW50IC0gMSksXG4gICAgICAgICAgICAgICAgZXZlbjogaW5kZXggJSAyID09PSAwLFxuICAgICAgICAgICAgICAgIG9kZDogaW5kZXggJSAyICE9PSAwXG4gICAgICAgICAgICB9XG4gICAgICAgIH0sXG4gICAgICAgIGlzSG9yaXpvbnRhbCgpIHtcbiAgICAgICAgICAgIHJldHVybiB0aGlzLm9yaWVudGF0aW9uID09PSAnaG9yaXpvbnRhbCc7XG4gICAgICAgIH0sXG4gICAgICAgIGlzQm90aCgpIHtcbiAgICAgICAgICAgIHJldHVybiB0aGlzLm9yaWVudGF0aW9uID09PSAnYm90aCc7XG4gICAgICAgIH0sXG4gICAgICAgIHNjcm9sbFRvKG9wdGlvbnMpIHtcbiAgICAgICAgICAgIGlmICh0aGlzLmVsZW1lbnQpIHtcbiAgICAgICAgICAgICAgICB0aGlzLmVsZW1lbnQuc2Nyb2xsVG8ob3B0aW9ucyk7XG4gICAgICAgICAgICB9XG4gICAgICAgIH0sXG4gICAgICAgIHNjcm9sbFRvSW5kZXgoaW5kZXgsIGJlaGF2aW9yID0gJ2F1dG8nKSB7XG4gICAgICAgICAgICBjb25zdCBpc0JvdGggPSB0aGlzLmlz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gICAgY29uc3QgaXNUb1N0YXJ0ID0gdG8gPT09ICd0by1zdGFydCc7XG4gICAgICAgICAgICAgICAgY29uc3QgaXNUb0VuZCA9IHRvID09PSAndG8tZW5kJztcblxuICAgICAgICAgICAgICAgIGlmIChpc1RvU3RhcnQpIHtcbiAgICAgICAgICAgICAgICAgICAgaWYgKGlzQm90aCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHZpZXdwb3J0LmZpcnN0LnJvd3MgLSBmaXJzdC5yb3dzID4gaW5kZXhbMF0pIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBzY3JvbGxUbyh2aWV3cG9ydC5maXJzdC5jb2xzICogaXRlbVNpemVbMV0sICh2aWV3cG9ydC5maXJzdC5yb3dzIC0gMSkgKiBpdGVtU2l6ZVswXSk7XG4gICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICBlbHNlIGlmICh2aWV3cG9ydC5maXJzdC5jb2xzIC0gZmlyc3QuY29scyA+IGluZGV4WzFdKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgc2Nyb2xsVG8oKHZpZXdwb3J0LmZpcnN0LmNvbHMgLSAxKSAqIGl0ZW1TaXplWzFdLCB2aWV3cG9ydC5maXJzdC5yb3dzICogaXRlbVNpemVbMF0pO1xuICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgIGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHZpZXdwb3J0LmZpcnN0IC0gZmlyc3QgPiBpbmRleCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbnN0IHBvcyA9ICh2aWV3cG9ydC5maXJzdCAtIDEpICogaXRlbVNpemU7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaXNIb3Jpem9udGFsID8gc2Nyb2xsVG8ocG9zLCAwKSA6IHNjcm9sbFRvKDAsIHBvcyk7XG4gICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgZWxzZSBpZiAoaXNUb0VuZCkge1xuICAgICAgICAgICAgICAgICAgICBpZiAoaXNCb3RoKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAodmlld3BvcnQubGFzdC5yb3dzIC0gZmlyc3Qucm93cyA8PSBpbmRleFswXSArIDEpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBzY3JvbGxUbyh2aWV3cG9ydC5maXJzdC5jb2xzICogaXRlbVNpemVbMV0sICh2aWV3cG9ydC5maXJzdC5yb3dzICsgMSkgKiBpdGVtU2l6ZVswXSk7XG4gICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICBlbHNlIGlmICh2aWV3cG9ydC5sYXN0LmNvbHMgLSBmaXJzdC5jb2xzIDw9IGluZGV4WzFdICsgMSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNjcm9sbFRvKCh2aWV3cG9ydC5maXJzdC5jb2xzICsgMSkgKiBpdGVtU2l6ZVsxXSwgdmlld3BvcnQuZmlyc3Qucm93cyAqIGl0ZW1TaXplWzBdKTtcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmICh2aWV3cG9ydC5sYXN0IC0gZmlyc3QgPD0gaW5kZXggKyAxKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgY29uc3QgcG9zID0gKHZpZXdwb3J0LmZpcnN0ICsgMSkgKiBpdGVtU2l6ZTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpc0hvcml6b250YWwgPyBzY3JvbGxUbyhwb3MsIDApIDogc2Nyb2xsVG8oMCwgcG9zKTtcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGVsc2Uge1xuICAgICAgICAgICAgICAgIHRoaXMuc2Nyb2xsVG9JbmRleChpbmRleCwgYmVoYXZpb3IpO1xuICAgICAgICAgICAgfVxuICAgICAgICB9LFxuICAgICAgICBnZXRSZW5kZXJlZFJhbmdlKCkge1xuICAgICAgICAgICAgY29uc3QgaXNCb3RoID0gdGhpcy5pc0JvdGgoKTtcbiAgICAgICAgICAgIGNvbnN0IGlzSG9yaXpvbnRhbCA9IHRoaXMuaXNIb3Jpem9udGFsKCk7XG4gICAgICAgICAgICBjb25zdCBpdGVtU2l6ZSA9IHRoaXMuaXRlbVNpemU7XG4gICAgICAgICAgICBjb25zdCBjYWxjdWxhdGVGaXJzdEluVmlld3BvcnQgPSAoX3BvcywgX3NpemUpID0+IE1hdGguZmxvb3IoX3BvcyAvIChfc2l6ZSB8fCBfcG9zKSk7XG5cbiAgICAgICAgICAgIGxldCBmaXJzdEluVmlld3BvcnQgPSB0aGlzLmZpcnN0O1xuICAgICAgICAgICAgbGV0IGxhc3RJblZpZXdwb3J0ID0gMDtcblxuICAgICAgICAgICAgaWYgKHRoaXMuZWxlbWVudCkge1xuICAgICAgICAgICAgICAgIGNvbnN0IHNjcm9sbFRvcCA9IHRoaXMuZWxlbWVudC5zY3JvbGxUb3A7XG4gICAgICAgICAgICAgICAgY29uc3Qgc2Nyb2xsTGVmdCA9IHRoaXMuZWxlbWVudC5zY3JvbGxMZWZ0O1xuXG4gICAgICAgICAgICAgICAgaWYgKGlzQm90aCkge1xuICAgICAgICAgICAgICAgICAgICBmaXJzdEluVmlld3BvcnQgPSB7IHJvd3M6IGNhbGN1bGF0ZUZpcnN0SW5WaWV3cG9ydChzY3JvbGxUb3AsIGl0ZW1TaXplWzBdKSwgY29sczogY2FsY3VsYXRlRmlyc3RJblZpZXdwb3J0KHNjcm9sbExlZnQsIGl0ZW1TaXplWzFdKSB9O1xuICAgICAgICAgICAgICAgICAgICBsYXN0SW5WaWV3cG9ydCA9IHsgcm93czogZmlyc3RJblZpZXdwb3J0LnJvd3MgKyB0aGlzLm51bUl0ZW1zSW5WaWV3cG9ydC5yb3dzLCBjb2xzOiBmaXJzdEluVmlld3BvcnQuY29scyArIHRoaXMubnVtSXRlbXNJblZpZXdwb3J0LmNvbHMgfTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgIGNvbnN0IHNjcm9sbFBvcyA9IGlzSG9yaXpvbnRhbCA/IHNjcm9sbExlZnQgOiBzY3JvbGxUb3A7XG4gICAgICAgICAgICAgICAgICAgIGZpcnN0SW5WaWV3cG9ydCA9IGNhbGN1bGF0ZUZpcnN0SW5WaWV3cG9ydChzY3JvbGxQb3MsIGl0ZW1TaXplKTtcbiAgICAgICAgICAgICAgICAgICAgbGFzdEluVmlld3BvcnQgPSBmaXJzdEluVmlld3BvcnQgKyB0aGlzLm51bUl0ZW1zSW5WaWV3cG9ydDtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG5cbiAgICAgICAgICAgIHJldHVybiB7XG4gICAgICAgICAgICAgICAgZmlyc3Q6IHRoaXMuZmlyc3QsXG4gICAgICAgICAgICAgICAgbGFzdDogdGhpcy5sYXN0LFxuICAgICAgICAgICAgICAgIHZpZXdwb3J0OiB7XG4gICAgICAgICAgICAgICAgICAgIGZpcnN0OiBmaXJzdEluVmlld3BvcnQsXG4gICAgICAgICAgICAgICAgICAgIGxhc3Q6IGxhc3RJblZpZXdwb3J0XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfTtcbiAgICAgICAgfSxcbiAgICAgICAgZWxlbWVudFJlZihlbCkge1xuICAgICAgICAgICAgdGhpcy5lbGVtZW50ID0gZWw7XG4gICAgICAgIH0sXG4gICAgICAgIGNvbnRlbnRSZWYoZWwpIHtcbiAgICAgICAgICAgIHRoaXMuY29udGVudCA9IGVsO1xuICAgICAgICB9LFxuICAgICAgICBzcGFjZXJSZWYoZWwpIHtcbiAgICAgICAgICAgIHRoaXMuc3BhY2VyID0gZWw7XG4gICAgICAgIH1cbiAgICB9LFxuICAgIGNvbXB1dGVkOiB7XG4gICAgICAgIGNvbnRhaW5lckNsYXNzKCkge1xuICAgICAgICAgICAgcmV0dXJuIFsncC12aXJ0dWFsc2Nyb2xsZXInLCB7XG4gICAgICAgICAgICAgICAgJ3AtYm90aC1zY3JvbGwnOiB0aGlzLmlzQm90aCgpLFxuICAgICAgICAgICAgICAgICdwLWhvcml6b250YWwtc2Nyb2xsJzogdGhpcy5pc0hvcml6b250YWwoKVxuICAgICAgICAgICAgfSwgdGhpcy5jbGFzc107XG4gICAgICAgIH0sXG4gICAgICAgIGxvYWRlckNsYXNzKCkge1xuICAgICAgICAgICAgcmV0dXJuIFsncC12aXJ0dWFsc2Nyb2xsZXItbG9hZGVyJywge1xuICAgICAgICAgICAgICAgICdwLWNvbXBvbmVudC1vdmVybGF5JzogIXRoaXMuJHNsb3RzLmxvYWRlclxuICAgICAgICAgICAgfV07XG4gICAgICAgIH0sXG4gICAgICAgIGxvYWRlZEl0ZW1zKCkge1xuICAgICAgICAgICAgY29uc3QgaXRlbXMgPSB0aGlzLml0ZW1zO1xuICAgICAgICAgICAgaWYgKGl0ZW1zICYmICF0aGlzLmRfbG9hZGluZykge1xuICAgICAgICAgICAgICAgIGNvbnN0IGlzQm90aCA9IHRoaXMuaXNCb3RoKCk7XG5cbiAgICAgICAgICAgICAgICBpZiAoaXNCb3RoKSB7XG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBpdGVtcy5zbGljZSh0aGlzLmZpcnN0LnJvd3MsIHRoaXMubGFzdC5yb3dzKS5tYXAoKGl0ZW0pID0+IHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGNvbnN0IGl0ZW1zID0gaXRlbS5zbGljZSh0aGlzLmZpcnN0LmNvbHMsIHRoaXMubGFzdC5jb2xzKTtcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBpdGVtcztcbiAgICAgICAgICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICByZXR1cm4gaXRlbXMuc2xpY2UodGhpcy5maXJzdCwgdGhpcy5sYXN0KS5tYXAoKGl0ZW0pID0+IHtcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBpdGVtO1xuICAgICAgICAgICAgICAgICAgICB9KTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG5cbiAgICAgICAgICAgIHJldHVybiBbXTtcbiAgICAgICAgfVxuICAgIH1cbn07XG5cbmNvbnN0IF9ob2lzdGVkXzEgPSAvKiNfX1BVUkVfXyovY3JlYXRlVk5vZGUoXCJpXCIsIHsgY2xhc3M6IFwicC12aXJ0dWFsc2Nyb2xsZXItbG9hZGluZy1pY29uIHBpIHBpLXNwaW5uZXIgcGktc3BpblwiIH0sIG51bGwsIC0xKTtcblxuZnVuY3Rpb24gcmVuZGVyKF9jdHgsIF9jYWNoZSwgJHByb3BzLCAkc2V0dXAsICRkYXRhLCAkb3B0aW9ucykge1xuICByZXR1cm4gKCEkcHJvcHMuZGlzYWJsZWQpXG4gICAgPyAob3BlbkJsb2NrKCksIGNyZWF0ZUJsb2NrKFwiZGl2XCIsIHtcbiAgICAgICAga2V5OiAwLFxuICAgICAgICByZWY6ICRvcHRpb25zLmVsZW1lbnRSZWYsXG4gICAgICAgIGNsYXNzOiAkb3B0aW9ucy5jb250YWluZXJDbGFzcyxcbiAgICAgICAgc3R5bGU6ICRwcm9wcy5zdHlsZSxcbiAgICAgICAgb25TY3JvbGw6IF9jYWNoZVsxXSB8fCAoX2NhY2hlWzFdID0gKC4uLmFyZ3MpID0+ICgkb3B0aW9ucy5vblNjcm9sbCAmJiAkb3B0aW9ucy5vblNjcm9sbCguLi5hcmdzKSkpXG4gICAgICB9LCBbXG4gICAgICAgIHJlbmRlclNsb3QoX2N0eC4kc2xvdHMsIFwiY29udGVudFwiLCB7XG4gICAgICAgICAgc3R5bGVDbGFzczogXCJwLXZpcnR1YWxzY3JvbGxlci1jb250ZW50XCIsXG4gICAgICAgICAgY29udGVudFJlZjogJG9wdGlvbnMuY29udGVudFJlZixcbiAgICAgICAgICBpdGVtczogJG9wdGlvbnMubG9hZGVkSXRlbXMsXG4gICAgICAgICAgZ2V0SXRlbU9wdGlvbnM6ICRvcHRpb25zLmdldE9wdGlvbnNcbiAgICAgICAgfSwgKCkgPT4gW1xuICAgICAgICAgIGNyZWF0ZVZOb2RlKFwiZGl2XCIsIHtcbiAgICAgICAgICAgIHJlZjogJG9wdGlvbnMuY29udGVudFJlZixcbiAgICAgICAgICAgIGNsYXNzOiBcInAtdmlydHVhbHNjcm9sbGVyLWNvbnRlbnRcIlxuICAgICAgICAgIH0sIFtcbiAgICAgICAgICAgIChvcGVuQmxvY2sodHJ1ZSksIGNyZWF0ZUJsb2NrKEZyYWdtZW50LCBudWxsLCByZW5kZXJMaXN0KCRvcHRpb25zLmxvYWRlZEl0ZW1zLCAoaXRlbSwgaW5kZXgpID0+IHtcbiAgICAgICAgICAgICAgcmV0dXJuIHJlbmRlclNsb3QoX2N0eC4kc2xvdHMsIFwiaXRlbVwiLCB7XG4gICAgICAgICAgICAgICAga2V5OiBpbmRleCxcbiAgICAgICAgICAgICAgICBpdGVtOiBpdGVtLFxuICAgICAgICAgICAgICAgIG9wdGlvbnM6ICRvcHRpb25zLmdldE9wdGlvbnMoaW5kZXgpXG4gICAgICAgICAgICAgIH0pXG4gICAgICAgICAgICB9KSwgMTI4KSlcbiAgICAgICAgICBdLCA1MTIpXG4gICAgICAgIF0pLFxuICAgICAgICBjcmVhdGVWTm9kZShcImRpdlwiLCB7XG4gICAgICAgICAgcmVmOiAkb3B0aW9ucy5zcGFjZXJSZWYsXG4gICAgICAgICAgY2xhc3M6IFwicC12aXJ0dWFsc2Nyb2xsZXItc3BhY2VyXCJcbiAgICAgICAgfSwgbnVsbCwgNTEyKSxcbiAgICAgICAgKCRkYXRhLmRfbG9hZGluZylcbiAgICAgICAgICA/IChvcGVuQmxvY2soKSwgY3JlYXRlQmxvY2soXCJkaXZcIiwge1xuICAgICAgICAgICAgICBrZXk6IDAsXG4gICAgICAgICAgICAgIGNsYXNzOiAkb3B0aW9ucy5sb2FkZXJDbGFzc1xuICAgICAgICAgICAgfSwgW1xuICAgICAgICAgICAgICAob3BlbkJsb2NrKHRydWUpLCBjcmVhdGVCbG9jayhGcmFnbWVudCwgbnVsbCwgcmVuZGVyTGlzdCgkZGF0YS5sb2FkZXJBcnIsIChsb2FkSXRlbSwgaW5kZXgpID0+IHtcbiAgICAgICAgICAgICAgICByZXR1cm4gcmVuZGVyU2xvdChfY3R4LiRzbG90cywgXCJsb2FkZXJcIiwge1xuICAgICAgICAgICAgICAgICAga2V5OiBpbmRleCxcbiAgICAgICAgICAgICAgICAgIG9wdGlvbnM6ICRvcHRpb25zLmdldExvYWRlck9wdGlvbnMoaW5kZXgpXG4gICAgICAgICAgICAgICAgfSwgKCkgPT4gW1xuICAgICAgICAgICAgICAgICAgX2hvaXN0ZWRfMVxuICAgICAgICAgICAgICAgIF0pXG4gICAgICAgICAgICAgIH0pLCAxMjgpKVxuICAgICAgICAgICAgXSwgMikpXG4gICAgICAgICAgOiBjcmVhdGVDb21tZW50Vk5vZGUoXCJcIiwgdHJ1ZSlcbiAgICAgIF0sIDM4KSlcbiAgICA6IChvcGVuQmxvY2soKSwgY3JlYXRlQmxvY2soRnJhZ21lbnQsIHsga2V5OiAxIH0sIFtcbiAgICAgICAgcmVuZGVyU2xvdChfY3R4LiRzbG90cywgXCJkZWZhdWx0XCIpLFxuICAgICAgICByZW5kZXJTbG90KF9jdHguJHNsb3RzLCBcImNvbnRlbnRcIiwgeyBpdGVtczogJHByb3BzLml0ZW1zIH0pXG4gICAgICBdLCA2NCkpXG59XG5cbmZ1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LWZsZXgtYWxpZ246IGNlbnRlcjtcXG4gICAgICAgICAgICBhbGlnbi1pdGVtczogY2VudGVyO1xcbiAgICAtd2Via2l0LWJveC1wYWNrOiBjZW50ZXI7XFxuICAgICAgICAtbXMtZmxleC1wYWNrOiBjZW50ZXI7XFxuICAgICAgICAgICAganVzdGlmeS1jb250ZW50OiBjZW50ZXI7XFxufVxcblwiO1xuc3R5bGVJbmplY3QoY3NzXzI0OHopO1xuXG5zY3JpcHQucmVuZGVyID0gcmVuZGVyO1xuXG5leHBvcnQgZGVmYXVsdCBzY3JpcHQ7XG4iXSwibmFtZXMiOltdLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///921\n")}}]);