{"ast":null,"code":"import * as i0 from '@angular/core';\nimport { Directive, Component, ChangeDetectionStrategy, ViewEncapsulation, ViewChild, NgModule, Injectable } from '@angular/core';\nimport { animation, style, animate, trigger, transition, useAnimation } from '@angular/animations';\nimport * as i4 from '@angular/common';\nimport { CommonModule } from '@angular/common';\nimport { DomHandler } from 'primeng/dom';\nimport { ZIndexUtils } from 'primeng/utils';\nimport { Subject } from 'rxjs';\nimport * as i3 from 'primeng/api';\nconst _c0 = [\"mask\"];\n\nfunction DynamicDialogComponent_div_2_div_1_button_4_Template(rf, ctx) {\n if (rf & 1) {\n const _r7 = i0.ɵɵgetCurrentView();\n\n i0.ɵɵelementStart(0, \"button\", 12);\n i0.ɵɵlistener(\"click\", function DynamicDialogComponent_div_2_div_1_button_4_Template_button_click_0_listener() {\n i0.ɵɵrestoreView(_r7);\n const ctx_r6 = i0.ɵɵnextContext(3);\n return ctx_r6.hide();\n })(\"keydown.enter\", function DynamicDialogComponent_div_2_div_1_button_4_Template_button_keydown_enter_0_listener() {\n i0.ɵɵrestoreView(_r7);\n const ctx_r8 = i0.ɵɵnextContext(3);\n return ctx_r8.hide();\n });\n i0.ɵɵelement(1, \"span\", 13);\n i0.ɵɵelementEnd();\n }\n\n if (rf & 2) {\n i0.ɵɵproperty(\"ngClass\", \"p-dialog-header-icon p-dialog-header-maximize p-link\");\n }\n}\n\nfunction DynamicDialogComponent_div_2_div_1_Template(rf, ctx) {\n if (rf & 1) {\n i0.ɵɵelementStart(0, \"div\", 8);\n i0.ɵɵelementStart(1, \"span\", 9);\n i0.ɵɵtext(2);\n i0.ɵɵelementEnd();\n i0.ɵɵelementStart(3, \"div\", 10);\n i0.ɵɵtemplate(4, DynamicDialogComponent_div_2_div_1_button_4_Template, 2, 1, \"button\", 11);\n i0.ɵɵelementEnd();\n i0.ɵɵelementEnd();\n }\n\n if (rf & 2) {\n const ctx_r2 = i0.ɵɵnextContext(2);\n i0.ɵɵadvance(2);\n i0.ɵɵtextInterpolate(ctx_r2.config.header);\n i0.ɵɵadvance(2);\n i0.ɵɵproperty(\"ngIf\", ctx_r2.config.closable !== false);\n }\n}\n\nfunction DynamicDialogComponent_div_2_ng_template_3_Template(rf, ctx) {}\n\nfunction DynamicDialogComponent_div_2_div_4_Template(rf, ctx) {\n if (rf & 1) {\n i0.ɵɵelementStart(0, \"div\", 14);\n i0.ɵɵtext(1);\n i0.ɵɵelementEnd();\n }\n\n if (rf & 2) {\n const ctx_r4 = i0.ɵɵnextContext(2);\n i0.ɵɵadvance(1);\n i0.ɵɵtextInterpolate1(\" \", ctx_r4.config.footer, \" \");\n }\n}\n\nconst _c1 = function (a1) {\n return {\n \"p-dialog p-dynamic-dialog p-component\": true,\n \"p-dialog-rtl\": a1\n };\n};\n\nconst _c2 = function (a0, a1) {\n return {\n transform: a0,\n transition: a1\n };\n};\n\nconst _c3 = function (a1) {\n return {\n value: \"visible\",\n params: a1\n };\n};\n\nfunction DynamicDialogComponent_div_2_Template(rf, ctx) {\n if (rf & 1) {\n const _r10 = i0.ɵɵgetCurrentView();\n\n i0.ɵɵelementStart(0, \"div\", 3);\n i0.ɵɵlistener(\"@animation.start\", function DynamicDialogComponent_div_2_Template_div_animation_animation_start_0_listener($event) {\n i0.ɵɵrestoreView(_r10);\n const ctx_r9 = i0.ɵɵnextContext();\n return ctx_r9.onAnimationStart($event);\n })(\"@animation.done\", function DynamicDialogComponent_div_2_Template_div_animation_animation_done_0_listener($event) {\n i0.ɵɵrestoreView(_r10);\n const ctx_r11 = i0.ɵɵnextContext();\n return ctx_r11.onAnimationEnd($event);\n });\n i0.ɵɵtemplate(1, DynamicDialogComponent_div_2_div_1_Template, 5, 2, \"div\", 4);\n i0.ɵɵelementStart(2, \"div\", 5);\n i0.ɵɵtemplate(3, DynamicDialogComponent_div_2_ng_template_3_Template, 0, 0, \"ng-template\", 6);\n i0.ɵɵelementEnd();\n i0.ɵɵtemplate(4, DynamicDialogComponent_div_2_div_4_Template, 2, 1, \"div\", 7);\n i0.ɵɵelementEnd();\n }\n\n if (rf & 2) {\n const ctx_r1 = i0.ɵɵnextContext();\n i0.ɵɵclassMap(ctx_r1.config.styleClass);\n i0.ɵɵstyleProp(\"width\", ctx_r1.config.width)(\"height\", ctx_r1.config.height);\n i0.ɵɵproperty(\"ngClass\", i0.ɵɵpureFunction1(12, _c1, ctx_r1.config.rtl))(\"ngStyle\", ctx_r1.config.style)(\"@animation\", i0.ɵɵpureFunction1(17, _c3, i0.ɵɵpureFunction2(14, _c2, ctx_r1.transformOptions, ctx_r1.config.transitionOptions || \"150ms cubic-bezier(0, 0, 0.2, 1)\")));\n i0.ɵɵadvance(1);\n i0.ɵɵproperty(\"ngIf\", ctx_r1.config.showHeader === false ? false : true);\n i0.ɵɵadvance(1);\n i0.ɵɵproperty(\"ngStyle\", ctx_r1.config.contentStyle);\n i0.ɵɵadvance(2);\n i0.ɵɵproperty(\"ngIf\", ctx_r1.config.footer);\n }\n}\n\nconst _c4 = function (a1) {\n return {\n \"p-dialog-mask\": true,\n \"p-component-overlay-enter p-dialog-mask-scrollblocker\": a1\n };\n};\n\nclass DynamicDialogContent {\n constructor(viewContainerRef) {\n this.viewContainerRef = viewContainerRef;\n }\n\n}\n\nDynamicDialogContent.ɵfac = function DynamicDialogContent_Factory(t) {\n return new (t || DynamicDialogContent)(i0.ɵɵdirectiveInject(i0.ViewContainerRef));\n};\n\nDynamicDialogContent.ɵdir = /* @__PURE__ */i0.ɵɵdefineDirective({\n type: DynamicDialogContent,\n selectors: [[\"\", \"pDynamicDialogContent\", \"\"]],\n hostAttrs: [1, \"p-element\"]\n});\n\n(function () {\n (typeof ngDevMode === \"undefined\" || ngDevMode) && i0.ɵsetClassMetadata(DynamicDialogContent, [{\n type: Directive,\n args: [{\n selector: '[pDynamicDialogContent]',\n host: {\n 'class': 'p-element'\n }\n }]\n }], function () {\n return [{\n type: i0.ViewContainerRef\n }];\n }, null);\n})();\n\nclass DynamicDialogConfig {}\n\nclass DynamicDialogRef {\n constructor() {\n this._onClose = new Subject();\n this.onClose = this._onClose.asObservable();\n this._onDestroy = new Subject();\n this.onDestroy = this._onDestroy.asObservable();\n }\n\n close(result) {\n this._onClose.next(result);\n }\n\n destroy() {\n this._onDestroy.next(null);\n }\n\n}\n\nconst showAnimation = animation([style({\n transform: '{{transform}}',\n opacity: 0\n}), animate('{{transition}}', style({\n transform: 'none',\n opacity: 1\n}))]);\nconst hideAnimation = animation([animate('{{transition}}', style({\n transform: '{{transform}}',\n opacity: 0\n}))]);\n\nclass DynamicDialogComponent {\n constructor(componentFactoryResolver, cd, renderer, config, dialogRef, zone, primeNGConfig) {\n this.componentFactoryResolver = componentFactoryResolver;\n this.cd = cd;\n this.renderer = renderer;\n this.config = config;\n this.dialogRef = dialogRef;\n this.zone = zone;\n this.primeNGConfig = primeNGConfig;\n this.visible = true;\n this.transformOptions = \"scale(0.7)\";\n }\n\n ngAfterViewInit() {\n this.loadChildComponent(this.childComponentType);\n this.cd.detectChanges();\n }\n\n loadChildComponent(componentType) {\n let componentFactory = this.componentFactoryResolver.resolveComponentFactory(componentType);\n let viewContainerRef = this.insertionPoint.viewContainerRef;\n viewContainerRef.clear();\n this.componentRef = viewContainerRef.createComponent(componentFactory);\n }\n\n moveOnTop() {\n if (this.config.autoZIndex !== false) {\n ZIndexUtils.set('modal', this.container, (this.config.baseZIndex || 0) + this.primeNGConfig.zIndex.modal);\n this.wrapper.style.zIndex = String(parseInt(this.container.style.zIndex, 10) - 1);\n }\n }\n\n onAnimationStart(event) {\n switch (event.toState) {\n case 'visible':\n this.container = event.element;\n this.wrapper = this.container.parentElement;\n this.moveOnTop();\n this.bindGlobalListeners();\n\n if (this.config.modal !== false) {\n this.enableModality();\n }\n\n this.focus();\n break;\n\n case 'void':\n if (this.config.modal !== false) {\n DomHandler.addClass(this.wrapper, 'p-component-overlay-leave');\n }\n\n break;\n }\n }\n\n onAnimationEnd(event) {\n if (event.toState === 'void') {\n this.onContainerDestroy();\n this.dialogRef.destroy();\n }\n }\n\n onContainerDestroy() {\n this.unbindGlobalListeners();\n\n if (this.container && this.config.autoZIndex !== false) {\n ZIndexUtils.clear(this.container);\n }\n\n if (this.config.modal !== false) {\n this.disableModality();\n }\n\n this.container = null;\n }\n\n close() {\n this.visible = false;\n this.cd.markForCheck();\n }\n\n hide() {\n if (this.dialogRef) {\n this.dialogRef.close();\n }\n }\n\n enableModality() {\n if (this.config.closable !== false && this.config.dismissableMask) {\n this.maskClickListener = this.renderer.listen(this.wrapper, 'mousedown', event => {\n if (this.wrapper && this.wrapper.isSameNode(event.target)) {\n this.hide();\n }\n });\n }\n\n if (this.config.modal !== false) {\n DomHandler.addClass(document.body, 'p-overflow-hidden');\n }\n }\n\n disableModality() {\n if (this.wrapper) {\n if (this.config.dismissableMask) {\n this.unbindMaskClickListener();\n }\n\n if (this.config.modal !== false) {\n DomHandler.removeClass(document.body, 'p-overflow-hidden');\n }\n\n if (!this.cd.destroyed) {\n this.cd.detectChanges();\n }\n }\n }\n\n onKeydown(event) {\n if (event.which === 9) {\n event.preventDefault();\n let focusableElements = DomHandler.getFocusableElements(this.container);\n\n if (focusableElements && focusableElements.length > 0) {\n if (!focusableElements[0].ownerDocument.activeElement) {\n focusableElements[0].focus();\n } else {\n let focusedIndex = focusableElements.indexOf(focusableElements[0].ownerDocument.activeElement);\n\n if (event.shiftKey) {\n if (focusedIndex == -1 || focusedIndex === 0) focusableElements[focusableElements.length - 1].focus();else focusableElements[focusedIndex - 1].focus();\n } else {\n if (focusedIndex == -1 || focusedIndex === focusableElements.length - 1) focusableElements[0].focus();else focusableElements[focusedIndex + 1].focus();\n }\n }\n }\n }\n }\n\n focus() {\n let focusable = DomHandler.findSingle(this.container, '[autofocus]');\n\n if (focusable) {\n this.zone.runOutsideAngular(() => {\n setTimeout(() => focusable.focus(), 5);\n });\n }\n }\n\n bindGlobalListeners() {\n this.bindDocumentKeydownListener();\n\n if (this.config.closeOnEscape !== false && this.config.closable !== false) {\n this.bindDocumentEscapeListener();\n }\n }\n\n unbindGlobalListeners() {\n this.unbindDocumentKeydownListener();\n this.unbindDocumentEscapeListener();\n }\n\n bindDocumentKeydownListener() {\n this.zone.runOutsideAngular(() => {\n this.documentKeydownListener = this.onKeydown.bind(this);\n window.document.addEventListener('keydown', this.documentKeydownListener);\n });\n }\n\n unbindDocumentKeydownListener() {\n if (this.documentKeydownListener) {\n window.document.removeEventListener('keydown', this.documentKeydownListener);\n this.documentKeydownListener = null;\n }\n }\n\n bindDocumentEscapeListener() {\n const documentTarget = this.maskViewChild ? this.maskViewChild.nativeElement.ownerDocument : 'document';\n this.documentEscapeListener = this.renderer.listen(documentTarget, 'keydown', event => {\n if (event.which == 27) {\n if (parseInt(this.container.style.zIndex) == ZIndexUtils.getCurrent()) {\n this.hide();\n }\n }\n });\n }\n\n unbindDocumentEscapeListener() {\n if (this.documentEscapeListener) {\n this.documentEscapeListener();\n this.documentEscapeListener = null;\n }\n }\n\n unbindMaskClickListener() {\n if (this.maskClickListener) {\n this.maskClickListener();\n this.maskClickListener = null;\n }\n }\n\n ngOnDestroy() {\n this.onContainerDestroy();\n\n if (this.componentRef) {\n this.componentRef.destroy();\n }\n }\n\n}\n\nDynamicDialogComponent.ɵfac = function DynamicDialogComponent_Factory(t) {\n return new (t || DynamicDialogComponent)(i0.ɵɵdirectiveInject(i0.ComponentFactoryResolver), i0.ɵɵdirectiveInject(i0.ChangeDetectorRef), i0.ɵɵdirectiveInject(i0.Renderer2), i0.ɵɵdirectiveInject(DynamicDialogConfig), i0.ɵɵdirectiveInject(DynamicDialogRef), i0.ɵɵdirectiveInject(i0.NgZone), i0.ɵɵdirectiveInject(i3.PrimeNGConfig));\n};\n\nDynamicDialogComponent.ɵcmp = /* @__PURE__ */i0.ɵɵdefineComponent({\n type: DynamicDialogComponent,\n selectors: [[\"p-dynamicDialog\"]],\n viewQuery: function DynamicDialogComponent_Query(rf, ctx) {\n if (rf & 1) {\n i0.ɵɵviewQuery(DynamicDialogContent, 5);\n i0.ɵɵviewQuery(_c0, 5);\n }\n\n if (rf & 2) {\n let _t;\n\n i0.ɵɵqueryRefresh(_t = i0.ɵɵloadQuery()) && (ctx.insertionPoint = _t.first);\n i0.ɵɵqueryRefresh(_t = i0.ɵɵloadQuery()) && (ctx.maskViewChild = _t.first);\n }\n },\n hostAttrs: [1, \"p-element\"],\n decls: 3,\n vars: 4,\n consts: [[3, \"ngClass\"], [\"mask\", \"\"], [\"role\", \"dialog\", 3, \"ngClass\", \"ngStyle\", \"class\", \"width\", \"height\", 4, \"ngIf\"], [\"role\", \"dialog\", 3, \"ngClass\", \"ngStyle\"], [\"class\", \"p-dialog-header\", 4, \"ngIf\"], [1, \"p-dialog-content\", 3, \"ngStyle\"], [\"pDynamicDialogContent\", \"\"], [\"class\", \"p-dialog-footer\", 4, \"ngIf\"], [1, \"p-dialog-header\"], [1, \"p-dialog-title\"], [1, \"p-dialog-header-icons\"], [\"type\", \"button\", 3, \"ngClass\", \"click\", \"keydown.enter\", 4, \"ngIf\"], [\"type\", \"button\", 3, \"ngClass\", \"click\", \"keydown.enter\"], [1, \"p-dialog-header-close-icon\", \"pi\", \"pi-times\"], [1, \"p-dialog-footer\"]],\n template: function DynamicDialogComponent_Template(rf, ctx) {\n if (rf & 1) {\n i0.ɵɵelementStart(0, \"div\", 0, 1);\n i0.ɵɵtemplate(2, DynamicDialogComponent_div_2_Template, 5, 19, \"div\", 2);\n i0.ɵɵelementEnd();\n }\n\n if (rf & 2) {\n i0.ɵɵproperty(\"ngClass\", i0.ɵɵpureFunction1(2, _c4, ctx.config.modal !== false));\n i0.ɵɵadvance(2);\n i0.ɵɵproperty(\"ngIf\", ctx.visible);\n }\n },\n directives: function () {\n return [i4.NgClass, i4.NgIf, i4.NgStyle, DynamicDialogContent];\n },\n styles: [\".p-dialog-mask{position:fixed;top:0;left:0;width:100%;height:100%;display:flex;justify-content:center;align-items:center;pointer-events:none}.p-dialog-mask.p-component-overlay{pointer-events:auto}.p-dialog{display:flex;flex-direction:column;pointer-events:auto;max-height:90%;transform:scale(1);position:relative}.p-dialog-content{overflow-y:auto;flex-grow:1}.p-dialog-header{display:flex;align-items:center;justify-content:space-between;flex-shrink:0}.p-dialog-footer{flex-shrink:0}.p-dialog .p-dialog-header-icons{display:flex;align-items:center}.p-dialog .p-dialog-header-icon{display:flex;align-items:center;justify-content:center;overflow:hidden;position:relative}.p-fluid .p-dialog-footer .p-button{width:auto}.p-dialog-top .p-dialog,.p-dialog-bottom .p-dialog,.p-dialog-left .p-dialog,.p-dialog-right .p-dialog,.p-dialog-top-left .p-dialog,.p-dialog-top-right .p-dialog,.p-dialog-bottom-left .p-dialog,.p-dialog-bottom-right .p-dialog{margin:.75rem;transform:translate(0)}.p-dialog-maximized{transition:none;transform:none;width:100vw!important;height:100vh!important;top:0px!important;left:0px!important;max-height:100%;height:100%}.p-dialog-maximized .p-dialog-content{flex-grow:1}.p-dialog-left{justify-content:flex-start}.p-dialog-right{justify-content:flex-end}.p-dialog-top{align-items:flex-start}.p-dialog-top-left{justify-content:flex-start;align-items:flex-start}.p-dialog-top-right{justify-content:flex-end;align-items:flex-start}.p-dialog-bottom{align-items:flex-end}.p-dialog-bottom-left{justify-content:flex-start;align-items:flex-end}.p-dialog-bottom-right{justify-content:flex-end;align-items:flex-end}.p-dialog .p-resizable-handle{position:absolute;font-size:.1px;display:block;cursor:se-resize;width:12px;height:12px;right:1px;bottom:1px}.p-confirm-dialog .p-dialog-content{display:flex;align-items:center}\\n\"],\n encapsulation: 2,\n data: {\n animation: [trigger('animation', [transition('void => visible', [useAnimation(showAnimation)]), transition('visible => void', [useAnimation(hideAnimation)])])]\n }\n});\n\n(function () {\n (typeof ngDevMode === \"undefined\" || ngDevMode) && i0.ɵsetClassMetadata(DynamicDialogComponent, [{\n type: Component,\n args: [{\n selector: 'p-dynamicDialog',\n template: `\n