@coolon/angular-ui-powerups 0.0.6 → 0.0.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,2 +1,2 @@
1
- !function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("@angular/common"),require("@angular/core"),require("@angular/forms"),require("@angular/material"),require("@angular/platform-browser"),require("@angular/platform-browser/animations"),require("@coolon/pectin"),require("@angular/cdk/portal"),require("@coolon/pectin/lib/promise/deferred.class"),require("@angular/material/dialog"),require("@angular/router"),require("@angular/animations"),require("resize-observer-polyfill"),require("@typescript-plus/fast-memoize-decorator"),require("lodash"),require("reflect-metadata"),require("@coolon/typescript-utilities"),require("@typescript-plus/fast-memoize-decorator/dist/src")):"function"==typeof define&&define.amd?define("@coolon/angular-ui-powerups",["exports","@angular/common","@angular/core","@angular/forms","@angular/material","@angular/platform-browser","@angular/platform-browser/animations","@coolon/pectin","@angular/cdk/portal","@coolon/pectin/lib/promise/deferred.class","@angular/material/dialog","@angular/router","@angular/animations","resize-observer-polyfill","@typescript-plus/fast-memoize-decorator","lodash","reflect-metadata","@coolon/typescript-utilities","@typescript-plus/fast-memoize-decorator/dist/src"],e):e(((t=t||self).coolon=t.coolon||{},t.coolon["angular-ui-powerups"]={}),t.ng.common,t.ng.core,t.ng.forms,t.ng.material,t.ng.platformBrowser,t.ng.platformBrowser.animations,t.pectin,t.ng.cdk.portal,t.deferred_class,t.ng.material.dialog,t.ng.router,t.ng.animations,t.ResizeObserver,t.fastMemoizeDecorator,t.lodash,null,t.typescriptUtilities,t.src)}(this,function(t,e,n,r,o,i,a,s,u,c,l,p,f,d,y,m,g,h,v){"use strict";d=d&&d.hasOwnProperty("default")?d.default:d;var b=function(t,e){return(b=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)};function I(t,e){function n(){this.constructor=t}b(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}var w=function(){return(w=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)};function C(t,e,n,r){var o,i=arguments.length,a=i<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,r);else for(var s=t.length-1;s>=0;s--)(o=t[s])&&(a=(i<3?o(a):i>3?o(e,n,a):o(e,n))||a);return i>3&&a&&Object.defineProperty(e,n,a),a}function M(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)}function P(t,e,n,r){return new(n||(n=Promise))(function(o,i){function a(t){try{u(r.next(t))}catch(t){i(t)}}function s(t){try{u(r.throw(t))}catch(t){i(t)}}function u(t){t.done?o(t.value):new n(function(e){e(t.value)}).then(a,s)}u((r=r.apply(t,e||[])).next())})}function R(t,e){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,r=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!(o=(o=a.trys).length>0&&o[o.length-1])&&(6===i[0]||2===i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=e.call(t,a)}catch(t){i=[6,t],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}}function E(t){var e="function"==typeof Symbol&&t[Symbol.iterator],n=0;return e?e.call(t):{next:function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}}}var D=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return I(e,t),e.prototype.ngOnDestroy=function(){this.dispose()},e}(s.GarbageCollector),O=(new s.MutableListModel).readonly,A=function(t){function e(){var e=t.call(this)||this;e.focus=new n.EventEmitter,e.blur=new n.EventEmitter,e.enterKey=new n.EventEmitter,e.escapeKey=new n.EventEmitter;var r=e;return e.errorStateMatcher={isErrorState:function(t,e){return r.hasErrors()}},e}return I(e,t),e.prototype.notifyClick=function(){this.safelyInvoke(this.clickCommand)},e.prototype.notifyFocusIn=function(){this.safelyInvoke(this.focusCommand),this.focus.emit()},e.prototype.notifyFocusOut=function(){this.safelyInvoke(this.blurCommand),this.blur.emit()},e.prototype.notifyEnterKey=function(){this.safelyInvoke(this.enterCommand),this.enterKey.emit()},e.prototype.notifyEscapeKey=function(){this.safelyInvoke(this.escapeCommand),this.escapeKey.emit()},e.prototype.safelyInvoke=function(t){t&&t.isEnabled()&&t.execute()},e.prototype.ngOnInit=function(){},e.prototype.isEnabled=function(){return this.enabled.value},Object.defineProperty(e.prototype,"enabled",{get:function(){return this.valueModel.enabled||s.Constant.TRUE},enumerable:!0,configurable:!0}),e.prototype.hasErrors=function(){return!this.errorList.query().isEmpty()},Object.defineProperty(e.prototype,"errorList",{get:function(){return this.valueModel.errorList||O},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"firstError",{get:function(){return this.hasErrors()?this.errorList.value[0]:null},enumerable:!0,configurable:!0}),e.propDecorators={valueModel:[{type:n.Input}],label:[{type:n.Input}],floatLabel:[{type:n.Input}],hint:[{type:n.Input}],placeholder:[{type:n.Input}],focusCommand:[{type:n.Input,args:["command.focus"]}],blurCommand:[{type:n.Input,args:["command.blur"]}],enterCommand:[{type:n.Input,args:["command.enter"]}],escapeCommand:[{type:n.Input,args:["command.escape"]}],clickCommand:[{type:n.Input,args:["command.click"]}],focus:[{type:n.Output}],blur:[{type:n.Output}],enterKey:[{type:n.Output}],escapeKey:[{type:n.Output}],notifyClick:[{type:n.HostListener,args:["click"]}],notifyFocusIn:[{type:n.HostListener,args:["focusin"]}],notifyFocusOut:[{type:n.HostListener,args:["focusout"]}]},C([s.UseDelegate(),M("design:type",s.MutableValueModel)],e.prototype,"valueModel",void 0),e}(D);var j=function(t){function e(){return t.call(this)||this}return I(e,t),e.prototype.ngOnInit=function(){},e.decorators=[{type:n.Component,args:[{selector:"angular-ui-powerups-number-input",template:'<mat-form-field appearance="standard" [floatLabel]="floatLabel">\n <mat-label *ngIf="label">{{label}}</mat-label>\n <input type="number"\n matInput\n placeholder="{{placeholder}}"\n [(ngModel)]="valueModel.value"\n [disabled]="!enabled.value"\n (keydown.enter)="notifyEnterKey()"\n (keydown.escape)="notifyEscapeKey()"\n [pectinFocusBinding]="valueModel"\n [errorStateMatcher]="errorStateMatcher"\n >\n <mat-hint *ngIf="hint">{{hint}}</mat-hint>\n <mat-error *ngIf="hasErrors">{{firstError}}</mat-error>\n</mat-form-field>\n',styles:[":host{display:block}input,mat-form-field{width:100%}input mat-hint.faux-error,mat-form-field mat-hint.faux-error{color:#f44336}"]}]}],e.ctorParameters=function(){return[]},e}(A),F=function(t){function e(e){var n=t.call(this)||this;return n.elementRef=e,n}return I(e,t),e.prototype.ngOnInit=function(){s.assert.notNil(this.pectinCommand)},e.prototype.ngAfterViewInit=function(){var t=this;s.Dsl.disposeWith(this).chain.value(this.pectinCommand.enabled).subscribe(function(e){e?(t.elementRef.nativeElement.removeAttribute("disabled"),"A"===t.elementRef.nativeElement.tagName&&t.elementRef.nativeElement.setAttribute("href","javascript:void")):(t.elementRef.nativeElement.setAttribute("disabled","disabled"),"A"===t.elementRef.nativeElement.tagName&&t.elementRef.nativeElement.removeAttribute("href"))})},e.prototype.ngOnDestroy=function(){this.dispose()},e.prototype.notifyClick=function(t){t.preventDefault(),t.stopPropagation(),this.pectinCommand.isEnabled()?this.pectinCommand.execute({event:t}):console.warn("disabled command clicked, ignoring.")},e.decorators=[{type:n.Directive,args:[{selector:"[pectinCommand]"}]}],e.ctorParameters=function(){return[{type:n.ElementRef,decorators:[{type:n.Inject,args:[n.ElementRef]}]}]},e.propDecorators={pectinCommand:[{type:n.Input}],notifyClick:[{type:n.HostListener,args:["click",["$event"]]}]},e}(s.GarbageCollector);var T=function(t){function r(e,n,r){var o=t.call(this)||this;return o.el=e,o.ngZone=n,o.document=r,o}return I(r,t),r.prototype.onFocusIn=function(){this.pectinFocusBinding.focusCallbacks.notifyFocusIn()},r.prototype.onFocusOut=function(){this.pectinFocusBinding.focusCallbacks.notifyFocusOut()},r.prototype.ngOnInit=function(){},r.prototype.ngAfterViewInit=function(){var t=this;s.Dsl.disposeWith(this).chain.value(this.pectinFocusBinding.focused).subscribe(function(e){e&&!t.alreadyHasFocus()&&t.tryAndFocus()})},r.prototype.alreadyHasFocus=function(){return this.isFocused(this.focusTarget)},r.prototype.isFocused=function(t){return this.document.activeElement===t},r.prototype.tryAndFocus=function(t){var e=this;void 0===t&&(t=5),this.modelShouldStillHaveFocus()&&this.canFocus()&&(this.alreadyHasFocus()||this.focusTarget.focus(),this.alreadyHasFocus()||(s.Logger.get(this).log("focus failed, trying "+t+" more times"),t>0?requestAnimationFrame(function(){e.tryAndFocus(t-1)}):s.Logger.get(this).warn("Tried to focus but gave up as the component wasn't enabled or visible.")))},Object.defineProperty(r.prototype,"focusTarget",{get:function(){return this.focusBindingTarget||this.el.nativeElement},enumerable:!0,configurable:!0}),r.prototype.modelShouldStillHaveFocus=function(){return this.pectinFocusBinding.focused.value},r.prototype.canFocus=function(){var t=this.focusTarget.getBoundingClientRect();return t.height>=0&&t.height>=0&&!this.focusTarget.disabled},r.decorators=[{type:n.Directive,args:[{selector:"[pectinFocusBinding]"}]}],r.ctorParameters=function(){return[{type:n.ElementRef,decorators:[{type:n.Inject,args:[n.ElementRef]}]},{type:n.NgZone,decorators:[{type:n.Inject,args:[n.NgZone]}]},{type:void 0,decorators:[{type:n.Inject,args:[e.DOCUMENT]}]}]},r.propDecorators={pectinFocusBinding:[{type:n.Input}],focusBindingTarget:[{type:n.Input}],onFocusIn:[{type:n.HostListener,args:["focusin"]}],onFocusOut:[{type:n.HostListener,args:["focusout"]}]},r}(D);var x=function(t){function e(){return t.call(this)||this}return I(e,t),e.prototype.ngOnInit=function(){},e.decorators=[{type:n.Component,args:[{selector:"angular-ui-powerups-string-input",template:'<mat-form-field appearance="standard" [floatLabel]="floatLabel">\n <mat-label *ngIf="label">{{label}}</mat-label>\n <input matInput\n placeholder="{{placeholder}}"\n [(ngModel)]="valueModel.value"\n [disabled]="!enabled.value"\n (keydown.enter)="notifyEnterKey()"\n (keydown.escape)="notifyEscapeKey()"\n [pectinFocusBinding]="valueModel"\n [errorStateMatcher]="errorStateMatcher"\n >\n <mat-hint *ngIf="hint">{{hint}}</mat-hint>\n <mat-error *ngIf="hasErrors">{{firstError}}</mat-error>\n</mat-form-field>\n\n',styles:[":host{display:block}input,mat-form-field{width:100%}input mat-hint.faux-error,mat-form-field mat-hint.faux-error{color:#f44336}"]}]}],e.ctorParameters=function(){return[]},e}(A),L=function(t){function e(){return t.call(this)||this}return I(e,t),e.prototype.ngOnInit=function(){},e.decorators=[{type:n.Component,args:[{selector:"angular-ui-powerups-password-input",template:'<mat-form-field appearance="standard" [floatLabel]="floatLabel">\n <mat-label *ngIf="label">{{label}}</mat-label>\n <input type="password"\n matInput\n placeholder="{{placeholder}}"\n [(ngModel)]="valueModel.value"\n [disabled]="!enabled.value"\n (keydown.enter)="notifyEnterKey()"\n (keydown.escape)="notifyEscapeKey()"\n [pectinFocusBinding]="valueModel"\n [errorStateMatcher]="errorStateMatcher"\n >\n <mat-hint *ngIf="hint">{{hint}}</mat-hint>\n <mat-error *ngIf="hasErrors">{{firstError}}</mat-error>\n</mat-form-field>\n\n',styles:[":host{display:block}input,mat-form-field{width:100%}input mat-hint.faux-error,mat-form-field mat-hint.faux-error{color:#f44336}"]}]}],e.ctorParameters=function(){return[]},e}(A),_=function(t){function e(){var e=t.call(this)||this;return e.optionLabelFormat=function(t){return t&&e.optionLabel?t[e.optionLabel]:t},e}return I(e,t),e.prototype.ngOnInit=function(){},e.decorators=[{type:n.Component,args:[{selector:"angular-ui-powerups-select-input",template:'<mat-form-field appearance="standard" [floatLabel]="floatLabel">\n <mat-label *ngIf="label">{{label}}</mat-label>\n <mat-select placeholder="{{placeholder}}"\n [(ngModel)]="valueModel.value"\n [disabled]="!enabled.value"\n (keydown.enter)="notifyEnterKey()"\n (keydown.escape)="notifyEscapeKey()"\n [pectinFocusBinding]="valueModel"\n [errorStateMatcher]="errorStateMatcher"\n >\n <mat-option *ngFor="let option of optionsModel.value" [value]="option">{{optionLabelFormat(option)}}\n </mat-option>\n </mat-select>\n <mat-hint *ngIf="hint">{{hint}}</mat-hint>\n <mat-error *ngIf="hasErrors">{{firstError}}</mat-error>\n</mat-form-field>\n',styles:[":host{display:inline-block}mat-form-field{width:100%}"]}]}],e.ctorParameters=function(){return[]},e.propDecorators={optionsModel:[{type:n.Input}],options:[{type:n.Input}],optionLabel:[{type:n.Input}],optionLabelFormat:[{type:n.Input}]},C([s.UseDelegate(),M("design:type",s.ListModel)],e.prototype,"optionsModel",void 0),C([s.StoreInListModel("optionsModel"),M("design:type",Array)],e.prototype,"options",void 0),e}(A);var k=new n.InjectionToken("InteractionContext"),S=function(){};var B=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e._doneListeners=new s.EventListenerList,e._cancelListeners=new s.EventListenerList,e._finishListeners=new s.EventListenerList,e._busyModel=(new s.DelegatingValueModel).withDefault(!1),e}return I(e,t),e.prototype.onDone=function(t){this._doneListeners.add(t)},e.prototype.onCancel=function(t){this._cancelListeners.add(t)},e.prototype.done=function(t){var e=this;return this._doneListeners.fireAndWait(function(e){return e(t)}).finally(function(){return e.finalizeAndDispose()})},e.prototype.cancel=function(t){var e=this;return this._cancelListeners.fireAndWait(function(e){return e(t)}).finally(function(){return e.finalizeAndDispose()})},e.prototype.finalizeAndDispose=function(){this._finishListeners.fire(function(t){return t()}),[this._finishListeners,this._doneListeners,this._cancelListeners].forEach(function(t){return t.dispose()})},Object.defineProperty(e.prototype,"busy",{get:function(){return this._busyModel.readonly},enumerable:!0,configurable:!0}),e.prototype.busyWhile=function(t){this._busyModel.setDelegate(t)},e.prototype.isBusy=function(){return this._busyModel.value},e}(D);var K=new n.InjectionToken("InteractionActivityData");var N=function(t){function e(e){var n=t.call(this)||this;return n.alert=e,n}return I(e,t),e.prototype.ngOnInit=function(){},e.decorators=[{type:n.Component,args:[{selector:"angular-ui-powerups-alert-dialog",template:'<h3 matDialogTitle *ngIf="alert.title">{{alert.title()}}</h3>\n<div matDialogContent>\n <p *ngFor="let line of alert.content()">{{line}}</p>\n</div>\n<p matDialogActions>\n <button mat-raised-button color="primary" (click)="done()">{{alert.ok()}}</button>\n</p>\n',styles:[":host{display:block;padding:var(--default-padding)}.mat-dialog-actions{justify-content:flex-end}"]}]}],e.ctorParameters=function(){return[{type:void 0,decorators:[{type:n.Inject,args:[K]}]}]},e}(B);var q,V,U=function(t){function e(e){var n=t.call(this)||this;return n.confirm=e,s.assert.notNil(e),console.log(e),n}return I(e,t),e.prototype.ngOnInit=function(){},e.prototype.isDestructive=function(){return this.confirm.destructive&&this.confirm.destructive()},e.decorators=[{type:n.Component,args:[{selector:"angular-ui-powerups-confirmation-dialog",template:'<h3 matDialogTitle *ngIf="confirm.title">{{confirm.title()}}</h3>\n<div matDialogContent>\n <p *ngFor="let line of confirm.content()">{{line}}</p>\n</div>\n<p matDialogActions>\n <button mat-button (click)="cancel()">{{confirm.cancel()}}</button>\n <button mat-raised-button [color]="isDestructive() ? \'warn\' : \'primary\'" (click)="done(true)">{{confirm.ok()}}</button>\n</p>\n\n',styles:[":host{display:block;padding:var(--default-padding)}.mat-dialog-actions{justify-content:flex-end}"]}]}],e.ctorParameters=function(){return[{type:void 0,decorators:[{type:n.Inject,args:[K]}]}]},e}(B);t.ɵo=function(t){function e(){var e=t.call(this)||this;return e.activityTabs=new s.MutableListModel,e.obsoleteTabs=[],e}return I(e,t),e.prototype.ngOnInit=function(){},e.prototype.ngAfterViewInit=function(){var t=this;s.Dsl.disposeWith(this).observe.valuesFrom(this.tabs.animationDone).subscribe(function(){return t.cleanUpTabs()})},e.prototype.initialise=function(t){this.initialActivity=w({},t,{interactionContext:this})},e.prototype.startActivity=function(t,e){var n=this,r=c.Deferred.defer(),o={interactionContext:this,activityClass:t,activityData:e,onDone:r.resolve,onCancel:r.reject};return this.activityTabs.push(o),this.tabs.selectedIndex=this.activityTabs.length,r.promise.finally(function(){n.obsoleteTabs.push(o),n.tabs.selectedIndex=n.activityTabs.length-1})},e.prototype.alert=function(t){return this.startActivity(N,t)},e.prototype.confirm=function(t){return this.startActivity(U,t)},e.prototype.cleanUpTabs=function(){var t=this;this.activityTabs.value=this.activityTabs.value.filter(function(e){return!t.obsoleteTabs.includes(e)})},e.decorators=[{type:n.Component,args:[{selector:"angular-ui-powerups-activity-container",template:'<mat-tab-group #tabs no-tab-header [dynamicHeight]="true">\n <mat-tab>\n <angular-ui-powerups-activity-outlet [interactionContext]="this" [activityContext]="initialActivity"></angular-ui-powerups-activity-outlet>\n </mat-tab>\n <mat-tab *ngFor="let tab of activityTabs.value">\n <angular-ui-powerups-activity-outlet [interactionContext]="this" [activityContext]="tab"></angular-ui-powerups-activity-outlet>\n </mat-tab>\n</mat-tab-group>\n',styles:[":host{display:block}"]}]}],e.ctorParameters=function(){return[]},e.propDecorators={parentInteractionContext:[{type:n.Input}],initialActivity:[{type:n.Input}],tabs:[{type:n.ViewChild,args:["tabs",{static:!0}]}]},e}(D),function(e){function n(){}(t.ɵo||(t.ɵo={})).ActivityContext=n}(),t.ɵv=function(){function t(t,e,n){this.componentFactoryResolver=t,this.viewContainerRef=e,this.injector=n}return Object.defineProperty(t.prototype,"activityContext",{set:function(t){this.loadActivity(t)},enumerable:!0,configurable:!0}),t.prototype.ngOnInit=function(){},t.prototype.loadActivity=function(t){var e=n.Injector.create({providers:[{provide:S,useValue:this},{provide:K,useValue:t.activityData}],parent:this.injector}),r=this.componentFactoryResolver.resolveComponentFactory(t.activityClass);this.viewContainerRef.clear(),this.activityComponent=this.viewContainerRef.createComponent(r,0,e),this.activityComponent.instance.onDone(t.onDone),this.activityComponent.instance.onCancel(t.onCancel)},t.prototype.alert=function(t){return this.interactionContext.alert(t)},t.prototype.confirm=function(t){return this.interactionContext.confirm(t)},t.prototype.startActivity=function(t,e){return this.interactionContext.startActivity(t,e)},t.decorators=[{type:n.Component,args:[{selector:"angular-ui-powerups-activity-outlet",template:"",styles:[":host{display:block}"]}]}],t.ctorParameters=function(){return[{type:n.ComponentFactoryResolver},{type:n.ViewContainerRef},{type:n.Injector}]},t.propDecorators={interactionContext:[{type:n.Input}],activityContext:[{type:n.Input}]},t}(),q=t.ɵv||(t.ɵv={}),V=function(){function t(t){this.context=t}return t.prototype.alert=function(t){return s.lang.notImplemented()},t.prototype.confirm=function(t){return s.lang.notImplemented()},t.prototype.startActivity=function(t,e){return s.lang.notImplemented()},t}(),q.OutletInteractionContext=V;var z=function(e){function r(t){var n=e.call(this)||this;return n.dialogService=t,n}return I(r,e),r.prototype.startActivity=function(t,e){return this._startActivity(t,e)},r.prototype._startActivity=function(e,n,r){var o=this;void 0===r&&(r=!0);var i={data:n,disableClose:r,panelClass:"dialog-interaction-service",autoFocus:!1},a=this.dialogService.open(t.ɵo,i);return new Promise(function(t,r){var i=a.componentInstance;i.parentInteractionContext=o,i.initialise({activityClass:e,activityData:n,onDone:function(e){t(e),a.close(e)},onCancel:function(t){r(t),a.close(t)}}),a.updateSize()})},r.prototype.alert=function(t){return this._startActivity(N,t,!1)},r.prototype.confirm=function(t){return this._startActivity(U,t,!0)},r.decorators=[{type:n.Injectable,args:[{providedIn:"root"}]}],r.ctorParameters=function(){return[{type:o.MatDialog}]},r.ngInjectableDef=n.ɵɵdefineInjectable({factory:function(){return new r(n.ɵɵinject(l.MatDialog))},token:r,providedIn:"root"}),r}(S);var H=function(){function r(){}return r.decorators=[{type:n.NgModule,args:[{imports:[e.CommonModule,o.MatButtonModule,o.MatDialogModule,o.MatTabsModule,u.PortalModule],declarations:[t.ɵo,U,N,t.ɵv],entryComponents:[t.ɵo,U,N],providers:[z]}]}],r}(),G=function(){function t(){}return t.prototype.ngOnInit=function(){},t.decorators=[{type:n.Component,args:[{selector:"aup-busy-overlay",template:'<ng-content></ng-content>\n<div class="busy-overlay-backdrop" *ngIf="busyModel.value">\n <mat-progress-spinner mode="indeterminate" [diameter]="52"></mat-progress-spinner>\n</div>\n',styles:[":host{position:relative}div.busy-overlay-backdrop{position:absolute;background-color:rgba(0,0,0,.2);top:0;left:0;bottom:0;right:0;display:-ms-grid;display:grid;-ms-grid-columns:auto;grid-template-columns:auto;-ms-grid-rows:auto;grid-template-rows:auto;place-content:center}"]}]}],t.ctorParameters=function(){return[]},t.propDecorators={busyModel:[{type:n.Input}],busy:[{type:n.Input}]},C([s.UseDelegatingValueModel(),M("design:type",s.ValueModel)],t.prototype,"busyModel",void 0),C([s.StoreInValueModel("busyModel"),M("design:type",Boolean)],t.prototype,"busy",void 0),t}();var W=function(){function t(){}return t.prototype.ngOnInit=function(){},t.decorators=[{type:n.Component,args:[{selector:"angular-ui-powerups-empty-state",template:'\n <div class="container">\n <ng-content></ng-content>\n </div>\n ',styles:[":host{display:flex;flex-direction:column;justify-content:center;align-items:center}.container{padding:var(--default-padding);border:2px dashed rgba(0,0,0,.2);border-radius:5px;font-size:14px;font-weight:300}"]}]}],t.ctorParameters=function(){return[]},t}(),Y=function(){function t(){this._activePlaces=new s.MutableListModel}return Object.defineProperty(t.prototype,"activePlaces",{get:function(){return this._activePlaces.readonly},enumerable:!0,configurable:!0}),t.prototype.onActivate=function(t){this._activePlaces.push(t)},t.prototype.onDeactivate=function(t){this._activePlaces.remove(t)},t.decorators=[{type:n.Injectable,args:[{providedIn:"root"}]}],t.ctorParameters=function(){return[]},t.ngInjectableDef=n.ɵɵdefineInjectable({factory:function(){return new t},token:t,providedIn:"root"}),C([s.Trace(),M("design:type",Function),M("design:paramtypes",[Object]),M("design:returntype",void 0)],t.prototype,"onActivate",null),C([s.Trace(),M("design:type",Function),M("design:paramtypes",[Object]),M("design:returntype",void 0)],t.prototype,"onDeactivate",null),t}();var Z=function(){function t(t){this.placeService=t}return t.prototype.ngOnInit=function(){},t.prototype.onActivate=function(t){this.placeService.onActivate(t)},t.prototype.onDeactivate=function(t){this.placeService.onDeactivate(t)},t.decorators=[{type:n.Component,args:[{selector:"angular-ui-powerups-place-outlet",template:'<router-outlet (activate)="onActivate($event)" (deactivate)="onDeactivate($event)"></router-outlet>\n',styles:[":host{grid-area:main;display:-ms-grid;display:grid;-ms-grid-rows:0 1fr;grid-template-rows:0 1fr;min-height:0}"]}]}],t.ctorParameters=function(){return[{type:Y}]},t}();var $=function(){function t(){}return t.decorators=[{type:n.NgModule,args:[{imports:[e.CommonModule,o.MatProgressSpinnerModule,p.RouterModule],declarations:[W,G,Z],entryComponents:[G],exports:[G,Z,W],providers:[Y]}]}],t}(),J=function(){function t(){}return t.decorators=[{type:n.NgModule,args:[{declarations:[F,T,j,x,L,_],imports:[e.CommonModule,i.BrowserModule,a.BrowserAnimationsModule,r.FormsModule,o.MatInputModule,o.MatFormFieldModule,o.MatSelectModule,$,H],exports:[F,T,j,x,L,_,H,$]}]}],t}();var X=function(t,e){this.width=t,this.height=e};var Q,tt=function(){function t(t,e){this.x=t,this.y=e}return t.from=function(e){return new t(e.x,e.y)},t.prototype.translate=function(e,n){return new t(this.x+e,this.y+n)},t}();t.Bounds=function(t){function e(e,n,r,o){var i=t.call(this,r,o)||this;return i.top=e,i.left=n,i.width=r,i.height=o,i}return I(e,t),e.prototype.relativePositionOf=function(t){return t instanceof MouseEvent?new tt(t.clientX-this.left,t.clientY-this.top):new tt(t.x-this.left,t.y-this.top)},e}(X),(Q=t.Bounds||(t.Bounds={})).ofElement=function(t){var e=t.getBoundingClientRect();return new Q(e.top,e.left,e.width,e.height)};var et=function(e){function n(n,r){var o=e.call(this)||this;return o.elementRef=n,o.ngZone=r,o._boundsModel=new s.ValueHolder(new t.Bounds(0,0,0,0)),o}return I(n,e),n.prototype.ngAfterViewInit=function(){var t=this;this.updateBounds();var e=this.elementRef.nativeElement,n=new d(function(e,n){t.ngZone.run(function(){return t.updateBounds()})});n.observe(e),this.onDispose(function(){return n.disconnect()})},Object.defineProperty(n.prototype,"boundsModel",{get:function(){return this._boundsModel.readonly},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"nativeElement",{get:function(){return this.elementRef.nativeElement},enumerable:!0,configurable:!0}),n.prototype.relativePositionOf=function(t){return this.bounds.relativePositionOf(t)},Object.defineProperty(n.prototype,"bounds",{get:function(){return this._boundsModel.value},enumerable:!0,configurable:!0}),n.prototype.updateBounds=function(){this._boundsModel.value=t.Bounds.ofElement(this.nativeElement)},n}(D);function nt(){}function rt(t){return function(e){Reflect.defineMetadata("place.options",t,e)}}(function(t){function e(){}t.Callback=e})(nt||(nt={})),function(t){function e(){}t.Options=e;var n=function(t,e){s.assert.notNil(e),this.path=e.path,this.title=e.title,this.authenticate=m.isNil(e.authenticate)||e.authenticate};t.Descriptor=n,t.getDescriptor=function(t){var e=Reflect.getMetadata("place.options",t);return new n(t,e)}}(rt||(rt={}));var ot=function(){function t(t){this.parameters=t}return t.prototype.get=function(t){var e=this.parameters.find(function(e){return e.parameter===t});return e?e.resolvedValue:null},t.prototype.replace=function(e,n){return new t(this.parameters.filter(function(t){return t.parameter!==e}).concat({parameter:e,resolvedValue:n}))},t.prototype.getFormattedRouteId=function(){var t=this.getRouteIdParam();return t?t.parameter.type.format(t.resolvedValue):null},t.prototype.getRouteIdParam=function(){return this.parameters.find(function(t){return t.parameter.isRouteId})},t.prototype.getFormattedParameters=function(){var t={};this.parameters.filter(function(t){return!t.parameter.isRouteId}).forEach(function(e){t[e.parameter.name]=e.parameter.type.format(e.resolvedValue)});return t},t.prototype.hasRouteId=function(){return!!this.getRouteIdParam()},t.prototype.redirect=function(t,e,n){var r=this.getFormattedRouteId(),o=t.hasRouteId()?"..":".",i=r?[o,r,this.getFormattedParameters()]:[o,this.getFormattedParameters()];e.navigate(i,{relativeTo:n})},C([s.Trace(),M("design:type",Function),M("design:paramtypes",[]),M("design:returntype",void 0)],t.prototype,"getFormattedRouteId",null),C([s.Trace(),M("design:type",Function),M("design:paramtypes",[]),M("design:returntype",void 0)],t.prototype,"getFormattedParameters",null),C([s.Trace(),M("design:type",Function),M("design:paramtypes",[t,p.Router,p.ActivatedRoute]),M("design:returntype",void 0)],t.prototype,"redirect",null),t}();t.RouteParameterBindings=function(t){function e(n,r,o){var i=t.call(this)||this;i.component=n,i.router=r,i.activatedRoute=o,i._incomingRouteChange=new s.MutableValueModel(!1),i.resolvedParameters=new s.MutableValueModel;var a=s.Dsl.disposeWith(i),u=(a.chain,a.valueOf,a.before,a.when),c=(a.after,a.observe);i.txo=new s.TransactionObserver;var l=h.Klass.get(n).getMetadataList(e.ROUTE_PARAMETER_LIST_KEY);l.forEach(function(t){return i.installBinding(t)});var p=c.valuesFrom(o.paramMap).last().map(function(t){var e=[];return l.forEach(function(n){e.push({parameter:n,resolvedValue:n.type.parse(t.get(n.name))})}),new ot(e)});return p.subscribe(function(t){i._incomingRouteChange.value=!0,i.resolvedParameters.value=t,i._incomingRouteChange.value=!1}),u.valueOf(i.resolvedParameters).changes(function(t,e){t.redirect(e,r,o)},{unless:i.incomingRouteChange}),i.txo.observe("incomingResolvedRouteParameters",p),i.txo.observe("this.routeIsChanging",i.incomingRouteChange),i}return I(e,t),Object.defineProperty(e.prototype,"incomingRouteChange",{get:function(){return this._incomingRouteChange.readonly},enumerable:!0,configurable:!0}),e.prototype.installBinding=function(t){var e=this.getModelFor(t);this.txo.observe(t.propertyName,e),this.registerDisposable(new s.Binding(this.resolvedParameters,e,{toRight:function(e){return e.get(t)},toLeft:function(e,n){return n.replace(t,e)}}))},e.prototype.getModelFor=function(t){return this.component[t.propertyName]},e}(s.GarbageCollector),(t.RouteParameterBindings||(t.RouteParameterBindings={})).ROUTE_PARAMETER_LIST_KEY=Symbol("place:route:parameters");var it=function(e){function n(n,r){var o=e.call(this)||this;return o.activatedRoute=n,o.routeBindingMediator=o.registerDisposable(new t.RouteParameterBindings(o,r,n)),o.titleModel.setDefault(o.placeConfig.title),o}return I(n,e),Object.defineProperty(n.prototype,"placeConfig",{get:function(){return rt.getDescriptor(this.constructor)},enumerable:!0,configurable:!0}),n.prototype.canDeactivate=function(){return!0},C([s.UseDelegate(),M("design:type",s.MutableValueModel)],n.prototype,"titleModel",void 0),C([y.Memoize(),M("design:type",rt.Descriptor),M("design:paramtypes",[])],n.prototype,"placeConfig",null),n}(D);var at=function(){function t(t,e){this.router=t,this.injector=e}return t.prototype.canDeactivate=function(t,e,n,r){return t.canDeactivate()},t.decorators=[{type:n.Injectable,args:[{providedIn:"root"}]}],t.ctorParameters=function(){return[{type:p.Router},{type:n.Injector}]},t.ngInjectableDef=n.ɵɵdefineInjectable({factory:function(){return new t(n.ɵɵinject(p.Router),n.ɵɵinject(n.INJECTOR))},token:t,providedIn:"root"}),t}();var st=function(){function t(t,e){this.parameterDefs=t,this.injector=e,this.sanitisedParameters=[],this.routeParameter=t.find(function(t){return t.isRouteId}),this.queryParameters=t.filter(function(t){return!t.isRouteId})}return t.prototype.sanitise=function(t){return P(this,void 0,void 0,function(){var e,n,r,o,i,a;return R(this,function(s){switch(s.label){case 0:return this.routeParameter?[4,this.sanitiseParameter(this.routeParameter,t.paramMap.get(this.routeParameter.name))]:[3,2];case 1:if(!s.sent())return[2,!1];s.label=2;case 2:s.trys.push([2,7,8,9]),r=E(this.queryParameters),o=r.next(),s.label=3;case 3:return o.done?[3,6]:(i=o.value,[4,this.sanitiseParameter(i,t.queryParamMap.get(i.name))]);case 4:s.sent(),s.label=5;case 5:return o=r.next(),[3,3];case 6:return[3,9];case 7:return a=s.sent(),e={error:a},[3,9];case 8:try{o&&!o.done&&(n=r.return)&&n.call(r)}finally{if(e)throw e.error}return[7];case 9:return[2,0===this.sanitisedParameters.length]}})})},t.prototype.sanitiseParameter=function(t,e){return P(this,void 0,void 0,function(){var n,r,o;return R(this,function(i){switch(i.label){case 0:return t&&(n=this.getSanitiser(t))?(r=t.type.parse(e),[4,n.sanitise(r)]):[3,2];case 1:if(o=i.sent(),r!==o)return this.sanitisedParameters.push({def:t,value:t.type.format(o)}),[2,!1];i.label=2;case 2:return[2,!0]}})})},t.prototype.redirect=function(t){var e=this;s.assert.isTruthy(0!==this.sanitisedParameters.length);var n=this.sanitisedParameters.find(function(t){return t.def===e.routeParameter});if(n)return t.navigate(["..",n.value]);var r=this.sanitisedParameters.filter(function(t){return t.def!==e.routeParameter}).reduce(function(t,e){var n;return w({},t,((n={})[e.def.name]=e.value,n))},{});return t.navigate([".",r])},t.prototype.getSanitiser=function(t){return t.sanitiser?this.injector.get(t.sanitiser,new t.sanitiser):null},C([s.Trace(),M("design:type",Function),M("design:paramtypes",[Object,String]),M("design:returntype",Promise)],t.prototype,"sanitiseParameter",null),C([v.Memoize(),M("design:type",Function),M("design:paramtypes",[Object]),M("design:returntype",Object)],t.prototype,"getSanitiser",null),t}();var ut,ct,lt,pt=function(){function e(t,e){this.router=t,this.injector=e}return e.prototype.canActivate=function(e,n){var r=this,o=h.Klass.get(e.component).getMetadataList(t.RouteParameterBindings.ROUTE_PARAMETER_LIST_KEY),i=new st(o,this.injector);return i.sanitise(e).then(function(t){return t||i.redirect(r.router),t})},e.decorators=[{type:n.Injectable,args:[{providedIn:"root"}]}],e.ctorParameters=function(){return[{type:p.Router},{type:n.Injector}]},e.ngInjectableDef=n.ɵɵdefineInjectable({factory:function(){return new e(n.ɵɵinject(p.Router),n.ɵɵinject(n.INJECTOR))},token:e,providedIn:"root"}),C([s.Trace(),M("design:type",Function),M("design:paramtypes",[p.ActivatedRouteSnapshot,p.RouterStateSnapshot]),M("design:returntype",Object)],e.prototype,"canActivate",null),e}();function ft(t,e,n,r){var o=h.Opts.get(n),i=s.assert.notNil(t).toString();return{name:o.getOptional("as",i),propertyName:i,type:s.assert.notNil(e),sanitiser:o.getOptional("sanitiser",null),isRouteId:r}}ut=t.ParameterType||(t.ParameterType={}),ct=function(){function t(){}return t.prototype.format=function(t){return t},t.prototype.parse=function(t){return t},t}(),lt=function(){function t(){}return t.prototype.format=function(t){return""+t},t.prototype.parse=function(t){return+t},t}(),ut.STRING=new ct,ut.NUMBER=new lt,t.ACTIVITY_DATA=K,t.AbstractActivity=B,t.AbstractInputComponent=A,t.AbstractPlaceComponent=it,t.ActivityContainerComponent=t.ɵo,t.ActivityOutletComponent=t.ɵv,t.AlertDialogComponent=N,t.AngularUiPowerupsModule=J,t.BusyOverlayComponent=G,t.CommandDirective=F,t.ConfirmationDialogComponent=U,t.DialogInteractionService=z,t.Dimension=X,t.DisposableComponent=D,t.EmptyStateComponent=W,t.FocusBindingDirective=T,t.INTERACTION_CONTEXT=k,t.InteractionContext=S,t.InteractionModule=H,t.LeavePlaceGuard=at,t.NumberInputComponent=j,t.PasswordInputComponent=L,t.Place=rt,t.PlaceModule=$,t.PlaceOutletComponent=Z,t.PlaceRouteGuard=pt,t.PlaceService=Y,t.Point=tt,t.QueryParameter=function(e,n){return function(r,o){var i=ft(o,e,n,!1);h.Klass.get(r).addToOwnMetadataList(t.RouteParameterBindings.ROUTE_PARAMETER_LIST_KEY,i),s.UseDelegate()(r,o)}},t.ResizeAwareComponent=et,t.RouteId=function(e,n){return function(r,o){var i=ft(o,e,n,!0);h.Klass.get(r).addToOwnMetadataList(t.RouteParameterBindings.ROUTE_PARAMETER_LIST_KEY,i),s.UseDelegate()(r,o)}},t.RouteParameterSanitiser=st,t.SelectInputComponent=_,t.StringInputComponent=x,t.slideUpDownAnimation=function(t,e){return void 0===e&&(e="100ms"),f.trigger(t,[f.state("true",f.style({height:"*",overflow:"hidden",opacity:"1"})),f.state("false",f.style({height:"0px","padding-top":"0px","padding-bottom":"0px",overflow:"hidden",opacity:"0"})),f.transition("void => *",[]),f.transition("* => *",[f.animate(e)])])},t.ɵa=F,t.ɵb=T,t.ɵc=D,t.ɵd=j,t.ɵe=A,t.ɵf=x,t.ɵg=L,t.ɵh=_,t.ɵi=$,t.ɵj=W,t.ɵk=G,t.ɵl=Z,t.ɵm=Y,t.ɵn=H,t.ɵp=U,t.ɵq=B,t.ɵr=K,t.ɵt=N,t.ɵw=z,t.ɵx=S,Object.defineProperty(t,"__esModule",{value:!0})});
1
+ !function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("@angular/common"),require("@angular/core"),require("@angular/forms"),require("@angular/material"),require("@angular/platform-browser"),require("@angular/platform-browser/animations"),require("@coolon/pectin"),require("@angular/cdk/portal"),require("@coolon/pectin/lib/promise/deferred.class"),require("@angular/material/dialog"),require("@angular/router"),require("@angular/animations"),require("resize-observer-polyfill"),require("@typescript-plus/fast-memoize-decorator"),require("lodash"),require("reflect-metadata"),require("@coolon/typescript-utilities"),require("@typescript-plus/fast-memoize-decorator/dist/src")):"function"==typeof define&&define.amd?define("@coolon/angular-ui-powerups",["exports","@angular/common","@angular/core","@angular/forms","@angular/material","@angular/platform-browser","@angular/platform-browser/animations","@coolon/pectin","@angular/cdk/portal","@coolon/pectin/lib/promise/deferred.class","@angular/material/dialog","@angular/router","@angular/animations","resize-observer-polyfill","@typescript-plus/fast-memoize-decorator","lodash","reflect-metadata","@coolon/typescript-utilities","@typescript-plus/fast-memoize-decorator/dist/src"],e):e(((t=t||self).coolon=t.coolon||{},t.coolon["angular-ui-powerups"]={}),t.ng.common,t.ng.core,t.ng.forms,t.ng.material,t.ng.platformBrowser,t.ng.platformBrowser.animations,t.pectin,t.ng.cdk.portal,t.deferred_class,t.ng.material.dialog,t.ng.router,t.ng.animations,t.ResizeObserver,t.fastMemoizeDecorator,t.lodash,null,t.typescriptUtilities,t.src)}(this,function(t,e,n,r,o,i,a,s,u,c,l,p,f,d,m,y,g,h,v){"use strict";d=d&&d.hasOwnProperty("default")?d.default:d;var b=function(t,e){return(b=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)};function I(t,e){function n(){this.constructor=t}b(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}var w=function(){return(w=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)};function C(t,e,n,r){var o,i=arguments.length,a=i<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,r);else for(var s=t.length-1;s>=0;s--)(o=t[s])&&(a=(i<3?o(a):i>3?o(e,n,a):o(e,n))||a);return i>3&&a&&Object.defineProperty(e,n,a),a}function M(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)}function P(t,e,n,r){return new(n||(n=Promise))(function(o,i){function a(t){try{u(r.next(t))}catch(t){i(t)}}function s(t){try{u(r.throw(t))}catch(t){i(t)}}function u(t){t.done?o(t.value):new n(function(e){e(t.value)}).then(a,s)}u((r=r.apply(t,e||[])).next())})}function R(t,e){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,r=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!(o=(o=a.trys).length>0&&o[o.length-1])&&(6===i[0]||2===i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=e.call(t,a)}catch(t){i=[6,t],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}}function E(t){var e="function"==typeof Symbol&&t[Symbol.iterator],n=0;return e?e.call(t):{next:function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}}}var O=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return I(e,t),e.prototype.ngOnDestroy=function(){this.dispose()},e}(s.GarbageCollector),D=(new s.MutableListModel).readonly,A=function(t){function e(){var e=t.call(this)||this;e.focus=new n.EventEmitter,e.blur=new n.EventEmitter,e.enterKey=new n.EventEmitter,e.escapeKey=new n.EventEmitter;var r=e;return e.errorStateMatcher={isErrorState:function(t,e){return r.hasErrors()}},e}return I(e,t),e.prototype.notifyClick=function(){this.safelyInvoke(this.clickCommand)},e.prototype.notifyFocusIn=function(){this.safelyInvoke(this.focusCommand),this.focus.emit()},e.prototype.notifyFocusOut=function(){this.safelyInvoke(this.blurCommand),this.blur.emit()},e.prototype.notifyEnterKey=function(){this.safelyInvoke(this.enterCommand),this.enterKey.emit()},e.prototype.notifyEscapeKey=function(){this.safelyInvoke(this.escapeCommand),this.escapeKey.emit()},e.prototype.safelyInvoke=function(t){t&&t.isEnabled()&&t.execute()},e.prototype.ngOnInit=function(){},e.prototype.isEnabled=function(){return this.enabled.value},Object.defineProperty(e.prototype,"enabled",{get:function(){return this.valueModel.enabled||s.Constant.TRUE},enumerable:!0,configurable:!0}),e.prototype.hasErrors=function(){return!this.errorList.query().isEmpty()},Object.defineProperty(e.prototype,"errorList",{get:function(){return this.valueModel.errorList||D},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"firstError",{get:function(){return this.hasErrors()?this.errorList.value[0]:null},enumerable:!0,configurable:!0}),e.propDecorators={valueModel:[{type:n.Input}],label:[{type:n.Input}],floatLabel:[{type:n.Input}],hint:[{type:n.Input}],placeholder:[{type:n.Input}],focusCommand:[{type:n.Input,args:["command.focus"]}],blurCommand:[{type:n.Input,args:["command.blur"]}],enterCommand:[{type:n.Input,args:["command.enter"]}],escapeCommand:[{type:n.Input,args:["command.escape"]}],clickCommand:[{type:n.Input,args:["command.click"]}],focus:[{type:n.Output}],blur:[{type:n.Output}],enterKey:[{type:n.Output}],escapeKey:[{type:n.Output}],notifyClick:[{type:n.HostListener,args:["click"]}],notifyFocusIn:[{type:n.HostListener,args:["focusin"]}],notifyFocusOut:[{type:n.HostListener,args:["focusout"]}]},C([s.UseDelegate(),M("design:type",s.MutableValueModel)],e.prototype,"valueModel",void 0),e}(O);var j=function(t){function e(){return t.call(this)||this}return I(e,t),e.prototype.ngOnInit=function(){},e.decorators=[{type:n.Component,args:[{selector:"angular-ui-powerups-number-input",template:'<mat-form-field appearance="standard" [floatLabel]="floatLabel">\n <mat-label *ngIf="label">{{label}}</mat-label>\n <input type="number"\n matInput\n placeholder="{{placeholder}}"\n [(ngModel)]="valueModel.value"\n [disabled]="!enabled.value"\n (keydown.enter)="notifyEnterKey()"\n (keydown.escape)="notifyEscapeKey()"\n [pectinFocusBinding]="valueModel"\n [errorStateMatcher]="errorStateMatcher"\n >\n <mat-hint *ngIf="hint">{{hint}}</mat-hint>\n <mat-error *ngIf="hasErrors">{{firstError}}</mat-error>\n</mat-form-field>\n',styles:[":host{display:block}input,mat-form-field{width:100%}input mat-hint.faux-error,mat-form-field mat-hint.faux-error{color:#f44336}"]}]}],e.ctorParameters=function(){return[]},e}(A),F=function(t){function e(e){var n=t.call(this)||this;return n.elementRef=e,n}return I(e,t),e.prototype.ngOnInit=function(){s.assert.notNil(this.pectinCommand)},e.prototype.ngAfterViewInit=function(){var t=this;s.Dsl.disposeWith(this).chain.value(this.pectinCommand.enabled).subscribe(function(e){e?(t.elementRef.nativeElement.removeAttribute("disabled"),"A"===t.elementRef.nativeElement.tagName&&t.elementRef.nativeElement.setAttribute("href","javascript:void")):(t.elementRef.nativeElement.setAttribute("disabled","disabled"),"A"===t.elementRef.nativeElement.tagName&&t.elementRef.nativeElement.removeAttribute("href"))})},e.prototype.ngOnDestroy=function(){this.dispose()},e.prototype.notifyClick=function(t){t.preventDefault(),t.stopPropagation(),this.pectinCommand.isEnabled()?this.pectinCommand.execute({event:t}):console.warn("disabled command clicked, ignoring.")},e.decorators=[{type:n.Directive,args:[{selector:"[pectinCommand]"}]}],e.ctorParameters=function(){return[{type:n.ElementRef,decorators:[{type:n.Inject,args:[n.ElementRef]}]}]},e.propDecorators={pectinCommand:[{type:n.Input}],notifyClick:[{type:n.HostListener,args:["click",["$event"]]}]},e}(s.GarbageCollector);var T=function(t){function r(e,n,r){var o=t.call(this)||this;return o.el=e,o.ngZone=n,o.document=r,o}return I(r,t),r.prototype.onFocusIn=function(){this.pectinFocusBinding.focusCallbacks.notifyFocusIn()},r.prototype.onFocusOut=function(){this.pectinFocusBinding.focusCallbacks.notifyFocusOut()},r.prototype.ngOnInit=function(){},r.prototype.ngAfterViewInit=function(){var t=this;s.Dsl.disposeWith(this).chain.value(this.pectinFocusBinding.focused).subscribe(function(e){e&&!t.alreadyHasFocus()&&t.tryAndFocus()})},r.prototype.alreadyHasFocus=function(){return this.isFocused(this.focusTarget)},r.prototype.isFocused=function(t){return this.document.activeElement===t},r.prototype.tryAndFocus=function(t){var e=this;void 0===t&&(t=5),this.modelShouldStillHaveFocus()&&this.canFocus()&&(this.alreadyHasFocus()||this.focusTarget.focus(),this.alreadyHasFocus()||(s.Logger.get(this).log("focus failed, trying "+t+" more times"),t>0?requestAnimationFrame(function(){e.tryAndFocus(t-1)}):s.Logger.get(this).warn("Tried to focus but gave up as the component wasn't enabled or visible.")))},Object.defineProperty(r.prototype,"focusTarget",{get:function(){return this.focusBindingTarget||this.el.nativeElement},enumerable:!0,configurable:!0}),r.prototype.modelShouldStillHaveFocus=function(){return this.pectinFocusBinding.focused.value},r.prototype.canFocus=function(){var t=this.focusTarget.getBoundingClientRect();return t.height>=0&&t.height>=0&&!this.focusTarget.disabled},r.decorators=[{type:n.Directive,args:[{selector:"[pectinFocusBinding]"}]}],r.ctorParameters=function(){return[{type:n.ElementRef,decorators:[{type:n.Inject,args:[n.ElementRef]}]},{type:n.NgZone,decorators:[{type:n.Inject,args:[n.NgZone]}]},{type:void 0,decorators:[{type:n.Inject,args:[e.DOCUMENT]}]}]},r.propDecorators={pectinFocusBinding:[{type:n.Input}],focusBindingTarget:[{type:n.Input}],onFocusIn:[{type:n.HostListener,args:["focusin"]}],onFocusOut:[{type:n.HostListener,args:["focusout"]}]},r}(O);var L=function(t){function e(){return t.call(this)||this}return I(e,t),e.prototype.ngOnInit=function(){},e.decorators=[{type:n.Component,args:[{selector:"angular-ui-powerups-string-input",template:'<mat-form-field appearance="standard" [floatLabel]="floatLabel">\n <mat-label *ngIf="label">{{label}}</mat-label>\n <input matInput\n placeholder="{{placeholder}}"\n [(ngModel)]="valueModel.value"\n [disabled]="!enabled.value"\n (keydown.enter)="notifyEnterKey()"\n (keydown.escape)="notifyEscapeKey()"\n [pectinFocusBinding]="valueModel"\n [errorStateMatcher]="errorStateMatcher"\n >\n <mat-hint *ngIf="hint">{{hint}}</mat-hint>\n <mat-error *ngIf="hasErrors">{{firstError}}</mat-error>\n</mat-form-field>\n\n',styles:[":host{display:block}input,mat-form-field{width:100%}input mat-hint.faux-error,mat-form-field mat-hint.faux-error{color:#f44336}"]}]}],e.ctorParameters=function(){return[]},e}(A),_=function(t){function e(){return t.call(this)||this}return I(e,t),e.prototype.ngOnInit=function(){},e.decorators=[{type:n.Component,args:[{selector:"angular-ui-powerups-password-input",template:'<mat-form-field appearance="standard" [floatLabel]="floatLabel">\n <mat-label *ngIf="label">{{label}}</mat-label>\n <input type="password"\n matInput\n placeholder="{{placeholder}}"\n [(ngModel)]="valueModel.value"\n [disabled]="!enabled.value"\n (keydown.enter)="notifyEnterKey()"\n (keydown.escape)="notifyEscapeKey()"\n [pectinFocusBinding]="valueModel"\n [errorStateMatcher]="errorStateMatcher"\n >\n <mat-hint *ngIf="hint">{{hint}}</mat-hint>\n <mat-error *ngIf="hasErrors">{{firstError}}</mat-error>\n</mat-form-field>\n\n',styles:[":host{display:block}input,mat-form-field{width:100%}input mat-hint.faux-error,mat-form-field mat-hint.faux-error{color:#f44336}"]}]}],e.ctorParameters=function(){return[]},e}(A),x=function(t){function e(){var e=t.call(this)||this;return e.optionLabelFormat=function(t){return t&&e.optionLabel?t[e.optionLabel]:t},e}return I(e,t),e.prototype.ngOnInit=function(){},e.decorators=[{type:n.Component,args:[{selector:"angular-ui-powerups-select-input",template:'<mat-form-field appearance="standard" [floatLabel]="floatLabel">\n <mat-label *ngIf="label">{{label}}</mat-label>\n <mat-select placeholder="{{placeholder}}"\n [(ngModel)]="valueModel.value"\n [disabled]="!enabled.value"\n (keydown.enter)="notifyEnterKey()"\n (keydown.escape)="notifyEscapeKey()"\n [pectinFocusBinding]="valueModel"\n [errorStateMatcher]="errorStateMatcher"\n >\n <mat-option *ngFor="let option of optionsModel.value" [value]="option">{{optionLabelFormat(option)}}\n </mat-option>\n </mat-select>\n <mat-hint *ngIf="hint">{{hint}}</mat-hint>\n <mat-error *ngIf="hasErrors">{{firstError}}</mat-error>\n</mat-form-field>\n',styles:[":host{display:inline-block}mat-form-field{width:100%}"]}]}],e.ctorParameters=function(){return[]},e.propDecorators={optionsModel:[{type:n.Input}],options:[{type:n.Input}],optionLabel:[{type:n.Input}],optionLabelFormat:[{type:n.Input}]},C([s.UseDelegate(),M("design:type",s.ListModel)],e.prototype,"optionsModel",void 0),C([s.StoreInListModel("optionsModel"),M("design:type",Array)],e.prototype,"options",void 0),e}(A);var k=new n.InjectionToken("InteractionContext"),S=function(){};var B=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e._doneListeners=new s.EventListenerList,e._cancelListeners=new s.EventListenerList,e._finishListeners=new s.EventListenerList,e._busyModel=(new s.DelegatingValueModel).withDefault(!1),e}return I(e,t),e.prototype.onDone=function(t){this._doneListeners.add(t)},e.prototype.onCancel=function(t){this._cancelListeners.add(t)},e.prototype.done=function(t){var e=this;return this._doneListeners.fireAndWait(function(e){return e(t)}).finally(function(){return e.finalizeAndDispose()})},e.prototype.cancel=function(t){var e=this;return this._cancelListeners.fireAndWait(function(e){return e(t)}).finally(function(){return e.finalizeAndDispose()})},e.prototype.finalizeAndDispose=function(){this._finishListeners.fire(function(t){return t()}),[this._finishListeners,this._doneListeners,this._cancelListeners].forEach(function(t){return t.dispose()})},Object.defineProperty(e.prototype,"busy",{get:function(){return this._busyModel.readonly},enumerable:!0,configurable:!0}),e.prototype.busyWhile=function(t){this._busyModel.setDelegate(t)},e.prototype.isBusy=function(){return this._busyModel.value},e}(O);var K=new n.InjectionToken("InteractionActivityData");var N=function(t){function e(e){var n=t.call(this)||this;return n.alert=e,n}return I(e,t),e.prototype.ngOnInit=function(){},e.decorators=[{type:n.Component,args:[{selector:"angular-ui-powerups-alert-dialog",template:'<h3 matDialogTitle *ngIf="alert.title">{{alert.title()}}</h3>\n<div matDialogContent>\n <p *ngFor="let line of alert.content()">{{line}}</p>\n</div>\n<p matDialogActions>\n <button mat-raised-button color="primary" (click)="done()">{{alert.ok()}}</button>\n</p>\n',styles:[":host{display:block;padding:var(--default-padding)}.mat-dialog-actions{justify-content:flex-end}"]}]}],e.ctorParameters=function(){return[{type:void 0,decorators:[{type:n.Inject,args:[K]}]}]},e}(B);var q,V,U=function(t){function e(e){var n=t.call(this)||this;return n.confirm=e,s.assert.notNil(e),console.log(e),n}return I(e,t),e.prototype.ngOnInit=function(){},e.prototype.isDestructive=function(){return this.confirm.destructive&&this.confirm.destructive()},e.decorators=[{type:n.Component,args:[{selector:"angular-ui-powerups-confirmation-dialog",template:'<h3 matDialogTitle *ngIf="confirm.title">{{confirm.title()}}</h3>\n<div matDialogContent>\n <p *ngFor="let line of confirm.content()">{{line}}</p>\n</div>\n<p matDialogActions>\n <button mat-button (click)="cancel()">{{confirm.cancel()}}</button>\n <button mat-raised-button [color]="isDestructive() ? \'warn\' : \'primary\'" (click)="done(true)">{{confirm.ok()}}</button>\n</p>\n\n',styles:[":host{display:block;padding:var(--default-padding)}.mat-dialog-actions{justify-content:flex-end}"]}]}],e.ctorParameters=function(){return[{type:void 0,decorators:[{type:n.Inject,args:[K]}]}]},e}(B);t.ɵo=function(t){function e(){var e=t.call(this)||this;return e.activityTabs=new s.MutableListModel,e.obsoleteTabs=[],e}return I(e,t),e.prototype.ngOnInit=function(){},e.prototype.ngAfterViewInit=function(){var t=this;s.Dsl.disposeWith(this).observe.valuesFrom(this.tabs.animationDone).subscribe(function(){return t.cleanUpTabs()})},e.prototype.initialise=function(t){this.initialActivity=w({},t,{interactionContext:this})},e.prototype.startActivity=function(t,e){var n=this,r=c.Deferred.defer(),o={interactionContext:this,activityClass:t,activityData:e,onDone:r.resolve,onCancel:r.reject};return this.activityTabs.push(o),this.tabs.selectedIndex=this.activityTabs.length,r.promise.finally(function(){n.obsoleteTabs.push(o),n.tabs.selectedIndex=n.activityTabs.length-1})},e.prototype.alert=function(t){return this.startActivity(N,t)},e.prototype.confirm=function(t){return this.startActivity(U,t)},e.prototype.cleanUpTabs=function(){var t=this;this.activityTabs.value=this.activityTabs.value.filter(function(e){return!t.obsoleteTabs.includes(e)})},e.decorators=[{type:n.Component,args:[{selector:"angular-ui-powerups-activity-container",template:'<mat-tab-group #tabs no-tab-header [dynamicHeight]="true">\n <mat-tab>\n <angular-ui-powerups-activity-outlet [interactionContext]="this" [activityContext]="initialActivity"></angular-ui-powerups-activity-outlet>\n </mat-tab>\n <mat-tab *ngFor="let tab of activityTabs.value">\n <angular-ui-powerups-activity-outlet [interactionContext]="this" [activityContext]="tab"></angular-ui-powerups-activity-outlet>\n </mat-tab>\n</mat-tab-group>\n',styles:[":host{display:block}"]}]}],e.ctorParameters=function(){return[]},e.propDecorators={parentInteractionContext:[{type:n.Input}],initialActivity:[{type:n.Input}],tabs:[{type:n.ViewChild,args:["tabs",{static:!0}]}]},e}(O),function(e){function n(){}(t.ɵo||(t.ɵo={})).ActivityContext=n}(),t.ɵv=function(){function t(t,e,n){this.componentFactoryResolver=t,this.viewContainerRef=e,this.injector=n}return Object.defineProperty(t.prototype,"activityContext",{set:function(t){this.loadActivity(t)},enumerable:!0,configurable:!0}),t.prototype.ngOnInit=function(){},t.prototype.loadActivity=function(t){var e=n.Injector.create({providers:[{provide:S,useValue:this},{provide:K,useValue:t.activityData}],parent:this.injector}),r=this.componentFactoryResolver.resolveComponentFactory(t.activityClass);this.viewContainerRef.clear(),this.activityComponent=this.viewContainerRef.createComponent(r,0,e),this.activityComponent.instance.onDone(t.onDone),this.activityComponent.instance.onCancel(t.onCancel)},t.prototype.alert=function(t){return this.interactionContext.alert(t)},t.prototype.confirm=function(t){return this.interactionContext.confirm(t)},t.prototype.startActivity=function(t,e){return this.interactionContext.startActivity(t,e)},t.decorators=[{type:n.Component,args:[{selector:"angular-ui-powerups-activity-outlet",template:"",styles:[":host{display:block}"]}]}],t.ctorParameters=function(){return[{type:n.ComponentFactoryResolver},{type:n.ViewContainerRef},{type:n.Injector}]},t.propDecorators={interactionContext:[{type:n.Input}],activityContext:[{type:n.Input}]},t}(),q=t.ɵv||(t.ɵv={}),V=function(){function t(t){this.context=t}return t.prototype.alert=function(t){return s.lang.notImplemented()},t.prototype.confirm=function(t){return s.lang.notImplemented()},t.prototype.startActivity=function(t,e){return s.lang.notImplemented()},t}(),q.OutletInteractionContext=V;var z=function(e){function r(t){var n=e.call(this)||this;return n.dialogService=t,n}return I(r,e),r.prototype.startActivity=function(t,e){return this._startActivity(t,e)},r.prototype._startActivity=function(e,n,r){var o=this;void 0===r&&(r=!0);var i={data:n,disableClose:r,panelClass:"dialog-interaction-service",autoFocus:!1},a=this.dialogService.open(t.ɵo,i);return new Promise(function(t,r){var i=a.componentInstance;i.parentInteractionContext=o,i.initialise({activityClass:e,activityData:n,onDone:function(e){t(e),a.close(e)},onCancel:function(t){r(t),a.close(t)}}),a.updateSize()})},r.prototype.alert=function(t){return this._startActivity(N,t,!1)},r.prototype.confirm=function(t){return this._startActivity(U,t,!0)},r.decorators=[{type:n.Injectable,args:[{providedIn:"root"}]}],r.ctorParameters=function(){return[{type:o.MatDialog}]},r.ngInjectableDef=n.ɵɵdefineInjectable({factory:function(){return new r(n.ɵɵinject(l.MatDialog))},token:r,providedIn:"root"}),r}(S);var H=function(){function r(){}return r.decorators=[{type:n.NgModule,args:[{imports:[e.CommonModule,o.MatButtonModule,o.MatDialogModule,o.MatTabsModule,u.PortalModule],declarations:[t.ɵo,U,N,t.ɵv],entryComponents:[t.ɵo,U,N],providers:[z]}]}],r}(),G=function(){function t(){}return t.prototype.ngOnInit=function(){},t.decorators=[{type:n.Component,args:[{selector:"aup-busy-overlay",template:'<ng-content></ng-content>\n<div class="busy-overlay-backdrop" *ngIf="busyModel.value">\n <mat-progress-spinner mode="indeterminate" [diameter]="52"></mat-progress-spinner>\n</div>\n',styles:[":host{position:relative}div.busy-overlay-backdrop{position:absolute;background-color:rgba(0,0,0,.2);top:0;left:0;bottom:0;right:0;display:-ms-grid;display:grid;-ms-grid-columns:auto;grid-template-columns:auto;-ms-grid-rows:auto;grid-template-rows:auto;place-content:center}"]}]}],t.ctorParameters=function(){return[]},t.propDecorators={busyModel:[{type:n.Input}],busy:[{type:n.Input}]},C([s.UseDelegatingValueModel(),M("design:type",s.ValueModel)],t.prototype,"busyModel",void 0),C([s.StoreInValueModel("busyModel"),M("design:type",Boolean)],t.prototype,"busy",void 0),t}();var W=function(){function t(){}return t.prototype.ngOnInit=function(){},t.decorators=[{type:n.Component,args:[{selector:"angular-ui-powerups-empty-state",template:'\n <div class="container">\n <ng-content></ng-content>\n </div>\n ',styles:[":host{display:flex;flex-direction:column;justify-content:center;align-items:center}.container{padding:var(--default-padding);border:2px dashed rgba(0,0,0,.2);border-radius:5px;font-size:14px;font-weight:300}"]}]}],t.ctorParameters=function(){return[]},t}(),Y=function(){function t(){this._activePlaces=new s.MutableListModel}return Object.defineProperty(t.prototype,"activePlaces",{get:function(){return this._activePlaces.readonly},enumerable:!0,configurable:!0}),t.prototype.onActivate=function(t){this._activePlaces.push(t)},t.prototype.onDeactivate=function(t){this._activePlaces.remove(t)},t.decorators=[{type:n.Injectable,args:[{providedIn:"root"}]}],t.ctorParameters=function(){return[]},t.ngInjectableDef=n.ɵɵdefineInjectable({factory:function(){return new t},token:t,providedIn:"root"}),C([s.Trace(),M("design:type",Function),M("design:paramtypes",[Object]),M("design:returntype",void 0)],t.prototype,"onActivate",null),C([s.Trace(),M("design:type",Function),M("design:paramtypes",[Object]),M("design:returntype",void 0)],t.prototype,"onDeactivate",null),t}();var Z=function(){function t(t){this.placeService=t}return t.prototype.ngOnInit=function(){},t.prototype.onActivate=function(t){this.placeService.onActivate(t)},t.prototype.onDeactivate=function(t){this.placeService.onDeactivate(t)},t.decorators=[{type:n.Component,args:[{selector:"angular-ui-powerups-place-outlet",template:'<router-outlet (activate)="onActivate($event)" (deactivate)="onDeactivate($event)"></router-outlet>\n',styles:[":host{grid-area:main;display:-ms-grid;display:grid;-ms-grid-rows:0 1fr;grid-template-rows:0 1fr;min-height:0}"]}]}],t.ctorParameters=function(){return[{type:Y}]},t}();var $=function(){function t(){}return t.decorators=[{type:n.NgModule,args:[{imports:[e.CommonModule,o.MatProgressSpinnerModule,p.RouterModule],declarations:[W,G,Z],entryComponents:[G],exports:[G,Z,W],providers:[Y]}]}],t}(),J=function(){function t(){}return t.decorators=[{type:n.NgModule,args:[{declarations:[F,T,j,L,_,x],imports:[e.CommonModule,i.BrowserModule,a.BrowserAnimationsModule,r.FormsModule,o.MatInputModule,o.MatFormFieldModule,o.MatSelectModule,$,H],exports:[F,T,j,L,_,x,H,$]}]}],t}(),X=f.style({opacity:0,height:"0",paddingTop:"0",paddingBottom:"0"});var Q=function(t,e){this.width=t,this.height=e};var tt,et=function(){function t(t,e){this.x=t,this.y=e}return t.from=function(e){return new t(e.x,e.y)},t.prototype.translate=function(e,n){return new t(this.x+e,this.y+n)},t}();t.Bounds=function(t){function e(e,n,r,o){var i=t.call(this,r,o)||this;return i.top=e,i.left=n,i.width=r,i.height=o,i}return I(e,t),e.prototype.relativePositionOf=function(t){return t instanceof MouseEvent?new et(t.clientX-this.left,t.clientY-this.top):new et(t.x-this.left,t.y-this.top)},e}(Q),(tt=t.Bounds||(t.Bounds={})).ofElement=function(t){var e=t.getBoundingClientRect();return new tt(e.top,e.left,e.width,e.height)};var nt=function(e){function n(n,r){var o=e.call(this)||this;return o.elementRef=n,o.ngZone=r,o._boundsModel=new s.ValueHolder(new t.Bounds(0,0,0,0)),o}return I(n,e),n.prototype.ngAfterViewInit=function(){var t=this;this.updateBounds();var e=this.elementRef.nativeElement,n=new d(function(e,n){t.ngZone.run(function(){return t.updateBounds()})});n.observe(e),this.onDispose(function(){return n.disconnect()})},Object.defineProperty(n.prototype,"boundsModel",{get:function(){return this._boundsModel.readonly},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"nativeElement",{get:function(){return this.elementRef.nativeElement},enumerable:!0,configurable:!0}),n.prototype.relativePositionOf=function(t){return this.bounds.relativePositionOf(t)},Object.defineProperty(n.prototype,"bounds",{get:function(){return this._boundsModel.value},enumerable:!0,configurable:!0}),n.prototype.updateBounds=function(){this._boundsModel.value=t.Bounds.ofElement(this.nativeElement)},n}(O);function rt(){}function ot(t){return function(e){Reflect.defineMetadata("place.options",t,e)}}(function(t){function e(){}t.Callback=e})(rt||(rt={})),function(t){function e(){}t.Options=e;var n=function(t,e){s.assert.notNil(e),this.path=e.path,this.title=e.title,this.authenticate=y.isNil(e.authenticate)||e.authenticate};t.Descriptor=n,t.getDescriptor=function(t){var e=Reflect.getMetadata("place.options",t);return new n(t,e)}}(ot||(ot={}));var it=function(){function t(t){this.parameters=t}return t.prototype.get=function(t){var e=this.parameters.find(function(e){return e.parameter===t});return e?e.resolvedValue:null},t.prototype.replace=function(e,n){return new t(this.parameters.filter(function(t){return t.parameter!==e}).concat({parameter:e,resolvedValue:n}))},t.prototype.getFormattedRouteId=function(){var t=this.getRouteIdParam();return t?t.parameter.type.format(t.resolvedValue):null},t.prototype.getRouteIdParam=function(){return this.parameters.find(function(t){return t.parameter.isRouteId})},t.prototype.getFormattedParameters=function(){var t={};this.parameters.filter(function(t){return!t.parameter.isRouteId}).forEach(function(e){t[e.parameter.name]=e.parameter.type.format(e.resolvedValue)});return t},t.prototype.hasRouteId=function(){return!!this.getRouteIdParam()},t.prototype.redirect=function(t,e,n){var r=this.getFormattedRouteId(),o=t.hasRouteId()?"..":".",i=r?[o,r,this.getFormattedParameters()]:[o,this.getFormattedParameters()];e.navigate(i,{relativeTo:n})},C([s.Trace(),M("design:type",Function),M("design:paramtypes",[]),M("design:returntype",void 0)],t.prototype,"getFormattedRouteId",null),C([s.Trace(),M("design:type",Function),M("design:paramtypes",[]),M("design:returntype",void 0)],t.prototype,"getFormattedParameters",null),C([s.Trace(),M("design:type",Function),M("design:paramtypes",[t,p.Router,p.ActivatedRoute]),M("design:returntype",void 0)],t.prototype,"redirect",null),t}();t.RouteParameterBindings=function(t){function e(n,r,o){var i=t.call(this)||this;i.component=n,i.router=r,i.activatedRoute=o,i._incomingRouteChange=new s.MutableValueModel(!1),i.resolvedParameters=new s.MutableValueModel;var a=s.Dsl.disposeWith(i),u=(a.chain,a.valueOf,a.before,a.when),c=(a.after,a.observe);i.txo=new s.TransactionObserver;var l=h.Klass.get(n).getMetadataList(e.ROUTE_PARAMETER_LIST_KEY);l.forEach(function(t){return i.installBinding(t)});var p=c.valuesFrom(o.paramMap).last().map(function(t){var e=[];return l.forEach(function(n){e.push({parameter:n,resolvedValue:n.type.parse(t.get(n.name))})}),new it(e)});return p.subscribe(function(t){i._incomingRouteChange.value=!0,i.resolvedParameters.value=t,i._incomingRouteChange.value=!1}),u.valueOf(i.resolvedParameters).changes(function(t,e){t.redirect(e,r,o)},{unless:i.incomingRouteChange}),i.txo.observe("incomingResolvedRouteParameters",p),i.txo.observe("this.routeIsChanging",i.incomingRouteChange),i}return I(e,t),Object.defineProperty(e.prototype,"incomingRouteChange",{get:function(){return this._incomingRouteChange.readonly},enumerable:!0,configurable:!0}),e.prototype.installBinding=function(t){var e=this.getModelFor(t);this.txo.observe(t.propertyName,e),this.registerDisposable(new s.Binding(this.resolvedParameters,e,{toRight:function(e){return e.get(t)},toLeft:function(e,n){return n.replace(t,e)}}))},e.prototype.getModelFor=function(t){return this.component[t.propertyName]},e}(s.GarbageCollector),(t.RouteParameterBindings||(t.RouteParameterBindings={})).ROUTE_PARAMETER_LIST_KEY=Symbol("place:route:parameters");var at=function(e){function n(n,r){var o=e.call(this)||this;return o.activatedRoute=n,o.routeBindingMediator=o.registerDisposable(new t.RouteParameterBindings(o,r,n)),o.titleModel.setDefault(o.placeConfig.title),o}return I(n,e),Object.defineProperty(n.prototype,"placeConfig",{get:function(){return ot.getDescriptor(this.constructor)},enumerable:!0,configurable:!0}),n.prototype.canDeactivate=function(){return!0},C([s.UseDelegate(),M("design:type",s.MutableValueModel)],n.prototype,"titleModel",void 0),C([m.Memoize(),M("design:type",ot.Descriptor),M("design:paramtypes",[])],n.prototype,"placeConfig",null),n}(O);var st=function(){function t(t,e){this.router=t,this.injector=e}return t.prototype.canDeactivate=function(t,e,n,r){return t.canDeactivate()},t.decorators=[{type:n.Injectable,args:[{providedIn:"root"}]}],t.ctorParameters=function(){return[{type:p.Router},{type:n.Injector}]},t.ngInjectableDef=n.ɵɵdefineInjectable({factory:function(){return new t(n.ɵɵinject(p.Router),n.ɵɵinject(n.INJECTOR))},token:t,providedIn:"root"}),t}();var ut=function(){function t(t,e){this.parameterDefs=t,this.injector=e,this.sanitisedParameters=[],this.routeParameter=t.find(function(t){return t.isRouteId}),this.queryParameters=t.filter(function(t){return!t.isRouteId})}return t.prototype.sanitise=function(t){return P(this,void 0,void 0,function(){var e,n,r,o,i,a;return R(this,function(s){switch(s.label){case 0:return this.routeParameter?[4,this.sanitiseParameter(this.routeParameter,t.paramMap.get(this.routeParameter.name))]:[3,2];case 1:if(!s.sent())return[2,!1];s.label=2;case 2:s.trys.push([2,7,8,9]),r=E(this.queryParameters),o=r.next(),s.label=3;case 3:return o.done?[3,6]:(i=o.value,[4,this.sanitiseParameter(i,t.queryParamMap.get(i.name))]);case 4:s.sent(),s.label=5;case 5:return o=r.next(),[3,3];case 6:return[3,9];case 7:return a=s.sent(),e={error:a},[3,9];case 8:try{o&&!o.done&&(n=r.return)&&n.call(r)}finally{if(e)throw e.error}return[7];case 9:return[2,0===this.sanitisedParameters.length]}})})},t.prototype.sanitiseParameter=function(t,e){return P(this,void 0,void 0,function(){var n,r,o;return R(this,function(i){switch(i.label){case 0:return t&&(n=this.getSanitiser(t))?(r=t.type.parse(e),[4,n.sanitise(r)]):[3,2];case 1:if(o=i.sent(),r!==o)return this.sanitisedParameters.push({def:t,value:t.type.format(o)}),[2,!1];i.label=2;case 2:return[2,!0]}})})},t.prototype.redirect=function(t){var e=this;s.assert.isTruthy(0!==this.sanitisedParameters.length);var n=this.sanitisedParameters.find(function(t){return t.def===e.routeParameter});if(n)return t.navigate(["..",n.value]);var r=this.sanitisedParameters.filter(function(t){return t.def!==e.routeParameter}).reduce(function(t,e){var n;return w({},t,((n={})[e.def.name]=e.value,n))},{});return t.navigate([".",r])},t.prototype.getSanitiser=function(t){return t.sanitiser?this.injector.get(t.sanitiser,new t.sanitiser):null},C([s.Trace(),M("design:type",Function),M("design:paramtypes",[Object,String]),M("design:returntype",Promise)],t.prototype,"sanitiseParameter",null),C([v.Memoize(),M("design:type",Function),M("design:paramtypes",[Object]),M("design:returntype",Object)],t.prototype,"getSanitiser",null),t}();var ct,lt,pt,ft=function(){function e(t,e){this.router=t,this.injector=e}return e.prototype.canActivate=function(e,n){var r=this,o=h.Klass.get(e.component).getMetadataList(t.RouteParameterBindings.ROUTE_PARAMETER_LIST_KEY),i=new ut(o,this.injector);return i.sanitise(e).then(function(t){return t||i.redirect(r.router),t})},e.decorators=[{type:n.Injectable,args:[{providedIn:"root"}]}],e.ctorParameters=function(){return[{type:p.Router},{type:n.Injector}]},e.ngInjectableDef=n.ɵɵdefineInjectable({factory:function(){return new e(n.ɵɵinject(p.Router),n.ɵɵinject(n.INJECTOR))},token:e,providedIn:"root"}),C([s.Trace(),M("design:type",Function),M("design:paramtypes",[p.ActivatedRouteSnapshot,p.RouterStateSnapshot]),M("design:returntype",Object)],e.prototype,"canActivate",null),e}();function dt(t,e,n,r){var o=h.Opts.get(n),i=s.assert.notNil(t).toString();return{name:o.getOptional("as",i),propertyName:i,type:s.assert.notNil(e),sanitiser:o.getOptional("sanitiser",null),isRouteId:r}}ct=t.ParameterType||(t.ParameterType={}),lt=function(){function t(){}return t.prototype.format=function(t){return t},t.prototype.parse=function(t){return t},t}(),pt=function(){function t(){}return t.prototype.format=function(t){return""+t},t.prototype.parse=function(t){return+t},t}(),ct.STRING=new lt,ct.NUMBER=new pt,t.ACTIVITY_DATA=K,t.AbstractActivity=B,t.AbstractInputComponent=A,t.AbstractPlaceComponent=at,t.ActivityContainerComponent=t.ɵo,t.ActivityOutletComponent=t.ɵv,t.AlertDialogComponent=N,t.AngularUiPowerupsModule=J,t.BusyOverlayComponent=G,t.CommandDirective=F,t.ConfirmationDialogComponent=U,t.DialogInteractionService=z,t.Dimension=Q,t.DisposableComponent=O,t.EmptyStateComponent=W,t.FocusBindingDirective=T,t.INTERACTION_CONTEXT=k,t.InteractionContext=S,t.InteractionModule=H,t.LeavePlaceGuard=st,t.NumberInputComponent=j,t.PasswordInputComponent=_,t.Place=ot,t.PlaceModule=$,t.PlaceOutletComponent=Z,t.PlaceRouteGuard=ft,t.PlaceService=Y,t.Point=et,t.QueryParameter=function(e,n){return function(r,o){var i=dt(o,e,n,!1);h.Klass.get(r).addToOwnMetadataList(t.RouteParameterBindings.ROUTE_PARAMETER_LIST_KEY,i),s.UseDelegate()(r,o)}},t.ResizeAwareComponent=nt,t.RouteId=function(e,n){return function(r,o){var i=dt(o,e,n,!0);h.Klass.get(r).addToOwnMetadataList(t.RouteParameterBindings.ROUTE_PARAMETER_LIST_KEY,i),s.UseDelegate()(r,o)}},t.RouteParameterSanitiser=ut,t.SelectInputComponent=x,t.StringInputComponent=L,t.slideDownAndUpAnimation=function(t,e){s.OptionsHelper.get(e).getOptional("duration","100ms");var n=s.OptionsHelper.get(e).getOptional("hiddenStyleDef",X);return f.trigger(t,[f.transition(":enter",[n,f.animate("100ms")]),f.transition(":leave",[f.animate("100ms",n)])])},t.ɵa=F,t.ɵb=T,t.ɵc=O,t.ɵd=j,t.ɵe=A,t.ɵf=L,t.ɵg=_,t.ɵh=x,t.ɵi=$,t.ɵj=W,t.ɵk=G,t.ɵl=Z,t.ɵm=Y,t.ɵn=H,t.ɵp=U,t.ɵq=B,t.ɵr=K,t.ɵt=N,t.ɵw=z,t.ɵx=S,Object.defineProperty(t,"__esModule",{value:!0})});
2
2
  //# sourceMappingURL=coolon-angular-ui-powerups.umd.min.js.map