blob: 2ea3ec1b9db0e8ca702918b716a182525dddaf1c [file] [log] [blame]
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("@angular/cdk/overlay"),require("@angular/cdk/portal"),require("@angular/core"),require("@angular/material/core"),require("@angular/cdk/bidi"),require("@angular/common"),require("rxjs"),require("rxjs/operators"),require("@angular/cdk/a11y"),require("@angular/animations"),require("@angular/cdk/keycodes")):"function"==typeof define&&define.amd?define("@angular/material/dialog",["exports","@angular/cdk/overlay","@angular/cdk/portal","@angular/core","@angular/material/core","@angular/cdk/bidi","@angular/common","rxjs","rxjs/operators","@angular/cdk/a11y","@angular/animations","@angular/cdk/keycodes"],e):e(((t=t||self).ng=t.ng||{},t.ng.material=t.ng.material||{},t.ng.material.dialog={}),t.ng.cdk.overlay,t.ng.cdk.portal,t.ng.core,t.ng.material.core,t.ng.cdk.bidi,t.ng.common,t.rxjs,t.rxjs.operators,t.ng.cdk.a11y,t.ng.animations,t.ng.cdk.keycodes)}(this,(function(t,e,o,n,i,a,r,s,l,c,u,p){"use strict";
/*! *****************************************************************************
Copyright (c) Microsoft Corporation.
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
PERFORMANCE OF THIS SOFTWARE.
***************************************************************************** */var d=function(t,e){return(d=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o])})(t,e)};function h(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function o(){this.constructor=t}d(t,e),t.prototype=null===e?Object.create(e):(o.prototype=e.prototype,new o)}function f(t,e){var o="function"==typeof Symbol&&t[Symbol.iterator];if(!o)return t;var n,i,a=o.call(t),r=[];try{for(;(void 0===e||e-- >0)&&!(n=a.next()).done;)r.push(n.value)}catch(t){i={error:t}}finally{try{n&&!n.done&&(o=a.return)&&o.call(a)}finally{if(i)throw i.error}}return r}function g(){for(var t=[],e=0;e<arguments.length;e++)t=t.concat(f(arguments[e]));return t}
/**
* @license
* Copyright Google LLC All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.io/license
*/
var _=function _(){this.role="dialog",this.panelClass="",this.hasBackdrop=!0,this.backdropClass="",this.disableClose=!1,this.width="",this.height="",this.maxWidth="80vw",this.data=null,this.ariaDescribedBy=null,this.ariaLabelledBy=null,this.ariaLabel=null,this.autoFocus=!0,this.restoreFocus=!0,this.closeOnNavigation=!0},y={dialogContainer:u.trigger("dialogContainer",[u.state("void, exit",u.style({opacity:0,transform:"scale(0.7)"})),u.state("enter",u.style({transform:"none"})),u.transition("* => enter",u.animate("150ms cubic-bezier(0, 0, 0.2, 1)",u.style({transform:"none",opacity:1}))),u.transition("* => void, * => exit",u.animate("75ms cubic-bezier(0.4, 0.0, 0.2, 1)",u.style({opacity:0})))])},m=function(t){function e(e,o,i,a,r,s){var l=t.call(this)||this;return l._elementRef=e,l._focusTrapFactory=o,l._changeDetectorRef=i,l._config=r,l._focusMonitor=s,l._animationStateChanged=new n.EventEmitter,l._elementFocusedBeforeDialogWasOpened=null,l._closeInteractionType=null,l.attachDomPortal=function(t){return l._portalOutlet.hasAttached(),l._portalOutlet.attachDomPortal(t)},l._ariaLabelledBy=r.ariaLabelledBy||null,l._document=a,l}return h(e,t),e.prototype._initializeWithAttachedContent=function(){this._setupFocusTrap(),this._capturePreviouslyFocusedElement(),this._focusDialogContainer()},e.prototype.attachComponentPortal=function(t){return this._portalOutlet.hasAttached(),this._portalOutlet.attachComponentPortal(t)},e.prototype.attachTemplatePortal=function(t){return this._portalOutlet.hasAttached(),this._portalOutlet.attachTemplatePortal(t)},e.prototype._recaptureFocus=function(){this._containsFocus()||(!this._config.autoFocus||!this._focusTrap.focusInitialElement())&&this._elementRef.nativeElement.focus()},e.prototype._trapFocus=function(){this._config.autoFocus?this._focusTrap.focusInitialElementWhenReady():this._containsFocus()||this._elementRef.nativeElement.focus()},e.prototype._restoreFocus=function(){var t=this._elementFocusedBeforeDialogWasOpened;if(this._config.restoreFocus&&t&&"function"==typeof t.focus){var e=this._getActiveElement(),o=this._elementRef.nativeElement;e&&e!==this._document.body&&e!==o&&!o.contains(e)||(this._focusMonitor?(this._focusMonitor.focusVia(t,this._closeInteractionType),this._closeInteractionType=null):t.focus())}this._focusTrap&&this._focusTrap.destroy()},e.prototype._setupFocusTrap=function(){this._focusTrap=this._focusTrapFactory.create(this._elementRef.nativeElement)},e.prototype._capturePreviouslyFocusedElement=function(){this._document&&(this._elementFocusedBeforeDialogWasOpened=this._getActiveElement())},e.prototype._focusDialogContainer=function(){this._elementRef.nativeElement.focus&&this._elementRef.nativeElement.focus()},e.prototype._containsFocus=function(){var t=this._elementRef.nativeElement,e=this._getActiveElement();return t===e||t.contains(e)},e.prototype._getActiveElement=function(){var t,e=this._document.activeElement;return(null===(t=null==e?void 0:e.shadowRoot)||void 0===t?void 0:t.activeElement)||e},e}(o.BasePortalOutlet);
/**
* @license
* Copyright Google LLC All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.io/license
*/m.decorators=[{type:n.Directive}],m.ctorParameters=function(){return[{type:n.ElementRef},{type:c.FocusTrapFactory},{type:n.ChangeDetectorRef},{type:void 0,decorators:[{type:n.Optional},{type:n.Inject,args:[r.DOCUMENT]}]},{type:_},{type:c.FocusMonitor}]},m.propDecorators={_portalOutlet:[{type:n.ViewChild,args:[o.CdkPortalOutlet,{static:!0}]}]};var v=function(t){function e(){var e=t.apply(this,g(arguments))||this;return e._state="enter",e}return h(e,t),e.prototype._onAnimationDone=function(t){var e=t.toState,o=t.totalTime;"enter"===e?(this._trapFocus(),this._animationStateChanged.next({state:"opened",totalTime:o})):"exit"===e&&(this._restoreFocus(),this._animationStateChanged.next({state:"closed",totalTime:o}))},e.prototype._onAnimationStart=function(t){var e=t.toState,o=t.totalTime;"enter"===e?this._animationStateChanged.next({state:"opening",totalTime:o}):"exit"!==e&&"void"!==e||this._animationStateChanged.next({state:"closing",totalTime:o})},e.prototype._startExitAnimation=function(){this._state="exit",this._changeDetectorRef.markForCheck()},e}(m);v.decorators=[{type:n.Component,args:[{selector:"mat-dialog-container",template:"<ng-template cdkPortalOutlet></ng-template>\n",encapsulation:n.ViewEncapsulation.None,changeDetection:n.ChangeDetectionStrategy.Default,animations:[y.dialogContainer],host:{class:"mat-dialog-container",tabindex:"-1","aria-modal":"true","[id]":"_id","[attr.role]":"_config.role","[attr.aria-labelledby]":"_config.ariaLabel ? null : _ariaLabelledBy","[attr.aria-label]":"_config.ariaLabel","[attr.aria-describedby]":"_config.ariaDescribedBy || null","[@dialogContainer]":"_state","(@dialogContainer.start)":"_onAnimationStart($event)","(@dialogContainer.done)":"_onAnimationDone($event)"},styles:[".mat-dialog-container{display:block;padding:24px;border-radius:4px;box-sizing:border-box;overflow:auto;outline:0;width:100%;height:100%;min-height:inherit;max-height:inherit}.cdk-high-contrast-active .mat-dialog-container{outline:solid 1px}.mat-dialog-content{display:block;margin:0 -24px;padding:0 24px;max-height:65vh;overflow:auto;-webkit-overflow-scrolling:touch}.mat-dialog-title{margin:0 0 20px;display:block}.mat-dialog-actions{padding:8px 0;display:flex;flex-wrap:wrap;min-height:52px;align-items:center;box-sizing:content-box;margin-bottom:-24px}.mat-dialog-actions[align=end]{justify-content:flex-end}.mat-dialog-actions[align=center]{justify-content:center}.mat-dialog-actions .mat-button-base+.mat-button-base,.mat-dialog-actions .mat-mdc-button-base+.mat-mdc-button-base{margin-left:8px}[dir=rtl] .mat-dialog-actions .mat-button-base+.mat-button-base,[dir=rtl] .mat-dialog-actions .mat-mdc-button-base+.mat-mdc-button-base{margin-left:0;margin-right:8px}\n"]}]}];
/**
* @license
* Copyright Google LLC All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.io/license
*/
var C=0,b=function(){function t(t,e,o){var n=this;void 0===o&&(o="mat-dialog-"+C++),this._overlayRef=t,this._containerInstance=e,this.id=o,this.disableClose=this._containerInstance._config.disableClose,this._afterOpened=new s.Subject,this._afterClosed=new s.Subject,this._beforeClosed=new s.Subject,this._state=0,e._id=o,e._animationStateChanged.pipe(l.filter((function(t){return"opened"===t.state})),l.take(1)).subscribe((function(){n._afterOpened.next(),n._afterOpened.complete()})),e._animationStateChanged.pipe(l.filter((function(t){return"closed"===t.state})),l.take(1)).subscribe((function(){clearTimeout(n._closeFallbackTimeout),n._finishDialogClose()})),t.detachments().subscribe((function(){n._beforeClosed.next(n._result),n._beforeClosed.complete(),n._afterClosed.next(n._result),n._afterClosed.complete(),n.componentInstance=null,n._overlayRef.dispose()})),t.keydownEvents().pipe(l.filter((function(t){return t.keyCode===p.ESCAPE&&!n.disableClose&&!p.hasModifierKey(t)}))).subscribe((function(t){t.preventDefault(),D(n,"keyboard")})),t.backdropClick().subscribe((function(){n.disableClose?n._containerInstance._recaptureFocus():D(n,"mouse")}))}return t.prototype.close=function(t){var e=this;this._result=t,this._containerInstance._animationStateChanged.pipe(l.filter((function(t){return"closing"===t.state})),l.take(1)).subscribe((function(o){e._beforeClosed.next(t),e._beforeClosed.complete(),e._overlayRef.detachBackdrop(),e._closeFallbackTimeout=setTimeout((function(){return e._finishDialogClose()}),o.totalTime+100)})),this._state=1,this._containerInstance._startExitAnimation()},t.prototype.afterOpened=function(){return this._afterOpened},t.prototype.afterClosed=function(){return this._afterClosed},t.prototype.beforeClosed=function(){return this._beforeClosed},t.prototype.backdropClick=function(){return this._overlayRef.backdropClick()},t.prototype.keydownEvents=function(){return this._overlayRef.keydownEvents()},t.prototype.updatePosition=function(t){var e=this._getPositionStrategy();return t&&(t.left||t.right)?t.left?e.left(t.left):e.right(t.right):e.centerHorizontally(),t&&(t.top||t.bottom)?t.top?e.top(t.top):e.bottom(t.bottom):e.centerVertically(),this._overlayRef.updatePosition(),this},t.prototype.updateSize=function(t,e){return void 0===t&&(t=""),void 0===e&&(e=""),this._overlayRef.updateSize({width:t,height:e}),this._overlayRef.updatePosition(),this},t.prototype.addPanelClass=function(t){return this._overlayRef.addPanelClass(t),this},t.prototype.removePanelClass=function(t){return this._overlayRef.removePanelClass(t),this},t.prototype.getState=function(){return this._state},t.prototype._finishDialogClose=function(){this._state=2,this._overlayRef.dispose()},t.prototype._getPositionStrategy=function(){return this._overlayRef.getConfig().positionStrategy},t}();function D(t,e,o){return void 0!==t._containerInstance&&(t._containerInstance._closeInteractionType=e),t.close(o)}var O=new n.InjectionToken("MatDialogData"),T=new n.InjectionToken("mat-dialog-default-options"),A=new n.InjectionToken("mat-dialog-scroll-strategy");function R(t){return function(){return t.scrollStrategies.block()}}var k={provide:A,deps:[e.Overlay],useFactory:R},x=function(){function t(t,e,o,n,i,a,r,c,u){var p=this;this._overlay=t,this._injector=e,this._defaultOptions=o,this._parentDialog=n,this._overlayContainer=i,this._dialogRefConstructor=r,this._dialogContainerType=c,this._dialogDataToken=u,this._openDialogsAtThisLevel=[],this._afterAllClosedAtThisLevel=new s.Subject,this._afterOpenedAtThisLevel=new s.Subject,this._ariaHiddenElements=new Map,this.afterAllClosed=s.defer((function(){return p.openDialogs.length?p._getAfterAllClosed():p._getAfterAllClosed().pipe(l.startWith(void 0))})),this._scrollStrategy=a}return Object.defineProperty(t.prototype,"openDialogs",{get:function(){return this._parentDialog?this._parentDialog.openDialogs:this._openDialogsAtThisLevel},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"afterOpened",{get:function(){return this._parentDialog?this._parentDialog.afterOpened:this._afterOpenedAtThisLevel},enumerable:!1,configurable:!0}),t.prototype._getAfterAllClosed=function(){var t=this._parentDialog;return t?t._getAfterAllClosed():this._afterAllClosedAtThisLevel},t.prototype.open=function(t,e){var o=this;(e=function n(t,e){return Object.assign(Object.assign({},e),t)}
/**
* @license
* Copyright Google LLC All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.io/license
*/(e,this._defaultOptions||new _)).id&&this.getDialogById(e.id);var i=this._createOverlay(e),a=this._attachDialogContainer(i,e),r=this._attachDialogContent(t,a,i,e);return this.openDialogs.length||this._hideNonDialogContentFromAssistiveTechnology(),this.openDialogs.push(r),r.afterClosed().subscribe((function(){return o._removeOpenDialog(r)})),this.afterOpened.next(r),a._initializeWithAttachedContent(),r},t.prototype.closeAll=function(){this._closeDialogs(this.openDialogs)},t.prototype.getDialogById=function(t){return this.openDialogs.find((function(e){return e.id===t}))},t.prototype.ngOnDestroy=function(){this._closeDialogs(this._openDialogsAtThisLevel),this._afterAllClosedAtThisLevel.complete(),this._afterOpenedAtThisLevel.complete()},t.prototype._createOverlay=function(t){var e=this._getOverlayConfig(t);return this._overlay.create(e)},t.prototype._getOverlayConfig=function(t){var o=new e.OverlayConfig({positionStrategy:this._overlay.position().global(),scrollStrategy:t.scrollStrategy||this._scrollStrategy(),panelClass:t.panelClass,hasBackdrop:t.hasBackdrop,direction:t.direction,minWidth:t.minWidth,minHeight:t.minHeight,maxWidth:t.maxWidth,maxHeight:t.maxHeight,disposeOnNavigation:t.closeOnNavigation});return t.backdropClass&&(o.backdropClass=t.backdropClass),o},t.prototype._attachDialogContainer=function(t,e){var i=n.Injector.create({parent:e&&e.viewContainerRef&&e.viewContainerRef.injector||this._injector,providers:[{provide:_,useValue:e}]}),a=new o.ComponentPortal(this._dialogContainerType,e.viewContainerRef,i,e.componentFactoryResolver);return t.attach(a).instance},t.prototype._attachDialogContent=function(t,e,i,a){var r=new this._dialogRefConstructor(i,e,a.id);if(t instanceof n.TemplateRef)e.attachTemplatePortal(new o.TemplatePortal(t,null,{$implicit:a.data,dialogRef:r}));else{var s=this._createInjector(a,r,e),l=e.attachComponentPortal(new o.ComponentPortal(t,a.viewContainerRef,s));r.componentInstance=l.instance}return r.updateSize(a.width,a.height).updatePosition(a.position),r},t.prototype._createInjector=function(t,e,o){var i=t&&t.viewContainerRef&&t.viewContainerRef.injector,r=[{provide:this._dialogContainerType,useValue:o},{provide:this._dialogDataToken,useValue:t.data},{provide:this._dialogRefConstructor,useValue:e}];return!t.direction||i&&i.get(a.Directionality,null)||r.push({provide:a.Directionality,useValue:{value:t.direction,change:s.of()}}),n.Injector.create({parent:i||this._injector,providers:r})},t.prototype._removeOpenDialog=function(t){var e=this.openDialogs.indexOf(t);e>-1&&(this.openDialogs.splice(e,1),this.openDialogs.length||(this._ariaHiddenElements.forEach((function(t,e){t?e.setAttribute("aria-hidden",t):e.removeAttribute("aria-hidden")})),this._ariaHiddenElements.clear(),this._getAfterAllClosed().next()))},t.prototype._hideNonDialogContentFromAssistiveTechnology=function(){var t=this._overlayContainer.getContainerElement();if(t.parentElement)for(var e=t.parentElement.children,o=e.length-1;o>-1;o--){var n=e[o];n===t||"SCRIPT"===n.nodeName||"STYLE"===n.nodeName||n.hasAttribute("aria-live")||(this._ariaHiddenElements.set(n,n.getAttribute("aria-hidden")),n.setAttribute("aria-hidden","true"))}},t.prototype._closeDialogs=function(t){for(var e=t.length;e--;)t[e].close()},t}();x.decorators=[{type:n.Directive}],x.ctorParameters=function(){return[{type:e.Overlay},{type:n.Injector},{type:void 0},{type:void 0},{type:e.OverlayContainer},{type:void 0},{type:n.Type},{type:n.Type},{type:n.InjectionToken}]};var E=function(t){function e(e,o,n,i,a,r,s){return t.call(this,e,o,i,r,s,a,b,v,O)||this}return h(e,t),e}(x);E.decorators=[{type:n.Injectable}],E.ctorParameters=function(){return[{type:e.Overlay},{type:n.Injector},{type:r.Location,decorators:[{type:n.Optional}]},{type:_,decorators:[{type:n.Optional},{type:n.Inject,args:[T]}]},{type:void 0,decorators:[{type:n.Inject,args:[A]}]},{type:E,decorators:[{type:n.Optional},{type:n.SkipSelf}]},{type:e.OverlayContainer}]};var I=0,S=function(){function t(t,e,o){this.dialogRef=t,this._elementRef=e,this._dialog=o,this.type="button"}return t.prototype.ngOnInit=function(){this.dialogRef||(this.dialogRef=F(this._elementRef,this._dialog.openDialogs))},t.prototype.ngOnChanges=function(t){var e=t._matDialogClose||t._matDialogCloseResult;e&&(this.dialogResult=e.currentValue)},t.prototype._onButtonClick=function(t){D(this.dialogRef,0===t.screenX&&0===t.screenY?"keyboard":"mouse",this.dialogResult)},t}();S.decorators=[{type:n.Directive,args:[{selector:"[mat-dialog-close], [matDialogClose]",exportAs:"matDialogClose",host:{"(click)":"_onButtonClick($event)","[attr.aria-label]":"ariaLabel || null","[attr.type]":"type"}}]}],S.ctorParameters=function(){return[{type:b,decorators:[{type:n.Optional}]},{type:n.ElementRef},{type:E}]},S.propDecorators={ariaLabel:[{type:n.Input,args:["aria-label"]}],type:[{type:n.Input}],dialogResult:[{type:n.Input,args:["mat-dialog-close"]}],_matDialogClose:[{type:n.Input,args:["matDialogClose"]}]};var w,P,j,L=function(){function t(t,e,o){this._dialogRef=t,this._elementRef=e,this._dialog=o,this.id="mat-dialog-title-"+I++}return t.prototype.ngOnInit=function(){var t=this;this._dialogRef||(this._dialogRef=F(this._elementRef,this._dialog.openDialogs)),this._dialogRef&&Promise.resolve().then((function(){var e=t._dialogRef._containerInstance;e&&!e._ariaLabelledBy&&(e._ariaLabelledBy=t.id)}))},t}();function F(t,e){for(var o=t.nativeElement.parentElement;o&&!o.classList.contains("mat-dialog-container");)o=o.parentElement;return o?e.find((function(t){return t.id===o.id})):null}
/**
* @license
* Copyright Google LLC All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.io/license
*/L.decorators=[{type:n.Directive,args:[{selector:"[mat-dialog-title], [matDialogTitle]",exportAs:"matDialogTitle",host:{class:"mat-dialog-title","[id]":"id"}}]}],L.ctorParameters=function(){return[{type:b,decorators:[{type:n.Optional}]},{type:n.ElementRef},{type:E}]},L.propDecorators={id:[{type:n.Input}]},(w=function w(){}).decorators=[{type:n.Directive,args:[{selector:"[mat-dialog-content], mat-dialog-content, [matDialogContent]",host:{class:"mat-dialog-content"}}]}],(P=function P(){}).decorators=[{type:n.Directive,args:[{selector:"[mat-dialog-actions], mat-dialog-actions, [matDialogActions]",host:{class:"mat-dialog-actions"}}]}],(j=function j(){}).decorators=[{type:n.NgModule,args:[{imports:[e.OverlayModule,o.PortalModule,i.MatCommonModule],exports:[v,S,L,w,P,i.MatCommonModule],declarations:[v,S,L,P,w],providers:[E,k],entryComponents:[v]}]}],
/**
* @license
* Copyright Google LLC All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.io/license
*/
t.MAT_DIALOG_DATA=O,t.MAT_DIALOG_DEFAULT_OPTIONS=T,t.MAT_DIALOG_SCROLL_STRATEGY=A,t.MAT_DIALOG_SCROLL_STRATEGY_FACTORY=function M(t){return function(){return t.scrollStrategies.block()}},t.MAT_DIALOG_SCROLL_STRATEGY_PROVIDER=k,t.MAT_DIALOG_SCROLL_STRATEGY_PROVIDER_FACTORY=R,t.MatDialog=E,t.MatDialogActions=P,t.MatDialogClose=S,t.MatDialogConfig=_,t.MatDialogContainer=v,t.MatDialogContent=w,t.MatDialogModule=j,t.MatDialogRef=b,t.MatDialogTitle=L,t._MatDialogBase=x,t._MatDialogContainerBase=m,t._closeDialogVia=D,t.matDialogAnimations=y,t.throwMatDialogContentAlreadyAttachedError=function B(){throw Error("Attempting to attach dialog content after content is already attached")},Object.defineProperty(t,"__esModule",{value:!0})}));